@zyacreatives/shared 2.1.43 → 2.1.44

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.
@@ -95,7 +95,7 @@ export declare const UpdateCreativeProfileInputSchema: z.ZodObject<{
95
95
  position: z.ZodString;
96
96
  startDate: z.ZodOptional<z.ZodString>;
97
97
  endDate: z.ZodOptional<z.ZodString>;
98
- currentlyWorking: z.ZodOptional<z.ZodBoolean>;
98
+ currentlyWorking: z.ZodDefault<z.ZodBoolean>;
99
99
  description: z.ZodOptional<z.ZodString>;
100
100
  }, z.core.$strip>>>;
101
101
  links: z.ZodOptional<z.ZodArray<z.ZodObject<{
@@ -79,9 +79,7 @@ exports.CreativeEntitySchema = zod_openapi_1.z
79
79
  .date()
80
80
  .optional()
81
81
  .openapi({ example: "2025-10-13T09:00:00.000Z" }),
82
- updatedAt: zod_openapi_1.z.coerce
83
- .date()
84
- .openapi({ example: "2025-10-13T09:00:00.000Z" }),
82
+ updatedAt: zod_openapi_1.z.coerce.date().openapi({ example: "2025-10-13T09:00:00.000Z" }),
85
83
  })
86
84
  .openapi({
87
85
  title: "CreativeEntitySchema",
@@ -98,19 +96,10 @@ exports.ListCreativesInputSchema = zod_openapi_1.z
98
96
  .array(zod_openapi_1.z.enum(Object.values(constants_1.EXPERIENCE_LEVELS)))
99
97
  .optional()
100
98
  .openapi({
101
- example: [
102
- constants_1.EXPERIENCE_LEVELS.YEAR_1_3,
103
- constants_1.EXPERIENCE_LEVELS.YEAR_5_PLUS,
104
- ],
99
+ example: [constants_1.EXPERIENCE_LEVELS.YEAR_1_3, constants_1.EXPERIENCE_LEVELS.YEAR_5_PLUS],
105
100
  }),
106
101
  location: zod_openapi_1.z.string().optional().openapi({ example: "Los Angeles" }),
107
- page: zod_openapi_1.z
108
- .number()
109
- .int()
110
- .min(1)
111
- .default(1)
112
- .optional()
113
- .openapi({ example: 1 }),
102
+ page: zod_openapi_1.z.number().int().min(1).default(1).optional().openapi({ example: 1 }),
114
103
  perPage: zod_openapi_1.z
115
104
  .number()
116
105
  .int()
@@ -183,7 +172,7 @@ exports.UpdateCreativeProfileInputSchema = zod_openapi_1.z
183
172
  position: zod_openapi_1.z.string(),
184
173
  startDate: zod_openapi_1.z.string().optional(),
185
174
  endDate: zod_openapi_1.z.string().optional(),
186
- currentlyWorking: zod_openapi_1.z.boolean().optional(),
175
+ currentlyWorking: zod_openapi_1.z.boolean().default(false),
187
176
  description: zod_openapi_1.z.string().optional(),
188
177
  })
189
178
  .array()
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@zyacreatives/shared",
3
- "version": "2.1.43",
3
+ "version": "2.1.44",
4
4
  "description": "",
5
5
  "main": "dist/index.js",
6
6
  "types": "dist/index.d.ts",
@@ -4,253 +4,238 @@ import { ProfileIdentifierSchema } from "./common";
4
4
  import { MinimalUserSchema } from "./user";
5
5
 
