@zyacreatives/shared 1.5.7 → 1.5.9

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.
@@ -105,6 +105,9 @@ export declare const ProjectCommentEntitySchema: z.ZodObject<{
105
105
  id: z.ZodCUID2;
106
106
  projectId: z.ZodCUID2;
107
107
  userId: z.ZodCUID2;
108
+ commenterName: z.ZodString;
109
+ commenterUsername: z.ZodString;
110
+ commenterImageUrl: z.ZodOptional<z.ZodString>;
108
111
  parentCommentId: z.ZodOptional<z.ZodCUID2>;
109
112
  content: z.ZodString;
110
113
  createdAt: z.ZodOptional<z.ZodCoercedDate<unknown>>;
@@ -252,6 +255,9 @@ export declare const CommentOnProjectOutputSchema: z.ZodObject<{
252
255
  id: z.ZodCUID2;
253
256
  projectId: z.ZodCUID2;
254
257
  userId: z.ZodCUID2;
258
+ commenterName: z.ZodString;
259
+ commenterUsername: z.ZodString;
260
+ commenterImageUrl: z.ZodOptional<z.ZodString>;
255
261
  parentCommentId: z.ZodOptional<z.ZodCUID2>;
256
262
  content: z.ZodString;
257
263
  createdAt: z.ZodOptional<z.ZodCoercedDate<unknown>>;
@@ -260,6 +266,9 @@ export declare const DeleteProjectCommentOutputSchema: z.ZodObject<{
260
266
  id: z.ZodCUID2;
261
267
  projectId: z.ZodCUID2;
262
268
  userId: z.ZodCUID2;
269
+ commenterName: z.ZodString;
270
+ commenterUsername: z.ZodString;
271
+ commenterImageUrl: z.ZodOptional<z.ZodString>;
263
272
  parentCommentId: z.ZodOptional<z.ZodCUID2>;
264
273
  content: z.ZodString;
265
274
  createdAt: z.ZodOptional<z.ZodCoercedDate<unknown>>;
@@ -397,6 +406,9 @@ export declare const ProjectWithProjectCommentsEntitySchema: z.ZodObject<{
397
406
  id: z.ZodCUID2;
398
407
  projectId: z.ZodCUID2;
399
408
  userId: z.ZodCUID2;
409
+ commenterName: z.ZodString;
410
+ commenterUsername: z.ZodString;
411
+ commenterImageUrl: z.ZodOptional<z.ZodString>;
400
412
  parentCommentId: z.ZodOptional<z.ZodCUID2>;
401
413
  content: z.ZodString;
402
414
  createdAt: z.ZodOptional<z.ZodCoercedDate<unknown>>;
@@ -156,6 +156,9 @@ exports.ProjectCommentEntitySchema = zod_openapi_1.z
156
156
  id: zod_openapi_1.z.cuid2(),
157
157
  projectId: zod_openapi_1.z.cuid2(),
158
158
  userId: zod_openapi_1.z.cuid2(),
159
+ commenterName: zod_openapi_1.z.string(),
160
+ commenterUsername: zod_openapi_1.z.string(),
161
+ commenterImageUrl: zod_openapi_1.z.string().optional(),
159
162
  parentCommentId: zod_openapi_1.z.cuid2().optional(),
160
163
  content: zod_openapi_1.z.string().min(1),
161
164
  createdAt: zod_openapi_1.z.coerce.date().optional(),
@@ -256,7 +259,6 @@ exports.CommentOnProjectInputSchema = zod_openapi_1.z
256
259
  exports.DeleteProjectCommentInputSchema = zod_openapi_1.z.object({
257
260
  commentId: zod_openapi_1.z.cuid2(),
258
261
  });
259
- /* ------------------------------ Output Schemas ------------------------------ */
260
262
  exports.CreateProjectOutputSchema = exports.ProjectEntitySchema;
261
263
  exports.UpdateProjectOutputSchema = exports.ProjectEntitySchema;
262
264
  exports.CommentOnProjectOutputSchema = exports.ProjectCommentEntitySchema;
@@ -289,7 +291,6 @@ exports.ListProjectsInputSchema = zod_openapi_1.z
289
291
  .openapi({
290
292
  title: "ListProjectsInput",
291
293
  });
292
- /* ------------------------------ Aggregates ------------------------------ */
293
294
  exports.ProjectWithProjectViewsEntitySchema = exports.MinimalProjectSchema.extend({
294
295
  views: zod_openapi_1.z.array(exports.ProjectViewEntitySchema),
295
296
  }).openapi({
@@ -177,6 +177,23 @@ export declare const UserWithProjectsEntitySchema: z.ZodObject<{
177
177
  searchVector: z.ZodString;
178
178
  }, z.core.$strip>>;
179
179
  }, z.core.$strip>;
180
+ export declare const UserWithProjectLikesEntitySchema: z.ZodObject<{
181
+ userId: z.ZodCUID2;
182
+ projectLikes: z.ZodArray<z.ZodObject<{
183
+ projectId: z.ZodCUID2;
184
+ userId: z.ZodCUID2;
185
+ createdAt: z.ZodOptional<z.ZodCoercedDate<unknown>>;
186
+ project: z.ZodObject<{
187
+ id: z.ZodString;
188
+ description: z.ZodOptional<z.ZodString>;
189
+ title: z.ZodString;
190
+ tags: z.ZodOptional<z.ZodArray<z.ZodString>>;
191
+ imagePlaceholderUrl: z.ZodString;
192
+ startDate: z.ZodOptional<z.ZodCoercedDate<unknown>>;
193
+ endDate: z.ZodOptional<z.ZodCoercedDate<unknown>>;
194
+ }, z.core.$strip>;
195
+ }, z.core.$strip>>;
196
+ }, z.core.$strip>;
180
197
  export declare const UserWithProjectBookmarksEntitySchema: z.ZodObject<{
181
198
  userId: z.ZodCUID2;
182
199
  projectBookmarks: z.ZodArray<z.ZodObject<{
@@ -1,6 +1,6 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
- 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.UserWithProjectsEntitySchema = exports.UserProfileEntitySchema = exports.UserEntitySchema = exports.MinimalUserSchema = exports.BaseUserEntitySchema = exports.UserSocialGraphEntitySchema = void 0;
3
+ 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.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
6
  const project_1 = require("./project");
@@ -77,6 +77,20 @@ exports.UserWithProjectsEntitySchema = zod_openapi_1.z
77
77
  projects: zod_openapi_1.z.array(project_1.ProjectEntitySchema.omit({ overview: true })),
78
78
  })
79
79
  .openapi("UserWithProjectsEntity");
80
+ exports.UserWithProjectLikesEntitySchema = zod_openapi_1.z.object({
81
+ userId: zod_openapi_1.z.cuid2(),
82
+ projectLikes: zod_openapi_1.z.array(project_1.ProjectLikeEntitySchema.extend({
83
+ project: project_1.ProjectEntitySchema.pick({
84
+ id: true,
85
+ title: true,
86
+ description: true,
87
+ tags: true,
88
+ startDate: true,
89
+ endDate: true,
90
+ imagePlaceholderUrl: true,
91
+ }),
92
+ })),
93
+ });
80
94
  exports.UserWithProjectBookmarksEntitySchema = zod_openapi_1.z
81
95
  .object({
82
96
  userId: zod_openapi_1.z.cuid2(),
@@ -1,4 +1,4 @@
1
- import { BaseUserEntitySchema, MinimalUserSchema, UserEntitySchema, UserProfileEntitySchema, UserWithProjectsEntitySchema, UserWithProjectBookmarksEntitySchema, GetUserFollowingInputSchema, GetUserFollowersInputSchema, UserWithFollowingEntitySchema, UserWithFollowersEntitySchema, GetUserFollowingOutputSchema, GetUserFollowersOutputSchema, GetAuthenticatedUserOutputSchema, GetAuthenticatedUserProfileOutputSchema, GetAuthenticatedUserWithProjectsOutputSchema, GetAuthenticatedUserWithProjectBookmarksOutputSchema, GetAuthenticatedUserWithUserFollowingOutputSchema, GetAuthenticatedUserWithUserFollowersOutputSchema } from "../schemas/user";
1
+ import { BaseUserEntitySchema, MinimalUserSchema, UserEntitySchema, UserProfileEntitySchema, UserWithProjectsEntitySchema, UserWithProjectBookmarksEntitySchema, GetUserFollowingInputSchema, GetUserFollowersInputSchema, UserWithFollowingEntitySchema, UserWithFollowersEntitySchema, GetUserFollowingOutputSchema, GetUserFollowersOutputSchema, GetAuthenticatedUserOutputSchema, GetAuthenticatedUserProfileOutputSchema, GetAuthenticatedUserWithProjectsOutputSchema, GetAuthenticatedUserWithProjectBookmarksOutputSchema, GetAuthenticatedUserWithUserFollowingOutputSchema, GetAuthenticatedUserWithUserFollowersOutputSchema, UserWithProjectLikesEntitySchema } from "../schemas/user";
2
2
  import { z } from "@hono/zod-openapi";
3
3
  export type BaseUserEntity = z.infer<typeof BaseUserEntitySchema>;
4
4
  export type MinimalUser = z.infer<typeof MinimalUserSchema>;
@@ -6,6 +6,7 @@ export type UserEntity = z.infer<typeof UserEntitySchema>;
6
6
  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
+ export type UserWithProjectLikesEntity = z.infer<typeof UserWithProjectLikesEntitySchema>;
9
10
  export type GetUserFollowingInput = z.infer<typeof GetUserFollowingInputSchema>;
10
11
  export type GetUserFollowersInput = z.infer<typeof GetUserFollowersInputSchema>;
11
12
  export type UserWithFollowingEntity = z.infer<typeof UserWithFollowingEntitySchema>;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@zyacreatives/shared",
3
- "version": "1.5.7",
3
+ "version": "1.5.9",
4
4
  "description": "",
5
5
  "main": "dist/index.js",
6
6
  "types": "dist/index.d.ts",
@@ -163,6 +163,9 @@ export const ProjectCommentEntitySchema = z
163
163
  id: z.cuid2(),
164
164
  projectId: z.cuid2(),
165
165
  userId: z.cuid2(),
166
+ commenterName: z.string(),
167
+ commenterUsername:z.string(),
168
+ commenterImageUrl: z.string().optional(),
166
169
  parentCommentId: z.cuid2().optional(),
167
170
  content: z.string().min(1),
168
171
  createdAt: z.coerce.date().optional(),
@@ -274,7 +277,6 @@ export const DeleteProjectCommentInputSchema = z.object({
274
277
  commentId: z.cuid2(),
275
278
  });
276
279
 
277
- /* ------------------------------ Output Schemas ------------------------------ */
278
280
  export const CreateProjectOutputSchema = ProjectEntitySchema;
279
281
  export const UpdateProjectOutputSchema = ProjectEntitySchema;
280
282
  export const CommentOnProjectOutputSchema = ProjectCommentEntitySchema;
@@ -312,7 +314,6 @@ export const ListProjectsInputSchema = z
312
314
  title: "ListProjectsInput",
313
315
  });
314
316
 
315
- /* ------------------------------ Aggregates ------------------------------ */
316
317
  export const ProjectWithProjectViewsEntitySchema = MinimalProjectSchema.extend({
317
318
  views: z.array(ProjectViewEntitySchema),
318
319
  }).openapi({
@@ -2,7 +2,11 @@ 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 { ProjectBookmarkEntitySchema, ProjectEntitySchema } from "./project";
5
+ import {
6
+ ProjectBookmarkEntitySchema,
7
+ ProjectEntitySchema,
8
+ ProjectLikeEntitySchema,
9
+ } from "./project";
6
10
 
7
11
  export const UserSocialGraphEntitySchema = z
8
12
  .object({
@@ -87,6 +91,23 @@ export const UserWithProjectsEntitySchema = z
87
91
  })
88
92
  .openapi("UserWithProjectsEntity");
89
93
 
94
+ export const UserWithProjectLikesEntitySchema = z.object({
95
+ userId: z.cuid2(),
96
+ projectLikes: z.array(
97
+ ProjectLikeEntitySchema.extend({
98
+ project: ProjectEntitySchema.pick({
99
+ id: true,
100
+ title: true,
101
+ description: true,
102
+ tags: true,
103
+ startDate: true,
104
+ endDate: true,
105
+ imagePlaceholderUrl: true,
106
+ }),
107
+ })
108
+ ),
109
+ });
110
+
90
111
  export const UserWithProjectBookmarksEntitySchema = z
91
112
  .object({
92
113
  userId: z.cuid2(),
@@ -105,7 +126,7 @@ export const UserWithProjectBookmarksEntitySchema = z
105
126
  ),
106
127
  })
107
128
  .openapi("UserWithProjectBookmarksEntity");
108
-
129
+
109
130
  export const GetUserFollowingInputSchema = z.object({
110
131
  searchQuery: z.string().optional().openapi({ example: "design systems" }),
111
132
  offset: z.number().int().nonnegative().optional().openapi({ example: 20 }),
@@ -135,8 +156,6 @@ export const GetUserFollowersOutputSchema = z.object({
135
156
  results: UserWithFollowersEntitySchema,
136
157
  });
137
158
 
138
-
139
-
140
159
  export const GetAuthenticatedUserOutputSchema = UserEntitySchema;
141
160
 
142
161
  export const GetAuthenticatedUserProfileOutputSchema = UserProfileEntitySchema;
@@ -67,6 +67,7 @@ export type CommentOnProjectInput = z.infer<typeof CommentOnProjectInputSchema>;
67
67
  export type CommentOnProjectOutput = z.infer<
68
68
  typeof CommentOnProjectOutputSchema
69
69
  >;
70
+
70
71
  export type DeleteProjectCommentOutput = z.infer<
71
72
  typeof DeleteProjectCommentOutputSchema
72
73
  >;
package/src/types/user.ts CHANGED
@@ -19,6 +19,7 @@ import {
19
19
  GetAuthenticatedUserWithProjectBookmarksOutputSchema,
20
20
  GetAuthenticatedUserWithUserFollowingOutputSchema,
21
21
  GetAuthenticatedUserWithUserFollowersOutputSchema,
22
+ UserWithProjectLikesEntitySchema,
22
23
  } from "../schemas/user";
23
24
 
24
25
  import { z } from "@hono/zod-openapi";
@@ -33,6 +34,9 @@ export type UserWithProjectsEntity = z.infer<
33
34
  export type UserWithProjectBookmarksEntity = z.infer<
34
35
  typeof UserWithProjectBookmarksEntitySchema
35
36
  >;
37
+ export type UserWithProjectLikesEntity = z.infer<
38
+ typeof UserWithProjectLikesEntitySchema
39
+ >;
36
40
  export type GetUserFollowingInput = z.infer<typeof GetUserFollowingInputSchema>;
37
41
  export type GetUserFollowersInput = z.infer<typeof GetUserFollowersInputSchema>;
38
42
  export type UserWithFollowingEntity = z.infer<