@skmtc/core 0.0.800 → 0.0.803
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/GenerateContext.d.ts +16 -3
- package/esm/context/GenerateContext.d.ts.map +1 -1
- package/esm/context/ParseContext.d.ts +3 -3
- package/esm/context/ParseContext.d.ts.map +1 -1
- package/esm/context/RenderContext.d.ts +153 -1
- package/esm/context/RenderContext.d.ts.map +1 -1
- package/esm/context/RenderContext.js +179 -0
- package/esm/context/types.d.ts +30 -0
- package/esm/context/types.d.ts.map +1 -1
- package/esm/dsl/model/ModelBase.d.ts +1 -1
- package/esm/dsl/model/ModelBase.d.ts.map +1 -1
- package/esm/dsl/model/ModelDriver.d.ts +62 -0
- package/esm/dsl/model/ModelDriver.d.ts.map +1 -1
- package/esm/dsl/model/ModelDriver.js +63 -1
- package/esm/dsl/model/toModelBase.d.ts +66 -0
- package/esm/dsl/model/toModelBase.d.ts.map +1 -1
- package/esm/dsl/model/toModelBase.js +46 -0
- package/esm/dsl/model/toModelEntry.d.ts +63 -0
- package/esm/dsl/model/toModelEntry.d.ts.map +1 -1
- package/esm/dsl/model/toModelEntry.js +63 -0
- package/esm/dsl/operation/OperationBase.d.ts +3 -3
- package/esm/dsl/operation/OperationBase.d.ts.map +1 -1
- package/esm/dsl/operation/OperationDriver.d.ts +84 -0
- package/esm/dsl/operation/OperationDriver.d.ts.map +1 -1
- package/esm/dsl/operation/OperationDriver.js +85 -1
- package/esm/dsl/operation/toOperationBase.d.ts +58 -0
- package/esm/dsl/operation/toOperationBase.d.ts.map +1 -1
- package/esm/dsl/operation/toOperationBase.js +46 -0
- package/esm/dsl/operation/toOperationEntry.d.ts +37 -0
- package/esm/dsl/operation/toOperationEntry.d.ts.map +1 -1
- package/esm/dsl/operation/toOperationEntry.js +28 -0
- package/esm/helpers/isEmpty.d.ts +1 -1
- package/esm/helpers/isEmpty.d.ts.map +1 -1
- package/esm/helpers/tracer.d.ts +1 -1
- package/esm/helpers/tracer.d.ts.map +1 -1
- package/esm/helpers/tracer.js +1 -1
- package/esm/mod.d.ts +52 -0
- package/esm/mod.d.ts.map +1 -1
- package/esm/mod.js +52 -0
- package/esm/oas/array/Array.d.ts +26 -0
- package/esm/oas/array/Array.d.ts.map +1 -1
- package/esm/oas/array/Array.js +26 -0
- package/esm/oas/array/array-types.d.ts +32 -11
- package/esm/oas/array/array-types.d.ts.map +1 -1
- package/esm/oas/array/array-types.js +16 -0
- package/esm/oas/array/toArray.d.ts +111 -0
- package/esm/oas/array/toArray.d.ts.map +1 -1
- package/esm/oas/array/toArray.js +115 -3
- package/esm/oas/boolean/Boolean.d.ts +26 -0
- package/esm/oas/boolean/Boolean.d.ts.map +1 -1
- package/esm/oas/boolean/Boolean.js +26 -0
- package/esm/oas/boolean/boolean-types.d.ts +1 -7
- package/esm/oas/boolean/boolean-types.d.ts.map +1 -1
- package/esm/oas/boolean/toBoolean.d.ts +57 -0
- package/esm/oas/boolean/toBoolean.d.ts.map +1 -1
- package/esm/oas/boolean/toBoolean.js +57 -0
- package/esm/oas/components/components-types.d.ts +19 -0
- package/esm/oas/components/components-types.d.ts.map +1 -0
- package/esm/oas/components/components-types.js +21 -0
- package/esm/oas/contact/contact-types.d.ts +9 -0
- package/esm/oas/contact/contact-types.d.ts.map +1 -0
- package/esm/oas/contact/contact-types.js +7 -0
- package/esm/oas/discriminator/discriminator-types.d.ts +1 -5
- package/esm/oas/discriminator/discriminator-types.d.ts.map +1 -1
- package/esm/oas/document/document-types.d.ts +16 -0
- package/esm/oas/document/document-types.d.ts.map +1 -0
- package/esm/oas/document/document-types.js +18 -0
- package/esm/oas/example/example-types.d.ts +1 -6
- package/esm/oas/example/example-types.d.ts.map +1 -1
- package/esm/oas/header/header-types.d.ts +50 -0
- package/esm/oas/header/header-types.d.ts.map +1 -0
- package/esm/oas/header/header-types.js +30 -0
- package/esm/oas/info/info-types.d.ts +14 -0
- package/esm/oas/info/info-types.d.ts.map +1 -0
- package/esm/oas/info/info-types.js +13 -0
- package/esm/oas/integer/integer-types.d.ts +3 -17
- package/esm/oas/integer/integer-types.d.ts.map +1 -1
- package/esm/oas/license/license-types.d.ts +9 -0
- package/esm/oas/license/license-types.d.ts.map +1 -0
- package/esm/oas/license/license-types.js +7 -0
- package/esm/oas/mediaType/mediaType-types.d.ts +1 -11
- package/esm/oas/mediaType/mediaType-types.d.ts.map +1 -1
- package/esm/oas/number/number-types.d.ts +2 -16
- package/esm/oas/number/number-types.d.ts.map +1 -1
- package/esm/oas/number/toNumber.d.ts +62 -0
- package/esm/oas/number/toNumber.d.ts.map +1 -1
- package/esm/oas/number/toNumber.js +62 -0
- package/esm/oas/operation/operation-types.d.ts +22 -0
- package/esm/oas/operation/operation-types.d.ts.map +1 -0
- package/esm/oas/operation/operation-types.js +35 -0
- package/esm/oas/parameter/Parameter.d.ts +47 -0
- package/esm/oas/parameter/Parameter.d.ts.map +1 -1
- package/esm/oas/parameter/Parameter.js +47 -0
- package/esm/oas/parameter/parameter-types.d.ts +3 -58
- package/esm/oas/parameter/parameter-types.d.ts.map +1 -1
- package/esm/oas/pathItem/pathItem-types.d.ts +12 -0
- package/esm/oas/pathItem/pathItem-types.d.ts.map +1 -0
- package/esm/oas/pathItem/pathItem-types.js +12 -0
- package/esm/oas/requestBody/requestBody-types.d.ts +10 -0
- package/esm/oas/requestBody/requestBody-types.d.ts.map +1 -0
- package/esm/oas/requestBody/requestBody-types.js +9 -0
- package/esm/oas/response/response-types.d.ts +12 -0
- package/esm/oas/response/response-types.d.ts.map +1 -0
- package/esm/oas/response/response-types.js +11 -0
- package/esm/oas/schema/toSchemasV3.js +2 -2
- package/esm/oas/server/toServerV3.d.ts.map +1 -1
- package/esm/oas/string/string-types.d.ts +2 -29
- package/esm/oas/string/string-types.d.ts.map +1 -1
- package/esm/oas/string/toString.d.ts +125 -1
- package/esm/oas/string/toString.d.ts.map +1 -1
- package/esm/oas/string/toString.js +119 -0
- package/esm/oas/tag/tag-types.d.ts +8 -0
- package/esm/oas/tag/tag-types.d.ts.map +1 -0
- package/esm/oas/tag/tag-types.js +8 -0
- package/esm/oas/union/union-types.d.ts +1 -12
- package/esm/oas/union/union-types.d.ts.map +1 -1
- package/esm/oas/unknown/unknown-types.d.ts +1 -7
- package/esm/oas/unknown/unknown-types.d.ts.map +1 -1
- package/esm/types/CustomValue.d.ts +58 -0
- package/esm/types/CustomValue.d.ts.map +1 -1
- package/esm/types/CustomValue.js +58 -0
- package/esm/types/DenoJson.d.ts +24 -0
- package/esm/types/DenoJson.d.ts.map +1 -1
- package/esm/types/DenoJson.js +12 -0
- package/esm/types/Enrichments.d.ts +103 -0
- package/esm/types/Enrichments.d.ts.map +1 -1
- package/esm/types/Enrichments.js +52 -0
- package/esm/types/GeneratedValue.d.ts +17 -0
- package/esm/types/GeneratedValue.d.ts.map +1 -1
- package/esm/types/Logger.d.ts +9 -0
- package/esm/types/Logger.d.ts.map +1 -0
- package/esm/types/Logger.js +1 -0
- package/esm/types/Preview.d.ts +37 -0
- package/esm/types/Preview.d.ts.map +1 -1
- package/esm/types/Preview.js +37 -0
- package/esm/types/Settings.d.ts +35 -0
- package/esm/types/Settings.d.ts.map +1 -1
- package/esm/types/Settings.js +27 -0
- package/esm/typescript/FunctionParameter.d.ts +4 -4
- package/esm/typescript/FunctionParameter.d.ts.map +1 -1
- package/esm/typescript/List.d.ts +40 -2
- package/esm/typescript/List.d.ts.map +1 -1
- package/esm/typescript/List.js +32 -0
- 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/GenerateContext.d.ts +16 -3
- package/script/context/GenerateContext.d.ts.map +1 -1
- package/script/context/ParseContext.d.ts +3 -3
- package/script/context/ParseContext.d.ts.map +1 -1
- package/script/context/RenderContext.d.ts +153 -1
- package/script/context/RenderContext.d.ts.map +1 -1
- package/script/context/RenderContext.js +179 -0
- package/script/context/types.d.ts +30 -0
- package/script/context/types.d.ts.map +1 -1
- package/script/dsl/model/ModelBase.d.ts +1 -1
- package/script/dsl/model/ModelBase.d.ts.map +1 -1
- package/script/dsl/model/ModelDriver.d.ts +62 -0
- package/script/dsl/model/ModelDriver.d.ts.map +1 -1
- package/script/dsl/model/ModelDriver.js +63 -1
- package/script/dsl/model/toModelBase.d.ts +66 -0
- package/script/dsl/model/toModelBase.d.ts.map +1 -1
- package/script/dsl/model/toModelBase.js +46 -0
- package/script/dsl/model/toModelEntry.d.ts +63 -0
- package/script/dsl/model/toModelEntry.d.ts.map +1 -1
- package/script/dsl/model/toModelEntry.js +63 -0
- package/script/dsl/operation/OperationBase.d.ts +3 -3
- package/script/dsl/operation/OperationBase.d.ts.map +1 -1
- package/script/dsl/operation/OperationDriver.d.ts +84 -0
- package/script/dsl/operation/OperationDriver.d.ts.map +1 -1
- package/script/dsl/operation/OperationDriver.js +85 -1
- package/script/dsl/operation/toOperationBase.d.ts +58 -0
- package/script/dsl/operation/toOperationBase.d.ts.map +1 -1
- package/script/dsl/operation/toOperationBase.js +46 -0
- package/script/dsl/operation/toOperationEntry.d.ts +37 -0
- package/script/dsl/operation/toOperationEntry.d.ts.map +1 -1
- package/script/dsl/operation/toOperationEntry.js +28 -0
- package/script/helpers/isEmpty.d.ts +1 -1
- package/script/helpers/isEmpty.d.ts.map +1 -1
- package/script/helpers/tracer.d.ts +1 -1
- package/script/helpers/tracer.d.ts.map +1 -1
- package/script/helpers/tracer.js +1 -1
- package/script/mod.d.ts +52 -0
- package/script/mod.d.ts.map +1 -1
- package/script/mod.js +52 -0
- package/script/oas/array/Array.d.ts +26 -0
- package/script/oas/array/Array.d.ts.map +1 -1
- package/script/oas/array/Array.js +26 -0
- package/script/oas/array/array-types.d.ts +32 -11
- package/script/oas/array/array-types.d.ts.map +1 -1
- package/script/oas/array/array-types.js +17 -1
- package/script/oas/array/toArray.d.ts +111 -0
- package/script/oas/array/toArray.d.ts.map +1 -1
- package/script/oas/array/toArray.js +114 -2
- package/script/oas/boolean/Boolean.d.ts +26 -0
- package/script/oas/boolean/Boolean.d.ts.map +1 -1
- package/script/oas/boolean/Boolean.js +26 -0
- package/script/oas/boolean/boolean-types.d.ts +1 -7
- package/script/oas/boolean/boolean-types.d.ts.map +1 -1
- package/script/oas/boolean/toBoolean.d.ts +57 -0
- package/script/oas/boolean/toBoolean.d.ts.map +1 -1
- package/script/oas/boolean/toBoolean.js +57 -0
- package/script/oas/components/components-types.d.ts +19 -0
- package/script/oas/components/components-types.d.ts.map +1 -0
- package/script/oas/components/components-types.js +57 -0
- package/script/oas/contact/contact-types.d.ts +9 -0
- package/script/oas/contact/contact-types.d.ts.map +1 -0
- package/script/oas/contact/contact-types.js +43 -0
- package/script/oas/discriminator/discriminator-types.d.ts +1 -5
- package/script/oas/discriminator/discriminator-types.d.ts.map +1 -1
- package/script/oas/document/document-types.d.ts +16 -0
- package/script/oas/document/document-types.d.ts.map +1 -0
- package/script/oas/document/document-types.js +54 -0
- package/script/oas/example/example-types.d.ts +1 -6
- package/script/oas/example/example-types.d.ts.map +1 -1
- package/script/oas/header/header-types.d.ts +50 -0
- package/script/oas/header/header-types.d.ts.map +1 -0
- package/script/oas/header/header-types.js +66 -0
- package/script/oas/info/info-types.d.ts +14 -0
- package/script/oas/info/info-types.d.ts.map +1 -0
- package/script/oas/info/info-types.js +49 -0
- package/script/oas/integer/integer-types.d.ts +3 -17
- package/script/oas/integer/integer-types.d.ts.map +1 -1
- package/script/oas/license/license-types.d.ts +9 -0
- package/script/oas/license/license-types.d.ts.map +1 -0
- package/script/oas/license/license-types.js +43 -0
- package/script/oas/mediaType/mediaType-types.d.ts +1 -11
- package/script/oas/mediaType/mediaType-types.d.ts.map +1 -1
- package/script/oas/number/number-types.d.ts +2 -16
- package/script/oas/number/number-types.d.ts.map +1 -1
- package/script/oas/number/toNumber.d.ts +62 -0
- package/script/oas/number/toNumber.d.ts.map +1 -1
- package/script/oas/number/toNumber.js +62 -0
- package/script/oas/operation/operation-types.d.ts +22 -0
- package/script/oas/operation/operation-types.d.ts.map +1 -0
- package/script/oas/operation/operation-types.js +71 -0
- package/script/oas/parameter/Parameter.d.ts +47 -0
- package/script/oas/parameter/Parameter.d.ts.map +1 -1
- package/script/oas/parameter/Parameter.js +47 -0
- package/script/oas/parameter/parameter-types.d.ts +3 -58
- package/script/oas/parameter/parameter-types.d.ts.map +1 -1
- package/script/oas/pathItem/pathItem-types.d.ts +12 -0
- package/script/oas/pathItem/pathItem-types.d.ts.map +1 -0
- package/script/oas/pathItem/pathItem-types.js +48 -0
- package/script/oas/requestBody/requestBody-types.d.ts +10 -0
- package/script/oas/requestBody/requestBody-types.d.ts.map +1 -0
- package/script/oas/requestBody/requestBody-types.js +45 -0
- package/script/oas/response/response-types.d.ts +12 -0
- package/script/oas/response/response-types.d.ts.map +1 -0
- package/script/oas/response/response-types.js +47 -0
- package/script/oas/schema/toSchemasV3.js +2 -2
- package/script/oas/server/toServerV3.d.ts.map +1 -1
- package/script/oas/string/string-types.d.ts +2 -29
- package/script/oas/string/string-types.d.ts.map +1 -1
- package/script/oas/string/toString.d.ts +125 -1
- package/script/oas/string/toString.d.ts.map +1 -1
- package/script/oas/string/toString.js +119 -0
- package/script/oas/tag/tag-types.d.ts +8 -0
- package/script/oas/tag/tag-types.d.ts.map +1 -0
- package/script/oas/tag/tag-types.js +44 -0
- package/script/oas/union/union-types.d.ts +1 -12
- package/script/oas/union/union-types.d.ts.map +1 -1
- package/script/oas/unknown/unknown-types.d.ts +1 -7
- package/script/oas/unknown/unknown-types.d.ts.map +1 -1
- package/script/types/CustomValue.d.ts +58 -0
- package/script/types/CustomValue.d.ts.map +1 -1
- package/script/types/CustomValue.js +58 -0
- package/script/types/DenoJson.d.ts +24 -0
- package/script/types/DenoJson.d.ts.map +1 -1
- package/script/types/DenoJson.js +12 -0
- package/script/types/Enrichments.d.ts +103 -0
- package/script/types/Enrichments.d.ts.map +1 -1
- package/script/types/Enrichments.js +52 -0
- package/script/types/GeneratedValue.d.ts +17 -0
- package/script/types/GeneratedValue.d.ts.map +1 -1
- package/script/types/Logger.d.ts +9 -0
- package/script/types/Logger.d.ts.map +1 -0
- package/script/types/Logger.js +2 -0
- package/script/types/Preview.d.ts +37 -0
- package/script/types/Preview.d.ts.map +1 -1
- package/script/types/Preview.js +37 -0
- package/script/types/Settings.d.ts +35 -0
- package/script/types/Settings.d.ts.map +1 -1
- package/script/types/Settings.js +27 -0
- package/script/typescript/FunctionParameter.d.ts +4 -4
- package/script/typescript/FunctionParameter.d.ts.map +1 -1
- package/script/typescript/List.d.ts +40 -2
- package/script/typescript/List.d.ts.map +1 -1
- package/script/typescript/List.js +32 -0
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"toNumber.d.ts","sourceRoot":"","sources":["../../../src/oas/number/toNumber.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,EAAE,MAAM,aAAa,CAAA;AAQvC,KAAK,YAAY,GAAG;IAClB,KAAK,EAAE,SAAS,CAAC,YAAY,CAAA;IAC7B,OAAO,EAAE,YAAY,CAAA;CACtB,CAAA;AAED,eAAO,MAAM,QAAQ,GAAI,oBAAoB,YAAY,KAAG,SA2B3D,CAAA"}
|
|
1
|
+
{"version":3,"file":"toNumber.d.ts","sourceRoot":"","sources":["../../../src/oas/number/toNumber.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,EAAE,MAAM,aAAa,CAAA;AAQvC,KAAK,YAAY,GAAG;IAClB,KAAK,EAAE,SAAS,CAAC,YAAY,CAAA;IAC7B,OAAO,EAAE,YAAY,CAAA;CACtB,CAAA;AAED;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA6DG;AACH,eAAO,MAAM,QAAQ,GAAI,oBAAoB,YAAY,KAAG,SA2B3D,CAAA"}
|
|
@@ -6,6 +6,68 @@ import { parseNullable } from '../_helpers/parseNullable.js';
|
|
|
6
6
|
import { parseExample } from '../_helpers/parseExample.js';
|
|
7
7
|
import { parseEnum } from '../_helpers/parseEnum.js';
|
|
8
8
|
import { parseFormat } from '../_helpers/parseFormat.js';
|
|
9
|
+
/**
|
|
10
|
+
* Transforms an OpenAPI v3 number schema object into an internal OAS number representation.
|
|
11
|
+
*
|
|
12
|
+
* This function processes OpenAPI number schemas by extracting and parsing nullable values,
|
|
13
|
+
* examples, enumerations, and default values. It handles the complete transformation from
|
|
14
|
+
* raw OpenAPI JSON to the SKMTC internal number representation with proper validation
|
|
15
|
+
* of number formats and constraints.
|
|
16
|
+
*
|
|
17
|
+
* The transformation follows a pipeline approach:
|
|
18
|
+
* 1. Parse nullable flag and extract base value
|
|
19
|
+
* 2. Parse example values with nullable support
|
|
20
|
+
* 3. Parse enumeration constraints
|
|
21
|
+
* 4. Parse default values
|
|
22
|
+
* 5. Create final OasNumber instance with format validation
|
|
23
|
+
*
|
|
24
|
+
* @param args - Transformation arguments
|
|
25
|
+
* @param args.context - Parse context providing utilities and tracing
|
|
26
|
+
* @param args.value - The OpenAPI v3 number schema object to transform
|
|
27
|
+
* @returns Transformed OAS number object with parsed properties
|
|
28
|
+
*
|
|
29
|
+
* @example Basic number transformation
|
|
30
|
+
* ```typescript
|
|
31
|
+
* import { toNumber } from '@skmtc/core';
|
|
32
|
+
*
|
|
33
|
+
* const openApiNumber = {
|
|
34
|
+
* type: 'number',
|
|
35
|
+
* format: 'double',
|
|
36
|
+
* minimum: 0,
|
|
37
|
+
* maximum: 100
|
|
38
|
+
* };
|
|
39
|
+
*
|
|
40
|
+
* const oasNumber = toNumber({
|
|
41
|
+
* context: parseContext,
|
|
42
|
+
* value: openApiNumber
|
|
43
|
+
* });
|
|
44
|
+
*
|
|
45
|
+
* console.log(oasNumber.format); // 'double'
|
|
46
|
+
* console.log(oasNumber.minimum); // 0
|
|
47
|
+
* ```
|
|
48
|
+
*
|
|
49
|
+
* @example Number with nullable and constraints
|
|
50
|
+
* ```typescript
|
|
51
|
+
* const priceNumber = {
|
|
52
|
+
* type: 'number',
|
|
53
|
+
* format: 'float',
|
|
54
|
+
* nullable: true,
|
|
55
|
+
* minimum: 0.01,
|
|
56
|
+
* maximum: 9999.99,
|
|
57
|
+
* exclusiveMaximum: true,
|
|
58
|
+
* default: null,
|
|
59
|
+
* example: 19.99
|
|
60
|
+
* };
|
|
61
|
+
*
|
|
62
|
+
* const oasNumber = toNumber({
|
|
63
|
+
* context: parseContext,
|
|
64
|
+
* value: priceNumber
|
|
65
|
+
* });
|
|
66
|
+
*
|
|
67
|
+
* console.log(oasNumber.nullable); // true
|
|
68
|
+
* console.log(oasNumber.exclusiveMaximum); // true
|
|
69
|
+
* ```
|
|
70
|
+
*/
|
|
9
71
|
export const toNumber = ({ context, value }) => {
|
|
10
72
|
const { nullable, value: valueWithoutNullable } = parseNullable({
|
|
11
73
|
value,
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
import { type OasParameterData } from '../parameter/parameter-types.js';
|
|
2
|
+
import { type OasPathItemData } from '../pathItem/pathItem-types.js';
|
|
3
|
+
import { type OasParameterRefData, type OasRequestBodyRefData, type OasResponseRefData } from '../ref/ref-types.js';
|
|
4
|
+
import { type OasRequestBodyData } from '../requestBody/requestBody-types.js';
|
|
5
|
+
import { type OasResponseData } from '../response/response-types.js';
|
|
6
|
+
import * as v from 'valibot';
|
|
7
|
+
export type OasOperationData = {
|
|
8
|
+
oasType: 'operation';
|
|
9
|
+
pathItem: OasPathItemData;
|
|
10
|
+
path: string;
|
|
11
|
+
method: 'get' | 'put' | 'post' | 'delete' | 'options' | 'head' | 'patch' | 'trace';
|
|
12
|
+
operationId?: string;
|
|
13
|
+
tags?: string[];
|
|
14
|
+
summary?: string;
|
|
15
|
+
description?: string;
|
|
16
|
+
parameters?: (OasParameterData | OasParameterRefData)[];
|
|
17
|
+
requestBody?: OasRequestBodyData | OasRequestBodyRefData;
|
|
18
|
+
responses: Record<string, OasResponseData | OasResponseRefData>;
|
|
19
|
+
deprecated?: boolean;
|
|
20
|
+
};
|
|
21
|
+
export declare const oasOperationData: v.GenericSchema<OasOperationData>;
|
|
22
|
+
//# sourceMappingURL=operation-types.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"operation-types.d.ts","sourceRoot":"","sources":["../../../src/oas/operation/operation-types.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,KAAK,gBAAgB,EAAoB,MAAM,iCAAiC,CAAA;AACzF,OAAO,EAAE,KAAK,eAAe,EAAmB,MAAM,+BAA+B,CAAA;AACrF,OAAO,EACL,KAAK,mBAAmB,EACxB,KAAK,qBAAqB,EAC1B,KAAK,kBAAkB,EAIxB,MAAM,qBAAqB,CAAA;AAC5B,OAAO,EAAE,KAAK,kBAAkB,EAAsB,MAAM,qCAAqC,CAAA;AACjG,OAAO,EAAE,KAAK,eAAe,EAAmB,MAAM,+BAA+B,CAAA;AACrF,OAAO,KAAK,CAAC,MAAM,SAAS,CAAA;AAE5B,MAAM,MAAM,gBAAgB,GAAG;IAC7B,OAAO,EAAE,WAAW,CAAA;IACpB,QAAQ,EAAE,eAAe,CAAA;IACzB,IAAI,EAAE,MAAM,CAAA;IACZ,MAAM,EAAE,KAAK,GAAG,KAAK,GAAG,MAAM,GAAG,QAAQ,GAAG,SAAS,GAAG,MAAM,GAAG,OAAO,GAAG,OAAO,CAAA;IAClF,WAAW,CAAC,EAAE,MAAM,CAAA;IACpB,IAAI,CAAC,EAAE,MAAM,EAAE,CAAA;IACf,OAAO,CAAC,EAAE,MAAM,CAAA;IAChB,WAAW,CAAC,EAAE,MAAM,CAAA;IAGpB,UAAU,CAAC,EAAE,CAAC,gBAAgB,GAAG,mBAAmB,CAAC,EAAE,CAAA;IACvD,WAAW,CAAC,EAAE,kBAAkB,GAAG,qBAAqB,CAAA;IACxD,SAAS,EAAE,MAAM,CAAC,MAAM,EAAE,eAAe,GAAG,kBAAkB,CAAC,CAAA;IAE/D,UAAU,CAAC,EAAE,OAAO,CAAA;CAGrB,CAAA;AAED,eAAO,MAAM,gBAAgB,EAAE,CAAC,CAAC,aAAa,CAAC,gBAAgB,CA2B7D,CAAA"}
|
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
import { markdown } from '../markdown/markdown-types.js';
|
|
2
|
+
import { oasParameterData } from '../parameter/parameter-types.js';
|
|
3
|
+
import { oasPathItemData } from '../pathItem/pathItem-types.js';
|
|
4
|
+
import { oasParameterRefData, oasRequestBodyRefData, oasResponseRefData } from '../ref/ref-types.js';
|
|
5
|
+
import { oasRequestBodyData } from '../requestBody/requestBody-types.js';
|
|
6
|
+
import { oasResponseData } from '../response/response-types.js';
|
|
7
|
+
import * as v from 'valibot';
|
|
8
|
+
export const oasOperationData = v.object({
|
|
9
|
+
oasType: v.literal('operation'),
|
|
10
|
+
pathItem: oasPathItemData,
|
|
11
|
+
path: v.string(),
|
|
12
|
+
method: v.enum({
|
|
13
|
+
get: 'get',
|
|
14
|
+
put: 'put',
|
|
15
|
+
post: 'post',
|
|
16
|
+
delete: 'delete',
|
|
17
|
+
options: 'options',
|
|
18
|
+
head: 'head',
|
|
19
|
+
patch: 'patch',
|
|
20
|
+
trace: 'trace'
|
|
21
|
+
}),
|
|
22
|
+
operationId: v.optional(v.string()),
|
|
23
|
+
tags: v.optional(v.array(v.string())),
|
|
24
|
+
summary: v.optional(v.string()),
|
|
25
|
+
description: v.optional(markdown),
|
|
26
|
+
// externalDocs: externalDocs.optional(),
|
|
27
|
+
// operationId: z.string().optional(),
|
|
28
|
+
parameters: v.optional(v.array(v.union([oasParameterData, oasParameterRefData]))),
|
|
29
|
+
requestBody: v.optional(v.union([oasRequestBodyData, oasRequestBodyRefData])),
|
|
30
|
+
responses: v.record(v.string(), v.union([oasResponseData, oasResponseRefData])),
|
|
31
|
+
// callbacks: z.never(),
|
|
32
|
+
deprecated: v.optional(v.boolean())
|
|
33
|
+
// security: z.never(),
|
|
34
|
+
// servers: z.array(server).optional()
|
|
35
|
+
});
|
|
@@ -188,22 +188,69 @@ export declare class OasParameter {
|
|
|
188
188
|
name: string;
|
|
189
189
|
/** Where the parameter is located (path, query, header, cookie) */
|
|
190
190
|
location: OasParameterLocation;
|
|
191
|
+
/** A brief description of the parameter's purpose and usage */
|
|
191
192
|
description?: string | undefined;
|
|
193
|
+
/** Determines whether this parameter is mandatory for the operation */
|
|
192
194
|
required?: boolean | undefined;
|
|
195
|
+
/** Indicates that the parameter is deprecated and should be avoided */
|
|
193
196
|
deprecated?: boolean | undefined;
|
|
197
|
+
/** Whether to allow empty values for this parameter */
|
|
194
198
|
allowEmptyValue?: boolean | undefined;
|
|
199
|
+
/** Whether reserved characters are allowed in parameter values */
|
|
195
200
|
allowReserved?: boolean | undefined;
|
|
201
|
+
/** The schema defining the parameter's data type and validation rules */
|
|
196
202
|
schema?: OasSchema | OasRef<'schema'> | undefined;
|
|
203
|
+
/** Example values demonstrating parameter usage */
|
|
197
204
|
examples?: Record<string, OasExample | OasRef<'example'>> | undefined;
|
|
205
|
+
/** Media type definitions for complex parameter content */
|
|
198
206
|
content?: Record<string, OasMediaType> | undefined;
|
|
207
|
+
/** The serialization style for the parameter (form, simple, etc.) */
|
|
199
208
|
style: OasParameterStyle;
|
|
209
|
+
/** Whether to explode parameter values into separate key-value pairs */
|
|
200
210
|
explode: boolean;
|
|
211
|
+
/** Custom extension fields (x-* properties) defined for this parameter */
|
|
201
212
|
extensionFields: Record<string, unknown> | undefined;
|
|
213
|
+
/**
|
|
214
|
+
* Creates a new OasParameter instance.
|
|
215
|
+
*
|
|
216
|
+
* @param fields - Parameter configuration fields including name, location, schema, and serialization options
|
|
217
|
+
*/
|
|
202
218
|
constructor(fields: ParameterFields);
|
|
219
|
+
/**
|
|
220
|
+
* Determines if this parameter is a reference object.
|
|
221
|
+
*
|
|
222
|
+
* @returns Always false since this is a concrete parameter instance, not a reference
|
|
223
|
+
*/
|
|
203
224
|
isRef(): this is OasRef<'parameter'>;
|
|
225
|
+
/**
|
|
226
|
+
* Resolves this parameter object.
|
|
227
|
+
*
|
|
228
|
+
* @returns The parameter instance itself since it's already a concrete object
|
|
229
|
+
*/
|
|
204
230
|
resolve(): OasParameter;
|
|
231
|
+
/**
|
|
232
|
+
* Resolves this parameter object one level.
|
|
233
|
+
*
|
|
234
|
+
* @returns The parameter instance itself since it's already a concrete object
|
|
235
|
+
*/
|
|
205
236
|
resolveOnce(): OasParameter;
|
|
237
|
+
/**
|
|
238
|
+
* Extracts the schema for this parameter.
|
|
239
|
+
*
|
|
240
|
+
* Returns the direct schema if available, or extracts schema from content
|
|
241
|
+
* for the specified media type.
|
|
242
|
+
*
|
|
243
|
+
* @param mediaType - Media type to extract schema from when using content definitions
|
|
244
|
+
* @returns The parameter's schema object
|
|
245
|
+
* @throws Error if no schema is found for the specified media type
|
|
246
|
+
*/
|
|
206
247
|
toSchema(mediaType?: string): OasSchema | OasRef<'schema'>;
|
|
248
|
+
/**
|
|
249
|
+
* Converts this OAS parameter to an OpenAPI v3 JSON schema representation.
|
|
250
|
+
*
|
|
251
|
+
* @param options - Conversion options including reference handling and formatting preferences
|
|
252
|
+
* @returns OpenAPI v3 parameter object with all properties and validation constraints
|
|
253
|
+
*/
|
|
207
254
|
toJsonSchema(options: ToJsonSchemaOptions): OpenAPIV3.ParameterObject;
|
|
208
255
|
}
|
|
209
256
|
//# 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,yBAAyB,CAAC;AACjC,OAAO,KAAK,EAAE,oBAAoB,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AC,GAAG,SAAS,CAAA;IACpD;;;;OAIG;gBACS,MAAM,EAAE,eAAe;IAkBnC;;;;OAIG;IACH,KAAK,IAAI,IAAI,IAAI,MAAM,CAAC,WAAW,CAAC;IAIpC;;;;OAIG;IACH,OAAO,IAAI,YAAY;IAIvB;;;;OAIG;IACH,WAAW,IAAI,YAAY;IAI3B;;;;;;;;;OASG;IACH,QAAQ,CAAC,SAAS,GAAE,MAA2B,GAAG,SAAS,GAAG,MAAM,CAAC,QAAQ,CAAC;IAc9E;;;;;OAKG;IACH,YAAY,CAAC,OAAO,EAAE,mBAAmB,GAAG,SAAS,CAAC,eAAe;CAuBtE"}
|
|
@@ -144,6 +144,11 @@ import "../../_dnt.polyfills.js";
|
|
|
144
144
|
* ```
|
|
145
145
|
*/
|
|
146
146
|
export class OasParameter {
|
|
147
|
+
/**
|
|
148
|
+
* Creates a new OasParameter instance.
|
|
149
|
+
*
|
|
150
|
+
* @param fields - Parameter configuration fields including name, location, schema, and serialization options
|
|
151
|
+
*/
|
|
147
152
|
constructor(fields) {
|
|
148
153
|
/** Type identifier for OAS parameter objects */
|
|
149
154
|
Object.defineProperty(this, "oasType", {
|
|
@@ -166,66 +171,77 @@ export class OasParameter {
|
|
|
166
171
|
writable: true,
|
|
167
172
|
value: void 0
|
|
168
173
|
});
|
|
174
|
+
/** A brief description of the parameter's purpose and usage */
|
|
169
175
|
Object.defineProperty(this, "description", {
|
|
170
176
|
enumerable: true,
|
|
171
177
|
configurable: true,
|
|
172
178
|
writable: true,
|
|
173
179
|
value: void 0
|
|
174
180
|
});
|
|
181
|
+
/** Determines whether this parameter is mandatory for the operation */
|
|
175
182
|
Object.defineProperty(this, "required", {
|
|
176
183
|
enumerable: true,
|
|
177
184
|
configurable: true,
|
|
178
185
|
writable: true,
|
|
179
186
|
value: void 0
|
|
180
187
|
});
|
|
188
|
+
/** Indicates that the parameter is deprecated and should be avoided */
|
|
181
189
|
Object.defineProperty(this, "deprecated", {
|
|
182
190
|
enumerable: true,
|
|
183
191
|
configurable: true,
|
|
184
192
|
writable: true,
|
|
185
193
|
value: void 0
|
|
186
194
|
});
|
|
195
|
+
/** Whether to allow empty values for this parameter */
|
|
187
196
|
Object.defineProperty(this, "allowEmptyValue", {
|
|
188
197
|
enumerable: true,
|
|
189
198
|
configurable: true,
|
|
190
199
|
writable: true,
|
|
191
200
|
value: void 0
|
|
192
201
|
});
|
|
202
|
+
/** Whether reserved characters are allowed in parameter values */
|
|
193
203
|
Object.defineProperty(this, "allowReserved", {
|
|
194
204
|
enumerable: true,
|
|
195
205
|
configurable: true,
|
|
196
206
|
writable: true,
|
|
197
207
|
value: void 0
|
|
198
208
|
});
|
|
209
|
+
/** The schema defining the parameter's data type and validation rules */
|
|
199
210
|
Object.defineProperty(this, "schema", {
|
|
200
211
|
enumerable: true,
|
|
201
212
|
configurable: true,
|
|
202
213
|
writable: true,
|
|
203
214
|
value: void 0
|
|
204
215
|
});
|
|
216
|
+
/** Example values demonstrating parameter usage */
|
|
205
217
|
Object.defineProperty(this, "examples", {
|
|
206
218
|
enumerable: true,
|
|
207
219
|
configurable: true,
|
|
208
220
|
writable: true,
|
|
209
221
|
value: void 0
|
|
210
222
|
});
|
|
223
|
+
/** Media type definitions for complex parameter content */
|
|
211
224
|
Object.defineProperty(this, "content", {
|
|
212
225
|
enumerable: true,
|
|
213
226
|
configurable: true,
|
|
214
227
|
writable: true,
|
|
215
228
|
value: void 0
|
|
216
229
|
});
|
|
230
|
+
/** The serialization style for the parameter (form, simple, etc.) */
|
|
217
231
|
Object.defineProperty(this, "style", {
|
|
218
232
|
enumerable: true,
|
|
219
233
|
configurable: true,
|
|
220
234
|
writable: true,
|
|
221
235
|
value: void 0
|
|
222
236
|
});
|
|
237
|
+
/** Whether to explode parameter values into separate key-value pairs */
|
|
223
238
|
Object.defineProperty(this, "explode", {
|
|
224
239
|
enumerable: true,
|
|
225
240
|
configurable: true,
|
|
226
241
|
writable: true,
|
|
227
242
|
value: void 0
|
|
228
243
|
});
|
|
244
|
+
/** Custom extension fields (x-* properties) defined for this parameter */
|
|
229
245
|
Object.defineProperty(this, "extensionFields", {
|
|
230
246
|
enumerable: true,
|
|
231
247
|
configurable: true,
|
|
@@ -248,15 +264,40 @@ export class OasParameter {
|
|
|
248
264
|
this.explode = fields.explode;
|
|
249
265
|
this.extensionFields = fields.extensionFields;
|
|
250
266
|
}
|
|
267
|
+
/**
|
|
268
|
+
* Determines if this parameter is a reference object.
|
|
269
|
+
*
|
|
270
|
+
* @returns Always false since this is a concrete parameter instance, not a reference
|
|
271
|
+
*/
|
|
251
272
|
isRef() {
|
|
252
273
|
return false;
|
|
253
274
|
}
|
|
275
|
+
/**
|
|
276
|
+
* Resolves this parameter object.
|
|
277
|
+
*
|
|
278
|
+
* @returns The parameter instance itself since it's already a concrete object
|
|
279
|
+
*/
|
|
254
280
|
resolve() {
|
|
255
281
|
return this;
|
|
256
282
|
}
|
|
283
|
+
/**
|
|
284
|
+
* Resolves this parameter object one level.
|
|
285
|
+
*
|
|
286
|
+
* @returns The parameter instance itself since it's already a concrete object
|
|
287
|
+
*/
|
|
257
288
|
resolveOnce() {
|
|
258
289
|
return this;
|
|
259
290
|
}
|
|
291
|
+
/**
|
|
292
|
+
* Extracts the schema for this parameter.
|
|
293
|
+
*
|
|
294
|
+
* Returns the direct schema if available, or extracts schema from content
|
|
295
|
+
* for the specified media type.
|
|
296
|
+
*
|
|
297
|
+
* @param mediaType - Media type to extract schema from when using content definitions
|
|
298
|
+
* @returns The parameter's schema object
|
|
299
|
+
* @throws Error if no schema is found for the specified media type
|
|
300
|
+
*/
|
|
260
301
|
toSchema(mediaType = 'application/json') {
|
|
261
302
|
if (this.schema) {
|
|
262
303
|
return this.schema;
|
|
@@ -267,6 +308,12 @@ export class OasParameter {
|
|
|
267
308
|
}
|
|
268
309
|
return schema;
|
|
269
310
|
}
|
|
311
|
+
/**
|
|
312
|
+
* Converts this OAS parameter to an OpenAPI v3 JSON schema representation.
|
|
313
|
+
*
|
|
314
|
+
* @param options - Conversion options including reference handling and formatting preferences
|
|
315
|
+
* @returns OpenAPI v3 parameter object with all properties and validation constraints
|
|
316
|
+
*/
|
|
270
317
|
toJsonSchema(options) {
|
|
271
318
|
return {
|
|
272
319
|
name: this.name,
|
|
@@ -4,22 +4,9 @@ import { type OasExampleRefData, type OasSchemaRefData } from '../ref/ref-types.
|
|
|
4
4
|
import { type OasSchemaData } from '../schema/schema-types.js';
|
|
5
5
|
import * as v from 'valibot';
|
|
6
6
|
export type OasParameterLocation = 'query' | 'header' | 'path' | 'cookie';
|
|
7
|
-
export declare const oasParameterLocation: v.
|
|
8
|
-
readonly query: "query";
|
|
9
|
-
readonly header: "header";
|
|
10
|
-
readonly path: "path";
|
|
11
|
-
readonly cookie: "cookie";
|
|
12
|
-
}, undefined>;
|
|
7
|
+
export declare const oasParameterLocation: v.GenericSchema<OasParameterLocation>;
|
|
13
8
|
export type OasParameterStyle = 'matrix' | 'label' | 'form' | 'simple' | 'spaceDelimited' | 'pipeDelimited' | 'deepObject';
|
|
14
|
-
export declare const oasParameterStyle: v.
|
|
15
|
-
readonly matrix: "matrix";
|
|
16
|
-
readonly label: "label";
|
|
17
|
-
readonly form: "form";
|
|
18
|
-
readonly simple: "simple";
|
|
19
|
-
readonly spaceDelimited: "spaceDelimited";
|
|
20
|
-
readonly pipeDelimited: "pipeDelimited";
|
|
21
|
-
readonly deepObject: "deepObject";
|
|
22
|
-
}, undefined>;
|
|
9
|
+
export declare const oasParameterStyle: v.GenericSchema<OasParameterStyle>;
|
|
23
10
|
export type OasParameterData = {
|
|
24
11
|
oasType: 'parameter';
|
|
25
12
|
allowEmptyValue?: boolean;
|
|
@@ -35,47 +22,5 @@ export type OasParameterData = {
|
|
|
35
22
|
schema?: OasSchemaData | OasSchemaRefData;
|
|
36
23
|
style: OasParameterStyle;
|
|
37
24
|
};
|
|
38
|
-
export declare const oasParameterData: v.
|
|
39
|
-
readonly oasType: v.LiteralSchema<"parameter", undefined>;
|
|
40
|
-
readonly allowEmptyValue: v.OptionalSchema<v.BooleanSchema<undefined>, undefined>;
|
|
41
|
-
readonly allowReserved: v.OptionalSchema<v.BooleanSchema<undefined>, undefined>;
|
|
42
|
-
readonly content: v.OptionalSchema<v.RecordSchema<v.StringSchema<undefined>, v.ObjectSchema<{
|
|
43
|
-
readonly oasType: v.LiteralSchema<"mediaType", undefined>;
|
|
44
|
-
readonly mediaType: v.StringSchema<undefined>;
|
|
45
|
-
readonly schema: v.OptionalSchema<v.UnionSchema<[v.GenericSchema<OasSchemaData>, v.GenericSchema<OasSchemaRefData>], undefined>, undefined>;
|
|
46
|
-
readonly examples: v.OptionalSchema<v.RecordSchema<v.StringSchema<undefined>, v.UnionSchema<[v.ObjectSchema<{
|
|
47
|
-
readonly oasType: v.LiteralSchema<"example", undefined>;
|
|
48
|
-
readonly summary: v.OptionalSchema<v.StringSchema<undefined>, undefined>;
|
|
49
|
-
readonly description: v.OptionalSchema<v.GenericSchema<string>, undefined>;
|
|
50
|
-
readonly value: v.OptionalSchema<v.UnknownSchema, undefined>;
|
|
51
|
-
}, undefined>, v.GenericSchema<OasExampleRefData>], undefined>, undefined>, undefined>;
|
|
52
|
-
}, undefined>, undefined>, undefined>;
|
|
53
|
-
readonly deprecated: v.OptionalSchema<v.BooleanSchema<undefined>, undefined>;
|
|
54
|
-
readonly description: v.OptionalSchema<v.GenericSchema<string>, undefined>;
|
|
55
|
-
readonly examples: v.OptionalSchema<v.RecordSchema<v.StringSchema<undefined>, v.UnionSchema<[v.ObjectSchema<{
|
|
56
|
-
readonly oasType: v.LiteralSchema<"example", undefined>;
|
|
57
|
-
readonly summary: v.OptionalSchema<v.StringSchema<undefined>, undefined>;
|
|
58
|
-
readonly description: v.OptionalSchema<v.GenericSchema<string>, undefined>;
|
|
59
|
-
readonly value: v.OptionalSchema<v.UnknownSchema, undefined>;
|
|
60
|
-
}, undefined>, v.GenericSchema<OasExampleRefData>], undefined>, undefined>, undefined>;
|
|
61
|
-
readonly explode: v.BooleanSchema<undefined>;
|
|
62
|
-
readonly location: v.EnumSchema<{
|
|
63
|
-
readonly query: "query";
|
|
64
|
-
readonly header: "header";
|
|
65
|
-
readonly path: "path";
|
|
66
|
-
readonly cookie: "cookie";
|
|
67
|
-
}, undefined>;
|
|
68
|
-
readonly name: v.StringSchema<undefined>;
|
|
69
|
-
readonly required: v.OptionalSchema<v.BooleanSchema<undefined>, undefined>;
|
|
70
|
-
readonly schema: v.OptionalSchema<v.UnionSchema<[v.GenericSchema<OasSchemaData>, v.GenericSchema<OasSchemaRefData>], undefined>, undefined>;
|
|
71
|
-
readonly style: v.EnumSchema<{
|
|
72
|
-
readonly matrix: "matrix";
|
|
73
|
-
readonly label: "label";
|
|
74
|
-
readonly form: "form";
|
|
75
|
-
readonly simple: "simple";
|
|
76
|
-
readonly spaceDelimited: "spaceDelimited";
|
|
77
|
-
readonly pipeDelimited: "pipeDelimited";
|
|
78
|
-
readonly deepObject: "deepObject";
|
|
79
|
-
}, undefined>;
|
|
80
|
-
}, undefined>;
|
|
25
|
+
export declare const oasParameterData: v.GenericSchema<OasParameterData>;
|
|
81
26
|
//# sourceMappingURL=parameter-types.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"parameter-types.d.ts","sourceRoot":"","sources":["../../../src/oas/parameter/parameter-types.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,cAAc,EAAkB,MAAM,6BAA6B,CAAA;AAEjF,OAAO,EAAE,KAAK,gBAAgB,EAAoB,MAAM,iCAAiC,CAAA;AACzF,OAAO,EACL,KAAK,iBAAiB,EACtB,KAAK,gBAAgB,EAGtB,MAAM,qBAAqB,CAAA;AAC5B,OAAO,EAAE,KAAK,aAAa,EAAiB,MAAM,2BAA2B,CAAA;AAC7E,OAAO,KAAK,CAAC,MAAM,SAAS,CAAA;AAE5B,MAAM,MAAM,oBAAoB,GAAG,OAAO,GAAG,QAAQ,GAAG,MAAM,GAAG,QAAQ,CAAA;AAEzE,eAAO,MA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,CAAC,EAAE,OAAO,CAAA;IAClB,MAAM,CAAC,EAAE,aAAa,GAAG,gBAAgB,CAAA;IACzC,KAAK,EAAE,iBAAiB,CAAA;CACzB,CAAA;AAED,eAAO,MAAM,gBAAgB,EAAE,CAAC,CAAC,aAAa,CAAC,gBAAgB,CAc7D,CAAA"}
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import { type OasParameterData } from '../parameter/parameter-types.js';
|
|
2
|
+
import { type OasParameterRefData } from '../ref/ref-types.js';
|
|
3
|
+
import * as v from 'valibot';
|
|
4
|
+
export type OasPathItemData = {
|
|
5
|
+
oasType: 'pathItem';
|
|
6
|
+
$ref?: string;
|
|
7
|
+
summary?: string;
|
|
8
|
+
description?: string;
|
|
9
|
+
parameters?: (OasParameterData | OasParameterRefData)[];
|
|
10
|
+
};
|
|
11
|
+
export declare const oasPathItemData: v.GenericSchema<OasPathItemData>;
|
|
12
|
+
//# sourceMappingURL=pathItem-types.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"pathItem-types.d.ts","sourceRoot":"","sources":["../../../src/oas/pathItem/pathItem-types.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,KAAK,gBAAgB,EAAoB,MAAM,iCAAiC,CAAA;AACzF,OAAO,EAAE,KAAK,mBAAmB,EAAuB,MAAM,qBAAqB,CAAA;AACnF,OAAO,KAAK,CAAC,MAAM,SAAS,CAAA;AAE5B,MAAM,MAAM,eAAe,GAAG;IAC5B,OAAO,EAAE,UAAU,CAAA;IACnB,IAAI,CAAC,EAAE,MAAM,CAAA;IACb,OAAO,CAAC,EAAE,MAAM,CAAA;IAChB,WAAW,CAAC,EAAE,MAAM,CAAA;IAEpB,UAAU,CAAC,EAAE,CAAC,gBAAgB,GAAG,mBAAmB,CAAC,EAAE,CAAA;CACxD,CAAA;AAED,eAAO,MAAM,eAAe,EAAE,CAAC,CAAC,aAAa,CAAC,eAAe,CAO3D,CAAA"}
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import { markdown } from '../markdown/markdown-types.js';
|
|
2
|
+
import { oasParameterData } from '../parameter/parameter-types.js';
|
|
3
|
+
import { oasParameterRefData } from '../ref/ref-types.js';
|
|
4
|
+
import * as v from 'valibot';
|
|
5
|
+
export const oasPathItemData = v.object({
|
|
6
|
+
oasType: v.literal('pathItem'),
|
|
7
|
+
$ref: v.optional(v.string()),
|
|
8
|
+
summary: v.optional(v.string()),
|
|
9
|
+
description: v.optional(markdown),
|
|
10
|
+
// servers: z.array(server).optional(),
|
|
11
|
+
parameters: v.optional(v.array(v.union([oasParameterData, oasParameterRefData])))
|
|
12
|
+
});
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import { type OasMediaTypeData } from '../mediaType/mediaType-types.js';
|
|
2
|
+
import * as v from 'valibot';
|
|
3
|
+
export type OasRequestBodyData = {
|
|
4
|
+
oasType: 'requestBody';
|
|
5
|
+
description?: string;
|
|
6
|
+
content: Record<string, OasMediaTypeData>;
|
|
7
|
+
required?: boolean;
|
|
8
|
+
};
|
|
9
|
+
export declare const oasRequestBodyData: v.GenericSchema<OasRequestBodyData>;
|
|
10
|
+
//# sourceMappingURL=requestBody-types.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"requestBody-types.d.ts","sourceRoot":"","sources":["../../../src/oas/requestBody/requestBody-types.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,KAAK,gBAAgB,EAAoB,MAAM,iCAAiC,CAAA;AACzF,OAAO,KAAK,CAAC,MAAM,SAAS,CAAA;AAE5B,MAAM,MAAM,kBAAkB,GAAG;IAC/B,OAAO,EAAE,aAAa,CAAA;IACtB,WAAW,CAAC,EAAE,MAAM,CAAA;IACpB,OAAO,EAAE,MAAM,CAAC,MAAM,EAAE,gBAAgB,CAAC,CAAA;IACzC,QAAQ,CAAC,EAAE,OAAO,CAAA;CACnB,CAAA;AAED,eAAO,MAAM,kBAAkB,EAAE,CAAC,CAAC,aAAa,CAAC,kBAAkB,CAKjE,CAAA"}
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import { markdown } from '../markdown/markdown-types.js';
|
|
2
|
+
import { oasMediaTypeData } from '../mediaType/mediaType-types.js';
|
|
3
|
+
import * as v from 'valibot';
|
|
4
|
+
export const oasRequestBodyData = v.object({
|
|
5
|
+
oasType: v.literal('requestBody'),
|
|
6
|
+
description: v.optional(markdown),
|
|
7
|
+
content: v.record(v.string(), oasMediaTypeData),
|
|
8
|
+
required: v.optional(v.boolean())
|
|
9
|
+
});
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import { type OasHeaderData } from '../header/header-types.js';
|
|
2
|
+
import { type OasMediaTypeData } from '../mediaType/mediaType-types.js';
|
|
3
|
+
import { type OasHeaderRefData } from '../ref/ref-types.js';
|
|
4
|
+
import * as v from 'valibot';
|
|
5
|
+
export type OasResponseData = {
|
|
6
|
+
oasType: 'response';
|
|
7
|
+
description: string;
|
|
8
|
+
headers?: Record<string, OasHeaderData | OasHeaderRefData>;
|
|
9
|
+
content?: Record<string, OasMediaTypeData>;
|
|
10
|
+
};
|
|
11
|
+
export declare const oasResponseData: v.GenericSchema<OasResponseData>;
|
|
12
|
+
//# sourceMappingURL=response-types.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"response-types.d.ts","sourceRoot":"","sources":["../../../src/oas/response/response-types.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,aAAa,EAAiB,MAAM,2BAA2B,CAAA;AAC7E,OAAO,EAAE,KAAK,gBAAgB,EAAoB,MAAM,iCAAiC,CAAA;AACzF,OAAO,EAAE,KAAK,gBAAgB,EAAoB,MAAM,qBAAqB,CAAA;AAC7E,OAAO,KAAK,CAAC,MAAM,SAAS,CAAA;AAE5B,MAAM,MAAM,eAAe,GAAG;IAC5B,OAAO,EAAE,UAAU,CAAA;IACnB,WAAW,EAAE,MAAM,CAAA;IACnB,OAAO,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,aAAa,GAAG,gBAAgB,CAAC,CAAA;IAC1D,OAAO,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,gBAAgB,CAAC,CAAA;CAE3C,CAAA;AAED,eAAO,MAAM,eAAe,EAAE,CAAC,CAAC,aAAa,CAAC,eAAe,CAM3D,CAAA"}
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import { oasHeaderData } from '../header/header-types.js';
|
|
2
|
+
import { oasMediaTypeData } from '../mediaType/mediaType-types.js';
|
|
3
|
+
import { oasHeaderRefData } from '../ref/ref-types.js';
|
|
4
|
+
import * as v from 'valibot';
|
|
5
|
+
export const oasResponseData = v.object({
|
|
6
|
+
oasType: v.literal('response'),
|
|
7
|
+
description: v.string(),
|
|
8
|
+
headers: v.optional(v.record(v.string(), v.union([oasHeaderData, oasHeaderRefData]))),
|
|
9
|
+
content: v.optional(v.record(v.string(), oasMediaTypeData))
|
|
10
|
+
// links: z.record(z.union([link, ref])).optional()
|
|
11
|
+
});
|
|
@@ -80,8 +80,8 @@ export const toSchemaV3 = ({ schema, context }) => {
|
|
|
80
80
|
})
|
|
81
81
|
.with({ anyOf: P.array() }, matched => {
|
|
82
82
|
return context.trace('anyOf', () => {
|
|
83
|
-
const
|
|
84
|
-
const
|
|
83
|
+
const _lastThree = context.stackTrail.slice(-3).toString();
|
|
84
|
+
const _lastFive = context.stackTrail.slice(-5).toString();
|
|
85
85
|
// deno-lint-ignore ban-ts-comment
|
|
86
86
|
// @ts-expect-error
|
|
87
87
|
if (matched['x-expansionResources']) {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"toServerV3.d.ts","sourceRoot":"","sources":["../../../src/oas/server/toServerV3.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,+BAA+B,CAAA;AACjE,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,eAAe,CAAA;AAC9C,OAAO,EAAE,SAAS,EAAE,MAAM,aAAa,CAAA;
|
|
1
|
+
{"version":3,"file":"toServerV3.d.ts","sourceRoot":"","sources":["../../../src/oas/server/toServerV3.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,+BAA+B,CAAA;AACjE,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,eAAe,CAAA;AAC9C,OAAO,EAAE,SAAS,EAAE,MAAM,aAAa,CAAA;AAGvC,KAAK,eAAe,GAAG;IACrB,OAAO,EAAE,SAAS,CAAC,YAAY,EAAE,CAAA;IACjC,OAAO,EAAE,YAAY,CAAA;CACtB,CAAA;AAED,eAAO,MAAM,WAAW,GAAI,sBAAsB,eAAe,KAAG,SAAS,EAI5E,CAAA;AAED,KAAK,uBAAuB,GAAG;IAC7B,OAAO,EAAE,SAAS,CAAC,YAAY,EAAE,GAAG,SAAS,CAAA;IAC7C,OAAO,EAAE,YAAY,CAAA;CACtB,CAAA;AAED,eAAO,MAAM,mBAAmB,GAAI,sBAGjC,uBAAuB,KAAG,SAAS,EAAE,GAAG,SAM1C,CAAA;AAED,KAAK,cAAc,GAAG;IACpB,MAAM,EAAE,SAAS,CAAC,YAAY,CAAA;IAC9B,OAAO,EAAE,YAAY,CAAA;CACtB,CAAA;AAED,eAAO,MAAM,UAAU,GAAI,qBAAqB,cAAc,KAAG,SAgBhE,CAAA"}
|
|
@@ -13,41 +13,14 @@ export type StringFormat = 'date-time' | 'time' | 'date' | 'duration' | 'email'
|
|
|
13
13
|
* Defines the standard string formats supported by OpenAPI v3,
|
|
14
14
|
* including date/time formats, network formats, and encoding formats.
|
|
15
15
|
*/
|
|
16
|
-
export declare const stringFormat: v.
|
|
17
|
-
readonly 'date-time': "date-time";
|
|
18
|
-
readonly time: "time";
|
|
19
|
-
readonly date: "date";
|
|
20
|
-
readonly duration: "duration";
|
|
21
|
-
readonly email: "email";
|
|
22
|
-
readonly hostname: "hostname";
|
|
23
|
-
readonly ipv4: "ipv4";
|
|
24
|
-
readonly ipv6: "ipv6";
|
|
25
|
-
readonly uuid: "uuid";
|
|
26
|
-
readonly uri: "uri";
|
|
27
|
-
readonly regex: "regex";
|
|
28
|
-
readonly password: "password";
|
|
29
|
-
readonly byte: "byte";
|
|
30
|
-
readonly binary: "binary";
|
|
31
|
-
}, undefined>;
|
|
16
|
+
export declare const stringFormat: v.GenericSchema<StringFormat>;
|
|
32
17
|
/**
|
|
33
18
|
* Valibot schema for validating OpenAPI string data objects.
|
|
34
19
|
*
|
|
35
20
|
* Validates string schema objects including length constraints,
|
|
36
21
|
* pattern validation, format specifiers, and enumeration values.
|
|
37
22
|
*/
|
|
38
|
-
export declare const oasStringData: v.
|
|
39
|
-
readonly type: v.LiteralSchema<"string", undefined>;
|
|
40
|
-
readonly title: v.OptionalSchema<v.StringSchema<undefined>, undefined>;
|
|
41
|
-
readonly description: v.OptionalSchema<v.StringSchema<undefined>, undefined>;
|
|
42
|
-
readonly default: v.OptionalSchema<v.StringSchema<undefined>, undefined>;
|
|
43
|
-
readonly maxLength: v.OptionalSchema<v.NumberSchema<undefined>, undefined>;
|
|
44
|
-
readonly minLength: v.OptionalSchema<v.NumberSchema<undefined>, undefined>;
|
|
45
|
-
readonly pattern: v.OptionalSchema<v.StringSchema<undefined>, undefined>;
|
|
46
|
-
readonly enum: v.OptionalSchema<v.ArraySchema<v.StringSchema<undefined>, undefined>, undefined>;
|
|
47
|
-
readonly format: v.OptionalSchema<v.StringSchema<undefined>, undefined>;
|
|
48
|
-
readonly nullable: v.OptionalSchema<v.BooleanSchema<undefined>, undefined>;
|
|
49
|
-
readonly example: v.OptionalSchema<v.StringSchema<undefined>, undefined>;
|
|
50
|
-
}, undefined>;
|
|
23
|
+
export declare const oasStringData: v.GenericSchema<OasStringData>;
|
|
51
24
|
/**
|
|
52
25
|
* Data type for OpenAPI string schema objects.
|
|
53
26
|
*
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"string-types.d.ts","sourceRoot":"","sources":["../../../src/oas/string/string-types.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,CAAC,MAAM,SAAS,CAAA;AAE5B;;;;;;GAMG;AACH,MAAM,MAAM,YAAY,GACpB,WAAW,GACX,MAAM,GACN,MAAM,GACN,UAAU,GACV,OAAO,GACP,UAAU,GACV,MAAM,GACN,MAAM,GACN,MAAM,GACN,KAAK,GACL,OAAO,GACP,UAAU,GACV,MAAM,GACN,QAAQ,CAAA;AAEZ;;;;;GAKG;AACH,eAAO,MAAM,YAAY
|
|
1
|
+
{"version":3,"file":"string-types.d.ts","sourceRoot":"","sources":["../../../src/oas/string/string-types.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,CAAC,MAAM,SAAS,CAAA;AAE5B;;;;;;GAMG;AACH,MAAM,MAAM,YAAY,GACpB,WAAW,GACX,MAAM,GACN,MAAM,GACN,UAAU,GACV,OAAO,GACP,UAAU,GACV,MAAM,GACN,MAAM,GACN,MAAM,GACN,KAAK,GACL,OAAO,GACP,UAAU,GACV,MAAM,GACN,QAAQ,CAAA;AAEZ;;;;;GAKG;AACH,eAAO,MAAM,YAAY,EAAE,CAAC,CAAC,aAAa,CAAC,YAAY,CAerD,CAAA;AAEF;;;;;GAKG;AACH,eAAO,MAAM,aAAa,EAAE,CAAC,CAAC,aAAa,CAAC,aAAa,CAYvD,CAAA;AAEF;;;;;;GAMG;AACH,MAAM,MAAM,aAAa,GAAG;IAC1B,0CAA0C;IAC1C,KAAK,CAAC,EAAE,MAAM,CAAA;IACd,mDAAmD;IACnD,WAAW,CAAC,EAAE,MAAM,CAAA;IACpB,mCAAmC;IACnC,OAAO,CAAC,EAAE,MAAM,CAAA;IAChB,wCAAwC;IACxC,IAAI,EAAE,QAAQ,CAAA;IACd,6BAA6B;IAC7B,SAAS,CAAC,EAAE,MAAM,CAAA;IAClB,8BAA8B;IAC9B,SAAS,CAAC,EAAE,MAAM,CAAA;IAClB,gDAAgD;IAChD,OAAO,CAAC,EAAE,MAAM,CAAA;IAChB,wCAAwC;IACxC,IAAI,CAAC,EAAE,MAAM,EAAE,CAAA;IACf,gDAAgD;IAChD,MAAM,CAAC,EAAE,MAAM,CAAA;IACf,sCAAsC;IACtC,QAAQ,CAAC,EAAE,OAAO,CAAA;IAClB,sCAAsC;IACtC,OAAO,CAAC,EAAE,MAAM,CAAA;CACjB,CAAA"}
|