@zyacreatives/shared 1.4.6 → 1.4.8

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.
@@ -177,93 +177,6 @@ export declare const API_ROUTES: {
177
177
  readonly getProjectUser: "/:projectId/user";
178
178
  };
179
179
  };
180
- export declare const FRONTEND_API_ROUTES: {
181
- readonly healthCheck: "health";
182
- readonly username: {
183
- readonly base: "usernames";
184
- readonly checkAvailability: (username: string) => string;
185
- };
186
- readonly personal: {
187
- readonly base: "me";
188
- readonly getUser: "";
189
- readonly getProfile: "profile";
190
- readonly getProjects: "projects";
191
- readonly getProjectBookmarks: "project-bookmarks";
192
- readonly getFollowers: "followers";
193
- readonly getFollowing: "following";
194
- };
195
- readonly user: {
196
- readonly base: "users";
197
- readonly getUser: (value: string) => string;
198
- readonly getProfile: (value: string) => string;
199
- readonly getProjects: (value: string) => string;
200
- readonly getFollowers: (userId: string) => string;
201
- readonly getFollowing: (userId: string) => string;
202
- readonly followUser: (userId: string) => string;
203
- readonly unfollowUser: (userId: string) => string;
204
- readonly reserveUsername: "reserve-username";
205
- };
206
- readonly redirect: {
207
- readonly base: "redirect";
208
- readonly passwordReset: "password-reset";
209
- readonly verifiedUser: "verified-user";
210
- readonly googleProfile: "google-profile";
211
- readonly newGoogleProfile: "new-google-profile";
212
- };
213
- readonly file: {
214
- readonly base: "files";
215
- readonly getPresignedUploadUrl: "get-upload-url";
216
- readonly getPresignedDownloadUrl: (fileId: string) => string;
217
- readonly getPublicUrl: (fileId: string) => string;
218
- readonly createFile: "";
219
- readonly deleteFile: (fileId: string) => string;
220
- };
221
- readonly disciplines: {
222
- readonly base: "disciplines";
223
- readonly getDisciplines: "";
224
- readonly getSingleDiscipline: (slug: string) => string;
225
- readonly addDisciplines: "";
226
- readonly deleteDiscipline: (slug: string) => string;
227
- };
228
- readonly creatives: {
229
- readonly base: "creatives";
230
- readonly createCreative: "";
231
- readonly getCreative: (value: string) => string;
232
- readonly updateCreative: "";
233
- };
234
- readonly brands: {
235
- readonly base: "brands";
236
- readonly createBrand: "";
237
- readonly getBrand: (value: string) => string;
238
- readonly updateBrand: "";
239
- };
240
- readonly investors: {
241
- readonly base: "investors";
242
- readonly createInvestor: "";
243
- readonly getInvestor: (value: string) => string;
244
- readonly updateInvestor: "";
245
- };
246
- readonly projects: {
247
- readonly base: "projects";
248
- readonly createProject: "";
249
- readonly updateProject: "";
250
- readonly listProjects: "";
251
- readonly getProject: (projectId: string) => string;
252
- readonly deleteProject: (projectId: string) => string;
253
- readonly commentOnProject: (projectId: string) => string;
254
- readonly deleteCommentOnProject: (projectId: string, commentId: string) => string;
255
- readonly bookmarkProject: (projectId: string) => string;
256
- readonly unbookmarkProject: (projectId: string) => string;
257
- readonly likeProject: (projectId: string) => string;
258
- readonly unlikeProject: (projectId: string) => string;
259
- readonly viewProject: (projectId: string) => string;
260
- readonly getProjectComments: (projectId: string) => string;
261
- readonly getProjectLikes: (projectId: string) => string;
262
- readonly getProjectBookmarks: (projectId: string) => string;
263
- readonly getProjectViews: (projectId: string) => string;
264
- readonly getProjectUser: (projectId: string) => string;
265
- };
266
- };
267
180
  export declare const DEFAULT_DISCIPLINES: {
268
181
  name: string;
269
182
  slug: string;
package/dist/constants.js CHANGED
@@ -1,6 +1,6 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.DEFAULT_DISCIPLINES = exports.FRONTEND_API_ROUTES = exports.API_ROUTES = exports.INVESTOR_VERIFICATION_DOCUMENT_TYPES = exports.INVESTOR_VERIFICATION_DOCUMENT_STATUSES = exports.GEOGRAPHIC_FOCUS = exports.INVESTMENT_SIZES = exports.INVESTOR_TYPES = exports.ONBOARDING_PAGES = exports.EXPERIENCE_LEVELS = exports.CLIENT_TYPES = exports.USER_STATUSES = exports.ROLES = void 0;
3
+ exports.DEFAULT_DISCIPLINES = exports.API_ROUTES = exports.INVESTOR_VERIFICATION_DOCUMENT_TYPES = exports.INVESTOR_VERIFICATION_DOCUMENT_STATUSES = exports.GEOGRAPHIC_FOCUS = exports.INVESTMENT_SIZES = exports.INVESTOR_TYPES = exports.ONBOARDING_PAGES = exports.EXPERIENCE_LEVELS = exports.CLIENT_TYPES = exports.USER_STATUSES = exports.ROLES = void 0;
4
4
  exports.ROLES = {
5
5
  CREATIVE: "CREATIVE",
6
6
  BRAND: "BRAND",
@@ -170,93 +170,6 @@ exports.API_ROUTES = {
170
170
  getProjectUser: "/:projectId/user",
171
171
  },
172
172
  };
173
- exports.FRONTEND_API_ROUTES = {
174
- healthCheck: "health",
175
- username: {
176
- base: "usernames",
177
- checkAvailability: (username) => `${username}/availability`,
178
- },
179
- personal: {
180
- base: "me",
181
- getUser: "",
182
- getProfile: "profile",
183
- getProjects: "projects",
184
- getProjectBookmarks: "project-bookmarks",
185
- getFollowers: "followers",
186
- getFollowing: "following",
187
- },
188
- user: {
189
- base: "users",
190
- getUser: (value) => `${value}`,
191
- getProfile: (value) => `${value}/profile`,
192
- getProjects: (value) => `${value}/projects`,
193
- getFollowers: (userId) => `${userId}/followers`,
194
- getFollowing: (userId) => `${userId}/following`,
195
- followUser: (userId) => `${userId}/follow`,
196
- unfollowUser: (userId) => `${userId}/unfollow`,
197
- reserveUsername: "reserve-username",
198
- },
199
- redirect: {
200
- base: "redirect",
201
- passwordReset: "password-reset",
202
- verifiedUser: "verified-user",
203
- googleProfile: "google-profile",
204
- newGoogleProfile: "new-google-profile",
205
- },
206
- file: {
207
- base: "files",
208
- getPresignedUploadUrl: "get-upload-url",
209
- getPresignedDownloadUrl: (fileId) => `${fileId}/download-url`,
210
- getPublicUrl: (fileId) => `${fileId}/public-url`,
211
- createFile: "",
212
- deleteFile: (fileId) => `${fileId}`,
213
- },
214
- disciplines: {
215
- base: "disciplines",
216
- getDisciplines: "",
217
- getSingleDiscipline: (slug) => `${slug}`,
218
- addDisciplines: "",
219
- deleteDiscipline: (slug) => `${slug}`,
220
- },
221
- creatives: {
222
- base: "creatives",
223
- createCreative: "",
224
- getCreative: (value) => `${value}`,
225
- updateCreative: "",
226
- },
227
- brands: {
228
- base: "brands",
229
- createBrand: "",
230
- getBrand: (value) => `${value}`,
231
- updateBrand: "",
232
- },
233
- investors: {
234
- base: "investors",
235
- createInvestor: "",
236
- getInvestor: (value) => `${value}`,
237
- updateInvestor: "",
238
- },
239
- projects: {
240
- base: "projects",
241
- createProject: "",
242
- updateProject: "",
243
- listProjects: "",
244
- getProject: (projectId) => `${projectId}`,
245
- deleteProject: (projectId) => `${projectId}`,
246
- commentOnProject: (projectId) => `${projectId}/comment`,
247
- deleteCommentOnProject: (projectId, commentId) => `${projectId}/comments/${commentId}`,
248
- bookmarkProject: (projectId) => `${projectId}/bookmark`,
249
- unbookmarkProject: (projectId) => `${projectId}/unbookmark`,
250
- likeProject: (projectId) => `${projectId}/like`,
251
- unlikeProject: (projectId) => `${projectId}/unlike`,
252
- viewProject: (projectId) => `${projectId}/view`,
253
- getProjectComments: (projectId) => `${projectId}/comments`,
254
- getProjectLikes: (projectId) => `${projectId}/likes`,
255
- getProjectBookmarks: (projectId) => `${projectId}/bookmarks`,
256
- getProjectViews: (projectId) => `${projectId}/views`,
257
- getProjectUser: (projectId) => `${projectId}/user`,
258
- },
259
- };
260
173
  exports.DEFAULT_DISCIPLINES = [
261
174
  { name: "Painting", slug: "painting" },
262
175
  { name: "Drawing", slug: "drawing" },
@@ -1,45 +1,45 @@
1
1
  import { z } from "@hono/zod-openapi";
2
2
  export declare const FileEntitySchema: z.ZodObject<{
3
- key: z.ZodString;
4
3
  id: z.ZodCUID2;
4
+ key: z.ZodString;
5
+ mimeType: z.ZodString;
5
6
  url: z.ZodOptional<z.ZodURL>;
7
+ userId: z.ZodCUID2;
6
8
  createdAt: z.ZodCoercedDate<unknown>;
7
9
  updatedAt: z.ZodCoercedDate<unknown>;
8
- userId: z.ZodCUID2;
9
- mimeType: z.ZodString;
10
10
  }, z.core.$strip>;
11
- export declare const FileUpdateEntitySchema: z.ZodObject<{
11
+ export declare const FileUpdateInputSchema: z.ZodObject<{
12
12
  id: z.ZodString;
13
13
  }, z.core.$strip>;
14
- export declare const GetFilePresignedUploadUrlInputSchema: z.ZodObject<{
15
- key: z.ZodString;
16
- }, z.core.$strip>;
17
- export declare const GetFilePresignedUploadUrlOutputSchema: z.ZodObject<{
18
- url: z.ZodURL;
19
- }, z.core.$strip>;
20
- export declare const GetFilePresignedDownloadUrlParams: z.ZodObject<{
21
- fileId: z.ZodCUID2;
22
- }, z.core.$strip>;
23
- export declare const GetFilePresignedDownloadUrlOutputSchema: z.ZodObject<{
24
- url: z.ZodURL;
25
- }, z.core.$strip>;
26
14
  export declare const CreateFileInputSchema: z.ZodObject<{
27
15
  key: z.ZodString;
28
16
  mimeType: z.ZodString;
29
17
  }, z.core.$strip>;
30
18
  export declare const CreateFileOutputSchema: z.ZodObject<{
31
- key: z.ZodString;
32
19
  id: z.ZodCUID2;
20
+ key: z.ZodString;
21
+ mimeType: z.ZodString;
33
22
  url: z.ZodOptional<z.ZodURL>;
23
+ userId: z.ZodCUID2;
34
24
  createdAt: z.ZodCoercedDate<unknown>;
35
25
  updatedAt: z.ZodCoercedDate<unknown>;
36
- userId: z.ZodCUID2;
37
- mimeType: z.ZodString;
38
26
  }, z.core.$strip>;
39
- export declare const DeleteFileInputParams: z.ZodObject<{
27
+ export declare const DeleteFileInputSchema: z.ZodObject<{
40
28
  fileId: z.ZodOptional<z.ZodCUID2>;
41
29
  key: z.ZodOptional<z.ZodCUID2>;
42
30
  }, z.core.$strip>;
43
31
  export declare const DeleteFileOutputSchema: z.ZodObject<{
44
32
  id: z.ZodCUID2;
45
33
  }, z.core.$strip>;
34
+ export declare const GetPresignedUploadUrlInputSchema: z.ZodObject<{
35
+ key: z.ZodString;
36
+ }, z.core.$strip>;
37
+ export declare const GetPresignedUploadUrlOutputSchema: z.ZodObject<{
38
+ url: z.ZodURL;
39
+ }, z.core.$strip>;
40
+ export declare const GetPresignedDownloadUrlInputSchema: z.ZodObject<{
41
+ fileId: z.ZodCUID2;
42
+ }, z.core.$strip>;
43
+ export declare const GetPresignedDownloadUrlOutputSchema: z.ZodObject<{
44
+ url: z.ZodURL;
45
+ }, z.core.$strip>;
@@ -1,51 +1,49 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.DeleteFileOutputSchema = exports.DeleteFileInputParams = exports.CreateFileOutputSchema = exports.CreateFileInputSchema = exports.GetFilePresignedDownloadUrlOutputSchema = exports.GetFilePresignedDownloadUrlParams = exports.GetFilePresignedUploadUrlOutputSchema = exports.GetFilePresignedUploadUrlInputSchema = exports.FileUpdateEntitySchema = exports.FileEntitySchema = void 0;
3
+ exports.GetPresignedDownloadUrlOutputSchema = exports.GetPresignedDownloadUrlInputSchema = exports.GetPresignedUploadUrlOutputSchema = exports.GetPresignedUploadUrlInputSchema = exports.DeleteFileOutputSchema = exports.DeleteFileInputSchema = exports.CreateFileOutputSchema = exports.CreateFileInputSchema = exports.FileUpdateInputSchema = exports.FileEntitySchema = void 0;
4
4
  const zod_openapi_1 = require("@hono/zod-openapi");
5
5
  exports.FileEntitySchema = zod_openapi_1.z
6
6
  .object({
7
- key: zod_openapi_1.z.string().openapi({ example: "profile-pic-12345" }),
8
7
  id: zod_openapi_1.z.cuid2().openapi({ example: "f123e4567-e89b-12d3-a456-426614174000" }),
8
+ key: zod_openapi_1.z.string().openapi({ example: "profile-pic-12345" }),
9
+ mimeType: zod_openapi_1.z.string().openapi({ example: "image/jpeg" }),
9
10
  url: zod_openapi_1.z
10
11
  .url()
11
12
  .optional()
12
13
  .openapi({ example: "https://example.com/file.jpg" }),
13
- createdAt: zod_openapi_1.z.coerce.date().openapi({ example: "2025-10-14T08:00:00.000Z" }),
14
- updatedAt: zod_openapi_1.z.coerce.date().openapi({ example: "2025-10-14T09:00:00.000Z" }),
15
14
  userId: zod_openapi_1.z
16
15
  .cuid2()
17
16
  .openapi({ example: "u123e4567-e89b-12d3-a456-426614174000" }),
18
- mimeType: zod_openapi_1.z.string().openapi({ example: "image/jpeg" }),
17
+ createdAt: zod_openapi_1.z.coerce.date().openapi({ example: "2025-10-14T08:00:00.000Z" }),
18
+ updatedAt: zod_openapi_1.z.coerce.date().openapi({ example: "2025-10-14T09:00:00.000Z" }),
19
19
  })
20
20
  .openapi({ title: "FileEntity" });
21
- exports.FileUpdateEntitySchema = zod_openapi_1.z
21
+ exports.FileUpdateInputSchema = zod_openapi_1.z
22
22
  .object({
23
23
  id: zod_openapi_1.z
24
24
  .string()
25
25
  .openapi({ example: "f123e4567-e89b-12d3-a456-426614174000" }),
26
26
  })
27
- .openapi({ title: "FileUpdateEntity" });
28
- exports.GetFilePresignedUploadUrlInputSchema = zod_openapi_1.z.object({
29
- key: zod_openapi_1.z.string().openapi({ example: "/users/123/pfp" }),
30
- });
31
- exports.GetFilePresignedUploadUrlOutputSchema = zod_openapi_1.z.object({
32
- url: zod_openapi_1.z.url().openapi({ example: "https//www.cloudflare.img" }),
33
- });
34
- exports.GetFilePresignedDownloadUrlParams = zod_openapi_1.z.object({
35
- fileId: zod_openapi_1.z.cuid2().openapi({ example: "0irjif0qur09481u90r1u" }),
36
- });
37
- exports.GetFilePresignedDownloadUrlOutputSchema = exports.GetFilePresignedUploadUrlOutputSchema;
27
+ .openapi({ title: "FileUpdateInput" });
38
28
  exports.CreateFileInputSchema = zod_openapi_1.z.object({
39
29
  key: zod_openapi_1.z.string().openapi({ example: "uploads/audio/podcast789.mp3" }),
40
- mimeType: zod_openapi_1.z.string().openapi({
41
- example: "audio/mpeg",
42
- }),
30
+ mimeType: zod_openapi_1.z.string().openapi({ example: "audio/mpeg" }),
43
31
  });
44
32
  exports.CreateFileOutputSchema = exports.FileEntitySchema;
45
- exports.DeleteFileInputParams = zod_openapi_1.z.object({
33
+ exports.DeleteFileInputSchema = zod_openapi_1.z.object({
46
34
  fileId: zod_openapi_1.z.cuid2().optional().openapi({ example: "0irjif0qur09481u90r1u" }),
47
35
  key: zod_openapi_1.z.cuid2().optional(),
48
36
  });
49
37
  exports.DeleteFileOutputSchema = zod_openapi_1.z.object({
50
38
  id: zod_openapi_1.z.cuid2().openapi({ example: "r90rjnaneifijhi31" }),
51
39
  });
40
+ exports.GetPresignedUploadUrlInputSchema = zod_openapi_1.z.object({
41
+ key: zod_openapi_1.z.string().openapi({ example: "/users/123/pfp" }),
42
+ });
43
+ exports.GetPresignedUploadUrlOutputSchema = zod_openapi_1.z.object({
44
+ url: zod_openapi_1.z.url().openapi({ example: "https://www.cloudflare.img" }),
45
+ });
46
+ exports.GetPresignedDownloadUrlInputSchema = zod_openapi_1.z.object({
47
+ fileId: zod_openapi_1.z.cuid2().openapi({ example: "0irjif0qur09481u90r1u" }),
48
+ });
49
+ exports.GetPresignedDownloadUrlOutputSchema = exports.GetPresignedUploadUrlOutputSchema;
@@ -76,13 +76,13 @@ export declare const ProjectWithFilesEntitySchema: z.ZodObject<{
76
76
  id: z.ZodString;
77
77
  fileId: z.ZodString;
78
78
  file: z.ZodObject<{
79
- key: z.ZodString;
80
79
  id: z.ZodCUID2;
80
+ key: z.ZodString;
81
+ mimeType: z.ZodString;
81
82
  url: z.ZodOptional<z.ZodURL>;
83
+ userId: z.ZodCUID2;
82
84
  createdAt: z.ZodCoercedDate<unknown>;
83
85
  updatedAt: z.ZodCoercedDate<unknown>;
84
- userId: z.ZodCUID2;
85
- mimeType: z.ZodString;
86
86
  }, z.core.$strip>;
87
87
  }, z.core.$strip>>>;
88
88
  }, z.core.$strip>;
@@ -330,13 +330,13 @@ export declare const GetProjectOutputSchema: z.ZodObject<{
330
330
  id: z.ZodString;
331
331
  fileId: z.ZodString;
332
332
  file: z.ZodObject<{
333
- key: z.ZodString;
334
333
  id: z.ZodCUID2;
334
+ key: z.ZodString;
335
+ mimeType: z.ZodString;
335
336
  url: z.ZodOptional<z.ZodURL>;
337
+ userId: z.ZodCUID2;
336
338
  createdAt: z.ZodCoercedDate<unknown>;
337
339
  updatedAt: z.ZodCoercedDate<unknown>;
338
- userId: z.ZodCUID2;
339
- mimeType: z.ZodString;
340
340
  }, z.core.$strip>;
341
341
  }, z.core.$strip>>>;
342
342
  }, z.core.$strip>;
@@ -1,15 +1,15 @@
1
1
  import { z } from "@hono/zod-openapi";
2
- import { CreateFileInputSchema, CreateFileOutputSchema, DeleteFileInputParams, DeleteFileOutputSchema, FileEntitySchema, FileUpdateEntitySchema, GetFilePresignedDownloadUrlParams, GetFilePresignedUploadUrlInputSchema, GetFilePresignedUploadUrlOutputSchema } from "../schemas/file";
2
+ import { CreateFileInputSchema, CreateFileOutputSchema, DeleteFileInputSchema, DeleteFileOutputSchema, FileEntitySchema, FileUpdateInputSchema, GetPresignedDownloadUrlInputSchema, GetPresignedDownloadUrlOutputSchema, GetPresignedUploadUrlInputSchema, GetPresignedUploadUrlOutputSchema } from "../schemas/file";
3
3
  export type FileEntity = z.infer<typeof FileEntitySchema>;
4
- export type FileUpdateEntity = z.infer<typeof FileUpdateEntitySchema>;
5
- export type GetPresignedUploadUrlInput = z.infer<typeof GetFilePresignedUploadUrlInputSchema>;
6
- export type FileKeyInput = {
7
- key: string;
8
- };
9
- export type GetPresignedUploadUrlOutput = z.infer<typeof GetFilePresignedUploadUrlOutputSchema>;
10
- export type GetPresignedDownloadUrlInput = z.infer<typeof GetFilePresignedDownloadUrlParams>;
11
- export type GetPresignedDownloadUrlOutput = GetPresignedUploadUrlOutput;
12
4
  export type CreateFileInput = z.infer<typeof CreateFileInputSchema>;
13
5
  export type CreateFileOutput = z.infer<typeof CreateFileOutputSchema>;
14
- export type DeleteFileInput = z.infer<typeof DeleteFileInputParams>;
6
+ export type FileUpdateEntity = z.infer<typeof FileUpdateInputSchema>;
7
+ export type DeleteFileInput = z.infer<typeof DeleteFileInputSchema>;
15
8
  export type DeleteFileOutput = z.infer<typeof DeleteFileOutputSchema>;
9
+ export type FileKeyInput = {
10
+ key: string;
11
+ };
12
+ export type GetPresignedUploadUrlInput = z.infer<typeof GetPresignedUploadUrlInputSchema>;
13
+ export type GetPresignedUploadUrlOutput = z.infer<typeof GetPresignedUploadUrlOutputSchema>;
14
+ export type GetPresignedDownloadUrlInput = z.infer<typeof GetPresignedDownloadUrlInputSchema>;
15
+ export type GetPresignedDownloadUrlOutput = z.infer<typeof GetPresignedDownloadUrlOutputSchema>;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@zyacreatives/shared",
3
- "version": "1.4.6",
3
+ "version": "1.4.8",
4
4
  "description": "",
5
5
  "main": "dist/index.js",
6
6
  "types": "dist/index.d.ts",
package/src/constants.ts CHANGED
@@ -195,95 +195,6 @@ export const API_ROUTES = {
195
195
  },
196
196
  } as const;
197
197
 
198
- export const FRONTEND_API_ROUTES = {
199
- healthCheck: "health",
200
- username: {
201
- base: "usernames",
202
- checkAvailability: (username: string) => `${username}/availability`,
203
- },
204
- personal: {
205
- base: "me",
206
- getUser: "",
207
- getProfile: "profile",
208
- getProjects: "projects",
209
- getProjectBookmarks: "project-bookmarks",
210
- getFollowers: "followers",
211
- getFollowing: "following",
212
- },
213
- user: {
214
- base: "users",
215
- getUser: (value: string) => `${value}`,
216
- getProfile: (value: string) => `${value}/profile`,
217
- getProjects: (value: string) => `${value}/projects`,
218
- getFollowers: (userId: string) => `${userId}/followers`,
219
- getFollowing: (userId: string) => `${userId}/following`,
220
- followUser: (userId: string) => `${userId}/follow`,
221
- unfollowUser: (userId: string) => `${userId}/unfollow`,
222
- reserveUsername: "reserve-username",
223
- },
224
- redirect: {
225
- base: "redirect",
226
- passwordReset: "password-reset",
227
- verifiedUser: "verified-user",
228
- googleProfile: "google-profile",
229
- newGoogleProfile: "new-google-profile",
230
- },
231
- file: {
232
- base: "files",
233
- getPresignedUploadUrl: "get-upload-url",
234
- getPresignedDownloadUrl: (fileId: string) => `${fileId}/download-url`,
235
- getPublicUrl: (fileId: string) => `${fileId}/public-url`,
236
- createFile: "",
237
- deleteFile: (fileId: string) => `${fileId}`,
238
- },
239
- disciplines: {
240
- base: "disciplines",
241
- getDisciplines: "",
242
- getSingleDiscipline: (slug: string) => `${slug}`,
243
- addDisciplines: "",
244
- deleteDiscipline: (slug: string) => `${slug}`,
245
- },
246
- creatives: {
247
- base: "creatives",
248
- createCreative: "",
249
- getCreative: (value: string) => `${value}`,
250
- updateCreative: "",
251
- },
252
- brands: {
253
- base: "brands",
254
- createBrand: "",
255
- getBrand: (value: string) => `${value}`,
256
- updateBrand: "",
257
- },
258
- investors: {
259
- base: "investors",
260
- createInvestor: "",
261
- getInvestor: (value: string) => `${value}`,
262
- updateInvestor: "",
263
- },
264
- projects: {
265
- base: "projects",
266
- createProject: "",
267
- updateProject: "",
268
- listProjects: "",
269
- getProject: (projectId: string) => `${projectId}`,
270
- deleteProject: (projectId: string) => `${projectId}`,
271
- commentOnProject: (projectId: string) => `${projectId}/comment`,
272
- deleteCommentOnProject: (projectId: string, commentId: string) =>
273
- `${projectId}/comments/${commentId}`,
274
- bookmarkProject: (projectId: string) => `${projectId}/bookmark`,
275
- unbookmarkProject: (projectId: string) => `${projectId}/unbookmark`,
276
- likeProject: (projectId: string) => `${projectId}/like`,
277
- unlikeProject: (projectId: string) => `${projectId}/unlike`,
278
- viewProject: (projectId: string) => `${projectId}/view`,
279
- getProjectComments: (projectId: string) => `${projectId}/comments`,
280
- getProjectLikes: (projectId: string) => `${projectId}/likes`,
281
- getProjectBookmarks: (projectId: string) => `${projectId}/bookmarks`,
282
- getProjectViews: (projectId: string) => `${projectId}/views`,
283
- getProjectUser: (projectId: string) => `${projectId}/user`,
284
- },
285
- } as const;
286
-
287
198
  export const DEFAULT_DISCIPLINES = [
288
199
  { name: "Painting", slug: "painting" },
289
200
  { name: "Drawing", slug: "drawing" },
@@ -2,54 +2,37 @@ import { z } from "@hono/zod-openapi";
2
2
 
3
3
  export const FileEntitySchema = z
4
4
  .object({
5
- key: z.string().openapi({ example: "profile-pic-12345" }),
6
5
  id: z.cuid2().openapi({ example: "f123e4567-e89b-12d3-a456-426614174000" }),
6
+ key: z.string().openapi({ example: "profile-pic-12345" }),
7
+ mimeType: z.string().openapi({ example: "image/jpeg" }),
7
8
  url: z
8
9
  .url()
9
10
  .optional()
10
11
  .openapi({ example: "https://example.com/file.jpg" }),
11
- createdAt: z.coerce.date().openapi({ example: "2025-10-14T08:00:00.000Z" }),
12
- updatedAt: z.coerce.date().openapi({ example: "2025-10-14T09:00:00.000Z" }),
13
12
  userId: z
14
13
  .cuid2()
15
14
  .openapi({ example: "u123e4567-e89b-12d3-a456-426614174000" }),
16
- mimeType: z.string().openapi({ example: "image/jpeg" }),
15
+ createdAt: z.coerce.date().openapi({ example: "2025-10-14T08:00:00.000Z" }),
16
+ updatedAt: z.coerce.date().openapi({ example: "2025-10-14T09:00:00.000Z" }),
17
17
  })
18
18
  .openapi({ title: "FileEntity" });
19
19
 
20
- export const FileUpdateEntitySchema = z
20
+ export const FileUpdateInputSchema = z
21
21
  .object({
22
22
  id: z
23
23
  .string()
24
24
  .openapi({ example: "f123e4567-e89b-12d3-a456-426614174000" }),
25
25
  })
26
- .openapi({ title: "FileUpdateEntity" });
27
-
28
- export const GetFilePresignedUploadUrlInputSchema = z.object({
29
- key: z.string().openapi({ example: "/users/123/pfp" }),
30
- });
31
-
32
- export const GetFilePresignedUploadUrlOutputSchema = z.object({
33
- url: z.url().openapi({ example: "https//www.cloudflare.img" }),
34
- });
35
-
36
- export const GetFilePresignedDownloadUrlParams = z.object({
37
- fileId: z.cuid2().openapi({ example: "0irjif0qur09481u90r1u" }),
38
- });
39
-
40
- export const GetFilePresignedDownloadUrlOutputSchema =
41
- GetFilePresignedUploadUrlOutputSchema;
26
+ .openapi({ title: "FileUpdateInput" });
42
27
 
43
28
  export const CreateFileInputSchema = z.object({
44
29
  key: z.string().openapi({ example: "uploads/audio/podcast789.mp3" }),
45
- mimeType: z.string().openapi({
46
- example: "audio/mpeg",
47
- }),
30
+ mimeType: z.string().openapi({ example: "audio/mpeg" }),
48
31
  });
49
32
 
50
33
  export const CreateFileOutputSchema = FileEntitySchema;
51
34
 
52
- export const DeleteFileInputParams = z.object({
35
+ export const DeleteFileInputSchema = z.object({
53
36
  fileId: z.cuid2().optional().openapi({ example: "0irjif0qur09481u90r1u" }),
54
37
  key: z.cuid2().optional(),
55
38
  });
@@ -57,3 +40,18 @@ export const DeleteFileInputParams = z.object({
57
40
  export const DeleteFileOutputSchema = z.object({
58
41
  id: z.cuid2().openapi({ example: "r90rjnaneifijhi31" }),
59
42
  });
43
+
44
+ export const GetPresignedUploadUrlInputSchema = z.object({
45
+ key: z.string().openapi({ example: "/users/123/pfp" }),
46
+ });
47
+
48
+ export const GetPresignedUploadUrlOutputSchema = z.object({
49
+ url: z.url().openapi({ example: "https://www.cloudflare.img" }),
50
+ });
51
+
52
+ export const GetPresignedDownloadUrlInputSchema = z.object({
53
+ fileId: z.cuid2().openapi({ example: "0irjif0qur09481u90r1u" }),
54
+ });
55
+
56
+ export const GetPresignedDownloadUrlOutputSchema =
57
+ GetPresignedUploadUrlOutputSchema;
package/src/types/file.ts CHANGED
@@ -2,37 +2,38 @@ import { z } from "@hono/zod-openapi";
2
2
  import {
3
3
  CreateFileInputSchema,
4
4
  CreateFileOutputSchema,
5
- DeleteFileInputParams,
5
+ DeleteFileInputSchema,
6
6
  DeleteFileOutputSchema,
7
7
  FileEntitySchema,
8
- FileUpdateEntitySchema,
9
- GetFilePresignedDownloadUrlParams,
10
- GetFilePresignedUploadUrlInputSchema,
11
- GetFilePresignedUploadUrlOutputSchema,
8
+ FileUpdateInputSchema,
9
+ GetPresignedDownloadUrlInputSchema,
10
+ GetPresignedDownloadUrlOutputSchema,
11
+ GetPresignedUploadUrlInputSchema,
12
+ GetPresignedUploadUrlOutputSchema,
12
13
  } from "../schemas/file";
13
14
 
14
15
  export type FileEntity = z.infer<typeof FileEntitySchema>;
15
16
 
16
- export type FileUpdateEntity = z.infer<typeof FileUpdateEntitySchema>;
17
+ export type CreateFileInput = z.infer<typeof CreateFileInputSchema>;
18
+ export type CreateFileOutput = z.infer<typeof CreateFileOutputSchema>;
19
+
20
+ export type FileUpdateEntity = z.infer<typeof FileUpdateInputSchema>;
21
+
22
+ export type DeleteFileInput = z.infer<typeof DeleteFileInputSchema>;
23
+ export type DeleteFileOutput = z.infer<typeof DeleteFileOutputSchema>;
24
+
25
+ export type FileKeyInput = { key: string };
17
26
 
18
27
  export type GetPresignedUploadUrlInput = z.infer<
19
- typeof GetFilePresignedUploadUrlInputSchema
28
+ typeof GetPresignedUploadUrlInputSchema
20
29
  >;
21
- export type FileKeyInput = {
22
- key: string;
23
- };
24
-
25
30
  export type GetPresignedUploadUrlOutput = z.infer<
26
- typeof GetFilePresignedUploadUrlOutputSchema
31
+ typeof GetPresignedUploadUrlOutputSchema
27
32
  >;
28
33
 
29
34
  export type GetPresignedDownloadUrlInput = z.infer<
30
- typeof GetFilePresignedDownloadUrlParams
35
+ typeof GetPresignedDownloadUrlInputSchema
36
+ >;
37
+ export type GetPresignedDownloadUrlOutput = z.infer<
38
+ typeof GetPresignedDownloadUrlOutputSchema
31
39
  >;
32
-
33
- export type GetPresignedDownloadUrlOutput = GetPresignedUploadUrlOutput;
34
-
35
- export type CreateFileInput = z.infer<typeof CreateFileInputSchema>;
36
- export type CreateFileOutput = z.infer<typeof CreateFileOutputSchema>;
37
- export type DeleteFileInput = z.infer<typeof DeleteFileInputParams>;
38
- export type DeleteFileOutput = z.infer<typeof DeleteFileOutputSchema>;