@mtkruto/node 0.67.1 → 0.68.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/esm/0_errors.js +2 -6
- package/esm/3_errors.js +2 -12
- package/esm/3_transport.d.ts +3 -3
- package/esm/3_transport.js +3 -3
- package/esm/3_types.d.ts +8 -7
- package/esm/3_types.d.ts.map +1 -1
- package/esm/3_types.js +8 -7
- package/esm/4_errors.js +2 -12
- package/esm/_dnt.polyfills.d.ts +99 -0
- package/esm/_dnt.polyfills.d.ts.map +1 -1
- package/esm/_dnt.polyfills.js +127 -1
- package/esm/_dnt.test_polyfills.d.ts.map +1 -0
- package/esm/client/0_filters_test.d.ts.map +1 -1
- package/esm/client/0_markdown_test.d.ts.map +1 -1
- package/esm/client/0_params.d.ts +2 -0
- package/esm/client/0_params.d.ts.map +1 -1
- package/esm/client/0_password.d.ts +5 -5
- package/esm/client/0_password.d.ts.map +1 -1
- package/esm/client/0_password_test.d.ts.map +1 -1
- package/esm/client/0_storage_operations.js +143 -155
- package/esm/client/0_storage_operations_test.d.ts.map +1 -1
- package/esm/client/0_utilities.d.ts +1 -1
- package/esm/client/0_utilities_test.d.ts.map +1 -1
- package/esm/client/1_client_plain.js +4 -22
- package/esm/client/1_composer.js +8 -21
- package/esm/client/2_account_manager.js +85 -97
- package/esm/client/2_bot_info_manager.js +26 -38
- package/esm/client/2_business_connection_manager.js +10 -23
- package/esm/client/2_client_encrypted.js +194 -211
- package/esm/client/2_file_manager.d.ts +4 -3
- package/esm/client/2_file_manager.d.ts.map +1 -1
- package/esm/client/2_file_manager.js +268 -224
- package/esm/client/2_file_manager_test.d.ts.map +1 -1
- package/esm/client/2_network_statistics_manager.js +8 -21
- package/esm/client/2_payment_manager.js +7 -20
- package/esm/client/2_reaction_manager.js +7 -20
- package/esm/client/2_translations_manager.js +97 -107
- package/esm/client/2_update_manager.js +764 -759
- package/esm/client/3_client_encrypted_pool.js +10 -26
- package/esm/client/3_client_encrypted_pool_test.d.ts.map +1 -1
- package/esm/client/3_message_manager.d.ts +1 -1
- package/esm/client/3_message_manager.js +441 -448
- package/esm/client/3_message_manager_test.d.ts.map +1 -1
- package/esm/client/3_video_chat_manager.d.ts +1 -1
- package/esm/client/3_video_chat_manager.js +57 -68
- package/esm/client/4_callback_query_manager.js +18 -30
- package/esm/client/4_chat_list_manager.js +322 -318
- package/esm/client/4_chat_manager.js +118 -131
- package/esm/client/4_forum_manager.js +67 -73
- package/esm/client/4_gift_manager.js +16 -29
- package/esm/client/4_inline_query_manager.js +16 -28
- package/esm/client/4_link_preview_manager.js +6 -19
- package/esm/client/4_poll_manager.js +44 -57
- package/esm/client/4_story_manager.js +41 -53
- package/esm/client/5_client.d.ts +7 -0
- package/esm/client/5_client.d.ts.map +1 -1
- package/esm/client/5_client.js +1271 -1290
- package/esm/connection/1_connection_tcp.node.js +48 -65
- package/esm/connection/1_connection_web_socket.js +75 -91
- package/esm/deps/jsr.io/@roj/tgcrypto/1.0.1/dist/tgcrypto.js +3 -11
- package/esm/deps/jsr.io/@std/assert/1.0.13/equals.js +4 -4
- package/esm/deps/jsr.io/@std/async/1.0.13/mux_async_iterator.js +31 -47
- package/esm/deps/jsr.io/@std/async/1.0.13/tee.js +11 -34
- package/esm/deps/jsr.io/@std/datetime/0.225.5/_date_time_formatter.js +4 -17
- package/esm/deps/jsr.io/@std/internal/1.0.10/build_message.d.ts.map +1 -0
- package/esm/deps/jsr.io/@std/internal/1.0.10/diff.d.ts.map +1 -0
- package/esm/deps/jsr.io/@std/internal/1.0.10/diff_str.d.ts.map +1 -0
- package/esm/deps/jsr.io/@std/internal/1.0.10/format.d.ts +29 -0
- package/esm/deps/jsr.io/@std/internal/1.0.10/format.d.ts.map +1 -0
- package/esm/deps/jsr.io/@std/internal/1.0.10/format.js +70 -0
- package/esm/deps/jsr.io/@std/internal/1.0.10/styles.d.ts.map +1 -0
- package/esm/deps/jsr.io/@std/internal/1.0.10/types.d.ts.map +1 -0
- package/esm/mod.js +2 -12
- package/esm/session/0_session_state.js +12 -38
- package/esm/session/1_session.js +49 -72
- package/esm/session/2_session_encrypted.js +324 -320
- package/esm/storage/1_utilities_test.d.ts.map +1 -1
- package/esm/storage/2_storage_indexed_db.js +26 -44
- package/esm/storage/2_storage_local_storage.node.js +12 -25
- package/esm/storage/2_storage_memory.js +24 -41
- package/esm/storage/2_storage_session_storage.js +3 -16
- package/esm/tl/0_utilities_test.d.ts.map +1 -1
- package/esm/tl/1_tl_reader.js +80 -88
- package/esm/tl/1_tl_reader_test.d.ts.map +1 -1
- package/esm/tl/1_tl_writer.js +155 -164
- package/esm/tl/1_tl_writer_test.d.ts.map +1 -1
- package/esm/tl/2_telegram.d.ts +9 -10
- package/esm/tl/2_telegram.d.ts.map +1 -1
- package/esm/tl/2_telegram.js +10 -10
- package/esm/transport/0_transport.js +1 -8
- package/esm/transport/1_transport_abridged.js +11 -24
- package/esm/transport/1_transport_intermediate.js +10 -23
- package/{script/transport/2_transport_provider.d.ts → esm/transport/1_transport_provider.d.ts} +1 -1
- package/esm/transport/{2_transport_provider.d.ts.map → 1_transport_provider.d.ts.map} +1 -1
- package/{script/transport/3_transport_provider_tcp.d.ts → esm/transport/2_transport_provider_tcp.d.ts} +2 -2
- package/esm/transport/{3_transport_provider_tcp.d.ts.map → 2_transport_provider_tcp.d.ts.map} +1 -1
- package/esm/transport/{3_transport_provider_tcp.js → 2_transport_provider_tcp.js} +1 -1
- package/esm/transport/{3_transport_provider_web_socket.d.ts → 2_transport_provider_web_socket.d.ts} +2 -2
- package/esm/transport/2_transport_provider_web_socket.d.ts.map +1 -0
- package/esm/transport/{3_transport_provider_web_socket.js → 2_transport_provider_web_socket.js} +1 -1
- package/esm/types/0_upload_progress.d.ts +29 -0
- package/esm/types/0_upload_progress.d.ts.map +1 -0
- package/esm/types/0_upload_progress.js +20 -0
- package/esm/types/{2_inline_keyboard_button.d.ts → 1_inline_keyboard_button.d.ts} +1 -1
- package/esm/types/{2_inline_keyboard_button.d.ts.map → 1_inline_keyboard_button.d.ts.map} +1 -1
- package/esm/types/1_sticker.d.ts +1 -1
- package/esm/types/1_sticker.d.ts.map +1 -1
- package/esm/types/2_chat.d.ts.map +1 -1
- package/esm/types/2_poll_answer.d.ts +19 -0
- package/esm/types/2_poll_answer.d.ts.map +1 -1
- package/esm/types/2_poll_answer.js +19 -0
- package/esm/types/2_pre_checkout_query.d.ts.map +1 -1
- package/esm/types/{3_reply_markup.d.ts → 2_reply_markup.d.ts} +2 -2
- package/esm/types/{3_reply_markup.d.ts.map → 2_reply_markup.d.ts.map} +1 -1
- package/esm/types/{3_reply_markup.js → 2_reply_markup.js} +1 -1
- package/esm/types/2_story_interactive_area.d.ts.map +1 -1
- package/esm/types/3_chat_member_updated.d.ts.map +1 -1
- package/esm/types/3_story.d.ts.map +1 -1
- package/esm/types/5_message.d.ts +1 -1
- package/esm/types/5_message.d.ts.map +1 -1
- package/esm/types/5_message.js +1 -1
- package/esm/types/6_inline_query_result.d.ts +1 -1
- package/esm/types/6_inline_query_result.js +1 -1
- package/esm/types/7_update.d.ts +21 -2
- package/esm/types/7_update.d.ts.map +1 -1
- package/esm/utilities/0_bigint_test.d.ts.map +1 -1
- package/esm/utilities/0_buffer.d.ts +1 -1
- package/esm/utilities/0_buffer.d.ts.map +1 -1
- package/esm/utilities/0_buffer_test.d.ts.map +1 -1
- package/esm/utilities/0_hash.d.ts +2 -2
- package/esm/utilities/0_hash.d.ts.map +1 -1
- package/esm/utilities/0_mutex.js +4 -19
- package/esm/utilities/0_part_stream.js +11 -25
- package/esm/utilities/0_part_stream_test.d.ts.map +1 -1
- package/esm/utilities/0_rle.d.ts +2 -2
- package/esm/utilities/0_rle.d.ts.map +1 -1
- package/esm/utilities/0_rle_test.d.ts.map +1 -1
- package/esm/utilities/0_text.d.ts +20 -1
- package/esm/utilities/0_text.d.ts.map +1 -1
- package/esm/utilities/0_text.js +19 -0
- package/esm/utilities/1_auth.d.ts +1 -1
- package/esm/utilities/1_auth.d.ts.map +1 -1
- package/esm/utilities/1_base64.d.ts +1 -1
- package/esm/utilities/1_base64.d.ts.map +1 -1
- package/esm/utilities/1_base64_test.d.ts.map +1 -1
- package/esm/utilities/1_crypto.js +42 -53
- package/esm/utilities/1_crypto_test.d.ts.map +1 -1
- package/esm/utilities/1_logger.d.ts +2 -2
- package/esm/utilities/1_math_test.d.ts.map +1 -1
- package/esm/utilities/2_queue.js +29 -47
- package/package.json +1 -1
- package/script/0_errors.js +2 -6
- package/script/2_tl.js +17 -7
- package/script/3_errors.js +2 -12
- package/script/3_transport.d.ts +3 -3
- package/script/3_transport.js +3 -3
- package/script/3_types.d.ts +8 -7
- package/script/3_types.d.ts.map +1 -1
- package/script/3_types.js +8 -7
- package/script/4_constants.js +17 -7
- package/script/4_errors.js +2 -12
- package/script/_dnt.polyfills.d.ts +99 -0
- package/script/_dnt.polyfills.d.ts.map +1 -1
- package/script/_dnt.polyfills.js +128 -0
- package/script/_dnt.test_polyfills.d.ts.map +1 -0
- package/script/client/0_filters_test.d.ts.map +1 -1
- package/script/client/0_markdown_test.d.ts.map +1 -1
- package/script/client/0_params.d.ts +2 -0
- package/script/client/0_params.d.ts.map +1 -1
- package/script/client/0_password.d.ts +5 -5
- package/script/client/0_password.d.ts.map +1 -1
- package/script/client/0_password.js +17 -7
- package/script/client/0_password_test.d.ts.map +1 -1
- package/script/client/0_storage_operations.js +143 -155
- package/script/client/0_storage_operations_test.d.ts.map +1 -1
- package/script/client/0_utilities.d.ts +1 -1
- package/script/client/0_utilities_test.d.ts.map +1 -1
- package/script/client/1_client_plain.js +4 -22
- package/script/client/1_composer.js +8 -21
- package/script/client/2_account_manager.js +85 -97
- package/script/client/2_bot_info_manager.js +26 -38
- package/script/client/2_business_connection_manager.js +10 -23
- package/script/client/2_client_encrypted.js +195 -212
- package/script/client/2_file_manager.d.ts +4 -3
- package/script/client/2_file_manager.d.ts.map +1 -1
- package/script/client/2_file_manager.js +285 -231
- package/script/client/2_file_manager_test.d.ts.map +1 -1
- package/script/client/2_network_statistics_manager.js +8 -21
- package/script/client/2_payment_manager.js +7 -20
- package/script/client/2_reaction_manager.js +7 -20
- package/script/client/2_translations_manager.js +98 -108
- package/script/client/2_update_manager.js +764 -759
- package/script/client/3_client_encrypted_pool.js +10 -26
- package/script/client/3_client_encrypted_pool_test.d.ts.map +1 -1
- package/script/client/3_message_manager.d.ts +1 -1
- package/script/client/3_message_manager.js +441 -448
- package/script/client/3_message_manager_test.d.ts.map +1 -1
- package/script/client/3_video_chat_manager.d.ts +1 -1
- package/script/client/3_video_chat_manager.js +57 -68
- package/script/client/4_callback_query_manager.js +18 -30
- package/script/client/4_chat_list_manager.js +322 -318
- package/script/client/4_chat_manager.js +118 -131
- package/script/client/4_forum_manager.js +67 -73
- package/script/client/4_gift_manager.js +16 -29
- package/script/client/4_inline_query_manager.js +16 -28
- package/script/client/4_link_preview_manager.js +6 -19
- package/script/client/4_poll_manager.js +44 -57
- package/script/client/4_story_manager.js +41 -53
- package/script/client/5_client.d.ts +7 -0
- package/script/client/5_client.d.ts.map +1 -1
- package/script/client/5_client.js +1271 -1290
- package/script/connection/1_connection_tcp.node.js +48 -65
- package/script/connection/1_connection_web_socket.js +92 -98
- package/script/deps/jsr.io/@roj/tgcrypto/1.0.1/dist/tgcrypto.js +3 -11
- package/script/deps/jsr.io/@std/assert/1.0.13/equal.js +17 -7
- package/script/deps/jsr.io/@std/assert/1.0.13/equals.js +4 -4
- package/script/deps/jsr.io/@std/async/1.0.13/delay.js +17 -7
- package/script/deps/jsr.io/@std/async/1.0.13/mux_async_iterator.js +31 -47
- package/script/deps/jsr.io/@std/async/1.0.13/tee.js +11 -34
- package/script/deps/jsr.io/@std/datetime/0.225.5/_date_time_formatter.js +4 -17
- package/script/deps/jsr.io/@std/internal/1.0.10/build_message.d.ts.map +1 -0
- package/script/deps/jsr.io/@std/internal/1.0.10/diff.d.ts.map +1 -0
- package/script/deps/jsr.io/@std/internal/1.0.10/diff_str.d.ts.map +1 -0
- package/script/deps/jsr.io/@std/internal/1.0.10/format.d.ts +29 -0
- package/script/deps/jsr.io/@std/internal/1.0.10/format.d.ts.map +1 -0
- package/script/deps/jsr.io/@std/internal/1.0.10/format.js +106 -0
- package/script/deps/jsr.io/@std/internal/1.0.10/styles.d.ts.map +1 -0
- package/script/deps/jsr.io/@std/internal/{1.0.9 → 1.0.10}/styles.js +17 -7
- package/script/deps/jsr.io/@std/internal/1.0.10/types.d.ts.map +1 -0
- package/script/deps/jsr.io/@std/path/1.1.0/_os.js +17 -7
- package/script/mod.js +19 -19
- package/script/session/0_session_state.js +12 -38
- package/script/session/1_session.js +66 -79
- package/script/session/2_session_encrypted.js +325 -321
- package/script/storage/1_utilities_test.d.ts.map +1 -1
- package/script/storage/2_storage_indexed_db.js +26 -44
- package/script/storage/2_storage_local_storage.node.js +12 -25
- package/script/storage/2_storage_memory.js +24 -41
- package/script/storage/2_storage_session_storage.js +3 -16
- package/script/tl/0_utilities_test.d.ts.map +1 -1
- package/script/tl/1_tl_reader.js +81 -89
- package/script/tl/1_tl_reader_test.d.ts.map +1 -1
- package/script/tl/1_tl_writer.js +156 -165
- package/script/tl/1_tl_writer_test.d.ts.map +1 -1
- package/script/tl/2_telegram.d.ts +9 -10
- package/script/tl/2_telegram.d.ts.map +1 -1
- package/script/tl/2_telegram.js +32 -10
- package/script/transport/0_obfuscation.js +17 -7
- package/script/transport/0_transport.js +1 -8
- package/script/transport/1_transport_abridged.js +11 -24
- package/script/transport/1_transport_intermediate.js +10 -23
- package/{esm/transport/2_transport_provider.d.ts → script/transport/1_transport_provider.d.ts} +1 -1
- package/script/transport/{2_transport_provider.d.ts.map → 1_transport_provider.d.ts.map} +1 -1
- package/{esm/transport/3_transport_provider_tcp.d.ts → script/transport/2_transport_provider_tcp.d.ts} +2 -2
- package/script/transport/{3_transport_provider_tcp.d.ts.map → 2_transport_provider_tcp.d.ts.map} +1 -1
- package/script/transport/{3_transport_provider_tcp.js → 2_transport_provider_tcp.js} +3 -3
- package/script/transport/{3_transport_provider_web_socket.d.ts → 2_transport_provider_web_socket.d.ts} +2 -2
- package/script/transport/2_transport_provider_web_socket.d.ts.map +1 -0
- package/script/transport/{3_transport_provider_web_socket.js → 2_transport_provider_web_socket.js} +2 -2
- package/script/types/0_upload_progress.d.ts +29 -0
- package/script/types/0_upload_progress.d.ts.map +1 -0
- package/script/types/0_upload_progress.js +21 -0
- package/script/types/{2_inline_keyboard_button.d.ts → 1_inline_keyboard_button.d.ts} +1 -1
- package/script/types/{2_inline_keyboard_button.d.ts.map → 1_inline_keyboard_button.d.ts.map} +1 -1
- package/script/types/1_sticker.d.ts +1 -1
- package/script/types/1_sticker.d.ts.map +1 -1
- package/script/types/2_chat.d.ts.map +1 -1
- package/script/types/2_poll_answer.d.ts +19 -0
- package/script/types/2_poll_answer.d.ts.map +1 -1
- package/script/types/2_poll_answer.js +19 -0
- package/script/types/2_pre_checkout_query.d.ts.map +1 -1
- package/script/types/{3_reply_markup.d.ts → 2_reply_markup.d.ts} +2 -2
- package/script/types/{3_reply_markup.d.ts.map → 2_reply_markup.d.ts.map} +1 -1
- package/script/types/{3_reply_markup.js → 2_reply_markup.js} +3 -3
- package/script/types/2_story_interactive_area.d.ts.map +1 -1
- package/script/types/3_chat_member_updated.d.ts.map +1 -1
- package/script/types/3_story.d.ts.map +1 -1
- package/script/types/5_message.d.ts +1 -1
- package/script/types/5_message.d.ts.map +1 -1
- package/script/types/5_message.js +2 -2
- package/script/types/6_inline_query_result.d.ts +1 -1
- package/script/types/6_inline_query_result.js +4 -4
- package/script/types/7_update.d.ts +21 -2
- package/script/types/7_update.d.ts.map +1 -1
- package/script/utilities/0_bigint.js +17 -7
- package/script/utilities/0_bigint_test.d.ts.map +1 -1
- package/script/utilities/0_buffer.d.ts +1 -1
- package/script/utilities/0_buffer.d.ts.map +1 -1
- package/script/utilities/0_buffer_test.d.ts.map +1 -1
- package/script/utilities/0_env.js +17 -7
- package/script/utilities/0_hash.d.ts +2 -2
- package/script/utilities/0_hash.d.ts.map +1 -1
- package/script/utilities/0_hash.js +17 -7
- package/script/utilities/0_misc.js +17 -7
- package/script/utilities/0_mutex.js +4 -19
- package/script/utilities/0_part_stream.js +11 -25
- package/script/utilities/0_part_stream_test.d.ts.map +1 -1
- package/script/utilities/0_rle.d.ts +2 -2
- package/script/utilities/0_rle.d.ts.map +1 -1
- package/script/utilities/0_rle_test.d.ts.map +1 -1
- package/script/utilities/0_text.d.ts +20 -1
- package/script/utilities/0_text.d.ts.map +1 -1
- package/script/utilities/0_text.js +19 -0
- package/script/utilities/1_auth.d.ts +1 -1
- package/script/utilities/1_auth.d.ts.map +1 -1
- package/script/utilities/1_auth.js +17 -7
- package/script/utilities/1_base64.d.ts +1 -1
- package/script/utilities/1_base64.d.ts.map +1 -1
- package/script/utilities/1_base64_test.d.ts.map +1 -1
- package/script/utilities/1_crypto.js +60 -61
- package/script/utilities/1_crypto_test.d.ts.map +1 -1
- package/script/utilities/1_logger.d.ts +2 -2
- package/script/utilities/1_math_test.d.ts.map +1 -1
- package/script/utilities/2_queue.js +30 -48
- package/esm/deps/jsr.io/@std/internal/1.0.9/build_message.d.ts.map +0 -1
- package/esm/deps/jsr.io/@std/internal/1.0.9/diff.d.ts.map +0 -1
- package/esm/deps/jsr.io/@std/internal/1.0.9/diff_str.d.ts.map +0 -1
- package/esm/deps/jsr.io/@std/internal/1.0.9/format.d.ts +0 -2
- package/esm/deps/jsr.io/@std/internal/1.0.9/format.d.ts.map +0 -1
- package/esm/deps/jsr.io/@std/internal/1.0.9/format.js +0 -37
- package/esm/deps/jsr.io/@std/internal/1.0.9/styles.d.ts.map +0 -1
- package/esm/deps/jsr.io/@std/internal/1.0.9/types.d.ts.map +0 -1
- package/esm/transport/3_transport_provider_web_socket.d.ts.map +0 -1
- package/script/deps/jsr.io/@std/internal/1.0.9/build_message.d.ts.map +0 -1
- package/script/deps/jsr.io/@std/internal/1.0.9/diff.d.ts.map +0 -1
- package/script/deps/jsr.io/@std/internal/1.0.9/diff_str.d.ts.map +0 -1
- package/script/deps/jsr.io/@std/internal/1.0.9/format.d.ts +0 -2
- package/script/deps/jsr.io/@std/internal/1.0.9/format.d.ts.map +0 -1
- package/script/deps/jsr.io/@std/internal/1.0.9/format.js +0 -63
- package/script/deps/jsr.io/@std/internal/1.0.9/styles.d.ts.map +0 -1
- package/script/deps/jsr.io/@std/internal/1.0.9/types.d.ts.map +0 -1
- package/script/transport/3_transport_provider_web_socket.d.ts.map +0 -1
- /package/esm/deps/jsr.io/@std/internal/{1.0.9 → 1.0.10}/build_message.d.ts +0 -0
- /package/esm/deps/jsr.io/@std/internal/{1.0.9 → 1.0.10}/build_message.js +0 -0
- /package/esm/deps/jsr.io/@std/internal/{1.0.9 → 1.0.10}/diff.d.ts +0 -0
- /package/esm/deps/jsr.io/@std/internal/{1.0.9 → 1.0.10}/diff.js +0 -0
- /package/esm/deps/jsr.io/@std/internal/{1.0.9 → 1.0.10}/diff_str.d.ts +0 -0
- /package/esm/deps/jsr.io/@std/internal/{1.0.9 → 1.0.10}/diff_str.js +0 -0
- /package/esm/deps/jsr.io/@std/internal/{1.0.9 → 1.0.10}/styles.d.ts +0 -0
- /package/esm/deps/jsr.io/@std/internal/{1.0.9 → 1.0.10}/styles.js +0 -0
- /package/esm/deps/jsr.io/@std/internal/{1.0.9 → 1.0.10}/types.d.ts +0 -0
- /package/esm/deps/jsr.io/@std/internal/{1.0.9 → 1.0.10}/types.js +0 -0
- /package/esm/transport/{2_transport_provider.js → 1_transport_provider.js} +0 -0
- /package/esm/types/{2_inline_keyboard_button.js → 1_inline_keyboard_button.js} +0 -0
- /package/script/deps/jsr.io/@std/internal/{1.0.9 → 1.0.10}/build_message.d.ts +0 -0
- /package/script/deps/jsr.io/@std/internal/{1.0.9 → 1.0.10}/build_message.js +0 -0
- /package/script/deps/jsr.io/@std/internal/{1.0.9 → 1.0.10}/diff.d.ts +0 -0
- /package/script/deps/jsr.io/@std/internal/{1.0.9 → 1.0.10}/diff.js +0 -0
- /package/script/deps/jsr.io/@std/internal/{1.0.9 → 1.0.10}/diff_str.d.ts +0 -0
- /package/script/deps/jsr.io/@std/internal/{1.0.9 → 1.0.10}/diff_str.js +0 -0
- /package/script/deps/jsr.io/@std/internal/{1.0.9 → 1.0.10}/styles.d.ts +0 -0
- /package/script/deps/jsr.io/@std/internal/{1.0.9 → 1.0.10}/types.d.ts +0 -0
- /package/script/deps/jsr.io/@std/internal/{1.0.9 → 1.0.10}/types.js +0 -0
- /package/script/transport/{2_transport_provider.js → 1_transport_provider.js} +0 -0
- /package/script/types/{2_inline_keyboard_button.js → 1_inline_keyboard_button.js} +0 -0
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"3_message_manager_test.d.ts","sourceRoot":"","sources":["../../src/client/3_message_manager_test.ts"],"names":[],"mappings":""}
|
|
1
|
+
{"version":3,"file":"3_message_manager_test.d.ts","sourceRoot":"","sources":["../../src/client/3_message_manager_test.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;GAkBG;AACH,OAAO,2BAA2B,CAAC"}
|
|
@@ -40,7 +40,7 @@ export declare class VideoChatManager implements UpdateProcessor<VideoChatManage
|
|
|
40
40
|
canHandleUpdate(update: Api.Update): update is VideoChatManagerUpdate;
|
|
41
41
|
handleUpdate(update: VideoChatManagerUpdate): Promise<Update | null>;
|
|
42
42
|
getLiveStreamChannels(id: string): Promise<import("../3_types.js").LiveStreamChannel[]>;
|
|
43
|
-
downloadLiveStreamChunk(id: string, channel: number, scale: number, timestamp: number, params?: DownloadLiveStreamChunkParams): AsyncGenerator<Uint8Array
|
|
43
|
+
downloadLiveStreamChunk(id: string, channel: number, scale: number, timestamp: number, params?: DownloadLiveStreamChunkParams): AsyncGenerator<Uint8Array<ArrayBufferLike>, void, any>;
|
|
44
44
|
}
|
|
45
45
|
export {};
|
|
46
46
|
//# sourceMappingURL=3_video_chat_manager.d.ts.map
|
|
@@ -18,18 +18,6 @@
|
|
|
18
18
|
* You should have received a copy of the GNU Lesser General Public License
|
|
19
19
|
* along with this program. If not, see <https://www.gnu.org/licenses/>.
|
|
20
20
|
*/
|
|
21
|
-
var __classPrivateFieldSet = (this && this.__classPrivateFieldSet) || function (receiver, state, value, kind, f) {
|
|
22
|
-
if (kind === "m") throw new TypeError("Private method is not writable");
|
|
23
|
-
if (kind === "a" && !f) throw new TypeError("Private accessor was defined without a setter");
|
|
24
|
-
if (typeof state === "function" ? receiver !== state || !f : !state.has(receiver)) throw new TypeError("Cannot write private member to an object whose class did not declare it");
|
|
25
|
-
return (kind === "a" ? f.call(receiver, value) : f ? f.value = value : state.set(receiver, value)), value;
|
|
26
|
-
};
|
|
27
|
-
var __classPrivateFieldGet = (this && this.__classPrivateFieldGet) || function (receiver, state, kind, f) {
|
|
28
|
-
if (kind === "a" && !f) throw new TypeError("Private accessor was defined without a getter");
|
|
29
|
-
if (typeof state === "function" ? receiver !== state || !f : !state.has(receiver)) throw new TypeError("Cannot read private member from an object whose class did not declare it");
|
|
30
|
-
return kind === "m" ? f : kind === "a" ? f.call(receiver) : f ? f.value : state.get(receiver);
|
|
31
|
-
};
|
|
32
|
-
var _VideoChatManager_instances, _VideoChatManager_c, _VideoChatManager_createGroupCall, _VideoChatManager_getInputGroupCall, _VideoChatManager_getCall;
|
|
33
21
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
34
22
|
exports.VideoChatManager = void 0;
|
|
35
23
|
const _0_deps_js_1 = require("../0_deps.js");
|
|
@@ -43,23 +31,43 @@ const videoChatManagerUpdates = [
|
|
|
43
31
|
"updateGroupCall",
|
|
44
32
|
];
|
|
45
33
|
class VideoChatManager {
|
|
34
|
+
#c;
|
|
46
35
|
constructor(c) {
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
36
|
+
this.#c = c;
|
|
37
|
+
}
|
|
38
|
+
async #createGroupCall(chatId, title, liveStream, scheduleDate) {
|
|
39
|
+
const peer = await this.#c.getInputPeer(chatId);
|
|
40
|
+
if ((0, _0_utilities_js_1.canBeInputUser)(peer)) {
|
|
41
|
+
throw new _0_errors_js_1.InputError("Video chats are only available for groups and channels.");
|
|
42
|
+
}
|
|
43
|
+
const { updates } = await this.#c.invoke({ _: "phone.createGroupCall", peer, random_id: (0, _1_utilities_js_1.getRandomId)(true), title, rtmp_stream: liveStream, schedule_date: scheduleDate }).then((v) => _2_tl_js_1.Api.as("updates", v));
|
|
44
|
+
const updateGroupCall = updates
|
|
45
|
+
.find((v) => _2_tl_js_1.Api.is("updateGroupCall", v));
|
|
46
|
+
if (!updateGroupCall) {
|
|
47
|
+
(0, _0_deps_js_1.unreachable)();
|
|
48
|
+
}
|
|
49
|
+
return (0, _3_types_js_1.constructVideoChat)(updateGroupCall.call);
|
|
50
50
|
}
|
|
51
51
|
async startVideoChat(chatId, params) {
|
|
52
|
-
|
|
53
|
-
return await
|
|
52
|
+
this.#c.storage.assertUser("startVideoChat");
|
|
53
|
+
return await this.#createGroupCall(chatId, params?.title, params?.liveStream || undefined);
|
|
54
54
|
}
|
|
55
55
|
async scheduleVideoChat(chatId, startAt, params) {
|
|
56
|
-
|
|
57
|
-
return await
|
|
56
|
+
this.#c.storage.assertUser("scheduleVideoChat");
|
|
57
|
+
return await this.#createGroupCall(chatId, params?.title, params?.liveStream || undefined, startAt);
|
|
58
|
+
}
|
|
59
|
+
async #getInputGroupCall(id_) {
|
|
60
|
+
const id = BigInt(id_);
|
|
61
|
+
const accessHash = await this.#c.storage.getGroupCallAccessHash(id);
|
|
62
|
+
if (accessHash == null) {
|
|
63
|
+
throw new _0_errors_js_1.InputError("Video chat not found.");
|
|
64
|
+
}
|
|
65
|
+
return { _: "inputGroupCall", id, access_hash: accessHash };
|
|
58
66
|
}
|
|
59
67
|
async joinVideoChat(id, params, params_) {
|
|
60
|
-
|
|
61
|
-
const call = await
|
|
62
|
-
const { updates } = await
|
|
68
|
+
this.#c.storage.assertUser("joinVideoChat");
|
|
69
|
+
const call = await this.#getInputGroupCall(id);
|
|
70
|
+
const { updates } = await this.#c.invoke({ _: "phone.joinGroupCall", call, join_as: params_?.joinAs ? await this.#c.getInputPeer(params_.joinAs) : { _: "inputPeerSelf" }, params: ({ _: "dataJSON", data: params }), invite_hash: params_?.inviteHash, muted: params_?.audio ? undefined : true, video_stopped: params_?.video ? undefined : true }).then((v) => _2_tl_js_1.Api.as("updates", v));
|
|
63
71
|
const updateGroupCall = updates
|
|
64
72
|
.find((v) => _2_tl_js_1.Api.is("updateGroupCallConnection", v));
|
|
65
73
|
if (!updateGroupCall)
|
|
@@ -67,13 +75,13 @@ class VideoChatManager {
|
|
|
67
75
|
return updateGroupCall.params.data;
|
|
68
76
|
}
|
|
69
77
|
async leaveVideoChat(id) {
|
|
70
|
-
|
|
71
|
-
await
|
|
78
|
+
this.#c.storage.assertUser("leaveVideoChat");
|
|
79
|
+
await this.#c.invoke({ _: "phone.leaveGroupCall", call: await this.#getInputGroupCall(id), source: 0 });
|
|
72
80
|
}
|
|
73
81
|
async joinLiveStream(id) {
|
|
74
|
-
|
|
75
|
-
const call = await
|
|
76
|
-
const { updates } = await
|
|
82
|
+
this.#c.storage.assertUser("joinLiveStream");
|
|
83
|
+
const call = await this.#getInputGroupCall(id);
|
|
84
|
+
const { updates } = await this.#c.invoke({
|
|
77
85
|
_: "phone.joinGroupCall",
|
|
78
86
|
call,
|
|
79
87
|
join_as: { _: "inputPeerSelf" },
|
|
@@ -93,9 +101,17 @@ class VideoChatManager {
|
|
|
93
101
|
if (!updateGroupCall)
|
|
94
102
|
(0, _0_deps_js_1.unreachable)();
|
|
95
103
|
}
|
|
104
|
+
async #getCall(id) {
|
|
105
|
+
let groupCall = await this.#c.storage.getGroupCall(BigInt(id));
|
|
106
|
+
if (groupCall == null) {
|
|
107
|
+
const call = await this.#getInputGroupCall(id);
|
|
108
|
+
groupCall = (await this.#c.invoke({ _: "phone.getGroupCall", call, limit: 1 })).call;
|
|
109
|
+
}
|
|
110
|
+
return groupCall;
|
|
111
|
+
}
|
|
96
112
|
async getVideoChat(id) {
|
|
97
|
-
|
|
98
|
-
return (0, _3_types_js_1.constructVideoChat)(await
|
|
113
|
+
this.#c.storage.assertUser("getVideoChat");
|
|
114
|
+
return (0, _3_types_js_1.constructVideoChat)(await this.#getCall(id));
|
|
99
115
|
}
|
|
100
116
|
canHandleUpdate(update) {
|
|
101
117
|
return _2_tl_js_1.Api.isOneOf(videoChatManagerUpdates, update);
|
|
@@ -105,19 +121,19 @@ class VideoChatManager {
|
|
|
105
121
|
return null; // TODO: handle updates with unspecified chat_id
|
|
106
122
|
}
|
|
107
123
|
let chatId = Number(-update.chat_id);
|
|
108
|
-
const fullChat = await
|
|
124
|
+
const fullChat = await this.#c.storage.getFullChat(chatId).then((v) => v == null ? this.#c.storage.getFullChat(chatId = _1_utilities_js_1.ZERO_CHANNEL_ID - Number(update.chat_id)) : v);
|
|
109
125
|
let updateFullChat = false;
|
|
110
126
|
if (_2_tl_js_1.Api.is("groupCallDiscarded", update.call)) {
|
|
111
|
-
await
|
|
112
|
-
await
|
|
127
|
+
await this.#c.storage.setGroupCall(update.call.id, null);
|
|
128
|
+
await this.#c.storage.setGroupCallAccessHash(update.call.id, null);
|
|
113
129
|
if (fullChat != null) {
|
|
114
130
|
fullChat.call = undefined;
|
|
115
131
|
updateFullChat = true;
|
|
116
132
|
}
|
|
117
133
|
}
|
|
118
134
|
else {
|
|
119
|
-
await
|
|
120
|
-
await
|
|
135
|
+
await this.#c.storage.setGroupCall(update.call.id, update.call);
|
|
136
|
+
await this.#c.storage.setGroupCallAccessHash(update.call.id, update.call.access_hash);
|
|
121
137
|
if (fullChat != null) {
|
|
122
138
|
if (!("call" in fullChat) || !fullChat.call || !_2_tl_js_1.Api.is("inputGroupCall", fullChat.call) || fullChat.call.id != update.call.id) {
|
|
123
139
|
fullChat.call = { ...update.call, _: "inputGroupCall" };
|
|
@@ -126,23 +142,23 @@ class VideoChatManager {
|
|
|
126
142
|
}
|
|
127
143
|
}
|
|
128
144
|
if (updateFullChat) {
|
|
129
|
-
await
|
|
145
|
+
await this.#c.storage.setFullChat(chatId, fullChat);
|
|
130
146
|
}
|
|
131
147
|
return { videoChat: (0, _3_types_js_1.constructVideoChat)(update.call) };
|
|
132
148
|
}
|
|
133
149
|
async getLiveStreamChannels(id) {
|
|
134
|
-
|
|
135
|
-
const call = await
|
|
150
|
+
this.#c.storage.assertUser("getLiveStreamChannels");
|
|
151
|
+
const call = await this.#getCall(id);
|
|
136
152
|
if (!(_2_tl_js_1.Api.is("groupCall", call)) || !call.rtmp_stream) {
|
|
137
153
|
throw new _0_errors_js_1.InputError("Not a live stream.");
|
|
138
154
|
}
|
|
139
155
|
const dc = call.stream_dc_id ? (0, _3_transport_js_1.getDc)(call.stream_dc_id) : undefined;
|
|
140
|
-
const streams = await
|
|
156
|
+
const streams = await this.#c.invoke({ _: "phone.getGroupCallStreamChannels", call: await this.#getInputGroupCall(id) }, { dc, type: "download" });
|
|
141
157
|
return streams.channels.map(_3_types_js_1.constructLiveStreamChannel);
|
|
142
158
|
}
|
|
143
159
|
async *downloadLiveStreamChunk(id, channel, scale, timestamp, params) {
|
|
144
|
-
|
|
145
|
-
const call = await
|
|
160
|
+
this.#c.storage.assertUser("downloadLiveStreamChunk");
|
|
161
|
+
const call = await this.#getCall(id);
|
|
146
162
|
if (!(_2_tl_js_1.Api.is("groupCall", call)) || !call.rtmp_stream) {
|
|
147
163
|
throw new _0_errors_js_1.InputError("Not a live stream.");
|
|
148
164
|
}
|
|
@@ -157,34 +173,7 @@ class VideoChatManager {
|
|
|
157
173
|
throw new _0_errors_js_1.InputError("Got invalid quality.");
|
|
158
174
|
})(),
|
|
159
175
|
};
|
|
160
|
-
yield*
|
|
176
|
+
yield* this.#c.fileManager.downloadInner(location, call.stream_dc_id ?? (0, _0_deps_js_1.unreachable)(), params);
|
|
161
177
|
}
|
|
162
178
|
}
|
|
163
179
|
exports.VideoChatManager = VideoChatManager;
|
|
164
|
-
_VideoChatManager_c = new WeakMap(), _VideoChatManager_instances = new WeakSet(), _VideoChatManager_createGroupCall = async function _VideoChatManager_createGroupCall(chatId, title, liveStream, scheduleDate) {
|
|
165
|
-
const peer = await __classPrivateFieldGet(this, _VideoChatManager_c, "f").getInputPeer(chatId);
|
|
166
|
-
if ((0, _0_utilities_js_1.canBeInputUser)(peer)) {
|
|
167
|
-
throw new _0_errors_js_1.InputError("Video chats are only available for groups and channels.");
|
|
168
|
-
}
|
|
169
|
-
const { updates } = await __classPrivateFieldGet(this, _VideoChatManager_c, "f").invoke({ _: "phone.createGroupCall", peer, random_id: (0, _1_utilities_js_1.getRandomId)(true), title, rtmp_stream: liveStream, schedule_date: scheduleDate }).then((v) => _2_tl_js_1.Api.as("updates", v));
|
|
170
|
-
const updateGroupCall = updates
|
|
171
|
-
.find((v) => _2_tl_js_1.Api.is("updateGroupCall", v));
|
|
172
|
-
if (!updateGroupCall) {
|
|
173
|
-
(0, _0_deps_js_1.unreachable)();
|
|
174
|
-
}
|
|
175
|
-
return (0, _3_types_js_1.constructVideoChat)(updateGroupCall.call);
|
|
176
|
-
}, _VideoChatManager_getInputGroupCall = async function _VideoChatManager_getInputGroupCall(id_) {
|
|
177
|
-
const id = BigInt(id_);
|
|
178
|
-
const accessHash = await __classPrivateFieldGet(this, _VideoChatManager_c, "f").storage.getGroupCallAccessHash(id);
|
|
179
|
-
if (accessHash == null) {
|
|
180
|
-
throw new _0_errors_js_1.InputError("Video chat not found.");
|
|
181
|
-
}
|
|
182
|
-
return { _: "inputGroupCall", id, access_hash: accessHash };
|
|
183
|
-
}, _VideoChatManager_getCall = async function _VideoChatManager_getCall(id) {
|
|
184
|
-
let groupCall = await __classPrivateFieldGet(this, _VideoChatManager_c, "f").storage.getGroupCall(BigInt(id));
|
|
185
|
-
if (groupCall == null) {
|
|
186
|
-
const call = await __classPrivateFieldGet(this, _VideoChatManager_instances, "m", _VideoChatManager_getInputGroupCall).call(this, id);
|
|
187
|
-
groupCall = (await __classPrivateFieldGet(this, _VideoChatManager_c, "f").invoke({ _: "phone.getGroupCall", call, limit: 1 })).call;
|
|
188
|
-
}
|
|
189
|
-
return groupCall;
|
|
190
|
-
};
|
|
@@ -18,18 +18,6 @@
|
|
|
18
18
|
* You should have received a copy of the GNU Lesser General Public License
|
|
19
19
|
* along with this program. If not, see <https://www.gnu.org/licenses/>.
|
|
20
20
|
*/
|
|
21
|
-
var __classPrivateFieldSet = (this && this.__classPrivateFieldSet) || function (receiver, state, value, kind, f) {
|
|
22
|
-
if (kind === "m") throw new TypeError("Private method is not writable");
|
|
23
|
-
if (kind === "a" && !f) throw new TypeError("Private accessor was defined without a setter");
|
|
24
|
-
if (typeof state === "function" ? receiver !== state || !f : !state.has(receiver)) throw new TypeError("Cannot write private member to an object whose class did not declare it");
|
|
25
|
-
return (kind === "a" ? f.call(receiver, value) : f ? f.value = value : state.set(receiver, value)), value;
|
|
26
|
-
};
|
|
27
|
-
var __classPrivateFieldGet = (this && this.__classPrivateFieldGet) || function (receiver, state, kind, f) {
|
|
28
|
-
if (kind === "a" && !f) throw new TypeError("Private accessor was defined without a getter");
|
|
29
|
-
if (typeof state === "function" ? receiver !== state || !f : !state.has(receiver)) throw new TypeError("Cannot read private member from an object whose class did not declare it");
|
|
30
|
-
return kind === "m" ? f : kind === "a" ? f.call(receiver) : f ? f.value : state.get(receiver);
|
|
31
|
-
};
|
|
32
|
-
var _CallbackQueryManager_instances, _a, _CallbackQueryManager_c, _CallbackQueryManager_isExpired, _CallbackQueryManager_getPasswordCheck;
|
|
33
21
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
34
22
|
exports.CallbackQueryManager = void 0;
|
|
35
23
|
const _1_utilities_js_1 = require("../1_utilities.js");
|
|
@@ -42,42 +30,42 @@ const callbackQueryManagerUpdates = [
|
|
|
42
30
|
"updateInlineBotCallbackQuery",
|
|
43
31
|
];
|
|
44
32
|
class CallbackQueryManager {
|
|
33
|
+
#c;
|
|
45
34
|
constructor(c) {
|
|
46
|
-
|
|
47
|
-
_CallbackQueryManager_c.set(this, void 0);
|
|
48
|
-
__classPrivateFieldSet(this, _CallbackQueryManager_c, c, "f");
|
|
35
|
+
this.#c = c;
|
|
49
36
|
}
|
|
50
37
|
async answerCallbackQuery(id, params) {
|
|
51
|
-
|
|
38
|
+
this.#c.storage.assertBot("answerCallbackQuery");
|
|
52
39
|
(0, _0_utilities_js_1.checkCallbackQueryId)(id);
|
|
53
|
-
await
|
|
40
|
+
await this.#c.invoke({ _: "messages.setBotCallbackAnswer", query_id: BigInt(id), cache_time: params?.cacheTime ?? 0, message: params?.text, alert: params?.alert ? true : undefined });
|
|
54
41
|
}
|
|
55
42
|
async sendCallbackQuery(botId, messageId, question) {
|
|
56
|
-
|
|
43
|
+
this.#c.storage.assertUser("sendCallbackQuery");
|
|
57
44
|
(0, _0_utilities_js_1.checkMessageId)(messageId);
|
|
58
45
|
(0, _3_types_js_1.validateCallbackQueryQuestion)(question);
|
|
59
|
-
const peer = await
|
|
60
|
-
const maybeAnswer = await
|
|
61
|
-
if (maybeAnswer != null && !
|
|
46
|
+
const peer = await this.#c.getInputPeer(botId), peerId = await this.#c.getInputPeerChatId(peer), questionKey = JSON.stringify(question);
|
|
47
|
+
const maybeAnswer = await this.#c.messageStorage.getCallbackQueryAnswer(peerId, messageId, questionKey);
|
|
48
|
+
if (maybeAnswer != null && !CallbackQueryManager.#isExpired(maybeAnswer[1], maybeAnswer[0].cache_time)) {
|
|
62
49
|
return (0, _3_types_js_1.constructCallbackQueryAnswer)(maybeAnswer[0]);
|
|
63
50
|
}
|
|
64
|
-
const answer = await
|
|
51
|
+
const answer = await this.#c.invoke({ _: "messages.getBotCallbackAnswer", peer, msg_id: messageId, data: "data" in question ? (0, _1_utilities_js_1.encodeText)(question.data) : undefined, game: question.type == "game" ? true : undefined, password: question.type == "password" ? await this.#getPasswordCheck(question.password) : undefined });
|
|
65
52
|
if (answer.cache_time >= 0) {
|
|
66
|
-
await
|
|
53
|
+
await this.#c.messageStorage.setCallbackQueryAnswer(peerId, messageId, questionKey, answer);
|
|
67
54
|
}
|
|
68
55
|
return (0, _3_types_js_1.constructCallbackQueryAnswer)(answer);
|
|
69
56
|
}
|
|
57
|
+
static #isExpired(date, cacheTime) {
|
|
58
|
+
return (Date.now() - date.getTime()) / 1000 > cacheTime;
|
|
59
|
+
}
|
|
60
|
+
async #getPasswordCheck(password) {
|
|
61
|
+
const ap = await this.#c.invoke({ _: "account.getPassword" });
|
|
62
|
+
return await (0, _0_password_js_1.checkPassword)(password, ap);
|
|
63
|
+
}
|
|
70
64
|
canHandleUpdate(update) {
|
|
71
65
|
return _2_tl_js_1.Api.isOneOf(callbackQueryManagerUpdates, update);
|
|
72
66
|
}
|
|
73
67
|
async handleUpdate(update) {
|
|
74
|
-
return { callbackQuery: await (0, _3_types_js_1.constructCallbackQuery)(update,
|
|
68
|
+
return { callbackQuery: await (0, _3_types_js_1.constructCallbackQuery)(update, this.#c.getEntity, this.#c.messageManager.getMessageWithReply.bind(this.#c.messageManager)) };
|
|
75
69
|
}
|
|
76
70
|
}
|
|
77
71
|
exports.CallbackQueryManager = CallbackQueryManager;
|
|
78
|
-
_a = CallbackQueryManager, _CallbackQueryManager_c = new WeakMap(), _CallbackQueryManager_instances = new WeakSet(), _CallbackQueryManager_isExpired = function _CallbackQueryManager_isExpired(date, cacheTime) {
|
|
79
|
-
return (Date.now() - date.getTime()) / 1000 > cacheTime;
|
|
80
|
-
}, _CallbackQueryManager_getPasswordCheck = async function _CallbackQueryManager_getPasswordCheck(password) {
|
|
81
|
-
const ap = await __classPrivateFieldGet(this, _CallbackQueryManager_c, "f").invoke({ _: "account.getPassword" });
|
|
82
|
-
return await (0, _0_password_js_1.checkPassword)(password, ap);
|
|
83
|
-
};
|