openapi-typesafe 1.0.0-rc.3 → 1.0.0-rc.4
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/CHANGELOG.md +1831 -0
- package/dist/adapters/node-file-system/file-claims.cjs +105 -0
- package/dist/adapters/node-file-system/file-claims.cjs.map +1 -0
- package/dist/adapters/node-file-system/file-claims.mjs +95 -0
- package/dist/adapters/node-file-system/file-claims.mjs.map +1 -0
- package/dist/adapters/node-file-system/file-identity.cjs +82 -0
- package/dist/adapters/node-file-system/file-identity.cjs.map +1 -0
- package/dist/adapters/node-file-system/file-identity.mjs +74 -0
- package/dist/adapters/node-file-system/file-identity.mjs.map +1 -0
- package/dist/adapters/node-file-system/node-file-system.cjs +90 -14
- package/dist/adapters/node-file-system/node-file-system.cjs.map +1 -1
- package/dist/adapters/node-file-system/node-file-system.mjs +90 -14
- package/dist/adapters/node-file-system/node-file-system.mjs.map +1 -1
- package/dist/adapters/redocly-loader/bundled-mapping-copies.cjs +75 -0
- package/dist/adapters/redocly-loader/bundled-mapping-copies.cjs.map +1 -0
- package/dist/adapters/redocly-loader/bundled-mapping-copies.mjs +72 -0
- package/dist/adapters/redocly-loader/bundled-mapping-copies.mjs.map +1 -0
- package/dist/adapters/redocly-loader/bundled-ref-repair.cjs +1 -1
- package/dist/adapters/redocly-loader/bundled-ref-repair.cjs.map +1 -1
- package/dist/adapters/redocly-loader/bundled-ref-repair.mjs +2 -2
- package/dist/adapters/redocly-loader/bundled-ref-repair.mjs.map +1 -1
- package/dist/adapters/redocly-loader/loaded-documents.cjs +28 -0
- package/dist/adapters/redocly-loader/loaded-documents.cjs.map +1 -0
- package/dist/adapters/redocly-loader/loaded-documents.mjs +21 -0
- package/dist/adapters/redocly-loader/loaded-documents.mjs.map +1 -0
- package/dist/adapters/redocly-loader/redocly-schema-loader.cjs +14 -15
- package/dist/adapters/redocly-loader/redocly-schema-loader.cjs.map +1 -1
- package/dist/adapters/redocly-loader/redocly-schema-loader.mjs +12 -13
- package/dist/adapters/redocly-loader/redocly-schema-loader.mjs.map +1 -1
- package/dist/adapters/redocly-loader/ref-access.cjs +31 -3
- package/dist/adapters/redocly-loader/ref-access.cjs.map +1 -1
- package/dist/adapters/redocly-loader/ref-access.mjs +31 -3
- package/dist/adapters/redocly-loader/ref-access.mjs.map +1 -1
- package/dist/adapters/redocly-loader/ref-holders.cjs +2 -2
- package/dist/adapters/redocly-loader/ref-holders.cjs.map +1 -1
- package/dist/adapters/redocly-loader/ref-holders.mjs +3 -3
- package/dist/adapters/redocly-loader/ref-holders.mjs.map +1 -1
- package/dist/adapters/redocly-loader/remote-body-limit.cjs +50 -0
- package/dist/adapters/redocly-loader/remote-body-limit.cjs.map +1 -0
- package/dist/adapters/redocly-loader/remote-body-limit.mjs +48 -0
- package/dist/adapters/redocly-loader/remote-body-limit.mjs.map +1 -0
- package/dist/adapters/redocly-loader/remote-fetch.cjs +35 -6
- package/dist/adapters/redocly-loader/remote-fetch.cjs.map +1 -1
- package/dist/adapters/redocly-loader/remote-fetch.mjs +35 -6
- package/dist/adapters/redocly-loader/remote-fetch.mjs.map +1 -1
- package/dist/adapters/redocly-loader/remote-node-limit.cjs +47 -0
- package/dist/adapters/redocly-loader/remote-node-limit.cjs.map +1 -0
- package/dist/adapters/redocly-loader/remote-node-limit.mjs +44 -0
- package/dist/adapters/redocly-loader/remote-node-limit.mjs.map +1 -0
- package/dist/adapters/redocly-loader/schema-load-errors.cjs +32 -8
- package/dist/adapters/redocly-loader/schema-load-errors.cjs.map +1 -1
- package/dist/adapters/redocly-loader/schema-load-errors.mjs +32 -9
- package/dist/adapters/redocly-loader/schema-load-errors.mjs.map +1 -1
- package/dist/adapters/redocly-loader/schema-source.cjs +11 -7
- package/dist/adapters/redocly-loader/schema-source.cjs.map +1 -1
- package/dist/adapters/redocly-loader/schema-source.mjs +12 -8
- package/dist/adapters/redocly-loader/schema-source.mjs.map +1 -1
- package/dist/adapters/redocly-loader/unsupported-keys.cjs +3 -5
- package/dist/adapters/redocly-loader/unsupported-keys.cjs.map +1 -1
- package/dist/adapters/redocly-loader/unsupported-keys.mjs +3 -5
- package/dist/adapters/redocly-loader/unsupported-keys.mjs.map +1 -1
- package/dist/adapters/terminal-logger/terminal-logger.cjs +6 -4
- package/dist/adapters/terminal-logger/terminal-logger.cjs.map +1 -1
- package/dist/adapters/terminal-logger/terminal-logger.mjs +6 -4
- package/dist/adapters/terminal-logger/terminal-logger.mjs.map +1 -1
- package/dist/api/default-ports.cjs +14 -2
- package/dist/api/default-ports.cjs.map +1 -1
- package/dist/api/default-ports.mjs +14 -2
- package/dist/api/default-ports.mjs.map +1 -1
- package/dist/api/discriminator-enum-parent.cjs +2 -2
- package/dist/api/discriminator-enum-parent.cjs.map +1 -1
- package/dist/api/discriminator-enum-parent.mjs +3 -3
- package/dist/api/discriminator-enum-parent.mjs.map +1 -1
- package/dist/api/discriminator-other-owners.cjs +5 -3
- package/dist/api/discriminator-other-owners.cjs.map +1 -1
- package/dist/api/discriminator-other-owners.mjs +5 -3
- package/dist/api/discriminator-other-owners.mjs.map +1 -1
- package/dist/api/discriminator-patch.cjs +5 -1
- package/dist/api/discriminator-patch.cjs.map +1 -1
- package/dist/api/discriminator-patch.mjs +5 -1
- package/dist/api/discriminator-patch.mjs.map +1 -1
- package/dist/api/discriminator-scan.cjs +15 -8
- package/dist/api/discriminator-scan.cjs.map +1 -1
- package/dist/api/discriminator-scan.mjs +15 -8
- package/dist/api/discriminator-scan.mjs.map +1 -1
- package/dist/api/document-run.cjs +2 -2
- package/dist/api/document-run.cjs.map +1 -1
- package/dist/api/document-run.mjs +2 -2
- package/dist/api/document-run.mjs.map +1 -1
- package/dist/api/legacy-utils.cjs.map +1 -1
- package/dist/api/legacy-utils.mjs.map +1 -1
- package/dist/api/openapi-ts.cjs +8 -4
- package/dist/api/openapi-ts.cjs.map +1 -1
- package/dist/api/openapi-ts.mjs +8 -5
- package/dist/api/openapi-ts.mjs.map +1 -1
- package/dist/api/schema-callbacks.cjs +36 -12
- package/dist/api/schema-callbacks.cjs.map +1 -1
- package/dist/api/schema-callbacks.mjs +36 -12
- package/dist/api/schema-callbacks.mjs.map +1 -1
- package/dist/api/transform-context.cjs +7 -3
- package/dist/api/transform-context.cjs.map +1 -1
- package/dist/api/transform-context.mjs +7 -3
- package/dist/api/transform-context.mjs.map +1 -1
- package/dist/api/transform-schema.cjs +40 -10
- package/dist/api/transform-schema.cjs.map +1 -1
- package/dist/api/transform-schema.mjs +41 -11
- package/dist/api/transform-schema.mjs.map +1 -1
- package/dist/application/print/text-writer.cjs +10 -3
- package/dist/application/print/text-writer.cjs.map +1 -1
- package/dist/application/print/text-writer.mjs +10 -3
- package/dist/application/print/text-writer.mjs.map +1 -1
- package/dist/application/stack-overflow.cjs +2 -1
- package/dist/application/stack-overflow.cjs.map +1 -1
- package/dist/application/stack-overflow.mjs +2 -1
- package/dist/application/stack-overflow.mjs.map +1 -1
- package/dist/application/transform/document/components.cjs +1 -1
- package/dist/application/transform/document/components.cjs.map +1 -1
- package/dist/application/transform/document/components.mjs +2 -2
- package/dist/application/transform/document/components.mjs.map +1 -1
- package/dist/application/transform/document/declared-type-names.cjs +23 -0
- package/dist/application/transform/document/declared-type-names.cjs.map +1 -0
- package/dist/application/transform/document/declared-type-names.mjs +20 -0
- package/dist/application/transform/document/declared-type-names.mjs.map +1 -0
- package/dist/application/transform/document/defs-root.cjs +1 -1
- package/dist/application/transform/document/defs-root.cjs.map +1 -1
- package/dist/application/transform/document/defs-root.mjs +2 -2
- package/dist/application/transform/document/defs-root.mjs.map +1 -1
- package/dist/application/transform/document/document.cjs +4 -1
- package/dist/application/transform/document/document.cjs.map +1 -1
- package/dist/application/transform/document/document.mjs +3 -2
- package/dist/application/transform/document/document.mjs.map +1 -1
- package/dist/application/transform/document/enum-names-given-back.cjs +62 -0
- package/dist/application/transform/document/enum-names-given-back.cjs.map +1 -0
- package/dist/application/transform/document/enum-names-given-back.mjs +58 -0
- package/dist/application/transform/document/enum-names-given-back.mjs.map +1 -0
- package/dist/application/transform/document/global-type-references.cjs +1 -0
- package/dist/application/transform/document/global-type-references.cjs.map +1 -1
- package/dist/application/transform/document/global-type-references.mjs +1 -1
- package/dist/application/transform/document/global-type-references.mjs.map +1 -1
- package/dist/application/transform/document/media-type.cjs +2 -2
- package/dist/application/transform/document/media-type.cjs.map +1 -1
- package/dist/application/transform/document/media-type.mjs +3 -3
- package/dist/application/transform/document/media-type.mjs.map +1 -1
- package/dist/application/transform/document/operation-keys-written.cjs +26 -0
- package/dist/application/transform/document/operation-keys-written.cjs.map +1 -0
- package/dist/application/transform/document/operation-keys-written.mjs +24 -0
- package/dist/application/transform/document/operation-keys-written.mjs.map +1 -0
- package/dist/application/transform/document/operation.cjs +1 -1
- package/dist/application/transform/document/operation.cjs.map +1 -1
- package/dist/application/transform/document/operation.mjs +2 -2
- package/dist/application/transform/document/operation.mjs.map +1 -1
- package/dist/application/transform/document/parameter-entries.cjs +34 -0
- package/dist/application/transform/document/parameter-entries.cjs.map +1 -0
- package/dist/application/transform/document/parameter-entries.mjs +30 -0
- package/dist/application/transform/document/parameter-entries.mjs.map +1 -0
- package/dist/application/transform/document/parameter.cjs +12 -4
- package/dist/application/transform/document/parameter.cjs.map +1 -1
- package/dist/application/transform/document/parameter.mjs +13 -5
- package/dist/application/transform/document/parameter.mjs.map +1 -1
- package/dist/application/transform/document/parameters.cjs +6 -29
- package/dist/application/transform/document/parameters.cjs.map +1 -1
- package/dist/application/transform/document/parameters.mjs +6 -29
- package/dist/application/transform/document/parameters.mjs.map +1 -1
- package/dist/application/transform/document/path-item.cjs +11 -14
- package/dist/application/transform/document/path-item.cjs.map +1 -1
- package/dist/application/transform/document/path-item.mjs +12 -16
- package/dist/application/transform/document/path-item.mjs.map +1 -1
- package/dist/application/transform/document/paths-enum.cjs +1 -0
- package/dist/application/transform/document/paths-enum.cjs.map +1 -1
- package/dist/application/transform/document/paths-enum.mjs +1 -1
- package/dist/application/transform/document/paths-enum.mjs.map +1 -1
- package/dist/application/transform/document/paths.cjs +5 -1
- package/dist/application/transform/document/paths.cjs.map +1 -1
- package/dist/application/transform/document/paths.mjs +6 -2
- package/dist/application/transform/document/paths.mjs.map +1 -1
- package/dist/application/transform/document/referenced-parameter.cjs +80 -0
- package/dist/application/transform/document/referenced-parameter.cjs.map +1 -0
- package/dist/application/transform/document/referenced-parameter.mjs +78 -0
- package/dist/application/transform/document/referenced-parameter.mjs.map +1 -0
- package/dist/application/transform/document/request-body.cjs +1 -1
- package/dist/application/transform/document/request-body.cjs.map +1 -1
- package/dist/application/transform/document/request-body.mjs +2 -2
- package/dist/application/transform/document/request-body.mjs.map +1 -1
- package/dist/application/transform/document/response.cjs +2 -2
- package/dist/application/transform/document/response.cjs.map +1 -1
- package/dist/application/transform/document/response.mjs +3 -3
- package/dist/application/transform/document/response.mjs.map +1 -1
- package/dist/application/transform/document/responses.cjs +1 -1
- package/dist/application/transform/document/responses.cjs.map +1 -1
- package/dist/application/transform/document/responses.mjs +2 -2
- package/dist/application/transform/document/responses.mjs.map +1 -1
- package/dist/application/transform/document/root-type-aliases.cjs +8 -23
- package/dist/application/transform/document/root-type-aliases.cjs.map +1 -1
- package/dist/application/transform/document/root-type-aliases.mjs +8 -24
- package/dist/application/transform/document/root-type-aliases.mjs.map +1 -1
- package/dist/application/transform/document/type-resolution.cjs +3 -1
- package/dist/application/transform/document/type-resolution.cjs.map +1 -1
- package/dist/application/transform/document/type-resolution.mjs +3 -1
- package/dist/application/transform/document/type-resolution.mjs.map +1 -1
- package/dist/application/transform/document/webhooks.cjs +1 -1
- package/dist/application/transform/document/webhooks.cjs.map +1 -1
- package/dist/application/transform/document/webhooks.mjs +2 -2
- package/dist/application/transform/document/webhooks.mjs.map +1 -1
- package/dist/application/transform/footer/document-footer.cjs +10 -2
- package/dist/application/transform/footer/document-footer.cjs.map +1 -1
- package/dist/application/transform/footer/document-footer.mjs +10 -2
- package/dist/application/transform/footer/document-footer.mjs.map +1 -1
- package/dist/application/transform/footer/enum-name-claims.cjs +48 -0
- package/dist/application/transform/footer/enum-name-claims.cjs.map +1 -0
- package/dist/application/transform/footer/enum-name-claims.mjs +46 -0
- package/dist/application/transform/footer/enum-name-claims.mjs.map +1 -0
- package/dist/application/transform/footer/operation-keys.cjs +23 -0
- package/dist/application/transform/footer/operation-keys.cjs.map +1 -0
- package/dist/application/transform/footer/operation-keys.mjs +21 -0
- package/dist/application/transform/footer/operation-keys.mjs.map +1 -0
- package/dist/application/transform/footer/type-evaluation.cjs +4 -4
- package/dist/application/transform/footer/type-evaluation.cjs.map +1 -1
- package/dist/application/transform/footer/type-evaluation.mjs +4 -4
- package/dist/application/transform/footer/type-evaluation.mjs.map +1 -1
- package/dist/application/transform/helper-types.cjs +1 -1
- package/dist/application/transform/helper-types.cjs.map +1 -1
- package/dist/application/transform/helper-types.mjs +1 -1
- package/dist/application/transform/helper-types.mjs.map +1 -1
- package/dist/application/transform/numbered-names.cjs +9 -0
- package/dist/application/transform/numbered-names.cjs.map +1 -1
- package/dist/application/transform/numbered-names.mjs +9 -1
- package/dist/application/transform/numbered-names.mjs.map +1 -1
- package/dist/application/transform/ref-pointer/generated-location.cjs +1 -1
- package/dist/application/transform/ref-pointer/generated-location.cjs.map +1 -1
- package/dist/application/transform/ref-pointer/generated-location.mjs +2 -2
- package/dist/application/transform/ref-pointer/generated-location.mjs.map +1 -1
- package/dist/application/transform/ref-type.cjs +2 -1
- package/dist/application/transform/ref-type.cjs.map +1 -1
- package/dist/application/transform/ref-type.mjs +2 -1
- package/dist/application/transform/ref-type.mjs.map +1 -1
- package/dist/application/transform/schema/composition-type.cjs +1 -1
- package/dist/application/transform/schema/composition-type.cjs.map +1 -1
- package/dist/application/transform/schema/composition-type.mjs +2 -2
- package/dist/application/transform/schema/composition-type.mjs.map +1 -1
- package/dist/application/transform/schema/enum-rule.cjs +1 -1
- package/dist/application/transform/schema/enum-rule.cjs.map +1 -1
- package/dist/application/transform/schema/enum-rule.mjs +2 -2
- package/dist/application/transform/schema/enum-rule.mjs.map +1 -1
- package/dist/application/transform/schema/object-type.cjs +3 -3
- package/dist/application/transform/schema/object-type.cjs.map +1 -1
- package/dist/application/transform/schema/object-type.mjs +4 -4
- package/dist/application/transform/schema/object-type.mjs.map +1 -1
- package/dist/application/transform/schema/ref-siblings.cjs +47 -0
- package/dist/application/transform/schema/ref-siblings.cjs.map +1 -0
- package/dist/application/transform/schema/ref-siblings.mjs +45 -0
- package/dist/application/transform/schema/ref-siblings.mjs.map +1 -0
- package/dist/application/transform/schema/schema-transform.cjs +4 -2
- package/dist/application/transform/schema/schema-transform.cjs.map +1 -1
- package/dist/application/transform/schema/schema-transform.mjs +4 -2
- package/dist/application/transform/schema/schema-transform.mjs.map +1 -1
- package/dist/application/transform/schema-comment.cjs +5 -1
- package/dist/application/transform/schema-comment.cjs.map +1 -1
- package/dist/application/transform/schema-comment.mjs +5 -1
- package/dist/application/transform/schema-comment.mjs.map +1 -1
- package/dist/cli/api-settings.cjs +62 -6
- package/dist/cli/api-settings.cjs.map +1 -1
- package/dist/cli/api-settings.mjs +60 -7
- package/dist/cli/api-settings.mjs.map +1 -1
- package/dist/cli/api-writes.cjs +72 -0
- package/dist/cli/api-writes.cjs.map +1 -0
- package/dist/cli/api-writes.mjs +69 -0
- package/dist/cli/api-writes.mjs.map +1 -0
- package/dist/cli/cli-errors.cjs +12 -1
- package/dist/cli/cli-errors.cjs.map +1 -1
- package/dist/cli/cli-errors.mjs +12 -1
- package/dist/cli/cli-errors.mjs.map +1 -1
- package/dist/cli/cli-output.cjs +106 -1
- package/dist/cli/cli-output.cjs.map +1 -1
- package/dist/cli/cli-output.mjs +99 -2
- package/dist/cli/cli-output.mjs.map +1 -1
- package/dist/cli/main.cjs +5 -1
- package/dist/cli/main.cjs.map +1 -1
- package/dist/cli/main.mjs +6 -2
- package/dist/cli/main.mjs.map +1 -1
- package/dist/cli/redocly-apis.cjs +82 -36
- package/dist/cli/redocly-apis.cjs.map +1 -1
- package/dist/cli/redocly-apis.mjs +85 -39
- package/dist/cli/redocly-apis.mjs.map +1 -1
- package/dist/cli/run-cli.cjs +13 -7
- package/dist/cli/run-cli.cjs.map +1 -1
- package/dist/cli/run-cli.mjs +14 -8
- package/dist/cli/run-cli.mjs.map +1 -1
- package/dist/domain/append-all.cjs +10 -0
- package/dist/domain/append-all.cjs.map +1 -0
- package/dist/domain/append-all.mjs +8 -0
- package/dist/domain/append-all.mjs.map +1 -0
- package/dist/domain/cause-secrets.cjs +37 -0
- package/dist/domain/cause-secrets.cjs.map +1 -0
- package/dist/domain/cause-secrets.mjs +35 -0
- package/dist/domain/cause-secrets.mjs.map +1 -0
- package/dist/domain/errors.cjs +9 -3
- package/dist/domain/errors.cjs.map +1 -1
- package/dist/domain/errors.mjs +9 -3
- package/dist/domain/errors.mjs.map +1 -1
- package/dist/domain/ir/identifier-text.cjs.map +1 -1
- package/dist/domain/ir/identifier-text.mjs +1 -1
- package/dist/domain/ir/identifier-text.mjs.map +1 -1
- package/dist/domain/ir/ir-shape.cjs +187 -0
- package/dist/domain/ir/ir-shape.cjs.map +1 -0
- package/dist/domain/ir/ir-shape.mjs +184 -0
- package/dist/domain/ir/ir-shape.mjs.map +1 -0
- package/dist/domain/ir/newer-identifier-ranges.cjs +182 -29
- package/dist/domain/ir/newer-identifier-ranges.cjs.map +1 -1
- package/dist/domain/ir/newer-identifier-ranges.mjs +182 -29
- package/dist/domain/ir/newer-identifier-ranges.mjs.map +1 -1
- package/dist/domain/openapi/alias-expansion.cjs +3 -1
- package/dist/domain/openapi/alias-expansion.cjs.map +1 -1
- package/dist/domain/openapi/alias-expansion.mjs +3 -1
- package/dist/domain/openapi/alias-expansion.mjs.map +1 -1
- package/dist/domain/openapi/discriminated-union.cjs +3 -3
- package/dist/domain/openapi/discriminated-union.cjs.map +1 -1
- package/dist/domain/openapi/discriminated-union.mjs +4 -4
- package/dist/domain/openapi/discriminated-union.mjs.map +1 -1
- package/dist/domain/openapi/discriminator-conflicts.cjs +10 -6
- package/dist/domain/openapi/discriminator-conflicts.cjs.map +1 -1
- package/dist/domain/openapi/discriminator-conflicts.mjs +11 -7
- package/dist/domain/openapi/discriminator-conflicts.mjs.map +1 -1
- package/dist/domain/openapi/json-pointer.cjs +43 -1
- package/dist/domain/openapi/json-pointer.cjs.map +1 -1
- package/dist/domain/openapi/json-pointer.mjs +40 -2
- package/dist/domain/openapi/json-pointer.mjs.map +1 -1
- package/dist/domain/openapi/schema-dialect.cjs +15 -0
- package/dist/domain/openapi/schema-dialect.cjs.map +1 -0
- package/dist/domain/openapi/schema-dialect.mjs +12 -0
- package/dist/domain/openapi/schema-dialect.mjs.map +1 -0
- package/dist/domain/openapi/unsupported-features.cjs +1 -1
- package/dist/domain/openapi/unsupported-features.cjs.map +1 -1
- package/dist/domain/openapi/unsupported-features.mjs +2 -2
- package/dist/domain/openapi/unsupported-features.mjs.map +1 -1
- package/dist/domain/output-fixes.cjs +14 -0
- package/dist/domain/output-fixes.cjs.map +1 -1
- package/dist/domain/output-fixes.mjs +14 -0
- package/dist/domain/output-fixes.mjs.map +1 -1
- package/dist/domain/url-secrets.cjs +48 -0
- package/dist/domain/url-secrets.cjs.map +1 -0
- package/dist/domain/url-secrets.mjs +45 -0
- package/dist/domain/url-secrets.mjs.map +1 -0
- package/dist/index.d.cts +22 -4
- package/dist/index.d.mts +22 -4
- package/dist/index.d.ts +22 -4
- package/package.json +4 -5
- package/src/adapters/node-file-system/file-claims.ts +138 -0
- package/src/adapters/node-file-system/file-identity.ts +137 -0
- package/src/adapters/node-file-system/node-file-system.ts +145 -18
- package/src/adapters/redocly-loader/bundled-mapping-copies.ts +95 -0
- package/src/adapters/redocly-loader/bundled-ref-repair.ts +2 -2
- package/src/adapters/redocly-loader/loaded-documents.ts +46 -0
- package/src/adapters/redocly-loader/redocly-schema-loader.ts +18 -24
- package/src/adapters/redocly-loader/ref-access.ts +37 -3
- package/src/adapters/redocly-loader/ref-holders.ts +3 -3
- package/src/adapters/redocly-loader/remote-body-limit.ts +66 -0
- package/src/adapters/redocly-loader/remote-fetch.ts +74 -11
- package/src/adapters/redocly-loader/remote-node-limit.ts +62 -0
- package/src/adapters/redocly-loader/schema-load-errors.ts +52 -13
- package/src/adapters/redocly-loader/schema-source.ts +20 -8
- package/src/adapters/redocly-loader/unsupported-keys.ts +3 -7
- package/src/adapters/terminal-logger/terminal-logger.ts +10 -5
- package/src/api/default-ports.ts +33 -4
- package/src/api/discriminator-enum-parent.ts +3 -3
- package/src/api/discriminator-other-owners.ts +5 -3
- package/src/api/discriminator-patch.ts +5 -1
- package/src/api/discriminator-scan.ts +16 -8
- package/src/api/document-run.ts +4 -3
- package/src/api/legacy-utils.ts +5 -1
- package/src/api/openapi-ts.ts +20 -5
- package/src/api/run-context.ts +3 -0
- package/src/api/schema-callbacks.ts +60 -17
- package/src/api/transform-context.ts +7 -3
- package/src/api/transform-schema.ts +64 -12
- package/src/application/ports/file-system.ts +39 -0
- package/src/application/ports/schema-loader.ts +11 -1
- package/src/application/print/text-writer.ts +10 -3
- package/src/application/stack-overflow.ts +9 -5
- package/src/application/transform/document/components.ts +2 -2
- package/src/application/transform/document/declared-type-names.ts +36 -0
- package/src/application/transform/document/defs-root.ts +2 -2
- package/src/application/transform/document/document.ts +4 -3
- package/src/application/transform/document/enum-names-given-back.ts +91 -0
- package/src/application/transform/document/global-type-references.ts +1 -1
- package/src/application/transform/document/media-type.ts +4 -3
- package/src/application/transform/document/operation-keys-written.ts +27 -0
- package/src/application/transform/document/operation.ts +2 -2
- package/src/application/transform/document/parameter-entries.ts +70 -0
- package/src/application/transform/document/parameter.ts +21 -9
- package/src/application/transform/document/parameters.ts +11 -56
- package/src/application/transform/document/path-item.ts +13 -31
- package/src/application/transform/document/paths-enum.ts +1 -1
- package/src/application/transform/document/paths.ts +6 -2
- package/src/application/transform/document/referenced-parameter.ts +146 -0
- package/src/application/transform/document/request-body.ts +2 -2
- package/src/application/transform/document/response.ts +3 -3
- package/src/application/transform/document/responses.ts +2 -2
- package/src/application/transform/document/root-type-aliases.ts +17 -38
- package/src/application/transform/document/type-resolution.ts +2 -1
- package/src/application/transform/document/webhooks.ts +2 -2
- package/src/application/transform/footer/document-footer.ts +18 -1
- package/src/application/transform/footer/enum-name-claims.ts +62 -0
- package/src/application/transform/footer/operation-keys.ts +28 -0
- package/src/application/transform/footer/type-evaluation.ts +4 -4
- package/src/application/transform/helper-types.ts +6 -5
- package/src/application/transform/numbered-names.ts +15 -0
- package/src/application/transform/ref-pointer/generated-location.ts +2 -2
- package/src/application/transform/ref-type.ts +2 -1
- package/src/application/transform/schema/composition-type.ts +2 -2
- package/src/application/transform/schema/enum-rule.ts +6 -2
- package/src/application/transform/schema/object-type.ts +4 -4
- package/src/application/transform/schema/ref-siblings.ts +76 -0
- package/src/application/transform/schema/schema-context.ts +3 -0
- package/src/application/transform/schema/schema-transform.ts +4 -2
- package/src/application/transform/schema-comment.ts +5 -1
- package/src/application/transform/transform-context.ts +5 -0
- package/src/cli/api-settings.ts +82 -7
- package/src/cli/api-writes.ts +117 -0
- package/src/cli/cli-dependencies.ts +21 -4
- package/src/cli/cli-errors.ts +20 -1
- package/src/cli/cli-output.ts +186 -7
- package/src/cli/main.ts +6 -3
- package/src/cli/redocly-apis.ts +153 -48
- package/src/cli/run-cli.ts +37 -8
- package/src/domain/append-all.ts +10 -0
- package/src/domain/cause-secrets.ts +52 -0
- package/src/domain/errors.ts +14 -5
- package/src/domain/ir/identifier-text.ts +6 -5
- package/src/domain/ir/ir-shape.ts +299 -0
- package/src/domain/ir/newer-identifier-ranges.ts +183 -30
- package/src/domain/openapi/alias-expansion.ts +4 -1
- package/src/domain/openapi/discriminated-union.ts +6 -4
- package/src/domain/openapi/discriminator-conflicts.ts +21 -7
- package/src/domain/openapi/document-object.ts +2 -0
- package/src/domain/openapi/json-pointer.ts +96 -7
- package/src/domain/openapi/schema-dialect.ts +22 -0
- package/src/domain/openapi/unsupported-features.ts +2 -2
- package/src/domain/output-fixes.ts +21 -2
- package/src/domain/url-secrets.ts +72 -0
- package/src/types/generator-options.ts +1 -1
- package/dist/cli/main.d.cts +0 -2
- package/dist/cli/main.d.mts +0 -2
- package/dist/cli/main.d.ts +0 -2
- package/dist/domain/url-credentials.cjs +0 -10
- package/dist/domain/url-credentials.cjs.map +0 -1
- package/dist/domain/url-credentials.mjs +0 -8
- package/dist/domain/url-credentials.mjs.map +0 -1
- package/src/domain/url-credentials.ts +0 -18
|
@@ -0,0 +1,299 @@
|
|
|
1
|
+
import { hasIdentifierStart, withIdentifierParts } from "./identifier-text.js";
|
|
2
|
+
import type { IrKeyword, IrPropertySignature, IrType } from "./nodes.js";
|
|
3
|
+
|
|
4
|
+
/**
|
|
5
|
+
* Whether a value from outside the package (an IR callback's result) is IR the printer writes as
|
|
6
|
+
* valid TypeScript. JavaScript callers can return any value, and the type checker of a
|
|
7
|
+
* TypeScript caller does not stop `{ kind: "union", types: [] }` or an empty type text either:
|
|
8
|
+
* without this check such a result crashed the printer with an untyped error, or printed text
|
|
9
|
+
* such as `a?: ;`. Raw type text is printed as written, so only blank text is rejected; the text
|
|
10
|
+
* itself is the caller's TypeScript, which the caller's compiler checks.
|
|
11
|
+
*/
|
|
12
|
+
|
|
13
|
+
type Fields = Readonly<Record<string, unknown>>;
|
|
14
|
+
|
|
15
|
+
const KEYWORDS: ReadonlySet<string> = new Set<IrKeyword>([
|
|
16
|
+
"string",
|
|
17
|
+
"number",
|
|
18
|
+
"boolean",
|
|
19
|
+
"null",
|
|
20
|
+
"undefined",
|
|
21
|
+
"unknown",
|
|
22
|
+
"never",
|
|
23
|
+
]);
|
|
24
|
+
|
|
25
|
+
const STRING_ENCODINGS: ReadonlySet<unknown> = new Set([undefined, "json", "escaped"]);
|
|
26
|
+
|
|
27
|
+
function isFields(value: unknown): value is Fields {
|
|
28
|
+
return typeof value === "object" && value !== null;
|
|
29
|
+
}
|
|
30
|
+
|
|
31
|
+
function isText(value: unknown): value is string {
|
|
32
|
+
return typeof value === "string" && value.trim() !== "";
|
|
33
|
+
}
|
|
34
|
+
|
|
35
|
+
function isIdentifier(text: unknown): boolean {
|
|
36
|
+
return typeof text === "string" && hasIdentifierStart(text) && withIdentifierParts(text) === text;
|
|
37
|
+
}
|
|
38
|
+
|
|
39
|
+
/** The prefix of a type query: the generator writes `typeof Status` as a reference name. */
|
|
40
|
+
const TYPE_QUERY_PREFIX = "typeof ";
|
|
41
|
+
|
|
42
|
+
/**
|
|
43
|
+
* Words that cannot start the name of a type query (`typeof <name>`): `import` starts an import
|
|
44
|
+
* type, and strict mode reserves the others. Found with the TypeScript 5.4 and 6.0 compilers
|
|
45
|
+
* (syntax and grammar errors) on `type A = { a?: typeof <name> }`, over every reserved word and
|
|
46
|
+
* contextual keyword. A name after a `.` may be any identifier, reserved words included.
|
|
47
|
+
*/
|
|
48
|
+
const NOT_TYPE_QUERY_START: ReadonlySet<string> = new Set(
|
|
49
|
+
"import implements interface let package private protected public static yield".split(" "),
|
|
50
|
+
);
|
|
51
|
+
/** Words that cannot start a type reference either: they are operators of a type there. */
|
|
52
|
+
const NOT_TYPE_REFERENCE_START: ReadonlySet<string> = new Set([
|
|
53
|
+
...NOT_TYPE_QUERY_START,
|
|
54
|
+
..."new typeof infer keyof readonly unique".split(" "),
|
|
55
|
+
]);
|
|
56
|
+
|
|
57
|
+
/**
|
|
58
|
+
* A name TypeScript reads as the name of a type: identifiers joined by `.` (`Status`,
|
|
59
|
+
* `Status.active`), optionally as a type query (`typeof Status`). Text such as `a b` or `A<B>`
|
|
60
|
+
* would print as other or invalid TypeScript, and so would `keyof` or `let` as the first name;
|
|
61
|
+
* type arguments go in `typeArguments`.
|
|
62
|
+
*/
|
|
63
|
+
function isTypeName(text: unknown): boolean {
|
|
64
|
+
if (typeof text !== "string") {
|
|
65
|
+
return false;
|
|
66
|
+
}
|
|
67
|
+
const isQuery = text.startsWith(TYPE_QUERY_PREFIX);
|
|
68
|
+
const names = (isQuery ? text.slice(TYPE_QUERY_PREFIX.length) : text).split(".");
|
|
69
|
+
const reserved = isQuery ? NOT_TYPE_QUERY_START : NOT_TYPE_REFERENCE_START;
|
|
70
|
+
return names.every(isIdentifier) && !reserved.has(names[0] as string);
|
|
71
|
+
}
|
|
72
|
+
|
|
73
|
+
/** A non-negative number written as JavaScript writes it, as `toPropertyName` makes them. */
|
|
74
|
+
function isNumberName(text: unknown): boolean {
|
|
75
|
+
return typeof text === "string" && String(Number(text)) === text && !text.startsWith("-");
|
|
76
|
+
}
|
|
77
|
+
|
|
78
|
+
/** Walks one value; `ancestors` makes a cycle invalid instead of an endless recursion. */
|
|
79
|
+
class IrShapeCheck {
|
|
80
|
+
readonly #ancestors = new Set<object>();
|
|
81
|
+
|
|
82
|
+
isType(value: unknown): boolean {
|
|
83
|
+
return this.#within(value, (node) => {
|
|
84
|
+
const check = TYPE_CHECKS[node.kind as IrType["kind"]];
|
|
85
|
+
return Object.hasOwn(TYPE_CHECKS, String(node.kind)) && check(node, this);
|
|
86
|
+
});
|
|
87
|
+
}
|
|
88
|
+
|
|
89
|
+
isTypeList(value: unknown, isEmptyAllowed: boolean): boolean {
|
|
90
|
+
return (
|
|
91
|
+
Array.isArray(value) &&
|
|
92
|
+
(isEmptyAllowed || value.length > 0) &&
|
|
93
|
+
value.every((entry) => this.isType(entry))
|
|
94
|
+
);
|
|
95
|
+
}
|
|
96
|
+
|
|
97
|
+
isMember(value: unknown): boolean {
|
|
98
|
+
return isFields(value) && value.kind === "indexSignature"
|
|
99
|
+
? this.#within(value, (node) => this.#isIndexSignature(node))
|
|
100
|
+
: this.isProperty(value);
|
|
101
|
+
}
|
|
102
|
+
|
|
103
|
+
isProperty(value: unknown): boolean {
|
|
104
|
+
return this.#within(
|
|
105
|
+
value,
|
|
106
|
+
(node) =>
|
|
107
|
+
node.kind === "property" &&
|
|
108
|
+
isPropertyName(node.name) &&
|
|
109
|
+
this.isType(node.type) &&
|
|
110
|
+
typeof node.isOptional === "boolean" &&
|
|
111
|
+
typeof node.isReadonly === "boolean" &&
|
|
112
|
+
areComments(node.comments),
|
|
113
|
+
);
|
|
114
|
+
}
|
|
115
|
+
|
|
116
|
+
#isIndexSignature(node: Fields): boolean {
|
|
117
|
+
return (
|
|
118
|
+
isIdentifier(node.parameterName) &&
|
|
119
|
+
this.isType(node.parameterType) &&
|
|
120
|
+
isIndexParameterType(node.parameterType as IrType) &&
|
|
121
|
+
this.isType(node.type) &&
|
|
122
|
+
typeof node.isReadonly === "boolean" &&
|
|
123
|
+
areComments(node.comments)
|
|
124
|
+
);
|
|
125
|
+
}
|
|
126
|
+
|
|
127
|
+
#within(value: unknown, check: (node: Fields) => boolean): boolean {
|
|
128
|
+
if (!isFields(value) || this.#ancestors.has(value)) {
|
|
129
|
+
return false;
|
|
130
|
+
}
|
|
131
|
+
this.#ancestors.add(value);
|
|
132
|
+
try {
|
|
133
|
+
return check(value);
|
|
134
|
+
} finally {
|
|
135
|
+
this.#ancestors.delete(value);
|
|
136
|
+
}
|
|
137
|
+
}
|
|
138
|
+
}
|
|
139
|
+
|
|
140
|
+
/**
|
|
141
|
+
* What an index signature parameter type reduces to: `string`, `number`, or an object type that
|
|
142
|
+
* tags one of them (`string & {}`), each as an atom; `unresolved` for a name, an indexed access
|
|
143
|
+
* (`K["a"]`) or type text, which only TypeScript can resolve; undefined for a type that can never
|
|
144
|
+
* be one (a literal, an array, a tuple, `readonly`, another keyword).
|
|
145
|
+
*/
|
|
146
|
+
type IndexAtom = "string" | "number" | "tag";
|
|
147
|
+
type IndexKeys = ReadonlySet<IndexAtom> | "unresolved";
|
|
148
|
+
|
|
149
|
+
/** The keywords an index signature takes as its parameter type, as atoms. */
|
|
150
|
+
const INDEX_KEYWORD_ATOMS: ReadonlyMap<string, IndexAtom> = new Map([
|
|
151
|
+
["string", "string"],
|
|
152
|
+
["number", "number"],
|
|
153
|
+
]);
|
|
154
|
+
|
|
155
|
+
const TAG: IndexAtom = "tag";
|
|
156
|
+
const UNRESOLVED = "unresolved";
|
|
157
|
+
|
|
158
|
+
/** One atom of each side together: a tag keeps the other side, two keys must be the same. */
|
|
159
|
+
function intersectAtoms(left: IndexAtom, right: IndexAtom): IndexAtom | undefined {
|
|
160
|
+
if (left === right || right === TAG) {
|
|
161
|
+
return left;
|
|
162
|
+
}
|
|
163
|
+
return left === TAG ? right : undefined;
|
|
164
|
+
}
|
|
165
|
+
|
|
166
|
+
/** `A & B` over atoms, as TypeScript spreads an intersection over the members of a union. */
|
|
167
|
+
function intersectKeys(left: IndexKeys, right: IndexKeys): IndexKeys {
|
|
168
|
+
if (left === UNRESOLVED || right === UNRESOLVED) {
|
|
169
|
+
return UNRESOLVED;
|
|
170
|
+
}
|
|
171
|
+
const atoms = [...left].flatMap((atom) => [...right].map((other) => intersectAtoms(atom, other)));
|
|
172
|
+
return new Set(atoms.filter((atom) => atom !== undefined));
|
|
173
|
+
}
|
|
174
|
+
|
|
175
|
+
/** `A | B` over atoms. */
|
|
176
|
+
function unionKeys(left: IndexKeys, right: IndexKeys): IndexKeys {
|
|
177
|
+
return left === UNRESOLVED || right === UNRESOLVED ? UNRESOLVED : new Set([...left, ...right]);
|
|
178
|
+
}
|
|
179
|
+
|
|
180
|
+
/** The keys of each member combined, or undefined when one member can never be a key. */
|
|
181
|
+
function combineKeys(
|
|
182
|
+
types: readonly IrType[],
|
|
183
|
+
combine: (left: IndexKeys, right: IndexKeys) => IndexKeys,
|
|
184
|
+
): IndexKeys | undefined {
|
|
185
|
+
let combined: IndexKeys | undefined;
|
|
186
|
+
for (const member of types) {
|
|
187
|
+
const keys = indexKeys(member);
|
|
188
|
+
if (keys === undefined) {
|
|
189
|
+
return undefined;
|
|
190
|
+
}
|
|
191
|
+
combined = combined === undefined ? keys : combine(combined, keys);
|
|
192
|
+
}
|
|
193
|
+
return combined;
|
|
194
|
+
}
|
|
195
|
+
|
|
196
|
+
function indexKeys(type: IrType): IndexKeys | undefined {
|
|
197
|
+
switch (type.kind) {
|
|
198
|
+
case "keyword": {
|
|
199
|
+
const atom = INDEX_KEYWORD_ATOMS.get(type.keyword);
|
|
200
|
+
return atom === undefined ? undefined : new Set([atom]);
|
|
201
|
+
}
|
|
202
|
+
case "object":
|
|
203
|
+
return new Set([TAG]);
|
|
204
|
+
case "reference":
|
|
205
|
+
case "indexedAccess":
|
|
206
|
+
case "raw":
|
|
207
|
+
return UNRESOLVED;
|
|
208
|
+
case "union":
|
|
209
|
+
return combineKeys(type.types, unionKeys);
|
|
210
|
+
case "intersection":
|
|
211
|
+
return combineKeys(type.types, intersectKeys);
|
|
212
|
+
default:
|
|
213
|
+
return undefined;
|
|
214
|
+
}
|
|
215
|
+
}
|
|
216
|
+
|
|
217
|
+
/**
|
|
218
|
+
* Whether a type can be the parameter type of an index signature. TypeScript takes `string`,
|
|
219
|
+
* `number`, `symbol`, a template literal type, a union of these, or one of them tagged by an
|
|
220
|
+
* intersection (`string & {}`); anything else fails with TS1268 or TS1337. It decides by the
|
|
221
|
+
* resolved type, so `string & "a"` (the literal `"a"`), `string & number` (`never`) and an
|
|
222
|
+
* object type alone are refused, and a name, an indexed access and type text pass for TypeScript
|
|
223
|
+
* to check.
|
|
224
|
+
*/
|
|
225
|
+
function isIndexParameterType(type: IrType): boolean {
|
|
226
|
+
const keys = indexKeys(type);
|
|
227
|
+
return keys === UNRESOLVED || (keys !== undefined && keys.size > 0 && !keys.has(TAG));
|
|
228
|
+
}
|
|
229
|
+
|
|
230
|
+
function isPropertyName(value: unknown): boolean {
|
|
231
|
+
if (!isFields(value)) {
|
|
232
|
+
return false;
|
|
233
|
+
}
|
|
234
|
+
switch (value.kind) {
|
|
235
|
+
case "identifier":
|
|
236
|
+
return isIdentifier(value.text);
|
|
237
|
+
case "number":
|
|
238
|
+
return isNumberName(value.text);
|
|
239
|
+
case "string":
|
|
240
|
+
return typeof value.value === "string";
|
|
241
|
+
default:
|
|
242
|
+
return false;
|
|
243
|
+
}
|
|
244
|
+
}
|
|
245
|
+
|
|
246
|
+
/** A block comment must not end itself early (`*\/`); a line comment must stay on its line. */
|
|
247
|
+
function isComment(value: unknown): boolean {
|
|
248
|
+
if (!isFields(value) || typeof value.text !== "string") {
|
|
249
|
+
return false;
|
|
250
|
+
}
|
|
251
|
+
return value.kind === "block"
|
|
252
|
+
? !value.text.includes("*/")
|
|
253
|
+
: value.kind === "line" && !/[\n\r\u2028\u2029]/.test(value.text);
|
|
254
|
+
}
|
|
255
|
+
|
|
256
|
+
function areComments(value: unknown): boolean {
|
|
257
|
+
return Array.isArray(value) && value.every(isComment);
|
|
258
|
+
}
|
|
259
|
+
|
|
260
|
+
function isTupleElement(value: unknown, check: IrShapeCheck): boolean {
|
|
261
|
+
return (
|
|
262
|
+
isFields(value) &&
|
|
263
|
+
check.isType(value.type) &&
|
|
264
|
+
typeof value.isRest === "boolean" &&
|
|
265
|
+
typeof value.isOptional === "boolean" &&
|
|
266
|
+
!(value.isRest && value.isOptional)
|
|
267
|
+
);
|
|
268
|
+
}
|
|
269
|
+
|
|
270
|
+
/** One check per kind; the `Record` makes a new kind fail to compile until it is checked. */
|
|
271
|
+
const TYPE_CHECKS: Readonly<
|
|
272
|
+
Record<IrType["kind"], (node: Fields, check: IrShapeCheck) => boolean>
|
|
273
|
+
> = {
|
|
274
|
+
keyword: (node) => KEYWORDS.has(node.keyword as string),
|
|
275
|
+
stringLiteral: (node) => typeof node.value === "string" && STRING_ENCODINGS.has(node.encoding),
|
|
276
|
+
numberLiteral: (node) => Number.isFinite(node.value),
|
|
277
|
+
booleanLiteral: (node) => typeof node.value === "boolean",
|
|
278
|
+
reference: (node, check) => isTypeName(node.name) && check.isTypeList(node.typeArguments, true),
|
|
279
|
+
array: (node, check) => check.isType(node.element),
|
|
280
|
+
tuple: (node, check) =>
|
|
281
|
+
Array.isArray(node.elements) && node.elements.every((entry) => isTupleElement(entry, check)),
|
|
282
|
+
union: (node, check) => check.isTypeList(node.types, false),
|
|
283
|
+
intersection: (node, check) => check.isTypeList(node.types, false),
|
|
284
|
+
object: (node, check) =>
|
|
285
|
+
Array.isArray(node.members) && node.members.every((member) => check.isMember(member)),
|
|
286
|
+
indexedAccess: (node, check) => check.isType(node.object) && check.isType(node.index),
|
|
287
|
+
readonly: (node, check) => check.isType(node.type),
|
|
288
|
+
raw: (node) => isText(node.text),
|
|
289
|
+
};
|
|
290
|
+
|
|
291
|
+
/** Whether `value` is an IR type the printer writes as valid TypeScript. */
|
|
292
|
+
export function isPrintableIrType(value: unknown): value is IrType {
|
|
293
|
+
return new IrShapeCheck().isType(value);
|
|
294
|
+
}
|
|
295
|
+
|
|
296
|
+
/** Whether `value` is an IR property signature the printer writes as valid TypeScript. */
|
|
297
|
+
export function isPrintableIrProperty(value: unknown): value is IrPropertySignature {
|
|
298
|
+
return new IrShapeCheck().isProperty(value);
|
|
299
|
+
}
|
|
@@ -1,22 +1,52 @@
|
|
|
1
1
|
// Generated by scripts/identifier-ranges.ts (Node.js 26.0.0, Unicode
|
|
2
|
-
// 17.0, TypeScript 5.
|
|
2
|
+
// 17.0, TypeScript 5.4.5). Do not edit.
|
|
3
3
|
|
|
4
4
|
/** `ID_Start` code points that TypeScript's scanner does not accept, as regex class items. */
|
|
5
5
|
export const NEWER_IDENTIFIER_START: readonly string[] = [
|
|
6
|
-
"\\u{
|
|
7
|
-
"\\u{
|
|
8
|
-
"\\u{
|
|
6
|
+
"\\u{870}-\\u{887}",
|
|
7
|
+
"\\u{889}-\\u{88F}",
|
|
8
|
+
"\\u{8B5}",
|
|
9
|
+
"\\u{8BE}-\\u{8C9}",
|
|
10
|
+
"\\u{C5C}-\\u{C5D}",
|
|
11
|
+
"\\u{CDC}-\\u{CDD}",
|
|
12
|
+
"\\u{D04}",
|
|
13
|
+
"\\u{170D}",
|
|
14
|
+
"\\u{171F}",
|
|
15
|
+
"\\u{1B4C}",
|
|
9
16
|
"\\u{1C89}-\\u{1C8A}",
|
|
10
|
-
"\\u{
|
|
11
|
-
"\\u{
|
|
12
|
-
"\\u{
|
|
13
|
-
"\\u{
|
|
14
|
-
"\\u{
|
|
17
|
+
"\\u{2C2F}",
|
|
18
|
+
"\\u{2C5F}",
|
|
19
|
+
"\\u{31BB}-\\u{31BF}",
|
|
20
|
+
"\\u{4DB6}-\\u{4DBF}",
|
|
21
|
+
"\\u{9FF0}-\\u{9FFF}",
|
|
22
|
+
"\\u{A7C0}-\\u{A7C1}",
|
|
23
|
+
"\\u{A7C7}-\\u{A7DC}",
|
|
24
|
+
"\\u{A7F1}-\\u{A7F6}",
|
|
25
|
+
"\\u{AB68}-\\u{AB69}",
|
|
26
|
+
"\\u{10570}-\\u{1057A}",
|
|
27
|
+
"\\u{1057C}-\\u{1058A}",
|
|
28
|
+
"\\u{1058C}-\\u{10592}",
|
|
29
|
+
"\\u{10594}-\\u{10595}",
|
|
30
|
+
"\\u{10597}-\\u{105A1}",
|
|
31
|
+
"\\u{105A3}-\\u{105B1}",
|
|
32
|
+
"\\u{105B3}-\\u{105B9}",
|
|
33
|
+
"\\u{105BB}-\\u{105BC}",
|
|
15
34
|
"\\u{105C0}-\\u{105F3}",
|
|
35
|
+
"\\u{10780}-\\u{10785}",
|
|
36
|
+
"\\u{10787}-\\u{107B0}",
|
|
37
|
+
"\\u{107B2}-\\u{107BA}",
|
|
16
38
|
"\\u{10940}-\\u{10959}",
|
|
17
39
|
"\\u{10D4A}-\\u{10D65}",
|
|
18
40
|
"\\u{10D6F}-\\u{10D85}",
|
|
41
|
+
"\\u{10E80}-\\u{10EA9}",
|
|
42
|
+
"\\u{10EB0}-\\u{10EB1}",
|
|
19
43
|
"\\u{10EC2}-\\u{10EC7}",
|
|
44
|
+
"\\u{10F70}-\\u{10F81}",
|
|
45
|
+
"\\u{10FB0}-\\u{10FC4}",
|
|
46
|
+
"\\u{11071}-\\u{11072}",
|
|
47
|
+
"\\u{11075}",
|
|
48
|
+
"\\u{11147}",
|
|
49
|
+
"\\u{1123F}-\\u{11240}",
|
|
20
50
|
"\\u{11380}-\\u{11389}",
|
|
21
51
|
"\\u{1138B}",
|
|
22
52
|
"\\u{1138E}",
|
|
@@ -24,18 +54,47 @@ export const NEWER_IDENTIFIER_START: readonly string[] = [
|
|
|
24
54
|
"\\u{113B7}",
|
|
25
55
|
"\\u{113D1}",
|
|
26
56
|
"\\u{113D3}",
|
|
57
|
+
"\\u{11460}-\\u{11461}",
|
|
58
|
+
"\\u{11740}-\\u{11746}",
|
|
59
|
+
"\\u{11900}-\\u{11906}",
|
|
60
|
+
"\\u{11909}",
|
|
61
|
+
"\\u{1190C}-\\u{11913}",
|
|
62
|
+
"\\u{11915}-\\u{11916}",
|
|
63
|
+
"\\u{11918}-\\u{1192F}",
|
|
64
|
+
"\\u{1193F}",
|
|
65
|
+
"\\u{11941}",
|
|
66
|
+
"\\u{11AB0}-\\u{11ABF}",
|
|
27
67
|
"\\u{11BC0}-\\u{11BE0}",
|
|
28
68
|
"\\u{11DB0}-\\u{11DDB}",
|
|
69
|
+
"\\u{11F02}",
|
|
70
|
+
"\\u{11F04}-\\u{11F10}",
|
|
71
|
+
"\\u{11F12}-\\u{11F33}",
|
|
72
|
+
"\\u{11FB0}",
|
|
73
|
+
"\\u{12F90}-\\u{12FF0}",
|
|
74
|
+
"\\u{1342F}",
|
|
75
|
+
"\\u{13441}-\\u{13446}",
|
|
29
76
|
"\\u{13460}-\\u{143FA}",
|
|
30
77
|
"\\u{16100}-\\u{1611D}",
|
|
78
|
+
"\\u{16A70}-\\u{16ABE}",
|
|
31
79
|
"\\u{16D40}-\\u{16D6C}",
|
|
32
80
|
"\\u{16EA0}-\\u{16EB8}",
|
|
33
81
|
"\\u{16EBB}-\\u{16ED3}",
|
|
34
82
|
"\\u{16FF2}-\\u{16FF6}",
|
|
35
83
|
"\\u{187F8}-\\u{187FF}",
|
|
36
|
-
"\\u{
|
|
37
|
-
"\\u{
|
|
84
|
+
"\\u{18AF3}-\\u{18CD5}",
|
|
85
|
+
"\\u{18CFF}-\\u{18D1E}",
|
|
38
86
|
"\\u{18D80}-\\u{18DF2}",
|
|
87
|
+
"\\u{1AFF0}-\\u{1AFF3}",
|
|
88
|
+
"\\u{1AFF5}-\\u{1AFFB}",
|
|
89
|
+
"\\u{1AFFD}-\\u{1AFFE}",
|
|
90
|
+
"\\u{1B11F}-\\u{1B122}",
|
|
91
|
+
"\\u{1B132}",
|
|
92
|
+
"\\u{1B155}",
|
|
93
|
+
"\\u{1DF00}-\\u{1DF1E}",
|
|
94
|
+
"\\u{1DF25}-\\u{1DF2A}",
|
|
95
|
+
"\\u{1E030}-\\u{1E06D}",
|
|
96
|
+
"\\u{1E290}-\\u{1E2AD}",
|
|
97
|
+
"\\u{1E4D0}-\\u{1E4EB}",
|
|
39
98
|
"\\u{1E5D0}-\\u{1E5ED}",
|
|
40
99
|
"\\u{1E5F0}",
|
|
41
100
|
"\\u{1E6C0}-\\u{1E6DE}",
|
|
@@ -44,32 +103,83 @@ export const NEWER_IDENTIFIER_START: readonly string[] = [
|
|
|
44
103
|
"\\u{1E6E7}-\\u{1E6ED}",
|
|
45
104
|
"\\u{1E6F0}-\\u{1E6F4}",
|
|
46
105
|
"\\u{1E6FE}-\\u{1E6FF}",
|
|
47
|
-
"\\u{
|
|
106
|
+
"\\u{1E7E0}-\\u{1E7E6}",
|
|
107
|
+
"\\u{1E7E8}-\\u{1E7EB}",
|
|
108
|
+
"\\u{1E7ED}-\\u{1E7EE}",
|
|
109
|
+
"\\u{1E7F0}-\\u{1E7FE}",
|
|
110
|
+
"\\u{2A6D7}-\\u{2A6DF}",
|
|
111
|
+
"\\u{2B735}-\\u{2B73F}",
|
|
48
112
|
"\\u{2CEA2}-\\u{2CEAD}",
|
|
49
|
-
"\\u{
|
|
113
|
+
"\\u{2EBF0}-\\u{2EE5D}",
|
|
114
|
+
"\\u{30000}-\\u{3134A}",
|
|
115
|
+
"\\u{31350}-\\u{33479}",
|
|
50
116
|
];
|
|
51
117
|
|
|
52
118
|
/** `ID_Continue` code points that TypeScript's scanner does not accept, as regex class items. */
|
|
53
119
|
export const NEWER_IDENTIFIER_PART: readonly string[] = [
|
|
54
|
-
"\\u{
|
|
55
|
-
"\\u{
|
|
56
|
-
"\\u{
|
|
57
|
-
"\\u{
|
|
58
|
-
"\\u{
|
|
120
|
+
"\\u{870}-\\u{887}",
|
|
121
|
+
"\\u{889}-\\u{88F}",
|
|
122
|
+
"\\u{897}-\\u{89F}",
|
|
123
|
+
"\\u{8B5}",
|
|
124
|
+
"\\u{8BE}-\\u{8D2}",
|
|
125
|
+
"\\u{B55}",
|
|
126
|
+
"\\u{C3C}",
|
|
127
|
+
"\\u{C5C}-\\u{C5D}",
|
|
128
|
+
"\\u{CDC}-\\u{CDD}",
|
|
129
|
+
"\\u{CF3}",
|
|
130
|
+
"\\u{D04}",
|
|
131
|
+
"\\u{D81}",
|
|
132
|
+
"\\u{ECE}",
|
|
133
|
+
"\\u{170D}",
|
|
134
|
+
"\\u{1715}",
|
|
135
|
+
"\\u{171F}",
|
|
136
|
+
"\\u{180F}",
|
|
137
|
+
"\\u{1ABF}-\\u{1ADD}",
|
|
59
138
|
"\\u{1AE0}-\\u{1AEB}",
|
|
139
|
+
"\\u{1B4C}",
|
|
60
140
|
"\\u{1C89}-\\u{1C8A}",
|
|
61
|
-
"\\u{
|
|
62
|
-
"\\u{
|
|
63
|
-
"\\u{
|
|
64
|
-
"\\u{
|
|
65
|
-
"\\u{
|
|
141
|
+
"\\u{1DFA}",
|
|
142
|
+
"\\u{200C}-\\u{200D}",
|
|
143
|
+
"\\u{2C2F}",
|
|
144
|
+
"\\u{2C5F}",
|
|
145
|
+
"\\u{30FB}",
|
|
146
|
+
"\\u{31BB}-\\u{31BF}",
|
|
147
|
+
"\\u{4DB6}-\\u{4DBF}",
|
|
148
|
+
"\\u{9FF0}-\\u{9FFF}",
|
|
149
|
+
"\\u{A7C0}-\\u{A7C1}",
|
|
150
|
+
"\\u{A7C7}-\\u{A7DC}",
|
|
151
|
+
"\\u{A7F1}-\\u{A7F6}",
|
|
152
|
+
"\\u{A82C}",
|
|
153
|
+
"\\u{AB68}-\\u{AB69}",
|
|
154
|
+
"\\u{FF65}",
|
|
155
|
+
"\\u{10570}-\\u{1057A}",
|
|
156
|
+
"\\u{1057C}-\\u{1058A}",
|
|
157
|
+
"\\u{1058C}-\\u{10592}",
|
|
158
|
+
"\\u{10594}-\\u{10595}",
|
|
159
|
+
"\\u{10597}-\\u{105A1}",
|
|
160
|
+
"\\u{105A3}-\\u{105B1}",
|
|
161
|
+
"\\u{105B3}-\\u{105B9}",
|
|
162
|
+
"\\u{105BB}-\\u{105BC}",
|
|
66
163
|
"\\u{105C0}-\\u{105F3}",
|
|
164
|
+
"\\u{10780}-\\u{10785}",
|
|
165
|
+
"\\u{10787}-\\u{107B0}",
|
|
166
|
+
"\\u{107B2}-\\u{107BA}",
|
|
67
167
|
"\\u{10940}-\\u{10959}",
|
|
68
168
|
"\\u{10D40}-\\u{10D65}",
|
|
69
169
|
"\\u{10D69}-\\u{10D6D}",
|
|
70
170
|
"\\u{10D6F}-\\u{10D85}",
|
|
171
|
+
"\\u{10E80}-\\u{10EA9}",
|
|
172
|
+
"\\u{10EAB}-\\u{10EAC}",
|
|
173
|
+
"\\u{10EB0}-\\u{10EB1}",
|
|
71
174
|
"\\u{10EC2}-\\u{10EC7}",
|
|
72
|
-
"\\u{10EFA}-\\u{
|
|
175
|
+
"\\u{10EFA}-\\u{10EFF}",
|
|
176
|
+
"\\u{10F70}-\\u{10F85}",
|
|
177
|
+
"\\u{10FB0}-\\u{10FC4}",
|
|
178
|
+
"\\u{11070}-\\u{11075}",
|
|
179
|
+
"\\u{110C2}",
|
|
180
|
+
"\\u{11147}",
|
|
181
|
+
"\\u{111CE}-\\u{111CF}",
|
|
182
|
+
"\\u{1123F}-\\u{11241}",
|
|
73
183
|
"\\u{11380}-\\u{11389}",
|
|
74
184
|
"\\u{1138B}",
|
|
75
185
|
"\\u{1138E}",
|
|
@@ -80,30 +190,73 @@ export const NEWER_IDENTIFIER_PART: readonly string[] = [
|
|
|
80
190
|
"\\u{113C7}-\\u{113CA}",
|
|
81
191
|
"\\u{113CC}-\\u{113D3}",
|
|
82
192
|
"\\u{113E1}-\\u{113E2}",
|
|
193
|
+
"\\u{11460}-\\u{11461}",
|
|
83
194
|
"\\u{116D0}-\\u{116E3}",
|
|
195
|
+
"\\u{11740}-\\u{11746}",
|
|
196
|
+
"\\u{11900}-\\u{11906}",
|
|
197
|
+
"\\u{11909}",
|
|
198
|
+
"\\u{1190C}-\\u{11913}",
|
|
199
|
+
"\\u{11915}-\\u{11916}",
|
|
200
|
+
"\\u{11918}-\\u{11935}",
|
|
201
|
+
"\\u{11937}-\\u{11938}",
|
|
202
|
+
"\\u{1193B}-\\u{11943}",
|
|
203
|
+
"\\u{11950}-\\u{11959}",
|
|
204
|
+
"\\u{11AB0}-\\u{11ABF}",
|
|
84
205
|
"\\u{11B60}-\\u{11B67}",
|
|
85
206
|
"\\u{11BC0}-\\u{11BE0}",
|
|
86
207
|
"\\u{11BF0}-\\u{11BF9}",
|
|
87
208
|
"\\u{11DB0}-\\u{11DDB}",
|
|
88
209
|
"\\u{11DE0}-\\u{11DE9}",
|
|
89
|
-
"\\u{
|
|
210
|
+
"\\u{11F00}-\\u{11F10}",
|
|
211
|
+
"\\u{11F12}-\\u{11F3A}",
|
|
212
|
+
"\\u{11F3E}-\\u{11F42}",
|
|
213
|
+
"\\u{11F50}-\\u{11F5A}",
|
|
214
|
+
"\\u{11FB0}",
|
|
215
|
+
"\\u{12F90}-\\u{12FF0}",
|
|
216
|
+
"\\u{1342F}",
|
|
217
|
+
"\\u{13440}-\\u{13455}",
|
|
90
218
|
"\\u{13460}-\\u{143FA}",
|
|
91
219
|
"\\u{16100}-\\u{16139}",
|
|
220
|
+
"\\u{16A70}-\\u{16ABE}",
|
|
221
|
+
"\\u{16AC0}-\\u{16AC9}",
|
|
92
222
|
"\\u{16D40}-\\u{16D6C}",
|
|
93
223
|
"\\u{16D70}-\\u{16D79}",
|
|
94
224
|
"\\u{16EA0}-\\u{16EB8}",
|
|
95
225
|
"\\u{16EBB}-\\u{16ED3}",
|
|
96
|
-
"\\u{
|
|
226
|
+
"\\u{16FE4}",
|
|
227
|
+
"\\u{16FF0}-\\u{16FF6}",
|
|
97
228
|
"\\u{187F8}-\\u{187FF}",
|
|
98
|
-
"\\u{
|
|
99
|
-
"\\u{
|
|
229
|
+
"\\u{18AF3}-\\u{18CD5}",
|
|
230
|
+
"\\u{18CFF}-\\u{18D1E}",
|
|
100
231
|
"\\u{18D80}-\\u{18DF2}",
|
|
232
|
+
"\\u{1AFF0}-\\u{1AFF3}",
|
|
233
|
+
"\\u{1AFF5}-\\u{1AFFB}",
|
|
234
|
+
"\\u{1AFFD}-\\u{1AFFE}",
|
|
235
|
+
"\\u{1B11F}-\\u{1B122}",
|
|
236
|
+
"\\u{1B132}",
|
|
237
|
+
"\\u{1B155}",
|
|
101
238
|
"\\u{1CCF0}-\\u{1CCF9}",
|
|
239
|
+
"\\u{1CF00}-\\u{1CF2D}",
|
|
240
|
+
"\\u{1CF30}-\\u{1CF46}",
|
|
241
|
+
"\\u{1DF00}-\\u{1DF1E}",
|
|
242
|
+
"\\u{1DF25}-\\u{1DF2A}",
|
|
243
|
+
"\\u{1E030}-\\u{1E06D}",
|
|
244
|
+
"\\u{1E08F}",
|
|
245
|
+
"\\u{1E290}-\\u{1E2AE}",
|
|
246
|
+
"\\u{1E4D0}-\\u{1E4F9}",
|
|
102
247
|
"\\u{1E5D0}-\\u{1E5FA}",
|
|
103
248
|
"\\u{1E6C0}-\\u{1E6DE}",
|
|
104
249
|
"\\u{1E6E0}-\\u{1E6F5}",
|
|
105
250
|
"\\u{1E6FE}-\\u{1E6FF}",
|
|
106
|
-
"\\u{
|
|
251
|
+
"\\u{1E7E0}-\\u{1E7E6}",
|
|
252
|
+
"\\u{1E7E8}-\\u{1E7EB}",
|
|
253
|
+
"\\u{1E7ED}-\\u{1E7EE}",
|
|
254
|
+
"\\u{1E7F0}-\\u{1E7FE}",
|
|
255
|
+
"\\u{1FBF0}-\\u{1FBF9}",
|
|
256
|
+
"\\u{2A6D7}-\\u{2A6DF}",
|
|
257
|
+
"\\u{2B735}-\\u{2B73F}",
|
|
107
258
|
"\\u{2CEA2}-\\u{2CEAD}",
|
|
108
|
-
"\\u{
|
|
259
|
+
"\\u{2EBF0}-\\u{2EE5D}",
|
|
260
|
+
"\\u{30000}-\\u{3134A}",
|
|
261
|
+
"\\u{31350}-\\u{33479}",
|
|
109
262
|
];
|
|
@@ -53,7 +53,10 @@ export function countNodes(root: unknown): NodeCounts {
|
|
|
53
53
|
? childrenOf(node).filter((child) => isContainer(child) && !entered.has(child))
|
|
54
54
|
: [];
|
|
55
55
|
if (pending.length > 0) {
|
|
56
|
-
|
|
56
|
+
// One push per child: spreading an array of millions of children overflows the stack.
|
|
57
|
+
for (const child of pending as object[]) {
|
|
58
|
+
stack.push(child);
|
|
59
|
+
}
|
|
57
60
|
continue;
|
|
58
61
|
}
|
|
59
62
|
stack.pop();
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { escapePointerSegment } from "./json-pointer.js";
|
|
1
|
+
import { canonicalRef, escapePointerSegment } from "./json-pointer.js";
|
|
2
2
|
import type { Schema, SchemaObject } from "./schema-object.js";
|
|
3
3
|
|
|
4
4
|
/**
|
|
@@ -51,7 +51,7 @@ function reaches(schema: Schema, search: Search): boolean {
|
|
|
51
51
|
}
|
|
52
52
|
const ref = (schema as { readonly $ref?: unknown }).$ref;
|
|
53
53
|
if (typeof ref === "string") {
|
|
54
|
-
if (ref === search.target) {
|
|
54
|
+
if (canonicalRef(ref) === canonicalRef(search.target)) {
|
|
55
55
|
return true;
|
|
56
56
|
}
|
|
57
57
|
if (search.visited.has(ref)) {
|
|
@@ -84,7 +84,9 @@ function mappingRef(target: unknown): string | undefined {
|
|
|
84
84
|
if (typeof target !== "string") {
|
|
85
85
|
return undefined;
|
|
86
86
|
}
|
|
87
|
-
return target.startsWith("#")
|
|
87
|
+
return target.startsWith("#")
|
|
88
|
+
? canonicalRef(target)
|
|
89
|
+
: `${COMPONENT_SCHEMAS}${escapePointerSegment(target)}`;
|
|
88
90
|
}
|
|
89
91
|
|
|
90
92
|
/** Whether the discriminator `mapping` of `union` names the schema at `target`. */
|
|
@@ -93,7 +95,7 @@ export function unionMaps(union: SchemaObject, target: string): boolean {
|
|
|
93
95
|
if (!isSchemaObject(mapping)) {
|
|
94
96
|
return false;
|
|
95
97
|
}
|
|
96
|
-
return Object.values(mapping).some((value) => mappingRef(value) === target);
|
|
98
|
+
return Object.values(mapping).some((value) => mappingRef(value) === canonicalRef(target));
|
|
97
99
|
}
|
|
98
100
|
|
|
99
101
|
/**
|