@zyacreatives/shared 1.3.4 → 1.3.6

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.
@@ -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 GetFilePresignedDownloadUrlInputSchema: z.ZodObject<{
21
- key: z.ZodString;
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;
@@ -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.GetFilePresignedDownloadUrlInputSchema = exports.GetFilePresignedUploadUrlOutputSchema = exports.GetFilePresignedUploadUrlInputSchema = exports.FileUpdateEntitySchema = exports.FileEntitySchema = void 0;
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({
@@ -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.GetFilePresignedDownloadUrlInputSchema = exports.GetFilePresignedUploadUrlInputSchema;
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" }),
@@ -1,10 +1,13 @@
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
+ export type FileKeyInput = {
7
+ key: string;
8
+ };
6
9
  export type GetPresignedUploadUrlOutput = z.infer<typeof GetFilePresignedUploadUrlOutputSchema>;
7
- export type GetPresignedDownloadUrlInput = GetPresignedUploadUrlInput;
10
+ export type GetPresignedDownloadUrlInput = z.infer<typeof GetFilePresignedDownloadUrlParams>;
8
11
  export type GetPresignedDownloadUrlOutput = GetPresignedUploadUrlOutput;
9
12
  export type CreateFileInput = z.infer<typeof CreateFileInputSchema>;
10
13
  export type CreateFileOutput = z.infer<typeof CreateFileOutputSchema>;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@zyacreatives/shared",
3
- "version": "1.3.4",
3
+ "version": "1.3.6",
4
4
  "description": "",
5
5
  "main": "dist/index.js",
6
6
  "types": "dist/index.d.ts",
@@ -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 GetFilePresignedDownloadUrlInputSchema =
37
- GetFilePresignedUploadUrlInputSchema;
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";
@@ -17,12 +18,17 @@ export type FileUpdateEntity = z.infer<typeof FileUpdateEntitySchema>;
17
18
  export type GetPresignedUploadUrlInput = z.infer<
18
19
  typeof GetFilePresignedUploadUrlInputSchema
19
20
  >;
21
+ export type FileKeyInput = {
22
+ key: string;
23
+ };
20
24
 
21
25
  export type GetPresignedUploadUrlOutput = z.infer<
22
26
  typeof GetFilePresignedUploadUrlOutputSchema
23
27
  >;
24
28
 
25
- export type GetPresignedDownloadUrlInput = GetPresignedUploadUrlInput;
29
+ export type GetPresignedDownloadUrlInput = z.infer<
30
+ typeof GetFilePresignedDownloadUrlParams
31
+ >;
26
32
 
27
33
  export type GetPresignedDownloadUrlOutput = GetPresignedUploadUrlOutput;
28
34