@phuquy2203/n8n-nodes-zl-sumo 2.0.15

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.
Files changed (350) hide show
  1. package/README.md +0 -0
  2. package/dist/credentials/ZaloApi.credentials.d.ts +7 -0
  3. package/dist/credentials/ZaloApi.credentials.js +49 -0
  4. package/dist/nodes/Zalo/Zalo.node.d.ts +5 -0
  5. package/dist/nodes/Zalo/Zalo.node.js +260 -0
  6. package/dist/nodes/Zalo/zalo.png +0 -0
  7. package/dist/nodes/Zalo/zalo.svg +3 -0
  8. package/dist/src/Errors/ZaloApiError.d.ts +4 -0
  9. package/dist/src/Errors/ZaloApiError.js +11 -0
  10. package/dist/src/Errors/ZaloApiLoginQRAborted.d.ts +4 -0
  11. package/dist/src/Errors/ZaloApiLoginQRAborted.js +11 -0
  12. package/dist/src/Errors/ZaloApiLoginQRDeclined.d.ts +4 -0
  13. package/dist/src/Errors/ZaloApiLoginQRDeclined.js +11 -0
  14. package/dist/src/Errors/ZaloApiMissingImageMetadataGetter.d.ts +4 -0
  15. package/dist/src/Errors/ZaloApiMissingImageMetadataGetter.js +11 -0
  16. package/dist/src/Errors/index.d.ts +4 -0
  17. package/dist/src/Errors/index.js +20 -0
  18. package/dist/src/apis/acceptFriendRequest.d.ts +2 -0
  19. package/dist/src/apis/acceptFriendRequest.js +31 -0
  20. package/dist/src/apis/addGroupBlockedMember.d.ts +2 -0
  21. package/dist/src/apis/addGroupBlockedMember.js +31 -0
  22. package/dist/src/apis/addGroupDeputy.d.ts +2 -0
  23. package/dist/src/apis/addGroupDeputy.js +33 -0
  24. package/dist/src/apis/addPollOptions.d.ts +14 -0
  25. package/dist/src/apis/addPollOptions.js +29 -0
  26. package/dist/src/apis/addQuickMessage.d.ts +11 -0
  27. package/dist/src/apis/addQuickMessage.js +63 -0
  28. package/dist/src/apis/addReaction.d.ts +18 -0
  29. package/dist/src/apis/addReaction.js +297 -0
  30. package/dist/src/apis/addUnreadMark.d.ts +8 -0
  31. package/dist/src/apis/addUnreadMark.js +55 -0
  32. package/dist/src/apis/addUserToGroup.d.ts +5 -0
  33. package/dist/src/apis/addUserToGroup.js +37 -0
  34. package/dist/src/apis/blockUser.d.ts +2 -0
  35. package/dist/src/apis/blockUser.js +31 -0
  36. package/dist/src/apis/blockViewFeed.d.ts +2 -0
  37. package/dist/src/apis/blockViewFeed.js +33 -0
  38. package/dist/src/apis/changeAccountAvatar.d.ts +3 -0
  39. package/dist/src/apis/changeAccountAvatar.js +58 -0
  40. package/dist/src/apis/changeFriendAlias.d.ts +2 -0
  41. package/dist/src/apis/changeFriendAlias.js +30 -0
  42. package/dist/src/apis/changeGroupAvatar.d.ts +3 -0
  43. package/dist/src/apis/changeGroupAvatar.js +50 -0
  44. package/dist/src/apis/changeGroupName.d.ts +4 -0
  45. package/dist/src/apis/changeGroupName.js +35 -0
  46. package/dist/src/apis/changeGroupOwner.d.ts +4 -0
  47. package/dist/src/apis/changeGroupOwner.js +33 -0
  48. package/dist/src/apis/createAutoReply.d.ts +14 -0
  49. package/dist/src/apis/createAutoReply.js +40 -0
  50. package/dist/src/apis/createCatalog.d.ts +7 -0
  51. package/dist/src/apis/createCatalog.js +32 -0
  52. package/dist/src/apis/createGroup.d.ts +28 -0
  53. package/dist/src/apis/createGroup.js +46 -0
  54. package/dist/src/apis/createNote.d.ts +7 -0
  55. package/dist/src/apis/createNote.js +50 -0
  56. package/dist/src/apis/createPoll.d.ts +36 -0
  57. package/dist/src/apis/createPoll.js +43 -0
  58. package/dist/src/apis/createProductCatalog.d.ts +23 -0
  59. package/dist/src/apis/createProductCatalog.js +53 -0
  60. package/dist/src/apis/createReminder.d.ts +12 -0
  61. package/dist/src/apis/createReminder.js +66 -0
  62. package/dist/src/apis/custom.d.ts +9 -0
  63. package/dist/src/apis/custom.js +17 -0
  64. package/dist/src/apis/deleteAutoReply.d.ts +5 -0
  65. package/dist/src/apis/deleteAutoReply.js +32 -0
  66. package/dist/src/apis/deleteAvatar.d.ts +9 -0
  67. package/dist/src/apis/deleteAvatar.js +30 -0
  68. package/dist/src/apis/deleteCatalog.d.ts +2 -0
  69. package/dist/src/apis/deleteCatalog.js +31 -0
  70. package/dist/src/apis/deleteChat.d.ts +19 -0
  71. package/dist/src/apis/deleteChat.js +53 -0
  72. package/dist/src/apis/deleteGroupInviteBox.d.ts +9 -0
  73. package/dist/src/apis/deleteGroupInviteBox.js +30 -0
  74. package/dist/src/apis/deleteMessage.d.ts +14 -0
  75. package/dist/src/apis/deleteMessage.js +55 -0
  76. package/dist/src/apis/deleteProductCatalog.d.ts +10 -0
  77. package/dist/src/apis/deleteProductCatalog.js +34 -0
  78. package/dist/src/apis/disableGroupLink.d.ts +2 -0
  79. package/dist/src/apis/disableGroupLink.js +27 -0
  80. package/dist/src/apis/disperseGroup.d.ts +2 -0
  81. package/dist/src/apis/disperseGroup.js +31 -0
  82. package/dist/src/apis/editNote.d.ts +17 -0
  83. package/dist/src/apis/editNote.js +49 -0
  84. package/dist/src/apis/editReminder.d.ts +13 -0
  85. package/dist/src/apis/editReminder.js +64 -0
  86. package/dist/src/apis/enableGroupLink.d.ts +6 -0
  87. package/dist/src/apis/enableGroupLink.js +28 -0
  88. package/dist/src/apis/fetchAccountInfo.d.ts +3 -0
  89. package/dist/src/apis/fetchAccountInfo.js +13 -0
  90. package/dist/src/apis/findUser.d.ts +15 -0
  91. package/dist/src/apis/findUser.js +43 -0
  92. package/dist/src/apis/forwardMessage.d.ts +24 -0
  93. package/dist/src/apis/forwardMessage.js +102 -0
  94. package/dist/src/apis/getAliasList.d.ts +8 -0
  95. package/dist/src/apis/getAliasList.js +30 -0
  96. package/dist/src/apis/getAllFriends.d.ts +3 -0
  97. package/dist/src/apis/getAllFriends.js +35 -0
  98. package/dist/src/apis/getAllGroups.d.ts +7 -0
  99. package/dist/src/apis/getAllGroups.js +13 -0
  100. package/dist/src/apis/getArchivedChatList.d.ts +5 -0
  101. package/dist/src/apis/getArchivedChatList.js +26 -0
  102. package/dist/src/apis/getAutoDeleteChat.d.ts +9 -0
  103. package/dist/src/apis/getAutoDeleteChat.js +24 -0
  104. package/dist/src/apis/getAutoReplyList.d.ts +6 -0
  105. package/dist/src/apis/getAutoReplyList.js +27 -0
  106. package/dist/src/apis/getAvatarList.d.ts +12 -0
  107. package/dist/src/apis/getAvatarList.js +31 -0
  108. package/dist/src/apis/getBizAccount.d.ts +24 -0
  109. package/dist/src/apis/getBizAccount.js +30 -0
  110. package/dist/src/apis/getCatalogList.d.ts +18 -0
  111. package/dist/src/apis/getCatalogList.js +35 -0
  112. package/dist/src/apis/getContext.d.ts +1 -0
  113. package/dist/src/apis/getContext.js +7 -0
  114. package/dist/src/apis/getCookie.d.ts +1 -0
  115. package/dist/src/apis/getCookie.js +12 -0
  116. package/dist/src/apis/getFriendBoardList.d.ts +5 -0
  117. package/dist/src/apis/getFriendBoardList.js +29 -0
  118. package/dist/src/apis/getFriendOnlines.d.ts +10 -0
  119. package/dist/src/apis/getFriendOnlines.js +38 -0
  120. package/dist/src/apis/getFriendRecommendations.d.ts +42 -0
  121. package/dist/src/apis/getFriendRecommendations.js +30 -0
  122. package/dist/src/apis/getFriendRequestStatus.d.ts +8 -0
  123. package/dist/src/apis/getFriendRequestStatus.js +28 -0
  124. package/dist/src/apis/getGroupBlockedMember.d.ts +23 -0
  125. package/dist/src/apis/getGroupBlockedMember.js +32 -0
  126. package/dist/src/apis/getGroupInfo.d.ts +16 -0
  127. package/dist/src/apis/getGroupInfo.js +35 -0
  128. package/dist/src/apis/getGroupInviteBoxInfo.d.ts +32 -0
  129. package/dist/src/apis/getGroupInviteBoxInfo.js +41 -0
  130. package/dist/src/apis/getGroupInviteBoxList.d.ts +38 -0
  131. package/dist/src/apis/getGroupInviteBoxList.js +34 -0
  132. package/dist/src/apis/getGroupLinkDetail.d.ts +9 -0
  133. package/dist/src/apis/getGroupLinkDetail.js +28 -0
  134. package/dist/src/apis/getGroupLinkInfo.d.ts +34 -0
  135. package/dist/src/apis/getGroupLinkInfo.js +31 -0
  136. package/dist/src/apis/getGroupMembersInfo.d.ts +17 -0
  137. package/dist/src/apis/getGroupMembersInfo.js +27 -0
  138. package/dist/src/apis/getHiddenConversations.d.ts +11 -0
  139. package/dist/src/apis/getHiddenConversations.js +26 -0
  140. package/dist/src/apis/getLabels.d.ts +7 -0
  141. package/dist/src/apis/getLabels.js +31 -0
  142. package/dist/src/apis/getListBoard.d.ts +21 -0
  143. package/dist/src/apis/getListBoard.js +48 -0
  144. package/dist/src/apis/getListReminder.d.ts +28 -0
  145. package/dist/src/apis/getListReminder.js +50 -0
  146. package/dist/src/apis/getMute.d.ts +13 -0
  147. package/dist/src/apis/getMute.js +25 -0
  148. package/dist/src/apis/getOwnId.d.ts +1 -0
  149. package/dist/src/apis/getOwnId.js +7 -0
  150. package/dist/src/apis/getPendingGroupMembers.d.ts +11 -0
  151. package/dist/src/apis/getPendingGroupMembers.js +30 -0
  152. package/dist/src/apis/getPinConversations.d.ts +5 -0
  153. package/dist/src/apis/getPinConversations.js +25 -0
  154. package/dist/src/apis/getPollDetail.d.ts +3 -0
  155. package/dist/src/apis/getPollDetail.js +33 -0
  156. package/dist/src/apis/getProductCatalogList.d.ts +20 -0
  157. package/dist/src/apis/getProductCatalogList.js +36 -0
  158. package/dist/src/apis/getQR.d.ts +4 -0
  159. package/dist/src/apis/getQR.js +32 -0
  160. package/dist/src/apis/getQuickMessageList.d.ts +7 -0
  161. package/dist/src/apis/getQuickMessageList.js +27 -0
  162. package/dist/src/apis/getRelatedFriendGroup.d.ts +6 -0
  163. package/dist/src/apis/getRelatedFriendGroup.js +33 -0
  164. package/dist/src/apis/getReminder.d.ts +3 -0
  165. package/dist/src/apis/getReminder.js +28 -0
  166. package/dist/src/apis/getReminderResponses.d.ts +5 -0
  167. package/dist/src/apis/getReminderResponses.js +27 -0
  168. package/dist/src/apis/getSentFriendRequest.d.ts +18 -0
  169. package/dist/src/apis/getSentFriendRequest.js +27 -0
  170. package/dist/src/apis/getSettings.d.ts +3 -0
  171. package/dist/src/apis/getSettings.js +23 -0
  172. package/dist/src/apis/getStickers.d.ts +1 -0
  173. package/dist/src/apis/getStickers.js +43 -0
  174. package/dist/src/apis/getStickersDetail.d.ts +24 -0
  175. package/dist/src/apis/getStickersDetail.js +43 -0
  176. package/dist/src/apis/getUnreadMark.d.ts +14 -0
  177. package/dist/src/apis/getUnreadMark.js +33 -0
  178. package/dist/src/apis/getUserInfo.d.ts +8 -0
  179. package/dist/src/apis/getUserInfo.js +45 -0
  180. package/dist/src/apis/inviteUserToGroups.d.ts +10 -0
  181. package/dist/src/apis/inviteUserToGroups.js +33 -0
  182. package/dist/src/apis/joinGroupInviteBox.d.ts +2 -0
  183. package/dist/src/apis/joinGroupInviteBox.js +28 -0
  184. package/dist/src/apis/joinGroupLink.d.ts +2 -0
  185. package/dist/src/apis/joinGroupLink.js +30 -0
  186. package/dist/src/apis/keepAlive.d.ts +4 -0
  187. package/dist/src/apis/keepAlive.js +25 -0
  188. package/dist/src/apis/lastOnline.d.ts +7 -0
  189. package/dist/src/apis/lastOnline.js +29 -0
  190. package/dist/src/apis/leaveGroup.d.ts +4 -0
  191. package/dist/src/apis/leaveGroup.js +36 -0
  192. package/dist/src/apis/listen.d.ts +103 -0
  193. package/dist/src/apis/listen.js +432 -0
  194. package/dist/src/apis/lockPoll.d.ts +2 -0
  195. package/dist/src/apis/lockPoll.js +31 -0
  196. package/dist/src/apis/login.d.ts +3 -0
  197. package/dist/src/apis/login.js +101 -0
  198. package/dist/src/apis/loginQR.d.ts +70 -0
  199. package/dist/src/apis/loginQR.js +369 -0
  200. package/dist/src/apis/parseLink.d.ts +21 -0
  201. package/dist/src/apis/parseLink.js +30 -0
  202. package/dist/src/apis/rejectFriendRequest.d.ts +2 -0
  203. package/dist/src/apis/rejectFriendRequest.js +30 -0
  204. package/dist/src/apis/removeFriend.d.ts +2 -0
  205. package/dist/src/apis/removeFriend.js +31 -0
  206. package/dist/src/apis/removeFriendAlias.d.ts +2 -0
  207. package/dist/src/apis/removeFriendAlias.js +27 -0
  208. package/dist/src/apis/removeGroupBlockedMember.d.ts +2 -0
  209. package/dist/src/apis/removeGroupBlockedMember.js +31 -0
  210. package/dist/src/apis/removeGroupDeputy.d.ts +2 -0
  211. package/dist/src/apis/removeGroupDeputy.js +33 -0
  212. package/dist/src/apis/removeQuickMessage.d.ts +5 -0
  213. package/dist/src/apis/removeQuickMessage.js +30 -0
  214. package/dist/src/apis/removeReminder.d.ts +3 -0
  215. package/dist/src/apis/removeReminder.js +43 -0
  216. package/dist/src/apis/removeUnreadMark.d.ts +8 -0
  217. package/dist/src/apis/removeUnreadMark.js +53 -0
  218. package/dist/src/apis/removeUserFromGroup.d.ts +4 -0
  219. package/dist/src/apis/removeUserFromGroup.js +37 -0
  220. package/dist/src/apis/resetHiddenConversPin.d.ts +2 -0
  221. package/dist/src/apis/resetHiddenConversPin.js +23 -0
  222. package/dist/src/apis/reuseAvatar.d.ts +2 -0
  223. package/dist/src/apis/reuseAvatar.js +29 -0
  224. package/dist/src/apis/reviewPendingMemberRequest.d.ts +14 -0
  225. package/dist/src/apis/reviewPendingMemberRequest.js +41 -0
  226. package/dist/src/apis/sendBankCard.d.ts +9 -0
  227. package/dist/src/apis/sendBankCard.js +40 -0
  228. package/dist/src/apis/sendCard.d.ts +10 -0
  229. package/dist/src/apis/sendCard.js +62 -0
  230. package/dist/src/apis/sendDeliveredEvent.d.ts +16 -0
  231. package/dist/src/apis/sendDeliveredEvent.js +58 -0
  232. package/dist/src/apis/sendFriendRequest.d.ts +2 -0
  233. package/dist/src/apis/sendFriendRequest.js +42 -0
  234. package/dist/src/apis/sendLink.d.ts +10 -0
  235. package/dist/src/apis/sendLink.js +64 -0
  236. package/dist/src/apis/sendMessage.d.ts +99 -0
  237. package/dist/src/apis/sendMessage.js +455 -0
  238. package/dist/src/apis/sendReport.d.ts +17 -0
  239. package/dist/src/apis/sendReport.js +56 -0
  240. package/dist/src/apis/sendSeenEvent.d.ts +16 -0
  241. package/dist/src/apis/sendSeenEvent.js +66 -0
  242. package/dist/src/apis/sendSticker.d.ts +10 -0
  243. package/dist/src/apis/sendSticker.js +60 -0
  244. package/dist/src/apis/sendTypingEvent.d.ts +5 -0
  245. package/dist/src/apis/sendTypingEvent.js +36 -0
  246. package/dist/src/apis/sendVideo.d.ts +35 -0
  247. package/dist/src/apis/sendVideo.js +121 -0
  248. package/dist/src/apis/sendVoice.d.ts +12 -0
  249. package/dist/src/apis/sendVoice.js +76 -0
  250. package/dist/src/apis/setArchivedConversations.d.ts +10 -0
  251. package/dist/src/apis/setArchivedConversations.js +37 -0
  252. package/dist/src/apis/setHiddenConversations.d.ts +3 -0
  253. package/dist/src/apis/setHiddenConversations.js +42 -0
  254. package/dist/src/apis/setMute.d.ts +20 -0
  255. package/dist/src/apis/setMute.js +70 -0
  256. package/dist/src/apis/setPinnedConversations.d.ts +3 -0
  257. package/dist/src/apis/setPinnedConversations.js +37 -0
  258. package/dist/src/apis/sharePoll.d.ts +2 -0
  259. package/dist/src/apis/sharePoll.js +31 -0
  260. package/dist/src/apis/unblockUser.d.ts +2 -0
  261. package/dist/src/apis/unblockUser.js +31 -0
  262. package/dist/src/apis/undo.d.ts +9 -0
  263. package/dist/src/apis/undo.js +45 -0
  264. package/dist/src/apis/undoFriendRequest.d.ts +2 -0
  265. package/dist/src/apis/undoFriendRequest.js +30 -0
  266. package/dist/src/apis/updateActiveStatus.d.ts +4 -0
  267. package/dist/src/apis/updateActiveStatus.js +30 -0
  268. package/dist/src/apis/updateAutoDeleteChat.d.ts +9 -0
  269. package/dist/src/apis/updateAutoDeleteChat.js +43 -0
  270. package/dist/src/apis/updateAutoReply.d.ts +15 -0
  271. package/dist/src/apis/updateAutoReply.js +41 -0
  272. package/dist/src/apis/updateCatalog.d.ts +11 -0
  273. package/dist/src/apis/updateCatalog.js +33 -0
  274. package/dist/src/apis/updateGroupSettings.d.ts +40 -0
  275. package/dist/src/apis/updateGroupSettings.js +46 -0
  276. package/dist/src/apis/updateHiddenConversPin.d.ts +2 -0
  277. package/dist/src/apis/updateHiddenConversPin.js +33 -0
  278. package/dist/src/apis/updateLabels.d.ts +15 -0
  279. package/dist/src/apis/updateLabels.js +37 -0
  280. package/dist/src/apis/updateLang.d.ts +6 -0
  281. package/dist/src/apis/updateLang.js +33 -0
  282. package/dist/src/apis/updateProductCatalog.d.ts +25 -0
  283. package/dist/src/apis/updateProductCatalog.js +54 -0
  284. package/dist/src/apis/updateProfile.d.ts +20 -0
  285. package/dist/src/apis/updateProfile.js +46 -0
  286. package/dist/src/apis/updateQuickMessage.d.ts +11 -0
  287. package/dist/src/apis/updateQuickMessage.js +64 -0
  288. package/dist/src/apis/updateSettings.d.ts +16 -0
  289. package/dist/src/apis/updateSettings.js +93 -0
  290. package/dist/src/apis/uploadAttachment.d.ts +50 -0
  291. package/dist/src/apis/uploadAttachment.js +202 -0
  292. package/dist/src/apis/uploadProductPhoto.d.ts +14 -0
  293. package/dist/src/apis/uploadProductPhoto.js +56 -0
  294. package/dist/src/apis/votePoll.d.ts +5 -0
  295. package/dist/src/apis/votePoll.js +32 -0
  296. package/dist/src/apis.d.ts +279 -0
  297. package/dist/src/apis.js +283 -0
  298. package/dist/src/context.d.ts +183 -0
  299. package/dist/src/context.js +33 -0
  300. package/dist/src/index.d.ts +146 -0
  301. package/dist/src/index.js +41 -0
  302. package/dist/src/models/Attachment.d.ts +11 -0
  303. package/dist/src/models/Attachment.js +2 -0
  304. package/dist/src/models/AutoReply.d.ts +20 -0
  305. package/dist/src/models/AutoReply.js +10 -0
  306. package/dist/src/models/Board.d.ts +60 -0
  307. package/dist/src/models/Board.js +9 -0
  308. package/dist/src/models/Catalog.d.ts +16 -0
  309. package/dist/src/models/Catalog.js +2 -0
  310. package/dist/src/models/DeliveredMessage.d.ts +27 -0
  311. package/dist/src/models/DeliveredMessage.js +22 -0
  312. package/dist/src/models/Enum.d.ts +247 -0
  313. package/dist/src/models/Enum.js +254 -0
  314. package/dist/src/models/FriendEvent.d.ts +107 -0
  315. package/dist/src/models/FriendEvent.js +87 -0
  316. package/dist/src/models/Group.d.ts +125 -0
  317. package/dist/src/models/Group.js +14 -0
  318. package/dist/src/models/GroupEvent.d.ts +178 -0
  319. package/dist/src/models/GroupEvent.js +94 -0
  320. package/dist/src/models/Label.d.ts +10 -0
  321. package/dist/src/models/Label.js +2 -0
  322. package/dist/src/models/Message.d.ts +91 -0
  323. package/dist/src/models/Message.js +34 -0
  324. package/dist/src/models/ProductCatalog.d.ts +17 -0
  325. package/dist/src/models/ProductCatalog.js +2 -0
  326. package/dist/src/models/QuickMessage.d.ts +25 -0
  327. package/dist/src/models/QuickMessage.js +2 -0
  328. package/dist/src/models/Reaction.d.ts +85 -0
  329. package/dist/src/models/Reaction.js +74 -0
  330. package/dist/src/models/Reminder.d.ts +51 -0
  331. package/dist/src/models/Reminder.js +10 -0
  332. package/dist/src/models/SeenMessage.d.ts +26 -0
  333. package/dist/src/models/SeenMessage.js +22 -0
  334. package/dist/src/models/Typing.d.ts +24 -0
  335. package/dist/src/models/Typing.js +22 -0
  336. package/dist/src/models/Undo.d.ts +34 -0
  337. package/dist/src/models/Undo.js +16 -0
  338. package/dist/src/models/User.d.ts +49 -0
  339. package/dist/src/models/User.js +2 -0
  340. package/dist/src/models/ZBusiness.d.ts +22 -0
  341. package/dist/src/models/ZBusiness.js +38 -0
  342. package/dist/src/models/index.d.ts +20 -0
  343. package/dist/src/models/index.js +36 -0
  344. package/dist/src/update.d.ts +2 -0
  345. package/dist/src/update.js +33 -0
  346. package/dist/src/utils.d.ts +169 -0
  347. package/dist/src/utils.js +737 -0
  348. package/dist/src/zalo.d.ts +41 -0
  349. package/dist/src/zalo.js +110 -0
  350. package/package.json +60 -0
