@zyacreatives/shared 2.0.61 → 2.0.62

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.
@@ -78,3 +78,57 @@ export declare const UpdateBrandOutputSchema: z.ZodObject<{
78
78
  createdAt: z.ZodOptional<z.ZodCoercedDate<unknown>>;
79
79
  updatedAt: z.ZodCoercedDate<unknown>;
80
80
  }, z.core.$strip>;
81
+ export declare const BrandWithUserEntitySchema: z.ZodObject<{
82
+ id: z.ZodCUID2;
83
+ userId: z.ZodCUID2;
84
+ brandName: z.ZodString;
85
+ bio: z.ZodOptional<z.ZodString>;
86
+ tags: z.ZodOptional<z.ZodArray<z.ZodString>>;
87
+ disciplines: z.ZodOptional<z.ZodArray<z.ZodString>>;
88
+ createdAt: z.ZodOptional<z.ZodCoercedDate<unknown>>;
89
+ updatedAt: z.ZodCoercedDate<unknown>;
90
+ user: z.ZodObject<{
91
+ id: z.ZodCUID2;
92
+ username: z.ZodOptional<z.ZodString>;
93
+ email: z.ZodString;
94
+ name: z.ZodOptional<z.ZodString>;
95
+ image: z.ZodOptional<z.ZodString>;
96
+ role: z.ZodEnum<{
97
+ CREATIVE: "CREATIVE";
98
+ BRAND: "BRAND";
99
+ INVESTOR: "INVESTOR";
100
+ ADMIN: "ADMIN";
101
+ }>;
102
+ }, z.core.$strip>;
103
+ }, z.core.$strip>;
104
+ export declare const SearchBrandInputSchema: z.ZodObject<{
105
+ string: z.ZodString;
106
+ limit: z.ZodDefault<z.ZodCoercedNumber<unknown>>;
107
+ cursor: z.ZodOptional<z.ZodString>;
108
+ }, z.core.$strip>;
109
+ export declare const SearchBrandOutputSchema: z.ZodObject<{
110
+ brands: z.ZodArray<z.ZodObject<{
111
+ id: z.ZodCUID2;
112
+ userId: z.ZodCUID2;
113
+ brandName: z.ZodString;
114
+ bio: z.ZodOptional<z.ZodString>;
115
+ tags: z.ZodOptional<z.ZodArray<z.ZodString>>;
116
+ disciplines: z.ZodOptional<z.ZodArray<z.ZodString>>;
117
+ createdAt: z.ZodOptional<z.ZodCoercedDate<unknown>>;
118
+ updatedAt: z.ZodCoercedDate<unknown>;
119
+ user: z.ZodObject<{
120
+ id: z.ZodCUID2;
121
+ username: z.ZodOptional<z.ZodString>;
122
+ email: z.ZodString;
123
+ name: z.ZodOptional<z.ZodString>;
124
+ image: z.ZodOptional<z.ZodString>;
125
+ role: z.ZodEnum<{
126
+ CREATIVE: "CREATIVE";
127
+ BRAND: "BRAND";
128
+ INVESTOR: "INVESTOR";
129
+ ADMIN: "ADMIN";
130
+ }>;
131
+ }, z.core.$strip>;
132
+ }, z.core.$strip>>;
133
+ nextCursor: z.ZodOptional<z.ZodString>;
134
+ }, z.core.$strip>;
@@ -1,9 +1,10 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.UpdateBrandOutputSchema = exports.GetBrandOutputSchema = exports.CreateBrandOutputSchema = exports.GetBrandQuerySchema = exports.GetBrandInputSchema = exports.UpdateBrandProfileInputSchema = exports.CreateBrandProfileInputSchema = exports.ListBrandsInputSchema = exports.BrandEntitySchema = void 0;
3
+ exports.SearchBrandOutputSchema = exports.SearchBrandInputSchema = exports.BrandWithUserEntitySchema = exports.UpdateBrandOutputSchema = exports.GetBrandOutputSchema = exports.CreateBrandOutputSchema = exports.GetBrandQuerySchema = exports.GetBrandInputSchema = exports.UpdateBrandProfileInputSchema = exports.CreateBrandProfileInputSchema = exports.ListBrandsInputSchema = exports.BrandEntitySchema = void 0;
4
4
  const zod_openapi_1 = require("@hono/zod-openapi");
