@zyacreatives/shared 2.1.84 → 2.1.86
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/README.md +1 -1
- package/dist/schemas/post.d.ts +26 -0
- package/dist/schemas/post.js +24 -1
- package/dist/types/post.d.ts +2 -1
- package/package.json +1 -1
- package/src/constants.ts +483 -483
- package/src/index.ts +4 -4
- package/src/schemas/activity.ts +14 -14
- package/src/schemas/auth.ts +43 -43
- package/src/schemas/bookmark.ts +38 -38
- package/src/schemas/brand.ts +146 -146
- package/src/schemas/chat.ts +31 -31
- package/src/schemas/comment.ts +60 -60
- package/src/schemas/common.ts +22 -22
- package/src/schemas/creative.ts +222 -222
- package/src/schemas/discipline.ts +88 -88
- package/src/schemas/entity-stats.ts +43 -43
- package/src/schemas/feed.ts +11 -11
- package/src/schemas/file.ts +61 -61
- package/src/schemas/index.ts +21 -21
- package/src/schemas/investor.ts +211 -211
- package/src/schemas/job-application.ts +257 -257
- package/src/schemas/job.ts +364 -364
- package/src/schemas/like.ts +38 -38
- package/src/schemas/message.ts +112 -112
- package/src/schemas/notification.ts +71 -71
- package/src/schemas/post.ts +279 -255
- package/src/schemas/project.ts +298 -298
- package/src/schemas/user-strike.ts +21 -21
- package/src/schemas/user.ts +283 -283
- package/src/schemas/username.ts +11 -11
- package/src/schemas/view.ts +50 -50
- package/src/types/auth.ts +5 -5
- package/src/types/bookmark.ts +4 -4
- package/src/types/brand.ts +37 -37
- package/src/types/chat.ts +21 -21
- package/src/types/comment.ts +12 -12
- package/src/types/common.ts +9 -9
- package/src/types/creative.ts +33 -33
- package/src/types/discipline.ts +32 -32
- package/src/types/entity-stats.ts +4 -4
- package/src/types/feed.ts +5 -5
- package/src/types/file.ts +39 -39
- package/src/types/index.ts +22 -22
- package/src/types/investor.ts +34 -34
- package/src/types/job-application.ts +41 -41
- package/src/types/job.ts +71 -71
- package/src/types/like.ts +3 -3
- package/src/types/message.ts +23 -23
- package/src/types/notification.ts +34 -34
- package/src/types/post.ts +63 -60
- package/src/types/project.ts +65 -65
- package/src/types/user-strike.ts +10 -10
- package/src/types/user.ts +96 -96
- package/src/types/username.ts +4 -4
- package/src/utils/slugify.ts +10 -10
- package/tsconfig.json +13 -13
package/src/schemas/investor.ts
CHANGED
|
@@ -1,211 +1,211 @@
|
|
|
1
|
-
import { z } from "@hono/zod-openapi";
|
|
2
|
-
import {
|
|
3
|
-
EXPERIENCE_LEVELS,
|
|
4
|
-
ExperienceLevel,
|
|
5
|
-
GEOGRAPHIC_FOCUS,
|
|
6
|
-
GeographicFocus,
|
|
7
|
-
INVESTMENT_SIZES,
|
|
8
|
-
InvestmentSize,
|
|
9
|
-
INVESTOR_TYPES,
|
|
10
|
-
InvestorType,
|
|
11
|
-
} from "../constants";
|
|
12
|
-
import { CuidSchema, ProfileIdentifierSchema } from "./common";
|
|
13
|
-
|
|
14
|
-
export const InvestorEntitySchema = z
|
|
15
|
-
.object({
|
|
16
|
-
id: z.cuid2().openapi({ example: "inv_cksd0v6q0000s9a5y8z7p3x9" }),
|
|
17
|
-
userId: z.cuid2().openapi({ example: "user_owner_123" }),
|
|
18
|
-
bio: z
|
|
19
|
-
.string()
|
|
20
|
-
.optional()
|
|
21
|
-
.openapi({ example: "Early stage VC focusing on creative technology." }),
|
|
22
|
-
location: z.string().optional().openapi({ example: "New York, USA" }),
|
|
23
|
-
experienceLevel: z
|
|
24
|
-
.enum(
|
|
25
|
-
Object.values(EXPERIENCE_LEVELS) as [
|
|
26
|
-
ExperienceLevel,
|
|
27
|
-
...ExperienceLevel[],
|
|
28
|
-
],
|
|
29
|
-
)
|
|
30
|
-
.optional()
|
|
31
|
-
.openapi({ example: "EXPERT" }),
|
|
32
|
-
geographicFocus: z
|
|
33
|
-
.enum(
|
|
34
|
-
Object.values(GEOGRAPHIC_FOCUS) as [
|
|
35
|
-
GeographicFocus,
|
|
36
|
-
...GeographicFocus[],
|
|
37
|
-
],
|
|
38
|
-
)
|
|
39
|
-
.optional()
|
|
40
|
-
.openapi({ example: "NORTH_AMERICA" }),
|
|
41
|
-
investmentSize: z
|
|
42
|
-
.enum(
|
|
43
|
-
Object.values(INVESTMENT_SIZES) as [
|
|
44
|
-
InvestmentSize,
|
|
45
|
-
...InvestmentSize[],
|
|
46
|
-
],
|
|
47
|
-
)
|
|
48
|
-
.optional()
|
|
49
|
-
.openapi({ example: "SEED" }),
|
|
50
|
-
investorType: z
|
|
51
|
-
.enum(Object.values(INVESTOR_TYPES) as [InvestorType, ...InvestorType[]])
|
|
52
|
-
.optional()
|
|
53
|
-
.openapi({ example: "VC" }),
|
|
54
|
-
websiteURL: z
|
|
55
|
-
.url()
|
|
56
|
-
.optional()
|
|
57
|
-
.openapi({ example: "https://investorpartners.com" }),
|
|
58
|
-
disciplines: z
|
|
59
|
-
.array(z.string())
|
|
60
|
-
.optional()
|
|
61
|
-
.openapi({ example: ["Product Design", "AI Strategy"] }),
|
|
62
|
-
createdAt: z.coerce
|
|
63
|
-
.date()
|
|
64
|
-
.optional()
|
|
65
|
-
.openapi({ example: "2025-10-13T09:00:00.000Z" }),
|
|
66
|
-
updatedAt: z.coerce
|
|
67
|
-
.date()
|
|
68
|
-
.optional()
|
|
69
|
-
.openapi({ example: "2025-10-13T09:00:00.000Z" }),
|
|
70
|
-
version: z.int(),
|
|
71
|
-
})
|
|
72
|
-
.openapi("InvestorEntity");
|
|
73
|
-
|
|
74
|
-
export const CreateInvestorProfileInputSchema = z
|
|
75
|
-
.object({
|
|
76
|
-
bio: z.string().max(600).optional().openapi({
|
|
77
|
-
example: "Angel investor backing early-stage African startups.",
|
|
78
|
-
}),
|
|
79
|
-
websiteURL: z.url("Invalid url").optional().openapi({
|
|
80
|
-
example: "https://www.investorportfolio.com",
|
|
81
|
-
}),
|
|
82
|
-
experienceLevel: z
|
|
83
|
-
.enum(
|
|
84
|
-
Object.values(EXPERIENCE_LEVELS) as [
|
|
85
|
-
ExperienceLevel,
|
|
86
|
-
...ExperienceLevel[],
|
|
87
|
-
],
|
|
88
|
-
)
|
|
89
|
-
.default(EXPERIENCE_LEVELS.YEAR_0_1)
|
|
90
|
-
.openapi({
|
|
91
|
-
example: "0-1 year",
|
|
92
|
-
}),
|
|
93
|
-
location: z.string().openapi({
|
|
94
|
-
example: "UK",
|
|
95
|
-
}),
|
|
96
|
-
})
|
|
97
|
-
.openapi({
|
|
98
|
-
title: "Create Investor Profile",
|
|
99
|
-
});
|
|
100
|
-
|
|
101
|
-
export const UpdateInvestorProfileInputSchema = z
|
|
102
|
-
.object({
|
|
103
|
-
bio: z.string().max(600).optional().openapi({
|
|
104
|
-
example: "Seasoned venture capitalist with a focus on healthtech.",
|
|
105
|
-
}),
|
|
106
|
-
websiteURL: z.url("Invalid url").optional().openapi({
|
|
107
|
-
example: "https://www.vcgroup.com",
|
|
108
|
-
}),
|
|
109
|
-
experienceLevel: z
|
|
110
|
-
.enum(
|
|
111
|
-
Object.values(EXPERIENCE_LEVELS) as [
|
|
112
|
-
ExperienceLevel,
|
|
113
|
-
...ExperienceLevel[],
|
|
114
|
-
],
|
|
115
|
-
)
|
|
116
|
-
.optional()
|
|
117
|
-
.openapi({
|
|
118
|
-
example: "SENIOR",
|
|
119
|
-
}),
|
|
120
|
-
investorType: z
|
|
121
|
-
.enum(Object.values(INVESTOR_TYPES) as [InvestorType, ...InvestorType[]])
|
|
122
|
-
.optional()
|
|
123
|
-
.openapi({
|
|
124
|
-
example: "VC",
|
|
125
|
-
}),
|
|
126
|
-
disciplineSlugs: z
|
|
127
|
-
.array(z.string())
|
|
128
|
-
.min(1, "At least one discipline is required")
|
|
129
|
-
.optional()
|
|
130
|
-
.openapi({
|
|
131
|
-
example: ["fintech", "edtech"],
|
|
132
|
-
}),
|
|
133
|
-
investmentSize: z
|
|
134
|
-
.enum(
|
|
135
|
-
Object.values(INVESTMENT_SIZES) as [
|
|
136
|
-
InvestmentSize,
|
|
137
|
-
...InvestmentSize[],
|
|
138
|
-
],
|
|
139
|
-
)
|
|
140
|
-
.optional()
|
|
141
|
-
.openapi({
|
|
142
|
-
example: "SEED",
|
|
143
|
-
}),
|
|
144
|
-
geographicFocus: z
|
|
145
|
-
.enum(
|
|
146
|
-
Object.values(GEOGRAPHIC_FOCUS) as [
|
|
147
|
-
GeographicFocus,
|
|
148
|
-
...GeographicFocus[],
|
|
149
|
-
],
|
|
150
|
-
)
|
|
151
|
-
.optional()
|
|
152
|
-
.openapi({
|
|
153
|
-
example: "GLOBAL",
|
|
154
|
-
}),
|
|
155
|
-
location: z.string().optional().openapi({
|
|
156
|
-
example: "UK",
|
|
157
|
-
}),
|
|
158
|
-
version: z.int(),
|
|
159
|
-
})
|
|
160
|
-
.openapi({
|
|
161
|
-
title: "Update Investor Profile",
|
|
162
|
-
});
|
|
163
|
-
|
|
164
|
-
export const ListInvestorsInputSchema = z
|
|
165
|
-
.object({
|
|
166
|
-
query: z.string().optional().openapi({ example: "creative tech investor" }),
|
|
167
|
-
disciplines: z
|
|
168
|
-
.array(z.string())
|
|
169
|
-
.optional()
|
|
170
|
-
.openapi({ example: ["branding", "UX"] }),
|
|
171
|
-
experienceLevels: z
|
|
172
|
-
.array(
|
|
173
|
-
z.enum(
|
|
174
|
-
Object.values(EXPERIENCE_LEVELS) as [
|
|
175
|
-
ExperienceLevel,
|
|
176
|
-
...ExperienceLevel[],
|
|
177
|
-
],
|
|
178
|
-
),
|
|
179
|
-
)
|
|
180
|
-
.optional()
|
|
181
|
-
.openapi({
|
|
182
|
-
description: "Filter based on the required experience level.",
|
|
183
|
-
}),
|
|
184
|
-
location: z.string().optional().openapi({ example: "San Francisco" }),
|
|
185
|
-
tags: z
|
|
186
|
-
.array(z.string())
|
|
187
|
-
.optional()
|
|
188
|
-
.openapi({ example: ["design", "future"] }),
|
|
189
|
-
page: z.number().int().min(1).default(1).optional().openapi({ example: 1 }),
|
|
190
|
-
perPage: z
|
|
191
|
-
.number()
|
|
192
|
-
.int()
|
|
193
|
-
.min(1)
|
|
194
|
-
.max(100)
|
|
195
|
-
.default(20)
|
|
196
|
-
.optional()
|
|
197
|
-
.openapi({ example: 20 }),
|
|
198
|
-
})
|
|
199
|
-
.openapi("ListInvestorsInput");
|
|
200
|
-
|
|
201
|
-
export const GetInvestorParamsSchema = z.object({
|
|
202
|
-
value: CuidSchema,
|
|
203
|
-
});
|
|
204
|
-
|
|
205
|
-
export const GetInvestorQuerySchema = ProfileIdentifierSchema;
|
|
206
|
-
|
|
207
|
-
export const CreateInvestorOutputSchema = InvestorEntitySchema;
|
|
208
|
-
|
|
209
|
-
export const GetInvestorOutputSchema = InvestorEntitySchema;
|
|
210
|
-
|
|
211
|
-
export const UpdateInvestorOutputSchema = InvestorEntitySchema;
|
|
1
|
+
import { z } from "@hono/zod-openapi";
|
|
2
|
+
import {
|
|
3
|
+
EXPERIENCE_LEVELS,
|
|
4
|
+
ExperienceLevel,
|
|
5
|
+
GEOGRAPHIC_FOCUS,
|
|
6
|
+
GeographicFocus,
|
|
7
|
+
INVESTMENT_SIZES,
|
|
8
|
+
InvestmentSize,
|
|
9
|
+
INVESTOR_TYPES,
|
|
10
|
+
InvestorType,
|
|
11
|
+
} from "../constants";
|
|
12
|
+
import { CuidSchema, ProfileIdentifierSchema } from "./common";
|
|
13
|
+
|
|
14
|
+
export const InvestorEntitySchema = z
|
|
15
|
+
.object({
|
|
16
|
+
id: z.cuid2().openapi({ example: "inv_cksd0v6q0000s9a5y8z7p3x9" }),
|
|
17
|
+
userId: z.cuid2().openapi({ example: "user_owner_123" }),
|
|
18
|
+
bio: z
|
|
19
|
+
.string()
|
|
20
|
+
.optional()
|
|
21
|
+
.openapi({ example: "Early stage VC focusing on creative technology." }),
|
|
22
|
+
location: z.string().optional().openapi({ example: "New York, USA" }),
|
|
23
|
+
experienceLevel: z
|
|
24
|
+
.enum(
|
|
25
|
+
Object.values(EXPERIENCE_LEVELS) as [
|
|
26
|
+
ExperienceLevel,
|
|
27
|
+
...ExperienceLevel[],
|
|
28
|
+
],
|
|
29
|
+
)
|
|
30
|
+
.optional()
|
|
31
|
+
.openapi({ example: "EXPERT" }),
|
|
32
|
+
geographicFocus: z
|
|
33
|
+
.enum(
|
|
34
|
+
Object.values(GEOGRAPHIC_FOCUS) as [
|
|
35
|
+
GeographicFocus,
|
|
36
|
+
...GeographicFocus[],
|
|
37
|
+
],
|
|
38
|
+
)
|
|
39
|
+
.optional()
|
|
40
|
+
.openapi({ example: "NORTH_AMERICA" }),
|
|
41
|
+
investmentSize: z
|
|
42
|
+
.enum(
|
|
43
|
+
Object.values(INVESTMENT_SIZES) as [
|
|
44
|
+
InvestmentSize,
|
|
45
|
+
...InvestmentSize[],
|
|
46
|
+
],
|
|
47
|
+
)
|
|
48
|
+
.optional()
|
|
49
|
+
.openapi({ example: "SEED" }),
|
|
50
|
+
investorType: z
|
|
51
|
+
.enum(Object.values(INVESTOR_TYPES) as [InvestorType, ...InvestorType[]])
|
|
52
|
+
.optional()
|
|
53
|
+
.openapi({ example: "VC" }),
|
|
54
|
+
websiteURL: z
|
|
55
|
+
.url()
|
|
56
|
+
.optional()
|
|
57
|
+
.openapi({ example: "https://investorpartners.com" }),
|
|
58
|
+
disciplines: z
|
|
59
|
+
.array(z.string())
|
|
60
|
+
.optional()
|
|
61
|
+
.openapi({ example: ["Product Design", "AI Strategy"] }),
|
|
62
|
+
createdAt: z.coerce
|
|
63
|
+
.date()
|
|
64
|
+
.optional()
|
|
65
|
+
.openapi({ example: "2025-10-13T09:00:00.000Z" }),
|
|
66
|
+
updatedAt: z.coerce
|
|
67
|
+
.date()
|
|
68
|
+
.optional()
|
|
69
|
+
.openapi({ example: "2025-10-13T09:00:00.000Z" }),
|
|
70
|
+
version: z.int(),
|
|
71
|
+
})
|
|
72
|
+
.openapi("InvestorEntity");
|
|
73
|
+
|
|
74
|
+
export const CreateInvestorProfileInputSchema = z
|
|
75
|
+
.object({
|
|
76
|
+
bio: z.string().max(600).optional().openapi({
|
|
77
|
+
example: "Angel investor backing early-stage African startups.",
|
|
78
|
+
}),
|
|
79
|
+
websiteURL: z.url("Invalid url").optional().openapi({
|
|
80
|
+
example: "https://www.investorportfolio.com",
|
|
81
|
+
}),
|
|
82
|
+
experienceLevel: z
|
|
83
|
+
.enum(
|
|
84
|
+
Object.values(EXPERIENCE_LEVELS) as [
|
|
85
|
+
ExperienceLevel,
|
|
86
|
+
...ExperienceLevel[],
|
|
87
|
+
],
|
|
88
|
+
)
|
|
89
|
+
.default(EXPERIENCE_LEVELS.YEAR_0_1)
|
|
90
|
+
.openapi({
|
|
91
|
+
example: "0-1 year",
|
|
92
|
+
}),
|
|
93
|
+
location: z.string().openapi({
|
|
94
|
+
example: "UK",
|
|
95
|
+
}),
|
|
96
|
+
})
|
|
97
|
+
.openapi({
|
|
98
|
+
title: "Create Investor Profile",
|
|
99
|
+
});
|
|
100
|
+
|
|
101
|
+
export const UpdateInvestorProfileInputSchema = z
|
|
102
|
+
.object({
|
|
103
|
+
bio: z.string().max(600).optional().openapi({
|
|
104
|
+
example: "Seasoned venture capitalist with a focus on healthtech.",
|
|
105
|
+
}),
|
|
106
|
+
websiteURL: z.url("Invalid url").optional().openapi({
|
|
107
|
+
example: "https://www.vcgroup.com",
|
|
108
|
+
}),
|
|
109
|
+
experienceLevel: z
|
|
110
|
+
.enum(
|
|
111
|
+
Object.values(EXPERIENCE_LEVELS) as [
|
|
112
|
+
ExperienceLevel,
|
|
113
|
+
...ExperienceLevel[],
|
|
114
|
+
],
|
|
115
|
+
)
|
|
116
|
+
.optional()
|
|
117
|
+
.openapi({
|
|
118
|
+
example: "SENIOR",
|
|
119
|
+
}),
|
|
120
|
+
investorType: z
|
|
121
|
+
.enum(Object.values(INVESTOR_TYPES) as [InvestorType, ...InvestorType[]])
|
|
122
|
+
.optional()
|
|
123
|
+
.openapi({
|
|
124
|
+
example: "VC",
|
|
125
|
+
}),
|
|
126
|
+
disciplineSlugs: z
|
|
127
|
+
.array(z.string())
|
|
128
|
+
.min(1, "At least one discipline is required")
|
|
129
|
+
.optional()
|
|
130
|
+
.openapi({
|
|
131
|
+
example: ["fintech", "edtech"],
|
|
132
|
+
}),
|
|
133
|
+
investmentSize: z
|
|
134
|
+
.enum(
|
|
135
|
+
Object.values(INVESTMENT_SIZES) as [
|
|
136
|
+
InvestmentSize,
|
|
137
|
+
...InvestmentSize[],
|
|
138
|
+
],
|
|
139
|
+
)
|
|
140
|
+
.optional()
|
|
141
|
+
.openapi({
|
|
142
|
+
example: "SEED",
|
|
143
|
+
}),
|
|
144
|
+
geographicFocus: z
|
|
145
|
+
.enum(
|
|
146
|
+
Object.values(GEOGRAPHIC_FOCUS) as [
|
|
147
|
+
GeographicFocus,
|
|
148
|
+
...GeographicFocus[],
|
|
149
|
+
],
|
|
150
|
+
)
|
|
151
|
+
.optional()
|
|
152
|
+
.openapi({
|
|
153
|
+
example: "GLOBAL",
|
|
154
|
+
}),
|
|
155
|
+
location: z.string().optional().openapi({
|
|
156
|
+
example: "UK",
|
|
157
|
+
}),
|
|
158
|
+
version: z.int(),
|
|
159
|
+
})
|
|
160
|
+
.openapi({
|
|
161
|
+
title: "Update Investor Profile",
|
|
162
|
+
});
|
|
163
|
+
|
|
164
|
+
export const ListInvestorsInputSchema = z
|
|
165
|
+
.object({
|
|
166
|
+
query: z.string().optional().openapi({ example: "creative tech investor" }),
|
|
167
|
+
disciplines: z
|
|
168
|
+
.array(z.string())
|
|
169
|
+
.optional()
|
|
170
|
+
.openapi({ example: ["branding", "UX"] }),
|
|
171
|
+
experienceLevels: z
|
|
172
|
+
.array(
|
|
173
|
+
z.enum(
|
|
174
|
+
Object.values(EXPERIENCE_LEVELS) as [
|
|
175
|
+
ExperienceLevel,
|
|
176
|
+
...ExperienceLevel[],
|
|
177
|
+
],
|
|
178
|
+
),
|
|
179
|
+
)
|
|
180
|
+
.optional()
|
|
181
|
+
.openapi({
|
|
182
|
+
description: "Filter based on the required experience level.",
|
|
183
|
+
}),
|
|
184
|
+
location: z.string().optional().openapi({ example: "San Francisco" }),
|
|
185
|
+
tags: z
|
|
186
|
+
.array(z.string())
|
|
187
|
+
.optional()
|
|
188
|
+
.openapi({ example: ["design", "future"] }),
|
|
189
|
+
page: z.number().int().min(1).default(1).optional().openapi({ example: 1 }),
|
|
190
|
+
perPage: z
|
|
191
|
+
.number()
|
|
192
|
+
.int()
|
|
193
|
+
.min(1)
|
|
194
|
+
.max(100)
|
|
195
|
+
.default(20)
|
|
196
|
+
.optional()
|
|
197
|
+
.openapi({ example: 20 }),
|
|
198
|
+
})
|
|
199
|
+
.openapi("ListInvestorsInput");
|
|
200
|
+
|
|
201
|
+
export const GetInvestorParamsSchema = z.object({
|
|
202
|
+
value: CuidSchema,
|
|
203
|
+
});
|
|
204
|
+
|
|
205
|
+
export const GetInvestorQuerySchema = ProfileIdentifierSchema;
|
|
206
|
+
|
|
207
|
+
export const CreateInvestorOutputSchema = InvestorEntitySchema;
|
|
208
|
+
|
|
209
|
+
export const GetInvestorOutputSchema = InvestorEntitySchema;
|
|
210
|
+
|
|
211
|
+
export const UpdateInvestorOutputSchema = InvestorEntitySchema;
|