@zuplo/cli 6.69.3 → 6.69.5
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/confirm-linked-config.integration.test.d.ts +2 -0
- package/dist/__tests__/integration/confirm-linked-config.integration.test.d.ts.map +1 -0
- package/dist/__tests__/integration/confirm-linked-config.integration.test.js +202 -0
- package/dist/__tests__/integration/confirm-linked-config.integration.test.js.map +1 -0
- package/dist/__tests__/integration/info.integration.test.js +49 -2
- package/dist/__tests__/integration/info.integration.test.js.map +1 -1
- package/dist/__tests__/integration/jest-mocks-setup.js +29 -10
- package/dist/__tests__/integration/jest-mocks-setup.js.map +1 -1
- package/dist/__tests__/integration/linked-config-cascade.integration.test.js +36 -0
- package/dist/__tests__/integration/linked-config-cascade.integration.test.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/delete.d.ts.map +1 -1
- package/dist/cmds/delete.js +2 -0
- package/dist/cmds/delete.js.map +1 -1
- package/dist/cmds/deploy.d.ts.map +1 -1
- package/dist/cmds/deploy.js +2 -0
- package/dist/cmds/deploy.js.map +1 -1
- package/dist/cmds/link.d.ts.map +1 -1
- package/dist/cmds/link.js +2 -0
- package/dist/cmds/link.js.map +1 -1
- package/dist/cmds/list.d.ts.map +1 -1
- package/dist/cmds/list.js +2 -0
- package/dist/cmds/list.js.map +1 -1
- package/dist/cmds/mtls-certificates/create.d.ts.map +1 -1
- package/dist/cmds/mtls-certificates/create.js +2 -0
- package/dist/cmds/mtls-certificates/create.js.map +1 -1
- package/dist/cmds/mtls-certificates/delete.d.ts.map +1 -1
- package/dist/cmds/mtls-certificates/delete.js +2 -0
- package/dist/cmds/mtls-certificates/delete.js.map +1 -1
- package/dist/cmds/mtls-certificates/describe.d.ts.map +1 -1
- package/dist/cmds/mtls-certificates/describe.js +2 -0
- package/dist/cmds/mtls-certificates/describe.js.map +1 -1
- package/dist/cmds/mtls-certificates/disable.d.ts.map +1 -1
- package/dist/cmds/mtls-certificates/disable.js +2 -0
- package/dist/cmds/mtls-certificates/disable.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/mtls-certificates/list.d.ts.map +1 -1
- package/dist/cmds/mtls-certificates/list.js +2 -0
- package/dist/cmds/mtls-certificates/list.js.map +1 -1
- package/dist/cmds/mtls-certificates/update.d.ts.map +1 -1
- package/dist/cmds/mtls-certificates/update.js +2 -0
- package/dist/cmds/mtls-certificates/update.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/create.d.ts.map +1 -1
- package/dist/cmds/variable/create.js +2 -0
- package/dist/cmds/variable/create.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/cmds/variable/update.d.ts.map +1 -1
- package/dist/cmds/variable/update.js +2 -0
- package/dist/cmds/variable/update.js.map +1 -1
- 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/confirm-linked-config.d.ts +4 -0
- package/dist/common/middleware/confirm-linked-config.d.ts.map +1 -0
- package/dist/common/middleware/confirm-linked-config.js +30 -0
- package/dist/common/middleware/confirm-linked-config.js.map +1 -0
- 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/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/format-environment-type.d.ts +2 -0
- package/dist/common/utils/format-environment-type.d.ts.map +1 -0
- package/dist/common/utils/format-environment-type.js +12 -0
- package/dist/common/utils/format-environment-type.js.map +1 -0
- package/dist/common/utils/format-environment-type.test.d.ts +2 -0
- package/dist/common/utils/format-environment-type.test.d.ts.map +1 -0
- package/dist/common/utils/format-environment-type.test.js +32 -0
- package/dist/common/utils/format-environment-type.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 +6 -14
- 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/project/info/handler.d.ts.map +1 -1
- package/dist/project/info/handler.js +5 -1
- package/dist/project/info/handler.js.map +1 -1
- package/dist/tsconfig.tsbuildinfo +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
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"sort-environments-for-prompt.test.d.ts","sourceRoot":"","sources":["../../../src/common/utils/sort-environments-for-prompt.test.ts"],"names":[],"mappings":""}
|
|
@@ -0,0 +1,82 @@
|
|
|
1
|
+
import assert from "node:assert";
|
|
2
|
+
import { describe, it } from "node:test";
|
|
3
|
+
import { sortEnvironmentsForPrompt } from "./sort-environments-for-prompt.js";
|
|
4
|
+
function makeEnv(environmentType, name, branchName) {
|
|
5
|
+
return {
|
|
6
|
+
name,
|
|
7
|
+
accountName: "acme",
|
|
8
|
+
projectName: "my-project",
|
|
9
|
+
createdOn: null,
|
|
10
|
+
branchName: branchName ?? name,
|
|
11
|
+
environmentType,
|
|
12
|
+
};
|
|
13
|
+
}
|
|
14
|
+
describe("sortEnvironmentsForPrompt", () => {
|
|
15
|
+
it("orders working-copy first, then preview alpha, then production", () => {
|
|
16
|
+
const envs = [
|
|
17
|
+
makeEnv("production", "prod"),
|
|
18
|
+
makeEnv("preview", "staging-b"),
|
|
19
|
+
makeEnv("working_copy", "wc-1"),
|
|
20
|
+
makeEnv("preview", "staging-a"),
|
|
21
|
+
];
|
|
22
|
+
const result = sortEnvironmentsForPrompt(envs).map((e) => e.name);
|
|
23
|
+
assert.deepStrictEqual(result, ["wc-1", "staging-a", "staging-b", "prod"]);
|
|
24
|
+
});
|
|
25
|
+
it("sorts alphabetically within the same bucket", () => {
|
|
26
|
+
const envs = [
|
|
27
|
+
makeEnv("preview", "charlie"),
|
|
28
|
+
makeEnv("preview", "alpha"),
|
|
29
|
+
makeEnv("preview", "bravo"),
|
|
30
|
+
];
|
|
31
|
+
const result = sortEnvironmentsForPrompt(envs).map((e) => e.name);
|
|
32
|
+
assert.deepStrictEqual(result, ["alpha", "bravo", "charlie"]);
|
|
33
|
+
});
|
|
34
|
+
it("returns an empty array unchanged", () => {
|
|
35
|
+
assert.deepStrictEqual(sortEnvironmentsForPrompt([]), []);
|
|
36
|
+
});
|
|
37
|
+
it("treats every working-copy type spelling as the same bucket", () => {
|
|
38
|
+
const envs = [
|
|
39
|
+
makeEnv("production", "prod"),
|
|
40
|
+
makeEnv("development", "wc-c"),
|
|
41
|
+
makeEnv("working-copy", "wc-a"),
|
|
42
|
+
makeEnv("working_copy", "wc-b"),
|
|
43
|
+
];
|
|
44
|
+
const result = sortEnvironmentsForPrompt(envs).map((e) => e.name);
|
|
45
|
+
assert.deepStrictEqual(result, ["wc-a", "wc-b", "wc-c", "prod"]);
|
|
46
|
+
});
|
|
47
|
+
it("does not mutate the input array", () => {
|
|
48
|
+
const envs = [
|
|
49
|
+
makeEnv("production", "prod"),
|
|
50
|
+
makeEnv("working_copy", "wc"),
|
|
51
|
+
];
|
|
52
|
+
const before = envs.map((e) => e.name);
|
|
53
|
+
sortEnvironmentsForPrompt(envs);
|
|
54
|
+
assert.deepStrictEqual(envs.map((e) => e.name), before);
|
|
55
|
+
});
|
|
56
|
+
it("sorts preview/production rows by branchName (the visible label), not slug", () => {
|
|
57
|
+
const envs = [
|
|
58
|
+
makeEnv("preview", "env-test-zzz", "apple"),
|
|
59
|
+
makeEnv("preview", "env-test-aaa", "zebra"),
|
|
60
|
+
makeEnv("preview", "env-test-mmm", "mango"),
|
|
61
|
+
];
|
|
62
|
+
const result = sortEnvironmentsForPrompt(envs).map((e) => e.branchName);
|
|
63
|
+
assert.deepStrictEqual(result, ["apple", "mango", "zebra"]);
|
|
64
|
+
});
|
|
65
|
+
it("falls back to env.name when a preview env has no branchName", () => {
|
|
66
|
+
const envs = [
|
|
67
|
+
makeEnv("preview", "alpha-slug", "zebra"),
|
|
68
|
+
makeEnv("preview", "bravo-slug", ""),
|
|
69
|
+
];
|
|
70
|
+
const result = sortEnvironmentsForPrompt(envs).map((e) => e.name);
|
|
71
|
+
assert.deepStrictEqual(result, ["bravo-slug", "alpha-slug"]);
|
|
72
|
+
});
|
|
73
|
+
it("sorts working-copy rows by env.name (their visible label)", () => {
|
|
74
|
+
const envs = [
|
|
75
|
+
makeEnv("working_copy", "wc-zebra", "main"),
|
|
76
|
+
makeEnv("working_copy", "wc-apple", "main"),
|
|
77
|
+
];
|
|
78
|
+
const result = sortEnvironmentsForPrompt(envs).map((e) => e.name);
|
|
79
|
+
assert.deepStrictEqual(result, ["wc-apple", "wc-zebra"]);
|
|
80
|
+
});
|
|
81
|
+
});
|
|
82
|
+
//# sourceMappingURL=sort-environments-for-prompt.test.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"sort-environments-for-prompt.test.js","sourceRoot":"","sources":["../../../src/common/utils/sort-environments-for-prompt.test.ts"],"names":[],"mappings":"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","sourcesContent":["import assert from \"node:assert\";\nimport { describe, it } from \"node:test\";\nimport { Environment } from \"../api/lib.js\";\nimport { sortEnvironmentsForPrompt } from \"./sort-environments-for-prompt.js\";\n\nfunction makeEnv(\n environmentType: Environment[\"environmentType\"],\n name: string,\n branchName?: string\n): Environment {\n return {\n name,\n accountName: \"acme\",\n projectName: \"my-project\",\n createdOn: null,\n // Mirror real preview-env data where branchName matches what the user\n // typed at deploy time. Tests can override explicitly when they need to.\n branchName: branchName ?? name,\n environmentType,\n };\n}\n\ndescribe(\"sortEnvironmentsForPrompt\", () => {\n it(\"orders working-copy first, then preview alpha, then production\", () => {\n const envs: Environment[] = [\n makeEnv(\"production\", \"prod\"),\n makeEnv(\"preview\", \"staging-b\"),\n makeEnv(\"working_copy\", \"wc-1\"),\n makeEnv(\"preview\", \"staging-a\"),\n ];\n\n const result = sortEnvironmentsForPrompt(envs).map((e) => e.name);\n\n assert.deepStrictEqual(result, [\"wc-1\", \"staging-a\", \"staging-b\", \"prod\"]);\n });\n\n it(\"sorts alphabetically within the same bucket\", () => {\n const envs: Environment[] = [\n makeEnv(\"preview\", \"charlie\"),\n makeEnv(\"preview\", \"alpha\"),\n makeEnv(\"preview\", \"bravo\"),\n ];\n\n const result = sortEnvironmentsForPrompt(envs).map((e) => e.name);\n\n assert.deepStrictEqual(result, [\"alpha\", \"bravo\", \"charlie\"]);\n });\n\n it(\"returns an empty array unchanged\", () => {\n assert.deepStrictEqual(sortEnvironmentsForPrompt([]), []);\n });\n\n it(\"treats every working-copy type spelling as the same bucket\", () => {\n const envs: Environment[] = [\n makeEnv(\"production\", \"prod\"),\n makeEnv(\"development\", \"wc-c\"),\n makeEnv(\"working-copy\", \"wc-a\"),\n makeEnv(\"working_copy\", \"wc-b\"),\n ];\n\n const result = sortEnvironmentsForPrompt(envs).map((e) => e.name);\n\n assert.deepStrictEqual(result, [\"wc-a\", \"wc-b\", \"wc-c\", \"prod\"]);\n });\n\n it(\"does not mutate the input array\", () => {\n const envs: Environment[] = [\n makeEnv(\"production\", \"prod\"),\n makeEnv(\"working_copy\", \"wc\"),\n ];\n const before = envs.map((e) => e.name);\n\n sortEnvironmentsForPrompt(envs);\n\n assert.deepStrictEqual(\n envs.map((e) => e.name),\n before\n );\n });\n\n it(\"sorts preview/production rows by branchName (the visible label), not slug\", () => {\n const envs: Environment[] = [\n makeEnv(\"preview\", \"env-test-zzz\", \"apple\"),\n makeEnv(\"preview\", \"env-test-aaa\", \"zebra\"),\n makeEnv(\"preview\", \"env-test-mmm\", \"mango\"),\n ];\n\n const result = sortEnvironmentsForPrompt(envs).map((e) => e.branchName);\n\n assert.deepStrictEqual(result, [\"apple\", \"mango\", \"zebra\"]);\n });\n\n it(\"falls back to env.name when a preview env has no branchName\", () => {\n const envs: Environment[] = [\n makeEnv(\"preview\", \"alpha-slug\", \"zebra\"),\n makeEnv(\"preview\", \"bravo-slug\", \"\"),\n ];\n\n const result = sortEnvironmentsForPrompt(envs).map((e) => e.name);\n\n // bravo-slug has empty branchName so falls back to its slug \"bravo-slug\",\n // which sorts before \"zebra\".\n assert.deepStrictEqual(result, [\"bravo-slug\", \"alpha-slug\"]);\n });\n\n it(\"sorts working-copy rows by env.name (their visible label)\", () => {\n const envs: Environment[] = [\n makeEnv(\"working_copy\", \"wc-zebra\", \"main\"),\n makeEnv(\"working_copy\", \"wc-apple\", \"main\"),\n ];\n\n const result = sortEnvironmentsForPrompt(envs).map((e) => e.name);\n\n assert.deepStrictEqual(result, [\"wc-apple\", \"wc-zebra\"]);\n });\n});\n"]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"handler.d.ts","sourceRoot":"","sources":["../../../src/project/info/handler.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"handler.d.ts","sourceRoot":"","sources":["../../../src/project/info/handler.ts"],"names":[],"mappings":"AAaA,MAAM,WAAW,SAAU,SAAQ,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC;IACxD,SAAS,EAAE,MAAM,CAAC;IAClB,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,GAAG,CAAC,EAAE,MAAM,CAAC;CACd;AAQD,wBAAsB,IAAI,CAAC,IAAI,EAAE,SAAS,iBA8IzC"}
|
|
@@ -2,6 +2,7 @@ import { logger } from "../../common/logger.js";
|
|
|
2
2
|
import { printCriticalFailureToConsoleAndExit, printResultToConsoleAndExitGracefully, printWarningToConsole, textOrJson, } from "../../common/output.js";
|
|
3
3
|
import { readLinkedConfig } from "../../common/read-linked-config.js";
|
|
4
4
|
import settings from "../../common/settings.js";
|
|
5
|
+
import { formatEnvironmentTypeLabel } from "../../common/utils/format-environment-type.js";
|
|
5
6
|
const PORTAL_BASE_URL = "https://portal.zuplo.com";
|
|
6
7
|
export async function info(argv) {
|
|
7
8
|
const lines = [];
|
|
@@ -86,7 +87,10 @@ export async function info(argv) {
|
|
|
86
87
|
lines.push(`Account: ${account}`);
|
|
87
88
|
lines.push(`Portal: ${PORTAL_BASE_URL}/${account}/${project}`);
|
|
88
89
|
if (linked.environmentType) {
|
|
89
|
-
|
|
90
|
+
const environmentTypeLabel = formatEnvironmentTypeLabel(linked.environmentType);
|
|
91
|
+
if (environmentTypeLabel) {
|
|
92
|
+
lines.push(`Environment Type: ${environmentTypeLabel}`);
|
|
93
|
+
}
|
|
90
94
|
}
|
|
91
95
|
const projectNotFound = !fetchFailed && response?.ok === true && !projectData;
|
|
92
96
|
if (!fetchFailed && !projectNotFound) {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"handler.js","sourceRoot":"","sources":["../../../src/project/info/handler.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,MAAM,EAAE,MAAM,wBAAwB,CAAC;AAChD,OAAO,EACL,oCAAoC,EACpC,qCAAqC,EACrC,qBAAqB,EACrB,UAAU,GACX,MAAM,wBAAwB,CAAC;AAChC,OAAO,EAAE,gBAAgB,EAAE,MAAM,oCAAoC,CAAC;AACtE,OAAO,QAAQ,MAAM,0BAA0B,CAAC;
|
|
1
|
+
{"version":3,"file":"handler.js","sourceRoot":"","sources":["../../../src/project/info/handler.ts"],"names":[],"mappings":"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","sourcesContent":["import { logger } from \"../../common/logger.js\";\nimport {\n printCriticalFailureToConsoleAndExit,\n printResultToConsoleAndExitGracefully,\n printWarningToConsole,\n textOrJson,\n} from \"../../common/output.js\";\nimport { readLinkedConfig } from \"../../common/read-linked-config.js\";\nimport settings from \"../../common/settings.js\";\nimport { formatEnvironmentTypeLabel } from \"../../common/utils/format-environment-type.js\";\n\nconst PORTAL_BASE_URL = \"https://portal.zuplo.com\";\n\nexport interface Arguments extends Record<string, unknown> {\n authToken: string;\n \"api-key\"?: string;\n dir?: string;\n}\n\ninterface ProjectListItem {\n name: string;\n sourceRepoUrl: string | null;\n sourceControlProvider: string;\n}\n\nexport async function info(argv: Arguments) {\n const lines: string[] = [];\n\n // 1. Read linked config from .env.zuplo\n const linked = await readLinkedConfig(argv);\n\n // If no linked project, show guidance and exit\n if (!linked.accountName || !linked.projectName) {\n lines.push(\"No project linked. Run `zuplo link` to connect a project.\");\n await printResultToConsoleAndExitGracefully(lines.join(\"\\n\"));\n return;\n }\n\n const account = linked.accountName;\n const project = linked.projectName;\n\n // 2. Fetch project details from the projects list API for source control info\n let projectData: ProjectListItem | undefined;\n let fetchFailed = false;\n let response: Response | undefined;\n try {\n const projectsUrl = new URL(\n `${settings.ZUPLO_DEVELOPER_API_ENDPOINT}/v1/projects`\n );\n projectsUrl.searchParams.set(\"accountName\", account);\n response = await fetch(projectsUrl, {\n method: \"GET\",\n headers: {\n // biome-ignore lint/style/useNamingConvention: External API property\n Authorization: `Bearer ${argv.authToken}`,\n },\n });\n } catch (error) {\n logger.debug(error, \"Failed to fetch project details\");\n fetchFailed = true;\n }\n\n if (response?.status === 401) {\n let body = \"<unavailable>\";\n try {\n body = await response.text();\n } catch (error) {\n logger.debug(error, \"Failed to read response body\");\n }\n logger.debug(\n {\n status: response.status,\n statusText: response.statusText,\n response: textOrJson(body),\n },\n \"Failed to fetch project details\"\n );\n const message = argv[\"api-key\"]\n ? \"The provided --api-key was rejected. Check that it is valid and not expired, or run `zuplo login` to authenticate interactively.\"\n : \"Your saved credentials were rejected. They may be expired — run `zuplo login` to re-authenticate, or pass a valid --api-key.\";\n await printCriticalFailureToConsoleAndExit(message);\n return;\n }\n\n if (response?.ok) {\n try {\n const body = (await response.json()) as {\n data?: ProjectListItem[];\n };\n if (!Array.isArray(body.data)) {\n throw new Error(\"Projects API response did not include a data array\");\n }\n logger.debug(\n { projects: body.data, linkedProject: project },\n \"Projects API response\"\n );\n projectData = body.data.find((p) => p.name === project);\n } catch (error) {\n logger.debug(error, \"Failed to parse project details response\");\n fetchFailed = true;\n }\n } else if (response) {\n let body = \"<unavailable>\";\n try {\n body = await response.text();\n } catch (error) {\n logger.debug(error, \"Failed to read response body\");\n }\n logger.debug(\n {\n status: response.status,\n statusText: response.statusText,\n response: textOrJson(body),\n },\n \"Failed to fetch project details\"\n );\n // Treat 4xx (other than 401) as hard errors — they indicate a problem the\n // user must fix (bad account, missing permission, rate limit). 5xx falls\n // through to a transient warn+fallback below.\n if (response.status >= 400 && response.status < 500) {\n await printCriticalFailureToConsoleAndExit(\n `The Zuplo API returned ${response.status} ${response.statusText}. Verify the account \"${account}\" and your credentials.`\n );\n return;\n }\n fetchFailed = true;\n }\n\n // 3. Build the output\n lines.push(`Project: ${project}`);\n lines.push(`Account: ${account}`);\n lines.push(`Portal: ${PORTAL_BASE_URL}/${account}/${project}`);\n\n if (linked.environmentType) {\n const environmentTypeLabel = formatEnvironmentTypeLabel(\n linked.environmentType\n );\n if (environmentTypeLabel) {\n lines.push(`Environment Type: ${environmentTypeLabel}`);\n }\n }\n\n const projectNotFound = !fetchFailed && response?.ok === true && !projectData;\n\n // Source control info — only show when we successfully found the project\n if (!fetchFailed && !projectNotFound) {\n const sourceControlSettingsUrl = `${PORTAL_BASE_URL}/${account}/${project}/settings/source-control-settings`;\n if (projectData?.sourceRepoUrl) {\n lines.push(`Source Control: ${projectData.sourceRepoUrl}`);\n } else {\n lines.push(\n `Source Control: none, connect at ${sourceControlSettingsUrl}`\n );\n }\n }\n\n if (fetchFailed) {\n printWarningToConsole(\n \"Unable to fetch project details, some information may be missing\"\n );\n } else if (projectNotFound) {\n printWarningToConsole(\n `Project \"${project}\" was not found in account \"${account}\". Run \\`zuplo link\\` to link a project.`\n );\n }\n\n await printResultToConsoleAndExitGracefully(lines.join(\"\\n\"));\n}\n"]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"root":["../src/cli.ts","../src/internal.ts","../src/types.d.ts","../src/__tests__/archive-utils.test.ts","../src/__tests__/import-openapi.test.ts","../src/__tests__/outdated.test.ts","../src/__tests__/populate.test.ts","../src/__tests__/tsconfig-upgrader.test.ts","../src/__tests__/integration/custom-domain.integration.test.ts","../src/__tests__/integration/delete.integration.test.ts","../src/__tests__/integration/deploy.integration.test.ts","../src/__tests__/integration/get-project-param.integration.test.ts","../src/__tests__/integration/info.integration.test.ts","../src/__tests__/integration/jest-mocks-setup.ts","../src/__tests__/integration/jest-setup.ts","../src/__tests__/integration/link.integration.test.ts","../src/__tests__/integration/linked-config-cascade.integration.test.ts","../src/__tests__/integration/list.integration.test.ts","../src/__tests__/integration/test-utils.ts","../src/__tests__/integration/tunnel.integration.test.ts","../src/__tests__/integration/variable.integration.test.ts","../src/__tests__/integration/whoami.integration.test.ts","../src/build/handler.ts","../src/cmds/build.ts","../src/cmds/compile.ts","../src/cmds/delete.ts","../src/cmds/deploy.ts","../src/cmds/dev.ts","../src/cmds/docs.ts","../src/cmds/editor.ts","../src/cmds/info.ts","../src/cmds/init.ts","../src/cmds/link.ts","../src/cmds/list.ts","../src/cmds/login.ts","../src/cmds/test.ts","../src/cmds/whoami.ts","../src/cmds/custom-domain/create.ts","../src/cmds/custom-domain/delete.ts","../src/cmds/custom-domain/index.ts","../src/cmds/custom-domain/list.ts","../src/cmds/custom-domain/update.ts","../src/cmds/mtls-certificates/create.ts","../src/cmds/mtls-certificates/delete.ts","../src/cmds/mtls-certificates/describe.ts","../src/cmds/mtls-certificates/disable.ts","../src/cmds/mtls-certificates/index.ts","../src/cmds/mtls-certificates/list.ts","../src/cmds/mtls-certificates/update.ts","../src/cmds/open-api/convert.ts","../src/cmds/open-api/index.ts","../src/cmds/open-api/merge.ts","../src/cmds/open-api/overlay.ts","../src/cmds/project/create.ts","../src/cmds/project/index.ts","../src/cmds/project/info.ts","../src/cmds/proxies/create.ts","../src/cmds/proxies/delete.ts","../src/cmds/proxies/describe.ts","../src/cmds/proxies/index.ts","../src/cmds/proxies/update.ts","../src/cmds/source/import-openapi.ts","../src/cmds/source/index.ts","../src/cmds/source/migrate.ts","../src/cmds/source/upgrade.ts","../src/cmds/tunnel/create.ts","../src/cmds/tunnel/delete.ts","../src/cmds/tunnel/describe.ts","../src/cmds/tunnel/index.ts","../src/cmds/tunnel/list.ts","../src/cmds/tunnel/rotate-token.ts","../src/cmds/tunnel/services/describe.ts","../src/cmds/tunnel/services/index.ts","../src/cmds/tunnel/services/update.ts","../src/cmds/variable/create.ts","../src/cmds/variable/index.ts","../src/cmds/variable/update.ts","../src/common/alias.ts","../src/common/args.ts","../src/common/constants.ts","../src/common/handler.ts","../src/common/logger.ts","../src/common/models.ts","../src/common/outdated.ts","../src/common/output.ts","../src/common/populate.ts","../src/common/read-linked-config.test.ts","../src/common/read-linked-config.ts","../src/common/runner.ts","../src/common/settings.ts","../src/common/terminal.test.ts","../src/common/terminal.ts","../src/common/worker-output.ts","../src/common/analytics/lib.ts","../src/common/api/lib.ts","../src/common/machine-id/lib.ts","../src/common/middleware/authentication.ts","../src/common/middleware/get-account-param.ts","../src/common/middleware/get-environment-param.ts","../src/common/middleware/get-project-param.ts","../src/common/middleware/logging.ts","../src/common/middleware/user-configuration.ts","../src/common/middleware/user-identification.ts","../src/common/middleware/validate-fleet.ts","../src/common/upgraders/lib.ts","../src/common/upgraders/package-json-upgrader.ts","../src/common/upgraders/tsconfig-upgrader.ts","../src/common/upgraders/vscode-settings-json-upgrader.ts","../src/common/utils/box.ts","../src/common/utils/branch.ts","../src/common/utils/ports.ts","../src/common/utils/prefixed-output.ts","../src/common/utils/pretty-print-environment-prompt.test.ts","../src/common/utils/pretty-print-environment-prompt.ts","../src/common/utils/stringify-config.test.ts","../src/common/utils/stringify-config.ts","../src/common/utils/types.ts","../src/common/utils/urls.ts","../src/common/validators/argument-validators.spec.ts","../src/common/validators/argument-validators.ts","../src/common/validators/file-system-validator.ts","../src/common/validators/lib.ts","../src/common/validators/project-name-validator.ts","../src/common/xdg/lib.ts","../src/compile/handler.ts","../src/custom-domain/models.ts","../src/custom-domain/create/handler.ts","../src/custom-domain/delete/handler.ts","../src/custom-domain/list/handler.ts","../src/custom-domain/update/handler.ts","../src/delete/handler.ts","../src/delete/poll-deployment.ts","../src/deploy/archive.local-registry.test.ts","../src/deploy/archive.test.ts","../src/deploy/archive.ts","../src/deploy/environments.ts","../src/deploy/file-upload.ts","../src/deploy/handler.ts","../src/deploy/poll-deployment.ts","../src/dev/handler.ts","../src/docs/handler.ts","../src/editor/handler.ts","../src/editor/e2e/editor.spec.ts","../src/init/handler.ts","../src/link/handler.ts","../src/list/handler.ts","../src/login/login.ts","../src/login/tokens.ts","../src/mtls-certificates/models.ts","../src/mtls-certificates/create/handler.ts","../src/mtls-certificates/delete/handler.ts","../src/mtls-certificates/describe/handler.ts","../src/mtls-certificates/disable/handler.ts","../src/mtls-certificates/list/handler.ts","../src/mtls-certificates/update/handler.ts","../src/open-api/convert/handler.spec.ts","../src/open-api/convert/handler.ts","../src/open-api/merge/handler.spec.ts","../src/open-api/merge/handler.ts","../src/open-api/overlay/handler.spec.ts","../src/open-api/overlay/handler.ts","../src/project/create/handler.ts","../src/project/info/handler.ts","../src/proxies/models.ts","../src/proxies/create/handler.ts","../src/proxies/delete/handler.ts","../src/proxies/describe/handler.ts","../src/proxies/update/handler.ts","../src/source/migrate/dev-portal/handler.ts","../src/source/migrate/dev-portal/types.ts","../src/source/update/handler.ts","../src/test/esbuild-config.ts","../src/test/handler.ts","../src/test/invoke-test.ts","../src/test/test-files.test.ts","../src/test/test-files.ts","../src/test/esbuild-plugins/node-test-prep-plugin.ts","../src/tunnel/models.ts","../src/tunnel/create/handler.ts","../src/tunnel/delete/handler.ts","../src/tunnel/delete/poll-teardown-operation.ts","../src/tunnel/describe/handler.ts","../src/tunnel/list/handler.ts","../src/tunnel/rotate-token/handler.ts","../src/tunnel/services/describe/handler.ts","../src/tunnel/services/update/handler.ts","../src/tunnel/services/update/poll-provisioning-operations.ts","../src/variable/models.ts","../src/variable/create/handler.ts","../src/variable/update/handler.ts","../src/whoami/handler.ts"],"version":"5.8.2"}
|
|
1
|
+
{"root":["../src/cli.ts","../src/internal.ts","../src/types.d.ts","../src/__tests__/archive-utils.test.ts","../src/__tests__/import-openapi.test.ts","../src/__tests__/outdated.test.ts","../src/__tests__/populate.test.ts","../src/__tests__/tsconfig-upgrader.test.ts","../src/__tests__/integration/confirm-linked-config.integration.test.ts","../src/__tests__/integration/custom-domain.integration.test.ts","../src/__tests__/integration/delete.integration.test.ts","../src/__tests__/integration/deploy.integration.test.ts","../src/__tests__/integration/get-project-param.integration.test.ts","../src/__tests__/integration/info.integration.test.ts","../src/__tests__/integration/jest-mocks-setup.ts","../src/__tests__/integration/jest-setup.ts","../src/__tests__/integration/link.integration.test.ts","../src/__tests__/integration/linked-config-cascade.integration.test.ts","../src/__tests__/integration/list.integration.test.ts","../src/__tests__/integration/test-utils.ts","../src/__tests__/integration/tunnel.integration.test.ts","../src/__tests__/integration/variable.integration.test.ts","../src/__tests__/integration/whoami.integration.test.ts","../src/build/handler.ts","../src/cmds/build.ts","../src/cmds/compile.ts","../src/cmds/delete.ts","../src/cmds/deploy.ts","../src/cmds/dev.ts","../src/cmds/docs.ts","../src/cmds/editor.ts","../src/cmds/info.ts","../src/cmds/init.ts","../src/cmds/link.ts","../src/cmds/list.ts","../src/cmds/login.ts","../src/cmds/test.ts","../src/cmds/whoami.ts","../src/cmds/custom-domain/create.ts","../src/cmds/custom-domain/delete.ts","../src/cmds/custom-domain/index.ts","../src/cmds/custom-domain/list.ts","../src/cmds/custom-domain/update.ts","../src/cmds/mtls-certificates/create.ts","../src/cmds/mtls-certificates/delete.ts","../src/cmds/mtls-certificates/describe.ts","../src/cmds/mtls-certificates/disable.ts","../src/cmds/mtls-certificates/index.ts","../src/cmds/mtls-certificates/list.ts","../src/cmds/mtls-certificates/update.ts","../src/cmds/open-api/convert.ts","../src/cmds/open-api/index.ts","../src/cmds/open-api/merge.ts","../src/cmds/open-api/overlay.ts","../src/cmds/project/create.ts","../src/cmds/project/index.ts","../src/cmds/project/info.ts","../src/cmds/proxies/create.ts","../src/cmds/proxies/delete.ts","../src/cmds/proxies/describe.ts","../src/cmds/proxies/index.ts","../src/cmds/proxies/update.ts","../src/cmds/source/import-openapi.ts","../src/cmds/source/index.ts","../src/cmds/source/migrate.ts","../src/cmds/source/upgrade.ts","../src/cmds/tunnel/create.ts","../src/cmds/tunnel/delete.ts","../src/cmds/tunnel/describe.ts","../src/cmds/tunnel/index.ts","../src/cmds/tunnel/list.ts","../src/cmds/tunnel/rotate-token.ts","../src/cmds/tunnel/services/describe.ts","../src/cmds/tunnel/services/index.ts","../src/cmds/tunnel/services/update.ts","../src/cmds/variable/create.ts","../src/cmds/variable/index.ts","../src/cmds/variable/update.ts","../src/common/alias.ts","../src/common/args.ts","../src/common/constants.ts","../src/common/handler.ts","../src/common/logger.ts","../src/common/models.ts","../src/common/outdated.ts","../src/common/output.ts","../src/common/populate.ts","../src/common/read-linked-config.test.ts","../src/common/read-linked-config.ts","../src/common/runner.ts","../src/common/settings.ts","../src/common/terminal.test.ts","../src/common/terminal.ts","../src/common/worker-output.ts","../src/common/analytics/lib.ts","../src/common/api/lib.ts","../src/common/machine-id/lib.ts","../src/common/middleware/authentication.ts","../src/common/middleware/confirm-linked-config.ts","../src/common/middleware/get-account-param.ts","../src/common/middleware/get-environment-param.ts","../src/common/middleware/get-project-param.ts","../src/common/middleware/logging.ts","../src/common/middleware/user-configuration.ts","../src/common/middleware/user-identification.ts","../src/common/middleware/validate-fleet.ts","../src/common/upgraders/lib.ts","../src/common/upgraders/package-json-upgrader.ts","../src/common/upgraders/tsconfig-upgrader.ts","../src/common/upgraders/vscode-settings-json-upgrader.ts","../src/common/utils/box.ts","../src/common/utils/branch.ts","../src/common/utils/build-environment-prompt-choices.test.ts","../src/common/utils/build-environment-prompt-choices.ts","../src/common/utils/format-environment-type.test.ts","../src/common/utils/format-environment-type.ts","../src/common/utils/ports.ts","../src/common/utils/prefixed-output.ts","../src/common/utils/pretty-print-environment-prompt.test.ts","../src/common/utils/pretty-print-environment-prompt.ts","../src/common/utils/sort-environments-for-prompt.test.ts","../src/common/utils/sort-environments-for-prompt.ts","../src/common/utils/stringify-config.test.ts","../src/common/utils/stringify-config.ts","../src/common/utils/types.ts","../src/common/utils/urls.ts","../src/common/validators/argument-validators.spec.ts","../src/common/validators/argument-validators.ts","../src/common/validators/file-system-validator.ts","../src/common/validators/lib.ts","../src/common/validators/project-name-validator.ts","../src/common/xdg/lib.ts","../src/compile/handler.ts","../src/custom-domain/models.ts","../src/custom-domain/create/handler.ts","../src/custom-domain/delete/handler.ts","../src/custom-domain/list/handler.ts","../src/custom-domain/update/handler.ts","../src/delete/handler.ts","../src/delete/poll-deployment.ts","../src/deploy/archive.local-registry.test.ts","../src/deploy/archive.test.ts","../src/deploy/archive.ts","../src/deploy/environments.ts","../src/deploy/file-upload.ts","../src/deploy/handler.ts","../src/deploy/poll-deployment.ts","../src/dev/handler.ts","../src/docs/handler.ts","../src/editor/handler.ts","../src/editor/e2e/editor.spec.ts","../src/init/handler.ts","../src/link/handler.ts","../src/list/handler.ts","../src/login/login.ts","../src/login/tokens.ts","../src/mtls-certificates/models.ts","../src/mtls-certificates/create/handler.ts","../src/mtls-certificates/delete/handler.ts","../src/mtls-certificates/describe/handler.ts","../src/mtls-certificates/disable/handler.ts","../src/mtls-certificates/list/handler.ts","../src/mtls-certificates/update/handler.ts","../src/open-api/convert/handler.spec.ts","../src/open-api/convert/handler.ts","../src/open-api/merge/handler.spec.ts","../src/open-api/merge/handler.ts","../src/open-api/overlay/handler.spec.ts","../src/open-api/overlay/handler.ts","../src/project/create/handler.ts","../src/project/info/handler.ts","../src/proxies/models.ts","../src/proxies/create/handler.ts","../src/proxies/delete/handler.ts","../src/proxies/describe/handler.ts","../src/proxies/update/handler.ts","../src/source/migrate/dev-portal/handler.ts","../src/source/migrate/dev-portal/types.ts","../src/source/update/handler.ts","../src/test/esbuild-config.ts","../src/test/handler.ts","../src/test/invoke-test.ts","../src/test/test-files.test.ts","../src/test/test-files.ts","../src/test/esbuild-plugins/node-test-prep-plugin.ts","../src/tunnel/models.ts","../src/tunnel/create/handler.ts","../src/tunnel/delete/handler.ts","../src/tunnel/delete/poll-teardown-operation.ts","../src/tunnel/describe/handler.ts","../src/tunnel/list/handler.ts","../src/tunnel/rotate-token/handler.ts","../src/tunnel/services/describe/handler.ts","../src/tunnel/services/update/handler.ts","../src/tunnel/services/update/poll-provisioning-operations.ts","../src/variable/models.ts","../src/variable/create/handler.ts","../src/variable/update/handler.ts","../src/whoami/handler.ts"],"version":"5.8.2"}
|
|
@@ -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);
|
|
@@ -31,7 +31,7 @@
|
|
|
31
31
|
|
|
32
32
|
// Expand :: in an IPv6 address or address part consisting of `parts` groups.
|
|
33
33
|
function expandIPv6 (string, parts) {
|
|
34
|
-
// More than one '::' means invalid
|
|
34
|
+
// More than one '::' means invalid address
|
|
35
35
|
if (string.indexOf('::') !== string.lastIndexOf('::')) {
|
|
36
36
|
return null;
|
|
37
37
|
}
|
|
@@ -77,7 +77,7 @@
|
|
|
77
77
|
string = string.replace('::', replacement);
|
|
78
78
|
|
|
79
79
|
// Trim any garbage which may be hanging around if :: was at the edge in
|
|
80
|
-
// the source
|
|
80
|
+
// the source string
|
|
81
81
|
if (string[0] === ':') {
|
|
82
82
|
string = string.slice(1);
|
|
83
83
|
}
|
|
@@ -130,7 +130,7 @@
|
|
|
130
130
|
}
|
|
131
131
|
|
|
132
132
|
function parseIntAuto (string) {
|
|
133
|
-
//
|
|
133
|
+
// Hexadecimal base 16 (0x#)
|
|
134
134
|
if (hexRegex.test(string)) {
|
|
135
135
|
return parseInt(string, 16);
|
|
136
136
|
}
|
|
@@ -567,12 +567,18 @@
|
|
|
567
567
|
loopback: [new IPv6([0, 0, 0, 0, 0, 0, 0, 1]), 128],
|
|
568
568
|
uniqueLocal: [new IPv6([0xfc00, 0, 0, 0, 0, 0, 0, 0]), 7],
|
|
569
569
|
ipv4Mapped: [new IPv6([0, 0, 0, 0, 0, 0xffff, 0, 0]), 96],
|
|
570
|
+
// RFC3879
|
|
571
|
+
deprecatedSiteLocal: [new IPv6([0xfec0, 0, 0, 0, 0, 0, 0, 0]), 10],
|
|
570
572
|
// RFC6666
|
|
571
573
|
discard: [new IPv6([0x100, 0, 0, 0, 0, 0, 0, 0]), 64],
|
|
572
574
|
// RFC6145
|
|
573
575
|
rfc6145: [new IPv6([0, 0, 0, 0, 0xffff, 0, 0, 0]), 96],
|
|
574
|
-
|
|
575
|
-
|
|
576
|
+
rfc6052: [
|
|
577
|
+
// RFC6052
|
|
578
|
+
[new IPv6([0x64, 0xff9b, 0, 0, 0, 0, 0, 0]), 96],
|
|
579
|
+
// RFC8215
|
|
580
|
+
[new IPv6([0x64, 0xff9b, 0x1, 0, 0, 0, 0, 0]), 48],
|
|
581
|
+
],
|
|
576
582
|
// RFC3056
|
|
577
583
|
'6to4': [new IPv6([0x2002, 0, 0, 0, 0, 0, 0, 0]), 16],
|
|
578
584
|
// RFC6052, RFC6146
|
|
@@ -582,17 +588,26 @@
|
|
|
582
588
|
// RFC7450
|
|
583
589
|
amt: [new IPv6([0x2001, 0x3, 0, 0, 0, 0, 0, 0]), 32],
|
|
584
590
|
as112v6: [
|
|
591
|
+
// RFC7535
|
|
585
592
|
[new IPv6([0x2001, 0x4, 0x112, 0, 0, 0, 0, 0]), 48],
|
|
593
|
+
// RFC7534
|
|
586
594
|
[new IPv6([0x2620, 0x4f, 0x8000, 0, 0, 0, 0, 0]), 48],
|
|
587
595
|
],
|
|
588
|
-
|
|
596
|
+
// RFC4843
|
|
597
|
+
deprecatedOrchid: [new IPv6([0x2001, 0x10, 0, 0, 0, 0, 0, 0]), 28],
|
|
598
|
+
// RFC7343
|
|
589
599
|
orchid2: [new IPv6([0x2001, 0x20, 0, 0, 0, 0, 0, 0]), 28],
|
|
600
|
+
// RFC9374
|
|
590
601
|
droneRemoteIdProtocolEntityTags: [new IPv6([0x2001, 0x30, 0, 0, 0, 0, 0, 0]), 28],
|
|
602
|
+
// RFC9602
|
|
603
|
+
segmentRouting: [new IPv6([0x5f00, 0, 0, 0, 0, 0, 0, 0]), 16],
|
|
591
604
|
reserved: [
|
|
592
605
|
// RFC3849
|
|
593
606
|
[new IPv6([0x2001, 0, 0, 0, 0, 0, 0, 0]), 23],
|
|
594
607
|
// RFC2928
|
|
595
608
|
[new IPv6([0x2001, 0xdb8, 0, 0, 0, 0, 0, 0]), 32],
|
|
609
|
+
// RFC9637
|
|
610
|
+
[new IPv6([0x3fff, 0, 0, 0, 0, 0, 0, 0]), 20],
|
|
596
611
|
],
|
|
597
612
|
};
|
|
598
613
|
|