@mtkruto/node 0.3.0 → 0.4.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/esm/0_deps.d.ts +1 -1
- package/esm/0_deps.js +1 -1
- package/esm/4_constants.js +3 -3
- package/esm/client/0_params.d.ts +6 -2
- package/esm/client/0_params.d.ts.map +1 -1
- package/esm/client/0_password.js +2 -2
- package/esm/client/0_utilities.d.ts +4 -4
- package/esm/client/0_utilities.d.ts.map +1 -1
- package/esm/client/0_utilities.js +2 -2
- package/esm/client/2_update_manager.js +1 -1
- package/esm/client/3_message_manager.d.ts.map +1 -1
- package/esm/client/3_message_manager.js +6 -0
- package/esm/client/5_client.d.ts.map +1 -1
- package/esm/client/5_client.js +3 -3
- package/{script/deps/jsr.io/@std/io/0.224.9 → esm/deps/jsr.io/@std/io/0.225.0}/_constants.d.ts.map +1 -1
- package/esm/deps/jsr.io/@std/io/{0.224.9 → 0.225.0}/_constants.js +1 -1
- package/esm/deps/jsr.io/@std/io/{0.224.9 → 0.225.0}/iterate_reader.d.ts.map +1 -1
- package/esm/deps/jsr.io/@std/io/{0.224.9 → 0.225.0}/types.d.ts.map +1 -1
- package/esm/transport/2_transport_provider.js +4 -4
- package/esm/utilities/0_units.js +3 -3
- package/esm/utilities/2_queue.d.ts.map +1 -1
- package/package.json +1 -1
- package/script/0_deps.d.ts +1 -1
- package/script/0_deps.js +3 -3
- package/script/4_constants.js +3 -3
- package/script/4_errors.js +2 -2
- package/script/client/0_filters.js +1 -2
- package/script/client/0_html.js +1 -2
- package/script/client/0_markdown.js +2 -2
- package/script/client/0_message.js +5 -6
- package/script/client/0_params.d.ts +6 -2
- package/script/client/0_params.d.ts.map +1 -1
- package/script/client/0_password.js +8 -8
- package/script/client/0_utilities.d.ts +4 -4
- package/script/client/0_utilities.d.ts.map +1 -1
- package/script/client/0_utilities.js +18 -18
- package/script/client/1_composer.js +4 -4
- package/script/client/2_update_manager.js +1 -1
- package/script/client/3_message_manager.d.ts.map +1 -1
- package/script/client/3_message_manager.js +6 -0
- package/script/client/5_client.d.ts.map +1 -1
- package/script/client/5_client.js +2 -2
- package/script/deps/deno.land/std@0.224.0/io/write_all.js +2 -3
- package/script/deps/deno.land/x/html_parser@v0.1.3/src/DomSerializer.js +1 -1
- package/script/deps/deno.land/x/html_parser@v0.1.3/src/ElementType.js +2 -2
- package/script/deps/deno.land/x/html_parser@v0.1.3/src/FeedHandler.js +2 -2
- package/script/deps/deno.land/x/html_parser@v0.1.3/src/Node.js +9 -9
- package/script/deps/deno.land/x/html_parser@v0.1.3/src/mod.js +4 -4
- package/script/deps/deno.land/x/html_parser@v0.1.3/src/utils/entities/decode_codepoint.js +1 -1
- package/script/deps/deno.land/x/html_parser@v0.1.3/src/utils/entities/encode.js +3 -3
- package/script/deps/deno.land/x/html_parser@v0.1.3/src/utils/entities/mod.js +4 -4
- package/script/deps/deno.land/x/html_parser@v0.1.3/src/utils/helpers.js +4 -4
- package/script/deps/deno.land/x/html_parser@v0.1.3/src/utils/legacy.js +5 -6
- package/script/deps/deno.land/x/html_parser@v0.1.3/src/utils/manipulation.js +6 -7
- package/script/deps/deno.land/x/html_parser@v0.1.3/src/utils/querying.js +6 -7
- package/script/deps/deno.land/x/html_parser@v0.1.3/src/utils/stringify.js +5 -6
- package/script/deps/deno.land/x/html_parser@v0.1.3/src/utils/traversal.js +8 -9
- package/script/deps/deno.land/x/tgcrypto@0.4.1/mod.js +10 -11
- package/script/deps/jsr.io/@std/assert/1.0.6/almost_equals.js +1 -2
- package/script/deps/jsr.io/@std/assert/1.0.6/array_includes.js +1 -2
- package/script/deps/jsr.io/@std/assert/1.0.6/assert.js +1 -2
- package/script/deps/jsr.io/@std/assert/1.0.6/equal.js +1 -2
- package/script/deps/jsr.io/@std/assert/1.0.6/equals.js +1 -2
- package/script/deps/jsr.io/@std/assert/1.0.6/exists.js +1 -2
- package/script/deps/jsr.io/@std/assert/1.0.6/fail.js +1 -2
- package/script/deps/jsr.io/@std/assert/1.0.6/false.js +1 -2
- package/script/deps/jsr.io/@std/assert/1.0.6/greater.js +1 -2
- package/script/deps/jsr.io/@std/assert/1.0.6/greater_or_equal.js +1 -2
- package/script/deps/jsr.io/@std/assert/1.0.6/instance_of.js +1 -2
- package/script/deps/jsr.io/@std/assert/1.0.6/is_error.js +1 -2
- package/script/deps/jsr.io/@std/assert/1.0.6/less.js +1 -2
- package/script/deps/jsr.io/@std/assert/1.0.6/less_or_equal.js +1 -2
- package/script/deps/jsr.io/@std/assert/1.0.6/match.js +1 -2
- package/script/deps/jsr.io/@std/assert/1.0.6/not_equals.js +1 -2
- package/script/deps/jsr.io/@std/assert/1.0.6/not_instance_of.js +1 -2
- package/script/deps/jsr.io/@std/assert/1.0.6/not_match.js +1 -2
- package/script/deps/jsr.io/@std/assert/1.0.6/not_strict_equals.js +1 -2
- package/script/deps/jsr.io/@std/assert/1.0.6/object_match.js +1 -2
- package/script/deps/jsr.io/@std/assert/1.0.6/rejects.js +1 -2
- package/script/deps/jsr.io/@std/assert/1.0.6/strict_equals.js +1 -2
- package/script/deps/jsr.io/@std/assert/1.0.6/string_includes.js +1 -2
- package/script/deps/jsr.io/@std/assert/1.0.6/throws.js +1 -2
- package/script/deps/jsr.io/@std/assert/1.0.6/unimplemented.js +1 -2
- package/script/deps/jsr.io/@std/assert/1.0.6/unreachable.js +1 -2
- package/script/deps/jsr.io/@std/bytes/1.0.2/concat.js +1 -2
- package/script/deps/jsr.io/@std/encoding/1.0.5/_validate_binary_like.js +1 -2
- package/script/deps/jsr.io/@std/encoding/1.0.5/base64.js +2 -3
- package/script/deps/jsr.io/@std/internal/1.0.4/build_message.js +3 -4
- package/script/deps/jsr.io/@std/internal/1.0.4/diff.js +5 -6
- package/script/deps/jsr.io/@std/internal/1.0.4/diff_str.js +4 -5
- package/script/deps/jsr.io/@std/internal/1.0.4/format.js +1 -2
- package/script/deps/jsr.io/@std/internal/1.0.4/styles.js +10 -11
- package/{esm/deps/jsr.io/@std/io/0.224.9 → script/deps/jsr.io/@std/io/0.225.0}/_constants.d.ts.map +1 -1
- package/script/deps/jsr.io/@std/io/{0.224.9 → 0.225.0}/_constants.js +1 -1
- package/script/deps/jsr.io/@std/io/{0.224.9 → 0.225.0}/iterate_reader.d.ts.map +1 -1
- package/script/deps/jsr.io/@std/io/{0.224.9 → 0.225.0}/iterate_reader.js +2 -3
- package/script/deps/jsr.io/@std/io/{0.224.9 → 0.225.0}/types.d.ts.map +1 -1
- package/script/deps/jsr.io/@std/media-types/1.0.3/_util.js +8 -9
- package/script/deps/jsr.io/@std/media-types/1.0.3/all_extensions.js +1 -2
- package/script/deps/jsr.io/@std/media-types/1.0.3/content_type.js +1 -2
- package/script/deps/jsr.io/@std/media-types/1.0.3/extension.js +1 -2
- package/script/deps/jsr.io/@std/media-types/1.0.3/format_media_type.js +1 -2
- package/script/deps/jsr.io/@std/media-types/1.0.3/get_charset.js +1 -2
- package/script/deps/jsr.io/@std/media-types/1.0.3/parse_media_type.js +1 -2
- package/script/deps/jsr.io/@std/media-types/1.0.3/type_by_extension.js +1 -2
- package/script/deps/jsr.io/@std/path/1.0.6/_common/assert_path.js +1 -2
- package/script/deps/jsr.io/@std/path/1.0.6/_common/basename.js +3 -4
- package/script/deps/jsr.io/@std/path/1.0.6/_common/common.js +1 -2
- package/script/deps/jsr.io/@std/path/1.0.6/_common/dirname.js +1 -2
- package/script/deps/jsr.io/@std/path/1.0.6/_common/format.js +2 -3
- package/script/deps/jsr.io/@std/path/1.0.6/_common/from_file_url.js +1 -2
- package/script/deps/jsr.io/@std/path/1.0.6/_common/glob_to_reg_exp.js +1 -2
- package/script/deps/jsr.io/@std/path/1.0.6/_common/normalize.js +1 -2
- package/script/deps/jsr.io/@std/path/1.0.6/_common/normalize_string.js +1 -2
- package/script/deps/jsr.io/@std/path/1.0.6/_common/relative.js +1 -2
- package/script/deps/jsr.io/@std/path/1.0.6/_common/strip_trailing_separators.js +1 -2
- package/script/deps/jsr.io/@std/path/1.0.6/_common/to_file_url.js +1 -2
- package/script/deps/jsr.io/@std/path/1.0.6/basename.js +1 -2
- package/script/deps/jsr.io/@std/path/1.0.6/common.js +1 -2
- package/script/deps/jsr.io/@std/path/1.0.6/dirname.js +1 -2
- package/script/deps/jsr.io/@std/path/1.0.6/extname.js +1 -2
- package/script/deps/jsr.io/@std/path/1.0.6/format.js +1 -2
- package/script/deps/jsr.io/@std/path/1.0.6/from_file_url.js +1 -2
- package/script/deps/jsr.io/@std/path/1.0.6/glob_to_regexp.js +1 -2
- package/script/deps/jsr.io/@std/path/1.0.6/is_absolute.js +1 -2
- package/script/deps/jsr.io/@std/path/1.0.6/is_glob.js +1 -2
- package/script/deps/jsr.io/@std/path/1.0.6/join.js +1 -2
- package/script/deps/jsr.io/@std/path/1.0.6/join_globs.js +1 -2
- package/script/deps/jsr.io/@std/path/1.0.6/normalize.js +1 -2
- package/script/deps/jsr.io/@std/path/1.0.6/normalize_glob.js +1 -2
- package/script/deps/jsr.io/@std/path/1.0.6/parse.js +1 -2
- package/script/deps/jsr.io/@std/path/1.0.6/posix/_util.js +1 -2
- package/script/deps/jsr.io/@std/path/1.0.6/posix/basename.js +1 -2
- package/script/deps/jsr.io/@std/path/1.0.6/posix/dirname.js +1 -2
- package/script/deps/jsr.io/@std/path/1.0.6/posix/extname.js +1 -2
- package/script/deps/jsr.io/@std/path/1.0.6/posix/format.js +1 -2
- package/script/deps/jsr.io/@std/path/1.0.6/posix/from_file_url.js +1 -2
- package/script/deps/jsr.io/@std/path/1.0.6/posix/glob_to_regexp.js +1 -2
- package/script/deps/jsr.io/@std/path/1.0.6/posix/is_absolute.js +1 -2
- package/script/deps/jsr.io/@std/path/1.0.6/posix/join.js +1 -2
- package/script/deps/jsr.io/@std/path/1.0.6/posix/join_globs.js +1 -2
- package/script/deps/jsr.io/@std/path/1.0.6/posix/normalize.js +1 -2
- package/script/deps/jsr.io/@std/path/1.0.6/posix/normalize_glob.js +1 -2
- package/script/deps/jsr.io/@std/path/1.0.6/posix/parse.js +1 -2
- package/script/deps/jsr.io/@std/path/1.0.6/posix/relative.js +1 -2
- package/script/deps/jsr.io/@std/path/1.0.6/posix/resolve.js +1 -2
- package/script/deps/jsr.io/@std/path/1.0.6/posix/to_file_url.js +1 -2
- package/script/deps/jsr.io/@std/path/1.0.6/posix/to_namespaced_path.js +1 -2
- package/script/deps/jsr.io/@std/path/1.0.6/relative.js +1 -2
- package/script/deps/jsr.io/@std/path/1.0.6/resolve.js +1 -2
- package/script/deps/jsr.io/@std/path/1.0.6/to_file_url.js +1 -2
- package/script/deps/jsr.io/@std/path/1.0.6/to_namespaced_path.js +1 -2
- package/script/deps/jsr.io/@std/path/1.0.6/windows/_util.js +3 -4
- package/script/deps/jsr.io/@std/path/1.0.6/windows/basename.js +1 -2
- package/script/deps/jsr.io/@std/path/1.0.6/windows/dirname.js +1 -2
- package/script/deps/jsr.io/@std/path/1.0.6/windows/extname.js +1 -2
- package/script/deps/jsr.io/@std/path/1.0.6/windows/format.js +1 -2
- package/script/deps/jsr.io/@std/path/1.0.6/windows/from_file_url.js +1 -2
- package/script/deps/jsr.io/@std/path/1.0.6/windows/glob_to_regexp.js +1 -2
- package/script/deps/jsr.io/@std/path/1.0.6/windows/is_absolute.js +1 -2
- package/script/deps/jsr.io/@std/path/1.0.6/windows/join.js +1 -2
- package/script/deps/jsr.io/@std/path/1.0.6/windows/join_globs.js +1 -2
- package/script/deps/jsr.io/@std/path/1.0.6/windows/normalize.js +1 -2
- package/script/deps/jsr.io/@std/path/1.0.6/windows/normalize_glob.js +1 -2
- package/script/deps/jsr.io/@std/path/1.0.6/windows/parse.js +1 -2
- package/script/deps/jsr.io/@std/path/1.0.6/windows/relative.js +1 -2
- package/script/deps/jsr.io/@std/path/1.0.6/windows/resolve.js +1 -2
- package/script/deps/jsr.io/@std/path/1.0.6/windows/to_file_url.js +1 -2
- package/script/deps/jsr.io/@std/path/1.0.6/windows/to_namespaced_path.js +1 -2
- package/script/deps/raw.githubusercontent.com/MTKruto/compress/main/utils/uint8.js +1 -2
- package/script/deps/raw.githubusercontent.com/MTKruto/compress/main/zlib/deflate.js +2 -2
- package/script/deps/raw.githubusercontent.com/MTKruto/compress/main/zlib/zlib/adler32.js +1 -1
- package/script/deps/raw.githubusercontent.com/MTKruto/compress/main/zlib/zlib/crc32.js +2 -3
- package/script/deps/raw.githubusercontent.com/MTKruto/compress/main/zlib/zlib/deflate.js +6 -6
- package/script/deps/raw.githubusercontent.com/MTKruto/compress/main/zlib/zlib/inffast.js +1 -1
- package/script/deps/raw.githubusercontent.com/MTKruto/compress/main/zlib/zlib/inflate.js +10 -10
- package/script/deps/raw.githubusercontent.com/MTKruto/compress/main/zlib/zlib/inftrees.js +1 -1
- package/script/deps/raw.githubusercontent.com/MTKruto/compress/main/zlib/zlib/trees.js +5 -6
- package/script/deps/raw.githubusercontent.com/MTKruto/socks5/main/utils.js +1 -2
- package/script/storage/1_utilities.js +7 -7
- package/script/tl/1_utilities.js +9 -10
- package/script/tl/2_deserialize.js +1 -2
- package/script/tl/2_serialize.js +1 -2
- package/script/tl/3_utilities.js +6 -7
- package/script/tl/4_rpc_result.js +2 -2
- package/script/tl/5_message.js +6 -6
- package/script/transport/0_obfuscation.js +1 -2
- package/script/transport/2_transport_provider.js +7 -8
- package/script/transport/3_transport_provider_tcp.js +1 -2
- package/script/types/0_birthday.js +1 -2
- package/script/types/0_callback_query_answer.js +1 -2
- package/script/types/0_callback_query_question.js +1 -2
- package/script/types/0_chat_administrator_rights.js +2 -3
- package/script/types/0_chat_member_rights.js +2 -3
- package/script/types/0_chat_photo.js +1 -2
- package/script/types/0_contact.js +1 -2
- package/script/types/0_dice.js +1 -2
- package/script/types/0_failed_invitation.js +1 -2
- package/script/types/0_giveaway_parameters.js +1 -2
- package/script/types/0_invoice.js +1 -2
- package/script/types/0_link_preview.js +1 -2
- package/script/types/0_live_stream_channel.js +1 -2
- package/script/types/0_location.js +1 -2
- package/script/types/0_mask_position.js +1 -2
- package/script/types/0_message_entity.js +3 -4
- package/script/types/0_message_search_filter.js +1 -2
- package/script/types/0_mini_app_info.js +1 -2
- package/script/types/0_opening_hours.js +1 -2
- package/script/types/0_reaction.js +3 -4
- package/script/types/0_refunded_payment.js +1 -2
- package/script/types/0_restriction_reason.js +1 -2
- package/script/types/0_self_destruct_option.js +1 -2
- package/script/types/0_shipping_address.js +1 -2
- package/script/types/0_thumbnail.js +1 -2
- package/script/types/0_video_chat.js +1 -2
- package/script/types/0_voice.js +1 -2
- package/script/types/1_animation.js +1 -2
- package/script/types/1_audio.js +1 -2
- package/script/types/1_bot_command_scope.js +1 -2
- package/script/types/1_chat_p.js +1 -2
- package/script/types/1_document.js +1 -2
- package/script/types/1_giveaway.js +1 -2
- package/script/types/1_keyboard_button.js +2 -3
- package/script/types/1_message_reaction.js +1 -2
- package/script/types/1_order_info.js +1 -2
- package/script/types/1_photo.js +2 -3
- package/script/types/1_poll_option.js +1 -2
- package/script/types/1_reaction_count.js +1 -2
- package/script/types/1_reply_quote.js +1 -2
- package/script/types/1_sticker.js +1 -2
- package/script/types/1_story_privacy.js +2 -3
- package/script/types/1_story_reaction.js +1 -2
- package/script/types/1_user.js +1 -2
- package/script/types/1_venue.js +1 -2
- package/script/types/1_video.js +1 -2
- package/script/types/1_video_note.js +1 -2
- package/script/types/2_business_connection.js +1 -2
- package/script/types/2_chat.js +1 -2
- package/script/types/2_chat_member.js +1 -2
- package/script/types/2_chosen_inline_result.js +1 -2
- package/script/types/2_forward_header.js +1 -2
- package/script/types/2_game.js +1 -2
- package/script/types/2_inactive_chat.js +1 -2
- package/script/types/2_inline_keyboard_button.js +2 -3
- package/script/types/2_inline_query.js +1 -2
- package/script/types/2_invite_link.js +1 -2
- package/script/types/2_message_reaction_count.js +1 -2
- package/script/types/2_message_reactions.js +1 -2
- package/script/types/2_poll.js +1 -2
- package/script/types/2_pre_checkout_query.js +1 -2
- package/script/types/2_story_content.js +1 -2
- package/script/types/2_story_interactions.js +1 -2
- package/script/types/2_story_interactive_area.js +2 -3
- package/script/types/2_successful_payment.js +1 -2
- package/script/types/3_chat_member_updated.js +1 -2
- package/script/types/3_join_request.js +1 -2
- package/script/types/3_reply_markup.js +2 -3
- package/script/types/3_story.js +1 -2
- package/script/types/4_inline_query_result.js +2 -3
- package/script/types/4_message.js +2 -3
- package/script/types/5_callback_query.js +2 -3
- package/script/types/5_chat_list_item.js +5 -6
- package/script/types/5_inline_query_answer.js +1 -2
- package/script/types/_file_id.js +5 -5
- package/script/utilities/0_bigint.js +6 -7
- package/script/utilities/0_buffer.js +1 -2
- package/script/utilities/0_color.js +2 -3
- package/script/utilities/0_env.js +2 -3
- package/script/utilities/0_hash.js +2 -3
- package/script/utilities/0_object.js +1 -2
- package/script/utilities/0_rle.js +2 -3
- package/script/utilities/0_units.js +3 -3
- package/script/utilities/1_auth.js +1 -2
- package/script/utilities/1_base64.js +2 -3
- package/script/utilities/1_logger.js +5 -5
- package/script/utilities/1_math.js +1 -2
- package/script/utilities/1_misc.js +8 -8
- package/script/utilities/2_queue.d.ts.map +1 -1
- /package/esm/deps/jsr.io/@std/io/{0.224.9 → 0.225.0}/_constants.d.ts +0 -0
- /package/esm/deps/jsr.io/@std/io/{0.224.9 → 0.225.0}/iterate_reader.d.ts +0 -0
- /package/esm/deps/jsr.io/@std/io/{0.224.9 → 0.225.0}/iterate_reader.js +0 -0
- /package/esm/deps/jsr.io/@std/io/{0.224.9 → 0.225.0}/types.d.ts +0 -0
- /package/esm/deps/jsr.io/@std/io/{0.224.9 → 0.225.0}/types.js +0 -0
- /package/script/deps/jsr.io/@std/io/{0.224.9 → 0.225.0}/_constants.d.ts +0 -0
- /package/script/deps/jsr.io/@std/io/{0.224.9 → 0.225.0}/iterate_reader.d.ts +0 -0
- /package/script/deps/jsr.io/@std/io/{0.224.9 → 0.225.0}/types.d.ts +0 -0
- /package/script/deps/jsr.io/@std/io/{0.224.9 → 0.225.0}/types.js +0 -0
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
// Copyright 2018-2024 the Deno authors. All rights reserved. MIT license.
|
|
3
3
|
// This module is browser compatible.
|
|
4
4
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
5
|
-
exports.relative =
|
|
5
|
+
exports.relative = relative;
|
|
6
6
|
const constants_js_1 = require("../_common/constants.js");
|
|
7
7
|
const resolve_js_1 = require("./resolve.js");
|
|
8
8
|
const relative_js_1 = require("../_common/relative.js");
|
|
@@ -132,4 +132,3 @@ function relative(from, to) {
|
|
|
132
132
|
return toOrig.slice(toStart, toEnd);
|
|
133
133
|
}
|
|
134
134
|
}
|
|
135
|
-
exports.relative = relative;
|
|
@@ -23,7 +23,7 @@ var __importStar = (this && this.__importStar) || function (mod) {
|
|
|
23
23
|
return result;
|
|
24
24
|
};
|
|
25
25
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
26
|
-
exports.resolve =
|
|
26
|
+
exports.resolve = resolve;
|
|
27
27
|
// Copyright 2018-2024 the Deno authors. All rights reserved. MIT license.
|
|
28
28
|
// This module is browser compatible.
|
|
29
29
|
const dntShim = __importStar(require("../../../../../../_dnt.shims.js"));
|
|
@@ -178,4 +178,3 @@ function resolve(...pathSegments) {
|
|
|
178
178
|
resolvedTail = (0, normalize_string_js_1.normalizeString)(resolvedTail, !resolvedAbsolute, "\\", _util_js_1.isPathSeparator);
|
|
179
179
|
return resolvedDevice + (resolvedAbsolute ? "\\" : "") + resolvedTail || ".";
|
|
180
180
|
}
|
|
181
|
-
exports.resolve = resolve;
|
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
// Copyright 2018-2024 the Deno authors. All rights reserved. MIT license.
|
|
3
3
|
// This module is browser compatible.
|
|
4
4
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
5
|
-
exports.toFileUrl =
|
|
5
|
+
exports.toFileUrl = toFileUrl;
|
|
6
6
|
const to_file_url_js_1 = require("../_common/to_file_url.js");
|
|
7
7
|
const is_absolute_js_1 = require("./is_absolute.js");
|
|
8
8
|
/**
|
|
@@ -35,4 +35,3 @@ function toFileUrl(path) {
|
|
|
35
35
|
}
|
|
36
36
|
return url;
|
|
37
37
|
}
|
|
38
|
-
exports.toFileUrl = toFileUrl;
|
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
// Copyright 2018-2024 the Deno authors. All rights reserved. MIT license.
|
|
3
3
|
// This module is browser compatible.
|
|
4
4
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
5
|
-
exports.toNamespacedPath =
|
|
5
|
+
exports.toNamespacedPath = toNamespacedPath;
|
|
6
6
|
const constants_js_1 = require("../_common/constants.js");
|
|
7
7
|
const _util_js_1 = require("./_util.js");
|
|
8
8
|
const resolve_js_1 = require("./resolve.js");
|
|
@@ -50,4 +50,3 @@ function toNamespacedPath(path) {
|
|
|
50
50
|
}
|
|
51
51
|
return path;
|
|
52
52
|
}
|
|
53
|
-
exports.toNamespacedPath = toNamespacedPath;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.concatUint8Array =
|
|
3
|
+
exports.concatUint8Array = concatUint8Array;
|
|
4
4
|
function concatUint8Array(arr) {
|
|
5
5
|
const length = arr.reduce((pre, next) => pre + next.length, 0);
|
|
6
6
|
const result = new Uint8Array(length);
|
|
@@ -11,4 +11,3 @@ function concatUint8Array(arr) {
|
|
|
11
11
|
}
|
|
12
12
|
return result;
|
|
13
13
|
}
|
|
14
|
-
exports.concatUint8Array = concatUint8Array;
|
|
@@ -26,7 +26,8 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
|
26
26
|
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
27
27
|
};
|
|
28
28
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
29
|
-
exports.
|
|
29
|
+
exports.Deflate = void 0;
|
|
30
|
+
exports.gzip = gzip;
|
|
30
31
|
// from https://github.com/nodeca/pako
|
|
31
32
|
const zlibDeflate = __importStar(require("./zlib/deflate.js"));
|
|
32
33
|
const uint8_js_1 = require("../utils/uint8.js");
|
|
@@ -163,4 +164,3 @@ function gzip(input, options = {}) {
|
|
|
163
164
|
options.gzip = true;
|
|
164
165
|
return deflate(input, options);
|
|
165
166
|
}
|
|
166
|
-
exports.gzip = gzip;
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.default = adler32;
|
|
3
4
|
function adler32(adler, buf, len, pos) {
|
|
4
5
|
let s1 = (adler & 0xffff) | 0;
|
|
5
6
|
let s2 = ((adler >>> 16) & 0xffff) | 0;
|
|
@@ -19,4 +20,3 @@ function adler32(adler, buf, len, pos) {
|
|
|
19
20
|
}
|
|
20
21
|
return (s1 | (s2 << 16)) | 0;
|
|
21
22
|
}
|
|
22
|
-
exports.default = adler32;
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.
|
|
3
|
+
exports.makeTable = makeTable;
|
|
4
|
+
exports.crc32 = crc32;
|
|
4
5
|
function makeTable() {
|
|
5
6
|
let c;
|
|
6
7
|
const table = [];
|
|
@@ -14,7 +15,6 @@ function makeTable() {
|
|
|
14
15
|
}
|
|
15
16
|
return table;
|
|
16
17
|
}
|
|
17
|
-
exports.makeTable = makeTable;
|
|
18
18
|
// Create table on load. Just 255 signed longs. Not a problem.
|
|
19
19
|
const crcTable = makeTable();
|
|
20
20
|
function crc32(crc, buf, len, pos) {
|
|
@@ -27,4 +27,3 @@ function crc32(crc, buf, len, pos) {
|
|
|
27
27
|
}
|
|
28
28
|
return (crc ^ (-1)); // >>> 0;
|
|
29
29
|
}
|
|
30
|
-
exports.crc32 = crc32;
|
|
@@ -26,7 +26,12 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
|
26
26
|
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
27
27
|
};
|
|
28
28
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
29
|
-
exports.
|
|
29
|
+
exports.DeflateState = void 0;
|
|
30
|
+
exports.deflateSetHeader = deflateSetHeader;
|
|
31
|
+
exports.deflateInit2 = deflateInit2;
|
|
32
|
+
exports.deflate = deflate;
|
|
33
|
+
exports.deflateEnd = deflateEnd;
|
|
34
|
+
exports.deflateSetDictionary = deflateSetDictionary;
|
|
30
35
|
const messages_js_1 = require("./messages.js");
|
|
31
36
|
const trees = __importStar(require("./trees.js"));
|
|
32
37
|
const adler32_js_1 = __importDefault(require("./adler32.js"));
|
|
@@ -1490,7 +1495,6 @@ function deflateSetHeader(strm, head) {
|
|
|
1490
1495
|
strm.state.gzhead = head;
|
|
1491
1496
|
return Z_OK;
|
|
1492
1497
|
}
|
|
1493
|
-
exports.deflateSetHeader = deflateSetHeader;
|
|
1494
1498
|
function deflateInit2(strm, level, method, windowBits, memLevel, strategy) {
|
|
1495
1499
|
if (!strm) { // === Z_NULL
|
|
1496
1500
|
return status_js_1.default.Z_STREAM_ERROR;
|
|
@@ -1549,7 +1553,6 @@ function deflateInit2(strm, level, method, windowBits, memLevel, strategy) {
|
|
|
1549
1553
|
s.method = method;
|
|
1550
1554
|
return deflateReset(strm);
|
|
1551
1555
|
}
|
|
1552
|
-
exports.deflateInit2 = deflateInit2;
|
|
1553
1556
|
function deflateInit(strm, level) {
|
|
1554
1557
|
return deflateInit2(strm, level, Z_DEFLATED, MAX_WBITS, DEF_MEM_LEVEL, Z_DEFAULT_STRATEGY);
|
|
1555
1558
|
}
|
|
@@ -1874,7 +1877,6 @@ function deflate(strm, flush) {
|
|
|
1874
1877
|
/* write the trailer only once! */
|
|
1875
1878
|
return s.pending !== 0 ? Z_OK : Z_STREAM_END;
|
|
1876
1879
|
}
|
|
1877
|
-
exports.deflate = deflate;
|
|
1878
1880
|
function deflateEnd(strm) {
|
|
1879
1881
|
let status;
|
|
1880
1882
|
if (!strm /*== Z_NULL*/ || !strm.state /*== Z_NULL*/) {
|
|
@@ -1893,7 +1895,6 @@ function deflateEnd(strm) {
|
|
|
1893
1895
|
strm.state = null;
|
|
1894
1896
|
return status === BUSY_STATE ? err(strm, status_js_1.default.Z_DATA_ERROR) : Z_OK;
|
|
1895
1897
|
}
|
|
1896
|
-
exports.deflateEnd = deflateEnd;
|
|
1897
1898
|
/* =========================================================================
|
|
1898
1899
|
* Initializes the compression dictionary from the given byte
|
|
1899
1900
|
* sequence without producing any compressed output.
|
|
@@ -1973,4 +1974,3 @@ function deflateSetDictionary(strm, dictionary) {
|
|
|
1973
1974
|
s.wrap = wrap;
|
|
1974
1975
|
return Z_OK;
|
|
1975
1976
|
}
|
|
1976
|
-
exports.deflateSetDictionary = deflateSetDictionary;
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.default = inflate_fast;
|
|
3
4
|
// See state defs from inflate.js
|
|
4
5
|
const BAD = 30; /* got a data error -- remain here until reset */
|
|
5
6
|
const TYPE = 12; /* i: waiting for type bits, including last-flag bit */
|
|
@@ -321,4 +322,3 @@ function inflate_fast(strm, start) {
|
|
|
321
322
|
state.bits = bits;
|
|
322
323
|
return;
|
|
323
324
|
}
|
|
324
|
-
exports.default = inflate_fast;
|
|
@@ -3,7 +3,16 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
|
3
3
|
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
4
|
};
|
|
5
5
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
-
exports.
|
|
6
|
+
exports.InflateState = void 0;
|
|
7
|
+
exports.inflateResetKeep = inflateResetKeep;
|
|
8
|
+
exports.inflateReset = inflateReset;
|
|
9
|
+
exports.inflateReset2 = inflateReset2;
|
|
10
|
+
exports.inflateInit2 = inflateInit2;
|
|
11
|
+
exports.inflateInit = inflateInit;
|
|
12
|
+
exports.inflate = inflate;
|
|
13
|
+
exports.inflateEnd = inflateEnd;
|
|
14
|
+
exports.inflateGetHeader = inflateGetHeader;
|
|
15
|
+
exports.inflateSetDictionary = inflateSetDictionary;
|
|
7
16
|
const adler32_js_1 = __importDefault(require("./adler32.js"));
|
|
8
17
|
const crc32_js_1 = require("./crc32.js");
|
|
9
18
|
const inffast_js_1 = __importDefault(require("./inffast.js"));
|
|
@@ -335,7 +344,6 @@ function inflateResetKeep(strm) {
|
|
|
335
344
|
//Tracev((stderr, "inflate: reset\n"));
|
|
336
345
|
return Z_OK;
|
|
337
346
|
}
|
|
338
|
-
exports.inflateResetKeep = inflateResetKeep;
|
|
339
347
|
function inflateReset(strm) {
|
|
340
348
|
let state;
|
|
341
349
|
if (!strm || !strm.state)
|
|
@@ -346,7 +354,6 @@ function inflateReset(strm) {
|
|
|
346
354
|
state.wnext = 0;
|
|
347
355
|
return inflateResetKeep(strm);
|
|
348
356
|
}
|
|
349
|
-
exports.inflateReset = inflateReset;
|
|
350
357
|
function inflateReset2(strm, windowBits) {
|
|
351
358
|
let wrap;
|
|
352
359
|
let state;
|
|
@@ -377,7 +384,6 @@ function inflateReset2(strm, windowBits) {
|
|
|
377
384
|
state.wbits = windowBits;
|
|
378
385
|
return inflateReset(strm);
|
|
379
386
|
}
|
|
380
|
-
exports.inflateReset2 = inflateReset2;
|
|
381
387
|
function inflateInit2(strm, windowBits) {
|
|
382
388
|
let ret;
|
|
383
389
|
let state;
|
|
@@ -395,11 +401,9 @@ function inflateInit2(strm, windowBits) {
|
|
|
395
401
|
}
|
|
396
402
|
return ret;
|
|
397
403
|
}
|
|
398
|
-
exports.inflateInit2 = inflateInit2;
|
|
399
404
|
function inflateInit(strm) {
|
|
400
405
|
return inflateInit2(strm, DEF_WBITS);
|
|
401
406
|
}
|
|
402
|
-
exports.inflateInit = inflateInit;
|
|
403
407
|
/*
|
|
404
408
|
Return state with length and distance decoding tables and index sizes set to
|
|
405
409
|
fixed code decoding. Normally this returns fixed tables from inffixed.h.
|
|
@@ -1613,7 +1617,6 @@ function inflate(strm, flush) {
|
|
|
1613
1617
|
}
|
|
1614
1618
|
return ret;
|
|
1615
1619
|
}
|
|
1616
|
-
exports.inflate = inflate;
|
|
1617
1620
|
function inflateEnd(strm) {
|
|
1618
1621
|
if (!strm || !strm.state /*|| strm->zfree == (free_func)0*/) {
|
|
1619
1622
|
return Z_STREAM_ERROR;
|
|
@@ -1625,7 +1628,6 @@ function inflateEnd(strm) {
|
|
|
1625
1628
|
strm.state = null;
|
|
1626
1629
|
return Z_OK;
|
|
1627
1630
|
}
|
|
1628
|
-
exports.inflateEnd = inflateEnd;
|
|
1629
1631
|
function inflateGetHeader(strm, head) {
|
|
1630
1632
|
let state;
|
|
1631
1633
|
/* check state */
|
|
@@ -1639,7 +1641,6 @@ function inflateGetHeader(strm, head) {
|
|
|
1639
1641
|
head.done = false;
|
|
1640
1642
|
return Z_OK;
|
|
1641
1643
|
}
|
|
1642
|
-
exports.inflateGetHeader = inflateGetHeader;
|
|
1643
1644
|
function inflateSetDictionary(strm, dictionary) {
|
|
1644
1645
|
let dictLength = dictionary.length;
|
|
1645
1646
|
let state;
|
|
@@ -1673,4 +1674,3 @@ function inflateSetDictionary(strm, dictionary) {
|
|
|
1673
1674
|
// Tracev((stderr, "inflate: dictionary set\n"));
|
|
1674
1675
|
return Z_OK;
|
|
1675
1676
|
}
|
|
1676
|
-
exports.inflateSetDictionary = inflateSetDictionary;
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.default = inflate_table;
|
|
3
4
|
const MAXBITS = 15;
|
|
4
5
|
const ENOUGH_LENS = 852;
|
|
5
6
|
const ENOUGH_DISTS = 592;
|
|
@@ -355,4 +356,3 @@ function inflate_table(type, lens, lens_index, codes, table, table_index, work,
|
|
|
355
356
|
opts.bits = root;
|
|
356
357
|
return 0;
|
|
357
358
|
}
|
|
358
|
-
exports.default = inflate_table;
|
|
@@ -1,6 +1,10 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.
|
|
3
|
+
exports._tr_init = _tr_init;
|
|
4
|
+
exports._tr_stored_block = _tr_stored_block;
|
|
5
|
+
exports._tr_align = _tr_align;
|
|
6
|
+
exports._tr_flush_block = _tr_flush_block;
|
|
7
|
+
exports._tr_tally = _tr_tally;
|
|
4
8
|
//const Z_FILTERED = 1;
|
|
5
9
|
//const Z_HUFFMAN_ONLY = 2;
|
|
6
10
|
//const Z_RLE = 3;
|
|
@@ -971,7 +975,6 @@ function _tr_init(s) {
|
|
|
971
975
|
/* Initialize the first block of the first file: */
|
|
972
976
|
init_block(s);
|
|
973
977
|
}
|
|
974
|
-
exports._tr_init = _tr_init;
|
|
975
978
|
/* ===========================================================================
|
|
976
979
|
* Send a stored block
|
|
977
980
|
*/
|
|
@@ -979,7 +982,6 @@ function _tr_stored_block(s, buf, stored_len, last) {
|
|
|
979
982
|
send_bits(s, (STORED_BLOCK << 1) + (last ? 1 : 0), 3); /* send block type */
|
|
980
983
|
copy_block(s, buf, stored_len, true); /* with header */
|
|
981
984
|
}
|
|
982
|
-
exports._tr_stored_block = _tr_stored_block;
|
|
983
985
|
/* ===========================================================================
|
|
984
986
|
* Send one empty static block to give enough lookahead for inflate.
|
|
985
987
|
* This takes 10 bits, of which 7 may remain in the bit buffer.
|
|
@@ -989,7 +991,6 @@ function _tr_align(s) {
|
|
|
989
991
|
send_code(s, END_BLOCK, static_ltree);
|
|
990
992
|
bi_flush(s);
|
|
991
993
|
}
|
|
992
|
-
exports._tr_align = _tr_align;
|
|
993
994
|
/* ===========================================================================
|
|
994
995
|
* Determine the best encoding for the current block: dynamic trees, static
|
|
995
996
|
* trees or store, and output the encoded block to the zip file.
|
|
@@ -1060,7 +1061,6 @@ function _tr_flush_block(s, buf, stored_len, last) {
|
|
|
1060
1061
|
// Tracev((stderr,"\ncomprlen %lu(%lu) ", s->compressed_len>>3,
|
|
1061
1062
|
// s->compressed_len-7*last));
|
|
1062
1063
|
}
|
|
1063
|
-
exports._tr_flush_block = _tr_flush_block;
|
|
1064
1064
|
/* ===========================================================================
|
|
1065
1065
|
* Save the match info and tally the frequency counts. Return true if
|
|
1066
1066
|
* the current block must be flushed.
|
|
@@ -1112,4 +1112,3 @@ function _tr_tally(s, dist, lc) {
|
|
|
1112
1112
|
* 64K-1 bytes.
|
|
1113
1113
|
*/
|
|
1114
1114
|
}
|
|
1115
|
-
exports._tr_tally = _tr_tally;
|
|
@@ -23,7 +23,7 @@ var __importStar = (this && this.__importStar) || function (mod) {
|
|
|
23
23
|
return result;
|
|
24
24
|
};
|
|
25
25
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
26
|
-
exports.readN =
|
|
26
|
+
exports.readN = readN;
|
|
27
27
|
const dntShim = __importStar(require("../../../../../_dnt.shims.js"));
|
|
28
28
|
async function readN(reader, n) {
|
|
29
29
|
const out = new Uint8Array(n);
|
|
@@ -37,4 +37,3 @@ async function readN(reader, n) {
|
|
|
37
37
|
}
|
|
38
38
|
return out;
|
|
39
39
|
}
|
|
40
|
-
exports.readN = readN;
|
|
@@ -19,7 +19,13 @@
|
|
|
19
19
|
* along with this program. If not, see <https://www.gnu.org/licenses/>.
|
|
20
20
|
*/
|
|
21
21
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
22
|
-
exports.
|
|
22
|
+
exports.ValueType = void 0;
|
|
23
|
+
exports.toString = toString;
|
|
24
|
+
exports.fromString = fromString;
|
|
25
|
+
exports.fixKey = fixKey;
|
|
26
|
+
exports.restoreKey = restoreKey;
|
|
27
|
+
exports.getPrefixKeyRange = getPrefixKeyRange;
|
|
28
|
+
exports.isInRange = isInRange;
|
|
23
29
|
const _0_deps_js_1 = require("../0_deps.js");
|
|
24
30
|
const _0_deps_js_2 = require("../0_deps.js");
|
|
25
31
|
var ValueType;
|
|
@@ -67,7 +73,6 @@ function toString(value) {
|
|
|
67
73
|
(0, _0_deps_js_2.unreachable)();
|
|
68
74
|
}
|
|
69
75
|
}
|
|
70
|
-
exports.toString = toString;
|
|
71
76
|
function fromString(string) {
|
|
72
77
|
const [type, value] = [Number(string[0]), string.slice(1)];
|
|
73
78
|
switch (type) {
|
|
@@ -110,11 +115,9 @@ function fromString(string) {
|
|
|
110
115
|
}
|
|
111
116
|
}
|
|
112
117
|
}
|
|
113
|
-
exports.fromString = fromString;
|
|
114
118
|
function fixKey(key) {
|
|
115
119
|
return key.map((v) => typeof v === "bigint" ? String(ValueType.BigInt) + String(v) : typeof v === "string" ? String(ValueType.String) + v : v);
|
|
116
120
|
}
|
|
117
|
-
exports.fixKey = fixKey;
|
|
118
121
|
function restoreKey(key) {
|
|
119
122
|
return key.map((v) => {
|
|
120
123
|
if (typeof v === "string") {
|
|
@@ -134,7 +137,6 @@ function restoreKey(key) {
|
|
|
134
137
|
}
|
|
135
138
|
});
|
|
136
139
|
}
|
|
137
|
-
exports.restoreKey = restoreKey;
|
|
138
140
|
// Source: https://gist.github.com/inexorabletash/5462871
|
|
139
141
|
// deno-lint-ignore no-explicit-any
|
|
140
142
|
function getPrefixKeyRange(prefix) {
|
|
@@ -146,7 +148,6 @@ function getPrefixKeyRange(prefix) {
|
|
|
146
148
|
return IDBKeyRange.lowerBound(prefix);
|
|
147
149
|
return IDBKeyRange.bound(prefix, upperKey, false, true);
|
|
148
150
|
}
|
|
149
|
-
exports.getPrefixKeyRange = getPrefixKeyRange;
|
|
150
151
|
const MAX_DATE_VALUE = 8640000000000000;
|
|
151
152
|
const UPPER_BOUND = {
|
|
152
153
|
NUMBER: new Date(-MAX_DATE_VALUE),
|
|
@@ -213,4 +214,3 @@ function isInRange(key, start, end) {
|
|
|
213
214
|
}
|
|
214
215
|
return true;
|
|
215
216
|
}
|
|
216
|
-
exports.isInRange = isInRange;
|
package/script/tl/1_utilities.js
CHANGED
|
@@ -20,13 +20,20 @@
|
|
|
20
20
|
*/
|
|
21
21
|
// deno-lint-ignore-file no-explicit-any
|
|
22
22
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
23
|
-
exports.
|
|
23
|
+
exports.isOptionalParam = isOptionalParam;
|
|
24
|
+
exports.analyzeOptionalParam = analyzeOptionalParam;
|
|
25
|
+
exports.isValidType = isValidType;
|
|
26
|
+
exports.assertIsValidType = assertIsValidType;
|
|
27
|
+
exports.is = is;
|
|
28
|
+
exports.isOneOf = isOneOf;
|
|
29
|
+
exports.isOfEnum = isOfEnum;
|
|
30
|
+
exports.as = as;
|
|
31
|
+
exports.isGenericFunction = isGenericFunction;
|
|
24
32
|
const _0_deps_js_1 = require("../0_deps.js");
|
|
25
33
|
const _0_api_js_1 = require("./0_api.js");
|
|
26
34
|
function isOptionalParam(ntype) {
|
|
27
35
|
return ntype.includes("?");
|
|
28
36
|
}
|
|
29
|
-
exports.isOptionalParam = isOptionalParam;
|
|
30
37
|
function analyzeOptionalParam(ntype) {
|
|
31
38
|
if (!isOptionalParam(ntype)) {
|
|
32
39
|
throw new Error("Parameter not optional");
|
|
@@ -37,17 +44,14 @@ function analyzeOptionalParam(ntype) {
|
|
|
37
44
|
(0, _0_deps_js_1.assertFalse)(isNaN(bitIndex));
|
|
38
45
|
return { flagField, bitIndex };
|
|
39
46
|
}
|
|
40
|
-
exports.analyzeOptionalParam = analyzeOptionalParam;
|
|
41
47
|
function isValidType(object) {
|
|
42
48
|
return object != null && typeof object === "object" && typeof object._ === "string" && (0, _0_api_js_1.getType)(object._) !== undefined;
|
|
43
49
|
}
|
|
44
|
-
exports.isValidType = isValidType;
|
|
45
50
|
function assertIsValidType(object) {
|
|
46
51
|
if (!isValidType(object)) {
|
|
47
52
|
throw new Error("Invalid object");
|
|
48
53
|
}
|
|
49
54
|
}
|
|
50
|
-
exports.assertIsValidType = assertIsValidType;
|
|
51
55
|
function is(typeName, value) {
|
|
52
56
|
if (!isValidType(value)) {
|
|
53
57
|
return false;
|
|
@@ -56,15 +60,12 @@ function is(typeName, value) {
|
|
|
56
60
|
return value._ === typeName;
|
|
57
61
|
}
|
|
58
62
|
}
|
|
59
|
-
exports.is = is;
|
|
60
63
|
function isOneOf(typeNames, value) {
|
|
61
64
|
return typeNames.some((v) => is(v, value));
|
|
62
65
|
}
|
|
63
|
-
exports.isOneOf = isOneOf;
|
|
64
66
|
function isOfEnum(enumName, value) {
|
|
65
67
|
return isOneOf((0, _0_api_js_1.getEnum)(enumName) ?? [], value);
|
|
66
68
|
}
|
|
67
|
-
exports.isOfEnum = isOfEnum;
|
|
68
69
|
function as(typeName, value) {
|
|
69
70
|
if (is(typeName, value)) {
|
|
70
71
|
return value;
|
|
@@ -73,7 +74,6 @@ function as(typeName, value) {
|
|
|
73
74
|
(0, _0_deps_js_1.unreachable)();
|
|
74
75
|
}
|
|
75
76
|
}
|
|
76
|
-
exports.as = as;
|
|
77
77
|
const GENERIC_FUNCTIONS = [
|
|
78
78
|
"invokeAfterMsg",
|
|
79
79
|
"invokeAfterMsgs",
|
|
@@ -86,4 +86,3 @@ const GENERIC_FUNCTIONS = [
|
|
|
86
86
|
function isGenericFunction(value) {
|
|
87
87
|
return isOneOf(GENERIC_FUNCTIONS, value);
|
|
88
88
|
}
|
|
89
|
-
exports.isGenericFunction = isGenericFunction;
|
|
@@ -20,7 +20,7 @@
|
|
|
20
20
|
*/
|
|
21
21
|
// deno-lint-ignore-file no-explicit-any
|
|
22
22
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
23
|
-
exports.deserialize =
|
|
23
|
+
exports.deserialize = deserialize;
|
|
24
24
|
const _0_deps_js_1 = require("../0_deps.js");
|
|
25
25
|
const _1_utilities_js_1 = require("./1_utilities.js");
|
|
26
26
|
const _0_api_js_1 = require("./0_api.js");
|
|
@@ -96,4 +96,3 @@ function deserialize(reader, paramDesc, name) {
|
|
|
96
96
|
}
|
|
97
97
|
return type_;
|
|
98
98
|
}
|
|
99
|
-
exports.deserialize = deserialize;
|
package/script/tl/2_serialize.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.serialize =
|
|
3
|
+
exports.serialize = serialize;
|
|
4
4
|
/**
|
|
5
5
|
* MTKruto - Cross-runtime JavaScript library for building Telegram clients
|
|
6
6
|
* Copyright (C) 2023-2024 Roj <https://roj.im/>
|
|
@@ -161,4 +161,3 @@ function serialize(type_) {
|
|
|
161
161
|
}
|
|
162
162
|
return writer.buffer;
|
|
163
163
|
}
|
|
164
|
-
exports.serialize = serialize;
|
package/script/tl/3_utilities.js
CHANGED
|
@@ -19,13 +19,17 @@
|
|
|
19
19
|
* along with this program. If not, see <https://www.gnu.org/licenses/>.
|
|
20
20
|
*/
|
|
21
21
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
22
|
-
exports.
|
|
22
|
+
exports.getChannelChatId = getChannelChatId;
|
|
23
|
+
exports.peerToChatId = peerToChatId;
|
|
24
|
+
exports.chatIdToPeer = chatIdToPeer;
|
|
25
|
+
exports.chatIdToPeerId = chatIdToPeerId;
|
|
26
|
+
exports.getChatIdPeerType = getChatIdPeerType;
|
|
27
|
+
exports.inputPeerToPeer = inputPeerToPeer;
|
|
23
28
|
const _0_deps_js_1 = require("../0_deps.js");
|
|
24
29
|
const _1_utilities_js_1 = require("../1_utilities.js");
|
|
25
30
|
function getChannelChatId(channelId) {
|
|
26
31
|
return _1_utilities_js_1.ZERO_CHANNEL_ID + -Number(channelId);
|
|
27
32
|
}
|
|
28
|
-
exports.getChannelChatId = getChannelChatId;
|
|
29
33
|
function peerToChatId(peer) {
|
|
30
34
|
if (("_" in peer && (peer._ == "peerUser" || peer._ == "inputPeerUser" || peer._ == "inputPeerUserFromMessage" || peer._ == "user" || peer._ == "userFull")) || "user_id" in peer) {
|
|
31
35
|
return Number("user_id" in peer ? peer.user_id : peer.id);
|
|
@@ -40,7 +44,6 @@ function peerToChatId(peer) {
|
|
|
40
44
|
(0, _0_deps_js_1.unreachable)();
|
|
41
45
|
}
|
|
42
46
|
}
|
|
43
|
-
exports.peerToChatId = peerToChatId;
|
|
44
47
|
function chatIdToPeer(chatId) {
|
|
45
48
|
if (chatId > 0) {
|
|
46
49
|
return { _: "peerUser", user_id: BigInt(chatId) };
|
|
@@ -52,7 +55,6 @@ function chatIdToPeer(chatId) {
|
|
|
52
55
|
return { _: "peerChannel", channel_id: BigInt(_1_utilities_js_1.ZERO_CHANNEL_ID - chatId) };
|
|
53
56
|
}
|
|
54
57
|
}
|
|
55
|
-
exports.chatIdToPeer = chatIdToPeer;
|
|
56
58
|
function chatIdToPeerId(chatId) {
|
|
57
59
|
const peer = chatIdToPeer(chatId);
|
|
58
60
|
if ("user_id" in peer) {
|
|
@@ -68,7 +70,6 @@ function chatIdToPeerId(chatId) {
|
|
|
68
70
|
(0, _0_deps_js_1.unreachable)();
|
|
69
71
|
}
|
|
70
72
|
}
|
|
71
|
-
exports.chatIdToPeerId = chatIdToPeerId;
|
|
72
73
|
function getChatIdPeerType(chatId) {
|
|
73
74
|
if (chatId > 0) {
|
|
74
75
|
return "user";
|
|
@@ -80,7 +81,6 @@ function getChatIdPeerType(chatId) {
|
|
|
80
81
|
return "channel";
|
|
81
82
|
}
|
|
82
83
|
}
|
|
83
|
-
exports.getChatIdPeerType = getChatIdPeerType;
|
|
84
84
|
function inputPeerToPeer(inputPeer) {
|
|
85
85
|
if ("user_id" in inputPeer) {
|
|
86
86
|
return { ...inputPeer, _: "peerUser" };
|
|
@@ -95,4 +95,3 @@ function inputPeerToPeer(inputPeer) {
|
|
|
95
95
|
(0, _0_deps_js_1.unreachable)();
|
|
96
96
|
}
|
|
97
97
|
}
|
|
98
|
-
exports.inputPeerToPeer = inputPeerToPeer;
|
|
@@ -19,7 +19,8 @@
|
|
|
19
19
|
* along with this program. If not, see <https://www.gnu.org/licenses/>.
|
|
20
20
|
*/
|
|
21
21
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
22
|
-
exports.
|
|
22
|
+
exports.RPC_RESULT_ID = void 0;
|
|
23
|
+
exports.deserializeRpcResult = deserializeRpcResult;
|
|
23
24
|
const _3_tl_reader_js_1 = require("./3_tl_reader.js");
|
|
24
25
|
// rpc_result#f35c6d01 req_msg_id:long result:Object = RpcResult;
|
|
25
26
|
exports.RPC_RESULT_ID = 0xF35C6D01;
|
|
@@ -29,4 +30,3 @@ function deserializeRpcResult(buffer) {
|
|
|
29
30
|
const result = reader.readObject();
|
|
30
31
|
return { _: "rpc_result", req_msg_id: messageId, result };
|
|
31
32
|
}
|
|
32
|
-
exports.deserializeRpcResult = deserializeRpcResult;
|
package/script/tl/5_message.js
CHANGED
|
@@ -19,7 +19,12 @@
|
|
|
19
19
|
* along with this program. If not, see <https://www.gnu.org/licenses/>.
|
|
20
20
|
*/
|
|
21
21
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
22
|
-
exports.
|
|
22
|
+
exports.MSG_CONTAINER_ID = void 0;
|
|
23
|
+
exports.calculateLength = calculateLength;
|
|
24
|
+
exports.serializeMessage = serializeMessage;
|
|
25
|
+
exports.deserializeMessage = deserializeMessage;
|
|
26
|
+
exports.serializeMsgContainer = serializeMsgContainer;
|
|
27
|
+
exports.deserializeMsgContainer = deserializeMsgContainer;
|
|
23
28
|
const _2_serialize_js_1 = require("./2_serialize.js");
|
|
24
29
|
const _3_tl_reader_js_1 = require("./3_tl_reader.js");
|
|
25
30
|
const _4_rpc_result_js_1 = require("./4_rpc_result.js");
|
|
@@ -44,7 +49,6 @@ function calculateLength(object) {
|
|
|
44
49
|
}
|
|
45
50
|
return length;
|
|
46
51
|
}
|
|
47
|
-
exports.calculateLength = calculateLength;
|
|
48
52
|
function serializeMessage(message) {
|
|
49
53
|
if (message.body._ == "rpc_result") {
|
|
50
54
|
throw new Error("Not applicable");
|
|
@@ -61,7 +65,6 @@ function serializeMessage(message) {
|
|
|
61
65
|
}
|
|
62
66
|
return writer.buffer;
|
|
63
67
|
}
|
|
64
|
-
exports.serializeMessage = serializeMessage;
|
|
65
68
|
function deserializeMessage(reader) {
|
|
66
69
|
const id_ = reader.readInt64();
|
|
67
70
|
const seqno = reader.readInt32();
|
|
@@ -82,7 +85,6 @@ function deserializeMessage(reader) {
|
|
|
82
85
|
}
|
|
83
86
|
return { _: "message", msg_id: id_, seqno, body };
|
|
84
87
|
}
|
|
85
|
-
exports.deserializeMessage = deserializeMessage;
|
|
86
88
|
exports.MSG_CONTAINER_ID = 0x73F1F8DC;
|
|
87
89
|
function serializeMsgContainer(msgContainer) {
|
|
88
90
|
const writer = new _4_tl_writer_js_1.TLWriter();
|
|
@@ -93,7 +95,6 @@ function serializeMsgContainer(msgContainer) {
|
|
|
93
95
|
}
|
|
94
96
|
return writer.buffer;
|
|
95
97
|
}
|
|
96
|
-
exports.serializeMsgContainer = serializeMsgContainer;
|
|
97
98
|
function deserializeMsgContainer(buffer) {
|
|
98
99
|
const reader = new _3_tl_reader_js_1.TLReader(buffer);
|
|
99
100
|
const length = reader.readInt32();
|
|
@@ -103,4 +104,3 @@ function deserializeMsgContainer(buffer) {
|
|
|
103
104
|
}
|
|
104
105
|
return { _: "msg_container", messages };
|
|
105
106
|
}
|
|
106
|
-
exports.deserializeMsgContainer = deserializeMsgContainer;
|
|
@@ -23,7 +23,7 @@ var __importStar = (this && this.__importStar) || function (mod) {
|
|
|
23
23
|
return result;
|
|
24
24
|
};
|
|
25
25
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
26
|
-
exports.getObfuscationParameters =
|
|
26
|
+
exports.getObfuscationParameters = getObfuscationParameters;
|
|
27
27
|
/**
|
|
28
28
|
* MTKruto - Cross-runtime JavaScript library for building Telegram clients
|
|
29
29
|
* Copyright (C) 2023-2024 Roj <https://roj.im/>
|
|
@@ -76,4 +76,3 @@ async function getObfuscationParameters(protocol, connection) {
|
|
|
76
76
|
await connection.write((0, _0_deps_js_1.concat)([init.subarray(0, 56), encryptedInit.subarray(56, 56 + 8)]));
|
|
77
77
|
return { encryptionCTR, decryptionCTR };
|
|
78
78
|
}
|
|
79
|
-
exports.getObfuscationParameters = getObfuscationParameters;
|
|
@@ -19,7 +19,9 @@
|
|
|
19
19
|
* along with this program. If not, see <https://www.gnu.org/licenses/>.
|
|
20
20
|
*/
|
|
21
21
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
22
|
-
exports.
|
|
22
|
+
exports.getDcIps = getDcIps;
|
|
23
|
+
exports.getDcId = getDcId;
|
|
24
|
+
exports.getDc = getDc;
|
|
23
25
|
const _0_deps_js_1 = require("../0_deps.js");
|
|
24
26
|
function getDcIps(dc, version) {
|
|
25
27
|
switch (version) {
|
|
@@ -71,17 +73,14 @@ function getDcIps(dc, version) {
|
|
|
71
73
|
(0, _0_deps_js_1.unreachable)();
|
|
72
74
|
}
|
|
73
75
|
}
|
|
74
|
-
exports.getDcIps = getDcIps;
|
|
75
76
|
function getDcId(dc, cdn) {
|
|
76
|
-
return Number(dc[0]) + (dc.endsWith("-test") ?
|
|
77
|
+
return Number(dc[0]) + (dc.endsWith("-test") ? 10_000 : 0) * (cdn ? -1 : 1);
|
|
77
78
|
}
|
|
78
|
-
exports.getDcId = getDcId;
|
|
79
79
|
function getDc(dcId) {
|
|
80
80
|
dcId = Math.abs(dcId);
|
|
81
|
-
const test = dcId >=
|
|
82
|
-
if (dcId >=
|
|
83
|
-
dcId -=
|
|
81
|
+
const test = dcId >= 10_000;
|
|
82
|
+
if (dcId >= 10_000) {
|
|
83
|
+
dcId -= 10_000;
|
|
84
84
|
}
|
|
85
85
|
return `${dcId}${test ? "-test" : ""}`;
|
|
86
86
|
}
|
|
87
|
-
exports.getDc = getDc;
|