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