@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
|
@@ -1,16 +1,12 @@
|
|
|
1
1
|
import { z } from "@hono/zod-openapi";
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
export declare const MessageEntitySchema: z.ZodObject<{
|
|
9
|
-
id: z.ZodCUID2;
|
|
2
|
+
/**
|
|
3
|
+
* --------------------------------
|
|
4
|
+
* SHAPE
|
|
5
|
+
* --------------------------------
|
|
6
|
+
*/
|
|
7
|
+
declare const MessageShape: z.ZodObject<{
|
|
10
8
|
chatId: z.ZodCUID2;
|
|
11
|
-
|
|
12
|
-
receiverId: z.ZodCUID2;
|
|
13
|
-
content: z.ZodDefault<z.ZodOptional<z.ZodString>>;
|
|
9
|
+
content: z.ZodOptional<z.ZodString>;
|
|
14
10
|
messageType: z.ZodDefault<z.ZodEnum<{
|
|
15
11
|
readonly MARKETPLACE: "MARKETPLACE";
|
|
16
12
|
readonly PROJECT: "PROJECT";
|
|
@@ -34,6 +30,20 @@ export declare const MessageEntitySchema: z.ZodObject<{
|
|
|
34
30
|
readonly JOB_APPLICATION: "JOB_APPLICATION";
|
|
35
31
|
}>>;
|
|
36
32
|
replyToMessageId: z.ZodOptional<z.ZodCUID2>;
|
|
33
|
+
linkMeta: z.ZodOptional<z.ZodObject<{
|
|
34
|
+
url: z.ZodURL;
|
|
35
|
+
title: z.ZodOptional<z.ZodString>;
|
|
36
|
+
description: z.ZodOptional<z.ZodString>;
|
|
37
|
+
image: z.ZodOptional<z.ZodURL>;
|
|
38
|
+
}, z.core.$strip>>;
|
|
39
|
+
}, z.core.$strip>;
|
|
40
|
+
export type MessageShapeType = z.infer<typeof MessageShape>;
|
|
41
|
+
/**
|
|
42
|
+
* --------------------------------
|
|
43
|
+
* BASE ENTITY
|
|
44
|
+
* --------------------------------
|
|
45
|
+
*/
|
|
46
|
+
export declare const MessageEntitySchema: z.ZodObject<{
|
|
37
47
|
replyToContent: z.ZodOptional<z.ZodString>;
|
|
38
48
|
replyToImages: z.ZodOptional<z.ZodArray<z.ZodURL>>;
|
|
39
49
|
replyToLinkMeta: z.ZodOptional<z.ZodObject<{
|
|
@@ -42,36 +52,72 @@ export declare const MessageEntitySchema: z.ZodObject<{
|
|
|
42
52
|
description: z.ZodOptional<z.ZodString>;
|
|
43
53
|
image: z.ZodOptional<z.ZodURL>;
|
|
44
54
|
}, z.core.$strip>>;
|
|
55
|
+
deletedBySender: z.ZodDefault<z.ZodBoolean>;
|
|
56
|
+
deletedByReceiver: z.ZodDefault<z.ZodBoolean>;
|
|
57
|
+
isEdited: z.ZodDefault<z.ZodBoolean>;
|
|
58
|
+
createdAt: z.ZodISODateTime;
|
|
59
|
+
updatedAt: z.ZodOptional<z.ZodISODateTime>;
|
|
60
|
+
deletedAt: z.ZodOptional<z.ZodISODateTime>;
|
|
61
|
+
chatId: z.ZodCUID2;
|
|
62
|
+
content: z.ZodOptional<z.ZodString>;
|
|
63
|
+
messageType: z.ZodDefault<z.ZodEnum<{
|
|
64
|
+
readonly MARKETPLACE: "MARKETPLACE";
|
|
65
|
+
readonly PROJECT: "PROJECT";
|
|
66
|
+
readonly JOB_OPENING: "JOB_OPENING";
|
|
67
|
+
readonly DEFAULT_MESSAGE: "DEFAULT_MESSAGE";
|
|
68
|
+
readonly MESSAGE_WITH_LINKS: "MESSAGE_WITH_LINKS";
|
|
69
|
+
readonly MESSAGE_WITH_MEDIA: "MESSAGE_WITH_MEDIA";
|
|
70
|
+
readonly MESSAGE_WITH_MEDIA_AND_LINKS: "MESSAGE_WITH_MEDIA_AND_LINKS";
|
|
71
|
+
}>>;
|
|
72
|
+
parentId: z.ZodOptional<z.ZodCUID2>;
|
|
73
|
+
parentType: z.ZodOptional<z.ZodEnum<{
|
|
74
|
+
readonly PROJECT: "PROJECT";
|
|
75
|
+
readonly USER: "USER";
|
|
76
|
+
readonly JOB: "JOB";
|
|
77
|
+
readonly POST: "POST";
|
|
78
|
+
readonly PRODUCT: "PRODUCT";
|
|
79
|
+
readonly SIGNAL: "SIGNAL";
|
|
80
|
+
readonly PRODUCT_COVER: "PRODUCT_COVER";
|
|
81
|
+
readonly PRODUCT_DELIVERY: "PRODUCT_DELIVERY";
|
|
82
|
+
readonly COMMENT: "COMMENT";
|
|
83
|
+
readonly JOB_APPLICATION: "JOB_APPLICATION";
|
|
84
|
+
}>>;
|
|
85
|
+
replyToMessageId: z.ZodOptional<z.ZodCUID2>;
|
|
45
86
|
linkMeta: z.ZodOptional<z.ZodObject<{
|
|
46
87
|
url: z.ZodURL;
|
|
47
88
|
title: z.ZodOptional<z.ZodString>;
|
|
48
89
|
description: z.ZodOptional<z.ZodString>;
|
|
49
90
|
image: z.ZodOptional<z.ZodURL>;
|
|
50
91
|
}, z.core.$strip>>;
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
deletedByReceiver: z.ZodDefault<z.ZodBoolean>;
|
|
55
|
-
isEdited: z.ZodDefault<z.ZodBoolean>;
|
|
56
|
-
deletedAt: z.ZodOptional<z.ZodCoercedDate<unknown>>;
|
|
57
|
-
}, z.core.$strip>;
|
|
58
|
-
export declare const DeleteMessagesInputSchema: z.ZodObject<{
|
|
59
|
-
messageIds: z.ZodArray<z.ZodCUID2>;
|
|
60
|
-
deleteForEveryone: z.ZodDefault<z.ZodBoolean>;
|
|
92
|
+
id: z.ZodCUID2;
|
|
93
|
+
senderId: z.ZodCUID2;
|
|
94
|
+
receiverId: z.ZodCUID2;
|
|
61
95
|
}, z.core.$strip>;
|
|
96
|
+
export type MessageEntity = z.infer<typeof MessageEntitySchema>;
|
|
62
97
|
export declare const MessageFileEntitySchema: z.ZodObject<{
|
|
63
98
|
id: z.ZodCUID2;
|
|
64
99
|
messageId: z.ZodCUID2;
|
|
65
100
|
fileId: z.ZodCUID2;
|
|
66
101
|
url: z.ZodURL;
|
|
67
|
-
order: z.
|
|
102
|
+
order: z.ZodInt;
|
|
68
103
|
}, z.core.$strip>;
|
|
69
104
|
export declare const MessageWithFilesEntitySchema: z.ZodObject<{
|
|
70
|
-
|
|
105
|
+
replyToContent: z.ZodOptional<z.ZodString>;
|
|
106
|
+
replyToImages: z.ZodOptional<z.ZodArray<z.ZodURL>>;
|
|
107
|
+
replyToLinkMeta: z.ZodOptional<z.ZodObject<{
|
|
108
|
+
url: z.ZodURL;
|
|
109
|
+
title: z.ZodOptional<z.ZodString>;
|
|
110
|
+
description: z.ZodOptional<z.ZodString>;
|
|
111
|
+
image: z.ZodOptional<z.ZodURL>;
|
|
112
|
+
}, z.core.$strip>>;
|
|
113
|
+
deletedBySender: z.ZodDefault<z.ZodBoolean>;
|
|
114
|
+
deletedByReceiver: z.ZodDefault<z.ZodBoolean>;
|
|
115
|
+
isEdited: z.ZodDefault<z.ZodBoolean>;
|
|
116
|
+
createdAt: z.ZodISODateTime;
|
|
117
|
+
updatedAt: z.ZodOptional<z.ZodISODateTime>;
|
|
118
|
+
deletedAt: z.ZodOptional<z.ZodISODateTime>;
|
|
71
119
|
chatId: z.ZodCUID2;
|
|
72
|
-
|
|
73
|
-
receiverId: z.ZodCUID2;
|
|
74
|
-
content: z.ZodDefault<z.ZodOptional<z.ZodString>>;
|
|
120
|
+
content: z.ZodOptional<z.ZodString>;
|
|
75
121
|
messageType: z.ZodDefault<z.ZodEnum<{
|
|
76
122
|
readonly MARKETPLACE: "MARKETPLACE";
|
|
77
123
|
readonly PROJECT: "PROJECT";
|
|
@@ -95,39 +141,30 @@ export declare const MessageWithFilesEntitySchema: z.ZodObject<{
|
|
|
95
141
|
readonly JOB_APPLICATION: "JOB_APPLICATION";
|
|
96
142
|
}>>;
|
|
97
143
|
replyToMessageId: z.ZodOptional<z.ZodCUID2>;
|
|
98
|
-
replyToContent: z.ZodOptional<z.ZodString>;
|
|
99
|
-
replyToImages: z.ZodOptional<z.ZodArray<z.ZodURL>>;
|
|
100
|
-
replyToLinkMeta: z.ZodOptional<z.ZodObject<{
|
|
101
|
-
url: z.ZodURL;
|
|
102
|
-
title: z.ZodOptional<z.ZodString>;
|
|
103
|
-
description: z.ZodOptional<z.ZodString>;
|
|
104
|
-
image: z.ZodOptional<z.ZodURL>;
|
|
105
|
-
}, z.core.$strip>>;
|
|
106
144
|
linkMeta: z.ZodOptional<z.ZodObject<{
|
|
107
145
|
url: z.ZodURL;
|
|
108
146
|
title: z.ZodOptional<z.ZodString>;
|
|
109
147
|
description: z.ZodOptional<z.ZodString>;
|
|
110
148
|
image: z.ZodOptional<z.ZodURL>;
|
|
111
149
|
}, z.core.$strip>>;
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
isEdited: z.ZodDefault<z.ZodBoolean>;
|
|
117
|
-
deletedAt: z.ZodOptional<z.ZodCoercedDate<unknown>>;
|
|
118
|
-
messageFiles: z.ZodDefault<z.ZodArray<z.ZodObject<{
|
|
150
|
+
id: z.ZodCUID2;
|
|
151
|
+
senderId: z.ZodCUID2;
|
|
152
|
+
receiverId: z.ZodCUID2;
|
|
153
|
+
messageFiles: z.ZodArray<z.ZodObject<{
|
|
119
154
|
id: z.ZodCUID2;
|
|
120
155
|
messageId: z.ZodCUID2;
|
|
121
156
|
fileId: z.ZodCUID2;
|
|
122
157
|
url: z.ZodURL;
|
|
123
|
-
order: z.
|
|
124
|
-
}, z.core.$strip
|
|
158
|
+
order: z.ZodInt;
|
|
159
|
+
}, z.core.$strip>>;
|
|
125
160
|
}, z.core.$strip>;
|
|
161
|
+
/**
|
|
162
|
+
* --------------------------------
|
|
163
|
+
* INPUTS
|
|
164
|
+
* --------------------------------
|
|
165
|
+
*/
|
|
126
166
|
export declare const CreateMessageInputSchema: z.ZodObject<{
|
|
127
|
-
id: z.ZodCUID2;
|
|
128
167
|
chatId: z.ZodCUID2;
|
|
129
|
-
senderId: z.ZodCUID2;
|
|
130
|
-
receiverId: z.ZodCUID2;
|
|
131
168
|
content: z.ZodOptional<z.ZodString>;
|
|
132
169
|
messageType: z.ZodDefault<z.ZodEnum<{
|
|
133
170
|
readonly MARKETPLACE: "MARKETPLACE";
|
|
@@ -139,6 +176,18 @@ export declare const CreateMessageInputSchema: z.ZodObject<{
|
|
|
139
176
|
readonly MESSAGE_WITH_MEDIA_AND_LINKS: "MESSAGE_WITH_MEDIA_AND_LINKS";
|
|
140
177
|
}>>;
|
|
141
178
|
parentId: z.ZodOptional<z.ZodCUID2>;
|
|
179
|
+
parentType: z.ZodOptional<z.ZodEnum<{
|
|
180
|
+
readonly PROJECT: "PROJECT";
|
|
181
|
+
readonly USER: "USER";
|
|
182
|
+
readonly JOB: "JOB";
|
|
183
|
+
readonly POST: "POST";
|
|
184
|
+
readonly PRODUCT: "PRODUCT";
|
|
185
|
+
readonly SIGNAL: "SIGNAL";
|
|
186
|
+
readonly PRODUCT_COVER: "PRODUCT_COVER";
|
|
187
|
+
readonly PRODUCT_DELIVERY: "PRODUCT_DELIVERY";
|
|
188
|
+
readonly COMMENT: "COMMENT";
|
|
189
|
+
readonly JOB_APPLICATION: "JOB_APPLICATION";
|
|
190
|
+
}>>;
|
|
142
191
|
replyToMessageId: z.ZodOptional<z.ZodCUID2>;
|
|
143
192
|
linkMeta: z.ZodOptional<z.ZodObject<{
|
|
144
193
|
url: z.ZodURL;
|
|
@@ -149,38 +198,36 @@ export declare const CreateMessageInputSchema: z.ZodObject<{
|
|
|
149
198
|
files: z.ZodOptional<z.ZodArray<z.ZodObject<{
|
|
150
199
|
key: z.ZodString;
|
|
151
200
|
mimeType: z.ZodString;
|
|
152
|
-
|
|
153
|
-
parentType: z.ZodOptional<z.ZodEnum<{
|
|
154
|
-
readonly PROJECT: "PROJECT";
|
|
155
|
-
readonly USER: "USER";
|
|
156
|
-
readonly JOB: "JOB";
|
|
157
|
-
readonly POST: "POST";
|
|
158
|
-
readonly PRODUCT: "PRODUCT";
|
|
159
|
-
readonly SIGNAL: "SIGNAL";
|
|
160
|
-
readonly PRODUCT_COVER: "PRODUCT_COVER";
|
|
161
|
-
readonly PRODUCT_DELIVERY: "PRODUCT_DELIVERY";
|
|
162
|
-
readonly COMMENT: "COMMENT";
|
|
163
|
-
readonly JOB_APPLICATION: "JOB_APPLICATION";
|
|
164
|
-
}>>;
|
|
165
|
-
isThumbnail: z.ZodOptional<z.ZodBoolean>;
|
|
166
|
-
order: z.ZodNumber;
|
|
201
|
+
order: z.ZodInt;
|
|
167
202
|
}, z.core.$strip>>>;
|
|
168
203
|
}, z.core.$strip>;
|
|
169
204
|
export declare const EditMessageInputSchema: z.ZodObject<{
|
|
170
|
-
|
|
171
|
-
chatId: z.ZodCUID2;
|
|
172
|
-
senderId: z.ZodCUID2;
|
|
173
|
-
receiverId: z.ZodCUID2;
|
|
205
|
+
messageId: z.ZodCUID2;
|
|
174
206
|
content: z.ZodOptional<z.ZodString>;
|
|
175
|
-
isEdited: z.ZodDefault<z.ZodBoolean>;
|
|
176
207
|
}, z.core.$strip>;
|
|
208
|
+
/**
|
|
209
|
+
* --------------------------------
|
|
210
|
+
* OUTPUTS
|
|
211
|
+
* --------------------------------
|
|
212
|
+
*/
|
|
177
213
|
export declare const GetMessagesOutputSchema: z.ZodObject<{
|
|
178
214
|
messages: z.ZodArray<z.ZodObject<{
|
|
179
|
-
|
|
215
|
+
replyToContent: z.ZodOptional<z.ZodString>;
|
|
216
|
+
replyToImages: z.ZodOptional<z.ZodArray<z.ZodURL>>;
|
|
217
|
+
replyToLinkMeta: z.ZodOptional<z.ZodObject<{
|
|
218
|
+
url: z.ZodURL;
|
|
219
|
+
title: z.ZodOptional<z.ZodString>;
|
|
220
|
+
description: z.ZodOptional<z.ZodString>;
|
|
221
|
+
image: z.ZodOptional<z.ZodURL>;
|
|
222
|
+
}, z.core.$strip>>;
|
|
223
|
+
deletedBySender: z.ZodDefault<z.ZodBoolean>;
|
|
224
|
+
deletedByReceiver: z.ZodDefault<z.ZodBoolean>;
|
|
225
|
+
isEdited: z.ZodDefault<z.ZodBoolean>;
|
|
226
|
+
createdAt: z.ZodISODateTime;
|
|
227
|
+
updatedAt: z.ZodOptional<z.ZodISODateTime>;
|
|
228
|
+
deletedAt: z.ZodOptional<z.ZodISODateTime>;
|
|
180
229
|
chatId: z.ZodCUID2;
|
|
181
|
-
|
|
182
|
-
receiverId: z.ZodCUID2;
|
|
183
|
-
content: z.ZodDefault<z.ZodOptional<z.ZodString>>;
|
|
230
|
+
content: z.ZodOptional<z.ZodString>;
|
|
184
231
|
messageType: z.ZodDefault<z.ZodEnum<{
|
|
185
232
|
readonly MARKETPLACE: "MARKETPLACE";
|
|
186
233
|
readonly PROJECT: "PROJECT";
|
|
@@ -204,39 +251,23 @@ export declare const GetMessagesOutputSchema: z.ZodObject<{
|
|
|
204
251
|
readonly JOB_APPLICATION: "JOB_APPLICATION";
|
|
205
252
|
}>>;
|
|
206
253
|
replyToMessageId: z.ZodOptional<z.ZodCUID2>;
|
|
207
|
-
replyToContent: z.ZodOptional<z.ZodString>;
|
|
208
|
-
replyToImages: z.ZodOptional<z.ZodArray<z.ZodURL>>;
|
|
209
|
-
replyToLinkMeta: z.ZodOptional<z.ZodObject<{
|
|
210
|
-
url: z.ZodURL;
|
|
211
|
-
title: z.ZodOptional<z.ZodString>;
|
|
212
|
-
description: z.ZodOptional<z.ZodString>;
|
|
213
|
-
image: z.ZodOptional<z.ZodURL>;
|
|
214
|
-
}, z.core.$strip>>;
|
|
215
254
|
linkMeta: z.ZodOptional<z.ZodObject<{
|
|
216
255
|
url: z.ZodURL;
|
|
217
256
|
title: z.ZodOptional<z.ZodString>;
|
|
218
257
|
description: z.ZodOptional<z.ZodString>;
|
|
219
258
|
image: z.ZodOptional<z.ZodURL>;
|
|
220
259
|
}, z.core.$strip>>;
|
|
221
|
-
|
|
222
|
-
|
|
223
|
-
|
|
224
|
-
|
|
225
|
-
isEdited: z.ZodDefault<z.ZodBoolean>;
|
|
226
|
-
deletedAt: z.ZodOptional<z.ZodCoercedDate<unknown>>;
|
|
227
|
-
messageFiles: z.ZodDefault<z.ZodArray<z.ZodObject<{
|
|
260
|
+
id: z.ZodCUID2;
|
|
261
|
+
senderId: z.ZodCUID2;
|
|
262
|
+
receiverId: z.ZodCUID2;
|
|
263
|
+
messageFiles: z.ZodArray<z.ZodObject<{
|
|
228
264
|
id: z.ZodCUID2;
|
|
229
265
|
messageId: z.ZodCUID2;
|
|
230
266
|
fileId: z.ZodCUID2;
|
|
231
267
|
url: z.ZodURL;
|
|
232
|
-
order: z.
|
|
233
|
-
}, z.core.$strip
|
|
268
|
+
order: z.ZodInt;
|
|
269
|
+
}, z.core.$strip>>;
|
|
234
270
|
}, z.core.$strip>>;
|
|
235
|
-
nextCursor: z.
|
|
236
|
-
}, z.core.$strip>;
|
|
237
|
-
export declare const MessageIdSchema: z.ZodObject<{
|
|
238
|
-
messageId: z.ZodCUID2;
|
|
239
|
-
}, z.core.$strip>;
|
|
240
|
-
export declare const ChatIdParamSchema: z.ZodObject<{
|
|
241
|
-
chatId: z.ZodCUID2;
|
|
271
|
+
nextCursor: z.ZodOptional<z.ZodString>;
|
|
242
272
|
}, z.core.$strip>;
|
|
273
|
+
export {};
|
package/dist/schemas/message.js
CHANGED
|
@@ -1,86 +1,85 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.
|
|
3
|
+
exports.GetMessagesOutputSchema = exports.EditMessageInputSchema = exports.CreateMessageInputSchema = exports.MessageWithFilesEntitySchema = exports.MessageFileEntitySchema = exports.MessageEntitySchema = void 0;
|
|
4
4
|
const zod_openapi_1 = require("@hono/zod-openapi");
|
|
5
5
|
const constants_1 = require("../constants");
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
image: zod_openapi_1.z.url().optional(),
|
|
13
|
-
});
|
|
14
|
-
// 2. The API Output Schema (Enriched)
|
|
15
|
-
exports.MessageEntitySchema = zod_openapi_1.z.object({
|
|
16
|
-
id: zod_openapi_1.z.cuid2(),
|
|
6
|
+
/**
|
|
7
|
+
* --------------------------------
|
|
8
|
+
* SHAPE
|
|
9
|
+
* --------------------------------
|
|
10
|
+
*/
|
|
11
|
+
const MessageShape = zod_openapi_1.z.object({
|
|
17
12
|
chatId: zod_openapi_1.z.cuid2(),
|
|
18
|
-
|
|
19
|
-
receiverId: zod_openapi_1.z.cuid2(),
|
|
20
|
-
// Content & Type
|
|
21
|
-
content: zod_openapi_1.z.string().optional().default(""),
|
|
13
|
+
content: zod_openapi_1.z.string().optional(),
|
|
22
14
|
messageType: zod_openapi_1.z.enum(constants_1.MESSAGE_TYPES).default("DEFAULT_MESSAGE"),
|
|
23
|
-
// Parent/Threading
|
|
24
15
|
parentId: zod_openapi_1.z.cuid2().optional(),
|
|
25
16
|
parentType: zod_openapi_1.z.enum(constants_1.ACTIVITY_PARENT_TYPES).optional(),
|
|
26
|
-
// Reply Context
|
|
27
17
|
replyToMessageId: zod_openapi_1.z.cuid2().optional(),
|
|
18
|
+
linkMeta: zod_openapi_1.z
|
|
19
|
+
.object({
|
|
20
|
+
url: zod_openapi_1.z.url(),
|
|
21
|
+
title: zod_openapi_1.z.string().optional(),
|
|
22
|
+
description: zod_openapi_1.z.string().optional(),
|
|
23
|
+
image: zod_openapi_1.z.url().optional(),
|
|
24
|
+
})
|
|
25
|
+
.optional(),
|
|
26
|
+
});
|
|
27
|
+
/**
|
|
28
|
+
* --------------------------------
|
|
29
|
+
* BASE ENTITY
|
|
30
|
+
* --------------------------------
|
|
31
|
+
*/
|
|
32
|
+
exports.MessageEntitySchema = zod_openapi_1.z
|
|
33
|
+
.object({
|
|
34
|
+
id: zod_openapi_1.z.cuid2(),
|
|
35
|
+
senderId: zod_openapi_1.z.cuid2(),
|
|
36
|
+
receiverId: zod_openapi_1.z.cuid2(),
|
|
37
|
+
...MessageShape.shape,
|
|
28
38
|
replyToContent: zod_openapi_1.z.string().optional(),
|
|
29
39
|
replyToImages: zod_openapi_1.z.array(zod_openapi_1.z.url()).optional(),
|
|
30
|
-
replyToLinkMeta:
|
|
31
|
-
// Metadata
|
|
32
|
-
linkMeta: exports.LinkMetaSchema.optional(),
|
|
33
|
-
createdAt: zod_openapi_1.z.coerce.date(),
|
|
34
|
-
updatedAt: zod_openapi_1.z.coerce.date().optional(),
|
|
40
|
+
replyToLinkMeta: MessageShape.shape.linkMeta,
|
|
35
41
|
deletedBySender: zod_openapi_1.z.boolean().default(false),
|
|
36
42
|
deletedByReceiver: zod_openapi_1.z.boolean().default(false),
|
|
37
43
|
isEdited: zod_openapi_1.z.boolean().default(false),
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
});
|
|
44
|
+
createdAt: zod_openapi_1.z.iso.datetime(),
|
|
45
|
+
updatedAt: zod_openapi_1.z.iso.datetime().optional(),
|
|
46
|
+
deletedAt: zod_openapi_1.z.iso.datetime().optional(),
|
|
47
|
+
})
|
|
48
|
+
.openapi("Message");
|
|
44
49
|
exports.MessageFileEntitySchema = zod_openapi_1.z.object({
|
|
45
50
|
id: zod_openapi_1.z.cuid2(),
|
|
46
51
|
messageId: zod_openapi_1.z.cuid2(),
|
|
47
52
|
fileId: zod_openapi_1.z.cuid2(),
|
|
48
53
|
url: zod_openapi_1.z.url(),
|
|
49
|
-
order: zod_openapi_1.z.
|
|
54
|
+
order: zod_openapi_1.z.int(),
|
|
50
55
|
});
|
|
51
56
|
exports.MessageWithFilesEntitySchema = exports.MessageEntitySchema.extend({
|
|
52
|
-
messageFiles: zod_openapi_1.z.array(exports.MessageFileEntitySchema)
|
|
57
|
+
messageFiles: zod_openapi_1.z.array(exports.MessageFileEntitySchema),
|
|
53
58
|
});
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
content: zod_openapi_1.z.string().optional(),
|
|
61
|
-
messageType: zod_openapi_1.z.enum(constants_1.MESSAGE_TYPES).default("DEFAULT_MESSAGE"),
|
|
62
|
-
parentId: zod_openapi_1.z.cuid2().optional(),
|
|
63
|
-
replyToMessageId: zod_openapi_1.z.cuid2().optional(),
|
|
64
|
-
linkMeta: exports.LinkMetaSchema.optional(),
|
|
59
|
+
/**
|
|
60
|
+
* --------------------------------
|
|
61
|
+
* INPUTS
|
|
62
|
+
* --------------------------------
|
|
63
|
+
*/
|
|
64
|
+
exports.CreateMessageInputSchema = MessageShape.extend({
|
|
65
65
|
files: zod_openapi_1.z
|
|
66
|
-
.array(
|
|
66
|
+
.array(zod_openapi_1.z.object({
|
|
67
|
+
key: zod_openapi_1.z.string(),
|
|
68
|
+
mimeType: zod_openapi_1.z.string(),
|
|
69
|
+
order: zod_openapi_1.z.int(),
|
|
70
|
+
}))
|
|
67
71
|
.optional(),
|
|
68
72
|
});
|
|
69
73
|
exports.EditMessageInputSchema = zod_openapi_1.z.object({
|
|
70
|
-
|
|
71
|
-
chatId: zod_openapi_1.z.cuid2(),
|
|
72
|
-
senderId: zod_openapi_1.z.cuid2(),
|
|
73
|
-
receiverId: zod_openapi_1.z.cuid2(),
|
|
74
|
+
messageId: zod_openapi_1.z.cuid2(),
|
|
74
75
|
content: zod_openapi_1.z.string().optional(),
|
|
75
|
-
isEdited: zod_openapi_1.z.boolean().default(true),
|
|
76
76
|
});
|
|
77
|
+
/**
|
|
78
|
+
* --------------------------------
|
|
79
|
+
* OUTPUTS
|
|
80
|
+
* --------------------------------
|
|
81
|
+
*/
|
|
77
82
|
exports.GetMessagesOutputSchema = zod_openapi_1.z.object({
|
|
78
83
|
messages: zod_openapi_1.z.array(exports.MessageWithFilesEntitySchema),
|
|
79
|
-
nextCursor: zod_openapi_1.z.string().
|
|
80
|
-
});
|
|
81
|
-
exports.MessageIdSchema = zod_openapi_1.z.object({
|
|
82
|
-
messageId: zod_openapi_1.z.cuid2(),
|
|
83
|
-
});
|
|
84
|
-
exports.ChatIdParamSchema = zod_openapi_1.z.object({
|
|
85
|
-
chatId: zod_openapi_1.z.cuid2(),
|
|
84
|
+
nextCursor: zod_openapi_1.z.string().optional(),
|
|
86
85
|
});
|
|
@@ -1,8 +1,12 @@
|
|
|
1
1
|
import { z } from "@hono/zod-openapi";
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
2
|
+
/**
|
|
3
|
+
* --------------------------------
|
|
4
|
+
* SHAPE
|
|
5
|
+
* --------------------------------
|
|
6
|
+
*/
|
|
7
|
+
declare const NotificationShape: z.ZodObject<{
|
|
5
8
|
actorId: z.ZodCUID2;
|
|
9
|
+
recipientId: z.ZodCUID2;
|
|
6
10
|
type: z.ZodEnum<{
|
|
7
11
|
readonly FOLLOW: "Follow";
|
|
8
12
|
readonly LIKE: "Like";
|
|
@@ -23,8 +27,8 @@ export declare const NotificationEntitySchema: z.ZodObject<{
|
|
|
23
27
|
readonly MARKETPLACE_DROP: "Marketplace Drop";
|
|
24
28
|
}>;
|
|
25
29
|
entityId: z.ZodOptional<z.ZodCUID2>;
|
|
26
|
-
parentId: z.
|
|
27
|
-
parentType: z.
|
|
30
|
+
parentId: z.ZodOptional<z.ZodNullable<z.ZodCUID2>>;
|
|
31
|
+
parentType: z.ZodOptional<z.ZodNullable<z.ZodEnum<{
|
|
28
32
|
readonly PROJECT: "PROJECT";
|
|
29
33
|
readonly USER: "USER";
|
|
30
34
|
readonly JOB: "JOB";
|
|
@@ -49,19 +53,73 @@ export declare const NotificationEntitySchema: z.ZodObject<{
|
|
|
49
53
|
readonly COMMENT: "COMMENT";
|
|
50
54
|
readonly JOB_APPLICATION: "JOB_APPLICATION";
|
|
51
55
|
}>;
|
|
52
|
-
isRead: z.ZodDefault<z.ZodBoolean>;
|
|
53
|
-
createdAt: z.ZodCoercedDate<unknown>;
|
|
54
|
-
deletedAt: z.ZodNullable<z.ZodOptional<z.ZodCoercedDate<unknown>>>;
|
|
55
56
|
}, z.core.$strip>;
|
|
56
|
-
export
|
|
57
|
-
|
|
58
|
-
|
|
57
|
+
export type NotificationShapeType = z.infer<typeof NotificationShape>;
|
|
58
|
+
/**
|
|
59
|
+
* --------------------------------
|
|
60
|
+
* ENTITY
|
|
61
|
+
* --------------------------------
|
|
62
|
+
*/
|
|
63
|
+
export declare const NotificationEntitySchema: z.ZodObject<{
|
|
64
|
+
isRead: z.ZodDefault<z.ZodBoolean>;
|
|
65
|
+
createdAt: z.ZodISODateTime;
|
|
66
|
+
deletedAt: z.ZodOptional<z.ZodISODateTime>;
|
|
59
67
|
actorId: z.ZodCUID2;
|
|
68
|
+
recipientId: z.ZodCUID2;
|
|
69
|
+
type: z.ZodEnum<{
|
|
70
|
+
readonly FOLLOW: "Follow";
|
|
71
|
+
readonly LIKE: "Like";
|
|
72
|
+
readonly COMMENT: "Comment";
|
|
73
|
+
readonly SIGNAL: "Signal Creation";
|
|
74
|
+
readonly SIGNAL_APPROVAL: "Signal Approval";
|
|
75
|
+
readonly SIGNAL_REJECTION: "Signal Rejection";
|
|
76
|
+
readonly REPLY: "Reply";
|
|
77
|
+
readonly MESSAGE: "Message";
|
|
78
|
+
readonly BOOKMARK: "Bookmark";
|
|
79
|
+
readonly JOB_APPLICATION: "Job Application";
|
|
80
|
+
readonly APPLICATION_STATUS_CHANGE: "Application Status Change";
|
|
81
|
+
readonly SYSTEM_STRIKE: "System Strike";
|
|
82
|
+
readonly PROJECT_FEATURED: "Project Featured";
|
|
83
|
+
readonly PROJECT_TAG: "Project Tag";
|
|
84
|
+
readonly MENTION: "Mention";
|
|
85
|
+
readonly PRODUCT_APPROVAL: "Product Approval";
|
|
86
|
+
readonly MARKETPLACE_DROP: "Marketplace Drop";
|
|
87
|
+
}>;
|
|
88
|
+
entityId: z.ZodOptional<z.ZodCUID2>;
|
|
89
|
+
parentId: z.ZodOptional<z.ZodNullable<z.ZodCUID2>>;
|
|
90
|
+
parentType: z.ZodOptional<z.ZodNullable<z.ZodEnum<{
|
|
91
|
+
readonly PROJECT: "PROJECT";
|
|
92
|
+
readonly USER: "USER";
|
|
93
|
+
readonly JOB: "JOB";
|
|
94
|
+
readonly POST: "POST";
|
|
95
|
+
readonly PRODUCT: "PRODUCT";
|
|
96
|
+
readonly SIGNAL: "SIGNAL";
|
|
97
|
+
readonly PRODUCT_COVER: "PRODUCT_COVER";
|
|
98
|
+
readonly PRODUCT_DELIVERY: "PRODUCT_DELIVERY";
|
|
99
|
+
readonly COMMENT: "COMMENT";
|
|
100
|
+
readonly JOB_APPLICATION: "JOB_APPLICATION";
|
|
101
|
+
}>>>;
|
|
102
|
+
rootId: z.ZodCUID2;
|
|
103
|
+
rootType: z.ZodEnum<{
|
|
104
|
+
readonly PROJECT: "PROJECT";
|
|
105
|
+
readonly USER: "USER";
|
|
106
|
+
readonly JOB: "JOB";
|
|
107
|
+
readonly POST: "POST";
|
|
108
|
+
readonly PRODUCT: "PRODUCT";
|
|
109
|
+
readonly SIGNAL: "SIGNAL";
|
|
110
|
+
readonly PRODUCT_COVER: "PRODUCT_COVER";
|
|
111
|
+
readonly PRODUCT_DELIVERY: "PRODUCT_DELIVERY";
|
|
112
|
+
readonly COMMENT: "COMMENT";
|
|
113
|
+
readonly JOB_APPLICATION: "JOB_APPLICATION";
|
|
114
|
+
}>;
|
|
115
|
+
id: z.ZodCUID2;
|
|
60
116
|
}, z.core.$strip>;
|
|
61
117
|
export declare const NotificationDetailsEntitySchema: z.ZodObject<{
|
|
62
|
-
|
|
63
|
-
|
|
118
|
+
isRead: z.ZodDefault<z.ZodBoolean>;
|
|
119
|
+
createdAt: z.ZodISODateTime;
|
|
120
|
+
deletedAt: z.ZodOptional<z.ZodISODateTime>;
|
|
64
121
|
actorId: z.ZodCUID2;
|
|
122
|
+
recipientId: z.ZodCUID2;
|
|
65
123
|
type: z.ZodEnum<{
|
|
66
124
|
readonly FOLLOW: "Follow";
|
|
67
125
|
readonly LIKE: "Like";
|
|
@@ -82,8 +140,8 @@ export declare const NotificationDetailsEntitySchema: z.ZodObject<{
|
|
|
82
140
|
readonly MARKETPLACE_DROP: "Marketplace Drop";
|
|
83
141
|
}>;
|
|
84
142
|
entityId: z.ZodOptional<z.ZodCUID2>;
|
|
85
|
-
parentId: z.
|
|
86
|
-
parentType: z.
|
|
143
|
+
parentId: z.ZodOptional<z.ZodNullable<z.ZodCUID2>>;
|
|
144
|
+
parentType: z.ZodOptional<z.ZodNullable<z.ZodEnum<{
|
|
87
145
|
readonly PROJECT: "PROJECT";
|
|
88
146
|
readonly USER: "USER";
|
|
89
147
|
readonly JOB: "JOB";
|
|
@@ -108,9 +166,7 @@ export declare const NotificationDetailsEntitySchema: z.ZodObject<{
|
|
|
108
166
|
readonly COMMENT: "COMMENT";
|
|
109
167
|
readonly JOB_APPLICATION: "JOB_APPLICATION";
|
|
110
168
|
}>;
|
|
111
|
-
|
|
112
|
-
createdAt: z.ZodCoercedDate<unknown>;
|
|
113
|
-
deletedAt: z.ZodNullable<z.ZodOptional<z.ZodCoercedDate<unknown>>>;
|
|
169
|
+
id: z.ZodCUID2;
|
|
114
170
|
actor: z.ZodObject<{
|
|
115
171
|
email: z.ZodEmail;
|
|
116
172
|
username: z.ZodDefault<z.ZodString>;
|
|
@@ -142,6 +198,11 @@ export declare const NotificationDetailsEntitySchema: z.ZodObject<{
|
|
|
142
198
|
itemImgUrl: z.ZodOptional<z.ZodString>;
|
|
143
199
|
itemStatus: z.ZodOptional<z.ZodString>;
|
|
144
200
|
}, z.core.$strip>;
|
|
201
|
+
/**
|
|
202
|
+
* --------------------------------
|
|
203
|
+
* INPUTS
|
|
204
|
+
* --------------------------------
|
|
205
|
+
*/
|
|
145
206
|
export declare const ListNotificationsInputSchema: z.ZodObject<{
|
|
146
207
|
type: z.ZodOptional<z.ZodEnum<{
|
|
147
208
|
readonly FOLLOW: "Follow";
|
|
@@ -163,13 +224,23 @@ export declare const ListNotificationsInputSchema: z.ZodObject<{
|
|
|
163
224
|
readonly MARKETPLACE_DROP: "Marketplace Drop";
|
|
164
225
|
}>>;
|
|
165
226
|
cursor: z.ZodOptional<z.ZodString>;
|
|
166
|
-
unreadOnly: z.ZodDefault<z.ZodOptional<z.
|
|
227
|
+
unreadOnly: z.ZodDefault<z.ZodOptional<z.ZodBoolean>>;
|
|
228
|
+
}, z.core.$strip>;
|
|
229
|
+
export declare const MarkReadInputSchema: z.ZodObject<{
|
|
230
|
+
notificationIds: z.ZodArray<z.ZodCUID2>;
|
|
167
231
|
}, z.core.$strip>;
|
|
232
|
+
/**
|
|
233
|
+
* --------------------------------
|
|
234
|
+
* OUTPUTS
|
|
235
|
+
* --------------------------------
|
|
236
|
+
*/
|
|
168
237
|
export declare const ListNotificationsOutputSchema: z.ZodObject<{
|
|
169
238
|
notifications: z.ZodArray<z.ZodObject<{
|
|
170
|
-
|
|
171
|
-
|
|
239
|
+
isRead: z.ZodDefault<z.ZodBoolean>;
|
|
240
|
+
createdAt: z.ZodISODateTime;
|
|
241
|
+
deletedAt: z.ZodOptional<z.ZodISODateTime>;
|
|
172
242
|
actorId: z.ZodCUID2;
|
|
243
|
+
recipientId: z.ZodCUID2;
|
|
173
244
|
type: z.ZodEnum<{
|
|
174
245
|
readonly FOLLOW: "Follow";
|
|
175
246
|
readonly LIKE: "Like";
|
|
@@ -190,8 +261,8 @@ export declare const ListNotificationsOutputSchema: z.ZodObject<{
|
|
|
190
261
|
readonly MARKETPLACE_DROP: "Marketplace Drop";
|
|
191
262
|
}>;
|
|
192
263
|
entityId: z.ZodOptional<z.ZodCUID2>;
|
|
193
|
-
parentId: z.
|
|
194
|
-
parentType: z.
|
|
264
|
+
parentId: z.ZodOptional<z.ZodNullable<z.ZodCUID2>>;
|
|
265
|
+
parentType: z.ZodOptional<z.ZodNullable<z.ZodEnum<{
|
|
195
266
|
readonly PROJECT: "PROJECT";
|
|
196
267
|
readonly USER: "USER";
|
|
197
268
|
readonly JOB: "JOB";
|
|
@@ -216,9 +287,7 @@ export declare const ListNotificationsOutputSchema: z.ZodObject<{
|
|
|
216
287
|
readonly COMMENT: "COMMENT";
|
|
217
288
|
readonly JOB_APPLICATION: "JOB_APPLICATION";
|
|
218
289
|
}>;
|
|
219
|
-
|
|
220
|
-
createdAt: z.ZodCoercedDate<unknown>;
|
|
221
|
-
deletedAt: z.ZodNullable<z.ZodOptional<z.ZodCoercedDate<unknown>>>;
|
|
290
|
+
id: z.ZodCUID2;
|
|
222
291
|
actor: z.ZodObject<{
|
|
223
292
|
email: z.ZodEmail;
|
|
224
293
|
username: z.ZodDefault<z.ZodString>;
|
|
@@ -250,12 +319,10 @@ export declare const ListNotificationsOutputSchema: z.ZodObject<{
|
|
|
250
319
|
itemImgUrl: z.ZodOptional<z.ZodString>;
|
|
251
320
|
itemStatus: z.ZodOptional<z.ZodString>;
|
|
252
321
|
}, z.core.$strip>>;
|
|
253
|
-
nextCursor: z.
|
|
254
|
-
unreadCount: z.
|
|
255
|
-
}, z.core.$strip>;
|
|
256
|
-
export declare const MarkReadInputSchema: z.ZodObject<{
|
|
257
|
-
notificationIds: z.ZodArray<z.ZodCUID2>;
|
|
322
|
+
nextCursor: z.ZodOptional<z.ZodString>;
|
|
323
|
+
unreadCount: z.ZodInt;
|
|
258
324
|
}, z.core.$strip>;
|
|
259
325
|
export declare const NotificationCountOutputSchema: z.ZodObject<{
|
|
260
|
-
unreadCount: z.
|
|
326
|
+
unreadCount: z.ZodInt;
|
|
261
327
|
}, z.core.$strip>;
|
|
328
|
+
export {};
|