@skmtc/core 0.0.300 → 0.0.302
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/esm/context/CoreContext.d.ts +2 -2
- package/esm/context/CoreContext.d.ts.map +1 -1
- package/esm/context/CoreContext.js +3 -3
- package/esm/context/GenerateContext.d.ts +2 -2
- package/esm/context/GenerateContext.d.ts.map +1 -1
- package/esm/context/ParseContext.d.ts +14 -6
- package/esm/context/ParseContext.d.ts.map +1 -1
- package/esm/context/ParseContext.js +28 -12
- package/esm/context/StackTrail.d.ts +3 -3
- package/esm/context/StackTrail.d.ts.map +1 -1
- package/esm/context/StackTrail.js +9 -1
- package/esm/helpers/tracer.d.ts +7 -0
- package/esm/helpers/tracer.d.ts.map +1 -0
- package/esm/helpers/tracer.js +6 -0
- package/esm/oas/array/Array.d.ts +2 -12
- package/esm/oas/array/Array.d.ts.map +1 -1
- package/esm/oas/array/Array.js +2 -4
- package/esm/oas/array/toArray.d.ts +3 -5
- package/esm/oas/array/toArray.d.ts.map +1 -1
- package/esm/oas/array/toArray.js +5 -7
- package/esm/oas/boolean/Boolean.d.ts +2 -12
- package/esm/oas/boolean/Boolean.d.ts.map +1 -1
- package/esm/oas/boolean/Boolean.js +2 -4
- package/esm/oas/boolean/toBoolean.d.ts +3 -5
- package/esm/oas/boolean/toBoolean.d.ts.map +1 -1
- package/esm/oas/boolean/toBoolean.js +3 -2
- package/esm/oas/components/Components.d.ts +2 -12
- package/esm/oas/components/Components.d.ts.map +1 -1
- package/esm/oas/components/Components.js +2 -4
- package/esm/oas/components/toComponentsV3.d.ts +3 -5
- package/esm/oas/components/toComponentsV3.d.ts.map +1 -1
- package/esm/oas/components/toComponentsV3.js +10 -22
- package/esm/oas/discriminator/Discriminator.d.ts +2 -12
- package/esm/oas/discriminator/Discriminator.d.ts.map +1 -1
- package/esm/oas/discriminator/Discriminator.js +2 -4
- package/esm/oas/discriminator/toDiscriminatorV3.d.ts +3 -5
- package/esm/oas/discriminator/toDiscriminatorV3.d.ts.map +1 -1
- package/esm/oas/discriminator/toDiscriminatorV3.js +3 -2
- package/esm/oas/document/Document.d.ts +3 -12
- package/esm/oas/document/Document.d.ts.map +1 -1
- package/esm/oas/document/Document.js +20 -4
- package/esm/oas/document/toDocumentFieldsV3.d.ts +10 -0
- package/esm/oas/document/toDocumentFieldsV3.d.ts.map +1 -0
- package/esm/oas/document/toDocumentFieldsV3.js +17 -0
- package/esm/oas/example/Example.d.ts +2 -12
- package/esm/oas/example/Example.d.ts.map +1 -1
- package/esm/oas/example/Example.js +2 -4
- package/esm/oas/example/toExamplesV3.d.ts +6 -11
- package/esm/oas/example/toExamplesV3.d.ts.map +1 -1
- package/esm/oas/example/toExamplesV3.js +18 -17
- package/esm/oas/header/Header.d.ts +2 -12
- package/esm/oas/header/Header.d.ts.map +1 -1
- package/esm/oas/header/Header.js +2 -4
- package/esm/oas/header/toHeadersV3.d.ts +3 -5
- package/esm/oas/header/toHeadersV3.d.ts.map +1 -1
- package/esm/oas/header/toHeadersV3.js +9 -12
- package/esm/oas/info/Info.d.ts +2 -12
- package/esm/oas/info/Info.d.ts.map +1 -1
- package/esm/oas/info/Info.js +2 -4
- package/esm/oas/info/toInfoV3.d.ts +3 -5
- package/esm/oas/info/toInfoV3.d.ts.map +1 -1
- package/esm/oas/info/toInfoV3.js +3 -2
- package/esm/oas/integer/Integer.d.ts +2 -12
- package/esm/oas/integer/Integer.d.ts.map +1 -1
- package/esm/oas/integer/Integer.js +2 -4
- package/esm/oas/integer/toInteger.d.ts +3 -5
- package/esm/oas/integer/toInteger.d.ts.map +1 -1
- package/esm/oas/integer/toInteger.js +3 -2
- package/esm/oas/intersection/Intersection.d.ts +2 -12
- package/esm/oas/intersection/Intersection.d.ts.map +1 -1
- package/esm/oas/intersection/Intersection.js +2 -4
- package/esm/oas/intersection/toIntersection.d.ts +3 -5
- package/esm/oas/intersection/toIntersection.d.ts.map +1 -1
- package/esm/oas/intersection/toIntersection.js +6 -12
- package/esm/oas/mediaType/MediaType.d.ts +2 -12
- package/esm/oas/mediaType/MediaType.d.ts.map +1 -1
- package/esm/oas/mediaType/MediaType.js +2 -4
- package/esm/oas/mediaType/toMediaTypeItemV3.d.ts +7 -11
- package/esm/oas/mediaType/toMediaTypeItemV3.d.ts.map +1 -1
- package/esm/oas/mediaType/toMediaTypeItemV3.js +17 -19
- package/esm/oas/number/Number.d.ts +2 -12
- package/esm/oas/number/Number.d.ts.map +1 -1
- package/esm/oas/number/Number.js +2 -4
- package/esm/oas/number/toNumber.d.ts +3 -5
- package/esm/oas/number/toNumber.d.ts.map +1 -1
- package/esm/oas/number/toNumber.js +3 -2
- package/esm/oas/object/Object.d.ts +5 -15
- package/esm/oas/object/Object.d.ts.map +1 -1
- package/esm/oas/object/Object.js +16 -34
- package/esm/oas/object/toAdditionalPropertiesV3.d.ts +3 -5
- package/esm/oas/object/toAdditionalPropertiesV3.d.ts.map +1 -1
- package/esm/oas/object/toAdditionalPropertiesV3.js +2 -6
- package/esm/oas/object/toObject.d.ts +3 -5
- package/esm/oas/object/toObject.d.ts.map +1 -1
- package/esm/oas/object/toObject.js +7 -10
- package/esm/oas/operation/Operation.d.ts +2 -12
- package/esm/oas/operation/Operation.d.ts.map +1 -1
- package/esm/oas/operation/Operation.js +3 -5
- package/esm/oas/operation/toOperationsV3.d.ts +5 -8
- package/esm/oas/operation/toOperationsV3.d.ts.map +1 -1
- package/esm/oas/operation/toOperationsV3.js +42 -53
- package/esm/oas/parameter/Parameter.d.ts +2 -12
- package/esm/oas/parameter/Parameter.d.ts.map +1 -1
- package/esm/oas/parameter/Parameter.js +3 -5
- package/esm/oas/parameter/toParameterV3.d.ts +7 -11
- package/esm/oas/parameter/toParameterV3.d.ts.map +1 -1
- package/esm/oas/parameter/toParameterV3.js +18 -24
- package/esm/oas/pathItem/PathItem.d.ts +2 -12
- package/esm/oas/pathItem/PathItem.d.ts.map +1 -1
- package/esm/oas/pathItem/PathItem.js +2 -4
- package/esm/oas/pathItem/toPathItemV3.d.ts +3 -5
- package/esm/oas/pathItem/toPathItemV3.d.ts.map +1 -1
- package/esm/oas/pathItem/toPathItemV3.js +5 -7
- package/esm/oas/ref/Ref.d.ts +4 -12
- package/esm/oas/ref/Ref.d.ts.map +1 -1
- package/esm/oas/ref/Ref.js +10 -17
- package/esm/oas/ref/toRefV31.d.ts +3 -5
- package/esm/oas/ref/toRefV31.d.ts.map +1 -1
- package/esm/oas/ref/toRefV31.js +3 -2
- package/esm/oas/requestBody/RequestBody.d.ts +2 -12
- package/esm/oas/requestBody/RequestBody.d.ts.map +1 -1
- package/esm/oas/requestBody/RequestBody.js +2 -4
- package/esm/oas/requestBody/toRequestBodiesV3.d.ts +5 -8
- package/esm/oas/requestBody/toRequestBodiesV3.d.ts.map +1 -1
- package/esm/oas/requestBody/toRequestBodiesV3.js +9 -18
- package/esm/oas/response/Response.d.ts +2 -12
- package/esm/oas/response/Response.d.ts.map +1 -1
- package/esm/oas/response/Response.js +2 -4
- package/esm/oas/response/toResponseV3.d.ts +7 -11
- package/esm/oas/response/toResponseV3.d.ts.map +1 -1
- package/esm/oas/response/toResponseV3.js +11 -13
- package/esm/oas/schema/toSchemasV3.d.ts +9 -14
- package/esm/oas/schema/toSchemasV3.d.ts.map +1 -1
- package/esm/oas/schema/toSchemasV3.js +22 -24
- package/esm/oas/string/String.d.ts +2 -12
- package/esm/oas/string/String.d.ts.map +1 -1
- package/esm/oas/string/String.js +2 -4
- package/esm/oas/string/toString.d.ts +3 -5
- package/esm/oas/string/toString.d.ts.map +1 -1
- package/esm/oas/string/toString.js +3 -2
- package/esm/oas/tag/Tag.d.ts +2 -12
- package/esm/oas/tag/Tag.d.ts.map +1 -1
- package/esm/oas/tag/Tag.js +2 -4
- package/esm/oas/tag/toTagsV3.d.ts +8 -5
- package/esm/oas/tag/toTagsV3.d.ts.map +1 -1
- package/esm/oas/tag/toTagsV3.js +11 -9
- package/esm/oas/union/Union.d.ts +2 -12
- package/esm/oas/union/Union.d.ts.map +1 -1
- package/esm/oas/union/Union.js +2 -4
- package/esm/oas/union/toUnion.d.ts +3 -5
- package/esm/oas/union/toUnion.d.ts.map +1 -1
- package/esm/oas/union/toUnion.js +6 -12
- package/esm/oas/unknown/Unknown.d.ts +2 -12
- package/esm/oas/unknown/Unknown.d.ts.map +1 -1
- package/esm/oas/unknown/Unknown.js +2 -4
- package/esm/oas/unknown/toUnknown.d.ts +3 -5
- package/esm/oas/unknown/toUnknown.d.ts.map +1 -1
- package/esm/oas/unknown/toUnknown.js +3 -2
- package/esm/oas/void/Void.d.ts +3 -13
- package/esm/oas/void/Void.d.ts.map +1 -1
- package/esm/oas/void/Void.js +4 -12
- package/package.json +1 -1
- package/script/context/CoreContext.d.ts +2 -2
- package/script/context/CoreContext.d.ts.map +1 -1
- package/script/context/CoreContext.js +3 -3
- package/script/context/GenerateContext.d.ts +2 -2
- package/script/context/GenerateContext.d.ts.map +1 -1
- package/script/context/ParseContext.d.ts +14 -6
- package/script/context/ParseContext.d.ts.map +1 -1
- package/script/context/ParseContext.js +28 -12
- package/script/context/StackTrail.d.ts +3 -3
- package/script/context/StackTrail.d.ts.map +1 -1
- package/script/context/StackTrail.js +9 -1
- package/script/helpers/tracer.d.ts +7 -0
- package/script/helpers/tracer.d.ts.map +1 -0
- package/script/helpers/tracer.js +10 -0
- package/script/oas/array/Array.d.ts +2 -12
- package/script/oas/array/Array.d.ts.map +1 -1
- package/script/oas/array/Array.js +2 -4
- package/script/oas/array/toArray.d.ts +3 -5
- package/script/oas/array/toArray.d.ts.map +1 -1
- package/script/oas/array/toArray.js +5 -7
- package/script/oas/boolean/Boolean.d.ts +2 -12
- package/script/oas/boolean/Boolean.d.ts.map +1 -1
- package/script/oas/boolean/Boolean.js +2 -4
- package/script/oas/boolean/toBoolean.d.ts +3 -5
- package/script/oas/boolean/toBoolean.d.ts.map +1 -1
- package/script/oas/boolean/toBoolean.js +3 -2
- package/script/oas/components/Components.d.ts +2 -12
- package/script/oas/components/Components.d.ts.map +1 -1
- package/script/oas/components/Components.js +2 -4
- package/script/oas/components/toComponentsV3.d.ts +3 -5
- package/script/oas/components/toComponentsV3.d.ts.map +1 -1
- package/script/oas/components/toComponentsV3.js +10 -22
- package/script/oas/discriminator/Discriminator.d.ts +2 -12
- package/script/oas/discriminator/Discriminator.d.ts.map +1 -1
- package/script/oas/discriminator/Discriminator.js +2 -4
- package/script/oas/discriminator/toDiscriminatorV3.d.ts +3 -5
- package/script/oas/discriminator/toDiscriminatorV3.d.ts.map +1 -1
- package/script/oas/discriminator/toDiscriminatorV3.js +3 -2
- package/script/oas/document/Document.d.ts +3 -12
- package/script/oas/document/Document.d.ts.map +1 -1
- package/script/oas/document/Document.js +20 -4
- package/script/oas/document/toDocumentFieldsV3.d.ts +10 -0
- package/script/oas/document/toDocumentFieldsV3.d.ts.map +1 -0
- package/script/oas/document/toDocumentFieldsV3.js +21 -0
- package/script/oas/example/Example.d.ts +2 -12
- package/script/oas/example/Example.d.ts.map +1 -1
- package/script/oas/example/Example.js +2 -4
- package/script/oas/example/toExamplesV3.d.ts +6 -11
- package/script/oas/example/toExamplesV3.d.ts.map +1 -1
- package/script/oas/example/toExamplesV3.js +18 -17
- package/script/oas/header/Header.d.ts +2 -12
- package/script/oas/header/Header.d.ts.map +1 -1
- package/script/oas/header/Header.js +2 -4
- package/script/oas/header/toHeadersV3.d.ts +3 -5
- package/script/oas/header/toHeadersV3.d.ts.map +1 -1
- package/script/oas/header/toHeadersV3.js +9 -12
- package/script/oas/info/Info.d.ts +2 -12
- package/script/oas/info/Info.d.ts.map +1 -1
- package/script/oas/info/Info.js +2 -4
- package/script/oas/info/toInfoV3.d.ts +3 -5
- package/script/oas/info/toInfoV3.d.ts.map +1 -1
- package/script/oas/info/toInfoV3.js +3 -2
- package/script/oas/integer/Integer.d.ts +2 -12
- package/script/oas/integer/Integer.d.ts.map +1 -1
- package/script/oas/integer/Integer.js +2 -4
- package/script/oas/integer/toInteger.d.ts +3 -5
- package/script/oas/integer/toInteger.d.ts.map +1 -1
- package/script/oas/integer/toInteger.js +3 -2
- package/script/oas/intersection/Intersection.d.ts +2 -12
- package/script/oas/intersection/Intersection.d.ts.map +1 -1
- package/script/oas/intersection/Intersection.js +2 -4
- package/script/oas/intersection/toIntersection.d.ts +3 -5
- package/script/oas/intersection/toIntersection.d.ts.map +1 -1
- package/script/oas/intersection/toIntersection.js +6 -12
- package/script/oas/mediaType/MediaType.d.ts +2 -12
- package/script/oas/mediaType/MediaType.d.ts.map +1 -1
- package/script/oas/mediaType/MediaType.js +2 -4
- package/script/oas/mediaType/toMediaTypeItemV3.d.ts +7 -11
- package/script/oas/mediaType/toMediaTypeItemV3.d.ts.map +1 -1
- package/script/oas/mediaType/toMediaTypeItemV3.js +17 -19
- package/script/oas/number/Number.d.ts +2 -12
- package/script/oas/number/Number.d.ts.map +1 -1
- package/script/oas/number/Number.js +2 -4
- package/script/oas/number/toNumber.d.ts +3 -5
- package/script/oas/number/toNumber.d.ts.map +1 -1
- package/script/oas/number/toNumber.js +3 -2
- package/script/oas/object/Object.d.ts +5 -15
- package/script/oas/object/Object.d.ts.map +1 -1
- package/script/oas/object/Object.js +16 -34
- package/script/oas/object/toAdditionalPropertiesV3.d.ts +3 -5
- package/script/oas/object/toAdditionalPropertiesV3.d.ts.map +1 -1
- package/script/oas/object/toAdditionalPropertiesV3.js +2 -6
- package/script/oas/object/toObject.d.ts +3 -5
- package/script/oas/object/toObject.d.ts.map +1 -1
- package/script/oas/object/toObject.js +7 -10
- package/script/oas/operation/Operation.d.ts +2 -12
- package/script/oas/operation/Operation.d.ts.map +1 -1
- package/script/oas/operation/Operation.js +3 -5
- package/script/oas/operation/toOperationsV3.d.ts +5 -8
- package/script/oas/operation/toOperationsV3.d.ts.map +1 -1
- package/script/oas/operation/toOperationsV3.js +42 -53
- package/script/oas/parameter/Parameter.d.ts +2 -12
- package/script/oas/parameter/Parameter.d.ts.map +1 -1
- package/script/oas/parameter/Parameter.js +3 -5
- package/script/oas/parameter/toParameterV3.d.ts +7 -11
- package/script/oas/parameter/toParameterV3.d.ts.map +1 -1
- package/script/oas/parameter/toParameterV3.js +18 -24
- package/script/oas/pathItem/PathItem.d.ts +2 -12
- package/script/oas/pathItem/PathItem.d.ts.map +1 -1
- package/script/oas/pathItem/PathItem.js +2 -4
- package/script/oas/pathItem/toPathItemV3.d.ts +3 -5
- package/script/oas/pathItem/toPathItemV3.d.ts.map +1 -1
- package/script/oas/pathItem/toPathItemV3.js +5 -7
- package/script/oas/ref/Ref.d.ts +4 -12
- package/script/oas/ref/Ref.d.ts.map +1 -1
- package/script/oas/ref/Ref.js +10 -17
- package/script/oas/ref/toRefV31.d.ts +3 -5
- package/script/oas/ref/toRefV31.d.ts.map +1 -1
- package/script/oas/ref/toRefV31.js +3 -2
- package/script/oas/requestBody/RequestBody.d.ts +2 -12
- package/script/oas/requestBody/RequestBody.d.ts.map +1 -1
- package/script/oas/requestBody/RequestBody.js +2 -4
- package/script/oas/requestBody/toRequestBodiesV3.d.ts +5 -8
- package/script/oas/requestBody/toRequestBodiesV3.d.ts.map +1 -1
- package/script/oas/requestBody/toRequestBodiesV3.js +9 -18
- package/script/oas/response/Response.d.ts +2 -12
- package/script/oas/response/Response.d.ts.map +1 -1
- package/script/oas/response/Response.js +2 -4
- package/script/oas/response/toResponseV3.d.ts +7 -11
- package/script/oas/response/toResponseV3.d.ts.map +1 -1
- package/script/oas/response/toResponseV3.js +11 -13
- package/script/oas/schema/toSchemasV3.d.ts +9 -14
- package/script/oas/schema/toSchemasV3.d.ts.map +1 -1
- package/script/oas/schema/toSchemasV3.js +22 -24
- package/script/oas/string/String.d.ts +2 -12
- package/script/oas/string/String.d.ts.map +1 -1
- package/script/oas/string/String.js +2 -4
- package/script/oas/string/toString.d.ts +3 -5
- package/script/oas/string/toString.d.ts.map +1 -1
- package/script/oas/string/toString.js +3 -2
- package/script/oas/tag/Tag.d.ts +2 -12
- package/script/oas/tag/Tag.d.ts.map +1 -1
- package/script/oas/tag/Tag.js +2 -4
- package/script/oas/tag/toTagsV3.d.ts +8 -5
- package/script/oas/tag/toTagsV3.d.ts.map +1 -1
- package/script/oas/tag/toTagsV3.js +13 -10
- package/script/oas/union/Union.d.ts +2 -12
- package/script/oas/union/Union.d.ts.map +1 -1
- package/script/oas/union/Union.js +2 -4
- package/script/oas/union/toUnion.d.ts +3 -5
- package/script/oas/union/toUnion.d.ts.map +1 -1
- package/script/oas/union/toUnion.js +6 -12
- package/script/oas/unknown/Unknown.d.ts +2 -12
- package/script/oas/unknown/Unknown.d.ts.map +1 -1
- package/script/oas/unknown/Unknown.js +2 -4
- package/script/oas/unknown/toUnknown.d.ts +3 -5
- package/script/oas/unknown/toUnknown.d.ts.map +1 -1
- package/script/oas/unknown/toUnknown.js +3 -2
- package/script/oas/void/Void.d.ts +3 -13
- package/script/oas/void/Void.d.ts.map +1 -1
- package/script/oas/void/Void.js +4 -12
- package/esm/dsl/OasBase.d.ts +0 -15
- package/esm/dsl/OasBase.d.ts.map +0 -1
- package/esm/dsl/OasBase.js +0 -28
- package/esm/oas/document/toDocumentV3.d.ts +0 -12
- package/esm/oas/document/toDocumentV3.d.ts.map +0 -1
- package/esm/oas/document/toDocumentV3.js +0 -24
- package/script/dsl/OasBase.d.ts +0 -15
- package/script/dsl/OasBase.d.ts.map +0 -1
- package/script/dsl/OasBase.js +0 -32
- package/script/oas/document/toDocumentV3.d.ts +0 -12
- package/script/oas/document/toDocumentV3.d.ts.map +0 -1
- package/script/oas/document/toDocumentV3.js +0 -28
|
@@ -1,12 +1,10 @@
|
|
|
1
1
|
import type { OpenAPIV3 } from 'openapi-types';
|
|
2
|
-
import type {
|
|
3
|
-
import type { CoreContext } from '../../context/CoreContext.js';
|
|
2
|
+
import type { ParseContext } from '../../context/ParseContext.js';
|
|
4
3
|
import { OasObject } from './Object.js';
|
|
5
4
|
type ToObjectArgs = {
|
|
6
5
|
value: OpenAPIV3.NonArraySchemaObject;
|
|
7
|
-
|
|
8
|
-
context: CoreContext;
|
|
6
|
+
context: ParseContext;
|
|
9
7
|
};
|
|
10
|
-
export declare const toObject: ({ value,
|
|
8
|
+
export declare const toObject: ({ value, context }: ToObjectArgs) => OasObject;
|
|
11
9
|
export {};
|
|
12
10
|
//# sourceMappingURL=toObject.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"toObject.d.ts","sourceRoot":"","sources":["../../../src/oas/object/toObject.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,eAAe,CAAA;AAC9C,OAAO,KAAK,EAAE,
|
|
1
|
+
{"version":3,"file":"toObject.d.ts","sourceRoot":"","sources":["../../../src/oas/object/toObject.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,eAAe,CAAA;AAC9C,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,+BAA+B,CAAA;AACjE,OAAO,EAAE,SAAS,EAAwB,MAAM,aAAa,CAAA;AAK7D,KAAK,YAAY,GAAG;IAClB,KAAK,EAAE,SAAS,CAAC,oBAAoB,CAAA;IACrC,OAAO,EAAE,YAAY,CAAA;CACtB,CAAA;AAED,eAAO,MAAM,QAAQ,uBAAwB,YAAY,KAAG,SA+B3D,CAAA"}
|
|
@@ -1,23 +1,20 @@
|
|
|
1
1
|
import { OasObject } from './Object.js';
|
|
2
2
|
import { toOptionalSchemasV3 } from '../schema/toSchemasV3.js';
|
|
3
3
|
import { toAdditionalPropertiesV3 } from './toAdditionalPropertiesV3.js';
|
|
4
|
-
|
|
4
|
+
import { tracer } from '../../helpers/tracer.js';
|
|
5
|
+
export const toObject = ({ value, context }) => {
|
|
5
6
|
const { type: _type, title, description, properties, required, additionalProperties, nullable, ...skipped } = value;
|
|
7
|
+
context.logSkippedFields(skipped);
|
|
6
8
|
const fields = {
|
|
7
9
|
title,
|
|
8
10
|
description,
|
|
9
11
|
nullable,
|
|
10
|
-
properties: toOptionalSchemasV3({
|
|
12
|
+
properties: tracer(context, 'properties', () => toOptionalSchemasV3({
|
|
11
13
|
schemas: properties,
|
|
12
|
-
trail: trail.add('properties'),
|
|
13
14
|
context
|
|
14
|
-
})
|
|
15
|
+
})),
|
|
15
16
|
required: required ?? [],
|
|
16
|
-
additionalProperties: toAdditionalPropertiesV3({
|
|
17
|
-
additionalProperties,
|
|
18
|
-
trail: trail.add('additionalProperties'),
|
|
19
|
-
context
|
|
20
|
-
})
|
|
17
|
+
additionalProperties: tracer(context, 'additionalProperties', () => toAdditionalPropertiesV3({ additionalProperties, context }))
|
|
21
18
|
};
|
|
22
|
-
return new OasObject(
|
|
19
|
+
return new OasObject(fields);
|
|
23
20
|
};
|
|
@@ -1,6 +1,3 @@
|
|
|
1
|
-
import { OasBase } from '../../dsl/OasBase.js';
|
|
2
|
-
import type { CoreContext } from '../../context/CoreContext.js';
|
|
3
|
-
import type { Trail } from '../../context/Trail.js';
|
|
4
1
|
import type { Method } from '../../types/Method.js';
|
|
5
2
|
import type { OasPathItem } from '../pathItem/PathItem.js';
|
|
6
3
|
import type { OasParameter } from '../parameter/Parameter.js';
|
|
@@ -23,17 +20,11 @@ export type OperationFields = {
|
|
|
23
20
|
responses: Record<string, OasResponse | OasRef<'response'>>;
|
|
24
21
|
deprecated: boolean | undefined;
|
|
25
22
|
};
|
|
26
|
-
type ToOperationV3Args = {
|
|
27
|
-
fields: OperationFields;
|
|
28
|
-
trail: Trail;
|
|
29
|
-
context: CoreContext;
|
|
30
|
-
skipped: Record<string, unknown>;
|
|
31
|
-
};
|
|
32
23
|
/** Operation represents a resource path and a method that can be enacted against it */
|
|
33
|
-
export declare class OasOperation
|
|
24
|
+
export declare class OasOperation {
|
|
34
25
|
#private;
|
|
35
26
|
oasType: 'operation';
|
|
36
|
-
constructor(
|
|
27
|
+
constructor(fields: OperationFields);
|
|
37
28
|
toSuccessResponse(): OasResponse | OasRef<'response'>;
|
|
38
29
|
toRequestBody(mediaType?: string): OasSchema | OasRef<'schema'> | undefined;
|
|
39
30
|
/**
|
|
@@ -56,5 +47,4 @@ export declare class OasOperation extends OasBase {
|
|
|
56
47
|
get responses(): Record<string, OasResponse | OasRef<'response'>>;
|
|
57
48
|
get deprecated(): boolean | undefined;
|
|
58
49
|
}
|
|
59
|
-
export {};
|
|
60
50
|
//# sourceMappingURL=Operation.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Operation.d.ts","sourceRoot":"","sources":["../../../src/oas/operation/Operation.ts"],"names":[],"mappings":"AAAA,OAAO,
|
|
1
|
+
{"version":3,"file":"Operation.d.ts","sourceRoot":"","sources":["../../../src/oas/operation/Operation.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,uBAAuB,CAAA;AACnD,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,yBAAyB,CAAA;AAC1D,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,2BAA2B,CAAA;AAC7D,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,+BAA+B,CAAA;AACnE,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,yBAAyB,CAAA;AAC1D,OAAO,KAAK,EAAE,oBAAoB,EAAE,MAAM,iCAAiC,CAAA;AAC3E,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,qBAAqB,CAAA;AACpD,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,eAAe,CAAA;AAC3C,OAAO,EAAE,SAAS,EAAE,MAAM,qBAAqB,CAAA;AAE/C,MAAM,MAAM,eAAe,GAAG;IAC5B,IAAI,EAAE,MAAM,CAAA;IACZ,MAAM,EAAE,MAAM,CAAA;IACd,QAAQ,EAAE,WAAW,CAAA;IACrB,WAAW,EAAE,MAAM,GAAG,SAAS,CAAA;IAC/B,OAAO,EAAE,MAAM,GAAG,SAAS,CAAA;IAC3B,IAAI,EAAE,MAAM,EAAE,GAAG,SAAS,CAAA;IAC1B,WAAW,EAAE,MAAM,GAAG,SAAS,CAAA;IAC/B,UAAU,EAAE,CAAC,YAAY,GAAG,MAAM,CAAC,WAAW,CAAC,CAAC,EAAE,GAAG,SAAS,CAAA;IAC9D,WAAW,EAAE,cAAc,GAAG,MAAM,CAAC,aAAa,CAAC,GAAG,SAAS,CAAA;IAC/D,SAAS,EAAE,MAAM,CAAC,MAAM,EAAE,WAAW,GAAG,MAAM,CAAC,UAAU,CAAC,CAAC,CAAA;IAC3D,UAAU,EAAE,OAAO,GAAG,SAAS,CAAA;CAChC,CAAA;AAED,uFAAuF;AACvF,qBAAa,YAAY;;IACvB,OAAO,EAAE,WAAW,CAAc;gBAGtB,MAAM,EAAE,eAAe;IAInC,iBAAiB,IAAI,WAAW,GAAG,MAAM,CAAC,UAAU,CAAC;IAWrD,aAAa,CACX,SAAS,SAAqB,GAC7B,SAAS,GAAG,MAAM,CAAC,QAAQ,CAAC,GAAG,SAAS;IAI3C;;;;;OAKG;IACH,QAAQ,CAAC,MAAM,CAAC,EAAE,oBAAoB,EAAE,GAAG,YAAY,EAAE;IAUzD,kBAAkB,CAAC,MAAM,CAAC,EAAE,oBAAoB,EAAE;IAYlD,IAAI,IAAI,IAAI,MAAM,CAEjB;IAED,IAAI,MAAM,IAAI,MAAM,CAEnB;IAED,IAAI,QAAQ,IAAI,WAAW,CAE1B;IAED,IAAI,WAAW,IAAI,MAAM,GAAG,SAAS,CAEpC;IAED,IAAI,OAAO,IAAI,MAAM,GAAG,SAAS,CAEhC;IAED,IAAI,IAAI,IAAI,MAAM,EAAE,GAAG,SAAS,CAE/B;IAED,IAAI,WAAW,IAAI,MAAM,GAAG,SAAS,CAEpC;IAED,IAAI,UAAU,IAAI,CAAC,YAAY,GAAG,MAAM,CAAC,WAAW,CAAC,CAAC,EAAE,GAAG,SAAS,CAEnE;IAED,IAAI,WAAW,IAAI,cAAc,GAAG,MAAM,CAAC,aAAa,CAAC,GAAG,SAAS,CAEpE;IAED,IAAI,SAAS,IAAI,MAAM,CAAC,MAAM,EAAE,WAAW,GAAG,MAAM,CAAC,UAAU,CAAC,CAAC,CAEhE;IAED,IAAI,UAAU,IAAI,OAAO,GAAG,SAAS,CAEpC;CACF"}
|
|
@@ -10,12 +10,10 @@ var __classPrivateFieldGet = (this && this.__classPrivateFieldGet) || function (
|
|
|
10
10
|
return kind === "m" ? f : kind === "a" ? f.call(receiver) : f ? f.value : state.get(receiver);
|
|
11
11
|
};
|
|
12
12
|
var _OasOperation_fields;
|
|
13
|
-
import { OasBase } from '../../dsl/OasBase.js';
|
|
14
13
|
import { OasObject } from '../object/Object.js';
|
|
15
14
|
/** Operation represents a resource path and a method that can be enacted against it */
|
|
16
|
-
export class OasOperation
|
|
17
|
-
constructor(
|
|
18
|
-
super({ trail, skipped, context });
|
|
15
|
+
export class OasOperation {
|
|
16
|
+
constructor(fields) {
|
|
19
17
|
Object.defineProperty(this, "oasType", {
|
|
20
18
|
enumerable: true,
|
|
21
19
|
configurable: true,
|
|
@@ -55,7 +53,7 @@ export class OasOperation extends OasBase {
|
|
|
55
53
|
schema: parameter.toSchema(),
|
|
56
54
|
required: parameter.required
|
|
57
55
|
});
|
|
58
|
-
}, OasObject.empty(
|
|
56
|
+
}, OasObject.empty());
|
|
59
57
|
}
|
|
60
58
|
get path() {
|
|
61
59
|
return __classPrivateFieldGet(this, _OasOperation_fields, "f").path;
|
|
@@ -1,7 +1,6 @@
|
|
|
1
1
|
import type { OpenAPIV3 } from 'openapi-types';
|
|
2
2
|
import type { Method } from '../../types/Method.js';
|
|
3
|
-
import type {
|
|
4
|
-
import type { Trail } from '../../context/Trail.js';
|
|
3
|
+
import type { ParseContext } from '../../context/ParseContext.js';
|
|
5
4
|
import { OasOperation } from './Operation.js';
|
|
6
5
|
import type { OasPathItem } from '../pathItem/PathItem.js';
|
|
7
6
|
type OperationInfo = {
|
|
@@ -12,15 +11,13 @@ type OperationInfo = {
|
|
|
12
11
|
type ToOperationV3Args = {
|
|
13
12
|
operation: OpenAPIV3.OperationObject;
|
|
14
13
|
operationInfo: OperationInfo;
|
|
15
|
-
|
|
16
|
-
context: CoreContext;
|
|
14
|
+
context: ParseContext;
|
|
17
15
|
};
|
|
18
|
-
export declare const toOperationV3: ({ operation, operationInfo,
|
|
16
|
+
export declare const toOperationV3: ({ operation, operationInfo, context }: ToOperationV3Args) => OasOperation;
|
|
19
17
|
type ToOperationsV3Args = {
|
|
20
18
|
paths: OpenAPIV3.PathsObject;
|
|
21
|
-
|
|
22
|
-
context: CoreContext;
|
|
19
|
+
context: ParseContext;
|
|
23
20
|
};
|
|
24
|
-
export declare const toOperationsV3: ({ paths,
|
|
21
|
+
export declare const toOperationsV3: ({ paths, context }: ToOperationsV3Args) => OasOperation[];
|
|
25
22
|
export {};
|
|
26
23
|
//# sourceMappingURL=toOperationsV3.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"toOperationsV3.d.ts","sourceRoot":"","sources":["../../../src/oas/operation/toOperationsV3.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,eAAe,CAAA;AAC9C,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,uBAAuB,CAAA;AACnD,OAAO,KAAK,EAAE,
|
|
1
|
+
{"version":3,"file":"toOperationsV3.d.ts","sourceRoot":"","sources":["../../../src/oas/operation/toOperationsV3.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,eAAe,CAAA;AAC9C,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,uBAAuB,CAAA;AACnD,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,+BAA+B,CAAA;AAIjE,OAAO,EAAE,YAAY,EAAE,MAAM,gBAAgB,CAAA;AAG7C,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,yBAAyB,CAAA;AAG1D,KAAK,aAAa,GAAG;IACnB,MAAM,EAAE,MAAM,CAAA;IACd,IAAI,EAAE,MAAM,CAAA;IACZ,QAAQ,EAAE,WAAW,CAAA;CACtB,CAAA;AAED,KAAK,iBAAiB,GAAG;IACvB,SAAS,EAAE,SAAS,CAAC,eAAe,CAAA;IACpC,aAAa,EAAE,aAAa,CAAA;IAC5B,OAAO,EAAE,YAAY,CAAA;CACtB,CAAA;AAED,eAAO,MAAM,aAAa,0CAIvB,iBAAiB,KAAG,YAqCtB,CAAA;AAED,KAAK,kBAAkB,GAAG;IACxB,KAAK,EAAE,SAAS,CAAC,WAAW,CAAA;IAC5B,OAAO,EAAE,YAAY,CAAA;CACtB,CAAA;AAED,eAAO,MAAM,cAAc,uBAGxB,kBAAkB,KAAG,YAAY,EAqDnC,CAAA"}
|
|
@@ -3,9 +3,11 @@ import { toResponsesV3 } from '../response/toResponseV3.js';
|
|
|
3
3
|
import { toParameterListV3 } from '../parameter/toParameterV3.js';
|
|
4
4
|
import { OasOperation } from './Operation.js';
|
|
5
5
|
import { toPathItemV3 } from '../pathItem/toPathItemV3.js';
|
|
6
|
-
|
|
6
|
+
import { tracer } from '../../helpers/tracer.js';
|
|
7
|
+
export const toOperationV3 = ({ operation, operationInfo, context }) => {
|
|
7
8
|
const { method, path, pathItem } = operationInfo;
|
|
8
9
|
const { operationId, tags, summary, description, parameters, requestBody, responses, deprecated, ...skipped } = operation;
|
|
10
|
+
context.logSkippedFields(skipped);
|
|
9
11
|
const fields = {
|
|
10
12
|
pathItem,
|
|
11
13
|
path,
|
|
@@ -14,62 +16,49 @@ export const toOperationV3 = ({ operation, operationInfo, trail, context }) => {
|
|
|
14
16
|
summary,
|
|
15
17
|
tags,
|
|
16
18
|
description,
|
|
17
|
-
parameters: toParameterListV3({
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
context
|
|
21
|
-
}),
|
|
22
|
-
requestBody: toRequestBodyV3({
|
|
23
|
-
requestBody,
|
|
24
|
-
trail: trail.add('requestBody'),
|
|
25
|
-
context
|
|
26
|
-
}),
|
|
27
|
-
responses: toResponsesV3({
|
|
28
|
-
responses,
|
|
29
|
-
trail: trail.add('responses'),
|
|
30
|
-
context
|
|
31
|
-
}),
|
|
19
|
+
parameters: tracer(context, 'parameters', () => toParameterListV3({ parameters, context })),
|
|
20
|
+
requestBody: tracer(context, 'requestBody', () => toRequestBodyV3({ requestBody, context })),
|
|
21
|
+
responses: tracer(context, 'responses', () => toResponsesV3({ responses, context })),
|
|
32
22
|
deprecated
|
|
33
23
|
};
|
|
34
|
-
return new OasOperation(
|
|
24
|
+
return new OasOperation(fields);
|
|
35
25
|
};
|
|
36
|
-
export const toOperationsV3 = ({ paths,
|
|
26
|
+
export const toOperationsV3 = ({ paths, context }) => {
|
|
37
27
|
return Object.entries(paths).flatMap(([path, pathItem]) => {
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
const { get, post, put, delete: deleteMethod, options, head, patch, trace, ...rest } = pathItem;
|
|
42
|
-
const pathItemObject = toPathItemV3({
|
|
43
|
-
pathItem: rest,
|
|
44
|
-
trail: trail.addApiPath(path),
|
|
45
|
-
context
|
|
46
|
-
});
|
|
47
|
-
const methodObjects = {
|
|
48
|
-
get,
|
|
49
|
-
post,
|
|
50
|
-
put,
|
|
51
|
-
delete: deleteMethod,
|
|
52
|
-
options,
|
|
53
|
-
head,
|
|
54
|
-
patch,
|
|
55
|
-
trace
|
|
56
|
-
};
|
|
57
|
-
return Object.entries(methodObjects)
|
|
58
|
-
.map(([method, operation]) => {
|
|
59
|
-
if (!operation) {
|
|
60
|
-
return;
|
|
28
|
+
return tracer(context, path, () => {
|
|
29
|
+
if (!pathItem) {
|
|
30
|
+
return [];
|
|
61
31
|
}
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
32
|
+
const { get, post, put, delete: deleteMethod, options, head, patch, trace, ...rest } = pathItem;
|
|
33
|
+
const pathItemObject = toPathItemV3({ pathItem: rest, context });
|
|
34
|
+
const methodObjects = {
|
|
35
|
+
get,
|
|
36
|
+
post,
|
|
37
|
+
put,
|
|
38
|
+
delete: deleteMethod,
|
|
39
|
+
options,
|
|
40
|
+
head,
|
|
41
|
+
patch,
|
|
42
|
+
trace
|
|
43
|
+
};
|
|
44
|
+
return Object.entries(methodObjects)
|
|
45
|
+
.map(([method, operation]) => {
|
|
46
|
+
return tracer(context, method, () => {
|
|
47
|
+
if (!operation) {
|
|
48
|
+
return;
|
|
49
|
+
}
|
|
50
|
+
return toOperationV3({
|
|
51
|
+
operation,
|
|
52
|
+
operationInfo: {
|
|
53
|
+
method: method,
|
|
54
|
+
path,
|
|
55
|
+
pathItem: pathItemObject
|
|
56
|
+
},
|
|
57
|
+
context
|
|
58
|
+
});
|
|
59
|
+
});
|
|
60
|
+
})
|
|
61
|
+
.filter((item) => Boolean(item));
|
|
62
|
+
});
|
|
74
63
|
});
|
|
75
64
|
};
|
|
@@ -1,7 +1,4 @@
|
|
|
1
|
-
import { OasBase } from '../../dsl/OasBase.js';
|
|
2
1
|
import type { OasParameterLocation, OasParameterStyle } from './parameter-types.js';
|
|
3
|
-
import type { Trail } from '../../context/Trail.js';
|
|
4
|
-
import type { CoreContext } from '../../context/CoreContext.js';
|
|
5
2
|
import type { OasMediaType } from '../mediaType/MediaType.js';
|
|
6
3
|
import type { OasRef } from '../ref/Ref.js';
|
|
7
4
|
import type { OasExample } from '../example/Example.js';
|
|
@@ -20,16 +17,10 @@ export type ParameterFields = {
|
|
|
20
17
|
style: OasParameterStyle;
|
|
21
18
|
explode: boolean;
|
|
22
19
|
};
|
|
23
|
-
|
|
24
|
-
fields: ParameterFields;
|
|
25
|
-
trail: Trail;
|
|
26
|
-
skipped: Record<string, unknown>;
|
|
27
|
-
context: CoreContext;
|
|
28
|
-
};
|
|
29
|
-
export declare class OasParameter extends OasBase {
|
|
20
|
+
export declare class OasParameter {
|
|
30
21
|
#private;
|
|
31
22
|
oasType: 'parameter';
|
|
32
|
-
constructor(
|
|
23
|
+
constructor(fields: ParameterFields);
|
|
33
24
|
get name(): string;
|
|
34
25
|
get location(): OasParameterLocation;
|
|
35
26
|
get description(): string | undefined;
|
|
@@ -47,5 +38,4 @@ export declare class OasParameter extends OasBase {
|
|
|
47
38
|
resolveOnce(): OasParameter;
|
|
48
39
|
toSchema(mediaType?: string): OasSchema | OasRef<'schema'> | undefined;
|
|
49
40
|
}
|
|
50
|
-
export {};
|
|
51
41
|
//# sourceMappingURL=Parameter.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Parameter.d.ts","sourceRoot":"","sources":["../../../src/oas/parameter/Parameter.ts"],"names":[],"mappings":"AAAA,OAAO,
|
|
1
|
+
{"version":3,"file":"Parameter.d.ts","sourceRoot":"","sources":["../../../src/oas/parameter/Parameter.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EACV,oBAAoB,EACpB,iBAAiB,EAClB,MAAM,sBAAsB,CAAA;AAC7B,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,2BAA2B,CAAA;AAC7D,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,eAAe,CAAA;AAC3C,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,uBAAuB,CAAA;AACvD,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,qBAAqB,CAAA;AAKpD,MAAM,MAAM,eAAe,GAAG;IAC5B,IAAI,EAAE,MAAM,CAAA;IACZ,QAAQ,EAAE,oBAAoB,CAAA;IAC9B,WAAW,EAAE,MAAM,GAAG,SAAS,CAAA;IAC/B,QAAQ,EAAE,OAAO,GAAG,SAAS,CAAA;IAC7B,UAAU,EAAE,OAAO,GAAG,SAAS,CAAA;IAC/B,eAAe,EAAE,OAAO,GAAG,SAAS,CAAA;IACpC,aAAa,EAAE,OAAO,GAAG,SAAS,CAAA;IAClC,MAAM,EAAE,SAAS,GAAG,MAAM,CAAC,QAAQ,CAAC,GAAG,SAAS,CAAA;IAChD,QAAQ,EAAE,MAAM,CAAC,MAAM,EAAE,UAAU,GAAG,MAAM,CAAC,SAAS,CAAC,CAAC,GAAG,SAAS,CAAA;IACpE,OAAO,EAAE,MAAM,CAAC,MAAM,EAAE,YAAY,CAAC,GAAG,SAAS,CAAA;IACjD,KAAK,EAAE,iBAAiB,CAAA;IACxB,OAAO,EAAE,OAAO,CAAA;CACjB,CAAA;AAED,qBAAa,YAAY;;IACvB,OAAO,EAAE,WAAW,CAAc;gBAGtB,MAAM,EAAE,eAAe;IAInC,IAAI,IAAI,IAAI,MAAM,CAEjB;IAED,IAAI,QAAQ,IAAI,oBAAoB,CAEnC;IAED,IAAI,WAAW,IAAI,MAAM,GAAG,SAAS,CAEpC;IAED,IAAI,QAAQ,IAAI,OAAO,GAAG,SAAS,CAElC;IAED,IAAI,UAAU,IAAI,OAAO,GAAG,SAAS,CAEpC;IAED,IAAI,eAAe,IAAI,OAAO,GAAG,SAAS,CAEzC;IAED,IAAI,MAAM,IAAI,SAAS,GAAG,MAAM,CAAC,QAAQ,CAAC,GAAG,SAAS,CAErD;IAED,IAAI,QAAQ,IAAI,MAAM,CAAC,MAAM,EAAE,UAAU,GAAG,MAAM,CAAC,SAAS,CAAC,CAAC,GAAG,SAAS,CAEzE;IAED,IAAI,OAAO,IAAI,MAAM,CAAC,MAAM,EAAE,YAAY,CAAC,GAAG,SAAS,CAEtD;IAED,IAAI,KAAK,IAAI,iBAAiB,CAE7B;IAED,IAAI,OAAO,IAAI,OAAO,CAErB;IAED,IAAI,aAAa,IAAI,OAAO,GAAG,SAAS,CAEvC;IAED,KAAK,IAAI,IAAI,IAAI,MAAM,CAAC,WAAW,CAAC;IAIpC,OAAO,IAAI,YAAY;IAIvB,WAAW,IAAI,YAAY;IAI3B,QAAQ,CACN,SAAS,GAAE,MAA2B,GACrC,SAAS,GAAG,MAAM,CAAC,QAAQ,CAAC,GAAG,SAAS;CAa5C"}
|
|
@@ -10,10 +10,8 @@ var __classPrivateFieldGet = (this && this.__classPrivateFieldGet) || function (
|
|
|
10
10
|
return kind === "m" ? f : kind === "a" ? f.call(receiver) : f ? f.value : state.get(receiver);
|
|
11
11
|
};
|
|
12
12
|
var _OasParameter_fields;
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
constructor({ fields, trail, skipped, context }) {
|
|
16
|
-
super({ trail, skipped, context });
|
|
13
|
+
export class OasParameter {
|
|
14
|
+
constructor(fields) {
|
|
17
15
|
Object.defineProperty(this, "oasType", {
|
|
18
16
|
enumerable: true,
|
|
19
17
|
configurable: true,
|
|
@@ -74,7 +72,7 @@ export class OasParameter extends OasBase {
|
|
|
74
72
|
}
|
|
75
73
|
const schema = __classPrivateFieldGet(this, _OasParameter_fields, "f").content?.[mediaType]?.schema;
|
|
76
74
|
if (!schema) {
|
|
77
|
-
throw new Error(`Schema not found for media type ${mediaType}
|
|
75
|
+
throw new Error(`Schema not found for media type ${mediaType}`);
|
|
78
76
|
}
|
|
79
77
|
return schema;
|
|
80
78
|
}
|
|
@@ -1,25 +1,21 @@
|
|
|
1
|
-
import type {
|
|
1
|
+
import type { ParseContext } from '../../context/ParseContext.js';
|
|
2
2
|
import type { OpenAPIV3 } from 'openapi-types';
|
|
3
|
-
import type { Trail } from '../../context/Trail.js';
|
|
4
3
|
import { OasParameter } from './Parameter.js';
|
|
5
4
|
import type { OasRef } from '../ref/Ref.js';
|
|
6
5
|
type ToParameterListV3Args = {
|
|
7
6
|
parameters: (OpenAPIV3.ParameterObject | OpenAPIV3.ReferenceObject)[] | undefined;
|
|
8
|
-
|
|
9
|
-
context: CoreContext;
|
|
7
|
+
context: ParseContext;
|
|
10
8
|
};
|
|
11
|
-
export declare const toParameterListV3: ({ parameters,
|
|
9
|
+
export declare const toParameterListV3: ({ parameters, context }: ToParameterListV3Args) => (OasParameter | OasRef<"parameter">)[] | undefined;
|
|
12
10
|
type ToParametersV3Args = {
|
|
13
11
|
parameters: Record<string, OpenAPIV3.ParameterObject | OpenAPIV3.ReferenceObject>;
|
|
14
|
-
|
|
15
|
-
context: CoreContext;
|
|
12
|
+
context: ParseContext;
|
|
16
13
|
};
|
|
17
|
-
export declare const toParametersV3: ({ parameters,
|
|
14
|
+
export declare const toParametersV3: ({ parameters, context }: ToParametersV3Args) => Record<string, OasParameter | OasRef<"parameter">>;
|
|
18
15
|
type ToOptionalParametersV3Args = {
|
|
19
16
|
parameters: Record<string, OpenAPIV3.ParameterObject | OpenAPIV3.ReferenceObject> | undefined;
|
|
20
|
-
|
|
21
|
-
context: CoreContext;
|
|
17
|
+
context: ParseContext;
|
|
22
18
|
};
|
|
23
|
-
export declare const toOptionalParametersV3: ({ parameters,
|
|
19
|
+
export declare const toOptionalParametersV3: ({ parameters, context }: ToOptionalParametersV3Args) => Record<string, OasParameter | OasRef<"parameter">> | undefined;
|
|
24
20
|
export {};
|
|
25
21
|
//# sourceMappingURL=toParameterV3.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"toParameterV3.d.ts","sourceRoot":"","sources":["../../../src/oas/parameter/toParameterV3.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,
|
|
1
|
+
{"version":3,"file":"toParameterV3.d.ts","sourceRoot":"","sources":["../../../src/oas/parameter/toParameterV3.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,+BAA+B,CAAA;AAQjE,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,eAAe,CAAA;AAK9C,OAAO,EAAE,YAAY,EAAE,MAAM,gBAAgB,CAAA;AAE7C,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,eAAe,CAAA;AAI3C,KAAK,qBAAqB,GAAG;IAC3B,UAAU,EACN,CAAC,SAAS,CAAC,eAAe,GAAG,SAAS,CAAC,eAAe,CAAC,EAAE,GACzD,SAAS,CAAA;IACb,OAAO,EAAE,YAAY,CAAA;CACtB,CAAA;AAED,eAAO,MAAM,iBAAiB,4BAG3B,qBAAqB,KACpB,CAAC,YAAY,GAAG,MAAM,CAAC,WAAW,CAAC,CAAC,EAAE,GACtC,SAQH,CAAA;AAED,KAAK,kBAAkB,GAAG;IACxB,UAAU,EAAE,MAAM,CAChB,MAAM,EACN,SAAS,CAAC,eAAe,GAAG,SAAS,CAAC,eAAe,CACtD,CAAA;IACD,OAAO,EAAE,YAAY,CAAA;CACtB,CAAA;AAED,eAAO,MAAM,cAAc,4BAGxB,kBAAkB,KAAG,MAAM,CAAC,MAAM,EAAE,YAAY,GAAG,MAAM,CAAC,WAAW,CAAC,CASxE,CAAA;AAED,KAAK,0BAA0B,GAAG;IAChC,UAAU,EACN,MAAM,CAAC,MAAM,EAAE,SAAS,CAAC,eAAe,GAAG,SAAS,CAAC,eAAe,CAAC,GACrE,SAAS,CAAA;IACb,OAAO,EAAE,YAAY,CAAA;CACtB,CAAA;AAED,eAAO,MAAM,sBAAsB,4BAGhC,0BAA0B,KACzB,MAAM,CAAC,MAAM,EAAE,YAAY,GAAG,MAAM,CAAC,WAAW,CAAC,CAAC,GAClD,SAMH,CAAA"}
|
|
@@ -6,37 +6,36 @@ import { toOptionalSchemaV3 } from '../schema/toSchemasV3.js';
|
|
|
6
6
|
import { toOptionalMediaTypeItemsV3 } from '../mediaType/toMediaTypeItemV3.js';
|
|
7
7
|
import { OasParameter } from './Parameter.js';
|
|
8
8
|
import { match } from 'ts-pattern';
|
|
9
|
-
|
|
9
|
+
import { tracer } from '../../helpers/tracer.js';
|
|
10
|
+
export const toParameterListV3 = ({ parameters, context }) => {
|
|
10
11
|
if (!parameters) {
|
|
11
12
|
return undefined;
|
|
12
13
|
}
|
|
13
|
-
return parameters.map((parameter, index) =>
|
|
14
|
+
return parameters.map((parameter, index) => tracer(context, index, () => toParameterV3({ parameter, context })));
|
|
14
15
|
};
|
|
15
|
-
export const toParametersV3 = ({ parameters,
|
|
16
|
+
export const toParametersV3 = ({ parameters, context }) => {
|
|
16
17
|
return Object.fromEntries(Object.entries(parameters).map(([key, value]) => {
|
|
17
18
|
return [
|
|
18
19
|
key,
|
|
19
|
-
toParameterV3({ parameter: value,
|
|
20
|
+
tracer(context, key, () => toParameterV3({ parameter: value, context }))
|
|
20
21
|
];
|
|
21
22
|
}));
|
|
22
23
|
};
|
|
23
|
-
export const toOptionalParametersV3 = ({ parameters,
|
|
24
|
+
export const toOptionalParametersV3 = ({ parameters, context }) => {
|
|
24
25
|
if (!parameters) {
|
|
25
26
|
return undefined;
|
|
26
27
|
}
|
|
27
|
-
return toParametersV3({ parameters,
|
|
28
|
+
return toParametersV3({ parameters, context });
|
|
28
29
|
};
|
|
29
|
-
const toParameterV3 = ({ parameter,
|
|
30
|
+
const toParameterV3 = ({ parameter, context }) => {
|
|
30
31
|
if (isRef(parameter)) {
|
|
31
|
-
return toRefV31({ ref: parameter, refType: 'parameter',
|
|
32
|
+
return toRefV31({ ref: parameter, refType: 'parameter', context });
|
|
32
33
|
}
|
|
33
34
|
const { name, in: location, description, required, deprecated, allowEmptyValue, allowReserved, schema, example, examples, content, style, explode, ...skipped } = parameter;
|
|
35
|
+
context.logSkippedFields(skipped);
|
|
34
36
|
const parsedLocation = oasParameterLocation.parse(location);
|
|
35
37
|
if (parsedLocation === 'path' && !required) {
|
|
36
|
-
console.warn(
|
|
37
|
-
message: `Path parameters must be required`,
|
|
38
|
-
trail: trail.toString()
|
|
39
|
-
}));
|
|
38
|
+
console.warn(`Path parameters must be required`);
|
|
40
39
|
}
|
|
41
40
|
// Set missing 'required' to true for path parameters and false for others
|
|
42
41
|
const defaultRequired = typeof required === 'undefined'
|
|
@@ -50,25 +49,20 @@ const toParameterV3 = ({ parameter, trail, context }) => {
|
|
|
50
49
|
description,
|
|
51
50
|
required: defaultRequired,
|
|
52
51
|
deprecated,
|
|
53
|
-
style: toStyle({ style, location: parsedLocation }),
|
|
54
|
-
explode: toExplode({ explode, style }),
|
|
52
|
+
style: tracer(context, 'style', () => toStyle({ style, location: parsedLocation })),
|
|
53
|
+
explode: tracer(context, 'explode', () => toExplode({ explode, style })),
|
|
55
54
|
allowEmptyValue,
|
|
56
55
|
allowReserved,
|
|
57
|
-
schema:
|
|
58
|
-
examples: toExamplesV3({
|
|
56
|
+
schema: tracer(context, 'schema', () => toOptionalSchemaV3({ schema, context })),
|
|
57
|
+
examples: tracer(context, 'examples', () => toExamplesV3({
|
|
59
58
|
examples,
|
|
60
59
|
example,
|
|
61
60
|
exampleKey: `${name}-${parsedLocation}`,
|
|
62
|
-
trail: trail.add('examples'),
|
|
63
61
|
context
|
|
64
|
-
}),
|
|
65
|
-
content: toOptionalMediaTypeItemsV3({
|
|
66
|
-
content,
|
|
67
|
-
trail: trail.add('content'),
|
|
68
|
-
context
|
|
69
|
-
})
|
|
62
|
+
})),
|
|
63
|
+
content: tracer(context, 'content', () => toOptionalMediaTypeItemsV3({ content, context }))
|
|
70
64
|
};
|
|
71
|
-
return new OasParameter(
|
|
65
|
+
return new OasParameter(fields);
|
|
72
66
|
};
|
|
73
67
|
const toStyle = ({ style, location }) => {
|
|
74
68
|
const parsed = oasParameterStyle.optional().parse(style);
|
|
@@ -1,6 +1,3 @@
|
|
|
1
|
-
import { OasBase } from '../../dsl/OasBase.js';
|
|
2
|
-
import type { Trail } from '../../context/Trail.js';
|
|
3
|
-
import type { CoreContext } from '../../context/CoreContext.js';
|
|
4
1
|
import type { OasParameter } from '../parameter/Parameter.js';
|
|
5
2
|
import type { OasRef } from '../ref/Ref.js';
|
|
6
3
|
export type PathItemFields = {
|
|
@@ -8,19 +5,12 @@ export type PathItemFields = {
|
|
|
8
5
|
description: string | undefined;
|
|
9
6
|
parameters: (OasParameter | OasRef<'parameter'>)[] | undefined;
|
|
10
7
|
};
|
|
11
|
-
|
|
12
|
-
fields: PathItemFields;
|
|
13
|
-
trail: Trail;
|
|
14
|
-
skipped: Record<string, unknown>;
|
|
15
|
-
context: CoreContext;
|
|
16
|
-
};
|
|
17
|
-
export declare class OasPathItem extends OasBase {
|
|
8
|
+
export declare class OasPathItem {
|
|
18
9
|
#private;
|
|
19
10
|
oasType: 'pathItem';
|
|
20
|
-
constructor(
|
|
11
|
+
constructor(fields: PathItemFields);
|
|
21
12
|
get summary(): string | undefined;
|
|
22
13
|
get description(): string | undefined;
|
|
23
14
|
get parameters(): (OasParameter | OasRef<'parameter'>)[] | undefined;
|
|
24
15
|
}
|
|
25
|
-
export {};
|
|
26
16
|
//# sourceMappingURL=PathItem.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"PathItem.d.ts","sourceRoot":"","sources":["../../../src/oas/pathItem/PathItem.ts"],"names":[],"mappings":"AAAA,OAAO,
|
|
1
|
+
{"version":3,"file":"PathItem.d.ts","sourceRoot":"","sources":["../../../src/oas/pathItem/PathItem.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,2BAA2B,CAAA;AAC7D,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,eAAe,CAAA;AAE3C,MAAM,MAAM,cAAc,GAAG;IAC3B,OAAO,EAAE,MAAM,GAAG,SAAS,CAAA;IAC3B,WAAW,EAAE,MAAM,GAAG,SAAS,CAAA;IAC/B,UAAU,EAAE,CAAC,YAAY,GAAG,MAAM,CAAC,WAAW,CAAC,CAAC,EAAE,GAAG,SAAS,CAAA;CAC/D,CAAA;AAED,qBAAa,WAAW;;IACtB,OAAO,EAAE,UAAU,CAAa;gBAGpB,MAAM,EAAE,cAAc;IAIlC,IAAI,OAAO,IAAI,MAAM,GAAG,SAAS,CAEhC;IAED,IAAI,WAAW,IAAI,MAAM,GAAG,SAAS,CAEpC;IAED,IAAI,UAAU,IAAI,CAAC,YAAY,GAAG,MAAM,CAAC,WAAW,CAAC,CAAC,EAAE,GAAG,SAAS,CAEnE;CACF"}
|
|
@@ -10,10 +10,8 @@ var __classPrivateFieldGet = (this && this.__classPrivateFieldGet) || function (
|
|
|
10
10
|
return kind === "m" ? f : kind === "a" ? f.call(receiver) : f ? f.value : state.get(receiver);
|
|
11
11
|
};
|
|
12
12
|
var _OasPathItem_fields;
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
constructor({ fields, trail, skipped, context }) {
|
|
16
|
-
super({ trail, skipped, context });
|
|
13
|
+
export class OasPathItem {
|
|
14
|
+
constructor(fields) {
|
|
17
15
|
Object.defineProperty(this, "oasType", {
|
|
18
16
|
enumerable: true,
|
|
19
17
|
configurable: true,
|
|
@@ -1,12 +1,10 @@
|
|
|
1
1
|
import type { OpenAPIV3 } from 'openapi-types';
|
|
2
|
-
import type {
|
|
3
|
-
import type { Trail } from '../../context/Trail.js';
|
|
2
|
+
import type { ParseContext } from '../../context/ParseContext.js';
|
|
4
3
|
import { OasPathItem } from './PathItem.js';
|
|
5
4
|
type ToPathItemV3Args = {
|
|
6
5
|
pathItem: OpenAPIV3.PathItemObject;
|
|
7
|
-
|
|
8
|
-
context: CoreContext;
|
|
6
|
+
context: ParseContext;
|
|
9
7
|
};
|
|
10
|
-
export declare const toPathItemV3: ({ pathItem,
|
|
8
|
+
export declare const toPathItemV3: ({ pathItem, context }: ToPathItemV3Args) => OasPathItem;
|
|
11
9
|
export {};
|
|
12
10
|
//# sourceMappingURL=toPathItemV3.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"toPathItemV3.d.ts","sourceRoot":"","sources":["../../../src/oas/pathItem/toPathItemV3.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,eAAe,CAAA;AAC9C,OAAO,KAAK,EAAE,
|
|
1
|
+
{"version":3,"file":"toPathItemV3.d.ts","sourceRoot":"","sources":["../../../src/oas/pathItem/toPathItemV3.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,eAAe,CAAA;AAC9C,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,+BAA+B,CAAA;AAEjE,OAAO,EAAE,WAAW,EAAE,MAAM,eAAe,CAAA;AAI3C,KAAK,gBAAgB,GAAG;IACtB,QAAQ,EAAE,SAAS,CAAC,cAAc,CAAA;IAClC,OAAO,EAAE,YAAY,CAAA;CACtB,CAAA;AAED,eAAO,MAAM,YAAY,0BAGtB,gBAAgB,KAAG,WAcrB,CAAA"}
|
|
@@ -1,15 +1,13 @@
|
|
|
1
1
|
import { toParameterListV3 } from '../parameter/toParameterV3.js';
|
|
2
2
|
import { OasPathItem } from './PathItem.js';
|
|
3
|
-
|
|
3
|
+
import { tracer } from '../../helpers/tracer.js';
|
|
4
|
+
export const toPathItemV3 = ({ pathItem, context }) => {
|
|
4
5
|
const { summary, description, parameters, ...skipped } = pathItem;
|
|
6
|
+
context.logSkippedFields(skipped);
|
|
5
7
|
const fields = {
|
|
6
8
|
summary,
|
|
7
9
|
description,
|
|
8
|
-
parameters: toParameterListV3({
|
|
9
|
-
parameters,
|
|
10
|
-
trail: trail.add('parameters'),
|
|
11
|
-
context
|
|
12
|
-
})
|
|
10
|
+
parameters: tracer(context, 'parameters', () => toParameterListV3({ parameters, context }))
|
|
13
11
|
};
|
|
14
|
-
return new OasPathItem(
|
|
12
|
+
return new OasPathItem(fields);
|
|
15
13
|
};
|
package/esm/oas/ref/Ref.d.ts
CHANGED
|
@@ -1,30 +1,23 @@
|
|
|
1
|
-
import { OasBase } from '../../dsl/OasBase.js';
|
|
2
1
|
import type { OasRefData } from './ref-types.js';
|
|
3
|
-
import type { CoreContext } from '../../context/CoreContext.js';
|
|
4
|
-
import type { Trail } from '../../context/Trail.js';
|
|
5
2
|
import type { OasSchema } from '../schema/Schema.js';
|
|
6
3
|
import type { OasResponse } from '../response/Response.js';
|
|
7
4
|
import type { OasParameter } from '../parameter/Parameter.js';
|
|
8
5
|
import type { OasExample } from '../example/Example.js';
|
|
9
6
|
import type { OasRequestBody } from '../requestBody/RequestBody.js';
|
|
10
7
|
import type { OasHeader } from '../header/Header.js';
|
|
8
|
+
import type { OasDocument } from '../document/Document.js';
|
|
11
9
|
export type RefFields<T extends OasRefData['refType']> = {
|
|
12
10
|
refType: T;
|
|
13
11
|
$ref: string;
|
|
14
12
|
summary?: string;
|
|
15
13
|
description?: string;
|
|
16
14
|
};
|
|
17
|
-
|
|
18
|
-
fields: RefFields<T>;
|
|
19
|
-
trail: Trail;
|
|
20
|
-
context: CoreContext;
|
|
21
|
-
skipped: Record<string, unknown>;
|
|
22
|
-
};
|
|
23
|
-
export declare class OasRef<T extends OasRefData['refType']> extends OasBase {
|
|
15
|
+
export declare class OasRef<T extends OasRefData['refType']> {
|
|
24
16
|
#private;
|
|
25
17
|
oasType: 'ref';
|
|
26
18
|
type: 'ref';
|
|
27
|
-
|
|
19
|
+
documentRoot: OasDocument;
|
|
20
|
+
constructor(fields: RefFields<T>, documentRoot: OasDocument);
|
|
28
21
|
resolve(lookupsPerformed?: number): ResolvedRef<T>;
|
|
29
22
|
isRef(): this is OasRef<T>;
|
|
30
23
|
resolveOnce(): OasRef<T> | ResolvedRef<T>;
|
|
@@ -37,5 +30,4 @@ export type OasComponentType = OasSchema | OasResponse | OasParameter | OasExamp
|
|
|
37
30
|
export type ResolvedRef<T extends OasRefData['refType']> = Extract<OasComponentType, {
|
|
38
31
|
oasType: T;
|
|
39
32
|
}>;
|
|
40
|
-
export {};
|
|
41
33
|
//# sourceMappingURL=Ref.d.ts.map
|
package/esm/oas/ref/Ref.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Ref.d.ts","sourceRoot":"","sources":["../../../src/oas/ref/Ref.ts"],"names":[],"mappings":"AAAA,OAAO,
|
|
1
|
+
{"version":3,"file":"Ref.d.ts","sourceRoot":"","sources":["../../../src/oas/ref/Ref.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,gBAAgB,CAAA;AAGhD,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,qBAAqB,CAAA;AACpD,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,yBAAyB,CAAA;AAC1D,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,2BAA2B,CAAA;AAC7D,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,uBAAuB,CAAA;AACvD,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,+BAA+B,CAAA;AACnE,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,qBAAqB,CAAA;AACpD,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,yBAAyB,CAAA;AAI1D,MAAM,MAAM,SAAS,CAAC,CAAC,SAAS,UAAU,CAAC,SAAS,CAAC,IAAI;IACvD,OAAO,EAAE,CAAC,CAAA;IACV,IAAI,EAAE,MAAM,CAAA;IACZ,OAAO,CAAC,EAAE,MAAM,CAAA;IAChB,WAAW,CAAC,EAAE,MAAM,CAAA;CACrB,CAAA;AAED,qBAAa,MAAM,CAAC,CAAC,SAAS,UAAU,CAAC,SAAS,CAAC;;IACjD,OAAO,EAAE,KAAK,CAAQ;IACtB,IAAI,EAAE,KAAK,CAAQ;IAEnB,YAAY,EAAE,WAAW,CAAA;gBAEb,MAAM,EAAE,SAAS,CAAC,CAAC,CAAC,EAAE,YAAY,EAAE,WAAW;IAK3D,OAAO,CAAC,gBAAgB,GAAE,MAAU,GAAG,WAAW,CAAC,CAAC,CAAC;IAUrD,KAAK,IAAI,IAAI,IAAI,MAAM,CAAC,CAAC,CAAC;IAI1B,WAAW,IAAI,MAAM,CAAC,CAAC,CAAC,GAAG,WAAW,CAAC,CAAC,CAAC;IAqCzC,IAAI,IAAI,IAAI,MAAM,CAEjB;IAED,IAAI,OAAO,IAAI,UAAU,CAAC,SAAS,CAAC,CAEnC;IAED,IAAI,OAAO,IAAI,MAAM,GAAG,SAAS,CAEhC;IAED,IAAI,WAAW,IAAI,MAAM,GAAG,SAAS,CAEpC;CACF;AAED,MAAM,MAAM,gBAAgB,GACxB,SAAS,GACT,WAAW,GACX,YAAY,GACZ,UAAU,GACV,cAAc,GACd,SAAS,CAAA;AAEb,MAAM,MAAM,WAAW,CAAC,CAAC,SAAS,UAAU,CAAC,SAAS,CAAC,IAAI,OAAO,CAChE,gBAAgB,EAChB;IAAE,OAAO,EAAE,CAAC,CAAA;CAAE,CACf,CAAA"}
|