@zyacreatives/shared 2.0.51 → 2.0.52
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/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/user.ts +7 -22
- package/src/types/common.ts +1 -5
- package/src/types/user.ts +3 -2
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/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>;
|