@mtcute/core 0.7.2 → 0.8.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/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 +17 -13
- 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/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/authorization.js +1 -0
- package/cjs/network/authorization.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/mtproto-session.d.ts +1 -0
- package/cjs/network/mtproto-session.js +7 -1
- package/cjs/network/mtproto-session.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 +21 -7
- 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 +1 -2
- package/cjs/storage/index.js +1 -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/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 +17 -13
- 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/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/authorization.js +1 -0
- package/esm/network/authorization.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/mtproto-session.d.ts +1 -0
- package/esm/network/mtproto-session.js +7 -1
- package/esm/network/mtproto-session.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 +21 -7
- 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 +1 -2
- package/esm/storage/index.js +1 -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/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 +24 -52
- 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
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
import { tl } from '@mtcute/tl';
|
|
2
|
+
/**
|
|
3
|
+
* Reply keyboard markup
|
|
4
|
+
*/
|
|
5
|
+
export interface ReplyKeyboardMarkup extends Omit<tl.RawReplyKeyboardMarkup, '_' | 'rows'> {
|
|
6
|
+
readonly type: 'reply';
|
|
7
|
+
/**
|
|
8
|
+
* Two-dimensional array of buttons
|
|
9
|
+
*/
|
|
10
|
+
readonly buttons: tl.TypeKeyboardButton[][];
|
|
11
|
+
}
|
|
12
|
+
/**
|
|
13
|
+
* Hide previously sent bot keyboard
|
|
14
|
+
*/
|
|
15
|
+
export interface ReplyKeyboardHide extends Omit<tl.RawReplyKeyboardHide, '_'> {
|
|
16
|
+
readonly type: 'reply_hide';
|
|
17
|
+
}
|
|
18
|
+
/**
|
|
19
|
+
* Force the user to send a reply
|
|
20
|
+
*/
|
|
21
|
+
export interface ReplyKeyboardForceReply extends Omit<tl.RawReplyKeyboardForceReply, '_'> {
|
|
22
|
+
readonly type: 'force_reply';
|
|
23
|
+
}
|
|
24
|
+
/**
|
|
25
|
+
* Inline keyboard markup
|
|
26
|
+
*/
|
|
27
|
+
export interface InlineKeyboardMarkup {
|
|
28
|
+
readonly type: 'inline';
|
|
29
|
+
/**
|
|
30
|
+
* Two-dimensional array of buttons
|
|
31
|
+
*/
|
|
32
|
+
readonly buttons: tl.TypeKeyboardButton[][];
|
|
33
|
+
}
|
|
34
|
+
export type ReplyMarkup = ReplyKeyboardMarkup | ReplyKeyboardHide | ReplyKeyboardForceReply | InlineKeyboardMarkup | tl.TypeReplyMarkup;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"types.js","sourceRoot":"","sources":["../../../../../../src/highlevel/types/bots/keyboards/types.ts"],"names":[],"mappings":"","sourcesContent":["import { tl } from '@mtcute/tl'\n\n/**\n * Reply keyboard markup\n */\nexport interface ReplyKeyboardMarkup extends Omit<tl.RawReplyKeyboardMarkup, '_' | 'rows'> {\n readonly type: 'reply'\n\n /**\n * Two-dimensional array of buttons\n */\n readonly buttons: tl.TypeKeyboardButton[][]\n}\n\n/**\n * Hide previously sent bot keyboard\n */\nexport interface ReplyKeyboardHide extends Omit<tl.RawReplyKeyboardHide, '_'> {\n readonly type: 'reply_hide'\n}\n\n/**\n * Force the user to send a reply\n */\nexport interface ReplyKeyboardForceReply extends Omit<tl.RawReplyKeyboardForceReply, '_'> {\n readonly type: 'force_reply'\n}\n\n/**\n * Inline keyboard markup\n */\nexport interface InlineKeyboardMarkup {\n readonly type: 'inline'\n\n /**\n * Two-dimensional array of buttons\n */\n readonly buttons: tl.TypeKeyboardButton[][]\n}\n\nexport type ReplyMarkup =\n | ReplyKeyboardMarkup\n | ReplyKeyboardHide\n | ReplyKeyboardForceReply\n | InlineKeyboardMarkup\n | tl.TypeReplyMarkup\n"]}
|
|
@@ -5,7 +5,7 @@ import { makeInspectable } from '../../utils/index.js';
|
|
|
5
5
|
* Catch-all class for all kinds of Telegram file locations,
|
|
6
6
|
* including ones that are embedded directly into the entity.
|
|
7
7
|
*/
|
|
8
|
-
|
|
8
|
+
class FileLocation {
|
|
9
9
|
constructor(
|
|
10
10
|
/**
|
|
11
11
|
* Location of the file.
|
|
@@ -31,5 +31,6 @@ export class FileLocation {
|
|
|
31
31
|
this.dcId = dcId;
|
|
32
32
|
}
|
|
33
33
|
}
|
|
34
|
-
makeInspectable(FileLocation,
|
|
35
|
-
//# sourceMappingURL=file-location.js.map
|
|
34
|
+
const FileLocation$1 = /*#__PURE__*/makeInspectable(FileLocation, ['fileSize', 'dcId']);
|
|
35
|
+
//# sourceMappingURL=file-location.js.map
|
|
36
|
+
export { FileLocation$1 as FileLocation }
|
|
@@ -14,7 +14,7 @@ const STUB_LOCATION = () => {
|
|
|
14
14
|
* > and web pages (i.e. `mimeType = text/html`) usually aren't.
|
|
15
15
|
* > To be sure, check `isDownloadable` property.
|
|
16
16
|
*/
|
|
17
|
-
|
|
17
|
+
class WebDocument extends FileLocation {
|
|
18
18
|
constructor(raw) {
|
|
19
19
|
super(raw._ === 'webDocument' ?
|
|
20
20
|
{
|
|
@@ -49,5 +49,6 @@ export class WebDocument extends FileLocation {
|
|
|
49
49
|
return this.raw._ === 'webDocument';
|
|
50
50
|
}
|
|
51
51
|
}
|
|
52
|
-
makeInspectable(WebDocument);
|
|
53
|
-
//# sourceMappingURL=web-document.js.map
|
|
52
|
+
const WebDocument$1 = /*#__PURE__*/makeInspectable(WebDocument, );
|
|
53
|
+
//# sourceMappingURL=web-document.js.map
|
|
54
|
+
export { WebDocument$1 as WebDocument }
|
|
@@ -5,7 +5,7 @@ import { RawDocument } from './document.js';
|
|
|
5
5
|
/**
|
|
6
6
|
* An audio file
|
|
7
7
|
*/
|
|
8
|
-
|
|
8
|
+
class Audio extends RawDocument {
|
|
9
9
|
/** Type of the file for File ID generation */
|
|
10
10
|
_fileIdType() {
|
|
11
11
|
return tdFileId.FileType.Audio;
|
|
@@ -39,6 +39,7 @@ export class Audio extends RawDocument {
|
|
|
39
39
|
return this.attr.title ?? null;
|
|
40
40
|
}
|
|
41
41
|
}
|
|
42
|
-
memoizeGetters(Audio,
|
|
43
|
-
makeInspectable(Audio,
|
|
44
|
-
//# sourceMappingURL=audio.js.map
|
|
42
|
+
const Audio$1 = /*#__PURE__*/memoizeGetters(Audio, ['fileName', 'thumbnails', 'fileId', 'uniqueFileId']);
|
|
43
|
+
const Audio$2 = /*#__PURE__*/makeInspectable(Audio$1, ['fileSize', 'dcId'], ['inputMedia', 'inputDocument']);
|
|
44
|
+
//# sourceMappingURL=audio.js.map
|
|
45
|
+
export { Audio$2 as Audio }
|
|
@@ -2,7 +2,7 @@ import { makeInspectable } from '../../utils/index.js';
|
|
|
2
2
|
/**
|
|
3
3
|
* A phone contact
|
|
4
4
|
*/
|
|
5
|
-
|
|
5
|
+
class Contact {
|
|
6
6
|
constructor(obj) {
|
|
7
7
|
this.obj = obj;
|
|
8
8
|
this.type = 'contact';
|
|
@@ -43,5 +43,6 @@ export class Contact {
|
|
|
43
43
|
};
|
|
44
44
|
}
|
|
45
45
|
}
|
|
46
|
-
makeInspectable(Contact,
|
|
47
|
-
//# sourceMappingURL=contact.js.map
|
|
46
|
+
const Contact$1 = /*#__PURE__*/makeInspectable(Contact, undefined, ['inputMedia']);
|
|
47
|
+
//# sourceMappingURL=contact.js.map
|
|
48
|
+
export { Contact$1 as Contact }
|
|
@@ -2,7 +2,7 @@ import { makeInspectable } from '../../utils/index.js';
|
|
|
2
2
|
/**
|
|
3
3
|
* A dice or another interactive random emoji.
|
|
4
4
|
*/
|
|
5
|
-
|
|
5
|
+
class Dice {
|
|
6
6
|
constructor(obj) {
|
|
7
7
|
this.obj = obj;
|
|
8
8
|
this.type = 'dice';
|
|
@@ -163,5 +163,6 @@ Dice.TYPE_BOWLING = '🎳';
|
|
|
163
163
|
* Currently, this sticker set is used for the machine: [SlotMachineAnimated](https://t.me/addstickers/SlotMachineAnimated)
|
|
164
164
|
*/
|
|
165
165
|
Dice.TYPE_SLOTS = '🎰';
|
|
166
|
-
makeInspectable(Dice,
|
|
167
|
-
//# sourceMappingURL=dice.js.map
|
|
166
|
+
const Dice$1 = /*#__PURE__*/makeInspectable(Dice, undefined, ['inputMedia']);
|
|
167
|
+
//# sourceMappingURL=dice.js.map
|
|
168
|
+
export { Dice$1 as Dice }
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import { tdFileId as td, toFileId, toUniqueFileId } from '@mtcute/file-id';
|
|
2
|
+
import { getPlatform } from '../../../platform.js';
|
|
2
3
|
import { makeInspectable } from '../../utils/index.js';
|
|
3
4
|
import { memoizeGetters } from '../../utils/memoize.js';
|
|
4
5
|
import { FileLocation } from '../files/index.js';
|
|
@@ -99,7 +100,7 @@ export class RawDocument extends FileLocation {
|
|
|
99
100
|
* representing this document.
|
|
100
101
|
*/
|
|
101
102
|
get fileId() {
|
|
102
|
-
return toFileId({
|
|
103
|
+
return toFileId(getPlatform(), {
|
|
103
104
|
type: this._fileIdType(),
|
|
104
105
|
dcId: this.raw.dcId,
|
|
105
106
|
fileReference: this.raw.fileReference,
|
|
@@ -114,7 +115,7 @@ export class RawDocument extends FileLocation {
|
|
|
114
115
|
* Get a unique File ID representing this document.
|
|
115
116
|
*/
|
|
116
117
|
get uniqueFileId() {
|
|
117
|
-
return toUniqueFileId(td.FileType.Document, {
|
|
118
|
+
return toUniqueFileId(getPlatform(), td.FileType.Document, {
|
|
118
119
|
_: 'common',
|
|
119
120
|
id: this.raw.id,
|
|
120
121
|
});
|
|
@@ -127,12 +128,13 @@ export class RawDocument extends FileLocation {
|
|
|
127
128
|
* and only used for documents without any special
|
|
128
129
|
* attributes.
|
|
129
130
|
*/
|
|
130
|
-
|
|
131
|
+
class Document extends RawDocument {
|
|
131
132
|
constructor() {
|
|
132
133
|
super(...arguments);
|
|
133
134
|
this.type = 'document';
|
|
134
135
|
}
|
|
135
136
|
}
|
|
136
|
-
memoizeGetters(Document,
|
|
137
|
-
makeInspectable(Document,
|
|
138
|
-
//# sourceMappingURL=document.js.map
|
|
137
|
+
const Document$1 = /*#__PURE__*/memoizeGetters(Document, ['fileName', 'thumbnails', 'fileId', 'uniqueFileId']);
|
|
138
|
+
const Document$2 = /*#__PURE__*/makeInspectable(Document$1, ['fileSize', 'dcId'], ['inputMedia', 'inputDocument']);
|
|
139
|
+
//# sourceMappingURL=document.js.map
|
|
140
|
+
export { Document$2 as Document }
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"document.js","sourceRoot":"","sources":["../../../../../src/highlevel/types/media/document.ts"],"names":[],"mappings":"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
|
|
1
|
+
{"version":3,"file":"document.js","sourceRoot":"","sources":["../../../../../src/highlevel/types/media/document.ts"],"names":[],"mappings":"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","sourcesContent":["import { tdFileId as td, toFileId, toUniqueFileId } from '@mtcute/file-id'\nimport { tl } from '@mtcute/tl'\n\nimport { getPlatform } from '../../../platform.js'\nimport { makeInspectable } from '../../utils/index.js'\nimport { memoizeGetters } from '../../utils/memoize.js'\nimport { FileLocation } from '../files/index.js'\nimport { Thumbnail } from './thumbnail.js'\n\n/**\n * A file that is represented as a document in MTProto.\n *\n * This also includes audios, videos, voices etc.\n */\nexport abstract class RawDocument extends FileLocation {\n /** Type of the media (for use in a tagged union) */\n abstract type: string\n\n constructor(readonly raw: tl.RawDocument) {\n super(\n {\n _: 'inputDocumentFileLocation',\n id: raw.id,\n fileReference: raw.fileReference,\n accessHash: raw.accessHash,\n thumbSize: '',\n },\n raw.size,\n raw.dcId,\n )\n this.raw = raw\n }\n\n /**\n * Original file name, extracted from the document\n * attributes.\n */\n get fileName(): string | null {\n const attr = this.raw.attributes.find((it) => it._ === 'documentAttributeFilename')\n\n return attr ? (attr as tl.RawDocumentAttributeFilename).fileName : null\n }\n\n /**\n * File MIME type, as defined by the sender.\n */\n get mimeType(): string {\n return this.raw.mimeType\n }\n\n /**\n * Date the document was sent\n */\n get date(): Date {\n return new Date(this.raw.date * 1000)\n }\n\n /**\n * Available thumbnails, if any.\n *\n * If there are no thumbnails, the array will be empty.\n */\n get thumbnails(): ReadonlyArray<Thumbnail> {\n const arr: Thumbnail[] = []\n\n this.raw.thumbs?.forEach((sz) => arr.push(new Thumbnail(this.raw, sz)))\n this.raw.videoThumbs?.forEach((sz) => arr.push(new Thumbnail(this.raw, sz)))\n\n return arr\n }\n\n /**\n * Get a thumbnail by its type.\n *\n * Thumbnail types are described in the\n * [Telegram docs](https://core.telegram.org/api/files#image-thumbnail-types),\n * and are also available as static members of {@link Thumbnail} for convenience.\n *\n * @param type Thumbnail type\n */\n getThumbnail(type: string): Thumbnail | null {\n return (\n this.thumbnails.find((it) => {\n if (it.raw._ === 'videoSizeEmojiMarkup' || it.raw._ === 'videoSizeStickerMarkup') {\n return false\n }\n\n return it.raw.type === type\n }) ?? null\n )\n }\n\n /**\n * Input document TL object generated from this object,\n * to be used with methods that use it\n */\n get inputDocument(): tl.TypeInputDocument {\n return {\n _: 'inputDocument',\n id: this.raw.id,\n accessHash: this.raw.accessHash,\n fileReference: this.raw.fileReference,\n }\n }\n\n /**\n * Input media TL object generated from this object,\n * to be used inside {@link InputMediaLike} and\n * {@link TelegramClient.sendMedia}\n */\n get inputMedia(): tl.TypeInputMedia {\n return {\n _: 'inputMediaDocument',\n id: this.inputDocument,\n }\n }\n\n protected _fileIdType(): td.FileType {\n return td.FileType.Document\n }\n\n /**\n * Get TDLib and Bot API compatible File ID\n * representing this document.\n */\n get fileId(): string {\n return toFileId(getPlatform(), {\n type: this._fileIdType(),\n dcId: this.raw.dcId,\n fileReference: this.raw.fileReference,\n location: {\n _: 'common',\n id: this.raw.id,\n accessHash: this.raw.accessHash,\n },\n })\n }\n\n /**\n * Get a unique File ID representing this document.\n */\n get uniqueFileId(): string {\n return toUniqueFileId(getPlatform(), td.FileType.Document, {\n _: 'common',\n id: this.raw.id,\n })\n }\n}\n\n/**\n * A generic file.\n *\n * This does not include audios, videos, voices etc.\n * and only used for documents without any special\n * attributes.\n */\nexport class Document extends RawDocument {\n readonly type = 'document' as const\n}\n\nmemoizeGetters(Document, ['fileName', 'thumbnails', 'fileId', 'uniqueFileId'])\nmakeInspectable(Document, ['fileSize', 'dcId'], ['inputMedia', 'inputDocument'])\n"]}
|
|
@@ -2,7 +2,7 @@ import { makeInspectable } from '../../utils/index.js';
|
|
|
2
2
|
import { memoizeGetters } from '../../utils/memoize.js';
|
|
3
3
|
import { Photo } from './photo.js';
|
|
4
4
|
import { Video } from './video.js';
|
|
5
|
-
|
|
5
|
+
class Game {
|
|
6
6
|
constructor(game) {
|
|
7
7
|
this.game = game;
|
|
8
8
|
this.type = 'game';
|
|
@@ -67,6 +67,7 @@ export class Game {
|
|
|
67
67
|
};
|
|
68
68
|
}
|
|
69
69
|
}
|
|
70
|
-
memoizeGetters(Game,
|
|
71
|
-
makeInspectable(Game,
|
|
72
|
-
//# sourceMappingURL=game.js.map
|
|
70
|
+
const Game$1 = /*#__PURE__*/memoizeGetters(Game, ['photo', 'animation']);
|
|
71
|
+
const Game$2 = /*#__PURE__*/makeInspectable(Game$1, undefined, ['inputMedia']);
|
|
72
|
+
//# sourceMappingURL=game.js.map
|
|
73
|
+
export { Game$2 as Game }
|
|
@@ -3,7 +3,7 @@ export * from './contact.js';
|
|
|
3
3
|
export * from './dice.js';
|
|
4
4
|
export * from './document.js';
|
|
5
5
|
export * from './game.js';
|
|
6
|
-
export * from './input-media.js';
|
|
6
|
+
export * from './input-media/index.js';
|
|
7
7
|
export * from './invoice.js';
|
|
8
8
|
export * from './location.js';
|
|
9
9
|
export * from './photo.js';
|
|
@@ -3,7 +3,7 @@ export * from './contact.js';
|
|
|
3
3
|
export * from './dice.js';
|
|
4
4
|
export * from './document.js';
|
|
5
5
|
export * from './game.js';
|
|
6
|
-
export * from './input-media.js';
|
|
6
|
+
export * from './input-media/index.js';
|
|
7
7
|
export * from './invoice.js';
|
|
8
8
|
export * from './location.js';
|
|
9
9
|
export * from './photo.js';
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../../src/highlevel/types/media/index.ts"],"names":[],"mappings":"AAAA,cAAc,YAAY,CAAA;AAC1B,cAAc,cAAc,CAAA;AAC5B,cAAc,WAAW,CAAA;AACzB,cAAc,eAAe,CAAA;AAC7B,cAAc,WAAW,CAAA;AACzB,cAAc,
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../../src/highlevel/types/media/index.ts"],"names":[],"mappings":"AAAA,cAAc,YAAY,CAAA;AAC1B,cAAc,cAAc,CAAA;AAC5B,cAAc,WAAW,CAAA;AACzB,cAAc,eAAe,CAAA;AAC7B,cAAc,WAAW,CAAA;AACzB,cAAc,wBAAwB,CAAA;AACtC,cAAc,cAAc,CAAA;AAC5B,cAAc,eAAe,CAAA;AAC7B,cAAc,YAAY,CAAA;AAC1B,cAAc,WAAW,CAAA;AACzB,cAAc,cAAc,CAAA;AAC5B,cAAc,YAAY,CAAA;AAC1B,cAAc,gBAAgB,CAAA;AAC9B,cAAc,YAAY,CAAA;AAC1B,cAAc,YAAY,CAAA;AAC1B,cAAc,YAAY,CAAA;AAC1B,cAAc,eAAe,CAAA","sourcesContent":["export * from './audio.js'\nexport * from './contact.js'\nexport * from './dice.js'\nexport * from './document.js'\nexport * from './game.js'\nexport * from './input-media/index.js'\nexport * from './invoice.js'\nexport * from './location.js'\nexport * from './photo.js'\nexport * from './poll.js'\nexport * from './sticker.js'\nexport * from './story.js'\nexport * from './thumbnail.js'\nexport * from './venue.js'\nexport * from './video.js'\nexport * from './voice.js'\nexport * from './web-page.js'\n"]}
|
|
@@ -0,0 +1,141 @@
|
|
|
1
|
+
import { tl } from '@mtcute/tl';
|
|
2
|
+
import { InputFileLike } from '../../files/utils.js';
|
|
3
|
+
import { CaptionMixin, InputMediaAudio, InputMediaAuto, InputMediaContact, InputMediaDice, InputMediaDocument, InputMediaGame, InputMediaGeo, InputMediaGeoLive, InputMediaInvoice, InputMediaLike, InputMediaPhoto, InputMediaPoll, InputMediaQuiz, InputMediaSticker, InputMediaStory, InputMediaVenue, InputMediaVideo, InputMediaVoice, InputMediaWebpage } from './types.js';
|
|
4
|
+
/** Omit `type` and `file` from the given type */
|
|
5
|
+
export type OmitTypeAndFile<T extends InputMediaLike, K extends keyof T = never> = Omit<T, 'type' | 'file' | K>;
|
|
6
|
+
/**
|
|
7
|
+
* Create an animation to be sent
|
|
8
|
+
*
|
|
9
|
+
* @param file Animation
|
|
10
|
+
* @param params Additional parameters
|
|
11
|
+
*/
|
|
12
|
+
export declare function animation(file: InputFileLike, params?: OmitTypeAndFile<InputMediaVideo>): InputMediaVideo;
|
|
13
|
+
/**
|
|
14
|
+
* Create an audio to be sent
|
|
15
|
+
*
|
|
16
|
+
* @param file Audio file
|
|
17
|
+
* @param params Additional parameters
|
|
18
|
+
*/
|
|
19
|
+
export declare function audio(file: InputFileLike, params?: OmitTypeAndFile<InputMediaAudio>): InputMediaAudio;
|
|
20
|
+
/**
|
|
21
|
+
* Create an document to be sent
|
|
22
|
+
*
|
|
23
|
+
* @param file Document
|
|
24
|
+
* @param params Additional parameters
|
|
25
|
+
*/
|
|
26
|
+
export declare function document(file: InputFileLike, params?: OmitTypeAndFile<InputMediaDocument>): InputMediaDocument;
|
|
27
|
+
/**
|
|
28
|
+
* Create an photo to be sent
|
|
29
|
+
*
|
|
30
|
+
* @param file Photo
|
|
31
|
+
* @param params Additional parameters
|
|
32
|
+
*/
|
|
33
|
+
export declare function photo(file: InputFileLike, params?: OmitTypeAndFile<InputMediaPhoto>): InputMediaPhoto;
|
|
34
|
+
/**
|
|
35
|
+
* Create an video to be sent
|
|
36
|
+
*
|
|
37
|
+
* @param file Video
|
|
38
|
+
* @param params Additional parameters
|
|
39
|
+
*/
|
|
40
|
+
export declare function video(file: InputFileLike, params?: OmitTypeAndFile<InputMediaVideo>): InputMediaVideo;
|
|
41
|
+
/**
|
|
42
|
+
* Create a voice note to be sent
|
|
43
|
+
*
|
|
44
|
+
* @param file Voice note
|
|
45
|
+
* @param params Additional parameters
|
|
46
|
+
*/
|
|
47
|
+
export declare function voice(file: InputFileLike, params?: OmitTypeAndFile<InputMediaVoice>): InputMediaVoice;
|
|
48
|
+
/**
|
|
49
|
+
* Create a sticker to be sent
|
|
50
|
+
*
|
|
51
|
+
* @param file Sticker
|
|
52
|
+
* @param params Additional parameters
|
|
53
|
+
*/
|
|
54
|
+
export declare function sticker(file: InputFileLike, params?: OmitTypeAndFile<InputMediaSticker>): InputMediaSticker;
|
|
55
|
+
/**
|
|
56
|
+
* Create a venue to be sent
|
|
57
|
+
*
|
|
58
|
+
* @param params Venue parameters
|
|
59
|
+
*/
|
|
60
|
+
export declare function venue(params: OmitTypeAndFile<InputMediaVenue>): InputMediaVenue;
|
|
61
|
+
/**
|
|
62
|
+
* Create a geolocation to be sent
|
|
63
|
+
*
|
|
64
|
+
* @param latitude Latitude of the location
|
|
65
|
+
* @param longitude Longitude of the location
|
|
66
|
+
* @param params Additional parameters
|
|
67
|
+
*/
|
|
68
|
+
export declare function geo(latitude: number, longitude: number, params?: OmitTypeAndFile<InputMediaGeo, 'latitude' | 'longitude'>): InputMediaGeo;
|
|
69
|
+
/**
|
|
70
|
+
* Create a live geolocation to be sent
|
|
71
|
+
*
|
|
72
|
+
* @param latitude Latitude of the current location
|
|
73
|
+
* @param longitude Longitude of the current location
|
|
74
|
+
* @param params Additional parameters
|
|
75
|
+
*/
|
|
76
|
+
export declare function geoLive(latitude: number, longitude: number, params?: OmitTypeAndFile<InputMediaGeoLive, 'latitude' | 'longitude'>): InputMediaGeoLive;
|
|
77
|
+
/**
|
|
78
|
+
* Create a dice to be sent
|
|
79
|
+
*
|
|
80
|
+
* For convenience, known dice emojis are available
|
|
81
|
+
* as static members of {@link Dice}.
|
|
82
|
+
*
|
|
83
|
+
* @param emoji Emoji representing the dice
|
|
84
|
+
* @param params Additional parameters
|
|
85
|
+
*/
|
|
86
|
+
export declare function dice(emoji: string, params: CaptionMixin): InputMediaDice;
|
|
87
|
+
/**
|
|
88
|
+
* Create a contact to be sent
|
|
89
|
+
*
|
|
90
|
+
* @param params Contact parameters
|
|
91
|
+
*/
|
|
92
|
+
export declare function contact(params: OmitTypeAndFile<InputMediaContact>): InputMediaContact;
|
|
93
|
+
/**
|
|
94
|
+
* Create a game to be sent
|
|
95
|
+
*
|
|
96
|
+
* @param game Game short name or TL object representing one
|
|
97
|
+
*/
|
|
98
|
+
export declare function game(game: string | tl.TypeInputGame): InputMediaGame;
|
|
99
|
+
/**
|
|
100
|
+
* Create an invoice to be sent
|
|
101
|
+
*
|
|
102
|
+
* @param params Invoice parameters
|
|
103
|
+
*/
|
|
104
|
+
export declare function invoice(params: OmitTypeAndFile<InputMediaInvoice>): InputMediaInvoice;
|
|
105
|
+
/**
|
|
106
|
+
* Create a poll to be sent
|
|
107
|
+
*
|
|
108
|
+
* @param params Poll parameters
|
|
109
|
+
*/
|
|
110
|
+
export declare function poll(params: OmitTypeAndFile<InputMediaPoll>): InputMediaPoll;
|
|
111
|
+
/**
|
|
112
|
+
* Create a quiz to be sent
|
|
113
|
+
*
|
|
114
|
+
* @param params Quiz parameters
|
|
115
|
+
*/
|
|
116
|
+
export declare function quiz(params: OmitTypeAndFile<InputMediaQuiz>): InputMediaQuiz;
|
|
117
|
+
/**
|
|
118
|
+
* Create a story to be sent
|
|
119
|
+
*
|
|
120
|
+
* @param params Story parameters
|
|
121
|
+
*/
|
|
122
|
+
export declare function story(params: OmitTypeAndFile<InputMediaStory>): InputMediaStory;
|
|
123
|
+
/**
|
|
124
|
+
* Create a webpage to be sent
|
|
125
|
+
*
|
|
126
|
+
* @param url Webpage URL
|
|
127
|
+
* @param params Additional parameters
|
|
128
|
+
*/
|
|
129
|
+
export declare function webpage(url: string, params?: OmitTypeAndFile<InputMediaWebpage, 'url'>): InputMediaWebpage;
|
|
130
|
+
/**
|
|
131
|
+
* Create a document to be sent, which subtype
|
|
132
|
+
* is inferred automatically by file contents.
|
|
133
|
+
*
|
|
134
|
+
* Photo type is only inferred for reused files,
|
|
135
|
+
* newly uploaded photos with `auto` will be
|
|
136
|
+
* uploaded as a document
|
|
137
|
+
*
|
|
138
|
+
* @param file The media file
|
|
139
|
+
* @param params Additional parameters
|
|
140
|
+
*/
|
|
141
|
+
export declare function auto(file: InputFileLike, params?: OmitTypeAndFile<InputMediaAuto>): InputMediaAuto;
|
|
@@ -0,0 +1,228 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Create an animation to be sent
|
|
3
|
+
*
|
|
4
|
+
* @param file Animation
|
|
5
|
+
* @param params Additional parameters
|
|
6
|
+
*/
|
|
7
|
+
export function animation(file, params = {}) {
|
|
8
|
+
const ret = params;
|
|
9
|
+
ret.type = 'video';
|
|
10
|
+
ret.file = file;
|
|
11
|
+
ret.isAnimated = true;
|
|
12
|
+
return ret;
|
|
13
|
+
}
|
|
14
|
+
/**
|
|
15
|
+
* Create an audio to be sent
|
|
16
|
+
*
|
|
17
|
+
* @param file Audio file
|
|
18
|
+
* @param params Additional parameters
|
|
19
|
+
*/
|
|
20
|
+
export function audio(file, params = {}) {
|
|
21
|
+
const ret = params;
|
|
22
|
+
ret.type = 'audio';
|
|
23
|
+
ret.file = file;
|
|
24
|
+
return ret;
|
|
25
|
+
}
|
|
26
|
+
/**
|
|
27
|
+
* Create an document to be sent
|
|
28
|
+
*
|
|
29
|
+
* @param file Document
|
|
30
|
+
* @param params Additional parameters
|
|
31
|
+
*/
|
|
32
|
+
export function document(file, params = {}) {
|
|
33
|
+
const ret = params;
|
|
34
|
+
ret.type = 'document';
|
|
35
|
+
ret.file = file;
|
|
36
|
+
return ret;
|
|
37
|
+
}
|
|
38
|
+
/**
|
|
39
|
+
* Create an photo to be sent
|
|
40
|
+
*
|
|
41
|
+
* @param file Photo
|
|
42
|
+
* @param params Additional parameters
|
|
43
|
+
*/
|
|
44
|
+
export function photo(file, params = {}) {
|
|
45
|
+
const ret = params;
|
|
46
|
+
ret.type = 'photo';
|
|
47
|
+
ret.file = file;
|
|
48
|
+
return ret;
|
|
49
|
+
}
|
|
50
|
+
/**
|
|
51
|
+
* Create an video to be sent
|
|
52
|
+
*
|
|
53
|
+
* @param file Video
|
|
54
|
+
* @param params Additional parameters
|
|
55
|
+
*/
|
|
56
|
+
export function video(file, params = {}) {
|
|
57
|
+
const ret = params;
|
|
58
|
+
ret.type = 'video';
|
|
59
|
+
ret.file = file;
|
|
60
|
+
return ret;
|
|
61
|
+
}
|
|
62
|
+
/**
|
|
63
|
+
* Create a voice note to be sent
|
|
64
|
+
*
|
|
65
|
+
* @param file Voice note
|
|
66
|
+
* @param params Additional parameters
|
|
67
|
+
*/
|
|
68
|
+
export function voice(file, params = {}) {
|
|
69
|
+
const ret = params;
|
|
70
|
+
ret.type = 'voice';
|
|
71
|
+
ret.file = file;
|
|
72
|
+
return ret;
|
|
73
|
+
}
|
|
74
|
+
/**
|
|
75
|
+
* Create a sticker to be sent
|
|
76
|
+
*
|
|
77
|
+
* @param file Sticker
|
|
78
|
+
* @param params Additional parameters
|
|
79
|
+
*/
|
|
80
|
+
export function sticker(file, params = {}) {
|
|
81
|
+
const ret = params;
|
|
82
|
+
ret.type = 'sticker';
|
|
83
|
+
ret.file = file;
|
|
84
|
+
return ret;
|
|
85
|
+
}
|
|
86
|
+
/**
|
|
87
|
+
* Create a venue to be sent
|
|
88
|
+
*
|
|
89
|
+
* @param params Venue parameters
|
|
90
|
+
*/
|
|
91
|
+
export function venue(params) {
|
|
92
|
+
const ret = params;
|
|
93
|
+
ret.type = 'venue';
|
|
94
|
+
return ret;
|
|
95
|
+
}
|
|
96
|
+
/**
|
|
97
|
+
* Create a geolocation to be sent
|
|
98
|
+
*
|
|
99
|
+
* @param latitude Latitude of the location
|
|
100
|
+
* @param longitude Longitude of the location
|
|
101
|
+
* @param params Additional parameters
|
|
102
|
+
*/
|
|
103
|
+
export function geo(latitude, longitude, params = {}) {
|
|
104
|
+
const ret = params;
|
|
105
|
+
ret.type = 'geo';
|
|
106
|
+
ret.latitude = latitude;
|
|
107
|
+
ret.longitude = longitude;
|
|
108
|
+
return ret;
|
|
109
|
+
}
|
|
110
|
+
/**
|
|
111
|
+
* Create a live geolocation to be sent
|
|
112
|
+
*
|
|
113
|
+
* @param latitude Latitude of the current location
|
|
114
|
+
* @param longitude Longitude of the current location
|
|
115
|
+
* @param params Additional parameters
|
|
116
|
+
*/
|
|
117
|
+
export function geoLive(latitude, longitude, params = {}) {
|
|
118
|
+
const ret = params;
|
|
119
|
+
ret.type = 'geo_live';
|
|
120
|
+
ret.latitude = latitude;
|
|
121
|
+
ret.longitude = longitude;
|
|
122
|
+
return ret;
|
|
123
|
+
}
|
|
124
|
+
/**
|
|
125
|
+
* Create a dice to be sent
|
|
126
|
+
*
|
|
127
|
+
* For convenience, known dice emojis are available
|
|
128
|
+
* as static members of {@link Dice}.
|
|
129
|
+
*
|
|
130
|
+
* @param emoji Emoji representing the dice
|
|
131
|
+
* @param params Additional parameters
|
|
132
|
+
*/
|
|
133
|
+
export function dice(emoji, params) {
|
|
134
|
+
const ret = params;
|
|
135
|
+
ret.type = 'dice';
|
|
136
|
+
return ret;
|
|
137
|
+
}
|
|
138
|
+
/**
|
|
139
|
+
* Create a contact to be sent
|
|
140
|
+
*
|
|
141
|
+
* @param params Contact parameters
|
|
142
|
+
*/
|
|
143
|
+
export function contact(params) {
|
|
144
|
+
const ret = params;
|
|
145
|
+
ret.type = 'contact';
|
|
146
|
+
return ret;
|
|
147
|
+
}
|
|
148
|
+
/**
|
|
149
|
+
* Create a game to be sent
|
|
150
|
+
*
|
|
151
|
+
* @param game Game short name or TL object representing one
|
|
152
|
+
*/
|
|
153
|
+
export function game(game) {
|
|
154
|
+
return {
|
|
155
|
+
type: 'game',
|
|
156
|
+
game,
|
|
157
|
+
};
|
|
158
|
+
}
|
|
159
|
+
/**
|
|
160
|
+
* Create an invoice to be sent
|
|
161
|
+
*
|
|
162
|
+
* @param params Invoice parameters
|
|
163
|
+
*/
|
|
164
|
+
export function invoice(params) {
|
|
165
|
+
const ret = params;
|
|
166
|
+
ret.type = 'invoice';
|
|
167
|
+
return ret;
|
|
168
|
+
}
|
|
169
|
+
/**
|
|
170
|
+
* Create a poll to be sent
|
|
171
|
+
*
|
|
172
|
+
* @param params Poll parameters
|
|
173
|
+
*/
|
|
174
|
+
export function poll(params) {
|
|
175
|
+
const ret = params;
|
|
176
|
+
ret.type = 'poll';
|
|
177
|
+
return ret;
|
|
178
|
+
}
|
|
179
|
+
/**
|
|
180
|
+
* Create a quiz to be sent
|
|
181
|
+
*
|
|
182
|
+
* @param params Quiz parameters
|
|
183
|
+
*/
|
|
184
|
+
export function quiz(params) {
|
|
185
|
+
const ret = params;
|
|
186
|
+
ret.type = 'quiz';
|
|
187
|
+
return ret;
|
|
188
|
+
}
|
|
189
|
+
/**
|
|
190
|
+
* Create a story to be sent
|
|
191
|
+
*
|
|
192
|
+
* @param params Story parameters
|
|
193
|
+
*/
|
|
194
|
+
export function story(params) {
|
|
195
|
+
const ret = params;
|
|
196
|
+
ret.type = 'story';
|
|
197
|
+
return ret;
|
|
198
|
+
}
|
|
199
|
+
/**
|
|
200
|
+
* Create a webpage to be sent
|
|
201
|
+
*
|
|
202
|
+
* @param url Webpage URL
|
|
203
|
+
* @param params Additional parameters
|
|
204
|
+
*/
|
|
205
|
+
export function webpage(url, params = {}) {
|
|
206
|
+
const ret = params;
|
|
207
|
+
ret.type = 'webpage';
|
|
208
|
+
ret.url = url;
|
|
209
|
+
return ret;
|
|
210
|
+
}
|
|
211
|
+
/**
|
|
212
|
+
* Create a document to be sent, which subtype
|
|
213
|
+
* is inferred automatically by file contents.
|
|
214
|
+
*
|
|
215
|
+
* Photo type is only inferred for reused files,
|
|
216
|
+
* newly uploaded photos with `auto` will be
|
|
217
|
+
* uploaded as a document
|
|
218
|
+
*
|
|
219
|
+
* @param file The media file
|
|
220
|
+
* @param params Additional parameters
|
|
221
|
+
*/
|
|
222
|
+
export function auto(file, params = {}) {
|
|
223
|
+
const ret = params;
|
|
224
|
+
ret.type = 'auto';
|
|
225
|
+
ret.file = file;
|
|
226
|
+
return ret;
|
|
227
|
+
}
|
|
228
|
+
//# sourceMappingURL=factories.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"factories.js","sourceRoot":"","sources":["../../../../../../src/highlevel/types/media/input-media/factories.ts"],"names":[],"mappings":"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","sourcesContent":["import { tl } from '@mtcute/tl'\n\nimport { InputFileLike } from '../../files/utils.js'\nimport {\n CaptionMixin,\n InputMediaAudio,\n InputMediaAuto,\n InputMediaContact,\n InputMediaDice,\n InputMediaDocument,\n InputMediaGame,\n InputMediaGeo,\n InputMediaGeoLive,\n InputMediaInvoice,\n InputMediaLike,\n InputMediaPhoto,\n InputMediaPoll,\n InputMediaQuiz,\n InputMediaSticker,\n InputMediaStory,\n InputMediaVenue,\n InputMediaVideo,\n InputMediaVoice,\n InputMediaWebpage,\n} from './types.js'\n\n/** Omit `type` and `file` from the given type */\nexport type OmitTypeAndFile<T extends InputMediaLike, K extends keyof T = never> = Omit<T, 'type' | 'file' | K>\n\n/**\n * Create an animation to be sent\n *\n * @param file Animation\n * @param params Additional parameters\n */\nexport function animation(file: InputFileLike, params: OmitTypeAndFile<InputMediaVideo> = {}): InputMediaVideo {\n const ret = params as tl.Mutable<InputMediaVideo>\n ret.type = 'video'\n ret.file = file\n ret.isAnimated = true\n\n return ret\n}\n\n/**\n * Create an audio to be sent\n *\n * @param file Audio file\n * @param params Additional parameters\n */\nexport function audio(file: InputFileLike, params: OmitTypeAndFile<InputMediaAudio> = {}): InputMediaAudio {\n const ret = params as tl.Mutable<InputMediaAudio>\n ret.type = 'audio'\n ret.file = file\n\n return ret\n}\n\n/**\n * Create an document to be sent\n *\n * @param file Document\n * @param params Additional parameters\n */\nexport function document(file: InputFileLike, params: OmitTypeAndFile<InputMediaDocument> = {}): InputMediaDocument {\n const ret = params as tl.Mutable<InputMediaDocument>\n ret.type = 'document'\n ret.file = file\n\n return ret\n}\n\n/**\n * Create an photo to be sent\n *\n * @param file Photo\n * @param params Additional parameters\n */\nexport function photo(file: InputFileLike, params: OmitTypeAndFile<InputMediaPhoto> = {}): InputMediaPhoto {\n const ret = params as tl.Mutable<InputMediaPhoto>\n ret.type = 'photo'\n ret.file = file\n\n return ret\n}\n\n/**\n * Create an video to be sent\n *\n * @param file Video\n * @param params Additional parameters\n */\nexport function video(file: InputFileLike, params: OmitTypeAndFile<InputMediaVideo> = {}): InputMediaVideo {\n const ret = params as tl.Mutable<InputMediaVideo>\n ret.type = 'video'\n ret.file = file\n\n return ret\n}\n\n/**\n * Create a voice note to be sent\n *\n * @param file Voice note\n * @param params Additional parameters\n */\nexport function voice(file: InputFileLike, params: OmitTypeAndFile<InputMediaVoice> = {}): InputMediaVoice {\n const ret = params as tl.Mutable<InputMediaVoice>\n ret.type = 'voice'\n ret.file = file\n\n return ret\n}\n\n/**\n * Create a sticker to be sent\n *\n * @param file Sticker\n * @param params Additional parameters\n */\nexport function sticker(file: InputFileLike, params: OmitTypeAndFile<InputMediaSticker> = {}): InputMediaSticker {\n const ret = params as tl.Mutable<InputMediaSticker>\n ret.type = 'sticker'\n ret.file = file\n\n return ret\n}\n\n/**\n * Create a venue to be sent\n *\n * @param params Venue parameters\n */\nexport function venue(params: OmitTypeAndFile<InputMediaVenue>): InputMediaVenue {\n const ret = params as tl.Mutable<InputMediaVenue>\n ret.type = 'venue'\n\n return ret\n}\n\n/**\n * Create a geolocation to be sent\n *\n * @param latitude Latitude of the location\n * @param longitude Longitude of the location\n * @param params Additional parameters\n */\nexport function geo(\n latitude: number,\n longitude: number,\n params: OmitTypeAndFile<InputMediaGeo, 'latitude' | 'longitude'> = {},\n): InputMediaGeo {\n const ret = params as tl.Mutable<InputMediaGeo>\n ret.type = 'geo'\n ret.latitude = latitude\n ret.longitude = longitude\n\n return ret\n}\n\n/**\n * Create a live geolocation to be sent\n *\n * @param latitude Latitude of the current location\n * @param longitude Longitude of the current location\n * @param params Additional parameters\n */\nexport function geoLive(\n latitude: number,\n longitude: number,\n params: OmitTypeAndFile<InputMediaGeoLive, 'latitude' | 'longitude'> = {},\n): InputMediaGeoLive {\n const ret = params as tl.Mutable<InputMediaGeoLive>\n ret.type = 'geo_live'\n ret.latitude = latitude\n ret.longitude = longitude\n\n return ret\n}\n\n/**\n * Create a dice to be sent\n *\n * For convenience, known dice emojis are available\n * as static members of {@link Dice}.\n *\n * @param emoji Emoji representing the dice\n * @param params Additional parameters\n */\nexport function dice(emoji: string, params: CaptionMixin): InputMediaDice {\n const ret = params as tl.Mutable<InputMediaDice>\n ret.type = 'dice'\n\n return ret\n}\n\n/**\n * Create a contact to be sent\n *\n * @param params Contact parameters\n */\nexport function contact(params: OmitTypeAndFile<InputMediaContact>): InputMediaContact {\n const ret = params as tl.Mutable<InputMediaContact>\n ret.type = 'contact'\n\n return ret\n}\n\n/**\n * Create a game to be sent\n *\n * @param game Game short name or TL object representing one\n */\nexport function game(game: string | tl.TypeInputGame): InputMediaGame {\n return {\n type: 'game',\n game,\n }\n}\n\n/**\n * Create an invoice to be sent\n *\n * @param params Invoice parameters\n */\nexport function invoice(params: OmitTypeAndFile<InputMediaInvoice>): InputMediaInvoice {\n const ret = params as tl.Mutable<InputMediaInvoice>\n ret.type = 'invoice'\n\n return ret\n}\n\n/**\n * Create a poll to be sent\n *\n * @param params Poll parameters\n */\nexport function poll(params: OmitTypeAndFile<InputMediaPoll>): InputMediaPoll {\n const ret = params as tl.Mutable<InputMediaPoll>\n ret.type = 'poll'\n\n return ret\n}\n\n/**\n * Create a quiz to be sent\n *\n * @param params Quiz parameters\n */\nexport function quiz(params: OmitTypeAndFile<InputMediaQuiz>): InputMediaQuiz {\n const ret = params as tl.Mutable<InputMediaQuiz>\n ret.type = 'quiz'\n\n return ret\n}\n\n/**\n * Create a story to be sent\n *\n * @param params Story parameters\n */\nexport function story(params: OmitTypeAndFile<InputMediaStory>): InputMediaStory {\n const ret = params as tl.Mutable<InputMediaStory>\n ret.type = 'story'\n\n return ret\n}\n\n/**\n * Create a webpage to be sent\n *\n * @param url Webpage URL\n * @param params Additional parameters\n */\nexport function webpage(url: string, params: OmitTypeAndFile<InputMediaWebpage, 'url'> = {}): InputMediaWebpage {\n const ret = params as tl.Mutable<InputMediaWebpage>\n ret.type = 'webpage'\n ret.url = url\n\n return ret\n}\n\n/**\n * Create a document to be sent, which subtype\n * is inferred automatically by file contents.\n *\n * Photo type is only inferred for reused files,\n * newly uploaded photos with `auto` will be\n * uploaded as a document\n *\n * @param file The media file\n * @param params Additional parameters\n */\nexport function auto(file: InputFileLike, params: OmitTypeAndFile<InputMediaAuto> = {}): InputMediaAuto {\n const ret = params as tl.Mutable<InputMediaAuto>\n ret.type = 'auto'\n ret.file = file\n\n return ret\n}\n"]}
|