@zyacreatives/shared 1.5.3 → 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.
@@ -26,8 +26,8 @@ export declare const ListCreativesInputSchema: z.ZodObject<{
26
26
  }>>>;
27
27
  location: z.ZodOptional<z.ZodString>;
28
28
  tags: z.ZodOptional<z.ZodArray<z.ZodString>>;
29
- page: z.ZodDefault<z.ZodNumber>;
30
- perPage: z.ZodDefault<z.ZodNumber>;
29
+ page: z.ZodOptional<z.ZodDefault<z.ZodNumber>>;
30
+ perPage: z.ZodOptional<z.ZodDefault<z.ZodNumber>>;
31
31
  }, z.core.$strip>;
32
32
  export declare const CreateCreativeProfileInputSchema: z.ZodObject<{
33
33
  experienceLevel: z.ZodDefault<z.ZodEnum<{
@@ -53,9 +53,13 @@ export declare const UpdateCreativeProfileInputSchema: z.ZodObject<{
53
53
  disciplineSlugs: z.ZodOptional<z.ZodArray<z.ZodString>>;
54
54
  }, z.core.$strip>;
55
55
  export declare const GetCreativeInputSchema: z.ZodObject<{
56
- id: z.ZodCUID2;
56
+ value: z.ZodCUID2;
57
+ by: z.ZodDefault<z.ZodOptional<z.ZodEnum<{
58
+ id: "id";
59
+ userId: "userId";
60
+ }>>>;
57
61
  }, z.core.$strip>;
58
- export declare const GetCreativeByProfileIdentifierInputSchema: z.ZodObject<{
62
+ export declare const GetCreativeQuerySchema: z.ZodObject<{
59
63
  by: z.ZodDefault<z.ZodOptional<z.ZodEnum<{
60
64
  id: "id";
61
65
  userId: "userId";
@@ -1,13 +1,13 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.UpdateCreativeOutputSchema = exports.GetCreativeOutputSchema = exports.CreateCreativeOutputSchema = exports.GetCreativeByProfileIdentifierInputSchema = exports.GetCreativeInputSchema = exports.UpdateCreativeProfileInputSchema = exports.CreateCreativeProfileInputSchema = exports.ListCreativesInputSchema = exports.CreativeEntitySchema = void 0;
3
+ exports.UpdateCreativeOutputSchema = exports.GetCreativeOutputSchema = exports.CreateCreativeOutputSchema = exports.GetCreativeQuerySchema = exports.GetCreativeInputSchema = exports.UpdateCreativeProfileInputSchema = exports.CreateCreativeProfileInputSchema = exports.ListCreativesInputSchema = exports.CreativeEntitySchema = void 0;
4
4
  const zod_openapi_1 = require("@hono/zod-openapi");
5
5
  const constants_1 = require("../constants");
6
6
  const common_1 = require("./common");
7
7
  exports.CreativeEntitySchema = zod_openapi_1.z
8
8
  .object({
9
- id: zod_openapi_1.z.cuid2().openapi({ example: "cksd0v6q0000s9a5y8z7p3x9" }),
10
- userId: zod_openapi_1.z.cuid2().openapi({ example: "cksd0v6q0001s9a5y8z7p3x9" }),
9
+ id: zod_openapi_1.z.cuid2().openapi({ example: "cre_cksd0v6q0000s9a5y8z7p3x9" }),
10
+ userId: zod_openapi_1.z.cuid2().openapi({ example: "user_abc123" }),
11
11
  bio: zod_openapi_1.z.string().optional().openapi({
12
12
  example: "A multi-disciplinary designer specializing in brand identity.",
13
13
  }),
@@ -41,19 +41,20 @@ exports.ListCreativesInputSchema = zod_openapi_1.z
41
41
  experienceLevels: zod_openapi_1.z
42
42
  .array(zod_openapi_1.z.enum(Object.values(constants_1.EXPERIENCE_LEVELS)))
43
43
  .optional()
44
- .openapi({ example: ["YEAR_0_1", "YEAR_1_3"] }),
44
+ .openapi({ example: ["SENIOR", "EXPERT"] }),
45
45
  location: zod_openapi_1.z.string().optional().openapi({ example: "Los Angeles" }),
46
46
  tags: zod_openapi_1.z
47
47
  .array(zod_openapi_1.z.string())
48
48
  .optional()
49
49
  .openapi({ example: ["Figma", "AI"] }),
50
- page: zod_openapi_1.z.number().int().min(1).default(1).openapi({ example: 1 }),
50
+ page: zod_openapi_1.z.number().int().min(1).default(1).optional().openapi({ example: 1 }),
51
51
  perPage: zod_openapi_1.z
52
52
  .number()
53
53
  .int()
54
54
  .min(1)
55
55
  .max(100)
56
56
  .default(20)
57
+ .optional()
57
58
  .openapi({ example: 20 }),
58
59
  })
59
60
  .openapi("ListCreativesInput");
@@ -79,7 +80,9 @@ exports.CreateCreativeProfileInputSchema = zod_openapi_1.z
79
80
  .default([])
80
81
  .openapi({ example: ["ui-ux", "frontend"] }),
81
82
  })
82
- .openapi("CreateCreativeProfileInput");
83
+ .openapi({
84
+ title: "create creative profile",
85
+ });
83
86
  exports.UpdateCreativeProfileInputSchema = zod_openapi_1.z
84
87
  .object({
85
88
  experienceLevel: zod_openapi_1.z
@@ -106,13 +109,14 @@ exports.UpdateCreativeProfileInputSchema = zod_openapi_1.z
106
109
  .optional()
107
110
  .openapi({ example: ["frontend", "ui-ux"] }),
108
111
  })
109
- .openapi("UpdateCreativeProfileInput");
110
- exports.GetCreativeInputSchema = zod_openapi_1.z
111
- .object({
112
- id: zod_openapi_1.z.cuid2().openapi({ example: "cksd0v6q0000s9a5y8z7p3x9" }),
113
- })
114
- .openapi("GetCreativeInput");
115
- exports.GetCreativeByProfileIdentifierInputSchema = common_1.ProfileIdentifierSchema;
112
+ .openapi({
113
+ title: "update creative profile",
114
+ });
115
+ exports.GetCreativeInputSchema = zod_openapi_1.z.object({
116
+ value: zod_openapi_1.z.cuid2(),
117
+ by: common_1.ProfileIdentifierSchema.shape.by,
118
+ });
119
+ exports.GetCreativeQuerySchema = common_1.ProfileIdentifierSchema;
116
120
  exports.CreateCreativeOutputSchema = exports.CreativeEntitySchema;
117
121
  exports.GetCreativeOutputSchema = exports.CreativeEntitySchema;
118
122
  exports.UpdateCreativeOutputSchema = exports.CreativeEntitySchema;
@@ -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,11 +1,10 @@
1
1
  import { z } from "@hono/zod-openapi";
2
- import { CreativeEntitySchema, ListCreativesInputSchema, CreateCreativeProfileInputSchema, UpdateCreativeProfileInputSchema, GetCreativeInputSchema, GetCreativeByProfileIdentifierInputSchema, CreateCreativeOutputSchema, GetCreativeOutputSchema, UpdateCreativeOutputSchema } from "../schemas/creative";
2
+ import { CreativeEntitySchema, ListCreativesInputSchema, CreateCreativeProfileInputSchema, UpdateCreativeProfileInputSchema, GetCreativeInputSchema, CreateCreativeOutputSchema, GetCreativeOutputSchema, UpdateCreativeOutputSchema } from "../schemas/creative";
3
3
  export type CreativeEntity = z.infer<typeof CreativeEntitySchema>;
4
4
  export type ListCreativesInput = z.infer<typeof ListCreativesInputSchema>;
5
5
  export type CreateCreativeProfileInput = z.infer<typeof CreateCreativeProfileInputSchema>;
6
6
  export type UpdateCreativeProfileInput = z.infer<typeof UpdateCreativeProfileInputSchema>;
7
7
  export type GetCreativeInput = z.infer<typeof GetCreativeInputSchema>;
8
- export type GetCreativeByProfileIdentifierInput = z.infer<typeof GetCreativeByProfileIdentifierInputSchema>;
9
8
  export type CreateCreativeOutput = z.infer<typeof CreateCreativeOutputSchema>;
10
9
  export type GetCreativeOutput = z.infer<typeof GetCreativeOutputSchema>;
11
10
  export type UpdateCreativeOutput = z.infer<typeof UpdateCreativeOutputSchema>;
@@ -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.3",
3
+ "version": "1.5.5",
4
4
  "description": "",
5
5
  "main": "dist/index.js",
6
6
  "types": "dist/index.d.ts",
@@ -1,11 +1,11 @@
1
1
  import { z } from "@hono/zod-openapi";
2
2
  import { EXPERIENCE_LEVELS, ExperienceLevel } from "../constants";
3
- import { ProfileIdentifierSchema } from "./common";
3
+ import { CuidSchema, ProfileIdentifierSchema } from "./common";
4
4
 
5
5
  export const CreativeEntitySchema = z
6
6
  .object({
7
- id: z.cuid2().openapi({ example: "cksd0v6q0000s9a5y8z7p3x9" }),
8
- userId: z.cuid2().openapi({ example: "cksd0v6q0001s9a5y8z7p3x9" }),
7
+ id: z.cuid2().openapi({ example: "cre_cksd0v6q0000s9a5y8z7p3x9" }),
8
+ userId: z.cuid2().openapi({ example: "user_abc123" }),
9
9
  bio: z.string().optional().openapi({
10
10
  example: "A multi-disciplinary designer specializing in brand identity.",
11
11
  }),
@@ -52,19 +52,20 @@ export const ListCreativesInputSchema = z
52
52
  )
53
53
  )
54
54
  .optional()
55
- .openapi({ example: ["YEAR_0_1", "YEAR_1_3"] }),
55
+ .openapi({ example: ["SENIOR", "EXPERT"] }),
56
56
  location: z.string().optional().openapi({ example: "Los Angeles" }),
57
57
  tags: z
58
58
  .array(z.string())
59
59
  .optional()
60
60
  .openapi({ example: ["Figma", "AI"] }),
61
- page: z.number().int().min(1).default(1).openapi({ example: 1 }),
61
+ page: z.number().int().min(1).default(1).optional().openapi({ example: 1 }),
62
62
  perPage: z
63
63
  .number()
64
64
  .int()
65
65
  .min(1)
66
66
  .max(100)
67
67
  .default(20)
68
+ .optional()
68
69
  .openapi({ example: 20 }),
69
70
  })
70
71
  .openapi("ListCreativesInput");
@@ -91,7 +92,9 @@ export const CreateCreativeProfileInputSchema = z
91
92
  .default([])
92
93
  .openapi({ example: ["ui-ux", "frontend"] }),
93
94
  })
