@ventori/contracts 0.1.0 → 0.1.2

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/dist/index.d.mts CHANGED
@@ -2,23 +2,17 @@ import * as zod from 'zod';
2
2
  import { z } from 'zod';
3
3
  import * as _ts_rest_core from '@ts-rest/core';
4
4
  import { initContract } from '@ts-rest/core';
5
+ import * as zod_v4_core from 'zod/v4/core';
5
6
 
6
7
  declare const PaginationQuerySchema: z.ZodObject<{
7
- page: z.ZodDefault<z.ZodNumber>;
8
- pageSize: z.ZodDefault<z.ZodNumber>;
8
+ page: z.ZodDefault<z.ZodCoercedNumber<unknown>>;
9
+ pageSize: z.ZodDefault<z.ZodCoercedNumber<unknown>>;
9
10
  sortBy: z.ZodOptional<z.ZodString>;
10
- sortOrder: z.ZodDefault<z.ZodEnum<["asc", "desc"]>>;
11
- }, "strip", z.ZodTypeAny, {
12
- page: number;
13
- pageSize: number;
14
- sortOrder: "asc" | "desc";
15
- sortBy?: string | undefined;
16
- }, {
17
- page?: number | undefined;
18
- pageSize?: number | undefined;
19
- sortBy?: string | undefined;
20
- sortOrder?: "asc" | "desc" | undefined;
21
- }>;
11
+ sortOrder: z.ZodDefault<z.ZodEnum<{
12
+ asc: "asc";
13
+ desc: "desc";
14
+ }>>;
15
+ }, z.core.$strip>;
22
16
  type PaginationQuery = z.infer<typeof PaginationQuerySchema>;
23
17
  declare const PaginationSchema: z.ZodObject<{
24
18
  page: z.ZodNumber;
@@ -27,24 +21,10 @@ declare const PaginationSchema: z.ZodObject<{
27
21
  totalPages: z.ZodNumber;
28
22
  hasNext: z.ZodBoolean;
29
23
  hasPrev: z.ZodBoolean;
30
- }, "strip", z.ZodTypeAny, {
31
- page: number;
32
- pageSize: number;
33
- total: number;
34
- totalPages: number;
35
- hasNext: boolean;
36
- hasPrev: boolean;
37
- }, {
38
- page: number;
39
- pageSize: number;
40
- total: number;
41
- totalPages: number;
42
- hasNext: boolean;
43
- hasPrev: boolean;
44
- }>;
24
+ }, z.core.$strip>;
45
25
  type Pagination = z.infer<typeof PaginationSchema>;
46
26
  declare const DataResponseSchema: <T extends z.ZodTypeAny>(itemSchema: T) => z.ZodObject<{
47
- data: z.ZodArray<T, "many">;
27
+ data: z.ZodArray<T>;
48
28
  pagination: z.ZodObject<{
49
29
  page: z.ZodNumber;
50
30
  pageSize: z.ZodNumber;
@@ -52,42 +32,8 @@ declare const DataResponseSchema: <T extends z.ZodTypeAny>(itemSchema: T) => z.Z
52
32
  totalPages: z.ZodNumber;
53
33
  hasNext: z.ZodBoolean;
54
34
  hasPrev: z.ZodBoolean;
55
- }, "strip", z.ZodTypeAny, {
56
- page: number;
57
- pageSize: number;
58
- total: number;
59
- totalPages: number;
60
- hasNext: boolean;
61
- hasPrev: boolean;
62
- }, {
63
- page: number;
64
- pageSize: number;
65
- total: number;
66
- totalPages: number;
67
- hasNext: boolean;
68
- hasPrev: boolean;
69
- }>;
70
- }, "strip", z.ZodTypeAny, {
71
- data: T["_output"][];
72
- pagination: {
73
- page: number;
74
- pageSize: number;
75
- total: number;
76
- totalPages: number;
77
- hasNext: boolean;
78
- hasPrev: boolean;
79
- };
80
- }, {
81
- data: T["_input"][];
82
- pagination: {
83
- page: number;
84
- pageSize: number;
85
- total: number;
86
- totalPages: number;
87
- hasNext: boolean;
88
- hasPrev: boolean;
89
- };
90
- }>;
35
+ }, z.core.$strip>;
36
+ }, z.core.$strip>;
91
37
  type DataResponse<T> = {
92
38
  data: T[];
93
39
  pagination: Pagination;
@@ -98,25 +44,11 @@ declare const ErrorResponseSchema: z.ZodObject<{
98
44
  statusCode: z.ZodNumber;
99
45
  error: z.ZodOptional<z.ZodString>;
100
46
  details: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
101
- }, "strip", z.ZodTypeAny, {
102
- message: string;
103
- statusCode: number;
104
- error?: string | undefined;
105
- details?: Record<string, unknown> | undefined;
106
- }, {
107
- message: string;
108
- statusCode: number;
109
- error?: string | undefined;
110
- details?: Record<string, unknown> | undefined;
111
- }>;
47
+ }, z.core.$strip>;
112
48
  type ErrorResponse = z.infer<typeof ErrorResponseSchema>;
113
49
  declare const NotFoundResponseSchema: z.ZodObject<{
114
50
  message: z.ZodString;
115
- }, "strip", z.ZodTypeAny, {
116
- message: string;
117
- }, {
118
- message: string;
119
- }>;
51
+ }, z.core.$strip>;
120
52
  declare const ValidationErrorSchema: z.ZodObject<{
121
53
  message: z.ZodString;
122
54
  statusCode: z.ZodDefault<z.ZodNumber>;
@@ -124,60 +56,22 @@ declare const ValidationErrorSchema: z.ZodObject<{
124
56
  details: z.ZodArray<z.ZodObject<{
125
57
  field: z.ZodString;
126
58
  message: z.ZodString;
127
- }, "strip", z.ZodTypeAny, {
128
- message: string;
129
- field: string;
130
- }, {
131
- message: string;
132
- field: string;
133
- }>, "many">;
134
- }, "strip", z.ZodTypeAny, {
135
- message: string;
136
- statusCode: number;
137
- error: string;
138
- details: {
139
- message: string;
140
- field: string;
141
- }[];
142
- }, {
143
- message: string;
144
- details: {
145
- message: string;
146
- field: string;
147
- }[];
148
- statusCode?: number | undefined;
149
- error?: string | undefined;
150
- }>;
59
+ }, z.core.$strip>>;
60
+ }, z.core.$strip>;
151
61
  type ValidationError = z.infer<typeof ValidationErrorSchema>;
152
62
 
153
63
  declare const ApiSuccessResponseSchema: <T extends z.ZodTypeAny>(dataSchema: T) => z.ZodObject<{
154
64
  success: z.ZodLiteral<true>;
155
65
  data: T;
156
- }, "strip", z.ZodTypeAny, z.objectUtil.addQuestionMarks<z.baseObjectOutputType<{
157
- success: z.ZodLiteral<true>;
158
- data: T;
159
- }>, any> extends infer T_1 ? { [k in keyof T_1]: T_1[k]; } : never, z.baseObjectInputType<{
160
- success: z.ZodLiteral<true>;
161
- data: T;
162
- }> extends infer T_2 ? { [k_1 in keyof T_2]: T_2[k_1]; } : never>;
66
+ }, z.core.$strip>;
163
67
  declare const ApiErrorResponseSchema: z.ZodObject<{
164
68
  success: z.ZodLiteral<false>;
165
69
  message: z.ZodString;
166
70
  statusCode: z.ZodNumber;
167
71
  error: z.ZodOptional<z.ZodString>;
168
- }, "strip", z.ZodTypeAny, {
169
- message: string;
170
- statusCode: number;
171
- success: false;
172
- error?: string | undefined;
173
- }, {
174
- message: string;
175
- statusCode: number;
176
- success: false;
177
- error?: string | undefined;
178
- }>;
72
+ }, z.core.$strip>;
179
73
  declare const ApiPaginatedResponseSchema: <T extends z.ZodTypeAny>(itemSchema: T) => z.ZodObject<{
180
- data: z.ZodArray<T, "many">;
74
+ data: z.ZodArray<T>;
181
75
  pagination: z.ZodObject<{
182
76
  page: z.ZodNumber;
183
77
  pageSize: z.ZodNumber;
@@ -185,45 +79,9 @@ declare const ApiPaginatedResponseSchema: <T extends z.ZodTypeAny>(itemSchema: T
185
79
  totalPages: z.ZodNumber;
186
80
  hasNext: z.ZodBoolean;
187
81
  hasPrev: z.ZodBoolean;
188
- }, "strip", z.ZodTypeAny, {
189
- page: number;
190
- pageSize: number;
191
- total: number;
192
- totalPages: number;
193
- hasNext: boolean;
194
- hasPrev: boolean;
195
- }, {
196
- page: number;
197
- pageSize: number;
198
- total: number;
199
- totalPages: number;
200
- hasNext: boolean;
201
- hasPrev: boolean;
202
- }>;
82
+ }, z.core.$strip>;
203
83
  success: z.ZodLiteral<true>;
204
- }, "strip", z.ZodTypeAny, {
205
- data: T["_output"][];
206
- pagination: {
207
- page: number;
208
- pageSize: number;
209
- total: number;
210
- totalPages: number;
211
- hasNext: boolean;
212
- hasPrev: boolean;
213
- };
214
- success: true;
215
- }, {
216
- data: T["_input"][];
217
- pagination: {
218
- page: number;
219
- pageSize: number;
220
- total: number;
221
- totalPages: number;
222
- hasNext: boolean;
223
- hasPrev: boolean;
224
- };
225
- success: true;
226
- }>;
84
+ }, z.core.$strip>;
227
85
 