6
6
  export const MinimalCreativeEntitySchema = z.object({
7
+ id: z.cuid2().openapi({ example: "cre_cksd0v6q0000s9a5y8z7p3x9" }),
8
+ userId: z.cuid2().openapi({ example: "user_abc123" }),
9
+ bio: z.string().optional().openapi({
10
+ example: "A multi-disciplinary designer specializing in brand identity.",
11
+ }),
12
+ role: z.string().optional().openapi({ example: "Designer" }),
13
+ location: z.string().optional().openapi({ example: "London, UK" }),
14
+ experienceLevel: z
15
+ .enum(
16
+ Object.values(EXPERIENCE_LEVELS) as [
17
+ ExperienceLevel,
18
+ ...ExperienceLevel[]
19
+ ]
20
+ )
21
+ .optional()
22
+ .openapi({ example: EXPERIENCE_LEVELS.YEAR_0_1 }),
23
+
24
+ disciplines: z
25
+ .array(z.string())
26
+ .optional()
27
+ .openapi({ example: ["Design", "Art Direction"] }),
28
+ createdAt: z.coerce
29
+ .date()
30
+ .optional()
31
+ .openapi({ example: "2025-10-13T09:00:00.000Z" }),
32
+ updatedAt: z.coerce.date().openapi({ example: "2025-10-13T09:00:00.000Z" }),
33
+ });
34
+
35
+ export const CreativeEntitySchema = z
36
+ .object({
7
37
  id: z.cuid2().openapi({ example: "cre_cksd0v6q0000s9a5y8z7p3x9" }),
8
38
  userId: z.cuid2().openapi({ example: "user_abc123" }),
9
39
  bio: z.string().optional().openapi({
10
- example:
11
- "A multi-disciplinary designer specializing in brand identity.",
40
+ example: "A multi-disciplinary designer specializing in brand identity.",
12
41
  }),
13
42
  role: z.string().optional().openapi({ example: "Designer" }),
14
43
  location: z.string().optional().openapi({ example: "London, UK" }),
15
44
  experienceLevel: z
16
- .enum(
17
- Object.values(EXPERIENCE_LEVELS) as [
18
- ExperienceLevel,
19
- ...ExperienceLevel[],
20
- ],
21
- )
22
- .optional()
23
- .openapi({ example: EXPERIENCE_LEVELS.YEAR_0_1 }),
45
+ .enum(
46
+ Object.values(EXPERIENCE_LEVELS) as [
47
+ ExperienceLevel,
48
+ ...ExperienceLevel[]
49
+ ]
50
+ )
51
+ .optional()
52
+ .openapi({ example: EXPERIENCE_LEVELS.YEAR_0_1 }),
24
53
 
25
54
  disciplines: z
26
- .array(z.string())
27
- .optional()
28
- .openapi({ example: ["Design", "Art Direction"] }),
55
+ .array(z.string())
56
+ .optional()
57
+ .openapi({ example: ["Design", "Art Direction"] }),
58
+ workExperience: z
59
+ .object({
60
+ companyName: z.string(),
61
+ position: z.string(),
62
+ startDate: z.coerce.date().optional(),
63
+ endDate: z.coerce.date().optional(),
64
+ currentlyWorking: z.boolean().optional(),
65
+ description: z.string(),
66
+ })
67
+ .array()
68
+ .optional(),
69
+ links: z
70
+ .object({
71
+ url: z
72
+ .union([
73
+ z.url({ message: "Please enter a valid URL" }),
74
+ z.literal(""),
75
+ ])
76
+ .optional(),
77
+ type: z.enum(LINK_TYPES).optional(),
78
+ })
79
+ .array()
80
+ .optional(),
81
+ achievements: z
82
+ .object({
83
+ title: z.string(),
84
+ link: z.string().optional(),
85
+ year: z.coerce.number().int().optional(),
86
+ })
87
+ .array()
88
+ .optional(),
29
89
  createdAt: z.coerce
30
- .date()
31
- .optional()
32
- .openapi({ example: "2025-10-13T09:00:00.000Z" }),
33
- updatedAt: z.coerce.date().openapi({ example: "2025-10-13T09:00:00.000Z" }),
34
- });
35
-
36
- export const CreativeEntitySchema = z
37
- .object({
38
- id: z.cuid2().openapi({ example: "cre_cksd0v6q0000s9a5y8z7p3x9" }),
39
- userId: z.cuid2().openapi({ example: "user_abc123" }),
40
- bio: z.string().optional().openapi({
41
- example:
42
- "A multi-disciplinary designer specializing in brand identity.",
43
- }),
44
- role: z.string().optional().openapi({ example: "Designer" }),
45
- location: z.string().optional().openapi({ example: "London, UK" }),
46
- experienceLevel: z
47
- .enum(
48
- Object.values(EXPERIENCE_LEVELS) as [
49
- ExperienceLevel,
50
- ...ExperienceLevel[],
51
- ],
52
- )
53
- .optional()
54
- .openapi({ example: EXPERIENCE_LEVELS.YEAR_0_1 }),
90
+ .date()
91
+ .optional()
92
+ .openapi({ example: "2025-10-13T09:00:00.000Z" }),
55
93
 
56
- disciplines: z
57
- .array(z.string())
58
- .optional()
59
- .openapi({ example: ["Design", "Art Direction"] }),
60
- workExperience: z
61
- .object({
62
- companyName: z.string(),
63
- position: z.string(),
64
- startDate: z.coerce.date().optional(),
65
- endDate: z.coerce.date().optional(),
66
- currentlyWorking: z.boolean().optional(),
67
- description: z.string(),
68
- })
69
- .array()
70
- .optional(),
71
- links: z
72
- .object({
73
- url: z
74
- .union([
75
- z.url({ message: "Please enter a valid URL" }),
76
- z.literal(""),
77
- ])
78
- .optional(),
79
- type: z.enum(LINK_TYPES).optional(),
80
- })
81
- .array()
82
- .optional(),
83
- achievements: z
84
- .object({
85
- title: z.string(),
86
- link: z.string().optional(),
87
- year: z.coerce.number().int().optional(),
88
- })
89
- .array()
90
- .optional(),
91
- createdAt: z.coerce
92
- .date()
93
- .optional()
94
- .openapi({ example: "2025-10-13T09:00:00.000Z" }),
95
-
96
- updatedAt: z.coerce
97
- .date()
98
- .openapi({ example: "2025-10-13T09:00:00.000Z" }),
99
- })
100
- .openapi({
101
- title: "CreativeEntitySchema",
102
- description:
103
- "Represents a creative profile, including bio, experience level, location, disciplines and timestamps.",
104
- });
94
+ updatedAt: z.coerce.date().openapi({ example: "2025-10-13T09:00:00.000Z" }),
95
+ })
96
+ .openapi({
97
+ title: "CreativeEntitySchema",
98
+ description:
99
+ "Represents a creative profile, including bio, experience level, location, disciplines and timestamps.",
100
+ });
105
101
 
