Commit Graph

231 Commits

Author SHA1 Message Date
Frane Polić
4dd11c8867 fix(admin-ui): modal pointer events (#5113) 2023-09-18 15:07:59 +02:00
olivermrbl
7dcb82468f chore: Release 2023-09-15 17:14:26 +02:00
Kasper Fabricius Kristensen
cb67760f71 fix(admin,admin-ui): copy public folder as part of admin build (#5057)
**What**
- Copies `/public` folder into Admin build
- Updates the version of `dotenv` to match the version used in other Medusa dependencies. This will prevent errors when trying to link the `admin` package into a local repository for testing.
2023-09-15 09:47:11 +00:00
Geoffroy Empain
afd4e72cdf feat(admin-ui): Multi-language support (#4962) 2023-09-12 14:53:48 +02:00
Adrien de Peretti
6273b4b160 feat(utils, module-sdk, medusa): Extract pg connection utils to utils package (#4961) 2023-09-11 12:10:40 +02:00
olivermrbl
40d9c9479c chore: Release 2023-09-08 14:27:56 +02:00
Oli Juhl
d3d8f0bf58 chore(admin, medusa-payment-stripe): Fix deps (#4987) 2023-09-08 13:55:03 +02:00
Riqwan Thamir
c3dba06948 fix(modules-sdk, orchestration): add missing dependencies + fix default handling in medusa-app & remote query (#4930) 2023-09-07 07:53:46 +00:00
Riqwan Thamir
87bade096e fix(utils, product, pricing, link-modules): add missing dependencies for utils + fix migration path issue (#4915)
* fix: add missing dependencies for utils

* chore: migration path is set from the calling package

* chore: update changeset
2023-08-31 09:16:02 +02:00
Carlos R. L. Rodrigues
4d16acf5f0 feat(link-modules,modules-sdk, utils, types, products) - Remote Link and Link modules (#4695)
What:
- Definition of all Modules links
- `link-modules` package to manage the creation of all pre-defined link or custom ones

```typescript
import { initialize as iniInventory } from "@medusajs/inventory";
import { initialize as iniProduct } from "@medusajs/product";

import {
  initialize as iniLinks,
  runMigrations as migrateLinks
} from "@medusajs/link-modules";

await Promise.all([iniInventory(), iniProduct()]);


await migrateLinks(); // create tables based on previous loaded modules

await iniLinks(); // load link based on previous loaded modules

await iniLinks(undefined, [
  {
    serviceName: "product_custom_translation_service_link",
    isLink: true,
    databaseConfig: {
      tableName: "product_transalations",
    },
    alias: [
      {
        name: "translations",
      },
    ],
    primaryKeys: ["id", "product_id", "translation_id"],
    relationships: [
      {
        serviceName: Modules.PRODUCT,
        primaryKey: "id",
        foreignKey: "product_id",
        alias: "product",
      },
      {
        serviceName: "custom_translation_service",
        primaryKey: "id",
        foreignKey: "translation_id",
        alias: "transalation",
        deleteCascade: true,
      },
    ],
    extends: [
      {
        serviceName: Modules.PRODUCT,
        relationship: {
          serviceName: "product_custom_translation_service_link",
          primaryKey: "product_id",
          foreignKey: "id",
          alias: "translations",
          isList: true,
        },
      },
      {
        serviceName: "custom_translation_service",
        relationship: {
          serviceName: "product_custom_translation_service_link",
          primaryKey: "product_id",
          foreignKey: "id",
          alias: "product_link",
        },
      },
    ],
  },
]); // custom links
```

Remote Link

```typescript
import { RemoteLink, Modules } from "@medusajs/modules-sdk";

// [...] initialize modules and links

const remoteLink = new RemoteLink();

// upsert the relationship
await remoteLink.create({ // one (object) or many (array)
  [Modules.PRODUCT]: {
    variant_id: "var_abc",
  },
  [Modules.INVENTORY]: {
    inventory_item_id: "iitem_abc",
  },
  data: { // optional additional fields
    required_quantity: 5
  }
});

// dismiss (doesn't cascade)
await remoteLink.dismiss({ // one (object) or many (array)
  [Modules.PRODUCT]: {
    variant_id: "var_abc",
  },
  [Modules.INVENTORY]: {
    inventory_item_id: "iitem_abc",
  },
});

// delete
await remoteLink.delete({
  // every key is a module
  [Modules.PRODUCT]: {
    // every key is a linkable field
    variant_id: "var_abc", // single or multiple values
  },
});

// restore
await remoteLink.restore({
  // every key is a module
  [Modules.PRODUCT]: {
    // every key is a linkable field
    variant_id: "var_abc", // single or multiple values
  },
});

```

Co-authored-by: Riqwan Thamir <5105988+riqwan@users.noreply.github.com>
2023-08-30 14:31:32 +00:00
Riqwan Thamir
460161a69f feat(pricing, types, utils, medusa-sdk): Pricing Module Setup + Currency (#4860)
What:

- Setups the skeleton for pricing module
- Creates service/model/repository for currency model
- Setups types
- Setups DB
- Moved some utils to a common place

RESOLVES CORE-1477
RESOLVES CORE-1476
2023-08-29 21:58:34 +00:00
Lacey Pevey
046b0dcfa5 chore(medusa-file-s3): Add cache-control option + update to sdk v3 (#4884)
* add cache-control option, fix delete function, update to sdk v3

* Create cool-pears-trade.md

* reformat throw line, remove dev comment

* remove console.log debugging statement

---------

Co-authored-by: Oli Juhl <59018053+olivermrbl@users.noreply.github.com>
2023-08-29 19:25:17 +02:00
Oli Juhl
af09a4b7b4 fix(medusa-file-*): Add types as devDeps (#4871) 2023-08-27 16:32:59 +02:00
olivermrbl
d7e435650a chore: Release 2023-08-25 16:24:58 +02:00
Oli Juhl
f28fa6a7b3 chore(admin): Add caret range to peer deps (#4865) 2023-08-25 16:07:43 +02:00
Shahed Nasser
c58588904c fix(medusa-telemetry): added missing babel dependencies (#4817) 2023-08-23 14:26:06 +02:00
olivermrbl
8a43a6bc1d chore: Bump @medusajs/utils + @medusajs/product 2023-08-22 15:46:59 +02:00
olivermrbl
ecb4910312 chore: Release 2023-08-17 17:19:27 +02:00
Kasper Fabricius Kristensen
1e8d044b16 add versions (#4795) 2023-08-17 17:10:40 +02:00
Kasper Fabricius Kristensen
f1a05f4725 feat(admin, admin-ui, medusa-js, medusa-react, medusa): Support Admin Extensions (#4761)
Co-authored-by: Rares Stefan <948623+StephixOne@users.noreply.github.com>
Co-authored-by: Oli Juhl <59018053+olivermrbl@users.noreply.github.com>
2023-08-17 12:14:45 +00:00
Shahed Nasser
914d773d3a api-ref: custom API reference (#4770)
* initialized next.js project

* finished markdown sections

* added operation schema component

* change page metadata

* eslint fixes

* fixes related to deployment

* added response schema

* resolve max stack issue

* support for different property types

* added support for property types

* added loading for components

* added more loading

* type fixes

* added oneOf type

* removed console

* fix replace with push

* refactored everything

* use static content for description

* fixes and improvements

* added code examples section

* fix path name

* optimizations

* fixed tag navigation

* add support for admin and store references

* general enhancements

* optimizations and fixes

* fixes and enhancements

* added search bar

* loading enhancements

* added loading

* added code blocks

* added margin top

* add empty response text

* fixed oneOf parameters

* added path and query parameters

* general fixes

* added base path env variable

* small fix for arrays

* enhancements

* design enhancements

* general enhancements

* fix isRequired

* added enum values

* enhancements

* general fixes

* general fixes

* changed oas generation script

* additions to the introduction section

* added copy button for code + other enhancements

* fix response code block

* fix metadata

* formatted store introduction

* move sidebar logic to Tags component

* added test env variables

* fix code block bug

* added loading animation

* added expand param + loading

* enhance operation loading

* made responsive + improvements

* added loading provider

* fixed loading

* adjustments for small devices

* added sidebar label for endpoints

* added feedback component

* fixed analytics

* general fixes

* listen to scroll for other headings

* added sample env file

* update api ref files + support new fields

* fix for external docs link

* added new sections

* fix last item in sidebar not showing

* move docs content to www/docs

* change redirect url

* revert change

* resolve build errors

* configure rewrites

* changed to environment variable url

* revert changing environment variable name

* add environment variable for API path

* fix links

* fix tailwind settings

* remove vercel file

* reconfigured api route

* move api page under api

* fix page metadata

* fix external link in navigation bar

* update api spec

* updated api specs

* fixed google lint error

* add max-height on request samples

* add padding before loading

* fix for one of name

* fix undefined types

* general fixes

* remove response schema example

* redesigned navigation bar

* redesigned sidebar

* fixed up paddings

* added feedback component + report issue

* fixed up typography, padding, and general styling

* redesigned code blocks

* optimization

* added error timeout

* fixes

* added indexing with algolia + fixes

* fix errors with algolia script

* redesign operation sections

* fix heading scroll

* design fixes

* fix padding

* fix padding + scroll issues

* fix scroll issues

* improve scroll performance

* fixes for safari

* optimization and fixes

* fixes to docs + details animation

* padding fixes for code block

* added tab animation

* fixed incorrect link

* added selection styling

* fix lint errors

* redesigned details component

* added detailed feedback form

* api reference fixes

* fix tabs

* upgrade + fixes

* updated documentation links

* optimizations to sidebar items

* fix spacing in sidebar item

* optimizations and fixes

* fix endpoint path styling

* remove margin

* final fixes

* change margin on small devices

* generated OAS

* fixes for mobile

* added feedback modal

* optimize dark mode button

* fixed color mode useeffect

* minimize dom size

* use new style system

* radius and spacing design system

* design fixes

* fix eslint errors

* added meta files

* change cron schedule

* fix docusaurus configurations

* added operating system to feedback data

* change content directory name

* fixes to contribution guidelines

* revert renaming content

* added api-reference to documentation workflow

* fixes for search

* added dark mode + fixes

* oas fixes

* handle bugs

* added code examples for clients

* changed tooltip text

* change authentication to card

* change page title based on selected section

* redesigned mobile navbar

* fix icon colors

* fix key colors

* fix medusa-js installation command

* change external regex in algolia

* change changeset

* fix padding on mobile

* fix hydration error

* update depedencies
2023-08-15 18:07:54 +03:00
Shahed Nasser
30ce35b163 feat(create-medusa-app): add database options (#4733)
## What

Adds new options for easier usage of the `create-medusa-app` command for regular medusa users.

The following options are added:

- `--skip-db`: Skips creating the database, running migrations, and seeding, and subsequently skips opening the browser. Useful if the developer wants to set the database URL at a later point in the configurations.
- `--db-url <url>`:  Skips database creation and sets the database URL to the provided URL. Throws an error if can't connect to the database. Will still run migrations and open the admin after project creation. Useful if the developer already has database created, locally or remotely.
- `--no-migrations`: Skips running migrations, creating admin user, and seeding. If used, it's expected that you pass the `--db-url` option with a url of a database that has all necessary migrations. Otherwise, unexpected errors will occur. Helpful only if combined with `--db-url`
- `--no-browser`: Disables opening the browser at the end of the project creation and only shows success message.
- `--directory-path <path>`: Allows specifying the directory path to install the project in. Useful for testing.
2023-08-15 08:08:54 +00:00
Adrien de Peretti
3f3a84262c feat(types, product, utils, medusa): Include shared connection for modules (#4626) 2023-08-08 15:10:34 +00:00
olivermrbl
755f9cf307 chore: Update lock file 2023-08-07 13:48:05 +02:00
olivermrbl
f2c854fc0d chore(medusa): Replace workspace version 2023-08-07 13:02:53 +02:00
Adrien de Peretti
dc46927bc6 feat(medusa, types, utils, workflow): Migrate medusa workflow to the workflow package (#4682) 2023-08-05 16:03:45 +02:00
Lacey Pevey
9c682ce288 chore(medusa): Update request-ip dependency version (#4636)
This updates the request-ip package dependency in @medusajs/medusa.

This resolves the critical security warnings seen when creating a new medusa backend OTHER THAN medusa-admin related issues.  Because the admin is undergoing an extensive rewrite, I didn't address the older version of node-fetch that is at the root of those issues.

Co-authored-by: Oli Juhl <59018053+olivermrbl@users.noreply.github.com>
2023-08-02 15:29:12 +00:00
Adrien de Peretti
58d4c230e2 chore: include rimraf as part of the build for most of the packages (#4615)
* chore: include rimraf as part of the build for most of the packages

* cleanup

* revert medusa interface

* missing script update
2023-07-31 09:23:27 +02:00
olivermrbl
375447155d chore: Release 2023-07-27 17:17:24 +02:00
olivermrbl
7d3630f366 chore: Release 2023-07-27 13:24:35 +02:00
Carlos R. L. Rodrigues
f12299deb1 Feat: @medusajs/workflows (#4553)
feat: medusa workflows
2023-07-25 10:13:14 -03:00
Adrien de Peretti
d2a8cf0378 feat(medusa): Continue create product workflow changes (#4473) 2023-07-24 13:30:24 +02:00
Carlos R. L. Rodrigues
5a8a889c6d feat(modules-sdk): Remote Query (#4463)
* feat: Remote Query
2023-07-19 15:35:36 -03:00
olivermrbl
95c538c675 chore: Release 2023-07-19 18:10:52 +02:00
Adrien de Peretti
befc2f1c80 feat(product): Create (+ workflow), delete, restore (#4459)
* Feat: create product with product module

* feat: create product wip

* feat: create product wip

* feat: update product relation and generate image migration

* lint

* conitnue implementation

* continue implementation and add integration tests for produceService.create

* Add integration tests for product creation at the module level for the complete flow

* only use persist since write operations are always wrapped in a transaction which will be committed and flushed

* simplify the transaction wrapper to make future changes easier

* feat: move some utils to the utils package to simplify its usage

* tests: fix unit tests

* feat: create variants along side the product

* Add more integration tests an update migrations

* chore: Update actions workflow to include packages integration tests

* small types and utils cleanup

* chore: Add support for database debug option

* chore: Add missing types in package.json from types and util, validate that all the models are sync with medusa

* expose retrieve method

* fix types issues

* fix unit tests and move integration tests workflow with the plugins integration tests

* chore: remove migration function export from the definition to prevent them to be ran by the medusa cli just in case

* fix package.json script

* chore: workflows

* feat: start creating the create product workflow

* feat: add empty step for prices and sales channel

* tests: update scripts and action envs

* fix imports

* feat: Add proper soft deleted support + add product deletion service public api

* chore: update migrations

* chore: update migrations

* chore: update todo

* feat: Add product deletion to the create-product workflow as compensation

* chore: cleanup product utils

* feat: Add support for cascade soft-remove

* feat: refactor repository to take into account withDeleted

* fix integration tests

* Add support for force delete -> delete, cleanup repositories and improvements

* Add support for restoring a product and add integration tests

* cleaup + tests

* types

* fix integration tests

* remove unnecessary comments

* move specific mikro orm usage to the DAL

* Cleanup workflow functions

* Make deleted_at optional at the property level and add url index for the images

* address feedback + cleanup

* fix export

* merge migrations into one

* feat(product, types): added missing product variant methods (#4475)

* chore: added missing product variant methods

* chore: address PR feedback

* chore: catch undefined case for retrieve + specs for variant service

* chore: align TEntity + add changeset

* chore: revert changeset, TEntity to ProductVariant

* chore: write tests for pagination, unskip the test

* Create chilled-mice-deliver.md

* update integration fixtuers

* update pipeline node version

* rename github action

* fix pipeline

* feat(medusa, types): added missing category tests and service methods (#4499)

* chore: added missing category tests and service methods

* chore: added type changes to module service

* chore: address pr feedback

* update repositories manager usage and serialisation from the write public API

* move serializisation to the DAL

* rename template args

* chore: added collection methods for module and collection service (#4505)

* chore: added collection methods for module and collection service

* Create fresh-islands-teach.md

* chore: move retrieve entity to utils package

* chore: make products optional in DTO type

---------

Co-authored-by: Oliver Windall Juhl <59018053+olivermrbl@users.noreply.github.com>

* feat(product): Apply transaction decorators to the services (#4512)

---------

Co-authored-by: Riqwan Thamir <rmthamir@gmail.com>
Co-authored-by: Oliver Windall Juhl <59018053+olivermrbl@users.noreply.github.com>
Co-authored-by: Carlos R. L. Rodrigues <37986729+carlos-r-l-rodrigues@users.noreply.github.com>
2023-07-16 20:19:23 +02:00
olivermrbl
9fe430ba7e chore: Release 2023-07-11 20:43:53 +02:00
Adrien de Peretti
d363da2b72 chore(create-medusa-app): Cleanup the main script for readability and maintanability (#4369)
* chore(create-medusa-app): Cleanup the main script for readability and maintanability

* update types

* cleanup

* Create polite-queens-kiss.md
2023-07-10 16:27:16 +02:00
Carlos R. L. Rodrigues
499c3478c9 feat: Remote Joiner (#4098) 2023-06-29 15:29:01 +02:00
Adrien de Peretti
6f1fa244fa chore(medusa-cli): Cleanup plugin setup (#4420)
* chore(medusa-cli): Cleanup plugin setup

* fix: logger types

* fix event bus local

* fix event bus redis

* Create late-dragons-collect.md

* move to ts

* remove unused command

* env

* fix
2023-06-28 16:37:25 +02:00
Adrien de Peretti
5a4580b6a8 chore(medusa-dev-cli): Cleanup plugin setup (#4421)
FIXES CORE-1420

does not include ts migration
2023-06-28 11:32:05 +00:00
Adrien de Peretti
627bdb689f chore(gatsby-source-medusa): Cleanup plugin setup (#4419)
* chore(gatsby-source-medusa): Cleanup plugin setup

* fix process-node

* Create gentle-cups-crash.md
2023-06-27 14:00:11 +02:00
olivermrbl
befa3b83f8 chore: Release 2023-06-19 16:34:14 +02:00
olivermrbl
d88a57fd9c chore: Release 2023-06-18 13:26:47 +02:00
Shahed Nasser
e1f43fd207 chore(create-medusa-app, product, utils, medusa-cli): Resolve string-width dep issue (#4328) 2023-06-16 11:31:23 +02:00
Adrien de Peretti
30d89044f1 fix(product): The bin scripts should include a shebang and import in the body (#4296) 2023-06-15 19:42:49 +02:00
Shahed Nasser
f98ba5bde8 feat(create-medusa-app,medusa-cli): Allow clearing project (#4273)
- Added build step
- Added `--no-boilerplate` option to `create-medusa-app` to allow clearing onboarding files
- Clear project files by default in medusa-cli
2023-06-15 17:31:30 +00:00
olivermrbl
c95b485a1e chore: Use specific typeorm versions 2023-06-15 18:30:58 +02:00
Oliver Windall Juhl
9b42387fd3 chore: Add missing deps (#4317) 2023-06-15 18:27:31 +02:00
Oliver Windall Juhl
afd1b67f1c chore: Clean up deps, devDeps, and peerDeps across all packages (#4276)
* chore: Use caret for all Medusa deps

* Create wild-balloons-push.md

* Address PR feedback

* force build order

* add missing dep

* add missing dev deps

* addresses last comments
2023-06-14 15:18:11 +02:00
Adrien de Peretti
02b1bd07cd fix(medusa): Query parser issues with large array (#4213)
* fix(medusa): Query parser issues with large array

* Create little-weeks-exercise.md

* add integration tests
2023-06-14 13:36:04 +02:00