228
86
  type ContractInstance = ReturnType<typeof initContract>;
229
87
  declare const c: ContractInstance;
@@ -237,24 +95,17 @@ declare function createCrudEndpoints<TEntity extends z.ZodTypeAny, TCreate exten
237
95
  readonly method: "GET";
238
96
  readonly path: `/${string}`;
239
97
  readonly query: z.ZodObject<{
240
- page: z.ZodDefault<z.ZodNumber>;
241
- pageSize: z.ZodDefault<z.ZodNumber>;
98
+ page: z.ZodDefault<z.ZodCoercedNumber<unknown>>;
99
+ pageSize: z.ZodDefault<z.ZodCoercedNumber<unknown>>;
242
100
  sortBy: z.ZodOptional<z.ZodString>;
243
- sortOrder: z.ZodDefault<z.ZodEnum<["asc", "desc"]>>;
244
- }, "strip", z.ZodTypeAny, {
245
- page: number;
246
- pageSize: number;
247
- sortOrder: "asc" | "desc";
248
- sortBy?: string | undefined;
249
- }, {
250
- page?: number | undefined;
251
- pageSize?: number | undefined;
252
- sortBy?: string | undefined;
253
- sortOrder?: "asc" | "desc" | undefined;
254
- }>;
101
+ sortOrder: z.ZodDefault<z.ZodEnum<{
102
+ asc: "asc";
103
+ desc: "desc";
104
+ }>>;
105
+ }, z.core.$strip>;
255
106
  readonly responses: {
256
107
  readonly 200: z.ZodObject<{
257
- data: z.ZodArray<TEntity, "many">;
108
+ data: z.ZodArray<TEntity>;
258
109
  pagination: z.ZodObject<{
259
110
  page: z.ZodNumber;
260
111
  pageSize: z.ZodNumber;
@@ -262,42 +113,8 @@ declare function createCrudEndpoints<TEntity extends z.ZodTypeAny, TCreate exten
262
113
  totalPages: z.ZodNumber;
263
114
  hasNext: z.ZodBoolean;
264
115
  hasPrev: z.ZodBoolean;
265
- }, "strip", z.ZodTypeAny, {
266
- page: number;
267
- pageSize: number;
268
- total: number;
269
- totalPages: number;
270
- hasNext: boolean;
271
- hasPrev: boolean;
272
- }, {
273
- page: number;
274
- pageSize: number;
275
- total: number;
276
- totalPages: number;
277
- hasNext: boolean;
278
- hasPrev: boolean;
279
- }>;
280
- }, "strip", z.ZodTypeAny, {
281
- data: TEntity["_output"][];
282
- pagination: {
283
- page: number;
284
- pageSize: number;
285
- total: number;
286
- totalPages: number;
287
- hasNext: boolean;
288
- hasPrev: boolean;
289
- };
290
- }, {
291
- data: TEntity["_input"][];
292
- pagination: {
293
- page: number;
294
- pageSize: number;
295
- total: number;
296
- totalPages: number;
297
- hasNext: boolean;
298
- hasPrev: boolean;
299
- };
300
- }>;
116
+ }, z.core.$strip>;
117
+ }, z.core.$strip>;
301
118
  };
302
119
  readonly summary: `List all ${string}`;
303
120
  };
@@ -308,11 +125,7 @@ declare function createCrudEndpoints<TEntity extends z.ZodTypeAny, TCreate exten
308
125
  readonly 200: TEntity;
309
126
  readonly 404: z.ZodObject<{
310
127
  message: z.ZodString;
311
- }, "strip", z.ZodTypeAny, {
312
- message: string;
313
- }, {
314
- message: string;
315
- }>;
128
+ }, z.core.$strip>;
316
129
  };
317
130
  readonly summary: `Find ${string} by ID`;
318
131
  };
@@ -333,11 +146,7 @@ declare function createCrudEndpoints<TEntity extends z.ZodTypeAny, TCreate exten
333
146
  readonly 200: TEntity;
334
147
  readonly 404: z.ZodObject<{
335
148
  message: z.ZodString;
336
- }, "strip", z.ZodTypeAny, {
337
- message: string;
338
- }, {
339
- message: string;
340
- }>;
149
+ }, z.core.$strip>;
341
150
  };
342
151
  readonly summary: `Update ${string} by ID`;
343
152
  };
@@ -349,69 +158,48 @@ declare function createCrudEndpoints<TEntity extends z.ZodTypeAny, TCreate exten
349
158
  readonly 204: typeof _ts_rest_core.ContractNoBody;
350
159
  readonly 404: z.ZodObject<{
351
160
  message: z.ZodString;
352
- }, "strip", z.ZodTypeAny, {
353
- message: string;
354
- }, {
355
- message: string;
356
- }>;
161
+ }, z.core.$strip>;
357
162
  };
358
163
  readonly summary: `Delete ${string} by ID`;
359
164
  };
360
165
  };
361
166
 
