@zyacreatives/shared 1.3.1 → 1.3.2

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.
@@ -0,0 +1,44 @@
1
+ import { z } from "@hono/zod-openapi";
2
+ export declare const FileEntitySchema: z.ZodObject<{
3
+ key: z.ZodString;
4
+ id: z.ZodCUID2;
5
+ url: z.ZodOptional<z.ZodURL>;
6
+ createdAt: z.ZodString;
7
+ updatedAt: z.ZodString;
8
+ userId: z.ZodCUID2;
9
+ mimeType: z.ZodString;
10
+ }, z.core.$strip>;
11
+ export declare const FileUpdateEntitySchema: z.ZodObject<{
12
+ id: z.ZodString;
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 GetFilePresignedDownloadUrlInputSchema: z.ZodObject<{
21
+ key: z.ZodString;
22
+ }, z.core.$strip>;
23
+ export declare const GetFilePresignedDownloadUrlOutputSchema: z.ZodObject<{
24
+ url: z.ZodURL;
25
+ }, z.core.$strip>;
26
+ export declare const CreateFileInputSchema: z.ZodObject<{
27
+ key: z.ZodString;
28
+ mimeType: z.ZodString;
29
+ }, z.core.$strip>;
30
+ export declare const CreateFileOutputSchema: z.ZodObject<{
31
+ key: z.ZodString;
32
+ id: z.ZodCUID2;
33
+ url: z.ZodOptional<z.ZodURL>;
34
+ createdAt: z.ZodString;
35
+ updatedAt: z.ZodString;
36
+ userId: z.ZodCUID2;
37
+ mimeType: z.ZodString;
38
+ }, z.core.$strip>;
39
+ export declare const DeleteFileInputParams: z.ZodObject<{
40
+ fileId: z.ZodCUID2;
41
+ }, z.core.$strip>;
42
+ export declare const DeleteFileOutputSchema: z.ZodObject<{
43
+ id: z.ZodCUID2;
44
+ }, z.core.$strip>;
@@ -0,0 +1,48 @@
1
+ "use strict";
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;
4
+ const zod_openapi_1 = require("@hono/zod-openapi");
5
+ exports.FileEntitySchema = zod_openapi_1.z
6
+ .object({
7
+ key: zod_openapi_1.z.string().openapi({ example: "profile-pic-12345" }),
8
+ id: zod_openapi_1.z.cuid2().openapi({ example: "f123e4567-e89b-12d3-a456-426614174000" }),
9
+ url: zod_openapi_1.z
10
+ .url()
11
+ .optional()
12
+ .openapi({ example: "https://example.com/file.jpg" }),
13
+ createdAt: zod_openapi_1.z.string().openapi({ example: "2025-10-14T08:00:00.000Z" }),
14
+ updatedAt: zod_openapi_1.z.string().openapi({ example: "2025-10-14T09:00:00.000Z" }),
15
+ userId: zod_openapi_1.z
16
+ .cuid2()
17
+ .openapi({ example: "u123e4567-e89b-12d3-a456-426614174000" }),
18
+ mimeType: zod_openapi_1.z.string().openapi({ example: "image/jpeg" }),
19
+ })
20
+ .openapi({ title: "FileEntity" });
21
+ exports.FileUpdateEntitySchema = 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: "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.GetFilePresignedDownloadUrlInputSchema = exports.GetFilePresignedUploadUrlInputSchema;
35
+ exports.GetFilePresignedDownloadUrlOutputSchema = exports.GetFilePresignedUploadUrlOutputSchema;
36
+ exports.CreateFileInputSchema = zod_openapi_1.z.object({
37
+ key: zod_openapi_1.z.string().openapi({ example: "uploads/audio/podcast789.mp3" }),
38
+ mimeType: zod_openapi_1.z.string().openapi({
39
+ example: "audio/mpeg",
40
+ }),
41
+ });
42
+ exports.CreateFileOutputSchema = exports.FileEntitySchema;
43
+ exports.DeleteFileInputParams = zod_openapi_1.z.object({
44
+ fileId: zod_openapi_1.z.cuid2().openapi({ example: "0irjif0qur09481u90r1u" }),
45
+ });
46
+ exports.DeleteFileOutputSchema = zod_openapi_1.z.object({
47
+ id: zod_openapi_1.z.cuid2().openapi({ example: "r90rjnaneifijhi31" }),
48
+ });
@@ -1,12 +1,12 @@
1
- export type FileEntity = {
2
- key: string;
3
- id: string;
4
- url?: string;
5
- createdAt: Date;
6
- updatedAt: Date;
7
- userId: string;
8
- mimeType: string;
9
- };
10
- export type FileUpdateOutputEntity = {
11
- id: string;
12
- };
1
+ import { z } from "@hono/zod-openapi";
2
+ import { CreateFileInputSchema, CreateFileOutputSchema, DeleteFileInputParams, DeleteFileOutputSchema, FileEntitySchema, FileUpdateEntitySchema, GetFilePresignedUploadUrlInputSchema, GetFilePresignedUploadUrlOutputSchema } from "../schemas/file";
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 GetPresignedUploadUrlOutput = z.infer<typeof GetFilePresignedUploadUrlOutputSchema>;
7
+ export type GetPresignedDownloadUrlInput = GetPresignedUploadUrlInput;
8
+ export type GetPresignedDownloadUrlOutput = GetPresignedUploadUrlOutput;
9
+ export type CreateFileInput = z.infer<typeof CreateFileInputSchema>;
10
+ export type CreateFileOutput = z.infer<typeof CreateFileOutputSchema>;
11
+ export type DeleteFileInput = z.infer<typeof DeleteFileInputParams>;
12
+ export type DeleteFileOutput = z.infer<typeof DeleteFileOutputSchema>;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@zyacreatives/shared",
3
- "version": "1.3.1",
3
+ "version": "1.3.2",
4
4
  "description": "",
5
5
  "main": "dist/index.js",
6
6
  "types": "dist/index.d.ts",
@@ -0,0 +1,57 @@
1
+ import { z } from "@hono/zod-openapi";
2
+
3
+ export const FileEntitySchema = z
4
+ .object({
5
+ key: z.string().openapi({ example: "profile-pic-12345" }),
6
+ id: z.cuid2().openapi({ example: "f123e4567-e89b-12d3-a456-426614174000" }),
7
+ url: z
8
+ .url()
9
+ .optional()
10
+ .openapi({ example: "https://example.com/file.jpg" }),
11
+ createdAt: z.string().openapi({ example: "2025-10-14T08:00:00.000Z" }),
12
+ updatedAt: z.string().openapi({ example: "2025-10-14T09:00:00.000Z" }),
13
+ userId: z
14
+ .cuid2()
15
+ .openapi({ example: "u123e4567-e89b-12d3-a456-426614174000" }),
16
+ mimeType: z.string().openapi({ example: "image/jpeg" }),
17
+ })
18
+ .openapi({ title: "FileEntity" });
19
+
20
+ export const FileUpdateEntitySchema = z
21
+ .object({
22
+ id: z
23
+ .string()
24
+ .openapi({ example: "f123e4567-e89b-12d3-a456-426614174000" }),
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 GetFilePresignedDownloadUrlInputSchema =
37
+ GetFilePresignedUploadUrlInputSchema;
38
+
39
+ export const GetFilePresignedDownloadUrlOutputSchema =
40
+ GetFilePresignedUploadUrlOutputSchema;
41
+
42
+ export const CreateFileInputSchema = z.object({
43
+ key: z.string().openapi({ example: "uploads/audio/podcast789.mp3" }),
44
+ mimeType: z.string().openapi({
45
+ example: "audio/mpeg",
46
+ }),
47
+ });
48
+
49
+ export const CreateFileOutputSchema = FileEntitySchema;
50
+
51
+ export const DeleteFileInputParams = z.object({
52
+ fileId: z.cuid2().openapi({ example: "0irjif0qur09481u90r1u" }),
53
+ });
54
+
55
+ export const DeleteFileOutputSchema = z.object({
56
+ id: z.cuid2().openapi({ example: "r90rjnaneifijhi31" }),
57
+ });
@@ -9,7 +9,6 @@ import {
9
9
  INVESTOR_TYPES,
10
10
  InvestorType,
11
11
  } from "../constants";
12
- import { MinimalUserSchema } from "./user";
13
12
  import { CuidSchema, ProfileIdentifierSchema } from "./common";
14
13
 
15
14
  export const InvestorEntitySchema = z
package/src/types/file.ts CHANGED
@@ -1,13 +1,32 @@
1
- export type FileEntity = {
2
- key: string;
3
- id: string;
4
- url?: string;
5
- createdAt: Date;
6
- updatedAt: Date;
7
- userId: string;
8
- mimeType: string;
9
- };
10
-
11
- export type FileUpdateOutputEntity = {
12
- id: string;
13
- };
1
+ import { z } from "@hono/zod-openapi";
2
+ import {
3
+ CreateFileInputSchema,
4
+ CreateFileOutputSchema,
5
+ DeleteFileInputParams,
6
+ DeleteFileOutputSchema,
7
+ FileEntitySchema,
8
+ FileUpdateEntitySchema,
9
+ GetFilePresignedUploadUrlInputSchema,
10
+ GetFilePresignedUploadUrlOutputSchema,
11
+ } from "../schemas/file";
12
+
13
+ export type FileEntity = z.infer<typeof FileEntitySchema>;
14
+
15
+ export type FileUpdateEntity = z.infer<typeof FileUpdateEntitySchema>;
16
+
17
+ export type GetPresignedUploadUrlInput = z.infer<
18
+ typeof GetFilePresignedUploadUrlInputSchema
19
+ >;
20
+
21
+ export type GetPresignedUploadUrlOutput = z.infer<
22
+ typeof GetFilePresignedUploadUrlOutputSchema
23
+ >;
24
+
25
+ export type GetPresignedDownloadUrlInput = GetPresignedUploadUrlInput;
26
+
27
+ export type GetPresignedDownloadUrlOutput = GetPresignedUploadUrlOutput;
28
+
29
+ export type CreateFileInput = z.infer<typeof CreateFileInputSchema>;
30
+ export type CreateFileOutput = z.infer<typeof CreateFileOutputSchema>;
31
+ export type DeleteFileInput = z.infer<typeof DeleteFileInputParams>;
32
+ export type DeleteFileOutput = z.infer<typeof DeleteFileOutputSchema>;