@zyacreatives/shared 2.1.69 → 2.1.71

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