106
102
  export const ListCreativesInputSchema = z
107
- .object({
108
- query: z.string().optional().openapi({ example: "logo designer" }),
103
+ .object({
104
+ query: z.string().optional().openapi({ example: "logo designer" }),
109
105
 
110
- disciplines: z
111
- .array(z.string())
112
- .optional()
113
- .openapi({ example: ["branding", "web design"] }),
106
+ disciplines: z
107
+ .array(z.string())
108
+ .optional()
109
+ .openapi({ example: ["branding", "web design"] }),
114
110
 
115
- experienceLevels: z
116
- .array(
117
- z.enum(
118
- Object.values(EXPERIENCE_LEVELS) as [
119
- ExperienceLevel,
120
- ...ExperienceLevel[],
121
- ],
122
- ),
123
- )
124
- .optional()
125
- .openapi({
126
- example: [
127
- EXPERIENCE_LEVELS.YEAR_1_3,
128
- EXPERIENCE_LEVELS.YEAR_5_PLUS,
129
- ],
130
- }),
111
+ experienceLevels: z
112
+ .array(
113
+ z.enum(
114
+ Object.values(EXPERIENCE_LEVELS) as [
115
+ ExperienceLevel,
116
+ ...ExperienceLevel[]
117
+ ]
118
+ )
119
+ )
120
+ .optional()
121
+ .openapi({
122
+ example: [EXPERIENCE_LEVELS.YEAR_1_3, EXPERIENCE_LEVELS.YEAR_5_PLUS],
123
+ }),
131
124
 
132
- location: z.string().optional().openapi({ example: "Los Angeles" }),
125
+ location: z.string().optional().openapi({ example: "Los Angeles" }),
133
126
 
134
- page: z
135
- .number()
136
- .int()
137
- .min(1)
138
- .default(1)
139
- .optional()
140
- .openapi({ example: 1 }),
127
+ page: z.number().int().min(1).default(1).optional().openapi({ example: 1 }),
141
128
 
142
- perPage: z
143
- .number()
144
- .int()
145
- .min(1)
146
- .max(100)
147
- .default(20)
148
- .optional()
149
- .openapi({ example: 20 }),
150
- })
151
- .openapi({
152
- title: "ListCreativesInput",
153
- description:
154
- "Query parameters for filtering and paginating creatives. Supports text search, discipline filtering, experience level filtering, tag filtering, location filtering, and pagination settings.",
155
- });
129
+ perPage: z
130
+ .number()
131
+ .int()
132
+ .min(1)
133
+ .max(100)
134
+ .default(20)
135
+ .optional()
136
+ .openapi({ example: 20 }),
137
+ })
138
+ .openapi({
139
+ title: "ListCreativesInput",
140
+ description:
141
+ "Query parameters for filtering and paginating creatives. Supports text search, discipline filtering, experience level filtering, tag filtering, location filtering, and pagination settings.",
142
+ });
156
143
 
