@redocly/cli 2.33.1 → 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 -27
- 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 -41
- 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 -26
- 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/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 -55
- 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 -42
- 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,199 +0,0 @@
|
|
|
1
|
-
import { logger } from '@redocly/openapi-core';
|
|
2
|
-
import * as colors from 'colorette';
|
|
3
|
-
import { printExecutionTime, capitalize } from '../../utils/miscellaneous.js';
|
|
4
|
-
import { Spinner } from '../../utils/spinner.js';
|
|
5
|
-
import { ReuniteApi, getApiKeys, getDomain } from '../api/index.js';
|
|
6
|
-
import { DeploymentError } from '../utils.js';
|
|
7
|
-
import { handleReuniteError, retryUntilConditionMet } from './utils.js';
|
|
8
|
-
const RETRY_INTERVAL_MS = 5000; // 5 sec
|
|
9
|
-
export async function handlePushStatus({ argv, }) {
|
|
10
|
-
const startedAt = performance.now();
|
|
11
|
-
const spinner = new Spinner();
|
|
12
|
-
const { organization, project: projectId, pushId, wait } = argv;
|
|
13
|
-
const domain = argv.domain || getDomain();
|
|
14
|
-
const maxExecutionTime = argv['max-execution-time'] || 1200; // 20 min
|
|
15
|
-
const retryIntervalMs = argv['retry-interval']
|
|
16
|
-
? argv['retry-interval'] * 1000
|
|
17
|
-
: RETRY_INTERVAL_MS;
|
|
18
|
-
const startTime = argv['start-time'] || Date.now();
|
|
19
|
-
const retryTimeoutMs = maxExecutionTime * 1000;
|
|
20
|
-
const continueOnDeployFailures = argv['continue-on-deploy-failures'] || false;
|
|
21
|
-
try {
|
|
22
|
-
const apiKey = getApiKeys();
|
|
23
|
-
const client = new ReuniteApi({ domain, apiKey, command: 'push-status' });
|
|
24
|
-
let pushResponse;
|
|
25
|
-
pushResponse = await retryUntilConditionMet({
|
|
26
|
-
operation: () => client.remotes.getPush({
|
|
27
|
-
organizationId: organization,
|
|
28
|
-
projectId,
|
|
29
|
-
pushId,
|
|
30
|
-
}),
|
|
31
|
-
condition: wait
|
|
32
|
-
? // Keep retrying if status is "pending" or "running" (returning false, so the operation will be retried)
|
|
33
|
-
(result) => !['pending', 'running'].includes(result.status['preview'].deploy.status)
|
|
34
|
-
: null,
|
|
35
|
-
onConditionNotMet: (lastResult) => {
|
|
36
|
-
displayDeploymentAndBuildStatus({
|
|
37
|
-
status: lastResult.status['preview'].deploy.status,
|
|
38
|
-
url: lastResult.status['preview'].deploy.url,
|
|
39
|
-
spinner,
|
|
40
|
-
buildType: 'preview',
|
|
41
|
-
continueOnDeployFailures,
|
|
42
|
-
wait,
|
|
43
|
-
});
|
|
44
|
-
},
|
|
45
|
-
onRetry: (lastResult) => {
|
|
46
|
-
if (argv.onRetry) {
|
|
47
|
-
argv.onRetry({
|
|
48
|
-
preview: lastResult.status.preview,
|
|
49
|
-
production: lastResult.isMainBranch ? lastResult.status.production : null,
|
|
50
|
-
commit: lastResult.commit,
|
|
51
|
-
});
|
|
52
|
-
}
|
|
53
|
-
},
|
|
54
|
-
startTime,
|
|
55
|
-
retryTimeoutMs,
|
|
56
|
-
retryIntervalMs,
|
|
57
|
-
});
|
|
58
|
-
printPushStatus({
|
|
59
|
-
buildType: 'preview',
|
|
60
|
-
spinner,
|
|
61
|
-
wait,
|
|
62
|
-
push: pushResponse,
|
|
63
|
-
continueOnDeployFailures,
|
|
64
|
-
});
|
|
65
|
-
printScorecard(pushResponse.status.preview.scorecard);
|
|
66
|
-
const shouldWaitForProdDeployment = pushResponse.isMainBranch &&
|
|
67
|
-
(wait ? pushResponse.status.preview.deploy.status === 'success' : true);
|
|
68
|
-
if (shouldWaitForProdDeployment) {
|
|
69
|
-
pushResponse = await retryUntilConditionMet({
|
|
70
|
-
operation: () => client.remotes.getPush({
|
|
71
|
-
organizationId: organization,
|
|
72
|
-
projectId,
|
|
73
|
-
pushId,
|
|
74
|
-
}),
|
|
75
|
-
condition: wait
|
|
76
|
-
? // Keep retrying if status is "pending" or "running" (returning false, so the operation will be retried)
|
|
77
|
-
(result) => !['pending', 'running'].includes(result.status['production'].deploy.status)
|
|
78
|
-
: null,
|
|
79
|
-
onConditionNotMet: (lastResult) => {
|
|
80
|
-
displayDeploymentAndBuildStatus({
|
|
81
|
-
status: lastResult.status['production'].deploy.status,
|
|
82
|
-
url: lastResult.status['production'].deploy.url,
|
|
83
|
-
spinner,
|
|
84
|
-
buildType: 'production',
|
|
85
|
-
continueOnDeployFailures,
|
|
86
|
-
wait,
|
|
87
|
-
});
|
|
88
|
-
},
|
|
89
|
-
onRetry: (lastResult) => {
|
|
90
|
-
if (argv.onRetry) {
|
|
91
|
-
argv.onRetry({
|
|
92
|
-
preview: lastResult.status.preview,
|
|
93
|
-
production: lastResult.isMainBranch ? lastResult.status.production : null,
|
|
94
|
-
commit: lastResult.commit,
|
|
95
|
-
});
|
|
96
|
-
}
|
|
97
|
-
},
|
|
98
|
-
startTime,
|
|
99
|
-
retryTimeoutMs,
|
|
100
|
-
retryIntervalMs,
|
|
101
|
-
});
|
|
102
|
-
}
|
|
103
|
-
if (pushResponse.isMainBranch) {
|
|
104
|
-
printPushStatus({
|
|
105
|
-
buildType: 'production',
|
|
106
|
-
spinner,
|
|
107
|
-
wait,
|
|
108
|
-
push: pushResponse,
|
|
109
|
-
continueOnDeployFailures,
|
|
110
|
-
});
|
|
111
|
-
printScorecard(pushResponse.status.production.scorecard);
|
|
112
|
-
}
|
|
113
|
-
printPushStatusInfo({ organization, projectId, pushId, startedAt });
|
|
114
|
-
client.reportSunsetWarnings();
|
|
115
|
-
const summary = {
|
|
116
|
-
preview: pushResponse.status.preview,
|
|
117
|
-
production: pushResponse.isMainBranch ? pushResponse.status.production : null,
|
|
118
|
-
commit: pushResponse.commit,
|
|
119
|
-
};
|
|
120
|
-
return summary;
|
|
121
|
-
}
|
|
122
|
-
catch (err) {
|
|
123
|
-
spinner.stop(); // Spinner can block process exit, so we need to stop it explicitly.
|
|
124
|
-
handleReuniteError('✗ Failed to get push status.', err);
|
|
125
|
-
}
|
|
126
|
-
finally {
|
|
127
|
-
spinner.stop(); // Spinner can block process exit, so we need to stop it explicitly.
|
|
128
|
-
}
|
|
129
|
-
}
|
|
130
|
-
function printPushStatusInfo({ organization, projectId, pushId, startedAt, }) {
|
|
131
|
-
logger.info(`\nProcessed push-status for ${colors.yellow(organization)}, ${colors.yellow(projectId)} and pushID ${colors.yellow(pushId)}.\n`);
|
|
132
|
-
printExecutionTime('push-status', startedAt, 'Finished');
|
|
133
|
-
}
|
|
134
|
-
function printPushStatus({ buildType, spinner, push, continueOnDeployFailures, }) {
|
|
135
|
-
if (!push) {
|
|
136
|
-
return;
|
|
137
|
-
}
|
|
138
|
-
if (push.isOutdated || !push.hasChanges) {
|
|
139
|
-
logger.warn(`Files not added to your project. Reason: ${push.isOutdated ? 'outdated' : 'no changes'}.\n`);
|
|
140
|
-
}
|
|
141
|
-
else {
|
|
142
|
-
displayDeploymentAndBuildStatus({
|
|
143
|
-
status: push.status[buildType].deploy.status,
|
|
144
|
-
url: push.status[buildType].deploy.url,
|
|
145
|
-
buildType,
|
|
146
|
-
spinner,
|
|
147
|
-
continueOnDeployFailures,
|
|
148
|
-
});
|
|
149
|
-
}
|
|
150
|
-
}
|
|
151
|
-
function printScorecard(scorecard) {
|
|
152
|
-
if (!scorecard || scorecard.length === 0) {
|
|
153
|
-
return;
|
|
154
|
-
}
|
|
155
|
-
logger.output(`\n${colors.magenta('Scorecard')}:`);
|
|
156
|
-
for (const scorecardItem of scorecard) {
|
|
157
|
-
logger.output(`
|
|
158
|
-
${colors.magenta('Name')}: ${scorecardItem.name}
|
|
159
|
-
${colors.magenta('Status')}: ${scorecardItem.status}
|
|
160
|
-
${colors.magenta('URL')}: ${colors.cyan(scorecardItem.url)}
|
|
161
|
-
${colors.magenta('Description')}: ${scorecardItem.description}\n`);
|
|
162
|
-
}
|
|
163
|
-
logger.output(`\n`);
|
|
164
|
-
}
|
|
165
|
-
function displayDeploymentAndBuildStatus({ status, url, spinner, buildType, continueOnDeployFailures, wait, }) {
|
|
166
|
-
const message = getMessage({ status, url, buildType, wait });
|
|
167
|
-
if (status === 'failed' && !continueOnDeployFailures) {
|
|
168
|
-
spinner.stop();
|
|
169
|
-
throw new DeploymentError(message);
|
|
170
|
-
}
|
|
171
|
-
if (wait && (status === 'pending' || status === 'running')) {
|
|
172
|
-
return spinner.start(message);
|
|
173
|
-
}
|
|
174
|
-
spinner.stop();
|
|
175
|
-
return logger.output(message);
|
|
176
|
-
}
|
|
177
|
-
function getMessage({ status, url, buildType, wait, }) {
|
|
178
|
-
switch (status) {
|
|
179
|
-
case 'skipped':
|
|
180
|
-
return `${colors.yellow(`Skipped ${buildType}`)}\n`;
|
|
181
|
-
case 'pending': {
|
|
182
|
-
const message = `${colors.yellow(`Pending ${buildType}`)}`;
|
|
183
|
-
return wait ? message : `Status: ${message}\n`;
|
|
184
|
-
}
|
|
185
|
-
case 'running': {
|
|
186
|
-
const message = `${colors.yellow(`Running ${buildType}`)}`;
|
|
187
|
-
return wait ? message : `Status: ${message}\n`;
|
|
188
|
-
}
|
|
189
|
-
case 'success':
|
|
190
|
-
return `${colors.green(`🚀 ${capitalize(buildType)} deploy success.`)}\n${colors.magenta(`${capitalize(buildType)} URL`)}: ${colors.cyan(url || 'No URL yet.')}\n`;
|
|
191
|
-
case 'failed':
|
|
192
|
-
return `${colors.red(`❌ ${capitalize(buildType)} deploy fail.`)}\n${colors.magenta(`${capitalize(buildType)} URL`)}: ${colors.cyan(url || 'No URL yet.')}`;
|
|
193
|
-
default: {
|
|
194
|
-
const message = `${colors.yellow(`No status yet for ${buildType} deploy`)}`;
|
|
195
|
-
return wait ? message : `Status: ${message}\n`;
|
|
196
|
-
}
|
|
197
|
-
}
|
|
198
|
-
}
|
|
199
|
-
//# sourceMappingURL=push-status.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"push-status.js","sourceRoot":"","sources":["../../../src/reunite/commands/push-status.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,MAAM,EAAqB,MAAM,uBAAuB,CAAC;AAClE,OAAO,KAAK,MAAM,MAAM,WAAW,CAAC;AAGpC,OAAO,EAAE,kBAAkB,EAAE,UAAU,EAAE,MAAM,8BAA8B,CAAC;AAC9E,OAAO,EAAE,OAAO,EAAE,MAAM,wBAAwB,CAAC;AAEjD,OAAO,EAAE,UAAU,EAAE,UAAU,EAAE,SAAS,EAAE,MAAM,iBAAiB,CAAC;AAOpE,OAAO,EAAE,eAAe,EAAE,MAAM,aAAa,CAAC;AAC9C,OAAO,EAAE,kBAAkB,EAAE,sBAAsB,EAAE,MAAM,YAAY,CAAC;AAExE,MAAM,iBAAiB,GAAG,IAAI,CAAC,CAAC,QAAQ;AAsBxC,MAAM,CAAC,KAAK,UAAU,gBAAgB,CAAC,EACrC,IAAI,GACwB;IAC5B,MAAM,SAAS,GAAG,WAAW,CAAC,GAAG,EAAE,CAAC;IACpC,MAAM,OAAO,GAAG,IAAI,OAAO,EAAE,CAAC;IAE9B,MAAM,EAAE,YAAY,EAAE,OAAO,EAAE,SAAS,EAAE,MAAM,EAAE,IAAI,EAAE,GAAG,IAAI,CAAC;IAEhE,MAAM,MAAM,GAAG,IAAI,CAAC,MAAM,IAAI,SAAS,EAAE,CAAC;IAC1C,MAAM,gBAAgB,GAAG,IAAI,CAAC,oBAAoB,CAAC,IAAI,IAAI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ChF,GAAG,UAAU,CAAC,SAAS,CAAC,MAAM,CAC/B,KAAK,MAAM,CAAC,IAAI,CAAC,GAAG,IAAI,aAAa,CAAC,EAAE,CAAC;QAE5C,OAAO,CAAC,CAAC,CAAC;YACR,MAAM,OAAO,GAAG,GAAG,MAAM,CAAC,MAAM,CAAC,qBAAqB,SAAS,SAAS,CAAC,EAAE,CAAC;YAE5E,OAAO,IAAI,CAAC,CAAC,CAAC,OAAO,CAAC,CAAC,CAAC,WAAW,OAAO,IAAI,CAAC;QACjD,CAAC;IACH,CAAC;AACH,CAAC"}
|
|
@@ -1,28 +0,0 @@
|
|
|
1
|
-
import { type OutputFormat } from '@redocly/openapi-core';
|
|
2
|
-
import type { VerifyConfigOptions } from '../../types.js';
|
|
3
|
-
import type { CommandArgs } from '../../wrapper.js';
|
|
4
|
-
export type PushArgv = {
|
|
5
|
-
files: string[];
|
|
6
|
-
organization: string;
|
|
7
|
-
project: string;
|
|
8
|
-
'mount-path': string;
|
|
9
|
-
branch: string;
|
|
10
|
-
author: string;
|
|
11
|
-
message: string;
|
|
12
|
-
'commit-sha'?: string;
|
|
13
|
-
'commit-url'?: string;
|
|
14
|
-
namespace?: string;
|
|
15
|
-
repository?: string;
|
|
16
|
-
'created-at'?: string;
|
|
17
|
-
'default-branch': string;
|
|
18
|
-
domain?: string;
|
|
19
|
-
'wait-for-deployment'?: boolean;
|
|
20
|
-
'max-execution-time'?: number;
|
|
21
|
-
'continue-on-deploy-failures'?: boolean;
|
|
22
|
-
verbose?: boolean;
|
|
23
|
-
format?: Extract<OutputFormat, 'stylish'>;
|
|
24
|
-
} & VerifyConfigOptions;
|
|
25
|
-
export declare function handlePush({ argv, config, }: CommandArgs<PushArgv>): Promise<{
|
|
26
|
-
pushId: string;
|
|
27
|
-
} | void>;
|
|
28
|
-
//# sourceMappingURL=push.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"push.d.ts","sourceRoot":"","sources":["../../../src/reunite/commands/push.ts"],"names":[],"mappings":"AAAA,OAAO,EAA4B,KAAK,YAAY,EAAE,MAAM,uBAAuB,CAAC;AAKpF,OAAO,KAAK,EAAE,mBAAmB,EAAE,MAAM,gBAAgB,CAAC;AAI1D,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,kBAAkB,CAAC;AAKpD,MAAM,MAAM,QAAQ,GAAG;IACrB,KAAK,EAAE,MAAM,EAAE,CAAC;IAChB,YAAY,EAAE,MAAM,CAAC;IACrB,OAAO,EAAE,MAAM,CAAC;IAChB,YAAY,EAAE,MAAM,CAAC;IACrB,MAAM,EAAE,MAAM,CAAC;IACf,MAAM,EAAE,MAAM,CAAC;IACf,OAAO,EAAE,MAAM,CAAC;IAChB,YAAY,CAAC,EAAE,MAAM,CAAC;IACtB,YAAY,CAAC,EAAE,MAAM,CAAC;IACtB,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB,YAAY,CAAC,EAAE,MAAM,CAAC;IACtB,gBAAgB,EAAE,MAAM,CAAC;IACzB,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,qBAAqB,CAAC,EAAE,OAAO,CAAC;IAChC,oBAAoB,CAAC,EAAE,MAAM,CAAC;IAC9B,6BAA6B,CAAC,EAAE,OAAO,CAAC;IACxC,OAAO,CAAC,EAAE,OAAO,CAAC;IAClB,MAAM,CAAC,EAAE,OAAO,CAAC,YAAY,EAAE,SAAS,CAAC,CAAC;CAC3C,GAAG,mBAAmB,CAAC;AAIxB,wBAAsB,UAAU,CAAC,EAC/B,IAAI,EACJ,MAAM,GACP,EAAE,WAAW,CAAC,QAAQ,CAAC,GAAG,OAAO,CAAC;IAAE,MAAM,EAAE,MAAM,CAAA;CAAE,GAAG,IAAI,CAAC,CA6G5D"}
|
|
@@ -1,135 +0,0 @@
|
|
|
1
|
-
import { slash, pluralize, logger } from '@redocly/openapi-core';
|
|
2
|
-
import { green } from 'colorette';
|
|
3
|
-
import * as fs from 'node:fs';
|
|
4
|
-
import * as path from 'node:path';
|
|
5
|
-
import { exitWithError } from '../../utils/error.js';
|
|
6
|
-
import { printExecutionTime } from '../../utils/miscellaneous.js';
|
|
7
|
-
import { version } from '../../utils/package.js';
|
|
8
|
-
import { ReuniteApi, getDomain, getApiKeys } from '../api/index.js';
|
|
9
|
-
import { handlePushStatus } from './push-status.js';
|
|
10
|
-
import { handleReuniteError } from './utils.js';
|
|
11
|
-
export async function handlePush({ argv, config, }) {
|
|
12
|
-
const startedAt = performance.now(); // for printing execution time
|
|
13
|
-
const startTime = Date.now(); // for push-status command
|
|
14
|
-
const { organization, project: projectId, 'mount-path': mountPath, verbose } = argv;
|
|
15
|
-
const domain = argv.domain || getDomain();
|
|
16
|
-
if (!domain) {
|
|
17
|
-
return exitWithError(`No domain provided, please use --domain option or environment variable REDOCLY_AUTHORIZATION.`);
|
|
18
|
-
}
|
|
19
|
-
try {
|
|
20
|
-
const { 'commit-sha': commitSha, 'commit-url': commitUrl, 'default-branch': defaultBranch, 'wait-for-deployment': waitForDeployment, 'max-execution-time': maxExecutionTime, } = argv;
|
|
21
|
-
const author = parseCommitAuthor(argv.author);
|
|
22
|
-
const apiKey = getApiKeys();
|
|
23
|
-
const filesToUpload = collectFilesToPush(argv.files);
|
|
24
|
-
const commandName = 'push';
|
|
25
|
-
if (!filesToUpload.length) {
|
|
26
|
-
return printExecutionTime(commandName, startedAt, `No files to upload`);
|
|
27
|
-
}
|
|
28
|
-
const client = new ReuniteApi({ domain, apiKey, command: commandName });
|
|
29
|
-
const projectDefaultBranch = await client.remotes.getDefaultBranch(organization, projectId);
|
|
30
|
-
const remote = await client.remotes.upsert(organization, projectId, {
|
|
31
|
-
mountBranchName: projectDefaultBranch,
|
|
32
|
-
mountPath,
|
|
33
|
-
});
|
|
34
|
-
logger.info(`Uploading to ${remote.mountPath} ${filesToUpload.length} ${pluralize('file', filesToUpload.length)}:\n`);
|
|
35
|
-
const { id } = await client.remotes.push(organization, projectId, {
|
|
36
|
-
remoteId: remote.id,
|
|
37
|
-
commit: {
|
|
38
|
-
message: argv.message,
|
|
39
|
-
branchName: argv.branch,
|
|
40
|
-
sha: commitSha,
|
|
41
|
-
url: commitUrl,
|
|
42
|
-
createdAt: argv['created-at'],
|
|
43
|
-
namespace: argv.namespace,
|
|
44
|
-
repository: argv.repository,
|
|
45
|
-
author,
|
|
46
|
-
},
|
|
47
|
-
isMainBranch: defaultBranch === argv.branch,
|
|
48
|
-
}, filesToUpload.map((f) => ({ path: slash(f.name), stream: fs.createReadStream(f.path) })));
|
|
49
|
-
filesToUpload.forEach((f) => {
|
|
50
|
-
logger.info(green(`✓ ${f.name}\n`));
|
|
51
|
-
});
|
|
52
|
-
logger.info('\n');
|
|
53
|
-
logger.info(`Push ID: ${id}\n`);
|
|
54
|
-
if (waitForDeployment) {
|
|
55
|
-
logger.info('\n');
|
|
56
|
-
await handlePushStatus({
|
|
57
|
-
argv: {
|
|
58
|
-
organization,
|
|
59
|
-
project: projectId,
|
|
60
|
-
pushId: id,
|
|
61
|
-
wait: true,
|
|
62
|
-
domain,
|
|
63
|
-
'max-execution-time': maxExecutionTime,
|
|
64
|
-
'start-time': startTime,
|
|
65
|
-
'continue-on-deploy-failures': argv['continue-on-deploy-failures'],
|
|
66
|
-
},
|
|
67
|
-
config,
|
|
68
|
-
version,
|
|
69
|
-
});
|
|
70
|
-
}
|
|
71
|
-
if (verbose) {
|
|
72
|
-
printExecutionTime(commandName, startedAt, `${pluralize('file', filesToUpload.length)} uploaded to organization ${organization}, project ${projectId}. Push ID: ${id}.`);
|
|
73
|
-
}
|
|
74
|
-
client.reportSunsetWarnings();
|
|
75
|
-
return {
|
|
76
|
-
pushId: id,
|
|
77
|
-
};
|
|
78
|
-
}
|
|
79
|
-
catch (err) {
|
|
80
|
-
handleReuniteError('✗ File upload failed.', err);
|
|
81
|
-
}
|
|
82
|
-
}
|
|
83
|
-
function parseCommitAuthor(author) {
|
|
84
|
-
// Author Name <author@email.com>
|
|
85
|
-
const reg = /^.+\s<[^<>]+>$/;
|
|
86
|
-
if (!reg.test(author)) {
|
|
87
|
-
throw new Error('Invalid author format. Use "Author Name <author@email.com>"');
|
|
88
|
-
}
|
|
89
|
-
const [name, email] = author.split('<');
|
|
90
|
-
return {
|
|
91
|
-
name: name.trim(),
|
|
92
|
-
email: email.replace('>', '').trim(),
|
|
93
|
-
};
|
|
94
|
-
}
|
|
95
|
-
function collectFilesToPush(files) {
|
|
96
|
-
const collectedFiles = {};
|
|
97
|
-
for (const file of files) {
|
|
98
|
-
if (fs.statSync(file).isDirectory()) {
|
|
99
|
-
const dir = file;
|
|
100
|
-
const fileList = getFilesList(dir, []);
|
|
101
|
-
fileList.forEach((f) => addFile(f, dir));
|
|
102
|
-
}
|
|
103
|
-
else {
|
|
104
|
-
addFile(file, path.dirname(file));
|
|
105
|
-
}
|
|
106
|
-
}
|
|
107
|
-
function addFile(filePath, fileDir) {
|
|
108
|
-
const fileName = path.relative(fileDir, filePath);
|
|
109
|
-
if (collectedFiles[fileName]) {
|
|
110
|
-
logger.warn(`File ${collectedFiles[fileName]} is overwritten by ${filePath}\n`);
|
|
111
|
-
}
|
|
112
|
-
collectedFiles[fileName] = filePath;
|
|
113
|
-
}
|
|
114
|
-
return Object.entries(collectedFiles).map(([name, filePath]) => getFileEntry(name, filePath));
|
|
115
|
-
}
|
|
116
|
-
function getFileEntry(name, filePath) {
|
|
117
|
-
return {
|
|
118
|
-
name,
|
|
119
|
-
path: path.resolve(filePath),
|
|
120
|
-
};
|
|
121
|
-
}
|
|
122
|
-
function getFilesList(dir, files) {
|
|
123
|
-
const filesAndDirs = fs.readdirSync(dir);
|
|
124
|
-
for (const name of filesAndDirs) {
|
|
125
|
-
const currentPath = path.join(dir, name);
|
|
126
|
-
if (fs.statSync(currentPath).isDirectory()) {
|
|
127
|
-
files = getFilesList(currentPath, files);
|
|
128
|
-
}
|
|
129
|
-
else {
|
|
130
|
-
files.push(currentPath);
|
|
131
|
-
}
|
|
132
|
-
}
|
|
133
|
-
return files;
|
|
134
|
-
}
|
|
135
|
-
//# sourceMappingURL=push.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"push.js","sourceRoot":"","sources":["../../../src/reunite/commands/push.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,EAAE,SAAS,EAAE,MAAM,EAAqB,MAAM,uBAAuB,CAAC;AACpF,OAAO,EAAE,KAAK,EAAE,MAAM,WAAW,CAAC;AAClC,OAAO,KAAK,EAAE,MAAM,SAAS,CAAC;AAC9B,OAAO,KAAK,IAAI,MAAM,WAAW,CAAC;AAGlC,OAAO,EAAE,aAAa,EAAE,MAAM,sBAAsB,CAAC;AACrD,OAAO,EAAE,kBAAkB,EAAE,MAAM,8BAA8B,CAAC;AAClE,OAAO,EAAE,OAAO,EAAE,MAAM,wBAAwB,CAAC;AAEjD,OAAO,EAAE,UAAU,EAAE,SAAS,EAAE,UAAU,EAAE,MAAM,iBAAiB,CAAC;AACpE,OAAO,EAAE,gBAAgB,EAAE,MAAM,kBAAkB,CAAC;AACpD,OAAO,EAAE,kBAAkB,EAAE,MAAM,YAAY,CAAC;AA0BhD,MAAM,CAAC,KAAK,UAAU,UAAU,CAAC,EAC/B,IAAI,EACJ,MAAM,GACgB;IACtB,MAAM,SAAS,GAAG,WAAW,CAAC,GAAG,EAAE,CAAC,CAAC,8BAA8B;IACnE,MAAM,SAAS,GAAG,IAAI,CAAC,GAAG,EAAE,CAAC,CAAC,0BAA0B;IAExD,MAAM,EAAE,YAAY,EAAE,OAAO,EAAE,SAAS,EAAE,YAAY,EAAE,SAAS,EAAE,OAAO,EAAE,GAAG,IAAI,CAAC;IAEpF,MAAM,MAAM,GAAG,IAAI,CAAC,MAAM,IAAI,SAAS,EAAE,CAAC;IAE1C,IAAI,CAAC,MAAM,EAAE,CAAC;QACZ,OAAO,aAAa,CAClB,+FAA+F,CAChG,CAAC;IACJ,CAAC;IAED,IAAI,CAAC;QACH,MAAM,EACJ,YAAY,E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|
@@ -1,26 +0,0 @@
|
|
|
1
|
-
import { ReuniteApiError } from '../api/index.js';
|
|
2
|
-
import { DeploymentError } from '../utils.js';
|
|
3
|
-
/**
|
|
4
|
-
* This function retries an operation until a condition is met or a timeout is exceeded.
|
|
5
|
-
* If the condition is not met within the timeout, an error is thrown.
|
|
6
|
-
* @operation The operation to retry.
|
|
7
|
-
* @condition The condition to check after each operation result. Return false to continue retrying. Return true to stop retrying.
|
|
8
|
-
* If not provided, the first result will be returned.
|
|
9
|
-
* @param onConditionNotMet Will be called with the last result right after checking condition and before timeout and retrying.
|
|
10
|
-
* @param onRetry Will be called right before retrying operation with the last result before retrying.
|
|
11
|
-
* @param startTime The start time of the operation. Default is the current time.
|
|
12
|
-
* @param retryTimeoutMs The maximum time to retry the operation. Default is 10 minutes.
|
|
13
|
-
* @param retryIntervalMs The interval between retries. Default is 5 seconds.
|
|
14
|
-
*/
|
|
15
|
-
export declare function retryUntilConditionMet<T>({ operation, condition, onConditionNotMet, onRetry, startTime, retryTimeoutMs, // 10 min
|
|
16
|
-
retryIntervalMs, }: {
|
|
17
|
-
operation: () => Promise<T>;
|
|
18
|
-
condition?: ((result: T) => boolean) | null;
|
|
19
|
-
onConditionNotMet?: (lastResult: T) => void;
|
|
20
|
-
onRetry?: (lastResult: T) => void | Promise<void>;
|
|
21
|
-
startTime?: number;
|
|
22
|
-
retryTimeoutMs?: number;
|
|
23
|
-
retryIntervalMs?: number;
|
|
24
|
-
}): Promise<T>;
|
|
25
|
-
export declare function handleReuniteError(message: string, error: ReuniteApiError | DeploymentError | Error): never;
|
|
26
|
-
//# sourceMappingURL=utils.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"utils.d.ts","sourceRoot":"","sources":["../../../src/reunite/commands/utils.ts"],"names":[],"mappings":"AAGA,OAAO,EAAE,eAAe,EAAE,MAAM,iBAAiB,CAAC;AAClD,OAAO,EAAE,eAAe,EAAE,MAAM,aAAa,CAAC;AAE9C;;;;;;;;;;;GAWG;AACH,wBAAsB,sBAAsB,CAAC,CAAC,EAAE,EAC9C,SAAS,EACT,SAAS,EACT,iBAAiB,EACjB,OAAO,EACP,SAAsB,EACtB,cAAuB,EAAE,SAAS;AAClC,eAAsB,GACvB,EAAE;IACD,SAAS,EAAE,MAAM,OAAO,CAAC,CAAC,CAAC,CAAC;IAC5B,SAAS,CAAC,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,KAAK,OAAO,CAAC,GAAG,IAAI,CAAC;IAC5C,iBAAiB,CAAC,EAAE,CAAC,UAAU,EAAE,CAAC,KAAK,IAAI,CAAC;IAC5C,OAAO,CAAC,EAAE,CAAC,UAAU,EAAE,CAAC,KAAK,IAAI,GAAG,OAAO,CAAC,IAAI,CAAC,CAAC;IAClD,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,cAAc,CAAC,EAAE,MAAM,CAAC;IACxB,eAAe,CAAC,EAAE,MAAM,CAAC;CAC1B,GAAG,OAAO,CAAC,CAAC,CAAC,CAqBb;AAED,wBAAgB,kBAAkB,CAChC,OAAO,EAAE,MAAM,EACf,KAAK,EAAE,eAAe,GAAG,eAAe,GAAG,KAAK,SAWjD"}
|
|
@@ -1,49 +0,0 @@
|
|
|
1
|
-
import { pause } from '@redocly/openapi-core';
|
|
2
|
-
import { exitWithError } from '../../utils/error.js';
|
|
3
|
-
import { ReuniteApiError } from '../api/index.js';
|
|
4
|
-
import { DeploymentError } from '../utils.js';
|
|
5
|
-
/**
|
|
6
|
-
* This function retries an operation until a condition is met or a timeout is exceeded.
|
|
7
|
-
* If the condition is not met within the timeout, an error is thrown.
|
|
8
|
-
* @operation The operation to retry.
|
|
9
|
-
* @condition The condition to check after each operation result. Return false to continue retrying. Return true to stop retrying.
|
|
10
|
-
* If not provided, the first result will be returned.
|
|
11
|
-
* @param onConditionNotMet Will be called with the last result right after checking condition and before timeout and retrying.
|
|
12
|
-
* @param onRetry Will be called right before retrying operation with the last result before retrying.
|
|
13
|
-
* @param startTime The start time of the operation. Default is the current time.
|
|
14
|
-
* @param retryTimeoutMs The maximum time to retry the operation. Default is 10 minutes.
|
|
15
|
-
* @param retryIntervalMs The interval between retries. Default is 5 seconds.
|
|
16
|
-
*/
|
|
17
|
-
export async function retryUntilConditionMet({ operation, condition, onConditionNotMet, onRetry, startTime = Date.now(), retryTimeoutMs = 600000, // 10 min
|
|
18
|
-
retryIntervalMs = 5000, // 5 sec
|
|
19
|
-
}) {
|
|
20
|
-
async function attempt() {
|
|
21
|
-
const result = await operation();
|
|
22
|
-
if (!condition) {
|
|
23
|
-
return result;
|
|
24
|
-
}
|
|
25
|
-
if (condition(result)) {
|
|
26
|
-
return result;
|
|
27
|
-
}
|
|
28
|
-
else if (Date.now() - startTime > retryTimeoutMs) {
|
|
29
|
-
throw new Error('Timeout exceeded.');
|
|
30
|
-
}
|
|
31
|
-
else {
|
|
32
|
-
onConditionNotMet?.(result);
|
|
33
|
-
await pause(retryIntervalMs);
|
|
34
|
-
await onRetry?.(result);
|
|
35
|
-
return attempt();
|
|
36
|
-
}
|
|
37
|
-
}
|
|
38
|
-
return attempt();
|
|
39
|
-
}
|
|
40
|
-
export function handleReuniteError(message, error) {
|
|
41
|
-
if (error instanceof DeploymentError) {
|
|
42
|
-
return exitWithError(error.message);
|
|
43
|
-
}
|
|
44
|
-
if (error instanceof ReuniteApiError) {
|
|
45
|
-
return exitWithError(`${message} Reason: ${error.message} (status: ${error.status})\n`);
|
|
46
|
-
}
|
|
47
|
-
return exitWithError(`${message} Reason: ${error.message}\n`);
|
|
48
|
-
}
|
|
49
|
-
//# sourceMappingURL=utils.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"utils.js","sourceRoot":"","sources":["../../../src/reunite/commands/utils.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,EAAE,MAAM,uBAAuB,CAAC;AAE9C,OAAO,EAAE,aAAa,EAAE,MAAM,sBAAsB,CAAC;AACrD,OAAO,EAAE,eAAe,EA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,OAAO,aAAa,CAAC,GAAG,OAAO,YAAY,KAAK,CAAC,OAAO,IAAI,CAAC,CAAC;AAChE,CAAC"}
|
package/lib/reunite/utils.d.ts
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"utils.d.ts","sourceRoot":"","sources":["../../src/reunite/utils.ts"],"names":[],"mappings":"AAAA,qBAAa,eAAgB,SAAQ,KAAK;CAAG"}
|
package/lib/reunite/utils.js
DELETED
package/lib/reunite/utils.js.map
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"utils.js","sourceRoot":"","sources":["../../src/reunite/utils.ts"],"names":[],"mappings":"AAAA,MAAM,OAAO,eAAgB,SAAQ,KAAK;CAAG"}
|
package/lib/types.d.ts
DELETED
|
@@ -1,33 +0,0 @@
|
|
|
1
|
-
import type { RuleSeverity } from '@redocly/openapi-core';
|
|
2
|
-
import type { LoginArgv, LogoutArgv } from './commands/auth.js';
|
|
3
|
-
import type { BuildDocsArgv } from './commands/build-docs/types.js';
|
|
4
|
-
import type { BundleArgv } from './commands/bundle.js';
|
|
5
|
-
import type { EjectArgv } from './commands/eject.js';
|
|
6
|
-
import type { GenerateArazzoCommandArgv } from './commands/generate-arazzo.js';
|
|
7
|
-
import type { JoinArgv } from './commands/join/types.js';
|
|
8
|
-
import type { LintArgv } from './commands/lint.js';
|
|
9
|
-
import type { PreviewProjectArgv } from './commands/preview-project/types.js';
|
|
10
|
-
import type { RespectArgv } from './commands/respect/index.js';
|
|
11
|
-
import type { SplitArgv } from './commands/split/types.js';
|
|
12
|
-
import type { StatsArgv } from './commands/stats/index.js';
|
|
13
|
-
import type { TranslationsArgv } from './commands/translations.js';
|
|
14
|
-
import type { PushStatusArgv } from './reunite/commands/push-status.js';
|
|
15
|
-
import type { PushArgv } from './reunite/commands/push.js';
|
|
16
|
-
export type Totals = {
|
|
17
|
-
errors: number;
|
|
18
|
-
warnings: number;
|
|
19
|
-
ignored: number;
|
|
20
|
-
};
|
|
21
|
-
export type Entrypoint = {
|
|
22
|
-
path: string;
|
|
23
|
-
alias?: string;
|
|
24
|
-
output?: string;
|
|
25
|
-
};
|
|
26
|
-
export declare const outputExtensions: readonly ["json", "yaml", "yml"];
|
|
27
|
-
export type OutputExtension = (typeof outputExtensions)[number];
|
|
28
|
-
export type CommandArgv = StatsArgv | SplitArgv | JoinArgv | LintArgv | BundleArgv | LoginArgv | LogoutArgv | BuildDocsArgv | PushArgv | PushStatusArgv | PreviewProjectArgv | TranslationsArgv | EjectArgv | RespectArgv | GenerateArazzoCommandArgv;
|
|
29
|
-
export type VerifyConfigOptions = {
|
|
30
|
-
config?: string;
|
|
31
|
-
'lint-config'?: RuleSeverity;
|
|
32
|
-
};
|
|
33
|
-
//# sourceMappingURL=types.d.ts.map
|
package/lib/types.d.ts.map
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../src/types.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,uBAAuB,CAAC;AAE1D,OAAO,KAAK,EAAE,SAAS,EAAE,UAAU,EAAE,MAAM,oBAAoB,CAAC;AAChE,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,gCAAgC,CAAC;AACpE,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,sBAAsB,CAAC;AACvD,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,qBAAqB,CAAC;AACrD,OAAO,KAAK,EAAE,yBAAyB,EAAE,MAAM,+BAA+B,CAAC;AAC/E,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,0BAA0B,CAAC;AACzD,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,oBAAoB,CAAC;AACnD,OAAO,KAAK,EAAE,kBAAkB,EAAE,MAAM,qCAAqC,CAAC;AAC9E,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,6BAA6B,CAAC;AAC/D,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,2BAA2B,CAAC;AAC3D,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,2BAA2B,CAAC;AAC3D,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,4BAA4B,CAAC;AACnE,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,mCAAmC,CAAC;AACxE,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,4BAA4B,CAAC;AAE3D,MAAM,MAAM,MAAM,GAAG;IACnB,MAAM,EAAE,MAAM,CAAC;IACf,QAAQ,EAAE,MAAM,CAAC;IACjB,OAAO,EAAE,MAAM,CAAC;CACjB,CAAC;AACF,MAAM,MAAM,UAAU,GAAG;IACvB,IAAI,EAAE,MAAM,CAAC;IACb,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,MAAM,CAAC,EAAE,MAAM,CAAC;CACjB,CAAC;AACF,eAAO,MAAM,gBAAgB,kCAAmC,CAAC;AACjE,MAAM,MAAM,eAAe,GAAG,CAAC,OAAO,gBAAgB,CAAC,CAAC,MAAM,CAAC,CAAC;AAChE,MAAM,MAAM,WAAW,GACnB,SAAS,GACT,SAAS,GACT,QAAQ,GACR,QAAQ,GACR,UAAU,GACV,SAAS,GACT,UAAU,GACV,aAAa,GACb,QAAQ,GACR,cAAc,GACd,kBAAkB,GAClB,gBAAgB,GAChB,SAAS,GACT,WAAW,GACX,yBAAyB,CAAC;AAE9B,MAAM,MAAM,mBAAmB,GAAG;IAChC,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,aAAa,CAAC,EAAE,YAAY,CAAC;CAC9B,CAAC"}
|
package/lib/types.js
DELETED
package/lib/types.js.map
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"types.js","sourceRoot":"","sources":["../src/types.ts"],"names":[],"mappings":"AA2BA,MAAM,CAAC,MAAM,gBAAgB,GAAG,CAAC,MAAM,EAAE,MAAM,EAAE,KAAK,CAAU,CAAC"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"assert-node-version.d.ts","sourceRoot":"","sources":["../../src/utils/assert-node-version.ts"],"names":[],"mappings":""}
|
|
@@ -1,14 +0,0 @@
|
|
|
1
|
-
import { logger } from '@redocly/openapi-core';
|
|
2
|
-
import * as process from 'node:process';
|
|
3
|
-
import * as semver from 'semver';
|
|
4
|
-
import { engines } from './package.js';
|
|
5
|
-
try {
|
|
6
|
-
const range = engines?.node;
|
|
7
|
-
if (typeof range === 'string' && !semver.satisfies(process.version, range)) {
|
|
8
|
-
logger.warn(`\n⚠️ Warning: failed to satisfy expected node version. Expected: "${range}", Current "${process.version}"\n\n`);
|
|
9
|
-
}
|
|
10
|
-
}
|
|
11
|
-
catch (e) {
|
|
12
|
-
// Do nothing
|
|
13
|
-
}
|
|
14
|
-
//# sourceMappingURL=assert-node-version.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"assert-node-version.js","sourceRoot":"","sources":["../../src/utils/assert-node-version.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,MAAM,EAAE,MAAM,uBAAuB,CAAC;AAC/C,OAAO,KAAK,OAAO,MAAM,cAAc,CAAC;AACxC,OAAO,KAAK,MAAM,MAAM,QAAQ,CAAC;AAEjC,OAAO,EAAE,OAAO,EAAE,MAAM,cAAc,CAAC;AAEvC,IAAI,CAAC;IACH,MAAM,KAAK,GAAG,OAAO,EAAE,IAAI,CAAC;IAE5B,IAAI,OAAO,KAAK,KAAK,QAAQ,IAAI,CAAC,MAAM,CAAC,SAAS,CAAC,OAAO,CAAC,OAAO,EAAE,KAAK,CAAC,EAAE,CAAC;QAC3E,MAAM,CAAC,IAAI,CACT,qEAAqE,KAAK,eAAe,OAAO,CAAC,OAAO,OAAO,CAChH,CAAC;IACJ,CAAC;AACH,CAAC;AAAC,OAAO,CAAC,EAAE,CAAC;IACX,aAAa;AACf,CAAC"}
|
package/lib/utils/constants.d.ts
DELETED
|
@@ -1,5 +0,0 @@
|
|
|
1
|
-
export declare const OTEL_URL = "https://otel.cloud.redocly.com";
|
|
2
|
-
export declare const OTEL_TRACES_URL: string;
|
|
3
|
-
export declare const DEFAULT_FETCH_TIMEOUT = 6000;
|
|
4
|
-
export declare const ANONYMOUS_ID_CACHE_FILE = "redocly-cli-anonymous-id";
|
|
5
|
-
//# sourceMappingURL=constants.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"constants.d.ts","sourceRoot":"","sources":["../../src/utils/constants.ts"],"names":[],"mappings":"AAAA,eAAO,MAAM,QAAQ,mCAAmC,CAAC;AACzD,eAAO,MAAM,eAAe,QAAyD,CAAC;AACtF,eAAO,MAAM,qBAAqB,OAAO,CAAC;AAC1C,eAAO,MAAM,uBAAuB,6BAA6B,CAAC"}
|
package/lib/utils/constants.js
DELETED
|
@@ -1,5 +0,0 @@
|
|
|
1
|
-
export const OTEL_URL = 'https://otel.cloud.redocly.com';
|
|
2
|
-
export const OTEL_TRACES_URL = process.env.OTEL_TRACES_URL || `${OTEL_URL}/v1/traces`;
|
|
3
|
-
export const DEFAULT_FETCH_TIMEOUT = 6000;
|
|
4
|
-
export const ANONYMOUS_ID_CACHE_FILE = 'redocly-cli-anonymous-id';
|
|
5
|
-
//# sourceMappingURL=constants.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"constants.js","sourceRoot":"","sources":["../../src/utils/constants.ts"],"names":[],"mappings":"AAAA,MAAM,CAAC,MAAM,QAAQ,GAAG,gCAAgC,CAAC;AACzD,MAAM,CAAC,MAAM,eAAe,GAAG,OAAO,CAAC,GAAG,CAAC,eAAe,IAAI,GAAG,QAAQ,YAAY,CAAC;AACtF,MAAM,CAAC,MAAM,qBAAqB,GAAG,IAAI,CAAC;AAC1C,MAAM,CAAC,MAAM,uBAAuB,GAAG,0BAA0B,CAAC"}
|
package/lib/utils/error.d.ts
DELETED
package/lib/utils/error.d.ts.map
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"error.d.ts","sourceRoot":"","sources":["../../src/utils/error.ts"],"names":[],"mappings":"AAGA,qBAAa,cAAe,SAAQ,KAAK;CAAG;AAE5C,wBAAgB,aAAa,CAAC,OAAO,EAAE,MAAM,GAAG,KAAK,CAEpD"}
|
package/lib/utils/error.js
DELETED
|
@@ -1,8 +0,0 @@
|
|
|
1
|
-
import { HandledError } from '@redocly/openapi-core';
|
|
2
|
-
// Is used to abort the flow of execution - will be catched in the command execution wrapper
|
|
3
|
-
export class AbortFlowError extends Error {
|
|
4
|
-
}
|
|
5
|
-
export function exitWithError(message) {
|
|
6
|
-
throw new HandledError(message);
|
|
7
|
-
}
|
|
8
|
-
//# sourceMappingURL=error.js.map
|
package/lib/utils/error.js.map
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"error.js","sourceRoot":"","sources":["../../src/utils/error.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,YAAY,EAAE,MAAM,uBAAuB,CAAC;AAErD,4FAA4F;AAC5F,MAAM,OAAO,cAAe,SAAQ,KAAK;CAAG;AAE5C,MAAM,UAAU,aAAa,CAAC,OAAe;IAC3C,MAAM,IAAI,YAAY,CAAC,OAAO,CAAC,CAAC;AAClC,CAAC"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"fetch-with-timeout.d.ts","sourceRoot":"","sources":["../../src/utils/fetch-with-timeout.ts"],"names":[],"mappings":"AAIA,MAAM,MAAM,uBAAuB,GAAG,WAAW,GAAG;IAClD,OAAO,CAAC,EAAE,MAAM,CAAC;CAClB,CAAC;yBAEoB,KAAK,MAAM,EAAE,0BAAyB,uBAA4B;AAAxF,wBAuBE"}
|