@zyacreatives/shared 1.5.4 → 1.5.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.
@@ -43,3 +43,6 @@ export declare const GetPresignedDownloadUrlInputSchema: z.ZodObject<{
43
43
  export declare const GetPresignedDownloadUrlOutputSchema: z.ZodObject<{
44
44
  url: z.ZodURL;
45
45
  }, z.core.$strip>;
46
+ export declare const FileKeySchema: z.ZodObject<{
47
+ key: z.ZodString;
48
+ }, z.core.$strip>;
@@ -1,6 +1,6 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.GetPresignedDownloadUrlOutputSchema = exports.GetPresignedDownloadUrlInputSchema = exports.GetPresignedUploadUrlOutputSchema = exports.GetPresignedUploadUrlInputSchema = exports.DeleteFileOutputSchema = exports.DeleteFileInputSchema = exports.CreateFileOutputSchema = exports.CreateFileInputSchema = exports.FileUpdateInputSchema = exports.FileEntitySchema = void 0;
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;
4
4
  const zod_openapi_1 = require("@hono/zod-openapi");
5
5
  exports.FileEntitySchema = zod_openapi_1.z
6
6
  .object({
@@ -47,3 +47,6 @@ exports.GetPresignedDownloadUrlInputSchema = zod_openapi_1.z.object({
47
47
  fileId: zod_openapi_1.z.cuid2().openapi({ example: "0irjif0qur09481u90r1u" }),
48
48
  });
49
49
  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
+ });
@@ -1,14 +1,12 @@
1
1
  import { z } from "@hono/zod-openapi";
2
- import { CreateFileInputSchema, CreateFileOutputSchema, DeleteFileInputSchema, DeleteFileOutputSchema, FileEntitySchema, FileUpdateInputSchema, GetPresignedDownloadUrlInputSchema, GetPresignedDownloadUrlOutputSchema, GetPresignedUploadUrlInputSchema, GetPresignedUploadUrlOutputSchema } from "../schemas/file";
2
+ import { CreateFileInputSchema, CreateFileOutputSchema, DeleteFileInputSchema, DeleteFileOutputSchema, FileEntitySchema, FileKeySchema, FileUpdateInputSchema, GetPresignedDownloadUrlInputSchema, GetPresignedDownloadUrlOutputSchema, GetPresignedUploadUrlInputSchema, GetPresignedUploadUrlOutputSchema } from "../schemas/file";
3
3
  export type FileEntity = z.infer<typeof FileEntitySchema>;
4
4
  export type CreateFileInput = z.infer<typeof CreateFileInputSchema>;
5
5
  export type CreateFileOutput = z.infer<typeof CreateFileOutputSchema>;
6
6
  export type FileUpdateEntity = z.infer<typeof FileUpdateInputSchema>;
7
7
  export type DeleteFileInput = z.infer<typeof DeleteFileInputSchema>;
8
8
  export type DeleteFileOutput = z.infer<typeof DeleteFileOutputSchema>;
9
- export type FileKeyInput = {
10
- key: string;
11
- };
9
+ export type FileKeyInput = z.infer<typeof FileKeySchema>;
12
10
  export type GetPresignedUploadUrlInput = z.infer<typeof GetPresignedUploadUrlInputSchema>;
13
11
  export type GetPresignedUploadUrlOutput = z.infer<typeof GetPresignedUploadUrlOutputSchema>;
14
12
  export type GetPresignedDownloadUrlInput = z.infer<typeof GetPresignedDownloadUrlInputSchema>;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@zyacreatives/shared",
3
- "version": "1.5.4",
3
+ "version": "1.5.5",
4
4
  "description": "",
5
5
  "main": "dist/index.js",
6
6
  "types": "dist/index.d.ts",
@@ -55,3 +55,7 @@ export const GetPresignedDownloadUrlInputSchema = z.object({
55
55
 
56
56
  export const GetPresignedDownloadUrlOutputSchema =
57
57
  GetPresignedUploadUrlOutputSchema;
58
+
59
+ export const FileKeySchema = z.object({
60
+ key: z.string().max(400, {error: "Key should not be longner than 400 characters"}),
61
+ });
package/src/types/file.ts CHANGED
@@ -5,6 +5,7 @@ import {
5
5
  DeleteFileInputSchema,
6
6
  DeleteFileOutputSchema,
7
7
  FileEntitySchema,
8
+ FileKeySchema,
8
9
  FileUpdateInputSchema,
9
10
  GetPresignedDownloadUrlInputSchema,
10
11
  GetPresignedDownloadUrlOutputSchema,
@@ -22,8 +23,7 @@ export type FileUpdateEntity = z.infer<typeof FileUpdateInputSchema>;
22
23
  export type DeleteFileInput = z.infer<typeof DeleteFileInputSchema>;
23
24
  export type DeleteFileOutput = z.infer<typeof DeleteFileOutputSchema>;
24
25
 
25
- export type FileKeyInput = { key: string };
26
-
26
+ export type FileKeyInput = z.infer<typeof FileKeySchema>;
27
27
  export type GetPresignedUploadUrlInput = z.infer<
28
28
  typeof GetPresignedUploadUrlInputSchema
29
29
  >;