@kubb/agent 4.27.2 → 4.28.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/.output/nitro.json +1 -1
- package/.output/server/chunks/nitro/nitro.mjs +330 -194
- package/.output/server/chunks/nitro/nitro.mjs.map +1 -1
- package/.output/server/chunks/routes/api/health.get.mjs +10 -5
- package/.output/server/chunks/routes/api/health.get.mjs.map +1 -1
- package/.output/server/index.mjs +11 -6
- package/.output/server/index.mjs.map +1 -1
- package/.output/server/node_modules/anymatch/index.js +104 -0
- package/.output/server/node_modules/anymatch/package.json +48 -0
- package/.output/server/node_modules/chokidar/handler.js +632 -0
- package/.output/server/node_modules/chokidar/index.js +822 -0
- package/.output/server/node_modules/chokidar/package.json +63 -0
- package/.output/server/node_modules/normalize-path/index.js +35 -0
- package/.output/server/node_modules/normalize-path/package.json +77 -0
- package/.output/server/node_modules/picomatch/index.js +1 -15
- package/.output/server/node_modules/picomatch/lib/constants.js +5 -6
- package/.output/server/node_modules/picomatch/lib/parse.js +9 -3
- package/.output/server/node_modules/picomatch/lib/picomatch.js +4 -3
- package/.output/server/node_modules/picomatch/lib/utils.js +16 -24
- package/.output/server/node_modules/picomatch/package.json +5 -7
- package/.output/server/node_modules/readdirp/index.js +272 -0
- package/.output/server/node_modules/readdirp/package.json +66 -0
- package/.output/server/package.json +6 -10
- package/LICENSE +21 -0
- package/README.md +98 -42
- package/package.json +17 -24
- package/.output/server/node_modules/@redocly/ajv/dist/2020.js +0 -55
- package/.output/server/node_modules/@redocly/ajv/dist/ajv.js +0 -50
- package/.output/server/node_modules/@redocly/ajv/dist/compile/codegen/code.js +0 -156
- package/.output/server/node_modules/@redocly/ajv/dist/compile/codegen/index.js +0 -697
- package/.output/server/node_modules/@redocly/ajv/dist/compile/codegen/scope.js +0 -143
- package/.output/server/node_modules/@redocly/ajv/dist/compile/errors.js +0 -123
- package/.output/server/node_modules/@redocly/ajv/dist/compile/index.js +0 -249
- package/.output/server/node_modules/@redocly/ajv/dist/compile/names.js +0 -29
- package/.output/server/node_modules/@redocly/ajv/dist/compile/ref_error.js +0 -12
- package/.output/server/node_modules/@redocly/ajv/dist/compile/resolve.js +0 -155
- package/.output/server/node_modules/@redocly/ajv/dist/compile/rules.js +0 -26
- package/.output/server/node_modules/@redocly/ajv/dist/compile/util.js +0 -178
- package/.output/server/node_modules/@redocly/ajv/dist/compile/validate/applicability.js +0 -19
- package/.output/server/node_modules/@redocly/ajv/dist/compile/validate/boolSchema.js +0 -50
- package/.output/server/node_modules/@redocly/ajv/dist/compile/validate/dataType.js +0 -203
- package/.output/server/node_modules/@redocly/ajv/dist/compile/validate/defaults.js +0 -35
- package/.output/server/node_modules/@redocly/ajv/dist/compile/validate/index.js +0 -534
- package/.output/server/node_modules/@redocly/ajv/dist/compile/validate/keyword.js +0 -124
- package/.output/server/node_modules/@redocly/ajv/dist/compile/validate/subschema.js +0 -81
- package/.output/server/node_modules/@redocly/ajv/dist/core.js +0 -632
- package/.output/server/node_modules/@redocly/ajv/dist/draft4.js +0 -56
- package/.output/server/node_modules/@redocly/ajv/dist/refs/data.json +0 -13
- package/.output/server/node_modules/@redocly/ajv/dist/refs/json-schema-2020-12/index.js +0 -30
- package/.output/server/node_modules/@redocly/ajv/dist/refs/json-schema-2020-12/meta/applicator.json +0 -48
- package/.output/server/node_modules/@redocly/ajv/dist/refs/json-schema-2020-12/meta/content.json +0 -17
- package/.output/server/node_modules/@redocly/ajv/dist/refs/json-schema-2020-12/meta/core.json +0 -51
- package/.output/server/node_modules/@redocly/ajv/dist/refs/json-schema-2020-12/meta/format-annotation.json +0 -14
- package/.output/server/node_modules/@redocly/ajv/dist/refs/json-schema-2020-12/meta/meta-data.json +0 -37
- package/.output/server/node_modules/@redocly/ajv/dist/refs/json-schema-2020-12/meta/unevaluated.json +0 -15
- package/.output/server/node_modules/@redocly/ajv/dist/refs/json-schema-2020-12/meta/validation.json +0 -90
- package/.output/server/node_modules/@redocly/ajv/dist/refs/json-schema-2020-12/schema.json +0 -55
- package/.output/server/node_modules/@redocly/ajv/dist/refs/json-schema-draft-04.json +0 -138
- package/.output/server/node_modules/@redocly/ajv/dist/refs/json-schema-draft-07.json +0 -151
- package/.output/server/node_modules/@redocly/ajv/dist/runtime/equal.js +0 -7
- package/.output/server/node_modules/@redocly/ajv/dist/runtime/ucs2length.js +0 -24
- package/.output/server/node_modules/@redocly/ajv/dist/runtime/uri.js +0 -6
- package/.output/server/node_modules/@redocly/ajv/dist/runtime/validation_error.js +0 -11
- package/.output/server/node_modules/@redocly/ajv/dist/vocabularies/applicator/additionalItems.js +0 -49
- package/.output/server/node_modules/@redocly/ajv/dist/vocabularies/applicator/additionalProperties.js +0 -107
- package/.output/server/node_modules/@redocly/ajv/dist/vocabularies/applicator/allOf.js +0 -23
- package/.output/server/node_modules/@redocly/ajv/dist/vocabularies/applicator/anyOf.js +0 -12
- package/.output/server/node_modules/@redocly/ajv/dist/vocabularies/applicator/contains.js +0 -95
- package/.output/server/node_modules/@redocly/ajv/dist/vocabularies/applicator/dependencies.js +0 -85
- package/.output/server/node_modules/@redocly/ajv/dist/vocabularies/applicator/dependentSchemas.js +0 -11
- package/.output/server/node_modules/@redocly/ajv/dist/vocabularies/applicator/if.js +0 -66
- package/.output/server/node_modules/@redocly/ajv/dist/vocabularies/applicator/index.js +0 -44
- package/.output/server/node_modules/@redocly/ajv/dist/vocabularies/applicator/items.js +0 -52
- package/.output/server/node_modules/@redocly/ajv/dist/vocabularies/applicator/items2020.js +0 -30
- package/.output/server/node_modules/@redocly/ajv/dist/vocabularies/applicator/not.js +0 -26
- package/.output/server/node_modules/@redocly/ajv/dist/vocabularies/applicator/oneOf.js +0 -60
- package/.output/server/node_modules/@redocly/ajv/dist/vocabularies/applicator/patternProperties.js +0 -75
- package/.output/server/node_modules/@redocly/ajv/dist/vocabularies/applicator/prefixItems.js +0 -12
- package/.output/server/node_modules/@redocly/ajv/dist/vocabularies/applicator/properties.js +0 -55
- package/.output/server/node_modules/@redocly/ajv/dist/vocabularies/applicator/propertyNames.js +0 -38
- package/.output/server/node_modules/@redocly/ajv/dist/vocabularies/applicator/thenElse.js +0 -13
- package/.output/server/node_modules/@redocly/ajv/dist/vocabularies/code.js +0 -138
- package/.output/server/node_modules/@redocly/ajv/dist/vocabularies/core/id.js +0 -10
- package/.output/server/node_modules/@redocly/ajv/dist/vocabularies/core/index.js +0 -16
- package/.output/server/node_modules/@redocly/ajv/dist/vocabularies/core/ref.js +0 -132
- package/.output/server/node_modules/@redocly/ajv/dist/vocabularies/discriminator/index.js +0 -139
- package/.output/server/node_modules/@redocly/ajv/dist/vocabularies/discriminator/types.js +0 -9
- package/.output/server/node_modules/@redocly/ajv/dist/vocabularies/draft2020.js +0 -23
- package/.output/server/node_modules/@redocly/ajv/dist/vocabularies/draft4.js +0 -29
- package/.output/server/node_modules/@redocly/ajv/dist/vocabularies/draft7.js +0 -17
- package/.output/server/node_modules/@redocly/ajv/dist/vocabularies/dynamic/dynamicAnchor.js +0 -30
- package/.output/server/node_modules/@redocly/ajv/dist/vocabularies/dynamic/dynamicRef.js +0 -51
- package/.output/server/node_modules/@redocly/ajv/dist/vocabularies/dynamic/index.js +0 -9
- package/.output/server/node_modules/@redocly/ajv/dist/vocabularies/dynamic/recursiveAnchor.js +0 -16
- package/.output/server/node_modules/@redocly/ajv/dist/vocabularies/dynamic/recursiveRef.js +0 -10
- package/.output/server/node_modules/@redocly/ajv/dist/vocabularies/format/format.js +0 -92
- package/.output/server/node_modules/@redocly/ajv/dist/vocabularies/format/index.js +0 -6
- package/.output/server/node_modules/@redocly/ajv/dist/vocabularies/metadata.js +0 -26
- package/.output/server/node_modules/@redocly/ajv/dist/vocabularies/next.js +0 -8
- package/.output/server/node_modules/@redocly/ajv/dist/vocabularies/oasContext.js +0 -26
- package/.output/server/node_modules/@redocly/ajv/dist/vocabularies/unevaluated/index.js +0 -7
- package/.output/server/node_modules/@redocly/ajv/dist/vocabularies/unevaluated/unevaluatedItems.js +0 -40
- package/.output/server/node_modules/@redocly/ajv/dist/vocabularies/unevaluated/unevaluatedProperties.js +0 -84
- package/.output/server/node_modules/@redocly/ajv/dist/vocabularies/validation/const.js +0 -25
- package/.output/server/node_modules/@redocly/ajv/dist/vocabularies/validation/dependentRequired.js +0 -12
- package/.output/server/node_modules/@redocly/ajv/dist/vocabularies/validation/draft04/limitNumber.js +0 -43
- package/.output/server/node_modules/@redocly/ajv/dist/vocabularies/validation/draft04/limitNumberExclusive.js +0 -19
- package/.output/server/node_modules/@redocly/ajv/dist/vocabularies/validation/enum.js +0 -48
- package/.output/server/node_modules/@redocly/ajv/dist/vocabularies/validation/index.js +0 -37
- package/.output/server/node_modules/@redocly/ajv/dist/vocabularies/validation/limitContains.js +0 -15
- package/.output/server/node_modules/@redocly/ajv/dist/vocabularies/validation/limitItems.js +0 -24
- package/.output/server/node_modules/@redocly/ajv/dist/vocabularies/validation/limitLength.js +0 -27
- package/.output/server/node_modules/@redocly/ajv/dist/vocabularies/validation/limitNumber.js +0 -27
- package/.output/server/node_modules/@redocly/ajv/dist/vocabularies/validation/limitProperties.js +0 -24
- package/.output/server/node_modules/@redocly/ajv/dist/vocabularies/validation/multipleOf.js +0 -26
- package/.output/server/node_modules/@redocly/ajv/dist/vocabularies/validation/pattern.js +0 -24
- package/.output/server/node_modules/@redocly/ajv/dist/vocabularies/validation/readOnly.js +0 -20
- package/.output/server/node_modules/@redocly/ajv/dist/vocabularies/validation/required.js +0 -86
- package/.output/server/node_modules/@redocly/ajv/dist/vocabularies/validation/uniqueItems.js +0 -64
- package/.output/server/node_modules/@redocly/ajv/dist/vocabularies/validation/writeOnly.js +0 -20
- package/.output/server/node_modules/@redocly/ajv/package.json +0 -130
- package/.output/server/node_modules/@redocly/config/lib/common.js +0 -90
- package/.output/server/node_modules/@redocly/config/lib/constants.js +0 -73
- package/.output/server/node_modules/@redocly/config/lib/default-theme-config-schema.js +0 -54
- package/.output/server/node_modules/@redocly/config/lib/entities-catalog-config-schema.js +0 -186
- package/.output/server/node_modules/@redocly/config/lib/entities-catalog-entity-file-schema.js +0 -283
- package/.output/server/node_modules/@redocly/config/lib/ex-theme-config-schemas.js +0 -661
- package/.output/server/node_modules/@redocly/config/lib/feedback-config-schema.js +0 -88
- package/.output/server/node_modules/@redocly/config/lib/graphql-config-schema.js +0 -157
- package/.output/server/node_modules/@redocly/config/lib/index.js +0 -38
- package/.output/server/node_modules/@redocly/config/lib/product-override-schema.js +0 -43
- package/.output/server/node_modules/@redocly/config/lib/redoc-config-schema.js +0 -120
- package/.output/server/node_modules/@redocly/config/lib/reference-docs-config-schema.js +0 -518
- package/.output/server/node_modules/@redocly/config/lib/remove-property-recursively.js +0 -25
- package/.output/server/node_modules/@redocly/config/lib/reunite-config-schema.js +0 -103
- package/.output/server/node_modules/@redocly/config/lib/root-config-schema.js +0 -551
- package/.output/server/node_modules/@redocly/config/lib/scorecards-config-schema.js +0 -244
- package/.output/server/node_modules/@redocly/config/lib/types/api-functions-types.js +0 -3
- package/.output/server/node_modules/@redocly/config/lib/types/catalog-entity-types.js +0 -3
- package/.output/server/node_modules/@redocly/config/lib/types/code-walkthrough-types.js +0 -3
- package/.output/server/node_modules/@redocly/config/lib/types/config-types.js +0 -3
- package/.output/server/node_modules/@redocly/config/lib/types/index.js +0 -21
- package/.output/server/node_modules/@redocly/config/lib/types/portal-shared-types.js +0 -18
- package/.output/server/node_modules/@redocly/config/package.json +0 -28
- package/.output/server/node_modules/@redocly/openapi-core/lib/bundle/bundle-document.js +0 -85
- package/.output/server/node_modules/@redocly/openapi-core/lib/bundle/bundle-visitor.js +0 -257
- package/.output/server/node_modules/@redocly/openapi-core/lib/bundle/bundle.js +0 -74
- package/.output/server/node_modules/@redocly/openapi-core/lib/config/all.js +0 -310
- package/.output/server/node_modules/@redocly/openapi-core/lib/config/builtIn.js +0 -58
- package/.output/server/node_modules/@redocly/openapi-core/lib/config/bundle-extends.js +0 -27
- package/.output/server/node_modules/@redocly/openapi-core/lib/config/config-resolvers.js +0 -335
- package/.output/server/node_modules/@redocly/openapi-core/lib/config/config.js +0 -338
- package/.output/server/node_modules/@redocly/openapi-core/lib/config/constants.js +0 -13
- package/.output/server/node_modules/@redocly/openapi-core/lib/config/get-resolve-config.js +0 -9
- package/.output/server/node_modules/@redocly/openapi-core/lib/config/group-assertion-rules.js +0 -51
- package/.output/server/node_modules/@redocly/openapi-core/lib/config/index.js +0 -8
- package/.output/server/node_modules/@redocly/openapi-core/lib/config/load.js +0 -98
- package/.output/server/node_modules/@redocly/openapi-core/lib/config/minimal.js +0 -289
- package/.output/server/node_modules/@redocly/openapi-core/lib/config/recommended-strict.js +0 -289
- package/.output/server/node_modules/@redocly/openapi-core/lib/config/recommended.js +0 -289
- package/.output/server/node_modules/@redocly/openapi-core/lib/config/rules.js +0 -35
- package/.output/server/node_modules/@redocly/openapi-core/lib/config/spec.js +0 -289
- package/.output/server/node_modules/@redocly/openapi-core/lib/config/types.js +0 -2
- package/.output/server/node_modules/@redocly/openapi-core/lib/config/utils.js +0 -129
- package/.output/server/node_modules/@redocly/openapi-core/lib/config/visitors.js +0 -88
- package/.output/server/node_modules/@redocly/openapi-core/lib/decorators/arazzo/index.js +0 -2
- package/.output/server/node_modules/@redocly/openapi-core/lib/decorators/async2/index.js +0 -2
- package/.output/server/node_modules/@redocly/openapi-core/lib/decorators/async3/index.js +0 -2
- package/.output/server/node_modules/@redocly/openapi-core/lib/decorators/common/filters/filter-helper.js +0 -65
- package/.output/server/node_modules/@redocly/openapi-core/lib/decorators/common/filters/filter-in.js +0 -14
- package/.output/server/node_modules/@redocly/openapi-core/lib/decorators/common/filters/filter-out.js +0 -14
- package/.output/server/node_modules/@redocly/openapi-core/lib/decorators/common/info-description-override.js +0 -21
- package/.output/server/node_modules/@redocly/openapi-core/lib/decorators/common/info-override.js +0 -14
- package/.output/server/node_modules/@redocly/openapi-core/lib/decorators/common/media-type-examples-override.js +0 -58
- package/.output/server/node_modules/@redocly/openapi-core/lib/decorators/common/operation-description-override.js +0 -27
- package/.output/server/node_modules/@redocly/openapi-core/lib/decorators/common/remove-x-internal.js +0 -68
- package/.output/server/node_modules/@redocly/openapi-core/lib/decorators/common/tag-description-override.js +0 -23
- package/.output/server/node_modules/@redocly/openapi-core/lib/decorators/oas2/index.js +0 -19
- package/.output/server/node_modules/@redocly/openapi-core/lib/decorators/oas2/remove-unused-components.js +0 -88
- package/.output/server/node_modules/@redocly/openapi-core/lib/decorators/oas3/index.js +0 -21
- package/.output/server/node_modules/@redocly/openapi-core/lib/decorators/oas3/remove-unused-components.js +0 -116
- package/.output/server/node_modules/@redocly/openapi-core/lib/decorators/openrpc/index.js +0 -2
- package/.output/server/node_modules/@redocly/openapi-core/lib/decorators/overlay1/index.js +0 -2
- package/.output/server/node_modules/@redocly/openapi-core/lib/detect-spec.js +0 -79
- package/.output/server/node_modules/@redocly/openapi-core/lib/env.js +0 -5
- package/.output/server/node_modules/@redocly/openapi-core/lib/errors/yaml-parse-error.js +0 -14
- package/.output/server/node_modules/@redocly/openapi-core/lib/format/codeframes.js +0 -177
- package/.output/server/node_modules/@redocly/openapi-core/lib/format/format.js +0 -365
- package/.output/server/node_modules/@redocly/openapi-core/lib/index.js +0 -49
- package/.output/server/node_modules/@redocly/openapi-core/lib/js-yaml/index.js +0 -11
- package/.output/server/node_modules/@redocly/openapi-core/lib/lint-entity.js +0 -171
- package/.output/server/node_modules/@redocly/openapi-core/lib/lint.js +0 -123
- package/.output/server/node_modules/@redocly/openapi-core/lib/logger.js +0 -56
- package/.output/server/node_modules/@redocly/openapi-core/lib/oas-types.js +0 -35
- package/.output/server/node_modules/@redocly/openapi-core/lib/ref-utils.js +0 -106
- package/.output/server/node_modules/@redocly/openapi-core/lib/resolve.js +0 -326
- package/.output/server/node_modules/@redocly/openapi-core/lib/rules/ajv.js +0 -106
- package/.output/server/node_modules/@redocly/openapi-core/lib/rules/arazzo/criteria-unique.js +0 -68
- package/.output/server/node_modules/@redocly/openapi-core/lib/rules/arazzo/index.js +0 -52
- package/.output/server/node_modules/@redocly/openapi-core/lib/rules/arazzo/outputs-defined.js +0 -139
- package/.output/server/node_modules/@redocly/openapi-core/lib/rules/arazzo/parameters-unique.js +0 -27
- package/.output/server/node_modules/@redocly/openapi-core/lib/rules/arazzo/requestBody-replacements-unique.js +0 -30
- package/.output/server/node_modules/@redocly/openapi-core/lib/rules/arazzo/sourceDescription-type.js +0 -19
- package/.output/server/node_modules/@redocly/openapi-core/lib/rules/arazzo/sourceDescriptions-name-unique.js +0 -21
- package/.output/server/node_modules/@redocly/openapi-core/lib/rules/arazzo/sourceDescriptions-not-empty.js +0 -15
- package/.output/server/node_modules/@redocly/openapi-core/lib/rules/arazzo/step-onFailure-unique.js +0 -27
- package/.output/server/node_modules/@redocly/openapi-core/lib/rules/arazzo/step-onSuccess-unique.js +0 -27
- package/.output/server/node_modules/@redocly/openapi-core/lib/rules/arazzo/stepId-unique.js +0 -23
- package/.output/server/node_modules/@redocly/openapi-core/lib/rules/arazzo/workflow-dependsOn.js +0 -53
- package/.output/server/node_modules/@redocly/openapi-core/lib/rules/arazzo/workflowId-unique.js +0 -19
- package/.output/server/node_modules/@redocly/openapi-core/lib/rules/async2/channels-kebab-case.js +0 -16
- package/.output/server/node_modules/@redocly/openapi-core/lib/rules/async2/index.js +0 -32
- package/.output/server/node_modules/@redocly/openapi-core/lib/rules/async2/no-channel-trailing-slash.js +0 -13
- package/.output/server/node_modules/@redocly/openapi-core/lib/rules/async3/channels-kebab-case.js +0 -16
- package/.output/server/node_modules/@redocly/openapi-core/lib/rules/async3/index.js +0 -32
- package/.output/server/node_modules/@redocly/openapi-core/lib/rules/async3/no-channel-trailing-slash.js +0 -13
- package/.output/server/node_modules/@redocly/openapi-core/lib/rules/catalog-entity/entity-key-valid.js +0 -39
- package/.output/server/node_modules/@redocly/openapi-core/lib/rules/common/assertions/asserts.js +0 -269
- package/.output/server/node_modules/@redocly/openapi-core/lib/rules/common/assertions/index.js +0 -22
- package/.output/server/node_modules/@redocly/openapi-core/lib/rules/common/assertions/utils.js +0 -215
- package/.output/server/node_modules/@redocly/openapi-core/lib/rules/common/info-contact.js +0 -14
- package/.output/server/node_modules/@redocly/openapi-core/lib/rules/common/info-license-strict.js +0 -23
- package/.output/server/node_modules/@redocly/openapi-core/lib/rules/common/info-license.js +0 -14
- package/.output/server/node_modules/@redocly/openapi-core/lib/rules/common/no-ambiguous-paths.js +0 -42
- package/.output/server/node_modules/@redocly/openapi-core/lib/rules/common/no-duplicated-tag-names.js +0 -21
- package/.output/server/node_modules/@redocly/openapi-core/lib/rules/common/no-enum-type-mismatch.js +0 -38
- package/.output/server/node_modules/@redocly/openapi-core/lib/rules/common/no-http-verbs-in-paths.js +0 -31
- package/.output/server/node_modules/@redocly/openapi-core/lib/rules/common/no-identical-paths.js +0 -21
- package/.output/server/node_modules/@redocly/openapi-core/lib/rules/common/no-invalid-parameter-examples.js +0 -32
- package/.output/server/node_modules/@redocly/openapi-core/lib/rules/common/no-invalid-schema-examples.js +0 -34
- package/.output/server/node_modules/@redocly/openapi-core/lib/rules/common/no-path-trailing-slash.js +0 -13
- package/.output/server/node_modules/@redocly/openapi-core/lib/rules/common/no-required-schema-properties-undefined.js +0 -78
- package/.output/server/node_modules/@redocly/openapi-core/lib/rules/common/no-schema-type-mismatch.js +0 -19
- package/.output/server/node_modules/@redocly/openapi-core/lib/rules/common/no-unresolved-refs.js +0 -42
- package/.output/server/node_modules/@redocly/openapi-core/lib/rules/common/operation-2xx-response.js +0 -20
- package/.output/server/node_modules/@redocly/openapi-core/lib/rules/common/operation-4xx-response.js +0 -20
- package/.output/server/node_modules/@redocly/openapi-core/lib/rules/common/operation-description.js +0 -9
- package/.output/server/node_modules/@redocly/openapi-core/lib/rules/common/operation-operationId-unique.js +0 -17
- package/.output/server/node_modules/@redocly/openapi-core/lib/rules/common/operation-operationId-url-safe.js +0 -15
- package/.output/server/node_modules/@redocly/openapi-core/lib/rules/common/operation-operationId.js +0 -13
- package/.output/server/node_modules/@redocly/openapi-core/lib/rules/common/operation-parameters-unique.js +0 -37
- package/.output/server/node_modules/@redocly/openapi-core/lib/rules/common/operation-singular-tag.js +0 -13
- package/.output/server/node_modules/@redocly/openapi-core/lib/rules/common/operation-summary.js +0 -9
- package/.output/server/node_modules/@redocly/openapi-core/lib/rules/common/operation-tag-defined.js +0 -27
- package/.output/server/node_modules/@redocly/openapi-core/lib/rules/common/parameter-description.js +0 -19
- package/.output/server/node_modules/@redocly/openapi-core/lib/rules/common/path-declaration-must-exist.js +0 -13
- package/.output/server/node_modules/@redocly/openapi-core/lib/rules/common/path-http-verbs-order.js +0 -23
- package/.output/server/node_modules/@redocly/openapi-core/lib/rules/common/path-not-include-query.js +0 -15
- package/.output/server/node_modules/@redocly/openapi-core/lib/rules/common/path-params-defined.js +0 -125
- package/.output/server/node_modules/@redocly/openapi-core/lib/rules/common/path-segment-plural.js +0 -30
- package/.output/server/node_modules/@redocly/openapi-core/lib/rules/common/paths-kebab-case.js +0 -17
- package/.output/server/node_modules/@redocly/openapi-core/lib/rules/common/required-string-property-missing-min-length.js +0 -34
- package/.output/server/node_modules/@redocly/openapi-core/lib/rules/common/response-contains-header.js +0 -26
- package/.output/server/node_modules/@redocly/openapi-core/lib/rules/common/scalar-property-missing-example.js +0 -39
- package/.output/server/node_modules/@redocly/openapi-core/lib/rules/common/security-defined.js +0 -62
- package/.output/server/node_modules/@redocly/openapi-core/lib/rules/common/spec-strict-refs.js +0 -27
- package/.output/server/node_modules/@redocly/openapi-core/lib/rules/common/struct.js +0 -150
- package/.output/server/node_modules/@redocly/openapi-core/lib/rules/common/tag-description.js +0 -9
- package/.output/server/node_modules/@redocly/openapi-core/lib/rules/common/tags-alphabetical.js +0 -18
- package/.output/server/node_modules/@redocly/openapi-core/lib/rules/oas2/boolean-parameter-prefixes.js +0 -19
- package/.output/server/node_modules/@redocly/openapi-core/lib/rules/oas2/index.js +0 -93
- package/.output/server/node_modules/@redocly/openapi-core/lib/rules/oas2/request-mime-type.js +0 -14
- package/.output/server/node_modules/@redocly/openapi-core/lib/rules/oas2/response-contains-property.js +0 -34
- package/.output/server/node_modules/@redocly/openapi-core/lib/rules/oas2/response-mime-type.js +0 -14
- package/.output/server/node_modules/@redocly/openapi-core/lib/rules/oas3/array-parameter-serialization.js +0 -26
- package/.output/server/node_modules/@redocly/openapi-core/lib/rules/oas3/boolean-parameter-prefixes.js +0 -21
- package/.output/server/node_modules/@redocly/openapi-core/lib/rules/oas3/component-name-unique.js +0 -130
- package/.output/server/node_modules/@redocly/openapi-core/lib/rules/oas3/index.js +0 -129
- package/.output/server/node_modules/@redocly/openapi-core/lib/rules/oas3/no-empty-servers.js +0 -20
- package/.output/server/node_modules/@redocly/openapi-core/lib/rules/oas3/no-example-value-and-externalValue.js +0 -13
- package/.output/server/node_modules/@redocly/openapi-core/lib/rules/oas3/no-invalid-media-type-examples.js +0 -59
- package/.output/server/node_modules/@redocly/openapi-core/lib/rules/oas3/no-server-example.com.js +0 -15
- package/.output/server/node_modules/@redocly/openapi-core/lib/rules/oas3/no-server-trailing-slash.js +0 -15
- package/.output/server/node_modules/@redocly/openapi-core/lib/rules/oas3/no-server-variables-empty-enum.js +0 -58
- package/.output/server/node_modules/@redocly/openapi-core/lib/rules/oas3/no-undefined-server-variable.js +0 -28
- package/.output/server/node_modules/@redocly/openapi-core/lib/rules/oas3/no-unused-components.js +0 -83
- package/.output/server/node_modules/@redocly/openapi-core/lib/rules/oas3/nullable-type-sibling.js +0 -15
- package/.output/server/node_modules/@redocly/openapi-core/lib/rules/oas3/operation-4xx-problem-details-rfc7807.js +0 -33
- package/.output/server/node_modules/@redocly/openapi-core/lib/rules/oas3/request-mime-type.js +0 -28
- package/.output/server/node_modules/@redocly/openapi-core/lib/rules/oas3/response-contains-property.js +0 -36
- package/.output/server/node_modules/@redocly/openapi-core/lib/rules/oas3/response-mime-type.js +0 -28
- package/.output/server/node_modules/@redocly/openapi-core/lib/rules/oas3/spec-components-invalid-map-name.js +0 -59
- package/.output/server/node_modules/@redocly/openapi-core/lib/rules/oas3/spec-discriminator-defaultMapping.js +0 -32
- package/.output/server/node_modules/@redocly/openapi-core/lib/rules/oas3/spec-example-values.js +0 -31
- package/.output/server/node_modules/@redocly/openapi-core/lib/rules/oas3/spec-no-invalid-encoding-combinations.js +0 -16
- package/.output/server/node_modules/@redocly/openapi-core/lib/rules/oas3/spec-no-invalid-tag-parents.js +0 -38
- package/.output/server/node_modules/@redocly/openapi-core/lib/rules/oas3/spec-querystring-parameters.js +0 -65
- package/.output/server/node_modules/@redocly/openapi-core/lib/rules/openrpc/index.js +0 -20
- package/.output/server/node_modules/@redocly/openapi-core/lib/rules/openrpc/no-unused-components.js +0 -82
- package/.output/server/node_modules/@redocly/openapi-core/lib/rules/openrpc/spec-no-duplicated-method-params.js +0 -28
- package/.output/server/node_modules/@redocly/openapi-core/lib/rules/openrpc/spec-no-required-params-after-optional.js +0 -31
- package/.output/server/node_modules/@redocly/openapi-core/lib/rules/other/stats.js +0 -74
- package/.output/server/node_modules/@redocly/openapi-core/lib/rules/overlay1/index.js +0 -12
- package/.output/server/node_modules/@redocly/openapi-core/lib/rules/respect/no-criteria-xpath.js +0 -20
- package/.output/server/node_modules/@redocly/openapi-core/lib/rules/respect/no-x-security-both-scheme-and-scheme-name.js +0 -30
- package/.output/server/node_modules/@redocly/openapi-core/lib/rules/respect/no-x-security-scheme-name-without-openapi.js +0 -25
- package/.output/server/node_modules/@redocly/openapi-core/lib/rules/respect/respect-supported-versions.js +0 -18
- package/.output/server/node_modules/@redocly/openapi-core/lib/rules/respect/x-security-scheme-name-reference.js +0 -35
- package/.output/server/node_modules/@redocly/openapi-core/lib/rules/respect/x-security-scheme-required-values.js +0 -60
- package/.output/server/node_modules/@redocly/openapi-core/lib/rules/utils.js +0 -172
- package/.output/server/node_modules/@redocly/openapi-core/lib/types/arazzo.js +0 -482
- package/.output/server/node_modules/@redocly/openapi-core/lib/types/asyncapi2.js +0 -1157
- package/.output/server/node_modules/@redocly/openapi-core/lib/types/asyncapi3.js +0 -511
- package/.output/server/node_modules/@redocly/openapi-core/lib/types/entity.js +0 -32
- package/.output/server/node_modules/@redocly/openapi-core/lib/types/index.js +0 -90
- package/.output/server/node_modules/@redocly/openapi-core/lib/types/json-schema-adapter.js +0 -174
- package/.output/server/node_modules/@redocly/openapi-core/lib/types/json-schema-draft7.shared.js +0 -101
- package/.output/server/node_modules/@redocly/openapi-core/lib/types/oas2.js +0 -454
- package/.output/server/node_modules/@redocly/openapi-core/lib/types/oas3.js +0 -828
- package/.output/server/node_modules/@redocly/openapi-core/lib/types/oas3_1.js +0 -292
- package/.output/server/node_modules/@redocly/openapi-core/lib/types/oas3_2.js +0 -306
- package/.output/server/node_modules/@redocly/openapi-core/lib/types/openrpc.js +0 -360
- package/.output/server/node_modules/@redocly/openapi-core/lib/types/overlay.js +0 -61
- package/.output/server/node_modules/@redocly/openapi-core/lib/types/redocly-yaml.js +0 -555
- package/.output/server/node_modules/@redocly/openapi-core/lib/typings/arazzo.js +0 -3
- package/.output/server/node_modules/@redocly/openapi-core/lib/utils/assign-config.js +0 -28
- package/.output/server/node_modules/@redocly/openapi-core/lib/utils/dequal.js +0 -36
- package/.output/server/node_modules/@redocly/openapi-core/lib/utils/does-yaml-file-exist.js +0 -7
- package/.output/server/node_modules/@redocly/openapi-core/lib/utils/error.js +0 -3
- package/.output/server/node_modules/@redocly/openapi-core/lib/utils/get-intersection-length.js +0 -11
- package/.output/server/node_modules/@redocly/openapi-core/lib/utils/get-matching-status-code-range.js +0 -4
- package/.output/server/node_modules/@redocly/openapi-core/lib/utils/get-own.js +0 -4
- package/.output/server/node_modules/@redocly/openapi-core/lib/utils/identity.js +0 -4
- package/.output/server/node_modules/@redocly/openapi-core/lib/utils/is-custom-rule-id.js +0 -4
- package/.output/server/node_modules/@redocly/openapi-core/lib/utils/is-defined.js +0 -4
- package/.output/server/node_modules/@redocly/openapi-core/lib/utils/is-empty-array.js +0 -4
- package/.output/server/node_modules/@redocly/openapi-core/lib/utils/is-empty-object.js +0 -5
- package/.output/server/node_modules/@redocly/openapi-core/lib/utils/is-not-empty-array.js +0 -4
- package/.output/server/node_modules/@redocly/openapi-core/lib/utils/is-not-empty-object.js +0 -6
- package/.output/server/node_modules/@redocly/openapi-core/lib/utils/is-not-string.js +0 -5
- package/.output/server/node_modules/@redocly/openapi-core/lib/utils/is-ordered.js +0 -27
- package/.output/server/node_modules/@redocly/openapi-core/lib/utils/is-path-parameter.js +0 -4
- package/.output/server/node_modules/@redocly/openapi-core/lib/utils/is-plain-object.js +0 -4
- package/.output/server/node_modules/@redocly/openapi-core/lib/utils/is-string.js +0 -4
- package/.output/server/node_modules/@redocly/openapi-core/lib/utils/is-truthy.js +0 -4
- package/.output/server/node_modules/@redocly/openapi-core/lib/utils/keys-of.js +0 -6
- package/.output/server/node_modules/@redocly/openapi-core/lib/utils/make-ref-id.js +0 -4
- package/.output/server/node_modules/@redocly/openapi-core/lib/utils/next-tick.js +0 -6
- package/.output/server/node_modules/@redocly/openapi-core/lib/utils/oas-has-component.js +0 -4
- package/.output/server/node_modules/@redocly/openapi-core/lib/utils/omit.js +0 -8
- package/.output/server/node_modules/@redocly/openapi-core/lib/utils/pause.js +0 -4
- package/.output/server/node_modules/@redocly/openapi-core/lib/utils/pluralize.js +0 -8
- package/.output/server/node_modules/@redocly/openapi-core/lib/utils/read-file-from-url.js +0 -26
- package/.output/server/node_modules/@redocly/openapi-core/lib/utils/regex-from-string.js +0 -5
- package/.output/server/node_modules/@redocly/openapi-core/lib/utils/scorecards.js +0 -99
- package/.output/server/node_modules/@redocly/openapi-core/lib/utils/slash.js +0 -11
- package/.output/server/node_modules/@redocly/openapi-core/lib/utils/split-camel-case-into-words.js +0 -13
- package/.output/server/node_modules/@redocly/openapi-core/lib/utils/stack.js +0 -7
- package/.output/server/node_modules/@redocly/openapi-core/lib/utils/validate-mime-type.js +0 -31
- package/.output/server/node_modules/@redocly/openapi-core/lib/utils/yaml-fs-helper.js +0 -23
- package/.output/server/node_modules/@redocly/openapi-core/lib/visitors.js +0 -177
- package/.output/server/node_modules/@redocly/openapi-core/lib/walk.js +0 -303
- package/.output/server/node_modules/@redocly/openapi-core/package.json +0 -74
- package/.output/server/node_modules/ajv-formats/dist/formats.js +0 -208
- package/.output/server/node_modules/ajv-formats/dist/index.js +0 -37
- package/.output/server/node_modules/ajv-formats/dist/limit.js +0 -69
- package/.output/server/node_modules/ajv-formats/package.json +0 -74
- package/.output/server/node_modules/colorette/index.js +0 -82
- package/.output/server/node_modules/colorette/package.json +0 -39
- package/.output/server/node_modules/js-levenshtein/index.js +0 -105
- package/.output/server/node_modules/js-levenshtein/package.json +0 -49
- package/.output/server/node_modules/pluralize/package.json +0 -40
- package/.output/server/node_modules/pluralize/pluralize.js +0 -503
- package/.output/server/node_modules/yaml-ast-parser/dist/src/common.js +0 -45
- package/.output/server/node_modules/yaml-ast-parser/dist/src/dumper.js +0 -644
- package/.output/server/node_modules/yaml-ast-parser/dist/src/exception.js +0 -40
- package/.output/server/node_modules/yaml-ast-parser/dist/src/index.js +0 -22
- package/.output/server/node_modules/yaml-ast-parser/dist/src/loader.js +0 -1416
- package/.output/server/node_modules/yaml-ast-parser/dist/src/mark.js +0 -62
- package/.output/server/node_modules/yaml-ast-parser/dist/src/scalarInference.js +0 -82
- package/.output/server/node_modules/yaml-ast-parser/dist/src/schema/core.js +0 -8
- package/.output/server/node_modules/yaml-ast-parser/dist/src/schema/default_full.js +0 -14
- package/.output/server/node_modules/yaml-ast-parser/dist/src/schema/default_safe.js +0 -19
- package/.output/server/node_modules/yaml-ast-parser/dist/src/schema/failsafe.js +0 -10
- package/.output/server/node_modules/yaml-ast-parser/dist/src/schema/json.js +0 -14
- package/.output/server/node_modules/yaml-ast-parser/dist/src/schema.js +0 -78
- package/.output/server/node_modules/yaml-ast-parser/dist/src/type/binary.js +0 -92
- package/.output/server/node_modules/yaml-ast-parser/dist/src/type/bool.js +0 -32
- package/.output/server/node_modules/yaml-ast-parser/dist/src/type/float.js +0 -95
- package/.output/server/node_modules/yaml-ast-parser/dist/src/type/int.js +0 -155
- package/.output/server/node_modules/yaml-ast-parser/dist/src/type/js/regexp.js +0 -64
- package/.output/server/node_modules/yaml-ast-parser/dist/src/type/js/undefined.js +0 -22
- package/.output/server/node_modules/yaml-ast-parser/dist/src/type/map.js +0 -7
- package/.output/server/node_modules/yaml-ast-parser/dist/src/type/merge.js +0 -10
- package/.output/server/node_modules/yaml-ast-parser/dist/src/type/null.js +0 -30
- package/.output/server/node_modules/yaml-ast-parser/dist/src/type/omap.js +0 -46
- package/.output/server/node_modules/yaml-ast-parser/dist/src/type/pairs.js +0 -55
- package/.output/server/node_modules/yaml-ast-parser/dist/src/type/seq.js +0 -7
- package/.output/server/node_modules/yaml-ast-parser/dist/src/type/set.js +0 -22
- package/.output/server/node_modules/yaml-ast-parser/dist/src/type/str.js +0 -7
- package/.output/server/node_modules/yaml-ast-parser/dist/src/type/timestamp.js +0 -70
- package/.output/server/node_modules/yaml-ast-parser/dist/src/type.js +0 -54
- package/.output/server/node_modules/yaml-ast-parser/dist/src/yamlAST.js +0 -82
- package/.output/server/node_modules/yaml-ast-parser/package.json +0 -39
|
@@ -1,326 +0,0 @@
|
|
|
1
|
-
import * as fs from 'node:fs';
|
|
2
|
-
import * as path from 'node:path';
|
|
3
|
-
import { isRef, joinPointer, escapePointerFragment, parseRef, isAbsoluteUrl, isAnchor, isExternalValue, } from './ref-utils.js';
|
|
4
|
-
import { isNamedType, SpecExtension } from './types/index.js';
|
|
5
|
-
import { getOwn } from './utils/get-own.js';
|
|
6
|
-
import { readFileFromUrl } from './utils/read-file-from-url.js';
|
|
7
|
-
import { parseYaml } from './js-yaml/index.js';
|
|
8
|
-
import { nextTick } from './utils/next-tick.js';
|
|
9
|
-
import { YamlParseError } from './errors/yaml-parse-error.js';
|
|
10
|
-
import { makeRefId } from './utils/make-ref-id.js';
|
|
11
|
-
export class Source {
|
|
12
|
-
constructor(absoluteRef, body, mimeType) {
|
|
13
|
-
this.absoluteRef = absoluteRef;
|
|
14
|
-
this.body = body;
|
|
15
|
-
this.mimeType = mimeType;
|
|
16
|
-
}
|
|
17
|
-
// pass safeLoad as argument to separate it from browser bundle
|
|
18
|
-
getAst(safeLoad) {
|
|
19
|
-
if (this._ast === undefined) {
|
|
20
|
-
this._ast = safeLoad(this.body, { filename: this.absoluteRef }) ?? undefined;
|
|
21
|
-
// fix ast representation of file with newlines only
|
|
22
|
-
if (this._ast &&
|
|
23
|
-
this._ast.kind === 0 && // KIND.scalar = 0
|
|
24
|
-
this._ast.value === '' &&
|
|
25
|
-
this._ast.startPosition !== 1) {
|
|
26
|
-
this._ast.startPosition = 1;
|
|
27
|
-
this._ast.endPosition = 1;
|
|
28
|
-
}
|
|
29
|
-
}
|
|
30
|
-
return this._ast;
|
|
31
|
-
}
|
|
32
|
-
getLines() {
|
|
33
|
-
if (this._lines === undefined) {
|
|
34
|
-
this._lines = this.body.split(/\r\n|[\n\r]/g);
|
|
35
|
-
}
|
|
36
|
-
return this._lines;
|
|
37
|
-
}
|
|
38
|
-
}
|
|
39
|
-
export class ResolveError extends Error {
|
|
40
|
-
constructor(originalError) {
|
|
41
|
-
super(originalError.message);
|
|
42
|
-
this.originalError = originalError;
|
|
43
|
-
// Set the prototype explicitly.
|
|
44
|
-
Object.setPrototypeOf(this, ResolveError.prototype);
|
|
45
|
-
}
|
|
46
|
-
}
|
|
47
|
-
export function makeDocumentFromString(sourceString, absoluteRef) {
|
|
48
|
-
const source = new Source(absoluteRef, sourceString);
|
|
49
|
-
try {
|
|
50
|
-
return {
|
|
51
|
-
source,
|
|
52
|
-
parsed: parseYaml(sourceString, { filename: absoluteRef }),
|
|
53
|
-
};
|
|
54
|
-
}
|
|
55
|
-
catch (e) {
|
|
56
|
-
throw new YamlParseError(e, source);
|
|
57
|
-
}
|
|
58
|
-
}
|
|
59
|
-
export class BaseResolver {
|
|
60
|
-
constructor(config = { http: { headers: [] } }) {
|
|
61
|
-
this.config = config;
|
|
62
|
-
this.cache = new Map();
|
|
63
|
-
}
|
|
64
|
-
getFiles() {
|
|
65
|
-
return new Set(Array.from(this.cache.keys()));
|
|
66
|
-
}
|
|
67
|
-
resolveExternalRef(base, ref) {
|
|
68
|
-
if (isAbsoluteUrl(ref)) {
|
|
69
|
-
return ref;
|
|
70
|
-
}
|
|
71
|
-
if (base && isAbsoluteUrl(base)) {
|
|
72
|
-
return new URL(ref, base).href;
|
|
73
|
-
}
|
|
74
|
-
return path.resolve(base ? path.dirname(base) : process.cwd(), ref);
|
|
75
|
-
}
|
|
76
|
-
async loadExternalRef(absoluteRef) {
|
|
77
|
-
try {
|
|
78
|
-
if (isAbsoluteUrl(absoluteRef)) {
|
|
79
|
-
const { body, mimeType } = await readFileFromUrl(absoluteRef, this.config.http);
|
|
80
|
-
return new Source(absoluteRef, body, mimeType);
|
|
81
|
-
}
|
|
82
|
-
else {
|
|
83
|
-
if (fs.lstatSync(absoluteRef).isDirectory()) {
|
|
84
|
-
throw new Error(`Expected a file but received a folder at ${absoluteRef}.`);
|
|
85
|
-
}
|
|
86
|
-
const content = await fs.promises.readFile(absoluteRef, 'utf-8');
|
|
87
|
-
// In some cases file have \r\n line delimeters like on windows, we should skip it.
|
|
88
|
-
return new Source(absoluteRef, content.replace(/\r\n/g, '\n'));
|
|
89
|
-
}
|
|
90
|
-
}
|
|
91
|
-
catch (error) {
|
|
92
|
-
error.message = error.message.replace(', lstat', '');
|
|
93
|
-
throw new ResolveError(error);
|
|
94
|
-
}
|
|
95
|
-
}
|
|
96
|
-
parseDocument(source, isRoot = false) {
|
|
97
|
-
const ext = source.absoluteRef.substr(source.absoluteRef.lastIndexOf('.'));
|
|
98
|
-
if (!['.json', '.json', '.yml', '.yaml'].includes(ext) &&
|
|
99
|
-
!source.mimeType?.match(/(json|yaml|openapi)/) &&
|
|
100
|
-
!isRoot // always parse root
|
|
101
|
-
) {
|
|
102
|
-
return { source, parsed: source.body };
|
|
103
|
-
}
|
|
104
|
-
try {
|
|
105
|
-
return {
|
|
106
|
-
source,
|
|
107
|
-
parsed: parseYaml(source.body, { filename: source.absoluteRef }),
|
|
108
|
-
};
|
|
109
|
-
}
|
|
110
|
-
catch (e) {
|
|
111
|
-
throw new YamlParseError(e, source);
|
|
112
|
-
}
|
|
113
|
-
}
|
|
114
|
-
async resolveDocument(base, ref, isRoot = false) {
|
|
115
|
-
const absoluteRef = this.resolveExternalRef(base, ref);
|
|
116
|
-
const cachedDocument = this.cache.get(absoluteRef);
|
|
117
|
-
if (cachedDocument) {
|
|
118
|
-
return cachedDocument;
|
|
119
|
-
}
|
|
120
|
-
const doc = this.loadExternalRef(absoluteRef).then((source) => {
|
|
121
|
-
return this.parseDocument(source, isRoot);
|
|
122
|
-
});
|
|
123
|
-
this.cache.set(absoluteRef, doc);
|
|
124
|
-
return doc;
|
|
125
|
-
}
|
|
126
|
-
}
|
|
127
|
-
function pushRef(head, node) {
|
|
128
|
-
return {
|
|
129
|
-
prev: head,
|
|
130
|
-
node,
|
|
131
|
-
};
|
|
132
|
-
}
|
|
133
|
-
function hasRef(head, node) {
|
|
134
|
-
while (head) {
|
|
135
|
-
if (head.node === node) {
|
|
136
|
-
return true;
|
|
137
|
-
}
|
|
138
|
-
head = head.prev;
|
|
139
|
-
}
|
|
140
|
-
return false;
|
|
141
|
-
}
|
|
142
|
-
const unknownType = { name: 'unknown', properties: {} };
|
|
143
|
-
const resolvableScalarType = { name: 'scalar', properties: {} };
|
|
144
|
-
export async function resolveDocument(opts) {
|
|
145
|
-
const { rootDocument, externalRefResolver, rootType } = opts;
|
|
146
|
-
const resolvedRefMap = new Map();
|
|
147
|
-
const seenNodes = new Set(); // format "${type}::${absoluteRef}${pointer}"
|
|
148
|
-
const resolvePromises = [];
|
|
149
|
-
resolveRefsInParallel(rootDocument.parsed, rootDocument, '#/', rootType);
|
|
150
|
-
let resolved;
|
|
151
|
-
do {
|
|
152
|
-
resolved = await Promise.all(resolvePromises);
|
|
153
|
-
} while (resolvePromises.length !== resolved.length);
|
|
154
|
-
return resolvedRefMap;
|
|
155
|
-
function resolveRefsInParallel(rootNode, rootNodeDocument, rootNodePointer, type) {
|
|
156
|
-
const rootNodeDocAbsoluteRef = rootNodeDocument.source.absoluteRef;
|
|
157
|
-
const anchorRefsMap = new Map();
|
|
158
|
-
walk(rootNode, type, rootNodeDocAbsoluteRef + rootNodePointer);
|
|
159
|
-
function walk(node, type, nodeAbsoluteRef) {
|
|
160
|
-
if (typeof node !== 'object' || node === null) {
|
|
161
|
-
return;
|
|
162
|
-
}
|
|
163
|
-
const nodeId = `${type.name}::${nodeAbsoluteRef}`;
|
|
164
|
-
if (seenNodes.has(nodeId)) {
|
|
165
|
-
return;
|
|
166
|
-
}
|
|
167
|
-
seenNodes.add(nodeId);
|
|
168
|
-
const [_, anchor] = Object.entries(node).find(([key]) => key === '$anchor') || [];
|
|
169
|
-
if (anchor) {
|
|
170
|
-
anchorRefsMap.set(`#${anchor}`, node);
|
|
171
|
-
}
|
|
172
|
-
if (Array.isArray(node)) {
|
|
173
|
-
const itemsType = type.items;
|
|
174
|
-
// we continue resolving unknown types, but stop early on known scalars
|
|
175
|
-
if (itemsType === undefined && type !== unknownType && type !== SpecExtension) {
|
|
176
|
-
return;
|
|
177
|
-
}
|
|
178
|
-
const isTypeAFunction = typeof itemsType === 'function';
|
|
179
|
-
for (let i = 0; i < node.length; i++) {
|
|
180
|
-
let itemType = isTypeAFunction
|
|
181
|
-
? itemsType(node[i], joinPointer(nodeAbsoluteRef, i))
|
|
182
|
-
: itemsType;
|
|
183
|
-
// we continue resolving unknown types, but stop early on known scalars
|
|
184
|
-
if (itemType === undefined && type !== unknownType && type !== SpecExtension) {
|
|
185
|
-
continue;
|
|
186
|
-
}
|
|
187
|
-
const value = itemType?.directResolveAs ? { $ref: node[i] } : node[i];
|
|
188
|
-
itemType = itemType?.directResolveAs || itemType;
|
|
189
|
-
walk(value, isNamedType(itemType) ? itemType : unknownType, joinPointer(nodeAbsoluteRef, i));
|
|
190
|
-
}
|
|
191
|
-
return;
|
|
192
|
-
}
|
|
193
|
-
for (const propName of Object.keys(node)) {
|
|
194
|
-
let propValue = node[propName];
|
|
195
|
-
let propType = getOwn(type.properties, propName);
|
|
196
|
-
if (propType === undefined)
|
|
197
|
-
propType = type.additionalProperties;
|
|
198
|
-
if (typeof propType === 'function')
|
|
199
|
-
propType = propType(propValue, propName);
|
|
200
|
-
if (propType === undefined)
|
|
201
|
-
propType = unknownType;
|
|
202
|
-
if (type.extensionsPrefix &&
|
|
203
|
-
propName.startsWith(type.extensionsPrefix) &&
|
|
204
|
-
propType === unknownType) {
|
|
205
|
-
propType = SpecExtension;
|
|
206
|
-
}
|
|
207
|
-
if (!isNamedType(propType) && propType?.directResolveAs) {
|
|
208
|
-
propType = propType.directResolveAs;
|
|
209
|
-
propValue = { $ref: propValue };
|
|
210
|
-
}
|
|
211
|
-
if (propType && propType.name === undefined && propType.resolvable !== false) {
|
|
212
|
-
propType = resolvableScalarType;
|
|
213
|
-
}
|
|
214
|
-
if (!isNamedType(propType) || typeof propValue !== 'object') {
|
|
215
|
-
continue;
|
|
216
|
-
}
|
|
217
|
-
walk(propValue, propType, joinPointer(nodeAbsoluteRef, escapePointerFragment(propName)));
|
|
218
|
-
}
|
|
219
|
-
if (isRef(node)) {
|
|
220
|
-
const promise = followRef(rootNodeDocument, node, {
|
|
221
|
-
prev: null,
|
|
222
|
-
node,
|
|
223
|
-
}).then((resolvedRef) => {
|
|
224
|
-
if (resolvedRef.resolved) {
|
|
225
|
-
resolveRefsInParallel(resolvedRef.node, resolvedRef.document, resolvedRef.nodePointer, type);
|
|
226
|
-
}
|
|
227
|
-
});
|
|
228
|
-
resolvePromises.push(promise);
|
|
229
|
-
}
|
|
230
|
-
// handle example.externalValue as reference
|
|
231
|
-
if (isExternalValue(node)) {
|
|
232
|
-
const promise = followRef(rootNodeDocument, { $ref: node.externalValue }, {
|
|
233
|
-
prev: null,
|
|
234
|
-
node,
|
|
235
|
-
}).then((resolvedRef) => {
|
|
236
|
-
if (resolvedRef.resolved) {
|
|
237
|
-
resolveRefsInParallel(resolvedRef.node, resolvedRef.document, resolvedRef.nodePointer, type);
|
|
238
|
-
}
|
|
239
|
-
});
|
|
240
|
-
resolvePromises.push(promise);
|
|
241
|
-
}
|
|
242
|
-
}
|
|
243
|
-
async function followRef(document, ref, refStack) {
|
|
244
|
-
if (hasRef(refStack.prev, ref)) {
|
|
245
|
-
throw new Error('Self-referencing circular pointer');
|
|
246
|
-
}
|
|
247
|
-
if (isAnchor(ref.$ref)) {
|
|
248
|
-
// Wait for all anchors in the document to be collected firstly.
|
|
249
|
-
await nextTick();
|
|
250
|
-
const resolvedRef = {
|
|
251
|
-
resolved: true,
|
|
252
|
-
isRemote: false,
|
|
253
|
-
node: anchorRefsMap.get(ref.$ref),
|
|
254
|
-
document,
|
|
255
|
-
nodePointer: ref.$ref,
|
|
256
|
-
};
|
|
257
|
-
const refId = makeRefId(document.source.absoluteRef, ref.$ref);
|
|
258
|
-
resolvedRefMap.set(refId, resolvedRef);
|
|
259
|
-
return resolvedRef;
|
|
260
|
-
}
|
|
261
|
-
const { uri, pointer } = parseRef(ref.$ref);
|
|
262
|
-
const isRemote = uri !== null &&
|
|
263
|
-
externalRefResolver.resolveExternalRef(document.source.absoluteRef, uri) !==
|
|
264
|
-
document.source.absoluteRef;
|
|
265
|
-
let targetDoc;
|
|
266
|
-
try {
|
|
267
|
-
targetDoc = isRemote
|
|
268
|
-
? (await externalRefResolver.resolveDocument(document.source.absoluteRef, uri))
|
|
269
|
-
: document;
|
|
270
|
-
}
|
|
271
|
-
catch (error) {
|
|
272
|
-
const resolvedRef = {
|
|
273
|
-
resolved: false,
|
|
274
|
-
isRemote,
|
|
275
|
-
document: undefined,
|
|
276
|
-
error: error,
|
|
277
|
-
};
|
|
278
|
-
const refId = makeRefId(document.source.absoluteRef, ref.$ref);
|
|
279
|
-
resolvedRefMap.set(refId, resolvedRef);
|
|
280
|
-
return resolvedRef;
|
|
281
|
-
}
|
|
282
|
-
let resolvedRef = {
|
|
283
|
-
resolved: true,
|
|
284
|
-
document: targetDoc,
|
|
285
|
-
isRemote,
|
|
286
|
-
node: document.parsed,
|
|
287
|
-
nodePointer: '#/',
|
|
288
|
-
};
|
|
289
|
-
let target = targetDoc.parsed;
|
|
290
|
-
const segments = pointer;
|
|
291
|
-
for (const segment of segments) {
|
|
292
|
-
if (typeof target !== 'object') {
|
|
293
|
-
target = undefined;
|
|
294
|
-
break;
|
|
295
|
-
}
|
|
296
|
-
else if (target[segment] !== undefined) {
|
|
297
|
-
target = target[segment];
|
|
298
|
-
resolvedRef.nodePointer = joinPointer(resolvedRef.nodePointer, escapePointerFragment(segment));
|
|
299
|
-
}
|
|
300
|
-
else if (isRef(target)) {
|
|
301
|
-
resolvedRef = await followRef(targetDoc, target, pushRef(refStack, target));
|
|
302
|
-
targetDoc = resolvedRef.document || targetDoc;
|
|
303
|
-
if (typeof resolvedRef.node !== 'object') {
|
|
304
|
-
target = undefined;
|
|
305
|
-
break;
|
|
306
|
-
}
|
|
307
|
-
target = resolvedRef.node[segment];
|
|
308
|
-
resolvedRef.nodePointer = joinPointer(resolvedRef.nodePointer, escapePointerFragment(segment));
|
|
309
|
-
}
|
|
310
|
-
else {
|
|
311
|
-
target = undefined;
|
|
312
|
-
break;
|
|
313
|
-
}
|
|
314
|
-
}
|
|
315
|
-
resolvedRef.node = target;
|
|
316
|
-
resolvedRef.document = targetDoc;
|
|
317
|
-
const refId = makeRefId(document.source.absoluteRef, ref.$ref);
|
|
318
|
-
if (resolvedRef.document && isRef(target)) {
|
|
319
|
-
resolvedRef = await followRef(resolvedRef.document, target, pushRef(refStack, target));
|
|
320
|
-
}
|
|
321
|
-
resolvedRefMap.set(refId, resolvedRef);
|
|
322
|
-
return { ...resolvedRef };
|
|
323
|
-
}
|
|
324
|
-
}
|
|
325
|
-
}
|
|
326
|
-
//# sourceMappingURL=resolve.js.map
|
|
@@ -1,106 +0,0 @@
|
|
|
1
|
-
import addFormats from 'ajv-formats';
|
|
2
|
-
import Ajv2020 from '@redocly/ajv/dist/2020.js';
|
|
3
|
-
import AjvDraft4 from '@redocly/ajv/dist/draft4.js';
|
|
4
|
-
import { escapePointerFragment } from '../ref-utils.js';
|
|
5
|
-
const ajvInstances = {};
|
|
6
|
-
export function releaseAjvInstance() {
|
|
7
|
-
ajvInstances['2020'] = undefined;
|
|
8
|
-
ajvInstances['draft4'] = undefined;
|
|
9
|
-
}
|
|
10
|
-
function getSchemaIdKey(dialect) {
|
|
11
|
-
return dialect === 'draft4' ? 'id' : '$id';
|
|
12
|
-
}
|
|
13
|
-
function getDialectBySpecVersion(specVersion) {
|
|
14
|
-
if (specVersion === 'oas2' || specVersion === 'oas3_0')
|
|
15
|
-
return 'draft4';
|
|
16
|
-
return '2020';
|
|
17
|
-
}
|
|
18
|
-
function getAjv(resolve, dialect) {
|
|
19
|
-
if (!ajvInstances[dialect]) {
|
|
20
|
-
const schemaIdKey = getSchemaIdKey(dialect);
|
|
21
|
-
const options = {
|
|
22
|
-
schemaId: schemaIdKey,
|
|
23
|
-
meta: true,
|
|
24
|
-
allErrors: true,
|
|
25
|
-
strictSchema: false,
|
|
26
|
-
inlineRefs: false,
|
|
27
|
-
validateSchema: false,
|
|
28
|
-
discriminator: true,
|
|
29
|
-
allowUnionTypes: true,
|
|
30
|
-
validateFormats: true,
|
|
31
|
-
passContext: true,
|
|
32
|
-
loadSchemaSync(base, $ref, $id) {
|
|
33
|
-
const decodedBase = decodeURI(base.split('#')[0]);
|
|
34
|
-
const resolvedRef = resolve({ $ref }, decodedBase);
|
|
35
|
-
if (!resolvedRef || !resolvedRef.location)
|
|
36
|
-
return false;
|
|
37
|
-
return {
|
|
38
|
-
[schemaIdKey]: encodeURI(resolvedRef.location.source.absoluteRef) + '#' + $id,
|
|
39
|
-
...resolvedRef.node,
|
|
40
|
-
};
|
|
41
|
-
},
|
|
42
|
-
logger: false,
|
|
43
|
-
};
|
|
44
|
-
ajvInstances[dialect] = dialect === '2020' ? new Ajv2020(options) : new AjvDraft4(options);
|
|
45
|
-
addFormats(ajvInstances[dialect]);
|
|
46
|
-
}
|
|
47
|
-
return ajvInstances[dialect];
|
|
48
|
-
}
|
|
49
|
-
function getAjvValidator(schema, loc, resolve, allowAdditionalProperties, dialect) {
|
|
50
|
-
const ajv = getAjv(resolve, dialect);
|
|
51
|
-
const $id = encodeURI(loc.absolutePointer);
|
|
52
|
-
const schemaIdKey = getSchemaIdKey(dialect);
|
|
53
|
-
if (!ajv.getSchema($id)) {
|
|
54
|
-
ajv.setDefaultUnevaluatedProperties(allowAdditionalProperties);
|
|
55
|
-
ajv.addSchema({
|
|
56
|
-
[schemaIdKey]: $id,
|
|
57
|
-
...schema,
|
|
58
|
-
}, $id);
|
|
59
|
-
}
|
|
60
|
-
return ajv.getSchema($id);
|
|
61
|
-
}
|
|
62
|
-
export function validateJsonSchema(data, schema, options) {
|
|
63
|
-
const { schemaLoc, instancePath, resolve, allowAdditionalProperties, ajvContext, specVersion } = options;
|
|
64
|
-
const dialect = getDialectBySpecVersion(specVersion);
|
|
65
|
-
const validate = getAjvValidator(schema, schemaLoc, resolve, allowAdditionalProperties, dialect);
|
|
66
|
-
if (!validate)
|
|
67
|
-
return { valid: true, errors: [] }; // unresolved refs are reported
|
|
68
|
-
const dataCxt = {
|
|
69
|
-
instancePath,
|
|
70
|
-
parentData: { fake: {} },
|
|
71
|
-
parentDataProperty: 'fake',
|
|
72
|
-
rootData: {},
|
|
73
|
-
dynamicAnchors: {},
|
|
74
|
-
};
|
|
75
|
-
const valid = validate.call(ajvContext ?? {}, data, dataCxt);
|
|
76
|
-
return {
|
|
77
|
-
valid: !!valid,
|
|
78
|
-
errors: (validate.errors || []).map(beatifyErrorMessage),
|
|
79
|
-
};
|
|
80
|
-
function beatifyErrorMessage(error) {
|
|
81
|
-
let message = error.message;
|
|
82
|
-
const suggest = error.keyword === 'enum' ? error.params.allowedValues : undefined;
|
|
83
|
-
if (suggest) {
|
|
84
|
-
message += ` ${suggest.map((e) => `"${e}"`).join(', ')}`;
|
|
85
|
-
}
|
|
86
|
-
if (error.keyword === 'type') {
|
|
87
|
-
message = `type ${message}`;
|
|
88
|
-
}
|
|
89
|
-
const relativePath = error.instancePath.substring(instancePath.length + 1);
|
|
90
|
-
const propName = relativePath.substring(relativePath.lastIndexOf('/') + 1);
|
|
91
|
-
if (propName) {
|
|
92
|
-
message = `\`${propName}\` property ${message}`;
|
|
93
|
-
}
|
|
94
|
-
if (error.keyword === 'additionalProperties' || error.keyword === 'unevaluatedProperties') {
|
|
95
|
-
const property = error.params.additionalProperty || error.params.unevaluatedProperty;
|
|
96
|
-
message = `${message} \`${property}\``;
|
|
97
|
-
error.instancePath += '/' + escapePointerFragment(property);
|
|
98
|
-
}
|
|
99
|
-
return {
|
|
100
|
-
...error,
|
|
101
|
-
message,
|
|
102
|
-
suggest,
|
|
103
|
-
};
|
|
104
|
-
}
|
|
105
|
-
}
|
|
106
|
-
//# sourceMappingURL=ajv.js.map
|
package/.output/server/node_modules/@redocly/openapi-core/lib/rules/arazzo/criteria-unique.js
DELETED
|
@@ -1,68 +0,0 @@
|
|
|
1
|
-
export const CriteriaUnique = () => {
|
|
2
|
-
return {
|
|
3
|
-
FailureActionObject: {
|
|
4
|
-
enter(action, { report, location }) {
|
|
5
|
-
const criterias = action?.criteria;
|
|
6
|
-
if (!Array.isArray(criterias)) {
|
|
7
|
-
return;
|
|
8
|
-
}
|
|
9
|
-
const seen = new Set();
|
|
10
|
-
for (const criteria of criterias) {
|
|
11
|
-
const key = JSON.stringify(criteria);
|
|
12
|
-
if (seen.has(key)) {
|
|
13
|
-
report({
|
|
14
|
-
message: 'The FailureAction criteria items must be unique.',
|
|
15
|
-
location: location.child(['criteria', criterias.indexOf(criteria)]),
|
|
16
|
-
});
|
|
17
|
-
}
|
|
18
|
-
else {
|
|
19
|
-
seen.add(key);
|
|
20
|
-
}
|
|
21
|
-
}
|
|
22
|
-
},
|
|
23
|
-
},
|
|
24
|
-
SuccessActionObject: {
|
|
25
|
-
enter(action, { report, location }) {
|
|
26
|
-
const criterias = action?.criteria;
|
|
27
|
-
if (!Array.isArray(criterias)) {
|
|
28
|
-
return;
|
|
29
|
-
}
|
|
30
|
-
const seen = new Set();
|
|
31
|
-
for (const criteria of criterias) {
|
|
32
|
-
const key = JSON.stringify(criteria);
|
|
33
|
-
if (seen.has(key)) {
|
|
34
|
-
report({
|
|
35
|
-
message: 'The SuccessAction criteria items must be unique.',
|
|
36
|
-
location: location.child(['criteria', criterias.indexOf(criteria)]),
|
|
37
|
-
});
|
|
38
|
-
}
|
|
39
|
-
else {
|
|
40
|
-
seen.add(key);
|
|
41
|
-
}
|
|
42
|
-
}
|
|
43
|
-
},
|
|
44
|
-
},
|
|
45
|
-
Step: {
|
|
46
|
-
enter(step, { report, location }) {
|
|
47
|
-
const successCriterias = step?.successCriteria;
|
|
48
|
-
if (!Array.isArray(successCriterias)) {
|
|
49
|
-
return;
|
|
50
|
-
}
|
|
51
|
-
const seen = new Set();
|
|
52
|
-
for (const criteria of successCriterias) {
|
|
53
|
-
const key = JSON.stringify(criteria);
|
|
54
|
-
if (seen.has(key)) {
|
|
55
|
-
report({
|
|
56
|
-
message: 'The Step SuccessCriteria items must be unique.',
|
|
57
|
-
location: location.child(['successCriteria', successCriterias.indexOf(criteria)]),
|
|
58
|
-
});
|
|
59
|
-
}
|
|
60
|
-
else {
|
|
61
|
-
seen.add(key);
|
|
62
|
-
}
|
|
63
|
-
}
|
|
64
|
-
},
|
|
65
|
-
},
|
|
66
|
-
};
|
|
67
|
-
};
|
|
68
|
-
//# sourceMappingURL=criteria-unique.js.map
|
|
@@ -1,52 +0,0 @@
|
|
|
1
|
-
import { Struct } from '../common/struct.js';
|
|
2
|
-
import { Assertions } from '../common/assertions/index.js';
|
|
3
|
-
import { SourceDescriptionType } from '../arazzo/sourceDescription-type.js';
|
|
4
|
-
import { SourceDescriptionsNotEmpty } from './sourceDescriptions-not-empty.js';
|
|
5
|
-
import { RespectSupportedVersions } from '../respect/respect-supported-versions.js';
|
|
6
|
-
import { WorkflowIdUnique } from './workflowId-unique.js';
|
|
7
|
-
import { StepIdUnique } from './stepId-unique.js';
|
|
8
|
-
import { SourceDescriptionsNameUnique } from './sourceDescriptions-name-unique.js';
|
|
9
|
-
import { WorkflowDependsOn } from './workflow-dependsOn.js';
|
|
10
|
-
import { ParametersUnique } from './parameters-unique.js';
|
|
11
|
-
import { StepOnSuccessUnique } from './step-onSuccess-unique.js';
|
|
12
|
-
import { StepOnFailureUnique } from './step-onFailure-unique.js';
|
|
13
|
-
import { RequestBodyReplacementsUnique } from './requestBody-replacements-unique.js';
|
|
14
|
-
import { NoCriteriaXpath } from '../respect/no-criteria-xpath.js';
|
|
15
|
-
import { CriteriaUnique } from './criteria-unique.js';
|
|
16
|
-
import { NoXSecuritySchemeNameWithoutOpenAPI } from '../respect/no-x-security-scheme-name-without-openapi.js';
|
|
17
|
-
import { XSecuritySchemaRequiredValues } from '../respect/x-security-scheme-required-values.js';
|
|
18
|
-
import { NoUnresolvedRefs } from '../common/no-unresolved-refs.js';
|
|
19
|
-
import { NoRequiredSchemaPropertiesUndefined } from '../common/no-required-schema-properties-undefined.js';
|
|
20
|
-
import { NoEnumTypeMismatch } from '../common/no-enum-type-mismatch.js';
|
|
21
|
-
import { NoSchemaTypeMismatch } from '../common/no-schema-type-mismatch.js';
|
|
22
|
-
import { NoXSecurityBothSchemeAndSchemeName } from '../respect/no-x-security-both-scheme-and-scheme-name.js';
|
|
23
|
-
import { XSecuritySchemeNameReference } from '../respect/x-security-scheme-name-reference.js';
|
|
24
|
-
import { OutputsDefined } from './outputs-defined.js';
|
|
25
|
-
export const rules = {
|
|
26
|
-
assertions: Assertions,
|
|
27
|
-
'criteria-unique': CriteriaUnique,
|
|
28
|
-
'no-criteria-xpath': NoCriteriaXpath,
|
|
29
|
-
'no-enum-type-mismatch': NoEnumTypeMismatch,
|
|
30
|
-
'no-required-schema-properties-undefined': NoRequiredSchemaPropertiesUndefined,
|
|
31
|
-
'no-schema-type-mismatch': NoSchemaTypeMismatch,
|
|
32
|
-
'no-unresolved-refs': NoUnresolvedRefs,
|
|
33
|
-
'no-x-security-both-scheme-and-scheme-name': NoXSecurityBothSchemeAndSchemeName,
|
|
34
|
-
'no-x-security-scheme-name-without-openapi': NoXSecuritySchemeNameWithoutOpenAPI,
|
|
35
|
-
'outputs-defined': OutputsDefined,
|
|
36
|
-
'parameters-unique': ParametersUnique,
|
|
37
|
-
'requestBody-replacements-unique': RequestBodyReplacementsUnique,
|
|
38
|
-
'respect-supported-versions': RespectSupportedVersions,
|
|
39
|
-
'sourceDescription-name-unique': SourceDescriptionsNameUnique,
|
|
40
|
-
'sourceDescription-type': SourceDescriptionType,
|
|
41
|
-
'sourceDescriptions-not-empty': SourceDescriptionsNotEmpty,
|
|
42
|
-
'step-onFailure-unique': StepOnFailureUnique,
|
|
43
|
-
'step-onSuccess-unique': StepOnSuccessUnique,
|
|
44
|
-
'stepId-unique': StepIdUnique,
|
|
45
|
-
struct: Struct,
|
|
46
|
-
'workflow-dependsOn': WorkflowDependsOn,
|
|
47
|
-
'workflowId-unique': WorkflowIdUnique,
|
|
48
|
-
'x-security-scheme-name-reference': XSecuritySchemeNameReference,
|
|
49
|
-
'x-security-scheme-required-values': XSecuritySchemaRequiredValues,
|
|
50
|
-
};
|
|
51
|
-
export const preprocessors = {};
|
|
52
|
-
//# sourceMappingURL=index.js.map
|
package/.output/server/node_modules/@redocly/openapi-core/lib/rules/arazzo/outputs-defined.js
DELETED
|
@@ -1,139 +0,0 @@
|
|
|
1
|
-
import { isPlainObject } from '../../utils/is-plain-object.js';
|
|
2
|
-
export const OutputsDefined = () => {
|
|
3
|
-
const definedWorkflowOutputs = new Map();
|
|
4
|
-
const definedStepOutputs = new Map();
|
|
5
|
-
// Store validation tasks to run after all outputs are collected
|
|
6
|
-
const deferredValidationTasks = [];
|
|
7
|
-
// Match $workflows.{id}.outputs.{key} pattern
|
|
8
|
-
function matchWorkflowOutput({ value, report, location, path, definedWorkflowOutputs, }) {
|
|
9
|
-
const workflowOutputPattern = /\$workflows\.([^.\s]+)\.outputs\.([^.\s}\]#]+)/g;
|
|
10
|
-
let match;
|
|
11
|
-
while ((match = workflowOutputPattern.exec(value)) !== null) {
|
|
12
|
-
const [fullMatch, workflowId, outputKey] = match;
|
|
13
|
-
const definedKeys = definedWorkflowOutputs.get(workflowId);
|
|
14
|
-
if (!definedKeys) {
|
|
15
|
-
report({
|
|
16
|
-
message: `Workflow "${workflowId}" referenced in runtime expression "${fullMatch}" is not defined or has no outputs.`,
|
|
17
|
-
location: location.child(path),
|
|
18
|
-
});
|
|
19
|
-
}
|
|
20
|
-
else if (!definedKeys.includes(outputKey)) {
|
|
21
|
-
report({
|
|
22
|
-
message: `Output key "${outputKey}" is not defined in workflow "${workflowId}". Available outputs: [ ${definedKeys.join(', ')} ].`,
|
|
23
|
-
location: location.child(path),
|
|
24
|
-
});
|
|
25
|
-
}
|
|
26
|
-
}
|
|
27
|
-
}
|
|
28
|
-
// Match $steps.{id}.outputs.{key} pattern
|
|
29
|
-
function matchStepOutput({ value, report, location, path, definedStepOutputs, }) {
|
|
30
|
-
const stepOutputPattern = /\$steps\.([^.\s]+)\.outputs\.([^.\s}\]#]+)/g;
|
|
31
|
-
let match;
|
|
32
|
-
while ((match = stepOutputPattern.exec(value)) !== null) {
|
|
33
|
-
const [fullMatch, stepId, outputKey] = match;
|
|
34
|
-
const definedKeys = definedStepOutputs.get(stepId);
|
|
35
|
-
if (!definedKeys) {
|
|
36
|
-
report({
|
|
37
|
-
message: `Step "${stepId}" referenced in runtime expression "${fullMatch}" is not defined or has no outputs.`,
|
|
38
|
-
location: location.child(path),
|
|
39
|
-
});
|
|
40
|
-
}
|
|
41
|
-
else if (!definedKeys.includes(outputKey)) {
|
|
42
|
-
report({
|
|
43
|
-
message: `Output key "${outputKey}" is not defined in step "${stepId}". Available outputs: [ ${definedKeys.join(', ')} ].`,
|
|
44
|
-
location: location.child(path),
|
|
45
|
-
});
|
|
46
|
-
}
|
|
47
|
-
}
|
|
48
|
-
}
|
|
49
|
-
function checkRuntimeExpressions(value, ctx, path = []) {
|
|
50
|
-
if (typeof value === 'string') {
|
|
51
|
-
matchWorkflowOutput({
|
|
52
|
-
value,
|
|
53
|
-
report: ctx.report,
|
|
54
|
-
location: ctx.location,
|
|
55
|
-
path,
|
|
56
|
-
definedWorkflowOutputs,
|
|
57
|
-
});
|
|
58
|
-
matchStepOutput({
|
|
59
|
-
value,
|
|
60
|
-
report: ctx.report,
|
|
61
|
-
location: ctx.location,
|
|
62
|
-
path,
|
|
63
|
-
definedStepOutputs,
|
|
64
|
-
});
|
|
65
|
-
}
|
|
66
|
-
else if (isPlainObject(value) || Array.isArray(value)) {
|
|
67
|
-
for (const [key, val] of Object.entries(value)) {
|
|
68
|
-
checkRuntimeExpressions(val, ctx, [...path, key]);
|
|
69
|
-
}
|
|
70
|
-
}
|
|
71
|
-
}
|
|
72
|
-
return {
|
|
73
|
-
Step: {
|
|
74
|
-
enter(step, { report: _report, location: _location }) {
|
|
75
|
-
if (!step.outputs)
|
|
76
|
-
return;
|
|
77
|
-
definedStepOutputs.set(step.stepId, Object.keys(step.outputs));
|
|
78
|
-
},
|
|
79
|
-
},
|
|
80
|
-
Workflow: {
|
|
81
|
-
enter(workflow, { report: _report, location: _location }) {
|
|
82
|
-
if (!workflow.outputs)
|
|
83
|
-
return;
|
|
84
|
-
definedWorkflowOutputs.set(workflow.workflowId, Object.keys(workflow.outputs));
|
|
85
|
-
},
|
|
86
|
-
},
|
|
87
|
-
Parameters: {
|
|
88
|
-
enter(parameters, ctx) {
|
|
89
|
-
deferredValidationTasks.push(() => {
|
|
90
|
-
checkRuntimeExpressions(parameters, ctx);
|
|
91
|
-
});
|
|
92
|
-
},
|
|
93
|
-
},
|
|
94
|
-
RequestBody: {
|
|
95
|
-
enter(requestBody, ctx) {
|
|
96
|
-
deferredValidationTasks.push(() => {
|
|
97
|
-
checkRuntimeExpressions(requestBody, ctx);
|
|
98
|
-
});
|
|
99
|
-
},
|
|
100
|
-
},
|
|
101
|
-
CriterionObject: {
|
|
102
|
-
enter(criteria, ctx) {
|
|
103
|
-
deferredValidationTasks.push(() => {
|
|
104
|
-
checkRuntimeExpressions(criteria.condition, ctx);
|
|
105
|
-
});
|
|
106
|
-
},
|
|
107
|
-
},
|
|
108
|
-
Outputs: {
|
|
109
|
-
enter(outputs, ctx) {
|
|
110
|
-
deferredValidationTasks.push(() => {
|
|
111
|
-
checkRuntimeExpressions(outputs, ctx);
|
|
112
|
-
});
|
|
113
|
-
},
|
|
114
|
-
},
|
|
115
|
-
ExtendedSecurity: {
|
|
116
|
-
enter(extendedSecurity, ctx) {
|
|
117
|
-
deferredValidationTasks.push(() => {
|
|
118
|
-
checkRuntimeExpressions(extendedSecurity, ctx);
|
|
119
|
-
});
|
|
120
|
-
},
|
|
121
|
-
},
|
|
122
|
-
ExtendedOperation: {
|
|
123
|
-
enter(extendedOperation, ctx) {
|
|
124
|
-
deferredValidationTasks.push(() => {
|
|
125
|
-
checkRuntimeExpressions(extendedOperation, ctx);
|
|
126
|
-
});
|
|
127
|
-
},
|
|
128
|
-
},
|
|
129
|
-
Root: {
|
|
130
|
-
leave() {
|
|
131
|
-
// Run all deferred validations after all outputs are collected
|
|
132
|
-
for (const task of deferredValidationTasks) {
|
|
133
|
-
task();
|
|
134
|
-
}
|
|
135
|
-
},
|
|
136
|
-
},
|
|
137
|
-
};
|
|
138
|
-
};
|
|
139
|
-
//# sourceMappingURL=outputs-defined.js.map
|