@zyacreatives/shared 2.0.71 → 2.0.73

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.
@@ -39,9 +39,8 @@ export declare const CreativeEntitySchema: z.ZodObject<{
39
39
  description: z.ZodOptional<z.ZodString>;
40
40
  }, z.core.$strip>>>;
41
41
  links: z.ZodOptional<z.ZodArray<z.ZodObject<{
42
- name: z.ZodString;
43
- url: z.ZodURL;
44
- type: z.ZodDefault<z.ZodEnum<{
42
+ url: z.ZodOptional<z.ZodUnion<readonly [z.ZodURL, z.ZodLiteral<"">]>>;
43
+ type: z.ZodOptional<z.ZodEnum<{
45
44
  readonly INSTAGRAM: "Instagram";
46
45
  readonly LINKEDIN: "LinkedIn";
47
46
  readonly TWITTER: "Twitter";
@@ -104,9 +103,8 @@ export declare const UpdateCreativeProfileInputSchema: z.ZodObject<{
104
103
  description: z.ZodOptional<z.ZodString>;
105
104
  }, z.core.$strip>>>;
106
105
  links: z.ZodOptional<z.ZodArray<z.ZodObject<{
107
- name: z.ZodString;
108
- url: z.ZodURL;
109
- type: z.ZodDefault<z.ZodEnum<{
106
+ url: z.ZodOptional<z.ZodUnion<readonly [z.ZodURL, z.ZodLiteral<"">]>>;
107
+ type: z.ZodOptional<z.ZodEnum<{
110
108
  readonly INSTAGRAM: "Instagram";
111
109
  readonly LINKEDIN: "LinkedIn";
112
110
  readonly TWITTER: "Twitter";
@@ -157,9 +155,8 @@ export declare const CreateCreativeOutputSchema: z.ZodObject<{
157
155
  description: z.ZodOptional<z.ZodString>;
158
156
  }, z.core.$strip>>>;
159
157
  links: z.ZodOptional<z.ZodArray<z.ZodObject<{
160
- name: z.ZodString;
161
- url: z.ZodURL;
162
- type: z.ZodDefault<z.ZodEnum<{
158
+ url: z.ZodOptional<z.ZodUnion<readonly [z.ZodURL, z.ZodLiteral<"">]>>;
159
+ type: z.ZodOptional<z.ZodEnum<{
163
160
  readonly INSTAGRAM: "Instagram";
164
161
  readonly LINKEDIN: "LinkedIn";
165
162
  readonly TWITTER: "Twitter";
@@ -199,9 +196,8 @@ export declare const GetCreativeOutputSchema: z.ZodObject<{
199
196
  description: z.ZodOptional<z.ZodString>;
200
197
  }, z.core.$strip>>>;
201
198
  links: z.ZodOptional<z.ZodArray<z.ZodObject<{
202
- name: z.ZodString;
203
- url: z.ZodURL;
204
- type: z.ZodDefault<z.ZodEnum<{
199
+ url: z.ZodOptional<z.ZodUnion<readonly [z.ZodURL, z.ZodLiteral<"">]>>;
200
+ type: z.ZodOptional<z.ZodEnum<{
205
201
  readonly INSTAGRAM: "Instagram";
206
202
  readonly LINKEDIN: "LinkedIn";
207
203
  readonly TWITTER: "Twitter";
@@ -241,9 +237,8 @@ export declare const UpdateCreativeOutputSchema: z.ZodObject<{
241
237
  description: z.ZodOptional<z.ZodString>;
242
238
  }, z.core.$strip>>>;
243
239
  links: z.ZodOptional<z.ZodArray<z.ZodObject<{
244
- name: z.ZodString;
245
- url: z.ZodURL;
246
- type: z.ZodDefault<z.ZodEnum<{
240
+ url: z.ZodOptional<z.ZodUnion<readonly [z.ZodURL, z.ZodLiteral<"">]>>;
241
+ type: z.ZodOptional<z.ZodEnum<{
247
242
  readonly INSTAGRAM: "Instagram";
248
243
  readonly LINKEDIN: "LinkedIn";
249
244
  readonly TWITTER: "Twitter";
@@ -65,9 +65,13 @@ exports.CreativeEntitySchema = zod_openapi_1.z
65
65
  .optional(),
66
66
  links: zod_openapi_1.z
67
67
  .object({
68
- name: zod_openapi_1.z.string(),
69
- url: zod_openapi_1.z.url(),
70
- type: zod_openapi_1.z.enum(constants_1.LINK_TYPES).default(constants_1.LINK_TYPES.GENERIC_WEBSITE),
68
+ url: zod_openapi_1.z
69
+ .union([
70
+ zod_openapi_1.z.url({ message: "Please enter a valid URL" }),
71
+ zod_openapi_1.z.literal(""),
72
+ ])
73
+ .optional(),
74
+ type: zod_openapi_1.z.enum(constants_1.LINK_TYPES).optional(),
71
75
  })
72
76
  .array()
73
77
  .optional(),
@@ -191,9 +195,13 @@ exports.UpdateCreativeProfileInputSchema = zod_openapi_1.z
191
195
  .optional(),
192
196
  links: zod_openapi_1.z
193
197
  .object({
194
- name: zod_openapi_1.z.string(),
195
- url: zod_openapi_1.z.url(),
196
- type: zod_openapi_1.z.enum(constants_1.LINK_TYPES).default(constants_1.LINK_TYPES.GENERIC_WEBSITE),
198
+ url: zod_openapi_1.z
199
+ .union([
200
+ zod_openapi_1.z.url({ message: "Please enter a valid URL" }),
201
+ zod_openapi_1.z.literal(""),
202
+ ])
203
+ .optional(),
204
+ type: zod_openapi_1.z.enum(constants_1.LINK_TYPES).optional(),
197
205
  })
198
206
  .array()
199
207
  .optional(),
@@ -91,10 +91,10 @@ export declare const CreateProjectInputSchema: z.ZodObject<{
91
91
  title: z.ZodString;
92
92
  description: z.ZodOptional<z.ZodString>;
93
93
  overview: z.ZodOptional<z.ZodString>;
94
- url: z.ZodString;
94
+ url: z.ZodOptional<z.ZodString>;
95
95
  imagePlaceholderUrl: z.ZodURL;
96
96
  tags: z.ZodDefault<z.ZodArray<z.ZodString>>;
97
- startDate: z.ZodCoercedDate<unknown>;
97
+ startDate: z.ZodOptional<z.ZodCoercedDate<unknown>>;
98
98
  endDate: z.ZodOptional<z.ZodCoercedDate<unknown>>;
99
99
  projectCreatorType: z.ZodDefault<z.ZodEnum<{
100
100
  readonly CREATIVE: "CREATIVE";
@@ -140,10 +140,10 @@ exports.CreateProjectInputSchema = zod_openapi_1.z
140
140
  title: zod_openapi_1.z.string().min(1).max(100),
141
141
  description: zod_openapi_1.z.string().max(1000).optional(),
142
142
  overview: zod_openapi_1.z.string().optional(),
143
- url: zod_openapi_1.z.string(),
143
+ url: zod_openapi_1.z.string().optional(),
144
144
  imagePlaceholderUrl: zod_openapi_1.z.url(),
145
145
  tags: zod_openapi_1.z.array(zod_openapi_1.z.string()).default([]),
146
- startDate: zod_openapi_1.z.coerce.date(),
146
+ startDate: zod_openapi_1.z.coerce.date().optional(),
147
147
  endDate: zod_openapi_1.z.coerce.date().optional(),
148
148
  projectCreatorType: zod_openapi_1.z.enum(constants_1.ROLES).default(constants_1.ROLES.CREATIVE),
149
149
  clientId: zod_openapi_1.z.string().optional(),
@@ -157,6 +157,8 @@ exports.CreateProjectInputSchema = zod_openapi_1.z
157
157
  .superRefine(({ startDate, endDate }, ctx) => {
158
158
  const today = new Date();
159
159
  today.setHours(0, 0, 0, 0);
160
+ if (!startDate)
161
+ return;
160
162
  if (startDate > today)
161
163
  ctx.addIssue({
162
164
  path: ["startDate"],
@@ -145,9 +145,8 @@ export declare const UserProfileEntitySchema: z.ZodObject<{
145
145
  description: z.ZodOptional<z.ZodString>;
146
146
  }, z.core.$strip>>>;
147
147
  links: z.ZodOptional<z.ZodArray<z.ZodObject<{
148
- name: z.ZodString;
149
- url: z.ZodURL;
150
- type: z.ZodDefault<z.ZodEnum<{
148
+ url: z.ZodOptional<z.ZodUnion<readonly [z.ZodURL, z.ZodLiteral<"">]>>;
149
+ type: z.ZodOptional<z.ZodEnum<{
151
150
  readonly INSTAGRAM: "Instagram";
152
151
  readonly LINKEDIN: "LinkedIn";
153
152
  readonly TWITTER: "Twitter";
@@ -532,9 +531,8 @@ export declare const GetAuthenticatedUserProfileOutputSchema: z.ZodObject<{
532
531
  description: z.ZodOptional<z.ZodString>;
533
532
  }, z.core.$strip>>>;
534
533
  links: z.ZodOptional<z.ZodArray<z.ZodObject<{
535
- name: z.ZodString;
536
- url: z.ZodURL;
537
- type: z.ZodDefault<z.ZodEnum<{
534
+ url: z.ZodOptional<z.ZodUnion<readonly [z.ZodURL, z.ZodLiteral<"">]>>;
535
+ type: z.ZodOptional<z.ZodEnum<{
538
536
  readonly INSTAGRAM: "Instagram";
539
537
  readonly LINKEDIN: "LinkedIn";
540
538
  readonly TWITTER: "Twitter";
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@zyacreatives/shared",
3
- "version": "2.0.71",
3
+ "version": "2.0.73",
4
4
  "description": "",
5
5
  "main": "dist/index.js",
6
6
  "types": "dist/index.d.ts",
@@ -24,7 +24,6 @@ export const MinimalCreativeEntitySchema = z.object({
24
24
  .array(z.string())
25
25
  .optional()
26
26
  .openapi({ example: ["branding", "typography", "UX"] }),
27
-
28
27
  disciplines: z
29
28
  .array(z.string())
30
29
  .optional()
@@ -77,9 +76,13 @@ export const CreativeEntitySchema = z
77
76
  .optional(),
78
77
  links: z
79
78
  .object({
80
- name: z.string(),
81
- url: z.url(),
82
- type: z.enum(LINK_TYPES).default(LINK_TYPES.GENERIC_WEBSITE),
79
+ url: z
80
+ .union([
81
+ z.url({ message: "Please enter a valid URL" }),
82
+ z.literal(""),
83
+ ])
84
+ .optional(),
85
+ type: z.enum(LINK_TYPES).optional(),
83
86
  })
84
87
  .array()
85
88
  .optional(),
@@ -224,9 +227,13 @@ export const UpdateCreativeProfileInputSchema = z
224
227
  .optional(),
225
228
  links: z
226
229
  .object({
227
- name: z.string(),
228
- url: z.url(),
229
- type: z.enum(LINK_TYPES).default(LINK_TYPES.GENERIC_WEBSITE),
230
+ url: z
231
+ .union([
232
+ z.url({ message: "Please enter a valid URL" }),
233
+ z.literal(""),
234
+ ])
235
+ .optional(),
236
+ type: z.enum(LINK_TYPES).optional(),
230
237
  })
231
238
  .array()
232
239
  .optional(),
@@ -146,10 +146,10 @@ export const CreateProjectInputSchema = z
146
146
  title: z.string().min(1).max(100),
147
147
  description: z.string().max(1000).optional(),
148
148
  overview: z.string().optional(),
149
- url: z.string(),
149
+ url: z.string().optional(),
150
150
  imagePlaceholderUrl: z.url(),
151
151
  tags: z.array(z.string()).default([]),
152
- startDate: z.coerce.date(),
152
+ startDate: z.coerce.date().optional(),
153
153
  endDate: z.coerce.date().optional(),
154
154
  projectCreatorType: z.enum(ROLES).default(ROLES.CREATIVE),
155
155
  clientId: z.string().optional(),
@@ -165,6 +165,7 @@ export const CreateProjectInputSchema = z
165
165
  .superRefine(({ startDate, endDate }, ctx) => {
166
166
  const today = new Date();
167
167
  today.setHours(0, 0, 0, 0);
168
+ if (!startDate) return;
168
169
  if (startDate > today)
169
170
  ctx.addIssue({
170
171
  path: ["startDate"],