@zyacreatives/shared 2.1.41 → 2.1.43
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.
- package/dist/schemas/brand.d.ts +2 -12
- package/dist/schemas/brand.js +20 -30
- package/dist/schemas/creative.d.ts +4 -13
- package/dist/schemas/creative.js +16 -21
- package/dist/schemas/job-application.d.ts +2 -2
- package/dist/schemas/notification.d.ts +4 -4
- package/dist/schemas/notification.js +0 -5
- package/dist/schemas/project.d.ts +2 -2
- package/dist/schemas/user.d.ts +17 -21
- package/dist/schemas/user.js +7 -3
- package/package.json +1 -1
- package/src/schemas/brand.ts +159 -168
- package/src/schemas/creative.ts +235 -237
- package/src/schemas/notification.ts +0 -6
- package/src/schemas/user.ts +130 -123
package/src/schemas/creative.ts
CHANGED
|
@@ -4,255 +4,253 @@ 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
|
-
tags: z
|
|
24
|
-
.array(z.string())
|
|
25
|
-
.optional()
|
|
26
|
-
.openapi({ example: ["branding", "typography", "UX"] }),
|
|
27
|
-
disciplines: z
|
|
28
|
-
.array(z.string())
|
|
29
|
-
.optional()
|
|
30
|
-
.openapi({ example: ["Design", "Art Direction"] }),
|
|
31
|
-
createdAt: z.coerce
|
|
32
|
-
.date()
|
|
33
|
-
.optional()
|
|
34
|
-
.openapi({ example: "2025-10-13T09:00:00.000Z" }),
|
|
35
|
-
updatedAt: z.coerce.date().openapi({ example: "2025-10-13T09:00:00.000Z" }),
|
|
36
|
-
});
|
|
37
|
-
|
|
38
|
-
export const CreativeEntitySchema = z
|
|
39
|
-
.object({
|
|
40
7
|
id: z.cuid2().openapi({ example: "cre_cksd0v6q0000s9a5y8z7p3x9" }),
|
|
41
8
|
userId: z.cuid2().openapi({ example: "user_abc123" }),
|
|
42
9
|
bio: z.string().optional().openapi({
|
|
43
|
-
|
|
10
|
+
example:
|
|
11
|
+
"A multi-disciplinary designer specializing in brand identity.",
|
|
44
12
|
}),
|
|
45
13
|
role: z.string().optional().openapi({ example: "Designer" }),
|
|
46
14
|
location: z.string().optional().openapi({ example: "London, UK" }),
|
|
47
15
|
experienceLevel: z
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
tags: z
|
|
58
|
-
.array(z.string())
|
|
59
|
-
.optional()
|
|
60
|
-
.openapi({ example: ["branding", "typography", "UX"] }),
|
|
16
|
+
.enum(
|
|
17
|
+
Object.values(EXPERIENCE_LEVELS) as [
|
|
18
|
+
ExperienceLevel,
|
|
19
|
+
...ExperienceLevel[],
|
|
20
|
+
],
|
|
21
|
+
)
|
|
22
|
+
.optional()
|
|
23
|
+
.openapi({ example: EXPERIENCE_LEVELS.YEAR_0_1 }),
|
|
61
24
|
|
|
62
25
|
disciplines: z
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
workExperience: z
|
|
67
|
-
.object({
|
|
68
|
-
companyName: z.string(),
|
|
69
|
-
position: z.string(),
|
|
70
|
-
startDate: z.coerce.date().optional(),
|
|
71
|
-
endDate: z.coerce.date().optional(),
|
|
72
|
-
currentlyWorking: z.boolean().optional(),
|
|
73
|
-
description: z.string(),
|
|
74
|
-
})
|
|
75
|
-
.array()
|
|
76
|
-
.optional(),
|
|
77
|
-
links: z
|
|
78
|
-
.object({
|
|
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(),
|
|
86
|
-
})
|
|
87
|
-
.array()
|
|
88
|
-
.optional(),
|
|
89
|
-
achievements: z
|
|
90
|
-
.object({
|
|
91
|
-
title: z.string(),
|
|
92
|
-
link: z.string().optional(),
|
|
93
|
-
year: z.coerce.number().int().optional(),
|
|
94
|
-
})
|
|
95
|
-
.array()
|
|
96
|
-
.optional(),
|
|
26
|
+
.array(z.string())
|
|
27
|
+
.optional()
|
|
28
|
+
.openapi({ example: ["Design", "Art Direction"] }),
|
|
97
29
|
createdAt: z.coerce
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
30
|
+
.date()
|
|
31
|
+
.optional()
|
|
32
|
+
.openapi({ example: "2025-10-13T09:00:00.000Z" }),
|
|
102
33
|
updatedAt: z.coerce.date().openapi({ example: "2025-10-13T09:00:00.000Z" }),
|
|
103
|
-
|
|
104
|
-
.openapi({
|
|
105
|
-
title: "CreativeEntitySchema",
|
|
106
|
-
description:
|
|
107
|
-
"Represents a creative profile, including bio, experience level, location, disciplines, tags, and timestamps.",
|
|
108
|
-
});
|
|
34
|
+
});
|
|
109
35
|
|
|
110
|
-
export const
|
|
111
|
-
|
|
112
|
-
|
|
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 }),
|
|
113
55
|
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
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" }),
|
|
118
95
|
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
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
|
+
});
|
|
105
|
+
|
|
106
|
+
export const ListCreativesInputSchema = z
|
|
107
|
+
.object({
|
|
108
|
+
query: z.string().optional().openapi({ example: "logo designer" }),
|
|
109
|
+
|
|
110
|
+
disciplines: z
|
|
111
|
+
.array(z.string())
|
|
112
|
+
.optional()
|
|
113
|
+
.openapi({ example: ["branding", "web design"] }),
|
|
132
114
|
|
|
133
|
-
|
|
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
|
+
}),
|
|
134
131
|
|
|
135
|
-
|
|
136
|
-
.array(z.string())
|
|
137
|
-
.optional()
|
|
138
|
-
.openapi({ example: ["Figma", "AI"] }),
|
|
132
|
+
location: z.string().optional().openapi({ example: "Los Angeles" }),
|
|
139
133
|
|
|
140
|
-
|
|
134
|
+
page: z
|
|
135
|
+
.number()
|
|
136
|
+
.int()
|
|
137
|
+
.min(1)
|
|
138
|
+
.default(1)
|
|
139
|
+
.optional()
|
|
140
|
+
.openapi({ example: 1 }),
|
|
141
141
|
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
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
|
+
});
|
|
156
156
|
|
|
157
157
|
export const CreateCreativeProfileInputSchema = z
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
|
|
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" }),
|
|
167
167
|
|
|
168
|
-
|
|
169
|
-
|
|
170
|
-
|
|
171
|
-
|
|
172
|
-
|
|
173
|
-
|
|
174
|
-
|
|
175
|
-
|
|
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
|
+
}),
|
|
176
176
|
|
|
177
|
-
|
|
178
|
-
|
|
179
|
-
|
|
180
|
-
|
|
181
|
-
|
|
182
|
-
|
|
183
|
-
|
|
184
|
-
|
|
185
|
-
|
|
186
|
-
|
|
187
|
-
|
|
188
|
-
|
|
189
|
-
|
|
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
|
+
});
|
|
190
192
|
|
|
191
193
|
export const UpdateCreativeProfileInputSchema = z
|
|
192
|
-
|
|
193
|
-
|
|
194
|
-
|
|
195
|
-
|
|
196
|
-
|
|
197
|
-
|
|
198
|
-
|
|
199
|
-
|
|
200
|
-
|
|
201
|
-
|
|
202
|
-
|
|
203
|
-
|
|
204
|
-
|
|
205
|
-
|
|
206
|
-
|
|
207
|
-
|
|
208
|
-
|
|
209
|
-
|
|
210
|
-
|
|
211
|
-
|
|
212
|
-
|
|
213
|
-
|
|
214
|
-
|
|
215
|
-
|
|
216
|
-
|
|
217
|
-
|
|
218
|
-
|
|
219
|
-
|
|
220
|
-
|
|
221
|
-
|
|
222
|
-
|
|
223
|
-
|
|
224
|
-
|
|
225
|
-
|
|
226
|
-
|
|
227
|
-
|
|
228
|
-
|
|
229
|
-
|
|
230
|
-
|
|
231
|
-
|
|
232
|
-
|
|
233
|
-
|
|
234
|
-
|
|
235
|
-
|
|
236
|
-
|
|
237
|
-
|
|
238
|
-
|
|
239
|
-
|
|
240
|
-
|
|
241
|
-
|
|
242
|
-
|
|
243
|
-
|
|
244
|
-
|
|
245
|
-
|
|
246
|
-
|
|
247
|
-
|
|
248
|
-
})
|
|
249
|
-
.openapi({
|
|
250
|
-
title: "update creative profile",
|
|
251
|
-
});
|
|
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
|
+
});
|
|
252
250
|
|
|
253
251
|
export const GetCreativeInputSchema = z.object({
|
|
254
|
-
|
|
255
|
-
|
|
252
|
+
value: z.cuid2(),
|
|
253
|
+
by: ProfileIdentifierSchema.shape.by,
|
|
256
254
|
});
|
|
257
255
|
|
|
258
256
|
export const GetCreativeQuerySchema = ProfileIdentifierSchema;
|
|
@@ -264,24 +262,24 @@ export const GetCreativeOutputSchema = CreativeEntitySchema;
|
|
|
264
262
|
export const UpdateCreativeOutputSchema = CreativeEntitySchema;
|
|
265
263
|
|
|
266
264
|
export const CreativeWithUserEntitySchema = MinimalCreativeEntitySchema.extend({
|
|
267
|
-
|
|
265
|
+
user: MinimalUserSchema,
|
|
268
266
|
});
|
|
269
267
|
|
|
270
268
|
export const SearchCreativeInputSchema = z.object({
|
|
271
|
-
|
|
272
|
-
|
|
273
|
-
|
|
274
|
-
|
|
275
|
-
|
|
276
|
-
|
|
277
|
-
|
|
278
|
-
|
|
279
|
-
|
|
280
|
-
|
|
281
|
-
|
|
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(),
|
|
282
280
|
});
|
|
283
281
|
|
|
284
282
|
export const SearchCreativeOutputSchema = z.object({
|
|
285
|
-
|
|
286
|
-
|
|
283
|
+
creatives: z.array(CreativeWithUserEntitySchema),
|
|
284
|
+
nextCursor: z.string().optional().nullable(),
|
|
287
285
|
});
|
|
@@ -8,20 +8,14 @@ export const NotificationEntitySchema = z
|
|
|
8
8
|
recipientId: z.cuid2().openapi({ example: "user_recipient_123" }),
|
|
9
9
|
actorId: z.cuid2().openapi({ example: "user_actor_456" }),
|
|
10
10
|
type: z.enum(NOTIFICATION_TYPES).openapi({ example: "LIKE" }),
|
|
11
|
-
// 1. ENTITY: The specific thing created (e.g., the Reply)
|
|
12
11
|
entityId: z.cuid2().optional().openapi({ example: "entity_789" }),
|
|
13
12
|
|
|
14
|
-
// 2. PARENT: The direct context (e.g., the Comment being replied to)
|
|
15
|
-
// Optional because top-level interactions (like a comment on a project)
|
|
16
|
-
// have no parent other than the root.
|
|
17
13
|
parentId: z
|
|
18
14
|
.cuid2()
|
|
19
15
|
.optional()
|
|
20
16
|
.nullable()
|
|
21
17
|
.openapi({ example: "parent_456" }),
|
|
22
18
|
parentType: z.enum(ACTIVITY_PARENT_TYPES).optional().nullable(),
|
|
23
|
-
|
|
24
|
-
// 3. ROOT: The top-level container (e.g., the Project)
|
|
25
19
|
rootId: z.cuid2().openapi({ example: "root_123" }),
|
|
26
20
|
rootType: z.enum(ACTIVITY_PARENT_TYPES),
|
|
27
21
|
|