@mtcute/core 0.28.2 → 0.29.0
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/client.cjs +0 -4
- package/client.js +0 -4
- package/highlevel/base.cjs +8 -9
- package/highlevel/base.d.cts +1 -1
- package/highlevel/base.d.ts +1 -1
- package/highlevel/base.js +8 -9
- package/highlevel/client.d.cts +9 -18
- package/highlevel/client.d.ts +9 -18
- package/highlevel/client.types.d.cts +5 -2
- package/highlevel/client.types.d.ts +5 -2
- package/highlevel/managers/timers.cjs +38 -18
- package/highlevel/managers/timers.d.cts +18 -4
- package/highlevel/managers/timers.d.ts +18 -4
- package/highlevel/managers/timers.js +38 -18
- package/highlevel/managers/timers.test.d.cts +1 -0
- package/highlevel/managers/timers.test.d.ts +1 -0
- package/highlevel/methods/auth/check-password.d.cts +1 -1
- package/highlevel/methods/auth/check-password.d.ts +1 -1
- package/highlevel/methods/auth/send-code.d.cts +1 -1
- package/highlevel/methods/auth/send-code.d.ts +1 -1
- package/highlevel/methods/auth/sign-in-qr.cjs +4 -4
- package/highlevel/methods/auth/sign-in-qr.js +4 -4
- package/highlevel/methods/auth/start.cjs +6 -6
- package/highlevel/methods/auth/start.d.cts +1 -1
- package/highlevel/methods/auth/start.d.ts +1 -1
- package/highlevel/methods/auth/start.js +6 -6
- package/highlevel/methods/auth/utils.d.cts +1 -1
- package/highlevel/methods/auth/utils.d.ts +1 -1
- package/highlevel/methods/bots/answer-inline-query.d.cts +1 -1
- package/highlevel/methods/bots/answer-inline-query.d.ts +1 -1
- package/highlevel/methods/bots/answer-pre-checkout-query.d.cts +1 -1
- package/highlevel/methods/bots/answer-pre-checkout-query.d.ts +1 -1
- package/highlevel/methods/bots/delete-my-commands.d.cts +1 -1
- package/highlevel/methods/bots/delete-my-commands.d.ts +1 -1
- package/highlevel/methods/bots/get-bot-info.d.cts +1 -1
- package/highlevel/methods/bots/get-bot-info.d.ts +1 -1
- package/highlevel/methods/bots/get-bot-menu-button.d.cts +1 -1
- package/highlevel/methods/bots/get-bot-menu-button.d.ts +1 -1
- package/highlevel/methods/bots/get-callback-answer.d.cts +1 -1
- package/highlevel/methods/bots/get-callback-answer.d.ts +1 -1
- package/highlevel/methods/bots/get-game-high-scores.d.cts +1 -1
- package/highlevel/methods/bots/get-game-high-scores.d.ts +1 -1
- package/highlevel/methods/bots/get-my-commands.d.cts +1 -1
- package/highlevel/methods/bots/get-my-commands.d.ts +1 -1
- package/highlevel/methods/bots/normalize-command-scope.cjs +2 -2
- package/highlevel/methods/bots/normalize-command-scope.d.cts +1 -1
- package/highlevel/methods/bots/normalize-command-scope.d.ts +1 -1
- package/highlevel/methods/bots/normalize-command-scope.js +2 -2
- package/highlevel/methods/bots/open-webview.cjs +15 -9
- package/highlevel/methods/bots/open-webview.d.cts +1 -1
- package/highlevel/methods/bots/open-webview.d.ts +1 -1
- package/highlevel/methods/bots/open-webview.js +15 -9
- package/highlevel/methods/bots/prepare-inline-message.d.cts +1 -1
- package/highlevel/methods/bots/prepare-inline-message.d.ts +1 -1
- package/highlevel/methods/bots/set-bot-menu-button.d.cts +1 -1
- package/highlevel/methods/bots/set-bot-menu-button.d.ts +1 -1
- package/highlevel/methods/bots/set-game-score.d.cts +1 -1
- package/highlevel/methods/bots/set-game-score.d.ts +1 -1
- package/highlevel/methods/bots/set-my-commands.d.cts +1 -1
- package/highlevel/methods/bots/set-my-commands.d.ts +1 -1
- package/highlevel/methods/bots/set-my-default-rights.d.cts +1 -1
- package/highlevel/methods/bots/set-my-default-rights.d.ts +1 -1
- package/highlevel/methods/chats/add-chat-members.d.cts +1 -1
- package/highlevel/methods/chats/add-chat-members.d.ts +1 -1
- package/highlevel/methods/chats/batched-queries.cjs +3 -3
- package/highlevel/methods/chats/batched-queries.d.cts +1 -1
- package/highlevel/methods/chats/batched-queries.d.ts +1 -1
- package/highlevel/methods/chats/batched-queries.js +3 -3
- package/highlevel/methods/chats/create-group.d.cts +1 -1
- package/highlevel/methods/chats/create-group.d.ts +1 -1
- package/highlevel/methods/chats/edit-admin-rights.d.cts +1 -1
- package/highlevel/methods/chats/edit-admin-rights.d.ts +1 -1
- package/highlevel/methods/chats/get-chat-event-log.d.cts +1 -1
- package/highlevel/methods/chats/get-chat-event-log.d.ts +1 -1
- package/highlevel/methods/chats/get-chat-member.cjs +2 -2
- package/highlevel/methods/chats/get-chat-member.js +2 -2
- package/highlevel/methods/chats/restrict-chat-member.d.cts +1 -1
- package/highlevel/methods/chats/restrict-chat-member.d.ts +1 -1
- package/highlevel/methods/chats/save-draft.d.cts +1 -1
- package/highlevel/methods/chats/save-draft.d.ts +1 -1
- package/highlevel/methods/chats/set-chat-color.d.cts +1 -1
- package/highlevel/methods/chats/set-chat-color.d.ts +1 -1
- package/highlevel/methods/chats/set-chat-default-permissions.d.cts +1 -1
- package/highlevel/methods/chats/set-chat-default-permissions.d.ts +1 -1
- package/highlevel/methods/chats/set-chat-photo.cjs +3 -3
- package/highlevel/methods/chats/set-chat-photo.js +3 -3
- package/highlevel/methods/contacts/import-contacts.d.cts +1 -1
- package/highlevel/methods/contacts/import-contacts.d.ts +1 -1
- package/highlevel/methods/contacts/set-contact-note.cjs +0 -2
- package/highlevel/methods/contacts/set-contact-note.js +0 -2
- package/highlevel/methods/dialogs/create-folder.d.cts +1 -1
- package/highlevel/methods/dialogs/create-folder.d.ts +1 -1
- package/highlevel/methods/dialogs/delete-folder.d.cts +1 -1
- package/highlevel/methods/dialogs/delete-folder.d.ts +1 -1
- package/highlevel/methods/dialogs/edit-folder.d.cts +1 -1
- package/highlevel/methods/dialogs/edit-folder.d.ts +1 -1
- package/highlevel/methods/dialogs/find-folder.cjs +1 -1
- package/highlevel/methods/dialogs/find-folder.d.cts +1 -1
- package/highlevel/methods/dialogs/find-folder.d.ts +1 -1
- package/highlevel/methods/dialogs/find-folder.js +1 -1
- package/highlevel/methods/dialogs/get-folders.d.cts +1 -1
- package/highlevel/methods/dialogs/get-folders.d.ts +1 -1
- package/highlevel/methods/dialogs/iter-dialogs.d.cts +1 -1
- package/highlevel/methods/dialogs/iter-dialogs.d.ts +1 -1
- package/highlevel/methods/dialogs/join-chatlist.d.cts +1 -1
- package/highlevel/methods/dialogs/join-chatlist.d.ts +1 -1
- package/highlevel/methods/files/download-chunk.cjs +2 -2
- package/highlevel/methods/files/download-chunk.js +2 -2
- package/highlevel/methods/files/download-iterable.cjs +3 -3
- package/highlevel/methods/files/download-iterable.d.cts +1 -1
- package/highlevel/methods/files/download-iterable.d.ts +1 -1
- package/highlevel/methods/files/download-iterable.js +3 -3
- package/highlevel/methods/files/normalize-file-to-document.cjs +2 -2
- package/highlevel/methods/files/normalize-file-to-document.d.cts +1 -1
- package/highlevel/methods/files/normalize-file-to-document.d.ts +1 -1
- package/highlevel/methods/files/normalize-file-to-document.js +2 -2
- package/highlevel/methods/files/normalize-input-file.cjs +3 -3
- package/highlevel/methods/files/normalize-input-file.d.cts +1 -1
- package/highlevel/methods/files/normalize-input-file.d.ts +1 -1
- package/highlevel/methods/files/normalize-input-file.js +3 -3
- package/highlevel/methods/files/normalize-input-media.cjs +5 -5
- package/highlevel/methods/files/normalize-input-media.d.cts +1 -1
- package/highlevel/methods/files/normalize-input-media.d.ts +1 -1
- package/highlevel/methods/files/normalize-input-media.js +5 -5
- package/highlevel/methods/forums/create-forum-topic.d.cts +1 -1
- package/highlevel/methods/forums/create-forum-topic.d.ts +1 -1
- package/highlevel/methods/forums/edit-forum-topic.d.cts +1 -1
- package/highlevel/methods/forums/edit-forum-topic.d.ts +1 -1
- package/highlevel/methods/gifts/_normalize-input-star-gift.d.cts +1 -1
- package/highlevel/methods/gifts/_normalize-input-star-gift.d.ts +1 -1
- package/highlevel/methods/gifts/get-resale-star-gifts.d.cts +1 -1
- package/highlevel/methods/gifts/get-resale-star-gifts.d.ts +1 -1
- package/highlevel/methods/gifts/get-star-gift-upgrade-options.d.cts +1 -1
- package/highlevel/methods/gifts/get-star-gift-upgrade-options.d.ts +1 -1
- package/highlevel/methods/gifts/send-star-gift-offer.d.cts +1 -1
- package/highlevel/methods/gifts/send-star-gift-offer.d.ts +1 -1
- package/highlevel/methods/gifts/transfer-star-gift.cjs +2 -2
- package/highlevel/methods/gifts/transfer-star-gift.js +2 -2
- package/highlevel/methods/gifts/upgrade-star-gift.cjs +2 -2
- package/highlevel/methods/gifts/upgrade-star-gift.js +2 -2
- package/highlevel/methods/invite-links/create-invite-link.d.cts +1 -1
- package/highlevel/methods/invite-links/create-invite-link.d.ts +1 -1
- package/highlevel/methods/invite-links/get-invite-link-members.d.cts +1 -1
- package/highlevel/methods/invite-links/get-invite-link-members.d.ts +1 -1
- package/highlevel/methods/messages/edit-inline-message.cjs +2 -2
- package/highlevel/methods/messages/edit-inline-message.d.cts +1 -1
- package/highlevel/methods/messages/edit-inline-message.d.ts +1 -1
- package/highlevel/methods/messages/edit-inline-message.js +2 -2
- package/highlevel/methods/messages/edit-message.cjs +3 -2
- package/highlevel/methods/messages/edit-message.js +3 -2
- package/highlevel/methods/messages/find-in-update.d.cts +1 -1
- package/highlevel/methods/messages/find-in-update.d.ts +1 -1
- package/highlevel/methods/messages/forward-messages.cjs +1 -1
- package/highlevel/methods/messages/forward-messages.d.cts +1 -1
- package/highlevel/methods/messages/forward-messages.d.ts +1 -1
- package/highlevel/methods/messages/forward-messages.js +1 -1
- package/highlevel/methods/messages/get-callback-query-message.d.cts +1 -1
- package/highlevel/methods/messages/get-callback-query-message.d.ts +1 -1
- package/highlevel/methods/messages/get-discussion-message.d.cts +1 -1
- package/highlevel/methods/messages/get-discussion-message.d.ts +1 -1
- package/highlevel/methods/messages/search-global.d.cts +1 -1
- package/highlevel/methods/messages/search-global.d.ts +1 -1
- package/highlevel/methods/messages/search-hashtag.d.cts +1 -1
- package/highlevel/methods/messages/search-hashtag.d.ts +1 -1
- package/highlevel/methods/messages/search-messages.d.cts +1 -1
- package/highlevel/methods/messages/search-messages.d.ts +1 -1
- package/highlevel/methods/messages/search-posts-global.d.cts +1 -1
- package/highlevel/methods/messages/search-posts-global.d.ts +1 -1
- package/highlevel/methods/messages/send-common.cjs +1 -1
- package/highlevel/methods/messages/send-common.d.cts +1 -1
- package/highlevel/methods/messages/send-common.d.ts +1 -1
- package/highlevel/methods/messages/send-common.js +1 -1
- package/highlevel/methods/messages/send-media-group.cjs +6 -5
- package/highlevel/methods/messages/send-media-group.js +6 -5
- package/highlevel/methods/messages/send-media.cjs +6 -5
- package/highlevel/methods/messages/send-media.js +6 -5
- package/highlevel/methods/messages/send-paid-reaction.cjs +2 -2
- package/highlevel/methods/messages/send-paid-reaction.js +2 -2
- package/highlevel/methods/messages/send-text.cjs +6 -5
- package/highlevel/methods/messages/send-text.js +6 -5
- package/highlevel/methods/messages/send-typing.cjs +3 -2
- package/highlevel/methods/messages/send-typing.d.cts +1 -1
- package/highlevel/methods/messages/send-typing.d.ts +1 -1
- package/highlevel/methods/messages/send-typing.js +3 -2
- package/highlevel/methods/messages/set-typing.cjs +12 -8
- package/highlevel/methods/messages/set-typing.d.cts +1 -1
- package/highlevel/methods/messages/set-typing.d.ts +1 -1
- package/highlevel/methods/messages/set-typing.js +12 -8
- package/highlevel/methods/messages/set-typing.test.d.cts +1 -0
- package/highlevel/methods/messages/set-typing.test.d.ts +1 -0
- package/highlevel/methods/misc/chain-id.d.cts +1 -1
- package/highlevel/methods/misc/chain-id.d.ts +1 -1
- package/highlevel/methods/misc/init-takeout-session.d.cts +1 -1
- package/highlevel/methods/misc/init-takeout-session.d.ts +1 -1
- package/highlevel/methods/misc/normalize-privacy-rules.d.cts +1 -1
- package/highlevel/methods/misc/normalize-privacy-rules.d.ts +1 -1
- package/highlevel/methods/misc/normalize-text.d.cts +1 -1
- package/highlevel/methods/misc/normalize-text.d.ts +1 -1
- package/highlevel/methods/premium/_normalize-stars-amount.d.cts +1 -1
- package/highlevel/methods/premium/_normalize-stars-amount.d.ts +1 -1
- package/highlevel/methods/premium/set-business-intro.d.cts +1 -1
- package/highlevel/methods/premium/set-business-intro.d.ts +1 -1
- package/highlevel/methods/premium/set-business-work-hours.d.cts +1 -1
- package/highlevel/methods/premium/set-business-work-hours.d.ts +1 -1
- package/highlevel/methods/stickers/_utils.d.cts +1 -1
- package/highlevel/methods/stickers/_utils.d.ts +1 -1
- package/highlevel/methods/stickers/get-custom-emojis.cjs +4 -5
- package/highlevel/methods/stickers/get-custom-emojis.d.cts +3 -3
- package/highlevel/methods/stickers/get-custom-emojis.d.ts +3 -3
- package/highlevel/methods/stickers/get-custom-emojis.js +4 -5
- package/highlevel/methods/stickers/set-sticker-set-thumb.d.cts +1 -1
- package/highlevel/methods/stickers/set-sticker-set-thumb.d.ts +1 -1
- package/highlevel/methods/stories/can-send-story.cjs +3 -3
- package/highlevel/methods/stories/can-send-story.js +3 -3
- package/highlevel/methods/stories/edit-story.d.cts +1 -1
- package/highlevel/methods/stories/edit-story.d.ts +1 -1
- package/highlevel/methods/stories/find-in-update.d.cts +1 -1
- package/highlevel/methods/stories/find-in-update.d.ts +1 -1
- package/highlevel/methods/stories/get-profile-stories.cjs +3 -3
- package/highlevel/methods/stories/get-profile-stories.js +3 -3
- package/highlevel/methods/stories/get-stories-by-id.cjs +3 -3
- package/highlevel/methods/stories/get-stories-by-id.js +3 -3
- package/highlevel/methods/stories/send-story.d.cts +1 -1
- package/highlevel/methods/stories/send-story.d.ts +1 -1
- package/highlevel/methods/users/_resolve-common.cjs +74 -0
- package/highlevel/methods/users/_resolve-common.d.cts +4 -0
- package/highlevel/methods/users/_resolve-common.d.ts +4 -0
- package/highlevel/methods/users/_resolve-common.js +69 -0
- package/highlevel/methods/users/delete-profile-photos.d.cts +1 -1
- package/highlevel/methods/users/delete-profile-photos.d.ts +1 -1
- package/highlevel/methods/users/get-profile-photo.cjs +1 -2
- package/highlevel/methods/users/get-profile-photo.d.cts +2 -2
- package/highlevel/methods/users/get-profile-photo.d.ts +2 -2
- package/highlevel/methods/users/get-profile-photo.js +1 -2
- package/highlevel/methods/users/get-profile-photos.cjs +3 -3
- package/highlevel/methods/users/get-profile-photos.js +3 -3
- package/highlevel/methods/users/get-saved-music.cjs +1 -0
- package/highlevel/methods/users/get-saved-music.js +1 -0
- package/highlevel/methods/users/is-peer-available.cjs +2 -2
- package/highlevel/methods/users/is-peer-available.js +1 -1
- package/highlevel/methods/users/resolve-peer-many.d.cts +1 -1
- package/highlevel/methods/users/resolve-peer-many.d.ts +1 -1
- package/highlevel/methods/users/resolve-peer.cjs +7 -68
- package/highlevel/methods/users/resolve-peer.d.cts +1 -3
- package/highlevel/methods/users/resolve-peer.d.ts +1 -3
- package/highlevel/methods/users/resolve-peer.js +8 -69
- package/highlevel/methods/users/resolve-phone-number.cjs +4 -4
- package/highlevel/methods/users/resolve-phone-number.d.cts +1 -1
- package/highlevel/methods/users/resolve-phone-number.d.ts +1 -1
- package/highlevel/methods/users/resolve-phone-number.js +3 -3
- package/highlevel/methods/users/save-music-to-profile.cjs +2 -2
- package/highlevel/methods/users/save-music-to-profile.js +2 -2
- package/highlevel/methods/users/set-emoji-status.d.cts +1 -1
- package/highlevel/methods/users/set-emoji-status.d.ts +1 -1
- package/highlevel/methods/users/set-my-profile-photo.cjs +5 -2
- package/highlevel/methods/users/set-my-profile-photo.d.cts +1 -1
- package/highlevel/methods/users/set-my-profile-photo.d.ts +1 -1
- package/highlevel/methods/users/set-my-profile-photo.js +5 -2
- package/highlevel/methods/users/set-online.cjs +9 -5
- package/highlevel/methods/users/set-online.js +9 -5
- package/highlevel/methods.d.cts +0 -1
- package/highlevel/methods.d.ts +0 -1
- package/highlevel/storage/service/current-user.cjs +1 -1
- package/highlevel/storage/service/current-user.d.cts +1 -1
- package/highlevel/storage/service/current-user.d.ts +1 -1
- package/highlevel/storage/service/current-user.js +1 -1
- package/highlevel/storage/service/peers.d.cts +1 -1
- package/highlevel/storage/service/peers.d.ts +1 -1
- package/highlevel/types/auth/sent-code.d.cts +1 -1
- package/highlevel/types/auth/sent-code.d.ts +1 -1
- package/highlevel/types/bots/command-scope/inner.d.cts +1 -1
- package/highlevel/types/bots/command-scope/inner.d.ts +1 -1
- package/highlevel/types/bots/game-high-score.d.cts +1 -1
- package/highlevel/types/bots/game-high-score.d.ts +1 -1
- package/highlevel/types/bots/inline-message/factories.d.cts +1 -1
- package/highlevel/types/bots/inline-message/factories.d.ts +1 -1
- package/highlevel/types/bots/inline-result/factories.d.cts +1 -1
- package/highlevel/types/bots/inline-result/factories.d.ts +1 -1
- package/highlevel/types/bots/inline-result/types.d.cts +1 -1
- package/highlevel/types/bots/inline-result/types.d.ts +1 -1
- package/highlevel/types/bots/keyboards/builder.d.cts +1 -1
- package/highlevel/types/bots/keyboards/builder.d.ts +1 -1
- package/highlevel/types/bots/keyboards/factories.cjs +2 -2
- package/highlevel/types/bots/keyboards/factories.d.cts +1 -1
- package/highlevel/types/bots/keyboards/factories.d.ts +1 -1
- package/highlevel/types/bots/keyboards/factories.js +2 -2
- package/highlevel/types/bots/keyboards/types.d.cts +1 -1
- package/highlevel/types/bots/keyboards/types.d.ts +1 -1
- package/highlevel/types/bots/webview.d.cts +1 -1
- package/highlevel/types/bots/webview.d.ts +1 -1
- package/highlevel/types/conversation.d.cts +1 -1
- package/highlevel/types/conversation.d.ts +1 -1
- package/highlevel/types/files/file-location.d.cts +1 -1
- package/highlevel/types/files/file-location.d.ts +1 -1
- package/highlevel/types/files/uploaded-file.d.cts +1 -1
- package/highlevel/types/files/uploaded-file.d.ts +1 -1
- package/highlevel/types/files/utils.d.cts +1 -1
- package/highlevel/types/files/utils.d.ts +1 -1
- package/highlevel/types/files/web-document.d.cts +1 -1
- package/highlevel/types/files/web-document.d.ts +1 -1
- package/highlevel/types/media/audio.d.cts +1 -1
- package/highlevel/types/media/audio.d.ts +1 -1
- package/highlevel/types/media/contact.d.cts +1 -1
- package/highlevel/types/media/contact.d.ts +1 -1
- package/highlevel/types/media/dice.d.cts +1 -1
- package/highlevel/types/media/dice.d.ts +1 -1
- package/highlevel/types/media/document-utils.d.cts +1 -1
- package/highlevel/types/media/document-utils.d.ts +1 -1
- package/highlevel/types/media/document.d.cts +1 -1
- package/highlevel/types/media/document.d.ts +1 -1
- package/highlevel/types/media/extended-media.d.cts +1 -1
- package/highlevel/types/media/extended-media.d.ts +1 -1
- package/highlevel/types/media/game.d.cts +1 -1
- package/highlevel/types/media/game.d.ts +1 -1
- package/highlevel/types/media/input-media/factories.d.cts +1 -1
- package/highlevel/types/media/input-media/factories.d.ts +1 -1
- package/highlevel/types/media/input-media/types.d.cts +1 -1
- package/highlevel/types/media/input-media/types.d.ts +1 -1
- package/highlevel/types/media/invoice.d.cts +1 -1
- package/highlevel/types/media/invoice.d.ts +1 -1
- package/highlevel/types/media/location.d.cts +1 -1
- package/highlevel/types/media/location.d.ts +1 -1
- package/highlevel/types/media/paid-media.d.cts +1 -1
- package/highlevel/types/media/paid-media.d.ts +1 -1
- package/highlevel/types/media/photo.d.cts +1 -1
- package/highlevel/types/media/photo.d.ts +1 -1
- package/highlevel/types/media/poll.d.cts +1 -1
- package/highlevel/types/media/poll.d.ts +1 -1
- package/highlevel/types/media/sticker.d.cts +1 -1
- package/highlevel/types/media/sticker.d.ts +1 -1
- package/highlevel/types/media/story.d.cts +1 -1
- package/highlevel/types/media/story.d.ts +1 -1
- package/highlevel/types/media/thumbnail.d.cts +1 -1
- package/highlevel/types/media/thumbnail.d.ts +1 -1
- package/highlevel/types/media/todo.d.cts +1 -1
- package/highlevel/types/media/todo.d.ts +1 -1
- package/highlevel/types/media/venue.cjs +2 -2
- package/highlevel/types/media/venue.d.cts +1 -1
- package/highlevel/types/media/venue.d.ts +1 -1
- package/highlevel/types/media/venue.js +2 -2
- package/highlevel/types/media/video.d.cts +1 -1
- package/highlevel/types/media/video.d.ts +1 -1
- package/highlevel/types/media/voice.d.cts +1 -1
- package/highlevel/types/media/voice.d.ts +1 -1
- package/highlevel/types/media/web-page.d.cts +1 -1
- package/highlevel/types/media/web-page.d.ts +1 -1
- package/highlevel/types/messages/dialog.d.cts +1 -1
- package/highlevel/types/messages/dialog.d.ts +1 -1
- package/highlevel/types/messages/draft-message.d.cts +1 -1
- package/highlevel/types/messages/draft-message.d.ts +1 -1
- package/highlevel/types/messages/fact-check.d.cts +1 -1
- package/highlevel/types/messages/fact-check.d.ts +1 -1
- package/highlevel/types/messages/message-action.cjs +4 -0
- package/highlevel/types/messages/message-action.d.cts +1 -1
- package/highlevel/types/messages/message-action.d.ts +1 -1
- package/highlevel/types/messages/message-action.js +4 -0
- package/highlevel/types/messages/message-effect.cjs +2 -6
- package/highlevel/types/messages/message-effect.d.cts +1 -1
- package/highlevel/types/messages/message-effect.d.ts +1 -1
- package/highlevel/types/messages/message-effect.js +2 -6
- package/highlevel/types/messages/message-entity.d.cts +1 -1
- package/highlevel/types/messages/message-entity.d.ts +1 -1
- package/highlevel/types/messages/message-forward.d.cts +1 -1
- package/highlevel/types/messages/message-forward.d.ts +1 -1
- package/highlevel/types/messages/message-media.d.cts +1 -1
- package/highlevel/types/messages/message-media.d.ts +1 -1
- package/highlevel/types/messages/message-reactions.d.cts +1 -1
- package/highlevel/types/messages/message-reactions.d.ts +1 -1
- package/highlevel/types/messages/message-replies.d.cts +1 -1
- package/highlevel/types/messages/message-replies.d.ts +1 -1
- package/highlevel/types/messages/message.d.cts +1 -1
- package/highlevel/types/messages/message.d.ts +1 -1
- package/highlevel/types/messages/replied-message.cjs +4 -14
- package/highlevel/types/messages/replied-message.d.cts +2 -2
- package/highlevel/types/messages/replied-message.d.ts +2 -2
- package/highlevel/types/messages/replied-message.js +2 -12
- package/highlevel/types/messages/suggested-post.d.cts +1 -1
- package/highlevel/types/messages/suggested-post.d.ts +1 -1
- package/highlevel/types/misc/collectible-info.d.cts +1 -1
- package/highlevel/types/misc/collectible-info.d.ts +1 -1
- package/highlevel/types/misc/entities.d.cts +1 -1
- package/highlevel/types/misc/entities.d.ts +1 -1
- package/highlevel/types/misc/input-privacy-rule/allow.d.cts +1 -1
- package/highlevel/types/misc/input-privacy-rule/allow.d.ts +1 -1
- package/highlevel/types/misc/input-privacy-rule/disallow.d.cts +1 -1
- package/highlevel/types/misc/input-privacy-rule/disallow.d.ts +1 -1
- package/highlevel/types/misc/input-privacy-rule/types.d.cts +1 -1
- package/highlevel/types/misc/input-privacy-rule/types.d.ts +1 -1
- package/highlevel/types/misc/sticker-set.cjs +5 -3
- package/highlevel/types/misc/sticker-set.d.cts +1 -1
- package/highlevel/types/misc/sticker-set.d.ts +1 -1
- package/highlevel/types/misc/sticker-set.js +5 -3
- package/highlevel/types/misc/takeout-session.d.cts +1 -1
- package/highlevel/types/misc/takeout-session.d.ts +1 -1
- package/highlevel/types/peers/bot-info.d.cts +1 -1
- package/highlevel/types/peers/bot-info.d.ts +1 -1
- package/highlevel/types/peers/bot-verification.d.cts +1 -1
- package/highlevel/types/peers/bot-verification.d.ts +1 -1
- package/highlevel/types/peers/chat-colors.d.cts +1 -1
- package/highlevel/types/peers/chat-colors.d.ts +1 -1
- package/highlevel/types/peers/chat-event/actions.cjs +4 -5
- package/highlevel/types/peers/chat-event/actions.d.cts +5 -6
- package/highlevel/types/peers/chat-event/actions.d.ts +5 -6
- package/highlevel/types/peers/chat-event/actions.js +4 -5
- package/highlevel/types/peers/chat-event/filters.d.cts +1 -1
- package/highlevel/types/peers/chat-event/filters.d.ts +1 -1
- package/highlevel/types/peers/chat-event/index.d.cts +1 -1
- package/highlevel/types/peers/chat-event/index.d.ts +1 -1
- package/highlevel/types/peers/chat-invite-link-member.d.cts +1 -1
- package/highlevel/types/peers/chat-invite-link-member.d.ts +1 -1
- package/highlevel/types/peers/chat-invite-link.d.cts +1 -1
- package/highlevel/types/peers/chat-invite-link.d.ts +1 -1
- package/highlevel/types/peers/chat-member.d.cts +1 -1
- package/highlevel/types/peers/chat-member.d.ts +1 -1
- package/highlevel/types/peers/chat-permissions.d.cts +1 -1
- package/highlevel/types/peers/chat-permissions.d.ts +1 -1
- package/highlevel/types/peers/chat-photo.d.cts +1 -1
- package/highlevel/types/peers/chat-photo.d.ts +1 -1
- package/highlevel/types/peers/chat-preview.d.cts +1 -1
- package/highlevel/types/peers/chat-preview.d.ts +1 -1
- package/highlevel/types/peers/chat.d.cts +1 -1
- package/highlevel/types/peers/chat.d.ts +1 -1
- package/highlevel/types/peers/chatlist-preview.d.cts +1 -1
- package/highlevel/types/peers/chatlist-preview.d.ts +1 -1
- package/highlevel/types/peers/forum-topic.d.cts +1 -1
- package/highlevel/types/peers/forum-topic.d.ts +1 -1
- package/highlevel/types/peers/full-chat.cjs +0 -11
- package/highlevel/types/peers/full-chat.d.cts +1 -6
- package/highlevel/types/peers/full-chat.d.ts +1 -6
- package/highlevel/types/peers/full-chat.js +0 -11
- package/highlevel/types/peers/full-user.d.cts +1 -1
- package/highlevel/types/peers/full-user.d.ts +1 -1
- package/highlevel/types/peers/index.d.cts +0 -1
- package/highlevel/types/peers/index.d.ts +0 -1
- package/highlevel/types/peers/peer-settings.d.cts +1 -1
- package/highlevel/types/peers/peer-settings.d.ts +1 -1
- package/highlevel/types/peers/peer.d.cts +1 -1
- package/highlevel/types/peers/peer.d.ts +1 -1
- package/highlevel/types/peers/peers-index.cjs +3 -1
- package/highlevel/types/peers/peers-index.d.cts +1 -1
- package/highlevel/types/peers/peers-index.d.ts +1 -1
- package/highlevel/types/peers/peers-index.js +3 -1
- package/highlevel/types/peers/user.d.cts +1 -1
- package/highlevel/types/peers/user.d.ts +1 -1
- package/highlevel/types/premium/boost-slot.d.cts +1 -1
- package/highlevel/types/premium/boost-slot.d.ts +1 -1
- package/highlevel/types/premium/boost-stats.d.cts +1 -1
- package/highlevel/types/premium/boost-stats.d.ts +1 -1
- package/highlevel/types/premium/boost.d.cts +1 -1
- package/highlevel/types/premium/boost.d.ts +1 -1
- package/highlevel/types/premium/business-account.d.cts +1 -1
- package/highlevel/types/premium/business-account.d.ts +1 -1
- package/highlevel/types/premium/business-chat-link.d.cts +1 -1
- package/highlevel/types/premium/business-chat-link.d.ts +1 -1
- package/highlevel/types/premium/business-connection.d.cts +1 -1
- package/highlevel/types/premium/business-connection.d.ts +1 -1
- package/highlevel/types/premium/business-intro.d.cts +1 -1
- package/highlevel/types/premium/business-intro.d.ts +1 -1
- package/highlevel/types/premium/business-location.d.cts +1 -1
- package/highlevel/types/premium/business-location.d.ts +1 -1
- package/highlevel/types/premium/business-work-hours.d.cts +1 -1
- package/highlevel/types/premium/business-work-hours.d.ts +1 -1
- package/highlevel/types/premium/saved-star-gift.d.cts +1 -1
- package/highlevel/types/premium/saved-star-gift.d.ts +1 -1
- package/highlevel/types/premium/star-gift-unique.d.cts +1 -1
- package/highlevel/types/premium/star-gift-unique.d.ts +1 -1
- package/highlevel/types/premium/star-gift-value.d.cts +1 -1
- package/highlevel/types/premium/star-gift-value.d.ts +1 -1
- package/highlevel/types/premium/star-gift.cjs +0 -4
- package/highlevel/types/premium/star-gift.d.cts +1 -3
- package/highlevel/types/premium/star-gift.d.ts +1 -3
- package/highlevel/types/premium/star-gift.js +0 -4
- package/highlevel/types/premium/stars-status.d.cts +1 -1
- package/highlevel/types/premium/stars-status.d.ts +1 -1
- package/highlevel/types/premium/stars-transaction.d.cts +1 -1
- package/highlevel/types/premium/stars-transaction.d.ts +1 -1
- package/highlevel/types/reactions/emoji-status.d.cts +1 -1
- package/highlevel/types/reactions/emoji-status.d.ts +1 -1
- package/highlevel/types/reactions/peer-reaction.cjs +5 -8
- package/highlevel/types/reactions/peer-reaction.d.cts +4 -5
- package/highlevel/types/reactions/peer-reaction.d.ts +4 -5
- package/highlevel/types/reactions/peer-reaction.js +5 -8
- package/highlevel/types/reactions/reaction-count.d.cts +1 -1
- package/highlevel/types/reactions/reaction-count.d.ts +1 -1
- package/highlevel/types/reactions/types.d.cts +1 -1
- package/highlevel/types/reactions/types.d.ts +1 -1
- package/highlevel/types/stories/all-stories.d.cts +1 -1
- package/highlevel/types/stories/all-stories.d.ts +1 -1
- package/highlevel/types/stories/interactive/base.d.cts +1 -1
- package/highlevel/types/stories/interactive/base.d.ts +1 -1
- package/highlevel/types/stories/interactive/channel-post.d.cts +1 -1
- package/highlevel/types/stories/interactive/channel-post.d.ts +1 -1
- package/highlevel/types/stories/interactive/index.d.cts +1 -1
- package/highlevel/types/stories/interactive/index.d.ts +1 -1
- package/highlevel/types/stories/interactive/input.d.cts +1 -1
- package/highlevel/types/stories/interactive/input.d.ts +1 -1
- package/highlevel/types/stories/interactive/location.d.cts +1 -1
- package/highlevel/types/stories/interactive/location.d.ts +1 -1
- package/highlevel/types/stories/interactive/reaction.d.cts +1 -1
- package/highlevel/types/stories/interactive/reaction.d.ts +1 -1
- package/highlevel/types/stories/interactive/star-gift.d.cts +1 -1
- package/highlevel/types/stories/interactive/star-gift.d.ts +1 -1
- package/highlevel/types/stories/interactive/url.d.cts +1 -1
- package/highlevel/types/stories/interactive/url.d.ts +1 -1
- package/highlevel/types/stories/interactive/venue.d.cts +1 -1
- package/highlevel/types/stories/interactive/venue.d.ts +1 -1
- package/highlevel/types/stories/interactive/weather.d.cts +1 -1
- package/highlevel/types/stories/interactive/weather.d.ts +1 -1
- package/highlevel/types/stories/peer-stories.cjs +4 -4
- package/highlevel/types/stories/peer-stories.d.cts +1 -1
- package/highlevel/types/stories/peer-stories.d.ts +1 -1
- package/highlevel/types/stories/peer-stories.js +4 -4
- package/highlevel/types/stories/stealth-mode.d.cts +1 -1
- package/highlevel/types/stories/stealth-mode.d.ts +1 -1
- package/highlevel/types/stories/story-interactions.d.cts +1 -1
- package/highlevel/types/stories/story-interactions.d.ts +1 -1
- package/highlevel/types/stories/story-viewer.cjs +3 -4
- package/highlevel/types/stories/story-viewer.d.cts +3 -3
- package/highlevel/types/stories/story-viewer.d.ts +3 -3
- package/highlevel/types/stories/story-viewer.js +3 -4
- package/highlevel/types/stories/story.d.cts +1 -1
- package/highlevel/types/stories/story.d.ts +1 -1
- package/highlevel/types/updates/bot-chat-join-request.d.cts +1 -1
- package/highlevel/types/updates/bot-chat-join-request.d.ts +1 -1
- package/highlevel/types/updates/bot-reaction.d.cts +1 -1
- package/highlevel/types/updates/bot-reaction.d.ts +1 -1
- package/highlevel/types/updates/bot-stopped.d.cts +1 -1
- package/highlevel/types/updates/bot-stopped.d.ts +1 -1
- package/highlevel/types/updates/business-message.d.cts +1 -1
- package/highlevel/types/updates/business-message.d.ts +1 -1
- package/highlevel/types/updates/callback-query.d.cts +1 -1
- package/highlevel/types/updates/callback-query.d.ts +1 -1
- package/highlevel/types/updates/chat-join-request.d.cts +1 -1
- package/highlevel/types/updates/chat-join-request.d.ts +1 -1
- package/highlevel/types/updates/chat-member-update.cjs +2 -2
- package/highlevel/types/updates/chat-member-update.d.cts +1 -1
- package/highlevel/types/updates/chat-member-update.d.ts +1 -1
- package/highlevel/types/updates/chat-member-update.js +2 -2
- package/highlevel/types/updates/chosen-inline-result.d.cts +1 -1
- package/highlevel/types/updates/chosen-inline-result.d.ts +1 -1
- package/highlevel/types/updates/delete-business-message-update.d.cts +1 -1
- package/highlevel/types/updates/delete-business-message-update.d.ts +1 -1
- package/highlevel/types/updates/delete-message-update.d.cts +1 -1
- package/highlevel/types/updates/delete-message-update.d.ts +1 -1
- package/highlevel/types/updates/delete-story-update.d.cts +1 -1
- package/highlevel/types/updates/delete-story-update.d.ts +1 -1
- package/highlevel/types/updates/history-read-update.d.cts +1 -1
- package/highlevel/types/updates/history-read-update.d.ts +1 -1
- package/highlevel/types/updates/inline-query.d.cts +1 -1
- package/highlevel/types/updates/inline-query.d.ts +1 -1
- package/highlevel/types/updates/poll-update.d.cts +1 -1
- package/highlevel/types/updates/poll-update.d.ts +1 -1
- package/highlevel/types/updates/poll-vote.d.cts +1 -1
- package/highlevel/types/updates/poll-vote.d.ts +1 -1
- package/highlevel/types/updates/pre-checkout-query.d.cts +1 -1
- package/highlevel/types/updates/pre-checkout-query.d.ts +1 -1
- package/highlevel/types/updates/story-update.d.cts +1 -1
- package/highlevel/types/updates/story-update.d.ts +1 -1
- package/highlevel/types/updates/user-status-update.d.cts +1 -1
- package/highlevel/types/updates/user-status-update.d.ts +1 -1
- package/highlevel/types/updates/user-typing-update.d.cts +1 -1
- package/highlevel/types/updates/user-typing-update.d.ts +1 -1
- package/highlevel/updates/manager.cjs +8 -9
- package/highlevel/updates/manager.d.cts +4 -2
- package/highlevel/updates/manager.d.ts +4 -2
- package/highlevel/updates/manager.js +8 -9
- package/highlevel/updates/types.d.cts +1 -1
- package/highlevel/updates/types.d.ts +1 -1
- package/highlevel/updates/utils.d.cts +1 -1
- package/highlevel/updates/utils.d.ts +1 -1
- package/highlevel/utils/convert-file-id.d.cts +1 -1
- package/highlevel/utils/convert-file-id.d.ts +1 -1
- package/highlevel/utils/file-utils.d.cts +1 -1
- package/highlevel/utils/file-utils.d.ts +1 -1
- package/highlevel/utils/inline-utils.d.cts +1 -1
- package/highlevel/utils/inline-utils.d.ts +1 -1
- package/highlevel/utils/peer-utils.cjs +4 -4
- package/highlevel/utils/peer-utils.d.cts +1 -1
- package/highlevel/utils/peer-utils.d.ts +1 -1
- package/highlevel/utils/peer-utils.js +4 -4
- package/highlevel/worker/errors.cjs +3 -3
- package/highlevel/worker/errors.js +3 -3
- package/highlevel/worker/invoker.cjs +67 -9
- package/highlevel/worker/invoker.d.cts +9 -1
- package/highlevel/worker/invoker.d.ts +9 -1
- package/highlevel/worker/invoker.js +67 -9
- package/highlevel/worker/invoker.test.d.cts +1 -0
- package/highlevel/worker/invoker.test.d.ts +1 -0
- package/highlevel/worker/port.cjs +50 -16
- package/highlevel/worker/port.d.cts +9 -5
- package/highlevel/worker/port.d.ts +9 -5
- package/highlevel/worker/port.js +51 -17
- package/highlevel/worker/protocol.cjs +19 -7
- package/highlevel/worker/protocol.d.cts +28 -4
- package/highlevel/worker/protocol.d.ts +28 -4
- package/highlevel/worker/protocol.js +19 -7
- package/highlevel/worker/protocol.test.d.cts +1 -0
- package/highlevel/worker/protocol.test.d.ts +1 -0
- package/highlevel/worker/storage.cjs +4 -1
- package/highlevel/worker/storage.d.cts +2 -1
- package/highlevel/worker/storage.d.ts +2 -1
- package/highlevel/worker/storage.js +4 -1
- package/highlevel/worker/timers.cjs +19 -0
- package/highlevel/worker/timers.d.cts +11 -0
- package/highlevel/worker/timers.d.ts +11 -0
- package/highlevel/worker/timers.js +14 -0
- package/highlevel/worker/timers.test.d.cts +1 -0
- package/highlevel/worker/timers.test.d.ts +1 -0
- package/highlevel/worker/worker.cjs +266 -53
- package/highlevel/worker/worker.d.cts +30 -2
- package/highlevel/worker/worker.d.ts +30 -2
- package/highlevel/worker/worker.js +267 -54
- package/highlevel/worker/worker.test.d.cts +1 -0
- package/highlevel/worker/worker.test.d.ts +1 -0
- package/index.cjs +4 -11
- package/index.d.cts +2 -2
- package/index.d.ts +2 -2
- package/index.js +4 -5
- package/methods.cjs +0 -2
- package/methods.js +0 -2
- package/network/auth-key.d.cts +1 -1
- package/network/auth-key.d.ts +1 -1
- package/network/authorization.cjs +2 -2
- package/network/authorization.js +2 -2
- package/network/client.cjs +6 -7
- package/network/client.d.cts +1 -12
- package/network/client.d.ts +1 -12
- package/network/client.js +4 -5
- package/network/config-manager.d.cts +1 -1
- package/network/config-manager.d.ts +1 -1
- package/network/middlewares/internal-errors.cjs +8 -8
- package/network/middlewares/internal-errors.js +8 -8
- package/network/middlewares/on-error.d.cts +1 -1
- package/network/middlewares/on-error.d.ts +1 -1
- package/network/middlewares/on-method.d.cts +1 -1
- package/network/middlewares/on-method.d.ts +1 -1
- package/network/mtproto-session.cjs +0 -3
- package/network/mtproto-session.d.cts +1 -2
- package/network/mtproto-session.d.ts +1 -2
- package/network/mtproto-session.js +0 -3
- package/network/mtproxy/index.d.cts +1 -1
- package/network/mtproxy/index.d.ts +1 -1
- package/network/multi-session-connection.d.cts +1 -1
- package/network/multi-session-connection.d.ts +1 -1
- package/network/network-manager.cjs +40 -2
- package/network/network-manager.d.cts +12 -3
- package/network/network-manager.d.ts +12 -3
- package/network/network-manager.js +41 -3
- package/network/persistent-connection.d.cts +1 -1
- package/network/persistent-connection.d.ts +1 -1
- package/network/server-salt.d.cts +1 -1
- package/network/server-salt.d.ts +1 -1
- package/network/session-connection.cjs +10 -17
- package/network/session-connection.d.cts +1 -3
- package/network/session-connection.d.ts +1 -3
- package/network/session-connection.js +10 -17
- package/network/transports/abstract.d.cts +1 -1
- package/network/transports/abstract.d.ts +1 -1
- package/network/transports/intermediate.cjs +0 -2
- package/network/transports/intermediate.js +0 -2
- package/package.json +9 -6
- package/storage/service/base.d.cts +1 -1
- package/storage/service/base.d.ts +1 -1
- package/storage/service/future-salts.d.cts +1 -1
- package/storage/service/future-salts.d.ts +1 -1
- package/storage/sqlite/driver.cjs +0 -22
- package/storage/sqlite/driver.d.cts +0 -3
- package/storage/sqlite/driver.d.ts +0 -3
- package/storage/sqlite/driver.js +0 -22
- package/storage/sqlite/repository/kv.cjs +5 -47
- package/storage/sqlite/repository/kv.js +5 -47
- package/storage/sqlite/repository/peers.cjs +0 -3
- package/storage/sqlite/repository/peers.js +0 -3
- package/storage/storage.cjs +1 -3
- package/storage/storage.js +1 -3
- package/tl/api-schema.json +1 -0
- package/tl/app-config.json +1 -0
- package/tl/binary/reader.cjs +5248 -0
- package/tl/binary/reader.d.cts +3 -0
- package/tl/binary/reader.d.ts +3 -0
- package/tl/binary/reader.js +5243 -0
- package/tl/binary/rsa-keys.cjs +9 -0
- package/tl/binary/rsa-keys.d.cts +38 -0
- package/tl/binary/rsa-keys.d.ts +38 -0
- package/tl/binary/rsa-keys.js +4 -0
- package/tl/binary/writer.cjs +18718 -0
- package/tl/binary/writer.d.cts +4 -0
- package/tl/binary/writer.d.ts +4 -0
- package/tl/binary/writer.js +18713 -0
- package/tl/compat/reader.cjs +313 -0
- package/tl/compat/reader.d.cts +1 -0
- package/tl/compat/reader.d.ts +1 -0
- package/tl/compat/reader.js +308 -0
- package/tl/index.d.cts +58614 -0
- package/tl/index.d.ts +58614 -0
- package/tl/inner-mtp.cjs +63 -0
- package/tl/inner-mtp.js +58 -0
- package/tl/inner-tl.cjs +1261 -0
- package/tl/inner-tl.js +1256 -0
- package/tl/mtp-schema.json +1 -0
- package/tl/raw-errors.json +1 -0
- package/utils/binary/compat.cjs +10 -10
- package/utils/binary/compat.d.cts +1 -1
- package/utils/binary/compat.d.ts +1 -1
- package/utils/binary/compat.js +5 -5
- package/utils/binary/serialization.cjs +7 -7
- package/utils/binary/serialization.d.cts +1 -1
- package/utils/binary/serialization.d.ts +1 -1
- package/utils/binary/serialization.js +5 -5
- package/utils/crypto/keys.cjs +5 -5
- package/utils/crypto/keys.d.cts +1 -1
- package/utils/crypto/keys.d.ts +1 -1
- package/utils/crypto/keys.js +1 -1
- package/utils/crypto/password.d.cts +1 -1
- package/utils/crypto/password.d.ts +1 -1
- package/utils/date-entity-format.d.cts +1 -1
- package/utils/date-entity-format.d.ts +1 -1
- package/utils/index.d.cts +2 -6
- package/utils/index.d.ts +2 -6
- package/utils/links/bots.d.cts +1 -1
- package/utils/links/bots.d.ts +1 -1
- package/utils/logger.cjs +2 -2
- package/utils/logger.js +2 -2
- package/utils/peer-utils.d.cts +1 -1
- package/utils/peer-utils.d.ts +1 -1
- package/utils/tl-json.d.cts +1 -1
- package/utils/tl-json.d.ts +1 -1
- package/utils/type-assertions.d.cts +1 -1
- package/utils/type-assertions.d.ts +1 -1
- package/utils.cjs +4 -18
- package/utils.js +2 -10
- package/highlevel/methods/chats/get-nearby-chats.cjs +0 -37
- package/highlevel/methods/chats/get-nearby-chats.d.cts +0 -9
- package/highlevel/methods/chats/get-nearby-chats.d.ts +0 -9
- package/highlevel/methods/chats/get-nearby-chats.js +0 -32
- package/highlevel/methods/messages/_business-connection.cjs +0 -42
- package/highlevel/methods/messages/_business-connection.d.cts +0 -8
- package/highlevel/methods/messages/_business-connection.d.ts +0 -8
- package/highlevel/methods/messages/_business-connection.js +0 -37
- package/highlevel/types/peers/chat-location.cjs +0 -30
- package/highlevel/types/peers/chat-location.d.cts +0 -17
- package/highlevel/types/peers/chat-location.d.ts +0 -17
- package/highlevel/types/peers/chat-location.js +0 -25
- package/utils/error-reporting.cjs +0 -23
- package/utils/error-reporting.d.cts +0 -3
- package/utils/error-reporting.d.ts +0 -3
- package/utils/error-reporting.js +0 -18
|
@@ -7,30 +7,77 @@ if (typeof globalThis !== "undefined" && !globalThis._MTCUTE_CJS_DEPRECATION_WAR
|
|
|
7
7
|
Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
|
|
8
8
|
const errors = require("./errors.cjs");
|
|
9
9
|
const protocol = require("./protocol.cjs");
|
|
10
|
+
const WORKER_HEARTBEAT_TIMEOUT = 6e4;
|
|
11
|
+
const WORKER_HEARTBEAT_SWEEP_INTERVAL = 1e4;
|
|
10
12
|
class TelegramWorker {
|
|
11
13
|
constructor(params) {
|
|
12
14
|
this.params = params;
|
|
13
15
|
this.workerId = params.workerId ?? protocol.DEFAULT_WORKER_ID;
|
|
16
|
+
this.client = params.client;
|
|
17
|
+
}
|
|
18
|
+
client;
|
|
19
|
+
broadcast = () => {
|
|
20
|
+
};
|
|
21
|
+
_cleanup = [];
|
|
22
|
+
_heartbeatSweep;
|
|
23
|
+
_mounted = false;
|
|
24
|
+
activeConnections = /* @__PURE__ */ new Set();
|
|
25
|
+
connectionLastSeen = /* @__PURE__ */ new Map();
|
|
26
|
+
pendingAborts = /* @__PURE__ */ new Map();
|
|
27
|
+
workerId;
|
|
28
|
+
_disconnecting;
|
|
29
|
+
_destroying;
|
|
30
|
+
mount() {
|
|
31
|
+
if (this._mounted) return this;
|
|
14
32
|
const [broadcast, cleanup] = this.registerWorker((message, respond) => {
|
|
15
33
|
if (message._mtcuteWorkerId !== this.workerId) return;
|
|
16
34
|
switch (message.type) {
|
|
35
|
+
case "connect":
|
|
36
|
+
this.touchConnection(message.connectionId, true);
|
|
37
|
+
break;
|
|
38
|
+
case "heartbeat":
|
|
39
|
+
if (!this.activeConnections.has(message.connectionId)) {
|
|
40
|
+
this.respondConnectionExpired(respond, message.connectionId);
|
|
41
|
+
break;
|
|
42
|
+
}
|
|
43
|
+
this.touchConnection(message.connectionId);
|
|
44
|
+
break;
|
|
45
|
+
case "release":
|
|
46
|
+
this.onRelease(message.connectionId);
|
|
47
|
+
break;
|
|
17
48
|
case "invoke":
|
|
49
|
+
if (!this.activeConnections.has(message.connectionId)) {
|
|
50
|
+
this.respondConnectionExpired(respond, message.connectionId);
|
|
51
|
+
break;
|
|
52
|
+
}
|
|
53
|
+
this.touchConnection(message.connectionId);
|
|
18
54
|
this.onInvoke(message, respond);
|
|
19
55
|
break;
|
|
20
56
|
case "abort": {
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
this.pendingAborts.delete(message.id);
|
|
57
|
+
if (!this.activeConnections.has(message.connectionId)) {
|
|
58
|
+
this.respondConnectionExpired(respond, message.connectionId);
|
|
59
|
+
break;
|
|
25
60
|
}
|
|
61
|
+
this.touchConnection(message.connectionId);
|
|
62
|
+
const pending = this.pendingAborts.get(message.connectionId);
|
|
63
|
+
const abort = pending?.get(message.id);
|
|
64
|
+
if (!abort) break;
|
|
65
|
+
abort.abort();
|
|
66
|
+
pending.delete(message.id);
|
|
67
|
+
if (!pending.size) {
|
|
68
|
+
this.pendingAborts.delete(message.connectionId);
|
|
69
|
+
}
|
|
70
|
+
break;
|
|
26
71
|
}
|
|
27
72
|
}
|
|
28
73
|
});
|
|
29
74
|
this.broadcast = broadcast;
|
|
30
|
-
this._cleanup
|
|
31
|
-
|
|
32
|
-
this.
|
|
33
|
-
client
|
|
75
|
+
this._cleanup.push(cleanup);
|
|
76
|
+
this._heartbeatSweep = setInterval(this.sweepExpiredConnections, WORKER_HEARTBEAT_SWEEP_INTERVAL);
|
|
77
|
+
this._mounted = true;
|
|
78
|
+
const client = this.client;
|
|
79
|
+
const prevLogHandler = client.log.mgr.handler;
|
|
80
|
+
const onLog = (color, level, tag, fmt, args) => this.broadcast({
|
|
34
81
|
_mtcuteWorkerId: this.workerId,
|
|
35
82
|
type: "log",
|
|
36
83
|
color,
|
|
@@ -39,56 +86,201 @@ class TelegramWorker {
|
|
|
39
86
|
fmt,
|
|
40
87
|
args
|
|
41
88
|
});
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
state
|
|
54
|
-
})
|
|
55
|
-
);
|
|
56
|
-
client.stopSignal.addEventListener("abort", () => this.broadcast({
|
|
89
|
+
const onError = (err) => this.broadcast({
|
|
90
|
+
_mtcuteWorkerId: this.workerId,
|
|
91
|
+
type: "error",
|
|
92
|
+
error: errors.serializeError(err)
|
|
93
|
+
});
|
|
94
|
+
const onConnectionState = (state) => this.broadcast({
|
|
95
|
+
_mtcuteWorkerId: this.workerId,
|
|
96
|
+
type: "conn_state",
|
|
97
|
+
state
|
|
98
|
+
});
|
|
99
|
+
const onStop = () => this.broadcast({
|
|
57
100
|
_mtcuteWorkerId: this.workerId,
|
|
58
101
|
type: "stop"
|
|
59
|
-
})
|
|
102
|
+
});
|
|
103
|
+
client.log.mgr.handler = onLog;
|
|
104
|
+
client.onError.add(onError);
|
|
105
|
+
client.onConnectionState.add(onConnectionState);
|
|
106
|
+
client.stopSignal.addEventListener("abort", onStop);
|
|
107
|
+
this._cleanup.push(
|
|
108
|
+
() => {
|
|
109
|
+
client.log.mgr.handler = prevLogHandler;
|
|
110
|
+
},
|
|
111
|
+
() => client.onError.remove(onError),
|
|
112
|
+
() => client.onConnectionState.remove(onConnectionState),
|
|
113
|
+
() => client.stopSignal.removeEventListener("abort", onStop)
|
|
114
|
+
);
|
|
60
115
|
if (client.updates) {
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
);
|
|
116
|
+
const onRawUpdate = ({ update, peers }) => this.broadcast({
|
|
117
|
+
_mtcuteWorkerId: this.workerId,
|
|
118
|
+
type: "update",
|
|
119
|
+
update: protocol.serializeResult(update),
|
|
120
|
+
users: protocol.serializeResult(peers.users),
|
|
121
|
+
chats: protocol.serializeResult(peers.chats),
|
|
122
|
+
hasMin: peers.hasMin
|
|
123
|
+
});
|
|
124
|
+
client.onRawUpdate.add(onRawUpdate);
|
|
125
|
+
this._cleanup.push(() => client.onRawUpdate.remove(onRawUpdate));
|
|
71
126
|
} else {
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
);
|
|
127
|
+
const onServerUpdate = (update) => this.broadcast({
|
|
128
|
+
_mtcuteWorkerId: this.workerId,
|
|
129
|
+
type: "server_update",
|
|
130
|
+
update: protocol.serializeResult(update)
|
|
131
|
+
});
|
|
132
|
+
client.onServerUpdate.add(onServerUpdate);
|
|
133
|
+
this._cleanup.push(() => client.onServerUpdate.remove(onServerUpdate));
|
|
79
134
|
}
|
|
135
|
+
return this;
|
|
136
|
+
}
|
|
137
|
+
getConnectionAborts(connectionId) {
|
|
138
|
+
const existing = this.pendingAborts.get(connectionId);
|
|
139
|
+
if (existing) return existing;
|
|
140
|
+
const created = /* @__PURE__ */ new Map();
|
|
141
|
+
this.pendingAborts.set(connectionId, created);
|
|
142
|
+
return created;
|
|
143
|
+
}
|
|
144
|
+
deletePendingAbort(connectionId, id) {
|
|
145
|
+
const pending = this.pendingAborts.get(connectionId);
|
|
146
|
+
if (!pending) return;
|
|
147
|
+
pending.delete(id);
|
|
148
|
+
if (!pending.size) {
|
|
149
|
+
this.pendingAborts.delete(connectionId);
|
|
150
|
+
}
|
|
151
|
+
}
|
|
152
|
+
touchConnection(connectionId, activate = false) {
|
|
153
|
+
if (activate) {
|
|
154
|
+
this.activeConnections.add(connectionId);
|
|
155
|
+
} else if (!this.activeConnections.has(connectionId)) {
|
|
156
|
+
return;
|
|
157
|
+
}
|
|
158
|
+
this.connectionLastSeen.set(connectionId, Date.now());
|
|
159
|
+
}
|
|
160
|
+
respondConnectionExpired(respond, connectionId) {
|
|
161
|
+
respond({
|
|
162
|
+
_mtcuteWorkerId: this.workerId,
|
|
163
|
+
connectionId,
|
|
164
|
+
type: "connection_expired"
|
|
165
|
+
});
|
|
166
|
+
}
|
|
167
|
+
sweepExpiredConnections = () => {
|
|
168
|
+
const now = Date.now();
|
|
169
|
+
for (const [connectionId, lastSeen] of this.connectionLastSeen) {
|
|
170
|
+
if (now - lastSeen < WORKER_HEARTBEAT_TIMEOUT) continue;
|
|
171
|
+
this.respondConnectionExpired(this.broadcast, connectionId);
|
|
172
|
+
this.onRelease(connectionId);
|
|
173
|
+
}
|
|
174
|
+
};
|
|
175
|
+
onRelease(connectionId) {
|
|
176
|
+
const wasActive = this.activeConnections.delete(connectionId);
|
|
177
|
+
const hadLastSeen = this.connectionLastSeen.delete(connectionId);
|
|
178
|
+
this.client.timers.clearOwner(connectionId);
|
|
179
|
+
const pending = this.pendingAborts.get(connectionId);
|
|
180
|
+
if (pending) {
|
|
181
|
+
for (const abort of pending.values()) {
|
|
182
|
+
abort.abort();
|
|
183
|
+
}
|
|
184
|
+
this.pendingAborts.delete(connectionId);
|
|
185
|
+
}
|
|
186
|
+
if (!wasActive && !hadLastSeen && !pending) return;
|
|
187
|
+
if (this.activeConnections.size !== 0) return;
|
|
188
|
+
switch (this.params.onLastDisconnected ?? "nothing") {
|
|
189
|
+
case "nothing":
|
|
190
|
+
return;
|
|
191
|
+
case "disconnect":
|
|
192
|
+
if (this._disconnecting || this._destroying) return;
|
|
193
|
+
void this.disconnectSharedClient().catch(() => {
|
|
194
|
+
});
|
|
195
|
+
return;
|
|
196
|
+
case "destroy":
|
|
197
|
+
if (this._destroying) return;
|
|
198
|
+
void this.forceDestroy().catch(() => {
|
|
199
|
+
});
|
|
200
|
+
}
|
|
201
|
+
}
|
|
202
|
+
disconnectSharedClient() {
|
|
203
|
+
if (this._destroying) return this._destroying;
|
|
204
|
+
if (this._disconnecting) return this._disconnecting;
|
|
205
|
+
this._disconnecting = this.client.disconnect().finally(() => {
|
|
206
|
+
this._disconnecting = void 0;
|
|
207
|
+
});
|
|
208
|
+
return this._disconnecting;
|
|
209
|
+
}
|
|
210
|
+
forceDestroy() {
|
|
211
|
+
this.activeConnections.clear();
|
|
212
|
+
this.connectionLastSeen.clear();
|
|
213
|
+
for (const pending of this.pendingAborts.values()) {
|
|
214
|
+
for (const abort of pending.values()) {
|
|
215
|
+
abort.abort();
|
|
216
|
+
}
|
|
217
|
+
}
|
|
218
|
+
this.pendingAborts.clear();
|
|
219
|
+
if (!this._destroying) {
|
|
220
|
+
this._destroying = (this._disconnecting ?? Promise.resolve()).catch(() => {
|
|
221
|
+
}).then(() => this.client.destroy());
|
|
222
|
+
}
|
|
223
|
+
return this._destroying;
|
|
224
|
+
}
|
|
225
|
+
shouldSyncCurrentUser(msg) {
|
|
226
|
+
if (msg.target === "storage-self") {
|
|
227
|
+
return msg.method === "store" || msg.method === "storeFrom" || msg.method === "update";
|
|
228
|
+
}
|
|
229
|
+
return msg.target === "client" && (msg.method === "notifyLoggedIn" || msg.method === "notifyLoggedOut" || msg.method === "importSession");
|
|
80
230
|
}
|
|
81
|
-
client;
|
|
82
|
-
broadcast;
|
|
83
|
-
_cleanup;
|
|
84
|
-
pendingAborts = /* @__PURE__ */ new Map();
|
|
85
|
-
workerId;
|
|
86
231
|
onInvoke(msg, respond) {
|
|
232
|
+
if (msg.target === "client" && msg.method === "destroy") {
|
|
233
|
+
this.forceDestroy().then(() => {
|
|
234
|
+
if (msg.void) return;
|
|
235
|
+
respond({
|
|
236
|
+
_mtcuteWorkerId: this.workerId,
|
|
237
|
+
connectionId: msg.connectionId,
|
|
238
|
+
type: "result",
|
|
239
|
+
id: msg.id
|
|
240
|
+
});
|
|
241
|
+
}).catch((err) => {
|
|
242
|
+
respond({
|
|
243
|
+
_mtcuteWorkerId: this.workerId,
|
|
244
|
+
connectionId: msg.connectionId,
|
|
245
|
+
type: "result",
|
|
246
|
+
id: msg.id,
|
|
247
|
+
error: errors.serializeError(err)
|
|
248
|
+
});
|
|
249
|
+
});
|
|
250
|
+
return;
|
|
251
|
+
}
|
|
252
|
+
if (msg.target === "client" && msg.method === "disconnect") {
|
|
253
|
+
this.disconnectSharedClient().then(() => {
|
|
254
|
+
if (msg.void) return;
|
|
255
|
+
respond({
|
|
256
|
+
_mtcuteWorkerId: this.workerId,
|
|
257
|
+
connectionId: msg.connectionId,
|
|
258
|
+
type: "result",
|
|
259
|
+
id: msg.id
|
|
260
|
+
});
|
|
261
|
+
}).catch((err) => {
|
|
262
|
+
respond({
|
|
263
|
+
_mtcuteWorkerId: this.workerId,
|
|
264
|
+
connectionId: msg.connectionId,
|
|
265
|
+
type: "result",
|
|
266
|
+
id: msg.id,
|
|
267
|
+
error: errors.serializeError(err)
|
|
268
|
+
});
|
|
269
|
+
});
|
|
270
|
+
return;
|
|
271
|
+
}
|
|
87
272
|
let target;
|
|
88
273
|
switch (msg.target) {
|
|
89
274
|
case "custom":
|
|
90
275
|
target = this.params.customMethods;
|
|
91
276
|
break;
|
|
277
|
+
case "timers":
|
|
278
|
+
target = {
|
|
279
|
+
upsert: (spec) => Promise.resolve(this.client.timers.upsertOwned(msg.connectionId, spec)),
|
|
280
|
+
cancel: (key) => this.client.timers.cancel(key),
|
|
281
|
+
exists: (key) => this.client.timers.exists(key)
|
|
282
|
+
};
|
|
283
|
+
break;
|
|
92
284
|
case "client":
|
|
93
285
|
target = this.client;
|
|
94
286
|
break;
|
|
@@ -107,9 +299,10 @@ class TelegramWorker {
|
|
|
107
299
|
default: {
|
|
108
300
|
respond({
|
|
109
301
|
_mtcuteWorkerId: this.workerId,
|
|
302
|
+
connectionId: msg.connectionId,
|
|
110
303
|
type: "result",
|
|
111
304
|
id: msg.id,
|
|
112
|
-
error: new Error(`Unknown target ${msg.target}`)
|
|
305
|
+
error: errors.serializeError(new Error(`Unknown target ${msg.target}`))
|
|
113
306
|
});
|
|
114
307
|
return;
|
|
115
308
|
}
|
|
@@ -118,16 +311,17 @@ class TelegramWorker {
|
|
|
118
311
|
if (!method) {
|
|
119
312
|
respond({
|
|
120
313
|
_mtcuteWorkerId: this.workerId,
|
|
314
|
+
connectionId: msg.connectionId,
|
|
121
315
|
type: "result",
|
|
122
316
|
id: msg.id,
|
|
123
|
-
error: new Error(`Method ${msg.method} not found on ${msg.target}`)
|
|
317
|
+
error: errors.serializeError(new Error(`Method ${msg.method} not found on ${msg.target}`))
|
|
124
318
|
});
|
|
125
319
|
return;
|
|
126
320
|
}
|
|
127
321
|
let args;
|
|
128
322
|
if (msg.target === "client" && msg.method === "call" && msg.withAbort) {
|
|
129
323
|
const abort = new AbortController();
|
|
130
|
-
this.
|
|
324
|
+
this.getConnectionAborts(msg.connectionId).set(msg.id, abort);
|
|
131
325
|
args = [
|
|
132
326
|
protocol.deserializeResult(msg.args[0]),
|
|
133
327
|
{
|
|
@@ -138,23 +332,36 @@ class TelegramWorker {
|
|
|
138
332
|
} else {
|
|
139
333
|
args = protocol.deserializeResult(msg.args);
|
|
140
334
|
}
|
|
141
|
-
|
|
335
|
+
const syncCurrentUser = this.shouldSyncCurrentUser(msg);
|
|
336
|
+
Promise.resolve(method.apply(target, args)).then(async (res) => {
|
|
142
337
|
if (msg.withAbort) {
|
|
143
|
-
this.
|
|
338
|
+
this.deletePendingAbort(msg.connectionId, msg.id);
|
|
339
|
+
}
|
|
340
|
+
if (syncCurrentUser) {
|
|
341
|
+
try {
|
|
342
|
+
this.broadcast({
|
|
343
|
+
_mtcuteWorkerId: this.workerId,
|
|
344
|
+
type: "self_sync",
|
|
345
|
+
self: protocol.serializeResult(await this.client.storage.self.fetch())
|
|
346
|
+
});
|
|
347
|
+
} catch {
|
|
348
|
+
}
|
|
144
349
|
}
|
|
145
350
|
if (msg.void) return;
|
|
146
351
|
respond({
|
|
147
352
|
_mtcuteWorkerId: this.workerId,
|
|
353
|
+
connectionId: msg.connectionId,
|
|
148
354
|
type: "result",
|
|
149
355
|
id: msg.id,
|
|
150
356
|
result: protocol.serializeResult(res)
|
|
151
357
|
});
|
|
152
358
|
}).catch((err) => {
|
|
153
359
|
if (msg.withAbort) {
|
|
154
|
-
this.
|
|
360
|
+
this.deletePendingAbort(msg.connectionId, msg.id);
|
|
155
361
|
}
|
|
156
362
|
respond({
|
|
157
363
|
_mtcuteWorkerId: this.workerId,
|
|
364
|
+
connectionId: msg.connectionId,
|
|
158
365
|
type: "result",
|
|
159
366
|
id: msg.id,
|
|
160
367
|
error: errors.serializeError(err)
|
|
@@ -162,7 +369,13 @@ class TelegramWorker {
|
|
|
162
369
|
});
|
|
163
370
|
}
|
|
164
371
|
destroy() {
|
|
165
|
-
this.
|
|
372
|
+
if (this._heartbeatSweep !== void 0) {
|
|
373
|
+
clearInterval(this._heartbeatSweep);
|
|
374
|
+
}
|
|
375
|
+
for (const cleanup of this._cleanup) {
|
|
376
|
+
cleanup();
|
|
377
|
+
}
|
|
378
|
+
this._mounted = false;
|
|
166
379
|
}
|
|
167
380
|
}
|
|
168
381
|
exports.TelegramWorker = TelegramWorker;
|
|
@@ -2,18 +2,46 @@ import { BaseTelegramClient } from '../base.js';
|
|
|
2
2
|
import { RespondFn, WorkerCustomMethods, WorkerMessageHandler } from './protocol.js';
|
|
3
3
|
export interface TelegramWorkerOptions<T extends WorkerCustomMethods> {
|
|
4
4
|
client: BaseTelegramClient;
|
|
5
|
+
/** mtcute worker ID to disambiguate multiple clients within the same underlying worker */
|
|
5
6
|
workerId?: string;
|
|
7
|
+
/**
|
|
8
|
+
* What to do when the last connection to the worker is closed?
|
|
9
|
+
*
|
|
10
|
+
* - `destroy`: destroy the client, terminating the worker
|
|
11
|
+
* - `disconnect`: disconnect the client, but keep the worker running until `forceDestroy` is called
|
|
12
|
+
* - `nothing`: do nothing, lifecycle is managed manually
|
|
13
|
+
*
|
|
14
|
+
* @default 'nothing'
|
|
15
|
+
*/
|
|
16
|
+
onLastDisconnected?: 'destroy' | 'disconnect' | 'nothing';
|
|
17
|
+
/** additional custom methods to expose */
|
|
6
18
|
customMethods?: T;
|
|
7
19
|
}
|
|
8
20
|
export declare abstract class TelegramWorker<T extends WorkerCustomMethods> {
|
|
9
21
|
readonly params: TelegramWorkerOptions<T>;
|
|
10
22
|
readonly client: BaseTelegramClient;
|
|
11
|
-
|
|
23
|
+
broadcast: RespondFn;
|
|
12
24
|
private _cleanup;
|
|
25
|
+
private _heartbeatSweep;
|
|
26
|
+
private _mounted;
|
|
13
27
|
abstract registerWorker(handler: WorkerMessageHandler): [RespondFn, VoidFunction];
|
|
14
|
-
readonly
|
|
28
|
+
readonly activeConnections: Set<string>;
|
|
29
|
+
readonly connectionLastSeen: Map<string, number>;
|
|
30
|
+
readonly pendingAborts: Map<string, Map<number, AbortController>>;
|
|
15
31
|
readonly workerId: string;
|
|
32
|
+
private _disconnecting?;
|
|
33
|
+
private _destroying?;
|
|
16
34
|
constructor(params: TelegramWorkerOptions<T>);
|
|
35
|
+
mount(): this;
|
|
36
|
+
private getConnectionAborts;
|
|
37
|
+
private deletePendingAbort;
|
|
38
|
+
private touchConnection;
|
|
39
|
+
private respondConnectionExpired;
|
|
40
|
+
private sweepExpiredConnections;
|
|
41
|
+
private onRelease;
|
|
42
|
+
private disconnectSharedClient;
|
|
43
|
+
private forceDestroy;
|
|
44
|
+
private shouldSyncCurrentUser;
|
|
17
45
|
private onInvoke;
|
|
18
46
|
destroy(): void;
|
|
19
47
|
}
|
|
@@ -2,18 +2,46 @@ import { BaseTelegramClient } from '../base.js';
|
|
|
2
2
|
import { RespondFn, WorkerCustomMethods, WorkerMessageHandler } from './protocol.js';
|
|
3
3
|
export interface TelegramWorkerOptions<T extends WorkerCustomMethods> {
|
|
4
4
|
client: BaseTelegramClient;
|
|
5
|
+
/** mtcute worker ID to disambiguate multiple clients within the same underlying worker */
|
|
5
6
|
workerId?: string;
|
|
7
|
+
/**
|
|
8
|
+
* What to do when the last connection to the worker is closed?
|
|
9
|
+
*
|
|
10
|
+
* - `destroy`: destroy the client, terminating the worker
|
|
11
|
+
* - `disconnect`: disconnect the client, but keep the worker running until `forceDestroy` is called
|
|
12
|
+
* - `nothing`: do nothing, lifecycle is managed manually
|
|
13
|
+
*
|
|
14
|
+
* @default 'nothing'
|
|
15
|
+
*/
|
|
16
|
+
onLastDisconnected?: 'destroy' | 'disconnect' | 'nothing';
|
|
17
|
+
/** additional custom methods to expose */
|
|
6
18
|
customMethods?: T;
|
|
7
19
|
}
|
|
8
20
|
export declare abstract class TelegramWorker<T extends WorkerCustomMethods> {
|
|
9
21
|
readonly params: TelegramWorkerOptions<T>;
|
|
10
22
|
readonly client: BaseTelegramClient;
|
|
11
|
-
|
|
23
|
+
broadcast: RespondFn;
|
|
12
24
|
private _cleanup;
|
|
25
|
+
private _heartbeatSweep;
|
|
26
|
+
private _mounted;
|
|
13
27
|
abstract registerWorker(handler: WorkerMessageHandler): [RespondFn, VoidFunction];
|
|
14
|
-
readonly
|
|
28
|
+
readonly activeConnections: Set<string>;
|
|
29
|
+
readonly connectionLastSeen: Map<string, number>;
|
|
30
|
+
readonly pendingAborts: Map<string, Map<number, AbortController>>;
|
|
15
31
|
readonly workerId: string;
|
|
32
|
+
private _disconnecting?;
|
|
33
|
+
private _destroying?;
|
|
16
34
|
constructor(params: TelegramWorkerOptions<T>);
|
|
35
|
+
mount(): this;
|
|
36
|
+
private getConnectionAborts;
|
|
37
|
+
private deletePendingAbort;
|
|
38
|
+
private touchConnection;
|
|
39
|
+
private respondConnectionExpired;
|
|
40
|
+
private sweepExpiredConnections;
|
|
41
|
+
private onRelease;
|
|
42
|
+
private disconnectSharedClient;
|
|
43
|
+
private forceDestroy;
|
|
44
|
+
private shouldSyncCurrentUser;
|
|
17
45
|
private onInvoke;
|
|
18
46
|
destroy(): void;
|
|
19
47
|
}
|