@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/network/client.d.cts
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import { ReconnectionStrategy } from '@fuman/net';
|
|
2
|
-
import { mtp, tl } from '@mtcute/tl';
|
|
3
2
|
import { TlReaderMap, TlWriterMap } from '@mtcute/tl-runtime';
|
|
4
3
|
import { IMtStorageProvider } from '../storage/provider.js';
|
|
5
4
|
import { StorageManagerExtraOptions, StorageManager } from '../storage/storage.js';
|
|
5
|
+
import { mtp, tl } from '../tl/index.js';
|
|
6
6
|
import { MustEqual } from '../types/index.js';
|
|
7
7
|
import { ICorePlatform } from '../types/platform.js';
|
|
8
8
|
import { DcOptions, ICryptoProvider, Logger } from '../utils/index.js';
|
|
@@ -85,17 +85,6 @@ export interface MtClientOptions {
|
|
|
85
85
|
* @default false
|
|
86
86
|
*/
|
|
87
87
|
disableUpdates?: boolean;
|
|
88
|
-
/**
|
|
89
|
-
* mtcute can send all unknown RPC errors to [danog](https://github.com/danog)'s
|
|
90
|
-
* [error reporting service](https://report-rpc-error.madelineproto.xyz/).
|
|
91
|
-
*
|
|
92
|
-
* This is fully anonymous (except maybe IP) and is only used to improve the library
|
|
93
|
-
* and developer experience for everyone working with MTProto. This is fully opt-in,
|
|
94
|
-
* and if you're too paranoid, you can disable it by manually passing `enableErrorReporting: false` to the client.
|
|
95
|
-
*
|
|
96
|
-
* @default false
|
|
97
|
-
*/
|
|
98
|
-
enableErrorReporting?: boolean;
|
|
99
88
|
/**
|
|
100
89
|
* Extra parameters for {@link NetworkManager}
|
|
101
90
|
*/
|
package/network/client.d.ts
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import { ReconnectionStrategy } from '@fuman/net';
|
|
2
|
-
import { mtp, tl } from '@mtcute/tl';
|
|
3
2
|
import { TlReaderMap, TlWriterMap } from '@mtcute/tl-runtime';
|
|
4
3
|
import { IMtStorageProvider } from '../storage/provider.js';
|
|
5
4
|
import { StorageManagerExtraOptions, StorageManager } from '../storage/storage.js';
|
|
5
|
+
import { mtp, tl } from '../tl/index.js';
|
|
6
6
|
import { MustEqual } from '../types/index.js';
|
|
7
7
|
import { ICorePlatform } from '../types/platform.js';
|
|
8
8
|
import { DcOptions, ICryptoProvider, Logger } from '../utils/index.js';
|
|
@@ -85,17 +85,6 @@ export interface MtClientOptions {
|
|
|
85
85
|
* @default false
|
|
86
86
|
*/
|
|
87
87
|
disableUpdates?: boolean;
|
|
88
|
-
/**
|
|
89
|
-
* mtcute can send all unknown RPC errors to [danog](https://github.com/danog)'s
|
|
90
|
-
* [error reporting service](https://report-rpc-error.madelineproto.xyz/).
|
|
91
|
-
*
|
|
92
|
-
* This is fully anonymous (except maybe IP) and is only used to improve the library
|
|
93
|
-
* and developer experience for everyone working with MTProto. This is fully opt-in,
|
|
94
|
-
* and if you're too paranoid, you can disable it by manually passing `enableErrorReporting: false` to the client.
|
|
95
|
-
*
|
|
96
|
-
* @default false
|
|
97
|
-
*/
|
|
98
|
-
enableErrorReporting?: boolean;
|
|
99
88
|
/**
|
|
100
89
|
* Extra parameters for {@link NetworkManager}
|
|
101
90
|
*/
|
package/network/client.js
CHANGED
|
@@ -1,8 +1,7 @@
|
|
|
1
1
|
import { Emitter } from "@fuman/utils";
|
|
2
|
-
import { tl } from "@mtcute/tl";
|
|
3
|
-
import { __tlReaderMap } from "@mtcute/tl/binary/reader.js";
|
|
4
|
-
import { __tlWriterMap } from "@mtcute/tl/binary/writer.js";
|
|
5
2
|
import { StorageManager } from "../storage/storage.js";
|
|
3
|
+
import { __tlReaderMap } from "../tl/binary/reader.js";
|
|
4
|
+
import { __tlWriterMap } from "../tl/binary/writer.js";
|
|
6
5
|
import { defaultTestIpv6Dc, defaultTestDc, defaultProductionIpv6Dc, defaultProductionDc } from "../utils/dcs.js";
|
|
7
6
|
import { asyncResettable } from "../utils/function-utils.js";
|
|
8
7
|
import { LogManager } from "../utils/logger.js";
|
|
@@ -10,6 +9,7 @@ import { isTlRpcError } from "../utils/type-assertions.js";
|
|
|
10
9
|
import "@mtcute/tl-runtime";
|
|
11
10
|
import { ConfigManager } from "./config-manager.js";
|
|
12
11
|
import { NetworkManager } from "./network-manager.js";
|
|
12
|
+
import { LAYER } from "../tl/inner-tl.js";
|
|
13
13
|
class MtClient {
|
|
14
14
|
constructor(params) {
|
|
15
15
|
this.params = params;
|
|
@@ -28,7 +28,7 @@ class MtClient {
|
|
|
28
28
|
}
|
|
29
29
|
}
|
|
30
30
|
this._defaultDcs = dc;
|
|
31
|
-
this._layer = params.overrideLayer ??
|
|
31
|
+
this._layer = params.overrideLayer ?? LAYER;
|
|
32
32
|
this._readerMap = params.readerMap ?? __tlReaderMap;
|
|
33
33
|
this._writerMap = params.writerMap ?? __tlWriterMap;
|
|
34
34
|
this._abortController = new AbortController();
|
|
@@ -58,7 +58,6 @@ class MtClient {
|
|
|
58
58
|
emitError: params.onError,
|
|
59
59
|
isPremium: false,
|
|
60
60
|
useIpv6: Boolean(params.useIpv6),
|
|
61
|
-
enableErrorReporting: params.enableErrorReporting ?? false,
|
|
62
61
|
onUsable: this.onUsable.emit.bind(this.onUsable),
|
|
63
62
|
onConnecting: this.onConnecting.emit.bind(this.onConnecting),
|
|
64
63
|
onNetworkChanged: this.onNetworkChanged.emit.bind(this.onNetworkChanged),
|
|
@@ -5,19 +5,19 @@ if (typeof globalThis !== "undefined" && !globalThis._MTCUTE_CJS_DEPRECATION_WAR
|
|
|
5
5
|
}
|
|
6
6
|
"use strict";
|
|
7
7
|
Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
|
|
8
|
-
const tl = require("@mtcute/tl");
|
|
9
8
|
const errors = require("../../types/errors.cjs");
|
|
10
9
|
const abortSignal = require("../../utils/abort-signal.cjs");
|
|
11
10
|
const miscUtils = require("../../utils/misc-utils.cjs");
|
|
12
11
|
const typeAssertions = require("../../utils/type-assertions.cjs");
|
|
12
|
+
const innerTl = require("../../tl/inner-tl.cjs");
|
|
13
13
|
const CLIENT_ERRORS = /* @__PURE__ */ new Set([
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
14
|
+
innerTl.RpcError.BAD_REQUEST,
|
|
15
|
+
innerTl.RpcError.UNAUTHORIZED,
|
|
16
|
+
innerTl.RpcError.FORBIDDEN,
|
|
17
|
+
innerTl.RpcError.NOT_FOUND,
|
|
18
|
+
innerTl.RpcError.FLOOD,
|
|
19
|
+
innerTl.RpcError.SEE_OTHER,
|
|
20
|
+
innerTl.RpcError.NOT_ACCEPTABLE
|
|
21
21
|
]);
|
|
22
22
|
const PTS_ERRORS = /* @__PURE__ */ new Set([
|
|
23
23
|
"PERSISTENT_TIMESTAMP_INVALID",
|
|
@@ -1,16 +1,16 @@
|
|
|
1
|
-
import { tl } from "@mtcute/tl";
|
|
2
1
|
import { MtTimeoutError } from "../../types/errors.js";
|
|
3
2
|
import { combineAbortSignals } from "../../utils/abort-signal.js";
|
|
4
3
|
import { sleepWithAbort } from "../../utils/misc-utils.js";
|
|
5
4
|
import { isTlRpcError } from "../../utils/type-assertions.js";
|
|
5
|
+
import { RpcError } from "../../tl/inner-tl.js";
|
|
6
6
|
const CLIENT_ERRORS = /* @__PURE__ */ new Set([
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
7
|
+
RpcError.BAD_REQUEST,
|
|
8
|
+
RpcError.UNAUTHORIZED,
|
|
9
|
+
RpcError.FORBIDDEN,
|
|
10
|
+
RpcError.NOT_FOUND,
|
|
11
|
+
RpcError.FLOOD,
|
|
12
|
+
RpcError.SEE_OTHER,
|
|
13
|
+
RpcError.NOT_ACCEPTABLE
|
|
14
14
|
]);
|
|
15
15
|
const PTS_ERRORS = /* @__PURE__ */ new Set([
|
|
16
16
|
"PERSISTENT_TIMESTAMP_INVALID",
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { Middleware } from '@fuman/utils';
|
|
2
|
-
import { tl } from '
|
|
2
|
+
import { tl } from '../../tl/index.js';
|
|
3
3
|
import { RpcCallMiddleware, RpcCallMiddlewareContext } from '../network-manager.js';
|
|
4
4
|
/**
|
|
5
5
|
* Middleware that will call `handler` whenever `method` RPC method is called.
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { Middleware } from '@fuman/utils';
|
|
2
|
-
import { tl } from '
|
|
2
|
+
import { tl } from '../../tl/index.js';
|
|
3
3
|
import { RpcCallMiddleware, RpcCallMiddlewareContext } from '../network-manager.js';
|
|
4
4
|
/**
|
|
5
5
|
* Middleware that will call `handler` whenever `method` RPC method is called.
|
|
@@ -11,8 +11,6 @@ const Long = require("long");
|
|
|
11
11
|
const longUtils = require("../utils/long-utils.cjs");
|
|
12
12
|
const miscUtils = require("../utils/misc-utils.cjs");
|
|
13
13
|
const sortedArray = require("../utils/sorted-array.cjs");
|
|
14
|
-
require("@mtcute/tl/binary/reader.js");
|
|
15
|
-
require("@mtcute/tl/binary/writer.js");
|
|
16
14
|
const authKey = require("./auth-key.cjs");
|
|
17
15
|
const errors = require("../types/errors.cjs");
|
|
18
16
|
class MtprotoSession {
|
|
@@ -56,7 +54,6 @@ class MtprotoSession {
|
|
|
56
54
|
chainsPendingFails = /* @__PURE__ */ new Map();
|
|
57
55
|
// requests info
|
|
58
56
|
pendingMessages = new longUtils.LongMap();
|
|
59
|
-
destroySessionIdToMsgId = new longUtils.LongMap();
|
|
60
57
|
lastPingRtt = Number.NaN;
|
|
61
58
|
lastPingTime = 0;
|
|
62
59
|
lastPingMsgId = Long.ZERO;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { Deferred, Deque, LruMap, LruSet, timers } from '@fuman/utils';
|
|
2
|
-
import { mtp, tl } from '@mtcute/tl';
|
|
3
2
|
import { TlBinaryWriter, TlReaderMap, TlWriterMap } from '@mtcute/tl-runtime';
|
|
3
|
+
import { mtp, tl } from '../tl/index.js';
|
|
4
4
|
import { ICryptoProvider, Logger, LongMap, SortedArray } from '../utils/index.js';
|
|
5
5
|
import { ServerSaltManager } from './server-salt.js';
|
|
6
6
|
import { default as Long } from 'long';
|
|
@@ -88,7 +88,6 @@ export declare class MtprotoSession {
|
|
|
88
88
|
chains: Map<string | number, Long>;
|
|
89
89
|
chainsPendingFails: Map<string | number, SortedArray<PendingRpc>>;
|
|
90
90
|
pendingMessages: LongMap<PendingMessage>;
|
|
91
|
-
destroySessionIdToMsgId: LongMap<Long>;
|
|
92
91
|
lastPingRtt: number;
|
|
93
92
|
lastPingTime: number;
|
|
94
93
|
lastPingMsgId: Long;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { Deferred, Deque, LruMap, LruSet, timers } from '@fuman/utils';
|
|
2
|
-
import { mtp, tl } from '@mtcute/tl';
|
|
3
2
|
import { TlBinaryWriter, TlReaderMap, TlWriterMap } from '@mtcute/tl-runtime';
|
|
3
|
+
import { mtp, tl } from '../tl/index.js';
|
|
4
4
|
import { ICryptoProvider, Logger, LongMap, SortedArray } from '../utils/index.js';
|
|
5
5
|
import { ServerSaltManager } from './server-salt.js';
|
|
6
6
|
import { default as Long } from 'long';
|
|
@@ -88,7 +88,6 @@ export declare class MtprotoSession {
|
|
|
88
88
|
chains: Map<string | number, Long>;
|
|
89
89
|
chainsPendingFails: Map<string | number, SortedArray<PendingRpc>>;
|
|
90
90
|
pendingMessages: LongMap<PendingMessage>;
|
|
91
|
-
destroySessionIdToMsgId: LongMap<Long>;
|
|
92
91
|
lastPingRtt: number;
|
|
93
92
|
lastPingTime: number;
|
|
94
93
|
lastPingMsgId: Long;
|
|
@@ -4,8 +4,6 @@ import Long from "long";
|
|
|
4
4
|
import { randomLong, LongSet, LongMap, compareLongs } from "../utils/long-utils.js";
|
|
5
5
|
import { getRandomInt } from "../utils/misc-utils.js";
|
|
6
6
|
import { SortedArray } from "../utils/sorted-array.js";
|
|
7
|
-
import "@mtcute/tl/binary/reader.js";
|
|
8
|
-
import "@mtcute/tl/binary/writer.js";
|
|
9
7
|
import { AuthKey } from "./auth-key.js";
|
|
10
8
|
import { MtcuteError } from "../types/errors.js";
|
|
11
9
|
class MtprotoSession {
|
|
@@ -49,7 +47,6 @@ class MtprotoSession {
|
|
|
49
47
|
chainsPendingFails = /* @__PURE__ */ new Map();
|
|
50
48
|
// requests info
|
|
51
49
|
pendingMessages = new LongMap();
|
|
52
|
-
destroySessionIdToMsgId = new LongMap();
|
|
53
50
|
lastPingRtt = Number.NaN;
|
|
54
51
|
lastPingTime = 0;
|
|
55
52
|
lastPingMsgId = Long.ZERO;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { ITcpConnection, TcpEndpoint } from '@fuman/net';
|
|
2
|
-
import { tl } from '
|
|
2
|
+
import { tl } from '../../tl/index.js';
|
|
3
3
|
import { BasicDcOption, ICryptoProvider, Logger } from '../../utils/index.js';
|
|
4
4
|
import { IPacketCodec, ITelegramConnection, TelegramTransport } from '../transports/index.js';
|
|
5
5
|
/**
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { ITcpConnection, TcpEndpoint } from '@fuman/net';
|
|
2
|
-
import { tl } from '
|
|
2
|
+
import { tl } from '../../tl/index.js';
|
|
3
3
|
import { BasicDcOption, ICryptoProvider, Logger } from '../../utils/index.js';
|
|
4
4
|
import { IPacketCodec, ITelegramConnection, TelegramTransport } from '../transports/index.js';
|
|
5
5
|
/**
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { mtp, tl } from '
|
|
1
|
+
import { mtp, tl } from '../tl/index.js';
|
|
2
2
|
import { Logger } from '../utils/index.js';
|
|
3
3
|
import { SessionConnectionParams, SessionConnection } from './session-connection.js';
|
|
4
4
|
import { TelegramTransport } from './transports/index.js';
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { mtp, tl } from '
|
|
1
|
+
import { mtp, tl } from '../tl/index.js';
|
|
2
2
|
import { Logger } from '../utils/index.js';
|
|
3
3
|
import { SessionConnectionParams, SessionConnection } from './session-connection.js';
|
|
4
4
|
import { TelegramTransport } from './transports/index.js';
|
|
@@ -48,7 +48,6 @@ class DcConnectionManager {
|
|
|
48
48
|
isMainConnection: false,
|
|
49
49
|
isMainDcConnection: this.isPrimary,
|
|
50
50
|
inactivityTimeout: managerParams.inactivityTimeout ?? 6e4,
|
|
51
|
-
enableErrorReporting: managerParams.enableErrorReporting,
|
|
52
51
|
// NB: we need a separate salts manager for each pfs connection, because server salts are auth_key-bound
|
|
53
52
|
salts: managerParams.usePfs ? new serverSalt.ServerSaltManager() : this._salts,
|
|
54
53
|
platform: managerParams.platform,
|
|
@@ -225,7 +224,7 @@ class NetworkManager {
|
|
|
225
224
|
_: "initConnection",
|
|
226
225
|
deviceModel,
|
|
227
226
|
systemVersion: "1.0",
|
|
228
|
-
appVersion: "0.
|
|
227
|
+
appVersion: "0.29.0",
|
|
229
228
|
systemLangCode: "en",
|
|
230
229
|
langPack: "",
|
|
231
230
|
// "langPacks are for official apps only"
|
|
@@ -388,6 +387,7 @@ class NetworkManager {
|
|
|
388
387
|
}
|
|
389
388
|
}
|
|
390
389
|
notifyLoggedIn(auth) {
|
|
390
|
+
this._businessConnectionDcs.clear();
|
|
391
391
|
if (auth._ === "auth.authorizationSignUpRequired") {
|
|
392
392
|
throw new errors.MtUnsupportedError(
|
|
393
393
|
"Signup is no longer supported by Telegram for non-official clients. Please use your mobile device to sign up."
|
|
@@ -412,6 +412,7 @@ class NetworkManager {
|
|
|
412
412
|
return user;
|
|
413
413
|
}
|
|
414
414
|
notifyLoggedOut() {
|
|
415
|
+
this._businessConnectionDcs.clear();
|
|
415
416
|
this.setIsPremium(false);
|
|
416
417
|
this.resetSessions();
|
|
417
418
|
}
|
|
@@ -448,6 +449,28 @@ class NetworkManager {
|
|
|
448
449
|
await this._switchPrimaryDc(this._dcConnections.get(newDc));
|
|
449
450
|
}
|
|
450
451
|
call;
|
|
452
|
+
_businessConnectionDcs = new utils.LruMap(50);
|
|
453
|
+
async _getBusinessConnectionDcId(connectionId, abortSignal) {
|
|
454
|
+
if (this._businessConnectionDcs.has(connectionId)) {
|
|
455
|
+
return this._businessConnectionDcs.get(connectionId);
|
|
456
|
+
}
|
|
457
|
+
const res = await this.call({
|
|
458
|
+
_: "account.getBotBusinessConnection",
|
|
459
|
+
connectionId
|
|
460
|
+
}, { abortSignal });
|
|
461
|
+
if (typeAssertions.isTlRpcError(res)) {
|
|
462
|
+
throw new errors.MtcuteError(`Failed to fetch business connection (${res.errorCode}: ${res.errorMessage})`);
|
|
463
|
+
}
|
|
464
|
+
if (!("updates" in res) || !Array.isArray(res.updates)) {
|
|
465
|
+
throw new errors.MtArgumentError("account.getBotBusinessConnection returned invalid updates");
|
|
466
|
+
}
|
|
467
|
+
const update = res.updates.find((it) => it._ === "updateBotBusinessConnect");
|
|
468
|
+
if (!update) {
|
|
469
|
+
throw new errors.MtArgumentError("account.getBotBusinessConnection did not return updateBotBusinessConnect");
|
|
470
|
+
}
|
|
471
|
+
this._businessConnectionDcs.set(connectionId, update.connection.dcId);
|
|
472
|
+
return update.connection.dcId;
|
|
473
|
+
}
|
|
451
474
|
_composeCall = (middlewares) => {
|
|
452
475
|
if (!middlewares) {
|
|
453
476
|
middlewares = _default.basic();
|
|
@@ -473,6 +496,18 @@ class NetworkManager {
|
|
|
473
496
|
throw new errors.MtcuteError("Not connected to any DC");
|
|
474
497
|
}
|
|
475
498
|
}
|
|
499
|
+
const businessConnectionId = params?.businessConnectionId;
|
|
500
|
+
if (businessConnectionId) {
|
|
501
|
+
const dcId = await this._getBusinessConnectionDcId(businessConnectionId, params?.abortSignal);
|
|
502
|
+
params.dcId = dcId;
|
|
503
|
+
params.manager = void 0;
|
|
504
|
+
params.localMigrate = true;
|
|
505
|
+
message = {
|
|
506
|
+
_: "invokeWithBusinessConnection",
|
|
507
|
+
connectionId: businessConnectionId,
|
|
508
|
+
query: message
|
|
509
|
+
};
|
|
510
|
+
}
|
|
476
511
|
const kind = params?.kind ?? "main";
|
|
477
512
|
let manager;
|
|
478
513
|
if (params?.manager) {
|
|
@@ -497,6 +532,9 @@ class NetworkManager {
|
|
|
497
532
|
}
|
|
498
533
|
if (params?.localMigrate) {
|
|
499
534
|
manager = await this._getOtherDc(newDc);
|
|
535
|
+
if (businessConnectionId) {
|
|
536
|
+
this._businessConnectionDcs.set(businessConnectionId, newDc);
|
|
537
|
+
}
|
|
500
538
|
} else {
|
|
501
539
|
this._log.info("received %s, migrating to dc %d", err, newDc);
|
|
502
540
|
await this.changePrimaryDc(newDc);
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
import { ReconnectionStrategy } from '@fuman/net';
|
|
2
2
|
import { Middleware, Deferred } from '@fuman/utils';
|
|
3
|
-
import { mtp, tl } from '@mtcute/tl';
|
|
4
3
|
import { TlReaderMap, TlWriterMap } from '@mtcute/tl-runtime';
|
|
5
4
|
import { default as Long } from 'long';
|
|
6
5
|
import { StorageManager } from '../storage/storage.js';
|
|
6
|
+
import { mtp, tl } from '../tl/index.js';
|
|
7
7
|
import { ICorePlatform } from '../types/platform.js';
|
|
8
8
|
import { DcOptions, ICryptoProvider, Logger } from '../utils/index.js';
|
|
9
9
|
import { ConfigManager } from './config-manager.js';
|
|
@@ -19,7 +19,6 @@ export interface NetworkManagerParams {
|
|
|
19
19
|
crypto: ICryptoProvider;
|
|
20
20
|
log: Logger;
|
|
21
21
|
platform: ICorePlatform;
|
|
22
|
-
enableErrorReporting: boolean;
|
|
23
22
|
apiId: number;
|
|
24
23
|
initConnectionOptions?: Partial<Omit<tl.RawInitConnectionRequest, 'apiId' | 'query'>>;
|
|
25
24
|
transport: TelegramTransport;
|
|
@@ -128,7 +127,7 @@ export interface RpcCallOptions {
|
|
|
128
127
|
* **ADVANCED**
|
|
129
128
|
*
|
|
130
129
|
* DC connection manager to use for this call.
|
|
131
|
-
* Overrides `dcId` if set.
|
|
130
|
+
* Overrides `dcId` if set, unless `businessConnectionId` is passed.
|
|
132
131
|
*/
|
|
133
132
|
manager?: DcConnectionManager;
|
|
134
133
|
/**
|
|
@@ -153,6 +152,14 @@ export interface RpcCallOptions {
|
|
|
153
152
|
* that is in fact not related to the user, but to the specific request.
|
|
154
153
|
*/
|
|
155
154
|
localMigrate?: boolean;
|
|
155
|
+
/**
|
|
156
|
+
* Business connection on behalf of which this call should be made.
|
|
157
|
+
*
|
|
158
|
+
* This wraps the request with `invokeWithBusinessConnection`,
|
|
159
|
+
* resolves the correct DC automatically, and overrides `dcId`,
|
|
160
|
+
* `manager` and `localMigrate`.
|
|
161
|
+
*/
|
|
162
|
+
businessConnectionId?: string;
|
|
156
163
|
/**
|
|
157
164
|
* Some requests should be processed consecutively, and not in parallel.
|
|
158
165
|
* Using the same `chainId` for multiple requests will ensure that they are processed in the order
|
|
@@ -245,6 +252,8 @@ export declare class NetworkManager {
|
|
|
245
252
|
private _onConfigChanged;
|
|
246
253
|
changePrimaryDc(newDc: number): Promise<void>;
|
|
247
254
|
readonly call: <T extends tl.RpcMethod>(message: T, params?: RpcCallOptions) => Promise<tl.RpcCallReturn[T['_']] | mtp.RawMt_rpc_error>;
|
|
255
|
+
private _businessConnectionDcs;
|
|
256
|
+
private _getBusinessConnectionDcId;
|
|
248
257
|
private _composeCall;
|
|
249
258
|
private _call;
|
|
250
259
|
changeTransport(transport: TelegramTransport): Promise<void>;
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
import { ReconnectionStrategy } from '@fuman/net';
|
|
2
2
|
import { Middleware, Deferred } from '@fuman/utils';
|
|
3
|
-
import { mtp, tl } from '@mtcute/tl';
|
|
4
3
|
import { TlReaderMap, TlWriterMap } from '@mtcute/tl-runtime';
|
|
5
4
|
import { default as Long } from 'long';
|
|
6
5
|
import { StorageManager } from '../storage/storage.js';
|
|
6
|
+
import { mtp, tl } from '../tl/index.js';
|
|
7
7
|
import { ICorePlatform } from '../types/platform.js';
|
|
8
8
|
import { DcOptions, ICryptoProvider, Logger } from '../utils/index.js';
|
|
9
9
|
import { ConfigManager } from './config-manager.js';
|
|
@@ -19,7 +19,6 @@ export interface NetworkManagerParams {
|
|
|
19
19
|
crypto: ICryptoProvider;
|
|
20
20
|
log: Logger;
|
|
21
21
|
platform: ICorePlatform;
|
|
22
|
-
enableErrorReporting: boolean;
|
|
23
22
|
apiId: number;
|
|
24
23
|
initConnectionOptions?: Partial<Omit<tl.RawInitConnectionRequest, 'apiId' | 'query'>>;
|
|
25
24
|
transport: TelegramTransport;
|
|
@@ -128,7 +127,7 @@ export interface RpcCallOptions {
|
|
|
128
127
|
* **ADVANCED**
|
|
129
128
|
*
|
|
130
129
|
* DC connection manager to use for this call.
|
|
131
|
-
* Overrides `dcId` if set.
|
|
130
|
+
* Overrides `dcId` if set, unless `businessConnectionId` is passed.
|
|
132
131
|
*/
|
|
133
132
|
manager?: DcConnectionManager;
|
|
134
133
|
/**
|
|
@@ -153,6 +152,14 @@ export interface RpcCallOptions {
|
|
|
153
152
|
* that is in fact not related to the user, but to the specific request.
|
|
154
153
|
*/
|
|
155
154
|
localMigrate?: boolean;
|
|
155
|
+
/**
|
|
156
|
+
* Business connection on behalf of which this call should be made.
|
|
157
|
+
*
|
|
158
|
+
* This wraps the request with `invokeWithBusinessConnection`,
|
|
159
|
+
* resolves the correct DC automatically, and overrides `dcId`,
|
|
160
|
+
* `manager` and `localMigrate`.
|
|
161
|
+
*/
|
|
162
|
+
businessConnectionId?: string;
|
|
156
163
|
/**
|
|
157
164
|
* Some requests should be processed consecutively, and not in parallel.
|
|
158
165
|
* Using the same `chainId` for multiple requests will ensure that they are processed in the order
|
|
@@ -245,6 +252,8 @@ export declare class NetworkManager {
|
|
|
245
252
|
private _onConfigChanged;
|
|
246
253
|
changePrimaryDc(newDc: number): Promise<void>;
|
|
247
254
|
readonly call: <T extends tl.RpcMethod>(message: T, params?: RpcCallOptions) => Promise<tl.RpcCallReturn[T['_']] | mtp.RawMt_rpc_error>;
|
|
255
|
+
private _businessConnectionDcs;
|
|
256
|
+
private _getBusinessConnectionDcId;
|
|
248
257
|
private _composeCall;
|
|
249
258
|
private _call;
|
|
250
259
|
changeTransport(transport: TelegramTransport): Promise<void>;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { defaultReconnectionStrategy } from "@fuman/net";
|
|
2
|
-
import { asNonNull, Deferred, composeMiddlewares } from "@fuman/utils";
|
|
2
|
+
import { asNonNull, Deferred, LruMap, composeMiddlewares } from "@fuman/utils";
|
|
3
3
|
import { isTlRpcError, assertTypeIs } from "../utils/type-assertions.js";
|
|
4
4
|
import { basic } from "./middlewares/default.js";
|
|
5
5
|
import { MultiSessionConnection } from "./multi-session-connection.js";
|
|
@@ -41,7 +41,6 @@ class DcConnectionManager {
|
|
|
41
41
|
isMainConnection: false,
|
|
42
42
|
isMainDcConnection: this.isPrimary,
|
|
43
43
|
inactivityTimeout: managerParams.inactivityTimeout ?? 6e4,
|
|
44
|
-
enableErrorReporting: managerParams.enableErrorReporting,
|
|
45
44
|
// NB: we need a separate salts manager for each pfs connection, because server salts are auth_key-bound
|
|
46
45
|
salts: managerParams.usePfs ? new ServerSaltManager() : this._salts,
|
|
47
46
|
platform: managerParams.platform,
|
|
@@ -218,7 +217,7 @@ class NetworkManager {
|
|
|
218
217
|
_: "initConnection",
|
|
219
218
|
deviceModel,
|
|
220
219
|
systemVersion: "1.0",
|
|
221
|
-
appVersion: "0.
|
|
220
|
+
appVersion: "0.29.0",
|
|
222
221
|
systemLangCode: "en",
|
|
223
222
|
langPack: "",
|
|
224
223
|
// "langPacks are for official apps only"
|
|
@@ -381,6 +380,7 @@ class NetworkManager {
|
|
|
381
380
|
}
|
|
382
381
|
}
|
|
383
382
|
notifyLoggedIn(auth) {
|
|
383
|
+
this._businessConnectionDcs.clear();
|
|
384
384
|
if (auth._ === "auth.authorizationSignUpRequired") {
|
|
385
385
|
throw new MtUnsupportedError(
|
|
386
386
|
"Signup is no longer supported by Telegram for non-official clients. Please use your mobile device to sign up."
|
|
@@ -405,6 +405,7 @@ class NetworkManager {
|
|
|
405
405
|
return user;
|
|
406
406
|
}
|
|
407
407
|
notifyLoggedOut() {
|
|
408
|
+
this._businessConnectionDcs.clear();
|
|
408
409
|
this.setIsPremium(false);
|
|
409
410
|
this.resetSessions();
|
|
410
411
|
}
|
|
@@ -441,6 +442,28 @@ class NetworkManager {
|
|
|
441
442
|
await this._switchPrimaryDc(this._dcConnections.get(newDc));
|
|
442
443
|
}
|
|
443
444
|
call;
|
|
445
|
+
_businessConnectionDcs = new LruMap(50);
|
|
446
|
+
async _getBusinessConnectionDcId(connectionId, abortSignal) {
|
|
447
|
+
if (this._businessConnectionDcs.has(connectionId)) {
|
|
448
|
+
return this._businessConnectionDcs.get(connectionId);
|
|
449
|
+
}
|
|
450
|
+
const res = await this.call({
|
|
451
|
+
_: "account.getBotBusinessConnection",
|
|
452
|
+
connectionId
|
|
453
|
+
}, { abortSignal });
|
|
454
|
+
if (isTlRpcError(res)) {
|
|
455
|
+
throw new MtcuteError(`Failed to fetch business connection (${res.errorCode}: ${res.errorMessage})`);
|
|
456
|
+
}
|
|
457
|
+
if (!("updates" in res) || !Array.isArray(res.updates)) {
|
|
458
|
+
throw new MtArgumentError("account.getBotBusinessConnection returned invalid updates");
|
|
459
|
+
}
|
|
460
|
+
const update = res.updates.find((it) => it._ === "updateBotBusinessConnect");
|
|
461
|
+
if (!update) {
|
|
462
|
+
throw new MtArgumentError("account.getBotBusinessConnection did not return updateBotBusinessConnect");
|
|
463
|
+
}
|
|
464
|
+
this._businessConnectionDcs.set(connectionId, update.connection.dcId);
|
|
465
|
+
return update.connection.dcId;
|
|
466
|
+
}
|
|
444
467
|
_composeCall = (middlewares) => {
|
|
445
468
|
if (!middlewares) {
|
|
446
469
|
middlewares = basic();
|
|
@@ -466,6 +489,18 @@ class NetworkManager {
|
|
|
466
489
|
throw new MtcuteError("Not connected to any DC");
|
|
467
490
|
}
|
|
468
491
|
}
|
|
492
|
+
const businessConnectionId = params?.businessConnectionId;
|
|
493
|
+
if (businessConnectionId) {
|
|
494
|
+
const dcId = await this._getBusinessConnectionDcId(businessConnectionId, params?.abortSignal);
|
|
495
|
+
params.dcId = dcId;
|
|
496
|
+
params.manager = void 0;
|
|
497
|
+
params.localMigrate = true;
|
|
498
|
+
message = {
|
|
499
|
+
_: "invokeWithBusinessConnection",
|
|
500
|
+
connectionId: businessConnectionId,
|
|
501
|
+
query: message
|
|
502
|
+
};
|
|
503
|
+
}
|
|
469
504
|
const kind = params?.kind ?? "main";
|
|
470
505
|
let manager;
|
|
471
506
|
if (params?.manager) {
|
|
@@ -490,6 +525,9 @@ class NetworkManager {
|
|
|
490
525
|
}
|
|
491
526
|
if (params?.localMigrate) {
|
|
492
527
|
manager = await this._getOtherDc(newDc);
|
|
528
|
+
if (businessConnectionId) {
|
|
529
|
+
this._businessConnectionDcs.set(businessConnectionId, newDc);
|
|
530
|
+
}
|
|
493
531
|
} else {
|
|
494
532
|
this._log.info("received %s, migrating to dc %d", err, newDc);
|
|
495
533
|
await this.changePrimaryDc(newDc);
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { ReconnectionStrategy } from '@fuman/net';
|
|
2
|
-
import { tl } from '
|
|
2
|
+
import { tl } from '../tl/index.js';
|
|
3
3
|
import { BasicDcOption, ICryptoProvider, Logger } from '../utils/index.js';
|
|
4
4
|
import { TelegramTransport } from './transports/abstract.js';
|
|
5
5
|
import { Emitter } from '@fuman/utils';
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { ReconnectionStrategy } from '@fuman/net';
|
|
2
|
-
import { tl } from '
|
|
2
|
+
import { tl } from '../tl/index.js';
|
|
3
3
|
import { BasicDcOption, ICryptoProvider, Logger } from '../utils/index.js';
|
|
4
4
|
import { TelegramTransport } from './transports/abstract.js';
|
|
5
5
|
import { Emitter } from '@fuman/utils';
|
package/network/server-salt.d.ts
CHANGED