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,20 @@
|
|
|
1
|
+
The MIT License (MIT)
|
|
2
|
+
|
|
3
|
+
Copyright (c) 2014 Ddo
|
|
4
|
+
|
|
5
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy of
|
|
6
|
+
this software and associated documentation files (the "Software"), to deal in
|
|
7
|
+
the Software without restriction, including without limitation the rights to
|
|
8
|
+
use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of
|
|
9
|
+
the Software, and to permit persons to whom the Software is furnished to do so,
|
|
10
|
+
subject to the following conditions:
|
|
11
|
+
|
|
12
|
+
The above copyright notice and this permission notice shall be included in all
|
|
13
|
+
copies or substantial portions of the Software.
|
|
14
|
+
|
|
15
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
16
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS
|
|
17
|
+
FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR
|
|
18
|
+
COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER
|
|
19
|
+
IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
|
|
20
|
+
CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
|
|
2
|
+
test: node_modules .env
|
|
3
|
+
npm test
|
|
4
|
+
|
|
5
|
+
coverage: coverage/lcov.info
|
|
6
|
+
node_modules/.bin/istanbul report text
|
|
7
|
+
|
|
8
|
+
coveralls: coverage/lcov.info
|
|
9
|
+
cat ./coverage/lcov.info | ./node_modules/coveralls/bin/coveralls.js && rm -rf ./coverage
|
|
10
|
+
|
|
11
|
+
.PHONY: test coverage coveralls
|
|
12
|
+
|
|
13
|
+
.env:
|
|
14
|
+
@echo "BITBUCKET_CONSUMER_PUBLIC=" > $@
|
|
15
|
+
@echo "BITBUCKET_CONSUMER_SECRET=" >> $@
|
|
16
|
+
@echo "" >> $@
|
|
17
|
+
@echo "FLICKR_CONSUMER_key=" >> $@
|
|
18
|
+
@echo "FLICKR_CONSUMER_SECRET=" >> $@
|
|
19
|
+
@echo "" >> $@
|
|
20
|
+
@echo "LINKEDIN_CONSUMER_PUBLIC=" >> $@
|
|
21
|
+
@echo "LINKEDIN_CONSUMER_SECRET=" >> $@
|
|
22
|
+
@echo "" >> $@
|
|
23
|
+
@echo "OPENBANK_CONSUMER_PUBLIC=" >> $@
|
|
24
|
+
@echo "OPENBANK_CONSUMER_SECRET=" >> $@
|
|
25
|
+
@echo "" >> $@
|
|
26
|
+
@echo "TWITTER_CONSUMER_PUBLIC=" >> $@
|
|
27
|
+
@echo "TWITTER_CONSUMER_SECRET=" >> $@
|
|
28
|
+
@echo "TWITTER_TOKEN_PUBLIC=" >> $@
|
|
29
|
+
@echo "TWITTER_TOKEN_SECRET=" >> $@
|
|
30
|
+
|
|
31
|
+
coverage/lcov.info: node_modules package.json oauth-1.0a.js .env test/*.js test/**/*.js test/mocha.opts
|
|
32
|
+
node_modules/.bin/istanbul cover ./node_modules/mocha/bin/_mocha --report lcovonly
|
|
33
|
+
|
|
34
|
+
node_modules: package.json
|
|
35
|
+
npm install
|
|
36
|
+
touch node_modules
|
|
@@ -0,0 +1,192 @@
|
|
|
1
|
+
// Type definitions for oauth-1.0a v2.2.3
|
|
2
|
+
// Project: oauth1.0a
|
|
3
|
+
// Definitions by: Ddo <http://ddo.me>
|
|
4
|
+
|
|
5
|
+
export as namespace OAuth;
|
|
6
|
+
export = OAuth;
|
|
7
|
+
|
|
8
|
+
declare class OAuth {
|
|
9
|
+
|
|
10
|
+
body_hash_function: OAuth.BodyHashFunction;
|
|
11
|
+
consumer: OAuth.Consumer;
|
|
12
|
+
hash_function: OAuth.HashFunction;
|
|
13
|
+
last_ampersand: boolean;
|
|
14
|
+
nonce_length: number;
|
|
15
|
+
parameter_seperator: string;
|
|
16
|
+
realm: string;
|
|
17
|
+
signature_metho: string;
|
|
18
|
+
version: string;
|
|
19
|
+
|
|
20
|
+
constructor(opts?: OAuth.Options);
|
|
21
|
+
|
|
22
|
+
/**
|
|
23
|
+
* Sign a request.
|
|
24
|
+
*/
|
|
25
|
+
authorize(request: OAuth.RequestOptions, token?: OAuth.Token): OAuth.Authorization;
|
|
26
|
+
|
|
27
|
+
/**
|
|
28
|
+
* Generate the oauth signature (i.e. oauth_signature).
|
|
29
|
+
*/
|
|
30
|
+
getSignature(request: OAuth.RequestOptions, token_secret: string | undefined, oauth_data: OAuth.Data): string;
|
|
31
|
+
|
|
32
|
+
/**
|
|
33
|
+
* Generate the body signature (i.e. oauth_body_hash).
|
|
34
|
+
*/
|
|
35
|
+
getBodyHash(request: OAuth.RequestOptions, token_secret: string | undefined): string;
|
|
36
|
+
|
|
37
|
+
/**
|
|
38
|
+
* Encode the request attributes.
|
|
39
|
+
*
|
|
40
|
+
* Base String = "<Method>&<Base Url>&<ParameterString>"
|
|
41
|
+
*/
|
|
42
|
+
getBaseString(request: OAuth.RequestOptions, oauth_data: OAuth.Data): string;
|
|
43
|
+
|
|
44
|
+
/**
|
|
45
|
+
* Encode the oauth data and the request parameter,
|
|
46
|
+
*/
|
|
47
|
+
getParameterString(request: OAuth.RequestOptions, oauth_data: OAuth.Data): string;
|
|
48
|
+
|
|
49
|
+
/**
|
|
50
|
+
* Generate the signing key.
|
|
51
|
+
*
|
|
52
|
+
* Key = "<Consumer Key>&<Token Key or an empty string>"
|
|
53
|
+
*/
|
|
54
|
+
getSigningKey(token_secret: string | undefined): string;
|
|
55
|
+
|
|
56
|
+
/**
|
|
57
|
+
* Return the the URL without its querystring.
|
|
58
|
+
*/
|
|
59
|
+
getBaseUrl(url: string): string;
|
|
60
|
+
|
|
61
|
+
/**
|
|
62
|
+
* Parse querystring / form data.
|
|
63
|
+
*/
|
|
64
|
+
deParam(str: string): OAuth.Param;
|
|
65
|
+
|
|
66
|
+
/**
|
|
67
|
+
* Parse querystring from an url
|
|
68
|
+
*/
|
|
69
|
+
deParamUrl(url: string): OAuth.Param;
|
|
70
|
+
|
|
71
|
+
/**
|
|
72
|
+
* Form data encoding.
|
|
73
|
+
*/
|
|
74
|
+
percentEncode(str: string): string;
|
|
75
|
+
|
|
76
|
+
/**
|
|
77
|
+
* Convert OAuth authorization data to an http header.
|
|
78
|
+
*/
|
|
79
|
+
toHeader(data: OAuth.Authorization): OAuth.Header;
|
|
80
|
+
|
|
81
|
+
/**
|
|
82
|
+
* Generate a random nonce.
|
|
83
|
+
*/
|
|
84
|
+
getNonce(): string;
|
|
85
|
+
|
|
86
|
+
/**
|
|
87
|
+
* Generate a current timestamp in second.
|
|
88
|
+
*/
|
|
89
|
+
getTimeStamp(): number;
|
|
90
|
+
|
|
91
|
+
/**
|
|
92
|
+
* Merge two object into a new one.
|
|
93
|
+
*/
|
|
94
|
+
mergeObject<T, U>(obj1: T, obj2: U): T & U;
|
|
95
|
+
|
|
96
|
+
/**
|
|
97
|
+
* Sort an object properties by keys.
|
|
98
|
+
*/
|
|
99
|
+
sortObject<O extends {[k: string]: any}, K extends string>(obj: O): Array<{key: keyof O, value: O[K]}>;
|
|
100
|
+
}
|
|
101
|
+
|
|
102
|
+
declare namespace OAuth {
|
|
103
|
+
|
|
104
|
+
/**
|
|
105
|
+
* OAuth data, including the signature.
|
|
106
|
+
*/
|
|
107
|
+
export interface Authorization extends Data {
|
|
108
|
+
oauth_signature: string;
|
|
109
|
+
}
|
|
110
|
+
|
|
111
|
+
/**
|
|
112
|
+
* Method used to generate the body hash.
|
|
113
|
+
*
|
|
114
|
+
* Note: the key is used for implementation HMAC algorithms for the body hash,
|
|
115
|
+
* but typically it should return SHA1 hash of base_string.
|
|
116
|
+
*/
|
|
117
|
+
export type BodyHashFunction = (base_string: string, key: string) => string;
|
|
118
|
+
|
|
119
|
+
/**
|
|
120
|
+
* OAuth key/secret pair.
|
|
121
|
+
*/
|
|
122
|
+
export interface Consumer {
|
|
123
|
+
key: string;
|
|
124
|
+
secret: string;
|
|
125
|
+
}
|
|
126
|
+
|
|
127
|
+
/**
|
|
128
|
+
* OAuth data, excluding the signature.
|
|
129
|
+
*/
|
|
130
|
+
export interface Data {
|
|
131
|
+
oauth_consumer_key: string;
|
|
132
|
+
oauth_nonce: string;
|
|
133
|
+
oauth_signature_method: string;
|
|
134
|
+
oauth_timestamp: number;
|
|
135
|
+
oauth_version: string;
|
|
136
|
+
oauth_token?: string;
|
|
137
|
+
oauth_body_hash?: string;
|
|
138
|
+
}
|
|
139
|
+
|
|
140
|
+
/**
|
|
141
|
+
* Method used to hash the the OAuth and form/querystring data.
|
|
142
|
+
*/
|
|
143
|
+
export type HashFunction = (base_string: string, key: string) => string;
|
|
144
|
+
|
|
145
|
+
/**
|
|
146
|
+
* Authorization header.
|
|
147
|
+
*/
|
|
148
|
+
export interface Header {
|
|
149
|
+
Authorization: string;
|
|
150
|
+
}
|
|
151
|
+
|
|
152
|
+
/**
|
|
153
|
+
* OAuth options.
|
|
154
|
+
*/
|
|
155
|
+
export interface Options {
|
|
156
|
+
body_hash_function?: BodyHashFunction;
|
|
157
|
+
consumer: Consumer;
|
|
158
|
+
hash_function?: HashFunction;
|
|
159
|
+
last_ampersand?: boolean;
|
|
160
|
+
nonce_length?: number;
|
|
161
|
+
parameter_seperator?: string;
|
|
162
|
+
realm?: string;
|
|
163
|
+
signature_method?: string;
|
|
164
|
+
version?: string;
|
|
165
|
+
}
|
|
166
|
+
|
|
167
|
+
/**
|
|
168
|
+
* Extra data.
|
|
169
|
+
*/
|
|
170
|
+
export interface Param {
|
|
171
|
+
[key: string]: string | string[];
|
|
172
|
+
}
|
|
173
|
+
|
|
174
|
+
/**
|
|
175
|
+
* Request options.
|
|
176
|
+
*/
|
|
177
|
+
export interface RequestOptions {
|
|
178
|
+
url: string;
|
|
179
|
+
method: string;
|
|
180
|
+
data?: any;
|
|
181
|
+
includeBodyHash?: boolean;
|
|
182
|
+
}
|
|
183
|
+
|
|
184
|
+
/**
|
|
185
|
+
* OAuth token key/secret pair.
|
|
186
|
+
*/
|
|
187
|
+
export interface Token {
|
|
188
|
+
key: string;
|
|
189
|
+
secret: string;
|
|
190
|
+
}
|
|
191
|
+
|
|
192
|
+
}
|
|
@@ -0,0 +1,377 @@
|
|
|
1
|
+
if (typeof(module) !== 'undefined' && typeof(exports) !== 'undefined') {
|
|
2
|
+
module.exports = OAuth;
|
|
3
|
+
}
|
|
4
|
+
|
|
5
|
+
/**
|
|
6
|
+
* Constructor
|
|
7
|
+
* @param {Object} opts consumer key and secret
|
|
8
|
+
*/
|
|
9
|
+
function OAuth(opts) {
|
|
10
|
+
if(!(this instanceof OAuth)) {
|
|
11
|
+
return new OAuth(opts);
|
|
12
|
+
}
|
|
13
|
+
|
|
14
|
+
if(!opts) {
|
|
15
|
+
opts = {};
|
|
16
|
+
}
|
|
17
|
+
|
|
18
|
+
if(!opts.consumer) {
|
|
19
|
+
throw new Error('consumer option is required');
|
|
20
|
+
}
|
|
21
|
+
|
|
22
|
+
this.consumer = opts.consumer;
|
|
23
|
+
this.nonce_length = opts.nonce_length || 32;
|
|
24
|
+
this.version = opts.version || '1.0';
|
|
25
|
+
this.parameter_seperator = opts.parameter_seperator || ', ';
|
|
26
|
+
this.realm = opts.realm;
|
|
27
|
+
|
|
28
|
+
if(typeof opts.last_ampersand === 'undefined') {
|
|
29
|
+
this.last_ampersand = true;
|
|
30
|
+
} else {
|
|
31
|
+
this.last_ampersand = opts.last_ampersand;
|
|
32
|
+
}
|
|
33
|
+
|
|
34
|
+
// default signature_method is 'PLAINTEXT'
|
|
35
|
+
this.signature_method = opts.signature_method || 'PLAINTEXT';
|
|
36
|
+
|
|
37
|
+
if(this.signature_method == 'PLAINTEXT' && !opts.hash_function) {
|
|
38
|
+
opts.hash_function = function(base_string, key) {
|
|
39
|
+
return key;
|
|
40
|
+
}
|
|
41
|
+
}
|
|
42
|
+
|
|
43
|
+
if(!opts.hash_function) {
|
|
44
|
+
throw new Error('hash_function option is required');
|
|
45
|
+
}
|
|
46
|
+
|
|
47
|
+
this.hash_function = opts.hash_function;
|
|
48
|
+
this.body_hash_function = opts.body_hash_function || this.hash_function;
|
|
49
|
+
}
|
|
50
|
+
|
|
51
|
+
/**
|
|
52
|
+
* OAuth request authorize
|
|
53
|
+
* @param {Object} request data
|
|
54
|
+
* {
|
|
55
|
+
* method,
|
|
56
|
+
* url,
|
|
57
|
+
* data
|
|
58
|
+
* }
|
|
59
|
+
* @param {Object} key and secret token
|
|
60
|
+
* @return {Object} OAuth Authorized data
|
|
61
|
+
*/
|
|
62
|
+
OAuth.prototype.authorize = function(request, token) {
|
|
63
|
+
var oauth_data = {
|
|
64
|
+
oauth_consumer_key: this.consumer.key,
|
|
65
|
+
oauth_nonce: this.getNonce(),
|
|
66
|
+
oauth_signature_method: this.signature_method,
|
|
67
|
+
oauth_timestamp: this.getTimeStamp(),
|
|
68
|
+
oauth_version: this.version
|
|
69
|
+
};
|
|
70
|
+
|
|
71
|
+
if(!token) {
|
|
72
|
+
token = {};
|
|
73
|
+
}
|
|
74
|
+
|
|
75
|
+
if(token.key !== undefined) {
|
|
76
|
+
oauth_data.oauth_token = token.key;
|
|
77
|
+
}
|
|
78
|
+
|
|
79
|
+
if(!request.data) {
|
|
80
|
+
request.data = {};
|
|
81
|
+
}
|
|
82
|
+
|
|
83
|
+
if(request.includeBodyHash) {
|
|
84
|
+
oauth_data.oauth_body_hash = this.getBodyHash(request, token.secret)
|
|
85
|
+
}
|
|
86
|
+
|
|
87
|
+
oauth_data.oauth_signature = this.getSignature(request, token.secret, oauth_data);
|
|
88
|
+
|
|
89
|
+
return oauth_data;
|
|
90
|
+
};
|
|
91
|
+
|
|
92
|
+
/**
|
|
93
|
+
* Create a OAuth Signature
|
|
94
|
+
* @param {Object} request data
|
|
95
|
+
* @param {Object} token_secret key and secret token
|
|
96
|
+
* @param {Object} oauth_data OAuth data
|
|
97
|
+
* @return {String} Signature
|
|
98
|
+
*/
|
|
99
|
+
OAuth.prototype.getSignature = function(request, token_secret, oauth_data) {
|
|
100
|
+
return this.hash_function(this.getBaseString(request, oauth_data), this.getSigningKey(token_secret));
|
|
101
|
+
};
|
|
102
|
+
|
|
103
|
+
/**
|
|
104
|
+
* Create a OAuth Body Hash
|
|
105
|
+
* @param {Object} request data
|
|
106
|
+
*/
|
|
107
|
+
OAuth.prototype.getBodyHash = function(request, token_secret) {
|
|
108
|
+
var body = typeof request.data === 'string' ? request.data : JSON.stringify(request.data)
|
|
109
|
+
|
|
110
|
+
if (!this.body_hash_function) {
|
|
111
|
+
throw new Error('body_hash_function option is required');
|
|
112
|
+
}
|
|
113
|
+
|
|
114
|
+
return this.body_hash_function(body, this.getSigningKey(token_secret))
|
|
115
|
+
};
|
|
116
|
+
|
|
117
|
+
/**
|
|
118
|
+
* Base String = Method + Base Url + ParameterString
|
|
119
|
+
* @param {Object} request data
|
|
120
|
+
* @param {Object} OAuth data
|
|
121
|
+
* @return {String} Base String
|
|
122
|
+
*/
|
|
123
|
+
OAuth.prototype.getBaseString = function(request, oauth_data) {
|
|
124
|
+
return request.method.toUpperCase() + '&' + this.percentEncode(this.getBaseUrl(request.url)) + '&' + this.percentEncode(this.getParameterString(request, oauth_data));
|
|
125
|
+
};
|
|
126
|
+
|
|
127
|
+
/**
|
|
128
|
+
* Get data from url
|
|
129
|
+
* -> merge with oauth data
|
|
130
|
+
* -> percent encode key & value
|
|
131
|
+
* -> sort
|
|
132
|
+
*
|
|
133
|
+
* @param {Object} request data
|
|
134
|
+
* @param {Object} OAuth data
|
|
135
|
+
* @return {Object} Parameter string data
|
|
136
|
+
*/
|
|
137
|
+
OAuth.prototype.getParameterString = function(request, oauth_data) {
|
|
138
|
+
var base_string_data;
|
|
139
|
+
if (oauth_data.oauth_body_hash) {
|
|
140
|
+
base_string_data = this.sortObject(this.percentEncodeData(this.mergeObject(oauth_data, this.deParamUrl(request.url))));
|
|
141
|
+
} else {
|
|
142
|
+
base_string_data = this.sortObject(this.percentEncodeData(this.mergeObject(oauth_data, this.mergeObject(request.data, this.deParamUrl(request.url)))));
|
|
143
|
+
}
|
|
144
|
+
|
|
145
|
+
var data_str = '';
|
|
146
|
+
|
|
147
|
+
//base_string_data to string
|
|
148
|
+
for(var i = 0; i < base_string_data.length; i++) {
|
|
149
|
+
var key = base_string_data[i].key;
|
|
150
|
+
var value = base_string_data[i].value;
|
|
151
|
+
// check if the value is an array
|
|
152
|
+
// this means that this key has multiple values
|
|
153
|
+
if (value && Array.isArray(value)){
|
|
154
|
+
// sort the array first
|
|
155
|
+
value.sort();
|
|
156
|
+
|
|
157
|
+
var valString = "";
|
|
158
|
+
// serialize all values for this key: e.g. formkey=formvalue1&formkey=formvalue2
|
|
159
|
+
value.forEach((function(item, i){
|
|
160
|
+
valString += key + '=' + item;
|
|
161
|
+
if (i < value.length){
|
|
162
|
+
valString += "&";
|
|
163
|
+
}
|
|
164
|
+
}).bind(this));
|
|
165
|
+
data_str += valString;
|
|
166
|
+
} else {
|
|
167
|
+
data_str += key + '=' + value + '&';
|
|
168
|
+
}
|
|
169
|
+
}
|
|
170
|
+
|
|
171
|
+
//remove the last character
|
|
172
|
+
data_str = data_str.substr(0, data_str.length - 1);
|
|
173
|
+
return data_str;
|
|
174
|
+
};
|
|
175
|
+
|
|
176
|
+
/**
|
|
177
|
+
* Create a Signing Key
|
|
178
|
+
* @param {String} token_secret Secret Token
|
|
179
|
+
* @return {String} Signing Key
|
|
180
|
+
*/
|
|
181
|
+
OAuth.prototype.getSigningKey = function(token_secret) {
|
|
182
|
+
token_secret = token_secret || '';
|
|
183
|
+
|
|
184
|
+
if(!this.last_ampersand && !token_secret) {
|
|
185
|
+
return this.percentEncode(this.consumer.secret);
|
|
186
|
+
}
|
|
187
|
+
|
|
188
|
+
return this.percentEncode(this.consumer.secret) + '&' + this.percentEncode(token_secret);
|
|
189
|
+
};
|
|
190
|
+
|
|
191
|
+
/**
|
|
192
|
+
* Get base url
|
|
193
|
+
* @param {String} url
|
|
194
|
+
* @return {String}
|
|
195
|
+
*/
|
|
196
|
+
OAuth.prototype.getBaseUrl = function(url) {
|
|
197
|
+
return url.split('?')[0];
|
|
198
|
+
};
|
|
199
|
+
|
|
200
|
+
/**
|
|
201
|
+
* Get data from String
|
|
202
|
+
* @param {String} string
|
|
203
|
+
* @return {Object}
|
|
204
|
+
*/
|
|
205
|
+
OAuth.prototype.deParam = function(string) {
|
|
206
|
+
var arr = string.split('&');
|
|
207
|
+
var data = {};
|
|
208
|
+
|
|
209
|
+
for(var i = 0; i < arr.length; i++) {
|
|
210
|
+
var item = arr[i].split('=');
|
|
211
|
+
|
|
212
|
+
// '' value
|
|
213
|
+
item[1] = item[1] || '';
|
|
214
|
+
|
|
215
|
+
// check if the key already exists
|
|
216
|
+
// this can occur if the QS part of the url contains duplicate keys like this: ?formkey=formvalue1&formkey=formvalue2
|
|
217
|
+
if (data[item[0]]){
|
|
218
|
+
// the key exists already
|
|
219
|
+
if (!Array.isArray(data[item[0]])) {
|
|
220
|
+
// replace the value with an array containing the already present value
|
|
221
|
+
data[item[0]] = [data[item[0]]];
|
|
222
|
+
}
|
|
223
|
+
// and add the new found value to it
|
|
224
|
+
data[item[0]].push(decodeURIComponent(item[1]));
|
|
225
|
+
} else {
|
|
226
|
+
// it doesn't exist, just put the found value in the data object
|
|
227
|
+
data[item[0]] = decodeURIComponent(item[1]);
|
|
228
|
+
}
|
|
229
|
+
}
|
|
230
|
+
|
|
231
|
+
return data;
|
|
232
|
+
};
|
|
233
|
+
|
|
234
|
+
/**
|
|
235
|
+
* Get data from url
|
|
236
|
+
* @param {String} url
|
|
237
|
+
* @return {Object}
|
|
238
|
+
*/
|
|
239
|
+
OAuth.prototype.deParamUrl = function(url) {
|
|
240
|
+
var tmp = url.split('?');
|
|
241
|
+
|
|
242
|
+
if (tmp.length === 1)
|
|
243
|
+
return {};
|
|
244
|
+
|
|
245
|
+
return this.deParam(tmp[1]);
|
|
246
|
+
};
|
|
247
|
+
|
|
248
|
+
/**
|
|
249
|
+
* Percent Encode
|
|
250
|
+
* @param {String} str
|
|
251
|
+
* @return {String} percent encoded string
|
|
252
|
+
*/
|
|
253
|
+
OAuth.prototype.percentEncode = function(str) {
|
|
254
|
+
return encodeURIComponent(str)
|
|
255
|
+
.replace(/\!/g, "%21")
|
|
256
|
+
.replace(/\*/g, "%2A")
|
|
257
|
+
.replace(/\'/g, "%27")
|
|
258
|
+
.replace(/\(/g, "%28")
|
|
259
|
+
.replace(/\)/g, "%29");
|
|
260
|
+
};
|
|
261
|
+
|
|
262
|
+
/**
|
|
263
|
+
* Percent Encode Object
|
|
264
|
+
* @param {Object} data
|
|
265
|
+
* @return {Object} percent encoded data
|
|
266
|
+
*/
|
|
267
|
+
OAuth.prototype.percentEncodeData = function(data) {
|
|
268
|
+
var result = {};
|
|
269
|
+
|
|
270
|
+
for(var key in data) {
|
|
271
|
+
var value = data[key];
|
|
272
|
+
// check if the value is an array
|
|
273
|
+
if (value && Array.isArray(value)){
|
|
274
|
+
var newValue = [];
|
|
275
|
+
// percentEncode every value
|
|
276
|
+
value.forEach((function(val){
|
|
277
|
+
newValue.push(this.percentEncode(val));
|
|
278
|
+
}).bind(this));
|
|
279
|
+
value = newValue;
|
|
280
|
+
} else {
|
|
281
|
+
value = this.percentEncode(value);
|
|
282
|
+
}
|
|
283
|
+
result[this.percentEncode(key)] = value;
|
|
284
|
+
}
|
|
285
|
+
|
|
286
|
+
return result;
|
|
287
|
+
};
|
|
288
|
+
|
|
289
|
+
/**
|
|
290
|
+
* Get OAuth data as Header
|
|
291
|
+
* @param {Object} oauth_data
|
|
292
|
+
* @return {String} Header data key - value
|
|
293
|
+
*/
|
|
294
|
+
OAuth.prototype.toHeader = function(oauth_data) {
|
|
295
|
+
var sorted = this.sortObject(oauth_data);
|
|
296
|
+
|
|
297
|
+
var header_value = 'OAuth ';
|
|
298
|
+
|
|
299
|
+
if (this.realm) {
|
|
300
|
+
header_value += 'realm="' + this.realm + '"' + this.parameter_seperator;
|
|
301
|
+
}
|
|
302
|
+
|
|
303
|
+
for(var i = 0; i < sorted.length; i++) {
|
|
304
|
+
if (sorted[i].key.indexOf('oauth_') !== 0)
|
|
305
|
+
continue;
|
|
306
|
+
|
|
307
|
+
header_value += this.percentEncode(sorted[i].key) + '="' + this.percentEncode(sorted[i].value) + '"' + this.parameter_seperator;
|
|
308
|
+
}
|
|
309
|
+
|
|
310
|
+
return {
|
|
311
|
+
Authorization: header_value.substr(0, header_value.length - this.parameter_seperator.length) //cut the last chars
|
|
312
|
+
};
|
|
313
|
+
};
|
|
314
|
+
|
|
315
|
+
/**
|
|
316
|
+
* Create a random word characters string with input length
|
|
317
|
+
* @return {String} a random word characters string
|
|
318
|
+
*/
|
|
319
|
+
OAuth.prototype.getNonce = function() {
|
|
320
|
+
var word_characters = 'abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789';
|
|
321
|
+
var result = '';
|
|
322
|
+
|
|
323
|
+
for(var i = 0; i < this.nonce_length; i++) {
|
|
324
|
+
result += word_characters[parseInt(Math.random() * word_characters.length, 10)];
|
|
325
|
+
}
|
|
326
|
+
|
|
327
|
+
return result;
|
|
328
|
+
};
|
|
329
|
+
|
|
330
|
+
/**
|
|
331
|
+
* Get Current Unix TimeStamp
|
|
332
|
+
* @return {Int} current unix timestamp
|
|
333
|
+
*/
|
|
334
|
+
OAuth.prototype.getTimeStamp = function() {
|
|
335
|
+
return parseInt(new Date().getTime()/1000, 10);
|
|
336
|
+
};
|
|
337
|
+
|
|
338
|
+
////////////////////// HELPER FUNCTIONS //////////////////////
|
|
339
|
+
|
|
340
|
+
/**
|
|
341
|
+
* Merge object
|
|
342
|
+
* @param {Object} obj1
|
|
343
|
+
* @param {Object} obj2
|
|
344
|
+
* @return {Object}
|
|
345
|
+
*/
|
|
346
|
+
OAuth.prototype.mergeObject = function(obj1, obj2) {
|
|
347
|
+
obj1 = obj1 || {};
|
|
348
|
+
obj2 = obj2 || {};
|
|
349
|
+
|
|
350
|
+
var merged_obj = obj1;
|
|
351
|
+
for(var key in obj2) {
|
|
352
|
+
merged_obj[key] = obj2[key];
|
|
353
|
+
}
|
|
354
|
+
return merged_obj;
|
|
355
|
+
};
|
|
356
|
+
|
|
357
|
+
/**
|
|
358
|
+
* Sort object by key
|
|
359
|
+
* @param {Object} data
|
|
360
|
+
* @return {Array} sorted array
|
|
361
|
+
*/
|
|
362
|
+
OAuth.prototype.sortObject = function(data) {
|
|
363
|
+
var keys = Object.keys(data);
|
|
364
|
+
var result = [];
|
|
365
|
+
|
|
366
|
+
keys.sort();
|
|
367
|
+
|
|
368
|
+
for(var i = 0; i < keys.length; i++) {
|
|
369
|
+
var key = keys[i];
|
|
370
|
+
result.push({
|
|
371
|
+
key: key,
|
|
372
|
+
value: data[key],
|
|
373
|
+
});
|
|
374
|
+
}
|
|
375
|
+
|
|
376
|
+
return result;
|
|
377
|
+
};
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "oauth-1.0a",
|
|
3
|
+
"version": "2.2.6",
|
|
4
|
+
"description": "OAuth 1.0a Request Authorization for Node and Browser.",
|
|
5
|
+
"scripts": {
|
|
6
|
+
"test": "mocha"
|
|
7
|
+
},
|
|
8
|
+
"main": "oauth-1.0a.js",
|
|
9
|
+
"types": "oauth-1.0a.d.ts",
|
|
10
|
+
"repository": "https://github.com/ddo/oauth-1.0a.git",
|
|
11
|
+
"keywords": [
|
|
12
|
+
"oauth",
|
|
13
|
+
"1.0a",
|
|
14
|
+
"oauth1.0a",
|
|
15
|
+
"authorize",
|
|
16
|
+
"signature",
|
|
17
|
+
"nonce",
|
|
18
|
+
"consumer"
|
|
19
|
+
],
|
|
20
|
+
"author": "Ddo",
|
|
21
|
+
"license": "MIT",
|
|
22
|
+
"devDependencies": {
|
|
23
|
+
"chai": "^4.1.2",
|
|
24
|
+
"coveralls": "^3.0.3",
|
|
25
|
+
"dotenv": "^8.0.0",
|
|
26
|
+
"istanbul": "^0.4.5",
|
|
27
|
+
"mocha": "^6.1.4",
|
|
28
|
+
"request": "^2.88.0"
|
|
29
|
+
}
|
|
30
|
+
}
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
var expect = require('chai').expect;
|
|
2
|
+
var OAuth = require('../oauth-1.0a');
|
|
3
|
+
var crypto = require('crypto');
|
|
4
|
+
|
|
5
|
+
describe("#getParameterString", function() {
|
|
6
|
+
var oauth = new OAuth({
|
|
7
|
+
consumer: {},
|
|
8
|
+
});
|
|
9
|
+
|
|
10
|
+
var request = {
|
|
11
|
+
url: 'https://api.twitter.com/1/statuses/update.json?&',
|
|
12
|
+
};
|
|
13
|
+
|
|
14
|
+
var oauth_data = {};
|
|
15
|
+
|
|
16
|
+
describe("#getParameterStringEmptyGetParam", function() {
|
|
17
|
+
it("should be equal to Twitter example", function() {
|
|
18
|
+
expect(oauth.getParameterString(request, oauth_data)).to.equal('=');
|
|
19
|
+
});
|
|
20
|
+
});
|
|
21
|
+
});
|