@zyacreatives/shared 2.5.54 → 2.5.56
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/index.d.ts +0 -1
- package/dist/index.js +0 -1
- package/dist/schemas/activity.d.ts +1 -0
- package/dist/schemas/auth.d.ts +2 -0
- package/dist/schemas/bookmark.d.ts +62 -7
- package/dist/schemas/bookmark.js +32 -30
- package/dist/schemas/brand.d.ts +3 -3
- package/dist/schemas/chat.d.ts +96 -52
- package/dist/schemas/chat.js +44 -18
- package/dist/schemas/comment.d.ts +65 -21
- package/dist/schemas/comment.js +48 -54
- package/dist/schemas/common.d.ts +15 -11
- package/dist/schemas/creative.d.ts +3 -3
- package/dist/schemas/discipline.d.ts +63 -12
- package/dist/schemas/discipline.js +62 -65
- package/dist/schemas/entity-stats.d.ts +35 -3
- package/dist/schemas/entity-stats.js +24 -38
- package/dist/schemas/feed.d.ts +50 -3
- package/dist/schemas/feed.js +43 -13
- package/dist/schemas/file.d.ts +65 -24
- package/dist/schemas/file.js +60 -49
- package/dist/schemas/index.d.ts +1 -0
- package/dist/schemas/index.js +1 -0
- package/dist/schemas/investor-shortlist.d.ts +68 -11
- package/dist/schemas/investor-shortlist.js +46 -24
- package/dist/schemas/investor-signal.d.ts +52 -12
- package/dist/schemas/investor-signal.js +59 -39
- package/dist/schemas/investor.d.ts +3 -3
- package/dist/schemas/job-application.d.ts +291 -279
- package/dist/schemas/job-application.js +59 -95
- package/dist/schemas/job.d.ts +200 -659
- package/dist/schemas/job.js +98 -231
- package/dist/schemas/like.d.ts +3 -0
- package/dist/schemas/message.d.ts +125 -94
- package/dist/schemas/message.js +54 -55
- package/dist/schemas/notification.d.ts +99 -32
- package/dist/schemas/notification.js +46 -42
- package/dist/schemas/payout-method.d.ts +51 -31
- package/dist/schemas/payout-method.js +48 -58
- package/dist/schemas/post.d.ts +295 -204
- package/dist/schemas/post.js +148 -272
- package/dist/schemas/product.d.ts +308 -229
- package/dist/schemas/product.js +111 -94
- package/dist/schemas/project.d.ts +512 -449
- package/dist/schemas/project.js +144 -102
- package/dist/schemas/seller.d.ts +10 -10
- package/dist/schemas/user-strike.d.ts +3 -0
- package/dist/schemas/user.d.ts +127 -136
- package/dist/schemas/username.d.ts +1 -0
- package/dist/schemas/view.d.ts +1 -0
- package/dist/types/activity.d.ts +1 -3
- package/dist/types/auth.d.ts +1 -4
- package/dist/types/bookmark.d.ts +1 -3
- package/dist/types/chat.d.ts +1 -11
- package/dist/types/comment.d.ts +1 -5
- package/dist/types/common.d.ts +2 -8
- package/dist/types/discipline.d.ts +1 -11
- package/dist/types/entity-stats.d.ts +1 -3
- package/dist/types/feed.d.ts +1 -5
- package/dist/types/investor-shortlist.d.ts +1 -6
- package/dist/types/investor-signal.d.ts +1 -7
- package/dist/types/like.d.ts +1 -3
- package/dist/types/message.d.ts +1 -9
- package/dist/types/notification.d.ts +1 -9
- package/dist/types/user-strike.d.ts +1 -5
- package/dist/types/username.d.ts +1 -3
- package/package.json +1 -1
- package/src/index.ts +4 -5
- package/src/schemas/activity.ts +5 -4
- package/src/schemas/auth.ts +14 -10
- package/src/schemas/bookmark.ts +48 -29
- package/src/schemas/chat.ts +79 -18
- package/src/schemas/comment.ts +63 -49
- package/src/schemas/common.ts +8 -3
- package/src/schemas/discipline.ts +103 -71
- package/src/schemas/entity-stats.ts +32 -38
- package/src/schemas/feed.ts +62 -15
- package/src/schemas/file.ts +85 -58
- package/src/schemas/index.ts +1 -0
- package/src/schemas/investor-shortlist.ts +57 -8
- package/src/schemas/investor-signal.ts +79 -27
- package/src/schemas/job-application.ts +81 -115
- package/src/schemas/job.ts +160 -301
- package/src/schemas/like.ts +5 -1
- package/src/schemas/message.ts +71 -64
- package/src/schemas/notification.ts +63 -51
- package/src/schemas/payout-method.ts +47 -63
- package/src/schemas/post.ts +211 -272
- package/src/schemas/product.ts +202 -139
- package/src/schemas/project.ts +265 -147
- package/src/schemas/user-strike.ts +7 -1
- package/src/schemas/user.ts +2 -6
- package/src/schemas/username.ts +5 -3
- package/src/schemas/view.ts +0 -50
- package/src/types/activity.ts +0 -4
- package/src/types/auth.ts +0 -5
- package/src/types/bookmark.ts +0 -4
- package/src/types/chat.ts +0 -31
- package/src/types/comment.ts +0 -12
- package/src/types/common.ts +0 -14
- package/src/types/discipline.ts +0 -32
- package/src/types/entity-stats.ts +0 -4
- package/src/types/feed.ts +0 -10
- package/src/types/index.ts +0 -16
- package/src/types/investor-shortlist.ts +0 -18
- package/src/types/investor-signal.ts +0 -26
- package/src/types/like.ts +0 -4
- package/src/types/message.ts +0 -26
- package/src/types/notification.ts +0 -34
- package/src/types/user-strike.ts +0 -10
- package/src/types/username.ts +0 -4
package/dist/index.d.ts
CHANGED
package/dist/index.js
CHANGED
|
@@ -14,7 +14,6 @@ var __exportStar = (this && this.__exportStar) || function(m, exports) {
|
|
|
14
14
|
for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
|
|
15
15
|
};
|
|
16
16
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
17
|
-
__exportStar(require("./types/index"), exports);
|
|
18
17
|
__exportStar(require("./constants"), exports);
|
|
19
18
|
__exportStar(require("./schemas/index"), exports);
|
|
20
19
|
__exportStar(require("./utils/slugify"), exports);
|
package/dist/schemas/auth.d.ts
CHANGED
|
@@ -6,8 +6,10 @@ export declare const RegisterSchema: z.ZodObject<{
|
|
|
6
6
|
username: z.ZodString;
|
|
7
7
|
password: z.ZodString;
|
|
8
8
|
}, z.core.$strip>;
|
|
9
|
+
export type RegisterInput = z.infer<typeof RegisterSchema>;
|
|
9
10
|
export declare const LoginSchema: z.ZodObject<{
|
|
10
11
|
identifier: z.ZodString;
|
|
11
12
|
password: z.ZodString;
|
|
12
13
|
rememberMe: z.ZodBoolean;
|
|
13
14
|
}, z.core.$strip>;
|
|
15
|
+
export type LoginInput = z.infer<typeof LoginSchema>;
|
|
@@ -1,8 +1,55 @@
|
|
|
1
1
|
import { z } from "@hono/zod-openapi";
|
|
2
|
+
/**
|
|
3
|
+
* --------------------------------
|
|
4
|
+
* SHAPE
|
|
5
|
+
* --------------------------------
|
|
6
|
+
*/
|
|
7
|
+
declare const BookmarkShape: z.ZodObject<{
|
|
8
|
+
parentId: z.ZodCUID2;
|
|
9
|
+
parentType: z.ZodEnum<{
|
|
10
|
+
readonly PROJECT: "PROJECT";
|
|
11
|
+
readonly USER: "USER";
|
|
12
|
+
readonly JOB: "JOB";
|
|
13
|
+
readonly POST: "POST";
|
|
14
|
+
readonly PRODUCT: "PRODUCT";
|
|
15
|
+
readonly SIGNAL: "SIGNAL";
|
|
16
|
+
readonly PRODUCT_COVER: "PRODUCT_COVER";
|
|
17
|
+
readonly PRODUCT_DELIVERY: "PRODUCT_DELIVERY";
|
|
18
|
+
readonly COMMENT: "COMMENT";
|
|
19
|
+
readonly JOB_APPLICATION: "JOB_APPLICATION";
|
|
20
|
+
}>;
|
|
21
|
+
}, z.core.$strip>;
|
|
22
|
+
export type BookmarkShapeType = z.infer<typeof BookmarkShape>;
|
|
23
|
+
/**
|
|
24
|
+
* --------------------------------
|
|
25
|
+
* BASE ENTITY
|
|
26
|
+
* --------------------------------
|
|
27
|
+
*/
|
|
2
28
|
export declare const BookmarkEntitySchema: z.ZodObject<{
|
|
29
|
+
createdAt: z.ZodISODateTime;
|
|
30
|
+
parentId: z.ZodCUID2;
|
|
31
|
+
parentType: z.ZodEnum<{
|
|
32
|
+
readonly PROJECT: "PROJECT";
|
|
33
|
+
readonly USER: "USER";
|
|
34
|
+
readonly JOB: "JOB";
|
|
35
|
+
readonly POST: "POST";
|
|
36
|
+
readonly PRODUCT: "PRODUCT";
|
|
37
|
+
readonly SIGNAL: "SIGNAL";
|
|
38
|
+
readonly PRODUCT_COVER: "PRODUCT_COVER";
|
|
39
|
+
readonly PRODUCT_DELIVERY: "PRODUCT_DELIVERY";
|
|
40
|
+
readonly COMMENT: "COMMENT";
|
|
41
|
+
readonly JOB_APPLICATION: "JOB_APPLICATION";
|
|
42
|
+
}>;
|
|
3
43
|
id: z.ZodCUID2;
|
|
4
|
-
createdAt: z.ZodOptional<z.ZodCoercedDate<unknown>>;
|
|
5
44
|
userId: z.ZodCUID2;
|
|
45
|
+
}, z.core.$strip>;
|
|
46
|
+
export type BookmarkEntity = z.infer<typeof BookmarkEntitySchema>;
|
|
47
|
+
/**
|
|
48
|
+
* --------------------------------
|
|
49
|
+
* INPUTS
|
|
50
|
+
* --------------------------------
|
|
51
|
+
*/
|
|
52
|
+
export declare const CreateBookmarkInputSchema: z.ZodObject<{
|
|
6
53
|
parentId: z.ZodCUID2;
|
|
7
54
|
parentType: z.ZodEnum<{
|
|
8
55
|
readonly PROJECT: "PROJECT";
|
|
@@ -17,8 +64,9 @@ export declare const BookmarkEntitySchema: z.ZodObject<{
|
|
|
17
64
|
readonly JOB_APPLICATION: "JOB_APPLICATION";
|
|
18
65
|
}>;
|
|
19
66
|
}, z.core.$strip>;
|
|
20
|
-
export
|
|
21
|
-
|
|
67
|
+
export type CreateBookmarkInput = z.infer<typeof CreateBookmarkInputSchema>;
|
|
68
|
+
export declare const DeleteBookmarkInputSchema: z.ZodObject<{
|
|
69
|
+
parentId: z.ZodCUID2;
|
|
22
70
|
parentType: z.ZodEnum<{
|
|
23
71
|
readonly PROJECT: "PROJECT";
|
|
24
72
|
readonly USER: "USER";
|
|
@@ -31,12 +79,15 @@ export declare const BookmarkInputSchema: z.ZodObject<{
|
|
|
31
79
|
readonly COMMENT: "COMMENT";
|
|
32
80
|
readonly JOB_APPLICATION: "JOB_APPLICATION";
|
|
33
81
|
}>;
|
|
34
|
-
userId: z.ZodString;
|
|
35
82
|
}, z.core.$strip>;
|
|
83
|
+
export type DeleteBookmarkInput = z.infer<typeof DeleteBookmarkInputSchema>;
|
|
84
|
+
/**
|
|
85
|
+
* --------------------------------
|
|
86
|
+
* OUTPUTS
|
|
87
|
+
* --------------------------------
|
|
88
|
+
*/
|
|
36
89
|
export declare const BookmarkOutputSchema: z.ZodObject<{
|
|
37
|
-
|
|
38
|
-
createdAt: z.ZodOptional<z.ZodCoercedDate<unknown>>;
|
|
39
|
-
userId: z.ZodCUID2;
|
|
90
|
+
createdAt: z.ZodISODateTime;
|
|
40
91
|
parentId: z.ZodCUID2;
|
|
41
92
|
parentType: z.ZodEnum<{
|
|
42
93
|
readonly PROJECT: "PROJECT";
|
|
@@ -50,4 +101,8 @@ export declare const BookmarkOutputSchema: z.ZodObject<{
|
|
|
50
101
|
readonly COMMENT: "COMMENT";
|
|
51
102
|
readonly JOB_APPLICATION: "JOB_APPLICATION";
|
|
52
103
|
}>;
|
|
104
|
+
id: z.ZodCUID2;
|
|
105
|
+
userId: z.ZodCUID2;
|
|
53
106
|
}, z.core.$strip>;
|
|
107
|
+
export type BookmarkOutput = z.infer<typeof BookmarkOutputSchema>;
|
|
108
|
+
export {};
|
package/dist/schemas/bookmark.js
CHANGED
|
@@ -1,38 +1,40 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.BookmarkOutputSchema = exports.
|
|
3
|
+
exports.BookmarkOutputSchema = exports.DeleteBookmarkInputSchema = exports.CreateBookmarkInputSchema = exports.BookmarkEntitySchema = void 0;
|
|
4
4
|
const zod_openapi_1 = require("@hono/zod-openapi");
|
|
5
5
|
const constants_1 = require("../constants");
|
|
6
|
+
/**
|
|
7
|
+
* --------------------------------
|
|
8
|
+
* SHAPE
|
|
9
|
+
* --------------------------------
|
|
10
|
+
*/
|
|
11
|
+
const BookmarkShape = zod_openapi_1.z.object({
|
|
12
|
+
parentId: zod_openapi_1.z.cuid2(),
|
|
13
|
+
parentType: zod_openapi_1.z.enum(constants_1.ACTIVITY_PARENT_TYPES),
|
|
14
|
+
});
|
|
15
|
+
/**
|
|
16
|
+
* --------------------------------
|
|
17
|
+
* BASE ENTITY
|
|
18
|
+
* --------------------------------
|
|
19
|
+
*/
|
|
6
20
|
exports.BookmarkEntitySchema = zod_openapi_1.z
|
|
7
21
|
.object({
|
|
8
|
-
id: zod_openapi_1.z.cuid2()
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
createdAt: zod_openapi_1.z.coerce.date().optional().openapi({
|
|
13
|
-
description: "Timestamp when the bookmark was created.",
|
|
14
|
-
title: "Created At",
|
|
15
|
-
}),
|
|
16
|
-
userId: zod_openapi_1.z.cuid2().openapi({
|
|
17
|
-
description: "Identifier of the user who created the bookmark.",
|
|
18
|
-
title: "User ID",
|
|
19
|
-
}),
|
|
20
|
-
parentId: zod_openapi_1.z.cuid2().openapi({
|
|
21
|
-
description: "Identifier of the parent entity that was bookmarked.",
|
|
22
|
-
title: "Parent ID",
|
|
23
|
-
}),
|
|
24
|
-
parentType: zod_openapi_1.z.enum(constants_1.ACTIVITY_PARENT_TYPES).openapi({
|
|
25
|
-
description: "Type of the parent entity this statistic belongs to.",
|
|
26
|
-
title: "Parent Type",
|
|
27
|
-
}),
|
|
22
|
+
id: zod_openapi_1.z.cuid2(),
|
|
23
|
+
userId: zod_openapi_1.z.cuid2(),
|
|
24
|
+
...BookmarkShape.shape,
|
|
25
|
+
createdAt: zod_openapi_1.z.iso.datetime(),
|
|
28
26
|
})
|
|
29
|
-
.openapi(
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
27
|
+
.openapi("Bookmark");
|
|
28
|
+
/**
|
|
29
|
+
* --------------------------------
|
|
30
|
+
* INPUTS
|
|
31
|
+
* --------------------------------
|
|
32
|
+
*/
|
|
33
|
+
exports.CreateBookmarkInputSchema = BookmarkShape.extend({});
|
|
34
|
+
exports.DeleteBookmarkInputSchema = BookmarkShape.extend({});
|
|
35
|
+
/**
|
|
36
|
+
* --------------------------------
|
|
37
|
+
* OUTPUTS
|
|
38
|
+
* --------------------------------
|
|
39
|
+
*/
|
|
38
40
|
exports.BookmarkOutputSchema = exports.BookmarkEntitySchema;
|
package/dist/schemas/brand.d.ts
CHANGED
|
@@ -52,8 +52,8 @@ export declare const BrandEntitySchema: z.ZodObject<{
|
|
|
52
52
|
export type BrandEntity = z.infer<typeof BrandEntitySchema>;
|
|
53
53
|
export declare const MinimalBrandEntitySchema: z.ZodObject<{
|
|
54
54
|
id: z.ZodCUID2;
|
|
55
|
-
createdAt: z.ZodISODateTime;
|
|
56
55
|
userId: z.ZodCUID2;
|
|
56
|
+
createdAt: z.ZodISODateTime;
|
|
57
57
|
updatedAt: z.ZodISODateTime;
|
|
58
58
|
bio: z.ZodDefault<z.ZodString>;
|
|
59
59
|
disciplines: z.ZodDefault<z.ZodArray<z.ZodString>>;
|
|
@@ -62,8 +62,8 @@ export declare const MinimalBrandEntitySchema: z.ZodObject<{
|
|
|
62
62
|
export type MinimalBrandEntity = z.infer<typeof MinimalBrandEntitySchema>;
|
|
63
63
|
export declare const BrandWithUserEntitySchema: z.ZodObject<{
|
|
64
64
|
id: z.ZodCUID2;
|
|
65
|
-
createdAt: z.ZodISODateTime;
|
|
66
65
|
userId: z.ZodCUID2;
|
|
66
|
+
createdAt: z.ZodISODateTime;
|
|
67
67
|
updatedAt: z.ZodISODateTime;
|
|
68
68
|
bio: z.ZodDefault<z.ZodString>;
|
|
69
69
|
disciplines: z.ZodDefault<z.ZodArray<z.ZodString>>;
|
|
@@ -137,8 +137,8 @@ export type SearchBrandInput = z.infer<typeof SearchBrandInputSchema>;
|
|
|
137
137
|
export declare const SearchBrandOutputSchema: z.ZodObject<{
|
|
138
138
|
brands: z.ZodArray<z.ZodObject<{
|
|
139
139
|
id: z.ZodCUID2;
|
|
140
|
-
createdAt: z.ZodISODateTime;
|
|
141
140
|
userId: z.ZodCUID2;
|
|
141
|
+
createdAt: z.ZodISODateTime;
|
|
142
142
|
updatedAt: z.ZodISODateTime;
|
|
143
143
|
bio: z.ZodDefault<z.ZodString>;
|
|
144
144
|
disciplines: z.ZodDefault<z.ZodArray<z.ZodString>>;
|
package/dist/schemas/chat.d.ts
CHANGED
|
@@ -1,6 +1,31 @@
|
|
|
1
1
|
import { z } from "@hono/zod-openapi";
|
|
2
|
+
/**
|
|
3
|
+
* --------------------------------
|
|
4
|
+
* SHAPE
|
|
5
|
+
* --------------------------------
|
|
6
|
+
*/
|
|
7
|
+
declare const ChatShape: z.ZodObject<{
|
|
8
|
+
senderId: z.ZodCUID2;
|
|
9
|
+
receiverId: z.ZodCUID2;
|
|
10
|
+
isMessageRequest: z.ZodDefault<z.ZodBoolean>;
|
|
11
|
+
messageRequestStatus: z.ZodDefault<z.ZodEnum<{
|
|
12
|
+
readonly PENDING: "PENDING";
|
|
13
|
+
readonly ACCEPTED: "ACCEPTED";
|
|
14
|
+
readonly DECLINED: "DECLINED";
|
|
15
|
+
}>>;
|
|
16
|
+
}, z.core.$strip>;
|
|
17
|
+
export type ChatShapeType = z.infer<typeof ChatShape>;
|
|
18
|
+
/**
|
|
19
|
+
* --------------------------------
|
|
20
|
+
* BASE ENTITY
|
|
21
|
+
* --------------------------------
|
|
22
|
+
*/
|
|
2
23
|
export declare const BaseChatEntitySchema: z.ZodObject<{
|
|
3
|
-
|
|
24
|
+
acceptedAt: z.ZodNullable<z.ZodISODateTime>;
|
|
25
|
+
declinedAt: z.ZodNullable<z.ZodISODateTime>;
|
|
26
|
+
createdAt: z.ZodISODateTime;
|
|
27
|
+
updatedAt: z.ZodNullable<z.ZodISODateTime>;
|
|
28
|
+
deletedAt: z.ZodNullable<z.ZodISODateTime>;
|
|
4
29
|
senderId: z.ZodCUID2;
|
|
5
30
|
receiverId: z.ZodCUID2;
|
|
6
31
|
isMessageRequest: z.ZodDefault<z.ZodBoolean>;
|
|
@@ -9,14 +34,20 @@ export declare const BaseChatEntitySchema: z.ZodObject<{
|
|
|
9
34
|
readonly ACCEPTED: "ACCEPTED";
|
|
10
35
|
readonly DECLINED: "DECLINED";
|
|
11
36
|
}>>;
|
|
12
|
-
|
|
13
|
-
declinedAt: z.ZodNullable<z.ZodCoercedDate<unknown>>;
|
|
14
|
-
createdAt: z.ZodCoercedDate<unknown>;
|
|
15
|
-
updatedAt: z.ZodNullable<z.ZodCoercedDate<unknown>>;
|
|
16
|
-
deletedAt: z.ZodNullable<z.ZodCoercedDate<unknown>>;
|
|
37
|
+
id: z.ZodCUID2;
|
|
17
38
|
}, z.core.$strip>;
|
|
39
|
+
export type BaseChatEntity = z.infer<typeof BaseChatEntitySchema>;
|
|
40
|
+
/**
|
|
41
|
+
* --------------------------------
|
|
42
|
+
* DERIVED ENTITIES
|
|
43
|
+
* --------------------------------
|
|
44
|
+
*/
|
|
18
45
|
export declare const ChatEntitySchema: z.ZodObject<{
|
|
19
|
-
|
|
46
|
+
acceptedAt: z.ZodNullable<z.ZodISODateTime>;
|
|
47
|
+
declinedAt: z.ZodNullable<z.ZodISODateTime>;
|
|
48
|
+
createdAt: z.ZodISODateTime;
|
|
49
|
+
updatedAt: z.ZodNullable<z.ZodISODateTime>;
|
|
50
|
+
deletedAt: z.ZodNullable<z.ZodISODateTime>;
|
|
20
51
|
senderId: z.ZodCUID2;
|
|
21
52
|
receiverId: z.ZodCUID2;
|
|
22
53
|
isMessageRequest: z.ZodDefault<z.ZodBoolean>;
|
|
@@ -25,11 +56,7 @@ export declare const ChatEntitySchema: z.ZodObject<{
|
|
|
25
56
|
readonly ACCEPTED: "ACCEPTED";
|
|
26
57
|
readonly DECLINED: "DECLINED";
|
|
27
58
|
}>>;
|
|
28
|
-
|
|
29
|
-
declinedAt: z.ZodNullable<z.ZodCoercedDate<unknown>>;
|
|
30
|
-
createdAt: z.ZodCoercedDate<unknown>;
|
|
31
|
-
updatedAt: z.ZodNullable<z.ZodCoercedDate<unknown>>;
|
|
32
|
-
deletedAt: z.ZodNullable<z.ZodCoercedDate<unknown>>;
|
|
59
|
+
id: z.ZodCUID2;
|
|
33
60
|
senderName: z.ZodString;
|
|
34
61
|
senderUsername: z.ZodString;
|
|
35
62
|
senderImgUrl: z.ZodNullable<z.ZodString>;
|
|
@@ -37,16 +64,43 @@ export declare const ChatEntitySchema: z.ZodObject<{
|
|
|
37
64
|
receiverUsername: z.ZodString;
|
|
38
65
|
receiverImgUrl: z.ZodNullable<z.ZodString>;
|
|
39
66
|
lastMessageSent: z.ZodNullable<z.ZodString>;
|
|
40
|
-
lastMessageAt: z.ZodNullable<z.
|
|
67
|
+
lastMessageAt: z.ZodNullable<z.ZodISODateTime>;
|
|
41
68
|
isUnread: z.ZodDefault<z.ZodBoolean>;
|
|
42
69
|
isOnline: z.ZodDefault<z.ZodBoolean>;
|
|
43
70
|
}, z.core.$strip>;
|
|
71
|
+
export type ChatEntity = z.infer<typeof ChatEntitySchema>;
|
|
72
|
+
/**
|
|
73
|
+
* --------------------------------
|
|
74
|
+
* INPUTS
|
|
75
|
+
* --------------------------------
|
|
76
|
+
*/
|
|
44
77
|
export declare const CreateChatInputSchema: z.ZodObject<{
|
|
45
|
-
senderId: z.ZodCUID2;
|
|
46
78
|
receiverId: z.ZodCUID2;
|
|
47
79
|
}, z.core.$strip>;
|
|
80
|
+
export type CreateChatInput = z.infer<typeof CreateChatInputSchema>;
|
|
81
|
+
export declare const ChatIdInputSchema: z.ZodObject<{
|
|
82
|
+
chatId: z.ZodCUID2;
|
|
83
|
+
}, z.core.$strip>;
|
|
84
|
+
export type ChatIdInput = z.infer<typeof ChatIdInputSchema>;
|
|
85
|
+
export declare const AcceptMessageRequestInputSchema: z.ZodObject<{
|
|
86
|
+
chatId: z.ZodCUID2;
|
|
87
|
+
}, z.core.$strip>;
|
|
88
|
+
export type AcceptMessageRequestInput = z.infer<typeof AcceptMessageRequestInputSchema>;
|
|
89
|
+
export declare const DeclineMessageRequestInputSchema: z.ZodObject<{
|
|
90
|
+
chatId: z.ZodCUID2;
|
|
91
|
+
}, z.core.$strip>;
|
|
92
|
+
export type DeclineMessageRequestInput = z.infer<typeof DeclineMessageRequestInputSchema>;
|
|
93
|
+
/**
|
|
94
|
+
* --------------------------------
|
|
95
|
+
* OUTPUTS
|
|
96
|
+
* --------------------------------
|
|
97
|
+
*/
|
|
48
98
|
export declare const CreateChatOutputSchema: z.ZodObject<{
|
|
49
|
-
|
|
99
|
+
acceptedAt: z.ZodNullable<z.ZodISODateTime>;
|
|
100
|
+
declinedAt: z.ZodNullable<z.ZodISODateTime>;
|
|
101
|
+
createdAt: z.ZodISODateTime;
|
|
102
|
+
updatedAt: z.ZodNullable<z.ZodISODateTime>;
|
|
103
|
+
deletedAt: z.ZodNullable<z.ZodISODateTime>;
|
|
50
104
|
senderId: z.ZodCUID2;
|
|
51
105
|
receiverId: z.ZodCUID2;
|
|
52
106
|
isMessageRequest: z.ZodDefault<z.ZodBoolean>;
|
|
@@ -55,17 +109,15 @@ export declare const CreateChatOutputSchema: z.ZodObject<{
|
|
|
55
109
|
readonly ACCEPTED: "ACCEPTED";
|
|
56
110
|
readonly DECLINED: "DECLINED";
|
|
57
111
|
}>>;
|
|
58
|
-
|
|
59
|
-
declinedAt: z.ZodNullable<z.ZodCoercedDate<unknown>>;
|
|
60
|
-
createdAt: z.ZodCoercedDate<unknown>;
|
|
61
|
-
updatedAt: z.ZodNullable<z.ZodCoercedDate<unknown>>;
|
|
62
|
-
deletedAt: z.ZodNullable<z.ZodCoercedDate<unknown>>;
|
|
63
|
-
}, z.core.$strip>;
|
|
64
|
-
export declare const ChatIdSchema: z.ZodObject<{
|
|
65
|
-
chatId: z.ZodCUID2;
|
|
112
|
+
id: z.ZodCUID2;
|
|
66
113
|
}, z.core.$strip>;
|
|
114
|
+
export type CreateChatOutput = z.infer<typeof CreateChatOutputSchema>;
|
|
67
115
|
export declare const GetChatsOutputSchema: z.ZodArray<z.ZodObject<{
|
|
68
|
-
|
|
116
|
+
acceptedAt: z.ZodNullable<z.ZodISODateTime>;
|
|
117
|
+
declinedAt: z.ZodNullable<z.ZodISODateTime>;
|
|
118
|
+
createdAt: z.ZodISODateTime;
|
|
119
|
+
updatedAt: z.ZodNullable<z.ZodISODateTime>;
|
|
120
|
+
deletedAt: z.ZodNullable<z.ZodISODateTime>;
|
|
69
121
|
senderId: z.ZodCUID2;
|
|
70
122
|
receiverId: z.ZodCUID2;
|
|
71
123
|
isMessageRequest: z.ZodDefault<z.ZodBoolean>;
|
|
@@ -74,11 +126,7 @@ export declare const GetChatsOutputSchema: z.ZodArray<z.ZodObject<{
|
|
|
74
126
|
readonly ACCEPTED: "ACCEPTED";
|
|
75
127
|
readonly DECLINED: "DECLINED";
|
|
76
128
|
}>>;
|
|
77
|
-
|
|
78
|
-
declinedAt: z.ZodNullable<z.ZodCoercedDate<unknown>>;
|
|
79
|
-
createdAt: z.ZodCoercedDate<unknown>;
|
|
80
|
-
updatedAt: z.ZodNullable<z.ZodCoercedDate<unknown>>;
|
|
81
|
-
deletedAt: z.ZodNullable<z.ZodCoercedDate<unknown>>;
|
|
129
|
+
id: z.ZodCUID2;
|
|
82
130
|
senderName: z.ZodString;
|
|
83
131
|
senderUsername: z.ZodString;
|
|
84
132
|
senderImgUrl: z.ZodNullable<z.ZodString>;
|
|
@@ -86,13 +134,18 @@ export declare const GetChatsOutputSchema: z.ZodArray<z.ZodObject<{
|
|
|
86
134
|
receiverUsername: z.ZodString;
|
|
87
135
|
receiverImgUrl: z.ZodNullable<z.ZodString>;
|
|
88
136
|
lastMessageSent: z.ZodNullable<z.ZodString>;
|
|
89
|
-
lastMessageAt: z.ZodNullable<z.
|
|
137
|
+
lastMessageAt: z.ZodNullable<z.ZodISODateTime>;
|
|
90
138
|
isUnread: z.ZodDefault<z.ZodBoolean>;
|
|
91
139
|
isOnline: z.ZodDefault<z.ZodBoolean>;
|
|
92
140
|
}, z.core.$strip>>;
|
|
141
|
+
export type GetChatsOutput = z.infer<typeof GetChatsOutputSchema>;
|
|
93
142
|
export declare const GetChatsForUserOutputSchema: z.ZodObject<{
|
|
94
143
|
chats: z.ZodArray<z.ZodObject<{
|
|
95
|
-
|
|
144
|
+
acceptedAt: z.ZodNullable<z.ZodISODateTime>;
|
|
145
|
+
declinedAt: z.ZodNullable<z.ZodISODateTime>;
|
|
146
|
+
createdAt: z.ZodISODateTime;
|
|
147
|
+
updatedAt: z.ZodNullable<z.ZodISODateTime>;
|
|
148
|
+
deletedAt: z.ZodNullable<z.ZodISODateTime>;
|
|
96
149
|
senderId: z.ZodCUID2;
|
|
97
150
|
receiverId: z.ZodCUID2;
|
|
98
151
|
isMessageRequest: z.ZodDefault<z.ZodBoolean>;
|
|
@@ -101,11 +154,7 @@ export declare const GetChatsForUserOutputSchema: z.ZodObject<{
|
|
|
101
154
|
readonly ACCEPTED: "ACCEPTED";
|
|
102
155
|
readonly DECLINED: "DECLINED";
|
|
103
156
|
}>>;
|
|
104
|
-
|
|
105
|
-
declinedAt: z.ZodNullable<z.ZodCoercedDate<unknown>>;
|
|
106
|
-
createdAt: z.ZodCoercedDate<unknown>;
|
|
107
|
-
updatedAt: z.ZodNullable<z.ZodCoercedDate<unknown>>;
|
|
108
|
-
deletedAt: z.ZodNullable<z.ZodCoercedDate<unknown>>;
|
|
157
|
+
id: z.ZodCUID2;
|
|
109
158
|
senderName: z.ZodString;
|
|
110
159
|
senderUsername: z.ZodString;
|
|
111
160
|
senderImgUrl: z.ZodNullable<z.ZodString>;
|
|
@@ -113,15 +162,20 @@ export declare const GetChatsForUserOutputSchema: z.ZodObject<{
|
|
|
113
162
|
receiverUsername: z.ZodString;
|
|
114
163
|
receiverImgUrl: z.ZodNullable<z.ZodString>;
|
|
115
164
|
lastMessageSent: z.ZodNullable<z.ZodString>;
|
|
116
|
-
lastMessageAt: z.ZodNullable<z.
|
|
165
|
+
lastMessageAt: z.ZodNullable<z.ZodISODateTime>;
|
|
117
166
|
isUnread: z.ZodDefault<z.ZodBoolean>;
|
|
118
167
|
isOnline: z.ZodDefault<z.ZodBoolean>;
|
|
119
168
|
}, z.core.$strip>>;
|
|
120
169
|
nextCursor: z.ZodNullable<z.ZodString>;
|
|
121
170
|
}, z.core.$strip>;
|
|
171
|
+
export type GetChatsForUserOutput = z.infer<typeof GetChatsForUserOutputSchema>;
|
|
122
172
|
export declare const GetMessageRequestsForUserOutputSchema: z.ZodObject<{
|
|
123
173
|
chats: z.ZodArray<z.ZodObject<{
|
|
124
|
-
|
|
174
|
+
acceptedAt: z.ZodNullable<z.ZodISODateTime>;
|
|
175
|
+
declinedAt: z.ZodNullable<z.ZodISODateTime>;
|
|
176
|
+
createdAt: z.ZodISODateTime;
|
|
177
|
+
updatedAt: z.ZodNullable<z.ZodISODateTime>;
|
|
178
|
+
deletedAt: z.ZodNullable<z.ZodISODateTime>;
|
|
125
179
|
senderId: z.ZodCUID2;
|
|
126
180
|
receiverId: z.ZodCUID2;
|
|
127
181
|
isMessageRequest: z.ZodDefault<z.ZodBoolean>;
|
|
@@ -130,11 +184,7 @@ export declare const GetMessageRequestsForUserOutputSchema: z.ZodObject<{
|
|
|
130
184
|
readonly ACCEPTED: "ACCEPTED";
|
|
131
185
|
readonly DECLINED: "DECLINED";
|
|
132
186
|
}>>;
|
|
133
|
-
|
|
134
|
-
declinedAt: z.ZodNullable<z.ZodCoercedDate<unknown>>;
|
|
135
|
-
createdAt: z.ZodCoercedDate<unknown>;
|
|
136
|
-
updatedAt: z.ZodNullable<z.ZodCoercedDate<unknown>>;
|
|
137
|
-
deletedAt: z.ZodNullable<z.ZodCoercedDate<unknown>>;
|
|
187
|
+
id: z.ZodCUID2;
|
|
138
188
|
senderName: z.ZodString;
|
|
139
189
|
senderUsername: z.ZodString;
|
|
140
190
|
senderImgUrl: z.ZodNullable<z.ZodString>;
|
|
@@ -142,17 +192,11 @@ export declare const GetMessageRequestsForUserOutputSchema: z.ZodObject<{
|
|
|
142
192
|
receiverUsername: z.ZodString;
|
|
143
193
|
receiverImgUrl: z.ZodNullable<z.ZodString>;
|
|
144
194
|
lastMessageSent: z.ZodNullable<z.ZodString>;
|
|
145
|
-
lastMessageAt: z.ZodNullable<z.
|
|
195
|
+
lastMessageAt: z.ZodNullable<z.ZodISODateTime>;
|
|
146
196
|
isUnread: z.ZodDefault<z.ZodBoolean>;
|
|
147
197
|
isOnline: z.ZodDefault<z.ZodBoolean>;
|
|
148
198
|
}, z.core.$strip>>;
|
|
149
199
|
nextCursor: z.ZodNullable<z.ZodString>;
|
|
150
200
|
}, z.core.$strip>;
|
|
151
|
-
export
|
|
152
|
-
|
|
153
|
-
userId: z.ZodCUID2;
|
|
154
|
-
}, z.core.$strip>;
|
|
155
|
-
export declare const DeclineMessageRequestInputSchema: z.ZodObject<{
|
|
156
|
-
chatId: z.ZodCUID2;
|
|
157
|
-
userId: z.ZodCUID2;
|
|
158
|
-
}, z.core.$strip>;
|
|
201
|
+
export type GetMessageRequestsForUserOutput = z.infer<typeof GetMessageRequestsForUserOutputSchema>;
|
|
202
|
+
export {};
|
package/dist/schemas/chat.js
CHANGED
|
@@ -1,20 +1,40 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.
|
|
3
|
+
exports.GetMessageRequestsForUserOutputSchema = exports.GetChatsForUserOutputSchema = exports.GetChatsOutputSchema = exports.CreateChatOutputSchema = exports.DeclineMessageRequestInputSchema = exports.AcceptMessageRequestInputSchema = exports.ChatIdInputSchema = exports.CreateChatInputSchema = exports.ChatEntitySchema = exports.BaseChatEntitySchema = void 0;
|
|
4
4
|
const zod_openapi_1 = require("@hono/zod-openapi");
|
|
5
5
|
const constants_1 = require("../constants");
|
|
6
|
-
|
|
7
|
-
|
|
6
|
+
/**
|
|
7
|
+
* --------------------------------
|
|
8
|
+
* SHAPE
|
|
9
|
+
* --------------------------------
|
|
10
|
+
*/
|
|
11
|
+
const ChatShape = zod_openapi_1.z.object({
|
|
8
12
|
senderId: zod_openapi_1.z.cuid2(),
|
|
9
13
|
receiverId: zod_openapi_1.z.cuid2(),
|
|
10
14
|
isMessageRequest: zod_openapi_1.z.boolean().default(true),
|
|
11
15
|
messageRequestStatus: zod_openapi_1.z.enum(constants_1.MESSAGE_REQUEST_STATUS).default("PENDING"),
|
|
12
|
-
acceptedAt: zod_openapi_1.z.coerce.date().nullable(),
|
|
13
|
-
declinedAt: zod_openapi_1.z.coerce.date().nullable(),
|
|
14
|
-
createdAt: zod_openapi_1.z.coerce.date(),
|
|
15
|
-
updatedAt: zod_openapi_1.z.coerce.date().nullable(),
|
|
16
|
-
deletedAt: zod_openapi_1.z.coerce.date().nullable(),
|
|
17
16
|
});
|
|
17
|
+
/**
|
|
18
|
+
* --------------------------------
|
|
19
|
+
* BASE ENTITY
|
|
20
|
+
* --------------------------------
|
|
21
|
+
*/
|
|
22
|
+
exports.BaseChatEntitySchema = zod_openapi_1.z
|
|
23
|
+
.object({
|
|
24
|
+
id: zod_openapi_1.z.cuid2(),
|
|
25
|
+
...ChatShape.shape,
|
|
26
|
+
acceptedAt: zod_openapi_1.z.iso.datetime().nullable(),
|
|
27
|
+
declinedAt: zod_openapi_1.z.iso.datetime().nullable(),
|
|
28
|
+
createdAt: zod_openapi_1.z.iso.datetime(),
|
|
29
|
+
updatedAt: zod_openapi_1.z.iso.datetime().nullable(),
|
|
30
|
+
deletedAt: zod_openapi_1.z.iso.datetime().nullable(),
|
|
31
|
+
})
|
|
32
|
+
.openapi("BaseChat");
|
|
33
|
+
/**
|
|
34
|
+
* --------------------------------
|
|
35
|
+
* DERIVED ENTITIES
|
|
36
|
+
* --------------------------------
|
|
37
|
+
*/
|
|
18
38
|
exports.ChatEntitySchema = exports.BaseChatEntitySchema.extend({
|
|
19
39
|
senderName: zod_openapi_1.z.string(),
|
|
20
40
|
senderUsername: zod_openapi_1.z.string(),
|
|
@@ -23,26 +43,32 @@ exports.ChatEntitySchema = exports.BaseChatEntitySchema.extend({
|
|
|
23
43
|
receiverUsername: zod_openapi_1.z.string(),
|
|
24
44
|
receiverImgUrl: zod_openapi_1.z.string().nullable(),
|
|
25
45
|
lastMessageSent: zod_openapi_1.z.string().nullable(),
|
|
26
|
-
lastMessageAt: zod_openapi_1.z.
|
|
46
|
+
lastMessageAt: zod_openapi_1.z.iso.datetime().nullable(),
|
|
27
47
|
isUnread: zod_openapi_1.z.boolean().default(false),
|
|
28
48
|
isOnline: zod_openapi_1.z.boolean().default(false),
|
|
29
|
-
});
|
|
49
|
+
}).openapi("Chat");
|
|
50
|
+
/**
|
|
51
|
+
* --------------------------------
|
|
52
|
+
* INPUTS
|
|
53
|
+
* --------------------------------
|
|
54
|
+
*/
|
|
30
55
|
exports.CreateChatInputSchema = zod_openapi_1.z.object({
|
|
31
|
-
senderId: zod_openapi_1.z.cuid2(),
|
|
32
56
|
receiverId: zod_openapi_1.z.cuid2(),
|
|
33
57
|
});
|
|
34
|
-
exports.
|
|
35
|
-
exports.ChatIdSchema = zod_openapi_1.z.object({
|
|
58
|
+
exports.ChatIdInputSchema = zod_openapi_1.z.object({
|
|
36
59
|
chatId: zod_openapi_1.z.cuid2(),
|
|
37
60
|
});
|
|
61
|
+
exports.AcceptMessageRequestInputSchema = exports.ChatIdInputSchema.extend({});
|
|
62
|
+
exports.DeclineMessageRequestInputSchema = exports.ChatIdInputSchema.extend({});
|
|
63
|
+
/**
|
|
64
|
+
* --------------------------------
|
|
65
|
+
* OUTPUTS
|
|
66
|
+
* --------------------------------
|
|
67
|
+
*/
|
|
68
|
+
exports.CreateChatOutputSchema = exports.BaseChatEntitySchema;
|
|
38
69
|
exports.GetChatsOutputSchema = zod_openapi_1.z.array(exports.ChatEntitySchema);
|
|
39
70
|
exports.GetChatsForUserOutputSchema = zod_openapi_1.z.object({
|
|
40
71
|
chats: zod_openapi_1.z.array(exports.ChatEntitySchema),
|
|
41
72
|
nextCursor: zod_openapi_1.z.string().nullable(),
|
|
42
73
|
});
|
|
43
74
|
exports.GetMessageRequestsForUserOutputSchema = exports.GetChatsForUserOutputSchema;
|
|
44
|
-
exports.AcceptMessageRequestInputSchema = zod_openapi_1.z.object({
|
|
45
|
-
chatId: zod_openapi_1.z.cuid2(),
|
|
46
|
-
userId: zod_openapi_1.z.cuid2(),
|
|
47
|
-
});
|
|
48
|
-
exports.DeclineMessageRequestInputSchema = exports.AcceptMessageRequestInputSchema;
|