@medusajs/link-modules 0.2.12-snapshot-20240607093839 → 0.2.12-snapshot-20240703074611

Sign up to get free protection for your applications and to get access to all the features.
Files changed (32) hide show
  1. package/dist/definitions/cart-payment-collection.js +10 -5
  2. package/dist/definitions/cart-promotion.js +9 -4
  3. package/dist/definitions/fulfillment-set-location.js +10 -5
  4. package/dist/definitions/order-cart.js +10 -5
  5. package/dist/definitions/order-fulfillment.js +7 -5
  6. package/dist/definitions/order-payment-collection.js +10 -5
  7. package/dist/definitions/order-promotion.js +10 -5
  8. package/dist/definitions/product-sales-channel.js +10 -5
  9. package/dist/definitions/product-variant-inventory-item.js +10 -7
  10. package/dist/definitions/product-variant-price-set.js +8 -6
  11. package/dist/definitions/publishable-api-key-sales-channel.js +10 -5
  12. package/dist/definitions/readonly/cart-customer.js +11 -5
  13. package/dist/definitions/readonly/cart-product.js +11 -8
  14. package/dist/definitions/readonly/cart-region.js +11 -5
  15. package/dist/definitions/readonly/cart-sales-channel.js +11 -5
  16. package/dist/definitions/readonly/index.d.ts +1 -1
  17. package/dist/definitions/readonly/index.js +1 -1
  18. package/dist/definitions/readonly/inventory-level-stock-location.js +6 -3
  19. package/dist/definitions/readonly/line-item-adjustment-promotion.js +6 -3
  20. package/dist/definitions/readonly/order-customer.js +11 -5
  21. package/dist/definitions/readonly/order-product.js +11 -8
  22. package/dist/definitions/readonly/order-region.js +11 -5
  23. package/dist/definitions/readonly/order-sales-channel.js +11 -5
  24. package/dist/definitions/readonly/store-currency.d.ts +2 -0
  25. package/dist/definitions/readonly/store-currency.js +22 -0
  26. package/dist/definitions/region-payment-provider.js +7 -5
  27. package/dist/definitions/sales-channel-location.js +10 -5
  28. package/dist/definitions/shipping-option-price-set.js +7 -5
  29. package/dist/services/link-module-service.js +24 -32
  30. package/package.json +6 -7
  31. package/dist/definitions/readonly/store-default-currency.d.ts +0 -2
  32. package/dist/definitions/readonly/store-default-currency.js +0 -19
@@ -1,7 +1,6 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.CartPaymentCollection = void 0;
4
- const modules_sdk_1 = require("@medusajs/modules-sdk");
5
4
  const utils_1 = require("@medusajs/utils");
