hh-contracts 0.0.89 → 0.0.90
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.
|
@@ -40,7 +40,11 @@ const translate_api_1 = require("../translate.api");
|
|
|
40
40
|
const permissions_1 = require("../../permissions");
|
|
41
41
|
const roles_1 = require("../../roles");
|
|
42
42
|
const translate_schemas_1 = require("../translate.schemas");
|
|
43
|
-
const makeReqVariant = (entity, schema
|
|
43
|
+
const makeReqVariant = (entity, schema) => z.object({
|
|
44
|
+
entity: z.literal(entity),
|
|
45
|
+
object: schema,
|
|
46
|
+
skipKeys: z.array(z.string()).optional(),
|
|
47
|
+
});
|
|
44
48
|
const makeResVariant = (entity, schema) => z.object({
|
|
45
49
|
entity: z.literal(entity),
|
|
46
50
|
translations: z.object({}).catchall(schema),
|
package/package.json
CHANGED
|
@@ -5,11 +5,12 @@ import { PermissionTranslationsSchema } from '../../permissions';
|
|
|
5
5
|
import { RoleTranslationsSchema } from '../../roles';
|
|
6
6
|
import { BaseTranslateSchema } from '../translate.schemas';
|
|
7
7
|
|
|
8
|
-
const makeReqVariant = <E extends TEntity, S extends z.
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
8
|
+
const makeReqVariant = <E extends TEntity, S extends z.ZodObject>(entity: E, schema: S) =>
|
|
9
|
+
z.object({
|
|
10
|
+
entity: z.literal(entity),
|
|
11
|
+
object: schema,
|
|
12
|
+
skipKeys: z.array(z.string()).optional(),
|
|
13
|
+
});
|
|
13
14
|
|
|
14
15
|
const makeResVariant = <E extends TEntity, S extends z.ZodTypeAny>(entity: E, schema: S) =>
|
|
15
16
|
z.object({
|