@zyacreatives/shared 1.1.4 → 1.2.2

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.
@@ -0,0 +1,153 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.ProjectUpdateOutputEntitySchema = exports.ProjectBookmarkEntitySchema = exports.ProjectCommentEntitySchema = exports.ProjectLikeEntitySchema = exports.ProjectViewEntitySchema = exports.ProjectWithFilesEntitySchema = exports.UserSocialGraphEntitySchema = exports.ProjectSocialGraphEntitySchema = exports.ProjectFileEntitySchema = exports.ProjectEntitySchema = void 0;
4
+ const zod_openapi_1 = require("@hono/zod-openapi");
5
+ const constants_1 = require("../constants");
6
+ exports.ProjectEntitySchema = zod_openapi_1.z
7
+ .object({
8
+ id: zod_openapi_1.z.cuid2().openapi({ example: "cksd0v6q0000s9a5y8z7p3x9" }),
9
+ createdAt: zod_openapi_1.z.coerce
10
+ .date()
11
+ .optional()
12
+ .openapi({ example: "2025-10-13T09:00:00.000Z" }),
13
+ updatedAt: zod_openapi_1.z.coerce
14
+ .date()
15
+ .optional()
16
+ .openapi({ example: "2025-10-13T09:00:00.000Z" }),
17
+ userId: zod_openapi_1.z.cuid2().openapi({ example: "cksd0v6q0000s9a5y8z7p3x9" }),
18
+ title: zod_openapi_1.z.string().openapi({ example: "Brand Identity Design" }),
19
+ description: zod_openapi_1.z
20
+ .string()
21
+ .optional()
22
+ .openapi({ example: "A full rebrand for a fashion label." }),
23
+ overview: zod_openapi_1.z
24
+ .string()
25
+ .optional()
26
+ .openapi({ example: "Detailed project story and outcomes." }),
27
+ url: zod_openapi_1.z
28
+ .string()
29
+ .url()
30
+ .optional()
31
+ .openapi({ example: "https://example.com/project" }),
32
+ clientId: zod_openapi_1.z.string().optional().openapi({ example: "client_abc123" }),
33
+ clientType: zod_openapi_1.z
34
+ .enum(Object.values(constants_1.CLIENT_TYPES))
35
+ .optional()
36
+ .openapi({ example: "BRAND" }),
37
+ clientName: zod_openapi_1.z.string().optional().openapi({ example: "Nike" }),
38
+ projectCreatorType: zod_openapi_1.z
39
+ .enum(Object.values(constants_1.ROLES))
40
+ .openapi({ example: "CREATIVE" }),
41
+ tags: zod_openapi_1.z
42
+ .array(zod_openapi_1.z.string())
43
+ .optional()
44
+ .openapi({ example: ["branding", "logo"] }),
45
+ isFeatured: zod_openapi_1.z.boolean().optional().openapi({ example: false }),
46
+ startDate: zod_openapi_1.z.coerce
47
+ .date()
48
+ .optional()
49
+ .openapi({ example: "2025-06-01T00:00:00.000Z" }),
50
+ endDate: zod_openapi_1.z.coerce
51
+ .date()
52
+ .optional()
53
+ .openapi({ example: "2025-07-15T00:00:00.000Z" }),
54
+ imagePlaceholderUrl: zod_openapi_1.z
55
+ .string()
56
+ .url()
57
+ .optional()
58
+ .openapi({ example: "https://example.com/project-image.png" }),
59
+ })
60
+ .openapi("ProjectEntity");
61
+ exports.ProjectFileEntitySchema = zod_openapi_1.z
62
+ .object({
63
+ id: zod_openapi_1.z.cuid2().openapi({ example: "pfe_cksd0v6q0000s9a5y8z7p3x9" }),
64
+ projectId: zod_openapi_1.z.cuid2().openapi({ example: "cksd0v6q0000s9a5y8z7p3x9" }),
65
+ url: zod_openapi_1.z
66
+ .string()
67
+ .url()
68
+ .openapi({ example: "https://cdn.example.com/project/image.jpg" }),
69
+ mimeType: zod_openapi_1.z.string().openapi({ example: "image/jpeg" }),
70
+ fileSize: zod_openapi_1.z.number().int().positive().openapi({ example: 1500000 }), // size in bytes
71
+ })
72
+ .openapi("ProjectFileEntity");
73
+ exports.ProjectSocialGraphEntitySchema = zod_openapi_1.z
74
+ .object({
75
+ noOfLikes: zod_openapi_1.z.number().int().optional().openapi({ example: 150 }),
76
+ noOfComments: zod_openapi_1.z.number().int().optional().openapi({ example: 45 }),
77
+ noOfBookmarks: zod_openapi_1.z.number().int().optional().openapi({ example: 22 }),
78
+ noOfViews: zod_openapi_1.z.number().int().optional().openapi({ example: 1200 }),
79
+ })
80
+ .openapi("ProjectSocialGraphEntity");
81
+ exports.UserSocialGraphEntitySchema = zod_openapi_1.z
82
+ .object({
83
+ followerCount: zod_openapi_1.z.number().int().optional().openapi({ example: 5000 }),
84
+ followingCount: zod_openapi_1.z.number().int().optional().openapi({ example: 150 }),
85
+ })
86
+ .openapi("UserSocialGraphEntity");
87
+ exports.ProjectWithFilesEntitySchema = exports.ProjectEntitySchema.merge(exports.ProjectSocialGraphEntitySchema)
88
+ .extend({
89
+ projectFiles: zod_openapi_1.z
90
+ .array(exports.ProjectFileEntitySchema)
91
+ .optional()
92
+ .openapi({ description: "Files associated with the project" }),
93
+ })
94
+ .openapi("ProjectWithFilesEntity");
95
+ exports.ProjectViewEntitySchema = zod_openapi_1.z
96
+ .object({
97
+ id: zod_openapi_1.z.cuid2().openapi({ example: "view_cksd0v6q0000s9a5y8z7p3x9" }),
98
+ userId: zod_openapi_1.z.cuid2().optional().openapi({ example: "user_view_xyz" }),
99
+ ipAddress: zod_openapi_1.z.ipv4().optional().openapi({ example: "192.168.1.1" }),
100
+ userAgent: zod_openapi_1.z
101
+ .string()
102
+ .optional()
103
+ .openapi({ example: "Mozilla/5.0 (Windows NT 10.0; Win64)" }),
104
+ projectId: zod_openapi_1.z.cuid2().openapi({ example: "proj_abc456" }),
105
+ sessionId: zod_openapi_1.z.string().optional().openapi({ example: "sess_xyz789" }),
106
+ viewedAt: zod_openapi_1.z.coerce.date().openapi({ example: "2025-10-14T10:30:00.000Z" }),
107
+ viewDate: zod_openapi_1.z.coerce.date().openapi({ example: "2025-10-14T00:00:00.000Z" }),
108
+ })
109
+ .openapi("ProjectViewEntity");
110
+ exports.ProjectLikeEntitySchema = zod_openapi_1.z
111
+ .object({
112
+ createdAt: zod_openapi_1.z.coerce
113
+ .date()
114
+ .optional()
115
+ .openapi({ example: "2025-10-13T11:00:00.000Z" }),
116
+ userId: zod_openapi_1.z.cuid2().openapi({ example: "user_liker_123" }),
117
+ projectId: zod_openapi_1.z.cuid2().openapi({ example: "proj_abc456" }),
118
+ })
119
+ .openapi("ProjectLikeEntity");
120
+ exports.ProjectCommentEntitySchema = zod_openapi_1.z
121
+ .object({
122
+ id: zod_openapi_1.z.cuid2().openapi({ example: "comment_id_1" }),
123
+ createdAt: zod_openapi_1.z.coerce
124
+ .date()
125
+ .optional()
126
+ .openapi({ example: "2025-10-13T12:00:00.000Z" }),
127
+ userId: zod_openapi_1.z.cuid2().openapi({ example: "user_commenter_456" }),
128
+ projectId: zod_openapi_1.z.cuid2().openapi({ example: "proj_abc456" }),
129
+ parentCommentId: zod_openapi_1.z
130
+ .cuid2()
131
+ .optional()
132
+ .openapi({ example: "comment_id_parent_1" }),
133
+ content: zod_openapi_1.z
134
+ .string()
135
+ .min(1)
136
+ .openapi({ example: "Amazing work on the color palette!" }),
137
+ })
138
+ .openapi("ProjectCommentEntity");
139
+ exports.ProjectBookmarkEntitySchema = zod_openapi_1.z
140
+ .object({
141
+ createdAt: zod_openapi_1.z.coerce
142
+ .date()
143
+ .optional()
144
+ .openapi({ example: "2025-10-13T13:00:00.000Z" }),
145
+ userId: zod_openapi_1.z.cuid2().openapi({ example: "user_bookmark_789" }),
146
+ projectId: zod_openapi_1.z.cuid2().openapi({ example: "proj_abc456" }),
147
+ })
148
+ .openapi("ProjectBookmarkEntity");
149
+ exports.ProjectUpdateOutputEntitySchema = zod_openapi_1.z
150
+ .object({
151
+ id: zod_openapi_1.z.cuid2().openapi({ example: "cksd0v6q0000s9a5y8z7p3x9" }),
152
+ })
153
+ .openapi("ProjectUpdateOutputEntity");
@@ -1,7 +1,7 @@
1
1
  import { z } from "@hono/zod-openapi";