94
- .openapi("CreateCreativeProfileInput");
95
+ .openapi({
96
+ title: "create creative profile",
97
+ });
95
98
 
96
99
  export const UpdateCreativeProfileInputSchema = z
97
100
  .object({
@@ -119,17 +122,19 @@ export const UpdateCreativeProfileInputSchema = z
119
122
  .optional()
120
123
  .openapi({ example: ["frontend", "ui-ux"] }),
121
124
  })
122
- .openapi("UpdateCreativeProfileInput");
125
+ .openapi({
126
+ title: "update creative profile",
127
+ });
123
128
 
124
- export const GetCreativeInputSchema = z
125
- .object({
126
- id: z.cuid2().openapi({ example: "cksd0v6q0000s9a5y8z7p3x9" }),
127
- })
128
- .openapi("GetCreativeInput");
129
+ export const GetCreativeInputSchema = z.object({
130
+ value: z.cuid2(),
131
+ by: ProfileIdentifierSchema.shape.by,
132
+ });
129
133
 
130
- export const GetCreativeByProfileIdentifierInputSchema =
131
- ProfileIdentifierSchema;
134
+ export const GetCreativeQuerySchema = ProfileIdentifierSchema;
132
135
 
133
136
  export const CreateCreativeOutputSchema = CreativeEntitySchema;
