openapi-typesafe 1.0.0-rc.2 → 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-deprecations/node-deprecations.cjs +14 -0
- package/dist/adapters/node-deprecations/node-deprecations.cjs.map +1 -0
- package/dist/adapters/node-deprecations/node-deprecations.mjs +12 -0
- package/dist/adapters/node-deprecations/node-deprecations.mjs.map +1 -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 +19 -2
- package/dist/api/default-ports.cjs.map +1 -1
- package/dist/api/default-ports.mjs +19 -3
- package/dist/api/default-ports.mjs.map +1 -1
- package/dist/api/discriminator-conflict-warnings.cjs +1 -1
- package/dist/api/discriminator-conflict-warnings.cjs.map +1 -1
- package/dist/api/discriminator-conflict-warnings.mjs +2 -2
- package/dist/api/discriminator-conflict-warnings.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 +8 -4
- package/dist/api/discriminator-patch.cjs.map +1 -1
- package/dist/api/discriminator-patch.mjs +9 -5
- package/dist/api/discriminator-patch.mjs.map +1 -1
- package/dist/api/discriminator-scan.cjs +17 -10
- package/dist/api/discriminator-scan.cjs.map +1 -1
- package/dist/api/discriminator-scan.mjs +18 -11
- package/dist/api/discriminator-scan.mjs.map +1 -1
- package/dist/api/document-run.cjs +4 -3
- package/dist/api/document-run.cjs.map +1 -1
- package/dist/api/document-run.mjs +4 -3
- package/dist/api/document-run.mjs.map +1 -1
- package/dist/api/legacy-callback-warning.cjs +7 -4
- package/dist/api/legacy-callback-warning.cjs.map +1 -1
- package/dist/api/legacy-callback-warning.mjs +8 -5
- package/dist/api/legacy-callback-warning.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 +9 -5
- package/dist/api/openapi-ts.cjs.map +1 -1
- package/dist/api/openapi-ts.mjs +10 -7
- 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/string-to-ast.cjs +7 -9
- package/dist/api/string-to-ast.cjs.map +1 -1
- package/dist/api/string-to-ast.mjs +8 -9
- package/dist/api/string-to-ast.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 +42 -12
- package/dist/api/transform-schema.cjs.map +1 -1
- package/dist/api/transform-schema.mjs +44 -14
- 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 +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-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 +7 -30
- package/dist/application/transform/document/parameters.cjs.map +1 -1
- package/dist/application/transform/document/parameters.mjs +8 -31
- 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 +6 -2
- package/dist/application/transform/document/paths.cjs.map +1 -1
- package/dist/application/transform/document/paths.mjs +8 -4
- 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-pointer/pointer-type.cjs +1 -1
- package/dist/application/transform/ref-pointer/pointer-type.cjs.map +1 -1
- package/dist/application/transform/ref-pointer/pointer-type.mjs +2 -2
- package/dist/application/transform/ref-pointer/pointer-type.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/access-flags.cjs +1 -1
- package/dist/application/transform/schema/access-flags.cjs.map +1 -1
- package/dist/application/transform/schema/access-flags.mjs +2 -2
- package/dist/application/transform/schema/access-flags.mjs.map +1 -1
- package/dist/application/transform/schema/array-type.cjs +2 -2
- package/dist/application/transform/schema/array-type.cjs.map +1 -1
- package/dist/application/transform/schema/array-type.mjs +3 -3
- package/dist/application/transform/schema/array-type.mjs.map +1 -1
- package/dist/application/transform/schema/composition-type.cjs +4 -4
- package/dist/application/transform/schema/composition-type.cjs.map +1 -1
- package/dist/application/transform/schema/composition-type.mjs +6 -6
- package/dist/application/transform/schema/composition-type.mjs.map +1 -1
- package/dist/application/transform/schema/enum-rule.cjs +4 -6
- package/dist/application/transform/schema/enum-rule.cjs.map +1 -1
- package/dist/application/transform/schema/enum-rule.mjs +6 -8
- 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/presence-members.cjs +1 -1
- package/dist/application/transform/schema/presence-members.cjs.map +1 -1
- package/dist/application/transform/schema/presence-members.mjs +2 -2
- package/dist/application/transform/schema/presence-members.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/required-variants.cjs +2 -2
- package/dist/application/transform/schema/required-variants.cjs.map +1 -1
- package/dist/application/transform/schema/required-variants.mjs +3 -3
- package/dist/application/transform/schema/required-variants.mjs.map +1 -1
- 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/unevaluated-properties.cjs +1 -1
- package/dist/application/transform/schema/unevaluated-properties.cjs.map +1 -1
- package/dist/application/transform/schema/unevaluated-properties.mjs +2 -2
- package/dist/application/transform/schema/unevaluated-properties.mjs.map +1 -1
- package/dist/application/transform/schema-comment.cjs +6 -2
- package/dist/application/transform/schema-comment.cjs.map +1 -1
- package/dist/application/transform/schema-comment.mjs +7 -3
- 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/deprecations.cjs +11 -0
- package/dist/domain/deprecations.cjs.map +1 -0
- package/dist/domain/deprecations.mjs +9 -0
- package/dist/domain/deprecations.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 +25 -14
- package/dist/domain/output-fixes.cjs.map +1 -1
- package/dist/domain/output-fixes.mjs +25 -13
- 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/domain/warnings.cjs +0 -1
- package/dist/domain/warnings.cjs.map +1 -1
- package/dist/domain/warnings.mjs +0 -1
- package/dist/domain/warnings.mjs.map +1 -1
- package/dist/index.cjs +2 -3
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +57 -20
- package/dist/index.d.mts +57 -20
- package/dist/index.d.ts +57 -20
- package/dist/index.mjs +3 -2
- package/dist/index.mjs.map +1 -1
- package/package.json +5 -6
- package/src/adapters/node-deprecations/node-deprecations.ts +14 -0
- 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 +40 -4
- package/src/api/discriminator-conflict-warnings.ts +2 -2
- package/src/api/discriminator-enum-parent.ts +3 -3
- package/src/api/discriminator-other-owners.ts +5 -3
- package/src/api/discriminator-patch.ts +9 -6
- package/src/api/discriminator-scan.ts +19 -11
- package/src/api/document-run.ts +9 -3
- package/src/api/legacy-callback-warning.ts +13 -6
- package/src/api/legacy-utils.ts +5 -1
- package/src/api/openapi-ts.ts +26 -7
- package/src/api/run-context.ts +6 -0
- package/src/api/schema-callbacks.ts +60 -17
- package/src/api/string-to-ast.ts +11 -15
- package/src/api/transform-context.ts +7 -3
- package/src/api/transform-schema.ts +67 -15
- package/src/application/ports/deprecation-reporter.ts +9 -0
- 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 +4 -4
- 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 +13 -58
- 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 +8 -4
- 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-pointer/pointer-type.ts +2 -4
- package/src/application/transform/ref-type.ts +2 -1
- package/src/application/transform/schema/access-flags.ts +2 -2
- package/src/application/transform/schema/array-type.ts +3 -5
- package/src/application/transform/schema/composition-type.ts +6 -6
- package/src/application/transform/schema/enum-rule.ts +10 -8
- package/src/application/transform/schema/object-type.ts +4 -4
- package/src/application/transform/schema/presence-members.ts +2 -2
- package/src/application/transform/schema/ref-siblings.ts +76 -0
- package/src/application/transform/schema/required-variants.ts +3 -3
- 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/unevaluated-properties.ts +2 -2
- package/src/application/transform/schema-comment.ts +7 -3
- 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/deprecations.ts +15 -0
- package/src/domain/errors.ts +22 -7
- 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 +37 -18
- package/src/domain/url-secrets.ts +72 -0
- package/src/domain/warnings.ts +0 -1
- package/src/index.ts +2 -6
- 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
|
@@ -7,7 +7,7 @@ import {
|
|
|
7
7
|
} from "../../../domain/ir/constructors.js";
|
|
8
8
|
import type { IrTupleElement, IrType } from "../../../domain/ir/nodes.js";
|
|
9
9
|
import type { Schema, SchemaObject } from "../../../domain/openapi/schema-object.js";
|
|
10
|
-
import {
|
|
10
|
+
import { FIX } from "../../../domain/output-fixes.js";
|
|
11
11
|
import { UNKNOWN_TYPE } from "../shared-types.js";
|
|
12
12
|
import { unionOf } from "../type-combinators.js";
|
|
13
13
|
import type { SchemaRequest } from "./schema-rule.js";
|
|
@@ -79,9 +79,7 @@ function prefixItemsTupleType(
|
|
|
79
79
|
}
|
|
80
80
|
|
|
81
81
|
function isPrefixItemsFixed(schema: SchemaObject, request: SchemaRequest): boolean {
|
|
82
|
-
return (
|
|
83
|
-
schema.prefixItems !== undefined && request.context.options.fixes.has(OutputFix.PREFIX_ITEMS)
|
|
84
|
-
);
|
|
82
|
+
return schema.prefixItems !== undefined && request.context.options.fixes.has(FIX.PREFIX_ITEMS);
|
|
85
83
|
}
|
|
86
84
|
|
|
87
85
|
/** The type of one item; `unknown` without `items`. */
|
|
@@ -193,7 +191,7 @@ function fixedArrayType(schema: SchemaObject, request: SchemaRequest): IrType {
|
|
|
193
191
|
|
|
194
192
|
function isArrayLengthFixed(request: SchemaRequest): boolean {
|
|
195
193
|
const { arrayLength, fixes } = request.context.options;
|
|
196
|
-
return arrayLength && fixes.has(
|
|
194
|
+
return arrayLength && fixes.has(FIX.ARRAY_LENGTH_TUPLES);
|
|
197
195
|
}
|
|
198
196
|
|
|
199
197
|
/** `type: array`, including tuples (`prefixItems`, array `items`) and `--array-length`. */
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import { irKeyword, irRecord } from "../../../domain/ir/constructors.js";
|
|
2
2
|
import type { IrType } from "../../../domain/ir/nodes.js";
|
|
3
|
-
import {
|
|
3
|
+
import { appendPointer } from "../../../domain/openapi/json-pointer.js";
|
|
4
4
|
import type { Schema, SchemaObject } from "../../../domain/openapi/schema-object.js";
|
|
5
|
-
import {
|
|
5
|
+
import { FIX } from "../../../domain/output-fixes.js";
|
|
6
6
|
import { requirableRefType } from "../ref-pointer/pointer-type.js";
|
|
7
7
|
import { UNKNOWN_TYPE } from "../shared-types.js";
|
|
8
8
|
import {
|
|
@@ -29,7 +29,7 @@ function variantTypes(
|
|
|
29
29
|
return variants.map((variant, index) =>
|
|
30
30
|
request.transformNested(variant, {
|
|
31
31
|
...request.location,
|
|
32
|
-
path:
|
|
32
|
+
path: appendPointer(request.location.path, [keyword, index]),
|
|
33
33
|
}),
|
|
34
34
|
);
|
|
35
35
|
}
|
|
@@ -58,7 +58,7 @@ function keysToRequire(
|
|
|
58
58
|
if (!request.context.discriminators.isHandled(ref)) {
|
|
59
59
|
return defined;
|
|
60
60
|
}
|
|
61
|
-
if (!request.context.options.fixes.has(
|
|
61
|
+
if (!request.context.options.fixes.has(FIX.DISCRIMINATOR_MEMBER_REQUIRED)) {
|
|
62
62
|
return [];
|
|
63
63
|
}
|
|
64
64
|
return defined.filter((key) => !target.required?.includes(key));
|
|
@@ -131,7 +131,7 @@ function allOfItemType(
|
|
|
131
131
|
const isUnion =
|
|
132
132
|
unionItem !== undefined &&
|
|
133
133
|
!unionItem.isMapped &&
|
|
134
|
-
request.context.options.fixes.has(
|
|
134
|
+
request.context.options.fixes.has(FIX.ALLOF_DISCRIMINATED_UNION);
|
|
135
135
|
if (!propertyName || isUnion) {
|
|
136
136
|
return type;
|
|
137
137
|
}
|
|
@@ -173,7 +173,7 @@ function anyOfType(
|
|
|
173
173
|
if (variants.length === 0 || previous === null) {
|
|
174
174
|
return variants.length === 0 ? previous : unionOf(variants);
|
|
175
175
|
}
|
|
176
|
-
if (!request.context.options.fixes.has(
|
|
176
|
+
if (!request.context.options.fixes.has(FIX.ANYOF_PROPERTIES)) {
|
|
177
177
|
return unionOf([previous, ...variants]);
|
|
178
178
|
}
|
|
179
179
|
return Array.isArray(schema.type) ? previous : intersectionOf([previous, unionOf(variants)]);
|
|
@@ -6,9 +6,13 @@ import {
|
|
|
6
6
|
irString,
|
|
7
7
|
} from "../../../domain/ir/constructors.js";
|
|
8
8
|
import type { IrType } from "../../../domain/ir/nodes.js";
|
|
9
|
-
import {
|
|
9
|
+
import {
|
|
10
|
+
appendPointer,
|
|
11
|
+
parseRefPointer,
|
|
12
|
+
ROOT_POINTER,
|
|
13
|
+
} from "../../../domain/openapi/json-pointer.js";
|
|
10
14
|
import type { SchemaObject } from "../../../domain/openapi/schema-object.js";
|
|
11
|
-
import {
|
|
15
|
+
import { FIX } from "../../../domain/output-fixes.js";
|
|
12
16
|
import { literalType } from "../literal-type.js";
|
|
13
17
|
import { refType } from "../ref-type.js";
|
|
14
18
|
import { intersectionOf, unionOf } from "../type-combinators.js";
|
|
@@ -55,7 +59,7 @@ function hasEnumMetadata(schema: SchemaObject): boolean {
|
|
|
55
59
|
*/
|
|
56
60
|
function tsEnumEntries(schema: SchemaObject, options: SchemaOptions): [unknown, number][] {
|
|
57
61
|
const entries = (schema.enum ?? []).map((value, index): [unknown, number] => [value, index]);
|
|
58
|
-
return options.fixes.has(
|
|
62
|
+
return options.fixes.has(FIX.NULLABLE_ENUMS)
|
|
59
63
|
? entries.filter(([value]) => value !== null)
|
|
60
64
|
: entries;
|
|
61
65
|
}
|
|
@@ -147,9 +151,7 @@ export function ownerEnumMembersType(
|
|
|
147
151
|
request: SchemaRequest,
|
|
148
152
|
): IrType | null {
|
|
149
153
|
const { options, discriminators, footer } = request.context;
|
|
150
|
-
const parent: DiscriminatorEnumParent | undefined = options.fixes.has(
|
|
151
|
-
OutputFix.DISCRIMINATOR_VALUES,
|
|
152
|
-
)
|
|
154
|
+
const parent: DiscriminatorEnumParent | undefined = options.fixes.has(FIX.DISCRIMINATOR_VALUES)
|
|
153
155
|
? discriminators.enumParentOf(key)
|
|
154
156
|
: undefined;
|
|
155
157
|
if (parent === undefined || !isTsEnum(parent.schema, options)) {
|
|
@@ -175,7 +177,7 @@ function tsEnumType(schema: SchemaObject, request: SchemaRequest): IrType {
|
|
|
175
177
|
irReference(footer.addEnum(enumRequest(schema, request.location.path, options))),
|
|
176
178
|
schema,
|
|
177
179
|
);
|
|
178
|
-
return options.fixes.has(
|
|
180
|
+
return options.fixes.has(FIX.NULLABLE_ENUMS) && isNullAllowed(schema)
|
|
179
181
|
? unionOf([type, irKeyword("null")])
|
|
180
182
|
: type;
|
|
181
183
|
}
|
|
@@ -230,7 +232,7 @@ function enumValuesPointer(path: string | undefined): { ref: string; extract: st
|
|
|
230
232
|
: pointer
|
|
231
233
|
.slice(firstVariantStart)
|
|
232
234
|
.filter((segment) => !UNION_KEYWORDS.has(segment) && !INDEX_RE.test(segment));
|
|
233
|
-
return { ref:
|
|
235
|
+
return { ref: appendPointer(ROOT_POINTER, kept), extract };
|
|
234
236
|
}
|
|
235
237
|
|
|
236
238
|
function addEnumValues(schema: SchemaObject, request: SchemaRequest): void {
|
|
@@ -7,7 +7,7 @@ import {
|
|
|
7
7
|
} from "../../../domain/ir/constructors.js";
|
|
8
8
|
import type { IrMember, IrPropertySignature, IrType } from "../../../domain/ir/nodes.js";
|
|
9
9
|
import { toPropertyName } from "../../../domain/ir/property-name.js";
|
|
10
|
-
import {
|
|
10
|
+
import { appendPointer } from "../../../domain/openapi/json-pointer.js";
|
|
11
11
|
import type { Schema, SchemaObject } from "../../../domain/openapi/schema-object.js";
|
|
12
12
|
import { documentEntries } from "../document-entries.js";
|
|
13
13
|
import { schemaRefType } from "../ref-pointer/pointer-type.js";
|
|
@@ -117,7 +117,7 @@ function propertyType(
|
|
|
117
117
|
facts: PropertyFacts,
|
|
118
118
|
request: SchemaRequest,
|
|
119
119
|
): CustomResult {
|
|
120
|
-
const path =
|
|
120
|
+
const path = appendPointer(request.location.path, [key]);
|
|
121
121
|
const type = facts.ref
|
|
122
122
|
? schemaRefType(facts.ref, request)
|
|
123
123
|
: request.transformNested(value, { ...request.location, path });
|
|
@@ -151,7 +151,7 @@ function propertyMember(
|
|
|
151
151
|
isReadonly: options.immutable || (!options.readWriteMarkers && facts.flags.isReadOnly),
|
|
152
152
|
},
|
|
153
153
|
);
|
|
154
|
-
return finishProperty(property, value,
|
|
154
|
+
return finishProperty(property, value, appendPointer(request.location.path, [key]), request);
|
|
155
155
|
}
|
|
156
156
|
|
|
157
157
|
function propertyMembers(schema: SchemaObject, request: SchemaRequest): IrMember[] {
|
|
@@ -176,7 +176,7 @@ function defsMember(
|
|
|
176
176
|
): IrMember {
|
|
177
177
|
const { options } = request.context;
|
|
178
178
|
const members = Object.entries(defs).map(([key, value]) => {
|
|
179
|
-
const path =
|
|
179
|
+
const path = appendPointer(request.location.path, ["$defs", key]);
|
|
180
180
|
const flags = propertyAccessFlags(value, request.context);
|
|
181
181
|
const type = withReadWriteMarker(
|
|
182
182
|
request.transformNested(value, { ...request.location, path }),
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import type { Schema, SchemaObject } from "../../../domain/openapi/schema-object.js";
|
|
2
|
-
import {
|
|
2
|
+
import { FIX } from "../../../domain/output-fixes.js";
|
|
3
3
|
import type { SchemaRequest } from "./schema-rule.js";
|
|
4
4
|
|
|
5
5
|
/**
|
|
@@ -81,7 +81,7 @@ export interface AllOfMembers {
|
|
|
81
81
|
*/
|
|
82
82
|
export function allOfMembers(members: readonly Schema[], request: SchemaRequest): AllOfMembers {
|
|
83
83
|
const unchanged = { members, required: [] };
|
|
84
|
-
if (!request.context.options.fixes.has(
|
|
84
|
+
if (!request.context.options.fixes.has(FIX.ALLOF_REQUIRED)) {
|
|
85
85
|
return unchanged;
|
|
86
86
|
}
|
|
87
87
|
const schemas = members.map((member) => memberSchema(member, request));
|
|
@@ -0,0 +1,76 @@
|
|
|
1
|
+
import { SCHEMA_DIALECTS } from "../../../domain/openapi/schema-dialect.js";
|
|
2
|
+
import type {
|
|
3
|
+
ReferenceSchema,
|
|
4
|
+
Schema,
|
|
5
|
+
SchemaObject,
|
|
6
|
+
} from "../../../domain/openapi/schema-object.js";
|
|
7
|
+
import { FIX } from "../../../domain/output-fixes.js";
|
|
8
|
+
import type { SchemaOptions } from "./schema-context.js";
|
|
9
|
+
|
|
10
|
+
/**
|
|
11
|
+
* The `ref-siblings` fix (ADR-021 amendment 2, RC4 G16): in JSON Schema 2020-12 (OpenAPI 3.1 and
|
|
12
|
+
* 3.2) the keywords next to a `$ref` apply too, so `{ $ref: Base, required: [extra], properties:
|
|
13
|
+
* { extra } }` is a `Base` that also has a required `extra`. That is what `allOf: [{ $ref: Base }]`
|
|
14
|
+
* next to the same keywords means, so the schema is typed as that `allOf`, with every rule the
|
|
15
|
+
* generator has for `allOf` and its siblings (`WithRequired`, intersections).
|
|
16
|
+
*/
|
|
17
|
+
|
|
18
|
+
/**
|
|
19
|
+
* Keywords that only annotate (JSON Schema 2020-12 meta-data, format-annotation and content
|
|
20
|
+
* vocabularies, OpenAPI fixed fields), or that change no type on their own (`discriminator`
|
|
21
|
+
* without `oneOf`). Next to a `$ref` they stay where they were, so the output keeps the plain
|
|
22
|
+
* reference with its comment. Extension keywords (`x-…`) count as annotations too.
|
|
23
|
+
*/
|
|
24
|
+
const ANNOTATION_KEYWORDS: ReadonlySet<string> = new Set([
|
|
25
|
+
"$anchor",
|
|
26
|
+
"$comment",
|
|
27
|
+
"$defs",
|
|
28
|
+
"$dynamicAnchor",
|
|
29
|
+
"$id",
|
|
30
|
+
"$ref",
|
|
31
|
+
"$schema",
|
|
32
|
+
"contentEncoding",
|
|
33
|
+
"contentMediaType",
|
|
34
|
+
"default",
|
|
35
|
+
"deprecated",
|
|
36
|
+
"description",
|
|
37
|
+
"discriminator",
|
|
38
|
+
"example",
|
|
39
|
+
"examples",
|
|
40
|
+
"externalDocs",
|
|
41
|
+
"format",
|
|
42
|
+
"readOnly",
|
|
43
|
+
"title",
|
|
44
|
+
"writeOnly",
|
|
45
|
+
"xml",
|
|
46
|
+
]);
|
|
47
|
+
|
|
48
|
+
const EXTENSION_PREFIX = "x-";
|
|
49
|
+
|
|
50
|
+
function hasRef(schema: SchemaObject): schema is SchemaObject & ReferenceSchema {
|
|
51
|
+
return typeof (schema as Partial<ReferenceSchema>).$ref === "string";
|
|
52
|
+
}
|
|
53
|
+
|
|
54
|
+
function isTypeKeyword(keyword: string): boolean {
|
|
55
|
+
return !ANNOTATION_KEYWORDS.has(keyword) && !keyword.startsWith(EXTENSION_PREFIX);
|
|
56
|
+
}
|
|
57
|
+
|
|
58
|
+
/**
|
|
59
|
+
* A `$ref` schema as the `allOf` it means, or null where nothing changes: a schema without `$ref`,
|
|
60
|
+
* no fix, an OpenAPI 3.0 document, or no sibling that changes the type. The result has no
|
|
61
|
+
* `$ref`, so the shape rules type it as `enum`, `const` or a composition.
|
|
62
|
+
*/
|
|
63
|
+
export function refWithSiblingsAsAllOf(
|
|
64
|
+
schema: SchemaObject,
|
|
65
|
+
options: SchemaOptions,
|
|
66
|
+
): SchemaObject | null {
|
|
67
|
+
const isApplied =
|
|
68
|
+
options.fixes.has(FIX.REF_SIBLINGS) &&
|
|
69
|
+
options.schemaDialect === SCHEMA_DIALECTS.JSON_SCHEMA_2020_12;
|
|
70
|
+
if (!isApplied || !hasRef(schema) || !Object.keys(schema).some(isTypeKeyword)) {
|
|
71
|
+
return null;
|
|
72
|
+
}
|
|
73
|
+
const { $ref, allOf = [], ...siblings } = schema;
|
|
74
|
+
const members: readonly Schema[] = [{ $ref }, ...allOf];
|
|
75
|
+
return { ...siblings, allOf: members };
|
|
76
|
+
}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import type { IrType } from "../../../domain/ir/nodes.js";
|
|
2
2
|
import type { Schema, SchemaObject } from "../../../domain/openapi/schema-object.js";
|
|
3
|
-
import {
|
|
3
|
+
import { FIX } from "../../../domain/output-fixes.js";
|
|
4
4
|
import { unionOf, withRequiredKeys } from "../type-combinators.js";
|
|
5
5
|
import { isKeptProperty } from "./object-type.js";
|
|
6
6
|
import type { SchemaRequest } from "./schema-rule.js";
|
|
@@ -55,7 +55,7 @@ export function hasRequiredVariants(
|
|
|
55
55
|
request: SchemaRequest,
|
|
56
56
|
): boolean {
|
|
57
57
|
return (
|
|
58
|
-
request.context.options.fixes.has(
|
|
58
|
+
request.context.options.fixes.has(FIX.ANYOF_ONEOF_REQUIRED) &&
|
|
59
59
|
isObjectTyped(schema) &&
|
|
60
60
|
requiredKeyLists(schema, variants, request) !== null
|
|
61
61
|
);
|
|
@@ -73,7 +73,7 @@ export function requiredVariantsType(
|
|
|
73
73
|
variants: readonly Schema[],
|
|
74
74
|
request: SchemaRequest,
|
|
75
75
|
): IrType | null {
|
|
76
|
-
if (!request.context.options.fixes.has(
|
|
76
|
+
if (!request.context.options.fixes.has(FIX.ANYOF_ONEOF_REQUIRED) || previous === null) {
|
|
77
77
|
return null;
|
|
78
78
|
}
|
|
79
79
|
const keyLists = isObjectTyped(schema) ? requiredKeyLists(schema, variants, request) : null;
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import type { IrPropertySignature, IrType } from "../../../domain/ir/nodes.js";
|
|
2
|
+
import type { SchemaDialect } from "../../../domain/openapi/schema-dialect.js";
|
|
2
3
|
import type { SchemaObject } from "../../../domain/openapi/schema-object.js";
|
|
3
4
|
import type { OutputFix } from "../../../domain/output-fixes.js";
|
|
4
5
|
|
|
@@ -27,6 +28,8 @@ export interface SchemaOptions {
|
|
|
27
28
|
readonly immutable: boolean;
|
|
28
29
|
readonly propertiesRequiredByDefault: boolean;
|
|
29
30
|
readonly readWriteMarkers: boolean;
|
|
31
|
+
/** Whether keywords next to a `$ref` apply (OpenAPI 3.1 and 3.2) or not (3.0). */
|
|
32
|
+
readonly schemaDialect: SchemaDialect;
|
|
30
33
|
}
|
|
31
34
|
|
|
32
35
|
/**
|
|
@@ -7,6 +7,7 @@ import { schemaRefType } from "../ref-pointer/pointer-type.js";
|
|
|
7
7
|
import { UNKNOWN_TYPE } from "../shared-types.js";
|
|
8
8
|
import { compositionType } from "./composition-type.js";
|
|
9
9
|
import { enumRule } from "./enum-rule.js";
|
|
10
|
+
import { refWithSiblingsAsAllOf } from "./ref-siblings.js";
|
|
10
11
|
import type { SchemaContext, SchemaLocation } from "./schema-context.js";
|
|
11
12
|
import type { SchemaRequest, SchemaRule } from "./schema-rule.js";
|
|
12
13
|
|
|
@@ -83,8 +84,9 @@ export function transformSchemaShape(
|
|
|
83
84
|
return checked.type;
|
|
84
85
|
}
|
|
85
86
|
const current = request(location, context, isFromAdditionalProperties);
|
|
86
|
-
const
|
|
87
|
-
|
|
87
|
+
const shaped = refWithSiblingsAsAllOf(checked.schema, context.options) ?? checked.schema;
|
|
88
|
+
const rule = SHAPE_RULES.find((candidate) => candidate.matches(shaped));
|
|
89
|
+
return rule ? rule.transform(shaped, current) : compositionType(shaped, current);
|
|
88
90
|
}
|
|
89
91
|
|
|
90
92
|
/** Transform a schema to IR, then apply `postTransform` (the original `transformSchemaObject`). */
|
|
@@ -6,7 +6,7 @@ import {
|
|
|
6
6
|
} from "../../../domain/ir/constructors.js";
|
|
7
7
|
import type { IrMember, IrType } from "../../../domain/ir/nodes.js";
|
|
8
8
|
import type { Schema, SchemaObject } from "../../../domain/openapi/schema-object.js";
|
|
9
|
-
import {
|
|
9
|
+
import { FIX } from "../../../domain/output-fixes.js";
|
|
10
10
|
import { HELPER_TYPES } from "../helper-types.js";
|
|
11
11
|
import { UNKNOWN_TYPE } from "../shared-types.js";
|
|
12
12
|
import { unionOf } from "../type-combinators.js";
|
|
@@ -32,7 +32,7 @@ import type { SchemaRequest } from "./schema-rule.js";
|
|
|
32
32
|
function unevaluatedSchemaOf(schema: SchemaObject, request: SchemaRequest): Schema | null {
|
|
33
33
|
const { unevaluatedProperties } = schema;
|
|
34
34
|
if (
|
|
35
|
-
!request.context.options.fixes.has(
|
|
35
|
+
!request.context.options.fixes.has(FIX.UNEVALUATED_PROPERTIES) ||
|
|
36
36
|
unevaluatedProperties === undefined ||
|
|
37
37
|
unevaluatedProperties === false ||
|
|
38
38
|
schema.additionalProperties !== undefined
|
|
@@ -1,5 +1,6 @@
|
|
|
1
|
+
import { appendAll } from "../../domain/append-all.js";
|
|
1
2
|
import type { IrComment, IrPropertySignature } from "../../domain/ir/nodes.js";
|
|
2
|
-
import { OutputFix } from "../../domain/output-fixes.js";
|
|
3
|
+
import { FIX, type OutputFix } from "../../domain/output-fixes.js";
|
|
3
4
|
|
|
4
5
|
/** Schema fields that produce JSDoc lines (the original `AnnotatedSchemaObject`). */
|
|
5
6
|
export interface AnnotatedSchema {
|
|
@@ -44,7 +45,7 @@ export const ORIGINAL_SCHEMA_COMMENT: SchemaCommentOptions = { hasMemberDescript
|
|
|
44
45
|
|
|
45
46
|
/** How the fixes turned on write a schema's JSDoc. */
|
|
46
47
|
export function schemaCommentOptionsOf(fixes: ReadonlySet<OutputFix>): SchemaCommentOptions {
|
|
47
|
-
return { hasMemberDescriptions: fixes.has(
|
|
48
|
+
return { hasMemberDescriptions: fixes.has(FIX.ANYOF_ONEOF_DESCRIPTIONS) };
|
|
48
49
|
}
|
|
49
50
|
|
|
50
51
|
function formatValue(value: unknown): string {
|
|
@@ -80,7 +81,10 @@ function valueTagLines(schema: AnnotatedSchema): string[] {
|
|
|
80
81
|
lines.push(`@${tag} ${formatValue(value)}`);
|
|
81
82
|
}
|
|
82
83
|
if (Array.isArray(schema.examples)) {
|
|
83
|
-
|
|
84
|
+
appendAll(
|
|
85
|
+
lines,
|
|
86
|
+
schema.examples.map((example: unknown) => `@example ${formatValue(example)}`),
|
|
87
|
+
);
|
|
84
88
|
}
|
|
85
89
|
return lines;
|
|
86
90
|
}
|
|
@@ -33,6 +33,11 @@ export interface DocumentFooter extends FooterDeclarations {
|
|
|
33
33
|
* it comes before any declaration the operation adds, as in the original.
|
|
34
34
|
*/
|
|
35
35
|
addOperation(build: () => IrPropertySignature): void;
|
|
36
|
+
/**
|
|
37
|
+
* The key in `operations` of the next operation with this (normalized) `operationId`: the ID,
|
|
38
|
+
* or for a repeated ID a numbered one (`OperationKeys`).
|
|
39
|
+
*/
|
|
40
|
+
operationKey(operationId: string): string;
|
|
36
41
|
}
|
|
37
42
|
|
|
38
43
|
/** Debug output for slow parts of a run (`DEBUG=openapi-ts:*`). */
|
package/src/cli/api-settings.ts
CHANGED
|
@@ -1,8 +1,11 @@
|
|
|
1
1
|
import { kebabCase } from "scule";
|
|
2
|
+
import { isOpenAPITypesafeError, OpenAPITypesafeError } from "../domain/errors.js";
|
|
3
|
+
import type { OutputFixName } from "../domain/output-fixes.js";
|
|
2
4
|
import { WARNING_CODES, warningText } from "../domain/warnings.js";
|
|
3
|
-
import { GENERATOR_FLAGS, hostList } from "./cli-arguments.js";
|
|
5
|
+
import { GENERATOR_FLAGS, type GeneratorFlags, hostList } from "./cli-arguments.js";
|
|
4
6
|
import { cliError } from "./cli-errors.js";
|
|
5
7
|
import { resolveLocationUrl } from "./cli-output.js";
|
|
8
|
+
import { fixNamesOf } from "./fix-option.js";
|
|
6
9
|
import type { RefLimitOptions } from "./ref-limits.js";
|
|
7
10
|
|
|
8
11
|
/**
|
|
@@ -51,22 +54,94 @@ export function unknownSettingWarnings(apiName: string, settings: ApiSettings):
|
|
|
51
54
|
);
|
|
52
55
|
}
|
|
53
56
|
|
|
57
|
+
/** The key a setting is written with: camelCase, else kebab-case; undefined when it is absent. */
|
|
58
|
+
function settingKey(settings: ApiSettings, name: string): string | undefined {
|
|
59
|
+
if (name in settings) {
|
|
60
|
+
return name;
|
|
61
|
+
}
|
|
62
|
+
const kebabName = kebabCase(name);
|
|
63
|
+
return kebabName in settings ? kebabName : undefined;
|
|
64
|
+
}
|
|
65
|
+
|
|
54
66
|
/** The value of a setting in camelCase, else in kebab-case; `undefined` when it is absent. */
|
|
55
67
|
function settingValue(settings: ApiSettings, name: string): unknown {
|
|
56
|
-
|
|
68
|
+
const key = settingKey(settings, name);
|
|
69
|
+
return key === undefined ? undefined : settings[key];
|
|
57
70
|
}
|
|
58
71
|
|
|
59
72
|
function hasSetting(settings: ApiSettings, name: string): boolean {
|
|
60
|
-
return
|
|
73
|
+
return settingKey(settings, name) !== undefined;
|
|
61
74
|
}
|
|
62
75
|
|
|
63
|
-
|
|
76
|
+
/** `CLI_CONFIG_INVALID` for the setting `name` of an API, named as the user wrote it. */
|
|
77
|
+
function invalidSetting(apiName: string, settings: ApiSettings, name: string, expected: string) {
|
|
78
|
+
const key = settingKey(settings, name) ?? kebabCase(name);
|
|
64
79
|
return cliError(
|
|
65
80
|
"CLI_CONFIG_INVALID",
|
|
66
|
-
`API ${apiName}: \`${
|
|
81
|
+
`API ${apiName}: \`${key}\` in x-openapi-ts must be ${expected}`,
|
|
67
82
|
);
|
|
68
83
|
}
|
|
69
84
|
|
|
85
|
+
/**
|
|
86
|
+
* The boolean flags an API sets, in camelCase or kebab-case; they win over the CLI's flags. A
|
|
87
|
+
* value of another type (`root-types: "true"`) fails with `CLI_CONFIG_INVALID`: ignoring it
|
|
88
|
+
* would generate other types than the config asks for, without a word.
|
|
89
|
+
*/
|
|
90
|
+
export function apiFlags(apiName: string, settings: ApiSettings): GeneratorFlags {
|
|
91
|
+
const flags: Partial<Record<(typeof GENERATOR_FLAGS)[number], boolean>> = {};
|
|
92
|
+
for (const name of GENERATOR_FLAGS) {
|
|
93
|
+
const value = settingValue(settings, name);
|
|
94
|
+
if (typeof value === "boolean") {
|
|
95
|
+
flags[name] = value;
|
|
96
|
+
} else if (hasSetting(settings, name)) {
|
|
97
|
+
throw invalidSetting(apiName, settings, name, "true or false");
|
|
98
|
+
}
|
|
99
|
+
}
|
|
100
|
+
return flags;
|
|
101
|
+
}
|
|
102
|
+
|
|
103
|
+
/** The API's `output` file as written; fails with `CLI_CONFIG_INVALID` when it is not text. */
|
|
104
|
+
export function apiOutputOf(apiName: string, settings: ApiSettings): string {
|
|
105
|
+
const output = settings[OUTPUT_SETTING];
|
|
106
|
+
if (typeof output !== "string") {
|
|
107
|
+
throw invalidSetting(apiName, settings, OUTPUT_SETTING, "a file path");
|
|
108
|
+
}
|
|
109
|
+
return output;
|
|
110
|
+
}
|
|
111
|
+
|
|
112
|
+
/**
|
|
113
|
+
* The API's `fix` names, which replace the CLI's `--fix` (ADR-021). An entry that is not text
|
|
114
|
+
* fails with `CLI_CONFIG_INVALID`; an unknown name with `OPTION_FIX_UNKNOWN`, naming the API.
|
|
115
|
+
*/
|
|
116
|
+
export function apiFixNames(
|
|
117
|
+
apiName: string,
|
|
118
|
+
settings: ApiSettings,
|
|
119
|
+
): readonly OutputFixName[] | undefined {
|
|
120
|
+
if (!hasSetting(settings, FIX_SETTING)) {
|
|
121
|
+
return undefined;
|
|
122
|
+
}
|
|
123
|
+
const entries = [settingValue(settings, FIX_SETTING)].flat();
|
|
124
|
+
if (entries.some((entry) => typeof entry !== "string")) {
|
|
125
|
+
throw invalidSetting(apiName, settings, FIX_SETTING, "a list of fix names or a comma list");
|
|
126
|
+
}
|
|
127
|
+
try {
|
|
128
|
+
return fixNamesOf(entries);
|
|
129
|
+
} catch (error) {
|
|
130
|
+
throw isOpenAPITypesafeError(error) ? withApiName(apiName, error) : error;
|
|
131
|
+
}
|
|
132
|
+
}
|
|
133
|
+
|
|
134
|
+
/** The same error, with the API named first in its message. */
|
|
135
|
+
function withApiName(apiName: string, error: OpenAPITypesafeError): OpenAPITypesafeError {
|
|
136
|
+
const { code, details, cause } = error;
|
|
137
|
+
return new OpenAPITypesafeError({
|
|
138
|
+
code,
|
|
139
|
+
message: `API ${apiName}: ${error.message}`,
|
|
140
|
+
details,
|
|
141
|
+
cause,
|
|
142
|
+
});
|
|
143
|
+
}
|
|
144
|
+
|
|
70
145
|
/** `local-ref-root: dir`, relative to the config file; empty means the config file's directory. */
|
|
71
146
|
function localRefRootOf(apiName: string, settings: ApiSettings, configRoot: URL): RefLimitOptions {
|
|
72
147
|
if (!hasSetting(settings, LOCAL_REF_ROOT_SETTING)) {
|
|
@@ -74,7 +149,7 @@ function localRefRootOf(apiName: string, settings: ApiSettings, configRoot: URL)
|
|
|
74
149
|
}
|
|
75
150
|
const value = settingValue(settings, LOCAL_REF_ROOT_SETTING) ?? "";
|
|
76
151
|
if (typeof value !== "string") {
|
|
77
|
-
throw invalidSetting(apiName, LOCAL_REF_ROOT_SETTING, "a directory path");
|
|
152
|
+
throw invalidSetting(apiName, settings, LOCAL_REF_ROOT_SETTING, "a directory path");
|
|
78
153
|
}
|
|
79
154
|
return { localRefRoot: resolveLocationUrl(value === "" ? "." : value, configRoot) };
|
|
80
155
|
}
|
|
@@ -87,7 +162,7 @@ function remoteRefHostsOf(apiName: string, settings: ApiSettings): RefLimitOptio
|
|
|
87
162
|
const value = settingValue(settings, REMOTE_REF_HOSTS_SETTING) ?? [];
|
|
88
163
|
const entries = [value].flat();
|
|
89
164
|
if (entries.some((entry) => typeof entry !== "string")) {
|
|
90
|
-
throw invalidSetting(apiName, REMOTE_REF_HOSTS_SETTING, "a host list");
|
|
165
|
+
throw invalidSetting(apiName, settings, REMOTE_REF_HOSTS_SETTING, "a host list");
|
|
91
166
|
}
|
|
92
167
|
return { remoteRefHosts: hostList(entries) ?? [] };
|
|
93
168
|
}
|
|
@@ -0,0 +1,117 @@
|
|
|
1
|
+
import type { ClaimedFile } from "../application/ports/file-system.js";
|
|
2
|
+
import type { GeneratedTypes } from "./cli-dependencies.js";
|
|
3
|
+
import {
|
|
4
|
+
type CliRun,
|
|
5
|
+
duplicateOutputError,
|
|
6
|
+
emitOutput,
|
|
7
|
+
ensureOutputIsNotSchema,
|
|
8
|
+
type NamedFile,
|
|
9
|
+
type OutputFile,
|
|
10
|
+
} from "./cli-output.js";
|
|
11
|
+
|
|
12
|
+
/**
|
|
13
|
+
* Writing the generated APIs of a Redocly config. Before the first byte is written, every output
|
|
14
|
+
* is claimed: a missing one is created empty, so the file system gives it its own identity. Two
|
|
15
|
+
* APIs whose files then have one identity fail with `CLI_OUTPUT_DUPLICATE` and write nothing,
|
|
16
|
+
* also when their names looked different (ADR-043, decision 1).
|
|
17
|
+
*/
|
|
18
|
+
|
|
19
|
+
/** An API whose types are generated and not written yet. */
|
|
20
|
+
export interface GeneratedApi {
|
|
21
|
+
readonly name: string;
|
|
22
|
+
readonly outputFile: OutputFile;
|
|
23
|
+
readonly types: GeneratedTypes;
|
|
24
|
+
}
|
|
25
|
+
|
|
26
|
+
/** An API whose output is claimed; `claim` is undefined with `--check`, which writes nothing. */
|
|
27
|
+
interface ClaimedApi {
|
|
28
|
+
readonly api: GeneratedApi;
|
|
29
|
+
readonly claim: ClaimedFile | undefined;
|
|
30
|
+
}
|
|
31
|
+
|
|
32
|
+
/** The failures of the API an API name maps to; an API without failures was written. */
|
|
33
|
+
type ApiFailures = Map<string, unknown[]>;
|
|
34
|
+
|
|
35
|
+
/** The failure of a step, as a list: empty when it succeeded. */
|
|
36
|
+
export function failuresOf(step: () => void): unknown[] {
|
|
37
|
+
try {
|
|
38
|
+
step();
|
|
39
|
+
return [];
|
|
40
|
+
} catch (failure) {
|
|
41
|
+
return [failure];
|
|
42
|
+
}
|
|
43
|
+
}
|
|
44
|
+
|
|
45
|
+
/** Claim the output of each API; an API whose claim fails gets that failure instead. */
|
|
46
|
+
function claimOutputs(run: CliRun, apis: readonly GeneratedApi[], failures: ApiFailures) {
|
|
47
|
+
const claimed: ClaimedApi[] = [];
|
|
48
|
+
for (const api of apis) {
|
|
49
|
+
try {
|
|
50
|
+
const claim = run.args.isCheck ? undefined : run.deps.files.claimFile(api.outputFile.file);
|
|
51
|
+
claimed.push({ api, claim });
|
|
52
|
+
} catch (failure) {
|
|
53
|
+
failures.set(api.name, [failure]);
|
|
54
|
+
}
|
|
55
|
+
}
|
|
56
|
+
return claimed;
|
|
57
|
+
}
|
|
58
|
+
|
|
59
|
+
/** The APIs that share their claimed file with another, by API name, with the other names. */
|
|
60
|
+
function sharedOutputs(claimed: readonly ClaimedApi[]): Map<string, string[]> {
|
|
61
|
+
const byIdentity = new Map<string, string[]>();
|
|
62
|
+
for (const { api, claim } of claimed) {
|
|
63
|
+
if (claim) {
|
|
64
|
+
byIdentity.set(claim.identity, [...(byIdentity.get(claim.identity) ?? []), api.name]);
|
|
65
|
+
}
|
|
66
|
+
}
|
|
67
|
+
const shared = new Map<string, string[]>();
|
|
68
|
+
for (const names of byIdentity.values()) {
|
|
69
|
+
for (const name of names.length > 1 ? names : []) {
|
|
70
|
+
shared.set(
|
|
71
|
+
name,
|
|
72
|
+
names.filter((other) => other !== name).map((other) => `API ${other}`),
|
|
73
|
+
);
|
|
74
|
+
}
|
|
75
|
+
}
|
|
76
|
+
return shared;
|
|
77
|
+
}
|
|
78
|
+
|
|
79
|
+
/** Write one claimed API; a failed write releases the claim, so no empty file is left. */
|
|
80
|
+
function writeClaimed(run: CliRun, { api, claim }: ClaimedApi): unknown[] {
|
|
81
|
+
const failures = failuresOf(() => emitOutput(run, api.outputFile, api.types.contents));
|
|
82
|
+
return failures.length > 0 && claim
|
|
83
|
+
? [...failures, ...failuresOf(() => claim.release())]
|
|
84
|
+
: failures;
|
|
85
|
+
}
|
|
86
|
+
|
|
87
|
+
/**
|
|
88
|
+
* Write (or `--check`) every API unless its output is a file the run read or the file of another
|
|
89
|
+
* API. Returns the failures by API name. Claims are released in reverse order, so a directory
|
|
90
|
+
* one claim created is empty by the time it is removed.
|
|
91
|
+
*/
|
|
92
|
+
export function writeGeneratedApis(
|
|
93
|
+
run: CliRun,
|
|
94
|
+
apis: readonly GeneratedApi[],
|
|
95
|
+
readFiles: readonly NamedFile[],
|
|
96
|
+
): ApiFailures {
|
|
97
|
+
const failures: ApiFailures = new Map();
|
|
98
|
+
const ownOutputs = apis.filter((api) => {
|
|
99
|
+
const failure = failuresOf(() => ensureOutputIsNotSchema(run, api.outputFile, readFiles));
|
|
100
|
+
failures.set(api.name, failure);
|
|
101
|
+
return failure.length === 0;
|
|
102
|
+
});
|
|
103
|
+
const claimed = claimOutputs(run, ownOutputs, failures);
|
|
104
|
+
const shared = sharedOutputs(claimed);
|
|
105
|
+
for (const entry of [...claimed].reverse()) {
|
|
106
|
+
const { api, claim } = entry;
|
|
107
|
+
const others = shared.get(api.name);
|
|
108
|
+
if (others) {
|
|
109
|
+
const release = claim ? failuresOf(() => claim.release()) : [];
|
|
110
|
+
failures.set(api.name, [duplicateOutputError(api.outputFile, others), ...release]);
|
|
111
|
+
}
|
|
112
|
+
}
|
|
113
|
+
for (const entry of claimed.filter(({ api }) => !shared.has(api.name))) {
|
|
114
|
+
failures.set(entry.api.name, writeClaimed(run, entry));
|
|
115
|
+
}
|
|
116
|
+
return failures;
|
|
117
|
+
}
|