@zyacreatives/shared 2.2.8 → 2.2.10

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;
@@ -254,6 +230,12 @@ export declare const UpdateProjectInputSchema: z.ZodObject<{
254
230
  readonly ZAR: "ZAR (South African Rand)";
255
231
  }>>;
256
232
  currentTraction: z.ZodOptional<z.ZodString>;
233
+ files: z.ZodArray<z.ZodObject<{
234
+ key: z.ZodString;
235
+ mimeType: z.ZodString;
236
+ isPlaceholder: z.ZodDefault<z.ZodBoolean>;
237
+ order: z.ZodDefault<z.ZodInt>;
238
+ }, z.core.$strip>>;
257
239
  startDate: z.ZodOptional<z.ZodCoercedDate<unknown>>;
258
240
  endDate: z.ZodOptional<z.ZodCoercedDate<unknown>>;
259
241
  createdAt: z.ZodOptional<z.ZodDate>;
@@ -261,65 +243,7 @@ export declare const UpdateProjectInputSchema: z.ZodObject<{
261
243
  version: z.ZodInt;
262
244
  }, z.core.$strip>;
263
245
  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;
246
+ id: z.ZodCUID2;
323
247
  }, z.core.$strip>;
324
248
  export declare const UpdateProjectOutputSchema: z.ZodObject<{
325
249
  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
@@ -205,14 +188,40 @@ exports.UpdateProjectInputSchema = zod_openapi_1.z
205
188
  capitalLookingToRaise: zod_openapi_1.z.string().optional(),
206
189
  capitalLookingToRaiseCurrency: zod_openapi_1.z.enum(constants_1.WAGES_CURRENCY).optional(),
207
190
  currentTraction: zod_openapi_1.z.string().max(600).optional(),
191
+ files: zod_openapi_1.z.array(file_1.CreateFileInputSchema.extend({
192
+ isPlaceholder: zod_openapi_1.z.boolean().default(false),
193
+ order: zod_openapi_1.z.int().default(1),
194
+ })),
208
195
  startDate: zod_openapi_1.z.coerce.date().optional(),
209
196
  endDate: zod_openapi_1.z.coerce.date().optional(),
210
197
  createdAt: zod_openapi_1.z.date().optional(),
211
198
  updatedAt: zod_openapi_1.z.date().optional(),
212
199
  version: zod_openapi_1.z.int(),
200
+ })
201
+ .superRefine(({ startDate, endDate }, ctx) => {
202
+ const today = new Date();
203
+ today.setHours(0, 0, 0, 0);
204
+ if (!startDate)
205
+ return;
206
+ if (startDate > today)
207
+ ctx.addIssue({
208
+ path: ["startDate"],
209
+ code: "custom",
210
+ message: "Start date cannot be in the future",
211
+ });
212
+ if (endDate) {
213
+ if (startDate > endDate)
214
+ ctx.addIssue({
215
+ path: ["startDate"],
216
+ code: "custom",
217
+ message: "Start date cannot be after end date",
218
+ });
219
+ }
213
220
  })
214
221
  .openapi({ title: "Update Project" });
215
- exports.CreateProjectOutputSchema = exports.ProjectEntitySchema;
222
+ exports.CreateProjectOutputSchema = zod_openapi_1.z.object({
223
+ id: zod_openapi_1.z.cuid2(),
224
+ });
216
225
  exports.UpdateProjectOutputSchema = exports.ProjectEntitySchema;
217
226
  exports.DeleteProjectOutputSchema = exports.ProjectEntitySchema;
218
227
  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.10",
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
@@ -219,15 +202,42 @@ export const UpdateProjectInputSchema = z
219
202
  capitalLookingToRaise: z.string().optional(),
220
203
  capitalLookingToRaiseCurrency: z.enum(WAGES_CURRENCY).optional(),
221
204
  currentTraction: z.string().max(600).optional(),
205
+ files: z.array(
206
+ CreateFileInputSchema.extend({
207
+ isPlaceholder: z.boolean().default(false),
208
+ order: z.int().default(1),
209
+ }),
210
+ ),
222
211
  startDate: z.coerce.date().optional(),
223
212
  endDate: z.coerce.date().optional(),
224
213
  createdAt: z.date().optional(),
225
214
  updatedAt: z.date().optional(),
226
215
  version: z.int(),
227
216
  })
217
+ .superRefine(({ startDate, endDate }, ctx) => {
218
+ const today = new Date();
219
+ today.setHours(0, 0, 0, 0);
220
+ if (!startDate) return;
221
+ if (startDate > today)
222
+ ctx.addIssue({
223
+ path: ["startDate"],
224
+ code: "custom",
225
+ message: "Start date cannot be in the future",
226
+ });
227
+ if (endDate) {
228
+ if (startDate > endDate)
229
+ ctx.addIssue({
230
+ path: ["startDate"],
231
+ code: "custom",
232
+ message: "Start date cannot be after end date",
233
+ });
234
+ }
235
+ })
228
236
  .openapi({ title: "Update Project" });
229
237
 
230
- export const CreateProjectOutputSchema = ProjectEntitySchema;
238
+ export const CreateProjectOutputSchema = z.object({
239
+ id: z.cuid2(),
240
+ });
231
241
  export const UpdateProjectOutputSchema = ProjectEntitySchema;
232
242
  export const DeleteProjectOutputSchema = ProjectEntitySchema;
233
243