@zyacreatives/shared 2.3.7 → 2.3.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.
@@ -3,46 +3,107 @@ export declare const FileEntitySchema: z.ZodObject<{
3
3
  id: z.ZodCUID2;
4
4
  key: z.ZodString;
5
5
  mimeType: z.ZodString;
6
- url: z.ZodOptional<z.ZodURL>;
6
+ url: z.ZodURL;
7
7
  userId: z.ZodCUID2;
8
+ parentId: z.ZodNullable<z.ZodCUID2>;
9
+ parentType: z.ZodNullable<z.ZodEnum<{
10
+ readonly PROJECT: "PROJECT";
11
+ readonly USER: "USER";
12
+ readonly JOB: "JOB";
13
+ readonly POST: "POST";
14
+ readonly PRODUCT: "PRODUCT";
15
+ readonly COMMENT: "COMMENT";
16
+ readonly JOB_APPLICATION: "JOB_APPLICATION";
17
+ }>>;
18
+ isThumbnail: z.ZodNullable<z.ZodBoolean>;
19
+ order: z.ZodNumber;
8
20
  createdAt: z.ZodCoercedDate<unknown>;
9
21
  updatedAt: z.ZodCoercedDate<unknown>;
22
+ deletedAt: z.ZodNullable<z.ZodCoercedDate<unknown>>;
10
23
  }, z.core.$strip>;
11
- export declare const FileUpdateInputSchema: z.ZodObject<{
12
- id: z.ZodString;
13
- }, z.core.$strip>;
24
+ export type FileEntity = z.infer<typeof FileEntitySchema>;
14
25
  export declare const CreateFileInputSchema: z.ZodObject<{
15
26
  key: z.ZodString;
16
27
  mimeType: z.ZodString;
28
+ parentId: z.ZodOptional<z.ZodCUID2>;
29
+ parentType: z.ZodOptional<z.ZodEnum<{
30
+ readonly PROJECT: "PROJECT";
31
+ readonly USER: "USER";
32
+ readonly JOB: "JOB";
33
+ readonly POST: "POST";
34
+ readonly PRODUCT: "PRODUCT";
35
+ readonly COMMENT: "COMMENT";
36
+ readonly JOB_APPLICATION: "JOB_APPLICATION";
37
+ }>>;
38
+ isThumbnail: z.ZodOptional<z.ZodBoolean>;
39
+ order: z.ZodDefault<z.ZodOptional<z.ZodNumber>>;
40
+ }, z.core.$strip>;
41
+ export type CreateFileInput = z.infer<typeof CreateFileInputSchema>;
42
+ export declare const FileUpdateInputSchema: z.ZodObject<{
43
+ id: z.ZodCUID2;
44
+ parentId: z.ZodOptional<z.ZodCUID2>;
45
+ parentType: z.ZodOptional<z.ZodEnum<{
46
+ readonly PROJECT: "PROJECT";
47
+ readonly USER: "USER";
48
+ readonly JOB: "JOB";
49
+ readonly POST: "POST";
50
+ readonly PRODUCT: "PRODUCT";
51
+ readonly COMMENT: "COMMENT";
52
+ readonly JOB_APPLICATION: "JOB_APPLICATION";
53
+ }>>;
54
+ isThumbnail: z.ZodOptional<z.ZodBoolean>;
55
+ order: z.ZodOptional<z.ZodNumber>;
17
56
  }, z.core.$strip>;
57
+ export type FileUpdateEntity = z.infer<typeof FileUpdateInputSchema>;
58
+ export declare const DeleteFileInputSchema: z.ZodObject<{
59
+ fileId: z.ZodOptional<z.ZodCUID2>;
60
+ key: z.ZodOptional<z.ZodString>;
61
+ }, z.core.$strip>;
62
+ export type DeleteFileInput = z.infer<typeof DeleteFileInputSchema>;
63
+ export declare const FileKeySchema: z.ZodObject<{
64
+ key: z.ZodString;
65
+ }, z.core.$strip>;
66
+ export type FileKeyInput = z.infer<typeof FileKeySchema>;
18
67
  export declare const CreateFileOutputSchema: z.ZodObject<{
19
68
  id: z.ZodCUID2;
20
69
  key: z.ZodString;
21
70
  mimeType: z.ZodString;
22
- url: z.ZodOptional<z.ZodURL>;
71
+ url: z.ZodURL;
23
72
  userId: z.ZodCUID2;
73
+ parentId: z.ZodNullable<z.ZodCUID2>;
74
+ parentType: z.ZodNullable<z.ZodEnum<{
75
+ readonly PROJECT: "PROJECT";
76
+ readonly USER: "USER";
77
+ readonly JOB: "JOB";
78
+ readonly POST: "POST";
79
+ readonly PRODUCT: "PRODUCT";
80
+ readonly COMMENT: "COMMENT";
81
+ readonly JOB_APPLICATION: "JOB_APPLICATION";
82
+ }>>;
83
+ isThumbnail: z.ZodNullable<z.ZodBoolean>;
84
+ order: z.ZodNumber;
24
85
  createdAt: z.ZodCoercedDate<unknown>;
25
86
  updatedAt: z.ZodCoercedDate<unknown>;
87
+ deletedAt: z.ZodNullable<z.ZodCoercedDate<unknown>>;
26
88
  }, z.core.$strip>;
