@zyacreatives/shared 2.2.8 → 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.
@@ -170,35 +170,11 @@ export declare const CreateProjectInputSchema: z.ZodObject<{
170
170
  title: z.ZodString;
171
171
  description: z.ZodOptional<z.ZodString>;
172
172
  overview: z.ZodOptional<z.ZodString>;
173
- url: z.ZodOptional<z.ZodString>;
174
- imagePlaceholderUrl: z.ZodURL;
175
- tags: z.ZodDefault<z.ZodArray<z.ZodString>>;
176
- startDate: z.ZodOptional<z.ZodCoercedDate<unknown>>;
177
173
  status: z.ZodDefault<z.ZodEnum<{
178
174
  readonly ACTIVE: "ACTIVE";
179
175
  readonly DRAFT: "DRAFT";
180
176
  readonly ARCHIVED: "ARCHIVED";
181
177
  }>>;
182
- endDate: z.ZodOptional<z.ZodCoercedDate<unknown>>;
183
- projectCreatorType: z.ZodDefault<z.ZodEnum<{
184
- readonly CREATIVE: "CREATIVE";
185
- readonly BRAND: "BRAND";
186
- readonly INVESTOR: "INVESTOR";
187
- readonly ADMIN: "ADMIN";
188
- }>>;
189
- clientId: z.ZodOptional<z.ZodString>;
190
- clientType: z.ZodDefault<z.ZodEnum<{
191
- readonly CREATIVE: "CREATIVE";
192
- readonly BRAND: "BRAND";
193
- readonly NONE: "NONE";
194
- }>>;
195
- clientName: z.ZodOptional<z.ZodString>;
196
- files: z.ZodArray<z.ZodObject<{
197
- key: z.ZodString;
198
- mimeType: z.ZodString;
199
- isPlaceholder: z.ZodDefault<z.ZodBoolean>;
200
- order: z.ZodDefault<z.ZodInt>;
201
- }, z.core.$strip>>;
202
178
  }, z.core.$strip>;
