@zyacreatives/shared 2.5.54 → 2.5.56
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/index.d.ts +0 -1
- package/dist/index.js +0 -1
- package/dist/schemas/activity.d.ts +1 -0
- package/dist/schemas/auth.d.ts +2 -0
- package/dist/schemas/bookmark.d.ts +62 -7
- package/dist/schemas/bookmark.js +32 -30
- package/dist/schemas/brand.d.ts +3 -3
- package/dist/schemas/chat.d.ts +96 -52
- package/dist/schemas/chat.js +44 -18
- package/dist/schemas/comment.d.ts +65 -21
- package/dist/schemas/comment.js +48 -54
- package/dist/schemas/common.d.ts +15 -11
- package/dist/schemas/creative.d.ts +3 -3
- package/dist/schemas/discipline.d.ts +63 -12
- package/dist/schemas/discipline.js +62 -65
- package/dist/schemas/entity-stats.d.ts +35 -3
- package/dist/schemas/entity-stats.js +24 -38
- package/dist/schemas/feed.d.ts +50 -3
- package/dist/schemas/feed.js +43 -13
- package/dist/schemas/file.d.ts +65 -24
- package/dist/schemas/file.js +60 -49
- package/dist/schemas/index.d.ts +1 -0
- package/dist/schemas/index.js +1 -0
- package/dist/schemas/investor-shortlist.d.ts +68 -11
- package/dist/schemas/investor-shortlist.js +46 -24
- package/dist/schemas/investor-signal.d.ts +52 -12
- package/dist/schemas/investor-signal.js +59 -39
- package/dist/schemas/investor.d.ts +3 -3
- package/dist/schemas/job-application.d.ts +291 -279
- package/dist/schemas/job-application.js +59 -95
- package/dist/schemas/job.d.ts +200 -659
- package/dist/schemas/job.js +98 -231
- package/dist/schemas/like.d.ts +3 -0
- package/dist/schemas/message.d.ts +125 -94
- package/dist/schemas/message.js +54 -55
- package/dist/schemas/notification.d.ts +99 -32
- package/dist/schemas/notification.js +46 -42
- package/dist/schemas/payout-method.d.ts +51 -31
- package/dist/schemas/payout-method.js +48 -58
- package/dist/schemas/post.d.ts +295 -204
- package/dist/schemas/post.js +148 -272
- package/dist/schemas/product.d.ts +308 -229
- package/dist/schemas/product.js +111 -94
- package/dist/schemas/project.d.ts +512 -449
- package/dist/schemas/project.js +144 -102
- package/dist/schemas/seller.d.ts +10 -10
- package/dist/schemas/user-strike.d.ts +3 -0
- package/dist/schemas/user.d.ts +127 -136
- package/dist/schemas/username.d.ts +1 -0
- package/dist/schemas/view.d.ts +1 -0
- package/dist/types/activity.d.ts +1 -3
- package/dist/types/auth.d.ts +1 -4
- package/dist/types/bookmark.d.ts +1 -3
- package/dist/types/chat.d.ts +1 -11
- package/dist/types/comment.d.ts +1 -5
- package/dist/types/common.d.ts +2 -8
- package/dist/types/discipline.d.ts +1 -11
- package/dist/types/entity-stats.d.ts +1 -3
- package/dist/types/feed.d.ts +1 -5
- package/dist/types/investor-shortlist.d.ts +1 -6
- package/dist/types/investor-signal.d.ts +1 -7
- package/dist/types/like.d.ts +1 -3
- package/dist/types/message.d.ts +1 -9
- package/dist/types/notification.d.ts +1 -9
- package/dist/types/user-strike.d.ts +1 -5
- package/dist/types/username.d.ts +1 -3
- package/package.json +1 -1
- package/src/index.ts +4 -5
- package/src/schemas/activity.ts +5 -4
- package/src/schemas/auth.ts +14 -10
- package/src/schemas/bookmark.ts +48 -29
- package/src/schemas/chat.ts +79 -18
- package/src/schemas/comment.ts +63 -49
- package/src/schemas/common.ts +8 -3
- package/src/schemas/discipline.ts +103 -71
- package/src/schemas/entity-stats.ts +32 -38
- package/src/schemas/feed.ts +62 -15
- package/src/schemas/file.ts +85 -58
- package/src/schemas/index.ts +1 -0
- package/src/schemas/investor-shortlist.ts +57 -8
- package/src/schemas/investor-signal.ts +79 -27
- package/src/schemas/job-application.ts +81 -115
- package/src/schemas/job.ts +160 -301
- package/src/schemas/like.ts +5 -1
- package/src/schemas/message.ts +71 -64
- package/src/schemas/notification.ts +63 -51
- package/src/schemas/payout-method.ts +47 -63
- package/src/schemas/post.ts +211 -272
- package/src/schemas/product.ts +202 -139
- package/src/schemas/project.ts +265 -147
- package/src/schemas/user-strike.ts +7 -1
- package/src/schemas/user.ts +2 -6
- package/src/schemas/username.ts +5 -3
- package/src/schemas/view.ts +0 -50
- package/src/types/activity.ts +0 -4
- package/src/types/auth.ts +0 -5
- package/src/types/bookmark.ts +0 -4
- package/src/types/chat.ts +0 -31
- package/src/types/comment.ts +0 -12
- package/src/types/common.ts +0 -14
- package/src/types/discipline.ts +0 -32
- package/src/types/entity-stats.ts +0 -4
- package/src/types/feed.ts +0 -10
- package/src/types/index.ts +0 -16
- package/src/types/investor-shortlist.ts +0 -18
- package/src/types/investor-signal.ts +0 -26
- package/src/types/like.ts +0 -4
- package/src/types/message.ts +0 -26
- package/src/types/notification.ts +0 -34
- package/src/types/user-strike.ts +0 -10
- package/src/types/username.ts +0 -4
package/dist/schemas/project.js
CHANGED
|
@@ -1,18 +1,19 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.
|
|
3
|
+
exports.CommentOnProjectOutputSchema = exports.DeleteProjectOutputSchema = exports.UpdateProjectOutputSchema = exports.CreateProjectOutputSchema = exports.ProjectUpdateOutputEntitySchema = exports.GetProjectWithLikesOutputSchema = exports.GetProjectWithCommentsOutputSchema = exports.SearchProjectsOutputSchema = exports.GetProjectOutputSchema = exports.ProjectSearchDocumentSchema = exports.ProjectIdSchema = exports.SearchProjectsInputSchema = exports.CommentOnProjectInputSchema = exports.UpdateProjectInputSchema = exports.CreateProjectInputSchema = exports.ProjectWithProjectBookmarksEntitySchema = exports.ProjectWithLikesEntitySchema = exports.ProjectWithProjectCommentsEntitySchema = exports.ProjectDetailsEntitySchema = exports.ProjectSocialGraphEntitySchema = exports.MinimalProjectSchema = exports.ProjectWithFilesEntitySchema = exports.ProjectEntitySchema = void 0;
|
|
4
4
|
const zod_openapi_1 = require("@hono/zod-openapi");
|
|
5
5
|
const constants_1 = require("../constants");
|
|
6
6
|
const comment_1 = require("./comment");
|
|
7
7
|
const bookmark_1 = require("./bookmark");
|
|
8
|
-
const view_1 = require("./view");
|
|
9
8
|
const user_1 = require("./user");
|
|
10
9
|
const activity_1 = require("./activity");
|
|
11
10
|
const file_1 = require("./file");
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
11
|
+
/**
|
|
12
|
+
* --------------------------------
|
|
13
|
+
* SHAPE
|
|
14
|
+
* --------------------------------
|
|
15
|
+
*/
|
|
16
|
+
const ProjectShape = zod_openapi_1.z.object({
|
|
16
17
|
title: zod_openapi_1.z.string(),
|
|
17
18
|
description: zod_openapi_1.z.string().optional(),
|
|
18
19
|
overview: zod_openapi_1.z.string().optional(),
|
|
@@ -21,9 +22,9 @@ exports.ProjectEntitySchema = zod_openapi_1.z
|
|
|
21
22
|
tags: zod_openapi_1.z.array(zod_openapi_1.z.string()).optional(),
|
|
22
23
|
projectCreatorType: zod_openapi_1.z.enum(constants_1.ROLES),
|
|
23
24
|
clientId: zod_openapi_1.z.cuid2().optional(),
|
|
24
|
-
status: zod_openapi_1.z.enum(constants_1.PROJECT_STATUS),
|
|
25
25
|
clientType: zod_openapi_1.z.enum(constants_1.CLIENT_TYPES).optional(),
|
|
26
26
|
clientName: zod_openapi_1.z.string().optional(),
|
|
27
|
+
status: zod_openapi_1.z.enum(constants_1.PROJECT_STATUS),
|
|
27
28
|
isFeatured: zod_openapi_1.z.boolean().optional(),
|
|
28
29
|
problemBeingSolved: zod_openapi_1.z.string().max(600).optional(),
|
|
29
30
|
whoItsFor: zod_openapi_1.z.string().max(600).optional(),
|
|
@@ -32,16 +33,32 @@ exports.ProjectEntitySchema = zod_openapi_1.z
|
|
|
32
33
|
capitalLookingToRaiseCurrency: zod_openapi_1.z.enum(constants_1.WAGES_CURRENCY).optional(),
|
|
33
34
|
currentTraction: zod_openapi_1.z.string().max(600),
|
|
34
35
|
isOpenToInvestment: zod_openapi_1.z.boolean().default(false),
|
|
35
|
-
startDate: zod_openapi_1.z.
|
|
36
|
-
endDate: zod_openapi_1.z.
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
36
|
+
startDate: zod_openapi_1.z.iso.datetime().optional(),
|
|
37
|
+
endDate: zod_openapi_1.z.iso.datetime().optional(),
|
|
38
|
+
});
|
|
39
|
+
/**
|
|
40
|
+
* --------------------------------
|
|
41
|
+
* BASE ENTITY
|
|
42
|
+
* --------------------------------
|
|
43
|
+
*/
|
|
44
|
+
exports.ProjectEntitySchema = zod_openapi_1.z
|
|
45
|
+
.object({
|
|
46
|
+
id: zod_openapi_1.z.cuid2(),
|
|
47
|
+
userId: zod_openapi_1.z.cuid2(),
|
|
48
|
+
...ProjectShape.shape,
|
|
49
|
+
createdAt: zod_openapi_1.z.iso.datetime(),
|
|
50
|
+
updatedAt: zod_openapi_1.z.iso.datetime(),
|
|
51
|
+
version: zod_openapi_1.z.int(),
|
|
40
52
|
})
|
|
41
|
-
.openapi("
|
|
53
|
+
.openapi("Project");
|
|
54
|
+
/**
|
|
55
|
+
* --------------------------------
|
|
56
|
+
* DERIVED ENTITIES
|
|
57
|
+
* --------------------------------
|
|
58
|
+
*/
|
|
42
59
|
exports.ProjectWithFilesEntitySchema = exports.ProjectEntitySchema.extend({
|
|
43
60
|
files: zod_openapi_1.z.array(file_1.FileEntitySchema).optional(),
|
|
44
|
-
}).openapi("
|
|
61
|
+
}).openapi("ProjectWithFiles");
|
|
45
62
|
exports.MinimalProjectSchema = exports.ProjectEntitySchema.pick({
|
|
46
63
|
id: true,
|
|
47
64
|
title: true,
|
|
@@ -58,7 +75,61 @@ exports.ProjectSocialGraphEntitySchema = zod_openapi_1.z
|
|
|
58
75
|
noOfBookmarks: zod_openapi_1.z.number().int().optional(),
|
|
59
76
|
noOfViews: zod_openapi_1.z.number().int().optional(),
|
|
60
77
|
})
|
|
61
|
-
.openapi("
|
|
78
|
+
.openapi("ProjectSocialGraph");
|
|
79
|
+
exports.ProjectDetailsEntitySchema = exports.ProjectEntitySchema.extend({
|
|
80
|
+
user: user_1.MinimalUserSchema,
|
|
81
|
+
files: zod_openapi_1.z.array(file_1.FileEntitySchema).optional(),
|
|
82
|
+
}).openapi("ProjectDetails");
|
|
83
|
+
exports.ProjectWithProjectCommentsEntitySchema = exports.MinimalProjectSchema.extend({
|
|
84
|
+
comments: zod_openapi_1.z.array(comment_1.CommentEntitySchema),
|
|
85
|
+
}).openapi("ProjectWithProjectComments");
|
|
86
|
+
exports.ProjectWithLikesEntitySchema = exports.MinimalProjectSchema.extend({
|
|
87
|
+
likes: zod_openapi_1.z.array(activity_1.ActivitySchema.extend({
|
|
88
|
+
followsYou: zod_openapi_1.z.boolean().optional(),
|
|
89
|
+
isFollowing: zod_openapi_1.z.boolean().optional(),
|
|
90
|
+
})),
|
|
91
|
+
}).openapi("ProjectWithLikes");
|
|
92
|
+
exports.ProjectWithProjectBookmarksEntitySchema = exports.MinimalProjectSchema.extend({
|
|
93
|
+
bookmarks: zod_openapi_1.z.array(bookmark_1.BookmarkEntitySchema),
|
|
94
|
+
}).openapi("ProjectWithProjectBookmarks");
|
|
95
|
+
/**
|
|
96
|
+
* --------------------------------
|
|
97
|
+
* INPUT HELPERS
|
|
98
|
+
* --------------------------------
|
|
99
|
+
*/
|
|
100
|
+
const coerceArray = (value) => {
|
|
101
|
+
if (typeof value === "string")
|
|
102
|
+
return value === "" ? [] : value.split(",");
|
|
103
|
+
return value;
|
|
104
|
+
};
|
|
105
|
+
const coerceBoolean = (value) => {
|
|
106
|
+
if (value === "true")
|
|
107
|
+
return true;
|
|
108
|
+
if (value === "false")
|
|
109
|
+
return false;
|
|
110
|
+
return value;
|
|
111
|
+
};
|
|
112
|
+
const nullableStringToUndefined = (value) => {
|
|
113
|
+
if (value === "" || value === null || value === undefined)
|
|
114
|
+
return undefined;
|
|
115
|
+
return value;
|
|
116
|
+
};
|
|
117
|
+
const urlInputSchema = zod_openapi_1.z
|
|
118
|
+
.string()
|
|
119
|
+
.transform((value) => {
|
|
120
|
+
if (!value)
|
|
121
|
+
return value;
|
|
122
|
+
if (value.startsWith("http://") || value.startsWith("https://")) {
|
|
123
|
+
return value;
|
|
124
|
+
}
|
|
125
|
+
return `https://${value}`;
|
|
126
|
+
})
|
|
127
|
+
.pipe(zod_openapi_1.z.url().or(zod_openapi_1.z.literal("")));
|
|
128
|
+
/**
|
|
129
|
+
* --------------------------------
|
|
130
|
+
* INPUTS
|
|
131
|
+
* --------------------------------
|
|
132
|
+
*/
|
|
62
133
|
exports.CreateProjectInputSchema = zod_openapi_1.z
|
|
63
134
|
.object({
|
|
64
135
|
id: zod_openapi_1.z.cuid2().optional(),
|
|
@@ -77,25 +148,11 @@ exports.UpdateProjectInputSchema = zod_openapi_1.z
|
|
|
77
148
|
.min(10, "Add a bit more detail to your description.")
|
|
78
149
|
.optional(),
|
|
79
150
|
overview: zod_openapi_1.z.string().optional(),
|
|
80
|
-
url:
|
|
81
|
-
.string()
|
|
82
|
-
.transform((val) => {
|
|
83
|
-
if (!val)
|
|
84
|
-
return val;
|
|
85
|
-
if (val.startsWith("http://") || val.startsWith("https://"))
|
|
86
|
-
return val;
|
|
87
|
-
return `https://${val}`;
|
|
88
|
-
})
|
|
89
|
-
.pipe(zod_openapi_1.z.url("Check your link.").or(zod_openapi_1.z.literal("")))
|
|
90
|
-
.optional(),
|
|
151
|
+
url: urlInputSchema.optional(),
|
|
91
152
|
imagePlaceholderUrl: zod_openapi_1.z.url().optional().or(zod_openapi_1.z.literal("")),
|
|
92
153
|
tags: zod_openapi_1.z.array(zod_openapi_1.z.string()).optional(),
|
|
93
154
|
projectCreatorType: zod_openapi_1.z.enum(constants_1.ROLES).optional(),
|
|
94
|
-
clientId: zod_openapi_1.z
|
|
95
|
-
.string()
|
|
96
|
-
.optional()
|
|
97
|
-
.transform((val) => (val === "" || val === undefined ? undefined : val))
|
|
98
|
-
.pipe(zod_openapi_1.z.cuid2().optional()),
|
|
155
|
+
clientId: zod_openapi_1.z.preprocess(nullableStringToUndefined, zod_openapi_1.z.cuid2().optional()),
|
|
99
156
|
clientType: zod_openapi_1.z.enum(constants_1.CLIENT_TYPES).optional(),
|
|
100
157
|
clientName: zod_openapi_1.z.string().optional(),
|
|
101
158
|
isFeatured: zod_openapi_1.z.boolean().optional(),
|
|
@@ -119,21 +176,25 @@ exports.UpdateProjectInputSchema = zod_openapi_1.z
|
|
|
119
176
|
.max(600)
|
|
120
177
|
.optional(),
|
|
121
178
|
isOpenToInvestment: zod_openapi_1.z.boolean().default(false),
|
|
122
|
-
startDate: zod_openapi_1.z.
|
|
123
|
-
endDate: zod_openapi_1.z.
|
|
124
|
-
version: zod_openapi_1.z.
|
|
179
|
+
startDate: zod_openapi_1.z.iso.datetime().optional(),
|
|
180
|
+
endDate: zod_openapi_1.z.iso.datetime().optional(),
|
|
181
|
+
version: zod_openapi_1.z.int().default(1),
|
|
125
182
|
})
|
|
126
183
|
.superRefine(({ startDate, endDate }, ctx) => {
|
|
184
|
+
if (!startDate)
|
|
185
|
+
return;
|
|
127
186
|
const today = new Date();
|
|
128
187
|
today.setHours(0, 0, 0, 0);
|
|
129
|
-
|
|
188
|
+
const parsedStartDate = new Date(startDate);
|
|
189
|
+
const parsedEndDate = endDate ? new Date(endDate) : undefined;
|
|
190
|
+
if (parsedStartDate > today) {
|
|
130
191
|
ctx.addIssue({
|
|
131
192
|
path: ["startDate"],
|
|
132
193
|
code: "custom",
|
|
133
194
|
message: "Start date cannot be in the future.",
|
|
134
195
|
});
|
|
135
196
|
}
|
|
136
|
-
if (
|
|
197
|
+
if (parsedEndDate && parsedStartDate > parsedEndDate) {
|
|
137
198
|
ctx.addIssue({
|
|
138
199
|
path: ["endDate"],
|
|
139
200
|
code: "custom",
|
|
@@ -143,24 +204,44 @@ exports.UpdateProjectInputSchema = zod_openapi_1.z
|
|
|
143
204
|
})
|
|
144
205
|
.openapi("UpdateProjectInput");
|
|
145
206
|
exports.CommentOnProjectInputSchema = comment_1.CommentEntitySchema;
|
|
146
|
-
exports.
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
207
|
+
exports.SearchProjectsInputSchema = zod_openapi_1.z
|
|
208
|
+
.object({
|
|
209
|
+
query: zod_openapi_1.z.string().optional(),
|
|
210
|
+
limit: zod_openapi_1.z.coerce.number().min(1).max(100).default(40),
|
|
211
|
+
cursor: zod_openapi_1.z.string().optional(),
|
|
212
|
+
tags: zod_openapi_1.z.preprocess(coerceArray, zod_openapi_1.z.array(zod_openapi_1.z.string())).optional(),
|
|
213
|
+
isOpenToInvestment: zod_openapi_1.z.preprocess(coerceBoolean, zod_openapi_1.z.boolean()).optional(),
|
|
214
|
+
minCapital: zod_openapi_1.z.coerce.number().optional(),
|
|
215
|
+
maxCapital: zod_openapi_1.z.coerce.number().optional(),
|
|
216
|
+
ventureStages: zod_openapi_1.z
|
|
217
|
+
.preprocess(coerceArray, zod_openapi_1.z.array(zod_openapi_1.z.enum(constants_1.VENTURE_STAGES)))
|
|
218
|
+
.optional(),
|
|
219
|
+
projectCreatorTypes: zod_openapi_1.z
|
|
220
|
+
.preprocess(coerceArray, zod_openapi_1.z.array(zod_openapi_1.z.enum(constants_1.ROLES)))
|
|
221
|
+
.optional(),
|
|
222
|
+
clientTypes: zod_openapi_1.z
|
|
223
|
+
.preprocess(coerceArray, zod_openapi_1.z.array(zod_openapi_1.z.enum(constants_1.CLIENT_TYPES)))
|
|
224
|
+
.optional(),
|
|
225
|
+
})
|
|
226
|
+
.openapi("SearchProjectsInput");
|
|
227
|
+
exports.ProjectIdSchema = zod_openapi_1.z.object({
|
|
228
|
+
projectId: zod_openapi_1.z.cuid2(),
|
|
229
|
+
});
|
|
230
|
+
/**
|
|
231
|
+
* --------------------------------
|
|
232
|
+
* SEARCH DOCUMENT
|
|
233
|
+
* --------------------------------
|
|
234
|
+
*/
|
|
154
235
|
exports.ProjectSearchDocumentSchema = zod_openapi_1.z
|
|
155
236
|
.object({
|
|
156
|
-
id: zod_openapi_1.z.
|
|
157
|
-
userId: zod_openapi_1.z.
|
|
237
|
+
id: zod_openapi_1.z.cuid2(),
|
|
238
|
+
userId: zod_openapi_1.z.cuid2(),
|
|
158
239
|
title: zod_openapi_1.z.string(),
|
|
159
240
|
imagePlaceholderUrl: zod_openapi_1.z.url(),
|
|
160
241
|
projectCreatorType: zod_openapi_1.z.enum(constants_1.ROLES),
|
|
161
242
|
isOpenToInvestment: zod_openapi_1.z.boolean(),
|
|
162
|
-
createdAt: zod_openapi_1.z.
|
|
163
|
-
updatedAt: zod_openapi_1.z.
|
|
243
|
+
createdAt: zod_openapi_1.z.iso.datetime(),
|
|
244
|
+
updatedAt: zod_openapi_1.z.iso.datetime(),
|
|
164
245
|
description: zod_openapi_1.z.string().optional(),
|
|
165
246
|
capitalLookingToRaise: zod_openapi_1.z.number().optional(),
|
|
166
247
|
capitalLookingToRaiseCurrency: zod_openapi_1.z.enum(constants_1.WAGES_CURRENCY).optional(),
|
|
@@ -170,74 +251,36 @@ exports.ProjectSearchDocumentSchema = zod_openapi_1.z
|
|
|
170
251
|
creatorUsername: zod_openapi_1.z.string(),
|
|
171
252
|
creatorImageUrl: zod_openapi_1.z.string(),
|
|
172
253
|
creatorName: zod_openapi_1.z.string(),
|
|
173
|
-
clientId: zod_openapi_1.z.
|
|
254
|
+
clientId: zod_openapi_1.z.cuid2().optional(),
|
|
174
255
|
clientType: zod_openapi_1.z.enum(constants_1.CLIENT_TYPES).optional(),
|
|
175
256
|
clientName: zod_openapi_1.z.string().optional(),
|
|
176
257
|
isFeatured: zod_openapi_1.z.boolean().optional(),
|
|
177
|
-
startDate: zod_openapi_1.z.
|
|
178
|
-
endDate: zod_openapi_1.z.
|
|
258
|
+
startDate: zod_openapi_1.z.iso.datetime().optional(),
|
|
259
|
+
endDate: zod_openapi_1.z.iso.datetime().optional(),
|
|
179
260
|
files: zod_openapi_1.z.array(file_1.FileEntitySchema).optional(),
|
|
180
261
|
})
|
|
181
262
|
.openapi("ProjectSearchDocument");
|
|
182
|
-
|
|
183
|
-
|
|
184
|
-
|
|
185
|
-
|
|
186
|
-
|
|
187
|
-
|
|
188
|
-
|
|
189
|
-
|
|
190
|
-
|
|
191
|
-
return false;
|
|
192
|
-
return val;
|
|
193
|
-
};
|
|
194
|
-
exports.SearchProjectsInputSchema = zod_openapi_1.z
|
|
195
|
-
.object({
|
|
196
|
-
query: zod_openapi_1.z.string().optional(),
|
|
197
|
-
limit: zod_openapi_1.z.coerce.number().optional().default(40),
|
|
198
|
-
cursor: zod_openapi_1.z.string().optional().nullable(),
|
|
199
|
-
tags: zod_openapi_1.z.preprocess(coerceArray, zod_openapi_1.z.array(zod_openapi_1.z.string())).optional(),
|
|
200
|
-
isOpenToInvestment: zod_openapi_1.z.preprocess(coerceBoolean, zod_openapi_1.z.boolean()).optional(),
|
|
201
|
-
minCapital: zod_openapi_1.z.coerce.number().optional(),
|
|
202
|
-
maxCapital: zod_openapi_1.z.coerce.number().optional(),
|
|
203
|
-
ventureStages: zod_openapi_1.z
|
|
204
|
-
.preprocess(coerceArray, zod_openapi_1.z.array(zod_openapi_1.z.enum(constants_1.VENTURE_STAGES)))
|
|
205
|
-
.optional(),
|
|
206
|
-
projectCreatorTypes: zod_openapi_1.z
|
|
207
|
-
.preprocess(coerceArray, zod_openapi_1.z.array(zod_openapi_1.z.enum(constants_1.ROLES)))
|
|
208
|
-
.optional(),
|
|
209
|
-
clientTypes: zod_openapi_1.z
|
|
210
|
-
.preprocess(coerceArray, zod_openapi_1.z.array(zod_openapi_1.z.enum(constants_1.CLIENT_TYPES)))
|
|
211
|
-
.optional(),
|
|
212
|
-
})
|
|
213
|
-
.openapi("SearchProjectsInput");
|
|
263
|
+
/**
|
|
264
|
+
* --------------------------------
|
|
265
|
+
* OUTPUTS
|
|
266
|
+
* --------------------------------
|
|
267
|
+
*/
|
|
268
|
+
exports.GetProjectOutputSchema = exports.ProjectDetailsEntitySchema.extend({
|
|
269
|
+
isLiked: zod_openapi_1.z.boolean().optional(),
|
|
270
|
+
isBookmarked: zod_openapi_1.z.boolean().optional(),
|
|
271
|
+
}).openapi("GetProjectOutput");
|
|
214
272
|
exports.SearchProjectsOutputSchema = zod_openapi_1.z
|
|
215
273
|
.object({
|
|
216
274
|
projects: zod_openapi_1.z.array(exports.ProjectSearchDocumentSchema),
|
|
217
|
-
nextCursor: zod_openapi_1.z.string().optional()
|
|
275
|
+
nextCursor: zod_openapi_1.z.string().optional(),
|
|
218
276
|
})
|
|
219
277
|
.openapi("SearchProjectsOutput");
|
|
220
|
-
exports.ProjectWithProjectCommentsEntitySchema = exports.MinimalProjectSchema.extend({
|
|
221
|
-
comments: zod_openapi_1.z.array(comment_1.CommentEntitySchema),
|
|
222
|
-
}).openapi("ProjectWithProjectCommentsEntity");
|
|
223
278
|
exports.GetProjectWithCommentsOutputSchema = exports.ProjectWithProjectCommentsEntitySchema.extend({
|
|
224
|
-
nextCursor: zod_openapi_1.z.string().optional()
|
|
279
|
+
nextCursor: zod_openapi_1.z.string().optional(),
|
|
225
280
|
}).openapi("GetProjectWithCommentsOutput");
|
|
226
|
-
exports.ProjectWithLikesEntitySchema = exports.MinimalProjectSchema.extend({
|
|
227
|
-
likes: zod_openapi_1.z.array(activity_1.ActivitySchema.extend({
|
|
228
|
-
followsYou: zod_openapi_1.z.boolean().optional(),
|
|
229
|
-
isFollowing: zod_openapi_1.z.boolean().optional(),
|
|
230
|
-
})),
|
|
231
|
-
}).openapi("ProjectWithLikesEntity");
|
|
232
281
|
exports.GetProjectWithLikesOutputSchema = exports.ProjectWithLikesEntitySchema.extend({
|
|
233
|
-
nextCursor: zod_openapi_1.z.string().optional()
|
|
282
|
+
nextCursor: zod_openapi_1.z.string().optional(),
|
|
234
283
|
}).openapi("GetProjectWithLikesOutput");
|
|
235
|
-
exports.ProjectWithProjectViewsEntitySchema = exports.MinimalProjectSchema.extend({
|
|
236
|
-
views: zod_openapi_1.z.array(view_1.ViewEntitySchema),
|
|
237
|
-
}).openapi("ProjectWithProjectViewsEntity");
|
|
238
|
-
exports.ProjectWithProjectBookmarksEntitySchema = exports.MinimalProjectSchema.extend({
|
|
239
|
-
bookmarks: zod_openapi_1.z.array(bookmark_1.BookmarkEntitySchema),
|
|
240
|
-
}).openapi("ProjectWithProjectBookmarksEntity");
|
|
241
284
|
exports.ProjectUpdateOutputEntitySchema = zod_openapi_1.z.object({
|
|
242
285
|
id: zod_openapi_1.z.cuid2(),
|
|
243
286
|
});
|
|
@@ -248,4 +291,3 @@ exports.CommentOnProjectOutputSchema = comment_1.CommentEntitySchema.omit({
|
|
|
248
291
|
likesCount: true,
|
|
249
292
|
isLiked: true,
|
|
250
293
|
});
|
|
251
|
-
exports.ProjectIdSchema = zod_openapi_1.z.object({ projectId: zod_openapi_1.z.cuid2() });
|
package/dist/schemas/seller.d.ts
CHANGED
|
@@ -58,26 +58,26 @@ export declare const SellerProfileSchema: z.ZodObject<{
|
|
|
58
58
|
createdAt: z.ZodCoercedDate<unknown>;
|
|
59
59
|
updatedAt: z.ZodCoercedDate<unknown>;
|
|
60
60
|
payoutMethods: z.ZodArray<z.ZodObject<{
|
|
61
|
-
|
|
62
|
-
|
|
61
|
+
status: z.ZodEnum<{
|
|
62
|
+
readonly VERIFIED: "VERIFIED";
|
|
63
|
+
readonly PENDING: "PENDING";
|
|
64
|
+
readonly REJECTED: "REJECTED";
|
|
65
|
+
}>;
|
|
66
|
+
createdAt: z.ZodISODateTime;
|
|
67
|
+
updatedAt: z.ZodISODateTime;
|
|
63
68
|
provider: z.ZodEnum<{
|
|
64
69
|
readonly PAYSTACK: "PAYSTACK";
|
|
65
70
|
readonly STRIPE: "STRIPE";
|
|
66
71
|
readonly NONE: "NONE";
|
|
67
72
|
}>;
|
|
68
|
-
currency: z.ZodString;
|
|
69
73
|
bankName: z.ZodString;
|
|
70
74
|
accountLast4: z.ZodString;
|
|
71
75
|
accountName: z.ZodString;
|
|
72
76
|
externalBankId: z.ZodNullable<z.ZodString>;
|
|
73
77
|
isDefault: z.ZodBoolean;
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
readonly REJECTED: "REJECTED";
|
|
78
|
-
}>>;
|
|
79
|
-
createdAt: z.ZodCoercedDate<unknown>;
|
|
80
|
-
updatedAt: z.ZodCoercedDate<unknown>;
|
|
78
|
+
id: z.ZodCUID2;
|
|
79
|
+
sellerId: z.ZodCUID2;
|
|
80
|
+
currency: z.ZodString;
|
|
81
81
|
}, z.core.$strip>>;
|
|
82
82
|
}, z.core.$strip>;
|
|
83
83
|
export type SellerProfile = z.infer<typeof SellerProfileSchema>;
|
|
@@ -59,3 +59,6 @@ export declare const UpsertUserStrikeOutputSchema: z.ZodObject<{
|
|
|
59
59
|
createdAt: z.ZodCoercedDate<unknown>;
|
|
60
60
|
updatedAt: z.ZodCoercedDate<unknown>;
|
|
61
61
|
}, z.core.$strip>;
|
|
62
|
+
export type UserStrikeEntity = z.infer<typeof UserStrikeEntitySchema>;
|
|
63
|
+
export type UpsertUserStrikeInput = z.infer<typeof UpsertUserStrikeInputSchema>;
|
|
64
|
+
export type UpsertUserStrikeOutput = z.infer<typeof UpsertUserStrikeOutputSchema>;
|