@mtcute/core 0.28.2 → 0.29.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/client.cjs +0 -4
- package/client.js +0 -4
- package/highlevel/base.cjs +11 -11
- package/highlevel/base.d.cts +1 -1
- package/highlevel/base.d.ts +1 -1
- package/highlevel/base.js +11 -11
- 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 +2 -2
- package/highlevel/types/peers/peer.d.ts +2 -2
- 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 +25 -4
- package/highlevel/utils/peer-utils.d.cts +2 -2
- package/highlevel/utils/peer-utils.d.ts +2 -2
- package/highlevel/utils/peer-utils.js +25 -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 +9 -9
- package/network/client.d.cts +1 -12
- package/network/client.d.ts +1 -12
- package/network/client.js +7 -7
- 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 +43 -3
- package/network/network-manager.d.cts +12 -3
- package/network/network-manager.d.ts +12 -3
- package/network/network-manager.js +44 -4
- 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/misc-utils.cjs +8 -0
- package/utils/misc-utils.d.cts +2 -0
- package/utils/misc-utils.d.ts +2 -0
- package/utils/misc-utils.js +8 -0
- 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 +5 -18
- package/utils.js +4 -11
- 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
|
@@ -1,29 +1,76 @@
|
|
|
1
1
|
import { serializeError } from "./errors.js";
|
|
2
|
-
import { DEFAULT_WORKER_ID,
|
|
2
|
+
import { DEFAULT_WORKER_ID, deserializeResult, serializeResult } from "./protocol.js";
|
|
3
|
+
const WORKER_HEARTBEAT_TIMEOUT = 6e4;
|
|
4
|
+
const WORKER_HEARTBEAT_SWEEP_INTERVAL = 1e4;
|
|
3
5
|
class TelegramWorker {
|
|
4
6
|
constructor(params) {
|
|
5
7
|
this.params = params;
|
|
6
8
|
this.workerId = params.workerId ?? DEFAULT_WORKER_ID;
|
|
9
|
+
this.client = params.client;
|
|
10
|
+
}
|
|
11
|
+
client;
|
|
12
|
+
broadcast = () => {
|
|
13
|
+
};
|
|
14
|
+
_cleanup = [];
|
|
15
|
+
_heartbeatSweep;
|
|
16
|
+
_mounted = false;
|
|
17
|
+
activeConnections = /* @__PURE__ */ new Set();
|
|
18
|
+
connectionLastSeen = /* @__PURE__ */ new Map();
|
|
19
|
+
pendingAborts = /* @__PURE__ */ new Map();
|
|
20
|
+
workerId;
|
|
21
|
+
_disconnecting;
|
|
22
|
+
_destroying;
|
|
23
|
+
mount() {
|
|
24
|
+
if (this._mounted) return this;
|
|
7
25
|
const [broadcast, cleanup] = this.registerWorker((message, respond) => {
|
|
8
26
|
if (message._mtcuteWorkerId !== this.workerId) return;
|
|
9
27
|
switch (message.type) {
|
|
28
|
+
case "connect":
|
|
29
|
+
this.touchConnection(message.connectionId, true);
|
|
30
|
+
break;
|
|
31
|
+
case "heartbeat":
|
|
32
|
+
if (!this.activeConnections.has(message.connectionId)) {
|
|
33
|
+
this.respondConnectionExpired(respond, message.connectionId);
|
|
34
|
+
break;
|
|
35
|
+
}
|
|
36
|
+
this.touchConnection(message.connectionId);
|
|
37
|
+
break;
|
|
38
|
+
case "release":
|
|
39
|
+
this.onRelease(message.connectionId);
|
|
40
|
+
break;
|
|
10
41
|
case "invoke":
|
|
42
|
+
if (!this.activeConnections.has(message.connectionId)) {
|
|
43
|
+
this.respondConnectionExpired(respond, message.connectionId);
|
|
44
|
+
break;
|
|
45
|
+
}
|
|
46
|
+
this.touchConnection(message.connectionId);
|
|
11
47
|
this.onInvoke(message, respond);
|
|
12
48
|
break;
|
|
13
49
|
case "abort": {
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
this.pendingAborts.delete(message.id);
|
|
50
|
+
if (!this.activeConnections.has(message.connectionId)) {
|
|
51
|
+
this.respondConnectionExpired(respond, message.connectionId);
|
|
52
|
+
break;
|
|
18
53
|
}
|
|
54
|
+
this.touchConnection(message.connectionId);
|
|
55
|
+
const pending = this.pendingAborts.get(message.connectionId);
|
|
56
|
+
const abort = pending?.get(message.id);
|
|
57
|
+
if (!abort) break;
|
|
58
|
+
abort.abort();
|
|
59
|
+
pending.delete(message.id);
|
|
60
|
+
if (!pending.size) {
|
|
61
|
+
this.pendingAborts.delete(message.connectionId);
|
|
62
|
+
}
|
|
63
|
+
break;
|
|
19
64
|
}
|
|
20
65
|
}
|
|
21
66
|
});
|
|
22
67
|
this.broadcast = broadcast;
|
|
23
|
-
this._cleanup
|
|
24
|
-
|
|
25
|
-
this.
|
|
26
|
-
client
|
|
68
|
+
this._cleanup.push(cleanup);
|
|
69
|
+
this._heartbeatSweep = setInterval(this.sweepExpiredConnections, WORKER_HEARTBEAT_SWEEP_INTERVAL);
|
|
70
|
+
this._mounted = true;
|
|
71
|
+
const client = this.client;
|
|
72
|
+
const prevLogHandler = client.log.mgr.handler;
|
|
73
|
+
const onLog = (color, level, tag, fmt, args) => this.broadcast({
|
|
27
74
|
_mtcuteWorkerId: this.workerId,
|
|
28
75
|
type: "log",
|
|
29
76
|
color,
|
|
@@ -32,56 +79,201 @@ class TelegramWorker {
|
|
|
32
79
|
fmt,
|
|
33
80
|
args
|
|
34
81
|
});
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
state
|
|
47
|
-
})
|
|
48
|
-
);
|
|
49
|
-
client.stopSignal.addEventListener("abort", () => this.broadcast({
|
|
82
|
+
const onError = (err) => this.broadcast({
|
|
83
|
+
_mtcuteWorkerId: this.workerId,
|
|
84
|
+
type: "error",
|
|
85
|
+
error: serializeError(err)
|
|
86
|
+
});
|
|
87
|
+
const onConnectionState = (state) => this.broadcast({
|
|
88
|
+
_mtcuteWorkerId: this.workerId,
|
|
89
|
+
type: "conn_state",
|
|
90
|
+
state
|
|
91
|
+
});
|
|
92
|
+
const onStop = () => this.broadcast({
|
|
50
93
|
_mtcuteWorkerId: this.workerId,
|
|
51
94
|
type: "stop"
|
|
52
|
-
})
|
|
95
|
+
});
|
|
96
|
+
client.log.mgr.handler = onLog;
|
|
97
|
+
client.onError.add(onError);
|
|
98
|
+
client.onConnectionState.add(onConnectionState);
|
|
99
|
+
client.stopSignal.addEventListener("abort", onStop);
|
|
100
|
+
this._cleanup.push(
|
|
101
|
+
() => {
|
|
102
|
+
client.log.mgr.handler = prevLogHandler;
|
|
103
|
+
},
|
|
104
|
+
() => client.onError.remove(onError),
|
|
105
|
+
() => client.onConnectionState.remove(onConnectionState),
|
|
106
|
+
() => client.stopSignal.removeEventListener("abort", onStop)
|
|
107
|
+
);
|
|
53
108
|
if (client.updates) {
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
);
|
|
109
|
+
const onRawUpdate = ({ update, peers }) => this.broadcast({
|
|
110
|
+
_mtcuteWorkerId: this.workerId,
|
|
111
|
+
type: "update",
|
|
112
|
+
update: serializeResult(update),
|
|
113
|
+
users: serializeResult(peers.users),
|
|
114
|
+
chats: serializeResult(peers.chats),
|
|
115
|
+
hasMin: peers.hasMin
|
|
116
|
+
});
|
|
117
|
+
client.onRawUpdate.add(onRawUpdate);
|
|
118
|
+
this._cleanup.push(() => client.onRawUpdate.remove(onRawUpdate));
|
|
64
119
|
} else {
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
);
|
|
120
|
+
const onServerUpdate = (update) => this.broadcast({
|
|
121
|
+
_mtcuteWorkerId: this.workerId,
|
|
122
|
+
type: "server_update",
|
|
123
|
+
update: serializeResult(update)
|
|
124
|
+
});
|
|
125
|
+
client.onServerUpdate.add(onServerUpdate);
|
|
126
|
+
this._cleanup.push(() => client.onServerUpdate.remove(onServerUpdate));
|
|
72
127
|
}
|
|
128
|
+
return this;
|
|
129
|
+
}
|
|
130
|
+
getConnectionAborts(connectionId) {
|
|
131
|
+
const existing = this.pendingAborts.get(connectionId);
|
|
132
|
+
if (existing) return existing;
|
|
133
|
+
const created = /* @__PURE__ */ new Map();
|
|
134
|
+
this.pendingAborts.set(connectionId, created);
|
|
135
|
+
return created;
|
|
136
|
+
}
|
|
137
|
+
deletePendingAbort(connectionId, id) {
|
|
138
|
+
const pending = this.pendingAborts.get(connectionId);
|
|
139
|
+
if (!pending) return;
|
|
140
|
+
pending.delete(id);
|
|
141
|
+
if (!pending.size) {
|
|
142
|
+
this.pendingAborts.delete(connectionId);
|
|
143
|
+
}
|
|
144
|
+
}
|
|
145
|
+
touchConnection(connectionId, activate = false) {
|
|
146
|
+
if (activate) {
|
|
147
|
+
this.activeConnections.add(connectionId);
|
|
148
|
+
} else if (!this.activeConnections.has(connectionId)) {
|
|
149
|
+
return;
|
|
150
|
+
}
|
|
151
|
+
this.connectionLastSeen.set(connectionId, Date.now());
|
|
152
|
+
}
|
|
153
|
+
respondConnectionExpired(respond, connectionId) {
|
|
154
|
+
respond({
|
|
155
|
+
_mtcuteWorkerId: this.workerId,
|
|
156
|
+
connectionId,
|
|
157
|
+
type: "connection_expired"
|
|
158
|
+
});
|
|
159
|
+
}
|
|
160
|
+
sweepExpiredConnections = () => {
|
|
161
|
+
const now = Date.now();
|
|
162
|
+
for (const [connectionId, lastSeen] of this.connectionLastSeen) {
|
|
163
|
+
if (now - lastSeen < WORKER_HEARTBEAT_TIMEOUT) continue;
|
|
164
|
+
this.respondConnectionExpired(this.broadcast, connectionId);
|
|
165
|
+
this.onRelease(connectionId);
|
|
166
|
+
}
|
|
167
|
+
};
|
|
168
|
+
onRelease(connectionId) {
|
|
169
|
+
const wasActive = this.activeConnections.delete(connectionId);
|
|
170
|
+
const hadLastSeen = this.connectionLastSeen.delete(connectionId);
|
|
171
|
+
this.client.timers.clearOwner(connectionId);
|
|
172
|
+
const pending = this.pendingAborts.get(connectionId);
|
|
173
|
+
if (pending) {
|
|
174
|
+
for (const abort of pending.values()) {
|
|
175
|
+
abort.abort();
|
|
176
|
+
}
|
|
177
|
+
this.pendingAborts.delete(connectionId);
|
|
178
|
+
}
|
|
179
|
+
if (!wasActive && !hadLastSeen && !pending) return;
|
|
180
|
+
if (this.activeConnections.size !== 0) return;
|
|
181
|
+
switch (this.params.onLastDisconnected ?? "nothing") {
|
|
182
|
+
case "nothing":
|
|
183
|
+
return;
|
|
184
|
+
case "disconnect":
|
|
185
|
+
if (this._disconnecting || this._destroying) return;
|
|
186
|
+
void this.disconnectSharedClient().catch(() => {
|
|
187
|
+
});
|
|
188
|
+
return;
|
|
189
|
+
case "destroy":
|
|
190
|
+
if (this._destroying) return;
|
|
191
|
+
void this.forceDestroy().catch(() => {
|
|
192
|
+
});
|
|
193
|
+
}
|
|
194
|
+
}
|
|
195
|
+
disconnectSharedClient() {
|
|
196
|
+
if (this._destroying) return this._destroying;
|
|
197
|
+
if (this._disconnecting) return this._disconnecting;
|
|
198
|
+
this._disconnecting = this.client.disconnect().finally(() => {
|
|
199
|
+
this._disconnecting = void 0;
|
|
200
|
+
});
|
|
201
|
+
return this._disconnecting;
|
|
202
|
+
}
|
|
203
|
+
forceDestroy() {
|
|
204
|
+
this.activeConnections.clear();
|
|
205
|
+
this.connectionLastSeen.clear();
|
|
206
|
+
for (const pending of this.pendingAborts.values()) {
|
|
207
|
+
for (const abort of pending.values()) {
|
|
208
|
+
abort.abort();
|
|
209
|
+
}
|
|
210
|
+
}
|
|
211
|
+
this.pendingAborts.clear();
|
|
212
|
+
if (!this._destroying) {
|
|
213
|
+
this._destroying = (this._disconnecting ?? Promise.resolve()).catch(() => {
|
|
214
|
+
}).then(() => this.client.destroy());
|
|
215
|
+
}
|
|
216
|
+
return this._destroying;
|
|
217
|
+
}
|
|
218
|
+
shouldSyncCurrentUser(msg) {
|
|
219
|
+
if (msg.target === "storage-self") {
|
|
220
|
+
return msg.method === "store" || msg.method === "storeFrom" || msg.method === "update";
|
|
221
|
+
}
|
|
222
|
+
return msg.target === "client" && (msg.method === "notifyLoggedIn" || msg.method === "notifyLoggedOut" || msg.method === "importSession");
|
|
73
223
|
}
|
|
74
|
-
client;
|
|
75
|
-
broadcast;
|
|
76
|
-
_cleanup;
|
|
77
|
-
pendingAborts = /* @__PURE__ */ new Map();
|
|
78
|
-
workerId;
|
|
79
224
|
onInvoke(msg, respond) {
|
|
225
|
+
if (msg.target === "client" && msg.method === "destroy") {
|
|
226
|
+
this.forceDestroy().then(() => {
|
|
227
|
+
if (msg.void) return;
|
|
228
|
+
respond({
|
|
229
|
+
_mtcuteWorkerId: this.workerId,
|
|
230
|
+
connectionId: msg.connectionId,
|
|
231
|
+
type: "result",
|
|
232
|
+
id: msg.id
|
|
233
|
+
});
|
|
234
|
+
}).catch((err) => {
|
|
235
|
+
respond({
|
|
236
|
+
_mtcuteWorkerId: this.workerId,
|
|
237
|
+
connectionId: msg.connectionId,
|
|
238
|
+
type: "result",
|
|
239
|
+
id: msg.id,
|
|
240
|
+
error: serializeError(err)
|
|
241
|
+
});
|
|
242
|
+
});
|
|
243
|
+
return;
|
|
244
|
+
}
|
|
245
|
+
if (msg.target === "client" && msg.method === "disconnect") {
|
|
246
|
+
this.disconnectSharedClient().then(() => {
|
|
247
|
+
if (msg.void) return;
|
|
248
|
+
respond({
|
|
249
|
+
_mtcuteWorkerId: this.workerId,
|
|
250
|
+
connectionId: msg.connectionId,
|
|
251
|
+
type: "result",
|
|
252
|
+
id: msg.id
|
|
253
|
+
});
|
|
254
|
+
}).catch((err) => {
|
|
255
|
+
respond({
|
|
256
|
+
_mtcuteWorkerId: this.workerId,
|
|
257
|
+
connectionId: msg.connectionId,
|
|
258
|
+
type: "result",
|
|
259
|
+
id: msg.id,
|
|
260
|
+
error: serializeError(err)
|
|
261
|
+
});
|
|
262
|
+
});
|
|
263
|
+
return;
|
|
264
|
+
}
|
|
80
265
|
let target;
|
|
81
266
|
switch (msg.target) {
|
|
82
267
|
case "custom":
|
|
83
268
|
target = this.params.customMethods;
|
|
84
269
|
break;
|
|
270
|
+
case "timers":
|
|
271
|
+
target = {
|
|
272
|
+
upsert: (spec) => Promise.resolve(this.client.timers.upsertOwned(msg.connectionId, spec)),
|
|
273
|
+
cancel: (key) => this.client.timers.cancel(key),
|
|
274
|
+
exists: (key) => this.client.timers.exists(key)
|
|
275
|
+
};
|
|
276
|
+
break;
|
|
85
277
|
case "client":
|
|
86
278
|
target = this.client;
|
|
87
279
|
break;
|
|
@@ -100,9 +292,10 @@ class TelegramWorker {
|
|
|
100
292
|
default: {
|
|
101
293
|
respond({
|
|
102
294
|
_mtcuteWorkerId: this.workerId,
|
|
295
|
+
connectionId: msg.connectionId,
|
|
103
296
|
type: "result",
|
|
104
297
|
id: msg.id,
|
|
105
|
-
error: new Error(`Unknown target ${msg.target}`)
|
|
298
|
+
error: serializeError(new Error(`Unknown target ${msg.target}`))
|
|
106
299
|
});
|
|
107
300
|
return;
|
|
108
301
|
}
|
|
@@ -111,16 +304,17 @@ class TelegramWorker {
|
|
|
111
304
|
if (!method) {
|
|
112
305
|
respond({
|
|
113
306
|
_mtcuteWorkerId: this.workerId,
|
|
307
|
+
connectionId: msg.connectionId,
|
|
114
308
|
type: "result",
|
|
115
309
|
id: msg.id,
|
|
116
|
-
error: new Error(`Method ${msg.method} not found on ${msg.target}`)
|
|
310
|
+
error: serializeError(new Error(`Method ${msg.method} not found on ${msg.target}`))
|
|
117
311
|
});
|
|
118
312
|
return;
|
|
119
313
|
}
|
|
120
314
|
let args;
|
|
121
315
|
if (msg.target === "client" && msg.method === "call" && msg.withAbort) {
|
|
122
316
|
const abort = new AbortController();
|
|
123
|
-
this.
|
|
317
|
+
this.getConnectionAborts(msg.connectionId).set(msg.id, abort);
|
|
124
318
|
args = [
|
|
125
319
|
deserializeResult(msg.args[0]),
|
|
126
320
|
{
|
|
@@ -131,23 +325,36 @@ class TelegramWorker {
|
|
|
131
325
|
} else {
|
|
132
326
|
args = deserializeResult(msg.args);
|
|
133
327
|
}
|
|
134
|
-
|
|
328
|
+
const syncCurrentUser = this.shouldSyncCurrentUser(msg);
|
|
329
|
+
Promise.resolve(method.apply(target, args)).then(async (res) => {
|
|
135
330
|
if (msg.withAbort) {
|
|
136
|
-
this.
|
|
331
|
+
this.deletePendingAbort(msg.connectionId, msg.id);
|
|
332
|
+
}
|
|
333
|
+
if (syncCurrentUser) {
|
|
334
|
+
try {
|
|
335
|
+
this.broadcast({
|
|
336
|
+
_mtcuteWorkerId: this.workerId,
|
|
337
|
+
type: "self_sync",
|
|
338
|
+
self: serializeResult(await this.client.storage.self.fetch())
|
|
339
|
+
});
|
|
340
|
+
} catch {
|
|
341
|
+
}
|
|
137
342
|
}
|
|
138
343
|
if (msg.void) return;
|
|
139
344
|
respond({
|
|
140
345
|
_mtcuteWorkerId: this.workerId,
|
|
346
|
+
connectionId: msg.connectionId,
|
|
141
347
|
type: "result",
|
|
142
348
|
id: msg.id,
|
|
143
349
|
result: serializeResult(res)
|
|
144
350
|
});
|
|
145
351
|
}).catch((err) => {
|
|
146
352
|
if (msg.withAbort) {
|
|
147
|
-
this.
|
|
353
|
+
this.deletePendingAbort(msg.connectionId, msg.id);
|
|
148
354
|
}
|
|
149
355
|
respond({
|
|
150
356
|
_mtcuteWorkerId: this.workerId,
|
|
357
|
+
connectionId: msg.connectionId,
|
|
151
358
|
type: "result",
|
|
152
359
|
id: msg.id,
|
|
153
360
|
error: serializeError(err)
|
|
@@ -155,7 +362,13 @@ class TelegramWorker {
|
|
|
155
362
|
});
|
|
156
363
|
}
|
|
157
364
|
destroy() {
|
|
158
|
-
this.
|
|
365
|
+
if (this._heartbeatSweep !== void 0) {
|
|
366
|
+
clearInterval(this._heartbeatSweep);
|
|
367
|
+
}
|
|
368
|
+
for (const cleanup of this._cleanup) {
|
|
369
|
+
cleanup();
|
|
370
|
+
}
|
|
371
|
+
this._mounted = false;
|
|
159
372
|
}
|
|
160
373
|
}
|
|
161
374
|
export {
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
package/index.cjs
CHANGED
|
@@ -7,7 +7,8 @@ if (typeof globalThis !== "undefined" && !globalThis._MTCUTE_CJS_DEPRECATION_WAR
|
|
|
7
7
|
Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
|
|
8
8
|
const Long = require("long");
|
|
9
9
|
const peerUtils = require("./utils/peer-utils.cjs");
|
|
10
|
-
const
|
|
10
|
+
const innerMtp = require("./tl/inner-mtp.cjs");
|
|
11
|
+
const innerTl = require("./tl/inner-tl.cjs");
|
|
11
12
|
const storage = require("./highlevel/storage/storage.cjs");
|
|
12
13
|
const sentCode = require("./highlevel/types/auth/sent-code.cjs");
|
|
13
14
|
const inner = require("./highlevel/types/bots/command-scope/inner.cjs");
|
|
@@ -69,7 +70,6 @@ const actions = require("./highlevel/types/peers/chat-event/actions.cjs");
|
|
|
69
70
|
const index = require("./highlevel/types/peers/chat-event/index.cjs");
|
|
70
71
|
const chatInviteLinkMember = require("./highlevel/types/peers/chat-invite-link-member.cjs");
|
|
71
72
|
const chatInviteLink = require("./highlevel/types/peers/chat-invite-link.cjs");
|
|
72
|
-
const chatLocation = require("./highlevel/types/peers/chat-location.cjs");
|
|
73
73
|
const chatMember = require("./highlevel/types/peers/chat-member.cjs");
|
|
74
74
|
const chatPermissions = require("./highlevel/types/peers/chat-permissions.cjs");
|
|
75
75
|
const chatPhoto = require("./highlevel/types/peers/chat-photo.cjs");
|
|
@@ -165,14 +165,8 @@ exports.getBasicPeerType = peerUtils.getBasicPeerType;
|
|
|
165
165
|
exports.getMarkedPeerId = peerUtils.getMarkedPeerId;
|
|
166
166
|
exports.parseMarkedPeerId = peerUtils.parseMarkedPeerId;
|
|
167
167
|
exports.toggleChannelIdMark = peerUtils.toggleChannelIdMark;
|
|
168
|
-
|
|
169
|
-
|
|
170
|
-
get: () => tl.mtp
|
|
171
|
-
});
|
|
172
|
-
Object.defineProperty(exports, "tl", {
|
|
173
|
-
enumerable: true,
|
|
174
|
-
get: () => tl.tl
|
|
175
|
-
});
|
|
168
|
+
exports.mtp = innerMtp;
|
|
169
|
+
exports.tl = innerTl;
|
|
176
170
|
exports.TelegramStorageManager = storage.TelegramStorageManager;
|
|
177
171
|
exports.SentCode = sentCode.SentCode;
|
|
178
172
|
exports.BotCommands = inner;
|
|
@@ -245,7 +239,6 @@ exports._actionFromTl = actions._actionFromTl;
|
|
|
245
239
|
exports.ChatEvent = index.ChatEvent;
|
|
246
240
|
exports.ChatInviteLinkMember = chatInviteLinkMember.ChatInviteLinkMember;
|
|
247
241
|
exports.ChatInviteLink = chatInviteLink.ChatInviteLink;
|
|
248
|
-
exports.ChatLocation = chatLocation.ChatLocation;
|
|
249
242
|
exports.ChatMember = chatMember.ChatMember;
|
|
250
243
|
exports.ChatPermissions = chatPermissions.ChatPermissions;
|
|
251
244
|
exports.ChatPhoto = chatPhoto.ChatPhoto;
|
package/index.d.cts
CHANGED
|
@@ -2,9 +2,9 @@ import { default as Long } from 'long';
|
|
|
2
2
|
export * from './highlevel/index.js';
|
|
3
3
|
export * from './network/index.js';
|
|
4
4
|
export * from './storage/index.js';
|
|
5
|
+
/** @hidden */
|
|
6
|
+
export { mtp, tl } from './tl/index.js';
|
|
5
7
|
export * from './types/index.js';
|
|
6
8
|
export * from './utils/peer-utils.js';
|
|
7
9
|
/** @hidden */
|
|
8
|
-
export { mtp, tl } from '@mtcute/tl';
|
|
9
|
-
/** @hidden */
|
|
10
10
|
export { Long };
|
package/index.d.ts
CHANGED
|
@@ -2,9 +2,9 @@ import { default as Long } from 'long';
|
|
|
2
2
|
export * from './highlevel/index.js';
|
|
3
3
|
export * from './network/index.js';
|
|
4
4
|
export * from './storage/index.js';
|
|
5
|
+
/** @hidden */
|
|
6
|
+
export { mtp, tl } from './tl/index.js';
|
|
5
7
|
export * from './types/index.js';
|
|
6
8
|
export * from './utils/peer-utils.js';
|
|
7
9
|
/** @hidden */
|
|
8
|
-
export { mtp, tl } from '@mtcute/tl';
|
|
9
|
-
/** @hidden */
|
|
10
10
|
export { Long };
|
package/index.js
CHANGED
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import { default as default2 } from "long";
|
|
2
2
|
import { getAllPeersFrom, getBarePeerId, getBasicPeerType, getMarkedPeerId, parseMarkedPeerId, toggleChannelIdMark } from "./utils/peer-utils.js";
|
|
3
|
-
import
|
|
3
|
+
import * as innerMtp from "./tl/inner-mtp.js";
|
|
4
|
+
import * as innerTl from "./tl/inner-tl.js";
|
|
4
5
|
import { TelegramStorageManager } from "./highlevel/storage/storage.js";
|
|
5
6
|
import { SentCode } from "./highlevel/types/auth/sent-code.js";
|
|
6
7
|
import * as inner from "./highlevel/types/bots/command-scope/inner.js";
|
|
@@ -62,7 +63,6 @@ import { _actionFromTl } from "./highlevel/types/peers/chat-event/actions.js";
|
|
|
62
63
|
import { ChatEvent } from "./highlevel/types/peers/chat-event/index.js";
|
|
63
64
|
import { ChatInviteLinkMember } from "./highlevel/types/peers/chat-invite-link-member.js";
|
|
64
65
|
import { ChatInviteLink } from "./highlevel/types/peers/chat-invite-link.js";
|
|
65
|
-
import { ChatLocation } from "./highlevel/types/peers/chat-location.js";
|
|
66
66
|
import { ChatMember } from "./highlevel/types/peers/chat-member.js";
|
|
67
67
|
import { ChatPermissions } from "./highlevel/types/peers/chat-permissions.js";
|
|
68
68
|
import { ChatPhoto, ChatPhotoSize } from "./highlevel/types/peers/chat-photo.js";
|
|
@@ -187,7 +187,6 @@ export {
|
|
|
187
187
|
ChatInviteLink,
|
|
188
188
|
ChatInviteLinkMember,
|
|
189
189
|
ChatJoinRequestUpdate,
|
|
190
|
-
ChatLocation,
|
|
191
190
|
ChatMember,
|
|
192
191
|
ChatMemberUpdate,
|
|
193
192
|
ChatPermissions,
|
|
@@ -331,14 +330,14 @@ export {
|
|
|
331
330
|
getMarkedPeerId,
|
|
332
331
|
inputTextToTl,
|
|
333
332
|
isUploadedFile,
|
|
334
|
-
mtp,
|
|
333
|
+
innerMtp as mtp,
|
|
335
334
|
bundle$1 as networkMiddlewares,
|
|
336
335
|
normalizeInputMessageId,
|
|
337
336
|
normalizeInputReaction,
|
|
338
337
|
normalizeInputStickerSet,
|
|
339
338
|
parseMarkedPeerId,
|
|
340
339
|
parsePeer,
|
|
341
|
-
tl,
|
|
340
|
+
innerTl as tl,
|
|
342
341
|
toReactionEmoji,
|
|
343
342
|
toggleChannelIdMark
|
|
344
343
|
};
|
package/methods.cjs
CHANGED
|
@@ -58,7 +58,6 @@ const getCreatorAfterLeave = require("./highlevel/methods/chats/get-creator-afte
|
|
|
58
58
|
const getFullChat = require("./highlevel/methods/chats/get-full-chat.cjs");
|
|
59
59
|
const getFullUser = require("./highlevel/methods/chats/get-full-user.cjs");
|
|
60
60
|
const getMessageAuthor = require("./highlevel/methods/chats/get-message-author.cjs");
|
|
61
|
-
const getNearbyChats = require("./highlevel/methods/chats/get-nearby-chats.cjs");
|
|
62
61
|
const getPeer = require("./highlevel/methods/chats/get-peer.cjs");
|
|
63
62
|
const getPeers = require("./highlevel/methods/chats/get-peers.cjs");
|
|
64
63
|
const getSimilarChannels = require("./highlevel/methods/chats/get-similar-channels.cjs");
|
|
@@ -342,7 +341,6 @@ exports.getCreatorAfterLeave = getCreatorAfterLeave.getCreatorAfterLeave;
|
|
|
342
341
|
exports.getFullChat = getFullChat.getFullChat;
|
|
343
342
|
exports.getFullUser = getFullUser.getFullUser;
|
|
344
343
|
exports.getMessageAuthor = getMessageAuthor.getMessageAuthor;
|
|
345
|
-
exports.getNearbyChats = getNearbyChats.getNearbyChats;
|
|
346
344
|
exports.getPeer = getPeer.getPeer;
|
|
347
345
|
exports.getPeers = getPeers.getPeers;
|
|
348
346
|
exports.getSimilarChannels = getSimilarChannels.getSimilarChannels;
|
package/methods.js
CHANGED
|
@@ -51,7 +51,6 @@ import { getCreatorAfterLeave } from "./highlevel/methods/chats/get-creator-afte
|
|
|
51
51
|
import { getFullChat } from "./highlevel/methods/chats/get-full-chat.js";
|
|
52
52
|
import { getFullUser } from "./highlevel/methods/chats/get-full-user.js";
|
|
53
53
|
import { getMessageAuthor } from "./highlevel/methods/chats/get-message-author.js";
|
|
54
|
-
import { getNearbyChats } from "./highlevel/methods/chats/get-nearby-chats.js";
|
|
55
54
|
import { getPeer } from "./highlevel/methods/chats/get-peer.js";
|
|
56
55
|
import { getPeers } from "./highlevel/methods/chats/get-peers.js";
|
|
57
56
|
import { getSimilarChannels } from "./highlevel/methods/chats/get-similar-channels.js";
|
|
@@ -408,7 +407,6 @@ export {
|
|
|
408
407
|
getMyCommands,
|
|
409
408
|
getMyStickerSets,
|
|
410
409
|
getMyUsername,
|
|
411
|
-
getNearbyChats,
|
|
412
410
|
getPasswordHint,
|
|
413
411
|
getPeer,
|
|
414
412
|
getPeerDialogs,
|
package/network/auth-key.d.cts
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import { tl } from '@mtcute/tl';
|
|
2
1
|
import { TlReaderMap, TlBinaryReader } from '@mtcute/tl-runtime';
|
|
3
2
|
import { default as Long } from 'long';
|
|
3
|
+
import { tl } from '../tl/index.js';
|
|
4
4
|
import { ICryptoProvider, Logger } from '../utils/index.js';
|
|
5
5
|
export declare class AuthKey {
|
|
6
6
|
readonly _crypto: ICryptoProvider;
|
package/network/auth-key.d.ts
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import { tl } from '@mtcute/tl';
|
|
2
1
|
import { TlReaderMap, TlBinaryReader } from '@mtcute/tl-runtime';
|
|
3
2
|
import { default as Long } from 'long';
|
|
3
|
+
import { tl } from '../tl/index.js';
|
|
4
4
|
import { ICryptoProvider, Logger } from '../utils/index.js';
|
|
5
5
|
export declare class AuthKey {
|
|
6
6
|
readonly _crypto: ICryptoProvider;
|
|
@@ -6,7 +6,6 @@ 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 tlRuntime = require("@mtcute/tl-runtime");
|
|
11
10
|
const Long = require("long");
|
|
12
11
|
const keys = require("../utils/crypto/keys.cjs");
|
|
@@ -14,6 +13,7 @@ const millerRabin = require("../utils/crypto/miller-rabin.cjs");
|
|
|
14
13
|
const mtproto = require("../utils/crypto/mtproto.cjs");
|
|
15
14
|
const typeAssertions = require("../utils/type-assertions.cjs");
|
|
16
15
|
const errors = require("../types/errors.cjs");
|
|
16
|
+
const innerMtp = require("../tl/inner-mtp.cjs");
|
|
17
17
|
const DH_SAFETY_RANGE = 2n ** (2048n - 64n);
|
|
18
18
|
const KNOWN_DH_PRIME = 0xC71CAEB9C6B1C9048E6C522F70F13F73980D40238E3E21C14934D037563D930F48198A0AA7C14058229493D22530F4DBFA336F6E0AC925139543AED44CCE7C3720FD51F69458705AC68CD4FE6B6B13ABDC9746512969328454F18FAF8C595F642477FE96BB2A941D5BCD1D4AC8CC49880708FA9B378E3C4F3A9060BEE67CF9A4A4A695811051907E162753B56B0F6B410DBA74D8A84B2A14B3144E0EF1284754FD17ED950D5965B4B9DD46582DB1178D169C6BC465B0D6FF9CA3928FEF5B9AE4E418FC15E83EBEA0F87FA9FF5EED70050DED2849F47BF959D956850CE929851F0D8115F635B105EE2E4E15D04B2454BF6F4FADF034B10403119CD8E3B92FCC5Bn;
|
|
19
19
|
const TWO_POW_2047 = 2n ** 2047n;
|
|
@@ -292,7 +292,7 @@ async function doAuthorization(connection, crypto, expiresIn) {
|
|
|
292
292
|
encryptedData: clientDhEncrypted
|
|
293
293
|
});
|
|
294
294
|
const dhGen = await readNext();
|
|
295
|
-
if (!
|
|
295
|
+
if (!innerMtp.isAnySet_client_DH_params_answer(dhGen)) {
|
|
296
296
|
throw new errors.MtTypeAssertionError("auth step 4", "set_client_DH_params_answer", dhGen._);
|
|
297
297
|
}
|
|
298
298
|
if (!utils.typed.equal(dhGen.nonce, nonce)) {
|
package/network/authorization.js
CHANGED
|
@@ -1,5 +1,4 @@
|
|
|
1
1
|
import { typed, bigint, u8 } from "@fuman/utils";
|
|
2
|
-
import { mtp } from "@mtcute/tl";
|
|
3
2
|
import { TlBinaryWriter, TlBinaryReader, TlSerializationCounter } from "@mtcute/tl-runtime";
|
|
4
3
|
import Long from "long";
|
|
5
4
|
import { findKeyByFingerprints } from "../utils/crypto/keys.js";
|
|
@@ -7,6 +6,7 @@ import { millerRabin } from "../utils/crypto/miller-rabin.js";
|
|
|
7
6
|
import { generateKeyAndIvFromNonce } from "../utils/crypto/mtproto.js";
|
|
8
7
|
import { mtpAssertTypeIs } from "../utils/type-assertions.js";
|
|
9
8
|
import { MtSecurityError, MtTypeAssertionError, MtArgumentError } from "../types/errors.js";
|
|
9
|
+
import { isAnySet_client_DH_params_answer } from "../tl/inner-mtp.js";
|
|
10
10
|
const DH_SAFETY_RANGE = 2n ** (2048n - 64n);
|
|
11
11
|
const KNOWN_DH_PRIME = 0xC71CAEB9C6B1C9048E6C522F70F13F73980D40238E3E21C14934D037563D930F48198A0AA7C14058229493D22530F4DBFA336F6E0AC925139543AED44CCE7C3720FD51F69458705AC68CD4FE6B6B13ABDC9746512969328454F18FAF8C595F642477FE96BB2A941D5BCD1D4AC8CC49880708FA9B378E3C4F3A9060BEE67CF9A4A4A695811051907E162753B56B0F6B410DBA74D8A84B2A14B3144E0EF1284754FD17ED950D5965B4B9DD46582DB1178D169C6BC465B0D6FF9CA3928FEF5B9AE4E418FC15E83EBEA0F87FA9FF5EED70050DED2849F47BF959D956850CE929851F0D8115F635B105EE2E4E15D04B2454BF6F4FADF034B10403119CD8E3B92FCC5Bn;
|
|
12
12
|
const TWO_POW_2047 = 2n ** 2047n;
|
|
@@ -285,7 +285,7 @@ async function doAuthorization(connection, crypto, expiresIn) {
|
|
|
285
285
|
encryptedData: clientDhEncrypted
|
|
286
286
|
});
|
|
287
287
|
const dhGen = await readNext();
|
|
288
|
-
if (!
|
|
288
|
+
if (!isAnySet_client_DH_params_answer(dhGen)) {
|
|
289
289
|
throw new MtTypeAssertionError("auth step 4", "set_client_DH_params_answer", dhGen._);
|
|
290
290
|
}
|
|
291
291
|
if (!typed.equal(dhGen.nonce, nonce)) {
|