@zyacreatives/shared 2.1.41 → 2.1.42
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 +2 -11
- package/dist/schemas/creative.js +14 -19
- 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/brand.ts
CHANGED
|
@@ -4,174 +4,165 @@ 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
|
|
11
|
-
.string()
|
|
12
|
-
.optional()
|
|
13
|
-
.openapi({ example: "Leading software development firm focused on AI." }),
|
|
14
|
-
tags: z
|
|
15
|
-
.array(z.string())
|
|
16
|
-
.optional()
|
|
17
|
-
.openapi({ example: ["technology", "saas", "startup"] }),
|
|
18
|
-
disciplines: z
|
|
19
|
-
.array(z.string())
|
|
20
|
-
.optional()
|
|
21
|
-
.openapi({ example: ["Marketing", "Product Development"] }),
|
|
22
|
-
createdAt: z.coerce
|
|
23
|
-
.date()
|
|
24
|
-
.optional()
|
|
25
|
-
.openapi({ example: "2025-10-13T09:00:00.000Z" }),
|
|
26
|
-
updatedAt: z.coerce.date().openapi({ example: "2025-10-13T09:00:00.000Z" }),
|
|
27
|
-
});
|
|
28
|
-
|
|
29
|
-
export const BrandEntitySchema = z
|
|
30
|
-
.object({
|
|
31
7
|
id: z.cuid2().openapi({ example: "brd_cksd0v6q0000s9a5y8z7p3x9" }),
|
|
32
8
|
userId: z.cuid2().openapi({ example: "user_owner_123" }),
|
|
33
9
|
brandName: z.string().openapi({ example: "TechInnovate Inc." }),
|
|
34
|
-
bio: z
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
.openapi({ example: "Leading software development firm focused on AI." }),
|
|
38
|
-
tags: z
|
|
39
|
-
.array(z.string())
|
|
40
|
-
.optional()
|
|
41
|
-
.openapi({ example: ["technology", "saas", "startup"] }),
|
|
42
|
-
disciplines: z
|
|
43
|
-
.array(z.string())
|
|
44
|
-
.optional()
|
|
45
|
-
.openapi({ example: ["Marketing", "Product Development"] }),
|
|
10
|
+
bio: z.string().optional().openapi({
|
|
11
|
+
example: "Leading software development firm focused on AI.",
|
|
12
|
+
}),
|
|
46
13
|
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
type: z.enum(LINK_TYPES).default(LINK_TYPES.GENERIC_WEBSITE),
|
|
52
|
-
})
|
|
53
|
-
.array()
|
|
54
|
-
.optional(),
|
|
55
|
-
achievements: z
|
|
56
|
-
.object({
|
|
57
|
-
title: z.string(),
|
|
58
|
-
link: z.url().optional(),
|
|
59
|
-
year: z.number().int().optional(),
|
|
60
|
-
})
|
|
61
|
-
.array()
|
|
62
|
-
.optional(),
|
|
14
|
+
disciplines: z
|
|
15
|
+
.array(z.string())
|
|
16
|
+
.optional()
|
|
17
|
+
.openapi({ example: ["Marketing", "Product Development"] }),
|
|
63
18
|
createdAt: z.coerce
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
19
|
+
.date()
|
|
20
|
+
.optional()
|
|
21
|
+
.openapi({ example: "2025-10-13T09:00:00.000Z" }),
|
|
67
22
|
updatedAt: z.coerce.date().openapi({ example: "2025-10-13T09:00:00.000Z" }),
|
|
68
|
-
|
|
69
|
-
|
|
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
|
+
name: z.string(),
|
|
41
|
+
url: z.url(),
|
|
42
|
+
type: z.enum(LINK_TYPES).default(LINK_TYPES.GENERIC_WEBSITE),
|
|
43
|
+
})
|
|
44
|
+
.array()
|
|
45
|
+
.optional(),
|
|
46
|
+
achievements: z
|
|
47
|
+
.object({
|
|
48
|
+
title: z.string(),
|
|
49
|
+
link: z.url().optional(),
|
|
50
|
+
year: z.number().int().optional(),
|
|
51
|
+
})
|
|
52
|
+
.array()
|
|
53
|
+
.optional(),
|
|
54
|
+
createdAt: z.coerce
|
|
55
|
+
.date()
|
|
56
|
+
.optional()
|
|
57
|
+
.openapi({ example: "2025-10-13T09:00:00.000Z" }),
|
|
58
|
+
updatedAt: z.coerce
|
|
59
|
+
.date()
|
|
60
|
+
.openapi({ example: "2025-10-13T09:00:00.000Z" }),
|
|
61
|
+
})
|
|
62
|
+
.openapi("BrandEntitySchema");
|
|
70
63
|
|
|
71
64
|
export const ListBrandsInputSchema = z
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
65
|
+
.object({
|
|
66
|
+
query: z.string().optional().openapi({ example: "AI software brand" }),
|
|
67
|
+
disciplines: z
|
|
68
|
+
.array(z.string())
|
|
69
|
+
.optional()
|
|
70
|
+
.openapi({ example: ["design", "marketing"] }),
|
|
71
|
+
experienceLevels: z
|
|
72
|
+
.array(
|
|
73
|
+
z.enum(
|
|
74
|
+
Object.values(EXPERIENCE_LEVELS) as [
|
|
75
|
+
ExperienceLevel,
|
|
76
|
+
...ExperienceLevel[],
|
|
77
|
+
],
|
|
78
|
+
),
|
|
79
|
+
)
|
|
80
|
+
.optional()
|
|
81
|
+
.openapi({
|
|
82
|
+
example: ["SENIOR", "EXPERT"],
|
|
83
|
+
description:
|
|
84
|
+
"Filter based on the required experience level of partners.",
|
|
85
|
+
}),
|
|
86
|
+
location: z.string().optional().openapi({ example: "San Francisco" }),
|
|
87
|
+
page: z
|
|
88
|
+
.number()
|
|
89
|
+
.int()
|
|
90
|
+
.min(1)
|
|
91
|
+
.default(1)
|
|
92
|
+
.optional()
|
|
93
|
+
.openapi({ example: 1 }),
|
|
94
|
+
perPage: z
|
|
95
|
+
.number()
|
|
96
|
+
.int()
|
|
97
|
+
.min(1)
|
|
98
|
+
.max(100)
|
|
99
|
+
.default(20)
|
|
100
|
+
.optional()
|
|
101
|
+
.openapi({ example: 20 }),
|
|
102
|
+
})
|
|
103
|
+
.openapi("ListBrandsInput");
|
|
109
104
|
|
|
110
105
|
export const CreateBrandProfileInputSchema = z
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
})
|
|
126
|
-
.openapi({
|
|
127
|
-
title: "create brand profile",
|
|
128
|
-
});
|
|
106
|
+
.object({
|
|
107
|
+
brandName: z
|
|
108
|
+
.string()
|
|
109
|
+
.min(1, "Brand name is required")
|
|
110
|
+
.openapi({ example: "Acme Creative Studio" }),
|
|
111
|
+
disciplineSlugs: z
|
|
112
|
+
.array(z.string())
|
|
113
|
+
.min(1, "At least one discipline is required")
|
|
114
|
+
.default([])
|
|
115
|
+
.openapi({ example: ["ui-ux", "frontend"] }),
|
|
116
|
+
})
|
|
117
|
+
.openapi({
|
|
118
|
+
title: "create brand profile",
|
|
119
|
+
});
|
|
129
120
|
|
|
130
121
|
export const UpdateBrandProfileInputSchema = z
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
|
|
169
|
-
|
|
170
|
-
|
|
122
|
+
.object({
|
|
123
|
+
brandName: z
|
|
124
|
+
.string()
|
|
125
|
+
.min(1)
|
|
126
|
+
.optional()
|
|
127
|
+
.openapi({ example: "Acme Studio" }),
|
|
128
|
+
links: z
|
|
129
|
+
.object({
|
|
130
|
+
url: z
|
|
131
|
+
.union([
|
|
132
|
+
z.url({ message: "Please enter a valid URL" }),
|
|
133
|
+
z.literal(""),
|
|
134
|
+
])
|
|
135
|
+
.optional(),
|
|
136
|
+
type: z.enum(LINK_TYPES).optional(),
|
|
137
|
+
})
|
|
138
|
+
.array()
|
|
139
|
+
.optional(),
|
|
140
|
+
achievements: z
|
|
141
|
+
.object({
|
|
142
|
+
title: z.string(),
|
|
143
|
+
link: z.url().optional(),
|
|
144
|
+
year: z.number().int().optional(),
|
|
145
|
+
})
|
|
146
|
+
.array()
|
|
147
|
+
.optional(),
|
|
148
|
+
bio: z
|
|
149
|
+
.string()
|
|
150
|
+
.max(600)
|
|
151
|
+
.optional()
|
|
152
|
+
.openapi({ example: "Updated bio for our creative agency." }),
|
|
153
|
+
disciplineSlugs: z
|
|
154
|
+
.array(z.string())
|
|
155
|
+
.min(1, "At least one discipline is required")
|
|
156
|
+
.optional()
|
|
157
|
+
.openapi({ example: ["frontend", "ui-ux"] }),
|
|
158
|
+
})
|
|
159
|
+
.openapi({
|
|
160
|
+
title: "update brand profile",
|
|
161
|
+
});
|
|
171
162
|
|
|
172
163
|
export const GetBrandInputSchema = z.object({
|
|
173
|
-
|
|
174
|
-
|
|
164
|
+
value: z.cuid2(),
|
|
165
|
+
by: ProfileIdentifierSchema.shape.by,
|
|
175
166
|
});
|
|
176
167
|
|
|
177
168
|
export const GetBrandQuerySchema = ProfileIdentifierSchema;
|
|
@@ -183,24 +174,24 @@ export const GetBrandOutputSchema = BrandEntitySchema;
|
|
|
183
174
|
export const UpdateBrandOutputSchema = BrandEntitySchema;
|
|
184
175
|
|
|
185
176
|
export const BrandWithUserEntitySchema = MinimalBrandEntitySchema.extend({
|
|
186
|
-
|
|
177
|
+
user: MinimalUserSchema,
|
|
187
178
|
});
|
|
188
179
|
|
|
189
180
|
export const SearchBrandInputSchema = z.object({
|
|
190
|
-
|
|
191
|
-
|
|
192
|
-
|
|
193
|
-
|
|
194
|
-
|
|
195
|
-
|
|
196
|
-
|
|
197
|
-
|
|
198
|
-
|
|
199
|
-
|
|
200
|
-
|
|
181
|
+
string: z
|
|
182
|
+
.string()
|
|
183
|
+
.min(1, { message: "Search string cannot be empty" })
|
|
184
|
+
.max(200, { message: "Search string cannot exceed 200 characters" }),
|
|
185
|
+
limit: z.coerce
|
|
186
|
+
.number()
|
|
187
|
+
.int({ message: "Limit must be an integer" })
|
|
188
|
+
.min(1, { message: "Limit must be at least 1" })
|
|
189
|
+
.max(100, { message: "Limit cannot exceed 100" })
|
|
190
|
+
.default(20),
|
|
191
|
+
cursor: z.string().optional(),
|
|
201
192
|
});
|
|
202
193
|
|
|
203
194
|
export const SearchBrandOutputSchema = z.object({
|
|
204
|
-
|
|
205
|
-
|
|
195
|
+
brands: z.array(BrandWithUserEntitySchema),
|
|
196
|
+
nextCursor: z.string().optional().nullable(),
|
|
206
197
|
});
|