@develemit/commerce-contracts 0.2.0 → 0.4.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.
- package/dist/index.cjs +293 -124
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +241 -3
- package/dist/index.d.ts +241 -3
- package/dist/index.js +276 -124
- package/dist/index.js.map +1 -1
- package/package.json +1 -1
package/dist/index.d.cts
CHANGED
|
@@ -37,6 +37,25 @@ declare const productSchema: z.ZodObject<{
|
|
|
37
37
|
}>;
|
|
38
38
|
featured: z.ZodBoolean;
|
|
39
39
|
}, z.core.$strip>;
|
|
40
|
+
declare const productCardSchema: z.ZodObject<{
|
|
41
|
+
currency: z.ZodString;
|
|
42
|
+
slug: z.ZodString;
|
|
43
|
+
name: z.ZodString;
|
|
44
|
+
priceCents: z.ZodNumber;
|
|
45
|
+
quantity: z.ZodNumber;
|
|
46
|
+
availability: z.ZodEnum<{
|
|
47
|
+
available: "available";
|
|
48
|
+
sold: "sold";
|
|
49
|
+
reserved: "reserved";
|
|
50
|
+
}>;
|
|
51
|
+
id: z.ZodString;
|
|
52
|
+
category: z.ZodString;
|
|
53
|
+
featured: z.ZodBoolean;
|
|
54
|
+
images: z.ZodArray<z.ZodObject<{
|
|
55
|
+
url: z.ZodString;
|
|
56
|
+
alt: z.ZodString;
|
|
57
|
+
}, z.core.$strip>>;
|
|
58
|
+
}, z.core.$strip>;
|
|
40
59
|
declare const categorySchema: z.ZodObject<{
|
|
41
60
|
slug: z.ZodString;
|
|
42
61
|
label: z.ZodString;
|
|
@@ -45,12 +64,38 @@ declare const categorySchema: z.ZodObject<{
|
|
|
45
64
|
declare const productListQuerySchema: z.ZodObject<{
|
|
46
65
|
category: z.ZodOptional<z.ZodString>;
|
|
47
66
|
featured: z.ZodOptional<z.ZodBoolean>;
|
|
67
|
+
limit: z.ZodDefault<z.ZodCoercedNumber<unknown>>;
|
|
68
|
+
cursor: z.ZodOptional<z.ZodString>;
|
|
69
|
+
}, z.core.$strip>;
|
|
70
|
+
declare const productCardPageSchema: z.ZodObject<{
|
|
71
|
+
items: z.ZodArray<z.ZodObject<{
|
|
72
|
+
currency: z.ZodString;
|
|
73
|
+
slug: z.ZodString;
|
|
74
|
+
name: z.ZodString;
|
|
75
|
+
priceCents: z.ZodNumber;
|
|
76
|
+
quantity: z.ZodNumber;
|
|
77
|
+
availability: z.ZodEnum<{
|
|
78
|
+
available: "available";
|
|
79
|
+
sold: "sold";
|
|
80
|
+
reserved: "reserved";
|
|
81
|
+
}>;
|
|
82
|
+
id: z.ZodString;
|
|
83
|
+
category: z.ZodString;
|
|
84
|
+
featured: z.ZodBoolean;
|
|
85
|
+
images: z.ZodArray<z.ZodObject<{
|
|
86
|
+
url: z.ZodString;
|
|
87
|
+
alt: z.ZodString;
|
|
88
|
+
}, z.core.$strip>>;
|
|
89
|
+
}, z.core.$strip>>;
|
|
90
|
+
nextCursor: z.ZodNullable<z.ZodString>;
|
|
48
91
|
}, z.core.$strip>;
|
|
49
92
|
type ProductImage = z.infer<typeof productImageSchema>;
|
|
50
93
|
type ProductAvailability = z.infer<typeof availabilitySchema>;
|
|
51
94
|
type Product = z.infer<typeof productSchema>;
|
|
95
|
+
type ProductCard = z.infer<typeof productCardSchema>;
|
|
96
|
+
type ProductCardPage = z.infer<typeof productCardPageSchema>;
|
|
52
97
|
type Category = z.infer<typeof categorySchema>;
|
|
53
|
-
type ProductListQuery = z.
|
|
98
|
+
type ProductListQuery = z.input<typeof productListQuerySchema>;
|
|
54
99
|
|
|
55
100
|
declare const cartLineSchema: z.ZodObject<{
|
|
56
101
|
productId: z.ZodString;
|
|
@@ -69,6 +114,7 @@ declare const checkoutRequestSchema: z.ZodObject<{
|
|
|
69
114
|
productId: z.ZodString;
|
|
70
115
|
quantity: z.ZodNumber;
|
|
71
116
|
}, z.core.$strip>>;
|
|
117
|
+
discountCode: z.ZodOptional<z.ZodPipe<z.ZodPipe<z.ZodString, z.ZodTransform<string, string>>, z.ZodString>>;
|
|
72
118
|
}, z.core.$strip>;
|
|
73
119
|
declare const checkoutResponseSchema: z.ZodObject<{
|
|
74
120
|
url: z.ZodString;
|
|
@@ -122,6 +168,8 @@ declare const orderSummarySchema: z.ZodObject<{
|
|
|
122
168
|
refunded: "refunded";
|
|
123
169
|
}>;
|
|
124
170
|
subtotalCents: z.ZodNumber;
|
|
171
|
+
discountCents: z.ZodDefault<z.ZodNumber>;
|
|
172
|
+
discountCode: z.ZodDefault<z.ZodNullable<z.ZodString>>;
|
|
125
173
|
shippingCents: z.ZodNumber;
|
|
126
174
|
shippingLabel: z.ZodNullable<z.ZodString>;
|
|
127
175
|
totalCents: z.ZodNumber;
|
|
@@ -171,6 +219,8 @@ declare const orderDetailSchema: z.ZodObject<{
|
|
|
171
219
|
refunded: "refunded";
|
|
172
220
|
}>;
|
|
173
221
|
subtotalCents: z.ZodNumber;
|
|
222
|
+
discountCents: z.ZodDefault<z.ZodNumber>;
|
|
223
|
+
discountCode: z.ZodDefault<z.ZodNullable<z.ZodString>>;
|
|
174
224
|
shippingCents: z.ZodNumber;
|
|
175
225
|
shippingLabel: z.ZodNullable<z.ZodString>;
|
|
176
226
|
totalCents: z.ZodNumber;
|
|
@@ -288,12 +338,59 @@ declare const adminProductSchema: z.ZodObject<{
|
|
|
288
338
|
declare const imageOrderInputSchema: z.ZodObject<{
|
|
289
339
|
imageIds: z.ZodArray<z.ZodString>;
|
|
290
340
|
}, z.core.$strip>;
|
|
341
|
+
declare const productImagePatchSchema: z.ZodObject<{
|
|
342
|
+
alt: z.ZodString;
|
|
343
|
+
}, z.core.$strip>;
|
|
344
|
+
declare const adminProductListQuerySchema: z.ZodObject<{
|
|
345
|
+
status: z.ZodOptional<z.ZodEnum<{
|
|
346
|
+
active: "active";
|
|
347
|
+
draft: "draft";
|
|
348
|
+
archived: "archived";
|
|
349
|
+
}>>;
|
|
350
|
+
stock: z.ZodOptional<z.ZodEnum<{
|
|
351
|
+
sold: "sold";
|
|
352
|
+
in: "in";
|
|
353
|
+
}>>;
|
|
354
|
+
q: z.ZodOptional<z.ZodString>;
|
|
355
|
+
cursor: z.ZodOptional<z.ZodString>;
|
|
356
|
+
limit: z.ZodDefault<z.ZodCoercedNumber<unknown>>;
|
|
357
|
+
}, z.core.$strip>;
|
|
358
|
+
declare const adminProductPageSchema: z.ZodObject<{
|
|
359
|
+
items: z.ZodArray<z.ZodObject<{
|
|
360
|
+
id: z.ZodString;
|
|
361
|
+
slug: z.ZodString;
|
|
362
|
+
name: z.ZodString;
|
|
363
|
+
description: z.ZodString;
|
|
364
|
+
materials: z.ZodNullable<z.ZodString>;
|
|
365
|
+
dimensions: z.ZodNullable<z.ZodString>;
|
|
366
|
+
priceCents: z.ZodNumber;
|
|
367
|
+
currency: z.ZodString;
|
|
368
|
+
category: z.ZodString;
|
|
369
|
+
quantity: z.ZodNumber;
|
|
370
|
+
status: z.ZodEnum<{
|
|
371
|
+
active: "active";
|
|
372
|
+
draft: "draft";
|
|
373
|
+
archived: "archived";
|
|
374
|
+
}>;
|
|
375
|
+
featured: z.ZodBoolean;
|
|
376
|
+
images: z.ZodArray<z.ZodObject<{
|
|
377
|
+
id: z.ZodString;
|
|
378
|
+
url: z.ZodString;
|
|
379
|
+
alt: z.ZodString;
|
|
380
|
+
position: z.ZodNumber;
|
|
381
|
+
}, z.core.$strip>>;
|
|
382
|
+
}, z.core.$strip>>;
|
|
383
|
+
nextCursor: z.ZodNullable<z.ZodString>;
|
|
384
|
+
}, z.core.$strip>;
|
|
291
385
|
type ProductStatus = z.infer<typeof productStatusSchema>;
|
|
292
386
|
type AdminProductInput = z.input<typeof adminProductInputSchema>;
|
|
293
387
|
type AdminProductPatch = z.input<typeof adminProductPatchSchema>;
|
|
294
388
|
type AdminProductImage = z.infer<typeof adminProductImageSchema>;
|
|
295
389
|
type AdminProduct = z.infer<typeof adminProductSchema>;
|
|
390
|
+
type ProductImagePatch = z.infer<typeof productImagePatchSchema>;
|
|
296
391
|
type ImageOrderInput = z.infer<typeof imageOrderInputSchema>;
|
|
392
|
+
type AdminProductListQuery = z.input<typeof adminProductListQuerySchema>;
|
|
393
|
+
type AdminProductPage = z.infer<typeof adminProductPageSchema>;
|
|
297
394
|
|
|
298
395
|
declare const adminOrderListQuerySchema: z.ZodObject<{
|
|
299
396
|
status: z.ZodOptional<z.ZodEnum<{
|
|
@@ -372,6 +469,8 @@ declare const adminOrderDetailSchema: z.ZodObject<{
|
|
|
372
469
|
refunded: "refunded";
|
|
373
470
|
}>;
|
|
374
471
|
subtotalCents: z.ZodNumber;
|
|
472
|
+
discountCents: z.ZodDefault<z.ZodNumber>;
|
|
473
|
+
discountCode: z.ZodDefault<z.ZodNullable<z.ZodString>>;
|
|
375
474
|
shippingCents: z.ZodNumber;
|
|
376
475
|
shippingLabel: z.ZodNullable<z.ZodString>;
|
|
377
476
|
totalCents: z.ZodNumber;
|
|
@@ -425,5 +524,144 @@ type AdminOrderDetail = z.infer<typeof adminOrderDetailSchema>;
|
|
|
425
524
|
type ShipOrderInput = z.infer<typeof shipOrderInputSchema>;
|
|
426
525
|
type RefundOrderInput = z.infer<typeof refundOrderInputSchema>;
|
|
427
526
|
|
|
428
|
-
|
|
429
|
-
|
|
527
|
+
declare const discountTypeSchema: z.ZodEnum<{
|
|
528
|
+
percent: "percent";
|
|
529
|
+
fixed: "fixed";
|
|
530
|
+
}>;
|
|
531
|
+
declare const discountCodeSchema: z.ZodPipe<z.ZodPipe<z.ZodString, z.ZodTransform<string, string>>, z.ZodString>;
|
|
532
|
+
declare const discountSchema: z.ZodObject<{
|
|
533
|
+
redeemedCount: z.ZodNumber;
|
|
534
|
+
reservedCount: z.ZodNumber;
|
|
535
|
+
createdAt: z.ZodString;
|
|
536
|
+
minSubtotalCents: z.ZodOptional<z.ZodNullable<z.ZodNumber>>;
|
|
537
|
+
startsAt: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
538
|
+
endsAt: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
539
|
+
maxRedemptions: z.ZodOptional<z.ZodNullable<z.ZodNumber>>;
|
|
540
|
+
active: z.ZodBoolean;
|
|
541
|
+
type: z.ZodEnum<{
|
|
542
|
+
percent: "percent";
|
|
543
|
+
fixed: "fixed";
|
|
544
|
+
}>;
|
|
545
|
+
percentOff: z.ZodOptional<z.ZodNullable<z.ZodNumber>>;
|
|
546
|
+
amountOffCents: z.ZodOptional<z.ZodNullable<z.ZodNumber>>;
|
|
547
|
+
currency: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
548
|
+
id: z.ZodString;
|
|
549
|
+
code: z.ZodPipe<z.ZodPipe<z.ZodString, z.ZodTransform<string, string>>, z.ZodString>;
|
|
550
|
+
}, z.core.$strip>;
|
|
551
|
+
declare const discountInputSchema: z.ZodObject<{
|
|
552
|
+
active: z.ZodDefault<z.ZodBoolean>;
|
|
553
|
+
minSubtotalCents: z.ZodOptional<z.ZodNullable<z.ZodNumber>>;
|
|
554
|
+
startsAt: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
555
|
+
endsAt: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
556
|
+
maxRedemptions: z.ZodOptional<z.ZodNullable<z.ZodNumber>>;
|
|
557
|
+
type: z.ZodEnum<{
|
|
558
|
+
percent: "percent";
|
|
559
|
+
fixed: "fixed";
|
|
560
|
+
}>;
|
|
561
|
+
percentOff: z.ZodOptional<z.ZodNullable<z.ZodNumber>>;
|
|
562
|
+
amountOffCents: z.ZodOptional<z.ZodNullable<z.ZodNumber>>;
|
|
563
|
+
currency: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
564
|
+
code: z.ZodPipe<z.ZodPipe<z.ZodString, z.ZodTransform<string, string>>, z.ZodString>;
|
|
565
|
+
}, z.core.$strip>;
|
|
566
|
+
declare const discountPatchSchema: z.ZodObject<{
|
|
567
|
+
minSubtotalCents: z.ZodOptional<z.ZodOptional<z.ZodNullable<z.ZodNumber>>>;
|
|
568
|
+
startsAt: z.ZodOptional<z.ZodOptional<z.ZodNullable<z.ZodString>>>;
|
|
569
|
+
endsAt: z.ZodOptional<z.ZodOptional<z.ZodNullable<z.ZodString>>>;
|
|
570
|
+
maxRedemptions: z.ZodOptional<z.ZodOptional<z.ZodNullable<z.ZodNumber>>>;
|
|
571
|
+
active: z.ZodOptional<z.ZodBoolean>;
|
|
572
|
+
type: z.ZodOptional<z.ZodEnum<{
|
|
573
|
+
percent: "percent";
|
|
574
|
+
fixed: "fixed";
|
|
575
|
+
}>>;
|
|
576
|
+
percentOff: z.ZodOptional<z.ZodOptional<z.ZodNullable<z.ZodNumber>>>;
|
|
577
|
+
amountOffCents: z.ZodOptional<z.ZodOptional<z.ZodNullable<z.ZodNumber>>>;
|
|
578
|
+
currency: z.ZodOptional<z.ZodOptional<z.ZodNullable<z.ZodString>>>;
|
|
579
|
+
code: z.ZodOptional<z.ZodPipe<z.ZodPipe<z.ZodString, z.ZodTransform<string, string>>, z.ZodString>>;
|
|
580
|
+
}, z.core.$strip>;
|
|
581
|
+
declare const discountStatusSchema: z.ZodEnum<{
|
|
582
|
+
expired: "expired";
|
|
583
|
+
active: "active";
|
|
584
|
+
inactive: "inactive";
|
|
585
|
+
scheduled: "scheduled";
|
|
586
|
+
}>;
|
|
587
|
+
declare const adminDiscountListQuerySchema: z.ZodObject<{
|
|
588
|
+
status: z.ZodOptional<z.ZodEnum<{
|
|
589
|
+
expired: "expired";
|
|
590
|
+
active: "active";
|
|
591
|
+
inactive: "inactive";
|
|
592
|
+
scheduled: "scheduled";
|
|
593
|
+
}>>;
|
|
594
|
+
q: z.ZodOptional<z.ZodString>;
|
|
595
|
+
cursor: z.ZodOptional<z.ZodString>;
|
|
596
|
+
limit: z.ZodDefault<z.ZodCoercedNumber<unknown>>;
|
|
597
|
+
}, z.core.$strip>;
|
|
598
|
+
declare const adminDiscountPageSchema: z.ZodObject<{
|
|
599
|
+
items: z.ZodArray<z.ZodObject<{
|
|
600
|
+
redeemedCount: z.ZodNumber;
|
|
601
|
+
reservedCount: z.ZodNumber;
|
|
602
|
+
createdAt: z.ZodString;
|
|
603
|
+
minSubtotalCents: z.ZodOptional<z.ZodNullable<z.ZodNumber>>;
|
|
604
|
+
startsAt: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
605
|
+
endsAt: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
606
|
+
maxRedemptions: z.ZodOptional<z.ZodNullable<z.ZodNumber>>;
|
|
607
|
+
active: z.ZodBoolean;
|
|
608
|
+
type: z.ZodEnum<{
|
|
609
|
+
percent: "percent";
|
|
610
|
+
fixed: "fixed";
|
|
611
|
+
}>;
|
|
612
|
+
percentOff: z.ZodOptional<z.ZodNullable<z.ZodNumber>>;
|
|
613
|
+
amountOffCents: z.ZodOptional<z.ZodNullable<z.ZodNumber>>;
|
|
614
|
+
currency: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
615
|
+
id: z.ZodString;
|
|
616
|
+
code: z.ZodPipe<z.ZodPipe<z.ZodString, z.ZodTransform<string, string>>, z.ZodString>;
|
|
617
|
+
}, z.core.$strip>>;
|
|
618
|
+
nextCursor: z.ZodNullable<z.ZodString>;
|
|
619
|
+
}, z.core.$strip>;
|
|
620
|
+
declare const discountPreviewRequestSchema: z.ZodObject<{
|
|
621
|
+
code: z.ZodPipe<z.ZodPipe<z.ZodString, z.ZodTransform<string, string>>, z.ZodString>;
|
|
622
|
+
items: z.ZodArray<z.ZodObject<{
|
|
623
|
+
productId: z.ZodString;
|
|
624
|
+
quantity: z.ZodNumber;
|
|
625
|
+
}, z.core.$strip>>;
|
|
626
|
+
}, z.core.$strip>;
|
|
627
|
+
declare const discountPreviewSchema: z.ZodObject<{
|
|
628
|
+
code: z.ZodString;
|
|
629
|
+
discountCents: z.ZodNumber;
|
|
630
|
+
subtotalCents: z.ZodNumber;
|
|
631
|
+
currency: z.ZodString;
|
|
632
|
+
}, z.core.$strip>;
|
|
633
|
+
declare const discountRejectionReasonSchema: z.ZodEnum<{
|
|
634
|
+
currency: "currency";
|
|
635
|
+
expired: "expired";
|
|
636
|
+
inactive: "inactive";
|
|
637
|
+
not_found: "not_found";
|
|
638
|
+
not_started: "not_started";
|
|
639
|
+
min_subtotal: "min_subtotal";
|
|
640
|
+
exhausted: "exhausted";
|
|
641
|
+
}>;
|
|
642
|
+
declare const discountRejectionSchema: z.ZodObject<{
|
|
643
|
+
error: z.ZodLiteral<"DISCOUNT_INVALID">;
|
|
644
|
+
reason: z.ZodEnum<{
|
|
645
|
+
currency: "currency";
|
|
646
|
+
expired: "expired";
|
|
647
|
+
inactive: "inactive";
|
|
648
|
+
not_found: "not_found";
|
|
649
|
+
not_started: "not_started";
|
|
650
|
+
min_subtotal: "min_subtotal";
|
|
651
|
+
exhausted: "exhausted";
|
|
652
|
+
}>;
|
|
653
|
+
}, z.core.$strip>;
|
|
654
|
+
type DiscountType = z.infer<typeof discountTypeSchema>;
|
|
655
|
+
type Discount = z.infer<typeof discountSchema>;
|
|
656
|
+
type DiscountStatus = z.infer<typeof discountStatusSchema>;
|
|
657
|
+
type AdminDiscountListQuery = z.infer<typeof adminDiscountListQuerySchema>;
|
|
658
|
+
type AdminDiscountPage = z.infer<typeof adminDiscountPageSchema>;
|
|
659
|
+
type DiscountInput = z.input<typeof discountInputSchema>;
|
|
660
|
+
type DiscountPatch = z.input<typeof discountPatchSchema>;
|
|
661
|
+
type DiscountPreviewRequest = z.input<typeof discountPreviewRequestSchema>;
|
|
662
|
+
type DiscountPreview = z.infer<typeof discountPreviewSchema>;
|
|
663
|
+
type DiscountRejectionReason = z.infer<typeof discountRejectionReasonSchema>;
|
|
664
|
+
type DiscountRejection = z.infer<typeof discountRejectionSchema>;
|
|
665
|
+
|
|
666
|
+
export { adminDiscountListQuerySchema, adminDiscountPageSchema, adminOrderDetailSchema, adminOrderListItemSchema, adminOrderListQuerySchema, adminOrderPageSchema, adminProductImageSchema, adminProductInputSchema, adminProductListQuerySchema, adminProductPageSchema, adminProductPatchSchema, adminProductSchema, availabilitySchema, cartLineSchema, categorySchema, checkoutConflictSchema, checkoutRequestSchema, checkoutResponseSchema, discountCodeSchema, discountInputSchema, discountPatchSchema, discountPreviewRequestSchema, discountPreviewSchema, discountRejectionReasonSchema, discountRejectionSchema, discountSchema, discountStatusSchema, discountTypeSchema, imageOrderInputSchema, moneySchema, orderAddressSchema, orderDetailSchema, orderFulfillmentSchema, orderRefundSchema, orderStatusSchema, orderSummarySchema, productCardPageSchema, productCardSchema, productImagePatchSchema, productImageSchema, productListQuerySchema, productSchema, productStatusSchema, refundOrderInputSchema, shipOrderInputSchema, shippingRateSchema, shippingRatesInputSchema };
|
|
667
|
+
export type { AdminDiscountListQuery, AdminDiscountPage, AdminOrderDetail, AdminOrderListItem, AdminOrderListQuery, AdminOrderPage, AdminProduct, AdminProductImage, AdminProductInput, AdminProductListQuery, AdminProductPage, AdminProductPatch, CartLine, Category, CheckoutConflict, CheckoutRequest, CheckoutResponse, Discount, DiscountInput, DiscountPatch, DiscountPreview, DiscountPreviewRequest, DiscountRejection, DiscountRejectionReason, DiscountStatus, DiscountType, ImageOrderInput, Money, OrderAddress, OrderDetail, OrderFulfillment, OrderRefund, OrderStatus, OrderSummary, Product, ProductAvailability, ProductCard, ProductCardPage, ProductImage, ProductImagePatch, ProductListQuery, ProductStatus, RefundOrderInput, ShipOrderInput, ShippingRate, ShippingRateInput };
|
package/dist/index.d.ts
CHANGED
|
@@ -37,6 +37,25 @@ declare const productSchema: z.ZodObject<{
|
|
|
37
37
|
}>;
|
|
38
38
|
featured: z.ZodBoolean;
|
|
39
39
|
}, z.core.$strip>;
|
|
40
|
+
declare const productCardSchema: z.ZodObject<{
|
|
41
|
+
currency: z.ZodString;
|
|
42
|
+
slug: z.ZodString;
|
|
43
|
+
name: z.ZodString;
|
|
44
|
+
priceCents: z.ZodNumber;
|
|
45
|
+
quantity: z.ZodNumber;
|
|
46
|
+
availability: z.ZodEnum<{
|
|
47
|
+
available: "available";
|
|
48
|
+
sold: "sold";
|
|
49
|
+
reserved: "reserved";
|
|
50
|
+
}>;
|
|
51
|
+
id: z.ZodString;
|
|
52
|
+
category: z.ZodString;
|
|
53
|
+
featured: z.ZodBoolean;
|
|
54
|
+
images: z.ZodArray<z.ZodObject<{
|
|
55
|
+
url: z.ZodString;
|
|
56
|
+
alt: z.ZodString;
|
|
57
|
+
}, z.core.$strip>>;
|
|
58
|
+
}, z.core.$strip>;
|
|
40
59
|
declare const categorySchema: z.ZodObject<{
|
|
41
60
|
slug: z.ZodString;
|
|
42
61
|
label: z.ZodString;
|
|
@@ -45,12 +64,38 @@ declare const categorySchema: z.ZodObject<{
|
|
|
45
64
|
declare const productListQuerySchema: z.ZodObject<{
|
|
46
65
|
category: z.ZodOptional<z.ZodString>;
|
|
47
66
|
featured: z.ZodOptional<z.ZodBoolean>;
|
|
67
|
+
limit: z.ZodDefault<z.ZodCoercedNumber<unknown>>;
|
|
68
|
+
cursor: z.ZodOptional<z.ZodString>;
|
|
69
|
+
}, z.core.$strip>;
|
|
70
|
+
declare const productCardPageSchema: z.ZodObject<{
|
|
71
|
+
items: z.ZodArray<z.ZodObject<{
|
|
72
|
+
currency: z.ZodString;
|
|
73
|
+
slug: z.ZodString;
|
|
74
|
+
name: z.ZodString;
|
|
75
|
+
priceCents: z.ZodNumber;
|
|
76
|
+
quantity: z.ZodNumber;
|
|
77
|
+
availability: z.ZodEnum<{
|
|
78
|
+
available: "available";
|
|
79
|
+
sold: "sold";
|
|
80
|
+
reserved: "reserved";
|
|
81
|
+
}>;
|
|
82
|
+
id: z.ZodString;
|
|
83
|
+
category: z.ZodString;
|
|
84
|
+
featured: z.ZodBoolean;
|
|
85
|
+
images: z.ZodArray<z.ZodObject<{
|
|
86
|
+
url: z.ZodString;
|
|
87
|
+
alt: z.ZodString;
|
|
88
|
+
}, z.core.$strip>>;
|
|
89
|
+
}, z.core.$strip>>;
|
|
90
|
+
nextCursor: z.ZodNullable<z.ZodString>;
|
|
48
91
|
}, z.core.$strip>;
|
|
49
92
|
type ProductImage = z.infer<typeof productImageSchema>;
|
|
50
93
|
type ProductAvailability = z.infer<typeof availabilitySchema>;
|
|
51
94
|
type Product = z.infer<typeof productSchema>;
|
|
95
|
+
type ProductCard = z.infer<typeof productCardSchema>;
|
|
96
|
+
type ProductCardPage = z.infer<typeof productCardPageSchema>;
|
|
52
97
|
type Category = z.infer<typeof categorySchema>;
|
|
53
|
-
type ProductListQuery = z.
|
|
98
|
+
type ProductListQuery = z.input<typeof productListQuerySchema>;
|
|
54
99
|
|
|
55
100
|
declare const cartLineSchema: z.ZodObject<{
|
|
56
101
|
productId: z.ZodString;
|
|
@@ -69,6 +114,7 @@ declare const checkoutRequestSchema: z.ZodObject<{
|
|
|
69
114
|
productId: z.ZodString;
|
|
70
115
|
quantity: z.ZodNumber;
|
|
71
116
|
}, z.core.$strip>>;
|
|
117
|
+
discountCode: z.ZodOptional<z.ZodPipe<z.ZodPipe<z.ZodString, z.ZodTransform<string, string>>, z.ZodString>>;
|
|
72
118
|
}, z.core.$strip>;
|
|
73
119
|
declare const checkoutResponseSchema: z.ZodObject<{
|
|
74
120
|
url: z.ZodString;
|
|
@@ -122,6 +168,8 @@ declare const orderSummarySchema: z.ZodObject<{
|
|
|
122
168
|
refunded: "refunded";
|
|
123
169
|
}>;
|
|
124
170
|
subtotalCents: z.ZodNumber;
|
|
171
|
+
discountCents: z.ZodDefault<z.ZodNumber>;
|
|
172
|
+
discountCode: z.ZodDefault<z.ZodNullable<z.ZodString>>;
|
|
125
173
|
shippingCents: z.ZodNumber;
|
|
126
174
|
shippingLabel: z.ZodNullable<z.ZodString>;
|
|
127
175
|
totalCents: z.ZodNumber;
|
|
@@ -171,6 +219,8 @@ declare const orderDetailSchema: z.ZodObject<{
|
|
|
171
219
|
refunded: "refunded";
|
|
172
220
|
}>;
|
|
173
221
|
subtotalCents: z.ZodNumber;
|
|
222
|
+
discountCents: z.ZodDefault<z.ZodNumber>;
|
|
223
|
+
discountCode: z.ZodDefault<z.ZodNullable<z.ZodString>>;
|
|
174
224
|
shippingCents: z.ZodNumber;
|
|
175
225
|
shippingLabel: z.ZodNullable<z.ZodString>;
|
|
176
226
|
totalCents: z.ZodNumber;
|
|
@@ -288,12 +338,59 @@ declare const adminProductSchema: z.ZodObject<{
|
|
|
288
338
|
declare const imageOrderInputSchema: z.ZodObject<{
|
|
289
339
|
imageIds: z.ZodArray<z.ZodString>;
|
|
290
340
|
}, z.core.$strip>;
|
|
341
|
+
declare const productImagePatchSchema: z.ZodObject<{
|
|
342
|
+
alt: z.ZodString;
|
|
343
|
+
}, z.core.$strip>;
|
|
344
|
+
declare const adminProductListQuerySchema: z.ZodObject<{
|
|
345
|
+
status: z.ZodOptional<z.ZodEnum<{
|
|
346
|
+
active: "active";
|
|
347
|
+
draft: "draft";
|
|
348
|
+
archived: "archived";
|
|
349
|
+
}>>;
|
|
350
|
+
stock: z.ZodOptional<z.ZodEnum<{
|
|
351
|
+
sold: "sold";
|
|
352
|
+
in: "in";
|
|
353
|
+
}>>;
|
|
354
|
+
q: z.ZodOptional<z.ZodString>;
|
|
355
|
+
cursor: z.ZodOptional<z.ZodString>;
|
|
356
|
+
limit: z.ZodDefault<z.ZodCoercedNumber<unknown>>;
|
|
357
|
+
}, z.core.$strip>;
|
|
358
|
+
declare const adminProductPageSchema: z.ZodObject<{
|
|
359
|
+
items: z.ZodArray<z.ZodObject<{
|
|
360
|
+
id: z.ZodString;
|
|
361
|
+
slug: z.ZodString;
|
|
362
|
+
name: z.ZodString;
|
|
363
|
+
description: z.ZodString;
|
|
364
|
+
materials: z.ZodNullable<z.ZodString>;
|
|
365
|
+
dimensions: z.ZodNullable<z.ZodString>;
|
|
366
|
+
priceCents: z.ZodNumber;
|
|
367
|
+
currency: z.ZodString;
|
|
368
|
+
category: z.ZodString;
|
|
369
|
+
quantity: z.ZodNumber;
|
|
370
|
+
status: z.ZodEnum<{
|
|
371
|
+
active: "active";
|
|
372
|
+
draft: "draft";
|
|
373
|
+
archived: "archived";
|
|
374
|
+
}>;
|
|
375
|
+
featured: z.ZodBoolean;
|
|
376
|
+
images: z.ZodArray<z.ZodObject<{
|
|
377
|
+
id: z.ZodString;
|
|
378
|
+
url: z.ZodString;
|
|
379
|
+
alt: z.ZodString;
|
|
380
|
+
position: z.ZodNumber;
|
|
381
|
+
}, z.core.$strip>>;
|
|
382
|
+
}, z.core.$strip>>;
|
|
383
|
+
nextCursor: z.ZodNullable<z.ZodString>;
|
|
384
|
+
}, z.core.$strip>;
|
|
291
385
|
type ProductStatus = z.infer<typeof productStatusSchema>;
|
|
292
386
|
type AdminProductInput = z.input<typeof adminProductInputSchema>;
|
|
293
387
|
type AdminProductPatch = z.input<typeof adminProductPatchSchema>;
|
|
294
388
|
type AdminProductImage = z.infer<typeof adminProductImageSchema>;
|
|
295
389
|
type AdminProduct = z.infer<typeof adminProductSchema>;
|
|
390
|
+
type ProductImagePatch = z.infer<typeof productImagePatchSchema>;
|
|
296
391
|
type ImageOrderInput = z.infer<typeof imageOrderInputSchema>;
|
|
392
|
+
type AdminProductListQuery = z.input<typeof adminProductListQuerySchema>;
|
|
393
|
+
type AdminProductPage = z.infer<typeof adminProductPageSchema>;
|
|
297
394
|
|
|
298
395
|
declare const adminOrderListQuerySchema: z.ZodObject<{
|
|
299
396
|
status: z.ZodOptional<z.ZodEnum<{
|
|
@@ -372,6 +469,8 @@ declare const adminOrderDetailSchema: z.ZodObject<{
|
|
|
372
469
|
refunded: "refunded";
|
|
373
470
|
}>;
|
|
374
471
|
subtotalCents: z.ZodNumber;
|
|
472
|
+
discountCents: z.ZodDefault<z.ZodNumber>;
|
|
473
|
+
discountCode: z.ZodDefault<z.ZodNullable<z.ZodString>>;
|
|
375
474
|
shippingCents: z.ZodNumber;
|
|
376
475
|
shippingLabel: z.ZodNullable<z.ZodString>;
|
|
377
476
|
totalCents: z.ZodNumber;
|
|
@@ -425,5 +524,144 @@ type AdminOrderDetail = z.infer<typeof adminOrderDetailSchema>;
|
|
|
425
524
|
type ShipOrderInput = z.infer<typeof shipOrderInputSchema>;
|
|
426
525
|
type RefundOrderInput = z.infer<typeof refundOrderInputSchema>;
|
|
427
526
|
|
|
428
|
-
|
|
429
|
-
|
|
527
|
+
declare const discountTypeSchema: z.ZodEnum<{
|
|
528
|
+
percent: "percent";
|
|
529
|
+
fixed: "fixed";
|
|
530
|
+
}>;
|
|
531
|
+
declare const discountCodeSchema: z.ZodPipe<z.ZodPipe<z.ZodString, z.ZodTransform<string, string>>, z.ZodString>;
|
|
532
|
+
declare const discountSchema: z.ZodObject<{
|
|
533
|
+
redeemedCount: z.ZodNumber;
|
|
534
|
+
reservedCount: z.ZodNumber;
|
|
535
|
+
createdAt: z.ZodString;
|
|
536
|
+
minSubtotalCents: z.ZodOptional<z.ZodNullable<z.ZodNumber>>;
|
|
537
|
+
startsAt: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
538
|
+
endsAt: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
539
|
+
maxRedemptions: z.ZodOptional<z.ZodNullable<z.ZodNumber>>;
|
|
540
|
+
active: z.ZodBoolean;
|
|
541
|
+
type: z.ZodEnum<{
|
|
542
|
+
percent: "percent";
|
|
543
|
+
fixed: "fixed";
|
|
544
|
+
}>;
|
|
545
|
+
percentOff: z.ZodOptional<z.ZodNullable<z.ZodNumber>>;
|
|
546
|
+
amountOffCents: z.ZodOptional<z.ZodNullable<z.ZodNumber>>;
|
|
547
|
+
currency: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
548
|
+
id: z.ZodString;
|
|
549
|
+
code: z.ZodPipe<z.ZodPipe<z.ZodString, z.ZodTransform<string, string>>, z.ZodString>;
|
|
550
|
+
}, z.core.$strip>;
|
|
551
|
+
declare const discountInputSchema: z.ZodObject<{
|
|
552
|
+
active: z.ZodDefault<z.ZodBoolean>;
|
|
553
|
+
minSubtotalCents: z.ZodOptional<z.ZodNullable<z.ZodNumber>>;
|
|
554
|
+
startsAt: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
555
|
+
endsAt: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
556
|
+
maxRedemptions: z.ZodOptional<z.ZodNullable<z.ZodNumber>>;
|
|
557
|
+
type: z.ZodEnum<{
|
|
558
|
+
percent: "percent";
|
|
559
|
+
fixed: "fixed";
|
|
560
|
+
}>;
|
|
561
|
+
percentOff: z.ZodOptional<z.ZodNullable<z.ZodNumber>>;
|
|
562
|
+
amountOffCents: z.ZodOptional<z.ZodNullable<z.ZodNumber>>;
|
|
563
|
+
currency: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
564
|
+
code: z.ZodPipe<z.ZodPipe<z.ZodString, z.ZodTransform<string, string>>, z.ZodString>;
|
|
565
|
+
}, z.core.$strip>;
|
|
566
|
+
declare const discountPatchSchema: z.ZodObject<{
|
|
567
|
+
minSubtotalCents: z.ZodOptional<z.ZodOptional<z.ZodNullable<z.ZodNumber>>>;
|
|
568
|
+
startsAt: z.ZodOptional<z.ZodOptional<z.ZodNullable<z.ZodString>>>;
|
|
569
|
+
endsAt: z.ZodOptional<z.ZodOptional<z.ZodNullable<z.ZodString>>>;
|
|
570
|
+
maxRedemptions: z.ZodOptional<z.ZodOptional<z.ZodNullable<z.ZodNumber>>>;
|
|
571
|
+
active: z.ZodOptional<z.ZodBoolean>;
|
|
572
|
+
type: z.ZodOptional<z.ZodEnum<{
|
|
573
|
+
percent: "percent";
|
|
574
|
+
fixed: "fixed";
|
|
575
|
+
}>>;
|
|
576
|
+
percentOff: z.ZodOptional<z.ZodOptional<z.ZodNullable<z.ZodNumber>>>;
|
|
577
|
+
amountOffCents: z.ZodOptional<z.ZodOptional<z.ZodNullable<z.ZodNumber>>>;
|
|
578
|
+
currency: z.ZodOptional<z.ZodOptional<z.ZodNullable<z.ZodString>>>;
|
|
579
|
+
code: z.ZodOptional<z.ZodPipe<z.ZodPipe<z.ZodString, z.ZodTransform<string, string>>, z.ZodString>>;
|
|
580
|
+
}, z.core.$strip>;
|
|
581
|
+
declare const discountStatusSchema: z.ZodEnum<{
|
|
582
|
+
expired: "expired";
|
|
583
|
+
active: "active";
|
|
584
|
+
inactive: "inactive";
|
|
585
|
+
scheduled: "scheduled";
|
|
586
|
+
}>;
|
|
587
|
+
declare const adminDiscountListQuerySchema: z.ZodObject<{
|
|
588
|
+
status: z.ZodOptional<z.ZodEnum<{
|
|
589
|
+
expired: "expired";
|
|
590
|
+
active: "active";
|
|
591
|
+
inactive: "inactive";
|
|
592
|
+
scheduled: "scheduled";
|
|
593
|
+
}>>;
|
|
594
|
+
q: z.ZodOptional<z.ZodString>;
|
|
595
|
+
cursor: z.ZodOptional<z.ZodString>;
|
|
596
|
+
limit: z.ZodDefault<z.ZodCoercedNumber<unknown>>;
|
|
597
|
+
}, z.core.$strip>;
|
|
598
|
+
declare const adminDiscountPageSchema: z.ZodObject<{
|
|
599
|
+
items: z.ZodArray<z.ZodObject<{
|
|
600
|
+
redeemedCount: z.ZodNumber;
|
|
601
|
+
reservedCount: z.ZodNumber;
|
|
602
|
+
createdAt: z.ZodString;
|
|
603
|
+
minSubtotalCents: z.ZodOptional<z.ZodNullable<z.ZodNumber>>;
|
|
604
|
+
startsAt: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
605
|
+
endsAt: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
606
|
+
maxRedemptions: z.ZodOptional<z.ZodNullable<z.ZodNumber>>;
|
|
607
|
+
active: z.ZodBoolean;
|
|
608
|
+
type: z.ZodEnum<{
|
|
609
|
+
percent: "percent";
|
|
610
|
+
fixed: "fixed";
|
|
611
|
+
}>;
|
|
612
|
+
percentOff: z.ZodOptional<z.ZodNullable<z.ZodNumber>>;
|
|
613
|
+
amountOffCents: z.ZodOptional<z.ZodNullable<z.ZodNumber>>;
|
|
614
|
+
currency: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
615
|
+
id: z.ZodString;
|
|
616
|
+
code: z.ZodPipe<z.ZodPipe<z.ZodString, z.ZodTransform<string, string>>, z.ZodString>;
|
|
617
|
+
}, z.core.$strip>>;
|
|
618
|
+
nextCursor: z.ZodNullable<z.ZodString>;
|
|
619
|
+
}, z.core.$strip>;
|
|
620
|
+
declare const discountPreviewRequestSchema: z.ZodObject<{
|
|
621
|
+
code: z.ZodPipe<z.ZodPipe<z.ZodString, z.ZodTransform<string, string>>, z.ZodString>;
|
|
622
|
+
items: z.ZodArray<z.ZodObject<{
|
|
623
|
+
productId: z.ZodString;
|
|
624
|
+
quantity: z.ZodNumber;
|
|
625
|
+
}, z.core.$strip>>;
|
|
626
|
+
}, z.core.$strip>;
|
|
627
|
+
declare const discountPreviewSchema: z.ZodObject<{
|
|
628
|
+
code: z.ZodString;
|
|
629
|
+
discountCents: z.ZodNumber;
|
|
630
|
+
subtotalCents: z.ZodNumber;
|
|
631
|
+
currency: z.ZodString;
|
|
632
|
+
}, z.core.$strip>;
|
|
633
|
+
declare const discountRejectionReasonSchema: z.ZodEnum<{
|
|
634
|
+
currency: "currency";
|
|
635
|
+
expired: "expired";
|
|
636
|
+
inactive: "inactive";
|
|
637
|
+
not_found: "not_found";
|
|
638
|
+
not_started: "not_started";
|
|
639
|
+
min_subtotal: "min_subtotal";
|
|
640
|
+
exhausted: "exhausted";
|
|
641
|
+
}>;
|
|
642
|
+
declare const discountRejectionSchema: z.ZodObject<{
|
|
643
|
+
error: z.ZodLiteral<"DISCOUNT_INVALID">;
|
|
644
|
+
reason: z.ZodEnum<{
|
|
645
|
+
currency: "currency";
|
|
646
|
+
expired: "expired";
|
|
647
|
+
inactive: "inactive";
|
|
648
|
+
not_found: "not_found";
|
|
649
|
+
not_started: "not_started";
|
|
650
|
+
min_subtotal: "min_subtotal";
|
|
651
|
+
exhausted: "exhausted";
|
|
652
|
+
}>;
|
|
653
|
+
}, z.core.$strip>;
|
|
654
|
+
type DiscountType = z.infer<typeof discountTypeSchema>;
|
|
655
|
+
type Discount = z.infer<typeof discountSchema>;
|
|
656
|
+
type DiscountStatus = z.infer<typeof discountStatusSchema>;
|
|
657
|
+
type AdminDiscountListQuery = z.infer<typeof adminDiscountListQuerySchema>;
|
|
658
|
+
type AdminDiscountPage = z.infer<typeof adminDiscountPageSchema>;
|
|
659
|
+
type DiscountInput = z.input<typeof discountInputSchema>;
|
|
660
|
+
type DiscountPatch = z.input<typeof discountPatchSchema>;
|
|
661
|
+
type DiscountPreviewRequest = z.input<typeof discountPreviewRequestSchema>;
|
|
662
|
+
type DiscountPreview = z.infer<typeof discountPreviewSchema>;
|
|
663
|
+
type DiscountRejectionReason = z.infer<typeof discountRejectionReasonSchema>;
|
|
664
|
+
type DiscountRejection = z.infer<typeof discountRejectionSchema>;
|
|
665
|
+
|
|
666
|
+
export { adminDiscountListQuerySchema, adminDiscountPageSchema, adminOrderDetailSchema, adminOrderListItemSchema, adminOrderListQuerySchema, adminOrderPageSchema, adminProductImageSchema, adminProductInputSchema, adminProductListQuerySchema, adminProductPageSchema, adminProductPatchSchema, adminProductSchema, availabilitySchema, cartLineSchema, categorySchema, checkoutConflictSchema, checkoutRequestSchema, checkoutResponseSchema, discountCodeSchema, discountInputSchema, discountPatchSchema, discountPreviewRequestSchema, discountPreviewSchema, discountRejectionReasonSchema, discountRejectionSchema, discountSchema, discountStatusSchema, discountTypeSchema, imageOrderInputSchema, moneySchema, orderAddressSchema, orderDetailSchema, orderFulfillmentSchema, orderRefundSchema, orderStatusSchema, orderSummarySchema, productCardPageSchema, productCardSchema, productImagePatchSchema, productImageSchema, productListQuerySchema, productSchema, productStatusSchema, refundOrderInputSchema, shipOrderInputSchema, shippingRateSchema, shippingRatesInputSchema };
|
|
667
|
+
export type { AdminDiscountListQuery, AdminDiscountPage, AdminOrderDetail, AdminOrderListItem, AdminOrderListQuery, AdminOrderPage, AdminProduct, AdminProductImage, AdminProductInput, AdminProductListQuery, AdminProductPage, AdminProductPatch, CartLine, Category, CheckoutConflict, CheckoutRequest, CheckoutResponse, Discount, DiscountInput, DiscountPatch, DiscountPreview, DiscountPreviewRequest, DiscountRejection, DiscountRejectionReason, DiscountStatus, DiscountType, ImageOrderInput, Money, OrderAddress, OrderDetail, OrderFulfillment, OrderRefund, OrderStatus, OrderSummary, Product, ProductAvailability, ProductCard, ProductCardPage, ProductImage, ProductImagePatch, ProductListQuery, ProductStatus, RefundOrderInput, ShipOrderInput, ShippingRate, ShippingRateInput };
|