@zyacreatives/shared 1.5.8 → 1.6.0

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.
@@ -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<{
@@ -503,3 +520,20 @@ export declare const GetAuthenticatedUserWithUserFollowersOutputSchema: z.ZodObj
503
520
  }>;
504
521
  }, z.core.$strip>>;
505
522
  }, z.core.$strip>;
523
+ export declare const GetAuthenticatedUserWithProjectLikesOutputSchema: z.ZodObject<{
524
+ userId: z.ZodCUID2;
525
+ projectLikes: z.ZodArray<z.ZodObject<{
526
+ projectId: z.ZodCUID2;
527
+ userId: z.ZodCUID2;
528
+ createdAt: z.ZodOptional<z.ZodCoercedDate<unknown>>;
529
+ project: z.ZodObject<{
530
+ id: z.ZodString;
531
+ description: z.ZodOptional<z.ZodString>;
532
+ title: z.ZodString;
533
+ tags: z.ZodOptional<z.ZodArray<z.ZodString>>;
534
+ imagePlaceholderUrl: z.ZodString;
535
+ startDate: z.ZodOptional<z.ZodCoercedDate<unknown>>;
536
+ endDate: z.ZodOptional<z.ZodCoercedDate<unknown>>;
537
+ }, z.core.$strip>;
538
+ }, z.core.$strip>>;
539
+ }, z.core.$strip>;
@@ -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.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.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(),
@@ -123,3 +137,4 @@ exports.GetAuthenticatedUserWithProjectsOutputSchema = exports.UserWithProjectsE
123
137
  exports.GetAuthenticatedUserWithProjectBookmarksOutputSchema = exports.UserWithProjectBookmarksEntitySchema;
124
138
  exports.GetAuthenticatedUserWithUserFollowingOutputSchema = exports.UserWithFollowingEntitySchema;
125
139
  exports.GetAuthenticatedUserWithUserFollowersOutputSchema = exports.UserWithFollowersEntitySchema;
140
+ exports.GetAuthenticatedUserWithProjectLikesOutputSchema = exports.UserWithProjectLikesEntitySchema;
@@ -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.8",
3
+ "version": "1.6.0",
4
4
  "description": "",
5
5
  "main": "dist/index.js",
6
6
  "types": "dist/index.d.ts",
@@ -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;
@@ -152,3 +171,6 @@ export const GetAuthenticatedUserWithUserFollowingOutputSchema =
152
171
 
153
172
  export const GetAuthenticatedUserWithUserFollowersOutputSchema =
154
173
  UserWithFollowersEntitySchema;
174
+
175
+ export const GetAuthenticatedUserWithProjectLikesOutputSchema =
176
+ UserWithProjectLikesEntitySchema;
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<