@zyacreatives/shared 2.0.62 → 2.0.64

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.
@@ -1,19 +1,45 @@
1
1
  import { z } from "@hono/zod-openapi";
2
- import { EXPERIENCE_LEVELS, ExperienceLevel } from "../constants";
3
- import { CuidSchema, ProfileIdentifierSchema } from "./common";
2
+ import { EXPERIENCE_LEVELS, ExperienceLevel, LINK_TYPES } from "../constants";
3
+ import { ProfileIdentifierSchema } from "./common";
4
4
  import { MinimalUserSchema } from "./user";
5
+
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
+
28
+ disciplines: z
29
+ .array(z.string())
30
+ .optional()
31
+ .openapi({ example: ["Design", "Art Direction"] }),
32
+ })
33
+
5
34
  export const CreativeEntitySchema = z
6
35
  .object({
7
36
  id: z.cuid2().openapi({ example: "cre_cksd0v6q0000s9a5y8z7p3x9" }),
8
-
9
37
  userId: z.cuid2().openapi({ example: "user_abc123" }),
10
-
11
38
  bio: z.string().optional().openapi({
12
39
  example: "A multi-disciplinary designer specializing in brand identity.",
13
40
  }),
14
-
41
+ role: z.string().optional().openapi({ example: "Designer" }),
15
42
  location: z.string().optional().openapi({ example: "London, UK" }),
16
-
17
43
  experienceLevel: z
18
44
  .enum(
19
45
  Object.values(EXPERIENCE_LEVELS) as [
@@ -33,7 +59,25 @@ export const CreativeEntitySchema = z
33
59
  .array(z.string())
34
60
  .optional()
35
61
  .openapi({ example: ["Design", "Art Direction"] }),
36
-
62
+ workExperience: z.object({
63
+ companyName: z.string(),
64
+ position: z.string(),
65
+ startDate: z.coerce.date().optional(),
66
+ endDate: z.coerce.date().optional(),
67
+ currentlyWorking: z.boolean().optional(),
68
+ description: z.string().optional(),
69
+ }).array().optional(),
70
+ links: z.object({
71
+ name: z.string(),
72
+ url: z.string(),
73
+ type: z.enum(LINK_TYPES).default(LINK_TYPES.GENERIC_WEBSITE),
74
+ }).array().optional(),
75
+ achievements: z.object({
76
+ title: z.string(),
77
+ description: z.string(),
78
+ link: z.string().optional(),
79
+ year: z.number().int().optional(),
80
+ }).array().optional(),
37
81
  createdAt: z.coerce
38
82
  .date()
39
83
  .optional()
@@ -103,15 +147,7 @@ export const CreateCreativeProfileInputSchema = z
103
147
  .openapi({
104
148
  example: EXPERIENCE_LEVELS.YEAR_1_3,
105
149
  }),
106
-
107
- bio: z
108
- .string()
109
- .max(210)
110
- .optional()
111
- .describe("Short professional summary or introduction.")
112
- .openapi({
113
- example: "I am a freelance UI/UX designer.",
114
- }),
150
+ role: z.string().optional().openapi({ example: "Designer" }),
115
151
 
116
152
  location: z
117
153
  .string()
@@ -146,6 +182,7 @@ export const UpdateCreativeProfileInputSchema = z
146
182
  .array(z.string())
147
183
  .optional()
148
184
  .openapi({ example: ["react", "design", "product"] }),
185
+ role: z.string().optional().openapi({ example: "Designer" }),
149
186
  bio: z
150
187
  .string()
151
188
  .max(210)
@@ -161,6 +198,25 @@ export const UpdateCreativeProfileInputSchema = z
161
198
  .min(1, "At least one discipline is required")
162
199
  .optional()
163
200
  .openapi({ example: ["frontend", "ui-ux"] }),
201
+ workExperience: z.object({
202
+ companyName: z.string(),
203
+ position: z.string(),
204
+ startDate: z.coerce.date().optional(),
205
+ endDate: z.coerce.date().optional(),
206
+ currentlyWorking: z.boolean().optional(),
207
+ description: z.string().optional(),
208
+ }).array().optional(),
209
+ links: z.object({
210
+ name: z.string(),
211
+ url: z.string(),
212
+ type: z.enum(LINK_TYPES).default(LINK_TYPES.GENERIC_WEBSITE),
213
+ }).array().optional(),
214
+ achievements: z.object({
215
+ title: z.string(),
216
+ description: z.string(),
217
+ link: z.string().optional(),
218
+ year: z.number().int().optional(),
219
+ }).array().optional(),
164
220
  })
165
221
  .openapi({
166
222
  title: "update creative profile",
@@ -179,9 +235,9 @@ export const GetCreativeOutputSchema = CreativeEntitySchema;
179
235
 
180
236
  export const UpdateCreativeOutputSchema = CreativeEntitySchema;
181
237
 
182
- export const CreativeWithUserEntitySchema = CreativeEntitySchema.extend({
238
+ export const CreativeWithUserEntitySchema = MinimalCreativeEntitySchema.extend({
183
239
  user: MinimalUserSchema,
184
- });
240
+ }).optional();
185
241
 
186
242
  export const SearchCreativeInputSchema = z.object({
187
243
  string: z
@@ -200,4 +256,4 @@ export const SearchCreativeInputSchema = z.object({
200
256
  export const SearchCreativeOutputSchema = z.object({
201
257
  creatives: z.array(CreativeWithUserEntitySchema),
202
258
  nextCursor: z.string().optional(),
203
- });
259
+ });
@@ -11,6 +11,7 @@ import {
11
11
  BrandWithUserEntitySchema,
12
12
  SearchBrandInputSchema,
13
13
  SearchBrandOutputSchema,
14
+ MinimalBrandEntitySchema,
14
15
  } from "../schemas/brand";
15
16
 
16
17
  export type BrandEntity = z.infer<typeof BrandEntitySchema>;
@@ -36,3 +37,5 @@ export type UpdateBrandOutput = z.infer<typeof UpdateBrandOutputSchema>;
36
37
  export type BrandWithUserEntity = z.infer<typeof BrandWithUserEntitySchema>
37
38
  export type SearchBrandInput = z.infer<typeof SearchBrandInputSchema>
38
39
  export type SearchBrandOutput = z.infer<typeof SearchBrandOutputSchema>
40
+
41
+ export type MinimalBrandEntity = z.infer<typeof MinimalBrandEntitySchema>
@@ -11,6 +11,7 @@ import {
11
11
  CreativeWithUserEntitySchema,
12
12
  SearchCreativeInputSchema,
13
13
  SearchCreativeOutputSchema,
14
+ MinimalCreativeEntitySchema,
14
15
  } from "../schemas/creative";
15
16
 
16
17
  export type CreativeEntity = z.infer<typeof CreativeEntitySchema>;
@@ -33,3 +34,4 @@ export type UpdateCreativeOutput = z.infer<typeof UpdateCreativeOutputSchema>;
33
34
  export type CreativeWithUserEntity = z.infer<typeof CreativeWithUserEntitySchema>
34
35
  export type SearchCreativeInput = z.infer<typeof SearchCreativeInputSchema>
35
36
  export type SearchCreativeOutput = z.infer<typeof SearchCreativeOutputSchema>
37
+ export type MinimalCreativeEntity = z.infer<typeof MinimalCreativeEntitySchema>