5
5
  const common_1 = require("./common");
6
6
  const constants_1 = require("../constants");
7
+ const user_1 = require("./user");
7
8
  exports.BrandEntitySchema = zod_openapi_1.z
8
9
  .object({
9
10
  id: zod_openapi_1.z.cuid2().openapi({ example: "brd_cksd0v6q0000s9a5y8z7p3x9" }),
@@ -113,3 +114,23 @@ exports.GetBrandQuerySchema = common_1.ProfileIdentifierSchema;
113
114
  exports.CreateBrandOutputSchema = exports.BrandEntitySchema;
114
115
  exports.GetBrandOutputSchema = exports.BrandEntitySchema;
115
116
  exports.UpdateBrandOutputSchema = exports.BrandEntitySchema;
117
+ exports.BrandWithUserEntitySchema = exports.BrandEntitySchema.extend({
118
+ user: user_1.MinimalUserSchema,
119
+ });
120
+ exports.SearchBrandInputSchema = zod_openapi_1.z.object({
121
+ string: zod_openapi_1.z
122
+ .string()
123
+ .min(1, { message: "Search string cannot be empty" })
124
+ .max(200, { message: "Search string cannot exceed 200 characters" }),
125
+ limit: zod_openapi_1.z.coerce
126
+ .number()
127
+ .int({ message: "Limit must be an integer" })
128
+ .min(1, { message: "Limit must be at least 1" })
129
+ .max(100, { message: "Limit cannot exceed 100" })
130
+ .default(20),
131
+ cursor: zod_openapi_1.z.string().optional(),
132
+ });
133
+ exports.SearchBrandOutputSchema = zod_openapi_1.z.object({
134
+ brands: zod_openapi_1.z.array(exports.BrandWithUserEntitySchema),
135
+ nextCursor: zod_openapi_1.z.string().optional(),
136
+ });
@@ -113,3 +113,69 @@ export declare const UpdateCreativeOutputSchema: z.ZodObject<{
113
113
  createdAt: z.ZodOptional<z.ZodCoercedDate<unknown>>;
114
114
  updatedAt: z.ZodCoercedDate<unknown>;
115
115
  }, z.core.$strip>;
116
+ export declare const CreativeWithUserEntitySchema: z.ZodObject<{
117
+ id: z.ZodCUID2;
118
+ userId: z.ZodCUID2;
119
+ bio: z.ZodOptional<z.ZodString>;
120
+ location: z.ZodOptional<z.ZodString>;
121
+ experienceLevel: z.ZodOptional<z.ZodEnum<{
122
+ "0-1 year": "0-1 year";
123
+ "1-3 years": "1-3 years";
124
+ "3-5 years": "3-5 years";
125
+ "5+ years": "5+ years";
126
+ }>>;
127
+ tags: z.ZodOptional<z.ZodArray<z.ZodString>>;
128
+ disciplines: z.ZodOptional<z.ZodArray<z.ZodString>>;
129
+ createdAt: z.ZodOptional<z.ZodCoercedDate<unknown>>;
130
+ updatedAt: z.ZodCoercedDate<unknown>;
131
+ user: z.ZodObject<{
132
+ id: z.ZodCUID2;
133
+ username: z.ZodOptional<z.ZodString>;
134
+ email: z.ZodString;
135
+ name: z.ZodOptional<z.ZodString>;
136
+ image: z.ZodOptional<z.ZodString>;
137
+ role: z.ZodEnum<{
138
+ CREATIVE: "CREATIVE";
139
+ BRAND: "BRAND";
140
+ INVESTOR: "INVESTOR";
141
+ ADMIN: "ADMIN";
142
+ }>;
143
+ }, z.core.$strip>;
144
+ }, z.core.$strip>;
145
+ export declare const SearchCreativeInputSchema: z.ZodObject<{
146
+ string: z.ZodString;
147
+ limit: z.ZodDefault<z.ZodCoercedNumber<unknown>>;
148
+ cursor: z.ZodOptional<z.ZodString>;
149
+ }, z.core.$strip>;
150
+ export declare const SearchCreativeOutputSchema: z.ZodObject<{
151
+ creatives: z.ZodArray<z.ZodObject<{
152
+ id: z.ZodCUID2;
153
+ userId: z.ZodCUID2;
154
+ bio: z.ZodOptional<z.ZodString>;
155
+ location: z.ZodOptional<z.ZodString>;
156
+ experienceLevel: z.ZodOptional<z.ZodEnum<{
157
+ "0-1 year": "0-1 year";
158
+ "1-3 years": "1-3 years";
159
+ "3-5 years": "3-5 years";
160
+ "5+ years": "5+ years";
161
+ }>>;
162
+ tags: z.ZodOptional<z.ZodArray<z.ZodString>>;
163
+ disciplines: z.ZodOptional<z.ZodArray<z.ZodString>>;
164
+ createdAt: z.ZodOptional<z.ZodCoercedDate<unknown>>;
165
+ updatedAt: z.ZodCoercedDate<unknown>;
166
+ user: z.ZodObject<{
167
+ id: z.ZodCUID2;
168
+ username: z.ZodOptional<z.ZodString>;
169
+ email: z.ZodString;
170
+ name: z.ZodOptional<z.ZodString>;
171
+ image: z.ZodOptional<z.ZodString>;
172
+ role: z.ZodEnum<{
173
+ CREATIVE: "CREATIVE";
174
+ BRAND: "BRAND";
175
+ INVESTOR: "INVESTOR";
176
+ ADMIN: "ADMIN";
177
+ }>;
178
+ }, z.core.$strip>;
179
+ }, z.core.$strip>>;
180
+ nextCursor: z.ZodOptional<z.ZodString>;
181
+ }, z.core.$strip>;
@@ -1,9 +1,10 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.UpdateCreativeOutputSchema = exports.GetCreativeOutputSchema = exports.CreateCreativeOutputSchema = exports.GetCreativeQuerySchema = exports.GetCreativeInputSchema = exports.UpdateCreativeProfileInputSchema = exports.CreateCreativeProfileInputSchema = exports.ListCreativesInputSchema = exports.CreativeEntitySchema = void 0;
3
+ exports.SearchCreativeOutputSchema = exports.SearchCreativeInputSchema = exports.CreativeWithUserEntitySchema = 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
+ const user_1 = require("./user");
7
8
  exports.CreativeEntitySchema = zod_openapi_1.z
8
9
  .object({
9
10
  id: zod_openapi_1.z.cuid2().openapi({ example: "cre_cksd0v6q0000s9a5y8z7p3x9" }),
@@ -141,3 +142,23 @@ exports.GetCreativeQuerySchema = common_1.ProfileIdentifierSchema;
141
142
  exports.CreateCreativeOutputSchema = exports.CreativeEntitySchema;
142
143
  exports.GetCreativeOutputSchema = exports.CreativeEntitySchema;
143
144
  exports.UpdateCreativeOutputSchema = exports.CreativeEntitySchema;
145
+ exports.CreativeWithUserEntitySchema = exports.CreativeEntitySchema.extend({
146
+ user: user_1.MinimalUserSchema,
147
+ });
148
+ exports.SearchCreativeInputSchema = zod_openapi_1.z.object({
149
+ string: zod_openapi_1.z
150
+ .string()
151
+ .min(1, { message: "Search string cannot be empty" })
152
+ .max(200, { message: "Search string cannot exceed 200 characters" }),
153
+ limit: zod_openapi_1.z.coerce
154
+ .number()
155
+ .int({ message: "Limit must be an integer" })
156
+ .min(1, { message: "Limit must be at least 1" })
157
+ .max(100, { message: "Limit cannot exceed 100" })
158
+ .default(20),
159
+ cursor: zod_openapi_1.z.string().optional(),
160
+ });
161
+ exports.SearchCreativeOutputSchema = zod_openapi_1.z.object({
162
+ creatives: zod_openapi_1.z.array(exports.CreativeWithUserEntitySchema),
163
+ nextCursor: zod_openapi_1.z.string().optional(),
164
+ });
@@ -294,8 +294,8 @@ export declare const MinimalProjectSchema: z.ZodObject<{
294
294
  id: z.ZodString;
295
295
  description: z.ZodOptional<z.ZodString>;
296
296
  title: z.ZodString;
297
- tags: z.ZodOptional<z.ZodArray<z.ZodString>>;
298
297
  imagePlaceholderUrl: z.ZodString;
298
+ tags: z.ZodOptional<z.ZodArray<z.ZodString>>;
299
299
  startDate: z.ZodOptional<z.ZodCoercedDate<unknown>>;
300
300
  endDate: z.ZodOptional<z.ZodCoercedDate<unknown>>;
301
301
  }, z.core.$strip>;
@@ -311,8 +311,8 @@ export declare const ProjectWithProjectViewsEntitySchema: z.ZodObject<{
311
311
  id: z.ZodString;
312
312
  description: z.ZodOptional<z.ZodString>;
313
313
  title: z.ZodString;
314
- tags: z.ZodOptional<z.ZodArray<z.ZodString>>;
315
314
  imagePlaceholderUrl: z.ZodString;
315
+ tags: z.ZodOptional<z.ZodArray<z.ZodString>>;
316
316
  startDate: z.ZodOptional<z.ZodCoercedDate<unknown>>;
317
317
  endDate: z.ZodOptional<z.ZodCoercedDate<unknown>>;
318
318
  views: z.ZodArray<z.ZodObject<{
@@ -334,8 +334,8 @@ export declare const ProjectWithProjectCommentsEntitySchema: z.ZodObject<{
334
334
  id: z.ZodString;
335
335
  description: z.ZodOptional<z.ZodString>;
336
336
  title: z.ZodString;
337
- tags: z.ZodOptional<z.ZodArray<z.ZodString>>;
338
337
  imagePlaceholderUrl: z.ZodString;
338
+ tags: z.ZodOptional<z.ZodArray<z.ZodString>>;
339
339
  startDate: z.ZodOptional<z.ZodCoercedDate<unknown>>;
340
340
  endDate: z.ZodOptional<z.ZodCoercedDate<unknown>>;
341
341
  comments: z.ZodArray<z.ZodObject<{
@@ -359,8 +359,8 @@ export declare const ProjectWithProjectLikesEntitySchema: z.ZodObject<{
359
359
  id: z.ZodString;
360
360
  description: z.ZodOptional<z.ZodString>;
361
361
  title: z.ZodString;
362
- tags: z.ZodOptional<z.ZodArray<z.ZodString>>;
363
362
  imagePlaceholderUrl: z.ZodString;
363
+ tags: z.ZodOptional<z.ZodArray<z.ZodString>>;
364
364
  startDate: z.ZodOptional<z.ZodCoercedDate<unknown>>;
365
365
  endDate: z.ZodOptional<z.ZodCoercedDate<unknown>>;
366
366
  likes: z.ZodArray<z.ZodObject<{
@@ -378,8 +378,8 @@ export declare const ProjectWithProjectBookmarksEntitySchema: z.ZodObject<{
378
378
  id: z.ZodString;
379
379
  description: z.ZodOptional<z.ZodString>;
380
380
  title: z.ZodString;
381
- tags: z.ZodOptional<z.ZodArray<z.ZodString>>;
382
381
  imagePlaceholderUrl: z.ZodString;
382
+ tags: z.ZodOptional<z.ZodArray<z.ZodString>>;
383
383
  startDate: z.ZodOptional<z.ZodCoercedDate<unknown>>;
384
384
  endDate: z.ZodOptional<z.ZodCoercedDate<unknown>>;
385
385
  bookmarks: z.ZodArray<z.ZodObject<{
@@ -178,11 +178,11 @@ export declare const UserWithProjectsEntitySchema: z.ZodObject<{
178
178
  userId: z.ZodString;
179
179
  description: z.ZodOptional<z.ZodString>;
180
180
  title: z.ZodString;
181
- tags: z.ZodOptional<z.ZodArray<z.ZodString>>;
181
+ url: z.ZodOptional<z.ZodString>;
182
182
  createdAt: z.ZodCoercedDate<unknown>;
183
183
  updatedAt: z.ZodCoercedDate<unknown>;
184
- url: z.ZodOptional<z.ZodString>;
185
184
  imagePlaceholderUrl: z.ZodString;
185
+ tags: z.ZodOptional<z.ZodArray<z.ZodString>>;
186
186
  projectCreatorType: z.ZodEnum<{
187
187
  readonly CREATIVE: "CREATIVE";
188
188
  readonly BRAND: "BRAND";
@@ -217,8 +217,8 @@ export declare const UserWithProjectLikesEntitySchema: z.ZodObject<{
217
217
  id: z.ZodString;
218
218
  description: z.ZodOptional<z.ZodString>;
219
219
  title: z.ZodString;
220
- tags: z.ZodOptional<z.ZodArray<z.ZodString>>;
221
220
  imagePlaceholderUrl: z.ZodString;
221
+ tags: z.ZodOptional<z.ZodArray<z.ZodString>>;
222
222
  startDate: z.ZodOptional<z.ZodCoercedDate<unknown>>;
223
223
  endDate: z.ZodOptional<z.ZodCoercedDate<unknown>>;
224
224
  }, z.core.$strip>;
@@ -239,8 +239,8 @@ export declare const UserWithProjectBookmarksEntitySchema: z.ZodObject<{
239
239
  id: z.ZodString;
240
240
  description: z.ZodOptional<z.ZodString>;
241
241
  title: z.ZodString;
242
- tags: z.ZodOptional<z.ZodArray<z.ZodString>>;
243
242
  imagePlaceholderUrl: z.ZodString;
243
+ tags: z.ZodOptional<z.ZodArray<z.ZodString>>;
244
244
  startDate: z.ZodOptional<z.ZodCoercedDate<unknown>>;
245
245
  endDate: z.ZodOptional<z.ZodCoercedDate<unknown>>;
246
246
  }, z.core.$strip>;
@@ -523,11 +523,11 @@ export declare const GetAuthenticatedUserWithProjectsOutputSchema: z.ZodObject<{
523
523
  userId: z.ZodString;
524
524
  description: z.ZodOptional<z.ZodString>;
525
525
  title: z.ZodString;
526
- tags: z.ZodOptional<z.ZodArray<z.ZodString>>;
526
+ url: z.ZodOptional<z.ZodString>;
527
527
  createdAt: z.ZodCoercedDate<unknown>;
528
528
  updatedAt: z.ZodCoercedDate<unknown>;
529
- url: z.ZodOptional<z.ZodString>;
530
529
  imagePlaceholderUrl: z.ZodString;
530
+ tags: z.ZodOptional<z.ZodArray<z.ZodString>>;
531
531
  projectCreatorType: z.ZodEnum<{
532
532
  readonly CREATIVE: "CREATIVE";
533
533
  readonly BRAND: "BRAND";
@@ -562,8 +562,8 @@ export declare const GetAuthenticatedUserWithProjectBookmarksOutputSchema: z.Zod
562
562
  id: z.ZodString;
563
563
  description: z.ZodOptional<z.ZodString>;
564
564
  title: z.ZodString;
565
- tags: z.ZodOptional<z.ZodArray<z.ZodString>>;
566
565
  imagePlaceholderUrl: z.ZodString;
566
+ tags: z.ZodOptional<z.ZodArray<z.ZodString>>;
567
567
  startDate: z.ZodOptional<z.ZodCoercedDate<unknown>>;
568
568
  endDate: z.ZodOptional<z.ZodCoercedDate<unknown>>;
569
569
  }, z.core.$strip>;
@@ -636,8 +636,8 @@ export declare const GetAuthenticatedUserWithProjectLikesOutputSchema: z.ZodObje
636
636
  id: z.ZodString;
637
637
  description: z.ZodOptional<z.ZodString>;
638
638
  title: z.ZodString;
639
- tags: z.ZodOptional<z.ZodArray<z.ZodString>>;
640
639
  imagePlaceholderUrl: z.ZodString;
640
+ tags: z.ZodOptional<z.ZodArray<z.ZodString>>;
641
641
  startDate: z.ZodOptional<z.ZodCoercedDate<unknown>>;
642
642
  endDate: z.ZodOptional<z.ZodCoercedDate<unknown>>;
643
643
  }, z.core.$strip>;
@@ -1,5 +1,5 @@
1
1
  import { z } from "@hono/zod-openapi";
2
- import { BrandEntitySchema, ListBrandsInputSchema, CreateBrandProfileInputSchema, UpdateBrandProfileInputSchema, GetBrandInputSchema, CreateBrandOutputSchema, GetBrandOutputSchema, UpdateBrandOutputSchema } from "../schemas/brand";
2
+ import { BrandEntitySchema, ListBrandsInputSchema, CreateBrandProfileInputSchema, UpdateBrandProfileInputSchema, GetBrandInputSchema, CreateBrandOutputSchema, GetBrandOutputSchema, UpdateBrandOutputSchema, BrandWithUserEntitySchema, SearchBrandInputSchema, SearchBrandOutputSchema } from "../schemas/brand";
3
3
  export type BrandEntity = z.infer<typeof BrandEntitySchema>;
4
4
  export type ListBrandsInput = z.infer<typeof ListBrandsInputSchema>;
5
5
  export type CreateBrandProfileInput = z.infer<typeof CreateBrandProfileInputSchema>;
@@ -8,3 +8,6 @@ export type GetBrandInput = z.infer<typeof GetBrandInputSchema>;
8
8
  export type CreateBrandOutput = z.infer<typeof CreateBrandOutputSchema>;
9
9
  export type GetBrandOutput = z.infer<typeof GetBrandOutputSchema>;
10
10
  export type UpdateBrandOutput = z.infer<typeof UpdateBrandOutputSchema>;
11
+ export type BrandWithUserEntity = z.infer<typeof BrandWithUserEntitySchema>;
12
+ export type SearchBrandInput = z.infer<typeof SearchBrandInputSchema>;
13
+ export type SearchBrandOutput = z.infer<typeof SearchBrandOutputSchema>;
@@ -1,5 +1,5 @@
1
1
  import { z } from "@hono/zod-openapi";
2
- import { CreativeEntitySchema, ListCreativesInputSchema, CreateCreativeProfileInputSchema, UpdateCreativeProfileInputSchema, GetCreativeInputSchema, CreateCreativeOutputSchema, GetCreativeOutputSchema, UpdateCreativeOutputSchema } from "../schemas/creative";
2
+ import { CreativeEntitySchema, ListCreativesInputSchema, CreateCreativeProfileInputSchema, UpdateCreativeProfileInputSchema, GetCreativeInputSchema, CreateCreativeOutputSchema, GetCreativeOutputSchema, UpdateCreativeOutputSchema, CreativeWithUserEntitySchema, SearchCreativeInputSchema, SearchCreativeOutputSchema } 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>;
@@ -8,3 +8,6 @@ export type GetCreativeInput = z.infer<typeof GetCreativeInputSchema>;
8
8
  export type CreateCreativeOutput = z.infer<typeof CreateCreativeOutputSchema>;
9
9
  export type GetCreativeOutput = z.infer<typeof GetCreativeOutputSchema>;
10
10
  export type UpdateCreativeOutput = z.infer<typeof UpdateCreativeOutputSchema>;
11
+ export type CreativeWithUserEntity = z.infer<typeof CreativeWithUserEntitySchema>;
12
+ export type SearchCreativeInput = z.infer<typeof SearchCreativeInputSchema>;
13
+ export type SearchCreativeOutput = z.infer<typeof SearchCreativeOutputSchema>;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@zyacreatives/shared",
3
- "version": "2.0.61",
3
+ "version": "2.0.62",
4
4
  "description": "",
5
5
  "main": "dist/index.js",
6
6
  "types": "dist/index.d.ts",
@@ -1,6 +1,7 @@
1
1
  import { z } from "@hono/zod-openapi";
2
2
  import { CuidSchema, ProfileIdentifierSchema } from "./common";
3
3
  import { EXPERIENCE_LEVELS, ExperienceLevel } from "../constants";
4
+ import { MinimalUserSchema } from "./user";
4
5
 
5
6
  export const BrandEntitySchema = z
6
7
  .object({
@@ -127,3 +128,26 @@ export const CreateBrandOutputSchema = BrandEntitySchema;
127
128
  export const GetBrandOutputSchema = BrandEntitySchema;
128
129
 
129
130
  export const UpdateBrandOutputSchema = BrandEntitySchema;
131
+
132
+ export const BrandWithUserEntitySchema = BrandEntitySchema.extend({
133
+ user: MinimalUserSchema,
134
+ });
135
+
136
+ export const SearchBrandInputSchema = z.object({
137
+ string: z
138
+ .string()
139
+ .min(1, { message: "Search string cannot be empty" })
140
+ .max(200, { message: "Search string cannot exceed 200 characters" }),
141
+ limit: z.coerce
142
+ .number()
143
+ .int({ message: "Limit must be an integer" })
144
+ .min(1, { message: "Limit must be at least 1" })
145
+ .max(100, { message: "Limit cannot exceed 100" })
146
+ .default(20),
147
+ cursor: z.string().optional(),
148
+ });
149
+
150
+ export const SearchBrandOutputSchema = z.object({
151
+ brands: z.array(BrandWithUserEntitySchema),
152
+ nextCursor: z.string().optional(),
153
+ })
@@ -1,6 +1,7 @@
1
1
  import { z } from "@hono/zod-openapi";
2
2
  import { EXPERIENCE_LEVELS, ExperienceLevel } from "../constants";
3
3
  import { CuidSchema, ProfileIdentifierSchema } from "./common";
4
+ import { MinimalUserSchema } from "./user";
4
5
  export const CreativeEntitySchema = z
5
6
  .object({
6
7
  id: z.cuid2().openapi({ example: "cre_cksd0v6q0000s9a5y8z7p3x9" }),
@@ -177,3 +178,26 @@ export const CreateCreativeOutputSchema = CreativeEntitySchema;
177
178
  export const GetCreativeOutputSchema = CreativeEntitySchema;
178
179
 
179
180
  export const UpdateCreativeOutputSchema = CreativeEntitySchema;
181
+
182
+ export const CreativeWithUserEntitySchema = CreativeEntitySchema.extend({
183
+ user: MinimalUserSchema,
184
+ });
185
+
186
+ export const SearchCreativeInputSchema = z.object({
187
+ string: z
188
+ .string()
189
+ .min(1, { message: "Search string cannot be empty" })
190
+ .max(200, { message: "Search string cannot exceed 200 characters" }),
191
+ limit: z.coerce
192
+ .number()
193
+ .int({ message: "Limit must be an integer" })
194
+ .min(1, { message: "Limit must be at least 1" })
195
+ .max(100, { message: "Limit cannot exceed 100" })
196
+ .default(20),
197
+ cursor: z.string().optional(),
198
+ });
199
+
200
+ export const SearchCreativeOutputSchema = z.object({
201
+ creatives: z.array(CreativeWithUserEntitySchema),
202
+ nextCursor: z.string().optional(),
203
+ });
@@ -8,6 +8,9 @@ import {
8
8
  CreateBrandOutputSchema,
9
9
  GetBrandOutputSchema,
10
10
  UpdateBrandOutputSchema,
11
+ BrandWithUserEntitySchema,
12
+ SearchBrandInputSchema,
13
+ SearchBrandOutputSchema,
11
14
  } from "../schemas/brand";
12
15
 
13
16
  export type BrandEntity = z.infer<typeof BrandEntitySchema>;
@@ -29,3 +32,7 @@ export type CreateBrandOutput = z.infer<typeof CreateBrandOutputSchema>;
29
32
  export type GetBrandOutput = z.infer<typeof GetBrandOutputSchema>;
30
33
 
31
34
  export type UpdateBrandOutput = z.infer<typeof UpdateBrandOutputSchema>;
35
+
36
+ export type BrandWithUserEntity = z.infer<typeof BrandWithUserEntitySchema>
37
+ export type SearchBrandInput = z.infer<typeof SearchBrandInputSchema>
38
+ export type SearchBrandOutput = z.infer<typeof SearchBrandOutputSchema>
@@ -8,6 +8,9 @@ import {
8
8
  CreateCreativeOutputSchema,
9
9
  GetCreativeOutputSchema,
10
10
  UpdateCreativeOutputSchema,
11
+ CreativeWithUserEntitySchema,
12
+ SearchCreativeInputSchema,
13
+ SearchCreativeOutputSchema,
11
14
  } from "../schemas/creative";
12
15
 
13
16
  export type CreativeEntity = z.infer<typeof CreativeEntitySchema>;
@@ -26,3 +29,7 @@ export type GetCreativeInput = z.infer<typeof GetCreativeInputSchema>;
26
29
  export type CreateCreativeOutput = z.infer<typeof CreateCreativeOutputSchema>;
27
30
  export type GetCreativeOutput = z.infer<typeof GetCreativeOutputSchema>;
28
31
  export type UpdateCreativeOutput = z.infer<typeof UpdateCreativeOutputSchema>;
32
+
33
+ export type CreativeWithUserEntity = z.infer<typeof CreativeWithUserEntitySchema>
34
+ export type SearchCreativeInput = z.infer<typeof SearchCreativeInputSchema>
35
+ export type SearchCreativeOutput = z.infer<typeof SearchCreativeOutputSchema>