@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,143 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.ValueScope = exports.ValueScopeName = exports.Scope = exports.varKinds = exports.UsedValueState = void 0;
|
|
4
|
-
const code_1 = require("./code");
|
|
5
|
-
class ValueError extends Error {
|
|
6
|
-
constructor(name) {
|
|
7
|
-
super(`CodeGen: "code" for ${name} not defined`);
|
|
8
|
-
this.value = name.value;
|
|
9
|
-
}
|
|
10
|
-
}
|
|
11
|
-
var UsedValueState;
|
|
12
|
-
(function (UsedValueState) {
|
|
13
|
-
UsedValueState[UsedValueState["Started"] = 0] = "Started";
|
|
14
|
-
UsedValueState[UsedValueState["Completed"] = 1] = "Completed";
|
|
15
|
-
})(UsedValueState || (exports.UsedValueState = UsedValueState = {}));
|
|
16
|
-
exports.varKinds = {
|
|
17
|
-
const: new code_1.Name("const"),
|
|
18
|
-
let: new code_1.Name("let"),
|
|
19
|
-
var: new code_1.Name("var"),
|
|
20
|
-
};
|
|
21
|
-
class Scope {
|
|
22
|
-
constructor({ prefixes, parent } = {}) {
|
|
23
|
-
this._names = {};
|
|
24
|
-
this._prefixes = prefixes;
|
|
25
|
-
this._parent = parent;
|
|
26
|
-
}
|
|
27
|
-
toName(nameOrPrefix) {
|
|
28
|
-
return nameOrPrefix instanceof code_1.Name ? nameOrPrefix : this.name(nameOrPrefix);
|
|
29
|
-
}
|
|
30
|
-
name(prefix) {
|
|
31
|
-
return new code_1.Name(this._newName(prefix));
|
|
32
|
-
}
|
|
33
|
-
_newName(prefix) {
|
|
34
|
-
const ng = this._names[prefix] || this._nameGroup(prefix);
|
|
35
|
-
return `${prefix}${ng.index++}`;
|
|
36
|
-
}
|
|
37
|
-
_nameGroup(prefix) {
|
|
38
|
-
var _a, _b;
|
|
39
|
-
if (((_b = (_a = this._parent) === null || _a === void 0 ? void 0 : _a._prefixes) === null || _b === void 0 ? void 0 : _b.has(prefix)) || (this._prefixes && !this._prefixes.has(prefix))) {
|
|
40
|
-
throw new Error(`CodeGen: prefix "${prefix}" is not allowed in this scope`);
|
|
41
|
-
}
|
|
42
|
-
return (this._names[prefix] = { prefix, index: 0 });
|
|
43
|
-
}
|
|
44
|
-
}
|
|
45
|
-
exports.Scope = Scope;
|
|
46
|
-
class ValueScopeName extends code_1.Name {
|
|
47
|
-
constructor(prefix, nameStr) {
|
|
48
|
-
super(nameStr);
|
|
49
|
-
this.prefix = prefix;
|
|
50
|
-
}
|
|
51
|
-
setValue(value, { property, itemIndex }) {
|
|
52
|
-
this.value = value;
|
|
53
|
-
this.scopePath = (0, code_1._) `.${new code_1.Name(property)}[${itemIndex}]`;
|
|
54
|
-
}
|
|
55
|
-
}
|
|
56
|
-
exports.ValueScopeName = ValueScopeName;
|
|
57
|
-
const line = (0, code_1._) `\n`;
|
|
58
|
-
class ValueScope extends Scope {
|
|
59
|
-
constructor(opts) {
|
|
60
|
-
super(opts);
|
|
61
|
-
this._values = {};
|
|
62
|
-
this._scope = opts.scope;
|
|
63
|
-
this.opts = { ...opts, _n: opts.lines ? line : code_1.nil };
|
|
64
|
-
}
|
|
65
|
-
get() {
|
|
66
|
-
return this._scope;
|
|
67
|
-
}
|
|
68
|
-
name(prefix) {
|
|
69
|
-
return new ValueScopeName(prefix, this._newName(prefix));
|
|
70
|
-
}
|
|
71
|
-
value(nameOrPrefix, value) {
|
|
72
|
-
var _a;
|
|
73
|
-
if (value.ref === undefined)
|
|
74
|
-
throw new Error("CodeGen: ref must be passed in value");
|
|
75
|
-
const name = this.toName(nameOrPrefix);
|
|
76
|
-
const { prefix } = name;
|
|
77
|
-
const valueKey = (_a = value.key) !== null && _a !== void 0 ? _a : value.ref;
|
|
78
|
-
let vs = this._values[prefix];
|
|
79
|
-
if (vs) {
|
|
80
|
-
const _name = vs.get(valueKey);
|
|
81
|
-
if (_name)
|
|
82
|
-
return _name;
|
|
83
|
-
}
|
|
84
|
-
else {
|
|
85
|
-
vs = this._values[prefix] = new Map();
|
|
86
|
-
}
|
|
87
|
-
vs.set(valueKey, name);
|
|
88
|
-
const s = this._scope[prefix] || (this._scope[prefix] = []);
|
|
89
|
-
const itemIndex = s.length;
|
|
90
|
-
s[itemIndex] = value.ref;
|
|
91
|
-
name.setValue(value, { property: prefix, itemIndex });
|
|
92
|
-
return name;
|
|
93
|
-
}
|
|
94
|
-
getValue(prefix, keyOrRef) {
|
|
95
|
-
const vs = this._values[prefix];
|
|
96
|
-
if (!vs)
|
|
97
|
-
return;
|
|
98
|
-
return vs.get(keyOrRef);
|
|
99
|
-
}
|
|
100
|
-
scopeRefs(scopeName, values = this._values) {
|
|
101
|
-
return this._reduceValues(values, (name) => {
|
|
102
|
-
if (name.scopePath === undefined)
|
|
103
|
-
throw new Error(`CodeGen: name "${name}" has no value`);
|
|
104
|
-
return (0, code_1._) `${scopeName}${name.scopePath}`;
|
|
105
|
-
});
|
|
106
|
-
}
|
|
107
|
-
scopeCode(values = this._values, usedValues, getCode) {
|
|
108
|
-
return this._reduceValues(values, (name) => {
|
|
109
|
-
if (name.value === undefined)
|
|
110
|
-
throw new Error(`CodeGen: name "${name}" has no value`);
|
|
111
|
-
return name.value.code;
|
|
112
|
-
}, usedValues, getCode);
|
|
113
|
-
}
|
|
114
|
-
_reduceValues(values, valueCode, usedValues = {}, getCode) {
|
|
115
|
-
let code = code_1.nil;
|
|
116
|
-
for (const prefix in values) {
|
|
117
|
-
const vs = values[prefix];
|
|
118
|
-
if (!vs)
|
|
119
|
-
continue;
|
|
120
|
-
const nameSet = (usedValues[prefix] = usedValues[prefix] || new Map());
|
|
121
|
-
vs.forEach((name) => {
|
|
122
|
-
if (nameSet.has(name))
|
|
123
|
-
return;
|
|
124
|
-
nameSet.set(name, UsedValueState.Started);
|
|
125
|
-
let c = valueCode(name);
|
|
126
|
-
if (c) {
|
|
127
|
-
const def = this.opts.es5 ? exports.varKinds.var : exports.varKinds.const;
|
|
128
|
-
code = (0, code_1._) `${code}${def} ${name} = ${c};${this.opts._n}`;
|
|
129
|
-
}
|
|
130
|
-
else if ((c = getCode === null || getCode === void 0 ? void 0 : getCode(name))) {
|
|
131
|
-
code = (0, code_1._) `${code}${c}${this.opts._n}`;
|
|
132
|
-
}
|
|
133
|
-
else {
|
|
134
|
-
throw new ValueError(name);
|
|
135
|
-
}
|
|
136
|
-
nameSet.set(name, UsedValueState.Completed);
|
|
137
|
-
});
|
|
138
|
-
}
|
|
139
|
-
return code;
|
|
140
|
-
}
|
|
141
|
-
}
|
|
142
|
-
exports.ValueScope = ValueScope;
|
|
143
|
-
//# sourceMappingURL=scope.js.map
|
|
@@ -1,123 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.extendErrors = exports.resetErrorsCount = exports.reportExtraError = exports.reportError = exports.keyword$DataError = exports.keywordError = void 0;
|
|
4
|
-
const codegen_1 = require("./codegen");
|
|
5
|
-
const util_1 = require("./util");
|
|
6
|
-
const names_1 = require("./names");
|
|
7
|
-
exports.keywordError = {
|
|
8
|
-
message: ({ keyword }) => (0, codegen_1.str) `must pass "${keyword}" keyword validation`,
|
|
9
|
-
};
|
|
10
|
-
exports.keyword$DataError = {
|
|
11
|
-
message: ({ keyword, schemaType }) => schemaType
|
|
12
|
-
? (0, codegen_1.str) `"${keyword}" keyword must be ${schemaType} ($data)`
|
|
13
|
-
: (0, codegen_1.str) `"${keyword}" keyword is invalid ($data)`,
|
|
14
|
-
};
|
|
15
|
-
function reportError(cxt, error = exports.keywordError, errorPaths, overrideAllErrors) {
|
|
16
|
-
const { it } = cxt;
|
|
17
|
-
const { gen, compositeRule, allErrors } = it;
|
|
18
|
-
const errObj = errorObjectCode(cxt, error, errorPaths);
|
|
19
|
-
if (overrideAllErrors !== null && overrideAllErrors !== void 0 ? overrideAllErrors : (compositeRule || allErrors)) {
|
|
20
|
-
addError(gen, errObj);
|
|
21
|
-
}
|
|
22
|
-
else {
|
|
23
|
-
returnErrors(it, (0, codegen_1._) `[${errObj}]`);
|
|
24
|
-
}
|
|
25
|
-
}
|
|
26
|
-
exports.reportError = reportError;
|
|
27
|
-
function reportExtraError(cxt, error = exports.keywordError, errorPaths) {
|
|
28
|
-
const { it } = cxt;
|
|
29
|
-
const { gen, compositeRule, allErrors } = it;
|
|
30
|
-
const errObj = errorObjectCode(cxt, error, errorPaths);
|
|
31
|
-
addError(gen, errObj);
|
|
32
|
-
if (!(compositeRule || allErrors)) {
|
|
33
|
-
returnErrors(it, names_1.default.vErrors);
|
|
34
|
-
}
|
|
35
|
-
}
|
|
36
|
-
exports.reportExtraError = reportExtraError;
|
|
37
|
-
function resetErrorsCount(gen, errsCount) {
|
|
38
|
-
gen.assign(names_1.default.errors, errsCount);
|
|
39
|
-
gen.if((0, codegen_1._) `${names_1.default.vErrors} !== null`, () => gen.if(errsCount, () => gen.assign((0, codegen_1._) `${names_1.default.vErrors}.length`, errsCount), () => gen.assign(names_1.default.vErrors, null)));
|
|
40
|
-
}
|
|
41
|
-
exports.resetErrorsCount = resetErrorsCount;
|
|
42
|
-
function extendErrors({ gen, keyword, schemaValue, data, errsCount, it, }) {
|
|
43
|
-
/* istanbul ignore if */
|
|
44
|
-
if (errsCount === undefined)
|
|
45
|
-
throw new Error("ajv implementation error");
|
|
46
|
-
const err = gen.name("err");
|
|
47
|
-
gen.forRange("i", errsCount, names_1.default.errors, (i) => {
|
|
48
|
-
gen.const(err, (0, codegen_1._) `${names_1.default.vErrors}[${i}]`);
|
|
49
|
-
gen.if((0, codegen_1._) `${err}.instancePath === undefined`, () => gen.assign((0, codegen_1._) `${err}.instancePath`, (0, codegen_1.strConcat)(names_1.default.instancePath, it.errorPath)));
|
|
50
|
-
gen.assign((0, codegen_1._) `${err}.schemaPath`, (0, codegen_1.str) `${it.errSchemaPath}/${keyword}`);
|
|
51
|
-
if (it.opts.verbose) {
|
|
52
|
-
gen.assign((0, codegen_1._) `${err}.schema`, schemaValue);
|
|
53
|
-
gen.assign((0, codegen_1._) `${err}.data`, data);
|
|
54
|
-
}
|
|
55
|
-
});
|
|
56
|
-
}
|
|
57
|
-
exports.extendErrors = extendErrors;
|
|
58
|
-
function addError(gen, errObj) {
|
|
59
|
-
const err = gen.const("err", errObj);
|
|
60
|
-
gen.if((0, codegen_1._) `${names_1.default.vErrors} === null`, () => gen.assign(names_1.default.vErrors, (0, codegen_1._) `[${err}]`), (0, codegen_1._) `${names_1.default.vErrors}.push(${err})`);
|
|
61
|
-
gen.code((0, codegen_1._) `${names_1.default.errors}++`);
|
|
62
|
-
}
|
|
63
|
-
function returnErrors(it, errs) {
|
|
64
|
-
const { gen, validateName, schemaEnv } = it;
|
|
65
|
-
if (schemaEnv.$async) {
|
|
66
|
-
gen.throw((0, codegen_1._) `new ${it.ValidationError}(${errs})`);
|
|
67
|
-
}
|
|
68
|
-
else {
|
|
69
|
-
gen.assign((0, codegen_1._) `${validateName}.errors`, errs);
|
|
70
|
-
gen.return(false);
|
|
71
|
-
}
|
|
72
|
-
}
|
|
73
|
-
const E = {
|
|
74
|
-
keyword: new codegen_1.Name("keyword"),
|
|
75
|
-
schemaPath: new codegen_1.Name("schemaPath"), // also used in JTD errors
|
|
76
|
-
params: new codegen_1.Name("params"),
|
|
77
|
-
propertyName: new codegen_1.Name("propertyName"),
|
|
78
|
-
message: new codegen_1.Name("message"),
|
|
79
|
-
schema: new codegen_1.Name("schema"),
|
|
80
|
-
parentSchema: new codegen_1.Name("parentSchema"),
|
|
81
|
-
};
|
|
82
|
-
function errorObjectCode(cxt, error, errorPaths) {
|
|
83
|
-
const { createErrors } = cxt.it;
|
|
84
|
-
if (createErrors === false)
|
|
85
|
-
return (0, codegen_1._) `{}`;
|
|
86
|
-
return errorObject(cxt, error, errorPaths);
|
|
87
|
-
}
|
|
88
|
-
function errorObject(cxt, error, errorPaths = {}) {
|
|
89
|
-
const { gen, it } = cxt;
|
|
90
|
-
const keyValues = [
|
|
91
|
-
errorInstancePath(it, errorPaths),
|
|
92
|
-
errorSchemaPath(cxt, errorPaths),
|
|
93
|
-
];
|
|
94
|
-
extraErrorProps(cxt, error, keyValues);
|
|
95
|
-
return gen.object(...keyValues);
|
|
96
|
-
}
|
|
97
|
-
function errorInstancePath({ errorPath }, { instancePath }) {
|
|
98
|
-
const instPath = instancePath
|
|
99
|
-
? (0, codegen_1.str) `${errorPath}${(0, util_1.getErrorPath)(instancePath, util_1.Type.Str)}`
|
|
100
|
-
: errorPath;
|
|
101
|
-
return [names_1.default.instancePath, (0, codegen_1.strConcat)(names_1.default.instancePath, instPath)];
|
|
102
|
-
}
|
|
103
|
-
function errorSchemaPath({ keyword, it: { errSchemaPath } }, { schemaPath, parentSchema }) {
|
|
104
|
-
let schPath = parentSchema ? errSchemaPath : (0, codegen_1.str) `${errSchemaPath}/${keyword}`;
|
|
105
|
-
if (schemaPath) {
|
|
106
|
-
schPath = (0, codegen_1.str) `${schPath}${(0, util_1.getErrorPath)(schemaPath, util_1.Type.Str)}`;
|
|
107
|
-
}
|
|
108
|
-
return [E.schemaPath, schPath];
|
|
109
|
-
}
|
|
110
|
-
function extraErrorProps(cxt, { params, message }, keyValues) {
|
|
111
|
-
const { keyword, data, schemaValue, it } = cxt;
|
|
112
|
-
const { opts, propertyName, topSchemaRef, schemaPath } = it;
|
|
113
|
-
keyValues.push([E.keyword, keyword], [E.params, typeof params == "function" ? params(cxt) : params || (0, codegen_1._) `{}`]);
|
|
114
|
-
if (opts.messages) {
|
|
115
|
-
keyValues.push([E.message, typeof message == "function" ? message(cxt) : message]);
|
|
116
|
-
}
|
|
117
|
-
if (opts.verbose) {
|
|
118
|
-
keyValues.push([E.schema, schemaValue], [E.parentSchema, (0, codegen_1._) `${topSchemaRef}${schemaPath}`], [names_1.default.data, data]);
|
|
119
|
-
}
|
|
120
|
-
if (propertyName)
|
|
121
|
-
keyValues.push([E.propertyName, propertyName]);
|
|
122
|
-
}
|
|
123
|
-
//# sourceMappingURL=errors.js.map
|
|
@@ -1,249 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.resolveSchema = exports.getCompilingSchema = exports.resolveRef = exports.compileSchema = exports.SchemaEnv = void 0;
|
|
4
|
-
const codegen_1 = require("./codegen");
|
|
5
|
-
const validation_error_1 = require("../runtime/validation_error");
|
|
6
|
-
const names_1 = require("./names");
|
|
7
|
-
const resolve_1 = require("./resolve");
|
|
8
|
-
const util_1 = require("./util");
|
|
9
|
-
const validate_1 = require("./validate");
|
|
10
|
-
class SchemaEnv {
|
|
11
|
-
constructor(env) {
|
|
12
|
-
var _a;
|
|
13
|
-
this.refs = {};
|
|
14
|
-
this.dynamicAnchors = {};
|
|
15
|
-
let schema;
|
|
16
|
-
if (typeof env.schema == "object")
|
|
17
|
-
schema = env.schema;
|
|
18
|
-
this.schema = env.schema;
|
|
19
|
-
this.schemaId = env.schemaId;
|
|
20
|
-
this.root = env.root || this;
|
|
21
|
-
this.baseId = (_a = env.baseId) !== null && _a !== void 0 ? _a : (0, resolve_1.normalizeId)(schema === null || schema === void 0 ? void 0 : schema[env.schemaId || "$id"]);
|
|
22
|
-
this.schemaPath = env.schemaPath;
|
|
23
|
-
this.localRefs = env.localRefs;
|
|
24
|
-
this.meta = env.meta;
|
|
25
|
-
this.$async = schema === null || schema === void 0 ? void 0 : schema.$async;
|
|
26
|
-
this.refs = {};
|
|
27
|
-
}
|
|
28
|
-
}
|
|
29
|
-
exports.SchemaEnv = SchemaEnv;
|
|
30
|
-
// let codeSize = 0
|
|
31
|
-
// let nodeCount = 0
|
|
32
|
-
// Compiles schema in SchemaEnv
|
|
33
|
-
function compileSchema(sch) {
|
|
34
|
-
// TODO refactor - remove compilations
|
|
35
|
-
const _sch = getCompilingSchema.call(this, sch);
|
|
36
|
-
if (_sch)
|
|
37
|
-
return _sch;
|
|
38
|
-
const rootId = (0, resolve_1.getFullPath)(this.opts.uriResolver, sch.root.baseId); // TODO if getFullPath removed 1 tests fails
|
|
39
|
-
const { es5, lines } = this.opts.code;
|
|
40
|
-
const { ownProperties } = this.opts;
|
|
41
|
-
const gen = new codegen_1.CodeGen(this.scope, { es5, lines, ownProperties });
|
|
42
|
-
let _ValidationError;
|
|
43
|
-
if (sch.$async) {
|
|
44
|
-
_ValidationError = gen.scopeValue("Error", {
|
|
45
|
-
ref: validation_error_1.default,
|
|
46
|
-
code: (0, codegen_1._) `require("ajv/dist/runtime/validation_error").default`,
|
|
47
|
-
});
|
|
48
|
-
}
|
|
49
|
-
const validateName = gen.scopeName("validate");
|
|
50
|
-
sch.validateName = validateName;
|
|
51
|
-
const schemaCxt = {
|
|
52
|
-
gen,
|
|
53
|
-
allErrors: this.opts.allErrors,
|
|
54
|
-
data: names_1.default.data,
|
|
55
|
-
parentData: names_1.default.parentData,
|
|
56
|
-
parentDataProperty: names_1.default.parentDataProperty,
|
|
57
|
-
dataNames: [names_1.default.data],
|
|
58
|
-
dataPathArr: [codegen_1.nil], // TODO can its length be used as dataLevel if nil is removed?
|
|
59
|
-
dataLevel: 0,
|
|
60
|
-
dataTypes: [],
|
|
61
|
-
definedProperties: new Set(),
|
|
62
|
-
topSchemaRef: gen.scopeValue("schema", this.opts.code.source === true
|
|
63
|
-
? { ref: sch.schema, code: (0, codegen_1.stringify)(sch.schema) }
|
|
64
|
-
: { ref: sch.schema }),
|
|
65
|
-
validateName,
|
|
66
|
-
ValidationError: _ValidationError,
|
|
67
|
-
schema: sch.schema,
|
|
68
|
-
schemaEnv: sch,
|
|
69
|
-
rootId,
|
|
70
|
-
baseId: sch.baseId || rootId,
|
|
71
|
-
schemaPath: codegen_1.nil,
|
|
72
|
-
errSchemaPath: sch.schemaPath || (this.opts.jtd ? "" : "#"),
|
|
73
|
-
errorPath: (0, codegen_1._) `""`,
|
|
74
|
-
opts: this.opts,
|
|
75
|
-
self: this,
|
|
76
|
-
};
|
|
77
|
-
let sourceCode;
|
|
78
|
-
try {
|
|
79
|
-
this._compilations.add(sch);
|
|
80
|
-
(0, validate_1.validateFunctionCode)(schemaCxt);
|
|
81
|
-
gen.optimize(this.opts.code.optimize);
|
|
82
|
-
// gen.optimize(1)
|
|
83
|
-
const validateCode = gen.toString();
|
|
84
|
-
sourceCode = `const visitedNodesForRef = new WeakMap(); ${gen.scopeRefs(names_1.default.scope)}return ${validateCode}`;
|
|
85
|
-
// console.log((codeSize += sourceCode.length), (nodeCount += gen.nodeCount))
|
|
86
|
-
if (this.opts.code.process)
|
|
87
|
-
sourceCode = this.opts.code.process(sourceCode, sch);
|
|
88
|
-
// console.log("\n\n\n *** \n", sourceCode)
|
|
89
|
-
const makeValidate = new Function(`${names_1.default.self}`, `${names_1.default.scope}`, sourceCode);
|
|
90
|
-
const validate = makeValidate(this, this.scope.get());
|
|
91
|
-
this.scope.value(validateName, { ref: validate });
|
|
92
|
-
validate.errors = null;
|
|
93
|
-
validate.schema = sch.schema;
|
|
94
|
-
validate.schemaEnv = sch;
|
|
95
|
-
if (sch.$async)
|
|
96
|
-
validate.$async = true;
|
|
97
|
-
if (this.opts.code.source === true) {
|
|
98
|
-
validate.source = { validateName, validateCode, scopeValues: gen._values };
|
|
99
|
-
}
|
|
100
|
-
if (this.opts.unevaluated) {
|
|
101
|
-
const { props, items } = schemaCxt;
|
|
102
|
-
validate.evaluated = {
|
|
103
|
-
props: props instanceof codegen_1.Name ? undefined : props,
|
|
104
|
-
items: items instanceof codegen_1.Name ? undefined : items,
|
|
105
|
-
dynamicProps: props instanceof codegen_1.Name,
|
|
106
|
-
dynamicItems: items instanceof codegen_1.Name,
|
|
107
|
-
};
|
|
108
|
-
if (validate.source)
|
|
109
|
-
validate.source.evaluated = (0, codegen_1.stringify)(validate.evaluated);
|
|
110
|
-
}
|
|
111
|
-
sch.validate = validate;
|
|
112
|
-
return sch;
|
|
113
|
-
}
|
|
114
|
-
catch (e) {
|
|
115
|
-
delete sch.validate;
|
|
116
|
-
delete sch.validateName;
|
|
117
|
-
if (sourceCode)
|
|
118
|
-
this.logger.error("Error compiling schema, function code:", sourceCode);
|
|
119
|
-
// console.log("\n\n\n *** \n", sourceCode, this.opts)
|
|
120
|
-
throw e;
|
|
121
|
-
}
|
|
122
|
-
finally {
|
|
123
|
-
this._compilations.delete(sch);
|
|
124
|
-
}
|
|
125
|
-
}
|
|
126
|
-
exports.compileSchema = compileSchema;
|
|
127
|
-
function resolveRef(root, baseId, origRef) {
|
|
128
|
-
var _a;
|
|
129
|
-
const ref = (0, resolve_1.resolveUrl)(this.opts.uriResolver, baseId, origRef);
|
|
130
|
-
const schOrFunc = root.refs[ref];
|
|
131
|
-
if (schOrFunc)
|
|
132
|
-
return schOrFunc;
|
|
133
|
-
let _sch = resolve.call(this, root, ref);
|
|
134
|
-
if (_sch === undefined) {
|
|
135
|
-
const schema = (_a = root.localRefs) === null || _a === void 0 ? void 0 : _a[ref]; // TODO maybe localRefs should hold SchemaEnv
|
|
136
|
-
const { schemaId } = this.opts;
|
|
137
|
-
if (schema)
|
|
138
|
-
_sch = new SchemaEnv({ schema, schemaId, root, baseId });
|
|
139
|
-
}
|
|
140
|
-
if (_sch === undefined && this.opts.loadSchemaSync) {
|
|
141
|
-
const remoteSchema = this.opts.loadSchemaSync(baseId, origRef, ref);
|
|
142
|
-
if (remoteSchema && !(this.refs[ref] || this.schemas[ref])) {
|
|
143
|
-
this.addSchema(remoteSchema, ref, undefined);
|
|
144
|
-
_sch = resolve.call(this, root, ref);
|
|
145
|
-
}
|
|
146
|
-
}
|
|
147
|
-
if (_sch === undefined)
|
|
148
|
-
return;
|
|
149
|
-
return (root.refs[ref] = inlineOrCompile.call(this, _sch));
|
|
150
|
-
}
|
|
151
|
-
exports.resolveRef = resolveRef;
|
|
152
|
-
function inlineOrCompile(sch) {
|
|
153
|
-
if ((0, resolve_1.inlineRef)(sch.schema, this.opts.inlineRefs))
|
|
154
|
-
return sch.schema;
|
|
155
|
-
return sch.validate ? sch : compileSchema.call(this, sch);
|
|
156
|
-
}
|
|
157
|
-
// Index of schema compilation in the currently compiled list
|
|
158
|
-
function getCompilingSchema(schEnv) {
|
|
159
|
-
for (const sch of this._compilations) {
|
|
160
|
-
if (sameSchemaEnv(sch, schEnv))
|
|
161
|
-
return sch;
|
|
162
|
-
}
|
|
163
|
-
}
|
|
164
|
-
exports.getCompilingSchema = getCompilingSchema;
|
|
165
|
-
function sameSchemaEnv(s1, s2) {
|
|
166
|
-
return s1.schema === s2.schema && s1.root === s2.root && s1.baseId === s2.baseId;
|
|
167
|
-
}
|
|
168
|
-
// resolve and compile the references ($ref)
|
|
169
|
-
// TODO returns AnySchemaObject (if the schema can be inlined) or validation function
|
|
170
|
-
function resolve(root, // information about the root schema for the current schema
|
|
171
|
-
ref // reference to resolve
|
|
172
|
-
) {
|
|
173
|
-
let sch;
|
|
174
|
-
while (typeof (sch = this.refs[ref]) == "string")
|
|
175
|
-
ref = sch;
|
|
176
|
-
return sch || this.schemas[ref] || resolveSchema.call(this, root, ref);
|
|
177
|
-
}
|
|
178
|
-
// Resolve schema, its root and baseId
|
|
179
|
-
function resolveSchema(root, // root object with properties schema, refs TODO below SchemaEnv is assigned to it
|
|
180
|
-
ref // reference to resolve
|
|
181
|
-
) {
|
|
182
|
-
const p = this.opts.uriResolver.parse(ref);
|
|
183
|
-
const refPath = (0, resolve_1._getFullPath)(this.opts.uriResolver, p);
|
|
184
|
-
let baseId = (0, resolve_1.getFullPath)(this.opts.uriResolver, root.baseId, undefined);
|
|
185
|
-
// TODO `Object.keys(root.schema).length > 0` should not be needed - but removing breaks 2 tests
|
|
186
|
-
if (Object.keys(root.schema).length > 0 && refPath === baseId) {
|
|
187
|
-
return getJsonPointer.call(this, p, root);
|
|
188
|
-
}
|
|
189
|
-
const id = (0, resolve_1.normalizeId)(refPath);
|
|
190
|
-
const schOrRef = this.refs[id] || this.schemas[id];
|
|
191
|
-
if (typeof schOrRef == "string") {
|
|
192
|
-
const sch = resolveSchema.call(this, root, schOrRef);
|
|
193
|
-
if (typeof (sch === null || sch === void 0 ? void 0 : sch.schema) !== "object")
|
|
194
|
-
return;
|
|
195
|
-
return getJsonPointer.call(this, p, sch);
|
|
196
|
-
}
|
|
197
|
-
if (typeof (schOrRef === null || schOrRef === void 0 ? void 0 : schOrRef.schema) !== "object")
|
|
198
|
-
return;
|
|
199
|
-
if (!schOrRef.validate)
|
|
200
|
-
compileSchema.call(this, schOrRef);
|
|
201
|
-
if (id === (0, resolve_1.normalizeId)(ref)) {
|
|
202
|
-
const { schema } = schOrRef;
|
|
203
|
-
const { schemaId } = this.opts;
|
|
204
|
-
const schId = schema[schemaId];
|
|
205
|
-
if (schId)
|
|
206
|
-
baseId = (0, resolve_1.resolveUrl)(this.opts.uriResolver, baseId, schId);
|
|
207
|
-
return new SchemaEnv({ schema, schemaId, root, baseId });
|
|
208
|
-
}
|
|
209
|
-
return getJsonPointer.call(this, p, schOrRef);
|
|
210
|
-
}
|
|
211
|
-
exports.resolveSchema = resolveSchema;
|
|
212
|
-
const PREVENT_SCOPE_CHANGE = new Set([
|
|
213
|
-
"properties",
|
|
214
|
-
"patternProperties",
|
|
215
|
-
"enum",
|
|
216
|
-
"dependencies",
|
|
217
|
-
"definitions",
|
|
218
|
-
]);
|
|
219
|
-
function getJsonPointer(parsedRef, { baseId, schema, root }) {
|
|
220
|
-
var _a;
|
|
221
|
-
if (((_a = parsedRef.fragment) === null || _a === void 0 ? void 0 : _a[0]) !== "/")
|
|
222
|
-
return;
|
|
223
|
-
for (const part of parsedRef.fragment.slice(1).split("/")) {
|
|
224
|
-
if (typeof schema === "boolean")
|
|
225
|
-
return;
|
|
226
|
-
const partSchema = schema[(0, util_1.unescapeFragment)(part)];
|
|
227
|
-
if (partSchema === undefined)
|
|
228
|
-
return;
|
|
229
|
-
schema = partSchema;
|
|
230
|
-
// TODO PREVENT_SCOPE_CHANGE could be defined in keyword def?
|
|
231
|
-
const schId = typeof schema === "object" && schema[this.opts.schemaId];
|
|
232
|
-
if (!PREVENT_SCOPE_CHANGE.has(part) && schId) {
|
|
233
|
-
baseId = (0, resolve_1.resolveUrl)(this.opts.uriResolver, baseId, schId);
|
|
234
|
-
}
|
|
235
|
-
}
|
|
236
|
-
let env;
|
|
237
|
-
if (typeof schema != "boolean" && schema.$ref && !(0, util_1.schemaHasRulesButRef)(schema, this.RULES)) {
|
|
238
|
-
const $ref = (0, resolve_1.resolveUrl)(this.opts.uriResolver, baseId, schema.$ref);
|
|
239
|
-
env = resolveSchema.call(this, root, $ref);
|
|
240
|
-
}
|
|
241
|
-
// even though resolution failed we need to return SchemaEnv to throw exception
|
|
242
|
-
// so that compileAsync loads missing schema.
|
|
243
|
-
const { schemaId } = this.opts;
|
|
244
|
-
env = env || new SchemaEnv({ schema, schemaId, root, baseId });
|
|
245
|
-
if (env.schema !== env.root.schema)
|
|
246
|
-
return env;
|
|
247
|
-
return undefined;
|
|
248
|
-
}
|
|
249
|
-
//# sourceMappingURL=index.js.map
|
|
@@ -1,29 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
const codegen_1 = require("./codegen");
|
|
4
|
-
const names = {
|
|
5
|
-
// validation function arguments
|
|
6
|
-
data: new codegen_1.Name("data"), // data passed to validation function
|
|
7
|
-
// args passed from referencing schema
|
|
8
|
-
valCxt: new codegen_1.Name("valCxt"), // validation/data context - should not be used directly, it is destructured to the names below
|
|
9
|
-
instancePath: new codegen_1.Name("instancePath"),
|
|
10
|
-
parentData: new codegen_1.Name("parentData"),
|
|
11
|
-
parentDataProperty: new codegen_1.Name("parentDataProperty"),
|
|
12
|
-
rootData: new codegen_1.Name("rootData"), // root data - same as the data passed to the first/top validation function
|
|
13
|
-
dynamicAnchors: new codegen_1.Name("dynamicAnchors"), // used to support recursiveRef and dynamicRef
|
|
14
|
-
isAllOfVariant: new codegen_1.Name("isAllOfVariant"), // used to check in runtime if the current function (ref) is called from allOf
|
|
15
|
-
// function scoped variables
|
|
16
|
-
vErrors: new codegen_1.Name("vErrors"), // null or array of validation errors
|
|
17
|
-
errors: new codegen_1.Name("errors"), // counter of validation errors
|
|
18
|
-
this: new codegen_1.Name("this"),
|
|
19
|
-
// "globals"
|
|
20
|
-
self: new codegen_1.Name("self"),
|
|
21
|
-
scope: new codegen_1.Name("scope"),
|
|
22
|
-
// JTD serialize/parse name for JSON string and position
|
|
23
|
-
json: new codegen_1.Name("json"),
|
|
24
|
-
jsonPos: new codegen_1.Name("jsonPos"),
|
|
25
|
-
jsonLen: new codegen_1.Name("jsonLen"),
|
|
26
|
-
jsonPart: new codegen_1.Name("jsonPart"),
|
|
27
|
-
};
|
|
28
|
-
exports.default = names;
|
|
29
|
-
//# sourceMappingURL=names.js.map
|
|
@@ -1,12 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
const resolve_1 = require("./resolve");
|
|
4
|
-
class MissingRefError extends Error {
|
|
5
|
-
constructor(resolver, baseId, ref, msg) {
|
|
6
|
-
super(msg || `can't resolve reference ${ref} from id ${baseId}`);
|
|
7
|
-
this.missingRef = (0, resolve_1.resolveUrl)(resolver, baseId, ref);
|
|
8
|
-
this.missingSchema = (0, resolve_1.normalizeId)((0, resolve_1.getFullPath)(resolver, this.missingRef));
|
|
9
|
-
}
|
|
10
|
-
}
|
|
11
|
-
exports.default = MissingRefError;
|
|
12
|
-
//# sourceMappingURL=ref_error.js.map
|