@zyacreatives/shared 2.5.38 → 2.5.39

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.
@@ -184,8 +184,8 @@ export declare const UpdateProjectInputSchema: z.ZodObject<{
184
184
  title: z.ZodOptional<z.ZodString>;
185
185
  description: z.ZodOptional<z.ZodString>;
186
186
  overview: z.ZodOptional<z.ZodString>;
187
- url: z.ZodOptional<z.ZodPipe<z.ZodPipe<z.ZodString, z.ZodTransform<string, string>>, z.ZodUnion<[z.ZodString, z.ZodLiteral<"">]>>>;
188
- imagePlaceholderUrl: z.ZodOptional<z.ZodURL>;
187
+ url: z.ZodOptional<z.ZodPipe<z.ZodPipe<z.ZodString, z.ZodTransform<string, string>>, z.ZodUnion<[z.ZodURL, z.ZodLiteral<"">]>>>;
188
+ imagePlaceholderUrl: z.ZodUnion<[z.ZodOptional<z.ZodURL>, z.ZodLiteral<"">]>;
189
189
  tags: z.ZodOptional<z.ZodArray<z.ZodString>>;
190
190
  projectCreatorType: z.ZodOptional<z.ZodEnum<{
191
191
  readonly CREATIVE: "CREATIVE";
@@ -193,7 +193,7 @@ export declare const UpdateProjectInputSchema: z.ZodObject<{
193
193
  readonly INVESTOR: "INVESTOR";
194
194
  readonly ADMIN: "ADMIN";
195
195
  }>>;
196
- clientId: z.ZodPipe<z.ZodPipe<z.ZodString, z.ZodTransform<string | undefined, string>>, z.ZodOptional<z.ZodString>>;
196
+ clientId: z.ZodPipe<z.ZodPipe<z.ZodOptional<z.ZodString>, z.ZodTransform<string | undefined, string | undefined>>, z.ZodOptional<z.ZodCUID2>>;
197
197
  clientType: z.ZodOptional<z.ZodEnum<{
198
198
  readonly CREATIVE: "CREATIVE";
199
199
  readonly BRAND: "BRAND";
@@ -236,7 +236,7 @@ export declare const UpdateProjectInputSchema: z.ZodObject<{
236
236
  isOpenToInvestment: z.ZodDefault<z.ZodBoolean>;
237
237
  startDate: z.ZodOptional<z.ZodCoercedDate<unknown>>;
238
238
  endDate: z.ZodOptional<z.ZodCoercedDate<unknown>>;
239
- version: z.ZodNumber;
239
+ version: z.ZodDefault<z.ZodNumber>;
240
240
  }, z.core.$strip>;
241
241
  export type UpdateProjectInput = z.infer<typeof UpdateProjectInputSchema>;
242
242
  export declare const CommentOnProjectInputSchema: z.ZodObject<{
@@ -86,15 +86,16 @@ exports.UpdateProjectInputSchema = zod_openapi_1.z
86
86
  return val;
87
87
  return `https://${val}`;
88
88
  })
89
- .pipe(zod_openapi_1.z.string().url("Check your link.").or(zod_openapi_1.z.literal("")))
89
+ .pipe(zod_openapi_1.z.url("Check your link.").or(zod_openapi_1.z.literal("")))
90
90
  .optional(),
91
- imagePlaceholderUrl: zod_openapi_1.z.url().optional(),
91
+ imagePlaceholderUrl: zod_openapi_1.z.url().optional().or(zod_openapi_1.z.literal("")),
92
92
  tags: zod_openapi_1.z.array(zod_openapi_1.z.string()).optional(),
93
93
  projectCreatorType: zod_openapi_1.z.enum(constants_1.ROLES).optional(),
94
94
  clientId: zod_openapi_1.z
95
95
  .string()
96
- .transform((val) => (val === "" ? undefined : val))
97
- .pipe(zod_openapi_1.z.string().cuid2().optional()),
96
+ .optional()
97
+ .transform((val) => (val === "" || val === undefined ? undefined : val))
98
+ .pipe(zod_openapi_1.z.cuid2().optional()),
98
99
  clientType: zod_openapi_1.z.enum(constants_1.CLIENT_TYPES).optional(),
99
100
  clientName: zod_openapi_1.z.string().optional(),
100
101
  isFeatured: zod_openapi_1.z.boolean().optional(),
@@ -120,7 +121,7 @@ exports.UpdateProjectInputSchema = zod_openapi_1.z
120
121
  isOpenToInvestment: zod_openapi_1.z.boolean().default(false),
121
122
  startDate: zod_openapi_1.z.coerce.date().optional(),
122
123
  endDate: zod_openapi_1.z.coerce.date().optional(),
123
- version: zod_openapi_1.z.number().int(),
124
+ version: zod_openapi_1.z.number().int().default(1),
124
125
  })
