@zyacreatives/shared 1.4.0 → 1.4.2
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/user.d.ts +64 -0
- package/dist/schemas/user.js +15 -1
- package/dist/types/user.d.ts +11 -1
- package/package.json +1 -1
- package/src/schemas/user.ts +20 -1
- package/src/types/user.ts +43 -11
package/dist/schemas/user.d.ts
CHANGED
|
@@ -194,6 +194,14 @@ export declare const UserWithProjectBookmarksEntitySchema: z.ZodObject<{
|
|
|
194
194
|
}, z.core.$strip>;
|
|
195
195
|
}, z.core.$strip>>;
|
|
196
196
|
}, z.core.$strip>;
|
|
197
|
+
export declare const GetUserFollowingInputSchema: z.ZodObject<{
|
|
198
|
+
searchQuery: z.ZodOptional<z.ZodString>;
|
|
199
|
+
offset: z.ZodOptional<z.ZodNumber>;
|
|
200
|
+
}, z.core.$strip>;
|
|
201
|
+
export declare const GetUserFollowersInputSchema: z.ZodObject<{
|
|
202
|
+
searchQuery: z.ZodOptional<z.ZodString>;
|
|
203
|
+
offset: z.ZodOptional<z.ZodNumber>;
|
|
204
|
+
}, z.core.$strip>;
|
|
197
205
|
export declare const UserWithFollowingEntitySchema: z.ZodObject<{
|
|
198
206
|
id: z.ZodCUID2;
|
|
199
207
|
username: z.ZodOptional<z.ZodString>;
|
|
@@ -246,6 +254,62 @@ export declare const UserWithFollowersEntitySchema: z.ZodObject<{
|
|
|
246
254
|
}>;
|
|
247
255
|
}, z.core.$strip>>;
|
|
248
256
|
}, z.core.$strip>;
|
|
257
|
+
export declare const GetUserFollowingOutputSchema: z.ZodObject<{
|
|
258
|
+
results: z.ZodObject<{
|
|
259
|
+
id: z.ZodCUID2;
|
|
260
|
+
username: z.ZodOptional<z.ZodString>;
|
|
261
|
+
email: z.ZodString;
|
|
262
|
+
name: z.ZodOptional<z.ZodString>;
|
|
263
|
+
image: z.ZodOptional<z.ZodString>;
|
|
264
|
+
role: z.ZodEnum<{
|
|
265
|
+
CREATIVE: "CREATIVE";
|
|
266
|
+
BRAND: "BRAND";
|
|
267
|
+
INVESTOR: "INVESTOR";
|
|
268
|
+
ADMIN: "ADMIN";
|
|
269
|
+
}>;
|
|
270
|
+
following: z.ZodArray<z.ZodObject<{
|
|
271
|
+
id: z.ZodCUID2;
|
|
272
|
+
username: z.ZodOptional<z.ZodString>;
|
|
273
|
+
email: z.ZodString;
|
|
274
|
+
name: z.ZodOptional<z.ZodString>;
|
|
275
|
+
image: z.ZodOptional<z.ZodString>;
|
|
276
|
+
role: z.ZodEnum<{
|
|
277
|
+
CREATIVE: "CREATIVE";
|
|
278
|
+
BRAND: "BRAND";
|
|
279
|
+
INVESTOR: "INVESTOR";
|
|
280
|
+
ADMIN: "ADMIN";
|
|
281
|
+
}>;
|
|
282
|
+
}, z.core.$strip>>;
|
|
283
|
+
}, z.core.$strip>;
|
|
284
|
+
}, z.core.$strip>;
|
|
285
|
+
export declare const GetUserFollowersOutputSchema: z.ZodObject<{
|
|
286
|
+
results: z.ZodObject<{
|
|
287
|
+
id: z.ZodCUID2;
|
|
288
|
+
username: z.ZodOptional<z.ZodString>;
|
|
289
|
+
email: z.ZodString;
|
|
290
|
+
name: z.ZodOptional<z.ZodString>;
|
|
291
|
+
image: z.ZodOptional<z.ZodString>;
|
|
292
|
+
role: z.ZodEnum<{
|
|
293
|
+
CREATIVE: "CREATIVE";
|
|
294
|
+
BRAND: "BRAND";
|
|
295
|
+
INVESTOR: "INVESTOR";
|
|
296
|
+
ADMIN: "ADMIN";
|
|
297
|
+
}>;
|
|
298
|
+
followers: z.ZodArray<z.ZodObject<{
|
|
299
|
+
id: z.ZodCUID2;
|
|
300
|
+
username: z.ZodOptional<z.ZodString>;
|
|
301
|
+
email: z.ZodString;
|
|
302
|
+
name: z.ZodOptional<z.ZodString>;
|
|
303
|
+
image: z.ZodOptional<z.ZodString>;
|
|
304
|
+
role: z.ZodEnum<{
|
|
305
|
+
CREATIVE: "CREATIVE";
|
|
306
|
+
BRAND: "BRAND";
|
|
307
|
+
INVESTOR: "INVESTOR";
|
|
308
|
+
ADMIN: "ADMIN";
|
|
309
|
+
}>;
|
|
310
|
+
}, z.core.$strip>>;
|
|
311
|
+
}, z.core.$strip>;
|
|
312
|
+
}, z.core.$strip>;
|
|
249
313
|
export declare const GetAuthenticatedUserOutputSchema: z.ZodObject<{
|
|
250
314
|
id: z.ZodCUID2;
|
|
251
315
|
email: z.ZodString;
|
package/dist/schemas/user.js
CHANGED
|
@@ -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.UserWithFollowersEntitySchema = exports.UserWithFollowingEntitySchema = 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.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");
|
|
@@ -93,6 +93,14 @@ exports.UserWithProjectBookmarksEntitySchema = zod_openapi_1.z
|
|
|
93
93
|
})),
|
|
94
94
|
})
|
|
95
95
|
.openapi("UserWithProjectBookmarksEntity");
|
|
96
|
+
exports.GetUserFollowingInputSchema = zod_openapi_1.z.object({
|
|
97
|
+
searchQuery: zod_openapi_1.z.string().optional().openapi({ example: "design systems" }),
|
|
98
|
+
offset: zod_openapi_1.z.number().int().nonnegative().optional().openapi({ example: 20 }),
|
|
99
|
+
});
|
|
100
|
+
exports.GetUserFollowersInputSchema = zod_openapi_1.z.object({
|
|
101
|
+
searchQuery: zod_openapi_1.z.string().optional().openapi({ example: "design systems" }),
|
|
102
|
+
offset: zod_openapi_1.z.number().int().nonnegative().optional().openapi({ example: 20 }),
|
|
103
|
+
});
|
|
96
104
|
exports.UserWithFollowingEntitySchema = exports.MinimalUserSchema.extend({
|
|
97
105
|
following: zod_openapi_1.z
|
|
98
106
|
.array(exports.MinimalUserSchema)
|
|
@@ -103,6 +111,12 @@ exports.UserWithFollowersEntitySchema = exports.MinimalUserSchema.extend({
|
|
|
103
111
|
.array(exports.MinimalUserSchema)
|
|
104
112
|
.openapi({ description: "List of users who follow this user." }),
|
|
105
113
|
}).openapi("UserWithFollowersEntity");
|
|
114
|
+
exports.GetUserFollowingOutputSchema = zod_openapi_1.z.object({
|
|
115
|
+
results: exports.UserWithFollowingEntitySchema,
|
|
116
|
+
});
|
|
117
|
+
exports.GetUserFollowersOutputSchema = zod_openapi_1.z.object({
|
|
118
|
+
results: exports.UserWithFollowersEntitySchema,
|
|
119
|
+
});
|
|
106
120
|
exports.GetAuthenticatedUserOutputSchema = exports.UserEntitySchema;
|
|
107
121
|
exports.GetAuthenticatedUserProfileOutputSchema = exports.UserProfileEntitySchema;
|
|
108
122
|
exports.GetAuthenticatedUserWithProjectsOutputSchema = exports.UserWithProjectsEntitySchema;
|
package/dist/types/user.d.ts
CHANGED
|
@@ -1,10 +1,20 @@
|
|
|
1
|
+
import { BaseUserEntitySchema, MinimalUserSchema, UserEntitySchema, UserProfileEntitySchema, UserWithProjectsEntitySchema, UserWithProjectBookmarksEntitySchema, GetUserFollowingInputSchema, GetUserFollowersInputSchema, UserWithFollowingEntitySchema, UserWithFollowersEntitySchema, GetUserFollowingOutputSchema, GetUserFollowersOutputSchema, GetAuthenticatedUserOutputSchema, GetAuthenticatedUserProfileOutputSchema, GetAuthenticatedUserWithProjectsOutputSchema, GetAuthenticatedUserWithProjectBookmarksOutputSchema, GetAuthenticatedUserWithUserFollowingOutputSchema, GetAuthenticatedUserWithUserFollowersOutputSchema } from "../schemas/user";
|
|
1
2
|
import { z } from "@hono/zod-openapi";
|
|
2
|
-
import { BaseUserEntitySchema, UserWithFollowingEntitySchema, MinimalUserSchema, UserEntitySchema, UserProfileEntitySchema, UserWithProjectBookmarksEntitySchema, UserWithProjectsEntitySchema, UserWithFollowersEntitySchema } from "../schemas";
|
|
3
3
|
export type BaseUserEntity = z.infer<typeof BaseUserEntitySchema>;
|
|
4
4
|
export type MinimalUser = z.infer<typeof MinimalUserSchema>;
|
|
5
5
|
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 GetUserFollowingInput = z.infer<typeof GetUserFollowingInputSchema>;
|
|
10
|
+
export type GetUserFollowersInput = z.infer<typeof GetUserFollowersInputSchema>;
|
|
9
11
|
export type UserWithFollowingEntity = z.infer<typeof UserWithFollowingEntitySchema>;
|
|
10
12
|
export type UserWithFollowersEntity = z.infer<typeof UserWithFollowersEntitySchema>;
|
|
13
|
+
export type GetUserFollowingOutput = z.infer<typeof GetUserFollowingOutputSchema>;
|
|
14
|
+
export type GetUserFollowersOutput = z.infer<typeof GetUserFollowersOutputSchema>;
|
|
15
|
+
export type GetAuthenticatedUserOutput = z.infer<typeof GetAuthenticatedUserOutputSchema>;
|
|
16
|
+
export type GetAuthenticatedUserProfileOutput = z.infer<typeof GetAuthenticatedUserProfileOutputSchema>;
|
|
17
|
+
export type GetAuthenticatedUserWithProjectsOutput = z.infer<typeof GetAuthenticatedUserWithProjectsOutputSchema>;
|
|
18
|
+
export type GetAuthenticatedUserWithProjectBookmarksOutput = z.infer<typeof GetAuthenticatedUserWithProjectBookmarksOutputSchema>;
|
|
19
|
+
export type GetAuthenticatedUserWithUserFollowingOutput = z.infer<typeof GetAuthenticatedUserWithUserFollowingOutputSchema>;
|
|
20
|
+
export type GetAuthenticatedUserWithUserFollowersOutput = z.infer<typeof GetAuthenticatedUserWithUserFollowersOutputSchema>;
|
package/package.json
CHANGED
package/src/schemas/user.ts
CHANGED
|
@@ -105,7 +105,16 @@ export const UserWithProjectBookmarksEntitySchema = z
|
|
|
105
105
|
),
|
|
106
106
|
})
|
|
107
107
|
.openapi("UserWithProjectBookmarksEntity");
|
|
108
|
-
|
|
108
|
+
|
|
109
|
+
export const GetUserFollowingInputSchema = z.object({
|
|
110
|
+
searchQuery: z.string().optional().openapi({ example: "design systems" }),
|
|
111
|
+
offset: z.number().int().nonnegative().optional().openapi({ example: 20 }),
|
|
112
|
+
});
|
|
113
|
+
|
|
114
|
+
export const GetUserFollowersInputSchema = z.object({
|
|
115
|
+
searchQuery: z.string().optional().openapi({ example: "design systems" }),
|
|
116
|
+
offset: z.number().int().nonnegative().optional().openapi({ example: 20 }),
|
|
117
|
+
});
|
|
109
118
|
export const UserWithFollowingEntitySchema = MinimalUserSchema.extend({
|
|
110
119
|
following: z
|
|
111
120
|
.array(MinimalUserSchema)
|
|
@@ -118,6 +127,16 @@ export const UserWithFollowersEntitySchema = MinimalUserSchema.extend({
|
|
|
118
127
|
.openapi({ description: "List of users who follow this user." }),
|
|
119
128
|
}).openapi("UserWithFollowersEntity");
|
|
120
129
|
|
|
130
|
+
export const GetUserFollowingOutputSchema = z.object({
|
|
131
|
+
results: UserWithFollowingEntitySchema,
|
|
132
|
+
});
|
|
133
|
+
|
|
134
|
+
export const GetUserFollowersOutputSchema = z.object({
|
|
135
|
+
results: UserWithFollowersEntitySchema,
|
|
136
|
+
});
|
|
137
|
+
|
|
138
|
+
|
|
139
|
+
|
|
121
140
|
export const GetAuthenticatedUserOutputSchema = UserEntitySchema;
|
|
122
141
|
|
|
123
142
|
export const GetAuthenticatedUserProfileOutputSchema = UserProfileEntitySchema;
|
package/src/types/user.ts
CHANGED
|
@@ -1,35 +1,67 @@
|
|
|
1
|
-
|
|
1
|
+
// user.types.ts
|
|
2
2
|
import {
|
|
3
|
+
UserSocialGraphEntitySchema,
|
|
3
4
|
BaseUserEntitySchema,
|
|
4
|
-
UserWithFollowingEntitySchema,
|
|
5
5
|
MinimalUserSchema,
|
|
6
6
|
UserEntitySchema,
|
|
7
7
|
UserProfileEntitySchema,
|
|
8
|
-
UserWithProjectBookmarksEntitySchema,
|
|
9
8
|
UserWithProjectsEntitySchema,
|
|
9
|
+
UserWithProjectBookmarksEntitySchema,
|
|
10
|
+
GetUserFollowingInputSchema,
|
|
11
|
+
GetUserFollowersInputSchema,
|
|
12
|
+
UserWithFollowingEntitySchema,
|
|
10
13
|
UserWithFollowersEntitySchema,
|
|
11
|
-
|
|
14
|
+
GetUserFollowingOutputSchema,
|
|
15
|
+
GetUserFollowersOutputSchema,
|
|
16
|
+
GetAuthenticatedUserOutputSchema,
|
|
17
|
+
GetAuthenticatedUserProfileOutputSchema,
|
|
18
|
+
GetAuthenticatedUserWithProjectsOutputSchema,
|
|
19
|
+
GetAuthenticatedUserWithProjectBookmarksOutputSchema,
|
|
20
|
+
GetAuthenticatedUserWithUserFollowingOutputSchema,
|
|
21
|
+
GetAuthenticatedUserWithUserFollowersOutputSchema,
|
|
22
|
+
} from "../schemas/user";
|
|
12
23
|
|
|
13
|
-
|
|
24
|
+
import { z } from "@hono/zod-openapi";
|
|
14
25
|
|
|
26
|
+
export type BaseUserEntity = z.infer<typeof BaseUserEntitySchema>;
|
|
15
27
|
export type MinimalUser = z.infer<typeof MinimalUserSchema>;
|
|
16
|
-
|
|
17
28
|
export type UserEntity = z.infer<typeof UserEntitySchema>;
|
|
18
|
-
|
|
19
29
|
export type UserProfileEntity = z.infer<typeof UserProfileEntitySchema>;
|
|
20
|
-
|
|
21
30
|
export type UserWithProjectsEntity = z.infer<
|
|
22
31
|
typeof UserWithProjectsEntitySchema
|
|
23
32
|
>;
|
|
24
|
-
|
|
25
33
|
export type UserWithProjectBookmarksEntity = z.infer<
|
|
26
34
|
typeof UserWithProjectBookmarksEntitySchema
|
|
27
35
|
>;
|
|
28
|
-
|
|
36
|
+
export type GetUserFollowingInput = z.infer<typeof GetUserFollowingInputSchema>;
|
|
37
|
+
export type GetUserFollowersInput = z.infer<typeof GetUserFollowersInputSchema>;
|
|
29
38
|
export type UserWithFollowingEntity = z.infer<
|
|
30
39
|
typeof UserWithFollowingEntitySchema
|
|
31
40
|
>;
|
|
32
|
-
|
|
33
41
|
export type UserWithFollowersEntity = z.infer<
|
|
34
42
|
typeof UserWithFollowersEntitySchema
|
|
35
43
|
>;
|
|
44
|
+
export type GetUserFollowingOutput = z.infer<
|
|
45
|
+
typeof GetUserFollowingOutputSchema
|
|
46
|
+
>;
|
|
47
|
+
export type GetUserFollowersOutput = z.infer<
|
|
48
|
+
typeof GetUserFollowersOutputSchema
|
|
49
|
+
>;
|
|
50
|
+
export type GetAuthenticatedUserOutput = z.infer<
|
|
51
|
+
typeof GetAuthenticatedUserOutputSchema
|
|
52
|
+
>;
|
|
53
|
+
export type GetAuthenticatedUserProfileOutput = z.infer<
|
|
54
|
+
typeof GetAuthenticatedUserProfileOutputSchema
|
|
55
|
+
>;
|
|
56
|
+
export type GetAuthenticatedUserWithProjectsOutput = z.infer<
|
|
57
|
+
typeof GetAuthenticatedUserWithProjectsOutputSchema
|
|
58
|
+
>;
|
|
59
|
+
export type GetAuthenticatedUserWithProjectBookmarksOutput = z.infer<
|
|
60
|
+
typeof GetAuthenticatedUserWithProjectBookmarksOutputSchema
|
|
61
|
+
>;
|
|
62
|
+
export type GetAuthenticatedUserWithUserFollowingOutput = z.infer<
|
|
63
|
+
typeof GetAuthenticatedUserWithUserFollowingOutputSchema
|
|
64
|
+
>;
|
|
65
|
+
export type GetAuthenticatedUserWithUserFollowersOutput = z.infer<
|
|
66
|
+
typeof GetAuthenticatedUserWithUserFollowersOutputSchema
|
|
67
|
+
>;
|