@medusajs/types 1.11.8 → 1.11.9-next-20231213100322
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/bundles.d.ts +2 -0
- package/dist/bundles.js +3 -1
- package/dist/bundles.js.map +1 -1
- package/dist/common/medusa-container.d.ts +3 -0
- package/dist/customer/common.d.ts +23 -0
- package/dist/customer/common.js +3 -0
- package/dist/customer/common.js.map +1 -0
- package/dist/customer/index.d.ts +1 -0
- package/dist/customer/index.js +18 -0
- package/dist/customer/index.js.map +1 -0
- package/dist/index.d.ts +2 -0
- package/dist/index.js +2 -0
- package/dist/index.js.map +1 -1
- package/dist/pricing/common/price-list.d.ts +19 -5
- package/dist/pricing/common/price-rule.d.ts +21 -6
- package/dist/pricing/common/price-set-money-amount.d.ts +1 -0
- package/dist/pricing/common/price-set.d.ts +2 -1
- package/dist/product/service.d.ts +73 -1
- package/dist/region/common.d.ts +11 -0
- package/dist/region/common.js +3 -0
- package/dist/region/common.js.map +1 -0
- package/dist/region/index.d.ts +1 -0
- package/dist/region/index.js +18 -0
- package/dist/region/index.js.map +1 -0
- package/dist/workflow/price-list/create-price-list.d.ts +2 -2
- package/package.json +4 -1
package/dist/bundles.d.ts
CHANGED
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
export * as CacheTypes from "./cache";
|
|
2
2
|
export * as CommonTypes from "./common";
|
|
3
|
+
export * as CustomerTypes from "./customer";
|
|
3
4
|
export * as DAL from "./dal";
|
|
4
5
|
export * as EventBusTypes from "./event-bus";
|
|
5
6
|
export * as FeatureFlagTypes from "./feature-flag";
|
|
@@ -8,6 +9,7 @@ export * as LoggerTypes from "./logger";
|
|
|
8
9
|
export * as ModulesSdkTypes from "./modules-sdk";
|
|
9
10
|
export * as PricingTypes from "./pricing";
|
|
10
11
|
export * as ProductTypes from "./product";
|
|
12
|
+
export * as RegionTypes from "./region";
|
|
11
13
|
export * as SalesChannelTypes from "./sales-channel";
|
|
12
14
|
export * as SearchTypes from "./search";
|
|
13
15
|
export * as StockLocationTypes from "./stock-location";
|
package/dist/bundles.js
CHANGED
|
@@ -23,9 +23,10 @@ var __importStar = (this && this.__importStar) || function (mod) {
|
|
|
23
23
|
return result;
|
|
24
24
|
};
|
|
25
25
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
26
|
-
exports.WorkflowTypes = exports.TransactionBaseTypes = exports.StockLocationTypes = exports.SearchTypes = exports.SalesChannelTypes = exports.ProductTypes = exports.PricingTypes = exports.ModulesSdkTypes = exports.LoggerTypes = exports.InventoryTypes = exports.FeatureFlagTypes = exports.EventBusTypes = exports.DAL = exports.CommonTypes = exports.CacheTypes = void 0;
|
|
26
|
+
exports.WorkflowTypes = exports.TransactionBaseTypes = exports.StockLocationTypes = exports.SearchTypes = exports.SalesChannelTypes = exports.RegionTypes = exports.ProductTypes = exports.PricingTypes = exports.ModulesSdkTypes = exports.LoggerTypes = exports.InventoryTypes = exports.FeatureFlagTypes = exports.EventBusTypes = exports.DAL = exports.CustomerTypes = exports.CommonTypes = exports.CacheTypes = void 0;
|
|
27
27
|
exports.CacheTypes = __importStar(require("./cache"));
|
|
28
28
|
exports.CommonTypes = __importStar(require("./common"));
|
|
29
|
+
exports.CustomerTypes = __importStar(require("./customer"));
|
|
29
30
|
exports.DAL = __importStar(require("./dal"));
|
|
30
31
|
exports.EventBusTypes = __importStar(require("./event-bus"));
|
|
31
32
|
exports.FeatureFlagTypes = __importStar(require("./feature-flag"));
|
|
@@ -34,6 +35,7 @@ exports.LoggerTypes = __importStar(require("./logger"));
|
|
|
34
35
|
exports.ModulesSdkTypes = __importStar(require("./modules-sdk"));
|
|
35
36
|
exports.PricingTypes = __importStar(require("./pricing"));
|
|
36
37
|
exports.ProductTypes = __importStar(require("./product"));
|
|
38
|
+
exports.RegionTypes = __importStar(require("./region"));
|
|
37
39
|
exports.SalesChannelTypes = __importStar(require("./sales-channel"));
|
|
38
40
|
exports.SearchTypes = __importStar(require("./search"));
|
|
39
41
|
exports.StockLocationTypes = __importStar(require("./stock-location"));
|
package/dist/bundles.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"bundles.js","sourceRoot":"","sources":["../src/bundles.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;AAAA,sDAAqC;AACrC,wDAAuC;AACvC,6CAA4B;AAC5B,6DAA4C;AAC5C,mEAAkD;AAClD,8DAA6C;AAC7C,wDAAuC;AACvC,iEAAgD;AAChD,0DAAyC;AACzC,0DAAyC;AACzC,qEAAoD;AACpD,wDAAuC;AACvC,uEAAsD;AACtD,2EAA0D;AAC1D,4DAA2C"}
|
|
1
|
+
{"version":3,"file":"bundles.js","sourceRoot":"","sources":["../src/bundles.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;AAAA,sDAAqC;AACrC,wDAAuC;AACvC,4DAA2C;AAC3C,6CAA4B;AAC5B,6DAA4C;AAC5C,mEAAkD;AAClD,8DAA6C;AAC7C,wDAAuC;AACvC,iEAAgD;AAChD,0DAAyC;AACzC,0DAAyC;AACzC,wDAAuC;AACvC,qEAAoD;AACpD,wDAAuC;AACvC,uEAAsD;AACtD,2EAA0D;AAC1D,4DAA2C"}
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
import { AddressDTO } from "../address";
|
|
2
|
+
export interface CustomerDTO {
|
|
3
|
+
id: string;
|
|
4
|
+
email: string;
|
|
5
|
+
billing_address_id?: string | null;
|
|
6
|
+
shipping_address_id?: string | null;
|
|
7
|
+
first_name?: string | null;
|
|
8
|
+
last_name?: string | null;
|
|
9
|
+
billing_address?: AddressDTO;
|
|
10
|
+
shipping_address?: AddressDTO;
|
|
11
|
+
phone?: string | null;
|
|
12
|
+
has_account: boolean;
|
|
13
|
+
groups?: {
|
|
14
|
+
id: string;
|
|
15
|
+
}[];
|
|
16
|
+
orders: {
|
|
17
|
+
id: string;
|
|
18
|
+
}[];
|
|
19
|
+
metadata?: Record<string, unknown>;
|
|
20
|
+
deleted_at?: Date | string;
|
|
21
|
+
created_at?: Date | string;
|
|
22
|
+
updated_at?: Date | string;
|
|
23
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"common.js","sourceRoot":"","sources":["../../src/customer/common.ts"],"names":[],"mappings":""}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from "./common";
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
3
|
+
if (k2 === undefined) k2 = k;
|
|
4
|
+
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
5
|
+
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
6
|
+
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
7
|
+
}
|
|
8
|
+
Object.defineProperty(o, k2, desc);
|
|
9
|
+
}) : (function(o, m, k, k2) {
|
|
10
|
+
if (k2 === undefined) k2 = k;
|
|
11
|
+
o[k2] = m[k];
|
|
12
|
+
}));
|
|
13
|
+
var __exportStar = (this && this.__exportStar) || function(m, exports) {
|
|
14
|
+
for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
|
|
15
|
+
};
|
|
16
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
17
|
+
__exportStar(require("./common"), exports);
|
|
18
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/customer/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;AAAA,2CAAwB"}
|
package/dist/index.d.ts
CHANGED
|
@@ -3,6 +3,7 @@ export * from "./bundles";
|
|
|
3
3
|
export * from "./cache";
|
|
4
4
|
export * from "./cart";
|
|
5
5
|
export * from "./common";
|
|
6
|
+
export * from "./customer";
|
|
6
7
|
export * from "./dal";
|
|
7
8
|
export * from "./event-bus";
|
|
8
9
|
export * from "./feature-flag";
|
|
@@ -15,6 +16,7 @@ export * from "./modules-sdk";
|
|
|
15
16
|
export * from "./pricing";
|
|
16
17
|
export * from "./product";
|
|
17
18
|
export * from "./product-category";
|
|
19
|
+
export * from "./region";
|
|
18
20
|
export * from "./sales-channel";
|
|
19
21
|
export * from "./search";
|
|
20
22
|
export * from "./shared-context";
|
package/dist/index.js
CHANGED
|
@@ -19,6 +19,7 @@ __exportStar(require("./bundles"), exports);
|
|
|
19
19
|
__exportStar(require("./cache"), exports);
|
|
20
20
|
__exportStar(require("./cart"), exports);
|
|
21
21
|
__exportStar(require("./common"), exports);
|
|
22
|
+
__exportStar(require("./customer"), exports);
|
|
22
23
|
__exportStar(require("./dal"), exports);
|
|
23
24
|
__exportStar(require("./event-bus"), exports);
|
|
24
25
|
__exportStar(require("./feature-flag"), exports);
|
|
@@ -31,6 +32,7 @@ __exportStar(require("./modules-sdk"), exports);
|
|
|
31
32
|
__exportStar(require("./pricing"), exports);
|
|
32
33
|
__exportStar(require("./product"), exports);
|
|
33
34
|
__exportStar(require("./product-category"), exports);
|
|
35
|
+
__exportStar(require("./region"), exports);
|
|
34
36
|
__exportStar(require("./sales-channel"), exports);
|
|
35
37
|
__exportStar(require("./search"), exports);
|
|
36
38
|
__exportStar(require("./shared-context"), exports);
|
package/dist/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;AAAA,4CAAyB;AACzB,4CAAyB;AACzB,0CAAuB;AACvB,yCAAsB;AACtB,2CAAwB;AACxB,wCAAqB;AACrB,8CAA2B;AAC3B,iDAA8B;AAC9B,iDAA8B;AAC9B,8CAA2B;AAC3B,2CAAwB;AACxB,iDAA8B;AAC9B,2CAAwB;AACxB,gDAA6B;AAC7B,4CAAyB;AACzB,4CAAyB;AACzB,qDAAkC;AAClC,kDAA+B;AAC/B,2CAAwB;AACxB,mDAAgC;AAChC,mDAAgC;AAChC,qDAAkC;AAClC,6CAA0B"}
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;AAAA,4CAAyB;AACzB,4CAAyB;AACzB,0CAAuB;AACvB,yCAAsB;AACtB,2CAAwB;AACxB,6CAA0B;AAC1B,wCAAqB;AACrB,8CAA2B;AAC3B,iDAA8B;AAC9B,iDAA8B;AAC9B,8CAA2B;AAC3B,2CAAwB;AACxB,iDAA8B;AAC9B,2CAAwB;AACxB,gDAA6B;AAC7B,4CAAyB;AACzB,4CAAyB;AACzB,qDAAkC;AAClC,2CAAwB;AACxB,kDAA+B;AAC/B,2CAAwB;AACxB,mDAAgC;AAChC,mDAAgC;AAChC,qDAAkC;AAClC,6CAA0B"}
|
|
@@ -61,7 +61,7 @@ export interface PriceListDTO {
|
|
|
61
61
|
/**
|
|
62
62
|
* The number of rules associated with this price list.
|
|
63
63
|
*/
|
|
64
|
-
|
|
64
|
+
rules_count?: number;
|
|
65
65
|
/**
|
|
66
66
|
* The associated price set money amounts.
|
|
67
67
|
*
|
|
@@ -106,6 +106,20 @@ export interface PriceListPriceDTO extends CreateMoneyAmountDTO {
|
|
|
106
106
|
* The ID of the associated price set.
|
|
107
107
|
*/
|
|
108
108
|
price_set_id: string;
|
|
109
|
+
/**
|
|
110
|
+
* The rules to add to the price. The object's keys are rule types' `rule_attribute` attribute, and values are the value of that rule associated with this price.
|
|
111
|
+
*/
|
|
112
|
+
rules?: CreatePriceSetPriceRules;
|
|
113
|
+
}
|
|
114
|
+
/**
|
|
115
|
+
* @interface
|
|
116
|
+
*
|
|
117
|
+
* The price rules to be set for each price in the price set.
|
|
118
|
+
*
|
|
119
|
+
* Each key of the object is a rule type's `rule_attribute`, and its value
|
|
120
|
+
* is the values of the rule.
|
|
121
|
+
*/
|
|
122
|
+
export interface CreatePriceSetPriceRules extends Record<string, string> {
|
|
109
123
|
}
|
|
110
124
|
/**
|
|
111
125
|
* @interface
|
|
@@ -148,7 +162,7 @@ export interface CreatePriceListDTO {
|
|
|
148
162
|
/**
|
|
149
163
|
* The number of rules associated with the price list.
|
|
150
164
|
*/
|
|
151
|
-
|
|
165
|
+
rules_count?: number;
|
|
152
166
|
/**
|
|
153
167
|
* The rules to be created and associated with the price list.
|
|
154
168
|
*/
|
|
@@ -187,14 +201,14 @@ export interface UpdatePriceListDTO {
|
|
|
187
201
|
/**
|
|
188
202
|
* The number of rules associated with the price list.
|
|
189
203
|
*/
|
|
190
|
-
|
|
204
|
+
rules_count?: number;
|
|
191
205
|
/**
|
|
192
206
|
* The rules to be created and associated with the price list.
|
|
193
207
|
*/
|
|
194
208
|
rules?: CreatePriceListRules;
|
|
195
209
|
}
|
|
196
210
|
/**
|
|
197
|
-
* @
|
|
211
|
+
* @interface
|
|
198
212
|
*
|
|
199
213
|
* Filters to apply on price lists.
|
|
200
214
|
*/
|
|
@@ -218,7 +232,7 @@ export interface FilterablePriceListProps extends BaseFilterable<FilterablePrice
|
|
|
218
232
|
/**
|
|
219
233
|
* The number of rules to filter price lists by.
|
|
220
234
|
*/
|
|
221
|
-
|
|
235
|
+
rules_count?: number[];
|
|
222
236
|
}
|
|
223
237
|
/**
|
|
224
238
|
* @interface
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import { BaseFilterable } from "../../dal";
|
|
2
2
|
import { PriceSetDTO } from "./price-set";
|
|
3
|
+
import { PriceSetMoneyAmountDTO } from "./price-set-money-amount";
|
|
3
4
|
import { RuleTypeDTO } from "./rule-type";
|
|
4
5
|
/**
|
|
5
6
|
* @interface
|
|
@@ -55,23 +56,37 @@ export interface PriceRuleDTO {
|
|
|
55
56
|
*/
|
|
56
57
|
export interface CreatePriceRuleDTO {
|
|
57
58
|
/**
|
|
58
|
-
* The ID of the price
|
|
59
|
+
* The ID of the associated price set.
|
|
59
60
|
*/
|
|
60
|
-
|
|
61
|
+
price_set_id?: string;
|
|
61
62
|
/**
|
|
62
|
-
* The ID of the associated price set.
|
|
63
|
+
* The ID or object of the associated price set.
|
|
63
64
|
*/
|
|
64
|
-
|
|
65
|
+
price_set?: string | PriceSetDTO;
|
|
65
66
|
/**
|
|
66
67
|
* The ID of the associated rule type.
|
|
67
68
|
*/
|
|
68
|
-
rule_type_id
|
|
69
|
+
rule_type_id?: string;
|
|
70
|
+
/**
|
|
71
|
+
* The ID of the associated rule type.
|
|
72
|
+
*/
|
|
73
|
+
rule_type?: string | RuleTypeDTO;
|
|
69
74
|
/**
|
|
70
75
|
* The value of the price rule.
|
|
71
76
|
*/
|
|
72
77
|
value: string;
|
|
78
|
+
/**
|
|
79
|
+
* The priority of the price rule in comparison to other applicable price rules.
|
|
80
|
+
*/
|
|
73
81
|
priority?: number;
|
|
74
|
-
|
|
82
|
+
/**
|
|
83
|
+
* The ID of the associated price set money amount.
|
|
84
|
+
*/
|
|
85
|
+
price_set_money_amount_id?: string;
|
|
86
|
+
/**
|
|
87
|
+
* The ID or object of the associated price set money amount.
|
|
88
|
+
*/
|
|
89
|
+
price_set_money_amount?: string | PriceSetMoneyAmountDTO;
|
|
75
90
|
}
|
|
76
91
|
/**
|
|
77
92
|
*
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import { BaseFilterable } from "../../dal";
|
|
2
2
|
import { CreateMoneyAmountDTO, FilterableMoneyAmountProps, MoneyAmountDTO } from "./money-amount";
|
|
3
3
|
import { RuleTypeDTO } from "./rule-type";
|
|
4
|
+
import { CreatePriceSetPriceRules } from "./price-list";
|
|
4
5
|
/**
|
|
5
6
|
* @interface
|
|
6
7
|
*
|
|
@@ -198,7 +199,7 @@ export interface CreatePricesDTO extends CreateMoneyAmountDTO {
|
|
|
198
199
|
/**
|
|
199
200
|
* The rules to add to the price. The object's keys are rule types' `rule_attribute` attribute, and values are the value of that rule associated with this price.
|
|
200
201
|
*/
|
|
201
|
-
rules
|
|
202
|
+
rules?: CreatePriceSetPriceRules;
|
|
202
203
|
}
|
|
203
204
|
/**
|
|
204
205
|
* @interface
|
|
@@ -1359,7 +1359,53 @@ export interface IProductModuleService {
|
|
|
1359
1359
|
* ```
|
|
1360
1360
|
*/
|
|
1361
1361
|
listVariants(filters?: FilterableProductVariantProps, config?: FindConfig<ProductVariantDTO>, sharedContext?: Context): Promise<ProductVariantDTO[]>;
|
|
1362
|
+
/**
|
|
1363
|
+
* This method is used to update a product's variants.
|
|
1364
|
+
*
|
|
1365
|
+
* @param {UpdateProductVariantDTO[]} data - The product variants to update.
|
|
1366
|
+
* @param {Context} sharedContext - A context used to share resources, such as transaction manager, between the application and the module.
|
|
1367
|
+
* @returns {Promise<ProductVariantDTO[]>} The updated product variants's details.
|
|
1368
|
+
*
|
|
1369
|
+
* @example
|
|
1370
|
+
* import {
|
|
1371
|
+
* initialize as initializeProductModule,
|
|
1372
|
+
* } from "@medusajs/product"
|
|
1373
|
+
* import {
|
|
1374
|
+
* UpdateProductVariantDTO
|
|
1375
|
+
* } from "@medusajs/product/dist/types/services/product-variant"
|
|
1376
|
+
*
|
|
1377
|
+
* async function updateProductVariants (items: UpdateProductVariantDTO[]) {
|
|
1378
|
+
* const productModule = await initializeProductModule()
|
|
1379
|
+
*
|
|
1380
|
+
* const productVariants = await productModule.updateVariants(items)
|
|
1381
|
+
*
|
|
1382
|
+
* // do something with the product variants or return them
|
|
1383
|
+
* }
|
|
1384
|
+
*/
|
|
1362
1385
|
updateVariants(data: UpdateProductVariantDTO[], sharedContext?: Context): Promise<ProductVariantDTO[]>;
|
|
1386
|
+
/**
|
|
1387
|
+
* This method is used to create variants for a product.
|
|
1388
|
+
*
|
|
1389
|
+
* @param {CreateProductVariantDTO[]} data - The product variants to create.
|
|
1390
|
+
* @param {Context} sharedContext - A context used to share resources, such as transaction manager, between the application and the module.
|
|
1391
|
+
* @returns {Promise<ProductVariantDTO[]>} The created product variants' details.
|
|
1392
|
+
*
|
|
1393
|
+
* @example
|
|
1394
|
+
* import {
|
|
1395
|
+
* initialize as initializeProductModule,
|
|
1396
|
+
* } from "@medusajs/product"
|
|
1397
|
+
*
|
|
1398
|
+
* async function createProductVariants (items: {
|
|
1399
|
+
* product_id: string,
|
|
1400
|
+
* title: string
|
|
1401
|
+
* }[]) {
|
|
1402
|
+
* const productModule = await initializeProductModule()
|
|
1403
|
+
*
|
|
1404
|
+
* const productVariants = await productModule.createVariants(items)
|
|
1405
|
+
*
|
|
1406
|
+
* // do something with the product variants or return them
|
|
1407
|
+
* }
|
|
1408
|
+
*/
|
|
1363
1409
|
createVariants(data: CreateProductVariantDTO[], sharedContext?: Context): Promise<ProductVariantDTO[]>;
|
|
1364
1410
|
/**
|
|
1365
1411
|
* This method is used to delete ProductVariant. This method will completely remove the ProductVariant and they can no longer be accessed or retrieved.
|
|
@@ -2222,7 +2268,7 @@ export interface IProductModuleService {
|
|
|
2222
2268
|
*
|
|
2223
2269
|
* @param {string[]} productIds - The IDs of the products to restore.
|
|
2224
2270
|
* @param {RestoreReturn<TReturnableLinkableKeys>} config -
|
|
2225
|
-
* Configurations determining which relations to restore along with
|
|
2271
|
+
* Configurations determining which relations to restore along with each of the products. You can pass to its `returnLinkableKeys`
|
|
2226
2272
|
* property any of the product's relation attribute names, such as `variant_id`.
|
|
2227
2273
|
* @param {Context} sharedContext - A context used to share resources, such as transaction manager, between the application and the module.
|
|
2228
2274
|
* @returns {Promise<Record<string, string[]> | void>}
|
|
@@ -2246,5 +2292,31 @@ export interface IProductModuleService {
|
|
|
2246
2292
|
* }
|
|
2247
2293
|
*/
|
|
2248
2294
|
restore<TReturnableLinkableKeys extends string = string>(productIds: string[], config?: RestoreReturn<TReturnableLinkableKeys>, sharedContext?: Context): Promise<Record<string, string[]> | void>;
|
|
2295
|
+
/**
|
|
2296
|
+
* This method is used to restore product varaints that were soft deleted. Product variants are soft deleted when they're not
|
|
2297
|
+
* provided in a product's details passed to the {@link update} method.
|
|
2298
|
+
*
|
|
2299
|
+
* @param {string[]} variantIds - The IDs of the variants to restore.
|
|
2300
|
+
* @param {RestoreReturn<TReturnableLinkableKeys>} config -
|
|
2301
|
+
* Configurations determining which relations to restore along with each of the product variants. You can pass to its `returnLinkableKeys`
|
|
2302
|
+
* property any of the product variant's relation attribute names.
|
|
2303
|
+
* @param {Context} sharedContext - A context used to share resources, such as transaction manager, between the application and the module.
|
|
2304
|
+
* @returns {Promise<Record<string, string[]> | void>}
|
|
2305
|
+
* An object that includes the IDs of related records that were restored. The object's keys are the ID attribute names of the product variant entity's relations
|
|
2306
|
+
* and its value is an array of strings, each being the ID of the record associated with the product variant through this relation.
|
|
2307
|
+
*
|
|
2308
|
+
* If there are no related records that were restored, the promise resolved to `void`.
|
|
2309
|
+
*
|
|
2310
|
+
* @example
|
|
2311
|
+
* import {
|
|
2312
|
+
* initialize as initializeProductModule,
|
|
2313
|
+
* } from "@medusajs/product"
|
|
2314
|
+
*
|
|
2315
|
+
* async function restoreProductVariants (ids: string[]) {
|
|
2316
|
+
* const productModule = await initializeProductModule()
|
|
2317
|
+
*
|
|
2318
|
+
* await productModule.restoreVariants(ids)
|
|
2319
|
+
* }
|
|
2320
|
+
*/
|
|
2249
2321
|
restoreVariants<TReturnableLinkableKeys extends string = string>(variantIds: string[], config?: RestoreReturn<TReturnableLinkableKeys>, sharedContext?: Context): Promise<Record<string, string[]> | void>;
|
|
2250
2322
|
}
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
export type RegionDTO = {
|
|
2
|
+
name: string;
|
|
3
|
+
currency_code: string;
|
|
4
|
+
tax_rate?: number;
|
|
5
|
+
tax_code?: string | null;
|
|
6
|
+
gift_cards_taxable?: boolean;
|
|
7
|
+
automatic_taxes?: boolean;
|
|
8
|
+
tax_provider_id?: string | null;
|
|
9
|
+
metadata?: Record<string, unknown>;
|
|
10
|
+
includes_tax?: boolean;
|
|
11
|
+
};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"common.js","sourceRoot":"","sources":["../../src/region/common.ts"],"names":[],"mappings":""}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from "./common";
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
3
|
+
if (k2 === undefined) k2 = k;
|
|
4
|
+
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
5
|
+
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
6
|
+
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
7
|
+
}
|
|
8
|
+
Object.defineProperty(o, k2, desc);
|
|
9
|
+
}) : (function(o, m, k, k2) {
|
|
10
|
+
if (k2 === undefined) k2 = k;
|
|
11
|
+
o[k2] = m[k];
|
|
12
|
+
}));
|
|
13
|
+
var __exportStar = (this && this.__exportStar) || function(m, exports) {
|
|
14
|
+
for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
|
|
15
|
+
};
|
|
16
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
17
|
+
__exportStar(require("./common"), exports);
|
|
18
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/region/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;AAAA,2CAAwB"}
|
|
@@ -3,7 +3,7 @@ export interface CreatePriceListDTO {
|
|
|
3
3
|
starts_at?: string;
|
|
4
4
|
ends_at?: string;
|
|
5
5
|
status?: PriceListStatus;
|
|
6
|
-
|
|
6
|
+
rules_count?: number;
|
|
7
7
|
rules?: PriceListRuleDTO[];
|
|
8
8
|
prices?: {
|
|
9
9
|
amount: number;
|
|
@@ -51,7 +51,7 @@ export interface CreatePriceListWorkflowDTO {
|
|
|
51
51
|
starts_at?: string;
|
|
52
52
|
ends_at?: string;
|
|
53
53
|
status?: PriceListStatus;
|
|
54
|
-
|
|
54
|
+
rules_count?: number;
|
|
55
55
|
prices: InputPrice[];
|
|
56
56
|
rules?: CreatePriceListRules;
|
|
57
57
|
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@medusajs/types",
|
|
3
|
-
"version": "1.11.
|
|
3
|
+
"version": "1.11.9-next-20231213100322",
|
|
4
4
|
"description": "Medusa Types definition",
|
|
5
5
|
"main": "dist/index.js",
|
|
6
6
|
"types": "dist/index.d.ts",
|
|
@@ -9,6 +9,9 @@
|
|
|
9
9
|
"url": "https://github.com/medusajs/medusa",
|
|
10
10
|
"directory": "packages/types"
|
|
11
11
|
},
|
|
12
|
+
"engines": {
|
|
13
|
+
"node": ">=16"
|
|
14
|
+
},
|
|
12
15
|
"publishConfig": {
|
|
13
16
|
"access": "public"
|
|
14
17
|
},
|