@mtkruto/node 0.1.201 → 0.1.299
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/COPYING +674 -0
- package/README.md +77 -1
- package/esm/0_deps.d.ts +20 -1
- package/esm/0_deps.js +21 -1
- package/esm/0_errors.d.ts +19 -0
- package/esm/0_errors.js +19 -0
- package/esm/1_utilities.d.ts +20 -1
- package/esm/1_utilities.js +20 -1
- package/esm/2_connection.d.ts +19 -0
- package/esm/2_connection.js +19 -0
- package/esm/2_tl.d.ts +19 -0
- package/esm/2_tl.js +19 -0
- package/esm/3_errors.d.ts +19 -0
- package/esm/3_errors.js +19 -0
- package/esm/3_storage.d.ts +19 -0
- package/esm/3_storage.js +19 -0
- package/esm/3_transport.d.ts +19 -0
- package/esm/3_transport.js +19 -0
- package/esm/3_types.d.ts +19 -0
- package/esm/3_types.js +19 -0
- package/esm/4_constants.js +19 -0
- package/esm/4_errors.d.ts +19 -0
- package/esm/4_errors.js +22 -3
- package/esm/5_client.d.ts +19 -0
- package/esm/5_client.js +19 -0
- package/esm/client/0_client_abstract.d.ts +19 -0
- package/esm/client/0_client_abstract.js +19 -0
- package/esm/client/0_filters.d.ts +19 -0
- package/esm/client/0_filters.js +19 -0
- package/esm/client/0_html.d.ts +19 -0
- package/esm/client/0_html.js +19 -0
- package/esm/client/0_markdown.js +5 -5
- package/esm/client/0_message.d.ts +19 -0
- package/esm/client/0_message.js +19 -0
- package/esm/client/0_params.d.ts +19 -0
- package/esm/client/0_params.js +19 -0
- package/esm/client/0_password.js +19 -0
- package/esm/client/0_types.d.ts +19 -0
- package/esm/client/0_types.js +19 -0
- package/esm/client/0_utilities.d.ts +7 -0
- package/esm/client/0_utilities.js +66 -4
- package/esm/client/1_account_manager.d.ts +19 -0
- package/esm/client/1_account_manager.js +23 -4
- package/esm/client/1_bot_info_manager.d.ts +19 -0
- package/esm/client/1_bot_info_manager.js +19 -0
- package/esm/client/1_business_connection_manager.d.ts +19 -0
- package/esm/client/1_business_connection_manager.js +19 -0
- package/esm/client/1_client_encrypted.d.ts +19 -0
- package/esm/client/1_client_encrypted.js +23 -4
- package/esm/client/1_client_plain.d.ts +19 -0
- package/esm/client/1_client_plain.js +22 -3
- package/esm/client/1_composer.d.ts +19 -0
- package/esm/client/1_composer.js +19 -0
- package/esm/client/1_file_manager.d.ts +19 -0
- package/esm/client/1_file_manager.js +25 -5
- package/esm/client/1_network_statistics_manager.d.ts +19 -0
- package/esm/client/1_network_statistics_manager.js +19 -0
- package/esm/client/1_reaction_manager.d.ts +19 -0
- package/esm/client/1_reaction_manager.js +21 -2
- package/esm/client/1_update_manager.d.ts +19 -0
- package/esm/client/1_update_manager.js +28 -8
- package/esm/client/2_message_manager.d.ts +19 -0
- package/esm/client/2_message_manager.js +66 -24
- package/esm/client/3_callback_query_manager.d.ts +19 -0
- package/esm/client/3_callback_query_manager.js +21 -0
- package/esm/client/3_chat_list_manager.d.ts +19 -0
- package/esm/client/3_chat_list_manager.js +32 -12
- package/esm/client/3_inline_query_manager.d.ts +19 -0
- package/esm/client/3_inline_query_manager.js +23 -2
- package/esm/client/3_story_manager.d.ts +19 -0
- package/esm/client/3_story_manager.js +26 -5
- package/esm/client/4_client.d.ts +19 -0
- package/esm/client/4_client.js +37 -17
- package/esm/connection/0_connection.d.ts +19 -0
- package/esm/connection/0_connection.js +19 -0
- package/esm/connection/1_connection_web_socket.js +22 -2
- package/esm/deps/deno.land/x/html_parser@v0.1.3/src/DomHandler.d.ts +83 -0
- package/esm/deps/deno.land/x/html_parser@v0.1.3/src/DomHandler.js +203 -0
- package/esm/deps/deno.land/x/html_parser@v0.1.3/src/DomSerializer.d.ts +50 -0
- package/esm/deps/deno.land/x/html_parser@v0.1.3/src/DomSerializer.js +274 -0
- package/esm/deps/deno.land/x/html_parser@v0.1.3/src/ElementType.d.ts +47 -0
- package/esm/deps/deno.land/x/html_parser@v0.1.3/src/ElementType.js +51 -0
- package/esm/deps/deno.land/x/html_parser@v0.1.3/src/FeedHandler.d.ts +66 -0
- package/esm/deps/deno.land/x/html_parser@v0.1.3/src/FeedHandler.js +191 -0
- package/esm/deps/deno.land/x/html_parser@v0.1.3/src/Node.d.ts +168 -0
- package/esm/deps/deno.land/x/html_parser@v0.1.3/src/Node.js +385 -0
- package/esm/deps/deno.land/x/html_parser@v0.1.3/src/Parser.d.ts +159 -0
- package/esm/deps/deno.land/x/html_parser@v0.1.3/src/Parser.js +431 -0
- package/esm/deps/deno.land/x/html_parser@v0.1.3/src/Tokenizer.d.ts +181 -0
- package/esm/deps/deno.land/x/html_parser@v0.1.3/src/Tokenizer.js +1046 -0
- package/esm/deps/deno.land/x/html_parser@v0.1.3/src/mod.d.ts +42 -0
- package/esm/deps/deno.land/x/html_parser@v0.1.3/src/mod.js +52 -0
- package/esm/deps/deno.land/x/html_parser@v0.1.3/src/utils/entities/decode.d.ts +11 -0
- package/esm/deps/deno.land/x/html_parser@v0.1.3/src/utils/entities/decode.js +122 -0
- package/esm/deps/deno.land/x/html_parser@v0.1.3/src/utils/entities/decode_codepoint.d.ts +1 -0
- package/esm/deps/deno.land/x/html_parser@v0.1.3/src/utils/entities/decode_codepoint.js +24 -0
- package/esm/deps/deno.land/x/html_parser@v0.1.3/src/utils/entities/encode.d.ts +46 -0
- package/esm/deps/deno.land/x/html_parser@v0.1.3/src/utils/entities/encode.js +121 -0
- package/esm/deps/deno.land/x/html_parser@v0.1.3/src/utils/entities/maps/decode.d.ts +31 -0
- package/esm/deps/deno.land/x/html_parser@v0.1.3/src/utils/entities/maps/decode.js +30 -0
- package/esm/deps/deno.land/x/html_parser@v0.1.3/src/utils/entities/maps/entities.d.ts +2128 -0
- package/esm/deps/deno.land/x/html_parser@v0.1.3/src/utils/entities/maps/entities.js +2127 -0
- package/esm/deps/deno.land/x/html_parser@v0.1.3/src/utils/entities/maps/legacy.d.ts +109 -0
- package/esm/deps/deno.land/x/html_parser@v0.1.3/src/utils/entities/maps/legacy.js +108 -0
- package/esm/deps/deno.land/x/html_parser@v0.1.3/src/utils/entities/maps/xml.d.ts +8 -0
- package/esm/deps/deno.land/x/html_parser@v0.1.3/src/utils/entities/maps/xml.js +1 -0
- package/esm/deps/deno.land/x/html_parser@v0.1.3/src/utils/entities/mod.d.ts +90 -0
- package/esm/deps/deno.land/x/html_parser@v0.1.3/src/utils/entities/mod.js +95 -0
- package/esm/deps/deno.land/x/html_parser@v0.1.3/src/utils/helpers.d.ts +50 -0
- package/esm/deps/deno.land/x/html_parser@v0.1.3/src/utils/helpers.js +128 -0
- package/esm/deps/deno.land/x/html_parser@v0.1.3/src/utils/legacy.d.ts +46 -0
- package/esm/deps/deno.land/x/html_parser@v0.1.3/src/utils/legacy.js +110 -0
- package/esm/deps/deno.land/x/html_parser@v0.1.3/src/utils/manipulation.d.ts +42 -0
- package/esm/deps/deno.land/x/html_parser@v0.1.3/src/utils/manipulation.js +120 -0
- package/esm/deps/deno.land/x/html_parser@v0.1.3/src/utils/mod.d.ts +6 -0
- package/esm/deps/deno.land/x/html_parser@v0.1.3/src/utils/mod.js +6 -0
- package/esm/deps/deno.land/x/html_parser@v0.1.3/src/utils/querying.d.ts +54 -0
- package/esm/deps/deno.land/x/html_parser@v0.1.3/src/utils/querying.js +110 -0
- package/esm/deps/deno.land/x/html_parser@v0.1.3/src/utils/stringify.d.ts +40 -0
- package/esm/deps/deno.land/x/html_parser@v0.1.3/src/utils/stringify.js +75 -0
- package/esm/deps/deno.land/x/html_parser@v0.1.3/src/utils/traversal.d.ts +58 -0
- package/esm/deps/deno.land/x/html_parser@v0.1.3/src/utils/traversal.js +101 -0
- package/{script/deps/deno.land/x/tgcrypto@0.3.3 → esm/deps/deno.land/x/tgcrypto@0.4.0}/mod.d.ts +0 -1
- package/esm/deps/deno.land/x/{tgcrypto@0.3.3 → tgcrypto@0.4.0}/mod.js +0 -11
- package/esm/deps/deno.land/x/tgcrypto@0.4.0/tgcrypto.js +308 -0
- package/esm/deps/raw.githubusercontent.com/MTKruto/compress/main/zlib/deflate.d.ts +2 -0
- package/esm/deps/raw.githubusercontent.com/MTKruto/compress/main/zlib/deflate.js +5 -1
- package/esm/deps/raw.githubusercontent.com/MTKruto/compress/main/zlib/inflate.d.ts +2 -2
- package/esm/deps/raw.githubusercontent.com/MTKruto/compress/main/zlib/inflate.js +5 -1
- package/esm/deps/raw.githubusercontent.com/MTKruto/compress/main/zlib/zlib/crc32.js +1 -1
- package/esm/deps/raw.githubusercontent.com/MTKruto/compress/main/zlib/zlib/deflate.js +8 -8
- package/esm/deps/raw.githubusercontent.com/MTKruto/compress/main/zlib/zlib/inffast.js +2 -2
- package/esm/deps/raw.githubusercontent.com/MTKruto/compress/main/zlib/zlib/inflate.js +19 -21
- package/esm/deps/raw.githubusercontent.com/MTKruto/compress/main/zlib/zlib/trees.js +3 -3
- package/esm/mod.d.ts +20 -1
- package/esm/mod.js +20 -1
- package/esm/storage/0_storage.d.ts +19 -0
- package/esm/storage/0_storage.js +25 -5
- package/esm/storage/1_utilities.d.ts +19 -1
- package/esm/storage/1_utilities.js +21 -3
- package/esm/storage/2_storage_indexed_db.d.ts +19 -0
- package/esm/storage/2_storage_indexed_db.js +19 -0
- package/esm/storage/2_storage_local_storage.d.ts +19 -0
- package/esm/storage/2_storage_local_storage.js +20 -4
- package/esm/storage/2_storage_memory.d.ts +19 -0
- package/esm/storage/2_storage_memory.js +19 -0
- package/esm/storage/2_storage_session_storage.d.ts +19 -0
- package/esm/storage/2_storage_session_storage.js +20 -4
- package/esm/tl/0_tl_raw_reader.d.ts +19 -0
- package/esm/tl/0_tl_raw_reader.js +19 -0
- package/esm/tl/0_tl_raw_writer.d.ts +19 -0
- package/esm/tl/0_tl_raw_writer.js +19 -0
- package/esm/tl/1_tl_object.d.ts +19 -0
- package/esm/tl/1_tl_object.js +19 -0
- package/esm/tl/2_types.d.ts +19 -0
- package/esm/tl/2_types.js +19 -0
- package/esm/tl/3_deserialize.d.ts +19 -0
- package/esm/tl/3_deserialize.js +19 -0
- package/esm/tl/3_functions.d.ts +19 -0
- package/esm/tl/3_functions.js +19 -0
- package/esm/tl/3_utilities.d.ts +19 -0
- package/esm/tl/3_utilities.js +24 -4
- package/esm/tl/4_tl_reader.d.ts +19 -0
- package/esm/tl/4_tl_reader.js +19 -0
- package/esm/tl/5_tl_writer.d.ts +19 -0
- package/esm/tl/5_tl_writer.js +19 -0
- package/esm/tl/6_rpc_result.d.ts +19 -0
- package/esm/tl/6_rpc_result.js +19 -0
- package/esm/tl/7_message.d.ts +19 -0
- package/esm/tl/7_message.js +19 -0
- package/esm/tl/8_message_container.d.ts +19 -0
- package/esm/tl/8_message_container.js +19 -0
- package/esm/transport/0_obfuscation.js +19 -0
- package/esm/transport/0_transport.d.ts +19 -0
- package/esm/transport/0_transport.js +19 -0
- package/esm/transport/1_transport_abridged.d.ts +19 -0
- package/esm/transport/1_transport_abridged.js +19 -0
- package/esm/transport/1_transport_intermediate.d.ts +19 -0
- package/esm/transport/1_transport_intermediate.js +19 -0
- package/esm/transport/2_transport_provider.d.ts +19 -0
- package/esm/transport/2_transport_provider.js +23 -4
- package/esm/transport/3_transport_provider_web_socket.d.ts +19 -0
- package/esm/transport/3_transport_provider_web_socket.js +19 -0
- package/esm/types/0_authorization_state.d.ts +19 -0
- package/esm/types/0_authorization_state.js +19 -0
- package/esm/types/0_bot_command.d.ts +19 -0
- package/esm/types/0_bot_command.js +19 -0
- package/esm/types/0_chat_action.d.ts +19 -0
- package/esm/types/0_chat_action.js +19 -0
- package/esm/types/0_chat_administrator_rights.d.ts +19 -0
- package/esm/types/0_chat_administrator_rights.js +19 -0
- package/esm/types/0_chat_member_rights.d.ts +19 -0
- package/esm/types/0_chat_member_rights.js +19 -0
- package/esm/types/0_chat_photo.d.ts +19 -1
- package/esm/types/0_chat_photo.js +19 -2
- package/esm/types/0_connection_state.d.ts +19 -0
- package/esm/types/0_connection_state.js +19 -0
- package/esm/types/0_contact.d.ts +19 -0
- package/esm/types/0_contact.js +19 -0
- package/esm/types/0_dice.d.ts +19 -0
- package/esm/types/0_dice.js +19 -0
- package/esm/types/0_file_source.d.ts +19 -0
- package/esm/types/0_file_source.js +19 -0
- package/esm/types/0_giveaway_parameters.d.ts +19 -0
- package/esm/types/0_giveaway_parameters.js +19 -0
- package/esm/types/0_id.d.ts +19 -0
- package/esm/types/0_id.js +19 -0
- package/esm/types/0_keyboard_button_poll_type.d.ts +19 -0
- package/esm/types/0_keyboard_button_poll_type.js +19 -0
- package/esm/types/0_link_preview.d.ts +19 -0
- package/esm/types/0_link_preview.js +19 -0
- package/esm/types/0_location.d.ts +19 -0
- package/esm/types/0_location.js +19 -0
- package/esm/types/0_login_url.d.ts +19 -0
- package/esm/types/0_login_url.js +19 -0
- package/esm/types/0_mask_position.d.ts +19 -0
- package/esm/types/0_mask_position.js +19 -0
- package/esm/types/0_message_entity.d.ts +19 -0
- package/esm/types/0_message_entity.js +22 -3
- package/esm/types/0_message_reference.d.ts +19 -0
- package/esm/types/0_message_reference.js +19 -0
- package/esm/types/0_message_search_filter.d.ts +19 -0
- package/esm/types/0_message_search_filter.js +21 -2
- package/esm/types/0_mini_app_info.d.ts +19 -0
- package/esm/types/0_mini_app_info.js +19 -0
- package/esm/types/0_network_statistics_entry.d.ts +19 -0
- package/esm/types/0_network_statistics_entry.js +19 -0
- package/esm/types/0_parse_mode.d.ts +19 -0
- package/esm/types/0_parse_mode.js +19 -0
- package/esm/types/0_poll_option.d.ts +19 -0
- package/esm/types/0_poll_option.js +19 -0
- package/esm/types/0_price_tag.d.ts +19 -0
- package/esm/types/0_price_tag.js +19 -0
- package/esm/types/0_reaction.d.ts +19 -0
- package/esm/types/0_reaction.js +21 -2
- package/esm/types/0_restriction_reason.d.ts +19 -0
- package/esm/types/0_restriction_reason.js +19 -0
- package/esm/types/0_story_reference.d.ts +19 -0
- package/esm/types/0_story_reference.js +19 -0
- package/esm/types/0_thumbnail.d.ts +19 -0
- package/esm/types/0_thumbnail.js +19 -0
- package/esm/types/0_voice.d.ts +19 -0
- package/esm/types/0_voice.js +19 -0
- package/esm/types/1_animation.d.ts +19 -0
- package/esm/types/1_animation.js +19 -0
- package/esm/types/1_audio.d.ts +19 -0
- package/esm/types/1_audio.js +19 -0
- package/esm/types/1_bot_command_scope.d.ts +19 -0
- package/esm/types/1_bot_command_scope.js +22 -3
- package/esm/types/1_chat_p.d.ts +19 -0
- package/esm/types/1_chat_p.js +22 -2
- package/esm/types/1_document.d.ts +19 -0
- package/esm/types/1_document.js +19 -0
- package/esm/types/1_giveaway.d.ts +19 -0
- package/esm/types/1_giveaway.js +19 -0
- package/esm/types/1_inline_query_result_button.d.ts +19 -0
- package/esm/types/1_inline_query_result_button.js +19 -0
- package/esm/types/1_input_message_content.d.ts +19 -0
- package/esm/types/1_input_message_content.js +19 -0
- package/esm/types/1_input_story_content.d.ts +19 -0
- package/esm/types/1_input_story_content.js +19 -0
- package/esm/types/1_keyboard_button.d.ts +19 -0
- package/esm/types/1_keyboard_button.js +22 -3
- package/esm/types/1_message_reaction.d.ts +19 -0
- package/esm/types/1_message_reaction.js +21 -2
- package/esm/types/1_network_statistics.d.ts +19 -0
- package/esm/types/1_network_statistics.js +19 -0
- package/esm/types/1_photo.d.ts +19 -0
- package/esm/types/1_photo.js +19 -0
- package/esm/types/1_poll.d.ts +19 -0
- package/esm/types/1_poll.js +19 -0
- package/esm/types/1_reaction_count.d.ts +19 -0
- package/esm/types/1_reaction_count.js +19 -0
- package/esm/types/1_reply_quote.d.ts +19 -0
- package/esm/types/1_reply_quote.js +19 -0
- package/esm/types/1_sticker.d.ts +19 -0
- package/esm/types/1_sticker.js +19 -0
- package/esm/types/1_story_privacy.d.ts +19 -0
- package/esm/types/1_story_privacy.js +22 -3
- package/esm/types/1_story_reaction.d.ts +19 -0
- package/esm/types/1_story_reaction.js +19 -0
- package/esm/types/1_user.d.ts +19 -0
- package/esm/types/1_user.js +19 -0
- package/esm/types/1_venue.d.ts +19 -0
- package/esm/types/1_venue.js +19 -0
- package/esm/types/1_video.d.ts +19 -0
- package/esm/types/1_video.js +19 -0
- package/esm/types/1_video_note.d.ts +19 -0
- package/esm/types/1_video_note.js +19 -0
- package/esm/types/2_business_connection.d.ts +19 -0
- package/esm/types/2_business_connection.js +19 -0
- package/esm/types/2_chat_member.d.ts +19 -0
- package/esm/types/2_chat_member.js +25 -5
- package/esm/types/2_chosen_inline_result.d.ts +19 -0
- package/esm/types/2_chosen_inline_result.js +22 -2
- package/esm/types/2_game.d.ts +19 -0
- package/esm/types/2_game.js +19 -0
- package/esm/types/2_inactive_chat.d.ts +19 -0
- package/esm/types/2_inactive_chat.js +22 -2
- package/esm/types/2_inline_keyboard_button.d.ts +19 -0
- package/esm/types/2_inline_keyboard_button.js +22 -3
- package/esm/types/2_inline_query.d.ts +19 -0
- package/esm/types/2_inline_query.js +22 -3
- package/esm/types/2_invite_link.d.ts +19 -0
- package/esm/types/2_invite_link.js +22 -2
- package/esm/types/2_message_interactions.d.ts +19 -0
- package/esm/types/2_message_interactions.js +19 -0
- package/esm/types/2_message_reaction_count.d.ts +19 -0
- package/esm/types/2_message_reaction_count.js +19 -0
- package/esm/types/2_message_reactions.d.ts +19 -0
- package/esm/types/2_message_reactions.js +19 -0
- package/esm/types/2_story_content.d.ts +19 -0
- package/esm/types/2_story_content.js +24 -5
- package/esm/types/2_story_interactions.d.ts +19 -0
- package/esm/types/2_story_interactions.js +19 -0
- package/esm/types/2_story_interactive_area.d.ts +19 -0
- package/esm/types/2_story_interactive_area.js +24 -5
- package/esm/types/3_chat_member_updated.d.ts +19 -0
- package/esm/types/3_chat_member_updated.js +23 -3
- package/esm/types/3_reply_markup.d.ts +19 -0
- package/esm/types/3_reply_markup.js +23 -3
- package/esm/types/3_story.d.ts +19 -0
- package/esm/types/3_story.js +22 -2
- package/esm/types/4_inline_query_result.d.ts +19 -0
- package/esm/types/4_inline_query_result.js +24 -5
- package/esm/types/4_message.d.ts +19 -0
- package/esm/types/4_message.js +36 -16
- package/esm/types/5_callback_query.d.ts +19 -0
- package/esm/types/5_callback_query.js +23 -3
- package/esm/types/5_chat.d.ts +19 -0
- package/esm/types/5_chat.js +27 -7
- package/esm/types/6_update.d.ts +19 -0
- package/esm/types/6_update.js +19 -0
- package/esm/types/_file_id.d.ts +19 -0
- package/esm/types/_file_id.js +28 -8
- package/esm/types/_getters.d.ts +19 -0
- package/esm/types/_getters.js +19 -0
- package/esm/utilities/0_bigint.d.ts +1 -0
- package/esm/utilities/0_bigint.js +44 -0
- package/esm/utilities/0_buffer.d.ts +19 -0
- package/esm/utilities/0_buffer.js +19 -0
- package/esm/utilities/0_cache_map.d.ts +19 -0
- package/esm/utilities/0_cache_map.js +19 -0
- package/esm/utilities/0_color.d.ts +19 -0
- package/esm/utilities/0_color.js +19 -0
- package/esm/utilities/0_crypto.d.ts +19 -0
- package/esm/utilities/0_crypto.js +19 -0
- package/esm/utilities/0_hash.js +19 -0
- package/esm/utilities/0_logger.d.ts +27 -0
- package/esm/utilities/0_logger.js +28 -5
- package/esm/utilities/0_mutex.d.ts +19 -0
- package/esm/utilities/0_mutex.js +19 -0
- package/esm/utilities/0_object.d.ts +19 -0
- package/esm/utilities/0_object.js +19 -0
- package/esm/utilities/0_rle.d.ts +19 -0
- package/esm/utilities/0_rle.js +19 -0
- package/esm/utilities/0_types.d.ts +19 -0
- package/esm/utilities/0_types.js +19 -0
- package/esm/utilities/1_auth.js +19 -0
- package/esm/utilities/1_base64.d.ts +19 -0
- package/esm/utilities/1_base64.js +19 -0
- package/esm/utilities/1_math.d.ts +20 -0
- package/esm/utilities/1_math.js +70 -0
- package/esm/utilities/1_misc.d.ts +19 -0
- package/esm/utilities/1_misc.js +21 -2
- package/esm/utilities/1_queue.d.ts +19 -0
- package/esm/utilities/1_queue.js +19 -0
- package/package.json +1 -1
- package/script/0_deps.d.ts +20 -1
- package/script/0_deps.js +22 -3
- package/script/0_errors.d.ts +19 -0
- package/script/0_errors.js +19 -0
- package/script/1_utilities.d.ts +20 -1
- package/script/1_utilities.js +20 -1
- package/script/2_connection.d.ts +19 -0
- package/script/2_connection.js +19 -0
- package/script/2_tl.d.ts +19 -0
- package/script/2_tl.js +19 -0
- package/script/3_errors.d.ts +19 -0
- package/script/3_errors.js +19 -0
- package/script/3_storage.d.ts +19 -0
- package/script/3_storage.js +19 -0
- package/script/3_transport.d.ts +19 -0
- package/script/3_transport.js +19 -0
- package/script/3_types.d.ts +19 -0
- package/script/3_types.js +19 -0
- package/script/4_constants.js +19 -0
- package/script/4_errors.d.ts +19 -0
- package/script/4_errors.js +22 -3
- package/script/5_client.d.ts +19 -0
- package/script/5_client.js +19 -0
- package/script/client/0_client_abstract.d.ts +19 -0
- package/script/client/0_client_abstract.js +19 -0
- package/script/client/0_filters.d.ts +19 -0
- package/script/client/0_filters.js +19 -0
- package/script/client/0_html.d.ts +19 -0
- package/script/client/0_html.js +19 -0
- package/script/client/0_markdown.js +5 -5
- package/script/client/0_message.d.ts +19 -0
- package/script/client/0_message.js +19 -0
- package/script/client/0_params.d.ts +19 -0
- package/script/client/0_params.js +19 -0
- package/script/client/0_password.js +19 -0
- package/script/client/0_types.d.ts +19 -0
- package/script/client/0_types.js +19 -0
- package/script/client/0_utilities.d.ts +7 -0
- package/script/client/0_utilities.js +73 -4
- package/script/client/1_account_manager.d.ts +19 -0
- package/script/client/1_account_manager.js +23 -4
- package/script/client/1_bot_info_manager.d.ts +19 -0
- package/script/client/1_bot_info_manager.js +19 -0
- package/script/client/1_business_connection_manager.d.ts +19 -0
- package/script/client/1_business_connection_manager.js +19 -0
- package/script/client/1_client_encrypted.d.ts +19 -0
- package/script/client/1_client_encrypted.js +21 -2
- package/script/client/1_client_plain.d.ts +19 -0
- package/script/client/1_client_plain.js +21 -2
- package/script/client/1_composer.d.ts +19 -0
- package/script/client/1_composer.js +19 -0
- package/script/client/1_file_manager.d.ts +19 -0
- package/script/client/1_file_manager.js +24 -4
- package/script/client/1_network_statistics_manager.d.ts +19 -0
- package/script/client/1_network_statistics_manager.js +19 -0
- package/script/client/1_reaction_manager.d.ts +19 -0
- package/script/client/1_reaction_manager.js +21 -2
- package/script/client/1_update_manager.d.ts +19 -0
- package/script/client/1_update_manager.js +27 -7
- package/script/client/2_message_manager.d.ts +19 -0
- package/script/client/2_message_manager.js +70 -28
- package/script/client/3_callback_query_manager.d.ts +19 -0
- package/script/client/3_callback_query_manager.js +21 -0
- package/script/client/3_chat_list_manager.d.ts +19 -0
- package/script/client/3_chat_list_manager.js +31 -11
- package/script/client/3_inline_query_manager.d.ts +19 -0
- package/script/client/3_inline_query_manager.js +23 -2
- package/script/client/3_story_manager.d.ts +19 -0
- package/script/client/3_story_manager.js +23 -2
- package/script/client/4_client.d.ts +19 -0
- package/script/client/4_client.js +35 -15
- package/script/connection/0_connection.d.ts +19 -0
- package/script/connection/0_connection.js +19 -0
- package/script/connection/1_connection_web_socket.js +21 -1
- package/script/deps/deno.land/x/html_parser@v0.1.3/src/DomHandler.d.ts +83 -0
- package/script/deps/deno.land/x/html_parser@v0.1.3/src/DomHandler.js +207 -0
- package/script/deps/deno.land/x/html_parser@v0.1.3/src/DomSerializer.d.ts +50 -0
- package/script/deps/deno.land/x/html_parser@v0.1.3/src/DomSerializer.js +301 -0
- package/script/deps/deno.land/x/html_parser@v0.1.3/src/ElementType.d.ts +47 -0
- package/script/deps/deno.land/x/html_parser@v0.1.3/src/ElementType.js +55 -0
- package/script/deps/deno.land/x/html_parser@v0.1.3/src/FeedHandler.d.ts +66 -0
- package/script/deps/deno.land/x/html_parser@v0.1.3/src/FeedHandler.js +222 -0
- package/script/deps/deno.land/x/html_parser@v0.1.3/src/Node.d.ts +168 -0
- package/script/deps/deno.land/x/html_parser@v0.1.3/src/Node.js +404 -0
- package/script/deps/deno.land/x/html_parser@v0.1.3/src/Parser.d.ts +159 -0
- package/script/deps/deno.land/x/html_parser@v0.1.3/src/Parser.js +438 -0
- package/script/deps/deno.land/x/html_parser@v0.1.3/src/Tokenizer.d.ts +181 -0
- package/script/deps/deno.land/x/html_parser@v0.1.3/src/Tokenizer.js +1052 -0
- package/script/deps/deno.land/x/html_parser@v0.1.3/src/mod.d.ts +42 -0
- package/script/deps/deno.land/x/html_parser@v0.1.3/src/mod.js +88 -0
- package/script/deps/deno.land/x/html_parser@v0.1.3/src/utils/entities/decode.d.ts +11 -0
- package/script/deps/deno.land/x/html_parser@v0.1.3/src/utils/entities/decode.js +128 -0
- package/script/deps/deno.land/x/html_parser@v0.1.3/src/utils/entities/decode_codepoint.d.ts +1 -0
- package/script/deps/deno.land/x/html_parser@v0.1.3/src/utils/entities/decode_codepoint.js +30 -0
- package/script/deps/deno.land/x/html_parser@v0.1.3/src/utils/entities/encode.d.ts +46 -0
- package/script/deps/deno.land/x/html_parser@v0.1.3/src/utils/entities/encode.js +129 -0
- package/script/deps/deno.land/x/html_parser@v0.1.3/src/utils/entities/maps/decode.d.ts +31 -0
- package/script/deps/deno.land/x/html_parser@v0.1.3/src/utils/entities/maps/decode.js +32 -0
- package/script/deps/deno.land/x/html_parser@v0.1.3/src/utils/entities/maps/entities.d.ts +2128 -0
- package/script/deps/deno.land/x/html_parser@v0.1.3/src/utils/entities/maps/entities.js +2129 -0
- package/script/deps/deno.land/x/html_parser@v0.1.3/src/utils/entities/maps/legacy.d.ts +109 -0
- package/script/deps/deno.land/x/html_parser@v0.1.3/src/utils/entities/maps/legacy.js +110 -0
- package/script/deps/deno.land/x/html_parser@v0.1.3/src/utils/entities/maps/xml.d.ts +8 -0
- package/script/deps/deno.land/x/html_parser@v0.1.3/src/utils/entities/maps/xml.js +3 -0
- package/script/deps/deno.land/x/html_parser@v0.1.3/src/utils/entities/mod.d.ts +90 -0
- package/script/deps/deno.land/x/html_parser@v0.1.3/src/utils/entities/mod.js +114 -0
- package/script/deps/deno.land/x/html_parser@v0.1.3/src/utils/helpers.d.ts +50 -0
- package/script/deps/deno.land/x/html_parser@v0.1.3/src/utils/helpers.js +134 -0
- package/script/deps/deno.land/x/html_parser@v0.1.3/src/utils/legacy.d.ts +46 -0
- package/script/deps/deno.land/x/html_parser@v0.1.3/src/utils/legacy.js +118 -0
- package/script/deps/deno.land/x/html_parser@v0.1.3/src/utils/manipulation.d.ts +42 -0
- package/script/deps/deno.land/x/html_parser@v0.1.3/src/utils/manipulation.js +129 -0
- package/script/deps/deno.land/x/html_parser@v0.1.3/src/utils/mod.d.ts +6 -0
- package/script/deps/deno.land/x/html_parser@v0.1.3/src/utils/mod.js +22 -0
- package/script/deps/deno.land/x/html_parser@v0.1.3/src/utils/querying.d.ts +54 -0
- package/script/deps/deno.land/x/html_parser@v0.1.3/src/utils/querying.js +119 -0
- package/script/deps/deno.land/x/html_parser@v0.1.3/src/utils/stringify.d.ts +40 -0
- package/script/deps/deno.land/x/html_parser@v0.1.3/src/utils/stringify.js +86 -0
- package/script/deps/deno.land/x/html_parser@v0.1.3/src/utils/traversal.d.ts +58 -0
- package/script/deps/deno.land/x/html_parser@v0.1.3/src/utils/traversal.js +112 -0
- package/{esm/deps/deno.land/x/tgcrypto@0.3.3 → script/deps/deno.land/x/tgcrypto@0.4.0}/mod.d.ts +0 -1
- package/script/deps/deno.land/x/{tgcrypto@0.3.3 → tgcrypto@0.4.0}/mod.js +1 -13
- package/script/deps/deno.land/x/tgcrypto@0.4.0/tgcrypto.js +310 -0
- package/script/deps/raw.githubusercontent.com/MTKruto/compress/main/zlib/deflate.d.ts +2 -0
- package/script/deps/raw.githubusercontent.com/MTKruto/compress/main/zlib/deflate.js +7 -1
- package/script/deps/raw.githubusercontent.com/MTKruto/compress/main/zlib/inflate.d.ts +2 -2
- package/script/deps/raw.githubusercontent.com/MTKruto/compress/main/zlib/inflate.js +7 -1
- package/script/deps/raw.githubusercontent.com/MTKruto/compress/main/zlib/zlib/crc32.js +1 -1
- package/script/deps/raw.githubusercontent.com/MTKruto/compress/main/zlib/zlib/deflate.js +8 -8
- package/script/deps/raw.githubusercontent.com/MTKruto/compress/main/zlib/zlib/inffast.js +2 -2
- package/script/deps/raw.githubusercontent.com/MTKruto/compress/main/zlib/zlib/inflate.js +19 -21
- package/script/deps/raw.githubusercontent.com/MTKruto/compress/main/zlib/zlib/trees.js +3 -3
- package/script/mod.d.ts +20 -1
- package/script/mod.js +21 -1
- package/script/storage/0_storage.d.ts +19 -0
- package/script/storage/0_storage.js +24 -4
- package/script/storage/1_utilities.d.ts +19 -1
- package/script/storage/1_utilities.js +22 -4
- package/script/storage/2_storage_indexed_db.d.ts +19 -0
- package/script/storage/2_storage_indexed_db.js +19 -0
- package/script/storage/2_storage_local_storage.d.ts +19 -0
- package/script/storage/2_storage_local_storage.js +19 -3
- package/script/storage/2_storage_memory.d.ts +19 -0
- package/script/storage/2_storage_memory.js +19 -0
- package/script/storage/2_storage_session_storage.d.ts +19 -0
- package/script/storage/2_storage_session_storage.js +19 -3
- package/script/tl/0_tl_raw_reader.d.ts +19 -0
- package/script/tl/0_tl_raw_reader.js +19 -0
- package/script/tl/0_tl_raw_writer.d.ts +19 -0
- package/script/tl/0_tl_raw_writer.js +19 -0
- package/script/tl/1_tl_object.d.ts +19 -0
- package/script/tl/1_tl_object.js +19 -0
- package/script/tl/2_types.d.ts +19 -0
- package/script/tl/2_types.js +19 -0
- package/script/tl/3_deserialize.d.ts +19 -0
- package/script/tl/3_deserialize.js +19 -0
- package/script/tl/3_functions.d.ts +19 -0
- package/script/tl/3_functions.js +19 -0
- package/script/tl/3_utilities.d.ts +19 -0
- package/script/tl/3_utilities.js +23 -3
- package/script/tl/4_tl_reader.d.ts +19 -0
- package/script/tl/4_tl_reader.js +19 -0
- package/script/tl/5_tl_writer.d.ts +19 -0
- package/script/tl/5_tl_writer.js +19 -0
- package/script/tl/6_rpc_result.d.ts +19 -0
- package/script/tl/6_rpc_result.js +19 -0
- package/script/tl/7_message.d.ts +19 -0
- package/script/tl/7_message.js +19 -0
- package/script/tl/8_message_container.d.ts +19 -0
- package/script/tl/8_message_container.js +19 -0
- package/script/transport/0_obfuscation.js +19 -0
- package/script/transport/0_transport.d.ts +19 -0
- package/script/transport/0_transport.js +19 -0
- package/script/transport/1_transport_abridged.d.ts +19 -0
- package/script/transport/1_transport_abridged.js +19 -0
- package/script/transport/1_transport_intermediate.d.ts +19 -0
- package/script/transport/1_transport_intermediate.js +19 -0
- package/script/transport/2_transport_provider.d.ts +19 -0
- package/script/transport/2_transport_provider.js +23 -4
- package/script/transport/3_transport_provider_web_socket.d.ts +19 -0
- package/script/transport/3_transport_provider_web_socket.js +19 -0
- package/script/types/0_authorization_state.d.ts +19 -0
- package/script/types/0_authorization_state.js +19 -0
- package/script/types/0_bot_command.d.ts +19 -0
- package/script/types/0_bot_command.js +19 -0
- package/script/types/0_chat_action.d.ts +19 -0
- package/script/types/0_chat_action.js +19 -0
- package/script/types/0_chat_administrator_rights.d.ts +19 -0
- package/script/types/0_chat_administrator_rights.js +19 -0
- package/script/types/0_chat_member_rights.d.ts +19 -0
- package/script/types/0_chat_member_rights.js +19 -0
- package/script/types/0_chat_photo.d.ts +19 -1
- package/script/types/0_chat_photo.js +19 -2
- package/script/types/0_connection_state.d.ts +19 -0
- package/script/types/0_connection_state.js +19 -0
- package/script/types/0_contact.d.ts +19 -0
- package/script/types/0_contact.js +19 -0
- package/script/types/0_dice.d.ts +19 -0
- package/script/types/0_dice.js +19 -0
- package/script/types/0_file_source.d.ts +19 -0
- package/script/types/0_file_source.js +19 -0
- package/script/types/0_giveaway_parameters.d.ts +19 -0
- package/script/types/0_giveaway_parameters.js +19 -0
- package/script/types/0_id.d.ts +19 -0
- package/script/types/0_id.js +19 -0
- package/script/types/0_keyboard_button_poll_type.d.ts +19 -0
- package/script/types/0_keyboard_button_poll_type.js +19 -0
- package/script/types/0_link_preview.d.ts +19 -0
- package/script/types/0_link_preview.js +19 -0
- package/script/types/0_location.d.ts +19 -0
- package/script/types/0_location.js +19 -0
- package/script/types/0_login_url.d.ts +19 -0
- package/script/types/0_login_url.js +19 -0
- package/script/types/0_mask_position.d.ts +19 -0
- package/script/types/0_mask_position.js +19 -0
- package/script/types/0_message_entity.d.ts +19 -0
- package/script/types/0_message_entity.js +22 -3
- package/script/types/0_message_reference.d.ts +19 -0
- package/script/types/0_message_reference.js +19 -0
- package/script/types/0_message_search_filter.d.ts +19 -0
- package/script/types/0_message_search_filter.js +21 -2
- package/script/types/0_mini_app_info.d.ts +19 -0
- package/script/types/0_mini_app_info.js +19 -0
- package/script/types/0_network_statistics_entry.d.ts +19 -0
- package/script/types/0_network_statistics_entry.js +19 -0
- package/script/types/0_parse_mode.d.ts +19 -0
- package/script/types/0_parse_mode.js +19 -0
- package/script/types/0_poll_option.d.ts +19 -0
- package/script/types/0_poll_option.js +19 -0
- package/script/types/0_price_tag.d.ts +19 -0
- package/script/types/0_price_tag.js +19 -0
- package/script/types/0_reaction.d.ts +19 -0
- package/script/types/0_reaction.js +21 -2
- package/script/types/0_restriction_reason.d.ts +19 -0
- package/script/types/0_restriction_reason.js +19 -0
- package/script/types/0_story_reference.d.ts +19 -0
- package/script/types/0_story_reference.js +19 -0
- package/script/types/0_thumbnail.d.ts +19 -0
- package/script/types/0_thumbnail.js +19 -0
- package/script/types/0_voice.d.ts +19 -0
- package/script/types/0_voice.js +19 -0
- package/script/types/1_animation.d.ts +19 -0
- package/script/types/1_animation.js +19 -0
- package/script/types/1_audio.d.ts +19 -0
- package/script/types/1_audio.js +19 -0
- package/script/types/1_bot_command_scope.d.ts +19 -0
- package/script/types/1_bot_command_scope.js +22 -3
- package/script/types/1_chat_p.d.ts +19 -0
- package/script/types/1_chat_p.js +21 -1
- package/script/types/1_document.d.ts +19 -0
- package/script/types/1_document.js +19 -0
- package/script/types/1_giveaway.d.ts +19 -0
- package/script/types/1_giveaway.js +19 -0
- package/script/types/1_inline_query_result_button.d.ts +19 -0
- package/script/types/1_inline_query_result_button.js +19 -0
- package/script/types/1_input_message_content.d.ts +19 -0
- package/script/types/1_input_message_content.js +19 -0
- package/script/types/1_input_story_content.d.ts +19 -0
- package/script/types/1_input_story_content.js +19 -0
- package/script/types/1_keyboard_button.d.ts +19 -0
- package/script/types/1_keyboard_button.js +22 -3
- package/script/types/1_message_reaction.d.ts +19 -0
- package/script/types/1_message_reaction.js +21 -2
- package/script/types/1_network_statistics.d.ts +19 -0
- package/script/types/1_network_statistics.js +19 -0
- package/script/types/1_photo.d.ts +19 -0
- package/script/types/1_photo.js +19 -0
- package/script/types/1_poll.d.ts +19 -0
- package/script/types/1_poll.js +19 -0
- package/script/types/1_reaction_count.d.ts +19 -0
- package/script/types/1_reaction_count.js +19 -0
- package/script/types/1_reply_quote.d.ts +19 -0
- package/script/types/1_reply_quote.js +19 -0
- package/script/types/1_sticker.d.ts +19 -0
- package/script/types/1_sticker.js +19 -0
- package/script/types/1_story_privacy.d.ts +19 -0
- package/script/types/1_story_privacy.js +22 -3
- package/script/types/1_story_reaction.d.ts +19 -0
- package/script/types/1_story_reaction.js +19 -0
- package/script/types/1_user.d.ts +19 -0
- package/script/types/1_user.js +19 -0
- package/script/types/1_venue.d.ts +19 -0
- package/script/types/1_venue.js +19 -0
- package/script/types/1_video.d.ts +19 -0
- package/script/types/1_video.js +19 -0
- package/script/types/1_video_note.d.ts +19 -0
- package/script/types/1_video_note.js +19 -0
- package/script/types/2_business_connection.d.ts +19 -0
- package/script/types/2_business_connection.js +19 -0
- package/script/types/2_chat_member.d.ts +19 -0
- package/script/types/2_chat_member.js +24 -4
- package/script/types/2_chosen_inline_result.d.ts +19 -0
- package/script/types/2_chosen_inline_result.js +21 -1
- package/script/types/2_game.d.ts +19 -0
- package/script/types/2_game.js +19 -0
- package/script/types/2_inactive_chat.d.ts +19 -0
- package/script/types/2_inactive_chat.js +21 -1
- package/script/types/2_inline_keyboard_button.d.ts +19 -0
- package/script/types/2_inline_keyboard_button.js +22 -3
- package/script/types/2_inline_query.d.ts +19 -0
- package/script/types/2_inline_query.js +22 -3
- package/script/types/2_invite_link.d.ts +19 -0
- package/script/types/2_invite_link.js +21 -1
- package/script/types/2_message_interactions.d.ts +19 -0
- package/script/types/2_message_interactions.js +19 -0
- package/script/types/2_message_reaction_count.d.ts +19 -0
- package/script/types/2_message_reaction_count.js +19 -0
- package/script/types/2_message_reactions.d.ts +19 -0
- package/script/types/2_message_reactions.js +19 -0
- package/script/types/2_story_content.d.ts +19 -0
- package/script/types/2_story_content.js +24 -5
- package/script/types/2_story_interactions.d.ts +19 -0
- package/script/types/2_story_interactions.js +19 -0
- package/script/types/2_story_interactive_area.d.ts +19 -0
- package/script/types/2_story_interactive_area.js +24 -5
- package/script/types/3_chat_member_updated.d.ts +19 -0
- package/script/types/3_chat_member_updated.js +22 -2
- package/script/types/3_reply_markup.d.ts +19 -0
- package/script/types/3_reply_markup.js +22 -2
- package/script/types/3_story.d.ts +19 -0
- package/script/types/3_story.js +21 -1
- package/script/types/4_inline_query_result.d.ts +19 -0
- package/script/types/4_inline_query_result.js +24 -5
- package/script/types/4_message.d.ts +19 -0
- package/script/types/4_message.js +35 -15
- package/script/types/5_callback_query.d.ts +19 -0
- package/script/types/5_callback_query.js +22 -2
- package/script/types/5_chat.d.ts +19 -0
- package/script/types/5_chat.js +26 -6
- package/script/types/6_update.d.ts +19 -0
- package/script/types/6_update.js +19 -0
- package/script/types/_file_id.d.ts +19 -0
- package/script/types/_file_id.js +27 -7
- package/script/types/_getters.d.ts +19 -0
- package/script/types/_getters.js +19 -0
- package/script/utilities/0_bigint.d.ts +1 -0
- package/script/utilities/0_bigint.js +46 -1
- package/script/utilities/0_buffer.d.ts +19 -0
- package/script/utilities/0_buffer.js +19 -0
- package/script/utilities/0_cache_map.d.ts +19 -0
- package/script/utilities/0_cache_map.js +19 -0
- package/script/utilities/0_color.d.ts +19 -0
- package/script/utilities/0_color.js +19 -0
- package/script/utilities/0_crypto.d.ts +19 -0
- package/script/utilities/0_crypto.js +19 -0
- package/script/utilities/0_hash.js +19 -0
- package/script/utilities/0_logger.d.ts +27 -0
- package/script/utilities/0_logger.js +30 -6
- package/script/utilities/0_mutex.d.ts +19 -0
- package/script/utilities/0_mutex.js +19 -0
- package/script/utilities/0_object.d.ts +19 -0
- package/script/utilities/0_object.js +19 -0
- package/script/utilities/0_rle.d.ts +19 -0
- package/script/utilities/0_rle.js +19 -0
- package/script/utilities/0_types.d.ts +19 -0
- package/script/utilities/0_types.js +19 -0
- package/script/utilities/1_auth.js +19 -0
- package/script/utilities/1_base64.d.ts +19 -0
- package/script/utilities/1_base64.js +19 -0
- package/script/utilities/1_math.d.ts +20 -0
- package/script/utilities/1_math.js +74 -0
- package/script/utilities/1_misc.d.ts +19 -0
- package/script/utilities/1_misc.js +21 -2
- package/script/utilities/1_queue.d.ts +19 -0
- package/script/utilities/1_queue.js +19 -0
- package/esm/deps/deno.land/x/tgcrypto@0.3.3/tgcrypto.js +0 -324
- package/esm/utilities/0_control.d.ts +0 -1
- package/esm/utilities/0_control.js +0 -3
- package/script/deps/deno.land/x/tgcrypto@0.3.3/tgcrypto.js +0 -326
- package/script/utilities/0_control.d.ts +0 -1
- package/script/utilities/0_control.js +0 -7
- /package/{LICENSE → COPYING.LESSER} +0 -0
- /package/esm/deps/deno.land/x/{tgcrypto@0.3.3 → tgcrypto@0.4.0}/tgcrypto.d.ts +0 -0
- /package/script/deps/deno.land/x/{tgcrypto@0.3.3 → tgcrypto@0.4.0}/tgcrypto.d.ts +0 -0
|
@@ -0,0 +1,301 @@
|
|
|
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
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
26
|
+
exports.attributeNames = exports.elementNames = void 0;
|
|
27
|
+
/*
|
|
28
|
+
* Module dependencies
|
|
29
|
+
*/
|
|
30
|
+
const ElementType = __importStar(require("./ElementType.js"));
|
|
31
|
+
const mod_js_1 = require("./utils/entities/mod.js");
|
|
32
|
+
/**
|
|
33
|
+
* Mixed-case SVG and MathML tags & attributes
|
|
34
|
+
* recognized by the HTML parser.
|
|
35
|
+
*
|
|
36
|
+
* @see https://html.spec.whatwg.org/multipage/parsing.html#parsing-main-inforeign
|
|
37
|
+
*/
|
|
38
|
+
exports.elementNames = new Map([
|
|
39
|
+
['altglyph', 'altGlyph'],
|
|
40
|
+
['altglyphdef', 'altGlyphDef'],
|
|
41
|
+
['altglyphitem', 'altGlyphItem'],
|
|
42
|
+
['animatecolor', 'animateColor'],
|
|
43
|
+
['animatemotion', 'animateMotion'],
|
|
44
|
+
['animatetransform', 'animateTransform'],
|
|
45
|
+
['clippath', 'clipPath'],
|
|
46
|
+
['feblend', 'feBlend'],
|
|
47
|
+
['fecolormatrix', 'feColorMatrix'],
|
|
48
|
+
['fecomponenttransfer', 'feComponentTransfer'],
|
|
49
|
+
['fecomposite', 'feComposite'],
|
|
50
|
+
['feconvolvematrix', 'feConvolveMatrix'],
|
|
51
|
+
['fediffuselighting', 'feDiffuseLighting'],
|
|
52
|
+
['fedisplacementmap', 'feDisplacementMap'],
|
|
53
|
+
['fedistantlight', 'feDistantLight'],
|
|
54
|
+
['fedropshadow', 'feDropShadow'],
|
|
55
|
+
['feflood', 'feFlood'],
|
|
56
|
+
['fefunca', 'feFuncA'],
|
|
57
|
+
['fefuncb', 'feFuncB'],
|
|
58
|
+
['fefuncg', 'feFuncG'],
|
|
59
|
+
['fefuncr', 'feFuncR'],
|
|
60
|
+
['fegaussianblur', 'feGaussianBlur'],
|
|
61
|
+
['feimage', 'feImage'],
|
|
62
|
+
['femerge', 'feMerge'],
|
|
63
|
+
['femergenode', 'feMergeNode'],
|
|
64
|
+
['femorphology', 'feMorphology'],
|
|
65
|
+
['feoffset', 'feOffset'],
|
|
66
|
+
['fepointlight', 'fePointLight'],
|
|
67
|
+
['fespecularlighting', 'feSpecularLighting'],
|
|
68
|
+
['fespotlight', 'feSpotLight'],
|
|
69
|
+
['fetile', 'feTile'],
|
|
70
|
+
['feturbulence', 'feTurbulence'],
|
|
71
|
+
['foreignobject', 'foreignObject'],
|
|
72
|
+
['glyphref', 'glyphRef'],
|
|
73
|
+
['lineargradient', 'linearGradient'],
|
|
74
|
+
['radialgradient', 'radialGradient'],
|
|
75
|
+
['textpath', 'textPath'],
|
|
76
|
+
]);
|
|
77
|
+
exports.attributeNames = new Map([
|
|
78
|
+
['definitionurl', 'definitionURL'],
|
|
79
|
+
['attributename', 'attributeName'],
|
|
80
|
+
['attributetype', 'attributeType'],
|
|
81
|
+
['basefrequency', 'baseFrequency'],
|
|
82
|
+
['baseprofile', 'baseProfile'],
|
|
83
|
+
['calcmode', 'calcMode'],
|
|
84
|
+
['clippathunits', 'clipPathUnits'],
|
|
85
|
+
['diffuseconstant', 'diffuseConstant'],
|
|
86
|
+
['edgemode', 'edgeMode'],
|
|
87
|
+
['filterunits', 'filterUnits'],
|
|
88
|
+
['glyphref', 'glyphRef'],
|
|
89
|
+
['gradienttransform', 'gradientTransform'],
|
|
90
|
+
['gradientunits', 'gradientUnits'],
|
|
91
|
+
['kernelmatrix', 'kernelMatrix'],
|
|
92
|
+
['kernelunitlength', 'kernelUnitLength'],
|
|
93
|
+
['keypoints', 'keyPoints'],
|
|
94
|
+
['keysplines', 'keySplines'],
|
|
95
|
+
['keytimes', 'keyTimes'],
|
|
96
|
+
['lengthadjust', 'lengthAdjust'],
|
|
97
|
+
['limitingconeangle', 'limitingConeAngle'],
|
|
98
|
+
['markerheight', 'markerHeight'],
|
|
99
|
+
['markerunits', 'markerUnits'],
|
|
100
|
+
['markerwidth', 'markerWidth'],
|
|
101
|
+
['maskcontentunits', 'maskContentUnits'],
|
|
102
|
+
['maskunits', 'maskUnits'],
|
|
103
|
+
['numoctaves', 'numOctaves'],
|
|
104
|
+
['pathlength', 'pathLength'],
|
|
105
|
+
['patterncontentunits', 'patternContentUnits'],
|
|
106
|
+
['patterntransform', 'patternTransform'],
|
|
107
|
+
['patternunits', 'patternUnits'],
|
|
108
|
+
['pointsatx', 'pointsAtX'],
|
|
109
|
+
['pointsaty', 'pointsAtY'],
|
|
110
|
+
['pointsatz', 'pointsAtZ'],
|
|
111
|
+
['preservealpha', 'preserveAlpha'],
|
|
112
|
+
['preserveaspectratio', 'preserveAspectRatio'],
|
|
113
|
+
['primitiveunits', 'primitiveUnits'],
|
|
114
|
+
['refx', 'refX'],
|
|
115
|
+
['refy', 'refY'],
|
|
116
|
+
['repeatcount', 'repeatCount'],
|
|
117
|
+
['repeatdur', 'repeatDur'],
|
|
118
|
+
['requiredextensions', 'requiredExtensions'],
|
|
119
|
+
['requiredfeatures', 'requiredFeatures'],
|
|
120
|
+
['specularconstant', 'specularConstant'],
|
|
121
|
+
['specularexponent', 'specularExponent'],
|
|
122
|
+
['spreadmethod', 'spreadMethod'],
|
|
123
|
+
['startoffset', 'startOffset'],
|
|
124
|
+
['stddeviation', 'stdDeviation'],
|
|
125
|
+
['stitchtiles', 'stitchTiles'],
|
|
126
|
+
['surfacescale', 'surfaceScale'],
|
|
127
|
+
['systemlanguage', 'systemLanguage'],
|
|
128
|
+
['tablevalues', 'tableValues'],
|
|
129
|
+
['targetx', 'targetX'],
|
|
130
|
+
['targety', 'targetY'],
|
|
131
|
+
['textlength', 'textLength'],
|
|
132
|
+
['viewbox', 'viewBox'],
|
|
133
|
+
['viewtarget', 'viewTarget'],
|
|
134
|
+
['xchannelselector', 'xChannelSelector'],
|
|
135
|
+
['ychannelselector', 'yChannelSelector'],
|
|
136
|
+
['zoomandpan', 'zoomAndPan'],
|
|
137
|
+
]);
|
|
138
|
+
const unencodedElements = new Set([
|
|
139
|
+
'style',
|
|
140
|
+
'script',
|
|
141
|
+
'xmp',
|
|
142
|
+
'iframe',
|
|
143
|
+
'noembed',
|
|
144
|
+
'noframes',
|
|
145
|
+
'plaintext',
|
|
146
|
+
'noscript',
|
|
147
|
+
]);
|
|
148
|
+
/**
|
|
149
|
+
* Format attributes
|
|
150
|
+
*/
|
|
151
|
+
function formatAttributes(attributes, opts) {
|
|
152
|
+
if (!attributes)
|
|
153
|
+
return;
|
|
154
|
+
return Object.keys(attributes)
|
|
155
|
+
.map(key => {
|
|
156
|
+
const value = attributes[key] ?? '';
|
|
157
|
+
if (opts.xmlMode === 'foreign') {
|
|
158
|
+
/* Fix up mixed-case attribute names */
|
|
159
|
+
key = exports.attributeNames.get(key) ?? key;
|
|
160
|
+
}
|
|
161
|
+
if (!opts.emptyAttrs && !opts.xmlMode && value === '') {
|
|
162
|
+
return key;
|
|
163
|
+
}
|
|
164
|
+
return `${key}="${opts.decodeEntities !== false
|
|
165
|
+
? (0, mod_js_1.encodeXML)(value)
|
|
166
|
+
: value.replace(/"/g, '"')}"`;
|
|
167
|
+
})
|
|
168
|
+
.join(' ');
|
|
169
|
+
}
|
|
170
|
+
/**
|
|
171
|
+
* Self-enclosing tags
|
|
172
|
+
*/
|
|
173
|
+
const singleTag = new Set([
|
|
174
|
+
'area',
|
|
175
|
+
'base',
|
|
176
|
+
'basefont',
|
|
177
|
+
'br',
|
|
178
|
+
'col',
|
|
179
|
+
'command',
|
|
180
|
+
'embed',
|
|
181
|
+
'frame',
|
|
182
|
+
'hr',
|
|
183
|
+
'img',
|
|
184
|
+
'input',
|
|
185
|
+
'isindex',
|
|
186
|
+
'keygen',
|
|
187
|
+
'link',
|
|
188
|
+
'meta',
|
|
189
|
+
'param',
|
|
190
|
+
'source',
|
|
191
|
+
'track',
|
|
192
|
+
'wbr',
|
|
193
|
+
]);
|
|
194
|
+
/**
|
|
195
|
+
* Renders a DOM node or an array of DOM nodes to a string.
|
|
196
|
+
*
|
|
197
|
+
* Can be thought of as the equivalent of the `outerHTML` of the passed node(s).
|
|
198
|
+
*
|
|
199
|
+
* @param node Node to be rendered.
|
|
200
|
+
* @param options Changes serialization behavior
|
|
201
|
+
*/
|
|
202
|
+
function render(node, options = {}) {
|
|
203
|
+
const nodes = 'length' in node ? node : [node];
|
|
204
|
+
let output = '';
|
|
205
|
+
for (let i = 0; i < nodes.length; i++) {
|
|
206
|
+
output += renderNode(nodes[i], options);
|
|
207
|
+
}
|
|
208
|
+
return output;
|
|
209
|
+
}
|
|
210
|
+
exports.default = render;
|
|
211
|
+
function renderNode(node, options) {
|
|
212
|
+
switch (node.type) {
|
|
213
|
+
case ElementType.Root:
|
|
214
|
+
return render(node.children, options);
|
|
215
|
+
case ElementType.Directive:
|
|
216
|
+
case ElementType.Doctype:
|
|
217
|
+
return renderDirective(node);
|
|
218
|
+
case ElementType.Comment:
|
|
219
|
+
return renderComment(node);
|
|
220
|
+
case ElementType.CDATA:
|
|
221
|
+
return renderCdata(node);
|
|
222
|
+
case ElementType.Script:
|
|
223
|
+
case ElementType.Style:
|
|
224
|
+
case ElementType.Tag:
|
|
225
|
+
return renderTag(node, options);
|
|
226
|
+
case ElementType.Text:
|
|
227
|
+
return renderText(node, options);
|
|
228
|
+
}
|
|
229
|
+
}
|
|
230
|
+
const foreignModeIntegrationPoints = new Set([
|
|
231
|
+
'mi',
|
|
232
|
+
'mo',
|
|
233
|
+
'mn',
|
|
234
|
+
'ms',
|
|
235
|
+
'mtext',
|
|
236
|
+
'annotation-xml',
|
|
237
|
+
'foreignObject',
|
|
238
|
+
'desc',
|
|
239
|
+
'title',
|
|
240
|
+
]);
|
|
241
|
+
const foreignElements = new Set(['svg', 'math']);
|
|
242
|
+
function renderTag(elem, opts) {
|
|
243
|
+
// Handle SVG / MathML in HTML
|
|
244
|
+
if (opts.xmlMode === 'foreign') {
|
|
245
|
+
/* Fix up mixed-case element names */
|
|
246
|
+
elem.name = exports.elementNames.get(elem.name) ?? elem.name;
|
|
247
|
+
/* Exit foreign mode at integration points */
|
|
248
|
+
if (elem.parent &&
|
|
249
|
+
foreignModeIntegrationPoints.has(elem.parent.name)) {
|
|
250
|
+
opts = { ...opts, xmlMode: false };
|
|
251
|
+
}
|
|
252
|
+
}
|
|
253
|
+
if (!opts.xmlMode && foreignElements.has(elem.name)) {
|
|
254
|
+
opts = { ...opts, xmlMode: 'foreign' };
|
|
255
|
+
}
|
|
256
|
+
let tag = `<${elem.name}`;
|
|
257
|
+
const attribs = formatAttributes(elem.attribs, opts);
|
|
258
|
+
if (attribs) {
|
|
259
|
+
tag += ` ${attribs}`;
|
|
260
|
+
}
|
|
261
|
+
if (elem.children.length === 0 &&
|
|
262
|
+
(opts.xmlMode
|
|
263
|
+
? // In XML mode or foreign mode, and user hasn't explicitly turned off self-closing tags
|
|
264
|
+
opts.selfClosingTags !== false
|
|
265
|
+
: // User explicitly asked for self-closing tags, even in HTML mode
|
|
266
|
+
opts.selfClosingTags && singleTag.has(elem.name))) {
|
|
267
|
+
if (!opts.xmlMode)
|
|
268
|
+
tag += ' ';
|
|
269
|
+
tag += '/>';
|
|
270
|
+
}
|
|
271
|
+
else {
|
|
272
|
+
tag += '>';
|
|
273
|
+
if (elem.children.length > 0) {
|
|
274
|
+
tag += render(elem.children, opts);
|
|
275
|
+
}
|
|
276
|
+
if (opts.xmlMode || !singleTag.has(elem.name)) {
|
|
277
|
+
tag += `</${elem.name}>`;
|
|
278
|
+
}
|
|
279
|
+
}
|
|
280
|
+
return tag;
|
|
281
|
+
}
|
|
282
|
+
function renderDirective(elem) {
|
|
283
|
+
return `<${elem.data}>`;
|
|
284
|
+
}
|
|
285
|
+
function renderText(elem, opts) {
|
|
286
|
+
let data = elem.data || '';
|
|
287
|
+
// If entities weren't decoded, no need to encode them back
|
|
288
|
+
if (opts.decodeEntities !== false &&
|
|
289
|
+
!(!opts.xmlMode &&
|
|
290
|
+
elem.parent &&
|
|
291
|
+
unencodedElements.has(elem.parent.name))) {
|
|
292
|
+
data = (0, mod_js_1.encodeXML)(data);
|
|
293
|
+
}
|
|
294
|
+
return data;
|
|
295
|
+
}
|
|
296
|
+
function renderCdata(elem) {
|
|
297
|
+
return `<![CDATA[${elem.children[0].data}]]>`;
|
|
298
|
+
}
|
|
299
|
+
function renderComment(elem) {
|
|
300
|
+
return `<!--${elem.data}-->`;
|
|
301
|
+
}
|
|
@@ -0,0 +1,47 @@
|
|
|
1
|
+
/** Types of elements found in htmlparser2's DOM */
|
|
2
|
+
export declare enum ElementType {
|
|
3
|
+
/** Type for the root element of a document */
|
|
4
|
+
Root = "root",
|
|
5
|
+
/** Type for Text */
|
|
6
|
+
Text = "text",
|
|
7
|
+
/** Type for <? ... ?> */
|
|
8
|
+
Directive = "directive",
|
|
9
|
+
/** Type for <!-- ... --> */
|
|
10
|
+
Comment = "comment",
|
|
11
|
+
/** Type for <script> tags */
|
|
12
|
+
Script = "script",
|
|
13
|
+
/** Type for <style> tags */
|
|
14
|
+
Style = "style",
|
|
15
|
+
/** Type for Any tag */
|
|
16
|
+
Tag = "tag",
|
|
17
|
+
/** Type for <![CDATA[ ... ]]> */
|
|
18
|
+
CDATA = "cdata",
|
|
19
|
+
/** Type for <!doctype ...> */
|
|
20
|
+
Doctype = "doctype"
|
|
21
|
+
}
|
|
22
|
+
/**
|
|
23
|
+
* Tests whether an element is a tag or not.
|
|
24
|
+
*
|
|
25
|
+
* @param elem Element to test
|
|
26
|
+
*/
|
|
27
|
+
export declare function isTag(elem: {
|
|
28
|
+
type: ElementType;
|
|
29
|
+
}): boolean;
|
|
30
|
+
/** Type for the root element of a document */
|
|
31
|
+
export declare const Root = ElementType.Root;
|
|
32
|
+
/** Type for Text */
|
|
33
|
+
export declare const Text = ElementType.Text;
|
|
34
|
+
/** Type for <? ... ?> */
|
|
35
|
+
export declare const Directive = ElementType.Directive;
|
|
36
|
+
/** Type for <!-- ... --> */
|
|
37
|
+
export declare const Comment = ElementType.Comment;
|
|
38
|
+
/** Type for <script> tags */
|
|
39
|
+
export declare const Script = ElementType.Script;
|
|
40
|
+
/** Type for <style> tags */
|
|
41
|
+
export declare const Style = ElementType.Style;
|
|
42
|
+
/** Type for Any tag */
|
|
43
|
+
export declare const Tag = ElementType.Tag;
|
|
44
|
+
/** Type for <![CDATA[ ... ]]> */
|
|
45
|
+
export declare const CDATA = ElementType.CDATA;
|
|
46
|
+
/** Type for <!doctype ...> */
|
|
47
|
+
export declare const Doctype = ElementType.Doctype;
|
|
@@ -0,0 +1,55 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.Doctype = exports.CDATA = exports.Tag = exports.Style = exports.Script = exports.Comment = exports.Directive = exports.Text = exports.Root = exports.isTag = exports.ElementType = void 0;
|
|
4
|
+
/** Types of elements found in htmlparser2's DOM */
|
|
5
|
+
var ElementType;
|
|
6
|
+
(function (ElementType) {
|
|
7
|
+
/** Type for the root element of a document */
|
|
8
|
+
ElementType["Root"] = "root";
|
|
9
|
+
/** Type for Text */
|
|
10
|
+
ElementType["Text"] = "text";
|
|
11
|
+
/** Type for <? ... ?> */
|
|
12
|
+
ElementType["Directive"] = "directive";
|
|
13
|
+
/** Type for <!-- ... --> */
|
|
14
|
+
ElementType["Comment"] = "comment";
|
|
15
|
+
/** Type for <script> tags */
|
|
16
|
+
ElementType["Script"] = "script";
|
|
17
|
+
/** Type for <style> tags */
|
|
18
|
+
ElementType["Style"] = "style";
|
|
19
|
+
/** Type for Any tag */
|
|
20
|
+
ElementType["Tag"] = "tag";
|
|
21
|
+
/** Type for <![CDATA[ ... ]]> */
|
|
22
|
+
ElementType["CDATA"] = "cdata";
|
|
23
|
+
/** Type for <!doctype ...> */
|
|
24
|
+
ElementType["Doctype"] = "doctype";
|
|
25
|
+
})(ElementType || (exports.ElementType = ElementType = {}));
|
|
26
|
+
/**
|
|
27
|
+
* Tests whether an element is a tag or not.
|
|
28
|
+
*
|
|
29
|
+
* @param elem Element to test
|
|
30
|
+
*/
|
|
31
|
+
function isTag(elem) {
|
|
32
|
+
return (elem.type === ElementType.Tag ||
|
|
33
|
+
elem.type === ElementType.Script ||
|
|
34
|
+
elem.type === ElementType.Style);
|
|
35
|
+
}
|
|
36
|
+
exports.isTag = isTag;
|
|
37
|
+
// Exports for backwards compatibility
|
|
38
|
+
/** Type for the root element of a document */
|
|
39
|
+
exports.Root = ElementType.Root;
|
|
40
|
+
/** Type for Text */
|
|
41
|
+
exports.Text = ElementType.Text;
|
|
42
|
+
/** Type for <? ... ?> */
|
|
43
|
+
exports.Directive = ElementType.Directive;
|
|
44
|
+
/** Type for <!-- ... --> */
|
|
45
|
+
exports.Comment = ElementType.Comment;
|
|
46
|
+
/** Type for <script> tags */
|
|
47
|
+
exports.Script = ElementType.Script;
|
|
48
|
+
/** Type for <style> tags */
|
|
49
|
+
exports.Style = ElementType.Style;
|
|
50
|
+
/** Type for Any tag */
|
|
51
|
+
exports.Tag = ElementType.Tag;
|
|
52
|
+
/** Type for <![CDATA[ ... ]]> */
|
|
53
|
+
exports.CDATA = ElementType.CDATA;
|
|
54
|
+
/** Type for <!doctype ...> */
|
|
55
|
+
exports.Doctype = ElementType.Doctype;
|
|
@@ -0,0 +1,66 @@
|
|
|
1
|
+
import DomHandler, { DomHandlerOptions } from './DomHandler.js';
|
|
2
|
+
import { ParserOptions } from './Parser.js';
|
|
3
|
+
declare enum FeedItemMediaMedium {
|
|
4
|
+
image = 0,
|
|
5
|
+
audio = 1,
|
|
6
|
+
video = 2,
|
|
7
|
+
document = 3,
|
|
8
|
+
executable = 4
|
|
9
|
+
}
|
|
10
|
+
declare enum FeedItemMediaExpression {
|
|
11
|
+
sample = 0,
|
|
12
|
+
full = 1,
|
|
13
|
+
nonstop = 2
|
|
14
|
+
}
|
|
15
|
+
interface FeedItemMedia {
|
|
16
|
+
url?: string;
|
|
17
|
+
fileSize?: number;
|
|
18
|
+
type?: string;
|
|
19
|
+
medium: FeedItemMediaMedium | undefined;
|
|
20
|
+
isDefault: boolean;
|
|
21
|
+
expression?: FeedItemMediaExpression;
|
|
22
|
+
bitrate?: number;
|
|
23
|
+
framerate?: number;
|
|
24
|
+
samplingrate?: number;
|
|
25
|
+
channels?: number;
|
|
26
|
+
duration?: number;
|
|
27
|
+
height?: number;
|
|
28
|
+
width?: number;
|
|
29
|
+
lang?: string;
|
|
30
|
+
}
|
|
31
|
+
interface FeedItem {
|
|
32
|
+
id?: string;
|
|
33
|
+
title?: string;
|
|
34
|
+
link?: string;
|
|
35
|
+
description?: string;
|
|
36
|
+
pubDate?: Date;
|
|
37
|
+
media?: FeedItemMedia[];
|
|
38
|
+
}
|
|
39
|
+
interface Feed {
|
|
40
|
+
type?: string;
|
|
41
|
+
id?: string;
|
|
42
|
+
title?: string;
|
|
43
|
+
link?: string;
|
|
44
|
+
description?: string;
|
|
45
|
+
updated?: Date;
|
|
46
|
+
author?: string;
|
|
47
|
+
items?: FeedItem[];
|
|
48
|
+
}
|
|
49
|
+
export declare class FeedHandler extends DomHandler {
|
|
50
|
+
feed?: Feed;
|
|
51
|
+
/**
|
|
52
|
+
*
|
|
53
|
+
* @param callback
|
|
54
|
+
* @param options
|
|
55
|
+
*/
|
|
56
|
+
constructor(callback?: ((error: Error | null) => void) | DomHandlerOptions, options?: DomHandlerOptions);
|
|
57
|
+
onend(): void;
|
|
58
|
+
}
|
|
59
|
+
/**
|
|
60
|
+
* Parse a feed.
|
|
61
|
+
*
|
|
62
|
+
* @param feed The feed that should be parsed, as a string.
|
|
63
|
+
* @param options Optionally, options for parsing. When using this option, you should set `xmlMode` to `true`.
|
|
64
|
+
*/
|
|
65
|
+
export declare function parseFeed(feed: string, options?: ParserOptions & DomHandlerOptions): Feed | undefined;
|
|
66
|
+
export {};
|
|
@@ -0,0 +1,222 @@
|
|
|
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 __importDefault = (this && this.__importDefault) || function (mod) {
|
|
26
|
+
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
27
|
+
};
|
|
28
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
29
|
+
exports.parseFeed = exports.FeedHandler = void 0;
|
|
30
|
+
const DomHandler_js_1 = __importDefault(require("./DomHandler.js"));
|
|
31
|
+
const DomUtils = __importStar(require("./utils/mod.js"));
|
|
32
|
+
const Parser_js_1 = require("./Parser.js");
|
|
33
|
+
var FeedItemMediaMedium;
|
|
34
|
+
(function (FeedItemMediaMedium) {
|
|
35
|
+
FeedItemMediaMedium[FeedItemMediaMedium["image"] = 0] = "image";
|
|
36
|
+
FeedItemMediaMedium[FeedItemMediaMedium["audio"] = 1] = "audio";
|
|
37
|
+
FeedItemMediaMedium[FeedItemMediaMedium["video"] = 2] = "video";
|
|
38
|
+
FeedItemMediaMedium[FeedItemMediaMedium["document"] = 3] = "document";
|
|
39
|
+
FeedItemMediaMedium[FeedItemMediaMedium["executable"] = 4] = "executable";
|
|
40
|
+
})(FeedItemMediaMedium || (FeedItemMediaMedium = {}));
|
|
41
|
+
var FeedItemMediaExpression;
|
|
42
|
+
(function (FeedItemMediaExpression) {
|
|
43
|
+
FeedItemMediaExpression[FeedItemMediaExpression["sample"] = 0] = "sample";
|
|
44
|
+
FeedItemMediaExpression[FeedItemMediaExpression["full"] = 1] = "full";
|
|
45
|
+
FeedItemMediaExpression[FeedItemMediaExpression["nonstop"] = 2] = "nonstop";
|
|
46
|
+
})(FeedItemMediaExpression || (FeedItemMediaExpression = {}));
|
|
47
|
+
// TODO: Consume data as it is coming in
|
|
48
|
+
class FeedHandler extends DomHandler_js_1.default {
|
|
49
|
+
/**
|
|
50
|
+
*
|
|
51
|
+
* @param callback
|
|
52
|
+
* @param options
|
|
53
|
+
*/
|
|
54
|
+
constructor(callback, options) {
|
|
55
|
+
if (typeof callback === 'object') {
|
|
56
|
+
callback = undefined;
|
|
57
|
+
options = callback;
|
|
58
|
+
}
|
|
59
|
+
super(callback, options);
|
|
60
|
+
Object.defineProperty(this, "feed", {
|
|
61
|
+
enumerable: true,
|
|
62
|
+
configurable: true,
|
|
63
|
+
writable: true,
|
|
64
|
+
value: void 0
|
|
65
|
+
});
|
|
66
|
+
}
|
|
67
|
+
onend() {
|
|
68
|
+
const feedRoot = getOneElement(isValidFeed, this.dom);
|
|
69
|
+
if (!feedRoot) {
|
|
70
|
+
this.handleCallback(new Error("couldn't find root of feed"));
|
|
71
|
+
return;
|
|
72
|
+
}
|
|
73
|
+
const feed = {};
|
|
74
|
+
if (feedRoot.name === 'feed') {
|
|
75
|
+
const childs = feedRoot.children;
|
|
76
|
+
feed.type = 'atom';
|
|
77
|
+
addConditionally(feed, 'id', 'id', childs);
|
|
78
|
+
addConditionally(feed, 'title', 'title', childs);
|
|
79
|
+
const href = getAttribute('href', getOneElement('link', childs));
|
|
80
|
+
if (href) {
|
|
81
|
+
feed.link = href;
|
|
82
|
+
}
|
|
83
|
+
addConditionally(feed, 'description', 'subtitle', childs);
|
|
84
|
+
const updated = fetch('updated', childs);
|
|
85
|
+
if (updated) {
|
|
86
|
+
feed.updated = new Date(updated);
|
|
87
|
+
}
|
|
88
|
+
addConditionally(feed, 'author', 'email', childs, true);
|
|
89
|
+
feed.items = getElements('entry', childs).map(item => {
|
|
90
|
+
const entry = {};
|
|
91
|
+
const { children } = item;
|
|
92
|
+
addConditionally(entry, 'id', 'id', children);
|
|
93
|
+
addConditionally(entry, 'title', 'title', children);
|
|
94
|
+
const href = getAttribute('href', getOneElement('link', children));
|
|
95
|
+
if (href) {
|
|
96
|
+
entry.link = href;
|
|
97
|
+
}
|
|
98
|
+
const description = fetch('summary', children) || fetch('content', children);
|
|
99
|
+
if (description) {
|
|
100
|
+
entry.description = description;
|
|
101
|
+
}
|
|
102
|
+
const pubDate = fetch('updated', children);
|
|
103
|
+
if (pubDate) {
|
|
104
|
+
entry.pubDate = new Date(pubDate);
|
|
105
|
+
}
|
|
106
|
+
entry.media = getMediaElements(children);
|
|
107
|
+
return entry;
|
|
108
|
+
});
|
|
109
|
+
}
|
|
110
|
+
else {
|
|
111
|
+
const childs = getOneElement('channel', feedRoot.children)?.children ?? [];
|
|
112
|
+
feed.type = feedRoot.name.substr(0, 3);
|
|
113
|
+
feed.id = '';
|
|
114
|
+
addConditionally(feed, 'title', 'title', childs);
|
|
115
|
+
addConditionally(feed, 'link', 'link', childs);
|
|
116
|
+
addConditionally(feed, 'description', 'description', childs);
|
|
117
|
+
const updated = fetch('lastBuildDate', childs);
|
|
118
|
+
if (updated) {
|
|
119
|
+
feed.updated = new Date(updated);
|
|
120
|
+
}
|
|
121
|
+
addConditionally(feed, 'author', 'managingEditor', childs, true);
|
|
122
|
+
feed.items = getElements('item', feedRoot.children).map((item) => {
|
|
123
|
+
const entry = {};
|
|
124
|
+
const { children } = item;
|
|
125
|
+
addConditionally(entry, 'id', 'guid', children);
|
|
126
|
+
addConditionally(entry, 'title', 'title', children);
|
|
127
|
+
addConditionally(entry, 'link', 'link', children);
|
|
128
|
+
addConditionally(entry, 'description', 'description', children);
|
|
129
|
+
const pubDate = fetch('pubDate', children);
|
|
130
|
+
if (pubDate)
|
|
131
|
+
entry.pubDate = new Date(pubDate);
|
|
132
|
+
entry.media = getMediaElements(children);
|
|
133
|
+
return entry;
|
|
134
|
+
});
|
|
135
|
+
}
|
|
136
|
+
this.feed = feed;
|
|
137
|
+
this.handleCallback(null);
|
|
138
|
+
}
|
|
139
|
+
}
|
|
140
|
+
exports.FeedHandler = FeedHandler;
|
|
141
|
+
function getMediaElements(where) {
|
|
142
|
+
return getElements('media:content', where).map(elem => {
|
|
143
|
+
const media = {
|
|
144
|
+
medium: elem.attribs.medium,
|
|
145
|
+
isDefault: !!elem.attribs.isDefault,
|
|
146
|
+
};
|
|
147
|
+
if (elem.attribs.url) {
|
|
148
|
+
media.url = elem.attribs.url;
|
|
149
|
+
}
|
|
150
|
+
if (elem.attribs.fileSize) {
|
|
151
|
+
media.fileSize = parseInt(elem.attribs.fileSize, 10);
|
|
152
|
+
}
|
|
153
|
+
if (elem.attribs.type) {
|
|
154
|
+
media.type = elem.attribs.type;
|
|
155
|
+
}
|
|
156
|
+
if (elem.attribs.expression) {
|
|
157
|
+
media.expression = elem.attribs
|
|
158
|
+
.expression;
|
|
159
|
+
}
|
|
160
|
+
if (elem.attribs.bitrate) {
|
|
161
|
+
media.bitrate = parseInt(elem.attribs.bitrate, 10);
|
|
162
|
+
}
|
|
163
|
+
if (elem.attribs.framerate) {
|
|
164
|
+
media.framerate = parseInt(elem.attribs.framerate, 10);
|
|
165
|
+
}
|
|
166
|
+
if (elem.attribs.samplingrate) {
|
|
167
|
+
media.samplingrate = parseInt(elem.attribs.samplingrate, 10);
|
|
168
|
+
}
|
|
169
|
+
if (elem.attribs.channels) {
|
|
170
|
+
media.channels = parseInt(elem.attribs.channels, 10);
|
|
171
|
+
}
|
|
172
|
+
if (elem.attribs.duration) {
|
|
173
|
+
media.duration = parseInt(elem.attribs.duration, 10);
|
|
174
|
+
}
|
|
175
|
+
if (elem.attribs.height) {
|
|
176
|
+
media.height = parseInt(elem.attribs.height, 10);
|
|
177
|
+
}
|
|
178
|
+
if (elem.attribs.width) {
|
|
179
|
+
media.width = parseInt(elem.attribs.width, 10);
|
|
180
|
+
}
|
|
181
|
+
if (elem.attribs.lang) {
|
|
182
|
+
media.lang = elem.attribs.lang;
|
|
183
|
+
}
|
|
184
|
+
return media;
|
|
185
|
+
});
|
|
186
|
+
}
|
|
187
|
+
function getElements(tagName, where) {
|
|
188
|
+
return DomUtils.getElementsByTagName(tagName, where, true);
|
|
189
|
+
}
|
|
190
|
+
function getOneElement(tagName, node) {
|
|
191
|
+
return DomUtils.getElementsByTagName(tagName, node, true, 1)[0];
|
|
192
|
+
}
|
|
193
|
+
function fetch(tagName, where, recurse = false) {
|
|
194
|
+
return DomUtils.getText(DomUtils.getElementsByTagName(tagName, where, recurse, 1)).trim();
|
|
195
|
+
}
|
|
196
|
+
function getAttribute(name, elem) {
|
|
197
|
+
if (!elem) {
|
|
198
|
+
return null;
|
|
199
|
+
}
|
|
200
|
+
const { attribs } = elem;
|
|
201
|
+
return attribs[name];
|
|
202
|
+
}
|
|
203
|
+
function addConditionally(obj, prop, what, where, recurse = false) {
|
|
204
|
+
const tmp = fetch(what, where, recurse);
|
|
205
|
+
if (tmp)
|
|
206
|
+
obj[prop] = tmp;
|
|
207
|
+
}
|
|
208
|
+
function isValidFeed(value) {
|
|
209
|
+
return value === 'rss' || value === 'feed' || value === 'rdf:RDF';
|
|
210
|
+
}
|
|
211
|
+
/**
|
|
212
|
+
* Parse a feed.
|
|
213
|
+
*
|
|
214
|
+
* @param feed The feed that should be parsed, as a string.
|
|
215
|
+
* @param options Optionally, options for parsing. When using this option, you should set `xmlMode` to `true`.
|
|
216
|
+
*/
|
|
217
|
+
function parseFeed(feed, options = { xmlMode: true }) {
|
|
218
|
+
const handler = new FeedHandler(options);
|
|
219
|
+
new Parser_js_1.Parser(handler, options).end(feed);
|
|
220
|
+
return handler.feed;
|
|
221
|
+
}
|
|
222
|
+
exports.parseFeed = parseFeed;
|