@mtkruto/node 0.1.800 → 0.2.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/esm/0_deps.d.ts +2 -0
- package/esm/0_deps.d.ts.map +1 -1
- package/esm/0_deps.js +2 -1
- package/esm/2_tl.d.ts +7 -8
- package/esm/2_tl.d.ts.map +1 -1
- package/esm/2_tl.js +7 -8
- package/esm/3_errors.d.ts +519 -515
- package/esm/3_errors.d.ts.map +1 -1
- package/esm/3_errors.js +527 -512
- package/esm/3_transport.d.ts +1 -0
- package/esm/3_transport.d.ts.map +1 -1
- package/esm/3_transport.js +1 -0
- package/esm/4_errors.d.ts +7 -7
- package/esm/4_errors.d.ts.map +1 -1
- package/esm/4_errors.js +5 -5
- package/esm/client/0_client_abstract.d.ts +1 -21
- package/esm/client/0_client_abstract.d.ts.map +1 -1
- package/esm/client/0_client_abstract.js +17 -15
- package/esm/client/0_message.d.ts +3 -3
- package/esm/client/0_message.d.ts.map +1 -1
- package/esm/client/0_message.js +4 -20
- package/esm/client/0_params.d.ts +1 -1
- package/esm/client/0_params.d.ts.map +1 -1
- package/esm/client/0_password.d.ts +2 -2
- package/esm/client/0_password.d.ts.map +1 -1
- package/esm/client/0_password.js +3 -8
- package/esm/client/0_storage_operations.d.ts +23 -23
- package/esm/client/0_storage_operations.d.ts.map +1 -1
- package/esm/client/0_storage_operations.js +13 -12
- package/esm/client/0_utilities.d.ts.map +1 -1
- package/esm/client/0_utilities.js +13 -10
- package/esm/client/1_client_encrypted.d.ts +3 -5
- package/esm/client/1_client_encrypted.d.ts.map +1 -1
- package/esm/client/1_client_encrypted.js +44 -28
- package/esm/client/1_client_plain.d.ts +2 -2
- package/esm/client/1_client_plain.d.ts.map +1 -1
- package/esm/client/1_client_plain.js +27 -19
- package/esm/client/1_types.d.ts +9 -22
- package/esm/client/1_types.d.ts.map +1 -1
- package/esm/client/2_account_manager.d.ts +2 -2
- package/esm/client/2_account_manager.js +16 -16
- package/esm/client/2_bot_info_manager.d.ts.map +1 -1
- package/esm/client/2_bot_info_manager.js +7 -6
- package/esm/client/2_business_connection_manager.d.ts +3 -3
- package/esm/client/2_business_connection_manager.d.ts.map +1 -1
- package/esm/client/2_business_connection_manager.js +6 -5
- package/esm/client/2_file_manager.d.ts +4 -4
- package/esm/client/2_file_manager.d.ts.map +1 -1
- package/esm/client/2_file_manager.js +26 -23
- package/esm/client/2_reaction_manager.d.ts +3 -3
- package/esm/client/2_reaction_manager.d.ts.map +1 -1
- package/esm/client/2_reaction_manager.js +16 -10
- package/esm/client/2_update_manager.d.ts +11 -11
- package/esm/client/2_update_manager.d.ts.map +1 -1
- package/esm/client/2_update_manager.js +185 -164
- package/esm/client/3_message_manager.d.ts +8 -9
- package/esm/client/3_message_manager.d.ts.map +1 -1
- package/esm/client/3_message_manager.js +205 -474
- package/esm/client/3_video_chat_manager.d.ts +3 -3
- package/esm/client/3_video_chat_manager.d.ts.map +1 -1
- package/esm/client/3_video_chat_manager.js +26 -36
- package/esm/client/4_callback_query_manager.d.ts +3 -3
- package/esm/client/4_callback_query_manager.d.ts.map +1 -1
- package/esm/client/4_callback_query_manager.js +5 -16
- package/esm/client/4_chat_list_manager.d.ts +5 -4
- package/esm/client/4_chat_list_manager.d.ts.map +1 -1
- package/esm/client/4_chat_list_manager.js +56 -34
- package/esm/client/4_inline_query_manager.d.ts +3 -3
- package/esm/client/4_inline_query_manager.d.ts.map +1 -1
- package/esm/client/4_inline_query_manager.js +6 -15
- package/esm/client/4_story_manager.d.ts +3 -3
- package/esm/client/4_story_manager.d.ts.map +1 -1
- package/esm/client/4_story_manager.js +15 -32
- package/esm/client/5_client.d.ts +10 -12
- package/esm/client/5_client.d.ts.map +1 -1
- package/esm/client/5_client.js +60 -114
- package/esm/{tl/7_message.d.ts → connection/1_connection_tcp.d.ts} +14 -12
- package/esm/connection/1_connection_tcp.d.ts.map +1 -0
- package/esm/connection/1_connection_tcp.js +169 -0
- package/esm/deps/deno.land/std@0.224.0/io/_constants.d.ts +3 -0
- package/esm/deps/deno.land/std@0.224.0/io/_constants.d.ts.map +1 -0
- package/esm/deps/deno.land/std@0.224.0/io/_constants.js +4 -0
- package/esm/deps/deno.land/std@0.224.0/io/iterate_reader.d.ts +70 -0
- package/esm/deps/deno.land/std@0.224.0/io/iterate_reader.d.ts.map +1 -0
- package/esm/deps/deno.land/std@0.224.0/io/iterate_reader.js +86 -0
- package/esm/deps/deno.land/std@0.224.0/io/types.d.ts +95 -0
- package/esm/deps/deno.land/std@0.224.0/io/types.d.ts.map +1 -0
- package/esm/deps/deno.land/std@0.224.0/io/types.js +3 -0
- package/esm/deps/deno.land/std@0.224.0/io/write_all.d.ts +39 -0
- package/esm/deps/deno.land/std@0.224.0/io/write_all.d.ts.map +1 -0
- package/esm/deps/deno.land/std@0.224.0/io/write_all.js +49 -0
- package/esm/deps/raw.githubusercontent.com/MTKruto/socks5/main/client.d.ts +45 -0
- package/esm/deps/raw.githubusercontent.com/MTKruto/socks5/main/client.d.ts.map +1 -0
- package/esm/deps/raw.githubusercontent.com/MTKruto/socks5/main/client.js +253 -0
- package/esm/deps/raw.githubusercontent.com/MTKruto/socks5/main/deps.d.ts +3 -0
- package/esm/deps/raw.githubusercontent.com/MTKruto/socks5/main/deps.d.ts.map +1 -0
- package/esm/deps/raw.githubusercontent.com/MTKruto/socks5/main/deps.js +1 -0
- package/esm/deps/raw.githubusercontent.com/MTKruto/socks5/main/utils.d.ts +3 -0
- package/esm/deps/raw.githubusercontent.com/MTKruto/socks5/main/utils.d.ts.map +1 -0
- package/esm/deps/raw.githubusercontent.com/MTKruto/socks5/main/utils.js +13 -0
- package/esm/mod.d.ts +0 -1
- package/esm/mod.d.ts.map +1 -1
- package/esm/mod.js +0 -1
- package/esm/tl/0_api.d.ts +14813 -0
- package/esm/tl/0_api.d.ts.map +1 -0
- package/esm/tl/0_api.js +23222 -0
- package/esm/tl/1_utilities.d.ts +32 -0
- package/esm/tl/1_utilities.d.ts.map +1 -0
- package/esm/tl/1_utilities.js +65 -0
- package/esm/tl/1_utilities_test.d.ts.map +1 -0
- package/esm/tl/2_deserialize.d.ts +23 -0
- package/esm/tl/2_deserialize.d.ts.map +1 -0
- package/esm/tl/{3_deserialize.js → 2_deserialize.js} +16 -17
- package/esm/tl/2_serialize.d.ts +22 -0
- package/esm/tl/2_serialize.d.ts.map +1 -0
- package/esm/tl/2_serialize.js +160 -0
- package/esm/tl/2_serialize_test.d.ts.map +1 -0
- package/esm/tl/{4_tl_reader.d.ts → 3_tl_reader.d.ts} +3 -3
- package/esm/tl/3_tl_reader.d.ts.map +1 -0
- package/esm/tl/{4_tl_reader.js → 3_tl_reader.js} +5 -5
- package/esm/tl/3_utilities.d.ts +5 -5
- package/esm/tl/3_utilities.d.ts.map +1 -1
- package/esm/tl/3_utilities.js +9 -10
- package/esm/tl/4_rpc_result.d.ts +27 -0
- package/esm/tl/4_rpc_result.d.ts.map +1 -0
- package/esm/tl/4_rpc_result.js +28 -0
- package/{script/tl/5_tl_writer.d.ts → esm/tl/4_tl_writer.d.ts} +2 -2
- package/esm/tl/4_tl_writer.d.ts.map +1 -0
- package/esm/tl/{5_tl_writer.js → 4_tl_writer.js} +4 -4
- package/esm/tl/5_message.d.ts +39 -0
- package/esm/tl/5_message.d.ts.map +1 -0
- package/esm/tl/5_message.js +98 -0
- package/esm/tl/5_message_test.d.ts.map +1 -0
- package/esm/transport/3_transport_provider_tcp.d.ts +14 -0
- package/esm/transport/3_transport_provider_tcp.d.ts.map +1 -0
- package/esm/transport/3_transport_provider_tcp.js +15 -0
- package/esm/types/0_birthday.d.ts +2 -2
- package/esm/types/0_birthday.d.ts.map +1 -1
- package/esm/types/0_callback_query_answer.d.ts +2 -2
- package/esm/types/0_callback_query_answer.d.ts.map +1 -1
- package/esm/types/0_chat_administrator_rights.d.ts +3 -3
- package/esm/types/0_chat_administrator_rights.d.ts.map +1 -1
- package/esm/types/0_chat_administrator_rights.js +1 -11
- package/esm/types/0_chat_member_rights.d.ts +3 -3
- package/esm/types/0_chat_member_rights.d.ts.map +1 -1
- package/esm/types/0_chat_member_rights.js +3 -3
- package/esm/types/0_chat_photo.d.ts +2 -2
- package/esm/types/0_chat_photo.d.ts.map +1 -1
- package/esm/types/0_chat_photo.js +2 -2
- package/esm/types/0_contact.d.ts +2 -2
- package/esm/types/0_contact.d.ts.map +1 -1
- package/esm/types/0_dice.d.ts +2 -2
- package/esm/types/0_dice.d.ts.map +1 -1
- package/esm/types/0_giveaway_parameters.d.ts +2 -2
- package/esm/types/0_giveaway_parameters.d.ts.map +1 -1
- package/esm/types/0_giveaway_parameters.js +3 -3
- package/esm/types/0_link_preview.d.ts +2 -2
- package/esm/types/0_link_preview.d.ts.map +1 -1
- package/esm/types/0_live_stream_channel.d.ts +2 -2
- package/esm/types/0_live_stream_channel.d.ts.map +1 -1
- package/esm/types/0_location.d.ts +2 -2
- package/esm/types/0_location.d.ts.map +1 -1
- package/esm/types/0_location.js +5 -5
- package/esm/types/0_mask_position.d.ts +2 -2
- package/esm/types/0_mask_position.d.ts.map +1 -1
- package/esm/types/0_message_entity.d.ts +3 -3
- package/esm/types/0_message_entity.d.ts.map +1 -1
- package/esm/types/0_message_entity.js +42 -42
- package/esm/types/0_message_search_filter.d.ts +2 -2
- package/esm/types/0_message_search_filter.d.ts.map +1 -1
- package/esm/types/0_message_search_filter.js +14 -15
- package/esm/types/0_opening_hours.d.ts +2 -2
- package/esm/types/0_opening_hours.d.ts.map +1 -1
- package/esm/types/0_poll_option.d.ts +2 -2
- package/esm/types/0_poll_option.d.ts.map +1 -1
- package/esm/types/0_reaction.d.ts +3 -3
- package/esm/types/0_reaction.d.ts.map +1 -1
- package/esm/types/0_reaction.js +4 -4
- package/esm/types/0_restriction_reason.d.ts +2 -2
- package/esm/types/0_restriction_reason.d.ts.map +1 -1
- package/esm/types/0_thumbnail.d.ts +2 -2
- package/esm/types/0_thumbnail.d.ts.map +1 -1
- package/esm/types/0_thumbnail.js +3 -3
- package/esm/types/0_video_chat.d.ts +2 -2
- package/esm/types/0_video_chat.d.ts.map +1 -1
- package/esm/types/0_video_chat.js +2 -2
- package/esm/types/0_voice.d.ts +2 -2
- package/esm/types/0_voice.d.ts.map +1 -1
- package/esm/types/1_animation.d.ts +2 -2
- package/esm/types/1_animation.d.ts.map +1 -1
- package/esm/types/1_animation.js +2 -2
- package/esm/types/1_audio.d.ts +2 -2
- package/esm/types/1_audio.d.ts.map +1 -1
- package/esm/types/1_audio.js +2 -2
- package/esm/types/1_bot_command_scope.d.ts +9 -2
- package/esm/types/1_bot_command_scope.d.ts.map +1 -1
- package/esm/types/1_bot_command_scope.js +9 -9
- package/esm/types/1_chat_p.d.ts +5 -5
- package/esm/types/1_chat_p.d.ts.map +1 -1
- package/esm/types/1_chat_p.js +6 -6
- package/esm/types/1_document.d.ts +2 -2
- package/esm/types/1_document.d.ts.map +1 -1
- package/esm/types/1_document.js +2 -2
- package/esm/types/1_giveaway.d.ts +2 -2
- package/esm/types/1_giveaway.d.ts.map +1 -1
- package/esm/types/1_keyboard_button.d.ts +3 -3
- package/esm/types/1_keyboard_button.d.ts.map +1 -1
- package/esm/types/1_keyboard_button.js +18 -45
- package/esm/types/1_message_reaction.d.ts +2 -2
- package/esm/types/1_message_reaction.d.ts.map +1 -1
- package/esm/types/1_message_reaction.js +5 -5
- package/esm/types/1_photo.d.ts +5 -5
- package/esm/types/1_photo.d.ts.map +1 -1
- package/esm/types/1_photo.js +4 -4
- package/esm/types/1_poll.d.ts +2 -2
- package/esm/types/1_poll.d.ts.map +1 -1
- package/esm/types/1_reaction_count.d.ts +2 -2
- package/esm/types/1_reaction_count.d.ts.map +1 -1
- package/esm/types/1_reply_quote.d.ts +2 -2
- package/esm/types/1_reply_quote.d.ts.map +1 -1
- package/esm/types/1_sticker.d.ts +3 -3
- package/esm/types/1_sticker.d.ts.map +1 -1
- package/esm/types/1_sticker.js +9 -9
- package/esm/types/1_story_privacy.d.ts +3 -3
- package/esm/types/1_story_privacy.d.ts.map +1 -1
- package/esm/types/1_story_privacy.js +14 -14
- package/esm/types/1_story_reaction.d.ts +2 -2
- package/esm/types/1_story_reaction.d.ts.map +1 -1
- package/esm/types/1_user.d.ts +2 -2
- package/esm/types/1_user.d.ts.map +1 -1
- package/esm/types/1_user.js +2 -2
- package/esm/types/1_venue.d.ts +2 -2
- package/esm/types/1_venue.d.ts.map +1 -1
- package/esm/types/1_venue.js +2 -2
- package/esm/types/1_video.d.ts +2 -2
- package/esm/types/1_video.d.ts.map +1 -1
- package/esm/types/1_video.js +2 -2
- package/esm/types/1_video_note.d.ts +2 -2
- package/esm/types/1_video_note.d.ts.map +1 -1
- package/esm/types/1_video_note.js +2 -2
- package/esm/types/2_business_connection.d.ts +2 -2
- package/esm/types/2_business_connection.d.ts.map +1 -1
- package/esm/types/2_business_connection.js +1 -2
- package/esm/types/2_chat.d.ts +2 -2
- package/esm/types/2_chat.d.ts.map +1 -1
- package/esm/types/2_chat.js +11 -11
- package/esm/types/2_chat_member.d.ts +2 -2
- package/esm/types/2_chat_member.d.ts.map +1 -1
- package/esm/types/2_chat_member.js +10 -10
- package/esm/types/2_chosen_inline_result.d.ts +2 -2
- package/esm/types/2_chosen_inline_result.d.ts.map +1 -1
- package/esm/types/2_chosen_inline_result.js +5 -5
- package/esm/types/2_game.d.ts +2 -2
- package/esm/types/2_game.d.ts.map +1 -1
- package/esm/types/2_game.js +4 -4
- package/esm/types/2_inactive_chat.d.ts +2 -2
- package/esm/types/2_inactive_chat.d.ts.map +1 -1
- package/esm/types/2_inactive_chat.js +2 -2
- package/esm/types/2_inline_keyboard_button.d.ts +3 -3
- package/esm/types/2_inline_keyboard_button.d.ts.map +1 -1
- package/esm/types/2_inline_keyboard_button.js +15 -21
- package/esm/types/2_inline_query.d.ts +2 -2
- package/esm/types/2_inline_query.d.ts.map +1 -1
- package/esm/types/2_inline_query.js +8 -8
- package/esm/types/2_invite_link.d.ts +2 -2
- package/esm/types/2_invite_link.d.ts.map +1 -1
- package/esm/types/2_invite_link.js +1 -2
- package/esm/types/2_message_reaction_count.d.ts +2 -2
- package/esm/types/2_message_reaction_count.d.ts.map +1 -1
- package/esm/types/2_message_reactions.d.ts +2 -2
- package/esm/types/2_message_reactions.d.ts.map +1 -1
- package/esm/types/2_message_reactions.js +2 -2
- package/esm/types/2_story_content.d.ts +2 -2
- package/esm/types/2_story_content.d.ts.map +1 -1
- package/esm/types/2_story_content.js +6 -6
- package/esm/types/2_story_interactions.d.ts +2 -2
- package/esm/types/2_story_interactions.d.ts.map +1 -1
- package/esm/types/2_story_interactive_area.d.ts +3 -3
- package/esm/types/2_story_interactive_area.d.ts.map +1 -1
- package/esm/types/2_story_interactive_area.js +19 -29
- package/esm/types/3_chat_member_updated.d.ts +2 -2
- package/esm/types/3_chat_member_updated.d.ts.map +1 -1
- package/esm/types/3_chat_member_updated.js +7 -7
- package/esm/types/3_reply_markup.d.ts +3 -3
- package/esm/types/3_reply_markup.d.ts.map +1 -1
- package/esm/types/3_reply_markup.js +12 -22
- package/esm/types/3_story.d.ts +2 -2
- package/esm/types/3_story.d.ts.map +1 -1
- package/esm/types/4_inline_query_result.d.ts +3 -3
- package/esm/types/4_inline_query_result.d.ts.map +1 -1
- package/esm/types/4_inline_query_result.js +53 -161
- package/esm/types/4_message.d.ts +3 -3
- package/esm/types/4_message.d.ts.map +1 -1
- package/esm/types/4_message.js +68 -59
- package/esm/types/5_callback_query.d.ts +3 -3
- package/esm/types/5_callback_query.d.ts.map +1 -1
- package/esm/types/5_callback_query.js +5 -5
- package/esm/types/5_chat_list_item.d.ts +3 -3
- package/esm/types/5_chat_list_item.d.ts.map +1 -1
- package/esm/types/5_chat_list_item.js +2 -2
- package/esm/types/5_inline_query_answer.d.ts +2 -2
- package/esm/types/5_inline_query_answer.d.ts.map +1 -1
- package/esm/types/_file_id.d.ts +2 -2
- package/esm/types/_file_id.d.ts.map +1 -1
- package/esm/types/_file_id.js +4 -4
- package/esm/types/_getters.d.ts +7 -7
- package/esm/types/_getters.d.ts.map +1 -1
- package/package.json +1 -1
- package/script/0_deps.d.ts +2 -0
- package/script/0_deps.d.ts.map +1 -1
- package/script/0_deps.js +5 -2
- package/script/2_tl.d.ts +7 -8
- package/script/2_tl.d.ts.map +1 -1
- package/script/2_tl.js +20 -11
- package/script/3_errors.d.ts +519 -515
- package/script/3_errors.d.ts.map +1 -1
- package/script/3_errors.js +543 -514
- package/script/3_transport.d.ts +1 -0
- package/script/3_transport.d.ts.map +1 -1
- package/script/3_transport.js +1 -0
- package/script/4_errors.d.ts +7 -7
- package/script/4_errors.d.ts.map +1 -1
- package/script/4_errors.js +6 -6
- package/script/client/0_client_abstract.d.ts +1 -21
- package/script/client/0_client_abstract.d.ts.map +1 -1
- package/script/client/0_client_abstract.js +41 -16
- package/script/client/0_message.d.ts +3 -3
- package/script/client/0_message.d.ts.map +1 -1
- package/script/client/0_message.js +3 -19
- package/script/client/0_params.d.ts +1 -1
- package/script/client/0_params.d.ts.map +1 -1
- package/script/client/0_password.d.ts +2 -2
- package/script/client/0_password.d.ts.map +1 -1
- package/script/client/0_password.js +2 -7
- package/script/client/0_storage_operations.d.ts +23 -23
- package/script/client/0_storage_operations.d.ts.map +1 -1
- package/script/client/0_storage_operations.js +12 -11
- package/script/client/0_utilities.d.ts.map +1 -1
- package/script/client/0_utilities.js +12 -9
- package/script/client/1_client_encrypted.d.ts +3 -5
- package/script/client/1_client_encrypted.d.ts.map +1 -1
- package/script/client/1_client_encrypted.js +42 -26
- package/script/client/1_client_plain.d.ts +2 -2
- package/script/client/1_client_plain.d.ts.map +1 -1
- package/script/client/1_client_plain.js +25 -17
- package/script/client/1_types.d.ts +9 -22
- package/script/client/1_types.d.ts.map +1 -1
- package/script/client/2_account_manager.d.ts +2 -2
- package/script/client/2_account_manager.js +15 -15
- package/script/client/2_bot_info_manager.d.ts.map +1 -1
- package/script/client/2_bot_info_manager.js +7 -6
- package/script/client/2_business_connection_manager.d.ts +3 -3
- package/script/client/2_business_connection_manager.d.ts.map +1 -1
- package/script/client/2_business_connection_manager.js +5 -4
- package/script/client/2_file_manager.d.ts +4 -4
- package/script/client/2_file_manager.d.ts.map +1 -1
- package/script/client/2_file_manager.js +25 -22
- package/script/client/2_reaction_manager.d.ts +3 -3
- package/script/client/2_reaction_manager.d.ts.map +1 -1
- package/script/client/2_reaction_manager.js +15 -9
- package/script/client/2_update_manager.d.ts +11 -11
- package/script/client/2_update_manager.d.ts.map +1 -1
- package/script/client/2_update_manager.js +183 -162
- package/script/client/3_message_manager.d.ts +8 -9
- package/script/client/3_message_manager.d.ts.map +1 -1
- package/script/client/3_message_manager.js +204 -473
- package/script/client/3_video_chat_manager.d.ts +3 -3
- package/script/client/3_video_chat_manager.d.ts.map +1 -1
- package/script/client/3_video_chat_manager.js +25 -35
- package/script/client/4_callback_query_manager.d.ts +3 -3
- package/script/client/4_callback_query_manager.d.ts.map +1 -1
- package/script/client/4_callback_query_manager.js +4 -15
- package/script/client/4_chat_list_manager.d.ts +5 -4
- package/script/client/4_chat_list_manager.d.ts.map +1 -1
- package/script/client/4_chat_list_manager.js +54 -32
- package/script/client/4_inline_query_manager.d.ts +3 -3
- package/script/client/4_inline_query_manager.d.ts.map +1 -1
- package/script/client/4_inline_query_manager.js +5 -14
- package/script/client/4_story_manager.d.ts +3 -3
- package/script/client/4_story_manager.d.ts.map +1 -1
- package/script/client/4_story_manager.js +14 -31
- package/script/client/5_client.d.ts +10 -12
- package/script/client/5_client.d.ts.map +1 -1
- package/script/client/5_client.js +59 -113
- package/{esm/tl/6_rpc_result.d.ts → script/connection/1_connection_tcp.d.ts} +14 -10
- package/script/connection/1_connection_tcp.d.ts.map +1 -0
- package/script/connection/1_connection_tcp.js +196 -0
- package/script/deps/deno.land/std@0.224.0/io/_constants.d.ts +3 -0
- package/script/deps/deno.land/std@0.224.0/io/_constants.d.ts.map +1 -0
- package/script/deps/deno.land/std@0.224.0/io/_constants.js +7 -0
- package/script/deps/deno.land/std@0.224.0/io/iterate_reader.d.ts +70 -0
- package/script/deps/deno.land/std@0.224.0/io/iterate_reader.d.ts.map +1 -0
- package/script/deps/deno.land/std@0.224.0/io/iterate_reader.js +91 -0
- package/script/deps/deno.land/std@0.224.0/io/types.d.ts +95 -0
- package/script/deps/deno.land/std@0.224.0/io/types.d.ts.map +1 -0
- package/script/deps/deno.land/std@0.224.0/io/types.js +4 -0
- package/script/deps/deno.land/std@0.224.0/io/write_all.d.ts +39 -0
- package/script/deps/deno.land/std@0.224.0/io/write_all.d.ts.map +1 -0
- package/script/deps/deno.land/std@0.224.0/io/write_all.js +54 -0
- package/script/deps/raw.githubusercontent.com/MTKruto/socks5/main/client.d.ts +45 -0
- package/script/deps/raw.githubusercontent.com/MTKruto/socks5/main/client.d.ts.map +1 -0
- package/script/deps/raw.githubusercontent.com/MTKruto/socks5/main/client.js +280 -0
- package/script/deps/raw.githubusercontent.com/MTKruto/socks5/main/deps.d.ts +3 -0
- package/script/deps/raw.githubusercontent.com/MTKruto/socks5/main/deps.d.ts.map +1 -0
- package/script/deps/raw.githubusercontent.com/MTKruto/socks5/main/deps.js +5 -0
- package/script/deps/raw.githubusercontent.com/MTKruto/socks5/main/utils.d.ts +3 -0
- package/script/deps/raw.githubusercontent.com/MTKruto/socks5/main/utils.d.ts.map +1 -0
- package/script/deps/raw.githubusercontent.com/MTKruto/socks5/main/utils.js +40 -0
- package/script/mod.d.ts +0 -1
- package/script/mod.d.ts.map +1 -1
- package/script/mod.js +0 -1
- package/script/tl/0_api.d.ts +14813 -0
- package/script/tl/0_api.d.ts.map +1 -0
- package/script/tl/0_api.js +23248 -0
- package/script/tl/1_utilities.d.ts +32 -0
- package/script/tl/1_utilities.d.ts.map +1 -0
- package/script/tl/1_utilities.js +76 -0
- package/script/tl/1_utilities_test.d.ts.map +1 -0
- package/script/tl/2_deserialize.d.ts +23 -0
- package/script/tl/2_deserialize.d.ts.map +1 -0
- package/script/tl/{3_deserialize.js → 2_deserialize.js} +19 -20
- package/script/tl/2_serialize.d.ts +22 -0
- package/script/tl/2_serialize.d.ts.map +1 -0
- package/script/tl/2_serialize.js +164 -0
- package/script/tl/2_serialize_test.d.ts.map +1 -0
- package/script/tl/{4_tl_reader.d.ts → 3_tl_reader.d.ts} +3 -3
- package/script/tl/3_tl_reader.d.ts.map +1 -0
- package/script/tl/{4_tl_reader.js → 3_tl_reader.js} +5 -5
- package/script/tl/3_utilities.d.ts +5 -5
- package/script/tl/3_utilities.d.ts.map +1 -1
- package/script/tl/3_utilities.js +9 -10
- package/script/tl/4_rpc_result.d.ts +27 -0
- package/script/tl/4_rpc_result.d.ts.map +1 -0
- package/{esm/tl/8_message_container.d.ts → script/tl/4_rpc_result.js} +12 -12
- package/{esm/tl/5_tl_writer.d.ts → script/tl/4_tl_writer.d.ts} +2 -2
- package/script/tl/4_tl_writer.d.ts.map +1 -0
- package/script/tl/{5_tl_writer.js → 4_tl_writer.js} +4 -4
- package/script/tl/5_message.d.ts +39 -0
- package/script/tl/5_message.d.ts.map +1 -0
- package/script/tl/5_message.js +106 -0
- package/script/tl/5_message_test.d.ts.map +1 -0
- package/script/transport/3_transport_provider_tcp.d.ts +14 -0
- package/script/transport/3_transport_provider_tcp.d.ts.map +1 -0
- package/script/transport/3_transport_provider_tcp.js +19 -0
- package/script/types/0_birthday.d.ts +2 -2
- package/script/types/0_birthday.d.ts.map +1 -1
- package/script/types/0_callback_query_answer.d.ts +2 -2
- package/script/types/0_callback_query_answer.d.ts.map +1 -1
- package/script/types/0_chat_administrator_rights.d.ts +3 -3
- package/script/types/0_chat_administrator_rights.d.ts.map +1 -1
- package/script/types/0_chat_administrator_rights.js +1 -11
- package/script/types/0_chat_member_rights.d.ts +3 -3
- package/script/types/0_chat_member_rights.d.ts.map +1 -1
- package/script/types/0_chat_member_rights.js +3 -3
- package/script/types/0_chat_photo.d.ts +2 -2
- package/script/types/0_chat_photo.d.ts.map +1 -1
- package/script/types/0_chat_photo.js +1 -1
- package/script/types/0_contact.d.ts +2 -2
- package/script/types/0_contact.d.ts.map +1 -1
- package/script/types/0_dice.d.ts +2 -2
- package/script/types/0_dice.d.ts.map +1 -1
- package/script/types/0_giveaway_parameters.d.ts +2 -2
- package/script/types/0_giveaway_parameters.d.ts.map +1 -1
- package/script/types/0_giveaway_parameters.js +2 -2
- package/script/types/0_link_preview.d.ts +2 -2
- package/script/types/0_link_preview.d.ts.map +1 -1
- package/script/types/0_live_stream_channel.d.ts +2 -2
- package/script/types/0_live_stream_channel.d.ts.map +1 -1
- package/script/types/0_location.d.ts +2 -2
- package/script/types/0_location.d.ts.map +1 -1
- package/script/types/0_location.js +4 -4
- package/script/types/0_mask_position.d.ts +2 -2
- package/script/types/0_mask_position.d.ts.map +1 -1
- package/script/types/0_message_entity.d.ts +3 -3
- package/script/types/0_message_entity.d.ts.map +1 -1
- package/script/types/0_message_entity.js +41 -41
- package/script/types/0_message_search_filter.d.ts +2 -2
- package/script/types/0_message_search_filter.d.ts.map +1 -1
- package/script/types/0_message_search_filter.js +14 -15
- package/script/types/0_opening_hours.d.ts +2 -2
- package/script/types/0_opening_hours.d.ts.map +1 -1
- package/script/types/0_poll_option.d.ts +2 -2
- package/script/types/0_poll_option.d.ts.map +1 -1
- package/script/types/0_reaction.d.ts +3 -3
- package/script/types/0_reaction.d.ts.map +1 -1
- package/script/types/0_reaction.js +3 -3
- package/script/types/0_restriction_reason.d.ts +2 -2
- package/script/types/0_restriction_reason.d.ts.map +1 -1
- package/script/types/0_thumbnail.d.ts +2 -2
- package/script/types/0_thumbnail.d.ts.map +1 -1
- package/script/types/0_thumbnail.js +2 -2
- package/script/types/0_video_chat.d.ts +2 -2
- package/script/types/0_video_chat.d.ts.map +1 -1
- package/script/types/0_video_chat.js +1 -1
- package/script/types/0_voice.d.ts +2 -2
- package/script/types/0_voice.d.ts.map +1 -1
- package/script/types/1_animation.d.ts +2 -2
- package/script/types/1_animation.d.ts.map +1 -1
- package/script/types/1_animation.js +1 -1
- package/script/types/1_audio.d.ts +2 -2
- package/script/types/1_audio.d.ts.map +1 -1
- package/script/types/1_audio.js +1 -1
- package/script/types/1_bot_command_scope.d.ts +9 -2
- package/script/types/1_bot_command_scope.d.ts.map +1 -1
- package/script/types/1_bot_command_scope.js +8 -8
- package/script/types/1_chat_p.d.ts +5 -5
- package/script/types/1_chat_p.d.ts.map +1 -1
- package/script/types/1_chat_p.js +5 -5
- package/script/types/1_document.d.ts +2 -2
- package/script/types/1_document.d.ts.map +1 -1
- package/script/types/1_document.js +1 -1
- package/script/types/1_giveaway.d.ts +2 -2
- package/script/types/1_giveaway.d.ts.map +1 -1
- package/script/types/1_keyboard_button.d.ts +3 -3
- package/script/types/1_keyboard_button.d.ts.map +1 -1
- package/script/types/1_keyboard_button.js +17 -44
- package/script/types/1_message_reaction.d.ts +2 -2
- package/script/types/1_message_reaction.d.ts.map +1 -1
- package/script/types/1_message_reaction.js +4 -4
- package/script/types/1_photo.d.ts +5 -5
- package/script/types/1_photo.d.ts.map +1 -1
- package/script/types/1_photo.js +3 -3
- package/script/types/1_poll.d.ts +2 -2
- package/script/types/1_poll.d.ts.map +1 -1
- package/script/types/1_reaction_count.d.ts +2 -2
- package/script/types/1_reaction_count.d.ts.map +1 -1
- package/script/types/1_reply_quote.d.ts +2 -2
- package/script/types/1_reply_quote.d.ts.map +1 -1
- package/script/types/1_sticker.d.ts +3 -3
- package/script/types/1_sticker.d.ts.map +1 -1
- package/script/types/1_sticker.js +8 -8
- package/script/types/1_story_privacy.d.ts +3 -3
- package/script/types/1_story_privacy.d.ts.map +1 -1
- package/script/types/1_story_privacy.js +13 -13
- package/script/types/1_story_reaction.d.ts +2 -2
- package/script/types/1_story_reaction.d.ts.map +1 -1
- package/script/types/1_user.d.ts +2 -2
- package/script/types/1_user.d.ts.map +1 -1
- package/script/types/1_user.js +1 -1
- package/script/types/1_venue.d.ts +2 -2
- package/script/types/1_venue.d.ts.map +1 -1
- package/script/types/1_venue.js +1 -1
- package/script/types/1_video.d.ts +2 -2
- package/script/types/1_video.d.ts.map +1 -1
- package/script/types/1_video.js +1 -1
- package/script/types/1_video_note.d.ts +2 -2
- package/script/types/1_video_note.d.ts.map +1 -1
- package/script/types/1_video_note.js +1 -1
- package/script/types/2_business_connection.d.ts +2 -2
- package/script/types/2_business_connection.d.ts.map +1 -1
- package/script/types/2_business_connection.js +1 -2
- package/script/types/2_chat.d.ts +2 -2
- package/script/types/2_chat.d.ts.map +1 -1
- package/script/types/2_chat.js +10 -10
- package/script/types/2_chat_member.d.ts +2 -2
- package/script/types/2_chat_member.d.ts.map +1 -1
- package/script/types/2_chat_member.js +9 -9
- package/script/types/2_chosen_inline_result.d.ts +2 -2
- package/script/types/2_chosen_inline_result.d.ts.map +1 -1
- package/script/types/2_chosen_inline_result.js +4 -4
- package/script/types/2_game.d.ts +2 -2
- package/script/types/2_game.d.ts.map +1 -1
- package/script/types/2_game.js +3 -3
- package/script/types/2_inactive_chat.d.ts +2 -2
- package/script/types/2_inactive_chat.d.ts.map +1 -1
- package/script/types/2_inactive_chat.js +1 -1
- package/script/types/2_inline_keyboard_button.d.ts +3 -3
- package/script/types/2_inline_keyboard_button.d.ts.map +1 -1
- package/script/types/2_inline_keyboard_button.js +14 -20
- package/script/types/2_inline_query.d.ts +2 -2
- package/script/types/2_inline_query.d.ts.map +1 -1
- package/script/types/2_inline_query.js +7 -7
- package/script/types/2_invite_link.d.ts +2 -2
- package/script/types/2_invite_link.d.ts.map +1 -1
- package/script/types/2_invite_link.js +1 -2
- package/script/types/2_message_reaction_count.d.ts +2 -2
- package/script/types/2_message_reaction_count.d.ts.map +1 -1
- package/script/types/2_message_reactions.d.ts +2 -2
- package/script/types/2_message_reactions.d.ts.map +1 -1
- package/script/types/2_message_reactions.js +1 -1
- package/script/types/2_story_content.d.ts +2 -2
- package/script/types/2_story_content.d.ts.map +1 -1
- package/script/types/2_story_content.js +5 -5
- package/script/types/2_story_interactions.d.ts +2 -2
- package/script/types/2_story_interactions.d.ts.map +1 -1
- package/script/types/2_story_interactive_area.d.ts +3 -3
- package/script/types/2_story_interactive_area.d.ts.map +1 -1
- package/script/types/2_story_interactive_area.js +18 -28
- package/script/types/3_chat_member_updated.d.ts +2 -2
- package/script/types/3_chat_member_updated.d.ts.map +1 -1
- package/script/types/3_chat_member_updated.js +6 -6
- package/script/types/3_reply_markup.d.ts +3 -3
- package/script/types/3_reply_markup.d.ts.map +1 -1
- package/script/types/3_reply_markup.js +11 -21
- package/script/types/3_story.d.ts +2 -2
- package/script/types/3_story.d.ts.map +1 -1
- package/script/types/4_inline_query_result.d.ts +3 -3
- package/script/types/4_inline_query_result.d.ts.map +1 -1
- package/script/types/4_inline_query_result.js +52 -160
- package/script/types/4_message.d.ts +3 -3
- package/script/types/4_message.d.ts.map +1 -1
- package/script/types/4_message.js +67 -58
- package/script/types/5_callback_query.d.ts +3 -3
- package/script/types/5_callback_query.d.ts.map +1 -1
- package/script/types/5_callback_query.js +4 -4
- package/script/types/5_chat_list_item.d.ts +3 -3
- package/script/types/5_chat_list_item.d.ts.map +1 -1
- package/script/types/5_chat_list_item.js +1 -1
- package/script/types/5_inline_query_answer.d.ts +2 -2
- package/script/types/5_inline_query_answer.d.ts.map +1 -1
- package/script/types/_file_id.d.ts +2 -2
- package/script/types/_file_id.d.ts.map +1 -1
- package/script/types/_file_id.js +3 -3
- package/script/types/_getters.d.ts +7 -7
- package/script/types/_getters.d.ts.map +1 -1
- package/esm/tl/1_tl_object.d.ts +0 -64
- package/esm/tl/1_tl_object.d.ts.map +0 -1
- package/esm/tl/1_tl_object.js +0 -221
- package/esm/tl/1_tl_object_test.d.ts.map +0 -1
- package/esm/tl/2_types.d.ts +0 -28060
- package/esm/tl/2_types.d.ts.map +0 -1
- package/esm/tl/2_types.js +0 -68685
- package/esm/tl/2_types_test.d.ts.map +0 -1
- package/esm/tl/3_deserialize.d.ts +0 -23
- package/esm/tl/3_deserialize.d.ts.map +0 -1
- package/esm/tl/3_functions.d.ts +0 -14094
- package/esm/tl/3_functions.d.ts.map +0 -1
- package/esm/tl/3_functions.js +0 -28475
- package/esm/tl/3_functions_test.d.ts.map +0 -1
- package/esm/tl/4_tl_reader.d.ts.map +0 -1
- package/esm/tl/5_tl_writer.d.ts.map +0 -1
- package/esm/tl/6_rpc_result.d.ts.map +0 -1
- package/esm/tl/6_rpc_result.js +0 -49
- package/esm/tl/7_message.d.ts.map +0 -1
- package/esm/tl/7_message.js +0 -90
- package/esm/tl/7_message_test.d.ts.map +0 -1
- package/esm/tl/8_message_container.d.ts.map +0 -1
- package/esm/tl/8_message_container.js +0 -72
- package/script/tl/1_tl_object.d.ts +0 -64
- package/script/tl/1_tl_object.d.ts.map +0 -1
- package/script/tl/1_tl_object.js +0 -228
- package/script/tl/1_tl_object_test.d.ts.map +0 -1
- package/script/tl/2_types.d.ts +0 -28060
- package/script/tl/2_types.d.ts.map +0 -1
- package/script/tl/2_types.js +0 -70558
- package/script/tl/2_types_test.d.ts.map +0 -1
- package/script/tl/3_deserialize.d.ts +0 -23
- package/script/tl/3_deserialize.d.ts.map +0 -1
- package/script/tl/3_functions.d.ts +0 -14094
- package/script/tl/3_functions.d.ts.map +0 -1
- package/script/tl/3_functions.js +0 -29121
- package/script/tl/3_functions_test.d.ts.map +0 -1
- package/script/tl/4_tl_reader.d.ts.map +0 -1
- package/script/tl/5_tl_writer.d.ts.map +0 -1
- package/script/tl/6_rpc_result.d.ts +0 -30
- package/script/tl/6_rpc_result.d.ts.map +0 -1
- package/script/tl/6_rpc_result.js +0 -53
- package/script/tl/7_message.d.ts +0 -32
- package/script/tl/7_message.d.ts.map +0 -1
- package/script/tl/7_message.js +0 -95
- package/script/tl/7_message_test.d.ts.map +0 -1
- package/script/tl/8_message_container.d.ts +0 -32
- package/script/tl/8_message_container.d.ts.map +0 -1
- package/script/tl/8_message_container.js +0 -76
|
@@ -0,0 +1,196 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
3
|
+
if (k2 === undefined) k2 = k;
|
|
4
|
+
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
5
|
+
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
6
|
+
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
7
|
+
}
|
|
8
|
+
Object.defineProperty(o, k2, desc);
|
|
9
|
+
}) : (function(o, m, k, k2) {
|
|
10
|
+
if (k2 === undefined) k2 = k;
|
|
11
|
+
o[k2] = m[k];
|
|
12
|
+
}));
|
|
13
|
+
var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
|
|
14
|
+
Object.defineProperty(o, "default", { enumerable: true, value: v });
|
|
15
|
+
}) : function(o, v) {
|
|
16
|
+
o["default"] = v;
|
|
17
|
+
});
|
|
18
|
+
var __importStar = (this && this.__importStar) || function (mod) {
|
|
19
|
+
if (mod && mod.__esModule) return mod;
|
|
20
|
+
var result = {};
|
|
21
|
+
if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
|
|
22
|
+
__setModuleDefault(result, mod);
|
|
23
|
+
return result;
|
|
24
|
+
};
|
|
25
|
+
var __classPrivateFieldSet = (this && this.__classPrivateFieldSet) || function (receiver, state, value, kind, f) {
|
|
26
|
+
if (kind === "m") throw new TypeError("Private method is not writable");
|
|
27
|
+
if (kind === "a" && !f) throw new TypeError("Private accessor was defined without a setter");
|
|
28
|
+
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");
|
|
29
|
+
return (kind === "a" ? f.call(receiver, value) : f ? f.value = value : state.set(receiver, value)), value;
|
|
30
|
+
};
|
|
31
|
+
var __classPrivateFieldGet = (this && this.__classPrivateFieldGet) || function (receiver, state, kind, f) {
|
|
32
|
+
if (kind === "a" && !f) throw new TypeError("Private accessor was defined without a getter");
|
|
33
|
+
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");
|
|
34
|
+
return kind === "m" ? f : kind === "a" ? f.call(receiver) : f ? f.value : state.get(receiver);
|
|
35
|
+
};
|
|
36
|
+
var _ConnectionTCP_instances, _ConnectionTCP_hostname, _ConnectionTCP_port, _ConnectionTCP_connection, _ConnectionTCP_rMutex, _ConnectionTCP_wMutex, _ConnectionTCP_buffer, _ConnectionTCP_nextResolve, _ConnectionTCP_canRead, _ConnectionTCP_canWrite, _ConnectionTCP_assertConnected, _ConnectionTCP_rejectRead;
|
|
37
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
38
|
+
exports.ConnectionTCP = void 0;
|
|
39
|
+
/**
|
|
40
|
+
* MTKruto - Cross-runtime JavaScript library for building Telegram clients
|
|
41
|
+
* Copyright (C) 2023-2024 Roj <https://roj.im/>
|
|
42
|
+
*
|
|
43
|
+
* This file is part of MTKruto.
|
|
44
|
+
*
|
|
45
|
+
* This program is free software: you can redistribute it and/or modify
|
|
46
|
+
* it under the terms of the GNU Lesser General Public License as published by
|
|
47
|
+
* the Free Software Foundation, either version 3 of the License, or
|
|
48
|
+
* (at your option) any later version.
|
|
49
|
+
*
|
|
50
|
+
* This program is distributed in the hope that it will be useful,
|
|
51
|
+
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
52
|
+
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
53
|
+
* GNU Lesser General Public License for more details.
|
|
54
|
+
*
|
|
55
|
+
* You should have received a copy of the GNU Lesser General Public License
|
|
56
|
+
* along with this program. If not, see <https://www.gnu.org/licenses/>.
|
|
57
|
+
*/
|
|
58
|
+
const dntShim = __importStar(require("../_dnt.shims.js"));
|
|
59
|
+
const _0_deps_js_1 = require("../0_deps.js");
|
|
60
|
+
const _1_utilities_js_1 = require("../1_utilities.js");
|
|
61
|
+
const L = (0, _1_utilities_js_1.getLogger)("ConnectionTCP");
|
|
62
|
+
class ConnectionTCP {
|
|
63
|
+
constructor(hostname, port) {
|
|
64
|
+
_ConnectionTCP_instances.add(this);
|
|
65
|
+
_ConnectionTCP_hostname.set(this, void 0);
|
|
66
|
+
_ConnectionTCP_port.set(this, void 0);
|
|
67
|
+
_ConnectionTCP_connection.set(this, void 0);
|
|
68
|
+
_ConnectionTCP_rMutex.set(this, new _1_utilities_js_1.Mutex());
|
|
69
|
+
_ConnectionTCP_wMutex.set(this, new _1_utilities_js_1.Mutex());
|
|
70
|
+
_ConnectionTCP_buffer.set(this, new Uint8Array());
|
|
71
|
+
_ConnectionTCP_nextResolve.set(this, null);
|
|
72
|
+
_ConnectionTCP_canRead.set(this, false);
|
|
73
|
+
_ConnectionTCP_canWrite.set(this, false);
|
|
74
|
+
Object.defineProperty(this, "connect", {
|
|
75
|
+
enumerable: true,
|
|
76
|
+
configurable: true,
|
|
77
|
+
writable: true,
|
|
78
|
+
value: dntShim.Deno.connect
|
|
79
|
+
});
|
|
80
|
+
Object.defineProperty(this, "stateChangeHandler", {
|
|
81
|
+
enumerable: true,
|
|
82
|
+
configurable: true,
|
|
83
|
+
writable: true,
|
|
84
|
+
value: void 0
|
|
85
|
+
});
|
|
86
|
+
Object.defineProperty(this, "callback", {
|
|
87
|
+
enumerable: true,
|
|
88
|
+
configurable: true,
|
|
89
|
+
writable: true,
|
|
90
|
+
value: void 0
|
|
91
|
+
});
|
|
92
|
+
__classPrivateFieldSet(this, _ConnectionTCP_hostname, hostname, "f");
|
|
93
|
+
__classPrivateFieldSet(this, _ConnectionTCP_port, port, "f");
|
|
94
|
+
}
|
|
95
|
+
get connected() {
|
|
96
|
+
return !!__classPrivateFieldGet(this, _ConnectionTCP_connection, "f") && __classPrivateFieldGet(this, _ConnectionTCP_canRead, "f") && __classPrivateFieldGet(this, _ConnectionTCP_canWrite, "f");
|
|
97
|
+
}
|
|
98
|
+
async open() {
|
|
99
|
+
if (this.connected) {
|
|
100
|
+
throw new Error("Connection already open");
|
|
101
|
+
}
|
|
102
|
+
const connection = await this.connect({
|
|
103
|
+
hostname: __classPrivateFieldGet(this, _ConnectionTCP_hostname, "f"),
|
|
104
|
+
port: __classPrivateFieldGet(this, _ConnectionTCP_port, "f"),
|
|
105
|
+
});
|
|
106
|
+
__classPrivateFieldSet(this, _ConnectionTCP_canRead, __classPrivateFieldSet(this, _ConnectionTCP_canWrite, true, "f"), "f");
|
|
107
|
+
this.stateChangeHandler?.(true);
|
|
108
|
+
Promise.resolve().then(async () => {
|
|
109
|
+
do {
|
|
110
|
+
try {
|
|
111
|
+
for await (const chunk of (0, _0_deps_js_1.iterateReader)(connection)) {
|
|
112
|
+
this.callback?.read(chunk.length);
|
|
113
|
+
__classPrivateFieldSet(this, _ConnectionTCP_buffer, (0, _0_deps_js_1.concat)([__classPrivateFieldGet(this, _ConnectionTCP_buffer, "f"), chunk]), "f");
|
|
114
|
+
if (__classPrivateFieldGet(this, _ConnectionTCP_nextResolve, "f") != null && __classPrivateFieldGet(this, _ConnectionTCP_buffer, "f").length >= __classPrivateFieldGet(this, _ConnectionTCP_nextResolve, "f")[0]) {
|
|
115
|
+
__classPrivateFieldGet(this, _ConnectionTCP_nextResolve, "f")[1].resolve();
|
|
116
|
+
__classPrivateFieldSet(this, _ConnectionTCP_nextResolve, null, "f");
|
|
117
|
+
}
|
|
118
|
+
}
|
|
119
|
+
__classPrivateFieldSet(this, _ConnectionTCP_canRead, false, "f");
|
|
120
|
+
break;
|
|
121
|
+
}
|
|
122
|
+
catch (err) {
|
|
123
|
+
if (!this.connected) {
|
|
124
|
+
this.stateChangeHandler?.(false);
|
|
125
|
+
__classPrivateFieldGet(this, _ConnectionTCP_instances, "m", _ConnectionTCP_rejectRead).call(this);
|
|
126
|
+
}
|
|
127
|
+
else {
|
|
128
|
+
L.error(err);
|
|
129
|
+
}
|
|
130
|
+
}
|
|
131
|
+
} while (this.connected);
|
|
132
|
+
});
|
|
133
|
+
__classPrivateFieldSet(this, _ConnectionTCP_connection, connection, "f");
|
|
134
|
+
}
|
|
135
|
+
async read(p) {
|
|
136
|
+
__classPrivateFieldGet(this, _ConnectionTCP_instances, "m", _ConnectionTCP_assertConnected).call(this);
|
|
137
|
+
const unlock = await __classPrivateFieldGet(this, _ConnectionTCP_rMutex, "f").lock();
|
|
138
|
+
try {
|
|
139
|
+
__classPrivateFieldGet(this, _ConnectionTCP_instances, "m", _ConnectionTCP_assertConnected).call(this);
|
|
140
|
+
if (__classPrivateFieldGet(this, _ConnectionTCP_buffer, "f").length < p.length) {
|
|
141
|
+
await new Promise((resolve, reject) => __classPrivateFieldSet(this, _ConnectionTCP_nextResolve, [p.length, { resolve, reject }], "f"));
|
|
142
|
+
}
|
|
143
|
+
const slice = __classPrivateFieldGet(this, _ConnectionTCP_buffer, "f").slice(0, p.length);
|
|
144
|
+
p.set(slice);
|
|
145
|
+
__classPrivateFieldSet(this, _ConnectionTCP_buffer, __classPrivateFieldGet(this, _ConnectionTCP_buffer, "f").slice(slice.length), "f");
|
|
146
|
+
}
|
|
147
|
+
finally {
|
|
148
|
+
unlock();
|
|
149
|
+
}
|
|
150
|
+
}
|
|
151
|
+
async write(p) {
|
|
152
|
+
__classPrivateFieldGet(this, _ConnectionTCP_instances, "m", _ConnectionTCP_assertConnected).call(this);
|
|
153
|
+
const unlock = await __classPrivateFieldGet(this, _ConnectionTCP_wMutex, "f").lock();
|
|
154
|
+
try {
|
|
155
|
+
__classPrivateFieldGet(this, _ConnectionTCP_instances, "m", _ConnectionTCP_assertConnected).call(this);
|
|
156
|
+
let written = 0;
|
|
157
|
+
while (written < p.length) {
|
|
158
|
+
try {
|
|
159
|
+
const wrote = await __classPrivateFieldGet(this, _ConnectionTCP_connection, "f").write(p.subarray(written));
|
|
160
|
+
this.callback?.write(wrote);
|
|
161
|
+
written += wrote;
|
|
162
|
+
}
|
|
163
|
+
catch (err) {
|
|
164
|
+
if (err instanceof dntShim.Deno.errors.BrokenPipe) {
|
|
165
|
+
__classPrivateFieldSet(this, _ConnectionTCP_canWrite, false, "f");
|
|
166
|
+
}
|
|
167
|
+
if (!this.connected) {
|
|
168
|
+
this.stateChangeHandler?.(false);
|
|
169
|
+
}
|
|
170
|
+
throw err;
|
|
171
|
+
}
|
|
172
|
+
}
|
|
173
|
+
}
|
|
174
|
+
finally {
|
|
175
|
+
unlock();
|
|
176
|
+
}
|
|
177
|
+
}
|
|
178
|
+
close() {
|
|
179
|
+
__classPrivateFieldGet(this, _ConnectionTCP_instances, "m", _ConnectionTCP_assertConnected).call(this);
|
|
180
|
+
__classPrivateFieldGet(this, _ConnectionTCP_connection, "f").close();
|
|
181
|
+
__classPrivateFieldSet(this, _ConnectionTCP_canRead, __classPrivateFieldSet(this, _ConnectionTCP_canWrite, false, "f"), "f");
|
|
182
|
+
__classPrivateFieldSet(this, _ConnectionTCP_connection, undefined, "f");
|
|
183
|
+
__classPrivateFieldGet(this, _ConnectionTCP_instances, "m", _ConnectionTCP_rejectRead).call(this);
|
|
184
|
+
}
|
|
185
|
+
}
|
|
186
|
+
exports.ConnectionTCP = ConnectionTCP;
|
|
187
|
+
_ConnectionTCP_hostname = new WeakMap(), _ConnectionTCP_port = new WeakMap(), _ConnectionTCP_connection = new WeakMap(), _ConnectionTCP_rMutex = new WeakMap(), _ConnectionTCP_wMutex = new WeakMap(), _ConnectionTCP_buffer = new WeakMap(), _ConnectionTCP_nextResolve = new WeakMap(), _ConnectionTCP_canRead = new WeakMap(), _ConnectionTCP_canWrite = new WeakMap(), _ConnectionTCP_instances = new WeakSet(), _ConnectionTCP_assertConnected = function _ConnectionTCP_assertConnected() {
|
|
188
|
+
if (!this.connected) {
|
|
189
|
+
throw new Error("Connection not open");
|
|
190
|
+
}
|
|
191
|
+
}, _ConnectionTCP_rejectRead = function _ConnectionTCP_rejectRead() {
|
|
192
|
+
if (__classPrivateFieldGet(this, _ConnectionTCP_nextResolve, "f") != null) {
|
|
193
|
+
__classPrivateFieldGet(this, _ConnectionTCP_nextResolve, "f")[1].reject(new Error("Connection was closed"));
|
|
194
|
+
__classPrivateFieldSet(this, _ConnectionTCP_nextResolve, null, "f");
|
|
195
|
+
}
|
|
196
|
+
};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"_constants.d.ts","sourceRoot":"","sources":["../../../../../src/deps/deno.land/std@0.224.0/io/_constants.ts"],"names":[],"mappings":"AAGA,eAAO,MAAM,kBAAkB,QAAS,CAAC;AACzC,eAAO,MAAM,mBAAmB,QAAY,CAAC"}
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
// Copyright 2018-2024 the Deno authors. All rights reserved. MIT license.
|
|
3
|
+
// This module is browser compatible.
|
|
4
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
5
|
+
exports.DEFAULT_BUFFER_SIZE = exports.DEFAULT_CHUNK_SIZE = void 0;
|
|
6
|
+
exports.DEFAULT_CHUNK_SIZE = 16640;
|
|
7
|
+
exports.DEFAULT_BUFFER_SIZE = 32 * 1024;
|
|
@@ -0,0 +1,70 @@
|
|
|
1
|
+
import type { Reader, ReaderSync } from "./types.js";
|
|
2
|
+
export type { Reader, ReaderSync };
|
|
3
|
+
/**
|
|
4
|
+
* Turns a {@linkcode Reader} into an async iterator.
|
|
5
|
+
*
|
|
6
|
+
* @example
|
|
7
|
+
* ```ts
|
|
8
|
+
* import { iterateReader } from "https://deno.land/std@$STD_VERSION/io/iterate_reader.ts";
|
|
9
|
+
*
|
|
10
|
+
* using file = await Deno.open("/etc/passwd");
|
|
11
|
+
* for await (const chunk of iterateReader(file)) {
|
|
12
|
+
* console.log(chunk);
|
|
13
|
+
* }
|
|
14
|
+
* ```
|
|
15
|
+
*
|
|
16
|
+
* Second argument can be used to tune size of a buffer.
|
|
17
|
+
* Default size of the buffer is 32kB.
|
|
18
|
+
*
|
|
19
|
+
* @example
|
|
20
|
+
* ```ts
|
|
21
|
+
* import { iterateReader } from "https://deno.land/std@$STD_VERSION/io/iterate_reader.ts";
|
|
22
|
+
*
|
|
23
|
+
* using file = await Deno.open("/etc/passwd");
|
|
24
|
+
* const iter = iterateReader(file, {
|
|
25
|
+
* bufSize: 1024 * 1024
|
|
26
|
+
* });
|
|
27
|
+
* for await (const chunk of iter) {
|
|
28
|
+
* console.log(chunk);
|
|
29
|
+
* }
|
|
30
|
+
* ```
|
|
31
|
+
*/
|
|
32
|
+
export declare function iterateReader(reader: Reader, options?: {
|
|
33
|
+
bufSize?: number;
|
|
34
|
+
}): AsyncIterableIterator<Uint8Array>;
|
|
35
|
+
/**
|
|
36
|
+
* Turns a {@linkcode ReaderSync} into an iterator.
|
|
37
|
+
*
|
|
38
|
+
* ```ts
|
|
39
|
+
* import { iterateReaderSync } from "https://deno.land/std@$STD_VERSION/io/iterate_reader.ts";
|
|
40
|
+
*
|
|
41
|
+
* using file = Deno.openSync("/etc/passwd");
|
|
42
|
+
* for (const chunk of iterateReaderSync(file)) {
|
|
43
|
+
* console.log(chunk);
|
|
44
|
+
* }
|
|
45
|
+
* ```
|
|
46
|
+
*
|
|
47
|
+
* Second argument can be used to tune size of a buffer.
|
|
48
|
+
* Default size of the buffer is 32kB.
|
|
49
|
+
*
|
|
50
|
+
* ```ts
|
|
51
|
+
* import { iterateReaderSync } from "https://deno.land/std@$STD_VERSION/io/iterate_reader.ts";
|
|
52
|
+
|
|
53
|
+
* using file = await Deno.open("/etc/passwd");
|
|
54
|
+
* const iter = iterateReaderSync(file, {
|
|
55
|
+
* bufSize: 1024 * 1024
|
|
56
|
+
* });
|
|
57
|
+
* for (const chunk of iter) {
|
|
58
|
+
* console.log(chunk);
|
|
59
|
+
* }
|
|
60
|
+
* ```
|
|
61
|
+
*
|
|
62
|
+
* Iterator uses an internal buffer of fixed size for efficiency; it returns
|
|
63
|
+
* a view on that buffer on each iteration. It is therefore caller's
|
|
64
|
+
* responsibility to copy contents of the buffer if needed; otherwise the
|
|
65
|
+
* next iteration will overwrite contents of previously returned chunk.
|
|
66
|
+
*/
|
|
67
|
+
export declare function iterateReaderSync(reader: ReaderSync, options?: {
|
|
68
|
+
bufSize?: number;
|
|
69
|
+
}): IterableIterator<Uint8Array>;
|
|
70
|
+
//# sourceMappingURL=iterate_reader.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"iterate_reader.d.ts","sourceRoot":"","sources":["../../../../../src/deps/deno.land/std@0.224.0/io/iterate_reader.ts"],"names":[],"mappings":"AAIA,OAAO,KAAK,EAAE,MAAM,EAAE,UAAU,EAAE,MAAM,YAAY,CAAC;AAErD,YAAY,EAAE,MAAM,EAAE,UAAU,EAAE,CAAC;AAEnC;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA4BG;AACH,wBAAuB,aAAa,CAClC,MAAM,EAAE,MAAM,EACd,OAAO,CAAC,EAAE;IACR,OAAO,CAAC,EAAE,MAAM,CAAC;CAClB,GACA,qBAAqB,CAAC,UAAU,CAAC,CAWnC;AAED;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA+BG;AACH,wBAAiB,iBAAiB,CAChC,MAAM,EAAE,UAAU,EAClB,OAAO,CAAC,EAAE;IACR,OAAO,CAAC,EAAE,MAAM,CAAC;CAClB,GACA,gBAAgB,CAAC,UAAU,CAAC,CAW9B"}
|
|
@@ -0,0 +1,91 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
// Copyright 2018-2024 the Deno authors. All rights reserved. MIT license.
|
|
3
|
+
// This module is browser compatible.
|
|
4
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
5
|
+
exports.iterateReaderSync = exports.iterateReader = void 0;
|
|
6
|
+
const _constants_js_1 = require("./_constants.js");
|
|
7
|
+
/**
|
|
8
|
+
* Turns a {@linkcode Reader} into an async iterator.
|
|
9
|
+
*
|
|
10
|
+
* @example
|
|
11
|
+
* ```ts
|
|
12
|
+
* import { iterateReader } from "https://deno.land/std@$STD_VERSION/io/iterate_reader.ts";
|
|
13
|
+
*
|
|
14
|
+
* using file = await Deno.open("/etc/passwd");
|
|
15
|
+
* for await (const chunk of iterateReader(file)) {
|
|
16
|
+
* console.log(chunk);
|
|
17
|
+
* }
|
|
18
|
+
* ```
|
|
19
|
+
*
|
|
20
|
+
* Second argument can be used to tune size of a buffer.
|
|
21
|
+
* Default size of the buffer is 32kB.
|
|
22
|
+
*
|
|
23
|
+
* @example
|
|
24
|
+
* ```ts
|
|
25
|
+
* import { iterateReader } from "https://deno.land/std@$STD_VERSION/io/iterate_reader.ts";
|
|
26
|
+
*
|
|
27
|
+
* using file = await Deno.open("/etc/passwd");
|
|
28
|
+
* const iter = iterateReader(file, {
|
|
29
|
+
* bufSize: 1024 * 1024
|
|
30
|
+
* });
|
|
31
|
+
* for await (const chunk of iter) {
|
|
32
|
+
* console.log(chunk);
|
|
33
|
+
* }
|
|
34
|
+
* ```
|
|
35
|
+
*/
|
|
36
|
+
async function* iterateReader(reader, options) {
|
|
37
|
+
const bufSize = options?.bufSize ?? _constants_js_1.DEFAULT_BUFFER_SIZE;
|
|
38
|
+
const b = new Uint8Array(bufSize);
|
|
39
|
+
while (true) {
|
|
40
|
+
const result = await reader.read(b);
|
|
41
|
+
if (result === null) {
|
|
42
|
+
break;
|
|
43
|
+
}
|
|
44
|
+
yield b.slice(0, result);
|
|
45
|
+
}
|
|
46
|
+
}
|
|
47
|
+
exports.iterateReader = iterateReader;
|
|
48
|
+
/**
|
|
49
|
+
* Turns a {@linkcode ReaderSync} into an iterator.
|
|
50
|
+
*
|
|
51
|
+
* ```ts
|
|
52
|
+
* import { iterateReaderSync } from "https://deno.land/std@$STD_VERSION/io/iterate_reader.ts";
|
|
53
|
+
*
|
|
54
|
+
* using file = Deno.openSync("/etc/passwd");
|
|
55
|
+
* for (const chunk of iterateReaderSync(file)) {
|
|
56
|
+
* console.log(chunk);
|
|
57
|
+
* }
|
|
58
|
+
* ```
|
|
59
|
+
*
|
|
60
|
+
* Second argument can be used to tune size of a buffer.
|
|
61
|
+
* Default size of the buffer is 32kB.
|
|
62
|
+
*
|
|
63
|
+
* ```ts
|
|
64
|
+
* import { iterateReaderSync } from "https://deno.land/std@$STD_VERSION/io/iterate_reader.ts";
|
|
65
|
+
|
|
66
|
+
* using file = await Deno.open("/etc/passwd");
|
|
67
|
+
* const iter = iterateReaderSync(file, {
|
|
68
|
+
* bufSize: 1024 * 1024
|
|
69
|
+
* });
|
|
70
|
+
* for (const chunk of iter) {
|
|
71
|
+
* console.log(chunk);
|
|
72
|
+
* }
|
|
73
|
+
* ```
|
|
74
|
+
*
|
|
75
|
+
* Iterator uses an internal buffer of fixed size for efficiency; it returns
|
|
76
|
+
* a view on that buffer on each iteration. It is therefore caller's
|
|
77
|
+
* responsibility to copy contents of the buffer if needed; otherwise the
|
|
78
|
+
* next iteration will overwrite contents of previously returned chunk.
|
|
79
|
+
*/
|
|
80
|
+
function* iterateReaderSync(reader, options) {
|
|
81
|
+
const bufSize = options?.bufSize ?? _constants_js_1.DEFAULT_BUFFER_SIZE;
|
|
82
|
+
const b = new Uint8Array(bufSize);
|
|
83
|
+
while (true) {
|
|
84
|
+
const result = reader.readSync(b);
|
|
85
|
+
if (result === null) {
|
|
86
|
+
break;
|
|
87
|
+
}
|
|
88
|
+
yield b.slice(0, result);
|
|
89
|
+
}
|
|
90
|
+
}
|
|
91
|
+
exports.iterateReaderSync = iterateReaderSync;
|
|
@@ -0,0 +1,95 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* An abstract interface which when implemented provides an interface to read bytes into an array buffer asynchronously.
|
|
3
|
+
*/
|
|
4
|
+
export interface Reader {
|
|
5
|
+
/** Reads up to `p.byteLength` bytes into `p`. It resolves to the number of
|
|
6
|
+
* bytes read (`0` < `n` <= `p.byteLength`) and rejects if any error
|
|
7
|
+
* encountered. Even if `read()` resolves to `n` < `p.byteLength`, it may
|
|
8
|
+
* use all of `p` as scratch space during the call. If some data is
|
|
9
|
+
* available but not `p.byteLength` bytes, `read()` conventionally resolves
|
|
10
|
+
* to what is available instead of waiting for more.
|
|
11
|
+
*
|
|
12
|
+
* When `read()` encounters end-of-file condition, it resolves to EOF
|
|
13
|
+
* (`null`).
|
|
14
|
+
*
|
|
15
|
+
* When `read()` encounters an error, it rejects with an error.
|
|
16
|
+
*
|
|
17
|
+
* Callers should always process the `n` > `0` bytes returned before
|
|
18
|
+
* considering the EOF (`null`). Doing so correctly handles I/O errors that
|
|
19
|
+
* happen after reading some bytes and also both of the allowed EOF
|
|
20
|
+
* behaviors.
|
|
21
|
+
*
|
|
22
|
+
* Implementations should not retain a reference to `p`.
|
|
23
|
+
*
|
|
24
|
+
* Use
|
|
25
|
+
* {@linkcode https://deno.land/std@$STD_VERSION/io/to_iterator.ts?s=toIterator}
|
|
26
|
+
* to turn a {@linkcode Reader} into an {@linkcode AsyncIterableIterator}.
|
|
27
|
+
*/
|
|
28
|
+
read(p: Uint8Array): Promise<number | null>;
|
|
29
|
+
}
|
|
30
|
+
/**
|
|
31
|
+
* An abstract interface which when implemented provides an interface to read bytes into an array buffer synchronously.
|
|
32
|
+
*/
|
|
33
|
+
export interface ReaderSync {
|
|
34
|
+
/** Reads up to `p.byteLength` bytes into `p`. It resolves to the number
|
|
35
|
+
* of bytes read (`0` < `n` <= `p.byteLength`) and rejects if any error
|
|
36
|
+
* encountered. Even if `read()` returns `n` < `p.byteLength`, it may use
|
|
37
|
+
* all of `p` as scratch space during the call. If some data is available
|
|
38
|
+
* but not `p.byteLength` bytes, `read()` conventionally returns what is
|
|
39
|
+
* available instead of waiting for more.
|
|
40
|
+
*
|
|
41
|
+
* When `readSync()` encounters end-of-file condition, it returns EOF
|
|
42
|
+
* (`null`).
|
|
43
|
+
*
|
|
44
|
+
* When `readSync()` encounters an error, it throws with an error.
|
|
45
|
+
*
|
|
46
|
+
* Callers should always process the `n` > `0` bytes returned before
|
|
47
|
+
* considering the EOF (`null`). Doing so correctly handles I/O errors that happen
|
|
48
|
+
* after reading some bytes and also both of the allowed EOF behaviors.
|
|
49
|
+
*
|
|
50
|
+
* Implementations should not retain a reference to `p`.
|
|
51
|
+
*
|
|
52
|
+
* Use
|
|
53
|
+
* {@linkcode https://deno.land/std@$STD_VERSION/io/to_iterator.ts?s=toIteratorSync}
|
|
54
|
+
* to turn a {@linkcode ReaderSync} into an {@linkcode IterableIterator}.
|
|
55
|
+
*/
|
|
56
|
+
readSync(p: Uint8Array): number | null;
|
|
57
|
+
}
|
|
58
|
+
/**
|
|
59
|
+
* An abstract interface which when implemented provides an interface to write bytes from an array buffer to a file/resource asynchronously.
|
|
60
|
+
*/
|
|
61
|
+
export interface Writer {
|
|
62
|
+
/** Writes `p.byteLength` bytes from `p` to the underlying data stream. It
|
|
63
|
+
* resolves to the number of bytes written from `p` (`0` <= `n` <=
|
|
64
|
+
* `p.byteLength`) or reject with the error encountered that caused the
|
|
65
|
+
* write to stop early. `write()` must reject with a non-null error if
|
|
66
|
+
* would resolve to `n` < `p.byteLength`. `write()` must not modify the
|
|
67
|
+
* slice data, even temporarily.
|
|
68
|
+
*
|
|
69
|
+
* Implementations should not retain a reference to `p`.
|
|
70
|
+
*/
|
|
71
|
+
write(p: Uint8Array): Promise<number>;
|
|
72
|
+
}
|
|
73
|
+
/**
|
|
74
|
+
* An abstract interface which when implemented provides an interface to write bytes from an array buffer to a file/resource synchronously.
|
|
75
|
+
*/
|
|
76
|
+
export interface WriterSync {
|
|
77
|
+
/** Writes `p.byteLength` bytes from `p` to the underlying data
|
|
78
|
+
* stream. It returns the number of bytes written from `p` (`0` <= `n`
|
|
79
|
+
* <= `p.byteLength`) and any error encountered that caused the write to
|
|
80
|
+
* stop early. `writeSync()` must throw a non-null error if it returns `n` <
|
|
81
|
+
* `p.byteLength`. `writeSync()` must not modify the slice data, even
|
|
82
|
+
* temporarily.
|
|
83
|
+
*
|
|
84
|
+
* Implementations should not retain a reference to `p`.
|
|
85
|
+
*/
|
|
86
|
+
writeSync(p: Uint8Array): number;
|
|
87
|
+
}
|
|
88
|
+
/**
|
|
89
|
+
* An abstract interface which when implemented provides an interface to close files/resources that were previously opened.
|
|
90
|
+
*/
|
|
91
|
+
export interface Closer {
|
|
92
|
+
/** Closes the resource, "freeing" the backing file/resource. */
|
|
93
|
+
close(): void;
|
|
94
|
+
}
|
|
95
|
+
//# sourceMappingURL=types.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../../../../src/deps/deno.land/std@0.224.0/io/types.ts"],"names":[],"mappings":"AAGA;;GAEG;AACH,MAAM,WAAW,MAAM;IACrB;;;;;;;;;;;;;;;;;;;;;;OAsBG;IACH,IAAI,CAAC,CAAC,EAAE,UAAU,GAAG,OAAO,CAAC,MAAM,GAAG,IAAI,CAAC,CAAC;CAC7C;AAED;;GAEG;AACH,MAAM,WAAW,UAAU;IACzB;;;;;;;;;;;;;;;;;;;;;OAqBG;IACH,QAAQ,CAAC,CAAC,EAAE,UAAU,GAAG,MAAM,GAAG,IAAI,CAAC;CACxC;AAED;;GAEG;AACH,MAAM,WAAW,MAAM;IACrB;;;;;;;;OAQG;IACH,KAAK,CAAC,CAAC,EAAE,UAAU,GAAG,OAAO,CAAC,MAAM,CAAC,CAAC;CACvC;AACD;;GAEG;AACH,MAAM,WAAW,UAAU;IACzB;;;;;;;;OAQG;IACH,SAAS,CAAC,CAAC,EAAE,UAAU,GAAG,MAAM,CAAC;CAClC;AAED;;GAEG;AACH,MAAM,WAAW,MAAM;IACrB,gEAAgE;IAChE,KAAK,IAAI,IAAI,CAAC;CACf"}
|
|
@@ -0,0 +1,39 @@
|
|
|
1
|
+
import type { Writer, WriterSync } from "./types.js";
|
|
2
|
+
/**
|
|
3
|
+
* Write all the content of the array buffer (`arr`) to the writer (`w`).
|
|
4
|
+
*
|
|
5
|
+
* @example
|
|
6
|
+
* ```ts
|
|
7
|
+
* import { writeAll } from "https://deno.land/std@$STD_VERSION/io/write_all.ts";
|
|
8
|
+
|
|
9
|
+
* // Example writing to stdout
|
|
10
|
+
* let contentBytes = new TextEncoder().encode("Hello World");
|
|
11
|
+
* await writeAll(Deno.stdout, contentBytes);
|
|
12
|
+
*
|
|
13
|
+
* // Example writing to file
|
|
14
|
+
* contentBytes = new TextEncoder().encode("Hello World");
|
|
15
|
+
* using file = await Deno.open('test.file', {write: true});
|
|
16
|
+
* await writeAll(file, contentBytes);
|
|
17
|
+
* ```
|
|
18
|
+
*/
|
|
19
|
+
export declare function writeAll(writer: Writer, data: Uint8Array): Promise<void>;
|
|
20
|
+
/**
|
|
21
|
+
* Synchronously write all the content of the array buffer (`arr`) to the
|
|
22
|
+
* writer (`w`).
|
|
23
|
+
*
|
|
24
|
+
* @example
|
|
25
|
+
* ```ts
|
|
26
|
+
* import { writeAllSync } from "https://deno.land/std@$STD_VERSION/io/write_all.ts";
|
|
27
|
+
*
|
|
28
|
+
* // Example writing to stdout
|
|
29
|
+
* let contentBytes = new TextEncoder().encode("Hello World");
|
|
30
|
+
* writeAllSync(Deno.stdout, contentBytes);
|
|
31
|
+
*
|
|
32
|
+
* // Example writing to file
|
|
33
|
+
* contentBytes = new TextEncoder().encode("Hello World");
|
|
34
|
+
* using file = Deno.openSync('test.file', {write: true});
|
|
35
|
+
* writeAllSync(file, contentBytes);
|
|
36
|
+
* ```
|
|
37
|
+
*/
|
|
38
|
+
export declare function writeAllSync(writer: WriterSync, data: Uint8Array): void;
|
|
39
|
+
//# sourceMappingURL=write_all.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"write_all.d.ts","sourceRoot":"","sources":["../../../../../src/deps/deno.land/std@0.224.0/io/write_all.ts"],"names":[],"mappings":"AAGA,OAAO,KAAK,EAAE,MAAM,EAAE,UAAU,EAAE,MAAM,YAAY,CAAC;AAErD;;;;;;;;;;;;;;;;GAgBG;AACH,wBAAsB,QAAQ,CAAC,MAAM,EAAE,MAAM,EAAE,IAAI,EAAE,UAAU,iBAK9D;AAED;;;;;;;;;;;;;;;;;GAiBG;AACH,wBAAgB,YAAY,CAAC,MAAM,EAAE,UAAU,EAAE,IAAI,EAAE,UAAU,QAKhE"}
|
|
@@ -0,0 +1,54 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
// Copyright 2018-2024 the Deno authors. All rights reserved. MIT license.
|
|
3
|
+
// This module is browser compatible.
|
|
4
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
5
|
+
exports.writeAllSync = exports.writeAll = void 0;
|
|
6
|
+
/**
|
|
7
|
+
* Write all the content of the array buffer (`arr`) to the writer (`w`).
|
|
8
|
+
*
|
|
9
|
+
* @example
|
|
10
|
+
* ```ts
|
|
11
|
+
* import { writeAll } from "https://deno.land/std@$STD_VERSION/io/write_all.ts";
|
|
12
|
+
|
|
13
|
+
* // Example writing to stdout
|
|
14
|
+
* let contentBytes = new TextEncoder().encode("Hello World");
|
|
15
|
+
* await writeAll(Deno.stdout, contentBytes);
|
|
16
|
+
*
|
|
17
|
+
* // Example writing to file
|
|
18
|
+
* contentBytes = new TextEncoder().encode("Hello World");
|
|
19
|
+
* using file = await Deno.open('test.file', {write: true});
|
|
20
|
+
* await writeAll(file, contentBytes);
|
|
21
|
+
* ```
|
|
22
|
+
*/
|
|
23
|
+
async function writeAll(writer, data) {
|
|
24
|
+
let nwritten = 0;
|
|
25
|
+
while (nwritten < data.length) {
|
|
26
|
+
nwritten += await writer.write(data.subarray(nwritten));
|
|
27
|
+
}
|
|
28
|
+
}
|
|
29
|
+
exports.writeAll = writeAll;
|
|
30
|
+
/**
|
|
31
|
+
* Synchronously write all the content of the array buffer (`arr`) to the
|
|
32
|
+
* writer (`w`).
|
|
33
|
+
*
|
|
34
|
+
* @example
|
|
35
|
+
* ```ts
|
|
36
|
+
* import { writeAllSync } from "https://deno.land/std@$STD_VERSION/io/write_all.ts";
|
|
37
|
+
*
|
|
38
|
+
* // Example writing to stdout
|
|
39
|
+
* let contentBytes = new TextEncoder().encode("Hello World");
|
|
40
|
+
* writeAllSync(Deno.stdout, contentBytes);
|
|
41
|
+
*
|
|
42
|
+
* // Example writing to file
|
|
43
|
+
* contentBytes = new TextEncoder().encode("Hello World");
|
|
44
|
+
* using file = Deno.openSync('test.file', {write: true});
|
|
45
|
+
* writeAllSync(file, contentBytes);
|
|
46
|
+
* ```
|
|
47
|
+
*/
|
|
48
|
+
function writeAllSync(writer, data) {
|
|
49
|
+
let nwritten = 0;
|
|
50
|
+
while (nwritten < data.length) {
|
|
51
|
+
nwritten += writer.writeSync(data.subarray(nwritten));
|
|
52
|
+
}
|
|
53
|
+
}
|
|
54
|
+
exports.writeAllSync = writeAllSync;
|
|
@@ -0,0 +1,45 @@
|
|
|
1
|
+
import * as dntShim from "../../../../../_dnt.shims.js";
|
|
2
|
+
export declare const SOCKS_VERSION = 5;
|
|
3
|
+
export declare const USERNAME_PASSWORD_AUTH_VERSION = 1;
|
|
4
|
+
export declare enum AddrType {
|
|
5
|
+
IPv4 = 1,
|
|
6
|
+
DomainName = 3,
|
|
7
|
+
IPv6 = 4
|
|
8
|
+
}
|
|
9
|
+
export declare enum AuthMethod {
|
|
10
|
+
NoAuth = 0,
|
|
11
|
+
UsernamePassword = 2,
|
|
12
|
+
NoneAcceptable = 255
|
|
13
|
+
}
|
|
14
|
+
export declare enum ReplyStatus {
|
|
15
|
+
Success = 0,
|
|
16
|
+
GeneralError = 1,
|
|
17
|
+
RulesetError = 2,
|
|
18
|
+
NetworkUnreachable = 3,
|
|
19
|
+
HostUnreachable = 4,
|
|
20
|
+
ConnectionRefused = 5,
|
|
21
|
+
TTLExpired = 6,
|
|
22
|
+
UnsupportedCommand = 7,
|
|
23
|
+
UnsupportedAddress = 8
|
|
24
|
+
}
|
|
25
|
+
export declare enum Command {
|
|
26
|
+
Connect = 1,
|
|
27
|
+
Bind = 2,
|
|
28
|
+
UdpAssociate = 3
|
|
29
|
+
}
|
|
30
|
+
interface AddrConfig {
|
|
31
|
+
hostname: string;
|
|
32
|
+
port?: number;
|
|
33
|
+
}
|
|
34
|
+
interface AuthConfig {
|
|
35
|
+
username: string;
|
|
36
|
+
password: string;
|
|
37
|
+
}
|
|
38
|
+
export type ClientConfig = AddrConfig | (AddrConfig & AuthConfig);
|
|
39
|
+
export declare class Client {
|
|
40
|
+
#private;
|
|
41
|
+
constructor(config: ClientConfig);
|
|
42
|
+
connect(opts: dntShim.Deno.ConnectOptions): Promise<dntShim.Deno.TcpConn>;
|
|
43
|
+
}
|
|
44
|
+
export {};
|
|
45
|
+
//# sourceMappingURL=client.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"client.d.ts","sourceRoot":"","sources":["../../../../../../src/deps/raw.githubusercontent.com/MTKruto/socks5/main/client.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,OAAO,MAAM,8BAA8B,CAAC;AAIxD,eAAO,MAAM,aAAa,IAAI,CAAC;AAC/B,eAAO,MAAM,8BAA8B,IAAI,CAAC;AAChD,oBAAY,QAAQ;IAClB,IAAI,IAAI;IACR,UAAU,IAAI;IACd,IAAI,IAAI;CACT;AACD,oBAAY,UAAU;IACpB,MAAM,IAAI;IACV,gBAAgB,IAAI;IACpB,cAAc,MAAO;CACtB;AACD,oBAAY,WAAW;IACrB,OAAO,IAAI;IACX,YAAY,IAAA;IACZ,YAAY,IAAA;IACZ,kBAAkB,IAAA;IAClB,eAAe,IAAA;IACf,iBAAiB,IAAA;IACjB,UAAU,IAAA;IACV,kBAAkB,IAAA;IAClB,kBAAkB,IAAA;CACnB;AACD,oBAAY,OAAO;IACjB,OAAO,IAAI;IACX,IAAI,IAAA;IACJ,YAAY,IAAA;CACb;AAuFD,UAAU,UAAU;IAClB,QAAQ,EAAE,MAAM,CAAC;IACjB,IAAI,CAAC,EAAE,MAAM,CAAC;CACf;AAED,UAAU,UAAU;IAClB,QAAQ,EAAE,MAAM,CAAC;IACjB,QAAQ,EAAE,MAAM,CAAC;CAClB;AAED,MAAM,MAAM,YAAY,GAAG,UAAU,GAAG,CAAC,UAAU,GAAG,UAAU,CAAC,CAAC;AAElE,qBAAa,MAAM;;gBAGL,MAAM,EAAE,YAAY;IAwG1B,OAAO,CAAC,IAAI,EAAE,OAAO,CAAC,IAAI,CAAC,cAAc,GAAG,OAAO,CAAC,OAAO,CAAC,IAAI,CAAC,OAAO,CAAC;CA8ChF"}
|