@zyacreatives/shared 2.2.19 → 2.2.21
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/common.d.ts +4 -0
- package/dist/schemas/common.js +4 -1
- package/dist/schemas/project.d.ts +421 -285
- package/dist/schemas/project.js +117 -158
- package/dist/schemas/user.d.ts +24 -24
- package/dist/types/project.d.ts +6 -1
- package/package.json +1 -1
- package/src/schemas/common.ts +5 -0
- package/src/schemas/project.ts +132 -167
- package/src/types/project.ts +18 -0
package/dist/schemas/project.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.
|
|
3
|
+
exports.DeleteProjectFileInputSchema = exports.CreateProjectFileInputSchema = exports.ProjectIdSchema = exports.CommentOnProjectOutputSchema = exports.DeleteProjectOutputSchema = exports.UpdateProjectOutputSchema = exports.CreateProjectOutputSchema = exports.ProjectUpdateOutputEntitySchema = exports.ProjectWithProjectBookmarksEntitySchema = exports.ProjectWithProjectViewsEntitySchema = exports.GetProjectWithLikesOutputSchema = exports.ProjectWithLikesEntitySchema = exports.GetProjectWithCommentsOutputSchema = exports.ProjectWithProjectCommentsEntitySchema = exports.SearchProjectsOutputSchema = exports.ProjectSearchDocumentSchema = exports.GetProjectOutputSchema = exports.ProjectDetailsEntitySchema = exports.CommentOnProjectInputSchema = exports.SearchProjectsInputSchema = exports.UpdateProjectInputSchema = exports.CreateProjectInputSchema = exports.ProjectSocialGraphEntitySchema = exports.MinimalProjectSchema = 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");
|
|
@@ -8,112 +8,58 @@ const bookmark_1 = require("./bookmark");
|
|
|
8
8
|
const view_1 = require("./view");
|
|
9
9
|
const user_1 = require("./user");
|
|
10
10
|
const activity_1 = require("./activity");
|
|
11
|
+
/**
|
|
12
|
+
* BASE ENTITY SCHEMAS
|
|
13
|
+
*/
|
|
11
14
|
exports.ProjectEntitySchema = zod_openapi_1.z
|
|
12
15
|
.object({
|
|
13
|
-
id: zod_openapi_1.z.
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
example: "E-commerce Mobile App",
|
|
24
|
-
}),
|
|
25
|
-
description: zod_openapi_1.z.string().optional().openapi({
|
|
26
|
-
description: "Detailed description of the project, max 1000 characters.",
|
|
27
|
-
example: "A modern e-commerce mobile application built with React Native.",
|
|
28
|
-
}),
|
|
29
|
-
overview: zod_openapi_1.z.string().optional().openapi({
|
|
30
|
-
description: "Brief overview of the project.",
|
|
31
|
-
example: "A comprehensive e-commerce solution for mobile devices.",
|
|
32
|
-
}),
|
|
33
|
-
url: zod_openapi_1.z.string().optional().openapi({
|
|
34
|
-
description: "URL to the project or live demo.",
|
|
35
|
-
example: "https://example.com/project",
|
|
36
|
-
}),
|
|
37
|
-
imagePlaceholderUrl: zod_openapi_1.z.url().openapi({
|
|
38
|
-
description: "URL for the placeholder image of the project.",
|
|
39
|
-
example: "https://img.com",
|
|
40
|
-
}),
|
|
41
|
-
tags: zod_openapi_1.z
|
|
42
|
-
.array(zod_openapi_1.z.string())
|
|
43
|
-
.optional()
|
|
44
|
-
.openapi({
|
|
45
|
-
description: "Array of tags associated with the project.",
|
|
46
|
-
example: ["react-native", "e-commerce", "mobile"],
|
|
47
|
-
}),
|
|
48
|
-
projectCreatorType: zod_openapi_1.z.enum(constants_1.ROLES).openapi({
|
|
49
|
-
description: "Type of creator who made this project.",
|
|
50
|
-
example: "CREATIVE",
|
|
51
|
-
}),
|
|
52
|
-
clientId: zod_openapi_1.z.string().optional().openapi({
|
|
53
|
-
description: "CUID2 of the client if this is a client project.",
|
|
54
|
-
example: "ckl1y9xyz0000qv7a0h1efgh4",
|
|
55
|
-
}),
|
|
16
|
+
id: zod_openapi_1.z.cuid2(),
|
|
17
|
+
userId: zod_openapi_1.z.cuid2(),
|
|
18
|
+
title: zod_openapi_1.z.string(),
|
|
19
|
+
description: zod_openapi_1.z.string().optional(),
|
|
20
|
+
overview: zod_openapi_1.z.string().optional(),
|
|
21
|
+
url: zod_openapi_1.z.url().optional(),
|
|
22
|
+
imagePlaceholderUrl: zod_openapi_1.z.url(),
|
|
23
|
+
tags: zod_openapi_1.z.array(zod_openapi_1.z.string()).optional(),
|
|
24
|
+
projectCreatorType: zod_openapi_1.z.enum(constants_1.ROLES),
|
|
25
|
+
clientId: zod_openapi_1.z.cuid2().optional(),
|
|
56
26
|
status: zod_openapi_1.z.enum(constants_1.PROJECT_STATUS),
|
|
57
|
-
clientType: zod_openapi_1.z.enum(constants_1.CLIENT_TYPES).optional()
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
}),
|
|
61
|
-
clientName: zod_openapi_1.z.string().optional().openapi({
|
|
62
|
-
description: "Name of the client.",
|
|
63
|
-
example: "Acme Corp",
|
|
64
|
-
}),
|
|
65
|
-
isFeatured: zod_openapi_1.z.boolean().optional().openapi({
|
|
66
|
-
description: "Whether the project is featured.",
|
|
67
|
-
example: true,
|
|
68
|
-
}),
|
|
27
|
+
clientType: zod_openapi_1.z.enum(constants_1.CLIENT_TYPES).optional(),
|
|
28
|
+
clientName: zod_openapi_1.z.string().optional(),
|
|
29
|
+
isFeatured: zod_openapi_1.z.boolean().optional(),
|
|
69
30
|
problemBeingSolved: zod_openapi_1.z.string().max(600).optional(),
|
|
70
31
|
whoItsFor: zod_openapi_1.z.string().max(600).optional(),
|
|
71
32
|
ventureStage: zod_openapi_1.z.enum(constants_1.VENTURE_STAGES).optional(),
|
|
72
33
|
capitalLookingToRaise: zod_openapi_1.z.string(),
|
|
73
34
|
capitalLookingToRaiseCurrency: zod_openapi_1.z.enum(constants_1.WAGES_CURRENCY).optional(),
|
|
74
35
|
currentTraction: zod_openapi_1.z.string().max(600),
|
|
75
|
-
startDate: zod_openapi_1.z.coerce
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
example: new Date("2024-01-01"),
|
|
81
|
-
}),
|
|
82
|
-
endDate: zod_openapi_1.z.coerce
|
|
83
|
-
.date()
|
|
84
|
-
.optional()
|
|
85
|
-
.openapi({
|
|
86
|
-
description: "End date of the project.",
|
|
87
|
-
example: new Date("2024-06-30"),
|
|
88
|
-
}),
|
|
89
|
-
createdAt: zod_openapi_1.z.coerce.date().openapi({
|
|
90
|
-
description: "Timestamp when the project was created.",
|
|
91
|
-
example: new Date("2024-01-01T00:00:00.000Z"),
|
|
92
|
-
}),
|
|
93
|
-
updatedAt: zod_openapi_1.z.coerce.date().openapi({
|
|
94
|
-
description: "Timestamp when the project was last updated.",
|
|
95
|
-
example: new Date("2024-06-30T00:00:00.000Z"),
|
|
96
|
-
}),
|
|
97
|
-
version: zod_openapi_1.z.int(),
|
|
36
|
+
startDate: zod_openapi_1.z.coerce.date().optional(),
|
|
37
|
+
endDate: zod_openapi_1.z.coerce.date().optional(),
|
|
38
|
+
createdAt: zod_openapi_1.z.coerce.date(),
|
|
39
|
+
updatedAt: zod_openapi_1.z.coerce.date(),
|
|
40
|
+
version: zod_openapi_1.z.number().int(),
|
|
98
41
|
})
|
|
99
|
-
.openapi(
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
42
|
+
.openapi("ProjectEntity");
|
|
43
|
+
exports.MinimalProjectSchema = exports.ProjectEntitySchema.pick({
|
|
44
|
+
id: true,
|
|
45
|
+
title: true,
|
|
46
|
+
description: true,
|
|
47
|
+
tags: true,
|
|
48
|
+
startDate: true,
|
|
49
|
+
endDate: true,
|
|
50
|
+
imagePlaceholderUrl: true,
|
|
51
|
+
}).openapi("MinimalProject");
|
|
103
52
|
exports.ProjectSocialGraphEntitySchema = zod_openapi_1.z
|
|
104
53
|
.object({
|
|
105
|
-
noOfLikes: zod_openapi_1.z.number().int().optional()
|
|
106
|
-
noOfComments: zod_openapi_1.z.number().int().optional()
|
|
107
|
-
noOfBookmarks: zod_openapi_1.z.number().int().optional()
|
|
108
|
-
noOfViews: zod_openapi_1.z.number().int().optional()
|
|
54
|
+
noOfLikes: zod_openapi_1.z.number().int().optional(),
|
|
55
|
+
noOfComments: zod_openapi_1.z.number().int().optional(),
|
|
56
|
+
noOfBookmarks: zod_openapi_1.z.number().int().optional(),
|
|
57
|
+
noOfViews: zod_openapi_1.z.number().int().optional(),
|
|
109
58
|
})
|
|
110
59
|
.openapi("ProjectSocialGraphEntity");
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
exports.ProjectUpdateOutputEntitySchema = zod_openapi_1.z
|
|
115
|
-
.object({ id: zod_openapi_1.z.cuid2() })
|
|
116
|
-
.openapi("ProjectUpdateOutputEntity");
|
|
60
|
+
/**
|
|
61
|
+
* INPUT SCHEMAS
|
|
62
|
+
*/
|
|
117
63
|
exports.CreateProjectInputSchema = zod_openapi_1.z
|
|
118
64
|
.object({
|
|
119
65
|
id: zod_openapi_1.z.cuid2().optional(),
|
|
@@ -122,7 +68,7 @@ exports.CreateProjectInputSchema = zod_openapi_1.z
|
|
|
122
68
|
overview: zod_openapi_1.z.string().optional(),
|
|
123
69
|
status: zod_openapi_1.z.enum(constants_1.PROJECT_STATUS).default(constants_1.PROJECT_STATUS.DRAFT),
|
|
124
70
|
})
|
|
125
|
-
.openapi(
|
|
71
|
+
.openapi("CreateProjectInput");
|
|
126
72
|
exports.UpdateProjectInputSchema = zod_openapi_1.z
|
|
127
73
|
.object({
|
|
128
74
|
id: zod_openapi_1.z.cuid2(),
|
|
@@ -146,100 +92,113 @@ exports.UpdateProjectInputSchema = zod_openapi_1.z
|
|
|
146
92
|
currentTraction: zod_openapi_1.z.string().max(600).optional(),
|
|
147
93
|
startDate: zod_openapi_1.z.coerce.date().optional(),
|
|
148
94
|
endDate: zod_openapi_1.z.coerce.date().optional(),
|
|
149
|
-
version: zod_openapi_1.z.int(),
|
|
95
|
+
version: zod_openapi_1.z.number().int(),
|
|
150
96
|
})
|
|
151
97
|
.superRefine(({ startDate, endDate }, ctx) => {
|
|
152
98
|
const today = new Date();
|
|
153
99
|
today.setHours(0, 0, 0, 0);
|
|
154
|
-
if (
|
|
155
|
-
return;
|
|
156
|
-
if (startDate > today)
|
|
100
|
+
if (startDate && startDate > today) {
|
|
157
101
|
ctx.addIssue({
|
|
158
102
|
path: ["startDate"],
|
|
159
103
|
code: "custom",
|
|
160
104
|
message: "Start date cannot be in the future",
|
|
161
105
|
});
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
|
|
106
|
+
}
|
|
107
|
+
if (startDate && endDate && startDate > endDate) {
|
|
108
|
+
ctx.addIssue({
|
|
109
|
+
path: ["startDate"],
|
|
110
|
+
code: "custom",
|
|
111
|
+
message: "Start date cannot be after end date",
|
|
112
|
+
});
|
|
169
113
|
}
|
|
170
114
|
})
|
|
171
|
-
.openapi(
|
|
172
|
-
exports.
|
|
173
|
-
|
|
174
|
-
|
|
115
|
+
.openapi("UpdateProjectInput");
|
|
116
|
+
exports.SearchProjectsInputSchema = zod_openapi_1.z
|
|
117
|
+
.object({
|
|
118
|
+
query: zod_openapi_1.z.string().optional(),
|
|
119
|
+
tags: zod_openapi_1.z.array(zod_openapi_1.z.string()).optional(),
|
|
120
|
+
limit: zod_openapi_1.z.coerce.number().min(1).max(100).default(20),
|
|
121
|
+
cursor: zod_openapi_1.z.string().optional(),
|
|
122
|
+
})
|
|
123
|
+
.openapi("SearchProjectsInput");
|
|
124
|
+
exports.CommentOnProjectInputSchema = comment_1.CommentEntitySchema;
|
|
125
|
+
/**
|
|
126
|
+
* OUTPUT / VIEW SCHEMAS
|
|
127
|
+
*/
|
|
128
|
+
exports.ProjectDetailsEntitySchema = exports.ProjectEntitySchema.extend({
|
|
129
|
+
user: user_1.MinimalUserSchema,
|
|
130
|
+
}).openapi("ProjectDetailsEntity");
|
|
175
131
|
exports.GetProjectOutputSchema = exports.ProjectDetailsEntitySchema.extend({
|
|
176
132
|
isLiked: zod_openapi_1.z.boolean().optional(),
|
|
177
133
|
isBookmarked: zod_openapi_1.z.boolean().optional(),
|
|
178
|
-
});
|
|
179
|
-
exports.
|
|
180
|
-
exports.MinimalProjectSchema = exports.ProjectEntitySchema.pick({
|
|
181
|
-
id: true,
|
|
182
|
-
title: true,
|
|
183
|
-
description: true,
|
|
184
|
-
tags: true,
|
|
185
|
-
startDate: true,
|
|
186
|
-
endDate: true,
|
|
187
|
-
imagePlaceholderUrl: true,
|
|
188
|
-
}).openapi({
|
|
189
|
-
title: "MinimalProject",
|
|
190
|
-
});
|
|
191
|
-
exports.SearchProjectsInputSchema = zod_openapi_1.z
|
|
134
|
+
}).openapi("GetProjectOutput");
|
|
135
|
+
exports.ProjectSearchDocumentSchema = zod_openapi_1.z
|
|
192
136
|
.object({
|
|
193
|
-
|
|
137
|
+
id: zod_openapi_1.z.string(),
|
|
138
|
+
userId: zod_openapi_1.z.string(),
|
|
139
|
+
title: zod_openapi_1.z.string(),
|
|
140
|
+
imagePlaceholderUrl: zod_openapi_1.z.url(),
|
|
141
|
+
projectCreatorType: zod_openapi_1.z.enum(constants_1.ROLES),
|
|
142
|
+
createdAt: zod_openapi_1.z.number(),
|
|
143
|
+
updatedAt: zod_openapi_1.z.number(),
|
|
144
|
+
description: zod_openapi_1.z.string().optional(),
|
|
145
|
+
capitalLookingToRaise: zod_openapi_1.z.string().optional(),
|
|
146
|
+
capitalLookingToRaiseCurrency: zod_openapi_1.z.enum(constants_1.WAGES_CURRENCY).optional(),
|
|
147
|
+
url: zod_openapi_1.z.url().optional(),
|
|
194
148
|
tags: zod_openapi_1.z.array(zod_openapi_1.z.string()).optional(),
|
|
195
|
-
|
|
196
|
-
|
|
197
|
-
|
|
198
|
-
|
|
199
|
-
|
|
200
|
-
|
|
201
|
-
cursor: zod_openapi_1.z
|
|
202
|
-
.string()
|
|
203
|
-
.optional()
|
|
204
|
-
.openapi({ example: "ckl1y9xyz0000qv7a0h1efgh4" }),
|
|
149
|
+
clientId: zod_openapi_1.z.string().optional(),
|
|
150
|
+
clientType: zod_openapi_1.z.enum(constants_1.CLIENT_TYPES).optional(),
|
|
151
|
+
clientName: zod_openapi_1.z.string().optional(),
|
|
152
|
+
isFeatured: zod_openapi_1.z.boolean().optional(),
|
|
153
|
+
startDate: zod_openapi_1.z.number().optional(),
|
|
154
|
+
endDate: zod_openapi_1.z.number().optional(),
|
|
205
155
|
})
|
|
206
|
-
.openapi(
|
|
207
|
-
title: "ListProjectsInput",
|
|
208
|
-
});
|
|
156
|
+
.openapi("ProjectSearchDocument");
|
|
209
157
|
exports.SearchProjectsOutputSchema = zod_openapi_1.z
|
|
210
158
|
.object({
|
|
211
|
-
projects: zod_openapi_1.z.array(exports.
|
|
159
|
+
projects: zod_openapi_1.z.array(exports.ProjectSearchDocumentSchema),
|
|
212
160
|
nextCursor: zod_openapi_1.z.string().optional().nullable(),
|
|
213
161
|
})
|
|
214
|
-
.openapi(
|
|
215
|
-
title: "SearchProjectsOutput",
|
|
216
|
-
});
|
|
217
|
-
exports.ProjectWithProjectViewsEntitySchema = exports.MinimalProjectSchema.extend({
|
|
218
|
-
views: zod_openapi_1.z.array(view_1.ViewEntitySchema),
|
|
219
|
-
}).openapi({
|
|
220
|
-
title: "ProjectWithProjectViewsEntity",
|
|
221
|
-
});
|
|
162
|
+
.openapi("SearchProjectsOutput");
|
|
222
163
|
exports.ProjectWithProjectCommentsEntitySchema = exports.MinimalProjectSchema.extend({
|
|
223
164
|
comments: zod_openapi_1.z.array(comment_1.CommentEntitySchema),
|
|
224
|
-
}).openapi(
|
|
225
|
-
|
|
226
|
-
|
|
165
|
+
}).openapi("ProjectWithProjectCommentsEntity");
|
|
166
|
+
exports.GetProjectWithCommentsOutputSchema = exports.ProjectWithProjectCommentsEntitySchema.extend({
|
|
167
|
+
nextCursor: zod_openapi_1.z.string().optional().nullable(),
|
|
168
|
+
}).openapi("GetProjectWithCommentsOutput");
|
|
227
169
|
exports.ProjectWithLikesEntitySchema = exports.MinimalProjectSchema.extend({
|
|
228
170
|
likes: zod_openapi_1.z.array(activity_1.ActivitySchema.extend({
|
|
229
171
|
followsYou: zod_openapi_1.z.boolean().optional(),
|
|
230
172
|
isFollowing: zod_openapi_1.z.boolean().optional(),
|
|
231
173
|
})),
|
|
232
|
-
}).openapi(
|
|
233
|
-
|
|
234
|
-
|
|
174
|
+
}).openapi("ProjectWithLikesEntity");
|
|
175
|
+
exports.GetProjectWithLikesOutputSchema = exports.ProjectWithLikesEntitySchema.extend({
|
|
176
|
+
nextCursor: zod_openapi_1.z.string().optional().nullable(),
|
|
177
|
+
}).openapi("GetProjectWithLikesOutput");
|
|
178
|
+
exports.ProjectWithProjectViewsEntitySchema = exports.MinimalProjectSchema.extend({
|
|
179
|
+
views: zod_openapi_1.z.array(view_1.ViewEntitySchema),
|
|
180
|
+
}).openapi("ProjectWithProjectViewsEntity");
|
|
235
181
|
exports.ProjectWithProjectBookmarksEntitySchema = exports.MinimalProjectSchema.extend({
|
|
236
182
|
bookmarks: zod_openapi_1.z.array(bookmark_1.BookmarkEntitySchema),
|
|
237
|
-
}).openapi(
|
|
238
|
-
|
|
183
|
+
}).openapi("ProjectWithProjectBookmarksEntity");
|
|
184
|
+
exports.ProjectUpdateOutputEntitySchema = zod_openapi_1.z.object({
|
|
185
|
+
id: zod_openapi_1.z.cuid2(),
|
|
239
186
|
});
|
|
240
|
-
exports.
|
|
241
|
-
|
|
187
|
+
exports.CreateProjectOutputSchema = exports.ProjectEntitySchema;
|
|
188
|
+
exports.UpdateProjectOutputSchema = exports.ProjectEntitySchema;
|
|
189
|
+
exports.DeleteProjectOutputSchema = exports.ProjectEntitySchema;
|
|
190
|
+
exports.CommentOnProjectOutputSchema = comment_1.CommentEntitySchema.omit({
|
|
191
|
+
likesCount: true,
|
|
192
|
+
isLiked: true,
|
|
242
193
|
});
|
|
243
|
-
|
|
244
|
-
|
|
194
|
+
/**
|
|
195
|
+
* SEARCH & UTILITY SCHEMAS
|
|
196
|
+
*/
|
|
197
|
+
exports.ProjectIdSchema = zod_openapi_1.z.object({ projectId: zod_openapi_1.z.cuid2() });
|
|
198
|
+
exports.CreateProjectFileInputSchema = zod_openapi_1.z.object({
|
|
199
|
+
key: zod_openapi_1.z.string().max(500),
|
|
200
|
+
projectId: zod_openapi_1.z.cuid2(),
|
|
201
|
+
});
|
|
202
|
+
exports.DeleteProjectFileInputSchema = zod_openapi_1.z.object({
|
|
203
|
+
keys: zod_openapi_1.z.array(zod_openapi_1.z.string()),
|
|
245
204
|
});
|
package/dist/schemas/user.d.ts
CHANGED
|
@@ -210,13 +210,18 @@ export declare const UserProfileEntitySchema: z.ZodObject<{
|
|
|
210
210
|
export declare const UserWithProjectsEntitySchema: z.ZodObject<{
|
|
211
211
|
userId: z.ZodCUID2;
|
|
212
212
|
projects: z.ZodArray<z.ZodObject<{
|
|
213
|
-
id: z.
|
|
214
|
-
userId: z.
|
|
213
|
+
id: z.ZodCUID2;
|
|
214
|
+
userId: z.ZodCUID2;
|
|
215
|
+
status: z.ZodEnum<{
|
|
216
|
+
readonly ACTIVE: "ACTIVE";
|
|
217
|
+
readonly DRAFT: "DRAFT";
|
|
218
|
+
readonly ARCHIVED: "ARCHIVED";
|
|
219
|
+
}>;
|
|
215
220
|
description: z.ZodOptional<z.ZodString>;
|
|
216
221
|
title: z.ZodString;
|
|
217
222
|
createdAt: z.ZodCoercedDate<unknown>;
|
|
218
223
|
updatedAt: z.ZodCoercedDate<unknown>;
|
|
219
|
-
url: z.ZodOptional<z.
|
|
224
|
+
url: z.ZodOptional<z.ZodURL>;
|
|
220
225
|
imagePlaceholderUrl: z.ZodURL;
|
|
221
226
|
tags: z.ZodOptional<z.ZodArray<z.ZodString>>;
|
|
222
227
|
projectCreatorType: z.ZodEnum<{
|
|
@@ -225,12 +230,7 @@ export declare const UserWithProjectsEntitySchema: z.ZodObject<{
|
|
|
225
230
|
readonly INVESTOR: "INVESTOR";
|
|
226
231
|
readonly ADMIN: "ADMIN";
|
|
227
232
|
}>;
|
|
228
|
-
clientId: z.ZodOptional<z.
|
|
229
|
-
status: z.ZodEnum<{
|
|
230
|
-
readonly ACTIVE: "ACTIVE";
|
|
231
|
-
readonly DRAFT: "DRAFT";
|
|
232
|
-
readonly ARCHIVED: "ARCHIVED";
|
|
233
|
-
}>;
|
|
233
|
+
clientId: z.ZodOptional<z.ZodCUID2>;
|
|
234
234
|
clientType: z.ZodOptional<z.ZodEnum<{
|
|
235
235
|
readonly CREATIVE: "CREATIVE";
|
|
236
236
|
readonly BRAND: "BRAND";
|
|
@@ -267,7 +267,7 @@ export declare const UserWithProjectsEntitySchema: z.ZodObject<{
|
|
|
267
267
|
currentTraction: z.ZodString;
|
|
268
268
|
startDate: z.ZodOptional<z.ZodCoercedDate<unknown>>;
|
|
269
269
|
endDate: z.ZodOptional<z.ZodCoercedDate<unknown>>;
|
|
270
|
-
version: z.
|
|
270
|
+
version: z.ZodNumber;
|
|
271
271
|
}, z.core.$strip>>;
|
|
272
272
|
}, z.core.$strip>;
|
|
273
273
|
export declare const UserWithProjectLikesEntitySchema: z.ZodObject<{
|
|
@@ -286,7 +286,7 @@ export declare const UserWithProjectLikesEntitySchema: z.ZodObject<{
|
|
|
286
286
|
readonly JOB_APPLICATION: "JOB_APPLICATION";
|
|
287
287
|
}>;
|
|
288
288
|
project: z.ZodObject<{
|
|
289
|
-
id: z.
|
|
289
|
+
id: z.ZodCUID2;
|
|
290
290
|
description: z.ZodOptional<z.ZodString>;
|
|
291
291
|
title: z.ZodString;
|
|
292
292
|
imagePlaceholderUrl: z.ZodURL;
|
|
@@ -366,7 +366,7 @@ export declare const UserWithProjectBookmarksEntitySchema: z.ZodObject<{
|
|
|
366
366
|
readonly JOB_APPLICATION: "JOB_APPLICATION";
|
|
367
367
|
}>;
|
|
368
368
|
project: z.ZodObject<{
|
|
369
|
-
id: z.
|
|
369
|
+
id: z.ZodCUID2;
|
|
370
370
|
description: z.ZodOptional<z.ZodString>;
|
|
371
371
|
title: z.ZodString;
|
|
372
372
|
imagePlaceholderUrl: z.ZodURL;
|
|
@@ -726,13 +726,18 @@ export declare const GetAuthenticatedUserProfileOutputSchema: z.ZodObject<{
|
|
|
726
726
|
export declare const GetAuthenticatedUserWithProjectsOutputSchema: z.ZodObject<{
|
|
727
727
|
userId: z.ZodCUID2;
|
|
728
728
|
projects: z.ZodArray<z.ZodObject<{
|
|
729
|
-
id: z.
|
|
730
|
-
userId: z.
|
|
729
|
+
id: z.ZodCUID2;
|
|
730
|
+
userId: z.ZodCUID2;
|
|
731
|
+
status: z.ZodEnum<{
|
|
732
|
+
readonly ACTIVE: "ACTIVE";
|
|
733
|
+
readonly DRAFT: "DRAFT";
|
|
734
|
+
readonly ARCHIVED: "ARCHIVED";
|
|
735
|
+
}>;
|
|
731
736
|
description: z.ZodOptional<z.ZodString>;
|
|
732
737
|
title: z.ZodString;
|
|
733
738
|
createdAt: z.ZodCoercedDate<unknown>;
|
|
734
739
|
updatedAt: z.ZodCoercedDate<unknown>;
|
|
735
|
-
url: z.ZodOptional<z.
|
|
740
|
+
url: z.ZodOptional<z.ZodURL>;
|
|
736
741
|
imagePlaceholderUrl: z.ZodURL;
|
|
737
742
|
tags: z.ZodOptional<z.ZodArray<z.ZodString>>;
|
|
738
743
|
projectCreatorType: z.ZodEnum<{
|
|
@@ -741,12 +746,7 @@ export declare const GetAuthenticatedUserWithProjectsOutputSchema: z.ZodObject<{
|
|
|
741
746
|
readonly INVESTOR: "INVESTOR";
|
|
742
747
|
readonly ADMIN: "ADMIN";
|
|
743
748
|
}>;
|
|
744
|
-
clientId: z.ZodOptional<z.
|
|
745
|
-
status: z.ZodEnum<{
|
|
746
|
-
readonly ACTIVE: "ACTIVE";
|
|
747
|
-
readonly DRAFT: "DRAFT";
|
|
748
|
-
readonly ARCHIVED: "ARCHIVED";
|
|
749
|
-
}>;
|
|
749
|
+
clientId: z.ZodOptional<z.ZodCUID2>;
|
|
750
750
|
clientType: z.ZodOptional<z.ZodEnum<{
|
|
751
751
|
readonly CREATIVE: "CREATIVE";
|
|
752
752
|
readonly BRAND: "BRAND";
|
|
@@ -783,7 +783,7 @@ export declare const GetAuthenticatedUserWithProjectsOutputSchema: z.ZodObject<{
|
|
|
783
783
|
currentTraction: z.ZodString;
|
|
784
784
|
startDate: z.ZodOptional<z.ZodCoercedDate<unknown>>;
|
|
785
785
|
endDate: z.ZodOptional<z.ZodCoercedDate<unknown>>;
|
|
786
|
-
version: z.
|
|
786
|
+
version: z.ZodNumber;
|
|
787
787
|
}, z.core.$strip>>;
|
|
788
788
|
}, z.core.$strip>;
|
|
789
789
|
export declare const GetAuthenticatedUserWithProjectBookmarksOutputSchema: z.ZodObject<{
|
|
@@ -802,7 +802,7 @@ export declare const GetAuthenticatedUserWithProjectBookmarksOutputSchema: z.Zod
|
|
|
802
802
|
readonly JOB_APPLICATION: "JOB_APPLICATION";
|
|
803
803
|
}>;
|
|
804
804
|
project: z.ZodObject<{
|
|
805
|
-
id: z.
|
|
805
|
+
id: z.ZodCUID2;
|
|
806
806
|
description: z.ZodOptional<z.ZodString>;
|
|
807
807
|
title: z.ZodString;
|
|
808
808
|
imagePlaceholderUrl: z.ZodURL;
|
|
@@ -884,7 +884,7 @@ export declare const GetAuthenticatedUserWithProjectLikesOutputSchema: z.ZodObje
|
|
|
884
884
|
readonly JOB_APPLICATION: "JOB_APPLICATION";
|
|
885
885
|
}>;
|
|
886
886
|
project: z.ZodObject<{
|
|
887
|
-
id: z.
|
|
887
|
+
id: z.ZodCUID2;
|
|
888
888
|
description: z.ZodOptional<z.ZodString>;
|
|
889
889
|
title: z.ZodString;
|
|
890
890
|
imagePlaceholderUrl: z.ZodURL;
|
package/dist/types/project.d.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import type { z } from "@hono/zod-openapi";
|
|
2
|
-
import type { ProjectEntitySchema, ProjectIdSchema, MinimalProjectSchema, ProjectDetailsEntitySchema, ProjectWithProjectViewsEntitySchema, ProjectWithProjectCommentsEntitySchema, ProjectWithLikesEntitySchema, ProjectWithProjectBookmarksEntitySchema, CreateProjectInputSchema, CreateProjectOutputSchema, UpdateProjectInputSchema, UpdateProjectOutputSchema, DeleteProjectOutputSchema, GetProjectOutputSchema, SearchProjectsInputSchema, SearchProjectsOutputSchema, GetProjectWithLikesOutputSchema, GetProjectWithCommentsOutputSchema } from "../schemas/project";
|
|
2
|
+
import type { ProjectEntitySchema, ProjectIdSchema, MinimalProjectSchema, ProjectDetailsEntitySchema, ProjectWithProjectViewsEntitySchema, ProjectWithProjectCommentsEntitySchema, ProjectWithLikesEntitySchema, ProjectWithProjectBookmarksEntitySchema, CreateProjectInputSchema, CreateProjectOutputSchema, UpdateProjectInputSchema, UpdateProjectOutputSchema, DeleteProjectOutputSchema, GetProjectOutputSchema, SearchProjectsInputSchema, SearchProjectsOutputSchema, GetProjectWithLikesOutputSchema, GetProjectWithCommentsOutputSchema, CommentOnProjectInputSchema, CommentOnProjectOutputSchema, ProjectSearchDocumentSchema, CreateProjectFileInputSchema, DeleteProjectFileInputSchema } from "../schemas/project";
|
|
3
3
|
import { ViewEntitySchema } from "../schemas/view";
|
|
4
4
|
import { LikeEntitySchema } from "../schemas/like";
|
|
5
5
|
import { CommentEntitySchema } from "../schemas/comment";
|
|
@@ -24,3 +24,8 @@ export type SearchProjectsInput = z.infer<typeof SearchProjectsInputSchema>;
|
|
|
24
24
|
export type SearchProjectsOutput = z.infer<typeof SearchProjectsOutputSchema>;
|
|
25
25
|
export type GetProjectWithCommentsOutput = z.infer<typeof GetProjectWithCommentsOutputSchema>;
|
|
26
26
|
export type GetProjectWithLikesOutput = z.infer<typeof GetProjectWithLikesOutputSchema>;
|
|
27
|
+
export type CommentOnProjectInput = z.infer<typeof CommentOnProjectInputSchema>;
|
|
28
|
+
export type CommentOnProjectOutput = z.infer<typeof CommentOnProjectOutputSchema>;
|
|
29
|
+
export type ProjectSearchDocument = z.infer<typeof ProjectSearchDocumentSchema>;
|
|
30
|
+
export type ProjectFileInput = z.infer<typeof CreateProjectFileInputSchema>;
|
|
31
|
+
export type DeleteProjectFileInput = z.infer<typeof DeleteProjectFileInputSchema>;
|
package/package.json
CHANGED
package/src/schemas/common.ts
CHANGED
|
@@ -20,3 +20,8 @@ export const ProjectIdentifierSchema = z.object({
|
|
|
20
20
|
|
|
21
21
|
export type ProjectIdentifier = z.infer<typeof ProjectIdentifierSchema>;
|
|
22
22
|
|
|
23
|
+
export const DefaultApiSuccessOutputSchema = z.object({
|
|
24
|
+
status: z.literal("success"),
|
|
25
|
+
});
|
|
26
|
+
|
|
27
|
+
export type ApiSuccessOutput = z.infer<typeof DefaultApiSuccessOutputSchema>;
|