redai-automation-web-sdk 1.0.1
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/README.md +715 -0
- package/dist/client/AutomationWebClient.d.ts +188 -0
- package/dist/client/AutomationWebClient.d.ts.map +1 -0
- package/dist/client/AutomationWebClient.js +370 -0
- package/dist/client/AutomationWebClient.js.map +1 -0
- package/dist/client/index.d.ts +5 -0
- package/dist/client/index.d.ts.map +1 -0
- package/dist/client/index.js +21 -0
- package/dist/client/index.js.map +1 -0
- package/dist/index.d.ts +20 -0
- package/dist/index.d.ts.map +1 -0
- package/dist/index.js +86 -0
- package/dist/index.js.map +1 -0
- package/dist/services/auth/auth.service.d.ts +78 -0
- package/dist/services/auth/auth.service.d.ts.map +1 -0
- package/dist/services/auth/auth.service.js +227 -0
- package/dist/services/auth/auth.service.js.map +1 -0
- package/dist/services/auth/index.d.ts +5 -0
- package/dist/services/auth/index.d.ts.map +1 -0
- package/dist/services/auth/index.js +21 -0
- package/dist/services/auth/index.js.map +1 -0
- package/dist/services/bulk/bulk.service.d.ts +201 -0
- package/dist/services/bulk/bulk.service.d.ts.map +1 -0
- package/dist/services/bulk/bulk.service.js +114 -0
- package/dist/services/bulk/bulk.service.js.map +1 -0
- package/dist/services/bulk/index.d.ts +5 -0
- package/dist/services/bulk/index.d.ts.map +1 -0
- package/dist/services/bulk/index.js +21 -0
- package/dist/services/bulk/index.js.map +1 -0
- package/dist/services/conversations/conversations.service.d.ts +187 -0
- package/dist/services/conversations/conversations.service.d.ts.map +1 -0
- package/dist/services/conversations/conversations.service.js +119 -0
- package/dist/services/conversations/conversations.service.js.map +1 -0
- package/dist/services/conversations/index.d.ts +6 -0
- package/dist/services/conversations/index.d.ts.map +1 -0
- package/dist/services/conversations/index.js +13 -0
- package/dist/services/conversations/index.js.map +1 -0
- package/dist/services/friends/friends.service.d.ts +499 -0
- package/dist/services/friends/friends.service.d.ts.map +1 -0
- package/dist/services/friends/friends.service.js +288 -0
- package/dist/services/friends/friends.service.js.map +1 -0
- package/dist/services/friends/index.d.ts +6 -0
- package/dist/services/friends/index.d.ts.map +1 -0
- package/dist/services/friends/index.js +10 -0
- package/dist/services/friends/index.js.map +1 -0
- package/dist/services/groups/groups.service.d.ts +366 -0
- package/dist/services/groups/groups.service.d.ts.map +1 -0
- package/dist/services/groups/groups.service.js +250 -0
- package/dist/services/groups/groups.service.js.map +1 -0
- package/dist/services/groups/index.d.ts +6 -0
- package/dist/services/groups/index.d.ts.map +1 -0
- package/dist/services/groups/index.js +10 -0
- package/dist/services/groups/index.js.map +1 -0
- package/dist/services/messaging/index.d.ts +6 -0
- package/dist/services/messaging/index.d.ts.map +1 -0
- package/dist/services/messaging/index.js +10 -0
- package/dist/services/messaging/index.js.map +1 -0
- package/dist/services/messaging/messaging.service.d.ts +186 -0
- package/dist/services/messaging/messaging.service.d.ts.map +1 -0
- package/dist/services/messaging/messaging.service.js +212 -0
- package/dist/services/messaging/messaging.service.js.map +1 -0
- package/dist/services/user-info/index.d.ts +6 -0
- package/dist/services/user-info/index.d.ts.map +1 -0
- package/dist/services/user-info/index.js +10 -0
- package/dist/services/user-info/index.js.map +1 -0
- package/dist/services/user-info/user-info.service.d.ts +168 -0
- package/dist/services/user-info/user-info.service.d.ts.map +1 -0
- package/dist/services/user-info/user-info.service.js +85 -0
- package/dist/services/user-info/user-info.service.js.map +1 -0
- package/dist/services/webhook/index.d.ts +6 -0
- package/dist/services/webhook/index.d.ts.map +1 -0
- package/dist/services/webhook/index.js +10 -0
- package/dist/services/webhook/index.js.map +1 -0
- package/dist/services/webhook/webhook.service.d.ts +303 -0
- package/dist/services/webhook/webhook.service.d.ts.map +1 -0
- package/dist/services/webhook/webhook.service.js +133 -0
- package/dist/services/webhook/webhook.service.js.map +1 -0
- package/dist/types/auth.types.d.ts +384 -0
- package/dist/types/auth.types.d.ts.map +1 -0
- package/dist/types/auth.types.js +28 -0
- package/dist/types/auth.types.js.map +1 -0
- package/dist/types/bulk.types.d.ts +553 -0
- package/dist/types/bulk.types.d.ts.map +1 -0
- package/dist/types/bulk.types.js +31 -0
- package/dist/types/bulk.types.js.map +1 -0
- package/dist/types/common.types.d.ts +301 -0
- package/dist/types/common.types.d.ts.map +1 -0
- package/dist/types/common.types.js +58 -0
- package/dist/types/common.types.js.map +1 -0
- package/dist/types/friends.types.d.ts +566 -0
- package/dist/types/friends.types.d.ts.map +1 -0
- package/dist/types/friends.types.js +39 -0
- package/dist/types/friends.types.js.map +1 -0
- package/dist/types/index.d.ts +12 -0
- package/dist/types/index.d.ts.map +1 -0
- package/dist/types/index.js +38 -0
- package/dist/types/index.js.map +1 -0
- package/dist/types/job/event-job.types.d.ts +147 -0
- package/dist/types/job/event-job.types.d.ts.map +1 -0
- package/dist/types/job/event-job.types.js +7 -0
- package/dist/types/job/event-job.types.js.map +1 -0
- package/dist/types/job/friend-group-job.types.d.ts +183 -0
- package/dist/types/job/friend-group-job.types.d.ts.map +1 -0
- package/dist/types/job/friend-group-job.types.js +7 -0
- package/dist/types/job/friend-group-job.types.js.map +1 -0
- package/dist/types/job/index.d.ts +88 -0
- package/dist/types/job/index.d.ts.map +1 -0
- package/dist/types/job/index.js +260 -0
- package/dist/types/job/index.js.map +1 -0
- package/dist/types/job/message-job.types.d.ts +181 -0
- package/dist/types/job/message-job.types.d.ts.map +1 -0
- package/dist/types/job/message-job.types.js +7 -0
- package/dist/types/job/message-job.types.js.map +1 -0
- package/dist/types/job/system-job.types.d.ts +235 -0
- package/dist/types/job/system-job.types.d.ts.map +1 -0
- package/dist/types/job/system-job.types.js +7 -0
- package/dist/types/job/system-job.types.js.map +1 -0
- package/dist/types/job/webhook-job.types.d.ts +219 -0
- package/dist/types/job/webhook-job.types.d.ts.map +1 -0
- package/dist/types/job/webhook-job.types.js +202 -0
- package/dist/types/job/webhook-job.types.js.map +1 -0
- package/dist/types/messaging.types.d.ts +565 -0
- package/dist/types/messaging.types.d.ts.map +1 -0
- package/dist/types/messaging.types.js +34 -0
- package/dist/types/messaging.types.js.map +1 -0
- package/dist/types/webhook/delivered-message.d.ts +47 -0
- package/dist/types/webhook/delivered-message.d.ts.map +1 -0
- package/dist/types/webhook/delivered-message.js +34 -0
- package/dist/types/webhook/delivered-message.js.map +1 -0
- package/dist/types/webhook/enums.d.ts +149 -0
- package/dist/types/webhook/enums.d.ts.map +1 -0
- package/dist/types/webhook/enums.js +160 -0
- package/dist/types/webhook/enums.js.map +1 -0
- package/dist/types/webhook/friend-event.d.ts +134 -0
- package/dist/types/webhook/friend-event.d.ts.map +1 -0
- package/dist/types/webhook/friend-event.js +79 -0
- package/dist/types/webhook/friend-event.js.map +1 -0
- package/dist/types/webhook/group-event.d.ts +223 -0
- package/dist/types/webhook/group-event.d.ts.map +1 -0
- package/dist/types/webhook/group-event.js +69 -0
- package/dist/types/webhook/group-event.js.map +1 -0
- package/dist/types/webhook/index.d.ts +25 -0
- package/dist/types/webhook/index.d.ts.map +1 -0
- package/dist/types/webhook/index.js +46 -0
- package/dist/types/webhook/index.js.map +1 -0
- package/dist/types/webhook/message.d.ts +123 -0
- package/dist/types/webhook/message.d.ts.map +1 -0
- package/dist/types/webhook/message.js +39 -0
- package/dist/types/webhook/message.js.map +1 -0
- package/dist/types/webhook/reaction.d.ts +40 -0
- package/dist/types/webhook/reaction.d.ts.map +1 -0
- package/dist/types/webhook/reaction.js +24 -0
- package/dist/types/webhook/reaction.js.map +1 -0
- package/dist/types/webhook/seen-message.d.ts +46 -0
- package/dist/types/webhook/seen-message.d.ts.map +1 -0
- package/dist/types/webhook/seen-message.js +34 -0
- package/dist/types/webhook/seen-message.js.map +1 -0
- package/dist/types/webhook/typing.d.ts +44 -0
- package/dist/types/webhook/typing.d.ts.map +1 -0
- package/dist/types/webhook/typing.js +35 -0
- package/dist/types/webhook/typing.js.map +1 -0
- package/dist/types/webhook/undo.d.ts +48 -0
- package/dist/types/webhook/undo.d.ts.map +1 -0
- package/dist/types/webhook/undo.js +24 -0
- package/dist/types/webhook/undo.js.map +1 -0
- package/dist/types/webhook.types.d.ts +451 -0
- package/dist/types/webhook.types.d.ts.map +1 -0
- package/dist/types/webhook.types.js +223 -0
- package/dist/types/webhook.types.js.map +1 -0
- package/dist/utils/event.utils.d.ts +119 -0
- package/dist/utils/event.utils.d.ts.map +1 -0
- package/dist/utils/event.utils.js +306 -0
- package/dist/utils/event.utils.js.map +1 -0
- package/dist/utils/format.utils.d.ts +128 -0
- package/dist/utils/format.utils.d.ts.map +1 -0
- package/dist/utils/format.utils.js +312 -0
- package/dist/utils/format.utils.js.map +1 -0
- package/dist/utils/http.utils.d.ts +111 -0
- package/dist/utils/http.utils.d.ts.map +1 -0
- package/dist/utils/http.utils.js +336 -0
- package/dist/utils/http.utils.js.map +1 -0
- package/dist/utils/index.d.ts +8 -0
- package/dist/utils/index.d.ts.map +1 -0
- package/dist/utils/index.js +24 -0
- package/dist/utils/index.js.map +1 -0
- package/dist/utils/validation.utils.d.ts +118 -0
- package/dist/utils/validation.utils.d.ts.map +1 -0
- package/dist/utils/validation.utils.js +326 -0
- package/dist/utils/validation.utils.js.map +1 -0
- package/package.json +88 -0
|
@@ -0,0 +1,223 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Group Event Types
|
|
3
|
+
* 100% khớp với zalo-personal-sdk/src/models/GroupEvent.ts
|
|
4
|
+
*/
|
|
5
|
+
import { GroupEventType } from './enums';
|
|
6
|
+
/**
|
|
7
|
+
* Group Member Type
|
|
8
|
+
*/
|
|
9
|
+
export interface Member {
|
|
10
|
+
id: string;
|
|
11
|
+
dName: string;
|
|
12
|
+
avatar: string;
|
|
13
|
+
type: number;
|
|
14
|
+
avatar_25: string;
|
|
15
|
+
}
|
|
16
|
+
/**
|
|
17
|
+
* Group Setting Type
|
|
18
|
+
*/
|
|
19
|
+
export interface GroupSetting {
|
|
20
|
+
blockName: number;
|
|
21
|
+
signAdminMsg: number;
|
|
22
|
+
addMemberOnly: number;
|
|
23
|
+
setTopicOnly: number;
|
|
24
|
+
enableMsgHistory: number;
|
|
25
|
+
joinAppr: number;
|
|
26
|
+
lockCreatePost: number;
|
|
27
|
+
lockCreatePoll: number;
|
|
28
|
+
lockSendMsg: number;
|
|
29
|
+
lockViewMember: number;
|
|
30
|
+
bannFeature: number;
|
|
31
|
+
dirtyMedia: number;
|
|
32
|
+
banDuration: number;
|
|
33
|
+
}
|
|
34
|
+
/**
|
|
35
|
+
* Group Topic Type
|
|
36
|
+
*/
|
|
37
|
+
export interface GroupTopic {
|
|
38
|
+
type: number;
|
|
39
|
+
color: number;
|
|
40
|
+
emoji: string;
|
|
41
|
+
startTime: number;
|
|
42
|
+
duration: number;
|
|
43
|
+
params: string;
|
|
44
|
+
id: string;
|
|
45
|
+
creatorId: string;
|
|
46
|
+
createTime: number;
|
|
47
|
+
editorId: string;
|
|
48
|
+
editTime: number;
|
|
49
|
+
repeat: number;
|
|
50
|
+
action: number;
|
|
51
|
+
}
|
|
52
|
+
/**
|
|
53
|
+
* Group Info Type
|
|
54
|
+
*/
|
|
55
|
+
export interface GroupInfo {
|
|
56
|
+
group_link?: string;
|
|
57
|
+
link_expired_time?: number;
|
|
58
|
+
[key: string]: any;
|
|
59
|
+
}
|
|
60
|
+
/**
|
|
61
|
+
* Group Extra Data Type
|
|
62
|
+
*/
|
|
63
|
+
export interface GroupExtraData {
|
|
64
|
+
featureId?: number;
|
|
65
|
+
field?: string;
|
|
66
|
+
[key: string]: any;
|
|
67
|
+
}
|
|
68
|
+
/**
|
|
69
|
+
* Base Group Event Type
|
|
70
|
+
*/
|
|
71
|
+
export interface TGroupEventBase {
|
|
72
|
+
subType: number;
|
|
73
|
+
groupId: string;
|
|
74
|
+
creatorId: string;
|
|
75
|
+
groupName: string;
|
|
76
|
+
sourceId: string;
|
|
77
|
+
updateMembers: Member[];
|
|
78
|
+
groupSetting: GroupSetting | null;
|
|
79
|
+
groupTopic: GroupTopic | null;
|
|
80
|
+
info: GroupInfo | null;
|
|
81
|
+
extraData: GroupExtraData | null;
|
|
82
|
+
time: string;
|
|
83
|
+
avt: string | null;
|
|
84
|
+
fullAvt: string | null;
|
|
85
|
+
isAdd: number;
|
|
86
|
+
hideGroupInfo: number;
|
|
87
|
+
version: string;
|
|
88
|
+
groupType: number;
|
|
89
|
+
clientId?: number;
|
|
90
|
+
errorMap?: Record<string, any>;
|
|
91
|
+
e2ee?: number;
|
|
92
|
+
}
|
|
93
|
+
/**
|
|
94
|
+
* Group Event Join Request Type
|
|
95
|
+
*/
|
|
96
|
+
export interface TGroupEventJoinRequest {
|
|
97
|
+
uids: string[];
|
|
98
|
+
totalPending: number;
|
|
99
|
+
groupId: string;
|
|
100
|
+
time: string;
|
|
101
|
+
}
|
|
102
|
+
/**
|
|
103
|
+
* Group Event Pin Topic Type
|
|
104
|
+
*/
|
|
105
|
+
export interface TGroupEventPinTopic {
|
|
106
|
+
oldBoardVersion: number;
|
|
107
|
+
boardVersion: number;
|
|
108
|
+
topic: GroupTopic;
|
|
109
|
+
actorId: string;
|
|
110
|
+
groupId: string;
|
|
111
|
+
}
|
|
112
|
+
/**
|
|
113
|
+
* Group Event Reorder Pin Topic Type
|
|
114
|
+
*/
|
|
115
|
+
export interface TGroupEventReorderPinTopic {
|
|
116
|
+
oldBoardVersion: number;
|
|
117
|
+
actorId: string;
|
|
118
|
+
topics: {
|
|
119
|
+
topicId: string;
|
|
120
|
+
topicType: number;
|
|
121
|
+
}[];
|
|
122
|
+
groupId: string;
|
|
123
|
+
boardVersion: number;
|
|
124
|
+
topic: null;
|
|
125
|
+
}
|
|
126
|
+
/**
|
|
127
|
+
* Group Event Board Type
|
|
128
|
+
*/
|
|
129
|
+
export interface TGroupEventBoard {
|
|
130
|
+
sourceId: string;
|
|
131
|
+
groupName: string;
|
|
132
|
+
groupTopic: GroupTopic;
|
|
133
|
+
groupId: string;
|
|
134
|
+
creatorId: string;
|
|
135
|
+
subType?: number;
|
|
136
|
+
updateMembers?: Member[];
|
|
137
|
+
groupSetting?: GroupSetting;
|
|
138
|
+
info?: GroupInfo;
|
|
139
|
+
extraData?: GroupExtraData;
|
|
140
|
+
time?: string;
|
|
141
|
+
avt?: null;
|
|
142
|
+
fullAvt?: null;
|
|
143
|
+
isAdd?: number;
|
|
144
|
+
hideGroupInfo?: number;
|
|
145
|
+
version?: string;
|
|
146
|
+
groupType?: number;
|
|
147
|
+
}
|
|
148
|
+
/**
|
|
149
|
+
* Group Event Remind Respond Type
|
|
150
|
+
*/
|
|
151
|
+
export interface TGroupEventRemindRespond {
|
|
152
|
+
topicId: string;
|
|
153
|
+
updateMembers: string[];
|
|
154
|
+
groupId: string;
|
|
155
|
+
time: string;
|
|
156
|
+
}
|
|
157
|
+
/**
|
|
158
|
+
* Group Event Remind Topic Type
|
|
159
|
+
*/
|
|
160
|
+
export interface TGroupEventRemindTopic {
|
|
161
|
+
msg: string;
|
|
162
|
+
editorId: string;
|
|
163
|
+
color: string;
|
|
164
|
+
emoji: string;
|
|
165
|
+
creatorId: string;
|
|
166
|
+
editTime: number;
|
|
167
|
+
type: number;
|
|
168
|
+
duration: number;
|
|
169
|
+
group_id: string;
|
|
170
|
+
createTime: number;
|
|
171
|
+
repeat: number;
|
|
172
|
+
startTime: number;
|
|
173
|
+
time: number;
|
|
174
|
+
remindType: number;
|
|
175
|
+
}
|
|
176
|
+
/**
|
|
177
|
+
* Group Event Union Type
|
|
178
|
+
*/
|
|
179
|
+
export type TGroupEvent = TGroupEventBase | TGroupEventJoinRequest | TGroupEventPinTopic | TGroupEventReorderPinTopic | TGroupEventBoard | TGroupEventRemindRespond | TGroupEventRemindTopic;
|
|
180
|
+
/**
|
|
181
|
+
* Group Event Discriminated Union
|
|
182
|
+
*/
|
|
183
|
+
export type GroupEvent = {
|
|
184
|
+
type: GroupEventType.JOIN_REQUEST;
|
|
185
|
+
data: TGroupEventJoinRequest;
|
|
186
|
+
threadId: string;
|
|
187
|
+
isSelf: boolean;
|
|
188
|
+
} | {
|
|
189
|
+
type: GroupEventType.NEW_PIN_TOPIC | GroupEventType.UNPIN_TOPIC | GroupEventType.UPDATE_PIN_TOPIC;
|
|
190
|
+
data: TGroupEventPinTopic;
|
|
191
|
+
threadId: string;
|
|
192
|
+
isSelf: boolean;
|
|
193
|
+
} | {
|
|
194
|
+
type: GroupEventType.REORDER_PIN_TOPIC;
|
|
195
|
+
data: TGroupEventReorderPinTopic;
|
|
196
|
+
threadId: string;
|
|
197
|
+
isSelf: boolean;
|
|
198
|
+
} | {
|
|
199
|
+
type: GroupEventType.UPDATE_BOARD | GroupEventType.REMOVE_BOARD;
|
|
200
|
+
data: TGroupEventBoard;
|
|
201
|
+
threadId: string;
|
|
202
|
+
isSelf: boolean;
|
|
203
|
+
} | {
|
|
204
|
+
type: GroupEventType.ACCEPT_REMIND | GroupEventType.REJECT_REMIND;
|
|
205
|
+
data: TGroupEventRemindRespond;
|
|
206
|
+
threadId: string;
|
|
207
|
+
isSelf: boolean;
|
|
208
|
+
} | {
|
|
209
|
+
type: GroupEventType.REMIND_TOPIC;
|
|
210
|
+
data: TGroupEventRemindTopic;
|
|
211
|
+
threadId: string;
|
|
212
|
+
isSelf: boolean;
|
|
213
|
+
} | {
|
|
214
|
+
type: Exclude<GroupEventType, GroupEventType.JOIN_REQUEST | GroupEventType.NEW_PIN_TOPIC | GroupEventType.UNPIN_TOPIC | GroupEventType.UPDATE_PIN_TOPIC | GroupEventType.REORDER_PIN_TOPIC | GroupEventType.UPDATE_BOARD | GroupEventType.REMOVE_BOARD | GroupEventType.ACCEPT_REMIND | GroupEventType.REJECT_REMIND | GroupEventType.REMIND_TOPIC>;
|
|
215
|
+
data: TGroupEventBase;
|
|
216
|
+
threadId: string;
|
|
217
|
+
isSelf: boolean;
|
|
218
|
+
};
|
|
219
|
+
/**
|
|
220
|
+
* Initialize Group Event Function
|
|
221
|
+
*/
|
|
222
|
+
export declare function initializeGroupEvent(uid: string, data: TGroupEvent, type: GroupEventType): GroupEvent;
|
|
223
|
+
//# sourceMappingURL=group-event.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"group-event.d.ts","sourceRoot":"","sources":["../../../src/types/webhook/group-event.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,OAAO,EAAE,cAAc,EAAE,MAAM,SAAS,CAAC;AAEzC;;GAEG;AACH,MAAM,WAAW,MAAM;IACrB,EAAE,EAAE,MAAM,CAAC;IACX,KAAK,EAAE,MAAM,CAAC;IACd,MAAM,EAAE,MAAM,CAAC;IACf,IAAI,EAAE,MAAM,CAAC;IACb,SAAS,EAAE,MAAM,CAAC;CACnB;AAED;;GAEG;AACH,MAAM,WAAW,YAAY;IAC3B,SAAS,EAAE,MAAM,CAAC;IAClB,YAAY,EAAE,MAAM,CAAC;IACrB,aAAa,EAAE,MAAM,CAAC;IACtB,YAAY,EAAE,MAAM,CAAC;IACrB,gBAAgB,EAAE,MAAM,CAAC;IACzB,QAAQ,EAAE,MAAM,CAAC;IACjB,cAAc,EAAE,MAAM,CAAC;IACvB,cAAc,EAAE,MAAM,CAAC;IACvB,WAAW,EAAE,MAAM,CAAC;IACpB,cAAc,EAAE,MAAM,CAAC;IACvB,WAAW,EAAE,MAAM,CAAC;IACpB,UAAU,EAAE,MAAM,CAAC;IACnB,WAAW,EAAE,MAAM,CAAC;CACrB;AAED;;GAEG;AACH,MAAM,WAAW,UAAU;IACzB,IAAI,EAAE,MAAM,CAAC;IACb,KAAK,EAAE,MAAM,CAAC;IACd,KAAK,EAAE,MAAM,CAAC;IACd,SAAS,EAAE,MAAM,CAAC;IAClB,QAAQ,EAAE,MAAM,CAAC;IACjB,MAAM,EAAE,MAAM,CAAC;IACf,EAAE,EAAE,MAAM,CAAC;IACX,SAAS,EAAE,MAAM,CAAC;IAClB,UAAU,EAAE,MAAM,CAAC;IACnB,QAAQ,EAAE,MAAM,CAAC;IACjB,QAAQ,EAAE,MAAM,CAAC;IACjB,MAAM,EAAE,MAAM,CAAC;IACf,MAAM,EAAE,MAAM,CAAC;CAChB;AAED;;GAEG;AACH,MAAM,WAAW,SAAS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Ac,CAAC,YAAY,CAAC;IAChE,IAAI,EAAE,gBAAgB,CAAC;IACvB,QAAQ,EAAE,MAAM,CAAC;IACjB,MAAM,EAAE,OAAO,CAAC;CACjB,GACD;IACE,IAAI,EAAE,cAAc,CAAC,aAAa,GAAG,cAAc,CAAC,aAAa,CAAC;IAClE,IAAI,EAAE,wBAAwB,CAAC;IAC/B,QAAQ,EAAE,MAAM,CAAC;IACjB,MAAM,EAAE,OAAO,CAAC;CACjB,GACD;IACE,IAAI,EAAE,cAAc,CAAC,YAAY,CAAC;IAClC,IAAI,EAAE,sBAAsB,CAAC;IAC7B,QAAQ,EAAE,MAAM,CAAC;IACjB,MAAM,EAAE,OAAO,CAAC;CACjB,GACD;IACE,IAAI,EAAE,OAAO,CACX,cAAc,EACZ,cAAc,CAAC,YAAY,GAC3B,cAAc,CAAC,aAAa,GAC5B,cAAc,CAAC,WAAW,GAC1B,cAAc,CAAC,gBAAgB,GAC/B,cAAc,CAAC,iBAAiB,GAChC,cAAc,CAAC,YAAY,GAC3B,cAAc,CAAC,YAAY,GAC3B,cAAc,CAAC,aAAa,GAC5B,cAAc,CAAC,aAAa,GAC5B,cAAc,CAAC,YAAY,CAC9B,CAAC;IACF,IAAI,EAAE,eAAe,CAAC;IACtB,QAAQ,EAAE,MAAM,CAAC;IACjB,MAAM,EAAE,OAAO,CAAC;CACjB,CAAC;AAEN;;GAEG;AACH,wBAAgB,oBAAoB,CAAC,GAAG,EAAE,MAAM,EAAE,IAAI,EAAE,WAAW,EAAE,IAAI,EAAE,cAAc,GAAG,UAAU,CAsDrG"}
|
|
@@ -0,0 +1,69 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
/**
|
|
3
|
+
* Group Event Types
|
|
4
|
+
* 100% khớp với zalo-personal-sdk/src/models/GroupEvent.ts
|
|
5
|
+
*/
|
|
6
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
7
|
+
exports.initializeGroupEvent = initializeGroupEvent;
|
|
8
|
+
const enums_1 = require("./enums");
|
|
9
|
+
/**
|
|
10
|
+
* Initialize Group Event Function
|
|
11
|
+
*/
|
|
12
|
+
function initializeGroupEvent(uid, data, type) {
|
|
13
|
+
const threadId = "group_id" in data ? data.group_id : data.groupId;
|
|
14
|
+
if (type === enums_1.GroupEventType.JOIN_REQUEST) {
|
|
15
|
+
return { type, data: data, threadId, isSelf: false };
|
|
16
|
+
}
|
|
17
|
+
else if (type === enums_1.GroupEventType.NEW_PIN_TOPIC ||
|
|
18
|
+
type === enums_1.GroupEventType.UNPIN_TOPIC ||
|
|
19
|
+
type === enums_1.GroupEventType.UPDATE_PIN_TOPIC) {
|
|
20
|
+
return {
|
|
21
|
+
type,
|
|
22
|
+
data: data,
|
|
23
|
+
threadId,
|
|
24
|
+
isSelf: data.actorId === uid,
|
|
25
|
+
};
|
|
26
|
+
}
|
|
27
|
+
else if (type === enums_1.GroupEventType.REORDER_PIN_TOPIC) {
|
|
28
|
+
return {
|
|
29
|
+
type,
|
|
30
|
+
data: data,
|
|
31
|
+
threadId,
|
|
32
|
+
isSelf: data.actorId === uid,
|
|
33
|
+
};
|
|
34
|
+
}
|
|
35
|
+
else if (type === enums_1.GroupEventType.UPDATE_BOARD || type === enums_1.GroupEventType.REMOVE_BOARD) {
|
|
36
|
+
return {
|
|
37
|
+
type,
|
|
38
|
+
data: data,
|
|
39
|
+
threadId,
|
|
40
|
+
isSelf: data.sourceId === uid,
|
|
41
|
+
};
|
|
42
|
+
}
|
|
43
|
+
else if (type === enums_1.GroupEventType.ACCEPT_REMIND || type === enums_1.GroupEventType.REJECT_REMIND) {
|
|
44
|
+
return {
|
|
45
|
+
type,
|
|
46
|
+
data: data,
|
|
47
|
+
threadId,
|
|
48
|
+
isSelf: data.updateMembers.some((memberId) => memberId === uid),
|
|
49
|
+
};
|
|
50
|
+
}
|
|
51
|
+
else if (type === enums_1.GroupEventType.REMIND_TOPIC) {
|
|
52
|
+
return {
|
|
53
|
+
type,
|
|
54
|
+
data: data,
|
|
55
|
+
threadId,
|
|
56
|
+
isSelf: data.creatorId === uid,
|
|
57
|
+
};
|
|
58
|
+
}
|
|
59
|
+
else {
|
|
60
|
+
const baseData = data;
|
|
61
|
+
return {
|
|
62
|
+
type,
|
|
63
|
+
data: baseData,
|
|
64
|
+
threadId,
|
|
65
|
+
isSelf: baseData.updateMembers?.some((member) => member.id === uid) || baseData.sourceId === uid,
|
|
66
|
+
};
|
|
67
|
+
}
|
|
68
|
+
}
|
|
69
|
+
//# sourceMappingURL=group-event.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"group-event.js","sourceRoot":"","sources":["../../../src/types/webhook/group-event.ts"],"names":[],"mappings":";AAAA;;;GAGG;;AAoQH,oDAsDC;AAxTD,mCAAyC;AA+PzC;;GAEG;AACH,SAAgB,oBAAoB,CAAC,GAAW,EAAE,IAAiB,EAAE,IAAoB;IACvF,MAAM,QAAQ,GAAG,UAAU,IAAI,IAAI,CAAC,CAAC,CAAC,IAAI,CAAC,QAAQ,CAAC,CAAC,CAAC,IAAI,CAAC,OAAO,CAAC;IAEnE,IAAI,IAAI,KAAK,sBAAc,CAAC,YAAY,EAAE,CAAC;QACzC,OAAO,EAAE,IAAI,EAAE,IAAI,EAAE,IAA8B,EAAE,QAAQ,EAAE,MAAM,EAAE,KAAK,EAAE,CAAC;IACjF,CAAC;SAAM,IACL,IAAI,KAAK,sBAAc,CAAC,aAAa;QACrC,IAAI,KAAK,sBAAc,CAAC,WAAW;QACnC,IAAI,KAAK,sBAAc,CAAC,gBAAgB,EACxC,CAAC;QACD,OAAO;YACL,IAAI;YACJ,IAAI,EAAE,IAA2B;YACjC,QAAQ;YACR,MAAM,EAAG,IAA4B,CAAC,OAAO,KAAK,GAAG;SACtD,CAAC;IACJ,CAAC;SAAM,IAAI,IAAI,KAAK,sBAAc,CAAC,iBAAiB,EAAE,CAAC;QACrD,OAAO;YACL,IAAI;YACJ,IAAI,EAAE,IAAkC;YACxC,QAAQ;YACR,MAAM,EAAG,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+
export * from './enums';
|
|
7
|
+
export * from './message';
|
|
8
|
+
export * from './typing';
|
|
9
|
+
export * from './reaction';
|
|
10
|
+
export * from './seen-message';
|
|
11
|
+
export * from './delivered-message';
|
|
12
|
+
export * from './friend-event';
|
|
13
|
+
export * from './group-event';
|
|
14
|
+
export * from './undo';
|
|
15
|
+
export type { Message, UserMessage, GroupMessage, TMessage, TGroupMessage, TQuote, TMention, TAttachmentContent, TOtherContent, } from './message';
|
|
16
|
+
export type { Typing, UserTyping, GroupTyping, TTyping, TGroupTyping, } from './typing';
|
|
17
|
+
export type { Reaction, TReaction, } from './reaction';
|
|
18
|
+
export type { SeenMessage, UserSeenMessage, GroupSeenMessage, TUserSeenMessage, TGroupSeenMessage, } from './seen-message';
|
|
19
|
+
export type { DeliveredMessage, UserDeliveredMessage, GroupDeliveredMessage, TDeliveredMessage, TGroupDeliveredMessage, } from './delivered-message';
|
|
20
|
+
export type { FriendEvent, TFriendEvent, TFriendEventBase, TFriendEventRequest, TFriendEventRejectUndo, TFriendEventSeenRequest, TFriendEventPinCreate, TFriendEventPinUnpin, } from './friend-event';
|
|
21
|
+
export type { GroupEvent, TGroupEvent, TGroupEventBase, TGroupEventJoinRequest, TGroupEventPinTopic, TGroupEventReorderPinTopic, TGroupEventBoard, TGroupEventRemindRespond, TGroupEventRemindTopic, Member, GroupSetting, GroupTopic, GroupInfo, GroupExtraData, } from './group-event';
|
|
22
|
+
export type { Undo, TUndo, TUndoContent, } from './undo';
|
|
23
|
+
export { initializeFriendEvent } from './friend-event';
|
|
24
|
+
export { initializeGroupEvent } from './group-event';
|
|
25
|
+
//# sourceMappingURL=index.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/types/webhook/index.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAGH,cAAc,SAAS,CAAC;AAGxB,cAAc,WAAW,CAAC;AAG1B,cAAc,UAAU,CAAC;AAGzB,cAAc,YA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
2
|
+
/**
|
|
3
|
+
* Webhook Types Index
|
|
4
|
+
* Export tất cả webhook event types
|
|
5
|
+
* 100% khớp với zalo-personal-sdk/src/models/
|
|
6
|
+
*/
|
|
7
|
+
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
8
|
+
if (k2 === undefined) k2 = k;
|
|
9
|
+
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
10
|
+
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
11
|
+
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
12
|
+
}
|
|
13
|
+
Object.defineProperty(o, k2, desc);
|
|
14
|
+
}) : (function(o, m, k, k2) {
|
|
15
|
+
if (k2 === undefined) k2 = k;
|
|
16
|
+
o[k2] = m[k];
|
|
17
|
+
}));
|
|
18
|
+
var __exportStar = (this && this.__exportStar) || function(m, exports) {
|
|
19
|
+
for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
|
|
20
|
+
};
|
|
21
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
22
|
+
exports.initializeGroupEvent = exports.initializeFriendEvent = void 0;
|
|
23
|
+
// Export enums
|
|
24
|
+
__exportStar(require("./enums"), exports);
|
|
25
|
+
// Export message types
|
|
26
|
+
__exportStar(require("./message"), exports);
|
|
27
|
+
// Export typing types
|
|
28
|
+
__exportStar(require("./typing"), exports);
|
|
29
|
+
// Export reaction types
|
|
30
|
+
__exportStar(require("./reaction"), exports);
|
|
31
|
+
// Export seen message types
|
|
32
|
+
__exportStar(require("./seen-message"), exports);
|
|
33
|
+
// Export delivered message types
|
|
34
|
+
__exportStar(require("./delivered-message"), exports);
|
|
35
|
+
// Export friend event types
|
|
36
|
+
__exportStar(require("./friend-event"), exports);
|
|
37
|
+
// Export group event types
|
|
38
|
+
__exportStar(require("./group-event"), exports);
|
|
39
|
+
// Export undo types
|
|
40
|
+
__exportStar(require("./undo"), exports);
|
|
41
|
+
// Export initialization functions
|
|
42
|
+
var friend_event_1 = require("./friend-event");
|
|
43
|
+
Object.defineProperty(exports, "initializeFriendEvent", { enumerable: true, get: function () { return friend_event_1.initializeFriendEvent; } });
|
|
44
|
+
var group_event_1 = require("./group-event");
|
|
45
|
+
Object.defineProperty(exports, "initializeGroupEvent", { enumerable: true, get: function () { return group_event_1.initializeGroupEvent; } });
|
|
46
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/types/webhook/index.ts"],"names":[],"mappings":";AAAA;;;;GAIG;;;;;;;;;;;;;;;;;AAEH,eAAe;AACf,0CAAwB;AAExB,uBAAuB;AACvB,4CAA0B;AAE1B,sBAAsB;AACtB,2CAAyB;AAEzB,wBAAwB;AACxB,6CAA2B;AAE3B,4BAA4B;AAC5B,iDAA+B;AAE/B,iCAAiC;AACjC,sDAAoC;AAEpC,4BAA4B;AAC5B,iDAA+B;AAE/B,2BAA2B;AAC3B,gDAA8B;AAE9B,oBAAoB;AACpB,yCAAuB;AA8EvB,kCAAkC;AAClC,+CAAuD;AAA9C,qHAAA,qBAAqB,OAAA;AAC9B,6CAAqD;AAA5C,mHAAA,oBAAoB,OAAA"}
|
|
@@ -0,0 +1,123 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Message Types
|
|
3
|
+
* 100% khớp với zalo-personal-sdk/src/models/Message.ts
|
|
4
|
+
*/
|
|
5
|
+
import { ThreadType } from './enums';
|
|
6
|
+
/**
|
|
7
|
+
* Attachment Content Type
|
|
8
|
+
*/
|
|
9
|
+
export interface TAttachmentContent {
|
|
10
|
+
title: string;
|
|
11
|
+
description: string;
|
|
12
|
+
href: string;
|
|
13
|
+
thumb: string;
|
|
14
|
+
childnumber: number;
|
|
15
|
+
action: string;
|
|
16
|
+
params: string;
|
|
17
|
+
type: string;
|
|
18
|
+
}
|
|
19
|
+
/**
|
|
20
|
+
* Other Content Type
|
|
21
|
+
*/
|
|
22
|
+
export interface TOtherContent {
|
|
23
|
+
[key: string]: any;
|
|
24
|
+
}
|
|
25
|
+
/**
|
|
26
|
+
* Quote Type
|
|
27
|
+
*/
|
|
28
|
+
export interface TQuote {
|
|
29
|
+
ownerId: number;
|
|
30
|
+
cliMsgId: number;
|
|
31
|
+
globalMsgId: number;
|
|
32
|
+
cliMsgType: number;
|
|
33
|
+
ts: number;
|
|
34
|
+
msg: string;
|
|
35
|
+
attach: string;
|
|
36
|
+
fromD: string;
|
|
37
|
+
ttl: number;
|
|
38
|
+
}
|
|
39
|
+
/**
|
|
40
|
+
* Mention Type
|
|
41
|
+
*/
|
|
42
|
+
export interface TMention {
|
|
43
|
+
uid: string;
|
|
44
|
+
pos: number;
|
|
45
|
+
len: number;
|
|
46
|
+
type: 0 | 1;
|
|
47
|
+
}
|
|
48
|
+
/**
|
|
49
|
+
* Base Message Type
|
|
50
|
+
*/
|
|
51
|
+
export interface TMessage {
|
|
52
|
+
actionId: string;
|
|
53
|
+
msgId: string;
|
|
54
|
+
cliMsgId: string;
|
|
55
|
+
msgType: string;
|
|
56
|
+
uidFrom: string;
|
|
57
|
+
idTo: string;
|
|
58
|
+
dName: string;
|
|
59
|
+
ts: string;
|
|
60
|
+
status: number;
|
|
61
|
+
content: string | TAttachmentContent | TOtherContent;
|
|
62
|
+
notify: string;
|
|
63
|
+
ttl: number;
|
|
64
|
+
userId: string;
|
|
65
|
+
uin: string;
|
|
66
|
+
topOut: string;
|
|
67
|
+
topOutTimeOut: string;
|
|
68
|
+
topOutImprTimeOut: string;
|
|
69
|
+
propertyExt: {
|
|
70
|
+
color: number;
|
|
71
|
+
size: number;
|
|
72
|
+
type: number;
|
|
73
|
+
subType: number;
|
|
74
|
+
ext: string;
|
|
75
|
+
} | undefined;
|
|
76
|
+
paramsExt: {
|
|
77
|
+
countUnread: number;
|
|
78
|
+
containType: number;
|
|
79
|
+
platformType: number;
|
|
80
|
+
};
|
|
81
|
+
cmd: number;
|
|
82
|
+
st: number;
|
|
83
|
+
at: number;
|
|
84
|
+
realMsgId: string;
|
|
85
|
+
quote: TQuote | undefined;
|
|
86
|
+
}
|
|
87
|
+
/**
|
|
88
|
+
* Group Message Type (extends TMessage with mentions)
|
|
89
|
+
*/
|
|
90
|
+
export interface TGroupMessage extends TMessage {
|
|
91
|
+
mentions: TMention[] | undefined;
|
|
92
|
+
}
|
|
93
|
+
/**
|
|
94
|
+
* User Message Class
|
|
95
|
+
*/
|
|
96
|
+
export declare class UserMessage {
|
|
97
|
+
type: ThreadType.USER;
|
|
98
|
+
data: TMessage;
|
|
99
|
+
threadId: string;
|
|
100
|
+
/**
|
|
101
|
+
* true if the message is sent by the logged in account
|
|
102
|
+
*/
|
|
103
|
+
isSelf: boolean;
|
|
104
|
+
constructor(uid: string, data: TMessage);
|
|
105
|
+
}
|
|
106
|
+
/**
|
|
107
|
+
* Group Message Class
|
|
108
|
+
*/
|
|
109
|
+
export declare class GroupMessage {
|
|
110
|
+
type: ThreadType.GROUP;
|
|
111
|
+
data: TGroupMessage;
|
|
112
|
+
threadId: string;
|
|
113
|
+
/**
|
|
114
|
+
* true if the message is sent by the logged in account
|
|
115
|
+
*/
|
|
116
|
+
isSelf: boolean;
|
|
117
|
+
constructor(uid: string, data: TGroupMessage);
|
|
118
|
+
}
|
|
119
|
+
/**
|
|
120
|
+
* Message Union Type
|
|
121
|
+
*/
|
|
122
|
+
export type Message = UserMessage | GroupMessage;
|
|
123
|
+
//# sourceMappingURL=message.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"message.d.ts","sourceRoot":"","sources":["../../../src/types/webhook/message.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,OAAO,EAAE,UAAU,EAAE,MAAM,SAAS,CAAC;AAErC;;GAEG;AACH,MAAM,WAAW,kBAAkB;IACjC,KAAK,EAAE,MAAM,CAAC;IACd,WAAW,EAAE,MAAM,CAAC;IACpB,IAAI,EAAE,MAAM,CAAC;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/**
|
|
3
|
+
* Message Types
|
|
4
|
+
* 100% khớp với zalo-personal-sdk/src/models/Message.ts
|
|
5
|
+
*/
|
|
6
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
7
|
+
exports.GroupMessage = exports.UserMessage = void 0;
|
|
8
|
+
const enums_1 = require("./enums");
|
|
9
|
+
/**
|
|
10
|
+
* User Message Class
|
|
11
|
+
*/
|
|
12
|
+
class UserMessage {
|
|
13
|
+
constructor(uid, data) {
|
|
14
|
+
this.type = enums_1.ThreadType.USER;
|
|
15
|
+
this.data = data;
|
|
16
|
+
this.threadId = data.uidFrom === "0" ? data.idTo : data.uidFrom;
|
|
17
|
+
this.isSelf = data.uidFrom === "0";
|
|
18
|
+
if (data.idTo === "0")
|
|
19
|
+
data.idTo = uid;
|
|
20
|
+
if (data.uidFrom === "0")
|
|
21
|
+
data.uidFrom = uid;
|
|
22
|
+
}
|
|
23
|
+
}
|
|
24
|
+
exports.UserMessage = UserMessage;
|
|
25
|
+
/**
|
|
26
|
+
* Group Message Class
|
|
27
|
+
*/
|
|
28
|
+
class GroupMessage {
|
|
29
|
+
constructor(uid, data) {
|
|
30
|
+
this.type = enums_1.ThreadType.GROUP;
|
|
31
|
+
this.data = data;
|
|
32
|
+
this.threadId = data.idTo;
|
|
33
|
+
this.isSelf = data.uidFrom === "0";
|
|
34
|
+
if (data.uidFrom === "0")
|
|
35
|
+
data.uidFrom = uid;
|
|
36
|
+
}
|
|
37
|
+
}
|
|
38
|
+
exports.GroupMessage = GroupMessage;
|
|
39
|
+
//# sourceMappingURL=message.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"message.js","sourceRoot":"","sources":["../../../src/types/webhook/message.ts"],"names":[],"mappings":";AAAA;;;GAGG;;;AAEH,mCAAqC;AAiGrC;;GAEG;AACH,MAAa,WAAW;IAStB,YAAY,GAAW,EAAE,IAAc;QARvC,SAAI,GAAoB,kBAAU,CAAC,IAAI,CAAC;QAStC,IAAI,CAAC,IAAI,GAAG,IAAI,CAAC;QACjB,IAAI,CAAC,QAAQ,GAAG,IAAI,CAAC,OAAO,KAAK,GAAG,CAAC,CAAC,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC,CAAC,IAAI,CAAC,OAAO,CAAC;QAChE,IAAI,CAAC,MAAM,GAAG,IAAI,CAAC,OAAO,KAAK,GAAG,CAAC;QAEnC,IAAI,IAAI,CAAC,IAAI,KAAK,GAAG;YAAE,IAAI,CAAC,IAAI,GAAG,GAAG,CAAC;QACvC,IAAI,IAAI,CAAC,OAAO,KAAK,GAAG;YAAE,IAAI,CAAC,OAAO,GAAG,GAAG,CAAC;IAC/C,CAAC;CACF;AAjBD,kCAiBC;AAED;;GAEG;AACH,MAAa,YAAY;IASvB,YAAY,GAAW,EAAE,IAAmB;QAR5C,SAAI,GAAqB,kBAAU,CAAC,KAAK,CAAC;QASxC,IAAI,CAAC,IAAI,GAAG,IAAI,CAAC;QACjB,IAAI,CAAC,QAAQ,GAAG,IAAI,CAAC,IAAI,CAAC;QAC1B,IAAI,CAAC,MAAM,GAAG,IAAI,CAAC,OAAO,KAAK,GAAG,CAAC;QAEnC,IAAI,IAAI,CAAC,OAAO,KAAK,GAAG;YAAE,IAAI,CAAC,OAAO,GAAG,GAAG,CAAC;IAC/C,CAAC;CACF;AAhBD,oCAgBC"}
|
|
@@ -0,0 +1,40 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Reaction Event Types
|
|
3
|
+
* 100% khớp với zalo-personal-sdk/src/models/Reaction.ts
|
|
4
|
+
*/
|
|
5
|
+
import { Reactions } from './enums';
|
|
6
|
+
/**
|
|
7
|
+
* Reaction Type
|
|
8
|
+
*/
|
|
9
|
+
export interface TReaction {
|
|
10
|
+
actionId: string;
|
|
11
|
+
msgId: string;
|
|
12
|
+
cliMsgId: string;
|
|
13
|
+
msgType: string;
|
|
14
|
+
uidFrom: string;
|
|
15
|
+
idTo: string;
|
|
16
|
+
dName?: string;
|
|
17
|
+
content: {
|
|
18
|
+
rMsg: {
|
|
19
|
+
gMsgID: string;
|
|
20
|
+
cMsgID: string;
|
|
21
|
+
msgType: number;
|
|
22
|
+
}[];
|
|
23
|
+
rIcon: Reactions;
|
|
24
|
+
rType: number;
|
|
25
|
+
source: number;
|
|
26
|
+
};
|
|
27
|
+
ts: string;
|
|
28
|
+
ttl: number;
|
|
29
|
+
}
|
|
30
|
+
/**
|
|
31
|
+
* Reaction Class
|
|
32
|
+
*/
|
|
33
|
+
export declare class Reaction {
|
|
34
|
+
data: TReaction;
|
|
35
|
+
threadId: string;
|
|
36
|
+
isSelf: boolean;
|
|
37
|
+
isGroup: boolean;
|
|
38
|
+
constructor(uid: string, data: TReaction, isGroup: boolean);
|
|
39
|
+
}
|
|
40
|
+
//# sourceMappingURL=reaction.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"reaction.d.ts","sourceRoot":"","sources":["../../../src/types/webhook/reaction.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,OAAO,EAAE,SAAS,EAAE,MAAM,SAAS,CAAC;AAEpC;;GAEG;AACH,MAAM,WAAW,SAAS;IACxB,QAAQ,EAAE,MAAM,CAAC;IACjB,KAAK,EAAE,MAAM,CAAC;IACd,QAAQ,EAAE,MAAM,CAAC;IACjB,OAAO,EAAE,MAAM,CAAC;IAChB,OAAO,EAAE,MAAM,CAAC;IAChB,IAAI,EAAE,MAAM,CAAC;IACb,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,OAAO,EAAE;QACP,IAAI,EAAE;YAAE,MAAM,EAAE,MAAM,CAAC;YAAC,MAAM,EAAE,MAAM,CAAC;YAAC,OAAO,EAAE,MAAM,CAAA;SAAE,EAAE,CAAC;QAC5D,KAAK,EAAE,SAAS,CAAC;QACjB,KAAK,EAAE,MAAM,CAAC;QACd,MAAM,EAAE,MAAM,CAAC;KAChB,CAAC;IACF,EAAE,EAAE,MAAM,CAAC;IACX,GAAG,EAAE,MAAM,CAAC;CACb;AAED;;GAEG;AACH,qBAAa,QAAQ;IACnB,IAAI,EAAE,SAAS,CAAC;IAChB,QAAQ,EAAE,MAAM,CAAC;IACjB,MAAM,EAAE,OAAO,CAAC;IAChB,OAAO,EAAE,OAAO,CAAC;gBAEL,GAAG,EAAE,MAAM,EAAE,IAAI,EAAE,SAAS,EAAE,OAAO,EAAE,OAAO;CAS3D"}
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
/**
|
|
3
|
+
* Reaction Event Types
|
|
4
|
+
* 100% khớp với zalo-personal-sdk/src/models/Reaction.ts
|
|
5
|
+
*/
|
|
6
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
7
|
+
exports.Reaction = void 0;
|
|
8
|
+
/**
|
|
9
|
+
* Reaction Class
|
|
10
|
+
*/
|
|
11
|
+
class Reaction {
|
|
12
|
+
constructor(uid, data, isGroup) {
|
|
13
|
+
this.data = data;
|
|
14
|
+
this.threadId = isGroup || data.uidFrom === "0" ? data.idTo : data.uidFrom;
|
|
15
|
+
this.isSelf = data.uidFrom === "0";
|
|
16
|
+
this.isGroup = isGroup;
|
|
17
|
+
if (data.idTo === "0")
|
|
18
|
+
data.idTo = uid;
|
|
19
|
+
if (data.uidFrom === "0")
|
|
20
|
+
data.uidFrom = uid;
|
|
21
|
+
}
|
|
22
|
+
}
|
|
23
|
+
exports.Reaction = Reaction;
|
|
24
|
+
//# sourceMappingURL=reaction.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"reaction.js","sourceRoot":"","sources":["../../../src/types/webhook/reaction.ts"],"names":[],"mappings":";AAAA;;;GAGG;;;AAyBH;;GAEG;AACH,MAAa,QAAQ;IAMnB,YAAY,GAAW,EAAE,IAAe,EAAE,OAAgB;QACxD,IAAI,CAAC,IAAI,GAAG,IAAI,CAAC;QACjB,IAAI,CAAC,QAAQ,GAAG,OAAO,IAAI,IAAI,CAAC,OAAO,KAAK,GAAG,CAAC,CAAC,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC,CAAC,IAAI,CAAC,OAAO,CAAC;QAC3E,IAAI,CAAC,MAAM,GAAG,IAAI,CAAC,OAAO,KAAK,GAAG,CAAC;QACnC,IAAI,CAAC,OAAO,GAAG,OAAO,CAAC;QAEvB,IAAI,IAAI,CAAC,IAAI,KAAK,GAAG;YAAE,IAAI,CAAC,IAAI,GAAG,GAAG,CAAC;QACvC,IAAI,IAAI,CAAC,OAAO,KAAK,GAAG;YAAE,IAAI,CAAC,OAAO,GAAG,GAAG,CAAC;IAC/C,CAAC;CACF;AAfD,4BAeC"}
|