203
179
  export declare const UpdateProjectInputSchema: z.ZodObject<{
204
180
  id: z.ZodCUID2;
@@ -261,65 +237,7 @@ export declare const UpdateProjectInputSchema: z.ZodObject<{
261
237
  version: z.ZodInt;
262
238
  }, z.core.$strip>;
263
239
  export declare const CreateProjectOutputSchema: z.ZodObject<{
264
- id: z.ZodString;
265
- userId: z.ZodString;
266
- title: z.ZodString;
267
- description: z.ZodOptional<z.ZodString>;
268
- overview: z.ZodOptional<z.ZodString>;
269
- url: z.ZodOptional<z.ZodString>;
270
- imagePlaceholderUrl: z.ZodString;
271
- tags: z.ZodOptional<z.ZodArray<z.ZodString>>;
272
- projectCreatorType: z.ZodEnum<{
273
- readonly CREATIVE: "CREATIVE";
274
- readonly BRAND: "BRAND";
275
- readonly INVESTOR: "INVESTOR";
276
- readonly ADMIN: "ADMIN";
277
- }>;
278
- clientId: z.ZodOptional<z.ZodString>;
279
- status: z.ZodEnum<{
280
- readonly ACTIVE: "ACTIVE";
281
- readonly DRAFT: "DRAFT";
282
- readonly ARCHIVED: "ARCHIVED";
283
- }>;
284
- clientType: z.ZodOptional<z.ZodEnum<{
285
- readonly CREATIVE: "CREATIVE";
286
- readonly BRAND: "BRAND";
287
- readonly NONE: "NONE";
288
- }>>;
289
- clientName: z.ZodOptional<z.ZodString>;
290
- isFeatured: z.ZodOptional<z.ZodBoolean>;
291
- problemBeingSolved: z.ZodOptional<z.ZodString>;
292
- whoItsFor: z.ZodOptional<z.ZodString>;
293
- ventureStage: z.ZodOptional<z.ZodEnum<{
294
- readonly IDEA: "Idea";
295
- readonly PRE_SEED: "Pre Seed";
296
- readonly MVP: "MVP";
297
- readonly SEED: "Seed";
298
- readonly SERIES_A: "Series A";
299
- readonly SERIES_B: "Series B";
300
- readonly SERIES_C: "Series C";
301
- readonly GROWTH: "Growth";
302
- readonly EXIT: "Exit";
303
- }>>;
304
- capitalLookingToRaise: z.ZodString;
305
- capitalLookingToRaiseCurrency: z.ZodOptional<z.ZodEnum<{
306
- readonly USD: "USD (United States Dollar)";
307
- readonly EUR: "EUR (Euro)";
308
- readonly GBP: "GBP (British Pound Sterling)";
309
- readonly NGN: "NGN (Nigerian Naira)";
310
- readonly CAD: "CAD (Canadian Dollar)";
311
- readonly AUD: "AUD (Australian Dollar)";
312
- readonly JPY: "JPY (Japanese Yen)";
313
- readonly CHF: "CHF (Swiss Franc)";
314
- readonly INR: "INR (Indian Rupee)";
315
- readonly ZAR: "ZAR (South African Rand)";
316
- }>>;
317
- currentTraction: z.ZodString;
318
- startDate: z.ZodOptional<z.ZodCoercedDate<unknown>>;
319
- endDate: z.ZodOptional<z.ZodCoercedDate<unknown>>;
320
- createdAt: z.ZodCoercedDate<unknown>;
321
- updatedAt: z.ZodCoercedDate<unknown>;
322
- version: z.ZodInt;
240
+ id: z.ZodCUID2;
323
241
  }, z.core.$strip>;
324
242
  export declare const UpdateProjectOutputSchema: z.ZodObject<{
325
243
  id: z.ZodString;
@@ -148,40 +148,23 @@ exports.CreateProjectInputSchema = zod_openapi_1.z
148
148
  title: zod_openapi_1.z.string().min(1).max(100),
149
149
  description: zod_openapi_1.z.string().max(1000).optional(),
150
150
  overview: zod_openapi_1.z.string().optional(),
151
- url: zod_openapi_1.z.string().optional(),
152
- imagePlaceholderUrl: zod_openapi_1.z.url(),
153
- tags: zod_openapi_1.z.array(zod_openapi_1.z.string()).default([]),
154
- startDate: zod_openapi_1.z.coerce.date().optional(),
155
- status: zod_openapi_1.z.enum(constants_1.PROJECT_STATUS).default(constants_1.PROJECT_STATUS.ACTIVE),
156
- endDate: zod_openapi_1.z.coerce.date().optional(),
157
- projectCreatorType: zod_openapi_1.z.enum(constants_1.ROLES).default(constants_1.ROLES.CREATIVE),
158
- clientId: zod_openapi_1.z.string().optional(),
159
- clientType: zod_openapi_1.z.enum(constants_1.CLIENT_TYPES).default(constants_1.CLIENT_TYPES.NONE),
160
- clientName: zod_openapi_1.z.string().optional(),
161
- files: zod_openapi_1.z.array(file_1.CreateFileInputSchema.extend({
162
- isPlaceholder: zod_openapi_1.z.boolean().default(false),
163
- order: zod_openapi_1.z.int().default(1),
164
- })),
165
- })
166
- .superRefine(({ startDate, endDate }, ctx) => {
167
- const today = new Date();
168
- today.setHours(0, 0, 0, 0);
169
- if (!startDate)
170
- return;
171
- if (startDate > today)
172
- ctx.addIssue({
173
- path: ["startDate"],
174
- code: "custom",
175
- message: "Start date cannot be in the future",
176
- });
177
- if (endDate) {
178
- if (startDate > endDate)
179
- ctx.addIssue({
180
- path: ["startDate"],
181
- code: "custom",
182
- message: "Start date cannot be after end date",
183
- });
184
- }
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
+ // ),
185
168
  })
