@medusajs/link-modules 0.2.12-snapshot-20240531102054 → 0.2.12-snapshot-20240701122250

Sign up to get free protection for your applications and to get access to all the features.
Files changed (38) 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/index.d.ts +2 -2
  5. package/dist/definitions/index.js +2 -2
  6. package/dist/definitions/order-cart.d.ts +2 -0
  7. package/dist/definitions/order-cart.js +67 -0
  8. package/dist/definitions/order-fulfillment.js +7 -5
  9. package/dist/definitions/order-payment-collection.js +10 -5
  10. package/dist/definitions/order-promotion.js +10 -5
  11. package/dist/definitions/product-sales-channel.js +10 -5
  12. package/dist/definitions/product-variant-inventory-item.js +10 -7
  13. package/dist/definitions/product-variant-price-set.js +8 -6
  14. package/dist/definitions/publishable-api-key-sales-channel.js +10 -5
  15. package/dist/definitions/readonly/cart-customer.js +11 -5
  16. package/dist/definitions/readonly/cart-product.js +11 -8
  17. package/dist/definitions/readonly/cart-region.js +11 -5
  18. package/dist/definitions/readonly/cart-sales-channel.js +11 -5
  19. package/dist/definitions/readonly/index.d.ts +1 -1
  20. package/dist/definitions/readonly/index.js +1 -1
  21. package/dist/definitions/readonly/inventory-level-stock-location.js +6 -3
  22. package/dist/definitions/readonly/line-item-adjustment-promotion.js +6 -3
  23. package/dist/definitions/readonly/order-customer.js +11 -5
  24. package/dist/definitions/readonly/order-product.js +11 -8
  25. package/dist/definitions/readonly/order-region.js +11 -5
  26. package/dist/definitions/readonly/order-sales-channel.js +11 -5
  27. package/dist/definitions/readonly/store-currency.d.ts +2 -0
  28. package/dist/definitions/readonly/store-currency.js +22 -0
  29. package/dist/definitions/region-payment-provider.js +7 -5
  30. package/dist/definitions/sales-channel-location.js +10 -5
  31. package/dist/definitions/shipping-option-price-set.js +7 -5
  32. package/dist/initialize/index.js +11 -1
  33. package/dist/repositories/link.d.ts +4 -1
  34. package/dist/services/dynamic-service-class.js +7 -0
  35. package/dist/services/link-module-service.js +24 -32
  36. package/package.json +6 -7
  37. package/dist/definitions/readonly/store-default-currency.d.ts +0 -2
  38. package/dist/definitions/readonly/store-default-currency.js +0 -19
@@ -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-20240531102054",
3
+ "version": "0.2.12-snapshot-20240701122250",
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-20240531102054",
32
+ "@medusajs/types": "1.12.0-snapshot-20240701122250",
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-20240531102054",
44
- "@medusajs/utils": "1.12.0-snapshot-20240531102054",
42
+ "@medusajs/modules-sdk": "1.13.0-snapshot-20240701122250",
43
+ "@medusajs/utils": "1.12.0-snapshot-20240701122250",
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
- };