@mtcute/core 0.7.3 → 0.9.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/LICENSE +1 -1
- package/README.md +26 -3
- package/cjs/highlevel/base.d.ts +3 -1
- package/cjs/highlevel/base.js +18 -0
- package/cjs/highlevel/base.js.map +1 -1
- package/cjs/highlevel/client.d.ts +23 -10
- package/cjs/highlevel/client.js +26 -19
- package/cjs/highlevel/client.js.map +1 -1
- package/cjs/highlevel/client.types.d.ts +14 -0
- package/cjs/highlevel/client.types.js.map +1 -1
- package/cjs/highlevel/index.d.ts +0 -2
- package/cjs/highlevel/index.js +0 -2
- package/cjs/highlevel/index.js.map +1 -1
- package/cjs/highlevel/methods/_imports.js.map +1 -1
- package/cjs/highlevel/methods/_init.js +4 -29
- package/cjs/highlevel/methods/_init.js.map +1 -1
- package/cjs/highlevel/methods/bots/get-callback-answer.js +2 -2
- package/cjs/highlevel/methods/bots/get-callback-answer.js.map +1 -1
- package/cjs/highlevel/methods/dialogs/create-folder.js +1 -1
- package/cjs/highlevel/methods/dialogs/create-folder.js.map +1 -1
- package/cjs/highlevel/methods/dialogs/edit-folder.js +1 -1
- package/cjs/highlevel/methods/dialogs/edit-folder.js.map +1 -1
- package/cjs/highlevel/methods/dialogs/find-folder.js +1 -1
- package/cjs/highlevel/methods/dialogs/find-folder.js.map +1 -1
- package/cjs/highlevel/methods/dialogs/get-folders.d.ts +1 -1
- package/cjs/highlevel/methods/dialogs/get-folders.js +1 -1
- package/cjs/highlevel/methods/dialogs/get-folders.js.map +1 -1
- package/cjs/highlevel/methods/files/download-file.d.ts +1 -10
- package/cjs/highlevel/methods/files/download-file.js +1 -32
- package/cjs/highlevel/methods/files/download-file.js.map +1 -1
- package/cjs/highlevel/methods/files/download-iterable.js +2 -1
- package/cjs/highlevel/methods/files/download-iterable.js.map +1 -1
- package/cjs/highlevel/methods/files/download-node-stream.js +4 -0
- package/cjs/highlevel/methods/files/download-node-stream.js.map +1 -0
- package/cjs/highlevel/methods/files/normalize-input-media.d.ts +1 -1
- package/cjs/highlevel/methods/files/normalize-input-media.js +2 -1
- package/cjs/highlevel/methods/files/normalize-input-media.js.map +1 -1
- package/cjs/highlevel/methods/files/upload-file.d.ts +0 -3
- package/cjs/highlevel/methods/files/upload-file.js +24 -11
- package/cjs/highlevel/methods/files/upload-file.js.map +1 -1
- package/cjs/highlevel/methods/messages/find-in-update.js +23 -8
- package/cjs/highlevel/methods/messages/find-in-update.js.map +1 -1
- package/cjs/highlevel/methods/messages/send-media-group.d.ts +1 -1
- package/cjs/highlevel/methods/messages/send-media-group.js.map +1 -1
- package/cjs/highlevel/methods/messages/send-media.d.ts +2 -2
- package/cjs/highlevel/methods/messages/send-media.js +5 -4
- package/cjs/highlevel/methods/messages/send-media.js.map +1 -1
- package/cjs/highlevel/methods/messages/send-text.d.ts +1 -1
- package/cjs/highlevel/methods/messages/send-text.js +7 -6
- package/cjs/highlevel/methods/messages/send-text.js.map +1 -1
- package/cjs/highlevel/methods/misc/with-params.d.ts +10 -0
- package/cjs/highlevel/methods/misc/with-params.js +32 -0
- package/cjs/highlevel/methods/misc/with-params.js.map +1 -0
- package/cjs/highlevel/methods.d.ts +13 -1
- package/cjs/highlevel/methods.js +4 -6
- package/cjs/highlevel/methods.js.map +1 -1
- package/cjs/highlevel/types/bots/command-scope/index.d.ts +10 -0
- package/cjs/highlevel/types/bots/command-scope/index.js +29 -0
- package/cjs/highlevel/types/bots/command-scope/index.js.map +1 -0
- package/cjs/highlevel/types/bots/command-scope/inner.d.ts +54 -0
- package/cjs/highlevel/types/bots/command-scope/inner.js +76 -0
- package/cjs/highlevel/types/bots/command-scope/inner.js.map +1 -0
- package/cjs/highlevel/types/bots/index.d.ts +4 -4
- package/cjs/highlevel/types/bots/index.js +4 -4
- package/cjs/highlevel/types/bots/index.js.map +1 -1
- package/cjs/highlevel/types/bots/inline-message/factories.d.ts +43 -0
- package/cjs/highlevel/types/bots/inline-message/factories.js +175 -0
- package/cjs/highlevel/types/bots/inline-message/factories.js.map +1 -0
- package/cjs/highlevel/types/bots/inline-message/index.d.ts +3 -0
- package/cjs/highlevel/types/bots/inline-message/index.js +33 -0
- package/cjs/highlevel/types/bots/inline-message/index.js.map +1 -0
- package/{esm/highlevel/types/bots/input/input-inline-message.d.ts → cjs/highlevel/types/bots/inline-message/types.d.ts} +2 -45
- package/cjs/highlevel/types/bots/inline-message/types.js +3 -0
- package/cjs/highlevel/types/bots/inline-message/types.js.map +1 -0
- package/cjs/highlevel/types/bots/inline-result/factories.d.ts +94 -0
- package/cjs/highlevel/types/bots/inline-result/factories.js +486 -0
- package/cjs/highlevel/types/bots/inline-result/factories.js.map +1 -0
- package/cjs/highlevel/types/bots/inline-result/index.d.ts +3 -0
- package/cjs/highlevel/types/bots/inline-result/index.js +33 -0
- package/cjs/highlevel/types/bots/inline-result/index.js.map +1 -0
- package/{esm/highlevel/types/bots/input/input-inline-result.d.ts → cjs/highlevel/types/bots/inline-result/types.d.ts} +1 -95
- package/cjs/highlevel/types/bots/inline-result/types.js +3 -0
- package/cjs/highlevel/types/bots/inline-result/types.js.map +1 -0
- package/cjs/highlevel/types/bots/{keyboard-builder.d.ts → keyboards/builder.d.ts} +1 -1
- package/cjs/highlevel/types/bots/{keyboard-builder.js → keyboards/builder.js} +1 -1
- package/cjs/highlevel/types/bots/keyboards/builder.js.map +1 -0
- package/cjs/highlevel/types/bots/keyboards/factories.d.ts +195 -0
- package/cjs/highlevel/types/bots/keyboards/factories.js +366 -0
- package/cjs/highlevel/types/bots/keyboards/factories.js.map +1 -0
- package/cjs/highlevel/types/bots/keyboards/index.d.ts +14 -0
- package/cjs/highlevel/types/bots/keyboards/index.js +33 -0
- package/cjs/highlevel/types/bots/keyboards/index.js.map +1 -0
- package/cjs/highlevel/types/bots/keyboards/types.d.ts +34 -0
- package/cjs/highlevel/types/bots/keyboards/types.js +3 -0
- package/cjs/highlevel/types/bots/keyboards/types.js.map +1 -0
- package/cjs/highlevel/types/files/utils.d.ts +9 -6
- package/cjs/highlevel/types/files/utils.js.map +1 -1
- package/cjs/highlevel/types/media/document.js +3 -2
- package/cjs/highlevel/types/media/document.js.map +1 -1
- package/cjs/highlevel/types/media/index.d.ts +1 -1
- package/cjs/highlevel/types/media/index.js +1 -1
- package/cjs/highlevel/types/media/index.js.map +1 -1
- package/cjs/highlevel/types/media/input-media/factories.d.ts +141 -0
- package/cjs/highlevel/types/media/input-media/factories.js +250 -0
- package/cjs/highlevel/types/media/input-media/factories.js.map +1 -0
- package/cjs/highlevel/types/media/input-media/index.d.ts +3 -0
- package/cjs/highlevel/types/media/input-media/index.js +33 -0
- package/cjs/highlevel/types/media/input-media/index.js.map +1 -0
- package/cjs/highlevel/types/media/{input-media.d.ts → input-media/types.d.ts} +5 -145
- package/cjs/highlevel/types/media/input-media/types.js +3 -0
- package/cjs/highlevel/types/media/input-media/types.js.map +1 -0
- package/cjs/highlevel/types/media/thumbnail.js +5 -4
- package/cjs/highlevel/types/media/thumbnail.js.map +1 -1
- package/cjs/highlevel/types/messages/message.d.ts +1 -1
- package/cjs/highlevel/types/messages/message.js +3 -3
- package/cjs/highlevel/types/messages/message.js.map +1 -1
- package/cjs/highlevel/types/misc/index.d.ts +1 -1
- package/cjs/highlevel/types/misc/index.js +1 -1
- package/cjs/highlevel/types/misc/index.js.map +1 -1
- package/cjs/highlevel/types/misc/input-privacy-rule/allow.d.ts +22 -0
- package/cjs/highlevel/types/misc/input-privacy-rule/allow.js +36 -0
- package/cjs/highlevel/types/misc/input-privacy-rule/allow.js.map +1 -0
- package/cjs/highlevel/types/misc/input-privacy-rule/bundle.d.ts +3 -0
- package/cjs/highlevel/types/misc/input-privacy-rule/bundle.js +31 -0
- package/cjs/highlevel/types/misc/input-privacy-rule/bundle.js.map +1 -0
- package/cjs/highlevel/types/misc/input-privacy-rule/disallow.d.ts +20 -0
- package/cjs/highlevel/types/misc/input-privacy-rule/disallow.js +32 -0
- package/cjs/highlevel/types/misc/input-privacy-rule/disallow.js.map +1 -0
- package/cjs/highlevel/types/misc/input-privacy-rule/index.d.ts +3 -0
- package/cjs/highlevel/types/misc/input-privacy-rule/index.js +33 -0
- package/cjs/highlevel/types/misc/input-privacy-rule/index.js.map +1 -0
- package/cjs/highlevel/types/misc/input-privacy-rule/types.d.ts +11 -0
- package/cjs/highlevel/types/misc/input-privacy-rule/types.js +3 -0
- package/cjs/highlevel/types/misc/input-privacy-rule/types.js.map +1 -0
- package/cjs/highlevel/types/peers/chat-photo.js +3 -2
- package/cjs/highlevel/types/peers/chat-photo.js.map +1 -1
- package/cjs/highlevel/types/updates/callback-query.js +2 -2
- package/cjs/highlevel/types/updates/callback-query.js.map +1 -1
- package/cjs/highlevel/types/updates/user-status-update.js +1 -1
- package/cjs/highlevel/types/updates/user-status-update.js.map +1 -1
- package/cjs/highlevel/updates/manager.d.ts +5 -3
- package/cjs/highlevel/updates/manager.js +81 -67
- package/cjs/highlevel/updates/manager.js.map +1 -1
- package/cjs/highlevel/utils/convert-file-id.js +7 -6
- package/cjs/highlevel/utils/convert-file-id.js.map +1 -1
- package/cjs/highlevel/utils/file-utils.js +8 -4
- package/cjs/highlevel/utils/file-utils.js.map +1 -1
- package/cjs/highlevel/utils/inline-utils.js +3 -2
- package/cjs/highlevel/utils/inline-utils.js.map +1 -1
- package/cjs/highlevel/utils/inspectable.d.ts +1 -1
- package/cjs/highlevel/utils/inspectable.js +3 -2
- package/cjs/highlevel/utils/inspectable.js.map +1 -1
- package/cjs/highlevel/utils/memoize.d.ts +1 -1
- package/cjs/highlevel/utils/memoize.js +1 -0
- package/cjs/highlevel/utils/memoize.js.map +1 -1
- package/cjs/highlevel/utils/stream-utils.d.ts +0 -2
- package/cjs/highlevel/utils/stream-utils.js +1 -28
- package/cjs/highlevel/utils/stream-utils.js.map +1 -1
- package/cjs/highlevel/utils/string-session.js +3 -2
- package/cjs/highlevel/utils/string-session.js.map +1 -1
- package/cjs/highlevel/worker/index.d.ts +3 -0
- package/cjs/highlevel/{types/bots/input → worker}/index.js +3 -2
- package/cjs/highlevel/worker/index.js.map +1 -0
- package/cjs/highlevel/worker/port.d.ts +6 -3
- package/cjs/highlevel/worker/port.js +8 -2
- package/cjs/highlevel/worker/port.js.map +1 -1
- package/cjs/highlevel/worker/protocol.d.ts +5 -1
- package/cjs/highlevel/worker/protocol.js.map +1 -1
- package/cjs/highlevel/worker/worker.d.ts +11 -4
- package/cjs/highlevel/worker/worker.js +53 -49
- package/cjs/highlevel/worker/worker.js.map +1 -1
- package/cjs/network/client.d.ts +4 -4
- package/cjs/network/client.js +3 -1
- package/cjs/network/client.js.map +1 -1
- package/cjs/network/multi-session-connection.d.ts +1 -0
- package/cjs/network/multi-session-connection.js +6 -0
- package/cjs/network/multi-session-connection.js.map +1 -1
- package/cjs/network/network-manager.d.ts +5 -1
- package/cjs/network/network-manager.js +24 -15
- package/cjs/network/network-manager.js.map +1 -1
- package/cjs/network/persistent-connection.d.ts +3 -0
- package/cjs/network/persistent-connection.js +23 -1
- package/cjs/network/persistent-connection.js.map +1 -1
- package/cjs/network/session-connection.d.ts +2 -0
- package/cjs/network/session-connection.js +18 -4
- package/cjs/network/session-connection.js.map +1 -1
- package/cjs/network/transports/index.d.ts +0 -3
- package/cjs/network/transports/index.js +0 -4
- package/cjs/network/transports/index.js.map +1 -1
- package/cjs/platform.d.ts +18 -0
- package/cjs/platform.js +36 -0
- package/cjs/platform.js.map +1 -0
- package/cjs/storage/index.d.ts +2 -2
- package/cjs/storage/index.js +2 -2
- package/cjs/storage/index.js.map +1 -1
- package/{esm/storage/providers → cjs/storage}/memory/driver.d.ts +1 -1
- package/cjs/storage/memory/driver.js.map +1 -0
- package/{esm/storage/providers → cjs/storage}/memory/index.d.ts +2 -2
- package/cjs/storage/memory/index.js.map +1 -0
- package/cjs/storage/{providers/memory → memory}/repository/auth-keys.d.ts +1 -1
- package/cjs/storage/memory/repository/auth-keys.js.map +1 -0
- package/{esm/storage/providers → cjs/storage}/memory/repository/kv.d.ts +1 -1
- package/cjs/storage/memory/repository/kv.js.map +1 -0
- package/{esm/storage/providers → cjs/storage}/memory/repository/peers.d.ts +1 -1
- package/cjs/storage/memory/repository/peers.js.map +1 -0
- package/{esm/storage/providers → cjs/storage}/memory/repository/ref-messages.d.ts +1 -1
- package/cjs/storage/memory/repository/ref-messages.js.map +1 -0
- package/cjs/storage/sqlite/driver.d.ts +24 -0
- package/cjs/storage/sqlite/driver.js +129 -0
- package/cjs/storage/sqlite/driver.js.map +1 -0
- package/cjs/storage/sqlite/index.d.ts +17 -0
- package/cjs/storage/sqlite/index.js +35 -0
- package/cjs/storage/sqlite/index.js.map +1 -0
- package/cjs/storage/sqlite/repository/auth-keys.d.ts +20 -0
- package/cjs/storage/sqlite/repository/auth-keys.js +68 -0
- package/cjs/storage/sqlite/repository/auth-keys.js.map +1 -0
- package/cjs/storage/sqlite/repository/kv.d.ts +14 -0
- package/cjs/storage/sqlite/repository/kv.js +96 -0
- package/cjs/storage/sqlite/repository/kv.js.map +1 -0
- package/cjs/storage/sqlite/repository/peers.d.ts +16 -0
- package/cjs/storage/sqlite/repository/peers.js +77 -0
- package/cjs/storage/sqlite/repository/peers.js.map +1 -0
- package/cjs/storage/sqlite/repository/ref-messages.d.ts +16 -0
- package/cjs/storage/sqlite/repository/ref-messages.js +49 -0
- package/cjs/storage/sqlite/repository/ref-messages.js.map +1 -0
- package/cjs/storage/sqlite/types.d.ts +18 -0
- package/cjs/storage/sqlite/types.js +3 -0
- package/cjs/storage/sqlite/types.js.map +1 -0
- package/cjs/storage/storage.js +2 -1
- package/cjs/storage/storage.js.map +1 -1
- package/cjs/utils/binary/asn1-parser.js +3 -3
- package/cjs/utils/binary/asn1-parser.js.map +1 -1
- package/cjs/utils/crypto/abstract.d.ts +0 -1
- package/cjs/utils/crypto/abstract.js.map +1 -1
- package/cjs/utils/crypto/index.d.ts +0 -2
- package/cjs/utils/crypto/index.js +0 -3
- package/cjs/utils/crypto/index.js.map +1 -1
- package/cjs/utils/crypto/keys.js +5 -3
- package/cjs/utils/crypto/keys.js.map +1 -1
- package/cjs/utils/crypto/password.js +3 -3
- package/cjs/utils/crypto/password.js.map +1 -1
- package/cjs/utils/dcs.d.ts +4 -0
- package/cjs/utils/dcs.js +0 -4
- package/cjs/utils/dcs.js.map +1 -1
- package/cjs/utils/{platform/error-reporting.d.ts → error-reporting.d.ts} +1 -1
- package/cjs/utils/error-reporting.js.map +1 -0
- package/cjs/utils/index.d.ts +4 -1
- package/cjs/utils/index.js +6 -1
- package/cjs/utils/index.js.map +1 -1
- package/cjs/utils/links/common.js +1 -1
- package/cjs/utils/links/common.js.map +1 -1
- package/cjs/utils/logger.d.ts +1 -0
- package/cjs/utils/logger.js +9 -22
- package/cjs/utils/logger.js.map +1 -1
- package/esm/highlevel/base.d.ts +3 -1
- package/esm/highlevel/base.js +18 -0
- package/esm/highlevel/base.js.map +1 -1
- package/esm/highlevel/client.d.ts +23 -10
- package/esm/highlevel/client.js +12 -19
- package/esm/highlevel/client.js.map +1 -1
- package/esm/highlevel/client.types.d.ts +14 -0
- package/esm/highlevel/client.types.js.map +1 -1
- package/esm/highlevel/index.d.ts +0 -2
- package/esm/highlevel/index.js +0 -2
- package/esm/highlevel/index.js.map +1 -1
- package/esm/highlevel/methods/_imports.js.map +1 -1
- package/esm/highlevel/methods/_init.js +4 -29
- package/esm/highlevel/methods/_init.js.map +1 -1
- package/esm/highlevel/methods/bots/get-callback-answer.js +2 -2
- package/esm/highlevel/methods/bots/get-callback-answer.js.map +1 -1
- package/esm/highlevel/methods/dialogs/create-folder.js +1 -1
- package/esm/highlevel/methods/dialogs/create-folder.js.map +1 -1
- package/esm/highlevel/methods/dialogs/edit-folder.js +1 -1
- package/esm/highlevel/methods/dialogs/edit-folder.js.map +1 -1
- package/esm/highlevel/methods/dialogs/find-folder.js +1 -1
- package/esm/highlevel/methods/dialogs/find-folder.js.map +1 -1
- package/esm/highlevel/methods/dialogs/get-folders.d.ts +1 -1
- package/esm/highlevel/methods/dialogs/get-folders.js +1 -1
- package/esm/highlevel/methods/dialogs/get-folders.js.map +1 -1
- package/esm/highlevel/methods/files/download-file.d.ts +1 -10
- package/esm/highlevel/methods/files/download-file.js +2 -30
- package/esm/highlevel/methods/files/download-file.js.map +1 -1
- package/esm/highlevel/methods/files/download-iterable.js +2 -1
- package/esm/highlevel/methods/files/download-iterable.js.map +1 -1
- package/esm/highlevel/methods/files/download-node-stream.js +3 -0
- package/esm/highlevel/methods/files/download-node-stream.js.map +1 -0
- package/esm/highlevel/methods/files/normalize-input-media.d.ts +1 -1
- package/esm/highlevel/methods/files/normalize-input-media.js +2 -1
- package/esm/highlevel/methods/files/normalize-input-media.js.map +1 -1
- package/esm/highlevel/methods/files/upload-file.d.ts +0 -3
- package/esm/highlevel/methods/files/upload-file.js +24 -11
- package/esm/highlevel/methods/files/upload-file.js.map +1 -1
- package/esm/highlevel/methods/messages/find-in-update.js +23 -8
- package/esm/highlevel/methods/messages/find-in-update.js.map +1 -1
- package/esm/highlevel/methods/messages/send-media-group.d.ts +1 -1
- package/esm/highlevel/methods/messages/send-media-group.js.map +1 -1
- package/esm/highlevel/methods/messages/send-media.d.ts +2 -2
- package/esm/highlevel/methods/messages/send-media.js +4 -3
- package/esm/highlevel/methods/messages/send-media.js.map +1 -1
- package/esm/highlevel/methods/messages/send-text.d.ts +1 -1
- package/esm/highlevel/methods/messages/send-text.js +4 -3
- package/esm/highlevel/methods/messages/send-text.js.map +1 -1
- package/esm/highlevel/methods/misc/with-params.d.ts +10 -0
- package/esm/highlevel/methods/misc/with-params.js +28 -0
- package/esm/highlevel/methods/misc/with-params.js.map +1 -0
- package/esm/highlevel/methods.d.ts +13 -1
- package/esm/highlevel/methods.js +0 -1
- package/esm/highlevel/methods.js.map +1 -1
- package/esm/highlevel/types/auth/sent-code.js +4 -3
- package/esm/highlevel/types/bots/command-scope/index.d.ts +10 -0
- package/esm/highlevel/types/bots/command-scope/index.js +11 -0
- package/esm/highlevel/types/bots/command-scope/index.js.map +1 -0
- package/esm/highlevel/types/bots/command-scope/inner.d.ts +54 -0
- package/esm/highlevel/types/bots/command-scope/inner.js +69 -0
- package/esm/highlevel/types/bots/command-scope/inner.js.map +1 -0
- package/esm/highlevel/types/bots/game-high-score.js +5 -4
- package/esm/highlevel/types/bots/index.d.ts +4 -4
- package/esm/highlevel/types/bots/index.js +4 -4
- package/esm/highlevel/types/bots/index.js.map +1 -1
- package/esm/highlevel/types/bots/inline-message/factories.d.ts +43 -0
- package/esm/highlevel/types/bots/inline-message/factories.js +163 -0
- package/esm/highlevel/types/bots/inline-message/factories.js.map +1 -0
- package/esm/highlevel/types/bots/inline-message/index.d.ts +3 -0
- package/esm/highlevel/types/bots/inline-message/index.js +4 -0
- package/esm/highlevel/types/bots/inline-message/index.js.map +1 -0
- package/{cjs/highlevel/types/bots/input/input-inline-message.d.ts → esm/highlevel/types/bots/inline-message/types.d.ts} +2 -45
- package/esm/highlevel/types/bots/inline-message/types.js +2 -0
- package/esm/highlevel/types/bots/inline-message/types.js.map +1 -0
- package/esm/highlevel/types/bots/inline-result/factories.d.ts +94 -0
- package/esm/highlevel/types/bots/inline-result/factories.js +470 -0
- package/esm/highlevel/types/bots/inline-result/factories.js.map +1 -0
- package/esm/highlevel/types/bots/inline-result/index.d.ts +3 -0
- package/esm/highlevel/types/bots/inline-result/index.js +4 -0
- package/esm/highlevel/types/bots/inline-result/index.js.map +1 -0
- package/{cjs/highlevel/types/bots/input/input-inline-result.d.ts → esm/highlevel/types/bots/inline-result/types.d.ts} +1 -95
- package/esm/highlevel/types/bots/inline-result/types.js +2 -0
- package/esm/highlevel/types/bots/inline-result/types.js.map +1 -0
- package/esm/highlevel/types/bots/{keyboard-builder.d.ts → keyboards/builder.d.ts} +1 -1
- package/esm/highlevel/types/bots/{keyboard-builder.js → keyboards/builder.js} +1 -1
- package/esm/highlevel/types/bots/keyboards/builder.js.map +1 -0
- package/esm/highlevel/types/bots/keyboards/factories.d.ts +195 -0
- package/esm/highlevel/types/bots/keyboards/factories.js +341 -0
- package/esm/highlevel/types/bots/keyboards/factories.js.map +1 -0
- package/esm/highlevel/types/bots/keyboards/index.d.ts +14 -0
- package/esm/highlevel/types/bots/keyboards/index.js +15 -0
- package/esm/highlevel/types/bots/keyboards/index.js.map +1 -0
- package/esm/highlevel/types/bots/keyboards/types.d.ts +34 -0
- package/esm/highlevel/types/bots/keyboards/types.js +2 -0
- package/esm/highlevel/types/bots/keyboards/types.js.map +1 -0
- package/esm/highlevel/types/files/file-location.js +4 -3
- package/esm/highlevel/types/files/utils.d.ts +9 -6
- package/esm/highlevel/types/files/utils.js.map +1 -1
- package/esm/highlevel/types/files/web-document.js +4 -3
- package/esm/highlevel/types/media/audio.js +5 -4
- package/esm/highlevel/types/media/contact.js +4 -3
- package/esm/highlevel/types/media/dice.js +4 -3
- package/esm/highlevel/types/media/document.js +8 -6
- package/esm/highlevel/types/media/document.js.map +1 -1
- package/esm/highlevel/types/media/game.js +5 -4
- package/esm/highlevel/types/media/index.d.ts +1 -1
- package/esm/highlevel/types/media/index.js +1 -1
- package/esm/highlevel/types/media/index.js.map +1 -1
- package/esm/highlevel/types/media/input-media/factories.d.ts +141 -0
- package/esm/highlevel/types/media/input-media/factories.js +228 -0
- package/esm/highlevel/types/media/input-media/factories.js.map +1 -0
- package/esm/highlevel/types/media/input-media/index.d.ts +3 -0
- package/esm/highlevel/types/media/input-media/index.js +4 -0
- package/esm/highlevel/types/media/input-media/index.js.map +1 -0
- package/esm/highlevel/types/media/{input-media.d.ts → input-media/types.d.ts} +5 -145
- package/esm/highlevel/types/media/input-media/types.js +2 -0
- package/esm/highlevel/types/media/input-media/types.js.map +1 -0
- package/esm/highlevel/types/media/invoice.js +9 -7
- package/esm/highlevel/types/media/location.js +7 -5
- package/esm/highlevel/types/media/photo.js +5 -4
- package/esm/highlevel/types/media/poll.js +5 -4
- package/esm/highlevel/types/media/sticker.js +5 -4
- package/esm/highlevel/types/media/story.js +4 -3
- package/esm/highlevel/types/media/thumbnail.js +10 -8
- package/esm/highlevel/types/media/thumbnail.js.map +1 -1
- package/esm/highlevel/types/media/venue.js +5 -4
- package/esm/highlevel/types/media/video.js +5 -4
- package/esm/highlevel/types/media/voice.js +5 -4
- package/esm/highlevel/types/media/web-page.js +5 -4
- package/esm/highlevel/types/messages/dialog.js +5 -4
- package/esm/highlevel/types/messages/draft-message.js +5 -4
- package/esm/highlevel/types/messages/message-entity.js +5 -4
- package/esm/highlevel/types/messages/message-forward.js +5 -4
- package/esm/highlevel/types/messages/message-reactions.js +5 -4
- package/esm/highlevel/types/messages/message-replies.js +5 -4
- package/esm/highlevel/types/messages/message.d.ts +1 -1
- package/esm/highlevel/types/messages/message.js +6 -5
- package/esm/highlevel/types/messages/message.js.map +1 -1
- package/esm/highlevel/types/messages/replied-message.js +5 -4
- package/esm/highlevel/types/misc/index.d.ts +1 -1
- package/esm/highlevel/types/misc/index.js +1 -1
- package/esm/highlevel/types/misc/index.js.map +1 -1
- package/esm/highlevel/types/misc/input-privacy-rule/allow.d.ts +22 -0
- package/esm/highlevel/types/misc/input-privacy-rule/allow.js +31 -0
- package/esm/highlevel/types/misc/input-privacy-rule/allow.js.map +1 -0
- package/esm/highlevel/types/misc/input-privacy-rule/bundle.d.ts +3 -0
- package/esm/highlevel/types/misc/input-privacy-rule/bundle.js +4 -0
- package/esm/highlevel/types/misc/input-privacy-rule/bundle.js.map +1 -0
- package/esm/highlevel/types/misc/input-privacy-rule/disallow.d.ts +20 -0
- package/esm/highlevel/types/misc/input-privacy-rule/disallow.js +27 -0
- package/esm/highlevel/types/misc/input-privacy-rule/disallow.js.map +1 -0
- package/esm/highlevel/types/misc/input-privacy-rule/index.d.ts +3 -0
- package/esm/highlevel/types/misc/input-privacy-rule/index.js +4 -0
- package/esm/highlevel/types/misc/input-privacy-rule/index.js.map +1 -0
- package/esm/highlevel/types/misc/input-privacy-rule/types.d.ts +11 -0
- package/esm/highlevel/types/misc/input-privacy-rule/types.js +2 -0
- package/esm/highlevel/types/misc/input-privacy-rule/types.js.map +1 -0
- package/esm/highlevel/types/misc/sticker-set.js +5 -4
- package/esm/highlevel/types/misc/takeout-session.js +4 -3
- package/esm/highlevel/types/peers/chat-colors.js +4 -3
- package/esm/highlevel/types/peers/chat-event/index.js +5 -4
- package/esm/highlevel/types/peers/chat-invite-link-member.js +5 -4
- package/esm/highlevel/types/peers/chat-invite-link.js +5 -4
- package/esm/highlevel/types/peers/chat-location.js +5 -4
- package/esm/highlevel/types/peers/chat-member.js +5 -4
- package/esm/highlevel/types/peers/chat-permissions.js +4 -3
- package/esm/highlevel/types/peers/chat-photo.js +12 -9
- package/esm/highlevel/types/peers/chat-photo.js.map +1 -1
- package/esm/highlevel/types/peers/chat-preview.js +5 -4
- package/esm/highlevel/types/peers/chat.js +5 -4
- package/esm/highlevel/types/peers/forum-topic.js +5 -4
- package/esm/highlevel/types/peers/user.js +5 -4
- package/esm/highlevel/types/premium/boost-slot.js +5 -4
- package/esm/highlevel/types/premium/boost-stats.js +4 -3
- package/esm/highlevel/types/premium/boost.js +5 -4
- package/esm/highlevel/types/reactions/emoji-status.js +4 -3
- package/esm/highlevel/types/reactions/peer-reaction.js +5 -4
- package/esm/highlevel/types/reactions/reaction-count.js +4 -3
- package/esm/highlevel/types/stories/all-stories.js +5 -4
- package/esm/highlevel/types/stories/interactive/channel-post.js +5 -4
- package/esm/highlevel/types/stories/interactive/location.js +5 -4
- package/esm/highlevel/types/stories/interactive/reaction.js +4 -3
- package/esm/highlevel/types/stories/interactive/venue.js +5 -4
- package/esm/highlevel/types/stories/peer-stories.js +5 -4
- package/esm/highlevel/types/stories/stealth-mode.js +4 -3
- package/esm/highlevel/types/stories/story-interactions.js +5 -4
- package/esm/highlevel/types/stories/story-viewer.js +9 -7
- package/esm/highlevel/types/stories/story.js +5 -4
- package/esm/highlevel/types/updates/bot-chat-join-request.js +5 -4
- package/esm/highlevel/types/updates/bot-reaction.js +9 -7
- package/esm/highlevel/types/updates/bot-stopped.js +5 -4
- package/esm/highlevel/types/updates/callback-query.js +11 -9
- package/esm/highlevel/types/updates/callback-query.js.map +1 -1
- package/esm/highlevel/types/updates/chat-join-request.js +5 -4
- package/esm/highlevel/types/updates/chat-member-update.js +5 -4
- package/esm/highlevel/types/updates/chosen-inline-result.js +5 -4
- package/esm/highlevel/types/updates/delete-message-update.js +4 -3
- package/esm/highlevel/types/updates/delete-story-update.js +5 -4
- package/esm/highlevel/types/updates/history-read-update.js +4 -3
- package/esm/highlevel/types/updates/inline-query.js +5 -4
- package/esm/highlevel/types/updates/poll-update.js +5 -4
- package/esm/highlevel/types/updates/poll-vote.js +5 -4
- package/esm/highlevel/types/updates/pre-checkout-query.js +5 -4
- package/esm/highlevel/types/updates/story-update.js +5 -4
- package/esm/highlevel/types/updates/user-status-update.js +5 -4
- package/esm/highlevel/types/updates/user-status-update.js.map +1 -1
- package/esm/highlevel/types/updates/user-typing-update.js +4 -3
- package/esm/highlevel/updates/manager.d.ts +5 -3
- package/esm/highlevel/updates/manager.js +81 -67
- package/esm/highlevel/updates/manager.js.map +1 -1
- package/esm/highlevel/utils/convert-file-id.js +7 -6
- package/esm/highlevel/utils/convert-file-id.js.map +1 -1
- package/esm/highlevel/utils/file-utils.js +8 -4
- package/esm/highlevel/utils/file-utils.js.map +1 -1
- package/esm/highlevel/utils/inline-utils.js +4 -3
- package/esm/highlevel/utils/inline-utils.js.map +1 -1
- package/esm/highlevel/utils/inspectable.d.ts +1 -1
- package/esm/highlevel/utils/inspectable.js +3 -2
- package/esm/highlevel/utils/inspectable.js.map +1 -1
- package/esm/highlevel/utils/memoize.d.ts +1 -1
- package/esm/highlevel/utils/memoize.js +1 -0
- package/esm/highlevel/utils/memoize.js.map +1 -1
- package/esm/highlevel/utils/stream-utils.d.ts +0 -2
- package/esm/highlevel/utils/stream-utils.js +0 -26
- package/esm/highlevel/utils/stream-utils.js.map +1 -1
- package/esm/highlevel/utils/string-session.js +4 -3
- package/esm/highlevel/utils/string-session.js.map +1 -1
- package/esm/highlevel/worker/index.d.ts +3 -0
- package/esm/highlevel/worker/index.js +4 -0
- package/esm/highlevel/worker/index.js.map +1 -0
- package/esm/highlevel/worker/port.d.ts +6 -3
- package/esm/highlevel/worker/port.js +8 -2
- package/esm/highlevel/worker/port.js.map +1 -1
- package/esm/highlevel/worker/protocol.d.ts +5 -1
- package/esm/highlevel/worker/protocol.js.map +1 -1
- package/esm/highlevel/worker/worker.d.ts +11 -4
- package/esm/highlevel/worker/worker.js +51 -47
- package/esm/highlevel/worker/worker.js.map +1 -1
- package/esm/network/client.d.ts +4 -4
- package/esm/network/client.js +4 -2
- package/esm/network/client.js.map +1 -1
- package/esm/network/multi-session-connection.d.ts +1 -0
- package/esm/network/multi-session-connection.js +6 -0
- package/esm/network/multi-session-connection.js.map +1 -1
- package/esm/network/network-manager.d.ts +5 -1
- package/esm/network/network-manager.js +24 -15
- package/esm/network/network-manager.js.map +1 -1
- package/esm/network/persistent-connection.d.ts +3 -0
- package/esm/network/persistent-connection.js +23 -1
- package/esm/network/persistent-connection.js.map +1 -1
- package/esm/network/session-connection.d.ts +2 -0
- package/esm/network/session-connection.js +18 -4
- package/esm/network/session-connection.js.map +1 -1
- package/esm/network/transports/index.d.ts +0 -3
- package/esm/network/transports/index.js +0 -3
- package/esm/network/transports/index.js.map +1 -1
- package/esm/platform.d.ts +18 -0
- package/esm/platform.js +31 -0
- package/esm/platform.js.map +1 -0
- package/esm/storage/index.d.ts +2 -2
- package/esm/storage/index.js +2 -2
- package/esm/storage/index.js.map +1 -1
- package/{cjs/storage/providers → esm/storage}/memory/driver.d.ts +1 -1
- package/esm/storage/memory/driver.js.map +1 -0
- package/{cjs/storage/providers → esm/storage}/memory/index.d.ts +2 -2
- package/esm/storage/memory/index.js.map +1 -0
- package/esm/storage/{providers/memory → memory}/repository/auth-keys.d.ts +1 -1
- package/esm/storage/memory/repository/auth-keys.js.map +1 -0
- package/{cjs/storage/providers → esm/storage}/memory/repository/kv.d.ts +1 -1
- package/esm/storage/memory/repository/kv.js.map +1 -0
- package/{cjs/storage/providers → esm/storage}/memory/repository/peers.d.ts +1 -1
- package/esm/storage/memory/repository/peers.js.map +1 -0
- package/{cjs/storage/providers → esm/storage}/memory/repository/ref-messages.d.ts +1 -1
- package/esm/storage/memory/repository/ref-messages.js.map +1 -0
- package/esm/storage/sqlite/driver.d.ts +24 -0
- package/esm/storage/sqlite/driver.js +125 -0
- package/esm/storage/sqlite/driver.js.map +1 -0
- package/esm/storage/sqlite/index.d.ts +17 -0
- package/esm/storage/sqlite/index.js +17 -0
- package/esm/storage/sqlite/index.js.map +1 -0
- package/esm/storage/sqlite/repository/auth-keys.d.ts +20 -0
- package/esm/storage/sqlite/repository/auth-keys.js +64 -0
- package/esm/storage/sqlite/repository/auth-keys.js.map +1 -0
- package/esm/storage/sqlite/repository/kv.d.ts +14 -0
- package/esm/storage/sqlite/repository/kv.js +92 -0
- package/esm/storage/sqlite/repository/kv.js.map +1 -0
- package/esm/storage/sqlite/repository/peers.d.ts +16 -0
- package/esm/storage/sqlite/repository/peers.js +73 -0
- package/esm/storage/sqlite/repository/peers.js.map +1 -0
- package/esm/storage/sqlite/repository/ref-messages.d.ts +16 -0
- package/esm/storage/sqlite/repository/ref-messages.js +45 -0
- package/esm/storage/sqlite/repository/ref-messages.js.map +1 -0
- package/esm/storage/sqlite/types.d.ts +18 -0
- package/esm/storage/sqlite/types.js +2 -0
- package/esm/storage/sqlite/types.js.map +1 -0
- package/esm/storage/storage.js +3 -2
- package/esm/storage/storage.js.map +1 -1
- package/esm/utils/binary/asn1-parser.js +3 -3
- package/esm/utils/binary/asn1-parser.js.map +1 -1
- package/esm/utils/crypto/abstract.d.ts +0 -1
- package/esm/utils/crypto/abstract.js.map +1 -1
- package/esm/utils/crypto/index.d.ts +0 -2
- package/esm/utils/crypto/index.js +0 -2
- package/esm/utils/crypto/index.js.map +1 -1
- package/esm/utils/crypto/keys.js +6 -4
- package/esm/utils/crypto/keys.js.map +1 -1
- package/esm/utils/crypto/password.js +3 -3
- package/esm/utils/crypto/password.js.map +1 -1
- package/esm/utils/dcs.d.ts +4 -0
- package/esm/utils/dcs.js +0 -4
- package/esm/utils/dcs.js.map +1 -1
- package/esm/utils/{platform/error-reporting.d.ts → error-reporting.d.ts} +1 -1
- package/esm/utils/error-reporting.js.map +1 -0
- package/esm/utils/index.d.ts +4 -1
- package/esm/utils/index.js +6 -1
- package/esm/utils/index.js.map +1 -1
- package/esm/utils/links/common.js +1 -1
- package/esm/utils/links/common.js.map +1 -1
- package/esm/utils/logger.d.ts +1 -0
- package/esm/utils/logger.js +9 -22
- package/esm/utils/logger.js.map +1 -1
- package/package.json +25 -53
- package/cjs/highlevel/base.test.js +0 -14
- package/cjs/highlevel/base.test.js.map +0 -1
- package/cjs/highlevel/methods/files/_platform.js +0 -33
- package/cjs/highlevel/methods/files/_platform.js.map +0 -1
- package/cjs/highlevel/methods/files/_platform.web.d.ts +0 -1
- package/cjs/highlevel/methods/files/_platform.web.js +0 -26
- package/cjs/highlevel/methods/files/_platform.web.js.map +0 -1
- package/cjs/highlevel/methods/files/download-file.web.d.ts +0 -1
- package/cjs/highlevel/methods/files/download-file.web.js +0 -9
- package/cjs/highlevel/methods/files/download-file.web.js.map +0 -1
- package/cjs/highlevel/methods/messages/send-text.test.d.ts +0 -1
- package/cjs/highlevel/methods/messages/send-text.test.js +0 -140
- package/cjs/highlevel/methods/messages/send-text.test.js.map +0 -1
- package/cjs/highlevel/methods/users/get-users.test.d.ts +0 -1
- package/cjs/highlevel/methods/users/get-users.test.js +0 -33
- package/cjs/highlevel/methods/users/get-users.test.js.map +0 -1
- package/cjs/highlevel/methods/users/resolve-peer.test.d.ts +0 -1
- package/cjs/highlevel/methods/users/resolve-peer.test.js +0 -307
- package/cjs/highlevel/methods/users/resolve-peer.test.js.map +0 -1
- package/cjs/highlevel/types/bots/command-scope.d.ts +0 -63
- package/cjs/highlevel/types/bots/command-scope.js +0 -87
- package/cjs/highlevel/types/bots/command-scope.js.map +0 -1
- package/cjs/highlevel/types/bots/input/index.d.ts +0 -2
- package/cjs/highlevel/types/bots/input/index.js.map +0 -1
- package/cjs/highlevel/types/bots/input/input-inline-message.js +0 -179
- package/cjs/highlevel/types/bots/input/input-inline-message.js.map +0 -1
- package/cjs/highlevel/types/bots/input/input-inline-result.js +0 -490
- package/cjs/highlevel/types/bots/input/input-inline-result.js.map +0 -1
- package/cjs/highlevel/types/bots/keyboard-builder.js.map +0 -1
- package/cjs/highlevel/types/bots/keyboard-builder.test.d.ts +0 -1
- package/cjs/highlevel/types/bots/keyboard-builder.test.js +0 -162
- package/cjs/highlevel/types/bots/keyboard-builder.test.js.map +0 -1
- package/cjs/highlevel/types/bots/keyboards.d.ts +0 -239
- package/cjs/highlevel/types/bots/keyboards.js +0 -380
- package/cjs/highlevel/types/bots/keyboards.js.map +0 -1
- package/cjs/highlevel/types/bots/keyboards.test.d.ts +0 -1
- package/cjs/highlevel/types/bots/keyboards.test.js +0 -146
- package/cjs/highlevel/types/bots/keyboards.test.js.map +0 -1
- package/cjs/highlevel/types/media/input-media.js +0 -254
- package/cjs/highlevel/types/media/input-media.js.map +0 -1
- package/cjs/highlevel/types/misc/input-privacy-rule.d.ts +0 -63
- package/cjs/highlevel/types/misc/input-privacy-rule.js +0 -85
- package/cjs/highlevel/types/misc/input-privacy-rule.js.map +0 -1
- package/cjs/highlevel/types/peers/peers-index.test.d.ts +0 -1
- package/cjs/highlevel/types/peers/peers-index.test.js +0 -71
- package/cjs/highlevel/types/peers/peers-index.test.js.map +0 -1
- package/cjs/highlevel/types/peers/user.test.d.ts +0 -1
- package/cjs/highlevel/types/peers/user.test.js +0 -176
- package/cjs/highlevel/types/peers/user.test.js.map +0 -1
- package/cjs/highlevel/utils/file-type.test.d.ts +0 -1
- package/cjs/highlevel/utils/file-type.test.js +0 -64
- package/cjs/highlevel/utils/file-type.test.js.map +0 -1
- package/cjs/highlevel/utils/file-utils.test.d.ts +0 -1
- package/cjs/highlevel/utils/file-utils.test.js +0 -126
- package/cjs/highlevel/utils/file-utils.test.js.map +0 -1
- package/cjs/highlevel/utils/inline-utils.test.d.ts +0 -1
- package/cjs/highlevel/utils/inline-utils.test.js +0 -47
- package/cjs/highlevel/utils/inline-utils.test.js.map +0 -1
- package/cjs/highlevel/utils/inspectable.test.d.ts +0 -1
- package/cjs/highlevel/utils/inspectable.test.js +0 -97
- package/cjs/highlevel/utils/inspectable.test.js.map +0 -1
- package/cjs/highlevel/utils/memoize.test.d.ts +0 -1
- package/cjs/highlevel/utils/memoize.test.js +0 -60
- package/cjs/highlevel/utils/memoize.test.js.map +0 -1
- package/cjs/highlevel/utils/peer-utils.test.d.ts +0 -1
- package/cjs/highlevel/utils/peer-utils.test.js +0 -109
- package/cjs/highlevel/utils/peer-utils.test.js.map +0 -1
- package/cjs/highlevel/utils/platform/storage.d.ts +0 -1
- package/cjs/highlevel/utils/platform/storage.js +0 -10
- package/cjs/highlevel/utils/platform/storage.js.map +0 -1
- package/cjs/highlevel/utils/platform/storage.web.d.ts +0 -1
- package/cjs/highlevel/utils/platform/storage.web.js +0 -14
- package/cjs/highlevel/utils/platform/storage.web.js.map +0 -1
- package/cjs/highlevel/utils/query-batcher.test.d.ts +0 -1
- package/cjs/highlevel/utils/query-batcher.test.js +0 -502
- package/cjs/highlevel/utils/query-batcher.test.js.map +0 -1
- package/cjs/highlevel/utils/stream-utils.test.d.ts +0 -1
- package/cjs/highlevel/utils/stream-utils.test.js +0 -98
- package/cjs/highlevel/utils/stream-utils.test.js.map +0 -1
- package/cjs/highlevel/utils/string-session.test.d.ts +0 -1
- package/cjs/highlevel/utils/string-session.test.js +0 -198
- package/cjs/highlevel/utils/string-session.test.js.map +0 -1
- package/cjs/highlevel/utils/voice-utils.test.d.ts +0 -1
- package/cjs/highlevel/utils/voice-utils.test.js +0 -28
- package/cjs/highlevel/utils/voice-utils.test.js.map +0 -1
- package/cjs/highlevel/worker/platform/connect.d.ts +0 -2
- package/cjs/highlevel/worker/platform/connect.js +0 -19
- package/cjs/highlevel/worker/platform/connect.js.map +0 -1
- package/cjs/highlevel/worker/platform/connect.web.d.ts +0 -2
- package/cjs/highlevel/worker/platform/connect.web.js +0 -51
- package/cjs/highlevel/worker/platform/connect.web.js.map +0 -1
- package/cjs/highlevel/worker/platform/register.d.ts +0 -2
- package/cjs/highlevel/worker/platform/register.js +0 -20
- package/cjs/highlevel/worker/platform/register.js.map +0 -1
- package/cjs/highlevel/worker/platform/register.web.d.ts +0 -2
- package/cjs/highlevel/worker/platform/register.web.js +0 -64
- package/cjs/highlevel/worker/platform/register.web.js.map +0 -1
- package/cjs/network/auth-key.test.d.ts +0 -1
- package/cjs/network/auth-key.test.js +0 -111
- package/cjs/network/auth-key.test.js.map +0 -1
- package/cjs/network/config-manager.test.d.ts +0 -1
- package/cjs/network/config-manager.test.js +0 -174
- package/cjs/network/config-manager.test.js.map +0 -1
- package/cjs/network/persistent-connection.test.d.ts +0 -1
- package/cjs/network/persistent-connection.test.js +0 -157
- package/cjs/network/persistent-connection.test.js.map +0 -1
- package/cjs/network/transports/intermediate.test.d.ts +0 -1
- package/cjs/network/transports/intermediate.test.js +0 -84
- package/cjs/network/transports/intermediate.test.js.map +0 -1
- package/cjs/network/transports/obfuscated.test.d.ts +0 -1
- package/cjs/network/transports/obfuscated.test.js +0 -131
- package/cjs/network/transports/obfuscated.test.js.map +0 -1
- package/cjs/network/transports/tcp.d.ts +0 -32
- package/cjs/network/transports/tcp.js +0 -130
- package/cjs/network/transports/tcp.js.map +0 -1
- package/cjs/network/transports/tcp.test.d.ts +0 -1
- package/cjs/network/transports/tcp.test.js +0 -103
- package/cjs/network/transports/tcp.test.js.map +0 -1
- package/cjs/network/transports/websocket.d.ts +0 -46
- package/cjs/network/transports/websocket.js +0 -124
- package/cjs/network/transports/websocket.js.map +0 -1
- package/cjs/network/transports/websocket.test.d.ts +0 -1
- package/cjs/network/transports/websocket.test.js +0 -91
- package/cjs/network/transports/websocket.test.js.map +0 -1
- package/cjs/storage/providers/idb/driver.d.ts +0 -18
- package/cjs/storage/providers/idb/driver.js +0 -138
- package/cjs/storage/providers/idb/driver.js.map +0 -1
- package/cjs/storage/providers/idb/idb.test.d.ts +0 -1
- package/cjs/storage/providers/idb/idb.test.js +0 -29
- package/cjs/storage/providers/idb/idb.test.js.map +0 -1
- package/cjs/storage/providers/idb/index.d.ts +0 -22
- package/cjs/storage/providers/idb/index.js +0 -28
- package/cjs/storage/providers/idb/index.js.map +0 -1
- package/cjs/storage/providers/idb/repository/auth-keys.d.ts +0 -14
- package/cjs/storage/providers/idb/repository/auth-keys.js +0 -70
- package/cjs/storage/providers/idb/repository/auth-keys.js.map +0 -1
- package/cjs/storage/providers/idb/repository/kv.d.ts +0 -11
- package/cjs/storage/providers/idb/repository/kv.js +0 -34
- package/cjs/storage/providers/idb/repository/kv.js.map +0 -1
- package/cjs/storage/providers/idb/repository/peers.d.ts +0 -12
- package/cjs/storage/providers/idb/repository/peers.js +0 -38
- package/cjs/storage/providers/idb/repository/peers.js.map +0 -1
- package/cjs/storage/providers/idb/repository/ref-messages.d.ts +0 -12
- package/cjs/storage/providers/idb/repository/ref-messages.js +0 -57
- package/cjs/storage/providers/idb/repository/ref-messages.js.map +0 -1
- package/cjs/storage/providers/idb/utils.d.ts +0 -3
- package/cjs/storage/providers/idb/utils.js +0 -27
- package/cjs/storage/providers/idb/utils.js.map +0 -1
- package/cjs/storage/providers/memory/driver.js.map +0 -1
- package/cjs/storage/providers/memory/index.js.map +0 -1
- package/cjs/storage/providers/memory/memory.test.d.ts +0 -1
- package/cjs/storage/providers/memory/memory.test.js +0 -13
- package/cjs/storage/providers/memory/memory.test.js.map +0 -1
- package/cjs/storage/providers/memory/repository/auth-keys.js.map +0 -1
- package/cjs/storage/providers/memory/repository/kv.js.map +0 -1
- package/cjs/storage/providers/memory/repository/peers.js.map +0 -1
- package/cjs/storage/providers/memory/repository/ref-messages.js.map +0 -1
- package/cjs/storage/service/auth-keys.test.d.ts +0 -1
- package/cjs/storage/service/auth-keys.test.js +0 -22
- package/cjs/storage/service/auth-keys.test.js.map +0 -1
- package/cjs/storage/service/updates.test.d.ts +0 -1
- package/cjs/storage/service/updates.test.js +0 -60
- package/cjs/storage/service/updates.test.js.map +0 -1
- package/cjs/storage/service/utils.test-utils.d.ts +0 -2
- package/cjs/storage/service/utils.test-utils.js +0 -19
- package/cjs/storage/service/utils.test-utils.js.map +0 -1
- package/cjs/utils/async-lock.test.d.ts +0 -1
- package/cjs/utils/async-lock.test.js +0 -25
- package/cjs/utils/async-lock.test.js.map +0 -1
- package/cjs/utils/bigint-utils.test.d.ts +0 -1
- package/cjs/utils/bigint-utils.test.js +0 -150
- package/cjs/utils/bigint-utils.test.js.map +0 -1
- package/cjs/utils/buffer-utils.test.d.ts +0 -1
- package/cjs/utils/buffer-utils.test.js +0 -69
- package/cjs/utils/buffer-utils.test.js.map +0 -1
- package/cjs/utils/condition-variable.test.d.ts +0 -1
- package/cjs/utils/condition-variable.test.js +0 -27
- package/cjs/utils/condition-variable.test.js.map +0 -1
- package/cjs/utils/controllable-promise.test.d.ts +0 -1
- package/cjs/utils/controllable-promise.test.js +0 -17
- package/cjs/utils/controllable-promise.test.js.map +0 -1
- package/cjs/utils/crypto/factorization.test.d.ts +0 -1
- package/cjs/utils/crypto/factorization.test.js +0 -19
- package/cjs/utils/crypto/factorization.test.js.map +0 -1
- package/cjs/utils/crypto/keys.test.d.ts +0 -1
- package/cjs/utils/crypto/keys.test.js +0 -40
- package/cjs/utils/crypto/keys.test.js.map +0 -1
- package/cjs/utils/crypto/miller-rabin.test.d.ts +0 -1
- package/cjs/utils/crypto/miller-rabin.test.js +0 -60
- package/cjs/utils/crypto/miller-rabin.test.js.map +0 -1
- package/cjs/utils/crypto/mtproto.test.d.ts +0 -1
- package/cjs/utils/crypto/mtproto.test.js +0 -50
- package/cjs/utils/crypto/mtproto.test.js.map +0 -1
- package/cjs/utils/crypto/node.d.ts +0 -21
- package/cjs/utils/crypto/node.js +0 -74
- package/cjs/utils/crypto/node.js.map +0 -1
- package/cjs/utils/crypto/node.test.d.ts +0 -1
- package/cjs/utils/crypto/node.test.js +0 -14
- package/cjs/utils/crypto/node.test.js.map +0 -1
- package/cjs/utils/crypto/password.test.d.ts +0 -1
- package/cjs/utils/crypto/password.test.js +0 -95
- package/cjs/utils/crypto/password.test.js.map +0 -1
- package/cjs/utils/crypto/utils.test.d.ts +0 -1
- package/cjs/utils/crypto/utils.test.js +0 -49
- package/cjs/utils/crypto/utils.test.js.map +0 -1
- package/cjs/utils/crypto/wasm.d.ts +0 -22
- package/cjs/utils/crypto/wasm.js +0 -41
- package/cjs/utils/crypto/wasm.js.map +0 -1
- package/cjs/utils/crypto/web.d.ts +0 -11
- package/cjs/utils/crypto/web.js +0 -40
- package/cjs/utils/crypto/web.js.map +0 -1
- package/cjs/utils/crypto/web.test.d.ts +0 -1
- package/cjs/utils/crypto/web.test.js +0 -17
- package/cjs/utils/crypto/web.test.js.map +0 -1
- package/cjs/utils/deque.test.d.ts +0 -1
- package/cjs/utils/deque.test.js +0 -128
- package/cjs/utils/deque.test.js.map +0 -1
- package/cjs/utils/function-utils.test.d.ts +0 -1
- package/cjs/utils/function-utils.test.js +0 -23
- package/cjs/utils/function-utils.test.js.map +0 -1
- package/cjs/utils/linked-list.test.d.ts +0 -1
- package/cjs/utils/linked-list.test.js +0 -36
- package/cjs/utils/linked-list.test.js.map +0 -1
- package/cjs/utils/links/bots.test.d.ts +0 -1
- package/cjs/utils/links/bots.test.js +0 -152
- package/cjs/utils/links/bots.test.js.map +0 -1
- package/cjs/utils/links/chat.test.d.ts +0 -1
- package/cjs/utils/links/chat.test.js +0 -84
- package/cjs/utils/links/chat.test.js.map +0 -1
- package/cjs/utils/links/misc.test.d.ts +0 -1
- package/cjs/utils/links/misc.test.js +0 -153
- package/cjs/utils/links/misc.test.js.map +0 -1
- package/cjs/utils/links/proxy.test.d.ts +0 -1
- package/cjs/utils/links/proxy.test.js +0 -74
- package/cjs/utils/links/proxy.test.js.map +0 -1
- package/cjs/utils/links/user.test.d.ts +0 -1
- package/cjs/utils/links/user.test.js +0 -63
- package/cjs/utils/links/user.test.js.map +0 -1
- package/cjs/utils/logger.test.d.ts +0 -1
- package/cjs/utils/logger.test.js +0 -139
- package/cjs/utils/logger.test.js.map +0 -1
- package/cjs/utils/long-utils.test.d.ts +0 -1
- package/cjs/utils/long-utils.test.js +0 -158
- package/cjs/utils/long-utils.test.js.map +0 -1
- package/cjs/utils/lru-map.test.d.ts +0 -1
- package/cjs/utils/lru-map.test.js +0 -96
- package/cjs/utils/lru-map.test.js.map +0 -1
- package/cjs/utils/lru-set.test.d.ts +0 -1
- package/cjs/utils/lru-set.test.js +0 -77
- package/cjs/utils/lru-set.test.js.map +0 -1
- package/cjs/utils/peer-utils.test.d.ts +0 -1
- package/cjs/utils/peer-utils.test.js +0 -110
- package/cjs/utils/peer-utils.test.js.map +0 -1
- package/cjs/utils/platform/crypto.d.ts +0 -1
- package/cjs/utils/platform/crypto.js +0 -8
- package/cjs/utils/platform/crypto.js.map +0 -1
- package/cjs/utils/platform/crypto.web.d.ts +0 -1
- package/cjs/utils/platform/crypto.web.js +0 -14
- package/cjs/utils/platform/crypto.web.js.map +0 -1
- package/cjs/utils/platform/error-reporting.js.map +0 -1
- package/cjs/utils/platform/exit-hook.d.ts +0 -1
- package/cjs/utils/platform/exit-hook.js +0 -45
- package/cjs/utils/platform/exit-hook.js.map +0 -1
- package/cjs/utils/platform/exit-hook.web.d.ts +0 -1
- package/cjs/utils/platform/exit-hook.web.js +0 -21
- package/cjs/utils/platform/exit-hook.web.js.map +0 -1
- package/cjs/utils/platform/logging.d.ts +0 -1
- package/cjs/utils/platform/logging.js +0 -34
- package/cjs/utils/platform/logging.js.map +0 -1
- package/cjs/utils/platform/logging.web.d.ts +0 -1
- package/cjs/utils/platform/logging.web.js +0 -35
- package/cjs/utils/platform/logging.web.js.map +0 -1
- package/cjs/utils/platform/transport.d.ts +0 -1
- package/cjs/utils/platform/transport.js +0 -8
- package/cjs/utils/platform/transport.js.map +0 -1
- package/cjs/utils/platform/transport.web.d.ts +0 -1
- package/cjs/utils/platform/transport.web.js +0 -15
- package/cjs/utils/platform/transport.web.js.map +0 -1
- package/cjs/utils/sorted-array.test.d.ts +0 -1
- package/cjs/utils/sorted-array.test.js +0 -66
- package/cjs/utils/sorted-array.test.js.map +0 -1
- package/cjs/utils/tl-json.test.d.ts +0 -1
- package/cjs/utils/tl-json.test.js +0 -83
- package/cjs/utils/tl-json.test.js.map +0 -1
- package/cjs/utils/type-assertions.test.d.ts +0 -1
- package/cjs/utils/type-assertions.test.js +0 -67
- package/cjs/utils/type-assertions.test.js.map +0 -1
- package/esm/highlevel/base.test.d.ts +0 -1
- package/esm/highlevel/base.test.js +0 -12
- package/esm/highlevel/base.test.js.map +0 -1
- package/esm/highlevel/methods/files/_platform.d.ts +0 -1
- package/esm/highlevel/methods/files/_platform.js +0 -26
- package/esm/highlevel/methods/files/_platform.js.map +0 -1
- package/esm/highlevel/methods/files/_platform.web.d.ts +0 -1
- package/esm/highlevel/methods/files/_platform.web.js +0 -19
- package/esm/highlevel/methods/files/_platform.web.js.map +0 -1
- package/esm/highlevel/methods/files/download-file.web.d.ts +0 -1
- package/esm/highlevel/methods/files/download-file.web.js +0 -5
- package/esm/highlevel/methods/files/download-file.web.js.map +0 -1
- package/esm/highlevel/methods/messages/send-text.test.d.ts +0 -1
- package/esm/highlevel/methods/messages/send-text.test.js +0 -135
- package/esm/highlevel/methods/messages/send-text.test.js.map +0 -1
- package/esm/highlevel/methods/users/get-users.test.d.ts +0 -1
- package/esm/highlevel/methods/users/get-users.test.js +0 -28
- package/esm/highlevel/methods/users/get-users.test.js.map +0 -1
- package/esm/highlevel/methods/users/resolve-peer.test.d.ts +0 -1
- package/esm/highlevel/methods/users/resolve-peer.test.js +0 -302
- package/esm/highlevel/methods/users/resolve-peer.test.js.map +0 -1
- package/esm/highlevel/types/bots/command-scope.d.ts +0 -63
- package/esm/highlevel/types/bots/command-scope.js +0 -84
- package/esm/highlevel/types/bots/command-scope.js.map +0 -1
- package/esm/highlevel/types/bots/input/index.d.ts +0 -2
- package/esm/highlevel/types/bots/input/index.js +0 -3
- package/esm/highlevel/types/bots/input/index.js.map +0 -1
- package/esm/highlevel/types/bots/input/input-inline-message.js +0 -176
- package/esm/highlevel/types/bots/input/input-inline-message.js.map +0 -1
- package/esm/highlevel/types/bots/input/input-inline-result.js +0 -487
- package/esm/highlevel/types/bots/input/input-inline-result.js.map +0 -1
- package/esm/highlevel/types/bots/keyboard-builder.js.map +0 -1
- package/esm/highlevel/types/bots/keyboard-builder.test.d.ts +0 -1
- package/esm/highlevel/types/bots/keyboard-builder.test.js +0 -160
- package/esm/highlevel/types/bots/keyboard-builder.test.js.map +0 -1
- package/esm/highlevel/types/bots/keyboards.d.ts +0 -239
- package/esm/highlevel/types/bots/keyboards.js +0 -377
- package/esm/highlevel/types/bots/keyboards.js.map +0 -1
- package/esm/highlevel/types/bots/keyboards.test.d.ts +0 -1
- package/esm/highlevel/types/bots/keyboards.test.js +0 -144
- package/esm/highlevel/types/bots/keyboards.test.js.map +0 -1
- package/esm/highlevel/types/media/input-media.js +0 -251
- package/esm/highlevel/types/media/input-media.js.map +0 -1
- package/esm/highlevel/types/misc/input-privacy-rule.d.ts +0 -63
- package/esm/highlevel/types/misc/input-privacy-rule.js +0 -82
- package/esm/highlevel/types/misc/input-privacy-rule.js.map +0 -1
- package/esm/highlevel/types/peers/peers-index.test.d.ts +0 -1
- package/esm/highlevel/types/peers/peers-index.test.js +0 -69
- package/esm/highlevel/types/peers/peers-index.test.js.map +0 -1
- package/esm/highlevel/types/peers/user.test.d.ts +0 -1
- package/esm/highlevel/types/peers/user.test.js +0 -171
- package/esm/highlevel/types/peers/user.test.js.map +0 -1
- package/esm/highlevel/utils/file-type.test.d.ts +0 -1
- package/esm/highlevel/utils/file-type.test.js +0 -62
- package/esm/highlevel/utils/file-type.test.js.map +0 -1
- package/esm/highlevel/utils/file-utils.test.d.ts +0 -1
- package/esm/highlevel/utils/file-utils.test.js +0 -124
- package/esm/highlevel/utils/file-utils.test.js.map +0 -1
- package/esm/highlevel/utils/inline-utils.test.d.ts +0 -1
- package/esm/highlevel/utils/inline-utils.test.js +0 -42
- package/esm/highlevel/utils/inline-utils.test.js.map +0 -1
- package/esm/highlevel/utils/inspectable.test.d.ts +0 -1
- package/esm/highlevel/utils/inspectable.test.js +0 -95
- package/esm/highlevel/utils/inspectable.test.js.map +0 -1
- package/esm/highlevel/utils/memoize.test.d.ts +0 -1
- package/esm/highlevel/utils/memoize.test.js +0 -58
- package/esm/highlevel/utils/memoize.test.js.map +0 -1
- package/esm/highlevel/utils/peer-utils.test.d.ts +0 -1
- package/esm/highlevel/utils/peer-utils.test.js +0 -107
- package/esm/highlevel/utils/peer-utils.test.js.map +0 -1
- package/esm/highlevel/utils/platform/storage.d.ts +0 -1
- package/esm/highlevel/utils/platform/storage.js +0 -6
- package/esm/highlevel/utils/platform/storage.js.map +0 -1
- package/esm/highlevel/utils/platform/storage.web.d.ts +0 -1
- package/esm/highlevel/utils/platform/storage.web.js +0 -10
- package/esm/highlevel/utils/platform/storage.web.js.map +0 -1
- package/esm/highlevel/utils/query-batcher.test.d.ts +0 -1
- package/esm/highlevel/utils/query-batcher.test.js +0 -500
- package/esm/highlevel/utils/query-batcher.test.js.map +0 -1
- package/esm/highlevel/utils/stream-utils.test.d.ts +0 -1
- package/esm/highlevel/utils/stream-utils.test.js +0 -96
- package/esm/highlevel/utils/stream-utils.test.js.map +0 -1
- package/esm/highlevel/utils/string-session.test.d.ts +0 -1
- package/esm/highlevel/utils/string-session.test.js +0 -196
- package/esm/highlevel/utils/string-session.test.js.map +0 -1
- package/esm/highlevel/utils/voice-utils.test.d.ts +0 -1
- package/esm/highlevel/utils/voice-utils.test.js +0 -26
- package/esm/highlevel/utils/voice-utils.test.js.map +0 -1
- package/esm/highlevel/worker/platform/connect.d.ts +0 -2
- package/esm/highlevel/worker/platform/connect.js +0 -15
- package/esm/highlevel/worker/platform/connect.js.map +0 -1
- package/esm/highlevel/worker/platform/connect.web.d.ts +0 -2
- package/esm/highlevel/worker/platform/connect.web.js +0 -47
- package/esm/highlevel/worker/platform/connect.web.js.map +0 -1
- package/esm/highlevel/worker/platform/register.d.ts +0 -2
- package/esm/highlevel/worker/platform/register.js +0 -16
- package/esm/highlevel/worker/platform/register.js.map +0 -1
- package/esm/highlevel/worker/platform/register.web.d.ts +0 -2
- package/esm/highlevel/worker/platform/register.web.js +0 -60
- package/esm/highlevel/worker/platform/register.web.js.map +0 -1
- package/esm/network/auth-key.test.d.ts +0 -1
- package/esm/network/auth-key.test.js +0 -106
- package/esm/network/auth-key.test.js.map +0 -1
- package/esm/network/config-manager.test.d.ts +0 -1
- package/esm/network/config-manager.test.js +0 -172
- package/esm/network/config-manager.test.js.map +0 -1
- package/esm/network/persistent-connection.test.d.ts +0 -1
- package/esm/network/persistent-connection.test.js +0 -155
- package/esm/network/persistent-connection.test.js.map +0 -1
- package/esm/network/transports/intermediate.test.d.ts +0 -1
- package/esm/network/transports/intermediate.test.js +0 -82
- package/esm/network/transports/intermediate.test.js.map +0 -1
- package/esm/network/transports/obfuscated.test.d.ts +0 -1
- package/esm/network/transports/obfuscated.test.js +0 -129
- package/esm/network/transports/obfuscated.test.js.map +0 -1
- package/esm/network/transports/tcp.d.ts +0 -32
- package/esm/network/transports/tcp.js +0 -122
- package/esm/network/transports/tcp.js.map +0 -1
- package/esm/network/transports/tcp.test.d.ts +0 -1
- package/esm/network/transports/tcp.test.js +0 -101
- package/esm/network/transports/tcp.test.js.map +0 -1
- package/esm/network/transports/websocket.d.ts +0 -46
- package/esm/network/transports/websocket.js +0 -116
- package/esm/network/transports/websocket.js.map +0 -1
- package/esm/network/transports/websocket.test.d.ts +0 -1
- package/esm/network/transports/websocket.test.js +0 -89
- package/esm/network/transports/websocket.test.js.map +0 -1
- package/esm/storage/providers/idb/driver.d.ts +0 -18
- package/esm/storage/providers/idb/driver.js +0 -134
- package/esm/storage/providers/idb/driver.js.map +0 -1
- package/esm/storage/providers/idb/idb.test.d.ts +0 -1
- package/esm/storage/providers/idb/idb.test.js +0 -27
- package/esm/storage/providers/idb/idb.test.js.map +0 -1
- package/esm/storage/providers/idb/index.d.ts +0 -22
- package/esm/storage/providers/idb/index.js +0 -23
- package/esm/storage/providers/idb/index.js.map +0 -1
- package/esm/storage/providers/idb/repository/auth-keys.d.ts +0 -14
- package/esm/storage/providers/idb/repository/auth-keys.js +0 -66
- package/esm/storage/providers/idb/repository/auth-keys.js.map +0 -1
- package/esm/storage/providers/idb/repository/kv.d.ts +0 -11
- package/esm/storage/providers/idb/repository/kv.js +0 -30
- package/esm/storage/providers/idb/repository/kv.js.map +0 -1
- package/esm/storage/providers/idb/repository/peers.d.ts +0 -12
- package/esm/storage/providers/idb/repository/peers.js +0 -34
- package/esm/storage/providers/idb/repository/peers.js.map +0 -1
- package/esm/storage/providers/idb/repository/ref-messages.d.ts +0 -12
- package/esm/storage/providers/idb/repository/ref-messages.js +0 -53
- package/esm/storage/providers/idb/repository/ref-messages.js.map +0 -1
- package/esm/storage/providers/idb/utils.d.ts +0 -3
- package/esm/storage/providers/idb/utils.js +0 -21
- package/esm/storage/providers/idb/utils.js.map +0 -1
- package/esm/storage/providers/memory/driver.js.map +0 -1
- package/esm/storage/providers/memory/index.js.map +0 -1
- package/esm/storage/providers/memory/memory.test.d.ts +0 -1
- package/esm/storage/providers/memory/memory.test.js +0 -11
- package/esm/storage/providers/memory/memory.test.js.map +0 -1
- package/esm/storage/providers/memory/repository/auth-keys.js.map +0 -1
- package/esm/storage/providers/memory/repository/kv.js.map +0 -1
- package/esm/storage/providers/memory/repository/peers.js.map +0 -1
- package/esm/storage/providers/memory/repository/ref-messages.js.map +0 -1
- package/esm/storage/service/auth-keys.test.d.ts +0 -1
- package/esm/storage/service/auth-keys.test.js +0 -20
- package/esm/storage/service/auth-keys.test.js.map +0 -1
- package/esm/storage/service/updates.test.d.ts +0 -1
- package/esm/storage/service/updates.test.js +0 -58
- package/esm/storage/service/updates.test.js.map +0 -1
- package/esm/storage/service/utils.test-utils.d.ts +0 -2
- package/esm/storage/service/utils.test-utils.js +0 -15
- package/esm/storage/service/utils.test-utils.js.map +0 -1
- package/esm/utils/async-lock.test.d.ts +0 -1
- package/esm/utils/async-lock.test.js +0 -23
- package/esm/utils/async-lock.test.js.map +0 -1
- package/esm/utils/bigint-utils.test.d.ts +0 -1
- package/esm/utils/bigint-utils.test.js +0 -148
- package/esm/utils/bigint-utils.test.js.map +0 -1
- package/esm/utils/buffer-utils.test.d.ts +0 -1
- package/esm/utils/buffer-utils.test.js +0 -67
- package/esm/utils/buffer-utils.test.js.map +0 -1
- package/esm/utils/condition-variable.test.d.ts +0 -1
- package/esm/utils/condition-variable.test.js +0 -25
- package/esm/utils/condition-variable.test.js.map +0 -1
- package/esm/utils/controllable-promise.test.d.ts +0 -1
- package/esm/utils/controllable-promise.test.js +0 -15
- package/esm/utils/controllable-promise.test.js.map +0 -1
- package/esm/utils/crypto/factorization.test.d.ts +0 -1
- package/esm/utils/crypto/factorization.test.js +0 -17
- package/esm/utils/crypto/factorization.test.js.map +0 -1
- package/esm/utils/crypto/keys.test.d.ts +0 -1
- package/esm/utils/crypto/keys.test.js +0 -38
- package/esm/utils/crypto/keys.test.js.map +0 -1
- package/esm/utils/crypto/miller-rabin.test.d.ts +0 -1
- package/esm/utils/crypto/miller-rabin.test.js +0 -58
- package/esm/utils/crypto/miller-rabin.test.js.map +0 -1
- package/esm/utils/crypto/mtproto.test.d.ts +0 -1
- package/esm/utils/crypto/mtproto.test.js +0 -48
- package/esm/utils/crypto/mtproto.test.js.map +0 -1
- package/esm/utils/crypto/node.d.ts +0 -21
- package/esm/utils/crypto/node.js +0 -69
- package/esm/utils/crypto/node.js.map +0 -1
- package/esm/utils/crypto/node.test.d.ts +0 -1
- package/esm/utils/crypto/node.test.js +0 -12
- package/esm/utils/crypto/node.test.js.map +0 -1
- package/esm/utils/crypto/password.test.d.ts +0 -1
- package/esm/utils/crypto/password.test.js +0 -90
- package/esm/utils/crypto/password.test.js.map +0 -1
- package/esm/utils/crypto/utils.test.d.ts +0 -1
- package/esm/utils/crypto/utils.test.js +0 -47
- package/esm/utils/crypto/utils.test.js.map +0 -1
- package/esm/utils/crypto/wasm.d.ts +0 -22
- package/esm/utils/crypto/wasm.js +0 -37
- package/esm/utils/crypto/wasm.js.map +0 -1
- package/esm/utils/crypto/web.d.ts +0 -11
- package/esm/utils/crypto/web.js +0 -36
- package/esm/utils/crypto/web.js.map +0 -1
- package/esm/utils/crypto/web.test.d.ts +0 -1
- package/esm/utils/crypto/web.test.js +0 -15
- package/esm/utils/crypto/web.test.js.map +0 -1
- package/esm/utils/deque.test.d.ts +0 -1
- package/esm/utils/deque.test.js +0 -126
- package/esm/utils/deque.test.js.map +0 -1
- package/esm/utils/function-utils.test.d.ts +0 -1
- package/esm/utils/function-utils.test.js +0 -21
- package/esm/utils/function-utils.test.js.map +0 -1
- package/esm/utils/linked-list.test.d.ts +0 -1
- package/esm/utils/linked-list.test.js +0 -34
- package/esm/utils/linked-list.test.js.map +0 -1
- package/esm/utils/links/bots.test.d.ts +0 -1
- package/esm/utils/links/bots.test.js +0 -150
- package/esm/utils/links/bots.test.js.map +0 -1
- package/esm/utils/links/chat.test.d.ts +0 -1
- package/esm/utils/links/chat.test.js +0 -82
- package/esm/utils/links/chat.test.js.map +0 -1
- package/esm/utils/links/misc.test.d.ts +0 -1
- package/esm/utils/links/misc.test.js +0 -151
- package/esm/utils/links/misc.test.js.map +0 -1
- package/esm/utils/links/proxy.test.d.ts +0 -1
- package/esm/utils/links/proxy.test.js +0 -72
- package/esm/utils/links/proxy.test.js.map +0 -1
- package/esm/utils/links/user.test.d.ts +0 -1
- package/esm/utils/links/user.test.js +0 -61
- package/esm/utils/links/user.test.js.map +0 -1
- package/esm/utils/logger.test.d.ts +0 -1
- package/esm/utils/logger.test.js +0 -134
- package/esm/utils/logger.test.js.map +0 -1
- package/esm/utils/long-utils.test.d.ts +0 -1
- package/esm/utils/long-utils.test.js +0 -153
- package/esm/utils/long-utils.test.js.map +0 -1
- package/esm/utils/lru-map.test.d.ts +0 -1
- package/esm/utils/lru-map.test.js +0 -94
- package/esm/utils/lru-map.test.js.map +0 -1
- package/esm/utils/lru-set.test.d.ts +0 -1
- package/esm/utils/lru-set.test.js +0 -72
- package/esm/utils/lru-set.test.js.map +0 -1
- package/esm/utils/peer-utils.test.d.ts +0 -1
- package/esm/utils/peer-utils.test.js +0 -105
- package/esm/utils/peer-utils.test.js.map +0 -1
- package/esm/utils/platform/crypto.d.ts +0 -1
- package/esm/utils/platform/crypto.js +0 -4
- package/esm/utils/platform/crypto.js.map +0 -1
- package/esm/utils/platform/crypto.web.d.ts +0 -1
- package/esm/utils/platform/crypto.web.js +0 -10
- package/esm/utils/platform/crypto.web.js.map +0 -1
- package/esm/utils/platform/error-reporting.js.map +0 -1
- package/esm/utils/platform/exit-hook.d.ts +0 -1
- package/esm/utils/platform/exit-hook.js +0 -41
- package/esm/utils/platform/exit-hook.js.map +0 -1
- package/esm/utils/platform/exit-hook.web.d.ts +0 -1
- package/esm/utils/platform/exit-hook.web.js +0 -17
- package/esm/utils/platform/exit-hook.web.js.map +0 -1
- package/esm/utils/platform/logging.d.ts +0 -1
- package/esm/utils/platform/logging.js +0 -31
- package/esm/utils/platform/logging.js.map +0 -1
- package/esm/utils/platform/logging.web.d.ts +0 -1
- package/esm/utils/platform/logging.web.js +0 -31
- package/esm/utils/platform/logging.web.js.map +0 -1
- package/esm/utils/platform/transport.d.ts +0 -1
- package/esm/utils/platform/transport.js +0 -4
- package/esm/utils/platform/transport.js.map +0 -1
- package/esm/utils/platform/transport.web.d.ts +0 -1
- package/esm/utils/platform/transport.web.js +0 -12
- package/esm/utils/platform/transport.web.js.map +0 -1
- package/esm/utils/sorted-array.test.d.ts +0 -1
- package/esm/utils/sorted-array.test.js +0 -64
- package/esm/utils/sorted-array.test.js.map +0 -1
- package/esm/utils/tl-json.test.d.ts +0 -1
- package/esm/utils/tl-json.test.js +0 -81
- package/esm/utils/tl-json.test.js.map +0 -1
- package/esm/utils/type-assertions.test.d.ts +0 -1
- package/esm/utils/type-assertions.test.js +0 -65
- package/esm/utils/type-assertions.test.js.map +0 -1
- /package/cjs/highlevel/{base.test.d.ts → methods/files/download-node-stream.d.ts} +0 -0
- /package/cjs/storage/{providers/memory → memory}/driver.js +0 -0
- /package/cjs/storage/{providers/memory → memory}/index.js +0 -0
- /package/cjs/storage/{providers/memory → memory}/repository/auth-keys.js +0 -0
- /package/cjs/storage/{providers/memory → memory}/repository/kv.js +0 -0
- /package/cjs/storage/{providers/memory → memory}/repository/peers.js +0 -0
- /package/cjs/storage/{providers/memory → memory}/repository/ref-messages.js +0 -0
- /package/cjs/utils/{platform/error-reporting.js → error-reporting.js} +0 -0
- /package/{cjs/highlevel/methods/files/_platform.d.ts → esm/highlevel/methods/files/download-node-stream.d.ts} +0 -0
- /package/esm/storage/{providers/memory → memory}/driver.js +0 -0
- /package/esm/storage/{providers/memory → memory}/index.js +0 -0
- /package/esm/storage/{providers/memory → memory}/repository/auth-keys.js +0 -0
- /package/esm/storage/{providers/memory → memory}/repository/kv.js +0 -0
- /package/esm/storage/{providers/memory → memory}/repository/peers.js +0 -0
- /package/esm/storage/{providers/memory → memory}/repository/ref-messages.js +0 -0
- /package/esm/utils/{platform/error-reporting.js → error-reporting.js} +0 -0
|
@@ -1,490 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.BotInline = void 0;
|
|
4
|
-
const errors_js_1 = require("../../../../types/errors.js");
|
|
5
|
-
const convert_file_id_js_1 = require("../../../utils/convert-file-id.js");
|
|
6
|
-
const file_utils_js_1 = require("../../../utils/file-utils.js");
|
|
7
|
-
const input_inline_message_js_1 = require("./input-inline-message.js");
|
|
8
|
-
// eslint-disable-next-line @typescript-eslint/no-namespace
|
|
9
|
-
var BotInline;
|
|
10
|
-
(function (BotInline) {
|
|
11
|
-
/**
|
|
12
|
-
* Create an inline result containing an article
|
|
13
|
-
*
|
|
14
|
-
* @param id Inline result ID
|
|
15
|
-
* @param params Article
|
|
16
|
-
*/
|
|
17
|
-
function article(id, params) {
|
|
18
|
-
const ret = params;
|
|
19
|
-
ret.id = id;
|
|
20
|
-
ret.type = 'article';
|
|
21
|
-
return ret;
|
|
22
|
-
}
|
|
23
|
-
BotInline.article = article;
|
|
24
|
-
/**
|
|
25
|
-
* Create an inline result containing a GIF
|
|
26
|
-
*
|
|
27
|
-
* @param id Inline result ID
|
|
28
|
-
* @param media GIF animation
|
|
29
|
-
* @param params Additional parameters
|
|
30
|
-
*/
|
|
31
|
-
function gif(id, media, params = {}) {
|
|
32
|
-
const ret = params;
|
|
33
|
-
ret.id = id;
|
|
34
|
-
ret.type = 'gif';
|
|
35
|
-
ret.media = media;
|
|
36
|
-
return ret;
|
|
37
|
-
}
|
|
38
|
-
BotInline.gif = gif;
|
|
39
|
-
/**
|
|
40
|
-
* Create an inline result containing a video
|
|
41
|
-
*
|
|
42
|
-
* @param id Inline result ID
|
|
43
|
-
* @param media Video
|
|
44
|
-
* @param params Additional parameters
|
|
45
|
-
*/
|
|
46
|
-
function video(id, media, params) {
|
|
47
|
-
const ret = params;
|
|
48
|
-
ret.id = id;
|
|
49
|
-
ret.type = 'video';
|
|
50
|
-
ret.media = media;
|
|
51
|
-
return ret;
|
|
52
|
-
}
|
|
53
|
-
BotInline.video = video;
|
|
54
|
-
/**
|
|
55
|
-
* Create an inline result containing an audio file
|
|
56
|
-
*
|
|
57
|
-
* @param id Inline result ID
|
|
58
|
-
* @param media Audio file
|
|
59
|
-
* @param params Additional parameters
|
|
60
|
-
*/
|
|
61
|
-
function audio(id, media, params) {
|
|
62
|
-
const ret = params;
|
|
63
|
-
ret.id = id;
|
|
64
|
-
ret.type = 'audio';
|
|
65
|
-
ret.media = media;
|
|
66
|
-
return ret;
|
|
67
|
-
}
|
|
68
|
-
BotInline.audio = audio;
|
|
69
|
-
/**
|
|
70
|
-
* Create an inline result containing a voice note
|
|
71
|
-
*
|
|
72
|
-
* @param id Inline result ID
|
|
73
|
-
* @param media Voice note
|
|
74
|
-
* @param params Additional parameters
|
|
75
|
-
*/
|
|
76
|
-
function voice(id, media, params) {
|
|
77
|
-
const ret = params;
|
|
78
|
-
ret.id = id;
|
|
79
|
-
ret.type = 'voice';
|
|
80
|
-
ret.media = media;
|
|
81
|
-
return ret;
|
|
82
|
-
}
|
|
83
|
-
BotInline.voice = voice;
|
|
84
|
-
/**
|
|
85
|
-
* Create an inline result containing a photo
|
|
86
|
-
*
|
|
87
|
-
* @param id Inline result ID
|
|
88
|
-
* @param media Photo
|
|
89
|
-
* @param params Additional parameters
|
|
90
|
-
*/
|
|
91
|
-
function photo(id, media, params = {}) {
|
|
92
|
-
const ret = params;
|
|
93
|
-
ret.id = id;
|
|
94
|
-
ret.type = 'photo';
|
|
95
|
-
ret.media = media;
|
|
96
|
-
return ret;
|
|
97
|
-
}
|
|
98
|
-
BotInline.photo = photo;
|
|
99
|
-
/**
|
|
100
|
-
* Create an inline result containing a sticker
|
|
101
|
-
*
|
|
102
|
-
* @param id Inline result ID
|
|
103
|
-
* @param media Sticker
|
|
104
|
-
*/
|
|
105
|
-
function sticker(id, media) {
|
|
106
|
-
return {
|
|
107
|
-
id,
|
|
108
|
-
type: 'sticker',
|
|
109
|
-
media,
|
|
110
|
-
};
|
|
111
|
-
}
|
|
112
|
-
BotInline.sticker = sticker;
|
|
113
|
-
/**
|
|
114
|
-
* Create an inline result containing a document
|
|
115
|
-
* (only PDF and ZIP are supported when using URL)
|
|
116
|
-
*
|
|
117
|
-
* @param id Inline result ID
|
|
118
|
-
* @param media Document
|
|
119
|
-
* @param params Additional parameters
|
|
120
|
-
*/
|
|
121
|
-
function file(id, media, params) {
|
|
122
|
-
const ret = params;
|
|
123
|
-
ret.id = id;
|
|
124
|
-
ret.type = 'file';
|
|
125
|
-
ret.media = media;
|
|
126
|
-
return ret;
|
|
127
|
-
}
|
|
128
|
-
BotInline.file = file;
|
|
129
|
-
/**
|
|
130
|
-
* Create an inline result containing a geolocation
|
|
131
|
-
*
|
|
132
|
-
* @param id Inline result ID
|
|
133
|
-
* @param params Additional parameters
|
|
134
|
-
*/
|
|
135
|
-
function geo(id, params) {
|
|
136
|
-
const ret = params;
|
|
137
|
-
ret.id = id;
|
|
138
|
-
ret.type = 'geo';
|
|
139
|
-
return ret;
|
|
140
|
-
}
|
|
141
|
-
BotInline.geo = geo;
|
|
142
|
-
/**
|
|
143
|
-
* Create an inline result containing a venue
|
|
144
|
-
*
|
|
145
|
-
* @param id Inline result ID
|
|
146
|
-
* @param params Venue parameters
|
|
147
|
-
*/
|
|
148
|
-
function venue(id, params) {
|
|
149
|
-
const ret = params;
|
|
150
|
-
ret.id = id;
|
|
151
|
-
ret.type = 'venue';
|
|
152
|
-
return ret;
|
|
153
|
-
}
|
|
154
|
-
BotInline.venue = venue;
|
|
155
|
-
/**
|
|
156
|
-
* Create an inline result containing a contact
|
|
157
|
-
*
|
|
158
|
-
* @param id Inline result ID
|
|
159
|
-
* @param params Contact parameters
|
|
160
|
-
*/
|
|
161
|
-
function contact(id, params) {
|
|
162
|
-
const ret = params;
|
|
163
|
-
ret.id = id;
|
|
164
|
-
ret.type = 'contact';
|
|
165
|
-
return ret;
|
|
166
|
-
}
|
|
167
|
-
BotInline.contact = contact;
|
|
168
|
-
/**
|
|
169
|
-
* Create an inline result containing a game
|
|
170
|
-
*
|
|
171
|
-
* @param id Inline result ID
|
|
172
|
-
* @param shortName Short name of the game
|
|
173
|
-
* @param params Additional parameters
|
|
174
|
-
*/
|
|
175
|
-
function game(id, shortName, params = {}) {
|
|
176
|
-
const ret = params;
|
|
177
|
-
ret.id = id;
|
|
178
|
-
ret.type = 'game';
|
|
179
|
-
ret.shortName = shortName;
|
|
180
|
-
return ret;
|
|
181
|
-
}
|
|
182
|
-
BotInline.game = game;
|
|
183
|
-
/** @internal */
|
|
184
|
-
async function _convertToTl(client, results) {
|
|
185
|
-
const normalizeThumb = (obj, fallback) => {
|
|
186
|
-
if (obj.type !== 'voice' && obj.type !== 'audio' && obj.type !== 'sticker' && obj.type !== 'game') {
|
|
187
|
-
if (!obj.thumb || typeof obj.thumb === 'string') {
|
|
188
|
-
if (!obj.thumb && !fallback) {
|
|
189
|
-
return undefined;
|
|
190
|
-
}
|
|
191
|
-
return {
|
|
192
|
-
_: 'inputWebDocument',
|
|
193
|
-
size: 0,
|
|
194
|
-
url: obj.thumb || fallback,
|
|
195
|
-
mimeType: obj.type === 'gif' ? obj.thumbMime ?? obj.mime ?? 'video/mp4' : 'image/jpeg',
|
|
196
|
-
attributes: [],
|
|
197
|
-
};
|
|
198
|
-
}
|
|
199
|
-
return obj.thumb;
|
|
200
|
-
}
|
|
201
|
-
};
|
|
202
|
-
const items = [];
|
|
203
|
-
let isGallery = false;
|
|
204
|
-
let forceVertical = false;
|
|
205
|
-
for (const obj of results) {
|
|
206
|
-
switch (obj.type) {
|
|
207
|
-
case 'article': {
|
|
208
|
-
forceVertical = true;
|
|
209
|
-
let sendMessage;
|
|
210
|
-
if (obj.message) {
|
|
211
|
-
sendMessage = await input_inline_message_js_1.BotInlineMessage._convertToTl(client, obj.message);
|
|
212
|
-
}
|
|
213
|
-
else {
|
|
214
|
-
let message = obj.title;
|
|
215
|
-
const entities = [
|
|
216
|
-
{
|
|
217
|
-
_: 'messageEntityBold',
|
|
218
|
-
offset: 0,
|
|
219
|
-
length: message.length,
|
|
220
|
-
},
|
|
221
|
-
];
|
|
222
|
-
if (obj.url) {
|
|
223
|
-
entities.push({
|
|
224
|
-
_: 'messageEntityTextUrl',
|
|
225
|
-
url: obj.url,
|
|
226
|
-
offset: 0,
|
|
227
|
-
length: message.length,
|
|
228
|
-
});
|
|
229
|
-
}
|
|
230
|
-
if (obj.description) {
|
|
231
|
-
message += '\n' + obj.description;
|
|
232
|
-
}
|
|
233
|
-
sendMessage = {
|
|
234
|
-
_: 'inputBotInlineMessageText',
|
|
235
|
-
message,
|
|
236
|
-
entities,
|
|
237
|
-
};
|
|
238
|
-
}
|
|
239
|
-
items.push({
|
|
240
|
-
_: 'inputBotInlineResult',
|
|
241
|
-
id: obj.id,
|
|
242
|
-
type: obj.type,
|
|
243
|
-
title: obj.title,
|
|
244
|
-
description: obj.description,
|
|
245
|
-
url: obj.hideUrl ? undefined : obj.url,
|
|
246
|
-
content: obj.url && obj.hideUrl ?
|
|
247
|
-
{
|
|
248
|
-
_: 'inputWebDocument',
|
|
249
|
-
url: obj.url,
|
|
250
|
-
mimeType: 'text/html',
|
|
251
|
-
size: 0,
|
|
252
|
-
attributes: [],
|
|
253
|
-
} :
|
|
254
|
-
undefined,
|
|
255
|
-
thumb: typeof obj.thumb === 'string' ? normalizeThumb(obj) : obj.thumb,
|
|
256
|
-
sendMessage,
|
|
257
|
-
});
|
|
258
|
-
continue;
|
|
259
|
-
}
|
|
260
|
-
case 'game': {
|
|
261
|
-
let sendMessage;
|
|
262
|
-
if (obj.message) {
|
|
263
|
-
sendMessage = await input_inline_message_js_1.BotInlineMessage._convertToTl(client, obj.message);
|
|
264
|
-
if (sendMessage._ !== 'inputBotInlineMessageGame') {
|
|
265
|
-
throw new errors_js_1.MtArgumentError('game inline result must contain a game inline message');
|
|
266
|
-
}
|
|
267
|
-
}
|
|
268
|
-
else {
|
|
269
|
-
sendMessage = {
|
|
270
|
-
_: 'inputBotInlineMessageGame',
|
|
271
|
-
};
|
|
272
|
-
}
|
|
273
|
-
items.push({
|
|
274
|
-
_: 'inputBotInlineResultGame',
|
|
275
|
-
id: obj.id,
|
|
276
|
-
shortName: obj.shortName,
|
|
277
|
-
sendMessage,
|
|
278
|
-
});
|
|
279
|
-
continue;
|
|
280
|
-
}
|
|
281
|
-
case 'gif':
|
|
282
|
-
case 'photo':
|
|
283
|
-
case 'sticker':
|
|
284
|
-
isGallery = true;
|
|
285
|
-
break;
|
|
286
|
-
case 'audio':
|
|
287
|
-
case 'contact':
|
|
288
|
-
case 'voice':
|
|
289
|
-
forceVertical = true;
|
|
290
|
-
}
|
|
291
|
-
let sendMessage;
|
|
292
|
-
if (obj.message) {
|
|
293
|
-
sendMessage = await input_inline_message_js_1.BotInlineMessage._convertToTl(client, obj.message);
|
|
294
|
-
}
|
|
295
|
-
else if (obj.type === 'venue') {
|
|
296
|
-
if (obj.latitude && obj.longitude) {
|
|
297
|
-
sendMessage = {
|
|
298
|
-
_: 'inputBotInlineMessageMediaVenue',
|
|
299
|
-
title: obj.title,
|
|
300
|
-
address: obj.address,
|
|
301
|
-
geoPoint: {
|
|
302
|
-
_: 'inputGeoPoint',
|
|
303
|
-
lat: obj.latitude,
|
|
304
|
-
long: obj.longitude,
|
|
305
|
-
},
|
|
306
|
-
provider: '',
|
|
307
|
-
venueId: '',
|
|
308
|
-
venueType: '',
|
|
309
|
-
};
|
|
310
|
-
}
|
|
311
|
-
else {
|
|
312
|
-
throw new errors_js_1.MtArgumentError('message or location (lat&lon) bust be supplied for venue inline result');
|
|
313
|
-
}
|
|
314
|
-
}
|
|
315
|
-
else if (obj.type === 'video' && obj.isEmbed && typeof obj.media === 'string') {
|
|
316
|
-
sendMessage = {
|
|
317
|
-
_: 'inputBotInlineMessageText',
|
|
318
|
-
message: obj.media,
|
|
319
|
-
};
|
|
320
|
-
}
|
|
321
|
-
else if (obj.type === 'geo') {
|
|
322
|
-
sendMessage = {
|
|
323
|
-
_: 'inputBotInlineMessageMediaGeo',
|
|
324
|
-
geoPoint: {
|
|
325
|
-
_: 'inputGeoPoint',
|
|
326
|
-
lat: obj.latitude,
|
|
327
|
-
long: obj.longitude,
|
|
328
|
-
},
|
|
329
|
-
};
|
|
330
|
-
}
|
|
331
|
-
else if (obj.type === 'contact') {
|
|
332
|
-
sendMessage = {
|
|
333
|
-
_: 'inputBotInlineMessageMediaContact',
|
|
334
|
-
phoneNumber: obj.phone,
|
|
335
|
-
firstName: obj.firstName,
|
|
336
|
-
lastName: obj.lastName ?? '',
|
|
337
|
-
vcard: '',
|
|
338
|
-
};
|
|
339
|
-
}
|
|
340
|
-
else {
|
|
341
|
-
sendMessage = {
|
|
342
|
-
_: 'inputBotInlineMessageMediaAuto',
|
|
343
|
-
message: '',
|
|
344
|
-
};
|
|
345
|
-
}
|
|
346
|
-
let media = undefined;
|
|
347
|
-
if (obj.type !== 'geo' && obj.type !== 'venue' && obj.type !== 'contact') {
|
|
348
|
-
if (typeof obj.media === 'string') {
|
|
349
|
-
// file id or url
|
|
350
|
-
if (obj.media.match(/^https?:\/\//)) {
|
|
351
|
-
if (obj.type === 'sticker') {
|
|
352
|
-
throw new errors_js_1.MtArgumentError('sticker inline result cannot contain a URL');
|
|
353
|
-
}
|
|
354
|
-
let mime;
|
|
355
|
-
if (obj.type === 'video')
|
|
356
|
-
mime = 'video/mp4';
|
|
357
|
-
else if (obj.type === 'audio') {
|
|
358
|
-
mime = obj.mime ?? 'audio/mpeg';
|
|
359
|
-
}
|
|
360
|
-
else if (obj.type === 'gif') {
|
|
361
|
-
mime = obj.mime ?? 'video/mp4';
|
|
362
|
-
}
|
|
363
|
-
else if (obj.type === 'voice')
|
|
364
|
-
mime = 'audio/ogg';
|
|
365
|
-
else if (obj.type === 'file') {
|
|
366
|
-
if (!obj.mime) {
|
|
367
|
-
throw new errors_js_1.MtArgumentError('MIME type must be specified for file inline result');
|
|
368
|
-
}
|
|
369
|
-
mime = obj.mime;
|
|
370
|
-
}
|
|
371
|
-
else
|
|
372
|
-
mime = 'image/jpeg';
|
|
373
|
-
const attributes = [];
|
|
374
|
-
if ((obj.type === 'video' || obj.type === 'gif' || obj.type === 'photo') &&
|
|
375
|
-
obj.width &&
|
|
376
|
-
obj.height) {
|
|
377
|
-
if (obj.type !== 'photo' && obj.duration) {
|
|
378
|
-
attributes.push({
|
|
379
|
-
_: 'documentAttributeVideo',
|
|
380
|
-
w: obj.width,
|
|
381
|
-
h: obj.height,
|
|
382
|
-
duration: obj.duration,
|
|
383
|
-
});
|
|
384
|
-
}
|
|
385
|
-
else {
|
|
386
|
-
attributes.push({
|
|
387
|
-
_: 'documentAttributeImageSize',
|
|
388
|
-
w: obj.width,
|
|
389
|
-
h: obj.height,
|
|
390
|
-
});
|
|
391
|
-
}
|
|
392
|
-
}
|
|
393
|
-
else if (obj.type === 'audio' || obj.type === 'voice') {
|
|
394
|
-
attributes.push({
|
|
395
|
-
_: 'documentAttributeAudio',
|
|
396
|
-
voice: obj.type === 'voice',
|
|
397
|
-
duration: obj.duration ?? 0,
|
|
398
|
-
title: obj.type === 'audio' ? obj.title : '',
|
|
399
|
-
performer: obj.type === 'audio' ? obj.performer : '',
|
|
400
|
-
});
|
|
401
|
-
}
|
|
402
|
-
attributes.push({
|
|
403
|
-
_: 'documentAttributeFilename',
|
|
404
|
-
fileName: (0, file_utils_js_1.extractFileName)(obj.media),
|
|
405
|
-
});
|
|
406
|
-
media = {
|
|
407
|
-
_: 'inputWebDocument',
|
|
408
|
-
url: obj.media,
|
|
409
|
-
mimeType: mime,
|
|
410
|
-
size: 0,
|
|
411
|
-
attributes,
|
|
412
|
-
};
|
|
413
|
-
}
|
|
414
|
-
else if (obj.type === 'photo') {
|
|
415
|
-
media = (0, convert_file_id_js_1.fileIdToInputPhoto)(obj.media);
|
|
416
|
-
}
|
|
417
|
-
else {
|
|
418
|
-
media = (0, convert_file_id_js_1.fileIdToInputDocument)(obj.media);
|
|
419
|
-
}
|
|
420
|
-
}
|
|
421
|
-
else {
|
|
422
|
-
media = obj.media;
|
|
423
|
-
}
|
|
424
|
-
}
|
|
425
|
-
let title = undefined;
|
|
426
|
-
let description = undefined;
|
|
427
|
-
// incredible hacks by durov team.
|
|
428
|
-
// i honestly don't understand why didn't they just
|
|
429
|
-
// make a bunch of types, as they normally do,
|
|
430
|
-
// but whatever.
|
|
431
|
-
// ref: https://github.com/tdlib/td/blob/master/td/telegram/InlineQueriesManager.cpp
|
|
432
|
-
if (obj.type === 'contact') {
|
|
433
|
-
title = obj.lastName?.length ? `${obj.firstName} ${obj.lastName}` : obj.firstName;
|
|
434
|
-
}
|
|
435
|
-
else if (obj.type !== 'sticker') {
|
|
436
|
-
title = obj.title;
|
|
437
|
-
}
|
|
438
|
-
if (obj.type === 'audio') {
|
|
439
|
-
description = obj.performer;
|
|
440
|
-
}
|
|
441
|
-
else if (obj.type === 'geo') {
|
|
442
|
-
description = `${obj.latitude} ${obj.longitude}`;
|
|
443
|
-
}
|
|
444
|
-
else if (obj.type === 'venue') {
|
|
445
|
-
description = obj.address;
|
|
446
|
-
}
|
|
447
|
-
else if (obj.type === 'contact') {
|
|
448
|
-
description = obj.phone;
|
|
449
|
-
}
|
|
450
|
-
else if (obj.type !== 'voice' && obj.type !== 'sticker') {
|
|
451
|
-
description = obj.description;
|
|
452
|
-
}
|
|
453
|
-
if (!media || media._ === 'inputWebDocument') {
|
|
454
|
-
items.push({
|
|
455
|
-
_: 'inputBotInlineResult',
|
|
456
|
-
id: obj.id,
|
|
457
|
-
type: obj.type,
|
|
458
|
-
title,
|
|
459
|
-
description,
|
|
460
|
-
content: media,
|
|
461
|
-
thumb: normalizeThumb(obj, media?.url),
|
|
462
|
-
sendMessage,
|
|
463
|
-
});
|
|
464
|
-
continue;
|
|
465
|
-
}
|
|
466
|
-
if (media._ === 'inputPhoto') {
|
|
467
|
-
items.push({
|
|
468
|
-
_: 'inputBotInlineResultPhoto',
|
|
469
|
-
id: obj.id,
|
|
470
|
-
type: obj.type,
|
|
471
|
-
photo: media,
|
|
472
|
-
sendMessage,
|
|
473
|
-
});
|
|
474
|
-
continue;
|
|
475
|
-
}
|
|
476
|
-
items.push({
|
|
477
|
-
_: 'inputBotInlineResultDocument',
|
|
478
|
-
id: obj.id,
|
|
479
|
-
type: obj.type,
|
|
480
|
-
title,
|
|
481
|
-
description,
|
|
482
|
-
document: media,
|
|
483
|
-
sendMessage,
|
|
484
|
-
});
|
|
485
|
-
}
|
|
486
|
-
return [isGallery && !forceVertical, items];
|
|
487
|
-
}
|
|
488
|
-
BotInline._convertToTl = _convertToTl;
|
|
489
|
-
})(BotInline || (exports.BotInline = BotInline = {}));
|
|
490
|
-
//# sourceMappingURL=input-inline-result.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"input-inline-result.js","sourceRoot":"","sources":["../../../../../../src/highlevel/types/bots/input/input-inline-result.ts"],"names":[],"mappings":";;;AAEA,2DAA6D;AAE7D,0EAA6F;AAC7F,gEAA8D;AAC9D,uEAAgF;AAofhF,2DAA2D;AAC3D,IAAiB,SAAS,CAwhBzB;AAxhBD,WAAiB,SAAS;IACtB;;;;;OAKG;IACH,SAAgB,OAAO,CACnB,EAAU,EACV,MAAqD;QAErD,MAAM,GAAG,GAAG,MAA8C,CAAA;QAC1D,GAAG,CAAC,EAAE,GAAG,EAAE,CAAA;QACX,GAAG,CAAC,IAAI,GAAG,SAAS,CAAA;QAEpB,OAAO,GAAG,CAAA;IACd,CAAC;IATe,iBAAO,UAStB,CAAA;IAED;;;;;;OAMG;IACH,SAAgB,GAAG,CACf,EAAU,EACV,KAA4D,EAC5D,SAA8D,EAAE;QAEhE,MAAM,GAAG,GAAG,MAA0C,CAAA;QACtD,GAAG,CAAC,EAAE,GAAG,EAAE,CAAA;QACX,GAAG,CAAC,IAAI,GAAG,KAAK,CAAA;QAChB,GAAG,CAAC,KAAK,GAAG,KAAK,CAAA;QAEjB,OAAO,GAAG,CAAA;IACd,CAAC;IAXe,aAAG,MAWlB,CAAA;IAED;;;;;;OAMG;IACH,SAAgB,KAAK,CACjB,EAAU,EACV,KAA4D,EAC5D,MAA6D;QAE7D,MAAM,GAAG,GAAG,MAA4C,CAAA;QACxD,GAAG,CAAC,EAAE,GAAG,EAAE,CAAA;QACX,GAAG,CAAC,IAAI,GAAG,OAAO,CAAA;QAClB,GAAG,CAAC,KAAK,GAAG,KAAK,CAAA;QAEjB,OAAO,GAAG,CAAA;IACd,CAAC;IAXe,eAAK,QAWpB,CAAA;IAED;;;;;;OAMG;IACH,SAAgB,KAAK,CACjB,EAAU,EACV,KAA4D,EAC5D,MAA6D;QAE7D,MA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AC1C,KAAK,CAAC,IAAI,CAAC;oBACP,CAAC,EAAE,sBAAsB;oBACzB,EAAE,EAAE,GAAG,CAAC,EAAE;oBACV,IAAI,EAAE,GAAG,CAAC,IAAI;oBACd,KAAK;oBACL,WAAW;oBACX,OAAO,EAAE,KAAK;oBACd,KAAK,EAAE,cAAc,CAAC,GAAG,EAAE,KAAK,EAAE,GAAG,CAAC;oBACtC,WAAW;iBACd,CAAC,CAAA;gBACF,SAAQ;aACX;YAED,IAAI,KAAK,CAAC,CAAC,KAAK,YAAY,EAAE;gBAC1B,KAAK,CAAC,IAAI,CAAC;oBACP,CAAC,EAAE,2BAA2B;oBAC9B,EAAE,EAAE,GAAG,CAAC,EAAE;oBACV,IAAI,EAAE,GAAG,CAAC,IAAI;oBACd,KAAK,EAAE,KAAK;oBACZ,WAAW;iBACd,CAAC,CAAA;gBACF,SAAQ;aACX;YAED,KAAK,CAAC,IAAI,CAAC;gBACP,CAAC,EAAE,8BAA8B;gBACjC,EAAE,EAAE,GAAG,CAAC,EAAE;gBACV,IAAI,EAAE,GAAG,CAAC,IAAI;gBACd,KAAK;gBACL,WAAW;gBACX,QAAQ,EAAE,KAAK;gBACf,WAAW;aACd,CAAC,CAAA;SACL;QAED,OAAO,CAAC,SAAS,IAAI,CAAC,aAAa,EAAE,KAAK,CAAC,CAAA;IAC/C,CAAC;IA5TqB,sBAAY,eA4TjC,CAAA;AACL,CAAC,EAxhBgB,SAAS,yBAAT,SAAS,QAwhBzB","sourcesContent":["import { tl } from '@mtcute/tl'\n\nimport { MtArgumentError } from '../../../../types/errors.js'\nimport { ITelegramClient } from '../../../client.types.js'\nimport { fileIdToInputDocument, fileIdToInputPhoto } from '../../../utils/convert-file-id.js'\nimport { extractFileName } from '../../../utils/file-utils.js'\nimport { BotInlineMessage, InputInlineMessage } from './input-inline-message.js'\n\nexport interface BaseInputInlineResult {\n /**\n * Unique ID of the result\n */\n id: string\n\n /**\n * Message to send when the result is selected.\n *\n * By default, is automatically generated,\n * and details about how it is generated can be found\n * in subclasses' description\n */\n message?: InputInlineMessage\n}\n\n/**\n * Inline result containing an article.\n *\n * If `message` is not provided, a {@link InputInlineMessageText} is created\n * with web preview enabled and text generated as follows:\n * ```\n * {{#if url}}\n * <a href=\"{{url}}\"><b>{{title}}</b></a>\n * {{else}}\n * <b>{{title}}</b>\n * {{/if}}\n * {{#if description}}\n * {{description}}\n * {{/if}}\n * ```\n * > Handlebars syntax is used. HTML tags are used to signify entities,\n * > but in fact raw TL entity objects are created\n */\nexport interface InputInlineResultArticle extends BaseInputInlineResult {\n type: 'article'\n\n /**\n * Title of the result (must not be empty)\n */\n title: string\n\n /**\n * Description of the result\n */\n description?: string\n\n /**\n * URL of the article\n */\n url?: string\n\n /**\n * Whether to prevent article URL from\n * displaying by the client\n *\n * @default `false`\n */\n hideUrl?: boolean\n\n /**\n * Article thumbnail URL (must be jpeg).\n */\n thumb?: string | tl.RawInputWebDocument\n}\n\n/**\n * Inline result containing an animation (silent mp4 or gif).\n *\n * If `message` is not provided, {@link InputInlineMessageMedia} is used\n * with empty caption\n */\nexport interface InputInlineResultGif extends BaseInputInlineResult {\n type: 'gif'\n\n /**\n * The animation itself.\n *\n * Can be a URL, a TDLib and Bot API compatible File ID,\n * or a TL object representing either of them.\n */\n media: string | tl.RawInputWebDocument | tl.RawInputDocument\n\n /**\n * Media MIME type, only applicable to URLs.\n *\n * Usually unnecessary, since Telegram automatically infers it.\n *\n * @default `video/mp4`\n */\n mime?: string\n\n /**\n * Title of the result\n */\n title?: string\n\n /**\n * Title of the result\n */\n description?: string\n\n /**\n * Animation thumbnail URL, only applicable in case `media` is a URL\n *\n * @default `media`\n */\n thumb?: string | tl.RawInputWebDocument\n\n /**\n * Thumbnail MIME type\n *\n * @default `image/jpeg`\n */\n thumbMime?: string\n\n /**\n * Width of the animation in pixels\n */\n width?: number\n\n /**\n * Height of the animation in pixels\n */\n height?: number\n\n /**\n * Duration of the animation in seconds\n */\n duration?: number\n}\n\n/**\n * Inline result containing a video (only MP4)\n *\n * If `message` is not provided, {@link InputInlineMessageMedia} is used\n * with empty caption for non-embed videos, {@link InputInlineMessageText}\n * is used with text containing the URL for embed videos.\n */\nexport interface InputInlineResultVideo extends BaseInputInlineResult {\n type: 'video'\n\n /**\n * The video itself, or a page containing an embedded video\n *\n * Can be a URL, a TDLib and Bot API compatible File ID,\n * or a TL object representing either of them.\n */\n media: string | tl.RawInputWebDocument | tl.RawInputDocument\n\n /**\n * In case `media` is a URL, whether that URL is a link\n * to an embedded video player.\n */\n isEmbed?: boolean\n\n /**\n * Title of the result\n */\n title: string\n\n /**\n * Description of the result\n */\n description?: string\n\n /**\n * Video thumbnail URL (must be jpeg), only applicable in case `media` is a URL.\n *\n * Must be provided explicitly if this is a video loaded by URL.\n *\n * @default `media`\n */\n thumb?: string | tl.RawInputWebDocument\n\n /**\n * Width of the video in pixels\n */\n width?: number\n\n /**\n * Height of the video in pixels\n */\n height?: number\n\n /**\n * Duration of the video in seconds\n */\n duration?: number\n}\n\n/**\n * Inline result containing an audio file\n *\n * If `message` is not provided, {@link InputInlineMessageMedia} is used\n * with empty caption.\n */\nexport interface InputInlineResultAudio extends BaseInputInlineResult {\n type: 'audio'\n\n /**\n * The audio itself\n *\n * Can be a URL, a TDLib and Bot API compatible File ID,\n * or a TL object representing either of them.\n */\n media: string | tl.RawInputWebDocument | tl.RawInputDocument\n\n /**\n * MIME type of the audio file\n *\n * Usually unnecessary, since Telegram infers it automatically.\n *\n * @default `audio/mpeg`\n */\n mime?: string\n\n /**\n * Title of the audio track\n */\n title: string\n\n /**\n * Performer of the audio track\n */\n performer?: string\n\n /**\n * Duration of the audio in seconds\n */\n duration?: number\n}\n\n/**\n * Inline result containing a voice note\n *\n * If `message` is not provided, {@link InputInlineMessageMedia} is used\n * with empty caption.\n */\nexport interface InputInlineResultVoice extends BaseInputInlineResult {\n type: 'voice'\n\n /**\n * The voice itself (.ogg, preferably encoded with OPUS)\n *\n * Can be a URL, a TDLib and Bot API compatible File ID,\n * or a TL object representing either of them.\n */\n media: string | tl.RawInputWebDocument | tl.RawInputDocument\n\n /**\n * Title of the result\n */\n title: string\n\n /**\n * Duration of the voice note in seconds\n */\n duration?: number\n}\n\n/**\n * Inline result containing a photo\n *\n * If `message` is not provided, {@link InputInlineMessageMedia} is used\n * with empty caption.\n */\nexport interface InputInlineResultPhoto extends BaseInputInlineResult {\n type: 'photo'\n\n /**\n * The photo itself\n *\n * Can be a URL, a TDLib and Bot API compatible File ID,\n * or a TL object representing either of them.\n */\n media: string | tl.RawInputWebDocument | tl.RawInputPhoto\n\n /**\n * Title of the result\n */\n title?: string\n\n /**\n * Description of the result\n */\n description?: string\n\n /**\n * Width of the photo in pixels\n */\n width?: number\n\n /**\n * Height of the photo in pixels\n */\n height?: number\n\n /**\n * Photo thumbnail URL (must be jpeg), only applicable in case `media` is a URL\n *\n * @default `media`\n */\n thumb?: string | tl.RawInputWebDocument\n}\n\n/**\n * Inline result containing a sticker\n *\n * If `message` is not provided, {@link InputInlineMessageMedia} is used.\n */\nexport interface InputInlineResultSticker extends BaseInputInlineResult {\n type: 'sticker'\n\n /**\n * The sticker itself. Can't be a URL.\n */\n media: string | tl.RawInputDocument\n}\n\n/**\n * Inline result containing a document\n *\n * If `message` is not provided, {@link InputInlineMessageMedia} is used\n * with empty caption.\n */\nexport interface InputInlineResultFile extends BaseInputInlineResult {\n type: 'file'\n\n /**\n * The file itself. When using URL, only PDF and ZIP are supported.\n *\n * Can be a URL, a TDLib and Bot API compatible File ID,\n * or a TL object representing either of them.\n */\n media: string | tl.RawInputWebDocument | tl.RawInputDocument\n\n /**\n * MIME type of the file.\n *\n * Due to some Telegram limitation, you can only send\n * PDF and ZIP files from URL\n * (`application/pdf` and `application/zip` MIMEs respectively).\n *\n * Must be provided if `media` is a URL\n */\n mime?: string\n\n /**\n * Title of the result\n */\n title: string\n\n /**\n * Description of the result\n */\n description?: string\n\n /**\n * Photo thumbnail URL (must be jpeg), only applicable in case `media` is a URL\n *\n * @default `media`\n */\n thumb?: string | tl.RawInputWebDocument\n}\n\n/**\n * Inline result containing a geolocation.\n *\n * If `message` is not passed, a {@link InputInlineMessageGeo} is\n * used, with the `latitude` and `longitude` parameters set\n * accordingly\n */\nexport interface InputInlineResultGeo extends BaseInputInlineResult {\n type: 'geo'\n\n /**\n * Title of the result\n */\n title: string\n\n /**\n * Latitude of the geolocation\n */\n latitude: number\n\n /**\n * Longitude of the geolocation\n */\n longitude: number\n\n /**\n * Location thumbnail URL (must be jpeg).\n *\n * By default, Telegram generates one based on\n * the location set by `latitude` and `longitude`\n */\n thumb?: string | tl.RawInputWebDocument\n}\n\n/**\n * Inline result containing a venue.\n *\n * If `message` is not passed, {@link BotInlineMessage.venue} is used with\n * given `latitude` and `longitude` were passed.\n * If they weren't passed either, an error is thrown.\n */\nexport interface InputInlineResultVenue extends BaseInputInlineResult {\n type: 'venue'\n\n /**\n * Title of the venue\n */\n title: string\n\n /**\n * Address of the venue\n */\n address: string\n\n /**\n * Latitude of the geolocation\n */\n latitude?: number\n\n /**\n * Longitude of the geolocation\n */\n longitude?: number\n\n /**\n * Venue thumbnail URL (must be jpeg).\n *\n * By default, Telegram generates one based on\n * the location in the `message`\n */\n thumb?: string | tl.RawInputWebDocument\n}\n\n/**\n * Inline result containing a game.\n *\n * If `message` is not passed, {@link InputInlineMessageGame} is used.\n *\n * Note that `message` can only be {@link InputInlineMessageGame}\n */\nexport interface InputInlineResultGame extends BaseInputInlineResult {\n type: 'game'\n\n /**\n * Short name of the game\n */\n shortName: string\n}\n\n/**\n * Inline result containing a contact.\n *\n * If `message` is not passed, {@link InputInlineMessageContact} is used.\n */\nexport interface InputInlineResultContact extends BaseInputInlineResult {\n type: 'contact'\n\n /**\n * First name of the contact\n */\n firstName: string\n\n /**\n * Last name of the contact\n */\n lastName?: string\n\n /**\n * Phone number of the contact\n */\n phone: string\n\n /**\n * Contact thumbnail URL (i.e. their avatar) (must be jpeg)\n */\n thumb?: string | tl.RawInputWebDocument\n}\n\nexport type InputInlineResult =\n | InputInlineResultArticle\n | InputInlineResultGif\n | InputInlineResultVideo\n | InputInlineResultAudio\n | InputInlineResultVoice\n | InputInlineResultPhoto\n | InputInlineResultSticker\n | InputInlineResultFile\n | InputInlineResultGeo\n | InputInlineResultVenue\n | InputInlineResultGame\n | InputInlineResultContact\n\n// eslint-disable-next-line @typescript-eslint/no-namespace\nexport namespace BotInline {\n /**\n * Create an inline result containing an article\n *\n * @param id Inline result ID\n * @param params Article\n */\n export function article(\n id: string,\n params: Omit<InputInlineResultArticle, 'type' | 'id'>,\n ): InputInlineResultArticle {\n const ret = params as tl.Mutable<InputInlineResultArticle>\n ret.id = id\n ret.type = 'article'\n\n return ret\n }\n\n /**\n * Create an inline result containing a GIF\n *\n * @param id Inline result ID\n * @param media GIF animation\n * @param params Additional parameters\n */\n export function gif(\n id: string,\n media: string | tl.RawInputWebDocument | tl.RawInputDocument,\n params: Omit<InputInlineResultGif, 'type' | 'id' | 'media'> = {},\n ): InputInlineResultGif {\n const ret = params as tl.Mutable<InputInlineResultGif>\n ret.id = id\n ret.type = 'gif'\n ret.media = media\n\n return ret\n }\n\n /**\n * Create an inline result containing a video\n *\n * @param id Inline result ID\n * @param media Video\n * @param params Additional parameters\n */\n export function video(\n id: string,\n media: string | tl.RawInputWebDocument | tl.RawInputDocument,\n params: Omit<InputInlineResultVideo, 'type' | 'id' | 'media'>,\n ): InputInlineResultVideo {\n const ret = params as tl.Mutable<InputInlineResultVideo>\n ret.id = id\n ret.type = 'video'\n ret.media = media\n\n return ret\n }\n\n /**\n * Create an inline result containing an audio file\n *\n * @param id Inline result ID\n * @param media Audio file\n * @param params Additional parameters\n */\n export function audio(\n id: string,\n media: string | tl.RawInputWebDocument | tl.RawInputDocument,\n params: Omit<InputInlineResultAudio, 'type' | 'id' | 'media'>,\n ): InputInlineResultAudio {\n const ret = params as tl.Mutable<InputInlineResultAudio>\n ret.id = id\n ret.type = 'audio'\n ret.media = media\n\n return ret\n }\n\n /**\n * Create an inline result containing a voice note\n *\n * @param id Inline result ID\n * @param media Voice note\n * @param params Additional parameters\n */\n export function voice(\n id: string,\n media: string | tl.RawInputWebDocument | tl.RawInputDocument,\n params: Omit<InputInlineResultVoice, 'type' | 'id' | 'media'>,\n ): InputInlineResultVoice {\n const ret = params as tl.Mutable<InputInlineResultVoice>\n ret.id = id\n ret.type = 'voice'\n ret.media = media\n\n return ret\n }\n\n /**\n * Create an inline result containing a photo\n *\n * @param id Inline result ID\n * @param media Photo\n * @param params Additional parameters\n */\n export function photo(\n id: string,\n media: string | tl.RawInputWebDocument | tl.RawInputPhoto,\n params: Omit<InputInlineResultPhoto, 'type' | 'id' | 'media'> = {},\n ): InputInlineResultPhoto {\n const ret = params as tl.Mutable<InputInlineResultPhoto>\n ret.id = id\n ret.type = 'photo'\n ret.media = media\n\n return ret\n }\n\n /**\n * Create an inline result containing a sticker\n *\n * @param id Inline result ID\n * @param media Sticker\n */\n export function sticker(id: string, media: string | tl.RawInputDocument): InputInlineResultSticker {\n return {\n id,\n type: 'sticker',\n media,\n }\n }\n\n /**\n * Create an inline result containing a document\n * (only PDF and ZIP are supported when using URL)\n *\n * @param id Inline result ID\n * @param media Document\n * @param params Additional parameters\n */\n export function file(\n id: string,\n media: string | tl.RawInputWebDocument | tl.RawInputDocument,\n params: Omit<InputInlineResultFile, 'type' | 'id' | 'media'>,\n ): InputInlineResultFile {\n const ret = params as tl.Mutable<InputInlineResultFile>\n ret.id = id\n ret.type = 'file'\n ret.media = media\n\n return ret\n }\n\n /**\n * Create an inline result containing a geolocation\n *\n * @param id Inline result ID\n * @param params Additional parameters\n */\n export function geo(id: string, params: Omit<InputInlineResultGeo, 'type' | 'id'>): InputInlineResultGeo {\n const ret = params as tl.Mutable<InputInlineResultGeo>\n ret.id = id\n ret.type = 'geo'\n\n return ret\n }\n\n /**\n * Create an inline result containing a venue\n *\n * @param id Inline result ID\n * @param params Venue parameters\n */\n export function venue(id: string, params: Omit<InputInlineResultVenue, 'type' | 'id'>): InputInlineResultVenue {\n const ret = params as tl.Mutable<InputInlineResultVenue>\n ret.id = id\n ret.type = 'venue'\n\n return ret\n }\n\n /**\n * Create an inline result containing a contact\n *\n * @param id Inline result ID\n * @param params Contact parameters\n */\n export function contact(\n id: string,\n params: Omit<InputInlineResultContact, 'type' | 'id'>,\n ): InputInlineResultContact {\n const ret = params as tl.Mutable<InputInlineResultContact>\n ret.id = id\n ret.type = 'contact'\n\n return ret\n }\n\n /**\n * Create an inline result containing a game\n *\n * @param id Inline result ID\n * @param shortName Short name of the game\n * @param params Additional parameters\n */\n export function game(\n id: string,\n shortName: string,\n params: Omit<InputInlineResultGame, 'type' | 'id' | 'shortName'> = {},\n ): InputInlineResultGame {\n const ret = params as tl.Mutable<InputInlineResultGame>\n ret.id = id\n ret.type = 'game'\n ret.shortName = shortName\n\n return ret\n }\n\n /** @internal */\n export async function _convertToTl(\n client: ITelegramClient,\n results: InputInlineResult[],\n ): Promise<[boolean, tl.TypeInputBotInlineResult[]]> {\n const normalizeThumb = (obj: InputInlineResult, fallback?: string): tl.RawInputWebDocument | undefined => {\n if (obj.type !== 'voice' && obj.type !== 'audio' && obj.type !== 'sticker' && obj.type !== 'game') {\n if (!obj.thumb || typeof obj.thumb === 'string') {\n if (!obj.thumb && !fallback) {\n return undefined\n }\n\n return {\n _: 'inputWebDocument',\n size: 0,\n url: obj.thumb || fallback!,\n mimeType: obj.type === 'gif' ? obj.thumbMime ?? obj.mime ?? 'video/mp4' : 'image/jpeg',\n attributes: [],\n }\n }\n\n return obj.thumb\n }\n }\n\n const items: tl.TypeInputBotInlineResult[] = []\n\n let isGallery = false\n let forceVertical = false\n\n for (const obj of results) {\n switch (obj.type) {\n case 'article': {\n forceVertical = true\n\n let sendMessage: tl.TypeInputBotInlineMessage\n\n if (obj.message) {\n sendMessage = await BotInlineMessage._convertToTl(client, obj.message)\n } else {\n let message = obj.title\n const entities: tl.TypeMessageEntity[] = [\n {\n _: 'messageEntityBold',\n offset: 0,\n length: message.length,\n },\n ]\n\n if (obj.url) {\n entities.push({\n _: 'messageEntityTextUrl',\n url: obj.url,\n offset: 0,\n length: message.length,\n })\n }\n\n if (obj.description) {\n message += '\\n' + obj.description\n }\n\n sendMessage = {\n _: 'inputBotInlineMessageText',\n message,\n entities,\n }\n }\n\n items.push({\n _: 'inputBotInlineResult',\n id: obj.id,\n type: obj.type,\n title: obj.title,\n description: obj.description,\n url: obj.hideUrl ? undefined : obj.url,\n content:\n obj.url && obj.hideUrl ?\n {\n _: 'inputWebDocument',\n url: obj.url,\n mimeType: 'text/html',\n size: 0,\n attributes: [],\n } :\n undefined,\n thumb: typeof obj.thumb === 'string' ? normalizeThumb(obj) : obj.thumb,\n sendMessage,\n })\n continue\n }\n case 'game': {\n let sendMessage: tl.TypeInputBotInlineMessage\n\n if (obj.message) {\n sendMessage = await BotInlineMessage._convertToTl(client, obj.message)\n\n if (sendMessage._ !== 'inputBotInlineMessageGame') {\n throw new MtArgumentError('game inline result must contain a game inline message')\n }\n } else {\n sendMessage = {\n _: 'inputBotInlineMessageGame',\n }\n }\n\n items.push({\n _: 'inputBotInlineResultGame',\n id: obj.id,\n shortName: obj.shortName,\n sendMessage,\n })\n continue\n }\n case 'gif':\n case 'photo':\n case 'sticker':\n isGallery = true\n break\n case 'audio':\n case 'contact':\n case 'voice':\n forceVertical = true\n }\n\n let sendMessage: tl.TypeInputBotInlineMessage\n\n if (obj.message) {\n sendMessage = await BotInlineMessage._convertToTl(client, obj.message)\n } else if (obj.type === 'venue') {\n if (obj.latitude && obj.longitude) {\n sendMessage = {\n _: 'inputBotInlineMessageMediaVenue',\n title: obj.title,\n address: obj.address,\n geoPoint: {\n _: 'inputGeoPoint',\n lat: obj.latitude,\n long: obj.longitude,\n },\n provider: '',\n venueId: '',\n venueType: '',\n }\n } else {\n throw new MtArgumentError('message or location (lat&lon) bust be supplied for venue inline result')\n }\n } else if (obj.type === 'video' && obj.isEmbed && typeof obj.media === 'string') {\n sendMessage = {\n _: 'inputBotInlineMessageText',\n message: obj.media,\n }\n } else if (obj.type === 'geo') {\n sendMessage = {\n _: 'inputBotInlineMessageMediaGeo',\n geoPoint: {\n _: 'inputGeoPoint',\n lat: obj.latitude,\n long: obj.longitude,\n },\n }\n } else if (obj.type === 'contact') {\n sendMessage = {\n _: 'inputBotInlineMessageMediaContact',\n phoneNumber: obj.phone,\n firstName: obj.firstName,\n lastName: obj.lastName ?? '',\n vcard: '',\n }\n } else {\n sendMessage = {\n _: 'inputBotInlineMessageMediaAuto',\n message: '',\n }\n }\n\n let media: tl.TypeInputWebDocument | tl.TypeInputDocument | tl.TypeInputPhoto | undefined = undefined\n\n if (obj.type !== 'geo' && obj.type !== 'venue' && obj.type !== 'contact') {\n if (typeof obj.media === 'string') {\n // file id or url\n if (obj.media.match(/^https?:\\/\\//)) {\n if (obj.type === 'sticker') {\n throw new MtArgumentError('sticker inline result cannot contain a URL')\n }\n\n let mime: string\n if (obj.type === 'video') mime = 'video/mp4'\n else if (obj.type === 'audio') {\n mime = obj.mime ?? 'audio/mpeg'\n } else if (obj.type === 'gif') {\n mime = obj.mime ?? 'video/mp4'\n } else if (obj.type === 'voice') mime = 'audio/ogg'\n else if (obj.type === 'file') {\n if (!obj.mime) {\n throw new MtArgumentError('MIME type must be specified for file inline result')\n }\n\n mime = obj.mime\n } else mime = 'image/jpeg'\n\n const attributes: tl.TypeDocumentAttribute[] = []\n\n if (\n (obj.type === 'video' || obj.type === 'gif' || obj.type === 'photo') &&\n obj.width &&\n obj.height\n ) {\n if (obj.type !== 'photo' && obj.duration) {\n attributes.push({\n _: 'documentAttributeVideo',\n w: obj.width,\n h: obj.height,\n duration: obj.duration,\n })\n } else {\n attributes.push({\n _: 'documentAttributeImageSize',\n w: obj.width,\n h: obj.height,\n })\n }\n } else if (obj.type === 'audio' || obj.type === 'voice') {\n attributes.push({\n _: 'documentAttributeAudio',\n voice: obj.type === 'voice',\n duration: obj.duration ?? 0,\n title: obj.type === 'audio' ? obj.title : '',\n performer: obj.type === 'audio' ? obj.performer : '',\n })\n }\n\n attributes.push({\n _: 'documentAttributeFilename',\n fileName: extractFileName(obj.media),\n })\n\n media = {\n _: 'inputWebDocument',\n url: obj.media,\n mimeType: mime,\n size: 0,\n attributes,\n }\n } else if (obj.type === 'photo') {\n media = fileIdToInputPhoto(obj.media)\n } else {\n media = fileIdToInputDocument(obj.media)\n }\n } else {\n media = obj.media\n }\n }\n\n let title: string | undefined = undefined\n let description: string | undefined = undefined\n\n // incredible hacks by durov team.\n // i honestly don't understand why didn't they just\n // make a bunch of types, as they normally do,\n // but whatever.\n // ref: https://github.com/tdlib/td/blob/master/td/telegram/InlineQueriesManager.cpp\n if (obj.type === 'contact') {\n title = obj.lastName?.length ? `${obj.firstName} ${obj.lastName}` : obj.firstName\n } else if (obj.type !== 'sticker') {\n title = obj.title\n }\n\n if (obj.type === 'audio') {\n description = obj.performer\n } else if (obj.type === 'geo') {\n description = `${obj.latitude} ${obj.longitude}`\n } else if (obj.type === 'venue') {\n description = obj.address\n } else if (obj.type === 'contact') {\n description = obj.phone\n } else if (obj.type !== 'voice' && obj.type !== 'sticker') {\n description = obj.description\n }\n\n if (!media || media._ === 'inputWebDocument') {\n items.push({\n _: 'inputBotInlineResult',\n id: obj.id,\n type: obj.type,\n title,\n description,\n content: media,\n thumb: normalizeThumb(obj, media?.url),\n sendMessage,\n })\n continue\n }\n\n if (media._ === 'inputPhoto') {\n items.push({\n _: 'inputBotInlineResultPhoto',\n id: obj.id,\n type: obj.type,\n photo: media,\n sendMessage,\n })\n continue\n }\n\n items.push({\n _: 'inputBotInlineResultDocument',\n id: obj.id,\n type: obj.type,\n title,\n description,\n document: media,\n sendMessage,\n })\n }\n\n return [isGallery && !forceVertical, items]\n }\n}\n"]}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"keyboard-builder.js","sourceRoot":"","sources":["../../../../../src/highlevel/types/bots/keyboard-builder.ts"],"names":[],"mappings":";;;AAMA;;GAEG;AACH,MAAa,kBAAkB;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;QACtD,IAAI,OAAO,GAAG,KAAK,UAAU;YAAE,GAAG,GAAG,GAAG,EAAE,CAAA;QAC1C,IAAI,CAAC,GAAG;YAAE,OAAO,IAAI,CAAA;QAErB,IACI,IAAI,CAAC,QAAQ,CAAC,MAAM;YACpB,CAAC,IAAI,CAAC,WAAW,KAAK,IAAI,IAAI,KAAK,IAAI,IAAI,CAAC,QAAQ,CAAC,IAAI,CAAC,QAAQ,CAAC,MAAM,GAAG,CAAC,CAAC,CAAC,MAAM,GAAG,IAAI,CAAC,WAAW,CAAC,EAC3G;YACE,IAAI,CAAC,QAAQ,CAAC,IAAI,CAAC,QAAQ,CAAC,MAAM,GAAG,CAAC,CAAC,CAAC,IAAI,CAAC,GAAG,CAAC,CAAA;SACpD;aAAM;YACH,IAAI,CAAC,QAAQ,CAAC,IAAI,CAAC,CAAC,GAAG,CAAC,CAAC,CAAA;SAC5B;QAED,OAAO,IAAI,CAAA;IACf,CAAC;IAED;;OAEG;IACH,QAAQ;QACJ,OAAO;YACH,IAAI,EAAE,QAAQ;YACd,OAAO,EAAE,IAAI,CAAC,QAAQ;SACzB,CAAA;IACL,CAAC;IAED;;OAEG;IACH,OAAO,CAAC,SAAwD,EAAE;QAC9D,MAAM,GAAG,GAAG,MAAyC,CAAA;QACrD,GAAG,CAAC,IAAI,GAAG,OAAO,CAAA;QAClB,GAAG,CAAC,OAAO,GAAG,IAAI,CAAC,QAAQ,CAAA;QAE3B,OAAO,GAAG,CAAA;IACd,CAAC;CACJ;AA7FD,gDA6FC","sourcesContent":["import { tl } from '@mtcute/tl'\n\nimport type { InlineKeyboardMarkup, ReplyKeyboardMarkup } from './keyboards.js'\n\nexport type ButtonLike = tl.TypeKeyboardButton | false | null | undefined | void\n\n/**\n * Builder for bot keyboards\n */\nexport class BotKeyboardBuilder {\n private _buttons: tl.TypeKeyboardButton[][] = []\n\n constructor(readonly maxRowWidth: number | null = 3) {}\n\n /**\n * Add buttons, wrapping them once {@link maxRowWidth} is reached\n *\n * @param buttons Buttons to add\n */\n push(...buttons: (ButtonLike | (() => ButtonLike))[]): this {\n if (!buttons.length) return this\n\n let row: tl.TypeKeyboardButton[] = []\n buttons.forEach((btn) => {\n if (typeof btn === 'function') btn = btn()\n if (!btn) return\n\n row.push(btn)\n\n if (row.length === this.maxRowWidth) {\n this._buttons.push(row)\n row = []\n }\n })\n\n if (row.length) {\n this._buttons.push(row)\n }\n\n return this\n }\n\n /**\n * Add a row of buttons. Will not be wrapped.\n *\n * @param row Row or a function that will populate it\n */\n row(row: ButtonLike[] | ((arr: ButtonLike[]) => void)): this {\n if (typeof row === 'function') {\n const fn = row\n row = []\n fn(row)\n }\n\n const normal = row.filter(Boolean) as tl.TypeKeyboardButton[]\n if (normal.length) this._buttons.push(normal)\n\n return this\n }\n\n /**\n * Append a button to the last row, wrapping if needed.\n *\n * @param btn Button to add\n * @param force Whether to forcefully add the button (i.e. do not wrap)\n */\n append(btn: ButtonLike | (() => ButtonLike), force = false): this {\n if (typeof btn === 'function') btn = btn()\n if (!btn) return this\n\n if (\n this._buttons.length &&\n (this.maxRowWidth === null || force || this._buttons[this._buttons.length - 1].length < this.maxRowWidth)\n ) {\n this._buttons[this._buttons.length - 1].push(btn)\n } else {\n this._buttons.push([btn])\n }\n\n return this\n }\n\n /**\n * Return contents of this builder as an inline keyboard\n */\n asInline(): InlineKeyboardMarkup {\n return {\n type: 'inline',\n buttons: this._buttons,\n }\n }\n\n /**\n * Return contents of this builder as a reply keyboard\n */\n asReply(params: Omit<ReplyKeyboardMarkup, 'type' | 'buttons'> = {}): ReplyKeyboardMarkup {\n const ret = params as tl.Mutable<ReplyKeyboardMarkup>\n ret.type = 'reply'\n ret.buttons = this._buttons\n\n return ret\n }\n}\n"]}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export {};
|