362
- interface ICrudService<T> {
363
- list(query: PaginationQuery): Promise<DataResponse<T>>;
364
- findById(id: string): Promise<T | null>;
365
- create(data: unknown): Promise<T>;
366
- update(id: string, data: unknown): Promise<T | null>;
167
+ interface ICrudService<TData, TCreate, TUpdate> {
168
+ list(query: PaginationQuery): Promise<DataResponse<TData>>;
169
+ findById(id: string): Promise<TData | null>;
170
+ create(data: TCreate): Promise<TData>;
171
+ update(id: string, data: TUpdate): Promise<TData | null>;
367
172
  remove(id: string): Promise<void>;
368
173
  }
369
174
 
370
- declare function createCrudHandlers<T>(service: ICrudService<T>): {
371
- list: ({ query }: {
372
- query: PaginationQuery;
373
- }) => Promise<{
175
+ declare function createCrudHandlers<TData, TCreate, TUpdate>(service: ICrudService<TData, TCreate, TUpdate>): {
176
+ list: (query: PaginationQuery) => Promise<{
374
177
  status: 200;
375
- body: DataResponse<T>;
178
+ body: DataResponse<TData>;
376
179
  }>;
377
- findById: ({ params }: {
378
- params: {
379
- id: string;
380
- };
381
- }) => Promise<{
180
+ findById: (id: string) => Promise<{
382
181
  status: 404;
383
182
  body: {
384
183
  message: string;
385
184
  };
386
185
  } | {
387
186
  status: 200;
388
- body: NonNullable<Awaited<T>>;
187
+ body: NonNullable<Awaited<TData>>;
389
188
  }>;
390
- create: ({ body }: {
391
- body: unknown;
392
- }) => Promise<{
189
+ create: (data: TCreate) => Promise<{
393
190
  status: 201;
394
- body: Awaited<T>;
191
+ body: Awaited<TData>;
395
192
  }>;
396
- update: ({ params, body, }: {
397
- params: {
398
- id: string;
399
- };
400
- body: unknown;
401
- }) => Promise<{
193
+ update: (id: string, data: TUpdate) => Promise<{
402
194
  status: 404;
403
195
  body: {
404
196
  message: string;
405
197
  };
406
198
  } | {
407
199
  status: 200;
408
- body: NonNullable<Awaited<T>>;
200
+ body: NonNullable<Awaited<TData>>;
409
201
  }>;
410
- remove: ({ params }: {
411
- params: {
412
- id: string;
413
- };
414
- }) => Promise<{
202
+ remove: (id: string) => Promise<{
415
203
  status: 204;
416
204
  body: undefined;
417
205
  }>;
@@ -433,329 +221,70 @@ declare const UserSchema: z.ZodObject<{
433
221
  isActive: z.ZodDefault<z.ZodBoolean>;
434
222
  createdAt: z.ZodString;
435
223
  updatedAt: z.ZodString;
436
- }, "strip", z.ZodTypeAny, {
437
- id: string;
438
- email: string;
439
- firstName: string;
440
- lastName: string;
441
- isActive: boolean;
442
- createdAt: string;
443
- updatedAt: string;
444
- }, {
445
- id: string;
446
- email: string;
447
- firstName: string;
448
- lastName: string;
449
- createdAt: string;
450
- updatedAt: string;
451
- isActive?: boolean | undefined;
452
- }>;
224
+ }, z.core.$strip>;
453
225
  declare const CreateUserSchema: z.ZodObject<{
454
226
  email: z.ZodString;
455
227
  firstName: z.ZodString;
456
228
  lastName: z.ZodString;
457
229
  password: z.ZodString;
458
- }, "strip", z.ZodTypeAny, {
459
- email: string;
460
- firstName: string;
461
- lastName: string;
462
- password: string;
463
- }, {
464
- email: string;
465
- firstName: string;
466
- lastName: string;
467
- password: string;
468
- }>;
469
- declare const UpdateUserSchema: z.ZodObject<Omit<{
230
+ }, z.core.$strip>;
231
+ declare const UpdateUserSchema: z.ZodObject<{
470
232
  email: z.ZodOptional<z.ZodString>;
471
233
  firstName: z.ZodOptional<z.ZodString>;
472
234
  lastName: z.ZodOptional<z.ZodString>;
473
- password: z.ZodOptional<z.ZodString>;
474
- }, "password"> & {
475
235
  isActive: z.ZodOptional<z.ZodBoolean>;
476
- }, "strip", z.ZodTypeAny, {
477
- email?: string | undefined;
478
- firstName?: string | undefined;
479
- lastName?: string | undefined;
480
- isActive?: boolean | undefined;
481
- }, {
482
- email?: string | undefined;
483
- firstName?: string | undefined;
484
- lastName?: string | undefined;
485
- isActive?: boolean | undefined;
486
- }>;
236
+ }, z.core.$strip>;
487
237
  type User = z.infer<typeof UserSchema>;
488
238
  type CreateUser = z.infer<typeof CreateUserSchema>;
489
239
  type UpdateUser = z.infer<typeof UpdateUserSchema>;
490
240
 
491
241
  declare const userContract: {
492
242
  list: {
243
+ [x: string]: any;
493
244
  readonly query: zod.ZodObject<{
494
- page: zod.ZodDefault<zod.ZodNumber>;
495
- pageSize: zod.ZodDefault<zod.ZodNumber>;
245
+ page: zod.ZodDefault<zod.ZodCoercedNumber<unknown>>;
246
+ pageSize: zod.ZodDefault<zod.ZodCoercedNumber<unknown>>;
496
247
  sortBy: zod.ZodOptional<zod.ZodString>;
497
- sortOrder: zod.ZodDefault<zod.ZodEnum<["asc", "desc"]>>;
498
- }, "strip", zod.ZodTypeAny, {
499
- page: number;
500
- pageSize: number;
501
- sortOrder: "asc" | "desc";
502
- sortBy?: string | undefined;
503
- }, {
504
- page?: number | undefined;
505
- pageSize?: number | undefined;
506
- sortBy?: string | undefined;
507
- sortOrder?: "asc" | "desc" | undefined;
508
- }>;
248
+ sortOrder: zod.ZodDefault<zod.ZodEnum<{
249
+ asc: "asc";
250
+ desc: "desc";
251
+ }>>;
252
+ }, zod_v4_core.$strip>;
509
253
  readonly summary: `List all ${string}`;
510
254
  readonly method: "GET";
511
- path: `/${string}`;
512
- responses: {
513
- readonly 200: zod.ZodObject<{
514
- data: zod.ZodArray<zod.ZodObject<{
515
- id: zod.ZodString;
516
- email: zod.ZodString;
517
- firstName: zod.ZodString;
518
- lastName: zod.ZodString;
519
- isActive: zod.ZodDefault<zod.ZodBoolean>;
520
- createdAt: zod.ZodString;
521
- updatedAt: zod.ZodString;
522
- }, "strip", zod.ZodTypeAny, {
523
- id: string;
524
- email: string;
525
- firstName: string;
526
- lastName: string;
527
- isActive: boolean;
528
- createdAt: string;
529
- updatedAt: string;
530
- }, {
531
- id: string;
532
- email: string;
533
- firstName: string;
534
- lastName: string;
535
- createdAt: string;
536
- updatedAt: string;
537
- isActive?: boolean | undefined;
538
- }>, "many">;
539
- pagination: zod.ZodObject<{
540
- page: zod.ZodNumber;
541
- pageSize: zod.ZodNumber;
542
- total: zod.ZodNumber;
543
- totalPages: zod.ZodNumber;
544
- hasNext: zod.ZodBoolean;
545
- hasPrev: zod.ZodBoolean;
546
- }, "strip", zod.ZodTypeAny, {
547
- page: number;
548
- pageSize: number;
549
- total: number;
550
- totalPages: number;
551
- hasNext: boolean;
552
- hasPrev: boolean;
553
- }, {
554
- page: number;
555
- pageSize: number;
556
- total: number;
557
- totalPages: number;
558
- hasNext: boolean;
559
- hasPrev: boolean;
560
- }>;
561
- }, "strip", zod.ZodTypeAny, {
562
- data: {
563
- id: string;
564
- email: string;
565
- firstName: string;
566
- lastName: string;
567
- isActive: boolean;
568
- createdAt: string;
569
- updatedAt: string;
570
- }[];
571
- pagination: {
572
- page: number;
573
- pageSize: number;
574
- total: number;
575
- totalPages: number;
576
- hasNext: boolean;
577
- hasPrev: boolean;
578
- };
579
- }, {
580
- data: {
581
- id: string;
582
- email: string;
583
- firstName: string;
584
- lastName: string;
585
- createdAt: string;
586
- updatedAt: string;
587
- isActive?: boolean | undefined;
588
- }[];
589
- pagination: {
590
- page: number;
591
- pageSize: number;
592
- total: number;
593
- totalPages: number;
594
- hasNext: boolean;
595
- hasPrev: boolean;
596
- };
597
- }>;
598
- };
599
255
  };
600
256
  findById: {
257
+ [x: string]: any;
601
258
  readonly summary: `Find ${string} by ID`;
602
259
  readonly method: "GET";
603
- path: `/${string}/:id`;
604
- responses: {
605
- readonly 200: zod.ZodObject<{
606
- id: zod.ZodString;
607
- email: zod.ZodString;
608
- firstName: zod.ZodString;
609
- lastName: zod.ZodString;
610
- isActive: zod.ZodDefault<zod.ZodBoolean>;
611
- createdAt: zod.ZodString;
612
- updatedAt: zod.ZodString;
613
- }, "strip", zod.ZodTypeAny, {
614
- id: string;
615
- email: string;
616
- firstName: string;
617
- lastName: string;
618
- isActive: boolean;
619
- createdAt: string;
620
- updatedAt: string;
621
- }, {
622
- id: string;
623
- email: string;
624
- firstName: string;
625
- lastName: string;
626
- createdAt: string;
627
- updatedAt: string;
628
- isActive?: boolean | undefined;
629
- }>;
630
- readonly 404: zod.ZodObject<{
631
- message: zod.ZodString;
632
- }, "strip", zod.ZodTypeAny, {
633
- message: string;
634
- }, {
635
- message: string;
636
- }>;
637
- };
638
260
  };
639
261
  create: {
262
+ [x: string]: any;
263
+ readonly summary: `Create a new ${string}`;
264
+ readonly method: "POST";
640
265
  readonly body: zod.ZodObject<{
641
266
  email: zod.ZodString;
642
267
  firstName: zod.ZodString;
643
268
  lastName: zod.ZodString;
644
269
  password: zod.ZodString;
645
- }, "strip", zod.ZodTypeAny, {
646
- email: string;
647
- firstName: string;
648
- lastName: string;
649
- password: string;
650
- }, {
651
- email: string;
652
- firstName: string;
653
- lastName: string;
654
- password: string;
655
- }>;
656
- readonly summary: `Create a new ${string}`;
657
- readonly method: "POST";
658
- path: `/${string}`;
659
- responses: {
660
- readonly 201: zod.ZodObject<{
661
- id: zod.ZodString;
662
- email: zod.ZodString;
663
- firstName: zod.ZodString;
664
- lastName: zod.ZodString;
665
- isActive: zod.ZodDefault<zod.ZodBoolean>;
666
- createdAt: zod.ZodString;
667
- updatedAt: zod.ZodString;
668
- }, "strip", zod.ZodTypeAny, {
669
- id: string;
670
- email: string;
671
- firstName: string;
672
- lastName: string;
673
- isActive: boolean;
674
- createdAt: string;
675
- updatedAt: string;
676
- }, {
677
- id: string;
678
- email: string;
679
- firstName: string;
680
- lastName: string;
681
- createdAt: string;
682
- updatedAt: string;
683
- isActive?: boolean | undefined;
684
- }>;
685
- };
270
+ }, zod_v4_core.$strip>;
686
271
  };
687
272
  update: {
688
- readonly body: zod.ZodObject<Omit<{
273
+ [x: string]: any;
274
+ readonly summary: `Update ${string} by ID`;
275
+ readonly method: "PUT";
276
+ readonly body: zod.ZodObject<{
689
277
  email: zod.ZodOptional<zod.ZodString>;
690
278
  firstName: zod.ZodOptional<zod.ZodString>;
691
279
  lastName: zod.ZodOptional<zod.ZodString>;
692
- password: zod.ZodOptional<zod.ZodString>;
693
- }, "password"> & {
694
280
  isActive: zod.ZodOptional<zod.ZodBoolean>;
695
- }, "strip", zod.ZodTypeAny, {
696
- email?: string | undefined;
697
- firstName?: string | undefined;
698
- lastName?: string | undefined;
699
- isActive?: boolean | undefined;
700
- }, {
701
- email?: string | undefined;
702
- firstName?: string | undefined;
703
- lastName?: string | undefined;
704
- isActive?: boolean | undefined;
705
- }>;
706
- readonly summary: `Update ${string} by ID`;
707
- readonly method: "PUT";
708
- path: `/${string}/:id`;
709
- responses: {
710
- readonly 200: zod.ZodObject<{
711
- id: zod.ZodString;
712
- email: zod.ZodString;
713
- firstName: zod.ZodString;
714
- lastName: zod.ZodString;
715
- isActive: zod.ZodDefault<zod.ZodBoolean>;
716
- createdAt: zod.ZodString;
717
- updatedAt: zod.ZodString;
718
- }, "strip", zod.ZodTypeAny, {
719
- id: string;
720
- email: string;
721
- firstName: string;
722
- lastName: string;
723
- isActive: boolean;
724
- createdAt: string;
725
- updatedAt: string;
726
- }, {
727
- id: string;
728
- email: string;
729
- firstName: string;
730
- lastName: string;
731
- createdAt: string;
732
- updatedAt: string;
733
- isActive?: boolean | undefined;
734
- }>;
735
- readonly 404: zod.ZodObject<{
736
- message: zod.ZodString;
737
- }, "strip", zod.ZodTypeAny, {
738
- message: string;
739
- }, {
740
- message: string;
741
- }>;
742
- };
281
+ }, zod_v4_core.$strip>;
743
282
  };
744
283
  remove: {
745
- readonly body: typeof _ts_rest_core.ContractNoBody;
284
+ [x: string]: any;
746
285
  readonly summary: `Delete ${string} by ID`;
747
286
  readonly method: "DELETE";
748
- path: `/${string}/:id`;
749
- responses: {
750
- readonly 204: typeof _ts_rest_core.ContractNoBody;
751
- readonly 404: zod.ZodObject<{
752
- message: zod.ZodString;
753
- }, "strip", zod.ZodTypeAny, {
754
- message: string;
755
- }, {
756
- message: string;
757
- }>;
758
- };
287
+ readonly body: typeof _ts_rest_core.ContractNoBody;
759
288
  };
760
289
  };
761
290
 
@@ -770,29 +299,7 @@ declare const ProductSchema: z.ZodObject<{
770
299
  isActive: z.ZodDefault<z.ZodBoolean>;
771
300
  createdAt: z.ZodString;
772
301
  updatedAt: z.ZodString;
773
- }, "strip", z.ZodTypeAny, {
774
- code: string;
775
- id: string;
776
- isActive: boolean;
777
- createdAt: string;
778
- updatedAt: string;
779
- name: string;
780
- categoryId: string;
781
- unitOfMeasureId: string;
782
- taxId: string;
783
- description?: string | undefined;
784
- }, {
785
- code: string;
786
- id: string;
787
- createdAt: string;
788
- updatedAt: string;
789
- name: string;
790
- categoryId: string;
791
- unitOfMeasureId: string;
792
- taxId: string;
793
- isActive?: boolean | undefined;
794
- description?: string | undefined;
795
- }>;
302
+ }, z.core.$strip>;
796
303
  declare const CreateProductSchema: z.ZodObject<{
797
304
  code: z.ZodString;
798
305
  name: z.ZodString;
@@ -800,21 +307,7 @@ declare const CreateProductSchema: z.ZodObject<{
800
307
  categoryId: z.ZodString;
801
308
  unitOfMeasureId: z.ZodString;
802
309
  taxId: z.ZodString;
803
- }, "strip", z.ZodTypeAny, {
804
- code: string;
805
- name: string;
806
- categoryId: string;
807
- unitOfMeasureId: string;
808
- taxId: string;
809
- description?: string | undefined;
810
- }, {
811
- code: string;
812
- name: string;
813
- categoryId: string;
814
- unitOfMeasureId: string;
815
- taxId: string;
816
- description?: string | undefined;
817
- }>;
310
+ }, z.core.$strip>;
818
311
  declare const UpdateProductSchema: z.ZodObject<{
819
312
  code: z.ZodOptional<z.ZodString>;
820
313
  name: z.ZodOptional<z.ZodString>;
@@ -822,202 +315,36 @@ declare const UpdateProductSchema: z.ZodObject<{
822
315
  categoryId: z.ZodOptional<z.ZodString>;
823
316
  unitOfMeasureId: z.ZodOptional<z.ZodString>;
824
317
  taxId: z.ZodOptional<z.ZodString>;
825
- } & {
826
318
  isActive: z.ZodOptional<z.ZodBoolean>;
827
- }, "strip", z.ZodTypeAny, {
828
- code?: string | undefined;
829
- isActive?: boolean | undefined;
830
- description?: string | undefined;
831
- name?: string | undefined;
832
- categoryId?: string | undefined;
833
- unitOfMeasureId?: string | undefined;
834
- taxId?: string | undefined;
835
- }, {
836
- code?: string | undefined;
837
- isActive?: boolean | undefined;
838
- description?: string | undefined;
839
- name?: string | undefined;
840
- categoryId?: string | undefined;
841
- unitOfMeasureId?: string | undefined;
842
- taxId?: string | undefined;
843
- }>;
319
+ }, z.core.$strip>;
844
320
  type Product = z.infer<typeof ProductSchema>;
845
321
  type CreateProduct = z.infer<typeof CreateProductSchema>;
846
322
  type UpdateProduct = z.infer<typeof UpdateProductSchema>;
847
323
 
848
324
  declare const productContract: {
849
325
  list: {
326
+ [x: string]: any;
850
327
  readonly query: zod.ZodObject<{
851
- page: zod.ZodDefault<zod.ZodNumber>;
852
- pageSize: zod.ZodDefault<zod.ZodNumber>;
328
+ page: zod.ZodDefault<zod.ZodCoercedNumber<unknown>>;
329
+ pageSize: zod.ZodDefault<zod.ZodCoercedNumber<unknown>>;
853
330
  sortBy: zod.ZodOptional<zod.ZodString>;
854
- sortOrder: zod.ZodDefault<zod.ZodEnum<["asc", "desc"]>>;
855
- }, "strip", zod.ZodTypeAny, {
856
- page: number;
857
- pageSize: number;
858
- sortOrder: "asc" | "desc";
859
- sortBy?: string | undefined;
860
- }, {
861
- page?: number | undefined;
862
- pageSize?: number | undefined;
863
- sortBy?: string | undefined;
864
- sortOrder?: "asc" | "desc" | undefined;
865
- }>;
331
+ sortOrder: zod.ZodDefault<zod.ZodEnum<{
332
+ asc: "asc";
333
+ desc: "desc";
334
+ }>>;
335
+ }, zod_v4_core.$strip>;
866
336
  readonly summary: `List all ${string}`;
867
337
  readonly method: "GET";
868
- path: `/${string}`;
869
- responses: {
870
- readonly 200: zod.ZodObject<{
871
- data: zod.ZodArray<zod.ZodObject<{
872
- id: zod.ZodString;
873
- code: zod.ZodString;
874
- name: zod.ZodString;
875
- description: zod.ZodOptional<zod.ZodString>;
876
- categoryId: zod.ZodString;
877
- unitOfMeasureId: zod.ZodString;
878
- taxId: zod.ZodString;
879
- isActive: zod.ZodDefault<zod.ZodBoolean>;
880
- createdAt: zod.ZodString;
881
- updatedAt: zod.ZodString;
882
- }, "strip", zod.ZodTypeAny, {
883
- code: string;
884
- id: string;
885
- isActive: boolean;
886
- createdAt: string;
887
- updatedAt: string;
888
- name: string;
889
- categoryId: string;
890
- unitOfMeasureId: string;
891
- taxId: string;
892
- description?: string | undefined;
893
- }, {
894
- code: string;
895
- id: string;
896
- createdAt: string;
897
- updatedAt: string;
898
- name: string;
899
- categoryId: string;
900
- unitOfMeasureId: string;
901
- taxId: string;
902
- isActive?: boolean | undefined;
903
- description?: string | undefined;
904
- }>, "many">;
905
- pagination: zod.ZodObject<{
906
- page: zod.ZodNumber;
907
- pageSize: zod.ZodNumber;
908
- total: zod.ZodNumber;
909
- totalPages: zod.ZodNumber;
910
- hasNext: zod.ZodBoolean;
911
- hasPrev: zod.ZodBoolean;
912
- }, "strip", zod.ZodTypeAny, {
913
- page: number;
914
- pageSize: number;
915
- total: number;
916
- totalPages: number;
917
- hasNext: boolean;
918
- hasPrev: boolean;
919
- }, {
920
- page: number;
921
- pageSize: number;
922
- total: number;
923
- totalPages: number;
924
- hasNext: boolean;
925
- hasPrev: boolean;
926
- }>;
927
- }, "strip", zod.ZodTypeAny, {
928
- data: {
929
- code: string;
930
- id: string;
931
- isActive: boolean;
932
- createdAt: string;
933
- updatedAt: string;
934
- name: string;
935
- categoryId: string;
936
- unitOfMeasureId: string;
937
- taxId: string;
938
- description?: string | undefined;
939
- }[];
940
- pagination: {
941
- page: number;
942
- pageSize: number;
943
- total: number;
944
- totalPages: number;
945
- hasNext: boolean;
946
- hasPrev: boolean;
947
- };
948
- }, {
949
- data: {
950
- code: string;
951
- id: string;
952
- createdAt: string;
953
- updatedAt: string;
954
- name: string;
955
- categoryId: string;
956
- unitOfMeasureId: string;
957
- taxId: string;
958
- isActive?: boolean | undefined;
959
- description?: string | undefined;
960
- }[];
961
- pagination: {
962
- page: number;
963
- pageSize: number;
964
- total: number;
965
- totalPages: number;
966
- hasNext: boolean;
967
- hasPrev: boolean;
968
- };
969
- }>;
970
- };
971
338
  };
972
339
  findById: {
340
+ [x: string]: any;
973
341
  readonly summary: `Find ${string} by ID`;
974
342
  readonly method: "GET";
975
- path: `/${string}/:id`;
976
- responses: {
977
- readonly 200: zod.ZodObject<{
978
- id: zod.ZodString;
979
- code: zod.ZodString;
980
- name: zod.ZodString;
981
- description: zod.ZodOptional<zod.ZodString>;
982
- categoryId: zod.ZodString;
983
- unitOfMeasureId: zod.ZodString;
984
- taxId: zod.ZodString;
985
- isActive: zod.ZodDefault<zod.ZodBoolean>;
986
- createdAt: zod.ZodString;
987
- updatedAt: zod.ZodString;
988
- }, "strip", zod.ZodTypeAny, {
989
- code: string;
990
- id: string;
991
- isActive: boolean;
992
- createdAt: string;
993
- updatedAt: string;
994
- name: string;
995
- categoryId: string;
996
- unitOfMeasureId: string;
997
- taxId: string;
998
- description?: string | undefined;
999
- }, {
1000
- code: string;
1001
- id: string;
1002
- createdAt: string;
1003
- updatedAt: string;
1004
- name: string;
1005
- categoryId: string;
1006
- unitOfMeasureId: string;
1007
- taxId: string;
1008
- isActive?: boolean | undefined;
1009
- description?: string | undefined;
1010
- }>;
1011
- readonly 404: zod.ZodObject<{
1012
- message: zod.ZodString;
1013
- }, "strip", zod.ZodTypeAny, {
1014
- message: string;
1015
- }, {
1016
- message: string;
1017
- }>;
1018
- };
1019
343
  };
1020
344
  create: {
345
+ [x: string]: any;
346
+ readonly summary: `Create a new ${string}`;
347
+ readonly method: "POST";
1021
348
  readonly body: zod.ZodObject<{
1022
349
  code: zod.ZodString;
1023
350
  name: zod.ZodString;
@@ -1025,62 +352,12 @@ declare const productContract: {
1025
352
  categoryId: zod.ZodString;
1026
353
  unitOfMeasureId: zod.ZodString;
1027
354
  taxId: zod.ZodString;
1028
- }, "strip", zod.ZodTypeAny, {
1029
- code: string;
1030
- name: string;
1031
- categoryId: string;
1032
- unitOfMeasureId: string;
1033
- taxId: string;
1034
- description?: string | undefined;
1035
- }, {
1036
- code: string;
1037
- name: string;
1038
- categoryId: string;
1039
- unitOfMeasureId: string;
1040
- taxId: string;
1041
- description?: string | undefined;
1042
- }>;
1043
- readonly summary: `Create a new ${string}`;
1044
- readonly method: "POST";
1045
- path: `/${string}`;
1046
- responses: {
1047
- readonly 201: zod.ZodObject<{
1048
- id: zod.ZodString;
1049
- code: zod.ZodString;
1050
- name: zod.ZodString;
1051
- description: zod.ZodOptional<zod.ZodString>;
1052
- categoryId: zod.ZodString;
1053
- unitOfMeasureId: zod.ZodString;
1054
- taxId: zod.ZodString;
1055
- isActive: zod.ZodDefault<zod.ZodBoolean>;
1056
- createdAt: zod.ZodString;
1057
- updatedAt: zod.ZodString;
1058
- }, "strip", zod.ZodTypeAny, {
1059
- code: string;
1060
- id: string;
1061
- isActive: boolean;
1062
- createdAt: string;
1063
- updatedAt: string;
1064
- name: string;
1065
- categoryId: string;
1066
- unitOfMeasureId: string;
1067
- taxId: string;
1068
- description?: string | undefined;
1069
- }, {
1070
- code: string;
1071
- id: string;
1072
- createdAt: string;
1073
- updatedAt: string;
1074
- name: string;
1075
- categoryId: string;
1076
- unitOfMeasureId: string;
1077
- taxId: string;
1078
- isActive?: boolean | undefined;
1079
- description?: string | undefined;
1080
- }>;
1081
- };
355
+ }, zod_v4_core.$strip>;
1082
356
  };
1083
357
  update: {
358
+ [x: string]: any;
359
+ readonly summary: `Update ${string} by ID`;
360
+ readonly method: "PUT";
1084
361
  readonly body: zod.ZodObject<{
1085
362
  code: zod.ZodOptional<zod.ZodString>;
1086
363
  name: zod.ZodOptional<zod.ZodString>;
@@ -1088,87 +365,14 @@ declare const productContract: {
1088
365
  categoryId: zod.ZodOptional<zod.ZodString>;
1089
366
  unitOfMeasureId: zod.ZodOptional<zod.ZodString>;
1090
367
  taxId: zod.ZodOptional<zod.ZodString>;
1091
- } & {
1092
368
  isActive: zod.ZodOptional<zod.ZodBoolean>;
1093
- }, "strip", zod.ZodTypeAny, {
1094
- code?: string | undefined;
1095
- isActive?: boolean | undefined;
1096
- description?: string | undefined;
1097
- name?: string | undefined;
1098
- categoryId?: string | undefined;
1099
- unitOfMeasureId?: string | undefined;
1100
- taxId?: string | undefined;
1101
- }, {
1102
- code?: string | undefined;
1103
- isActive?: boolean | undefined;
1104
- description?: string | undefined;
1105
- name?: string | undefined;
1106
- categoryId?: string | undefined;
1107
- unitOfMeasureId?: string | undefined;
1108
- taxId?: string | undefined;
1109
- }>;
1110
- readonly summary: `Update ${string} by ID`;
1111
- readonly method: "PUT";
1112
- path: `/${string}/:id`;
1113
- responses: {
1114
- readonly 200: zod.ZodObject<{
1115
- id: zod.ZodString;
1116
- code: zod.ZodString;
1117
- name: zod.ZodString;
1118
- description: zod.ZodOptional<zod.ZodString>;
1119
- categoryId: zod.ZodString;
1120
- unitOfMeasureId: zod.ZodString;
1121
- taxId: zod.ZodString;
1122
- isActive: zod.ZodDefault<zod.ZodBoolean>;
1123
- createdAt: zod.ZodString;
1124
- updatedAt: zod.ZodString;
1125
- }, "strip", zod.ZodTypeAny, {
1126
- code: string;
1127
- id: string;
1128
- isActive: boolean;
1129
- createdAt: string;
1130
- updatedAt: string;
1131
- name: string;
1132
- categoryId: string;
1133
- unitOfMeasureId: string;
1134
- taxId: string;
1135
- description?: string | undefined;
1136
- }, {
1137
- code: string;
1138
- id: string;
1139
- createdAt: string;
1140
- updatedAt: string;
1141
- name: string;
1142
- categoryId: string;
1143
- unitOfMeasureId: string;
1144
- taxId: string;
1145
- isActive?: boolean | undefined;
1146
- description?: string | undefined;
1147
- }>;
1148
- readonly 404: zod.ZodObject<{
1149
- message: zod.ZodString;
1150
- }, "strip", zod.ZodTypeAny, {
1151
- message: string;
1152
- }, {
1153
- message: string;
1154
- }>;
1155
- };
369
+ }, zod_v4_core.$strip>;
1156
370
  };
1157
371
  remove: {
1158
- readonly body: typeof _ts_rest_core.ContractNoBody;
372
+ [x: string]: any;
1159
373
  readonly summary: `Delete ${string} by ID`;
1160
374
  readonly method: "DELETE";
1161
- path: `/${string}/:id`;
1162
- responses: {
1163
- readonly 204: typeof _ts_rest_core.ContractNoBody;
1164
- readonly 404: zod.ZodObject<{
1165
- message: zod.ZodString;
1166
- }, "strip", zod.ZodTypeAny, {
1167
- message: string;
1168
- }, {
1169
- message: string;
1170
- }>;
1171
- };
375
+ readonly body: typeof _ts_rest_core.ContractNoBody;
1172
376
  };
1173
377
  };
1174
378
 
@@ -1181,45 +385,33 @@ declare const OrderItemSchema: z.ZodObject<{
1181
385
  subtotal: z.ZodNumber;
1182
386
  taxAmount: z.ZodNumber;
1183
387
  total: z.ZodNumber;
1184
- }, "strip", z.ZodTypeAny, {
1185
- total: number;
1186
- id: string;
1187
- orderId: string;
1188
- productId: string;
1189
- quantity: number;
1190
- unitPrice: number;
1191
- subtotal: number;
1192
- taxAmount: number;
1193
- }, {
1194
- total: number;
1195
- id: string;
1196
- orderId: string;
1197
- productId: string;
1198
- quantity: number;
1199
- unitPrice: number;
1200
- subtotal: number;
1201
- taxAmount: number;
1202
- }>;
388
+ }, z.core.$strip>;
1203
389
  declare const CreateOrderItemSchema: z.ZodObject<{
1204
390
  productId: z.ZodString;
1205
391
  quantity: z.ZodNumber;
1206
392
  unitPrice: z.ZodNumber;
1207
- }, "strip", z.ZodTypeAny, {
1208
- productId: string;
1209
- quantity: number;
1210
- unitPrice: number;
1211
- }, {
1212
- productId: string;
1213
- quantity: number;
1214
- unitPrice: number;
393
+ }, z.core.$strip>;
394
+ declare const OrderStatusSchema: z.ZodEnum<{
395
+ pending: "pending";
396
+ confirmed: "confirmed";
397
+ processing: "processing";
398
+ shipped: "shipped";
399
+ delivered: "delivered";
400
+ cancelled: "cancelled";
1215
401
  }>;
1216
- declare const OrderStatusSchema: z.ZodEnum<["pending", "confirmed", "processing", "shipped", "delivered", "cancelled"]>;
1217
402
  declare const OrderSchema: z.ZodObject<{
1218
403
  id: z.ZodString;
1219
404
  orderNumber: z.ZodString;
1220
405
  clientId: z.ZodString;
1221
406
  sellerId: z.ZodOptional<z.ZodString>;
1222
- status: z.ZodEnum<["pending", "confirmed", "processing", "shipped", "delivered", "cancelled"]>;
407
+ status: z.ZodEnum<{
408
+ pending: "pending";
409
+ confirmed: "confirmed";
410
+ processing: "processing";
411
+ shipped: "shipped";
412
+ delivered: "delivered";
413
+ cancelled: "cancelled";
414
+ }>;
1223
415
  subtotal: z.ZodNumber;
1224
416
  taxAmount: z.ZodNumber;
1225
417
  discountAmount: z.ZodDefault<z.ZodNumber>;
@@ -1236,72 +428,8 @@ declare const OrderSchema: z.ZodObject<{
1236
428
  subtotal: z.ZodNumber;
1237
429
  taxAmount: z.ZodNumber;
1238
430
  total: z.ZodNumber;
1239
- }, "strip", z.ZodTypeAny, {
1240
- total: number;
1241
- id: string;
1242
- orderId: string;
1243
- productId: string;
1244
- quantity: number;
1245
- unitPrice: number;
1246
- subtotal: number;
1247
- taxAmount: number;
1248
- }, {
1249
- total: number;
1250
- id: string;
1251
- orderId: string;
1252
- productId: string;
1253
- quantity: number;
1254
- unitPrice: number;
1255
- subtotal: number;
1256
- taxAmount: number;
1257
- }>, "many">>;
1258
- }, "strip", z.ZodTypeAny, {
1259
- status: "pending" | "confirmed" | "processing" | "shipped" | "delivered" | "cancelled";
1260
- total: number;
1261
- id: string;
1262
- createdAt: string;
1263
- updatedAt: string;
1264
- subtotal: number;
1265
- taxAmount: number;
1266
- orderNumber: string;
1267
- clientId: string;
1268
- discountAmount: number;
1269
- sellerId?: string | undefined;
1270
- notes?: string | undefined;
1271
- items?: {
1272
- total: number;
1273
- id: string;
1274
- orderId: string;
1275
- productId: string;
1276
- quantity: number;
1277
- unitPrice: number;
1278
- subtotal: number;
1279
- taxAmount: number;
1280
- }[] | undefined;
1281
- }, {
1282
- status: "pending" | "confirmed" | "processing" | "shipped" | "delivered" | "cancelled";
1283
- total: number;
1284
- id: string;
1285
- createdAt: string;
1286
- updatedAt: string;
1287
- subtotal: number;
1288
- taxAmount: number;
1289
- orderNumber: string;
1290
- clientId: string;
1291
- sellerId?: string | undefined;
1292
- discountAmount?: number | undefined;
1293
- notes?: string | undefined;
1294
- items?: {
1295
- total: number;
1296
- id: string;
1297
- orderId: string;
1298
- productId: string;
1299
- quantity: number;
1300
- unitPrice: number;
1301
- subtotal: number;
1302
- taxAmount: number;
1303
- }[] | undefined;
1304
- }>;
431
+ }, z.core.$strip>>>;
432
+ }, z.core.$strip>;
1305
433
  declare const CreateOrderSchema: z.ZodObject<{
1306
434
  clientId: z.ZodString;
1307
435
  sellerId: z.ZodOptional<z.ZodString>;
@@ -1310,41 +438,18 @@ declare const CreateOrderSchema: z.ZodObject<{
1310
438
  productId: z.ZodString;
1311
439
  quantity: z.ZodNumber;
1312
440
  unitPrice: z.ZodNumber;
1313
- }, "strip", z.ZodTypeAny, {
1314
- productId: string;
1315
- quantity: number;
1316
- unitPrice: number;
1317
- }, {
1318
- productId: string;
1319
- quantity: number;
1320
- unitPrice: number;
1321
- }>, "many">;
1322
- }, "strip", z.ZodTypeAny, {
1323
- clientId: string;
1324
- items: {
1325
- productId: string;
1326
- quantity: number;
1327
- unitPrice: number;
1328
- }[];
1329
- sellerId?: string | undefined;
1330
- notes?: string | undefined;
1331
- }, {
1332
- clientId: string;
1333
- items: {
1334
- productId: string;
1335
- quantity: number;
1336
- unitPrice: number;
1337
- }[];
1338
- sellerId?: string | undefined;
1339
- notes?: string | undefined;
1340
- }>;
441
+ }, z.core.$strip>>;
442
+ }, z.core.$strip>;
1341
443
  declare const UpdateOrderStatusSchema: z.ZodObject<{
1342
- status: z.ZodEnum<["pending", "confirmed", "processing", "shipped", "delivered", "cancelled"]>;
1343
- }, "strip", z.ZodTypeAny, {
1344
- status: "pending" | "confirmed" | "processing" | "shipped" | "delivered" | "cancelled";
1345
- }, {
1346
- status: "pending" | "confirmed" | "processing" | "shipped" | "delivered" | "cancelled";
1347
- }>;
444
+ status: z.ZodEnum<{
445
+ pending: "pending";
446
+ confirmed: "confirmed";
447
+ processing: "processing";
448
+ shipped: "shipped";
449
+ delivered: "delivered";
450
+ cancelled: "cancelled";
451
+ }>;
452
+ }, z.core.$strip>;
1348
453
  type OrderItem = z.infer<typeof OrderItemSchema>;