157
144
  export const CreateCreativeProfileInputSchema = z
158
- .object({
159
- experienceLevel: z
160
- .enum(EXPERIENCE_LEVELS)
161
- .describe("Overall experience range of the creative.")
162
- .default(EXPERIENCE_LEVELS.YEAR_0_1)
163
- .openapi({
164
- example: EXPERIENCE_LEVELS.YEAR_1_3,
165
- }),
166
- role: z.string().optional().openapi({ example: "Designer" }),
145
+ .object({
146
+ experienceLevel: z
147
+ .enum(EXPERIENCE_LEVELS)
148
+ .describe("Overall experience range of the creative.")
149
+ .default(EXPERIENCE_LEVELS.YEAR_0_1)
150
+ .openapi({
151
+ example: EXPERIENCE_LEVELS.YEAR_1_3,
152
+ }),
153
+ role: z.string().optional().openapi({ example: "Designer" }),
167
154
 
168
- location: z
169
- .string()
170
- .max(100)
171
- .optional()
172
- .describe("Primary location where the creative works or resides.")
173
- .openapi({
174
- example: "Lagos, Nigeria",
175
- }),
155
+ location: z
156
+ .string()
157
+ .max(100)
158
+ .optional()
159
+ .describe("Primary location where the creative works or resides.")
160
+ .openapi({
161
+ example: "Lagos, Nigeria",
162
+ }),
176
163
 
177
- disciplineSlugs: z
178
- .array(z.string())
179
- .min(1, "At least one discipline is required")
180
- .default([])
181
- .describe(
182
- "List of discipline slugs representing the creative’s fields.",
183
- )
184
- .openapi({
185
- example: ["ui-ux", "frontend"],
186
- }),
187
- })
188
- .openapi({
189
- title: "create creative profile",
190
- description: "Payload for creating a new creative profile.",
191
- });
164
+ disciplineSlugs: z
165
+ .array(z.string())
166
+ .min(1, "At least one discipline is required")
167
+ .default([])
168
+ .describe("List of discipline slugs representing the creative’s fields.")
169
+ .openapi({
170
+ example: ["ui-ux", "frontend"],
171
+ }),
172
+ })
173
+ .openapi({
174
+ title: "create creative profile",
175
+ description: "Payload for creating a new creative profile.",
176
+ });
192
177
 
193
178
  export const UpdateCreativeProfileInputSchema = z
