@acmekit/translation 2.13.1

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.
Files changed (58) hide show
  1. package/dist/index.d.ts +8 -0
  2. package/dist/index.d.ts.map +1 -0
  3. package/dist/index.js +16 -0
  4. package/dist/index.js.map +1 -0
  5. package/dist/loaders/defaults.d.ts +4 -0
  6. package/dist/loaders/defaults.d.ts.map +1 -0
  7. package/dist/loaders/defaults.js +84 -0
  8. package/dist/loaders/defaults.js.map +1 -0
  9. package/dist/migrations/Migration20251208124155.d.ts +6 -0
  10. package/dist/migrations/Migration20251208124155.d.ts.map +1 -0
  11. package/dist/migrations/Migration20251208124155.js +26 -0
  12. package/dist/migrations/Migration20251208124155.js.map +1 -0
  13. package/dist/migrations/Migration20251215083927.d.ts +6 -0
  14. package/dist/migrations/Migration20251215083927.d.ts.map +1 -0
  15. package/dist/migrations/Migration20251215083927.js +14 -0
  16. package/dist/migrations/Migration20251215083927.js.map +1 -0
  17. package/dist/migrations/Migration20251218140235.d.ts +6 -0
  18. package/dist/migrations/Migration20251218140235.d.ts.map +1 -0
  19. package/dist/migrations/Migration20251218140235.js +17 -0
  20. package/dist/migrations/Migration20251218140235.js.map +1 -0
  21. package/dist/migrations/Migration20260108122757.d.ts +6 -0
  22. package/dist/migrations/Migration20260108122757.d.ts.map +1 -0
  23. package/dist/migrations/Migration20260108122757.js +14 -0
  24. package/dist/migrations/Migration20260108122757.js.map +1 -0
  25. package/dist/models/index.d.ts +4 -0
  26. package/dist/models/index.d.ts.map +1 -0
  27. package/dist/models/index.js +13 -0
  28. package/dist/models/index.js.map +1 -0
  29. package/dist/models/locale.d.ts +13 -0
  30. package/dist/models/locale.d.ts.map +1 -0
  31. package/dist/models/locale.js +23 -0
  32. package/dist/models/locale.js.map +1 -0
  33. package/dist/models/settings.d.ts +26 -0
  34. package/dist/models/settings.d.ts.map +1 -0
  35. package/dist/models/settings.js +36 -0
  36. package/dist/models/settings.js.map +1 -0
  37. package/dist/models/translation.d.ts +36 -0
  38. package/dist/models/translation.d.ts.map +1 -0
  39. package/dist/models/translation.js +58 -0
  40. package/dist/models/translation.js.map +1 -0
  41. package/dist/services/translation-module.d.ts +70 -0
  42. package/dist/services/translation-module.d.ts.map +1 -0
  43. package/dist/services/translation-module.js +468 -0
  44. package/dist/services/translation-module.js.map +1 -0
  45. package/dist/tsconfig.tsbuildinfo +1 -0
  46. package/dist/types/index.d.ts +37 -0
  47. package/dist/types/index.d.ts.map +1 -0
  48. package/dist/types/index.js +3 -0
  49. package/dist/types/index.js.map +1 -0
  50. package/dist/utils/compute-translated-field-count.d.ts +12 -0
  51. package/dist/utils/compute-translated-field-count.d.ts.map +1 -0
  52. package/dist/utils/compute-translated-field-count.js +23 -0
  53. package/dist/utils/compute-translated-field-count.js.map +1 -0
  54. package/dist/utils/filter-translation-fields.d.ts +3 -0
  55. package/dist/utils/filter-translation-fields.d.ts.map +1 -0
  56. package/dist/utils/filter-translation-fields.js +22 -0
  57. package/dist/utils/filter-translation-fields.js.map +1 -0
  58. package/package.json +45 -0