1349
454
  type CreateOrderItem = z.infer<typeof CreateOrderItemSchema>;
1350
455
  type Order = z.infer<typeof OrderSchema>;
@@ -1354,309 +459,28 @@ type OrderStatus = z.infer<typeof OrderStatusSchema>;
1354
459
 
1355
460
  declare const orderContract: {
1356
461
  list: {
462
+ [x: string]: any;
1357
463
  readonly query: zod.ZodObject<{
1358
- page: zod.ZodDefault<zod.ZodNumber>;
1359
- pageSize: zod.ZodDefault<zod.ZodNumber>;
464
+ page: zod.ZodDefault<zod.ZodCoercedNumber<unknown>>;
465
+ pageSize: zod.ZodDefault<zod.ZodCoercedNumber<unknown>>;
1360
466
  sortBy: zod.ZodOptional<zod.ZodString>;
1361
- sortOrder: zod.ZodDefault<zod.ZodEnum<["asc", "desc"]>>;
1362
- }, "strip", zod.ZodTypeAny, {
1363
- page: number;
1364
- pageSize: number;
1365
- sortOrder: "asc" | "desc";
1366
- sortBy?: string | undefined;
1367
- }, {
1368
- page?: number | undefined;
1369
- pageSize?: number | undefined;
1370
- sortBy?: string | undefined;
1371
- sortOrder?: "asc" | "desc" | undefined;
1372
- }>;
467
+ sortOrder: zod.ZodDefault<zod.ZodEnum<{
468
+ asc: "asc";
469
+ desc: "desc";
470
+ }>>;
471
+ }, zod_v4_core.$strip>;
1373
472
  readonly summary: `List all ${string}`;
1374
473
  readonly method: "GET";
1375
- path: `/${string}`;
1376
- responses: {
1377
- readonly 200: zod.ZodObject<{
1378
- data: zod.ZodArray<zod.ZodObject<{
1379
- id: zod.ZodString;
1380
- orderNumber: zod.ZodString;
1381
- clientId: zod.ZodString;
1382
- sellerId: zod.ZodOptional<zod.ZodString>;
1383
- status: zod.ZodEnum<["pending", "confirmed", "processing", "shipped", "delivered", "cancelled"]>;
1384
- subtotal: zod.ZodNumber;
1385
- taxAmount: zod.ZodNumber;
1386
- discountAmount: zod.ZodDefault<zod.ZodNumber>;
1387
- total: zod.ZodNumber;
1388
- notes: zod.ZodOptional<zod.ZodString>;
1389
- createdAt: zod.ZodString;
1390
- updatedAt: zod.ZodString;
1391
- items: zod.ZodOptional<zod.ZodArray<zod.ZodObject<{
1392
- id: zod.ZodString;
1393
- orderId: zod.ZodString;
1394
- productId: zod.ZodString;
1395
- quantity: zod.ZodNumber;
1396
- unitPrice: zod.ZodNumber;
1397
- subtotal: zod.ZodNumber;
1398
- taxAmount: zod.ZodNumber;
1399
- total: zod.ZodNumber;
1400
- }, "strip", zod.ZodTypeAny, {
1401
- total: number;
1402
- id: string;
1403
- orderId: string;
1404
- productId: string;
1405
- quantity: number;
1406
- unitPrice: number;
1407
- subtotal: number;
1408
- taxAmount: number;
1409
- }, {
1410
- total: number;
1411
- id: string;
1412
- orderId: string;
1413
- productId: string;
1414
- quantity: number;
1415
- unitPrice: number;
1416
- subtotal: number;
1417
- taxAmount: number;
1418
- }>, "many">>;
1419
- }, "strip", zod.ZodTypeAny, {
1420
- status: "pending" | "confirmed" | "processing" | "shipped" | "delivered" | "cancelled";
1421
- total: number;
1422
- id: string;
1423
- createdAt: string;
1424
- updatedAt: string;
1425
- subtotal: number;
1426
- taxAmount: number;
1427
- orderNumber: string;
1428
- clientId: string;
1429
- discountAmount: number;
1430
- sellerId?: string | undefined;
1431
- notes?: string | undefined;
1432
- items?: {
1433
- total: number;
1434
- id: string;
1435
- orderId: string;
1436
- productId: string;
1437
- quantity: number;
1438
- unitPrice: number;
1439
- subtotal: number;
1440
- taxAmount: number;
1441
- }[] | undefined;
1442
- }, {
1443
- status: "pending" | "confirmed" | "processing" | "shipped" | "delivered" | "cancelled";
1444
- total: number;
1445
- id: string;
1446
- createdAt: string;
1447
- updatedAt: string;
1448
- subtotal: number;
1449
- taxAmount: number;
1450
- orderNumber: string;
1451
- clientId: string;
1452
- sellerId?: string | undefined;
1453
- discountAmount?: number | undefined;
1454
- notes?: string | undefined;
1455
- items?: {
1456
- total: number;
1457
- id: string;
1458
- orderId: string;
1459
- productId: string;
1460
- quantity: number;
1461
- unitPrice: number;
1462
- subtotal: number;
1463
- taxAmount: number;
1464
- }[] | undefined;
1465
- }>, "many">;
1466
- pagination: zod.ZodObject<{
1467
- page: zod.ZodNumber;
1468
- pageSize: zod.ZodNumber;
1469
- total: zod.ZodNumber;
1470
- totalPages: zod.ZodNumber;
1471
- hasNext: zod.ZodBoolean;
1472
- hasPrev: zod.ZodBoolean;
1473
- }, "strip", zod.ZodTypeAny, {
1474
- page: number;
1475
- pageSize: number;
1476
- total: number;
1477
- totalPages: number;
1478
- hasNext: boolean;
1479
- hasPrev: boolean;
1480
- }, {
1481
- page: number;
1482
- pageSize: number;
1483
- total: number;
1484
- totalPages: number;
1485
- hasNext: boolean;
1486
- hasPrev: boolean;
1487
- }>;
1488
- }, "strip", zod.ZodTypeAny, {
1489
- data: {
1490
- status: "pending" | "confirmed" | "processing" | "shipped" | "delivered" | "cancelled";
1491
- total: number;
1492
- id: string;
1493
- createdAt: string;
1494
- updatedAt: string;
1495
- subtotal: number;
1496
- taxAmount: number;
1497
- orderNumber: string;
1498
- clientId: string;
1499
- discountAmount: number;
1500
- sellerId?: string | undefined;
1501
- notes?: string | undefined;
1502
- items?: {
1503
- total: number;
1504
- id: string;
1505
- orderId: string;
1506
- productId: string;
1507
- quantity: number;
1508
- unitPrice: number;
1509
- subtotal: number;
1510
- taxAmount: number;
1511
- }[] | undefined;
1512
- }[];
1513
- pagination: {
1514
- page: number;
1515
- pageSize: number;
1516
- total: number;
1517
- totalPages: number;
1518
- hasNext: boolean;
1519
- hasPrev: boolean;
1520
- };
1521
- }, {
1522
- data: {
1523
- status: "pending" | "confirmed" | "processing" | "shipped" | "delivered" | "cancelled";
1524
- total: number;
1525
- id: string;
1526
- createdAt: string;
1527
- updatedAt: string;
1528
- subtotal: number;
1529
- taxAmount: number;
1530
- orderNumber: string;
1531
- clientId: string;
1532
- sellerId?: string | undefined;
1533
- discountAmount?: number | undefined;
1534
- notes?: string | undefined;
1535
- items?: {
1536
- total: number;
1537
- id: string;
1538
- orderId: string;
1539
- productId: string;
1540
- quantity: number;
1541
- unitPrice: number;
1542
- subtotal: number;
1543
- taxAmount: number;
1544
- }[] | undefined;
1545
- }[];
1546
- pagination: {
1547
- page: number;
1548
- pageSize: number;
1549
- total: number;
1550
- totalPages: number;
1551
- hasNext: boolean;
1552
- hasPrev: boolean;
1553
- };
1554
- }>;
1555
- };
1556
474
  };
