apipost-cli 1.0.8 → 1.0.13
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/README.md +4 -0
- package/dist/37.index.js +452 -0
- package/dist/841.index.js +6984 -0
- package/dist/action.js +4 -0
- package/dist/apipost-cli/node_modules/@azure/abort-controller/types/3.1/AbortController.d.ts +85 -0
- package/dist/apipost-cli/node_modules/@azure/abort-controller/types/3.1/AbortSignal.d.ts +80 -0
- package/dist/apipost-cli/node_modules/@azure/abort-controller/types/3.1/index.d.ts +3 -0
- package/dist/apipost-cli/node_modules/@azure/core-auth/types/3.1/core-auth.d.ts +229 -0
- package/dist/apipost-cli/node_modules/@azure/core-client/types/3.1/core-client.d.ts +900 -0
- package/dist/apipost-cli/node_modules/@azure/core-paging/types/3.1/core-paging.d.ts +77 -0
- package/dist/apipost-cli/node_modules/@azure/core-paging/types/3.1/samples-dev/getPagedAsyncIteratorSample.d.ts +2 -0
- package/dist/apipost-cli/node_modules/@azure/core-paging/types/3.1/src/getPagedAsyncIterator.d.ts +10 -0
- package/dist/apipost-cli/node_modules/@azure/core-paging/types/3.1/src/index.d.ts +3 -0
- package/dist/apipost-cli/node_modules/@azure/core-paging/types/3.1/src/models.d.ts +69 -0
- package/dist/apipost-cli/node_modules/@azure/core-paging/types/3.1/test/getPagedAsyncIterator.spec.d.ts +2 -0
- package/dist/apipost-cli/node_modules/@azure/core-rest-pipeline/types/3.1/core-rest-pipeline.d.ts +1114 -0
- package/dist/apipost-cli/node_modules/@azure/core-util/types/3.1/core-util.d.ts +112 -0
- package/dist/apipost-cli/node_modules/@nodelib/fs.scandir/LICENSE +21 -0
- package/dist/apipost-cli/node_modules/@nodelib/fs.scandir/out/adapters/fs.d.ts +20 -0
- package/dist/apipost-cli/node_modules/@nodelib/fs.scandir/out/adapters/fs.js +19 -0
- package/dist/apipost-cli/node_modules/@nodelib/fs.scandir/out/constants.d.ts +4 -0
- package/dist/apipost-cli/node_modules/@nodelib/fs.scandir/out/constants.js +17 -0
- package/dist/apipost-cli/node_modules/@nodelib/fs.scandir/out/index.d.ts +12 -0
- package/dist/apipost-cli/node_modules/@nodelib/fs.scandir/out/index.js +26 -0
- package/dist/apipost-cli/node_modules/@nodelib/fs.scandir/out/providers/async.d.ts +7 -0
- package/dist/apipost-cli/node_modules/@nodelib/fs.scandir/out/providers/async.js +104 -0
- package/dist/apipost-cli/node_modules/@nodelib/fs.scandir/out/providers/common.d.ts +1 -0
- package/dist/apipost-cli/node_modules/@nodelib/fs.scandir/out/providers/common.js +13 -0
- package/dist/apipost-cli/node_modules/@nodelib/fs.scandir/out/providers/sync.d.ts +5 -0
- package/dist/apipost-cli/node_modules/@nodelib/fs.scandir/out/providers/sync.js +54 -0
- package/dist/apipost-cli/node_modules/@nodelib/fs.scandir/out/settings.d.ts +20 -0
- package/dist/apipost-cli/node_modules/@nodelib/fs.scandir/out/settings.js +24 -0
- package/dist/apipost-cli/node_modules/@nodelib/fs.scandir/out/types/index.d.ts +20 -0
- package/dist/apipost-cli/node_modules/@nodelib/fs.scandir/out/types/index.js +2 -0
- package/dist/apipost-cli/node_modules/@nodelib/fs.scandir/out/utils/fs.d.ts +2 -0
- package/dist/apipost-cli/node_modules/@nodelib/fs.scandir/out/utils/fs.js +19 -0
- package/dist/apipost-cli/node_modules/@nodelib/fs.scandir/out/utils/index.d.ts +2 -0
- package/dist/apipost-cli/node_modules/@nodelib/fs.scandir/out/utils/index.js +5 -0
- package/dist/apipost-cli/node_modules/@nodelib/fs.scandir/package.json +44 -0
- package/dist/apipost-cli/node_modules/@nodelib/fs.stat/LICENSE +21 -0
- package/dist/apipost-cli/node_modules/@nodelib/fs.stat/out/adapters/fs.d.ts +13 -0
- package/dist/apipost-cli/node_modules/@nodelib/fs.stat/out/adapters/fs.js +17 -0
- package/dist/apipost-cli/node_modules/@nodelib/fs.stat/out/index.d.ts +12 -0
- package/dist/apipost-cli/node_modules/@nodelib/fs.stat/out/index.js +26 -0
- package/dist/apipost-cli/node_modules/@nodelib/fs.stat/out/providers/async.d.ts +4 -0
- package/dist/apipost-cli/node_modules/@nodelib/fs.stat/out/providers/async.js +36 -0
- package/dist/apipost-cli/node_modules/@nodelib/fs.stat/out/providers/sync.d.ts +3 -0
- package/dist/apipost-cli/node_modules/@nodelib/fs.stat/out/providers/sync.js +23 -0
- package/dist/apipost-cli/node_modules/@nodelib/fs.stat/out/settings.d.ts +16 -0
- package/dist/apipost-cli/node_modules/@nodelib/fs.stat/out/settings.js +16 -0
- package/dist/apipost-cli/node_modules/@nodelib/fs.stat/out/types/index.d.ts +4 -0
- package/dist/apipost-cli/node_modules/@nodelib/fs.stat/out/types/index.js +2 -0
- package/dist/apipost-cli/node_modules/@nodelib/fs.stat/package.json +37 -0
- package/dist/apipost-cli/node_modules/@nodelib/fs.walk/LICENSE +21 -0
- package/dist/apipost-cli/node_modules/@nodelib/fs.walk/out/index.d.ts +14 -0
- package/dist/apipost-cli/node_modules/@nodelib/fs.walk/out/index.js +34 -0
- package/dist/apipost-cli/node_modules/@nodelib/fs.walk/out/providers/async.d.ts +12 -0
- package/dist/apipost-cli/node_modules/@nodelib/fs.walk/out/providers/async.js +30 -0
- package/dist/apipost-cli/node_modules/@nodelib/fs.walk/out/providers/index.d.ts +4 -0
- package/dist/apipost-cli/node_modules/@nodelib/fs.walk/out/providers/index.js +9 -0
- package/dist/apipost-cli/node_modules/@nodelib/fs.walk/out/providers/stream.d.ts +12 -0
- package/dist/apipost-cli/node_modules/@nodelib/fs.walk/out/providers/stream.js +34 -0
- package/dist/apipost-cli/node_modules/@nodelib/fs.walk/out/providers/sync.d.ts +10 -0
- package/dist/apipost-cli/node_modules/@nodelib/fs.walk/out/providers/sync.js +14 -0
- package/dist/apipost-cli/node_modules/@nodelib/fs.walk/out/readers/async.d.ts +30 -0
- package/dist/apipost-cli/node_modules/@nodelib/fs.walk/out/readers/async.js +97 -0
- package/dist/apipost-cli/node_modules/@nodelib/fs.walk/out/readers/common.d.ts +7 -0
- package/dist/apipost-cli/node_modules/@nodelib/fs.walk/out/readers/common.js +31 -0
- package/dist/apipost-cli/node_modules/@nodelib/fs.walk/out/readers/reader.d.ts +6 -0
- package/dist/apipost-cli/node_modules/@nodelib/fs.walk/out/readers/reader.js +11 -0
- package/dist/apipost-cli/node_modules/@nodelib/fs.walk/out/readers/sync.d.ts +15 -0
- package/dist/apipost-cli/node_modules/@nodelib/fs.walk/out/readers/sync.js +59 -0
- package/dist/apipost-cli/node_modules/@nodelib/fs.walk/out/settings.d.ts +30 -0
- package/dist/apipost-cli/node_modules/@nodelib/fs.walk/out/settings.js +26 -0
- package/dist/apipost-cli/node_modules/@nodelib/fs.walk/out/types/index.d.ts +8 -0
- package/dist/apipost-cli/node_modules/@nodelib/fs.walk/out/types/index.js +2 -0
- package/dist/apipost-cli/node_modules/@nodelib/fs.walk/package.json +44 -0
- package/dist/apipost-cli/node_modules/@types/node/ts4.8/assert/strict.d.ts +8 -0
- package/dist/apipost-cli/node_modules/@types/node/ts4.8/assert.d.ts +972 -0
- package/dist/apipost-cli/node_modules/@types/node/ts4.8/async_hooks.d.ts +530 -0
- package/dist/apipost-cli/node_modules/@types/node/ts4.8/buffer.d.ts +2351 -0
- package/dist/apipost-cli/node_modules/@types/node/ts4.8/child_process.d.ts +1395 -0
- package/dist/apipost-cli/node_modules/@types/node/ts4.8/cluster.d.ts +410 -0
- package/dist/apipost-cli/node_modules/@types/node/ts4.8/console.d.ts +412 -0
- package/dist/apipost-cli/node_modules/@types/node/ts4.8/constants.d.ts +18 -0
- package/dist/apipost-cli/node_modules/@types/node/ts4.8/crypto.d.ts +3961 -0
- package/dist/apipost-cli/node_modules/@types/node/ts4.8/dgram.d.ts +545 -0
- package/dist/apipost-cli/node_modules/@types/node/ts4.8/diagnostics_channel.d.ts +191 -0
- package/dist/apipost-cli/node_modules/@types/node/ts4.8/dns/promises.d.ts +414 -0
- package/dist/apipost-cli/node_modules/@types/node/ts4.8/dns.d.ts +668 -0
- package/dist/apipost-cli/node_modules/@types/node/ts4.8/dom-events.d.ts +126 -0
- package/dist/apipost-cli/node_modules/@types/node/ts4.8/domain.d.ts +170 -0
- package/dist/apipost-cli/node_modules/@types/node/ts4.8/events.d.ts +724 -0
- package/dist/apipost-cli/node_modules/@types/node/ts4.8/fs/promises.d.ts +1189 -0
- package/dist/apipost-cli/node_modules/@types/node/ts4.8/fs.d.ts +4043 -0
- package/dist/apipost-cli/node_modules/@types/node/ts4.8/globals.d.ts +303 -0
- package/dist/apipost-cli/node_modules/@types/node/ts4.8/globals.global.d.ts +1 -0
- package/dist/apipost-cli/node_modules/@types/node/ts4.8/http.d.ts +1724 -0
- package/dist/apipost-cli/node_modules/@types/node/ts4.8/http2.d.ts +2129 -0
- package/dist/apipost-cli/node_modules/@types/node/ts4.8/https.d.ts +441 -0
- package/dist/apipost-cli/node_modules/@types/node/ts4.8/index.d.ts +88 -0
- package/dist/apipost-cli/node_modules/@types/node/ts4.8/inspector.d.ts +2748 -0
- package/dist/apipost-cli/node_modules/@types/node/ts4.8/module.d.ts +116 -0
- package/dist/apipost-cli/node_modules/@types/node/ts4.8/net.d.ts +886 -0
- package/dist/apipost-cli/node_modules/@types/node/ts4.8/os.d.ts +477 -0
- package/dist/apipost-cli/node_modules/@types/node/ts4.8/path.d.ts +191 -0
- package/dist/apipost-cli/node_modules/@types/node/ts4.8/perf_hooks.d.ts +638 -0
- package/dist/apipost-cli/node_modules/@types/node/ts4.8/process.d.ts +1485 -0
- package/dist/apipost-cli/node_modules/@types/node/ts4.8/punycode.d.ts +117 -0
- package/dist/apipost-cli/node_modules/@types/node/ts4.8/querystring.d.ts +131 -0
- package/dist/apipost-cli/node_modules/@types/node/ts4.8/readline/promises.d.ts +145 -0
- package/dist/apipost-cli/node_modules/@types/node/ts4.8/readline.d.ts +526 -0
- package/dist/apipost-cli/node_modules/@types/node/ts4.8/repl.d.ts +424 -0
- package/dist/apipost-cli/node_modules/@types/node/ts4.8/stream/consumers.d.ts +12 -0
- package/dist/apipost-cli/node_modules/@types/node/ts4.8/stream/promises.d.ts +42 -0
- package/dist/apipost-cli/node_modules/@types/node/ts4.8/stream/web.d.ts +330 -0
- package/dist/apipost-cli/node_modules/@types/node/ts4.8/stream.d.ts +1392 -0
- package/dist/apipost-cli/node_modules/@types/node/ts4.8/string_decoder.d.ts +67 -0
- package/dist/apipost-cli/node_modules/@types/node/ts4.8/test.d.ts +1052 -0
- package/dist/apipost-cli/node_modules/@types/node/ts4.8/timers/promises.d.ts +93 -0
- package/dist/apipost-cli/node_modules/@types/node/ts4.8/timers.d.ts +215 -0
- package/dist/apipost-cli/node_modules/@types/node/ts4.8/tls.d.ts +1119 -0
- package/dist/apipost-cli/node_modules/@types/node/ts4.8/trace_events.d.ts +182 -0
- package/dist/apipost-cli/node_modules/@types/node/ts4.8/tty.d.ts +205 -0
- package/dist/apipost-cli/node_modules/@types/node/ts4.8/url.d.ts +901 -0
- package/dist/apipost-cli/node_modules/@types/node/ts4.8/util.d.ts +2052 -0
- package/dist/apipost-cli/node_modules/@types/node/ts4.8/v8.d.ts +635 -0
- package/dist/apipost-cli/node_modules/@types/node/ts4.8/vm.d.ts +894 -0
- package/dist/apipost-cli/node_modules/@types/node/ts4.8/wasi.d.ts +152 -0
- package/dist/apipost-cli/node_modules/@types/node/ts4.8/worker_threads.d.ts +693 -0
- package/dist/apipost-cli/node_modules/@types/node/ts4.8/zlib.d.ts +517 -0
- package/dist/apipost-cli/node_modules/bignumber.js/LICENCE.md +26 -0
- package/dist/apipost-cli/node_modules/bignumber.js/bignumber.d.ts +1831 -0
- package/dist/apipost-cli/node_modules/bignumber.js/bignumber.js +2926 -0
- package/dist/apipost-cli/node_modules/bignumber.js/bignumber.mjs +2889 -0
- package/dist/apipost-cli/node_modules/bignumber.js/doc/API.html +2249 -0
- package/dist/apipost-cli/node_modules/bignumber.js/package.json +50 -0
- package/dist/apipost-cli/node_modules/cpu-features/build/Release/obj.target/cpu_features/deps/cpu_features/src/filesystem.o +0 -0
- package/dist/apipost-cli/node_modules/cpu-features/build/Release/obj.target/cpu_features/deps/cpu_features/src/hwcaps.o +0 -0
- package/dist/apipost-cli/node_modules/cpu-features/build/Release/obj.target/cpu_features/deps/cpu_features/src/impl_aarch64_linux_or_android.o +0 -0
- package/dist/apipost-cli/node_modules/cpu-features/build/Release/obj.target/cpu_features/deps/cpu_features/src/impl_aarch64_macos_or_iphone.o +0 -0
- package/dist/apipost-cli/node_modules/cpu-features/build/Release/obj.target/cpu_features/deps/cpu_features/src/impl_arm_linux_or_android.o +0 -0
- package/dist/apipost-cli/node_modules/cpu-features/build/Release/obj.target/cpu_features/deps/cpu_features/src/impl_mips_linux_or_android.o +0 -0
- package/dist/apipost-cli/node_modules/cpu-features/build/Release/obj.target/cpu_features/deps/cpu_features/src/impl_ppc_linux.o +0 -0
- package/dist/apipost-cli/node_modules/cpu-features/build/Release/obj.target/cpu_features/deps/cpu_features/src/impl_x86_freebsd.o +0 -0
- package/dist/apipost-cli/node_modules/cpu-features/build/Release/obj.target/cpu_features/deps/cpu_features/src/impl_x86_linux_or_android.o +0 -0
- package/dist/apipost-cli/node_modules/cpu-features/build/Release/obj.target/cpu_features/deps/cpu_features/src/impl_x86_macos.o +0 -0
- package/dist/apipost-cli/node_modules/cpu-features/build/Release/obj.target/cpu_features/deps/cpu_features/src/impl_x86_windows.o +0 -0
- package/dist/apipost-cli/node_modules/cpu-features/build/Release/obj.target/cpu_features/deps/cpu_features/src/stack_line_reader.o +0 -0
- package/dist/apipost-cli/node_modules/cpu-features/build/Release/obj.target/cpu_features/deps/cpu_features/src/string_view.o +0 -0
- package/dist/apipost-cli/node_modules/cpu-features/build/Release/obj.target/cpufeatures/src/binding.o +0 -0
- package/dist/apipost-cli/node_modules/des.js/lib/des/cbc.js +65 -0
- package/dist/apipost-cli/node_modules/des.js/lib/des/cipher.js +142 -0
- package/dist/apipost-cli/node_modules/des.js/lib/des/des.js +150 -0
- package/dist/apipost-cli/node_modules/des.js/lib/des/ede.js +54 -0
- package/dist/apipost-cli/node_modules/des.js/lib/des/utils.js +256 -0
- package/dist/apipost-cli/node_modules/des.js/lib/des.js +7 -0
- package/dist/apipost-cli/node_modules/des.js/package.json +33 -0
- package/dist/apipost-cli/node_modules/des.js/test/cbc-test.js +73 -0
- package/dist/apipost-cli/node_modules/des.js/test/des-test.js +139 -0
- package/dist/apipost-cli/node_modules/des.js/test/ede-test.js +106 -0
- package/dist/apipost-cli/node_modules/des.js/test/fixtures.js +5 -0
- package/dist/apipost-cli/node_modules/des.js/test/utils-test.js +169 -0
- package/dist/apipost-cli/node_modules/fs.realpath/LICENSE +43 -0
- package/dist/apipost-cli/node_modules/fs.realpath/index.js +66 -0
- package/dist/apipost-cli/node_modules/fs.realpath/old.js +303 -0
- package/dist/apipost-cli/node_modules/fs.realpath/package.json +26 -0
- package/dist/apipost-cli/node_modules/function.prototype.name/LICENSE +21 -0
- package/dist/apipost-cli/node_modules/function.prototype.name/auto.js +3 -0
- package/dist/apipost-cli/node_modules/function.prototype.name/helpers/functionsHaveNames.js +5 -0
- package/dist/apipost-cli/node_modules/function.prototype.name/implementation.js +43 -0
- package/dist/apipost-cli/node_modules/function.prototype.name/index.js +18 -0
- package/dist/apipost-cli/node_modules/function.prototype.name/package.json +80 -0
- package/dist/apipost-cli/node_modules/function.prototype.name/polyfill.js +7 -0
- package/dist/apipost-cli/node_modules/function.prototype.name/shim.js +35 -0
- package/dist/apipost-cli/node_modules/function.prototype.name/test/implementation.js +20 -0
- package/dist/apipost-cli/node_modules/function.prototype.name/test/index.js +23 -0
- package/dist/apipost-cli/node_modules/function.prototype.name/test/shimmed.js +21 -0
- package/dist/apipost-cli/node_modules/function.prototype.name/test/tests.js +60 -0
- package/dist/apipost-cli/node_modules/function.prototype.name/test/uglified.js +17 -0
- package/dist/apipost-cli/node_modules/lodash.camelcase/LICENSE +47 -0
- package/dist/apipost-cli/node_modules/lodash.camelcase/index.js +599 -0
- package/dist/apipost-cli/node_modules/lodash.camelcase/package.json +17 -0
- package/dist/apipost-cli/node_modules/lodash.memoize/LICENSE +47 -0
- package/dist/apipost-cli/node_modules/lodash.memoize/index.js +676 -0
- package/dist/apipost-cli/node_modules/lodash.memoize/package.json +17 -0
- package/dist/apipost-cli/node_modules/lodash.uniq/LICENSE +47 -0
- package/dist/apipost-cli/node_modules/lodash.uniq/index.js +896 -0
- package/dist/apipost-cli/node_modules/lodash.uniq/package.json +17 -0
- package/dist/apipost-cli/node_modules/moment/ts3.1-typings/moment.d.ts +785 -0
- package/dist/apipost-cli/node_modules/oauth-1.0a/LICENSE +20 -0
- package/dist/apipost-cli/node_modules/oauth-1.0a/Makefile +36 -0
- package/dist/apipost-cli/node_modules/oauth-1.0a/oauth-1.0a.d.ts +192 -0
- package/dist/apipost-cli/node_modules/oauth-1.0a/oauth-1.0a.js +377 -0
- package/dist/apipost-cli/node_modules/oauth-1.0a/package.json +30 -0
- package/dist/apipost-cli/node_modules/oauth-1.0a/test/getParameterString.js +21 -0
- package/dist/apipost-cli/node_modules/oauth-1.0a/test/mocha.opts +4 -0
- package/dist/apipost-cli/node_modules/oauth-1.0a/test/oauth_body_hash.js +141 -0
- package/dist/apipost-cli/node_modules/oauth-1.0a/test/options/consumer.js +14 -0
- package/dist/apipost-cli/node_modules/oauth-1.0a/test/options/last_ampersand.js +55 -0
- package/dist/apipost-cli/node_modules/oauth-1.0a/test/options/multiple_values.js +54 -0
- package/dist/apipost-cli/node_modules/oauth-1.0a/test/options/multiple_values_qs.js +50 -0
- package/dist/apipost-cli/node_modules/oauth-1.0a/test/options/nonce_length.js +44 -0
- package/dist/apipost-cli/node_modules/oauth-1.0a/test/options/parameter_seperator.js +102 -0
- package/dist/apipost-cli/node_modules/oauth-1.0a/test/options/realm.js +51 -0
- package/dist/apipost-cli/node_modules/oauth-1.0a/test/options/signature_method.js +36 -0
- package/dist/apipost-cli/node_modules/oauth-1.0a/test/services/bitbucket.js +88 -0
- package/dist/apipost-cli/node_modules/oauth-1.0a/test/services/flickr.js +196 -0
- package/dist/apipost-cli/node_modules/oauth-1.0a/test/services/openbank.js +61 -0
- package/dist/apipost-cli/node_modules/oauth-1.0a/test/services/twitter.js +183 -0
- package/dist/apipost-cli/node_modules/oauth-1.0a/test/twitter_sample_data.js +94 -0
- package/dist/apipost-cli/node_modules/object.assign/LICENSE +21 -0
- package/dist/apipost-cli/node_modules/object.assign/auto.js +3 -0
- package/dist/apipost-cli/node_modules/object.assign/dist/browser.js +944 -0
- package/dist/apipost-cli/node_modules/object.assign/hasSymbols.js +43 -0
- package/dist/apipost-cli/node_modules/object.assign/implementation.js +46 -0
- package/dist/apipost-cli/node_modules/object.assign/index.js +22 -0
- package/dist/apipost-cli/node_modules/object.assign/package.json +96 -0
- package/dist/apipost-cli/node_modules/object.assign/polyfill.js +55 -0
- package/dist/apipost-cli/node_modules/object.assign/shim.js +14 -0
- package/dist/apipost-cli/node_modules/object.assign/test/implementation.js +19 -0
- package/dist/apipost-cli/node_modules/object.assign/test/index.js +17 -0
- package/dist/apipost-cli/node_modules/object.assign/test/native.js +49 -0
- package/dist/apipost-cli/node_modules/object.assign/test/ses-compat.js +12 -0
- package/dist/apipost-cli/node_modules/object.assign/test/shimmed.js +52 -0
- package/dist/apipost-cli/node_modules/object.assign/test/tests.js +232 -0
- package/dist/apipost-cli/node_modules/object.assign/test.html +18458 -0
- package/dist/apipost-cli/node_modules/promise.series/LICENSE +21 -0
- package/dist/apipost-cli/node_modules/promise.series/index.js +10 -0
- package/dist/apipost-cli/node_modules/promise.series/package.json +34 -0
- package/dist/apipost-cli/node_modules/regexp.prototype.flags/LICENSE +22 -0
- package/dist/apipost-cli/node_modules/regexp.prototype.flags/auto.js +3 -0
- package/dist/apipost-cli/node_modules/regexp.prototype.flags/implementation.js +42 -0
- package/dist/apipost-cli/node_modules/regexp.prototype.flags/index.js +18 -0
- package/dist/apipost-cli/node_modules/regexp.prototype.flags/package.json +100 -0
- package/dist/apipost-cli/node_modules/regexp.prototype.flags/polyfill.js +36 -0
- package/dist/apipost-cli/node_modules/regexp.prototype.flags/shim.js +26 -0
- package/dist/apipost-cli/node_modules/regexp.prototype.flags/test/implementation.js +20 -0
- package/dist/apipost-cli/node_modules/regexp.prototype.flags/test/index.js +17 -0
- package/dist/apipost-cli/node_modules/regexp.prototype.flags/test/shimmed.js +48 -0
- package/dist/apipost-cli/node_modules/regexp.prototype.flags/test/tests.js +143 -0
- package/dist/apipost-cli/node_modules/resolve.exports/dist/index.js +1 -0
- package/dist/apipost-cli/node_modules/resolve.exports/dist/index.mjs +1 -0
- package/dist/apipost-cli/node_modules/resolve.exports/index.d.ts +100 -0
- package/dist/apipost-cli/node_modules/resolve.exports/license +21 -0
- package/dist/apipost-cli/node_modules/resolve.exports/package.json +50 -0
- package/dist/apipost-cli/node_modules/ssh2/lib/protocol/crypto/build/Release/obj.target/sshcrypto/src/binding.o +0 -0
- package/dist/apipost-cli/node_modules/string.prototype.trim/LICENSE +21 -0
- package/dist/apipost-cli/node_modules/string.prototype.trim/auto.js +3 -0
- package/dist/apipost-cli/node_modules/string.prototype.trim/implementation.js +21 -0
- package/dist/apipost-cli/node_modules/string.prototype.trim/index.js +23 -0
- package/dist/apipost-cli/node_modules/string.prototype.trim/package.json +101 -0
- package/dist/apipost-cli/node_modules/string.prototype.trim/polyfill.js +19 -0
- package/dist/apipost-cli/node_modules/string.prototype.trim/shim.js +14 -0
- package/dist/apipost-cli/node_modules/string.prototype.trim/test/implementation.js +21 -0
- package/dist/apipost-cli/node_modules/string.prototype.trim/test/index.js +17 -0
- package/dist/apipost-cli/node_modules/string.prototype.trim/test/shimmed.js +36 -0
- package/dist/apipost-cli/node_modules/string.prototype.trim/test/tests.js +45 -0
- package/dist/apipost-cli/node_modules/string.prototype.trimend/LICENSE +21 -0
- package/dist/apipost-cli/node_modules/string.prototype.trimend/auto.js +3 -0
- package/dist/apipost-cli/node_modules/string.prototype.trimend/implementation.js +15 -0
- package/dist/apipost-cli/node_modules/string.prototype.trimend/index.js +23 -0
- package/dist/apipost-cli/node_modules/string.prototype.trimend/package.json +79 -0
- package/dist/apipost-cli/node_modules/string.prototype.trimend/polyfill.js +15 -0
- package/dist/apipost-cli/node_modules/string.prototype.trimend/shim.js +14 -0
- package/dist/apipost-cli/node_modules/string.prototype.trimend/test/implementation.js +20 -0
- package/dist/apipost-cli/node_modules/string.prototype.trimend/test/index.js +17 -0
- package/dist/apipost-cli/node_modules/string.prototype.trimend/test/shimmed.js +36 -0
- package/dist/apipost-cli/node_modules/string.prototype.trimend/test/tests.js +31 -0
- package/dist/apipost-cli/node_modules/string.prototype.trimstart/LICENSE +21 -0
- package/dist/apipost-cli/node_modules/string.prototype.trimstart/auto.js +3 -0
- package/dist/apipost-cli/node_modules/string.prototype.trimstart/implementation.js +15 -0
- package/dist/apipost-cli/node_modules/string.prototype.trimstart/index.js +23 -0
- package/dist/apipost-cli/node_modules/string.prototype.trimstart/package.json +79 -0
- package/dist/apipost-cli/node_modules/string.prototype.trimstart/polyfill.js +15 -0
- package/dist/apipost-cli/node_modules/string.prototype.trimstart/shim.js +14 -0
- package/dist/apipost-cli/node_modules/string.prototype.trimstart/test/implementation.js +20 -0
- package/dist/apipost-cli/node_modules/string.prototype.trimstart/test/index.js +18 -0
- package/dist/apipost-cli/node_modules/string.prototype.trimstart/test/shimmed.js +36 -0
- package/dist/apipost-cli/node_modules/string.prototype.trimstart/test/tests.js +31 -0
- package/dist/apipost-cli/node_modules/web-streams-polyfill/dist/types/ts3.6/polyfill.d.ts +771 -0
- package/dist/apipost-http-schema.json +129 -0
- package/dist/bridge.js +1010 -0
- package/dist/build/Release/cpufeatures.node +0 -0
- package/dist/esprima.js +3756 -0
- package/dist/events.js +977 -0
- package/dist/index.js +565958 -0
- package/dist/index1.js +26 -0
- package/dist/lib/protocol/crypto/build/Release/sshcrypto.node +0 -0
- package/dist/module.js +34 -0
- package/dist/pagent.exe +0 -0
- package/dist/setup-node-sandbox.js +461 -0
- package/dist/setup-sandbox.js +545 -0
- package/dist/snappy.darwin-arm64.node +0 -0
- package/dist/xdg-open +1066 -0
- package/package.json +13 -4
- package/bin/cli.js +0 -216
- package/bin/template.js +0 -803
- /package/{bin → dist/apipost-cli}/apipost-reports//346/265/213/350/257/225.html" +0 -0
- /package/{bin → dist/apipost-cli}/apipost-reports//346/265/213/350/257/225.json" +0 -0
|
@@ -0,0 +1,545 @@
|
|
|
1
|
+
/* global host, bridge, data, context */
|
|
2
|
+
|
|
3
|
+
'use strict';
|
|
4
|
+
|
|
5
|
+
const {
|
|
6
|
+
Object: localObject,
|
|
7
|
+
Array: localArray,
|
|
8
|
+
Error: LocalError,
|
|
9
|
+
Reflect: localReflect,
|
|
10
|
+
Proxy: LocalProxy,
|
|
11
|
+
WeakMap: LocalWeakMap,
|
|
12
|
+
Function: localFunction,
|
|
13
|
+
Promise: localPromise,
|
|
14
|
+
eval: localEval
|
|
15
|
+
} = global;
|
|
16
|
+
|
|
17
|
+
const {
|
|
18
|
+
freeze: localObjectFreeze
|
|
19
|
+
} = localObject;
|
|
20
|
+
|
|
21
|
+
const {
|
|
22
|
+
getPrototypeOf: localReflectGetPrototypeOf,
|
|
23
|
+
apply: localReflectApply,
|
|
24
|
+
construct: localReflectConstruct,
|
|
25
|
+
deleteProperty: localReflectDeleteProperty,
|
|
26
|
+
has: localReflectHas,
|
|
27
|
+
defineProperty: localReflectDefineProperty,
|
|
28
|
+
setPrototypeOf: localReflectSetPrototypeOf,
|
|
29
|
+
getOwnPropertyDescriptor: localReflectGetOwnPropertyDescriptor
|
|
30
|
+
} = localReflect;
|
|
31
|
+
|
|
32
|
+
const {
|
|
33
|
+
isArray: localArrayIsArray
|
|
34
|
+
} = localArray;
|
|
35
|
+
|
|
36
|
+
const {
|
|
37
|
+
ensureThis,
|
|
38
|
+
ReadOnlyHandler,
|
|
39
|
+
from,
|
|
40
|
+
fromWithFactory,
|
|
41
|
+
readonlyFactory,
|
|
42
|
+
connect,
|
|
43
|
+
addProtoMapping,
|
|
44
|
+
VMError,
|
|
45
|
+
ReadOnlyMockHandler
|
|
46
|
+
} = bridge;
|
|
47
|
+
|
|
48
|
+
const {
|
|
49
|
+
allowAsync,
|
|
50
|
+
GeneratorFunction,
|
|
51
|
+
AsyncFunction,
|
|
52
|
+
AsyncGeneratorFunction
|
|
53
|
+
} = data;
|
|
54
|
+
|
|
55
|
+
const {
|
|
56
|
+
get: localWeakMapGet,
|
|
57
|
+
set: localWeakMapSet
|
|
58
|
+
} = LocalWeakMap.prototype;
|
|
59
|
+
|
|
60
|
+
function localUnexpected() {
|
|
61
|
+
return new VMError('Should not happen');
|
|
62
|
+
}
|
|
63
|
+
|
|
64
|
+
// global is originally prototype of host.Object so it can be used to climb up from the sandbox.
|
|
65
|
+
if (!localReflectSetPrototypeOf(context, localObject.prototype)) throw localUnexpected();
|
|
66
|
+
|
|
67
|
+
Object.defineProperties(global, {
|
|
68
|
+
global: {value: global, writable: true, configurable: true, enumerable: true},
|
|
69
|
+
globalThis: {value: global, writable: true, configurable: true},
|
|
70
|
+
GLOBAL: {value: global, writable: true, configurable: true},
|
|
71
|
+
root: {value: global, writable: true, configurable: true},
|
|
72
|
+
Error: {value: LocalError}
|
|
73
|
+
});
|
|
74
|
+
|
|
75
|
+
if (!localReflectDefineProperty(global, 'VMError', {
|
|
76
|
+
__proto__: null,
|
|
77
|
+
value: VMError,
|
|
78
|
+
writable: true,
|
|
79
|
+
enumerable: false,
|
|
80
|
+
configurable: true
|
|
81
|
+
})) throw localUnexpected();
|
|
82
|
+
|
|
83
|
+
// Fixes buffer unsafe allocation
|
|
84
|
+
/* eslint-disable no-use-before-define */
|
|
85
|
+
class BufferHandler extends ReadOnlyHandler {
|
|
86
|
+
|
|
87
|
+
apply(target, thiz, args) {
|
|
88
|
+
if (args.length > 0 && typeof args[0] === 'number') {
|
|
89
|
+
return LocalBuffer.alloc(args[0]);
|
|
90
|
+
}
|
|
91
|
+
return localReflectApply(LocalBuffer.from, LocalBuffer, args);
|
|
92
|
+
}
|
|
93
|
+
|
|
94
|
+
construct(target, args, newTarget) {
|
|
95
|
+
if (args.length > 0 && typeof args[0] === 'number') {
|
|
96
|
+
return LocalBuffer.alloc(args[0]);
|
|
97
|
+
}
|
|
98
|
+
return localReflectApply(LocalBuffer.from, LocalBuffer, args);
|
|
99
|
+
}
|
|
100
|
+
|
|
101
|
+
}
|
|
102
|
+
/* eslint-enable no-use-before-define */
|
|
103
|
+
|
|
104
|
+
const LocalBuffer = fromWithFactory(obj => new BufferHandler(obj), host.Buffer);
|
|
105
|
+
|
|
106
|
+
|
|
107
|
+
if (!localReflectDefineProperty(global, 'Buffer', {
|
|
108
|
+
__proto__: null,
|
|
109
|
+
value: LocalBuffer,
|
|
110
|
+
writable: true,
|
|
111
|
+
enumerable: false,
|
|
112
|
+
configurable: true
|
|
113
|
+
})) throw localUnexpected();
|
|
114
|
+
|
|
115
|
+
addProtoMapping(LocalBuffer.prototype, host.Buffer.prototype, 'Uint8Array');
|
|
116
|
+
|
|
117
|
+
/**
|
|
118
|
+
*
|
|
119
|
+
* @param {*} size Size of new buffer
|
|
120
|
+
* @this LocalBuffer
|
|
121
|
+
* @return {LocalBuffer}
|
|
122
|
+
*/
|
|
123
|
+
function allocUnsafe(size) {
|
|
124
|
+
return LocalBuffer.alloc(size);
|
|
125
|
+
}
|
|
126
|
+
|
|
127
|
+
connect(allocUnsafe, host.Buffer.allocUnsafe);
|
|
128
|
+
|
|
129
|
+
/**
|
|
130
|
+
*
|
|
131
|
+
* @param {*} size Size of new buffer
|
|
132
|
+
* @this LocalBuffer
|
|
133
|
+
* @return {LocalBuffer}
|
|
134
|
+
*/
|
|
135
|
+
function allocUnsafeSlow(size) {
|
|
136
|
+
return LocalBuffer.alloc(size);
|
|
137
|
+
}
|
|
138
|
+
|
|
139
|
+
connect(allocUnsafeSlow, host.Buffer.allocUnsafeSlow);
|
|
140
|
+
|
|
141
|
+
/**
|
|
142
|
+
* Replacement for Buffer inspect
|
|
143
|
+
*
|
|
144
|
+
* @param {*} recurseTimes
|
|
145
|
+
* @param {*} ctx
|
|
146
|
+
* @this LocalBuffer
|
|
147
|
+
* @return {string}
|
|
148
|
+
*/
|
|
149
|
+
function inspect(recurseTimes, ctx) {
|
|
150
|
+
// Mimic old behavior, could throw but didn't pass a test.
|
|
151
|
+
const max = host.INSPECT_MAX_BYTES;
|
|
152
|
+
const actualMax = Math.min(max, this.length);
|
|
153
|
+
const remaining = this.length - max;
|
|
154
|
+
let str = this.hexSlice(0, actualMax).replace(/(.{2})/g, '$1 ').trim();
|
|
155
|
+
if (remaining > 0) str += ` ... ${remaining} more byte${remaining > 1 ? 's' : ''}`;
|
|
156
|
+
return `<${this.constructor.name} ${str}>`;
|
|
157
|
+
}
|
|
158
|
+
|
|
159
|
+
connect(inspect, host.Buffer.prototype.inspect);
|
|
160
|
+
|
|
161
|
+
connect(localFunction.prototype.bind, host.Function.prototype.bind);
|
|
162
|
+
|
|
163
|
+
connect(localObject.prototype.__defineGetter__, host.Object.prototype.__defineGetter__);
|
|
164
|
+
connect(localObject.prototype.__defineSetter__, host.Object.prototype.__defineSetter__);
|
|
165
|
+
connect(localObject.prototype.__lookupGetter__, host.Object.prototype.__lookupGetter__);
|
|
166
|
+
connect(localObject.prototype.__lookupSetter__, host.Object.prototype.__lookupSetter__);
|
|
167
|
+
|
|
168
|
+
/*
|
|
169
|
+
* PrepareStackTrace sanitization
|
|
170
|
+
*/
|
|
171
|
+
|
|
172
|
+
const oldPrepareStackTraceDesc = localReflectGetOwnPropertyDescriptor(LocalError, 'prepareStackTrace');
|
|
173
|
+
|
|
174
|
+
let currentPrepareStackTrace = LocalError.prepareStackTrace;
|
|
175
|
+
const wrappedPrepareStackTrace = new LocalWeakMap();
|
|
176
|
+
if (typeof currentPrepareStackTrace === 'function') {
|
|
177
|
+
wrappedPrepareStackTrace.set(currentPrepareStackTrace, currentPrepareStackTrace);
|
|
178
|
+
}
|
|
179
|
+
|
|
180
|
+
let OriginalCallSite;
|
|
181
|
+
LocalError.prepareStackTrace = (e, sst) => {
|
|
182
|
+
OriginalCallSite = sst[0].constructor;
|
|
183
|
+
};
|
|
184
|
+
new LocalError().stack;
|
|
185
|
+
if (typeof OriginalCallSite === 'function') {
|
|
186
|
+
LocalError.prepareStackTrace = undefined;
|
|
187
|
+
|
|
188
|
+
function makeCallSiteGetters(list) {
|
|
189
|
+
const callSiteGetters = [];
|
|
190
|
+
for (let i=0; i<list.length; i++) {
|
|
191
|
+
const name = list[i];
|
|
192
|
+
const func = OriginalCallSite.prototype[name];
|
|
193
|
+
callSiteGetters[i] = {__proto__: null,
|
|
194
|
+
name,
|
|
195
|
+
propName: '_' + name,
|
|
196
|
+
func: (thiz) => {
|
|
197
|
+
return localReflectApply(func, thiz, []);
|
|
198
|
+
}
|
|
199
|
+
};
|
|
200
|
+
}
|
|
201
|
+
return callSiteGetters;
|
|
202
|
+
}
|
|
203
|
+
|
|
204
|
+
function applyCallSiteGetters(thiz, callSite, getters) {
|
|
205
|
+
for (let i=0; i<getters.length; i++) {
|
|
206
|
+
const getter = getters[i];
|
|
207
|
+
localReflectDefineProperty(thiz, getter.propName, {
|
|
208
|
+
__proto__: null,
|
|
209
|
+
value: getter.func(callSite)
|
|
210
|
+
});
|
|
211
|
+
}
|
|
212
|
+
}
|
|
213
|
+
|
|
214
|
+
const callSiteGetters = makeCallSiteGetters([
|
|
215
|
+
'getTypeName',
|
|
216
|
+
'getFunctionName',
|
|
217
|
+
'getMethodName',
|
|
218
|
+
'getFileName',
|
|
219
|
+
'getLineNumber',
|
|
220
|
+
'getColumnNumber',
|
|
221
|
+
'getEvalOrigin',
|
|
222
|
+
'isToplevel',
|
|
223
|
+
'isEval',
|
|
224
|
+
'isNative',
|
|
225
|
+
'isConstructor',
|
|
226
|
+
'isAsync',
|
|
227
|
+
'isPromiseAll',
|
|
228
|
+
'getPromiseIndex'
|
|
229
|
+
]);
|
|
230
|
+
|
|
231
|
+
class CallSite {
|
|
232
|
+
constructor(callSite) {
|
|
233
|
+
applyCallSiteGetters(this, callSite, callSiteGetters);
|
|
234
|
+
}
|
|
235
|
+
getThis() {
|
|
236
|
+
return undefined;
|
|
237
|
+
}
|
|
238
|
+
getFunction() {
|
|
239
|
+
return undefined;
|
|
240
|
+
}
|
|
241
|
+
toString() {
|
|
242
|
+
return 'CallSite {}';
|
|
243
|
+
}
|
|
244
|
+
}
|
|
245
|
+
|
|
246
|
+
|
|
247
|
+
for (let i=0; i<callSiteGetters.length; i++) {
|
|
248
|
+
const name = callSiteGetters[i].name;
|
|
249
|
+
const funcProp = localReflectGetOwnPropertyDescriptor(OriginalCallSite.prototype, name);
|
|
250
|
+
if (!funcProp) continue;
|
|
251
|
+
const propertyName = callSiteGetters[i].propName;
|
|
252
|
+
const func = {func() {
|
|
253
|
+
return this[propertyName];
|
|
254
|
+
}}.func;
|
|
255
|
+
const nameProp = localReflectGetOwnPropertyDescriptor(func, 'name');
|
|
256
|
+
if (!nameProp) throw localUnexpected();
|
|
257
|
+
nameProp.value = name;
|
|
258
|
+
if (!localReflectDefineProperty(func, 'name', nameProp)) throw localUnexpected();
|
|
259
|
+
funcProp.value = func;
|
|
260
|
+
if (!localReflectDefineProperty(CallSite.prototype, name, funcProp)) throw localUnexpected();
|
|
261
|
+
}
|
|
262
|
+
|
|
263
|
+
if (!localReflectDefineProperty(LocalError, 'prepareStackTrace', {
|
|
264
|
+
configurable: false,
|
|
265
|
+
enumerable: false,
|
|
266
|
+
get() {
|
|
267
|
+
return currentPrepareStackTrace;
|
|
268
|
+
},
|
|
269
|
+
set(value) {
|
|
270
|
+
if (typeof(value) !== 'function') {
|
|
271
|
+
currentPrepareStackTrace = value;
|
|
272
|
+
return;
|
|
273
|
+
}
|
|
274
|
+
const wrapped = localReflectApply(localWeakMapGet, wrappedPrepareStackTrace, [value]);
|
|
275
|
+
if (wrapped) {
|
|
276
|
+
currentPrepareStackTrace = wrapped;
|
|
277
|
+
return;
|
|
278
|
+
}
|
|
279
|
+
const newWrapped = (error, sst) => {
|
|
280
|
+
const sandboxSst = ensureThis(sst);
|
|
281
|
+
if (localArrayIsArray(sst)) {
|
|
282
|
+
if (sst === sandboxSst) {
|
|
283
|
+
for (let i=0; i < sst.length; i++) {
|
|
284
|
+
const cs = sst[i];
|
|
285
|
+
if (typeof cs === 'object' && localReflectGetPrototypeOf(cs) === OriginalCallSite.prototype) {
|
|
286
|
+
sst[i] = new CallSite(cs);
|
|
287
|
+
}
|
|
288
|
+
}
|
|
289
|
+
} else {
|
|
290
|
+
sst = [];
|
|
291
|
+
for (let i=0; i < sandboxSst.length; i++) {
|
|
292
|
+
const cs = sandboxSst[i];
|
|
293
|
+
localReflectDefineProperty(sst, i, {
|
|
294
|
+
__proto__: null,
|
|
295
|
+
value: new CallSite(cs),
|
|
296
|
+
enumerable: true,
|
|
297
|
+
configurable: true,
|
|
298
|
+
writable: true
|
|
299
|
+
});
|
|
300
|
+
}
|
|
301
|
+
}
|
|
302
|
+
} else {
|
|
303
|
+
sst = sandboxSst;
|
|
304
|
+
}
|
|
305
|
+
return value(error, sst);
|
|
306
|
+
};
|
|
307
|
+
localReflectApply(localWeakMapSet, wrappedPrepareStackTrace, [value, newWrapped]);
|
|
308
|
+
localReflectApply(localWeakMapSet, wrappedPrepareStackTrace, [newWrapped, newWrapped]);
|
|
309
|
+
currentPrepareStackTrace = newWrapped;
|
|
310
|
+
}
|
|
311
|
+
})) throw localUnexpected();
|
|
312
|
+
} else if (oldPrepareStackTraceDesc) {
|
|
313
|
+
localReflectDefineProperty(LocalError, 'prepareStackTrace', oldPrepareStackTraceDesc);
|
|
314
|
+
} else {
|
|
315
|
+
localReflectDeleteProperty(LocalError, 'prepareStackTrace');
|
|
316
|
+
}
|
|
317
|
+
|
|
318
|
+
/*
|
|
319
|
+
* Exception sanitization
|
|
320
|
+
*/
|
|
321
|
+
|
|
322
|
+
const withProxy = localObjectFreeze({
|
|
323
|
+
__proto__: null,
|
|
324
|
+
has(target, key) {
|
|
325
|
+
if (key === host.INTERNAL_STATE_NAME) return false;
|
|
326
|
+
return localReflectHas(target, key);
|
|
327
|
+
}
|
|
328
|
+
});
|
|
329
|
+
|
|
330
|
+
const interanState = localObjectFreeze({
|
|
331
|
+
__proto__: null,
|
|
332
|
+
wrapWith(x) {
|
|
333
|
+
if (x === null || x === undefined) return x;
|
|
334
|
+
return new LocalProxy(localObject(x), withProxy);
|
|
335
|
+
},
|
|
336
|
+
handleException: ensureThis,
|
|
337
|
+
import(what) {
|
|
338
|
+
throw new VMError('Dynamic Import not supported');
|
|
339
|
+
}
|
|
340
|
+
});
|
|
341
|
+
|
|
342
|
+
if (!localReflectDefineProperty(global, host.INTERNAL_STATE_NAME, {
|
|
343
|
+
__proto__: null,
|
|
344
|
+
configurable: false,
|
|
345
|
+
enumerable: false,
|
|
346
|
+
writable: false,
|
|
347
|
+
value: interanState
|
|
348
|
+
})) throw localUnexpected();
|
|
349
|
+
|
|
350
|
+
/*
|
|
351
|
+
* Eval sanitization
|
|
352
|
+
*/
|
|
353
|
+
|
|
354
|
+
function throwAsync() {
|
|
355
|
+
return new VMError('Async not available');
|
|
356
|
+
}
|
|
357
|
+
|
|
358
|
+
function makeFunction(inputArgs, isAsync, isGenerator) {
|
|
359
|
+
const lastArgs = inputArgs.length - 1;
|
|
360
|
+
let code = lastArgs >= 0 ? `${inputArgs[lastArgs]}` : '';
|
|
361
|
+
let args = lastArgs > 0 ? `${inputArgs[0]}` : '';
|
|
362
|
+
for (let i = 1; i < lastArgs; i++) {
|
|
363
|
+
args += `,${inputArgs[i]}`;
|
|
364
|
+
}
|
|
365
|
+
try {
|
|
366
|
+
code = host.transformAndCheck(args, code, isAsync, isGenerator, allowAsync);
|
|
367
|
+
} catch (e) {
|
|
368
|
+
throw bridge.from(e);
|
|
369
|
+
}
|
|
370
|
+
return localEval(code);
|
|
371
|
+
}
|
|
372
|
+
|
|
373
|
+
const FunctionHandler = {
|
|
374
|
+
__proto__: null,
|
|
375
|
+
apply(target, thiz, args) {
|
|
376
|
+
return makeFunction(args, this.isAsync, this.isGenerator);
|
|
377
|
+
},
|
|
378
|
+
construct(target, args, newTarget) {
|
|
379
|
+
return makeFunction(args, this.isAsync, this.isGenerator);
|
|
380
|
+
}
|
|
381
|
+
};
|
|
382
|
+
|
|
383
|
+
const EvalHandler = {
|
|
384
|
+
__proto__: null,
|
|
385
|
+
apply(target, thiz, args) {
|
|
386
|
+
if (args.length === 0) return undefined;
|
|
387
|
+
let code = `${args[0]}`;
|
|
388
|
+
try {
|
|
389
|
+
code = host.transformAndCheck(null, code, false, false, allowAsync);
|
|
390
|
+
} catch (e) {
|
|
391
|
+
throw bridge.from(e);
|
|
392
|
+
}
|
|
393
|
+
return localEval(code);
|
|
394
|
+
}
|
|
395
|
+
};
|
|
396
|
+
|
|
397
|
+
const AsyncErrorHandler = {
|
|
398
|
+
__proto__: null,
|
|
399
|
+
apply(target, thiz, args) {
|
|
400
|
+
throw throwAsync();
|
|
401
|
+
},
|
|
402
|
+
construct(target, args, newTarget) {
|
|
403
|
+
throw throwAsync();
|
|
404
|
+
}
|
|
405
|
+
};
|
|
406
|
+
|
|
407
|
+
function makeCheckFunction(isAsync, isGenerator) {
|
|
408
|
+
if (isAsync && !allowAsync) return AsyncErrorHandler;
|
|
409
|
+
return {
|
|
410
|
+
__proto__: FunctionHandler,
|
|
411
|
+
isAsync,
|
|
412
|
+
isGenerator
|
|
413
|
+
};
|
|
414
|
+
}
|
|
415
|
+
|
|
416
|
+
function overrideWithProxy(obj, prop, value, handler) {
|
|
417
|
+
const proxy = new LocalProxy(value, handler);
|
|
418
|
+
if (!localReflectDefineProperty(obj, prop, {__proto__: null, value: proxy})) throw localUnexpected();
|
|
419
|
+
return proxy;
|
|
420
|
+
}
|
|
421
|
+
|
|
422
|
+
const proxiedFunction = overrideWithProxy(localFunction.prototype, 'constructor', localFunction, makeCheckFunction(false, false));
|
|
423
|
+
if (GeneratorFunction) {
|
|
424
|
+
if (!localReflectSetPrototypeOf(GeneratorFunction, proxiedFunction)) throw localUnexpected();
|
|
425
|
+
overrideWithProxy(GeneratorFunction.prototype, 'constructor', GeneratorFunction, makeCheckFunction(false, true));
|
|
426
|
+
}
|
|
427
|
+
if (AsyncFunction) {
|
|
428
|
+
if (!localReflectSetPrototypeOf(AsyncFunction, proxiedFunction)) throw localUnexpected();
|
|
429
|
+
overrideWithProxy(AsyncFunction.prototype, 'constructor', AsyncFunction, makeCheckFunction(true, false));
|
|
430
|
+
}
|
|
431
|
+
if (AsyncGeneratorFunction) {
|
|
432
|
+
if (!localReflectSetPrototypeOf(AsyncGeneratorFunction, proxiedFunction)) throw localUnexpected();
|
|
433
|
+
overrideWithProxy(AsyncGeneratorFunction.prototype, 'constructor', AsyncGeneratorFunction, makeCheckFunction(true, true));
|
|
434
|
+
}
|
|
435
|
+
|
|
436
|
+
function makeSafeHandlerArgs(args) {
|
|
437
|
+
const sArgs = ensureThis(args);
|
|
438
|
+
if (sArgs === args) return args;
|
|
439
|
+
const a = [];
|
|
440
|
+
for (let i=0; i < sArgs.length; i++) {
|
|
441
|
+
localReflectDefineProperty(a, i, {
|
|
442
|
+
__proto__: null,
|
|
443
|
+
value: sArgs[i],
|
|
444
|
+
enumerable: true,
|
|
445
|
+
configurable: true,
|
|
446
|
+
writable: true
|
|
447
|
+
});
|
|
448
|
+
}
|
|
449
|
+
return a;
|
|
450
|
+
}
|
|
451
|
+
|
|
452
|
+
const makeSafeArgs = Object.freeze({
|
|
453
|
+
__proto__: null,
|
|
454
|
+
apply(target, thiz, args) {
|
|
455
|
+
return localReflectApply(target, thiz, makeSafeHandlerArgs(args));
|
|
456
|
+
},
|
|
457
|
+
construct(target, args, newTarget) {
|
|
458
|
+
return localReflectConstruct(target, makeSafeHandlerArgs(args), newTarget);
|
|
459
|
+
}
|
|
460
|
+
});
|
|
461
|
+
|
|
462
|
+
const proxyHandlerHandler = Object.freeze({
|
|
463
|
+
__proto__: null,
|
|
464
|
+
get(target, name, receiver) {
|
|
465
|
+
const value = target.handler[name];
|
|
466
|
+
if (typeof value !== 'function') return value;
|
|
467
|
+
return new LocalProxy(value, makeSafeArgs);
|
|
468
|
+
}
|
|
469
|
+
});
|
|
470
|
+
|
|
471
|
+
function wrapProxyHandler(args) {
|
|
472
|
+
if (args.length < 2) return args;
|
|
473
|
+
const handler = args[1];
|
|
474
|
+
args[1] = new LocalProxy({__proto__: null, handler}, proxyHandlerHandler);
|
|
475
|
+
return args;
|
|
476
|
+
}
|
|
477
|
+
|
|
478
|
+
const proxyHandler = Object.freeze({
|
|
479
|
+
__proto__: null,
|
|
480
|
+
apply(target, thiz, args) {
|
|
481
|
+
return localReflectApply(target, thiz, wrapProxyHandler(args));
|
|
482
|
+
},
|
|
483
|
+
construct(target, args, newTarget) {
|
|
484
|
+
return localReflectConstruct(target, wrapProxyHandler(args), newTarget);
|
|
485
|
+
}
|
|
486
|
+
});
|
|
487
|
+
|
|
488
|
+
const proxiedProxy = new LocalProxy(LocalProxy, proxyHandler);
|
|
489
|
+
|
|
490
|
+
overrideWithProxy(LocalProxy, 'revocable', LocalProxy.revocable, proxyHandler);
|
|
491
|
+
|
|
492
|
+
global.Proxy = proxiedProxy;
|
|
493
|
+
global.Function = proxiedFunction;
|
|
494
|
+
global.eval = new LocalProxy(localEval, EvalHandler);
|
|
495
|
+
|
|
496
|
+
/*
|
|
497
|
+
* Promise sanitization
|
|
498
|
+
*/
|
|
499
|
+
|
|
500
|
+
if (localPromise) {
|
|
501
|
+
|
|
502
|
+
const PromisePrototype = localPromise.prototype;
|
|
503
|
+
|
|
504
|
+
if (!allowAsync) {
|
|
505
|
+
|
|
506
|
+
overrideWithProxy(PromisePrototype, 'then', PromisePrototype.then, AsyncErrorHandler);
|
|
507
|
+
// This seems not to work, and will produce
|
|
508
|
+
// UnhandledPromiseRejectionWarning: TypeError: Method Promise.prototype.then called on incompatible receiver [object Object].
|
|
509
|
+
// This is likely caused since the host.Promise.prototype.then cannot use the VM Proxy object.
|
|
510
|
+
// Contextify.connect(host.Promise.prototype.then, Promise.prototype.then);
|
|
511
|
+
|
|
512
|
+
} else {
|
|
513
|
+
|
|
514
|
+
overrideWithProxy(PromisePrototype, 'then', PromisePrototype.then, {
|
|
515
|
+
__proto__: null,
|
|
516
|
+
apply(target, thiz, args) {
|
|
517
|
+
if (args.length > 1) {
|
|
518
|
+
const onRejected = args[1];
|
|
519
|
+
if (typeof onRejected === 'function') {
|
|
520
|
+
args[1] = function wrapper(error) {
|
|
521
|
+
error = ensureThis(error);
|
|
522
|
+
return localReflectApply(onRejected, this, [error]);
|
|
523
|
+
};
|
|
524
|
+
}
|
|
525
|
+
}
|
|
526
|
+
return localReflectApply(target, thiz, args);
|
|
527
|
+
}
|
|
528
|
+
});
|
|
529
|
+
|
|
530
|
+
}
|
|
531
|
+
|
|
532
|
+
}
|
|
533
|
+
|
|
534
|
+
function readonly(other, mock) {
|
|
535
|
+
// Note: other@other(unsafe) mock@other(unsafe) returns@this(unsafe) throws@this(unsafe)
|
|
536
|
+
if (!mock) return fromWithFactory(readonlyFactory, other);
|
|
537
|
+
const tmock = from(mock);
|
|
538
|
+
return fromWithFactory(obj=>new ReadOnlyMockHandler(obj, tmock), other);
|
|
539
|
+
}
|
|
540
|
+
|
|
541
|
+
return {
|
|
542
|
+
__proto__: null,
|
|
543
|
+
readonly,
|
|
544
|
+
global
|
|
545
|
+
};
|
|
Binary file
|