dsh-remote 0.8.46 → 0.8.48
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/LICENSE +21 -21
- package/README.en.md +361 -361
- package/README.md +368 -368
- package/cordis.patch.yml +9 -9
- package/lib/binding.js +172 -172
- package/lib/client.js +3637 -3637
- package/lib/credential.js +177 -177
- package/lib/deploy-tasks.js +142 -142
- package/lib/errors.js +87 -87
- package/lib/file-reference.js +457 -457
- package/lib/forwards.js +258 -258
- package/lib/hostkey.js +108 -108
- package/lib/http-transport.js +196 -196
- package/lib/ignore.js +202 -156
- package/lib/index.js +3779 -3747
- package/lib/openssh.js +838 -838
- package/lib/paths.js +225 -225
- package/lib/pool.js +757 -757
- package/lib/registry.js +95 -95
- package/lib/remote-fs.js +148 -143
- package/lib/routes-fs.js +233 -233
- package/lib/search.js +235 -230
- package/lib/sftp-surface.js +76 -76
- package/lib/sshconfig.js +454 -454
- package/lib/sync.js +275 -275
- package/lib/tasks.js +95 -95
- package/lib/telemetry.js +213 -213
- package/lib/update.js +472 -472
- package/lib/web-attach.js +850 -850
- package/lib/web-deploy-skill.js +205 -205
- package/lib/web-deploy.js +694 -694
- package/node_modules/asn1/Jenkinsfile +65 -0
- package/node_modules/asn1/LICENSE +19 -0
- package/node_modules/asn1/README.md +50 -0
- package/node_modules/asn1/lib/ber/errors.js +13 -0
- package/node_modules/asn1/lib/ber/index.js +27 -0
- package/node_modules/asn1/lib/ber/reader.js +262 -0
- package/node_modules/asn1/lib/ber/types.js +36 -0
- package/node_modules/asn1/lib/ber/writer.js +317 -0
- package/node_modules/asn1/lib/index.js +20 -0
- package/node_modules/asn1/package.json +31 -0
- package/node_modules/bcrypt-pbkdf/CONTRIBUTING.md +13 -0
- package/node_modules/bcrypt-pbkdf/LICENSE +66 -0
- package/node_modules/bcrypt-pbkdf/README.md +45 -0
- package/node_modules/bcrypt-pbkdf/index.js +556 -0
- package/node_modules/bcrypt-pbkdf/package.json +15 -0
- package/node_modules/buildcheck/.eslintrc.js +5 -0
- package/node_modules/buildcheck/.github/workflows/ci.yml +88 -0
- package/node_modules/buildcheck/.github/workflows/lint.yml +27 -0
- package/node_modules/buildcheck/.npmignore +3 -0
- package/node_modules/buildcheck/LICENSE +19 -0
- package/node_modules/buildcheck/README.md +106 -0
- package/node_modules/buildcheck/deps/Find-VisualStudio.cs +250 -0
- package/node_modules/buildcheck/lib/findvs.js +361 -0
- package/node_modules/buildcheck/lib/index.js +738 -0
- package/node_modules/buildcheck/package.json +36 -0
- package/node_modules/buildcheck/test/test.js +8 -0
- package/node_modules/cpu-features/.eslintrc.js +5 -0
- package/node_modules/cpu-features/.github/workflows/ci.yml +74 -0
- package/node_modules/cpu-features/.github/workflows/lint.yml +27 -0
- package/node_modules/cpu-features/LICENSE +19 -0
- package/node_modules/cpu-features/README.md +59 -0
- package/node_modules/cpu-features/binding.gyp +16 -0
- package/node_modules/cpu-features/buildcheck.js +32 -0
- package/node_modules/cpu-features/deps/cpu_features/.clang-format +4 -0
- package/node_modules/cpu-features/deps/cpu_features/.dockerignore +31 -0
- package/node_modules/cpu-features/deps/cpu_features/.github/workflows/Dockerfile +5 -0
- package/node_modules/cpu-features/deps/cpu_features/.github/workflows/aarch64_linux_cmake.yml +30 -0
- package/node_modules/cpu-features/deps/cpu_features/.github/workflows/amd64_freebsd_cmake.yml +22 -0
- package/node_modules/cpu-features/deps/cpu_features/.github/workflows/amd64_linux_bazel.yml +26 -0
- package/node_modules/cpu-features/deps/cpu_features/.github/workflows/amd64_linux_cmake.yml +31 -0
- package/node_modules/cpu-features/deps/cpu_features/.github/workflows/amd64_macos_cmake.yml +43 -0
- package/node_modules/cpu-features/deps/cpu_features/.github/workflows/amd64_windows_cmake.yml +25 -0
- package/node_modules/cpu-features/deps/cpu_features/.github/workflows/arm_linux_cmake.yml +31 -0
- package/node_modules/cpu-features/deps/cpu_features/.github/workflows/clang_format.yml +24 -0
- package/node_modules/cpu-features/deps/cpu_features/.github/workflows/mips_linux_cmake.yml +30 -0
- package/node_modules/cpu-features/deps/cpu_features/.github/workflows/power_linux_cmake.yml +29 -0
- package/node_modules/cpu-features/deps/cpu_features/.github/workflows/riscv_linux_cmake.yml +28 -0
- package/node_modules/cpu-features/deps/cpu_features/.github/workflows/s390x_linux_cmake.yml +27 -0
- package/node_modules/cpu-features/deps/cpu_features/.grenrc.yml +21 -0
- package/node_modules/cpu-features/deps/cpu_features/BUILD.bazel +329 -0
- package/node_modules/cpu-features/deps/cpu_features/CMakeLists.txt +261 -0
- package/node_modules/cpu-features/deps/cpu_features/CONTRIBUTING.md +23 -0
- package/node_modules/cpu-features/deps/cpu_features/LICENSE +230 -0
- package/node_modules/cpu-features/deps/cpu_features/README.md +272 -0
- package/node_modules/cpu-features/deps/cpu_features/WORKSPACE +19 -0
- package/node_modules/cpu-features/deps/cpu_features/bazel/ci/README.md +5 -0
- package/node_modules/cpu-features/deps/cpu_features/bazel/platforms.bzl +11 -0
- package/node_modules/cpu-features/deps/cpu_features/cmake/CpuFeaturesConfig.cmake.in +3 -0
- package/node_modules/cpu-features/deps/cpu_features/cmake/CpuFeaturesNdkCompatConfig.cmake.in +3 -0
- package/node_modules/cpu-features/deps/cpu_features/cmake/README.md +30 -0
- package/node_modules/cpu-features/deps/cpu_features/cmake/ci/Makefile +252 -0
- package/node_modules/cpu-features/deps/cpu_features/cmake/ci/README.md +40 -0
- package/node_modules/cpu-features/deps/cpu_features/cmake/ci/doc/docker.dot +64 -0
- package/node_modules/cpu-features/deps/cpu_features/cmake/ci/doc/docker.svg +312 -0
- package/node_modules/cpu-features/deps/cpu_features/cmake/ci/doc/generate_image.sh +7 -0
- package/node_modules/cpu-features/deps/cpu_features/cmake/ci/docker/amd64/Dockerfile +48 -0
- package/node_modules/cpu-features/deps/cpu_features/cmake/ci/docker/toolchain/Dockerfile +34 -0
- package/node_modules/cpu-features/deps/cpu_features/cmake/ci/sample/CMakeLists.txt +22 -0
- package/node_modules/cpu-features/deps/cpu_features/cmake/ci/sample/main.cpp +11 -0
- package/node_modules/cpu-features/deps/cpu_features/cmake/ci/vagrant/freebsd/Vagrantfile +107 -0
- package/node_modules/cpu-features/deps/cpu_features/cmake/googletest.CMakeLists.txt.in +15 -0
- package/node_modules/cpu-features/deps/cpu_features/cpu_features.gyp +105 -0
- package/node_modules/cpu-features/deps/cpu_features/include/cpu_features_cache_info.h +54 -0
- package/node_modules/cpu-features/deps/cpu_features/include/cpu_features_macros.h +384 -0
- package/node_modules/cpu-features/deps/cpu_features/include/cpuinfo_aarch64.h +259 -0
- package/node_modules/cpu-features/deps/cpu_features/include/cpuinfo_arm.h +121 -0
- package/node_modules/cpu-features/deps/cpu_features/include/cpuinfo_mips.h +74 -0
- package/node_modules/cpu-features/deps/cpu_features/include/cpuinfo_ppc.h +149 -0
- package/node_modules/cpu-features/deps/cpu_features/include/cpuinfo_riscv.h +72 -0
- package/node_modules/cpu-features/deps/cpu_features/include/cpuinfo_s390x.h +108 -0
- package/node_modules/cpu-features/deps/cpu_features/include/cpuinfo_x86.h +288 -0
- package/node_modules/cpu-features/deps/cpu_features/include/internal/bit_utils.h +40 -0
- package/node_modules/cpu-features/deps/cpu_features/include/internal/cpuid_x86.h +37 -0
- package/node_modules/cpu-features/deps/cpu_features/include/internal/filesystem.h +39 -0
- package/node_modules/cpu-features/deps/cpu_features/include/internal/hwcaps.h +240 -0
- package/node_modules/cpu-features/deps/cpu_features/include/internal/stack_line_reader.h +49 -0
- package/node_modules/cpu-features/deps/cpu_features/include/internal/string_view.h +110 -0
- package/node_modules/cpu-features/deps/cpu_features/include/internal/windows_utils.h +70 -0
- package/node_modules/cpu-features/deps/cpu_features/ndk_compat/CMakeLists.txt +60 -0
- package/node_modules/cpu-features/deps/cpu_features/ndk_compat/README.md +4 -0
- package/node_modules/cpu-features/deps/cpu_features/ndk_compat/cpu-features.c +205 -0
- package/node_modules/cpu-features/deps/cpu_features/ndk_compat/cpu-features.h +320 -0
- package/node_modules/cpu-features/deps/cpu_features/ndk_compat/ndk-compat-test.c +12 -0
- package/node_modules/cpu-features/deps/cpu_features/patches/0001-Add-Apple-Silicon-Support.patch +456 -0
- package/node_modules/cpu-features/deps/cpu_features/scripts/generate_badges.d +165 -0
- package/node_modules/cpu-features/deps/cpu_features/scripts/make_release.sh +75 -0
- package/node_modules/cpu-features/deps/cpu_features/scripts/run_integration.sh +490 -0
- package/node_modules/cpu-features/deps/cpu_features/scripts/test_integration.sh +79 -0
- package/node_modules/cpu-features/deps/cpu_features/src/copy.inl +19 -0
- package/node_modules/cpu-features/deps/cpu_features/src/define_introspection.inl +86 -0
- package/node_modules/cpu-features/deps/cpu_features/src/define_introspection_and_hwcaps.inl +26 -0
- package/node_modules/cpu-features/deps/cpu_features/src/equals.inl +22 -0
- package/node_modules/cpu-features/deps/cpu_features/src/filesystem.c +62 -0
- package/node_modules/cpu-features/deps/cpu_features/src/hwcaps.c +169 -0
- package/node_modules/cpu-features/deps/cpu_features/src/impl_aarch64__base_implementation.inl +88 -0
- package/node_modules/cpu-features/deps/cpu_features/src/impl_aarch64_linux_or_android.c +79 -0
- package/node_modules/cpu-features/deps/cpu_features/src/impl_aarch64_macos_or_iphone.c +82 -0
- package/node_modules/cpu-features/deps/cpu_features/src/impl_aarch64_windows.c +138 -0
- package/node_modules/cpu-features/deps/cpu_features/src/impl_arm_linux_or_android.c +212 -0
- package/node_modules/cpu-features/deps/cpu_features/src/impl_mips_linux_or_android.c +93 -0
- package/node_modules/cpu-features/deps/cpu_features/src/impl_ppc_linux.c +163 -0
- package/node_modules/cpu-features/deps/cpu_features/src/impl_riscv_linux.c +111 -0
- package/node_modules/cpu-features/deps/cpu_features/src/impl_s390x_linux.c +120 -0
- package/node_modules/cpu-features/deps/cpu_features/src/impl_x86__base_implementation.inl +2055 -0
- package/node_modules/cpu-features/deps/cpu_features/src/impl_x86_freebsd.c +68 -0
- package/node_modules/cpu-features/deps/cpu_features/src/impl_x86_linux_or_android.c +58 -0
- package/node_modules/cpu-features/deps/cpu_features/src/impl_x86_macos.c +57 -0
- package/node_modules/cpu-features/deps/cpu_features/src/impl_x86_windows.c +58 -0
- package/node_modules/cpu-features/deps/cpu_features/src/stack_line_reader.c +132 -0
- package/node_modules/cpu-features/deps/cpu_features/src/string_view.c +192 -0
- package/node_modules/cpu-features/deps/cpu_features/src/utils/list_cpu_features.c +461 -0
- package/node_modules/cpu-features/deps/cpu_features/test/CMakeLists.txt +114 -0
- package/node_modules/cpu-features/deps/cpu_features/test/bit_utils_test.cc +53 -0
- package/node_modules/cpu-features/deps/cpu_features/test/cpuinfo_aarch64_test.cc +396 -0
- package/node_modules/cpu-features/deps/cpu_features/test/cpuinfo_arm_test.cc +384 -0
- package/node_modules/cpu-features/deps/cpu_features/test/cpuinfo_mips_test.cc +176 -0
- package/node_modules/cpu-features/deps/cpu_features/test/cpuinfo_ppc_test.cc +131 -0
- package/node_modules/cpu-features/deps/cpu_features/test/cpuinfo_riscv_test.cc +180 -0
- package/node_modules/cpu-features/deps/cpu_features/test/cpuinfo_s390x_test.cc +82 -0
- package/node_modules/cpu-features/deps/cpu_features/test/cpuinfo_x86_test.cc +1729 -0
- package/node_modules/cpu-features/deps/cpu_features/test/filesystem_for_testing.cc +103 -0
- package/node_modules/cpu-features/deps/cpu_features/test/filesystem_for_testing.h +61 -0
- package/node_modules/cpu-features/deps/cpu_features/test/hwcaps_for_testing.cc +52 -0
- package/node_modules/cpu-features/deps/cpu_features/test/hwcaps_for_testing.h +31 -0
- package/node_modules/cpu-features/deps/cpu_features/test/stack_line_reader_test.cc +132 -0
- package/node_modules/cpu-features/deps/cpu_features/test/string_view_test.cc +202 -0
- package/node_modules/cpu-features/lib/index.js +5 -0
- package/node_modules/cpu-features/package.json +40 -0
- package/node_modules/cpu-features/src/binding.cc +151 -0
- package/node_modules/cpu-features/test/test.js +12 -0
- package/node_modules/nan/.github/workflows/ci.yml +46 -0
- package/node_modules/nan/.pre-commit-config.yaml +8 -0
- package/node_modules/nan/CHANGELOG.md +605 -0
- package/node_modules/nan/CMakeLists.txt +138 -0
- package/node_modules/nan/LICENSE.md +9 -0
- package/node_modules/nan/README.md +457 -0
- package/node_modules/nan/doc/asyncworker.md +146 -0
- package/node_modules/nan/doc/buffers.md +54 -0
- package/node_modules/nan/doc/callback.md +76 -0
- package/node_modules/nan/doc/converters.md +41 -0
- package/node_modules/nan/doc/errors.md +226 -0
- package/node_modules/nan/doc/json.md +62 -0
- package/node_modules/nan/doc/maybe_types.md +583 -0
- package/node_modules/nan/doc/methods.md +689 -0
- package/node_modules/nan/doc/new.md +147 -0
- package/node_modules/nan/doc/node_misc.md +123 -0
- package/node_modules/nan/doc/object_wrappers.md +263 -0
- package/node_modules/nan/doc/persistent.md +296 -0
- package/node_modules/nan/doc/scopes.md +73 -0
- package/node_modules/nan/doc/script.md +58 -0
- package/node_modules/nan/doc/string_bytes.md +81 -0
- package/node_modules/nan/doc/v8_internals.md +211 -0
- package/node_modules/nan/doc/v8_misc.md +85 -0
- package/node_modules/nan/include_dirs.js +1 -0
- package/node_modules/nan/nan.h +3202 -0
- package/node_modules/nan/nan_callbacks.h +141 -0
- package/node_modules/nan/nan_callbacks_12_inl.h +730 -0
- package/node_modules/nan/nan_callbacks_pre_12_inl.h +528 -0
- package/node_modules/nan/nan_converters.h +72 -0
- package/node_modules/nan/nan_converters_43_inl.h +68 -0
- package/node_modules/nan/nan_converters_pre_43_inl.h +42 -0
- package/node_modules/nan/nan_define_own_property_helper.h +29 -0
- package/node_modules/nan/nan_implementation_12_inl.h +446 -0
- package/node_modules/nan/nan_implementation_pre_12_inl.h +263 -0
- package/node_modules/nan/nan_json.h +166 -0
- package/node_modules/nan/nan_maybe_43_inl.h +360 -0
- package/node_modules/nan/nan_maybe_pre_43_inl.h +268 -0
- package/node_modules/nan/nan_new.h +340 -0
- package/node_modules/nan/nan_object_wrap.h +156 -0
- package/node_modules/nan/nan_persistent_12_inl.h +132 -0
- package/node_modules/nan/nan_persistent_pre_12_inl.h +242 -0
- package/node_modules/nan/nan_private.h +73 -0
- package/node_modules/nan/nan_scriptorigin.h +97 -0
- package/node_modules/nan/nan_string_bytes.h +305 -0
- package/node_modules/nan/nan_typedarray_contents.h +96 -0
- package/node_modules/nan/nan_weak.h +453 -0
- package/node_modules/nan/package.json +38 -0
- package/node_modules/nan/tools/1to2.js +412 -0
- package/node_modules/nan/tools/README.md +14 -0
- package/node_modules/nan/tools/package.json +19 -0
- package/node_modules/safer-buffer/LICENSE +21 -0
- package/node_modules/safer-buffer/Porting-Buffer.md +268 -0
- package/node_modules/safer-buffer/Readme.md +156 -0
- package/node_modules/safer-buffer/dangerous.js +58 -0
- package/node_modules/safer-buffer/package.json +34 -0
- package/node_modules/safer-buffer/safer.js +77 -0
- package/node_modules/safer-buffer/tests.js +406 -0
- package/node_modules/ssh2/.eslintignore +4 -0
- package/node_modules/ssh2/.eslintrc.js +5 -0
- package/node_modules/ssh2/.github/workflows/ci.yml +110 -0
- package/node_modules/ssh2/.github/workflows/lint.yml +27 -0
- package/node_modules/ssh2/LICENSE +19 -0
- package/node_modules/ssh2/README.md +1529 -0
- package/node_modules/ssh2/SFTP.md +413 -0
- package/node_modules/ssh2/examples/server-chat.js +238 -0
- package/node_modules/ssh2/examples/sftp-server-download-only.js +134 -0
- package/node_modules/ssh2/install.js +27 -0
- package/node_modules/ssh2/lib/Channel.js +295 -0
- package/node_modules/ssh2/lib/agent.js +1123 -0
- package/node_modules/ssh2/lib/client.js +2176 -0
- package/node_modules/ssh2/lib/http-agents.js +84 -0
- package/node_modules/ssh2/lib/index.js +44 -0
- package/node_modules/ssh2/lib/keygen.js +582 -0
- package/node_modules/ssh2/lib/protocol/Protocol.js +2136 -0
- package/node_modules/ssh2/lib/protocol/SFTP.js +4052 -0
- package/node_modules/ssh2/lib/protocol/constants.js +356 -0
- package/node_modules/ssh2/lib/protocol/crypto/binding.gyp +23 -0
- package/node_modules/ssh2/lib/protocol/crypto/poly1305.js +43 -0
- package/node_modules/ssh2/lib/protocol/crypto/src/binding.cc +2300 -0
- package/node_modules/ssh2/lib/protocol/crypto.js +1602 -0
- package/node_modules/ssh2/lib/protocol/handlers.js +16 -0
- package/node_modules/ssh2/lib/protocol/handlers.misc.js +1285 -0
- package/node_modules/ssh2/lib/protocol/kex.js +1908 -0
- package/node_modules/ssh2/lib/protocol/keyParser.js +1484 -0
- package/node_modules/ssh2/lib/protocol/node-fs-compat.js +115 -0
- package/node_modules/ssh2/lib/protocol/utils.js +356 -0
- package/node_modules/ssh2/lib/protocol/zlib.js +255 -0
- package/node_modules/ssh2/lib/server.js +1380 -0
- package/node_modules/ssh2/lib/utils.js +336 -0
- package/node_modules/ssh2/package.json +49 -0
- package/node_modules/ssh2/test/common.js +316 -0
- package/node_modules/ssh2/test/fixtures/bad_rsa_private_key +26 -0
- package/node_modules/ssh2/test/fixtures/https_cert.pem +33 -0
- package/node_modules/ssh2/test/fixtures/https_key.pem +52 -0
- package/node_modules/ssh2/test/fixtures/id_dsa +12 -0
- package/node_modules/ssh2/test/fixtures/id_ecdsa +5 -0
- package/node_modules/ssh2/test/fixtures/id_rsa +15 -0
- package/node_modules/ssh2/test/fixtures/id_rsa.ppk +26 -0
- package/node_modules/ssh2/test/fixtures/id_rsa_enc +30 -0
- package/node_modules/ssh2/test/fixtures/keyParser/openssh_new_dsa +21 -0
- package/node_modules/ssh2/test/fixtures/keyParser/openssh_new_dsa.pub +1 -0
- package/node_modules/ssh2/test/fixtures/keyParser/openssh_new_dsa.pub.result +7 -0
- package/node_modules/ssh2/test/fixtures/keyParser/openssh_new_dsa.result +7 -0
- package/node_modules/ssh2/test/fixtures/keyParser/openssh_new_dsa_enc +22 -0
- package/node_modules/ssh2/test/fixtures/keyParser/openssh_new_dsa_enc.pub +1 -0
- package/node_modules/ssh2/test/fixtures/keyParser/openssh_new_dsa_enc.pub.result +7 -0
- package/node_modules/ssh2/test/fixtures/keyParser/openssh_new_dsa_enc.result +7 -0
- package/node_modules/ssh2/test/fixtures/keyParser/openssh_new_dsa_enc_gcm +23 -0
- package/node_modules/ssh2/test/fixtures/keyParser/openssh_new_dsa_enc_gcm.pub +1 -0
- package/node_modules/ssh2/test/fixtures/keyParser/openssh_new_dsa_enc_gcm.pub.result +7 -0
- package/node_modules/ssh2/test/fixtures/keyParser/openssh_new_dsa_enc_gcm.result +7 -0
- package/node_modules/ssh2/test/fixtures/keyParser/openssh_new_ecdsa +9 -0
- package/node_modules/ssh2/test/fixtures/keyParser/openssh_new_ecdsa.pub +1 -0
- package/node_modules/ssh2/test/fixtures/keyParser/openssh_new_ecdsa.pub.result +7 -0
- package/node_modules/ssh2/test/fixtures/keyParser/openssh_new_ecdsa.result +7 -0
- package/node_modules/ssh2/test/fixtures/keyParser/openssh_new_ecdsa_enc +10 -0
- package/node_modules/ssh2/test/fixtures/keyParser/openssh_new_ecdsa_enc.pub +1 -0
- package/node_modules/ssh2/test/fixtures/keyParser/openssh_new_ecdsa_enc.pub.result +8 -0
- package/node_modules/ssh2/test/fixtures/keyParser/openssh_new_ecdsa_enc.result +7 -0
- package/node_modules/ssh2/test/fixtures/keyParser/openssh_new_ecdsa_enc_gcm +10 -0
- package/node_modules/ssh2/test/fixtures/keyParser/openssh_new_ecdsa_enc_gcm.pub +1 -0
- package/node_modules/ssh2/test/fixtures/keyParser/openssh_new_ecdsa_enc_gcm.pub.result +8 -0
- package/node_modules/ssh2/test/fixtures/keyParser/openssh_new_ecdsa_enc_gcm.result +7 -0
- package/node_modules/ssh2/test/fixtures/keyParser/openssh_new_ed25519 +7 -0
- package/node_modules/ssh2/test/fixtures/keyParser/openssh_new_ed25519.pub +1 -0
- package/node_modules/ssh2/test/fixtures/keyParser/openssh_new_ed25519.pub.result +7 -0
- package/node_modules/ssh2/test/fixtures/keyParser/openssh_new_ed25519.result +7 -0
- package/node_modules/ssh2/test/fixtures/keyParser/openssh_new_rsa +27 -0
- package/node_modules/ssh2/test/fixtures/keyParser/openssh_new_rsa.pub +1 -0
- package/node_modules/ssh2/test/fixtures/keyParser/openssh_new_rsa.pub.result +7 -0
- package/node_modules/ssh2/test/fixtures/keyParser/openssh_new_rsa.result +7 -0
- package/node_modules/ssh2/test/fixtures/keyParser/openssh_new_rsa_enc +28 -0
- package/node_modules/ssh2/test/fixtures/keyParser/openssh_new_rsa_enc.pub +1 -0
- package/node_modules/ssh2/test/fixtures/keyParser/openssh_new_rsa_enc.pub.result +8 -0
- package/node_modules/ssh2/test/fixtures/keyParser/openssh_new_rsa_enc.result +7 -0
- package/node_modules/ssh2/test/fixtures/keyParser/openssh_new_rsa_enc_gcm +29 -0
- package/node_modules/ssh2/test/fixtures/keyParser/openssh_new_rsa_enc_gcm.pub +1 -0
- package/node_modules/ssh2/test/fixtures/keyParser/openssh_new_rsa_enc_gcm.pub.result +8 -0
- package/node_modules/ssh2/test/fixtures/keyParser/openssh_new_rsa_enc_gcm.result +7 -0
- package/node_modules/ssh2/test/fixtures/keyParser/openssh_old_dsa +12 -0
- package/node_modules/ssh2/test/fixtures/keyParser/openssh_old_dsa.pub +1 -0
- package/node_modules/ssh2/test/fixtures/keyParser/openssh_old_dsa.pub.result +7 -0
- package/node_modules/ssh2/test/fixtures/keyParser/openssh_old_dsa.result +7 -0
- package/node_modules/ssh2/test/fixtures/keyParser/openssh_old_dsa_enc +15 -0
- package/node_modules/ssh2/test/fixtures/keyParser/openssh_old_dsa_enc.pub +1 -0
- package/node_modules/ssh2/test/fixtures/keyParser/openssh_old_dsa_enc.pub.result +8 -0
- package/node_modules/ssh2/test/fixtures/keyParser/openssh_old_dsa_enc.result +7 -0
- package/node_modules/ssh2/test/fixtures/keyParser/openssh_old_ecdsa +5 -0
- package/node_modules/ssh2/test/fixtures/keyParser/openssh_old_ecdsa.pub +1 -0
- package/node_modules/ssh2/test/fixtures/keyParser/openssh_old_ecdsa.pub.result +7 -0
- package/node_modules/ssh2/test/fixtures/keyParser/openssh_old_ecdsa.result +7 -0
- package/node_modules/ssh2/test/fixtures/keyParser/openssh_old_ecdsa_enc +8 -0
- package/node_modules/ssh2/test/fixtures/keyParser/openssh_old_ecdsa_enc.pub +1 -0
- package/node_modules/ssh2/test/fixtures/keyParser/openssh_old_ecdsa_enc.pub.result +8 -0
- package/node_modules/ssh2/test/fixtures/keyParser/openssh_old_ecdsa_enc.result +7 -0
- package/node_modules/ssh2/test/fixtures/keyParser/openssh_old_rsa +27 -0
- package/node_modules/ssh2/test/fixtures/keyParser/openssh_old_rsa.pub +1 -0
- package/node_modules/ssh2/test/fixtures/keyParser/openssh_old_rsa.pub.result +7 -0
- package/node_modules/ssh2/test/fixtures/keyParser/openssh_old_rsa.result +7 -0
- package/node_modules/ssh2/test/fixtures/keyParser/openssh_old_rsa_enc +30 -0
- package/node_modules/ssh2/test/fixtures/keyParser/openssh_old_rsa_enc.pub +1 -0
- package/node_modules/ssh2/test/fixtures/keyParser/openssh_old_rsa_enc.pub.result +8 -0
- package/node_modules/ssh2/test/fixtures/keyParser/openssh_old_rsa_enc.result +7 -0
- package/node_modules/ssh2/test/fixtures/keyParser/openssh_old_rsa_enc_aes256 +54 -0
- package/node_modules/ssh2/test/fixtures/keyParser/openssh_old_rsa_enc_aes256.pub +1 -0
- package/node_modules/ssh2/test/fixtures/keyParser/openssh_old_rsa_enc_aes256.pub.result +6 -0
- package/node_modules/ssh2/test/fixtures/keyParser/openssh_old_rsa_enc_aes256.result +6 -0
- package/node_modules/ssh2/test/fixtures/keyParser/ppk_dsa_enc +17 -0
- package/node_modules/ssh2/test/fixtures/keyParser/ppk_dsa_enc.result +7 -0
- package/node_modules/ssh2/test/fixtures/keyParser/ppk_rsa +26 -0
- package/node_modules/ssh2/test/fixtures/keyParser/ppk_rsa.result +7 -0
- package/node_modules/ssh2/test/fixtures/keyParser/ppk_rsa_enc +18 -0
- package/node_modules/ssh2/test/fixtures/keyParser/ppk_rsa_enc.result +7 -0
- package/node_modules/ssh2/test/fixtures/keyParser/rfc4716_rsa.pub +9 -0
- package/node_modules/ssh2/test/fixtures/keyParser/rfc4716_rsa.pub.result +7 -0
- package/node_modules/ssh2/test/fixtures/keyParser/rfc4716_rsa2.pub +10 -0
- package/node_modules/ssh2/test/fixtures/keyParser/rfc4716_rsa2.pub.result +7 -0
- package/node_modules/ssh2/test/fixtures/keyParser/rfc4716_rsa3.pub +11 -0
- package/node_modules/ssh2/test/fixtures/keyParser/rfc4716_rsa3.pub.result +7 -0
- package/node_modules/ssh2/test/fixtures/keyParser/rfc4716_rsa4.pub +11 -0
- package/node_modules/ssh2/test/fixtures/keyParser/rfc4716_rsa4.pub.result +7 -0
- package/node_modules/ssh2/test/fixtures/keyParser/rfc4716_rsa5.pub +8 -0
- package/node_modules/ssh2/test/fixtures/keyParser/rfc4716_rsa5.pub.result +7 -0
- package/node_modules/ssh2/test/fixtures/keyParser/rfc4716_rsa6.pub +13 -0
- package/node_modules/ssh2/test/fixtures/keyParser/rfc4716_rsa6.pub.result +7 -0
- package/node_modules/ssh2/test/fixtures/openssh_new_rsa +27 -0
- package/node_modules/ssh2/test/fixtures/ssh_host_dsa_key +12 -0
- package/node_modules/ssh2/test/fixtures/ssh_host_ecdsa_key +5 -0
- package/node_modules/ssh2/test/fixtures/ssh_host_rsa_key +15 -0
- package/node_modules/ssh2/test/test-exec.js +578 -0
- package/node_modules/ssh2/test/test-integration-openssh.js +486 -0
- package/node_modules/ssh2/test/test-keygen.js +60 -0
- package/node_modules/ssh2/test/test-misc-client-server.js +1460 -0
- package/node_modules/ssh2/test/test-openssh.js +261 -0
- package/node_modules/ssh2/test/test-protocol-crypto.js +631 -0
- package/node_modules/ssh2/test/test-protocol-keyparser.js +177 -0
- package/node_modules/ssh2/test/test-server-hostkeys.js +138 -0
- package/node_modules/ssh2/test/test-sftp.js +842 -0
- package/node_modules/ssh2/test/test-shell.js +109 -0
- package/node_modules/ssh2/test/test-userauth-agent-openssh.js +110 -0
- package/node_modules/ssh2/test/test-userauth-agent.js +171 -0
- package/node_modules/ssh2/test/test-userauth.js +611 -0
- package/node_modules/ssh2/test/test-worker-imports.js +25 -0
- package/node_modules/ssh2/test/test.js +20 -0
- package/node_modules/ssh2/util/build_pagent.bat +2 -0
- package/node_modules/ssh2/util/pagent.c +88 -0
- package/node_modules/ssh2/util/pagent.exe +0 -0
- package/node_modules/tweetnacl/.npmignore +4 -0
- package/node_modules/tweetnacl/AUTHORS.md +28 -0
- package/node_modules/tweetnacl/CHANGELOG.md +221 -0
- package/node_modules/tweetnacl/LICENSE +24 -0
- package/node_modules/tweetnacl/PULL_REQUEST_TEMPLATE.md +20 -0
- package/node_modules/tweetnacl/README.md +459 -0
- package/node_modules/tweetnacl/nacl-fast.js +2388 -0
- package/node_modules/tweetnacl/nacl-fast.min.js +2 -0
- package/node_modules/tweetnacl/nacl.d.ts +98 -0
- package/node_modules/tweetnacl/nacl.js +1175 -0
- package/node_modules/tweetnacl/nacl.min.js +1 -0
- package/node_modules/tweetnacl/package.json +58 -0
- package/package.json +96 -89
|
@@ -0,0 +1,340 @@
|
|
|
1
|
+
/*********************************************************************
|
|
2
|
+
* NAN - Native Abstractions for Node.js
|
|
3
|
+
*
|
|
4
|
+
* Copyright (c) 2018 NAN contributors
|
|
5
|
+
*
|
|
6
|
+
* MIT License <https://github.com/nodejs/nan/blob/master/LICENSE.md>
|
|
7
|
+
********************************************************************/
|
|
8
|
+
|
|
9
|
+
#ifndef NAN_NEW_H_
|
|
10
|
+
#define NAN_NEW_H_
|
|
11
|
+
|
|
12
|
+
namespace imp { // scnr
|
|
13
|
+
|
|
14
|
+
// TODO(agnat): Generalize
|
|
15
|
+
template <typename T> v8::Local<T> To(v8::Local<v8::Integer> i);
|
|
16
|
+
|
|
17
|
+
template <>
|
|
18
|
+
inline
|
|
19
|
+
v8::Local<v8::Integer>
|
|
20
|
+
To<v8::Integer>(v8::Local<v8::Integer> i) {
|
|
21
|
+
return Nan::To<v8::Integer>(i).ToLocalChecked();
|
|
22
|
+
}
|
|
23
|
+
|
|
24
|
+
template <>
|
|
25
|
+
inline
|
|
26
|
+
v8::Local<v8::Int32>
|
|
27
|
+
To<v8::Int32>(v8::Local<v8::Integer> i) {
|
|
28
|
+
return Nan::To<v8::Int32>(i).ToLocalChecked();
|
|
29
|
+
}
|
|
30
|
+
|
|
31
|
+
template <>
|
|
32
|
+
inline
|
|
33
|
+
v8::Local<v8::Uint32>
|
|
34
|
+
To<v8::Uint32>(v8::Local<v8::Integer> i) {
|
|
35
|
+
return Nan::To<v8::Uint32>(i).ToLocalChecked();
|
|
36
|
+
}
|
|
37
|
+
|
|
38
|
+
template <typename T> struct FactoryBase {
|
|
39
|
+
typedef v8::Local<T> return_t;
|
|
40
|
+
};
|
|
41
|
+
|
|
42
|
+
template <typename T> struct MaybeFactoryBase {
|
|
43
|
+
typedef MaybeLocal<T> return_t;
|
|
44
|
+
};
|
|
45
|
+
|
|
46
|
+
template <typename T> struct Factory;
|
|
47
|
+
|
|
48
|
+
template <>
|
|
49
|
+
struct Factory<v8::Array> : FactoryBase<v8::Array> {
|
|
50
|
+
static inline return_t New();
|
|
51
|
+
static inline return_t New(int length);
|
|
52
|
+
};
|
|
53
|
+
|
|
54
|
+
template <>
|
|
55
|
+
struct Factory<v8::Boolean> : FactoryBase<v8::Boolean> {
|
|
56
|
+
static inline return_t New(bool value);
|
|
57
|
+
};
|
|
58
|
+
|
|
59
|
+
template <>
|
|
60
|
+
struct Factory<v8::BooleanObject> : FactoryBase<v8::BooleanObject> {
|
|
61
|
+
static inline return_t New(bool value);
|
|
62
|
+
};
|
|
63
|
+
|
|
64
|
+
template <>
|
|
65
|
+
struct Factory<v8::Context> : FactoryBase<v8::Context> {
|
|
66
|
+
static inline
|
|
67
|
+
return_t
|
|
68
|
+
New( v8::ExtensionConfiguration* extensions = NULL
|
|
69
|
+
, v8::Local<v8::ObjectTemplate> tmpl = v8::Local<v8::ObjectTemplate>()
|
|
70
|
+
, v8::Local<v8::Value> obj = v8::Local<v8::Value>());
|
|
71
|
+
};
|
|
72
|
+
|
|
73
|
+
template <>
|
|
74
|
+
struct Factory<v8::Date> : MaybeFactoryBase<v8::Date> {
|
|
75
|
+
static inline return_t New(double value);
|
|
76
|
+
};
|
|
77
|
+
|
|
78
|
+
template <>
|
|
79
|
+
struct Factory<v8::External> : FactoryBase<v8::External> {
|
|
80
|
+
static inline return_t New(void *value);
|
|
81
|
+
};
|
|
82
|
+
|
|
83
|
+
template <>
|
|
84
|
+
struct Factory<v8::Function> : FactoryBase<v8::Function> {
|
|
85
|
+
static inline
|
|
86
|
+
return_t
|
|
87
|
+
New( FunctionCallback callback
|
|
88
|
+
, v8::Local<v8::Value> data = v8::Local<v8::Value>());
|
|
89
|
+
};
|
|
90
|
+
|
|
91
|
+
template <>
|
|
92
|
+
struct Factory<v8::FunctionTemplate> : FactoryBase<v8::FunctionTemplate> {
|
|
93
|
+
static inline
|
|
94
|
+
return_t
|
|
95
|
+
New( FunctionCallback callback = NULL
|
|
96
|
+
, v8::Local<v8::Value> data = v8::Local<v8::Value>()
|
|
97
|
+
, v8::Local<v8::Signature> signature = v8::Local<v8::Signature>());
|
|
98
|
+
};
|
|
99
|
+
|
|
100
|
+
template <>
|
|
101
|
+
struct Factory<v8::Number> : FactoryBase<v8::Number> {
|
|
102
|
+
static inline return_t New(double value);
|
|
103
|
+
};
|
|
104
|
+
|
|
105
|
+
template <>
|
|
106
|
+
struct Factory<v8::NumberObject> : FactoryBase<v8::NumberObject> {
|
|
107
|
+
static inline return_t New(double value);
|
|
108
|
+
};
|
|
109
|
+
|
|
110
|
+
template <typename T>
|
|
111
|
+
struct IntegerFactory : FactoryBase<T> {
|
|
112
|
+
typedef typename FactoryBase<T>::return_t return_t;
|
|
113
|
+
static inline return_t New(int32_t value);
|
|
114
|
+
static inline return_t New(uint32_t value);
|
|
115
|
+
};
|
|
116
|
+
|
|
117
|
+
template <>
|
|
118
|
+
struct Factory<v8::Integer> : IntegerFactory<v8::Integer> {};
|
|
119
|
+
|
|
120
|
+
template <>
|
|
121
|
+
struct Factory<v8::Int32> : IntegerFactory<v8::Int32> {};
|
|
122
|
+
|
|
123
|
+
template <>
|
|
124
|
+
struct Factory<v8::Uint32> : FactoryBase<v8::Uint32> {
|
|
125
|
+
static inline return_t New(int32_t value);
|
|
126
|
+
static inline return_t New(uint32_t value);
|
|
127
|
+
};
|
|
128
|
+
|
|
129
|
+
template <>
|
|
130
|
+
struct Factory<v8::Object> : FactoryBase<v8::Object> {
|
|
131
|
+
static inline return_t New();
|
|
132
|
+
};
|
|
133
|
+
|
|
134
|
+
template <>
|
|
135
|
+
struct Factory<v8::ObjectTemplate> : FactoryBase<v8::ObjectTemplate> {
|
|
136
|
+
static inline return_t New();
|
|
137
|
+
};
|
|
138
|
+
|
|
139
|
+
template <>
|
|
140
|
+
struct Factory<v8::RegExp> : MaybeFactoryBase<v8::RegExp> {
|
|
141
|
+
static inline return_t New(
|
|
142
|
+
v8::Local<v8::String> pattern, v8::RegExp::Flags flags);
|
|
143
|
+
};
|
|
144
|
+
|
|
145
|
+
template <>
|
|
146
|
+
struct Factory<v8::Script> : MaybeFactoryBase<v8::Script> {
|
|
147
|
+
static inline return_t New( v8::Local<v8::String> source);
|
|
148
|
+
static inline return_t New( v8::Local<v8::String> source
|
|
149
|
+
, v8::ScriptOrigin const& origin);
|
|
150
|
+
};
|
|
151
|
+
|
|
152
|
+
template <>
|
|
153
|
+
struct Factory<v8::Signature> : FactoryBase<v8::Signature> {
|
|
154
|
+
typedef v8::Local<v8::FunctionTemplate> FTH;
|
|
155
|
+
static inline return_t New(FTH receiver = FTH());
|
|
156
|
+
};
|
|
157
|
+
|
|
158
|
+
template <>
|
|
159
|
+
struct Factory<v8::String> : MaybeFactoryBase<v8::String> {
|
|
160
|
+
static inline return_t New();
|
|
161
|
+
static inline return_t New(const char *value, int length = -1);
|
|
162
|
+
static inline return_t New(const uint16_t *value, int length = -1);
|
|
163
|
+
static inline return_t New(std::string const& value);
|
|
164
|
+
|
|
165
|
+
static inline return_t New(v8::String::ExternalStringResource * value);
|
|
166
|
+
static inline return_t New(ExternalOneByteStringResource * value);
|
|
167
|
+
};
|
|
168
|
+
|
|
169
|
+
template <>
|
|
170
|
+
struct Factory<v8::StringObject> : FactoryBase<v8::StringObject> {
|
|
171
|
+
static inline return_t New(v8::Local<v8::String> value);
|
|
172
|
+
};
|
|
173
|
+
|
|
174
|
+
} // end of namespace imp
|
|
175
|
+
|
|
176
|
+
#if (NODE_MODULE_VERSION >= 12)
|
|
177
|
+
|
|
178
|
+
namespace imp {
|
|
179
|
+
|
|
180
|
+
template <>
|
|
181
|
+
struct Factory<v8::UnboundScript> : MaybeFactoryBase<v8::UnboundScript> {
|
|
182
|
+
static inline return_t New( v8::Local<v8::String> source);
|
|
183
|
+
static inline return_t New( v8::Local<v8::String> source
|
|
184
|
+
, v8::ScriptOrigin const& origin);
|
|
185
|
+
};
|
|
186
|
+
|
|
187
|
+
} // end of namespace imp
|
|
188
|
+
|
|
189
|
+
# include "nan_implementation_12_inl.h"
|
|
190
|
+
|
|
191
|
+
#else // NODE_MODULE_VERSION >= 12
|
|
192
|
+
|
|
193
|
+
# include "nan_implementation_pre_12_inl.h"
|
|
194
|
+
|
|
195
|
+
#endif
|
|
196
|
+
|
|
197
|
+
//=== API ======================================================================
|
|
198
|
+
|
|
199
|
+
template <typename T>
|
|
200
|
+
typename imp::Factory<T>::return_t
|
|
201
|
+
New() {
|
|
202
|
+
return imp::Factory<T>::New();
|
|
203
|
+
}
|
|
204
|
+
|
|
205
|
+
template <typename T, typename A0>
|
|
206
|
+
typename imp::Factory<T>::return_t
|
|
207
|
+
New(A0 arg0) {
|
|
208
|
+
return imp::Factory<T>::New(arg0);
|
|
209
|
+
}
|
|
210
|
+
|
|
211
|
+
template <typename T, typename A0, typename A1>
|
|
212
|
+
typename imp::Factory<T>::return_t
|
|
213
|
+
New(A0 arg0, A1 arg1) {
|
|
214
|
+
return imp::Factory<T>::New(arg0, arg1);
|
|
215
|
+
}
|
|
216
|
+
|
|
217
|
+
template <typename T, typename A0, typename A1, typename A2>
|
|
218
|
+
typename imp::Factory<T>::return_t
|
|
219
|
+
New(A0 arg0, A1 arg1, A2 arg2) {
|
|
220
|
+
return imp::Factory<T>::New(arg0, arg1, arg2);
|
|
221
|
+
}
|
|
222
|
+
|
|
223
|
+
template <typename T, typename A0, typename A1, typename A2, typename A3>
|
|
224
|
+
typename imp::Factory<T>::return_t
|
|
225
|
+
New(A0 arg0, A1 arg1, A2 arg2, A3 arg3) {
|
|
226
|
+
return imp::Factory<T>::New(arg0, arg1, arg2, arg3);
|
|
227
|
+
}
|
|
228
|
+
|
|
229
|
+
// Note(agnat): When passing overloaded function pointers to template functions
|
|
230
|
+
// as generic arguments the compiler needs help in picking the right overload.
|
|
231
|
+
// These two functions handle New<Function> and New<FunctionTemplate> with
|
|
232
|
+
// all argument variations.
|
|
233
|
+
|
|
234
|
+
// v8::Function and v8::FunctionTemplate with one or two arguments
|
|
235
|
+
template <typename T>
|
|
236
|
+
typename imp::Factory<T>::return_t
|
|
237
|
+
New( FunctionCallback callback
|
|
238
|
+
, v8::Local<v8::Value> data = v8::Local<v8::Value>()) {
|
|
239
|
+
return imp::Factory<T>::New(callback, data);
|
|
240
|
+
}
|
|
241
|
+
|
|
242
|
+
// v8::Function and v8::FunctionTemplate with three arguments
|
|
243
|
+
template <typename T, typename A2>
|
|
244
|
+
typename imp::Factory<T>::return_t
|
|
245
|
+
New( FunctionCallback callback
|
|
246
|
+
, v8::Local<v8::Value> data = v8::Local<v8::Value>()
|
|
247
|
+
, A2 a2 = A2()) {
|
|
248
|
+
return imp::Factory<T>::New(callback, data, a2);
|
|
249
|
+
}
|
|
250
|
+
|
|
251
|
+
// Convenience
|
|
252
|
+
|
|
253
|
+
#if NODE_MODULE_VERSION < IOJS_3_0_MODULE_VERSION
|
|
254
|
+
template <typename T> inline v8::Local<T> New(v8::Handle<T> h);
|
|
255
|
+
#endif
|
|
256
|
+
|
|
257
|
+
#if NODE_MODULE_VERSION > NODE_0_10_MODULE_VERSION
|
|
258
|
+
template <typename T, typename M>
|
|
259
|
+
inline v8::Local<T> New(v8::Persistent<T, M> const& p);
|
|
260
|
+
#else
|
|
261
|
+
template <typename T> inline v8::Local<T> New(v8::Persistent<T> const& p);
|
|
262
|
+
#endif
|
|
263
|
+
template <typename T, typename M>
|
|
264
|
+
inline v8::Local<T> New(Persistent<T, M> const& p);
|
|
265
|
+
template <typename T>
|
|
266
|
+
inline v8::Local<T> New(Global<T> const& p);
|
|
267
|
+
|
|
268
|
+
inline
|
|
269
|
+
imp::Factory<v8::Boolean>::return_t
|
|
270
|
+
New(bool value) {
|
|
271
|
+
return New<v8::Boolean>(value);
|
|
272
|
+
}
|
|
273
|
+
|
|
274
|
+
inline
|
|
275
|
+
imp::Factory<v8::Int32>::return_t
|
|
276
|
+
New(int32_t value) {
|
|
277
|
+
return New<v8::Int32>(value);
|
|
278
|
+
}
|
|
279
|
+
|
|
280
|
+
inline
|
|
281
|
+
imp::Factory<v8::Uint32>::return_t
|
|
282
|
+
New(uint32_t value) {
|
|
283
|
+
return New<v8::Uint32>(value);
|
|
284
|
+
}
|
|
285
|
+
|
|
286
|
+
inline
|
|
287
|
+
imp::Factory<v8::Number>::return_t
|
|
288
|
+
New(double value) {
|
|
289
|
+
return New<v8::Number>(value);
|
|
290
|
+
}
|
|
291
|
+
|
|
292
|
+
inline
|
|
293
|
+
imp::Factory<v8::String>::return_t
|
|
294
|
+
New(std::string const& value) { // NOLINT(build/include_what_you_use)
|
|
295
|
+
return New<v8::String>(value);
|
|
296
|
+
}
|
|
297
|
+
|
|
298
|
+
inline
|
|
299
|
+
imp::Factory<v8::String>::return_t
|
|
300
|
+
New(const char * value, int length) {
|
|
301
|
+
return New<v8::String>(value, length);
|
|
302
|
+
}
|
|
303
|
+
|
|
304
|
+
inline
|
|
305
|
+
imp::Factory<v8::String>::return_t
|
|
306
|
+
New(const uint16_t * value, int length) {
|
|
307
|
+
return New<v8::String>(value, length);
|
|
308
|
+
}
|
|
309
|
+
|
|
310
|
+
inline
|
|
311
|
+
imp::Factory<v8::String>::return_t
|
|
312
|
+
New(const char * value) {
|
|
313
|
+
return New<v8::String>(value);
|
|
314
|
+
}
|
|
315
|
+
|
|
316
|
+
inline
|
|
317
|
+
imp::Factory<v8::String>::return_t
|
|
318
|
+
New(const uint16_t * value) {
|
|
319
|
+
return New<v8::String>(value);
|
|
320
|
+
}
|
|
321
|
+
|
|
322
|
+
inline
|
|
323
|
+
imp::Factory<v8::String>::return_t
|
|
324
|
+
New(v8::String::ExternalStringResource * value) {
|
|
325
|
+
return New<v8::String>(value);
|
|
326
|
+
}
|
|
327
|
+
|
|
328
|
+
inline
|
|
329
|
+
imp::Factory<v8::String>::return_t
|
|
330
|
+
New(ExternalOneByteStringResource * value) {
|
|
331
|
+
return New<v8::String>(value);
|
|
332
|
+
}
|
|
333
|
+
|
|
334
|
+
inline
|
|
335
|
+
imp::Factory<v8::RegExp>::return_t
|
|
336
|
+
New(v8::Local<v8::String> pattern, v8::RegExp::Flags flags) {
|
|
337
|
+
return New<v8::RegExp>(pattern, flags);
|
|
338
|
+
}
|
|
339
|
+
|
|
340
|
+
#endif // NAN_NEW_H_
|
|
@@ -0,0 +1,156 @@
|
|
|
1
|
+
/*********************************************************************
|
|
2
|
+
* NAN - Native Abstractions for Node.js
|
|
3
|
+
*
|
|
4
|
+
* Copyright (c) 2018 NAN contributors
|
|
5
|
+
*
|
|
6
|
+
* MIT License <https://github.com/nodejs/nan/blob/master/LICENSE.md>
|
|
7
|
+
********************************************************************/
|
|
8
|
+
|
|
9
|
+
#ifndef NAN_OBJECT_WRAP_H_
|
|
10
|
+
#define NAN_OBJECT_WRAP_H_
|
|
11
|
+
|
|
12
|
+
class ObjectWrap {
|
|
13
|
+
public:
|
|
14
|
+
ObjectWrap() {
|
|
15
|
+
refs_ = 0;
|
|
16
|
+
}
|
|
17
|
+
|
|
18
|
+
|
|
19
|
+
virtual ~ObjectWrap() {
|
|
20
|
+
if (persistent().IsEmpty()) {
|
|
21
|
+
return;
|
|
22
|
+
}
|
|
23
|
+
|
|
24
|
+
persistent().ClearWeak();
|
|
25
|
+
persistent().Reset();
|
|
26
|
+
}
|
|
27
|
+
|
|
28
|
+
|
|
29
|
+
template <class T>
|
|
30
|
+
static inline T* Unwrap(v8::Local<v8::Object> object) {
|
|
31
|
+
assert(!object.IsEmpty());
|
|
32
|
+
assert(object->InternalFieldCount() > 0);
|
|
33
|
+
// Cast to ObjectWrap before casting to T. A direct cast from void
|
|
34
|
+
// to T won't work right when T has more than one base class.
|
|
35
|
+
void* ptr = GetInternalFieldPointer(object, 0);
|
|
36
|
+
ObjectWrap* wrap = static_cast<ObjectWrap*>(ptr);
|
|
37
|
+
return static_cast<T*>(wrap);
|
|
38
|
+
}
|
|
39
|
+
|
|
40
|
+
|
|
41
|
+
inline v8::Local<v8::Object> handle() const {
|
|
42
|
+
return New(handle_);
|
|
43
|
+
}
|
|
44
|
+
|
|
45
|
+
|
|
46
|
+
inline Persistent<v8::Object>& persistent() {
|
|
47
|
+
return handle_;
|
|
48
|
+
}
|
|
49
|
+
|
|
50
|
+
|
|
51
|
+
protected:
|
|
52
|
+
inline void Wrap(v8::Local<v8::Object> object) {
|
|
53
|
+
assert(persistent().IsEmpty());
|
|
54
|
+
assert(object->InternalFieldCount() > 0);
|
|
55
|
+
SetInternalFieldPointer(object, 0, this);
|
|
56
|
+
persistent().Reset(object);
|
|
57
|
+
MakeWeak();
|
|
58
|
+
}
|
|
59
|
+
|
|
60
|
+
#if defined(V8_MAJOR_VERSION) && (V8_MAJOR_VERSION > 4 || \
|
|
61
|
+
(V8_MAJOR_VERSION == 4 && defined(V8_MINOR_VERSION) && V8_MINOR_VERSION >= 3))
|
|
62
|
+
|
|
63
|
+
inline void MakeWeak() {
|
|
64
|
+
persistent().v8::PersistentBase<v8::Object>::SetWeak(
|
|
65
|
+
this, WeakCallback, v8::WeakCallbackType::kParameter);
|
|
66
|
+
#if NODE_MAJOR_VERSION < 10
|
|
67
|
+
// FIXME(bnoordhuis) Probably superfluous in older Node.js versions too.
|
|
68
|
+
persistent().MarkIndependent();
|
|
69
|
+
#endif
|
|
70
|
+
}
|
|
71
|
+
|
|
72
|
+
#elif NODE_MODULE_VERSION > NODE_0_10_MODULE_VERSION
|
|
73
|
+
|
|
74
|
+
inline void MakeWeak() {
|
|
75
|
+
persistent().v8::PersistentBase<v8::Object>::SetWeak(this, WeakCallback);
|
|
76
|
+
persistent().MarkIndependent();
|
|
77
|
+
}
|
|
78
|
+
|
|
79
|
+
#else
|
|
80
|
+
|
|
81
|
+
inline void MakeWeak() {
|
|
82
|
+
persistent().persistent.MakeWeak(this, WeakCallback);
|
|
83
|
+
persistent().MarkIndependent();
|
|
84
|
+
}
|
|
85
|
+
|
|
86
|
+
#endif
|
|
87
|
+
|
|
88
|
+
/* Ref() marks the object as being attached to an event loop.
|
|
89
|
+
* Refed objects will not be garbage collected, even if
|
|
90
|
+
* all references are lost.
|
|
91
|
+
*/
|
|
92
|
+
virtual void Ref() {
|
|
93
|
+
assert(!persistent().IsEmpty());
|
|
94
|
+
persistent().ClearWeak();
|
|
95
|
+
refs_++;
|
|
96
|
+
}
|
|
97
|
+
|
|
98
|
+
/* Unref() marks an object as detached from the event loop. This is its
|
|
99
|
+
* default state. When an object with a "weak" reference changes from
|
|
100
|
+
* attached to detached state it will be freed. Be careful not to access
|
|
101
|
+
* the object after making this call as it might be gone!
|
|
102
|
+
* (A "weak reference" means an object that only has a
|
|
103
|
+
* persistent handle.)
|
|
104
|
+
*
|
|
105
|
+
* DO NOT CALL THIS FROM DESTRUCTOR
|
|
106
|
+
*/
|
|
107
|
+
virtual void Unref() {
|
|
108
|
+
assert(!persistent().IsEmpty());
|
|
109
|
+
assert(!persistent().IsWeak());
|
|
110
|
+
assert(refs_ > 0);
|
|
111
|
+
if (--refs_ == 0)
|
|
112
|
+
MakeWeak();
|
|
113
|
+
}
|
|
114
|
+
|
|
115
|
+
int refs_; // ro
|
|
116
|
+
|
|
117
|
+
private:
|
|
118
|
+
NAN_DISALLOW_ASSIGN_COPY_MOVE(ObjectWrap)
|
|
119
|
+
#if defined(V8_MAJOR_VERSION) && (V8_MAJOR_VERSION > 4 || \
|
|
120
|
+
(V8_MAJOR_VERSION == 4 && defined(V8_MINOR_VERSION) && V8_MINOR_VERSION >= 3))
|
|
121
|
+
|
|
122
|
+
static void
|
|
123
|
+
WeakCallback(v8::WeakCallbackInfo<ObjectWrap> const& info) {
|
|
124
|
+
ObjectWrap* wrap = info.GetParameter();
|
|
125
|
+
assert(wrap->refs_ == 0);
|
|
126
|
+
wrap->handle_.Reset();
|
|
127
|
+
delete wrap;
|
|
128
|
+
}
|
|
129
|
+
|
|
130
|
+
#elif NODE_MODULE_VERSION > NODE_0_10_MODULE_VERSION
|
|
131
|
+
|
|
132
|
+
static void
|
|
133
|
+
WeakCallback(v8::WeakCallbackData<v8::Object, ObjectWrap> const& data) {
|
|
134
|
+
ObjectWrap* wrap = data.GetParameter();
|
|
135
|
+
assert(wrap->refs_ == 0);
|
|
136
|
+
assert(wrap->handle_.IsNearDeath());
|
|
137
|
+
wrap->handle_.Reset();
|
|
138
|
+
delete wrap;
|
|
139
|
+
}
|
|
140
|
+
|
|
141
|
+
#else
|
|
142
|
+
|
|
143
|
+
static void WeakCallback(v8::Persistent<v8::Value> value, void *data) {
|
|
144
|
+
ObjectWrap *wrap = static_cast<ObjectWrap*>(data);
|
|
145
|
+
assert(wrap->refs_ == 0);
|
|
146
|
+
assert(wrap->handle_.IsNearDeath());
|
|
147
|
+
wrap->handle_.Reset();
|
|
148
|
+
delete wrap;
|
|
149
|
+
}
|
|
150
|
+
|
|
151
|
+
#endif
|
|
152
|
+
Persistent<v8::Object> handle_;
|
|
153
|
+
};
|
|
154
|
+
|
|
155
|
+
|
|
156
|
+
#endif // NAN_OBJECT_WRAP_H_
|
|
@@ -0,0 +1,132 @@
|
|
|
1
|
+
/*********************************************************************
|
|
2
|
+
* NAN - Native Abstractions for Node.js
|
|
3
|
+
*
|
|
4
|
+
* Copyright (c) 2018 NAN contributors
|
|
5
|
+
*
|
|
6
|
+
* MIT License <https://github.com/nodejs/nan/blob/master/LICENSE.md>
|
|
7
|
+
********************************************************************/
|
|
8
|
+
|
|
9
|
+
#ifndef NAN_PERSISTENT_12_INL_H_
|
|
10
|
+
#define NAN_PERSISTENT_12_INL_H_
|
|
11
|
+
|
|
12
|
+
template<typename T, typename M> class Persistent :
|
|
13
|
+
public v8::Persistent<T, M> {
|
|
14
|
+
public:
|
|
15
|
+
inline Persistent() : v8::Persistent<T, M>() {}
|
|
16
|
+
|
|
17
|
+
template<typename S> inline Persistent(v8::Local<S> that) :
|
|
18
|
+
v8::Persistent<T, M>(v8::Isolate::GetCurrent(), that) {}
|
|
19
|
+
|
|
20
|
+
template<typename S, typename M2>
|
|
21
|
+
inline
|
|
22
|
+
Persistent(const v8::Persistent<S, M2> &that) : // NOLINT(runtime/explicit)
|
|
23
|
+
v8::Persistent<T, M2>(v8::Isolate::GetCurrent(), that) {}
|
|
24
|
+
|
|
25
|
+
inline void Reset() { v8::PersistentBase<T>::Reset(); }
|
|
26
|
+
|
|
27
|
+
template <typename S>
|
|
28
|
+
inline void Reset(const v8::Local<S> &other) {
|
|
29
|
+
v8::PersistentBase<T>::Reset(v8::Isolate::GetCurrent(), other);
|
|
30
|
+
}
|
|
31
|
+
|
|
32
|
+
template <typename S>
|
|
33
|
+
inline void Reset(const v8::PersistentBase<S> &other) {
|
|
34
|
+
v8::PersistentBase<T>::Reset(v8::Isolate::GetCurrent(), other);
|
|
35
|
+
}
|
|
36
|
+
|
|
37
|
+
template<typename P>
|
|
38
|
+
inline void SetWeak(
|
|
39
|
+
P *parameter
|
|
40
|
+
, typename WeakCallbackInfo<P>::Callback callback
|
|
41
|
+
, WeakCallbackType type);
|
|
42
|
+
|
|
43
|
+
private:
|
|
44
|
+
inline T *operator*() const { return *PersistentBase<T>::persistent; }
|
|
45
|
+
|
|
46
|
+
template<typename S, typename M2>
|
|
47
|
+
inline void Copy(const Persistent<S, M2> &that) {
|
|
48
|
+
TYPE_CHECK(T, S);
|
|
49
|
+
|
|
50
|
+
this->Reset();
|
|
51
|
+
|
|
52
|
+
if (!that.IsEmpty()) {
|
|
53
|
+
this->Reset(that);
|
|
54
|
+
M::Copy(that, this);
|
|
55
|
+
}
|
|
56
|
+
}
|
|
57
|
+
};
|
|
58
|
+
|
|
59
|
+
#if defined(V8_MAJOR_VERSION) && (V8_MAJOR_VERSION > 4 || \
|
|
60
|
+
(V8_MAJOR_VERSION == 4 && defined(V8_MINOR_VERSION) && V8_MINOR_VERSION >= 3))
|
|
61
|
+
template<typename T>
|
|
62
|
+
class Global : public v8::Global<T> {
|
|
63
|
+
public:
|
|
64
|
+
inline Global() : v8::Global<T>() {}
|
|
65
|
+
|
|
66
|
+
template<typename S> inline Global(v8::Local<S> that) :
|
|
67
|
+
v8::Global<T>(v8::Isolate::GetCurrent(), that) {}
|
|
68
|
+
|
|
69
|
+
template<typename S>
|
|
70
|
+
inline
|
|
71
|
+
Global(const v8::PersistentBase<S> &that) : // NOLINT(runtime/explicit)
|
|
72
|
+
v8::Global<S>(v8::Isolate::GetCurrent(), that) {}
|
|
73
|
+
|
|
74
|
+
inline void Reset() { v8::PersistentBase<T>::Reset(); }
|
|
75
|
+
|
|
76
|
+
template <typename S>
|
|
77
|
+
inline void Reset(const v8::Local<S> &other) {
|
|
78
|
+
v8::PersistentBase<T>::Reset(v8::Isolate::GetCurrent(), other);
|
|
79
|
+
}
|
|
80
|
+
|
|
81
|
+
template <typename S>
|
|
82
|
+
inline void Reset(const v8::PersistentBase<S> &other) {
|
|
83
|
+
v8::PersistentBase<T>::Reset(v8::Isolate::GetCurrent(), other);
|
|
84
|
+
}
|
|
85
|
+
|
|
86
|
+
template<typename P>
|
|
87
|
+
inline void SetWeak(
|
|
88
|
+
P *parameter
|
|
89
|
+
, typename WeakCallbackInfo<P>::Callback callback
|
|
90
|
+
, WeakCallbackType type) {
|
|
91
|
+
reinterpret_cast<Persistent<T>*>(this)->SetWeak(
|
|
92
|
+
parameter, callback, type);
|
|
93
|
+
}
|
|
94
|
+
};
|
|
95
|
+
#else
|
|
96
|
+
template<typename T>
|
|
97
|
+
class Global : public v8::UniquePersistent<T> {
|
|
98
|
+
public:
|
|
99
|
+
inline Global() : v8::UniquePersistent<T>() {}
|
|
100
|
+
|
|
101
|
+
template<typename S> inline Global(v8::Local<S> that) :
|
|
102
|
+
v8::UniquePersistent<T>(v8::Isolate::GetCurrent(), that) {}
|
|
103
|
+
|
|
104
|
+
template<typename S>
|
|
105
|
+
inline
|
|
106
|
+
Global(const v8::PersistentBase<S> &that) : // NOLINT(runtime/explicit)
|
|
107
|
+
v8::UniquePersistent<S>(v8::Isolate::GetCurrent(), that) {}
|
|
108
|
+
|
|
109
|
+
inline void Reset() { v8::PersistentBase<T>::Reset(); }
|
|
110
|
+
|
|
111
|
+
template <typename S>
|
|
112
|
+
inline void Reset(const v8::Local<S> &other) {
|
|
113
|
+
v8::PersistentBase<T>::Reset(v8::Isolate::GetCurrent(), other);
|
|
114
|
+
}
|
|
115
|
+
|
|
116
|
+
template <typename S>
|
|
117
|
+
inline void Reset(const v8::PersistentBase<S> &other) {
|
|
118
|
+
v8::PersistentBase<T>::Reset(v8::Isolate::GetCurrent(), other);
|
|
119
|
+
}
|
|
120
|
+
|
|
121
|
+
template<typename P>
|
|
122
|
+
inline void SetWeak(
|
|
123
|
+
P *parameter
|
|
124
|
+
, typename WeakCallbackInfo<P>::Callback callback
|
|
125
|
+
, WeakCallbackType type) {
|
|
126
|
+
reinterpret_cast<Persistent<T>*>(this)->SetWeak(
|
|
127
|
+
parameter, callback, type);
|
|
128
|
+
}
|
|
129
|
+
};
|
|
130
|
+
#endif
|
|
131
|
+
|
|
132
|
+
#endif // NAN_PERSISTENT_12_INL_H_
|