hh-contracts 0.0.47 → 0.0.49
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.
|
@@ -15,8 +15,10 @@ exports.TranslationPersistedSchema = zod_1.z.object({
|
|
|
15
15
|
exports.TranslationItemSchema = exports.TranslationPersistedSchema.omit({
|
|
16
16
|
entityId: true,
|
|
17
17
|
entityName: true,
|
|
18
|
+
field: true,
|
|
18
19
|
});
|
|
19
20
|
exports.TranslationsArraySchema = zod_1.z.array(exports.TranslationItemSchema);
|
|
20
21
|
exports.TranslationsSchema = zod_1.z.object({
|
|
21
|
-
|
|
22
|
+
name: exports.TranslationsArraySchema,
|
|
23
|
+
description: exports.TranslationsArraySchema,
|
|
22
24
|
});
|
|
@@ -33,7 +33,9 @@ exports.PermissionPersistedSchema = zod_1.z
|
|
|
33
33
|
conditions: exports.JsonConditionsSchema,
|
|
34
34
|
})
|
|
35
35
|
.merge(common_1.TimestampSchema);
|
|
36
|
-
exports.PermissionWithTranslationsSchema = exports.PermissionPersistedSchema.
|
|
36
|
+
exports.PermissionWithTranslationsSchema = exports.PermissionPersistedSchema.extend({
|
|
37
|
+
translations: common_1.TranslationsSchema.pick({ name: true, description: true }),
|
|
38
|
+
});
|
|
37
39
|
exports.PermissionListItemSchema = exports.PermissionPersistedSchema.extend({
|
|
38
40
|
name: zod_1.z.string().nullable(),
|
|
39
41
|
});
|
|
@@ -15,6 +15,7 @@ export type TTranslationPersisted = z.infer<typeof TranslationPersistedSchema>;
|
|
|
15
15
|
export const TranslationItemSchema = TranslationPersistedSchema.omit({
|
|
16
16
|
entityId: true,
|
|
17
17
|
entityName: true,
|
|
18
|
+
field: true,
|
|
18
19
|
});
|
|
19
20
|
export type TTranslationItem = z.infer<typeof TranslationItemSchema>;
|
|
20
21
|
|
|
@@ -22,6 +23,7 @@ export const TranslationsArraySchema = z.array(TranslationItemSchema);
|
|
|
22
23
|
export type TTranslationsArray = z.infer<typeof TranslationsArraySchema>;
|
|
23
24
|
|
|
24
25
|
export const TranslationsSchema = z.object({
|
|
25
|
-
|
|
26
|
+
name: TranslationsArraySchema,
|
|
27
|
+
description: TranslationsArraySchema,
|
|
26
28
|
});
|
|
27
29
|
export type TTranslations = z.infer<typeof TranslationsSchema>;
|
package/package.json
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { z } from 'zod';
|
|
2
|
-
import { AppAbility,
|
|
2
|
+
import { AppAbility, TimestampSchema, TranslationsSchema } from '../common';
|
|
3
3
|
|
|
4
4
|
export const JsonConditionsSchema = z
|
|
5
5
|
.string()
|
|
@@ -37,7 +37,9 @@ export const PermissionPersistedSchema = z
|
|
|
37
37
|
|
|
38
38
|
export type TPermissionPersisted = z.infer<typeof PermissionPersistedSchema>;
|
|
39
39
|
|
|
40
|
-
export const PermissionWithTranslationsSchema = PermissionPersistedSchema.
|
|
40
|
+
export const PermissionWithTranslationsSchema = PermissionPersistedSchema.extend({
|
|
41
|
+
translations: TranslationsSchema.pick({ name: true, description: true }),
|
|
42
|
+
});
|
|
41
43
|
export type TPermissionWithTranslations = z.infer<typeof PermissionWithTranslationsSchema>;
|
|
42
44
|
|
|
43
45
|
export const PermissionListItemSchema = PermissionPersistedSchema.extend({
|