@medusajs/core-flows 3.0.0-snapshot-20251216103925 → 3.0.0-snapshot-20251216135612
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/translation/steps/create-translations.d.ts +8 -1
- package/dist/translation/steps/create-translations.d.ts.map +1 -1
- package/dist/translation/steps/create-translations.js +3 -0
- package/dist/translation/steps/create-translations.js.map +1 -1
- package/dist/translation/steps/delete-translations.d.ts +9 -0
- package/dist/translation/steps/delete-translations.d.ts.map +1 -1
- package/dist/translation/steps/delete-translations.js +9 -0
- package/dist/translation/steps/delete-translations.js.map +1 -1
- package/dist/translation/steps/update-translations.d.ts +21 -1
- package/dist/translation/steps/update-translations.d.ts.map +1 -1
- package/dist/translation/steps/update-translations.js +18 -1
- package/dist/translation/steps/update-translations.js.map +1 -1
- package/dist/translation/steps/validate-translations.d.ts +19 -0
- package/dist/translation/steps/validate-translations.d.ts.map +1 -1
- package/dist/translation/steps/validate-translations.js +19 -1
- package/dist/translation/steps/validate-translations.js.map +1 -1
- package/dist/translation/workflows/batch-translations.d.ts +54 -0
- package/dist/translation/workflows/batch-translations.d.ts.map +1 -1
- package/dist/translation/workflows/batch-translations.js +42 -0
- package/dist/translation/workflows/batch-translations.js.map +1 -1
- package/dist/translation/workflows/create-translations.d.ts +11 -1
- package/dist/translation/workflows/create-translations.d.ts.map +1 -1
- package/dist/translation/workflows/create-translations.js +5 -1
- package/dist/translation/workflows/create-translations.js.map +1 -1
- package/dist/translation/workflows/delete-translations.d.ts +11 -1
- package/dist/translation/workflows/delete-translations.d.ts.map +1 -1
- package/dist/translation/workflows/delete-translations.js +5 -1
- package/dist/translation/workflows/delete-translations.js.map +1 -1
- package/dist/translation/workflows/update-translations.d.ts +27 -8
- package/dist/translation/workflows/update-translations.d.ts.map +1 -1
- package/dist/translation/workflows/update-translations.js +24 -8
- package/dist/translation/workflows/update-translations.js.map +1 -1
- package/package.json +3 -3
|
@@ -1,8 +1,15 @@
|
|
|
1
1
|
import { CreateTranslationDTO } from "@medusajs/framework/types";
|
|
2
|
+
/**
|
|
3
|
+
* The translations to create.
|
|
4
|
+
*/
|
|
5
|
+
export type CreateTranslationsStepInput = CreateTranslationDTO[];
|
|
2
6
|
export declare const createTranslationsStepId = "create-translations";
|
|
3
7
|
/**
|
|
4
8
|
* This step creates one or more translations.
|
|
5
9
|
*
|
|
10
|
+
* @since 2.12.3
|
|
11
|
+
* @featureFlag translation
|
|
12
|
+
*
|
|
6
13
|
* @example
|
|
7
14
|
* const data = createTranslationsStep([
|
|
8
15
|
* {
|
|
@@ -13,5 +20,5 @@ export declare const createTranslationsStepId = "create-translations";
|
|
|
13
20
|
* }
|
|
14
21
|
* ])
|
|
15
22
|
*/
|
|
16
|
-
export declare const createTranslationsStep: import("@medusajs/framework/workflows-sdk").StepFunction<
|
|
23
|
+
export declare const createTranslationsStep: import("@medusajs/framework/workflows-sdk").StepFunction<CreateTranslationsStepInput, import("@medusajs/framework/types").TranslationDTO[]>;
|
|
17
24
|
//# sourceMappingURL=create-translations.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"create-translations.d.ts","sourceRoot":"","sources":["../../../src/translation/steps/create-translations.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,oBAAoB,EAErB,MAAM,2BAA2B,CAAA;AAIlC,eAAO,MAAM,wBAAwB,wBAAwB,CAAA;AAC7D
|
|
1
|
+
{"version":3,"file":"create-translations.d.ts","sourceRoot":"","sources":["../../../src/translation/steps/create-translations.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,oBAAoB,EAErB,MAAM,2BAA2B,CAAA;AAIlC;;GAEG;AACH,MAAM,MAAM,2BAA2B,GAAG,oBAAoB,EAAE,CAAA;AAEhE,eAAO,MAAM,wBAAwB,wBAAwB,CAAA;AAC7D;;;;;;;;;;;;;;;GAeG;AACH,eAAO,MAAM,sBAAsB,6IAyBlC,CAAA"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"create-translations.js","sourceRoot":"","sources":["../../../src/translation/steps/create-translations.ts"],"names":[],"mappings":";;;AAIA,qDAAmD;AACnD,qEAA4E;
|
|
1
|
+
{"version":3,"file":"create-translations.js","sourceRoot":"","sources":["../../../src/translation/steps/create-translations.ts"],"names":[],"mappings":";;;AAIA,qDAAmD;AACnD,qEAA4E;AAO/D,QAAA,wBAAwB,GAAG,qBAAqB,CAAA;AAC7D;;;;;;;;;;;;;;;GAeG;AACU,QAAA,sBAAsB,GAAG,IAAA,0BAAU,EAC9C,gCAAwB,EACxB,KAAK,EAAE,IAAiC,EAAE,EAAE,SAAS,EAAE,EAAE,EAAE;IACzD,MAAM,OAAO,GAAG,SAAS,CAAC,OAAO,CAC/B,eAAO,CAAC,WAAW,CACpB,CAAA;IAED,MAAM,OAAO,GAAG,MAAM,OAAO,CAAC,kBAAkB,CAAC,IAAI,CAAC,CAAA;IAEtD,OAAO,IAAI,4BAAY,CACrB,OAAO,EACP,OAAO,CAAC,GAAG,CAAC,CAAC,WAAW,EAAE,EAAE,CAAC,WAAW,CAAC,EAAE,CAAC,CAC7C,CAAA;AACH,CAAC,EACD,KAAK,EAAE,UAAU,EAAE,EAAE,SAAS,EAAE,EAAE,EAAE;IAClC,IAAI,CAAC,UAAU,EAAE,MAAM,EAAE,CAAC;QACxB,OAAM;IACR,CAAC;IAED,MAAM,OAAO,GAAG,SAAS,CAAC,OAAO,CAC/B,eAAO,CAAC,WAAW,CACpB,CAAA;IAED,MAAM,OAAO,CAAC,kBAAkB,CAAC,UAAU,CAAC,CAAA;AAC9C,CAAC,CACF,CAAA"}
|
|
@@ -5,6 +5,15 @@ export type DeleteTranslationsStepInput = string[];
|
|
|
5
5
|
export declare const deleteTranslationsStepId = "delete-translations";
|
|
6
6
|
/**
|
|
7
7
|
* This step deletes one or more translations.
|
|
8
|
+
*
|
|
9
|
+
* @since 2.12.3
|
|
10
|
+
* @featureFlag translation
|
|
11
|
+
*
|
|
12
|
+
* @example
|
|
13
|
+
* const data = deleteTranslationsStep([
|
|
14
|
+
* "trans_123",
|
|
15
|
+
* "trans_456",
|
|
16
|
+
* ])
|
|
8
17
|
*/
|
|
9
18
|
export declare const deleteTranslationsStep: import("@medusajs/framework/workflows-sdk").StepFunction<DeleteTranslationsStepInput, undefined>;
|
|
10
19
|
//# sourceMappingURL=delete-translations.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"delete-translations.d.ts","sourceRoot":"","sources":["../../../src/translation/steps/delete-translations.ts"],"names":[],"mappings":"AAIA;;GAEG;AACH,MAAM,MAAM,2BAA2B,GAAG,MAAM,EAAE,CAAA;AAElD,eAAO,MAAM,wBAAwB,wBAAwB,CAAA;AAC7D
|
|
1
|
+
{"version":3,"file":"delete-translations.d.ts","sourceRoot":"","sources":["../../../src/translation/steps/delete-translations.ts"],"names":[],"mappings":"AAIA;;GAEG;AACH,MAAM,MAAM,2BAA2B,GAAG,MAAM,EAAE,CAAA;AAElD,eAAO,MAAM,wBAAwB,wBAAwB,CAAA;AAC7D;;;;;;;;;;;GAWG;AACH,eAAO,MAAM,sBAAsB,kGAsBlC,CAAA"}
|
|
@@ -6,6 +6,15 @@ const workflows_sdk_1 = require("@medusajs/framework/workflows-sdk");
|
|
|
6
6
|
exports.deleteTranslationsStepId = "delete-translations";
|
|
7
7
|
/**
|
|
8
8
|
* This step deletes one or more translations.
|
|
9
|
+
*
|
|
10
|
+
* @since 2.12.3
|
|
11
|
+
* @featureFlag translation
|
|
12
|
+
*
|
|
13
|
+
* @example
|
|
14
|
+
* const data = deleteTranslationsStep([
|
|
15
|
+
* "trans_123",
|
|
16
|
+
* "trans_456",
|
|
17
|
+
* ])
|
|
9
18
|
*/
|
|
10
19
|
exports.deleteTranslationsStep = (0, workflows_sdk_1.createStep)(exports.deleteTranslationsStepId, async (ids, { container }) => {
|
|
11
20
|
const service = container.resolve(utils_1.Modules.TRANSLATION);
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"delete-translations.js","sourceRoot":"","sources":["../../../src/translation/steps/delete-translations.ts"],"names":[],"mappings":";;;AACA,qDAAmD;AACnD,qEAA4E;AAO/D,QAAA,wBAAwB,GAAG,qBAAqB,CAAA;AAC7D
|
|
1
|
+
{"version":3,"file":"delete-translations.js","sourceRoot":"","sources":["../../../src/translation/steps/delete-translations.ts"],"names":[],"mappings":";;;AACA,qDAAmD;AACnD,qEAA4E;AAO/D,QAAA,wBAAwB,GAAG,qBAAqB,CAAA;AAC7D;;;;;;;;;;;GAWG;AACU,QAAA,sBAAsB,GAAG,IAAA,0BAAU,EAC9C,gCAAwB,EACxB,KAAK,EAAE,GAAgC,EAAE,EAAE,SAAS,EAAE,EAAE,EAAE;IACxD,MAAM,OAAO,GAAG,SAAS,CAAC,OAAO,CAC/B,eAAO,CAAC,WAAW,CACpB,CAAA;IAED,MAAM,OAAO,CAAC,sBAAsB,CAAC,GAAG,CAAC,CAAA;IAEzC,OAAO,IAAI,4BAAY,CAAC,KAAK,CAAC,EAAE,GAAG,CAAC,CAAA;AACtC,CAAC,EACD,KAAK,EAAE,OAAO,EAAE,EAAE,SAAS,EAAE,EAAE,EAAE;IAC/B,IAAI,CAAC,OAAO,EAAE,MAAM,EAAE,CAAC;QACrB,OAAM;IACR,CAAC;IAED,MAAM,OAAO,GAAG,SAAS,CAAC,OAAO,CAC/B,eAAO,CAAC,WAAW,CACpB,CAAA;IAED,MAAM,OAAO,CAAC,mBAAmB,CAAC,OAAO,CAAC,CAAA;AAC5C,CAAC,CACF,CAAA"}
|
|
@@ -12,13 +12,32 @@ export type UpdateTranslationsStepInput = {
|
|
|
12
12
|
*/
|
|
13
13
|
update: UpdateTranslationDataDTO;
|
|
14
14
|
} | {
|
|
15
|
+
/**
|
|
16
|
+
* The translations to update by ID.
|
|
17
|
+
*/
|
|
15
18
|
translations: UpdateTranslationDTO[];
|
|
16
19
|
};
|
|
17
20
|
export declare const updateTranslationsStepId = "update-translations";
|
|
18
21
|
/**
|
|
19
|
-
* This step updates translations matching the specified filters.
|
|
22
|
+
* This step updates translations matching the specified filters or by ID.
|
|
23
|
+
*
|
|
24
|
+
* @since 2.12.3
|
|
25
|
+
* @featureFlag translation
|
|
20
26
|
*
|
|
21
27
|
* @example
|
|
28
|
+
* To update translations by their ID:
|
|
29
|
+
*
|
|
30
|
+
* ```ts
|
|
31
|
+
* const data = updateTranslationsStep({
|
|
32
|
+
* translations: [
|
|
33
|
+
* { id: "trans_123", translations: { title: "Nouveau titre" } }
|
|
34
|
+
* ]
|
|
35
|
+
* })
|
|
36
|
+
* ```
|
|
37
|
+
*
|
|
38
|
+
* To update translations matching filters:
|
|
39
|
+
*
|
|
40
|
+
* ```ts
|
|
22
41
|
* const data = updateTranslationsStep({
|
|
23
42
|
* selector: {
|
|
24
43
|
* reference_id: "prod_123",
|
|
@@ -28,6 +47,7 @@ export declare const updateTranslationsStepId = "update-translations";
|
|
|
28
47
|
* translations: { title: "Nouveau titre" }
|
|
29
48
|
* }
|
|
30
49
|
* })
|
|
50
|
+
* ```
|
|
31
51
|
*/
|
|
32
52
|
export declare const updateTranslationsStep: import("@medusajs/framework/workflows-sdk").StepFunction<UpdateTranslationsStepInput, import("@medusajs/framework/types").TranslationDTO[]>;
|
|
33
53
|
//# sourceMappingURL=update-translations.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"update-translations.d.ts","sourceRoot":"","sources":["../../../src/translation/steps/update-translations.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,0BAA0B,EAE1B,wBAAwB,EACxB,oBAAoB,EACrB,MAAM,2BAA2B,CAAA;AAQlC;;GAEG;AACH,MAAM,MAAM,2BAA2B,GACnC;IACE;;OAEG;IACH,QAAQ,EAAE,0BAA0B,CAAA;IACpC;;OAEG;IACH,MAAM,EAAE,wBAAwB,CAAA;CACjC,GACD;
|
|
1
|
+
{"version":3,"file":"update-translations.d.ts","sourceRoot":"","sources":["../../../src/translation/steps/update-translations.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,0BAA0B,EAE1B,wBAAwB,EACxB,oBAAoB,EACrB,MAAM,2BAA2B,CAAA;AAQlC;;GAEG;AACH,MAAM,MAAM,2BAA2B,GACnC;IACE;;OAEG;IACH,QAAQ,EAAE,0BAA0B,CAAA;IACpC;;OAEG;IACH,MAAM,EAAE,wBAAwB,CAAA;CACjC,GACD;IACA;;OAEG;IACD,YAAY,EAAE,oBAAoB,EAAE,CAAA;CACrC,CAAA;AAEL,eAAO,MAAM,wBAAwB,wBAAwB,CAAA;AAC7D;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA8BG;AACH,eAAO,MAAM,sBAAsB,6IAmElC,CAAA"}
|
|
@@ -5,9 +5,25 @@ const utils_1 = require("@medusajs/framework/utils");
|
|
|
5
5
|
const workflows_sdk_1 = require("@medusajs/framework/workflows-sdk");
|
|
6
6
|
exports.updateTranslationsStepId = "update-translations";
|
|
7
7
|
/**
|
|
8
|
-
* This step updates translations matching the specified filters.
|
|
8
|
+
* This step updates translations matching the specified filters or by ID.
|
|
9
|
+
*
|
|
10
|
+
* @since 2.12.3
|
|
11
|
+
* @featureFlag translation
|
|
9
12
|
*
|
|
10
13
|
* @example
|
|
14
|
+
* To update translations by their ID:
|
|
15
|
+
*
|
|
16
|
+
* ```ts
|
|
17
|
+
* const data = updateTranslationsStep({
|
|
18
|
+
* translations: [
|
|
19
|
+
* { id: "trans_123", translations: { title: "Nouveau titre" } }
|
|
20
|
+
* ]
|
|
21
|
+
* })
|
|
22
|
+
* ```
|
|
23
|
+
*
|
|
24
|
+
* To update translations matching filters:
|
|
25
|
+
*
|
|
26
|
+
* ```ts
|
|
11
27
|
* const data = updateTranslationsStep({
|
|
12
28
|
* selector: {
|
|
13
29
|
* reference_id: "prod_123",
|
|
@@ -17,6 +33,7 @@ exports.updateTranslationsStepId = "update-translations";
|
|
|
17
33
|
* translations: { title: "Nouveau titre" }
|
|
18
34
|
* }
|
|
19
35
|
* })
|
|
36
|
+
* ```
|
|
20
37
|
*/
|
|
21
38
|
exports.updateTranslationsStep = (0, workflows_sdk_1.createStep)(exports.updateTranslationsStepId, async (data, { container }) => {
|
|
22
39
|
const service = container.resolve(utils_1.Modules.TRANSLATION);
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"update-translations.js","sourceRoot":"","sources":["../../../src/translation/steps/update-translations.ts"],"names":[],"mappings":";;;AAMA,qDAIkC;AAClC,qEAA4E;
|
|
1
|
+
{"version":3,"file":"update-translations.js","sourceRoot":"","sources":["../../../src/translation/steps/update-translations.ts"],"names":[],"mappings":";;;AAMA,qDAIkC;AAClC,qEAA4E;AAuB/D,QAAA,wBAAwB,GAAG,qBAAqB,CAAA;AAC7D;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA8BG;AACU,QAAA,sBAAsB,GAAG,IAAA,0BAAU,EAC9C,gCAAwB,EACxB,KAAK,EAAE,IAAiC,EAAE,EAAE,SAAS,EAAE,EAAE,EAAE;IACzD,MAAM,OAAO,GAAG,SAAS,CAAC,OAAO,CAC/B,eAAO,CAAC,WAAW,CACpB,CAAA;IAED,IAAI,cAAc,IAAI,IAAI,EAAE,CAAC;QAC3B,IAAI,IAAI,CAAC,YAAY,CAAC,IAAI,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC,CAAC,CAAC,EAAE,CAAC,EAAE,CAAC;YACzC,MAAM,IAAI,mBAAW,CACnB,wBAAgB,CAAC,YAAY,EAC7B,sEAAsE,CACvE,CAAA;QACH,CAAC;QAED,IAAI,CAAC,IAAI,CAAC,YAAY,CAAC,MAAM,EAAE,CAAC;YAC9B,OAAO,IAAI,4BAAY,CAAC,EAAE,EAAE,EAAE,CAAC,CAAA;QACjC,CAAC;QAED,MAAM,QAAQ,GAAG,MAAM,OAAO,CAAC,gBAAgB,CAAC;YAC9C,EAAE,EAAE,IAAI,CAAC,YAAY,CAAC,GAAG,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC,CAAC,EAAE,CAAa;SACnD,CAAC,CAAA;QAEF,MAAM,YAAY,GAAG,MAAM,OAAO,CAAC,kBAAkB,CAAC,IAAI,CAAC,YAAY,CAAC,CAAA;QACxE,OAAO,IAAI,4BAAY,CAAC,YAAY,EAAE,QAAQ,CAAC,CAAA;IACjD,CAAC;IAED,MAAM,QAAQ,GAAG,MAAM,OAAO,CAAC,gBAAgB,CAAC,IAAI,CAAC,QAAQ,EAAE;QAC7D,MAAM,EAAE;YACN,IAAI;YACJ,cAAc;YACd,WAAW;YACX,aAAa;YACb,cAAc;SACf;KACF,CAAC,CAAA;IAEF,IAAI,MAAM,CAAC,IAAI,CAAC,IAAI,CAAC,MAAM,CAAC,CAAC,MAAM,KAAK,CAAC,EAAE,CAAC;QAC1C,OAAO,IAAI,4BAAY,CAAC,QAAQ,EAAE,EAAE,CAAC,CAAA;IACvC,CAAC;IAED,MAAM,YAAY,GAAG,MAAM,OAAO,CAAC,kBAAkB,CAAC;QACpD,QAAQ,EAAE,IAAI,CAAC,QAAQ;QACvB,IAAI,EAAE,IAAI,CAAC,MAAM;KAClB,CAAC,CAAA;IAEF,OAAO,IAAI,4BAAY,CAAC,YAAY,EAAE,QAAQ,CAAC,CAAA;AACjD,CAAC,EACD,KAAK,EAAE,QAAQ,EAAE,EAAE,SAAS,EAAE,EAAE,EAAE;IAChC,IAAI,CAAC,QAAQ,EAAE,MAAM,EAAE,CAAC;QACtB,OAAM;IACR,CAAC;IAED,MAAM,OAAO,GAAG,SAAS,CAAC,OAAO,CAC/B,eAAO,CAAC,WAAW,CACpB,CAAA;IAED,MAAM,OAAO,CAAC,kBAAkB,CAC9B,QAAQ,CAAC,GAAG,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC;QACnB,EAAE,EAAE,CAAC,CAAC,EAAE;QACR,YAAY,EAAE,CAAC,CAAC,YAAY;QAC5B,SAAS,EAAE,CAAC,CAAC,SAAS;QACtB,WAAW,EAAE,CAAC,CAAC,WAAW;QAC1B,YAAY,EAAE,CAAC,CAAC,YAAY;KAC7B,CAAC,CAAC,CACJ,CAAA;AACH,CAAC,CACF,CAAA"}
|
|
@@ -1,5 +1,24 @@
|
|
|
1
1
|
import { CreateTranslationDTO, UpdateTranslationDataDTO, UpdateTranslationDTO } from "@medusajs/types";
|
|
2
2
|
export declare const validateTranslationsStepId = "validate-translations";
|
|
3
3
|
export type ValidateTranslationsStepInput = CreateTranslationDTO[] | CreateTranslationDTO | UpdateTranslationDTO[] | UpdateTranslationDTO | UpdateTranslationDataDTO;
|
|
4
|
+
/**
|
|
5
|
+
* This step validates that the translations are supported by the store.
|
|
6
|
+
*
|
|
7
|
+
* @since 2.12.3
|
|
8
|
+
* @featureFlag translation
|
|
9
|
+
*
|
|
10
|
+
* @example
|
|
11
|
+
* const data = validateTranslationsStep([
|
|
12
|
+
* {
|
|
13
|
+
* reference_id: "prod_123",
|
|
14
|
+
* reference: "product",
|
|
15
|
+
* locale: "fr-FR",
|
|
16
|
+
* translations: { title: "Produit", description: "Description du produit" }
|
|
17
|
+
* }
|
|
18
|
+
* ])
|
|
19
|
+
*
|
|
20
|
+
* @privateRemarks
|
|
21
|
+
* TODO: Do we want to validate anything else here?
|
|
22
|
+
*/
|
|
4
23
|
export declare const validateTranslationsStep: import("@medusajs/framework/workflows-sdk").StepFunction<ValidateTranslationsStepInput, undefined>;
|
|
5
24
|
//# sourceMappingURL=validate-translations.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"validate-translations.d.ts","sourceRoot":"","sources":["../../../src/translation/steps/validate-translations.ts"],"names":[],"mappings":"AAMA,OAAO,EAAE,oBAAoB,EAAE,wBAAwB,EAAE,oBAAoB,EAAE,MAAM,iBAAiB,CAAA;AAEtG,eAAO,MAAM,0BAA0B,0BAA0B,CAAA;AAEjE,MAAM,MAAM,6BAA6B,GACrC,oBAAoB,EAAE,GACtB,oBAAoB,GACpB,oBAAoB,EAAE,GACtB,oBAAoB,GACpB,wBAAwB,CAAA;
|
|
1
|
+
{"version":3,"file":"validate-translations.d.ts","sourceRoot":"","sources":["../../../src/translation/steps/validate-translations.ts"],"names":[],"mappings":"AAMA,OAAO,EAAE,oBAAoB,EAAE,wBAAwB,EAAE,oBAAoB,EAAE,MAAM,iBAAiB,CAAA;AAEtG,eAAO,MAAM,0BAA0B,0BAA0B,CAAA;AAEjE,MAAM,MAAM,6BAA6B,GACrC,oBAAoB,EAAE,GACtB,oBAAoB,GACpB,oBAAoB,EAAE,GACtB,oBAAoB,GACpB,wBAAwB,CAAA;AAE5B;;;;;;;;;;;;;;;;;;GAkBG;AACH,eAAO,MAAM,wBAAwB,oGAuCpC,CAAA"}
|
|
@@ -4,7 +4,25 @@ exports.validateTranslationsStep = exports.validateTranslationsStepId = void 0;
|
|
|
4
4
|
const utils_1 = require("@medusajs/framework/utils");
|
|
5
5
|
const workflows_sdk_1 = require("@medusajs/framework/workflows-sdk");
|
|
6
6
|
exports.validateTranslationsStepId = "validate-translations";
|
|
7
|
-
|
|
7
|
+
/**
|
|
8
|
+
* This step validates that the translations are supported by the store.
|
|
9
|
+
*
|
|
10
|
+
* @since 2.12.3
|
|
11
|
+
* @featureFlag translation
|
|
12
|
+
*
|
|
13
|
+
* @example
|
|
14
|
+
* const data = validateTranslationsStep([
|
|
15
|
+
* {
|
|
16
|
+
* reference_id: "prod_123",
|
|
17
|
+
* reference: "product",
|
|
18
|
+
* locale: "fr-FR",
|
|
19
|
+
* translations: { title: "Produit", description: "Description du produit" }
|
|
20
|
+
* }
|
|
21
|
+
* ])
|
|
22
|
+
*
|
|
23
|
+
* @privateRemarks
|
|
24
|
+
* TODO: Do we want to validate anything else here?
|
|
25
|
+
*/
|
|
8
26
|
exports.validateTranslationsStep = (0, workflows_sdk_1.createStep)(exports.validateTranslationsStepId, async (data, { container }) => {
|
|
9
27
|
const query = container.resolve(utils_1.ContainerRegistrationKeys.QUERY);
|
|
10
28
|
const { data: [store], } = await query.graph({
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"validate-translations.js","sourceRoot":"","sources":["../../../src/translation/steps/validate-translations.ts"],"names":[],"mappings":";;;AAAA,qDAIkC;AAClC,qEAA4E;AAG/D,QAAA,0BAA0B,GAAG,uBAAuB,CAAA;AASjE
|
|
1
|
+
{"version":3,"file":"validate-translations.js","sourceRoot":"","sources":["../../../src/translation/steps/validate-translations.ts"],"names":[],"mappings":";;;AAAA,qDAIkC;AAClC,qEAA4E;AAG/D,QAAA,0BAA0B,GAAG,uBAAuB,CAAA;AASjE;;;;;;;;;;;;;;;;;;GAkBG;AACU,QAAA,wBAAwB,GAAG,IAAA,0BAAU,EAChD,kCAA0B,EAC1B,KAAK,EAAE,IAAmC,EAAE,EAAE,SAAS,EAAE,EAAE,EAAE;IAC3D,MAAM,KAAK,GAAG,SAAS,CAAC,OAAO,CAAC,iCAAyB,CAAC,KAAK,CAAC,CAAA;IAChE,MAAM,EACJ,IAAI,EAAE,CAAC,KAAK,CAAC,GACd,GAAG,MAAM,KAAK,CAAC,KAAK,CACnB;QACE,MAAM,EAAE,OAAO;QACf,MAAM,EAAE,CAAC,IAAI,EAAE,qBAAqB,CAAC;QACrC,UAAU,EAAE;YACV,IAAI,EAAE,CAAC;SACR;KACF,EACD;QACE,KAAK,EAAE,EAAE,MAAM,EAAE,IAAI,EAAE;KACxB,CACF,CAAA;IAED,MAAM,cAAc,GAAG,CAAC,KAAK,CAAC,iBAAiB,IAAI,EAAE,CAAC,CAAC,GAAG,CACxD,CAAC,MAAM,EAAE,EAAE,CAAC,MAAM,CAAC,WAAW,CAC/B,CAAA;IACD,MAAM,eAAe,GAAG,KAAK,CAAC,OAAO,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC,IAAI,CAAC,CAAA;IAE3D,MAAM,kBAAkB,GAAG,eAAe;SACvC,MAAM,CAAC,CAAC,WAAW,EAAE,EAAE,CAAC,OAAO,CAAC,WAAW,CAAC,WAAW,CAAC,CAAC;SACzD,GAAG,CAAC,CAAC,WAAW,EAAE,EAAE,CAAC,WAAW,CAAC,WAAW,CAAC;SAC7C,MAAM,CAAC,CAAC,MAAM,EAAE,EAAE,CAAC,CAAC,cAAc,CAAC,QAAQ,CAAC,MAAM,CAAC,CAAC,CAAA;IAEvD,IAAI,kBAAkB,CAAC,MAAM,EAAE,CAAC;QAC9B,MAAM,IAAI,mBAAW,CACnB,wBAAgB,CAAC,YAAY,EAC7B,yDAAyD,kBAAkB,CAAC,IAAI,CAC9E,IAAI,CACL,EAAE,CACJ,CAAA;IACH,CAAC;IACD,OAAO,IAAI,4BAAY,CAAC,KAAK,CAAC,CAAC,CAAA;AACjC,CAAC,CACF,CAAA"}
|
|
@@ -1,10 +1,64 @@
|
|
|
1
1
|
import { CreateTranslationDTO, UpdateTranslationDTO } from "@medusajs/types";
|
|
2
2
|
export declare const batchTranslationsWorkflowId = "batch-translations";
|
|
3
|
+
/**
|
|
4
|
+
* The translations to manage.
|
|
5
|
+
*/
|
|
3
6
|
export type BatchTranslationsWorkflowInput = {
|
|
7
|
+
/**
|
|
8
|
+
* The translations to create.
|
|
9
|
+
*/
|
|
4
10
|
create: CreateTranslationDTO[];
|
|
11
|
+
/**
|
|
12
|
+
* The translations to update.
|
|
13
|
+
*/
|
|
5
14
|
update: UpdateTranslationDTO[];
|
|
15
|
+
/**
|
|
16
|
+
* The IDs of the translations to delete.
|
|
17
|
+
*/
|
|
6
18
|
delete: string[];
|
|
7
19
|
};
|
|
20
|
+
/**
|
|
21
|
+
* This workflow creates, updates, and deletes translations. It's used by the
|
|
22
|
+
* [Manage Translations Admin API Route](https://docs.medusajs.com/api/admin#translations_posttranslationsbatch).
|
|
23
|
+
*
|
|
24
|
+
* You can use this workflow within your own customizations or custom workflows, allowing you
|
|
25
|
+
* to create, update, and delete translations in your custom flows.
|
|
26
|
+
*
|
|
27
|
+
* @since 2.12.3
|
|
28
|
+
* @featureFlag translation
|
|
29
|
+
*
|
|
30
|
+
* @example
|
|
31
|
+
* const { result } = await batchTranslationsWorkflow(container)
|
|
32
|
+
* .run({
|
|
33
|
+
* input: {
|
|
34
|
+
* create: [
|
|
35
|
+
* {
|
|
36
|
+
* reference_id: "prod_123",
|
|
37
|
+
* reference: "product",
|
|
38
|
+
* locale_code: "en-US",
|
|
39
|
+
* translations: {
|
|
40
|
+
* title: "Product Title",
|
|
41
|
+
* description: "Product Description",
|
|
42
|
+
* },
|
|
43
|
+
* }
|
|
44
|
+
* ],
|
|
45
|
+
* update: [
|
|
46
|
+
* {
|
|
47
|
+
* id: "trans_123",
|
|
48
|
+
* translations: {
|
|
49
|
+
* title: "Product Title",
|
|
50
|
+
* description: "Product Description",
|
|
51
|
+
* },
|
|
52
|
+
* }
|
|
53
|
+
* ],
|
|
54
|
+
* delete: ["trans_321"]
|
|
55
|
+
* }
|
|
56
|
+
* })
|
|
57
|
+
*
|
|
58
|
+
* @summary
|
|
59
|
+
*
|
|
60
|
+
* Create, update, and delete translations.
|
|
61
|
+
*/
|
|
8
62
|
export declare const batchTranslationsWorkflow: import("@medusajs/framework/workflows-sdk").ReturnWorkflow<BatchTranslationsWorkflowInput, {
|
|
9
63
|
created: import("@medusajs/types").TranslationDTO[];
|
|
10
64
|
updated: import("@medusajs/types").TranslationDTO[];
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"batch-translations.d.ts","sourceRoot":"","sources":["../../../src/translation/workflows/batch-translations.ts"],"names":[],"mappings":"AAMA,OAAO,EAAE,oBAAoB,EAAE,oBAAoB,EAAE,MAAM,iBAAiB,CAAA;AAK5E,eAAO,MAAM,2BAA2B,uBAAuB,CAAA;AAE/D,MAAM,MAAM,8BAA8B,GAAG;IAC3C,MAAM,EAAE,oBAAoB,EAAE,CAAA;IAC9B,MAAM,EAAE,oBAAoB,EAAE,CAAA;IAC9B,MAAM,EAAE,MAAM,EAAE,CAAA;CACjB,CAAA;AACD,eAAO,MAAM,yBAAyB;;;;MAyBrC,CAAA"}
|
|
1
|
+
{"version":3,"file":"batch-translations.d.ts","sourceRoot":"","sources":["../../../src/translation/workflows/batch-translations.ts"],"names":[],"mappings":"AAMA,OAAO,EAAE,oBAAoB,EAAE,oBAAoB,EAAE,MAAM,iBAAiB,CAAA;AAK5E,eAAO,MAAM,2BAA2B,uBAAuB,CAAA;AAE/D;;GAEG;AACH,MAAM,MAAM,8BAA8B,GAAG;IAC3C;;OAEG;IACH,MAAM,EAAE,oBAAoB,EAAE,CAAA;IAC9B;;OAEG;IACH,MAAM,EAAE,oBAAoB,EAAE,CAAA;IAC9B;;OAEG;IACH,MAAM,EAAE,MAAM,EAAE,CAAA;CACjB,CAAA;AACD;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAyCG;AACH,eAAO,MAAM,yBAAyB;;;;MAyBrC,CAAA"}
|
|
@@ -6,6 +6,48 @@ const create_translations_1 = require("./create-translations");
|
|
|
6
6
|
const delete_translations_1 = require("./delete-translations");
|
|
7
7
|
const update_translations_1 = require("./update-translations");
|
|
8
8
|
exports.batchTranslationsWorkflowId = "batch-translations";
|
|
9
|
+
/**
|
|
10
|
+
* This workflow creates, updates, and deletes translations. It's used by the
|
|
11
|
+
* [Manage Translations Admin API Route](https://docs.medusajs.com/api/admin#translations_posttranslationsbatch).
|
|
12
|
+
*
|
|
13
|
+
* You can use this workflow within your own customizations or custom workflows, allowing you
|
|
14
|
+
* to create, update, and delete translations in your custom flows.
|
|
15
|
+
*
|
|
16
|
+
* @since 2.12.3
|
|
17
|
+
* @featureFlag translation
|
|
18
|
+
*
|
|
19
|
+
* @example
|
|
20
|
+
* const { result } = await batchTranslationsWorkflow(container)
|
|
21
|
+
* .run({
|
|
22
|
+
* input: {
|
|
23
|
+
* create: [
|
|
24
|
+
* {
|
|
25
|
+
* reference_id: "prod_123",
|
|
26
|
+
* reference: "product",
|
|
27
|
+
* locale_code: "en-US",
|
|
28
|
+
* translations: {
|
|
29
|
+
* title: "Product Title",
|
|
30
|
+
* description: "Product Description",
|
|
31
|
+
* },
|
|
32
|
+
* }
|
|
33
|
+
* ],
|
|
34
|
+
* update: [
|
|
35
|
+
* {
|
|
36
|
+
* id: "trans_123",
|
|
37
|
+
* translations: {
|
|
38
|
+
* title: "Product Title",
|
|
39
|
+
* description: "Product Description",
|
|
40
|
+
* },
|
|
41
|
+
* }
|
|
42
|
+
* ],
|
|
43
|
+
* delete: ["trans_321"]
|
|
44
|
+
* }
|
|
45
|
+
* })
|
|
46
|
+
*
|
|
47
|
+
* @summary
|
|
48
|
+
*
|
|
49
|
+
* Create, update, and delete translations.
|
|
50
|
+
*/
|
|
9
51
|
exports.batchTranslationsWorkflow = (0, workflows_sdk_1.createWorkflow)(exports.batchTranslationsWorkflowId, (input) => {
|
|
10
52
|
const [created, updated, deleted] = (0, workflows_sdk_1.parallelize)(create_translations_1.createTranslationsWorkflow.runAsStep({
|
|
11
53
|
input: {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"batch-translations.js","sourceRoot":"","sources":["../../../src/translation/workflows/batch-translations.ts"],"names":[],"mappings":";;;AAAA,qEAK0C;AAE1C,+DAAkE;AAClE,+DAAkE;AAClE,+DAAkE;AAErD,QAAA,2BAA2B,GAAG,oBAAoB,CAAA;
|
|
1
|
+
{"version":3,"file":"batch-translations.js","sourceRoot":"","sources":["../../../src/translation/workflows/batch-translations.ts"],"names":[],"mappings":";;;AAAA,qEAK0C;AAE1C,+DAAkE;AAClE,+DAAkE;AAClE,+DAAkE;AAErD,QAAA,2BAA2B,GAAG,oBAAoB,CAAA;AAmB/D;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAyCG;AACU,QAAA,yBAAyB,GAAG,IAAA,8BAAc,EACrD,mCAA2B,EAC3B,CAAC,KAAqC,EAAE,EAAE;IACxC,MAAM,CAAC,OAAO,EAAE,OAAO,EAAE,OAAO,CAAC,GAAG,IAAA,2BAAW,EAC7C,gDAA0B,CAAC,SAAS,CAAC;QACnC,KAAK,EAAE;YACL,YAAY,EAAE,KAAK,CAAC,MAAM;SAC3B;KACF,CAAC,EACF,gDAA0B,CAAC,SAAS,CAAC;QACnC,KAAK,EAAE;YACL,YAAY,EAAE,KAAK,CAAC,MAAM;SAC3B;KACF,CAAC,EACF,gDAA0B,CAAC,SAAS,CAAC;QACnC,KAAK,EAAE;YACL,GAAG,EAAE,KAAK,CAAC,MAAM;SAClB;KACF,CAAC,CACH,CAAA;IAED,OAAO,IAAI,gCAAgB,CACzB,IAAA,yBAAS,EAAC,EAAE,OAAO,EAAE,OAAO,EAAE,OAAO,EAAE,EAAE,CAAC,MAAM,EAAE,EAAE,CAAC,MAAM,CAAC,CAC7D,CAAA;AACH,CAAC,CACF,CAAA"}
|
|
@@ -1,14 +1,24 @@
|
|
|
1
1
|
import { CreateTranslationDTO, TranslationDTO } from "@medusajs/framework/types";
|
|
2
|
+
/**
|
|
3
|
+
* The translations to create.
|
|
4
|
+
*/
|
|
2
5
|
export type CreateTranslationsWorkflowInput = {
|
|
6
|
+
/**
|
|
7
|
+
* The translations to create.
|
|
8
|
+
*/
|
|
3
9
|
translations: CreateTranslationDTO[];
|
|
4
10
|
};
|
|
5
11
|
export declare const createTranslationsWorkflowId = "create-translations";
|
|
6
12
|
/**
|
|
7
|
-
* This workflow creates one or more translations.
|
|
13
|
+
* This workflow creates one or more translations. It's used by other workflows
|
|
14
|
+
* like the {@link batchTranslationsWorkflow} workflow.
|
|
8
15
|
*
|
|
9
16
|
* You can use this workflow within your own customizations or custom workflows, allowing you
|
|
10
17
|
* to create translations in your custom flows.
|
|
11
18
|
*
|
|
19
|
+
* @since 2.12.3
|
|
20
|
+
* @featureFlag translation
|
|
21
|
+
*
|
|
12
22
|
* @example
|
|
13
23
|
* const { result } = await createTranslationsWorkflow(container)
|
|
14
24
|
* .run({
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"create-translations.d.ts","sourceRoot":"","sources":["../../../src/translation/workflows/create-translations.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,oBAAoB,EAAE,cAAc,EAAE,MAAM,2BAA2B,CAAA;AAYhF,MAAM,MAAM,+BAA+B,GAAG;IAC5C,YAAY,EAAE,oBAAoB,EAAE,CAAA;CACrC,CAAA;AAED,eAAO,MAAM,4BAA4B,wBAAwB,CAAA;AACjE
|
|
1
|
+
{"version":3,"file":"create-translations.d.ts","sourceRoot":"","sources":["../../../src/translation/workflows/create-translations.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,oBAAoB,EAAE,cAAc,EAAE,MAAM,2BAA2B,CAAA;AAYhF;;GAEG;AACH,MAAM,MAAM,+BAA+B,GAAG;IAC5C;;OAEG;IACH,YAAY,EAAE,oBAAoB,EAAE,CAAA;CACrC,CAAA;AAED,eAAO,MAAM,4BAA4B,wBAAwB,CAAA;AACjE;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA4BG;AACH,eAAO,MAAM,0BAA0B,mHAwBtC,CAAA"}
|
|
@@ -8,11 +8,15 @@ const steps_2 = require("../steps");
|
|
|
8
8
|
const utils_1 = require("@medusajs/framework/utils");
|
|
9
9
|
exports.createTranslationsWorkflowId = "create-translations";
|
|
10
10
|
/**
|
|
11
|
-
* This workflow creates one or more translations.
|
|
11
|
+
* This workflow creates one or more translations. It's used by other workflows
|
|
12
|
+
* like the {@link batchTranslationsWorkflow} workflow.
|
|
12
13
|
*
|
|
13
14
|
* You can use this workflow within your own customizations or custom workflows, allowing you
|
|
14
15
|
* to create translations in your custom flows.
|
|
15
16
|
*
|
|
17
|
+
* @since 2.12.3
|
|
18
|
+
* @featureFlag translation
|
|
19
|
+
*
|
|
16
20
|
* @example
|
|
17
21
|
* const { result } = await createTranslationsWorkflow(container)
|
|
18
22
|
* .run({
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"create-translations.js","sourceRoot":"","sources":["../../../src/translation/workflows/create-translations.ts"],"names":[],"mappings":";;;AACA,qEAK0C;AAC1C,8DAA6D;AAC7D,oCAAiD;AACjD,oCAAmD;AACnD,qDAAqE;
|
|
1
|
+
{"version":3,"file":"create-translations.js","sourceRoot":"","sources":["../../../src/translation/workflows/create-translations.ts"],"names":[],"mappings":";;;AACA,qEAK0C;AAC1C,8DAA6D;AAC7D,oCAAiD;AACjD,oCAAmD;AACnD,qDAAqE;AAYxD,QAAA,4BAA4B,GAAG,qBAAqB,CAAA;AACjE;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA4BG;AACU,QAAA,0BAA0B,GAAG,IAAA,8BAAc,EACtD,oCAA4B,EAC5B,CACE,KAAoD,EAChB,EAAE;IACtC,IAAA,gCAAwB,EAAC,KAAK,CAAC,YAAY,CAAC,CAAA;IAC5C,MAAM,YAAY,GAAG,IAAA,8BAAsB,EAAC,KAAK,CAAC,YAAY,CAAC,CAAA;IAE/D,MAAM,mBAAmB,GAAG,IAAA,yBAAS,EACnC,EAAE,YAAY,EAAE,EAChB,CAAC,EAAE,YAAY,EAAE,EAAE,EAAE;QACnB,OAAO,YAAY,CAAC,GAAG,CAAC,CAAC,CAAC,EAAE,EAAE;YAC5B,OAAO,EAAE,EAAE,EAAE,CAAC,CAAC,EAAE,EAAE,CAAA;QACrB,CAAC,CAAC,CAAA;IACJ,CAAC,CACF,CAAA;IAED,IAAA,0BAAa,EAAC;QACZ,SAAS,EAAE,iCAAyB,CAAC,OAAO;QAC5C,IAAI,EAAE,mBAAmB;KAC1B,CAAC,CAAA;IAEF,OAAO,IAAI,gCAAgB,CAAC,YAAY,CAAC,CAAA;AAC3C,CAAC,CACF,CAAA"}
|
|
@@ -1,13 +1,23 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* The IDs of the translations to delete.
|
|
3
|
+
*/
|
|
1
4
|
export type DeleteTranslationsWorkflowInput = {
|
|
5
|
+
/**
|
|
6
|
+
* The IDs of the translations to delete.
|
|
7
|
+
*/
|
|
2
8
|
ids: string[];
|
|
3
9
|
};
|
|
4
10
|
export declare const deleteTranslationsWorkflowId = "delete-translations";
|
|
5
11
|
/**
|
|
6
|
-
* This workflow deletes one or more translations.
|
|
12
|
+
* This workflow deletes one or more translations. It's used by other
|
|
13
|
+
* workflows like the {@link batchTranslationsWorkflow} workflow.
|
|
7
14
|
*
|
|
8
15
|
* You can use this workflow within your own customizations or custom workflows, allowing you
|
|
9
16
|
* to delete translations in your custom flows.
|
|
10
17
|
*
|
|
18
|
+
* @since 2.12.3
|
|
19
|
+
* @featureFlag translation
|
|
20
|
+
*
|
|
11
21
|
* @example
|
|
12
22
|
* const { result } = await deleteTranslationsWorkflow(container)
|
|
13
23
|
* .run({
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"delete-translations.d.ts","sourceRoot":"","sources":["../../../src/translation/workflows/delete-translations.ts"],"names":[],"mappings":"AASA,MAAM,MAAM,+BAA+B,GAAG;
|
|
1
|
+
{"version":3,"file":"delete-translations.d.ts","sourceRoot":"","sources":["../../../src/translation/workflows/delete-translations.ts"],"names":[],"mappings":"AASA;;GAEG;AACH,MAAM,MAAM,+BAA+B,GAAG;IAC5C;;OAEG;IACH,GAAG,EAAE,MAAM,EAAE,CAAA;CACd,CAAA;AAED,eAAO,MAAM,4BAA4B,wBAAwB,CAAA;AACjE;;;;;;;;;;;;;;;;;;;;;GAqBG;AACH,eAAO,MAAM,0BAA0B,6GAkBtC,CAAA"}
|
|
@@ -7,11 +7,15 @@ const steps_1 = require("../steps");
|
|
|
7
7
|
const utils_1 = require("@medusajs/framework/utils");
|
|
8
8
|
exports.deleteTranslationsWorkflowId = "delete-translations";
|
|
9
9
|
/**
|
|
10
|
-
* This workflow deletes one or more translations.
|
|
10
|
+
* This workflow deletes one or more translations. It's used by other
|
|
11
|
+
* workflows like the {@link batchTranslationsWorkflow} workflow.
|
|
11
12
|
*
|
|
12
13
|
* You can use this workflow within your own customizations or custom workflows, allowing you
|
|
13
14
|
* to delete translations in your custom flows.
|
|
14
15
|
*
|
|
16
|
+
* @since 2.12.3
|
|
17
|
+
* @featureFlag translation
|
|
18
|
+
*
|
|
15
19
|
* @example
|
|
16
20
|
* const { result } = await deleteTranslationsWorkflow(container)
|
|
17
21
|
* .run({
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"delete-translations.js","sourceRoot":"","sources":["../../../src/translation/workflows/delete-translations.ts"],"names":[],"mappings":";;;AAAA,qEAI0C;AAC1C,8DAA6D;AAC7D,oCAAiD;AACjD,qDAAqE;
|
|
1
|
+
{"version":3,"file":"delete-translations.js","sourceRoot":"","sources":["../../../src/translation/workflows/delete-translations.ts"],"names":[],"mappings":";;;AAAA,qEAI0C;AAC1C,8DAA6D;AAC7D,oCAAiD;AACjD,qDAAqE;AAYxD,QAAA,4BAA4B,GAAG,qBAAqB,CAAA;AACjE;;;;;;;;;;;;;;;;;;;;;GAqBG;AACU,QAAA,0BAA0B,GAAG,IAAA,8BAAc,EACtD,oCAA4B,EAC5B,CACE,KAAoD,EAChC,EAAE;IACtB,IAAA,8BAAsB,EAAC,KAAK,CAAC,GAAG,CAAC,CAAA;IAEjC,MAAM,mBAAmB,GAAG,IAAA,yBAAS,EAAC,EAAE,KAAK,EAAE,EAAE,CAAC,EAAE,KAAK,EAAE,EAAE,EAAE;QAC7D,OAAO,KAAK,CAAC,GAAG,EAAE,GAAG,CAAC,CAAC,EAAE,EAAE,EAAE;YAC3B,OAAO,EAAE,EAAE,EAAE,CAAA;QACf,CAAC,CAAC,CAAA;IACJ,CAAC,CAAC,CAAA;IAEF,IAAA,0BAAa,EAAC;QACZ,SAAS,EAAE,iCAAyB,CAAC,OAAO;QAC5C,IAAI,EAAE,mBAAmB;KAC1B,CAAC,CAAA;AACJ,CAAC,CACF,CAAA"}
|
|
@@ -1,26 +1,45 @@
|
|
|
1
1
|
import { TranslationDTO } from "@medusajs/framework/types";
|
|
2
2
|
import { UpdateTranslationsStepInput } from "../steps";
|
|
3
|
+
/**
|
|
4
|
+
* The translations to update.
|
|
5
|
+
*/
|
|
3
6
|
export type UpdateTranslationsWorkflowInput = UpdateTranslationsStepInput;
|
|
4
7
|
export declare const updateTranslationsWorkflowId = "update-translations";
|
|
5
8
|
/**
|
|
6
|
-
* This workflow updates translations matching the specified filters.
|
|
9
|
+
* This workflow updates translations matching the specified filters or IDs. It's used by other
|
|
10
|
+
* workflows like the {@link batchTranslationsWorkflow} workflow.
|
|
7
11
|
*
|
|
8
12
|
* You can use this workflow within your own customizations or custom workflows, allowing you
|
|
9
13
|
* to update translations in your custom flows.
|
|
10
14
|
*
|
|
15
|
+
* @since 2.12.3
|
|
16
|
+
* @featureFlag translation
|
|
17
|
+
*
|
|
11
18
|
* @example
|
|
19
|
+
* To update translations by their IDs:
|
|
20
|
+
*
|
|
21
|
+
* ```ts
|
|
22
|
+
* const { result } = await updateTranslationsWorkflow(container)
|
|
23
|
+
* .run({
|
|
24
|
+
* input: {
|
|
25
|
+
* translations: [
|
|
26
|
+
* { id: "trans_123", translations: { title: "Nouveau titre" } }
|
|
27
|
+
* ]
|
|
28
|
+
* }
|
|
29
|
+
* })
|
|
30
|
+
* ```
|
|
31
|
+
*
|
|
32
|
+
* To update translations matching filters:
|
|
33
|
+
*
|
|
34
|
+
* ```ts
|
|
12
35
|
* const { result } = await updateTranslationsWorkflow(container)
|
|
13
36
|
* .run({
|
|
14
37
|
* input: {
|
|
15
|
-
* selector: {
|
|
16
|
-
*
|
|
17
|
-
* locale: "fr-FR"
|
|
18
|
-
* },
|
|
19
|
-
* update: {
|
|
20
|
-
* translations: { title: "Nouveau titre" }
|
|
21
|
-
* }
|
|
38
|
+
* selector: { reference_id: "prod_123", locale: "fr-FR" },
|
|
39
|
+
* update: { translations: { title: "Nouveau titre" } }
|
|
22
40
|
* }
|
|
23
41
|
* })
|
|
42
|
+
* ```
|
|
24
43
|
*
|
|
25
44
|
* @summary
|
|
26
45
|
*
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"update-translations.d.ts","sourceRoot":"","sources":["../../../src/translation/workflows/update-translations.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,cAAc,EAAE,MAAM,2BAA2B,CAAA;AAQ1D,OAAO,EAA0B,2BAA2B,EAAE,MAAM,UAAU,CAAA;AAI9E,MAAM,MAAM,+BAA+B,GAAG,2BAA2B,CAAA;AAEzE,eAAO,MAAM,4BAA4B,wBAAwB,CAAA;AACjE
|
|
1
|
+
{"version":3,"file":"update-translations.d.ts","sourceRoot":"","sources":["../../../src/translation/workflows/update-translations.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,cAAc,EAAE,MAAM,2BAA2B,CAAA;AAQ1D,OAAO,EAA0B,2BAA2B,EAAE,MAAM,UAAU,CAAA;AAI9E;;GAEG;AACH,MAAM,MAAM,+BAA+B,GAAG,2BAA2B,CAAA;AAEzE,eAAO,MAAM,4BAA4B,wBAAwB,CAAA;AACjE;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAuCG;AACH,eAAO,MAAM,0BAA0B,+GA4BtC,CAAA"}
|
|
@@ -8,24 +8,40 @@ const steps_2 = require("../steps");
|
|
|
8
8
|
const utils_1 = require("@medusajs/framework/utils");
|
|
9
9
|
exports.updateTranslationsWorkflowId = "update-translations";
|
|
10
10
|
/**
|
|
11
|
-
* This workflow updates translations matching the specified filters.
|
|
11
|
+
* This workflow updates translations matching the specified filters or IDs. It's used by other
|
|
12
|
+
* workflows like the {@link batchTranslationsWorkflow} workflow.
|
|
12
13
|
*
|
|
13
14
|
* You can use this workflow within your own customizations or custom workflows, allowing you
|
|
14
15
|
* to update translations in your custom flows.
|
|
15
16
|
*
|
|
17
|
+
* @since 2.12.3
|
|
18
|
+
* @featureFlag translation
|
|
19
|
+
*
|
|
16
20
|
* @example
|
|
21
|
+
* To update translations by their IDs:
|
|
22
|
+
*
|
|
23
|
+
* ```ts
|
|
24
|
+
* const { result } = await updateTranslationsWorkflow(container)
|
|
25
|
+
* .run({
|
|
26
|
+
* input: {
|
|
27
|
+
* translations: [
|
|
28
|
+
* { id: "trans_123", translations: { title: "Nouveau titre" } }
|
|
29
|
+
* ]
|
|
30
|
+
* }
|
|
31
|
+
* })
|
|
32
|
+
* ```
|
|
33
|
+
*
|
|
34
|
+
* To update translations matching filters:
|
|
35
|
+
*
|
|
36
|
+
* ```ts
|
|
17
37
|
* const { result } = await updateTranslationsWorkflow(container)
|
|
18
38
|
* .run({
|
|
19
39
|
* input: {
|
|
20
|
-
* selector: {
|
|
21
|
-
*
|
|
22
|
-
* locale: "fr-FR"
|
|
23
|
-
* },
|
|
24
|
-
* update: {
|
|
25
|
-
* translations: { title: "Nouveau titre" }
|
|
26
|
-
* }
|
|
40
|
+
* selector: { reference_id: "prod_123", locale: "fr-FR" },
|
|
41
|
+
* update: { translations: { title: "Nouveau titre" } }
|
|
27
42
|
* }
|
|
28
43
|
* })
|
|
44
|
+
* ```
|
|
29
45
|
*
|
|
30
46
|
* @summary
|
|
31
47
|
*
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"update-translations.js","sourceRoot":"","sources":["../../../src/translation/workflows/update-translations.ts"],"names":[],"mappings":";;;AACA,qEAK0C;AAC1C,8DAA6D;AAC7D,oCAA8E;AAC9E,oCAAmD;AACnD,qDAAqE;
|
|
1
|
+
{"version":3,"file":"update-translations.js","sourceRoot":"","sources":["../../../src/translation/workflows/update-translations.ts"],"names":[],"mappings":";;;AACA,qEAK0C;AAC1C,8DAA6D;AAC7D,oCAA8E;AAC9E,oCAAmD;AACnD,qDAAqE;AAOxD,QAAA,4BAA4B,GAAG,qBAAqB,CAAA;AACjE;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAuCG;AACU,QAAA,0BAA0B,GAAG,IAAA,8BAAc,EACtD,oCAA4B,EAC5B,CACE,KAAoD,EAChB,EAAE;IACtC,MAAM,aAAa,GAAG,IAAA,yBAAS,EAAC,KAAK,EAAE,CAAC,KAAK,EAAE,EAAE;QAC/C,OAAO,cAAc,IAAI,KAAK,CAAC,CAAC,CAAC,KAAK,CAAC,YAAY,CAAC,CAAC,CAAC,CAAC,KAAK,CAAC,MAAM,CAAC,CAAA;IACtE,CAAC,CAAC,CAAA;IACF,IAAA,gCAAwB,EAAC,aAAa,CAAC,CAAA;IAEvC,MAAM,YAAY,GAAG,IAAA,8BAAsB,EAAC,KAAK,CAAC,CAAA;IAElD,MAAM,mBAAmB,GAAG,IAAA,yBAAS,EACnC,EAAE,YAAY,EAAE,EAChB,CAAC,EAAE,YAAY,EAAE,EAAE,EAAE;QACnB,OAAO,YAAY,EAAE,GAAG,CAAC,CAAC,CAAC,EAAE,EAAE;YAC7B,OAAO,EAAE,EAAE,EAAE,CAAC,CAAC,EAAE,EAAE,CAAA;QACrB,CAAC,CAAC,CAAA;IACJ,CAAC,CACF,CAAA;IAED,IAAA,0BAAa,EAAC;QACZ,SAAS,EAAE,iCAAyB,CAAC,OAAO;QAC5C,IAAI,EAAE,mBAAmB;KAC1B,CAAC,CAAA;IAEF,OAAO,IAAI,gCAAgB,CAAC,YAAY,CAAC,CAAA;AAC3C,CAAC,CACF,CAAA"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@medusajs/core-flows",
|
|
3
|
-
"version": "3.0.0-snapshot-
|
|
3
|
+
"version": "3.0.0-snapshot-20251216135612",
|
|
4
4
|
"description": "Set of workflow definitions for Medusa",
|
|
5
5
|
"main": "dist/index.js",
|
|
6
6
|
"exports": {
|
|
@@ -26,7 +26,7 @@
|
|
|
26
26
|
"author": "Medusa",
|
|
27
27
|
"license": "MIT",
|
|
28
28
|
"devDependencies": {
|
|
29
|
-
"@medusajs/framework": "3.0.0-snapshot-
|
|
29
|
+
"@medusajs/framework": "3.0.0-snapshot-20251216135612"
|
|
30
30
|
},
|
|
31
31
|
"dependencies": {
|
|
32
32
|
"csv-parse": "^5.6.0",
|
|
@@ -34,7 +34,7 @@
|
|
|
34
34
|
"zod": "3.25.76"
|
|
35
35
|
},
|
|
36
36
|
"peerDependencies": {
|
|
37
|
-
"@medusajs/framework": "3.0.0-snapshot-
|
|
37
|
+
"@medusajs/framework": "3.0.0-snapshot-20251216135612"
|
|
38
38
|
},
|
|
39
39
|
"scripts": {
|
|
40
40
|
"build": "yarn run -T rimraf dist && yarn run -T tsc --build",
|