@zyacreatives/shared 2.2.43 → 2.2.44

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.
@@ -1,4 +1,52 @@
1
1
  import { z } from "@hono/zod-openapi";
2
+ export declare const MinimalInvestorEntitySchema: z.ZodObject<{
3
+ id: z.ZodCUID2;
4
+ userId: z.ZodCUID2;
5
+ bio: z.ZodOptional<z.ZodString>;
6
+ location: z.ZodOptional<z.ZodString>;
7
+ experienceLevel: z.ZodOptional<z.ZodEnum<{
8
+ "0-1 year": "0-1 year";
9
+ "1-3 years": "1-3 years";
10
+ "3-5 years": "3-5 years";
11
+ "5+ years": "5+ years";
12
+ }>>;
13
+ investorType: z.ZodOptional<z.ZodEnum<{
14
+ "Angel Investor": "Angel Investor";
15
+ "Venture Capitalist": "Venture Capitalist";
16
+ "Private Equity Firm": "Private Equity Firm";
17
+ "Venture Debt Provider": "Venture Debt Provider";
18
+ Bank: "Bank";
19
+ "Convertible Note Investor": "Convertible Note Investor";
20
+ "Revenue Based Financing Investor": "Revenue Based Financing Investor";
21
+ "Corporate Venture Capitalist": "Corporate Venture Capitalist";
22
+ Government: "Government";
23
+ "Social Impact Investor": "Social Impact Investor";
24
+ }>>;
25
+ investmentSize: z.ZodOptional<z.ZodEnum<{
26
+ "Under 5k USD": "Under 5k USD";
27
+ "5k - 25k USD": "5k - 25k USD";
28
+ "25k - 100k USD": "25k - 100k USD";
29
+ "100k - 500k USD": "100k - 500k USD";
30
+ "500k - 1M USD": "500k - 1M USD";
31
+ "1M+ USD": "1M+ USD";
32
+ }>>;
33
+ geographicFocus: z.ZodOptional<z.ZodEnum<{
34
+ Africa: "Africa";
35
+ Asia: "Asia";
36
+ Europe: "Europe";
37
+ "North America": "North America";
38
+ "South America": "South America";
39
+ "Middle East": "Middle East";
40
+ Oceania: "Oceania";
41
+ "United Kingdom (UK)": "United Kingdom (UK)";
42
+ "United States (US)": "United States (US)";
43
+ Global: "Global";
44
+ Other: "Other";
45
+ }>>;
46
+ disciplines: z.ZodOptional<z.ZodArray<z.ZodString>>;
47
+ createdAt: z.ZodOptional<z.ZodCoercedDate<unknown>>;
48
+ updatedAt: z.ZodOptional<z.ZodCoercedDate<unknown>>;
49
+ }, z.core.$strip>;
2
50
  export declare const InvestorEntitySchema: z.ZodObject<{
3
51
  id: z.ZodCUID2;
4
52
  userId: z.ZodCUID2;
@@ -65,6 +113,67 @@ export declare const InvestorEntitySchema: z.ZodObject<{
65
113
  updatedAt: z.ZodOptional<z.ZodCoercedDate<unknown>>;
66
114
  version: z.ZodInt;
67
115
  }, z.core.$strip>;
116
+ export declare const InvestorWithUserEntitySchema: z.ZodObject<{
117
+ id: z.ZodCUID2;
118
+ userId: z.ZodCUID2;
119
+ bio: z.ZodOptional<z.ZodString>;
120
+ location: z.ZodOptional<z.ZodString>;
121
+ experienceLevel: z.ZodOptional<z.ZodEnum<{
122
+ "0-1 year": "0-1 year";
123
+ "1-3 years": "1-3 years";
124
+ "3-5 years": "3-5 years";
125
+ "5+ years": "5+ years";
126
+ }>>;
127
+ investorType: z.ZodOptional<z.ZodEnum<{
128
+ "Angel Investor": "Angel Investor";
129
+ "Venture Capitalist": "Venture Capitalist";
130
+ "Private Equity Firm": "Private Equity Firm";
131
+ "Venture Debt Provider": "Venture Debt Provider";
132
+ Bank: "Bank";
133
+ "Convertible Note Investor": "Convertible Note Investor";
134
+ "Revenue Based Financing Investor": "Revenue Based Financing Investor";
135
+ "Corporate Venture Capitalist": "Corporate Venture Capitalist";
136
+ Government: "Government";
137
+ "Social Impact Investor": "Social Impact Investor";
138
+ }>>;
139
+ investmentSize: z.ZodOptional<z.ZodEnum<{
140
+ "Under 5k USD": "Under 5k USD";
141
+ "5k - 25k USD": "5k - 25k USD";
142
+ "25k - 100k USD": "25k - 100k USD";
143
+ "100k - 500k USD": "100k - 500k USD";
144
+ "500k - 1M USD": "500k - 1M USD";
145
+ "1M+ USD": "1M+ USD";
146
+ }>>;
147
+ geographicFocus: z.ZodOptional<z.ZodEnum<{
148
+ Africa: "Africa";
149
+ Asia: "Asia";
150
+ Europe: "Europe";
151
+ "North America": "North America";
152
+ "South America": "South America";
153
+ "Middle East": "Middle East";
154
+ Oceania: "Oceania";
155
+ "United Kingdom (UK)": "United Kingdom (UK)";
156
+ "United States (US)": "United States (US)";
157
+ Global: "Global";
158
+ Other: "Other";
159
+ }>>;
160
+ disciplines: z.ZodOptional<z.ZodArray<z.ZodString>>;
161
+ createdAt: z.ZodOptional<z.ZodCoercedDate<unknown>>;
162
+ updatedAt: z.ZodOptional<z.ZodCoercedDate<unknown>>;
163
+ user: z.ZodObject<{
164
+ email: z.ZodEmail;
165
+ username: z.ZodOptional<z.ZodString>;
166
+ id: z.ZodCUID2;
167
+ name: z.ZodOptional<z.ZodString>;
168
+ image: z.ZodOptional<z.ZodString>;
169
+ role: z.ZodEnum<{
170
+ CREATIVE: "CREATIVE";
171
+ BRAND: "BRAND";
172
+ INVESTOR: "INVESTOR";
173
+ ADMIN: "ADMIN";
174
+ }>;
175
+ }, z.core.$strip>;
176
+ }, z.core.$strip>;
68
177
  export declare const CreateInvestorProfileInputSchema: z.ZodObject<{
69
178
  websiteURL: z.ZodOptional<z.ZodPipe<z.ZodPipe<z.ZodString, z.ZodTransform<string, string>>, z.ZodUnion<[z.ZodURL, z.ZodLiteral<"">]>>>;
70
179
  experienceLevel: z.ZodDefault<z.ZodEnum<{
@@ -74,6 +183,7 @@ export declare const CreateInvestorProfileInputSchema: z.ZodObject<{
74
183
  "5+ years": "5+ years";
75
184
  }>>;
76
185
  location: z.ZodString;
186
+ disciplineSlugs: z.ZodDefault<z.ZodArray<z.ZodString>>;
77
187
  }, z.core.$strip>;
78
188
  export declare const UpdateInvestorProfileInputSchema: z.ZodObject<{
79
189
  bio: z.ZodOptional<z.ZodString>;
@@ -151,6 +261,11 @@ export declare const ListInvestorsInputSchema: z.ZodObject<{
151
261
  page: z.ZodOptional<z.ZodDefault<z.ZodNumber>>;
152
262
  perPage: z.ZodOptional<z.ZodDefault<z.ZodNumber>>;
153
263
  }, z.core.$strip>;
264
+ export declare const SearchInvestorInputSchema: z.ZodObject<{
265
+ string: z.ZodString;
266
+ limit: z.ZodDefault<z.ZodCoercedNumber<unknown>>;
267
+ cursor: z.ZodOptional<z.ZodString>;
268
+ }, z.core.$strip>;
154
269
  export declare const GetInvestorParamsSchema: z.ZodObject<{
155
270
  value: z.ZodCUID2;
156
271
  }, z.core.$strip>;
@@ -358,3 +473,67 @@ export declare const UpdateInvestorOutputSchema: z.ZodObject<{
358
473
  updatedAt: z.ZodOptional<z.ZodCoercedDate<unknown>>;
359
474
  version: z.ZodInt;
360
475
  }, z.core.$strip>;
476
+ export declare const SearchInvestorOutputSchema: z.ZodObject<{
477
+ investors: z.ZodArray<z.ZodObject<{
478
+ id: z.ZodCUID2;
479
+ userId: z.ZodCUID2;
480
+ bio: z.ZodOptional<z.ZodString>;
481
+ location: z.ZodOptional<z.ZodString>;
482
+ experienceLevel: z.ZodOptional<z.ZodEnum<{
483
+ "0-1 year": "0-1 year";
484
+ "1-3 years": "1-3 years";
485
+ "3-5 years": "3-5 years";
486
+ "5+ years": "5+ years";
487
+ }>>;
488
+ investorType: z.ZodOptional<z.ZodEnum<{
489
+ "Angel Investor": "Angel Investor";
490
+ "Venture Capitalist": "Venture Capitalist";
491
+ "Private Equity Firm": "Private Equity Firm";
492
+ "Venture Debt Provider": "Venture Debt Provider";
493
+ Bank: "Bank";
494
+ "Convertible Note Investor": "Convertible Note Investor";
495
+ "Revenue Based Financing Investor": "Revenue Based Financing Investor";
496
+ "Corporate Venture Capitalist": "Corporate Venture Capitalist";
497
+ Government: "Government";
498
+ "Social Impact Investor": "Social Impact Investor";
499
+ }>>;
500
+ investmentSize: z.ZodOptional<z.ZodEnum<{
501
+ "Under 5k USD": "Under 5k USD";
502
+ "5k - 25k USD": "5k - 25k USD";
503
+ "25k - 100k USD": "25k - 100k USD";
504
+ "100k - 500k USD": "100k - 500k USD";
505
+ "500k - 1M USD": "500k - 1M USD";
506
+ "1M+ USD": "1M+ USD";
507
+ }>>;
508
+ geographicFocus: z.ZodOptional<z.ZodEnum<{
509
+ Africa: "Africa";
510
+ Asia: "Asia";
511
+ Europe: "Europe";
512
+ "North America": "North America";
513
+ "South America": "South America";
514
+ "Middle East": "Middle East";
515
+ Oceania: "Oceania";
516
+ "United Kingdom (UK)": "United Kingdom (UK)";
517
+ "United States (US)": "United States (US)";
518
+ Global: "Global";
519
+ Other: "Other";
520
+ }>>;
521
+ disciplines: z.ZodOptional<z.ZodArray<z.ZodString>>;
522
+ createdAt: z.ZodOptional<z.ZodCoercedDate<unknown>>;
523
+ updatedAt: z.ZodOptional<z.ZodCoercedDate<unknown>>;
524
+ user: z.ZodObject<{
525
+ email: z.ZodEmail;
526
+ username: z.ZodOptional<z.ZodString>;
527
+ id: z.ZodCUID2;
528
+ name: z.ZodOptional<z.ZodString>;
529
+ image: z.ZodOptional<z.ZodString>;
530
+ role: z.ZodEnum<{
531
+ CREATIVE: "CREATIVE";
532
+ BRAND: "BRAND";
533
+ INVESTOR: "INVESTOR";
534
+ ADMIN: "ADMIN";
535
+ }>;
536
+ }, z.core.$strip>;
537
+ }, z.core.$strip>>;
538
+ nextCursor: z.ZodNullable<z.ZodOptional<z.ZodString>>;
539
+ }, z.core.$strip>;
@@ -1,9 +1,51 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.UpdateInvestorOutputSchema = exports.GetInvestorOutputSchema = exports.CreateInvestorOutputSchema = exports.GetInvestorQuerySchema = exports.GetInvestorParamsSchema = exports.ListInvestorsInputSchema = exports.UpdateInvestorProfileInputSchema = exports.CreateInvestorProfileInputSchema = exports.InvestorEntitySchema = void 0;
3
+ exports.SearchInvestorOutputSchema = exports.UpdateInvestorOutputSchema = exports.GetInvestorOutputSchema = exports.CreateInvestorOutputSchema = exports.GetInvestorQuerySchema = exports.GetInvestorParamsSchema = exports.SearchInvestorInputSchema = exports.ListInvestorsInputSchema = exports.UpdateInvestorProfileInputSchema = exports.CreateInvestorProfileInputSchema = exports.InvestorWithUserEntitySchema = exports.InvestorEntitySchema = exports.MinimalInvestorEntitySchema = 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 user_1 = require("./user");
8
+ exports.MinimalInvestorEntitySchema = zod_openapi_1.z.object({
9
+ id: zod_openapi_1.z.cuid2().openapi({ example: "inv_cksd0v6q0000s9a5y8z7p3x9" }),
10
+ userId: zod_openapi_1.z.cuid2().openapi({ example: "user_owner_123" }),
11
+ bio: zod_openapi_1.z
12
+ .string()
13
+ .optional()
14
+ .openapi({ example: "Early stage VC focusing on creative technology." }),
15
+ location: zod_openapi_1.z.string().optional().openapi({ example: "New York, USA" }),
16
+ experienceLevel: zod_openapi_1.z
17
+ .enum(Object.values(constants_1.EXPERIENCE_LEVELS))
18
+ .optional()
19
+ .openapi({ example: "EXPERT" }),
20
+ investorType: zod_openapi_1.z
21
+ .enum(Object.values(constants_1.INVESTOR_TYPES))
22
+ .optional()
23
+ .openapi({ example: "VC" }),
24
+ investmentSize: zod_openapi_1.z
25
+ .enum(Object.values(constants_1.INVESTMENT_SIZES))
26
+ .optional()
27
+ .openapi({
28
+ example: "SEED",
29
+ }),
30
+ geographicFocus: zod_openapi_1.z
31
+ .enum(Object.values(constants_1.GEOGRAPHIC_FOCUS))
32
+ .optional()
33
+ .openapi({
34
+ example: "GLOBAL",
35
+ }),
36
+ disciplines: zod_openapi_1.z
37
+ .array(zod_openapi_1.z.string())
38
+ .optional()
39
+ .openapi({ example: ["Product Design", "AI Strategy"] }),
40
+ createdAt: zod_openapi_1.z.coerce
41
+ .date()
42
+ .optional()
43
+ .openapi({ example: "2025-10-13T09:00:00.000Z" }),
44
+ updatedAt: zod_openapi_1.z.coerce
45
+ .date()
46
+ .optional()
47
+ .openapi({ example: "2025-10-13T09:00:00.000Z" }),
48
+ });
7
49
  exports.InvestorEntitySchema = zod_openapi_1.z
8
50
  .object({
9
51
  id: zod_openapi_1.z.cuid2().openapi({ example: "inv_cksd0v6q0000s9a5y8z7p3x9" }),
@@ -66,6 +108,9 @@ exports.InvestorEntitySchema = zod_openapi_1.z
66
108
  version: zod_openapi_1.z.int(),
67
109
  })
68
110
  .openapi("InvestorEntity");
111
+ exports.InvestorWithUserEntitySchema = exports.MinimalInvestorEntitySchema.extend({
112
+ user: user_1.MinimalUserSchema,
113
+ });
69
114
  exports.CreateInvestorProfileInputSchema = zod_openapi_1.z
70
115
  .object({
71
116
  websiteURL: zod_openapi_1.z
@@ -73,7 +118,6 @@ exports.CreateInvestorProfileInputSchema = zod_openapi_1.z
73
118
  .transform((val) => {
74
119
  if (!val)
75
120
  return val;
76
- console.log({ val });
77
121
  if (val.startsWith("http://") || val.startsWith("https://")) {
78
122
  return val;
79
123
  }
@@ -90,6 +134,14 @@ exports.CreateInvestorProfileInputSchema = zod_openapi_1.z
90
134
  location: zod_openapi_1.z.string().openapi({
91
135
  example: "UK",
92
136
  }),
137
+ disciplineSlugs: zod_openapi_1.z
138
+ .array(zod_openapi_1.z.string())
139
+ .min(1, "At least one discipline is required")
140
+ .default([])
141
+ .describe("List of discipline slugs.")
142
+ .openapi({
143
+ example: ["fintech", "edtech"],
144
+ }),
93
145
  })
94
146
  .openapi({
95
147
  title: "Create Investor Profile",
@@ -104,7 +156,6 @@ exports.UpdateInvestorProfileInputSchema = zod_openapi_1.z
104
156
  .transform((val) => {
105
157
  if (!val)
106
158
  return val;
107
- console.log({ val });
108
159
  if (val.startsWith("http://") || val.startsWith("https://")) {
109
160
  return val;
110
161
  }
@@ -198,6 +249,19 @@ exports.ListInvestorsInputSchema = zod_openapi_1.z
198
249
  .openapi({ example: 20 }),
199
250
  })
200
251
  .openapi("ListInvestorsInput");
252
+ exports.SearchInvestorInputSchema = zod_openapi_1.z.object({
253
+ string: zod_openapi_1.z
254
+ .string()
255
+ .min(1, { message: "Search string cannot be empty" })
256
+ .max(200, { message: "Search string cannot exceed 200 characters" }),
257
+ limit: zod_openapi_1.z.coerce
258
+ .number()
259
+ .int({ message: "Limit must be an integer" })
260
+ .min(1, { message: "Limit must be at least 1" })
261
+ .max(100, { message: "Limit cannot exceed 100" })
262
+ .default(20),
263
+ cursor: zod_openapi_1.z.string().optional(),
264
+ });
201
265
  exports.GetInvestorParamsSchema = zod_openapi_1.z.object({
202
266
  value: common_1.CuidSchema,
203
267
  });
@@ -205,3 +269,7 @@ exports.GetInvestorQuerySchema = common_1.ProfileIdentifierSchema;
205
269
  exports.CreateInvestorOutputSchema = exports.InvestorEntitySchema;
206
270
  exports.GetInvestorOutputSchema = exports.InvestorEntitySchema;
207
271
  exports.UpdateInvestorOutputSchema = exports.InvestorEntitySchema;
272
+ exports.SearchInvestorOutputSchema = zod_openapi_1.z.object({
273
+ investors: zod_openapi_1.z.array(exports.InvestorWithUserEntitySchema),
274
+ nextCursor: zod_openapi_1.z.string().optional().nullable(),
275
+ });
@@ -1,11 +1,15 @@
1
1
  import { z } from "@hono/zod-openapi";
2
- import { CreateInvestorOutputSchema, CreateInvestorProfileInputSchema, GetInvestorOutputSchema, GetInvestorParamsSchema, GetInvestorQuerySchema, InvestorEntitySchema, ListInvestorsInputSchema, UpdateInvestorOutputSchema, UpdateInvestorProfileInputSchema } from "../schemas/investor";
2
+ import { CreateInvestorOutputSchema, CreateInvestorProfileInputSchema, GetInvestorOutputSchema, GetInvestorParamsSchema, GetInvestorQuerySchema, InvestorEntitySchema, InvestorWithUserEntitySchema, ListInvestorsInputSchema, MinimalInvestorEntitySchema, SearchInvestorInputSchema, SearchInvestorOutputSchema, UpdateInvestorOutputSchema, UpdateInvestorProfileInputSchema } from "../schemas/investor";
3
3
  export type InvestorEntity = z.infer<typeof InvestorEntitySchema>;
4
+ export type MinimalInvestorEntity = z.infer<typeof MinimalInvestorEntitySchema>;
5
+ export type InvestorWithUserEntity = z.infer<typeof InvestorWithUserEntitySchema>;
4
6
  export type ListInvestorsInput = z.infer<typeof ListInvestorsInputSchema>;
5
7
  export type CreateInvestorInput = z.infer<typeof CreateInvestorProfileInputSchema>;
6
8
  export type UpdateInvestorInput = z.infer<typeof UpdateInvestorProfileInputSchema>;
9
+ export type SearchInvestorInput = z.infer<typeof SearchInvestorInputSchema>;
7
10
  export type GetInvestorParams = z.infer<typeof GetInvestorParamsSchema>;
8
11
  export type GetInvestorQuery = z.infer<typeof GetInvestorQuerySchema>;
9
12
  export type CreateInvestorOutput = z.infer<typeof CreateInvestorOutputSchema>;
10
13
  export type GetInvestorOutput = z.infer<typeof GetInvestorOutputSchema>;
11
14
  export type UpdateInvestorOutput = z.infer<typeof UpdateInvestorOutputSchema>;
15
+ export type SearchInvestorOutput = z.infer<typeof SearchInvestorOutputSchema>;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@zyacreatives/shared",
3
- "version": "2.2.43",
3
+ "version": "2.2.44",
4
4
  "description": "",
5
5
  "main": "dist/index.js",
6
6
  "types": "dist/index.d.ts",
@@ -11,6 +11,61 @@ import {
11
11
  LINK_TYPES,
12
12
  } from "../constants";
13
13
  import { CuidSchema, ProfileIdentifierSchema } from "./common";
14
+ import { MinimalUserSchema } from "./user";
15
+
16
+ export const MinimalInvestorEntitySchema = z.object({
17
+ id: z.cuid2().openapi({ example: "inv_cksd0v6q0000s9a5y8z7p3x9" }),
18
+ userId: z.cuid2().openapi({ example: "user_owner_123" }),
19
+ bio: z
20
+ .string()
21
+ .optional()
22
+ .openapi({ example: "Early stage VC focusing on creative technology." }),
23
+ location: z.string().optional().openapi({ example: "New York, USA" }),
24
+ experienceLevel: z
25
+ .enum(
26
+ Object.values(EXPERIENCE_LEVELS) as [
27
+ ExperienceLevel,
28
+ ...ExperienceLevel[],
29
+ ],
30
+ )
31
+ .optional()
32
+ .openapi({ example: "EXPERT" }),
33
+ investorType: z
34
+ .enum(Object.values(INVESTOR_TYPES) as [InvestorType, ...InvestorType[]])
35
+ .optional()
36
+ .openapi({ example: "VC" }),
37
+ investmentSize: z
38
+ .enum(
39
+ Object.values(INVESTMENT_SIZES) as [InvestmentSize, ...InvestmentSize[]],
40
+ )
41
+ .optional()
42
+ .openapi({
43
+ example: "SEED",
44
+ }),
45
+ geographicFocus: z
46
+ .enum(
47
+ Object.values(GEOGRAPHIC_FOCUS) as [
48
+ GeographicFocus,
49
+ ...GeographicFocus[],
50
+ ],
51
+ )
52
+ .optional()
53
+ .openapi({
54
+ example: "GLOBAL",
55
+ }),
56
+ disciplines: z
57
+ .array(z.string())
58
+ .optional()
59
+ .openapi({ example: ["Product Design", "AI Strategy"] }),
60
+ createdAt: z.coerce
61
+ .date()
62
+ .optional()
63
+ .openapi({ example: "2025-10-13T09:00:00.000Z" }),
64
+ updatedAt: z.coerce
65
+ .date()
66
+ .optional()
67
+ .openapi({ example: "2025-10-13T09:00:00.000Z" }),
68
+ });
14
69
 
15
70
  export const InvestorEntitySchema = z
16
71
  .object({
@@ -90,13 +145,16 @@ export const InvestorEntitySchema = z
90
145
  })
91
146
  .openapi("InvestorEntity");
92
147
 
148
+ export const InvestorWithUserEntitySchema = MinimalInvestorEntitySchema.extend({
149
+ user: MinimalUserSchema,
150
+ });
151
+
93
152
  export const CreateInvestorProfileInputSchema = z
94
153
  .object({
95
154
  websiteURL: z
96
155
  .string()
97
156
  .transform((val) => {
98
157
  if (!val) return val;
99
- console.log({ val });
100
158
  if (val.startsWith("http://") || val.startsWith("https://")) {
101
159
  return val;
102
160
  }
@@ -118,6 +176,14 @@ export const CreateInvestorProfileInputSchema = z
118
176
  location: z.string().openapi({
119
177
  example: "UK",
120
178
  }),
179
+ disciplineSlugs: z
180
+ .array(z.string())
181
+ .min(1, "At least one discipline is required")
182
+ .default([])
183
+ .describe("List of discipline slugs.")
184
+ .openapi({
185
+ example: ["fintech", "edtech"],
186
+ }),
121
187
  })
122
188
  .openapi({
123
189
  title: "Create Investor Profile",
@@ -132,7 +198,6 @@ export const UpdateInvestorProfileInputSchema = z
132
198
  .string()
133
199
  .transform((val) => {
134
200
  if (!val) return val;
135
- console.log({ val });
136
201
  if (val.startsWith("http://") || val.startsWith("https://")) {
137
202
  return val;
138
203
  }
@@ -250,6 +315,20 @@ export const ListInvestorsInputSchema = z
250
315
  })
251
316
  .openapi("ListInvestorsInput");
252
317
 
318
+ export const SearchInvestorInputSchema = z.object({
319
+ string: z
320
+ .string()
321
+ .min(1, { message: "Search string cannot be empty" })
322
+ .max(200, { message: "Search string cannot exceed 200 characters" }),
323
+ limit: z.coerce
324
+ .number()
325
+ .int({ message: "Limit must be an integer" })
326
+ .min(1, { message: "Limit must be at least 1" })
327
+ .max(100, { message: "Limit cannot exceed 100" })
328
+ .default(20),
329
+ cursor: z.string().optional(),
330
+ });
331
+
253
332
  export const GetInvestorParamsSchema = z.object({
254
333
  value: CuidSchema,
255
334
  });
@@ -261,3 +340,8 @@ export const CreateInvestorOutputSchema = InvestorEntitySchema;
261
340
  export const GetInvestorOutputSchema = InvestorEntitySchema;
262
341
 
263
342
  export const UpdateInvestorOutputSchema = InvestorEntitySchema;
343
+
344
+ export const SearchInvestorOutputSchema = z.object({
345
+ investors: z.array(InvestorWithUserEntitySchema),
346
+ nextCursor: z.string().optional().nullable(),
347
+ });
@@ -6,13 +6,23 @@ import {
6
6
  GetInvestorParamsSchema,
7
7
  GetInvestorQuerySchema,
8
8
  InvestorEntitySchema,
9
+ InvestorWithUserEntitySchema,
9
10
  ListInvestorsInputSchema,
11
+ MinimalInvestorEntitySchema,
12
+ SearchInvestorInputSchema,
13
+ SearchInvestorOutputSchema,
10
14
  UpdateInvestorOutputSchema,
11
15
  UpdateInvestorProfileInputSchema,
12
16
  } from "../schemas/investor";
13
17
 
14
18
  export type InvestorEntity = z.infer<typeof InvestorEntitySchema>;
15
19
 
20
+ export type MinimalInvestorEntity = z.infer<typeof MinimalInvestorEntitySchema>;
21
+
22
+ export type InvestorWithUserEntity = z.infer<
23
+ typeof InvestorWithUserEntitySchema
24
+ >;
25
+
16
26
  export type ListInvestorsInput = z.infer<typeof ListInvestorsInputSchema>;
17
27
 
18
28
  export type CreateInvestorInput = z.infer<
@@ -23,6 +33,8 @@ export type UpdateInvestorInput = z.infer<
23
33
  typeof UpdateInvestorProfileInputSchema
24
34
  >;
25
35
 
36
+ export type SearchInvestorInput = z.infer<typeof SearchInvestorInputSchema>;
37
+
26
38
  export type GetInvestorParams = z.infer<typeof GetInvestorParamsSchema>;
27
39
 
28
40
  export type GetInvestorQuery = z.infer<typeof GetInvestorQuerySchema>;
@@ -32,3 +44,5 @@ export type CreateInvestorOutput = z.infer<typeof CreateInvestorOutputSchema>;
32
44
  export type GetInvestorOutput = z.infer<typeof GetInvestorOutputSchema>;
33
45
 
34
46
  export type UpdateInvestorOutput = z.infer<typeof UpdateInvestorOutputSchema>;
47
+
48
+ export type SearchInvestorOutput = z.infer<typeof SearchInvestorOutputSchema>;