186
169
  .openapi({ title: "Create Project" });
187
170
  exports.UpdateProjectInputSchema = zod_openapi_1.z
@@ -210,9 +193,31 @@ exports.UpdateProjectInputSchema = zod_openapi_1.z
210
193
  createdAt: zod_openapi_1.z.date().optional(),
211
194
  updatedAt: zod_openapi_1.z.date().optional(),
212
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
+ }
213
216
  })
214
217
  .openapi({ title: "Update Project" });
215
- exports.CreateProjectOutputSchema = exports.ProjectEntitySchema;
218
+ exports.CreateProjectOutputSchema = zod_openapi_1.z.object({
219
+ id: zod_openapi_1.z.cuid2(),
220
+ });
216
221
  exports.UpdateProjectOutputSchema = exports.ProjectEntitySchema;
217
222
  exports.DeleteProjectOutputSchema = exports.ProjectEntitySchema;
218
223
  exports.GetProjectOutputSchema = exports.ProjectDetailsEntitySchema.extend({
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@zyacreatives/shared",
3
- "version": "2.2.8",
3
+ "version": "2.2.9",
4
4
  "description": "",
5
5
  "main": "dist/index.js",
6
6
  "types": "dist/index.d.ts",
@@ -59,7 +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
+ status: z.enum(PROJECT_STATUS),
63
63
  clientType: z.enum(CLIENT_TYPES).optional().openapi({
64
64
  description: "Type of client for this project.",
65
65
  example: "BRAND",
@@ -160,42 +160,25 @@ export const CreateProjectInputSchema = z
160
160
  title: z.string().min(1).max(100),
161
161
  description: z.string().max(1000).optional(),
162
162
  overview: z.string().optional(),
163
- url: z.string().optional(),
164
- imagePlaceholderUrl: z.url(),
165
- tags: z.array(z.string()).default([]),
166
- startDate: z.coerce.date().optional(),
167
- status: z.enum(PROJECT_STATUS).default(PROJECT_STATUS.ACTIVE),
168
- endDate: z.coerce.date().optional(),
169
- projectCreatorType: z.enum(ROLES).default(ROLES.CREATIVE),
170
- clientId: z.string().optional(),
171
- clientType: z.enum(CLIENT_TYPES).default(CLIENT_TYPES.NONE),
172
- clientName: z.string().optional(),
173
- files: z.array(
174
- CreateFileInputSchema.extend({
175
- isPlaceholder: z.boolean().default(false),
176
- order: z.int().default(1),
177
- }),
178
- ),
179
- })
180
- .superRefine(({ startDate, endDate }, ctx) => {
181
- const today = new Date();
182
- today.setHours(0, 0, 0, 0);
183
- if (!startDate) return;
184
- if (startDate > today)
185
- ctx.addIssue({
186
- path: ["startDate"],
187
- code: "custom",
188
- message: "Start date cannot be in the future",
189
- });
190
- if (endDate) {
191
- if (startDate > endDate)
192
- ctx.addIssue({
193
- path: ["startDate"],
194
- code: "custom",
195
- message: "Start date cannot be after end date",
196
- });
197
- }
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
+ // ),
198
180
  })
181
+
199
182
  .openapi({ title: "Create Project" });
200
183
 
201
184
  export const UpdateProjectInputSchema = z
@@ -225,9 +208,30 @@ export const UpdateProjectInputSchema = z
225
208
  updatedAt: z.date().optional(),
226
209
  version: z.int(),
227
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
+ })
228
230
  .openapi({ title: "Update Project" });
229
231
 
230
- export const CreateProjectOutputSchema = ProjectEntitySchema;
232
+ export const CreateProjectOutputSchema = z.object({
233
+ id: z.cuid2(),
234
+ });
231
235
  export const UpdateProjectOutputSchema = ProjectEntitySchema;
232
236
  export const DeleteProjectOutputSchema = ProjectEntitySchema;
233
237