@zyacreatives/shared 2.2.98 → 2.2.99
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/schemas/product.js
CHANGED
|
@@ -3,7 +3,6 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
|
3
3
|
exports.ProductEntitySchema = exports.UpdateProductInputSchema = exports.ProductServiceAndComplianceInputSchema = exports.CreateProductInputSchema = exports.BaseProductSchema = exports.ProductLinkSchema = exports.ProductDiscountEntitySchema = exports.ProductDeliveryFileEntitySchema = exports.ProductCoverImageEntitySchema = exports.DeliveryFileInputSchema = exports.CoverImageInputSchema = void 0;
|
|
4
4
|
const zod_openapi_1 = require("@hono/zod-openapi");
|
|
5
5
|
const constants_1 = require("../constants");
|
|
6
|
-
// --- File Input Schemas ---
|
|
7
6
|
exports.CoverImageInputSchema = zod_openapi_1.z.object({
|
|
8
7
|
key: zod_openapi_1.z.string().openapi({ description: "Storage key of the uploaded file" }),
|
|
9
8
|
mimeType: zod_openapi_1.z.string().openapi({ example: "image/jpeg" }),
|
|
@@ -15,7 +14,6 @@ exports.DeliveryFileInputSchema = zod_openapi_1.z.object({
|
|
|
15
14
|
mimeType: zod_openapi_1.z.string().openapi({ example: "application/zip" }),
|
|
16
15
|
order: zod_openapi_1.z.number().int().default(0),
|
|
17
16
|
});
|
|
18
|
-
// --- Entity Schemas ---
|
|
19
17
|
exports.ProductCoverImageEntitySchema = zod_openapi_1.z.object({
|
|
20
18
|
fileId: zod_openapi_1.z
|
|
21
19
|
.cuid2()
|
|
@@ -70,7 +68,6 @@ exports.BaseProductSchema = zod_openapi_1.z.object({
|
|
|
70
68
|
supportEmail: zod_openapi_1.z.string().nullable(),
|
|
71
69
|
supportPhone: zod_openapi_1.z.string().nullable(),
|
|
72
70
|
});
|
|
73
|
-
// --- Core Input Schema ---
|
|
74
71
|
const ProductCoreInputSchema = zod_openapi_1.z.object({
|
|
75
72
|
id: zod_openapi_1.z.cuid2().openapi({ description: "Client-generated ID for the product" }),
|
|
76
73
|
title: zod_openapi_1.z.string().min(1, "Title is required").max(255),
|
|
@@ -88,7 +85,7 @@ const ProductCoreInputSchema = zod_openapi_1.z.object({
|
|
|
88
85
|
productFiles: zod_openapi_1.z.array(exports.DeliveryFileInputSchema).default([]),
|
|
89
86
|
productLinks: zod_openapi_1.z.array(exports.ProductLinkSchema).default([]),
|
|
90
87
|
pricingModel: zod_openapi_1.z.enum(constants_1.PRICING_MODELS).default(constants_1.PRICING_MODELS.FIXED),
|
|
91
|
-
price: zod_openapi_1.z.number().int("Must be
|
|
88
|
+
price: zod_openapi_1.z.number().int("Must be a whole number").min(0).optional(),
|
|
92
89
|
suggestedPrice: zod_openapi_1.z.number().int("Must be in cents").min(0).optional(),
|
|
93
90
|
discounts: zod_openapi_1.z.array(exports.ProductDiscountEntitySchema).max(3).default([]),
|
|
94
91
|
});
|
package/package.json
CHANGED
package/src/schemas/product.ts
CHANGED
|
@@ -6,7 +6,6 @@ import {
|
|
|
6
6
|
WAGES_CURRENCY,
|
|
7
7
|
} from "../constants";
|
|
8
8
|
|
|
9
|
-
// --- File Input Schemas ---
|
|
10
9
|
|
|
11
10
|
export const CoverImageInputSchema = z.object({
|
|
12
11
|
key: z.string().openapi({ description: "Storage key of the uploaded file" }),
|
|
@@ -21,7 +20,6 @@ export const DeliveryFileInputSchema = z.object({
|
|
|
21
20
|
order: z.number().int().default(0),
|
|
22
21
|
});
|
|
23
22
|
|
|
24
|
-
// --- Entity Schemas ---
|
|
25
23
|
|
|
26
24
|
export const ProductCoverImageEntitySchema = z.object({
|
|
27
25
|
fileId: z
|
|
@@ -88,7 +86,6 @@ export const BaseProductSchema = z.object({
|
|
|
88
86
|
supportPhone: z.string().nullable(),
|
|
89
87
|
});
|
|
90
88
|
|
|
91
|
-
// --- Core Input Schema ---
|
|
92
89
|
|
|
93
90
|
const ProductCoreInputSchema = z.object({
|
|
94
91
|
id: z.cuid2().openapi({ description: "Client-generated ID for the product" }),
|
|
@@ -112,7 +109,7 @@ const ProductCoreInputSchema = z.object({
|
|
|
112
109
|
|
|
113
110
|
pricingModel: z.enum(PRICING_MODELS).default(PRICING_MODELS.FIXED),
|
|
114
111
|
|
|
115
|
-
price: z.number().int("Must be
|
|
112
|
+
price: z.number().int("Must be a whole number").min(0).optional(),
|
|
116
113
|
suggestedPrice: z.number().int("Must be in cents").min(0).optional(),
|
|
117
114
|
|
|
118
115
|
discounts: z.array(ProductDiscountEntitySchema).max(3).default([]),
|