1557
475
  findById: {
476
+ [x: string]: any;
1558
477
  readonly summary: `Find ${string} by ID`;
1559
478
  readonly method: "GET";
1560
- path: `/${string}/:id`;
1561
- responses: {
1562
- readonly 200: zod.ZodObject<{
1563
- id: zod.ZodString;
1564
- orderNumber: zod.ZodString;
1565
- clientId: zod.ZodString;
1566
- sellerId: zod.ZodOptional<zod.ZodString>;
1567
- status: zod.ZodEnum<["pending", "confirmed", "processing", "shipped", "delivered", "cancelled"]>;
1568
- subtotal: zod.ZodNumber;
1569
- taxAmount: zod.ZodNumber;
1570
- discountAmount: zod.ZodDefault<zod.ZodNumber>;
1571
- total: zod.ZodNumber;
1572
- notes: zod.ZodOptional<zod.ZodString>;
1573
- createdAt: zod.ZodString;
1574
- updatedAt: zod.ZodString;
1575
- items: zod.ZodOptional<zod.ZodArray<zod.ZodObject<{
1576
- id: zod.ZodString;
1577
- orderId: zod.ZodString;
1578
- productId: zod.ZodString;
1579
- quantity: zod.ZodNumber;
1580
- unitPrice: zod.ZodNumber;
1581
- subtotal: zod.ZodNumber;
1582
- taxAmount: zod.ZodNumber;
1583
- total: zod.ZodNumber;
1584
- }, "strip", zod.ZodTypeAny, {
1585
- total: number;
1586
- id: string;
1587
- orderId: string;
1588
- productId: string;
1589
- quantity: number;
1590
- unitPrice: number;
1591
- subtotal: number;
1592
- taxAmount: number;
1593
- }, {
1594
- total: number;
1595
- id: string;
1596
- orderId: string;
1597
- productId: string;
1598
- quantity: number;
1599
- unitPrice: number;
1600
- subtotal: number;
1601
- taxAmount: number;
1602
- }>, "many">>;
1603
- }, "strip", zod.ZodTypeAny, {
1604
- status: "pending" | "confirmed" | "processing" | "shipped" | "delivered" | "cancelled";
1605
- total: number;
1606
- id: string;
1607
- createdAt: string;
1608
- updatedAt: string;
1609
- subtotal: number;
1610
- taxAmount: number;
1611
- orderNumber: string;
1612
- clientId: string;
1613
- discountAmount: number;
1614
- sellerId?: string | undefined;
1615
- notes?: string | undefined;
1616
- items?: {
1617
- total: number;
1618
- id: string;
1619
- orderId: string;
1620
- productId: string;
1621
- quantity: number;
1622
- unitPrice: number;
1623
- subtotal: number;
1624
- taxAmount: number;
1625
- }[] | undefined;
1626
- }, {
1627
- status: "pending" | "confirmed" | "processing" | "shipped" | "delivered" | "cancelled";
1628
- total: number;
1629
- id: string;
1630
- createdAt: string;
1631
- updatedAt: string;
1632
- subtotal: number;
1633
- taxAmount: number;
1634
- orderNumber: string;
1635
- clientId: string;
1636
- sellerId?: string | undefined;
1637
- discountAmount?: number | undefined;
1638
- notes?: string | undefined;
1639
- items?: {
1640
- total: number;
1641
- id: string;
1642
- orderId: string;
1643
- productId: string;
1644
- quantity: number;
1645
- unitPrice: number;
1646
- subtotal: number;
1647
- taxAmount: number;
1648
- }[] | undefined;
1649
- }>;
1650
- readonly 404: zod.ZodObject<{
1651
- message: zod.ZodString;
1652
- }, "strip", zod.ZodTypeAny, {
1653
- message: string;
1654
- }, {
1655
- message: string;
1656
- }>;
1657
- };
1658
479
  };
