@zyacreatives/shared 2.1.76 → 2.1.77
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.js +0 -1
- package/dist/schemas/user.d.ts +58 -0
- package/dist/schemas/user.js +30 -1
- package/dist/types/user.d.ts +3 -1
- package/package.json +1 -1
- package/src/schemas/post.ts +0 -1
- package/src/schemas/user.ts +36 -1
- package/src/types/user.ts +10 -0
package/dist/schemas/post.js
CHANGED
|
@@ -152,7 +152,6 @@ exports.CreatePostOutputSchema = exports.PostEntitySchema;
|
|
|
152
152
|
exports.GetPostOutputSchema = exports.PostWithFilesEntitySchema;
|
|
153
153
|
exports.PostIdSchema = zod_openapi_1.z.object({ postId: zod_openapi_1.z.cuid2() });
|
|
154
154
|
exports.MinimalPostSchema = exports.PostEntitySchema.pick({
|
|
155
|
-
title: true,
|
|
156
155
|
id: true,
|
|
157
156
|
parentId: true,
|
|
158
157
|
content: true,
|
package/dist/schemas/user.d.ts
CHANGED
|
@@ -30,6 +30,7 @@ export declare const UserEntitySchema: z.ZodObject<{
|
|
|
30
30
|
DONE: "DONE";
|
|
31
31
|
}>;
|
|
32
32
|
createdAt: z.ZodCoercedDate<unknown>;
|
|
33
|
+
version: z.ZodInt;
|
|
33
34
|
updatedAt: z.ZodCoercedDate<unknown>;
|
|
34
35
|
}, z.core.$strip>;
|
|
35
36
|
export declare const MinimalUserSchema: z.ZodObject<{
|
|
@@ -81,6 +82,7 @@ export declare const UserProfileEntitySchema: z.ZodObject<{
|
|
|
81
82
|
DONE: "DONE";
|
|
82
83
|
}>;
|
|
83
84
|
createdAt: z.ZodCoercedDate<unknown>;
|
|
85
|
+
version: z.ZodInt;
|
|
84
86
|
updatedAt: z.ZodCoercedDate<unknown>;
|
|
85
87
|
profileType: z.ZodOptional<z.ZodEnum<{
|
|
86
88
|
creative: "creative";
|
|
@@ -258,6 +260,60 @@ export declare const UserWithProjectLikesEntitySchema: z.ZodObject<{
|
|
|
258
260
|
}, z.core.$strip>;
|
|
259
261
|
}, z.core.$strip>>;
|
|
260
262
|
}, z.core.$strip>;
|
|
263
|
+
export declare const UserWithPostLikesEntitySchema: z.ZodObject<{
|
|
264
|
+
userId: z.ZodCUID2;
|
|
265
|
+
postLikes: z.ZodArray<z.ZodObject<{
|
|
266
|
+
id: z.ZodCUID2;
|
|
267
|
+
createdAt: z.ZodOptional<z.ZodCoercedDate<unknown>>;
|
|
268
|
+
userId: z.ZodCUID2;
|
|
269
|
+
parentId: z.ZodCUID2;
|
|
270
|
+
parentType: z.ZodEnum<{
|
|
271
|
+
readonly PROJECT: "PROJECT";
|
|
272
|
+
readonly USER: "USER";
|
|
273
|
+
readonly JOB: "JOB";
|
|
274
|
+
readonly POST: "POST";
|
|
275
|
+
readonly COMMENT: "COMMENT";
|
|
276
|
+
readonly JOB_APPLICATION: "JOB_APPLICATION";
|
|
277
|
+
}>;
|
|
278
|
+
post: z.ZodObject<{
|
|
279
|
+
id: z.ZodCUID2;
|
|
280
|
+
createdAt: z.ZodOptional<z.ZodCoercedDate<unknown>>;
|
|
281
|
+
parentId: z.ZodOptional<z.ZodCUID2>;
|
|
282
|
+
content: z.ZodOptional<z.ZodString>;
|
|
283
|
+
tags: z.ZodOptional<z.ZodArray<z.ZodObject<{
|
|
284
|
+
name: z.ZodString;
|
|
285
|
+
id: z.ZodInt;
|
|
286
|
+
}, z.core.$strip>>>;
|
|
287
|
+
}, z.core.$strip>;
|
|
288
|
+
}, z.core.$strip>>;
|
|
289
|
+
}, z.core.$strip>;
|
|
290
|
+
export declare const UserWithPostBookmarksEntitySchema: z.ZodObject<{
|
|
291
|
+
userId: z.ZodCUID2;
|
|
292
|
+
postBookmarks: z.ZodArray<z.ZodObject<{
|
|
293
|
+
id: z.ZodCUID2;
|
|
294
|
+
createdAt: z.ZodOptional<z.ZodCoercedDate<unknown>>;
|
|
295
|
+
userId: z.ZodCUID2;
|
|
296
|
+
parentId: z.ZodCUID2;
|
|
297
|
+
parentType: z.ZodEnum<{
|
|
298
|
+
readonly PROJECT: "PROJECT";
|
|
299
|
+
readonly USER: "USER";
|
|
300
|
+
readonly JOB: "JOB";
|
|
301
|
+
readonly POST: "POST";
|
|
302
|
+
readonly COMMENT: "COMMENT";
|
|
303
|
+
readonly JOB_APPLICATION: "JOB_APPLICATION";
|
|
304
|
+
}>;
|
|
305
|
+
post: z.ZodObject<{
|
|
306
|
+
id: z.ZodCUID2;
|
|
307
|
+
createdAt: z.ZodOptional<z.ZodCoercedDate<unknown>>;
|
|
308
|
+
parentId: z.ZodOptional<z.ZodCUID2>;
|
|
309
|
+
content: z.ZodOptional<z.ZodString>;
|
|
310
|
+
tags: z.ZodOptional<z.ZodArray<z.ZodObject<{
|
|
311
|
+
name: z.ZodString;
|
|
312
|
+
id: z.ZodInt;
|
|
313
|
+
}, z.core.$strip>>>;
|
|
314
|
+
}, z.core.$strip>;
|
|
315
|
+
}, z.core.$strip>>;
|
|
316
|
+
}, z.core.$strip>;
|
|
261
317
|
export declare const UserWithProjectBookmarksEntitySchema: z.ZodObject<{
|
|
262
318
|
userId: z.ZodCUID2;
|
|
263
319
|
projectBookmarks: z.ZodArray<z.ZodObject<{
|
|
@@ -472,6 +528,7 @@ export declare const GetAuthenticatedUserOutputSchema: z.ZodObject<{
|
|
|
472
528
|
DONE: "DONE";
|
|
473
529
|
}>;
|
|
474
530
|
createdAt: z.ZodCoercedDate<unknown>;
|
|
531
|
+
version: z.ZodInt;
|
|
475
532
|
updatedAt: z.ZodCoercedDate<unknown>;
|
|
476
533
|
}, z.core.$strip>;
|
|
477
534
|
export declare const GetAuthenticatedUserProfileOutputSchema: z.ZodObject<{
|
|
@@ -505,6 +562,7 @@ export declare const GetAuthenticatedUserProfileOutputSchema: z.ZodObject<{
|
|
|
505
562
|
DONE: "DONE";
|
|
506
563
|
}>;
|
|
507
564
|
createdAt: z.ZodCoercedDate<unknown>;
|
|
565
|
+
version: z.ZodInt;
|
|
508
566
|
updatedAt: z.ZodCoercedDate<unknown>;
|
|
509
567
|
profileType: z.ZodOptional<z.ZodEnum<{
|
|
510
568
|
creative: "creative";
|
package/dist/schemas/user.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.SearchUsersOutputSchema = 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;
|
|
3
|
+
exports.SearchUsersOutputSchema = 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.UserWithPostBookmarksEntitySchema = exports.UserWithPostLikesEntitySchema = 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");
|
|
@@ -38,6 +38,7 @@ exports.UserEntitySchema = zod_openapi_1.z
|
|
|
38
38
|
createdAt: zod_openapi_1.z.coerce
|
|
39
39
|
.date()
|
|
40
40
|
.openapi({ example: "2025-10-13T09:00:00.000Z" }),
|
|
41
|
+
version: zod_openapi_1.z.int(),
|
|
41
42
|
updatedAt: zod_openapi_1.z.coerce
|
|
42
43
|
.date()
|
|
43
44
|
.openapi({ example: "2025-10-13T09:00:00.000Z" }),
|
|
@@ -82,6 +83,34 @@ exports.UserWithProjectLikesEntitySchema = zod_openapi_1.z.object({
|
|
|
82
83
|
}),
|
|
83
84
|
})),
|
|
84
85
|
});
|
|
86
|
+
exports.UserWithPostLikesEntitySchema = zod_openapi_1.z.object({
|
|
87
|
+
userId: zod_openapi_1.z.cuid2(),
|
|
88
|
+
postLikes: zod_openapi_1.z.array(like_1.LikeEntitySchema.extend({
|
|
89
|
+
post: post_1.PostEntitySchema.pick({
|
|
90
|
+
id: true,
|
|
91
|
+
parentId: true,
|
|
92
|
+
title: true,
|
|
93
|
+
content: true,
|
|
94
|
+
tags: true,
|
|
95
|
+
createdAt: true,
|
|
96
|
+
updatedAt: true,
|
|
97
|
+
}),
|
|
98
|
+
})),
|
|
99
|
+
});
|
|
100
|
+
exports.UserWithPostBookmarksEntitySchema = zod_openapi_1.z.object({
|
|
101
|
+
userId: zod_openapi_1.z.cuid2(),
|
|
102
|
+
postBookmarks: zod_openapi_1.z.array(bookmark_1.BookmarkEntitySchema.extend({
|
|
103
|
+
post: post_1.PostEntitySchema.pick({
|
|
104
|
+
id: true,
|
|
105
|
+
parentId: true,
|
|
106
|
+
title: true,
|
|
107
|
+
content: true,
|
|
108
|
+
tags: true,
|
|
109
|
+
createdAt: true,
|
|
110
|
+
updatedAt: true,
|
|
111
|
+
}),
|
|
112
|
+
})),
|
|
113
|
+
});
|
|
85
114
|
exports.UserWithProjectBookmarksEntitySchema = zod_openapi_1.z
|
|
86
115
|
.object({
|
|
87
116
|
userId: zod_openapi_1.z.cuid2(),
|
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, SearchUsersInputSchema, UserWithProjectLikesEntitySchema, GetAuthenticatedUserWithProjectLikesOutputSchema, GetUserActivityInputSchema, GetUserActivityOutputSchema, UserStatsEntitySchema, UserWithPostsEntitySchema, SearchUsersOutputSchema } 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, SearchUsersOutputSchema, UserWithPostBookmarksEntitySchema, UserWithPostLikesEntitySchema } 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>;
|
|
@@ -7,6 +7,8 @@ export type UserProfileEntity = z.infer<typeof UserProfileEntitySchema>;
|
|
|
7
7
|
export type UserWithProjectsEntity = z.infer<typeof UserWithProjectsEntitySchema>;
|
|
8
8
|
export type UserWithProjectBookmarksEntity = z.infer<typeof UserWithProjectBookmarksEntitySchema>;
|
|
9
9
|
export type UserWithProjectLikesEntity = z.infer<typeof UserWithProjectLikesEntitySchema>;
|
|
10
|
+
export type UserWithPostBookmarksEntity = z.infer<typeof UserWithPostBookmarksEntitySchema>;
|
|
11
|
+
export type UserWithPostLikesEntity = z.infer<typeof UserWithPostLikesEntitySchema>;
|
|
10
12
|
export type UserWithUserPostsEntity = z.infer<typeof UserWithPostsEntitySchema>;
|
|
11
13
|
export type GetUserFollowingInput = z.infer<typeof GetUserFollowingInputSchema>;
|
|
12
14
|
export type GetUserFollowersInput = z.infer<typeof GetUserFollowersInputSchema>;
|
package/package.json
CHANGED
package/src/schemas/post.ts
CHANGED
|
@@ -170,7 +170,6 @@ export const CreatePostOutputSchema = PostEntitySchema;
|
|
|
170
170
|
export const GetPostOutputSchema = PostWithFilesEntitySchema;
|
|
171
171
|
export const PostIdSchema = z.object({ postId: z.cuid2() });
|
|
172
172
|
export const MinimalPostSchema = PostEntitySchema.pick({
|
|
173
|
-
title: true,
|
|
174
173
|
id: true,
|
|
175
174
|
parentId: true,
|
|
176
175
|
content: true,
|
package/src/schemas/user.ts
CHANGED
|
@@ -20,7 +20,7 @@ import { LikeEntitySchema } from "./like";
|
|
|
20
20
|
import { BrandEntitySchema } from "./brand";
|
|
21
21
|
import { CreativeEntitySchema } from "./creative";
|
|
22
22
|
import { InvestorEntitySchema } from "./investor";
|
|
23
|
-
import { PostWithFilesEntitySchema } from "./post";
|
|
23
|
+
import { PostEntitySchema, PostWithFilesEntitySchema } from "./post";
|
|
24
24
|
|
|
25
25
|
export const UserEntitySchema = z
|
|
26
26
|
.object({
|
|
@@ -55,6 +55,7 @@ export const UserEntitySchema = z
|
|
|
55
55
|
createdAt: z.coerce
|
|
56
56
|
.date()
|
|
57
57
|
.openapi({ example: "2025-10-13T09:00:00.000Z" }),
|
|
58
|
+
version: z.int(),
|
|
58
59
|
updatedAt: z.coerce
|
|
59
60
|
.date()
|
|
60
61
|
.openapi({ example: "2025-10-13T09:00:00.000Z" }),
|
|
@@ -107,6 +108,40 @@ export const UserWithProjectLikesEntitySchema = z.object({
|
|
|
107
108
|
),
|
|
108
109
|
});
|
|
109
110
|
|
|
111
|
+
export const UserWithPostLikesEntitySchema = z.object({
|
|
112
|
+
userId: z.cuid2(),
|
|
113
|
+
postLikes: z.array(
|
|
114
|
+
LikeEntitySchema.extend({
|
|
115
|
+
post: PostEntitySchema.pick({
|
|
116
|
+
id: true,
|
|
117
|
+
parentId: true,
|
|
118
|
+
title: true,
|
|
119
|
+
content: true,
|
|
120
|
+
tags: true,
|
|
121
|
+
createdAt: true,
|
|
122
|
+
updatedAt: true,
|
|
123
|
+
}),
|
|
124
|
+
}),
|
|
125
|
+
),
|
|
126
|
+
});
|
|
127
|
+
|
|
128
|
+
export const UserWithPostBookmarksEntitySchema = z.object({
|
|
129
|
+
userId: z.cuid2(),
|
|
130
|
+
postBookmarks: z.array(
|
|
131
|
+
BookmarkEntitySchema.extend({
|
|
132
|
+
post: PostEntitySchema.pick({
|
|
133
|
+
id: true,
|
|
134
|
+
parentId: true,
|
|
135
|
+
title: true,
|
|
136
|
+
content: true,
|
|
137
|
+
tags: true,
|
|
138
|
+
createdAt: true,
|
|
139
|
+
updatedAt: true,
|
|
140
|
+
}),
|
|
141
|
+
}),
|
|
142
|
+
),
|
|
143
|
+
});
|
|
144
|
+
|
|
110
145
|
export const UserWithProjectBookmarksEntitySchema = z
|
|
111
146
|
.object({
|
|
112
147
|
userId: z.cuid2(),
|
package/src/types/user.ts
CHANGED
|
@@ -24,6 +24,8 @@ import {
|
|
|
24
24
|
UserStatsEntitySchema,
|
|
25
25
|
UserWithPostsEntitySchema,
|
|
26
26
|
SearchUsersOutputSchema,
|
|
27
|
+
UserWithPostBookmarksEntitySchema,
|
|
28
|
+
UserWithPostLikesEntitySchema,
|
|
27
29
|
} from "../schemas/user";
|
|
28
30
|
|
|
29
31
|
import { z } from "@hono/zod-openapi";
|
|
@@ -41,6 +43,14 @@ export type UserWithProjectBookmarksEntity = z.infer<
|
|
|
41
43
|
export type UserWithProjectLikesEntity = z.infer<
|
|
42
44
|
typeof UserWithProjectLikesEntitySchema
|
|
43
45
|
>;
|
|
46
|
+
|
|
47
|
+
export type UserWithPostBookmarksEntity = z.infer<
|
|
48
|
+
typeof UserWithPostBookmarksEntitySchema
|
|
49
|
+
>;
|
|
50
|
+
export type UserWithPostLikesEntity = z.infer<
|
|
51
|
+
typeof UserWithPostLikesEntitySchema
|
|
52
|
+
>;
|
|
53
|
+
|
|
44
54
|
export type UserWithUserPostsEntity = z.infer<typeof UserWithPostsEntitySchema>;
|
|
45
55
|
export type GetUserFollowingInput = z.infer<typeof GetUserFollowingInputSchema>;
|
|
46
56
|
export type GetUserFollowersInput = z.infer<typeof GetUserFollowersInputSchema>;
|