27
- export declare const DeleteFileInputSchema: z.ZodObject<{
28
- fileId: z.ZodOptional<z.ZodCUID2>;
29
- key: z.ZodOptional<z.ZodCUID2>;
30
- }, z.core.$strip>;
89
+ export type CreateFileOutput = z.infer<typeof CreateFileOutputSchema>;
31
90
  export declare const DeleteFileOutputSchema: z.ZodObject<{
32
91
  id: z.ZodCUID2;
33
92
  }, z.core.$strip>;
93
+ export type DeleteFileOutput = z.infer<typeof DeleteFileOutputSchema>;
34
94
  export declare const GetPresignedUploadUrlInputSchema: z.ZodObject<{
35
95
  key: z.ZodString;
36
96
  }, z.core.$strip>;
97
+ export type GetPresignedUploadUrlInput = z.infer<typeof GetPresignedUploadUrlInputSchema>;
37
98
  export declare const GetPresignedUploadUrlOutputSchema: z.ZodObject<{
38
99
  url: z.ZodURL;
39
100
  }, z.core.$strip>;
101
+ export type GetPresignedUploadUrlOutput = z.infer<typeof GetPresignedUploadUrlOutputSchema>;
40
102
  export declare const GetPresignedDownloadUrlInputSchema: z.ZodObject<{
41
103
  fileId: z.ZodCUID2;
42
104
  }, z.core.$strip>;
105
+ export type GetPresignedDownloadUrlInput = z.infer<typeof GetPresignedDownloadUrlInputSchema>;
43
106
  export declare const GetPresignedDownloadUrlOutputSchema: z.ZodObject<{
44
107
  url: z.ZodURL;
45
108
  }, z.core.$strip>;
46
- export declare const FileKeySchema: z.ZodObject<{
47
- key: z.ZodString;
48
- }, z.core.$strip>;
109
+ export type GetPresignedDownloadUrlOutput = z.infer<typeof GetPresignedDownloadUrlOutputSchema>;
@@ -1,39 +1,64 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.FileKeySchema = exports.GetPresignedDownloadUrlOutputSchema = exports.GetPresignedDownloadUrlInputSchema = exports.GetPresignedUploadUrlOutputSchema = exports.GetPresignedUploadUrlInputSchema = exports.DeleteFileOutputSchema = exports.DeleteFileInputSchema = exports.CreateFileOutputSchema = exports.CreateFileInputSchema = exports.FileUpdateInputSchema = exports.FileEntitySchema = void 0;
3
+ exports.GetPresignedDownloadUrlOutputSchema = exports.GetPresignedDownloadUrlInputSchema = exports.GetPresignedUploadUrlOutputSchema = exports.GetPresignedUploadUrlInputSchema = exports.DeleteFileOutputSchema = exports.CreateFileOutputSchema = exports.FileKeySchema = exports.DeleteFileInputSchema = exports.FileUpdateInputSchema = exports.CreateFileInputSchema = exports.FileEntitySchema = void 0;
4
4
  const zod_openapi_1 = require("@hono/zod-openapi");
5
+ const constants_1 = require("../constants");
5
6
  exports.FileEntitySchema = zod_openapi_1.z
6
7
  .object({
7
8
  id: zod_openapi_1.z.cuid2().openapi({ example: "f123e4567-e89b-12d3-a456-426614174000" }),
8
9
  key: zod_openapi_1.z.string().openapi({ example: "profile-pic-12345" }),
9
10
  mimeType: zod_openapi_1.z.string().openapi({ example: "image/jpeg" }),
10
- url: zod_openapi_1.z
11
- .url()
12
- .optional()
13
- .openapi({ example: "https://example.com/file.jpg" }),
11
+ url: zod_openapi_1.z.url().openapi({ example: "https://example.com/file.jpg" }),
14
12
  userId: zod_openapi_1.z
15
13
  .cuid2()
16
14
  .openapi({ example: "u123e4567-e89b-12d3-a456-426614174000" }),
15
+ parentId: zod_openapi_1.z.cuid2().nullable().openapi({ example: "ckj1a2b3c0000xyz" }),
16
+ parentType: zod_openapi_1.z
17
+ .enum(constants_1.ACTIVITY_PARENT_TYPES)
18
+ .nullable()
19
+ .openapi({ example: "POST" }),
20
+ isThumbnail: zod_openapi_1.z.boolean().nullable().openapi({ example: false }),
21
+ order: zod_openapi_1.z.number().int().openapi({ example: 0 }),
17
22
  createdAt: zod_openapi_1.z.coerce.date().openapi({ example: "2025-10-14T08:00:00.000Z" }),
18
23
  updatedAt: zod_openapi_1.z.coerce.date().openapi({ example: "2025-10-14T09:00:00.000Z" }),
24
+ deletedAt: zod_openapi_1.z.coerce.date().nullable().openapi({ example: null }),
19
25
  })
