@webitel/api-services 0.1.42 → 0.1.44

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 CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@webitel/api-services",
3
- "version": "0.1.42",
3
+ "version": "0.1.44",
4
4
  "private": false,
5
5
  "repository": {
6
6
  "type": "git",
@@ -46,7 +46,7 @@
46
46
  "@biomejs/biome": "2.4.16",
47
47
  "@tsconfig/node22": "^22.0.0",
48
48
  "@types/node": "^22.13.10",
49
- "axios": "1.13.2",
49
+ "axios": "^1.15.2",
50
50
  "change-case": "^5.4.4",
51
51
  "globby": "^14.1.0",
52
52
  "husky": "^9.1.7",
@@ -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 { CreateSourceBody as genCaseSourceSchema } from '../../gen';
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
- * @author r.zatirskyi
5
- * Inner schema is required because started from orval v8.4.1
6
- * default values from the OpenAPI spec are preserved during Zod schema generation.
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
+ });
@@ -1 +1,5 @@
1
+ export * from './casePriority/casePriority.validations';
1
2
  export * from './caseSource/caseSource.validations';
3
+ export * from './caseStatus/caseStatus.validations';
4
+ export * from './caseStatusCondition/caseStatusCondition.validations';
5
+ export * from './types';
@@ -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
- export declare const caseSourceSchema: any;
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>;
@@ -1 +1,5 @@
1
+ export * from './casePriority/casePriority.validations';
1
2
  export * from './caseSource/caseSource.validations';
3
+ export * from './caseStatus/caseStatus.validations';
4
+ export * from './caseStatusCondition/caseStatusCondition.validations';
5
+ export * from './types';
@@ -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
+ };