@zyacreatives/shared 1.3.3 → 1.3.5
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/file.d.ts +6 -6
- package/dist/schemas/file.js +6 -4
- package/dist/types/file.d.ts +2 -2
- package/package.json +1 -1
- package/src/schemas/file.ts +5 -5
- package/src/types/file.ts +4 -1
package/dist/schemas/file.d.ts
CHANGED
|
@@ -3,8 +3,8 @@ export declare const FileEntitySchema: z.ZodObject<{
|
|
|
3
3
|
key: z.ZodString;
|
|
4
4
|
id: z.ZodCUID2;
|
|
5
5
|
url: z.ZodOptional<z.ZodURL>;
|
|
6
|
-
createdAt: z.
|
|
7
|
-
updatedAt: z.
|
|
6
|
+
createdAt: z.ZodCoercedDate<unknown>;
|
|
7
|
+
updatedAt: z.ZodCoercedDate<unknown>;
|
|
8
8
|
userId: z.ZodCUID2;
|
|
9
9
|
mimeType: z.ZodString;
|
|
10
10
|
}, z.core.$strip>;
|
|
@@ -17,8 +17,8 @@ export declare const GetFilePresignedUploadUrlInputSchema: z.ZodObject<{
|
|
|
17
17
|
export declare const GetFilePresignedUploadUrlOutputSchema: z.ZodObject<{
|
|
18
18
|
url: z.ZodURL;
|
|
19
19
|
}, z.core.$strip>;
|
|
20
|
-
export declare const
|
|
21
|
-
|
|
20
|
+
export declare const GetFilePresignedDownloadUrlParams: z.ZodObject<{
|
|
21
|
+
fileId: z.ZodCUID2;
|
|
22
22
|
}, z.core.$strip>;
|
|
23
23
|
export declare const GetFilePresignedDownloadUrlOutputSchema: z.ZodObject<{
|
|
24
24
|
url: z.ZodURL;
|
|
@@ -31,8 +31,8 @@ export declare const CreateFileOutputSchema: z.ZodObject<{
|
|
|
31
31
|
key: z.ZodString;
|
|
32
32
|
id: z.ZodCUID2;
|
|
33
33
|
url: z.ZodOptional<z.ZodURL>;
|
|
34
|
-
createdAt: z.
|
|
35
|
-
updatedAt: z.
|
|
34
|
+
createdAt: z.ZodCoercedDate<unknown>;
|
|
35
|
+
updatedAt: z.ZodCoercedDate<unknown>;
|
|
36
36
|
userId: z.ZodCUID2;
|
|
37
37
|
mimeType: z.ZodString;
|
|
38
38
|
}, z.core.$strip>;
|
package/dist/schemas/file.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.DeleteFileOutputSchema = exports.DeleteFileInputParams = exports.CreateFileOutputSchema = exports.CreateFileInputSchema = exports.GetFilePresignedDownloadUrlOutputSchema = exports.
|
|
3
|
+
exports.DeleteFileOutputSchema = exports.DeleteFileInputParams = exports.CreateFileOutputSchema = exports.CreateFileInputSchema = exports.GetFilePresignedDownloadUrlOutputSchema = exports.GetFilePresignedDownloadUrlParams = exports.GetFilePresignedUploadUrlOutputSchema = exports.GetFilePresignedUploadUrlInputSchema = exports.FileUpdateEntitySchema = 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({
|
|
@@ -10,8 +10,8 @@ exports.FileEntitySchema = zod_openapi_1.z
|
|
|
10
10
|
.url()
|
|
11
11
|
.optional()
|
|
12
12
|
.openapi({ example: "https://example.com/file.jpg" }),
|
|
13
|
-
createdAt: zod_openapi_1.z.
|
|
14
|
-
updatedAt: zod_openapi_1.z.
|
|
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
15
|
userId: zod_openapi_1.z
|
|
16
16
|
.cuid2()
|
|
17
17
|
.openapi({ example: "u123e4567-e89b-12d3-a456-426614174000" }),
|
|
@@ -31,7 +31,9 @@ exports.GetFilePresignedUploadUrlInputSchema = zod_openapi_1.z.object({
|
|
|
31
31
|
exports.GetFilePresignedUploadUrlOutputSchema = zod_openapi_1.z.object({
|
|
32
32
|
url: zod_openapi_1.z.url().openapi({ example: "https//www.cloudflare.img" }),
|
|
33
33
|
});
|
|
34
|
-
exports.
|
|
34
|
+
exports.GetFilePresignedDownloadUrlParams = zod_openapi_1.z.object({
|
|
35
|
+
fileId: zod_openapi_1.z.cuid2().openapi({ example: "0irjif0qur09481u90r1u" }),
|
|
36
|
+
});
|
|
35
37
|
exports.GetFilePresignedDownloadUrlOutputSchema = exports.GetFilePresignedUploadUrlOutputSchema;
|
|
36
38
|
exports.CreateFileInputSchema = zod_openapi_1.z.object({
|
|
37
39
|
key: zod_openapi_1.z.string().openapi({ example: "uploads/audio/podcast789.mp3" }),
|
package/dist/types/file.d.ts
CHANGED
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
import { z } from "@hono/zod-openapi";
|
|
2
|
-
import { CreateFileInputSchema, CreateFileOutputSchema, DeleteFileInputParams, DeleteFileOutputSchema, FileEntitySchema, FileUpdateEntitySchema, GetFilePresignedUploadUrlInputSchema, GetFilePresignedUploadUrlOutputSchema } from "../schemas/file";
|
|
2
|
+
import { CreateFileInputSchema, CreateFileOutputSchema, DeleteFileInputParams, DeleteFileOutputSchema, FileEntitySchema, FileUpdateEntitySchema, GetFilePresignedDownloadUrlParams, GetFilePresignedUploadUrlInputSchema, GetFilePresignedUploadUrlOutputSchema } from "../schemas/file";
|
|
3
3
|
export type FileEntity = z.infer<typeof FileEntitySchema>;
|
|
4
4
|
export type FileUpdateEntity = z.infer<typeof FileUpdateEntitySchema>;
|
|
5
5
|
export type GetPresignedUploadUrlInput = z.infer<typeof GetFilePresignedUploadUrlInputSchema>;
|
|
6
6
|
export type GetPresignedUploadUrlOutput = z.infer<typeof GetFilePresignedUploadUrlOutputSchema>;
|
|
7
|
-
export type GetPresignedDownloadUrlInput =
|
|
7
|
+
export type GetPresignedDownloadUrlInput = z.infer<typeof GetFilePresignedDownloadUrlParams>;
|
|
8
8
|
export type GetPresignedDownloadUrlOutput = GetPresignedUploadUrlOutput;
|
|
9
9
|
export type CreateFileInput = z.infer<typeof CreateFileInputSchema>;
|
|
10
10
|
export type CreateFileOutput = z.infer<typeof CreateFileOutputSchema>;
|
package/package.json
CHANGED
package/src/schemas/file.ts
CHANGED
|
@@ -8,8 +8,8 @@ export const FileEntitySchema = z
|
|
|
8
8
|
.url()
|
|
9
9
|
.optional()
|
|
10
10
|
.openapi({ example: "https://example.com/file.jpg" }),
|
|
11
|
-
createdAt: z.
|
|
12
|
-
updatedAt: z.
|
|
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
13
|
userId: z
|
|
14
14
|
.cuid2()
|
|
15
15
|
.openapi({ example: "u123e4567-e89b-12d3-a456-426614174000" }),
|
|
@@ -33,9 +33,9 @@ export const GetFilePresignedUploadUrlOutputSchema = z.object({
|
|
|
33
33
|
url: z.url().openapi({ example: "https//www.cloudflare.img" }),
|
|
34
34
|
});
|
|
35
35
|
|
|
36
|
-
export const
|
|
37
|
-
|
|
38
|
-
|
|
36
|
+
export const GetFilePresignedDownloadUrlParams = z.object({
|
|
37
|
+
fileId: z.cuid2().openapi({ example: "0irjif0qur09481u90r1u" }),
|
|
38
|
+
});
|
|
39
39
|
export const GetFilePresignedDownloadUrlOutputSchema =
|
|
40
40
|
GetFilePresignedUploadUrlOutputSchema;
|
|
41
41
|
|
package/src/types/file.ts
CHANGED
|
@@ -6,6 +6,7 @@ import {
|
|
|
6
6
|
DeleteFileOutputSchema,
|
|
7
7
|
FileEntitySchema,
|
|
8
8
|
FileUpdateEntitySchema,
|
|
9
|
+
GetFilePresignedDownloadUrlParams,
|
|
9
10
|
GetFilePresignedUploadUrlInputSchema,
|
|
10
11
|
GetFilePresignedUploadUrlOutputSchema,
|
|
11
12
|
} from "../schemas/file";
|
|
@@ -22,7 +23,9 @@ export type GetPresignedUploadUrlOutput = z.infer<
|
|
|
22
23
|
typeof GetFilePresignedUploadUrlOutputSchema
|
|
23
24
|
>;
|
|
24
25
|
|
|
25
|
-
export type GetPresignedDownloadUrlInput =
|
|
26
|
+
export type GetPresignedDownloadUrlInput = z.infer<
|
|
27
|
+
typeof GetFilePresignedDownloadUrlParams
|
|
28
|
+
>;
|
|
26
29
|
|
|
27
30
|
export type GetPresignedDownloadUrlOutput = GetPresignedUploadUrlOutput;
|
|
28
31
|
|