@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
|
@@ -6,19 +6,17 @@ 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 mtproto = require("../utils/crypto/mtproto.cjs");
|
|
13
12
|
const earlyTimer = require("../utils/early-timer.cjs");
|
|
14
13
|
const longUtils = require("../utils/long-utils.cjs");
|
|
15
|
-
require("@mtcute/tl/binary/reader.js");
|
|
16
|
-
require("@mtcute/tl/binary/writer.js");
|
|
17
14
|
const authorization = require("./authorization.cjs");
|
|
18
15
|
const mtprotoSession = require("./mtproto-session.cjs");
|
|
19
16
|
const persistentConnection = require("./persistent-connection.cjs");
|
|
20
17
|
const abstract = require("./transports/abstract.cjs");
|
|
21
18
|
const errors = require("../types/errors.cjs");
|
|
19
|
+
const innerTl = require("../tl/inner-tl.cjs");
|
|
22
20
|
const TEMP_AUTH_KEY_EXPIRY = 86400;
|
|
23
21
|
const GET_STATE_INTERVAL = 1500;
|
|
24
22
|
const GET_STATE_TIMEOUT = 2500;
|
|
@@ -195,7 +193,7 @@ class SessionConnection extends persistentConnection.PersistentConnection {
|
|
|
195
193
|
onConnectionUsable() {
|
|
196
194
|
if (this.params.withUpdates) {
|
|
197
195
|
this.sendRpc({ _: "updates.getState" }).catch((err) => {
|
|
198
|
-
if (this._destroyed ||
|
|
196
|
+
if (this._destroyed || innerTl.RpcError.is(err, "AUTH_KEY_UNREGISTERED")) return;
|
|
199
197
|
this.log.warn("failed to send updates.getState: %e", err);
|
|
200
198
|
});
|
|
201
199
|
}
|
|
@@ -471,10 +469,10 @@ class SessionConnection extends persistentConnection.PersistentConnection {
|
|
|
471
469
|
break;
|
|
472
470
|
case "mt_destroy_session_ok":
|
|
473
471
|
case "mt_destroy_session_none":
|
|
474
|
-
this.
|
|
472
|
+
this.log.debug("received %s (msg_id = %l): %j", message._, messageId, message);
|
|
475
473
|
break;
|
|
476
474
|
default:
|
|
477
|
-
if (
|
|
475
|
+
if (innerTl.isAnyUpdates(message)) {
|
|
478
476
|
if (this._usable && this.params.inactivityTimeout) {
|
|
479
477
|
this._rescheduleInactivity();
|
|
480
478
|
}
|
|
@@ -527,6 +525,7 @@ class SessionConnection extends persistentConnection.PersistentConnection {
|
|
|
527
525
|
if (msg._ === "bind") {
|
|
528
526
|
this._sendAck(messageId);
|
|
529
527
|
msg.promise.resolve(message.object());
|
|
528
|
+
this._session.pendingMessages.delete(reqMsgId);
|
|
530
529
|
return;
|
|
531
530
|
}
|
|
532
531
|
if (msg._ === "cancel") {
|
|
@@ -535,10 +534,12 @@ class SessionConnection extends persistentConnection.PersistentConnection {
|
|
|
535
534
|
result2 = message.object();
|
|
536
535
|
} catch {
|
|
537
536
|
this.log.debug("failed to parse rpc_result for cancel request %l, ignoring", reqMsgId);
|
|
537
|
+
this._session.pendingMessages.delete(reqMsgId);
|
|
538
538
|
return;
|
|
539
539
|
}
|
|
540
540
|
this.log.debug("received %s for cancelled request %l: %j", result2._, reqMsgId, result2);
|
|
541
541
|
this._onMessageAcked(reqMsgId);
|
|
542
|
+
this._session.pendingMessages.delete(reqMsgId);
|
|
542
543
|
return;
|
|
543
544
|
}
|
|
544
545
|
this.log.error("received rpc_result for %s request %l", msg._, reqMsgId);
|
|
@@ -948,16 +949,6 @@ class SessionConnection extends persistentConnection.PersistentConnection {
|
|
|
948
949
|
this._salts.setFutureSalts(msg.salts.slice());
|
|
949
950
|
this.onFutureSalts.emit(msg.salts);
|
|
950
951
|
}
|
|
951
|
-
_onDestroySessionResult(msg) {
|
|
952
|
-
const reqMsgId = this._session.destroySessionIdToMsgId.get(msg.sessionId);
|
|
953
|
-
if (!reqMsgId) {
|
|
954
|
-
this.log.warn("received %s for unknown session %h", msg._, msg.sessionId);
|
|
955
|
-
return;
|
|
956
|
-
}
|
|
957
|
-
this._session.destroySessionIdToMsgId.delete(msg.sessionId);
|
|
958
|
-
this._session.pendingMessages.delete(reqMsgId);
|
|
959
|
-
this.log.debug("received %s for session %h", msg._, msg.sessionId);
|
|
960
|
-
}
|
|
961
952
|
_enqueueRpc(rpc, force) {
|
|
962
953
|
if (this._session.enqueueRpc(rpc, force)) {
|
|
963
954
|
this._flushTimer.emitWhenIdle();
|
|
@@ -1093,6 +1084,7 @@ class SessionConnection extends persistentConnection.PersistentConnection {
|
|
|
1093
1084
|
}
|
|
1094
1085
|
rpc.cancelled = true;
|
|
1095
1086
|
if (rpc.msgId) {
|
|
1087
|
+
this._session.pendingMessages.delete(rpc.msgId);
|
|
1096
1088
|
this._session.queuedCancelReq.push(rpc.msgId);
|
|
1097
1089
|
this._session.getStateSchedule.remove(rpc);
|
|
1098
1090
|
this._flushTimer.emitWhenIdle();
|
|
@@ -1147,6 +1139,8 @@ class SessionConnection extends persistentConnection.PersistentConnection {
|
|
|
1147
1139
|
this._doFlush();
|
|
1148
1140
|
} catch (e) {
|
|
1149
1141
|
this.log.error("flush error: %s", e.stack);
|
|
1142
|
+
this._resetSession("flush error");
|
|
1143
|
+
return;
|
|
1150
1144
|
}
|
|
1151
1145
|
if (this._session.hasPendingMessages) {
|
|
1152
1146
|
this._flushTimer.emitWhenIdle();
|
|
@@ -1378,7 +1372,6 @@ class SessionConnection extends persistentConnection.PersistentConnection {
|
|
|
1378
1372
|
containerId: msgId
|
|
1379
1373
|
};
|
|
1380
1374
|
this._session.pendingMessages.set(msgId, pending);
|
|
1381
|
-
this._session.destroySessionIdToMsgId.set(sessionId, msgId);
|
|
1382
1375
|
otherPendings.push(pending);
|
|
1383
1376
|
});
|
|
1384
1377
|
}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { mtp, tl } from '@mtcute/tl';
|
|
2
1
|
import { TlReaderMap, TlWriterMap } from '@mtcute/tl-runtime';
|
|
2
|
+
import { mtp, tl } from '../tl/index.js';
|
|
3
3
|
import { ICorePlatform } from '../types/platform.js';
|
|
4
4
|
import { Logger } from '../utils/index.js';
|
|
5
5
|
import { PersistentConnectionParams, PersistentConnection } from './persistent-connection.js';
|
|
@@ -10,7 +10,6 @@ export interface SessionConnectionParams extends PersistentConnectionParams {
|
|
|
10
10
|
initConnection: tl.RawInitConnectionRequest;
|
|
11
11
|
inactivityTimeout?: number;
|
|
12
12
|
pingInterval: number;
|
|
13
|
-
enableErrorReporting: boolean;
|
|
14
13
|
layer: number;
|
|
15
14
|
disableUpdates?: boolean;
|
|
16
15
|
withUpdates?: boolean;
|
|
@@ -81,7 +80,6 @@ export declare class SessionConnection extends PersistentConnection {
|
|
|
81
80
|
private _onMessagesInfo;
|
|
82
81
|
private _onMsgsStateInfo;
|
|
83
82
|
private _onFutureSalts;
|
|
84
|
-
private _onDestroySessionResult;
|
|
85
83
|
private _enqueueRpc;
|
|
86
84
|
_resetSession(reason?: string): void;
|
|
87
85
|
private _sendAck;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { mtp, tl } from '@mtcute/tl';
|
|
2
1
|
import { TlReaderMap, TlWriterMap } from '@mtcute/tl-runtime';
|
|
2
|
+
import { mtp, tl } from '../tl/index.js';
|
|
3
3
|
import { ICorePlatform } from '../types/platform.js';
|
|
4
4
|
import { Logger } from '../utils/index.js';
|
|
5
5
|
import { PersistentConnectionParams, PersistentConnection } from './persistent-connection.js';
|
|
@@ -10,7 +10,6 @@ export interface SessionConnectionParams extends PersistentConnectionParams {
|
|
|
10
10
|
initConnection: tl.RawInitConnectionRequest;
|
|
11
11
|
inactivityTimeout?: number;
|
|
12
12
|
pingInterval: number;
|
|
13
|
-
enableErrorReporting: boolean;
|
|
14
13
|
layer: number;
|
|
15
14
|
disableUpdates?: boolean;
|
|
16
15
|
withUpdates?: boolean;
|
|
@@ -81,7 +80,6 @@ export declare class SessionConnection extends PersistentConnection {
|
|
|
81
80
|
private _onMessagesInfo;
|
|
82
81
|
private _onMsgsStateInfo;
|
|
83
82
|
private _onFutureSalts;
|
|
84
|
-
private _onDestroySessionResult;
|
|
85
83
|
private _enqueueRpc;
|
|
86
84
|
_resetSession(reason?: string): void;
|
|
87
85
|
private _sendAck;
|
|
@@ -1,17 +1,15 @@
|
|
|
1
1
|
import { Emitter, timers, u8, Deferred } from "@fuman/utils";
|
|
2
|
-
import { tl } from "@mtcute/tl";
|
|
3
2
|
import { TlBinaryWriter, TlSerializationCounter, TlUnknownObjectError, TlBinaryReader } from "@mtcute/tl-runtime";
|
|
4
3
|
import Long from "long";
|
|
5
4
|
import { createAesIgeForMessageOld } from "../utils/crypto/mtproto.js";
|
|
6
5
|
import { EarlyTimer } from "../utils/early-timer.js";
|
|
7
6
|
import { longFromBuffer, randomLong, removeFromLongArray } from "../utils/long-utils.js";
|
|
8
|
-
import "@mtcute/tl/binary/reader.js";
|
|
9
|
-
import "@mtcute/tl/binary/writer.js";
|
|
10
7
|
import { doAuthorization } from "./authorization.js";
|
|
11
8
|
import { MtprotoSession } from "./mtproto-session.js";
|
|
12
9
|
import { PersistentConnection } from "./persistent-connection.js";
|
|
13
10
|
import { TransportError } from "./transports/abstract.js";
|
|
14
11
|
import { MtcuteError, MtTimeoutError, MtArgumentError } from "../types/errors.js";
|
|
12
|
+
import { RpcError, isAnyUpdates } from "../tl/inner-tl.js";
|
|
15
13
|
const TEMP_AUTH_KEY_EXPIRY = 86400;
|
|
16
14
|
const GET_STATE_INTERVAL = 1500;
|
|
17
15
|
const GET_STATE_TIMEOUT = 2500;
|
|
@@ -188,7 +186,7 @@ class SessionConnection extends PersistentConnection {
|
|
|
188
186
|
onConnectionUsable() {
|
|
189
187
|
if (this.params.withUpdates) {
|
|
190
188
|
this.sendRpc({ _: "updates.getState" }).catch((err) => {
|
|
191
|
-
if (this._destroyed ||
|
|
189
|
+
if (this._destroyed || RpcError.is(err, "AUTH_KEY_UNREGISTERED")) return;
|
|
192
190
|
this.log.warn("failed to send updates.getState: %e", err);
|
|
193
191
|
});
|
|
194
192
|
}
|
|
@@ -464,10 +462,10 @@ class SessionConnection extends PersistentConnection {
|
|
|
464
462
|
break;
|
|
465
463
|
case "mt_destroy_session_ok":
|
|
466
464
|
case "mt_destroy_session_none":
|
|
467
|
-
this.
|
|
465
|
+
this.log.debug("received %s (msg_id = %l): %j", message._, messageId, message);
|
|
468
466
|
break;
|
|
469
467
|
default:
|
|
470
|
-
if (
|
|
468
|
+
if (isAnyUpdates(message)) {
|
|
471
469
|
if (this._usable && this.params.inactivityTimeout) {
|
|
472
470
|
this._rescheduleInactivity();
|
|
473
471
|
}
|
|
@@ -520,6 +518,7 @@ class SessionConnection extends PersistentConnection {
|
|
|
520
518
|
if (msg._ === "bind") {
|
|
521
519
|
this._sendAck(messageId);
|
|
522
520
|
msg.promise.resolve(message.object());
|
|
521
|
+
this._session.pendingMessages.delete(reqMsgId);
|
|
523
522
|
return;
|
|
524
523
|
}
|
|
525
524
|
if (msg._ === "cancel") {
|
|
@@ -528,10 +527,12 @@ class SessionConnection extends PersistentConnection {
|
|
|
528
527
|
result2 = message.object();
|
|
529
528
|
} catch {
|
|
530
529
|
this.log.debug("failed to parse rpc_result for cancel request %l, ignoring", reqMsgId);
|
|
530
|
+
this._session.pendingMessages.delete(reqMsgId);
|
|
531
531
|
return;
|
|
532
532
|
}
|
|
533
533
|
this.log.debug("received %s for cancelled request %l: %j", result2._, reqMsgId, result2);
|
|
534
534
|
this._onMessageAcked(reqMsgId);
|
|
535
|
+
this._session.pendingMessages.delete(reqMsgId);
|
|
535
536
|
return;
|
|
536
537
|
}
|
|
537
538
|
this.log.error("received rpc_result for %s request %l", msg._, reqMsgId);
|
|
@@ -941,16 +942,6 @@ class SessionConnection extends PersistentConnection {
|
|
|
941
942
|
this._salts.setFutureSalts(msg.salts.slice());
|
|
942
943
|
this.onFutureSalts.emit(msg.salts);
|
|
943
944
|
}
|
|
944
|
-
_onDestroySessionResult(msg) {
|
|
945
|
-
const reqMsgId = this._session.destroySessionIdToMsgId.get(msg.sessionId);
|
|
946
|
-
if (!reqMsgId) {
|
|
947
|
-
this.log.warn("received %s for unknown session %h", msg._, msg.sessionId);
|
|
948
|
-
return;
|
|
949
|
-
}
|
|
950
|
-
this._session.destroySessionIdToMsgId.delete(msg.sessionId);
|
|
951
|
-
this._session.pendingMessages.delete(reqMsgId);
|
|
952
|
-
this.log.debug("received %s for session %h", msg._, msg.sessionId);
|
|
953
|
-
}
|
|
954
945
|
_enqueueRpc(rpc, force) {
|
|
955
946
|
if (this._session.enqueueRpc(rpc, force)) {
|
|
956
947
|
this._flushTimer.emitWhenIdle();
|
|
@@ -1086,6 +1077,7 @@ class SessionConnection extends PersistentConnection {
|
|
|
1086
1077
|
}
|
|
1087
1078
|
rpc.cancelled = true;
|
|
1088
1079
|
if (rpc.msgId) {
|
|
1080
|
+
this._session.pendingMessages.delete(rpc.msgId);
|
|
1089
1081
|
this._session.queuedCancelReq.push(rpc.msgId);
|
|
1090
1082
|
this._session.getStateSchedule.remove(rpc);
|
|
1091
1083
|
this._flushTimer.emitWhenIdle();
|
|
@@ -1140,6 +1132,8 @@ class SessionConnection extends PersistentConnection {
|
|
|
1140
1132
|
this._doFlush();
|
|
1141
1133
|
} catch (e) {
|
|
1142
1134
|
this.log.error("flush error: %s", e.stack);
|
|
1135
|
+
this._resetSession("flush error");
|
|
1136
|
+
return;
|
|
1143
1137
|
}
|
|
1144
1138
|
if (this._session.hasPendingMessages) {
|
|
1145
1139
|
this._flushTimer.emitWhenIdle();
|
|
@@ -1371,7 +1365,6 @@ class SessionConnection extends PersistentConnection {
|
|
|
1371
1365
|
containerId: msgId
|
|
1372
1366
|
};
|
|
1373
1367
|
this._session.pendingMessages.set(msgId, pending);
|
|
1374
|
-
this._session.destroySessionIdToMsgId.set(sessionId, msgId);
|
|
1375
1368
|
otherPendings.push(pending);
|
|
1376
1369
|
});
|
|
1377
1370
|
}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { IFrameDecoder, IFrameEncoder } from '@fuman/io';
|
|
2
2
|
import { IConnection } from '@fuman/net';
|
|
3
|
-
import { tl } from '
|
|
3
|
+
import { tl } from '../../tl/index.js';
|
|
4
4
|
import { MaybePromise } from '../../types/index.js';
|
|
5
5
|
import { BasicDcOption, ICryptoProvider, Logger } from '../../utils/index.js';
|
|
6
6
|
/**
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { IFrameDecoder, IFrameEncoder } from '@fuman/io';
|
|
2
2
|
import { IConnection } from '@fuman/net';
|
|
3
|
-
import { tl } from '
|
|
3
|
+
import { tl } from '../../tl/index.js';
|
|
4
4
|
import { MaybePromise } from '../../types/index.js';
|
|
5
5
|
import { BasicDcOption, ICryptoProvider, Logger } from '../../utils/index.js';
|
|
6
6
|
/**
|
|
@@ -9,8 +9,6 @@ const io = require("@fuman/io");
|
|
|
9
9
|
const utils = require("@fuman/utils");
|
|
10
10
|
const miscUtils = require("../../utils/misc-utils.cjs");
|
|
11
11
|
require("@mtcute/tl-runtime");
|
|
12
|
-
require("@mtcute/tl/binary/reader.js");
|
|
13
|
-
require("@mtcute/tl/binary/writer.js");
|
|
14
12
|
const abstract = require("./abstract.cjs");
|
|
15
13
|
const TAG = new Uint8Array([238, 238, 238, 238]);
|
|
16
14
|
const PADDED_TAG = new Uint8Array([221, 221, 221, 221]);
|
|
@@ -2,8 +2,6 @@ import { read, write } from "@fuman/io";
|
|
|
2
2
|
import { typed } from "@fuman/utils";
|
|
3
3
|
import { getRandomInt } from "../../utils/misc-utils.js";
|
|
4
4
|
import "@mtcute/tl-runtime";
|
|
5
|
-
import "@mtcute/tl/binary/reader.js";
|
|
6
|
-
import "@mtcute/tl/binary/writer.js";
|
|
7
5
|
import { TransportError } from "./abstract.js";
|
|
8
6
|
const TAG = new Uint8Array([238, 238, 238, 238]);
|
|
9
7
|
const PADDED_TAG = new Uint8Array([221, 221, 221, 221]);
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@mtcute/core",
|
|
3
3
|
"type": "module",
|
|
4
|
-
"version": "0.
|
|
4
|
+
"version": "0.29.0",
|
|
5
5
|
"description": "Type-safe library for MTProto (Telegram API)",
|
|
6
6
|
"license": "MIT",
|
|
7
7
|
"scripts": {},
|
|
@@ -9,11 +9,10 @@
|
|
|
9
9
|
"@fuman/io": "0.0.19",
|
|
10
10
|
"@fuman/net": "0.0.19",
|
|
11
11
|
"@fuman/utils": "0.0.19",
|
|
12
|
-
"@mtcute/file-id": "^0.
|
|
13
|
-
"@mtcute/tl": "^
|
|
14
|
-
"@mtcute/tl-runtime": "^0.24.3",
|
|
12
|
+
"@mtcute/file-id": "^0.29.0",
|
|
13
|
+
"@mtcute/tl-runtime": "^0.29.0",
|
|
15
14
|
"@types/events": "3.0.0",
|
|
16
|
-
"long": "5.2
|
|
15
|
+
"long": "^5.3.2"
|
|
17
16
|
},
|
|
18
17
|
"exports": {
|
|
19
18
|
".": {
|
|
@@ -65,7 +64,11 @@
|
|
|
65
64
|
"types": "./methods.d.cts",
|
|
66
65
|
"default": "./methods.cjs"
|
|
67
66
|
}
|
|
68
|
-
}
|
|
67
|
+
},
|
|
68
|
+
"./tl/api-schema.json": "./tl/api-schema.json",
|
|
69
|
+
"./tl/app-config.json": "./tl/app-config.json",
|
|
70
|
+
"./tl/raw-errors.json": "./tl/raw-errors.json",
|
|
71
|
+
"./tl/mtp-schema.json": "./tl/mtp-schema.json"
|
|
69
72
|
},
|
|
70
73
|
"author": "alina sireneva <alina@tei.su>",
|
|
71
74
|
"sideEffects": false,
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { tl } from '@mtcute/tl';
|
|
2
1
|
import { TlReaderMap, TlWriterMap } from '@mtcute/tl-runtime';
|
|
2
|
+
import { tl } from '../../tl/index.js';
|
|
3
3
|
import { Logger } from '../../utils/logger.js';
|
|
4
4
|
import { IStorageDriver } from '../driver.js';
|
|
5
5
|
export interface ServiceOptions {
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { tl } from '@mtcute/tl';
|
|
2
1
|
import { TlReaderMap, TlWriterMap } from '@mtcute/tl-runtime';
|
|
2
|
+
import { tl } from '../../tl/index.js';
|
|
3
3
|
import { Logger } from '../../utils/logger.js';
|
|
4
4
|
import { IStorageDriver } from '../driver.js';
|
|
5
5
|
export interface ServiceOptions {
|
|
@@ -20,14 +20,6 @@ class BaseSqliteStorageDriver extends driver.BaseStorageDriver {
|
|
|
20
20
|
_cleanup;
|
|
21
21
|
_migrations = /* @__PURE__ */ new Map();
|
|
22
22
|
_maxVersion = /* @__PURE__ */ new Map();
|
|
23
|
-
// todo: remove in 1.0.0
|
|
24
|
-
_legacyMigrations = /* @__PURE__ */ new Map();
|
|
25
|
-
registerLegacyMigration(repo, migration) {
|
|
26
|
-
if (this.loaded) {
|
|
27
|
-
throw new Error("Cannot register migrations after loading");
|
|
28
|
-
}
|
|
29
|
-
this._legacyMigrations.set(repo, migration);
|
|
30
|
-
}
|
|
31
23
|
registerMigration(repo, version, migration) {
|
|
32
24
|
if (this.loaded) {
|
|
33
25
|
throw new Error("Cannot register migrations after loading");
|
|
@@ -57,13 +49,7 @@ class BaseSqliteStorageDriver extends driver.BaseStorageDriver {
|
|
|
57
49
|
_writeLater(stmt, params) {
|
|
58
50
|
this._pending.push([stmt, params]);
|
|
59
51
|
}
|
|
60
|
-
_runLegacyMigrations = false;
|
|
61
52
|
_initialize() {
|
|
62
|
-
const hasLegacyTables = this.db.prepare("select name from sqlite_master where type = 'table' and name = 'kv'").get();
|
|
63
|
-
if (hasLegacyTables) {
|
|
64
|
-
this._log.info("legacy tables detected, will run migrations");
|
|
65
|
-
this._runLegacyMigrations = true;
|
|
66
|
-
}
|
|
67
53
|
this.db.exec(MIGRATIONS_TABLE_SQL);
|
|
68
54
|
const writeVersion = this.db.prepare(
|
|
69
55
|
`insert or replace into ${MIGRATIONS_TABLE_NAME} (repo, version) values (?, ?)`
|
|
@@ -104,14 +90,6 @@ class BaseSqliteStorageDriver extends driver.BaseStorageDriver {
|
|
|
104
90
|
this._destroy();
|
|
105
91
|
});
|
|
106
92
|
for (const cb of this._onLoad) cb(this.db);
|
|
107
|
-
if (this._runLegacyMigrations) {
|
|
108
|
-
this.db.transaction(() => {
|
|
109
|
-
for (const migration of this._legacyMigrations.values()) {
|
|
110
|
-
migration(this.db);
|
|
111
|
-
}
|
|
112
|
-
this._runMany(this._pending);
|
|
113
|
-
})();
|
|
114
|
-
}
|
|
115
93
|
}
|
|
116
94
|
_save() {
|
|
117
95
|
if (!this._pending.length) return;
|
|
@@ -8,13 +8,10 @@ export declare abstract class BaseSqliteStorageDriver extends BaseStorageDriver
|
|
|
8
8
|
private _cleanup?;
|
|
9
9
|
private _migrations;
|
|
10
10
|
private _maxVersion;
|
|
11
|
-
private _legacyMigrations;
|
|
12
|
-
registerLegacyMigration(repo: string, migration: MigrationFunction): void;
|
|
13
11
|
registerMigration(repo: string, version: number, migration: MigrationFunction): void;
|
|
14
12
|
private _onLoad;
|
|
15
13
|
onLoad(cb: (db: ISqliteDatabase) => void): void;
|
|
16
14
|
_writeLater(stmt: ISqliteStatement, params: unknown[]): void;
|
|
17
|
-
private _runLegacyMigrations;
|
|
18
15
|
_initialize(): void;
|
|
19
16
|
abstract _createDatabase(): ISqliteDatabase;
|
|
20
17
|
_load(): Promise<void>;
|
|
@@ -8,13 +8,10 @@ export declare abstract class BaseSqliteStorageDriver extends BaseStorageDriver
|
|
|
8
8
|
private _cleanup?;
|
|
9
9
|
private _migrations;
|
|
10
10
|
private _maxVersion;
|
|
11
|
-
private _legacyMigrations;
|
|
12
|
-
registerLegacyMigration(repo: string, migration: MigrationFunction): void;
|
|
13
11
|
registerMigration(repo: string, version: number, migration: MigrationFunction): void;
|
|
14
12
|
private _onLoad;
|
|
15
13
|
onLoad(cb: (db: ISqliteDatabase) => void): void;
|
|
16
14
|
_writeLater(stmt: ISqliteStatement, params: unknown[]): void;
|
|
17
|
-
private _runLegacyMigrations;
|
|
18
15
|
_initialize(): void;
|
|
19
16
|
abstract _createDatabase(): ISqliteDatabase;
|
|
20
17
|
_load(): Promise<void>;
|
package/storage/sqlite/driver.js
CHANGED
|
@@ -13,14 +13,6 @@ class BaseSqliteStorageDriver extends BaseStorageDriver {
|
|
|
13
13
|
_cleanup;
|
|
14
14
|
_migrations = /* @__PURE__ */ new Map();
|
|
15
15
|
_maxVersion = /* @__PURE__ */ new Map();
|
|
16
|
-
// todo: remove in 1.0.0
|
|
17
|
-
_legacyMigrations = /* @__PURE__ */ new Map();
|
|
18
|
-
registerLegacyMigration(repo, migration) {
|
|
19
|
-
if (this.loaded) {
|
|
20
|
-
throw new Error("Cannot register migrations after loading");
|
|
21
|
-
}
|
|
22
|
-
this._legacyMigrations.set(repo, migration);
|
|
23
|
-
}
|
|
24
16
|
registerMigration(repo, version, migration) {
|
|
25
17
|
if (this.loaded) {
|
|
26
18
|
throw new Error("Cannot register migrations after loading");
|
|
@@ -50,13 +42,7 @@ class BaseSqliteStorageDriver extends BaseStorageDriver {
|
|
|
50
42
|
_writeLater(stmt, params) {
|
|
51
43
|
this._pending.push([stmt, params]);
|
|
52
44
|
}
|
|
53
|
-
_runLegacyMigrations = false;
|
|
54
45
|
_initialize() {
|
|
55
|
-
const hasLegacyTables = this.db.prepare("select name from sqlite_master where type = 'table' and name = 'kv'").get();
|
|
56
|
-
if (hasLegacyTables) {
|
|
57
|
-
this._log.info("legacy tables detected, will run migrations");
|
|
58
|
-
this._runLegacyMigrations = true;
|
|
59
|
-
}
|
|
60
46
|
this.db.exec(MIGRATIONS_TABLE_SQL);
|
|
61
47
|
const writeVersion = this.db.prepare(
|
|
62
48
|
`insert or replace into ${MIGRATIONS_TABLE_NAME} (repo, version) values (?, ?)`
|
|
@@ -97,14 +83,6 @@ class BaseSqliteStorageDriver extends BaseStorageDriver {
|
|
|
97
83
|
this._destroy();
|
|
98
84
|
});
|
|
99
85
|
for (const cb of this._onLoad) cb(this.db);
|
|
100
|
-
if (this._runLegacyMigrations) {
|
|
101
|
-
this.db.transaction(() => {
|
|
102
|
-
for (const migration of this._legacyMigrations.values()) {
|
|
103
|
-
migration(this.db);
|
|
104
|
-
}
|
|
105
|
-
this._runMany(this._pending);
|
|
106
|
-
})();
|
|
107
|
-
}
|
|
108
86
|
}
|
|
109
87
|
_save() {
|
|
110
88
|
if (!this._pending.length) return;
|
|
@@ -5,21 +5,16 @@ 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 reader_js = require("@mtcute/tl/binary/reader.js");
|
|
9
|
-
const writer_js = require("@mtcute/tl/binary/writer.js");
|
|
10
|
-
const currentUser = require("../../../highlevel/storage/service/current-user.cjs");
|
|
11
|
-
const updates = require("../../../highlevel/storage/service/updates.cjs");
|
|
12
|
-
const defaultDcs = require("../../service/default-dcs.cjs");
|
|
13
8
|
class SqliteKeyValueRepository {
|
|
14
9
|
constructor(_driver) {
|
|
15
10
|
this._driver = _driver;
|
|
16
11
|
_driver.registerMigration("kv", 1, (db) => {
|
|
17
12
|
db.exec(`
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
13
|
+
create table key_value (
|
|
14
|
+
key text primary key,
|
|
15
|
+
value blob not null
|
|
16
|
+
);
|
|
17
|
+
`);
|
|
23
18
|
});
|
|
24
19
|
_driver.onLoad((db) => {
|
|
25
20
|
this._get = db.prepare("select value from key_value where key = ?");
|
|
@@ -27,43 +22,6 @@ class SqliteKeyValueRepository {
|
|
|
27
22
|
this._del = db.prepare("delete from key_value where key = ?");
|
|
28
23
|
this._delAll = db.prepare("delete from key_value");
|
|
29
24
|
});
|
|
30
|
-
_driver.registerLegacyMigration("kv", (db) => {
|
|
31
|
-
const all = db.prepare("select key, value from kv").all();
|
|
32
|
-
const obj = {};
|
|
33
|
-
for (const { key, value } of all) {
|
|
34
|
-
obj[key] = JSON.parse(value);
|
|
35
|
-
}
|
|
36
|
-
db.exec("drop table kv");
|
|
37
|
-
const options = {
|
|
38
|
-
driver: this._driver,
|
|
39
|
-
readerMap: reader_js.__tlReaderMap,
|
|
40
|
-
writerMap: writer_js.__tlWriterMap,
|
|
41
|
-
log: this._driver["_log"]
|
|
42
|
-
};
|
|
43
|
-
if (obj.self) {
|
|
44
|
-
new currentUser.CurrentUserService(this, options).store({
|
|
45
|
-
userId: obj.self.userId,
|
|
46
|
-
isBot: obj.self.isBot,
|
|
47
|
-
isPremium: false,
|
|
48
|
-
usernames: []
|
|
49
|
-
});
|
|
50
|
-
}
|
|
51
|
-
if (obj.pts) {
|
|
52
|
-
const svc = new updates.UpdatesStateService(this, options);
|
|
53
|
-
svc.setPts(obj.pts);
|
|
54
|
-
if (obj.qts) svc.setQts(obj.qts);
|
|
55
|
-
if (obj.date) svc.setDate(obj.date);
|
|
56
|
-
if (obj.seq) svc.setSeq(obj.seq);
|
|
57
|
-
const channels = db.prepare("select * from pts").all();
|
|
58
|
-
for (const channel of channels) {
|
|
59
|
-
svc.setChannelPts(channel.channel_id, channel.pts);
|
|
60
|
-
}
|
|
61
|
-
}
|
|
62
|
-
db.exec("drop table pts");
|
|
63
|
-
if (obj.def_dc) {
|
|
64
|
-
new defaultDcs.DefaultDcsService(this, options).store(obj.def_dc);
|
|
65
|
-
}
|
|
66
|
-
});
|
|
67
25
|
}
|
|
68
26
|
_set;
|
|
69
27
|
set(key, value) {
|
|
@@ -1,18 +1,13 @@
|
|
|
1
|
-
import { __tlReaderMap } from "@mtcute/tl/binary/reader.js";
|
|
2
|
-
import { __tlWriterMap } from "@mtcute/tl/binary/writer.js";
|
|
3
|
-
import { CurrentUserService } from "../../../highlevel/storage/service/current-user.js";
|
|
4
|
-
import { UpdatesStateService } from "../../../highlevel/storage/service/updates.js";
|
|
5
|
-
import { DefaultDcsService } from "../../service/default-dcs.js";
|
|
6
1
|
class SqliteKeyValueRepository {
|
|
7
2
|
constructor(_driver) {
|
|
8
3
|
this._driver = _driver;
|
|
9
4
|
_driver.registerMigration("kv", 1, (db) => {
|
|
10
5
|
db.exec(`
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
6
|
+
create table key_value (
|
|
7
|
+
key text primary key,
|
|
8
|
+
value blob not null
|
|
9
|
+
);
|
|
10
|
+
`);
|
|
16
11
|
});
|
|
17
12
|
_driver.onLoad((db) => {
|
|
18
13
|
this._get = db.prepare("select value from key_value where key = ?");
|
|
@@ -20,43 +15,6 @@ class SqliteKeyValueRepository {
|
|
|
20
15
|
this._del = db.prepare("delete from key_value where key = ?");
|
|
21
16
|
this._delAll = db.prepare("delete from key_value");
|
|
22
17
|
});
|
|
23
|
-
_driver.registerLegacyMigration("kv", (db) => {
|
|
24
|
-
const all = db.prepare("select key, value from kv").all();
|
|
25
|
-
const obj = {};
|
|
26
|
-
for (const { key, value } of all) {
|
|
27
|
-
obj[key] = JSON.parse(value);
|
|
28
|
-
}
|
|
29
|
-
db.exec("drop table kv");
|
|
30
|
-
const options = {
|
|
31
|
-
driver: this._driver,
|
|
32
|
-
readerMap: __tlReaderMap,
|
|
33
|
-
writerMap: __tlWriterMap,
|
|
34
|
-
log: this._driver["_log"]
|
|
35
|
-
};
|
|
36
|
-
if (obj.self) {
|
|
37
|
-
new CurrentUserService(this, options).store({
|
|
38
|
-
userId: obj.self.userId,
|
|
39
|
-
isBot: obj.self.isBot,
|
|
40
|
-
isPremium: false,
|
|
41
|
-
usernames: []
|
|
42
|
-
});
|
|
43
|
-
}
|
|
44
|
-
if (obj.pts) {
|
|
45
|
-
const svc = new UpdatesStateService(this, options);
|
|
46
|
-
svc.setPts(obj.pts);
|
|
47
|
-
if (obj.qts) svc.setQts(obj.qts);
|
|
48
|
-
if (obj.date) svc.setDate(obj.date);
|
|
49
|
-
if (obj.seq) svc.setSeq(obj.seq);
|
|
50
|
-
const channels = db.prepare("select * from pts").all();
|
|
51
|
-
for (const channel of channels) {
|
|
52
|
-
svc.setChannelPts(channel.channel_id, channel.pts);
|
|
53
|
-
}
|
|
54
|
-
}
|
|
55
|
-
db.exec("drop table pts");
|
|
56
|
-
if (obj.def_dc) {
|
|
57
|
-
new DefaultDcsService(this, options).store(obj.def_dc);
|
|
58
|
-
}
|
|
59
|
-
});
|
|
60
18
|
}
|
|
61
19
|
_set;
|
|
62
20
|
set(key, value) {
|
|
@@ -49,9 +49,6 @@ class SqlitePeersRepository {
|
|
|
49
49
|
this._getByPhone = db.prepare("select * from peers where phone = ? and isMin = false");
|
|
50
50
|
this._delAll = db.prepare("delete from peers");
|
|
51
51
|
});
|
|
52
|
-
_driver.registerLegacyMigration("peers", (db) => {
|
|
53
|
-
db.exec("drop table entities");
|
|
54
|
-
});
|
|
55
52
|
}
|
|
56
53
|
_loaded = false;
|
|
57
54
|
_ensureLoaded() {
|
|
@@ -42,9 +42,6 @@ class SqlitePeersRepository {
|
|
|
42
42
|
this._getByPhone = db.prepare("select * from peers where phone = ? and isMin = false");
|
|
43
43
|
this._delAll = db.prepare("delete from peers");
|
|
44
44
|
});
|
|
45
|
-
_driver.registerLegacyMigration("peers", (db) => {
|
|
46
|
-
db.exec("drop table entities");
|
|
47
|
-
});
|
|
48
45
|
}
|
|
49
46
|
_loaded = false;
|
|
50
47
|
_ensureLoaded() {
|
package/storage/storage.cjs
CHANGED
|
@@ -5,12 +5,10 @@ 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 defaultDcs = require("./service/default-dcs.cjs");
|
|
9
8
|
const functionUtils = require("../utils/function-utils.cjs");
|
|
10
9
|
require("@mtcute/tl-runtime");
|
|
11
|
-
require("@mtcute/tl/binary/reader.js");
|
|
12
|
-
require("@mtcute/tl/binary/writer.js");
|
|
13
10
|
const authKeys = require("./service/auth-keys.cjs");
|
|
11
|
+
const defaultDcs = require("./service/default-dcs.cjs");
|
|
14
12
|
const futureSalts = require("./service/future-salts.cjs");
|
|
15
13
|
class StorageManager {
|
|
16
14
|
constructor(options) {
|
package/storage/storage.js
CHANGED
|
@@ -1,9 +1,7 @@
|
|
|
1
|
-
import { DefaultDcsService } from "./service/default-dcs.js";
|
|
2
1
|
import { asyncResettable } from "../utils/function-utils.js";
|
|
3
2
|
import "@mtcute/tl-runtime";
|
|
4
|
-
import "@mtcute/tl/binary/reader.js";
|
|
5
|
-
import "@mtcute/tl/binary/writer.js";
|
|
6
3
|
import { AuthKeysService } from "./service/auth-keys.js";
|
|
4
|
+
import { DefaultDcsService } from "./service/default-dcs.js";
|
|
7
5
|
import { FutureSaltsService } from "./service/future-salts.js";
|
|
8
6
|
class StorageManager {
|
|
9
7
|
constructor(options) {
|