194
- .object({
195
- experienceLevel: z
196
- .enum(EXPERIENCE_LEVELS)
197
- .optional()
198
- .openapi({ example: EXPERIENCE_LEVELS.YEAR_3_5 }),
199
- role: z.string().optional().openapi({ example: "Designer" }),
200
- bio: z
201
- .string()
202
- .max(600)
203
- .optional()
204
- .openapi({ example: "I am a freelance UI/UX designer." }),
205
- location: z
206
- .string()
207
- .max(100)
208
- .optional()
209
- .openapi({ example: "Lagos, Nigeria" }),
210
- disciplineSlugs: z
211
- .array(z.string())
212
- .min(1, "At least one discipline is required")
213
- .optional()
214
- .openapi({ example: ["frontend", "ui-ux"] }),
215
- workExperience: z
216
- .object({
217
- companyName: z.string(),
218
- position: z.string(),
219
- startDate: z.string().optional(),
220
- endDate: z.string().optional(),
221
- currentlyWorking: z.boolean().optional(),
222
- description: z.string().optional(),
223
- })
224
- .array()
225
- .optional(),
226
- links: z
227
- .object({
228
- url: z
229
- .union([
230
- z.url({ message: "Please enter a valid URL" }),
231
- z.literal(""),
232
- ])
233
- .optional(),
234
- type: z.enum(LINK_TYPES).optional(),
235
- })
236
- .array()
237
- .optional(),
238
- achievements: z
239
- .object({
240
- title: z.string(),
241
- link: z.string().optional(),
242
- year: z.coerce.number().int().optional(),
243
- })
244
- .array()
245
- .optional(),
246
- })
247
- .openapi({
248
- title: "update creative profile",
249
- });
179
+ .object({
180
+ experienceLevel: z
181
+ .enum(EXPERIENCE_LEVELS)
182
+ .optional()
183
+ .openapi({ example: EXPERIENCE_LEVELS.YEAR_3_5 }),
184
+ role: z.string().optional().openapi({ example: "Designer" }),
185
+ bio: z
186
+ .string()
187
+ .max(600)
188
+ .optional()
189
+ .openapi({ example: "I am a freelance UI/UX designer." }),
190
+ location: z
191
+ .string()
192
+ .max(100)
193
+ .optional()
194
+ .openapi({ example: "Lagos, Nigeria" }),
195
+ disciplineSlugs: z
196
+ .array(z.string())
197
+ .min(1, "At least one discipline is required")
198
+ .optional()
199
+ .openapi({ example: ["frontend", "ui-ux"] }),
200
+ workExperience: z
201
+ .object({
202
+ companyName: z.string(),
203
+ position: z.string(),
204
+ startDate: z.string().optional(),
205
+ endDate: z.string().optional(),
206
+ currentlyWorking: z.boolean().default(false),
207
+ description: z.string().optional(),
208
+ })
209
+ .array()
210
+ .optional(),
211
+ links: z
212
+ .object({
213
+ url: z
214
+ .union([
215
+ z.url({ message: "Please enter a valid URL" }),
216
+ z.literal(""),
217
+ ])
218
+ .optional(),
219
+ type: z.enum(LINK_TYPES).optional(),
220
+ })
221
+ .array()
222
+ .optional(),
223
+ achievements: z
224
+ .object({
225
+ title: z.string(),
226
+ link: z.string().optional(),
227
+ year: z.coerce.number().int().optional(),
228
+ })
229
+ .array()
230
+ .optional(),
231
+ })
232
+ .openapi({
233
+ title: "update creative profile",
234
+ });
250
235
 
251
236
  export const GetCreativeInputSchema = z.object({
252
- value: z.cuid2(),
253
- by: ProfileIdentifierSchema.shape.by,
237
+ value: z.cuid2(),
238
+ by: ProfileIdentifierSchema.shape.by,
254
239
  });
255
240
 
256
241
  export const GetCreativeQuerySchema = ProfileIdentifierSchema;
@@ -262,24 +247,24 @@ export const GetCreativeOutputSchema = CreativeEntitySchema;
262
247
  export const UpdateCreativeOutputSchema = CreativeEntitySchema;
263
248
 
264
249
  export const CreativeWithUserEntitySchema = MinimalCreativeEntitySchema.extend({
265
- user: MinimalUserSchema,
250
+ user: MinimalUserSchema,
266
251
  });
267
252
 
268
253
  export const SearchCreativeInputSchema = z.object({
269
- string: z
270
- .string()
271
- .min(1, { message: "Search string cannot be empty" })
272
- .max(200, { message: "Search string cannot exceed 200 characters" }),
273
- limit: z.coerce
274
- .number()
275
- .int({ message: "Limit must be an integer" })
276
- .min(1, { message: "Limit must be at least 1" })
277
- .max(100, { message: "Limit cannot exceed 100" })
278
- .default(20),
279
- cursor: z.string().optional(),
254
+ string: z
255
+ .string()
256
+ .min(1, { message: "Search string cannot be empty" })
257
+ .max(200, { message: "Search string cannot exceed 200 characters" }),
258
+ limit: z.coerce
259
+ .number()
260
+ .int({ message: "Limit must be an integer" })
261
+ .min(1, { message: "Limit must be at least 1" })
262
+ .max(100, { message: "Limit cannot exceed 100" })
263
+ .default(20),
264
+ cursor: z.string().optional(),
280
265
  });
281
266
 
282
267
  export const SearchCreativeOutputSchema = z.object({
283
- creatives: z.array(CreativeWithUserEntitySchema),
284
- nextCursor: z.string().optional().nullable(),
268
+ creatives: z.array(CreativeWithUserEntitySchema),
269
+ nextCursor: z.string().optional().nullable(),
285
270
  });