@medusajs/translation 3.0.0-snapshot-20251215162333 → 3.0.0-snapshot-20251216122339

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.
@@ -1,8 +1,4 @@
1
1
  import { LoaderOptions } from "@medusajs/framework/types";
2
- declare const _default: ({ container, options, }: LoaderOptions<{
3
- expandedTranslatableFields: {
4
- [key: string]: string[];
5
- };
6
- }>) => Promise<void>;
2
+ declare const _default: ({ container }: LoaderOptions) => Promise<void>;
7
3
  export default _default;
8
4
  //# sourceMappingURL=config.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"config.d.ts","sourceRoot":"","sources":["../../src/loaders/config.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,aAAa,EAAE,MAAM,2BAA2B,CAAA;yBAUnC,yBAGnB,aAAa,CAAC;IACf,0BAA0B,EAAE;QAAE,CAAC,GAAG,EAAE,MAAM,GAAG,MAAM,EAAE,CAAA;KAAE,CAAA;CACxD,CAAC,KAAG,OAAO,CAAC,IAAI,CAAC;AALlB,wBA6DC"}
1
+ {"version":3,"file":"config.d.ts","sourceRoot":"","sources":["../../src/loaders/config.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,aAAa,EAAE,MAAM,2BAA2B,CAAA;yBAKnC,eAAe,aAAa,KAAG,OAAO,CAAC,IAAI,CAAC;AAAlE,wBAKC"}
@@ -1,51 +1,9 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
- const translatable_fields_1 = require("../utils/translatable-fields");
4
- const awilix_1 = require("awilix");
5
3
  const constants_1 = require("../utils/constants");
6
- exports.default = async ({ container, options, }) => {
7
- const { expandedTranslatableFields } = options ?? {};
8
- const { product, productVariant, productType, productCollection, ...others } = expandedTranslatableFields ?? {};
9
- const translatableFieldsConfig = {
10
- product: translatable_fields_1.PRODUCT_TRANSLATABLE_FIELDS,
11
- product_variant: translatable_fields_1.PRODUCT_VARIANT_TRANSLATABLE_FIELDS,
12
- product_type: translatable_fields_1.PRODUCT_TYPE_TRANSLATABLE_FIELDS,
13
- product_collection: translatable_fields_1.PRODUCT_COLLECTION_TRANSLATABLE_FIELDS,
14
- };
15
- if (product) {
16
- const translatableFields = new Set([
17
- ...translatable_fields_1.PRODUCT_TRANSLATABLE_FIELDS,
18
- ...product,
19
- ]);
20
- translatableFieldsConfig.product = Array.from(translatableFields);
21
- }
22
- if (productVariant) {
23
- const translatableFields = new Set([
24
- ...translatable_fields_1.PRODUCT_VARIANT_TRANSLATABLE_FIELDS,
25
- ...productVariant,
26
- ]);
27
- translatableFieldsConfig.product_variant = Array.from(translatableFields);
28
- }
29
- if (productType) {
30
- const translatableFields = new Set([
31
- ...translatable_fields_1.PRODUCT_TYPE_TRANSLATABLE_FIELDS,
32
- ...productType,
33
- ]);
34
- translatableFieldsConfig.product_type = Array.from(translatableFields);
35
- }
36
- if (productCollection) {
37
- const translatableFields = new Set([
38
- ...translatable_fields_1.PRODUCT_COLLECTION_TRANSLATABLE_FIELDS,
39
- ...productCollection,
40
- ]);
41
- translatableFieldsConfig.product_collection = Array.from(translatableFields);
42
- }
43
- if (others) {
44
- Object.entries(others).forEach(([key, value]) => {
45
- const translatableFields = new Set([...value]);
46
- translatableFieldsConfig[key] = Array.from(translatableFields);
47
- });
48
- }
49
- container.register(constants_1.TRANSLATABLE_FIELDS_CONFIG_KEY, (0, awilix_1.asValue)(translatableFieldsConfig));
4
+ const awilix_1 = require("awilix");
5
+ const translatable_fields_1 = require("../utils/translatable-fields");
6
+ exports.default = async ({ container }) => {
7
+ container.register(constants_1.TRANSLATABLE_FIELDS_CONFIG_KEY, (0, awilix_1.asValue)(translatable_fields_1.translatableFieldsConfig));
50
8
  };
51
9
  //# sourceMappingURL=config.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"config.js","sourceRoot":"","sources":["../../src/loaders/config.ts"],"names":[],"mappings":";;AACA,sEAKqC;AACrC,mCAAgC;AAChC,gDAAiE;AAEjE,kBAAe,KAAK,EAAE,EACpB,SAAS,EACT,OAAO,GAGP,EAAiB,EAAE;IACnB,MAAM,EAAE,0BAA0B,EAAE,GAAG,OAAO,IAAI,EAAE,CAAA;IAEpD,MAAM,EAAE,OAAO,EAAE,cAAc,EAAE,WAAW,EAAE,iBAAiB,EAAE,GAAG,MAAM,EAAE,GAC1E,0BAA0B,IAAI,EAAE,CAAA;IAElC,MAAM,wBAAwB,GAA6B;QACzD,OAAO,EAAE,iDAA2B;QACpC,eAAe,EAAE,yDAAmC;QACpD,YAAY,EAAE,sDAAgC;QAC9C,kBAAkB,EAAE,4DAAsC;KAC3D,CAAA;IAED,IAAI,OAAO,EAAE,CAAC;QACZ,MAAM,kBAAkB,GAAG,IAAI,GAAG,CAAC;YACjC,GAAG,iDAA2B;YAC9B,GAAG,OAAO;SACX,CAAC,CAAA;QACF,wBAAwB,CAAC,OAAO,GAAG,KAAK,CAAC,IAAI,CAAC,kBAAkB,CAAC,CAAA;IACnE,CAAC;IAED,IAAI,cAAc,EAAE,CAAC;QACnB,MAAM,kBAAkB,GAAG,IAAI,GAAG,CAAC;YACjC,GAAG,yDAAmC;YACtC,GAAG,cAAc;SAClB,CAAC,CAAA;QACF,wBAAwB,CAAC,eAAe,GAAG,KAAK,CAAC,IAAI,CAAC,kBAAkB,CAAC,CAAA;IAC3E,CAAC;IAED,IAAI,WAAW,EAAE,CAAC;QAChB,MAAM,kBAAkB,GAAG,IAAI,GAAG,CAAC;YACjC,GAAG,sDAAgC;YACnC,GAAG,WAAW;SACf,CAAC,CAAA;QACF,wBAAwB,CAAC,YAAY,GAAG,KAAK,CAAC,IAAI,CAAC,kBAAkB,CAAC,CAAA;IACxE,CAAC;IAED,IAAI,iBAAiB,EAAE,CAAC;QACtB,MAAM,kBAAkB,GAAG,IAAI,GAAG,CAAC;YACjC,GAAG,4DAAsC;YACzC,GAAG,iBAAiB;SACrB,CAAC,CAAA;QACF,wBAAwB,CAAC,kBAAkB,GAAG,KAAK,CAAC,IAAI,CAAC,kBAAkB,CAAC,CAAA;IAC9E,CAAC;IAED,IAAI,MAAM,EAAE,CAAC;QACX,MAAM,CAAC,OAAO,CAAC,MAAM,CAAC,CAAC,OAAO,CAAC,CAAC,CAAC,GAAG,EAAE,KAAK,CAAC,EAAE,EAAE;YAC9C,MAAM,kBAAkB,GAAG,IAAI,GAAG,CAAC,CAAC,GAAG,KAAK,CAAC,CAAC,CAAA;YAC9C,wBAAwB,CAAC,GAAG,CAAC,GAAG,KAAK,CAAC,IAAI,CAAC,kBAAkB,CAAC,CAAA;QAChE,CAAC,CAAC,CAAA;IACJ,CAAC;IAED,SAAS,CAAC,QAAQ,CAChB,0CAA8B,EAC9B,IAAA,gBAAO,EAAC,wBAAwB,CAAC,CAClC,CAAA;AACH,CAAC,CAAA"}
1
+ {"version":3,"file":"config.js","sourceRoot":"","sources":["../../src/loaders/config.ts"],"names":[],"mappings":";;AACA,gDAAiE;AACjE,mCAAgC;AAChC,sEAAuE;AAEvE,kBAAe,KAAK,EAAE,EAAE,SAAS,EAAiB,EAAiB,EAAE;IACnE,SAAS,CAAC,QAAQ,CAChB,0CAA8B,EAC9B,IAAA,gBAAO,EAAC,8CAAwB,CAAC,CAClC,CAAA;AACH,CAAC,CAAA"}
@@ -1,4 +1,4 @@
1
- import { Migration } from '@mikro-orm/migrations';
1
+ import { Migration } from "@medusajs/framework/mikro-orm/migrations";
2
2
  export declare class Migration20251215083927 extends Migration {
3
3
  up(): Promise<void>;
4
4
  down(): Promise<void>;
@@ -1 +1 @@
1
- {"version":3,"file":"Migration20251215083927.d.ts","sourceRoot":"","sources":["../../src/migrations/Migration20251215083927.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,MAAM,uBAAuB,CAAC;AAElD,qBAAa,uBAAwB,SAAQ,SAAS;IAErC,EAAE,IAAI,OAAO,CAAC,IAAI,CAAC;IAInB,IAAI,IAAI,OAAO,CAAC,IAAI,CAAC;CAIrC"}
1
+ {"version":3,"file":"Migration20251215083927.d.ts","sourceRoot":"","sources":["../../src/migrations/Migration20251215083927.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,MAAM,0CAA0C,CAAA;AAEpE,qBAAa,uBAAwB,SAAQ,SAAS;IACrC,EAAE,IAAI,OAAO,CAAC,IAAI,CAAC;IAMnB,IAAI,IAAI,OAAO,CAAC,IAAI,CAAC;CAKrC"}
@@ -1,7 +1,7 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.Migration20251215083927 = void 0;
4
- const migrations_1 = require("@mikro-orm/migrations");
4
+ const migrations_1 = require("@medusajs/framework/mikro-orm/migrations");
5
5
  class Migration20251215083927 extends migrations_1.Migration {
6
6
  async up() {
7
7
  this.addSql(`alter table if exists "translation" add column if not exists "translated_field_count" integer not null default 0;`);
@@ -1 +1 @@
1
- {"version":3,"file":"Migration20251215083927.js","sourceRoot":"","sources":["../../src/migrations/Migration20251215083927.ts"],"names":[],"mappings":";;;AAAA,sDAAkD;AAElD,MAAa,uBAAwB,SAAQ,sBAAS;IAE3C,KAAK,CAAC,EAAE;QACf,IAAI,CAAC,MAAM,CAAC,mHAAmH,CAAC,CAAC;IACnI,CAAC;IAEQ,KAAK,CAAC,IAAI;QACjB,IAAI,CAAC,MAAM,CAAC,qFAAqF,CAAC,CAAC;IACrG,CAAC;CAEF;AAVD,0DAUC"}
1
+ {"version":3,"file":"Migration20251215083927.js","sourceRoot":"","sources":["../../src/migrations/Migration20251215083927.ts"],"names":[],"mappings":";;;AAAA,yEAAoE;AAEpE,MAAa,uBAAwB,SAAQ,sBAAS;IAC3C,KAAK,CAAC,EAAE;QACf,IAAI,CAAC,MAAM,CACT,mHAAmH,CACpH,CAAA;IACH,CAAC;IAEQ,KAAK,CAAC,IAAI;QACjB,IAAI,CAAC,MAAM,CACT,qFAAqF,CACtF,CAAA;IACH,CAAC;CACF;AAZD,0DAYC"}
@@ -1,6 +1,12 @@
1
1
  declare const Locale: import("@medusajs/framework/utils").DmlEntity<import("@medusajs/framework/utils").DMLEntitySchemaBuilder<{
2
2
  id: import("@medusajs/framework/utils").PrimaryKeyModifier<string, import("@medusajs/framework/utils").IdProperty>;
3
+ /**
4
+ * The BCP 47 language tag code of the locale (e.g., "en-US", "da-DK").
5
+ */
3
6
  code: import("@medusajs/framework/utils").TextProperty;
7
+ /**
8
+ * The human-readable name of the locale (e.g., "English (US)", "Danish").
9
+ */
4
10
  name: import("@medusajs/framework/utils").TextProperty;
5
11
  }>, "locale">;
6
12
  export default Locale;
@@ -1 +1 @@
1
- {"version":3,"file":"locale.d.ts","sourceRoot":"","sources":["../../src/models/locale.ts"],"names":[],"mappings":"AAEA,QAAA,MAAM,MAAM;;;;aAWR,CAAA;AAEJ,eAAe,MAAM,CAAA"}
1
+ {"version":3,"file":"locale.d.ts","sourceRoot":"","sources":["../../src/models/locale.ts"],"names":[],"mappings":"AAEA,QAAA,MAAM,MAAM;;IAGR;;OAEG;;IAEH;;OAEG;;aAQH,CAAA;AAEJ,eAAe,MAAM,CAAA"}
@@ -4,8 +4,14 @@ const utils_1 = require("@medusajs/framework/utils");
4
4
  const Locale = utils_1.model
5
5
  .define("locale", {
6
6
  id: utils_1.model.id({ prefix: "loc" }).primaryKey(),
7
- code: utils_1.model.text().searchable(), // BCP 47 language tag, e.g., "en-US", "da-DK"
8
- name: utils_1.model.text().searchable(), // Human-readable name, e.g., "English (US)", "Danish"
7
+ /**
8
+ * The BCP 47 language tag code of the locale (e.g., "en-US", "da-DK").
9
+ */
10
+ code: utils_1.model.text().searchable(),
11
+ /**
12
+ * The human-readable name of the locale (e.g., "English (US)", "Danish").
13
+ */
14
+ name: utils_1.model.text().searchable(),
9
15
  })
10
16
  .indexes([
11
17
  {
@@ -1 +1 @@
1
- {"version":3,"file":"locale.js","sourceRoot":"","sources":["../../src/models/locale.ts"],"names":[],"mappings":";;AAAA,qDAAiD;AAEjD,MAAM,MAAM,GAAG,aAAK;KACjB,MAAM,CAAC,QAAQ,EAAE;IAChB,EAAE,EAAE,aAAK,CAAC,EAAE,CAAC,EAAE,MAAM,EAAE,KAAK,EAAE,CAAC,CAAC,UAAU,EAAE;IAC5C,IAAI,EAAE,aAAK,CAAC,IAAI,EAAE,CAAC,UAAU,EAAE,EAAE,8CAA8C;IAC/E,IAAI,EAAE,aAAK,CAAC,IAAI,EAAE,CAAC,UAAU,EAAE,EAAE,sDAAsD;CACxF,CAAC;KACD,OAAO,CAAC;IACP;QACE,EAAE,EAAE,CAAC,MAAM,CAAC;QACZ,MAAM,EAAE,IAAI;KACb;CACF,CAAC,CAAA;AAEJ,kBAAe,MAAM,CAAA"}
1
+ {"version":3,"file":"locale.js","sourceRoot":"","sources":["../../src/models/locale.ts"],"names":[],"mappings":";;AAAA,qDAAiD;AAEjD,MAAM,MAAM,GAAG,aAAK;KACjB,MAAM,CAAC,QAAQ,EAAE;IAChB,EAAE,EAAE,aAAK,CAAC,EAAE,CAAC,EAAE,MAAM,EAAE,KAAK,EAAE,CAAC,CAAC,UAAU,EAAE;IAC5C;;OAEG;IACH,IAAI,EAAE,aAAK,CAAC,IAAI,EAAE,CAAC,UAAU,EAAE;IAC/B;;OAEG;IACH,IAAI,EAAE,aAAK,CAAC,IAAI,EAAE,CAAC,UAAU,EAAE;CAChC,CAAC;KACD,OAAO,CAAC;IACP;QACE,EAAE,EAAE,CAAC,MAAM,CAAC;QACZ,MAAM,EAAE,IAAI;KACb;CACF,CAAC,CAAA;AAEJ,kBAAe,MAAM,CAAA"}
@@ -1,9 +1,35 @@
1
1
  declare const Translation: import("@medusajs/framework/utils").DmlEntity<import("@medusajs/framework/utils").DMLEntitySchemaBuilder<{
2
2
  id: import("@medusajs/framework/utils").PrimaryKeyModifier<string, import("@medusajs/framework/utils").IdProperty>;
3
+ /**
4
+ * The ID of the entity that the translation belongs to. For example, the ID of a product or a product variant.
5
+ */
3
6
  reference_id: import("@medusajs/framework/utils").TextProperty;
7
+ /**
8
+ * The name of the table that the translation belongs to. For example, "product" or "product_variant".
9
+ */
4
10
  reference: import("@medusajs/framework/utils").TextProperty;
11
+ /**
12
+ * The BCP 47 language tag code of the locale
13
+ *
14
+ * @example
15
+ * "en-US"
16
+ */
5
17
  locale_code: import("@medusajs/framework/utils").TextProperty;
18
+ /**
19
+ * The translations of the entity.
20
+ * The object's keys are the field names of the entity, and its value is the translated value.
21
+ *
22
+ * @example
23
+ * {
24
+ * "title": "Product Title",
25
+ * "description": "Product Description",
26
+ * }
27
+ */
6
28
  translations: import("@medusajs/framework/utils").JSONProperty;
29
+ /**
30
+ * Precomputed count of translated fields of a resource.
31
+ * Useful for optimization purposes.
32
+ */
7
33
  translated_field_count: import("@medusajs/framework/utils").NumberProperty;
8
34
  }>, "translation">;
9
35
  export default Translation;
@@ -1 +1 @@
1
- {"version":3,"file":"translation.d.ts","sourceRoot":"","sources":["../../src/models/translation.ts"],"names":[],"mappings":"AAEA,QAAA,MAAM,WAAW;;;;;;;kBA0Bb,CAAA;AAEJ,eAAe,WAAW,CAAA"}
1
+ {"version":3,"file":"translation.d.ts","sourceRoot":"","sources":["../../src/models/translation.ts"],"names":[],"mappings":"AAEA,QAAA,MAAM,WAAW;;IAGb;;OAEG;;IAEH;;OAEG;;IAEH;;;;;OAKG;;IAEH;;;;;;;;;OASG;;IAEH;;;OAGG;;kBAoBH,CAAA;AAEJ,eAAe,WAAW,CAAA"}
@@ -4,11 +4,37 @@ const utils_1 = require("@medusajs/framework/utils");
4
4
  const Translation = utils_1.model
5
5
  .define("translation", {
6
6
  id: utils_1.model.id({ prefix: "trans" }).primaryKey(),
7
+ /**
8
+ * The ID of the entity that the translation belongs to. For example, the ID of a product or a product variant.
9
+ */
7
10
  reference_id: utils_1.model.text().searchable(),
8
- reference: utils_1.model.text().searchable(), // e.g., "product", "product_variant", "product_category"
9
- locale_code: utils_1.model.text().searchable(), // BCP 47 language tag, e.g., "en-US", "da-DK"
11
+ /**
12
+ * The name of the table that the translation belongs to. For example, "product" or "product_variant".
13
+ */
14
+ reference: utils_1.model.text().searchable(),
15
+ /**
16
+ * The BCP 47 language tag code of the locale
17
+ *
18
+ * @example
19
+ * "en-US"
20
+ */
21
+ locale_code: utils_1.model.text().searchable(),
22
+ /**
23
+ * The translations of the entity.
24
+ * The object's keys are the field names of the entity, and its value is the translated value.
25
+ *
26
+ * @example
27
+ * {
28
+ * "title": "Product Title",
29
+ * "description": "Product Description",
30
+ * }
31
+ */
10
32
  translations: utils_1.model.json(),
11
- translated_field_count: utils_1.model.number().default(0), // Precomputed count of translated fields for performance
33
+ /**
34
+ * Precomputed count of translated fields of a resource.
35
+ * Useful for optimization purposes.
36
+ */
37
+ translated_field_count: utils_1.model.number().default(0),
12
38
  })
13
39
  .indexes([
14
40
  {
@@ -1 +1 @@
1
- {"version":3,"file":"translation.js","sourceRoot":"","sources":["../../src/models/translation.ts"],"names":[],"mappings":";;AAAA,qDAAiD;AAEjD,MAAM,WAAW,GAAG,aAAK;KACtB,MAAM,CAAC,aAAa,EAAE;IACrB,EAAE,EAAE,aAAK,CAAC,EAAE,CAAC,EAAE,MAAM,EAAE,OAAO,EAAE,CAAC,CAAC,UAAU,EAAE;IAC9C,YAAY,EAAE,aAAK,CAAC,IAAI,EAAE,CAAC,UAAU,EAAE;IACvC,SAAS,EAAE,aAAK,CAAC,IAAI,EAAE,CAAC,UAAU,EAAE,EAAE,yDAAyD;IAC/F,WAAW,EAAE,aAAK,CAAC,IAAI,EAAE,CAAC,UAAU,EAAE,EAAE,8CAA8C;IACtF,YAAY,EAAE,aAAK,CAAC,IAAI,EAAE;IAC1B,sBAAsB,EAAE,aAAK,CAAC,MAAM,EAAE,CAAC,OAAO,CAAC,CAAC,CAAC,EAAE,yDAAyD;CAC7G,CAAC;KACD,OAAO,CAAC;IACP;QACE,EAAE,EAAE,CAAC,cAAc,EAAE,aAAa,CAAC;QACnC,MAAM,EAAE,IAAI;KACb;IACD;QACE,EAAE,EAAE,CAAC,cAAc,EAAE,WAAW,EAAE,aAAa,CAAC;KACjD;IACD;QACE,EAAE,EAAE,CAAC,WAAW,EAAE,aAAa,CAAC;KACjC;IACD;QACE,EAAE,EAAE,CAAC,cAAc,EAAE,WAAW,CAAC;KAClC;IACD;QACE,EAAE,EAAE,CAAC,aAAa,CAAC;KACpB;CACF,CAAC,CAAA;AAEJ,kBAAe,WAAW,CAAA"}
1
+ {"version":3,"file":"translation.js","sourceRoot":"","sources":["../../src/models/translation.ts"],"names":[],"mappings":";;AAAA,qDAAiD;AAEjD,MAAM,WAAW,GAAG,aAAK;KACtB,MAAM,CAAC,aAAa,EAAE;IACrB,EAAE,EAAE,aAAK,CAAC,EAAE,CAAC,EAAE,MAAM,EAAE,OAAO,EAAE,CAAC,CAAC,UAAU,EAAE;IAC9C;;OAEG;IACH,YAAY,EAAE,aAAK,CAAC,IAAI,EAAE,CAAC,UAAU,EAAE;IACvC;;OAEG;IACH,SAAS,EAAE,aAAK,CAAC,IAAI,EAAE,CAAC,UAAU,EAAE;IACpC;;;;;OAKG;IACH,WAAW,EAAE,aAAK,CAAC,IAAI,EAAE,CAAC,UAAU,EAAE;IACtC;;;;;;;;;OASG;IACH,YAAY,EAAE,aAAK,CAAC,IAAI,EAAE;IAC1B;;;OAGG;IACH,sBAAsB,EAAE,aAAK,CAAC,MAAM,EAAE,CAAC,OAAO,CAAC,CAAC,CAAC;CAClD,CAAC;KACD,OAAO,CAAC;IACP;QACE,EAAE,EAAE,CAAC,cAAc,EAAE,aAAa,CAAC;QACnC,MAAM,EAAE,IAAI;KACb;IACD;QACE,EAAE,EAAE,CAAC,cAAc,EAAE,WAAW,EAAE,aAAa,CAAC;KACjD;IACD;QACE,EAAE,EAAE,CAAC,WAAW,EAAE,aAAa,CAAC;KACjC;IACD;QACE,EAAE,EAAE,CAAC,cAAc,EAAE,WAAW,CAAC;KAClC;IACD;QACE,EAAE,EAAE,CAAC,aAAa,CAAC;KACpB;CACF,CAAC,CAAA;AAEJ,kBAAe,WAAW,CAAA"}
@@ -2,4 +2,18 @@ export declare const PRODUCT_TRANSLATABLE_FIELDS: string[];
2
2
  export declare const PRODUCT_VARIANT_TRANSLATABLE_FIELDS: string[];
3
3
  export declare const PRODUCT_TYPE_TRANSLATABLE_FIELDS: string[];
4
4
  export declare const PRODUCT_COLLECTION_TRANSLATABLE_FIELDS: string[];
5
+ export declare const PRODUCT_CATEGORY_TRANSLATABLE_FIELDS: string[];
6
+ export declare const PRODUCT_TAG_TRANSLATABLE_FIELDS: string[];
7
+ export declare const PRODUCT_OPTION_TRANSLATABLE_FIELDS: string[];
8
+ export declare const PRODUCT_OPTION_VALUE_TRANSLATABLE_FIELDS: string[];
9
+ export declare const translatableFieldsConfig: {
10
+ product: string[];
11
+ product_variant: string[];
12
+ product_type: string[];
13
+ product_collection: string[];
14
+ product_category: string[];
15
+ product_tag: string[];
16
+ product_option: string[];
17
+ product_option_value: string[];
18
+ };
5
19
  //# sourceMappingURL=translatable-fields.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"translatable-fields.d.ts","sourceRoot":"","sources":["../../src/utils/translatable-fields.ts"],"names":[],"mappings":"AAAA,eAAO,MAAM,2BAA2B,UAMvC,CAAA;AAED,eAAO,MAAM,mCAAmC,UAAwB,CAAA;AAExE,eAAO,MAAM,gCAAgC,UAAY,CAAA;AAEzD,eAAO,MAAM,sCAAsC,UAAY,CAAA"}
1
+ {"version":3,"file":"translatable-fields.d.ts","sourceRoot":"","sources":["../../src/utils/translatable-fields.ts"],"names":[],"mappings":"AAAA,eAAO,MAAM,2BAA2B,UAMvC,CAAA;AACD,eAAO,MAAM,mCAAmC,UAAwB,CAAA;AACxE,eAAO,MAAM,gCAAgC,UAAY,CAAA;AACzD,eAAO,MAAM,sCAAsC,UAAY,CAAA;AAC/D,eAAO,MAAM,oCAAoC,UAA0B,CAAA;AAC3E,eAAO,MAAM,+BAA+B,UAAY,CAAA;AACxD,eAAO,MAAM,kCAAkC,UAAY,CAAA;AAC3D,eAAO,MAAM,wCAAwC,UAAY,CAAA;AAWjE,eAAO,MAAM,wBAAwB;;;;;;;;;CAcpC,CAAA"}
@@ -1,6 +1,6 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.PRODUCT_COLLECTION_TRANSLATABLE_FIELDS = exports.PRODUCT_TYPE_TRANSLATABLE_FIELDS = exports.PRODUCT_VARIANT_TRANSLATABLE_FIELDS = exports.PRODUCT_TRANSLATABLE_FIELDS = void 0;
3
+ exports.translatableFieldsConfig = exports.PRODUCT_OPTION_VALUE_TRANSLATABLE_FIELDS = exports.PRODUCT_OPTION_TRANSLATABLE_FIELDS = exports.PRODUCT_TAG_TRANSLATABLE_FIELDS = exports.PRODUCT_CATEGORY_TRANSLATABLE_FIELDS = exports.PRODUCT_COLLECTION_TRANSLATABLE_FIELDS = exports.PRODUCT_TYPE_TRANSLATABLE_FIELDS = exports.PRODUCT_VARIANT_TRANSLATABLE_FIELDS = exports.PRODUCT_TRANSLATABLE_FIELDS = void 0;
4
4
  exports.PRODUCT_TRANSLATABLE_FIELDS = [
5
5
  "title",
6
6
  "description",
@@ -11,4 +11,28 @@ exports.PRODUCT_TRANSLATABLE_FIELDS = [
11
11
  exports.PRODUCT_VARIANT_TRANSLATABLE_FIELDS = ["title", "material"];
12
12
  exports.PRODUCT_TYPE_TRANSLATABLE_FIELDS = ["value"];
13
13
  exports.PRODUCT_COLLECTION_TRANSLATABLE_FIELDS = ["title"];
14
+ exports.PRODUCT_CATEGORY_TRANSLATABLE_FIELDS = ["name", "description"];
15
+ exports.PRODUCT_TAG_TRANSLATABLE_FIELDS = ["value"];
16
+ exports.PRODUCT_OPTION_TRANSLATABLE_FIELDS = ["title"];
17
+ exports.PRODUCT_OPTION_VALUE_TRANSLATABLE_FIELDS = ["value"];
18
+ // export const SHIPPING_OPTION_TRANSLATABLE_FIELDS = ["name"]
19
+ // export const SHIPPING_OPTION_TYPE_TRANSLATABLE_FIELDS = ["label", "description"]
20
+ // export const RETURN_REASON_TRANSLATABLE_FIELDS = [
21
+ // "value",
22
+ // "label",
23
+ // "description",
24
+ // ]
25
+ exports.translatableFieldsConfig = {
26
+ product: exports.PRODUCT_TRANSLATABLE_FIELDS,
27
+ product_variant: exports.PRODUCT_VARIANT_TRANSLATABLE_FIELDS,
28
+ product_type: exports.PRODUCT_TYPE_TRANSLATABLE_FIELDS,
29
+ product_collection: exports.PRODUCT_COLLECTION_TRANSLATABLE_FIELDS,
30
+ product_category: exports.PRODUCT_CATEGORY_TRANSLATABLE_FIELDS,
31
+ product_tag: exports.PRODUCT_TAG_TRANSLATABLE_FIELDS,
32
+ product_option: exports.PRODUCT_OPTION_TRANSLATABLE_FIELDS,
33
+ product_option_value: exports.PRODUCT_OPTION_VALUE_TRANSLATABLE_FIELDS,
34
+ // shipping_option: SHIPPING_OPTION_TRANSLATABLE_FIELDS,
35
+ // shipping_option_type: SHIPPING_OPTION_TYPE_TRANSLATABLE_FIELDS,
36
+ // return_reason: RETURN_REASON_TRANSLATABLE_FIELDS,
37
+ };
14
38
  //# sourceMappingURL=translatable-fields.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"translatable-fields.js","sourceRoot":"","sources":["../../src/utils/translatable-fields.ts"],"names":[],"mappings":";;;AAAa,QAAA,2BAA2B,GAAG;IACzC,OAAO;IACP,aAAa;IACb,UAAU;IACV,UAAU;IACV,QAAQ;CACT,CAAA;AAEY,QAAA,mCAAmC,GAAG,CAAC,OAAO,EAAE,UAAU,CAAC,CAAA;AAE3D,QAAA,gCAAgC,GAAG,CAAC,OAAO,CAAC,CAAA;AAE5C,QAAA,sCAAsC,GAAG,CAAC,OAAO,CAAC,CAAA"}
1
+ {"version":3,"file":"translatable-fields.js","sourceRoot":"","sources":["../../src/utils/translatable-fields.ts"],"names":[],"mappings":";;;AAAa,QAAA,2BAA2B,GAAG;IACzC,OAAO;IACP,aAAa;IACb,UAAU;IACV,UAAU;IACV,QAAQ;CACT,CAAA;AACY,QAAA,mCAAmC,GAAG,CAAC,OAAO,EAAE,UAAU,CAAC,CAAA;AAC3D,QAAA,gCAAgC,GAAG,CAAC,OAAO,CAAC,CAAA;AAC5C,QAAA,sCAAsC,GAAG,CAAC,OAAO,CAAC,CAAA;AAClD,QAAA,oCAAoC,GAAG,CAAC,MAAM,EAAE,aAAa,CAAC,CAAA;AAC9D,QAAA,+BAA+B,GAAG,CAAC,OAAO,CAAC,CAAA;AAC3C,QAAA,kCAAkC,GAAG,CAAC,OAAO,CAAC,CAAA;AAC9C,QAAA,wCAAwC,GAAG,CAAC,OAAO,CAAC,CAAA;AAEjE,8DAA8D;AAC9D,mFAAmF;AAEnF,qDAAqD;AACrD,aAAa;AACb,aAAa;AACb,mBAAmB;AACnB,IAAI;AAES,QAAA,wBAAwB,GAAG;IACtC,OAAO,EAAE,mCAA2B;IACpC,eAAe,EAAE,2CAAmC;IACpD,YAAY,EAAE,wCAAgC;IAC9C,kBAAkB,EAAE,8CAAsC;IAC1D,gBAAgB,EAAE,4CAAoC;IACtD,WAAW,EAAE,uCAA+B;IAC5C,cAAc,EAAE,0CAAkC;IAClD,oBAAoB,EAAE,gDAAwC;IAE9D,wDAAwD;IACxD,kEAAkE;IAElE,oDAAoD;CACrD,CAAA"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@medusajs/translation",
3
- "version": "3.0.0-snapshot-20251215162333",
3
+ "version": "3.0.0-snapshot-20251216122339",
4
4
  "description": "Medusa Translation module",
5
5
  "main": "dist/index.js",
6
6
  "types": "dist/index.d.ts",
@@ -36,10 +36,10 @@
36
36
  "orm:cache:clear": "MIKRO_ORM_CLI_CONFIG=./mikro-orm.config.dev.ts MIKRO_ORM_ALLOW_GLOBAL_CLI=true medusa-mikro-orm cache:clear"
37
37
  },
38
38
  "devDependencies": {
39
- "@medusajs/framework": "3.0.0-snapshot-20251215162333",
40
- "@medusajs/test-utils": "3.0.0-snapshot-20251215162333"
39
+ "@medusajs/framework": "3.0.0-snapshot-20251216122339",
40
+ "@medusajs/test-utils": "3.0.0-snapshot-20251216122339"
41
41
  },
42
42
  "peerDependencies": {
43
- "@medusajs/framework": "3.0.0-snapshot-20251215162333"
43
+ "@medusajs/framework": "3.0.0-snapshot-20251216122339"
44
44
  }
45
45
  }