@zyacreatives/shared 2.5.49 → 2.5.51

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.
@@ -1,22 +1,36 @@
1
1
  import { z } from "@hono/zod-openapi";
2
- export declare const MinimalBrandEntitySchema: z.ZodObject<{
3
- id: z.ZodCUID2;
4
- userId: z.ZodCUID2;
2
+ declare const BrandShape: z.ZodObject<{
5
3
  brandName: z.ZodString;
6
- bio: z.ZodOptional<z.ZodString>;
7
- disciplines: z.ZodOptional<z.ZodArray<z.ZodString>>;
8
- createdAt: z.ZodOptional<z.ZodCoercedDate<unknown>>;
9
- updatedAt: z.ZodCoercedDate<unknown>;
4
+ bio: z.ZodDefault<z.ZodString>;
5
+ location: z.ZodString;
6
+ disciplines: z.ZodDefault<z.ZodArray<z.ZodString>>;
7
+ links: z.ZodDefault<z.ZodArray<z.ZodObject<{
8
+ url: z.ZodURL;
9
+ type: z.ZodDefault<z.ZodEnum<{
10
+ readonly INSTAGRAM: "Instagram";
11
+ readonly LINKEDIN: "LinkedIn";
12
+ readonly TWITTER: "Twitter";
13
+ readonly YOUTUBE: "Youtube";
14
+ readonly PORTFOLIO: "Portfolio Website";
15
+ readonly GENERIC_WEBSITE: "Generic Website";
16
+ }>>;
17
+ }, z.core.$strip>>>;
18
+ achievements: z.ZodDefault<z.ZodArray<z.ZodObject<{
19
+ title: z.ZodString;
20
+ link: z.ZodOptional<z.ZodURL>;
21
+ year: z.ZodOptional<z.ZodNumber>;
22
+ }, z.core.$strip>>>;
10
23
  }, z.core.$strip>;
11
- export type MinimalBrandEntity = z.infer<typeof MinimalBrandEntitySchema>;
24
+ export type BrandShapeType = z.infer<typeof BrandShape>;
12
25
  export declare const BrandEntitySchema: z.ZodObject<{
13
- id: z.ZodCUID2;
14
- userId: z.ZodCUID2;
26
+ createdAt: z.ZodISODateTime;
27
+ updatedAt: z.ZodISODateTime;
28
+ version: z.ZodInt;
15
29
  brandName: z.ZodString;
16
- bio: z.ZodOptional<z.ZodString>;
30
+ bio: z.ZodDefault<z.ZodString>;
17
31
  location: z.ZodString;
18
- disciplines: z.ZodOptional<z.ZodArray<z.ZodString>>;
19
- links: z.ZodOptional<z.ZodArray<z.ZodObject<{
32
+ disciplines: z.ZodDefault<z.ZodArray<z.ZodString>>;
33
+ links: z.ZodDefault<z.ZodArray<z.ZodObject<{
20
34
  url: z.ZodURL;
21
35
  type: z.ZodDefault<z.ZodEnum<{
22
36
  readonly INSTAGRAM: "Instagram";
@@ -27,42 +41,75 @@ export declare const BrandEntitySchema: z.ZodObject<{
27
41
  readonly GENERIC_WEBSITE: "Generic Website";
28
42
  }>>;
29
43
  }, z.core.$strip>>>;
30
- achievements: z.ZodOptional<z.ZodArray<z.ZodObject<{
44
+ achievements: z.ZodDefault<z.ZodArray<z.ZodObject<{
31
45
  title: z.ZodString;
32
46
  link: z.ZodOptional<z.ZodURL>;
33
47
  year: z.ZodOptional<z.ZodNumber>;
34
48
  }, z.core.$strip>>>;
35
- createdAt: z.ZodCoercedDate<unknown>;
36
- updatedAt: z.ZodCoercedDate<unknown>;
37
- version: z.ZodInt;
49
+ id: z.ZodCUID2;
50
+ userId: z.ZodCUID2;
38
51
  }, z.core.$strip>;
39
52
  export type BrandEntity = z.infer<typeof BrandEntitySchema>;
40
- export declare const CreateBrandProfileInputSchema: z.ZodObject<{
53
+ export declare const MinimalBrandEntitySchema: z.ZodObject<{
54
+ id: z.ZodCUID2;
55
+ createdAt: z.ZodISODateTime;
56
+ userId: z.ZodCUID2;
57
+ updatedAt: z.ZodISODateTime;
58
+ bio: z.ZodDefault<z.ZodString>;
59
+ disciplines: z.ZodDefault<z.ZodArray<z.ZodString>>;
60
+ brandName: z.ZodString;
61
+ }, z.core.$strip>;
62
+ export type MinimalBrandEntity = z.infer<typeof MinimalBrandEntitySchema>;
63
+ export declare const BrandWithUserEntitySchema: z.ZodObject<{
64
+ id: z.ZodCUID2;
65
+ createdAt: z.ZodISODateTime;
66
+ userId: z.ZodCUID2;
67
+ updatedAt: z.ZodISODateTime;
68
+ bio: z.ZodDefault<z.ZodString>;
69
+ disciplines: z.ZodDefault<z.ZodArray<z.ZodString>>;
41
70
  brandName: z.ZodString;
71
+ user: z.ZodObject<{
72
+ email: z.ZodEmail;
73
+ username: z.ZodDefault<z.ZodString>;
74
+ id: z.ZodCUID2;
75
+ name: z.ZodDefault<z.ZodString>;
76
+ image: z.ZodDefault<z.ZodString>;
77
+ role: z.ZodEnum<{
78
+ CREATIVE: "CREATIVE";
79
+ BRAND: "BRAND";
80
+ INVESTOR: "INVESTOR";
81
+ ADMIN: "ADMIN";
82
+ }>;
83
+ }, z.core.$strip>;
84
+ }, z.core.$strip>;
85
+ export type BrandWithUserEntity = z.infer<typeof BrandWithUserEntitySchema>;
86
+ export declare const CreateBrandProfileInputSchema: z.ZodObject<{
42
87
  location: z.ZodString;
43
- disciplineSlugs: z.ZodDefault<z.ZodArray<z.ZodString>>;
88
+ brandName: z.ZodString;
89
+ disciplineSlugs: z.ZodArray<z.ZodString>;
44
90
  }, z.core.$strip>;
45
91
  export type CreateBrandProfileInput = z.infer<typeof CreateBrandProfileInputSchema>;
46
92
  export declare const UpdateBrandProfileInputSchema: z.ZodObject<{
47
93
  brandName: z.ZodOptional<z.ZodString>;
48
- links: z.ZodOptional<z.ZodArray<z.ZodObject<{
49
- url: z.ZodUnion<readonly [z.ZodURL, z.ZodLiteral<"">]>;
50
- type: z.ZodEnum<{
94
+ bio: z.ZodOptional<z.ZodDefault<z.ZodString>>;
95
+ location: z.ZodOptional<z.ZodString>;
96
+ disciplines: z.ZodOptional<z.ZodDefault<z.ZodArray<z.ZodString>>>;
97
+ links: z.ZodOptional<z.ZodDefault<z.ZodArray<z.ZodObject<{
98
+ url: z.ZodURL;
99
+ type: z.ZodDefault<z.ZodEnum<{
51
100
  readonly INSTAGRAM: "Instagram";
52
101
  readonly LINKEDIN: "LinkedIn";
53
102
  readonly TWITTER: "Twitter";
54
103
  readonly YOUTUBE: "Youtube";
55
104
  readonly PORTFOLIO: "Portfolio Website";
56
105
  readonly GENERIC_WEBSITE: "Generic Website";
57
- }>;
58
- }, z.core.$strip>>>;
59
- location: z.ZodString;
60
- achievements: z.ZodOptional<z.ZodArray<z.ZodObject<{
106
+ }>>;
107
+ }, z.core.$strip>>>>;
108
+ achievements: z.ZodOptional<z.ZodDefault<z.ZodArray<z.ZodObject<{
61
109
  title: z.ZodString;
62
110
  link: z.ZodOptional<z.ZodURL>;
63
111
  year: z.ZodOptional<z.ZodNumber>;
64
- }, z.core.$strip>>>;
65
- bio: z.ZodOptional<z.ZodString>;
112
+ }, z.core.$strip>>>>;
66
113
  disciplineSlugs: z.ZodOptional<z.ZodArray<z.ZodString>>;
67
114
  version: z.ZodInt;
68
115
  }, z.core.$strip>;
@@ -81,14 +128,47 @@ export declare const GetBrandQuerySchema: z.ZodObject<{
81
128
  userId: "userId";
82
129
  }>>>;
83
130
  }, z.core.$strip>;
131
+ export declare const SearchBrandInputSchema: z.ZodObject<{
132
+ string: z.ZodString;
133
+ limit: z.ZodDefault<z.ZodCoercedNumber<unknown>>;
134
+ cursor: z.ZodOptional<z.ZodString>;
135
+ }, z.core.$strip>;
136
+ export type SearchBrandInput = z.infer<typeof SearchBrandInputSchema>;
137
+ export declare const SearchBrandOutputSchema: z.ZodObject<{
138
+ brands: z.ZodArray<z.ZodObject<{
139
+ id: z.ZodCUID2;
140
+ createdAt: z.ZodISODateTime;
141
+ userId: z.ZodCUID2;
142
+ updatedAt: z.ZodISODateTime;
143
+ bio: z.ZodDefault<z.ZodString>;
144
+ disciplines: z.ZodDefault<z.ZodArray<z.ZodString>>;
145
+ brandName: z.ZodString;
146
+ user: z.ZodObject<{
147
+ email: z.ZodEmail;
148
+ username: z.ZodDefault<z.ZodString>;
149
+ id: z.ZodCUID2;
150
+ name: z.ZodDefault<z.ZodString>;
151
+ image: z.ZodDefault<z.ZodString>;
152
+ role: z.ZodEnum<{
153
+ CREATIVE: "CREATIVE";
154
+ BRAND: "BRAND";
155
+ INVESTOR: "INVESTOR";
156
+ ADMIN: "ADMIN";
157
+ }>;
158
+ }, z.core.$strip>;
159
+ }, z.core.$strip>>;
160
+ nextCursor: z.ZodOptional<z.ZodNullable<z.ZodString>>;
161
+ }, z.core.$strip>;
162
+ export type SearchBrandOutput = z.infer<typeof SearchBrandOutputSchema>;
84
163
  export declare const CreateBrandOutputSchema: z.ZodObject<{
85
- id: z.ZodCUID2;
86
- userId: z.ZodCUID2;
164
+ createdAt: z.ZodISODateTime;
165
+ updatedAt: z.ZodISODateTime;
166
+ version: z.ZodInt;
87
167
  brandName: z.ZodString;
88
- bio: z.ZodOptional<z.ZodString>;
168
+ bio: z.ZodDefault<z.ZodString>;
89
169
  location: z.ZodString;
90
- disciplines: z.ZodOptional<z.ZodArray<z.ZodString>>;
91
- links: z.ZodOptional<z.ZodArray<z.ZodObject<{
170
+ disciplines: z.ZodDefault<z.ZodArray<z.ZodString>>;
171
+ links: z.ZodDefault<z.ZodArray<z.ZodObject<{
92
172
  url: z.ZodURL;
93
173
  type: z.ZodDefault<z.ZodEnum<{
94
174
  readonly INSTAGRAM: "Instagram";
@@ -99,24 +179,24 @@ export declare const CreateBrandOutputSchema: z.ZodObject<{
99
179
  readonly GENERIC_WEBSITE: "Generic Website";
100
180
  }>>;
101
181
  }, z.core.$strip>>>;
102
- achievements: z.ZodOptional<z.ZodArray<z.ZodObject<{
182
+ achievements: z.ZodDefault<z.ZodArray<z.ZodObject<{
103
183
  title: z.ZodString;
104
184
  link: z.ZodOptional<z.ZodURL>;
105
185
  year: z.ZodOptional<z.ZodNumber>;
106
186
  }, z.core.$strip>>>;
107
- createdAt: z.ZodCoercedDate<unknown>;
108
- updatedAt: z.ZodCoercedDate<unknown>;
109
- version: z.ZodInt;
187
+ id: z.ZodCUID2;
188
+ userId: z.ZodCUID2;
110
189
  }, z.core.$strip>;
111
190
  export type CreateBrandOutput = z.infer<typeof CreateBrandOutputSchema>;
112
191
  export declare const GetBrandOutputSchema: z.ZodObject<{
113
- id: z.ZodCUID2;
114
- userId: z.ZodCUID2;
192
+ createdAt: z.ZodISODateTime;
193
+ updatedAt: z.ZodISODateTime;
194
+ version: z.ZodInt;
115
195
  brandName: z.ZodString;
116
- bio: z.ZodOptional<z.ZodString>;
196
+ bio: z.ZodDefault<z.ZodString>;
117
197
  location: z.ZodString;
118
- disciplines: z.ZodOptional<z.ZodArray<z.ZodString>>;
119
- links: z.ZodOptional<z.ZodArray<z.ZodObject<{
198
+ disciplines: z.ZodDefault<z.ZodArray<z.ZodString>>;
199
+ links: z.ZodDefault<z.ZodArray<z.ZodObject<{
120
200
  url: z.ZodURL;
121
201
  type: z.ZodDefault<z.ZodEnum<{
122
202
  readonly INSTAGRAM: "Instagram";
@@ -127,24 +207,24 @@ export declare const GetBrandOutputSchema: z.ZodObject<{
127
207
  readonly GENERIC_WEBSITE: "Generic Website";
128
208
  }>>;
129
209
  }, z.core.$strip>>>;
130
- achievements: z.ZodOptional<z.ZodArray<z.ZodObject<{
210
+ achievements: z.ZodDefault<z.ZodArray<z.ZodObject<{
131
211
  title: z.ZodString;
132
212
  link: z.ZodOptional<z.ZodURL>;
133
213
  year: z.ZodOptional<z.ZodNumber>;
134
214
  }, z.core.$strip>>>;
135
- createdAt: z.ZodCoercedDate<unknown>;
136
- updatedAt: z.ZodCoercedDate<unknown>;
137
- version: z.ZodInt;
215
+ id: z.ZodCUID2;
216
+ userId: z.ZodCUID2;
138
217
  }, z.core.$strip>;
139
218
  export type GetBrandOutput = z.infer<typeof GetBrandOutputSchema>;
140
219
  export declare const UpdateBrandOutputSchema: z.ZodObject<{
141
- id: z.ZodCUID2;
142
- userId: z.ZodCUID2;
220
+ createdAt: z.ZodISODateTime;
221
+ updatedAt: z.ZodISODateTime;
222
+ version: z.ZodInt;
143
223
  brandName: z.ZodString;
144
- bio: z.ZodOptional<z.ZodString>;
224
+ bio: z.ZodDefault<z.ZodString>;
145
225
  location: z.ZodString;
146
- disciplines: z.ZodOptional<z.ZodArray<z.ZodString>>;
147
- links: z.ZodOptional<z.ZodArray<z.ZodObject<{
226
+ disciplines: z.ZodDefault<z.ZodArray<z.ZodString>>;
227
+ links: z.ZodDefault<z.ZodArray<z.ZodObject<{
148
228
  url: z.ZodURL;
149
229
  type: z.ZodDefault<z.ZodEnum<{
150
230
  readonly INSTAGRAM: "Instagram";
@@ -155,68 +235,13 @@ export declare const UpdateBrandOutputSchema: z.ZodObject<{
155
235
  readonly GENERIC_WEBSITE: "Generic Website";
156
236
  }>>;
157
237
  }, z.core.$strip>>>;
158
- achievements: z.ZodOptional<z.ZodArray<z.ZodObject<{
238
+ achievements: z.ZodDefault<z.ZodArray<z.ZodObject<{
159
239
  title: z.ZodString;
160
240
  link: z.ZodOptional<z.ZodURL>;
161
241
  year: z.ZodOptional<z.ZodNumber>;
162
242
  }, z.core.$strip>>>;
163
- createdAt: z.ZodCoercedDate<unknown>;
164
- updatedAt: z.ZodCoercedDate<unknown>;
165
- version: z.ZodInt;
166
- }, z.core.$strip>;
167
- export type UpdateBrandOutput = z.infer<typeof UpdateBrandOutputSchema>;
168
- export declare const BrandWithUserEntitySchema: z.ZodObject<{
169
243
  id: z.ZodCUID2;
170
244
  userId: z.ZodCUID2;
171
- brandName: z.ZodString;
172
- bio: z.ZodOptional<z.ZodString>;
173
- disciplines: z.ZodOptional<z.ZodArray<z.ZodString>>;
174
- createdAt: z.ZodOptional<z.ZodCoercedDate<unknown>>;
175
- updatedAt: z.ZodCoercedDate<unknown>;
176
- user: z.ZodObject<{
177
- email: z.ZodEmail;
178
- username: z.ZodOptional<z.ZodString>;
179
- id: z.ZodCUID2;
180
- name: z.ZodOptional<z.ZodString>;
181
- image: z.ZodOptional<z.ZodString>;
182
- role: z.ZodEnum<{
183
- CREATIVE: "CREATIVE";
184
- BRAND: "BRAND";
185
- INVESTOR: "INVESTOR";
186
- ADMIN: "ADMIN";
187
- }>;
188
- }, z.core.$strip>;
189
- }, z.core.$strip>;
190
- export type BrandWithUserEntity = z.infer<typeof BrandWithUserEntitySchema>;
191
- export declare const SearchBrandInputSchema: z.ZodObject<{
192
- string: z.ZodString;
193
- limit: z.ZodDefault<z.ZodCoercedNumber<unknown>>;
194
- cursor: z.ZodOptional<z.ZodString>;
195
- }, z.core.$strip>;
196
- export type SearchBrandInput = z.infer<typeof SearchBrandInputSchema>;
197
- export declare const SearchBrandOutputSchema: z.ZodObject<{
198
- brands: z.ZodArray<z.ZodObject<{
199
- id: z.ZodCUID2;
200
- userId: z.ZodCUID2;
201
- brandName: z.ZodString;
202
- bio: z.ZodOptional<z.ZodString>;
203
- disciplines: z.ZodOptional<z.ZodArray<z.ZodString>>;
204
- createdAt: z.ZodOptional<z.ZodCoercedDate<unknown>>;
205
- updatedAt: z.ZodCoercedDate<unknown>;
206
- user: z.ZodObject<{
207
- email: z.ZodEmail;
208
- username: z.ZodOptional<z.ZodString>;
209
- id: z.ZodCUID2;
210
- name: z.ZodOptional<z.ZodString>;
211
- image: z.ZodOptional<z.ZodString>;
212
- role: z.ZodEnum<{
213
- CREATIVE: "CREATIVE";
214
- BRAND: "BRAND";
215
- INVESTOR: "INVESTOR";
216
- ADMIN: "ADMIN";
217
- }>;
218
- }, z.core.$strip>;
219
- }, z.core.$strip>>;
220
- nextCursor: z.ZodNullable<z.ZodOptional<z.ZodString>>;
221
245
  }, z.core.$strip>;
222
- export type SearchBrandOutput = z.infer<typeof SearchBrandOutputSchema>;
246
+ export type UpdateBrandOutput = z.infer<typeof UpdateBrandOutputSchema>;
247
+ export {};
@@ -1,144 +1,81 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.SearchBrandOutputSchema = exports.SearchBrandInputSchema = exports.BrandWithUserEntitySchema = exports.UpdateBrandOutputSchema = exports.GetBrandOutputSchema = exports.CreateBrandOutputSchema = exports.GetBrandQuerySchema = exports.GetBrandInputSchema = exports.UpdateBrandProfileInputSchema = exports.CreateBrandProfileInputSchema = exports.BrandEntitySchema = exports.MinimalBrandEntitySchema = void 0;
3
+ exports.UpdateBrandOutputSchema = exports.GetBrandOutputSchema = exports.CreateBrandOutputSchema = exports.SearchBrandOutputSchema = exports.SearchBrandInputSchema = exports.GetBrandQuerySchema = exports.GetBrandInputSchema = exports.UpdateBrandProfileInputSchema = exports.CreateBrandProfileInputSchema = exports.BrandWithUserEntitySchema = exports.MinimalBrandEntitySchema = exports.BrandEntitySchema = 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
  const user_1 = require("./user");
8
- exports.MinimalBrandEntitySchema = zod_openapi_1.z.object({
9
- id: zod_openapi_1.z.cuid2().openapi({ example: "brd_cksd0v6q0000s9a5y8z7p3x9" }),
10
- userId: zod_openapi_1.z.cuid2().openapi({ example: "user_owner_123" }),
11
- brandName: zod_openapi_1.z.string().openapi({ example: "TechInnovate Inc." }),
12
- bio: zod_openapi_1.z.string().optional().openapi({
13
- example: "Leading software development firm focused on AI.",
14
- }),
15
- disciplines: zod_openapi_1.z
16
- .array(zod_openapi_1.z.string())
17
- .optional()
18
- .openapi({ example: ["Marketing", "Product Development"] }),
19
- createdAt: zod_openapi_1.z.coerce
20
- .date()
21
- .optional()
22
- .openapi({ example: "2025-10-13T09:00:00.000Z" }),
23
- updatedAt: zod_openapi_1.z.coerce.date().openapi({ example: "2025-10-13T09:00:00.000Z" }),
24
- });
25
- exports.BrandEntitySchema = zod_openapi_1.z
26
- .object({
27
- id: zod_openapi_1.z.cuid2().openapi({ example: "brd_cksd0v6q0000s9a5y8z7p3x9" }),
28
- userId: zod_openapi_1.z.cuid2().openapi({ example: "user_owner_123" }),
29
- brandName: zod_openapi_1.z.string().openapi({ example: "TechInnovate Inc." }),
30
- bio: zod_openapi_1.z.string().optional().openapi({
31
- example: "Leading software development firm focused on AI.",
32
- }),
33
- location: zod_openapi_1.z.string().openapi({
34
- example: "UK",
35
- }),
36
- disciplines: zod_openapi_1.z
37
- .array(zod_openapi_1.z.string())
38
- .optional()
39
- .openapi({ example: ["Marketing", "Product Development"] }),
8
+ const BrandShape = zod_openapi_1.z.object({
9
+ brandName: zod_openapi_1.z.string().min(1).max(200),
10
+ bio: zod_openapi_1.z.string().max(600).default(""),
11
+ location: zod_openapi_1.z.string(),
12
+ disciplines: zod_openapi_1.z.array(zod_openapi_1.z.string()).default([]),
40
13
  links: zod_openapi_1.z
41
- .object({
14
+ .array(zod_openapi_1.z.object({
42
15
  url: zod_openapi_1.z.url(),
43
16
  type: zod_openapi_1.z.enum(constants_1.LINK_TYPES).default(constants_1.LINK_TYPES.GENERIC_WEBSITE),
44
- })
45
- .array()
46
- .optional(),
17
+ }))
18
+ .default([]),
47
19
  achievements: zod_openapi_1.z
48
- .object({
20
+ .array(zod_openapi_1.z.object({
49
21
  title: zod_openapi_1.z.string(),
50
22
  link: zod_openapi_1.z.url().optional(),
51
23
  year: zod_openapi_1.z.number().int().optional(),
52
- })
53
- .array()
54
- .optional(),
55
- createdAt: zod_openapi_1.z.coerce.date().openapi({ example: "2025-10-13T09:00:00.000Z" }),
56
- updatedAt: zod_openapi_1.z.coerce.date().openapi({ example: "2025-10-13T09:00:00.000Z" }),
57
- version: zod_openapi_1.z.int(),
58
- })
59
- .openapi("BrandEntitySchema");
60
- exports.CreateBrandProfileInputSchema = zod_openapi_1.z
24
+ }))
25
+ .default([]),
26
+ });
27
+ exports.BrandEntitySchema = zod_openapi_1.z
61
28
  .object({
62
- brandName: zod_openapi_1.z
63
- .string()
64
- .min(1, "Brand name is required")
65
- .openapi({ example: "Acme Creative Studio" }),
66
- location: zod_openapi_1.z.string().openapi({
67
- example: "UK",
68
- }),
69
- disciplineSlugs: zod_openapi_1.z
70
- .array(zod_openapi_1.z.string())
71
- .min(1, "At least one discipline is required")
72
- .default([])
73
- .openapi({ example: ["ui-ux", "frontend"] }),
29
+ id: zod_openapi_1.z.cuid2().openapi({ example: "brd_cksd0v6q0000s9a5y8z7p3x9" }),
30
+ userId: zod_openapi_1.z.cuid2().openapi({ example: "user_owner_123" }),
31
+ ...BrandShape.shape,
32
+ createdAt: zod_openapi_1.z.iso.datetime(),
33
+ updatedAt: zod_openapi_1.z.iso.datetime(),
34
+ version: zod_openapi_1.z.int(),
74
35
  })
75
- .openapi({
76
- title: "create brand profile",
36
+ .openapi("BrandEntity");
37
+ exports.MinimalBrandEntitySchema = exports.BrandEntitySchema.pick({
38
+ id: true,
39
+ userId: true,
40
+ brandName: true,
41
+ bio: true,
42
+ disciplines: true,
43
+ createdAt: true,
44
+ updatedAt: true,
77
45
  });
78
- exports.UpdateBrandProfileInputSchema = zod_openapi_1.z
79
- .object({
80
- brandName: zod_openapi_1.z.string().min(1).optional().openapi({ example: "Acme Studio" }),
81
- links: zod_openapi_1.z
82
- .object({
83
- url: zod_openapi_1.z.union([
84
- zod_openapi_1.z.url({ message: "Please enter a valid URL" }),
85
- zod_openapi_1.z.literal(""),
86
- ]),
87
- type: zod_openapi_1.z.enum(constants_1.LINK_TYPES),
88
- })
89
- .array()
90
- .optional(),
91
- location: zod_openapi_1.z.string().openapi({
92
- example: "UK",
93
- }),
94
- achievements: zod_openapi_1.z
95
- .object({
96
- title: zod_openapi_1.z.string(),
97
- link: zod_openapi_1.z.url().optional(),
98
- year: zod_openapi_1.z.number().int().optional(),
99
- })
100
- .array()
101
- .optional(),
102
- bio: zod_openapi_1.z
103
- .string()
104
- .max(600)
105
- .optional()
106
- .openapi({ example: "Updated bio for our creative agency." }),
46
+ exports.BrandWithUserEntitySchema = exports.MinimalBrandEntitySchema.extend({
47
+ user: user_1.MinimalUserSchema,
48
+ });
49
+ exports.CreateBrandProfileInputSchema = BrandShape.pick({
50
+ brandName: true,
51
+ location: true,
52
+ }).extend({
107
53
  disciplineSlugs: zod_openapi_1.z
108
54
  .array(zod_openapi_1.z.string())
109
- .min(1, "At least one discipline is required")
110
- .optional()
111
- .openapi({ example: ["frontend", "ui-ux"] }),
55
+ .min(1, "At least one discipline is required"),
56
+ });
57
+ exports.UpdateBrandProfileInputSchema = BrandShape.partial()
58
+ .extend({
59
+ disciplineSlugs: zod_openapi_1.z.array(zod_openapi_1.z.string()).optional(),
112
60
  version: zod_openapi_1.z.int(),
113
61
  })
114
- .openapi({
115
- title: "update brand profile",
62
+ .refine((d) => Object.values(d).some((v) => v !== undefined), {
63
+ message: "At least one field must be provided",
116
64
  });
117
65
  exports.GetBrandInputSchema = zod_openapi_1.z.object({
118
66
  value: zod_openapi_1.z.cuid2(),
119
67
  by: common_1.ProfileIdentifierSchema.shape.by,
120
68
  });
121
69
  exports.GetBrandQuerySchema = common_1.ProfileIdentifierSchema;
122
- exports.CreateBrandOutputSchema = exports.BrandEntitySchema;
123
- exports.GetBrandOutputSchema = exports.BrandEntitySchema;
124
- exports.UpdateBrandOutputSchema = exports.BrandEntitySchema;
125
- exports.BrandWithUserEntitySchema = exports.MinimalBrandEntitySchema.extend({
126
- user: user_1.MinimalUserSchema,
127
- });
128
70
  exports.SearchBrandInputSchema = zod_openapi_1.z.object({
129
- string: zod_openapi_1.z
130
- .string()
131
- .min(1, { message: "Search string cannot be empty" })
132
- .max(200, { message: "Search string cannot exceed 200 characters" }),
133
- limit: zod_openapi_1.z.coerce
134
- .number()
135
- .int({ message: "Limit must be an integer" })
136
- .min(1, { message: "Limit must be at least 1" })
137
- .max(100, { message: "Limit cannot exceed 100" })
138
- .default(20),
71
+ string: zod_openapi_1.z.string().min(1, "Search string cannot be empty").max(200),
72
+ limit: zod_openapi_1.z.coerce.number().int().min(1).max(100).default(20),
139
73
  cursor: zod_openapi_1.z.string().optional(),
140
74
  });
141
75
  exports.SearchBrandOutputSchema = zod_openapi_1.z.object({
142
76
  brands: zod_openapi_1.z.array(exports.BrandWithUserEntitySchema),
143
- nextCursor: zod_openapi_1.z.string().optional().nullable(),
77
+ nextCursor: zod_openapi_1.z.string().nullable().optional(),
144
78
  });
79
+ exports.CreateBrandOutputSchema = exports.BrandEntitySchema;
80
+ exports.GetBrandOutputSchema = exports.BrandEntitySchema;
81
+ exports.UpdateBrandOutputSchema = exports.BrandEntitySchema;
@@ -117,3 +117,28 @@ export declare const EntityRepliesOutputSchema: z.ZodObject<{
117
117
  nextCursor: z.ZodNullable<z.ZodString>;
118
118
  }, z.core.$strip>;
119
119
  export type EntityRepliesOutput = z.infer<typeof EntityRepliesOutputSchema>;
120
+ export declare const LinkSchema: z.ZodObject<{
121
+ url: z.ZodUnion<[z.ZodURL, z.ZodLiteral<"">]>;
122
+ type: z.ZodDefault<z.ZodEnum<{
123
+ readonly INSTAGRAM: "Instagram";
124
+ readonly LINKEDIN: "LinkedIn";
125
+ readonly TWITTER: "Twitter";
126
+ readonly YOUTUBE: "Youtube";
127
+ readonly PORTFOLIO: "Portfolio Website";
128
+ readonly GENERIC_WEBSITE: "Generic Website";
129
+ }>>;
130
+ }, z.core.$strip>;
131
+ export declare const AchievementSchema: z.ZodObject<{
132
+ title: z.ZodString;
133
+ link: z.ZodOptional<z.ZodURL>;
134
+ year: z.ZodOptional<z.ZodNumber>;
135
+ }, z.core.$strip>;
136
+ export declare const WorkExperienceSchema: z.ZodObject<{
137
+ companyName: z.ZodString;
138
+ position: z.ZodString;
139
+ startDate: z.ZodOptional<z.ZodISODateTime>;
140
+ endDate: z.ZodOptional<z.ZodISODateTime>;
141
+ currentlyWorking: z.ZodDefault<z.ZodBoolean>;
142
+ description: z.ZodDefault<z.ZodString>;
143
+ }, z.core.$strip>;
144
+ export declare const WebsiteUrlInputSchema: z.ZodOptional<z.ZodPipe<z.ZodPipe<z.ZodString, z.ZodTransform<string, string>>, z.ZodUnion<[z.ZodURL, z.ZodLiteral<"">]>>>;
@@ -1,9 +1,10 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.EntityRepliesOutputSchema = exports.EntityBookmarksOutputSchema = exports.EntityLikesOutputSchema = exports.EntityCommentsOutputSchema = exports.DefaultApiSuccessOutputSchema = exports.ProjectIdentifierSchema = exports.ProfileIdentifierSchema = exports.UserIdentifierSchema = exports.CuidSchema = void 0;
3
+ exports.WebsiteUrlInputSchema = exports.WorkExperienceSchema = exports.AchievementSchema = exports.LinkSchema = exports.EntityRepliesOutputSchema = exports.EntityBookmarksOutputSchema = exports.EntityLikesOutputSchema = exports.EntityCommentsOutputSchema = exports.DefaultApiSuccessOutputSchema = exports.ProjectIdentifierSchema = exports.ProfileIdentifierSchema = exports.UserIdentifierSchema = exports.CuidSchema = void 0;
4
4
  const zod_openapi_1 = require("@hono/zod-openapi");
5
5
  const comment_1 = require("./comment");
6
6
  const activity_1 = require("./activity");
7
+ const constants_1 = require("../constants");
7
8
  exports.CuidSchema = zod_openapi_1.z.cuid2({ error: "Invalid CUID2 is written." });
8
9
  exports.UserIdentifierSchema = zod_openapi_1.z.object({
9
10
  by: zod_openapi_1.z.enum(["id", "username"]).optional().default("id"),
@@ -33,3 +34,31 @@ exports.EntityRepliesOutputSchema = zod_openapi_1.z.object({
33
34
  replies: zod_openapi_1.z.array(activity_1.ActivitySchema),
34
35
  nextCursor: zod_openapi_1.z.string().nullable(),
35
36
  });
37
+ exports.LinkSchema = zod_openapi_1.z.object({
38
+ url: zod_openapi_1.z.url({ message: "Please enter a valid URL" }).or(zod_openapi_1.z.literal("")),
39
+ type: zod_openapi_1.z.enum(constants_1.LINK_TYPES).default(constants_1.LINK_TYPES.GENERIC_WEBSITE),
40
+ });
41
+ exports.AchievementSchema = zod_openapi_1.z.object({
42
+ title: zod_openapi_1.z.string().min(1),
43
+ link: zod_openapi_1.z.url().optional(),
44
+ year: zod_openapi_1.z.number().int().optional(),
45
+ });
46
+ exports.WorkExperienceSchema = zod_openapi_1.z.object({
47
+ companyName: zod_openapi_1.z.string().min(1),
48
+ position: zod_openapi_1.z.string().min(1),
49
+ startDate: zod_openapi_1.z.iso.datetime().optional(),
50
+ endDate: zod_openapi_1.z.iso.datetime().optional(),
51
+ currentlyWorking: zod_openapi_1.z.boolean().default(false),
52
+ description: zod_openapi_1.z.string().default(""),
53
+ });
54
+ exports.WebsiteUrlInputSchema = zod_openapi_1.z
55
+ .string()
56
+ .transform((val) => {
57
+ if (!val)
58
+ return val;
59
+ if (val.startsWith("http://") || val.startsWith("https://"))
60
+ return val;
61
+ return `https://${val}`;
62
+ })
63
+ .pipe(zod_openapi_1.z.url("Invalid URL").or(zod_openapi_1.z.literal("")))
64
+ .optional();