1659
480
  create: {
481
+ [x: string]: any;
482
+ readonly summary: `Create a new ${string}`;
483
+ readonly method: "POST";
1660
484
  readonly body: zod.ZodObject<{
1661
485
  clientId: zod.ZodString;
1662
486
  sellerId: zod.ZodOptional<zod.ZodString>;
@@ -1665,252 +489,29 @@ declare const orderContract: {
1665
489
  productId: zod.ZodString;
1666
490
  quantity: zod.ZodNumber;
1667
491
  unitPrice: zod.ZodNumber;
1668
- }, "strip", zod.ZodTypeAny, {
1669
- productId: string;
1670
- quantity: number;
1671
- unitPrice: number;
1672
- }, {
1673
- productId: string;
1674
- quantity: number;
1675
- unitPrice: number;
1676
- }>, "many">;
1677
- }, "strip", zod.ZodTypeAny, {
1678
- clientId: string;
1679
- items: {
1680
- productId: string;
1681
- quantity: number;
1682
- unitPrice: number;
1683
- }[];
1684
- sellerId?: string | undefined;
1685
- notes?: string | undefined;
1686
- }, {
1687
- clientId: string;
1688
- items: {
1689
- productId: string;
1690
- quantity: number;
1691
- unitPrice: number;
1692
- }[];
1693
- sellerId?: string | undefined;
1694
- notes?: string | undefined;
1695
- }>;
1696
- readonly summary: `Create a new ${string}`;
1697
- readonly method: "POST";
1698
- path: `/${string}`;
1699
- responses: {
1700
- readonly 201: zod.ZodObject<{
1701
- id: zod.ZodString;
1702
- orderNumber: zod.ZodString;
1703
- clientId: zod.ZodString;
1704
- sellerId: zod.ZodOptional<zod.ZodString>;
1705
- status: zod.ZodEnum<["pending", "confirmed", "processing", "shipped", "delivered", "cancelled"]>;
1706
- subtotal: zod.ZodNumber;
1707
- taxAmount: zod.ZodNumber;
1708
- discountAmount: zod.ZodDefault<zod.ZodNumber>;
1709
- total: zod.ZodNumber;
1710
- notes: zod.ZodOptional<zod.ZodString>;
1711
- createdAt: zod.ZodString;
1712
- updatedAt: zod.ZodString;
1713
- items: zod.ZodOptional<zod.ZodArray<zod.ZodObject<{
1714
- id: zod.ZodString;
1715
- orderId: zod.ZodString;
1716
- productId: zod.ZodString;
1717
- quantity: zod.ZodNumber;
1718
- unitPrice: zod.ZodNumber;
1719
- subtotal: zod.ZodNumber;
1720
- taxAmount: zod.ZodNumber;
1721
- total: zod.ZodNumber;
1722
- }, "strip", zod.ZodTypeAny, {
1723
- total: number;
1724
- id: string;
1725
- orderId: string;
1726
- productId: string;
1727
- quantity: number;
1728
- unitPrice: number;
1729
- subtotal: number;
1730
- taxAmount: number;
1731
- }, {
1732
- total: number;
1733
- id: string;
1734
- orderId: string;
1735
- productId: string;
1736
- quantity: number;
1737
- unitPrice: number;
1738
- subtotal: number;
1739
- taxAmount: number;
1740
- }>, "many">>;
1741
- }, "strip", zod.ZodTypeAny, {
1742
- status: "pending" | "confirmed" | "processing" | "shipped" | "delivered" | "cancelled";
1743
- total: number;
1744
- id: string;
1745
- createdAt: string;
1746
- updatedAt: string;
1747
- subtotal: number;
1748
- taxAmount: number;
1749
- orderNumber: string;
1750
- clientId: string;
1751
- discountAmount: number;
1752
- sellerId?: string | undefined;
1753
- notes?: string | undefined;
1754
- items?: {
1755
- total: number;
1756
- id: string;
1757
- orderId: string;
1758
- productId: string;
1759
- quantity: number;
1760
- unitPrice: number;
1761
- subtotal: number;
1762
- taxAmount: number;
1763
- }[] | undefined;
1764
- }, {
1765
- status: "pending" | "confirmed" | "processing" | "shipped" | "delivered" | "cancelled";
1766
- total: number;
1767
- id: string;
1768
- createdAt: string;
1769
- updatedAt: string;
1770
- subtotal: number;
1771
- taxAmount: number;
1772
- orderNumber: string;
1773
- clientId: string;
1774
- sellerId?: string | undefined;
1775
- discountAmount?: number | undefined;
1776
- notes?: string | undefined;
1777
- items?: {
1778
- total: number;
1779
- id: string;
1780
- orderId: string;
1781
- productId: string;
1782
- quantity: number;
1783
- unitPrice: number;
1784
- subtotal: number;
1785
- taxAmount: number;
1786
- }[] | undefined;
1787
- }>;
1788
- };
492
+ }, zod_v4_core.$strip>>;
493
+ }, zod_v4_core.$strip>;
1789
494
  };