20
26
  .openapi({ title: "FileEntity" });
21
- exports.FileUpdateInputSchema = zod_openapi_1.z
22
- .object({
23
- id: zod_openapi_1.z
24
- .string()
25
- .openapi({ example: "f123e4567-e89b-12d3-a456-426614174000" }),
26
- })
27
- .openapi({ title: "FileUpdateInput" });
27
+ // ─── Inputs ───────────────────────────────────────────────────────────────────
28
28
  exports.CreateFileInputSchema = zod_openapi_1.z.object({
29
29
  key: zod_openapi_1.z.string().openapi({ example: "uploads/audio/podcast789.mp3" }),
30
30
  mimeType: zod_openapi_1.z.string().openapi({ example: "audio/mpeg" }),
31
+ parentId: zod_openapi_1.z.cuid2().optional().openapi({ example: "ckj1a2b3c0000xyz" }),
32
+ parentType: zod_openapi_1.z
33
+ .enum(constants_1.ACTIVITY_PARENT_TYPES)
34
+ .optional()
35
+ .openapi({ example: "POST" }),
36
+ isThumbnail: zod_openapi_1.z.boolean().optional().openapi({ example: false }),
37
+ order: zod_openapi_1.z.number().int().optional().default(0).openapi({ example: 0 }),
31
38
  });
32
- exports.CreateFileOutputSchema = exports.FileEntitySchema;
39
+ exports.FileUpdateInputSchema = zod_openapi_1.z
40
+ .object({
41
+ id: zod_openapi_1.z.cuid2().openapi({ example: "f123e4567-e89b-12d3-a456-426614174000" }),
42
+ parentId: zod_openapi_1.z.cuid2().optional().openapi({ example: "ckj1a2b3c0000xyz" }),
43
+ parentType: zod_openapi_1.z
44
+ .enum(constants_1.ACTIVITY_PARENT_TYPES)
45
+ .optional()
46
+ .openapi({ example: "POST" }),
47
+ isThumbnail: zod_openapi_1.z.boolean().optional().openapi({ example: false }),
48
+ order: zod_openapi_1.z.number().int().optional().openapi({ example: 1 }),
49
+ })
50
+ .openapi({ title: "FileUpdateInput" });
33
51
  exports.DeleteFileInputSchema = zod_openapi_1.z.object({
34
52
  fileId: zod_openapi_1.z.cuid2().optional().openapi({ example: "0irjif0qur09481u90r1u" }),
35
- key: zod_openapi_1.z.cuid2().optional(),
53
+ key: zod_openapi_1.z.string().optional(),
54
+ });
55
+ exports.FileKeySchema = zod_openapi_1.z.object({
56
+ key: zod_openapi_1.z
57
+ .string()
58
+ .max(400, { error: "Key should not be longer than 400 characters" }),
36
59
  });
60
+ // ─── Outputs ──────────────────────────────────────────────────────────────────
61
+ exports.CreateFileOutputSchema = exports.FileEntitySchema;
37
62
  exports.DeleteFileOutputSchema = zod_openapi_1.z.object({
38
63
  id: zod_openapi_1.z.cuid2().openapi({ example: "r90rjnaneifijhi31" }),
39
64
  });
@@ -47,6 +72,3 @@ exports.GetPresignedDownloadUrlInputSchema = zod_openapi_1.z.object({
47
72
  fileId: zod_openapi_1.z.cuid2().openapi({ example: "0irjif0qur09481u90r1u" }),
48
73
  });
49
74
  exports.GetPresignedDownloadUrlOutputSchema = exports.GetPresignedUploadUrlOutputSchema;
50
- exports.FileKeySchema = zod_openapi_1.z.object({
51
- key: zod_openapi_1.z.string().max(400, { error: "Key should not be longner than 400 characters" }),
52
- });
@@ -143,6 +143,17 @@ export declare const CreateMessageInputSchema: z.ZodObject<{
143
143
  files: z.ZodOptional<z.ZodArray<z.ZodObject<{
144
144
  key: z.ZodString;
145
145
  mimeType: z.ZodString;
146
+ parentId: z.ZodOptional<z.ZodCUID2>;
147
+ parentType: z.ZodOptional<z.ZodEnum<{
148
+ readonly PROJECT: "PROJECT";
149
+ readonly USER: "USER";
150
+ readonly JOB: "JOB";
151
+ readonly POST: "POST";
152
+ readonly PRODUCT: "PRODUCT";
153
+ readonly COMMENT: "COMMENT";
154
+ readonly JOB_APPLICATION: "JOB_APPLICATION";
155
+ }>>;
156
+ isThumbnail: z.ZodOptional<z.ZodBoolean>;
146
157
  order: z.ZodNumber;
147
158
  }, z.core.$strip>>>;
148
159
  }, z.core.$strip>;