6
5
  exports.CartPaymentCollection = {
7
6
  serviceName: utils_1.LINKS.CartPaymentCollection,
@@ -21,21 +20,27 @@ exports.CartPaymentCollection = {
21
20
  primaryKeys: ["id", "cart_id", "payment_collection_id"],
22
21
  relationships: [
23
22
  {
24
- serviceName: modules_sdk_1.Modules.CART,
23
+ serviceName: utils_1.Modules.CART,
25
24
  primaryKey: "id",
26
25
  foreignKey: "cart_id",
27
26
  alias: "cart",
27
+ args: {
28
+ methodSuffix: "Carts",
29
+ },
28
30
  },
29
31
  {
30
- serviceName: modules_sdk_1.Modules.PAYMENT,
32
+ serviceName: utils_1.Modules.PAYMENT,
31
33
  primaryKey: "id",
32
34
  foreignKey: "payment_collection_id",
33
35
  alias: "payment_collection",
36
+ args: {
37
+ methodSuffix: "PaymentCollections",
38
+ },
34
39
  },
35
40
  ],
36
41
  extends: [
37
42
  {
38
- serviceName: modules_sdk_1.Modules.CART,
43
+ serviceName: utils_1.Modules.CART,
39
44
  fieldAlias: {
40
45
  payment_collection: "payment_collection_link.payment_collection",
41
46
  },
@@ -47,7 +52,7 @@ exports.CartPaymentCollection = {
47
52
  },
48
53
  },
49
54
  {
50
- serviceName: modules_sdk_1.Modules.PAYMENT,
55
+ serviceName: utils_1.Modules.PAYMENT,
51
56
  fieldAlias: {
52
57
  cart: "cart_link.cart",
53
58
  },
@@ -1,7 +1,6 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.CartPromotion = void 0;
4
- const modules_sdk_1 = require("@medusajs/modules-sdk");
5
4
  const utils_1 = require("@medusajs/utils");
6
5
  exports.CartPromotion = {
7
6
  serviceName: utils_1.LINKS.CartPromotion,
@@ -21,21 +20,27 @@ exports.CartPromotion = {
21
20
  primaryKeys: ["id", "cart_id", "promotion_id"],
22
21
  relationships: [
23
22
  {
24
- serviceName: modules_sdk_1.Modules.CART,
23
+ serviceName: utils_1.Modules.CART,
25
24
  primaryKey: "id",
26
25
  foreignKey: "cart_id",
27
26
  alias: "cart",
27
+ args: {
28
+ methodSuffix: "Carts",
29
+ },
28
30
  },
29
31
  {
30
- serviceName: modules_sdk_1.Modules.PROMOTION,
32
+ serviceName: utils_1.Modules.PROMOTION,
31
33
  primaryKey: "id",
32
34
  foreignKey: "promotion_id",
33
35
  alias: "promotions",
36
+ args: {
37
+ methodSuffix: "Promotions",
38
+ },
34
39
  },
35
40
  ],
36
41
  extends: [
37
42
  {
38
- serviceName: modules_sdk_1.Modules.CART,
43
+ serviceName: utils_1.Modules.CART,
39
44
  fieldAlias: {
40
45
  promotions: "cart_link.promotions",
41
46
  },
@@ -1,7 +1,6 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.LocationFulfillmentSet = void 0;
4
- const modules_sdk_1 = require("@medusajs/modules-sdk");
5
4
  const utils_1 = require("@medusajs/utils");
6
5
  exports.LocationFulfillmentSet = {
7
6
  serviceName: utils_1.LINKS.LocationFulfillmentSet,
@@ -21,22 +20,28 @@ exports.LocationFulfillmentSet = {
21
20
  primaryKeys: ["id", "stock_location_id", "fulfillment_set_id"],
22
21
  relationships: [
23
22
  {
24
- serviceName: modules_sdk_1.Modules.STOCK_LOCATION,
23
+ serviceName: utils_1.Modules.STOCK_LOCATION,
25
24
  primaryKey: "id",
26
25
  foreignKey: "stock_location_id",
27
26
  alias: "location",
27
+ args: {
28
+ methodSuffix: "StockLocations",
29
+ },
28
30
  },
29
31
  {
30
- serviceName: modules_sdk_1.Modules.FULFILLMENT,
32
+ serviceName: utils_1.Modules.FULFILLMENT,
31
33
  primaryKey: "id",
32
34
  foreignKey: "fulfillment_set_id",
33
35
  alias: "fulfillment_set",
36
+ args: {
37
+ methodSuffix: "FulfillmentSets",
38
+ },
34
39
  deleteCascade: true,
35
40
  },
36
41
  ],
37
42
  extends: [
38
43
  {
39
- serviceName: modules_sdk_1.Modules.STOCK_LOCATION,
44
+ serviceName: utils_1.Modules.STOCK_LOCATION,
40
45
  relationship: {
41
46
  serviceName: utils_1.LINKS.LocationFulfillmentSet,
42
47
  primaryKey: "stock_location_id",
@@ -49,7 +54,7 @@ exports.LocationFulfillmentSet = {
49
54
  },
50
55
  },
51
56
  {
52
- serviceName: modules_sdk_1.Modules.FULFILLMENT,
57
+ serviceName: utils_1.Modules.FULFILLMENT,
53
58
  fieldAlias: {
54
59
  location: "locations_link.location",
55
60
  },
@@ -1,7 +1,6 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.OrderCart = void 0;
4
- const modules_sdk_1 = require("@medusajs/modules-sdk");
5
4
  const utils_1 = require("@medusajs/utils");
6
5
  exports.OrderCart = {
7
6
  serviceName: utils_1.LINKS.OrderCart,
@@ -21,21 +20,27 @@ exports.OrderCart = {
21
20
  primaryKeys: ["id", "order_id", "cart_id"],
22
21
  relationships: [
23
22
  {
24
- serviceName: modules_sdk_1.Modules.ORDER,
23
+ serviceName: utils_1.Modules.ORDER,
25
24
  primaryKey: "id",
26
25
  foreignKey: "order_id",
27
26
  alias: "order",
27
+ args: {
28
+ methodSuffix: "Orders",
29
+ },
28
30
  },
29
31
  {
30
- serviceName: modules_sdk_1.Modules.CART,
32
+ serviceName: utils_1.Modules.CART,
31
33
  primaryKey: "id",
32
34
  foreignKey: "cart_id",
33
35
  alias: "cart",
36
+ args: {
37
+ methodSuffix: "Carts",
38
+ },
34
39
  },
35
40
  ],
36
41
  extends: [
37
42
  {
38
- serviceName: modules_sdk_1.Modules.ORDER,
43
+ serviceName: utils_1.Modules.ORDER,
39
44
  fieldAlias: {
40
45
  cart: "cart_link.cart",
41
46
  },
@@ -47,7 +52,7 @@ exports.OrderCart = {
47
52
  },
48
53
  },
49
54
  {
50
- serviceName: modules_sdk_1.Modules.CART,
55
+ serviceName: utils_1.Modules.CART,
51
56
  fieldAlias: {
52
57
  order: "order_link.order",
53
58
  },
@@ -1,7 +1,6 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.OrderFulfillment = void 0;
4
- const modules_sdk_1 = require("@medusajs/modules-sdk");
5
4
  const utils_1 = require("@medusajs/utils");
6
5
  exports.OrderFulfillment = {
7
6
  serviceName: utils_1.LINKS.OrderFulfillment,
@@ -21,13 +20,16 @@ exports.OrderFulfillment = {
21
20
  primaryKeys: ["id", "order_id", "fulfillment_id"],
22
21
  relationships: [
23
22
  {
24
- serviceName: modules_sdk_1.Modules.ORDER,
23
+ serviceName: utils_1.Modules.ORDER,
25
24
  primaryKey: "id",
26
25
  foreignKey: "order_id",
27
26
  alias: "order",
27
+ args: {
28
+ methodSuffix: "Orders",
29
+ },
28
30
  },
29
31
  {
30
- serviceName: modules_sdk_1.Modules.FULFILLMENT,
32
+ serviceName: utils_1.Modules.FULFILLMENT,
31
33
  primaryKey: "id",
32
34
  foreignKey: "fulfillment_id",
33
35
  alias: "fulfillments",
@@ -39,7 +41,7 @@ exports.OrderFulfillment = {
39
41
  ],
40
42
  extends: [
41
43
  {
42
- serviceName: modules_sdk_1.Modules.ORDER,
44
+ serviceName: utils_1.Modules.ORDER,
43
45
  fieldAlias: {
44
46
  fulfillments: "fulfillment_link.fulfillments",
45
47
  },
@@ -52,7 +54,7 @@ exports.OrderFulfillment = {
52
54
  },
53
55
  },
54
56
  {
55
- serviceName: modules_sdk_1.Modules.FULFILLMENT,
57
+ serviceName: utils_1.Modules.FULFILLMENT,
56
58
  relationship: {
57
59
  serviceName: utils_1.LINKS.OrderFulfillment,
58
60
  primaryKey: "fulfillment_id",
@@ -1,7 +1,6 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.OrderPaymentCollection = void 0;
4
- const modules_sdk_1 = require("@medusajs/modules-sdk");
5
4
  const utils_1 = require("@medusajs/utils");
6
5
  exports.OrderPaymentCollection = {
7
6
  serviceName: utils_1.LINKS.OrderPaymentCollection,
@@ -21,21 +20,27 @@ exports.OrderPaymentCollection = {
21
20
  primaryKeys: ["id", "order_id", "payment_collection_id"],
22
21
  relationships: [
23
22
  {
24
- serviceName: modules_sdk_1.Modules.ORDER,
23
+ serviceName: utils_1.Modules.ORDER,
25
24
  primaryKey: "id",
26
25
  foreignKey: "order_id",
27
26
  alias: "order",
27
+ args: {
28
+ methodSuffix: "Orders",
29
+ },
28
30
  },
29
31
  {
30
- serviceName: modules_sdk_1.Modules.PAYMENT,
32
+ serviceName: utils_1.Modules.PAYMENT,
31
33
  primaryKey: "id",
32
34
  foreignKey: "payment_collection_id",
33
35
  alias: "payment_collection",
36
+ args: {
37
+ methodSuffix: "PaymentCollections",
38
+ },
34
39
  },
35
40
  ],
36
41
  extends: [
37
42
  {
38
- serviceName: modules_sdk_1.Modules.ORDER,
43
+ serviceName: utils_1.Modules.ORDER,
39
44
  fieldAlias: {
40
45
  payment_collections: {
41
46
  path: "payment_collections_link.payment_collection",
@@ -50,7 +55,7 @@ exports.OrderPaymentCollection = {
50
55
  },
51
56
  },
52
57
  {
53
- serviceName: modules_sdk_1.Modules.PAYMENT,
58
+ serviceName: utils_1.Modules.PAYMENT,
54
59
  fieldAlias: {
55
60
  order: "order_link.order",
56
61
  },
@@ -1,7 +1,6 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.OrderPromotion = void 0;
4
- const modules_sdk_1 = require("@medusajs/modules-sdk");
5
4
  const utils_1 = require("@medusajs/utils");
6
5
  exports.OrderPromotion = {
7
6
  serviceName: utils_1.LINKS.OrderPromotion,
@@ -21,21 +20,27 @@ exports.OrderPromotion = {
21
20
  primaryKeys: ["id", "order_id", "promotion_id"],
22
21
  relationships: [
23
22
  {
24
- serviceName: modules_sdk_1.Modules.ORDER,
23
+ serviceName: utils_1.Modules.ORDER,
25
24
  primaryKey: "id",
26
25
  foreignKey: "order_id",
27
26
  alias: "order",
27
+ args: {
28
+ methodSuffix: "Orders",
29
+ },
28
30
  },
29
31
  {
30
- serviceName: modules_sdk_1.Modules.PROMOTION,
32
+ serviceName: utils_1.Modules.PROMOTION,
31
33
  primaryKey: "id",
32
34
  foreignKey: "promotion_id",
33
35
  alias: "promotion",
36
+ args: {
37
+ methodSuffix: "Promotions",
38
+ },
34
39
  },
35
40
  ],
36
41
  extends: [
37
42
  {
38
- serviceName: modules_sdk_1.Modules.ORDER,
43
+ serviceName: utils_1.Modules.ORDER,
39
44
  fieldAlias: {
40
45
  promotion: "promotion_link.promotion",
41
46
  },
@@ -47,7 +52,7 @@ exports.OrderPromotion = {
47
52
  },
48
53
  },
49
54
  {
50
- serviceName: modules_sdk_1.Modules.PROMOTION,
55
+ serviceName: utils_1.Modules.PROMOTION,
51
56
  relationship: {
52
57
  serviceName: utils_1.LINKS.OrderPromotion,
53
58
  primaryKey: "promotion_id",
@@ -1,7 +1,6 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.ProductSalesChannel = void 0;
4
- const modules_sdk_1 = require("@medusajs/modules-sdk");
5
4
  const utils_1 = require("@medusajs/utils");
6
5
  exports.ProductSalesChannel = {
7
6
  serviceName: utils_1.LINKS.ProductSalesChannel,
@@ -21,21 +20,27 @@ exports.ProductSalesChannel = {
21
20
  primaryKeys: ["id", "product_id", "sales_channel_id"],
22
21
  relationships: [
23
22
  {
24
- serviceName: modules_sdk_1.Modules.PRODUCT,
23
+ serviceName: utils_1.Modules.PRODUCT,
25
24
  primaryKey: "id",
26
25
  foreignKey: "product_id",
27
26
  alias: "product",
27
+ args: {
28
+ methodSuffix: "Products",
29
+ },
28
30
  },
29
31
  {
30
- serviceName: modules_sdk_1.Modules.SALES_CHANNEL,
32
+ serviceName: utils_1.Modules.SALES_CHANNEL,
31
33
  primaryKey: "id",
32
34
  foreignKey: "sales_channel_id",
33
35
  alias: "sales_channel",
36
+ args: {
37
+ methodSuffix: "SalesChannels",
38
+ },
34
39
  },
35
40
  ],
36
41
  extends: [
37
42
  {
38
- serviceName: modules_sdk_1.Modules.PRODUCT,
43
+ serviceName: utils_1.Modules.PRODUCT,
39
44
  fieldAlias: {
40
45
  sales_channels: "sales_channels_link.sales_channel",
41
46
  },
@@ -48,7 +53,7 @@ exports.ProductSalesChannel = {
48
53
  },
49
54
  },
50
55
  {
51
- serviceName: modules_sdk_1.Modules.SALES_CHANNEL,
56
+ serviceName: utils_1.Modules.SALES_CHANNEL,
52
57
  relationship: {
53
58
  serviceName: utils_1.LINKS.ProductSalesChannel,
54
59
  primaryKey: "sales_channel_id",
@@ -1,7 +1,6 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.ProductVariantInventoryItem = void 0;
4
- const modules_sdk_1 = require("@medusajs/modules-sdk");
5
4
  const utils_1 = require("@medusajs/utils");
6
5
  exports.ProductVariantInventoryItem = {
7
6
  serviceName: utils_1.LINKS.ProductVariantInventoryItem,
@@ -30,25 +29,28 @@ exports.ProductVariantInventoryItem = {
30
29
  primaryKeys: ["id", "variant_id", "inventory_item_id"],
31
30
  relationships: [
32
31
  {
33
- serviceName: modules_sdk_1.Modules.PRODUCT,
32
+ serviceName: utils_1.Modules.PRODUCT,
34
33
  primaryKey: "id",
35
34
  foreignKey: "variant_id",
36
35
  alias: "variant",
37
36
  args: {
38
- methodSuffix: "Variants",
37
+ methodSuffix: "ProductVariants",
39
38
  },
40
39
  },
41
40
  {
42
- serviceName: modules_sdk_1.Modules.INVENTORY,
41
+ serviceName: utils_1.Modules.INVENTORY,
43
42
  primaryKey: "id",
44
43
  foreignKey: "inventory_item_id",
45
44
  alias: "inventory",
45
+ args: {
46
+ methodSuffix: "InventoryItems",
47
+ },
46
48
  deleteCascade: true,
47
49
  },
48
50
  ],
49
51
  extends: [
50
52
  {
51
- serviceName: modules_sdk_1.Modules.PRODUCT,
53
+ serviceName: utils_1.Modules.PRODUCT,
52
54
  fieldAlias: {
53
55
  inventory: "inventory_items.inventory",
54
56
  },
@@ -61,15 +63,16 @@ exports.ProductVariantInventoryItem = {
61
63
  },
62
64
  },
63
65
  {
64
- serviceName: modules_sdk_1.Modules.INVENTORY,
66
+ serviceName: utils_1.Modules.INVENTORY,
65
67
  fieldAlias: {
66
- variant: "variant_link.variant",
68
+ variants: "variant_link.variant",
67
69
  },
68
70
  relationship: {
69
71
  serviceName: utils_1.LINKS.ProductVariantInventoryItem,
70
72
  primaryKey: "inventory_item_id",
71
73
  foreignKey: "id",
72
74
  alias: "variant_link",
75
+ isList: true,
73
76
  },
74
77
  },
75
78
  ],
@@ -1,7 +1,6 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.ProductVariantPriceSet = void 0;
4
- const modules_sdk_1 = require("@medusajs/modules-sdk");
5
4
  const utils_1 = require("@medusajs/utils");
6
5
  exports.ProductVariantPriceSet = {
7
6
  serviceName: utils_1.LINKS.ProductVariantPriceSet,
@@ -21,25 +20,28 @@ exports.ProductVariantPriceSet = {
21
20
  primaryKeys: ["id", "variant_id", "price_set_id"],
22
21
  relationships: [
23
22
  {
24
- serviceName: modules_sdk_1.Modules.PRODUCT,
23
+ serviceName: utils_1.Modules.PRODUCT,
25
24
  primaryKey: "id",
26
25
  foreignKey: "variant_id",
27
26
  alias: "variant",
28
27
  args: {
29
- methodSuffix: "Variants",
28
+ methodSuffix: "ProductVariants",
30
29
  },
31
30
  },
32
31
  {
33
- serviceName: modules_sdk_1.Modules.PRICING,
32
+ serviceName: utils_1.Modules.PRICING,
34
33
  primaryKey: "id",
35
34
  foreignKey: "price_set_id",
36
35
  alias: "price_set",
36
+ args: {
37
+ methodSuffix: "PriceSets",
38
+ },
37
39
  deleteCascade: true,
38
40
  },
39
41
  ],
40
42
  extends: [
41
43
  {
42
- serviceName: modules_sdk_1.Modules.PRODUCT,
44
+ serviceName: utils_1.Modules.PRODUCT,
43
45
  fieldAlias: {
44
46
  price_set: "price_set_link.price_set",
45
47
  prices: "price_set_link.price_set.prices",
@@ -56,7 +58,7 @@ exports.ProductVariantPriceSet = {
56
58
  },
57
59
  },
58
60
  {
59
- serviceName: modules_sdk_1.Modules.PRICING,
61
+ serviceName: utils_1.Modules.PRICING,
60
62
  relationship: {
61
63
  serviceName: utils_1.LINKS.ProductVariantPriceSet,
62
64
  primaryKey: "price_set_id",
@@ -1,7 +1,6 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.PublishableApiKeySalesChannel = void 0;
4
- const modules_sdk_1 = require("@medusajs/modules-sdk");
5
4
  const utils_1 = require("@medusajs/utils");
6
5
  exports.PublishableApiKeySalesChannel = {
7
6
  serviceName: utils_1.LINKS.PublishableApiKeySalesChannel,
@@ -21,21 +20,27 @@ exports.PublishableApiKeySalesChannel = {
21
20
  primaryKeys: ["id", "publishable_key_id", "sales_channel_id"],
22
21
  relationships: [
23
22
  {
24
- serviceName: modules_sdk_1.Modules.API_KEY,
23
+ serviceName: utils_1.Modules.API_KEY,
25
24
  primaryKey: "id",
26
25
  foreignKey: "publishable_key_id",
27
26
  alias: "api_key",
27
+ args: {
28
+ methodSuffix: "ApiKeys",
29
+ },
28
30
  },
29
31
  {
30
- serviceName: modules_sdk_1.Modules.SALES_CHANNEL,
32
+ serviceName: utils_1.Modules.SALES_CHANNEL,
31
33
  primaryKey: "id",
32
34
  foreignKey: "sales_channel_id",
33
35
  alias: "sales_channel",
36
+ args: {
37
+ methodSuffix: "SalesChannels",
38
+ },
34
39
  },
35
40
  ],
36
41
  extends: [
37
42
  {
38
- serviceName: modules_sdk_1.Modules.API_KEY,
43
+ serviceName: utils_1.Modules.API_KEY,
39
44
  fieldAlias: {
40
45
  sales_channels: "sales_channels_link.sales_channel",
41
46
  },
@@ -48,7 +53,7 @@ exports.PublishableApiKeySalesChannel = {
48
53
  },
49
54
  },
50
55
  {
51
- serviceName: modules_sdk_1.Modules.SALES_CHANNEL,
56
+ serviceName: utils_1.Modules.SALES_CHANNEL,
52
57
  fieldAlias: {
53
58
  publishable_api_keys: "api_keys_link.api_key",
54
59
  },
@@ -1,27 +1,33 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.CartCustomer = void 0;
4
- const modules_sdk_1 = require("@medusajs/modules-sdk");
4
+ const utils_1 = require("@medusajs/utils");
5
5
  exports.CartCustomer = {
6
6
  isLink: true,
7
7
  isReadOnlyLink: true,
8
8
  extends: [
9
9
  {
10
- serviceName: modules_sdk_1.Modules.CART,
10
+ serviceName: utils_1.Modules.CART,
11
11
  relationship: {
12
- serviceName: modules_sdk_1.Modules.CUSTOMER,
12
+ serviceName: utils_1.Modules.CUSTOMER,
13
13
  primaryKey: "id",
14
14
  foreignKey: "customer_id",
15
15
  alias: "customer",
16
+ args: {
17
+ methodSuffix: "Customers",
18
+ },
16
19
  },
17
20
  },
18
21
  {
19
- serviceName: modules_sdk_1.Modules.CUSTOMER,
22
+ serviceName: utils_1.Modules.CUSTOMER,
20
23
  relationship: {
21
- serviceName: modules_sdk_1.Modules.CART,
24
+ serviceName: utils_1.Modules.CART,
22
25
  primaryKey: "customer_id",
23
26
  foreignKey: "id",
24
27
  alias: "carts",
28
+ args: {
29
+ methodSuffix: "Carts",
30
+ },
25
31
  isList: true,
26
32
  },
27
33
  },
@@ -1,36 +1,39 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.CartProduct = void 0;
4
- const modules_sdk_1 = require("@medusajs/modules-sdk");
4
+ const utils_1 = require("@medusajs/utils");
5
5
  exports.CartProduct = {
6
6
  isLink: true,
7
7
  isReadOnlyLink: true,
8
8
  extends: [
9
9
  {
10
- serviceName: modules_sdk_1.Modules.CART,
10
+ serviceName: utils_1.Modules.CART,
11
11
  relationship: {
12
- serviceName: modules_sdk_1.Modules.PRODUCT,
12
+ serviceName: utils_1.Modules.PRODUCT,
13
13
  primaryKey: "id",
14
14
  foreignKey: "items.product_id",
15
15
  alias: "product",
16
+ args: {
17
+ methodSuffix: "Products",
18
+ },
16
19
  },
17
20
  },
18
21
  {
19
- serviceName: modules_sdk_1.Modules.CART,
22
+ serviceName: utils_1.Modules.CART,
20
23
  relationship: {
21
- serviceName: modules_sdk_1.Modules.PRODUCT,
24
+ serviceName: utils_1.Modules.PRODUCT,
22
25
  primaryKey: "id",
23
26
  foreignKey: "items.variant_id",
24
27
  alias: "variant",
25
28
  args: {
26
- methodSuffix: "Variants",
29
+ methodSuffix: "ProductVariants",
27
30
  },
28
31
  },
29
32
  },
30
33
  {
31
- serviceName: modules_sdk_1.Modules.PRODUCT,
34
+ serviceName: utils_1.Modules.PRODUCT,
32
35
  relationship: {
33
- serviceName: modules_sdk_1.Modules.CART,
36
+ serviceName: utils_1.Modules.CART,
34
37
  primaryKey: "variant_id",
35
38
  foreignKey: "id",
36
39
  alias: "cart_items",
@@ -1,27 +1,33 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.CartRegion = void 0;
4
- const modules_sdk_1 = require("@medusajs/modules-sdk");
4
+ const utils_1 = require("@medusajs/utils");
5
5
  exports.CartRegion = {
6
6
  isLink: true,
7
7
  isReadOnlyLink: true,
8
8
  extends: [
9
9
  {
10
- serviceName: modules_sdk_1.Modules.CART,
10
+ serviceName: utils_1.Modules.CART,
11
11
  relationship: {
12
- serviceName: modules_sdk_1.Modules.REGION,
12
+ serviceName: utils_1.Modules.REGION,
13
13
  primaryKey: "id",
14
14
  foreignKey: "region_id",
15
15
  alias: "region",
16
+ args: {
17
+ methodSuffix: "Regions",
18
+ },
16
19
  },
17
20
  },
18
21
  {
19
- serviceName: modules_sdk_1.Modules.REGION,
22
+ serviceName: utils_1.Modules.REGION,
20
23
  relationship: {
21
- serviceName: modules_sdk_1.Modules.CART,
24
+ serviceName: utils_1.Modules.CART,
22
25
  primaryKey: "region_id",
23
26
  foreignKey: "id",
24
27
  alias: "carts",
28
+ args: {
29
+ methodSuffix: "Carts",
30
+ },
25
31
  isList: true,
26
32
  },
27
33
  },
@@ -1,27 +1,33 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.CartSalesChannel = void 0;
4
- const modules_sdk_1 = require("@medusajs/modules-sdk");
4
+ const utils_1 = require("@medusajs/utils");
5
5
  exports.CartSalesChannel = {
6
6
  isLink: true,
7
7
  isReadOnlyLink: true,
8
8
  extends: [
9
9
  {
10
- serviceName: modules_sdk_1.Modules.CART,
10
+ serviceName: utils_1.Modules.CART,
11
11
  relationship: {
12
- serviceName: modules_sdk_1.Modules.SALES_CHANNEL,
12
+ serviceName: utils_1.Modules.SALES_CHANNEL,
13
13
  primaryKey: "id",
14
14
  foreignKey: "sales_channel_id",
15
15
  alias: "sales_channel",
16
+ args: {
17
+ methodSuffix: "SalesChannels",
18
+ },
16
19
  },
17
20
  },
18
21
  {
19
- serviceName: modules_sdk_1.Modules.SALES_CHANNEL,
22
+ serviceName: utils_1.Modules.SALES_CHANNEL,
20
23
  relationship: {
21
- serviceName: modules_sdk_1.Modules.CART,
24
+ serviceName: utils_1.Modules.CART,
22
25
  primaryKey: "sales_channel_id",
23
26
  foreignKey: "id",
24
27
  alias: "carts",
28
+ args: {
29
+ methodSuffix: "Carts",
30
+ },
25
31
  isList: true,
26
32
  },
27
33
  },
@@ -8,4 +8,4 @@ export * from "./order-customer";
8
8
  export * from "./order-product";
9
9
  export * from "./order-region";
10
10
  export * from "./order-sales-channel";
11
- export * from "./store-default-currency";
11
+ export * from "./store-currency";
@@ -24,4 +24,4 @@ __exportStar(require("./order-customer"), exports);
24
24
  __exportStar(require("./order-product"), exports);
25
25
  __exportStar(require("./order-region"), exports);
26
26
  __exportStar(require("./order-sales-channel"), exports);
27
- __exportStar(require("./store-default-currency"), exports);
27
+ __exportStar(require("./store-currency"), exports);
@@ -1,18 +1,21 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.InventoryLevelStockLocation = void 0;
4
- const modules_sdk_1 = require("@medusajs/modules-sdk");
4
+ const utils_1 = require("@medusajs/utils");
5
5
  exports.InventoryLevelStockLocation = {
6
6
  isLink: true,
7
7
  isReadOnlyLink: true,
8
8
  extends: [
9
9
  {
10
- serviceName: modules_sdk_1.Modules.INVENTORY,
10
+ serviceName: utils_1.Modules.INVENTORY,
11
11
  relationship: {
12
- serviceName: modules_sdk_1.Modules.STOCK_LOCATION,
12
+ serviceName: utils_1.Modules.STOCK_LOCATION,
13
13
  primaryKey: "id",
14
14
  foreignKey: "location_id",
15
15
  alias: "stock_locations",
16
+ args: {
17
+ methodSuffix: "StockLocations",
18
+ },
16
19
  isList: true,
17
20
  },
18
21
  },
@@ -1,18 +1,21 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.LineItemAdjustmentPromotion = void 0;
4
- const modules_sdk_1 = require("@medusajs/modules-sdk");
4
+ const utils_1 = require("@medusajs/utils");
5
5
  exports.LineItemAdjustmentPromotion = {
6
6
  isLink: true,
7
7
  isReadOnlyLink: true,
8
8
  extends: [
9
9
  {
10
- serviceName: modules_sdk_1.Modules.CART,
10
+ serviceName: utils_1.Modules.CART,
11
11
  relationship: {
12
- serviceName: modules_sdk_1.Modules.PROMOTION,
12
+ serviceName: utils_1.Modules.PROMOTION,
13
13
  primaryKey: "id",
14
14
  foreignKey: "promotion_id",
15
15
  alias: "promotion",
16
+ args: {
17
+ methodSuffix: "Promotions",
18
+ },
16
19
  },
17
20
  },
18
21
  ],
@@ -1,27 +1,33 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.OrderCustomer = void 0;
4
- const modules_sdk_1 = require("@medusajs/modules-sdk");
4
+ const utils_1 = require("@medusajs/utils");
5
5
  exports.OrderCustomer = {
6
6
  isLink: true,
7
7
  isReadOnlyLink: true,
8
8
  extends: [
9
9
  {
10
- serviceName: modules_sdk_1.Modules.ORDER,
10
+ serviceName: utils_1.Modules.ORDER,
11
11
  relationship: {
12
- serviceName: modules_sdk_1.Modules.CUSTOMER,
12
+ serviceName: utils_1.Modules.CUSTOMER,
13
13
  primaryKey: "id",
14
14
  foreignKey: "customer_id",
15
15
  alias: "customer",
16
+ args: {
17
+ methodSuffix: "Customers",
18
+ },
16
19
  },
17
20
  },
18
21
  {
19
- serviceName: modules_sdk_1.Modules.CUSTOMER,
22
+ serviceName: utils_1.Modules.CUSTOMER,
20
23
  relationship: {
21
- serviceName: modules_sdk_1.Modules.ORDER,
24
+ serviceName: utils_1.Modules.ORDER,
22
25
  primaryKey: "customer_id",
23
26
  foreignKey: "id",
24
27
  alias: "orders",
28
+ args: {
29
+ methodSuffix: "Orders",
30
+ },
25
31
  isList: true,
26
32
  },
27
33
  },
@@ -1,36 +1,39 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.OrderProduct = void 0;
4
- const modules_sdk_1 = require("@medusajs/modules-sdk");
4
+ const utils_1 = require("@medusajs/utils");
5
5
  exports.OrderProduct = {
6
6
  isLink: true,
7
7
  isReadOnlyLink: true,
8
8
  extends: [
9
9
  {
10
- serviceName: modules_sdk_1.Modules.ORDER,
10
+ serviceName: utils_1.Modules.ORDER,
11
11
  relationship: {
12
- serviceName: modules_sdk_1.Modules.PRODUCT,
12
+ serviceName: utils_1.Modules.PRODUCT,
13
13
  primaryKey: "id",
14
14
  foreignKey: "items.product_id",
15
15
  alias: "product",
16
+ args: {
17
+ methodSuffix: "Products",
18
+ },
16
19
  },
17
20
  },
18
21
  {
19
- serviceName: modules_sdk_1.Modules.ORDER,
22
+ serviceName: utils_1.Modules.ORDER,
20
23
  relationship: {
21
- serviceName: modules_sdk_1.Modules.PRODUCT,
24
+ serviceName: utils_1.Modules.PRODUCT,
22
25
  primaryKey: "id",
23
26
  foreignKey: "items.variant_id",
24
27
  alias: "variant",
25
28
  args: {
26
- methodSuffix: "Variants",
29
+ methodSuffix: "ProductVariants",
27
30
  },
28
31
  },
29
32
  },
30
33
  {
31
- serviceName: modules_sdk_1.Modules.PRODUCT,
34
+ serviceName: utils_1.Modules.PRODUCT,
32
35
  relationship: {
33
- serviceName: modules_sdk_1.Modules.ORDER,
36
+ serviceName: utils_1.Modules.ORDER,
34
37
  primaryKey: "variant_id",
35
38
  foreignKey: "id",
36
39
  alias: "order_items",
@@ -1,27 +1,33 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.OrderRegion = void 0;
4
- const modules_sdk_1 = require("@medusajs/modules-sdk");
4
+ const utils_1 = require("@medusajs/utils");
5
5
  exports.OrderRegion = {
6
6
  isLink: true,
7
7
  isReadOnlyLink: true,
8
8
  extends: [
9
9
  {
10
- serviceName: modules_sdk_1.Modules.ORDER,
10
+ serviceName: utils_1.Modules.ORDER,
11
11
  relationship: {
12
- serviceName: modules_sdk_1.Modules.REGION,
12
+ serviceName: utils_1.Modules.REGION,
13
13
  primaryKey: "id",
14
14
  foreignKey: "region_id",
15
15
  alias: "region",
16
+ args: {
17
+ methodSuffix: "Regions",
18
+ },
16
19
  },
17
20
  },
18
21
  {
19
- serviceName: modules_sdk_1.Modules.REGION,
22
+ serviceName: utils_1.Modules.REGION,
20
23
  relationship: {
21
- serviceName: modules_sdk_1.Modules.ORDER,
24
+ serviceName: utils_1.Modules.ORDER,
22
25
  primaryKey: "region_id",
23
26
  foreignKey: "id",
24
27
  alias: "orders",
28
+ args: {
29
+ methodSuffix: "Orders",
30
+ },
25
31
  isList: true,
26
32
  },
27
33
  },
@@ -1,27 +1,33 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.OrderSalesChannel = void 0;
4
- const modules_sdk_1 = require("@medusajs/modules-sdk");
4
+ const utils_1 = require("@medusajs/utils");
5
5
  exports.OrderSalesChannel = {
6
6
  isLink: true,
7
7
  isReadOnlyLink: true,
8
8
  extends: [
9
9
  {
10
- serviceName: modules_sdk_1.Modules.ORDER,
10
+ serviceName: utils_1.Modules.ORDER,
11
11
  relationship: {
12
- serviceName: modules_sdk_1.Modules.SALES_CHANNEL,
12
+ serviceName: utils_1.Modules.SALES_CHANNEL,
13
13
  primaryKey: "id",
14
14
  foreignKey: "sales_channel_id",
15
15
  alias: "sales_channel",
16
+ args: {
17
+ methodSuffix: "SalesChannels",
18
+ },
16
19
  },
17
20
  },
18
21
  {
19
- serviceName: modules_sdk_1.Modules.SALES_CHANNEL,
22
+ serviceName: utils_1.Modules.SALES_CHANNEL,
20
23
  relationship: {
21
- serviceName: modules_sdk_1.Modules.ORDER,
24
+ serviceName: utils_1.Modules.ORDER,
22
25
  primaryKey: "sales_channel_id",
23
26
  foreignKey: "id",
24
27
  alias: "orders",
28
+ args: {
29
+ methodSuffix: "Orders",
30
+ },
25
31
  isList: true,
26
32
  },
27
33
  },
@@ -0,0 +1,2 @@
1
+ import { ModuleJoinerConfig } from "@medusajs/types";
2
+ export declare const StoreCurrencies: ModuleJoinerConfig;
@@ -0,0 +1,22 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.StoreCurrencies = void 0;
4
+ const utils_1 = require("@medusajs/utils");
5
+ exports.StoreCurrencies = {
6
+ isLink: true,
7
+ isReadOnlyLink: true,
8
+ extends: [
9
+ {
10
+ serviceName: utils_1.Modules.STORE,
11
+ relationship: {
12
+ serviceName: utils_1.Modules.CURRENCY,
13
+ primaryKey: "code",
14
+ foreignKey: "supported_currencies.currency_code",
15
+ alias: "currency",
16
+ args: {
17
+ methodSuffix: "Currencies",
18
+ },
19
+ },
20
+ },
21
+ ],
22
+ };
@@ -1,7 +1,6 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.RegionPaymentProvider = void 0;
4
- const modules_sdk_1 = require("@medusajs/modules-sdk");
5
4
  const utils_1 = require("@medusajs/utils");
6
5
  exports.RegionPaymentProvider = {
7
6
  serviceName: utils_1.LINKS.RegionPaymentProvider,
@@ -21,13 +20,16 @@ exports.RegionPaymentProvider = {
21
20
  primaryKeys: ["id", "region_id", "payment_provider_id"],
22
21
  relationships: [
23
22
  {
24
- serviceName: modules_sdk_1.Modules.REGION,
23
+ serviceName: utils_1.Modules.REGION,
25
24
  primaryKey: "id",
26
25
  foreignKey: "region_id",
27
26
  alias: "region",
27
+ args: {
28
+ methodSuffix: "Regions",
29
+ },
28
30
  },
29
31
  {
30
- serviceName: modules_sdk_1.Modules.PAYMENT,
32
+ serviceName: utils_1.Modules.PAYMENT,
31
33
  primaryKey: "id",
32
34
  foreignKey: "payment_provider_id",
33
35
  alias: "payment_provider",
@@ -36,7 +38,7 @@ exports.RegionPaymentProvider = {
36
38
  ],
37
39
  extends: [
38
40
  {
39
- serviceName: modules_sdk_1.Modules.REGION,
41
+ serviceName: utils_1.Modules.REGION,
40
42
  fieldAlias: {
41
43
  payment_providers: "payment_provider_link.payment_provider",
42
44
  },
@@ -49,7 +51,7 @@ exports.RegionPaymentProvider = {
49
51
  },
50
52
  },
51
53
  {
52
- serviceName: modules_sdk_1.Modules.PAYMENT,
54
+ serviceName: utils_1.Modules.PAYMENT,
53
55
  fieldAlias: {
54
56
  regions: "region_link.region",
55
57
  },
@@ -1,7 +1,6 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.SalesChannelLocation = void 0;
4
- const modules_sdk_1 = require("@medusajs/modules-sdk");
5
4
  const utils_1 = require("@medusajs/utils");
6
5
  exports.SalesChannelLocation = {
7
6
  serviceName: utils_1.LINKS.SalesChannelLocation,
@@ -21,21 +20,27 @@ exports.SalesChannelLocation = {
21
20
  primaryKeys: ["id", "sales_channel_id", "stock_location_id"],
22
21
  relationships: [
23
22
  {
24
- serviceName: modules_sdk_1.Modules.SALES_CHANNEL,
23
+ serviceName: utils_1.Modules.SALES_CHANNEL,
25
24
  primaryKey: "id",
26
25
  foreignKey: "sales_channel_id",
27
26
  alias: "sales_channel",
27
+ args: {
28
+ methodSuffix: "SalesChannels",
29
+ },
28
30
  },
29
31
  {
30
- serviceName: modules_sdk_1.Modules.STOCK_LOCATION,
32
+ serviceName: utils_1.Modules.STOCK_LOCATION,
31
33
  primaryKey: "id",
32
34
  foreignKey: "stock_location_id",
33
35
  alias: "location",
36
+ args: {
37
+ methodSuffix: "StockLocations",
38
+ },
34
39
  },
35
40
  ],
36
41
  extends: [
37
42
  {
38
- serviceName: modules_sdk_1.Modules.SALES_CHANNEL,
43
+ serviceName: utils_1.Modules.SALES_CHANNEL,
39
44
  fieldAlias: {
40
45
  stock_locations: "locations_link.location",
41
46
  },
@@ -48,7 +53,7 @@ exports.SalesChannelLocation = {
48
53
  },
49
54
  },
50
55
  {
51
- serviceName: modules_sdk_1.Modules.STOCK_LOCATION,
56
+ serviceName: utils_1.Modules.STOCK_LOCATION,
52
57
  fieldAlias: {
53
58
  sales_channels: "sales_channels_link.sales_channel",
54
59
  },
@@ -1,7 +1,6 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.ShippingOptionPriceSet = void 0;
4
- const modules_sdk_1 = require("@medusajs/modules-sdk");
5
4
  const utils_1 = require("@medusajs/utils");
6
5
  exports.ShippingOptionPriceSet = {
7
6
  serviceName: utils_1.LINKS.ShippingOptionPriceSet,
@@ -21,7 +20,7 @@ exports.ShippingOptionPriceSet = {
21
20
  primaryKeys: ["id", "shipping_option_id", "price_set_id"],
22
21
  relationships: [
23
22
  {
24
- serviceName: modules_sdk_1.Modules.FULFILLMENT,
23
+ serviceName: utils_1.Modules.FULFILLMENT,
25
24
  primaryKey: "id",
26
25
  foreignKey: "shipping_option_id",
27
26
  alias: "shipping_option",
@@ -30,16 +29,19 @@ exports.ShippingOptionPriceSet = {
30
29
  },
31
30
  },
32
31
  {
33
- serviceName: modules_sdk_1.Modules.PRICING,
32
+ serviceName: utils_1.Modules.PRICING,
34
33
  primaryKey: "id",
35
34
  foreignKey: "price_set_id",
36
35
  alias: "price_set",
36
+ args: {
37
+ methodSuffix: "PriceSets",
38
+ },
37
39
  deleteCascade: true,
38
40
  },
39
41
  ],
40
42
  extends: [
41
43
  {
42
- serviceName: modules_sdk_1.Modules.FULFILLMENT,
44
+ serviceName: utils_1.Modules.FULFILLMENT,
43
45
  fieldAlias: {
44
46
  prices: {
45
47
  path: "price_set_link.price_set.prices",
@@ -58,7 +60,7 @@ exports.ShippingOptionPriceSet = {
58
60
  },
59
61
  },
60
62
  {
61
- serviceName: modules_sdk_1.Modules.PRICING,
63
+ serviceName: utils_1.Modules.PRICING,
62
64
  relationship: {
63
65
  serviceName: utils_1.LINKS.ShippingOptionPriceSet,
64
66
  primaryKey: "price_set_id",
@@ -93,15 +93,13 @@ class LinkModuleService {
93
93
  const links = await this.linkService_.create(data, sharedContext);
94
94
  await this.eventBusModuleService_?.emit(data.map(({ id }) => ({
95
95
  eventName: this.entityName_ + "." + utils_1.CommonEvents.ATTACHED,
96
- body: {
97
- metadata: {
98
- service: this.serviceName_,
99
- action: utils_1.CommonEvents.ATTACHED,
100
- object: this.entityName_,
101
- eventGroupId: sharedContext.eventGroupId,
102
- },
103
- data: { id },
96
+ metadata: {
97
+ source: this.serviceName_,
98
+ action: utils_1.CommonEvents.ATTACHED,
99
+ object: this.entityName_,
100
+ eventGroupId: sharedContext.eventGroupId,
104
101
  },
102
+ data: { id },
105
103
  })));
106
104
  return await this.baseRepository_.serialize(links);
107
105
  }
@@ -124,15 +122,13 @@ class LinkModuleService {
124
122
  const allData = Array.isArray(data) ? data : [data];
125
123
  await this.eventBusModuleService_?.emit(allData.map(({ id }) => ({
126
124
  eventName: this.entityName_ + "." + utils_1.CommonEvents.DETACHED,
127
- body: {
128
- metadata: {
129
- service: this.serviceName_,
130
- action: utils_1.CommonEvents.DETACHED,
131
- object: this.entityName_,
132
- eventGroupId: sharedContext.eventGroupId,
133
- },
134
- data: { id },
125
+ metadata: {
126
+ source: this.serviceName_,
127
+ action: utils_1.CommonEvents.DETACHED,
128
+ object: this.entityName_,
129
+ eventGroupId: sharedContext.eventGroupId,
135
130
  },
131
+ data: { id },
136
132
  })));
137
133
  }
138
134
  async softDelete(data, { returnLinkableKeys } = {}, sharedContext = {}) {
@@ -156,15 +152,13 @@ class LinkModuleService {
156
152
  }
157
153
  await this.eventBusModuleService_?.emit(deletedEntities.map(({ id }) => ({
158
154
  eventName: this.entityName_ + "." + utils_1.CommonEvents.DETACHED,
159
- body: {
160
- metadata: {
161
- service: this.serviceName_,
162
- action: utils_1.CommonEvents.DETACHED,
163
- object: this.entityName_,
164
- eventGroupId: sharedContext.eventGroupId,
165
- },
166
- data: { id },
155
+ metadata: {
156
+ source: this.serviceName_,
157
+ action: utils_1.CommonEvents.DETACHED,
158
+ object: this.entityName_,
159
+ eventGroupId: sharedContext.eventGroupId,
167
160
  },
161
+ data: { id },
168
162
  })));
169
163
  return mappedCascadedEntitiesMap ? mappedCascadedEntitiesMap : void 0;
170
164
  }
@@ -192,15 +186,13 @@ class LinkModuleService {
192
186
  }
193
187
  await this.eventBusModuleService_?.emit(restoredEntities.map(({ id }) => ({
194
188
  eventName: this.entityName_ + "." + utils_1.CommonEvents.ATTACHED,
195
- body: {
196
- metadata: {
197
- service: this.serviceName_,
198
- action: utils_1.CommonEvents.ATTACHED,
199
- object: this.entityName_,
200
- eventGroupId: sharedContext.eventGroupId,
201
- },
202
- data: { id },
189
+ metadata: {
190
+ source: this.serviceName_,
191
+ action: utils_1.CommonEvents.ATTACHED,
192
+ object: this.entityName_,
193
+ eventGroupId: sharedContext.eventGroupId,
203
194
  },
195
+ data: { id },
204
196
  })));
205
197
  return mappedCascadedEntitiesMap ? mappedCascadedEntitiesMap : void 0;
206
198
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@medusajs/link-modules",
3
- "version": "0.2.12-snapshot-20240607093839",
3
+ "version": "0.2.12-snapshot-20240703074611",
4
4
  "description": "Medusa Default Link Modules Package and Definitions",
5
5
  "main": "dist/index.js",
6
6
  "types": "dist/index.d.ts",
@@ -16,7 +16,7 @@
16
16
  "access": "public"
17
17
  },
18
18
  "engines": {
19
- "node": ">=16"
19
+ "node": ">=20"
20
20
  },
21
21
  "author": "Medusa",
22
22
  "license": "MIT",
@@ -29,19 +29,18 @@
29
29
  "test:integration": "jest --passWithNoTests"
30
30
  },
31
31
  "devDependencies": {
32
- "@medusajs/types": "1.12.0-snapshot-20240607093839",
32
+ "@medusajs/types": "1.12.0-snapshot-20240703074611",
33
33
  "cross-env": "^5.2.1",
34
- "jest": "^29.6.3",
34
+ "jest": "^29.7.0",
35
35
  "pg-god": "^1.0.12",
36
36
  "rimraf": "^5.0.1",
37
- "ts-jest": "^29.1.1",
38
37
  "ts-node": "^10.9.1",
39
38
  "tsc-alias": "^1.8.6",
40
39
  "typescript": "^5.1.6"
41
40
  },
42
41
  "dependencies": {
43
- "@medusajs/modules-sdk": "1.13.0-snapshot-20240607093839",
44
- "@medusajs/utils": "1.12.0-snapshot-20240607093839",
42
+ "@medusajs/modules-sdk": "1.13.0-snapshot-20240703074611",
43
+ "@medusajs/utils": "1.12.0-snapshot-20240703074611",
45
44
  "@mikro-orm/core": "5.9.7",
46
45
  "@mikro-orm/postgresql": "5.9.7",
47
46
  "awilix": "^8.0.0"
@@ -1,2 +0,0 @@
1
- import { ModuleJoinerConfig } from "@medusajs/types";
2
- export declare const StoreDefaultCurrency: ModuleJoinerConfig;
@@ -1,19 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.StoreDefaultCurrency = void 0;
4
- const modules_sdk_1 = require("@medusajs/modules-sdk");
5
- exports.StoreDefaultCurrency = {
6
- isLink: true,
7
- isReadOnlyLink: true,
8
- extends: [
9
- {
10
- serviceName: modules_sdk_1.Modules.STORE,
11
- relationship: {
12
- serviceName: modules_sdk_1.Modules.CURRENCY,
13
- primaryKey: "code",
14
- foreignKey: "default_currency_code",
15
- alias: "default_currency",
16
- },
17
- },
18
- ],
19
- };