@medusajs/types 1.12.0-snapshot-20240403120107 → 1.12.0-snapshot-20240405154416
Sign up to get free protection for your applications and to get access to all the features.
- package/dist/auth/common/auth-user.d.ts +21 -16
- package/dist/auth/common/auth-user.d.ts.map +1 -1
- package/dist/auth/common/provider.d.ts +28 -15
- package/dist/auth/common/provider.d.ts.map +1 -1
- package/dist/auth/service.d.ts +137 -75
- package/dist/auth/service.d.ts.map +1 -1
- package/dist/bundles.d.ts +2 -0
- package/dist/bundles.d.ts.map +1 -1
- package/dist/bundles.js +3 -1
- package/dist/bundles.js.map +1 -1
- package/dist/cart/common.d.ts +443 -62
- package/dist/cart/common.d.ts.map +1 -1
- package/dist/cart/mutations.d.ts +483 -0
- package/dist/cart/mutations.d.ts.map +1 -1
- package/dist/cart/mutations.js.map +1 -1
- package/dist/cart/service.d.ts +1607 -0
- package/dist/cart/service.d.ts.map +1 -1
- package/dist/common/index.d.ts +1 -0
- package/dist/common/index.d.ts.map +1 -1
- package/dist/common/index.js +1 -0
- package/dist/common/index.js.map +1 -1
- package/dist/common/rule.d.ts +2 -0
- package/dist/common/rule.d.ts.map +1 -0
- package/dist/common/rule.js +3 -0
- package/dist/common/rule.js.map +1 -0
- package/dist/customer/service.d.ts +445 -197
- package/dist/customer/service.d.ts.map +1 -1
- package/dist/file/common.d.ts +14 -0
- package/dist/file/common.d.ts.map +1 -0
- package/dist/file/common.js +3 -0
- package/dist/file/common.js.map +1 -0
- package/dist/file/index.d.ts +4 -0
- package/dist/file/index.d.ts.map +1 -0
- package/dist/file/index.js +20 -0
- package/dist/file/index.js.map +1 -0
- package/dist/file/mutations.d.ts +18 -0
- package/dist/file/mutations.d.ts.map +1 -0
- package/dist/file/mutations.js +3 -0
- package/dist/file/mutations.js.map +1 -0
- package/dist/file/service.d.ts +76 -0
- package/dist/file/service.d.ts.map +1 -0
- package/dist/file/service.js +3 -0
- package/dist/file/service.js.map +1 -0
- package/dist/fulfillment/mutations/shipping-option-rule.d.ts +2 -2
- package/dist/fulfillment/mutations/shipping-option-rule.d.ts.map +1 -1
- package/dist/http/fulfillment/admin/fulfillment-address.d.ts +22 -0
- package/dist/http/fulfillment/admin/fulfillment-address.d.ts.map +1 -0
- package/dist/http/fulfillment/admin/fulfillment-address.js +3 -0
- package/dist/http/fulfillment/admin/fulfillment-address.js.map +1 -0
- package/dist/http/fulfillment/admin/fulfillment-item.d.ts +17 -0
- package/dist/http/fulfillment/admin/fulfillment-item.d.ts.map +1 -0
- package/dist/http/fulfillment/admin/fulfillment-item.js +3 -0
- package/dist/http/fulfillment/admin/fulfillment-item.js.map +1 -0
- package/dist/http/fulfillment/admin/fulfillment-label.d.ts +14 -0
- package/dist/http/fulfillment/admin/fulfillment-label.d.ts.map +1 -0
- package/dist/http/fulfillment/admin/fulfillment-label.js +3 -0
- package/dist/http/fulfillment/admin/fulfillment-label.js.map +1 -0
- package/dist/http/fulfillment/admin/fulfillment-provider.d.ts +12 -0
- package/dist/http/fulfillment/admin/fulfillment-provider.d.ts.map +1 -0
- package/dist/http/fulfillment/admin/fulfillment-provider.js +3 -0
- package/dist/http/fulfillment/admin/fulfillment-provider.js.map +1 -0
- package/dist/http/fulfillment/admin/fulfillment-set.d.ts +15 -0
- package/dist/http/fulfillment/admin/fulfillment-set.d.ts.map +1 -0
- package/dist/http/fulfillment/admin/fulfillment-set.js +3 -0
- package/dist/http/fulfillment/admin/fulfillment-set.js.map +1 -0
- package/dist/http/fulfillment/admin/fulfillment.d.ts +27 -0
- package/dist/http/fulfillment/admin/fulfillment.d.ts.map +1 -0
- package/dist/http/fulfillment/admin/fulfillment.js +3 -0
- package/dist/http/fulfillment/admin/fulfillment.js.map +1 -0
- package/dist/http/fulfillment/admin/geo-zone.d.ts +17 -0
- package/dist/http/fulfillment/admin/geo-zone.d.ts.map +1 -0
- package/dist/http/fulfillment/admin/geo-zone.js +3 -0
- package/dist/http/fulfillment/admin/geo-zone.js.map +1 -0
- package/dist/http/fulfillment/admin/index.d.ts +13 -0
- package/dist/http/fulfillment/admin/index.d.ts.map +1 -0
- package/dist/http/fulfillment/admin/index.js +29 -0
- package/dist/http/fulfillment/admin/index.js.map +1 -0
- package/dist/http/fulfillment/admin/service-zone.d.ts +14 -0
- package/dist/http/fulfillment/admin/service-zone.d.ts.map +1 -0
- package/dist/http/fulfillment/admin/service-zone.js +3 -0
- package/dist/http/fulfillment/admin/service-zone.js.map +1 -0
- package/dist/http/fulfillment/admin/shipping-option-rule.d.ts +16 -0
- package/dist/http/fulfillment/admin/shipping-option-rule.d.ts.map +1 -0
- package/dist/http/fulfillment/admin/shipping-option-rule.js +3 -0
- package/dist/http/fulfillment/admin/shipping-option-rule.js.map +1 -0
- package/dist/http/fulfillment/admin/shipping-option-type.d.ts +14 -0
- package/dist/http/fulfillment/admin/shipping-option-type.d.ts.map +1 -0
- package/dist/http/fulfillment/admin/shipping-option-type.js +3 -0
- package/dist/http/fulfillment/admin/shipping-option-type.js.map +1 -0
- package/dist/http/fulfillment/admin/shipping-option.d.ts +31 -0
- package/dist/http/fulfillment/admin/shipping-option.d.ts.map +1 -0
- package/dist/http/fulfillment/admin/shipping-option.js +3 -0
- package/dist/http/fulfillment/admin/shipping-option.js.map +1 -0
- package/dist/http/fulfillment/admin/shipping-profile.d.ts +13 -0
- package/dist/http/fulfillment/admin/shipping-profile.d.ts.map +1 -0
- package/dist/http/fulfillment/admin/shipping-profile.js +3 -0
- package/dist/http/fulfillment/admin/shipping-profile.js.map +1 -0
- package/dist/http/fulfillment/index.d.ts +2 -0
- package/dist/http/fulfillment/index.d.ts.map +1 -0
- package/dist/http/fulfillment/index.js +18 -0
- package/dist/http/fulfillment/index.js.map +1 -0
- package/dist/http/index.d.ts +2 -0
- package/dist/http/index.d.ts.map +1 -0
- package/dist/http/index.js +18 -0
- package/dist/http/index.js.map +1 -0
- package/dist/index.d.ts +2 -0
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +2 -0
- package/dist/index.js.map +1 -1
- package/dist/inventory/common/inventory-item.d.ts +55 -64
- package/dist/inventory/common/inventory-item.d.ts.map +1 -1
- package/dist/inventory/common/inventory-level.d.ts +37 -37
- package/dist/inventory/common/inventory-level.d.ts.map +1 -1
- package/dist/inventory/common/reservation-item.d.ts +34 -44
- package/dist/inventory/common/reservation-item.d.ts.map +1 -1
- package/dist/inventory/service-next.d.ts +596 -534
- package/dist/inventory/service-next.d.ts.map +1 -1
- package/dist/payment/common.d.ts +175 -54
- package/dist/payment/common.d.ts.map +1 -1
- package/dist/payment/common.js +3 -3
- package/dist/payment/common.js.map +1 -1
- package/dist/payment/mutations.d.ts +58 -17
- package/dist/payment/mutations.d.ts.map +1 -1
- package/dist/payment/provider.d.ts +128 -43
- package/dist/payment/provider.d.ts.map +1 -1
- package/dist/payment/provider.js.map +1 -1
- package/dist/payment/service.d.ts +460 -39
- package/dist/payment/service.d.ts.map +1 -1
- package/dist/pricing/common/price-list.d.ts +2 -2
- package/dist/pricing/common/price-set.d.ts +6 -4
- package/dist/pricing/common/price-set.d.ts.map +1 -1
- package/dist/pricing/service.d.ts +731 -1695
- package/dist/pricing/service.d.ts.map +1 -1
- package/dist/promotion/common/application-method.d.ts +153 -0
- package/dist/promotion/common/application-method.d.ts.map +1 -1
- package/dist/promotion/common/campaign-budget.d.ts +37 -0
- package/dist/promotion/common/campaign-budget.d.ts.map +1 -1
- package/dist/promotion/common/campaign.d.ts +36 -0
- package/dist/promotion/common/campaign.d.ts.map +1 -1
- package/dist/promotion/common/compute-actions.d.ts +135 -0
- package/dist/promotion/common/compute-actions.d.ts.map +1 -1
- package/dist/promotion/common/promotion-rule-value.d.ts +30 -0
- package/dist/promotion/common/promotion-rule-value.d.ts.map +1 -1
- package/dist/promotion/common/promotion-rule.d.ts +77 -0
- package/dist/promotion/common/promotion-rule.d.ts.map +1 -1
- package/dist/promotion/common/promotion.d.ts +100 -0
- package/dist/promotion/common/promotion.d.ts.map +1 -1
- package/dist/promotion/mutations.d.ts +84 -0
- package/dist/promotion/mutations.d.ts.map +1 -1
- package/dist/promotion/service.d.ts +786 -0
- package/dist/promotion/service.d.ts.map +1 -1
- package/dist/region/common.d.ts +1 -1
- package/dist/region/common.d.ts.map +1 -1
- package/dist/region/service.d.ts +1 -1
- package/dist/stock-location/common.d.ts +14 -0
- package/dist/stock-location/common.d.ts.map +1 -1
- package/dist/stock-location/service-next.d.ts +178 -186
- package/dist/stock-location/service-next.d.ts.map +1 -1
- package/dist/store/common/store.d.ts +42 -0
- package/dist/store/common/store.d.ts.map +1 -1
- package/dist/store/mutations/store.d.ts +75 -0
- package/dist/store/mutations/store.d.ts.map +1 -1
- package/dist/store/service.d.ts +113 -75
- package/dist/store/service.d.ts.map +1 -1
- package/dist/tax/common.d.ts +298 -10
- package/dist/tax/common.d.ts.map +1 -1
- package/dist/tax/mutations.d.ts +157 -0
- package/dist/tax/mutations.d.ts.map +1 -1
- package/dist/tax/provider.d.ts +126 -0
- package/dist/tax/provider.d.ts.map +1 -1
- package/dist/tax/service.d.ts +600 -0
- package/dist/tax/service.d.ts.map +1 -1
- package/dist/workflow/index.d.ts +1 -0
- package/dist/workflow/index.d.ts.map +1 -1
- package/dist/workflow/index.js +2 -1
- package/dist/workflow/index.js.map +1 -1
- package/dist/workflow/region/create-regions.d.ts +8 -0
- package/dist/workflow/region/create-regions.d.ts.map +1 -0
- package/dist/workflow/region/create-regions.js +3 -0
- package/dist/workflow/region/create-regions.js.map +1 -0
- package/dist/workflow/region/index.d.ts +3 -0
- package/dist/workflow/region/index.d.ts.map +1 -0
- package/dist/workflow/region/index.js +19 -0
- package/dist/workflow/region/index.js.map +1 -0
- package/dist/workflow/region/update-regions.d.ts +9 -0
- package/dist/workflow/region/update-regions.d.ts.map +1 -0
- package/dist/workflow/region/update-regions.js +3 -0
- package/dist/workflow/region/update-regions.js.map +1 -0
- package/package.json +1 -1
@@ -1,29 +1,104 @@
|
|
1
|
+
/**
|
2
|
+
* The store to be created.
|
3
|
+
*/
|
1
4
|
export interface CreateStoreDTO {
|
5
|
+
/**
|
6
|
+
* The name of the store.
|
7
|
+
*/
|
2
8
|
name?: string;
|
9
|
+
/**
|
10
|
+
* The supported currency codes of the store.
|
11
|
+
*/
|
3
12
|
supported_currency_codes?: string[];
|
13
|
+
/**
|
14
|
+
* The default currency code of the store.
|
15
|
+
*/
|
4
16
|
default_currency_code?: string;
|
17
|
+
/**
|
18
|
+
* The associated default sales channel's ID.
|
19
|
+
*/
|
5
20
|
default_sales_channel_id?: string;
|
21
|
+
/**
|
22
|
+
* The associated default region's ID.
|
23
|
+
*/
|
6
24
|
default_region_id?: string;
|
25
|
+
/**
|
26
|
+
* The associated default location's ID.
|
27
|
+
*/
|
7
28
|
default_location_id?: string;
|
29
|
+
/**
|
30
|
+
* Holds custom data in key-value pairs.
|
31
|
+
*/
|
8
32
|
metadata?: Record<string, any>;
|
9
33
|
}
|
34
|
+
/**
|
35
|
+
* The attributes in the store to be created or updated.
|
36
|
+
*/
|
10
37
|
export interface UpsertStoreDTO {
|
38
|
+
/**
|
39
|
+
* The ID of the store.
|
40
|
+
*/
|
11
41
|
id?: string;
|
42
|
+
/**
|
43
|
+
* The name of the store.
|
44
|
+
*/
|
12
45
|
name?: string;
|
46
|
+
/**
|
47
|
+
* The supported currency codes of the store.
|
48
|
+
*/
|
13
49
|
supported_currency_codes?: string[];
|
50
|
+
/**
|
51
|
+
* The default currency code of the store.
|
52
|
+
*/
|
14
53
|
default_currency_code?: string;
|
54
|
+
/**
|
55
|
+
* The associated default sales channel's ID.
|
56
|
+
*/
|
15
57
|
default_sales_channel_id?: string;
|
58
|
+
/**
|
59
|
+
* The associated default region's ID.
|
60
|
+
*/
|
16
61
|
default_region_id?: string;
|
62
|
+
/**
|
63
|
+
* The associated default location's ID.
|
64
|
+
*/
|
17
65
|
default_location_id?: string;
|
66
|
+
/**
|
67
|
+
* Holds custom data in key-value pairs.
|
68
|
+
*/
|
18
69
|
metadata?: Record<string, any>;
|
19
70
|
}
|
71
|
+
/**
|
72
|
+
* The attributes to update in the store.
|
73
|
+
*/
|
20
74
|
export interface UpdateStoreDTO {
|
75
|
+
/**
|
76
|
+
* The name of the store.
|
77
|
+
*/
|
21
78
|
name?: string;
|
79
|
+
/**
|
80
|
+
* The supported currency codes of the store.
|
81
|
+
*/
|
22
82
|
supported_currency_codes?: string[];
|
83
|
+
/**
|
84
|
+
* The default currency code of the store.
|
85
|
+
*/
|
23
86
|
default_currency_code?: string;
|
87
|
+
/**
|
88
|
+
* The associated default sales channel's ID.
|
89
|
+
*/
|
24
90
|
default_sales_channel_id?: string;
|
91
|
+
/**
|
92
|
+
* The associated default region's ID.
|
93
|
+
*/
|
25
94
|
default_region_id?: string;
|
95
|
+
/**
|
96
|
+
* The associated default location's ID.
|
97
|
+
*/
|
26
98
|
default_location_id?: string;
|
99
|
+
/**
|
100
|
+
* Holds custom data in key-value pairs.
|
101
|
+
*/
|
27
102
|
metadata?: Record<string, any>;
|
28
103
|
}
|
29
104
|
//# sourceMappingURL=store.d.ts.map
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"store.d.ts","sourceRoot":"","sources":["../../../src/store/mutations/store.ts"],"names":[],"mappings":"AAAA,MAAM,WAAW,cAAc;IAC7B,IAAI,CAAC,EAAE,MAAM,CAAA;
|
1
|
+
{"version":3,"file":"store.d.ts","sourceRoot":"","sources":["../../../src/store/mutations/store.ts"],"names":[],"mappings":"AAAA;;GAEG;AACH,MAAM,WAAW,cAAc;IAC7B;;OAEG;IACH,IAAI,CAAC,EAAE,MAAM,CAAA;IAEb;;OAEG;IACH,wBAAwB,CAAC,EAAE,MAAM,EAAE,CAAA;IAEnC;;OAEG;IACH,qBAAqB,CAAC,EAAE,MAAM,CAAA;IAE9B;;OAEG;IACH,wBAAwB,CAAC,EAAE,MAAM,CAAA;IAEjC;;OAEG;IACH,iBAAiB,CAAC,EAAE,MAAM,CAAA;IAE1B;;OAEG;IACH,mBAAmB,CAAC,EAAE,MAAM,CAAA;IAE5B;;OAEG;IACH,QAAQ,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC,CAAA;CAC/B;AAED;;GAEG;AACH,MAAM,WAAW,cAAc;IAC7B;;OAEG;IACH,EAAE,CAAC,EAAE,MAAM,CAAA;IAEX;;OAEG;IACH,IAAI,CAAC,EAAE,MAAM,CAAA;IAEb;;OAEG;IACH,wBAAwB,CAAC,EAAE,MAAM,EAAE,CAAA;IAEnC;;OAEG;IACH,qBAAqB,CAAC,EAAE,MAAM,CAAA;IAE9B;;OAEG;IACH,wBAAwB,CAAC,EAAE,MAAM,CAAA;IAEjC;;OAEG;IACH,iBAAiB,CAAC,EAAE,MAAM,CAAA;IAE1B;;OAEG;IACH,mBAAmB,CAAC,EAAE,MAAM,CAAA;IAE5B;;OAEG;IACH,QAAQ,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC,CAAA;CAC/B;AAED;;GAEG;AACH,MAAM,WAAW,cAAc;IAC7B;;OAEG;IACH,IAAI,CAAC,EAAE,MAAM,CAAA;IAEb;;OAEG;IACH,wBAAwB,CAAC,EAAE,MAAM,EAAE,CAAA;IAEnC;;OAEG;IACH,qBAAqB,CAAC,EAAE,MAAM,CAAA;IAE9B;;OAEG;IACH,wBAAwB,CAAC,EAAE,MAAM,CAAA;IAEjC;;OAEG;IACH,iBAAiB,CAAC,EAAE,MAAM,CAAA;IAE1B;;OAEG;IACH,mBAAmB,CAAC,EAAE,MAAM,CAAA;IAE5B;;OAEG;IACH,QAAQ,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC,CAAA;CAC/B"}
|
package/dist/store/service.d.ts
CHANGED
@@ -5,7 +5,7 @@ import { Context } from "../shared-context";
|
|
5
5
|
import { FilterableStoreProps, StoreDTO } from "./common";
|
6
6
|
import { CreateStoreDTO, UpdateStoreDTO, UpsertStoreDTO } from "./mutations";
|
7
7
|
/**
|
8
|
-
* The main service interface for the
|
8
|
+
* The main service interface for the Store Module.
|
9
9
|
*/
|
10
10
|
export interface IStoreModuleService extends IModuleService {
|
11
11
|
/**
|
@@ -16,7 +16,18 @@ export interface IStoreModuleService extends IModuleService {
|
|
16
16
|
* @returns {Promise<StoreDTO[]>} The created stores.
|
17
17
|
*
|
18
18
|
* @example
|
19
|
-
*
|
19
|
+
* const stores = await storeModuleService.create([
|
20
|
+
* {
|
21
|
+
* name: "Acme",
|
22
|
+
* supported_currency_codes: ["usd", "eur"],
|
23
|
+
* default_currency_code: "usd",
|
24
|
+
* },
|
25
|
+
* {
|
26
|
+
* name: "Acme 2",
|
27
|
+
* supported_currency_codes: ["usd"],
|
28
|
+
* default_currency_code: "usd",
|
29
|
+
* },
|
30
|
+
* ])
|
20
31
|
*/
|
21
32
|
create(data: CreateStoreDTO[], sharedContext?: Context): Promise<StoreDTO[]>;
|
22
33
|
/**
|
@@ -27,59 +38,90 @@ export interface IStoreModuleService extends IModuleService {
|
|
27
38
|
* @returns {Promise<StoreDTO>} The created store.
|
28
39
|
*
|
29
40
|
* @example
|
30
|
-
* {
|
41
|
+
* const store = await storeModuleService.create({
|
42
|
+
* name: "Acme",
|
43
|
+
* supported_currency_codes: ["usd", "eur"],
|
44
|
+
* default_currency_code: "usd",
|
45
|
+
* })
|
31
46
|
*/
|
32
47
|
create(data: CreateStoreDTO, sharedContext?: Context): Promise<StoreDTO>;
|
33
48
|
/**
|
34
|
-
* This method updates
|
49
|
+
* This method updates or creates stores if they don't exist.
|
35
50
|
*
|
36
|
-
* @param {UpsertStoreDTO[]} data - The attributes
|
37
|
-
* @
|
51
|
+
* @param {UpsertStoreDTO[]} data - The attributes in the stores to be created or updated.
|
52
|
+
* @param {Context} sharedContext - A context used to share resources, such as transaction manager, between the application and the module.
|
53
|
+
* @returns {Promise<StoreDTO[]>} The created or updated stores.
|
38
54
|
*
|
39
55
|
* @example
|
40
|
-
*
|
56
|
+
* const stores = await storeModuleService.upsert([
|
57
|
+
* {
|
58
|
+
* id: "store_123",
|
59
|
+
* name: "Acme",
|
60
|
+
* },
|
61
|
+
* {
|
62
|
+
* name: "Acme 2",
|
63
|
+
* supported_currency_codes: ["usd"],
|
64
|
+
* default_currency_code: "usd",
|
65
|
+
* },
|
66
|
+
* ])
|
41
67
|
*/
|
42
68
|
upsert(data: UpsertStoreDTO[], sharedContext?: Context): Promise<StoreDTO[]>;
|
43
69
|
/**
|
44
|
-
* This method updates
|
70
|
+
* This method updates or creates a store if it doesn't exist.
|
45
71
|
*
|
46
|
-
* @param {UpsertStoreDTO} data - The attributes
|
47
|
-
* @
|
72
|
+
* @param {UpsertStoreDTO} data - The attributes in the store to be created or updated.
|
73
|
+
* @param {Context} sharedContext - A context used to share resources, such as transaction manager, between the application and the module.
|
74
|
+
* @returns {Promise<StoreDTO>} The created or updated store.
|
48
75
|
*
|
49
76
|
* @example
|
50
|
-
* {
|
77
|
+
* const store = await storeModuleService.upsert({
|
78
|
+
* id: "store_123",
|
79
|
+
* name: "Acme",
|
80
|
+
* })
|
51
81
|
*/
|
52
82
|
upsert(data: UpsertStoreDTO, sharedContext?: Context): Promise<StoreDTO>;
|
53
83
|
/**
|
54
84
|
* This method updates an existing store.
|
55
85
|
*
|
56
|
-
* @param {string} id - The store
|
57
|
-
* @param {UpdateStoreDTO} data - The
|
86
|
+
* @param {string} id - The ID of the store.
|
87
|
+
* @param {UpdateStoreDTO} data - The attributes to update in the store.
|
58
88
|
* @param {Context} sharedContext - A context used to share resources, such as transaction manager, between the application and the module.
|
59
89
|
* @returns {Promise<StoreDTO>} The updated store.
|
90
|
+
*
|
91
|
+
* @example
|
92
|
+
* const store = await storeModuleService.update("store_123", {
|
93
|
+
* name: "Acme",
|
94
|
+
* })
|
60
95
|
*/
|
61
96
|
update(id: string, data: UpdateStoreDTO, sharedContext?: Context): Promise<StoreDTO>;
|
62
97
|
/**
|
63
|
-
* This method updates existing stores.
|
98
|
+
* This method updates existing stores matching the specified filters.
|
64
99
|
*
|
65
|
-
* @param {FilterableStoreProps} selector - The filters
|
66
|
-
* @param {UpdateStoreDTO} data - The
|
100
|
+
* @param {FilterableStoreProps} selector - The filters specifying which stores to update.
|
101
|
+
* @param {UpdateStoreDTO} data - The attributes to update in the store.
|
67
102
|
* @param {Context} sharedContext - A context used to share resources, such as transaction manager, between the application and the module.
|
68
103
|
* @returns {Promise<StoreDTO[]>} The updated stores.
|
69
104
|
*
|
70
105
|
* @example
|
71
|
-
*
|
106
|
+
* const store = await storeModuleService.update(
|
107
|
+
* {
|
108
|
+
* name: ["Acme"],
|
109
|
+
* },
|
110
|
+
* {
|
111
|
+
* default_currency_code: "usd",
|
112
|
+
* }
|
113
|
+
* )
|
72
114
|
*/
|
73
115
|
update(selector: FilterableStoreProps, data: UpdateStoreDTO, sharedContext?: Context): Promise<StoreDTO[]>;
|
74
116
|
/**
|
75
117
|
* This method deletes stores by their IDs.
|
76
118
|
*
|
77
|
-
* @param {string[]} ids - The
|
119
|
+
* @param {string[]} ids - The IDs of the stores.
|
78
120
|
* @param {Context} sharedContext - A context used to share resources, such as transaction manager, between the application and the module.
|
79
|
-
* @returns {Promise<void>} Resolves when the stores are deleted.
|
121
|
+
* @returns {Promise<void>} Resolves when the stores are deleted successfully.
|
80
122
|
*
|
81
123
|
* @example
|
82
|
-
*
|
124
|
+
* await storeModuleService.delete(["store_123", "store_321"])
|
83
125
|
*/
|
84
126
|
delete(ids: string[], sharedContext?: Context): Promise<void>;
|
85
127
|
/**
|
@@ -87,125 +129,121 @@ export interface IStoreModuleService extends IModuleService {
|
|
87
129
|
*
|
88
130
|
* @param {string} id - The ID of the store.
|
89
131
|
* @param {Context} sharedContext - A context used to share resources, such as transaction manager, between the application and the module.
|
90
|
-
* @returns {Promise<void>} Resolves when the store is deleted.
|
132
|
+
* @returns {Promise<void>} Resolves when the store is deleted successfully.
|
91
133
|
*
|
92
134
|
* @example
|
93
|
-
*
|
135
|
+
* await storeModuleService.delete("store_123")
|
94
136
|
*/
|
95
137
|
delete(id: string, sharedContext?: Context): Promise<void>;
|
96
138
|
/**
|
97
139
|
* This method retrieves a store by its ID.
|
98
140
|
*
|
99
|
-
* @param {string} id - The ID of the
|
141
|
+
* @param {string} id - The ID of the store.
|
100
142
|
* @param {FindConfig<StoreDTO>} config - The configurations determining how the store is retrieved. Its properties, such as `select` or `relations`, accept the
|
101
143
|
* attributes or relations associated with a store.
|
102
144
|
* @param {Context} sharedContext - A context used to share resources, such as transaction manager, between the application and the module.
|
103
145
|
* @returns {Promise<StoreDTO>} The retrieved store.
|
104
146
|
*
|
105
147
|
* @example
|
106
|
-
*
|
107
|
-
*
|
108
|
-
* ```ts
|
109
|
-
* {example-code}
|
110
|
-
* ```
|
111
|
-
*
|
112
|
-
* To specify relations that should be retrieved:
|
113
|
-
*
|
114
|
-
* ```ts
|
115
|
-
* {example-code}
|
116
|
-
* ```
|
117
|
-
*
|
118
|
-
*
|
148
|
+
* const store = await storeModuleService.retrieve("store_123")
|
119
149
|
*/
|
120
150
|
retrieve(id: string, config?: FindConfig<StoreDTO>, sharedContext?: Context): Promise<StoreDTO>;
|
121
151
|
/**
|
122
152
|
* This method retrieves a paginated list of stores based on optional filters and configuration.
|
123
153
|
*
|
124
|
-
* @param {FilterableStoreProps} filters - The filters to apply on the retrieved
|
154
|
+
* @param {FilterableStoreProps} filters - The filters to apply on the retrieved stores.
|
125
155
|
* @param {FindConfig<StoreDTO>} config - The configurations determining how the store is retrieved. Its properties, such as `select` or `relations`, accept the
|
126
156
|
* attributes or relations associated with a store.
|
127
157
|
* @param {Context} sharedContext - A context used to share resources, such as transaction manager, between the application and the module.
|
128
158
|
* @returns {Promise<StoreDTO[]>} The list of stores.
|
129
159
|
*
|
130
160
|
* @example
|
131
|
-
* To retrieve a list of
|
161
|
+
* To retrieve a list of stores using their IDs:
|
132
162
|
*
|
133
163
|
* ```ts
|
134
|
-
* {
|
164
|
+
* const stores = await storeModuleService.list({
|
165
|
+
* id: ["store_123", "store_321"],
|
166
|
+
* })
|
135
167
|
* ```
|
136
168
|
*
|
137
|
-
*
|
169
|
+
* By default, only the first `15` records are retrieved. You can control pagination by specifying the `skip` and `take` properties of the `config` parameter:
|
138
170
|
*
|
139
171
|
* ```ts
|
140
|
-
*
|
172
|
+
* const stores = await storeModuleService.list(
|
173
|
+
* {
|
174
|
+
* id: ["store_123", "store_321"],
|
175
|
+
* },
|
176
|
+
* {
|
177
|
+
* take: 20,
|
178
|
+
* skip: 2,
|
179
|
+
* }
|
180
|
+
* )
|
141
181
|
* ```
|
142
|
-
*
|
143
|
-
* By default, only the first `{default limit}` records are retrieved. You can control pagination by specifying the `skip` and `take` properties of the `config` parameter:
|
144
|
-
*
|
145
|
-
* ```ts
|
146
|
-
* {example-code}
|
147
|
-
* ```
|
148
|
-
*
|
149
|
-
*
|
150
182
|
*/
|
151
183
|
list(filters?: FilterableStoreProps, config?: FindConfig<StoreDTO>, sharedContext?: Context): Promise<StoreDTO[]>;
|
152
184
|
/**
|
153
185
|
* This method retrieves a paginated list of stores along with the total count of available stores satisfying the provided filters.
|
154
186
|
*
|
155
|
-
* @param {FilterableStoreProps} filters - The filters to apply on the retrieved
|
187
|
+
* @param {FilterableStoreProps} filters - The filters to apply on the retrieved stores.
|
156
188
|
* @param {FindConfig<StoreDTO>} config - The configurations determining how the store is retrieved. Its properties, such as `select` or `relations`, accept the
|
157
189
|
* attributes or relations associated with a store.
|
158
190
|
* @param {Context} sharedContext - A context used to share resources, such as transaction manager, between the application and the module.
|
159
191
|
* @returns {Promise<[StoreDTO[], number]>} The list of stores along with their total count.
|
160
192
|
*
|
161
193
|
* @example
|
162
|
-
* To retrieve a list of
|
194
|
+
* To retrieve a list of stores using their IDs:
|
163
195
|
*
|
164
196
|
* ```ts
|
165
|
-
*
|
197
|
+
* const [stores, count] = await storeModuleService.listAndCount(
|
198
|
+
* {
|
199
|
+
* id: ["store_123", "store_321"],
|
200
|
+
* }
|
201
|
+
* )
|
166
202
|
* ```
|
167
203
|
*
|
168
|
-
*
|
204
|
+
* By default, only the first `15` records are retrieved. You can control pagination by specifying the `skip` and `take` properties of the `config` parameter:
|
169
205
|
*
|
170
206
|
* ```ts
|
171
|
-
*
|
207
|
+
* const [stores, count] = await storeModuleService.listAndCount(
|
208
|
+
* {
|
209
|
+
* id: ["store_123", "store_321"],
|
210
|
+
* },
|
211
|
+
* {
|
212
|
+
* take: 20,
|
213
|
+
* skip: 2,
|
214
|
+
* }
|
215
|
+
* )
|
172
216
|
* ```
|
173
|
-
*
|
174
|
-
* By default, only the first `{default limit}` records are retrieved. You can control pagination by specifying the `skip` and `take` properties of the `config` parameter:
|
175
|
-
*
|
176
|
-
* ```ts
|
177
|
-
* {example-code}
|
178
|
-
* ```
|
179
|
-
*
|
180
|
-
*
|
181
217
|
*/
|
182
218
|
listAndCount(filters?: FilterableStoreProps, config?: FindConfig<StoreDTO>, sharedContext?: Context): Promise<[StoreDTO[], number]>;
|
183
219
|
/**
|
184
|
-
* This method soft deletes
|
220
|
+
* This method soft deletes a store by its IDs.
|
185
221
|
*
|
186
|
-
* @param {string[]} storeIds - The
|
222
|
+
* @param {string[]} storeIds - The IDs of the stores.
|
187
223
|
* @param {SoftDeleteReturn<TReturnableLinkableKeys>} config - An object that is used to specify an entity's related entities that should be soft-deleted when the main entity is soft-deleted.
|
188
224
|
* @param {Context} sharedContext - A context used to share resources, such as transaction manager, between the application and the module.
|
189
|
-
* @returns {Promise<void | Record<string, string[]>>}
|
225
|
+
* @returns {Promise<void | Record<string, string[]>>} An object that includes the IDs of related records that were also soft deleted.
|
226
|
+
* If there are no related records, the promise resolves to `void`.
|
190
227
|
*
|
191
228
|
* @example
|
192
|
-
*
|
229
|
+
* await storeModuleService.softDelete([
|
230
|
+
* "store_123",
|
231
|
+
* "store_321",
|
232
|
+
* ])
|
193
233
|
*/
|
194
234
|
softDelete<TReturnableLinkableKeys extends string = string>(storeIds: string[], config?: SoftDeleteReturn<TReturnableLinkableKeys>, sharedContext?: Context): Promise<Record<string, string[]> | void>;
|
195
235
|
/**
|
196
|
-
* This method restores soft deleted
|
236
|
+
* This method restores a soft deleted store by its IDs.
|
197
237
|
*
|
198
|
-
* @param {string[]} storeIds - The
|
199
|
-
* @param {RestoreReturn<TReturnableLinkableKeys>} config - Configurations determining which relations to restore along with each of the
|
200
|
-
* property any of the
|
238
|
+
* @param {string[]} storeIds - The IDs of the stores.
|
239
|
+
* @param {RestoreReturn<TReturnableLinkableKeys>} config - Configurations determining which relations to restore along with each of the store. You can pass to its `returnLinkableKeys`
|
240
|
+
* property any of the store's relation attribute names.
|
201
241
|
* @param {Context} sharedContext - A context used to share resources, such as transaction manager, between the application and the module.
|
202
|
-
* @returns {Promise<void | Record<string, string[]>>} An object that includes the IDs of related records that were restored
|
203
|
-
*
|
204
|
-
* and its value is an array of strings, each being the ID of the record associated with the store through this relation,
|
205
|
-
* such as the IDs of associated currency.
|
242
|
+
* @returns {Promise<void | Record<string, string[]>>} An object that includes the IDs of related records that were restored.
|
243
|
+
* If there are no related records restored, the promise resolves to `void`.
|
206
244
|
*
|
207
245
|
* @example
|
208
|
-
*
|
246
|
+
* await storeModuleService.restore(["store_123", "store_321"])
|
209
247
|
*/
|
210
248
|
restore<TReturnableLinkableKeys extends string = string>(storeIds: string[], config?: RestoreReturn<TReturnableLinkableKeys>, sharedContext?: Context): Promise<Record<string, string[]> | void>;
|
211
249
|
}
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"service.d.ts","sourceRoot":"","sources":["../../src/store/service.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAE,MAAM,WAAW,CAAA;AACtC,OAAO,EAAE,aAAa,EAAE,gBAAgB,EAAE,MAAM,QAAQ,CAAA;AACxD,OAAO,EAAE,cAAc,EAAE,MAAM,gBAAgB,CAAA;AAC/C,OAAO,EAAE,OAAO,EAAE,MAAM,mBAAmB,CAAA;AAC3C,OAAO,EAAE,oBAAoB,EAAE,QAAQ,EAAE,MAAM,UAAU,CAAA;AACzD,OAAO,EAAE,cAAc,EAAE,cAAc,EAAE,cAAc,EAAE,MAAM,aAAa,CAAA;AAE5E;;GAEG;AACH,MAAM,WAAW,mBAAoB,SAAQ,cAAc;IAC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