2
2
  export declare const BaseUserEntitySchema: z.ZodObject<{
3
3
  id: z.ZodCUID2;
4
- email: z.ZodEmail;
4
+ email: z.ZodString;
5
5
  emailVerified: z.ZodBoolean;
6
6
  name: z.ZodOptional<z.ZodString>;
7
7
  image: z.ZodOptional<z.ZodString>;
@@ -33,15 +33,15 @@ export declare const BaseUserEntitySchema: z.ZodObject<{
33
33
  INVESTOR_VERIFICATION: "INVESTOR_VERIFICATION";
34
34
  DONE: "DONE";
35
35
  }>;
36
- createdAt: z.ZodISODateTime;
37
- updatedAt: z.ZodISODateTime;
36
+ createdAt: z.ZodCoercedDate<unknown>;
37
+ updatedAt: z.ZodCoercedDate<unknown>;
38
38
  }, z.core.$strip>;
39
39
  export declare const MinimalUserSchema: z.ZodObject<{
40
40
  id: z.ZodCUID2;
41
+ username: z.ZodOptional<z.ZodString>;
42
+ email: z.ZodString;
41
43
  name: z.ZodOptional<z.ZodString>;
42
- email: z.ZodEmail;
43
44
  image: z.ZodOptional<z.ZodString>;
44
- username: z.ZodOptional<z.ZodString>;
45
45
  role: z.ZodEnum<{
46
46
  CREATIVE: "CREATIVE";
47
47
  BRAND: "BRAND";
@@ -51,7 +51,7 @@ export declare const MinimalUserSchema: z.ZodObject<{
51
51
  }, z.core.$strip>;
52
52
  export declare const UserEntitySchema: z.ZodObject<{
53
53
  id: z.ZodCUID2;
54
- email: z.ZodEmail;
54
+ email: z.ZodString;
55
55
  emailVerified: z.ZodBoolean;
56
56
  name: z.ZodOptional<z.ZodString>;
57
57
  image: z.ZodOptional<z.ZodString>;
@@ -83,14 +83,14 @@ export declare const UserEntitySchema: z.ZodObject<{
83
83
  INVESTOR_VERIFICATION: "INVESTOR_VERIFICATION";
84
84
  DONE: "DONE";
85
85
  }>;
86
- createdAt: z.ZodISODateTime;
87
- updatedAt: z.ZodISODateTime;
86
+ createdAt: z.ZodCoercedDate<unknown>;
87
+ updatedAt: z.ZodCoercedDate<unknown>;
88
88
  followerCount: z.ZodOptional<z.ZodNumber>;
89
89
  followingCount: z.ZodOptional<z.ZodNumber>;
90
90
  }, z.core.$strip>;
91
91
  export declare const UserProfileEntitySchema: z.ZodObject<{
92
92
  id: z.ZodCUID2;
93
- email: z.ZodEmail;
93
+ email: z.ZodString;
94
94
  emailVerified: z.ZodBoolean;
95
95
  name: z.ZodOptional<z.ZodString>;
96
96
  image: z.ZodOptional<z.ZodString>;
@@ -122,8 +122,8 @@ export declare const UserProfileEntitySchema: z.ZodObject<{
122
122
  INVESTOR_VERIFICATION: "INVESTOR_VERIFICATION";
123
123
  DONE: "DONE";
124
124
  }>;
125
- createdAt: z.ZodISODateTime;
126
- updatedAt: z.ZodISODateTime;
125
+ createdAt: z.ZodCoercedDate<unknown>;
126
+ updatedAt: z.ZodCoercedDate<unknown>;
127
127
  followerCount: z.ZodOptional<z.ZodNumber>;
128
128
  followingCount: z.ZodOptional<z.ZodNumber>;
129
129
  profileType: z.ZodOptional<z.ZodEnum<{
@@ -133,47 +133,111 @@ export declare const UserProfileEntitySchema: z.ZodObject<{
133
133
  }>>;
134
134
  bio: z.ZodOptional<z.ZodString>;
135
135
  location: z.ZodOptional<z.ZodString>;
136
- experienceLevel: z.ZodOptional<z.ZodEnum<{
137
- "0-1 year": "0-1 year";
138
- "1-3 years": "1-3 years";
139
- "3-5 years": "3-5 years";
140
- "5+ years": "5+ years";
141
- }>>;
142
- disciplines: z.ZodOptional<z.ZodArray<z.ZodString>>;
143
- tags: z.ZodOptional<z.ZodArray<z.ZodString>>;
136
+ experienceLevel: z.ZodOptional<z.ZodString>;
137
+ disciplines: z.ZodOptional<z.ZodArray<z.ZodAny>>;
138
+ tags: z.ZodOptional<z.ZodArray<z.ZodAny>>;
144
139
  brandName: z.ZodOptional<z.ZodString>;
145
140
  websiteURL: z.ZodOptional<z.ZodString>;
146
- investorType: z.ZodOptional<z.ZodEnum<{
147
- "Angel Investor": "Angel Investor";
148
- "Venture Capitalist": "Venture Capitalist";
149
- "Private Equity Firm": "Private Equity Firm";
150
- "Venture Debt Provider": "Venture Debt Provider";
151
- Bank: "Bank";
152
- "Convertible Note Investor": "Convertible Note Investor";
153
- "Revenue Based Financing Investor": "Revenue Based Financing Investor";
154
- "Corporate Venture Capitalist": "Corporate Venture Capitalist";
155
- Government: "Government";
156
- "Social Impact Investor": "Social Impact Investor";
157
- }>>;
158
- investmentSize: z.ZodOptional<z.ZodEnum<{
159
- "Under 5k USD": "Under 5k USD";
160
- "5k - 25k USD": "5k - 25k USD";
161
- "25k - 100k USD": "25k - 100k USD";
162
- "100k - 500k USD": "100k - 500k USD";
163
- "500k - 1M USD": "500k - 1M USD";
164
- "1M+ USD": "1M+ USD";
165
- }>>;
166
- geographicFocus: z.ZodOptional<z.ZodEnum<{
167
- Africa: "Africa";
168
- Asia: "Asia";
169
- Europe: "Europe";
170
- "North America": "North America";
171
- "South America": "South America";
172
- "Middle East": "Middle East";
173
- Oceania: "Oceania";
174
- "United Kingdom (UK)": "United Kingdom (UK)";
175
- "United States (US)": "United States (US)";
176
- Global: "Global";
177
- Other: "Other";
178
- }>>;
141
+ investorType: z.ZodOptional<z.ZodString>;
142
+ investmentSize: z.ZodOptional<z.ZodString>;
143
+ geographicFocus: z.ZodOptional<z.ZodString>;
144
+ }, z.core.$strip>;
145
+ export declare const UserWithProjectsEntitySchema: z.ZodObject<{
146
+ userId: z.ZodCUID2;
147
+ projects: z.ZodArray<z.ZodObject<{
148
+ id: z.ZodCUID2;
149
+ userId: z.ZodCUID2;
150
+ description: z.ZodOptional<z.ZodString>;
151
+ title: z.ZodString;
152
+ createdAt: z.ZodOptional<z.ZodCoercedDate<unknown>>;
153
+ updatedAt: z.ZodOptional<z.ZodCoercedDate<unknown>>;
154
+ url: z.ZodOptional<z.ZodString>;
155
+ clientId: z.ZodOptional<z.ZodString>;
156
+ clientType: z.ZodOptional<z.ZodEnum<{
157
+ CREATIVE: "CREATIVE";
158
+ BRAND: "BRAND";
159
+ NONE: "NONE";
160
+ }>>;
161
+ clientName: z.ZodOptional<z.ZodString>;
162
+ projectCreatorType: z.ZodEnum<{
163
+ CREATIVE: "CREATIVE";
164
+ BRAND: "BRAND";
165
+ INVESTOR: "INVESTOR";
166
+ ADMIN: "ADMIN";
167
+ }>;
168
+ tags: z.ZodOptional<z.ZodArray<z.ZodString>>;
169
+ isFeatured: z.ZodOptional<z.ZodBoolean>;
170
+ startDate: z.ZodOptional<z.ZodCoercedDate<unknown>>;
171
+ endDate: z.ZodOptional<z.ZodCoercedDate<unknown>>;
172
+ imagePlaceholderUrl: z.ZodOptional<z.ZodString>;
173
+ }, z.core.$strip>>;
174
+ }, z.core.$strip>;
175
+ export declare const UserWithProjectBookmarksEntitySchema: z.ZodObject<{
176
+ userId: z.ZodCUID2;
177
+ projectBookmarks: z.ZodArray<z.ZodObject<{
178
+ createdAt: z.ZodOptional<z.ZodCoercedDate<unknown>>;
179
+ userId: z.ZodCUID2;
180
+ projectId: z.ZodCUID2;
181
+ project: z.ZodObject<{
182
+ id: z.ZodCUID2;
183
+ description: z.ZodOptional<z.ZodString>;
184
+ title: z.ZodString;
185
+ tags: z.ZodOptional<z.ZodArray<z.ZodString>>;
186
+ startDate: z.ZodOptional<z.ZodCoercedDate<unknown>>;
187
+ endDate: z.ZodOptional<z.ZodCoercedDate<unknown>>;
188
+ imagePlaceholderUrl: z.ZodOptional<z.ZodString>;
189
+ }, z.core.$strip>;
190
+ }, z.core.$strip>>;
191
+ }, z.core.$strip>;
192
+ export declare const UserWithFollowingEntitySchema: z.ZodObject<{
193
+ id: z.ZodCUID2;
194
+ username: z.ZodOptional<z.ZodString>;
195
+ email: z.ZodString;
196
+ name: z.ZodOptional<z.ZodString>;
197
+ image: z.ZodOptional<z.ZodString>;
198
+ role: z.ZodEnum<{
199
+ CREATIVE: "CREATIVE";
200
+ BRAND: "BRAND";
201
+ INVESTOR: "INVESTOR";
202
+ ADMIN: "ADMIN";
203
+ }>;
204
+ following: z.ZodArray<z.ZodObject<{
205
+ id: z.ZodCUID2;
206
+ username: z.ZodOptional<z.ZodString>;
207
+ email: z.ZodString;
208
+ name: z.ZodOptional<z.ZodString>;
209
+ image: z.ZodOptional<z.ZodString>;
210
+ role: z.ZodEnum<{
211
+ CREATIVE: "CREATIVE";
212
+ BRAND: "BRAND";
213
+ INVESTOR: "INVESTOR";
214
+ ADMIN: "ADMIN";
215
+ }>;
216
+ }, z.core.$strip>>;
217
+ }, z.core.$strip>;
218
+ export declare const UserWithFollowersEntitySchema: z.ZodObject<{
219
+ id: z.ZodCUID2;
220
+ username: z.ZodOptional<z.ZodString>;
221
+ email: z.ZodString;
222
+ name: z.ZodOptional<z.ZodString>;
223
+ image: z.ZodOptional<z.ZodString>;
224
+ role: z.ZodEnum<{
225
+ CREATIVE: "CREATIVE";
226
+ BRAND: "BRAND";
227
+ INVESTOR: "INVESTOR";
228
+ ADMIN: "ADMIN";
229
+ }>;
230
+ followers: z.ZodArray<z.ZodObject<{
231
+ id: z.ZodCUID2;
232
+ username: z.ZodOptional<z.ZodString>;
233
+ email: z.ZodString;
234
+ name: z.ZodOptional<z.ZodString>;
235
+ image: z.ZodOptional<z.ZodString>;
236
+ role: z.ZodEnum<{
237
+ CREATIVE: "CREATIVE";
238
+ BRAND: "BRAND";
239
+ INVESTOR: "INVESTOR";
240
+ ADMIN: "ADMIN";
241
+ }>;
242
+ }, z.core.$strip>>;
179
243
  }, z.core.$strip>;
@@ -1,13 +1,14 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.UserProfileEntitySchema = exports.UserEntitySchema = exports.MinimalUserSchema = exports.BaseUserEntitySchema = void 0;
3
+ exports.UserWithFollowersEntitySchema = exports.UserWithFollowingEntitySchema = exports.UserWithProjectBookmarksEntitySchema = exports.UserWithProjectsEntitySchema = exports.UserProfileEntitySchema = exports.UserEntitySchema = exports.MinimalUserSchema = exports.BaseUserEntitySchema = 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
+ const project_1 = require("./project");
7
8
  exports.BaseUserEntitySchema = zod_openapi_1.z
8
9
  .object({
9
10
  id: zod_openapi_1.z.cuid2().openapi({ example: "cksd0v6q0000s9a5y8z7p3x9" }),
10
- email: zod_openapi_1.z.email().openapi({ example: "user@example.com" }),
11
+ email: zod_openapi_1.z.string().email().openapi({ example: "user@example.com" }),
11
12
  emailVerified: zod_openapi_1.z.boolean().openapi({ example: true }),
12
13
  name: zod_openapi_1.z.string().optional().openapi({ example: "John Doe" }),
13
14
  image: zod_openapi_1.z
@@ -29,12 +30,8 @@ exports.BaseUserEntitySchema = zod_openapi_1.z
29
30
  .openapi({
30
31
  example: "DONE",
31
32
  }),
32
- createdAt: zod_openapi_1.z.iso
33
- .datetime()
34
- .openapi({ example: "2025-10-13T09:00:00.000Z" }),
35
- updatedAt: zod_openapi_1.z.iso
36
- .datetime()
37
- .openapi({ example: "2025-10-13T09:00:00.000Z" }),
33
+ createdAt: zod_openapi_1.z.coerce.date().openapi({ example: "2025-10-13T09:00:00.000Z" }),
34
+ updatedAt: zod_openapi_1.z.coerce.date().openapi({ example: "2025-10-13T09:00:00.000Z" }),
38
35
  })
39
36
  .openapi("BaseUserEntity");
40
37
  exports.MinimalUserSchema = exports.BaseUserEntitySchema.pick({
@@ -47,47 +44,47 @@ exports.MinimalUserSchema = exports.BaseUserEntitySchema.pick({
47
44
  }).openapi("MinimalUser");
48
45
  exports.UserEntitySchema = exports.BaseUserEntitySchema.merge(common_1.UserSocialGraphEntitySchema).openapi("UserEntity");
49
46
  exports.UserProfileEntitySchema = exports.UserEntitySchema.extend({
50
- profileType: zod_openapi_1.z.enum(["creative", "brand", "investor"]).optional().openapi({
51
- example: "creative",
52
- }),
53
- bio: zod_openapi_1.z.string().optional().openapi({
54
- example: "Passionate digital artist focusing on UI/UX.",
55
- }),
56
- location: zod_openapi_1.z.string().optional().openapi({
57
- example: "Lagos, Nigeria",
58
- }),
59
- experienceLevel: zod_openapi_1.z
60
- .enum(Object.values(constants_1.EXPERIENCE_LEVELS))
61
- .optional()
62
- .openapi({ example: constants_1.EXPERIENCE_LEVELS.YEAR_1_3 }),
63
- disciplines: zod_openapi_1.z
64
- .array(zod_openapi_1.z.string())
65
- .optional()
66
- .openapi({
67
- example: ["ui-ux", "frontend"],
68
- }),
69
- tags: zod_openapi_1.z
70
- .array(zod_openapi_1.z.string())
71
- .optional()
72
- .openapi({
73
- example: ["react", "design", "product"],
74
- }),
75
- brandName: zod_openapi_1.z.string().optional().openapi({
76
- example: "Acme Creative Studio",
77
- }),
78
- websiteURL: zod_openapi_1.z.string().optional().openapi({
79
- example: "https://acme-creative.com",
80
- }),
81
- investorType: zod_openapi_1.z
82
- .enum(Object.values(constants_1.INVESTOR_TYPES))
83
- .optional()
84
- .openapi({ example: constants_1.INVESTOR_TYPES.ANGEL_INVESTOR }),
85
- investmentSize: zod_openapi_1.z
86
- .enum(Object.values(constants_1.INVESTMENT_SIZES))
87
- .optional()
88
- .openapi({ example: constants_1.INVESTMENT_SIZES.BETWEEN_25K_100K }),
89
- geographicFocus: zod_openapi_1.z
90
- .enum(Object.values(constants_1.GEOGRAPHIC_FOCUS))
91
- .optional()
92
- .openapi({ example: constants_1.GEOGRAPHIC_FOCUS.AFRICA }),
47
+ profileType: zod_openapi_1.z.enum(["creative", "brand", "investor"]).optional(),
48
+ bio: zod_openapi_1.z.string().optional(),
49
+ location: zod_openapi_1.z.string().optional(),
50
+ experienceLevel: zod_openapi_1.z.string().optional(),
51
+ disciplines: zod_openapi_1.z.array(zod_openapi_1.z.any()).optional(),
52
+ tags: zod_openapi_1.z.array(zod_openapi_1.z.any()).optional(),
53
+ brandName: zod_openapi_1.z.string().optional(),
54
+ websiteURL: zod_openapi_1.z.string().url().optional(),
55
+ investorType: zod_openapi_1.z.string().optional(),
56
+ investmentSize: zod_openapi_1.z.string().optional(),
57
+ geographicFocus: zod_openapi_1.z.string().optional(),
93
58
  }).openapi("UserProfileEntity");
59
+ exports.UserWithProjectsEntitySchema = zod_openapi_1.z
60
+ .object({
61
+ userId: zod_openapi_1.z.cuid2(),
62
+ projects: zod_openapi_1.z.array(project_1.ProjectEntitySchema.omit({ overview: true })),
63
+ })
64
+ .openapi("UserWithProjectsEntity");
65
+ exports.UserWithProjectBookmarksEntitySchema = zod_openapi_1.z
66
+ .object({
67
+ userId: zod_openapi_1.z.cuid2(),
68
+ projectBookmarks: zod_openapi_1.z.array(project_1.ProjectBookmarkEntitySchema.extend({
69
+ project: project_1.ProjectEntitySchema.pick({
70
+ id: true,
71
+ title: true,
72
+ description: true,
73
+ tags: true,
74
+ startDate: true,
75
+ endDate: true,
76
+ imagePlaceholderUrl: true,
77
+ }),
78
+ })),
79
+ })
80
+ .openapi("UserWithProjectBookmarksEntity");
81
+ exports.UserWithFollowingEntitySchema = exports.MinimalUserSchema.extend({
82
+ following: zod_openapi_1.z
83
+ .array(exports.MinimalUserSchema)
84
+ .openapi({ description: "List of users this user is following." }),
85
+ }).openapi("UserWithFollowingEntity");
86
+ exports.UserWithFollowersEntitySchema = exports.MinimalUserSchema.extend({
87
+ followers: zod_openapi_1.z
88
+ .array(exports.MinimalUserSchema)
89
+ .openapi({ description: "List of users who follow this user." }),
90
+ }).openapi("UserWithFollowersEntity");
@@ -0,0 +1 @@
1
+ export {};
@@ -0,0 +1,2 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
@@ -1,24 +1,16 @@
1
- import type { MinimalUser } from "./user";
2
- export type BrandEntity = {
3
- id: string;
1
+ import { z } from "@hono/zod-openapi";
2
+ import { BrandEntitySchema, BrandWithUserEntitySchema, CreateBrandEndpointResponseSchema, CreateBrandProfileSchema, GetBrandEndpointResponseSchema, GetBrandParamsSchema, GetBrandQuerySchema, ListBrandsInputSchema, UpdateBrandEndpointResponseSchema, UpdateBrandProfileSchema } from "../schemas";
3
+ export type BrandEntity = z.infer<typeof BrandEntitySchema>;
4
+ export type BrandWithUserEntity = z.infer<typeof BrandWithUserEntitySchema>;
5
+ export type ListBrandsInput = z.infer<typeof ListBrandsInputSchema>;
6
+ export type CreateBrandDto = z.infer<typeof CreateBrandProfileSchema> & {
4
7
  userId: string;
5
- brandName: string;
6
- searchVector?: string;
7
- bio?: string;
8
- tags?: string[];
9
- createdAt: Date;
10
- updatedAt: Date;
11
8
  };
12
- export type BrandWithUserEntity = BrandEntity & {
13
- user: MinimalUser;
14
- disciplines: string[];
15
- };
16
- export type ListBrandsInput = {
17
- query?: string;
18
- disciplines?: string[];
19
- experienceLevels?: string[];
20
- location?: string;
21
- tags?: string[];
22
- page?: number;
23
- perPage?: number;
9
+ export type UpdateBrandDto = z.infer<typeof UpdateBrandProfileSchema> & {
10
+ userId: string;
24
11
  };
12
+ export type GetBrandParams = z.infer<typeof GetBrandParamsSchema>;
13
+ export type GetBrandQuery = z.infer<typeof GetBrandQuerySchema>;
14
+ export type CreateBrandEndpointResponse = z.infer<typeof CreateBrandEndpointResponseSchema>;
15
+ export type GetBrandEndpointResponse = z.infer<typeof GetBrandEndpointResponseSchema>;
16
+ export type UpdateBrandEndpointResponse = z.infer<typeof UpdateBrandEndpointResponseSchema>;
@@ -1,28 +1,16 @@
1
- import type { ExperienceLevel } from "../constants";
2
- import type { MinimalUser } from "./user";
3
- export type BaseCreativeEntity = {
4
- id: string;
1
+ import { z } from "@hono/zod-openapi";
2
+ import { CreateCreativeEndpointResponseSchema, CreateCreativeProfileSchema, CreativeEntitySchema, CreativeWithUserEntitySchema, GetCreativeEndpointResponseSchema, GetCreativeParamsSchema, GetCreativeQuerySchema, ListCreativesInputSchema, UpdateCreativeEndpointResponseSchema, UpdateCreativeProfileSchema } from "../schemas";
3
+ export type CreativeEntity = z.infer<typeof CreativeEntitySchema>;
4
+ export type CreativeWithUserEntity = z.infer<typeof CreativeWithUserEntitySchema>;
5
+ export type ListCreativesDto = z.infer<typeof ListCreativesInputSchema>;
6
+ export type CreateCreativeDto = z.infer<typeof CreateCreativeProfileSchema> & {
5
7
  userId: string;
6
- bio?: string;
7
- location?: string;
8
- experienceLevel?: ExperienceLevel;
9
- tags?: string[];
10
- disciplines?: string[];
11
- user?: any;
12
- createdAt: Date;
13
- updatedAt: Date;
14
8
  };
15
- export type CreativeEntity = BaseCreativeEntity;
16
- export type CreativeWithUserEntity = CreativeEntity & {
17
- user: MinimalUser;
18
- disciplines: string[];
19
- };
20
- export type ListCreativesInput = {
21
- query?: string;
22
- disciplines?: string[];
23
- experienceLevels?: string[];
24
- location?: string;
25
- tags?: string[];
26
- page?: number;
27
- perPage?: number;
9
+ export type UpdateCreativeDto = z.infer<typeof UpdateCreativeProfileSchema> & {
10
+ userId: string;
28
11
  };
12
+ export type GetCreativeParams = z.infer<typeof GetCreativeParamsSchema>;
13
+ export type GetCreativeQuery = z.infer<typeof GetCreativeQuerySchema>;
14
+ export type CreateCreativeEndpointResponse = z.infer<typeof CreateCreativeEndpointResponseSchema>;
15
+ export type GetCreativeEndpointResponse = z.infer<typeof GetCreativeEndpointResponseSchema>;
16
+ export type UpdateCreativeEndpointResponse = z.infer<typeof UpdateCreativeEndpointResponseSchema>;
@@ -1,30 +1,16 @@
1
- import type { ExperienceLevel, GeographicFocus, InvestmentSize, InvestorType } from "../constants";
2
- import type { MinimalUser } from "./user";
3
- export type InvestorEntity = {
4
- id: string;
1
+ import { z } from "@hono/zod-openapi";
2
+ import { CreateInvestorEndpointResponseSchema, CreateInvestorProfileSchema, GetInvestorEndpointResponseSchema, GetInvestorParamsSchema, GetInvestorQuerySchema, InvestorEntitySchema, InvestorWithUserEntitySchema, ListInvestorsInputSchema, UpdateInvestorEndpointResponseSchema, UpdateInvestorProfileSchema } from "../schemas/investor";
3
+ export type InvestorEntity = z.infer<typeof InvestorEntitySchema>;
4
+ export type InvestorWithUserEntity = z.infer<typeof InvestorWithUserEntitySchema>;
5
+ export type ListInvestorsInput = z.infer<typeof ListInvestorsInputSchema>;
6
+ export type CreateInvestorDto = z.infer<typeof CreateInvestorProfileSchema> & {
5
7
  userId: string;
6
- bio?: string;
7
- location?: string;
8
- experienceLevel?: ExperienceLevel;
9
- geographicFocus?: GeographicFocus;
10
- investmentSize?: InvestmentSize;
11
- investorType?: InvestorType;
12
- websiteURL?: string;
13
- disciplines?: string[];
14
- user?: any;
15
- createdAt: Date;
16
- updatedAt: Date;
17
8
  };
18
- export type InvestorWithUserEntity = InvestorEntity & {
19
- user: MinimalUser;
20
- disciplines: string[];
21
- };
22
- export type ListInvestorsInput = {
23
- query?: string;
24
- disciplines?: string[];
25
- experienceLevels?: string[];
26
- location?: string;
27
- tags?: string[];
28
- page?: number;
29
- perPage?: number;
9
+ export type UpdateInvestorDto = z.infer<typeof UpdateInvestorProfileSchema> & {
10
+ userId: string;
30
11
  };
12
+ export type GetInvestorParams = z.infer<typeof GetInvestorParamsSchema>;
13
+ export type GetInvestorQuery = z.infer<typeof GetInvestorQuerySchema>;
14
+ export type CreateInvestorEndpointResponse = z.infer<typeof CreateInvestorEndpointResponseSchema>;
15
+ export type GetInvestorEndpointResponse = z.infer<typeof GetInvestorEndpointResponseSchema>;
16
+ export type UpdateInvestorEndpointResponse = z.infer<typeof UpdateInvestorEndpointResponseSchema>;
@@ -23,9 +23,9 @@ export type ProjectEntity = {
23
23
  projectCreatorType: Role;
24
24
  tags?: string[];
25
25
  isFeatured?: boolean;
26
- startDate?: Date | null;
26
+ startDate?: Date;
27
27
  imagePlaceholderUrl?: string;
28
- endDate?: Date | null;
28
+ endDate?: Date;
29
29
  };
30
30
  export type ProjectWithFilesEntity = ProjectEntity & ProjectSocialGraphEntity & {
31
31
  projectFiles?: ProjectFileEntity[];