Riqwan Thamir
07107f3565
feat(orchestration,core-flows,medusa,product,types,utils): product import/export uses workflows ( #5811 )
2023-12-12 12:09:25 +00:00
Adrien de Peretti
ddbeed4ea6
chore(workflows, core-flows): Split workflows tooling and definitions ( #5705 )
2023-11-24 13:55:48 +00:00
Carlos R. L. Rodrigues
9f9db39698
feat(workflows): Workflow DX ( #5607 )
2023-11-22 17:23:39 +00: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
Adrien de Peretti
5c77029cb0
fix(orchestration): field alias should represent the isList in the result ( #5449 )
...
* fix(orchestration): field alias should represent the isList in the result
* push last fix
* Create witty-rocks-heal.md
* Update remote-joiner.ts
Co-authored-by: Oli Juhl <59018053+olivermrbl@users.noreply.github.com >
---------
Co-authored-by: Oli Juhl <59018053+olivermrbl@users.noreply.github.com >
2023-10-23 19:21:07 +02:00
Adrien de Peretti
e47461d95c
chore(orchestration): prevent throwing on already defined workflow ( #5337 )
...
**What**
At the moment, when importing something from medusa entry point, if two medusa packages are installed because of a plugin, the evaluation of the import can end up throwing that a workflow is already defined. To prevent that from happening, we can just not throw if it is already defined and just return prematurely and make it idempotent.
2023-10-18 09:47:22 +00:00
Adrien de Peretti
02fe4d1364
fix(orchestration): ToRemoteJoinerHelper property building ( #5130 )
...
* fix(orchestration): ToRemoteJoinerHelper property building
* update fix
2023-09-19 15:37:17 +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
107aaa371c
fix(orchestration): Infinite loop by reference update ( #5023 )
...
* fix(orchestration): Infinite loop by reference update
* fix
* handle conflict alias config
* rm field alias
* Create wet-gorillas-laugh.md
2023-09-12 13:24:35 +02:00
Carlos R. L. Rodrigues
0953bdfe84
feat(orchestration): Remote Joiner field aliases ( #5013 )
...
* initial commit
* chore: unit tests and forward arguments
2023-09-12 08:43:25 +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
Carlos R. L. Rodrigues
4b0e3fb2a7
feat(medusa,orchestration): Decouple Product in Cart domain ( #4945 )
2023-09-08 17:24:46 +02:00
Adrien de Peretti
86f4ca369f
fix(orchestration): Fix remote joiner filtering fields ( #4970 )
...
* fix(orchestration): Fix remote joiner filtering fields
* cleanup test
2023-09-07 09:10:16 +02:00
Carlos R. L. Rodrigues
a4906d0ac0
chore(medusa,orchestration,link-modules,modules-sdk): internal services as modules ( #4925 )
2023-09-04 11:36:05 -03: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
Adrien de Peretti
ac866ebb51
test(): Test the create product workflow compensation ( #4716 )
...
**What**
Integration tests to validate the workflow compensation.
Also, fix the transaction state when the workflow is compensating and some steps does not have any compensation
2023-08-09 14:33:04 +00:00
Carlos R. L. Rodrigues
c0ca002901
feat(orchestration,workflows): pipe oncomplete and workflow preparation ( #4697 )
...
* chore: pipe onComplete and workflow preparation step
* changeset
* fix: tests
---------
Co-authored-by: Adrien de Peretti <adrien.deperetti@gmail.com >
Co-authored-by: Oli Juhl <59018053+olivermrbl@users.noreply.github.com >
2023-08-08 13:06:47 +02:00
Riqwan Thamir
a42c41e8ab
chore: scope errors on workflow to invoke ( #4709 )
...
what:
Scopes the errors from the exported workflow to return only invoke errors.
If an error occurs on the invoke level, it'll stop the invoke flow and begin the compensation flow. If another error shows up on the compensate level, it doesn't make sense to throw that error since the user won't be able to do anything about it.
2023-08-07 17:02:38 +00:00
Carlos R. L. Rodrigues
f12299deb1
Feat: @medusajs/workflows ( #4553 )
...
feat: medusa workflows
2023-07-25 10:13:14 -03:00
Carlos R. L. Rodrigues
5a8a889c6d
feat(modules-sdk): Remote Query ( #4463 )
...
* feat: Remote Query
2023-07-19 15:35:36 -03:00
Carlos R. L. Rodrigues
499c3478c9
feat: Remote Joiner ( #4098 )
2023-06-29 15:29:01 +02:00