@@ -0,0 +1,74 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.Reaction = exports.Reactions = void 0;
4
+ var Reactions;
5
+ (function (Reactions) {
6
+ Reactions["HEART"] = "/-heart";
7
+ Reactions["LIKE"] = "/-strong";
8
+ Reactions["HAHA"] = ":>";
9
+ Reactions["WOW"] = ":o";
10
+ Reactions["CRY"] = ":-((";
11
+ Reactions["ANGRY"] = ":-h";
12
+ Reactions["KISS"] = ":-*";
13
+ Reactions["TEARS_OF_JOY"] = ":')";
14
+ Reactions["SHIT"] = "/-shit";
15
+ Reactions["ROSE"] = "/-rose";
16
+ Reactions["BROKEN_HEART"] = "/-break";
17
+ Reactions["DISLIKE"] = "/-weak";
18
+ Reactions["LOVE"] = ";xx";
19
+ Reactions["CONFUSED"] = ";-/";
20
+ Reactions["WINK"] = ";-)";
21
+ Reactions["FADE"] = "/-fade";
22
+ Reactions["SUN"] = "/-li";
23
+ Reactions["BIRTHDAY"] = "/-bd";
24
+ Reactions["BOMB"] = "/-bome";
25
+ Reactions["OK"] = "/-ok";
26
+ Reactions["PEACE"] = "/-v";
27
+ Reactions["THANKS"] = "/-thanks";
28
+ Reactions["PUNCH"] = "/-punch";
29
+ Reactions["SHARE"] = "/-share";
30
+ Reactions["PRAY"] = "_()_";
31
+ Reactions["NO"] = "/-no";
32
+ Reactions["BAD"] = "/-bad";
33
+ Reactions["LOVE_YOU"] = "/-loveu";
34
+ Reactions["SAD"] = "--b";
35
+ Reactions["VERY_SAD"] = ":((";
36
+ Reactions["COOL"] = "x-)";
37
+ Reactions["NERD"] = "8-)";
38
+ Reactions["BIG_SMILE"] = ";-d";
39
+ Reactions["SUNGLASSES"] = "b-)";
40
+ Reactions["NEUTRAL"] = ":--|";
41
+ Reactions["SAD_FACE"] = "p-(";
42
+ Reactions["BYE"] = ":-bye";
43
+ Reactions["SLEEPY"] = "|-)";
44
+ Reactions["WIPE"] = ":wipe";
45
+ Reactions["DIG"] = ":-dig";
46
+ Reactions["ANGUISH"] = "&-(";
47
+ Reactions["HANDCLAP"] = ":handclap";
48
+ Reactions["ANGRY_FACE"] = ">-|";
49
+ Reactions["F_CHAIR"] = ":-f";
50
+ Reactions["L_CHAIR"] = ":-l";
51
+ Reactions["R_CHAIR"] = ":-r";
52
+ Reactions["SILENT"] = ";-x";
53
+ Reactions["SURPRISE"] = ":-o";
54
+ Reactions["EMBARRASSED"] = ";-s";
55
+ Reactions["AFRAID"] = ";-a";
56
+ Reactions["SAD2"] = ":-<";
57
+ Reactions["BIG_LAUGH"] = ":))";
58
+ Reactions["RICH"] = "$-)";
59
+ Reactions["BEER"] = "/-beer";
60
+ Reactions["NONE"] = "";
61
+ })(Reactions || (exports.Reactions = Reactions = {}));
62
+ class Reaction {
63
+ constructor(uid, data, isGroup) {
64
+ this.data = data;
65
+ this.threadId = isGroup || data.uidFrom == "0" ? data.idTo : data.uidFrom;
66
+ this.isSelf = data.uidFrom == "0";
67
+ this.isGroup = isGroup;
68
+ if (data.idTo == "0")
69
+ data.idTo = uid;
70
+ if (data.uidFrom == "0")
71
+ data.uidFrom = uid;
72
+ }
73
+ }
74
+ exports.Reaction = Reaction;
@@ -0,0 +1,51 @@
1
+ export declare enum ReminderRepeatMode {
2
+ None = 0,
3
+ Daily = 1,
4
+ Weekly = 2,
5
+ Monthly = 3
6
+ }
7
+ export type ReminderUser = {
8
+ creatorUid: string;
9
+ toUid: string;
10
+ emoji: string;
11
+ color: number;
12
+ reminderId: string;
13
+ createTime: number;
14
+ repeat: ReminderRepeatMode;
15
+ startTime: number;
16
+ editTime: number;
17
+ endTime: number;
18
+ params: {
19
+ title: string;
20
+ setTitle: boolean;
21
+ };
22
+ type: number;
23
+ };
24
+ export type ReminderGroup = {
25
+ editorId: string;
26
+ emoji: string;
27
+ color: number;
28
+ groupId: string;
29
+ creatorId: string;
30
+ editTime: number;
31
+ eventType: number;
32
+ responseMem: {
33
+ rejectMember: number;
34
+ myResp: number;
35
+ acceptMember: number;
36
+ };
37
+ params: {
38
+ title: string;
39
+ setTitle?: boolean;
40
+ };
41
+ type: number;
42
+ duration: number;
43
+ repeatInfo: {
44
+ list_ts: unknown[];
45
+ } | null;
46
+ repeatData: unknown[];
47
+ createTime: number;
48
+ repeat: ReminderRepeatMode;
49
+ startTime: number;
50
+ id: string;
51
+ };
@@ -0,0 +1,10 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.ReminderRepeatMode = void 0;
4
+ var ReminderRepeatMode;
5
+ (function (ReminderRepeatMode) {
6
+ ReminderRepeatMode[ReminderRepeatMode["None"] = 0] = "None";
7
+ ReminderRepeatMode[ReminderRepeatMode["Daily"] = 1] = "Daily";
8
+ ReminderRepeatMode[ReminderRepeatMode["Weekly"] = 2] = "Weekly";
9
+ ReminderRepeatMode[ReminderRepeatMode["Monthly"] = 3] = "Monthly";
10
+ })(ReminderRepeatMode || (exports.ReminderRepeatMode = ReminderRepeatMode = {}));
@@ -0,0 +1,26 @@
1
+ import { ThreadType } from "./Enum.js";
2
+ export type TUserSeenMessage = {
3
+ idTo: string;
4
+ msgId: string;
5
+ realMsgId: string;
6
+ };
7
+ export type TGroupSeenMessage = {
8
+ msgId: string;
9
+ groupId: string;
10
+ seenUids: string[];
11
+ };
12
+ export declare class UserSeenMessage {
13
+ type: ThreadType.User;
14
+ data: TUserSeenMessage;
15
+ threadId: string;
16
+ isSelf: false;
17
+ constructor(data: TUserSeenMessage);
18
+ }
19
+ export declare class GroupSeenMessage {
20
+ type: ThreadType.Group;
21
+ data: TGroupSeenMessage;
22
+ threadId: string;
23
+ isSelf: boolean;
24
+ constructor(uid: string, data: TGroupSeenMessage);
25
+ }
26
+ export type SeenMessage = UserSeenMessage | GroupSeenMessage;
@@ -0,0 +1,22 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.GroupSeenMessage = exports.UserSeenMessage = void 0;
4
+ const Enum_js_1 = require("./Enum.js");
5
+ class UserSeenMessage {
6
+ constructor(data) {
7
+ this.type = Enum_js_1.ThreadType.User;
8
+ this.data = data;
9
+ this.threadId = data.idTo;
10
+ this.isSelf = false;
11
+ }
12
+ }
13
+ exports.UserSeenMessage = UserSeenMessage;
14
+ class GroupSeenMessage {
15
+ constructor(uid, data) {
16
+ this.type = Enum_js_1.ThreadType.Group;
17
+ this.data = data;
18
+ this.threadId = data.groupId;
19
+ this.isSelf = data.seenUids.includes(uid);
20
+ }
21
+ }
22
+ exports.GroupSeenMessage = GroupSeenMessage;
@@ -0,0 +1,24 @@
1
+ import { ThreadType } from "./Enum.js";
2
+ export type TTyping = {
3
+ uid: string;
4
+ ts: string;
5
+ isPC: 0 | 1;
6
+ };
7
+ export type TGroupTyping = TTyping & {
8
+ gid: string;
9
+ };
10
+ export declare class UserTyping {
11
+ type: ThreadType.User;
12
+ data: TTyping;
13
+ threadId: string;
14
+ isSelf: false;
15
+ constructor(data: TTyping);
16
+ }
17
+ export declare class GroupTyping {
18
+ type: ThreadType.Group;
19
+ data: TGroupTyping;
20
+ threadId: string;
21
+ isSelf: false;
22
+ constructor(data: TGroupTyping);
23
+ }
24
+ export type Typing = UserTyping | GroupTyping;
@@ -0,0 +1,22 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.GroupTyping = exports.UserTyping = void 0;
4
+ const Enum_js_1 = require("./Enum.js");
5
+ class UserTyping {
6
+ constructor(data) {
7
+ this.type = Enum_js_1.ThreadType.User;
8
+ this.data = data;
9
+ this.threadId = data.uid;
10
+ this.isSelf = false;
11
+ }
12
+ }
13
+ exports.UserTyping = UserTyping;
14
+ class GroupTyping {
15
+ constructor(data) {
16
+ this.type = Enum_js_1.ThreadType.Group;
17
+ this.data = data;
18
+ this.threadId = data.gid;
19
+ this.isSelf = false;
20
+ }
21
+ }
22
+ exports.GroupTyping = GroupTyping;
@@ -0,0 +1,34 @@
1
+ export type TUndoContent = {
2
+ globalMsgId: number;
3
+ cliMsgId: number;
4
+ deleteMsg: number;
5
+ srcId: number;
6
+ destId: number;
7
+ };
8
+ export type TUndo = {
9
+ actionId: string;
10
+ msgId: string;
11
+ cliMsgId: string;
12
+ msgType: string;
13
+ uidFrom: string;
14
+ idTo: string;
15
+ dName: string;
16
+ ts: string;
17
+ status: number;
18
+ content: TUndoContent;
19
+ notify: string;
20
+ ttl: number;
21
+ userId: string;
22
+ uin: string;
23
+ cmd: number;
24
+ st: number;
25
+ at: number;
26
+ realMsgId: string;
27
+ };
28
+ export declare class Undo {
29
+ data: TUndo;
30
+ threadId: string;
31
+ isSelf: boolean;
32
+ isGroup: boolean;
33
+ constructor(uid: string, data: TUndo, isGroup: boolean);
34
+ }
@@ -0,0 +1,16 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.Undo = void 0;
4
+ class Undo {
5
+ constructor(uid, data, isGroup) {
6
+ this.data = data;
7
+ this.threadId = isGroup || data.uidFrom == "0" ? data.idTo : data.uidFrom;
8
+ this.isSelf = data.uidFrom == "0";
9
+ this.isGroup = isGroup;
10
+ if (data.idTo == "0")
11
+ data.idTo = uid;
12
+ if (data.uidFrom == "0")
13
+ data.uidFrom = uid;
14
+ }
15
+ }
16
+ exports.Undo = Undo;
@@ -0,0 +1,49 @@
1
+ import type { Gender } from "./Enum.js";
2
+ import type { ZBusinessPackage } from "./ZBusiness.js";
3
+ export type User = {
4
+ userId: string;
5
+ username: string;
6
+ displayName: string;
7
+ zaloName: string;
8
+ avatar: string;
9
+ bgavatar: string;
10
+ cover: string;
11
+ gender: Gender;
12
+ dob: number;
13
+ sdob: string;
14
+ status: string;
15
+ phoneNumber: string;
16
+ isFr: number;
17
+ isBlocked: number;
18
+ lastActionTime: number;
19
+ lastUpdateTime: number;
20
+ isActive: number;
21
+ key: number;
22
+ type: number;
23
+ isActivePC: number;
24
+ isActiveWeb: number;
25
+ isValid: number;
26
+ userKey: string;
27
+ accountStatus: number;
28
+ oaInfo: unknown;
29
+ user_mode: number;
30
+ globalId: string;
31
+ bizPkg: ZBusinessPackage;
32
+ createdTs: number;
33
+ oa_status: unknown;
34
+ };
35
+ export type UserSetting = {
36
+ add_friend_via_contact: number;
37
+ display_on_recommend_friend: number;
38
+ add_friend_via_group: number;
39
+ add_friend_via_qr: number;
40
+ quick_message_status: number;
41
+ show_online_status: boolean;
42
+ accept_stranger_call: number;
43
+ archived_chat_status: number;
44
+ receive_message: number;
45
+ add_friend_via_phone: number;
46
+ display_seen_status: number;
47
+ view_birthday: number;
48
+ setting_2FA_status: number;
49
+ };
@@ -0,0 +1,2 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
@@ -0,0 +1,22 @@
1
+ export type ZBusinessPackage = {
2
+ label?: Record<string, string> | null;
3
+ pkgId: number;
4
+ };
5
+ export declare enum BusinessCategory {
6
+ Other = 0,
7
+ RealEstate = 1,
8
+ TechnologyAndDevices = 2,
9
+ TravelAndHospitality = 3,
10
+ EducationAndTraining = 4,
11
+ ShoppingAndRetail = 5,
12
+ CosmeticsAndBeauty = 6,
13
+ RestaurantAndCafe = 7,
14
+ AutoAndMotorbike = 8,
15
+ FashionAndApparel = 9,
16
+ FoodAndBeverage = 10,
17
+ MediaAndEntertainment = 11,
18
+ InternalCommunications = 12,
19
+ Transportation = 13,
20
+ Telecommunications = 14
21
+ }
22
+ export declare const BusinessCategoryName: Record<BusinessCategory, string>;
@@ -0,0 +1,38 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.BusinessCategoryName = exports.BusinessCategory = void 0;
4
+ var BusinessCategory;
5
+ (function (BusinessCategory) {
6
+ BusinessCategory[BusinessCategory["Other"] = 0] = "Other";
7
+ BusinessCategory[BusinessCategory["RealEstate"] = 1] = "RealEstate";
8
+ BusinessCategory[BusinessCategory["TechnologyAndDevices"] = 2] = "TechnologyAndDevices";
9
+ BusinessCategory[BusinessCategory["TravelAndHospitality"] = 3] = "TravelAndHospitality";
10
+ BusinessCategory[BusinessCategory["EducationAndTraining"] = 4] = "EducationAndTraining";
11
+ BusinessCategory[BusinessCategory["ShoppingAndRetail"] = 5] = "ShoppingAndRetail";
12
+ BusinessCategory[BusinessCategory["CosmeticsAndBeauty"] = 6] = "CosmeticsAndBeauty";
13
+ BusinessCategory[BusinessCategory["RestaurantAndCafe"] = 7] = "RestaurantAndCafe";
14
+ BusinessCategory[BusinessCategory["AutoAndMotorbike"] = 8] = "AutoAndMotorbike";
15
+ BusinessCategory[BusinessCategory["FashionAndApparel"] = 9] = "FashionAndApparel";
16
+ BusinessCategory[BusinessCategory["FoodAndBeverage"] = 10] = "FoodAndBeverage";
17
+ BusinessCategory[BusinessCategory["MediaAndEntertainment"] = 11] = "MediaAndEntertainment";
18
+ BusinessCategory[BusinessCategory["InternalCommunications"] = 12] = "InternalCommunications";
19
+ BusinessCategory[BusinessCategory["Transportation"] = 13] = "Transportation";
20
+ BusinessCategory[BusinessCategory["Telecommunications"] = 14] = "Telecommunications";
21
+ })(BusinessCategory || (exports.BusinessCategory = BusinessCategory = {}));
22
+ exports.BusinessCategoryName = {
23
+ [BusinessCategory.Other]: "Dịch vụ khác (Không hiển thị)",
24
+ [BusinessCategory.RealEstate]: "Bất động sản",
25
+ [BusinessCategory.TechnologyAndDevices]: "Công nghệ & Thiết bị",
26
+ [BusinessCategory.TravelAndHospitality]: "Du lịch & Lưu trú",
27
+ [BusinessCategory.EducationAndTraining]: "Giáo dục & Đào tạo",
28
+ [BusinessCategory.ShoppingAndRetail]: "Mua sắm & Bán lẻ",
29
+ [BusinessCategory.CosmeticsAndBeauty]: "Mỹ phẩm & Làm đẹp",
30
+ [BusinessCategory.RestaurantAndCafe]: "Nhà hàng & Quán",
31
+ [BusinessCategory.AutoAndMotorbike]: "Ô tô & Xe máy",
32
+ [BusinessCategory.FashionAndApparel]: "Thời trang & May mặc",
33
+ [BusinessCategory.FoodAndBeverage]: "Thực phẩm & Đồ uống",
34
+ [BusinessCategory.MediaAndEntertainment]: "Truyền thông & Giải trí",
35
+ [BusinessCategory.InternalCommunications]: "Truyền thông nội bộ",
36
+ [BusinessCategory.Transportation]: "Vận tải",
37
+ [BusinessCategory.Telecommunications]: "Viễn thông",
38
+ };
@@ -0,0 +1,20 @@
1
+ export * from "./Attachment.js";
2
+ export * from "./AutoReply.js";
3
+ export * from "./Board.js";
4
+ export * from "./Catalog.js";
5
+ export * from "./DeliveredMessage.js";
6
+ export * from "./Enum.js";
7
+ export * from "./FriendEvent.js";
8
+ export * from "./Group.js";
9
+ export * from "./GroupEvent.js";
10
+ export * from "./Message.js";
11
+ export * from "./ProductCatalog.js";
12
+ export * from "./QuickMessage.js";
13
+ export * from "./Reaction.js";
14
+ export * from "./Reminder.js";
15
+ export * from "./SeenMessage.js";
16
+ export * from "./Typing.js";
17
+ export * from "./Undo.js";
18
+ export * from "./User.js";
19
+ export * from "./ZBusiness.js";
20
+ export * from "./Label.js";
@@ -0,0 +1,36 @@
1
+ "use strict";
2
+ var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
3
+ if (k2 === undefined) k2 = k;
4
+ var desc = Object.getOwnPropertyDescriptor(m, k);
5
+ if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
6
+ desc = { enumerable: true, get: function() { return m[k]; } };
7
+ }
8
+ Object.defineProperty(o, k2, desc);
9
+ }) : (function(o, m, k, k2) {
10
+ if (k2 === undefined) k2 = k;
11
+ o[k2] = m[k];
12
+ }));
13
+ var __exportStar = (this && this.__exportStar) || function(m, exports) {
14
+ for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
15
+ };
16
+ Object.defineProperty(exports, "__esModule", { value: true });
17
+ __exportStar(require("./Attachment.js"), exports);
18
+ __exportStar(require("./AutoReply.js"), exports);
19
+ __exportStar(require("./Board.js"), exports);
20
+ __exportStar(require("./Catalog.js"), exports);
21
+ __exportStar(require("./DeliveredMessage.js"), exports);
22
+ __exportStar(require("./Enum.js"), exports);
23
+ __exportStar(require("./FriendEvent.js"), exports);
24
+ __exportStar(require("./Group.js"), exports);
25
+ __exportStar(require("./GroupEvent.js"), exports);
26
+ __exportStar(require("./Message.js"), exports);
27
+ __exportStar(require("./ProductCatalog.js"), exports);
28
+ __exportStar(require("./QuickMessage.js"), exports);
29
+ __exportStar(require("./Reaction.js"), exports);
30
+ __exportStar(require("./Reminder.js"), exports);
31
+ __exportStar(require("./SeenMessage.js"), exports);
32
+ __exportStar(require("./Typing.js"), exports);
33
+ __exportStar(require("./Undo.js"), exports);
34
+ __exportStar(require("./User.js"), exports);
35
+ __exportStar(require("./ZBusiness.js"), exports);
36
+ __exportStar(require("./Label.js"), exports);
@@ -0,0 +1,2 @@
1
+ import type { ContextBase } from "./context.js";
2
+ export declare function checkUpdate(ctx: ContextBase): Promise<void>;
@@ -0,0 +1,33 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.checkUpdate = void 0;
4
+ const semver_1 = require("semver");
5
+ const utils_js_1 = require("./utils.js");
6
+ const VERSION = "2.0.4";
7
+ const NPM_REGISTRY = "https://registry.npmjs.org/zca-js";
8
+ async function checkUpdate(ctx) {
9
+ var _a, _b;
10
+ if (!ctx.options.checkUpdate)
11
+ return;
12
+ const _options = Object.assign({}, (utils_js_1.isBun
13
+ ? {
14
+ // eslint-disable-next-line @typescript-eslint/ban-ts-comment
15
+ // @ts-ignore
16
+ proxy: (_b = (_a = ctx.options.agent) === null || _a === void 0 ? void 0 : _a.proxy) === null || _b === void 0 ? void 0 : _b.href,
17
+ }
18
+ : { agent: ctx.options.agent }));
19
+ const response = await ctx.options.polyfill(NPM_REGISTRY, _options).catch(() => null);
20
+ if (!response || !response.ok)
21
+ return;
22
+ const data = await response.json().catch(() => null);
23
+ if (!data)
24
+ return;
25
+ const latestVersion = data["dist-tags"].latest;
26
+ if ((0, semver_1.compare)(VERSION, latestVersion) === -1) {
27
+ (0, utils_js_1.logger)(ctx).info(`A new version of zca-js is available: ${latestVersion}`);
28
+ }
29
+ else {
30
+ (0, utils_js_1.logger)(ctx).info("zca-js is up to date");
31
+ }
32
+ }
33
+ exports.checkUpdate = checkUpdate;
@@ -0,0 +1,169 @@
1
+ /// <reference types="node" />
2
+ /// <reference types="node" />
3
+ /// <reference types="node" />
4
+ import cryptojs from "crypto-js";
5
+ import { type ContextSession, type ContextBase } from "./context.js";
6
+ import { FriendEventType } from "./models/FriendEvent.js";
7
+ import { GroupEventType } from "./models/GroupEvent.js";
8
+ import type { API } from "./zalo.js";
9
+ import type { AttachmentSource } from "./models/Attachment.js";
10
+ declare global {
11
+ var Bun: unknown;
12
+ }
13
+ export declare const isBun: boolean;
14
+ export declare function hasOwn(obj: Record<string, unknown>, key: string): key is keyof typeof obj;
15
+ /**
16
+ * Get signed key for API requests.
17
+ *
18
+ * @param type
19
+ * @param params
20
+ * @returns MD5 hash
21
+ *
22
+ */
23
+ export declare function getSignKey(type: string, params: Record<string, unknown>): string;
24
+ /**
25
+ *
26
+ * @param baseURL
27
+ * @param params
28
+ * @param apiVersion automatically add zalo api version to url params
29
+ * @returns
30
+ *
31
+ */
32
+ export declare function makeURL(ctx: ContextBase, baseURL: string, params?: Record<string, string | number>, apiVersion?: boolean): string;
33
+ export declare class ParamsEncryptor {
34
+ private zcid;
35
+ private enc_ver;
36
+ private zcid_ext;
37
+ private encryptKey;
38
+ constructor({ type, imei, firstLaunchTime }: {
39
+ type: number;
40
+ imei: string;
41
+ firstLaunchTime: number;
42
+ });
43
+ getEncryptKey(): string;
44
+ createZcid(type: number, imei: string, firstLaunchTime: number): void;
45
+ createEncryptKey(e?: number): boolean;
46
+ getParams(): {
47
+ zcid: string;
48
+ zcid_ext: string;
49
+ enc_ver: string;
50
+ };
51
+ static processStr(e: string): {
52
+ even: string[];
53
+ odd: string[];
54
+ };
55
+ static randomString(e?: number, t?: number): string;
56
+ static encodeAES(e: string, message: string, type: "hex" | "base64", uppercase: boolean, s?: number): string | null;
57
+ }
58
+ export declare function decryptResp(key: string, data: string): Record<string, unknown> | null | string;
59
+ export declare function decodeBase64ToBuffer(data: string): Buffer;
60
+ export declare function decodeUnit8Array(data: Uint8Array): string;
61
+ export declare function encodeAES(secretKey: string, data: cryptojs.lib.WordArray | string, t?: number): string | null;
62
+ export declare function decodeAES(secretKey: string, data: string, t?: number): string | null;
63
+ export declare function getDefaultHeaders(ctx: ContextBase, origin?: string): Promise<{
64
+ Accept: string;
65
+ "Accept-Encoding": string;
66
+ "Accept-Language": string;
67
+ "content-type": string;
68
+ Cookie: string;
69
+ Origin: string;
70
+ Referer: string;
71
+ "User-Agent": string;
72
+ }>;
73
+ export declare function request(ctx: ContextBase, url: string, options?: RequestInit, raw?: boolean): Promise<Response>;
74
+ export declare function getImageMetaData(ctx: ContextBase, filePath: string): Promise<{
75
+ fileName: string;
76
+ totalSize: number;
77
+ width: number;
78
+ height: number;
79
+ }>;
80
+ export declare function getFileSize(filePath: string): Promise<number>;
81
+ export declare function getGifMetaData(ctx: ContextBase, filePath: string): Promise<{
82
+ fileName: string;
83
+ totalSize: number;
84
+ width: number;
85
+ height: number;
86
+ }>;
87
+ export declare function decodeEventData(parsed: Record<string, unknown>, cipherKey?: string): Promise<any>;
88
+ export declare function getMd5LargeFileObject(source: AttachmentSource, fileSize: number): Promise<{
89
+ currentChunk: number;
90
+ data: string;
91
+ }>;
92
+ export declare const logger: (ctx: {
93
+ options: {
94
+ logging?: boolean;
95
+ };
96
+ }) => {
97
+ verbose: (...args: unknown[]) => void;
98
+ info: (...args: unknown[]) => void;
99
+ warn: (...args: unknown[]) => void;
100
+ error: (...args: unknown[]) => void;
101
+ success: (...args: unknown[]) => void;
102
+ timestamp: (...args: unknown[]) => void;
103
+ };
104
+ export declare function getClientMessageType(msgType: string): 1 | 31 | 32 | 44 | 46 | 49 | 36 | 37 | 38 | 43;
105
+ export declare function strPadLeft(e: number | string, t: string, n: number): string;
106
+ export declare function formatTime(format: string, timestamp?: number): string;
107
+ export declare function getFullTimeFromMillisecond(e: number): string;
108
+ export declare function getFileExtension(e: string): string;
109
+ export declare function getFileName(e: string): string;
110
+ export declare function removeUndefinedKeys(e: Record<string, unknown>): Record<string, unknown>;
111
+ export declare function getGroupEventType(act: string): GroupEventType;
112
+ export declare function getFriendEventType(act: string): FriendEventType;
113
+ type ZaloResponse<T> = {
114
+ data: T | null;
115
+ error: {
116
+ message: string;
117
+ code?: number;
118
+ } | null;
119
+ };
120
+ export declare function handleZaloResponse<T = unknown>(ctx: ContextSession, response: Response, isEncrypted?: boolean): Promise<ZaloResponse<T>>;
121
+ export declare function resolveResponse<T = unknown>(ctx: ContextSession, res: Response, cb?: (result: ZaloResponse<unknown>) => T, isEncrypted?: boolean): Promise<T>;
122
+ export type FactoryUtils<T> = {
123
+ makeURL: (baseURL: string, params?: Record<string, string | number>, apiVersion?: boolean) => ReturnType<typeof makeURL>;
124
+ encodeAES: (data: cryptojs.lib.WordArray | string, t?: number) => ReturnType<typeof encodeAES>;
125
+ request: (url: string, options?: RequestInit, raw?: boolean) => ReturnType<typeof request>;
126
+ logger: ReturnType<typeof logger>;
127
+ resolve: (res: Response, cb?: (result: ZaloResponse<unknown>) => T, isEncrypted?: boolean) => ReturnType<typeof resolveResponse<T>>;
128
+ };
129
+ export declare function apiFactory<T>(): <K extends (api: API, ctx: ContextSession, utils: FactoryUtils<T>) => unknown>(callback: K) => (ctx: ContextBase, api: API) => ReturnType<K>;
130
+ export declare function generateZaloUUID(userAgent: string): string;
131
+ /**
132
+ * Encrypts a 4-digit PIN to a 32-character hex string
133
+ * @param pin 4-digit PIN number
134
+ * @returns 32-character hex string
135
+ */
136
+ export declare function encryptPin(pin: string): string;
137
+ /**
138
+ * Decrypts a 32-character hex string back to 4-digit PIN
139
+ * Note: This is a one-way hash, so we can only verify if a PIN matches the hash
140
+ * @param encryptedPin 32-character hex string
141
+ * @param pin 4-digit PIN to verify
142
+ * @returns true if the PIN matches the hash
143
+ *
144
+ * @example
145
+ * const encryptedPin = (await api.getHiddenConversations()).pin;
146
+ * checking pin created..
147
+ * const isValid = validatePin(encryptedPin, "1234"); // true if pin created is 1234
148
+ * const isInvalid = validatePin(encryptedPin, "5678"); // false if not pin created is 5678
149
+ */
150
+ export declare function validatePin(encryptedPin: string, pin: string): boolean;
151
+ /**
152
+ * Converts a hex color code to a negative color number used by Zalo API
153
+ * @param hex Hex color code (e.g. '#00FF00' or '00FF00')
154
+ * @returns Negative color number (e.g. -16711936)
155
+ *
156
+ * @example
157
+ * const negativeColor = hexToNegativeColor('#00FF00'); // Result: -16711936
158
+ */
159
+ export declare function hexToNegativeColor(hex: string): number;
160
+ /**
161
+ * Converts a negative color number from Zalo API to hex color code
162
+ * @param negativeColor Negative color number (e.g. -16711936)
163
+ * @returns Hex color code (e.g. '#00FF00')
164
+ *
165
+ * @example
166
+ * const hexColor = negativeColorToHex(-16711936); // Result: '#00FF00'
167
+ */
168
+ export declare function negativeColorToHex(negativeColor: number): string;
169
+ export {};