Commit Graph

95 Commits

Author SHA1 Message Date
github-actions[bot]
16851c557d chore: Version Packages (#6241)
Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>
2024-02-08 16:23:19 +01:00
Adrien de Peretti
12054f5c01 feat: Fulfillment module basic structure (#6319)
**What**
Scafold the fulfillment module basic structure

**Bonus**
Simplified module scaffolding with new factories and less directories to manage
- mikro orm connection loader factory
- initialize factory

FIXES CORE-1709
FIXES CORE-1710
2024-02-06 13:29:36 +00:00
Philip Korsholm
b2eaac8cb1 feat(user): Init user module (#6293)
* init user module

* add migration

* update module with latest utils

* pr ready

* make interface types interfaces
2024-02-06 11:10:54 +08:00
Oli Juhl
823b98aaa1 feat: Region Module (basic CRUD) (#6315) 2024-02-05 16:03:26 +00:00
Carlos R. L. Rodrigues
884428a1b5 feat: event aggregator (#6218)
What:
- Event Aggregator Util
- Preparation for normalizing event in a new format (backward compatible with the current format)
- GQL Schema to joiner config and some Entities configured
- Link modules emmiting events
2024-02-05 11:59:10 +00:00
Carlos R. L. Rodrigues
96ba49329b fix: load custom modules by path (#6312)
What:
medusa-config.js loading custom modules by their path.

```typescript
{
  modules: {
    internalModule: {
      scope: MODULE_SCOPE.INTERNAL,
      resources: MODULE_RESOURCE_TYPE.SHARED,
      resolve: "./internal_module",
      definition: {
        key: "internalModule",
        registrationName: "internalModule",
      },
    },
  }
}
```
2024-02-04 14:26:34 +00:00
Oli Juhl
3a103f0c36 feat(modules-sdk): Module provider plugin loader (#6286) 2024-02-01 17:03:31 +01:00
Carlos R. L. Rodrigues
45134e4d11 chore: local workflow proxying methods to pass context (#6263)
What:
- When calling a module's method inside a Local Workflow the MedusaContext is passed as the last argument to the method if not provided
- Add `requestId` to req
- A couple of fixes on Remote Joiner and the data fetcher for internal services

Why:
- The context used to initialize the workflow has to be shared with all modules. properties like transactionId will be used to emit events and requestId to trace logs for example.
2024-02-01 13:37:26 +00:00
Philip Korsholm
512b041929 Feat(auth): Rename authentication to auth (#6229)
**What**
- rename `authenticationModule` -> `authModule`
2024-01-29 10:19:30 +00:00
Frane Polić
3db2f95e65 feat: sales channel module (#5923) 2024-01-29 09:47:28 +01:00
github-actions[bot]
3d0ae72887 chore: Version Packages (#6039)
Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>
2024-01-25 16:23:53 +01:00
Carlos R. L. Rodrigues
302323916b feat: Workflow engine modules (#6128) 2024-01-23 10:08:08 -03:00
Carlos R. L. Rodrigues
d85fee42ee chore: use loaded module reference (#5763) 2024-01-23 08:31:02 -03:00
Sebastian Rindom
12aa1737d5 feat: customer module skeleton (#6126) 2024-01-19 10:18:54 +00:00
Philip Korsholm
2b9f98895e Feat(modules-sdk): Run hooks on application start (#6111)
**What**
- run `onApplicationStart` hook when starting modules
2024-01-17 10:46:44 +00:00
Frane Polić
8472460f53 feat: Payment module package setup (#6059) 2024-01-11 16:41:40 +01:00
github-actions[bot]
47272bf2b9 chore: Version Packages (#5880) 2024-01-09 18:41:35 +01:00
Oli Juhl
925feea04a feat(cart): Add cart module package (#5982)
* feat: Add CartModule foundation

* remove migration

* fix ts issue

* Create hot-dingos-pay.md
2024-01-02 15:59:23 +01:00
Philip Korsholm
6d1e3cc028 feat(types,module-sdk): setup authentication module skeleton (#5943)
**What**
- add authentication module skeleton
2023-12-21 06:56:20 +00:00
Riqwan Thamir
3f6d79961d feat(types,modules-sdk): basic module setup for promotions (#5920)
RESOLVES CORE-1580
2023-12-20 12:21:13 +00:00
github-actions[bot]
7f5e638f61 chore: Version Packages (#5754)
Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>
2023-12-14 15:27:39 +01:00
Adrien de Peretti
946db51a9b chore(): Add engines to all package.json if needed (#5812) 2023-12-07 17:03:50 +01:00
Riqwan Thamir
c4deeee481 fix(modules-sdk): add graphql dependency to modules-sdk (#5750) 2023-11-28 17:11:44 +00:00
github-actions[bot]
935e9f0561 chore: Version Packages (#5673)
Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>
2023-11-27 16:43:51 +00:00
github-actions[bot]
71d59d2c81 chore: Version Packages (#5527)
Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>
2023-11-10 10:28:21 +01:00
Adrien de Peretti
f90ba02087 feat(utils): Introduce promiseAll util (#5543) 2023-11-08 08:48:48 +01:00
Adrien de Peretti
154c9b43bd feat(medusa, modules-sdk, types, utils): Re work modules loading and remove legacy functions (#5496) 2023-11-02 17:59:13 +01:00
github-actions[bot]
309c82e175 chore: Version Packages (#5454)
Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>
2023-11-01 08:19:58 +01:00
Philip Korsholm
148f537b47 feat(medusa): integrate pricing module to core (#5304)
* add pricing integraiton feature flag

* init

* first endpoint

* cleanup

* remove console.logs

* refactor to util and implement across endpoints

* add changeset

* rename variables

* remove mistype

* feat(medusa): move price module integration to pricing service (#5322)

* initial changes

* chore: make product service always internal for pricing module

* add notes

---------

Co-authored-by: Riqwan Thamir <rmthamir@gmail.com>

* nit

* cleanup

* update to object querying

* update cart integration test

* remove uppercase currency_code

* nit

* Feat/admin product pricing module reads (#5354)

* initial changes to list prices for admin

* working price module implementation of list prices

* nit

* variant pricing

* redo integration test changes

* cleanup

* cleanup

* fix unit tests

* [wip] Core <> Pricing - price updates  (#5364)

* chore: update medusa-app

* wip

* get links and modules working with migration

* wip

* chore: make test pass

* Feat/rule type utils (#5371)

* initial rule type utils

* update migration script

* chore: cleanup

* ensure prices are always decorated

* chore: use seed instead

* chore: fix oas conflict

* region id add to admin price read!

---------

Co-authored-by: Philip Korsholm <88927411+pKorsholm@users.noreply.github.com>
Co-authored-by: Philip Korsholm <philip.korsholm@hotmail.com>

* pr feedback

* create remoteQueryFunction type

* fix merge

* fix loaders issue

* Feat(medusa, types, pricing): pricing module migration script (#5409)

* add migration script for money amounts in pricing module

* add changeset

* rename file

* cleanup imports

* update changeset

* add check for pricing module and ff

* feat(medusa,workflows,types): update prices on product and variant update (#5412)

* wip

* chore: update product prices through workflow

* chore: cleanup

* chore: update product handler updates prices for variants

* chore: handle reverts

* chore: address pr comments

* chore: scope workflow handlers to flag handlers

* chore: update return

* chore: update db url

* chore: remove migration

* chore: increase jest timeout

* Feat(medusa): update migration and initDb to run link-migrations (#5437)

* initial

* loader update

* more progress on loaders

* update integration tests and remote-query loader

* remove helper

* migrate isolated modules

* fix test

* fix integration test

* update with pr feedback

* unregister medusa-app

* re-register medusaApp

* fix featureflag

* set timeout

* set timeout

* conditionally run link-module migrations

* pr feedback 1

* add driver options for db

* throw if link is not defined in migration script

* pass config module directly

* include container in migrate command

* chore: increase timeout

* rm redis from api integration tests to test

* chore: temporarily skip tests

* chore: undo skips + add timeout for workflow tests

* chore: increase timeout for order edits

* re-add redis

* include final resolution

* add sharedcontainer to medusaapp loader

* chore: move migration under run command

* try removing redis_url from api tests

* chore: cleanup server on process exit

* chore: clear container on exit

* chore: adjustments

* chore: remove consoles

* chore: close express app on finish

* chore: destroy pg connection on shutdown

* chore: skip

* chore: unskip test

* chore: cleanup container pg connection

* chore: skip

---------

Co-authored-by: Riqwan Thamir <rmthamir@gmail.com>
2023-10-30 14:42:17 +01:00
Adrien de Peretti
a45da9215d fix(medusa, modules-sdk, modules): Module loading missing dependencies + remote query reference issue (#5468) 2023-10-26 20:24:38 +02:00
github-actions[bot]
c0d74bc682 chore: Version Packages (#5340)
Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>
2023-10-19 15:58:48 +02:00
Riqwan Thamir
b62af612c7 feat(link-modules,modules-sdk,pricing): Medusa App Migrations + Core compatible migrations (#5317)
* chore: remove skipping logic for migrations

* chore: medusa app returns migrations to run for modules

* chore: added migration for feature compatible

* chore: added changelog

* chore: create table only if it does not exist

* chore: update migration to pluck from registered modules

* chore: cleanup

* chore: make product an internal service temp

* chore: added options and deps to module

* chore: added link module options

* chore: remove duplicate

* chore: added missing column names in core + remove from model

* chore: scope migrations to only to create if not exist - money amount, currency

---------

Co-authored-by: Sebastian Rindom <skrindom@gmail.com>
2023-10-10 16:23:38 +02:00
github-actions[bot]
35d5fbe8cc chore: Version Packages (#5272)
Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>
2023-10-06 08:41:24 -07:00
Carlos R. L. Rodrigues
130cbc1f43 feat(*): Modules export entities and fields (#5242) 2023-10-03 14:20:43 -07:00
Adrien de Peretti
eeceec791c feat(utils,modules-sdk): Remote query object to string array (#5216)
**What**
- transform remote query object back to string array
- get all fields and fields from given relations from a GraphQL schema

Co-authored-by: Carlos R. L. Rodrigues <37986729+carlos-r-l-rodrigues@users.noreply.github.com>
2023-10-03 17:54:41 +00:00
github-actions[bot]
dab8a82cc1 chore: Version Packages (#5171)
Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>
2023-09-29 14:17:21 -04:00
Adrien de Peretti
dfa5d041c9 feat(medusa): Add product isolation FF to update cart (#5168)
**What**
Update cart must use the remote query when being in product isolation mode.

This pr is a first iteration that aims to quickly make compatible the end point in isolation. In a future iteration, this end point will be migrated to a workflow

Co-authored-by: Oli Juhl <59018053+olivermrbl@users.noreply.github.com>
2023-09-22 08:49:59 +00:00
Adrien de Peretti
202049f8aa fix(medusa, workflows): Create product workflow with Isolated modules + module registration (#5081)
* fix(medusa, workflows): Isolated modules

* Create polite-kangaroos-rhyme.md

* finalise

* naming
2023-09-21 17:10:14 +02:00
github-actions[bot]
ed2c31d8e2 chore: Version Packages (#5157)
Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>
2023-09-21 08:57:25 +02:00
Carlos R. L. Rodrigues
47603f4797 fix(modules-sdk): medusa app load legacy modules (#5115)
* fix: default module path

* fix: allow legacy modules to be loaded by MedusaApp

* changeset

---------

Co-authored-by: Adrien de Peretti <adrien.deperetti@gmail.com>
2023-09-20 10:20:46 +02:00
github-actions[bot]
c5433e2981 chore: Version Packages (#5083)
Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>
2023-09-18 18:55:48 +02:00
Carlos R. L. Rodrigues
1e5a6d4359 fix(modules-sdk): medusa app default module (#5114) 2023-09-18 12:45:13 +00:00
github-actions[bot]
223a4a4cd9 chore: Version Packages (#5002)
Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>
2023-09-15 17:09:34 +02:00
Adrien de Peretti
4fa675ec25 chore(medusa, modules-sdk, types): Refactor modules loading from medusa (#5018) 2023-09-13 14:26:54 +02:00
Riqwan Thamir
3d68be2b6b fix(orchestration,link-modules,pricing,types): fix shippingprofile errror outside of core + change link alias name (#5025)
* fix(orchestration,link-modules,pricing,types): fix shippingprofile error outside of core + change link alias name

* chore: scope relationships and move condition inside

* chore: remove islist

* chore: fix merge conflict

* chore: reverted serviceName scoping

* chore: change shape to make methodOverride compatible

* chore: added methodOverride to remote query

* chore: revert override
2023-09-13 12:16:00 +02:00
Adrien de Peretti
30863fee52 feat(medusa): List products with Remote Query (#4969)
**What**
- includes some type fixes in the DAL layer
- List products including their prices and filtered by the sales channel as well as q parameter and category scope and all other filters
- Assign shipping profile
- ordering
- Add missing columns in the product module
- update product module migrations

**Comment**
-  In regards to the fields, we can pass whatever we want the module will only return the one that exists (default behavior), but on the other hand, that is not possible for the relations.

**question**
- To simplify usage, should we expose the fields/relations available from the module to simplify building a query for the user and be aware of what the module provides

**todo**
- Add back the support for the user to ask for fields/relations
2023-09-12 15:55:05 +00: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
Carlos R. L. Rodrigues
d8649bacaa chore(modules-sdk,orchestration): to remote joiner query (#4974)
Helper function to transform js/json object into RemoteJoinerQuery format.

```typescript
toRemoteJoinerQuery({
  product: {
    fields: ["id", "title"],
    __args: {
      skip: 0,
    },
    variants: {
      fields: ["id", "title", "handle", "sku"],
      shipping_profile: {
        profile: {
          fields: ["id", "name"],
        },
      },
    },
    collections: {
      fields: ["id", "title"],
    },
  },
})
```

outputs:
```
{
  alias: "product",
  fields: ["id", "title"],
  expands: [
    {
      property: "product.variants",
      fields: ["id", "title", "handle", "sku"],
    },
    {
      property: "product.variants.shipping_profile",
    },
    {
      property: "product.variants.shipping_profile.profile",
      fields: ["id", "name"],
    },
    {
      property: "product.collections",
      fields: ["id", "title"],
    },
  ],
  args: [
    {
      name: "skip",
      value: 0,
    },
  ],
};
```
2023-09-10 13:26:50 +00:00
github-actions[bot]
98b91d1137 chore: Version Packages (#4891)
Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>
2023-09-08 14:09:39 +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