@develemit/commerce-contracts 0.7.0 → 0.9.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/CHANGELOG.md +14 -0
- package/dist/index.cjs +19 -1
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +29 -15
- package/dist/index.d.ts +29 -15
- package/dist/index.js +17 -1
- package/dist/index.js.map +1 -1
- package/package.json +1 -1
package/CHANGELOG.md
CHANGED
|
@@ -1,3 +1,17 @@
|
|
|
1
|
+
## 0.9.0 (2026-11-14)
|
|
2
|
+
|
|
3
|
+
### Features
|
|
4
|
+
|
|
5
|
+
- `adminProductSchema` gains `taxCode` (nullable, defaults to `null`); `adminProductInputSchema` and `adminProductPatchSchema` accept an optional, nullable `taxCode` matching `txcd_` plus 8 digits.
|
|
6
|
+
- Order shapes (`orderSummarySchema`, `orderDetailSchema`, the admin list item and detail) gain `taxCents` (integer cents, defaults to `0` so older servers still parse). `totalCents` includes it.
|
|
7
|
+
|
|
8
|
+
## 0.8.0 (2026-11-12)
|
|
9
|
+
|
|
10
|
+
### Features
|
|
11
|
+
|
|
12
|
+
- `adminProductSchema` gains `everPublished` (boolean, defaults to `false`): true once a product has been active, which makes it archive-only.
|
|
13
|
+
- `formatOrderRef(id)` returns the short, quotable order reference (`#` + the first 8 hex characters, uppercased); `orderRefSearchTerm(input)` strips a leading `#` from a search term. The full id stays in URLs and the database.
|
|
14
|
+
|
|
1
15
|
## 0.7.0 (2026-11-04)
|
|
2
16
|
|
|
3
17
|
### Features
|
package/dist/index.cjs
CHANGED
|
@@ -49,11 +49,13 @@ __export(index_exports, {
|
|
|
49
49
|
discountSchema: () => discountSchema,
|
|
50
50
|
discountStatusSchema: () => discountStatusSchema,
|
|
51
51
|
discountTypeSchema: () => discountTypeSchema,
|
|
52
|
+
formatOrderRef: () => formatOrderRef,
|
|
52
53
|
imageOrderInputSchema: () => imageOrderInputSchema,
|
|
53
54
|
moneySchema: () => moneySchema,
|
|
54
55
|
orderAddressSchema: () => orderAddressSchema,
|
|
55
56
|
orderDetailSchema: () => orderDetailSchema,
|
|
56
57
|
orderFulfillmentSchema: () => orderFulfillmentSchema,
|
|
58
|
+
orderRefSearchTerm: () => orderRefSearchTerm,
|
|
57
59
|
orderRefundSchema: () => orderRefundSchema,
|
|
58
60
|
orderStatusSchema: () => orderStatusSchema,
|
|
59
61
|
orderSummarySchema: () => orderSummarySchema,
|
|
@@ -302,6 +304,7 @@ var orderTotalsShape = {
|
|
|
302
304
|
discountCode: import_zod6.z.string().nullable().default(null),
|
|
303
305
|
shippingCents: import_zod6.z.number().int().nonnegative(),
|
|
304
306
|
shippingLabel: import_zod6.z.string().nullable(),
|
|
307
|
+
taxCents: import_zod6.z.number().int().nonnegative().default(0),
|
|
305
308
|
totalCents: import_zod6.z.number().int().nonnegative(),
|
|
306
309
|
currency: import_zod6.z.string().length(3),
|
|
307
310
|
items: import_zod6.z.array(orderItemSchema),
|
|
@@ -342,6 +345,7 @@ var shippingRatesInputSchema = import_zod7.z.array(shippingRateSchema).refine((r
|
|
|
342
345
|
// src/admin.ts
|
|
343
346
|
var import_zod8 = require("zod");
|
|
344
347
|
var productStatusSchema = import_zod8.z.enum(["draft", "active", "archived"]);
|
|
348
|
+
var taxCodeSchema = import_zod8.z.string().regex(/^txcd_\d{8}$/);
|
|
345
349
|
var productFields = import_zod8.z.object({
|
|
346
350
|
name: import_zod8.z.string().trim().min(1),
|
|
347
351
|
description: import_zod8.z.string(),
|
|
@@ -352,7 +356,8 @@ var productFields = import_zod8.z.object({
|
|
|
352
356
|
category: import_zod8.z.string().trim().min(1),
|
|
353
357
|
quantity: import_zod8.z.number().int().nonnegative(),
|
|
354
358
|
status: productStatusSchema,
|
|
355
|
-
featured: import_zod8.z.boolean()
|
|
359
|
+
featured: import_zod8.z.boolean(),
|
|
360
|
+
taxCode: taxCodeSchema.nullable().optional()
|
|
356
361
|
});
|
|
357
362
|
var publishRequiredFields = [
|
|
358
363
|
"name",
|
|
@@ -400,6 +405,8 @@ var adminProductSchema = import_zod8.z.object({
|
|
|
400
405
|
quantity: import_zod8.z.number().int().nonnegative(),
|
|
401
406
|
status: productStatusSchema,
|
|
402
407
|
featured: import_zod8.z.boolean(),
|
|
408
|
+
everPublished: import_zod8.z.boolean().default(false),
|
|
409
|
+
taxCode: taxCodeSchema.nullable().default(null),
|
|
403
410
|
images: import_zod8.z.array(adminProductImageSchema)
|
|
404
411
|
});
|
|
405
412
|
var imageOrderInputSchema = import_zod8.z.object({
|
|
@@ -447,6 +454,7 @@ var adminOrderListItemSchema = import_zod9.z.object({
|
|
|
447
454
|
id: import_zod9.z.string().min(1),
|
|
448
455
|
status: orderStatusSchema,
|
|
449
456
|
email: import_zod9.z.string().nullable(),
|
|
457
|
+
taxCents: import_zod9.z.number().int().nonnegative().default(0),
|
|
450
458
|
totalCents: import_zod9.z.number().int().nonnegative(),
|
|
451
459
|
currency: import_zod9.z.string().length(3),
|
|
452
460
|
itemCount: import_zod9.z.number().int().nonnegative(),
|
|
@@ -472,6 +480,14 @@ var refundOrderInputSchema = import_zod9.z.object({
|
|
|
472
480
|
reason: import_zod9.z.string().max(500).optional(),
|
|
473
481
|
restock: import_zod9.z.boolean().default(false)
|
|
474
482
|
});
|
|
483
|
+
|
|
484
|
+
// src/order-ref.ts
|
|
485
|
+
function formatOrderRef(id) {
|
|
486
|
+
return `#${id.replace(/-/g, "").slice(0, 8).toUpperCase()}`;
|
|
487
|
+
}
|
|
488
|
+
function orderRefSearchTerm(input) {
|
|
489
|
+
return input.trim().replace(/^#/, "");
|
|
490
|
+
}
|
|
475
491
|
// Annotate the CommonJS export names for ESM import in node:
|
|
476
492
|
0 && (module.exports = {
|
|
477
493
|
adminDiscountListQuerySchema,
|
|
@@ -503,11 +519,13 @@ var refundOrderInputSchema = import_zod9.z.object({
|
|
|
503
519
|
discountSchema,
|
|
504
520
|
discountStatusSchema,
|
|
505
521
|
discountTypeSchema,
|
|
522
|
+
formatOrderRef,
|
|
506
523
|
imageOrderInputSchema,
|
|
507
524
|
moneySchema,
|
|
508
525
|
orderAddressSchema,
|
|
509
526
|
orderDetailSchema,
|
|
510
527
|
orderFulfillmentSchema,
|
|
528
|
+
orderRefSearchTerm,
|
|
511
529
|
orderRefundSchema,
|
|
512
530
|
orderStatusSchema,
|
|
513
531
|
orderSummarySchema,
|
package/dist/index.cjs.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../src/index.ts","../src/money.ts","../src/product.ts","../src/cart.ts","../src/checkout.ts","../src/discount.ts","../src/order.ts","../src/shipping.ts","../src/admin.ts","../src/admin-orders.ts"],"sourcesContent":["export * from './money';\nexport * from './product';\nexport * from './cart';\nexport * from './checkout';\nexport * from './order';\nexport * from './shipping';\nexport * from './admin';\nexport * from './admin-orders';\nexport * from './discount';\n","import { z } from 'zod';\n\nexport const moneySchema = z.object({\n amountCents: z.number().int(),\n currency: z.string().length(3),\n});\n\nexport type Money = z.infer<typeof moneySchema>;\n","import { z } from 'zod';\n\nexport const productImageSchema = z.object({\n url: z.string().min(1),\n alt: z.string(),\n});\n\nexport const availabilitySchema = z.enum(['available', 'sold', 'reserved']);\n\nexport const productSchema = z.object({\n id: z.string().min(1),\n slug: z.string().min(1),\n name: z.string().min(1),\n description: z.string(),\n materials: z.string().optional(),\n dimensions: z.string().optional(),\n priceCents: z.number().int().nonnegative(),\n currency: z.string().length(3),\n category: z.string().min(1),\n images: z.array(productImageSchema),\n quantity: z.number().int().nonnegative(),\n availability: availabilitySchema,\n featured: z.boolean(),\n});\n\nexport const productCardSchema = productSchema\n .pick({\n id: true,\n slug: true,\n name: true,\n priceCents: true,\n currency: true,\n category: true,\n quantity: true,\n availability: true,\n featured: true,\n })\n .extend({ images: z.array(productImageSchema).max(1) });\n\nexport const categorySchema = z.object({\n slug: z.string().min(1),\n label: z.string().min(1),\n count: z.number().int().nonnegative(),\n});\n\nexport const productListQuerySchema = z.object({\n category: z.string().min(1).optional(),\n featured: z.boolean().optional(),\n limit: z.coerce.number().int().min(1).max(100).default(48),\n cursor: z.string().min(1).optional(),\n});\n\nexport const productCardPageSchema = z.object({\n items: z.array(productCardSchema),\n nextCursor: z.string().nullable(),\n});\n\nexport type ProductImage = z.infer<typeof productImageSchema>;\nexport type ProductAvailability = z.infer<typeof availabilitySchema>;\nexport type Product = z.infer<typeof productSchema>;\nexport type ProductCard = z.infer<typeof productCardSchema>;\nexport type ProductCardPage = z.infer<typeof productCardPageSchema>;\nexport type Category = z.infer<typeof categorySchema>;\nexport type ProductListQuery = z.input<typeof productListQuerySchema>;\n","import { z } from 'zod';\n\nexport const cartLineSchema = z.object({\n productId: z.string().min(1),\n slug: z.string().min(1),\n name: z.string().min(1),\n priceCents: z.number().int().nonnegative(),\n currency: z.string().length(3),\n imageUrl: z.string().optional(),\n quantity: z.number().int().positive(),\n maxQuantity: z.number().int().positive(),\n});\n\nexport type CartLine = z.infer<typeof cartLineSchema>;\n","import { z } from 'zod';\nimport { discountCodeSchema } from './discount';\n\nexport const checkoutRequestSchema = z.object({\n items: z\n .array(\n z.object({\n productId: z.string().min(1),\n quantity: z.number().int().positive(),\n }),\n )\n .min(1),\n discountCode: discountCodeSchema.optional(),\n});\n\nexport const checkoutResponseSchema = z.object({\n url: z.string().min(1),\n});\n\nexport const checkoutConflictSchema = z.object({\n unavailableProductIds: z.array(z.string().min(1)).min(1),\n});\n\nexport type CheckoutRequest = z.infer<typeof checkoutRequestSchema>;\nexport type CheckoutResponse = z.infer<typeof checkoutResponseSchema>;\nexport type CheckoutConflict = z.infer<typeof checkoutConflictSchema>;\n","import { z } from 'zod';\n\nexport const discountTypeSchema = z.enum(['percent', 'fixed']);\n\nexport const discountCodeSchema = z\n .string()\n .transform((value) => value.trim().toUpperCase())\n .pipe(\n z\n .string()\n .min(1)\n .max(40)\n .regex(/^[A-Z0-9_-]+$/),\n );\n\nconst currencyInputSchema = z\n .string()\n .transform((value) => value.trim().toUpperCase())\n .pipe(z.string().length(3));\n\nconst limitFields = {\n minSubtotalCents: z.number().int().positive().nullable().optional(),\n startsAt: z.string().min(1).nullable().optional(),\n endsAt: z.string().min(1).nullable().optional(),\n maxRedemptions: z.number().int().positive().nullable().optional(),\n active: z.boolean(),\n};\n\nconst discountValueFields = {\n type: discountTypeSchema,\n percentOff: z.number().int().min(1).max(100).nullable().optional(),\n amountOffCents: z.number().int().positive().nullable().optional(),\n currency: currencyInputSchema.nullable().optional(),\n};\n\ntype ValueFields = {\n type?: z.infer<typeof discountTypeSchema>;\n percentOff?: number | null;\n amountOffCents?: number | null;\n currency?: string | null;\n};\n\nconst hasValue = (value: unknown) => value !== undefined && value !== null;\n\nfunction valueFieldsAgree(input: ValueFields): boolean {\n const { type, percentOff, amountOffCents, currency } = input;\n if (type === 'percent') {\n return (\n hasValue(percentOff) && !hasValue(amountOffCents) && !hasValue(currency)\n );\n }\n if (type === 'fixed') {\n return (\n !hasValue(percentOff) && hasValue(amountOffCents) && hasValue(currency)\n );\n }\n return !(hasValue(percentOff) && hasValue(amountOffCents));\n}\n\nconst valueFieldsMessage = {\n message:\n 'percent needs percentOff only; fixed needs amountOffCents and currency only',\n path: ['type'],\n};\n\nexport const discountSchema = z.object({\n id: z.string().min(1),\n code: discountCodeSchema,\n ...discountValueFields,\n ...limitFields,\n redeemedCount: z.number().int().nonnegative(),\n reservedCount: z.number().int().nonnegative(),\n createdAt: z.string().min(1),\n});\n\nexport const discountInputSchema = z\n .object({\n code: discountCodeSchema,\n ...discountValueFields,\n ...limitFields,\n active: limitFields.active.default(true),\n })\n .refine(valueFieldsAgree, valueFieldsMessage);\n\nexport const discountPatchSchema = z\n .object({\n code: discountCodeSchema,\n ...discountValueFields,\n ...limitFields,\n })\n .partial()\n .refine(valueFieldsAgree, valueFieldsMessage);\n\nexport const discountStatusSchema = z.enum([\n 'active',\n 'inactive',\n 'scheduled',\n 'expired',\n]);\n\nexport const adminDiscountListQuerySchema = z.object({\n status: discountStatusSchema.optional(),\n q: z.string().trim().min(1).optional(),\n cursor: z.string().min(1).optional(),\n limit: z.coerce.number().int().min(1).max(100).default(25),\n});\n\nexport const adminDiscountPageSchema = z.object({\n items: z.array(discountSchema),\n nextCursor: z.string().nullable(),\n});\n\nexport const discountPreviewRequestSchema = z.object({\n code: discountCodeSchema,\n items: z\n .array(\n z.object({\n productId: z.string().min(1),\n quantity: z.number().int().positive(),\n }),\n )\n .min(1),\n});\n\nexport const discountPreviewSchema = z.object({\n code: z.string().min(1),\n discountCents: z.number().int().nonnegative(),\n subtotalCents: z.number().int().nonnegative(),\n currency: z.string().length(3),\n});\n\nexport const discountRejectionReasonSchema = z.enum([\n 'not_found',\n 'inactive',\n 'not_started',\n 'expired',\n 'min_subtotal',\n 'exhausted',\n 'currency',\n]);\n\nexport const discountRejectionSchema = z.object({\n error: z.literal('DISCOUNT_INVALID'),\n reason: discountRejectionReasonSchema,\n});\n\nexport type DiscountType = z.infer<typeof discountTypeSchema>;\nexport type Discount = z.infer<typeof discountSchema>;\nexport type DiscountStatus = z.infer<typeof discountStatusSchema>;\nexport type AdminDiscountListQuery = z.infer<\n typeof adminDiscountListQuerySchema\n>;\nexport type AdminDiscountPage = z.infer<typeof adminDiscountPageSchema>;\nexport type DiscountInput = z.input<typeof discountInputSchema>;\nexport type DiscountPatch = z.input<typeof discountPatchSchema>;\nexport type DiscountPreviewRequest = z.input<\n typeof discountPreviewRequestSchema\n>;\nexport type DiscountPreview = z.infer<typeof discountPreviewSchema>;\nexport type DiscountRejectionReason = z.infer<\n typeof discountRejectionReasonSchema\n>;\nexport type DiscountRejection = z.infer<typeof discountRejectionSchema>;\n","import { z } from 'zod';\n\nexport const orderStatusSchema = z.enum([\n 'pending',\n 'paid',\n 'shipped',\n 'cancelled',\n 'expired',\n 'needs_attention',\n 'refunded',\n]);\n\nconst orderItemSchema = z.object({\n productId: z.string().min(1),\n name: z.string().min(1),\n priceCents: z.number().int().nonnegative(),\n quantity: z.number().int().positive(),\n});\n\nexport const orderFulfillmentSchema = z.object({\n carrier: z.string().nullable(),\n trackingNumber: z.string().nullable(),\n trackingUrl: z.string().url().nullable(),\n shippedAt: z.string().min(1),\n});\n\nexport const orderRefundSchema = z.object({\n id: z.string().min(1),\n amountCents: z.number().int().positive(),\n reason: z.string().nullable(),\n restocked: z.boolean(),\n source: z.enum(['admin', 'gateway']),\n status: z.enum(['pending', 'succeeded']),\n createdAt: z.string().min(1),\n});\n\nconst orderTotalsShape = {\n id: z.string().min(1),\n status: orderStatusSchema,\n subtotalCents: z.number().int().nonnegative(),\n discountCents: z.number().int().nonnegative().default(0),\n discountCode: z.string().nullable().default(null),\n shippingCents: z.number().int().nonnegative(),\n shippingLabel: z.string().nullable(),\n totalCents: z.number().int().nonnegative(),\n currency: z.string().length(3),\n items: z.array(orderItemSchema),\n fulfillment: orderFulfillmentSchema.nullable(),\n createdAt: z.string().min(1),\n};\n\nexport const orderSummarySchema = z.object(orderTotalsShape);\n\nexport const orderAddressSchema = z.object({\n name: z.string().optional(),\n line1: z.string().optional(),\n line2: z.string().optional(),\n city: z.string().optional(),\n state: z.string().optional(),\n postalCode: z.string().optional(),\n country: z.string().optional(),\n});\n\nexport const orderDetailSchema = z.object({\n ...orderTotalsShape,\n email: z.string().nullable(),\n shippingAddress: orderAddressSchema.nullable(),\n});\n\nexport type OrderStatus = z.infer<typeof orderStatusSchema>;\nexport type OrderFulfillment = z.infer<typeof orderFulfillmentSchema>;\nexport type OrderRefund = z.infer<typeof orderRefundSchema>;\nexport type OrderSummary = z.infer<typeof orderSummarySchema>;\nexport type OrderAddress = z.infer<typeof orderAddressSchema>;\nexport type OrderDetail = z.infer<typeof orderDetailSchema>;\n","import { z } from 'zod';\n\nexport const shippingRateSchema = z.object({\n label: z.string().min(1),\n amountCents: z.number().int().nonnegative(),\n currency: z.string().length(3),\n minDays: z.number().int().nonnegative().nullable().optional(),\n maxDays: z.number().int().nonnegative().nullable().optional(),\n active: z.boolean().default(true),\n sort: z.number().int().default(0),\n});\n\nexport const shippingRatesInputSchema = z\n .array(shippingRateSchema)\n .refine((rates) => new Set(rates.map((r) => r.label)).size === rates.length, {\n message: 'Shipping rate labels must be unique',\n });\n\nexport type ShippingRate = z.infer<typeof shippingRateSchema>;\nexport type ShippingRateInput = z.input<typeof shippingRateSchema>;\n","import { z } from 'zod';\n\nexport const productStatusSchema = z.enum(['draft', 'active', 'archived']);\n\nconst productFields = z.object({\n name: z.string().trim().min(1),\n description: z.string(),\n materials: z.string().nullable().optional(),\n dimensions: z.string().nullable().optional(),\n priceCents: z.number().int().nonnegative(),\n currency: z.string().length(3).optional(),\n category: z.string().trim().min(1),\n quantity: z.number().int().nonnegative(),\n status: productStatusSchema,\n featured: z.boolean(),\n});\n\nexport const publishRequiredFields = [\n 'name',\n 'priceCents',\n 'category',\n] as const;\n\nexport const adminProductInputSchema = productFields\n .extend({\n name: z.string().trim().default(''),\n description: z.string().default(''),\n priceCents: productFields.shape.priceCents.optional(),\n category: z.string().trim().optional(),\n quantity: z.number().int().nonnegative().default(1),\n status: productStatusSchema.default('draft'),\n featured: z.boolean().default(false),\n })\n .superRefine((product, ctx) => {\n if (product.status !== 'active') return;\n for (const field of publishRequiredFields) {\n const value = product[field];\n if (value === undefined || value === '') {\n ctx.addIssue({\n code: 'custom',\n path: [field],\n message: `${field} is required to publish a product`,\n });\n }\n }\n });\n\nexport const adminProductPatchSchema = productFields\n .partial()\n .extend({ sold: z.boolean().optional() });\n\nexport const adminProductImageSchema = z.object({\n id: z.string().min(1),\n url: z.string().min(1),\n alt: z.string(),\n position: z.number().int().nonnegative(),\n});\n\nexport const adminProductSchema = z.object({\n id: z.string().min(1),\n slug: z.string().min(1),\n name: z.string(),\n description: z.string(),\n materials: z.string().nullable(),\n dimensions: z.string().nullable(),\n priceCents: z.number().int().nonnegative().nullable(),\n currency: z.string().length(3),\n category: z.string().min(1).nullable(),\n quantity: z.number().int().nonnegative(),\n status: productStatusSchema,\n featured: z.boolean(),\n images: z.array(adminProductImageSchema),\n});\n\nexport const imageOrderInputSchema = z.object({\n imageIds: z.array(z.string().min(1)),\n});\n\nexport const productImagePatchSchema = z.object({\n alt: z.string().trim().max(500),\n});\n\nexport const adminProductListQuerySchema = z.object({\n status: productStatusSchema.optional(),\n excludeArchived: z.literal('true').optional(),\n incomplete: z.literal('true').optional(),\n stock: z.enum(['in', 'sold']).optional(),\n q: z.string().trim().min(1).optional(),\n cursor: z.string().min(1).optional(),\n limit: z.coerce.number().int().min(1).max(100).default(50),\n});\n\nexport const adminProductPageSchema = z.object({\n items: z.array(adminProductSchema),\n nextCursor: z.string().nullable(),\n});\n\nexport const adminProductCountsSchema = z.object({\n all: z.number().int().nonnegative(),\n live: z.number().int().nonnegative(),\n draft: z.number().int().nonnegative(),\n sold: z.number().int().nonnegative(),\n archived: z.number().int().nonnegative(),\n incompleteDrafts: z.number().int().nonnegative(),\n});\n\nexport const productIncompleteFieldSchema = z.enum([\n ...publishRequiredFields,\n 'images',\n]);\n\nexport type ProductStatus = z.infer<typeof productStatusSchema>;\nexport type AdminProductInput = z.input<typeof adminProductInputSchema>;\nexport type AdminProductPatch = z.input<typeof adminProductPatchSchema>;\nexport type AdminProductImage = z.infer<typeof adminProductImageSchema>;\nexport type AdminProduct = z.infer<typeof adminProductSchema>;\nexport type ProductImagePatch = z.infer<typeof productImagePatchSchema>;\nexport type ImageOrderInput = z.infer<typeof imageOrderInputSchema>;\nexport type AdminProductListQuery = z.input<typeof adminProductListQuerySchema>;\nexport type AdminProductPage = z.infer<typeof adminProductPageSchema>;\nexport type AdminProductCounts = z.infer<typeof adminProductCountsSchema>;\nexport type ProductIncompleteField = z.infer<\n typeof productIncompleteFieldSchema\n>;\n","import { z } from 'zod';\nimport {\n orderDetailSchema,\n orderRefundSchema,\n orderStatusSchema,\n} from './order';\n\nexport const adminOrderListQuerySchema = z.object({\n status: orderStatusSchema.optional(),\n q: z.string().trim().min(1).optional(),\n hasPendingRefund: z\n .enum(['true', 'false'])\n .transform((v) => v === 'true')\n .optional(),\n cursor: z.string().min(1).optional(),\n limit: z.coerce.number().int().min(1).max(100).default(25),\n});\n\nexport const adminOrderListItemSchema = z.object({\n id: z.string().min(1),\n status: orderStatusSchema,\n email: z.string().nullable(),\n totalCents: z.number().int().nonnegative(),\n currency: z.string().length(3),\n itemCount: z.number().int().nonnegative(),\n createdAt: z.string().min(1),\n});\n\nexport const adminOrderPageSchema = z.object({\n items: z.array(adminOrderListItemSchema),\n nextCursor: z.string().nullable(),\n});\n\nexport const adminOrderDetailSchema = orderDetailSchema.extend({\n refunds: z.array(orderRefundSchema),\n refundedCents: z.number().int().nonnegative(),\n checkoutSessionId: z.string().nullable(),\n updatedAt: z.string().min(1),\n});\n\nexport const shipOrderInputSchema = z.object({\n carrier: z.string().optional(),\n trackingNumber: z.string().optional(),\n trackingUrl: z.string().url().optional(),\n});\n\nexport const refundOrderInputSchema = z.object({\n amountCents: z.number().int().positive().optional(),\n reason: z.string().max(500).optional(),\n restock: z.boolean().default(false),\n});\n\nexport type AdminOrderListQuery = z.infer<typeof adminOrderListQuerySchema>;\nexport type AdminOrderListItem = z.infer<typeof adminOrderListItemSchema>;\nexport type AdminOrderPage = z.infer<typeof adminOrderPageSchema>;\nexport type AdminOrderDetail = z.infer<typeof adminOrderDetailSchema>;\nexport type ShipOrderInput = z.infer<typeof shipOrderInputSchema>;\nexport type RefundOrderInput = z.infer<typeof refundOrderInputSchema>;\n"],"mappings":";;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;;;ACAA,iBAAkB;AAEX,IAAM,cA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,kBAAkB,OAAO;AAAA,EAC7D,SAAS,cAAE,MAAM,iBAAiB;AAAA,EAClC,eAAe,cAAE,OAAO,EAAE,IAAI,EAAE,YAAY;AAAA,EAC5C,mBAAmB,cAAE,OAAO,EAAE,SAAS;AAAA,EACvC,WAAW,cAAE,OAAO,EAAE,IAAI,CAAC;AAC7B,CAAC;AAEM,IAAM,uBAAuB,cAAE,OAAO;AAAA,EAC3C,SAAS,cAAE,OAAO,EAAE,SAAS;AAAA,EAC7B,gBAAgB,cAAE,OAAO,EAAE,SAAS;AAAA,EACpC,aAAa,cAAE,OAAO,EAAE,IAAI,EAAE,SAAS;AACzC,CAAC;AAEM,IAAM,yBAAyB,cAAE,OAAO;AAAA,EAC7C,aAAa,cAAE,OAAO,EAAE,IAAI,EAAE,SAAS,EAAE,SAAS;AAAA,EAClD,QAAQ,cAAE,OAAO,EAAE,IAAI,GAAG,EAAE,SAAS;AAAA,EACrC,SAAS,cAAE,QAAQ,EAAE,QAAQ,KAAK;AACpC,CAAC;","names":["import_zod","import_zod","import_zod","import_zod","import_zod","import_zod","import_zod","import_zod"]}
|
|
1
|
+
{"version":3,"sources":["../src/index.ts","../src/money.ts","../src/product.ts","../src/cart.ts","../src/checkout.ts","../src/discount.ts","../src/order.ts","../src/shipping.ts","../src/admin.ts","../src/admin-orders.ts","../src/order-ref.ts"],"sourcesContent":["export * from './money';\nexport * from './product';\nexport * from './cart';\nexport * from './checkout';\nexport * from './order';\nexport * from './shipping';\nexport * from './admin';\nexport * from './admin-orders';\nexport * from './discount';\nexport * from './order-ref';\n","import { z } from 'zod';\n\nexport const moneySchema = z.object({\n amountCents: z.number().int(),\n currency: z.string().length(3),\n});\n\nexport type Money = z.infer<typeof moneySchema>;\n","import { z } from 'zod';\n\nexport const productImageSchema = z.object({\n url: z.string().min(1),\n alt: z.string(),\n});\n\nexport const availabilitySchema = z.enum(['available', 'sold', 'reserved']);\n\nexport const productSchema = z.object({\n id: z.string().min(1),\n slug: z.string().min(1),\n name: z.string().min(1),\n description: z.string(),\n materials: z.string().optional(),\n dimensions: z.string().optional(),\n priceCents: z.number().int().nonnegative(),\n currency: z.string().length(3),\n category: z.string().min(1),\n images: z.array(productImageSchema),\n quantity: z.number().int().nonnegative(),\n availability: availabilitySchema,\n featured: z.boolean(),\n});\n\nexport const productCardSchema = productSchema\n .pick({\n id: true,\n slug: true,\n name: true,\n priceCents: true,\n currency: true,\n category: true,\n quantity: true,\n availability: true,\n featured: true,\n })\n .extend({ images: z.array(productImageSchema).max(1) });\n\nexport const categorySchema = z.object({\n slug: z.string().min(1),\n label: z.string().min(1),\n count: z.number().int().nonnegative(),\n});\n\nexport const productListQuerySchema = z.object({\n category: z.string().min(1).optional(),\n featured: z.boolean().optional(),\n limit: z.coerce.number().int().min(1).max(100).default(48),\n cursor: z.string().min(1).optional(),\n});\n\nexport const productCardPageSchema = z.object({\n items: z.array(productCardSchema),\n nextCursor: z.string().nullable(),\n});\n\nexport type ProductImage = z.infer<typeof productImageSchema>;\nexport type ProductAvailability = z.infer<typeof availabilitySchema>;\nexport type Product = z.infer<typeof productSchema>;\nexport type ProductCard = z.infer<typeof productCardSchema>;\nexport type ProductCardPage = z.infer<typeof productCardPageSchema>;\nexport type Category = z.infer<typeof categorySchema>;\nexport type ProductListQuery = z.input<typeof productListQuerySchema>;\n","import { z } from 'zod';\n\nexport const cartLineSchema = z.object({\n productId: z.string().min(1),\n slug: z.string().min(1),\n name: z.string().min(1),\n priceCents: z.number().int().nonnegative(),\n currency: z.string().length(3),\n imageUrl: z.string().optional(),\n quantity: z.number().int().positive(),\n maxQuantity: z.number().int().positive(),\n});\n\nexport type CartLine = z.infer<typeof cartLineSchema>;\n","import { z } from 'zod';\nimport { discountCodeSchema } from './discount';\n\nexport const checkoutRequestSchema = z.object({\n items: z\n .array(\n z.object({\n productId: z.string().min(1),\n quantity: z.number().int().positive(),\n }),\n )\n .min(1),\n discountCode: discountCodeSchema.optional(),\n});\n\nexport const checkoutResponseSchema = z.object({\n url: z.string().min(1),\n});\n\nexport const checkoutConflictSchema = z.object({\n unavailableProductIds: z.array(z.string().min(1)).min(1),\n});\n\nexport type CheckoutRequest = z.infer<typeof checkoutRequestSchema>;\nexport type CheckoutResponse = z.infer<typeof checkoutResponseSchema>;\nexport type CheckoutConflict = z.infer<typeof checkoutConflictSchema>;\n","import { z } from 'zod';\n\nexport const discountTypeSchema = z.enum(['percent', 'fixed']);\n\nexport const discountCodeSchema = z\n .string()\n .transform((value) => value.trim().toUpperCase())\n .pipe(\n z\n .string()\n .min(1)\n .max(40)\n .regex(/^[A-Z0-9_-]+$/),\n );\n\nconst currencyInputSchema = z\n .string()\n .transform((value) => value.trim().toUpperCase())\n .pipe(z.string().length(3));\n\nconst limitFields = {\n minSubtotalCents: z.number().int().positive().nullable().optional(),\n startsAt: z.string().min(1).nullable().optional(),\n endsAt: z.string().min(1).nullable().optional(),\n maxRedemptions: z.number().int().positive().nullable().optional(),\n active: z.boolean(),\n};\n\nconst discountValueFields = {\n type: discountTypeSchema,\n percentOff: z.number().int().min(1).max(100).nullable().optional(),\n amountOffCents: z.number().int().positive().nullable().optional(),\n currency: currencyInputSchema.nullable().optional(),\n};\n\ntype ValueFields = {\n type?: z.infer<typeof discountTypeSchema>;\n percentOff?: number | null;\n amountOffCents?: number | null;\n currency?: string | null;\n};\n\nconst hasValue = (value: unknown) => value !== undefined && value !== null;\n\nfunction valueFieldsAgree(input: ValueFields): boolean {\n const { type, percentOff, amountOffCents, currency } = input;\n if (type === 'percent') {\n return (\n hasValue(percentOff) && !hasValue(amountOffCents) && !hasValue(currency)\n );\n }\n if (type === 'fixed') {\n return (\n !hasValue(percentOff) && hasValue(amountOffCents) && hasValue(currency)\n );\n }\n return !(hasValue(percentOff) && hasValue(amountOffCents));\n}\n\nconst valueFieldsMessage = {\n message:\n 'percent needs percentOff only; fixed needs amountOffCents and currency only',\n path: ['type'],\n};\n\nexport const discountSchema = z.object({\n id: z.string().min(1),\n code: discountCodeSchema,\n ...discountValueFields,\n ...limitFields,\n redeemedCount: z.number().int().nonnegative(),\n reservedCount: z.number().int().nonnegative(),\n createdAt: z.string().min(1),\n});\n\nexport const discountInputSchema = z\n .object({\n code: discountCodeSchema,\n ...discountValueFields,\n ...limitFields,\n active: limitFields.active.default(true),\n })\n .refine(valueFieldsAgree, valueFieldsMessage);\n\nexport const discountPatchSchema = z\n .object({\n code: discountCodeSchema,\n ...discountValueFields,\n ...limitFields,\n })\n .partial()\n .refine(valueFieldsAgree, valueFieldsMessage);\n\nexport const discountStatusSchema = z.enum([\n 'active',\n 'inactive',\n 'scheduled',\n 'expired',\n]);\n\nexport const adminDiscountListQuerySchema = z.object({\n status: discountStatusSchema.optional(),\n q: z.string().trim().min(1).optional(),\n cursor: z.string().min(1).optional(),\n limit: z.coerce.number().int().min(1).max(100).default(25),\n});\n\nexport const adminDiscountPageSchema = z.object({\n items: z.array(discountSchema),\n nextCursor: z.string().nullable(),\n});\n\nexport const discountPreviewRequestSchema = z.object({\n code: discountCodeSchema,\n items: z\n .array(\n z.object({\n productId: z.string().min(1),\n quantity: z.number().int().positive(),\n }),\n )\n .min(1),\n});\n\nexport const discountPreviewSchema = z.object({\n code: z.string().min(1),\n discountCents: z.number().int().nonnegative(),\n subtotalCents: z.number().int().nonnegative(),\n currency: z.string().length(3),\n});\n\nexport const discountRejectionReasonSchema = z.enum([\n 'not_found',\n 'inactive',\n 'not_started',\n 'expired',\n 'min_subtotal',\n 'exhausted',\n 'currency',\n]);\n\nexport const discountRejectionSchema = z.object({\n error: z.literal('DISCOUNT_INVALID'),\n reason: discountRejectionReasonSchema,\n});\n\nexport type DiscountType = z.infer<typeof discountTypeSchema>;\nexport type Discount = z.infer<typeof discountSchema>;\nexport type DiscountStatus = z.infer<typeof discountStatusSchema>;\nexport type AdminDiscountListQuery = z.infer<\n typeof adminDiscountListQuerySchema\n>;\nexport type AdminDiscountPage = z.infer<typeof adminDiscountPageSchema>;\nexport type DiscountInput = z.input<typeof discountInputSchema>;\nexport type DiscountPatch = z.input<typeof discountPatchSchema>;\nexport type DiscountPreviewRequest = z.input<\n typeof discountPreviewRequestSchema\n>;\nexport type DiscountPreview = z.infer<typeof discountPreviewSchema>;\nexport type DiscountRejectionReason = z.infer<\n typeof discountRejectionReasonSchema\n>;\nexport type DiscountRejection = z.infer<typeof discountRejectionSchema>;\n","import { z } from 'zod';\n\nexport const orderStatusSchema = z.enum([\n 'pending',\n 'paid',\n 'shipped',\n 'cancelled',\n 'expired',\n 'needs_attention',\n 'refunded',\n]);\n\nconst orderItemSchema = z.object({\n productId: z.string().min(1),\n name: z.string().min(1),\n priceCents: z.number().int().nonnegative(),\n quantity: z.number().int().positive(),\n});\n\nexport const orderFulfillmentSchema = z.object({\n carrier: z.string().nullable(),\n trackingNumber: z.string().nullable(),\n trackingUrl: z.string().url().nullable(),\n shippedAt: z.string().min(1),\n});\n\nexport const orderRefundSchema = z.object({\n id: z.string().min(1),\n amountCents: z.number().int().positive(),\n reason: z.string().nullable(),\n restocked: z.boolean(),\n source: z.enum(['admin', 'gateway']),\n status: z.enum(['pending', 'succeeded']),\n createdAt: z.string().min(1),\n});\n\nconst orderTotalsShape = {\n id: z.string().min(1),\n status: orderStatusSchema,\n subtotalCents: z.number().int().nonnegative(),\n discountCents: z.number().int().nonnegative().default(0),\n discountCode: z.string().nullable().default(null),\n shippingCents: z.number().int().nonnegative(),\n shippingLabel: z.string().nullable(),\n taxCents: z.number().int().nonnegative().default(0),\n totalCents: z.number().int().nonnegative(),\n currency: z.string().length(3),\n items: z.array(orderItemSchema),\n fulfillment: orderFulfillmentSchema.nullable(),\n createdAt: z.string().min(1),\n};\n\nexport const orderSummarySchema = z.object(orderTotalsShape);\n\nexport const orderAddressSchema = z.object({\n name: z.string().optional(),\n line1: z.string().optional(),\n line2: z.string().optional(),\n city: z.string().optional(),\n state: z.string().optional(),\n postalCode: z.string().optional(),\n country: z.string().optional(),\n});\n\nexport const orderDetailSchema = z.object({\n ...orderTotalsShape,\n email: z.string().nullable(),\n shippingAddress: orderAddressSchema.nullable(),\n});\n\nexport type OrderStatus = z.infer<typeof orderStatusSchema>;\nexport type OrderFulfillment = z.infer<typeof orderFulfillmentSchema>;\nexport type OrderRefund = z.infer<typeof orderRefundSchema>;\nexport type OrderSummary = z.infer<typeof orderSummarySchema>;\nexport type OrderAddress = z.infer<typeof orderAddressSchema>;\nexport type OrderDetail = z.infer<typeof orderDetailSchema>;\n","import { z } from 'zod';\n\nexport const shippingRateSchema = z.object({\n label: z.string().min(1),\n amountCents: z.number().int().nonnegative(),\n currency: z.string().length(3),\n minDays: z.number().int().nonnegative().nullable().optional(),\n maxDays: z.number().int().nonnegative().nullable().optional(),\n active: z.boolean().default(true),\n sort: z.number().int().default(0),\n});\n\nexport const shippingRatesInputSchema = z\n .array(shippingRateSchema)\n .refine((rates) => new Set(rates.map((r) => r.label)).size === rates.length, {\n message: 'Shipping rate labels must be unique',\n });\n\nexport type ShippingRate = z.infer<typeof shippingRateSchema>;\nexport type ShippingRateInput = z.input<typeof shippingRateSchema>;\n","import { z } from 'zod';\n\nexport const productStatusSchema = z.enum(['draft', 'active', 'archived']);\n\nconst taxCodeSchema = z.string().regex(/^txcd_\\d{8}$/);\n\nconst productFields = z.object({\n name: z.string().trim().min(1),\n description: z.string(),\n materials: z.string().nullable().optional(),\n dimensions: z.string().nullable().optional(),\n priceCents: z.number().int().nonnegative(),\n currency: z.string().length(3).optional(),\n category: z.string().trim().min(1),\n quantity: z.number().int().nonnegative(),\n status: productStatusSchema,\n featured: z.boolean(),\n taxCode: taxCodeSchema.nullable().optional(),\n});\n\nexport const publishRequiredFields = [\n 'name',\n 'priceCents',\n 'category',\n] as const;\n\nexport const adminProductInputSchema = productFields\n .extend({\n name: z.string().trim().default(''),\n description: z.string().default(''),\n priceCents: productFields.shape.priceCents.optional(),\n category: z.string().trim().optional(),\n quantity: z.number().int().nonnegative().default(1),\n status: productStatusSchema.default('draft'),\n featured: z.boolean().default(false),\n })\n .superRefine((product, ctx) => {\n if (product.status !== 'active') return;\n for (const field of publishRequiredFields) {\n const value = product[field];\n if (value === undefined || value === '') {\n ctx.addIssue({\n code: 'custom',\n path: [field],\n message: `${field} is required to publish a product`,\n });\n }\n }\n });\n\nexport const adminProductPatchSchema = productFields\n .partial()\n .extend({ sold: z.boolean().optional() });\n\nexport const adminProductImageSchema = z.object({\n id: z.string().min(1),\n url: z.string().min(1),\n alt: z.string(),\n position: z.number().int().nonnegative(),\n});\n\nexport const adminProductSchema = z.object({\n id: z.string().min(1),\n slug: z.string().min(1),\n name: z.string(),\n description: z.string(),\n materials: z.string().nullable(),\n dimensions: z.string().nullable(),\n priceCents: z.number().int().nonnegative().nullable(),\n currency: z.string().length(3),\n category: z.string().min(1).nullable(),\n quantity: z.number().int().nonnegative(),\n status: productStatusSchema,\n featured: z.boolean(),\n everPublished: z.boolean().default(false),\n taxCode: taxCodeSchema.nullable().default(null),\n images: z.array(adminProductImageSchema),\n});\n\nexport const imageOrderInputSchema = z.object({\n imageIds: z.array(z.string().min(1)),\n});\n\nexport const productImagePatchSchema = z.object({\n alt: z.string().trim().max(500),\n});\n\nexport const adminProductListQuerySchema = z.object({\n status: productStatusSchema.optional(),\n excludeArchived: z.literal('true').optional(),\n incomplete: z.literal('true').optional(),\n stock: z.enum(['in', 'sold']).optional(),\n q: z.string().trim().min(1).optional(),\n cursor: z.string().min(1).optional(),\n limit: z.coerce.number().int().min(1).max(100).default(50),\n});\n\nexport const adminProductPageSchema = z.object({\n items: z.array(adminProductSchema),\n nextCursor: z.string().nullable(),\n});\n\nexport const adminProductCountsSchema = z.object({\n all: z.number().int().nonnegative(),\n live: z.number().int().nonnegative(),\n draft: z.number().int().nonnegative(),\n sold: z.number().int().nonnegative(),\n archived: z.number().int().nonnegative(),\n incompleteDrafts: z.number().int().nonnegative(),\n});\n\nexport const productIncompleteFieldSchema = z.enum([\n ...publishRequiredFields,\n 'images',\n]);\n\nexport type ProductStatus = z.infer<typeof productStatusSchema>;\nexport type AdminProductInput = z.input<typeof adminProductInputSchema>;\nexport type AdminProductPatch = z.input<typeof adminProductPatchSchema>;\nexport type AdminProductImage = z.infer<typeof adminProductImageSchema>;\nexport type AdminProduct = z.infer<typeof adminProductSchema>;\nexport type ProductImagePatch = z.infer<typeof productImagePatchSchema>;\nexport type ImageOrderInput = z.infer<typeof imageOrderInputSchema>;\nexport type AdminProductListQuery = z.input<typeof adminProductListQuerySchema>;\nexport type AdminProductPage = z.infer<typeof adminProductPageSchema>;\nexport type AdminProductCounts = z.infer<typeof adminProductCountsSchema>;\nexport type ProductIncompleteField = z.infer<\n typeof productIncompleteFieldSchema\n>;\n","import { z } from 'zod';\nimport {\n orderDetailSchema,\n orderRefundSchema,\n orderStatusSchema,\n} from './order';\n\nexport const adminOrderListQuerySchema = z.object({\n status: orderStatusSchema.optional(),\n q: z.string().trim().min(1).optional(),\n hasPendingRefund: z\n .enum(['true', 'false'])\n .transform((v) => v === 'true')\n .optional(),\n cursor: z.string().min(1).optional(),\n limit: z.coerce.number().int().min(1).max(100).default(25),\n});\n\nexport const adminOrderListItemSchema = z.object({\n id: z.string().min(1),\n status: orderStatusSchema,\n email: z.string().nullable(),\n taxCents: z.number().int().nonnegative().default(0),\n totalCents: z.number().int().nonnegative(),\n currency: z.string().length(3),\n itemCount: z.number().int().nonnegative(),\n createdAt: z.string().min(1),\n});\n\nexport const adminOrderPageSchema = z.object({\n items: z.array(adminOrderListItemSchema),\n nextCursor: z.string().nullable(),\n});\n\nexport const adminOrderDetailSchema = orderDetailSchema.extend({\n refunds: z.array(orderRefundSchema),\n refundedCents: z.number().int().nonnegative(),\n checkoutSessionId: z.string().nullable(),\n updatedAt: z.string().min(1),\n});\n\nexport const shipOrderInputSchema = z.object({\n carrier: z.string().optional(),\n trackingNumber: z.string().optional(),\n trackingUrl: z.string().url().optional(),\n});\n\nexport const refundOrderInputSchema = z.object({\n amountCents: z.number().int().positive().optional(),\n reason: z.string().max(500).optional(),\n restock: z.boolean().default(false),\n});\n\nexport type AdminOrderListQuery = z.infer<typeof adminOrderListQuerySchema>;\nexport type AdminOrderListItem = z.infer<typeof adminOrderListItemSchema>;\nexport type AdminOrderPage = z.infer<typeof adminOrderPageSchema>;\nexport type AdminOrderDetail = z.infer<typeof adminOrderDetailSchema>;\nexport type ShipOrderInput = z.infer<typeof shipOrderInputSchema>;\nexport type RefundOrderInput = z.infer<typeof refundOrderInputSchema>;\n","export function formatOrderRef(id: string): string {\n return `#${id.replace(/-/g, '').slice(0, 8).toUpperCase()}`;\n}\n\nexport function orderRefSearchTerm(input: string): string {\n return input.trim().replace(/^#/, '');\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;;;ACAA,iBAAkB;AAEX,IAAM,cAAc,aAAE,OAAO;AAAA,EAClC,aAAa,aAAE,OAAO,EAAE,IAAI;AAAA,EAC5B,UAAU,aAAE,OAAO,EAAE,OAAO,CAAC;AAC/B,CAAC;;;ACLD,IAAAA,cAAkB;AAEX,IAAM,qBAAqB,cAAE,OAAO;AAAA,EACzC,KAAK,cAAE,OAAO,EAAE,IAAI,CAAC;AAAA,EACrB,KAAK,cAAE,OAAO;AAChB,CAAC;AAEM,IAAM,qBAAqB,cAAE,KAAK,CAAC,aAAa,QAAQ,UAAU,CAAC;AAEnE,IAAM,gBAAgB,cAAE,OAAO;AAAA,EACpC,IAAI,cAAE,OAAO,EAAE,IAAI,CAAC;AAAA,EACpB,MAAM,cAAE,OAAO,EAAE,IAAI,CAAC;AAAA,EACtB,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cAAE,OAAO,EAAE,SAAS;AAAA,EACvC,WAAW,cAAE,OAAO,EAAE,IAAI,CAAC;AAC7B,CAAC;AAEM,IAAM,uBAAuB,cAAE,OAAO;AAAA,EAC3C,SAAS,cAAE,OAAO,EAAE,SAAS;AAAA,EAC7B,gBAAgB,cAAE,OAAO,EAAE,SAAS;AAAA,EACpC,aAAa,cAAE,OAAO,EAAE,IAAI,EAAE,SAAS;AACzC,CAAC;AAEM,IAAM,yBAAyB,cAAE,OAAO;AAAA,EAC7C,aAAa,cAAE,OAAO,EAAE,IAAI,EAAE,SAAS,EAAE,SAAS;AAAA,EAClD,QAAQ,cAAE,OAAO,EAAE,IAAI,GAAG,EAAE,SAAS;AAAA,EACrC,SAAS,cAAE,QAAQ,EAAE,QAAQ,KAAK;AACpC,CAAC;;;ACnDM,SAAS,eAAe,IAAoB;AACjD,SAAO,IAAI,GAAG,QAAQ,MAAM,EAAE,EAAE,MAAM,GAAG,CAAC,EAAE,YAAY,CAAC;AAC3D;AAEO,SAAS,mBAAmB,OAAuB;AACxD,SAAO,MAAM,KAAK,EAAE,QAAQ,MAAM,EAAE;AACtC;","names":["import_zod","import_zod","import_zod","import_zod","import_zod","import_zod","import_zod","import_zod"]}
|
package/dist/index.d.cts
CHANGED
|
@@ -38,6 +38,10 @@ declare const productSchema: z.ZodObject<{
|
|
|
38
38
|
featured: z.ZodBoolean;
|
|
39
39
|
}, z.core.$strip>;
|
|
40
40
|
declare const productCardSchema: z.ZodObject<{
|
|
41
|
+
quantity: z.ZodNumber;
|
|
42
|
+
slug: z.ZodString;
|
|
43
|
+
name: z.ZodString;
|
|
44
|
+
priceCents: z.ZodNumber;
|
|
41
45
|
currency: z.ZodString;
|
|
42
46
|
availability: z.ZodEnum<{
|
|
43
47
|
available: "available";
|
|
@@ -45,11 +49,7 @@ declare const productCardSchema: z.ZodObject<{
|
|
|
45
49
|
reserved: "reserved";
|
|
46
50
|
}>;
|
|
47
51
|
id: z.ZodString;
|
|
48
|
-
slug: z.ZodString;
|
|
49
|
-
name: z.ZodString;
|
|
50
|
-
priceCents: z.ZodNumber;
|
|
51
52
|
category: z.ZodString;
|
|
52
|
-
quantity: z.ZodNumber;
|
|
53
53
|
featured: z.ZodBoolean;
|
|
54
54
|
images: z.ZodArray<z.ZodObject<{
|
|
55
55
|
url: z.ZodString;
|
|
@@ -69,6 +69,10 @@ declare const productListQuerySchema: z.ZodObject<{
|
|
|
69
69
|
}, z.core.$strip>;
|
|
70
70
|
declare const productCardPageSchema: z.ZodObject<{
|
|
71
71
|
items: z.ZodArray<z.ZodObject<{
|
|
72
|
+
quantity: z.ZodNumber;
|
|
73
|
+
slug: z.ZodString;
|
|
74
|
+
name: z.ZodString;
|
|
75
|
+
priceCents: z.ZodNumber;
|
|
72
76
|
currency: z.ZodString;
|
|
73
77
|
availability: z.ZodEnum<{
|
|
74
78
|
available: "available";
|
|
@@ -76,11 +80,7 @@ declare const productCardPageSchema: z.ZodObject<{
|
|
|
76
80
|
reserved: "reserved";
|
|
77
81
|
}>;
|
|
78
82
|
id: z.ZodString;
|
|
79
|
-
slug: z.ZodString;
|
|
80
|
-
name: z.ZodString;
|
|
81
|
-
priceCents: z.ZodNumber;
|
|
82
83
|
category: z.ZodString;
|
|
83
|
-
quantity: z.ZodNumber;
|
|
84
84
|
featured: z.ZodBoolean;
|
|
85
85
|
images: z.ZodArray<z.ZodObject<{
|
|
86
86
|
url: z.ZodString;
|
|
@@ -172,6 +172,7 @@ declare const orderSummarySchema: z.ZodObject<{
|
|
|
172
172
|
discountCode: z.ZodDefault<z.ZodNullable<z.ZodString>>;
|
|
173
173
|
shippingCents: z.ZodNumber;
|
|
174
174
|
shippingLabel: z.ZodNullable<z.ZodString>;
|
|
175
|
+
taxCents: z.ZodDefault<z.ZodNumber>;
|
|
175
176
|
totalCents: z.ZodNumber;
|
|
176
177
|
currency: z.ZodString;
|
|
177
178
|
items: z.ZodArray<z.ZodObject<{
|
|
@@ -223,6 +224,7 @@ declare const orderDetailSchema: z.ZodObject<{
|
|
|
223
224
|
discountCode: z.ZodDefault<z.ZodNullable<z.ZodString>>;
|
|
224
225
|
shippingCents: z.ZodNumber;
|
|
225
226
|
shippingLabel: z.ZodNullable<z.ZodString>;
|
|
227
|
+
taxCents: z.ZodDefault<z.ZodNumber>;
|
|
226
228
|
totalCents: z.ZodNumber;
|
|
227
229
|
currency: z.ZodString;
|
|
228
230
|
items: z.ZodArray<z.ZodObject<{
|
|
@@ -268,8 +270,8 @@ type ShippingRate = z.infer<typeof shippingRateSchema>;
|
|
|
268
270
|
type ShippingRateInput = z.input<typeof shippingRateSchema>;
|
|
269
271
|
|
|
270
272
|
declare const productStatusSchema: z.ZodEnum<{
|
|
271
|
-
active: "active";
|
|
272
273
|
draft: "draft";
|
|
274
|
+
active: "active";
|
|
273
275
|
archived: "archived";
|
|
274
276
|
}>;
|
|
275
277
|
declare const publishRequiredFields: readonly ["name", "priceCents", "category"];
|
|
@@ -277,14 +279,15 @@ declare const adminProductInputSchema: z.ZodObject<{
|
|
|
277
279
|
materials: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
278
280
|
dimensions: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
279
281
|
currency: z.ZodOptional<z.ZodString>;
|
|
282
|
+
taxCode: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
280
283
|
name: z.ZodDefault<z.ZodString>;
|
|
281
284
|
description: z.ZodDefault<z.ZodString>;
|
|
282
285
|
priceCents: z.ZodOptional<z.ZodNumber>;
|
|
283
286
|
category: z.ZodOptional<z.ZodString>;
|
|
284
287
|
quantity: z.ZodDefault<z.ZodNumber>;
|
|
285
288
|
status: z.ZodDefault<z.ZodEnum<{
|
|
286
|
-
active: "active";
|
|
287
289
|
draft: "draft";
|
|
290
|
+
active: "active";
|
|
288
291
|
archived: "archived";
|
|
289
292
|
}>>;
|
|
290
293
|
featured: z.ZodDefault<z.ZodBoolean>;
|
|
@@ -299,11 +302,12 @@ declare const adminProductPatchSchema: z.ZodObject<{
|
|
|
299
302
|
category: z.ZodOptional<z.ZodString>;
|
|
300
303
|
quantity: z.ZodOptional<z.ZodNumber>;
|
|
301
304
|
status: z.ZodOptional<z.ZodEnum<{
|
|
302
|
-
active: "active";
|
|
303
305
|
draft: "draft";
|
|
306
|
+
active: "active";
|
|
304
307
|
archived: "archived";
|
|
305
308
|
}>>;
|
|
306
309
|
featured: z.ZodOptional<z.ZodBoolean>;
|
|
310
|
+
taxCode: z.ZodOptional<z.ZodOptional<z.ZodNullable<z.ZodString>>>;
|
|
307
311
|
sold: z.ZodOptional<z.ZodBoolean>;
|
|
308
312
|
}, z.core.$strip>;
|
|
309
313
|
declare const adminProductImageSchema: z.ZodObject<{
|
|
@@ -324,11 +328,13 @@ declare const adminProductSchema: z.ZodObject<{
|
|
|
324
328
|
category: z.ZodNullable<z.ZodString>;
|
|
325
329
|
quantity: z.ZodNumber;
|
|
326
330
|
status: z.ZodEnum<{
|
|
327
|
-
active: "active";
|
|
328
331
|
draft: "draft";
|
|
332
|
+
active: "active";
|
|
329
333
|
archived: "archived";
|
|
330
334
|
}>;
|
|
331
335
|
featured: z.ZodBoolean;
|
|
336
|
+
everPublished: z.ZodDefault<z.ZodBoolean>;
|
|
337
|
+
taxCode: z.ZodDefault<z.ZodNullable<z.ZodString>>;
|
|
332
338
|
images: z.ZodArray<z.ZodObject<{
|
|
333
339
|
id: z.ZodString;
|
|
334
340
|
url: z.ZodString;
|
|
@@ -344,8 +350,8 @@ declare const productImagePatchSchema: z.ZodObject<{
|
|
|
344
350
|
}, z.core.$strip>;
|
|
345
351
|
declare const adminProductListQuerySchema: z.ZodObject<{
|
|
346
352
|
status: z.ZodOptional<z.ZodEnum<{
|
|
347
|
-
active: "active";
|
|
348
353
|
draft: "draft";
|
|
354
|
+
active: "active";
|
|
349
355
|
archived: "archived";
|
|
350
356
|
}>>;
|
|
351
357
|
excludeArchived: z.ZodOptional<z.ZodLiteral<"true">>;
|
|
@@ -371,11 +377,13 @@ declare const adminProductPageSchema: z.ZodObject<{
|
|
|
371
377
|
category: z.ZodNullable<z.ZodString>;
|
|
372
378
|
quantity: z.ZodNumber;
|
|
373
379
|
status: z.ZodEnum<{
|
|
374
|
-
active: "active";
|
|
375
380
|
draft: "draft";
|
|
381
|
+
active: "active";
|
|
376
382
|
archived: "archived";
|
|
377
383
|
}>;
|
|
378
384
|
featured: z.ZodBoolean;
|
|
385
|
+
everPublished: z.ZodDefault<z.ZodBoolean>;
|
|
386
|
+
taxCode: z.ZodDefault<z.ZodNullable<z.ZodString>>;
|
|
379
387
|
images: z.ZodArray<z.ZodObject<{
|
|
380
388
|
id: z.ZodString;
|
|
381
389
|
url: z.ZodString;
|
|
@@ -441,6 +449,7 @@ declare const adminOrderListItemSchema: z.ZodObject<{
|
|
|
441
449
|
refunded: "refunded";
|
|
442
450
|
}>;
|
|
443
451
|
email: z.ZodNullable<z.ZodString>;
|
|
452
|
+
taxCents: z.ZodDefault<z.ZodNumber>;
|
|
444
453
|
totalCents: z.ZodNumber;
|
|
445
454
|
currency: z.ZodString;
|
|
446
455
|
itemCount: z.ZodNumber;
|
|
@@ -459,6 +468,7 @@ declare const adminOrderPageSchema: z.ZodObject<{
|
|
|
459
468
|
refunded: "refunded";
|
|
460
469
|
}>;
|
|
461
470
|
email: z.ZodNullable<z.ZodString>;
|
|
471
|
+
taxCents: z.ZodDefault<z.ZodNumber>;
|
|
462
472
|
totalCents: z.ZodNumber;
|
|
463
473
|
currency: z.ZodString;
|
|
464
474
|
itemCount: z.ZodNumber;
|
|
@@ -492,6 +502,7 @@ declare const adminOrderDetailSchema: z.ZodObject<{
|
|
|
492
502
|
discountCode: z.ZodDefault<z.ZodNullable<z.ZodString>>;
|
|
493
503
|
shippingCents: z.ZodNumber;
|
|
494
504
|
shippingLabel: z.ZodNullable<z.ZodString>;
|
|
505
|
+
taxCents: z.ZodDefault<z.ZodNumber>;
|
|
495
506
|
totalCents: z.ZodNumber;
|
|
496
507
|
currency: z.ZodString;
|
|
497
508
|
items: z.ZodArray<z.ZodObject<{
|
|
@@ -682,5 +693,8 @@ type DiscountPreview = z.infer<typeof discountPreviewSchema>;
|
|
|
682
693
|
type DiscountRejectionReason = z.infer<typeof discountRejectionReasonSchema>;
|
|
683
694
|
type DiscountRejection = z.infer<typeof discountRejectionSchema>;
|
|
684
695
|
|
|
685
|
-
|
|
696
|
+
declare function formatOrderRef(id: string): string;
|
|
697
|
+
declare function orderRefSearchTerm(input: string): string;
|
|
698
|
+
|
|
699
|
+
export { adminDiscountListQuerySchema, adminDiscountPageSchema, adminOrderDetailSchema, adminOrderListItemSchema, adminOrderListQuerySchema, adminOrderPageSchema, adminProductCountsSchema, adminProductImageSchema, adminProductInputSchema, adminProductListQuerySchema, adminProductPageSchema, adminProductPatchSchema, adminProductSchema, availabilitySchema, cartLineSchema, categorySchema, checkoutConflictSchema, checkoutRequestSchema, checkoutResponseSchema, discountCodeSchema, discountInputSchema, discountPatchSchema, discountPreviewRequestSchema, discountPreviewSchema, discountRejectionReasonSchema, discountRejectionSchema, discountSchema, discountStatusSchema, discountTypeSchema, formatOrderRef, imageOrderInputSchema, moneySchema, orderAddressSchema, orderDetailSchema, orderFulfillmentSchema, orderRefSearchTerm, orderRefundSchema, orderStatusSchema, orderSummarySchema, productCardPageSchema, productCardSchema, productImagePatchSchema, productImageSchema, productIncompleteFieldSchema, productListQuerySchema, productSchema, productStatusSchema, publishRequiredFields, refundOrderInputSchema, shipOrderInputSchema, shippingRateSchema, shippingRatesInputSchema };
|
|
686
700
|
export type { AdminDiscountListQuery, AdminDiscountPage, AdminOrderDetail, AdminOrderListItem, AdminOrderListQuery, AdminOrderPage, AdminProduct, AdminProductCounts, 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, ProductIncompleteField, ProductListQuery, ProductStatus, RefundOrderInput, ShipOrderInput, ShippingRate, ShippingRateInput };
|
package/dist/index.d.ts
CHANGED
|
@@ -38,6 +38,10 @@ declare const productSchema: z.ZodObject<{
|
|
|
38
38
|
featured: z.ZodBoolean;
|
|
39
39
|
}, z.core.$strip>;
|
|
40
40
|
declare const productCardSchema: z.ZodObject<{
|
|
41
|
+
quantity: z.ZodNumber;
|
|
42
|
+
slug: z.ZodString;
|
|
43
|
+
name: z.ZodString;
|
|
44
|
+
priceCents: z.ZodNumber;
|
|
41
45
|
currency: z.ZodString;
|
|
42
46
|
availability: z.ZodEnum<{
|
|
43
47
|
available: "available";
|
|
@@ -45,11 +49,7 @@ declare const productCardSchema: z.ZodObject<{
|
|
|
45
49
|
reserved: "reserved";
|
|
46
50
|
}>;
|
|
47
51
|
id: z.ZodString;
|
|
48
|
-
slug: z.ZodString;
|
|
49
|
-
name: z.ZodString;
|
|
50
|
-
priceCents: z.ZodNumber;
|
|
51
52
|
category: z.ZodString;
|
|
52
|
-
quantity: z.ZodNumber;
|
|
53
53
|
featured: z.ZodBoolean;
|
|
54
54
|
images: z.ZodArray<z.ZodObject<{
|
|
55
55
|
url: z.ZodString;
|
|
@@ -69,6 +69,10 @@ declare const productListQuerySchema: z.ZodObject<{
|
|
|
69
69
|
}, z.core.$strip>;
|
|
70
70
|
declare const productCardPageSchema: z.ZodObject<{
|
|
71
71
|
items: z.ZodArray<z.ZodObject<{
|
|
72
|
+
quantity: z.ZodNumber;
|
|
73
|
+
slug: z.ZodString;
|
|
74
|
+
name: z.ZodString;
|
|
75
|
+
priceCents: z.ZodNumber;
|
|
72
76
|
currency: z.ZodString;
|
|
73
77
|
availability: z.ZodEnum<{
|
|
74
78
|
available: "available";
|
|
@@ -76,11 +80,7 @@ declare const productCardPageSchema: z.ZodObject<{
|
|
|
76
80
|
reserved: "reserved";
|
|
77
81
|
}>;
|
|
78
82
|
id: z.ZodString;
|
|
79
|
-
slug: z.ZodString;
|
|
80
|
-
name: z.ZodString;
|
|
81
|
-
priceCents: z.ZodNumber;
|
|
82
83
|
category: z.ZodString;
|
|
83
|
-
quantity: z.ZodNumber;
|
|
84
84
|
featured: z.ZodBoolean;
|
|
85
85
|
images: z.ZodArray<z.ZodObject<{
|
|
86
86
|
url: z.ZodString;
|
|
@@ -172,6 +172,7 @@ declare const orderSummarySchema: z.ZodObject<{
|
|
|
172
172
|
discountCode: z.ZodDefault<z.ZodNullable<z.ZodString>>;
|
|
173
173
|
shippingCents: z.ZodNumber;
|
|
174
174
|
shippingLabel: z.ZodNullable<z.ZodString>;
|
|
175
|
+
taxCents: z.ZodDefault<z.ZodNumber>;
|
|
175
176
|
totalCents: z.ZodNumber;
|
|
176
177
|
currency: z.ZodString;
|
|
177
178
|
items: z.ZodArray<z.ZodObject<{
|
|
@@ -223,6 +224,7 @@ declare const orderDetailSchema: z.ZodObject<{
|
|
|
223
224
|
discountCode: z.ZodDefault<z.ZodNullable<z.ZodString>>;
|
|
224
225
|
shippingCents: z.ZodNumber;
|
|
225
226
|
shippingLabel: z.ZodNullable<z.ZodString>;
|
|
227
|
+
taxCents: z.ZodDefault<z.ZodNumber>;
|
|
226
228
|
totalCents: z.ZodNumber;
|
|
227
229
|
currency: z.ZodString;
|
|
228
230
|
items: z.ZodArray<z.ZodObject<{
|
|
@@ -268,8 +270,8 @@ type ShippingRate = z.infer<typeof shippingRateSchema>;
|
|
|
268
270
|
type ShippingRateInput = z.input<typeof shippingRateSchema>;
|
|
269
271
|
|
|
270
272
|
declare const productStatusSchema: z.ZodEnum<{
|
|
271
|
-
active: "active";
|
|
272
273
|
draft: "draft";
|
|
274
|
+
active: "active";
|
|
273
275
|
archived: "archived";
|
|
274
276
|
}>;
|
|
275
277
|
declare const publishRequiredFields: readonly ["name", "priceCents", "category"];
|
|
@@ -277,14 +279,15 @@ declare const adminProductInputSchema: z.ZodObject<{
|
|
|
277
279
|
materials: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
278
280
|
dimensions: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
279
281
|
currency: z.ZodOptional<z.ZodString>;
|
|
282
|
+
taxCode: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
280
283
|
name: z.ZodDefault<z.ZodString>;
|
|
281
284
|
description: z.ZodDefault<z.ZodString>;
|
|
282
285
|
priceCents: z.ZodOptional<z.ZodNumber>;
|
|
283
286
|
category: z.ZodOptional<z.ZodString>;
|
|
284
287
|
quantity: z.ZodDefault<z.ZodNumber>;
|
|
285
288
|
status: z.ZodDefault<z.ZodEnum<{
|
|
286
|
-
active: "active";
|
|
287
289
|
draft: "draft";
|
|
290
|
+
active: "active";
|
|
288
291
|
archived: "archived";
|
|
289
292
|
}>>;
|
|
290
293
|
featured: z.ZodDefault<z.ZodBoolean>;
|
|
@@ -299,11 +302,12 @@ declare const adminProductPatchSchema: z.ZodObject<{
|
|
|
299
302
|
category: z.ZodOptional<z.ZodString>;
|
|
300
303
|
quantity: z.ZodOptional<z.ZodNumber>;
|
|
301
304
|
status: z.ZodOptional<z.ZodEnum<{
|
|
302
|
-
active: "active";
|
|
303
305
|
draft: "draft";
|
|
306
|
+
active: "active";
|
|
304
307
|
archived: "archived";
|
|
305
308
|
}>>;
|
|
306
309
|
featured: z.ZodOptional<z.ZodBoolean>;
|
|
310
|
+
taxCode: z.ZodOptional<z.ZodOptional<z.ZodNullable<z.ZodString>>>;
|
|
307
311
|
sold: z.ZodOptional<z.ZodBoolean>;
|
|
308
312
|
}, z.core.$strip>;
|
|
309
313
|
declare const adminProductImageSchema: z.ZodObject<{
|
|
@@ -324,11 +328,13 @@ declare const adminProductSchema: z.ZodObject<{
|
|
|
324
328
|
category: z.ZodNullable<z.ZodString>;
|
|
325
329
|
quantity: z.ZodNumber;
|
|
326
330
|
status: z.ZodEnum<{
|
|
327
|
-
active: "active";
|
|
328
331
|
draft: "draft";
|
|
332
|
+
active: "active";
|
|
329
333
|
archived: "archived";
|
|
330
334
|
}>;
|
|
331
335
|
featured: z.ZodBoolean;
|
|
336
|
+
everPublished: z.ZodDefault<z.ZodBoolean>;
|
|
337
|
+
taxCode: z.ZodDefault<z.ZodNullable<z.ZodString>>;
|
|
332
338
|
images: z.ZodArray<z.ZodObject<{
|
|
333
339
|
id: z.ZodString;
|
|
334
340
|
url: z.ZodString;
|
|
@@ -344,8 +350,8 @@ declare const productImagePatchSchema: z.ZodObject<{
|
|
|
344
350
|
}, z.core.$strip>;
|
|
345
351
|
declare const adminProductListQuerySchema: z.ZodObject<{
|
|
346
352
|
status: z.ZodOptional<z.ZodEnum<{
|
|
347
|
-
active: "active";
|
|
348
353
|
draft: "draft";
|
|
354
|
+
active: "active";
|
|
349
355
|
archived: "archived";
|
|
350
356
|
}>>;
|
|
351
357
|
excludeArchived: z.ZodOptional<z.ZodLiteral<"true">>;
|
|
@@ -371,11 +377,13 @@ declare const adminProductPageSchema: z.ZodObject<{
|
|
|
371
377
|
category: z.ZodNullable<z.ZodString>;
|
|
372
378
|
quantity: z.ZodNumber;
|
|
373
379
|
status: z.ZodEnum<{
|
|
374
|
-
active: "active";
|
|
375
380
|
draft: "draft";
|
|
381
|
+
active: "active";
|
|
376
382
|
archived: "archived";
|
|
377
383
|
}>;
|
|
378
384
|
featured: z.ZodBoolean;
|
|
385
|
+
everPublished: z.ZodDefault<z.ZodBoolean>;
|
|
386
|
+
taxCode: z.ZodDefault<z.ZodNullable<z.ZodString>>;
|
|
379
387
|
images: z.ZodArray<z.ZodObject<{
|
|
380
388
|
id: z.ZodString;
|
|
381
389
|
url: z.ZodString;
|
|
@@ -441,6 +449,7 @@ declare const adminOrderListItemSchema: z.ZodObject<{
|
|
|
441
449
|
refunded: "refunded";
|
|
442
450
|
}>;
|
|
443
451
|
email: z.ZodNullable<z.ZodString>;
|
|
452
|
+
taxCents: z.ZodDefault<z.ZodNumber>;
|
|
444
453
|
totalCents: z.ZodNumber;
|
|
445
454
|
currency: z.ZodString;
|
|
446
455
|
itemCount: z.ZodNumber;
|
|
@@ -459,6 +468,7 @@ declare const adminOrderPageSchema: z.ZodObject<{
|
|
|
459
468
|
refunded: "refunded";
|
|
460
469
|
}>;
|
|
461
470
|
email: z.ZodNullable<z.ZodString>;
|
|
471
|
+
taxCents: z.ZodDefault<z.ZodNumber>;
|
|
462
472
|
totalCents: z.ZodNumber;
|
|
463
473
|
currency: z.ZodString;
|
|
464
474
|
itemCount: z.ZodNumber;
|
|
@@ -492,6 +502,7 @@ declare const adminOrderDetailSchema: z.ZodObject<{
|
|
|
492
502
|
discountCode: z.ZodDefault<z.ZodNullable<z.ZodString>>;
|
|
493
503
|
shippingCents: z.ZodNumber;
|
|
494
504
|
shippingLabel: z.ZodNullable<z.ZodString>;
|
|
505
|
+
taxCents: z.ZodDefault<z.ZodNumber>;
|
|
495
506
|
totalCents: z.ZodNumber;
|
|
496
507
|
currency: z.ZodString;
|
|
497
508
|
items: z.ZodArray<z.ZodObject<{
|
|
@@ -682,5 +693,8 @@ type DiscountPreview = z.infer<typeof discountPreviewSchema>;
|
|
|
682
693
|
type DiscountRejectionReason = z.infer<typeof discountRejectionReasonSchema>;
|
|
683
694
|
type DiscountRejection = z.infer<typeof discountRejectionSchema>;
|
|
684
695
|
|
|
685
|
-
|
|
696
|
+
declare function formatOrderRef(id: string): string;
|
|
697
|
+
declare function orderRefSearchTerm(input: string): string;
|
|
698
|
+
|
|
699
|
+
export { adminDiscountListQuerySchema, adminDiscountPageSchema, adminOrderDetailSchema, adminOrderListItemSchema, adminOrderListQuerySchema, adminOrderPageSchema, adminProductCountsSchema, adminProductImageSchema, adminProductInputSchema, adminProductListQuerySchema, adminProductPageSchema, adminProductPatchSchema, adminProductSchema, availabilitySchema, cartLineSchema, categorySchema, checkoutConflictSchema, checkoutRequestSchema, checkoutResponseSchema, discountCodeSchema, discountInputSchema, discountPatchSchema, discountPreviewRequestSchema, discountPreviewSchema, discountRejectionReasonSchema, discountRejectionSchema, discountSchema, discountStatusSchema, discountTypeSchema, formatOrderRef, imageOrderInputSchema, moneySchema, orderAddressSchema, orderDetailSchema, orderFulfillmentSchema, orderRefSearchTerm, orderRefundSchema, orderStatusSchema, orderSummarySchema, productCardPageSchema, productCardSchema, productImagePatchSchema, productImageSchema, productIncompleteFieldSchema, productListQuerySchema, productSchema, productStatusSchema, publishRequiredFields, refundOrderInputSchema, shipOrderInputSchema, shippingRateSchema, shippingRatesInputSchema };
|
|
686
700
|
export type { AdminDiscountListQuery, AdminDiscountPage, AdminOrderDetail, AdminOrderListItem, AdminOrderListQuery, AdminOrderPage, AdminProduct, AdminProductCounts, 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, ProductIncompleteField, ProductListQuery, ProductStatus, RefundOrderInput, ShipOrderInput, ShippingRate, ShippingRateInput };
|
package/dist/index.js
CHANGED
|
@@ -227,6 +227,7 @@ var orderTotalsShape = {
|
|
|
227
227
|
discountCode: z6.string().nullable().default(null),
|
|
228
228
|
shippingCents: z6.number().int().nonnegative(),
|
|
229
229
|
shippingLabel: z6.string().nullable(),
|
|
230
|
+
taxCents: z6.number().int().nonnegative().default(0),
|
|
230
231
|
totalCents: z6.number().int().nonnegative(),
|
|
231
232
|
currency: z6.string().length(3),
|
|
232
233
|
items: z6.array(orderItemSchema),
|
|
@@ -267,6 +268,7 @@ var shippingRatesInputSchema = z7.array(shippingRateSchema).refine((rates) => ne
|
|
|
267
268
|
// src/admin.ts
|
|
268
269
|
import { z as z8 } from "zod";
|
|
269
270
|
var productStatusSchema = z8.enum(["draft", "active", "archived"]);
|
|
271
|
+
var taxCodeSchema = z8.string().regex(/^txcd_\d{8}$/);
|
|
270
272
|
var productFields = z8.object({
|
|
271
273
|
name: z8.string().trim().min(1),
|
|
272
274
|
description: z8.string(),
|
|
@@ -277,7 +279,8 @@ var productFields = z8.object({
|
|
|
277
279
|
category: z8.string().trim().min(1),
|
|
278
280
|
quantity: z8.number().int().nonnegative(),
|
|
279
281
|
status: productStatusSchema,
|
|
280
|
-
featured: z8.boolean()
|
|
282
|
+
featured: z8.boolean(),
|
|
283
|
+
taxCode: taxCodeSchema.nullable().optional()
|
|
281
284
|
});
|
|
282
285
|
var publishRequiredFields = [
|
|
283
286
|
"name",
|
|
@@ -325,6 +328,8 @@ var adminProductSchema = z8.object({
|
|
|
325
328
|
quantity: z8.number().int().nonnegative(),
|
|
326
329
|
status: productStatusSchema,
|
|
327
330
|
featured: z8.boolean(),
|
|
331
|
+
everPublished: z8.boolean().default(false),
|
|
332
|
+
taxCode: taxCodeSchema.nullable().default(null),
|
|
328
333
|
images: z8.array(adminProductImageSchema)
|
|
329
334
|
});
|
|
330
335
|
var imageOrderInputSchema = z8.object({
|
|
@@ -372,6 +377,7 @@ var adminOrderListItemSchema = z9.object({
|
|
|
372
377
|
id: z9.string().min(1),
|
|
373
378
|
status: orderStatusSchema,
|
|
374
379
|
email: z9.string().nullable(),
|
|
380
|
+
taxCents: z9.number().int().nonnegative().default(0),
|
|
375
381
|
totalCents: z9.number().int().nonnegative(),
|
|
376
382
|
currency: z9.string().length(3),
|
|
377
383
|
itemCount: z9.number().int().nonnegative(),
|
|
@@ -397,6 +403,14 @@ var refundOrderInputSchema = z9.object({
|
|
|
397
403
|
reason: z9.string().max(500).optional(),
|
|
398
404
|
restock: z9.boolean().default(false)
|
|
399
405
|
});
|
|
406
|
+
|
|
407
|
+
// src/order-ref.ts
|
|
408
|
+
function formatOrderRef(id) {
|
|
409
|
+
return `#${id.replace(/-/g, "").slice(0, 8).toUpperCase()}`;
|
|
410
|
+
}
|
|
411
|
+
function orderRefSearchTerm(input) {
|
|
412
|
+
return input.trim().replace(/^#/, "");
|
|
413
|
+
}
|
|
400
414
|
export {
|
|
401
415
|
adminDiscountListQuerySchema,
|
|
402
416
|
adminDiscountPageSchema,
|
|
@@ -427,11 +441,13 @@ export {
|
|
|
427
441
|
discountSchema,
|
|
428
442
|
discountStatusSchema,
|
|
429
443
|
discountTypeSchema,
|
|
444
|
+
formatOrderRef,
|
|
430
445
|
imageOrderInputSchema,
|
|
431
446
|
moneySchema,
|
|
432
447
|
orderAddressSchema,
|
|
433
448
|
orderDetailSchema,
|
|
434
449
|
orderFulfillmentSchema,
|
|
450
|
+
orderRefSearchTerm,
|
|
435
451
|
orderRefundSchema,
|
|
436
452
|
orderStatusSchema,
|
|
437
453
|
orderSummarySchema,
|
package/dist/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../src/money.ts","../src/product.ts","../src/cart.ts","../src/checkout.ts","../src/discount.ts","../src/order.ts","../src/shipping.ts","../src/admin.ts","../src/admin-orders.ts"],"sourcesContent":["import { z } from 'zod';\n\nexport const moneySchema = z.object({\n amountCents: z.number().int(),\n currency: z.string().length(3),\n});\n\nexport type Money = z.infer<typeof moneySchema>;\n","import { z } from 'zod';\n\nexport const productImageSchema = z.object({\n url: z.string().min(1),\n alt: z.string(),\n});\n\nexport const availabilitySchema = z.enum(['available', 'sold', 'reserved']);\n\nexport const productSchema = z.object({\n id: z.string().min(1),\n slug: z.string().min(1),\n name: z.string().min(1),\n description: z.string(),\n materials: z.string().optional(),\n dimensions: z.string().optional(),\n priceCents: z.number().int().nonnegative(),\n currency: z.string().length(3),\n category: z.string().min(1),\n images: z.array(productImageSchema),\n quantity: z.number().int().nonnegative(),\n availability: availabilitySchema,\n featured: z.boolean(),\n});\n\nexport const productCardSchema = productSchema\n .pick({\n id: true,\n slug: true,\n name: true,\n priceCents: true,\n currency: true,\n category: true,\n quantity: true,\n availability: true,\n featured: true,\n })\n .extend({ images: z.array(productImageSchema).max(1) });\n\nexport const categorySchema = z.object({\n slug: z.string().min(1),\n label: z.string().min(1),\n count: z.number().int().nonnegative(),\n});\n\nexport const productListQuerySchema = z.object({\n category: z.string().min(1).optional(),\n featured: z.boolean().optional(),\n limit: z.coerce.number().int().min(1).max(100).default(48),\n cursor: z.string().min(1).optional(),\n});\n\nexport const productCardPageSchema = z.object({\n items: z.array(productCardSchema),\n nextCursor: z.string().nullable(),\n});\n\nexport type ProductImage = z.infer<typeof productImageSchema>;\nexport type ProductAvailability = z.infer<typeof availabilitySchema>;\nexport type Product = z.infer<typeof productSchema>;\nexport type ProductCard = z.infer<typeof productCardSchema>;\nexport type ProductCardPage = z.infer<typeof productCardPageSchema>;\nexport type Category = z.infer<typeof categorySchema>;\nexport type ProductListQuery = z.input<typeof productListQuerySchema>;\n","import { z } from 'zod';\n\nexport const cartLineSchema = z.object({\n productId: z.string().min(1),\n slug: z.string().min(1),\n name: z.string().min(1),\n priceCents: z.number().int().nonnegative(),\n currency: z.string().length(3),\n imageUrl: z.string().optional(),\n quantity: z.number().int().positive(),\n maxQuantity: z.number().int().positive(),\n});\n\nexport type CartLine = z.infer<typeof cartLineSchema>;\n","import { z } from 'zod';\nimport { discountCodeSchema } from './discount';\n\nexport const checkoutRequestSchema = z.object({\n items: z\n .array(\n z.object({\n productId: z.string().min(1),\n quantity: z.number().int().positive(),\n }),\n )\n .min(1),\n discountCode: discountCodeSchema.optional(),\n});\n\nexport const checkoutResponseSchema = z.object({\n url: z.string().min(1),\n});\n\nexport const checkoutConflictSchema = z.object({\n unavailableProductIds: z.array(z.string().min(1)).min(1),\n});\n\nexport type CheckoutRequest = z.infer<typeof checkoutRequestSchema>;\nexport type CheckoutResponse = z.infer<typeof checkoutResponseSchema>;\nexport type CheckoutConflict = z.infer<typeof checkoutConflictSchema>;\n","import { z } from 'zod';\n\nexport const discountTypeSchema = z.enum(['percent', 'fixed']);\n\nexport const discountCodeSchema = z\n .string()\n .transform((value) => value.trim().toUpperCase())\n .pipe(\n z\n .string()\n .min(1)\n .max(40)\n .regex(/^[A-Z0-9_-]+$/),\n );\n\nconst currencyInputSchema = z\n .string()\n .transform((value) => value.trim().toUpperCase())\n .pipe(z.string().length(3));\n\nconst limitFields = {\n minSubtotalCents: z.number().int().positive().nullable().optional(),\n startsAt: z.string().min(1).nullable().optional(),\n endsAt: z.string().min(1).nullable().optional(),\n maxRedemptions: z.number().int().positive().nullable().optional(),\n active: z.boolean(),\n};\n\nconst discountValueFields = {\n type: discountTypeSchema,\n percentOff: z.number().int().min(1).max(100).nullable().optional(),\n amountOffCents: z.number().int().positive().nullable().optional(),\n currency: currencyInputSchema.nullable().optional(),\n};\n\ntype ValueFields = {\n type?: z.infer<typeof discountTypeSchema>;\n percentOff?: number | null;\n amountOffCents?: number | null;\n currency?: string | null;\n};\n\nconst hasValue = (value: unknown) => value !== undefined && value !== null;\n\nfunction valueFieldsAgree(input: ValueFields): boolean {\n const { type, percentOff, amountOffCents, currency } = input;\n if (type === 'percent') {\n return (\n hasValue(percentOff) && !hasValue(amountOffCents) && !hasValue(currency)\n );\n }\n if (type === 'fixed') {\n return (\n !hasValue(percentOff) && hasValue(amountOffCents) && hasValue(currency)\n );\n }\n return !(hasValue(percentOff) && hasValue(amountOffCents));\n}\n\nconst valueFieldsMessage = {\n message:\n 'percent needs percentOff only; fixed needs amountOffCents and currency only',\n path: ['type'],\n};\n\nexport const discountSchema = z.object({\n id: z.string().min(1),\n code: discountCodeSchema,\n ...discountValueFields,\n ...limitFields,\n redeemedCount: z.number().int().nonnegative(),\n reservedCount: z.number().int().nonnegative(),\n createdAt: z.string().min(1),\n});\n\nexport const discountInputSchema = z\n .object({\n code: discountCodeSchema,\n ...discountValueFields,\n ...limitFields,\n active: limitFields.active.default(true),\n })\n .refine(valueFieldsAgree, valueFieldsMessage);\n\nexport const discountPatchSchema = z\n .object({\n code: discountCodeSchema,\n ...discountValueFields,\n ...limitFields,\n })\n .partial()\n .refine(valueFieldsAgree, valueFieldsMessage);\n\nexport const discountStatusSchema = z.enum([\n 'active',\n 'inactive',\n 'scheduled',\n 'expired',\n]);\n\nexport const adminDiscountListQuerySchema = z.object({\n status: discountStatusSchema.optional(),\n q: z.string().trim().min(1).optional(),\n cursor: z.string().min(1).optional(),\n limit: z.coerce.number().int().min(1).max(100).default(25),\n});\n\nexport const adminDiscountPageSchema = z.object({\n items: z.array(discountSchema),\n nextCursor: z.string().nullable(),\n});\n\nexport const discountPreviewRequestSchema = z.object({\n code: discountCodeSchema,\n items: z\n .array(\n z.object({\n productId: z.string().min(1),\n quantity: z.number().int().positive(),\n }),\n )\n .min(1),\n});\n\nexport const discountPreviewSchema = z.object({\n code: z.string().min(1),\n discountCents: z.number().int().nonnegative(),\n subtotalCents: z.number().int().nonnegative(),\n currency: z.string().length(3),\n});\n\nexport const discountRejectionReasonSchema = z.enum([\n 'not_found',\n 'inactive',\n 'not_started',\n 'expired',\n 'min_subtotal',\n 'exhausted',\n 'currency',\n]);\n\nexport const discountRejectionSchema = z.object({\n error: z.literal('DISCOUNT_INVALID'),\n reason: discountRejectionReasonSchema,\n});\n\nexport type DiscountType = z.infer<typeof discountTypeSchema>;\nexport type Discount = z.infer<typeof discountSchema>;\nexport type DiscountStatus = z.infer<typeof discountStatusSchema>;\nexport type AdminDiscountListQuery = z.infer<\n typeof adminDiscountListQuerySchema\n>;\nexport type AdminDiscountPage = z.infer<typeof adminDiscountPageSchema>;\nexport type DiscountInput = z.input<typeof discountInputSchema>;\nexport type DiscountPatch = z.input<typeof discountPatchSchema>;\nexport type DiscountPreviewRequest = z.input<\n typeof discountPreviewRequestSchema\n>;\nexport type DiscountPreview = z.infer<typeof discountPreviewSchema>;\nexport type DiscountRejectionReason = z.infer<\n typeof discountRejectionReasonSchema\n>;\nexport type DiscountRejection = z.infer<typeof discountRejectionSchema>;\n","import { z } from 'zod';\n\nexport const orderStatusSchema = z.enum([\n 'pending',\n 'paid',\n 'shipped',\n 'cancelled',\n 'expired',\n 'needs_attention',\n 'refunded',\n]);\n\nconst orderItemSchema = z.object({\n productId: z.string().min(1),\n name: z.string().min(1),\n priceCents: z.number().int().nonnegative(),\n quantity: z.number().int().positive(),\n});\n\nexport const orderFulfillmentSchema = z.object({\n carrier: z.string().nullable(),\n trackingNumber: z.string().nullable(),\n trackingUrl: z.string().url().nullable(),\n shippedAt: z.string().min(1),\n});\n\nexport const orderRefundSchema = z.object({\n id: z.string().min(1),\n amountCents: z.number().int().positive(),\n reason: z.string().nullable(),\n restocked: z.boolean(),\n source: z.enum(['admin', 'gateway']),\n status: z.enum(['pending', 'succeeded']),\n createdAt: z.string().min(1),\n});\n\nconst orderTotalsShape = {\n id: z.string().min(1),\n status: orderStatusSchema,\n subtotalCents: z.number().int().nonnegative(),\n discountCents: z.number().int().nonnegative().default(0),\n discountCode: z.string().nullable().default(null),\n shippingCents: z.number().int().nonnegative(),\n shippingLabel: z.string().nullable(),\n totalCents: z.number().int().nonnegative(),\n currency: z.string().length(3),\n items: z.array(orderItemSchema),\n fulfillment: orderFulfillmentSchema.nullable(),\n createdAt: z.string().min(1),\n};\n\nexport const orderSummarySchema = z.object(orderTotalsShape);\n\nexport const orderAddressSchema = z.object({\n name: z.string().optional(),\n line1: z.string().optional(),\n line2: z.string().optional(),\n city: z.string().optional(),\n state: z.string().optional(),\n postalCode: z.string().optional(),\n country: z.string().optional(),\n});\n\nexport const orderDetailSchema = z.object({\n ...orderTotalsShape,\n email: z.string().nullable(),\n shippingAddress: orderAddressSchema.nullable(),\n});\n\nexport type OrderStatus = z.infer<typeof orderStatusSchema>;\nexport type OrderFulfillment = z.infer<typeof orderFulfillmentSchema>;\nexport type OrderRefund = z.infer<typeof orderRefundSchema>;\nexport type OrderSummary = z.infer<typeof orderSummarySchema>;\nexport type OrderAddress = z.infer<typeof orderAddressSchema>;\nexport type OrderDetail = z.infer<typeof orderDetailSchema>;\n","import { z } from 'zod';\n\nexport const shippingRateSchema = z.object({\n label: z.string().min(1),\n amountCents: z.number().int().nonnegative(),\n currency: z.string().length(3),\n minDays: z.number().int().nonnegative().nullable().optional(),\n maxDays: z.number().int().nonnegative().nullable().optional(),\n active: z.boolean().default(true),\n sort: z.number().int().default(0),\n});\n\nexport const shippingRatesInputSchema = z\n .array(shippingRateSchema)\n .refine((rates) => new Set(rates.map((r) => r.label)).size === rates.length, {\n message: 'Shipping rate labels must be unique',\n });\n\nexport type ShippingRate = z.infer<typeof shippingRateSchema>;\nexport type ShippingRateInput = z.input<typeof shippingRateSchema>;\n","import { z } from 'zod';\n\nexport const productStatusSchema = z.enum(['draft', 'active', 'archived']);\n\nconst productFields = z.object({\n name: z.string().trim().min(1),\n description: z.string(),\n materials: z.string().nullable().optional(),\n dimensions: z.string().nullable().optional(),\n priceCents: z.number().int().nonnegative(),\n currency: z.string().length(3).optional(),\n category: z.string().trim().min(1),\n quantity: z.number().int().nonnegative(),\n status: productStatusSchema,\n featured: z.boolean(),\n});\n\nexport const publishRequiredFields = [\n 'name',\n 'priceCents',\n 'category',\n] as const;\n\nexport const adminProductInputSchema = productFields\n .extend({\n name: z.string().trim().default(''),\n description: z.string().default(''),\n priceCents: productFields.shape.priceCents.optional(),\n category: z.string().trim().optional(),\n quantity: z.number().int().nonnegative().default(1),\n status: productStatusSchema.default('draft'),\n featured: z.boolean().default(false),\n })\n .superRefine((product, ctx) => {\n if (product.status !== 'active') return;\n for (const field of publishRequiredFields) {\n const value = product[field];\n if (value === undefined || value === '') {\n ctx.addIssue({\n code: 'custom',\n path: [field],\n message: `${field} is required to publish a product`,\n });\n }\n }\n });\n\nexport const adminProductPatchSchema = productFields\n .partial()\n .extend({ sold: z.boolean().optional() });\n\nexport const adminProductImageSchema = z.object({\n id: z.string().min(1),\n url: z.string().min(1),\n alt: z.string(),\n position: z.number().int().nonnegative(),\n});\n\nexport const adminProductSchema = z.object({\n id: z.string().min(1),\n slug: z.string().min(1),\n name: z.string(),\n description: z.string(),\n materials: z.string().nullable(),\n dimensions: z.string().nullable(),\n priceCents: z.number().int().nonnegative().nullable(),\n currency: z.string().length(3),\n category: z.string().min(1).nullable(),\n quantity: z.number().int().nonnegative(),\n status: productStatusSchema,\n featured: z.boolean(),\n images: z.array(adminProductImageSchema),\n});\n\nexport const imageOrderInputSchema = z.object({\n imageIds: z.array(z.string().min(1)),\n});\n\nexport const productImagePatchSchema = z.object({\n alt: z.string().trim().max(500),\n});\n\nexport const adminProductListQuerySchema = z.object({\n status: productStatusSchema.optional(),\n excludeArchived: z.literal('true').optional(),\n incomplete: z.literal('true').optional(),\n stock: z.enum(['in', 'sold']).optional(),\n q: z.string().trim().min(1).optional(),\n cursor: z.string().min(1).optional(),\n limit: z.coerce.number().int().min(1).max(100).default(50),\n});\n\nexport const adminProductPageSchema = z.object({\n items: z.array(adminProductSchema),\n nextCursor: z.string().nullable(),\n});\n\nexport const adminProductCountsSchema = z.object({\n all: z.number().int().nonnegative(),\n live: z.number().int().nonnegative(),\n draft: z.number().int().nonnegative(),\n sold: z.number().int().nonnegative(),\n archived: z.number().int().nonnegative(),\n incompleteDrafts: z.number().int().nonnegative(),\n});\n\nexport const productIncompleteFieldSchema = z.enum([\n ...publishRequiredFields,\n 'images',\n]);\n\nexport type ProductStatus = z.infer<typeof productStatusSchema>;\nexport type AdminProductInput = z.input<typeof adminProductInputSchema>;\nexport type AdminProductPatch = z.input<typeof adminProductPatchSchema>;\nexport type AdminProductImage = z.infer<typeof adminProductImageSchema>;\nexport type AdminProduct = z.infer<typeof adminProductSchema>;\nexport type ProductImagePatch = z.infer<typeof productImagePatchSchema>;\nexport type ImageOrderInput = z.infer<typeof imageOrderInputSchema>;\nexport type AdminProductListQuery = z.input<typeof adminProductListQuerySchema>;\nexport type AdminProductPage = z.infer<typeof adminProductPageSchema>;\nexport type AdminProductCounts = z.infer<typeof adminProductCountsSchema>;\nexport type ProductIncompleteField = z.infer<\n typeof productIncompleteFieldSchema\n>;\n","import { z } from 'zod';\nimport {\n orderDetailSchema,\n orderRefundSchema,\n orderStatusSchema,\n} from './order';\n\nexport const adminOrderListQuerySchema = z.object({\n status: orderStatusSchema.optional(),\n q: z.string().trim().min(1).optional(),\n hasPendingRefund: z\n .enum(['true', 'false'])\n .transform((v) => v === 'true')\n .optional(),\n cursor: z.string().min(1).optional(),\n limit: z.coerce.number().int().min(1).max(100).default(25),\n});\n\nexport const adminOrderListItemSchema = z.object({\n id: z.string().min(1),\n status: orderStatusSchema,\n email: z.string().nullable(),\n totalCents: z.number().int().nonnegative(),\n currency: z.string().length(3),\n itemCount: z.number().int().nonnegative(),\n createdAt: z.string().min(1),\n});\n\nexport const adminOrderPageSchema = z.object({\n items: z.array(adminOrderListItemSchema),\n nextCursor: z.string().nullable(),\n});\n\nexport const adminOrderDetailSchema = orderDetailSchema.extend({\n refunds: z.array(orderRefundSchema),\n refundedCents: z.number().int().nonnegative(),\n checkoutSessionId: z.string().nullable(),\n updatedAt: z.string().min(1),\n});\n\nexport const shipOrderInputSchema = z.object({\n carrier: z.string().optional(),\n trackingNumber: z.string().optional(),\n trackingUrl: z.string().url().optional(),\n});\n\nexport const refundOrderInputSchema = z.object({\n amountCents: z.number().int().positive().optional(),\n reason: z.string().max(500).optional(),\n restock: z.boolean().default(false),\n});\n\nexport type AdminOrderListQuery = z.infer<typeof adminOrderListQuerySchema>;\nexport type AdminOrderListItem = z.infer<typeof adminOrderListItemSchema>;\nexport type AdminOrderPage = z.infer<typeof adminOrderPageSchema>;\nexport type AdminOrderDetail = z.infer<typeof adminOrderDetailSchema>;\nexport type ShipOrderInput = z.infer<typeof shipOrderInputSchema>;\nexport type RefundOrderInput = z.infer<typeof refundOrderInputSchema>;\n"],"mappings":";AAAA,SAAS,SAAS;AAEX,IAAM,cAAc,EAAE,OAAO;AAAA,EAClC,aAAa,EAAE,OAAO,EAAE,IAAI;AAAA,EAC5B,UAAU,EAAE,OAAO,EAAE,OAAO,CAAC;AAC/B,CAAC;;;ACLD,SAAS,KAAAA,UAAS;AAE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AAO;AAAA,EAC3C,OAAOA,GAAE,MAAM,wBAAwB;AAAA,EACvC,YAAYA,GAAE,OAAO,EAAE,SAAS;AAClC,CAAC;AAEM,IAAM,yBAAyB,kBAAkB,OAAO;AAAA,EAC7D,SAASA,GAAE,MAAM,iBAAiB;AAAA,EAClC,eAAeA,GAAE,OAAO,EAAE,IAAI,EAAE,YAAY;AAAA,EAC5C,mBAAmBA,GAAE,OAAO,EAAE,SAAS;AAAA,EACvC,WAAWA,GAAE,OAAO,EAAE,IAAI,CAAC;AAC7B,CAAC;AAEM,IAAM,uBAAuBA,GAAE,OAAO;AAAA,EAC3C,SAASA,GAAE,OAAO,EAAE,SAAS;AAAA,EAC7B,gBAAgBA,GAAE,OAAO,EAAE,SAAS;AAAA,EACpC,aAAaA,GAAE,OAAO,EAAE,IAAI,EAAE,SAAS;AACzC,CAAC;AAEM,IAAM,yBAAyBA,GAAE,OAAO;AAAA,EAC7C,aAAaA,GAAE,OAAO,EAAE,IAAI,EAAE,SAAS,EAAE,SAAS;AAAA,EAClD,QAAQA,GAAE,OAAO,EAAE,IAAI,GAAG,EAAE,SAAS;AAAA,EACrC,SAASA,GAAE,QAAQ,EAAE,QAAQ,KAAK;AACpC,CAAC;","names":["z","z","z","z","z","z","z","z","z","z"]}
|
|
1
|
+
{"version":3,"sources":["../src/money.ts","../src/product.ts","../src/cart.ts","../src/checkout.ts","../src/discount.ts","../src/order.ts","../src/shipping.ts","../src/admin.ts","../src/admin-orders.ts","../src/order-ref.ts"],"sourcesContent":["import { z } from 'zod';\n\nexport const moneySchema = z.object({\n amountCents: z.number().int(),\n currency: z.string().length(3),\n});\n\nexport type Money = z.infer<typeof moneySchema>;\n","import { z } from 'zod';\n\nexport const productImageSchema = z.object({\n url: z.string().min(1),\n alt: z.string(),\n});\n\nexport const availabilitySchema = z.enum(['available', 'sold', 'reserved']);\n\nexport const productSchema = z.object({\n id: z.string().min(1),\n slug: z.string().min(1),\n name: z.string().min(1),\n description: z.string(),\n materials: z.string().optional(),\n dimensions: z.string().optional(),\n priceCents: z.number().int().nonnegative(),\n currency: z.string().length(3),\n category: z.string().min(1),\n images: z.array(productImageSchema),\n quantity: z.number().int().nonnegative(),\n availability: availabilitySchema,\n featured: z.boolean(),\n});\n\nexport const productCardSchema = productSchema\n .pick({\n id: true,\n slug: true,\n name: true,\n priceCents: true,\n currency: true,\n category: true,\n quantity: true,\n availability: true,\n featured: true,\n })\n .extend({ images: z.array(productImageSchema).max(1) });\n\nexport const categorySchema = z.object({\n slug: z.string().min(1),\n label: z.string().min(1),\n count: z.number().int().nonnegative(),\n});\n\nexport const productListQuerySchema = z.object({\n category: z.string().min(1).optional(),\n featured: z.boolean().optional(),\n limit: z.coerce.number().int().min(1).max(100).default(48),\n cursor: z.string().min(1).optional(),\n});\n\nexport const productCardPageSchema = z.object({\n items: z.array(productCardSchema),\n nextCursor: z.string().nullable(),\n});\n\nexport type ProductImage = z.infer<typeof productImageSchema>;\nexport type ProductAvailability = z.infer<typeof availabilitySchema>;\nexport type Product = z.infer<typeof productSchema>;\nexport type ProductCard = z.infer<typeof productCardSchema>;\nexport type ProductCardPage = z.infer<typeof productCardPageSchema>;\nexport type Category = z.infer<typeof categorySchema>;\nexport type ProductListQuery = z.input<typeof productListQuerySchema>;\n","import { z } from 'zod';\n\nexport const cartLineSchema = z.object({\n productId: z.string().min(1),\n slug: z.string().min(1),\n name: z.string().min(1),\n priceCents: z.number().int().nonnegative(),\n currency: z.string().length(3),\n imageUrl: z.string().optional(),\n quantity: z.number().int().positive(),\n maxQuantity: z.number().int().positive(),\n});\n\nexport type CartLine = z.infer<typeof cartLineSchema>;\n","import { z } from 'zod';\nimport { discountCodeSchema } from './discount';\n\nexport const checkoutRequestSchema = z.object({\n items: z\n .array(\n z.object({\n productId: z.string().min(1),\n quantity: z.number().int().positive(),\n }),\n )\n .min(1),\n discountCode: discountCodeSchema.optional(),\n});\n\nexport const checkoutResponseSchema = z.object({\n url: z.string().min(1),\n});\n\nexport const checkoutConflictSchema = z.object({\n unavailableProductIds: z.array(z.string().min(1)).min(1),\n});\n\nexport type CheckoutRequest = z.infer<typeof checkoutRequestSchema>;\nexport type CheckoutResponse = z.infer<typeof checkoutResponseSchema>;\nexport type CheckoutConflict = z.infer<typeof checkoutConflictSchema>;\n","import { z } from 'zod';\n\nexport const discountTypeSchema = z.enum(['percent', 'fixed']);\n\nexport const discountCodeSchema = z\n .string()\n .transform((value) => value.trim().toUpperCase())\n .pipe(\n z\n .string()\n .min(1)\n .max(40)\n .regex(/^[A-Z0-9_-]+$/),\n );\n\nconst currencyInputSchema = z\n .string()\n .transform((value) => value.trim().toUpperCase())\n .pipe(z.string().length(3));\n\nconst limitFields = {\n minSubtotalCents: z.number().int().positive().nullable().optional(),\n startsAt: z.string().min(1).nullable().optional(),\n endsAt: z.string().min(1).nullable().optional(),\n maxRedemptions: z.number().int().positive().nullable().optional(),\n active: z.boolean(),\n};\n\nconst discountValueFields = {\n type: discountTypeSchema,\n percentOff: z.number().int().min(1).max(100).nullable().optional(),\n amountOffCents: z.number().int().positive().nullable().optional(),\n currency: currencyInputSchema.nullable().optional(),\n};\n\ntype ValueFields = {\n type?: z.infer<typeof discountTypeSchema>;\n percentOff?: number | null;\n amountOffCents?: number | null;\n currency?: string | null;\n};\n\nconst hasValue = (value: unknown) => value !== undefined && value !== null;\n\nfunction valueFieldsAgree(input: ValueFields): boolean {\n const { type, percentOff, amountOffCents, currency } = input;\n if (type === 'percent') {\n return (\n hasValue(percentOff) && !hasValue(amountOffCents) && !hasValue(currency)\n );\n }\n if (type === 'fixed') {\n return (\n !hasValue(percentOff) && hasValue(amountOffCents) && hasValue(currency)\n );\n }\n return !(hasValue(percentOff) && hasValue(amountOffCents));\n}\n\nconst valueFieldsMessage = {\n message:\n 'percent needs percentOff only; fixed needs amountOffCents and currency only',\n path: ['type'],\n};\n\nexport const discountSchema = z.object({\n id: z.string().min(1),\n code: discountCodeSchema,\n ...discountValueFields,\n ...limitFields,\n redeemedCount: z.number().int().nonnegative(),\n reservedCount: z.number().int().nonnegative(),\n createdAt: z.string().min(1),\n});\n\nexport const discountInputSchema = z\n .object({\n code: discountCodeSchema,\n ...discountValueFields,\n ...limitFields,\n active: limitFields.active.default(true),\n })\n .refine(valueFieldsAgree, valueFieldsMessage);\n\nexport const discountPatchSchema = z\n .object({\n code: discountCodeSchema,\n ...discountValueFields,\n ...limitFields,\n })\n .partial()\n .refine(valueFieldsAgree, valueFieldsMessage);\n\nexport const discountStatusSchema = z.enum([\n 'active',\n 'inactive',\n 'scheduled',\n 'expired',\n]);\n\nexport const adminDiscountListQuerySchema = z.object({\n status: discountStatusSchema.optional(),\n q: z.string().trim().min(1).optional(),\n cursor: z.string().min(1).optional(),\n limit: z.coerce.number().int().min(1).max(100).default(25),\n});\n\nexport const adminDiscountPageSchema = z.object({\n items: z.array(discountSchema),\n nextCursor: z.string().nullable(),\n});\n\nexport const discountPreviewRequestSchema = z.object({\n code: discountCodeSchema,\n items: z\n .array(\n z.object({\n productId: z.string().min(1),\n quantity: z.number().int().positive(),\n }),\n )\n .min(1),\n});\n\nexport const discountPreviewSchema = z.object({\n code: z.string().min(1),\n discountCents: z.number().int().nonnegative(),\n subtotalCents: z.number().int().nonnegative(),\n currency: z.string().length(3),\n});\n\nexport const discountRejectionReasonSchema = z.enum([\n 'not_found',\n 'inactive',\n 'not_started',\n 'expired',\n 'min_subtotal',\n 'exhausted',\n 'currency',\n]);\n\nexport const discountRejectionSchema = z.object({\n error: z.literal('DISCOUNT_INVALID'),\n reason: discountRejectionReasonSchema,\n});\n\nexport type DiscountType = z.infer<typeof discountTypeSchema>;\nexport type Discount = z.infer<typeof discountSchema>;\nexport type DiscountStatus = z.infer<typeof discountStatusSchema>;\nexport type AdminDiscountListQuery = z.infer<\n typeof adminDiscountListQuerySchema\n>;\nexport type AdminDiscountPage = z.infer<typeof adminDiscountPageSchema>;\nexport type DiscountInput = z.input<typeof discountInputSchema>;\nexport type DiscountPatch = z.input<typeof discountPatchSchema>;\nexport type DiscountPreviewRequest = z.input<\n typeof discountPreviewRequestSchema\n>;\nexport type DiscountPreview = z.infer<typeof discountPreviewSchema>;\nexport type DiscountRejectionReason = z.infer<\n typeof discountRejectionReasonSchema\n>;\nexport type DiscountRejection = z.infer<typeof discountRejectionSchema>;\n","import { z } from 'zod';\n\nexport const orderStatusSchema = z.enum([\n 'pending',\n 'paid',\n 'shipped',\n 'cancelled',\n 'expired',\n 'needs_attention',\n 'refunded',\n]);\n\nconst orderItemSchema = z.object({\n productId: z.string().min(1),\n name: z.string().min(1),\n priceCents: z.number().int().nonnegative(),\n quantity: z.number().int().positive(),\n});\n\nexport const orderFulfillmentSchema = z.object({\n carrier: z.string().nullable(),\n trackingNumber: z.string().nullable(),\n trackingUrl: z.string().url().nullable(),\n shippedAt: z.string().min(1),\n});\n\nexport const orderRefundSchema = z.object({\n id: z.string().min(1),\n amountCents: z.number().int().positive(),\n reason: z.string().nullable(),\n restocked: z.boolean(),\n source: z.enum(['admin', 'gateway']),\n status: z.enum(['pending', 'succeeded']),\n createdAt: z.string().min(1),\n});\n\nconst orderTotalsShape = {\n id: z.string().min(1),\n status: orderStatusSchema,\n subtotalCents: z.number().int().nonnegative(),\n discountCents: z.number().int().nonnegative().default(0),\n discountCode: z.string().nullable().default(null),\n shippingCents: z.number().int().nonnegative(),\n shippingLabel: z.string().nullable(),\n taxCents: z.number().int().nonnegative().default(0),\n totalCents: z.number().int().nonnegative(),\n currency: z.string().length(3),\n items: z.array(orderItemSchema),\n fulfillment: orderFulfillmentSchema.nullable(),\n createdAt: z.string().min(1),\n};\n\nexport const orderSummarySchema = z.object(orderTotalsShape);\n\nexport const orderAddressSchema = z.object({\n name: z.string().optional(),\n line1: z.string().optional(),\n line2: z.string().optional(),\n city: z.string().optional(),\n state: z.string().optional(),\n postalCode: z.string().optional(),\n country: z.string().optional(),\n});\n\nexport const orderDetailSchema = z.object({\n ...orderTotalsShape,\n email: z.string().nullable(),\n shippingAddress: orderAddressSchema.nullable(),\n});\n\nexport type OrderStatus = z.infer<typeof orderStatusSchema>;\nexport type OrderFulfillment = z.infer<typeof orderFulfillmentSchema>;\nexport type OrderRefund = z.infer<typeof orderRefundSchema>;\nexport type OrderSummary = z.infer<typeof orderSummarySchema>;\nexport type OrderAddress = z.infer<typeof orderAddressSchema>;\nexport type OrderDetail = z.infer<typeof orderDetailSchema>;\n","import { z } from 'zod';\n\nexport const shippingRateSchema = z.object({\n label: z.string().min(1),\n amountCents: z.number().int().nonnegative(),\n currency: z.string().length(3),\n minDays: z.number().int().nonnegative().nullable().optional(),\n maxDays: z.number().int().nonnegative().nullable().optional(),\n active: z.boolean().default(true),\n sort: z.number().int().default(0),\n});\n\nexport const shippingRatesInputSchema = z\n .array(shippingRateSchema)\n .refine((rates) => new Set(rates.map((r) => r.label)).size === rates.length, {\n message: 'Shipping rate labels must be unique',\n });\n\nexport type ShippingRate = z.infer<typeof shippingRateSchema>;\nexport type ShippingRateInput = z.input<typeof shippingRateSchema>;\n","import { z } from 'zod';\n\nexport const productStatusSchema = z.enum(['draft', 'active', 'archived']);\n\nconst taxCodeSchema = z.string().regex(/^txcd_\\d{8}$/);\n\nconst productFields = z.object({\n name: z.string().trim().min(1),\n description: z.string(),\n materials: z.string().nullable().optional(),\n dimensions: z.string().nullable().optional(),\n priceCents: z.number().int().nonnegative(),\n currency: z.string().length(3).optional(),\n category: z.string().trim().min(1),\n quantity: z.number().int().nonnegative(),\n status: productStatusSchema,\n featured: z.boolean(),\n taxCode: taxCodeSchema.nullable().optional(),\n});\n\nexport const publishRequiredFields = [\n 'name',\n 'priceCents',\n 'category',\n] as const;\n\nexport const adminProductInputSchema = productFields\n .extend({\n name: z.string().trim().default(''),\n description: z.string().default(''),\n priceCents: productFields.shape.priceCents.optional(),\n category: z.string().trim().optional(),\n quantity: z.number().int().nonnegative().default(1),\n status: productStatusSchema.default('draft'),\n featured: z.boolean().default(false),\n })\n .superRefine((product, ctx) => {\n if (product.status !== 'active') return;\n for (const field of publishRequiredFields) {\n const value = product[field];\n if (value === undefined || value === '') {\n ctx.addIssue({\n code: 'custom',\n path: [field],\n message: `${field} is required to publish a product`,\n });\n }\n }\n });\n\nexport const adminProductPatchSchema = productFields\n .partial()\n .extend({ sold: z.boolean().optional() });\n\nexport const adminProductImageSchema = z.object({\n id: z.string().min(1),\n url: z.string().min(1),\n alt: z.string(),\n position: z.number().int().nonnegative(),\n});\n\nexport const adminProductSchema = z.object({\n id: z.string().min(1),\n slug: z.string().min(1),\n name: z.string(),\n description: z.string(),\n materials: z.string().nullable(),\n dimensions: z.string().nullable(),\n priceCents: z.number().int().nonnegative().nullable(),\n currency: z.string().length(3),\n category: z.string().min(1).nullable(),\n quantity: z.number().int().nonnegative(),\n status: productStatusSchema,\n featured: z.boolean(),\n everPublished: z.boolean().default(false),\n taxCode: taxCodeSchema.nullable().default(null),\n images: z.array(adminProductImageSchema),\n});\n\nexport const imageOrderInputSchema = z.object({\n imageIds: z.array(z.string().min(1)),\n});\n\nexport const productImagePatchSchema = z.object({\n alt: z.string().trim().max(500),\n});\n\nexport const adminProductListQuerySchema = z.object({\n status: productStatusSchema.optional(),\n excludeArchived: z.literal('true').optional(),\n incomplete: z.literal('true').optional(),\n stock: z.enum(['in', 'sold']).optional(),\n q: z.string().trim().min(1).optional(),\n cursor: z.string().min(1).optional(),\n limit: z.coerce.number().int().min(1).max(100).default(50),\n});\n\nexport const adminProductPageSchema = z.object({\n items: z.array(adminProductSchema),\n nextCursor: z.string().nullable(),\n});\n\nexport const adminProductCountsSchema = z.object({\n all: z.number().int().nonnegative(),\n live: z.number().int().nonnegative(),\n draft: z.number().int().nonnegative(),\n sold: z.number().int().nonnegative(),\n archived: z.number().int().nonnegative(),\n incompleteDrafts: z.number().int().nonnegative(),\n});\n\nexport const productIncompleteFieldSchema = z.enum([\n ...publishRequiredFields,\n 'images',\n]);\n\nexport type ProductStatus = z.infer<typeof productStatusSchema>;\nexport type AdminProductInput = z.input<typeof adminProductInputSchema>;\nexport type AdminProductPatch = z.input<typeof adminProductPatchSchema>;\nexport type AdminProductImage = z.infer<typeof adminProductImageSchema>;\nexport type AdminProduct = z.infer<typeof adminProductSchema>;\nexport type ProductImagePatch = z.infer<typeof productImagePatchSchema>;\nexport type ImageOrderInput = z.infer<typeof imageOrderInputSchema>;\nexport type AdminProductListQuery = z.input<typeof adminProductListQuerySchema>;\nexport type AdminProductPage = z.infer<typeof adminProductPageSchema>;\nexport type AdminProductCounts = z.infer<typeof adminProductCountsSchema>;\nexport type ProductIncompleteField = z.infer<\n typeof productIncompleteFieldSchema\n>;\n","import { z } from 'zod';\nimport {\n orderDetailSchema,\n orderRefundSchema,\n orderStatusSchema,\n} from './order';\n\nexport const adminOrderListQuerySchema = z.object({\n status: orderStatusSchema.optional(),\n q: z.string().trim().min(1).optional(),\n hasPendingRefund: z\n .enum(['true', 'false'])\n .transform((v) => v === 'true')\n .optional(),\n cursor: z.string().min(1).optional(),\n limit: z.coerce.number().int().min(1).max(100).default(25),\n});\n\nexport const adminOrderListItemSchema = z.object({\n id: z.string().min(1),\n status: orderStatusSchema,\n email: z.string().nullable(),\n taxCents: z.number().int().nonnegative().default(0),\n totalCents: z.number().int().nonnegative(),\n currency: z.string().length(3),\n itemCount: z.number().int().nonnegative(),\n createdAt: z.string().min(1),\n});\n\nexport const adminOrderPageSchema = z.object({\n items: z.array(adminOrderListItemSchema),\n nextCursor: z.string().nullable(),\n});\n\nexport const adminOrderDetailSchema = orderDetailSchema.extend({\n refunds: z.array(orderRefundSchema),\n refundedCents: z.number().int().nonnegative(),\n checkoutSessionId: z.string().nullable(),\n updatedAt: z.string().min(1),\n});\n\nexport const shipOrderInputSchema = z.object({\n carrier: z.string().optional(),\n trackingNumber: z.string().optional(),\n trackingUrl: z.string().url().optional(),\n});\n\nexport const refundOrderInputSchema = z.object({\n amountCents: z.number().int().positive().optional(),\n reason: z.string().max(500).optional(),\n restock: z.boolean().default(false),\n});\n\nexport type AdminOrderListQuery = z.infer<typeof adminOrderListQuerySchema>;\nexport type AdminOrderListItem = z.infer<typeof adminOrderListItemSchema>;\nexport type AdminOrderPage = z.infer<typeof adminOrderPageSchema>;\nexport type AdminOrderDetail = z.infer<typeof adminOrderDetailSchema>;\nexport type ShipOrderInput = z.infer<typeof shipOrderInputSchema>;\nexport type RefundOrderInput = z.infer<typeof refundOrderInputSchema>;\n","export function formatOrderRef(id: string): string {\n return `#${id.replace(/-/g, '').slice(0, 8).toUpperCase()}`;\n}\n\nexport function orderRefSearchTerm(input: string): string {\n return input.trim().replace(/^#/, '');\n}\n"],"mappings":";AAAA,SAAS,SAAS;AAEX,IAAM,cAAc,EAAE,OAAO;AAAA,EAClC,aAAa,EAAE,OAAO,EAAE,IAAI;AAAA,EAC5B,UAAU,EAAE,OAAO,EAAE,OAAO,CAAC;AAC/B,CAAC;;;ACLD,SAAS,KAAAA,UAAS;AAEX,IAAM,qBAAqBA,GAAE,OAAO;AAAA,EACzC,KAAKA,GAAE,OAAO,EAAE,IAAI,CAAC;AAAA,EACrB,KAAKA,GAAE,OAAO;AAChB,CAAC;AAEM,IAAM,qBAAqBA,GAAE,KAAK,CAAC,aAAa,QAAQ,UAAU,CAAC;AAEnE,IAAM,gBAAgBA,GAAE,OAAO;AAAA,EACpC,IAAIA,GAAE,OAAO,EAAE,IAAI,CAAC;AAAA,EACpB,MAAMA,GAAE,OAAO,EAAE,IAAI,CAAC;AAAA,EACtB,MAAMA,GAAE,OAAO,EAAE,IAAI,CAAC;AAAA,EACtB,aAAaA,GAAE,OAAO;AAAA,EACtB,WAAWA,GAAE,OAAO,EAAE,SAAS;AAAA,EAC/B,YAAYA,GAAE,OAAO,EAAE,SAAS;AAAA,EAChC,YAAYA,GAAE,OAAO,EAAE,IAAI,EAAE,YAAY;AAAA,EACzC,UAAUA,GAAE,OAAO,EAAE,OAAO,CAAC;AAAA,EAC7B,UAAUA,GAAE,OAAO,EAAE,IAAI,CAAC;AAAA,EAC1B,QAAQA,GAAE,MAAM,kBAAkB;AAAA,EAClC,UAAUA,GA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