hh-contracts 0.0.33 → 0.0.34
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/app-languge.constant.js +8 -0
- package/build/common/constants/index.js +2 -1
- package/build/common/models/index.js +1 -0
- package/build/common/models/language-values.schema.js +6 -0
- package/build/permissions/permission.model.js +5 -5
- package/common/constants/app-languge.constant.ts +7 -0
- package/common/constants/index.ts +2 -1
- package/common/models/index.ts +1 -0
- package/common/models/language-values.schema.ts +4 -0
- package/package.json +1 -1
- package/permissions/permission.model.ts +9 -6
|
@@ -15,10 +15,11 @@ var __exportStar = (this && this.__exportStar) || function(m, exports) {
|
|
|
15
15
|
};
|
|
16
16
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
17
17
|
__exportStar(require("./app-ability.constant"), exports);
|
|
18
|
+
__exportStar(require("./app-error.constant"), exports);
|
|
19
|
+
__exportStar(require("./app-languge.constant"), exports);
|
|
18
20
|
__exportStar(require("./default-pagination-config.constant"), exports);
|
|
19
21
|
__exportStar(require("./http-method.constant"), exports);
|
|
20
22
|
__exportStar(require("./icon-key.constant"), exports);
|
|
21
23
|
__exportStar(require("./navigation-item-type.constant"), exports);
|
|
22
24
|
__exportStar(require("./order-direction.constant"), exports);
|
|
23
25
|
__exportStar(require("./route-component-key.constants"), exports);
|
|
24
|
-
__exportStar(require("./app-error.constant"), exports);
|
|
@@ -23,3 +23,4 @@ __exportStar(require("./order.schema"), exports);
|
|
|
23
23
|
__exportStar(require("./pagination.schema"), exports);
|
|
24
24
|
__exportStar(require("./search.schema"), exports);
|
|
25
25
|
__exportStar(require("./timestamp.schemas"), exports);
|
|
26
|
+
__exportStar(require("./language-values.schema"), exports);
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.LanguageValuesSchema = void 0;
|
|
4
|
+
const zod_1 = require("zod");
|
|
5
|
+
const constants_1 = require("../constants");
|
|
6
|
+
exports.LanguageValuesSchema = zod_1.z.enum(constants_1.LANGUAGE_VALUES);
|
|
@@ -6,11 +6,11 @@ const common_1 = require("../common");
|
|
|
6
6
|
exports.PermissionSchema = zod_1.z
|
|
7
7
|
.object({
|
|
8
8
|
id: zod_1.z.number({ invalid_type_error: 'idInvalid' }).positive({ message: 'idMustBePositive' }),
|
|
9
|
-
|
|
10
|
-
.string(
|
|
11
|
-
.
|
|
12
|
-
|
|
13
|
-
|
|
9
|
+
name_i18n: zod_1.z
|
|
10
|
+
.record(common_1.LanguageValuesSchema, zod_1.z.string().transform(s => s.trim()))
|
|
11
|
+
.refine(val => Object.values(val).some(str => str.length > 0), {
|
|
12
|
+
message: 'atLeastOneTranslationRequired',
|
|
13
|
+
}),
|
|
14
14
|
action: zod_1.z.nativeEnum(common_1.AppAbility.ACTION, {
|
|
15
15
|
invalid_type_error: 'actionInvalid',
|
|
16
16
|
required_error: 'actionRequired',
|
|
@@ -1,8 +1,9 @@
|
|
|
1
1
|
export * from './app-ability.constant';
|
|
2
|
+
export * from './app-error.constant';
|
|
3
|
+
export * from './app-languge.constant';
|
|
2
4
|
export * from './default-pagination-config.constant';
|
|
3
5
|
export * from './http-method.constant';
|
|
4
6
|
export * from './icon-key.constant';
|
|
5
7
|
export * from './navigation-item-type.constant';
|
|
6
8
|
export * from './order-direction.constant';
|
|
7
9
|
export * from './route-component-key.constants';
|
|
8
|
-
export * from './app-error.constant';
|
package/common/models/index.ts
CHANGED
package/package.json
CHANGED
|
@@ -1,14 +1,17 @@
|
|
|
1
1
|
import { z } from 'zod';
|
|
2
|
-
import { AppAbility, TimestampSchema } from '../common';
|
|
2
|
+
import { AppAbility, LanguageValuesSchema, TimestampSchema } from '../common';
|
|
3
3
|
|
|
4
4
|
export const PermissionSchema = z
|
|
5
5
|
.object({
|
|
6
6
|
id: z.number({ invalid_type_error: 'idInvalid' }).positive({ message: 'idMustBePositive' }),
|
|
7
|
-
|
|
8
|
-
.
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
7
|
+
name_i18n: z
|
|
8
|
+
.record(
|
|
9
|
+
LanguageValuesSchema,
|
|
10
|
+
z.string().transform(s => s.trim()),
|
|
11
|
+
)
|
|
12
|
+
.refine(val => Object.values(val).some(str => str.length > 0), {
|
|
13
|
+
message: 'atLeastOneTranslationRequired',
|
|
14
|
+
}),
|
|
12
15
|
action: z.nativeEnum(AppAbility.ACTION, {
|
|
13
16
|
invalid_type_error: 'actionInvalid',
|
|
14
17
|
required_error: 'actionRequired',
|