@zyacreatives/shared 2.0.51 → 2.0.53
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/post.d.ts +24 -6
- package/dist/schemas/post.js +7 -2
- package/dist/schemas/user.d.ts +5 -49
- package/dist/schemas/user.js +8 -20
- package/dist/types/common.d.ts +1 -2
- package/dist/types/user.d.ts +3 -2
- package/package.json +1 -1
- package/src/schemas/post.ts +10 -3
- package/src/schemas/user.ts +7 -22
- package/src/types/common.ts +1 -5
- package/src/types/user.ts +3 -2
package/dist/schemas/post.d.ts
CHANGED
|
@@ -2,7 +2,10 @@ import { z } from "@hono/zod-openapi";
|
|
|
2
2
|
export declare const PostEntitySchema: z.ZodObject<{
|
|
3
3
|
id: z.ZodCUID2;
|
|
4
4
|
parentId: z.ZodOptional<z.ZodCUID2>;
|
|
5
|
-
tags: z.ZodOptional<z.ZodArray<z.
|
|
5
|
+
tags: z.ZodOptional<z.ZodArray<z.ZodObject<{
|
|
6
|
+
name: z.ZodString;
|
|
7
|
+
id: z.ZodInt;
|
|
8
|
+
}, z.core.$strip>>>;
|
|
6
9
|
badge: z.ZodOptional<z.ZodEnum<{
|
|
7
10
|
readonly NETWORKING: "Networking";
|
|
8
11
|
readonly FUNDING: "Funding";
|
|
@@ -44,7 +47,10 @@ export declare const PostFileEntitySchema: z.ZodObject<{
|
|
|
44
47
|
export declare const PostWithFilesEntitySchema: z.ZodObject<{
|
|
45
48
|
id: z.ZodCUID2;
|
|
46
49
|
parentId: z.ZodOptional<z.ZodCUID2>;
|
|
47
|
-
tags: z.ZodOptional<z.ZodArray<z.
|
|
50
|
+
tags: z.ZodOptional<z.ZodArray<z.ZodObject<{
|
|
51
|
+
name: z.ZodString;
|
|
52
|
+
id: z.ZodInt;
|
|
53
|
+
}, z.core.$strip>>>;
|
|
48
54
|
badge: z.ZodOptional<z.ZodEnum<{
|
|
49
55
|
readonly NETWORKING: "Networking";
|
|
50
56
|
readonly FUNDING: "Funding";
|
|
@@ -122,7 +128,10 @@ export declare const CreatePostInputSchema: z.ZodObject<{
|
|
|
122
128
|
export declare const CreatePostOutputSchema: z.ZodObject<{
|
|
123
129
|
id: z.ZodCUID2;
|
|
124
130
|
parentId: z.ZodOptional<z.ZodCUID2>;
|
|
125
|
-
tags: z.ZodOptional<z.ZodArray<z.
|
|
131
|
+
tags: z.ZodOptional<z.ZodArray<z.ZodObject<{
|
|
132
|
+
name: z.ZodString;
|
|
133
|
+
id: z.ZodInt;
|
|
134
|
+
}, z.core.$strip>>>;
|
|
126
135
|
badge: z.ZodOptional<z.ZodEnum<{
|
|
127
136
|
readonly NETWORKING: "Networking";
|
|
128
137
|
readonly FUNDING: "Funding";
|
|
@@ -158,7 +167,10 @@ export declare const CreatePostOutputSchema: z.ZodObject<{
|
|
|
158
167
|
export declare const GetPostOutputSchema: z.ZodObject<{
|
|
159
168
|
id: z.ZodCUID2;
|
|
160
169
|
parentId: z.ZodOptional<z.ZodCUID2>;
|
|
161
|
-
tags: z.ZodOptional<z.ZodArray<z.
|
|
170
|
+
tags: z.ZodOptional<z.ZodArray<z.ZodObject<{
|
|
171
|
+
name: z.ZodString;
|
|
172
|
+
id: z.ZodInt;
|
|
173
|
+
}, z.core.$strip>>>;
|
|
162
174
|
badge: z.ZodOptional<z.ZodEnum<{
|
|
163
175
|
readonly NETWORKING: "Networking";
|
|
164
176
|
readonly FUNDING: "Funding";
|
|
@@ -269,7 +281,10 @@ export declare const LinkPreviewOutputSchema: z.ZodObject<{
|
|
|
269
281
|
export declare const FeedPostEntitySchema: z.ZodObject<{
|
|
270
282
|
id: z.ZodCUID2;
|
|
271
283
|
parentId: z.ZodOptional<z.ZodCUID2>;
|
|
272
|
-
tags: z.ZodOptional<z.ZodArray<z.
|
|
284
|
+
tags: z.ZodOptional<z.ZodArray<z.ZodObject<{
|
|
285
|
+
name: z.ZodString;
|
|
286
|
+
id: z.ZodInt;
|
|
287
|
+
}, z.core.$strip>>>;
|
|
273
288
|
badge: z.ZodOptional<z.ZodEnum<{
|
|
274
289
|
readonly NETWORKING: "Networking";
|
|
275
290
|
readonly FUNDING: "Funding";
|
|
@@ -333,7 +348,10 @@ export declare const GetFeedInputSchema: z.ZodObject<{
|
|
|
333
348
|
export declare const GetFeedOutputSchema: z.ZodArray<z.ZodObject<{
|
|
334
349
|
id: z.ZodCUID2;
|
|
335
350
|
parentId: z.ZodOptional<z.ZodCUID2>;
|
|
336
|
-
tags: z.ZodOptional<z.ZodArray<z.
|
|
351
|
+
tags: z.ZodOptional<z.ZodArray<z.ZodObject<{
|
|
352
|
+
name: z.ZodString;
|
|
353
|
+
id: z.ZodInt;
|
|
354
|
+
}, z.core.$strip>>>;
|
|
337
355
|
badge: z.ZodOptional<z.ZodEnum<{
|
|
338
356
|
readonly NETWORKING: "Networking";
|
|
339
357
|
readonly FUNDING: "Funding";
|
package/dist/schemas/post.js
CHANGED
|
@@ -16,7 +16,12 @@ exports.PostEntitySchema = zod_openapi_1.z.object({
|
|
|
16
16
|
.cuid2()
|
|
17
17
|
.optional()
|
|
18
18
|
.openapi({ description: "Parent id", example: "ckj1a2b3c0000abc" }),
|
|
19
|
-
tags: zod_openapi_1.z
|
|
19
|
+
tags: zod_openapi_1.z
|
|
20
|
+
.array(zod_openapi_1.z.object({
|
|
21
|
+
name: zod_openapi_1.z.string(),
|
|
22
|
+
id: zod_openapi_1.z.int(),
|
|
23
|
+
}))
|
|
24
|
+
.optional(),
|
|
20
25
|
badge: zod_openapi_1.z.enum(constants_1.POST_BADGE_TYPES).optional(),
|
|
21
26
|
userId: zod_openapi_1.z
|
|
22
27
|
.cuid2()
|
|
@@ -156,7 +161,7 @@ exports.FeedPostEntitySchema = exports.PostWithFilesEntitySchema.extend({
|
|
|
156
161
|
score: zod_openapi_1.z.number(),
|
|
157
162
|
isLiked: zod_openapi_1.z.boolean().optional(),
|
|
158
163
|
isFollowing: zod_openapi_1.z.boolean().optional(),
|
|
159
|
-
isBookmarked: zod_openapi_1.z.boolean().optional()
|
|
164
|
+
isBookmarked: zod_openapi_1.z.boolean().optional(),
|
|
160
165
|
});
|
|
161
166
|
exports.GetFeedInputSchema = zod_openapi_1.z.object({
|
|
162
167
|
limit: zod_openapi_1.z.number().optional(),
|
package/dist/schemas/user.d.ts
CHANGED
|
@@ -1,9 +1,5 @@
|
|
|
1
1
|
import { z } from "@hono/zod-openapi";
|
|
2
|
-
export declare const
|
|
3
|
-
followerCount: z.ZodOptional<z.ZodNumber>;
|
|
4
|
-
followingCount: z.ZodOptional<z.ZodNumber>;
|
|
5
|
-
}, z.core.$strip>;
|
|
6
|
-
export declare const BaseUserEntitySchema: z.ZodObject<{
|
|
2
|
+
export declare const UserEntitySchema: z.ZodObject<{
|
|
7
3
|
id: z.ZodCUID2;
|
|
8
4
|
email: z.ZodString;
|
|
9
5
|
emailVerified: z.ZodBoolean;
|
|
@@ -53,44 +49,10 @@ export declare const MinimalUserSchema: z.ZodObject<{
|
|
|
53
49
|
ADMIN: "ADMIN";
|
|
54
50
|
}>;
|
|
55
51
|
}, z.core.$strip>;
|
|
56
|
-
export declare const
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
name: z.ZodOptional<z.ZodString>;
|
|
61
|
-
image: z.ZodOptional<z.ZodString>;
|
|
62
|
-
username: z.ZodOptional<z.ZodString>;
|
|
63
|
-
displayUsername: z.ZodOptional<z.ZodString>;
|
|
64
|
-
role: z.ZodEnum<{
|
|
65
|
-
CREATIVE: "CREATIVE";
|
|
66
|
-
BRAND: "BRAND";
|
|
67
|
-
INVESTOR: "INVESTOR";
|
|
68
|
-
ADMIN: "ADMIN";
|
|
69
|
-
}>;
|
|
70
|
-
status: z.ZodEnum<{
|
|
71
|
-
ACTIVE: "ACTIVE";
|
|
72
|
-
SUSPENDED: "SUSPENDED";
|
|
73
|
-
DELETED: "DELETED";
|
|
74
|
-
}>;
|
|
75
|
-
onboardingPage: z.ZodEnum<{
|
|
76
|
-
EMAIL_VERIFICATION: "EMAIL_VERIFICATION";
|
|
77
|
-
USERNAME_SELECTION: "USERNAME_SELECTION";
|
|
78
|
-
ACCOUNT_TYPE_SELECTION: "ACCOUNT_TYPE_SELECTION";
|
|
79
|
-
CREATIVE_PROFILE_DETAILS: "CREATIVE_PROFILE_DETAILS";
|
|
80
|
-
CREATIVE_PROFILE_CUSTOMIZE_FEED: "CREATIVE_PROFILE_CUSTOMIZE_FEED";
|
|
81
|
-
CREATIVE_PROFILE_PORTFOLIO: "CREATIVE_PROFILE_PORTFOLIO";
|
|
82
|
-
BRAND_PROFILE_DETAILS: "BRAND_PROFILE_DETAILS";
|
|
83
|
-
BRAND_PROFILE_CUSTOMIZE_FEED: "BRAND_PROFILE_CUSTOMIZE_FEED";
|
|
84
|
-
BRAND_PROFILE_PORTFOLIO: "BRAND_PROFILE_PORTFOLIO";
|
|
85
|
-
INVESTOR_PROFILE_DETAILS: "INVESTOR_PROFILE_DETAILS";
|
|
86
|
-
INVESTOR_INVESTMENT_FOCUS: "INVESTOR_INVESTMENT_FOCUS";
|
|
87
|
-
INVESTOR_VERIFICATION: "INVESTOR_VERIFICATION";
|
|
88
|
-
DONE: "DONE";
|
|
89
|
-
}>;
|
|
90
|
-
createdAt: z.ZodCoercedDate<unknown>;
|
|
91
|
-
updatedAt: z.ZodCoercedDate<unknown>;
|
|
92
|
-
followerCount: z.ZodOptional<z.ZodNumber>;
|
|
93
|
-
followingCount: z.ZodOptional<z.ZodNumber>;
|
|
52
|
+
export declare const UserStatsEntitySchema: z.ZodObject<{
|
|
53
|
+
followerCount: z.ZodInt;
|
|
54
|
+
followingCount: z.ZodInt;
|
|
55
|
+
followingIds: z.ZodArray<z.ZodString>;
|
|
94
56
|
}, z.core.$strip>;
|
|
95
57
|
export declare const UserProfileEntitySchema: z.ZodObject<{
|
|
96
58
|
id: z.ZodCUID2;
|
|
@@ -128,8 +90,6 @@ export declare const UserProfileEntitySchema: z.ZodObject<{
|
|
|
128
90
|
}>;
|
|
129
91
|
createdAt: z.ZodCoercedDate<unknown>;
|
|
130
92
|
updatedAt: z.ZodCoercedDate<unknown>;
|
|
131
|
-
followerCount: z.ZodOptional<z.ZodNumber>;
|
|
132
|
-
followingCount: z.ZodOptional<z.ZodNumber>;
|
|
133
93
|
profileType: z.ZodOptional<z.ZodEnum<{
|
|
134
94
|
creative: "creative";
|
|
135
95
|
brand: "brand";
|
|
@@ -438,8 +398,6 @@ export declare const GetAuthenticatedUserOutputSchema: z.ZodObject<{
|
|
|
438
398
|
}>;
|
|
439
399
|
createdAt: z.ZodCoercedDate<unknown>;
|
|
440
400
|
updatedAt: z.ZodCoercedDate<unknown>;
|
|
441
|
-
followerCount: z.ZodOptional<z.ZodNumber>;
|
|
442
|
-
followingCount: z.ZodOptional<z.ZodNumber>;
|
|
443
401
|
}, z.core.$strip>;
|
|
444
402
|
export declare const GetAuthenticatedUserProfileOutputSchema: z.ZodObject<{
|
|
445
403
|
id: z.ZodCUID2;
|
|
@@ -477,8 +435,6 @@ export declare const GetAuthenticatedUserProfileOutputSchema: z.ZodObject<{
|
|
|
477
435
|
}>;
|
|
478
436
|
createdAt: z.ZodCoercedDate<unknown>;
|
|
479
437
|
updatedAt: z.ZodCoercedDate<unknown>;
|
|
480
|
-
followerCount: z.ZodOptional<z.ZodNumber>;
|
|
481
|
-
followingCount: z.ZodOptional<z.ZodNumber>;
|
|
482
438
|
profileType: z.ZodOptional<z.ZodEnum<{
|
|
483
439
|
creative: "creative";
|
|
484
440
|
brand: "brand";
|
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.GetUserFollowersOutputSchema = exports.GetUserFollowingOutputSchema = exports.UserWithFollowersEntitySchema = exports.UserWithFollowingEntitySchema = exports.GetUserFollowersInputSchema = exports.GetUserFollowingInputSchema = exports.UserWithProjectBookmarksEntitySchema = exports.UserWithProjectLikesEntitySchema = exports.UserWithProjectsEntitySchema = exports.UserProfileEntitySchema = exports.
|
|
3
|
+
exports.GetUserActivityOutputSchema = exports.GetUserActivityInputSchema = exports.GetAuthenticatedUserWithProjectLikesOutputSchema = exports.GetAuthenticatedUserWithUserFollowersOutputSchema = exports.GetAuthenticatedUserWithUserFollowingOutputSchema = exports.GetAuthenticatedUserWithProjectBookmarksOutputSchema = exports.GetAuthenticatedUserWithProjectsOutputSchema = exports.GetAuthenticatedUserProfileOutputSchema = exports.GetAuthenticatedUserOutputSchema = exports.GetUserFollowersOutputSchema = exports.GetUserFollowingOutputSchema = 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");
|
|
@@ -9,23 +9,7 @@ const like_1 = require("./like");
|
|
|
9
9
|
const brand_1 = require("./brand");
|
|
10
10
|
const creative_1 = require("./creative");
|
|
11
11
|
const investor_1 = require("./investor");
|
|
12
|
-
exports.
|
|
13
|
-
.object({
|
|
14
|
-
followerCount: zod_openapi_1.z
|
|
15
|
-
.number()
|
|
16
|
-
.int()
|
|
17
|
-
.nonnegative()
|
|
18
|
-
.optional()
|
|
19
|
-
.openapi({ example: 120 }),
|
|
20
|
-
followingCount: zod_openapi_1.z
|
|
21
|
-
.number()
|
|
22
|
-
.int()
|
|
23
|
-
.nonnegative()
|
|
24
|
-
.optional()
|
|
25
|
-
.openapi({ example: 45 }),
|
|
26
|
-
})
|
|
27
|
-
.openapi("UserSocialGraphEntity");
|
|
28
|
-
exports.BaseUserEntitySchema = zod_openapi_1.z
|
|
12
|
+
exports.UserEntitySchema = zod_openapi_1.z
|
|
29
13
|
.object({
|
|
30
14
|
id: zod_openapi_1.z.cuid2().openapi({ example: "cksd0v6q0000s9a5y8z7p3x9" }),
|
|
31
15
|
email: zod_openapi_1.z.string().email().openapi({ example: "user@example.com" }),
|
|
@@ -54,7 +38,7 @@ exports.BaseUserEntitySchema = zod_openapi_1.z
|
|
|
54
38
|
updatedAt: zod_openapi_1.z.coerce.date().openapi({ example: "2025-10-13T09:00:00.000Z" }),
|
|
55
39
|
})
|
|
56
40
|
.openapi("BaseUserEntity");
|
|
57
|
-
exports.MinimalUserSchema = exports.
|
|
41
|
+
exports.MinimalUserSchema = exports.UserEntitySchema.pick({
|
|
58
42
|
id: true,
|
|
59
43
|
name: true,
|
|
60
44
|
email: true,
|
|
@@ -62,7 +46,11 @@ exports.MinimalUserSchema = exports.BaseUserEntitySchema.pick({
|
|
|
62
46
|
username: true,
|
|
63
47
|
role: true,
|
|
64
48
|
}).openapi("MinimalUser");
|
|
65
|
-
exports.
|
|
49
|
+
exports.UserStatsEntitySchema = zod_openapi_1.z.object({
|
|
50
|
+
followerCount: zod_openapi_1.z.int(),
|
|
51
|
+
followingCount: zod_openapi_1.z.int(),
|
|
52
|
+
followingIds: zod_openapi_1.z.array(zod_openapi_1.z.string()),
|
|
53
|
+
});
|
|
66
54
|
exports.UserProfileEntitySchema = exports.UserEntitySchema.extend({
|
|
67
55
|
profileType: zod_openapi_1.z.enum(["creative", "brand", "investor"]).optional(),
|
|
68
56
|
brand: brand_1.BrandEntitySchema,
|
package/dist/types/common.d.ts
CHANGED
|
@@ -1,5 +1,4 @@
|
|
|
1
1
|
import z from "zod";
|
|
2
|
-
import { ProjectSocialGraphEntitySchema
|
|
2
|
+
import { ProjectSocialGraphEntitySchema } from "../schemas";
|
|
3
3
|
export type ProjectSocialGraphEntity = z.infer<typeof ProjectSocialGraphEntitySchema>;
|
|
4
4
|
export type PostSocialGraphEntity = z.infer<typeof ProjectSocialGraphEntitySchema>;
|
|
5
|
-
export type UserSocialGraphEntity = z.infer<typeof UserSocialGraphEntitySchema>;
|
package/dist/types/user.d.ts
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { MinimalUserSchema, UserEntitySchema, UserProfileEntitySchema, UserWithProjectsEntitySchema, UserWithProjectBookmarksEntitySchema, GetUserFollowingInputSchema, GetUserFollowersInputSchema, UserWithFollowingEntitySchema, UserWithFollowersEntitySchema, GetUserFollowingOutputSchema, GetUserFollowersOutputSchema, GetAuthenticatedUserOutputSchema, GetAuthenticatedUserProfileOutputSchema, GetAuthenticatedUserWithProjectsOutputSchema, GetAuthenticatedUserWithProjectBookmarksOutputSchema, GetAuthenticatedUserWithUserFollowingOutputSchema, GetAuthenticatedUserWithUserFollowersOutputSchema, UserWithProjectLikesEntitySchema, GetAuthenticatedUserWithProjectLikesOutputSchema, GetUserActivityInputSchema, GetUserActivityOutputSchema, UserStatsEntitySchema } from "../schemas/user";
|
|
2
2
|
import { z } from "@hono/zod-openapi";
|
|
3
|
-
export type BaseUserEntity = z.infer<typeof
|
|
3
|
+
export type BaseUserEntity = z.infer<typeof UserEntitySchema>;
|
|
4
4
|
export type MinimalUser = z.infer<typeof MinimalUserSchema>;
|
|
5
5
|
export type UserEntity = z.infer<typeof UserEntitySchema>;
|
|
6
6
|
export type UserProfileEntity = z.infer<typeof UserProfileEntitySchema>;
|
|
@@ -22,3 +22,4 @@ export type GetAuthenticatedUserWithUserFollowingOutput = z.infer<typeof GetAuth
|
|
|
22
22
|
export type GetAuthenticatedUserWithUserFollowersOutput = z.infer<typeof GetAuthenticatedUserWithUserFollowersOutputSchema>;
|
|
23
23
|
export type GetUserActivityInput = z.infer<typeof GetUserActivityInputSchema>;
|
|
24
24
|
export type GetUserActivityOutput = z.infer<typeof GetUserActivityOutputSchema>;
|
|
25
|
+
export type UserStatsEntity = z.infer<typeof UserStatsEntitySchema>;
|
package/package.json
CHANGED
package/src/schemas/post.ts
CHANGED
|
@@ -15,7 +15,14 @@ export const PostEntitySchema = z.object({
|
|
|
15
15
|
.optional()
|
|
16
16
|
.openapi({ description: "Parent id", example: "ckj1a2b3c0000abc" }),
|
|
17
17
|
|
|
18
|
-
tags: z
|
|
18
|
+
tags: z
|
|
19
|
+
.array(
|
|
20
|
+
z.object({
|
|
21
|
+
name: z.string(),
|
|
22
|
+
id: z.int(),
|
|
23
|
+
})
|
|
24
|
+
)
|
|
25
|
+
.optional(),
|
|
19
26
|
badge: z.enum(POST_BADGE_TYPES).optional(),
|
|
20
27
|
userId: z
|
|
21
28
|
.cuid2()
|
|
@@ -171,7 +178,7 @@ export const FeedPostEntitySchema = PostWithFilesEntitySchema.extend({
|
|
|
171
178
|
score: z.number(),
|
|
172
179
|
isLiked: z.boolean().optional(),
|
|
173
180
|
isFollowing: z.boolean().optional(),
|
|
174
|
-
isBookmarked: z.boolean().optional()
|
|
181
|
+
isBookmarked: z.boolean().optional(),
|
|
175
182
|
});
|
|
176
183
|
|
|
177
184
|
export const GetFeedInputSchema = z.object({
|
|
@@ -179,4 +186,4 @@ export const GetFeedInputSchema = z.object({
|
|
|
179
186
|
cursor: z.string().optional(),
|
|
180
187
|
});
|
|
181
188
|
|
|
182
|
-
export const GetFeedOutputSchema = z.array(FeedPostEntitySchema)
|
|
189
|
+
export const GetFeedOutputSchema = z.array(FeedPostEntitySchema);
|
package/src/schemas/user.ts
CHANGED
|
@@ -21,24 +21,7 @@ import { BrandEntitySchema } from "./brand";
|
|
|
21
21
|
import { CreativeEntitySchema } from "./creative";
|
|
22
22
|
import { InvestorEntitySchema } from "./investor";
|
|
23
23
|
|
|
24
|
-
export const
|
|
25
|
-
.object({
|
|
26
|
-
followerCount: z
|
|
27
|
-
.number()
|
|
28
|
-
.int()
|
|
29
|
-
.nonnegative()
|
|
30
|
-
.optional()
|
|
31
|
-
.openapi({ example: 120 }),
|
|
32
|
-
followingCount: z
|
|
33
|
-
.number()
|
|
34
|
-
.int()
|
|
35
|
-
.nonnegative()
|
|
36
|
-
.optional()
|
|
37
|
-
.openapi({ example: 45 }),
|
|
38
|
-
})
|
|
39
|
-
.openapi("UserSocialGraphEntity");
|
|
40
|
-
|
|
41
|
-
export const BaseUserEntitySchema = z
|
|
24
|
+
export const UserEntitySchema = z
|
|
42
25
|
.object({
|
|
43
26
|
id: z.cuid2().openapi({ example: "cksd0v6q0000s9a5y8z7p3x9" }),
|
|
44
27
|
email: z.string().email().openapi({ example: "user@example.com" }),
|
|
@@ -70,7 +53,7 @@ export const BaseUserEntitySchema = z
|
|
|
70
53
|
})
|
|
71
54
|
.openapi("BaseUserEntity");
|
|
72
55
|
|
|
73
|
-
export const MinimalUserSchema =
|
|
56
|
+
export const MinimalUserSchema = UserEntitySchema.pick({
|
|
74
57
|
id: true,
|
|
75
58
|
name: true,
|
|
76
59
|
email: true,
|
|
@@ -79,9 +62,11 @@ export const MinimalUserSchema = BaseUserEntitySchema.pick({
|
|
|
79
62
|
role: true,
|
|
80
63
|
}).openapi("MinimalUser");
|
|
81
64
|
|
|
82
|
-
export const
|
|
83
|
-
|
|
84
|
-
|
|
65
|
+
export const UserStatsEntitySchema = z.object({
|
|
66
|
+
followerCount: z.int(),
|
|
67
|
+
followingCount: z.int(),
|
|
68
|
+
followingIds: z.array(z.string()),
|
|
69
|
+
});
|
|
85
70
|
|
|
86
71
|
export const UserProfileEntitySchema = UserEntitySchema.extend({
|
|
87
72
|
profileType: z.enum(["creative", "brand", "investor"]).optional(),
|
package/src/types/common.ts
CHANGED
|
@@ -1,8 +1,5 @@
|
|
|
1
1
|
import z from "zod";
|
|
2
|
-
import {
|
|
3
|
-
ProjectSocialGraphEntitySchema,
|
|
4
|
-
UserSocialGraphEntitySchema,
|
|
5
|
-
} from "../schemas";
|
|
2
|
+
import { ProjectSocialGraphEntitySchema } from "../schemas";
|
|
6
3
|
|
|
7
4
|
export type ProjectSocialGraphEntity = z.infer<
|
|
8
5
|
typeof ProjectSocialGraphEntitySchema
|
|
@@ -10,4 +7,3 @@ export type ProjectSocialGraphEntity = z.infer<
|
|
|
10
7
|
export type PostSocialGraphEntity = z.infer<
|
|
11
8
|
typeof ProjectSocialGraphEntitySchema
|
|
12
9
|
>;
|
|
13
|
-
export type UserSocialGraphEntity = z.infer<typeof UserSocialGraphEntitySchema>;
|
package/src/types/user.ts
CHANGED
|
@@ -1,5 +1,4 @@
|
|
|
1
1
|
import {
|
|
2
|
-
BaseUserEntitySchema,
|
|
3
2
|
MinimalUserSchema,
|
|
4
3
|
UserEntitySchema,
|
|
5
4
|
UserProfileEntitySchema,
|
|
@@ -21,11 +20,12 @@ import {
|
|
|
21
20
|
GetAuthenticatedUserWithProjectLikesOutputSchema,
|
|
22
21
|
GetUserActivityInputSchema,
|
|
23
22
|
GetUserActivityOutputSchema,
|
|
23
|
+
UserStatsEntitySchema,
|
|
24
24
|
} from "../schemas/user";
|
|
25
25
|
|
|
26
26
|
import { z } from "@hono/zod-openapi";
|
|
27
27
|
|
|
28
|
-
export type BaseUserEntity = z.infer<typeof
|
|
28
|
+
export type BaseUserEntity = z.infer<typeof UserEntitySchema>;
|
|
29
29
|
export type MinimalUser = z.infer<typeof MinimalUserSchema>;
|
|
30
30
|
export type UserEntity = z.infer<typeof UserEntitySchema>;
|
|
31
31
|
export type UserProfileEntity = z.infer<typeof UserProfileEntitySchema>;
|
|
@@ -76,3 +76,4 @@ export type GetAuthenticatedUserWithUserFollowersOutput = z.infer<
|
|
|
76
76
|
|
|
77
77
|
export type GetUserActivityInput = z.infer<typeof GetUserActivityInputSchema>;
|
|
78
78
|
export type GetUserActivityOutput = z.infer<typeof GetUserActivityOutputSchema>;
|
|
79
|
+
export type UserStatsEntity = z.infer<typeof UserStatsEntitySchema>;
|