@zyacreatives/shared 2.2.7 → 2.2.9

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.
@@ -15,6 +15,11 @@ export declare const ProjectEntitySchema: z.ZodObject<{
15
15
  readonly ADMIN: "ADMIN";
16
16
  }>;
17
17
  clientId: z.ZodOptional<z.ZodString>;
18
+ status: z.ZodEnum<{
19
+ readonly ACTIVE: "ACTIVE";
20
+ readonly DRAFT: "DRAFT";
21
+ readonly ARCHIVED: "ARCHIVED";
22
+ }>;
18
23
  clientType: z.ZodOptional<z.ZodEnum<{
19
24
  readonly CREATIVE: "CREATIVE";
20
25
  readonly BRAND: "BRAND";
@@ -84,6 +89,11 @@ export declare const ProjectDetailsEntitySchema: z.ZodObject<{
84
89
  readonly ADMIN: "ADMIN";
85
90
  }>;
86
91
  clientId: z.ZodOptional<z.ZodString>;
92
+ status: z.ZodEnum<{
93
+ readonly ACTIVE: "ACTIVE";
94
+ readonly DRAFT: "DRAFT";
95
+ readonly ARCHIVED: "ARCHIVED";
96
+ }>;
87
97
  clientType: z.ZodOptional<z.ZodEnum<{
88
98
  readonly CREATIVE: "CREATIVE";
89
99
  readonly BRAND: "BRAND";
@@ -160,35 +170,11 @@ export declare const CreateProjectInputSchema: z.ZodObject<{
160
170
  title: z.ZodString;
161
171
  description: z.ZodOptional<z.ZodString>;
162
172
  overview: z.ZodOptional<z.ZodString>;
163
- url: z.ZodOptional<z.ZodString>;
164
- imagePlaceholderUrl: z.ZodURL;
165
- tags: z.ZodDefault<z.ZodArray<z.ZodString>>;
166
- startDate: z.ZodOptional<z.ZodCoercedDate<unknown>>;
167
173
  status: z.ZodDefault<z.ZodEnum<{
168
174
  readonly ACTIVE: "ACTIVE";
169
175
  readonly DRAFT: "DRAFT";
170
176
  readonly ARCHIVED: "ARCHIVED";
171
177
  }>>;
172
- endDate: z.ZodOptional<z.ZodCoercedDate<unknown>>;
173
- projectCreatorType: z.ZodDefault<z.ZodEnum<{
174
- readonly CREATIVE: "CREATIVE";
175
- readonly BRAND: "BRAND";
176
- readonly INVESTOR: "INVESTOR";
177
- readonly ADMIN: "ADMIN";
178
- }>>;
179
- clientId: z.ZodOptional<z.ZodString>;
180
- clientType: z.ZodDefault<z.ZodEnum<{
181
- readonly CREATIVE: "CREATIVE";
182
- readonly BRAND: "BRAND";
183
- readonly NONE: "NONE";
184
- }>>;
185
- clientName: z.ZodOptional<z.ZodString>;
186
- files: z.ZodArray<z.ZodObject<{
187
- key: z.ZodString;
188
- mimeType: z.ZodString;
189
- isPlaceholder: z.ZodDefault<z.ZodBoolean>;
190
- order: z.ZodDefault<z.ZodInt>;
191
- }, z.core.$strip>>;
192
178
  }, z.core.$strip>;
193
179
  export declare const UpdateProjectInputSchema: z.ZodObject<{
194
180
  id: z.ZodCUID2;
@@ -251,60 +237,7 @@ export declare const UpdateProjectInputSchema: z.ZodObject<{
251
237
  version: z.ZodInt;
252
238
  }, z.core.$strip>;
253
239
  export declare const CreateProjectOutputSchema: z.ZodObject<{
254
- id: z.ZodString;
255
- userId: z.ZodString;
256
- title: z.ZodString;
257
- description: z.ZodOptional<z.ZodString>;
258
- overview: z.ZodOptional<z.ZodString>;
259
- url: z.ZodOptional<z.ZodString>;
260
- imagePlaceholderUrl: z.ZodString;
261
- tags: z.ZodOptional<z.ZodArray<z.ZodString>>;
262
- projectCreatorType: z.ZodEnum<{
263
- readonly CREATIVE: "CREATIVE";
264
- readonly BRAND: "BRAND";
265
- readonly INVESTOR: "INVESTOR";
266
- readonly ADMIN: "ADMIN";
267
- }>;
268
- clientId: z.ZodOptional<z.ZodString>;
269
- clientType: z.ZodOptional<z.ZodEnum<{
270
- readonly CREATIVE: "CREATIVE";
271
- readonly BRAND: "BRAND";
272
- readonly NONE: "NONE";
273
- }>>;
274
- clientName: z.ZodOptional<z.ZodString>;
275
- isFeatured: z.ZodOptional<z.ZodBoolean>;
276
- problemBeingSolved: z.ZodOptional<z.ZodString>;
277
- whoItsFor: z.ZodOptional<z.ZodString>;
278
- ventureStage: z.ZodOptional<z.ZodEnum<{
279
- readonly IDEA: "Idea";
280
- readonly PRE_SEED: "Pre Seed";
281
- readonly MVP: "MVP";
282
- readonly SEED: "Seed";
283
- readonly SERIES_A: "Series A";
284
- readonly SERIES_B: "Series B";
285
- readonly SERIES_C: "Series C";
286
- readonly GROWTH: "Growth";
287
- readonly EXIT: "Exit";
288
- }>>;
289
- capitalLookingToRaise: z.ZodString;
290
- capitalLookingToRaiseCurrency: z.ZodOptional<z.ZodEnum<{
291
- readonly USD: "USD (United States Dollar)";
292
- readonly EUR: "EUR (Euro)";
293
- readonly GBP: "GBP (British Pound Sterling)";
294
- readonly NGN: "NGN (Nigerian Naira)";
295
- readonly CAD: "CAD (Canadian Dollar)";
296
- readonly AUD: "AUD (Australian Dollar)";
297
- readonly JPY: "JPY (Japanese Yen)";
298
- readonly CHF: "CHF (Swiss Franc)";
299
- readonly INR: "INR (Indian Rupee)";
300
- readonly ZAR: "ZAR (South African Rand)";
301
- }>>;
302
- currentTraction: z.ZodString;
303
- startDate: z.ZodOptional<z.ZodCoercedDate<unknown>>;
304
- endDate: z.ZodOptional<z.ZodCoercedDate<unknown>>;
305
- createdAt: z.ZodCoercedDate<unknown>;
306
- updatedAt: z.ZodCoercedDate<unknown>;
307
- version: z.ZodInt;
240
+ id: z.ZodCUID2;
308
241
  }, z.core.$strip>;
309
242
  export declare const UpdateProjectOutputSchema: z.ZodObject<{
310
243
  id: z.ZodString;
@@ -322,6 +255,11 @@ export declare const UpdateProjectOutputSchema: z.ZodObject<{
322
255
  readonly ADMIN: "ADMIN";
323
256
  }>;
324
257
  clientId: z.ZodOptional<z.ZodString>;
258
+ status: z.ZodEnum<{
259
+ readonly ACTIVE: "ACTIVE";
260
+ readonly DRAFT: "DRAFT";
261
+ readonly ARCHIVED: "ARCHIVED";
262
+ }>;
325
263
  clientType: z.ZodOptional<z.ZodEnum<{
326
264
  readonly CREATIVE: "CREATIVE";
327
265
  readonly BRAND: "BRAND";
@@ -378,6 +316,11 @@ export declare const DeleteProjectOutputSchema: z.ZodObject<{
378
316
  readonly ADMIN: "ADMIN";
379
317
  }>;
380
318
  clientId: z.ZodOptional<z.ZodString>;
319
+ status: z.ZodEnum<{
320
+ readonly ACTIVE: "ACTIVE";
321
+ readonly DRAFT: "DRAFT";
322
+ readonly ARCHIVED: "ARCHIVED";
323
+ }>;
381
324
  clientType: z.ZodOptional<z.ZodEnum<{
382
325
  readonly CREATIVE: "CREATIVE";
383
326
  readonly BRAND: "BRAND";
@@ -434,6 +377,11 @@ export declare const GetProjectOutputSchema: z.ZodObject<{
434
377
  readonly ADMIN: "ADMIN";
435
378
  }>;
436
379
  clientId: z.ZodOptional<z.ZodString>;
380
+ status: z.ZodEnum<{
381
+ readonly ACTIVE: "ACTIVE";
382
+ readonly DRAFT: "DRAFT";
383
+ readonly ARCHIVED: "ARCHIVED";
384
+ }>;
437
385
  clientType: z.ZodOptional<z.ZodEnum<{
438
386
  readonly CREATIVE: "CREATIVE";
439
387
  readonly BRAND: "BRAND";
@@ -54,6 +54,7 @@ exports.ProjectEntitySchema = zod_openapi_1.z
54
54
  description: "CUID2 of the client if this is a client project.",
55
55
  example: "ckl1y9xyz0000qv7a0h1efgh4",
56
56
  }),
57
+ status: zod_openapi_1.z.enum(constants_1.PROJECT_STATUS),
57
58
  clientType: zod_openapi_1.z.enum(constants_1.CLIENT_TYPES).optional().openapi({
58
59
  description: "Type of client for this project.",
59
60
  example: "BRAND",
@@ -147,40 +148,23 @@ exports.CreateProjectInputSchema = zod_openapi_1.z
147
148
  title: zod_openapi_1.z.string().min(1).max(100),
148
149
  description: zod_openapi_1.z.string().max(1000).optional(),
149
150
  overview: zod_openapi_1.z.string().optional(),
150
- url: zod_openapi_1.z.string().optional(),
151
- imagePlaceholderUrl: zod_openapi_1.z.url(),
152
- tags: zod_openapi_1.z.array(zod_openapi_1.z.string()).default([]),
153
- startDate: zod_openapi_1.z.coerce.date().optional(),
154
- status: zod_openapi_1.z.enum(constants_1.PROJECT_STATUS).default(constants_1.PROJECT_STATUS.ACTIVE),
155
- endDate: zod_openapi_1.z.coerce.date().optional(),
156
- projectCreatorType: zod_openapi_1.z.enum(constants_1.ROLES).default(constants_1.ROLES.CREATIVE),
157
- clientId: zod_openapi_1.z.string().optional(),
158
- clientType: zod_openapi_1.z.enum(constants_1.CLIENT_TYPES).default(constants_1.CLIENT_TYPES.NONE),
159
- clientName: zod_openapi_1.z.string().optional(),
160
- files: zod_openapi_1.z.array(file_1.CreateFileInputSchema.extend({
161
- isPlaceholder: zod_openapi_1.z.boolean().default(false),
162
- order: zod_openapi_1.z.int().default(1),
163
- })),
164
- })
165
- .superRefine(({ startDate, endDate }, ctx) => {
166
- const today = new Date();
167
- today.setHours(0, 0, 0, 0);
168
- if (!startDate)
169
- return;
170
- if (startDate > today)
171
- ctx.addIssue({
172
- path: ["startDate"],
173
- code: "custom",
174
- message: "Start date cannot be in the future",
175
- });
176
- if (endDate) {
177
- if (startDate > endDate)
178
- ctx.addIssue({
179
- path: ["startDate"],
180
- code: "custom",
181
- message: "Start date cannot be after end date",
182
- });
183
- }
151
+ status: zod_openapi_1.z.enum(constants_1.PROJECT_STATUS).default(constants_1.PROJECT_STATUS.DRAFT),
152
+ // url: z.string().optional(),
153
+ // imagePlaceholderUrl: z.url(),
154
+ // tags: z.array(z.string()).default([]),
155
+ // startDate: z.coerce.date().optional(),
156
+ // status: z.enum(PROJECT_STATUS).default(PROJECT_STATUS.ACTIVE),
157
+ // endDate: z.coerce.date().optional(),
158
+ // projectCreatorType: z.enum(ROLES).default(ROLES.CREATIVE),
159
+ // clientId: z.string().optional(),
160
+ // clientType: z.enum(CLIENT_TYPES).default(CLIENT_TYPES.NONE),
161
+ // clientName: z.string().optional(),
162
+ // files: z.array(
163
+ // CreateFileInputSchema.extend({
164
+ // isPlaceholder: z.boolean().default(false),
165
+ // order: z.int().default(1),
166
+ // }),
167
+ // ),
184
168
  })
185
169
  .openapi({ title: "Create Project" });
186
170
  exports.UpdateProjectInputSchema = zod_openapi_1.z
@@ -209,9 +193,31 @@ exports.UpdateProjectInputSchema = zod_openapi_1.z
209
193
  createdAt: zod_openapi_1.z.date().optional(),
210
194
  updatedAt: zod_openapi_1.z.date().optional(),
211
195
  version: zod_openapi_1.z.int(),
196
+ })
197
+ .superRefine(({ startDate, endDate }, ctx) => {
198
+ const today = new Date();
199
+ today.setHours(0, 0, 0, 0);
200
+ if (!startDate)
201
+ return;
202
+ if (startDate > today)
203
+ ctx.addIssue({
204
+ path: ["startDate"],
205
+ code: "custom",
206
+ message: "Start date cannot be in the future",
207
+ });
208
+ if (endDate) {
209
+ if (startDate > endDate)
210
+ ctx.addIssue({
211
+ path: ["startDate"],
212
+ code: "custom",
213
+ message: "Start date cannot be after end date",
214
+ });
215
+ }
212
216
  })
213
217
  .openapi({ title: "Update Project" });
214
- exports.CreateProjectOutputSchema = exports.ProjectEntitySchema;
218
+ exports.CreateProjectOutputSchema = zod_openapi_1.z.object({
219
+ id: zod_openapi_1.z.cuid2(),
220
+ });
215
221
  exports.UpdateProjectOutputSchema = exports.ProjectEntitySchema;
216
222
  exports.DeleteProjectOutputSchema = exports.ProjectEntitySchema;
217
223
  exports.GetProjectOutputSchema = exports.ProjectDetailsEntitySchema.extend({
@@ -226,6 +226,11 @@ export declare const UserWithProjectsEntitySchema: z.ZodObject<{
226
226
  readonly ADMIN: "ADMIN";
227
227
  }>;
228
228
  clientId: z.ZodOptional<z.ZodString>;
229
+ status: z.ZodEnum<{
230
+ readonly ACTIVE: "ACTIVE";
231
+ readonly DRAFT: "DRAFT";
232
+ readonly ARCHIVED: "ARCHIVED";
233
+ }>;
229
234
  clientType: z.ZodOptional<z.ZodEnum<{
230
235
  readonly CREATIVE: "CREATIVE";
231
236
  readonly BRAND: "BRAND";
@@ -737,6 +742,11 @@ export declare const GetAuthenticatedUserWithProjectsOutputSchema: z.ZodObject<{
737
742
  readonly ADMIN: "ADMIN";
738
743
  }>;
739
744
  clientId: z.ZodOptional<z.ZodString>;
745
+ status: z.ZodEnum<{
746
+ readonly ACTIVE: "ACTIVE";
747
+ readonly DRAFT: "DRAFT";
748
+ readonly ARCHIVED: "ARCHIVED";
749
+ }>;
740
750
  clientType: z.ZodOptional<z.ZodEnum<{
741
751
  readonly CREATIVE: "CREATIVE";
742
752
  readonly BRAND: "BRAND";
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@zyacreatives/shared",
3
- "version": "2.2.7",
3
+ "version": "2.2.9",
4
4
  "description": "",
5
5
  "main": "dist/index.js",
6
6
  "types": "dist/index.d.ts",
@@ -59,6 +59,7 @@ export const ProjectEntitySchema = z
59
59
  description: "CUID2 of the client if this is a client project.",
60
60
  example: "ckl1y9xyz0000qv7a0h1efgh4",
61
61
  }),
62
+ status: z.enum(PROJECT_STATUS),
62
63
  clientType: z.enum(CLIENT_TYPES).optional().openapi({
63
64
  description: "Type of client for this project.",
64
65
  example: "BRAND",
@@ -159,42 +160,25 @@ export const CreateProjectInputSchema = z
159
160
  title: z.string().min(1).max(100),
160
161
  description: z.string().max(1000).optional(),
161
162
  overview: z.string().optional(),
162
- url: z.string().optional(),
163
- imagePlaceholderUrl: z.url(),
164
- tags: z.array(z.string()).default([]),
165
- startDate: z.coerce.date().optional(),
166
- status: z.enum(PROJECT_STATUS).default(PROJECT_STATUS.ACTIVE),
167
- endDate: z.coerce.date().optional(),
168
- projectCreatorType: z.enum(ROLES).default(ROLES.CREATIVE),
169
- clientId: z.string().optional(),
170
- clientType: z.enum(CLIENT_TYPES).default(CLIENT_TYPES.NONE),
171
- clientName: z.string().optional(),
172
- files: z.array(
173
- CreateFileInputSchema.extend({
174
- isPlaceholder: z.boolean().default(false),
175
- order: z.int().default(1),
176
- }),
177
- ),
178
- })
179
- .superRefine(({ startDate, endDate }, ctx) => {
180
- const today = new Date();
181
- today.setHours(0, 0, 0, 0);
182
- if (!startDate) return;
183
- if (startDate > today)
184
- ctx.addIssue({
185
- path: ["startDate"],
186
- code: "custom",
187
- message: "Start date cannot be in the future",
188
- });
189
- if (endDate) {
190
- if (startDate > endDate)
191
- ctx.addIssue({
192
- path: ["startDate"],
193
- code: "custom",
194
- message: "Start date cannot be after end date",
195
- });
196
- }
163
+ status: z.enum(PROJECT_STATUS).default(PROJECT_STATUS.DRAFT),
164
+ // url: z.string().optional(),
165
+ // imagePlaceholderUrl: z.url(),
166
+ // tags: z.array(z.string()).default([]),
167
+ // startDate: z.coerce.date().optional(),
168
+ // status: z.enum(PROJECT_STATUS).default(PROJECT_STATUS.ACTIVE),
169
+ // endDate: z.coerce.date().optional(),
170
+ // projectCreatorType: z.enum(ROLES).default(ROLES.CREATIVE),
171
+ // clientId: z.string().optional(),
172
+ // clientType: z.enum(CLIENT_TYPES).default(CLIENT_TYPES.NONE),
173
+ // clientName: z.string().optional(),
174
+ // files: z.array(
175
+ // CreateFileInputSchema.extend({
176
+ // isPlaceholder: z.boolean().default(false),
177
+ // order: z.int().default(1),
178
+ // }),
179
+ // ),
197
180
  })
181
+
198
182
  .openapi({ title: "Create Project" });
199
183
 
200
184
  export const UpdateProjectInputSchema = z
@@ -224,9 +208,30 @@ export const UpdateProjectInputSchema = z
224
208
  updatedAt: z.date().optional(),
225
209
  version: z.int(),
226
210
  })
211
+ .superRefine(({ startDate, endDate }, ctx) => {
212
+ const today = new Date();
213
+ today.setHours(0, 0, 0, 0);
214
+ if (!startDate) return;
215
+ if (startDate > today)
216
+ ctx.addIssue({
217
+ path: ["startDate"],
218
+ code: "custom",
219
+ message: "Start date cannot be in the future",
220
+ });
221
+ if (endDate) {
222
+ if (startDate > endDate)
223
+ ctx.addIssue({
224
+ path: ["startDate"],
225
+ code: "custom",
226
+ message: "Start date cannot be after end date",
227
+ });
228
+ }
229
+ })
227
230
  .openapi({ title: "Update Project" });
228
231
 
229
- export const CreateProjectOutputSchema = ProjectEntitySchema;
232
+ export const CreateProjectOutputSchema = z.object({
233
+ id: z.cuid2(),
234
+ });
230
235
  export const UpdateProjectOutputSchema = ProjectEntitySchema;
231
236
  export const DeleteProjectOutputSchema = ProjectEntitySchema;
232
237