@flusys/nestjs-localization 4.1.1 → 5.0.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.
@@ -10,11 +10,11 @@ Object.defineProperty(exports, "TranslationKeyController", {
10
10
  });
11
11
  const _classes = require("@flusys/nestjs-shared/classes");
12
12
  const _decorators = require("@flusys/nestjs-shared/decorators");
13
- const _config = require("../config");
14
13
  const _guards = require("@flusys/nestjs-shared/guards");
15
14
  const _interfaces = require("@flusys/nestjs-shared/interfaces");
16
15
  const _common = require("@nestjs/common");
17
16
  const _swagger = require("@nestjs/swagger");
17
+ const _config = require("../config");
18
18
  const _dtos = require("../dtos");
19
19
  const _services = require("../services");
20
20
  function _define_property(obj, key, value) {
@@ -45,7 +45,7 @@ function _ts_param(paramIndex, decorator) {
45
45
  };
46
46
  }
47
47
  let TranslationKeyController = class TranslationKeyController extends (0, _classes.createApiController)(_dtos.CreateTranslationKeyDto, _dtos.UpdateTranslationKeyDto, _dtos.TranslationKeyResponseDto, {
48
- entityName: 'translationKey',
48
+ entityName: 'translation.key',
49
49
  security: {
50
50
  insert: {
51
51
  level: 'permission',
@@ -100,21 +100,6 @@ let TranslationKeyController = class TranslationKeyController extends (0, _class
100
100
  data
101
101
  };
102
102
  }
103
- async getByModule(body, _user) {
104
- const data = await this.service.findByModule(body.module);
105
- return {
106
- success: true,
107
- message: 'Translation keys retrieved successfully',
108
- messageKey: _config.TRANSLATION_KEY_MESSAGES.GET_ALL_SUCCESS,
109
- data,
110
- meta: {
111
- total: data.length,
112
- page: 0,
113
- pageSize: data.length,
114
- count: data.length
115
- }
116
- };
117
- }
118
103
  constructor(service){
119
104
  super(service), _define_property(this, "service", void 0), this.service = service;
120
105
  }
@@ -140,29 +125,6 @@ _ts_decorate([
140
125
  ]),
141
126
  _ts_metadata("design:returntype", Promise)
142
127
  ], TranslationKeyController.prototype, "getModules", null);
143
- _ts_decorate([
144
- (0, _common.Post)('get-by-module'),
145
- (0, _common.UseGuards)(_guards.JwtAuthGuard),
146
- (0, _swagger.ApiBearerAuth)(),
147
- (0, _decorators.RequirePermission)(_classes.TRANSLATION_KEY_PERMISSIONS.READ),
148
- (0, _swagger.ApiOperation)({
149
- summary: 'Get translation keys by module'
150
- }),
151
- (0, _swagger.ApiResponse)({
152
- status: 200,
153
- type: [
154
- _dtos.TranslationKeyResponseDto
155
- ]
156
- }),
157
- _ts_param(0, (0, _common.Body)()),
158
- _ts_param(1, (0, _decorators.CurrentUser)()),
159
- _ts_metadata("design:type", Function),
160
- _ts_metadata("design:paramtypes", [
161
- typeof _dtos.GetByModuleDto === "undefined" ? Object : _dtos.GetByModuleDto,
162
- typeof _interfaces.ILoggedUserInfo === "undefined" ? Object : _interfaces.ILoggedUserInfo
163
- ]),
164
- _ts_metadata("design:returntype", Promise)
165
- ], TranslationKeyController.prototype, "getByModule", null);
166
128
  TranslationKeyController = _ts_decorate([
167
129
  (0, _swagger.ApiTags)('Localization - Translation Key'),
168
130
  (0, _common.Controller)('localization/translation-key'),
@@ -100,15 +100,6 @@ let TranslationController = class TranslationController extends (0, _classes.cre
100
100
  data
101
101
  };
102
102
  }
103
- async getByModule(body) {
104
- const data = await this.service.getByModuleAndLanguage(body.module, body.languageCode);
105
- return {
106
- success: true,
107
- message: 'Translations by module retrieved successfully',
108
- messageKey: _config.TRANSLATION_MESSAGES.BY_MODULE_SUCCESS,
109
- data
110
- };
111
- }
112
103
  async updateManyValues(body, _user) {
113
104
  const data = await this.service.bulkUpdate(body.translations);
114
105
  return {
@@ -124,21 +115,6 @@ let TranslationController = class TranslationController extends (0, _classes.cre
124
115
  }
125
116
  };
126
117
  }
127
- async getMissing(body, _user) {
128
- const data = await this.service.getMissingTranslations(body.languageCode);
129
- return {
130
- success: true,
131
- message: 'Missing translations retrieved successfully',
132
- messageKey: _config.TRANSLATION_MESSAGES.MISSING_SUCCESS,
133
- data,
134
- meta: {
135
- total: data.length,
136
- page: 0,
137
- pageSize: data.length,
138
- count: data.length
139
- }
140
- };
141
- }
142
118
  async getCounts(_user) {
143
119
  const data = await this.service.getTranslationCounts();
144
120
  return {
@@ -167,21 +143,6 @@ _ts_decorate([
167
143
  ]),
168
144
  _ts_metadata("design:returntype", Promise)
169
145
  ], TranslationController.prototype, "getByLanguage", null);
170
- _ts_decorate([
171
- (0, _common.Post)('get-by-module'),
172
- (0, _swagger.ApiOperation)({
173
- summary: 'Get translations by module and language'
174
- }),
175
- (0, _swagger.ApiResponse)({
176
- status: 200
177
- }),
178
- _ts_param(0, (0, _common.Body)()),
179
- _ts_metadata("design:type", Function),
180
- _ts_metadata("design:paramtypes", [
181
- typeof _dtos.GetTranslationsByModuleDto === "undefined" ? Object : _dtos.GetTranslationsByModuleDto
182
- ]),
183
- _ts_metadata("design:returntype", Promise)
184
- ], TranslationController.prototype, "getByModule", null);
185
146
  _ts_decorate([
186
147
  (0, _common.Post)('update-many-values'),
187
148
  (0, _common.UseGuards)(_guards.JwtAuthGuard),
@@ -205,26 +166,6 @@ _ts_decorate([
205
166
  ]),
206
167
  _ts_metadata("design:returntype", Promise)
207
168
  ], TranslationController.prototype, "updateManyValues", null);
208
- _ts_decorate([
209
- (0, _common.Post)('get-missing'),
210
- (0, _common.UseGuards)(_guards.JwtAuthGuard),
211
- (0, _swagger.ApiBearerAuth)(),
212
- (0, _decorators.RequirePermission)(_classes.TRANSLATION_PERMISSIONS.READ),
213
- (0, _swagger.ApiOperation)({
214
- summary: 'Get translation keys missing translations for a language'
215
- }),
216
- (0, _swagger.ApiResponse)({
217
- status: 200
218
- }),
219
- _ts_param(0, (0, _common.Body)()),
220
- _ts_param(1, (0, _decorators.CurrentUser)()),
221
- _ts_metadata("design:type", Function),
222
- _ts_metadata("design:paramtypes", [
223
- typeof _dtos.GetTranslationsByLanguageDto === "undefined" ? Object : _dtos.GetTranslationsByLanguageDto,
224
- typeof _interfaces.ILoggedUserInfo === "undefined" ? Object : _interfaces.ILoggedUserInfo
225
- ]),
226
- _ts_metadata("design:returntype", Promise)
227
- ], TranslationController.prototype, "getMissing", null);
228
169
  _ts_decorate([
229
170
  (0, _common.Post)('get-counts'),
230
171
  (0, _common.UseGuards)(_guards.JwtAuthGuard),
@@ -0,0 +1,11 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", {
3
+ value: true
4
+ });
5
+ Object.defineProperty(exports, "localizationSwaggerConfig", {
6
+ enumerable: true,
7
+ get: function() {
8
+ return _localizationswaggerconfig.localizationSwaggerConfig;
9
+ }
10
+ });
11
+ const _localizationswaggerconfig = require("./localization-swagger.config");
@@ -0,0 +1,111 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", {
3
+ value: true
4
+ });
5
+ Object.defineProperty(exports, "localizationSwaggerConfig", {
6
+ enumerable: true,
7
+ get: function() {
8
+ return localizationSwaggerConfig;
9
+ }
10
+ });
11
+ function localizationSwaggerConfig(bootstrapConfig) {
12
+ const isMultiTenant = bootstrapConfig?.databaseMode === 'multi-tenant';
13
+ const multiTenantNote = isMultiTenant ? `\n> **Multi-Tenant Mode**: Include \`x-tenant-id\` header to target a specific tenant database.\n` : '';
14
+ return {
15
+ title: 'Localization API',
16
+ description: `
17
+ ## Localization API
18
+ ${multiTenantNote}
19
+
20
+ Database-driven internationalization system. Manage languages, translation keys, and translations — all stored in the database and served via API.
21
+
22
+ ## Features
23
+
24
+ ### 🌐 Language Management
25
+ - Create and manage languages with LTR/RTL direction support
26
+ - Set a default language
27
+ - Mark languages as readonly to protect seeded entries
28
+
29
+ ### 🔑 Translation Keys
30
+ - Organize keys by module for lazy loading (e.g. \`auth\`, \`iam\`, \`common\`)
31
+ - Dot-case naming convention: \`auth.login.title\`, \`common.button.save\`
32
+ - Support for interpolation variables: \`['count', 'name']\`
33
+ - Readonly protection — system keys cannot be deleted or have their key/module changed
34
+
35
+ ### 📝 Translations
36
+ - Store translated values per language per key
37
+ - Mark translations as verified
38
+ - Bulk upsert in a single transaction — create or update in one call
39
+ - Detect missing translations for a given language
40
+ - Track translation counts per key
41
+
42
+ ### 🚀 Angular Lazy Loading
43
+ - Public endpoints return flat key-value maps: \`{ "auth.login.title": "Sign In" }\`
44
+ - Filter by one or multiple modules to load only what is needed
45
+ - No authentication required for translation retrieval endpoints
46
+
47
+ ## Key Naming Convention
48
+
49
+ Translation keys use dot-case and must be unique per module:
50
+
51
+ \`\`\`
52
+ auth.login.title
53
+ auth.login.submit
54
+ auth.register.email.placeholder
55
+ common.button.save
56
+ common.button.cancel
57
+ iam.role.create.success
58
+ \`\`\`
59
+
60
+ ## Module-Based Lazy Loading
61
+
62
+ Keys are grouped by \`module\` so the frontend loads translations on demand:
63
+
64
+ | Module | Purpose |
65
+ |--------|---------|
66
+ | auth | Login, register, profile pages |
67
+ | iam | Roles, permissions management |
68
+ | storage | Files and folders |
69
+ | event-manager | Calendar events |
70
+ | form-builder | Dynamic form fields |
71
+ | notification | Notification titles and messages |
72
+ | email | Email template content |
73
+ | common | Shared labels used across modules |
74
+
75
+ ## Public vs Authenticated Endpoints
76
+
77
+ **Public** (no auth required — used by Angular to load translations):
78
+ - POST /localization/language/get-active
79
+ - POST /localization/language/get-default
80
+ - POST /localization/translation/get-by-language
81
+ - POST /localization/translation/get-by-module
82
+
83
+ **Authenticated** (require JWT + permission):
84
+ - All create, update, delete operations
85
+ - get-missing, get-counts, update-many-values
86
+
87
+ ## Bulk Update
88
+
89
+ POST /localization/translation/update-many-values accepts an array of translation objects. Each item is either an upsert (provide **id** to update, omit to create). The entire batch runs in a single database transaction.
90
+
91
+ ## Readonly Protection
92
+
93
+ Languages and translation keys with \`isReadonly: true\` are protected at the service layer:
94
+ - Cannot be deleted
95
+ - Key and module fields cannot be modified
96
+
97
+ Use \`isReadonly\` to protect entries that are seeded at startup and should not be changed by users.
98
+
99
+ ## Getting Started
100
+
101
+ 1. **Authenticate**: Obtain JWT token from POST /auth/login
102
+ 2. **Create languages**: Add languages via POST /localization/language/insert
103
+ 3. **Seed translation keys**: Bulk insert keys via POST /localization/translation-key/insert-many
104
+ 4. **Add translations**: Use POST /localization/translation/update-many-values for bulk upsert
105
+ 5. **Load in Angular**: Call POST /localization/translation/get-by-language with { languageCode: "en", modules: ["auth"] }
106
+ `,
107
+ version: '1.0',
108
+ path: 'api/docs/localization',
109
+ bearerAuth: true
110
+ };
111
+ }
@@ -12,9 +12,6 @@ _export(exports, {
12
12
  get CreateTranslationKeyDto () {
13
13
  return CreateTranslationKeyDto;
14
14
  },
15
- get GetByModuleDto () {
16
- return GetByModuleDto;
17
- },
18
15
  get TranslationKeyResponseDto () {
19
16
  return TranslationKeyResponseDto;
20
17
  },
@@ -216,18 +213,3 @@ _ts_decorate([
216
213
  TranslationKeyResponseDto = _ts_decorate([
217
214
  (0, _classtransformer.Exclude)()
218
215
  ], TranslationKeyResponseDto);
219
- let GetByModuleDto = class GetByModuleDto {
220
- constructor(){
221
- _define_property(this, "module", void 0);
222
- }
223
- };
224
- _ts_decorate([
225
- (0, _classvalidator.IsString)(),
226
- (0, _classvalidator.MaxLength)(100),
227
- (0, _classtransformer.Transform)(({ value })=>value?.trim()?.toLowerCase()),
228
- (0, _swagger.ApiProperty)({
229
- example: 'auth',
230
- description: 'Module name'
231
- }),
232
- _ts_metadata("design:type", String)
233
- ], GetByModuleDto.prototype, "module", void 0);
@@ -21,9 +21,6 @@ _export(exports, {
21
21
  get GetTranslationsByLanguageDto () {
22
22
  return GetTranslationsByLanguageDto;
23
23
  },
24
- get GetTranslationsByModuleDto () {
25
- return GetTranslationsByModuleDto;
26
- },
27
24
  get TranslationResponseDto () {
28
25
  return TranslationResponseDto;
29
26
  },
@@ -270,29 +267,3 @@ _ts_decorate([
270
267
  }),
271
268
  _ts_metadata("design:type", Array)
272
269
  ], GetTranslationsByLanguageDto.prototype, "modules", void 0);
273
- let GetTranslationsByModuleDto = class GetTranslationsByModuleDto {
274
- constructor(){
275
- _define_property(this, "module", void 0);
276
- _define_property(this, "languageCode", void 0);
277
- }
278
- };
279
- _ts_decorate([
280
- (0, _classvalidator.IsString)(),
281
- (0, _classvalidator.MaxLength)(100),
282
- (0, _classtransformer.Transform)(({ value })=>value?.trim()?.toLowerCase()),
283
- (0, _swagger.ApiProperty)({
284
- example: 'auth',
285
- description: 'Module name'
286
- }),
287
- _ts_metadata("design:type", String)
288
- ], GetTranslationsByModuleDto.prototype, "module", void 0);
289
- _ts_decorate([
290
- (0, _classvalidator.IsString)(),
291
- (0, _classvalidator.MaxLength)(10),
292
- (0, _classtransformer.Transform)(({ value })=>value?.trim()?.toLowerCase()),
293
- (0, _swagger.ApiProperty)({
294
- example: 'en',
295
- description: 'Language code'
296
- }),
297
- _ts_metadata("design:type", String)
298
- ], GetTranslationsByModuleDto.prototype, "languageCode", void 0);
@@ -8,6 +8,7 @@ Object.defineProperty(exports, "TranslationKey", {
8
8
  return TranslationKey;
9
9
  }
10
10
  });
11
+ const _nestjsshared = require("@flusys/nestjs-shared");
11
12
  const _entities = require("@flusys/nestjs-shared/entities");
12
13
  const _typeorm = require("typeorm");
13
14
  function _define_property(obj, key, value) {
@@ -71,7 +72,7 @@ _ts_decorate([
71
72
  ], TranslationKey.prototype, "description", void 0);
72
73
  _ts_decorate([
73
74
  (0, _typeorm.Column)({
74
- type: 'simple-array',
75
+ type: (0, _nestjsshared.getJsonColumnType)(),
75
76
  nullable: true
76
77
  }),
77
78
  _ts_metadata("design:type", Object)
@@ -77,7 +77,7 @@ let TranslationKeyService = class TranslationKeyService extends _classes.Request
77
77
  throw new _common.ForbiddenException({
78
78
  message: `Cannot modify key or module of readonly translation key "${existing.key}"`,
79
79
  messageKey: _config.TRANSLATION_KEY_MESSAGES.READONLY_UPDATE_FORBIDDEN,
80
- messageParams: {
80
+ messageVariables: {
81
81
  key: existing.key
82
82
  }
83
83
  });
@@ -113,7 +113,7 @@ let TranslationKeyService = class TranslationKeyService extends _classes.Request
113
113
  throw new _common.ForbiddenException({
114
114
  message: `Cannot delete readonly translation keys: ${keys}`,
115
115
  messageKey: _config.TRANSLATION_KEY_MESSAGES.READONLY_DELETE_FORBIDDEN,
116
- messageParams: {
116
+ messageVariables: {
117
117
  keys
118
118
  }
119
119
  });
@@ -156,7 +156,7 @@ let TranslationKeyService = class TranslationKeyService extends _classes.Request
156
156
  throw new _common.BadRequestException({
157
157
  message: `Translation key "${key}" already exists in module "${module}"`,
158
158
  messageKey: _config.TRANSLATION_KEY_MESSAGES.DUPLICATE_KEY_IN_MODULE,
159
- messageParams: {
159
+ messageVariables: {
160
160
  key,
161
161
  module
162
162
  }
@@ -1,2 +1 @@
1
1
  export declare const LOCALIZATION_MODULE_OPTIONS = "LOCALIZATION_MODULE_OPTIONS";
2
- export declare const DEFAULT_LANGUAGE_CODE = "en";
@@ -1,96 +1,16 @@
1
1
  export declare const LANGUAGE_MESSAGES: {
2
- readonly CREATE_SUCCESS: "language.create.success";
3
- readonly CREATE_MANY_SUCCESS: "language.create.many.success";
4
- readonly GET_SUCCESS: "language.get.success";
5
- readonly GET_ALL_SUCCESS: "language.get.all.success";
6
- readonly UPDATE_SUCCESS: "language.update.success";
7
- readonly UPDATE_MANY_SUCCESS: "language.update.many.success";
8
- readonly DELETE_SUCCESS: "language.delete.success";
9
- readonly RESTORE_SUCCESS: "language.restore.success";
10
- readonly NOT_FOUND: "language.not.found";
11
2
  readonly ACTIVE_SUCCESS: "language.active.success";
12
3
  readonly SET_DEFAULT_SUCCESS: "language.set.default.success";
13
4
  readonly GET_DEFAULT_SUCCESS: "language.get.default.success";
14
5
  };
15
6
  export declare const TRANSLATION_KEY_MESSAGES: {
16
- readonly CREATE_SUCCESS: "translation.key.create.success";
17
- readonly CREATE_MANY_SUCCESS: "translation.key.create.many.success";
18
- readonly GET_SUCCESS: "translation.key.get.success";
19
- readonly GET_ALL_SUCCESS: "translation.key.get.all.success";
20
- readonly UPDATE_SUCCESS: "translation.key.update.success";
21
- readonly UPDATE_MANY_SUCCESS: "translation.key.update.many.success";
22
- readonly DELETE_SUCCESS: "translation.key.delete.success";
23
- readonly RESTORE_SUCCESS: "translation.key.restore.success";
24
- readonly NOT_FOUND: "translation.key.not.found";
25
- readonly IMPORT_SUCCESS: "translation.key.import.success";
26
- readonly EXPORT_SUCCESS: "translation.key.export.success";
27
7
  readonly MODULES_SUCCESS: "translation.key.modules.success";
28
8
  readonly READONLY_DELETE_FORBIDDEN: "translation.key.readonly.delete.forbidden";
29
9
  readonly READONLY_UPDATE_FORBIDDEN: "translation.key.readonly.update.forbidden";
30
10
  readonly DUPLICATE_KEY_IN_MODULE: "translation.key.duplicate.key.in.module";
31
11
  };
32
12
  export declare const TRANSLATION_MESSAGES: {
33
- readonly CREATE_SUCCESS: "translation.create.success";
34
- readonly CREATE_MANY_SUCCESS: "translation.create.many.success";
35
- readonly GET_SUCCESS: "translation.get.success";
36
13
  readonly GET_ALL_SUCCESS: "translation.get.all.success";
37
- readonly UPDATE_SUCCESS: "translation.update.success";
38
14
  readonly UPDATE_MANY_SUCCESS: "translation.update.many.success";
39
- readonly DELETE_SUCCESS: "translation.delete.success";
40
- readonly RESTORE_SUCCESS: "translation.restore.success";
41
- readonly NOT_FOUND: "translation.not.found";
42
15
  readonly BY_LANGUAGE_SUCCESS: "translation.by.language.success";
43
- readonly BY_MODULE_SUCCESS: "translation.by.module.success";
44
- readonly MISSING_SUCCESS: "translation.missing.success";
45
- readonly SYNC_SUCCESS: "translation.sync.success";
46
- readonly UPDATE_VALUES_SUCCESS: "translation.update.values.success";
47
- };
48
- export declare const LOCALIZATION_MODULE_MESSAGES: {
49
- readonly LANGUAGE: {
50
- readonly CREATE_SUCCESS: "language.create.success";
51
- readonly CREATE_MANY_SUCCESS: "language.create.many.success";
52
- readonly GET_SUCCESS: "language.get.success";
53
- readonly GET_ALL_SUCCESS: "language.get.all.success";
54
- readonly UPDATE_SUCCESS: "language.update.success";
55
- readonly UPDATE_MANY_SUCCESS: "language.update.many.success";
56
- readonly DELETE_SUCCESS: "language.delete.success";
57
- readonly RESTORE_SUCCESS: "language.restore.success";
58
- readonly NOT_FOUND: "language.not.found";
59
- readonly ACTIVE_SUCCESS: "language.active.success";
60
- readonly SET_DEFAULT_SUCCESS: "language.set.default.success";
61
- readonly GET_DEFAULT_SUCCESS: "language.get.default.success";
62
- };
63
- readonly TRANSLATION_KEY: {
64
- readonly CREATE_SUCCESS: "translation.key.create.success";
65
- readonly CREATE_MANY_SUCCESS: "translation.key.create.many.success";
66
- readonly GET_SUCCESS: "translation.key.get.success";
67
- readonly GET_ALL_SUCCESS: "translation.key.get.all.success";
68
- readonly UPDATE_SUCCESS: "translation.key.update.success";
69
- readonly UPDATE_MANY_SUCCESS: "translation.key.update.many.success";
70
- readonly DELETE_SUCCESS: "translation.key.delete.success";
71
- readonly RESTORE_SUCCESS: "translation.key.restore.success";
72
- readonly NOT_FOUND: "translation.key.not.found";
73
- readonly IMPORT_SUCCESS: "translation.key.import.success";
74
- readonly EXPORT_SUCCESS: "translation.key.export.success";
75
- readonly MODULES_SUCCESS: "translation.key.modules.success";
76
- readonly READONLY_DELETE_FORBIDDEN: "translation.key.readonly.delete.forbidden";
77
- readonly READONLY_UPDATE_FORBIDDEN: "translation.key.readonly.update.forbidden";
78
- readonly DUPLICATE_KEY_IN_MODULE: "translation.key.duplicate.key.in.module";
79
- };
80
- readonly TRANSLATION: {
81
- readonly CREATE_SUCCESS: "translation.create.success";
82
- readonly CREATE_MANY_SUCCESS: "translation.create.many.success";
83
- readonly GET_SUCCESS: "translation.get.success";
84
- readonly GET_ALL_SUCCESS: "translation.get.all.success";
85
- readonly UPDATE_SUCCESS: "translation.update.success";
86
- readonly UPDATE_MANY_SUCCESS: "translation.update.many.success";
87
- readonly DELETE_SUCCESS: "translation.delete.success";
88
- readonly RESTORE_SUCCESS: "translation.restore.success";
89
- readonly NOT_FOUND: "translation.not.found";
90
- readonly BY_LANGUAGE_SUCCESS: "translation.by.language.success";
91
- readonly BY_MODULE_SUCCESS: "translation.by.module.success";
92
- readonly MISSING_SUCCESS: "translation.missing.success";
93
- readonly SYNC_SUCCESS: "translation.sync.success";
94
- readonly UPDATE_VALUES_SUCCESS: "translation.update.values.success";
95
- };
96
16
  };
@@ -1,7 +1,6 @@
1
- import { ListResponseDto, SingleResponseDto } from '@flusys/nestjs-shared/dtos';
1
+ import { SingleResponseDto } from '@flusys/nestjs-shared/dtos';
2
2
  import { ILoggedUserInfo } from '@flusys/nestjs-shared/interfaces';
3
- import { CreateTranslationKeyDto, GetByModuleDto, TranslationKeyResponseDto, UpdateTranslationKeyDto } from '../dtos';
4
- import { ITranslationKey } from '../interfaces';
3
+ import { CreateTranslationKeyDto, TranslationKeyResponseDto, UpdateTranslationKeyDto } from '../dtos';
5
4
  import { TranslationKeyService } from '../services';
6
5
  declare const TranslationKeyController_base: abstract new (service: TranslationKeyService) => {
7
6
  readonly enabledEndpoints: import("@flusys/nestjs-shared/classes").ApiEndpoint[] | "all";
@@ -10,18 +9,17 @@ declare const TranslationKeyController_base: abstract new (service: TranslationK
10
9
  insert(addDto: CreateTranslationKeyDto, user: ILoggedUserInfo | null): Promise<SingleResponseDto<TranslationKeyResponseDto>>;
11
10
  insertMany(addDto: CreateTranslationKeyDto[], user: ILoggedUserInfo | null): Promise<import("@flusys/nestjs-shared/dtos").BulkResponseDto<TranslationKeyResponseDto>>;
12
11
  getById(id: string, body: import("@flusys/nestjs-shared/dtos").GetByIdBodyDto, user: ILoggedUserInfo | null): Promise<SingleResponseDto<TranslationKeyResponseDto>>;
13
- getByIds(body: import("@flusys/nestjs-shared/dtos").GetByIdsDto, user: ILoggedUserInfo | null): Promise<ListResponseDto<TranslationKeyResponseDto>>;
12
+ getByIds(body: import("@flusys/nestjs-shared/dtos").GetByIdsDto, user: ILoggedUserInfo | null): Promise<import("@flusys/nestjs-shared/dtos").ListResponseDto<TranslationKeyResponseDto>>;
14
13
  update(updateDto: UpdateTranslationKeyDto, user: ILoggedUserInfo | null): Promise<SingleResponseDto<TranslationKeyResponseDto>>;
15
14
  updateMany(updateDtos: UpdateTranslationKeyDto[], user: ILoggedUserInfo | null): Promise<import("@flusys/nestjs-shared/dtos").BulkResponseDto<TranslationKeyResponseDto>>;
16
15
  bulkUpsert(dtos: (CreateTranslationKeyDto | UpdateTranslationKeyDto)[], user: ILoggedUserInfo | null): Promise<import("@flusys/nestjs-shared/dtos").BulkResponseDto<TranslationKeyResponseDto>>;
17
16
  getByFilter(filter: Record<string, any>, user: ILoggedUserInfo | null): Promise<SingleResponseDto<TranslationKeyResponseDto>>;
18
- getAll(filterAndPaginationDto: import("@flusys/nestjs-shared/dtos").FilterAndPaginationDto, user: ILoggedUserInfo | null, search?: string): Promise<ListResponseDto<TranslationKeyResponseDto>>;
17
+ getAll(filterAndPaginationDto: import("@flusys/nestjs-shared/dtos").FilterAndPaginationDto, user: ILoggedUserInfo | null, search?: string): Promise<import("@flusys/nestjs-shared/dtos").ListResponseDto<TranslationKeyResponseDto>>;
19
18
  delete(deleteDto: import("@flusys/nestjs-shared/dtos").DeleteDto, user: ILoggedUserInfo | null): Promise<import("@flusys/nestjs-shared/dtos").MessageResponseDto>;
20
19
  };
21
20
  export declare class TranslationKeyController extends TranslationKeyController_base {
22
21
  service: TranslationKeyService;
23
22
  constructor(service: TranslationKeyService);
24
23
  getModules(_user: ILoggedUserInfo): Promise<SingleResponseDto<string[]>>;
25
- getByModule(body: GetByModuleDto, _user: ILoggedUserInfo): Promise<ListResponseDto<ITranslationKey>>;
26
24
  }
27
25
  export {};
@@ -1,7 +1,7 @@
1
- import { BulkResponseDto, ListResponseDto, SingleResponseDto } from '@flusys/nestjs-shared/dtos';
1
+ import { BulkResponseDto, SingleResponseDto } from '@flusys/nestjs-shared/dtos';
2
2
  import { ILoggedUserInfo } from '@flusys/nestjs-shared/interfaces';
3
- import { BulkUpdateTranslationsDto, CreateTranslationDto, GetTranslationsByLanguageDto, GetTranslationsByModuleDto, TranslationResponseDto, UpdateTranslationDto } from '../dtos';
4
- import { ITranslation, ITranslationKey, ITranslationsMap } from '../interfaces';
3
+ import { BulkUpdateTranslationsDto, CreateTranslationDto, GetTranslationsByLanguageDto, TranslationResponseDto, UpdateTranslationDto } from '../dtos';
4
+ import { ITranslation, ITranslationsMap } from '../interfaces';
5
5
  import { TranslationService } from '../services';
6
6
  declare const TranslationController_base: abstract new (service: TranslationService) => {
7
7
  readonly enabledEndpoints: import("@flusys/nestjs-shared/classes").ApiEndpoint[] | "all";
@@ -10,21 +10,19 @@ declare const TranslationController_base: abstract new (service: TranslationServ
10
10
  insert(addDto: CreateTranslationDto, user: ILoggedUserInfo | null): Promise<SingleResponseDto<TranslationResponseDto>>;
11
11
  insertMany(addDto: CreateTranslationDto[], user: ILoggedUserInfo | null): Promise<BulkResponseDto<TranslationResponseDto>>;
12
12
  getById(id: string, body: import("@flusys/nestjs-shared/dtos").GetByIdBodyDto, user: ILoggedUserInfo | null): Promise<SingleResponseDto<TranslationResponseDto>>;
13
- getByIds(body: import("@flusys/nestjs-shared/dtos").GetByIdsDto, user: ILoggedUserInfo | null): Promise<ListResponseDto<TranslationResponseDto>>;
13
+ getByIds(body: import("@flusys/nestjs-shared/dtos").GetByIdsDto, user: ILoggedUserInfo | null): Promise<import("@flusys/nestjs-shared/dtos").ListResponseDto<TranslationResponseDto>>;
14
14
  update(updateDto: UpdateTranslationDto, user: ILoggedUserInfo | null): Promise<SingleResponseDto<TranslationResponseDto>>;
15
15
  updateMany(updateDtos: UpdateTranslationDto[], user: ILoggedUserInfo | null): Promise<BulkResponseDto<TranslationResponseDto>>;
16
16
  bulkUpsert(dtos: (CreateTranslationDto | UpdateTranslationDto)[], user: ILoggedUserInfo | null): Promise<BulkResponseDto<TranslationResponseDto>>;
17
17
  getByFilter(filter: Record<string, any>, user: ILoggedUserInfo | null): Promise<SingleResponseDto<TranslationResponseDto>>;
18
- getAll(filterAndPaginationDto: import("@flusys/nestjs-shared/dtos").FilterAndPaginationDto, user: ILoggedUserInfo | null, search?: string): Promise<ListResponseDto<TranslationResponseDto>>;
18
+ getAll(filterAndPaginationDto: import("@flusys/nestjs-shared/dtos").FilterAndPaginationDto, user: ILoggedUserInfo | null, search?: string): Promise<import("@flusys/nestjs-shared/dtos").ListResponseDto<TranslationResponseDto>>;
19
19
  delete(deleteDto: import("@flusys/nestjs-shared/dtos").DeleteDto, user: ILoggedUserInfo | null): Promise<import("@flusys/nestjs-shared/dtos").MessageResponseDto>;
20
20
  };
21
21
  export declare class TranslationController extends TranslationController_base {
22
22
  service: TranslationService;
23
23
  constructor(service: TranslationService);
24
24
  getByLanguage(body: GetTranslationsByLanguageDto): Promise<SingleResponseDto<ITranslationsMap>>;
25
- getByModule(body: GetTranslationsByModuleDto): Promise<SingleResponseDto<ITranslationsMap>>;
26
25
  updateManyValues(body: BulkUpdateTranslationsDto, _user: ILoggedUserInfo): Promise<BulkResponseDto<ITranslation>>;
27
- getMissing(body: GetTranslationsByLanguageDto, _user: ILoggedUserInfo): Promise<ListResponseDto<ITranslationKey>>;
28
26
  getCounts(_user: ILoggedUserInfo): Promise<SingleResponseDto<Record<string, number>>>;
29
27
  }
30
28
  export {};
@@ -0,0 +1 @@
1
+ export { localizationSwaggerConfig } from './localization-swagger.config';
@@ -0,0 +1,4 @@
1
+ import { IModuleSwaggerOptions } from '@flusys/nestjs-core/docs';
2
+ export declare function localizationSwaggerConfig(bootstrapConfig?: {
3
+ databaseMode?: string;
4
+ }): IModuleSwaggerOptions;
@@ -23,7 +23,4 @@ export declare class TranslationKeyResponseDto extends IdentityResponseDto {
23
23
  isReadonly: boolean;
24
24
  serial: number | null;
25
25
  }
26
- export declare class GetByModuleDto {
27
- module: string;
28
- }
29
26
  export {};
@@ -35,8 +35,4 @@ export declare class GetTranslationsByLanguageDto {
35
35
  languageCode: string;
36
36
  modules?: string[];
37
37
  }
38
- export declare class GetTranslationsByModuleDto {
39
- module: string;
40
- languageCode: string;
41
- }
42
38
  export {};
@@ -1,2 +1 @@
1
1
  export const LOCALIZATION_MODULE_OPTIONS = 'LOCALIZATION_MODULE_OPTIONS';
2
- export const DEFAULT_LANGUAGE_CODE = 'en';
@@ -1,54 +1,17 @@
1
1
  // ==================== LOCALIZATION MODULE MESSAGE KEYS ====================
2
2
  export const LANGUAGE_MESSAGES = {
3
- CREATE_SUCCESS: 'language.create.success',
4
- CREATE_MANY_SUCCESS: 'language.create.many.success',
5
- GET_SUCCESS: 'language.get.success',
6
- GET_ALL_SUCCESS: 'language.get.all.success',
7
- UPDATE_SUCCESS: 'language.update.success',
8
- UPDATE_MANY_SUCCESS: 'language.update.many.success',
9
- DELETE_SUCCESS: 'language.delete.success',
10
- RESTORE_SUCCESS: 'language.restore.success',
11
- NOT_FOUND: 'language.not.found',
12
3
  ACTIVE_SUCCESS: 'language.active.success',
13
4
  SET_DEFAULT_SUCCESS: 'language.set.default.success',
14
5
  GET_DEFAULT_SUCCESS: 'language.get.default.success'
15
6
  };
16
7
  export const TRANSLATION_KEY_MESSAGES = {
17
- CREATE_SUCCESS: 'translation.key.create.success',
18
- CREATE_MANY_SUCCESS: 'translation.key.create.many.success',
19
- GET_SUCCESS: 'translation.key.get.success',
20
- GET_ALL_SUCCESS: 'translation.key.get.all.success',
21
- UPDATE_SUCCESS: 'translation.key.update.success',
22
- UPDATE_MANY_SUCCESS: 'translation.key.update.many.success',
23
- DELETE_SUCCESS: 'translation.key.delete.success',
24
- RESTORE_SUCCESS: 'translation.key.restore.success',
25
- NOT_FOUND: 'translation.key.not.found',
26
- IMPORT_SUCCESS: 'translation.key.import.success',
27
- EXPORT_SUCCESS: 'translation.key.export.success',
28
8
  MODULES_SUCCESS: 'translation.key.modules.success',
29
9
  READONLY_DELETE_FORBIDDEN: 'translation.key.readonly.delete.forbidden',
30
10
  READONLY_UPDATE_FORBIDDEN: 'translation.key.readonly.update.forbidden',
31
11
  DUPLICATE_KEY_IN_MODULE: 'translation.key.duplicate.key.in.module'
32
12
  };
33
13
  export const TRANSLATION_MESSAGES = {
34
- CREATE_SUCCESS: 'translation.create.success',
35
- CREATE_MANY_SUCCESS: 'translation.create.many.success',
36
- GET_SUCCESS: 'translation.get.success',
37
14
  GET_ALL_SUCCESS: 'translation.get.all.success',
38
- UPDATE_SUCCESS: 'translation.update.success',
39
15
  UPDATE_MANY_SUCCESS: 'translation.update.many.success',
40
- DELETE_SUCCESS: 'translation.delete.success',
41
- RESTORE_SUCCESS: 'translation.restore.success',
42
- NOT_FOUND: 'translation.not.found',
43
- BY_LANGUAGE_SUCCESS: 'translation.by.language.success',
44
- BY_MODULE_SUCCESS: 'translation.by.module.success',
45
- MISSING_SUCCESS: 'translation.missing.success',
46
- SYNC_SUCCESS: 'translation.sync.success',
47
- UPDATE_VALUES_SUCCESS: 'translation.update.values.success'
48
- };
49
- // Aggregated export for backward compatibility
50
- export const LOCALIZATION_MODULE_MESSAGES = {
51
- LANGUAGE: LANGUAGE_MESSAGES,
52
- TRANSLATION_KEY: TRANSLATION_KEY_MESSAGES,
53
- TRANSLATION: TRANSLATION_MESSAGES
16
+ BY_LANGUAGE_SUCCESS: 'translation.by.language.success'
54
17
  };