@develemit/commerce-contracts 0.0.0-stage → 0.2.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.
@@ -0,0 +1,429 @@
1
+ import { z } from 'zod';
2
+
3
+ declare const moneySchema: z.ZodObject<{
4
+ amountCents: z.ZodNumber;
5
+ currency: z.ZodString;
6
+ }, z.core.$strip>;
7
+ type Money = z.infer<typeof moneySchema>;
8
+
9
+ declare const productImageSchema: z.ZodObject<{
10
+ url: z.ZodString;
11
+ alt: z.ZodString;
12
+ }, z.core.$strip>;
13
+ declare const availabilitySchema: z.ZodEnum<{
14
+ available: "available";
15
+ sold: "sold";
16
+ reserved: "reserved";
17
+ }>;
18
+ declare const productSchema: z.ZodObject<{
19
+ id: z.ZodString;
20
+ slug: z.ZodString;
21
+ name: z.ZodString;
22
+ description: z.ZodString;
23
+ materials: z.ZodOptional<z.ZodString>;
24
+ dimensions: z.ZodOptional<z.ZodString>;
25
+ priceCents: z.ZodNumber;
26
+ currency: z.ZodString;
27
+ category: z.ZodString;
28
+ images: z.ZodArray<z.ZodObject<{
29
+ url: z.ZodString;
30
+ alt: z.ZodString;
31
+ }, z.core.$strip>>;
32
+ quantity: z.ZodNumber;
33
+ availability: z.ZodEnum<{
34
+ available: "available";
35
+ sold: "sold";
36
+ reserved: "reserved";
37
+ }>;
38
+ featured: z.ZodBoolean;
39
+ }, z.core.$strip>;
40
+ declare const categorySchema: z.ZodObject<{
41
+ slug: z.ZodString;
42
+ label: z.ZodString;
43
+ count: z.ZodNumber;
44
+ }, z.core.$strip>;
45
+ declare const productListQuerySchema: z.ZodObject<{
46
+ category: z.ZodOptional<z.ZodString>;
47
+ featured: z.ZodOptional<z.ZodBoolean>;
48
+ }, z.core.$strip>;
49
+ type ProductImage = z.infer<typeof productImageSchema>;
50
+ type ProductAvailability = z.infer<typeof availabilitySchema>;
51
+ type Product = z.infer<typeof productSchema>;
52
+ type Category = z.infer<typeof categorySchema>;
53
+ type ProductListQuery = z.infer<typeof productListQuerySchema>;
54
+
55
+ declare const cartLineSchema: z.ZodObject<{
56
+ productId: z.ZodString;
57
+ slug: z.ZodString;
58
+ name: z.ZodString;
59
+ priceCents: z.ZodNumber;
60
+ currency: z.ZodString;
61
+ imageUrl: z.ZodOptional<z.ZodString>;
62
+ quantity: z.ZodNumber;
63
+ maxQuantity: z.ZodNumber;
64
+ }, z.core.$strip>;
65
+ type CartLine = z.infer<typeof cartLineSchema>;
66
+
67
+ declare const checkoutRequestSchema: z.ZodObject<{
68
+ items: z.ZodArray<z.ZodObject<{
69
+ productId: z.ZodString;
70
+ quantity: z.ZodNumber;
71
+ }, z.core.$strip>>;
72
+ }, z.core.$strip>;
73
+ declare const checkoutResponseSchema: z.ZodObject<{
74
+ url: z.ZodString;
75
+ }, z.core.$strip>;
76
+ declare const checkoutConflictSchema: z.ZodObject<{
77
+ unavailableProductIds: z.ZodArray<z.ZodString>;
78
+ }, z.core.$strip>;
79
+ type CheckoutRequest = z.infer<typeof checkoutRequestSchema>;
80
+ type CheckoutResponse = z.infer<typeof checkoutResponseSchema>;
81
+ type CheckoutConflict = z.infer<typeof checkoutConflictSchema>;
82
+
83
+ declare const orderStatusSchema: z.ZodEnum<{
84
+ pending: "pending";
85
+ paid: "paid";
86
+ shipped: "shipped";
87
+ cancelled: "cancelled";
88
+ expired: "expired";
89
+ needs_attention: "needs_attention";
90
+ refunded: "refunded";
91
+ }>;
92
+ declare const orderFulfillmentSchema: z.ZodObject<{
93
+ carrier: z.ZodNullable<z.ZodString>;
94
+ trackingNumber: z.ZodNullable<z.ZodString>;
95
+ trackingUrl: z.ZodNullable<z.ZodString>;
96
+ shippedAt: z.ZodString;
97
+ }, z.core.$strip>;
98
+ declare const orderRefundSchema: z.ZodObject<{
99
+ id: z.ZodString;
100
+ amountCents: z.ZodNumber;
101
+ reason: z.ZodNullable<z.ZodString>;
102
+ restocked: z.ZodBoolean;
103
+ source: z.ZodEnum<{
104
+ admin: "admin";
105
+ gateway: "gateway";
106
+ }>;
107
+ status: z.ZodEnum<{
108
+ pending: "pending";
109
+ succeeded: "succeeded";
110
+ }>;
111
+ createdAt: z.ZodString;
112
+ }, z.core.$strip>;
113
+ declare const orderSummarySchema: z.ZodObject<{
114
+ id: z.ZodString;
115
+ status: z.ZodEnum<{
116
+ pending: "pending";
117
+ paid: "paid";
118
+ shipped: "shipped";
119
+ cancelled: "cancelled";
120
+ expired: "expired";
121
+ needs_attention: "needs_attention";
122
+ refunded: "refunded";
123
+ }>;
124
+ subtotalCents: z.ZodNumber;
125
+ shippingCents: z.ZodNumber;
126
+ shippingLabel: z.ZodNullable<z.ZodString>;
127
+ totalCents: z.ZodNumber;
128
+ currency: z.ZodString;
129
+ items: z.ZodArray<z.ZodObject<{
130
+ productId: z.ZodString;
131
+ name: z.ZodString;
132
+ priceCents: z.ZodNumber;
133
+ quantity: z.ZodNumber;
134
+ }, z.core.$strip>>;
135
+ fulfillment: z.ZodNullable<z.ZodObject<{
136
+ carrier: z.ZodNullable<z.ZodString>;
137
+ trackingNumber: z.ZodNullable<z.ZodString>;
138
+ trackingUrl: z.ZodNullable<z.ZodString>;
139
+ shippedAt: z.ZodString;
140
+ }, z.core.$strip>>;
141
+ createdAt: z.ZodString;
142
+ }, z.core.$strip>;
143
+ declare const orderAddressSchema: z.ZodObject<{
144
+ name: z.ZodOptional<z.ZodString>;
145
+ line1: z.ZodOptional<z.ZodString>;
146
+ line2: z.ZodOptional<z.ZodString>;
147
+ city: z.ZodOptional<z.ZodString>;
148
+ state: z.ZodOptional<z.ZodString>;
149
+ postalCode: z.ZodOptional<z.ZodString>;
150
+ country: z.ZodOptional<z.ZodString>;
151
+ }, z.core.$strip>;
152
+ declare const orderDetailSchema: z.ZodObject<{
153
+ email: z.ZodNullable<z.ZodString>;
154
+ shippingAddress: z.ZodNullable<z.ZodObject<{
155
+ name: z.ZodOptional<z.ZodString>;
156
+ line1: z.ZodOptional<z.ZodString>;
157
+ line2: z.ZodOptional<z.ZodString>;
158
+ city: z.ZodOptional<z.ZodString>;
159
+ state: z.ZodOptional<z.ZodString>;
160
+ postalCode: z.ZodOptional<z.ZodString>;
161
+ country: z.ZodOptional<z.ZodString>;
162
+ }, z.core.$strip>>;
163
+ id: z.ZodString;
164
+ status: z.ZodEnum<{
165
+ pending: "pending";
166
+ paid: "paid";
167
+ shipped: "shipped";
168
+ cancelled: "cancelled";
169
+ expired: "expired";
170
+ needs_attention: "needs_attention";
171
+ refunded: "refunded";
172
+ }>;
173
+ subtotalCents: z.ZodNumber;
174
+ shippingCents: z.ZodNumber;
175
+ shippingLabel: z.ZodNullable<z.ZodString>;
176
+ totalCents: z.ZodNumber;
177
+ currency: z.ZodString;
178
+ items: z.ZodArray<z.ZodObject<{
179
+ productId: z.ZodString;
180
+ name: z.ZodString;
181
+ priceCents: z.ZodNumber;
182
+ quantity: z.ZodNumber;
183
+ }, z.core.$strip>>;
184
+ fulfillment: z.ZodNullable<z.ZodObject<{
185
+ carrier: z.ZodNullable<z.ZodString>;
186
+ trackingNumber: z.ZodNullable<z.ZodString>;
187
+ trackingUrl: z.ZodNullable<z.ZodString>;
188
+ shippedAt: z.ZodString;
189
+ }, z.core.$strip>>;
190
+ createdAt: z.ZodString;
191
+ }, z.core.$strip>;
192
+ type OrderStatus = z.infer<typeof orderStatusSchema>;
193
+ type OrderFulfillment = z.infer<typeof orderFulfillmentSchema>;
194
+ type OrderRefund = z.infer<typeof orderRefundSchema>;
195
+ type OrderSummary = z.infer<typeof orderSummarySchema>;
196
+ type OrderAddress = z.infer<typeof orderAddressSchema>;
197
+ type OrderDetail = z.infer<typeof orderDetailSchema>;
198
+
199
+ declare const shippingRateSchema: z.ZodObject<{
200
+ label: z.ZodString;
201
+ amountCents: z.ZodNumber;
202
+ currency: z.ZodString;
203
+ minDays: z.ZodOptional<z.ZodNullable<z.ZodNumber>>;
204
+ maxDays: z.ZodOptional<z.ZodNullable<z.ZodNumber>>;
205
+ active: z.ZodDefault<z.ZodBoolean>;
206
+ sort: z.ZodDefault<z.ZodNumber>;
207
+ }, z.core.$strip>;
208
+ declare const shippingRatesInputSchema: z.ZodArray<z.ZodObject<{
209
+ label: z.ZodString;
210
+ amountCents: z.ZodNumber;
211
+ currency: z.ZodString;
212
+ minDays: z.ZodOptional<z.ZodNullable<z.ZodNumber>>;
213
+ maxDays: z.ZodOptional<z.ZodNullable<z.ZodNumber>>;
214
+ active: z.ZodDefault<z.ZodBoolean>;
215
+ sort: z.ZodDefault<z.ZodNumber>;
216
+ }, z.core.$strip>>;
217
+ type ShippingRate = z.infer<typeof shippingRateSchema>;
218
+ type ShippingRateInput = z.input<typeof shippingRateSchema>;
219
+
220
+ declare const productStatusSchema: z.ZodEnum<{
221
+ active: "active";
222
+ draft: "draft";
223
+ archived: "archived";
224
+ }>;
225
+ declare const adminProductInputSchema: z.ZodObject<{
226
+ name: z.ZodString;
227
+ materials: z.ZodOptional<z.ZodNullable<z.ZodString>>;
228
+ dimensions: z.ZodOptional<z.ZodNullable<z.ZodString>>;
229
+ priceCents: z.ZodNumber;
230
+ currency: z.ZodOptional<z.ZodString>;
231
+ category: z.ZodString;
232
+ description: z.ZodDefault<z.ZodString>;
233
+ quantity: z.ZodDefault<z.ZodNumber>;
234
+ status: z.ZodDefault<z.ZodEnum<{
235
+ active: "active";
236
+ draft: "draft";
237
+ archived: "archived";
238
+ }>>;
239
+ featured: z.ZodDefault<z.ZodBoolean>;
240
+ }, z.core.$strip>;
241
+ declare const adminProductPatchSchema: z.ZodObject<{
242
+ name: z.ZodOptional<z.ZodString>;
243
+ description: z.ZodOptional<z.ZodString>;
244
+ materials: z.ZodOptional<z.ZodOptional<z.ZodNullable<z.ZodString>>>;
245
+ dimensions: z.ZodOptional<z.ZodOptional<z.ZodNullable<z.ZodString>>>;
246
+ priceCents: z.ZodOptional<z.ZodNumber>;
247
+ currency: z.ZodOptional<z.ZodOptional<z.ZodString>>;
248
+ category: z.ZodOptional<z.ZodString>;
249
+ quantity: z.ZodOptional<z.ZodNumber>;
250
+ status: z.ZodOptional<z.ZodEnum<{
251
+ active: "active";
252
+ draft: "draft";
253
+ archived: "archived";
254
+ }>>;
255
+ featured: z.ZodOptional<z.ZodBoolean>;
256
+ sold: z.ZodOptional<z.ZodBoolean>;
257
+ }, z.core.$strip>;
258
+ declare const adminProductImageSchema: z.ZodObject<{
259
+ id: z.ZodString;
260
+ url: z.ZodString;
261
+ alt: z.ZodString;
262
+ position: z.ZodNumber;
263
+ }, z.core.$strip>;
264
+ declare const adminProductSchema: z.ZodObject<{
265
+ id: z.ZodString;
266
+ slug: z.ZodString;
267
+ name: z.ZodString;
268
+ description: z.ZodString;
269
+ materials: z.ZodNullable<z.ZodString>;
270
+ dimensions: z.ZodNullable<z.ZodString>;
271
+ priceCents: z.ZodNumber;
272
+ currency: z.ZodString;
273
+ category: z.ZodString;
274
+ quantity: z.ZodNumber;
275
+ status: z.ZodEnum<{
276
+ active: "active";
277
+ draft: "draft";
278
+ archived: "archived";
279
+ }>;
280
+ featured: z.ZodBoolean;
281
+ images: z.ZodArray<z.ZodObject<{
282
+ id: z.ZodString;
283
+ url: z.ZodString;
284
+ alt: z.ZodString;
285
+ position: z.ZodNumber;
286
+ }, z.core.$strip>>;
287
+ }, z.core.$strip>;
288
+ declare const imageOrderInputSchema: z.ZodObject<{
289
+ imageIds: z.ZodArray<z.ZodString>;
290
+ }, z.core.$strip>;
291
+ type ProductStatus = z.infer<typeof productStatusSchema>;
292
+ type AdminProductInput = z.input<typeof adminProductInputSchema>;
293
+ type AdminProductPatch = z.input<typeof adminProductPatchSchema>;
294
+ type AdminProductImage = z.infer<typeof adminProductImageSchema>;
295
+ type AdminProduct = z.infer<typeof adminProductSchema>;
296
+ type ImageOrderInput = z.infer<typeof imageOrderInputSchema>;
297
+
298
+ declare const adminOrderListQuerySchema: z.ZodObject<{
299
+ status: z.ZodOptional<z.ZodEnum<{
300
+ pending: "pending";
301
+ paid: "paid";
302
+ shipped: "shipped";
303
+ cancelled: "cancelled";
304
+ expired: "expired";
305
+ needs_attention: "needs_attention";
306
+ refunded: "refunded";
307
+ }>>;
308
+ q: z.ZodOptional<z.ZodString>;
309
+ hasPendingRefund: z.ZodOptional<z.ZodPipe<z.ZodEnum<{
310
+ true: "true";
311
+ false: "false";
312
+ }>, z.ZodTransform<boolean, "true" | "false">>>;
313
+ cursor: z.ZodOptional<z.ZodString>;
314
+ limit: z.ZodDefault<z.ZodCoercedNumber<unknown>>;
315
+ }, z.core.$strip>;
316
+ declare const adminOrderListItemSchema: z.ZodObject<{
317
+ id: z.ZodString;
318
+ status: z.ZodEnum<{
319
+ pending: "pending";
320
+ paid: "paid";
321
+ shipped: "shipped";
322
+ cancelled: "cancelled";
323
+ expired: "expired";
324
+ needs_attention: "needs_attention";
325
+ refunded: "refunded";
326
+ }>;
327
+ email: z.ZodNullable<z.ZodString>;
328
+ totalCents: z.ZodNumber;
329
+ currency: z.ZodString;
330
+ itemCount: z.ZodNumber;
331
+ createdAt: z.ZodString;
332
+ }, z.core.$strip>;
333
+ declare const adminOrderPageSchema: z.ZodObject<{
334
+ items: z.ZodArray<z.ZodObject<{
335
+ id: z.ZodString;
336
+ status: z.ZodEnum<{
337
+ pending: "pending";
338
+ paid: "paid";
339
+ shipped: "shipped";
340
+ cancelled: "cancelled";
341
+ expired: "expired";
342
+ needs_attention: "needs_attention";
343
+ refunded: "refunded";
344
+ }>;
345
+ email: z.ZodNullable<z.ZodString>;
346
+ totalCents: z.ZodNumber;
347
+ currency: z.ZodString;
348
+ itemCount: z.ZodNumber;
349
+ createdAt: z.ZodString;
350
+ }, z.core.$strip>>;
351
+ nextCursor: z.ZodNullable<z.ZodString>;
352
+ }, z.core.$strip>;
353
+ declare const adminOrderDetailSchema: z.ZodObject<{
354
+ email: z.ZodNullable<z.ZodString>;
355
+ shippingAddress: z.ZodNullable<z.ZodObject<{
356
+ name: z.ZodOptional<z.ZodString>;
357
+ line1: z.ZodOptional<z.ZodString>;
358
+ line2: z.ZodOptional<z.ZodString>;
359
+ city: z.ZodOptional<z.ZodString>;
360
+ state: z.ZodOptional<z.ZodString>;
361
+ postalCode: z.ZodOptional<z.ZodString>;
362
+ country: z.ZodOptional<z.ZodString>;
363
+ }, z.core.$strip>>;
364
+ id: z.ZodString;
365
+ status: z.ZodEnum<{
366
+ pending: "pending";
367
+ paid: "paid";
368
+ shipped: "shipped";
369
+ cancelled: "cancelled";
370
+ expired: "expired";
371
+ needs_attention: "needs_attention";
372
+ refunded: "refunded";
373
+ }>;
374
+ subtotalCents: z.ZodNumber;
375
+ shippingCents: z.ZodNumber;
376
+ shippingLabel: z.ZodNullable<z.ZodString>;
377
+ totalCents: z.ZodNumber;
378
+ currency: z.ZodString;
379
+ items: z.ZodArray<z.ZodObject<{
380
+ productId: z.ZodString;
381
+ name: z.ZodString;
382
+ priceCents: z.ZodNumber;
383
+ quantity: z.ZodNumber;
384
+ }, z.core.$strip>>;
385
+ fulfillment: z.ZodNullable<z.ZodObject<{
386
+ carrier: z.ZodNullable<z.ZodString>;
387
+ trackingNumber: z.ZodNullable<z.ZodString>;
388
+ trackingUrl: z.ZodNullable<z.ZodString>;
389
+ shippedAt: z.ZodString;
390
+ }, z.core.$strip>>;
391
+ createdAt: z.ZodString;
392
+ refunds: z.ZodArray<z.ZodObject<{
393
+ id: z.ZodString;
394
+ amountCents: z.ZodNumber;
395
+ reason: z.ZodNullable<z.ZodString>;
396
+ restocked: z.ZodBoolean;
397
+ source: z.ZodEnum<{
398
+ admin: "admin";
399
+ gateway: "gateway";
400
+ }>;
401
+ status: z.ZodEnum<{
402
+ pending: "pending";
403
+ succeeded: "succeeded";
404
+ }>;
405
+ createdAt: z.ZodString;
406
+ }, z.core.$strip>>;
407
+ refundedCents: z.ZodNumber;
408
+ checkoutSessionId: z.ZodNullable<z.ZodString>;
409
+ updatedAt: z.ZodString;
410
+ }, z.core.$strip>;
411
+ declare const shipOrderInputSchema: z.ZodObject<{
412
+ carrier: z.ZodOptional<z.ZodString>;
413
+ trackingNumber: z.ZodOptional<z.ZodString>;
414
+ trackingUrl: z.ZodOptional<z.ZodString>;
415
+ }, z.core.$strip>;
416
+ declare const refundOrderInputSchema: z.ZodObject<{
417
+ amountCents: z.ZodOptional<z.ZodNumber>;
418
+ reason: z.ZodOptional<z.ZodString>;
419
+ restock: z.ZodDefault<z.ZodBoolean>;
420
+ }, z.core.$strip>;
421
+ type AdminOrderListQuery = z.infer<typeof adminOrderListQuerySchema>;
422
+ type AdminOrderListItem = z.infer<typeof adminOrderListItemSchema>;
423
+ type AdminOrderPage = z.infer<typeof adminOrderPageSchema>;
424
+ type AdminOrderDetail = z.infer<typeof adminOrderDetailSchema>;
425
+ type ShipOrderInput = z.infer<typeof shipOrderInputSchema>;
426
+ type RefundOrderInput = z.infer<typeof refundOrderInputSchema>;
427
+
428
+ export { adminOrderDetailSchema, adminOrderListItemSchema, adminOrderListQuerySchema, adminOrderPageSchema, adminProductImageSchema, adminProductInputSchema, adminProductPatchSchema, adminProductSchema, availabilitySchema, cartLineSchema, categorySchema, checkoutConflictSchema, checkoutRequestSchema, checkoutResponseSchema, imageOrderInputSchema, moneySchema, orderAddressSchema, orderDetailSchema, orderFulfillmentSchema, orderRefundSchema, orderStatusSchema, orderSummarySchema, productImageSchema, productListQuerySchema, productSchema, productStatusSchema, refundOrderInputSchema, shipOrderInputSchema, shippingRateSchema, shippingRatesInputSchema };
429
+ export type { AdminOrderDetail, AdminOrderListItem, AdminOrderListQuery, AdminOrderPage, AdminProduct, AdminProductImage, AdminProductInput, AdminProductPatch, CartLine, Category, CheckoutConflict, CheckoutRequest, CheckoutResponse, ImageOrderInput, Money, OrderAddress, OrderDetail, OrderFulfillment, OrderRefund, OrderStatus, OrderSummary, Product, ProductAvailability, ProductImage, ProductListQuery, ProductStatus, RefundOrderInput, ShipOrderInput, ShippingRate, ShippingRateInput };