@zyacreatives/shared 2.2.94 → 2.2.95

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.
@@ -27,6 +27,11 @@ export declare const ProductDiscountEntitySchema: z.ZodObject<{
27
27
  amount: z.ZodNumber;
28
28
  discountCode: z.ZodOptional<z.ZodString>;
29
29
  }, z.core.$strip>;
30
+ export declare const ProductLinkSchema: z.ZodObject<{
31
+ title: z.ZodNullable<z.ZodString>;
32
+ url: z.ZodString;
33
+ }, z.core.$strip>;
34
+ export type ProductLink = z.infer<typeof ProductLinkSchema>;
30
35
  export declare const BaseProductSchema: z.ZodObject<{
31
36
  id: z.ZodCUID2;
32
37
  createdAt: z.ZodDate;
@@ -39,7 +44,10 @@ export declare const BaseProductSchema: z.ZodObject<{
39
44
  category: z.ZodString;
40
45
  subcategory: z.ZodNullable<z.ZodString>;
41
46
  tags: z.ZodNullable<z.ZodArray<z.ZodString>>;
42
- productLinks: z.ZodNullable<z.ZodArray<z.ZodString>>;
47
+ productLinks: z.ZodNullable<z.ZodArray<z.ZodObject<{
48
+ title: z.ZodNullable<z.ZodString>;
49
+ url: z.ZodString;
50
+ }, z.core.$strip>>>;
43
51
  pricingModel: z.ZodEnum<{
44
52
  readonly FREE: "Free";
45
53
  readonly FIXED: "Fixed";
@@ -78,7 +86,10 @@ export declare const CreateProductInputSchema: z.ZodObject<{
78
86
  mimeType: z.ZodString;
79
87
  order: z.ZodDefault<z.ZodNumber>;
80
88
  }, z.core.$strip>>>;
81
- productLinks: z.ZodDefault<z.ZodArray<z.ZodURL>>;
89
+ productLinks: z.ZodDefault<z.ZodArray<z.ZodObject<{
90
+ title: z.ZodNullable<z.ZodString>;
91
+ url: z.ZodString;
92
+ }, z.core.$strip>>>;
82
93
  pricingModel: z.ZodDefault<z.ZodEnum<{
83
94
  readonly FREE: "Free";
84
95
  readonly FIXED: "Fixed";
@@ -123,7 +134,10 @@ export declare const UpdateProductInputSchema: z.ZodObject<{
123
134
  mimeType: z.ZodString;
124
135
  order: z.ZodDefault<z.ZodNumber>;
125
136
  }, z.core.$strip>>>>;
126
- productLinks: z.ZodOptional<z.ZodDefault<z.ZodArray<z.ZodURL>>>;
137
+ productLinks: z.ZodOptional<z.ZodDefault<z.ZodArray<z.ZodObject<{
138
+ title: z.ZodNullable<z.ZodString>;
139
+ url: z.ZodString;
140
+ }, z.core.$strip>>>>;
127
141
  pricingModel: z.ZodOptional<z.ZodDefault<z.ZodEnum<{
128
142
  readonly FREE: "Free";
129
143
  readonly FIXED: "Fixed";
@@ -1,6 +1,6 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.ProductEntitySchema = exports.UpdateProductInputSchema = exports.ProductServiceAndComplianceInputSchema = exports.CreateProductInputSchema = exports.BaseProductSchema = exports.ProductDiscountEntitySchema = exports.ProductDeliveryFileEntitySchema = exports.ProductCoverImageEntitySchema = exports.DeliveryFileInputSchema = exports.CoverImageInputSchema = void 0;
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
6
  // --- File Input Schemas ---
@@ -37,6 +37,10 @@ exports.ProductDiscountEntitySchema = zod_openapi_1.z.object({
37
37
  .min(0, "Discount amount cannot be negative"),
38
38
  discountCode: zod_openapi_1.z.string().optional(),
39
39
  });
40
+ exports.ProductLinkSchema = zod_openapi_1.z.object({
41
+ title: zod_openapi_1.z.string().nullable(),
42
+ url: zod_openapi_1.z.string(),
43
+ });
40
44
  exports.BaseProductSchema = zod_openapi_1.z.object({
41
45
  id: zod_openapi_1.z.cuid2(),
42
46
  createdAt: zod_openapi_1.z.date(),
@@ -49,7 +53,7 @@ exports.BaseProductSchema = zod_openapi_1.z.object({
49
53
  category: zod_openapi_1.z.string(),
50
54
  subcategory: zod_openapi_1.z.string().nullable(),
51
55
  tags: zod_openapi_1.z.array(zod_openapi_1.z.string()).nullable(),
52
- productLinks: zod_openapi_1.z.array(zod_openapi_1.z.string()).nullable(),
56
+ productLinks: zod_openapi_1.z.array(exports.ProductLinkSchema).nullable(),
53
57
  pricingModel: zod_openapi_1.z.enum(constants_1.PRICING_MODELS),
54
58
  currency: zod_openapi_1.z.string(),
55
59
  price: zod_openapi_1.z.number().nullable(),
@@ -79,9 +83,7 @@ const ProductCoreInputSchema = zod_openapi_1.z.object({
79
83
  .min(1, "At least one cover image is required")
80
84
  .max(3, "Maximum of 3 cover images allowed"),
81
85
  productFiles: zod_openapi_1.z.array(exports.DeliveryFileInputSchema).default([]),
82
- productLinks: zod_openapi_1.z
83
- .array(zod_openapi_1.z.url().openapi({ example: "https://figma.com/file/..." }))
84
- .default([]),
86
+ productLinks: zod_openapi_1.z.array(exports.ProductLinkSchema).default([]),
85
87
  pricingModel: zod_openapi_1.z.enum(constants_1.PRICING_MODELS).default(constants_1.PRICING_MODELS.FIXED),
86
88
  currency: zod_openapi_1.z.string().default("USD").openapi({ example: "USD" }),
87
89
  price: zod_openapi_1.z.number().int("Must be in cents").min(0).optional(),
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@zyacreatives/shared",
3
- "version": "2.2.94",
3
+ "version": "2.2.95",
4
4
  "description": "",
5
5
  "main": "dist/index.js",
6
6
  "types": "dist/index.d.ts",
@@ -42,6 +42,12 @@ export const ProductDiscountEntitySchema = z.object({
42
42
  discountCode: z.string().optional(),
43
43
  });
44
44
 
45
+ export const ProductLinkSchema = z.object({
46
+ title: z.string().nullable(),
47
+ url: z.string(),
48
+ });
49
+ export type ProductLink = z.infer<typeof ProductLinkSchema>;
50
+
45
51
  export const BaseProductSchema = z.object({
46
52
  id: z.cuid2(),
47
53
  createdAt: z.date(),
@@ -58,7 +64,7 @@ export const BaseProductSchema = z.object({
58
64
  subcategory: z.string().nullable(),
59
65
  tags: z.array(z.string()).nullable(),
60
66
 
61
- productLinks: z.array(z.string()).nullable(),
67
+ productLinks: z.array(ProductLinkSchema).nullable(),
62
68
  pricingModel: z.enum(PRICING_MODELS),
63
69
  currency: z.string(),
64
70
  price: z.number().nullable(),
@@ -98,9 +104,7 @@ const ProductCoreInputSchema = z.object({
98
104
 
99
105
  productFiles: z.array(DeliveryFileInputSchema).default([]),
100
106
 
101
- productLinks: z
102
- .array(z.url().openapi({ example: "https://figma.com/file/..." }))
103
- .default([]),
107
+ productLinks: z.array(ProductLinkSchema).default([]),
104
108
 
105
109
  pricingModel: z.enum(PRICING_MODELS).default(PRICING_MODELS.FIXED),
106
110
  currency: z.string().default("USD").openapi({ example: "USD" }),