hh-contracts 0.0.57 → 0.0.59
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/build/common/constants/{icon-key.constant.js → icon-keys.constant.js} +12 -3
- package/build/common/constants/index.js +1 -1
- package/build/common/constants/locales.constant.js +3 -3
- package/build/index.js +1 -0
- package/build/translate/contracts/get-translate.contract.js +22 -0
- package/build/translate/contracts/index.js +17 -0
- package/build/translate/index.js +18 -0
- package/build/translate/translate.api.js +11 -0
- package/common/constants/{icon-key.constant.ts → icon-keys.constant.ts} +12 -4
- package/common/constants/index.ts +1 -1
- package/common/constants/locales.constant.ts +1 -1
- package/index.ts +1 -0
- package/package.json +1 -1
- package/translate/contracts/get-translate.contract.ts +25 -0
- package/translate/contracts/index.ts +1 -0
- package/translate/index.ts +2 -0
- package/translate/translate.api.ts +10 -0
|
@@ -5,18 +5,27 @@ exports.ICON_KEYS = {
|
|
|
5
5
|
// eye: 'eye',
|
|
6
6
|
// eyeSlash: 'eyeSlash',
|
|
7
7
|
chevronDown: 'chevronDown',
|
|
8
|
+
chevronLeft: 'chevronLeft',
|
|
9
|
+
chevronRight: 'chevronRight',
|
|
10
|
+
arrowDown: 'arrowDown',
|
|
11
|
+
arrowUp: 'arrowUp',
|
|
8
12
|
moon: 'moon',
|
|
9
13
|
sun: 'sun',
|
|
10
14
|
// user: 'user',
|
|
11
15
|
menu: 'menu',
|
|
16
|
+
ellipsis: 'ellipsis',
|
|
17
|
+
filter: 'filter',
|
|
18
|
+
resetFilter: 'resetFilter',
|
|
19
|
+
sorting: 'sorting',
|
|
20
|
+
create: 'create',
|
|
21
|
+
edit: 'edit',
|
|
22
|
+
delete: 'delete',
|
|
23
|
+
search: 'search',
|
|
12
24
|
language: 'language',
|
|
13
25
|
// close: 'close',
|
|
14
26
|
// check: 'check',
|
|
15
27
|
// closeFilled: 'closeFilled',
|
|
16
28
|
logo: 'logo',
|
|
17
|
-
housekeeping: 'housekeeping',
|
|
18
29
|
flagGB: 'flagGB',
|
|
19
30
|
flagRU: 'flagRU',
|
|
20
|
-
radioBase: 'radioBase',
|
|
21
|
-
radioChecked: 'radioChecked',
|
|
22
31
|
};
|
|
@@ -19,7 +19,7 @@ __exportStar(require("./app-errors.constant"), exports);
|
|
|
19
19
|
__exportStar(require("./locales.constant"), exports);
|
|
20
20
|
__exportStar(require("./default-pagination-config.constant"), exports);
|
|
21
21
|
__exportStar(require("./http-method.constant"), exports);
|
|
22
|
-
__exportStar(require("./icon-
|
|
22
|
+
__exportStar(require("./icon-keys.constant"), exports);
|
|
23
23
|
__exportStar(require("./entity.constant"), exports);
|
|
24
24
|
__exportStar(require("./navigation-item-type.constant"), exports);
|
|
25
25
|
__exportStar(require("./order-direction.constant"), exports);
|
|
@@ -1,19 +1,19 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.LANGUAGE_KEYS = exports.LANGUAGES = void 0;
|
|
4
|
-
const
|
|
4
|
+
const icon_keys_constant_1 = require("./icon-keys.constant");
|
|
5
5
|
exports.LANGUAGES = {
|
|
6
6
|
en: {
|
|
7
7
|
value: 'en',
|
|
8
8
|
label: 'English',
|
|
9
|
-
flag:
|
|
9
|
+
flag: icon_keys_constant_1.ICON_KEYS.flagGB,
|
|
10
10
|
locale: 'en-US',
|
|
11
11
|
postgressLocale: 'en_US',
|
|
12
12
|
},
|
|
13
13
|
ru: {
|
|
14
14
|
value: 'ru',
|
|
15
15
|
label: 'Русский',
|
|
16
|
-
flag:
|
|
16
|
+
flag: icon_keys_constant_1.ICON_KEYS.flagRU,
|
|
17
17
|
locale: 'ru-RU',
|
|
18
18
|
postgressLocale: 'ru_RU',
|
|
19
19
|
},
|
package/build/index.js
CHANGED
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.BatchTranslateContract = void 0;
|
|
4
|
+
const zod_1 = require("zod");
|
|
5
|
+
const common_1 = require("../../common");
|
|
6
|
+
const translate_api_1 = require("../translate.api");
|
|
7
|
+
const BatchTranslateContractRequestSchema = zod_1.z.object({
|
|
8
|
+
text: zod_1.z.string().min(1),
|
|
9
|
+
fromLang: common_1.LanguageKeysSchema,
|
|
10
|
+
toLangs: zod_1.z.array(common_1.LanguageKeysSchema),
|
|
11
|
+
});
|
|
12
|
+
const BatchTranslateContractResponseSchema = zod_1.z.object({
|
|
13
|
+
translations: zod_1.z.record(common_1.LanguageKeysSchema, zod_1.z.string()),
|
|
14
|
+
});
|
|
15
|
+
var BatchTranslateContract;
|
|
16
|
+
(function (BatchTranslateContract) {
|
|
17
|
+
BatchTranslateContract.getUrl = translate_api_1.TRANSLATE_API.batch;
|
|
18
|
+
BatchTranslateContract.endpoint = translate_api_1.TRANSLATE_CONTROLLER.endpoints.batch;
|
|
19
|
+
BatchTranslateContract.httpMethod = common_1.HTTP_METHODS.post;
|
|
20
|
+
BatchTranslateContract.RequestSchema = BatchTranslateContractRequestSchema;
|
|
21
|
+
BatchTranslateContract.ResponseSchema = BatchTranslateContractResponseSchema;
|
|
22
|
+
})(BatchTranslateContract || (exports.BatchTranslateContract = BatchTranslateContract = {}));
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
3
|
+
if (k2 === undefined) k2 = k;
|
|
4
|
+
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
5
|
+
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
6
|
+
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
7
|
+
}
|
|
8
|
+
Object.defineProperty(o, k2, desc);
|
|
9
|
+
}) : (function(o, m, k, k2) {
|
|
10
|
+
if (k2 === undefined) k2 = k;
|
|
11
|
+
o[k2] = m[k];
|
|
12
|
+
}));
|
|
13
|
+
var __exportStar = (this && this.__exportStar) || function(m, exports) {
|
|
14
|
+
for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
|
|
15
|
+
};
|
|
16
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
17
|
+
__exportStar(require("./get-translate.contract"), exports);
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
3
|
+
if (k2 === undefined) k2 = k;
|
|
4
|
+
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
5
|
+
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
6
|
+
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
7
|
+
}
|
|
8
|
+
Object.defineProperty(o, k2, desc);
|
|
9
|
+
}) : (function(o, m, k, k2) {
|
|
10
|
+
if (k2 === undefined) k2 = k;
|
|
11
|
+
o[k2] = m[k];
|
|
12
|
+
}));
|
|
13
|
+
var __exportStar = (this && this.__exportStar) || function(m, exports) {
|
|
14
|
+
for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
|
|
15
|
+
};
|
|
16
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
17
|
+
__exportStar(require("./translate.api"), exports);
|
|
18
|
+
__exportStar(require("./contracts"), exports);
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.TRANSLATE_API = exports.TRANSLATE_CONTROLLER = void 0;
|
|
4
|
+
const utils_1 = require("../common/utils");
|
|
5
|
+
exports.TRANSLATE_CONTROLLER = {
|
|
6
|
+
prefix: 'translate',
|
|
7
|
+
endpoints: {
|
|
8
|
+
batch: '',
|
|
9
|
+
},
|
|
10
|
+
};
|
|
11
|
+
exports.TRANSLATE_API = (0, utils_1.createApi)(exports.TRANSLATE_CONTROLLER);
|
|
@@ -2,22 +2,30 @@ export const ICON_KEYS = {
|
|
|
2
2
|
// eye: 'eye',
|
|
3
3
|
// eyeSlash: 'eyeSlash',
|
|
4
4
|
chevronDown: 'chevronDown',
|
|
5
|
+
chevronLeft: 'chevronLeft',
|
|
6
|
+
chevronRight: 'chevronRight',
|
|
7
|
+
arrowDown: 'arrowDown',
|
|
8
|
+
arrowUp: 'arrowUp',
|
|
5
9
|
moon: 'moon',
|
|
6
10
|
sun: 'sun',
|
|
7
11
|
// user: 'user',
|
|
8
12
|
menu: 'menu',
|
|
13
|
+
ellipsis: 'ellipsis',
|
|
14
|
+
filter: 'filter',
|
|
15
|
+
resetFilter: 'resetFilter',
|
|
16
|
+
sorting: 'sorting',
|
|
17
|
+
create: 'create',
|
|
18
|
+
edit: 'edit',
|
|
19
|
+
delete: 'delete',
|
|
20
|
+
search: 'search',
|
|
9
21
|
language: 'language',
|
|
10
22
|
// close: 'close',
|
|
11
23
|
// check: 'check',
|
|
12
24
|
|
|
13
25
|
// closeFilled: 'closeFilled',
|
|
14
|
-
|
|
15
26
|
logo: 'logo',
|
|
16
|
-
housekeeping: 'housekeeping',
|
|
17
27
|
flagGB: 'flagGB',
|
|
18
28
|
flagRU: 'flagRU',
|
|
19
|
-
radioBase: 'radioBase',
|
|
20
|
-
radioChecked: 'radioChecked',
|
|
21
29
|
} as const;
|
|
22
30
|
|
|
23
31
|
export type TIconKey = (typeof ICON_KEYS)[keyof typeof ICON_KEYS];
|
|
@@ -3,7 +3,7 @@ export * from './app-errors.constant';
|
|
|
3
3
|
export * from './locales.constant';
|
|
4
4
|
export * from './default-pagination-config.constant';
|
|
5
5
|
export * from './http-method.constant';
|
|
6
|
-
export * from './icon-
|
|
6
|
+
export * from './icon-keys.constant';
|
|
7
7
|
export * from './entity.constant';
|
|
8
8
|
export * from './navigation-item-type.constant';
|
|
9
9
|
export * from './order-direction.constant';
|
package/index.ts
CHANGED
package/package.json
CHANGED
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
import { z } from 'zod';
|
|
2
|
+
import { HTTP_METHODS, LanguageKeysSchema } from '../../common';
|
|
3
|
+
import { TRANSLATE_API, TRANSLATE_CONTROLLER } from '../translate.api';
|
|
4
|
+
|
|
5
|
+
const BatchTranslateContractRequestSchema = z.object({
|
|
6
|
+
text: z.string().min(1),
|
|
7
|
+
fromLang: LanguageKeysSchema,
|
|
8
|
+
toLangs: z.array(LanguageKeysSchema),
|
|
9
|
+
});
|
|
10
|
+
|
|
11
|
+
const BatchTranslateContractResponseSchema = z.object({
|
|
12
|
+
translations: z.record(LanguageKeysSchema, z.string()),
|
|
13
|
+
});
|
|
14
|
+
|
|
15
|
+
export namespace BatchTranslateContract {
|
|
16
|
+
export const getUrl = TRANSLATE_API.batch;
|
|
17
|
+
export const endpoint = TRANSLATE_CONTROLLER.endpoints.batch;
|
|
18
|
+
export const httpMethod = HTTP_METHODS.post;
|
|
19
|
+
|
|
20
|
+
export const RequestSchema = BatchTranslateContractRequestSchema;
|
|
21
|
+
export type TRequest = z.infer<typeof RequestSchema>;
|
|
22
|
+
|
|
23
|
+
export const ResponseSchema = BatchTranslateContractResponseSchema;
|
|
24
|
+
export type TResponse = z.infer<typeof ResponseSchema>;
|
|
25
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from './get-translate.contract';
|