@medusajs/link-modules 0.2.12-snapshot-20240718083016 → 0.2.12-snapshot-20240719080828
Sign up to get free protection for your applications and to get access to all the features.
- package/dist/definitions/cart-payment-collection.d.ts +1 -0
- package/dist/definitions/cart-payment-collection.d.ts.map +1 -0
- package/dist/definitions/cart-payment-collection.js +10 -5
- package/dist/definitions/cart-promotion.d.ts +1 -0
- package/dist/definitions/cart-promotion.d.ts.map +1 -0
- package/dist/definitions/cart-promotion.js +14 -14
- package/dist/definitions/fulfillment-set-location.d.ts +2 -1
- package/dist/definitions/fulfillment-set-location.d.ts.map +1 -0
- package/dist/definitions/fulfillment-set-location.js +35 -30
- package/dist/definitions/index.d.ts +5 -9
- package/dist/definitions/index.d.ts.map +1 -0
- package/dist/definitions/index.js +4 -9
- package/dist/definitions/order-cart.d.ts +3 -0
- package/dist/definitions/order-cart.d.ts.map +1 -0
- package/dist/definitions/order-cart.js +67 -0
- package/dist/definitions/order-claim-payment-collection.d.ts +3 -0
- package/dist/definitions/order-claim-payment-collection.d.ts.map +1 -0
- package/dist/definitions/order-claim-payment-collection.js +73 -0
- package/dist/definitions/order-exchange-payment-collection.d.ts +3 -0
- package/dist/definitions/order-exchange-payment-collection.d.ts.map +1 -0
- package/dist/definitions/order-exchange-payment-collection.js +73 -0
- package/dist/definitions/order-fulfillment.d.ts +3 -0
- package/dist/definitions/order-fulfillment.d.ts.map +1 -0
- package/dist/definitions/order-fulfillment.js +66 -0
- package/dist/definitions/order-payment-collection.d.ts +3 -0
- package/dist/definitions/order-payment-collection.d.ts.map +1 -0
- package/dist/definitions/order-payment-collection.js +70 -0
- package/dist/definitions/order-promotion.d.ts +1 -0
- package/dist/definitions/order-promotion.d.ts.map +1 -0
- package/dist/definitions/order-promotion.js +15 -7
- package/dist/definitions/product-sales-channel.d.ts +1 -0
- package/dist/definitions/product-sales-channel.d.ts.map +1 -0
- package/dist/definitions/product-sales-channel.js +10 -7
- package/dist/definitions/product-variant-inventory-item.d.ts +1 -0
- package/dist/definitions/product-variant-inventory-item.d.ts.map +1 -0
- package/dist/definitions/product-variant-inventory-item.js +13 -7
- package/dist/definitions/product-variant-price-set.d.ts +1 -0
- package/dist/definitions/product-variant-price-set.d.ts.map +1 -0
- package/dist/definitions/product-variant-price-set.js +9 -8
- package/dist/definitions/publishable-api-key-sales-channel.d.ts +1 -0
- package/dist/definitions/publishable-api-key-sales-channel.d.ts.map +1 -0
- package/dist/definitions/publishable-api-key-sales-channel.js +10 -5
- package/dist/definitions/{cart-customer.d.ts → readonly/cart-customer.d.ts} +1 -0
- package/dist/definitions/readonly/cart-customer.d.ts.map +1 -0
- package/dist/definitions/{cart-customer.js → readonly/cart-customer.js} +11 -5
- package/dist/definitions/readonly/cart-product.d.ts +3 -0
- package/dist/definitions/readonly/cart-product.d.ts.map +1 -0
- package/dist/definitions/readonly/cart-product.js +47 -0
- package/dist/definitions/{cart-region.d.ts → readonly/cart-region.d.ts} +1 -0
- package/dist/definitions/readonly/cart-region.d.ts.map +1 -0
- package/dist/definitions/{cart-region.js → readonly/cart-region.js} +11 -5
- package/dist/definitions/{cart-sales-channel.d.ts → readonly/cart-sales-channel.d.ts} +1 -0
- package/dist/definitions/readonly/cart-sales-channel.d.ts.map +1 -0
- package/dist/definitions/{cart-sales-channel.js → readonly/cart-sales-channel.js} +11 -5
- package/dist/definitions/readonly/index.d.ts +12 -0
- package/dist/definitions/readonly/index.d.ts.map +1 -0
- package/dist/definitions/readonly/index.js +27 -0
- package/dist/definitions/{inventory-level-stock-location.d.ts → readonly/inventory-level-stock-location.d.ts} +1 -0
- package/dist/definitions/readonly/inventory-level-stock-location.d.ts.map +1 -0
- package/dist/definitions/{inventory-level-stock-location.js → readonly/inventory-level-stock-location.js} +6 -3
- package/dist/definitions/readonly/line-item-adjustment-promotion.d.ts +3 -0
- package/dist/definitions/readonly/line-item-adjustment-promotion.d.ts.map +1 -0
- package/dist/definitions/readonly/line-item-adjustment-promotion.js +22 -0
- package/dist/definitions/{order-customer.d.ts → readonly/order-customer.d.ts} +1 -0
- package/dist/definitions/readonly/order-customer.d.ts.map +1 -0
- package/dist/definitions/{order-customer.js → readonly/order-customer.js} +11 -5
- package/dist/definitions/readonly/order-product.d.ts +3 -0
- package/dist/definitions/readonly/order-product.d.ts.map +1 -0
- package/dist/definitions/readonly/order-product.js +47 -0
- package/dist/definitions/{order-region.d.ts → readonly/order-region.d.ts} +1 -0
- package/dist/definitions/readonly/order-region.d.ts.map +1 -0
- package/dist/definitions/{order-region.js → readonly/order-region.js} +11 -5
- package/dist/definitions/{order-sales-channel.d.ts → readonly/order-sales-channel.d.ts} +1 -0
- package/dist/definitions/readonly/order-sales-channel.d.ts.map +1 -0
- package/dist/definitions/readonly/order-sales-channel.js +35 -0
- package/dist/definitions/readonly/store-currency.d.ts +3 -0
- package/dist/definitions/readonly/store-currency.d.ts.map +1 -0
- package/dist/definitions/readonly/store-currency.js +22 -0
- package/dist/definitions/region-payment-provider.d.ts +1 -0
- package/dist/definitions/region-payment-provider.d.ts.map +1 -0
- package/dist/definitions/region-payment-provider.js +7 -5
- package/dist/definitions/sales-channel-location.d.ts +1 -0
- package/dist/definitions/sales-channel-location.d.ts.map +1 -0
- package/dist/definitions/sales-channel-location.js +10 -5
- package/dist/definitions/shipping-option-price-set.d.ts +1 -0
- package/dist/definitions/shipping-option-price-set.d.ts.map +1 -0
- package/dist/definitions/shipping-option-price-set.js +7 -5
- package/dist/index.d.ts +1 -0
- package/dist/index.d.ts.map +1 -0
- package/dist/initialize/index.d.ts +2 -0
- package/dist/initialize/index.d.ts.map +1 -0
- package/dist/initialize/index.js +30 -14
- package/dist/initialize/module-definition.d.ts +1 -0
- package/dist/initialize/module-definition.d.ts.map +1 -0
- package/dist/loaders/connection.d.ts +1 -0
- package/dist/loaders/connection.d.ts.map +1 -0
- package/dist/loaders/container.d.ts +1 -0
- package/dist/loaders/container.d.ts.map +1 -0
- package/dist/loaders/index.d.ts +1 -0
- package/dist/loaders/index.d.ts.map +1 -0
- package/dist/migration/index.d.ts +2 -0
- package/dist/migration/index.d.ts.map +1 -0
- package/dist/migration/index.js +31 -7
- package/dist/repositories/index.d.ts +1 -0
- package/dist/repositories/index.d.ts.map +1 -0
- package/dist/repositories/link.d.ts +6 -4
- package/dist/repositories/link.d.ts.map +1 -0
- package/dist/services/dynamic-service-class.d.ts +1 -0
- package/dist/services/dynamic-service-class.d.ts.map +1 -0
- package/dist/services/dynamic-service-class.js +7 -0
- package/dist/services/index.d.ts +1 -0
- package/dist/services/index.d.ts.map +1 -0
- package/dist/services/link-module-service.d.ts +1 -0
- package/dist/services/link-module-service.d.ts.map +1 -0
- package/dist/services/link-module-service.js +28 -36
- package/dist/services/link.d.ts +1 -0
- package/dist/services/link.d.ts.map +1 -0
- package/dist/types/index.d.ts +1 -0
- package/dist/types/index.d.ts.map +1 -0
- package/dist/utils/compose-link-name.d.ts +1 -0
- package/dist/utils/compose-link-name.d.ts.map +1 -0
- package/dist/utils/generate-entity.d.ts +1 -0
- package/dist/utils/generate-entity.d.ts.map +1 -0
- package/dist/utils/generate-schema.d.ts +1 -0
- package/dist/utils/generate-schema.d.ts.map +1 -0
- package/dist/utils/generate-schema.js +5 -4
- package/dist/utils/index.d.ts +1 -0
- package/dist/utils/index.d.ts.map +1 -0
- package/dist/utils/index.js +2 -2
- package/package.json +6 -7
- package/dist/definitions/order-sales-channel.js +0 -67
- package/dist/definitions/product-shipping-profile.d.ts +0 -2
- package/dist/definitions/product-shipping-profile.js +0 -61
- package/dist/definitions/store-default-currency.d.ts +0 -2
- package/dist/definitions/store-default-currency.js +0 -19
@@ -1,18 +1,21 @@
|
|
1
1
|
"use strict";
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
3
3
|
exports.InventoryLevelStockLocation = void 0;
|
4
|
-
const
|
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:
|
10
|
+
serviceName: utils_1.Modules.INVENTORY,
|
11
11
|
relationship: {
|
12
|
-
serviceName:
|
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
|
},
|
@@ -0,0 +1 @@
|
|
1
|
+
{"version":3,"file":"line-item-adjustment-promotion.d.ts","sourceRoot":"","sources":["../../../src/definitions/readonly/line-item-adjustment-promotion.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,kBAAkB,EAAE,MAAM,iBAAiB,CAAA;AAGpD,eAAO,MAAM,2BAA2B,EAAE,kBAiBzC,CAAA"}
|
@@ -0,0 +1,22 @@
|
|
1
|
+
"use strict";
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
3
|
+
exports.LineItemAdjustmentPromotion = void 0;
|
4
|
+
const utils_1 = require("@medusajs/utils");
|
5
|
+
exports.LineItemAdjustmentPromotion = {
|
6
|
+
isLink: true,
|
7
|
+
isReadOnlyLink: true,
|
8
|
+
extends: [
|
9
|
+
{
|
10
|
+
serviceName: utils_1.Modules.CART,
|
11
|
+
relationship: {
|
12
|
+
serviceName: utils_1.Modules.PROMOTION,
|
13
|
+
primaryKey: "id",
|
14
|
+
foreignKey: "promotion_id",
|
15
|
+
alias: "promotion",
|
16
|
+
args: {
|
17
|
+
methodSuffix: "Promotions",
|
18
|
+
},
|
19
|
+
},
|
20
|
+
},
|
21
|
+
],
|
22
|
+
};
|
@@ -0,0 +1 @@
|
|
1
|
+
{"version":3,"file":"order-customer.d.ts","sourceRoot":"","sources":["../../../src/definitions/readonly/order-customer.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,kBAAkB,EAAE,MAAM,iBAAiB,CAAA;AAGpD,eAAO,MAAM,aAAa,EAAE,kBA8B3B,CAAA"}
|
@@ -1,27 +1,33 @@
|
|
1
1
|
"use strict";
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
3
3
|
exports.OrderCustomer = void 0;
|
4
|
-
const
|
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:
|
10
|
+
serviceName: utils_1.Modules.ORDER,
|
11
11
|
relationship: {
|
12
|
-
serviceName:
|
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:
|
22
|
+
serviceName: utils_1.Modules.CUSTOMER,
|
20
23
|
relationship: {
|
21
|
-
serviceName:
|
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
|
},
|
@@ -0,0 +1 @@
|
|
1
|
+
{"version":3,"file":"order-product.d.ts","sourceRoot":"","sources":["../../../src/definitions/readonly/order-product.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,kBAAkB,EAAE,MAAM,iBAAiB,CAAA;AAGpD,eAAO,MAAM,YAAY,EAAE,kBA0C1B,CAAA"}
|
@@ -0,0 +1,47 @@
|
|
1
|
+
"use strict";
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
3
|
+
exports.OrderProduct = void 0;
|
4
|
+
const utils_1 = require("@medusajs/utils");
|
5
|
+
exports.OrderProduct = {
|
6
|
+
isLink: true,
|
7
|
+
isReadOnlyLink: true,
|
8
|
+
extends: [
|
9
|
+
{
|
10
|
+
serviceName: utils_1.Modules.ORDER,
|
11
|
+
relationship: {
|
12
|
+
serviceName: utils_1.Modules.PRODUCT,
|
13
|
+
primaryKey: "id",
|
14
|
+
foreignKey: "items.product_id",
|
15
|
+
alias: "product",
|
16
|
+
args: {
|
17
|
+
methodSuffix: "Products",
|
18
|
+
},
|
19
|
+
},
|
20
|
+
},
|
21
|
+
{
|
22
|
+
serviceName: utils_1.Modules.ORDER,
|
23
|
+
relationship: {
|
24
|
+
serviceName: utils_1.Modules.PRODUCT,
|
25
|
+
primaryKey: "id",
|
26
|
+
foreignKey: "items.variant_id",
|
27
|
+
alias: "variant",
|
28
|
+
args: {
|
29
|
+
methodSuffix: "ProductVariants",
|
30
|
+
},
|
31
|
+
},
|
32
|
+
},
|
33
|
+
{
|
34
|
+
serviceName: utils_1.Modules.PRODUCT,
|
35
|
+
relationship: {
|
36
|
+
serviceName: utils_1.Modules.ORDER,
|
37
|
+
primaryKey: "variant_id",
|
38
|
+
foreignKey: "id",
|
39
|
+
alias: "order_items",
|
40
|
+
isList: true,
|
41
|
+
args: {
|
42
|
+
methodSuffix: "LineItems",
|
43
|
+
},
|
44
|
+
},
|
45
|
+
},
|
46
|
+
],
|
47
|
+
};
|
@@ -0,0 +1 @@
|
|
1
|
+
{"version":3,"file":"order-region.d.ts","sourceRoot":"","sources":["../../../src/definitions/readonly/order-region.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,kBAAkB,EAAE,MAAM,iBAAiB,CAAA;AAGpD,eAAO,MAAM,WAAW,EAAE,kBA8BzB,CAAA"}
|
@@ -1,27 +1,33 @@
|
|
1
1
|
"use strict";
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
3
3
|
exports.OrderRegion = void 0;
|
4
|
-
const
|
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:
|
10
|
+
serviceName: utils_1.Modules.ORDER,
|
11
11
|
relationship: {
|
12
|
-
serviceName:
|
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:
|
22
|
+
serviceName: utils_1.Modules.REGION,
|
20
23
|
relationship: {
|
21
|
-
serviceName:
|
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
|
},
|
@@ -0,0 +1 @@
|
|
1
|
+
{"version":3,"file":"order-sales-channel.d.ts","sourceRoot":"","sources":["../../../src/definitions/readonly/order-sales-channel.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,kBAAkB,EAAE,MAAM,iBAAiB,CAAA;AAGpD,eAAO,MAAM,iBAAiB,EAAE,kBA8B/B,CAAA"}
|
@@ -0,0 +1,35 @@
|
|
1
|
+
"use strict";
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
3
|
+
exports.OrderSalesChannel = void 0;
|
4
|
+
const utils_1 = require("@medusajs/utils");
|
5
|
+
exports.OrderSalesChannel = {
|
6
|
+
isLink: true,
|
7
|
+
isReadOnlyLink: true,
|
8
|
+
extends: [
|
9
|
+
{
|
10
|
+
serviceName: utils_1.Modules.ORDER,
|
11
|
+
relationship: {
|
12
|
+
serviceName: utils_1.Modules.SALES_CHANNEL,
|
13
|
+
primaryKey: "id",
|
14
|
+
foreignKey: "sales_channel_id",
|
15
|
+
alias: "sales_channel",
|
16
|
+
args: {
|
17
|
+
methodSuffix: "SalesChannels",
|
18
|
+
},
|
19
|
+
},
|
20
|
+
},
|
21
|
+
{
|
22
|
+
serviceName: utils_1.Modules.SALES_CHANNEL,
|
23
|
+
relationship: {
|
24
|
+
serviceName: utils_1.Modules.ORDER,
|
25
|
+
primaryKey: "sales_channel_id",
|
26
|
+
foreignKey: "id",
|
27
|
+
alias: "orders",
|
28
|
+
args: {
|
29
|
+
methodSuffix: "Orders",
|
30
|
+
},
|
31
|
+
isList: true,
|
32
|
+
},
|
33
|
+
},
|
34
|
+
],
|
35
|
+
};
|
@@ -0,0 +1 @@
|
|
1
|
+
{"version":3,"file":"store-currency.d.ts","sourceRoot":"","sources":["../../../src/definitions/readonly/store-currency.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,kBAAkB,EAAE,MAAM,iBAAiB,CAAA;AAGpD,eAAO,MAAM,eAAe,EAAE,kBAiB7B,CAAA"}
|
@@ -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
|
+
};
|
@@ -0,0 +1 @@
|
|
1
|
+
{"version":3,"file":"region-payment-provider.d.ts","sourceRoot":"","sources":["../../src/definitions/region-payment-provider.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,kBAAkB,EAAE,MAAM,iBAAiB,CAAA;AAGpD,eAAO,MAAM,qBAAqB,EAAE,kBA8DnC,CAAA"}
|
@@ -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:
|
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:
|
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:
|
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:
|
54
|
+
serviceName: utils_1.Modules.PAYMENT,
|
53
55
|
fieldAlias: {
|
54
56
|
regions: "region_link.region",
|
55
57
|
},
|
@@ -0,0 +1 @@
|
|
1
|
+
{"version":3,"file":"sales-channel-location.d.ts","sourceRoot":"","sources":["../../src/definitions/sales-channel-location.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,kBAAkB,EAAE,MAAM,iBAAiB,CAAA;AAGpD,eAAO,MAAM,oBAAoB,EAAE,kBAgElC,CAAA"}
|
@@ -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:
|
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:
|
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:
|
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:
|
56
|
+
serviceName: utils_1.Modules.STOCK_LOCATION,
|
52
57
|
fieldAlias: {
|
53
58
|
sales_channels: "sales_channels_link.sales_channel",
|
54
59
|
},
|
@@ -0,0 +1 @@
|
|
1
|
+
{"version":3,"file":"shipping-option-price-set.d.ts","sourceRoot":"","sources":["../../src/definitions/shipping-option-price-set.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,kBAAkB,EAAE,MAAM,iBAAiB,CAAA;AAGpD,eAAO,MAAM,sBAAsB,EAAE,kBAsEpC,CAAA"}
|
@@ -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:
|
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:
|
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:
|
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:
|
63
|
+
serviceName: utils_1.Modules.PRICING,
|
62
64
|
relationship: {
|
63
65
|
serviceName: utils_1.LINKS.ShippingOptionPriceSet,
|
64
66
|
primaryKey: "price_set_id",
|
package/dist/index.d.ts
CHANGED
@@ -0,0 +1 @@
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,cAAc,cAAc,CAAA;AAC5B,cAAc,SAAS,CAAA;AACvB,cAAc,WAAW,CAAA;AACzB,cAAc,YAAY,CAAA;AAC1B,cAAc,2BAA2B,CAAA"}
|
@@ -5,3 +5,5 @@ export declare const initialize: (options?: ModuleServiceInitializeOptions | Mod
|
|
5
5
|
[link: string]: ILinkModule;
|
6
6
|
}>;
|
7
7
|
export declare function runMigrations({ options, logger, }: Omit<LoaderOptions<ModuleServiceInitializeOptions>, "container">, modulesDefinition?: ModuleJoinerConfig[]): Promise<void>;
|
8
|
+
export declare function revertMigrations({ options, logger, }: Omit<LoaderOptions<ModuleServiceInitializeOptions>, "container">, modulesDefinition?: ModuleJoinerConfig[]): Promise<void>;
|
9
|
+
//# sourceMappingURL=index.d.ts.map
|
@@ -0,0 +1 @@
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/initialize/index.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,yBAAyB,EAI1B,MAAM,uBAAuB,CAAA;AAC9B,OAAO,EACL,yBAAyB,EACzB,WAAW,EAEX,aAAa,EAEb,kBAAkB,EAClB,6CAA6C,EAC7C,8BAA8B,EAC/B,MAAM,iBAAiB,CAAA;AAWxB,OAAO,EAAE,sCAAsC,EAAE,MAAM,UAAU,CAAA;AAQjE,eAAO,MAAM,UAAU,aAEjB,8BAA8B,GAC9B,6CAA6C,GAC7C,yBAAyB,GACzB,yBAAyB,sBACT,kBAAkB,EAAE,yBACjB,sCAAsC,KAC5D,QAAQ;IAAE,CAAC,IAAI,EAAE,MAAM,GAAG,WAAW,CAAA;CAAE,CAgJzC,CAAA;AA6DD,wBAAsB,aAAa,CACjC,EACE,OAAO,EACP,MAAM,GACP,EAAE,IAAI,CAAC,aAAa,CAAC,8BAA8B,CAAC,EAAE,WAAW,CAAC,EACnE,iBAAiB,CAAC,EAAE,kBAAkB,EAAE,iBAGzC;AAED,wBAAsB,gBAAgB,CACpC,EACE,OAAO,EACP,MAAM,GACP,EAAE,IAAI,CAAC,aAAa,CAAC,8BAA8B,CAAC,EAAE,WAAW,CAAC,EACnE,iBAAiB,CAAC,EAAE,kBAAkB,EAAE,iBAGzC"}
|
package/dist/initialize/index.js
CHANGED
@@ -23,9 +23,8 @@ var __importStar = (this && this.__importStar) || function (mod) {
|
|
23
23
|
return result;
|
24
24
|
};
|
25
25
|
Object.defineProperty(exports, "__esModule", { value: true });
|
26
|
-
exports.runMigrations = exports.initialize = void 0;
|
26
|
+
exports.revertMigrations = exports.runMigrations = exports.initialize = void 0;
|
27
27
|
const modules_sdk_1 = require("@medusajs/modules-sdk");
|
28
|
-
const types_1 = require("@medusajs/types");
|
29
28
|
const utils_1 = require("@medusajs/utils");
|
30
29
|
const linkDefinitions = __importStar(require("../definitions"));
|
31
30
|
const migration_1 = require("../migration");
|
@@ -45,6 +44,14 @@ const initialize = async (options, modulesDefinition, injectedDependencies) => {
|
|
45
44
|
!definition.isReadOnlyLink) {
|
46
45
|
throw new Error(`Foreign key cannot be a composed key.`);
|
47
46
|
}
|
47
|
+
if (Array.isArray(definition.extraDataFields)) {
|
48
|
+
const extraDataFields = definition.extraDataFields;
|
49
|
+
const definedDbFields = Object.keys(definition.databaseConfig?.extraFields || {});
|
50
|
+
const difference = (0, utils_1.arrayDifference)(extraDataFields, definedDbFields);
|
51
|
+
if (difference.length) {
|
52
|
+
throw new Error(`extraDataFields (fieldNames: ${difference.join(",")}) need to be configured under databaseConfig (serviceName: ${definition.serviceName}).`);
|
53
|
+
}
|
54
|
+
}
|
48
55
|
const serviceKey = !definition.isReadOnlyLink
|
49
56
|
? (0, utils_1.lowerCaseFirst)(definition.serviceName ??
|
50
57
|
(0, utils_2.composeLinkName)(primary.serviceName, primary.foreignKey, foreign.serviceName, foreign.foreignKey))
|
@@ -68,19 +75,19 @@ const initialize = async (options, modulesDefinition, injectedDependencies) => {
|
|
68
75
|
continue;
|
69
76
|
}
|
70
77
|
}
|
71
|
-
else if ((
|
72
|
-
!modulesLoadedKeys.includes(
|
73
|
-
(!foreign.isInternalService &&
|
74
|
-
!modulesLoadedKeys.includes(foreign.serviceName))) {
|
78
|
+
else if (!modulesLoadedKeys.includes(primary.serviceName) ||
|
79
|
+
!modulesLoadedKeys.includes(foreign.serviceName)) {
|
75
80
|
continue;
|
76
81
|
}
|
77
82
|
const logger = injectedDependencies?.[utils_1.ContainerRegistrationKeys.LOGGER] ?? console;
|
78
83
|
definition.schema = (0, utils_2.generateGraphQLSchema)(definition, primary, foreign, {
|
79
84
|
logger,
|
80
85
|
});
|
81
|
-
|
86
|
+
if (!Array.isArray(definition.alias)) {
|
87
|
+
definition.alias = definition.alias ? [definition.alias] : [];
|
88
|
+
}
|
82
89
|
for (const alias of definition.alias) {
|
83
|
-
alias.args
|
90
|
+
alias.args ??= {};
|
84
91
|
alias.args.entity = (0, utils_1.toPascalCase)("Link_" +
|
85
92
|
(definition.databaseConfig?.tableName ??
|
86
93
|
(0, utils_2.composeTableName)(primary.serviceName, primary.foreignKey, foreign.serviceName, foreign.foreignKey)));
|
@@ -90,12 +97,12 @@ const initialize = async (options, modulesDefinition, injectedDependencies) => {
|
|
90
97
|
key: serviceKey,
|
91
98
|
registrationName: serviceKey,
|
92
99
|
label: serviceKey,
|
93
|
-
dependencies: [
|
100
|
+
dependencies: [utils_1.ModuleRegistrationName.EVENT_BUS],
|
94
101
|
defaultModuleDeclaration: {
|
95
|
-
scope:
|
102
|
+
scope: modules_sdk_1.MODULE_SCOPE.INTERNAL,
|
96
103
|
resources: injectedDependencies?.[utils_1.ContainerRegistrationKeys.PG_CONNECTION]
|
97
|
-
?
|
98
|
-
:
|
104
|
+
? modules_sdk_1.MODULE_RESOURCE_TYPE.SHARED
|
105
|
+
: modules_sdk_1.MODULE_RESOURCE_TYPE.ISOLATED,
|
99
106
|
},
|
100
107
|
};
|
101
108
|
const loaded = await modules_sdk_1.MedusaModule.bootstrapLink({
|
@@ -109,7 +116,7 @@ const initialize = async (options, modulesDefinition, injectedDependencies) => {
|
|
109
116
|
return allLinks;
|
110
117
|
};
|
111
118
|
exports.initialize = initialize;
|
112
|
-
async function
|
119
|
+
async function applyMigrationUpOrDown({ options, logger, }, modulesDefinition, revert = false) {
|
113
120
|
const modulesLoadedKeys = modules_sdk_1.MedusaModule.getLoadedModules().map((mod) => Object.keys(mod)[0]);
|
114
121
|
const allLinksToLoad = Object.values(linkDefinitions).concat(modulesDefinition ?? []);
|
115
122
|
const allLinks = new Set();
|
@@ -131,8 +138,17 @@ async function runMigrations({ options, logger, }, modulesDefinition) {
|
|
131
138
|
!modulesLoadedKeys.includes(foreign.serviceName)) {
|
132
139
|
continue;
|
133
140
|
}
|
134
|
-
const migrate =
|
141
|
+
const migrate = revert
|
142
|
+
? (0, migration_1.getRevertMigration)(definition, serviceKey, primary, foreign)
|
143
|
+
: (0, migration_1.getMigration)(definition, serviceKey, primary, foreign);
|
135
144
|
await migrate({ options, logger });
|
136
145
|
}
|
137
146
|
}
|
147
|
+
async function runMigrations({ options, logger, }, modulesDefinition) {
|
148
|
+
await applyMigrationUpOrDown({ options, logger }, modulesDefinition);
|
149
|
+
}
|
138
150
|
exports.runMigrations = runMigrations;
|
151
|
+
async function revertMigrations({ options, logger, }, modulesDefinition) {
|
152
|
+
await applyMigrationUpOrDown({ options, logger }, modulesDefinition, true);
|
153
|
+
}
|
154
|
+
exports.revertMigrations = revertMigrations;
|
@@ -1,2 +1,3 @@
|
|
1
1
|
import { JoinerRelationship, ModuleExports, ModuleJoinerConfig } from "@medusajs/types";
|
2
2
|
export declare function getLinkModuleDefinition(joinerConfig: ModuleJoinerConfig, primary: JoinerRelationship, foreign: JoinerRelationship): ModuleExports;
|
3
|
+
//# sourceMappingURL=module-definition.d.ts.map
|
@@ -0,0 +1 @@
|
|
1
|
+
{"version":3,"file":"module-definition.d.ts","sourceRoot":"","sources":["../../src/initialize/module-definition.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,kBAAkB,EAClB,aAAa,EACb,kBAAkB,EACnB,MAAM,iBAAiB,CAAA;AAIxB,wBAAgB,uBAAuB,CACrC,YAAY,EAAE,kBAAkB,EAChC,OAAO,EAAE,kBAAkB,EAC3B,OAAO,EAAE,kBAAkB,GAC1B,aAAa,CAWf"}
|
@@ -1,3 +1,4 @@
|
|
1
1
|
import { InternalModuleDeclaration, LoaderOptions, ModuleServiceInitializeCustomDataLayerOptions, ModuleServiceInitializeOptions } from "@medusajs/modules-sdk";
|
2
2
|
import { EntitySchema } from "@mikro-orm/core";
|
3
3
|
export declare function connectionLoader(entity: EntitySchema): ({ options, container, logger, }: LoaderOptions<ModuleServiceInitializeOptions | ModuleServiceInitializeCustomDataLayerOptions>, moduleDeclaration?: InternalModuleDeclaration) => Promise<void>;
|
4
|
+
//# sourceMappingURL=connection.d.ts.map
|
@@ -0,0 +1 @@
|
|
1
|
+
{"version":3,"file":"connection.d.ts","sourceRoot":"","sources":["../../src/loaders/connection.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,yBAAyB,EACzB,aAAa,EACb,6CAA6C,EAC7C,8BAA8B,EAC/B,MAAM,uBAAuB,CAAA;AAG9B,OAAO,EAAE,YAAY,EAAE,MAAM,iBAAiB,CAAA;AAE9C,wBAAgB,gBAAgB,CAAC,MAAM,EAAE,YAAY,qCAM9C,cACC,8BAA8B,GAC9B,6CAA6C,CAChD,sBACmB,yBAAyB,KAC5C,QAAQ,IAAI,CAAC,CAajB"}
|
@@ -1,3 +1,4 @@
|
|
1
1
|
import { LoaderOptions } from "@medusajs/modules-sdk";
|
2
2
|
import { InternalModuleDeclaration, ModuleJoinerConfig, ModulesSdkTypes } from "@medusajs/types";
|
3
3
|
export declare function containerLoader(entity: any, joinerConfig: ModuleJoinerConfig): ({ options, container, }: LoaderOptions<ModulesSdkTypes.ModuleServiceInitializeOptions | ModulesSdkTypes.ModuleServiceInitializeCustomDataLayerOptions>, moduleDeclaration?: InternalModuleDeclaration) => Promise<void>;
|
4
|
+
//# sourceMappingURL=container.d.ts.map
|
@@ -0,0 +1 @@
|
|
1
|
+
{"version":3,"file":"container.d.ts","sourceRoot":"","sources":["../../src/loaders/container.ts"],"names":[],"mappings":"AAGA,OAAO,EAAE,aAAa,EAAE,MAAM,uBAAuB,CAAA;AACrD,OAAO,EACL,yBAAyB,EACzB,kBAAkB,EAClB,eAAe,EAChB,MAAM,iBAAiB,CAAA;AAKxB,wBAAgB,eAAe,CAAC,MAAM,KAAA,EAAE,YAAY,EAAE,kBAAkB,6BAKjE,cACC,gBAAgB,8BAA8B,GAC9C,gBAAgB,6CAA6C,CAChE,sBACmB,yBAAyB,KAC5C,QAAQ,IAAI,CAAC,CA2CjB"}
|
package/dist/loaders/index.d.ts
CHANGED
@@ -0,0 +1 @@
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/loaders/index.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,kBAAkB,EAClB,kBAAkB,EAClB,oBAAoB,EACrB,MAAM,iBAAiB,CAAA;AAMxB,wBAAgB,UAAU,CAAC,EACzB,YAAY,EACZ,OAAO,EACP,OAAO,GACR,EAAE;IACD,YAAY,EAAE,kBAAkB,CAAA;IAChC,OAAO,EAAE,kBAAkB,CAAA;IAC3B,OAAO,EAAE,kBAAkB,CAAA;CAC5B,GAAG,oBAAoB,EAAE,CAOzB"}
|
@@ -1,2 +1,4 @@
|
|
1
1
|
import { JoinerRelationship, LoaderOptions, ModuleJoinerConfig, ModuleServiceInitializeOptions } from "@medusajs/types";
|
2
2
|
export declare function getMigration(joinerConfig: ModuleJoinerConfig, serviceName: string, primary: JoinerRelationship, foreign: JoinerRelationship): ({ options, logger, }?: Pick<LoaderOptions<ModuleServiceInitializeOptions>, "options" | "logger">) => Promise<void>;
|
3
|
+
export declare function getRevertMigration(joinerConfig: ModuleJoinerConfig, serviceName: string, primary: JoinerRelationship, foreign: JoinerRelationship): ({ options, logger, }?: Pick<LoaderOptions<ModuleServiceInitializeOptions>, "options" | "logger">) => Promise<void>;
|
4
|
+
//# sourceMappingURL=index.d.ts.map
|
@@ -0,0 +1 @@
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/migration/index.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,kBAAkB,EAClB,aAAa,EAEb,kBAAkB,EAClB,8BAA8B,EAC/B,MAAM,iBAAiB,CAAA;AAKxB,wBAAgB,YAAY,CAC1B,YAAY,EAAE,kBAAkB,EAChC,WAAW,EAAE,MAAM,EACnB,OAAO,EAAE,kBAAkB,EAC3B,OAAO,EAAE,kBAAkB,2BAMtB,KACD,cAAc,8BAA8B,CAAC,EAC7C,SAAS,GAAG,QAAQ,CACrB,mBAkEJ;AAED,wBAAgB,kBAAkB,CAChC,YAAY,EAAE,kBAAkB,EAChC,WAAW,EAAE,MAAM,EACnB,OAAO,EAAE,kBAAkB,EAC3B,OAAO,EAAE,kBAAkB,2BAMtB,KACD,cAAc,8BAA8B,CAAC,EAC7C,SAAS,GAAG,QAAQ,CACrB,mBA4BJ"}
|