137
+
134
138
  export const GetCreativeOutputSchema = CreativeEntitySchema;
139
+
135
140
  export const UpdateCreativeOutputSchema = CreativeEntitySchema;
@@ -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
+ });
@@ -5,7 +5,6 @@ import {
5
5
  CreateCreativeProfileInputSchema,
6
6
  UpdateCreativeProfileInputSchema,
7
7
  GetCreativeInputSchema,
8
- GetCreativeByProfileIdentifierInputSchema,
9
8
  CreateCreativeOutputSchema,
10
9
  GetCreativeOutputSchema,
11
10
  UpdateCreativeOutputSchema,
@@ -15,13 +14,14 @@ export type CreativeEntity = z.infer<typeof CreativeEntitySchema>;
15
14
 
16
15
  export type ListCreativesInput = z.infer<typeof ListCreativesInputSchema>;
17
16
 
18
- export type CreateCreativeProfileInput = z.infer<typeof CreateCreativeProfileInputSchema>;
19
- export type UpdateCreativeProfileInput = z.infer<typeof UpdateCreativeProfileInputSchema>;
17
+ export type CreateCreativeProfileInput = z.infer<
18
+ typeof CreateCreativeProfileInputSchema
19
+ >;
20
+ export type UpdateCreativeProfileInput = z.infer<
21
+ typeof UpdateCreativeProfileInputSchema
22
+ >;
20
23
 
21
24
  export type GetCreativeInput = z.infer<typeof GetCreativeInputSchema>;
22
- export type GetCreativeByProfileIdentifierInput = z.infer<
23
- typeof GetCreativeByProfileIdentifierInputSchema
24
- >;
25
25
 
26
26
  export type CreateCreativeOutput = z.infer<typeof CreateCreativeOutputSchema>;
27
27
  export type GetCreativeOutput = z.infer<typeof GetCreativeOutputSchema>;
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
  >;