@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,20 +1,10 @@
|
|
|
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
|
export type DiscriminatorFields = {
|
|
5
2
|
propertyName: string;
|
|
6
3
|
};
|
|
7
|
-
|
|
8
|
-
fields: DiscriminatorFields;
|
|
9
|
-
trail: Trail;
|
|
10
|
-
skipped: Record<string, unknown>;
|
|
11
|
-
context: CoreContext;
|
|
12
|
-
};
|
|
13
|
-
export declare class OasDiscriminator extends OasBase {
|
|
4
|
+
export declare class OasDiscriminator {
|
|
14
5
|
#private;
|
|
15
6
|
oasType: 'discriminator';
|
|
16
|
-
constructor(
|
|
7
|
+
constructor(fields: DiscriminatorFields);
|
|
17
8
|
get propertyName(): string;
|
|
18
9
|
}
|
|
19
|
-
export {};
|
|
20
10
|
//# sourceMappingURL=Discriminator.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Discriminator.d.ts","sourceRoot":"","sources":["../../../src/oas/discriminator/Discriminator.ts"],"names":[],"mappings":"AAAA,
|
|
1
|
+
{"version":3,"file":"Discriminator.d.ts","sourceRoot":"","sources":["../../../src/oas/discriminator/Discriminator.ts"],"names":[],"mappings":"AAAA,MAAM,MAAM,mBAAmB,GAAG;IAChC,YAAY,EAAE,MAAM,CAAA;CACrB,CAAA;AAED,qBAAa,gBAAgB;;IAC3B,OAAO,EAAE,eAAe,CAAkB;gBAG9B,MAAM,EAAE,mBAAmB;IAIvC,IAAI,YAAY,IAAI,MAAM,CAEzB;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 _OasDiscriminator_fields;
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
constructor({ fields, trail, skipped, context }) {
|
|
16
|
-
super({ trail, skipped, context });
|
|
13
|
+
export class OasDiscriminator {
|
|
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 { OasDiscriminator } from './Discriminator.js';
|
|
5
4
|
type ToDiscriminatorV3Args = {
|
|
6
5
|
discriminator: OpenAPIV3.DiscriminatorObject | undefined;
|
|
7
|
-
|
|
8
|
-
context: CoreContext;
|
|
6
|
+
context: ParseContext;
|
|
9
7
|
};
|
|
10
|
-
export declare const toDiscriminatorV3: ({ discriminator,
|
|
8
|
+
export declare const toDiscriminatorV3: ({ discriminator, context }: ToDiscriminatorV3Args) => OasDiscriminator | undefined;
|
|
11
9
|
export {};
|
|
12
10
|
//# sourceMappingURL=toDiscriminatorV3.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"toDiscriminatorV3.d.ts","sourceRoot":"","sources":["../../../src/oas/discriminator/toDiscriminatorV3.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,eAAe,CAAA;AAC9C,OAAO,KAAK,EAAE,
|
|
1
|
+
{"version":3,"file":"toDiscriminatorV3.d.ts","sourceRoot":"","sources":["../../../src/oas/discriminator/toDiscriminatorV3.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,gBAAgB,EAAE,MAAM,oBAAoB,CAAA;AAGrD,KAAK,qBAAqB,GAAG;IAC3B,aAAa,EAAE,SAAS,CAAC,mBAAmB,GAAG,SAAS,CAAA;IACxD,OAAO,EAAE,YAAY,CAAA;CACtB,CAAA;AAED,eAAO,MAAM,iBAAiB,+BAG3B,qBAAqB,KAAG,gBAAgB,GAAG,SAc7C,CAAA"}
|
|
@@ -1,11 +1,12 @@
|
|
|
1
1
|
import { OasDiscriminator } from './Discriminator.js';
|
|
2
|
-
export const toDiscriminatorV3 = ({ discriminator,
|
|
2
|
+
export const toDiscriminatorV3 = ({ discriminator, context }) => {
|
|
3
3
|
if (!discriminator) {
|
|
4
4
|
return undefined;
|
|
5
5
|
}
|
|
6
6
|
const { propertyName, ...skipped } = discriminator;
|
|
7
|
+
context.logSkippedFields(skipped);
|
|
7
8
|
const fields = {
|
|
8
9
|
propertyName
|
|
9
10
|
};
|
|
10
|
-
return new OasDiscriminator(
|
|
11
|
+
return new OasDiscriminator(fields);
|
|
11
12
|
};
|
|
@@ -1,6 +1,3 @@
|
|
|
1
|
-
import type { CoreContext } from '../../context/CoreContext.js';
|
|
2
|
-
import type { Trail } from '../../context/Trail.js';
|
|
3
|
-
import { OasBase } from '../../dsl/OasBase.js';
|
|
4
1
|
import type { OasTag } from '../tag/Tag.js';
|
|
5
2
|
import type { OasComponents } from '../components/Components.js';
|
|
6
3
|
import type { OasOperation } from '../operation/Operation.js';
|
|
@@ -12,18 +9,13 @@ export type DocumentFields = {
|
|
|
12
9
|
components: OasComponents | undefined;
|
|
13
10
|
tags: OasTag[] | undefined;
|
|
14
11
|
};
|
|
15
|
-
type ToDocumentV3Args = {
|
|
16
|
-
fields: DocumentFields;
|
|
17
|
-
trail: Trail;
|
|
18
|
-
skipped: Record<string, unknown>;
|
|
19
|
-
context: CoreContext;
|
|
20
|
-
};
|
|
21
12
|
/** Top level document object describing the API */
|
|
22
|
-
export declare class OasDocument
|
|
13
|
+
export declare class OasDocument {
|
|
23
14
|
#private;
|
|
24
15
|
/** Static identifier property for OasDocument */
|
|
25
16
|
oasType: 'openapi';
|
|
26
|
-
constructor(
|
|
17
|
+
constructor(fields?: DocumentFields);
|
|
18
|
+
set fields(fields: DocumentFields);
|
|
27
19
|
/** OpenAPI specification version */
|
|
28
20
|
get openapi(): string;
|
|
29
21
|
/** API metadata */
|
|
@@ -35,5 +27,4 @@ export declare class OasDocument extends OasBase {
|
|
|
35
27
|
/** List of tags used by API with additional metadata */
|
|
36
28
|
get tags(): OasTag[] | undefined;
|
|
37
29
|
}
|
|
38
|
-
export {};
|
|
39
30
|
//# sourceMappingURL=Document.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Document.d.ts","sourceRoot":"","sources":["../../../src/oas/document/Document.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,
|
|
1
|
+
{"version":3,"file":"Document.d.ts","sourceRoot":"","sources":["../../../src/oas/document/Document.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,eAAe,CAAA;AAC3C,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,6BAA6B,CAAA;AAChE,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,2BAA2B,CAAA;AAC7D,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,iBAAiB,CAAA;AAE9C,MAAM,MAAM,cAAc,GAAG;IAC3B,OAAO,EAAE,MAAM,CAAA;IACf,IAAI,EAAE,OAAO,CAAA;IACb,UAAU,EAAE,YAAY,EAAE,CAAA;IAC1B,UAAU,EAAE,aAAa,GAAG,SAAS,CAAA;IACrC,IAAI,EAAE,MAAM,EAAE,GAAG,SAAS,CAAA;CAC3B,CAAA;AAED,mDAAmD;AACnD,qBAAa,WAAW;;IACtB,iDAAiD;IACjD,OAAO,EAAE,SAAS,CAAY;gBAIlB,MAAM,CAAC,EAAE,cAAc;IAInC,IAAI,MAAM,CAAC,MAAM,EAAE,cAAc,EAEhC;IAED,oCAAoC;IACpC,IAAI,OAAO,IAAI,MAAM,CAMpB;IAED,mBAAmB;IACnB,IAAI,IAAI,IAAI,OAAO,CAMlB;IAED,yCAAyC;IACzC,IAAI,UAAU,IAAI,YAAY,EAAE,CAM/B;IAED,iEAAiE;IACjE,IAAI,UAAU,IAAI,aAAa,GAAG,SAAS,CAM1C;IAED,wDAAwD;IACxD,IAAI,IAAI,IAAI,MAAM,EAAE,GAAG,SAAS,CAM/B;CACF"}
|
|
@@ -10,11 +10,9 @@ 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 _OasDocument_fields;
|
|
13
|
-
import { OasBase } from '../../dsl/OasBase.js';
|
|
14
13
|
/** Top level document object describing the API */
|
|
15
|
-
export class OasDocument
|
|
16
|
-
constructor(
|
|
17
|
-
super({ trail, skipped, context });
|
|
14
|
+
export class OasDocument {
|
|
15
|
+
constructor(fields) {
|
|
18
16
|
/** Static identifier property for OasDocument */
|
|
19
17
|
Object.defineProperty(this, "oasType", {
|
|
20
18
|
enumerable: true,
|
|
@@ -26,24 +24,42 @@ export class OasDocument extends OasBase {
|
|
|
26
24
|
_OasDocument_fields.set(this, void 0);
|
|
27
25
|
__classPrivateFieldSet(this, _OasDocument_fields, fields, "f");
|
|
28
26
|
}
|
|
27
|
+
set fields(fields) {
|
|
28
|
+
__classPrivateFieldSet(this, _OasDocument_fields, fields, "f");
|
|
29
|
+
}
|
|
29
30
|
/** OpenAPI specification version */
|
|
30
31
|
get openapi() {
|
|
32
|
+
if (!__classPrivateFieldGet(this, _OasDocument_fields, "f")) {
|
|
33
|
+
throw new Error(`Accessing 'openapi' before fields are set`);
|
|
34
|
+
}
|
|
31
35
|
return __classPrivateFieldGet(this, _OasDocument_fields, "f").openapi;
|
|
32
36
|
}
|
|
33
37
|
/** API metadata */
|
|
34
38
|
get info() {
|
|
39
|
+
if (!__classPrivateFieldGet(this, _OasDocument_fields, "f")) {
|
|
40
|
+
throw new Error(`Accessing 'info' before fields are set`);
|
|
41
|
+
}
|
|
35
42
|
return __classPrivateFieldGet(this, _OasDocument_fields, "f").info;
|
|
36
43
|
}
|
|
37
44
|
/** List of all operations for the API */
|
|
38
45
|
get operations() {
|
|
46
|
+
if (!__classPrivateFieldGet(this, _OasDocument_fields, "f")) {
|
|
47
|
+
throw new Error(`Accessing 'operations' before fields are set`);
|
|
48
|
+
}
|
|
39
49
|
return __classPrivateFieldGet(this, _OasDocument_fields, "f").operations;
|
|
40
50
|
}
|
|
41
51
|
/** Container object for re-usable schema items within the API */
|
|
42
52
|
get components() {
|
|
53
|
+
if (!__classPrivateFieldGet(this, _OasDocument_fields, "f")) {
|
|
54
|
+
throw new Error(`Accessing 'components' before fields are set`);
|
|
55
|
+
}
|
|
43
56
|
return __classPrivateFieldGet(this, _OasDocument_fields, "f").components;
|
|
44
57
|
}
|
|
45
58
|
/** List of tags used by API with additional metadata */
|
|
46
59
|
get tags() {
|
|
60
|
+
if (!__classPrivateFieldGet(this, _OasDocument_fields, "f")) {
|
|
61
|
+
throw new Error(`Accessing 'tags' before fields are set`);
|
|
62
|
+
}
|
|
47
63
|
return __classPrivateFieldGet(this, _OasDocument_fields, "f").tags;
|
|
48
64
|
}
|
|
49
65
|
}
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import type { OpenAPIV3 } from 'openapi-types';
|
|
2
|
+
import type { ParseContext } from '../../context/ParseContext.js';
|
|
3
|
+
import type { DocumentFields } from './Document.js';
|
|
4
|
+
type ToDocumentV3Args = {
|
|
5
|
+
document: OpenAPIV3.Document;
|
|
6
|
+
context: ParseContext;
|
|
7
|
+
};
|
|
8
|
+
export declare const toDocumentFieldsV3: ({ document, context }: ToDocumentV3Args) => DocumentFields;
|
|
9
|
+
export {};
|
|
10
|
+
//# sourceMappingURL=toDocumentFieldsV3.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"toDocumentFieldsV3.d.ts","sourceRoot":"","sources":["../../../src/oas/document/toDocumentFieldsV3.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,eAAe,CAAA;AAC9C,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,+BAA+B,CAAA;AAKjE,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,eAAe,CAAA;AAGnD,KAAK,gBAAgB,GAAG;IACtB,QAAQ,EAAE,SAAS,CAAC,QAAQ,CAAA;IAC5B,OAAO,EAAE,YAAY,CAAA;CACtB,CAAA;AAED,eAAO,MAAM,kBAAkB,0BAG5B,gBAAgB,KAAG,cAkBrB,CAAA"}
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import { toTagsV3 } from '../tag/toTagsV3.js';
|
|
2
|
+
import { toOperationsV3 } from '../operation/toOperationsV3.js';
|
|
3
|
+
import { toComponentsV3 } from '../components/toComponentsV3.js';
|
|
4
|
+
import { toInfoV3 } from '../info/toInfoV3.js';
|
|
5
|
+
import { tracer } from '../../helpers/tracer.js';
|
|
6
|
+
export const toDocumentFieldsV3 = ({ document, context }) => {
|
|
7
|
+
const { openapi, info, paths, components, tags, ...skipped } = document;
|
|
8
|
+
context.logSkippedFields(skipped);
|
|
9
|
+
const fields = {
|
|
10
|
+
openapi,
|
|
11
|
+
info: tracer(context, 'info', () => toInfoV3({ info, context })),
|
|
12
|
+
operations: tracer(context, 'paths', () => toOperationsV3({ paths, context })),
|
|
13
|
+
components: tracer(context, 'components', () => toComponentsV3({ components, context })),
|
|
14
|
+
tags: tracer(context, 'tags', () => toTagsV3({ tags, context }))
|
|
15
|
+
};
|
|
16
|
+
return fields;
|
|
17
|
+
};
|
|
@@ -1,24 +1,15 @@
|
|
|
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 { OasRef } from '../ref/Ref.js';
|
|
5
2
|
export type ExampleFields = {
|
|
6
3
|
summary: string | undefined;
|
|
7
4
|
description: string | undefined;
|
|
8
5
|
value: unknown;
|
|
9
6
|
};
|
|
10
|
-
type ToExampleV3Args = {
|
|
11
|
-
fields: ExampleFields;
|
|
12
|
-
trail: Trail;
|
|
13
|
-
context: CoreContext;
|
|
14
|
-
skipped: Record<string, unknown>;
|
|
15
|
-
};
|
|
16
7
|
/** Provides example data represented by schema */
|
|
17
|
-
export declare class OasExample
|
|
8
|
+
export declare class OasExample {
|
|
18
9
|
#private;
|
|
19
10
|
/** Static identifier property for OasExample */
|
|
20
11
|
oasType: 'example';
|
|
21
|
-
constructor(
|
|
12
|
+
constructor(fields: ExampleFields);
|
|
22
13
|
/** Brief summary of example */
|
|
23
14
|
get summary(): string | undefined;
|
|
24
15
|
/** Detailed description of the example. May contain CommonMark Markdown */
|
|
@@ -31,5 +22,4 @@ export declare class OasExample extends OasBase {
|
|
|
31
22
|
resolve(): OasExample;
|
|
32
23
|
resolveOnce(): OasExample;
|
|
33
24
|
}
|
|
34
|
-
export {};
|
|
35
25
|
//# sourceMappingURL=Example.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Example.d.ts","sourceRoot":"","sources":["../../../src/oas/example/Example.ts"],"names":[],"mappings":"AAAA,OAAO,
|
|
1
|
+
{"version":3,"file":"Example.d.ts","sourceRoot":"","sources":["../../../src/oas/example/Example.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,eAAe,CAAA;AAE3C,MAAM,MAAM,aAAa,GAAG;IAC1B,OAAO,EAAE,MAAM,GAAG,SAAS,CAAA;IAC3B,WAAW,EAAE,MAAM,GAAG,SAAS,CAAA;IAC/B,KAAK,EAAE,OAAO,CAAA;CACf,CAAA;AAED,kDAAkD;AAClD,qBAAa,UAAU;;IACrB,gDAAgD;IAChD,OAAO,EAAE,SAAS,CAAY;gBAIlB,MAAM,EAAE,aAAa;IAIjC,+BAA+B;IAC/B,IAAI,OAAO,IAAI,MAAM,GAAG,SAAS,CAEhC;IAED,2EAA2E;IAC3E,IAAI,WAAW,IAAI,MAAM,GAAG,SAAS,CAEpC;IAED,6BAA6B;IAE7B,IAAI,KAAK,IAAI,OAAO,CAEnB;IAED,4CAA4C;IAC5C,KAAK,IAAI,IAAI,IAAI,MAAM,CAAC,SAAS,CAAC;IAIlC,qBAAqB;IACrB,OAAO,IAAI,UAAU;IAIrB,WAAW,IAAI,UAAU;CAG1B"}
|
|
@@ -10,11 +10,9 @@ 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 _OasExample_fields;
|
|
13
|
-
import { OasBase } from '../../dsl/OasBase.js';
|
|
14
13
|
/** Provides example data represented by schema */
|
|
15
|
-
export class OasExample
|
|
16
|
-
constructor(
|
|
17
|
-
super({ trail, skipped, context });
|
|
14
|
+
export class OasExample {
|
|
15
|
+
constructor(fields) {
|
|
18
16
|
/** Static identifier property for OasExample */
|
|
19
17
|
Object.defineProperty(this, "oasType", {
|
|
20
18
|
enumerable: true,
|
|
@@ -1,27 +1,22 @@
|
|
|
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 { OasExample } from './Example.js';
|
|
5
4
|
import type { OasRef } from '../ref/Ref.js';
|
|
6
5
|
type ToExampleSimpleV3Args = {
|
|
7
6
|
example: unknown;
|
|
8
|
-
trail: Trail;
|
|
9
|
-
context: CoreContext;
|
|
10
7
|
};
|
|
11
|
-
export declare const toExampleSimpleV3: ({ example
|
|
8
|
+
export declare const toExampleSimpleV3: ({ example }: ToExampleSimpleV3Args) => OasExample | OasRef<"example">;
|
|
12
9
|
export type ToExamplesV3Args = {
|
|
13
10
|
example: OpenAPIV3.ExampleObject | undefined;
|
|
14
11
|
examples: Record<string, OpenAPIV3.ExampleObject | OpenAPIV3.ReferenceObject> | undefined;
|
|
15
12
|
exampleKey: string;
|
|
16
|
-
|
|
17
|
-
context: CoreContext;
|
|
13
|
+
context: ParseContext;
|
|
18
14
|
};
|
|
19
|
-
export declare const toExamplesV3: ({ example, examples, exampleKey,
|
|
15
|
+
export declare const toExamplesV3: ({ example, examples, exampleKey, context }: ToExamplesV3Args) => Record<string, OasExample | OasRef<"example">> | undefined;
|
|
20
16
|
type ToExampleV3Args = {
|
|
21
17
|
example: OpenAPIV3.ExampleObject | OpenAPIV3.ReferenceObject;
|
|
22
|
-
|
|
23
|
-
context: CoreContext;
|
|
18
|
+
context: ParseContext;
|
|
24
19
|
};
|
|
25
|
-
export declare const toExampleV3: ({ example,
|
|
20
|
+
export declare const toExampleV3: ({ example, context }: ToExampleV3Args) => OasExample | OasRef<"example">;
|
|
26
21
|
export {};
|
|
27
22
|
//# sourceMappingURL=toExamplesV3.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"toExamplesV3.d.ts","sourceRoot":"","sources":["../../../src/oas/example/toExamplesV3.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,
|
|
1
|
+
{"version":3,"file":"toExamplesV3.d.ts","sourceRoot":"","sources":["../../../src/oas/example/toExamplesV3.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,+BAA+B,CAAA;AACjE,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,eAAe,CAAA;AAG9C,OAAO,EAAE,UAAU,EAAE,MAAM,cAAc,CAAA;AAEzC,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,eAAe,CAAA;AAG3C,KAAK,qBAAqB,GAAG;IAC3B,OAAO,EAAE,OAAO,CAAA;CACjB,CAAA;AAED,eAAO,MAAM,iBAAiB,gBAE3B,qBAAqB,KAAG,UAAU,GAAG,MAAM,CAAC,SAAS,CAQvD,CAAA;AAED,MAAM,MAAM,gBAAgB,GAAG;IAC7B,OAAO,EAAE,SAAS,CAAC,aAAa,GAAG,SAAS,CAAA;IAC5C,QAAQ,EACJ,MAAM,CAAC,MAAM,EAAE,SAAS,CAAC,aAAa,GAAG,SAAS,CAAC,eAAe,CAAC,GACnE,SAAS,CAAA;IACb,UAAU,EAAE,MAAM,CAAA;IAClB,OAAO,EAAE,YAAY,CAAA;CACtB,CAAA;AAED,eAAO,MAAM,YAAY,+CAKtB,gBAAgB,KACf,MAAM,CAAC,MAAM,EAAE,UAAU,GAAG,MAAM,CAAC,SAAS,CAAC,CAAC,GAC9C,SA6BH,CAAA;AAED,KAAK,eAAe,GAAG;IACrB,OAAO,EAAE,SAAS,CAAC,aAAa,GAAG,SAAS,CAAC,eAAe,CAAA;IAC5D,OAAO,EAAE,YAAY,CAAA;CACtB,CAAA;AAED,eAAO,MAAM,WAAW,yBAGrB,eAAe,KAAG,UAAU,GAAG,MAAM,CAAC,SAAS,CAgBjD,CAAA"}
|
|
@@ -1,45 +1,46 @@
|
|
|
1
1
|
import { isRef } from '../../helpers/refFns.js';
|
|
2
2
|
import { toRefV31 } from '../ref/toRefV31.js';
|
|
3
3
|
import { OasExample } from './Example.js';
|
|
4
|
-
|
|
4
|
+
import { tracer } from '../../helpers/tracer.js';
|
|
5
|
+
export const toExampleSimpleV3 = ({ example }) => {
|
|
5
6
|
const fields = {
|
|
6
7
|
value: example,
|
|
7
8
|
summary: undefined,
|
|
8
9
|
description: undefined
|
|
9
10
|
};
|
|
10
|
-
return new OasExample(
|
|
11
|
+
return new OasExample(fields);
|
|
11
12
|
};
|
|
12
|
-
export const toExamplesV3 = ({ example, examples, exampleKey,
|
|
13
|
+
export const toExamplesV3 = ({ example, examples, exampleKey, context }) => {
|
|
13
14
|
if (example && examples) {
|
|
14
|
-
context.logger.warn(
|
|
15
|
-
trail: trail.toString(),
|
|
16
|
-
message: `Both example and examples are defined for ${exampleKey}`
|
|
17
|
-
}));
|
|
15
|
+
context.logger.warn(`Both example and examples are defined for ${exampleKey}`);
|
|
18
16
|
}
|
|
19
17
|
if (example) {
|
|
20
18
|
return {
|
|
21
|
-
[exampleKey]:
|
|
19
|
+
[exampleKey]: tracer(context, 'example', () => toExampleSimpleV3({ example }))
|
|
22
20
|
};
|
|
23
21
|
}
|
|
24
22
|
if (examples) {
|
|
25
|
-
|
|
26
|
-
return [
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
23
|
+
tracer(context, 'examples', () => {
|
|
24
|
+
return Object.fromEntries(Object.entries(examples).map(([key, value]) => {
|
|
25
|
+
return [
|
|
26
|
+
key,
|
|
27
|
+
tracer(context, key, () => toExampleV3({ example: value, context }))
|
|
28
|
+
];
|
|
29
|
+
}));
|
|
30
|
+
});
|
|
31
31
|
}
|
|
32
32
|
return undefined;
|
|
33
33
|
};
|
|
34
|
-
export const toExampleV3 = ({ example,
|
|
34
|
+
export const toExampleV3 = ({ example, context }) => {
|
|
35
35
|
if (isRef(example)) {
|
|
36
|
-
return toRefV31({ ref: example, refType: 'example',
|
|
36
|
+
return toRefV31({ ref: example, refType: 'example', context });
|
|
37
37
|
}
|
|
38
38
|
const { summary, description, value, ...skipped } = example;
|
|
39
|
+
context.logSkippedFields(skipped);
|
|
39
40
|
const fields = {
|
|
40
41
|
summary,
|
|
41
42
|
description,
|
|
42
43
|
value
|
|
43
44
|
};
|
|
44
|
-
return new OasExample(
|
|
45
|
+
return new OasExample(fields);
|
|
45
46
|
};
|
|
@@ -1,6 +1,3 @@
|
|
|
1
|
-
import type { CoreContext } from '../../context/CoreContext.js';
|
|
2
|
-
import type { Trail } from '../../context/Trail.js';
|
|
3
|
-
import { OasBase } from '../../dsl/OasBase.js';
|
|
4
1
|
import type { OasMediaType } from '../mediaType/MediaType.js';
|
|
5
2
|
import type { OasRef } from '../ref/Ref.js';
|
|
6
3
|
import type { OasExample } from '../example/Example.js';
|
|
@@ -13,17 +10,11 @@ export type HeaderFields = {
|
|
|
13
10
|
examples: Record<string, OasExample | OasRef<'example'>> | undefined;
|
|
14
11
|
content: Record<string, OasMediaType> | undefined;
|
|
15
12
|
};
|
|
16
|
-
type ToHeaderV3Args = {
|
|
17
|
-
fields: HeaderFields;
|
|
18
|
-
trail: Trail;
|
|
19
|
-
skipped: Record<string, unknown>;
|
|
20
|
-
context: CoreContext;
|
|
21
|
-
};
|
|
22
13
|
/** Describes a single header in the API */
|
|
23
|
-
export declare class OasHeader
|
|
14
|
+
export declare class OasHeader {
|
|
24
15
|
#private;
|
|
25
16
|
oasType: 'header';
|
|
26
|
-
constructor(
|
|
17
|
+
constructor(fields: HeaderFields);
|
|
27
18
|
/** Brief description of header */
|
|
28
19
|
get description(): string | undefined;
|
|
29
20
|
/** Indicates if header is mandatory. Default value is `false` */
|
|
@@ -48,5 +39,4 @@ export declare class OasHeader extends OasBase {
|
|
|
48
39
|
*/
|
|
49
40
|
toSchema(mediaType?: string): OasSchema | OasRef<'schema'> | undefined;
|
|
50
41
|
}
|
|
51
|
-
export {};
|
|
52
42
|
//# sourceMappingURL=Header.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Header.d.ts","sourceRoot":"","sources":["../../../src/oas/header/Header.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,
|
|
1
|
+
{"version":3,"file":"Header.d.ts","sourceRoot":"","sources":["../../../src/oas/header/Header.ts"],"names":[],"mappings":"AAAA,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;AAEpD,MAAM,MAAM,YAAY,GAAG;IACzB,WAAW,EAAE,MAAM,GAAG,SAAS,CAAA;IAC/B,QAAQ,EAAE,OAAO,GAAG,SAAS,CAAA;IAC7B,UAAU,EAAE,OAAO,GAAG,SAAS,CAAA;IAC/B,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;CAClD,CAAA;AAED,2CAA2C;AAC3C,qBAAa,SAAS;;IACpB,OAAO,EAAE,QAAQ,CAAW;gBAGhB,MAAM,EAAE,YAAY;IAIhC,kCAAkC;IAClC,IAAI,WAAW,IAAI,MAAM,GAAG,SAAS,CAEpC;IAED,iEAAiE;IACjE,IAAI,QAAQ,IAAI,OAAO,GAAG,SAAS,CAElC;IAED,6FAA6F;IAC7F,IAAI,UAAU,IAAI,OAAO,GAAG,SAAS,CAEpC;IAED,4BAA4B;IAC5B,IAAI,MAAM,IAAI,SAAS,GAAG,MAAM,CAAC,QAAQ,CAAC,GAAG,SAAS,CAErD;IAED,6BAA6B;IAC7B,IAAI,QAAQ,IAAI,MAAM,CAAC,MAAM,EAAE,UAAU,GAAG,MAAM,CAAC,SAAS,CAAC,CAAC,GAAG,SAAS,CAEzE;IAED,4BAA4B;IAC5B,IAAI,OAAO,IAAI,MAAM,CAAC,MAAM,EAAE,YAAY,CAAC,GAAG,SAAS,CAEtD;IAED,4CAA4C;IAC5C,KAAK,IAAI,IAAI,IAAI,MAAM,CAAC,QAAQ,CAAC;IAIjC,qBAAqB;IACrB,OAAO,IAAI,SAAS;IAIpB,WAAW,IAAI,SAAS;IAIxB;;;;OAIG;IACH,QAAQ,CACN,SAAS,GAAE,MAA2B,GACrC,SAAS,GAAG,MAAM,CAAC,QAAQ,CAAC,GAAG,SAAS;CAO5C"}
|
package/esm/oas/header/Header.js
CHANGED
|
@@ -10,11 +10,9 @@ 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 _OasHeader_fields;
|
|
13
|
-
import { OasBase } from '../../dsl/OasBase.js';
|
|
14
13
|
/** Describes a single header in the API */
|
|
15
|
-
export class OasHeader
|
|
16
|
-
constructor(
|
|
17
|
-
super({ trail, skipped, context });
|
|
14
|
+
export class OasHeader {
|
|
15
|
+
constructor(fields) {
|
|
18
16
|
Object.defineProperty(this, "oasType", {
|
|
19
17
|
enumerable: true,
|
|
20
18
|
configurable: true,
|
|
@@ -1,13 +1,11 @@
|
|
|
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 { OasHeader } from './Header.js';
|
|
5
4
|
import type { OasRef } from '../ref/Ref.js';
|
|
6
5
|
type ToHeadersV3Args = {
|
|
7
6
|
headers: Record<string, OpenAPIV3.ReferenceObject | OpenAPIV3.HeaderObject> | undefined;
|
|
8
|
-
|
|
9
|
-
context: CoreContext;
|
|
7
|
+
context: ParseContext;
|
|
10
8
|
};
|
|
11
|
-
export declare const toHeadersV3: ({ headers,
|
|
9
|
+
export declare const toHeadersV3: ({ headers, context }: ToHeadersV3Args) => Record<string, OasHeader | OasRef<"header">> | undefined;
|
|
12
10
|
export {};
|
|
13
11
|
//# sourceMappingURL=toHeadersV3.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"toHeadersV3.d.ts","sourceRoot":"","sources":["../../../src/oas/header/toHeadersV3.ts"],"names":[],"mappings":"AAGA,OAAO,KAAK,EAAE,
|
|
1
|
+
{"version":3,"file":"toHeadersV3.d.ts","sourceRoot":"","sources":["../../../src/oas/header/toHeadersV3.ts"],"names":[],"mappings":"AAGA,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,+BAA+B,CAAA;AAEjE,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,eAAe,CAAA;AAE9C,OAAO,EAAE,SAAS,EAAE,MAAM,aAAa,CAAA;AAEvC,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,eAAe,CAAA;AAG3C,KAAK,eAAe,GAAG;IACrB,OAAO,EACH,MAAM,CAAC,MAAM,EAAE,SAAS,CAAC,eAAe,GAAG,SAAS,CAAC,YAAY,CAAC,GAClE,SAAS,CAAA;IACb,OAAO,EAAE,YAAY,CAAA;CACtB,CAAA;AAED,eAAO,MAAM,WAAW,yBAGrB,eAAe,KACd,MAAM,CAAC,MAAM,EAAE,SAAS,GAAG,MAAM,CAAC,QAAQ,CAAC,CAAC,GAC5C,SAaH,CAAA"}
|
|
@@ -4,39 +4,36 @@ import { toOptionalSchemaV3 } from '../schema/toSchemasV3.js';
|
|
|
4
4
|
import { isRef } from '../../helpers/refFns.js';
|
|
5
5
|
import { toOptionalMediaTypeItemsV3 } from '../mediaType/toMediaTypeItemV3.js';
|
|
6
6
|
import { OasHeader } from './Header.js';
|
|
7
|
-
|
|
7
|
+
import { tracer } from '../../helpers/tracer.js';
|
|
8
|
+
export const toHeadersV3 = ({ headers, context }) => {
|
|
8
9
|
if (!headers) {
|
|
9
10
|
return undefined;
|
|
10
11
|
}
|
|
11
12
|
return Object.fromEntries(Object.entries(headers).map(([key, value]) => {
|
|
12
13
|
return [
|
|
13
14
|
key,
|
|
14
|
-
toHeaderV3({ header: value,
|
|
15
|
+
tracer(context, key, () => toHeaderV3({ header: value, context }))
|
|
15
16
|
];
|
|
16
17
|
}));
|
|
17
18
|
};
|
|
18
|
-
const toHeaderV3 = ({ header,
|
|
19
|
+
const toHeaderV3 = ({ header, context }) => {
|
|
19
20
|
if (isRef(header)) {
|
|
20
|
-
return toRefV31({ ref: header, refType: 'header',
|
|
21
|
+
return toRefV31({ ref: header, refType: 'header', context });
|
|
21
22
|
}
|
|
22
23
|
const { description, required, deprecated, schema, example, examples, content, ...skipped } = header;
|
|
24
|
+
context.logSkippedFields(skipped);
|
|
23
25
|
const fields = {
|
|
24
26
|
description,
|
|
25
27
|
required,
|
|
26
28
|
deprecated,
|
|
27
|
-
schema:
|
|
29
|
+
schema: tracer(context, 'schema', () => toOptionalSchemaV3({ schema, context })),
|
|
28
30
|
examples: toExamplesV3({
|
|
29
31
|
examples,
|
|
30
32
|
example,
|
|
31
33
|
exampleKey: `TEMP`,
|
|
32
|
-
trail,
|
|
33
34
|
context
|
|
34
35
|
}),
|
|
35
|
-
content: toOptionalMediaTypeItemsV3({
|
|
36
|
-
content,
|
|
37
|
-
trail: trail.add('content'),
|
|
38
|
-
context
|
|
39
|
-
})
|
|
36
|
+
content: tracer(context, 'content', () => toOptionalMediaTypeItemsV3({ content, context }))
|
|
40
37
|
};
|
|
41
|
-
return new OasHeader(
|
|
38
|
+
return new OasHeader(fields);
|
|
42
39
|
};
|
package/esm/oas/info/Info.d.ts
CHANGED
|
@@ -1,8 +1,5 @@
|
|
|
1
|
-
import { OasBase } from '../../dsl/OasBase.js';
|
|
2
1
|
import type { OasLicenseData } from '../license/license-types.js';
|
|
3
2
|
import type { OasContactData } from '../contact/contact-types.js';
|
|
4
|
-
import type { Trail } from '../../context/Trail.js';
|
|
5
|
-
import type { CoreContext } from '../../context/CoreContext.js';
|
|
6
3
|
export type InfoFields = {
|
|
7
4
|
title: string;
|
|
8
5
|
version: string;
|
|
@@ -11,16 +8,10 @@ export type InfoFields = {
|
|
|
11
8
|
contact: OasContactData | undefined;
|
|
12
9
|
license: OasLicenseData | undefined;
|
|
13
10
|
};
|
|
14
|
-
|
|
15
|
-
fields: InfoFields;
|
|
16
|
-
trail: Trail;
|
|
17
|
-
context: CoreContext;
|
|
18
|
-
skipped: Record<string, unknown>;
|
|
19
|
-
};
|
|
20
|
-
export declare class OasInfo extends OasBase {
|
|
11
|
+
export declare class OasInfo {
|
|
21
12
|
#private;
|
|
22
13
|
oasType: 'info';
|
|
23
|
-
constructor(
|
|
14
|
+
constructor(fields: InfoFields);
|
|
24
15
|
get title(): string;
|
|
25
16
|
get description(): string | undefined;
|
|
26
17
|
get termsOfService(): string | undefined;
|
|
@@ -28,5 +19,4 @@ export declare class OasInfo extends OasBase {
|
|
|
28
19
|
get license(): OasLicenseData | undefined;
|
|
29
20
|
get version(): string;
|
|
30
21
|
}
|
|
31
|
-
export {};
|
|
32
22
|
//# sourceMappingURL=Info.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Info.d.ts","sourceRoot":"","sources":["../../../src/oas/info/Info.ts"],"names":[],"mappings":"AAAA,OAAO,
|
|
1
|
+
{"version":3,"file":"Info.d.ts","sourceRoot":"","sources":["../../../src/oas/info/Info.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,6BAA6B,CAAA;AACjE,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,6BAA6B,CAAA;AAEjE,MAAM,MAAM,UAAU,GAAG;IACvB,KAAK,EAAE,MAAM,CAAA;IACb,OAAO,EAAE,MAAM,CAAA;IACf,WAAW,EAAE,MAAM,GAAG,SAAS,CAAA;IAC/B,cAAc,EAAE,MAAM,GAAG,SAAS,CAAA;IAClC,OAAO,EAAE,cAAc,GAAG,SAAS,CAAA;IACnC,OAAO,EAAE,cAAc,GAAG,SAAS,CAAA;CACpC,CAAA;AAED,qBAAa,OAAO;;IAClB,OAAO,EAAE,MAAM,CAAS;gBAGZ,MAAM,EAAE,UAAU;IAI9B,IAAI,KAAK,IAAI,MAAM,CAElB;IAED,IAAI,WAAW,IAAI,MAAM,GAAG,SAAS,CAEpC;IAED,IAAI,cAAc,IAAI,MAAM,GAAG,SAAS,CAEvC;IAED,IAAI,OAAO,IAAI,cAAc,GAAG,SAAS,CAExC;IAED,IAAI,OAAO,IAAI,cAAc,GAAG,SAAS,CAExC;IAED,IAAI,OAAO,IAAI,MAAM,CAEpB;CACF"}
|
package/esm/oas/info/Info.js
CHANGED
|
@@ -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 _OasInfo_fields;
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
constructor({ fields, trail, skipped, context }) {
|
|
16
|
-
super({ trail, skipped, context });
|
|
13
|
+
export class OasInfo {
|
|
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 { CoreContext } from '../../context/CoreContext.js';
|
|
2
|
+
import type { ParseContext } from '../../context/ParseContext.js';
|
|
4
3
|
import { OasInfo } from './Info.js';
|
|
5
4
|
type ToInfoV3Args = {
|
|
6
5
|
info: OpenAPIV3.InfoObject;
|
|
7
|
-
|
|
8
|
-
context: CoreContext;
|
|
6
|
+
context: ParseContext;
|
|
9
7
|
};
|
|
10
|
-
export declare const toInfoV3: ({ info,
|
|
8
|
+
export declare const toInfoV3: ({ info, context }: ToInfoV3Args) => OasInfo;
|
|
11
9
|
export {};
|
|
12
10
|
//# sourceMappingURL=toInfoV3.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"toInfoV3.d.ts","sourceRoot":"","sources":["../../../src/oas/info/toInfoV3.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,eAAe,CAAA;AAC9C,OAAO,KAAK,EAAE,
|
|
1
|
+
{"version":3,"file":"toInfoV3.d.ts","sourceRoot":"","sources":["../../../src/oas/info/toInfoV3.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,eAAe,CAAA;AAC9C,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,+BAA+B,CAAA;AACjE,OAAO,EAAE,OAAO,EAAE,MAAM,WAAW,CAAA;AAGnC,KAAK,YAAY,GAAG;IAClB,IAAI,EAAE,SAAS,CAAC,UAAU,CAAA;IAC1B,OAAO,EAAE,YAAY,CAAA;CACtB,CAAA;AAED,eAAO,MAAM,QAAQ,sBAAuB,YAAY,KAAG,OAuB1D,CAAA"}
|
package/esm/oas/info/toInfoV3.js
CHANGED
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import { OasInfo } from './Info.js';
|
|
2
|
-
export const toInfoV3 = ({ info,
|
|
2
|
+
export const toInfoV3 = ({ info, context }) => {
|
|
3
3
|
const { title, description, termsOfService, contact, license, version, ...skipped } = info;
|
|
4
|
+
context.logSkippedFields(skipped);
|
|
4
5
|
const fields = {
|
|
5
6
|
title,
|
|
6
7
|
description,
|
|
@@ -9,7 +10,7 @@ export const toInfoV3 = ({ info, trail, context }) => {
|
|
|
9
10
|
license: license ? toLicense(license) : undefined,
|
|
10
11
|
version
|
|
11
12
|
};
|
|
12
|
-
return new OasInfo(
|
|
13
|
+
return new OasInfo(fields);
|
|
13
14
|
};
|
|
14
15
|
const toLicense = (license) => ({
|
|
15
16
|
oasType: 'license',
|