@zyacreatives/shared 2.1.71 → 2.1.73

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.
@@ -784,3 +784,50 @@ export declare const GetUserActivityOutputSchema: z.ZodArray<z.ZodObject<{
784
784
  JOB_APPLICATION: "JOB_APPLICATION";
785
785
  }>;
786
786
  }, z.core.$strip>>;
787
+ export declare const SearchUsersInputSchema: z.ZodObject<{
788
+ query: z.ZodDefault<z.ZodString>;
789
+ role: z.ZodOptional<z.ZodEnum<{
790
+ CREATIVE: "CREATIVE";
791
+ BRAND: "BRAND";
792
+ INVESTOR: "INVESTOR";
793
+ ADMIN: "ADMIN";
794
+ }>>;
795
+ limit: z.ZodDefault<z.ZodCoercedNumber<unknown>>;
796
+ cursor: z.ZodDefault<z.ZodCoercedNumber<unknown>>;
797
+ }, z.core.$strip>;
798
+ export declare const SearchUsersOutputSchema: z.ZodObject<{
799
+ users: z.ZodArray<z.ZodObject<{
800
+ id: z.ZodCUID2;
801
+ email: z.ZodEmail;
802
+ emailVerified: z.ZodBoolean;
803
+ name: z.ZodOptional<z.ZodString>;
804
+ image: z.ZodOptional<z.ZodString>;
805
+ username: z.ZodOptional<z.ZodString>;
806
+ displayUsername: z.ZodOptional<z.ZodString>;
807
+ role: z.ZodEnum<{
808
+ CREATIVE: "CREATIVE";
809
+ BRAND: "BRAND";
810
+ INVESTOR: "INVESTOR";
811
+ ADMIN: "ADMIN";
812
+ }>;
813
+ status: z.ZodEnum<{
814
+ ACTIVE: "ACTIVE";
815
+ SUSPENDED: "SUSPENDED";
816
+ DELETED: "DELETED";
817
+ }>;
818
+ onboardingPage: z.ZodEnum<{
819
+ EMAIL_VERIFICATION: "EMAIL_VERIFICATION";
820
+ USERNAME_SELECTION: "USERNAME_SELECTION";
821
+ ACCOUNT_TYPE_SELECTION: "ACCOUNT_TYPE_SELECTION";
822
+ CREATIVE_PROFILE_DETAILS: "CREATIVE_PROFILE_DETAILS";
823
+ BRAND_PROFILE_DETAILS: "BRAND_PROFILE_DETAILS";
824
+ INVESTOR_PROFILE_DETAILS: "INVESTOR_PROFILE_DETAILS";
825
+ INVESTOR_INVESTMENT_FOCUS: "INVESTOR_INVESTMENT_FOCUS";
826
+ INVESTOR_VERIFICATION: "INVESTOR_VERIFICATION";
827
+ DONE: "DONE";
828
+ }>;
829
+ createdAt: z.ZodCoercedDate<unknown>;
830
+ updatedAt: z.ZodCoercedDate<unknown>;
831
+ }, z.core.$strip>>;
832
+ nextCursor: z.ZodOptional<z.ZodString>;
833
+ }, z.core.$strip>;
@@ -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.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.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");
@@ -156,3 +156,27 @@ exports.GetUserActivityOutputSchema = zod_openapi_1.z.array(zod_openapi_1.z.obje
156
156
  parentId: zod_openapi_1.z.string(),
157
157
  parentType: zod_openapi_1.z.enum(Object.values(constants_1.ACTIVITY_PARENT_TYPES)),
158
158
  }));
