@mtkruto/node 0.1.200 → 0.1.289
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/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 +24 -8
- package/esm/client/4_client.js +40 -29
- 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/{tgcrypto@0.3.3 → 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/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 +24 -8
- package/script/client/4_client.js +38 -27
- 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/{tgcrypto@0.3.3 → 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/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/html_parser@v0.1.3/src/DomHandler.d.ts +0 -83
- package/esm/deps/deno.land/x/html_parser@v0.1.3/src/DomHandler.js +0 -203
- package/esm/deps/deno.land/x/html_parser@v0.1.3/src/DomSerializer.d.ts +0 -50
- package/esm/deps/deno.land/x/html_parser@v0.1.3/src/DomSerializer.js +0 -274
- package/esm/deps/deno.land/x/html_parser@v0.1.3/src/ElementType.d.ts +0 -47
- package/esm/deps/deno.land/x/html_parser@v0.1.3/src/ElementType.js +0 -51
- package/esm/deps/deno.land/x/html_parser@v0.1.3/src/FeedHandler.d.ts +0 -66
- package/esm/deps/deno.land/x/html_parser@v0.1.3/src/FeedHandler.js +0 -191
- package/esm/deps/deno.land/x/html_parser@v0.1.3/src/Node.d.ts +0 -168
- package/esm/deps/deno.land/x/html_parser@v0.1.3/src/Node.js +0 -385
- package/esm/deps/deno.land/x/html_parser@v0.1.3/src/Parser.d.ts +0 -159
- package/esm/deps/deno.land/x/html_parser@v0.1.3/src/Parser.js +0 -431
- package/esm/deps/deno.land/x/html_parser@v0.1.3/src/Tokenizer.d.ts +0 -181
- package/esm/deps/deno.land/x/html_parser@v0.1.3/src/Tokenizer.js +0 -1046
- package/esm/deps/deno.land/x/html_parser@v0.1.3/src/mod.d.ts +0 -42
- package/esm/deps/deno.land/x/html_parser@v0.1.3/src/mod.js +0 -52
- package/esm/deps/deno.land/x/html_parser@v0.1.3/src/utils/entities/decode.d.ts +0 -11
- package/esm/deps/deno.land/x/html_parser@v0.1.3/src/utils/entities/decode.js +0 -122
- package/esm/deps/deno.land/x/html_parser@v0.1.3/src/utils/entities/decode_codepoint.d.ts +0 -1
- package/esm/deps/deno.land/x/html_parser@v0.1.3/src/utils/entities/decode_codepoint.js +0 -24
- package/esm/deps/deno.land/x/html_parser@v0.1.3/src/utils/entities/encode.d.ts +0 -46
- package/esm/deps/deno.land/x/html_parser@v0.1.3/src/utils/entities/encode.js +0 -121
- package/esm/deps/deno.land/x/html_parser@v0.1.3/src/utils/entities/maps/decode.d.ts +0 -31
- package/esm/deps/deno.land/x/html_parser@v0.1.3/src/utils/entities/maps/decode.js +0 -30
- package/esm/deps/deno.land/x/html_parser@v0.1.3/src/utils/entities/maps/entities.d.ts +0 -2128
- package/esm/deps/deno.land/x/html_parser@v0.1.3/src/utils/entities/maps/entities.js +0 -2127
- package/esm/deps/deno.land/x/html_parser@v0.1.3/src/utils/entities/maps/legacy.d.ts +0 -109
- package/esm/deps/deno.land/x/html_parser@v0.1.3/src/utils/entities/maps/legacy.js +0 -108
- package/esm/deps/deno.land/x/html_parser@v0.1.3/src/utils/entities/maps/xml.d.ts +0 -8
- package/esm/deps/deno.land/x/html_parser@v0.1.3/src/utils/entities/maps/xml.js +0 -1
- package/esm/deps/deno.land/x/html_parser@v0.1.3/src/utils/entities/mod.d.ts +0 -90
- package/esm/deps/deno.land/x/html_parser@v0.1.3/src/utils/entities/mod.js +0 -95
- package/esm/deps/deno.land/x/html_parser@v0.1.3/src/utils/helpers.d.ts +0 -50
- package/esm/deps/deno.land/x/html_parser@v0.1.3/src/utils/helpers.js +0 -128
- package/esm/deps/deno.land/x/html_parser@v0.1.3/src/utils/legacy.d.ts +0 -46
- package/esm/deps/deno.land/x/html_parser@v0.1.3/src/utils/legacy.js +0 -110
- package/esm/deps/deno.land/x/html_parser@v0.1.3/src/utils/manipulation.d.ts +0 -42
- package/esm/deps/deno.land/x/html_parser@v0.1.3/src/utils/manipulation.js +0 -120
- package/esm/deps/deno.land/x/html_parser@v0.1.3/src/utils/mod.d.ts +0 -6
- package/esm/deps/deno.land/x/html_parser@v0.1.3/src/utils/mod.js +0 -6
- package/esm/deps/deno.land/x/html_parser@v0.1.3/src/utils/querying.d.ts +0 -54
- package/esm/deps/deno.land/x/html_parser@v0.1.3/src/utils/querying.js +0 -110
- package/esm/deps/deno.land/x/html_parser@v0.1.3/src/utils/stringify.d.ts +0 -40
- package/esm/deps/deno.land/x/html_parser@v0.1.3/src/utils/stringify.js +0 -75
- package/esm/deps/deno.land/x/html_parser@v0.1.3/src/utils/traversal.d.ts +0 -58
- package/esm/deps/deno.land/x/html_parser@v0.1.3/src/utils/traversal.js +0 -101
- 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/html_parser@v0.1.3/src/DomHandler.d.ts +0 -83
- package/script/deps/deno.land/x/html_parser@v0.1.3/src/DomHandler.js +0 -207
- package/script/deps/deno.land/x/html_parser@v0.1.3/src/DomSerializer.d.ts +0 -50
- package/script/deps/deno.land/x/html_parser@v0.1.3/src/DomSerializer.js +0 -301
- package/script/deps/deno.land/x/html_parser@v0.1.3/src/ElementType.d.ts +0 -47
- package/script/deps/deno.land/x/html_parser@v0.1.3/src/ElementType.js +0 -55
- package/script/deps/deno.land/x/html_parser@v0.1.3/src/FeedHandler.d.ts +0 -66
- package/script/deps/deno.land/x/html_parser@v0.1.3/src/FeedHandler.js +0 -222
- package/script/deps/deno.land/x/html_parser@v0.1.3/src/Node.d.ts +0 -168
- package/script/deps/deno.land/x/html_parser@v0.1.3/src/Node.js +0 -404
- package/script/deps/deno.land/x/html_parser@v0.1.3/src/Parser.d.ts +0 -159
- package/script/deps/deno.land/x/html_parser@v0.1.3/src/Parser.js +0 -438
- package/script/deps/deno.land/x/html_parser@v0.1.3/src/Tokenizer.d.ts +0 -181
- package/script/deps/deno.land/x/html_parser@v0.1.3/src/Tokenizer.js +0 -1052
- package/script/deps/deno.land/x/html_parser@v0.1.3/src/mod.d.ts +0 -42
- package/script/deps/deno.land/x/html_parser@v0.1.3/src/mod.js +0 -88
- package/script/deps/deno.land/x/html_parser@v0.1.3/src/utils/entities/decode.d.ts +0 -11
- package/script/deps/deno.land/x/html_parser@v0.1.3/src/utils/entities/decode.js +0 -128
- package/script/deps/deno.land/x/html_parser@v0.1.3/src/utils/entities/decode_codepoint.d.ts +0 -1
- package/script/deps/deno.land/x/html_parser@v0.1.3/src/utils/entities/decode_codepoint.js +0 -30
- package/script/deps/deno.land/x/html_parser@v0.1.3/src/utils/entities/encode.d.ts +0 -46
- package/script/deps/deno.land/x/html_parser@v0.1.3/src/utils/entities/encode.js +0 -129
- package/script/deps/deno.land/x/html_parser@v0.1.3/src/utils/entities/maps/decode.d.ts +0 -31
- package/script/deps/deno.land/x/html_parser@v0.1.3/src/utils/entities/maps/decode.js +0 -32
- package/script/deps/deno.land/x/html_parser@v0.1.3/src/utils/entities/maps/entities.d.ts +0 -2128
- package/script/deps/deno.land/x/html_parser@v0.1.3/src/utils/entities/maps/entities.js +0 -2129
- package/script/deps/deno.land/x/html_parser@v0.1.3/src/utils/entities/maps/legacy.d.ts +0 -109
- package/script/deps/deno.land/x/html_parser@v0.1.3/src/utils/entities/maps/legacy.js +0 -110
- package/script/deps/deno.land/x/html_parser@v0.1.3/src/utils/entities/maps/xml.d.ts +0 -8
- package/script/deps/deno.land/x/html_parser@v0.1.3/src/utils/entities/maps/xml.js +0 -3
- package/script/deps/deno.land/x/html_parser@v0.1.3/src/utils/entities/mod.d.ts +0 -90
- package/script/deps/deno.land/x/html_parser@v0.1.3/src/utils/entities/mod.js +0 -114
- package/script/deps/deno.land/x/html_parser@v0.1.3/src/utils/helpers.d.ts +0 -50
- package/script/deps/deno.land/x/html_parser@v0.1.3/src/utils/helpers.js +0 -134
- package/script/deps/deno.land/x/html_parser@v0.1.3/src/utils/legacy.d.ts +0 -46
- package/script/deps/deno.land/x/html_parser@v0.1.3/src/utils/legacy.js +0 -118
- package/script/deps/deno.land/x/html_parser@v0.1.3/src/utils/manipulation.d.ts +0 -42
- package/script/deps/deno.land/x/html_parser@v0.1.3/src/utils/manipulation.js +0 -129
- package/script/deps/deno.land/x/html_parser@v0.1.3/src/utils/mod.d.ts +0 -6
- package/script/deps/deno.land/x/html_parser@v0.1.3/src/utils/mod.js +0 -22
- package/script/deps/deno.land/x/html_parser@v0.1.3/src/utils/querying.d.ts +0 -54
- package/script/deps/deno.land/x/html_parser@v0.1.3/src/utils/querying.js +0 -119
- package/script/deps/deno.land/x/html_parser@v0.1.3/src/utils/stringify.d.ts +0 -40
- package/script/deps/deno.land/x/html_parser@v0.1.3/src/utils/stringify.js +0 -86
- package/script/deps/deno.land/x/html_parser@v0.1.3/src/utils/traversal.d.ts +0 -58
- package/script/deps/deno.land/x/html_parser@v0.1.3/src/utils/traversal.js +0 -112
- 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
|
@@ -1,191 +0,0 @@
|
|
|
1
|
-
import DomHandler from './DomHandler.js';
|
|
2
|
-
import * as DomUtils from './utils/mod.js';
|
|
3
|
-
import { Parser } from './Parser.js';
|
|
4
|
-
var FeedItemMediaMedium;
|
|
5
|
-
(function (FeedItemMediaMedium) {
|
|
6
|
-
FeedItemMediaMedium[FeedItemMediaMedium["image"] = 0] = "image";
|
|
7
|
-
FeedItemMediaMedium[FeedItemMediaMedium["audio"] = 1] = "audio";
|
|
8
|
-
FeedItemMediaMedium[FeedItemMediaMedium["video"] = 2] = "video";
|
|
9
|
-
FeedItemMediaMedium[FeedItemMediaMedium["document"] = 3] = "document";
|
|
10
|
-
FeedItemMediaMedium[FeedItemMediaMedium["executable"] = 4] = "executable";
|
|
11
|
-
})(FeedItemMediaMedium || (FeedItemMediaMedium = {}));
|
|
12
|
-
var FeedItemMediaExpression;
|
|
13
|
-
(function (FeedItemMediaExpression) {
|
|
14
|
-
FeedItemMediaExpression[FeedItemMediaExpression["sample"] = 0] = "sample";
|
|
15
|
-
FeedItemMediaExpression[FeedItemMediaExpression["full"] = 1] = "full";
|
|
16
|
-
FeedItemMediaExpression[FeedItemMediaExpression["nonstop"] = 2] = "nonstop";
|
|
17
|
-
})(FeedItemMediaExpression || (FeedItemMediaExpression = {}));
|
|
18
|
-
// TODO: Consume data as it is coming in
|
|
19
|
-
export class FeedHandler extends DomHandler {
|
|
20
|
-
/**
|
|
21
|
-
*
|
|
22
|
-
* @param callback
|
|
23
|
-
* @param options
|
|
24
|
-
*/
|
|
25
|
-
constructor(callback, options) {
|
|
26
|
-
if (typeof callback === 'object') {
|
|
27
|
-
callback = undefined;
|
|
28
|
-
options = callback;
|
|
29
|
-
}
|
|
30
|
-
super(callback, options);
|
|
31
|
-
Object.defineProperty(this, "feed", {
|
|
32
|
-
enumerable: true,
|
|
33
|
-
configurable: true,
|
|
34
|
-
writable: true,
|
|
35
|
-
value: void 0
|
|
36
|
-
});
|
|
37
|
-
}
|
|
38
|
-
onend() {
|
|
39
|
-
const feedRoot = getOneElement(isValidFeed, this.dom);
|
|
40
|
-
if (!feedRoot) {
|
|
41
|
-
this.handleCallback(new Error("couldn't find root of feed"));
|
|
42
|
-
return;
|
|
43
|
-
}
|
|
44
|
-
const feed = {};
|
|
45
|
-
if (feedRoot.name === 'feed') {
|
|
46
|
-
const childs = feedRoot.children;
|
|
47
|
-
feed.type = 'atom';
|
|
48
|
-
addConditionally(feed, 'id', 'id', childs);
|
|
49
|
-
addConditionally(feed, 'title', 'title', childs);
|
|
50
|
-
const href = getAttribute('href', getOneElement('link', childs));
|
|
51
|
-
if (href) {
|
|
52
|
-
feed.link = href;
|
|
53
|
-
}
|
|
54
|
-
addConditionally(feed, 'description', 'subtitle', childs);
|
|
55
|
-
const updated = fetch('updated', childs);
|
|
56
|
-
if (updated) {
|
|
57
|
-
feed.updated = new Date(updated);
|
|
58
|
-
}
|
|
59
|
-
addConditionally(feed, 'author', 'email', childs, true);
|
|
60
|
-
feed.items = getElements('entry', childs).map(item => {
|
|
61
|
-
const entry = {};
|
|
62
|
-
const { children } = item;
|
|
63
|
-
addConditionally(entry, 'id', 'id', children);
|
|
64
|
-
addConditionally(entry, 'title', 'title', children);
|
|
65
|
-
const href = getAttribute('href', getOneElement('link', children));
|
|
66
|
-
if (href) {
|
|
67
|
-
entry.link = href;
|
|
68
|
-
}
|
|
69
|
-
const description = fetch('summary', children) || fetch('content', children);
|
|
70
|
-
if (description) {
|
|
71
|
-
entry.description = description;
|
|
72
|
-
}
|
|
73
|
-
const pubDate = fetch('updated', children);
|
|
74
|
-
if (pubDate) {
|
|
75
|
-
entry.pubDate = new Date(pubDate);
|
|
76
|
-
}
|
|
77
|
-
entry.media = getMediaElements(children);
|
|
78
|
-
return entry;
|
|
79
|
-
});
|
|
80
|
-
}
|
|
81
|
-
else {
|
|
82
|
-
const childs = getOneElement('channel', feedRoot.children)?.children ?? [];
|
|
83
|
-
feed.type = feedRoot.name.substr(0, 3);
|
|
84
|
-
feed.id = '';
|
|
85
|
-
addConditionally(feed, 'title', 'title', childs);
|
|
86
|
-
addConditionally(feed, 'link', 'link', childs);
|
|
87
|
-
addConditionally(feed, 'description', 'description', childs);
|
|
88
|
-
const updated = fetch('lastBuildDate', childs);
|
|
89
|
-
if (updated) {
|
|
90
|
-
feed.updated = new Date(updated);
|
|
91
|
-
}
|
|
92
|
-
addConditionally(feed, 'author', 'managingEditor', childs, true);
|
|
93
|
-
feed.items = getElements('item', feedRoot.children).map((item) => {
|
|
94
|
-
const entry = {};
|
|
95
|
-
const { children } = item;
|
|
96
|
-
addConditionally(entry, 'id', 'guid', children);
|
|
97
|
-
addConditionally(entry, 'title', 'title', children);
|
|
98
|
-
addConditionally(entry, 'link', 'link', children);
|
|
99
|
-
addConditionally(entry, 'description', 'description', children);
|
|
100
|
-
const pubDate = fetch('pubDate', children);
|
|
101
|
-
if (pubDate)
|
|
102
|
-
entry.pubDate = new Date(pubDate);
|
|
103
|
-
entry.media = getMediaElements(children);
|
|
104
|
-
return entry;
|
|
105
|
-
});
|
|
106
|
-
}
|
|
107
|
-
this.feed = feed;
|
|
108
|
-
this.handleCallback(null);
|
|
109
|
-
}
|
|
110
|
-
}
|
|
111
|
-
function getMediaElements(where) {
|
|
112
|
-
return getElements('media:content', where).map(elem => {
|
|
113
|
-
const media = {
|
|
114
|
-
medium: elem.attribs.medium,
|
|
115
|
-
isDefault: !!elem.attribs.isDefault,
|
|
116
|
-
};
|
|
117
|
-
if (elem.attribs.url) {
|
|
118
|
-
media.url = elem.attribs.url;
|
|
119
|
-
}
|
|
120
|
-
if (elem.attribs.fileSize) {
|
|
121
|
-
media.fileSize = parseInt(elem.attribs.fileSize, 10);
|
|
122
|
-
}
|
|
123
|
-
if (elem.attribs.type) {
|
|
124
|
-
media.type = elem.attribs.type;
|
|
125
|
-
}
|
|
126
|
-
if (elem.attribs.expression) {
|
|
127
|
-
media.expression = elem.attribs
|
|
128
|
-
.expression;
|
|
129
|
-
}
|
|
130
|
-
if (elem.attribs.bitrate) {
|
|
131
|
-
media.bitrate = parseInt(elem.attribs.bitrate, 10);
|
|
132
|
-
}
|
|
133
|
-
if (elem.attribs.framerate) {
|
|
134
|
-
media.framerate = parseInt(elem.attribs.framerate, 10);
|
|
135
|
-
}
|
|
136
|
-
if (elem.attribs.samplingrate) {
|
|
137
|
-
media.samplingrate = parseInt(elem.attribs.samplingrate, 10);
|
|
138
|
-
}
|
|
139
|
-
if (elem.attribs.channels) {
|
|
140
|
-
media.channels = parseInt(elem.attribs.channels, 10);
|
|
141
|
-
}
|
|
142
|
-
if (elem.attribs.duration) {
|
|
143
|
-
media.duration = parseInt(elem.attribs.duration, 10);
|
|
144
|
-
}
|
|
145
|
-
if (elem.attribs.height) {
|
|
146
|
-
media.height = parseInt(elem.attribs.height, 10);
|
|
147
|
-
}
|
|
148
|
-
if (elem.attribs.width) {
|
|
149
|
-
media.width = parseInt(elem.attribs.width, 10);
|
|
150
|
-
}
|
|
151
|
-
if (elem.attribs.lang) {
|
|
152
|
-
media.lang = elem.attribs.lang;
|
|
153
|
-
}
|
|
154
|
-
return media;
|
|
155
|
-
});
|
|
156
|
-
}
|
|
157
|
-
function getElements(tagName, where) {
|
|
158
|
-
return DomUtils.getElementsByTagName(tagName, where, true);
|
|
159
|
-
}
|
|
160
|
-
function getOneElement(tagName, node) {
|
|
161
|
-
return DomUtils.getElementsByTagName(tagName, node, true, 1)[0];
|
|
162
|
-
}
|
|
163
|
-
function fetch(tagName, where, recurse = false) {
|
|
164
|
-
return DomUtils.getText(DomUtils.getElementsByTagName(tagName, where, recurse, 1)).trim();
|
|
165
|
-
}
|
|
166
|
-
function getAttribute(name, elem) {
|
|
167
|
-
if (!elem) {
|
|
168
|
-
return null;
|
|
169
|
-
}
|
|
170
|
-
const { attribs } = elem;
|
|
171
|
-
return attribs[name];
|
|
172
|
-
}
|
|
173
|
-
function addConditionally(obj, prop, what, where, recurse = false) {
|
|
174
|
-
const tmp = fetch(what, where, recurse);
|
|
175
|
-
if (tmp)
|
|
176
|
-
obj[prop] = tmp;
|
|
177
|
-
}
|
|
178
|
-
function isValidFeed(value) {
|
|
179
|
-
return value === 'rss' || value === 'feed' || value === 'rdf:RDF';
|
|
180
|
-
}
|
|
181
|
-
/**
|
|
182
|
-
* Parse a feed.
|
|
183
|
-
*
|
|
184
|
-
* @param feed The feed that should be parsed, as a string.
|
|
185
|
-
* @param options Optionally, options for parsing. When using this option, you should set `xmlMode` to `true`.
|
|
186
|
-
*/
|
|
187
|
-
export function parseFeed(feed, options = { xmlMode: true }) {
|
|
188
|
-
const handler = new FeedHandler(options);
|
|
189
|
-
new Parser(handler, options).end(feed);
|
|
190
|
-
return handler.feed;
|
|
191
|
-
}
|
|
@@ -1,168 +0,0 @@
|
|
|
1
|
-
import { ElementType } from './ElementType.js';
|
|
2
|
-
/**
|
|
3
|
-
* This object will be used as the prototype for Nodes when creating a
|
|
4
|
-
* DOM-Level-1-compliant structure.
|
|
5
|
-
*/
|
|
6
|
-
export declare class Node {
|
|
7
|
-
type: ElementType;
|
|
8
|
-
/** Parent of the node */
|
|
9
|
-
parent: NodeWithChildren | null;
|
|
10
|
-
/** Previous sibling */
|
|
11
|
-
prev: Node | null;
|
|
12
|
-
/** Next sibling */
|
|
13
|
-
next: Node | null;
|
|
14
|
-
/** The start index of the node. Requires `withStartIndices` on the handler to be `true. */
|
|
15
|
-
startIndex: number | null;
|
|
16
|
-
/** The end index of the node. Requires `withEndIndices` on the handler to be `true. */
|
|
17
|
-
endIndex: number | null;
|
|
18
|
-
/**
|
|
19
|
-
*
|
|
20
|
-
* @param type The type of the node.
|
|
21
|
-
*/
|
|
22
|
-
constructor(type: ElementType);
|
|
23
|
-
get nodeType(): number;
|
|
24
|
-
get parentNode(): NodeWithChildren | null;
|
|
25
|
-
set parentNode(parent: NodeWithChildren | null);
|
|
26
|
-
get previousSibling(): Node | null;
|
|
27
|
-
set previousSibling(prev: Node | null);
|
|
28
|
-
get nextSibling(): Node | null;
|
|
29
|
-
set nextSibling(next: Node | null);
|
|
30
|
-
/**
|
|
31
|
-
* Clone this node, and optionally its children.
|
|
32
|
-
*
|
|
33
|
-
* @param recursive Clone child nodes as well.
|
|
34
|
-
* @returns A clone of the node.
|
|
35
|
-
*/
|
|
36
|
-
cloneNode<T extends Node>(this: T, recursive?: boolean): T;
|
|
37
|
-
}
|
|
38
|
-
/**
|
|
39
|
-
* A node that contains some data.
|
|
40
|
-
*/
|
|
41
|
-
export declare class DataNode extends Node {
|
|
42
|
-
data: string;
|
|
43
|
-
/**
|
|
44
|
-
* @param type The type of the node
|
|
45
|
-
* @param data The content of the data node
|
|
46
|
-
*/
|
|
47
|
-
constructor(type: ElementType.Comment | ElementType.Text | ElementType.Directive, data: string);
|
|
48
|
-
get nodeValue(): string;
|
|
49
|
-
set nodeValue(data: string);
|
|
50
|
-
}
|
|
51
|
-
/**
|
|
52
|
-
* Text within the document.
|
|
53
|
-
*/
|
|
54
|
-
export declare class Text extends DataNode {
|
|
55
|
-
constructor(data: string);
|
|
56
|
-
}
|
|
57
|
-
/**
|
|
58
|
-
* Comments within the document.
|
|
59
|
-
*/
|
|
60
|
-
export declare class Comment extends DataNode {
|
|
61
|
-
constructor(data: string);
|
|
62
|
-
}
|
|
63
|
-
/**
|
|
64
|
-
* Processing instructions, including doc types.
|
|
65
|
-
*/
|
|
66
|
-
export declare class ProcessingInstruction extends DataNode {
|
|
67
|
-
name: string;
|
|
68
|
-
constructor(name: string, data: string);
|
|
69
|
-
'x-name'?: string;
|
|
70
|
-
'x-publicId'?: string;
|
|
71
|
-
'x-systemId'?: string;
|
|
72
|
-
}
|
|
73
|
-
/**
|
|
74
|
-
* A `Node` that can have children.
|
|
75
|
-
*/
|
|
76
|
-
export declare class NodeWithChildren extends Node {
|
|
77
|
-
children: Node[];
|
|
78
|
-
/**
|
|
79
|
-
* @param type Type of the node.
|
|
80
|
-
* @param children Children of the node. Only certain node types can have children.
|
|
81
|
-
*/
|
|
82
|
-
constructor(type: ElementType.Root | ElementType.CDATA | ElementType.Script | ElementType.Style | ElementType.Tag, children: Node[]);
|
|
83
|
-
get firstChild(): Node | null;
|
|
84
|
-
get lastChild(): Node | null;
|
|
85
|
-
get childNodes(): Node[];
|
|
86
|
-
set childNodes(children: Node[]);
|
|
87
|
-
}
|
|
88
|
-
/**
|
|
89
|
-
* The root node of the document.
|
|
90
|
-
*/
|
|
91
|
-
export declare class Document extends NodeWithChildren {
|
|
92
|
-
constructor(children: Node[]);
|
|
93
|
-
'x-mode'?: 'no-quirks' | 'quirks' | 'limited-quirks';
|
|
94
|
-
}
|
|
95
|
-
/**
|
|
96
|
-
* The description of an individual attribute.
|
|
97
|
-
*/
|
|
98
|
-
interface Attribute {
|
|
99
|
-
name: string;
|
|
100
|
-
value: string;
|
|
101
|
-
namespace?: string;
|
|
102
|
-
prefix?: string;
|
|
103
|
-
}
|
|
104
|
-
/**
|
|
105
|
-
* An element within the DOM.
|
|
106
|
-
*/
|
|
107
|
-
export declare class Element extends NodeWithChildren {
|
|
108
|
-
name: string;
|
|
109
|
-
attribs: {
|
|
110
|
-
[name: string]: string;
|
|
111
|
-
};
|
|
112
|
-
/**
|
|
113
|
-
* @param name Name of the tag, eg. `div`, `span`.
|
|
114
|
-
* @param attribs Object mapping attribute names to attribute values.
|
|
115
|
-
* @param children Children of the node.
|
|
116
|
-
*/
|
|
117
|
-
constructor(name: string, attribs: {
|
|
118
|
-
[name: string]: string;
|
|
119
|
-
}, children?: Node[], type?: ElementType.Tag | ElementType.Script | ElementType.Style);
|
|
120
|
-
get tagName(): string;
|
|
121
|
-
set tagName(name: string);
|
|
122
|
-
get attributes(): Attribute[];
|
|
123
|
-
'x-attribsNamespace'?: Record<string, string>;
|
|
124
|
-
'x-attribsPrefix'?: Record<string, string>;
|
|
125
|
-
}
|
|
126
|
-
/**
|
|
127
|
-
* @param node Node to check.
|
|
128
|
-
* @returns `true` if the node is a `Element`, `false` otherwise.
|
|
129
|
-
*/
|
|
130
|
-
export declare function isTag(node: Node): node is Element;
|
|
131
|
-
/**
|
|
132
|
-
* @param node Node to check.
|
|
133
|
-
* @returns `true` if the node has the type `CDATA`, `false` otherwise.
|
|
134
|
-
*/
|
|
135
|
-
export declare function isCDATA(node: Node): node is NodeWithChildren;
|
|
136
|
-
/**
|
|
137
|
-
* @param node Node to check.
|
|
138
|
-
* @returns `true` if the node has the type `Text`, `false` otherwise.
|
|
139
|
-
*/
|
|
140
|
-
export declare function isText(node: Node): node is Text;
|
|
141
|
-
/**
|
|
142
|
-
* @param node Node to check.
|
|
143
|
-
* @returns `true` if the node has the type `Comment`, `false` otherwise.
|
|
144
|
-
*/
|
|
145
|
-
export declare function isComment(node: Node): node is DataNode;
|
|
146
|
-
/**
|
|
147
|
-
* @param node Node to check.
|
|
148
|
-
* @returns `true` if the node has the type `ProcessingInstruction`, `false` otherwise.
|
|
149
|
-
*/
|
|
150
|
-
export declare function isDirective(node: Node): node is ProcessingInstruction;
|
|
151
|
-
/**
|
|
152
|
-
* @param node Node to check.
|
|
153
|
-
* @returns `true` if the node has the type `ProcessingInstruction`, `false` otherwise.
|
|
154
|
-
*/
|
|
155
|
-
export declare function isDocument(node: Node): node is Document;
|
|
156
|
-
/**
|
|
157
|
-
* @param node Node to check.
|
|
158
|
-
* @returns `true` if the node is a `NodeWithChildren` (has children), `false` otherwise.
|
|
159
|
-
*/
|
|
160
|
-
export declare function hasChildren(node: Node): node is NodeWithChildren;
|
|
161
|
-
/**
|
|
162
|
-
* Clone a node, and optionally its children.
|
|
163
|
-
*
|
|
164
|
-
* @param recursive Clone child nodes as well.
|
|
165
|
-
* @returns A clone of the node.
|
|
166
|
-
*/
|
|
167
|
-
export declare function cloneNode<T extends Node>(node: T, recursive?: boolean): T;
|
|
168
|
-
export {};
|