@zyacreatives/shared 2.1.70 → 2.1.72
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.
- package/dist/schemas/brand.d.ts +4 -4
- package/dist/schemas/brand.js +15 -4
- package/dist/schemas/user.d.ts +13 -2
- package/dist/schemas/user.js +18 -1
- package/dist/types/user.d.ts +2 -1
- package/package.json +1 -1
- package/src/schemas/brand.ts +154 -143
- package/src/schemas/user.ts +18 -0
- package/src/types/user.ts +2 -0
package/dist/schemas/brand.d.ts
CHANGED
|
@@ -30,7 +30,7 @@ export declare const BrandEntitySchema: z.ZodObject<{
|
|
|
30
30
|
link: z.ZodOptional<z.ZodURL>;
|
|
31
31
|
year: z.ZodOptional<z.ZodNumber>;
|
|
32
32
|
}, z.core.$strip>>>;
|
|
33
|
-
createdAt: z.
|
|
33
|
+
createdAt: z.ZodCoercedDate<unknown>;
|
|
34
34
|
updatedAt: z.ZodCoercedDate<unknown>;
|
|
35
35
|
}, z.core.$strip>;
|
|
36
36
|
export declare const ListBrandsInputSchema: z.ZodObject<{
|
|
@@ -107,7 +107,7 @@ export declare const CreateBrandOutputSchema: z.ZodObject<{
|
|
|
107
107
|
link: z.ZodOptional<z.ZodURL>;
|
|
108
108
|
year: z.ZodOptional<z.ZodNumber>;
|
|
109
109
|
}, z.core.$strip>>>;
|
|
110
|
-
createdAt: z.
|
|
110
|
+
createdAt: z.ZodCoercedDate<unknown>;
|
|
111
111
|
updatedAt: z.ZodCoercedDate<unknown>;
|
|
112
112
|
}, z.core.$strip>;
|
|
113
113
|
export declare const GetBrandOutputSchema: z.ZodObject<{
|
|
@@ -132,7 +132,7 @@ export declare const GetBrandOutputSchema: z.ZodObject<{
|
|
|
132
132
|
link: z.ZodOptional<z.ZodURL>;
|
|
133
133
|
year: z.ZodOptional<z.ZodNumber>;
|
|
134
134
|
}, z.core.$strip>>>;
|
|
135
|
-
createdAt: z.
|
|
135
|
+
createdAt: z.ZodCoercedDate<unknown>;
|
|
136
136
|
updatedAt: z.ZodCoercedDate<unknown>;
|
|
137
137
|
}, z.core.$strip>;
|
|
138
138
|
export declare const UpdateBrandOutputSchema: z.ZodObject<{
|
|
@@ -157,7 +157,7 @@ export declare const UpdateBrandOutputSchema: z.ZodObject<{
|
|
|
157
157
|
link: z.ZodOptional<z.ZodURL>;
|
|
158
158
|
year: z.ZodOptional<z.ZodNumber>;
|
|
159
159
|
}, z.core.$strip>>>;
|
|
160
|
-
createdAt: z.
|
|
160
|
+
createdAt: z.ZodCoercedDate<unknown>;
|
|
161
161
|
updatedAt: z.ZodCoercedDate<unknown>;
|
|
162
162
|
}, z.core.$strip>;
|
|
163
163
|
export declare const BrandWithUserEntitySchema: z.ZodObject<{
|
package/dist/schemas/brand.js
CHANGED
|
@@ -51,9 +51,10 @@ exports.BrandEntitySchema = zod_openapi_1.z
|
|
|
51
51
|
.optional(),
|
|
52
52
|
createdAt: zod_openapi_1.z.coerce
|
|
53
53
|
.date()
|
|
54
|
-
.optional()
|
|
55
54
|
.openapi({ example: "2025-10-13T09:00:00.000Z" }),
|
|
56
|
-
updatedAt: zod_openapi_1.z.coerce
|
|
55
|
+
updatedAt: zod_openapi_1.z.coerce
|
|
56
|
+
.date()
|
|
57
|
+
.openapi({ example: "2025-10-13T09:00:00.000Z" }),
|
|
57
58
|
})
|
|
58
59
|
.openapi("BrandEntitySchema");
|
|
59
60
|
exports.ListBrandsInputSchema = zod_openapi_1.z
|
|
@@ -71,7 +72,13 @@ exports.ListBrandsInputSchema = zod_openapi_1.z
|
|
|
71
72
|
description: "Filter based on the required experience level of partners.",
|
|
72
73
|
}),
|
|
73
74
|
location: zod_openapi_1.z.string().optional().openapi({ example: "San Francisco" }),
|
|
74
|
-
page: zod_openapi_1.z
|
|
75
|
+
page: zod_openapi_1.z
|
|
76
|
+
.number()
|
|
77
|
+
.int()
|
|
78
|
+
.min(1)
|
|
79
|
+
.default(1)
|
|
80
|
+
.optional()
|
|
81
|
+
.openapi({ example: 1 }),
|
|
75
82
|
perPage: zod_openapi_1.z
|
|
76
83
|
.number()
|
|
77
84
|
.int()
|
|
@@ -100,7 +107,11 @@ exports.CreateBrandProfileInputSchema = zod_openapi_1.z
|
|
|
100
107
|
exports.UpdateBrandProfileInputSchema = zod_openapi_1.z
|
|
101
108
|
.object({
|
|
102
109
|
expectedUpdateAt: zod_openapi_1.z.iso.datetime(),
|
|
103
|
-
brandName: zod_openapi_1.z
|
|
110
|
+
brandName: zod_openapi_1.z
|
|
111
|
+
.string()
|
|
112
|
+
.min(1)
|
|
113
|
+
.optional()
|
|
114
|
+
.openapi({ example: "Acme Studio" }),
|
|
104
115
|
links: zod_openapi_1.z
|
|
105
116
|
.object({
|
|
106
117
|
url: zod_openapi_1.z.union([
|
package/dist/schemas/user.d.ts
CHANGED
|
@@ -109,7 +109,7 @@ export declare const UserProfileEntitySchema: z.ZodObject<{
|
|
|
109
109
|
link: z.ZodOptional<z.ZodURL>;
|
|
110
110
|
year: z.ZodOptional<z.ZodNumber>;
|
|
111
111
|
}, z.core.$strip>>>;
|
|
112
|
-
createdAt: z.
|
|
112
|
+
createdAt: z.ZodCoercedDate<unknown>;
|
|
113
113
|
updatedAt: z.ZodCoercedDate<unknown>;
|
|
114
114
|
}, z.core.$strip>;
|
|
115
115
|
creative: z.ZodObject<{
|
|
@@ -533,7 +533,7 @@ export declare const GetAuthenticatedUserProfileOutputSchema: z.ZodObject<{
|
|
|
533
533
|
link: z.ZodOptional<z.ZodURL>;
|
|
534
534
|
year: z.ZodOptional<z.ZodNumber>;
|
|
535
535
|
}, z.core.$strip>>>;
|
|
536
|
-
createdAt: z.
|
|
536
|
+
createdAt: z.ZodCoercedDate<unknown>;
|
|
537
537
|
updatedAt: z.ZodCoercedDate<unknown>;
|
|
538
538
|
}, z.core.$strip>;
|
|
539
539
|
creative: z.ZodObject<{
|
|
@@ -784,3 +784,14 @@ export declare const GetUserActivityOutputSchema: z.ZodArray<z.ZodObject<{
|
|
|
784
784
|
JOB_APPLICATION: "JOB_APPLICATION";
|
|
785
785
|
}>;
|
|
786
786
|
}, z.core.$strip>>;
|
|
787
|
+
export declare const SearchUsersInputSchema: z.ZodObject<{
|
|
788
|
+
query: z.ZodDefault<z.ZodString>;
|
|
789
|
+
role: z.ZodOptional<z.ZodEnum<{
|
|
790
|
+
CREATIVE: "CREATIVE";
|
|
791
|
+
BRAND: "BRAND";
|
|
792
|
+
INVESTOR: "INVESTOR";
|
|
793
|
+
ADMIN: "ADMIN";
|
|
794
|
+
}>>;
|
|
795
|
+
limit: z.ZodDefault<z.ZodCoercedNumber<unknown>>;
|
|
796
|
+
cursor: z.ZodDefault<z.ZodCoercedNumber<unknown>>;
|
|
797
|
+
}, z.core.$strip>;
|
package/dist/schemas/user.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.GetUserActivityOutputSchema = exports.GetUserActivityInputSchema = exports.GetAuthenticatedUserWithProjectLikesOutputSchema = exports.GetAuthenticatedUserWithUserFollowersOutputSchema = exports.GetAuthenticatedUserWithUserFollowingOutputSchema = exports.GetAuthenticatedUserWithProjectBookmarksOutputSchema = exports.GetAuthenticatedUserWithProjectsOutputSchema = exports.GetAuthenticatedUserProfileOutputSchema = exports.GetAuthenticatedUserOutputSchema = exports.UserWithPostsEntitySchema = exports.GetUserFollowingOutputSchema = exports.GetUserFollowersOutputSchema = exports.UserWithFollowersEntitySchema = exports.UserWithFollowingEntitySchema = exports.GetUserFollowersInputSchema = exports.GetUserFollowingInputSchema = exports.UserWithProjectBookmarksEntitySchema = exports.UserWithProjectLikesEntitySchema = exports.UserWithProjectsEntitySchema = exports.UserProfileEntitySchema = exports.UserStatsEntitySchema = exports.MinimalUserSchema = exports.UserEntitySchema = void 0;
|
|
3
|
+
exports.SearchUsersInputSchema = exports.GetUserActivityOutputSchema = exports.GetUserActivityInputSchema = exports.GetAuthenticatedUserWithProjectLikesOutputSchema = exports.GetAuthenticatedUserWithUserFollowersOutputSchema = exports.GetAuthenticatedUserWithUserFollowingOutputSchema = exports.GetAuthenticatedUserWithProjectBookmarksOutputSchema = exports.GetAuthenticatedUserWithProjectsOutputSchema = exports.GetAuthenticatedUserProfileOutputSchema = exports.GetAuthenticatedUserOutputSchema = exports.UserWithPostsEntitySchema = exports.GetUserFollowingOutputSchema = exports.GetUserFollowersOutputSchema = exports.UserWithFollowersEntitySchema = exports.UserWithFollowingEntitySchema = exports.GetUserFollowersInputSchema = exports.GetUserFollowingInputSchema = exports.UserWithProjectBookmarksEntitySchema = exports.UserWithProjectLikesEntitySchema = exports.UserWithProjectsEntitySchema = exports.UserProfileEntitySchema = exports.UserStatsEntitySchema = exports.MinimalUserSchema = exports.UserEntitySchema = void 0;
|
|
4
4
|
const zod_openapi_1 = require("@hono/zod-openapi");
|
|
5
5
|
const constants_1 = require("../constants");
|
|
6
6
|
const project_1 = require("./project");
|
|
@@ -156,3 +156,20 @@ exports.GetUserActivityOutputSchema = zod_openapi_1.z.array(zod_openapi_1.z.obje
|
|
|
156
156
|
parentId: zod_openapi_1.z.string(),
|
|
157
157
|
parentType: zod_openapi_1.z.enum(Object.values(constants_1.ACTIVITY_PARENT_TYPES)),
|
|
158
158
|
}));
|
|
159
|
+
exports.SearchUsersInputSchema = zod_openapi_1.z.object({
|
|
160
|
+
query: zod_openapi_1.z.string().default("").openapi({
|
|
161
|
+
example: "john",
|
|
162
|
+
description: "Search by name, email, username, or discipline",
|
|
163
|
+
}),
|
|
164
|
+
role: zod_openapi_1.z.enum(Object.values(constants_1.ROLES)).optional(),
|
|
165
|
+
limit: zod_openapi_1.z.coerce
|
|
166
|
+
.number()
|
|
167
|
+
.min(1)
|
|
168
|
+
.max(100)
|
|
169
|
+
.default(20)
|
|
170
|
+
.openapi({ example: 20 }),
|
|
171
|
+
cursor: zod_openapi_1.z.coerce.number().min(0).default(0).openapi({
|
|
172
|
+
example: 0,
|
|
173
|
+
description: "The offset/cursor for pagination",
|
|
174
|
+
}),
|
|
175
|
+
});
|
package/dist/types/user.d.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { MinimalUserSchema, UserEntitySchema, UserProfileEntitySchema, UserWithProjectsEntitySchema, UserWithProjectBookmarksEntitySchema, GetUserFollowingInputSchema, GetUserFollowersInputSchema, UserWithFollowingEntitySchema, UserWithFollowersEntitySchema, GetUserFollowingOutputSchema, GetUserFollowersOutputSchema, GetAuthenticatedUserOutputSchema, GetAuthenticatedUserProfileOutputSchema, GetAuthenticatedUserWithProjectsOutputSchema, GetAuthenticatedUserWithProjectBookmarksOutputSchema, GetAuthenticatedUserWithUserFollowingOutputSchema, GetAuthenticatedUserWithUserFollowersOutputSchema, UserWithProjectLikesEntitySchema, GetAuthenticatedUserWithProjectLikesOutputSchema, GetUserActivityInputSchema, GetUserActivityOutputSchema, UserStatsEntitySchema, UserWithPostsEntitySchema } from "../schemas/user";
|
|
1
|
+
import { MinimalUserSchema, UserEntitySchema, UserProfileEntitySchema, UserWithProjectsEntitySchema, UserWithProjectBookmarksEntitySchema, GetUserFollowingInputSchema, GetUserFollowersInputSchema, UserWithFollowingEntitySchema, UserWithFollowersEntitySchema, GetUserFollowingOutputSchema, GetUserFollowersOutputSchema, GetAuthenticatedUserOutputSchema, GetAuthenticatedUserProfileOutputSchema, GetAuthenticatedUserWithProjectsOutputSchema, GetAuthenticatedUserWithProjectBookmarksOutputSchema, GetAuthenticatedUserWithUserFollowingOutputSchema, GetAuthenticatedUserWithUserFollowersOutputSchema, SearchUsersInputSchema, UserWithProjectLikesEntitySchema, GetAuthenticatedUserWithProjectLikesOutputSchema, GetUserActivityInputSchema, GetUserActivityOutputSchema, UserStatsEntitySchema, UserWithPostsEntitySchema } from "../schemas/user";
|
|
2
2
|
import { z } from "@hono/zod-openapi";
|
|
3
3
|
export type BaseUserEntity = z.infer<typeof UserEntitySchema>;
|
|
4
4
|
export type MinimalUser = z.infer<typeof MinimalUserSchema>;
|
|
@@ -24,3 +24,4 @@ export type GetAuthenticatedUserWithUserFollowersOutput = z.infer<typeof GetAuth
|
|
|
24
24
|
export type GetUserActivityInput = z.infer<typeof GetUserActivityInputSchema>;
|
|
25
25
|
export type GetUserActivityOutput = z.infer<typeof GetUserActivityOutputSchema>;
|
|
26
26
|
export type UserStatsEntity = z.infer<typeof UserStatsEntitySchema>;
|
|
27
|
+
export type SearchUsersInput = z.infer<typeof SearchUsersInputSchema>;
|
package/package.json
CHANGED
package/src/schemas/brand.ts
CHANGED
|
@@ -4,151 +4,162 @@ import { EXPERIENCE_LEVELS, ExperienceLevel, LINK_TYPES } from "../constants";
|
|
|
4
4
|
import { MinimalUserSchema } from "./user";
|
|
5
5
|
|
|
6
6
|
export const MinimalBrandEntitySchema = z.object({
|
|
7
|
-
id: z.cuid2().openapi({ example: "brd_cksd0v6q0000s9a5y8z7p3x9" }),
|
|
8
|
-
userId: z.cuid2().openapi({ example: "user_owner_123" }),
|
|
9
|
-
brandName: z.string().openapi({ example: "TechInnovate Inc." }),
|
|
10
|
-
bio: z.string().optional().openapi({
|
|
11
|
-
example: "Leading software development firm focused on AI.",
|
|
12
|
-
}),
|
|
13
|
-
|
|
14
|
-
disciplines: z
|
|
15
|
-
.array(z.string())
|
|
16
|
-
.optional()
|
|
17
|
-
.openapi({ example: ["Marketing", "Product Development"] }),
|
|
18
|
-
createdAt: z.coerce
|
|
19
|
-
.date()
|
|
20
|
-
.optional()
|
|
21
|
-
.openapi({ example: "2025-10-13T09:00:00.000Z" }),
|
|
22
|
-
updatedAt: z.coerce.date().openapi({ example: "2025-10-13T09:00:00.000Z" }),
|
|
23
|
-
});
|
|
24
|
-
|
|
25
|
-
export const BrandEntitySchema = z
|
|
26
|
-
.object({
|
|
27
7
|
id: z.cuid2().openapi({ example: "brd_cksd0v6q0000s9a5y8z7p3x9" }),
|
|
28
8
|
userId: z.cuid2().openapi({ example: "user_owner_123" }),
|
|
29
9
|
brandName: z.string().openapi({ example: "TechInnovate Inc." }),
|
|
30
10
|
bio: z.string().optional().openapi({
|
|
31
|
-
|
|
11
|
+
example: "Leading software development firm focused on AI.",
|
|
32
12
|
}),
|
|
33
|
-
disciplines: z
|
|
34
|
-
.array(z.string())
|
|
35
|
-
.optional()
|
|
36
|
-
.openapi({ example: ["Marketing", "Product Development"] }),
|
|
37
13
|
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
})
|
|
43
|
-
.array()
|
|
44
|
-
.optional(),
|
|
45
|
-
achievements: z
|
|
46
|
-
.object({
|
|
47
|
-
title: z.string(),
|
|
48
|
-
link: z.url().optional(),
|
|
49
|
-
year: z.number().int().optional(),
|
|
50
|
-
})
|
|
51
|
-
.array()
|
|
52
|
-
.optional(),
|
|
14
|
+
disciplines: z
|
|
15
|
+
.array(z.string())
|
|
16
|
+
.optional()
|
|
17
|
+
.openapi({ example: ["Marketing", "Product Development"] }),
|
|
53
18
|
createdAt: z.coerce
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
19
|
+
.date()
|
|
20
|
+
.optional()
|
|
21
|
+
.openapi({ example: "2025-10-13T09:00:00.000Z" }),
|
|
57
22
|
updatedAt: z.coerce.date().openapi({ example: "2025-10-13T09:00:00.000Z" }),
|
|
58
|
-
|
|
59
|
-
|
|
23
|
+
});
|
|
24
|
+
|
|
25
|
+
export const BrandEntitySchema = z
|
|
26
|
+
.object({
|
|
27
|
+
id: z.cuid2().openapi({ example: "brd_cksd0v6q0000s9a5y8z7p3x9" }),
|
|
28
|
+
userId: z.cuid2().openapi({ example: "user_owner_123" }),
|
|
29
|
+
brandName: z.string().openapi({ example: "TechInnovate Inc." }),
|
|
30
|
+
bio: z.string().optional().openapi({
|
|
31
|
+
example: "Leading software development firm focused on AI.",
|
|
32
|
+
}),
|
|
33
|
+
disciplines: z
|
|
34
|
+
.array(z.string())
|
|
35
|
+
.optional()
|
|
36
|
+
.openapi({ example: ["Marketing", "Product Development"] }),
|
|
37
|
+
|
|
38
|
+
links: z
|
|
39
|
+
.object({
|
|
40
|
+
url: z.url(),
|
|
41
|
+
type: z.enum(LINK_TYPES).default(LINK_TYPES.GENERIC_WEBSITE),
|
|
42
|
+
})
|
|
43
|
+
.array()
|
|
44
|
+
.optional(),
|
|
45
|
+
achievements: z
|
|
46
|
+
.object({
|
|
47
|
+
title: z.string(),
|
|
48
|
+
link: z.url().optional(),
|
|
49
|
+
year: z.number().int().optional(),
|
|
50
|
+
})
|
|
51
|
+
.array()
|
|
52
|
+
.optional(),
|
|
53
|
+
createdAt: z.coerce
|
|
54
|
+
.date()
|
|
55
|
+
.openapi({ example: "2025-10-13T09:00:00.000Z" }),
|
|
56
|
+
updatedAt: z.coerce
|
|
57
|
+
.date()
|
|
58
|
+
.openapi({ example: "2025-10-13T09:00:00.000Z" }),
|
|
59
|
+
})
|
|
60
|
+
.openapi("BrandEntitySchema");
|
|
60
61
|
|
|
61
62
|
export const ListBrandsInputSchema = z
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
63
|
+
.object({
|
|
64
|
+
query: z.string().optional().openapi({ example: "AI software brand" }),
|
|
65
|
+
disciplines: z
|
|
66
|
+
.array(z.string())
|
|
67
|
+
.optional()
|
|
68
|
+
.openapi({ example: ["design", "marketing"] }),
|
|
69
|
+
experienceLevels: z
|
|
70
|
+
.array(
|
|
71
|
+
z.enum(
|
|
72
|
+
Object.values(EXPERIENCE_LEVELS) as [
|
|
73
|
+
ExperienceLevel,
|
|
74
|
+
...ExperienceLevel[],
|
|
75
|
+
],
|
|
76
|
+
),
|
|
77
|
+
)
|
|
78
|
+
.optional()
|
|
79
|
+
.openapi({
|
|
80
|
+
example: ["SENIOR", "EXPERT"],
|
|
81
|
+
description:
|
|
82
|
+
"Filter based on the required experience level of partners.",
|
|
83
|
+
}),
|
|
84
|
+
location: z.string().optional().openapi({ example: "San Francisco" }),
|
|
85
|
+
page: z
|
|
86
|
+
.number()
|
|
87
|
+
.int()
|
|
88
|
+
.min(1)
|
|
89
|
+
.default(1)
|
|
90
|
+
.optional()
|
|
91
|
+
.openapi({ example: 1 }),
|
|
92
|
+
perPage: z
|
|
93
|
+
.number()
|
|
94
|
+
.int()
|
|
95
|
+
.min(1)
|
|
96
|
+
.max(100)
|
|
97
|
+
.default(20)
|
|
98
|
+
.optional()
|
|
99
|
+
.openapi({ example: 20 }),
|
|
100
|
+
})
|
|
101
|
+
.openapi("ListBrandsInput");
|
|
95
102
|
|
|
96
103
|
export const CreateBrandProfileInputSchema = z
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
104
|
+
.object({
|
|
105
|
+
brandName: z
|
|
106
|
+
.string()
|
|
107
|
+
.min(1, "Brand name is required")
|
|
108
|
+
.openapi({ example: "Acme Creative Studio" }),
|
|
109
|
+
disciplineSlugs: z
|
|
110
|
+
.array(z.string())
|
|
111
|
+
.min(1, "At least one discipline is required")
|
|
112
|
+
.default([])
|
|
113
|
+
.openapi({ example: ["ui-ux", "frontend"] }),
|
|
114
|
+
})
|
|
115
|
+
.openapi({
|
|
116
|
+
title: "create brand profile",
|
|
117
|
+
});
|
|
111
118
|
|
|
112
119
|
export const UpdateBrandProfileInputSchema = z
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
120
|
+
.object({
|
|
121
|
+
expectedUpdateAt: z.iso.datetime(),
|
|
122
|
+
brandName: z
|
|
123
|
+
.string()
|
|
124
|
+
.min(1)
|
|
125
|
+
.optional()
|
|
126
|
+
.openapi({ example: "Acme Studio" }),
|
|
127
|
+
links: z
|
|
128
|
+
.object({
|
|
129
|
+
url: z.union([
|
|
130
|
+
z.url({ message: "Please enter a valid URL" }),
|
|
131
|
+
z.literal(""),
|
|
132
|
+
]),
|
|
133
|
+
type: z.enum(LINK_TYPES),
|
|
134
|
+
})
|
|
135
|
+
.array()
|
|
136
|
+
.optional(),
|
|
137
|
+
achievements: z
|
|
138
|
+
.object({
|
|
139
|
+
title: z.string(),
|
|
140
|
+
link: z.url().optional(),
|
|
141
|
+
year: z.number().int().optional(),
|
|
142
|
+
})
|
|
143
|
+
.array()
|
|
144
|
+
.optional(),
|
|
145
|
+
bio: z
|
|
146
|
+
.string()
|
|
147
|
+
.max(600)
|
|
148
|
+
.optional()
|
|
149
|
+
.openapi({ example: "Updated bio for our creative agency." }),
|
|
150
|
+
disciplineSlugs: z
|
|
151
|
+
.array(z.string())
|
|
152
|
+
.min(1, "At least one discipline is required")
|
|
153
|
+
.optional()
|
|
154
|
+
.openapi({ example: ["frontend", "ui-ux"] }),
|
|
155
|
+
})
|
|
156
|
+
.openapi({
|
|
157
|
+
title: "update brand profile",
|
|
158
|
+
});
|
|
148
159
|
|
|
149
160
|
export const GetBrandInputSchema = z.object({
|
|
150
|
-
|
|
151
|
-
|
|
161
|
+
value: z.cuid2(),
|
|
162
|
+
by: ProfileIdentifierSchema.shape.by,
|
|
152
163
|
});
|
|
153
164
|
|
|
154
165
|
export const GetBrandQuerySchema = ProfileIdentifierSchema;
|
|
@@ -160,24 +171,24 @@ export const GetBrandOutputSchema = BrandEntitySchema;
|
|
|
160
171
|
export const UpdateBrandOutputSchema = BrandEntitySchema;
|
|
161
172
|
|
|
162
173
|
export const BrandWithUserEntitySchema = MinimalBrandEntitySchema.extend({
|
|
163
|
-
|
|
174
|
+
user: MinimalUserSchema,
|
|
164
175
|
});
|
|
165
176
|
|
|
166
177
|
export const SearchBrandInputSchema = z.object({
|
|
167
|
-
|
|
168
|
-
|
|
169
|
-
|
|
170
|
-
|
|
171
|
-
|
|
172
|
-
|
|
173
|
-
|
|
174
|
-
|
|
175
|
-
|
|
176
|
-
|
|
177
|
-
|
|
178
|
+
string: z
|
|
179
|
+
.string()
|
|
180
|
+
.min(1, { message: "Search string cannot be empty" })
|
|
181
|
+
.max(200, { message: "Search string cannot exceed 200 characters" }),
|
|
182
|
+
limit: z.coerce
|
|
183
|
+
.number()
|
|
184
|
+
.int({ message: "Limit must be an integer" })
|
|
185
|
+
.min(1, { message: "Limit must be at least 1" })
|
|
186
|
+
.max(100, { message: "Limit cannot exceed 100" })
|
|
187
|
+
.default(20),
|
|
188
|
+
cursor: z.string().optional(),
|
|
178
189
|
});
|
|
179
190
|
|
|
180
191
|
export const SearchBrandOutputSchema = z.object({
|
|
181
|
-
|
|
182
|
-
|
|
192
|
+
brands: z.array(BrandWithUserEntitySchema),
|
|
193
|
+
nextCursor: z.string().optional().nullable(),
|
|
183
194
|
});
|
package/src/schemas/user.ts
CHANGED
|
@@ -220,3 +220,21 @@ export const GetUserActivityOutputSchema = z.array(
|
|
|
220
220
|
),
|
|
221
221
|
}),
|
|
222
222
|
);
|
|
223
|
+
|
|
224
|
+
export const SearchUsersInputSchema = z.object({
|
|
225
|
+
query: z.string().default("").openapi({
|
|
226
|
+
example: "john",
|
|
227
|
+
description: "Search by name, email, username, or discipline",
|
|
228
|
+
}),
|
|
229
|
+
role: z.enum(Object.values(ROLES) as [Role, ...Role[]]).optional(),
|
|
230
|
+
limit: z.coerce
|
|
231
|
+
.number()
|
|
232
|
+
.min(1)
|
|
233
|
+
.max(100)
|
|
234
|
+
.default(20)
|
|
235
|
+
.openapi({ example: 20 }),
|
|
236
|
+
cursor: z.coerce.number().min(0).default(0).openapi({
|
|
237
|
+
example: 0,
|
|
238
|
+
description: "The offset/cursor for pagination",
|
|
239
|
+
}),
|
|
240
|
+
});
|
package/src/types/user.ts
CHANGED
|
@@ -16,6 +16,7 @@ import {
|
|
|
16
16
|
GetAuthenticatedUserWithProjectBookmarksOutputSchema,
|
|
17
17
|
GetAuthenticatedUserWithUserFollowingOutputSchema,
|
|
18
18
|
GetAuthenticatedUserWithUserFollowersOutputSchema,
|
|
19
|
+
SearchUsersInputSchema,
|
|
19
20
|
UserWithProjectLikesEntitySchema,
|
|
20
21
|
GetAuthenticatedUserWithProjectLikesOutputSchema,
|
|
21
22
|
GetUserActivityInputSchema,
|
|
@@ -79,3 +80,4 @@ export type GetAuthenticatedUserWithUserFollowersOutput = z.infer<
|
|
|
79
80
|
export type GetUserActivityInput = z.infer<typeof GetUserActivityInputSchema>;
|
|
80
81
|
export type GetUserActivityOutput = z.infer<typeof GetUserActivityOutputSchema>;
|
|
81
82
|
export type UserStatsEntity = z.infer<typeof UserStatsEntitySchema>;
|
|
83
|
+
export type SearchUsersInput = z.infer<typeof SearchUsersInputSchema>;
|