159
+ exports.SearchUsersInputSchema = zod_openapi_1.z.object({
160
+ query: zod_openapi_1.z.string().default("").openapi({
161
+ example: "john",
162
+ description: "Search by name, email, username, or discipline",
163
+ }),
164
+ role: zod_openapi_1.z.enum(Object.values(constants_1.ROLES)).optional(),
165
+ limit: zod_openapi_1.z.coerce
166
+ .number()
167
+ .min(1)
168
+ .max(100)
169
+ .default(20)
170
+ .openapi({ example: 20 }),
171
+ cursor: zod_openapi_1.z.coerce.number().min(0).default(0).openapi({
172
+ example: 0,
173
+ description: "The offset/cursor for pagination",
174
+ }),
175
+ });
176
+ exports.SearchUsersOutputSchema = zod_openapi_1.z.object({
177
+ users: zod_openapi_1.z.array(exports.UserEntitySchema),
178
+ nextCursor: zod_openapi_1.z.string().optional().openapi({
179
+ example: "abc123",
180
+ description: "The next cursor for pagination",
181
+ }),
182
+ });
@@ -1,4 +1,4 @@
1
- import { MinimalUserSchema, UserEntitySchema, UserProfileEntitySchema, UserWithProjectsEntitySchema, UserWithProjectBookmarksEntitySchema, GetUserFollowingInputSchema, GetUserFollowersInputSchema, UserWithFollowingEntitySchema, UserWithFollowersEntitySchema, GetUserFollowingOutputSchema, GetUserFollowersOutputSchema, GetAuthenticatedUserOutputSchema, GetAuthenticatedUserProfileOutputSchema, GetAuthenticatedUserWithProjectsOutputSchema, GetAuthenticatedUserWithProjectBookmarksOutputSchema, GetAuthenticatedUserWithUserFollowingOutputSchema, GetAuthenticatedUserWithUserFollowersOutputSchema, UserWithProjectLikesEntitySchema, GetAuthenticatedUserWithProjectLikesOutputSchema, GetUserActivityInputSchema, GetUserActivityOutputSchema, UserStatsEntitySchema, UserWithPostsEntitySchema } 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 } 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>;
@@ -24,3 +24,5 @@ export type GetAuthenticatedUserWithUserFollowersOutput = z.infer<typeof GetAuth
24
24
  export type GetUserActivityInput = z.infer<typeof GetUserActivityInputSchema>;
25
25
  export type GetUserActivityOutput = z.infer<typeof GetUserActivityOutputSchema>;
26
26
  export type UserStatsEntity = z.infer<typeof UserStatsEntitySchema>;
27
+ export type SearchUsersInput = z.infer<typeof SearchUsersInputSchema>;
28
+ export type SearchUsersOutput = z.infer<typeof SearchUsersOutputSchema>;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@zyacreatives/shared",
3
- "version": "2.1.71",
3
+ "version": "2.1.73",
4
4
  "description": "",
5
5
  "main": "dist/index.js",
6
6
  "types": "dist/index.d.ts",
@@ -220,3 +220,29 @@ export const GetUserActivityOutputSchema = z.array(
220
220
  ),
221
221
  }),
222
222
  );
223
+
224
+ export const SearchUsersInputSchema = z.object({
225
+ query: z.string().default("").openapi({
226
+ example: "john",
227
+ description: "Search by name, email, username, or discipline",
228
+ }),
229
+ role: z.enum(Object.values(ROLES) as [Role, ...Role[]]).optional(),
230
+ limit: z.coerce
231
+ .number()
232
+ .min(1)
233
+ .max(100)
234
+ .default(20)
235
+ .openapi({ example: 20 }),
236
+ cursor: z.coerce.number().min(0).default(0).openapi({
237
+ example: 0,
238
+ description: "The offset/cursor for pagination",
239
+ }),
240
+ });
241
+
242
+ export const SearchUsersOutputSchema = z.object({
243
+ users: z.array(UserEntitySchema),
244
+ nextCursor: z.string().optional().openapi({
245
+ example: "abc123",
246
+ description: "The next cursor for pagination",
247
+ }),
248
+ });
package/src/types/user.ts CHANGED
@@ -16,12 +16,14 @@ import {
16
16
  GetAuthenticatedUserWithProjectBookmarksOutputSchema,
17
17
  GetAuthenticatedUserWithUserFollowingOutputSchema,
18
18
  GetAuthenticatedUserWithUserFollowersOutputSchema,
19
+ SearchUsersInputSchema,
19
20
  UserWithProjectLikesEntitySchema,
20
21
  GetAuthenticatedUserWithProjectLikesOutputSchema,
21
22
  GetUserActivityInputSchema,
22
23
  GetUserActivityOutputSchema,
23
24
  UserStatsEntitySchema,
24
25
  UserWithPostsEntitySchema,
26
+ SearchUsersOutputSchema,
25
27
  } from "../schemas/user";
26
28
 
27
29
  import { z } from "@hono/zod-openapi";
@@ -79,3 +81,6 @@ export type GetAuthenticatedUserWithUserFollowersOutput = z.infer<
79
81
  export type GetUserActivityInput = z.infer<typeof GetUserActivityInputSchema>;
80
82
  export type GetUserActivityOutput = z.infer<typeof GetUserActivityOutputSchema>;
81
83
  export type UserStatsEntity = z.infer<typeof UserStatsEntitySchema>;
84
+
85
+ export type SearchUsersInput = z.infer<typeof SearchUsersInputSchema>;
86
+ export type SearchUsersOutput = z.infer<typeof SearchUsersOutputSchema>;