125
126
  .superRefine(({ startDate, endDate }, ctx) => {
126
127
  const today = new Date();
@@ -136,7 +137,7 @@ exports.UpdateProjectInputSchema = zod_openapi_1.z
136
137
  ctx.addIssue({
137
138
  path: ["endDate"],
138
139
  code: "custom",
139
- message: "End date must follow the start date.",
140
+ message: "End date must be after the start date.",
140
141
  });
141
142
  }
142
143
  })
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@zyacreatives/shared",
3
- "version": "2.5.38",
3
+ "version": "2.5.39",
4
4
  "description": "",
5
5
  "main": "dist/index.js",
6
6
  "types": "dist/index.d.ts",
@@ -104,15 +104,16 @@ export const UpdateProjectInputSchema = z
104
104
  if (val.startsWith("http://") || val.startsWith("https://")) return val;
105
105
  return `https://${val}`;
106
106
  })
107
- .pipe(z.string().url("Check your link.").or(z.literal("")))
107
+ .pipe(z.url("Check your link.").or(z.literal("")))
108
108
  .optional(),
109
- imagePlaceholderUrl: z.url().optional(),
109
+ imagePlaceholderUrl: z.url().optional().or(z.literal("")),
110
110
  tags: z.array(z.string()).optional(),
111
111
  projectCreatorType: z.enum(ROLES).optional(),
112
112
  clientId: z
113
113
  .string()
114
- .transform((val) => (val === "" ? undefined : val))
115
- .pipe(z.string().cuid2().optional()),
114
+ .optional()
115
+ .transform((val) => (val === "" || val === undefined ? undefined : val))
116
+ .pipe(z.cuid2().optional()),
116
117
  clientType: z.enum(CLIENT_TYPES).optional(),
117
118
  clientName: z.string().optional(),
118
119
  isFeatured: z.boolean().optional(),
@@ -138,7 +139,7 @@ export const UpdateProjectInputSchema = z
138
139
  isOpenToInvestment: z.boolean().default(false),
139
140
  startDate: z.coerce.date().optional(),
140
141
  endDate: z.coerce.date().optional(),
141
- version: z.number().int(),
142
+ version: z.number().int().default(1),
142
143
  })
143
144
  .superRefine(({ startDate, endDate }, ctx) => {
144
145
  const today = new Date();
@@ -154,12 +155,12 @@ export const UpdateProjectInputSchema = z
154
155
  ctx.addIssue({
155
156
  path: ["endDate"],
156
157
  code: "custom",
157
- message: "End date must follow the start date.",
158
+ message: "End date must be after the start date.",
158
159
  });
159
160
  }
160
161
  })
161
162
  .openapi("UpdateProjectInput");
162
-
163
+
163
164
  export type UpdateProjectInput = z.infer<typeof UpdateProjectInputSchema>;
164
165
 
165
166
  export const CommentOnProjectInputSchema = CommentEntitySchema;