openapi-typesafe 1.0.0-rc.3 → 1.0.0-rc.5
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +1972 -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 +97 -14
- package/dist/adapters/node-file-system/node-file-system.cjs.map +1 -1
- package/dist/adapters/node-file-system/node-file-system.mjs +97 -14
- package/dist/adapters/node-file-system/node-file-system.mjs.map +1 -1
- package/dist/adapters/pipe-safe-writer/pipe-safe-writer.cjs +19 -0
- package/dist/adapters/pipe-safe-writer/pipe-safe-writer.cjs.map +1 -0
- package/dist/adapters/pipe-safe-writer/pipe-safe-writer.mjs +17 -0
- package/dist/adapters/pipe-safe-writer/pipe-safe-writer.mjs.map +1 -0
- package/dist/adapters/redocly-loader/bundled-mapping-copies.cjs +48 -0
- package/dist/adapters/redocly-loader/bundled-mapping-copies.cjs.map +1 -0
- package/dist/adapters/redocly-loader/bundled-mapping-copies.mjs +45 -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/component-schemas.cjs +17 -0
- package/dist/adapters/redocly-loader/component-schemas.cjs.map +1 -0
- package/dist/adapters/redocly-loader/component-schemas.mjs +14 -0
- package/dist/adapters/redocly-loader/component-schemas.mjs.map +1 -0
- 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/mapping-schema-names.cjs +22 -0
- package/dist/adapters/redocly-loader/mapping-schema-names.cjs.map +1 -0
- package/dist/adapters/redocly-loader/mapping-schema-names.mjs +20 -0
- package/dist/adapters/redocly-loader/mapping-schema-names.mjs.map +1 -0
- package/dist/adapters/redocly-loader/query-named-components.cjs +137 -0
- package/dist/adapters/redocly-loader/query-named-components.cjs.map +1 -0
- package/dist/adapters/redocly-loader/query-named-components.mjs +134 -0
- package/dist/adapters/redocly-loader/query-named-components.mjs.map +1 -0
- package/dist/adapters/redocly-loader/redocly-schema-loader.cjs +40 -29
- package/dist/adapters/redocly-loader/redocly-schema-loader.cjs.map +1 -1
- package/dist/adapters/redocly-loader/redocly-schema-loader.mjs +38 -27
- package/dist/adapters/redocly-loader/redocly-schema-loader.mjs.map +1 -1
- package/dist/adapters/redocly-loader/ref-access.cjs +45 -4
- package/dist/adapters/redocly-loader/ref-access.cjs.map +1 -1
- package/dist/adapters/redocly-loader/ref-access.mjs +45 -4
- package/dist/adapters/redocly-loader/ref-access.mjs.map +1 -1
- package/dist/adapters/redocly-loader/ref-holders.cjs +52 -10
- package/dist/adapters/redocly-loader/ref-holders.cjs.map +1 -1
- package/dist/adapters/redocly-loader/ref-holders.mjs +53 -12
- 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 +40 -9
- package/dist/adapters/redocly-loader/remote-fetch.cjs.map +1 -1
- package/dist/adapters/redocly-loader/remote-fetch.mjs +40 -9
- package/dist/adapters/redocly-loader/remote-fetch.mjs.map +1 -1
- package/dist/adapters/redocly-loader/remote-node-limit.cjs +61 -0
- package/dist/adapters/redocly-loader/remote-node-limit.cjs.map +1 -0
- package/dist/adapters/redocly-loader/remote-node-limit.mjs +58 -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 +18 -9
- package/dist/adapters/redocly-loader/schema-source.cjs.map +1 -1
- package/dist/adapters/redocly-loader/schema-source.mjs +20 -11
- 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 +10 -4
- package/dist/adapters/terminal-logger/terminal-logger.cjs.map +1 -1
- package/dist/adapters/terminal-logger/terminal-logger.mjs +10 -4
- package/dist/adapters/terminal-logger/terminal-logger.mjs.map +1 -1
- package/dist/api/default-ports.cjs +14 -2
- package/dist/api/default-ports.cjs.map +1 -1
- package/dist/api/default-ports.mjs +14 -2
- package/dist/api/default-ports.mjs.map +1 -1
- package/dist/api/discriminator-enum-parent.cjs +2 -2
- package/dist/api/discriminator-enum-parent.cjs.map +1 -1
- package/dist/api/discriminator-enum-parent.mjs +3 -3
- package/dist/api/discriminator-enum-parent.mjs.map +1 -1
- package/dist/api/discriminator-other-owners.cjs +5 -3
- package/dist/api/discriminator-other-owners.cjs.map +1 -1
- package/dist/api/discriminator-other-owners.mjs +5 -3
- package/dist/api/discriminator-other-owners.mjs.map +1 -1
- package/dist/api/discriminator-patch.cjs +5 -1
- package/dist/api/discriminator-patch.cjs.map +1 -1
- package/dist/api/discriminator-patch.mjs +5 -1
- package/dist/api/discriminator-patch.mjs.map +1 -1
- package/dist/api/discriminator-scan.cjs +15 -8
- package/dist/api/discriminator-scan.cjs.map +1 -1
- package/dist/api/discriminator-scan.mjs +15 -8
- package/dist/api/discriminator-scan.mjs.map +1 -1
- package/dist/api/document-refs.cjs +16 -1
- package/dist/api/document-refs.cjs.map +1 -1
- package/dist/api/document-refs.mjs +16 -1
- package/dist/api/document-refs.mjs.map +1 -1
- package/dist/api/document-run.cjs +6 -12
- package/dist/api/document-run.cjs.map +1 -1
- package/dist/api/document-run.mjs +6 -12
- package/dist/api/document-run.mjs.map +1 -1
- package/dist/api/legacy-utils.cjs.map +1 -1
- package/dist/api/legacy-utils.mjs.map +1 -1
- package/dist/api/openapi-ts.cjs +9 -6
- package/dist/api/openapi-ts.cjs.map +1 -1
- package/dist/api/openapi-ts.mjs +10 -8
- package/dist/api/openapi-ts.mjs.map +1 -1
- package/dist/api/ref-limit-options.cjs +63 -0
- package/dist/api/ref-limit-options.cjs.map +1 -0
- package/dist/api/ref-limit-options.mjs +57 -0
- package/dist/api/ref-limit-options.mjs.map +1 -0
- package/dist/api/schema-callbacks.cjs +36 -12
- package/dist/api/schema-callbacks.cjs.map +1 -1
- package/dist/api/schema-callbacks.mjs +36 -12
- package/dist/api/schema-callbacks.mjs.map +1 -1
- package/dist/api/transform-context.cjs +7 -3
- package/dist/api/transform-context.cjs.map +1 -1
- package/dist/api/transform-context.mjs +7 -3
- package/dist/api/transform-context.mjs.map +1 -1
- package/dist/api/transform-schema.cjs +47 -10
- package/dist/api/transform-schema.cjs.map +1 -1
- package/dist/api/transform-schema.mjs +48 -11
- package/dist/api/transform-schema.mjs.map +1 -1
- package/dist/application/print/text-writer.cjs +10 -3
- package/dist/application/print/text-writer.cjs.map +1 -1
- package/dist/application/print/text-writer.mjs +10 -3
- package/dist/application/print/text-writer.mjs.map +1 -1
- package/dist/application/stack-overflow.cjs +2 -1
- package/dist/application/stack-overflow.cjs.map +1 -1
- package/dist/application/stack-overflow.mjs +2 -1
- package/dist/application/stack-overflow.mjs.map +1 -1
- package/dist/application/transform/declared-value-types.cjs +36 -0
- package/dist/application/transform/declared-value-types.cjs.map +1 -0
- package/dist/application/transform/declared-value-types.mjs +34 -0
- package/dist/application/transform/declared-value-types.mjs.map +1 -0
- package/dist/application/transform/document/components.cjs +1 -1
- package/dist/application/transform/document/components.cjs.map +1 -1
- package/dist/application/transform/document/components.mjs +2 -2
- package/dist/application/transform/document/components.mjs.map +1 -1
- package/dist/application/transform/document/declared-type-names.cjs +23 -0
- package/dist/application/transform/document/declared-type-names.cjs.map +1 -0
- package/dist/application/transform/document/declared-type-names.mjs +20 -0
- package/dist/application/transform/document/declared-type-names.mjs.map +1 -0
- package/dist/application/transform/document/defs-root.cjs +1 -1
- package/dist/application/transform/document/defs-root.cjs.map +1 -1
- package/dist/application/transform/document/defs-root.mjs +2 -2
- package/dist/application/transform/document/defs-root.mjs.map +1 -1
- package/dist/application/transform/document/document.cjs +7 -2
- package/dist/application/transform/document/document.cjs.map +1 -1
- package/dist/application/transform/document/document.mjs +6 -3
- 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/exploded-query-values.cjs +63 -0
- package/dist/application/transform/document/exploded-query-values.cjs.map +1 -0
- package/dist/application/transform/document/exploded-query-values.mjs +59 -0
- package/dist/application/transform/document/exploded-query-values.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/header.cjs +11 -3
- package/dist/application/transform/document/header.cjs.map +1 -1
- package/dist/application/transform/document/header.mjs +10 -2
- package/dist/application/transform/document/header.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 +29 -34
- package/dist/application/transform/document/parameters.cjs.map +1 -1
- package/dist/application/transform/document/parameters.mjs +29 -34
- package/dist/application/transform/document/parameters.mjs.map +1 -1
- package/dist/application/transform/document/path-item.cjs +15 -17
- package/dist/application/transform/document/path-item.cjs.map +1 -1
- package/dist/application/transform/document/path-item.mjs +15 -19
- package/dist/application/transform/document/path-item.mjs.map +1 -1
- package/dist/application/transform/document/path-template-key.cjs +84 -0
- package/dist/application/transform/document/path-template-key.cjs.map +1 -0
- package/dist/application/transform/document/path-template-key.mjs +79 -0
- package/dist/application/transform/document/path-template-key.mjs.map +1 -0
- package/dist/application/transform/document/path-template-refs.cjs +70 -0
- package/dist/application/transform/document/path-template-refs.cjs.map +1 -0
- package/dist/application/transform/document/path-template-refs.mjs +67 -0
- package/dist/application/transform/document/path-template-refs.mjs.map +1 -0
- package/dist/application/transform/document/paths-enum.cjs +8 -6
- package/dist/application/transform/document/paths-enum.cjs.map +1 -1
- package/dist/application/transform/document/paths-enum.mjs +8 -7
- package/dist/application/transform/document/paths-enum.mjs.map +1 -1
- package/dist/application/transform/document/paths.cjs +43 -67
- package/dist/application/transform/document/paths.cjs.map +1 -1
- package/dist/application/transform/document/paths.mjs +42 -68
- 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 +10 -3
- package/dist/application/transform/document/webhooks.cjs.map +1 -1
- package/dist/application/transform/document/webhooks.mjs +10 -3
- package/dist/application/transform/document/webhooks.mjs.map +1 -1
- package/dist/application/transform/footer/document-footer.cjs +16 -5
- package/dist/application/transform/footer/document-footer.cjs.map +1 -1
- package/dist/application/transform/footer/document-footer.mjs +16 -5
- 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 +3 -3
- package/dist/application/transform/helper-types.cjs.map +1 -1
- package/dist/application/transform/helper-types.mjs +3 -3
- 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 +5 -5
- package/dist/application/transform/ref-pointer/generated-location.cjs.map +1 -1
- package/dist/application/transform/ref-pointer/generated-location.mjs +3 -3
- package/dist/application/transform/ref-pointer/generated-location.mjs.map +1 -1
- package/dist/application/transform/ref-pointer/generated-shape.cjs +47 -66
- package/dist/application/transform/ref-pointer/generated-shape.cjs.map +1 -1
- package/dist/application/transform/ref-pointer/generated-shape.mjs +36 -50
- package/dist/application/transform/ref-pointer/generated-shape.mjs.map +1 -1
- package/dist/application/transform/ref-pointer/inline-cycles.cjs +2 -2
- package/dist/application/transform/ref-pointer/inline-cycles.cjs.map +1 -1
- package/dist/application/transform/ref-pointer/inline-cycles.mjs +1 -1
- package/dist/application/transform/ref-pointer/inline-cycles.mjs.map +1 -1
- package/dist/application/transform/ref-pointer/located-node.cjs +23 -0
- package/dist/application/transform/ref-pointer/located-node.cjs.map +1 -0
- package/dist/application/transform/ref-pointer/located-node.mjs +18 -0
- package/dist/application/transform/ref-pointer/located-node.mjs.map +1 -0
- package/dist/application/transform/ref-pointer/original-index.cjs +68 -13
- package/dist/application/transform/ref-pointer/original-index.cjs.map +1 -1
- package/dist/application/transform/ref-pointer/original-index.mjs +70 -15
- package/dist/application/transform/ref-pointer/original-index.mjs.map +1 -1
- package/dist/application/transform/ref-pointer/pointer-type.cjs +2 -2
- package/dist/application/transform/ref-pointer/pointer-type.cjs.map +1 -1
- package/dist/application/transform/ref-pointer/pointer-type.mjs +1 -1
- package/dist/application/transform/ref-pointer/pointer-type.mjs.map +1 -1
- package/dist/application/transform/ref-pointer/pointer-walk.cjs +54 -13
- package/dist/application/transform/ref-pointer/pointer-walk.cjs.map +1 -1
- package/dist/application/transform/ref-pointer/pointer-walk.mjs +46 -7
- package/dist/application/transform/ref-pointer/pointer-walk.mjs.map +1 -1
- package/dist/application/transform/ref-pointer/property-shape.cjs +52 -0
- package/dist/application/transform/ref-pointer/property-shape.cjs.map +1 -0
- package/dist/application/transform/ref-pointer/property-shape.mjs +45 -0
- package/dist/application/transform/ref-pointer/property-shape.mjs.map +1 -0
- package/dist/application/transform/ref-pointer/typed-walk.cjs +79 -21
- package/dist/application/transform/ref-pointer/typed-walk.cjs.map +1 -1
- package/dist/application/transform/ref-pointer/typed-walk.mjs +76 -18
- package/dist/application/transform/ref-pointer/typed-walk.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.map +1 -1
- package/dist/application/transform/schema/access-flags.mjs.map +1 -1
- package/dist/application/transform/schema/composition-type.cjs +1 -1
- package/dist/application/transform/schema/composition-type.cjs.map +1 -1
- package/dist/application/transform/schema/composition-type.mjs +2 -2
- package/dist/application/transform/schema/composition-type.mjs.map +1 -1
- package/dist/application/transform/schema/enum-rule.cjs +1 -1
- package/dist/application/transform/schema/enum-rule.cjs.map +1 -1
- package/dist/application/transform/schema/enum-rule.mjs +2 -2
- package/dist/application/transform/schema/enum-rule.mjs.map +1 -1
- package/dist/application/transform/schema/index-signature-type.cjs +21 -0
- package/dist/application/transform/schema/index-signature-type.cjs.map +1 -0
- package/dist/application/transform/schema/index-signature-type.mjs +19 -0
- package/dist/application/transform/schema/index-signature-type.mjs.map +1 -0
- package/dist/application/transform/schema/input-location.cjs +23 -0
- package/dist/application/transform/schema/input-location.cjs.map +1 -0
- package/dist/application/transform/schema/input-location.mjs +21 -0
- package/dist/application/transform/schema/input-location.mjs.map +1 -0
- package/dist/application/transform/schema/object-type.cjs +18 -8
- package/dist/application/transform/schema/object-type.cjs.map +1 -1
- package/dist/application/transform/schema/object-type.mjs +19 -9
- package/dist/application/transform/schema/object-type.mjs.map +1 -1
- package/dist/application/transform/schema/ref-siblings.cjs +47 -0
- package/dist/application/transform/schema/ref-siblings.cjs.map +1 -0
- package/dist/application/transform/schema/ref-siblings.mjs +45 -0
- package/dist/application/transform/schema/ref-siblings.mjs.map +1 -0
- package/dist/application/transform/schema/schema-transform.cjs +6 -3
- package/dist/application/transform/schema/schema-transform.cjs.map +1 -1
- package/dist/application/transform/schema/schema-transform.mjs +6 -3
- package/dist/application/transform/schema/schema-transform.mjs.map +1 -1
- package/dist/application/transform/schema/unevaluated-properties.cjs +2 -30
- package/dist/application/transform/schema/unevaluated-properties.cjs.map +1 -1
- package/dist/application/transform/schema/unevaluated-properties.mjs +3 -31
- package/dist/application/transform/schema/unevaluated-properties.mjs.map +1 -1
- package/dist/application/transform/schema-comment.cjs +5 -1
- package/dist/application/transform/schema-comment.cjs.map +1 -1
- package/dist/application/transform/schema-comment.mjs +5 -1
- package/dist/application/transform/schema-comment.mjs.map +1 -1
- package/dist/cli/api-logger.cjs +13 -0
- package/dist/cli/api-logger.cjs.map +1 -0
- package/dist/cli/api-logger.mjs +11 -0
- package/dist/cli/api-logger.mjs.map +1 -0
- package/dist/cli/api-settings.cjs +57 -9
- package/dist/cli/api-settings.cjs.map +1 -1
- package/dist/cli/api-settings.mjs +56 -11
- 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-arguments.cjs +51 -11
- package/dist/cli/cli-arguments.cjs.map +1 -1
- package/dist/cli/cli-arguments.mjs +51 -11
- package/dist/cli/cli-arguments.mjs.map +1 -1
- package/dist/cli/cli-errors.cjs +29 -1
- package/dist/cli/cli-errors.cjs.map +1 -1
- package/dist/cli/cli-errors.mjs +29 -2
- package/dist/cli/cli-errors.mjs.map +1 -1
- package/dist/cli/cli-output.cjs +111 -4
- package/dist/cli/cli-output.cjs.map +1 -1
- package/dist/cli/cli-output.mjs +104 -5
- package/dist/cli/cli-output.mjs.map +1 -1
- package/dist/cli/main.cjs +13 -3
- package/dist/cli/main.cjs.map +1 -1
- package/dist/cli/main.mjs +14 -4
- package/dist/cli/main.mjs.map +1 -1
- package/dist/cli/redocly-apis.cjs +94 -37
- package/dist/cli/redocly-apis.cjs.map +1 -1
- package/dist/cli/redocly-apis.mjs +99 -42
- package/dist/cli/redocly-apis.mjs.map +1 -1
- package/dist/cli/ref-limits.cjs +15 -1
- package/dist/cli/ref-limits.cjs.map +1 -1
- package/dist/cli/ref-limits.mjs +15 -2
- package/dist/cli/ref-limits.mjs.map +1 -1
- package/dist/cli/run-cli.cjs +37 -14
- package/dist/cli/run-cli.cjs.map +1 -1
- package/dist/cli/run-cli.mjs +39 -16
- 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 +52 -0
- package/dist/domain/cause-secrets.cjs.map +1 -0
- package/dist/domain/cause-secrets.mjs +50 -0
- package/dist/domain/cause-secrets.mjs.map +1 -0
- package/dist/domain/errors.cjs +11 -3
- package/dist/domain/errors.cjs.map +1 -1
- package/dist/domain/errors.mjs +11 -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/location-text.cjs +9 -0
- package/dist/domain/location-text.cjs.map +1 -0
- package/dist/domain/location-text.mjs +7 -0
- package/dist/domain/location-text.mjs.map +1 -0
- 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/document-places.cjs +55 -0
- package/dist/domain/openapi/document-places.cjs.map +1 -0
- package/dist/domain/openapi/document-places.mjs +53 -0
- package/dist/domain/openapi/document-places.mjs.map +1 -0
- 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 +20 -0
- package/dist/domain/output-fixes.cjs.map +1 -1
- package/dist/domain/output-fixes.mjs +20 -0
- package/dist/domain/output-fixes.mjs.map +1 -1
- package/dist/domain/terminal-text.cjs +31 -0
- package/dist/domain/terminal-text.cjs.map +1 -0
- package/dist/domain/terminal-text.mjs +29 -0
- package/dist/domain/terminal-text.mjs.map +1 -0
- 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 +1 -0
- package/dist/domain/warnings.cjs.map +1 -1
- package/dist/domain/warnings.mjs +1 -0
- package/dist/domain/warnings.mjs.map +1 -1
- package/dist/index.d.cts +46 -20
- package/dist/index.d.mts +46 -20
- package/dist/index.d.ts +46 -20
- package/package.json +4 -5
- package/src/adapters/node-file-system/file-claims.ts +138 -0
- package/src/adapters/node-file-system/file-identity.ts +137 -0
- package/src/adapters/node-file-system/node-file-system.ts +158 -18
- package/src/adapters/pipe-safe-writer/pipe-safe-writer.ts +29 -0
- package/src/adapters/redocly-loader/bundled-mapping-copies.ts +60 -0
- package/src/adapters/redocly-loader/bundled-ref-repair.ts +2 -2
- package/src/adapters/redocly-loader/component-schemas.ts +19 -0
- package/src/adapters/redocly-loader/loaded-documents.ts +46 -0
- package/src/adapters/redocly-loader/mapping-schema-names.ts +25 -0
- package/src/adapters/redocly-loader/query-named-components.ts +201 -0
- package/src/adapters/redocly-loader/redocly-schema-loader.ts +64 -38
- package/src/adapters/redocly-loader/ref-access.ts +51 -4
- package/src/adapters/redocly-loader/ref-holders.ts +76 -15
- package/src/adapters/redocly-loader/remote-body-limit.ts +66 -0
- package/src/adapters/redocly-loader/remote-fetch.ts +85 -13
- package/src/adapters/redocly-loader/remote-node-limit.ts +102 -0
- package/src/adapters/redocly-loader/schema-load-errors.ts +52 -13
- package/src/adapters/redocly-loader/schema-source.ts +35 -11
- package/src/adapters/redocly-loader/unsupported-keys.ts +3 -7
- package/src/adapters/terminal-logger/terminal-logger.ts +17 -6
- package/src/api/default-ports.ts +33 -4
- package/src/api/discriminator-enum-parent.ts +3 -3
- package/src/api/discriminator-other-owners.ts +5 -3
- package/src/api/discriminator-patch.ts +5 -1
- package/src/api/discriminator-scan.ts +16 -8
- package/src/api/document-refs.ts +29 -1
- package/src/api/document-run.ts +10 -19
- package/src/api/legacy-utils.ts +5 -1
- package/src/api/openapi-ts.ts +26 -8
- package/src/api/ref-limit-options.ts +76 -0
- package/src/api/run-context.ts +3 -0
- package/src/api/schema-callbacks.ts +60 -17
- package/src/api/transform-context.ts +7 -3
- package/src/api/transform-schema.ts +79 -12
- package/src/application/ports/file-system.ts +47 -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/declared-value-types.ts +42 -0
- package/src/application/transform/document/components.ts +2 -2
- package/src/application/transform/document/declared-type-names.ts +36 -0
- package/src/application/transform/document/defs-root.ts +2 -2
- package/src/application/transform/document/document.ts +8 -5
- package/src/application/transform/document/enum-names-given-back.ts +91 -0
- package/src/application/transform/document/exploded-query-values.ts +88 -0
- package/src/application/transform/document/global-type-references.ts +1 -1
- package/src/application/transform/document/header.ts +25 -5
- 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 +56 -66
- package/src/application/transform/document/path-item.ts +16 -34
- package/src/application/transform/document/path-template-key.ts +152 -0
- package/src/application/transform/document/path-template-refs.ts +106 -0
- package/src/application/transform/document/paths-enum.ts +24 -10
- package/src/application/transform/document/paths.ts +59 -125
- 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 +19 -6
- package/src/application/transform/footer/document-footer.ts +36 -9
- 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 +8 -7
- package/src/application/transform/numbered-names.ts +15 -0
- package/src/application/transform/ref-pointer/generated-location.ts +3 -3
- package/src/application/transform/ref-pointer/generated-shape.ts +67 -78
- package/src/application/transform/ref-pointer/inline-cycles.ts +1 -1
- package/src/application/transform/ref-pointer/located-node.ts +38 -0
- package/src/application/transform/ref-pointer/original-index.ts +100 -17
- package/src/application/transform/ref-pointer/pointer-type.ts +1 -1
- package/src/application/transform/ref-pointer/pointer-walk.ts +82 -8
- package/src/application/transform/ref-pointer/property-shape.ts +97 -0
- package/src/application/transform/ref-pointer/typed-walk.ts +117 -25
- package/src/application/transform/ref-type.ts +2 -1
- package/src/application/transform/schema/access-flags.ts +5 -2
- package/src/application/transform/schema/composition-type.ts +2 -2
- package/src/application/transform/schema/enum-rule.ts +6 -2
- package/src/application/transform/schema/index-signature-type.ts +31 -0
- package/src/application/transform/schema/input-location.ts +35 -0
- package/src/application/transform/schema/object-type.ts +22 -12
- package/src/application/transform/schema/ref-siblings.ts +76 -0
- package/src/application/transform/schema/schema-context.ts +3 -0
- package/src/application/transform/schema/schema-transform.ts +6 -3
- package/src/application/transform/schema/unevaluated-properties.ts +4 -44
- package/src/application/transform/schema-comment.ts +5 -1
- package/src/application/transform/transform-context.ts +5 -0
- package/src/cli/api-logger.ts +17 -0
- package/src/cli/api-settings.ts +80 -13
- package/src/cli/api-writes.ts +117 -0
- package/src/cli/cli-arguments.ts +90 -14
- package/src/cli/cli-dependencies.ts +26 -4
- package/src/cli/cli-errors.ts +42 -1
- package/src/cli/cli-output.ts +195 -15
- package/src/cli/main.ts +14 -5
- package/src/cli/redocly-apis.ts +177 -52
- package/src/cli/ref-limits.ts +21 -2
- package/src/cli/run-cli.ts +76 -15
- package/src/domain/append-all.ts +10 -0
- package/src/domain/cause-secrets.ts +86 -0
- package/src/domain/errors.ts +16 -5
- package/src/domain/ir/identifier-text.ts +6 -5
- package/src/domain/ir/ir-shape.ts +299 -0
- package/src/domain/ir/newer-identifier-ranges.ts +183 -30
- package/src/domain/location-text.ts +12 -0
- 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/document-places.ts +78 -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 +28 -2
- package/src/domain/terminal-text.ts +44 -0
- package/src/domain/url-secrets.ts +72 -0
- package/src/domain/warnings.ts +1 -0
- package/src/types/generator-options.ts +1 -1
- package/dist/cli/main.d.cts +0 -2
- package/dist/cli/main.d.mts +0 -2
- package/dist/cli/main.d.ts +0 -2
- package/dist/domain/url-credentials.cjs +0 -10
- package/dist/domain/url-credentials.cjs.map +0 -1
- package/dist/domain/url-credentials.mjs +0 -8
- package/dist/domain/url-credentials.mjs.map +0 -1
- package/src/domain/url-credentials.ts +0 -18
|
@@ -0,0 +1,58 @@
|
|
|
1
|
+
import { HELPER_TYPES, READ_WRITE_MARKER_TYPES } from '../helper-types.mjs';
|
|
2
|
+
import { typeNamesInText, typeNamesDeclaredBy } from './declared-type-names.mjs';
|
|
3
|
+
import { ROOT_KEYS, OPERATIONS_NAME } from './document.mjs';
|
|
4
|
+
import { GLOBAL_TYPE_NAMES, globalTypeReferences } from './global-type-references.mjs';
|
|
5
|
+
import { API_PATHS_NAME } from './paths-enum.mjs';
|
|
6
|
+
import { isRootTypeAlias } from './root-type-aliases.mjs';
|
|
7
|
+
|
|
8
|
+
const NAMES_THE_OUTPUT_MAY_NEED = /* @__PURE__ */ new Set([
|
|
9
|
+
...GLOBAL_TYPE_NAMES,
|
|
10
|
+
...Object.values(HELPER_TYPES).map(({ name }) => name),
|
|
11
|
+
...typeNamesInText(READ_WRITE_MARKER_TYPES),
|
|
12
|
+
API_PATHS_NAME,
|
|
13
|
+
...ROOT_KEYS,
|
|
14
|
+
OPERATIONS_NAME
|
|
15
|
+
]);
|
|
16
|
+
function namesTheOutputNeeds({ body, footer, closing }) {
|
|
17
|
+
const others = [
|
|
18
|
+
...body.filter((declaration) => !isRootTypeAlias(declaration)),
|
|
19
|
+
...footer.filter((declaration) => declaration.kind !== "enum"),
|
|
20
|
+
...closing
|
|
21
|
+
];
|
|
22
|
+
return /* @__PURE__ */ new Set([
|
|
23
|
+
...globalTypeReferences([...body, ...footer, ...closing]),
|
|
24
|
+
...typeNamesDeclaredBy(others)
|
|
25
|
+
]);
|
|
26
|
+
}
|
|
27
|
+
const SKIPPED_KEYS = /* @__PURE__ */ new Set(["origin"]);
|
|
28
|
+
const ENUM_REFERENCE_RE = /^(typeof )?([^.]+)(\..*)?$/s;
|
|
29
|
+
function renamedReference(name, renames) {
|
|
30
|
+
const match = ENUM_REFERENCE_RE.exec(name);
|
|
31
|
+
const renamed = match === null ? void 0 : renames.get(match[2] ?? "");
|
|
32
|
+
return renamed === void 0 ? name : `${match?.[1] ?? ""}${renamed}${match?.[3] ?? ""}`;
|
|
33
|
+
}
|
|
34
|
+
function isNode(value) {
|
|
35
|
+
return typeof value === "object" && value !== null;
|
|
36
|
+
}
|
|
37
|
+
function renamedNode(value, renames) {
|
|
38
|
+
if (Array.isArray(value)) {
|
|
39
|
+
return value.map((item) => renamedNode(item, renames));
|
|
40
|
+
}
|
|
41
|
+
if (!isNode(value)) {
|
|
42
|
+
return value;
|
|
43
|
+
}
|
|
44
|
+
const node = Object.fromEntries(
|
|
45
|
+
Object.entries(value).map(([key, child]) => [
|
|
46
|
+
key,
|
|
47
|
+
SKIPPED_KEYS.has(key) ? child : renamedNode(child, renames)
|
|
48
|
+
])
|
|
49
|
+
);
|
|
50
|
+
const isNamed = (node.kind === "reference" || node.kind === "enum") && typeof node.name === "string";
|
|
51
|
+
return isNamed ? { ...node, name: renamedReference(node.name, renames) } : node;
|
|
52
|
+
}
|
|
53
|
+
function withEnumsRenamed(declarations, renames) {
|
|
54
|
+
return renames.size === 0 ? [...declarations] : renamedNode(declarations, renames);
|
|
55
|
+
}
|
|
56
|
+
|
|
57
|
+
export { NAMES_THE_OUTPUT_MAY_NEED, namesTheOutputNeeds, withEnumsRenamed };
|
|
58
|
+
//# sourceMappingURL=enum-names-given-back.mjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"enum-names-given-back.mjs","sources":["../../../../src/application/transform/document/enum-names-given-back.ts"],"sourcesContent":["import type { IrDeclaration } from \"../../../domain/ir/nodes.js\";\nimport { HELPER_TYPES, READ_WRITE_MARKER_TYPES } from \"../helper-types.js\";\nimport { typeNamesDeclaredBy, typeNamesInText } from \"./declared-type-names.js\";\nimport { OPERATIONS_NAME, ROOT_KEYS } from \"./document.js\";\nimport { GLOBAL_TYPE_NAMES, globalTypeReferences } from \"./global-type-references.js\";\nimport { API_PATHS_NAME } from \"./paths-enum.js\";\nimport { isRootTypeAlias } from \"./root-type-aliases.js\";\n\n/**\n * The second step of naming `--enum` declarations (`EnumNameClaims`): once the output is known,\n * an enum that gave way to a name the output turned out not to need gets that name back.\n */\n\n/**\n * The type names the output of a document may need, besides its enums: the global types it may\n * refer to and the names the generator declares itself. An enum avoids them until the end.\n */\nexport const NAMES_THE_OUTPUT_MAY_NEED: ReadonlySet<string> = new Set([\n ...GLOBAL_TYPE_NAMES,\n ...Object.values(HELPER_TYPES).map(({ name }) => name),\n ...typeNamesInText(READ_WRITE_MARKER_TYPES),\n API_PATHS_NAME,\n ...ROOT_KEYS,\n OPERATIONS_NAME,\n]);\n\n/** The parts of a transformed document; the footer holds only IR declarations here. */\nexport interface DocumentParts {\n readonly body: readonly IrDeclaration[];\n readonly footer: readonly IrDeclaration[];\n readonly closing: readonly IrDeclaration[];\n}\n\n/**\n * The type names the output needs besides its enums: the globals it refers to, and the names of\n * its other declarations. Root aliases give way to enums (`renameTakenAliases`), so they count\n * for nothing.\n */\nexport function namesTheOutputNeeds({ body, footer, closing }: DocumentParts): Set<string> {\n const others = [\n ...body.filter((declaration) => !isRootTypeAlias(declaration)),\n ...footer.filter((declaration) => declaration.kind !== \"enum\"),\n ...closing,\n ];\n return new Set([\n ...globalTypeReferences([...body, ...footer, ...closing]),\n ...typeNamesDeclaredBy(others),\n ]);\n}\n\n/** `origin` holds the compiler node a raw type was printed from; it is not IR. */\nconst SKIPPED_KEYS: ReadonlySet<string> = new Set([\"origin\"]);\n\n/** The enum references the generator writes: `Name`, `Name.member` and `typeof Name`. */\nconst ENUM_REFERENCE_RE = /^(typeof )?([^.]+)(\\..*)?$/s;\n\nfunction renamedReference(name: string, renames: ReadonlyMap<string, string>): string {\n const match = ENUM_REFERENCE_RE.exec(name);\n const renamed = match === null ? undefined : renames.get(match[2] ?? \"\");\n return renamed === undefined ? name : `${match?.[1] ?? \"\"}${renamed}${match?.[3] ?? \"\"}`;\n}\n\nfunction isNode(value: unknown): value is Readonly<Record<string, unknown>> {\n return typeof value === \"object\" && value !== null;\n}\n\nfunction renamedNode(value: unknown, renames: ReadonlyMap<string, string>): unknown {\n if (Array.isArray(value)) {\n return value.map((item) => renamedNode(item, renames));\n }\n if (!isNode(value)) {\n return value;\n }\n const node = Object.fromEntries(\n Object.entries(value).map(([key, child]) => [\n key,\n SKIPPED_KEYS.has(key) ? child : renamedNode(child, renames),\n ]),\n );\n const isNamed =\n (node.kind === \"reference\" || node.kind === \"enum\") && typeof node.name === \"string\";\n return isNamed ? { ...node, name: renamedReference(node.name as string, renames) } : node;\n}\n\n/** The declarations with each enum in `renames` (old name to new) renamed, references too. */\nexport function withEnumsRenamed<T extends IrDeclaration>(\n declarations: readonly T[],\n renames: ReadonlyMap<string, string>,\n): T[] {\n return renames.size === 0 ? [...declarations] : (renamedNode(declarations, renames) as T[]);\n}\n"],"names":[],"mappings":"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"}
|
|
@@ -0,0 +1,63 @@
|
|
|
1
|
+
'use strict';
|
|
2
|
+
|
|
3
|
+
const schemaTransform = require('../schema/schema-transform.cjs');
|
|
4
|
+
const typeCombinators = require('../type-combinators.cjs');
|
|
5
|
+
|
|
6
|
+
function refOf(value) {
|
|
7
|
+
const ref = value?.$ref;
|
|
8
|
+
return typeof ref === "string" ? ref : void 0;
|
|
9
|
+
}
|
|
10
|
+
function declaredSchema(schema, ref, context) {
|
|
11
|
+
let declared = { schema, path: ref };
|
|
12
|
+
const seen = /* @__PURE__ */ new Set();
|
|
13
|
+
for (let next = refOf(schema); next !== void 0 && !seen.has(next); ) {
|
|
14
|
+
seen.add(next);
|
|
15
|
+
declared = { schema: context.refs.resolve(next), path: next };
|
|
16
|
+
next = refOf(declared.schema);
|
|
17
|
+
}
|
|
18
|
+
return declared;
|
|
19
|
+
}
|
|
20
|
+
function declaredObjectType(entry, context) {
|
|
21
|
+
const { original, resolved } = entry;
|
|
22
|
+
const schemaRef = refOf(resolved.schema);
|
|
23
|
+
if (schemaRef !== void 0) {
|
|
24
|
+
const { schema, path } = declaredSchema(resolved.schema, schemaRef, context);
|
|
25
|
+
return schemaTransform.transformSchema(schema, { path, schema }, context);
|
|
26
|
+
}
|
|
27
|
+
const parameterRef = refOf(original);
|
|
28
|
+
return parameterRef === void 0 ? null : schemaTransform.transformSchema(resolved.schema, { path: parameterRef, schema: resolved }, context);
|
|
29
|
+
}
|
|
30
|
+
function isIndexSignature(member) {
|
|
31
|
+
return member.kind === "indexSignature";
|
|
32
|
+
}
|
|
33
|
+
function hasIndexSignature(type) {
|
|
34
|
+
switch (type.kind) {
|
|
35
|
+
case "object":
|
|
36
|
+
return type.members.some(isIndexSignature);
|
|
37
|
+
case "union":
|
|
38
|
+
case "intersection":
|
|
39
|
+
return type.types.some(hasIndexSignature);
|
|
40
|
+
default:
|
|
41
|
+
return false;
|
|
42
|
+
}
|
|
43
|
+
}
|
|
44
|
+
function widenedMember(member, values) {
|
|
45
|
+
const isUnknown = member.type.kind === "keyword" && member.type.keyword === "unknown";
|
|
46
|
+
return isIndexSignature(member) && !isUnknown ? { ...member, type: typeCombinators.unionOf([member.type, ...values]) } : member;
|
|
47
|
+
}
|
|
48
|
+
function withIndexValues(type, values) {
|
|
49
|
+
switch (type.kind) {
|
|
50
|
+
case "object":
|
|
51
|
+
return { ...type, members: type.members.map((member) => widenedMember(member, values)) };
|
|
52
|
+
case "union":
|
|
53
|
+
case "intersection":
|
|
54
|
+
return { ...type, types: type.types.map((member) => withIndexValues(member, values)) };
|
|
55
|
+
default:
|
|
56
|
+
return type;
|
|
57
|
+
}
|
|
58
|
+
}
|
|
59
|
+
|
|
60
|
+
exports.declaredObjectType = declaredObjectType;
|
|
61
|
+
exports.hasIndexSignature = hasIndexSignature;
|
|
62
|
+
exports.withIndexValues = withIndexValues;
|
|
63
|
+
//# sourceMappingURL=exploded-query-values.cjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"exploded-query-values.cjs","sources":["../../../../src/application/transform/document/exploded-query-values.ts"],"sourcesContent":["import type { IrMember, IrType } from \"../../../domain/ir/nodes.js\";\nimport type { Schema } from \"../../../domain/openapi/schema-object.js\";\nimport { transformSchema } from \"../schema/schema-transform.js\";\nimport type { TransformContext } from \"../transform-context.js\";\nimport { unionOf } from \"../type-combinators.js\";\nimport type { ResolvedEntry } from \"./parameter-entries.js\";\n\n/**\n * `exploded-query-objects` and index signatures. The keys of an exploded object are keys of\n * `query`, next to the other parameters. TypeScript checks an index signature against every key\n * of a value, so `{ page?: number } & { [key: string]: string }` admits no `page`, and no value\n * with another parameter at all. An index signature of an exploded object therefore also takes\n * the value types of the other keys of `query`: those keys carry their own values.\n */\n\nfunction refOf(value: unknown): string | undefined {\n const ref = (value as { $ref?: unknown } | undefined)?.$ref;\n return typeof ref === \"string\" ? ref : undefined;\n}\n\n/** A schema `$ref` chain followed to its end, with the pointer where that schema is declared. */\nfunction declaredSchema(schema: Schema | undefined, ref: string, context: TransformContext) {\n let declared = { schema, path: ref };\n const seen = new Set<string>();\n for (let next = refOf(schema); next !== undefined && !seen.has(next); ) {\n seen.add(next);\n declared = { schema: context.refs.resolve(next) as Schema | undefined, path: next };\n next = refOf(declared.schema);\n }\n return declared;\n}\n\n/**\n * The type of an exploded parameter whose own type is a reference (its `$ref`, or the `$ref` of\n * its schema), written out where its schema is declared: the index signature of a referenced type\n * cannot be changed. The location is the one `components` types it at, so the enums it declares\n * are the ones the reference names. Null when no `$ref` is involved.\n */\nexport function declaredObjectType(entry: ResolvedEntry, context: TransformContext): IrType | null {\n const { original, resolved } = entry;\n const schemaRef = refOf(resolved.schema);\n if (schemaRef !== undefined) {\n const { schema, path } = declaredSchema(resolved.schema, schemaRef, context);\n return transformSchema(schema, { path, schema }, context);\n }\n const parameterRef = refOf(original);\n return parameterRef === undefined\n ? null\n : transformSchema(resolved.schema, { path: parameterRef, schema: resolved }, context);\n}\n\nfunction isIndexSignature(member: IrMember): boolean {\n return member.kind === \"indexSignature\";\n}\n\n/** Whether the type has an index signature in its objects, through unions and intersections. */\nexport function hasIndexSignature(type: IrType): boolean {\n switch (type.kind) {\n case \"object\":\n return type.members.some(isIndexSignature);\n case \"union\":\n case \"intersection\":\n return type.types.some(hasIndexSignature);\n default:\n return false;\n }\n}\n\nfunction widenedMember(member: IrMember, values: readonly IrType[]): IrMember {\n // `unknown` takes every value already.\n const isUnknown = member.type.kind === \"keyword\" && member.type.keyword === \"unknown\";\n return isIndexSignature(member) && !isUnknown\n ? { ...member, type: unionOf([member.type, ...values]) }\n : member;\n}\n\n/** The type with the values added to each index signature of its objects. */\nexport function withIndexValues(type: IrType, values: readonly IrType[]): IrType {\n switch (type.kind) {\n case \"object\":\n return { ...type, members: type.members.map((member) => widenedMember(member, values)) };\n case \"union\":\n case \"intersection\":\n return { ...type, types: type.types.map((member) => withIndexValues(member, values)) };\n default:\n return type;\n }\n}\n"],"names":["transformSchema","unionOf"],"mappings":"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"}
|
|
@@ -0,0 +1,59 @@
|
|
|
1
|
+
import { transformSchema } from '../schema/schema-transform.mjs';
|
|
2
|
+
import { unionOf } from '../type-combinators.mjs';
|
|
3
|
+
|
|
4
|
+
function refOf(value) {
|
|
5
|
+
const ref = value?.$ref;
|
|
6
|
+
return typeof ref === "string" ? ref : void 0;
|
|
7
|
+
}
|
|
8
|
+
function declaredSchema(schema, ref, context) {
|
|
9
|
+
let declared = { schema, path: ref };
|
|
10
|
+
const seen = /* @__PURE__ */ new Set();
|
|
11
|
+
for (let next = refOf(schema); next !== void 0 && !seen.has(next); ) {
|
|
12
|
+
seen.add(next);
|
|
13
|
+
declared = { schema: context.refs.resolve(next), path: next };
|
|
14
|
+
next = refOf(declared.schema);
|
|
15
|
+
}
|
|
16
|
+
return declared;
|
|
17
|
+
}
|
|
18
|
+
function declaredObjectType(entry, context) {
|
|
19
|
+
const { original, resolved } = entry;
|
|
20
|
+
const schemaRef = refOf(resolved.schema);
|
|
21
|
+
if (schemaRef !== void 0) {
|
|
22
|
+
const { schema, path } = declaredSchema(resolved.schema, schemaRef, context);
|
|
23
|
+
return transformSchema(schema, { path, schema }, context);
|
|
24
|
+
}
|
|
25
|
+
const parameterRef = refOf(original);
|
|
26
|
+
return parameterRef === void 0 ? null : transformSchema(resolved.schema, { path: parameterRef, schema: resolved }, context);
|
|
27
|
+
}
|
|
28
|
+
function isIndexSignature(member) {
|
|
29
|
+
return member.kind === "indexSignature";
|
|
30
|
+
}
|
|
31
|
+
function hasIndexSignature(type) {
|
|
32
|
+
switch (type.kind) {
|
|
33
|
+
case "object":
|
|
34
|
+
return type.members.some(isIndexSignature);
|
|
35
|
+
case "union":
|
|
36
|
+
case "intersection":
|
|
37
|
+
return type.types.some(hasIndexSignature);
|
|
38
|
+
default:
|
|
39
|
+
return false;
|
|
40
|
+
}
|
|
41
|
+
}
|
|
42
|
+
function widenedMember(member, values) {
|
|
43
|
+
const isUnknown = member.type.kind === "keyword" && member.type.keyword === "unknown";
|
|
44
|
+
return isIndexSignature(member) && !isUnknown ? { ...member, type: unionOf([member.type, ...values]) } : member;
|
|
45
|
+
}
|
|
46
|
+
function withIndexValues(type, values) {
|
|
47
|
+
switch (type.kind) {
|
|
48
|
+
case "object":
|
|
49
|
+
return { ...type, members: type.members.map((member) => widenedMember(member, values)) };
|
|
50
|
+
case "union":
|
|
51
|
+
case "intersection":
|
|
52
|
+
return { ...type, types: type.types.map((member) => withIndexValues(member, values)) };
|
|
53
|
+
default:
|
|
54
|
+
return type;
|
|
55
|
+
}
|
|
56
|
+
}
|
|
57
|
+
|
|
58
|
+
export { declaredObjectType, hasIndexSignature, withIndexValues };
|
|
59
|
+
//# sourceMappingURL=exploded-query-values.mjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"exploded-query-values.mjs","sources":["../../../../src/application/transform/document/exploded-query-values.ts"],"sourcesContent":["import type { IrMember, IrType } from \"../../../domain/ir/nodes.js\";\nimport type { Schema } from \"../../../domain/openapi/schema-object.js\";\nimport { transformSchema } from \"../schema/schema-transform.js\";\nimport type { TransformContext } from \"../transform-context.js\";\nimport { unionOf } from \"../type-combinators.js\";\nimport type { ResolvedEntry } from \"./parameter-entries.js\";\n\n/**\n * `exploded-query-objects` and index signatures. The keys of an exploded object are keys of\n * `query`, next to the other parameters. TypeScript checks an index signature against every key\n * of a value, so `{ page?: number } & { [key: string]: string }` admits no `page`, and no value\n * with another parameter at all. An index signature of an exploded object therefore also takes\n * the value types of the other keys of `query`: those keys carry their own values.\n */\n\nfunction refOf(value: unknown): string | undefined {\n const ref = (value as { $ref?: unknown } | undefined)?.$ref;\n return typeof ref === \"string\" ? ref : undefined;\n}\n\n/** A schema `$ref` chain followed to its end, with the pointer where that schema is declared. */\nfunction declaredSchema(schema: Schema | undefined, ref: string, context: TransformContext) {\n let declared = { schema, path: ref };\n const seen = new Set<string>();\n for (let next = refOf(schema); next !== undefined && !seen.has(next); ) {\n seen.add(next);\n declared = { schema: context.refs.resolve(next) as Schema | undefined, path: next };\n next = refOf(declared.schema);\n }\n return declared;\n}\n\n/**\n * The type of an exploded parameter whose own type is a reference (its `$ref`, or the `$ref` of\n * its schema), written out where its schema is declared: the index signature of a referenced type\n * cannot be changed. The location is the one `components` types it at, so the enums it declares\n * are the ones the reference names. Null when no `$ref` is involved.\n */\nexport function declaredObjectType(entry: ResolvedEntry, context: TransformContext): IrType | null {\n const { original, resolved } = entry;\n const schemaRef = refOf(resolved.schema);\n if (schemaRef !== undefined) {\n const { schema, path } = declaredSchema(resolved.schema, schemaRef, context);\n return transformSchema(schema, { path, schema }, context);\n }\n const parameterRef = refOf(original);\n return parameterRef === undefined\n ? null\n : transformSchema(resolved.schema, { path: parameterRef, schema: resolved }, context);\n}\n\nfunction isIndexSignature(member: IrMember): boolean {\n return member.kind === \"indexSignature\";\n}\n\n/** Whether the type has an index signature in its objects, through unions and intersections. */\nexport function hasIndexSignature(type: IrType): boolean {\n switch (type.kind) {\n case \"object\":\n return type.members.some(isIndexSignature);\n case \"union\":\n case \"intersection\":\n return type.types.some(hasIndexSignature);\n default:\n return false;\n }\n}\n\nfunction widenedMember(member: IrMember, values: readonly IrType[]): IrMember {\n // `unknown` takes every value already.\n const isUnknown = member.type.kind === \"keyword\" && member.type.keyword === \"unknown\";\n return isIndexSignature(member) && !isUnknown\n ? { ...member, type: unionOf([member.type, ...values]) }\n : member;\n}\n\n/** The type with the values added to each index signature of its objects. */\nexport function withIndexValues(type: IrType, values: readonly IrType[]): IrType {\n switch (type.kind) {\n case \"object\":\n return { ...type, members: type.members.map((member) => widenedMember(member, values)) };\n case \"union\":\n case \"intersection\":\n return { ...type, types: type.types.map((member) => withIndexValues(member, values)) };\n default:\n return type;\n }\n}\n"],"names":[],"mappings":"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"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"global-type-references.cjs","sources":["../../../../src/application/transform/document/global-type-references.ts"],"sourcesContent":["import type { IrDeclaration } from \"../../../domain/ir/nodes.js\";\n\n/**\n * The TypeScript global types that generated code can refer to: in references (`Record<string,\n * never>`, `Omit<…>`, the `Blob` of `--binary-as-blob`) and in the text of footer helpers\n * (`Exclude<…>`, `Readonly<…>`). A module declaration of the same name shadows the global: every\n * use of it then fails to compile, or silently names the module's type (`Blob`).\n */\
|
|
1
|
+
{"version":3,"file":"global-type-references.cjs","sources":["../../../../src/application/transform/document/global-type-references.ts"],"sourcesContent":["import type { IrDeclaration } from \"../../../domain/ir/nodes.js\";\n\n/**\n * The TypeScript global types that generated code can refer to: in references (`Record<string,\n * never>`, `Omit<…>`, the `Blob` of `--binary-as-blob`) and in the text of footer helpers\n * (`Exclude<…>`, `Readonly<…>`). A module declaration of the same name shadows the global: every\n * use of it then fails to compile, or silently names the module's type (`Blob`).\n */\nexport const GLOBAL_TYPE_NAMES: ReadonlySet<string> = new Set([\n \"Array\",\n \"Blob\",\n \"Exclude\",\n \"Extract\",\n \"NonNullable\",\n \"Omit\",\n \"Partial\",\n \"Pick\",\n \"Readonly\",\n \"ReadonlyArray\",\n \"Record\",\n \"Required\",\n]);\n\nconst GENERIC_USE = /\\b([A-Z][A-Za-z]*)\\s*</g;\n\n/** `origin` holds the outside node a raw type was printed from; it is not part of the output. */\nconst SKIPPED_KEYS: ReadonlySet<string> = new Set([\"origin\", \"comments\"]);\n\nfunction isObject(value: unknown): value is Readonly<Record<string, unknown>> {\n return typeof value === \"object\" && value !== null;\n}\n\nfunction addTextUses(text: string, used: Set<string>): void {\n for (const match of text.matchAll(GENERIC_USE)) {\n const name = match[1] ?? \"\";\n if (GLOBAL_TYPE_NAMES.has(name)) {\n used.add(name);\n }\n }\n}\n\nfunction addNodeUses(node: Readonly<Record<string, unknown>>, used: Set<string>): void {\n if (node.kind === \"reference\" && typeof node.name === \"string\") {\n if (GLOBAL_TYPE_NAMES.has(node.name)) {\n used.add(node.name);\n }\n } else if (\n (node.kind === \"raw\" || node.kind === \"rawDeclaration\") &&\n typeof node.text === \"string\"\n ) {\n addTextUses(node.text, used);\n }\n}\n\nfunction visit(value: unknown, used: Set<string>): void {\n if (Array.isArray(value)) {\n for (const item of value) {\n visit(item, used);\n }\n return;\n }\n if (!isObject(value)) {\n return;\n }\n addNodeUses(value, used);\n for (const [key, child] of Object.entries(value)) {\n if (!SKIPPED_KEYS.has(key)) {\n visit(child, used);\n }\n }\n}\n\n/** The TypeScript global type names that the declarations refer to. */\nexport function globalTypeReferences(declarations: readonly IrDeclaration[]): Set<string> {\n const used = new Set<string>();\n visit(declarations, used);\n return used;\n}\n"],"names":[],"mappings":";;AAQO,MAAM,iBAAA,uBAA6C,GAAA,CAAI;AAAA,EAC5D,OAAA;AAAA,EACA,MAAA;AAAA,EACA,SAAA;AAAA,EACA,SAAA;AAAA,EACA,aAAA;AAAA,EACA,MAAA;AAAA,EACA,SAAA;AAAA,EACA,MAAA;AAAA,EACA,UAAA;AAAA,EACA,eAAA;AAAA,EACA,QAAA;AAAA,EACA;AACF,CAAC;AAED,MAAM,WAAA,GAAc,yBAAA;AAGpB,MAAM,+BAAoC,IAAI,GAAA,CAAI,CAAC,QAAA,EAAU,UAAU,CAAC,CAAA;AAExE,SAAS,SAAS,KAAA,EAA4D;AAC5E,EAAA,OAAO,OAAO,KAAA,KAAU,QAAA,IAAY,KAAA,KAAU,IAAA;AAChD;AAEA,SAAS,WAAA,CAAY,MAAc,IAAA,EAAyB;AAC1D,EAAA,KAAA,MAAW,KAAA,IAAS,IAAA,CAAK,QAAA,CAAS,WAAW,CAAA,EAAG;AAC9C,IAAA,MAAM,IAAA,GAAO,KAAA,CAAM,CAAC,CAAA,IAAK,EAAA;AACzB,IAAA,IAAI,iBAAA,CAAkB,GAAA,CAAI,IAAI,CAAA,EAAG;AAC/B,MAAA,IAAA,CAAK,IAAI,IAAI,CAAA;AAAA,IACf;AAAA,EACF;AACF;AAEA,SAAS,WAAA,CAAY,MAAyC,IAAA,EAAyB;AACrF,EAAA,IAAI,KAAK,IAAA,KAAS,WAAA,IAAe,OAAO,IAAA,CAAK,SAAS,QAAA,EAAU;AAC9D,IAAA,IAAI,iBAAA,CAAkB,GAAA,CAAI,IAAA,CAAK,IAAI,CAAA,EAAG;AACpC,MAAA,IAAA,CAAK,GAAA,CAAI,KAAK,IAAI,CAAA;AAAA,IACpB;AAAA,EACF,CAAA,MAAA,IAAA,CACG,IAAA,CAAK,IAAA,KAAS,KAAA,IAAS,IAAA,CAAK,SAAS,gBAAA,KACtC,OAAO,IAAA,CAAK,IAAA,KAAS,QAAA,EACrB;AACA,IAAA,WAAA,CAAY,IAAA,CAAK,MAAM,IAAI,CAAA;AAAA,EAC7B;AACF;AAEA,SAAS,KAAA,CAAM,OAAgB,IAAA,EAAyB;AACtD,EAAA,IAAI,KAAA,CAAM,OAAA,CAAQ,KAAK,CAAA,EAAG;AACxB,IAAA,KAAA,MAAW,QAAQ,KAAA,EAAO;AACxB,MAAA,KAAA,CAAM,MAAM,IAAI,CAAA;AAAA,IAClB;AACA,IAAA;AAAA,EACF;AACA,EAAA,IAAI,CAAC,QAAA,CAAS,KAAK,CAAA,EAAG;AACpB,IAAA;AAAA,EACF;AACA,EAAA,WAAA,CAAY,OAAO,IAAI,CAAA;AACvB,EAAA,KAAA,MAAW,CAAC,GAAA,EAAK,KAAK,KAAK,MAAA,CAAO,OAAA,CAAQ,KAAK,CAAA,EAAG;AAChD,IAAA,IAAI,CAAC,YAAA,CAAa,GAAA,CAAI,GAAG,CAAA,EAAG;AAC1B,MAAA,KAAA,CAAM,OAAO,IAAI,CAAA;AAAA,IACnB;AAAA,EACF;AACF;AAGO,SAAS,qBAAqB,YAAA,EAAqD;AACxF,EAAA,MAAM,IAAA,uBAAW,GAAA,EAAY;AAC7B,EAAA,KAAA,CAAM,cAAc,IAAI,CAAA;AACxB,EAAA,OAAO,IAAA;AACT;;;"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"global-type-references.mjs","sources":["../../../../src/application/transform/document/global-type-references.ts"],"sourcesContent":["import type { IrDeclaration } from \"../../../domain/ir/nodes.js\";\n\n/**\n * The TypeScript global types that generated code can refer to: in references (`Record<string,\n * never>`, `Omit<…>`, the `Blob` of `--binary-as-blob`) and in the text of footer helpers\n * (`Exclude<…>`, `Readonly<…>`). A module declaration of the same name shadows the global: every\n * use of it then fails to compile, or silently names the module's type (`Blob`).\n */\
|
|
1
|
+
{"version":3,"file":"global-type-references.mjs","sources":["../../../../src/application/transform/document/global-type-references.ts"],"sourcesContent":["import type { IrDeclaration } from \"../../../domain/ir/nodes.js\";\n\n/**\n * The TypeScript global types that generated code can refer to: in references (`Record<string,\n * never>`, `Omit<…>`, the `Blob` of `--binary-as-blob`) and in the text of footer helpers\n * (`Exclude<…>`, `Readonly<…>`). A module declaration of the same name shadows the global: every\n * use of it then fails to compile, or silently names the module's type (`Blob`).\n */\nexport const GLOBAL_TYPE_NAMES: ReadonlySet<string> = new Set([\n \"Array\",\n \"Blob\",\n \"Exclude\",\n \"Extract\",\n \"NonNullable\",\n \"Omit\",\n \"Partial\",\n \"Pick\",\n \"Readonly\",\n \"ReadonlyArray\",\n \"Record\",\n \"Required\",\n]);\n\nconst GENERIC_USE = /\\b([A-Z][A-Za-z]*)\\s*</g;\n\n/** `origin` holds the outside node a raw type was printed from; it is not part of the output. */\nconst SKIPPED_KEYS: ReadonlySet<string> = new Set([\"origin\", \"comments\"]);\n\nfunction isObject(value: unknown): value is Readonly<Record<string, unknown>> {\n return typeof value === \"object\" && value !== null;\n}\n\nfunction addTextUses(text: string, used: Set<string>): void {\n for (const match of text.matchAll(GENERIC_USE)) {\n const name = match[1] ?? \"\";\n if (GLOBAL_TYPE_NAMES.has(name)) {\n used.add(name);\n }\n }\n}\n\nfunction addNodeUses(node: Readonly<Record<string, unknown>>, used: Set<string>): void {\n if (node.kind === \"reference\" && typeof node.name === \"string\") {\n if (GLOBAL_TYPE_NAMES.has(node.name)) {\n used.add(node.name);\n }\n } else if (\n (node.kind === \"raw\" || node.kind === \"rawDeclaration\") &&\n typeof node.text === \"string\"\n ) {\n addTextUses(node.text, used);\n }\n}\n\nfunction visit(value: unknown, used: Set<string>): void {\n if (Array.isArray(value)) {\n for (const item of value) {\n visit(item, used);\n }\n return;\n }\n if (!isObject(value)) {\n return;\n }\n addNodeUses(value, used);\n for (const [key, child] of Object.entries(value)) {\n if (!SKIPPED_KEYS.has(key)) {\n visit(child, used);\n }\n }\n}\n\n/** The TypeScript global type names that the declarations refer to. */\nexport function globalTypeReferences(declarations: readonly IrDeclaration[]): Set<string> {\n const used = new Set<string>();\n visit(declarations, used);\n return used;\n}\n"],"names":[],"mappings":"AAQO,MAAM,iBAAA,uBAA6C,GAAA,CAAI;AAAA,EAC5D,OAAA;AAAA,EACA,MAAA;AAAA,EACA,SAAA;AAAA,EACA,SAAA;AAAA,EACA,aAAA;AAAA,EACA,MAAA;AAAA,EACA,SAAA;AAAA,EACA,MAAA;AAAA,EACA,UAAA;AAAA,EACA,eAAA;AAAA,EACA,QAAA;AAAA,EACA;AACF,CAAC;AAED,MAAM,WAAA,GAAc,yBAAA;AAGpB,MAAM,+BAAoC,IAAI,GAAA,CAAI,CAAC,QAAA,EAAU,UAAU,CAAC,CAAA;AAExE,SAAS,SAAS,KAAA,EAA4D;AAC5E,EAAA,OAAO,OAAO,KAAA,KAAU,QAAA,IAAY,KAAA,KAAU,IAAA;AAChD;AAEA,SAAS,WAAA,CAAY,MAAc,IAAA,EAAyB;AAC1D,EAAA,KAAA,MAAW,KAAA,IAAS,IAAA,CAAK,QAAA,CAAS,WAAW,CAAA,EAAG;AAC9C,IAAA,MAAM,IAAA,GAAO,KAAA,CAAM,CAAC,CAAA,IAAK,EAAA;AACzB,IAAA,IAAI,iBAAA,CAAkB,GAAA,CAAI,IAAI,CAAA,EAAG;AAC/B,MAAA,IAAA,CAAK,IAAI,IAAI,CAAA;AAAA,IACf;AAAA,EACF;AACF;AAEA,SAAS,WAAA,CAAY,MAAyC,IAAA,EAAyB;AACrF,EAAA,IAAI,KAAK,IAAA,KAAS,WAAA,IAAe,OAAO,IAAA,CAAK,SAAS,QAAA,EAAU;AAC9D,IAAA,IAAI,iBAAA,CAAkB,GAAA,CAAI,IAAA,CAAK,IAAI,CAAA,EAAG;AACpC,MAAA,IAAA,CAAK,GAAA,CAAI,KAAK,IAAI,CAAA;AAAA,IACpB;AAAA,EACF,CAAA,MAAA,IAAA,CACG,IAAA,CAAK,IAAA,KAAS,KAAA,IAAS,IAAA,CAAK,SAAS,gBAAA,KACtC,OAAO,IAAA,CAAK,IAAA,KAAS,QAAA,EACrB;AACA,IAAA,WAAA,CAAY,IAAA,CAAK,MAAM,IAAI,CAAA;AAAA,EAC7B;AACF;AAEA,SAAS,KAAA,CAAM,OAAgB,IAAA,EAAyB;AACtD,EAAA,IAAI,KAAA,CAAM,OAAA,CAAQ,KAAK,CAAA,EAAG;AACxB,IAAA,KAAA,MAAW,QAAQ,KAAA,EAAO;AACxB,MAAA,KAAA,CAAM,MAAM,IAAI,CAAA;AAAA,IAClB;AACA,IAAA;AAAA,EACF;AACA,EAAA,IAAI,CAAC,QAAA,CAAS,KAAK,CAAA,EAAG;AACpB,IAAA;AAAA,EACF;AACA,EAAA,WAAA,CAAY,OAAO,IAAI,CAAA;AACvB,EAAA,KAAA,MAAW,CAAC,GAAA,EAAK,KAAK,KAAK,MAAA,CAAO,OAAA,CAAQ,KAAK,CAAA,EAAG;AAChD,IAAA,IAAI,CAAC,YAAA,CAAa,GAAA,CAAI,GAAG,CAAA,EAAG;AAC1B,MAAA,KAAA,CAAM,OAAO,IAAI,CAAA;AAAA,IACnB;AAAA,EACF;AACF;AAGO,SAAS,qBAAqB,YAAA,EAAqD;AACxF,EAAA,MAAM,IAAA,uBAAW,GAAA,EAAY;AAC7B,EAAA,KAAA,CAAM,cAAc,IAAI,CAAA;AACxB,EAAA,OAAO,IAAA;AACT;;"}
|
|
@@ -2,11 +2,12 @@
|
|
|
2
2
|
|
|
3
3
|
const constructors = require('../../../domain/ir/constructors.cjs');
|
|
4
4
|
const jsonPointer = require('../../../domain/openapi/json-pointer.cjs');
|
|
5
|
+
const outputFixes = require('../../../domain/output-fixes.cjs');
|
|
5
6
|
const documentEntries = require('../document-entries.cjs');
|
|
6
7
|
const schemaTransform = require('../schema/schema-transform.cjs');
|
|
7
8
|
const sharedTypes = require('../shared-types.cjs');
|
|
8
9
|
const documentMember = require('./document-member.cjs');
|
|
9
|
-
const mediaType = require('./media-type.cjs');
|
|
10
|
+
const mediaType$1 = require('./media-type.cjs');
|
|
10
11
|
|
|
11
12
|
function headerType(header, location, context) {
|
|
12
13
|
if (header.schema) {
|
|
@@ -15,13 +16,20 @@ function headerType(header, location, context) {
|
|
|
15
16
|
if (!header.content) {
|
|
16
17
|
return sharedTypes.UNKNOWN_TYPE;
|
|
17
18
|
}
|
|
19
|
+
if (context.options.fixes.has(outputFixes.FIX.PARAMETER_HEADER_CONTENT)) {
|
|
20
|
+
const first = Object.entries(header.content)[0];
|
|
21
|
+
return first === void 0 ? sharedTypes.UNKNOWN_TYPE : mediaType(...first, location, context);
|
|
22
|
+
}
|
|
18
23
|
const members = documentEntries.documentEntries(header.content, context.options).map(([contentType, entry]) => {
|
|
19
|
-
const
|
|
20
|
-
const type = mediaType.contentEntryType(entry, { ...location, path }, context);
|
|
24
|
+
const type = mediaType(contentType, entry, location, context);
|
|
21
25
|
return documentMember.documentMember(contentType, type, entry, { isReadonly: context.options.immutable });
|
|
22
26
|
});
|
|
23
27
|
return constructors.irObject(members);
|
|
24
28
|
}
|
|
29
|
+
function mediaType(contentType, entry, location, context) {
|
|
30
|
+
const path = `${location.path ?? "#"}/${jsonPointer.escapePointerSegment(contentType)}`;
|
|
31
|
+
return mediaType$1.contentEntryType(entry, { ...location, path }, context);
|
|
32
|
+
}
|
|
25
33
|
|
|
26
34
|
exports.headerType = headerType;
|
|
27
35
|
//# sourceMappingURL=header.cjs.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"header.cjs","sources":["../../../../src/application/transform/document/header.ts"],"sourcesContent":["import { irObject } from \"../../../domain/ir/constructors.js\";\nimport type { IrType } from \"../../../domain/ir/nodes.js\";\nimport type { HeaderObject } from \"../../../domain/openapi/header-object.js\";\nimport { escapePointerSegment } from \"../../../domain/openapi/json-pointer.js\";\nimport { documentEntries } from \"../document-entries.js\";\nimport type { SchemaContext, SchemaLocation } from \"../schema/schema-context.js\";\nimport { transformSchema } from \"../schema/schema-transform.js\";\nimport { UNKNOWN_TYPE } from \"../shared-types.js\";\nimport { documentMember } from \"./document-member.js\";\nimport { contentEntryType } from \"./media-type.js\";\n\n/**\n * A header's type (OpenAPI 3.1 §4.8.21): its schema, else an object with one property per media\n * type
|
|
1
|
+
{"version":3,"file":"header.cjs","sources":["../../../../src/application/transform/document/header.ts"],"sourcesContent":["import { irObject } from \"../../../domain/ir/constructors.js\";\nimport type { IrType } from \"../../../domain/ir/nodes.js\";\nimport type { HeaderObject } from \"../../../domain/openapi/header-object.js\";\nimport { escapePointerSegment } from \"../../../domain/openapi/json-pointer.js\";\nimport type { ContentMap } from \"../../../domain/openapi/media-type-object.js\";\nimport { FIX } from \"../../../domain/output-fixes.js\";\nimport { documentEntries } from \"../document-entries.js\";\nimport type { SchemaContext, SchemaLocation } from \"../schema/schema-context.js\";\nimport { transformSchema } from \"../schema/schema-transform.js\";\nimport { UNKNOWN_TYPE } from \"../shared-types.js\";\nimport { documentMember } from \"./document-member.js\";\nimport { contentEntryType } from \"./media-type.js\";\n\n/**\n * A header's type (OpenAPI 3.1 §4.8.21): its schema, else the type of its `content`, else\n * `unknown`. `content` holds one media type whose schema describes the value; the original typed\n * it as an object with one property per media type, which the `parameter-header-content` fix\n * replaces by the media type's type, as for a parameter.\n */\nexport function headerType(\n header: HeaderObject,\n location: SchemaLocation,\n context: SchemaContext,\n): IrType {\n if (header.schema) {\n return transformSchema(header.schema, location, context);\n }\n if (!header.content) {\n return UNKNOWN_TYPE;\n }\n if (context.options.fixes.has(FIX.PARAMETER_HEADER_CONTENT)) {\n // The first media type in document order, as for a parameter: `--alphabetize` sorts only\n // the members it writes.\n const first = Object.entries(header.content)[0];\n return first === undefined ? UNKNOWN_TYPE : mediaType(...first, location, context);\n }\n const members = documentEntries(header.content, context.options).map(([contentType, entry]) => {\n const type = mediaType(contentType, entry, location, context);\n return documentMember(contentType, type, entry, { isReadonly: context.options.immutable });\n });\n return irObject(members);\n}\n\n/** The type of one media type of a header, at the path the original gave it. */\nfunction mediaType(\n contentType: string,\n entry: ContentMap[string],\n location: SchemaLocation,\n context: SchemaContext,\n): IrType {\n // Unlike other content maps, the original joins this path by hand: a missing path is `#`.\n const path = `${location.path ?? \"#\"}/${escapePointerSegment(contentType)}`;\n return contentEntryType(entry, { ...location, path }, context);\n}\n"],"names":["transformSchema","UNKNOWN_TYPE","FIX","documentEntries","documentMember","irObject","escapePointerSegment","contentEntryType"],"mappings":";;;;;;;;;;;AAmBO,SAAS,UAAA,CACd,MAAA,EACA,QAAA,EACA,OAAA,EACQ;AACR,EAAA,IAAI,OAAO,MAAA,EAAQ;AACjB,IAAA,OAAOA,+BAAA,CAAgB,MAAA,CAAO,MAAA,EAAQ,QAAA,EAAU,OAAO,CAAA;AAAA,EACzD;AACA,EAAA,IAAI,CAAC,OAAO,OAAA,EAAS;AACnB,IAAA,OAAOC,wBAAA;AAAA,EACT;AACA,EAAA,IAAI,QAAQ,OAAA,CAAQ,KAAA,CAAM,GAAA,CAAIC,eAAA,CAAI,wBAAwB,CAAA,EAAG;AAG3D,IAAA,MAAM,QAAQ,MAAA,CAAO,OAAA,CAAQ,MAAA,CAAO,OAAO,EAAE,CAAC,CAAA;AAC9C,IAAA,OAAO,UAAU,MAAA,GAAYD,wBAAA,GAAe,UAAU,GAAG,KAAA,EAAO,UAAU,OAAO,CAAA;AAAA,EACnF;AACA,EAAA,MAAM,OAAA,GAAUE,+BAAA,CAAgB,MAAA,CAAO,OAAA,EAAS,OAAA,CAAQ,OAAO,CAAA,CAAE,GAAA,CAAI,CAAC,CAAC,WAAA,EAAa,KAAK,CAAA,KAAM;AAC7F,IAAA,MAAM,IAAA,GAAO,SAAA,CAAU,WAAA,EAAa,KAAA,EAAO,UAAU,OAAO,CAAA;AAC5D,IAAA,OAAOC,6BAAA,CAAe,aAAa,IAAA,EAAM,KAAA,EAAO,EAAE,UAAA,EAAY,OAAA,CAAQ,OAAA,CAAQ,SAAA,EAAW,CAAA;AAAA,EAC3F,CAAC,CAAA;AACD,EAAA,OAAOC,sBAAS,OAAO,CAAA;AACzB;AAGA,SAAS,SAAA,CACP,WAAA,EACA,KAAA,EACA,QAAA,EACA,OAAA,EACQ;AAER,EAAA,MAAM,IAAA,GAAO,GAAG,QAAA,CAAS,IAAA,IAAQ,GAAG,CAAA,CAAA,EAAIC,gCAAA,CAAqB,WAAW,CAAC,CAAA,CAAA;AACzE,EAAA,OAAOC,6BAAiB,KAAA,EAAO,EAAE,GAAG,QAAA,EAAU,IAAA,IAAQ,OAAO,CAAA;AAC/D;;"}
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import { irObject } from '../../../domain/ir/constructors.mjs';
|
|
2
2
|
import { escapePointerSegment } from '../../../domain/openapi/json-pointer.mjs';
|
|
3
|
+
import { FIX } from '../../../domain/output-fixes.mjs';
|
|
3
4
|
import { documentEntries } from '../document-entries.mjs';
|
|
4
5
|
import { transformSchema } from '../schema/schema-transform.mjs';
|
|
5
6
|
import { UNKNOWN_TYPE } from '../shared-types.mjs';
|
|
@@ -13,13 +14,20 @@ function headerType(header, location, context) {
|
|
|
13
14
|
if (!header.content) {
|
|
14
15
|
return UNKNOWN_TYPE;
|
|
15
16
|
}
|
|
17
|
+
if (context.options.fixes.has(FIX.PARAMETER_HEADER_CONTENT)) {
|
|
18
|
+
const first = Object.entries(header.content)[0];
|
|
19
|
+
return first === void 0 ? UNKNOWN_TYPE : mediaType(...first, location, context);
|
|
20
|
+
}
|
|
16
21
|
const members = documentEntries(header.content, context.options).map(([contentType, entry]) => {
|
|
17
|
-
const
|
|
18
|
-
const type = contentEntryType(entry, { ...location, path }, context);
|
|
22
|
+
const type = mediaType(contentType, entry, location, context);
|
|
19
23
|
return documentMember(contentType, type, entry, { isReadonly: context.options.immutable });
|
|
20
24
|
});
|
|
21
25
|
return irObject(members);
|
|
22
26
|
}
|
|
27
|
+
function mediaType(contentType, entry, location, context) {
|
|
28
|
+
const path = `${location.path ?? "#"}/${escapePointerSegment(contentType)}`;
|
|
29
|
+
return contentEntryType(entry, { ...location, path }, context);
|
|
30
|
+
}
|
|
23
31
|
|
|
24
32
|
export { headerType };
|
|
25
33
|
//# sourceMappingURL=header.mjs.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"header.mjs","sources":["../../../../src/application/transform/document/header.ts"],"sourcesContent":["import { irObject } from \"../../../domain/ir/constructors.js\";\nimport type { IrType } from \"../../../domain/ir/nodes.js\";\nimport type { HeaderObject } from \"../../../domain/openapi/header-object.js\";\nimport { escapePointerSegment } from \"../../../domain/openapi/json-pointer.js\";\nimport { documentEntries } from \"../document-entries.js\";\nimport type { SchemaContext, SchemaLocation } from \"../schema/schema-context.js\";\nimport { transformSchema } from \"../schema/schema-transform.js\";\nimport { UNKNOWN_TYPE } from \"../shared-types.js\";\nimport { documentMember } from \"./document-member.js\";\nimport { contentEntryType } from \"./media-type.js\";\n\n/**\n * A header's type (OpenAPI 3.1 §4.8.21): its schema, else an object with one property per media\n * type
|
|
1
|
+
{"version":3,"file":"header.mjs","sources":["../../../../src/application/transform/document/header.ts"],"sourcesContent":["import { irObject } from \"../../../domain/ir/constructors.js\";\nimport type { IrType } from \"../../../domain/ir/nodes.js\";\nimport type { HeaderObject } from \"../../../domain/openapi/header-object.js\";\nimport { escapePointerSegment } from \"../../../domain/openapi/json-pointer.js\";\nimport type { ContentMap } from \"../../../domain/openapi/media-type-object.js\";\nimport { FIX } from \"../../../domain/output-fixes.js\";\nimport { documentEntries } from \"../document-entries.js\";\nimport type { SchemaContext, SchemaLocation } from \"../schema/schema-context.js\";\nimport { transformSchema } from \"../schema/schema-transform.js\";\nimport { UNKNOWN_TYPE } from \"../shared-types.js\";\nimport { documentMember } from \"./document-member.js\";\nimport { contentEntryType } from \"./media-type.js\";\n\n/**\n * A header's type (OpenAPI 3.1 §4.8.21): its schema, else the type of its `content`, else\n * `unknown`. `content` holds one media type whose schema describes the value; the original typed\n * it as an object with one property per media type, which the `parameter-header-content` fix\n * replaces by the media type's type, as for a parameter.\n */\nexport function headerType(\n header: HeaderObject,\n location: SchemaLocation,\n context: SchemaContext,\n): IrType {\n if (header.schema) {\n return transformSchema(header.schema, location, context);\n }\n if (!header.content) {\n return UNKNOWN_TYPE;\n }\n if (context.options.fixes.has(FIX.PARAMETER_HEADER_CONTENT)) {\n // The first media type in document order, as for a parameter: `--alphabetize` sorts only\n // the members it writes.\n const first = Object.entries(header.content)[0];\n return first === undefined ? UNKNOWN_TYPE : mediaType(...first, location, context);\n }\n const members = documentEntries(header.content, context.options).map(([contentType, entry]) => {\n const type = mediaType(contentType, entry, location, context);\n return documentMember(contentType, type, entry, { isReadonly: context.options.immutable });\n });\n return irObject(members);\n}\n\n/** The type of one media type of a header, at the path the original gave it. */\nfunction mediaType(\n contentType: string,\n entry: ContentMap[string],\n location: SchemaLocation,\n context: SchemaContext,\n): IrType {\n // Unlike other content maps, the original joins this path by hand: a missing path is `#`.\n const path = `${location.path ?? \"#\"}/${escapePointerSegment(contentType)}`;\n return contentEntryType(entry, { ...location, path }, context);\n}\n"],"names":[],"mappings":";;;;;;;;;AAmBO,SAAS,UAAA,CACd,MAAA,EACA,QAAA,EACA,OAAA,EACQ;AACR,EAAA,IAAI,OAAO,MAAA,EAAQ;AACjB,IAAA,OAAO,eAAA,CAAgB,MAAA,CAAO,MAAA,EAAQ,QAAA,EAAU,OAAO,CAAA;AAAA,EACzD;AACA,EAAA,IAAI,CAAC,OAAO,OAAA,EAAS;AACnB,IAAA,OAAO,YAAA;AAAA,EACT;AACA,EAAA,IAAI,QAAQ,OAAA,CAAQ,KAAA,CAAM,GAAA,CAAI,GAAA,CAAI,wBAAwB,CAAA,EAAG;AAG3D,IAAA,MAAM,QAAQ,MAAA,CAAO,OAAA,CAAQ,MAAA,CAAO,OAAO,EAAE,CAAC,CAAA;AAC9C,IAAA,OAAO,UAAU,MAAA,GAAY,YAAA,GAAe,UAAU,GAAG,KAAA,EAAO,UAAU,OAAO,CAAA;AAAA,EACnF;AACA,EAAA,MAAM,OAAA,GAAU,eAAA,CAAgB,MAAA,CAAO,OAAA,EAAS,OAAA,CAAQ,OAAO,CAAA,CAAE,GAAA,CAAI,CAAC,CAAC,WAAA,EAAa,KAAK,CAAA,KAAM;AAC7F,IAAA,MAAM,IAAA,GAAO,SAAA,CAAU,WAAA,EAAa,KAAA,EAAO,UAAU,OAAO,CAAA;AAC5D,IAAA,OAAO,cAAA,CAAe,aAAa,IAAA,EAAM,KAAA,EAAO,EAAE,UAAA,EAAY,OAAA,CAAQ,OAAA,CAAQ,SAAA,EAAW,CAAA;AAAA,EAC3F,CAAC,CAAA;AACD,EAAA,OAAO,SAAS,OAAO,CAAA;AACzB;AAGA,SAAS,SAAA,CACP,WAAA,EACA,KAAA,EACA,QAAA,EACA,OAAA,EACQ;AAER,EAAA,MAAM,IAAA,GAAO,GAAG,QAAA,CAAS,IAAA,IAAQ,GAAG,CAAA,CAAA,EAAI,oBAAA,CAAqB,WAAW,CAAC,CAAA,CAAA;AACzE,EAAA,OAAO,iBAAiB,KAAA,EAAO,EAAE,GAAG,QAAA,EAAU,IAAA,IAAQ,OAAO,CAAA;AAC/D;;"}
|
|
@@ -21,11 +21,11 @@ function itemSchemaAt(entry, path, context) {
|
|
|
21
21
|
const resolved = mediaTypeObject.isMediaTypeComponentRef(entry.$ref) ? context.refs.resolve(entry.$ref) : void 0;
|
|
22
22
|
return { schema: resolved?.itemSchema, path: jsonPointer.createRef([entry.$ref, "itemSchema"]) };
|
|
23
23
|
}
|
|
24
|
-
return { schema: entry.itemSchema, path: jsonPointer.
|
|
24
|
+
return { schema: entry.itemSchema, path: jsonPointer.appendPointer(path, ["itemSchema"]) };
|
|
25
25
|
}
|
|
26
26
|
function itemContentMember(content, location, context, flags) {
|
|
27
27
|
const members = documentEntries.documentEntries(content, context.options).flatMap(([mediaType, entry]) => {
|
|
28
|
-
const contentPath = jsonPointer.
|
|
28
|
+
const contentPath = jsonPointer.appendPointer(location.path, ["content", mediaType]);
|
|
29
29
|
const item = itemSchemaAt(entry, contentPath, context);
|
|
30
30
|
if (item.schema === void 0) {
|
|
31
31
|
return [];
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"media-type.cjs","sources":["../../../../src/application/transform/document/media-type.ts"],"sourcesContent":["import { irObject, irProperty } from \"../../../domain/ir/constructors.js\";\nimport type { IrPropertySignature, IrType } from \"../../../domain/ir/nodes.js\";\nimport { toPropertyName } from \"../../../domain/ir/property-name.js\";\nimport { createRef } from \"../../../domain/openapi/json-pointer.js\";\nimport {\n type ContentMap,\n isMediaTypeComponentRef,\n type MediaTypeObject,\n} from \"../../../domain/openapi/media-type-object.js\";\nimport { documentEntries } from \"../document-entries.js\";\nimport type { SchemaContext, SchemaLocation } from \"../schema/schema-context.js\";\nimport { transformSchema } from \"../schema/schema-transform.js\";\nimport { UNKNOWN_TYPE } from \"../shared-types.js\";\nimport { documentMember } from \"./document-member.js\";\n\n/** The sibling of `content` that holds item types (ADR-020). */\nconst ITEM_CONTENT_KEY = \"itemContent\";\n\n/** A media type's schema, or `unknown` when it has none (OpenAPI 3.1 §4.8.14). */\nexport function mediaTypeType(\n mediaType: MediaTypeObject,\n location: SchemaLocation,\n context: SchemaContext,\n): IrType {\n return mediaType.schema ? transformSchema(mediaType.schema, location, context) : UNKNOWN_TYPE;\n}\n\n/** A `content` entry: a `$ref` is transformed like a schema `$ref`, the rest as a media type. */\nexport function contentEntryType(\n entry: ContentMap[string],\n location: SchemaLocation,\n context: SchemaContext,\n): IrType {\n // `in` throws for a null entry, as in the original.\n return \"$ref\" in entry\n ? transformSchema(entry, location, context)\n : mediaTypeType(entry, location, context);\n}\n\n/** The `itemSchema` of a `content` entry and where it is, following a `$ref` to a component. */\nfunction itemSchemaAt(\n entry: ContentMap[string],\n path: string,\n context: SchemaContext,\n): { readonly schema: MediaTypeObject[\"itemSchema\"]; readonly path: string } {\n if (\"$ref\" in entry) {\n // Other `$ref`s in `content` keep their pre-3.2 output, so only media type components count.\n const resolved = isMediaTypeComponentRef(entry.$ref)\n ? (context.refs.resolve(entry.$ref) as MediaTypeObject | undefined)\n : undefined;\n return { schema: resolved?.itemSchema, path: createRef([entry.$ref, \"itemSchema\"]) };\n }\n return { schema: entry.itemSchema, path:
|
|
1
|
+
{"version":3,"file":"media-type.cjs","sources":["../../../../src/application/transform/document/media-type.ts"],"sourcesContent":["import { irObject, irProperty } from \"../../../domain/ir/constructors.js\";\nimport type { IrPropertySignature, IrType } from \"../../../domain/ir/nodes.js\";\nimport { toPropertyName } from \"../../../domain/ir/property-name.js\";\nimport { appendPointer, createRef } from \"../../../domain/openapi/json-pointer.js\";\nimport {\n type ContentMap,\n isMediaTypeComponentRef,\n type MediaTypeObject,\n} from \"../../../domain/openapi/media-type-object.js\";\nimport { documentEntries } from \"../document-entries.js\";\nimport type { SchemaContext, SchemaLocation } from \"../schema/schema-context.js\";\nimport { transformSchema } from \"../schema/schema-transform.js\";\nimport { UNKNOWN_TYPE } from \"../shared-types.js\";\nimport { documentMember } from \"./document-member.js\";\n\n/** The sibling of `content` that holds item types (ADR-020). */\nconst ITEM_CONTENT_KEY = \"itemContent\";\n\n/** A media type's schema, or `unknown` when it has none (OpenAPI 3.1 §4.8.14). */\nexport function mediaTypeType(\n mediaType: MediaTypeObject,\n location: SchemaLocation,\n context: SchemaContext,\n): IrType {\n return mediaType.schema ? transformSchema(mediaType.schema, location, context) : UNKNOWN_TYPE;\n}\n\n/** A `content` entry: a `$ref` is transformed like a schema `$ref`, the rest as a media type. */\nexport function contentEntryType(\n entry: ContentMap[string],\n location: SchemaLocation,\n context: SchemaContext,\n): IrType {\n // `in` throws for a null entry, as in the original.\n return \"$ref\" in entry\n ? transformSchema(entry, location, context)\n : mediaTypeType(entry, location, context);\n}\n\n/** The `itemSchema` of a `content` entry and where it is, following a `$ref` to a component. */\nfunction itemSchemaAt(\n entry: ContentMap[string],\n path: string,\n context: SchemaContext,\n): { readonly schema: MediaTypeObject[\"itemSchema\"]; readonly path: string } {\n if (\"$ref\" in entry) {\n // Other `$ref`s in `content` keep their pre-3.2 output, so only media type components count.\n const resolved = isMediaTypeComponentRef(entry.$ref)\n ? (context.refs.resolve(entry.$ref) as MediaTypeObject | undefined)\n : undefined;\n // `createRef` reads the `$ref` itself as a pointer; only the constant segment is appended.\n return { schema: resolved?.itemSchema, path: createRef([entry.$ref, \"itemSchema\"]) };\n }\n return { schema: entry.itemSchema, path: appendPointer(path, [\"itemSchema\"]) };\n}\n\n/**\n * `itemContent`: the type of one item of each media type with an `itemSchema` (OpenAPI 3.2), next\n * to `content`, which keeps the type of the complete body. Null when no media type has one.\n */\nexport function itemContentMember(\n content: ContentMap,\n location: SchemaLocation,\n context: SchemaContext,\n flags: { readonly isReadonly: boolean },\n): IrPropertySignature | null {\n const members = documentEntries(content, context.options).flatMap(([mediaType, entry]) => {\n const contentPath = appendPointer(location.path, [\"content\", mediaType]);\n const item = itemSchemaAt(entry, contentPath, context);\n if (item.schema === undefined) {\n return [];\n }\n const type = transformSchema(item.schema, { ...location, path: item.path }, context);\n return [documentMember(mediaType, type, entry, { isReadonly: context.options.immutable })];\n });\n return members.length > 0\n ? irProperty(toPropertyName(ITEM_CONTENT_KEY), irObject(members), flags)\n : null;\n}\n"],"names":["transformSchema","UNKNOWN_TYPE","isMediaTypeComponentRef","createRef","appendPointer","documentEntries","documentMember","irProperty","toPropertyName","irObject"],"mappings":";;;;;;;;;;;AAgBA,MAAM,gBAAA,GAAmB,aAAA;AAGlB,SAAS,aAAA,CACd,SAAA,EACA,QAAA,EACA,OAAA,EACQ;AACR,EAAA,OAAO,UAAU,MAAA,GAASA,+BAAA,CAAgB,UAAU,MAAA,EAAQ,QAAA,EAAU,OAAO,CAAA,GAAIC,wBAAA;AACnF;AAGO,SAAS,gBAAA,CACd,KAAA,EACA,QAAA,EACA,OAAA,EACQ;AAER,EAAA,OAAO,MAAA,IAAU,KAAA,GACbD,+BAAA,CAAgB,KAAA,EAAO,QAAA,EAAU,OAAO,CAAA,GACxC,aAAA,CAAc,KAAA,EAAO,QAAA,EAAU,OAAO,CAAA;AAC5C;AAGA,SAAS,YAAA,CACP,KAAA,EACA,IAAA,EACA,OAAA,EAC2E;AAC3E,EAAA,IAAI,UAAU,KAAA,EAAO;AAEnB,IAAA,MAAM,QAAA,GAAWE,uCAAA,CAAwB,KAAA,CAAM,IAAI,CAAA,GAC9C,QAAQ,IAAA,CAAK,OAAA,CAAQ,KAAA,CAAM,IAAI,CAAA,GAChC,MAAA;AAEJ,IAAA,OAAO,EAAE,MAAA,EAAQ,QAAA,EAAU,UAAA,EAAY,IAAA,EAAMC,qBAAA,CAAU,CAAC,KAAA,CAAM,IAAA,EAAM,YAAY,CAAC,CAAA,EAAE;AAAA,EACrF;AACA,EAAA,OAAO,EAAE,MAAA,EAAQ,KAAA,CAAM,UAAA,EAAY,IAAA,EAAMC,0BAAc,IAAA,EAAM,CAAC,YAAY,CAAC,CAAA,EAAE;AAC/E;AAMO,SAAS,iBAAA,CACd,OAAA,EACA,QAAA,EACA,OAAA,EACA,KAAA,EAC4B;AAC5B,EAAA,MAAM,OAAA,GAAUC,+BAAA,CAAgB,OAAA,EAAS,OAAA,CAAQ,OAAO,CAAA,CAAE,OAAA,CAAQ,CAAC,CAAC,SAAA,EAAW,KAAK,CAAA,KAAM;AACxF,IAAA,MAAM,cAAcD,yBAAA,CAAc,QAAA,CAAS,MAAM,CAAC,SAAA,EAAW,SAAS,CAAC,CAAA;AACvE,IAAA,MAAM,IAAA,GAAO,YAAA,CAAa,KAAA,EAAO,WAAA,EAAa,OAAO,CAAA;AACrD,IAAA,IAAI,IAAA,CAAK,WAAW,MAAA,EAAW;AAC7B,MAAA,OAAO,EAAC;AAAA,IACV;AACA,IAAA,MAAM,IAAA,GAAOJ,+BAAA,CAAgB,IAAA,CAAK,MAAA,EAAQ,EAAE,GAAG,QAAA,EAAU,IAAA,EAAM,IAAA,CAAK,IAAA,EAAK,EAAG,OAAO,CAAA;AACnF,IAAA,OAAO,CAACM,6BAAA,CAAe,SAAA,EAAW,IAAA,EAAM,KAAA,EAAO,EAAE,UAAA,EAAY,OAAA,CAAQ,OAAA,CAAQ,SAAA,EAAW,CAAC,CAAA;AAAA,EAC3F,CAAC,CAAA;AACD,EAAA,OAAO,OAAA,CAAQ,MAAA,GAAS,CAAA,GACpBC,uBAAA,CAAWC,2BAAA,CAAe,gBAAgB,CAAA,EAAGC,qBAAA,CAAS,OAAO,CAAA,EAAG,KAAK,CAAA,GACrE,IAAA;AACN;;;;"}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { irProperty, irObject } from '../../../domain/ir/constructors.mjs';
|
|
2
2
|
import { toPropertyName } from '../../../domain/ir/property-name.mjs';
|
|
3
|
-
import { createRef } from '../../../domain/openapi/json-pointer.mjs';
|
|
3
|
+
import { appendPointer, createRef } from '../../../domain/openapi/json-pointer.mjs';
|
|
4
4
|
import { isMediaTypeComponentRef } from '../../../domain/openapi/media-type-object.mjs';
|
|
5
5
|
import { documentEntries } from '../document-entries.mjs';
|
|
6
6
|
import { transformSchema } from '../schema/schema-transform.mjs';
|
|
@@ -19,11 +19,11 @@ function itemSchemaAt(entry, path, context) {
|
|
|
19
19
|
const resolved = isMediaTypeComponentRef(entry.$ref) ? context.refs.resolve(entry.$ref) : void 0;
|
|
20
20
|
return { schema: resolved?.itemSchema, path: createRef([entry.$ref, "itemSchema"]) };
|
|
21
21
|
}
|
|
22
|
-
return { schema: entry.itemSchema, path:
|
|
22
|
+
return { schema: entry.itemSchema, path: appendPointer(path, ["itemSchema"]) };
|
|
23
23
|
}
|
|
24
24
|
function itemContentMember(content, location, context, flags) {
|
|
25
25
|
const members = documentEntries(content, context.options).flatMap(([mediaType, entry]) => {
|
|
26
|
-
const contentPath =
|
|
26
|
+
const contentPath = appendPointer(location.path, ["content", mediaType]);
|
|
27
27
|
const item = itemSchemaAt(entry, contentPath, context);
|
|
28
28
|
if (item.schema === void 0) {
|
|
29
29
|
return [];
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"media-type.mjs","sources":["../../../../src/application/transform/document/media-type.ts"],"sourcesContent":["import { irObject, irProperty } from \"../../../domain/ir/constructors.js\";\nimport type { IrPropertySignature, IrType } from \"../../../domain/ir/nodes.js\";\nimport { toPropertyName } from \"../../../domain/ir/property-name.js\";\nimport { createRef } from \"../../../domain/openapi/json-pointer.js\";\nimport {\n type ContentMap,\n isMediaTypeComponentRef,\n type MediaTypeObject,\n} from \"../../../domain/openapi/media-type-object.js\";\nimport { documentEntries } from \"../document-entries.js\";\nimport type { SchemaContext, SchemaLocation } from \"../schema/schema-context.js\";\nimport { transformSchema } from \"../schema/schema-transform.js\";\nimport { UNKNOWN_TYPE } from \"../shared-types.js\";\nimport { documentMember } from \"./document-member.js\";\n\n/** The sibling of `content` that holds item types (ADR-020). */\nconst ITEM_CONTENT_KEY = \"itemContent\";\n\n/** A media type's schema, or `unknown` when it has none (OpenAPI 3.1 §4.8.14). */\nexport function mediaTypeType(\n mediaType: MediaTypeObject,\n location: SchemaLocation,\n context: SchemaContext,\n): IrType {\n return mediaType.schema ? transformSchema(mediaType.schema, location, context) : UNKNOWN_TYPE;\n}\n\n/** A `content` entry: a `$ref` is transformed like a schema `$ref`, the rest as a media type. */\nexport function contentEntryType(\n entry: ContentMap[string],\n location: SchemaLocation,\n context: SchemaContext,\n): IrType {\n // `in` throws for a null entry, as in the original.\n return \"$ref\" in entry\n ? transformSchema(entry, location, context)\n : mediaTypeType(entry, location, context);\n}\n\n/** The `itemSchema` of a `content` entry and where it is, following a `$ref` to a component. */\nfunction itemSchemaAt(\n entry: ContentMap[string],\n path: string,\n context: SchemaContext,\n): { readonly schema: MediaTypeObject[\"itemSchema\"]; readonly path: string } {\n if (\"$ref\" in entry) {\n // Other `$ref`s in `content` keep their pre-3.2 output, so only media type components count.\n const resolved = isMediaTypeComponentRef(entry.$ref)\n ? (context.refs.resolve(entry.$ref) as MediaTypeObject | undefined)\n : undefined;\n return { schema: resolved?.itemSchema, path: createRef([entry.$ref, \"itemSchema\"]) };\n }\n return { schema: entry.itemSchema, path:
|
|
1
|
+
{"version":3,"file":"media-type.mjs","sources":["../../../../src/application/transform/document/media-type.ts"],"sourcesContent":["import { irObject, irProperty } from \"../../../domain/ir/constructors.js\";\nimport type { IrPropertySignature, IrType } from \"../../../domain/ir/nodes.js\";\nimport { toPropertyName } from \"../../../domain/ir/property-name.js\";\nimport { appendPointer, createRef } from \"../../../domain/openapi/json-pointer.js\";\nimport {\n type ContentMap,\n isMediaTypeComponentRef,\n type MediaTypeObject,\n} from \"../../../domain/openapi/media-type-object.js\";\nimport { documentEntries } from \"../document-entries.js\";\nimport type { SchemaContext, SchemaLocation } from \"../schema/schema-context.js\";\nimport { transformSchema } from \"../schema/schema-transform.js\";\nimport { UNKNOWN_TYPE } from \"../shared-types.js\";\nimport { documentMember } from \"./document-member.js\";\n\n/** The sibling of `content` that holds item types (ADR-020). */\nconst ITEM_CONTENT_KEY = \"itemContent\";\n\n/** A media type's schema, or `unknown` when it has none (OpenAPI 3.1 §4.8.14). */\nexport function mediaTypeType(\n mediaType: MediaTypeObject,\n location: SchemaLocation,\n context: SchemaContext,\n): IrType {\n return mediaType.schema ? transformSchema(mediaType.schema, location, context) : UNKNOWN_TYPE;\n}\n\n/** A `content` entry: a `$ref` is transformed like a schema `$ref`, the rest as a media type. */\nexport function contentEntryType(\n entry: ContentMap[string],\n location: SchemaLocation,\n context: SchemaContext,\n): IrType {\n // `in` throws for a null entry, as in the original.\n return \"$ref\" in entry\n ? transformSchema(entry, location, context)\n : mediaTypeType(entry, location, context);\n}\n\n/** The `itemSchema` of a `content` entry and where it is, following a `$ref` to a component. */\nfunction itemSchemaAt(\n entry: ContentMap[string],\n path: string,\n context: SchemaContext,\n): { readonly schema: MediaTypeObject[\"itemSchema\"]; readonly path: string } {\n if (\"$ref\" in entry) {\n // Other `$ref`s in `content` keep their pre-3.2 output, so only media type components count.\n const resolved = isMediaTypeComponentRef(entry.$ref)\n ? (context.refs.resolve(entry.$ref) as MediaTypeObject | undefined)\n : undefined;\n // `createRef` reads the `$ref` itself as a pointer; only the constant segment is appended.\n return { schema: resolved?.itemSchema, path: createRef([entry.$ref, \"itemSchema\"]) };\n }\n return { schema: entry.itemSchema, path: appendPointer(path, [\"itemSchema\"]) };\n}\n\n/**\n * `itemContent`: the type of one item of each media type with an `itemSchema` (OpenAPI 3.2), next\n * to `content`, which keeps the type of the complete body. Null when no media type has one.\n */\nexport function itemContentMember(\n content: ContentMap,\n location: SchemaLocation,\n context: SchemaContext,\n flags: { readonly isReadonly: boolean },\n): IrPropertySignature | null {\n const members = documentEntries(content, context.options).flatMap(([mediaType, entry]) => {\n const contentPath = appendPointer(location.path, [\"content\", mediaType]);\n const item = itemSchemaAt(entry, contentPath, context);\n if (item.schema === undefined) {\n return [];\n }\n const type = transformSchema(item.schema, { ...location, path: item.path }, context);\n return [documentMember(mediaType, type, entry, { isReadonly: context.options.immutable })];\n });\n return members.length > 0\n ? irProperty(toPropertyName(ITEM_CONTENT_KEY), irObject(members), flags)\n : null;\n}\n"],"names":[],"mappings":";;;;;;;;;AAgBA,MAAM,gBAAA,GAAmB,aAAA;AAGlB,SAAS,aAAA,CACd,SAAA,EACA,QAAA,EACA,OAAA,EACQ;AACR,EAAA,OAAO,UAAU,MAAA,GAAS,eAAA,CAAgB,UAAU,MAAA,EAAQ,QAAA,EAAU,OAAO,CAAA,GAAI,YAAA;AACnF;AAGO,SAAS,gBAAA,CACd,KAAA,EACA,QAAA,EACA,OAAA,EACQ;AAER,EAAA,OAAO,MAAA,IAAU,KAAA,GACb,eAAA,CAAgB,KAAA,EAAO,QAAA,EAAU,OAAO,CAAA,GACxC,aAAA,CAAc,KAAA,EAAO,QAAA,EAAU,OAAO,CAAA;AAC5C;AAGA,SAAS,YAAA,CACP,KAAA,EACA,IAAA,EACA,OAAA,EAC2E;AAC3E,EAAA,IAAI,UAAU,KAAA,EAAO;AAEnB,IAAA,MAAM,QAAA,GAAW,uBAAA,CAAwB,KAAA,CAAM,IAAI,CAAA,GAC9C,QAAQ,IAAA,CAAK,OAAA,CAAQ,KAAA,CAAM,IAAI,CAAA,GAChC,MAAA;AAEJ,IAAA,OAAO,EAAE,MAAA,EAAQ,QAAA,EAAU,UAAA,EAAY,IAAA,EAAM,SAAA,CAAU,CAAC,KAAA,CAAM,IAAA,EAAM,YAAY,CAAC,CAAA,EAAE;AAAA,EACrF;AACA,EAAA,OAAO,EAAE,MAAA,EAAQ,KAAA,CAAM,UAAA,EAAY,IAAA,EAAM,cAAc,IAAA,EAAM,CAAC,YAAY,CAAC,CAAA,EAAE;AAC/E;AAMO,SAAS,iBAAA,CACd,OAAA,EACA,QAAA,EACA,OAAA,EACA,KAAA,EAC4B;AAC5B,EAAA,MAAM,OAAA,GAAU,eAAA,CAAgB,OAAA,EAAS,OAAA,CAAQ,OAAO,CAAA,CAAE,OAAA,CAAQ,CAAC,CAAC,SAAA,EAAW,KAAK,CAAA,KAAM;AACxF,IAAA,MAAM,cAAc,aAAA,CAAc,QAAA,CAAS,MAAM,CAAC,SAAA,EAAW,SAAS,CAAC,CAAA;AACvE,IAAA,MAAM,IAAA,GAAO,YAAA,CAAa,KAAA,EAAO,WAAA,EAAa,OAAO,CAAA;AACrD,IAAA,IAAI,IAAA,CAAK,WAAW,MAAA,EAAW;AAC7B,MAAA,OAAO,EAAC;AAAA,IACV;AACA,IAAA,MAAM,IAAA,GAAO,eAAA,CAAgB,IAAA,CAAK,MAAA,EAAQ,EAAE,GAAG,QAAA,EAAU,IAAA,EAAM,IAAA,CAAK,IAAA,EAAK,EAAG,OAAO,CAAA;AACnF,IAAA,OAAO,CAAC,cAAA,CAAe,SAAA,EAAW,IAAA,EAAM,KAAA,EAAO,EAAE,UAAA,EAAY,OAAA,CAAQ,OAAA,CAAQ,SAAA,EAAW,CAAC,CAAA;AAAA,EAC3F,CAAC,CAAA;AACD,EAAA,OAAO,OAAA,CAAQ,MAAA,GAAS,CAAA,GACpB,UAAA,CAAW,cAAA,CAAe,gBAAgB,CAAA,EAAG,QAAA,CAAS,OAAO,CAAA,EAAG,KAAK,CAAA,GACrE,IAAA;AACN;;"}
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
'use strict';
|
|
2
|
+
|
|
3
|
+
const appendAll = require('../../../domain/append-all.cjs');
|
|
4
|
+
const pathItem = require('./path-item.cjs');
|
|
5
|
+
|
|
6
|
+
function operationKeysWritten(document) {
|
|
7
|
+
const keys = /* @__PURE__ */ new Set();
|
|
8
|
+
const seen = /* @__PURE__ */ new WeakSet();
|
|
9
|
+
const pending = [document];
|
|
10
|
+
while (pending.length > 0) {
|
|
11
|
+
const value = pending.pop();
|
|
12
|
+
if (typeof value !== "object" || value === null || seen.has(value)) {
|
|
13
|
+
continue;
|
|
14
|
+
}
|
|
15
|
+
seen.add(value);
|
|
16
|
+
const { operationId } = value;
|
|
17
|
+
if (typeof operationId === "string") {
|
|
18
|
+
keys.add(pathItem.operationKeyOf(operationId));
|
|
19
|
+
}
|
|
20
|
+
appendAll.appendAll(pending, Object.values(value));
|
|
21
|
+
}
|
|
22
|
+
return keys;
|
|
23
|
+
}
|
|
24
|
+
|
|
25
|
+
exports.operationKeysWritten = operationKeysWritten;
|
|
26
|
+
//# sourceMappingURL=operation-keys-written.cjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"operation-keys-written.cjs","sources":["../../../../src/application/transform/document/operation-keys-written.ts"],"sourcesContent":["import { appendAll } from \"../../../domain/append-all.js\";\nimport { operationKeyOf } from \"./path-item.js\";\n\n/**\n * Every `operations` key that an `operationId` in the document asks for, so that a repeated ID\n * never gets a number another operation has as its own ID (`OperationKeys`). Operations can sit\n * in `paths`, `webhooks`, `components.pathItems` and callbacks, so the whole document is read. A\n * Link Object's `operationId` is read too; an extra name only makes a number skip it.\n */\nexport function operationKeysWritten(document: object): Set<string> {\n const keys = new Set<string>();\n const seen = new WeakSet<object>();\n const pending: unknown[] = [document];\n while (pending.length > 0) {\n const value = pending.pop();\n if (typeof value !== \"object\" || value === null || seen.has(value)) {\n continue;\n }\n seen.add(value);\n const { operationId } = value as { operationId?: unknown };\n if (typeof operationId === \"string\") {\n keys.add(operationKeyOf(operationId));\n }\n appendAll(pending, Object.values(value));\n }\n return keys;\n}\n"],"names":["operationKeyOf","appendAll"],"mappings":";;;;;AASO,SAAS,qBAAqB,QAAA,EAA+B;AAClE,EAAA,MAAM,IAAA,uBAAW,GAAA,EAAY;AAC7B,EAAA,MAAM,IAAA,uBAAW,OAAA,EAAgB;AACjC,EAAA,MAAM,OAAA,GAAqB,CAAC,QAAQ,CAAA;AACpC,EAAA,OAAO,OAAA,CAAQ,SAAS,CAAA,EAAG;AACzB,IAAA,MAAM,KAAA,GAAQ,QAAQ,GAAA,EAAI;AAC1B,IAAA,IAAI,OAAO,UAAU,QAAA,IAAY,KAAA,KAAU,QAAQ,IAAA,CAAK,GAAA,CAAI,KAAK,CAAA,EAAG;AAClE,MAAA;AAAA,IACF;AACA,IAAA,IAAA,CAAK,IAAI,KAAK,CAAA;AACd,IAAA,MAAM,EAAE,aAAY,GAAI,KAAA;AACxB,IAAA,IAAI,OAAO,gBAAgB,QAAA,EAAU;AACnC,MAAA,IAAA,CAAK,GAAA,CAAIA,uBAAA,CAAe,WAAW,CAAC,CAAA;AAAA,IACtC;AACA,IAAAC,mBAAA,CAAU,OAAA,EAAS,MAAA,CAAO,MAAA,CAAO,KAAK,CAAC,CAAA;AAAA,EACzC;AACA,EAAA,OAAO,IAAA;AACT;;"}
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
import { appendAll } from '../../../domain/append-all.mjs';
|
|
2
|
+
import { operationKeyOf } from './path-item.mjs';
|
|
3
|
+
|
|
4
|
+
function operationKeysWritten(document) {
|
|
5
|
+
const keys = /* @__PURE__ */ new Set();
|
|
6
|
+
const seen = /* @__PURE__ */ new WeakSet();
|
|
7
|
+
const pending = [document];
|
|
8
|
+
while (pending.length > 0) {
|
|
9
|
+
const value = pending.pop();
|
|
10
|
+
if (typeof value !== "object" || value === null || seen.has(value)) {
|
|
11
|
+
continue;
|
|
12
|
+
}
|
|
13
|
+
seen.add(value);
|
|
14
|
+
const { operationId } = value;
|
|
15
|
+
if (typeof operationId === "string") {
|
|
16
|
+
keys.add(operationKeyOf(operationId));
|
|
17
|
+
}
|
|
18
|
+
appendAll(pending, Object.values(value));
|
|
19
|
+
}
|
|
20
|
+
return keys;
|
|
21
|
+
}
|
|
22
|
+
|
|
23
|
+
export { operationKeysWritten };
|
|
24
|
+
//# sourceMappingURL=operation-keys-written.mjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"operation-keys-written.mjs","sources":["../../../../src/application/transform/document/operation-keys-written.ts"],"sourcesContent":["import { appendAll } from \"../../../domain/append-all.js\";\nimport { operationKeyOf } from \"./path-item.js\";\n\n/**\n * Every `operations` key that an `operationId` in the document asks for, so that a repeated ID\n * never gets a number another operation has as its own ID (`OperationKeys`). Operations can sit\n * in `paths`, `webhooks`, `components.pathItems` and callbacks, so the whole document is read. A\n * Link Object's `operationId` is read too; an extra name only makes a number skip it.\n */\nexport function operationKeysWritten(document: object): Set<string> {\n const keys = new Set<string>();\n const seen = new WeakSet<object>();\n const pending: unknown[] = [document];\n while (pending.length > 0) {\n const value = pending.pop();\n if (typeof value !== \"object\" || value === null || seen.has(value)) {\n continue;\n }\n seen.add(value);\n const { operationId } = value as { operationId?: unknown };\n if (typeof operationId === \"string\") {\n keys.add(operationKeyOf(operationId));\n }\n appendAll(pending, Object.values(value));\n }\n return keys;\n}\n"],"names":[],"mappings":";;;AASO,SAAS,qBAAqB,QAAA,EAA+B;AAClE,EAAA,MAAM,IAAA,uBAAW,GAAA,EAAY;AAC7B,EAAA,MAAM,IAAA,uBAAW,OAAA,EAAgB;AACjC,EAAA,MAAM,OAAA,GAAqB,CAAC,QAAQ,CAAA;AACpC,EAAA,OAAO,OAAA,CAAQ,SAAS,CAAA,EAAG;AACzB,IAAA,MAAM,KAAA,GAAQ,QAAQ,GAAA,EAAI;AAC1B,IAAA,IAAI,OAAO,UAAU,QAAA,IAAY,KAAA,KAAU,QAAQ,IAAA,CAAK,GAAA,CAAI,KAAK,CAAA,EAAG;AAClE,MAAA;AAAA,IACF;AACA,IAAA,IAAA,CAAK,IAAI,KAAK,CAAA;AACd,IAAA,MAAM,EAAE,aAAY,GAAI,KAAA;AACxB,IAAA,IAAI,OAAO,gBAAgB,QAAA,EAAU;AACnC,MAAA,IAAA,CAAK,GAAA,CAAI,cAAA,CAAe,WAAW,CAAC,CAAA;AAAA,IACtC;AACA,IAAA,SAAA,CAAU,OAAA,EAAS,MAAA,CAAO,MAAA,CAAO,KAAK,CAAC,CAAA;AAAA,EACzC;AACA,EAAA,OAAO,IAAA;AACT;;"}
|
|
@@ -21,7 +21,7 @@ function requestBodyMember(operation, location, context) {
|
|
|
21
21
|
const isReference = "$ref" in body;
|
|
22
22
|
const type = isReference ? refType.refType(body.$ref) : requestBody.requestBodyType(
|
|
23
23
|
body,
|
|
24
|
-
{ ...location, path: jsonPointer.
|
|
24
|
+
{ ...location, path: jsonPointer.appendPointer(location.path, ["requestBody"]) },
|
|
25
25
|
context
|
|
26
26
|
);
|
|
27
27
|
const resolved = isReference ? context.refs.resolve(body.$ref) : body;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"operation.cjs","sources":["../../../../src/application/transform/document/operation.ts"],"sourcesContent":["import { irKeyword, irProperty } from \"../../../domain/ir/constructors.js\";\nimport type { IrPropertySignature } from \"../../../domain/ir/nodes.js\";\nimport { toPropertyName } from \"../../../domain/ir/property-name.js\";\nimport {
|
|
1
|
+
{"version":3,"file":"operation.cjs","sources":["../../../../src/application/transform/document/operation.ts"],"sourcesContent":["import { irKeyword, irProperty } from \"../../../domain/ir/constructors.js\";\nimport type { IrPropertySignature } from \"../../../domain/ir/nodes.js\";\nimport { toPropertyName } from \"../../../domain/ir/property-name.js\";\nimport { appendPointer } from \"../../../domain/openapi/json-pointer.js\";\nimport type { OperationObject } from \"../../../domain/openapi/operation-object.js\";\nimport type { RequestBodyObject } from \"../../../domain/openapi/request-body-object.js\";\nimport { refType } from \"../ref-type.js\";\nimport type { SchemaLocation } from \"../schema/schema-context.js\";\nimport type { TransformContext } from \"../transform-context.js\";\nimport { documentMember } from \"./document-member.js\";\nimport { parametersMember } from \"./parameters.js\";\nimport { requestBodyType } from \"./request-body.js\";\nimport { responsesType } from \"./responses.js\";\n\n/** `requestBody`, optional unless the resolved body is required; `requestBody?: never` if none. */\nfunction requestBodyMember(\n operation: OperationObject,\n location: SchemaLocation,\n context: TransformContext,\n): IrPropertySignature {\n const isReadonly = context.options.immutable;\n const body = operation.requestBody;\n if (!body) {\n return irProperty(toPropertyName(\"requestBody\"), irKeyword(\"never\"), {\n isOptional: true,\n isReadonly,\n });\n }\n const isReference = \"$ref\" in body;\n const type = isReference\n ? refType(body.$ref)\n : requestBodyType(\n body,\n { ...location, path: appendPointer(location.path, [\"requestBody\"]) },\n context,\n );\n const resolved = isReference\n ? (context.refs.resolve(body.$ref) as RequestBodyObject | undefined)\n : body;\n return documentMember(\"requestBody\", type, body, {\n isReadonly,\n isOptional: !resolved?.required,\n });\n}\n\n/**\n * The members of an operation (OpenAPI 3.1 §4.8.10): `parameters`, `requestBody` and `responses`.\n * `location.path` is the operation's pointer.\n */\nexport function operationMembers(\n operation: OperationObject,\n location: SchemaLocation,\n context: TransformContext,\n): IrPropertySignature[] {\n // Built in document order: each part may add footer declarations (enums), in this order.\n const parameters = parametersMember(operation.parameters ?? [], location, context);\n const requestBody = requestBodyMember(operation, location, context);\n const responses = responsesType(operation.responses ?? {}, location, context);\n return [\n parameters,\n requestBody,\n irProperty(toPropertyName(\"responses\"), responses, { isReadonly: context.options.immutable }),\n ];\n}\n"],"names":["irProperty","toPropertyName","irKeyword","refType","requestBodyType","appendPointer","documentMember","parameters","parametersMember","responses","responsesType"],"mappings":";;;;;;;;;;;AAeA,SAAS,iBAAA,CACP,SAAA,EACA,QAAA,EACA,OAAA,EACqB;AACrB,EAAA,MAAM,UAAA,GAAa,QAAQ,OAAA,CAAQ,SAAA;AACnC,EAAA,MAAM,OAAO,SAAA,CAAU,WAAA;AACvB,EAAA,IAAI,CAAC,IAAA,EAAM;AACT,IAAA,OAAOA,wBAAWC,2BAAA,CAAe,aAAa,CAAA,EAAGC,sBAAA,CAAU,OAAO,CAAA,EAAG;AAAA,MACnE,UAAA,EAAY,IAAA;AAAA,MACZ;AAAA,KACD,CAAA;AAAA,EACH;AACA,EAAA,MAAM,cAAc,MAAA,IAAU,IAAA;AAC9B,EAAA,MAAM,IAAA,GAAO,WAAA,GACTC,eAAA,CAAQ,IAAA,CAAK,IAAI,CAAA,GACjBC,2BAAA;AAAA,IACE,IAAA;AAAA,IACA,EAAE,GAAG,QAAA,EAAU,IAAA,EAAMC,yBAAA,CAAc,SAAS,IAAA,EAAM,CAAC,aAAa,CAAC,CAAA,EAAE;AAAA,IACnE;AAAA,GACF;AACJ,EAAA,MAAM,WAAW,WAAA,GACZ,OAAA,CAAQ,KAAK,OAAA,CAAQ,IAAA,CAAK,IAAI,CAAA,GAC/B,IAAA;AACJ,EAAA,OAAOC,6BAAA,CAAe,aAAA,EAAe,IAAA,EAAM,IAAA,EAAM;AAAA,IAC/C,UAAA;AAAA,IACA,UAAA,EAAY,CAAC,QAAA,EAAU;AAAA,GACxB,CAAA;AACH;AAMO,SAAS,gBAAA,CACd,SAAA,EACA,QAAA,EACA,OAAA,EACuB;AAEvB,EAAA,MAAMC,eAAaC,2BAAA,CAAiB,SAAA,CAAU,cAAc,EAAC,EAAG,UAAU,OAAO,CAAA;AACjF,EAAA,MAAM,WAAA,GAAc,iBAAA,CAAkB,SAAA,EAAW,QAAA,EAAU,OAAO,CAAA;AAClE,EAAA,MAAMC,cAAYC,uBAAA,CAAc,SAAA,CAAU,aAAa,EAAC,EAAG,UAAU,OAAO,CAAA;AAC5E,EAAA,OAAO;AAAA,IACLH,YAAA;AAAA,IACA,WAAA;AAAA,IACAP,uBAAA,CAAWC,2BAAA,CAAe,WAAW,CAAA,EAAGQ,WAAA,EAAW,EAAE,UAAA,EAAY,OAAA,CAAQ,OAAA,CAAQ,SAAA,EAAW;AAAA,GAC9F;AACF;;"}
|