@skmtc/core 0.0.799 → 0.0.802
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 +0 -3
- package/esm/context/CoreContext.d.ts.map +1 -1
- package/esm/context/CoreContext.js +12 -17
- package/esm/context/GenerateContext.d.ts +35 -3
- package/esm/context/GenerateContext.d.ts.map +1 -1
- package/esm/context/GenerateContext.js +21 -1
- package/esm/context/ParseContext.d.ts +64 -3
- package/esm/context/ParseContext.d.ts.map +1 -1
- package/esm/context/ParseContext.js +61 -0
- package/esm/context/RenderContext.d.ts +151 -2
- package/esm/context/RenderContext.d.ts.map +1 -1
- package/esm/context/RenderContext.js +185 -11
- package/esm/context/ResultsHandler.d.ts +10 -3
- package/esm/context/ResultsHandler.d.ts.map +1 -1
- 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/model/types.d.ts +51 -4
- package/esm/dsl/model/types.d.ts.map +1 -1
- 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 +48 -0
- package/esm/dsl/operation/OperationDriver.d.ts.map +1 -1
- package/esm/dsl/operation/OperationDriver.js +49 -1
- package/esm/dsl/operation/types.d.ts +61 -3
- package/esm/dsl/operation/types.d.ts.map +1 -1
- 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 +51 -0
- package/esm/mod.d.ts.map +1 -1
- package/esm/mod.js +51 -0
- package/esm/oas/array/array-types.d.ts +20 -11
- package/esm/oas/array/array-types.d.ts.map +1 -1
- package/esm/oas/array/array-types.js +10 -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-types.d.ts +1 -7
- package/esm/oas/boolean/boolean-types.d.ts.map +1 -1
- 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/operation/Operation.d.ts +47 -2
- package/esm/oas/operation/Operation.d.ts.map +1 -1
- package/esm/oas/operation/Operation.js +43 -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-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/ref/Ref.d.ts +49 -2
- package/esm/oas/ref/Ref.d.ts.map +1 -1
- package/esm/oas/ref/Ref.js +28 -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/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 +104 -5
- package/esm/typescript/List.d.ts.map +1 -1
- package/esm/typescript/List.js +75 -0
- package/package.json +1 -1
- package/script/context/CoreContext.d.ts +0 -3
- package/script/context/CoreContext.d.ts.map +1 -1
- package/script/context/CoreContext.js +12 -17
- package/script/context/GenerateContext.d.ts +35 -3
- package/script/context/GenerateContext.d.ts.map +1 -1
- package/script/context/GenerateContext.js +21 -1
- package/script/context/ParseContext.d.ts +64 -3
- package/script/context/ParseContext.d.ts.map +1 -1
- package/script/context/ParseContext.js +61 -0
- package/script/context/RenderContext.d.ts +151 -2
- package/script/context/RenderContext.d.ts.map +1 -1
- package/script/context/RenderContext.js +185 -11
- package/script/context/ResultsHandler.d.ts +10 -3
- package/script/context/ResultsHandler.d.ts.map +1 -1
- 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/model/types.d.ts +51 -4
- package/script/dsl/model/types.d.ts.map +1 -1
- 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 +48 -0
- package/script/dsl/operation/OperationDriver.d.ts.map +1 -1
- package/script/dsl/operation/OperationDriver.js +49 -1
- package/script/dsl/operation/types.d.ts +61 -3
- package/script/dsl/operation/types.d.ts.map +1 -1
- 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 +51 -0
- package/script/mod.d.ts.map +1 -1
- package/script/mod.js +51 -0
- package/script/oas/array/array-types.d.ts +20 -11
- package/script/oas/array/array-types.d.ts.map +1 -1
- package/script/oas/array/array-types.js +11 -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-types.d.ts +1 -7
- package/script/oas/boolean/boolean-types.d.ts.map +1 -1
- 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/operation/Operation.d.ts +47 -2
- package/script/oas/operation/Operation.d.ts.map +1 -1
- package/script/oas/operation/Operation.js +43 -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-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/ref/Ref.d.ts +49 -2
- package/script/oas/ref/Ref.d.ts.map +1 -1
- package/script/oas/ref/Ref.js +28 -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/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 +104 -5
- package/script/typescript/List.d.ts.map +1 -1
- package/script/typescript/List.js +75 -0
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"integer-types.d.ts","sourceRoot":"","sources":["../../../src/oas/integer/integer-types.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,CAAC,MAAM,SAAS,CAAA;AAE5B;;;;;GAKG;AACH,eAAO,MAAM,aAAa,
|
|
1
|
+
{"version":3,"file":"integer-types.d.ts","sourceRoot":"","sources":["../../../src/oas/integer/integer-types.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,CAAC,MAAM,SAAS,CAAA;AAE5B;;;;;GAKG;AACH,eAAO,MAAM,aAAa,EAAE,CAAC,CAAC,aAAa,CAAC,MAAM,CAAmC,CAAA;AAErF;;;;;GAKG;AACH,eAAO,MAAM,aAAa,EAAE,CAAC,CAAC,aAAa,CAAC,OAAO,GAAG,OAAO,CAAqD,CAAA;AAElH;;;;;GAKG;AACH,eAAO,MAAM,cAAc,EAAE,CAAC,CAAC,aAAa,CAAC,cAAc,CAczD,CAAA;AAEF,MAAM,MAAM,cAAc,GAAG;IAC3B,IAAI,EAAE,SAAS,CAAA;IACf,KAAK,CAAC,EAAE,MAAM,CAAA;IACd,WAAW,CAAC,EAAE,MAAM,CAAA;IACpB,OAAO,CAAC,EAAE,MAAM,CAAA;IAChB,MAAM,CAAC,EAAE,OAAO,GAAG,OAAO,CAAA;IAC1B,IAAI,CAAC,EAAE,MAAM,EAAE,CAAA;IACf,QAAQ,CAAC,EAAE,OAAO,CAAA;IAClB,OAAO,CAAC,EAAE,MAAM,CAAA;IAChB,UAAU,CAAC,EAAE,MAAM,CAAA;IACnB,OAAO,CAAC,EAAE,MAAM,CAAA;IAChB,gBAAgB,CAAC,EAAE,OAAO,CAAA;IAC1B,OAAO,CAAC,EAAE,MAAM,CAAA;IAChB,gBAAgB,CAAC,EAAE,OAAO,CAAA;CAC3B,CAAA"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"license-types.d.ts","sourceRoot":"","sources":["../../../src/oas/license/license-types.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,CAAC,MAAM,SAAS,CAAA;AAE5B,MAAM,MAAM,cAAc,GAAG;IAC3B,OAAO,EAAE,SAAS,CAAA;IAClB,IAAI,EAAE,MAAM,CAAA;IACZ,GAAG,CAAC,EAAE,MAAM,CAAA;IACZ,UAAU,CAAC,EAAE,MAAM,CAAA;CACpB,CAAA;AAED,eAAO,MAAM,cAAc,EAAE,CAAC,CAAC,aAAa,CAAC,cAAc,CAKzD,CAAA"}
|
|
@@ -0,0 +1,43 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
3
|
+
if (k2 === undefined) k2 = k;
|
|
4
|
+
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
5
|
+
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
6
|
+
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
7
|
+
}
|
|
8
|
+
Object.defineProperty(o, k2, desc);
|
|
9
|
+
}) : (function(o, m, k, k2) {
|
|
10
|
+
if (k2 === undefined) k2 = k;
|
|
11
|
+
o[k2] = m[k];
|
|
12
|
+
}));
|
|
13
|
+
var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
|
|
14
|
+
Object.defineProperty(o, "default", { enumerable: true, value: v });
|
|
15
|
+
}) : function(o, v) {
|
|
16
|
+
o["default"] = v;
|
|
17
|
+
});
|
|
18
|
+
var __importStar = (this && this.__importStar) || (function () {
|
|
19
|
+
var ownKeys = function(o) {
|
|
20
|
+
ownKeys = Object.getOwnPropertyNames || function (o) {
|
|
21
|
+
var ar = [];
|
|
22
|
+
for (var k in o) if (Object.prototype.hasOwnProperty.call(o, k)) ar[ar.length] = k;
|
|
23
|
+
return ar;
|
|
24
|
+
};
|
|
25
|
+
return ownKeys(o);
|
|
26
|
+
};
|
|
27
|
+
return function (mod) {
|
|
28
|
+
if (mod && mod.__esModule) return mod;
|
|
29
|
+
var result = {};
|
|
30
|
+
if (mod != null) for (var k = ownKeys(mod), i = 0; i < k.length; i++) if (k[i] !== "default") __createBinding(result, mod, k[i]);
|
|
31
|
+
__setModuleDefault(result, mod);
|
|
32
|
+
return result;
|
|
33
|
+
};
|
|
34
|
+
})();
|
|
35
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
36
|
+
exports.oasLicenseData = void 0;
|
|
37
|
+
const v = __importStar(require("valibot"));
|
|
38
|
+
exports.oasLicenseData = v.object({
|
|
39
|
+
oasType: v.literal('license'),
|
|
40
|
+
name: v.string(),
|
|
41
|
+
url: v.optional(v.string()),
|
|
42
|
+
identifier: v.optional(v.string())
|
|
43
|
+
});
|
|
@@ -25,15 +25,5 @@ export type OasMediaTypeData = {
|
|
|
25
25
|
* Validates the structure of media type objects including content type
|
|
26
26
|
* identifiers, schema definitions, and example collections.
|
|
27
27
|
*/
|
|
28
|
-
export declare const oasMediaTypeData: v.
|
|
29
|
-
readonly oasType: v.LiteralSchema<"mediaType", undefined>;
|
|
30
|
-
readonly mediaType: v.StringSchema<undefined>;
|
|
31
|
-
readonly schema: v.OptionalSchema<v.UnionSchema<[v.GenericSchema<OasSchemaData>, v.GenericSchema<OasSchemaRefData>], undefined>, undefined>;
|
|
32
|
-
readonly examples: v.OptionalSchema<v.RecordSchema<v.StringSchema<undefined>, v.UnionSchema<[v.ObjectSchema<{
|
|
33
|
-
readonly oasType: v.LiteralSchema<"example", undefined>;
|
|
34
|
-
readonly summary: v.OptionalSchema<v.StringSchema<undefined>, undefined>;
|
|
35
|
-
readonly description: v.OptionalSchema<v.GenericSchema<string>, undefined>;
|
|
36
|
-
readonly value: v.OptionalSchema<v.UnknownSchema, undefined>;
|
|
37
|
-
}, undefined>, v.GenericSchema<OasExampleRefData>], undefined>, undefined>, undefined>;
|
|
38
|
-
}, undefined>;
|
|
28
|
+
export declare const oasMediaTypeData: v.GenericSchema<OasMediaTypeData>;
|
|
39
29
|
//# sourceMappingURL=mediaType-types.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"mediaType-types.d.ts","sourceRoot":"","sources":["../../../src/oas/mediaType/mediaType-types.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,cAAc,EAAkB,MAAM,6BAA6B,CAAA;AACjF,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;;;;;;GAMG;AACH,MAAM,MAAM,gBAAgB,GAAG;IAC7B,iDAAiD;IACjD,OAAO,EAAE,WAAW,CAAA;IACpB,yEAAyE;IACzE,SAAS,EAAE,MAAM,CAAA;IACjB,mDAAmD;IACnD,MAAM,CAAC,EAAE,aAAa,GAAG,gBAAgB,CAAA;IAEzC,gDAAgD;IAChD,QAAQ,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,cAAc,GAAG,iBAAiB,CAAC,CAAA;CAE9D,CAAA;AAED;;;;;GAKG;AACH,eAAO,MAAM,gBAAgB
|
|
1
|
+
{"version":3,"file":"mediaType-types.d.ts","sourceRoot":"","sources":["../../../src/oas/mediaType/mediaType-types.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,cAAc,EAAkB,MAAM,6BAA6B,CAAA;AACjF,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;;;;;;GAMG;AACH,MAAM,MAAM,gBAAgB,GAAG;IAC7B,iDAAiD;IACjD,OAAO,EAAE,WAAW,CAAA;IACpB,yEAAyE;IACzE,SAAS,EAAE,MAAM,CAAA;IACjB,mDAAmD;IACnD,MAAM,CAAC,EAAE,aAAa,GAAG,gBAAgB,CAAA;IAEzC,gDAAgD;IAChD,QAAQ,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,cAAc,GAAG,iBAAiB,CAAC,CAAA;CAE9D,CAAA;AAED;;;;;GAKG;AACH,eAAO,MAAM,gBAAgB,EAAE,CAAC,CAAC,aAAa,CAAC,gBAAgB,CAO7D,CAAA"}
|
|
@@ -5,28 +5,14 @@ import * as v from 'valibot';
|
|
|
5
5
|
* Defines the precision formats for number types: float for single-precision
|
|
6
6
|
* and double for double-precision floating-point numbers.
|
|
7
7
|
*/
|
|
8
|
-
export declare const numberFormat: v.
|
|
8
|
+
export declare const numberFormat: v.GenericSchema<'float' | 'double'>;
|
|
9
9
|
/**
|
|
10
10
|
* Valibot schema for validating OpenAPI number data objects.
|
|
11
11
|
*
|
|
12
12
|
* Validates number schemas including precision formats, range constraints,
|
|
13
13
|
* multiple validation, and enumeration values.
|
|
14
14
|
*/
|
|
15
|
-
export declare const oasNumberData: v.
|
|
16
|
-
readonly type: v.LiteralSchema<"number", undefined>;
|
|
17
|
-
readonly title: v.OptionalSchema<v.StringSchema<undefined>, undefined>;
|
|
18
|
-
readonly description: v.OptionalSchema<v.StringSchema<undefined>, undefined>;
|
|
19
|
-
readonly default: v.OptionalSchema<v.NumberSchema<undefined>, undefined>;
|
|
20
|
-
readonly format: v.OptionalSchema<v.UnionSchema<[v.LiteralSchema<"float", undefined>, v.LiteralSchema<"double", undefined>], undefined>, undefined>;
|
|
21
|
-
readonly enum: v.OptionalSchema<v.ArraySchema<v.NumberSchema<undefined>, undefined>, undefined>;
|
|
22
|
-
readonly nullable: v.OptionalSchema<v.BooleanSchema<undefined>, undefined>;
|
|
23
|
-
readonly example: v.OptionalSchema<v.NumberSchema<undefined>, undefined>;
|
|
24
|
-
readonly multipleOf: v.OptionalSchema<v.NumberSchema<undefined>, undefined>;
|
|
25
|
-
readonly maximum: v.OptionalSchema<v.NumberSchema<undefined>, undefined>;
|
|
26
|
-
readonly exclusiveMaximum: v.OptionalSchema<v.BooleanSchema<undefined>, undefined>;
|
|
27
|
-
readonly minimum: v.OptionalSchema<v.NumberSchema<undefined>, undefined>;
|
|
28
|
-
readonly exclusiveMinimum: v.OptionalSchema<v.BooleanSchema<undefined>, undefined>;
|
|
29
|
-
}, undefined>;
|
|
15
|
+
export declare const oasNumberData: v.GenericSchema<OasNumberData>;
|
|
30
16
|
export type OasNumberData = {
|
|
31
17
|
type: 'number';
|
|
32
18
|
title?: string;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"number-types.d.ts","sourceRoot":"","sources":["../../../src/oas/number/number-types.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,CAAC,MAAM,SAAS,CAAA;AAE5B;;;;;GAKG;AACH,eAAO,MAAM,YAAY,
|
|
1
|
+
{"version":3,"file":"number-types.d.ts","sourceRoot":"","sources":["../../../src/oas/number/number-types.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,CAAC,MAAM,SAAS,CAAA;AAE5B;;;;;GAKG;AACH,eAAO,MAAM,YAAY,EAAE,CAAC,CAAC,aAAa,CAAC,OAAO,GAAG,QAAQ,CAAsD,CAAA;AAEnH;;;;;GAKG;AACH,eAAO,MAAM,aAAa,EAAE,CAAC,CAAC,aAAa,CAAC,aAAa,CAcvD,CAAA;AAEF,MAAM,MAAM,aAAa,GAAG;IAC1B,IAAI,EAAE,QAAQ,CAAA;IACd,KAAK,CAAC,EAAE,MAAM,CAAA;IACd,WAAW,CAAC,EAAE,MAAM,CAAA;IACpB,OAAO,CAAC,EAAE,MAAM,CAAA;IAChB,MAAM,CAAC,EAAE,OAAO,GAAG,QAAQ,CAAA;IAC3B,IAAI,CAAC,EAAE,MAAM,EAAE,CAAA;IACf,QAAQ,CAAC,EAAE,OAAO,CAAA;IAClB,OAAO,CAAC,EAAE,MAAM,CAAA;IAChB,UAAU,CAAC,EAAE,MAAM,CAAA;IACnB,OAAO,CAAC,EAAE,MAAM,CAAA;IAChB,gBAAgB,CAAC,EAAE,OAAO,CAAA;IAC1B,OAAO,CAAC,EAAE,MAAM,CAAA;IAChB,gBAAgB,CAAC,EAAE,OAAO,CAAA;CAC3B,CAAA"}
|
|
@@ -46,7 +46,10 @@ export type OperationFields = {
|
|
|
46
46
|
/** OpenAPI specification extensions */
|
|
47
47
|
extensionFields?: Record<string, unknown>;
|
|
48
48
|
};
|
|
49
|
-
|
|
49
|
+
/**
|
|
50
|
+
* Arguments passed to request body mapping functions.
|
|
51
|
+
*/
|
|
52
|
+
export type ToRequestBodyMapArgs = {
|
|
50
53
|
schema: OasSchema | OasRef<'schema'>;
|
|
51
54
|
requestBody: OasRequestBody;
|
|
52
55
|
};
|
|
@@ -186,9 +189,35 @@ export declare class OasOperation {
|
|
|
186
189
|
deprecated: boolean | undefined;
|
|
187
190
|
/** OpenAPI specification extensions */
|
|
188
191
|
extensionFields: Record<string, unknown> | undefined;
|
|
192
|
+
/**
|
|
193
|
+
* Creates a new OasOperation instance from operation field data.
|
|
194
|
+
*
|
|
195
|
+
* @param fields - Operation field data from OpenAPI specification
|
|
196
|
+
*/
|
|
189
197
|
constructor(fields: OperationFields);
|
|
198
|
+
/**
|
|
199
|
+
* Returns the successful response definition for this operation.
|
|
200
|
+
*
|
|
201
|
+
* Looks for the lowest numbered 2xx response code and returns its response definition.
|
|
202
|
+
*
|
|
203
|
+
* @returns Success response object or undefined if none found
|
|
204
|
+
*/
|
|
190
205
|
toSuccessResponse(): OasResponse | OasRef<'response'> | undefined;
|
|
206
|
+
/**
|
|
207
|
+
* Returns the HTTP status code for the primary success response.
|
|
208
|
+
*
|
|
209
|
+
* Finds the lowest numbered 2xx status code in the responses.
|
|
210
|
+
*
|
|
211
|
+
* @returns Success status code as string or undefined if none found
|
|
212
|
+
*/
|
|
191
213
|
toSuccessResponseCode(): string | undefined;
|
|
214
|
+
/**
|
|
215
|
+
* Maps the request body schema to a custom value using the provided mapping function.
|
|
216
|
+
*
|
|
217
|
+
* @param map - Function to transform the request body schema and metadata
|
|
218
|
+
* @param mediaType - Media type to extract schema from (default: 'application/json')
|
|
219
|
+
* @returns Mapped value or undefined if no request body schema found
|
|
220
|
+
*/
|
|
192
221
|
toRequestBody<V>(map: ({ schema, requestBody }: ToRequestBodyMapArgs) => V, mediaType?: string): V | undefined;
|
|
193
222
|
/**
|
|
194
223
|
* Resolve all parameters and optionally filter by location
|
|
@@ -197,9 +226,25 @@ export declare class OasOperation {
|
|
|
197
226
|
* @returns
|
|
198
227
|
*/
|
|
199
228
|
toParams(filter?: OasParameterLocation[]): OasParameter[];
|
|
229
|
+
/**
|
|
230
|
+
* Creates an OAS object representation of operation parameters.
|
|
231
|
+
*
|
|
232
|
+
* @param filter - Optional array of parameter locations to include
|
|
233
|
+
* @returns OAS object with parameter properties
|
|
234
|
+
*/
|
|
200
235
|
toParametersObject(filter?: OasParameterLocation[]): OasObject;
|
|
236
|
+
/**
|
|
237
|
+
* Converts the operation to OpenAPI v3 JSON schema format.
|
|
238
|
+
*
|
|
239
|
+
* @param options - Conversion options for nested components
|
|
240
|
+
* @returns OpenAPI v3 operation object
|
|
241
|
+
*/
|
|
201
242
|
toJsonSchema(options: ToJsonSchemaOptions): OpenAPIV3.OperationObject;
|
|
243
|
+
/**
|
|
244
|
+
* Serializes the operation to a plain JavaScript object.
|
|
245
|
+
*
|
|
246
|
+
* @returns Plain object representation of the operation
|
|
247
|
+
*/
|
|
202
248
|
toJSON(): object;
|
|
203
249
|
}
|
|
204
|
-
export {};
|
|
205
250
|
//# sourceMappingURL=Operation.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Operation.d.ts","sourceRoot":"","sources":["../../../src/oas/operation/Operation.ts"],"names":[],"mappings":"AAAA,OAAO,yBAAyB,CAAC;AACjC,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,uBAAuB,CAAA;AACnD,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,yBAAyB,CAAA;AAC1D,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,2BAA2B,CAAA;AAC7D,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,+BAA+B,CAAA;AACnE,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,yBAAyB,CAAA;AAC1D,OAAO,KAAK,EAAE,oBAAoB,EAAE,MAAM,iCAAiC,CAAA;AAC3E,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,qBAAqB,CAAA;AACpD,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,eAAe,CAAA;AAC3C,OAAO,EAAE,SAAS,EAAE,MAAM,qBAAqB,CAAA;AAC/C,OAAO,KAAK,EAAE,mBAAmB,EAAE,MAAM,qBAAqB,CAAA;AAC9D,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,eAAe,CAAA;AAC9C,OAAO,KAAK,EAAE,sBAAsB,EAAE,MAAM,+CAA+C,CAAA;AAC3F;;;;;;GAMG;AACH,MAAM,MAAM,eAAe,GAAG;IAC5B,sCAAsC;IACtC,IAAI,EAAE,MAAM,CAAA;IACZ,yCAAyC;IACzC,MAAM,EAAE,MAAM,CAAA;IACd,qDAAqD;IACrD,QAAQ,EAAE,WAAW,GAAG,SAAS,CAAA;IACjC,0CAA0C;IAC1C,WAAW,CAAC,EAAE,MAAM,GAAG,SAAS,CAAA;IAChC,qCAAqC;IACrC,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AuC;IACvC,eAAe,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,GAAG,SAAS,CAAA;IAEpD;;;;OAIG;gBACS,MAAM,EAAE,eAAe;IAgBnC;;;;;;OAMG;IACH,iBAAiB,IAAI,WAAW,GAAG,MAAM,CAAC,UAAU,CAAC,GAAG,SAAS;IAMjE;;;;;;OAMG;IACH,qBAAqB,IAAI,MAAM,GAAG,SAAS;IAiB3C;;;;;;OAMG;IACH,aAAa,CAAC,CAAC,EACb,GAAG,EAAE,CAAC,EAAE,MAAM,EAAE,WAAW,EAAE,EAAE,oBAAoB,KAAK,CAAC,EACzD,SAAS,SAAqB,GAC7B,CAAC,GAAG,SAAS;IAOhB;;;;;OAKG;IACH,QAAQ,CAAC,MAAM,CAAC,EAAE,oBAAoB,EAAE,GAAG,YAAY,EAAE;IAQzD;;;;;OAKG;IACH,kBAAkB,CAAC,MAAM,CAAC,EAAE,oBAAoB,EAAE,GAAG,SAAS;IAY9D;;;;;OAKG;IACH,YAAY,CAAC,OAAO,EAAE,mBAAmB,GAAG,SAAS,CAAC,eAAe;IAiBrE;;;;OAIG;IACH,MAAM,IAAI,MAAM;CAcjB"}
|
|
@@ -111,6 +111,11 @@ const Object_js_1 = require("../object/Object.js");
|
|
|
111
111
|
* ```
|
|
112
112
|
*/
|
|
113
113
|
class OasOperation {
|
|
114
|
+
/**
|
|
115
|
+
* Creates a new OasOperation instance from operation field data.
|
|
116
|
+
*
|
|
117
|
+
* @param fields - Operation field data from OpenAPI specification
|
|
118
|
+
*/
|
|
114
119
|
constructor(fields) {
|
|
115
120
|
/** Type identifier for OAS operation objects */
|
|
116
121
|
Object.defineProperty(this, "oasType", {
|
|
@@ -224,10 +229,24 @@ class OasOperation {
|
|
|
224
229
|
this.deprecated = fields.deprecated;
|
|
225
230
|
this.extensionFields = fields.extensionFields;
|
|
226
231
|
}
|
|
232
|
+
/**
|
|
233
|
+
* Returns the successful response definition for this operation.
|
|
234
|
+
*
|
|
235
|
+
* Looks for the lowest numbered 2xx response code and returns its response definition.
|
|
236
|
+
*
|
|
237
|
+
* @returns Success response object or undefined if none found
|
|
238
|
+
*/
|
|
227
239
|
toSuccessResponse() {
|
|
228
240
|
const successCode = this.toSuccessResponseCode();
|
|
229
241
|
return successCode ? this.responses[successCode] : undefined;
|
|
230
242
|
}
|
|
243
|
+
/**
|
|
244
|
+
* Returns the HTTP status code for the primary success response.
|
|
245
|
+
*
|
|
246
|
+
* Finds the lowest numbered 2xx status code in the responses.
|
|
247
|
+
*
|
|
248
|
+
* @returns Success status code as string or undefined if none found
|
|
249
|
+
*/
|
|
231
250
|
toSuccessResponseCode() {
|
|
232
251
|
const successCode = Object.keys(this.responses)
|
|
233
252
|
.map(httpCode => parseInt(httpCode))
|
|
@@ -241,6 +260,13 @@ class OasOperation {
|
|
|
241
260
|
}
|
|
242
261
|
return undefined;
|
|
243
262
|
}
|
|
263
|
+
/**
|
|
264
|
+
* Maps the request body schema to a custom value using the provided mapping function.
|
|
265
|
+
*
|
|
266
|
+
* @param map - Function to transform the request body schema and metadata
|
|
267
|
+
* @param mediaType - Media type to extract schema from (default: 'application/json')
|
|
268
|
+
* @returns Mapped value or undefined if no request body schema found
|
|
269
|
+
*/
|
|
244
270
|
toRequestBody(map, mediaType = 'application/json') {
|
|
245
271
|
const requestBody = this.requestBody?.resolve();
|
|
246
272
|
const schema = requestBody?.content[mediaType]?.schema;
|
|
@@ -257,6 +283,12 @@ class OasOperation {
|
|
|
257
283
|
?.map(param => param.resolve())
|
|
258
284
|
.filter(param => (filter?.length ? filter.includes(param.location) : true)) ?? []);
|
|
259
285
|
}
|
|
286
|
+
/**
|
|
287
|
+
* Creates an OAS object representation of operation parameters.
|
|
288
|
+
*
|
|
289
|
+
* @param filter - Optional array of parameter locations to include
|
|
290
|
+
* @returns OAS object with parameter properties
|
|
291
|
+
*/
|
|
260
292
|
toParametersObject(filter) {
|
|
261
293
|
const parameters = this.toParams(filter);
|
|
262
294
|
return parameters.reduce((acc, parameter) => {
|
|
@@ -267,6 +299,12 @@ class OasOperation {
|
|
|
267
299
|
});
|
|
268
300
|
}, Object_js_1.OasObject.empty());
|
|
269
301
|
}
|
|
302
|
+
/**
|
|
303
|
+
* Converts the operation to OpenAPI v3 JSON schema format.
|
|
304
|
+
*
|
|
305
|
+
* @param options - Conversion options for nested components
|
|
306
|
+
* @returns OpenAPI v3 operation object
|
|
307
|
+
*/
|
|
270
308
|
toJsonSchema(options) {
|
|
271
309
|
return {
|
|
272
310
|
tags: this.tags,
|
|
@@ -281,6 +319,11 @@ class OasOperation {
|
|
|
281
319
|
...this.extensionFields
|
|
282
320
|
};
|
|
283
321
|
}
|
|
322
|
+
/**
|
|
323
|
+
* Serializes the operation to a plain JavaScript object.
|
|
324
|
+
*
|
|
325
|
+
* @returns Plain object representation of the operation
|
|
326
|
+
*/
|
|
284
327
|
toJSON() {
|
|
285
328
|
return {
|
|
286
329
|
tags: this.tags,
|
|
@@ -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,71 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
3
|
+
if (k2 === undefined) k2 = k;
|
|
4
|
+
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
5
|
+
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
6
|
+
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
7
|
+
}
|
|
8
|
+
Object.defineProperty(o, k2, desc);
|
|
9
|
+
}) : (function(o, m, k, k2) {
|
|
10
|
+
if (k2 === undefined) k2 = k;
|
|
11
|
+
o[k2] = m[k];
|
|
12
|
+
}));
|
|
13
|
+
var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
|
|
14
|
+
Object.defineProperty(o, "default", { enumerable: true, value: v });
|
|
15
|
+
}) : function(o, v) {
|
|
16
|
+
o["default"] = v;
|
|
17
|
+
});
|
|
18
|
+
var __importStar = (this && this.__importStar) || (function () {
|
|
19
|
+
var ownKeys = function(o) {
|
|
20
|
+
ownKeys = Object.getOwnPropertyNames || function (o) {
|
|
21
|
+
var ar = [];
|
|
22
|
+
for (var k in o) if (Object.prototype.hasOwnProperty.call(o, k)) ar[ar.length] = k;
|
|
23
|
+
return ar;
|
|
24
|
+
};
|
|
25
|
+
return ownKeys(o);
|
|
26
|
+
};
|
|
27
|
+
return function (mod) {
|
|
28
|
+
if (mod && mod.__esModule) return mod;
|
|
29
|
+
var result = {};
|
|
30
|
+
if (mod != null) for (var k = ownKeys(mod), i = 0; i < k.length; i++) if (k[i] !== "default") __createBinding(result, mod, k[i]);
|
|
31
|
+
__setModuleDefault(result, mod);
|
|
32
|
+
return result;
|
|
33
|
+
};
|
|
34
|
+
})();
|
|
35
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
36
|
+
exports.oasOperationData = void 0;
|
|
37
|
+
const markdown_types_js_1 = require("../markdown/markdown-types.js");
|
|
38
|
+
const parameter_types_js_1 = require("../parameter/parameter-types.js");
|
|
39
|
+
const pathItem_types_js_1 = require("../pathItem/pathItem-types.js");
|
|
40
|
+
const ref_types_js_1 = require("../ref/ref-types.js");
|
|
41
|
+
const requestBody_types_js_1 = require("../requestBody/requestBody-types.js");
|
|
42
|
+
const response_types_js_1 = require("../response/response-types.js");
|
|
43
|
+
const v = __importStar(require("valibot"));
|
|
44
|
+
exports.oasOperationData = v.object({
|
|
45
|
+
oasType: v.literal('operation'),
|
|
46
|
+
pathItem: pathItem_types_js_1.oasPathItemData,
|
|
47
|
+
path: v.string(),
|
|
48
|
+
method: v.enum({
|
|
49
|
+
get: 'get',
|
|
50
|
+
put: 'put',
|
|
51
|
+
post: 'post',
|
|
52
|
+
delete: 'delete',
|
|
53
|
+
options: 'options',
|
|
54
|
+
head: 'head',
|
|
55
|
+
patch: 'patch',
|
|
56
|
+
trace: 'trace'
|
|
57
|
+
}),
|
|
58
|
+
operationId: v.optional(v.string()),
|
|
59
|
+
tags: v.optional(v.array(v.string())),
|
|
60
|
+
summary: v.optional(v.string()),
|
|
61
|
+
description: v.optional(markdown_types_js_1.markdown),
|
|
62
|
+
// externalDocs: externalDocs.optional(),
|
|
63
|
+
// operationId: z.string().optional(),
|
|
64
|
+
parameters: v.optional(v.array(v.union([parameter_types_js_1.oasParameterData, ref_types_js_1.oasParameterRefData]))),
|
|
65
|
+
requestBody: v.optional(v.union([requestBody_types_js_1.oasRequestBodyData, ref_types_js_1.oasRequestBodyRefData])),
|
|
66
|
+
responses: v.record(v.string(), v.union([response_types_js_1.oasResponseData, ref_types_js_1.oasResponseRefData])),
|
|
67
|
+
// callbacks: z.never(),
|
|
68
|
+
deprecated: v.optional(v.boolean())
|
|
69
|
+
// security: z.never(),
|
|
70
|
+
// servers: z.array(server).optional()
|
|
71
|
+
});
|
|
@@ -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,MAAM,oBAAoB
|
|
1
|
+
{"version":3,"file":"parameter-types.d.ts","sourceRoot":"","sources":["../../../src/oas/parameter/parameter-types.ts"],"names":[],"mappings":"AAAA,OAAO,EA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A;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,48 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
3
|
+
if (k2 === undefined) k2 = k;
|
|
4
|
+
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
5
|
+
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
6
|
+
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
7
|
+
}
|
|
8
|
+
Object.defineProperty(o, k2, desc);
|
|
9
|
+
}) : (function(o, m, k, k2) {
|
|
10
|
+
if (k2 === undefined) k2 = k;
|
|
11
|
+
o[k2] = m[k];
|
|
12
|
+
}));
|
|
13
|
+
var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
|
|
14
|
+
Object.defineProperty(o, "default", { enumerable: true, value: v });
|
|
15
|
+
}) : function(o, v) {
|
|
16
|
+
o["default"] = v;
|
|
17
|
+
});
|
|
18
|
+
var __importStar = (this && this.__importStar) || (function () {
|
|
19
|
+
var ownKeys = function(o) {
|
|
20
|
+
ownKeys = Object.getOwnPropertyNames || function (o) {
|
|
21
|
+
var ar = [];
|
|
22
|
+
for (var k in o) if (Object.prototype.hasOwnProperty.call(o, k)) ar[ar.length] = k;
|
|
23
|
+
return ar;
|
|
24
|
+
};
|
|
25
|
+
return ownKeys(o);
|
|
26
|
+
};
|
|
27
|
+
return function (mod) {
|
|
28
|
+
if (mod && mod.__esModule) return mod;
|
|
29
|
+
var result = {};
|
|
30
|
+
if (mod != null) for (var k = ownKeys(mod), i = 0; i < k.length; i++) if (k[i] !== "default") __createBinding(result, mod, k[i]);
|
|
31
|
+
__setModuleDefault(result, mod);
|
|
32
|
+
return result;
|
|
33
|
+
};
|
|
34
|
+
})();
|
|
35
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
36
|
+
exports.oasPathItemData = void 0;
|
|
37
|
+
const markdown_types_js_1 = require("../markdown/markdown-types.js");
|
|
38
|
+
const parameter_types_js_1 = require("../parameter/parameter-types.js");
|
|
39
|
+
const ref_types_js_1 = require("../ref/ref-types.js");
|
|
40
|
+
const v = __importStar(require("valibot"));
|
|
41
|
+
exports.oasPathItemData = v.object({
|
|
42
|
+
oasType: v.literal('pathItem'),
|
|
43
|
+
$ref: v.optional(v.string()),
|
|
44
|
+
summary: v.optional(v.string()),
|
|
45
|
+
description: v.optional(markdown_types_js_1.markdown),
|
|
46
|
+
// servers: z.array(server).optional(),
|
|
47
|
+
parameters: v.optional(v.array(v.union([parameter_types_js_1.oasParameterData, ref_types_js_1.oasParameterRefData])))
|
|
48
|
+
});
|
package/script/oas/ref/Ref.d.ts
CHANGED
|
@@ -10,6 +10,11 @@ import type { OasDocument } from '../document/Document.js';
|
|
|
10
10
|
import type { RefName } from '../../types/RefName.js';
|
|
11
11
|
import type { OpenAPIV3 } from 'openapi-types';
|
|
12
12
|
import type { OasSecurityScheme } from '../securitySchemes/SecurityScheme.js';
|
|
13
|
+
/**
|
|
14
|
+
* Field data for creating OAS reference objects.
|
|
15
|
+
*
|
|
16
|
+
* @template T - The type of component being referenced (e.g., 'schema', 'response')
|
|
17
|
+
*/
|
|
13
18
|
export type RefFields<T extends OasRefData['refType']> = {
|
|
14
19
|
refType: T;
|
|
15
20
|
$ref: string;
|
|
@@ -102,11 +107,39 @@ export type RefFields<T extends OasRefData['refType']> = {
|
|
|
102
107
|
*/
|
|
103
108
|
export declare class OasRef<T extends OasRefData['refType']> {
|
|
104
109
|
#private;
|
|
110
|
+
/** OAS type identifier */
|
|
105
111
|
oasType: 'ref';
|
|
112
|
+
/** Type identifier */
|
|
106
113
|
type: 'ref';
|
|
114
|
+
/**
|
|
115
|
+
* Creates a new OAS reference instance.
|
|
116
|
+
*
|
|
117
|
+
* @param fields - Reference field data including refType and $ref
|
|
118
|
+
* @param oasDocument - Document containing the referenced component
|
|
119
|
+
*/
|
|
107
120
|
constructor(fields: RefFields<T>, oasDocument: OasDocument);
|
|
121
|
+
/**
|
|
122
|
+
* Type guard to check if this instance is a reference.
|
|
123
|
+
*
|
|
124
|
+
* @returns Always true for OasRef instances
|
|
125
|
+
*/
|
|
108
126
|
isRef(): this is OasRef<T>;
|
|
127
|
+
/**
|
|
128
|
+
* Recursively resolves this reference to its final target component.
|
|
129
|
+
*
|
|
130
|
+
* Follows reference chains until reaching a non-reference component,
|
|
131
|
+
* with protection against infinite loops.
|
|
132
|
+
*
|
|
133
|
+
* @param lookupsPerformed - Internal counter to prevent infinite recursion
|
|
134
|
+
* @returns The resolved component
|
|
135
|
+
* @throws Error if maximum lookup depth is exceeded
|
|
136
|
+
*/
|
|
109
137
|
resolve(lookupsPerformed?: number): ResolvedRef<T>;
|
|
138
|
+
/**
|
|
139
|
+
* Resolves this reference one level, potentially returning another reference.
|
|
140
|
+
*
|
|
141
|
+
* @returns Either the resolved component or another reference in the chain
|
|
142
|
+
*/
|
|
110
143
|
resolveOnce(): OasRef<T> | ResolvedRef<T>;
|
|
111
144
|
toRefName(): RefName;
|
|
112
145
|
get $ref(): string;
|
|
@@ -115,10 +148,24 @@ export declare class OasRef<T extends OasRefData['refType']> {
|
|
|
115
148
|
toJsonSchema({ resolve }: ToJsonSchemaOptions): OpenAPIV3.ReferenceObject | ResolvedRefJsonType<T>;
|
|
116
149
|
toJSON(): object;
|
|
117
150
|
}
|
|
118
|
-
|
|
151
|
+
/**
|
|
152
|
+
* Type representing the JSON schema result from resolving a reference.
|
|
153
|
+
*
|
|
154
|
+
* @template T - The type of component being referenced
|
|
155
|
+
*/
|
|
156
|
+
export type ResolvedRefJsonType<T extends OasRefData['refType']> = ReturnType<ResolvedRef<T>['toJsonSchema']>;
|
|
157
|
+
/**
|
|
158
|
+
* Union type of all OAS component types that can be referenced.
|
|
159
|
+
*
|
|
160
|
+
* Includes all OpenAPI component types that support $ref resolution.
|
|
161
|
+
*/
|
|
119
162
|
export type OasComponentType = OasSchema | OasResponse | OasParameter | OasExample | OasRequestBody | OasHeader | OasSecurityScheme;
|
|
163
|
+
/**
|
|
164
|
+
* Type representing a resolved reference to a specific component type.
|
|
165
|
+
*
|
|
166
|
+
* @template T - The type of component being referenced (e.g., 'schema', 'response')
|
|
167
|
+
*/
|
|
120
168
|
export type ResolvedRef<T extends OasRefData['refType']> = Extract<OasComponentType, {
|
|
121
169
|
oasType: T;
|
|
122
170
|
}>;
|
|
123
|
-
export {};
|
|
124
171
|
//# sourceMappingURL=Ref.d.ts.map
|