@flusys/nestjs-localization 5.0.3 → 5.1.0
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/cjs/controllers/language.controller.js +2 -2
- package/cjs/controllers/translation-key.controller.js +0 -1
- package/cjs/controllers/translation.controller.js +3 -3
- package/cjs/services/translation-key.service.js +1 -1
- package/fesm/controllers/language.controller.js +3 -3
- package/fesm/controllers/translation-key.controller.js +1 -2
- package/fesm/controllers/translation.controller.js +4 -4
- package/fesm/services/translation-key.service.js +1 -1
- package/fesm/services/translation.service.js +1 -1
- package/package.json +3 -3
- package/services/language.service.d.ts +2 -2
- package/services/translation-key.service.d.ts +2 -2
- package/services/translation.service.d.ts +3 -3
|
@@ -10,11 +10,11 @@ Object.defineProperty(exports, "LanguageController", {
|
|
|
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) {
|
|
@@ -158,7 +158,7 @@ _ts_decorate([
|
|
|
158
158
|
], LanguageController.prototype, "getDefault", null);
|
|
159
159
|
_ts_decorate([
|
|
160
160
|
(0, _common.Post)('set-default'),
|
|
161
|
-
(0, _common.UseGuards)(_guards.JwtAuthGuard),
|
|
161
|
+
(0, _common.UseGuards)(_guards.JwtAuthGuard, _guards.PermissionGuard),
|
|
162
162
|
(0, _swagger.ApiBearerAuth)(),
|
|
163
163
|
(0, _decorators.RequirePermission)(_classes.LANGUAGE_PERMISSIONS.UPDATE),
|
|
164
164
|
(0, _swagger.ApiOperation)({
|
|
@@ -108,7 +108,6 @@ _ts_decorate([
|
|
|
108
108
|
(0, _common.Post)('get-modules'),
|
|
109
109
|
(0, _common.UseGuards)(_guards.JwtAuthGuard),
|
|
110
110
|
(0, _swagger.ApiBearerAuth)(),
|
|
111
|
-
(0, _decorators.RequirePermission)(_classes.TRANSLATION_KEY_PERMISSIONS.READ),
|
|
112
111
|
(0, _swagger.ApiOperation)({
|
|
113
112
|
summary: 'Get all distinct module names'
|
|
114
113
|
}),
|
|
@@ -10,11 +10,11 @@ Object.defineProperty(exports, "TranslationController", {
|
|
|
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) {
|
|
@@ -145,7 +145,7 @@ _ts_decorate([
|
|
|
145
145
|
], TranslationController.prototype, "getByLanguage", null);
|
|
146
146
|
_ts_decorate([
|
|
147
147
|
(0, _common.Post)('update-many-values'),
|
|
148
|
-
(0, _common.UseGuards)(_guards.JwtAuthGuard),
|
|
148
|
+
(0, _common.UseGuards)(_guards.JwtAuthGuard, _guards.PermissionGuard),
|
|
149
149
|
(0, _swagger.ApiBearerAuth)(),
|
|
150
150
|
(0, _decorators.RequirePermission)(_classes.TRANSLATION_PERMISSIONS.UPDATE),
|
|
151
151
|
(0, _swagger.ApiOperation)({
|
|
@@ -168,7 +168,7 @@ _ts_decorate([
|
|
|
168
168
|
], TranslationController.prototype, "updateManyValues", null);
|
|
169
169
|
_ts_decorate([
|
|
170
170
|
(0, _common.Post)('get-counts'),
|
|
171
|
-
(0, _common.UseGuards)(_guards.JwtAuthGuard),
|
|
171
|
+
(0, _common.UseGuards)(_guards.JwtAuthGuard, _guards.PermissionGuard),
|
|
172
172
|
(0, _swagger.ApiBearerAuth)(),
|
|
173
173
|
(0, _decorators.RequirePermission)(_classes.TRANSLATION_PERMISSIONS.READ),
|
|
174
174
|
(0, _swagger.ApiOperation)({
|
|
@@ -9,10 +9,10 @@ Object.defineProperty(exports, "TranslationKeyService", {
|
|
|
9
9
|
}
|
|
10
10
|
});
|
|
11
11
|
const _classes = require("@flusys/nestjs-shared/classes");
|
|
12
|
-
const _config = require("../config");
|
|
13
12
|
const _modules = require("@flusys/nestjs-shared/modules");
|
|
14
13
|
const _common = require("@nestjs/common");
|
|
15
14
|
const _typeorm = require("typeorm");
|
|
15
|
+
const _config = require("../config");
|
|
16
16
|
const _entities = require("../entities");
|
|
17
17
|
const _localizationdatasourceprovider = require("./localization-datasource.provider");
|
|
18
18
|
function _define_property(obj, key, value) {
|
|
@@ -27,11 +27,11 @@ function _ts_param(paramIndex, decorator) {
|
|
|
27
27
|
}
|
|
28
28
|
import { createApiController, LANGUAGE_PERMISSIONS } from '@flusys/nestjs-shared/classes';
|
|
29
29
|
import { CurrentUser, RequirePermission } from '@flusys/nestjs-shared/decorators';
|
|
30
|
-
import {
|
|
31
|
-
import { JwtAuthGuard } from '@flusys/nestjs-shared/guards';
|
|
30
|
+
import { JwtAuthGuard, PermissionGuard } from '@flusys/nestjs-shared/guards';
|
|
32
31
|
import { ILoggedUserInfo } from '@flusys/nestjs-shared/interfaces';
|
|
33
32
|
import { Body, Controller, Inject, Post, UseGuards } from '@nestjs/common';
|
|
34
33
|
import { ApiBearerAuth, ApiOperation, ApiResponse, ApiTags } from '@nestjs/swagger';
|
|
34
|
+
import { LANGUAGE_MESSAGES } from '../config';
|
|
35
35
|
import { CreateLanguageDto, LanguageResponseDto, UpdateLanguageDto } from '../dtos';
|
|
36
36
|
import { LanguageService } from '../services';
|
|
37
37
|
export class LanguageController extends createApiController(CreateLanguageDto, UpdateLanguageDto, LanguageResponseDto, {
|
|
@@ -148,7 +148,7 @@ _ts_decorate([
|
|
|
148
148
|
], LanguageController.prototype, "getDefault", null);
|
|
149
149
|
_ts_decorate([
|
|
150
150
|
Post('set-default'),
|
|
151
|
-
UseGuards(JwtAuthGuard),
|
|
151
|
+
UseGuards(JwtAuthGuard, PermissionGuard),
|
|
152
152
|
ApiBearerAuth(),
|
|
153
153
|
RequirePermission(LANGUAGE_PERMISSIONS.UPDATE),
|
|
154
154
|
ApiOperation({
|
|
@@ -26,7 +26,7 @@ function _ts_param(paramIndex, decorator) {
|
|
|
26
26
|
};
|
|
27
27
|
}
|
|
28
28
|
import { createApiController, TRANSLATION_KEY_PERMISSIONS } from '@flusys/nestjs-shared/classes';
|
|
29
|
-
import { CurrentUser
|
|
29
|
+
import { CurrentUser } from '@flusys/nestjs-shared/decorators';
|
|
30
30
|
import { JwtAuthGuard } from '@flusys/nestjs-shared/guards';
|
|
31
31
|
import { ILoggedUserInfo } from '@flusys/nestjs-shared/interfaces';
|
|
32
32
|
import { Controller, Inject, Post, UseGuards } from '@nestjs/common';
|
|
@@ -98,7 +98,6 @@ _ts_decorate([
|
|
|
98
98
|
Post('get-modules'),
|
|
99
99
|
UseGuards(JwtAuthGuard),
|
|
100
100
|
ApiBearerAuth(),
|
|
101
|
-
RequirePermission(TRANSLATION_KEY_PERMISSIONS.READ),
|
|
102
101
|
ApiOperation({
|
|
103
102
|
summary: 'Get all distinct module names'
|
|
104
103
|
}),
|
|
@@ -27,11 +27,11 @@ function _ts_param(paramIndex, decorator) {
|
|
|
27
27
|
}
|
|
28
28
|
import { createApiController, TRANSLATION_PERMISSIONS } from '@flusys/nestjs-shared/classes';
|
|
29
29
|
import { CurrentUser, RequirePermission } from '@flusys/nestjs-shared/decorators';
|
|
30
|
-
import {
|
|
31
|
-
import { JwtAuthGuard } from '@flusys/nestjs-shared/guards';
|
|
30
|
+
import { JwtAuthGuard, PermissionGuard } from '@flusys/nestjs-shared/guards';
|
|
32
31
|
import { ILoggedUserInfo } from '@flusys/nestjs-shared/interfaces';
|
|
33
32
|
import { Body, Controller, Inject, Post, UseGuards } from '@nestjs/common';
|
|
34
33
|
import { ApiBearerAuth, ApiOperation, ApiResponse, ApiTags } from '@nestjs/swagger';
|
|
34
|
+
import { TRANSLATION_MESSAGES } from '../config';
|
|
35
35
|
import { BulkUpdateTranslationsDto, CreateTranslationDto, GetTranslationsByLanguageDto, TranslationResponseDto, UpdateTranslationDto } from '../dtos';
|
|
36
36
|
import { TranslationService } from '../services';
|
|
37
37
|
export class TranslationController extends createApiController(CreateTranslationDto, UpdateTranslationDto, TranslationResponseDto, {
|
|
@@ -135,7 +135,7 @@ _ts_decorate([
|
|
|
135
135
|
], TranslationController.prototype, "getByLanguage", null);
|
|
136
136
|
_ts_decorate([
|
|
137
137
|
Post('update-many-values'),
|
|
138
|
-
UseGuards(JwtAuthGuard),
|
|
138
|
+
UseGuards(JwtAuthGuard, PermissionGuard),
|
|
139
139
|
ApiBearerAuth(),
|
|
140
140
|
RequirePermission(TRANSLATION_PERMISSIONS.UPDATE),
|
|
141
141
|
ApiOperation({
|
|
@@ -158,7 +158,7 @@ _ts_decorate([
|
|
|
158
158
|
], TranslationController.prototype, "updateManyValues", null);
|
|
159
159
|
_ts_decorate([
|
|
160
160
|
Post('get-counts'),
|
|
161
|
-
UseGuards(JwtAuthGuard),
|
|
161
|
+
UseGuards(JwtAuthGuard, PermissionGuard),
|
|
162
162
|
ApiBearerAuth(),
|
|
163
163
|
RequirePermission(TRANSLATION_PERMISSIONS.READ),
|
|
164
164
|
ApiOperation({
|
|
@@ -26,10 +26,10 @@ function _ts_param(paramIndex, decorator) {
|
|
|
26
26
|
};
|
|
27
27
|
}
|
|
28
28
|
import { HybridCache, RequestScopedApiService } from '@flusys/nestjs-shared/classes';
|
|
29
|
-
import { TRANSLATION_KEY_MESSAGES } from '../config';
|
|
30
29
|
import { UtilsService } from '@flusys/nestjs-shared/modules';
|
|
31
30
|
import { BadRequestException, ForbiddenException, Inject, Injectable, Scope } from '@nestjs/common';
|
|
32
31
|
import { In, IsNull } from 'typeorm';
|
|
32
|
+
import { TRANSLATION_KEY_MESSAGES } from '../config';
|
|
33
33
|
import { TranslationKey } from '../entities';
|
|
34
34
|
import { LocalizationDataSourceProvider } from './localization-datasource.provider';
|
|
35
35
|
export class TranslationKeyService extends RequestScopedApiService {
|
|
@@ -29,7 +29,7 @@ import { HybridCache, RequestScopedApiService } from '@flusys/nestjs-shared/clas
|
|
|
29
29
|
import { UtilsService } from '@flusys/nestjs-shared/modules';
|
|
30
30
|
import { Inject, Injectable, Scope } from '@nestjs/common';
|
|
31
31
|
import { In, IsNull } from 'typeorm';
|
|
32
|
-
import {
|
|
32
|
+
import { Language, Translation, TranslationKey } from '../entities';
|
|
33
33
|
import { LocalizationDataSourceProvider } from './localization-datasource.provider';
|
|
34
34
|
export class TranslationService extends RequestScopedApiService {
|
|
35
35
|
resolveEntity() {
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@flusys/nestjs-localization",
|
|
3
|
-
"version": "5.0
|
|
3
|
+
"version": "5.1.0",
|
|
4
4
|
"description": "Localization module for multi-language support",
|
|
5
5
|
"main": "cjs/index.js",
|
|
6
6
|
"module": "fesm/index.js",
|
|
@@ -80,7 +80,7 @@
|
|
|
80
80
|
"express": "^4.18.0"
|
|
81
81
|
},
|
|
82
82
|
"dependencies": {
|
|
83
|
-
"@flusys/nestjs-core": "5.0
|
|
84
|
-
"@flusys/nestjs-shared": "5.0
|
|
83
|
+
"@flusys/nestjs-core": "5.1.0",
|
|
84
|
+
"@flusys/nestjs-shared": "5.1.0"
|
|
85
85
|
}
|
|
86
86
|
}
|
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
import { HybridCache, RequestScopedApiService } from '@flusys/nestjs-shared/classes';
|
|
2
2
|
import { UtilsService } from '@flusys/nestjs-shared/modules';
|
|
3
|
-
import { EntityTarget
|
|
3
|
+
import { EntityTarget } from 'typeorm';
|
|
4
4
|
import { CreateLanguageDto, UpdateLanguageDto } from '../dtos';
|
|
5
5
|
import { Language } from '../entities';
|
|
6
6
|
import { ILanguage } from '../interfaces';
|
|
7
7
|
import { LocalizationDataSourceProvider } from './localization-datasource.provider';
|
|
8
|
-
export declare class LanguageService extends RequestScopedApiService<CreateLanguageDto, UpdateLanguageDto, ILanguage, Language
|
|
8
|
+
export declare class LanguageService extends RequestScopedApiService<CreateLanguageDto, UpdateLanguageDto, ILanguage, Language> {
|
|
9
9
|
protected cacheManager: HybridCache;
|
|
10
10
|
protected utilsService: UtilsService;
|
|
11
11
|
private readonly dataSourceProvider;
|
|
@@ -2,12 +2,12 @@ import { HybridCache, RequestScopedApiService } from '@flusys/nestjs-shared/clas
|
|
|
2
2
|
import { DeleteDto } from '@flusys/nestjs-shared/dtos';
|
|
3
3
|
import { ILoggedUserInfo } from '@flusys/nestjs-shared/interfaces';
|
|
4
4
|
import { UtilsService } from '@flusys/nestjs-shared/modules';
|
|
5
|
-
import { EntityTarget, QueryRunner
|
|
5
|
+
import { EntityTarget, QueryRunner } from 'typeorm';
|
|
6
6
|
import { CreateTranslationKeyDto, UpdateTranslationKeyDto } from '../dtos';
|
|
7
7
|
import { TranslationKey } from '../entities';
|
|
8
8
|
import { ITranslationKey } from '../interfaces';
|
|
9
9
|
import { LocalizationDataSourceProvider } from './localization-datasource.provider';
|
|
10
|
-
export declare class TranslationKeyService extends RequestScopedApiService<CreateTranslationKeyDto, UpdateTranslationKeyDto, ITranslationKey, TranslationKey
|
|
10
|
+
export declare class TranslationKeyService extends RequestScopedApiService<CreateTranslationKeyDto, UpdateTranslationKeyDto, ITranslationKey, TranslationKey> {
|
|
11
11
|
protected cacheManager: HybridCache;
|
|
12
12
|
protected utilsService: UtilsService;
|
|
13
13
|
private readonly dataSourceProvider;
|
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
import { HybridCache, RequestScopedApiService } from '@flusys/nestjs-shared/classes';
|
|
2
2
|
import { ILoggedUserInfo } from '@flusys/nestjs-shared/interfaces';
|
|
3
3
|
import { UtilsService } from '@flusys/nestjs-shared/modules';
|
|
4
|
-
import { EntityTarget,
|
|
5
|
-
import { CreateTranslationDto, UpdateTranslationDto
|
|
4
|
+
import { EntityTarget, SelectQueryBuilder } from 'typeorm';
|
|
5
|
+
import { BulkUpdateTranslationDto, CreateTranslationDto, UpdateTranslationDto } from '../dtos';
|
|
6
6
|
import { Translation, TranslationKey } from '../entities';
|
|
7
7
|
import { ITranslation, ITranslationsMap } from '../interfaces';
|
|
8
8
|
import { LocalizationDataSourceProvider } from './localization-datasource.provider';
|
|
9
|
-
export declare class TranslationService extends RequestScopedApiService<CreateTranslationDto, UpdateTranslationDto, ITranslation, Translation
|
|
9
|
+
export declare class TranslationService extends RequestScopedApiService<CreateTranslationDto, UpdateTranslationDto, ITranslation, Translation> {
|
|
10
10
|
protected cacheManager: HybridCache;
|
|
11
11
|
protected utilsService: UtilsService;
|
|
12
12
|
private readonly dataSourceProvider;
|