@zyacreatives/shared 2.5.49 → 2.5.51
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 +134 -109
- package/dist/schemas/brand.js +49 -112
- package/dist/schemas/common.d.ts +25 -0
- package/dist/schemas/common.js +30 -1
- package/dist/schemas/creative.d.ts +224 -150
- package/dist/schemas/creative.js +91 -170
- package/dist/schemas/investor.d.ts +362 -261
- package/dist/schemas/investor.js +111 -211
- package/dist/schemas/job-application.d.ts +6 -6
- package/dist/schemas/notification.d.ts +12 -12
- package/dist/schemas/project.d.ts +20 -20
- package/dist/schemas/user.d.ts +265 -1161
- package/dist/schemas/user.js +141 -252
- package/package.json +1 -1
- package/src/schemas/brand.ts +73 -129
- package/src/schemas/common.ts +32 -0
- package/src/schemas/creative.ts +118 -187
- package/src/schemas/investor.ts +154 -278
- package/src/schemas/user.ts +186 -438
package/dist/schemas/creative.js
CHANGED
|
@@ -1,206 +1,127 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.SearchCreativeOutputSchema = exports.SearchCreativeInputSchema = exports.CreativeWithUserEntitySchema = exports.UpdateCreativeOutputSchema = exports.GetCreativeOutputSchema = exports.CreateCreativeOutputSchema = exports.GetCreativeQuerySchema = exports.GetCreativeInputSchema = exports.UpdateCreativeProfileInputSchema = exports.CreateCreativeProfileInputSchema = exports.
|
|
3
|
+
exports.SearchCreativeOutputSchema = exports.SearchCreativeInputSchema = exports.CreativeWithUserEntitySchema = exports.UpdateCreativeOutputSchema = exports.GetCreativeOutputSchema = exports.CreateCreativeOutputSchema = exports.GetCreativeQuerySchema = exports.GetCreativeInputSchema = exports.UpdateCreativeProfileInputSchema = exports.CreateCreativeProfileInputSchema = exports.MinimalCreativeEntitySchema = exports.CreativeEntitySchema = void 0;
|
|
4
4
|
const zod_openapi_1 = require("@hono/zod-openapi");
|
|
5
5
|
const constants_1 = require("../constants");
|
|
6
6
|
const common_1 = require("./common");
|
|
7
7
|
const user_1 = require("./user");
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
bio: zod_openapi_1.z.string().
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
experienceLevel: zod_openapi_1.z
|
|
20
|
-
.enum(Object.values(constants_1.EXPERIENCE_LEVELS))
|
|
21
|
-
.optional()
|
|
22
|
-
.openapi({ example: constants_1.EXPERIENCE_LEVELS.YEAR_0_1 }),
|
|
23
|
-
disciplines: zod_openapi_1.z
|
|
24
|
-
.array(zod_openapi_1.z.string())
|
|
25
|
-
.optional()
|
|
26
|
-
.openapi({ example: ["Design", "Art Direction"] }),
|
|
27
|
-
createdAt: zod_openapi_1.z.coerce.date().openapi({ example: "2025-10-13T09:00:00.000Z" }),
|
|
28
|
-
updatedAt: zod_openapi_1.z.coerce.date().openapi({ example: "2025-10-13T09:00:00.000Z" }),
|
|
29
|
-
});
|
|
30
|
-
// -----------------------------------------------------------------------------
|
|
31
|
-
// Full Creative Entity
|
|
32
|
-
// -----------------------------------------------------------------------------
|
|
33
|
-
exports.CreativeEntitySchema = zod_openapi_1.z
|
|
34
|
-
.object({
|
|
35
|
-
id: zod_openapi_1.z.cuid2().openapi({ example: "cre_cksd0v6q0000s9a5y8z7p3x9" }),
|
|
36
|
-
userId: zod_openapi_1.z.cuid2().openapi({ example: "user_abc123" }),
|
|
37
|
-
bio: zod_openapi_1.z.string().optional().openapi({
|
|
38
|
-
example: "A multi-disciplinary designer specializing in brand identity.",
|
|
39
|
-
}),
|
|
40
|
-
role: zod_openapi_1.z.string().optional().openapi({ example: "Designer" }),
|
|
41
|
-
version: zod_openapi_1.z.int(),
|
|
42
|
-
location: zod_openapi_1.z.string().optional().openapi({ example: "London, UK" }),
|
|
43
|
-
experienceLevel: zod_openapi_1.z
|
|
44
|
-
.enum(Object.values(constants_1.EXPERIENCE_LEVELS))
|
|
45
|
-
.optional()
|
|
46
|
-
.openapi({ example: constants_1.EXPERIENCE_LEVELS.YEAR_0_1 }),
|
|
47
|
-
disciplines: zod_openapi_1.z
|
|
48
|
-
.array(zod_openapi_1.z.string())
|
|
49
|
-
.optional()
|
|
50
|
-
.openapi({ example: ["Design", "Art Direction"] }),
|
|
8
|
+
/**
|
|
9
|
+
* --------------------------------
|
|
10
|
+
* SHAPE
|
|
11
|
+
* --------------------------------
|
|
12
|
+
*/
|
|
13
|
+
const CreativeShape = zod_openapi_1.z.object({
|
|
14
|
+
bio: zod_openapi_1.z.string().max(600).default(""),
|
|
15
|
+
role: zod_openapi_1.z.string().default(""),
|
|
16
|
+
location: zod_openapi_1.z.string().max(100).default(""),
|
|
17
|
+
experienceLevel: zod_openapi_1.z.enum(Object.values(constants_1.EXPERIENCE_LEVELS)),
|
|
18
|
+
disciplines: zod_openapi_1.z.array(zod_openapi_1.z.string()).default([]),
|
|
51
19
|
workExperience: zod_openapi_1.z
|
|
52
|
-
.object({
|
|
20
|
+
.array(zod_openapi_1.z.object({
|
|
53
21
|
companyName: zod_openapi_1.z.string(),
|
|
54
22
|
position: zod_openapi_1.z.string(),
|
|
55
|
-
startDate: zod_openapi_1.z.
|
|
56
|
-
endDate: zod_openapi_1.z.
|
|
57
|
-
currentlyWorking: zod_openapi_1.z.boolean().
|
|
58
|
-
description: zod_openapi_1.z.string(),
|
|
59
|
-
})
|
|
60
|
-
.
|
|
61
|
-
.optional(),
|
|
23
|
+
startDate: zod_openapi_1.z.string().datetime().optional(),
|
|
24
|
+
endDate: zod_openapi_1.z.string().datetime().optional(),
|
|
25
|
+
currentlyWorking: zod_openapi_1.z.boolean().default(false),
|
|
26
|
+
description: zod_openapi_1.z.string().default(""),
|
|
27
|
+
}))
|
|
28
|
+
.default([]),
|
|
62
29
|
links: zod_openapi_1.z
|
|
63
|
-
.object({
|
|
64
|
-
url: zod_openapi_1.z.
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
]),
|
|
68
|
-
type: zod_openapi_1.z.enum(constants_1.LINK_TYPES),
|
|
69
|
-
})
|
|
70
|
-
.array()
|
|
71
|
-
.optional(),
|
|
30
|
+
.array(zod_openapi_1.z.object({
|
|
31
|
+
url: zod_openapi_1.z.url(),
|
|
32
|
+
type: zod_openapi_1.z.enum(constants_1.LINK_TYPES).default(constants_1.LINK_TYPES.GENERIC_WEBSITE),
|
|
33
|
+
}))
|
|
34
|
+
.default([]),
|
|
72
35
|
achievements: zod_openapi_1.z
|
|
73
|
-
.object({
|
|
36
|
+
.array(zod_openapi_1.z.object({
|
|
74
37
|
title: zod_openapi_1.z.string(),
|
|
75
|
-
link: zod_openapi_1.z.
|
|
76
|
-
year: zod_openapi_1.z.
|
|
77
|
-
})
|
|
78
|
-
.
|
|
79
|
-
.optional(),
|
|
80
|
-
createdAt: zod_openapi_1.z.coerce
|
|
81
|
-
.date()
|
|
82
|
-
.optional()
|
|
83
|
-
.openapi({ example: "2025-10-13T09:00:00.000Z" }),
|
|
84
|
-
updatedAt: zod_openapi_1.z.coerce.date().openapi({ example: "2025-10-13T09:00:00.000Z" }),
|
|
85
|
-
})
|
|
86
|
-
.openapi({
|
|
87
|
-
title: "CreativeEntitySchema",
|
|
88
|
-
description: "Represents a creative profile, including bio, experience level, location, disciplines and timestamps.",
|
|
38
|
+
link: zod_openapi_1.z.url().optional(),
|
|
39
|
+
year: zod_openapi_1.z.number().int().optional(),
|
|
40
|
+
}))
|
|
41
|
+
.default([]),
|
|
89
42
|
});
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
43
|
+
/**
|
|
44
|
+
* --------------------------------
|
|
45
|
+
* ENTITY (DTO)
|
|
46
|
+
* --------------------------------
|
|
47
|
+
*/
|
|
48
|
+
exports.CreativeEntitySchema = zod_openapi_1.z
|
|
94
49
|
.object({
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
.string()
|
|
102
|
-
.max(100)
|
|
103
|
-
.describe("Primary location where the creative works or resides.")
|
|
104
|
-
.openapi({ example: "Lagos, Nigeria" }),
|
|
105
|
-
disciplineSlugs: zod_openapi_1.z
|
|
106
|
-
.array(zod_openapi_1.z.string())
|
|
107
|
-
.min(1, "At least one discipline is required")
|
|
108
|
-
.default([])
|
|
109
|
-
.describe("List of discipline slugs representing the creative’s fields.")
|
|
110
|
-
.openapi({ example: ["ui-ux", "frontend"] }),
|
|
50
|
+
id: zod_openapi_1.z.cuid2(),
|
|
51
|
+
userId: zod_openapi_1.z.cuid2(),
|
|
52
|
+
...CreativeShape.shape,
|
|
53
|
+
createdAt: zod_openapi_1.z.string().datetime(),
|
|
54
|
+
updatedAt: zod_openapi_1.z.string().datetime(),
|
|
55
|
+
version: zod_openapi_1.z.int(),
|
|
111
56
|
})
|
|
112
|
-
.openapi(
|
|
113
|
-
|
|
114
|
-
|
|
57
|
+
.openapi("Creative");
|
|
58
|
+
exports.MinimalCreativeEntitySchema = exports.CreativeEntitySchema.pick({
|
|
59
|
+
id: true,
|
|
60
|
+
userId: true,
|
|
61
|
+
bio: true,
|
|
62
|
+
role: true,
|
|
63
|
+
location: true,
|
|
64
|
+
experienceLevel: true,
|
|
65
|
+
disciplines: true,
|
|
66
|
+
createdAt: true,
|
|
67
|
+
updatedAt: true,
|
|
115
68
|
});
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
.optional()
|
|
127
|
-
.openapi({ example: "I am a freelance UI/UX designer." }),
|
|
128
|
-
location: zod_openapi_1.z
|
|
129
|
-
.string()
|
|
130
|
-
.max(100)
|
|
131
|
-
.optional()
|
|
132
|
-
.openapi({ example: "Lagos, Nigeria" }),
|
|
69
|
+
/**
|
|
70
|
+
* --------------------------------
|
|
71
|
+
* INPUT DTOs
|
|
72
|
+
* --------------------------------
|
|
73
|
+
*/
|
|
74
|
+
exports.CreateCreativeProfileInputSchema = CreativeShape.pick({
|
|
75
|
+
experienceLevel: true,
|
|
76
|
+
role: true,
|
|
77
|
+
location: true,
|
|
78
|
+
}).extend({
|
|
133
79
|
disciplineSlugs: zod_openapi_1.z
|
|
134
80
|
.array(zod_openapi_1.z.string())
|
|
135
|
-
.min(1, "At least one discipline is required")
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
companyName: zod_openapi_1.z.string(),
|
|
141
|
-
position: zod_openapi_1.z.string(),
|
|
142
|
-
startDate: zod_openapi_1.z.string().optional(),
|
|
143
|
-
endDate: zod_openapi_1.z.string().optional(),
|
|
144
|
-
currentlyWorking: zod_openapi_1.z.boolean().default(false),
|
|
145
|
-
description: zod_openapi_1.z.string().optional(),
|
|
146
|
-
})
|
|
147
|
-
.array()
|
|
148
|
-
.optional(),
|
|
149
|
-
links: zod_openapi_1.z
|
|
150
|
-
.object({
|
|
151
|
-
url: zod_openapi_1.z.union([
|
|
152
|
-
zod_openapi_1.z.url({ message: "Please enter a valid URL" }),
|
|
153
|
-
zod_openapi_1.z.literal(""),
|
|
154
|
-
]),
|
|
155
|
-
type: zod_openapi_1.z.enum(constants_1.LINK_TYPES),
|
|
156
|
-
})
|
|
157
|
-
.array()
|
|
158
|
-
.optional(),
|
|
81
|
+
.min(1, "At least one discipline is required"),
|
|
82
|
+
});
|
|
83
|
+
exports.UpdateCreativeProfileInputSchema = CreativeShape.partial()
|
|
84
|
+
.extend({
|
|
85
|
+
disciplineSlugs: zod_openapi_1.z.array(zod_openapi_1.z.string()).optional(),
|
|
159
86
|
version: zod_openapi_1.z.int(),
|
|
160
|
-
achievements: zod_openapi_1.z
|
|
161
|
-
.object({
|
|
162
|
-
title: zod_openapi_1.z.string(),
|
|
163
|
-
link: zod_openapi_1.z.string().optional(),
|
|
164
|
-
year: zod_openapi_1.z.coerce.number().int().optional(),
|
|
165
|
-
})
|
|
166
|
-
.array()
|
|
167
|
-
.optional(),
|
|
168
87
|
})
|
|
169
|
-
.
|
|
170
|
-
|
|
88
|
+
.refine((d) => Object.values(d).some((v) => v !== undefined), {
|
|
89
|
+
message: "At least one field must be provided",
|
|
171
90
|
});
|
|
172
|
-
|
|
173
|
-
|
|
174
|
-
|
|
91
|
+
/**
|
|
92
|
+
* --------------------------------
|
|
93
|
+
* GET
|
|
94
|
+
* --------------------------------
|
|
95
|
+
*/
|
|
175
96
|
exports.GetCreativeInputSchema = zod_openapi_1.z.object({
|
|
176
97
|
value: zod_openapi_1.z.cuid2(),
|
|
177
98
|
by: common_1.ProfileIdentifierSchema.shape.by,
|
|
178
99
|
});
|
|
179
100
|
exports.GetCreativeQuerySchema = common_1.ProfileIdentifierSchema;
|
|
180
|
-
|
|
101
|
+
/**
|
|
102
|
+
* --------------------------------
|
|
103
|
+
* OUTPUT ALIASES
|
|
104
|
+
* --------------------------------
|
|
105
|
+
*/
|
|
181
106
|
exports.CreateCreativeOutputSchema = exports.CreativeEntitySchema;
|
|
182
107
|
exports.GetCreativeOutputSchema = exports.CreativeEntitySchema;
|
|
183
108
|
exports.UpdateCreativeOutputSchema = exports.CreativeEntitySchema;
|
|
184
|
-
|
|
185
|
-
|
|
186
|
-
|
|
109
|
+
/**
|
|
110
|
+
* --------------------------------
|
|
111
|
+
* ENTITY WITH USER
|
|
112
|
+
* --------------------------------
|
|
113
|
+
*/
|
|
187
114
|
exports.CreativeWithUserEntitySchema = exports.MinimalCreativeEntitySchema.extend({
|
|
188
115
|
user: user_1.MinimalUserSchema,
|
|
189
116
|
});
|
|
190
|
-
|
|
191
|
-
|
|
192
|
-
|
|
117
|
+
/**
|
|
118
|
+
* --------------------------------
|
|
119
|
+
* SEARCH
|
|
120
|
+
* --------------------------------
|
|
121
|
+
*/
|
|
193
122
|
exports.SearchCreativeInputSchema = zod_openapi_1.z.object({
|
|
194
|
-
string: zod_openapi_1.z
|
|
195
|
-
|
|
196
|
-
.min(1, { message: "Search string cannot be empty" })
|
|
197
|
-
.max(200, { message: "Search string cannot exceed 200 characters" }),
|
|
198
|
-
limit: zod_openapi_1.z.coerce
|
|
199
|
-
.number()
|
|
200
|
-
.int({ message: "Limit must be an integer" })
|
|
201
|
-
.min(1, { message: "Limit must be at least 1" })
|
|
202
|
-
.max(100, { message: "Limit cannot exceed 100" })
|
|
203
|
-
.default(20),
|
|
123
|
+
string: zod_openapi_1.z.string().min(1).max(200),
|
|
124
|
+
limit: zod_openapi_1.z.coerce.number().int().min(1).max(100).default(20),
|
|
204
125
|
cursor: zod_openapi_1.z.string().optional(),
|
|
205
126
|
});
|
|
206
127
|
exports.SearchCreativeOutputSchema = zod_openapi_1.z.object({
|