@@ -0,0 +1,468 @@
1
+ "use strict";
2
+ var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
3
+ var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
4
+ if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
5
+ else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
6
+ return c > 3 && r && Object.defineProperty(target, key, r), r;
7
+ };
8
+ var __metadata = (this && this.__metadata) || function (k, v) {
9
+ if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(k, v);
10
+ };
11
+ var __param = (this && this.__param) || function (paramIndex, decorator) {
12
+ return function (target, key) { decorator(target, key, paramIndex); }
13
+ };
14
+ var __importDefault = (this && this.__importDefault) || function (mod) {
15
+ return (mod && mod.__esModule) ? mod : { "default": mod };
16
+ };
17
+ Object.defineProperty(exports, "__esModule", { value: true });
18
+ const core_1 = require("@acmekit/framework/mikro-orm/core");
19
+ const types_1 = require("@acmekit/framework/types");
20
+ const utils_1 = require("@acmekit/framework/utils");
21
+ const locale_1 = __importDefault(require("../models/locale"));
22
+ const translation_1 = __importDefault(require("../models/translation"));
23
+ const settings_1 = __importDefault(require("../models/settings"));
24
+ const compute_translated_field_count_1 = require("../utils/compute-translated-field-count");
25
+ const filter_translation_fields_1 = require("../utils/filter-translation-fields");
26
+ class TranslationModuleService extends (0, utils_1.AcmeKitService)({
27
+ Locale: locale_1.default,
28
+ Translation: translation_1.default,
29
+ TranslationSettings: settings_1.default,
30
+ }) {
31
+ constructor({ baseRepository, translationService, localeService, translationSettingsService, }) {
32
+ super(...arguments);
33
+ this.__hooks = {
34
+ onApplicationStart: async () => {
35
+ return this.onApplicationStart_();
36
+ },
37
+ };
38
+ this.baseRepository_ = baseRepository;
39
+ this.translationService_ = translationService;
40
+ this.localeService_ = localeService;
41
+ this.settingsService_ = translationSettingsService;
42
+ }
43
+ async onApplicationStart_() {
44
+ const translatableEntities = utils_1.DmlEntity.getTranslatableEntities();
45
+ const translatableEntitiesSet = new Set(translatableEntities.map((entity) => (0, utils_1.toSnakeCase)(entity.entity)));
46
+ const currentTranslationSettings = await this.settingsService_.list();
47
+ const currentTranslationSettingsSet = new Set(currentTranslationSettings.map((setting) => setting.entity_type));
48
+ const settingsToUpsert = [];
49
+ for (const setting of currentTranslationSettings) {
50
+ if (!translatableEntitiesSet.has(setting.entity_type) &&
51
+ setting.is_active) {
52
+ settingsToUpsert.push({
53
+ id: setting.id,
54
+ is_active: false,
55
+ });
56
+ }
57
+ }
58
+ for (const entity of translatableEntities) {
59
+ const snakeCaseEntityType = (0, utils_1.toSnakeCase)(entity.entity);
60
+ const hasCurrentSettings = currentTranslationSettingsSet.has(snakeCaseEntityType);
61
+ if (!hasCurrentSettings) {
62
+ settingsToUpsert.push({
63
+ entity_type: snakeCaseEntityType,
64
+ fields: entity.fields,
65
+ });
66
+ }
67
+ }
68
+ await this.settingsService_.upsert(settingsToUpsert);
69
+ }
70
+ async getTranslatableFields(entityType, sharedContext = {}) {
71
+ const filters = entityType ? { entity_type: entityType } : {};
72
+ const settings = await this.settingsService_.list(filters, {}, sharedContext);
73
+ return settings.reduce((acc, setting) => {
74
+ acc[setting.entity_type] = setting.is_active
75
+ ? setting.fields
76
+ : [];
77
+ return acc;
78
+ }, {});
79
+ }
80
+ async getInactiveTranslatableFields(entityType, sharedContext = {}) {
81
+ const translatableFields = await this.getTranslatableFields(entityType, sharedContext);
82
+ return Object.entries(translatableFields).reduce((acc, [entityType, fields]) => {
83
+ const entity = utils_1.DmlEntity.getTranslatableEntities().find((entity) => (0, utils_1.toSnakeCase)(entity.entity) === entityType);
84
+ if (!entity) {
85
+ return acc;
86
+ }
87
+ acc[entityType] = (0, utils_1.arrayDifference)(entity.fields, fields);
88
+ return acc;
89
+ }, {});
90
+ }
91
+ static prepareFilters(filters) {
92
+ let { q, ...restFilters } = filters;
93
+ if (q) {
94
+ restFilters = {
95
+ ...restFilters,
96
+ [(0, core_1.raw)(`translations::text ILIKE ?`, [`%${q}%`])]: [],
97
+ };
98
+ }
99
+ return restFilters;
100
+ }
101
+ // @ts-expect-error
102
+ async retrieveTranslation(id, config = {}, sharedContext = {}) {
103
+ const configWithReference = TranslationModuleService.ensureReferenceFieldInConfig(config);
104
+ const result = await this.translationService_.retrieve(id, configWithReference, sharedContext);
105
+ const serialized = await this.baseRepository_.serialize(result);
106
+ const translatableFieldsConfig = await this.getTranslatableFields(undefined, sharedContext);
107
+ return (0, filter_translation_fields_1.filterTranslationFields)([serialized], translatableFieldsConfig)[0];
108
+ }
109
+ /**
110
+ * Ensures the 'reference' field is included in the select config.
111
+ * This is needed for filtering translations by translatable fields.
112
+ */
113
+ static ensureReferenceFieldInConfig(config) {
114
+ if (!config?.select?.length) {
115
+ return config;
116
+ }
117
+ const select = config.select;
118
+ if (!select.includes("reference")) {
119
+ return { ...config, select: [...select, "reference"] };
120
+ }
121
+ return config;
122
+ }
123
+ // @ts-expect-error
124
+ async listTranslations(filters = {}, config = {}, sharedContext = {}) {
125
+ const preparedFilters = TranslationModuleService.prepareFilters(filters);
126
+ const configWithReference = TranslationModuleService.ensureReferenceFieldInConfig(config);
127
+ const results = await this.translationService_.list(preparedFilters, configWithReference, sharedContext);
128
+ const serialized = await this.baseRepository_.serialize(results);
129
+ const translatableFieldsConfig = await this.getTranslatableFields(undefined, sharedContext);
130
+ return (0, filter_translation_fields_1.filterTranslationFields)(serialized, translatableFieldsConfig);
131
+ }
132
+ // @ts-expect-error
133
+ async listAndCountTranslations(filters = {}, config = {}, sharedContext = {}) {
134
+ const preparedFilters = TranslationModuleService.prepareFilters(filters);
135
+ const configWithReference = TranslationModuleService.ensureReferenceFieldInConfig(config);
136
+ const [results, count] = await this.translationService_.listAndCount(preparedFilters, configWithReference, sharedContext);
137
+ const serialized = await this.baseRepository_.serialize(results);
138
+ const translatableFieldsConfig = await this.getTranslatableFields(undefined, sharedContext);
139
+ return [
140
+ (0, filter_translation_fields_1.filterTranslationFields)(serialized, translatableFieldsConfig),
141
+ count,
142
+ ];
143
+ }
144
+ // @ts-expect-error
145
+ async createLocales(data, sharedContext = {}) {
146
+ const dataArray = Array.isArray(data) ? data : [data];
147
+ const normalizedData = dataArray.map((locale) => ({
148
+ ...locale,
149
+ code: (0, utils_1.normalizeLocale)(locale.code),
150
+ }));
151
+ const createdLocales = await this.localeService_.create(normalizedData, sharedContext);
152
+ const serialized = await this.baseRepository_.serialize(createdLocales);
153
+ return Array.isArray(data) ? serialized : serialized[0];
154
+ }
155
+ // @ts-expect-error
156
+ async createTranslations(data, sharedContext = {}) {
157
+ const dataArray = Array.isArray(data) ? data : [data];
158
+ const translatableFieldsConfig = await this.getTranslatableFields(undefined, sharedContext);
159
+ const normalizedData = dataArray.map((translation) => ({
160
+ ...translation,
161
+ locale_code: (0, utils_1.normalizeLocale)(translation.locale_code),
162
+ translated_field_count: (0, compute_translated_field_count_1.computeTranslatedFieldCount)(translation.translations, translatableFieldsConfig[translation.reference]),
163
+ }));
164
+ const createdTranslations = await this.translationService_.create(normalizedData, sharedContext);
165
+ const serialized = await this.baseRepository_.serialize(createdTranslations);
166
+ return Array.isArray(data) ? serialized : serialized[0];
167
+ }
168
+ // @ts-expect-error
169
+ async updateTranslations(data, sharedContext = {}) {
170
+ const dataArray = Array.isArray(data) ? data : [data];
171
+ const updatesWithTranslations = dataArray.filter((d) => d.translations);
172
+ if (updatesWithTranslations.length) {
173
+ const idsNeedingReference = updatesWithTranslations
174
+ .filter((d) => !d.reference)
175
+ .map((d) => d.id);
176
+ let referenceMap = {};
177
+ if (idsNeedingReference.length) {
178
+ const existingTranslations = await this.translationService_.list({ id: idsNeedingReference }, { select: ["id", "reference"] }, sharedContext);
179
+ referenceMap = Object.fromEntries(existingTranslations.map((t) => [t.id, t.reference]));
180
+ }
181
+ const translatableFieldsConfig = await this.getTranslatableFields(undefined, sharedContext);
182
+ for (const update of dataArray) {
183
+ if (update.translations) {
184
+ const reference = update.reference || referenceMap[update.id];
185
+ update.translated_field_count = (0, compute_translated_field_count_1.computeTranslatedFieldCount)(update.translations, translatableFieldsConfig[reference] || []);
186
+ }
187
+ }
188
+ }
189
+ const updatedTranslations = await this.translationService_.update(dataArray, sharedContext);
190
+ const serialized = await this.baseRepository_.serialize(updatedTranslations);
191
+ return Array.isArray(data) ? serialized : serialized[0];
192
+ }
193
+ // @ts-expect-error
194
+ async createTranslationSettings(data, sharedContext = {}) {
195
+ const dataArray = Array.isArray(data) ? data : [data];
196
+ const normalizedData = await this.ensureEntityType_(dataArray, sharedContext);
197
+ TranslationModuleService.validateSettings(normalizedData);
198
+ // @ts-expect-error TS can't match union type to overloads
199
+ return await super.createTranslationSettings(data, sharedContext);
200
+ }
201
+ // @ts-expect-error
202
+ async updateTranslationSettings(data, sharedContext = {}) {
203
+ const dataArray = Array.isArray(data) ? data : [data];
204
+ const normalizedData = await this.ensureEntityType_(dataArray, sharedContext);
205
+ TranslationModuleService.validateSettings(normalizedData);
206
+ const updatedSettings = await this.settingsService_.update(data, sharedContext);
207
+ const entityTypes = [
208
+ ...new Set(normalizedData.map((setting) => setting.entity_type)),
209
+ ];
210
+ const translatableFieldsConfig = await this.getTranslatableFields(undefined, sharedContext);
211
+ const translations = await this.translationService_.list({
212
+ reference: entityTypes,
213
+ });
214
+ const toUpdate = translations.map((translation) => ({
215
+ id: translation.id,
216
+ translated_field_count: (0, compute_translated_field_count_1.computeTranslatedFieldCount)(translation.translations, translatableFieldsConfig[translation.reference] ?? []),
217
+ }));
218
+ if (toUpdate.length) {
219
+ await this.translationService_.update(toUpdate, sharedContext);
220
+ }
221
+ const serialized = await this.baseRepository_.serialize(updatedSettings);
222
+ return Array.isArray(data) ? serialized : serialized[0];
223
+ }
224
+ async getStatistics(input, sharedContext = {}) {
225
+ const { locales, entities } = input;
226
+ if (!locales || !locales.length) {
227
+ throw new utils_1.AcmeKitError(utils_1.AcmeKitError.Types.INVALID_DATA, "At least one locale must be provided");
228
+ }
229
+ if (!entities || !Object.keys(entities).length) {
230
+ throw new utils_1.AcmeKitError(utils_1.AcmeKitError.Types.INVALID_DATA, "At least one entity type must be provided");
231
+ }
232
+ const normalizedLocales = locales.map(utils_1.normalizeLocale);
233
+ const manager = (sharedContext.transactionManager ??
234
+ sharedContext.manager);
235
+ const knex = manager.getKnex();
236
+ const translatableFieldsConfig = await this.getTranslatableFields(undefined, sharedContext);
237
+ const result = {};
238
+ const entityTypes = [];
239
+ for (const entityType of Object.keys(entities)) {
240
+ const translatableFields = translatableFieldsConfig[entityType];
241
+ if (!translatableFields || translatableFields.length === 0) {
242
+ result[entityType] = {
243
+ expected: 0,
244
+ translated: 0,
245
+ missing: 0,
246
+ by_locale: Object.fromEntries(normalizedLocales.map((locale) => [
247
+ locale,
248
+ { expected: 0, translated: 0, missing: 0 },
249
+ ])),
250
+ };
251
+ }
252
+ else {
253
+ entityTypes.push(entityType);
254
+ }
255
+ }
256
+ if (!entityTypes.length) {
257
+ return result;
258
+ }
259
+ const { rows } = await knex.raw(`
260
+ SELECT
261
+ reference,
262
+ locale_code,
263
+ COALESCE(SUM(translated_field_count), 0)::int AS translated_field_count
264
+ FROM translation
265
+ WHERE reference = ANY(?)
266
+ AND locale_code = ANY(?)
267
+ AND deleted_at IS NULL
268
+ GROUP BY reference, locale_code
269
+ `, [entityTypes, normalizedLocales]);
270
+ for (const entityType of entityTypes) {
271
+ const translatableFields = translatableFieldsConfig[entityType];
272
+ const fieldsPerEntity = translatableFields.length;
273
+ const entityCount = entities[entityType].count;
274
+ const expectedPerLocale = entityCount * fieldsPerEntity;
275
+ result[entityType] = {
276
+ expected: expectedPerLocale * normalizedLocales.length,
277
+ translated: 0,
278
+ missing: expectedPerLocale * normalizedLocales.length,
279
+ by_locale: Object.fromEntries(normalizedLocales.map((locale) => [
280
+ locale,
281
+ {
282
+ expected: expectedPerLocale,
283
+ translated: 0,
284
+ missing: expectedPerLocale,
285
+ },
286
+ ])),
287
+ };
288
+ }
289
+ for (const row of rows) {
290
+ const entityType = row.reference;
291
+ const localeCode = row.locale_code;
292
+ const translatedCount = parseInt(row.translated_field_count, 10) || 0;
293
+ result[entityType].by_locale[localeCode].translated = translatedCount;
294
+ result[entityType].by_locale[localeCode].missing =
295
+ result[entityType].by_locale[localeCode].expected - translatedCount;
296
+ result[entityType].translated += translatedCount;
297
+ }
298
+ for (const entityType of entityTypes) {
299
+ result[entityType].missing =
300
+ result[entityType].expected - result[entityType].translated;
301
+ }
302
+ return result;
303
+ }
304
+ /**
305
+ * Validates the translation settings to create or update against the translatable entities and their translatable fields configuration.
306
+ * @param dataToValidate - The data to validate.
307
+ */
308
+ static validateSettings(dataToValidate) {
309
+ const translatableEntities = utils_1.DmlEntity.getTranslatableEntities();
310
+ const translatableEntitiesMap = new Map(translatableEntities.map((entity) => [(0, utils_1.toSnakeCase)(entity.entity), entity]));
311
+ const invalidSettings = [];
312
+ for (const item of dataToValidate) {
313
+ const entityType = item.entity_type;
314
+ const entity = translatableEntitiesMap.get(entityType);
315
+ if (!entity) {
316
+ invalidSettings.push({
317
+ entity_type: entityType,
318
+ is_invalid_entity: true,
319
+ });
320
+ }
321
+ else {
322
+ const invalidFields = (0, utils_1.arrayDifference)(item.fields ?? [], entity.fields);
323
+ if (invalidFields.length) {
324
+ invalidSettings.push({
325
+ entity_type: entityType,
326
+ is_invalid_entity: false,
327
+ invalidFields,
328
+ });
329
+ }
330
+ }
331
+ }
332
+ if (invalidSettings.length) {
333
+ throw new utils_1.AcmeKitError(utils_1.AcmeKitErrorTypes.INVALID_DATA, "Invalid translation settings:\n" +
334
+ invalidSettings
335
+ .map((setting) => `- ${setting.entity_type} ${setting.is_invalid_entity
336
+ ? "is not a translatable entity"
337
+ : `doesn't have the following fields set as translatable: ${setting.invalidFields?.join(", ")}`}`)
338
+ .join("\n"));
339
+ }
340
+ }
341
+ /**
342
+ * Ensures the entity type is set for the settings to be created or updated. This is useful for validation purposes and recomputing the translated field count.
343
+ * @param settings - The settings to ensure the entity type for.
344
+ * @param sharedContext - A context used to share resources, such as transaction manager, between the application and the module.
345
+ * @returns The settings with the entity type set.
346
+ */
347
+ async ensureEntityType_(settings, sharedContext = {}) {
348
+ const idsNeedingResolution = settings
349
+ .filter((setting) => !setting.entity_type && "id" in setting)
350
+ .map((setting) => setting.id);
351
+ let entityTypeMap = {};
352
+ if (idsNeedingResolution.length) {
353
+ const existingSettings = await this.settingsService_.list({ id: idsNeedingResolution }, { select: ["id", "entity_type"] }, sharedContext);
354
+ entityTypeMap = Object.fromEntries(existingSettings.map((s) => [s.id, s.entity_type]));
355
+ }
356
+ return settings.map((setting) => {
357
+ const entityType = setting.entity_type ||
358
+ entityTypeMap[setting.id];
359
+ return { ...setting, entity_type: entityType };
360
+ });
361
+ }
362
+ }
363
+ exports.default = TranslationModuleService;
364
+ __decorate([
365
+ (0, utils_1.InjectManager)(),
366
+ __param(1, (0, utils_1.AcmeKitContext)()),
367
+ __metadata("design:type", Function),
368
+ __metadata("design:paramtypes", [String, Object]),
369
+ __metadata("design:returntype", Promise)
370
+ ], TranslationModuleService.prototype, "getTranslatableFields", null);
371
+ __decorate([
372
+ (0, utils_1.InjectManager)(),
373
+ __param(1, (0, utils_1.AcmeKitContext)()),
374
+ __metadata("design:type", Function),
375
+ __metadata("design:paramtypes", [String, Object]),
376
+ __metadata("design:returntype", Promise)
377
+ ], TranslationModuleService.prototype, "getInactiveTranslatableFields", null);
378
+ __decorate([
379
+ (0, utils_1.InjectManager)()
380
+ // @ts-expect-error
381
+ ,
382
+ __param(2, (0, utils_1.AcmeKitContext)()),
383
+ __metadata("design:type", Function),
384
+ __metadata("design:paramtypes", [String, Object, Object]),
385
+ __metadata("design:returntype", Promise)
386
+ ], TranslationModuleService.prototype, "retrieveTranslation", null);
387
+ __decorate([
388
+ (0, utils_1.InjectManager)()
389
+ // @ts-expect-error
390
+ ,
391
+ __param(2, (0, utils_1.AcmeKitContext)()),
392
+ __metadata("design:type", Function),
393
+ __metadata("design:paramtypes", [Object, Object, Object]),
394
+ __metadata("design:returntype", Promise)
395
+ ], TranslationModuleService.prototype, "listTranslations", null);
396
+ __decorate([
397
+ (0, utils_1.InjectManager)()
398
+ // @ts-expect-error
399
+ ,
400
+ __param(2, (0, utils_1.AcmeKitContext)()),
401
+ __metadata("design:type", Function),
402
+ __metadata("design:paramtypes", [Object, Object, Object]),
403
+ __metadata("design:returntype", Promise)
404
+ ], TranslationModuleService.prototype, "listAndCountTranslations", null);
405
+ __decorate([
406
+ (0, utils_1.InjectManager)(),
407
+ (0, utils_1.EmitEvents)()
408
+ // @ts-expect-error
409
+ ,
410
+ __param(1, (0, utils_1.AcmeKitContext)()),
411
+ __metadata("design:type", Function),
412
+ __metadata("design:paramtypes", [Object, Object]),
413
+ __metadata("design:returntype", Promise)
414
+ ], TranslationModuleService.prototype, "createLocales", null);
415
+ __decorate([
416
+ (0, utils_1.InjectManager)(),
417
+ (0, utils_1.EmitEvents)()
418
+ // @ts-expect-error
419
+ ,
420
+ __param(1, (0, utils_1.AcmeKitContext)()),
421
+ __metadata("design:type", Function),
422
+ __metadata("design:paramtypes", [Object, Object]),
423
+ __metadata("design:returntype", Promise)
424
+ ], TranslationModuleService.prototype, "createTranslations", null);
425
+ __decorate([
426
+ (0, utils_1.InjectManager)(),
427
+ (0, utils_1.EmitEvents)()
428
+ // @ts-expect-error
429
+ ,
430
+ __param(1, (0, utils_1.AcmeKitContext)()),
431
+ __metadata("design:type", Function),
432
+ __metadata("design:paramtypes", [Object, Object]),
433
+ __metadata("design:returntype", Promise)
434
+ ], TranslationModuleService.prototype, "updateTranslations", null);
435
+ __decorate([
436
+ (0, utils_1.InjectManager)(),
437
+ (0, utils_1.EmitEvents)()
438
+ // @ts-expect-error
439
+ ,
440
+ __param(1, (0, utils_1.AcmeKitContext)()),
441
+ __metadata("design:type", Function),
442
+ __metadata("design:paramtypes", [Object, Object]),
443
+ __metadata("design:returntype", Promise)
444
+ ], TranslationModuleService.prototype, "createTranslationSettings", null);
445
+ __decorate([
446
+ (0, utils_1.InjectManager)(),
447
+ (0, utils_1.EmitEvents)()
448
+ // @ts-expect-error
449
+ ,
450
+ __param(1, (0, utils_1.AcmeKitContext)()),
451
+ __metadata("design:type", Function),
452
+ __metadata("design:paramtypes", [Object, Object]),
453
+ __metadata("design:returntype", Promise)
454
+ ], TranslationModuleService.prototype, "updateTranslationSettings", null);
455
+ __decorate([
456
+ (0, utils_1.InjectManager)(),
457
+ __param(1, (0, utils_1.AcmeKitContext)()),
458
+ __metadata("design:type", Function),
459
+ __metadata("design:paramtypes", [Object, Object]),
460
+ __metadata("design:returntype", Promise)
461
+ ], TranslationModuleService.prototype, "getStatistics", null);
462
+ __decorate([
463
+ __param(1, (0, utils_1.AcmeKitContext)()),
464
+ __metadata("design:type", Function),
465
+ __metadata("design:paramtypes", [Array, Object]),
466
+ __metadata("design:returntype", Promise)
467
+ ], TranslationModuleService.prototype, "ensureEntityType_", null);
468
+ //# sourceMappingURL=translation-module.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"translation-module.js","sourceRoot":"","sources":["../../src/services/translation-module.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;AAAA,4DAAuD;AACvD,oDAYiC;AAEjC,oDAWiC;AACjC,4DAAmC;AACnC,sEAA6C;AAC7C,gEAAuC;AACvC,0FAAmF;AACnF,gFAA0E;AAW1E,MAAqB,wBACnB,SAAQ,IAAA,sBAAc,EAUnB;IACD,MAAM,EAAN,gBAAM;IACN,WAAW,EAAX,qBAAW;IACX,mBAAmB,EAAE,kBAAQ;CAC9B,CAAC;IAcF,YAAY,EACV,cAAc,EACd,kBAAkB,EAClB,aAAa,EACb,0BAA0B,GACL;QACrB,KAAK,CAAC,GAAG,SAAS,CAAC,CAAA;QAOrB,YAAO,GAAG;YACR,kBAAkB,EAAE,KAAK,IAAI,EAAE;gBAC7B,OAAO,IAAI,CAAC,mBAAmB,EAAE,CAAA;YACnC,CAAC;SACF,CAAA;QAVC,IAAI,CAAC,eAAe,GAAG,cAAc,CAAA;QACrC,IAAI,CAAC,mBAAmB,GAAG,kBAAkB,CAAA;QAC7C,IAAI,CAAC,cAAc,GAAG,aAAa,CAAA;QACnC,IAAI,CAAC,gBAAgB,GAAG,0BAA0B,CAAA;IACpD,CAAC;IAQS,KAAK,CAAC,mBAAmB;QACjC,MAAM,oBAAoB,GAAG,iBAAS,CAAC,uBAAuB,EAAE,CAAA;QAChE,MAAM,uBAAuB,GAAG,IAAI,GAAG,CACrC,oBAAoB,CAAC,GAAG,CAAC,CAAC,MAAM,EAAE,EAAE,CAAC,IAAA,mBAAW,EAAC,MAAM,CAAC,MAAM,CAAC,CAAC,CACjE,CAAA;QAED,MAAM,0BAA0B,GAAG,MAAM,IAAI,CAAC,gBAAgB,CAAC,IAAI,EAAE,CAAA;QACrE,MAAM,6BAA6B,GAAG,IAAI,G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A;;;;wEAyBlB;AAgBK;IAHL,IAAA,qBAAa,GAAE;IACf,IAAA,kBAAU,GAAE;IACb,mBAAmB;;IAGhB,WAAA,IAAA,sBAAc,GAAE,CAAA;;;;6DAiBlB;AAiBK;IAHL,IAAA,qBAAa,GAAE;IACf,IAAA,kBAAU,GAAE;IACb,mBAAmB;;IAGhB,WAAA,IAAA,sBAAc,GAAE,CAAA;;;;kEA4BlB;AAgBK;IAHL,IAAA,qBAAa,GAAE;IACf,IAAA,kBAAU,GAAE;IACb,mBAAmB;;IAKhB,WAAA,IAAA,sBAAc,GAAE,CAAA;;;;kEAwDlB;AAKK;IAHL,IAAA,qBAAa,GAAE;IACf,IAAA,kBAAU,GAAE;IACb,mBAAmB;;IAGhB,WAAA,IAAA,sBAAc,GAAE,CAAA;;;;yEAelB;AAKK;IAHL,IAAA,qBAAa,GAAE;IACf,IAAA,kBAAU,GAAE;IACb,mBAAmB;;IAGhB,WAAA,IAAA,sBAAc,GAAE,CAAA;;;;yEAgDlB;AAGK;IADL,IAAA,qBAAa,GAAE;IAGb,WAAA,IAAA,sBAAc,GAAE,CAAA;;;;6DA+GlB;AAsEe;IAEb,WAAA,IAAA,sBAAc,GAAE,CAAA;;;;iEA8BlB"}
@@ -0,0 +1 @@
1
+ {"root":["../src/index.ts","../src/loaders/defaults.ts","../src/migrations/migration20251208124155.ts","../src/migrations/migration20251215083927.ts","../src/migrations/migration20251218140235.ts","../src/migrations/migration20260108122757.ts","../src/models/index.ts","../src/models/locale.ts","../src/models/settings.ts","../src/models/translation.ts","../src/services/translation-module.ts","../src/types/index.ts","../src/utils/compute-translated-field-count.ts","../src/utils/filter-translation-fields.ts"],"version":"5.9.3"}
@@ -0,0 +1,37 @@
1
+ import { RemoteQueryEntryPoints } from "@acmekit/framework/types";
2
+ /**
3
+ * Extracts only the keys of T where the value is a string (or nullable string), the key
4
+ * is not __typename or id.
5
+ * This filters out relations and other non-string fields.
6
+ */
7
+ type StringValuedKeys<T> = {
8
+ [K in keyof T]: K extends `${string}_id` ? never : "__typename" extends K ? never : "id" extends K ? never : NonNullable<T[K]> extends string ? K : never;
9
+ }[keyof T];
10
+ /**
11
+ * A discriminated union of all possible entity configurations.
12
+ * When you specify a `type`, TypeScript will narrow `fields` to only
13
+ * the string-valued keys of that specific entity type.
14
+ */
15
+ export type TranslatableEntityConfig = {
16
+ [K in keyof RemoteQueryEntryPoints]: {
17
+ type: K;
18
+ fields: StringValuedKeys<RemoteQueryEntryPoints[K]>[];
19
+ };
20
+ }[keyof RemoteQueryEntryPoints] | {
21
+ type: string;
22
+ fields: string[];
23
+ };
24
+ /**
25
+ * Options for configuring the translation module.
26
+ */
27
+ export type TranslationModuleOptions = {
28
+ entities?: TranslatableEntityConfig[];
29
+ };
30
+ declare module "@acmekit/types" {
31
+ interface ModuleOptions {
32
+ "@acmekit/translation": TranslationModuleOptions;
33
+ "@acmekit/acmekit/translation": TranslationModuleOptions;
34
+ }
35
+ }
36
+ export {};
37
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/types/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,sBAAsB,EAAE,MAAM,0BAA0B,CAAA;AAEjE;;;;GAIG;AACH,KAAK,gBAAgB,CAAC,CAAC,IAAI;KACxB,CAAC,IAAI,MAAM,CAAC,GAAG,CAAC,SAAS,GAAG,MAAM,KAAK,GACpC,KAAK,GACL,YAAY,SAAS,CAAC,GACtB,KAAK,GACL,IAAI,SAAS,CAAC,GACd,KAAK,GACL,WAAW,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,SAAS,MAAM,GAChC,CAAC,GACD,KAAK;CACV,CAAC,MAAM,CAAC,CAAC,CAAA;AAEV;;;;GAIG;AACH,MAAM,MAAM,wBAAwB,GAChC;KACG,CAAC,IAAI,MAAM,sBAAsB,GAAG;QACnC,IAAI,EAAE,CAAC,CAAA;QACP,MAAM,EAAE,gBAAgB,CAAC,sBAAsB,CAAC,CAAC,CAAC,CAAC,EAAE,CAAA;KACtD;CACF,CAAC,MAAM,sBAAsB,CAAC,GAC/B;IACE,IAAI,EAAE,MAAM,CAAA;IACZ,MAAM,EAAE,MAAM,EAAE,CAAA;CACjB,CAAA;AAEL;;GAEG;AACH,MAAM,MAAM,wBAAwB,GAAG;IACrC,QAAQ,CAAC,EAAE,wBAAwB,EAAE,CAAA;CACtC,CAAA;AAGD,OAAO,QAAQ,gBAAgB,CAAC;IAC9B,UAAU,aAAa;QACrB,sBAAsB,EAAE,wBAAwB,CAAA;QAChD,8BAA8B,EAAE,wBAAwB,CAAA;KACzD;CACF"}
@@ -0,0 +1,3 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/types/index.ts"],"names":[],"mappings":""}
@@ -0,0 +1,12 @@
1
+ /**
2
+ * Computes the count of translated fields based on the translatable fields configuration.
3
+ * Only counts fields that are:
4
+ * 1. In the translatableFields array for the entity type
5
+ * 2. Have a non-null, non-empty value in the translations object
6
+ *
7
+ * @param translations - The translations JSON object from the translation record
8
+ * @param translatableFields - Array of field names that are translatable for this entity type
9
+ * @returns The count of translated fields
10
+ */
11
+ export declare function computeTranslatedFieldCount(translations: Record<string, unknown> | undefined | null, translatableFields: string[] | undefined | null): number;
12
+ //# sourceMappingURL=compute-translated-field-count.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"compute-translated-field-count.d.ts","sourceRoot":"","sources":["../../src/utils/compute-translated-field-count.ts"],"names":[],"mappings":"AAAA;;;;;;;;;GASG;AACH,wBAAgB,2BAA2B,CACzC,YAAY,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,GAAG,SAAS,GAAG,IAAI,EACxD,kBAAkB,EAAE,MAAM,EAAE,GAAG,SAAS,GAAG,IAAI,GAC9C,MAAM,CASR"}
@@ -0,0 +1,23 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.computeTranslatedFieldCount = computeTranslatedFieldCount;
4
+ /**
5
+ * Computes the count of translated fields based on the translatable fields configuration.
6
+ * Only counts fields that are:
7
+ * 1. In the translatableFields array for the entity type
8
+ * 2. Have a non-null, non-empty value in the translations object
9
+ *
10
+ * @param translations - The translations JSON object from the translation record
11
+ * @param translatableFields - Array of field names that are translatable for this entity type
12
+ * @returns The count of translated fields
13
+ */
14
+ function computeTranslatedFieldCount(translations, translatableFields) {
15
+ if (!translations || !translatableFields?.length) {
16
+ return 0;
17
+ }
18
+ return translatableFields.filter((field) => {
19
+ const value = translations[field];
20
+ return value != null && value !== "" && value !== "null";
21
+ }).length;
22
+ }
23
+ //# sourceMappingURL=compute-translated-field-count.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"compute-translated-field-count.js","sourceRoot":"","sources":["../../src/utils/compute-translated-field-count.ts"],"names":[],"mappings":";;AAUA,kEAYC;AAtBD;;;;;;;;;GASG;AACH,SAAgB,2BAA2B,CACzC,YAAwD,EACxD,kBAA+C;IAE/C,IAAI,CAAC,YAAY,IAAI,CAAC,kBAAkB,EAAE,MAAM,EAAE,CAAC;QACjD,OAAO,CAAC,CAAA;IACV,CAAC;IAED,OAAO,kBAAkB,CAAC,MAAM,CAAC,CAAC,KAAK,EAAE,EAAE;QACzC,MAAM,KAAK,GAAG,YAAY,CAAC,KAAK,CAAC,CAAA;QACjC,OAAO,KAAK,IAAI,IAAI,IAAI,KAAK,KAAK,EAAE,IAAI,KAAK,KAAK,MAAM,CAAA;IAC1D,CAAC,CAAC,CAAC,MAAM,CAAA;AACX,CAAC"}
@@ -0,0 +1,3 @@
1
+ import { TranslationTypes } from "@acmekit/framework/types";
2
+ export declare function filterTranslationFields(translations: TranslationTypes.TranslationDTO[], translatableFieldsConfig: Record<string, string[]>): TranslationTypes.TranslationDTO[];
3
+ //# sourceMappingURL=filter-translation-fields.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"filter-translation-fields.d.ts","sourceRoot":"","sources":["../../src/utils/filter-translation-fields.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,gBAAgB,EAAE,MAAM,0BAA0B,CAAA;AAE3D,wBAAgB,uBAAuB,CACrC,YAAY,EAAE,gBAAgB,CAAC,cAAc,EAAE,EAC/C,wBAAwB,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,EAAE,CAAC,GACjD,gBAAgB,CAAC,cAAc,EAAE,CAuBnC"}
@@ -0,0 +1,22 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.filterTranslationFields = filterTranslationFields;
4
+ function filterTranslationFields(translations, translatableFieldsConfig) {
5
+ return translations.map((translation) => {
6
+ const allowedFields = translatableFieldsConfig[translation.reference];
7
+ if (!allowedFields?.length) {
8
+ translation.translations = {};
9
+ return translation;
10
+ }
11
+ const filteredTranslations = {};
12
+ for (const field of allowedFields) {
13
+ if (translation.translations &&
14
+ field in translation.translations) {
15
+ filteredTranslations[field] = translation.translations[field];
16
+ }
17
+ }
18
+ translation.translations = filteredTranslations;
19
+ return translation;
20
+ });
21
+ }
22
+ //# sourceMappingURL=filter-translation-fields.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"filter-translation-fields.js","sourceRoot":"","sources":["../../src/utils/filter-translation-fields.ts"],"names":[],"mappings":";;AAEA,0DA0BC;AA1BD,SAAgB,uBAAuB,CACrC,YAA+C,EAC/C,wBAAkD;IAElD,OAAO,YAAY,CAAC,GAAG,CAAC,CAAC,WAAW,EAAE,EAAE;QACtC,MAAM,aAAa,GAAG,wBAAwB,CAAC,WAAW,CAAC,SAAS,CAAC,CAAA;QACrE,IAAI,CAAC,aAAa,EAAE,MAAM,EAAE,CAAC;YAC3B,WAAW,CAAC,YAAY,GAAG,EAAE,CAAA;YAC7B,OAAO,WAAW,CAAA;QACpB,CAAC;QAED,MAAM,oBAAoB,GAA4B,EAAE,CAAA;QACxD,KAAK,MAAM,KAAK,IAAI,aAAa,EAAE,CAAC;YAClC,IACE,WAAW,CAAC,YAAY;gBACxB,KAAK,IAAK,WAAW,CAAC,YAAwC,EAC9D,CAAC;gBACD,oBAAoB,CAAC,KAAK,CAAC,GACzB,WAAW,CAAC,YACb,CAAC,KAAK,CAAC,CAAA;YACV,CAAC;QACH,CAAC;QAED,WAAW,CAAC,YAAY,GAAG,oBAAoB,CAAA;QAC/C,OAAO,WAAW,CAAA;IACpB,CAAC,CAAC,CAAA;AACJ,CAAC"}