@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
package/client.cjs
CHANGED
|
@@ -60,7 +60,6 @@ const getCreatorAfterLeave = require("./highlevel/methods/chats/get-creator-afte
|
|
|
60
60
|
const getFullChat = require("./highlevel/methods/chats/get-full-chat.cjs");
|
|
61
61
|
const getFullUser = require("./highlevel/methods/chats/get-full-user.cjs");
|
|
62
62
|
const getMessageAuthor = require("./highlevel/methods/chats/get-message-author.cjs");
|
|
63
|
-
const getNearbyChats = require("./highlevel/methods/chats/get-nearby-chats.cjs");
|
|
64
63
|
const getPeer = require("./highlevel/methods/chats/get-peer.cjs");
|
|
65
64
|
const getPeers = require("./highlevel/methods/chats/get-peers.cjs");
|
|
66
65
|
const getSimilarChannels = require("./highlevel/methods/chats/get-similar-channels.cjs");
|
|
@@ -620,9 +619,6 @@ TelegramClient.prototype.getFullUser = function(...args) {
|
|
|
620
619
|
TelegramClient.prototype.getMessageAuthor = function(...args) {
|
|
621
620
|
return getMessageAuthor.getMessageAuthor(this._client, ...args);
|
|
622
621
|
};
|
|
623
|
-
TelegramClient.prototype.getNearbyChats = function(...args) {
|
|
624
|
-
return getNearbyChats.getNearbyChats(this._client, ...args);
|
|
625
|
-
};
|
|
626
622
|
TelegramClient.prototype.getPeer = function(...args) {
|
|
627
623
|
return getPeer.getPeer(this._client, ...args);
|
|
628
624
|
};
|
package/client.js
CHANGED
|
@@ -53,7 +53,6 @@ import { getCreatorAfterLeave } from "./highlevel/methods/chats/get-creator-afte
|
|
|
53
53
|
import { getFullChat } from "./highlevel/methods/chats/get-full-chat.js";
|
|
54
54
|
import { getFullUser } from "./highlevel/methods/chats/get-full-user.js";
|
|
55
55
|
import { getMessageAuthor } from "./highlevel/methods/chats/get-message-author.js";
|
|
56
|
-
import { getNearbyChats } from "./highlevel/methods/chats/get-nearby-chats.js";
|
|
57
56
|
import { getPeer } from "./highlevel/methods/chats/get-peer.js";
|
|
58
57
|
import { getPeers } from "./highlevel/methods/chats/get-peers.js";
|
|
59
58
|
import { getSimilarChannels } from "./highlevel/methods/chats/get-similar-channels.js";
|
|
@@ -613,9 +612,6 @@ TelegramClient.prototype.getFullUser = function(...args) {
|
|
|
613
612
|
TelegramClient.prototype.getMessageAuthor = function(...args) {
|
|
614
613
|
return getMessageAuthor(this._client, ...args);
|
|
615
614
|
};
|
|
616
|
-
TelegramClient.prototype.getNearbyChats = function(...args) {
|
|
617
|
-
return getNearbyChats(this._client, ...args);
|
|
618
|
-
};
|
|
619
615
|
TelegramClient.prototype.getPeer = function(...args) {
|
|
620
616
|
return getPeer(this._client, ...args);
|
|
621
617
|
};
|
package/highlevel/base.cjs
CHANGED
|
@@ -6,23 +6,20 @@ if (typeof globalThis !== "undefined" && !globalThis._MTCUTE_CJS_DEPRECATION_WAR
|
|
|
6
6
|
"use strict";
|
|
7
7
|
Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
|
|
8
8
|
const utils = require("@fuman/utils");
|
|
9
|
-
const tl = require("@mtcute/tl");
|
|
10
9
|
const client = require("../network/client.cjs");
|
|
11
|
-
const errorReporting = require("../utils/error-reporting.cjs");
|
|
12
10
|
const functionUtils = require("../utils/function-utils.cjs");
|
|
13
11
|
const logger = require("../utils/logger.cjs");
|
|
14
12
|
const typeAssertions = require("../utils/type-assertions.cjs");
|
|
15
13
|
require("@mtcute/tl-runtime");
|
|
16
|
-
require("@mtcute/tl/binary/reader.js");
|
|
17
|
-
require("@mtcute/tl/binary/writer.js");
|
|
18
14
|
const appConfigManager = require("./managers/app-config-manager.cjs");
|
|
19
15
|
const timers = require("./managers/timers.cjs");
|
|
20
16
|
const storage = require("./storage/storage.cjs");
|
|
21
17
|
const manager = require("./updates/manager.cjs");
|
|
22
18
|
const stringSession = require("./utils/string-session.cjs");
|
|
23
19
|
const password = require("../utils/crypto/password.cjs");
|
|
20
|
+
const innerTl = require("../tl/inner-tl.cjs");
|
|
24
21
|
function makeRpcError(raw, stack, method) {
|
|
25
|
-
const error =
|
|
22
|
+
const error = innerTl.RpcError.fromTl(raw);
|
|
26
23
|
error.stack = `RpcError (${error.code} ${error.text}): ${error.message}
|
|
27
24
|
at ${method}
|
|
28
25
|
${stack.split("\n").slice(2).join("\n")}`;
|
|
@@ -64,7 +61,12 @@ class BaseTelegramClient {
|
|
|
64
61
|
provider: this.params.storage,
|
|
65
62
|
...this.params.storageOptions
|
|
66
63
|
});
|
|
67
|
-
this.timers = new timers.TimersManager()
|
|
64
|
+
this.timers = new timers.TimersManager(async (spec, abortSignal) => {
|
|
65
|
+
await this.call(spec.request, {
|
|
66
|
+
abortSignal,
|
|
67
|
+
...spec.options
|
|
68
|
+
});
|
|
69
|
+
});
|
|
68
70
|
this.timers.onError((err) => this.onError.emit(utils.unknownToError(err)));
|
|
69
71
|
}
|
|
70
72
|
updates;
|
|
@@ -186,9 +188,6 @@ class BaseTelegramClient {
|
|
|
186
188
|
const res = await this.mt.call(message, params);
|
|
187
189
|
if (typeAssertions.isTlRpcError(res)) {
|
|
188
190
|
const error = makeRpcError(res, new Error().stack ?? "", message._);
|
|
189
|
-
if (error.unknown && this.params.enableErrorReporting) {
|
|
190
|
-
errorReporting.reportUnknownError(this.log, error, message._);
|
|
191
|
-
}
|
|
192
191
|
throw error;
|
|
193
192
|
}
|
|
194
193
|
await this.storage.peers.updatePeersFrom(res);
|
package/highlevel/base.d.cts
CHANGED
|
@@ -10,7 +10,7 @@ import { ITelegramStorageProvider } from './storage/provider.js';
|
|
|
10
10
|
import { TelegramStorageManagerExtraOptions, TelegramStorageManager } from './storage/storage.js';
|
|
11
11
|
import { RawUpdateInfo, UpdatesManagerParams } from './updates/types.js';
|
|
12
12
|
import { Emitter } from '@fuman/utils';
|
|
13
|
-
import { tl } from '
|
|
13
|
+
import { tl } from '../tl/index.js';
|
|
14
14
|
import { AppConfigManager } from './managers/app-config-manager.js';
|
|
15
15
|
import { TimersManager } from './managers/timers.js';
|
|
16
16
|
import { UpdatesManager } from './updates/manager.js';
|
package/highlevel/base.d.ts
CHANGED
|
@@ -10,7 +10,7 @@ import { ITelegramStorageProvider } from './storage/provider.js';
|
|
|
10
10
|
import { TelegramStorageManagerExtraOptions, TelegramStorageManager } from './storage/storage.js';
|
|
11
11
|
import { RawUpdateInfo, UpdatesManagerParams } from './updates/types.js';
|
|
12
12
|
import { Emitter } from '@fuman/utils';
|
|
13
|
-
import { tl } from '
|
|
13
|
+
import { tl } from '../tl/index.js';
|
|
14
14
|
import { AppConfigManager } from './managers/app-config-manager.js';
|
|
15
15
|
import { TimersManager } from './managers/timers.js';
|
|
16
16
|
import { UpdatesManager } from './updates/manager.js';
|
package/highlevel/base.js
CHANGED
|
@@ -1,21 +1,18 @@
|
|
|
1
1
|
import { unknownToError, Emitter } from "@fuman/utils";
|
|
2
|
-
import { tl } from "@mtcute/tl";
|
|
3
2
|
import { MtClient } from "../network/client.js";
|
|
4
|
-
import { reportUnknownError } from "../utils/error-reporting.js";
|
|
5
3
|
import { asyncResettable } from "../utils/function-utils.js";
|
|
6
4
|
import { LogManager } from "../utils/logger.js";
|
|
7
5
|
import { isTlRpcError } from "../utils/type-assertions.js";
|
|
8
6
|
import "@mtcute/tl-runtime";
|
|
9
|
-
import "@mtcute/tl/binary/reader.js";
|
|
10
|
-
import "@mtcute/tl/binary/writer.js";
|
|
11
7
|
import { AppConfigManager } from "./managers/app-config-manager.js";
|
|
12
8
|
import { TimersManager } from "./managers/timers.js";
|
|
13
9
|
import { TelegramStorageManager } from "./storage/storage.js";
|
|
14
10
|
import { UpdatesManager } from "./updates/manager.js";
|
|
15
11
|
import { readStringSession, writeStringSession } from "./utils/string-session.js";
|
|
16
12
|
import { computeSrpParams, computeNewPasswordHash } from "../utils/crypto/password.js";
|
|
13
|
+
import { RpcError } from "../tl/inner-tl.js";
|
|
17
14
|
function makeRpcError(raw, stack, method) {
|
|
18
|
-
const error =
|
|
15
|
+
const error = RpcError.fromTl(raw);
|
|
19
16
|
error.stack = `RpcError (${error.code} ${error.text}): ${error.message}
|
|
20
17
|
at ${method}
|
|
21
18
|
${stack.split("\n").slice(2).join("\n")}`;
|
|
@@ -57,7 +54,12 @@ class BaseTelegramClient {
|
|
|
57
54
|
provider: this.params.storage,
|
|
58
55
|
...this.params.storageOptions
|
|
59
56
|
});
|
|
60
|
-
this.timers = new TimersManager()
|
|
57
|
+
this.timers = new TimersManager(async (spec, abortSignal) => {
|
|
58
|
+
await this.call(spec.request, {
|
|
59
|
+
abortSignal,
|
|
60
|
+
...spec.options
|
|
61
|
+
});
|
|
62
|
+
});
|
|
61
63
|
this.timers.onError((err) => this.onError.emit(unknownToError(err)));
|
|
62
64
|
}
|
|
63
65
|
updates;
|
|
@@ -179,9 +181,6 @@ class BaseTelegramClient {
|
|
|
179
181
|
const res = await this.mt.call(message, params);
|
|
180
182
|
if (isTlRpcError(res)) {
|
|
181
183
|
const error = makeRpcError(res, new Error().stack ?? "", message._);
|
|
182
|
-
if (error.unknown && this.params.enableErrorReporting) {
|
|
183
|
-
reportUnknownError(this.log, error, message._);
|
|
184
|
-
}
|
|
185
184
|
throw error;
|
|
186
185
|
}
|
|
187
186
|
await this.storage.peers.updatePeersFrom(res);
|
package/highlevel/client.d.cts
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import { tl } from '@mtcute/tl';
|
|
2
1
|
import { default as Long } from 'long';
|
|
3
2
|
import { RpcCallOptions } from '../network/index.js';
|
|
3
|
+
import { tl } from '../tl/index.js';
|
|
4
4
|
import { MaybeArray, MaybePromise, PartialExcept, PartialOnly } from '../types/index.js';
|
|
5
5
|
import { BaseTelegramClientOptions } from './base.js';
|
|
6
6
|
import { ITelegramClient } from './client.types.js';
|
|
@@ -1304,15 +1304,6 @@ export interface TelegramClient extends ITelegramClient {
|
|
|
1304
1304
|
*/
|
|
1305
1305
|
getFullUser(userId: InputPeerLike): Promise<FullUser>;
|
|
1306
1306
|
getMessageAuthor(message: InputMessageId): Promise<User>;
|
|
1307
|
-
/**
|
|
1308
|
-
* Get nearby chats
|
|
1309
|
-
*
|
|
1310
|
-
* **Available**: 👤 users only
|
|
1311
|
-
*
|
|
1312
|
-
* @param latitude Latitude of the location
|
|
1313
|
-
* @param longitude Longitude of the location
|
|
1314
|
-
*/
|
|
1315
|
-
getNearbyChats(latitude: number, longitude: number): Promise<Chat[]>;
|
|
1316
1307
|
/** Shorthand for {@link getChat} and {@link getUser} depending on the type of the peer */
|
|
1317
1308
|
getPeer(peer: InputPeerLike): Promise<Peer>;
|
|
1318
1309
|
/**
|
|
@@ -3165,7 +3156,7 @@ export interface TelegramClient extends ITelegramClient {
|
|
|
3165
3156
|
/**
|
|
3166
3157
|
* Edit message text, media, reply markup and schedule date.
|
|
3167
3158
|
*
|
|
3168
|
-
* **Available**:
|
|
3159
|
+
* **Available**: 👤 users only
|
|
3169
3160
|
*
|
|
3170
3161
|
* @param chatId ID of the chat, its username, phone or `"me"` or `"self"`
|
|
3171
3162
|
* @param message Message or its ID
|
|
@@ -3918,7 +3909,7 @@ export interface TelegramClient extends ITelegramClient {
|
|
|
3918
3909
|
* To add a caption to the group, add caption to the first
|
|
3919
3910
|
* media in the group and don't add caption for any other.
|
|
3920
3911
|
*
|
|
3921
|
-
* **Available**:
|
|
3912
|
+
* **Available**: 👤 users only
|
|
3922
3913
|
*
|
|
3923
3914
|
* @param chatId ID of the chat, its username, phone or `"me"` or `"self"`
|
|
3924
3915
|
* @param medias Medias contained in the message.
|
|
@@ -3947,7 +3938,7 @@ export interface TelegramClient extends ITelegramClient {
|
|
|
3947
3938
|
/**
|
|
3948
3939
|
* Send a single media (a photo or a document-based media)
|
|
3949
3940
|
*
|
|
3950
|
-
* **Available**:
|
|
3941
|
+
* **Available**: 👤 users only
|
|
3951
3942
|
*
|
|
3952
3943
|
* @param chatId ID of the chat, its username, phone or `"me"` or `"self"`
|
|
3953
3944
|
* @param media
|
|
@@ -4074,7 +4065,7 @@ export interface TelegramClient extends ITelegramClient {
|
|
|
4074
4065
|
/**
|
|
4075
4066
|
* Send a text message
|
|
4076
4067
|
*
|
|
4077
|
-
* **Available**:
|
|
4068
|
+
* **Available**: 👤 users only
|
|
4078
4069
|
*
|
|
4079
4070
|
* @param chatId ID of the chat, its username, phone or `"me"` or `"self"`
|
|
4080
4071
|
* @param text Text of the message
|
|
@@ -4108,7 +4099,7 @@ export interface TelegramClient extends ITelegramClient {
|
|
|
4108
4099
|
*
|
|
4109
4100
|
* If you need a continuous typing status, use {@link setTyping} instead.
|
|
4110
4101
|
*
|
|
4111
|
-
* **Available**:
|
|
4102
|
+
* **Available**: 👤 users only
|
|
4112
4103
|
*
|
|
4113
4104
|
* @param chatId Chat ID
|
|
4114
4105
|
* @param [status='typing'] Typing status
|
|
@@ -4647,13 +4638,13 @@ export interface TelegramClient extends ITelegramClient {
|
|
|
4647
4638
|
*/
|
|
4648
4639
|
deleteStickerFromSet(sticker: InputDocumentId): Promise<StickerSet>;
|
|
4649
4640
|
/**
|
|
4650
|
-
* Get custom emoji stickers by their IDs
|
|
4641
|
+
* Get custom emoji stickers by their IDs, or `null` if not available/found.
|
|
4651
4642
|
*
|
|
4652
4643
|
* **Available**: 👤 users only
|
|
4653
4644
|
*
|
|
4654
4645
|
* @param ids IDs of the stickers (as defined in {@link MessageEntity.emojiId})
|
|
4655
4646
|
*/
|
|
4656
|
-
getCustomEmojis(ids: tl.Long[]): Promise<Sticker[]>;
|
|
4647
|
+
getCustomEmojis(ids: tl.Long[]): Promise<(Sticker | null)[]>;
|
|
4657
4648
|
/**
|
|
4658
4649
|
* Given one or more messages, extract all unique custom emojis from it and fetch them
|
|
4659
4650
|
* **Available**: ✅ both users and bots
|
|
@@ -5205,7 +5196,7 @@ export interface TelegramClient extends ITelegramClient {
|
|
|
5205
5196
|
* @param photoId ID of the photo to fetch
|
|
5206
5197
|
* @param params
|
|
5207
5198
|
*/
|
|
5208
|
-
getProfilePhoto(userId: InputPeerLike, photoId: tl.Long): Promise<Photo>;
|
|
5199
|
+
getProfilePhoto(userId: InputPeerLike, photoId: tl.Long): Promise<Photo | null>;
|
|
5209
5200
|
/**
|
|
5210
5201
|
* Get a list of profile pictures of a user
|
|
5211
5202
|
*
|
package/highlevel/client.d.ts
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import { tl } from '@mtcute/tl';
|
|
2
1
|
import { default as Long } from 'long';
|
|
3
2
|
import { RpcCallOptions } from '../network/index.js';
|
|
3
|
+
import { tl } from '../tl/index.js';
|
|
4
4
|
import { MaybeArray, MaybePromise, PartialExcept, PartialOnly } from '../types/index.js';
|
|
5
5
|
import { BaseTelegramClientOptions } from './base.js';
|
|
6
6
|
import { ITelegramClient } from './client.types.js';
|
|
@@ -1304,15 +1304,6 @@ export interface TelegramClient extends ITelegramClient {
|
|
|
1304
1304
|
*/
|
|
1305
1305
|
getFullUser(userId: InputPeerLike): Promise<FullUser>;
|
|
1306
1306
|
getMessageAuthor(message: InputMessageId): Promise<User>;
|
|
1307
|
-
/**
|
|
1308
|
-
* Get nearby chats
|
|
1309
|
-
*
|
|
1310
|
-
* **Available**: 👤 users only
|
|
1311
|
-
*
|
|
1312
|
-
* @param latitude Latitude of the location
|
|
1313
|
-
* @param longitude Longitude of the location
|
|
1314
|
-
*/
|
|
1315
|
-
getNearbyChats(latitude: number, longitude: number): Promise<Chat[]>;
|
|
1316
1307
|
/** Shorthand for {@link getChat} and {@link getUser} depending on the type of the peer */
|
|
1317
1308
|
getPeer(peer: InputPeerLike): Promise<Peer>;
|
|
1318
1309
|
/**
|
|
@@ -3165,7 +3156,7 @@ export interface TelegramClient extends ITelegramClient {
|
|
|
3165
3156
|
/**
|
|
3166
3157
|
* Edit message text, media, reply markup and schedule date.
|
|
3167
3158
|
*
|
|
3168
|
-
* **Available**:
|
|
3159
|
+
* **Available**: 👤 users only
|
|
3169
3160
|
*
|
|
3170
3161
|
* @param chatId ID of the chat, its username, phone or `"me"` or `"self"`
|
|
3171
3162
|
* @param message Message or its ID
|
|
@@ -3918,7 +3909,7 @@ export interface TelegramClient extends ITelegramClient {
|
|
|
3918
3909
|
* To add a caption to the group, add caption to the first
|
|
3919
3910
|
* media in the group and don't add caption for any other.
|
|
3920
3911
|
*
|
|
3921
|
-
* **Available**:
|
|
3912
|
+
* **Available**: 👤 users only
|
|
3922
3913
|
*
|
|
3923
3914
|
* @param chatId ID of the chat, its username, phone or `"me"` or `"self"`
|
|
3924
3915
|
* @param medias Medias contained in the message.
|
|
@@ -3947,7 +3938,7 @@ export interface TelegramClient extends ITelegramClient {
|
|
|
3947
3938
|
/**
|
|
3948
3939
|
* Send a single media (a photo or a document-based media)
|
|
3949
3940
|
*
|
|
3950
|
-
* **Available**:
|
|
3941
|
+
* **Available**: 👤 users only
|
|
3951
3942
|
*
|
|
3952
3943
|
* @param chatId ID of the chat, its username, phone or `"me"` or `"self"`
|
|
3953
3944
|
* @param media
|
|
@@ -4074,7 +4065,7 @@ export interface TelegramClient extends ITelegramClient {
|
|
|
4074
4065
|
/**
|
|
4075
4066
|
* Send a text message
|
|
4076
4067
|
*
|
|
4077
|
-
* **Available**:
|
|
4068
|
+
* **Available**: 👤 users only
|
|
4078
4069
|
*
|
|
4079
4070
|
* @param chatId ID of the chat, its username, phone or `"me"` or `"self"`
|
|
4080
4071
|
* @param text Text of the message
|
|
@@ -4108,7 +4099,7 @@ export interface TelegramClient extends ITelegramClient {
|
|
|
4108
4099
|
*
|
|
4109
4100
|
* If you need a continuous typing status, use {@link setTyping} instead.
|
|
4110
4101
|
*
|
|
4111
|
-
* **Available**:
|
|
4102
|
+
* **Available**: 👤 users only
|
|
4112
4103
|
*
|
|
4113
4104
|
* @param chatId Chat ID
|
|
4114
4105
|
* @param [status='typing'] Typing status
|
|
@@ -4647,13 +4638,13 @@ export interface TelegramClient extends ITelegramClient {
|
|
|
4647
4638
|
*/
|
|
4648
4639
|
deleteStickerFromSet(sticker: InputDocumentId): Promise<StickerSet>;
|
|
4649
4640
|
/**
|
|
4650
|
-
* Get custom emoji stickers by their IDs
|
|
4641
|
+
* Get custom emoji stickers by their IDs, or `null` if not available/found.
|
|
4651
4642
|
*
|
|
4652
4643
|
* **Available**: 👤 users only
|
|
4653
4644
|
*
|
|
4654
4645
|
* @param ids IDs of the stickers (as defined in {@link MessageEntity.emojiId})
|
|
4655
4646
|
*/
|
|
4656
|
-
getCustomEmojis(ids: tl.Long[]): Promise<Sticker[]>;
|
|
4647
|
+
getCustomEmojis(ids: tl.Long[]): Promise<(Sticker | null)[]>;
|
|
4657
4648
|
/**
|
|
4658
4649
|
* Given one or more messages, extract all unique custom emojis from it and fetch them
|
|
4659
4650
|
* **Available**: ✅ both users and bots
|
|
@@ -5205,7 +5196,7 @@ export interface TelegramClient extends ITelegramClient {
|
|
|
5205
5196
|
* @param photoId ID of the photo to fetch
|
|
5206
5197
|
* @param params
|
|
5207
5198
|
*/
|
|
5208
|
-
getProfilePhoto(userId: InputPeerLike, photoId: tl.Long): Promise<Photo>;
|
|
5199
|
+
getProfilePhoto(userId: InputPeerLike, photoId: tl.Long): Promise<Photo | null>;
|
|
5209
5200
|
/**
|
|
5210
5201
|
* Get a list of profile pictures of a user
|
|
5211
5202
|
*
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { Emitter } from '@fuman/utils';
|
|
2
|
-
import { tl } from '@mtcute/tl';
|
|
3
2
|
import { default as Long } from 'long';
|
|
4
3
|
import { ConnectionKind, RpcCallOptions } from '../network/index.js';
|
|
4
|
+
import { tl } from '../tl/index.js';
|
|
5
5
|
import { ICorePlatform } from '../types/platform.js';
|
|
6
6
|
import { MustEqual, PublicPart } from '../types/utils.js';
|
|
7
7
|
import { Logger } from '../utils/logger.js';
|
|
@@ -31,7 +31,7 @@ export interface ITelegramClient {
|
|
|
31
31
|
/** App config manager */
|
|
32
32
|
readonly appConfig: PublicPart<AppConfigManager>;
|
|
33
33
|
/** Timers manager */
|
|
34
|
-
readonly timers: Pick<TimersManager, '
|
|
34
|
+
readonly timers: Pick<TimersManager, 'upsert' | 'cancel' | 'exists'>;
|
|
35
35
|
/** Signal that will be aborted when the client is destroyed */
|
|
36
36
|
readonly stopSignal: AbortSignal;
|
|
37
37
|
/** Platform used by the client */
|
|
@@ -62,6 +62,9 @@ export interface ITelegramClient {
|
|
|
62
62
|
*
|
|
63
63
|
* This will terminate any connections to the Telegram servers,
|
|
64
64
|
* free all the resources, and make the client no longer usable
|
|
65
|
+
*
|
|
66
|
+
* > **Note**: the above is not true for worker ports, which instead only closes the port connection itself.
|
|
67
|
+
* > To destroy the underlying client, use `unsafeForceDestroy()`.
|
|
65
68
|
*/
|
|
66
69
|
destroy(): Promise<void>;
|
|
67
70
|
/** Notify the client that the user has logged in */
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { Emitter } from '@fuman/utils';
|
|
2
|
-
import { tl } from '@mtcute/tl';
|
|
3
2
|
import { default as Long } from 'long';
|
|
4
3
|
import { ConnectionKind, RpcCallOptions } from '../network/index.js';
|
|
4
|
+
import { tl } from '../tl/index.js';
|
|
5
5
|
import { ICorePlatform } from '../types/platform.js';
|
|
6
6
|
import { MustEqual, PublicPart } from '../types/utils.js';
|
|
7
7
|
import { Logger } from '../utils/logger.js';
|
|
@@ -31,7 +31,7 @@ export interface ITelegramClient {
|
|
|
31
31
|
/** App config manager */
|
|
32
32
|
readonly appConfig: PublicPart<AppConfigManager>;
|
|
33
33
|
/** Timers manager */
|
|
34
|
-
readonly timers: Pick<TimersManager, '
|
|
34
|
+
readonly timers: Pick<TimersManager, 'upsert' | 'cancel' | 'exists'>;
|
|
35
35
|
/** Signal that will be aborted when the client is destroyed */
|
|
36
36
|
readonly stopSignal: AbortSignal;
|
|
37
37
|
/** Platform used by the client */
|
|
@@ -62,6 +62,9 @@ export interface ITelegramClient {
|
|
|
62
62
|
*
|
|
63
63
|
* This will terminate any connections to the Telegram servers,
|
|
64
64
|
* free all the resources, and make the client no longer usable
|
|
65
|
+
*
|
|
66
|
+
* > **Note**: the above is not true for worker ports, which instead only closes the port connection itself.
|
|
67
|
+
* > To destroy the underlying client, use `unsafeForceDestroy()`.
|
|
65
68
|
*/
|
|
66
69
|
destroy(): Promise<void>;
|
|
67
70
|
/** Notify the client that the user has logged in */
|
|
@@ -7,37 +7,57 @@ if (typeof globalThis !== "undefined" && !globalThis._MTCUTE_CJS_DEPRECATION_WAR
|
|
|
7
7
|
Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
|
|
8
8
|
const utils = require("@fuman/utils");
|
|
9
9
|
class TimersManager {
|
|
10
|
+
constructor(_executeRpc) {
|
|
11
|
+
this._executeRpc = _executeRpc;
|
|
12
|
+
}
|
|
10
13
|
_timers = /* @__PURE__ */ new Map();
|
|
11
14
|
_errorHandler;
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
exists(key) {
|
|
15
|
+
// These methods are async for API parity with worker-backed clients,
|
|
16
|
+
// where keepalive state is owned by the shared client/worker and accessed over RPC.
|
|
17
|
+
async exists(key) {
|
|
15
18
|
return this._timers.has(key);
|
|
16
19
|
}
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
+
async upsert(spec) {
|
|
21
|
+
this.upsertOwned("local", spec);
|
|
22
|
+
}
|
|
23
|
+
async cancel(key) {
|
|
24
|
+
this._cancel(key);
|
|
25
|
+
}
|
|
26
|
+
upsertOwned(ownerId, spec) {
|
|
27
|
+
this._cancel(spec.key);
|
|
28
|
+
const timer = new utils.AsyncInterval(
|
|
29
|
+
(abortSignal) => this._executeRpc(spec, abortSignal),
|
|
30
|
+
spec.interval
|
|
31
|
+
);
|
|
32
|
+
if (this._errorHandler) {
|
|
33
|
+
timer.onError(this._errorHandler);
|
|
20
34
|
}
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
35
|
+
this._timers.set(spec.key, {
|
|
36
|
+
ownerId,
|
|
37
|
+
timer
|
|
38
|
+
});
|
|
39
|
+
if (spec.startNow) timer.startNow();
|
|
25
40
|
else timer.start();
|
|
26
41
|
}
|
|
27
|
-
|
|
28
|
-
const timer
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
42
|
+
clearOwner(ownerId) {
|
|
43
|
+
for (const [key, timer] of Array.from(this._timers.entries())) {
|
|
44
|
+
if (timer.ownerId !== ownerId) continue;
|
|
45
|
+
this._cancel(key);
|
|
46
|
+
}
|
|
32
47
|
}
|
|
33
48
|
onError(handler) {
|
|
34
49
|
this._errorHandler = handler;
|
|
35
50
|
}
|
|
36
51
|
destroy() {
|
|
37
|
-
for (const
|
|
38
|
-
|
|
52
|
+
for (const key of Array.from(this._timers.keys())) {
|
|
53
|
+
this._cancel(key);
|
|
39
54
|
}
|
|
40
|
-
|
|
55
|
+
}
|
|
56
|
+
_cancel(key) {
|
|
57
|
+
const timer = this._timers.get(key);
|
|
58
|
+
if (!timer) return;
|
|
59
|
+
timer.timer.stop();
|
|
60
|
+
this._timers.delete(key);
|
|
41
61
|
}
|
|
42
62
|
}
|
|
43
63
|
exports.TimersManager = TimersManager;
|
|
@@ -1,10 +1,24 @@
|
|
|
1
|
+
import { RpcCallOptions } from '../../network/network-manager.js';
|
|
2
|
+
import { tl } from '../../tl/index.js';
|
|
3
|
+
export interface RpcTimerSpec {
|
|
4
|
+
kind: 'rpc';
|
|
5
|
+
key: string;
|
|
6
|
+
interval: number;
|
|
7
|
+
request: tl.RpcMethod;
|
|
8
|
+
options?: Omit<RpcCallOptions, 'abortSignal' | 'manager'>;
|
|
9
|
+
startNow?: boolean;
|
|
10
|
+
}
|
|
1
11
|
export declare class TimersManager {
|
|
12
|
+
private readonly _executeRpc;
|
|
2
13
|
private _timers;
|
|
3
14
|
private _errorHandler?;
|
|
4
|
-
constructor();
|
|
5
|
-
exists(key: string): boolean
|
|
6
|
-
|
|
7
|
-
cancel(key: string): void
|
|
15
|
+
constructor(_executeRpc: (spec: RpcTimerSpec, abortSignal: AbortSignal) => Promise<void>);
|
|
16
|
+
exists(key: string): Promise<boolean>;
|
|
17
|
+
upsert(spec: RpcTimerSpec): Promise<void>;
|
|
18
|
+
cancel(key: string): Promise<void>;
|
|
19
|
+
upsertOwned(ownerId: string, spec: RpcTimerSpec): void;
|
|
20
|
+
clearOwner(ownerId: string): void;
|
|
8
21
|
onError(handler: (err: unknown) => void): void;
|
|
9
22
|
destroy(): void;
|
|
23
|
+
private _cancel;
|
|
10
24
|
}
|
|
@@ -1,10 +1,24 @@
|
|
|
1
|
+
import { RpcCallOptions } from '../../network/network-manager.js';
|
|
2
|
+
import { tl } from '../../tl/index.js';
|
|
3
|
+
export interface RpcTimerSpec {
|
|
4
|
+
kind: 'rpc';
|
|
5
|
+
key: string;
|
|
6
|
+
interval: number;
|
|
7
|
+
request: tl.RpcMethod;
|
|
8
|
+
options?: Omit<RpcCallOptions, 'abortSignal' | 'manager'>;
|
|
9
|
+
startNow?: boolean;
|
|
10
|
+
}
|
|
1
11
|
export declare class TimersManager {
|
|
12
|
+
private readonly _executeRpc;
|
|
2
13
|
private _timers;
|
|
3
14
|
private _errorHandler?;
|
|
4
|
-
constructor();
|
|
5
|
-
exists(key: string): boolean
|
|
6
|
-
|
|
7
|
-
cancel(key: string): void
|
|
15
|
+
constructor(_executeRpc: (spec: RpcTimerSpec, abortSignal: AbortSignal) => Promise<void>);
|
|
16
|
+
exists(key: string): Promise<boolean>;
|
|
17
|
+
upsert(spec: RpcTimerSpec): Promise<void>;
|
|
18
|
+
cancel(key: string): Promise<void>;
|
|
19
|
+
upsertOwned(ownerId: string, spec: RpcTimerSpec): void;
|
|
20
|
+
clearOwner(ownerId: string): void;
|
|
8
21
|
onError(handler: (err: unknown) => void): void;
|
|
9
22
|
destroy(): void;
|
|
23
|
+
private _cancel;
|
|
10
24
|
}
|
|
@@ -1,36 +1,56 @@
|
|
|
1
1
|
import { AsyncInterval } from "@fuman/utils";
|
|
2
2
|
class TimersManager {
|
|
3
|
+
constructor(_executeRpc) {
|
|
4
|
+
this._executeRpc = _executeRpc;
|
|
5
|
+
}
|
|
3
6
|
_timers = /* @__PURE__ */ new Map();
|
|
4
7
|
_errorHandler;
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
exists(key) {
|
|
8
|
+
// These methods are async for API parity with worker-backed clients,
|
|
9
|
+
// where keepalive state is owned by the shared client/worker and accessed over RPC.
|
|
10
|
+
async exists(key) {
|
|
8
11
|
return this._timers.has(key);
|
|
9
12
|
}
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
+
async upsert(spec) {
|
|
14
|
+
this.upsertOwned("local", spec);
|
|
15
|
+
}
|
|
16
|
+
async cancel(key) {
|
|
17
|
+
this._cancel(key);
|
|
18
|
+
}
|
|
19
|
+
upsertOwned(ownerId, spec) {
|
|
20
|
+
this._cancel(spec.key);
|
|
21
|
+
const timer = new AsyncInterval(
|
|
22
|
+
(abortSignal) => this._executeRpc(spec, abortSignal),
|
|
23
|
+
spec.interval
|
|
24
|
+
);
|
|
25
|
+
if (this._errorHandler) {
|
|
26
|
+
timer.onError(this._errorHandler);
|
|
13
27
|
}
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
28
|
+
this._timers.set(spec.key, {
|
|
29
|
+
ownerId,
|
|
30
|
+
timer
|
|
31
|
+
});
|
|
32
|
+
if (spec.startNow) timer.startNow();
|
|
18
33
|
else timer.start();
|
|
19
34
|
}
|
|
20
|
-
|
|
21
|
-
const timer
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
35
|
+
clearOwner(ownerId) {
|
|
36
|
+
for (const [key, timer] of Array.from(this._timers.entries())) {
|
|
37
|
+
if (timer.ownerId !== ownerId) continue;
|
|
38
|
+
this._cancel(key);
|
|
39
|
+
}
|
|
25
40
|
}
|
|
26
41
|
onError(handler) {
|
|
27
42
|
this._errorHandler = handler;
|
|
28
43
|
}
|
|
29
44
|
destroy() {
|
|
30
|
-
for (const
|
|
31
|
-
|
|
45
|
+
for (const key of Array.from(this._timers.keys())) {
|
|
46
|
+
this._cancel(key);
|
|
32
47
|
}
|
|
33
|
-
|
|
48
|
+
}
|
|
49
|
+
_cancel(key) {
|
|
50
|
+
const timer = this._timers.get(key);
|
|
51
|
+
if (!timer) return;
|
|
52
|
+
timer.timer.stop();
|
|
53
|
+
this._timers.delete(key);
|
|
34
54
|
}
|
|
35
55
|
}
|
|
36
56
|
export {
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|