@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
|
@@ -0,0 +1,183 @@
|
|
|
1
|
+
'use strict'
|
|
2
|
+
|
|
3
|
+
const { test } = require('node:test')
|
|
4
|
+
const build = require('..')
|
|
5
|
+
|
|
6
|
+
test('external $ref schema should be reused, not inlined at every reference', (t) => {
|
|
7
|
+
t.plan(3)
|
|
8
|
+
|
|
9
|
+
const contactSchema = {
|
|
10
|
+
$id: 'contact.json',
|
|
11
|
+
type: 'object',
|
|
12
|
+
properties: {
|
|
13
|
+
firstName: { type: 'string' },
|
|
14
|
+
lastName: { type: 'string' },
|
|
15
|
+
email: { type: 'string' }
|
|
16
|
+
}
|
|
17
|
+
}
|
|
18
|
+
|
|
19
|
+
// Schema referencing the same external $ref multiple times
|
|
20
|
+
const parentSchema = {
|
|
21
|
+
type: 'object',
|
|
22
|
+
properties: {
|
|
23
|
+
owner: { $ref: 'contact.json' },
|
|
24
|
+
assignee: { $ref: 'contact.json' },
|
|
25
|
+
reporter: { $ref: 'contact.json' }
|
|
26
|
+
}
|
|
27
|
+
}
|
|
28
|
+
|
|
29
|
+
const serializer = build(parentSchema, { schema: { 'contact.json': contactSchema } })
|
|
30
|
+
const code = serializer.toString()
|
|
31
|
+
|
|
32
|
+
// The serialized function should contain extracted anonymous functions
|
|
33
|
+
// rather than inlining the full contact schema at every reference.
|
|
34
|
+
// With the fix, `firstName` appears 0 times in the main serializer body
|
|
35
|
+
// (it is inside the extracted function, which is not included in .toString())
|
|
36
|
+
// or at most 1 time if in a single extracted function.
|
|
37
|
+
const firstNameMatches = code.match(/firstName/g)
|
|
38
|
+
t.assert.ok(firstNameMatches === null || firstNameMatches.length <= 1,
|
|
39
|
+
`firstName should appear at most once (extracted function), got ${firstNameMatches ? firstNameMatches.length : 0}`)
|
|
40
|
+
|
|
41
|
+
// Verify correct serialization
|
|
42
|
+
const data = {
|
|
43
|
+
owner: { firstName: 'John', lastName: 'Doe', email: 'john@example.com' },
|
|
44
|
+
assignee: { firstName: 'Jane', lastName: 'Smith', email: 'jane@example.com' },
|
|
45
|
+
reporter: { firstName: 'Bob', lastName: 'Jones', email: 'bob@example.com' }
|
|
46
|
+
}
|
|
47
|
+
|
|
48
|
+
const output = serializer(data)
|
|
49
|
+
t.assert.doesNotThrow(() => JSON.parse(output))
|
|
50
|
+
t.assert.equal(output, JSON.stringify(data))
|
|
51
|
+
})
|
|
52
|
+
|
|
53
|
+
test('external $ref schema reused with anyOf wrapping', (t) => {
|
|
54
|
+
t.plan(2)
|
|
55
|
+
|
|
56
|
+
const contactSchema = {
|
|
57
|
+
$id: 'contact.json',
|
|
58
|
+
type: 'object',
|
|
59
|
+
properties: {
|
|
60
|
+
firstName: { type: 'string' },
|
|
61
|
+
lastName: { type: 'string' },
|
|
62
|
+
email: { type: 'string' }
|
|
63
|
+
}
|
|
64
|
+
}
|
|
65
|
+
|
|
66
|
+
// Common pattern: anyOf wrapping $ref for polymorphic fields (populated object OR string ID OR null)
|
|
67
|
+
const parentSchema = {
|
|
68
|
+
type: 'object',
|
|
69
|
+
properties: {
|
|
70
|
+
owner: {
|
|
71
|
+
anyOf: [{ type: ['string', 'null'] }, { $ref: 'contact.json' }]
|
|
72
|
+
},
|
|
73
|
+
assignee: {
|
|
74
|
+
anyOf: [{ type: ['string', 'null'] }, { $ref: 'contact.json' }]
|
|
75
|
+
},
|
|
76
|
+
reporter: {
|
|
77
|
+
anyOf: [{ type: ['string', 'null'] }, { $ref: 'contact.json' }]
|
|
78
|
+
}
|
|
79
|
+
}
|
|
80
|
+
}
|
|
81
|
+
|
|
82
|
+
const serializer = build(parentSchema, { schema: { 'contact.json': contactSchema } })
|
|
83
|
+
|
|
84
|
+
// Serialize with populated objects
|
|
85
|
+
const data = {
|
|
86
|
+
owner: { firstName: 'John', lastName: 'Doe', email: 'john@example.com' },
|
|
87
|
+
assignee: { firstName: 'Jane', lastName: 'Smith', email: 'jane@example.com' },
|
|
88
|
+
reporter: { firstName: 'Bob', lastName: 'Jones', email: 'bob@example.com' }
|
|
89
|
+
}
|
|
90
|
+
|
|
91
|
+
const output = serializer(data)
|
|
92
|
+
t.assert.doesNotThrow(() => JSON.parse(output))
|
|
93
|
+
t.assert.equal(output, JSON.stringify(data))
|
|
94
|
+
})
|
|
95
|
+
|
|
96
|
+
test('external $ref schema reused in array items', (t) => {
|
|
97
|
+
t.plan(2)
|
|
98
|
+
|
|
99
|
+
const contactSchema = {
|
|
100
|
+
$id: 'contact.json',
|
|
101
|
+
type: 'object',
|
|
102
|
+
properties: {
|
|
103
|
+
firstName: { type: 'string' },
|
|
104
|
+
lastName: { type: 'string' }
|
|
105
|
+
}
|
|
106
|
+
}
|
|
107
|
+
|
|
108
|
+
const parentSchema = {
|
|
109
|
+
type: 'object',
|
|
110
|
+
properties: {
|
|
111
|
+
contacts: {
|
|
112
|
+
type: 'array',
|
|
113
|
+
items: { $ref: 'contact.json' }
|
|
114
|
+
},
|
|
115
|
+
primary: { $ref: 'contact.json' },
|
|
116
|
+
secondary: { $ref: 'contact.json' }
|
|
117
|
+
}
|
|
118
|
+
}
|
|
119
|
+
|
|
120
|
+
const serializer = build(parentSchema, { schema: { 'contact.json': contactSchema } })
|
|
121
|
+
|
|
122
|
+
const data = {
|
|
123
|
+
contacts: [
|
|
124
|
+
{ firstName: 'Alice', lastName: 'Wonder' },
|
|
125
|
+
{ firstName: 'Bob', lastName: 'Builder' }
|
|
126
|
+
],
|
|
127
|
+
primary: { firstName: 'Charlie', lastName: 'Charm' },
|
|
128
|
+
secondary: { firstName: 'Diana', lastName: 'Prince' }
|
|
129
|
+
}
|
|
130
|
+
|
|
131
|
+
const output = serializer(data)
|
|
132
|
+
t.assert.doesNotThrow(() => JSON.parse(output))
|
|
133
|
+
t.assert.equal(output, JSON.stringify(data))
|
|
134
|
+
})
|
|
135
|
+
|
|
136
|
+
test('external array $ref schema should be reused, not inlined at every reference', (t) => {
|
|
137
|
+
t.plan(2)
|
|
138
|
+
|
|
139
|
+
const tagsSchema = {
|
|
140
|
+
$id: 'tags.json',
|
|
141
|
+
type: 'array',
|
|
142
|
+
items: { type: 'string' }
|
|
143
|
+
}
|
|
144
|
+
|
|
145
|
+
const parentSchema = {
|
|
146
|
+
type: 'object',
|
|
147
|
+
properties: {
|
|
148
|
+
a: { $ref: 'tags.json' },
|
|
149
|
+
b: { $ref: 'tags.json' },
|
|
150
|
+
c: { $ref: 'tags.json' }
|
|
151
|
+
}
|
|
152
|
+
}
|
|
153
|
+
|
|
154
|
+
const serializer = build(parentSchema, { schema: { 'tags.json': tagsSchema } })
|
|
155
|
+
|
|
156
|
+
const data = {
|
|
157
|
+
a: ['x', 'y'],
|
|
158
|
+
b: ['z'],
|
|
159
|
+
c: []
|
|
160
|
+
}
|
|
161
|
+
|
|
162
|
+
const output = serializer(data)
|
|
163
|
+
t.assert.doesNotThrow(() => JSON.parse(output))
|
|
164
|
+
t.assert.equal(output, JSON.stringify(data))
|
|
165
|
+
})
|
|
166
|
+
|
|
167
|
+
test('inline anonymous schemas should still be inlined (not extracted)', (t) => {
|
|
168
|
+
t.plan(1)
|
|
169
|
+
|
|
170
|
+
// Inline schemas (no external $ref) should continue to work normally
|
|
171
|
+
const schema = {
|
|
172
|
+
type: 'object',
|
|
173
|
+
properties: {
|
|
174
|
+
a: { type: 'object', properties: { x: { type: 'string' } } },
|
|
175
|
+
b: { type: 'object', properties: { x: { type: 'string' } } }
|
|
176
|
+
}
|
|
177
|
+
}
|
|
178
|
+
|
|
179
|
+
const serializer = build(schema)
|
|
180
|
+
const output = serializer({ a: { x: 'hello' }, b: { x: 'world' } })
|
|
181
|
+
|
|
182
|
+
t.assert.equal(output, '{"a":{"x":"hello"},"b":{"x":"world"}}')
|
|
183
|
+
})
|
package/node_modules/@zuplo/editor/node_modules/fast-json-stringify/test/json-add-comma.test.js
CHANGED
|
@@ -1,57 +1,57 @@
|
|
|
1
|
-
'use strict'
|
|
2
|
-
|
|
3
|
-
const { test } = require('node:test')
|
|
4
|
-
const build = require('..')
|
|
5
|
-
|
|
6
|
-
test('additionalProperties: false', (t) => {
|
|
7
|
-
t.plan(1)
|
|
8
|
-
const stringify = build({
|
|
9
|
-
title: 'additionalProperties',
|
|
10
|
-
type: 'object',
|
|
11
|
-
properties: {
|
|
12
|
-
foo: {
|
|
13
|
-
type: 'string'
|
|
14
|
-
}
|
|
15
|
-
},
|
|
16
|
-
additionalProperties: false
|
|
17
|
-
})
|
|
18
|
-
|
|
19
|
-
const obj = { foo: 'a', bar: 'b', baz: 'c' }
|
|
20
|
-
t.assert.equal(stringify(obj), '{"foo":"a"}')
|
|
21
|
-
})
|
|
22
|
-
|
|
23
|
-
test('additionalProperties: {}', (t) => {
|
|
24
|
-
t.plan(1)
|
|
25
|
-
const stringify = build({
|
|
26
|
-
title: 'additionalProperties',
|
|
27
|
-
type: 'object',
|
|
28
|
-
properties: {
|
|
29
|
-
foo: {
|
|
30
|
-
type: 'string'
|
|
31
|
-
}
|
|
32
|
-
},
|
|
33
|
-
additionalProperties: {}
|
|
34
|
-
})
|
|
35
|
-
|
|
36
|
-
const obj = { foo: 'a', bar: 'b', baz: 'c' }
|
|
37
|
-
t.assert.equal(stringify(obj), '{"foo":"a","bar":"b","baz":"c"}')
|
|
38
|
-
})
|
|
39
|
-
|
|
40
|
-
test('additionalProperties: {type: string}', (t) => {
|
|
41
|
-
t.plan(1)
|
|
42
|
-
const stringify = build({
|
|
43
|
-
title: 'additionalProperties',
|
|
44
|
-
type: 'object',
|
|
45
|
-
properties: {
|
|
46
|
-
foo: {
|
|
47
|
-
type: 'string'
|
|
48
|
-
}
|
|
49
|
-
},
|
|
50
|
-
additionalProperties: {
|
|
51
|
-
type: 'string'
|
|
52
|
-
}
|
|
53
|
-
})
|
|
54
|
-
|
|
55
|
-
const obj = { foo: 'a', bar: 'b', baz: 'c' }
|
|
56
|
-
t.assert.equal(stringify(obj), '{"foo":"a","bar":"b","baz":"c"}')
|
|
57
|
-
})
|
|
1
|
+
'use strict'
|
|
2
|
+
|
|
3
|
+
const { test } = require('node:test')
|
|
4
|
+
const build = require('..')
|
|
5
|
+
|
|
6
|
+
test('additionalProperties: false', (t) => {
|
|
7
|
+
t.plan(1)
|
|
8
|
+
const stringify = build({
|
|
9
|
+
title: 'additionalProperties',
|
|
10
|
+
type: 'object',
|
|
11
|
+
properties: {
|
|
12
|
+
foo: {
|
|
13
|
+
type: 'string'
|
|
14
|
+
}
|
|
15
|
+
},
|
|
16
|
+
additionalProperties: false
|
|
17
|
+
})
|
|
18
|
+
|
|
19
|
+
const obj = { foo: 'a', bar: 'b', baz: 'c' }
|
|
20
|
+
t.assert.equal(stringify(obj), '{"foo":"a"}')
|
|
21
|
+
})
|
|
22
|
+
|
|
23
|
+
test('additionalProperties: {}', (t) => {
|
|
24
|
+
t.plan(1)
|
|
25
|
+
const stringify = build({
|
|
26
|
+
title: 'additionalProperties',
|
|
27
|
+
type: 'object',
|
|
28
|
+
properties: {
|
|
29
|
+
foo: {
|
|
30
|
+
type: 'string'
|
|
31
|
+
}
|
|
32
|
+
},
|
|
33
|
+
additionalProperties: {}
|
|
34
|
+
})
|
|
35
|
+
|
|
36
|
+
const obj = { foo: 'a', bar: 'b', baz: 'c' }
|
|
37
|
+
t.assert.equal(stringify(obj), '{"foo":"a","bar":"b","baz":"c"}')
|
|
38
|
+
})
|
|
39
|
+
|
|
40
|
+
test('additionalProperties: {type: string}', (t) => {
|
|
41
|
+
t.plan(1)
|
|
42
|
+
const stringify = build({
|
|
43
|
+
title: 'additionalProperties',
|
|
44
|
+
type: 'object',
|
|
45
|
+
properties: {
|
|
46
|
+
foo: {
|
|
47
|
+
type: 'string'
|
|
48
|
+
}
|
|
49
|
+
},
|
|
50
|
+
additionalProperties: {
|
|
51
|
+
type: 'string'
|
|
52
|
+
}
|
|
53
|
+
})
|
|
54
|
+
|
|
55
|
+
const obj = { foo: 'a', bar: 'b', baz: 'c' }
|
|
56
|
+
t.assert.equal(stringify(obj), '{"foo":"a","bar":"b","baz":"c"}')
|
|
57
|
+
})
|
|
@@ -488,3 +488,23 @@ test('all array items does not match oneOf types', (t) => {
|
|
|
488
488
|
|
|
489
489
|
t.assert.throws(() => stringify({ data: [null, false, true, undefined, [], {}] }))
|
|
490
490
|
})
|
|
491
|
+
|
|
492
|
+
test('invalid oneOf schema', (t) => {
|
|
493
|
+
t.plan(1)
|
|
494
|
+
|
|
495
|
+
const schema = {
|
|
496
|
+
type: 'object',
|
|
497
|
+
properties: {
|
|
498
|
+
prop: {
|
|
499
|
+
oneOf: 'not array' // invalid, oneOf must be array
|
|
500
|
+
}
|
|
501
|
+
}
|
|
502
|
+
}
|
|
503
|
+
|
|
504
|
+
try {
|
|
505
|
+
build(schema)
|
|
506
|
+
t.assert.fail('Should throw')
|
|
507
|
+
} catch (err) {
|
|
508
|
+
t.assert.ok(err.message.includes('schema is invalid'))
|
|
509
|
+
}
|
|
510
|
+
})
|
|
@@ -2044,3 +2044,34 @@ test('ref internal - throw if schema has definition twice with different shape',
|
|
|
2044
2044
|
t.assert.equal(err.message, 'There is already another anchor "#uri" in schema "test".')
|
|
2045
2045
|
}
|
|
2046
2046
|
})
|
|
2047
|
+
|
|
2048
|
+
test('ref nested', (t) => {
|
|
2049
|
+
t.plan(2)
|
|
2050
|
+
|
|
2051
|
+
const schema = {
|
|
2052
|
+
definitions: {
|
|
2053
|
+
def1: {
|
|
2054
|
+
$ref: '#/definitions/def2'
|
|
2055
|
+
},
|
|
2056
|
+
def2: {
|
|
2057
|
+
type: 'string'
|
|
2058
|
+
}
|
|
2059
|
+
},
|
|
2060
|
+
type: 'object',
|
|
2061
|
+
properties: {
|
|
2062
|
+
str: {
|
|
2063
|
+
$ref: '#/definitions/def1'
|
|
2064
|
+
}
|
|
2065
|
+
}
|
|
2066
|
+
}
|
|
2067
|
+
|
|
2068
|
+
const object = {
|
|
2069
|
+
str: 'test'
|
|
2070
|
+
}
|
|
2071
|
+
|
|
2072
|
+
const stringify = build(schema)
|
|
2073
|
+
const output = stringify(object)
|
|
2074
|
+
|
|
2075
|
+
t.assert.doesNotThrow(() => JSON.parse(output))
|
|
2076
|
+
t.assert.equal(output, '{"str":"test"}')
|
|
2077
|
+
})
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
// eslint-disable-next-line @typescript-eslint/no-unused-vars -- Test using this disabled, see https://github.com/fastify/fast-json-stringify/pull/683
|
|
2
2
|
import Ajv from 'ajv'
|
|
3
3
|
import build, { restore, Schema, validLargeArrayMechanisms } from '..'
|
|
4
|
-
import {
|
|
4
|
+
import { expect } from 'tstyche'
|
|
5
5
|
|
|
6
6
|
// Number schemas
|
|
7
7
|
build({
|
|
@@ -26,9 +26,10 @@ build({
|
|
|
26
26
|
build({
|
|
27
27
|
type: 'number'
|
|
28
28
|
}, { rounding: 'trunc' })
|
|
29
|
-
|
|
29
|
+
|
|
30
|
+
expect(build).type.not.toBeCallableWith({
|
|
30
31
|
type: 'number'
|
|
31
|
-
}, { rounding: 'invalid' })
|
|
32
|
+
}, { rounding: 'invalid' })
|
|
32
33
|
|
|
33
34
|
// String schema
|
|
34
35
|
build({
|
|
@@ -153,7 +154,6 @@ build({
|
|
|
153
154
|
})({ something: 'a string', somethingElse: 42 })
|
|
154
155
|
|
|
155
156
|
// String schema with format
|
|
156
|
-
|
|
157
157
|
build({
|
|
158
158
|
type: 'string',
|
|
159
159
|
format: 'date-time'
|
|
@@ -181,7 +181,6 @@ str = build({
|
|
|
181
181
|
type: 'number'
|
|
182
182
|
}, { mode: 'standalone' })
|
|
183
183
|
*/
|
|
184
|
-
|
|
185
184
|
const debugCompiled = build({
|
|
186
185
|
title: 'default string',
|
|
187
186
|
type: 'object',
|
|
@@ -191,11 +190,12 @@ const debugCompiled = build({
|
|
|
191
190
|
}
|
|
192
191
|
}
|
|
193
192
|
}, { mode: 'debug' })
|
|
194
|
-
expectType<ReturnType<typeof build>>(build.restore(debugCompiled))
|
|
195
|
-
expectType<ReturnType<typeof build>>(restore(debugCompiled))
|
|
196
193
|
|
|
197
|
-
|
|
198
|
-
|
|
194
|
+
expect(build.restore(debugCompiled)).type.toBe(build({} as Schema))
|
|
195
|
+
expect(restore(debugCompiled)).type.toBe(build({} as Schema))
|
|
196
|
+
|
|
197
|
+
expect(build.validLargeArrayMechanisms).type.toBe<string[]>()
|
|
198
|
+
expect(validLargeArrayMechanisms).type.toBe<string[]>()
|
|
199
199
|
|
|
200
200
|
/**
|
|
201
201
|
* Schema inference
|
|
@@ -211,10 +211,11 @@ const stringify3 = build({
|
|
|
211
211
|
type: 'object',
|
|
212
212
|
properties: { a: { type: 'string' } },
|
|
213
213
|
})
|
|
214
|
+
|
|
214
215
|
stringify3<InferenceSchema>({ id: '123' })
|
|
215
216
|
stringify3<InferenceSchema>({ a: 123, id: '123' })
|
|
216
|
-
|
|
217
|
-
|
|
217
|
+
expect(stringify3<InferenceSchema>).type.not.toBeCallableWith({ anotherOne: 'bar' })
|
|
218
|
+
expect(stringify3<Schema>).type.not.toBeCallableWith({ a: 'bar' })
|
|
218
219
|
|
|
219
220
|
// Without inference
|
|
220
221
|
const stringify4 = build({
|
|
@@ -231,29 +232,28 @@ const stringify5 = build({
|
|
|
231
232
|
type: 'string',
|
|
232
233
|
})
|
|
233
234
|
stringify5('foo')
|
|
234
|
-
|
|
235
|
+
expect(stringify5).type.not.toBeCallableWith({ id: '123' })
|
|
235
236
|
|
|
236
237
|
// Without inference - null type
|
|
237
238
|
const stringify6 = build({
|
|
238
239
|
type: 'null',
|
|
239
240
|
})
|
|
240
241
|
stringify6(null)
|
|
241
|
-
|
|
242
|
+
expect(stringify6).type.not.toBeCallableWith('a string')
|
|
242
243
|
|
|
243
244
|
// Without inference - boolean type
|
|
244
245
|
const stringify7 = build({
|
|
245
246
|
type: 'boolean',
|
|
246
247
|
})
|
|
247
248
|
stringify7(true)
|
|
248
|
-
|
|
249
|
+
expect(stringify7).type.not.toBeCallableWith('a string')
|
|
249
250
|
|
|
250
251
|
// largeArrayMechanism
|
|
251
|
-
|
|
252
252
|
build({}, { largeArrayMechanism: 'json-stringify' })
|
|
253
253
|
build({}, { largeArrayMechanism: 'default' })
|
|
254
|
-
|
|
254
|
+
expect(build).type.not.toBeCallableWith({} as Schema, { largeArrayMechanism: 'invalid' })
|
|
255
255
|
|
|
256
256
|
build({}, { largeArraySize: 2000 })
|
|
257
257
|
build({}, { largeArraySize: '2e4' })
|
|
258
258
|
build({}, { largeArraySize: 2n })
|
|
259
|
-
|
|
259
|
+
expect(build).type.not.toBeCallableWith({} as Schema, { largeArraySize: ['asdf'] })
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"diagnostics-channel-browser.d.ts","sourceRoot":"","sources":["../../../src/diagnostics-channel-browser.ts"],"names":[],"mappings":"AAEA,OAAO,EACL,KAAK,OAAO,EACZ,KAAK,cAAc,EACpB,MAAM,0BAA0B,CAAA;AACjC,YAAY,EAAE,cAAc,EAAE,OAAO,EAAE,CAAA;AAGvC,eAAO,MAAM,OAAO,EAAY,OAAO,CAAC,OAAO,CAAC,CAAA;AAChD,eAAO,MAAM,OAAO,EAAY,cAAc,CAAC,OAAO,CAAC,CAAA"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"diagnostics-channel-browser.js","sourceRoot":"","sources":["../../../src/diagnostics-channel-browser.ts"],"names":[],"mappings":";;;AAQA,MAAM,KAAK,GAAG,EAAE,cAAc,EAAE,KAAK,EAAE,CAAA;AAC1B,QAAA,OAAO,GAAG,KAAyB,CAAA;AACnC,QAAA,OAAO,GAAG,KAAgC,CAAA","sourcesContent":["// this is used in ESM environments that follow the 'browser' import\n// condition, to avoid even trying to load node:diagnostics_channel\nimport {\n type Channel,\n type TracingChannel,\n} from 'node:diagnostics_channel'\nexport type { TracingChannel, Channel }\n\nconst dummy = { hasSubscribers: false }\nexport const metrics = dummy as Channel<unknown>\nexport const tracing = dummy as TracingChannel<unknown>\n"]}
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
import { type Channel, type TracingChannel } from 'node:diagnostics_channel';
|
|
2
|
+
export type { TracingChannel, Channel };
|
|
3
|
+
export declare const metrics: Channel<unknown>;
|
|
4
|
+
export declare const tracing: TracingChannel<unknown>;
|
|
5
|
+
//# sourceMappingURL=diagnostics-channel-browser.d.ts.map
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.tracing = exports.metrics = void 0;
|
|
4
|
+
const dummy = { hasSubscribers: false };
|
|
5
|
+
exports.metrics = dummy;
|
|
6
|
+
exports.tracing = dummy;
|
|
7
|
+
//# sourceMappingURL=diagnostics-channel-browser.js.map
|