openapi-typesafe 1.0.0-rc.0 → 1.0.0-rc.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +12 -5
- package/dist/adapters/redocly-loader/configured-headers.cjs +32 -0
- package/dist/adapters/redocly-loader/configured-headers.cjs.map +1 -0
- package/dist/adapters/redocly-loader/configured-headers.mjs +30 -0
- package/dist/adapters/redocly-loader/configured-headers.mjs.map +1 -0
- package/dist/adapters/redocly-loader/redocly-config-source.cjs +21 -2
- package/dist/adapters/redocly-loader/redocly-config-source.cjs.map +1 -1
- package/dist/adapters/redocly-loader/redocly-config-source.mjs +22 -3
- package/dist/adapters/redocly-loader/redocly-config-source.mjs.map +1 -1
- package/dist/adapters/redocly-loader/redocly-schema-loader.cjs +34 -11
- package/dist/adapters/redocly-loader/redocly-schema-loader.cjs.map +1 -1
- package/dist/adapters/redocly-loader/redocly-schema-loader.mjs +33 -10
- package/dist/adapters/redocly-loader/redocly-schema-loader.mjs.map +1 -1
- package/dist/adapters/redocly-loader/ref-access.cjs +37 -4
- package/dist/adapters/redocly-loader/ref-access.cjs.map +1 -1
- package/dist/adapters/redocly-loader/ref-access.mjs +37 -4
- package/dist/adapters/redocly-loader/ref-access.mjs.map +1 -1
- package/dist/adapters/redocly-loader/ref-resolution-check.cjs +191 -0
- package/dist/adapters/redocly-loader/ref-resolution-check.cjs.map +1 -0
- package/dist/adapters/redocly-loader/ref-resolution-check.mjs +189 -0
- package/dist/adapters/redocly-loader/ref-resolution-check.mjs.map +1 -0
- package/dist/adapters/redocly-loader/ref-resolution-steps.cjs +73 -0
- package/dist/adapters/redocly-loader/ref-resolution-steps.cjs.map +1 -0
- package/dist/adapters/redocly-loader/ref-resolution-steps.mjs +60 -0
- package/dist/adapters/redocly-loader/ref-resolution-steps.mjs.map +1 -0
- package/dist/adapters/redocly-loader/remote-fetch.cjs +41 -14
- package/dist/adapters/redocly-loader/remote-fetch.cjs.map +1 -1
- package/dist/adapters/redocly-loader/remote-fetch.mjs +40 -14
- package/dist/adapters/redocly-loader/remote-fetch.mjs.map +1 -1
- package/dist/adapters/redocly-loader/schema-load-errors.cjs +23 -5
- package/dist/adapters/redocly-loader/schema-load-errors.cjs.map +1 -1
- package/dist/adapters/redocly-loader/schema-load-errors.mjs +23 -5
- package/dist/adapters/redocly-loader/schema-load-errors.mjs.map +1 -1
- package/dist/adapters/redocly-loader/unsupported-keys.cjs +9 -1
- package/dist/adapters/redocly-loader/unsupported-keys.cjs.map +1 -1
- package/dist/adapters/redocly-loader/unsupported-keys.mjs +9 -1
- 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/adapters/type-ast-bridge/ir-to-typescript.cjs +5 -1
- package/dist/adapters/type-ast-bridge/ir-to-typescript.cjs.map +1 -1
- package/dist/adapters/type-ast-bridge/ir-to-typescript.mjs +5 -1
- package/dist/adapters/type-ast-bridge/ir-to-typescript.mjs.map +1 -1
- package/dist/adapters/type-ast-bridge/print-typescript.cjs.map +1 -1
- package/dist/adapters/type-ast-bridge/print-typescript.mjs.map +1 -1
- package/dist/adapters/type-ast-bridge/typescript-to-ir.cjs +15 -9
- package/dist/adapters/type-ast-bridge/typescript-to-ir.cjs.map +1 -1
- package/dist/adapters/type-ast-bridge/typescript-to-ir.mjs +15 -9
- package/dist/adapters/type-ast-bridge/typescript-to-ir.mjs.map +1 -1
- package/dist/api/default-ports.cjs +9 -0
- package/dist/api/default-ports.cjs.map +1 -1
- package/dist/api/default-ports.mjs +8 -1
- package/dist/api/default-ports.mjs.map +1 -1
- package/dist/api/discriminator-conflict-warnings.cjs +25 -0
- package/dist/api/discriminator-conflict-warnings.cjs.map +1 -0
- package/dist/api/discriminator-conflict-warnings.mjs +23 -0
- package/dist/api/discriminator-conflict-warnings.mjs.map +1 -0
- package/dist/api/discriminator-enum-names.cjs +19 -0
- package/dist/api/discriminator-enum-names.cjs.map +1 -0
- package/dist/api/discriminator-enum-names.mjs +17 -0
- package/dist/api/discriminator-enum-names.mjs.map +1 -0
- package/dist/api/discriminator-enum-parent.cjs +59 -0
- package/dist/api/discriminator-enum-parent.cjs.map +1 -0
- package/dist/api/discriminator-enum-parent.mjs +57 -0
- package/dist/api/discriminator-enum-parent.mjs.map +1 -0
- package/dist/api/discriminator-enum.cjs +25 -0
- package/dist/api/discriminator-enum.cjs.map +1 -1
- package/dist/api/discriminator-enum.mjs +25 -1
- package/dist/api/discriminator-enum.mjs.map +1 -1
- package/dist/api/discriminator-other-owners.cjs +67 -0
- package/dist/api/discriminator-other-owners.cjs.map +1 -0
- package/dist/api/discriminator-other-owners.mjs +64 -0
- package/dist/api/discriminator-other-owners.mjs.map +1 -0
- package/dist/api/discriminator-patch.cjs +92 -0
- package/dist/api/discriminator-patch.cjs.map +1 -0
- package/dist/api/discriminator-patch.mjs +86 -0
- package/dist/api/discriminator-patch.mjs.map +1 -0
- package/dist/api/discriminator-scan.cjs +50 -65
- package/dist/api/discriminator-scan.cjs.map +1 -1
- package/dist/api/discriminator-scan.mjs +44 -59
- package/dist/api/discriminator-scan.mjs.map +1 -1
- package/dist/api/document-refs.cjs +15 -12
- package/dist/api/document-refs.cjs.map +1 -1
- package/dist/api/document-refs.mjs +15 -12
- package/dist/api/document-refs.mjs.map +1 -1
- package/dist/api/document-run.cjs +21 -4
- package/dist/api/document-run.cjs.map +1 -1
- package/dist/api/document-run.mjs +22 -5
- package/dist/api/document-run.mjs.map +1 -1
- package/dist/api/enum-values-warnings.cjs +16 -0
- package/dist/api/enum-values-warnings.cjs.map +1 -0
- package/dist/api/enum-values-warnings.mjs +14 -0
- package/dist/api/enum-values-warnings.mjs.map +1 -0
- package/dist/api/footer-sink.cjs +25 -2
- package/dist/api/footer-sink.cjs.map +1 -1
- package/dist/api/footer-sink.mjs +25 -2
- package/dist/api/footer-sink.mjs.map +1 -1
- package/dist/api/legacy-callback-warning.cjs +4 -1
- package/dist/api/legacy-callback-warning.cjs.map +1 -1
- package/dist/api/legacy-callback-warning.mjs +4 -1
- package/dist/api/legacy-callback-warning.mjs.map +1 -1
- package/dist/api/legacy-ts-helpers.cjs.map +1 -1
- package/dist/api/legacy-ts-helpers.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 +2 -1
- package/dist/api/openapi-ts.cjs.map +1 -1
- package/dist/api/openapi-ts.mjs +3 -2
- package/dist/api/openapi-ts.mjs.map +1 -1
- package/dist/api/path-template-warnings.cjs +21 -0
- package/dist/api/path-template-warnings.cjs.map +1 -0
- package/dist/api/path-template-warnings.mjs +19 -0
- package/dist/api/path-template-warnings.mjs.map +1 -0
- package/dist/api/transform-context.cjs +4 -2
- package/dist/api/transform-context.cjs.map +1 -1
- package/dist/api/transform-context.mjs +4 -2
- package/dist/api/transform-context.mjs.map +1 -1
- package/dist/api/transform-schema.cjs +52 -3
- package/dist/api/transform-schema.cjs.map +1 -1
- package/dist/api/transform-schema.mjs +53 -4
- package/dist/api/transform-schema.mjs.map +1 -1
- package/dist/api/unsupported-feature-warnings.cjs +6 -1
- package/dist/api/unsupported-feature-warnings.cjs.map +1 -1
- package/dist/api/unsupported-feature-warnings.mjs +6 -1
- package/dist/api/unsupported-feature-warnings.mjs.map +1 -1
- package/dist/application/print/type-printer.cjs +7 -1
- package/dist/application/print/type-printer.cjs.map +1 -1
- package/dist/application/print/type-printer.mjs +7 -1
- package/dist/application/print/type-printer.mjs.map +1 -1
- package/dist/application/transform/document/assignability.cjs +144 -0
- package/dist/application/transform/document/assignability.cjs.map +1 -0
- package/dist/application/transform/document/assignability.mjs +138 -0
- package/dist/application/transform/document/assignability.mjs.map +1 -0
- package/dist/application/transform/document/components.cjs +2 -2
- package/dist/application/transform/document/components.cjs.map +1 -1
- package/dist/application/transform/document/components.mjs +4 -4
- package/dist/application/transform/document/components.mjs.map +1 -1
- package/dist/application/transform/document/declared-types.cjs +66 -0
- package/dist/application/transform/document/declared-types.cjs.map +1 -0
- package/dist/application/transform/document/declared-types.mjs +63 -0
- package/dist/application/transform/document/declared-types.mjs.map +1 -0
- package/dist/application/transform/document/document.cjs +32 -9
- package/dist/application/transform/document/document.cjs.map +1 -1
- package/dist/application/transform/document/document.mjs +34 -11
- package/dist/application/transform/document/document.mjs.map +1 -1
- package/dist/application/transform/document/exploded-query.cjs +46 -0
- package/dist/application/transform/document/exploded-query.cjs.map +1 -0
- package/dist/application/transform/document/exploded-query.mjs +43 -0
- package/dist/application/transform/document/exploded-query.mjs.map +1 -0
- package/dist/application/transform/document/global-type-references.cjs +63 -0
- package/dist/application/transform/document/global-type-references.cjs.map +1 -0
- package/dist/application/transform/document/global-type-references.mjs +61 -0
- package/dist/application/transform/document/global-type-references.mjs.map +1 -0
- package/dist/application/transform/document/list-assignability.cjs +54 -0
- package/dist/application/transform/document/list-assignability.cjs.map +1 -0
- package/dist/application/transform/document/list-assignability.mjs +52 -0
- package/dist/application/transform/document/list-assignability.mjs.map +1 -0
- package/dist/application/transform/document/parameters.cjs +41 -9
- package/dist/application/transform/document/parameters.cjs.map +1 -1
- package/dist/application/transform/document/parameters.mjs +42 -10
- package/dist/application/transform/document/parameters.mjs.map +1 -1
- package/dist/application/transform/document/path-key-overlaps.cjs +83 -33
- package/dist/application/transform/document/path-key-overlaps.cjs.map +1 -1
- package/dist/application/transform/document/path-key-overlaps.mjs +83 -33
- package/dist/application/transform/document/path-key-overlaps.mjs.map +1 -1
- package/dist/application/transform/document/path-template-replace.cjs +48 -0
- package/dist/application/transform/document/path-template-replace.cjs.map +1 -0
- package/dist/application/transform/document/path-template-replace.mjs +45 -0
- package/dist/application/transform/document/path-template-replace.mjs.map +1 -0
- package/dist/application/transform/document/paths.cjs +55 -29
- package/dist/application/transform/document/paths.cjs.map +1 -1
- package/dist/application/transform/document/paths.mjs +54 -30
- package/dist/application/transform/document/paths.mjs.map +1 -1
- package/dist/application/transform/document/root-type-aliases.cjs +15 -14
- package/dist/application/transform/document/root-type-aliases.cjs.map +1 -1
- package/dist/application/transform/document/root-type-aliases.mjs +15 -13
- package/dist/application/transform/document/root-type-aliases.mjs.map +1 -1
- package/dist/application/transform/document/template-key-match.cjs +128 -0
- package/dist/application/transform/document/template-key-match.cjs.map +1 -0
- package/dist/application/transform/document/template-key-match.mjs +125 -0
- package/dist/application/transform/document/template-key-match.mjs.map +1 -0
- package/dist/application/transform/document/type-assignability.cjs +192 -0
- package/dist/application/transform/document/type-assignability.cjs.map +1 -0
- package/dist/application/transform/document/type-assignability.mjs +190 -0
- package/dist/application/transform/document/type-assignability.mjs.map +1 -0
- package/dist/application/transform/document/type-key.cjs +70 -0
- package/dist/application/transform/document/type-key.cjs.map +1 -0
- package/dist/application/transform/document/type-key.mjs +68 -0
- package/dist/application/transform/document/type-key.mjs.map +1 -0
- package/dist/application/transform/document/type-resolution.cjs +131 -0
- package/dist/application/transform/document/type-resolution.cjs.map +1 -0
- package/dist/application/transform/document/type-resolution.mjs +125 -0
- package/dist/application/transform/document/type-resolution.mjs.map +1 -0
- package/dist/application/transform/footer/document-footer.cjs +66 -4
- package/dist/application/transform/footer/document-footer.cjs.map +1 -1
- package/dist/application/transform/footer/document-footer.mjs +67 -5
- package/dist/application/transform/footer/document-footer.mjs.map +1 -1
- package/dist/application/transform/footer/enum-naming.cjs +17 -0
- package/dist/application/transform/footer/enum-naming.cjs.map +1 -1
- package/dist/application/transform/footer/enum-naming.mjs +17 -1
- package/dist/application/transform/footer/enum-naming.mjs.map +1 -1
- package/dist/application/transform/footer/enum-values-check.cjs +129 -0
- package/dist/application/transform/footer/enum-values-check.cjs.map +1 -0
- package/dist/application/transform/footer/enum-values-check.mjs +127 -0
- package/dist/application/transform/footer/enum-values-check.mjs.map +1 -0
- package/dist/application/transform/footer/evaluation.cjs +42 -0
- package/dist/application/transform/footer/evaluation.cjs.map +1 -0
- package/dist/application/transform/footer/evaluation.mjs +33 -0
- package/dist/application/transform/footer/evaluation.mjs.map +1 -0
- package/dist/application/transform/footer/shared-enum-names.cjs +60 -0
- package/dist/application/transform/footer/shared-enum-names.cjs.map +1 -0
- package/dist/application/transform/footer/shared-enum-names.mjs +57 -0
- package/dist/application/transform/footer/shared-enum-names.mjs.map +1 -0
- package/dist/application/transform/footer/type-evaluation.cjs +138 -0
- package/dist/application/transform/footer/type-evaluation.cjs.map +1 -0
- package/dist/application/transform/footer/type-evaluation.mjs +136 -0
- package/dist/application/transform/footer/type-evaluation.mjs.map +1 -0
- package/dist/application/transform/footer/type-indexing.cjs +107 -0
- package/dist/application/transform/footer/type-indexing.cjs.map +1 -0
- package/dist/application/transform/footer/type-indexing.mjs +105 -0
- package/dist/application/transform/footer/type-indexing.mjs.map +1 -0
- package/dist/application/transform/footer/type-rules.cjs +172 -0
- package/dist/application/transform/footer/type-rules.cjs.map +1 -0
- package/dist/application/transform/footer/type-rules.mjs +166 -0
- package/dist/application/transform/footer/type-rules.mjs.map +1 -0
- package/dist/application/transform/ref-pointer/generated-location.cjs +138 -0
- package/dist/application/transform/ref-pointer/generated-location.cjs.map +1 -0
- package/dist/application/transform/ref-pointer/generated-location.mjs +136 -0
- package/dist/application/transform/ref-pointer/generated-location.mjs.map +1 -0
- package/dist/application/transform/ref-pointer/generated-shape.cjs +171 -0
- package/dist/application/transform/ref-pointer/generated-shape.cjs.map +1 -0
- package/dist/application/transform/ref-pointer/generated-shape.mjs +162 -0
- package/dist/application/transform/ref-pointer/generated-shape.mjs.map +1 -0
- package/dist/application/transform/ref-pointer/inline-cycles.cjs +44 -0
- package/dist/application/transform/ref-pointer/inline-cycles.cjs.map +1 -0
- package/dist/application/transform/ref-pointer/inline-cycles.mjs +42 -0
- package/dist/application/transform/ref-pointer/inline-cycles.mjs.map +1 -0
- package/dist/application/transform/ref-pointer/original-index.cjs +62 -0
- package/dist/application/transform/ref-pointer/original-index.cjs.map +1 -0
- package/dist/application/transform/ref-pointer/original-index.mjs +60 -0
- package/dist/application/transform/ref-pointer/original-index.mjs.map +1 -0
- package/dist/application/transform/ref-pointer/pointer-type.cjs +60 -0
- package/dist/application/transform/ref-pointer/pointer-type.cjs.map +1 -0
- package/dist/application/transform/ref-pointer/pointer-type.mjs +57 -0
- package/dist/application/transform/ref-pointer/pointer-type.mjs.map +1 -0
- package/dist/application/transform/ref-pointer/pointer-walk.cjs +66 -0
- package/dist/application/transform/ref-pointer/pointer-walk.cjs.map +1 -0
- package/dist/application/transform/ref-pointer/pointer-walk.mjs +56 -0
- package/dist/application/transform/ref-pointer/pointer-walk.mjs.map +1 -0
- package/dist/application/transform/ref-pointer/typed-walk.cjs +124 -0
- package/dist/application/transform/ref-pointer/typed-walk.cjs.map +1 -0
- package/dist/application/transform/ref-pointer/typed-walk.mjs +122 -0
- package/dist/application/transform/ref-pointer/typed-walk.mjs.map +1 -0
- package/dist/application/transform/ref-type.cjs +7 -2
- package/dist/application/transform/ref-type.cjs.map +1 -1
- package/dist/application/transform/ref-type.mjs +3 -2
- package/dist/application/transform/ref-type.mjs.map +1 -1
- package/dist/application/transform/schema/access-flags.cjs +38 -0
- package/dist/application/transform/schema/access-flags.cjs.map +1 -0
- package/dist/application/transform/schema/access-flags.mjs +36 -0
- package/dist/application/transform/schema/access-flags.mjs.map +1 -0
- package/dist/application/transform/schema/array-type.cjs +32 -1
- package/dist/application/transform/schema/array-type.cjs.map +1 -1
- package/dist/application/transform/schema/array-type.mjs +33 -2
- package/dist/application/transform/schema/array-type.mjs.map +1 -1
- package/dist/application/transform/schema/composition-type.cjs +50 -15
- package/dist/application/transform/schema/composition-type.cjs.map +1 -1
- package/dist/application/transform/schema/composition-type.mjs +50 -15
- package/dist/application/transform/schema/composition-type.mjs.map +1 -1
- package/dist/application/transform/schema/core-type.cjs +3 -1
- package/dist/application/transform/schema/core-type.cjs.map +1 -1
- package/dist/application/transform/schema/core-type.mjs +3 -1
- package/dist/application/transform/schema/core-type.mjs.map +1 -1
- package/dist/application/transform/schema/discriminated-union.cjs +30 -0
- package/dist/application/transform/schema/discriminated-union.cjs.map +1 -0
- package/dist/application/transform/schema/discriminated-union.mjs +27 -0
- package/dist/application/transform/schema/discriminated-union.mjs.map +1 -0
- package/dist/application/transform/schema/discriminator-property.cjs +3 -2
- package/dist/application/transform/schema/discriminator-property.cjs.map +1 -1
- package/dist/application/transform/schema/discriminator-property.mjs +3 -2
- package/dist/application/transform/schema/discriminator-property.mjs.map +1 -1
- package/dist/application/transform/schema/enum-rule.cjs +66 -10
- package/dist/application/transform/schema/enum-rule.cjs.map +1 -1
- package/dist/application/transform/schema/enum-rule.mjs +67 -12
- package/dist/application/transform/schema/enum-rule.mjs.map +1 -1
- package/dist/application/transform/schema/inherited-discriminator.cjs +29 -0
- package/dist/application/transform/schema/inherited-discriminator.cjs.map +1 -0
- package/dist/application/transform/schema/inherited-discriminator.mjs +26 -0
- package/dist/application/transform/schema/inherited-discriminator.mjs.map +1 -0
- package/dist/application/transform/schema/object-type.cjs +38 -25
- package/dist/application/transform/schema/object-type.cjs.map +1 -1
- package/dist/application/transform/schema/object-type.mjs +39 -27
- package/dist/application/transform/schema/object-type.mjs.map +1 -1
- package/dist/application/transform/schema/required-variants.cjs +45 -0
- package/dist/application/transform/schema/required-variants.cjs.map +1 -0
- package/dist/application/transform/schema/required-variants.mjs +42 -0
- package/dist/application/transform/schema/required-variants.mjs.map +1 -0
- package/dist/application/transform/schema/schema-transform.cjs +2 -2
- package/dist/application/transform/schema/schema-transform.cjs.map +1 -1
- package/dist/application/transform/schema/schema-transform.mjs +2 -2
- package/dist/application/transform/schema/schema-transform.mjs.map +1 -1
- package/dist/application/transform/schema-comment.cjs +51 -5
- package/dist/application/transform/schema-comment.cjs.map +1 -1
- package/dist/application/transform/schema-comment.mjs +50 -6
- package/dist/application/transform/schema-comment.mjs.map +1 -1
- package/dist/application/transform/type-combinators.mjs +1 -1
- package/dist/cli/api-settings.cjs +78 -0
- package/dist/cli/api-settings.cjs.map +1 -0
- package/dist/cli/api-settings.mjs +73 -0
- package/dist/cli/api-settings.mjs.map +1 -0
- package/dist/cli/cli-arguments.cjs +12 -3
- package/dist/cli/cli-arguments.cjs.map +1 -1
- package/dist/cli/cli-arguments.mjs +12 -4
- package/dist/cli/cli-arguments.mjs.map +1 -1
- package/dist/cli/cli-errors.cjs +3 -2
- package/dist/cli/cli-errors.cjs.map +1 -1
- package/dist/cli/cli-errors.mjs +3 -2
- package/dist/cli/cli-errors.mjs.map +1 -1
- package/dist/cli/cli-output.cjs +8 -3
- package/dist/cli/cli-output.cjs.map +1 -1
- package/dist/cli/cli-output.mjs +9 -4
- package/dist/cli/cli-output.mjs.map +1 -1
- package/dist/cli/help-text.cjs +3 -3
- package/dist/cli/help-text.cjs.map +1 -1
- package/dist/cli/help-text.mjs +3 -3
- package/dist/cli/help-text.mjs.map +1 -1
- package/dist/cli/main.cjs +5 -0
- package/dist/cli/main.cjs.map +1 -1
- package/dist/cli/main.mjs +5 -0
- package/dist/cli/main.mjs.map +1 -1
- package/dist/cli/redocly-apis.cjs +15 -7
- package/dist/cli/redocly-apis.cjs.map +1 -1
- package/dist/cli/redocly-apis.mjs +15 -7
- package/dist/cli/redocly-apis.mjs.map +1 -1
- package/dist/cli/ref-limits.cjs +1 -1
- package/dist/cli/ref-limits.cjs.map +1 -1
- package/dist/cli/ref-limits.mjs +2 -2
- package/dist/cli/ref-limits.mjs.map +1 -1
- package/dist/cli/run-cli.cjs +20 -3
- package/dist/cli/run-cli.cjs.map +1 -1
- package/dist/cli/run-cli.mjs +21 -4
- package/dist/cli/run-cli.mjs.map +1 -1
- package/dist/domain/errors.cjs +6 -1
- package/dist/domain/errors.cjs.map +1 -1
- package/dist/domain/errors.mjs +6 -1
- package/dist/domain/errors.mjs.map +1 -1
- package/dist/domain/ir/constructors.cjs +7 -1
- package/dist/domain/ir/constructors.cjs.map +1 -1
- package/dist/domain/ir/constructors.mjs +6 -2
- package/dist/domain/ir/constructors.mjs.map +1 -1
- package/dist/domain/openapi/admitted-values.cjs +75 -0
- package/dist/domain/openapi/admitted-values.cjs.map +1 -0
- package/dist/domain/openapi/admitted-values.mjs +72 -0
- package/dist/domain/openapi/admitted-values.mjs.map +1 -0
- package/dist/domain/openapi/discriminated-union.cjs +68 -0
- package/dist/domain/openapi/discriminated-union.cjs.map +1 -0
- package/dist/domain/openapi/discriminated-union.mjs +62 -0
- package/dist/domain/openapi/discriminated-union.mjs.map +1 -0
- package/dist/domain/openapi/discriminator-conflicts.cjs +143 -0
- package/dist/domain/openapi/discriminator-conflicts.cjs.map +1 -0
- package/dist/domain/openapi/discriminator-conflicts.mjs +141 -0
- package/dist/domain/openapi/discriminator-conflicts.mjs.map +1 -0
- package/dist/domain/openapi/parameter-object.cjs.map +1 -1
- package/dist/domain/openapi/parameter-object.mjs.map +1 -1
- package/dist/domain/openapi/path-templates.cjs +23 -0
- package/dist/domain/openapi/path-templates.cjs.map +1 -0
- package/dist/domain/openapi/path-templates.mjs +21 -0
- package/dist/domain/openapi/path-templates.mjs.map +1 -0
- package/dist/domain/output-fixes.cjs +36 -1
- package/dist/domain/output-fixes.cjs.map +1 -1
- package/dist/domain/output-fixes.mjs +36 -1
- package/dist/domain/output-fixes.mjs.map +1 -1
- package/dist/domain/url-credentials.cjs +10 -0
- package/dist/domain/url-credentials.cjs.map +1 -0
- package/dist/domain/url-credentials.mjs +8 -0
- package/dist/domain/url-credentials.mjs.map +1 -0
- package/dist/domain/warnings.cjs +23 -0
- package/dist/domain/warnings.cjs.map +1 -0
- package/dist/domain/warnings.mjs +20 -0
- package/dist/domain/warnings.mjs.map +1 -0
- package/dist/index.cjs +2 -0
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +1182 -46
- package/dist/index.d.mts +1182 -46
- package/dist/index.d.ts +1182 -46
- package/dist/index.mjs +1 -0
- package/dist/index.mjs.map +1 -1
- package/dist/transform/components-object.cjs +2 -1
- package/dist/transform/components-object.cjs.map +1 -1
- package/dist/transform/components-object.mjs +2 -1
- package/dist/transform/components-object.mjs.map +1 -1
- package/dist/transform/path-item-object.cjs.map +1 -1
- package/dist/transform/path-item-object.mjs.map +1 -1
- package/package.json +6 -5
- package/src/adapters/redocly-loader/configured-headers.ts +65 -0
- package/src/adapters/redocly-loader/redocly-config-source.ts +41 -6
- package/src/adapters/redocly-loader/redocly-schema-loader.ts +44 -13
- package/src/adapters/redocly-loader/ref-access.ts +60 -5
- package/src/adapters/redocly-loader/ref-resolution-check.ts +257 -0
- package/src/adapters/redocly-loader/ref-resolution-steps.ts +113 -0
- package/src/adapters/redocly-loader/remote-fetch.ts +77 -21
- package/src/adapters/redocly-loader/schema-load-errors.ts +33 -11
- package/src/adapters/redocly-loader/unsupported-keys.ts +17 -2
- package/src/adapters/terminal-logger/terminal-logger.ts +9 -5
- package/src/adapters/type-ast-bridge/ir-to-typescript.ts +5 -1
- package/src/adapters/type-ast-bridge/print-typescript.ts +3 -1
- package/src/adapters/type-ast-bridge/typescript-to-ir.ts +26 -12
- package/src/adapters/type-ast-bridge/typescript-types.ts +57 -5
- package/src/api/default-ports.ts +16 -0
- package/src/api/discriminator-conflict-warnings.ts +43 -0
- package/src/api/discriminator-enum-names.ts +26 -0
- package/src/api/discriminator-enum-parent.ts +129 -0
- package/src/api/discriminator-enum.ts +39 -0
- package/src/api/discriminator-other-owners.ts +97 -0
- package/src/api/discriminator-patch.ts +152 -0
- package/src/api/discriminator-scan.ts +78 -90
- package/src/api/document-refs.ts +19 -15
- package/src/api/document-run.ts +32 -11
- package/src/api/enum-values-warnings.ts +21 -0
- package/src/api/footer-sink.ts +34 -2
- package/src/api/legacy-callback-warning.ts +7 -3
- package/src/api/legacy-ts-helpers.ts +7 -5
- package/src/api/legacy-utils.ts +1 -1
- package/src/api/openapi-ts.ts +2 -0
- package/src/api/path-template-warnings.ts +27 -0
- package/src/api/run-context.ts +34 -0
- package/src/api/transform-context.ts +17 -9
- package/src/api/transform-schema.ts +90 -5
- package/src/api/unsupported-feature-warnings.ts +8 -1
- package/src/application/ports/redocly-config-source.ts +5 -1
- package/src/application/print/type-printer.ts +8 -1
- package/src/application/transform/document/assignability.ts +203 -0
- package/src/application/transform/document/components.ts +6 -6
- package/src/application/transform/document/declared-types.ts +93 -0
- package/src/application/transform/document/document.ts +71 -13
- package/src/application/transform/document/exploded-query.ts +91 -0
- package/src/application/transform/document/global-type-references.ts +78 -0
- package/src/application/transform/document/list-assignability.ts +87 -0
- package/src/application/transform/document/parameters.ts +78 -12
- package/src/application/transform/document/path-key-overlaps.ts +148 -59
- package/src/application/transform/document/path-template-replace.ts +90 -0
- package/src/application/transform/document/paths.ts +101 -38
- package/src/application/transform/document/root-type-aliases.ts +29 -28
- package/src/application/transform/document/template-key-match.ts +183 -0
- package/src/application/transform/document/type-assignability.ts +268 -0
- package/src/application/transform/document/type-key.ts +80 -0
- package/src/application/transform/document/type-resolution.ts +163 -0
- package/src/application/transform/footer/document-footer.ts +91 -6
- package/src/application/transform/footer/enum-naming.ts +29 -0
- package/src/application/transform/footer/enum-values-check.ts +171 -0
- package/src/application/transform/footer/evaluation.ts +57 -0
- package/src/application/transform/footer/shared-enum-names.ts +86 -0
- package/src/application/transform/footer/type-evaluation.ts +167 -0
- package/src/application/transform/footer/type-indexing.ts +152 -0
- package/src/application/transform/footer/type-rules.ts +269 -0
- package/src/application/transform/ref-pointer/generated-location.ts +211 -0
- package/src/application/transform/ref-pointer/generated-shape.ts +275 -0
- package/src/application/transform/ref-pointer/inline-cycles.ts +56 -0
- package/src/application/transform/ref-pointer/original-index.ts +95 -0
- package/src/application/transform/ref-pointer/pointer-type.ts +92 -0
- package/src/application/transform/ref-pointer/pointer-walk.ts +96 -0
- package/src/application/transform/ref-pointer/typed-walk.ts +192 -0
- package/src/application/transform/ref-type.ts +11 -6
- package/src/application/transform/schema/access-flags.ts +63 -0
- package/src/application/transform/schema/array-type.ts +66 -5
- package/src/application/transform/schema/composition-type.ts +96 -24
- package/src/application/transform/schema/core-type.ts +8 -4
- package/src/application/transform/schema/discriminated-union.ts +58 -0
- package/src/application/transform/schema/discriminator-property.ts +8 -3
- package/src/application/transform/schema/enum-rule.ts +136 -13
- package/src/application/transform/schema/inherited-discriminator.ts +54 -0
- package/src/application/transform/schema/object-type.ts +51 -33
- package/src/application/transform/schema/required-variants.ts +88 -0
- package/src/application/transform/schema/schema-context.ts +26 -0
- package/src/application/transform/schema/schema-transform.ts +2 -2
- package/src/application/transform/schema-comment.ts +84 -4
- package/src/cli/api-settings.ts +109 -0
- package/src/cli/cli-arguments.ts +18 -5
- package/src/cli/cli-dependencies.ts +5 -0
- package/src/cli/cli-errors.ts +4 -2
- package/src/cli/cli-output.ts +18 -4
- package/src/cli/help-text.ts +4 -4
- package/src/cli/main.ts +6 -0
- package/src/cli/redocly-apis.ts +21 -11
- package/src/cli/ref-limits.ts +2 -2
- package/src/cli/run-cli.ts +25 -4
- package/src/domain/errors.ts +10 -2
- package/src/domain/ir/constructors.ts +9 -1
- package/src/domain/ir/nodes.ts +11 -7
- package/src/domain/openapi/admitted-values.ts +113 -0
- package/src/domain/openapi/discriminated-union.ts +109 -0
- package/src/domain/openapi/discriminator-conflicts.ts +251 -0
- package/src/domain/openapi/parameter-object.ts +4 -0
- package/src/domain/openapi/path-templates.ts +32 -0
- package/src/domain/openapi/schema-object.ts +2 -0
- package/src/domain/output-fixes.ts +43 -2
- package/src/domain/url-credentials.ts +18 -0
- package/src/domain/warnings.ts +28 -0
- package/src/index.ts +1 -0
- package/src/transform/components-object.ts +3 -1
- package/src/transform/path-item-object.ts +6 -2
- package/src/types/generator-options.ts +12 -21
- package/src/types/openapi-common.ts +1 -0
- package/src/types/openapi-request.ts +3 -0
- package/src/types/openapi-schema.ts +2 -0
- package/src/types/openapi-security.ts +1 -0
- package/dist/application/transform/document/path-item-conflicts.cjs +0 -51
- package/dist/application/transform/document/path-item-conflicts.cjs.map +0 -1
- package/dist/application/transform/document/path-item-conflicts.mjs +0 -49
- package/dist/application/transform/document/path-item-conflicts.mjs.map +0 -1
- package/src/application/transform/document/path-item-conflicts.ts +0 -79
package/dist/index.mjs
CHANGED
|
@@ -9,6 +9,7 @@ export { default as transformSchema } from './api/transform-schema.mjs';
|
|
|
9
9
|
export { BOOLEAN, FALSE, NEVER, NULL, NUMBER, STRING, TRUE, UNDEFINED, UNKNOWN, oapiRef, tsIntersection, tsLiteral, tsNullable, tsOmit, tsRecord, tsUnion, tsWithRequired } from './api/type-helpers.mjs';
|
|
10
10
|
export { ERROR_CODES, OpenAPITypesafeError, isOpenAPITypesafeError } from './domain/errors.mjs';
|
|
11
11
|
export { ALL_OUTPUT_FIXES, OUTPUT_FIXES, OutputFix } from './domain/output-fixes.mjs';
|
|
12
|
+
export { WARNING_CODES } from './domain/warnings.mjs';
|
|
12
13
|
export { default as transformComponentsObject } from './transform/components-object.mjs';
|
|
13
14
|
export { default as transformHeaderObject } from './transform/header-object.mjs';
|
|
14
15
|
export { default as transformMediaTypeObject } from './transform/media-type-object.mjs';
|
package/dist/index.mjs.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.mjs","sources":[],"sourcesContent":[],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"index.mjs","sources":[],"sourcesContent":[],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;"}
|
|
@@ -4,10 +4,11 @@ Object.defineProperty(exports, '__esModule', { value: true });
|
|
|
4
4
|
|
|
5
5
|
const transformContext = require('../api/transform-context.cjs');
|
|
6
6
|
const components = require('../application/transform/document/components.cjs');
|
|
7
|
+
const rootTypeAliases = require('../application/transform/document/root-type-aliases.cjs');
|
|
7
8
|
|
|
8
9
|
function transformComponentsObject(componentsObject, ctx) {
|
|
9
10
|
const { type, rootTypes } = components.componentsType(componentsObject, transformContext.createTransformContext(ctx));
|
|
10
|
-
return [type, ...rootTypes];
|
|
11
|
+
return [type, ...rootTypeAliases.renameTakenAliases(rootTypes, [])];
|
|
11
12
|
}
|
|
12
13
|
|
|
13
14
|
exports.default = transformComponentsObject;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"components-object.cjs","sources":["../../src/transform/components-object.ts"],"sourcesContent":["import { createTransformContext } from \"../api/transform-context.js\";\nimport { componentsType } from \"../application/transform/document/components.js\";\nimport type { IrType, IrTypeAliasDeclaration } from \"../domain/ir/nodes.js\";\nimport { isEnumSchema, singularizeComponentKind } from \"../domain/openapi/components-object.js\";\nimport type { ComponentsObject, GlobalContext } from \"../types.js\";\n\nexport { isEnumSchema };\n\n/** `requestBodies` → `requestBody`; other keys drop the final `s`. */\nexport const singularizeComponentKey = singularizeComponentKind;\n\n/**\n * Transform the ComponentsObject (4.8.7)\n * @see https://spec.openapis.org/oas/latest.html#components-object\n *\n * Ported to IR (ENGINEERING_PLAN Phase 5, step 6). Same name and parameters as the original;\n * returns IR (task 6.2). For the public API: the `components` type, then the root type aliases.\n */\nexport default function transformComponentsObject(\n componentsObject: ComponentsObject,\n ctx: GlobalContext,\n): (IrType | IrTypeAliasDeclaration)[] {\n const { type, rootTypes } = componentsType(componentsObject, createTransformContext(ctx));\n return [type, ...rootTypes];\n}\n"],"names":["componentsType","createTransformContext"],"mappings":"
|
|
1
|
+
{"version":3,"file":"components-object.cjs","sources":["../../src/transform/components-object.ts"],"sourcesContent":["import { createTransformContext } from \"../api/transform-context.js\";\nimport { componentsType } from \"../application/transform/document/components.js\";\nimport { renameTakenAliases } from \"../application/transform/document/root-type-aliases.js\";\nimport type { IrType, IrTypeAliasDeclaration } from \"../domain/ir/nodes.js\";\nimport { isEnumSchema, singularizeComponentKind } from \"../domain/openapi/components-object.js\";\nimport type { ComponentsObject, GlobalContext } from \"../types.js\";\n\nexport { isEnumSchema };\n\n/** `requestBodies` → `requestBody`; other keys drop the final `s`. */\nexport const singularizeComponentKey = singularizeComponentKind;\n\n/**\n * Transform the ComponentsObject (4.8.7)\n * @see https://spec.openapis.org/oas/latest.html#components-object\n *\n * Ported to IR (ENGINEERING_PLAN Phase 5, step 6). Same name and parameters as the original;\n * returns IR (task 6.2). For the public API: the `components` type, then the root type aliases.\n */\nexport default function transformComponentsObject(\n componentsObject: ComponentsObject,\n ctx: GlobalContext,\n): (IrType | IrTypeAliasDeclaration)[] {\n const { type, rootTypes } = componentsType(componentsObject, createTransformContext(ctx));\n // No footer here: only the aliases the `root-type-numbering` fix keeps get numbers.\n return [type, ...renameTakenAliases(rootTypes, [])];\n}\n"],"names":["componentsType","createTransformContext","renameTakenAliases"],"mappings":";;;;;;;;AAmBA,SAAwB,yBAAA,CACtB,kBACA,GAAA,EACqC;AACrC,EAAA,MAAM,EAAE,MAAM,SAAA,EAAU,GAAIA,0BAAe,gBAAA,EAAkBC,uCAAA,CAAuB,GAAG,CAAC,CAAA;AAExF,EAAA,OAAO,CAAC,IAAA,EAAM,GAAGC,mCAAmB,SAAA,EAAW,EAAE,CAAC,CAAA;AACpD;;"}
|
|
@@ -1,9 +1,10 @@
|
|
|
1
1
|
import { createTransformContext } from '../api/transform-context.mjs';
|
|
2
2
|
import { componentsType } from '../application/transform/document/components.mjs';
|
|
3
|
+
import { renameTakenAliases } from '../application/transform/document/root-type-aliases.mjs';
|
|
3
4
|
|
|
4
5
|
function transformComponentsObject(componentsObject, ctx) {
|
|
5
6
|
const { type, rootTypes } = componentsType(componentsObject, createTransformContext(ctx));
|
|
6
|
-
return [type, ...rootTypes];
|
|
7
|
+
return [type, ...renameTakenAliases(rootTypes, [])];
|
|
7
8
|
}
|
|
8
9
|
|
|
9
10
|
export { transformComponentsObject as default };
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"components-object.mjs","sources":["../../src/transform/components-object.ts"],"sourcesContent":["import { createTransformContext } from \"../api/transform-context.js\";\nimport { componentsType } from \"../application/transform/document/components.js\";\nimport type { IrType, IrTypeAliasDeclaration } from \"../domain/ir/nodes.js\";\nimport { isEnumSchema, singularizeComponentKind } from \"../domain/openapi/components-object.js\";\nimport type { ComponentsObject, GlobalContext } from \"../types.js\";\n\nexport { isEnumSchema };\n\n/** `requestBodies` → `requestBody`; other keys drop the final `s`. */\nexport const singularizeComponentKey = singularizeComponentKind;\n\n/**\n * Transform the ComponentsObject (4.8.7)\n * @see https://spec.openapis.org/oas/latest.html#components-object\n *\n * Ported to IR (ENGINEERING_PLAN Phase 5, step 6). Same name and parameters as the original;\n * returns IR (task 6.2). For the public API: the `components` type, then the root type aliases.\n */\nexport default function transformComponentsObject(\n componentsObject: ComponentsObject,\n ctx: GlobalContext,\n): (IrType | IrTypeAliasDeclaration)[] {\n const { type, rootTypes } = componentsType(componentsObject, createTransformContext(ctx));\n return [type, ...rootTypes];\n}\n"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"components-object.mjs","sources":["../../src/transform/components-object.ts"],"sourcesContent":["import { createTransformContext } from \"../api/transform-context.js\";\nimport { componentsType } from \"../application/transform/document/components.js\";\nimport { renameTakenAliases } from \"../application/transform/document/root-type-aliases.js\";\nimport type { IrType, IrTypeAliasDeclaration } from \"../domain/ir/nodes.js\";\nimport { isEnumSchema, singularizeComponentKind } from \"../domain/openapi/components-object.js\";\nimport type { ComponentsObject, GlobalContext } from \"../types.js\";\n\nexport { isEnumSchema };\n\n/** `requestBodies` → `requestBody`; other keys drop the final `s`. */\nexport const singularizeComponentKey = singularizeComponentKind;\n\n/**\n * Transform the ComponentsObject (4.8.7)\n * @see https://spec.openapis.org/oas/latest.html#components-object\n *\n * Ported to IR (ENGINEERING_PLAN Phase 5, step 6). Same name and parameters as the original;\n * returns IR (task 6.2). For the public API: the `components` type, then the root type aliases.\n */\nexport default function transformComponentsObject(\n componentsObject: ComponentsObject,\n ctx: GlobalContext,\n): (IrType | IrTypeAliasDeclaration)[] {\n const { type, rootTypes } = componentsType(componentsObject, createTransformContext(ctx));\n // No footer here: only the aliases the `root-type-numbering` fix keeps get numbers.\n return [type, ...renameTakenAliases(rootTypes, [])];\n}\n"],"names":[],"mappings":";;;;AAmBA,SAAwB,yBAAA,CACtB,kBACA,GAAA,EACqC;AACrC,EAAA,MAAM,EAAE,MAAM,SAAA,EAAU,GAAI,eAAe,gBAAA,EAAkB,sBAAA,CAAuB,GAAG,CAAC,CAAA;AAExF,EAAA,OAAO,CAAC,IAAA,EAAM,GAAG,mBAAmB,SAAA,EAAW,EAAE,CAAC,CAAA;AACpD;;"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"path-item-object.cjs","sources":["../../src/transform/path-item-object.ts"],"sourcesContent":["import { createTransformContext, schemaLocation } from \"../api/transform-context.js\";\nimport { pathItemType } from \"../application/transform/document/path-item.js\";\nimport type { IrType } from \"../domain/ir/nodes.js\";\nimport type {
|
|
1
|
+
{"version":3,"file":"path-item-object.cjs","sources":["../../src/transform/path-item-object.ts"],"sourcesContent":["import { createTransformContext, schemaLocation } from \"../api/transform-context.js\";\nimport { pathItemType } from \"../application/transform/document/path-item.js\";\nimport type { IrType } from \"../domain/ir/nodes.js\";\nimport type { PathItemMethod } from \"../domain/openapi/path-item-object.js\";\nimport type { PathItemObject, TransformNodeOptions } from \"../types.js\";\n\n/**\n * The operation methods of a path item: openapi-typescript's eight, plus the OpenAPI 3.2 `query`\n * (ADR-020), as `HttpMethod` of openapi-typesafe-helpers lists them.\n */\nexport type Method = PathItemMethod;\n\n/**\n * Transform PathItem nodes (4.8.9)\n * @see https://spec.openapis.org/oas/v3.1.0#path-item-object\n *\n * Ported to IR (ENGINEERING_PLAN Phase 5, step 5). Same name and parameters as the original;\n * returns IR (task 6.2). For the public API and for users who call it from callbacks.\n */\nexport default function transformPathItemObject(\n pathItem: PathItemObject,\n options: TransformNodeOptions,\n): IrType {\n const context = createTransformContext(options.ctx);\n return pathItemType(pathItem, schemaLocation(options), context);\n}\n"],"names":["pathItem","createTransformContext","pathItemType","schemaLocation"],"mappings":";;;;;AAmBA,SAAwB,uBAAA,CACtBA,YACA,OAAA,EACQ;AACR,EAAA,MAAM,OAAA,GAAUC,uCAAA,CAAuB,OAAA,CAAQ,GAAG,CAAA;AAClD,EAAA,OAAOC,qBAAA,CAAaF,UAAA,EAAUG,+BAAA,CAAe,OAAO,GAAG,OAAO,CAAA;AAChE;;"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"path-item-object.mjs","sources":["../../src/transform/path-item-object.ts"],"sourcesContent":["import { createTransformContext, schemaLocation } from \"../api/transform-context.js\";\nimport { pathItemType } from \"../application/transform/document/path-item.js\";\nimport type { IrType } from \"../domain/ir/nodes.js\";\nimport type {
|
|
1
|
+
{"version":3,"file":"path-item-object.mjs","sources":["../../src/transform/path-item-object.ts"],"sourcesContent":["import { createTransformContext, schemaLocation } from \"../api/transform-context.js\";\nimport { pathItemType } from \"../application/transform/document/path-item.js\";\nimport type { IrType } from \"../domain/ir/nodes.js\";\nimport type { PathItemMethod } from \"../domain/openapi/path-item-object.js\";\nimport type { PathItemObject, TransformNodeOptions } from \"../types.js\";\n\n/**\n * The operation methods of a path item: openapi-typescript's eight, plus the OpenAPI 3.2 `query`\n * (ADR-020), as `HttpMethod` of openapi-typesafe-helpers lists them.\n */\nexport type Method = PathItemMethod;\n\n/**\n * Transform PathItem nodes (4.8.9)\n * @see https://spec.openapis.org/oas/v3.1.0#path-item-object\n *\n * Ported to IR (ENGINEERING_PLAN Phase 5, step 5). Same name and parameters as the original;\n * returns IR (task 6.2). For the public API and for users who call it from callbacks.\n */\nexport default function transformPathItemObject(\n pathItem: PathItemObject,\n options: TransformNodeOptions,\n): IrType {\n const context = createTransformContext(options.ctx);\n return pathItemType(pathItem, schemaLocation(options), context);\n}\n"],"names":[],"mappings":";;;AAmBA,SAAwB,uBAAA,CACtB,UACA,OAAA,EACQ;AACR,EAAA,MAAM,OAAA,GAAU,sBAAA,CAAuB,OAAA,CAAQ,GAAG,CAAA;AAClD,EAAA,OAAO,YAAA,CAAa,QAAA,EAAU,cAAA,CAAe,OAAO,GAAG,OAAO,CAAA;AAChE;;"}
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "openapi-typesafe",
|
|
3
|
-
"description": "Convert OpenAPI 3.0 & 3.
|
|
4
|
-
"version": "1.0.0-rc.
|
|
3
|
+
"description": "Convert OpenAPI 3.0, 3.1 & 3.2 schemas to TypeScript",
|
|
4
|
+
"version": "1.0.0-rc.2",
|
|
5
5
|
"author": {
|
|
6
6
|
"name": "Fedor Chishchin",
|
|
7
7
|
"url": "https://github.com/fedorello"
|
|
@@ -72,7 +72,7 @@
|
|
|
72
72
|
}
|
|
73
73
|
},
|
|
74
74
|
"dependencies": {
|
|
75
|
-
"@redocly/openapi-core": "^1.34.
|
|
75
|
+
"@redocly/openapi-core": "^1.34.23",
|
|
76
76
|
"ansi-colors": "^4.1.3",
|
|
77
77
|
"change-case": "^5.4.4",
|
|
78
78
|
"parse-json": "^8.3.0",
|
|
@@ -81,15 +81,16 @@
|
|
|
81
81
|
"yargs-parser": "^22.0.0"
|
|
82
82
|
},
|
|
83
83
|
"devDependencies": {
|
|
84
|
-
"@types/js-yaml": "4.0.9",
|
|
85
84
|
"@types/yargs-parser": "21.0.3",
|
|
86
85
|
"@typescript/typescript6": "6.0.2",
|
|
87
86
|
"degit": "3.10.1",
|
|
88
|
-
"dependency-cruiser": "18.7.
|
|
87
|
+
"dependency-cruiser": "18.7.2",
|
|
89
88
|
"execa": "^10.2.1",
|
|
90
89
|
"fast-check": "4.10.2",
|
|
91
90
|
"strip-ansi": "7.2.0",
|
|
92
91
|
"typescript": "^6.0.3",
|
|
92
|
+
"typescript-5.4": "npm:typescript@5.4.5",
|
|
93
|
+
"typescript-7.0": "npm:typescript@7.0.2",
|
|
93
94
|
"vite-node": "6.0.0"
|
|
94
95
|
},
|
|
95
96
|
"engines": {
|
|
@@ -0,0 +1,65 @@
|
|
|
1
|
+
import { type Config as RedoclyConfig, readFileFromUrl } from "@redocly/openapi-core";
|
|
2
|
+
|
|
3
|
+
/**
|
|
4
|
+
* Which `resolve.http.headers` of the Redocly config go with a request (threat model T4a). The
|
|
5
|
+
* headers often carry credentials, so they are chosen again for every request and every redirect,
|
|
6
|
+
* from the parsed URL, and never sent over plain HTTP to another machine unless the pattern asks
|
|
7
|
+
* for it.
|
|
8
|
+
*/
|
|
9
|
+
|
|
10
|
+
/** One `resolve.http.headers` entry: a name, a value or an environment variable, a pattern. */
|
|
11
|
+
export type ConfiguredHeader = RedoclyConfig["resolve"]["http"]["headers"][number];
|
|
12
|
+
|
|
13
|
+
/** Redocly matches the protocol only when the pattern starts with one; the same test. */
|
|
14
|
+
const EXPLICIT_HTTP_PATTERN = /^http:\/\//;
|
|
15
|
+
|
|
16
|
+
/** Hosts that never leave the machine: plain HTTP to them cannot be read on the network. */
|
|
17
|
+
const LOOPBACK_HOSTNAMES: ReadonlySet<string> = new Set(["localhost", "[::1]"]);
|
|
18
|
+
// The URL parser has already turned every IPv4 form (`2130706433`, `0x7f.1`) into dotted decimal.
|
|
19
|
+
const LOOPBACK_IPV4 = /^127\.\d{1,3}\.\d{1,3}\.\d{1,3}$/;
|
|
20
|
+
|
|
21
|
+
function isLoopback(url: URL): boolean {
|
|
22
|
+
return LOOPBACK_HOSTNAMES.has(url.hostname) || LOOPBACK_IPV4.test(url.hostname);
|
|
23
|
+
}
|
|
24
|
+
|
|
25
|
+
/**
|
|
26
|
+
* A header goes over HTTPS, over HTTP to this machine (a local dev server), or over HTTP to
|
|
27
|
+
* another machine when its pattern names `http://` itself.
|
|
28
|
+
*/
|
|
29
|
+
function isProtocolAllowed(header: ConfiguredHeader, url: URL): boolean {
|
|
30
|
+
return (
|
|
31
|
+
url.protocol === "https:" ||
|
|
32
|
+
(url.protocol === "http:" && isLoopback(url)) ||
|
|
33
|
+
EXPLICIT_HTTP_PATTERN.test(header.matches)
|
|
34
|
+
);
|
|
35
|
+
}
|
|
36
|
+
|
|
37
|
+
/**
|
|
38
|
+
* The URL as a pattern sees it: protocol, host and path. User info, query and fragment are left
|
|
39
|
+
* out, so a `*` in the pattern cannot match across `?`, `#` or `@` into another host's URL.
|
|
40
|
+
*/
|
|
41
|
+
function matchedText(url: URL): string {
|
|
42
|
+
return `${url.protocol}//${url.host}${url.pathname}`;
|
|
43
|
+
}
|
|
44
|
+
|
|
45
|
+
/**
|
|
46
|
+
* The headers configured for this URL. The patterns are matched by Redocly's own matcher, which
|
|
47
|
+
* also reads `envVariable` values, so a pattern means here what it means in Redocly; its fetch
|
|
48
|
+
* only records the headers it would send and sends nothing.
|
|
49
|
+
*/
|
|
50
|
+
export async function headersFor(
|
|
51
|
+
url: URL,
|
|
52
|
+
configured: readonly ConfiguredHeader[],
|
|
53
|
+
): Promise<Record<string, string>> {
|
|
54
|
+
const candidates = configured.filter((header) => isProtocolAllowed(header, url));
|
|
55
|
+
let selected: Record<string, string> = {};
|
|
56
|
+
if (candidates.length === 0) {
|
|
57
|
+
return selected;
|
|
58
|
+
}
|
|
59
|
+
const recordHeaders = async (_input: string, init: { headers: Record<string, string> }) => {
|
|
60
|
+
selected = init.headers;
|
|
61
|
+
return new Response("");
|
|
62
|
+
};
|
|
63
|
+
await readFileFromUrl(matchedText(url), { headers: [...candidates], customFetch: recordHeaders });
|
|
64
|
+
return selected;
|
|
65
|
+
}
|
|
@@ -1,10 +1,43 @@
|
|
|
1
1
|
import fs from "node:fs";
|
|
2
2
|
import path from "node:path";
|
|
3
|
-
import { createConfig, findConfig, loadConfig } from "@redocly/openapi-core";
|
|
3
|
+
import { createConfig, findConfig, IGNORE_FILE, loadConfig } from "@redocly/openapi-core";
|
|
4
4
|
import type {
|
|
5
5
|
RedoclyConfig,
|
|
6
6
|
RedoclyConfigSource,
|
|
7
7
|
} from "../../application/ports/redocly-config-source.js";
|
|
8
|
+
import { ERROR_CODES, OpenAPITypesafeError } from "../../domain/errors.js";
|
|
9
|
+
|
|
10
|
+
/**
|
|
11
|
+
* The first line of a failure, with the error's name: a YAML error goes on with a snippet of the
|
|
12
|
+
* file, and the name tells a YAML error from a file system one.
|
|
13
|
+
*/
|
|
14
|
+
function reasonOf(error: unknown): string {
|
|
15
|
+
return String(error).replace(/\n[\s\S]*$/, "");
|
|
16
|
+
}
|
|
17
|
+
|
|
18
|
+
/**
|
|
19
|
+
* The config, or `CLI_CONFIG_INVALID`. Redocly reads the config file and the lint-ignore file
|
|
20
|
+
* next to it (or in the working directory); either can be malformed, and its error does not
|
|
21
|
+
* always name the file, so the message names both.
|
|
22
|
+
*/
|
|
23
|
+
async function loadedConfig(
|
|
24
|
+
load: () => Promise<RedoclyConfig>,
|
|
25
|
+
configPath: string | undefined,
|
|
26
|
+
): Promise<RedoclyConfig> {
|
|
27
|
+
try {
|
|
28
|
+
return await load();
|
|
29
|
+
} catch (error) {
|
|
30
|
+
const config =
|
|
31
|
+
configPath === undefined ? "the default Redocly config" : `the Redocly config ${configPath}`;
|
|
32
|
+
const where = configPath === undefined ? "in the working directory" : "next to it";
|
|
33
|
+
throw new OpenAPITypesafeError({
|
|
34
|
+
code: ERROR_CODES.CLI_CONFIG_INVALID,
|
|
35
|
+
message: `Cannot load ${config} or the ${IGNORE_FILE} ${where}: ${reasonOf(error)}`,
|
|
36
|
+
details: { configPath },
|
|
37
|
+
cause: error,
|
|
38
|
+
});
|
|
39
|
+
}
|
|
40
|
+
}
|
|
8
41
|
|
|
9
42
|
/** The Redocly config port on `@redocly/openapi-core`, resolving paths from `cwd`. */
|
|
10
43
|
class RedoclyConfigFiles implements RedoclyConfigSource {
|
|
@@ -26,14 +59,16 @@ class RedoclyConfigFiles implements RedoclyConfigSource {
|
|
|
26
59
|
}
|
|
27
60
|
|
|
28
61
|
load(configPath: string): Promise<RedoclyConfig> {
|
|
29
|
-
return loadConfig({ configPath });
|
|
62
|
+
return loadedConfig(() => loadConfig({ configPath }), configPath);
|
|
30
63
|
}
|
|
31
64
|
|
|
32
65
|
createDefault(): Promise<RedoclyConfig> {
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
66
|
+
const create = () =>
|
|
67
|
+
createConfig(
|
|
68
|
+
{ rules: { "operation-operationId-unique": { severity: "warn" } } },
|
|
69
|
+
{ extends: ["minimal"] },
|
|
70
|
+
);
|
|
71
|
+
return loadedConfig(create, undefined);
|
|
37
72
|
}
|
|
38
73
|
}
|
|
39
74
|
|
|
@@ -10,11 +10,14 @@ import {
|
|
|
10
10
|
import type { Logger } from "../../application/ports/logger.js";
|
|
11
11
|
import type { SchemaLoader, SchemaLoadRequest } from "../../application/ports/schema-loader.js";
|
|
12
12
|
import { withStackOverflowReportedAsync } from "../../application/stack-overflow.js";
|
|
13
|
+
import { WARNING_CODES, warningText } from "../../domain/warnings.js";
|
|
13
14
|
import type { OpenAPI3 } from "../../types.js";
|
|
14
15
|
import { repairBundledRefs } from "./bundled-ref-repair.js";
|
|
15
16
|
import { findMalformedRefs, malformedRefsError } from "./malformed-refs.js";
|
|
16
17
|
import { RefAccessResolver } from "./ref-access.js";
|
|
17
|
-
import {
|
|
18
|
+
import { checkRefsResolve } from "./ref-resolution-check.js";
|
|
19
|
+
import { REF_CYCLE_MESSAGE } from "./ref-resolution-steps.js";
|
|
20
|
+
import { type RemoteDocumentLimits, resolveConfigWithAccess } from "./remote-fetch.js";
|
|
18
21
|
import {
|
|
19
22
|
loadFailedError,
|
|
20
23
|
refCycleError,
|
|
@@ -39,6 +42,7 @@ export interface RedoclySchemaLoaderOptions {
|
|
|
39
42
|
readonly now: () => number;
|
|
40
43
|
/** Time limit of one remote fetch, unless the Redocly config brings its own `customFetch`. */
|
|
41
44
|
readonly remoteRefTimeoutMs: number;
|
|
45
|
+
readonly remoteDocumentLimits: RemoteDocumentLimits;
|
|
42
46
|
}
|
|
43
47
|
|
|
44
48
|
const UNSUPPORTED_FORMAT_MESSAGE = "Unsupported schema format, expected `openapi: 3.x`";
|
|
@@ -74,12 +78,17 @@ function assertOpenAPI3(document: unknown): void {
|
|
|
74
78
|
throw versionUnsupportedError(UNSUPPORTED_FORMAT_MESSAGE, parsed);
|
|
75
79
|
}
|
|
76
80
|
|
|
77
|
-
/**
|
|
81
|
+
/**
|
|
82
|
+
* The name an inline source (a string, object, buffer or stream) gets inside the working
|
|
83
|
+
* directory. Redocly resolves relative `$ref`s against the directory of the document, so the
|
|
84
|
+
* document must be named as a file in the working directory, not as the directory itself.
|
|
85
|
+
*/
|
|
86
|
+
const INLINE_SOURCE_NAME = "inline-source";
|
|
87
|
+
|
|
88
|
+
/** The base for relative `$ref`s: the source file or URL itself, else a file in the cwd. */
|
|
78
89
|
function sourceAbsoluteRef(source: unknown, cwd: URL): string {
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
}
|
|
82
|
-
return fileURLToPath(cwd);
|
|
90
|
+
const document = source instanceof URL ? source : new URL(INLINE_SOURCE_NAME, cwd);
|
|
91
|
+
return document.protocol === "file:" ? sourceFilePath(document) : document.href;
|
|
83
92
|
}
|
|
84
93
|
|
|
85
94
|
/**
|
|
@@ -98,9 +107,6 @@ function sourceFilePath(source: URL): string {
|
|
|
98
107
|
}
|
|
99
108
|
}
|
|
100
109
|
|
|
101
|
-
/** Redocly throws a plain Error for a `$ref` chain that points back to itself. */
|
|
102
|
-
const REF_CYCLE_MESSAGE = "Self-referencing circular pointer";
|
|
103
|
-
|
|
104
110
|
/**
|
|
105
111
|
* The root document and every other document the resolver loaded, as far as they parsed. A root
|
|
106
112
|
* read from a file or URL is in the resolver cache too, and is listed once.
|
|
@@ -171,12 +177,16 @@ class RedoclySchemaLoader implements SchemaLoader {
|
|
|
171
177
|
}
|
|
172
178
|
|
|
173
179
|
#resolver(request: SchemaLoadRequest): RefAccessResolver {
|
|
174
|
-
const { redoc, remoteRefTimeoutMs } = this.#options;
|
|
180
|
+
const { redoc, remoteRefTimeoutMs, remoteDocumentLimits } = this.#options;
|
|
175
181
|
const config = resolveConfigWithAccess(redoc.resolve, {
|
|
176
182
|
timeoutMs: remoteRefTimeoutMs,
|
|
177
183
|
access: request.refAccess,
|
|
184
|
+
maxParallelFetches: remoteDocumentLimits.maxParallelFetches,
|
|
185
|
+
});
|
|
186
|
+
return new RefAccessResolver(config, {
|
|
187
|
+
access: request.refAccess,
|
|
188
|
+
maxRemoteDocuments: remoteDocumentLimits.maxDocuments,
|
|
178
189
|
});
|
|
179
|
-
return new RefAccessResolver(config, request.refAccess);
|
|
180
190
|
}
|
|
181
191
|
|
|
182
192
|
async #lintAndBundle(
|
|
@@ -185,6 +195,8 @@ class RedoclySchemaLoader implements SchemaLoader {
|
|
|
185
195
|
shouldLint: boolean,
|
|
186
196
|
): Promise<OpenAPI3> {
|
|
187
197
|
const rethrow = (error: unknown) => rethrowDocumentError(error, document, resolver);
|
|
198
|
+
// Redocly leaves unhandled rejections behind when a `$ref` fails in two documents (ADR-031).
|
|
199
|
+
await checkRefsResolve(document, resolver, this.#options.redoc.styleguide).catch(rethrow);
|
|
188
200
|
if (shouldLint) {
|
|
189
201
|
await this.#lint(document, resolver).catch(rethrow);
|
|
190
202
|
}
|
|
@@ -217,16 +229,27 @@ class RedoclySchemaLoader implements SchemaLoader {
|
|
|
217
229
|
return bundled.bundle.parsed;
|
|
218
230
|
}
|
|
219
231
|
|
|
220
|
-
/**
|
|
232
|
+
/**
|
|
233
|
+
* Report every problem; then throw if any of them is an error. A problem that the Redocly
|
|
234
|
+
* config's `.redocly.lint-ignore.yaml` lists is left out, as `redocly lint` leaves it out
|
|
235
|
+
* (upstream #2189).
|
|
236
|
+
*/
|
|
221
237
|
#report(problems: readonly NormalizedProblem[]): void {
|
|
222
238
|
const errorMessages: string[] = [];
|
|
223
239
|
for (const problem of problems) {
|
|
240
|
+
if (problem.ignored === true) {
|
|
241
|
+
this.#options.logger.debug(
|
|
242
|
+
`Ignored by the lint ignore file: ${problemMessage(problem)}`,
|
|
243
|
+
"lint",
|
|
244
|
+
);
|
|
245
|
+
continue;
|
|
246
|
+
}
|
|
224
247
|
const message = problemMessage(problem);
|
|
225
248
|
if (problem.severity === "error") {
|
|
226
249
|
errorMessages.push(message);
|
|
227
250
|
this.#options.logger.error(message);
|
|
228
251
|
} else {
|
|
229
|
-
this.#options.logger.warn(
|
|
252
|
+
this.#options.logger.warn(lintWarningText(problem));
|
|
230
253
|
}
|
|
231
254
|
}
|
|
232
255
|
if (errorMessages.length > 0) {
|
|
@@ -235,6 +258,14 @@ class RedoclySchemaLoader implements SchemaLoader {
|
|
|
235
258
|
}
|
|
236
259
|
}
|
|
237
260
|
|
|
261
|
+
/** A lint warning names its rule, which `redocly.yaml` can turn off, and ends with its code. */
|
|
262
|
+
function lintWarningText(problem: NormalizedProblem): string {
|
|
263
|
+
return warningText(
|
|
264
|
+
`${problemMessage(problem)}, rule ${problem.ruleId}`,
|
|
265
|
+
WARNING_CODES.LINT_PROBLEM,
|
|
266
|
+
);
|
|
267
|
+
}
|
|
268
|
+
|
|
238
269
|
function problemMessage(problem: NormalizedProblem): string {
|
|
239
270
|
const location = problem.location?.[0]?.pointer;
|
|
240
271
|
return location ? `${problem.message} at ${location}` : problem.message;
|
|
@@ -10,6 +10,7 @@ import {
|
|
|
10
10
|
} from "@redocly/openapi-core";
|
|
11
11
|
import type { RefAccess } from "../../application/ports/schema-loader.js";
|
|
12
12
|
import { ERROR_CODES, type OpenAPITypesafeError } from "../../domain/errors.js";
|
|
13
|
+
import { redactUrlCredentials } from "../../domain/url-credentials.js";
|
|
13
14
|
import { aliasExpansionFailure } from "./alias-limit.js";
|
|
14
15
|
import { isHostAllowed } from "./allowed-hosts.js";
|
|
15
16
|
import { refForbiddenError } from "./schema-load-errors.js";
|
|
@@ -79,20 +80,45 @@ export async function refusalOf(
|
|
|
79
80
|
});
|
|
80
81
|
}
|
|
81
82
|
|
|
83
|
+
/**
|
|
84
|
+
* A remote document may refer only to other URLs (threat model T3). Redocly resolves a `$ref`
|
|
85
|
+
* against a URL base with `new URL()`, so `C:/x` becomes `c:/x` and `file:///x` stays as it is;
|
|
86
|
+
* Redocly then reads either from disk, and on Windows a drive letter is an absolute path.
|
|
87
|
+
*/
|
|
88
|
+
function localFromRemoteRefusal(
|
|
89
|
+
base: string,
|
|
90
|
+
absoluteRef: string,
|
|
91
|
+
): OpenAPITypesafeError | undefined {
|
|
92
|
+
if (!isRemoteRef(base) || isRemoteRef(absoluteRef)) {
|
|
93
|
+
return undefined;
|
|
94
|
+
}
|
|
95
|
+
const shownBase = redactUrlCredentials(base);
|
|
96
|
+
return refForbiddenError(absoluteRef, { reason: "local-ref-from-remote", base: shownBase });
|
|
97
|
+
}
|
|
98
|
+
|
|
99
|
+
/** The limits one resolver checks; each load gets its own resolver. */
|
|
100
|
+
export interface RefAccessLimits {
|
|
101
|
+
readonly access: RefAccess;
|
|
102
|
+
/** Remote documents one load may fetch, the root included (threat model T2). */
|
|
103
|
+
readonly maxRemoteDocuments: number;
|
|
104
|
+
}
|
|
105
|
+
|
|
82
106
|
/**
|
|
83
107
|
* A Redocly resolver that checks each document before it loads it. Redocly turns a failed load
|
|
84
108
|
* into an unresolved-`$ref` problem, so the refusals are also kept for the loader to report as
|
|
85
109
|
* the typed error.
|
|
86
110
|
*/
|
|
87
111
|
export class RefAccessResolver extends BaseResolver {
|
|
88
|
-
readonly #
|
|
112
|
+
readonly #limits: RefAccessLimits;
|
|
89
113
|
readonly #refusals: OpenAPITypesafeError[] = [];
|
|
90
114
|
/** The root document's ref: it is chosen by the developer, so it is not limited. */
|
|
91
115
|
#rootRef: string | undefined;
|
|
116
|
+
/** Remote documents asked for so far; Redocly caches each one, so each is counted once. */
|
|
117
|
+
#remoteDocumentCount = 0;
|
|
92
118
|
|
|
93
|
-
constructor(config: ResolveConfig,
|
|
119
|
+
constructor(config: ResolveConfig, limits: RefAccessLimits) {
|
|
94
120
|
super(config);
|
|
95
|
-
this.#
|
|
121
|
+
this.#limits = limits;
|
|
96
122
|
}
|
|
97
123
|
|
|
98
124
|
/** The first document that was refused, if any. */
|
|
@@ -108,6 +134,12 @@ export class RefAccessResolver extends BaseResolver {
|
|
|
108
134
|
if (isRoot) {
|
|
109
135
|
this.#rootRef = this.resolveExternalRef(base, ref);
|
|
110
136
|
}
|
|
137
|
+
const refusal =
|
|
138
|
+
base === null ? undefined : localFromRemoteRefusal(base, this.resolveExternalRef(base, ref));
|
|
139
|
+
if (refusal !== undefined) {
|
|
140
|
+
this.#refusals.push(refusal);
|
|
141
|
+
return Promise.reject(refusal);
|
|
142
|
+
}
|
|
111
143
|
return super.resolveDocument(base, ref, isRoot);
|
|
112
144
|
}
|
|
113
145
|
|
|
@@ -122,8 +154,7 @@ export class RefAccessResolver extends BaseResolver {
|
|
|
122
154
|
}
|
|
123
155
|
|
|
124
156
|
override async loadExternalRef(absoluteRef: string): Promise<Source> {
|
|
125
|
-
const refusal =
|
|
126
|
-
absoluteRef === this.#rootRef ? undefined : await refusalOf(absoluteRef, this.#access);
|
|
157
|
+
const refusal = this.#countRefusal(absoluteRef) ?? (await this.#accessRefusal(absoluteRef));
|
|
127
158
|
if (refusal !== undefined) {
|
|
128
159
|
this.#refusals.push(refusal);
|
|
129
160
|
throw refusal;
|
|
@@ -139,6 +170,30 @@ export class RefAccessResolver extends BaseResolver {
|
|
|
139
170
|
throw error;
|
|
140
171
|
}
|
|
141
172
|
}
|
|
173
|
+
|
|
174
|
+
#accessRefusal(absoluteRef: string): Promise<OpenAPITypesafeError | undefined> {
|
|
175
|
+
return absoluteRef === this.#rootRef
|
|
176
|
+
? Promise.resolve(undefined)
|
|
177
|
+
: refusalOf(absoluteRef, this.#limits.access);
|
|
178
|
+
}
|
|
179
|
+
|
|
180
|
+
/**
|
|
181
|
+
* A document that changes all its URLs can fan out without end: 150 `$ref`s per document, three
|
|
182
|
+
* levels deep, made 16,212 requests and exhausted the local ports (audit B2, F4).
|
|
183
|
+
*/
|
|
184
|
+
#countRefusal(absoluteRef: string): OpenAPITypesafeError | undefined {
|
|
185
|
+
if (!isRemoteRef(absoluteRef)) {
|
|
186
|
+
return undefined;
|
|
187
|
+
}
|
|
188
|
+
this.#remoteDocumentCount += 1;
|
|
189
|
+
const { maxRemoteDocuments } = this.#limits;
|
|
190
|
+
return this.#remoteDocumentCount > maxRemoteDocuments
|
|
191
|
+
? refForbiddenError(absoluteRef, {
|
|
192
|
+
reason: "too-many-remote-documents",
|
|
193
|
+
maxDocuments: maxRemoteDocuments,
|
|
194
|
+
})
|
|
195
|
+
: undefined;
|
|
196
|
+
}
|
|
142
197
|
}
|
|
143
198
|
|
|
144
199
|
function isRefusal(value: unknown): value is OpenAPITypesafeError {
|