@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.
- package/dist/definitions/cart-payment-collection.js +10 -5
- package/dist/definitions/cart-promotion.js +9 -4
- package/dist/definitions/fulfillment-set-location.js +10 -5
- package/dist/definitions/index.d.ts +2 -2
- package/dist/definitions/index.js +2 -2
- package/dist/definitions/order-cart.d.ts +2 -0
- package/dist/definitions/order-cart.js +67 -0
- package/dist/definitions/order-fulfillment.js +7 -5
- package/dist/definitions/order-payment-collection.js +10 -5
- package/dist/definitions/order-promotion.js +10 -5
- package/dist/definitions/product-sales-channel.js +10 -5
- package/dist/definitions/product-variant-inventory-item.js +10 -7
- package/dist/definitions/product-variant-price-set.js +8 -6
- package/dist/definitions/publishable-api-key-sales-channel.js +10 -5
- package/dist/definitions/readonly/cart-customer.js +11 -5
- package/dist/definitions/readonly/cart-product.js +11 -8
- package/dist/definitions/readonly/cart-region.js +11 -5
- package/dist/definitions/readonly/cart-sales-channel.js +11 -5
- package/dist/definitions/readonly/index.d.ts +1 -1
- package/dist/definitions/readonly/index.js +1 -1
- package/dist/definitions/readonly/inventory-level-stock-location.js +6 -3
- package/dist/definitions/readonly/line-item-adjustment-promotion.js +6 -3
- package/dist/definitions/readonly/order-customer.js +11 -5
- package/dist/definitions/readonly/order-product.js +11 -8
- package/dist/definitions/readonly/order-region.js +11 -5
- package/dist/definitions/readonly/order-sales-channel.js +11 -5
- package/dist/definitions/readonly/store-currency.d.ts +2 -0
- package/dist/definitions/readonly/store-currency.js +22 -0
- package/dist/definitions/region-payment-provider.js +7 -5
- package/dist/definitions/sales-channel-location.js +10 -5
- package/dist/definitions/shipping-option-price-set.js +7 -5
- package/dist/initialize/index.js +11 -1
- package/dist/repositories/link.d.ts +4 -1
- package/dist/services/dynamic-service-class.js +7 -0
- package/dist/services/link-module-service.js +24 -32
- package/package.json +6 -7
- package/dist/definitions/readonly/store-default-currency.d.ts +0 -2
- 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
|
-
|
97
|
-
|
98
|
-
|
99
|
-
|
100
|
-
|
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
|
-
|
128
|
-
|
129
|
-
|
130
|
-
|
131
|
-
|
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
|
-
|
160
|
-
|
161
|
-
|
162
|
-
|
163
|
-
|
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
|
-
|
196
|
-
|
197
|
-
|
198
|
-
|
199
|
-
|
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-
|
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": ">=
|
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-
|
32
|
+
"@medusajs/types": "1.12.0-snapshot-20240701122250",
|
33
33
|
"cross-env": "^5.2.1",
|
34
|
-
"jest": "^29.
|
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-
|
44
|
-
"@medusajs/utils": "1.12.0-snapshot-
|
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,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
|
-
};
|