1790
495
  update: {
1791
- readonly body: zod.ZodObject<{
1792
- status: zod.ZodEnum<["pending", "confirmed", "processing", "shipped", "delivered", "cancelled"]>;
1793
- }, "strip", zod.ZodTypeAny, {
1794
- status: "pending" | "confirmed" | "processing" | "shipped" | "delivered" | "cancelled";
1795
- }, {
1796
- status: "pending" | "confirmed" | "processing" | "shipped" | "delivered" | "cancelled";
1797
- }>;
496
+ [x: string]: any;
1798
497
  readonly summary: `Update ${string} by ID`;
1799
498
  readonly method: "PUT";
1800
- path: `/${string}/:id`;
1801
- responses: {
1802
- readonly 200: zod.ZodObject<{
1803
- id: zod.ZodString;
1804
- orderNumber: zod.ZodString;
1805
- clientId: zod.ZodString;
1806
- sellerId: zod.ZodOptional<zod.ZodString>;
1807
- status: zod.ZodEnum<["pending", "confirmed", "processing", "shipped", "delivered", "cancelled"]>;
1808
- subtotal: zod.ZodNumber;
1809
- taxAmount: zod.ZodNumber;
1810
- discountAmount: zod.ZodDefault<zod.ZodNumber>;
1811
- total: zod.ZodNumber;
1812
- notes: zod.ZodOptional<zod.ZodString>;
1813
- createdAt: zod.ZodString;
1814
- updatedAt: zod.ZodString;
1815
- items: zod.ZodOptional<zod.ZodArray<zod.ZodObject<{
1816
- id: zod.ZodString;
1817
- orderId: zod.ZodString;
1818
- productId: zod.ZodString;
1819
- quantity: zod.ZodNumber;
1820
- unitPrice: zod.ZodNumber;
1821
- subtotal: zod.ZodNumber;
1822
- taxAmount: zod.ZodNumber;
1823
- total: zod.ZodNumber;
1824
- }, "strip", zod.ZodTypeAny, {
1825
- total: number;
1826
- id: string;
1827
- orderId: string;
1828
- productId: string;
1829
- quantity: number;
1830
- unitPrice: number;
1831
- subtotal: number;
1832
- taxAmount: number;
1833
- }, {
1834
- total: number;
1835
- id: string;
1836
- orderId: string;
1837
- productId: string;
1838
- quantity: number;
1839
- unitPrice: number;
1840
- subtotal: number;
1841
- taxAmount: number;
1842
- }>, "many">>;
1843
- }, "strip", zod.ZodTypeAny, {
1844
- status: "pending" | "confirmed" | "processing" | "shipped" | "delivered" | "cancelled";
1845
- total: number;
1846
- id: string;
1847
- createdAt: string;
1848
- updatedAt: string;
1849
- subtotal: number;
1850
- taxAmount: number;
1851
- orderNumber: string;
1852
- clientId: string;
1853
- discountAmount: number;
1854
- sellerId?: string | undefined;
1855
- notes?: string | undefined;
1856
- items?: {
1857
- total: number;
1858
- id: string;
1859
- orderId: string;
1860
- productId: string;
1861
- quantity: number;
1862
- unitPrice: number;
1863
- subtotal: number;
1864
- taxAmount: number;
1865
- }[] | undefined;
1866
- }, {
1867
- status: "pending" | "confirmed" | "processing" | "shipped" | "delivered" | "cancelled";
1868
- total: number;
1869
- id: string;
1870
- createdAt: string;
1871
- updatedAt: string;
1872
- subtotal: number;
1873
- taxAmount: number;
1874
- orderNumber: string;
1875
- clientId: string;
1876
- sellerId?: string | undefined;
1877
- discountAmount?: number | undefined;
1878
- notes?: string | undefined;
1879
- items?: {
1880
- total: number;
1881
- id: string;
1882
- orderId: string;
1883
- productId: string;
1884
- quantity: number;
1885
- unitPrice: number;
1886
- subtotal: number;
1887
- taxAmount: number;
1888
- }[] | undefined;
1889
- }>;
1890
- readonly 404: zod.ZodObject<{
1891
- message: zod.ZodString;
1892
- }, "strip", zod.ZodTypeAny, {
1893
- message: string;
1894
- }, {
1895
- message: string;
499
+ readonly body: zod.ZodObject<{
500
+ status: zod.ZodEnum<{
501
+ pending: "pending";
502
+ confirmed: "confirmed";
503
+ processing: "processing";
504
+ shipped: "shipped";
505
+ delivered: "delivered";
506
+ cancelled: "cancelled";
1896
507
  }>;
1897
- };
508
+ }, zod_v4_core.$strip>;
1898
509
  };
1899
510
  remove: {
1900
- readonly body: typeof _ts_rest_core.ContractNoBody;
511
+ [x: string]: any;
1901
512
  readonly summary: `Delete ${string} by ID`;
1902
513
  readonly method: "DELETE";
1903
- path: `/${string}/:id`;
1904
- responses: {
1905
- readonly 204: typeof _ts_rest_core.ContractNoBody;
1906
- readonly 404: zod.ZodObject<{
1907
- message: zod.ZodString;
1908
- }, "strip", zod.ZodTypeAny, {
1909
- message: string;
1910
- }, {
1911
- message: string;
1912
- }>;
1913
- };
514
+ readonly body: typeof _ts_rest_core.ContractNoBody;
1914
515
  };
1915
516
  };
1916
517