zlient 2.1.10 → 3.0.0

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.
@@ -1,88 +0,0 @@
1
- import { z } from 'zod';
2
- /**
3
- * Common ID type that supports strings, numbers, or UUIDs.
4
- * Use this for entity identifiers in your schemas.
5
- *
6
- * @example
7
- * ```ts
8
- * const UserSchema = z.object({ id: Id, name: z.string() });
9
- * ```
10
- */
11
- export declare const Id: z.ZodUnion<readonly [z.ZodString, z.ZodNumber, z.ZodUUID]>;
12
- export type IdType = z.infer<typeof Id>;
13
- /**
14
- * Common timestamp fields for entities.
15
- * Use this for database models with creation/update tracking.
16
- *
17
- * @example
18
- * ```ts
19
- * const UserSchema = z.object({
20
- * id: Id,
21
- * name: z.string(),
22
- * ...Timestamps.shape
23
- * });
24
- * ```
25
- */
26
- export declare const Timestamps: z.ZodObject<{
27
- createdAt: z.ZodISODateTime;
28
- updatedAt: z.ZodISODateTime;
29
- }, z.core.$strip>;
30
- /**
31
- * Metadata information typically included in API responses.
32
- * Contains request tracking and debugging information.
33
- */
34
- export declare const Meta: z.ZodObject<{
35
- timestamp: z.ZodOptional<z.ZodISODateTime>;
36
- }, z.core.$strip>;
37
- /**
38
- * Detailed error information for a specific field or path.
39
- */
40
- export declare const ErrorDetail: z.ZodObject<{
41
- path: z.ZodOptional<z.ZodString>;
42
- message: z.ZodString;
43
- }, z.core.$strip>;
44
- /**
45
- * Standard API error response schema.
46
- * Use this for consistent error handling across your API.
47
- */
48
- export declare const ApiErrorSchema: z.ZodObject<{
49
- code: z.ZodString;
50
- message: z.ZodString;
51
- details: z.ZodOptional<z.ZodArray<z.ZodObject<{
52
- path: z.ZodOptional<z.ZodString>;
53
- message: z.ZodString;
54
- }, z.core.$strip>>>;
55
- }, z.core.$strip>;
56
- /**
57
- * Generic envelope wrapper for API responses.
58
- * Provides consistent structure with success flag, data, error, and metadata.
59
- *
60
- * @param inner - Zod schema for the response data
61
- * @returns Envelope schema wrapping the inner schema
62
- *
63
- * @example
64
- * ```ts
65
- * const UserResponseSchema = Envelope(z.object({ id: Id, name: z.string() }));
66
- *
67
- * // Response structure:
68
- * // {
69
- * // success: true,
70
- * // data: { id: 1, name: 'John' },
71
- * // meta: { timestamp: '...' }
72
- * // }
73
- * ```
74
- */
75
- export declare const Envelope: <T extends z.ZodType, M extends z.ZodType = z.ZodOptional<typeof Meta>>(inner: T, meta?: M) => z.ZodObject<{
76
- success: z.ZodBoolean;
77
- data: z.ZodNullable<z.ZodOptional<T>>;
78
- error: z.ZodOptional<z.ZodObject<{
79
- code: z.ZodString;
80
- message: z.ZodString;
81
- details: z.ZodOptional<z.ZodArray<z.ZodObject<{
82
- path: z.ZodOptional<z.ZodString>;
83
- message: z.ZodString;
84
- }, z.core.$strip>>>;
85
- }, z.core.$strip>>;
86
- meta: M extends undefined ? z.ZodOptional<typeof Meta> : M;
87
- }, z.core.$strip>;
88
- //# sourceMappingURL=common.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"common.d.ts","sourceRoot":"","sources":["../../lib/schemas/common.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAExB;;;;;;;;GAQG;AACH,eAAO,MAAM,EAAE,4DAMb,CAAC;AACH,MAAM,MAAM,MAAM,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,EAAE,CAAC,CAAC;AAExC;;;;;;;;;;;;GAYG;AACH,eAAO,MAAM,UAAU;;;iBAGrB,CAAC;AAEH;;;GAGG;AACH,eAAO,MAAM,IAAI;;iBAEf,CAAC;AAEH;;GAEG;AACH,eAAO,MAAM,WAAW;;;iBAGtB,CAAC;AAEH;;;GAGG;AACH,eAAO,MAAM,cAAc;;;;;;;iBAIzB,CAAC;AAEH;;;;;;;;;;;;;;;;;;GAkBG;AACH,eAAO,MAAM,QAAQ,GAAI,CAAC,SAAS,CAAC,CAAC,OAAO,EAAE,CAAC,SAAS,CAAC,CAAC,OAAO,GAAG,CAAC,CAAC,WAAW,CAAC,OAAO,IAAI,CAAC,EAC5F,OAAO,CAAC,EACR,OAAO,CAAC;;;;;;;;;;;UAMiD,CAAC,SAAS,SAAS,GAAG,CAAC,CAAC,WAAW,CAAC,OAAO,IAAI,CAAC,GAAG,CAAC;iBAE9G,CAAA"}