@zyacreatives/shared 1.2.2 → 1.2.4
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/common.d.ts +0 -10
- package/dist/schemas/common.js +1 -45
- package/dist/schemas/index.d.ts +2 -0
- package/dist/schemas/index.js +2 -0
- package/dist/schemas/project.d.ts +0 -4
- package/dist/schemas/project.js +2 -8
- package/dist/schemas/user.d.ts +4 -0
- package/dist/schemas/user.js +18 -3
- package/dist/types/common.d.ts +4 -10
- package/package.json +1 -1
- package/src/schemas/common.ts +0 -45
- package/src/schemas/index.ts +2 -0
- package/src/schemas/project.ts +2 -9
- package/src/schemas/user.ts +19 -3
- package/src/types/common.ts +9 -10
package/dist/schemas/common.d.ts
CHANGED
|
@@ -21,13 +21,3 @@ export declare const ProjectIdentifierSchema: z.ZodObject<{
|
|
|
21
21
|
}>>>;
|
|
22
22
|
}, z.core.$strip>;
|
|
23
23
|
export type ProjectIdentifier = z.infer<typeof ProjectIdentifierSchema>;
|
|
24
|
-
export declare const ProjectSocialGraphEntitySchema: z.ZodObject<{
|
|
25
|
-
noOfLikes: z.ZodOptional<z.ZodNumber>;
|
|
26
|
-
noOfComments: z.ZodOptional<z.ZodNumber>;
|
|
27
|
-
noOfBookmarks: z.ZodOptional<z.ZodNumber>;
|
|
28
|
-
noOfViews: z.ZodOptional<z.ZodNumber>;
|
|
29
|
-
}, z.core.$strip>;
|
|
30
|
-
export declare const UserSocialGraphEntitySchema: z.ZodObject<{
|
|
31
|
-
followerCount: z.ZodOptional<z.ZodNumber>;
|
|
32
|
-
followingCount: z.ZodOptional<z.ZodNumber>;
|
|
33
|
-
}, z.core.$strip>;
|
package/dist/schemas/common.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.
|
|
3
|
+
exports.ProjectIdentifierSchema = exports.ProfileIdentifierSchema = exports.UserIdentifierSchema = exports.CuidSchema = void 0;
|
|
4
4
|
const zod_openapi_1 = require("@hono/zod-openapi");
|
|
5
5
|
exports.CuidSchema = zod_openapi_1.z.cuid2({ error: "Invalid CUID2 is written." });
|
|
6
6
|
exports.UserIdentifierSchema = zod_openapi_1.z.object({
|
|
@@ -12,47 +12,3 @@ exports.ProfileIdentifierSchema = zod_openapi_1.z.object({
|
|
|
12
12
|
exports.ProjectIdentifierSchema = zod_openapi_1.z.object({
|
|
13
13
|
by: zod_openapi_1.z.enum(["id", "userId"]).optional().default("id"),
|
|
14
14
|
});
|
|
15
|
-
exports.ProjectSocialGraphEntitySchema = zod_openapi_1.z
|
|
16
|
-
.object({
|
|
17
|
-
noOfLikes: zod_openapi_1.z
|
|
18
|
-
.number()
|
|
19
|
-
.int()
|
|
20
|
-
.nonnegative()
|
|
21
|
-
.optional()
|
|
22
|
-
.openapi({ example: 350 }),
|
|
23
|
-
noOfComments: zod_openapi_1.z
|
|
24
|
-
.number()
|
|
25
|
-
.int()
|
|
26
|
-
.nonnegative()
|
|
27
|
-
.optional()
|
|
28
|
-
.openapi({ example: 78 }),
|
|
29
|
-
noOfBookmarks: zod_openapi_1.z
|
|
30
|
-
.number()
|
|
31
|
-
.int()
|
|
32
|
-
.nonnegative()
|
|
33
|
-
.optional()
|
|
34
|
-
.openapi({ example: 25 }),
|
|
35
|
-
noOfViews: zod_openapi_1.z
|
|
36
|
-
.number()
|
|
37
|
-
.int()
|
|
38
|
-
.nonnegative()
|
|
39
|
-
.optional()
|
|
40
|
-
.openapi({ example: 1024 }),
|
|
41
|
-
})
|
|
42
|
-
.openapi("ProjectSocialGraphEntity");
|
|
43
|
-
exports.UserSocialGraphEntitySchema = zod_openapi_1.z
|
|
44
|
-
.object({
|
|
45
|
-
followerCount: zod_openapi_1.z
|
|
46
|
-
.number()
|
|
47
|
-
.int()
|
|
48
|
-
.nonnegative()
|
|
49
|
-
.optional()
|
|
50
|
-
.openapi({ example: 120 }),
|
|
51
|
-
followingCount: zod_openapi_1.z
|
|
52
|
-
.number()
|
|
53
|
-
.int()
|
|
54
|
-
.nonnegative()
|
|
55
|
-
.optional()
|
|
56
|
-
.openapi({ example: 45 }),
|
|
57
|
-
})
|
|
58
|
-
.openapi("UserSocialGraphEntity");
|
package/dist/schemas/index.d.ts
CHANGED
package/dist/schemas/index.js
CHANGED
|
@@ -18,3 +18,5 @@ __exportStar(require("./brand"), exports);
|
|
|
18
18
|
__exportStar(require("./common"), exports);
|
|
19
19
|
__exportStar(require("./creative"), exports);
|
|
20
20
|
__exportStar(require("./user"), exports);
|
|
21
|
+
__exportStar(require("./project"), exports);
|
|
22
|
+
__exportStar(require("./investor"), exports);
|
|
@@ -40,10 +40,6 @@ export declare const ProjectSocialGraphEntitySchema: z.ZodObject<{
|
|
|
40
40
|
noOfBookmarks: z.ZodOptional<z.ZodNumber>;
|
|
41
41
|
noOfViews: z.ZodOptional<z.ZodNumber>;
|
|
42
42
|
}, z.core.$strip>;
|
|
43
|
-
export declare const UserSocialGraphEntitySchema: z.ZodObject<{
|
|
44
|
-
followerCount: z.ZodOptional<z.ZodNumber>;
|
|
45
|
-
followingCount: z.ZodOptional<z.ZodNumber>;
|
|
46
|
-
}, z.core.$strip>;
|
|
47
43
|
export declare const ProjectWithFilesEntitySchema: z.ZodObject<{
|
|
48
44
|
id: z.ZodCUID2;
|
|
49
45
|
createdAt: z.ZodOptional<z.ZodCoercedDate<unknown>>;
|
package/dist/schemas/project.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.ProjectUpdateOutputEntitySchema = exports.ProjectBookmarkEntitySchema = exports.ProjectCommentEntitySchema = exports.ProjectLikeEntitySchema = exports.ProjectViewEntitySchema = exports.ProjectWithFilesEntitySchema = exports.
|
|
3
|
+
exports.ProjectUpdateOutputEntitySchema = exports.ProjectBookmarkEntitySchema = exports.ProjectCommentEntitySchema = exports.ProjectLikeEntitySchema = exports.ProjectViewEntitySchema = exports.ProjectWithFilesEntitySchema = exports.ProjectSocialGraphEntitySchema = exports.ProjectFileEntitySchema = exports.ProjectEntitySchema = void 0;
|
|
4
4
|
const zod_openapi_1 = require("@hono/zod-openapi");
|
|
5
5
|
const constants_1 = require("../constants");
|
|
6
6
|
exports.ProjectEntitySchema = zod_openapi_1.z
|
|
@@ -78,13 +78,7 @@ exports.ProjectSocialGraphEntitySchema = zod_openapi_1.z
|
|
|
78
78
|
noOfViews: zod_openapi_1.z.number().int().optional().openapi({ example: 1200 }),
|
|
79
79
|
})
|
|
80
80
|
.openapi("ProjectSocialGraphEntity");
|
|
81
|
-
exports.
|
|
82
|
-
.object({
|
|
83
|
-
followerCount: zod_openapi_1.z.number().int().optional().openapi({ example: 5000 }),
|
|
84
|
-
followingCount: zod_openapi_1.z.number().int().optional().openapi({ example: 150 }),
|
|
85
|
-
})
|
|
86
|
-
.openapi("UserSocialGraphEntity");
|
|
87
|
-
exports.ProjectWithFilesEntitySchema = exports.ProjectEntitySchema.merge(exports.ProjectSocialGraphEntitySchema)
|
|
81
|
+
exports.ProjectWithFilesEntitySchema = exports.ProjectEntitySchema.extend(exports.ProjectSocialGraphEntitySchema.shape)
|
|
88
82
|
.extend({
|
|
89
83
|
projectFiles: zod_openapi_1.z
|
|
90
84
|
.array(exports.ProjectFileEntitySchema)
|
package/dist/schemas/user.d.ts
CHANGED
|
@@ -1,4 +1,8 @@
|
|
|
1
1
|
import { z } from "@hono/zod-openapi";
|
|
2
|
+
export declare const UserSocialGraphEntitySchema: z.ZodObject<{
|
|
3
|
+
followerCount: z.ZodOptional<z.ZodNumber>;
|
|
4
|
+
followingCount: z.ZodOptional<z.ZodNumber>;
|
|
5
|
+
}, z.core.$strip>;
|
|
2
6
|
export declare const BaseUserEntitySchema: z.ZodObject<{
|
|
3
7
|
id: z.ZodCUID2;
|
|
4
8
|
email: z.ZodString;
|
package/dist/schemas/user.js
CHANGED
|
@@ -1,10 +1,25 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.UserWithFollowersEntitySchema = exports.UserWithFollowingEntitySchema = exports.UserWithProjectBookmarksEntitySchema = exports.UserWithProjectsEntitySchema = exports.UserProfileEntitySchema = exports.UserEntitySchema = exports.MinimalUserSchema = exports.BaseUserEntitySchema = void 0;
|
|
3
|
+
exports.UserWithFollowersEntitySchema = exports.UserWithFollowingEntitySchema = exports.UserWithProjectBookmarksEntitySchema = exports.UserWithProjectsEntitySchema = exports.UserProfileEntitySchema = exports.UserEntitySchema = exports.MinimalUserSchema = exports.BaseUserEntitySchema = exports.UserSocialGraphEntitySchema = void 0;
|
|
4
4
|
const zod_openapi_1 = require("@hono/zod-openapi");
|
|
5
5
|
const constants_1 = require("../constants");
|
|
6
|
-
const common_1 = require("./common");
|
|
7
6
|
const project_1 = require("./project");
|
|
7
|
+
exports.UserSocialGraphEntitySchema = zod_openapi_1.z
|
|
8
|
+
.object({
|
|
9
|
+
followerCount: zod_openapi_1.z
|
|
10
|
+
.number()
|
|
11
|
+
.int()
|
|
12
|
+
.nonnegative()
|
|
13
|
+
.optional()
|
|
14
|
+
.openapi({ example: 120 }),
|
|
15
|
+
followingCount: zod_openapi_1.z
|
|
16
|
+
.number()
|
|
17
|
+
.int()
|
|
18
|
+
.nonnegative()
|
|
19
|
+
.optional()
|
|
20
|
+
.openapi({ example: 45 }),
|
|
21
|
+
})
|
|
22
|
+
.openapi("UserSocialGraphEntity");
|
|
8
23
|
exports.BaseUserEntitySchema = zod_openapi_1.z
|
|
9
24
|
.object({
|
|
10
25
|
id: zod_openapi_1.z.cuid2().openapi({ example: "cksd0v6q0000s9a5y8z7p3x9" }),
|
|
@@ -42,7 +57,7 @@ exports.MinimalUserSchema = exports.BaseUserEntitySchema.pick({
|
|
|
42
57
|
username: true,
|
|
43
58
|
role: true,
|
|
44
59
|
}).openapi("MinimalUser");
|
|
45
|
-
exports.UserEntitySchema = exports.BaseUserEntitySchema.
|
|
60
|
+
exports.UserEntitySchema = exports.BaseUserEntitySchema.extend(exports.UserSocialGraphEntitySchema.shape).openapi("UserEntity");
|
|
46
61
|
exports.UserProfileEntitySchema = exports.UserEntitySchema.extend({
|
|
47
62
|
profileType: zod_openapi_1.z.enum(["creative", "brand", "investor"]).optional(),
|
|
48
63
|
bio: zod_openapi_1.z.string().optional(),
|
package/dist/types/common.d.ts
CHANGED
|
@@ -1,10 +1,4 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
noOfViews?: number;
|
|
6
|
-
};
|
|
7
|
-
export type UserSocialGraphEntity = {
|
|
8
|
-
followerCount?: number;
|
|
9
|
-
followingCount?: number;
|
|
10
|
-
};
|
|
1
|
+
import z from "zod";
|
|
2
|
+
import { ProjectSocialGraphEntitySchema, UserSocialGraphEntitySchema } from "../schemas";
|
|
3
|
+
export type ProjectSocialGraphEntity = z.infer<typeof ProjectSocialGraphEntitySchema>;
|
|
4
|
+
export type UserSocialGraphEntity = z.infer<typeof UserSocialGraphEntitySchema>;
|
package/package.json
CHANGED
package/src/schemas/common.ts
CHANGED
|
@@ -20,48 +20,3 @@ export const ProjectIdentifierSchema = z.object({
|
|
|
20
20
|
|
|
21
21
|
export type ProjectIdentifier = z.infer<typeof ProjectIdentifierSchema>;
|
|
22
22
|
|
|
23
|
-
export const ProjectSocialGraphEntitySchema = z
|
|
24
|
-
.object({
|
|
25
|
-
noOfLikes: z
|
|
26
|
-
.number()
|
|
27
|
-
.int()
|
|
28
|
-
.nonnegative()
|
|
29
|
-
.optional()
|
|
30
|
-
.openapi({ example: 350 }),
|
|
31
|
-
noOfComments: z
|
|
32
|
-
.number()
|
|
33
|
-
.int()
|
|
34
|
-
.nonnegative()
|
|
35
|
-
.optional()
|
|
36
|
-
.openapi({ example: 78 }),
|
|
37
|
-
noOfBookmarks: z
|
|
38
|
-
.number()
|
|
39
|
-
.int()
|
|
40
|
-
.nonnegative()
|
|
41
|
-
.optional()
|
|
42
|
-
.openapi({ example: 25 }),
|
|
43
|
-
noOfViews: z
|
|
44
|
-
.number()
|
|
45
|
-
.int()
|
|
46
|
-
.nonnegative()
|
|
47
|
-
.optional()
|
|
48
|
-
.openapi({ example: 1024 }),
|
|
49
|
-
})
|
|
50
|
-
.openapi("ProjectSocialGraphEntity");
|
|
51
|
-
|
|
52
|
-
export const UserSocialGraphEntitySchema = z
|
|
53
|
-
.object({
|
|
54
|
-
followerCount: z
|
|
55
|
-
.number()
|
|
56
|
-
.int()
|
|
57
|
-
.nonnegative()
|
|
58
|
-
.optional()
|
|
59
|
-
.openapi({ example: 120 }),
|
|
60
|
-
followingCount: z
|
|
61
|
-
.number()
|
|
62
|
-
.int()
|
|
63
|
-
.nonnegative()
|
|
64
|
-
.optional()
|
|
65
|
-
.openapi({ example: 45 }),
|
|
66
|
-
})
|
|
67
|
-
.openapi("UserSocialGraphEntity");
|
package/src/schemas/index.ts
CHANGED
package/src/schemas/project.ts
CHANGED
|
@@ -79,15 +79,8 @@ export const ProjectSocialGraphEntitySchema = z
|
|
|
79
79
|
})
|
|
80
80
|
.openapi("ProjectSocialGraphEntity");
|
|
81
81
|
|
|
82
|
-
export const
|
|
83
|
-
.
|
|
84
|
-
followerCount: z.number().int().optional().openapi({ example: 5000 }),
|
|
85
|
-
followingCount: z.number().int().optional().openapi({ example: 150 }),
|
|
86
|
-
})
|
|
87
|
-
.openapi("UserSocialGraphEntity");
|
|
88
|
-
|
|
89
|
-
export const ProjectWithFilesEntitySchema = ProjectEntitySchema.merge(
|
|
90
|
-
ProjectSocialGraphEntitySchema
|
|
82
|
+
export const ProjectWithFilesEntitySchema = ProjectEntitySchema.extend(
|
|
83
|
+
ProjectSocialGraphEntitySchema.shape
|
|
91
84
|
)
|
|
92
85
|
.extend({
|
|
93
86
|
projectFiles: z
|
package/src/schemas/user.ts
CHANGED
|
@@ -2,9 +2,25 @@ import { z } from "@hono/zod-openapi";
|
|
|
2
2
|
|
|
3
3
|
import { ROLES, USER_STATUSES, ONBOARDING_PAGES } from "../constants";
|
|
4
4
|
import type { Role, UserStatus, OnboardingPage } from "../constants";
|
|
5
|
-
import { UserSocialGraphEntitySchema } from "./common";
|
|
6
5
|
import { ProjectBookmarkEntitySchema, ProjectEntitySchema } from "./project";
|
|
7
6
|
|
|
7
|
+
export const UserSocialGraphEntitySchema = z
|
|
8
|
+
.object({
|
|
9
|
+
followerCount: z
|
|
10
|
+
.number()
|
|
11
|
+
.int()
|
|
12
|
+
.nonnegative()
|
|
13
|
+
.optional()
|
|
14
|
+
.openapi({ example: 120 }),
|
|
15
|
+
followingCount: z
|
|
16
|
+
.number()
|
|
17
|
+
.int()
|
|
18
|
+
.nonnegative()
|
|
19
|
+
.optional()
|
|
20
|
+
.openapi({ example: 45 }),
|
|
21
|
+
})
|
|
22
|
+
.openapi("UserSocialGraphEntity");
|
|
23
|
+
|
|
8
24
|
export const BaseUserEntitySchema = z
|
|
9
25
|
.object({
|
|
10
26
|
id: z.cuid2().openapi({ example: "cksd0v6q0000s9a5y8z7p3x9" }),
|
|
@@ -46,8 +62,8 @@ export const MinimalUserSchema = BaseUserEntitySchema.pick({
|
|
|
46
62
|
role: true,
|
|
47
63
|
}).openapi("MinimalUser");
|
|
48
64
|
|
|
49
|
-
export const UserEntitySchema = BaseUserEntitySchema.
|
|
50
|
-
UserSocialGraphEntitySchema
|
|
65
|
+
export const UserEntitySchema = BaseUserEntitySchema.extend(
|
|
66
|
+
UserSocialGraphEntitySchema.shape
|
|
51
67
|
).openapi("UserEntity");
|
|
52
68
|
|
|
53
69
|
export const UserProfileEntitySchema = UserEntitySchema.extend({
|
package/src/types/common.ts
CHANGED
|
@@ -1,11 +1,10 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
};
|
|
1
|
+
import z from "zod";
|
|
2
|
+
import {
|
|
3
|
+
ProjectSocialGraphEntitySchema,
|
|
4
|
+
UserSocialGraphEntitySchema,
|
|
5
|
+
} from "../schemas";
|
|
7
6
|
|
|
8
|
-
export type
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
7
|
+
export type ProjectSocialGraphEntity = z.infer<
|
|
8
|
+
typeof ProjectSocialGraphEntitySchema
|
|
9
|
+
>;
|
|
10
|
+
export type UserSocialGraphEntity = z.infer<typeof UserSocialGraphEntitySchema>;
|