@medusajs/types 3.0.0-preview-20251203060132 → 3.0.0-preview-20251211180557
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 +1 -0
- package/dist/bundles.d.ts.map +1 -1
- package/dist/bundles.js +2 -1
- package/dist/bundles.js.map +1 -1
- package/dist/cart/common.d.ts +4 -0
- package/dist/cart/common.d.ts.map +1 -1
- package/dist/cart/mutations.d.ts +8 -0
- package/dist/cart/mutations.d.ts.map +1 -1
- package/dist/cart/mutations.js.map +1 -1
- package/dist/cart/workflows.d.ts +8 -0
- package/dist/cart/workflows.d.ts.map +1 -1
- package/dist/http/cart/store/payloads.d.ts +8 -0
- package/dist/http/cart/store/payloads.d.ts.map +1 -1
- package/dist/http/index.d.ts +2 -0
- package/dist/http/index.d.ts.map +1 -1
- package/dist/http/index.js +2 -0
- package/dist/http/index.js.map +1 -1
- package/dist/http/locale/admin/entities.d.ts +4 -0
- package/dist/http/locale/admin/entities.d.ts.map +1 -0
- package/dist/http/locale/admin/entities.js +3 -0
- package/dist/http/locale/admin/entities.js.map +1 -0
- package/dist/http/locale/admin/index.d.ts +4 -0
- package/dist/http/locale/admin/index.d.ts.map +1 -0
- package/dist/http/locale/admin/index.js +20 -0
- package/dist/http/locale/admin/index.js.map +1 -0
- package/dist/http/locale/admin/queries.d.ts +15 -0
- package/dist/http/locale/admin/queries.d.ts.map +1 -0
- package/dist/http/locale/admin/queries.js +3 -0
- package/dist/http/locale/admin/queries.js.map +1 -0
- package/dist/http/locale/admin/responses.d.ts +16 -0
- package/dist/http/locale/admin/responses.d.ts.map +1 -0
- package/dist/http/locale/admin/responses.js +3 -0
- package/dist/http/locale/admin/responses.js.map +1 -0
- package/dist/http/locale/common.d.ts +29 -0
- package/dist/http/locale/common.d.ts.map +1 -0
- package/dist/http/locale/common.js +3 -0
- package/dist/http/locale/common.js.map +1 -0
- package/dist/http/locale/index.d.ts +3 -0
- package/dist/http/locale/index.d.ts.map +1 -0
- package/dist/http/locale/index.js +19 -0
- package/dist/http/locale/index.js.map +1 -0
- package/dist/http/price-list/admin/queries.d.ts +2 -0
- package/dist/http/price-list/admin/queries.d.ts.map +1 -1
- package/dist/http/price-list/admin/responses.d.ts +4 -0
- package/dist/http/price-list/admin/responses.d.ts.map +1 -1
- package/dist/http/store/admin/entities.d.ts +42 -0
- package/dist/http/store/admin/entities.d.ts.map +1 -1
- package/dist/http/store/admin/payloads.d.ts +14 -0
- package/dist/http/store/admin/payloads.d.ts.map +1 -1
- package/dist/http/translations/admin/entities.d.ts +35 -0
- package/dist/http/translations/admin/entities.d.ts.map +1 -0
- package/dist/http/translations/admin/entities.js +3 -0
- package/dist/http/translations/admin/entities.js.map +1 -0
- package/dist/http/translations/admin/index.d.ts +4 -0
- package/dist/http/translations/admin/index.d.ts.map +1 -0
- package/dist/http/translations/admin/index.js +20 -0
- package/dist/http/translations/admin/index.js.map +1 -0
- package/dist/http/translations/admin/queries.d.ts +21 -0
- package/dist/http/translations/admin/queries.d.ts.map +1 -0
- package/dist/http/translations/admin/queries.js +3 -0
- package/dist/http/translations/admin/queries.js.map +1 -0
- package/dist/http/translations/admin/responses.d.ts +33 -0
- package/dist/http/translations/admin/responses.d.ts.map +1 -0
- package/dist/http/translations/admin/responses.js +3 -0
- package/dist/http/translations/admin/responses.js.map +1 -0
- package/dist/http/translations/index.d.ts +2 -0
- package/dist/http/translations/index.d.ts.map +1 -0
- package/dist/http/translations/index.js +18 -0
- package/dist/http/translations/index.js.map +1 -0
- package/dist/index.d.ts +1 -0
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +1 -0
- package/dist/index.js.map +1 -1
- package/dist/modules-sdk/index.d.ts +5 -2
- package/dist/modules-sdk/index.d.ts.map +1 -1
- package/dist/order/common.d.ts +4 -0
- package/dist/order/common.d.ts.map +1 -1
- package/dist/order/mutations.d.ts +8 -0
- package/dist/order/mutations.d.ts.map +1 -1
- package/dist/store/common/store.d.ts +34 -0
- package/dist/store/common/store.d.ts.map +1 -1
- package/dist/store/mutations/store.d.ts +18 -0
- package/dist/store/mutations/store.d.ts.map +1 -1
- package/dist/translation/common.d.ts +111 -0
- package/dist/translation/common.d.ts.map +1 -0
- package/dist/translation/common.js +3 -0
- package/dist/translation/common.js.map +1 -0
- package/dist/translation/index.d.ts +4 -0
- package/dist/translation/index.d.ts.map +1 -0
- package/dist/translation/index.js +20 -0
- package/dist/translation/index.js.map +1 -0
- package/dist/translation/mutations.d.ts +123 -0
- package/dist/translation/mutations.d.ts.map +1 -0
- package/dist/translation/mutations.js +3 -0
- package/dist/translation/mutations.js.map +1 -0
- package/dist/translation/service.d.ts +189 -0
- package/dist/translation/service.d.ts.map +1 -0
- package/dist/translation/service.js +3 -0
- package/dist/translation/service.js.map +1 -0
- package/dist/tsconfig.tsbuildinfo +1 -1
- package/dist/workflow/order/update-order.d.ts +5 -0
- package/dist/workflow/order/update-order.d.ts.map +1 -1
- package/package.json +2 -2
|
@@ -29,6 +29,36 @@ export interface StoreCurrencyDTO {
|
|
|
29
29
|
*/
|
|
30
30
|
deleted_at: string | null;
|
|
31
31
|
}
|
|
32
|
+
export interface StoreLocaleDTO {
|
|
33
|
+
/**
|
|
34
|
+
* The ID of the store locale.
|
|
35
|
+
*/
|
|
36
|
+
id: string;
|
|
37
|
+
/**
|
|
38
|
+
* The locale code of the store locale.
|
|
39
|
+
*/
|
|
40
|
+
locale_code: string;
|
|
41
|
+
/**
|
|
42
|
+
* Whether the locale is the default one for the store.
|
|
43
|
+
*/
|
|
44
|
+
is_default: boolean;
|
|
45
|
+
/**
|
|
46
|
+
* The store ID associated with the locale.
|
|
47
|
+
*/
|
|
48
|
+
store_id: string;
|
|
49
|
+
/**
|
|
50
|
+
* The created date of the locale.
|
|
51
|
+
*/
|
|
52
|
+
created_at: string;
|
|
53
|
+
/**
|
|
54
|
+
* The updated date of the locale.
|
|
55
|
+
*/
|
|
56
|
+
updated_at: string;
|
|
57
|
+
/**
|
|
58
|
+
* The deleted date of the locale.
|
|
59
|
+
*/
|
|
60
|
+
deleted_at: string | null;
|
|
61
|
+
}
|
|
32
62
|
/**
|
|
33
63
|
* The store details.
|
|
34
64
|
*/
|
|
@@ -45,6 +75,10 @@ export interface StoreDTO {
|
|
|
45
75
|
* The supported currency codes of the store.
|
|
46
76
|
*/
|
|
47
77
|
supported_currencies?: StoreCurrencyDTO[];
|
|
78
|
+
/**
|
|
79
|
+
* The supported locale codes of the store.
|
|
80
|
+
*/
|
|
81
|
+
supported_locales?: StoreLocaleDTO[];
|
|
48
82
|
/**
|
|
49
83
|
* The associated default sales channel's ID.
|
|
50
84
|
*/
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"store.d.ts","sourceRoot":"","sources":["../../../src/store/common/store.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,cAAc,EAAE,WAAW,EAAE,MAAM,WAAW,CAAA;AAEvD,MAAM,WAAW,gBAAgB;IAC/B;;OAEG;IACH,EAAE,EAAE,MAAM,CAAA;IACV;;OAEG;IACH,aAAa,EAAE,MAAM,CAAA;IACrB;;OAEG;IACH,UAAU,EAAE,OAAO,CAAA;IACnB;;OAEG;IACH,QAAQ,EAAE,MAAM,CAAA;IAChB;;OAEG;IACH,UAAU,EAAE,MAAM,CAAA;IAClB;;OAEG;IACH,UAAU,EAAE,MAAM,CAAA;IAClB;;OAEG;IACH,UAAU,EAAE,MAAM,GAAG,IAAI,CAAA;CAC1B;AAED;;GAEG;AACH,MAAM,WAAW,QAAQ;IACvB;;OAEG;IACH,EAAE,EAAE,MAAM,CAAA;IAEV;;OAEG;IACH,IAAI,EAAE,MAAM,CAAA;IAEZ;;OAEG;IACH,oBAAoB,CAAC,EAAE,gBAAgB,EAAE,CAAA;IAEzC;;OAEG;IACH,wBAAwB,CAAC,EAAE,MAAM,CAAA;IAEjC;;OAEG;IACH,iBAAiB,CAAC,EAAE,MAAM,CAAA;IAE1B;;OAEG;IACH,mBAAmB,CAAC,EAAE,MA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DTO {
|
|
12
|
+
/**
|
|
13
|
+
* The locale code of the store locale.
|
|
14
|
+
*/
|
|
15
|
+
locale_code: string;
|
|
16
|
+
/**
|
|
17
|
+
* Whether the locale is the default one for the store.
|
|
18
|
+
*/
|
|
19
|
+
is_default?: boolean;
|
|
20
|
+
}
|
|
11
21
|
/**
|
|
12
22
|
* The store to be created.
|
|
13
23
|
*/
|
|
@@ -20,6 +30,10 @@ export interface CreateStoreDTO {
|
|
|
20
30
|
* The supported currency codes of the store.
|
|
21
31
|
*/
|
|
22
32
|
supported_currencies?: CreateStoreCurrencyDTO[];
|
|
33
|
+
/**
|
|
34
|
+
* The suppoprted locale codes of the store.
|
|
35
|
+
*/
|
|
36
|
+
supported_locales?: CreateStoreLocaleDTO[];
|
|
23
37
|
/**
|
|
24
38
|
* The associated default sales channel's ID.
|
|
25
39
|
*/
|
|
@@ -58,6 +72,10 @@ export interface UpdateStoreDTO {
|
|
|
58
72
|
* The supported currency codes of the store.
|
|
59
73
|
*/
|
|
60
74
|
supported_currencies?: CreateStoreCurrencyDTO[];
|
|
75
|
+
/**
|
|
76
|
+
* The supported locale codes of the store.
|
|
77
|
+
*/
|
|
78
|
+
supported_locales?: CreateStoreLocaleDTO[];
|
|
61
79
|
/**
|
|
62
80
|
* The associated default sales channel's ID.
|
|
63
81
|
*/
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"store.d.ts","sourceRoot":"","sources":["../../../src/store/mutations/store.ts"],"names":[],"mappings":"AAAA,MAAM,WAAW,sBAAsB;IACrC;;OAEG;IACH,aAAa,EAAE,MAAM,CAAA;IACrB;;OAEG;IACH,UAAU,CAAC,EAAE,OAAO,CAAA;CACrB;AAED;;GAEG;AACH,MAAM,WAAW,cAAc;IAC7B;;OAEG;IACH,IAAI,CAAC,EAAE,MAAM,CAAA;IAEb;;OAEG;IACH,oBAAoB,CAAC,EAAE,sBAAsB,EAAE,CAAA;IAE/C;;OAEG;IACH,wBAAwB,CAAC,EAAE,MAA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,CAAC,EAAE,oBAAoB,EAAE,CAAA;IAE1C;;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,cAAe,SAAQ,cAAc;IACpD;;OAEG;IACH,EAAE,CAAC,EAAE,MAAM,CAAA;CACZ;AAED;;GAEG;AACH,MAAM,WAAW,cAAc;IAC7B;;OAEG;IACH,IAAI,CAAC,EAAE,MAAM,CAAA;IAEb;;OAEG;IACH,oBAAoB,CAAC,EAAE,sBAAsB,EAAE,CAAA;IAE/C;;OAEG;IACH,iBAAiB,CAAC,EAAE,oBAAoB,EAAE,CAAA;IAE1C;;OAEG;IACH,wBAAwB,CAAC,EAAE,MAAM,GAAG,IAAI,CAAA;IAExC;;OAEG;IACH,iBAAiB,CAAC,EAAE,MAAM,GAAG,IAAI,CAAA;IAEjC;;OAEG;IACH,mBAAmB,CAAC,EAAE,MAAM,GAAG,IAAI,CAAA;IAEnC;;OAEG;IACH,QAAQ,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC,GAAG,IAAI,CAAA;CACtC"}
|
|
@@ -0,0 +1,111 @@
|
|
|
1
|
+
import { BaseFilterable, OperatorMap } from "../dal";
|
|
2
|
+
/**
|
|
3
|
+
* The locale details.
|
|
4
|
+
*/
|
|
5
|
+
export interface LocaleDTO {
|
|
6
|
+
/**
|
|
7
|
+
* The ID of the locale.
|
|
8
|
+
*/
|
|
9
|
+
id: string;
|
|
10
|
+
/**
|
|
11
|
+
* The BCP 47 language tag code of the locale (e.g., "en-US", "fr-FR").
|
|
12
|
+
*/
|
|
13
|
+
code: string;
|
|
14
|
+
/**
|
|
15
|
+
* The human-readable name of the locale (e.g., "English (United States)").
|
|
16
|
+
*/
|
|
17
|
+
name: string;
|
|
18
|
+
/**
|
|
19
|
+
* The date and time the locale was created.
|
|
20
|
+
*/
|
|
21
|
+
created_at: Date | string;
|
|
22
|
+
/**
|
|
23
|
+
* The date and time the locale was last updated.
|
|
24
|
+
*/
|
|
25
|
+
updated_at: Date | string;
|
|
26
|
+
/**
|
|
27
|
+
* The date and time the locale was deleted.
|
|
28
|
+
*/
|
|
29
|
+
deleted_at: Date | string | null;
|
|
30
|
+
}
|
|
31
|
+
/**
|
|
32
|
+
* The translation details.
|
|
33
|
+
*/
|
|
34
|
+
export interface TranslationDTO {
|
|
35
|
+
/**
|
|
36
|
+
* The ID of the translation.
|
|
37
|
+
*/
|
|
38
|
+
id: string;
|
|
39
|
+
/**
|
|
40
|
+
* The ID of the entity being translated.
|
|
41
|
+
*/
|
|
42
|
+
reference_id: string;
|
|
43
|
+
/**
|
|
44
|
+
* The type of entity being translated (e.g., "product", "product_variant").
|
|
45
|
+
*/
|
|
46
|
+
reference: string;
|
|
47
|
+
/**
|
|
48
|
+
* The BCP 47 language tag code for this translation (e.g., "en-US", "fr-FR").
|
|
49
|
+
*/
|
|
50
|
+
locale_code: string;
|
|
51
|
+
/**
|
|
52
|
+
* The translated fields as key-value pairs.
|
|
53
|
+
*/
|
|
54
|
+
translations: Record<string, unknown>;
|
|
55
|
+
/**
|
|
56
|
+
* The date and time the translation was created.
|
|
57
|
+
*/
|
|
58
|
+
created_at: Date | string;
|
|
59
|
+
/**
|
|
60
|
+
* The date and time the translation was last updated.
|
|
61
|
+
*/
|
|
62
|
+
updated_at: Date | string;
|
|
63
|
+
/**
|
|
64
|
+
* The date and time the translation was deleted.
|
|
65
|
+
*/
|
|
66
|
+
deleted_at: Date | string | null;
|
|
67
|
+
}
|
|
68
|
+
/**
|
|
69
|
+
* The filters to apply on the retrieved locales.
|
|
70
|
+
*/
|
|
71
|
+
export interface FilterableLocaleProps extends BaseFilterable<FilterableLocaleProps> {
|
|
72
|
+
/**
|
|
73
|
+
* The IDs to filter the locales by.
|
|
74
|
+
*/
|
|
75
|
+
id?: string[] | string | OperatorMap<string | string[]>;
|
|
76
|
+
/**
|
|
77
|
+
* Filter locales by their code.
|
|
78
|
+
*/
|
|
79
|
+
code?: string | string[] | OperatorMap<string>;
|
|
80
|
+
/**
|
|
81
|
+
* Filter locales by their name.
|
|
82
|
+
*/
|
|
83
|
+
name?: string | OperatorMap<string>;
|
|
84
|
+
}
|
|
85
|
+
/**
|
|
86
|
+
* The filters to apply on the retrieved translations.
|
|
87
|
+
*/
|
|
88
|
+
export interface FilterableTranslationProps extends BaseFilterable<FilterableTranslationProps> {
|
|
89
|
+
/**
|
|
90
|
+
* Search through translated content using this search term.
|
|
91
|
+
* This searches within the JSONB translations field values.
|
|
92
|
+
*/
|
|
93
|
+
q?: string;
|
|
94
|
+
/**
|
|
95
|
+
* The IDs to filter the translations by.
|
|
96
|
+
*/
|
|
97
|
+
id?: string[] | string | OperatorMap<string | string[]>;
|
|
98
|
+
/**
|
|
99
|
+
* Filter translations by entity ID.
|
|
100
|
+
*/
|
|
101
|
+
reference_id?: string | string[] | OperatorMap<string>;
|
|
102
|
+
/**
|
|
103
|
+
* Filter translations by entity type.
|
|
104
|
+
*/
|
|
105
|
+
reference?: string | string[] | OperatorMap<string>;
|
|
106
|
+
/**
|
|
107
|
+
* Filter translations by locale code.
|
|
108
|
+
*/
|
|
109
|
+
locale_code?: string | string[] | OperatorMap<string>;
|
|
110
|
+
}
|
|
111
|
+
//# sourceMappingURL=common.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"common.d.ts","sourceRoot":"","sources":["../../src/translation/common.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,cAAc,EAAE,WAAW,EAAE,MAAM,QAAQ,CAAA;AAEpD;;GAEG;AACH,MAAM,WAAW,SAAS;IACxB;;OAEG;IACH,EAAE,EAAE,MAAM,CAAA;IAEV;;OAEG;IACH,IAA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MAAM,EAAE,GAAG,MAAM,GAAG,WAAW,CAAC,MAAM,GAAG,MAAM,EAAE,CAAC,CAAA;IAEvD;;OAEG;IACH,YAAY,CAAC,EAAE,MAAM,GAAG,MAAM,EAAE,GAAG,WAAW,CAAC,MAAM,CAAC,CAAA;IAEtD;;OAEG;IACH,SAAS,CAAC,EAAE,MAAM,GAAG,MAAM,EAAE,GAAG,WAAW,CAAC,MAAM,CAAC,CAAA;IAEnD;;OAEG;IACH,WAAW,CAAC,EAAE,MAAM,GAAG,MAAM,EAAE,GAAG,WAAW,CAAC,MAAM,CAAC,CAAA;CACtD"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"common.js","sourceRoot":"","sources":["../../src/translation/common.ts"],"names":[],"mappings":""}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/translation/index.ts"],"names":[],"mappings":"AAAA,cAAc,UAAU,CAAA;AACxB,cAAc,aAAa,CAAA;AAC3B,cAAc,WAAW,CAAA"}
|
|
@@ -0,0 +1,20 @@
|
|
|
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
|
+
__exportStar(require("./mutations"), exports);
|
|
19
|
+
__exportStar(require("./service"), exports);
|
|
20
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/translation/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;AAAA,2CAAwB;AACxB,8CAA2B;AAC3B,4CAAyB"}
|
|
@@ -0,0 +1,123 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* The locale to be created.
|
|
3
|
+
*/
|
|
4
|
+
export interface CreateLocaleDTO {
|
|
5
|
+
/**
|
|
6
|
+
* The ID of the locale to create.
|
|
7
|
+
*/
|
|
8
|
+
id?: string;
|
|
9
|
+
/**
|
|
10
|
+
* The BCP 47 language tag code of the locale (e.g., "en-US", "fr-FR").
|
|
11
|
+
*/
|
|
12
|
+
code: string;
|
|
13
|
+
/**
|
|
14
|
+
* The human-readable name of the locale (e.g., "English (United States)").
|
|
15
|
+
*/
|
|
16
|
+
name: string;
|
|
17
|
+
}
|
|
18
|
+
/**
|
|
19
|
+
* The attributes to update in the locale.
|
|
20
|
+
*/
|
|
21
|
+
export interface UpdateLocaleDTO {
|
|
22
|
+
/**
|
|
23
|
+
* The ID of the locale to update.
|
|
24
|
+
*/
|
|
25
|
+
id: string;
|
|
26
|
+
/**
|
|
27
|
+
* The BCP 47 language tag code of the locale.
|
|
28
|
+
*/
|
|
29
|
+
code?: string;
|
|
30
|
+
/**
|
|
31
|
+
* The human-readable name of the locale.
|
|
32
|
+
*/
|
|
33
|
+
name?: string;
|
|
34
|
+
}
|
|
35
|
+
/**
|
|
36
|
+
* The attributes in the locale to be created or updated.
|
|
37
|
+
*/
|
|
38
|
+
export interface UpsertLocaleDTO {
|
|
39
|
+
/**
|
|
40
|
+
* The ID of the locale in case of an update.
|
|
41
|
+
*/
|
|
42
|
+
id?: string;
|
|
43
|
+
/**
|
|
44
|
+
* The BCP 47 language tag code of the locale.
|
|
45
|
+
*/
|
|
46
|
+
code?: string;
|
|
47
|
+
/**
|
|
48
|
+
* The human-readable name of the locale.
|
|
49
|
+
*/
|
|
50
|
+
name?: string;
|
|
51
|
+
}
|
|
52
|
+
/**
|
|
53
|
+
* The translation to be created.
|
|
54
|
+
*/
|
|
55
|
+
export interface CreateTranslationDTO {
|
|
56
|
+
/**
|
|
57
|
+
* The ID of the entity being translated.
|
|
58
|
+
*/
|
|
59
|
+
reference_id: string;
|
|
60
|
+
/**
|
|
61
|
+
* The type of entity being translated (e.g., "product", "product_variant").
|
|
62
|
+
*/
|
|
63
|
+
reference: string;
|
|
64
|
+
/**
|
|
65
|
+
* The BCP 47 language tag code for this translation (e.g., "en-US", "fr-FR").
|
|
66
|
+
*/
|
|
67
|
+
locale_code: string;
|
|
68
|
+
/**
|
|
69
|
+
* The translated fields as key-value pairs.
|
|
70
|
+
*/
|
|
71
|
+
translations: Record<string, unknown>;
|
|
72
|
+
}
|
|
73
|
+
/**
|
|
74
|
+
* The attributes to update in the translation.
|
|
75
|
+
*/
|
|
76
|
+
export interface UpdateTranslationDTO {
|
|
77
|
+
/**
|
|
78
|
+
* The ID of the translation to update.
|
|
79
|
+
*/
|
|
80
|
+
id: string;
|
|
81
|
+
/**
|
|
82
|
+
* The ID of the entity being translated.
|
|
83
|
+
*/
|
|
84
|
+
reference_id?: string;
|
|
85
|
+
/**
|
|
86
|
+
* The type of entity being translated.
|
|
87
|
+
*/
|
|
88
|
+
reference?: string;
|
|
89
|
+
/**
|
|
90
|
+
* The BCP 47 language tag code for this translation.
|
|
91
|
+
*/
|
|
92
|
+
locale_code?: string;
|
|
93
|
+
/**
|
|
94
|
+
* The translated fields as key-value pairs.
|
|
95
|
+
*/
|
|
96
|
+
translations?: Record<string, unknown>;
|
|
97
|
+
}
|
|
98
|
+
/**
|
|
99
|
+
* The attributes in the translation to be created or updated.
|
|
100
|
+
*/
|
|
101
|
+
export interface UpsertTranslationDTO {
|
|
102
|
+
/**
|
|
103
|
+
* The ID of the translation in case of an update.
|
|
104
|
+
*/
|
|
105
|
+
id?: string;
|
|
106
|
+
/**
|
|
107
|
+
* The ID of the entity being translated.
|
|
108
|
+
*/
|
|
109
|
+
reference_id?: string;
|
|
110
|
+
/**
|
|
111
|
+
* The type of entity being translated.
|
|
112
|
+
*/
|
|
113
|
+
reference?: string;
|
|
114
|
+
/**
|
|
115
|
+
* The BCP 47 language tag code for this translation.
|
|
116
|
+
*/
|
|
117
|
+
locale_code?: string;
|
|
118
|
+
/**
|
|
119
|
+
* The translated fields as key-value pairs.
|
|
120
|
+
*/
|
|
121
|
+
translations?: Record<string, unknown>;
|
|
122
|
+
}
|
|
123
|
+
//# sourceMappingURL=mutations.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"mutations.d.ts","sourceRoot":"","sources":["../../src/translation/mutations.ts"],"names":[],"mappings":"AAAA;;GAEG;AACH,MAAM,WAAW,eAAe;IAC9B;;OAEG;IACH,EAAE,CAAC,EAAE,MAAM,CAAA;IAEX;;OAEG;IACH,IAAI,EAAE,MAAM,CAAA;IAEZ;;OAEG;IACH,IAAI,EAAE,MAAM,CAAA;CACb;AAED;;GAEG;AACH,MAAM,WAAW,eAAe;IAC9B;;OAEG;IACH,EAAE,EAAE,MAAM,CAAA;IAEV;;OAEG;IACH,IAAI,CAAC,EAAE,MAAM,CAAA;IAEb;;OAEG;IACH,IAAI,CAAC,EAAE,MAAM,CAAA;CACd;AAED;;GAEG;AACH,MAAM,WAAW,eAAe;IAC9B;;OAEG;IACH,EAAE,CAAC,EAAE,MAAM,CAAA;IAEX;;OAEG;IACH,IAAI,CAAC,EAAE,MAAM,CAAA;IAEb;;OAEG;IACH,IAAI,CAAC,EAAE,MAAM,CAAA;CACd;AAED;;GAEG;AACH,MAAM,WAAW,oBAAoB;IACnC;;OAEG;IACH,YAAY,EAAE,MAAM,CAAA;IAEpB;;OAEG;IACH,SAAS,EAAE,MAAM,CAAA;IAEjB;;OAEG;IACH,WAAW,EAAE,MAAM,CAAA;IAEnB;;OAEG;IACH,YAAY,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAA;CACtC;AAED;;GAEG;AACH,MAAM,WAAW,oBAAoB;IACnC;;OAEG;IACH,EAAE,EAAE,MAAM,CAAA;IAEV;;OAEG;IACH,YAAY,CAAC,EAAE,MAAM,CAAA;IAErB;;OAEG;IACH,SAAS,CAAC,EAAE,MAAM,CAAA;IAElB;;OAEG;IACH,WAAW,CAAC,EAAE,MAAM,CAAA;IAEpB;;OAEG;IACH,YAAY,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAA;CACvC;AAED;;GAEG;AACH,MAAM,WAAW,oBAAoB;IACnC;;OAEG;IACH,EAAE,CAAC,EAAE,MAAM,CAAA;IAEX;;OAEG;IACH,YAAY,CAAC,EAAE,MAAM,CAAA;IAErB;;OAEG;IACH,SAAS,CAAC,EAAE,MAAM,CAAA;IAElB;;OAEG;IACH,WAAW,CAAC,EAAE,MAAM,CAAA;IAEpB;;OAEG;IACH,YAAY,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAA;CACvC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"mutations.js","sourceRoot":"","sources":["../../src/translation/mutations.ts"],"names":[],"mappings":""}
|
|
@@ -0,0 +1,189 @@
|
|
|
1
|
+
import { FindConfig } from "../common";
|
|
2
|
+
import { RestoreReturn, SoftDeleteReturn } from "../dal";
|
|
3
|
+
import { IModuleService } from "../modules-sdk";
|
|
4
|
+
import { Context } from "../shared-context";
|
|
5
|
+
import { FilterableLocaleProps, FilterableTranslationProps, LocaleDTO, TranslationDTO } from "./common";
|
|
6
|
+
import { CreateLocaleDTO, CreateTranslationDTO, UpdateLocaleDTO, UpdateTranslationDTO } from "./mutations";
|
|
7
|
+
/**
|
|
8
|
+
* The main service interface for the Translation Module.
|
|
9
|
+
* Method signatures match what MedusaService generates.
|
|
10
|
+
*/
|
|
11
|
+
export interface ITranslationModuleService extends IModuleService {
|
|
12
|
+
/**
|
|
13
|
+
* This method retrieves a locale by its ID.
|
|
14
|
+
*
|
|
15
|
+
* @param {string} id - The ID of the locale.
|
|
16
|
+
* @param {FindConfig<LocaleDTO>} config - The configurations determining how the locale is retrieved.
|
|
17
|
+
* @param {Context} sharedContext
|
|
18
|
+
* @returns {Promise<LocaleDTO>} The retrieved locale.
|
|
19
|
+
*/
|
|
20
|
+
retrieveLocale(id: string, config?: FindConfig<LocaleDTO>, sharedContext?: Context): Promise<LocaleDTO>;
|
|
21
|
+
/**
|
|
22
|
+
* This method retrieves a paginated list of locales based on optional filters and configuration.
|
|
23
|
+
*
|
|
24
|
+
* @param {FilterableLocaleProps} filters - The filters to apply on the retrieved locales.
|
|
25
|
+
* @param {FindConfig<LocaleDTO>} config - The configurations determining how the locale is retrieved.
|
|
26
|
+
* @param {Context} sharedContext
|
|
27
|
+
* @returns {Promise<LocaleDTO[]>} The list of locales.
|
|
28
|
+
*/
|
|
29
|
+
listLocales(filters?: FilterableLocaleProps, config?: FindConfig<LocaleDTO>, sharedContext?: Context): Promise<LocaleDTO[]>;
|
|
30
|
+
/**
|
|
31
|
+
* This method retrieves a paginated list of locales along with the total count.
|
|
32
|
+
*
|
|
33
|
+
* @param {FilterableLocaleProps} filters - The filters to apply on the retrieved locales.
|
|
34
|
+
* @param {FindConfig<LocaleDTO>} config - The configurations determining how the locale is retrieved.
|
|
35
|
+
* @param {Context} sharedContext
|
|
36
|
+
* @returns {Promise<[LocaleDTO[], number]>} The list of locales along with their total count.
|
|
37
|
+
*/
|
|
38
|
+
listAndCountLocales(filters?: FilterableLocaleProps, config?: FindConfig<LocaleDTO>, sharedContext?: Context): Promise<[LocaleDTO[], number]>;
|
|
39
|
+
/**
|
|
40
|
+
* This method creates a locale.
|
|
41
|
+
*
|
|
42
|
+
* @param {CreateLocaleDTO} data - The locale to be created.
|
|
43
|
+
* @param {Context} sharedContext
|
|
44
|
+
* @returns {Promise<LocaleDTO>} The created locale.
|
|
45
|
+
*/
|
|
46
|
+
createLocales(data: CreateLocaleDTO, sharedContext?: Context): Promise<LocaleDTO>;
|
|
47
|
+
/**
|
|
48
|
+
* This method creates locales.
|
|
49
|
+
*
|
|
50
|
+
* @param {CreateLocaleDTO[]} data - The locales to be created.
|
|
51
|
+
* @param {Context} sharedContext
|
|
52
|
+
* @returns {Promise<LocaleDTO[]>} The created locales.
|
|
53
|
+
*/
|
|
54
|
+
createLocales(data: CreateLocaleDTO[], sharedContext?: Context): Promise<LocaleDTO[]>;
|
|
55
|
+
/**
|
|
56
|
+
* This method updates an existing locale. The ID should be included in the data object.
|
|
57
|
+
*
|
|
58
|
+
* @param {UpdateLocaleDTO} data - The attributes to update in the locale (including id).
|
|
59
|
+
* @param {Context} sharedContext
|
|
60
|
+
* @returns {Promise<LocaleDTO>} The updated locale.
|
|
61
|
+
*/
|
|
62
|
+
updateLocales(data: UpdateLocaleDTO, sharedContext?: Context): Promise<LocaleDTO>;
|
|
63
|
+
/**
|
|
64
|
+
* This method updates existing locales using an array or selector-based approach.
|
|
65
|
+
*
|
|
66
|
+
* @param {UpdateLocaleDTO[] | { selector: Record<string, any>; data: UpdateLocaleDTO | UpdateLocaleDTO[] }} dataOrOptions - The data or options for bulk update.
|
|
67
|
+
* @param {Context} sharedContext
|
|
68
|
+
* @returns {Promise<LocaleDTO[]>} The updated locales.
|
|
69
|
+
*/
|
|
70
|
+
updateLocales(dataOrOptions: UpdateLocaleDTO[] | {
|
|
71
|
+
selector: Record<string, any>;
|
|
72
|
+
data: UpdateLocaleDTO | UpdateLocaleDTO[];
|
|
73
|
+
}, sharedContext?: Context): Promise<LocaleDTO[]>;
|
|
74
|
+
/**
|
|
75
|
+
* This method deletes locales by their IDs or objects.
|
|
76
|
+
*
|
|
77
|
+
* @param {string | object | string[] | object[]} primaryKeyValues - The IDs or objects identifying the locales to delete.
|
|
78
|
+
* @param {Context} sharedContext
|
|
79
|
+
* @returns {Promise<void>} Resolves when the locales are deleted.
|
|
80
|
+
*/
|
|
81
|
+
deleteLocales(primaryKeyValues: string | object | string[] | object[], sharedContext?: Context): Promise<void>;
|
|
82
|
+
/**
|
|
83
|
+
* This method soft deletes locales by their IDs or objects.
|
|
84
|
+
*
|
|
85
|
+
* @param {string | object | string[] | object[]} primaryKeyValues - The IDs or objects identifying the locales to soft delete.
|
|
86
|
+
* @param {SoftDeleteReturn<TReturnableLinkableKeys>} config - An object for related entities that should be soft-deleted.
|
|
87
|
+
* @param {Context} sharedContext
|
|
88
|
+
* @returns {Promise<Record<string, string[]> | void>} An object with IDs of related records that were also soft deleted.
|
|
89
|
+
*/
|
|
90
|
+
softDeleteLocales<TReturnableLinkableKeys extends string = string>(primaryKeyValues: string | object | string[] | object[], config?: SoftDeleteReturn<TReturnableLinkableKeys>, sharedContext?: Context): Promise<Record<string, string[]> | void>;
|
|
91
|
+
/**
|
|
92
|
+
* This method restores soft deleted locales by their IDs or objects.
|
|
93
|
+
*
|
|
94
|
+
* @param {string | object | string[] | object[]} primaryKeyValues - The IDs or objects identifying the locales to restore.
|
|
95
|
+
* @param {RestoreReturn<TReturnableLinkableKeys>} config - Configurations determining which relations to restore.
|
|
96
|
+
* @param {Context} sharedContext
|
|
97
|
+
* @returns {Promise<Record<string, string[]> | void>} An object with IDs of related records that were restored.
|
|
98
|
+
*/
|
|
99
|
+
restoreLocales<TReturnableLinkableKeys extends string = string>(primaryKeyValues: string | object | string[] | object[], config?: RestoreReturn<TReturnableLinkableKeys>, sharedContext?: Context): Promise<Record<string, string[]> | void>;
|
|
100
|
+
/**
|
|
101
|
+
* This method retrieves a translation by its ID.
|
|
102
|
+
*
|
|
103
|
+
* @param {string} id - The ID of the translation.
|
|
104
|
+
* @param {FindConfig<TranslationDTO>} config - The configurations determining how the translation is retrieved.
|
|
105
|
+
* @param {Context} sharedContext
|
|
106
|
+
* @returns {Promise<TranslationDTO>} The retrieved translation.
|
|
107
|
+
*/
|
|
108
|
+
retrieveTranslation(id: string, config?: FindConfig<TranslationDTO>, sharedContext?: Context): Promise<TranslationDTO>;
|
|
109
|
+
/**
|
|
110
|
+
* This method retrieves a paginated list of translations based on optional filters and configuration.
|
|
111
|
+
*
|
|
112
|
+
* @param {FilterableTranslationProps} filters - The filters to apply on the retrieved translations.
|
|
113
|
+
* @param {FindConfig<TranslationDTO>} config - The configurations determining how the translation is retrieved.
|
|
114
|
+
* @param {Context} sharedContext
|
|
115
|
+
* @returns {Promise<TranslationDTO[]>} The list of translations.
|
|
116
|
+
*/
|
|
117
|
+
listTranslations(filters?: FilterableTranslationProps, config?: FindConfig<TranslationDTO>, sharedContext?: Context): Promise<TranslationDTO[]>;
|
|
118
|
+
/**
|
|
119
|
+
* This method retrieves a paginated list of translations along with the total count.
|
|
120
|
+
*
|
|
121
|
+
* @param {FilterableTranslationProps} filters - The filters to apply on the retrieved translations.
|
|
122
|
+
* @param {FindConfig<TranslationDTO>} config - The configurations determining how the translation is retrieved.
|
|
123
|
+
* @param {Context} sharedContext
|
|
124
|
+
* @returns {Promise<[TranslationDTO[], number]>} The list of translations along with their total count.
|
|
125
|
+
*/
|
|
126
|
+
listAndCountTranslations(filters?: FilterableTranslationProps, config?: FindConfig<TranslationDTO>, sharedContext?: Context): Promise<[TranslationDTO[], number]>;
|
|
127
|
+
/**
|
|
128
|
+
* This method creates a translation.
|
|
129
|
+
*
|
|
130
|
+
* @param {CreateTranslationDTO} data - The translation to be created.
|
|
131
|
+
* @param {Context} sharedContext
|
|
132
|
+
* @returns {Promise<TranslationDTO>} The created translation.
|
|
133
|
+
*/
|
|
134
|
+
createTranslations(data: CreateTranslationDTO, sharedContext?: Context): Promise<TranslationDTO>;
|
|
135
|
+
/**
|
|
136
|
+
* This method creates translations.
|
|
137
|
+
*
|
|
138
|
+
* @param {CreateTranslationDTO[]} data - The translations to be created.
|
|
139
|
+
* @param {Context} sharedContext
|
|
140
|
+
* @returns {Promise<TranslationDTO[]>} The created translations.
|
|
141
|
+
*/
|
|
142
|
+
createTranslations(data: CreateTranslationDTO[], sharedContext?: Context): Promise<TranslationDTO[]>;
|
|
143
|
+
/**
|
|
144
|
+
* This method updates an existing translation. The ID should be included in the data object.
|
|
145
|
+
*
|
|
146
|
+
* @param {UpdateTranslationDTO} data - The attributes to update in the translation (including id).
|
|
147
|
+
* @param {Context} sharedContext
|
|
148
|
+
* @returns {Promise<TranslationDTO>} The updated translation.
|
|
149
|
+
*/
|
|
150
|
+
updateTranslations(data: UpdateTranslationDTO, sharedContext?: Context): Promise<TranslationDTO>;
|
|
151
|
+
/**
|
|
152
|
+
* This method updates existing translations using an array or selector-based approach.
|
|
153
|
+
*
|
|
154
|
+
* @param {UpdateTranslationDTO[] | { selector: Record<string, any>; data: UpdateTranslationDTO | UpdateTranslationDTO[] }} dataOrOptions - The data or options for bulk update.
|
|
155
|
+
* @param {Context} sharedContext
|
|
156
|
+
* @returns {Promise<TranslationDTO[]>} The updated translations.
|
|
157
|
+
*/
|
|
158
|
+
updateTranslations(dataOrOptions: UpdateTranslationDTO[] | {
|
|
159
|
+
selector: Record<string, any>;
|
|
160
|
+
data: UpdateTranslationDTO | UpdateTranslationDTO[];
|
|
161
|
+
}, sharedContext?: Context): Promise<TranslationDTO[]>;
|
|
162
|
+
/**
|
|
163
|
+
* This method deletes translations by their IDs or objects.
|
|
164
|
+
*
|
|
165
|
+
* @param {string | object | string[] | object[]} primaryKeyValues - The IDs or objects identifying the translations to delete.
|
|
166
|
+
* @param {Context} sharedContext
|
|
167
|
+
* @returns {Promise<void>} Resolves when the translations are deleted.
|
|
168
|
+
*/
|
|
169
|
+
deleteTranslations(primaryKeyValues: string | object | string[] | object[], sharedContext?: Context): Promise<void>;
|
|
170
|
+
/**
|
|
171
|
+
* This method soft deletes translations by their IDs or objects.
|
|
172
|
+
*
|
|
173
|
+
* @param {string | object | string[] | object[]} primaryKeyValues - The IDs or objects identifying the translations to soft delete.
|
|
174
|
+
* @param {SoftDeleteReturn<TReturnableLinkableKeys>} config - An object for related entities that should be soft-deleted.
|
|
175
|
+
* @param {Context} sharedContext
|
|
176
|
+
* @returns {Promise<Record<string, string[]> | void>} An object with IDs of related records that were also soft deleted.
|
|
177
|
+
*/
|
|
178
|
+
softDeleteTranslations<TReturnableLinkableKeys extends string = string>(primaryKeyValues: string | object | string[] | object[], config?: SoftDeleteReturn<TReturnableLinkableKeys>, sharedContext?: Context): Promise<Record<string, string[]> | void>;
|
|
179
|
+
/**
|
|
180
|
+
* This method restores soft deleted translations by their IDs or objects.
|
|
181
|
+
*
|
|
182
|
+
* @param {string | object | string[] | object[]} primaryKeyValues - The IDs or objects identifying the translations to restore.
|
|
183
|
+
* @param {RestoreReturn<TReturnableLinkableKeys>} config - Configurations determining which relations to restore.
|
|
184
|
+
* @param {Context} sharedContext
|
|
185
|
+
* @returns {Promise<Record<string, string[]> | void>} An object with IDs of related records that were restored.
|
|
186
|
+
*/
|
|
187
|
+
restoreTranslations<TReturnableLinkableKeys extends string = string>(primaryKeyValues: string | object | string[] | object[], config?: RestoreReturn<TReturnableLinkableKeys>, sharedContext?: Context): Promise<Record<string, string[]> | void>;
|
|
188
|
+
}
|
|
189
|
+
//# sourceMappingURL=service.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"service.d.ts","sourceRoot":"","sources":["../../src/translation/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,EACL,qBAAqB,EACrB,0BAA0B,EAC1B,SAAS,EACT,cAAc,EACf,MAAM,UAAU,CAAA;AACjB,OAAO,EACL,eAAe,EAC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