@zuplo/cli 6.69.4 → 6.69.6
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/dist/__tests__/integration/custom-domain.integration.test.js +4 -4
- package/dist/__tests__/integration/custom-domain.integration.test.js.map +1 -1
- package/dist/__tests__/integration/jest-mocks-setup.js +30 -10
- package/dist/__tests__/integration/jest-mocks-setup.js.map +1 -1
- package/dist/__tests__/integration/list.integration.test.js +2 -2
- package/dist/__tests__/integration/list.integration.test.js.map +1 -1
- package/dist/__tests__/integration/tunnel.integration.test.js +14 -14
- package/dist/__tests__/integration/tunnel.integration.test.js.map +1 -1
- package/dist/__tests__/integration/variable.integration.test.js +4 -4
- package/dist/__tests__/integration/variable.integration.test.js.map +1 -1
- package/dist/__tests__/integration/whoami.integration.test.js +2 -5
- package/dist/__tests__/integration/whoami.integration.test.js.map +1 -1
- package/dist/cli.js +12 -6
- package/dist/cli.js.map +1 -1
- package/dist/cmds/custom-domain/index.d.ts.map +1 -1
- package/dist/cmds/custom-domain/index.js +6 -10
- package/dist/cmds/custom-domain/index.js.map +1 -1
- package/dist/cmds/mtls-certificates/index.d.ts.map +1 -1
- package/dist/cmds/mtls-certificates/index.js +8 -12
- package/dist/cmds/mtls-certificates/index.js.map +1 -1
- package/dist/cmds/open-api/index.d.ts.map +1 -1
- package/dist/cmds/open-api/index.js +2 -5
- package/dist/cmds/open-api/index.js.map +1 -1
- package/dist/cmds/project/index.d.ts.map +1 -1
- package/dist/cmds/project/index.js +2 -5
- package/dist/cmds/project/index.js.map +1 -1
- package/dist/cmds/proxies/index.d.ts +4 -4
- package/dist/cmds/proxies/index.d.ts.map +1 -1
- package/dist/cmds/proxies/index.js +6 -10
- package/dist/cmds/proxies/index.js.map +1 -1
- package/dist/cmds/source/index.d.ts.map +1 -1
- package/dist/cmds/source/index.js +2 -9
- package/dist/cmds/source/index.js.map +1 -1
- package/dist/cmds/source/migrate.d.ts +4 -4
- package/dist/cmds/source/migrate.d.ts.map +1 -1
- package/dist/cmds/source/migrate.js +3 -6
- package/dist/cmds/source/migrate.js.map +1 -1
- package/dist/cmds/tunnel/index.d.ts.map +1 -1
- package/dist/cmds/tunnel/index.js +8 -12
- package/dist/cmds/tunnel/index.js.map +1 -1
- package/dist/cmds/tunnel/services/index.d.ts.map +1 -1
- package/dist/cmds/tunnel/services/index.js +2 -5
- package/dist/cmds/tunnel/services/index.js.map +1 -1
- package/dist/cmds/variable/index.d.ts.map +1 -1
- package/dist/cmds/variable/index.js +2 -5
- package/dist/cmds/variable/index.js.map +1 -1
- package/dist/common/api/client.d.ts +40 -0
- package/dist/common/api/client.d.ts.map +1 -0
- package/dist/common/api/client.js +92 -0
- package/dist/common/api/client.js.map +1 -0
- package/dist/common/handler.d.ts +4 -1
- package/dist/common/handler.d.ts.map +1 -1
- package/dist/common/handler.js +11 -2
- package/dist/common/handler.js.map +1 -1
- package/dist/common/middleware/get-environment-param.d.ts.map +1 -1
- package/dist/common/middleware/get-environment-param.js +2 -18
- package/dist/common/middleware/get-environment-param.js.map +1 -1
- package/dist/common/output.d.ts +4 -0
- package/dist/common/output.d.ts.map +1 -1
- package/dist/common/output.js +4 -1
- package/dist/common/output.js.map +1 -1
- package/dist/common/utils/build-environment-prompt-choices.d.ts +13 -0
- package/dist/common/utils/build-environment-prompt-choices.d.ts.map +1 -0
- package/dist/common/utils/build-environment-prompt-choices.js +66 -0
- package/dist/common/utils/build-environment-prompt-choices.js.map +1 -0
- package/dist/common/utils/build-environment-prompt-choices.test.d.ts +2 -0
- package/dist/common/utils/build-environment-prompt-choices.test.d.ts.map +1 -0
- package/dist/common/utils/build-environment-prompt-choices.test.js +97 -0
- package/dist/common/utils/build-environment-prompt-choices.test.js.map +1 -0
- package/dist/common/utils/pretty-print-environment-prompt.d.ts +1 -4
- package/dist/common/utils/pretty-print-environment-prompt.d.ts.map +1 -1
- package/dist/common/utils/pretty-print-environment-prompt.js +3 -8
- package/dist/common/utils/pretty-print-environment-prompt.js.map +1 -1
- package/dist/common/utils/pretty-print-environment-prompt.test.js +15 -17
- package/dist/common/utils/pretty-print-environment-prompt.test.js.map +1 -1
- package/dist/common/utils/sort-environments-for-prompt.d.ts +5 -0
- package/dist/common/utils/sort-environments-for-prompt.d.ts.map +1 -0
- package/dist/common/utils/sort-environments-for-prompt.js +27 -0
- package/dist/common/utils/sort-environments-for-prompt.js.map +1 -0
- package/dist/common/utils/sort-environments-for-prompt.test.d.ts +2 -0
- package/dist/common/utils/sort-environments-for-prompt.test.d.ts.map +1 -0
- package/dist/common/utils/sort-environments-for-prompt.test.js +82 -0
- package/dist/common/utils/sort-environments-for-prompt.test.js.map +1 -0
- package/dist/custom-domain/create/handler.d.ts.map +1 -1
- package/dist/custom-domain/create/handler.js +12 -27
- package/dist/custom-domain/create/handler.js.map +1 -1
- package/dist/custom-domain/delete/handler.d.ts.map +1 -1
- package/dist/custom-domain/delete/handler.js +25 -54
- package/dist/custom-domain/delete/handler.js.map +1 -1
- package/dist/custom-domain/list/handler.d.ts.map +1 -1
- package/dist/custom-domain/list/handler.js +15 -29
- package/dist/custom-domain/list/handler.js.map +1 -1
- package/dist/custom-domain/update/handler.d.ts.map +1 -1
- package/dist/custom-domain/update/handler.js +12 -27
- package/dist/custom-domain/update/handler.js.map +1 -1
- package/dist/list/handler.d.ts.map +1 -1
- package/dist/list/handler.js +41 -59
- package/dist/list/handler.js.map +1 -1
- package/dist/mtls-certificates/create/handler.d.ts.map +1 -1
- package/dist/mtls-certificates/create/handler.js +9 -23
- package/dist/mtls-certificates/create/handler.js.map +1 -1
- package/dist/mtls-certificates/delete/handler.d.ts.map +1 -1
- package/dist/mtls-certificates/delete/handler.js +8 -20
- package/dist/mtls-certificates/delete/handler.js.map +1 -1
- package/dist/mtls-certificates/describe/handler.d.ts.map +1 -1
- package/dist/mtls-certificates/describe/handler.js +17 -31
- package/dist/mtls-certificates/describe/handler.js.map +1 -1
- package/dist/mtls-certificates/disable/handler.d.ts.map +1 -1
- package/dist/mtls-certificates/disable/handler.js +9 -26
- package/dist/mtls-certificates/disable/handler.js.map +1 -1
- package/dist/mtls-certificates/list/handler.d.ts.map +1 -1
- package/dist/mtls-certificates/list/handler.js +22 -36
- package/dist/mtls-certificates/list/handler.js.map +1 -1
- package/dist/mtls-certificates/update/handler.d.ts.map +1 -1
- package/dist/mtls-certificates/update/handler.js +14 -29
- package/dist/mtls-certificates/update/handler.js.map +1 -1
- package/dist/proxies/create/handler.d.ts.map +1 -1
- package/dist/proxies/create/handler.js +9 -22
- package/dist/proxies/create/handler.js.map +1 -1
- package/dist/proxies/delete/handler.d.ts.map +1 -1
- package/dist/proxies/delete/handler.js +8 -21
- package/dist/proxies/delete/handler.js.map +1 -1
- package/dist/proxies/describe/handler.d.ts.map +1 -1
- package/dist/proxies/describe/handler.js +7 -22
- package/dist/proxies/describe/handler.js.map +1 -1
- package/dist/proxies/update/handler.d.ts.map +1 -1
- package/dist/proxies/update/handler.js +9 -22
- package/dist/proxies/update/handler.js.map +1 -1
- package/dist/tsconfig.tsbuildinfo +1 -1
- package/dist/tunnel/create/handler.d.ts.map +1 -1
- package/dist/tunnel/create/handler.js +8 -22
- package/dist/tunnel/create/handler.js.map +1 -1
- package/dist/tunnel/delete/handler.d.ts.map +1 -1
- package/dist/tunnel/delete/handler.js +16 -30
- package/dist/tunnel/delete/handler.js.map +1 -1
- package/dist/tunnel/describe/handler.d.ts.map +1 -1
- package/dist/tunnel/describe/handler.js +7 -21
- package/dist/tunnel/describe/handler.js.map +1 -1
- package/dist/tunnel/list/handler.d.ts.map +1 -1
- package/dist/tunnel/list/handler.js +13 -28
- package/dist/tunnel/list/handler.js.map +1 -1
- package/dist/tunnel/rotate-token/handler.d.ts.map +1 -1
- package/dist/tunnel/rotate-token/handler.js +7 -21
- package/dist/tunnel/rotate-token/handler.js.map +1 -1
- package/dist/tunnel/services/describe/handler.d.ts.map +1 -1
- package/dist/tunnel/services/describe/handler.js +7 -21
- package/dist/tunnel/services/describe/handler.js.map +1 -1
- package/dist/tunnel/services/update/handler.d.ts.map +1 -1
- package/dist/tunnel/services/update/handler.js +18 -32
- package/dist/tunnel/services/update/handler.js.map +1 -1
- package/dist/variable/create/handler.d.ts.map +1 -1
- package/dist/variable/create/handler.js +9 -24
- package/dist/variable/create/handler.js.map +1 -1
- package/dist/variable/update/handler.d.ts.map +1 -1
- package/dist/variable/update/handler.js +9 -24
- package/dist/variable/update/handler.js.map +1 -1
- package/dist/whoami/handler.d.ts.map +1 -1
- package/dist/whoami/handler.js +6 -18
- package/dist/whoami/handler.js.map +1 -1
- package/node_modules/@fastify/proxy-addr/node_modules/ipaddr.js/README.md +1 -5
- package/node_modules/@fastify/proxy-addr/node_modules/ipaddr.js/ipaddr.min.js +1 -1
- package/node_modules/@fastify/proxy-addr/node_modules/ipaddr.js/lib/ipaddr.js +21 -6
- package/node_modules/@fastify/proxy-addr/node_modules/ipaddr.js/package.json +1 -1
- package/node_modules/@zuplo/core/index.minified.js +141 -137
- package/node_modules/@zuplo/core/package.json +1 -1
- package/node_modules/@zuplo/editor/node_modules/fast-json-stringify/.github/workflows/ci.yml +1 -1
- package/node_modules/@zuplo/editor/node_modules/fast-json-stringify/.github/workflows/lock-threads.yml +19 -0
- package/node_modules/@zuplo/editor/node_modules/fast-json-stringify/LICENSE +1 -3
- package/node_modules/@zuplo/editor/node_modules/fast-json-stringify/benchmark/bench-cmp-lib.js +60 -44
- package/node_modules/@zuplo/editor/node_modules/fast-json-stringify/index.js +2 -2
- package/node_modules/@zuplo/editor/node_modules/fast-json-stringify/package.json +7 -7
- package/node_modules/@zuplo/editor/node_modules/fast-json-stringify/test/anyof.test.js +20 -0
- package/node_modules/@zuplo/editor/node_modules/fast-json-stringify/test/array.test.js +22 -0
- package/node_modules/@zuplo/editor/node_modules/fast-json-stringify/test/debug-mode.test.js +21 -0
- package/node_modules/@zuplo/editor/node_modules/fast-json-stringify/test/if-then-else.test.js +72 -0
- package/node_modules/@zuplo/editor/node_modules/fast-json-stringify/test/invalidSchema.test.js +20 -0
- package/node_modules/@zuplo/editor/node_modules/fast-json-stringify/test/issue-836.test.js +183 -0
- package/node_modules/@zuplo/editor/node_modules/fast-json-stringify/test/json-add-comma.test.js +57 -57
- package/node_modules/@zuplo/editor/node_modules/fast-json-stringify/test/oneof.test.js +20 -0
- package/node_modules/@zuplo/editor/node_modules/fast-json-stringify/test/ref.test.js +31 -0
- package/node_modules/@zuplo/editor/node_modules/fast-json-stringify/test/typebox.test.js +1 -1
- package/node_modules/@zuplo/editor/node_modules/fast-json-stringify/types/{index.test-d.ts → index.tst.ts} +17 -17
- package/node_modules/@zuplo/editor/node_modules/lru-cache/dist/commonjs/browser/diagnostics-channel-browser.d.ts.map +1 -0
- package/node_modules/@zuplo/editor/node_modules/lru-cache/dist/commonjs/browser/diagnostics-channel-browser.js.map +1 -0
- package/node_modules/@zuplo/editor/node_modules/lru-cache/dist/commonjs/browser/diagnostics-channel.d.ts +5 -0
- package/node_modules/@zuplo/editor/node_modules/lru-cache/dist/commonjs/browser/diagnostics-channel.js +7 -0
- package/node_modules/@zuplo/editor/node_modules/lru-cache/dist/commonjs/browser/index.d.ts +1380 -0
- package/node_modules/@zuplo/editor/node_modules/lru-cache/dist/commonjs/browser/index.d.ts.map +1 -0
- package/node_modules/@zuplo/editor/node_modules/lru-cache/dist/commonjs/browser/index.js +1686 -0
- package/node_modules/@zuplo/editor/node_modules/lru-cache/dist/commonjs/browser/index.js.map +1 -0
- package/node_modules/@zuplo/editor/node_modules/lru-cache/dist/commonjs/browser/index.min.js +2 -0
- package/node_modules/@zuplo/editor/node_modules/lru-cache/dist/commonjs/browser/index.min.js.map +7 -0
- package/node_modules/@zuplo/editor/node_modules/lru-cache/dist/commonjs/browser/perf.d.ts +12 -0
- package/node_modules/@zuplo/editor/node_modules/lru-cache/dist/commonjs/browser/perf.d.ts.map +1 -0
- package/node_modules/@zuplo/editor/node_modules/lru-cache/dist/commonjs/browser/perf.js +11 -0
- package/node_modules/@zuplo/editor/node_modules/lru-cache/dist/commonjs/browser/perf.js.map +1 -0
- package/node_modules/@zuplo/editor/node_modules/lru-cache/dist/commonjs/diagnostics-channel-cjs.cjs.map +1 -0
- package/node_modules/@zuplo/editor/node_modules/lru-cache/dist/commonjs/diagnostics-channel-cjs.d.cts.map +1 -0
- package/node_modules/@zuplo/editor/node_modules/lru-cache/dist/commonjs/diagnostics-channel.d.ts +2 -2
- package/node_modules/@zuplo/editor/node_modules/lru-cache/dist/commonjs/diagnostics-channel.js +4 -7
- package/node_modules/@zuplo/editor/node_modules/lru-cache/dist/commonjs/index.d.ts +2 -3
- package/node_modules/@zuplo/editor/node_modules/lru-cache/dist/commonjs/index.d.ts.map +1 -1
- package/node_modules/@zuplo/editor/node_modules/lru-cache/dist/commonjs/index.js +10 -16
- package/node_modules/@zuplo/editor/node_modules/lru-cache/dist/commonjs/index.js.map +1 -1
- package/node_modules/@zuplo/editor/node_modules/lru-cache/dist/commonjs/index.min.js +1 -1
- package/node_modules/@zuplo/editor/node_modules/lru-cache/dist/commonjs/index.min.js.map +4 -4
- package/node_modules/@zuplo/editor/node_modules/lru-cache/dist/commonjs/node/diagnostics-channel-node.d.ts.map +1 -0
- package/node_modules/@zuplo/editor/node_modules/lru-cache/dist/commonjs/node/diagnostics-channel-node.js.map +1 -0
- package/node_modules/@zuplo/editor/node_modules/lru-cache/dist/commonjs/node/diagnostics-channel.d.ts +5 -0
- package/node_modules/@zuplo/editor/node_modules/lru-cache/dist/commonjs/node/diagnostics-channel.js +9 -0
- package/node_modules/@zuplo/editor/node_modules/lru-cache/dist/commonjs/node/index.d.ts +1380 -0
- package/node_modules/@zuplo/editor/node_modules/lru-cache/dist/commonjs/node/index.d.ts.map +1 -0
- package/node_modules/@zuplo/editor/node_modules/lru-cache/dist/commonjs/node/index.js +1686 -0
- package/node_modules/@zuplo/editor/node_modules/lru-cache/dist/commonjs/node/index.js.map +1 -0
- package/node_modules/@zuplo/editor/node_modules/lru-cache/dist/commonjs/node/index.min.js +2 -0
- package/node_modules/@zuplo/editor/node_modules/lru-cache/dist/commonjs/node/index.min.js.map +7 -0
- package/node_modules/@zuplo/editor/node_modules/lru-cache/dist/commonjs/node/perf.d.ts +12 -0
- package/node_modules/@zuplo/editor/node_modules/lru-cache/dist/commonjs/node/perf.d.ts.map +1 -0
- package/node_modules/@zuplo/editor/node_modules/lru-cache/dist/commonjs/node/perf.js +11 -0
- package/node_modules/@zuplo/editor/node_modules/lru-cache/dist/commonjs/node/perf.js.map +1 -0
- package/node_modules/@zuplo/editor/node_modules/lru-cache/dist/commonjs/perf.d.ts +12 -0
- package/node_modules/@zuplo/editor/node_modules/lru-cache/dist/commonjs/perf.d.ts.map +1 -0
- package/node_modules/@zuplo/editor/node_modules/lru-cache/dist/commonjs/perf.js +11 -0
- package/node_modules/@zuplo/editor/node_modules/lru-cache/dist/commonjs/perf.js.map +1 -0
- package/node_modules/@zuplo/editor/node_modules/lru-cache/dist/esm/browser/diagnostics-channel-browser.d.ts.map +1 -0
- package/node_modules/@zuplo/editor/node_modules/lru-cache/dist/esm/browser/diagnostics-channel-browser.js.map +1 -0
- package/node_modules/@zuplo/editor/node_modules/lru-cache/dist/esm/browser/diagnostics-channel.d.ts +1 -1
- package/node_modules/@zuplo/editor/node_modules/lru-cache/dist/esm/browser/diagnostics-channel.js +1 -1
- package/node_modules/@zuplo/editor/node_modules/lru-cache/dist/esm/browser/index.d.ts +2 -3
- package/node_modules/@zuplo/editor/node_modules/lru-cache/dist/esm/browser/index.d.ts.map +1 -1
- package/node_modules/@zuplo/editor/node_modules/lru-cache/dist/esm/browser/index.js +9 -15
- package/node_modules/@zuplo/editor/node_modules/lru-cache/dist/esm/browser/index.js.map +1 -1
- package/node_modules/@zuplo/editor/node_modules/lru-cache/dist/esm/browser/index.min.js +1 -1
- package/node_modules/@zuplo/editor/node_modules/lru-cache/dist/esm/browser/index.min.js.map +4 -4
- package/node_modules/@zuplo/editor/node_modules/lru-cache/dist/esm/browser/perf.d.ts +12 -0
- package/node_modules/@zuplo/editor/node_modules/lru-cache/dist/esm/browser/perf.d.ts.map +1 -0
- package/node_modules/@zuplo/editor/node_modules/lru-cache/dist/esm/browser/perf.js +8 -0
- package/node_modules/@zuplo/editor/node_modules/lru-cache/dist/esm/browser/perf.js.map +1 -0
- package/node_modules/@zuplo/editor/node_modules/lru-cache/dist/esm/diagnostics-channel-esm.d.mts.map +1 -1
- package/node_modules/@zuplo/editor/node_modules/lru-cache/dist/esm/diagnostics-channel-esm.mjs.map +1 -1
- package/node_modules/@zuplo/editor/node_modules/lru-cache/dist/esm/index.d.ts +2 -3
- package/node_modules/@zuplo/editor/node_modules/lru-cache/dist/esm/index.d.ts.map +1 -1
- package/node_modules/@zuplo/editor/node_modules/lru-cache/dist/esm/index.js +9 -15
- package/node_modules/@zuplo/editor/node_modules/lru-cache/dist/esm/index.js.map +1 -1
- package/node_modules/@zuplo/editor/node_modules/lru-cache/dist/esm/index.min.js +1 -1
- package/node_modules/@zuplo/editor/node_modules/lru-cache/dist/esm/index.min.js.map +4 -4
- package/node_modules/@zuplo/editor/node_modules/lru-cache/dist/esm/node/diagnostics-channel-node.d.ts.map +1 -0
- package/node_modules/@zuplo/editor/node_modules/lru-cache/dist/esm/node/diagnostics-channel-node.js.map +1 -0
- package/node_modules/@zuplo/editor/node_modules/lru-cache/dist/esm/node/diagnostics-channel.d.ts +1 -1
- package/node_modules/@zuplo/editor/node_modules/lru-cache/dist/esm/node/diagnostics-channel.js +2 -3
- package/node_modules/@zuplo/editor/node_modules/lru-cache/dist/esm/node/index.d.ts +2 -3
- package/node_modules/@zuplo/editor/node_modules/lru-cache/dist/esm/node/index.d.ts.map +1 -1
- package/node_modules/@zuplo/editor/node_modules/lru-cache/dist/esm/node/index.js +9 -15
- package/node_modules/@zuplo/editor/node_modules/lru-cache/dist/esm/node/index.js.map +1 -1
- package/node_modules/@zuplo/editor/node_modules/lru-cache/dist/esm/node/index.min.js +1 -1
- package/node_modules/@zuplo/editor/node_modules/lru-cache/dist/esm/node/index.min.js.map +4 -4
- package/node_modules/@zuplo/editor/node_modules/lru-cache/dist/esm/node/perf.d.ts +12 -0
- package/node_modules/@zuplo/editor/node_modules/lru-cache/dist/esm/node/perf.d.ts.map +1 -0
- package/node_modules/@zuplo/editor/node_modules/lru-cache/dist/esm/node/perf.js +8 -0
- package/node_modules/@zuplo/editor/node_modules/lru-cache/dist/esm/node/perf.js.map +1 -0
- package/node_modules/@zuplo/editor/node_modules/lru-cache/dist/esm/perf.d.ts +12 -0
- package/node_modules/@zuplo/editor/node_modules/lru-cache/dist/esm/perf.d.ts.map +1 -0
- package/node_modules/@zuplo/editor/node_modules/lru-cache/dist/esm/perf.js +8 -0
- package/node_modules/@zuplo/editor/node_modules/lru-cache/dist/esm/perf.js.map +1 -0
- package/node_modules/@zuplo/editor/node_modules/lru-cache/package.json +44 -16
- package/node_modules/@zuplo/graphql/package.json +1 -1
- package/node_modules/@zuplo/openapi-tools/package.json +1 -1
- package/node_modules/@zuplo/otel/package.json +1 -1
- package/node_modules/@zuplo/runtime/out/esm/index.js +54 -54
- package/node_modules/@zuplo/runtime/out/esm/index.js.map +1 -1
- package/node_modules/@zuplo/runtime/out/types/index.d.ts +4 -0
- package/node_modules/@zuplo/runtime/package.json +1 -1
- package/node_modules/axios/CHANGELOG.md +32 -6
- package/node_modules/axios/README.md +356 -20
- package/node_modules/axios/dist/axios.js +1389 -1071
- package/node_modules/axios/dist/axios.js.map +1 -1
- package/node_modules/axios/dist/axios.min.js +3 -3
- package/node_modules/axios/dist/axios.min.js.map +1 -1
- package/node_modules/axios/dist/browser/axios.cjs +1486 -1123
- package/node_modules/axios/dist/browser/axios.cjs.map +1 -1
- package/node_modules/axios/dist/esm/axios.js +1488 -1124
- package/node_modules/axios/dist/esm/axios.js.map +1 -1
- package/node_modules/axios/dist/esm/axios.min.js +2 -2
- package/node_modules/axios/dist/esm/axios.min.js.map +1 -1
- package/node_modules/axios/dist/node/axios.cjs +1230 -871
- package/node_modules/axios/dist/node/axios.cjs.map +1 -1
- package/node_modules/axios/index.d.cts +25 -13
- package/node_modules/axios/index.d.ts +21 -4
- package/node_modules/axios/index.js +2 -0
- package/node_modules/axios/lib/adapters/adapters.js +4 -2
- package/node_modules/axios/lib/adapters/fetch.js +126 -10
- package/node_modules/axios/lib/adapters/http.js +178 -59
- package/node_modules/axios/lib/adapters/xhr.js +6 -2
- package/node_modules/axios/lib/core/Axios.js +7 -3
- package/node_modules/axios/lib/core/AxiosError.js +86 -1
- package/node_modules/axios/lib/core/AxiosHeaders.js +3 -0
- package/node_modules/axios/lib/core/dispatchRequest.js +19 -7
- package/node_modules/axios/lib/core/mergeConfig.js +6 -3
- package/node_modules/axios/lib/core/settle.js +7 -11
- package/node_modules/axios/lib/defaults/index.js +1 -1
- package/node_modules/axios/lib/env/data.js +1 -1
- package/node_modules/axios/lib/helpers/buildURL.js +1 -1
- package/node_modules/axios/lib/helpers/cookies.js +14 -2
- package/node_modules/axios/lib/helpers/estimateDataURLDecodedBytes.js +28 -1
- package/node_modules/axios/lib/helpers/formDataToStream.js +1 -1
- package/node_modules/axios/lib/helpers/parseProtocol.js +1 -1
- package/node_modules/axios/lib/helpers/resolveConfig.js +33 -17
- package/node_modules/axios/lib/helpers/shouldBypassProxy.js +26 -1
- package/node_modules/axios/lib/helpers/validator.js +1 -1
- package/node_modules/axios/lib/utils.js +27 -15
- package/node_modules/axios/package.json +17 -24
- package/node_modules/fast-uri/.github/workflows/ci.yml +12 -7
- package/node_modules/fast-uri/.github/workflows/lock-threads.yml +19 -0
- package/node_modules/fast-uri/.github/workflows/package-manager-ci.yml +1 -1
- package/node_modules/fast-uri/LICENSE +1 -3
- package/node_modules/fast-uri/README.md +13 -4
- package/node_modules/fast-uri/index.js +90 -24
- package/node_modules/fast-uri/lib/utils.js +129 -22
- package/node_modules/fast-uri/package.json +3 -4
- package/node_modules/fast-uri/test/equal.test.js +9 -0
- package/node_modules/fast-uri/test/parse.test.js +5 -0
- package/node_modules/fast-uri/test/resolve.test.js +9 -0
- package/node_modules/fast-uri/test/security-normalization.test.js +39 -0
- package/node_modules/fast-uri/test/security.test.js +133 -0
- package/node_modules/is-core-module/CHANGELOG.md +244 -113
- package/node_modules/is-core-module/README.md +1 -1
- package/node_modules/is-core-module/core.json +12 -12
- package/node_modules/is-core-module/package.json +5 -5
- package/node_modules/is-core-module/test/index.js +101 -0
- package/node_modules/rimraf/node_modules/lru-cache/dist/commonjs/browser/diagnostics-channel-browser.d.ts.map +1 -0
- package/node_modules/rimraf/node_modules/lru-cache/dist/commonjs/browser/diagnostics-channel-browser.js.map +1 -0
- package/node_modules/rimraf/node_modules/lru-cache/dist/commonjs/browser/diagnostics-channel.d.ts +5 -0
- package/node_modules/rimraf/node_modules/lru-cache/dist/commonjs/browser/diagnostics-channel.js +7 -0
- package/node_modules/rimraf/node_modules/lru-cache/dist/commonjs/browser/index.d.ts +1380 -0
- package/node_modules/rimraf/node_modules/lru-cache/dist/commonjs/browser/index.d.ts.map +1 -0
- package/node_modules/rimraf/node_modules/lru-cache/dist/commonjs/browser/index.js +1686 -0
- package/node_modules/rimraf/node_modules/lru-cache/dist/commonjs/browser/index.js.map +1 -0
- package/node_modules/rimraf/node_modules/lru-cache/dist/commonjs/browser/index.min.js +2 -0
- package/node_modules/rimraf/node_modules/lru-cache/dist/commonjs/browser/index.min.js.map +7 -0
- package/node_modules/rimraf/node_modules/lru-cache/dist/commonjs/browser/perf.d.ts +12 -0
- package/node_modules/rimraf/node_modules/lru-cache/dist/commonjs/browser/perf.d.ts.map +1 -0
- package/node_modules/rimraf/node_modules/lru-cache/dist/commonjs/browser/perf.js +11 -0
- package/node_modules/rimraf/node_modules/lru-cache/dist/commonjs/browser/perf.js.map +1 -0
- package/node_modules/rimraf/node_modules/lru-cache/dist/commonjs/diagnostics-channel-cjs.cjs.map +1 -0
- package/node_modules/rimraf/node_modules/lru-cache/dist/commonjs/diagnostics-channel-cjs.d.cts.map +1 -0
- package/node_modules/rimraf/node_modules/lru-cache/dist/commonjs/diagnostics-channel.d.ts +2 -2
- package/node_modules/rimraf/node_modules/lru-cache/dist/commonjs/diagnostics-channel.js +4 -7
- package/node_modules/rimraf/node_modules/lru-cache/dist/commonjs/index.d.ts +2 -3
- package/node_modules/rimraf/node_modules/lru-cache/dist/commonjs/index.d.ts.map +1 -1
- package/node_modules/rimraf/node_modules/lru-cache/dist/commonjs/index.js +10 -16
- package/node_modules/rimraf/node_modules/lru-cache/dist/commonjs/index.js.map +1 -1
- package/node_modules/rimraf/node_modules/lru-cache/dist/commonjs/index.min.js +1 -1
- package/node_modules/rimraf/node_modules/lru-cache/dist/commonjs/index.min.js.map +4 -4
- package/node_modules/rimraf/node_modules/lru-cache/dist/commonjs/node/diagnostics-channel-node.d.ts.map +1 -0
- package/node_modules/rimraf/node_modules/lru-cache/dist/commonjs/node/diagnostics-channel-node.js.map +1 -0
- package/node_modules/rimraf/node_modules/lru-cache/dist/commonjs/node/diagnostics-channel.d.ts +5 -0
- package/node_modules/rimraf/node_modules/lru-cache/dist/commonjs/node/diagnostics-channel.js +9 -0
- package/node_modules/rimraf/node_modules/lru-cache/dist/commonjs/node/index.d.ts +1380 -0
- package/node_modules/rimraf/node_modules/lru-cache/dist/commonjs/node/index.d.ts.map +1 -0
- package/node_modules/rimraf/node_modules/lru-cache/dist/commonjs/node/index.js +1686 -0
- package/node_modules/rimraf/node_modules/lru-cache/dist/commonjs/node/index.js.map +1 -0
- package/node_modules/rimraf/node_modules/lru-cache/dist/commonjs/node/index.min.js +2 -0
- package/node_modules/rimraf/node_modules/lru-cache/dist/commonjs/node/index.min.js.map +7 -0
- package/node_modules/rimraf/node_modules/lru-cache/dist/commonjs/node/perf.d.ts +12 -0
- package/node_modules/rimraf/node_modules/lru-cache/dist/commonjs/node/perf.d.ts.map +1 -0
- package/node_modules/rimraf/node_modules/lru-cache/dist/commonjs/node/perf.js +11 -0
- package/node_modules/rimraf/node_modules/lru-cache/dist/commonjs/node/perf.js.map +1 -0
- package/node_modules/rimraf/node_modules/lru-cache/dist/commonjs/perf.d.ts +12 -0
- package/node_modules/rimraf/node_modules/lru-cache/dist/commonjs/perf.d.ts.map +1 -0
- package/node_modules/rimraf/node_modules/lru-cache/dist/commonjs/perf.js +11 -0
- package/node_modules/rimraf/node_modules/lru-cache/dist/commonjs/perf.js.map +1 -0
- package/node_modules/rimraf/node_modules/lru-cache/dist/esm/browser/diagnostics-channel-browser.d.ts.map +1 -0
- package/node_modules/rimraf/node_modules/lru-cache/dist/esm/browser/diagnostics-channel-browser.js.map +1 -0
- package/node_modules/rimraf/node_modules/lru-cache/dist/esm/browser/diagnostics-channel.d.ts +1 -1
- package/node_modules/rimraf/node_modules/lru-cache/dist/esm/browser/diagnostics-channel.js +1 -1
- package/node_modules/rimraf/node_modules/lru-cache/dist/esm/browser/index.d.ts +2 -3
- package/node_modules/rimraf/node_modules/lru-cache/dist/esm/browser/index.d.ts.map +1 -1
- package/node_modules/rimraf/node_modules/lru-cache/dist/esm/browser/index.js +9 -15
- package/node_modules/rimraf/node_modules/lru-cache/dist/esm/browser/index.js.map +1 -1
- package/node_modules/rimraf/node_modules/lru-cache/dist/esm/browser/index.min.js +1 -1
- package/node_modules/rimraf/node_modules/lru-cache/dist/esm/browser/index.min.js.map +4 -4
- package/node_modules/rimraf/node_modules/lru-cache/dist/esm/browser/perf.d.ts +12 -0
- package/node_modules/rimraf/node_modules/lru-cache/dist/esm/browser/perf.d.ts.map +1 -0
- package/node_modules/rimraf/node_modules/lru-cache/dist/esm/browser/perf.js +8 -0
- package/node_modules/rimraf/node_modules/lru-cache/dist/esm/browser/perf.js.map +1 -0
- package/node_modules/rimraf/node_modules/lru-cache/dist/esm/diagnostics-channel-esm.d.mts.map +1 -1
- package/node_modules/rimraf/node_modules/lru-cache/dist/esm/diagnostics-channel-esm.mjs.map +1 -1
- package/node_modules/rimraf/node_modules/lru-cache/dist/esm/index.d.ts +2 -3
- package/node_modules/rimraf/node_modules/lru-cache/dist/esm/index.d.ts.map +1 -1
- package/node_modules/rimraf/node_modules/lru-cache/dist/esm/index.js +9 -15
- package/node_modules/rimraf/node_modules/lru-cache/dist/esm/index.js.map +1 -1
- package/node_modules/rimraf/node_modules/lru-cache/dist/esm/index.min.js +1 -1
- package/node_modules/rimraf/node_modules/lru-cache/dist/esm/index.min.js.map +4 -4
- package/node_modules/rimraf/node_modules/lru-cache/dist/esm/node/diagnostics-channel-node.d.ts.map +1 -0
- package/node_modules/rimraf/node_modules/lru-cache/dist/esm/node/diagnostics-channel-node.js.map +1 -0
- package/node_modules/rimraf/node_modules/lru-cache/dist/esm/node/diagnostics-channel.d.ts +1 -1
- package/node_modules/rimraf/node_modules/lru-cache/dist/esm/node/diagnostics-channel.js +2 -3
- package/node_modules/rimraf/node_modules/lru-cache/dist/esm/node/index.d.ts +2 -3
- package/node_modules/rimraf/node_modules/lru-cache/dist/esm/node/index.d.ts.map +1 -1
- package/node_modules/rimraf/node_modules/lru-cache/dist/esm/node/index.js +9 -15
- package/node_modules/rimraf/node_modules/lru-cache/dist/esm/node/index.js.map +1 -1
- package/node_modules/rimraf/node_modules/lru-cache/dist/esm/node/index.min.js +1 -1
- package/node_modules/rimraf/node_modules/lru-cache/dist/esm/node/index.min.js.map +4 -4
- package/node_modules/rimraf/node_modules/lru-cache/dist/esm/node/perf.d.ts +12 -0
- package/node_modules/rimraf/node_modules/lru-cache/dist/esm/node/perf.d.ts.map +1 -0
- package/node_modules/rimraf/node_modules/lru-cache/dist/esm/node/perf.js +8 -0
- package/node_modules/rimraf/node_modules/lru-cache/dist/esm/node/perf.js.map +1 -0
- package/node_modules/rimraf/node_modules/lru-cache/dist/esm/perf.d.ts +12 -0
- package/node_modules/rimraf/node_modules/lru-cache/dist/esm/perf.d.ts.map +1 -0
- package/node_modules/rimraf/node_modules/lru-cache/dist/esm/perf.js +8 -0
- package/node_modules/rimraf/node_modules/lru-cache/dist/esm/perf.js.map +1 -0
- package/node_modules/rimraf/node_modules/lru-cache/package.json +44 -16
- package/package.json +6 -6
- package/node_modules/@zuplo/editor/node_modules/fast-json-stringify/.github/stale.yml +0 -21
- package/node_modules/@zuplo/editor/node_modules/lru-cache/dist/commonjs/diagnostics-channel.d.ts.map +0 -1
- package/node_modules/@zuplo/editor/node_modules/lru-cache/dist/commonjs/diagnostics-channel.js.map +0 -1
- package/node_modules/@zuplo/editor/node_modules/lru-cache/dist/esm/browser/diagnostics-channel-browser.d.mts.map +0 -1
- package/node_modules/@zuplo/editor/node_modules/lru-cache/dist/esm/browser/diagnostics-channel-browser.mjs.map +0 -1
- package/node_modules/@zuplo/editor/node_modules/lru-cache/dist/esm/node/diagnostics-channel-node.d.mts.map +0 -1
- package/node_modules/@zuplo/editor/node_modules/lru-cache/dist/esm/node/diagnostics-channel-node.mjs.map +0 -1
- package/node_modules/fast-uri/.github/.stale.yml +0 -21
- package/node_modules/fast-uri/.github/tests_checker.yml +0 -8
- package/node_modules/rimraf/node_modules/lru-cache/dist/commonjs/diagnostics-channel.d.ts.map +0 -1
- package/node_modules/rimraf/node_modules/lru-cache/dist/commonjs/diagnostics-channel.js.map +0 -1
- package/node_modules/rimraf/node_modules/lru-cache/dist/esm/browser/diagnostics-channel-browser.d.mts.map +0 -1
- package/node_modules/rimraf/node_modules/lru-cache/dist/esm/browser/diagnostics-channel-browser.mjs.map +0 -1
- package/node_modules/rimraf/node_modules/lru-cache/dist/esm/node/diagnostics-channel-node.d.mts.map +0 -1
- package/node_modules/rimraf/node_modules/lru-cache/dist/esm/node/diagnostics-channel-node.mjs.map +0 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"handler.js","sourceRoot":"","sources":["../../../src/tunnel/describe/handler.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,
|
|
1
|
+
{"version":3,"file":"handler.js","sourceRoot":"","sources":["../../../src/tunnel/describe/handler.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,eAAe,EAAE,MAAM,4BAA4B,CAAC;AAC7D,OAAO,EAAE,oCAAoC,EAAE,MAAM,wBAAwB,CAAC;AAS9E,MAAM,CAAC,KAAK,UAAU,QAAQ,CAAC,IAAe;IAC5C,MAAM,EAAE,OAAO,EAAE,GAAG,IAAI,CAAC;IACzB,MAAM,MAAM,GAAG,eAAe,CAAC,EAAE,SAAS,EAAE,IAAI,CAAC,SAAS,EAAE,CAAC,CAAC;IAC9D,MAAM,MAAM,GAAG,MAAM,MAAM,CAAC,GAAG,CAC7B,gBAAgB,OAAO,YAAY,IAAI,CAAC,WAAW,CAAC,EAAE,EACtD;QACE,SAAS,EAAE,uCAAuC;QAClD,YAAY,EACV,yEAAyE;KAC5E,CACF,CAAC;IAEF,MAAM,oCAAoC,CAAC,MAAM,CAAC,CAAC;AACrD,CAAC","sourcesContent":["import { createApiClient } from \"../../common/api/client.js\";\nimport { printTableToConsoleAndExitGracefully } from \"../../common/output.js\";\nimport { Tunnel } from \"../models.js\";\n\nexport interface Arguments {\n account: string;\n \"tunnel-id\": string;\n authToken: string;\n}\n\nexport async function describe(argv: Arguments) {\n const { account } = argv;\n const client = createApiClient({ authToken: argv.authToken });\n const tunnel = await client.get<Tunnel>(\n `/v1/accounts/${account}/tunnels/${argv[\"tunnel-id\"]}`,\n {\n operation: \"Failed to describe tunnel for account\",\n errorMessage:\n \"Error: Failed to describe tunnel for your account. Check the arguments.\",\n }\n );\n\n await printTableToConsoleAndExitGracefully(tunnel);\n}\n"]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"handler.d.ts","sourceRoot":"","sources":["../../../src/tunnel/list/handler.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"handler.d.ts","sourceRoot":"","sources":["../../../src/tunnel/list/handler.ts"],"names":[],"mappings":"AAOA,MAAM,WAAW,SAAS;IACxB,OAAO,EAAE,MAAM,CAAC;IAChB,SAAS,EAAE,MAAM,CAAC;CACnB;AAED,wBAAsB,IAAI,CAAC,IAAI,EAAE,SAAS,iBAoBzC"}
|
|
@@ -1,35 +1,20 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import {
|
|
3
|
-
import settings from "../../common/settings.js";
|
|
1
|
+
import { createApiClient } from "../../common/api/client.js";
|
|
2
|
+
import { printResultToConsoleAndExitGracefully, printTableToConsoleAndExitGracefully, } from "../../common/output.js";
|
|
4
3
|
export async function list(argv) {
|
|
5
|
-
const { account } =
|
|
6
|
-
const
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
},
|
|
4
|
+
const { account } = argv;
|
|
5
|
+
const client = createApiClient({ authToken: argv.authToken });
|
|
6
|
+
const tunnels = await client.get(`/v1/accounts/${account}/tunnels`, {
|
|
7
|
+
operation: "Failed to list tunnels for account",
|
|
8
|
+
errorMessage: "Error: Failed to list tunnels for your account. Try again later.",
|
|
11
9
|
});
|
|
12
|
-
if (
|
|
13
|
-
|
|
14
|
-
if (tunnels.data.length === 0) {
|
|
15
|
-
const output = "No tunnels found";
|
|
16
|
-
await printResultToConsoleAndExitGracefully(output);
|
|
17
|
-
}
|
|
18
|
-
else {
|
|
19
|
-
const table = tunnels.data.map((tunnel) => {
|
|
20
|
-
return { "tunnel-id": tunnel.id, name: tunnel.name };
|
|
21
|
-
});
|
|
22
|
-
await printTableToConsoleAndExitGracefully(table);
|
|
23
|
-
}
|
|
10
|
+
if (tunnels.data.length === 0) {
|
|
11
|
+
await printResultToConsoleAndExitGracefully("No tunnels found");
|
|
24
12
|
}
|
|
25
13
|
else {
|
|
26
|
-
const
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
response,
|
|
31
|
-
}, "Failed to list tunnels for account");
|
|
32
|
-
printDiagnosticsToConsole("Error: Failed to list tunnels for your account. Try again later.", response);
|
|
14
|
+
const table = tunnels.data.map((tunnel) => {
|
|
15
|
+
return { "tunnel-id": tunnel.id, name: tunnel.name };
|
|
16
|
+
});
|
|
17
|
+
await printTableToConsoleAndExitGracefully(table);
|
|
33
18
|
}
|
|
34
19
|
}
|
|
35
20
|
//# sourceMappingURL=handler.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"handler.js","sourceRoot":"","sources":["../../../src/tunnel/list/handler.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,
|
|
1
|
+
{"version":3,"file":"handler.js","sourceRoot":"","sources":["../../../src/tunnel/list/handler.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,eAAe,EAAE,MAAM,4BAA4B,CAAC;AAC7D,OAAO,EACL,qCAAqC,EACrC,oCAAoC,GACrC,MAAM,wBAAwB,CAAC;AAQhC,MAAM,CAAC,KAAK,UAAU,IAAI,CAAC,IAAe;IACxC,MAAM,EAAE,OAAO,EAAE,GAAG,IAAI,CAAC;IACzB,MAAM,MAAM,GAAG,eAAe,CAAC,EAAE,SAAS,EAAE,IAAI,CAAC,SAAS,EAAE,CAAC,CAAC;IAC9D,MAAM,OAAO,GAAG,MAAM,MAAM,CAAC,GAAG,CAC9B,gBAAgB,OAAO,UAAU,EACjC;QACE,SAAS,EAAE,oCAAoC;QAC/C,YAAY,EACV,kEAAkE;KACrE,CACF,CAAC;IAEF,IAAI,OAAO,CAAC,IAAI,CAAC,MAAM,KAAK,CAAC,EAAE,CAAC;QAC9B,MAAM,qCAAqC,CAAC,kBAAkB,CAAC,CAAC;IAClE,CAAC;SAAM,CAAC;QACN,MAAM,KAAK,GAAG,OAAO,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC,MAAM,EAAE,EAAE;YACxC,OAAO,EAAE,WAAW,EAAE,MAAM,CAAC,EAAE,EAAE,IAAI,EAAE,MAAM,CAAC,IAAI,EAAE,CAAC;QACvD,CAAC,CAAC,CAAC;QACH,MAAM,oCAAoC,CAAC,KAAK,CAAC,CAAC;IACpD,CAAC;AACH,CAAC","sourcesContent":["import { createApiClient } from \"../../common/api/client.js\";\nimport {\n printResultToConsoleAndExitGracefully,\n printTableToConsoleAndExitGracefully,\n} from \"../../common/output.js\";\nimport { TunnelList } from \"../models.js\";\n\nexport interface Arguments {\n account: string;\n authToken: string;\n}\n\nexport async function list(argv: Arguments) {\n const { account } = argv;\n const client = createApiClient({ authToken: argv.authToken });\n const tunnels = await client.get<TunnelList>(\n `/v1/accounts/${account}/tunnels`,\n {\n operation: \"Failed to list tunnels for account\",\n errorMessage:\n \"Error: Failed to list tunnels for your account. Try again later.\",\n }\n );\n\n if (tunnels.data.length === 0) {\n await printResultToConsoleAndExitGracefully(\"No tunnels found\");\n } else {\n const table = tunnels.data.map((tunnel) => {\n return { \"tunnel-id\": tunnel.id, name: tunnel.name };\n });\n await printTableToConsoleAndExitGracefully(table);\n }\n}\n"]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"handler.d.ts","sourceRoot":"","sources":["../../../src/tunnel/rotate-token/handler.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"handler.d.ts","sourceRoot":"","sources":["../../../src/tunnel/rotate-token/handler.ts"],"names":[],"mappings":"AAIA,MAAM,WAAW,SAAS;IACxB,OAAO,EAAE,MAAM,CAAC;IAChB,WAAW,EAAE,MAAM,CAAC;IACpB,SAAS,EAAE,MAAM,CAAC;CACnB;AAED,wBAAsB,WAAW,CAAC,IAAI,EAAE,SAAS,iBAahD"}
|
|
@@ -1,26 +1,12 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import {
|
|
3
|
-
import settings from "../../common/settings.js";
|
|
1
|
+
import { createApiClient } from "../../common/api/client.js";
|
|
2
|
+
import { printTableToConsoleAndExitGracefully } from "../../common/output.js";
|
|
4
3
|
export async function rotateToken(argv) {
|
|
5
4
|
const { account } = argv;
|
|
6
|
-
const
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
},
|
|
5
|
+
const client = createApiClient({ authToken: argv.authToken });
|
|
6
|
+
const tunnel = await client.post(`/v1/accounts/${account}/tunnels/${argv["tunnel-id"]}/$rotate-token`, {
|
|
7
|
+
operation: "Failed to rotate token for tunnel",
|
|
8
|
+
errorMessage: "Error: Failed to rotate token for tunnel. Check the arguments.",
|
|
11
9
|
});
|
|
12
|
-
|
|
13
|
-
const tunnel = await rotateResponse.json();
|
|
14
|
-
await printTableToConsoleAndExitGracefully(tunnel);
|
|
15
|
-
}
|
|
16
|
-
else {
|
|
17
|
-
const response = textOrJson(await rotateResponse.text());
|
|
18
|
-
logger.error({
|
|
19
|
-
status: rotateResponse.status,
|
|
20
|
-
statusText: rotateResponse.statusText,
|
|
21
|
-
response,
|
|
22
|
-
}, "Failed to rotate token for tunnel");
|
|
23
|
-
printDiagnosticsToConsole("Error: Failed to rotate token for tunnel. Check the arguments.", response);
|
|
24
|
-
}
|
|
10
|
+
await printTableToConsoleAndExitGracefully(tunnel);
|
|
25
11
|
}
|
|
26
12
|
//# sourceMappingURL=handler.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"handler.js","sourceRoot":"","sources":["../../../src/tunnel/rotate-token/handler.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,
|
|
1
|
+
{"version":3,"file":"handler.js","sourceRoot":"","sources":["../../../src/tunnel/rotate-token/handler.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,eAAe,EAAE,MAAM,4BAA4B,CAAC;AAC7D,OAAO,EAAE,oCAAoC,EAAE,MAAM,wBAAwB,CAAC;AAS9E,MAAM,CAAC,KAAK,UAAU,WAAW,CAAC,IAAe;IAC/C,MAAM,EAAE,OAAO,EAAE,GAAG,IAAI,CAAC;IACzB,MAAM,MAAM,GAAG,eAAe,CAAC,EAAE,SAAS,EAAE,IAAI,CAAC,SAAS,EAAE,CAAC,CAAC;IAC9D,MAAM,MAAM,GAAG,MAAM,MAAM,CAAC,IAAI,CAC9B,gBAAgB,OAAO,YAAY,IAAI,CAAC,WAAW,CAAC,gBAAgB,EACpE;QACE,SAAS,EAAE,mCAAmC;QAC9C,YAAY,EACV,gEAAgE;KACnE,CACF,CAAC;IAEF,MAAM,oCAAoC,CAAC,MAAM,CAAC,CAAC;AACrD,CAAC","sourcesContent":["import { createApiClient } from \"../../common/api/client.js\";\nimport { printTableToConsoleAndExitGracefully } from \"../../common/output.js\";\nimport { Tunnel } from \"../models.js\";\n\nexport interface Arguments {\n account: string;\n \"tunnel-id\": string;\n authToken: string;\n}\n\nexport async function rotateToken(argv: Arguments) {\n const { account } = argv;\n const client = createApiClient({ authToken: argv.authToken });\n const tunnel = await client.post<Tunnel>(\n `/v1/accounts/${account}/tunnels/${argv[\"tunnel-id\"]}/$rotate-token`,\n {\n operation: \"Failed to rotate token for tunnel\",\n errorMessage:\n \"Error: Failed to rotate token for tunnel. Check the arguments.\",\n }\n );\n\n await printTableToConsoleAndExitGracefully(tunnel);\n}\n"]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"handler.d.ts","sourceRoot":"","sources":["../../../../src/tunnel/services/describe/handler.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"handler.d.ts","sourceRoot":"","sources":["../../../../src/tunnel/services/describe/handler.ts"],"names":[],"mappings":"AAIA,MAAM,WAAW,SAAS;IACxB,OAAO,EAAE,MAAM,CAAC;IAChB,WAAW,EAAE,MAAM,CAAC;IACpB,SAAS,EAAE,MAAM,CAAC;CACnB;AAED,wBAAsB,QAAQ,CAAC,IAAI,EAAE,SAAS,iBAa7C"}
|
|
@@ -1,26 +1,12 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import {
|
|
3
|
-
import settings from "../../../common/settings.js";
|
|
1
|
+
import { createApiClient } from "../../../common/api/client.js";
|
|
2
|
+
import { printResultToConsoleAndExitGracefully } from "../../../common/output.js";
|
|
4
3
|
export async function describe(argv) {
|
|
5
4
|
const { account } = argv;
|
|
6
|
-
const
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
},
|
|
5
|
+
const client = createApiClient({ authToken: argv.authToken });
|
|
6
|
+
const tunnel = await client.get(`/v1/accounts/${account}/tunnels/${argv["tunnel-id"]}/services-configuration`, {
|
|
7
|
+
operation: "Failed to describe services for tunnel",
|
|
8
|
+
errorMessage: "Error: Failed to describe the services for your tunnel. Check the arguments.",
|
|
11
9
|
});
|
|
12
|
-
|
|
13
|
-
const tunnel = await describeResponse.json();
|
|
14
|
-
await printResultToConsoleAndExitGracefully(JSON.stringify(tunnel, null, 2));
|
|
15
|
-
}
|
|
16
|
-
else {
|
|
17
|
-
const response = textOrJson(await describeResponse.text());
|
|
18
|
-
logger.error({
|
|
19
|
-
status: describeResponse.status,
|
|
20
|
-
statusText: describeResponse.statusText,
|
|
21
|
-
response,
|
|
22
|
-
}, "Failed to describe services for tunnel");
|
|
23
|
-
printDiagnosticsToConsole("Error: Failed to describe the services for your tunnel. Check the arguments.", response);
|
|
24
|
-
}
|
|
10
|
+
await printResultToConsoleAndExitGracefully(JSON.stringify(tunnel, null, 2));
|
|
25
11
|
}
|
|
26
12
|
//# sourceMappingURL=handler.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"handler.js","sourceRoot":"","sources":["../../../../src/tunnel/services/describe/handler.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,
|
|
1
|
+
{"version":3,"file":"handler.js","sourceRoot":"","sources":["../../../../src/tunnel/services/describe/handler.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,eAAe,EAAE,MAAM,+BAA+B,CAAC;AAChE,OAAO,EAAE,qCAAqC,EAAE,MAAM,2BAA2B,CAAC;AASlF,MAAM,CAAC,KAAK,UAAU,QAAQ,CAAC,IAAe;IAC5C,MAAM,EAAE,OAAO,EAAE,GAAG,IAAI,CAAC;IACzB,MAAM,MAAM,GAAG,eAAe,CAAC,EAAE,SAAS,EAAE,IAAI,CAAC,SAAS,EAAE,CAAC,CAAC;IAC9D,MAAM,MAAM,GAAG,MAAM,MAAM,CAAC,GAAG,CAC7B,gBAAgB,OAAO,YAAY,IAAI,CAAC,WAAW,CAAC,yBAAyB,EAC7E;QACE,SAAS,EAAE,wCAAwC;QACnD,YAAY,EACV,8EAA8E;KACjF,CACF,CAAC;IAEF,MAAM,qCAAqC,CAAC,IAAI,CAAC,SAAS,CAAC,MAAM,EAAE,IAAI,EAAE,CAAC,CAAC,CAAC,CAAC;AAC/E,CAAC","sourcesContent":["import { createApiClient } from \"../../../common/api/client.js\";\nimport { printResultToConsoleAndExitGracefully } from \"../../../common/output.js\";\nimport { Tunnel } from \"../../models.js\";\n\nexport interface Arguments {\n account: string;\n \"tunnel-id\": string;\n authToken: string;\n}\n\nexport async function describe(argv: Arguments) {\n const { account } = argv;\n const client = createApiClient({ authToken: argv.authToken });\n const tunnel = await client.get<Tunnel>(\n `/v1/accounts/${account}/tunnels/${argv[\"tunnel-id\"]}/services-configuration`,\n {\n operation: \"Failed to describe services for tunnel\",\n errorMessage:\n \"Error: Failed to describe the services for your tunnel. Check the arguments.\",\n }\n );\n\n await printResultToConsoleAndExitGracefully(JSON.stringify(tunnel, null, 2));\n}\n"]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"handler.d.ts","sourceRoot":"","sources":["../../../../src/tunnel/services/update/handler.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"handler.d.ts","sourceRoot":"","sources":["../../../../src/tunnel/services/update/handler.ts"],"names":[],"mappings":"AAUA,MAAM,WAAW,SAAS;IACxB,OAAO,EAAE,MAAM,CAAC;IAChB,oBAAoB,EAAE,MAAM,CAAC;IAC7B,WAAW,EAAE,MAAM,CAAC;IACpB,SAAS,EAAE,MAAM,CAAC;CACnB;AAED,wBAAsB,cAAc,CAAC,IAAI,EAAE,SAAS,iBA8CnD"}
|
|
@@ -1,7 +1,6 @@
|
|
|
1
1
|
import { readFile } from "node:fs/promises";
|
|
2
|
-
import {
|
|
3
|
-
import { printCriticalFailureToConsoleAndExit, printDiagnosticsToConsole, printResultToConsoleAndExitGracefully,
|
|
4
|
-
import settings from "../../../common/settings.js";
|
|
2
|
+
import { createApiClient } from "../../../common/api/client.js";
|
|
3
|
+
import { printCriticalFailureToConsoleAndExit, printDiagnosticsToConsole, printResultToConsoleAndExitGracefully, } from "../../../common/output.js";
|
|
5
4
|
import { pollProvisioningOperation } from "./poll-provisioning-operations.js";
|
|
6
5
|
export async function updateServices(argv) {
|
|
7
6
|
let contents;
|
|
@@ -9,41 +8,28 @@ export async function updateServices(argv) {
|
|
|
9
8
|
contents = await readFile(argv["configuration-file"], "utf-8");
|
|
10
9
|
}
|
|
11
10
|
catch (err) {
|
|
12
|
-
await printCriticalFailureToConsoleAndExit(`Error reading the configuration file at ${argv["configuration-file"]}: ${err.message}
|
|
11
|
+
await printCriticalFailureToConsoleAndExit(`Error reading the configuration file at ${argv["configuration-file"]}: ${err.message}`);
|
|
12
|
+
return;
|
|
13
13
|
}
|
|
14
14
|
const { account } = argv;
|
|
15
|
-
const
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
"Content-Type": "application/json",
|
|
20
|
-
},
|
|
15
|
+
const client = createApiClient({ authToken: argv.authToken });
|
|
16
|
+
const provisioningOperation = await client.put(`/v1/accounts/${account}/tunnels/${argv["tunnel-id"]}/services-configuration`, {
|
|
17
|
+
operation: "Failed to update tunnel for account",
|
|
18
|
+
errorMessage: "Error: Failed to update the tunnel for your account. Check the arguments.",
|
|
21
19
|
body: contents,
|
|
22
20
|
});
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
});
|
|
31
|
-
if (polledProvisioningOperation.status === "success") {
|
|
32
|
-
await printResultToConsoleAndExitGracefully(`Tunnel ${argv["tunnel-id"]} updated successfully.`);
|
|
33
|
-
}
|
|
34
|
-
else {
|
|
35
|
-
printDiagnosticsToConsole(polledProvisioningOperation.details);
|
|
36
|
-
await printCriticalFailureToConsoleAndExit(`Tunnel ${argv["tunnel-id"]} failed to update. Here's the error: ${polledProvisioningOperation.message}`);
|
|
37
|
-
}
|
|
21
|
+
printDiagnosticsToConsole(`Updating services on tunnel ${argv["tunnel-id"]} on account ${account}...`);
|
|
22
|
+
const polledProvisioningOperation = await pollProvisioningOperation({
|
|
23
|
+
argv,
|
|
24
|
+
account,
|
|
25
|
+
provisioningOperationId: provisioningOperation.id,
|
|
26
|
+
});
|
|
27
|
+
if (polledProvisioningOperation.status === "success") {
|
|
28
|
+
await printResultToConsoleAndExitGracefully(`Tunnel ${argv["tunnel-id"]} updated successfully.`);
|
|
38
29
|
}
|
|
39
30
|
else {
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
status: deleteResponse.status,
|
|
43
|
-
statusText: deleteResponse.statusText,
|
|
44
|
-
response,
|
|
45
|
-
}, "Failed to update tunnel for account");
|
|
46
|
-
printDiagnosticsToConsole("Error: Failed to update the tunnel for your account. Check the arguments.", response);
|
|
31
|
+
printDiagnosticsToConsole(polledProvisioningOperation.details);
|
|
32
|
+
await printCriticalFailureToConsoleAndExit(`Tunnel ${argv["tunnel-id"]} failed to update. Here's the error: ${polledProvisioningOperation.message}`);
|
|
47
33
|
}
|
|
48
34
|
}
|
|
49
35
|
//# sourceMappingURL=handler.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"handler.js","sourceRoot":"","sources":["../../../../src/tunnel/services/update/handler.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,QAAQ,EAAE,MAAM,kBAAkB,CAAC;AAC5C,OAAO,EAAE,
|
|
1
|
+
{"version":3,"file":"handler.js","sourceRoot":"","sources":["../../../../src/tunnel/services/update/handler.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,QAAQ,EAAE,MAAM,kBAAkB,CAAC;AAC5C,OAAO,EAAE,eAAe,EAAE,MAAM,+BAA+B,CAAC;AAChE,OAAO,EACL,oCAAoC,EACpC,yBAAyB,EACzB,qCAAqC,GACtC,MAAM,2BAA2B,CAAC;AAEnC,OAAO,EAAE,yBAAyB,EAAE,MAAM,mCAAmC,CAAC;AAS9E,MAAM,CAAC,KAAK,UAAU,cAAc,CAAC,IAAe;IAElD,IAAI,QAAgB,CAAC;IACrB,IAAI,CAAC;QACH,QAAQ,GAAG,MAAM,QAAQ,CAAC,IAAI,CAAC,oBAAoB,CAAC,EAAE,OAAO,CAAC,CAAC;IACjE,CAAC;IAAC,OAAO,GAAG,EAAE,CAAC;QACb,MAAM,oCAAoC,CACxC,2CAA2C,IAAI,CAAC,oBAAoB,CAAC,KAAK,GAAG,CAAC,OAAO,EAAE,CACxF,CAAC;QACF,OAAO;IACT,CAAC;IAGD,MAAM,EAAE,OAAO,EAAE,GAAG,IAAI,CAAC;IACzB,MAAM,MAAM,GAAG,eAAe,CAAC,EAAE,SAAS,EAAE,IAAI,CAAC,SAAS,EAAE,CAAC,CAAC;IAC9D,MAAM,qBAAqB,GAAG,MAAM,MAAM,CAAC,GAAG,CAC5C,gBAAgB,OAAO,YAAY,IAAI,CAAC,WAAW,CAAC,yBAAyB,EAC7E;QACE,SAAS,EAAE,qCAAqC;QAChD,YAAY,EACV,2EAA2E;QAC7E,IAAI,EAAE,QAAQ;KACf,CACF,CAAC;IAEF,yBAAyB,CACvB,+BAA+B,IAAI,CAAC,WAAW,CAAC,eAAe,OAAO,KAAK,CAC5E,CAAC;IAGF,MAAM,2BAA2B,GAAG,MAAM,yBAAyB,CAAC;QAClE,IAAI;QACJ,OAAO;QACP,uBAAuB,EAAE,qBAAqB,CAAC,EAAE;KAClD,CAAC,CAAC;IAEH,IAAI,2BAA2B,CAAC,MAAM,KAAK,SAAS,EAAE,CAAC;QACrD,MAAM,qCAAqC,CACzC,UAAU,IAAI,CAAC,WAAW,CAAC,wBAAwB,CACpD,CAAC;IACJ,CAAC;SAAM,CAAC;QACN,yBAAyB,CAAC,2BAA2B,CAAC,OAAO,CAAC,CAAC;QAC/D,MAAM,oCAAoC,CACxC,UAAU,IAAI,CAAC,WAAW,CAAC,wCAAwC,2BAA2B,CAAC,OAAO,EAAE,CACzG,CAAC;IACJ,CAAC;AACH,CAAC","sourcesContent":["import { readFile } from \"node:fs/promises\";\nimport { createApiClient } from \"../../../common/api/client.js\";\nimport {\n printCriticalFailureToConsoleAndExit,\n printDiagnosticsToConsole,\n printResultToConsoleAndExitGracefully,\n} from \"../../../common/output.js\";\nimport { ProvisioningOperation } from \"../../models.js\";\nimport { pollProvisioningOperation } from \"./poll-provisioning-operations.js\";\n\nexport interface Arguments {\n account: string;\n \"configuration-file\": string;\n \"tunnel-id\": string;\n authToken: string;\n}\n\nexport async function updateServices(argv: Arguments) {\n // 2. Read the configuration file\n let contents: string;\n try {\n contents = await readFile(argv[\"configuration-file\"], \"utf-8\");\n } catch (err) {\n await printCriticalFailureToConsoleAndExit(\n `Error reading the configuration file at ${argv[\"configuration-file\"]}: ${err.message}`\n );\n return;\n }\n\n // 3. Initiate an update for the tunnel\n const { account } = argv;\n const client = createApiClient({ authToken: argv.authToken });\n const provisioningOperation = await client.put<ProvisioningOperation>(\n `/v1/accounts/${account}/tunnels/${argv[\"tunnel-id\"]}/services-configuration`,\n {\n operation: \"Failed to update tunnel for account\",\n errorMessage:\n \"Error: Failed to update the tunnel for your account. Check the arguments.\",\n body: contents,\n }\n );\n\n printDiagnosticsToConsole(\n `Updating services on tunnel ${argv[\"tunnel-id\"]} on account ${account}...`\n );\n\n // 3. Poll for status\n const polledProvisioningOperation = await pollProvisioningOperation({\n argv,\n account,\n provisioningOperationId: provisioningOperation.id,\n });\n\n if (polledProvisioningOperation.status === \"success\") {\n await printResultToConsoleAndExitGracefully(\n `Tunnel ${argv[\"tunnel-id\"]} updated successfully.`\n );\n } else {\n printDiagnosticsToConsole(polledProvisioningOperation.details);\n await printCriticalFailureToConsoleAndExit(\n `Tunnel ${argv[\"tunnel-id\"]} failed to update. Here's the error: ${polledProvisioningOperation.message}`\n );\n }\n}\n"]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"handler.d.ts","sourceRoot":"","sources":["../../../src/variable/create/handler.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"handler.d.ts","sourceRoot":"","sources":["../../../src/variable/create/handler.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,SAAS,EAAY,MAAM,cAAc,CAAC;AAEnD,wBAAsB,MAAM,CAAC,IAAI,EAAE,SAAS,iBAmB3C"}
|
|
@@ -1,32 +1,17 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import {
|
|
3
|
-
import settings from "../../common/settings.js";
|
|
1
|
+
import { createApiClient } from "../../common/api/client.js";
|
|
2
|
+
import { printResultToConsole } from "../../common/output.js";
|
|
4
3
|
export async function create(argv) {
|
|
5
4
|
const { account, project } = argv;
|
|
6
|
-
const
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
},
|
|
12
|
-
body: JSON.stringify({
|
|
5
|
+
const client = createApiClient({ authToken: argv.authToken });
|
|
6
|
+
const variable = await client.post(`/v1/accounts/${account}/projects/${project}/branches/${encodeURIComponent(argv["branch"])}/variables`, {
|
|
7
|
+
operation: "Failed to create variable",
|
|
8
|
+
errorMessage: "Error: Failed to create variable. Check the arguments.",
|
|
9
|
+
body: {
|
|
13
10
|
name: argv["name"],
|
|
14
11
|
isSecret: argv["is-secret"],
|
|
15
12
|
value: argv["value"],
|
|
16
|
-
}
|
|
13
|
+
},
|
|
17
14
|
});
|
|
18
|
-
|
|
19
|
-
const variable = await createResponse.json();
|
|
20
|
-
printResultToConsole(`${variable.name} created successfully`);
|
|
21
|
-
}
|
|
22
|
-
else {
|
|
23
|
-
const problem = textOrJson(await createResponse.text());
|
|
24
|
-
logger.error({
|
|
25
|
-
status: createResponse.status,
|
|
26
|
-
statusText: createResponse.statusText,
|
|
27
|
-
response: problem,
|
|
28
|
-
}, "Failed to create variable");
|
|
29
|
-
printDiagnosticsToConsole("Error: Failed to create variable. Check the arguments.", problem);
|
|
30
|
-
}
|
|
15
|
+
printResultToConsole(`${variable.name} created successfully`);
|
|
31
16
|
}
|
|
32
17
|
//# sourceMappingURL=handler.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"handler.js","sourceRoot":"","sources":["../../../src/variable/create/handler.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,
|
|
1
|
+
{"version":3,"file":"handler.js","sourceRoot":"","sources":["../../../src/variable/create/handler.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,eAAe,EAAE,MAAM,4BAA4B,CAAC;AAC7D,OAAO,EAAE,oBAAoB,EAAE,MAAM,wBAAwB,CAAC;AAG9D,MAAM,CAAC,KAAK,UAAU,MAAM,CAAC,IAAe;IAC1C,MAAM,EAAE,OAAO,EAAE,OAAO,EAAE,GAAG,IAAI,CAAC;IAClC,MAAM,MAAM,GAAG,eAAe,CAAC,EAAE,SAAS,EAAE,IAAI,CAAC,SAAS,EAAE,CAAC,CAAC;IAC9D,MAAM,QAAQ,GAAG,MAAM,MAAM,CAAC,IAAI,CAChC,gBAAgB,OAAO,aAAa,OAAO,aAAa,kBAAkB,CACxE,IAAI,CAAC,QAAQ,CAAC,CACf,YAAY,EACb;QACE,SAAS,EAAE,2BAA2B;QACtC,YAAY,EAAE,wDAAwD;QACtE,IAAI,EAAE;YACJ,IAAI,EAAE,IAAI,CAAC,MAAM,CAAC;YAClB,QAAQ,EAAE,IAAI,CAAC,WAAW,CAAC;YAC3B,KAAK,EAAE,IAAI,CAAC,OAAO,CAAC;SACrB;KACF,CACF,CAAC;IAEF,oBAAoB,CAAC,GAAG,QAAQ,CAAC,IAAI,uBAAuB,CAAC,CAAC;AAChE,CAAC","sourcesContent":["import { createApiClient } from \"../../common/api/client.js\";\nimport { printResultToConsole } from \"../../common/output.js\";\nimport { Arguments, Variable } from \"../models.js\";\n\nexport async function create(argv: Arguments) {\n const { account, project } = argv;\n const client = createApiClient({ authToken: argv.authToken });\n const variable = await client.post<Variable>(\n `/v1/accounts/${account}/projects/${project}/branches/${encodeURIComponent(\n argv[\"branch\"]\n )}/variables`,\n {\n operation: \"Failed to create variable\",\n errorMessage: \"Error: Failed to create variable. Check the arguments.\",\n body: {\n name: argv[\"name\"],\n isSecret: argv[\"is-secret\"],\n value: argv[\"value\"],\n },\n }\n );\n\n printResultToConsole(`${variable.name} created successfully`);\n}\n"]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"handler.d.ts","sourceRoot":"","sources":["../../../src/variable/update/handler.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"handler.d.ts","sourceRoot":"","sources":["../../../src/variable/update/handler.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,SAAS,EAAY,MAAM,cAAc,CAAC;AAEnD,wBAAsB,MAAM,CAAC,IAAI,EAAE,SAAS,iBAiB3C"}
|
|
@@ -1,30 +1,15 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import {
|
|
3
|
-
import settings from "../../common/settings.js";
|
|
1
|
+
import { createApiClient } from "../../common/api/client.js";
|
|
2
|
+
import { printResultToConsole } from "../../common/output.js";
|
|
4
3
|
export async function update(argv) {
|
|
5
4
|
const { account, project } = argv;
|
|
6
|
-
const
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
},
|
|
12
|
-
body: JSON.stringify({
|
|
5
|
+
const client = createApiClient({ authToken: argv.authToken });
|
|
6
|
+
const variable = await client.patch(`/v1/accounts/${account}/projects/${project}/branches/${encodeURIComponent(argv["branch"])}/variables/${encodeURIComponent(argv["name"])}`, {
|
|
7
|
+
operation: "Failed to update variable",
|
|
8
|
+
errorMessage: "Error: Failed to update variable. Check the arguments.",
|
|
9
|
+
body: {
|
|
13
10
|
value: argv["value"],
|
|
14
|
-
}
|
|
11
|
+
},
|
|
15
12
|
});
|
|
16
|
-
|
|
17
|
-
const variable = await updateResponse.json();
|
|
18
|
-
printResultToConsole(`${variable.name} updated successfully`);
|
|
19
|
-
}
|
|
20
|
-
else {
|
|
21
|
-
const problem = textOrJson(await updateResponse.text());
|
|
22
|
-
logger.error({
|
|
23
|
-
status: updateResponse.status,
|
|
24
|
-
statusText: updateResponse.statusText,
|
|
25
|
-
response: problem,
|
|
26
|
-
}, "Failed to update variable");
|
|
27
|
-
printDiagnosticsToConsole("Error: Failed to update variable. Check the arguments.", problem);
|
|
28
|
-
}
|
|
13
|
+
printResultToConsole(`${variable.name} updated successfully`);
|
|
29
14
|
}
|
|
30
15
|
//# sourceMappingURL=handler.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"handler.js","sourceRoot":"","sources":["../../../src/variable/update/handler.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,
|
|
1
|
+
{"version":3,"file":"handler.js","sourceRoot":"","sources":["../../../src/variable/update/handler.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,eAAe,EAAE,MAAM,4BAA4B,CAAC;AAC7D,OAAO,EAAE,oBAAoB,EAAE,MAAM,wBAAwB,CAAC;AAG9D,MAAM,CAAC,KAAK,UAAU,MAAM,CAAC,IAAe;IAC1C,MAAM,EAAE,OAAO,EAAE,OAAO,EAAE,GAAG,IAAI,CAAC;IAClC,MAAM,MAAM,GAAG,eAAe,CAAC,EAAE,SAAS,EAAE,IAAI,CAAC,SAAS,EAAE,CAAC,CAAC;IAC9D,MAAM,QAAQ,GAAG,MAAM,MAAM,CAAC,KAAK,CACjC,gBAAgB,OAAO,aAAa,OAAO,aAAa,kBAAkB,CACxE,IAAI,CAAC,QAAQ,CAAC,CACf,cAAc,kBAAkB,CAAC,IAAI,CAAC,MAAM,CAAC,CAAC,EAAE,EACjD;QACE,SAAS,EAAE,2BAA2B;QACtC,YAAY,EAAE,wDAAwD;QACtE,IAAI,EAAE;YACJ,KAAK,EAAE,IAAI,CAAC,OAAO,CAAC;SACrB;KACF,CACF,CAAC;IAEF,oBAAoB,CAAC,GAAG,QAAQ,CAAC,IAAI,uBAAuB,CAAC,CAAC;AAChE,CAAC","sourcesContent":["import { createApiClient } from \"../../common/api/client.js\";\nimport { printResultToConsole } from \"../../common/output.js\";\nimport { Arguments, Variable } from \"../models.js\";\n\nexport async function update(argv: Arguments) {\n const { account, project } = argv;\n const client = createApiClient({ authToken: argv.authToken });\n const variable = await client.patch<Variable>(\n `/v1/accounts/${account}/projects/${project}/branches/${encodeURIComponent(\n argv[\"branch\"]\n )}/variables/${encodeURIComponent(argv[\"name\"])}`,\n {\n operation: \"Failed to update variable\",\n errorMessage: \"Error: Failed to update variable. Check the arguments.\",\n body: {\n value: argv[\"value\"],\n },\n }\n );\n\n printResultToConsole(`${variable.name} updated successfully`);\n}\n"]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"handler.d.ts","sourceRoot":"","sources":["../../src/whoami/handler.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"handler.d.ts","sourceRoot":"","sources":["../../src/whoami/handler.ts"],"names":[],"mappings":"AAGA,MAAM,WAAW,SAAS;IACxB,SAAS,EAAE,MAAM,CAAC;CACnB;AAQD,wBAAsB,MAAM,CAAC,IAAI,EAAE,SAAS,iBAe3C"}
|
package/dist/whoami/handler.js
CHANGED
|
@@ -1,23 +1,11 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import {
|
|
3
|
-
import settings from "../common/settings.js";
|
|
1
|
+
import { createApiClient } from "../common/api/client.js";
|
|
2
|
+
import { printResultToConsoleAndExitGracefully } from "../common/output.js";
|
|
4
3
|
export async function whoami(argv) {
|
|
5
|
-
const
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
},
|
|
4
|
+
const client = createApiClient({ authToken: argv.authToken });
|
|
5
|
+
const data = await client.get("/v1/who-am-i", {
|
|
6
|
+
operation: "Failed to determine current user",
|
|
7
|
+
errorMessage: "Error: Failed to determine current user. Check your credentials.",
|
|
10
8
|
});
|
|
11
|
-
if (!response.ok) {
|
|
12
|
-
logger.error({
|
|
13
|
-
status: response.status,
|
|
14
|
-
statusText: response.statusText,
|
|
15
|
-
response: textOrJson(await response.text()),
|
|
16
|
-
}, "Failed to determine current user");
|
|
17
|
-
await printCriticalFailureToConsoleAndExit("Error: Failed to determine current user. Check your credentials.");
|
|
18
|
-
return;
|
|
19
|
-
}
|
|
20
|
-
const data = (await response.json());
|
|
21
9
|
const identity = data.email ? `${data.email} (${data.sub})` : data.sub;
|
|
22
10
|
const lines = [`Authenticated as ${identity}`];
|
|
23
11
|
if (data.account) {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"handler.js","sourceRoot":"","sources":["../../src/whoami/handler.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,
|
|
1
|
+
{"version":3,"file":"handler.js","sourceRoot":"","sources":["../../src/whoami/handler.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,eAAe,EAAE,MAAM,yBAAyB,CAAC;AAC1D,OAAO,EAAE,qCAAqC,EAAE,MAAM,qBAAqB,CAAC;AAY5E,MAAM,CAAC,KAAK,UAAU,MAAM,CAAC,IAAe;IAC1C,MAAM,MAAM,GAAG,eAAe,CAAC,EAAE,SAAS,EAAE,IAAI,CAAC,SAAS,EAAE,CAAC,CAAC;IAC9D,MAAM,IAAI,GAAG,MAAM,MAAM,CAAC,GAAG,CAAiB,cAAc,EAAE;QAC5D,SAAS,EAAE,kCAAkC;QAC7C,YAAY,EACV,kEAAkE;KACrE,CAAC,CAAC;IAEH,MAAM,QAAQ,GAAG,IAAI,CAAC,KAAK,CAAC,CAAC,CAAC,GAAG,IAAI,CAAC,KAAK,KAAK,IAAI,CAAC,GAAG,GAAG,CAAC,CAAC,CAAC,IAAI,CAAC,GAAG,CAAC;IACvE,MAAM,KAAK,GAAG,CAAC,oBAAoB,QAAQ,EAAE,CAAC,CAAC;IAC/C,IAAI,IAAI,CAAC,OAAO,EAAE,CAAC;QACjB,KAAK,CAAC,IAAI,CAAC,YAAY,IAAI,CAAC,OAAO,EAAE,CAAC,CAAC;IACzC,CAAC;IAED,MAAM,qCAAqC,CAAC,KAAK,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC,CAAC;AAChE,CAAC","sourcesContent":["import { createApiClient } from \"../common/api/client.js\";\nimport { printResultToConsoleAndExitGracefully } from \"../common/output.js\";\n\nexport interface Arguments {\n authToken: string;\n}\n\ninterface WhoAmIResponse {\n sub: string;\n account?: string;\n email?: string;\n}\n\nexport async function whoami(argv: Arguments) {\n const client = createApiClient({ authToken: argv.authToken });\n const data = await client.get<WhoAmIResponse>(\"/v1/who-am-i\", {\n operation: \"Failed to determine current user\",\n errorMessage:\n \"Error: Failed to determine current user. Check your credentials.\",\n });\n\n const identity = data.email ? `${data.email} (${data.sub})` : data.sub;\n const lines = [`Authenticated as ${identity}`];\n if (data.account) {\n lines.push(`Account: ${data.account}`);\n }\n\n await printResultToConsoleAndExitGracefully(lines.join(\"\\n\"));\n}\n"]}
|
|
@@ -17,10 +17,6 @@ and convert between IPv4 and IPv4-mapped IPv6 addresses.
|
|
|
17
17
|
|
|
18
18
|
`npm install ipaddr.js`
|
|
19
19
|
|
|
20
|
-
or
|
|
21
|
-
|
|
22
|
-
`bower install ipaddr.js`
|
|
23
|
-
|
|
24
20
|
## Older Node support
|
|
25
21
|
|
|
26
22
|
Use 2.x release for nodejs versions 10+.
|
|
@@ -56,7 +52,7 @@ IP address.
|
|
|
56
52
|
The `ipaddr.process` method works just like the `ipaddr.parse` one, but it
|
|
57
53
|
automatically converts IPv4-mapped IPv6 addresses to their IPv4 counterparts
|
|
58
54
|
before returning. It is useful when you have a Node.js instance listening
|
|
59
|
-
on an IPv6 socket, and the `net.
|
|
55
|
+
on an IPv6 socket, and the `net.ipv6.bindv6only` sysctl parameter (or its
|
|
60
56
|
equivalent on non-Linux OS) is set to 0. In this case, you can accept IPv4
|
|
61
57
|
connections on your IPv6-only socket, but the remote address will be mangled.
|
|
62
58
|
Use `ipaddr.process` method to automatically demangle it.
|
|
@@ -1 +1 @@
|
|
|
1
|
-
!function(t){!function(t){"use strict";const r="(0?\\d+|0x[a-f0-9]+)",e={fourOctet:new RegExp(`^${r}\\.${r}\\.${r}\\.${r}$`,"i"),threeOctet:new RegExp(`^${r}\\.${r}\\.${r}$`,"i"),twoOctet:new RegExp(`^${r}\\.${r}$`,"i"),longValue:new RegExp(`^${r}$`,"i")},n=new RegExp("^0[0-7]+$","i"),i=new RegExp("^0x[a-f0-9]+$","i"),o="(?:[0-9a-f]+::?)+",s={zoneIndex:new RegExp("%[0-9a-z]{1,}","i"),native:new RegExp(`^(::)?(${o})?([0-9a-f]+)?(::)?(%[0-9a-z]{1,})?$`,"i"),deprecatedTransitional:new RegExp(`^(?:::)(${r}\\.${r}\\.${r}\\.${r}(%[0-9a-z]{1,})?)$`,"i"),transitional:new RegExp(`^((?:${o})|(?:::)(?:${o})?)${r}\\.${r}\\.${r}\\.${r}(%[0-9a-z]{1,})?$`,"i")};function a(t,r){if(t.indexOf("::")!==t.lastIndexOf("::"))return null;let e,n,i=0,o=-1,a=(t.match(s.zoneIndex)||[])[0];for(a&&(a=a.substring(1),t=t.replace(/%.+$/,""));(o=t.indexOf(":",o+1))>=0;)i++;if("::"===t.substr(0,2)&&i--,"::"===t.substr(-2,2)&&i--,i>r)return null;for(n=r-i,e=":";n--;)e+="0:";return":"===(t=t.replace("::",e))[0]&&(t=t.slice(1)),":"===t[t.length-1]&&(t=t.slice(0,-1)),{parts:r=function(){const r=t.split(":"),e=[];for(let t=0;t<r.length;t++)e.push(parseInt(r[t],16));return e}(),zoneId:a}}function p(t,r,e,n){if(t.length!==r.length)throw new Error("ipaddr: cannot match CIDR for objects with different lengths");let i,o=0;for(;n>0;){if((i=e-n)<0&&(i=0),t[o]>>i!=r[o]>>i)return!1;n-=e,o+=1}return!0}function u(t){if(i.test(t))return parseInt(t,16);if("0"===t[0]&&!isNaN(parseInt(t[1],10))){if(n.test(t))return parseInt(t,8);throw new Error(`ipaddr: cannot parse ${t} as octal`)}return parseInt(t,10)}function d(t,r){for(;t.length<r;)t=`0${t}`;return t}const c={};c.IPv4=function(){function t(t){if(4!==t.length)throw new Error("ipaddr: ipv4 octet count should be 4");let r,e;for(r=0;r<t.length;r++)if(!(0<=(e=t[r])&&e<=255))throw new Error("ipaddr: ipv4 octet should fit in 8 bits");this.octets=t}return t.prototype.SpecialRanges={unspecified:[[new t([0,0,0,0]),8]],broadcast:[[new t([255,255,255,255]),32]],multicast:[[new t([224,0,0,0]),4]],linkLocal:[[new t([169,254,0,0]),16]],loopback:[[new t([127,0,0,0]),8]],carrierGradeNat:[[new t([100,64,0,0]),10]],private:[[new t([10,0,0,0]),8],[new t([172,16,0,0]),12],[new t([192,168,0,0]),16]],reserved:[[new t([192,0,0,0]),24],[new t([192,0,2,0]),24],[new t([192,88,99,0]),24],[new t([198,18,0,0]),15],[new t([198,51,100,0]),24],[new t([203,0,113,0]),24],[new t([240,0,0,0]),4]],as112:[[new t([192,175,48,0]),24],[new t([192,31,196,0]),24]],amt:[[new t([192,52,193,0]),24]]},t.prototype.kind=function(){return"ipv4"},t.prototype.match=function(t,r){let e;if(void 0===r&&(t=(e=t)[0],r=e[1]),"ipv4"!==t.kind())throw new Error("ipaddr: cannot match ipv4 address with non-ipv4 one");return p(this.octets,t.octets,8,r)},t.prototype.prefixLengthFromSubnetMask=function(){let t=0,r=!1;const e={0:8,128:7,192:6,224:5,240:4,248:3,252:2,254:1,255:0};let n,i,o;for(n=3;n>=0;n-=1){if(!((i=this.octets[n])in e))return null;if(o=e[i],r&&0!==o)return null;8!==o&&(r=!0),t+=o}return 32-t},t.prototype.range=function(){return c.subnetMatch(this,this.SpecialRanges)},t.prototype.toByteArray=function(){return this.octets.slice(0)},t.prototype.toIPv4MappedAddress=function(){return c.IPv6.parse(`::ffff:${this.toString()}`)},t.prototype.toNormalizedString=function(){return this.toString()},t.prototype.toString=function(){return this.octets.join(".")},t}(),c.IPv4.broadcastAddressFromCIDR=function(t){try{const r=this.parseCIDR(t),e=r[0].toByteArray(),n=this.subnetMaskFromPrefixLength(r[1]).toByteArray(),i=[];let o=0;for(;o<4;)i.push(parseInt(e[o],10)|255^parseInt(n[o],10)),o++;return new this(i)}catch(t){throw new Error("ipaddr: the address does not have IPv4 CIDR format")}},c.IPv4.isIPv4=function(t){return null!==this.parser(t)},c.IPv4.isValid=function(t){try{return new this(this.parser(t)),!0}catch(t){return!1}},c.IPv4.isValidCIDR=function(t){try{return this.parseCIDR(t),!0}catch(t){return!1}},c.IPv4.isValidFourPartDecimal=function(t){return!(!c.IPv4.isValid(t)||!t.match(/^(0|[1-9]\d*)(\.(0|[1-9]\d*)){3}$/))},c.IPv4.isValidCIDRFourPartDecimal=function(t){const r=t.match(/^(.+)\/(\d+)$/);return!(!c.IPv4.isValidCIDR(t)||!r)&&c.IPv4.isValidFourPartDecimal(r[1])},c.IPv4.networkAddressFromCIDR=function(t){let r,e,n,i,o;try{for(n=(r=this.parseCIDR(t))[0].toByteArray(),o=this.subnetMaskFromPrefixLength(r[1]).toByteArray(),i=[],e=0;e<4;)i.push(parseInt(n[e],10)&parseInt(o[e],10)),e++;return new this(i)}catch(t){throw new Error("ipaddr: the address does not have IPv4 CIDR format")}},c.IPv4.parse=function(t){const r=this.parser(t);if(null===r)throw new Error("ipaddr: string is not formatted like an IPv4 Address");return new this(r)},c.IPv4.parseCIDR=function(t){let r;if(r=t.match(/^(.+)\/(\d+)$/)){const t=parseInt(r[2]);if(t>=0&&t<=32){const e=[this.parse(r[1]),t];return Object.defineProperty(e,"toString",{value:function(){return this.join("/")}}),e}}throw new Error("ipaddr: string is not formatted like an IPv4 CIDR range")},c.IPv4.parser=function(t){let r,n,i;if(r=t.match(e.fourOctet))return function(){const t=r.slice(1,6),e=[];for(let r=0;r<t.length;r++)n=t[r],e.push(u(n));return e}();if(r=t.match(e.longValue)){if((i=u(r[1]))>4294967295||i<0)throw new Error("ipaddr: address outside defined range");return function(){const t=[];let r;for(r=0;r<=24;r+=8)t.push(i>>r&255);return t}().reverse()}return(r=t.match(e.twoOctet))?function(){const t=r.slice(1,4),e=[];if((i=u(t[1]))>16777215||i<0)throw new Error("ipaddr: address outside defined range");return e.push(u(t[0])),e.push(i>>16&255),e.push(i>>8&255),e.push(255&i),e}():(r=t.match(e.threeOctet))?function(){const t=r.slice(1,5),e=[];if((i=u(t[2]))>65535||i<0)throw new Error("ipaddr: address outside defined range");return e.push(u(t[0])),e.push(u(t[1])),e.push(i>>8&255),e.push(255&i),e}():null},c.IPv4.subnetMaskFromPrefixLength=function(t){if((t=parseInt(t))<0||t>32)throw new Error("ipaddr: invalid IPv4 prefix length");const r=[0,0,0,0];let e=0;const n=Math.floor(t/8);for(;e<n;)r[e]=255,e++;return n<4&&(r[n]=Math.pow(2,t%8)-1<<8-t%8),new this(r)},c.IPv6=function(){function t(t,r){let e,n;if(16===t.length)for(this.parts=[],e=0;e<=14;e+=2)this.parts.push(t[e]<<8|t[e+1]);else{if(8!==t.length)throw new Error("ipaddr: ipv6 part count should be 8 or 16");this.parts=t}for(e=0;e<this.parts.length;e++)if(!(0<=(n=this.parts[e])&&n<=65535))throw new Error("ipaddr: ipv6 part should fit in 16 bits");r&&(this.zoneId=r)}return t.prototype.SpecialRanges={unspecified:[new t([0,0,0,0,0,0,0,0]),128],linkLocal:[new t([65152,0,0,0,0,0,0,0]),10],multicast:[new t([65280,0,0,0,0,0,0,0]),8],loopback:[new t([0,0,0,0,0,0,0,1]),128],uniqueLocal:[new t([64512,0,0,0,0,0,0,0]),7],ipv4Mapped:[new t([0,0,0,0,0,65535,0,0]),96],discard:[new t([256,0,0,0,0,0,0,0]),64],rfc6145:[new t([0,0,0,0,65535,0,0,0]),96],rfc6052:[new t([100,65435,0,0,0,0,0,0]),96],"6to4":[new t([8194,0,0,0,0,0,0,0]),16],teredo:[new t([8193,0,0,0,0,0,0,0]),32],benchmarking:[new t([8193,2,0,0,0,0,0,0]),48],amt:[new t([8193,3,0,0,0,0,0,0]),32],as112v6:[[new t([8193,4,274,0,0,0,0,0]),48],[new t([9760,79,32768,0,0,0,0,0]),48]],deprecated:[new t([8193,16,0,0,0,0,0,0]),28],orchid2:[new t([8193,32,0,0,0,0,0,0]),28],droneRemoteIdProtocolEntityTags:[new t([8193,48,0,0,0,0,0,0]),28],reserved:[[new t([8193,0,0,0,0,0,0,0]),23],[new t([8193,3512,0,0,0,0,0,0]),32]]},t.prototype.isIPv4MappedAddress=function(){return"ipv4Mapped"===this.range()},t.prototype.kind=function(){return"ipv6"},t.prototype.match=function(t,r){let e;if(void 0===r&&(t=(e=t)[0],r=e[1]),"ipv6"!==t.kind())throw new Error("ipaddr: cannot match ipv6 address with non-ipv6 one");return p(this.parts,t.parts,16,r)},t.prototype.prefixLengthFromSubnetMask=function(){let t=0,r=!1;const e={0:16,32768:15,49152:14,57344:13,61440:12,63488:11,64512:10,65024:9,65280:8,65408:7,65472:6,65504:5,65520:4,65528:3,65532:2,65534:1,65535:0};let n,i;for(let o=7;o>=0;o-=1){if(!((n=this.parts[o])in e))return null;if(i=e[n],r&&0!==i)return null;16!==i&&(r=!0),t+=i}return 128-t},t.prototype.range=function(){return c.subnetMatch(this,this.SpecialRanges)},t.prototype.toByteArray=function(){let t;const r=[],e=this.parts;for(let n=0;n<e.length;n++)t=e[n],r.push(t>>8),r.push(255&t);return r},t.prototype.toFixedLengthString=function(){const t=function(){const t=[];for(let r=0;r<this.parts.length;r++)t.push(d(this.parts[r].toString(16),4));return t}.call(this).join(":");let r="";return this.zoneId&&(r=`%${this.zoneId}`),t+r},t.prototype.toIPv4Address=function(){if(!this.isIPv4MappedAddress())throw new Error("ipaddr: trying to convert a generic ipv6 address to ipv4");const t=this.parts.slice(-2),r=t[0],e=t[1];return new c.IPv4([r>>8,255&r,e>>8,255&e])},t.prototype.toNormalizedString=function(){const t=function(){const t=[];for(let r=0;r<this.parts.length;r++)t.push(this.parts[r].toString(16));return t}.call(this).join(":");let r="";return this.zoneId&&(r=`%${this.zoneId}`),t+r},t.prototype.toRFC5952String=function(){const t=/((^|:)(0(:|$)){2,})/g,r=this.toNormalizedString();let e,n=0,i=-1;for(;e=t.exec(r);)e[0].length>i&&(n=e.index,i=e[0].length);return i<0?r:`${r.substring(0,n)}::${r.substring(n+i)}`},t.prototype.toString=function(){return this.toRFC5952String()},t}(),c.IPv6.broadcastAddressFromCIDR=function(t){try{const r=this.parseCIDR(t),e=r[0].toByteArray(),n=this.subnetMaskFromPrefixLength(r[1]).toByteArray(),i=[];let o=0;for(;o<16;)i.push(parseInt(e[o],10)|255^parseInt(n[o],10)),o++;return new this(i)}catch(t){throw new Error(`ipaddr: the address does not have IPv6 CIDR format (${t})`)}},c.IPv6.isIPv6=function(t){return null!==this.parser(t)},c.IPv6.isValid=function(t){if("string"==typeof t&&-1===t.indexOf(":"))return!1;try{const r=this.parser(t);return new this(r.parts,r.zoneId),!0}catch(t){return!1}},c.IPv6.isValidCIDR=function(t){if("string"==typeof t&&-1===t.indexOf(":"))return!1;try{return this.parseCIDR(t),!0}catch(t){return!1}},c.IPv6.networkAddressFromCIDR=function(t){let r,e,n,i,o;try{for(n=(r=this.parseCIDR(t))[0].toByteArray(),o=this.subnetMaskFromPrefixLength(r[1]).toByteArray(),i=[],e=0;e<16;)i.push(parseInt(n[e],10)&parseInt(o[e],10)),e++;return new this(i)}catch(t){throw new Error(`ipaddr: the address does not have IPv6 CIDR format (${t})`)}},c.IPv6.parse=function(t){const r=this.parser(t);if(null===r.parts)throw new Error("ipaddr: string is not formatted like an IPv6 Address");return new this(r.parts,r.zoneId)},c.IPv6.parseCIDR=function(t){let r,e,n;if((e=t.match(/^(.+)\/(\d+)$/))&&(r=parseInt(e[2]))>=0&&r<=128)return n=[this.parse(e[1]),r],Object.defineProperty(n,"toString",{value:function(){return this.join("/")}}),n;throw new Error("ipaddr: string is not formatted like an IPv6 CIDR range")},c.IPv6.parser=function(t){let r,e,n,i,o,p;if(n=t.match(s.deprecatedTransitional))return this.parser(`::ffff:${n[1]}`);if(s.native.test(t))return a(t,8);if((n=t.match(s.transitional))&&(p=n[6]||"",r=n[1],n[1].endsWith("::")||(r=r.slice(0,-1)),(r=a(r+p,6)).parts)){for(o=[parseInt(n[2]),parseInt(n[3]),parseInt(n[4]),parseInt(n[5])],e=0;e<o.length;e++)if(!(0<=(i=o[e])&&i<=255))return null;return r.parts.push(o[0]<<8|o[1]),r.parts.push(o[2]<<8|o[3]),{parts:r.parts,zoneId:r.zoneId}}return null},c.IPv6.subnetMaskFromPrefixLength=function(t){if((t=parseInt(t))<0||t>128)throw new Error("ipaddr: invalid IPv6 prefix length");const r=[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0];let e=0;const n=Math.floor(t/8);for(;e<n;)r[e]=255,e++;return n<16&&(r[n]=Math.pow(2,t%8)-1<<8-t%8),new this(r)},c.fromByteArray=function(t){const r=t.length;if(4===r)return new c.IPv4(t);if(16===r)return new c.IPv6(t);throw new Error("ipaddr: the binary input is neither an IPv6 nor IPv4 address")},c.isValid=function(t){return c.IPv6.isValid(t)||c.IPv4.isValid(t)},c.isValidCIDR=function(t){return c.IPv6.isValidCIDR(t)||c.IPv4.isValidCIDR(t)},c.parse=function(t){if(c.IPv6.isValid(t))return c.IPv6.parse(t);if(c.IPv4.isValid(t))return c.IPv4.parse(t);throw new Error("ipaddr: the address has neither IPv6 nor IPv4 format")},c.parseCIDR=function(t){try{return c.IPv6.parseCIDR(t)}catch(r){try{return c.IPv4.parseCIDR(t)}catch(t){throw new Error("ipaddr: the address has neither IPv6 nor IPv4 CIDR format")}}},c.process=function(t){const r=this.parse(t);return"ipv6"===r.kind()&&r.isIPv4MappedAddress()?r.toIPv4Address():r},c.subnetMatch=function(t,r,e){let n,i,o,s;for(i in null==e&&(e="unicast"),r)if(Object.prototype.hasOwnProperty.call(r,i))for(!(o=r[i])[0]||o[0]instanceof Array||(o=[o]),n=0;n<o.length;n++)if(s=o[n],t.kind()===s[0].kind()&&t.match.apply(t,s))return i;return e},"undefined"!=typeof module&&module.exports?module.exports=c:t.ipaddr=c}(this)}("undefined"==typeof window?window={}:window);
|
|
1
|
+
!function(t){!function(t){"use strict";const r="(0?\\d+|0x[a-f0-9]+)",e={fourOctet:new RegExp(`^${r}\\.${r}\\.${r}\\.${r}$`,"i"),threeOctet:new RegExp(`^${r}\\.${r}\\.${r}$`,"i"),twoOctet:new RegExp(`^${r}\\.${r}$`,"i"),longValue:new RegExp(`^${r}$`,"i")},n=new RegExp("^0[0-7]+$","i"),i=new RegExp("^0x[a-f0-9]+$","i"),o="(?:[0-9a-f]+::?)+",s={zoneIndex:new RegExp("%[0-9a-z]{1,}","i"),native:new RegExp(`^(::)?(${o})?([0-9a-f]+)?(::)?(%[0-9a-z]{1,})?$`,"i"),deprecatedTransitional:new RegExp(`^(?:::)(${r}\\.${r}\\.${r}\\.${r}(%[0-9a-z]{1,})?)$`,"i"),transitional:new RegExp(`^((?:${o})|(?:::)(?:${o})?)${r}\\.${r}\\.${r}\\.${r}(%[0-9a-z]{1,})?$`,"i")};function a(t,r){if(t.indexOf("::")!==t.lastIndexOf("::"))return null;let e,n,i=0,o=-1,a=(t.match(s.zoneIndex)||[])[0];for(a&&(a=a.substring(1),t=t.replace(/%.+$/,""));(o=t.indexOf(":",o+1))>=0;)i++;if("::"===t.substr(0,2)&&i--,"::"===t.substr(-2,2)&&i--,i>r)return null;for(n=r-i,e=":";n--;)e+="0:";return":"===(t=t.replace("::",e))[0]&&(t=t.slice(1)),":"===t[t.length-1]&&(t=t.slice(0,-1)),{parts:r=function(){const r=t.split(":"),e=[];for(let t=0;t<r.length;t++)e.push(parseInt(r[t],16));return e}(),zoneId:a}}function p(t,r,e,n){if(t.length!==r.length)throw new Error("ipaddr: cannot match CIDR for objects with different lengths");let i,o=0;for(;n>0;){if((i=e-n)<0&&(i=0),t[o]>>i!=r[o]>>i)return!1;n-=e,o+=1}return!0}function u(t){if(i.test(t))return parseInt(t,16);if("0"===t[0]&&!isNaN(parseInt(t[1],10))){if(n.test(t))return parseInt(t,8);throw new Error(`ipaddr: cannot parse ${t} as octal`)}return parseInt(t,10)}function d(t,r){for(;t.length<r;)t=`0${t}`;return t}const c={};c.IPv4=function(){function t(t){if(4!==t.length)throw new Error("ipaddr: ipv4 octet count should be 4");let r,e;for(r=0;r<t.length;r++)if(!(0<=(e=t[r])&&e<=255))throw new Error("ipaddr: ipv4 octet should fit in 8 bits");this.octets=t}return t.prototype.SpecialRanges={unspecified:[[new t([0,0,0,0]),8]],broadcast:[[new t([255,255,255,255]),32]],multicast:[[new t([224,0,0,0]),4]],linkLocal:[[new t([169,254,0,0]),16]],loopback:[[new t([127,0,0,0]),8]],carrierGradeNat:[[new t([100,64,0,0]),10]],private:[[new t([10,0,0,0]),8],[new t([172,16,0,0]),12],[new t([192,168,0,0]),16]],reserved:[[new t([192,0,0,0]),24],[new t([192,0,2,0]),24],[new t([192,88,99,0]),24],[new t([198,18,0,0]),15],[new t([198,51,100,0]),24],[new t([203,0,113,0]),24],[new t([240,0,0,0]),4]],as112:[[new t([192,175,48,0]),24],[new t([192,31,196,0]),24]],amt:[[new t([192,52,193,0]),24]]},t.prototype.kind=function(){return"ipv4"},t.prototype.match=function(t,r){let e;if(void 0===r&&(t=(e=t)[0],r=e[1]),"ipv4"!==t.kind())throw new Error("ipaddr: cannot match ipv4 address with non-ipv4 one");return p(this.octets,t.octets,8,r)},t.prototype.prefixLengthFromSubnetMask=function(){let t=0,r=!1;const e={0:8,128:7,192:6,224:5,240:4,248:3,252:2,254:1,255:0};let n,i,o;for(n=3;n>=0;n-=1){if(!((i=this.octets[n])in e))return null;if(o=e[i],r&&0!==o)return null;8!==o&&(r=!0),t+=o}return 32-t},t.prototype.range=function(){return c.subnetMatch(this,this.SpecialRanges)},t.prototype.toByteArray=function(){return this.octets.slice(0)},t.prototype.toIPv4MappedAddress=function(){return c.IPv6.parse(`::ffff:${this.toString()}`)},t.prototype.toNormalizedString=function(){return this.toString()},t.prototype.toString=function(){return this.octets.join(".")},t}(),c.IPv4.broadcastAddressFromCIDR=function(t){try{const r=this.parseCIDR(t),e=r[0].toByteArray(),n=this.subnetMaskFromPrefixLength(r[1]).toByteArray(),i=[];let o=0;for(;o<4;)i.push(parseInt(e[o],10)|255^parseInt(n[o],10)),o++;return new this(i)}catch(t){throw new Error("ipaddr: the address does not have IPv4 CIDR format")}},c.IPv4.isIPv4=function(t){return null!==this.parser(t)},c.IPv4.isValid=function(t){try{return new this(this.parser(t)),!0}catch(t){return!1}},c.IPv4.isValidCIDR=function(t){try{return this.parseCIDR(t),!0}catch(t){return!1}},c.IPv4.isValidFourPartDecimal=function(t){return!(!c.IPv4.isValid(t)||!t.match(/^(0|[1-9]\d*)(\.(0|[1-9]\d*)){3}$/))},c.IPv4.isValidCIDRFourPartDecimal=function(t){const r=t.match(/^(.+)\/(\d+)$/);return!(!c.IPv4.isValidCIDR(t)||!r)&&c.IPv4.isValidFourPartDecimal(r[1])},c.IPv4.networkAddressFromCIDR=function(t){let r,e,n,i,o;try{for(n=(r=this.parseCIDR(t))[0].toByteArray(),o=this.subnetMaskFromPrefixLength(r[1]).toByteArray(),i=[],e=0;e<4;)i.push(parseInt(n[e],10)&parseInt(o[e],10)),e++;return new this(i)}catch(t){throw new Error("ipaddr: the address does not have IPv4 CIDR format")}},c.IPv4.parse=function(t){const r=this.parser(t);if(null===r)throw new Error("ipaddr: string is not formatted like an IPv4 Address");return new this(r)},c.IPv4.parseCIDR=function(t){let r;if(r=t.match(/^(.+)\/(\d+)$/)){const t=parseInt(r[2]);if(t>=0&&t<=32){const e=[this.parse(r[1]),t];return Object.defineProperty(e,"toString",{value:function(){return this.join("/")}}),e}}throw new Error("ipaddr: string is not formatted like an IPv4 CIDR range")},c.IPv4.parser=function(t){let r,n,i;if(r=t.match(e.fourOctet))return function(){const t=r.slice(1,6),e=[];for(let r=0;r<t.length;r++)n=t[r],e.push(u(n));return e}();if(r=t.match(e.longValue)){if((i=u(r[1]))>4294967295||i<0)throw new Error("ipaddr: address outside defined range");return function(){const t=[];let r;for(r=0;r<=24;r+=8)t.push(i>>r&255);return t}().reverse()}return(r=t.match(e.twoOctet))?function(){const t=r.slice(1,4),e=[];if((i=u(t[1]))>16777215||i<0)throw new Error("ipaddr: address outside defined range");return e.push(u(t[0])),e.push(i>>16&255),e.push(i>>8&255),e.push(255&i),e}():(r=t.match(e.threeOctet))?function(){const t=r.slice(1,5),e=[];if((i=u(t[2]))>65535||i<0)throw new Error("ipaddr: address outside defined range");return e.push(u(t[0])),e.push(u(t[1])),e.push(i>>8&255),e.push(255&i),e}():null},c.IPv4.subnetMaskFromPrefixLength=function(t){if((t=parseInt(t))<0||t>32)throw new Error("ipaddr: invalid IPv4 prefix length");const r=[0,0,0,0];let e=0;const n=Math.floor(t/8);for(;e<n;)r[e]=255,e++;return n<4&&(r[n]=Math.pow(2,t%8)-1<<8-t%8),new this(r)},c.IPv6=function(){function t(t,r){let e,n;if(16===t.length)for(this.parts=[],e=0;e<=14;e+=2)this.parts.push(t[e]<<8|t[e+1]);else{if(8!==t.length)throw new Error("ipaddr: ipv6 part count should be 8 or 16");this.parts=t}for(e=0;e<this.parts.length;e++)if(!(0<=(n=this.parts[e])&&n<=65535))throw new Error("ipaddr: ipv6 part should fit in 16 bits");r&&(this.zoneId=r)}return t.prototype.SpecialRanges={unspecified:[new t([0,0,0,0,0,0,0,0]),128],linkLocal:[new t([65152,0,0,0,0,0,0,0]),10],multicast:[new t([65280,0,0,0,0,0,0,0]),8],loopback:[new t([0,0,0,0,0,0,0,1]),128],uniqueLocal:[new t([64512,0,0,0,0,0,0,0]),7],ipv4Mapped:[new t([0,0,0,0,0,65535,0,0]),96],deprecatedSiteLocal:[new t([65216,0,0,0,0,0,0,0]),10],discard:[new t([256,0,0,0,0,0,0,0]),64],rfc6145:[new t([0,0,0,0,65535,0,0,0]),96],rfc6052:[[new t([100,65435,0,0,0,0,0,0]),96],[new t([100,65435,1,0,0,0,0,0]),48]],"6to4":[new t([8194,0,0,0,0,0,0,0]),16],teredo:[new t([8193,0,0,0,0,0,0,0]),32],benchmarking:[new t([8193,2,0,0,0,0,0,0]),48],amt:[new t([8193,3,0,0,0,0,0,0]),32],as112v6:[[new t([8193,4,274,0,0,0,0,0]),48],[new t([9760,79,32768,0,0,0,0,0]),48]],deprecatedOrchid:[new t([8193,16,0,0,0,0,0,0]),28],orchid2:[new t([8193,32,0,0,0,0,0,0]),28],droneRemoteIdProtocolEntityTags:[new t([8193,48,0,0,0,0,0,0]),28],segmentRouting:[new t([24320,0,0,0,0,0,0,0]),16],reserved:[[new t([8193,0,0,0,0,0,0,0]),23],[new t([8193,3512,0,0,0,0,0,0]),32],[new t([16383,0,0,0,0,0,0,0]),20]]},t.prototype.isIPv4MappedAddress=function(){return"ipv4Mapped"===this.range()},t.prototype.kind=function(){return"ipv6"},t.prototype.match=function(t,r){let e;if(void 0===r&&(t=(e=t)[0],r=e[1]),"ipv6"!==t.kind())throw new Error("ipaddr: cannot match ipv6 address with non-ipv6 one");return p(this.parts,t.parts,16,r)},t.prototype.prefixLengthFromSubnetMask=function(){let t=0,r=!1;const e={0:16,32768:15,49152:14,57344:13,61440:12,63488:11,64512:10,65024:9,65280:8,65408:7,65472:6,65504:5,65520:4,65528:3,65532:2,65534:1,65535:0};let n,i;for(let o=7;o>=0;o-=1){if(!((n=this.parts[o])in e))return null;if(i=e[n],r&&0!==i)return null;16!==i&&(r=!0),t+=i}return 128-t},t.prototype.range=function(){return c.subnetMatch(this,this.SpecialRanges)},t.prototype.toByteArray=function(){let t;const r=[],e=this.parts;for(let n=0;n<e.length;n++)t=e[n],r.push(t>>8),r.push(255&t);return r},t.prototype.toFixedLengthString=function(){const t=function(){const t=[];for(let r=0;r<this.parts.length;r++)t.push(d(this.parts[r].toString(16),4));return t}.call(this).join(":");let r="";return this.zoneId&&(r=`%${this.zoneId}`),t+r},t.prototype.toIPv4Address=function(){if(!this.isIPv4MappedAddress())throw new Error("ipaddr: trying to convert a generic ipv6 address to ipv4");const t=this.parts.slice(-2),r=t[0],e=t[1];return new c.IPv4([r>>8,255&r,e>>8,255&e])},t.prototype.toNormalizedString=function(){const t=function(){const t=[];for(let r=0;r<this.parts.length;r++)t.push(this.parts[r].toString(16));return t}.call(this).join(":");let r="";return this.zoneId&&(r=`%${this.zoneId}`),t+r},t.prototype.toRFC5952String=function(){const t=/((^|:)(0(:|$)){2,})/g,r=this.toNormalizedString();let e,n=0,i=-1;for(;e=t.exec(r);)e[0].length>i&&(n=e.index,i=e[0].length);return i<0?r:`${r.substring(0,n)}::${r.substring(n+i)}`},t.prototype.toString=function(){return this.toRFC5952String()},t}(),c.IPv6.broadcastAddressFromCIDR=function(t){try{const r=this.parseCIDR(t),e=r[0].toByteArray(),n=this.subnetMaskFromPrefixLength(r[1]).toByteArray(),i=[];let o=0;for(;o<16;)i.push(parseInt(e[o],10)|255^parseInt(n[o],10)),o++;return new this(i)}catch(t){throw new Error(`ipaddr: the address does not have IPv6 CIDR format (${t})`)}},c.IPv6.isIPv6=function(t){return null!==this.parser(t)},c.IPv6.isValid=function(t){if("string"==typeof t&&-1===t.indexOf(":"))return!1;try{const r=this.parser(t);return new this(r.parts,r.zoneId),!0}catch(t){return!1}},c.IPv6.isValidCIDR=function(t){if("string"==typeof t&&-1===t.indexOf(":"))return!1;try{return this.parseCIDR(t),!0}catch(t){return!1}},c.IPv6.networkAddressFromCIDR=function(t){let r,e,n,i,o;try{for(n=(r=this.parseCIDR(t))[0].toByteArray(),o=this.subnetMaskFromPrefixLength(r[1]).toByteArray(),i=[],e=0;e<16;)i.push(parseInt(n[e],10)&parseInt(o[e],10)),e++;return new this(i)}catch(t){throw new Error(`ipaddr: the address does not have IPv6 CIDR format (${t})`)}},c.IPv6.parse=function(t){const r=this.parser(t);if(null===r.parts)throw new Error("ipaddr: string is not formatted like an IPv6 Address");return new this(r.parts,r.zoneId)},c.IPv6.parseCIDR=function(t){let r,e,n;if((e=t.match(/^(.+)\/(\d+)$/))&&(r=parseInt(e[2]))>=0&&r<=128)return n=[this.parse(e[1]),r],Object.defineProperty(n,"toString",{value:function(){return this.join("/")}}),n;throw new Error("ipaddr: string is not formatted like an IPv6 CIDR range")},c.IPv6.parser=function(t){let r,e,n,i,o,p;if(n=t.match(s.deprecatedTransitional))return this.parser(`::ffff:${n[1]}`);if(s.native.test(t))return a(t,8);if((n=t.match(s.transitional))&&(p=n[6]||"",r=n[1],n[1].endsWith("::")||(r=r.slice(0,-1)),(r=a(r+p,6)).parts)){for(o=[parseInt(n[2]),parseInt(n[3]),parseInt(n[4]),parseInt(n[5])],e=0;e<o.length;e++)if(!(0<=(i=o[e])&&i<=255))return null;return r.parts.push(o[0]<<8|o[1]),r.parts.push(o[2]<<8|o[3]),{parts:r.parts,zoneId:r.zoneId}}return null},c.IPv6.subnetMaskFromPrefixLength=function(t){if((t=parseInt(t))<0||t>128)throw new Error("ipaddr: invalid IPv6 prefix length");const r=[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0];let e=0;const n=Math.floor(t/8);for(;e<n;)r[e]=255,e++;return n<16&&(r[n]=Math.pow(2,t%8)-1<<8-t%8),new this(r)},c.fromByteArray=function(t){const r=t.length;if(4===r)return new c.IPv4(t);if(16===r)return new c.IPv6(t);throw new Error("ipaddr: the binary input is neither an IPv6 nor IPv4 address")},c.isValid=function(t){return c.IPv6.isValid(t)||c.IPv4.isValid(t)},c.isValidCIDR=function(t){return c.IPv6.isValidCIDR(t)||c.IPv4.isValidCIDR(t)},c.parse=function(t){if(c.IPv6.isValid(t))return c.IPv6.parse(t);if(c.IPv4.isValid(t))return c.IPv4.parse(t);throw new Error("ipaddr: the address has neither IPv6 nor IPv4 format")},c.parseCIDR=function(t){try{return c.IPv6.parseCIDR(t)}catch(r){try{return c.IPv4.parseCIDR(t)}catch(t){throw new Error("ipaddr: the address has neither IPv6 nor IPv4 CIDR format")}}},c.process=function(t){const r=this.parse(t);return"ipv6"===r.kind()&&r.isIPv4MappedAddress()?r.toIPv4Address():r},c.subnetMatch=function(t,r,e){let n,i,o,s;for(i in void 0!==e&&null!==e||(e="unicast"),r)if(Object.prototype.hasOwnProperty.call(r,i))for(!(o=r[i])[0]||o[0]instanceof Array||(o=[o]),n=0;n<o.length;n++)if(s=o[n],t.kind()===s[0].kind()&&t.match.apply(t,s))return i;return e},"undefined"!=typeof module&&module.exports?module.exports=c:t.ipaddr=c}(this)}("undefined"==typeof window?window={}:window);
|