@redocly/cli 2.33.2 → 2.34.0
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/LICENSE +7 -0
- package/THIRD_PARTY_NOTICES +767 -0
- package/lib/chunks/2ULY6UWW.js +13374 -0
- package/lib/chunks/4DNBVE5S.js +23 -0
- package/lib/chunks/5ILQMFXK.js +59 -0
- package/lib/chunks/7GOGGHM5.js +92239 -0
- package/lib/chunks/A6JSOHCP.js +41 -0
- package/lib/chunks/AIT3U3JT.js +22 -0
- package/lib/chunks/EIHBO33S.js +1133 -0
- package/lib/chunks/FDUPOI4C.js +19036 -0
- package/lib/chunks/FO6BDVGE.js +25 -0
- package/lib/chunks/FP2VGYMF.js +90 -0
- package/lib/chunks/GRMVFQAA.js +17782 -0
- package/lib/chunks/ICAVAH7N.js +387 -0
- package/lib/chunks/OEYVENNB.js +37533 -0
- package/lib/chunks/TS33ZDKX.js +35 -0
- package/lib/chunks/VUDTNFRL.js +42 -0
- package/lib/chunks/VXIQEZPR.js +2564 -0
- package/lib/chunks/W7G5WVPB.js +44 -0
- package/lib/chunks/XHPY6UJF.js +1638 -0
- package/lib/chunks/Y6DTFCLS.js +15 -0
- package/lib/chunks/YA5P3RI2.js +13 -0
- package/lib/chunks/ZIYSHX6D.js +3617 -0
- package/lib/index.js +13606 -620
- package/package.json +13 -53
- package/lib/auth/device-flow.d.ts +0 -24
- package/lib/auth/device-flow.d.ts.map +0 -1
- package/lib/auth/device-flow.js +0 -140
- package/lib/auth/device-flow.js.map +0 -1
- package/lib/auth/oauth-client.d.ts +0 -18
- package/lib/auth/oauth-client.d.ts.map +0 -1
- package/lib/auth/oauth-client.js +0 -117
- package/lib/auth/oauth-client.js.map +0 -1
- package/lib/commands/auth.d.ts +0 -12
- package/lib/commands/auth.d.ts.map +0 -1
- package/lib/commands/auth.js +0 -34
- package/lib/commands/auth.js.map +0 -1
- package/lib/commands/build-docs/index.d.ts +0 -4
- package/lib/commands/build-docs/index.d.ts.map +0 -1
- package/lib/commands/build-docs/index.js +0 -38
- package/lib/commands/build-docs/index.js.map +0 -1
- package/lib/commands/build-docs/template.hbs +0 -23
- package/lib/commands/build-docs/types.d.ts +0 -24
- package/lib/commands/build-docs/types.d.ts.map +0 -1
- package/lib/commands/build-docs/types.js +0 -2
- package/lib/commands/build-docs/types.js.map +0 -1
- package/lib/commands/build-docs/utils.d.ts +0 -8
- package/lib/commands/build-docs/utils.d.ts.map +0 -1
- package/lib/commands/build-docs/utils.js +0 -84
- package/lib/commands/build-docs/utils.js.map +0 -1
- package/lib/commands/bundle.d.ts +0 -20
- package/lib/commands/bundle.d.ts.map +0 -1
- package/lib/commands/bundle.js +0 -93
- package/lib/commands/bundle.js.map +0 -1
- package/lib/commands/eject.d.ts +0 -10
- package/lib/commands/eject.d.ts.map +0 -1
- package/lib/commands/eject.js +0 -26
- package/lib/commands/eject.js.map +0 -1
- package/lib/commands/generate-arazzo.d.ts +0 -8
- package/lib/commands/generate-arazzo.d.ts.map +0 -1
- package/lib/commands/generate-arazzo.js +0 -25
- package/lib/commands/generate-arazzo.js.map +0 -1
- package/lib/commands/join/index.d.ts +0 -4
- package/lib/commands/join/index.d.ts.map +0 -1
- package/lib/commands/join/index.js +0 -141
- package/lib/commands/join/index.js.map +0 -1
- package/lib/commands/join/types.d.ts +0 -22
- package/lib/commands/join/types.d.ts.map +0 -1
- package/lib/commands/join/types.js +0 -2
- package/lib/commands/join/types.js.map +0 -1
- package/lib/commands/join/utils/add-components-prefix.d.ts +0 -2
- package/lib/commands/join/utils/add-components-prefix.d.ts.map +0 -1
- package/lib/commands/join/utils/add-components-prefix.js +0 -9
- package/lib/commands/join/utils/add-components-prefix.js.map +0 -1
- package/lib/commands/join/utils/add-info-section.d.ts +0 -2
- package/lib/commands/join/utils/add-info-section.d.ts.map +0 -1
- package/lib/commands/join/utils/add-info-section.js +0 -19
- package/lib/commands/join/utils/add-info-section.js.map +0 -1
- package/lib/commands/join/utils/add-prefix.d.ts +0 -2
- package/lib/commands/join/utils/add-prefix.d.ts.map +0 -1
- package/lib/commands/join/utils/add-prefix.js +0 -4
- package/lib/commands/join/utils/add-prefix.js.map +0 -1
- package/lib/commands/join/utils/add-security-prefix.d.ts +0 -2
- package/lib/commands/join/utils/add-security-prefix.d.ts.map +0 -1
- package/lib/commands/join/utils/add-security-prefix.js +0 -12
- package/lib/commands/join/utils/add-security-prefix.js.map +0 -1
- package/lib/commands/join/utils/collect-components.d.ts +0 -7
- package/lib/commands/join/utils/collect-components.d.ts.map +0 -1
- package/lib/commands/join/utils/collect-components.js +0 -26
- package/lib/commands/join/utils/collect-components.js.map +0 -1
- package/lib/commands/join/utils/collect-external-docs.d.ts +0 -7
- package/lib/commands/join/utils/collect-external-docs.d.ts.map +0 -1
- package/lib/commands/join/utils/collect-external-docs.js +0 -15
- package/lib/commands/join/utils/collect-external-docs.js.map +0 -1
- package/lib/commands/join/utils/collect-paths.d.ts +0 -9
- package/lib/commands/join/utils/collect-paths.d.ts.map +0 -1
- package/lib/commands/join/utils/collect-paths.js +0 -172
- package/lib/commands/join/utils/collect-paths.js.map +0 -1
- package/lib/commands/join/utils/collect-webhooks.d.ts +0 -8
- package/lib/commands/join/utils/collect-webhooks.d.ts.map +0 -1
- package/lib/commands/join/utils/collect-webhooks.js +0 -46
- package/lib/commands/join/utils/collect-webhooks.js.map +0 -1
- package/lib/commands/join/utils/duplicate-tag-description-warning.d.ts +0 -2
- package/lib/commands/join/utils/duplicate-tag-description-warning.d.ts.map +0 -1
- package/lib/commands/join/utils/duplicate-tag-description-warning.js +0 -8
- package/lib/commands/join/utils/duplicate-tag-description-warning.js.map +0 -1
- package/lib/commands/join/utils/filter-conflicts.d.ts +0 -2
- package/lib/commands/join/utils/filter-conflicts.d.ts.map +0 -1
- package/lib/commands/join/utils/filter-conflicts.js +0 -4
- package/lib/commands/join/utils/filter-conflicts.js.map +0 -1
- package/lib/commands/join/utils/format-tags.d.ts +0 -4
- package/lib/commands/join/utils/format-tags.d.ts.map +0 -1
- package/lib/commands/join/utils/format-tags.js +0 -4
- package/lib/commands/join/utils/format-tags.js.map +0 -1
- package/lib/commands/join/utils/get-api-filename.d.ts +0 -2
- package/lib/commands/join/utils/get-api-filename.d.ts.map +0 -1
- package/lib/commands/join/utils/get-api-filename.js +0 -5
- package/lib/commands/join/utils/get-api-filename.js.map +0 -1
- package/lib/commands/join/utils/get-info-prefix.d.ts +0 -2
- package/lib/commands/join/utils/get-info-prefix.d.ts.map +0 -1
- package/lib/commands/join/utils/get-info-prefix.js +0 -17
- package/lib/commands/join/utils/get-info-prefix.js.map +0 -1
- package/lib/commands/join/utils/index.d.ts +0 -19
- package/lib/commands/join/utils/index.d.ts.map +0 -1
- package/lib/commands/join/utils/index.js +0 -19
- package/lib/commands/join/utils/index.js.map +0 -1
- package/lib/commands/join/utils/iterate-potential-conflicts.d.ts +0 -5
- package/lib/commands/join/utils/iterate-potential-conflicts.d.ts.map +0 -1
- package/lib/commands/join/utils/iterate-potential-conflicts.js +0 -53
- package/lib/commands/join/utils/iterate-potential-conflicts.js.map +0 -1
- package/lib/commands/join/utils/populate-tags.d.ts +0 -7
- package/lib/commands/join/utils/populate-tags.d.ts.map +0 -1
- package/lib/commands/join/utils/populate-tags.js +0 -77
- package/lib/commands/join/utils/populate-tags.js.map +0 -1
- package/lib/commands/join/utils/prefix-tag-suggestion.d.ts +0 -2
- package/lib/commands/join/utils/prefix-tag-suggestion.d.ts.map +0 -1
- package/lib/commands/join/utils/prefix-tag-suggestion.js +0 -6
- package/lib/commands/join/utils/prefix-tag-suggestion.js.map +0 -1
- package/lib/commands/join/utils/replace-$-refs.d.ts +0 -2
- package/lib/commands/join/utils/replace-$-refs.d.ts.map +0 -1
- package/lib/commands/join/utils/replace-$-refs.js +0 -29
- package/lib/commands/join/utils/replace-$-refs.js.map +0 -1
- package/lib/commands/join/utils/show-conflicts.d.ts +0 -2
- package/lib/commands/join/utils/show-conflicts.d.ts.map +0 -1
- package/lib/commands/join/utils/show-conflicts.js +0 -8
- package/lib/commands/join/utils/show-conflicts.js.map +0 -1
- package/lib/commands/lint.d.ts +0 -15
- package/lib/commands/lint.d.ts.map +0 -1
- package/lib/commands/lint.js +0 -112
- package/lib/commands/lint.js.map +0 -1
- package/lib/commands/preview-project/constants.d.ts +0 -15
- package/lib/commands/preview-project/constants.d.ts.map +0 -1
- package/lib/commands/preview-project/constants.js +0 -20
- package/lib/commands/preview-project/constants.js.map +0 -1
- package/lib/commands/preview-project/index.d.ts +0 -4
- package/lib/commands/preview-project/index.d.ts.map +0 -1
- package/lib/commands/preview-project/index.js +0 -54
- package/lib/commands/preview-project/index.js.map +0 -1
- package/lib/commands/preview-project/types.d.ts +0 -11
- package/lib/commands/preview-project/types.d.ts.map +0 -1
- package/lib/commands/preview-project/types.js +0 -2
- package/lib/commands/preview-project/types.js.map +0 -1
- package/lib/commands/respect/connection-client.d.ts +0 -12
- package/lib/commands/respect/connection-client.d.ts.map +0 -1
- package/lib/commands/respect/connection-client.js +0 -73
- package/lib/commands/respect/connection-client.js.map +0 -1
- package/lib/commands/respect/display-files-summary-table.d.ts +0 -12
- package/lib/commands/respect/display-files-summary-table.d.ts.map +0 -1
- package/lib/commands/respect/display-files-summary-table.js +0 -65
- package/lib/commands/respect/display-files-summary-table.js.map +0 -1
- package/lib/commands/respect/har-logs/har-logs.d.ts +0 -6
- package/lib/commands/respect/har-logs/har-logs.d.ts.map +0 -1
- package/lib/commands/respect/har-logs/har-logs.js +0 -28
- package/lib/commands/respect/har-logs/har-logs.js.map +0 -1
- package/lib/commands/respect/har-logs/helpers/add-headers.d.ts +0 -2
- package/lib/commands/respect/har-logs/helpers/add-headers.d.ts.map +0 -1
- package/lib/commands/respect/har-logs/helpers/add-headers.js +0 -17
- package/lib/commands/respect/har-logs/helpers/add-headers.js.map +0 -1
- package/lib/commands/respect/har-logs/helpers/build-headers.d.ts +0 -10
- package/lib/commands/respect/har-logs/helpers/build-headers.d.ts.map +0 -1
- package/lib/commands/respect/har-logs/helpers/build-headers.js +0 -33
- package/lib/commands/respect/har-logs/helpers/build-headers.js.map +0 -1
- package/lib/commands/respect/har-logs/helpers/build-request-cookies.d.ts +0 -2
- package/lib/commands/respect/har-logs/helpers/build-request-cookies.d.ts.map +0 -1
- package/lib/commands/respect/har-logs/helpers/build-request-cookies.js +0 -18
- package/lib/commands/respect/har-logs/helpers/build-request-cookies.js.map +0 -1
- package/lib/commands/respect/har-logs/helpers/build-response-cookies.d.ts +0 -2
- package/lib/commands/respect/har-logs/helpers/build-response-cookies.d.ts.map +0 -1
- package/lib/commands/respect/har-logs/helpers/build-response-cookies.js +0 -40
- package/lib/commands/respect/har-logs/helpers/build-response-cookies.js.map +0 -1
- package/lib/commands/respect/har-logs/helpers/get-duration.d.ts +0 -2
- package/lib/commands/respect/har-logs/helpers/get-duration.d.ts.map +0 -1
- package/lib/commands/respect/har-logs/helpers/get-duration.js +0 -6
- package/lib/commands/respect/har-logs/helpers/get-duration.js.map +0 -1
- package/lib/commands/respect/har-logs/index.d.ts +0 -2
- package/lib/commands/respect/har-logs/index.d.ts.map +0 -1
- package/lib/commands/respect/har-logs/index.js +0 -2
- package/lib/commands/respect/har-logs/index.js.map +0 -1
- package/lib/commands/respect/har-logs/with-har.d.ts +0 -7
- package/lib/commands/respect/har-logs/with-har.d.ts.map +0 -1
- package/lib/commands/respect/har-logs/with-har.js +0 -182
- package/lib/commands/respect/har-logs/with-har.js.map +0 -1
- package/lib/commands/respect/index.d.ts +0 -27
- package/lib/commands/respect/index.d.ts.map +0 -1
- package/lib/commands/respect/index.js +0 -115
- package/lib/commands/respect/index.js.map +0 -1
- package/lib/commands/respect/json-logs.d.ts +0 -11
- package/lib/commands/respect/json-logs.d.ts.map +0 -1
- package/lib/commands/respect/json-logs.js +0 -85
- package/lib/commands/respect/json-logs.js.map +0 -1
- package/lib/commands/respect/mtls/resolve-mtls-certificates.d.ts +0 -9
- package/lib/commands/respect/mtls/resolve-mtls-certificates.d.ts.map +0 -1
- package/lib/commands/respect/mtls/resolve-mtls-certificates.js +0 -48
- package/lib/commands/respect/mtls/resolve-mtls-certificates.js.map +0 -1
- package/lib/commands/respect/mtls/validate-mtls-command-option.d.ts +0 -3
- package/lib/commands/respect/mtls/validate-mtls-command-option.d.ts.map +0 -1
- package/lib/commands/respect/mtls/validate-mtls-command-option.js +0 -55
- package/lib/commands/respect/mtls/validate-mtls-command-option.js.map +0 -1
- package/lib/commands/score/collect-metrics.d.ts +0 -17
- package/lib/commands/score/collect-metrics.d.ts.map +0 -1
- package/lib/commands/score/collect-metrics.js +0 -195
- package/lib/commands/score/collect-metrics.js.map +0 -1
- package/lib/commands/score/collectors/dependency-graph.d.ts +0 -9
- package/lib/commands/score/collectors/dependency-graph.d.ts.map +0 -1
- package/lib/commands/score/collectors/dependency-graph.js +0 -61
- package/lib/commands/score/collectors/dependency-graph.js.map +0 -1
- package/lib/commands/score/collectors/document-metrics.d.ts +0 -69
- package/lib/commands/score/collectors/document-metrics.d.ts.map +0 -1
- package/lib/commands/score/collectors/document-metrics.js +0 -343
- package/lib/commands/score/collectors/document-metrics.js.map +0 -1
- package/lib/commands/score/constants.d.ts +0 -4
- package/lib/commands/score/constants.d.ts.map +0 -1
- package/lib/commands/score/constants.js +0 -47
- package/lib/commands/score/constants.js.map +0 -1
- package/lib/commands/score/formatters/json.d.ts +0 -3
- package/lib/commands/score/formatters/json.d.ts.map +0 -1
- package/lib/commands/score/formatters/json.js +0 -20
- package/lib/commands/score/formatters/json.js.map +0 -1
- package/lib/commands/score/formatters/stylish.d.ts +0 -4
- package/lib/commands/score/formatters/stylish.d.ts.map +0 -1
- package/lib/commands/score/formatters/stylish.js +0 -235
- package/lib/commands/score/formatters/stylish.js.map +0 -1
- package/lib/commands/score/hotspots.d.ts +0 -3
- package/lib/commands/score/hotspots.d.ts.map +0 -1
- package/lib/commands/score/hotspots.js +0 -70
- package/lib/commands/score/hotspots.js.map +0 -1
- package/lib/commands/score/index.d.ts +0 -11
- package/lib/commands/score/index.d.ts.map +0 -1
- package/lib/commands/score/index.js +0 -69
- package/lib/commands/score/index.js.map +0 -1
- package/lib/commands/score/scoring.d.ts +0 -14
- package/lib/commands/score/scoring.d.ts.map +0 -1
- package/lib/commands/score/scoring.js +0 -136
- package/lib/commands/score/scoring.js.map +0 -1
- package/lib/commands/score/types.d.ts +0 -119
- package/lib/commands/score/types.d.ts.map +0 -1
- package/lib/commands/score/types.js +0 -2
- package/lib/commands/score/types.js.map +0 -1
- package/lib/commands/score/utils.d.ts +0 -2
- package/lib/commands/score/utils.d.ts.map +0 -1
- package/lib/commands/score/utils.js +0 -8
- package/lib/commands/score/utils.js.map +0 -1
- package/lib/commands/scorecard-classic/auth/login-handler.d.ts +0 -3
- package/lib/commands/scorecard-classic/auth/login-handler.d.ts.map +0 -1
- package/lib/commands/scorecard-classic/auth/login-handler.js +0 -31
- package/lib/commands/scorecard-classic/auth/login-handler.js.map +0 -1
- package/lib/commands/scorecard-classic/formatters/checkstyle-formatter.d.ts +0 -3
- package/lib/commands/scorecard-classic/formatters/checkstyle-formatter.d.ts.map +0 -1
- package/lib/commands/scorecard-classic/formatters/checkstyle-formatter.js +0 -28
- package/lib/commands/scorecard-classic/formatters/checkstyle-formatter.js.map +0 -1
- package/lib/commands/scorecard-classic/formatters/json-formatter.d.ts +0 -27
- package/lib/commands/scorecard-classic/formatters/json-formatter.d.ts.map +0 -1
- package/lib/commands/scorecard-classic/formatters/json-formatter.js +0 -67
- package/lib/commands/scorecard-classic/formatters/json-formatter.js.map +0 -1
- package/lib/commands/scorecard-classic/formatters/junit-formatter.d.ts +0 -3
- package/lib/commands/scorecard-classic/formatters/junit-formatter.d.ts.map +0 -1
- package/lib/commands/scorecard-classic/formatters/junit-formatter.js +0 -67
- package/lib/commands/scorecard-classic/formatters/junit-formatter.js.map +0 -1
- package/lib/commands/scorecard-classic/formatters/stylish-formatter.d.ts +0 -3
- package/lib/commands/scorecard-classic/formatters/stylish-formatter.d.ts.map +0 -1
- package/lib/commands/scorecard-classic/formatters/stylish-formatter.js +0 -57
- package/lib/commands/scorecard-classic/formatters/stylish-formatter.js.map +0 -1
- package/lib/commands/scorecard-classic/index.d.ts +0 -4
- package/lib/commands/scorecard-classic/index.d.ts.map +0 -1
- package/lib/commands/scorecard-classic/index.js +0 -120
- package/lib/commands/scorecard-classic/index.js.map +0 -1
- package/lib/commands/scorecard-classic/remote/fetch-scorecard.d.ts +0 -9
- package/lib/commands/scorecard-classic/remote/fetch-scorecard.d.ts.map +0 -1
- package/lib/commands/scorecard-classic/remote/fetch-scorecard.js +0 -126
- package/lib/commands/scorecard-classic/remote/fetch-scorecard.js.map +0 -1
- package/lib/commands/scorecard-classic/targets-handler/targets-handler.d.ts +0 -13
- package/lib/commands/scorecard-classic/targets-handler/targets-handler.d.ts.map +0 -1
- package/lib/commands/scorecard-classic/targets-handler/targets-handler.js +0 -55
- package/lib/commands/scorecard-classic/targets-handler/targets-handler.js.map +0 -1
- package/lib/commands/scorecard-classic/types.d.ts +0 -27
- package/lib/commands/scorecard-classic/types.d.ts.map +0 -1
- package/lib/commands/scorecard-classic/types.js +0 -2
- package/lib/commands/scorecard-classic/types.js.map +0 -1
- package/lib/commands/scorecard-classic/validation/plugin-evaluator.d.ts +0 -3
- package/lib/commands/scorecard-classic/validation/plugin-evaluator.d.ts.map +0 -1
- package/lib/commands/scorecard-classic/validation/plugin-evaluator.js +0 -45
- package/lib/commands/scorecard-classic/validation/plugin-evaluator.js.map +0 -1
- package/lib/commands/scorecard-classic/validation/project-url.d.ts +0 -2
- package/lib/commands/scorecard-classic/validation/project-url.d.ts.map +0 -1
- package/lib/commands/scorecard-classic/validation/project-url.js +0 -11
- package/lib/commands/scorecard-classic/validation/project-url.js.map +0 -1
- package/lib/commands/scorecard-classic/validation/validate-scorecard.d.ts +0 -21
- package/lib/commands/scorecard-classic/validation/validate-scorecard.d.ts.map +0 -1
- package/lib/commands/scorecard-classic/validation/validate-scorecard.js +0 -87
- package/lib/commands/scorecard-classic/validation/validate-scorecard.js.map +0 -1
- package/lib/commands/split/asyncapi/constants.d.ts +0 -6
- package/lib/commands/split/asyncapi/constants.d.ts.map +0 -1
- package/lib/commands/split/asyncapi/constants.js +0 -71
- package/lib/commands/split/asyncapi/constants.js.map +0 -1
- package/lib/commands/split/asyncapi/find-asyncapi-component-types.d.ts +0 -2
- package/lib/commands/split/asyncapi/find-asyncapi-component-types.d.ts.map +0 -1
- package/lib/commands/split/asyncapi/find-asyncapi-component-types.js +0 -8
- package/lib/commands/split/asyncapi/find-asyncapi-component-types.js.map +0 -1
- package/lib/commands/split/asyncapi/gather-asyncapi-component-files.d.ts +0 -9
- package/lib/commands/split/asyncapi/gather-asyncapi-component-files.d.ts.map +0 -1
- package/lib/commands/split/asyncapi/gather-asyncapi-component-files.js +0 -28
- package/lib/commands/split/asyncapi/gather-asyncapi-component-files.js.map +0 -1
- package/lib/commands/split/asyncapi/iterate-asyncapi-channels.d.ts +0 -10
- package/lib/commands/split/asyncapi/iterate-asyncapi-channels.d.ts.map +0 -1
- package/lib/commands/split/asyncapi/iterate-asyncapi-channels.js +0 -29
- package/lib/commands/split/asyncapi/iterate-asyncapi-channels.js.map +0 -1
- package/lib/commands/split/asyncapi/iterate-asyncapi-components.d.ts +0 -10
- package/lib/commands/split/asyncapi/iterate-asyncapi-components.d.ts.map +0 -1
- package/lib/commands/split/asyncapi/iterate-asyncapi-components.js +0 -43
- package/lib/commands/split/asyncapi/iterate-asyncapi-components.js.map +0 -1
- package/lib/commands/split/asyncapi/iterate-asyncapi-operations.d.ts +0 -11
- package/lib/commands/split/asyncapi/iterate-asyncapi-operations.d.ts.map +0 -1
- package/lib/commands/split/asyncapi/iterate-asyncapi-operations.js +0 -28
- package/lib/commands/split/asyncapi/iterate-asyncapi-operations.js.map +0 -1
- package/lib/commands/split/asyncapi/remove-asyncapi-empty-components.d.ts +0 -3
- package/lib/commands/split/asyncapi/remove-asyncapi-empty-components.d.ts.map +0 -1
- package/lib/commands/split/asyncapi/remove-asyncapi-empty-components.js +0 -13
- package/lib/commands/split/asyncapi/remove-asyncapi-empty-components.js.map +0 -1
- package/lib/commands/split/asyncapi/split-asyncapi-definition.d.ts +0 -9
- package/lib/commands/split/asyncapi/split-asyncapi-definition.d.ts.map +0 -1
- package/lib/commands/split/asyncapi/split-asyncapi-definition.js +0 -51
- package/lib/commands/split/asyncapi/split-asyncapi-definition.js.map +0 -1
- package/lib/commands/split/constants.d.ts +0 -7
- package/lib/commands/split/constants.d.ts.map +0 -1
- package/lib/commands/split/constants.js +0 -7
- package/lib/commands/split/constants.js.map +0 -1
- package/lib/commands/split/index.d.ts +0 -6
- package/lib/commands/split/index.d.ts.map +0 -1
- package/lib/commands/split/index.js +0 -46
- package/lib/commands/split/index.js.map +0 -1
- package/lib/commands/split/oas/constants.d.ts +0 -3
- package/lib/commands/split/oas/constants.d.ts.map +0 -1
- package/lib/commands/split/oas/constants.js +0 -23
- package/lib/commands/split/oas/constants.js.map +0 -1
- package/lib/commands/split/oas/split-oas-definition.d.ts +0 -3
- package/lib/commands/split/oas/split-oas-definition.d.ts.map +0 -1
- package/lib/commands/split/oas/split-oas-definition.js +0 -19
- package/lib/commands/split/oas/split-oas-definition.js.map +0 -1
- package/lib/commands/split/types.d.ts +0 -28
- package/lib/commands/split/types.d.ts.map +0 -1
- package/lib/commands/split/types.js +0 -2
- package/lib/commands/split/types.js.map +0 -1
- package/lib/commands/split/utils/assert-within-dir.d.ts +0 -2
- package/lib/commands/split/utils/assert-within-dir.d.ts.map +0 -1
- package/lib/commands/split/utils/assert-within-dir.js +0 -10
- package/lib/commands/split/utils/assert-within-dir.js.map +0 -1
- package/lib/commands/split/utils/crawl.d.ts +0 -2
- package/lib/commands/split/utils/crawl.d.ts.map +0 -1
- package/lib/commands/split/utils/crawl.js +0 -15
- package/lib/commands/split/utils/crawl.js.map +0 -1
- package/lib/commands/split/utils/create-component-dir.d.ts +0 -2
- package/lib/commands/split/utils/create-component-dir.d.ts.map +0 -1
- package/lib/commands/split/utils/create-component-dir.js +0 -8
- package/lib/commands/split/utils/create-component-dir.js.map +0 -1
- package/lib/commands/split/utils/does-file-differ.d.ts +0 -2
- package/lib/commands/split/utils/does-file-differ.d.ts.map +0 -1
- package/lib/commands/split/utils/does-file-differ.js +0 -7
- package/lib/commands/split/utils/does-file-differ.js.map +0 -1
- package/lib/commands/split/utils/extract-filename-from-path.d.ts +0 -2
- package/lib/commands/split/utils/extract-filename-from-path.d.ts.map +0 -1
- package/lib/commands/split/utils/extract-filename-from-path.js +0 -5
- package/lib/commands/split/utils/extract-filename-from-path.js.map +0 -1
- package/lib/commands/split/utils/find-component-type.d.ts +0 -3
- package/lib/commands/split/utils/find-component-type.d.ts.map +0 -1
- package/lib/commands/split/utils/find-component-type.js +0 -8
- package/lib/commands/split/utils/find-component-type.js.map +0 -1
- package/lib/commands/split/utils/gather-components-files.d.ts +0 -4
- package/lib/commands/split/utils/gather-components-files.d.ts.map +0 -1
- package/lib/commands/split/utils/gather-components-files.js +0 -12
- package/lib/commands/split/utils/gather-components-files.js.map +0 -1
- package/lib/commands/split/utils/get-file-name-path.d.ts +0 -2
- package/lib/commands/split/utils/get-file-name-path.d.ts.map +0 -1
- package/lib/commands/split/utils/get-file-name-path.js +0 -5
- package/lib/commands/split/utils/get-file-name-path.js.map +0 -1
- package/lib/commands/split/utils/implicitly-reference-discriminator.d.ts +0 -2
- package/lib/commands/split/utils/implicitly-reference-discriminator.d.ts.map +0 -1
- package/lib/commands/split/utils/implicitly-reference-discriminator.js +0 -31
- package/lib/commands/split/utils/implicitly-reference-discriminator.js.map +0 -1
- package/lib/commands/split/utils/is-not-security-component-type.d.ts +0 -2
- package/lib/commands/split/utils/is-not-security-component-type.d.ts.map +0 -1
- package/lib/commands/split/utils/is-not-security-component-type.js +0 -4
- package/lib/commands/split/utils/is-not-security-component-type.js.map +0 -1
- package/lib/commands/split/utils/is-supported-extension.d.ts +0 -2
- package/lib/commands/split/utils/is-supported-extension.d.ts.map +0 -1
- package/lib/commands/split/utils/is-supported-extension.js +0 -4
- package/lib/commands/split/utils/is-supported-extension.js.map +0 -1
- package/lib/commands/split/utils/iterate-components.d.ts +0 -3
- package/lib/commands/split/utils/iterate-components.d.ts.map +0 -1
- package/lib/commands/split/utils/iterate-components.js +0 -57
- package/lib/commands/split/utils/iterate-components.js.map +0 -1
- package/lib/commands/split/utils/iterate-path-items.d.ts +0 -3
- package/lib/commands/split/utils/iterate-path-items.d.ts.map +0 -1
- package/lib/commands/split/utils/iterate-path-items.js +0 -45
- package/lib/commands/split/utils/iterate-path-items.js.map +0 -1
- package/lib/commands/split/utils/remove-empty-components.d.ts +0 -4
- package/lib/commands/split/utils/remove-empty-components.d.ts.map +0 -1
- package/lib/commands/split/utils/remove-empty-components.js +0 -10
- package/lib/commands/split/utils/remove-empty-components.js.map +0 -1
- package/lib/commands/split/utils/replace-$-refs.d.ts +0 -3
- package/lib/commands/split/utils/replace-$-refs.d.ts.map +0 -1
- package/lib/commands/split/utils/replace-$-refs.js +0 -34
- package/lib/commands/split/utils/replace-$-refs.js.map +0 -1
- package/lib/commands/split/utils/replace-channel-refs.d.ts +0 -3
- package/lib/commands/split/utils/replace-channel-refs.d.ts.map +0 -1
- package/lib/commands/split/utils/replace-channel-refs.js +0 -30
- package/lib/commands/split/utils/replace-channel-refs.js.map +0 -1
- package/lib/commands/split/utils/starts-with-components.d.ts +0 -2
- package/lib/commands/split/utils/starts-with-components.d.ts.map +0 -1
- package/lib/commands/split/utils/starts-with-components.js +0 -5
- package/lib/commands/split/utils/starts-with-components.js.map +0 -1
- package/lib/commands/split/utils/traverse-directory-deep.d.ts +0 -3
- package/lib/commands/split/utils/traverse-directory-deep.d.ts.map +0 -1
- package/lib/commands/split/utils/traverse-directory-deep.js +0 -27
- package/lib/commands/split/utils/traverse-directory-deep.js.map +0 -1
- package/lib/commands/stats/index.d.ts +0 -9
- package/lib/commands/stats/index.d.ts.map +0 -1
- package/lib/commands/stats/index.js +0 -42
- package/lib/commands/stats/index.js.map +0 -1
- package/lib/commands/stats/print-stats/index.d.ts +0 -3
- package/lib/commands/stats/print-stats/index.d.ts.map +0 -1
- package/lib/commands/stats/print-stats/index.js +0 -22
- package/lib/commands/stats/print-stats/index.js.map +0 -1
- package/lib/commands/stats/print-stats/json.d.ts +0 -3
- package/lib/commands/stats/print-stats/json.d.ts.map +0 -1
- package/lib/commands/stats/print-stats/json.js +0 -13
- package/lib/commands/stats/print-stats/json.js.map +0 -1
- package/lib/commands/stats/print-stats/markdown.d.ts +0 -3
- package/lib/commands/stats/print-stats/markdown.d.ts.map +0 -1
- package/lib/commands/stats/print-stats/markdown.js +0 -10
- package/lib/commands/stats/print-stats/markdown.js.map +0 -1
- package/lib/commands/stats/print-stats/stylish.d.ts +0 -3
- package/lib/commands/stats/print-stats/stylish.d.ts.map +0 -1
- package/lib/commands/stats/print-stats/stylish.js +0 -11
- package/lib/commands/stats/print-stats/stylish.js.map +0 -1
- package/lib/commands/stats/visitor-and-accumulator-resolver.d.ts +0 -103
- package/lib/commands/stats/visitor-and-accumulator-resolver.d.ts.map +0 -1
- package/lib/commands/stats/visitor-and-accumulator-resolver.js +0 -46
- package/lib/commands/stats/visitor-and-accumulator-resolver.js.map +0 -1
- package/lib/commands/translations.d.ts +0 -8
- package/lib/commands/translations.d.ts.map +0 -1
- package/lib/commands/translations.js +0 -18
- package/lib/commands/translations.js.map +0 -1
- package/lib/index.d.ts +0 -3
- package/lib/index.d.ts.map +0 -1
- package/lib/index.js.map +0 -1
- package/lib/reunite/api/api-client.d.ts +0 -83
- package/lib/reunite/api/api-client.d.ts.map +0 -1
- package/lib/reunite/api/api-client.js +0 -262
- package/lib/reunite/api/api-client.js.map +0 -1
- package/lib/reunite/api/api-keys.d.ts +0 -2
- package/lib/reunite/api/api-keys.d.ts.map +0 -1
- package/lib/reunite/api/api-keys.js +0 -7
- package/lib/reunite/api/api-keys.js.map +0 -1
- package/lib/reunite/api/domains.d.ts +0 -12
- package/lib/reunite/api/domains.d.ts.map +0 -1
- package/lib/reunite/api/domains.js +0 -52
- package/lib/reunite/api/domains.js.map +0 -1
- package/lib/reunite/api/index.d.ts +0 -4
- package/lib/reunite/api/index.d.ts.map +0 -1
- package/lib/reunite/api/index.js +0 -4
- package/lib/reunite/api/index.js.map +0 -1
- package/lib/reunite/api/types.d.ts +0 -103
- package/lib/reunite/api/types.d.ts.map +0 -1
- package/lib/reunite/api/types.js +0 -2
- package/lib/reunite/api/types.js.map +0 -1
- package/lib/reunite/commands/push-status.d.ts +0 -24
- package/lib/reunite/commands/push-status.d.ts.map +0 -1
- package/lib/reunite/commands/push-status.js +0 -199
- package/lib/reunite/commands/push-status.js.map +0 -1
- package/lib/reunite/commands/push.d.ts +0 -28
- package/lib/reunite/commands/push.d.ts.map +0 -1
- package/lib/reunite/commands/push.js +0 -135
- package/lib/reunite/commands/push.js.map +0 -1
- package/lib/reunite/commands/utils.d.ts +0 -26
- package/lib/reunite/commands/utils.d.ts.map +0 -1
- package/lib/reunite/commands/utils.js +0 -49
- package/lib/reunite/commands/utils.js.map +0 -1
- package/lib/reunite/utils.d.ts +0 -3
- package/lib/reunite/utils.d.ts.map +0 -1
- package/lib/reunite/utils.js +0 -3
- package/lib/reunite/utils.js.map +0 -1
- package/lib/types.d.ts +0 -33
- package/lib/types.d.ts.map +0 -1
- package/lib/types.js +0 -2
- package/lib/types.js.map +0 -1
- package/lib/utils/assert-node-version.d.ts +0 -2
- package/lib/utils/assert-node-version.d.ts.map +0 -1
- package/lib/utils/assert-node-version.js +0 -14
- package/lib/utils/assert-node-version.js.map +0 -1
- package/lib/utils/constants.d.ts +0 -5
- package/lib/utils/constants.d.ts.map +0 -1
- package/lib/utils/constants.js +0 -5
- package/lib/utils/constants.js.map +0 -1
- package/lib/utils/error.d.ts +0 -4
- package/lib/utils/error.d.ts.map +0 -1
- package/lib/utils/error.js +0 -8
- package/lib/utils/error.js.map +0 -1
- package/lib/utils/fetch-with-timeout.d.ts +0 -6
- package/lib/utils/fetch-with-timeout.d.ts.map +0 -1
- package/lib/utils/fetch-with-timeout.js +0 -24
- package/lib/utils/fetch-with-timeout.js.map +0 -1
- package/lib/utils/get-command-name-from-args.d.ts +0 -3
- package/lib/utils/get-command-name-from-args.d.ts.map +0 -1
- package/lib/utils/get-command-name-from-args.js +0 -4
- package/lib/utils/get-command-name-from-args.js.map +0 -1
- package/lib/utils/json-stringify-with-array-buffer.d.ts +0 -2
- package/lib/utils/json-stringify-with-array-buffer.d.ts.map +0 -1
- package/lib/utils/json-stringify-with-array-buffer.js +0 -32
- package/lib/utils/json-stringify-with-array-buffer.js.map +0 -1
- package/lib/utils/miscellaneous.d.ts +0 -46
- package/lib/utils/miscellaneous.d.ts.map +0 -1
- package/lib/utils/miscellaneous.js +0 -443
- package/lib/utils/miscellaneous.js.map +0 -1
- package/lib/utils/network-check.d.ts +0 -2
- package/lib/utils/network-check.d.ts.map +0 -1
- package/lib/utils/network-check.js +0 -12
- package/lib/utils/network-check.js.map +0 -1
- package/lib/utils/otel.d.ts +0 -8
- package/lib/utils/otel.d.ts.map +0 -1
- package/lib/utils/otel.js +0 -40
- package/lib/utils/otel.js.map +0 -1
- package/lib/utils/package.d.ts +0 -2
- package/lib/utils/package.d.ts.map +0 -1
- package/lib/utils/package.js +0 -4
- package/lib/utils/package.js.map +0 -1
- package/lib/utils/platform.d.ts +0 -17
- package/lib/utils/platform.d.ts.map +0 -1
- package/lib/utils/platform.js +0 -30
- package/lib/utils/platform.js.map +0 -1
- package/lib/utils/proxy-agent.d.ts +0 -5
- package/lib/utils/proxy-agent.d.ts.map +0 -1
- package/lib/utils/proxy-agent.js +0 -41
- package/lib/utils/proxy-agent.js.map +0 -1
- package/lib/utils/read-env-variables.d.ts +0 -2
- package/lib/utils/read-env-variables.d.ts.map +0 -1
- package/lib/utils/read-env-variables.js +0 -18
- package/lib/utils/read-env-variables.js.map +0 -1
- package/lib/utils/spinner.d.ts +0 -11
- package/lib/utils/spinner.d.ts.map +0 -1
- package/lib/utils/spinner.js +0 -44
- package/lib/utils/spinner.js.map +0 -1
- package/lib/utils/strip-ansi-codes.d.ts +0 -2
- package/lib/utils/strip-ansi-codes.d.ts.map +0 -1
- package/lib/utils/strip-ansi-codes.js +0 -6
- package/lib/utils/strip-ansi-codes.js.map +0 -1
- package/lib/utils/telemetry.d.ts +0 -26
- package/lib/utils/telemetry.d.ts.map +0 -1
- package/lib/utils/telemetry.js +0 -291
- package/lib/utils/telemetry.js.map +0 -1
- package/lib/utils/update-version-notifier.d.ts +0 -3
- package/lib/utils/update-version-notifier.d.ts.map +0 -1
- package/lib/utils/update-version-notifier.js +0 -100
- package/lib/utils/update-version-notifier.js.map +0 -1
- package/lib/utils/validate-mount-path.d.ts +0 -2
- package/lib/utils/validate-mount-path.d.ts.map +0 -1
- package/lib/utils/validate-mount-path.js +0 -7
- package/lib/utils/validate-mount-path.js.map +0 -1
- package/lib/utils/validate-positive-number.d.ts +0 -2
- package/lib/utils/validate-positive-number.d.ts.map +0 -1
- package/lib/utils/validate-positive-number.js +0 -13
- package/lib/utils/validate-positive-number.js.map +0 -1
- package/lib/wrapper.d.ts +0 -11
- package/lib/wrapper.d.ts.map +0 -1
- package/lib/wrapper.js +0 -99
- package/lib/wrapper.js.map +0 -1
|
@@ -1,61 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Builds a dependency graph from shared $ref usage across operations.
|
|
3
|
-
* An edge from A to B means both A and B reference the same schema $ref.
|
|
4
|
-
* The depth for each operation is the longest path from a root node (no incoming edges)
|
|
5
|
-
* in the undirected "shared ref" graph.
|
|
6
|
-
*/
|
|
7
|
-
export function computeDependencyDepths(operations) {
|
|
8
|
-
const refToOps = new Map();
|
|
9
|
-
for (const [opKey, metrics] of operations) {
|
|
10
|
-
for (const ref of metrics.refsUsed) {
|
|
11
|
-
let ops = refToOps.get(ref);
|
|
12
|
-
if (!ops) {
|
|
13
|
-
ops = new Set();
|
|
14
|
-
refToOps.set(ref, ops);
|
|
15
|
-
}
|
|
16
|
-
ops.add(opKey);
|
|
17
|
-
}
|
|
18
|
-
}
|
|
19
|
-
const adjacency = new Map();
|
|
20
|
-
for (const opKey of operations.keys()) {
|
|
21
|
-
adjacency.set(opKey, new Set());
|
|
22
|
-
}
|
|
23
|
-
for (const ops of refToOps.values()) {
|
|
24
|
-
if (ops.size < 2)
|
|
25
|
-
continue;
|
|
26
|
-
const opArray = Array.from(ops);
|
|
27
|
-
for (let i = 0; i < opArray.length; i++) {
|
|
28
|
-
for (let j = i + 1; j < opArray.length; j++) {
|
|
29
|
-
adjacency.get(opArray[i]).add(opArray[j]);
|
|
30
|
-
adjacency.get(opArray[j]).add(opArray[i]);
|
|
31
|
-
}
|
|
32
|
-
}
|
|
33
|
-
}
|
|
34
|
-
const depths = new Map();
|
|
35
|
-
for (const opKey of operations.keys()) {
|
|
36
|
-
const depth = computeLongestBfsPath(opKey, adjacency);
|
|
37
|
-
depths.set(opKey, depth);
|
|
38
|
-
}
|
|
39
|
-
return depths;
|
|
40
|
-
}
|
|
41
|
-
function computeLongestBfsPath(start, adjacency) {
|
|
42
|
-
const visited = new Set([start]);
|
|
43
|
-
let queue = [start];
|
|
44
|
-
let depth = 0;
|
|
45
|
-
while (queue.length > 0) {
|
|
46
|
-
const next = [];
|
|
47
|
-
for (const node of queue) {
|
|
48
|
-
for (const neighbor of adjacency.get(node) ?? []) {
|
|
49
|
-
if (!visited.has(neighbor)) {
|
|
50
|
-
visited.add(neighbor);
|
|
51
|
-
next.push(neighbor);
|
|
52
|
-
}
|
|
53
|
-
}
|
|
54
|
-
}
|
|
55
|
-
if (next.length > 0)
|
|
56
|
-
depth++;
|
|
57
|
-
queue = next;
|
|
58
|
-
}
|
|
59
|
-
return depth;
|
|
60
|
-
}
|
|
61
|
-
//# sourceMappingURL=dependency-graph.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"dependency-graph.js","sourceRoot":"","sources":["../../../../src/commands/score/collectors/dependency-graph.ts"],"names":[],"mappings":"AAEA;;;;;GAKG;AACH,MAA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1,69 +0,0 @@
|
|
|
1
|
-
import { type Oas3Visitor, type Oas3Parameter, type Oas3Schema, type Oas3_1Schema, type Referenced } from '@redocly/openapi-core';
|
|
2
|
-
import type { DebugMediaTypeLog, DebugSchemaEntry, DocumentMetrics, OperationMetrics, SchemaStats } from '../types.js';
|
|
3
|
-
type Schema = Oas3Schema | Oas3_1Schema;
|
|
4
|
-
type Param = Oas3Parameter<Schema>;
|
|
5
|
-
export interface SchemaWalkState {
|
|
6
|
-
depth: number;
|
|
7
|
-
maxDepth: number;
|
|
8
|
-
polymorphismCount: number;
|
|
9
|
-
anyOfCount: number;
|
|
10
|
-
hasDiscriminator: boolean;
|
|
11
|
-
totalSchemaProperties: number;
|
|
12
|
-
schemaPropertiesWithDescription: number;
|
|
13
|
-
constraintCount: number;
|
|
14
|
-
hasPropertyExamples: boolean;
|
|
15
|
-
writableTopLevelFields: number;
|
|
16
|
-
refsUsed: string[];
|
|
17
|
-
debugEntries: DebugSchemaEntry[] | null;
|
|
18
|
-
pendingRef: string | null;
|
|
19
|
-
}
|
|
20
|
-
export declare function createSchemaWalkState(): SchemaWalkState;
|
|
21
|
-
export declare function resetSchemaWalkState(s: SchemaWalkState): void;
|
|
22
|
-
export declare function createSchemaMetricVisitor(state: SchemaWalkState): Oas3Visitor;
|
|
23
|
-
interface CurrentOperationContext {
|
|
24
|
-
path: string;
|
|
25
|
-
method: string;
|
|
26
|
-
operationId?: string;
|
|
27
|
-
operationDescriptionPresent: boolean;
|
|
28
|
-
parameterCount: number;
|
|
29
|
-
requiredParameterCount: number;
|
|
30
|
-
paramsWithDescription: number;
|
|
31
|
-
ambiguousIdentifierCount: number;
|
|
32
|
-
maxRequestSchemaDepth: number;
|
|
33
|
-
maxResponseSchemaDepth: number;
|
|
34
|
-
totalSchemaProperties: number;
|
|
35
|
-
schemaPropertiesWithDescription: number;
|
|
36
|
-
constraintCount: number;
|
|
37
|
-
polymorphismCount: number;
|
|
38
|
-
anyOfCount: number;
|
|
39
|
-
hasDiscriminator: boolean;
|
|
40
|
-
topLevelWritableFieldCount: number;
|
|
41
|
-
requestBodyPresent: boolean;
|
|
42
|
-
requestExamplePresent: boolean;
|
|
43
|
-
responseExamplePresent: boolean;
|
|
44
|
-
structuredErrorResponseCount: number;
|
|
45
|
-
totalErrorResponses: number;
|
|
46
|
-
inRequestBody: boolean;
|
|
47
|
-
inResponse: boolean;
|
|
48
|
-
currentResponseCode: string;
|
|
49
|
-
errorStructuredCounted: boolean;
|
|
50
|
-
/** Internal: best schema walk for polymorphism + anyOf (see `effectivePolymorphismFromCounts`). */
|
|
51
|
-
maxEffectivePolymorphism: number;
|
|
52
|
-
refsUsed: Set<string>;
|
|
53
|
-
}
|
|
54
|
-
export interface ScoreAccumulator {
|
|
55
|
-
operations: Map<string, OperationMetrics>;
|
|
56
|
-
currentPath: string;
|
|
57
|
-
pathLevelParams: Array<Referenced<Param>>;
|
|
58
|
-
current: CurrentOperationContext | null;
|
|
59
|
-
walkSchema: (schema: any, debug?: boolean) => SchemaStats;
|
|
60
|
-
/** Must match scoring `weights.anyOfPenaltyMultiplier` for this run. */
|
|
61
|
-
anyOfPenaltyMultiplier: number;
|
|
62
|
-
debugOperationId?: string;
|
|
63
|
-
debugLogs: DebugMediaTypeLog[];
|
|
64
|
-
}
|
|
65
|
-
export declare function createScoreAccumulator(walkSchema: (schema: any, debug?: boolean) => SchemaStats, anyOfPenaltyMultiplier: number, debugOperationId?: string): ScoreAccumulator;
|
|
66
|
-
export declare function createScoreVisitor(accumulator: ScoreAccumulator): Oas3Visitor;
|
|
67
|
-
export declare function getDocumentMetrics(accumulator: ScoreAccumulator): DocumentMetrics;
|
|
68
|
-
export {};
|
|
69
|
-
//# sourceMappingURL=document-metrics.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"document-metrics.d.ts","sourceRoot":"","sources":["../../../../src/commands/score/collectors/document-metrics.ts"],"names":[],"mappings":"AAAA,OAAO,EAIL,KAAK,WAAW,EAIhB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CAAC,EAAE,OAAO,KAAK,WAAW,EACzD,sBAAsB,EAAE,MAAM,EAC9B,gBAAgB,CAAC,EAAE,MAAM,GACxB,gBAAgB,CAWlB;AA0DD,wBAAgB,kBAAkB,CAAC,WAAW,EAAE,gBAAgB,GAAG,WAAW,CA0J7E;AAED,wBAAgB,kBAAkB,CAAC,WAAW,EAAE,gBAAgB,GAAG,eAAe,CAEjF"}
|
|
@@ -1,343 +0,0 @@
|
|
|
1
|
-
import { isNotEmptyObject, isPlainObject, } from '@redocly/openapi-core';
|
|
2
|
-
import { AMBIGUOUS_PARAM_NAMES } from '../constants.js';
|
|
3
|
-
import { effectivePolymorphismFromCounts } from '../scoring.js';
|
|
4
|
-
/** When two media types have the same property count, pick the triple with stronger doc + constraint signal. */
|
|
5
|
-
function propertyMetricsBundleScore(totalSchemaProperties, schemaPropertiesWithDescription, constraintCount) {
|
|
6
|
-
const p = Math.max(1, totalSchemaProperties);
|
|
7
|
-
return schemaPropertiesWithDescription / p + constraintCount / p;
|
|
8
|
-
}
|
|
9
|
-
function shouldReplacePropertyMetrics(current, stats) {
|
|
10
|
-
if (stats.totalSchemaProperties > current.totalSchemaProperties)
|
|
11
|
-
return true;
|
|
12
|
-
if (stats.totalSchemaProperties < current.totalSchemaProperties)
|
|
13
|
-
return false;
|
|
14
|
-
return (propertyMetricsBundleScore(stats.totalSchemaProperties, stats.schemaPropertiesWithDescription, stats.constraintCount) >
|
|
15
|
-
propertyMetricsBundleScore(current.totalSchemaProperties, current.schemaPropertiesWithDescription, current.constraintCount));
|
|
16
|
-
}
|
|
17
|
-
const CONSTRAINT_KEYS = [
|
|
18
|
-
'enum',
|
|
19
|
-
'const',
|
|
20
|
-
'format',
|
|
21
|
-
'pattern',
|
|
22
|
-
'minimum',
|
|
23
|
-
'maximum',
|
|
24
|
-
'minLength',
|
|
25
|
-
'maxLength',
|
|
26
|
-
'minItems',
|
|
27
|
-
'maxItems',
|
|
28
|
-
'minProperties',
|
|
29
|
-
'maxProperties',
|
|
30
|
-
'multipleOf',
|
|
31
|
-
'exclusiveMinimum',
|
|
32
|
-
'exclusiveMaximum',
|
|
33
|
-
'uniqueItems',
|
|
34
|
-
];
|
|
35
|
-
export function createSchemaWalkState() {
|
|
36
|
-
return {
|
|
37
|
-
depth: -1, // starts at -1 because the root Schema.enter increments to 0
|
|
38
|
-
maxDepth: 0,
|
|
39
|
-
polymorphismCount: 0,
|
|
40
|
-
anyOfCount: 0,
|
|
41
|
-
hasDiscriminator: false,
|
|
42
|
-
totalSchemaProperties: 0,
|
|
43
|
-
schemaPropertiesWithDescription: 0,
|
|
44
|
-
constraintCount: 0,
|
|
45
|
-
hasPropertyExamples: false,
|
|
46
|
-
writableTopLevelFields: 0,
|
|
47
|
-
refsUsed: [],
|
|
48
|
-
debugEntries: null,
|
|
49
|
-
pendingRef: null,
|
|
50
|
-
};
|
|
51
|
-
}
|
|
52
|
-
export function resetSchemaWalkState(s) {
|
|
53
|
-
Object.assign(s, createSchemaWalkState());
|
|
54
|
-
}
|
|
55
|
-
export function createSchemaMetricVisitor(state) {
|
|
56
|
-
return {
|
|
57
|
-
ref: {
|
|
58
|
-
enter(ref) {
|
|
59
|
-
if (typeof ref?.$ref === 'string') {
|
|
60
|
-
state.refsUsed.push(ref.$ref);
|
|
61
|
-
state.pendingRef = ref.$ref;
|
|
62
|
-
}
|
|
63
|
-
},
|
|
64
|
-
},
|
|
65
|
-
Schema: {
|
|
66
|
-
enter(schema, ctx) {
|
|
67
|
-
state.depth++;
|
|
68
|
-
state.maxDepth = Math.max(state.maxDepth, state.depth);
|
|
69
|
-
let localConstraints = 0;
|
|
70
|
-
for (const key of CONSTRAINT_KEYS) {
|
|
71
|
-
if (schema[key] !== undefined) {
|
|
72
|
-
state.constraintCount++;
|
|
73
|
-
localConstraints++;
|
|
74
|
-
}
|
|
75
|
-
}
|
|
76
|
-
if (schema.discriminator?.propertyName)
|
|
77
|
-
state.hasDiscriminator = true;
|
|
78
|
-
const localPoly = {};
|
|
79
|
-
for (const keyword of ['oneOf', 'anyOf', 'allOf']) {
|
|
80
|
-
const list = schema[keyword];
|
|
81
|
-
if (!Array.isArray(list))
|
|
82
|
-
continue;
|
|
83
|
-
state.polymorphismCount += list.length;
|
|
84
|
-
if (keyword === 'anyOf')
|
|
85
|
-
state.anyOfCount += list.length;
|
|
86
|
-
localPoly[keyword] = list.length;
|
|
87
|
-
}
|
|
88
|
-
const localPropertyNames = [];
|
|
89
|
-
if (isPlainObject(schema.properties)) {
|
|
90
|
-
const props = Object.entries(schema.properties);
|
|
91
|
-
state.totalSchemaProperties += props.length;
|
|
92
|
-
for (const [name, prop] of props) {
|
|
93
|
-
localPropertyNames.push(name);
|
|
94
|
-
const res = prop && '$ref' in prop && prop.$ref ? (ctx.resolve(prop)?.node ?? prop) : prop;
|
|
95
|
-
if (res?.description)
|
|
96
|
-
state.schemaPropertiesWithDescription++;
|
|
97
|
-
if (res?.example !== undefined || res?.examples)
|
|
98
|
-
state.hasPropertyExamples = true;
|
|
99
|
-
if (!res?.readOnly)
|
|
100
|
-
state.writableTopLevelFields++;
|
|
101
|
-
}
|
|
102
|
-
}
|
|
103
|
-
if (state.debugEntries !== null) {
|
|
104
|
-
state.debugEntries.push({
|
|
105
|
-
ref: state.pendingRef,
|
|
106
|
-
depth: state.depth,
|
|
107
|
-
propertyNames: localPropertyNames,
|
|
108
|
-
polymorphism: Object.keys(localPoly).length > 0 ? localPoly : {},
|
|
109
|
-
constraintCount: localConstraints,
|
|
110
|
-
});
|
|
111
|
-
}
|
|
112
|
-
state.pendingRef = null;
|
|
113
|
-
},
|
|
114
|
-
leave() {
|
|
115
|
-
state.depth--;
|
|
116
|
-
},
|
|
117
|
-
},
|
|
118
|
-
};
|
|
119
|
-
}
|
|
120
|
-
export function createScoreAccumulator(walkSchema, anyOfPenaltyMultiplier, debugOperationId) {
|
|
121
|
-
return {
|
|
122
|
-
operations: new Map(),
|
|
123
|
-
currentPath: '',
|
|
124
|
-
pathLevelParams: [],
|
|
125
|
-
current: null,
|
|
126
|
-
walkSchema,
|
|
127
|
-
anyOfPenaltyMultiplier,
|
|
128
|
-
debugOperationId,
|
|
129
|
-
debugLogs: [],
|
|
130
|
-
};
|
|
131
|
-
}
|
|
132
|
-
function createOperationContext(path, method, operation) {
|
|
133
|
-
return {
|
|
134
|
-
path,
|
|
135
|
-
method,
|
|
136
|
-
operationId: operation.operationId,
|
|
137
|
-
operationDescriptionPresent: !!operation.description,
|
|
138
|
-
parameterCount: 0,
|
|
139
|
-
requiredParameterCount: 0,
|
|
140
|
-
paramsWithDescription: 0,
|
|
141
|
-
ambiguousIdentifierCount: 0,
|
|
142
|
-
maxRequestSchemaDepth: 0,
|
|
143
|
-
maxResponseSchemaDepth: 0,
|
|
144
|
-
totalSchemaProperties: 0,
|
|
145
|
-
schemaPropertiesWithDescription: 0,
|
|
146
|
-
constraintCount: 0,
|
|
147
|
-
polymorphismCount: 0,
|
|
148
|
-
anyOfCount: 0,
|
|
149
|
-
hasDiscriminator: false,
|
|
150
|
-
topLevelWritableFieldCount: 0,
|
|
151
|
-
requestBodyPresent: false,
|
|
152
|
-
requestExamplePresent: false,
|
|
153
|
-
responseExamplePresent: false,
|
|
154
|
-
structuredErrorResponseCount: 0,
|
|
155
|
-
totalErrorResponses: 0,
|
|
156
|
-
inRequestBody: false,
|
|
157
|
-
inResponse: false,
|
|
158
|
-
currentResponseCode: '',
|
|
159
|
-
errorStructuredCounted: false,
|
|
160
|
-
maxEffectivePolymorphism: -1,
|
|
161
|
-
refsUsed: new Set(),
|
|
162
|
-
};
|
|
163
|
-
}
|
|
164
|
-
function buildOperationMetrics(ctx) {
|
|
165
|
-
const { inRequestBody: _1, inResponse: _2, currentResponseCode: _3, errorStructuredCounted: _4, maxEffectivePolymorphism: _5, ...metrics } = ctx;
|
|
166
|
-
return metrics;
|
|
167
|
-
}
|
|
168
|
-
export function createScoreVisitor(accumulator) {
|
|
169
|
-
return {
|
|
170
|
-
RequestBody: {
|
|
171
|
-
enter() {
|
|
172
|
-
if (!accumulator.current)
|
|
173
|
-
return;
|
|
174
|
-
accumulator.current.requestBodyPresent = true;
|
|
175
|
-
accumulator.current.inRequestBody = true;
|
|
176
|
-
},
|
|
177
|
-
leave() {
|
|
178
|
-
if (accumulator.current)
|
|
179
|
-
accumulator.current.inRequestBody = false;
|
|
180
|
-
},
|
|
181
|
-
},
|
|
182
|
-
Response: {
|
|
183
|
-
enter(response, ctx) {
|
|
184
|
-
const current = accumulator.current;
|
|
185
|
-
if (!current)
|
|
186
|
-
return;
|
|
187
|
-
const code = String(ctx.key);
|
|
188
|
-
current.inResponse = true;
|
|
189
|
-
current.currentResponseCode = code;
|
|
190
|
-
current.errorStructuredCounted = false;
|
|
191
|
-
if (isErrorCode(code)) {
|
|
192
|
-
current.totalErrorResponses++;
|
|
193
|
-
if (!response.content && response.description) {
|
|
194
|
-
current.structuredErrorResponseCount++;
|
|
195
|
-
current.errorStructuredCounted = true;
|
|
196
|
-
}
|
|
197
|
-
}
|
|
198
|
-
},
|
|
199
|
-
leave() {
|
|
200
|
-
if (accumulator.current)
|
|
201
|
-
accumulator.current.inResponse = false;
|
|
202
|
-
},
|
|
203
|
-
},
|
|
204
|
-
MediaType: {
|
|
205
|
-
enter(mediaType) {
|
|
206
|
-
const current = accumulator.current;
|
|
207
|
-
if (!current)
|
|
208
|
-
return;
|
|
209
|
-
if (hasExample(mediaType)) {
|
|
210
|
-
if (current.inRequestBody)
|
|
211
|
-
current.requestExamplePresent = true;
|
|
212
|
-
if (current.inResponse)
|
|
213
|
-
current.responseExamplePresent = true;
|
|
214
|
-
}
|
|
215
|
-
if (current.inResponse &&
|
|
216
|
-
isErrorCode(current.currentResponseCode) &&
|
|
217
|
-
!current.errorStructuredCounted) {
|
|
218
|
-
current.structuredErrorResponseCount++;
|
|
219
|
-
current.errorStructuredCounted = true;
|
|
220
|
-
}
|
|
221
|
-
if (mediaType.schema) {
|
|
222
|
-
const isDebugTarget = !!accumulator.debugOperationId &&
|
|
223
|
-
(current.operationId === accumulator.debugOperationId ||
|
|
224
|
-
`${current.method.toUpperCase()} ${current.path}` === accumulator.debugOperationId);
|
|
225
|
-
const stats = accumulator.walkSchema(mediaType.schema, isDebugTarget);
|
|
226
|
-
if (shouldReplacePropertyMetrics(current, stats)) {
|
|
227
|
-
current.totalSchemaProperties = stats.totalSchemaProperties;
|
|
228
|
-
current.schemaPropertiesWithDescription = stats.schemaPropertiesWithDescription;
|
|
229
|
-
current.constraintCount = stats.constraintCount;
|
|
230
|
-
}
|
|
231
|
-
const effective = effectivePolymorphismFromCounts(stats.polymorphismCount, stats.anyOfCount, accumulator.anyOfPenaltyMultiplier);
|
|
232
|
-
if (effective > current.maxEffectivePolymorphism) {
|
|
233
|
-
current.maxEffectivePolymorphism = effective;
|
|
234
|
-
current.polymorphismCount = stats.polymorphismCount;
|
|
235
|
-
current.anyOfCount = stats.anyOfCount;
|
|
236
|
-
}
|
|
237
|
-
if (stats.hasDiscriminator)
|
|
238
|
-
current.hasDiscriminator = true;
|
|
239
|
-
for (const ref of stats.refsUsed)
|
|
240
|
-
current.refsUsed.add(ref);
|
|
241
|
-
if (stats.hasPropertyExamples) {
|
|
242
|
-
if (current.inRequestBody)
|
|
243
|
-
current.requestExamplePresent = true;
|
|
244
|
-
if (current.inResponse)
|
|
245
|
-
current.responseExamplePresent = true;
|
|
246
|
-
}
|
|
247
|
-
if (current.inRequestBody) {
|
|
248
|
-
current.maxRequestSchemaDepth = Math.max(current.maxRequestSchemaDepth, stats.maxDepth);
|
|
249
|
-
current.topLevelWritableFieldCount = Math.max(current.topLevelWritableFieldCount, stats.writableTopLevelFields);
|
|
250
|
-
}
|
|
251
|
-
if (current.inResponse) {
|
|
252
|
-
current.maxResponseSchemaDepth = Math.max(current.maxResponseSchemaDepth, stats.maxDepth);
|
|
253
|
-
}
|
|
254
|
-
if (isDebugTarget && stats.debugEntries) {
|
|
255
|
-
const context = current.inRequestBody
|
|
256
|
-
? 'REQUEST BODY'
|
|
257
|
-
: `RESPONSE ${current.currentResponseCode}`;
|
|
258
|
-
accumulator.debugLogs.push({
|
|
259
|
-
context,
|
|
260
|
-
entries: stats.debugEntries,
|
|
261
|
-
totalProperties: stats.totalSchemaProperties,
|
|
262
|
-
totalPolymorphism: stats.polymorphismCount,
|
|
263
|
-
totalConstraints: stats.constraintCount,
|
|
264
|
-
maxDepth: stats.maxDepth,
|
|
265
|
-
});
|
|
266
|
-
}
|
|
267
|
-
}
|
|
268
|
-
},
|
|
269
|
-
},
|
|
270
|
-
Paths: {
|
|
271
|
-
PathItem: {
|
|
272
|
-
enter(pathItem, ctx) {
|
|
273
|
-
accumulator.currentPath = String(ctx.key);
|
|
274
|
-
accumulator.pathLevelParams = pathItem.parameters ?? [];
|
|
275
|
-
},
|
|
276
|
-
Operation: {
|
|
277
|
-
enter(operation, ctx) {
|
|
278
|
-
const method = String(ctx.key);
|
|
279
|
-
const current = createOperationContext(accumulator.currentPath, method, operation);
|
|
280
|
-
accumulator.current = current;
|
|
281
|
-
const merged = mergeParameters(accumulator.pathLevelParams, operation.parameters ?? [], ctx.resolve);
|
|
282
|
-
for (const param of merged.values()) {
|
|
283
|
-
current.parameterCount++;
|
|
284
|
-
if (param.required)
|
|
285
|
-
current.requiredParameterCount++;
|
|
286
|
-
if (param.description)
|
|
287
|
-
current.paramsWithDescription++;
|
|
288
|
-
if (isAmbiguousParam(param))
|
|
289
|
-
current.ambiguousIdentifierCount++;
|
|
290
|
-
}
|
|
291
|
-
},
|
|
292
|
-
leave(operation) {
|
|
293
|
-
const current = accumulator.current;
|
|
294
|
-
if (!current)
|
|
295
|
-
return;
|
|
296
|
-
const opKey = operation.operationId ?? `${current.method.toUpperCase()} ${current.path}`;
|
|
297
|
-
accumulator.operations.set(opKey, buildOperationMetrics(current));
|
|
298
|
-
accumulator.current = null;
|
|
299
|
-
},
|
|
300
|
-
},
|
|
301
|
-
},
|
|
302
|
-
},
|
|
303
|
-
};
|
|
304
|
-
}
|
|
305
|
-
export function getDocumentMetrics(accumulator) {
|
|
306
|
-
return { operationCount: accumulator.operations.size, operations: accumulator.operations };
|
|
307
|
-
}
|
|
308
|
-
function resolveParam(raw, resolve) {
|
|
309
|
-
return resolve(raw).node;
|
|
310
|
-
}
|
|
311
|
-
function mergeParameters(pathLevel, opLevel, resolve) {
|
|
312
|
-
const merged = new Map();
|
|
313
|
-
for (const raw of pathLevel) {
|
|
314
|
-
const p = resolveParam(raw, resolve);
|
|
315
|
-
if (p?.name && p.in)
|
|
316
|
-
merged.set(`${p.in}:${p.name}`, p);
|
|
317
|
-
}
|
|
318
|
-
for (const raw of opLevel) {
|
|
319
|
-
const p = resolveParam(raw, resolve);
|
|
320
|
-
if (p?.name && p.in)
|
|
321
|
-
merged.set(`${p.in}:${p.name}`, p);
|
|
322
|
-
}
|
|
323
|
-
return merged;
|
|
324
|
-
}
|
|
325
|
-
function hasExample(mediaType) {
|
|
326
|
-
return mediaType.example !== undefined || isNotEmptyObject(mediaType.examples);
|
|
327
|
-
}
|
|
328
|
-
function isAmbiguousParam(param) {
|
|
329
|
-
if (param.description)
|
|
330
|
-
return false;
|
|
331
|
-
const name = (param.name ?? '').toLowerCase();
|
|
332
|
-
return AMBIGUOUS_PARAM_NAMES.has(name);
|
|
333
|
-
}
|
|
334
|
-
function isErrorCode(code) {
|
|
335
|
-
if (code === 'default')
|
|
336
|
-
return true;
|
|
337
|
-
// OpenAPI 3.1: status ranges 4XX / 5XX (see https://spec.openapis.org/oas/v3.1.0#patterned-fields)
|
|
338
|
-
if (/^4xx$/i.test(code) || /^5xx$/i.test(code))
|
|
339
|
-
return true;
|
|
340
|
-
const num = parseInt(code, 10);
|
|
341
|
-
return num >= 400 && num < 600;
|
|
342
|
-
}
|
|
343
|
-
//# sourceMappingURL=document-metrics.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"document-metrics.js","sourceRoot":"","sources":["../../../../src/commands/score/collectors/document-metrics.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,gBAAgB,E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IAAI,GAAG,CAAC,KAAK,CAAC,IAAI,IAAI,EAAE,CAAC,CAAC,WAAW,EAAE,CAAC;IAC9C,OAAO,qBAAqB,CAAC,GAAG,CAAC,IAAI,CAAC,CAAC;AACzC,CAAC;AAED,SAAS,WAAW,CAAC,IAAY;IAC/B,IAAI,IAAI,KAAK,SAAS;QAAE,OAAO,IAAI,CAAC;IACpC,mGAAmG;IACnG,IAAI,QAAQ,CAAC,IAAI,CAAC,IAAI,CAAC,IAAI,QAAQ,CAAC,IAAI,CAAC,IAAI,CAAC;QAAE,OAAO,IAAI,CAAC;IAC5D,MAAM,GAAG,GAAG,QAAQ,CAAC,IAAI,EAAE,EAAE,CAAC,CAAC;IAC/B,OAAO,GAAG,IAAI,GAAG,IAAI,GAAG,GAAG,GAAG,CAAC;AACjC,CAAC"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"constants.d.ts","sourceRoot":"","sources":["../../../src/commands/score/constants.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,YAAY,CAAC;AAEnD,eAAO,MAAM,yBAAyB,EAAE,gBAuBvC,CAAC;AAEF,eAAO,MAAM,qBAAqB,aAqBhC,CAAC"}
|
|
@@ -1,47 +0,0 @@
|
|
|
1
|
-
export const DEFAULT_SCORING_CONSTANTS = {
|
|
2
|
-
thresholds: {
|
|
3
|
-
maxParamsGood: 5,
|
|
4
|
-
maxDepthGood: 4,
|
|
5
|
-
maxPolymorphismGood: 2,
|
|
6
|
-
maxDependencyDepthGood: 3,
|
|
7
|
-
maxAmbiguousGood: 0,
|
|
8
|
-
maxOperationsForDiscoverability: 1000,
|
|
9
|
-
},
|
|
10
|
-
weights: {
|
|
11
|
-
parameterSimplicity: 0.1,
|
|
12
|
-
schemaSimplicity: 0.1,
|
|
13
|
-
documentationQuality: 0.18,
|
|
14
|
-
constraintClarity: 0.12,
|
|
15
|
-
exampleCoverage: 0.18,
|
|
16
|
-
errorClarity: 0.12,
|
|
17
|
-
dependencyClarity: 0.1,
|
|
18
|
-
identifierClarity: 0.05,
|
|
19
|
-
polymorphismClarity: 0.05,
|
|
20
|
-
anyOfPenaltyMultiplier: 2.0,
|
|
21
|
-
discoverabilityWeight: 0.1,
|
|
22
|
-
},
|
|
23
|
-
hotspotLimit: 10,
|
|
24
|
-
};
|
|
25
|
-
export const AMBIGUOUS_PARAM_NAMES = new Set([
|
|
26
|
-
'id',
|
|
27
|
-
'name',
|
|
28
|
-
'type',
|
|
29
|
-
'value',
|
|
30
|
-
'data',
|
|
31
|
-
'key',
|
|
32
|
-
'status',
|
|
33
|
-
'state',
|
|
34
|
-
'code',
|
|
35
|
-
'result',
|
|
36
|
-
'item',
|
|
37
|
-
'object',
|
|
38
|
-
'resource',
|
|
39
|
-
'entity',
|
|
40
|
-
'input',
|
|
41
|
-
'output',
|
|
42
|
-
'payload',
|
|
43
|
-
'body',
|
|
44
|
-
'content',
|
|
45
|
-
'info',
|
|
46
|
-
]);
|
|
47
|
-
//# sourceMappingURL=constants.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"constants.js","sourceRoot":"","sources":["../../../src/commands/score/constants.ts"],"names":[],"mappings":"AAEA,MAAM,CAAC,MAAM,yBAAyB,GAAqB;IACzD,UAAU,EAAE;QACV,aAAa,EAAE,CAAC;QAChB,YAAY,EAAE,CAAC;QACf,mBAAmB,EAAE,CAAC;QACtB,sBAAsB,EAAE,CAAC;QACzB,gBAAgB,EAAE,CAAC;QACnB,+BAA+B,EAAE,IAAI;KACtC;IACD,OAAO,EAAE;QACP,mBAAmB,EAAE,GAAG;QACxB,gBAAgB,EAAE,GAAG;QACrB,oBAAoB,EAAE,IAAI;QAC1B,iBAAiB,EAAE,IAAI;QACvB,eAAe,EAAE,IAAI;QACrB,YAAY,EAAE,IAAI;QAClB,iBAAiB,EAAE,GAAG;QACtB,iBAAiB,EAAE,IAAI;QACvB,mBAAmB,EAAE,IAAI;QACzB,sBAAsB,EAAE,GAAG;QAC3B,qBAAqB,EAAE,GAAG;KAC3B;IACD,YAAY,EAAE,EAAE;CACjB,CAAC;AAEF,MAAM,CAAC,MAAM,qBAAqB,GAAG,IAAI,GAAG,CAAC;IAC3C,IAAI;IACJ,MAAM;IACN,MAAM;IACN,OAAO;IACP,MAAM;IACN,KAAK;IACL,QAAQ;IACR,OAAO;IACP,MAAM;IACN,QAAQ;IACR,MAAM;IACN,QAAQ;IACR,UAAU;IACV,QAAQ;IACR,OAAO;IACP,QAAQ;IACR,SAAS;IACT,MAAM;IACN,SAAS;IACT,MAAM;CACP,CAAC,CAAC"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"json.d.ts","sourceRoot":"","sources":["../../../../src/commands/score/formatters/json.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,aAAa,CAAC;AAE/C,wBAAgB,cAAc,CAAC,MAAM,EAAE,WAAW,GAAG,IAAI,CAoBxD"}
|
|
@@ -1,20 +0,0 @@
|
|
|
1
|
-
import { logger } from '@redocly/openapi-core';
|
|
2
|
-
export function printScoreJson(result) {
|
|
3
|
-
const output = {
|
|
4
|
-
agentReadiness: result.agentReadiness,
|
|
5
|
-
discoverability: Math.round(result.discoverability * 100),
|
|
6
|
-
subscores: result.subscores,
|
|
7
|
-
rawMetrics: {
|
|
8
|
-
operationCount: result.rawMetrics.operationCount,
|
|
9
|
-
operations: Object.fromEntries(Array.from(result.rawMetrics.operations.entries()).map(([key, m]) => {
|
|
10
|
-
const { refsUsed: _, ...rest } = m;
|
|
11
|
-
return [key, rest];
|
|
12
|
-
})),
|
|
13
|
-
},
|
|
14
|
-
operationScores: Object.fromEntries(result.operationScores),
|
|
15
|
-
dependencyDepths: Object.fromEntries(result.dependencyDepths),
|
|
16
|
-
hotspots: result.hotspots,
|
|
17
|
-
};
|
|
18
|
-
logger.output(JSON.stringify(output, null, 2));
|
|
19
|
-
}
|
|
20
|
-
//# sourceMappingURL=json.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"json.js","sourceRoot":"","sources":["../../../../src/commands/score/formatters/json.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,MAAM,EAAE,MAAM,uBAAuB,CAAC;AAI/C,MAAM,UAAU,cAAc,CAAC,MAAmB;IAChD,MAAM,MAAM,GAAG;QACb,cAAc,EAAE,MAAM,CAAC,cAAc;QACrC,eAAe,EAAE,IAAI,CAAC,KAAK,CAAC,MAAM,CAAC,eAAe,GAAG,GAAG,CAAC;QACzD,SAAS,EAAE,MAAM,CAAC,SAAS;QAC3B,UAAU,EAAE;YACV,cAAc,EAAE,MAAM,CAAC,UAAU,CAAC,cAAc;YAChD,UAAU,EAAE,MAAM,CAAC,WAAW,CAC5B,KAAK,CAAC,IAAI,CAAC,MAAM,CAAC,UAAU,CAAC,UAAU,CAAC,OAAO,EAAE,CAAC,CAAC,GAAG,CAAC,CAAC,CAAC,GAAG,EAAE,CAAC,CAAC,EAAE,EAAE;gBAClE,MAAM,EAAE,QAAQ,EAAE,CAAC,EAAE,GAAG,IAAI,EAAE,GAAG,CAAC,CAAC;gBACnC,OAAO,CAAC,GAAG,EAAE,IAAI,CAAC,CAAC;YACrB,CAAC,CAAC,CACH;SACF;QACD,eAAe,EAAE,MAAM,CAAC,WAAW,CAAC,MAAM,CAAC,eAAe,CAAC;QAC3D,gBAAgB,EAAE,MAAM,CAAC,WAAW,CAAC,MAAM,CAAC,gBAAgB,CAAC;QAC7D,QAAQ,EAAE,MAAM,CAAC,QAAQ;KAC1B,CAAC;IAEF,MAAM,CAAC,MAAM,CAAC,IAAI,CAAC,SAAS,CAAC,MAAM,EAAE,IAAI,EAAE,CAAC,CAAC,CAAC,CAAC;AACjD,CAAC"}
|
|
@@ -1,4 +0,0 @@
|
|
|
1
|
-
import type { DebugMediaTypeLog, ScoreResult } from '../types.js';
|
|
2
|
-
export declare function printScoreStylish(result: ScoreResult, operationDetails?: boolean): void;
|
|
3
|
-
export declare function printDebugOperation(operationId: string, logs: DebugMediaTypeLog[]): void;
|
|
4
|
-
//# sourceMappingURL=stylish.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"stylish.d.ts","sourceRoot":"","sources":["../../../../src/commands/score/formatters/stylish.ts"],"names":[],"mappings":"AAGA,OAAO,KAAK,EAAE,iBAAiB,EAAE,WAAW,EAAE,MAAM,aAAa,CAAC;AAGlE,wBAAgB,iBAAiB,CAAC,MAAM,EAAE,WAAW,EAAE,gBAAgB,UAAQ,GAAG,IAAI,CAMrF;AAqJD,wBAAgB,mBAAmB,CAAC,WAAW,EAAE,MAAM,EAAE,IAAI,EAAE,iBAAiB,EAAE,GAAG,IAAI,CA0FxF"}
|