@webitel/api-services 0.1.42 → 0.1.43
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/package.json +1 -1
- package/src/validations/casePriority/casePriority.validations.ts +9 -0
- package/src/validations/caseSource/caseSource.validations.ts +7 -16
- package/src/validations/caseStatus/caseStatus.validations.ts +8 -0
- package/src/validations/caseStatusCondition/caseStatusCondition.validations.ts +10 -0
- package/src/validations/index.ts +4 -0
- package/src/validations/types.ts +9 -0
- package/types/validations/casePriority/casePriority.validations.d.ts +11 -0
- package/types/validations/caseSource/caseSource.validations.d.ts +11 -1
- package/types/validations/caseStatus/caseStatus.validations.d.ts +10 -0
- package/types/validations/caseStatusCondition/caseStatusCondition.validations.d.ts +13 -0
- package/types/validations/index.d.ts +4 -0
- package/types/validations/types.d.ts +8 -0
package/package.json
CHANGED
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import type { WebitelCasesPriority } from '@webitel/api-services/gen/models';
|
|
2
|
+
import { z } from 'zod';
|
|
3
|
+
import type { ZodShape } from '../types';
|
|
4
|
+
|
|
5
|
+
export const casePrioritySchema = z.object<ZodShape<WebitelCasesPriority>>({
|
|
6
|
+
name: z.string().min(1),
|
|
7
|
+
color: z.string().min(1),
|
|
8
|
+
description: z.string().optional(),
|
|
9
|
+
});
|
|
@@ -1,18 +1,9 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import type { WebitelCasesSource } from '@webitel/api-services/gen/models';
|
|
2
|
+
import { z } from 'zod';
|
|
3
|
+
import type { ZodShape } from '../types';
|
|
2
4
|
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
*
|
|
8
|
-
* Previously, orval ignored `default` values and generated plain `ZodObject`.
|
|
9
|
-
* Now schemas are wrapped with `.default(...)`, which transforms
|
|
10
|
-
* `CreateSourceBody` from `ZodObject` into `ZodDefault<ZodObject>`.
|
|
11
|
-
*/
|
|
12
|
-
const innerSchema = genCaseSourceSchema.unwrap();
|
|
13
|
-
|
|
14
|
-
export const caseSourceSchema = innerSchema.extend({
|
|
15
|
-
name: innerSchema.shape.name.unwrap().default(''),
|
|
16
|
-
description: innerSchema.shape.description.default(''),
|
|
17
|
-
type: innerSchema.shape.type.unwrap(),
|
|
5
|
+
export const caseSourceSchema = z.object<ZodShape<WebitelCasesSource>>({
|
|
6
|
+
name: z.string().min(1),
|
|
7
|
+
description: z.string().optional(),
|
|
8
|
+
type: z.string().min(1),
|
|
18
9
|
});
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import type { WebitelCasesStatus } from '@webitel/api-services/gen/models';
|
|
2
|
+
import { z } from 'zod';
|
|
3
|
+
import type { ZodShape } from '../types';
|
|
4
|
+
|
|
5
|
+
export const caseStatusSchema = z.object<ZodShape<WebitelCasesStatus>>({
|
|
6
|
+
name: z.string().min(1),
|
|
7
|
+
description: z.string().optional(),
|
|
8
|
+
});
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import type { WebitelCasesStatusCondition } from '@webitel/api-services/gen/models';
|
|
2
|
+
import { z } from 'zod';
|
|
3
|
+
import type { ZodShape } from '../types';
|
|
4
|
+
|
|
5
|
+
export const caseStatusConditionSchema = z.object<
|
|
6
|
+
ZodShape<WebitelCasesStatusCondition>
|
|
7
|
+
>({
|
|
8
|
+
name: z.string().min(1),
|
|
9
|
+
description: z.string().optional(),
|
|
10
|
+
});
|
package/src/validations/index.ts
CHANGED
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import type { z } from 'zod';
|
|
2
|
+
|
|
3
|
+
/**
|
|
4
|
+
* Maps every key of T to a ZodType, suitable for use as a `z.object<ZodShape<T>>()` generic.
|
|
5
|
+
* Ensures the schema covers all fields of T without importing from generated code.
|
|
6
|
+
*/
|
|
7
|
+
export type ZodShape<T> = {
|
|
8
|
+
[K in keyof T]?: z.ZodType;
|
|
9
|
+
};
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import { z } from 'zod';
|
|
2
|
+
export declare const casePrioritySchema: z.ZodObject<{
|
|
3
|
+
color?: z.ZodType<unknown, unknown, z.core.$ZodTypeInternals<unknown, unknown>>;
|
|
4
|
+
createdAt?: z.ZodType<unknown, unknown, z.core.$ZodTypeInternals<unknown, unknown>>;
|
|
5
|
+
createdBy?: z.ZodType<unknown, unknown, z.core.$ZodTypeInternals<unknown, unknown>>;
|
|
6
|
+
description?: z.ZodType<unknown, unknown, z.core.$ZodTypeInternals<unknown, unknown>>;
|
|
7
|
+
id?: z.ZodType<unknown, unknown, z.core.$ZodTypeInternals<unknown, unknown>>;
|
|
8
|
+
name?: z.ZodType<unknown, unknown, z.core.$ZodTypeInternals<unknown, unknown>>;
|
|
9
|
+
updatedAt?: z.ZodType<unknown, unknown, z.core.$ZodTypeInternals<unknown, unknown>>;
|
|
10
|
+
updatedBy?: z.ZodType<unknown, unknown, z.core.$ZodTypeInternals<unknown, unknown>>;
|
|
11
|
+
}, z.core.$strip>;
|
|
@@ -1 +1,11 @@
|
|
|
1
|
-
|
|
1
|
+
import { z } from 'zod';
|
|
2
|
+
export declare const caseSourceSchema: z.ZodObject<{
|
|
3
|
+
createdAt?: z.ZodType<unknown, unknown, z.core.$ZodTypeInternals<unknown, unknown>>;
|
|
4
|
+
createdBy?: z.ZodType<unknown, unknown, z.core.$ZodTypeInternals<unknown, unknown>>;
|
|
5
|
+
description?: z.ZodType<unknown, unknown, z.core.$ZodTypeInternals<unknown, unknown>>;
|
|
6
|
+
id?: z.ZodType<unknown, unknown, z.core.$ZodTypeInternals<unknown, unknown>>;
|
|
7
|
+
name?: z.ZodType<unknown, unknown, z.core.$ZodTypeInternals<unknown, unknown>>;
|
|
8
|
+
type?: z.ZodType<unknown, unknown, z.core.$ZodTypeInternals<unknown, unknown>>;
|
|
9
|
+
updatedAt?: z.ZodType<unknown, unknown, z.core.$ZodTypeInternals<unknown, unknown>>;
|
|
10
|
+
updatedBy?: z.ZodType<unknown, unknown, z.core.$ZodTypeInternals<unknown, unknown>>;
|
|
11
|
+
}, z.core.$strip>;
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import { z } from 'zod';
|
|
2
|
+
export declare const caseStatusSchema: z.ZodObject<{
|
|
3
|
+
createdAt?: z.ZodType<unknown, unknown, z.core.$ZodTypeInternals<unknown, unknown>>;
|
|
4
|
+
createdBy?: z.ZodType<unknown, unknown, z.core.$ZodTypeInternals<unknown, unknown>>;
|
|
5
|
+
description?: z.ZodType<unknown, unknown, z.core.$ZodTypeInternals<unknown, unknown>>;
|
|
6
|
+
id?: z.ZodType<unknown, unknown, z.core.$ZodTypeInternals<unknown, unknown>>;
|
|
7
|
+
name?: z.ZodType<unknown, unknown, z.core.$ZodTypeInternals<unknown, unknown>>;
|
|
8
|
+
updatedAt?: z.ZodType<unknown, unknown, z.core.$ZodTypeInternals<unknown, unknown>>;
|
|
9
|
+
updatedBy?: z.ZodType<unknown, unknown, z.core.$ZodTypeInternals<unknown, unknown>>;
|
|
10
|
+
}, z.core.$strip>;
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import { z } from 'zod';
|
|
2
|
+
export declare const caseStatusConditionSchema: z.ZodObject<{
|
|
3
|
+
createdAt?: z.ZodType<unknown, unknown, z.core.$ZodTypeInternals<unknown, unknown>>;
|
|
4
|
+
createdBy?: z.ZodType<unknown, unknown, z.core.$ZodTypeInternals<unknown, unknown>>;
|
|
5
|
+
description?: z.ZodType<unknown, unknown, z.core.$ZodTypeInternals<unknown, unknown>>;
|
|
6
|
+
final?: z.ZodType<unknown, unknown, z.core.$ZodTypeInternals<unknown, unknown>>;
|
|
7
|
+
id?: z.ZodType<unknown, unknown, z.core.$ZodTypeInternals<unknown, unknown>>;
|
|
8
|
+
initial?: z.ZodType<unknown, unknown, z.core.$ZodTypeInternals<unknown, unknown>>;
|
|
9
|
+
name?: z.ZodType<unknown, unknown, z.core.$ZodTypeInternals<unknown, unknown>>;
|
|
10
|
+
statusId?: z.ZodType<unknown, unknown, z.core.$ZodTypeInternals<unknown, unknown>>;
|
|
11
|
+
updatedAt?: z.ZodType<unknown, unknown, z.core.$ZodTypeInternals<unknown, unknown>>;
|
|
12
|
+
updatedBy?: z.ZodType<unknown, unknown, z.core.$ZodTypeInternals<unknown, unknown>>;
|
|
13
|
+
}, z.core.$strip>;
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import type { z } from 'zod';
|
|
2
|
+
/**
|
|
3
|
+
* Maps every key of T to a ZodType, suitable for use as a `z.object<ZodShape<T>>()` generic.
|
|
4
|
+
* Ensures the schema covers all fields of T without importing from generated code.
|
|
5
|
+
*/
|
|
6
|
+
export type ZodShape<T> = {
|
|
7
|
+
[K in keyof T]?: z.ZodType;
|
|
8
|
+
};
|