@skmtc/core 0.0.332 → 0.0.334
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/_dnt.test_shims.d.ts.map +1 -0
- package/esm/context/GenerateContext.d.ts +12 -4
- package/esm/context/GenerateContext.d.ts.map +1 -1
- package/esm/context/GenerateContext.js +57 -31
- package/esm/deps/jsr.io/@std/assert/1.0.4/almost_equals.d.ts.map +1 -0
- package/esm/deps/jsr.io/@std/assert/1.0.4/array_includes.d.ts.map +1 -0
- package/esm/deps/jsr.io/@std/assert/1.0.4/assert.d.ts.map +1 -0
- package/esm/deps/jsr.io/@std/assert/1.0.4/assertion_error.d.ts.map +1 -0
- package/esm/deps/jsr.io/@std/assert/1.0.4/equal.d.ts.map +1 -0
- package/esm/deps/jsr.io/@std/assert/1.0.4/equals.d.ts.map +1 -0
- package/esm/deps/jsr.io/@std/assert/1.0.4/exists.d.ts.map +1 -0
- package/esm/deps/jsr.io/@std/assert/1.0.4/fail.d.ts.map +1 -0
- package/esm/deps/jsr.io/@std/assert/1.0.4/false.d.ts.map +1 -0
- package/esm/deps/jsr.io/@std/assert/1.0.4/greater.d.ts.map +1 -0
- package/esm/deps/jsr.io/@std/assert/1.0.4/greater_or_equal.d.ts.map +1 -0
- package/esm/deps/jsr.io/@std/assert/1.0.4/instance_of.d.ts.map +1 -0
- package/esm/deps/jsr.io/@std/assert/1.0.4/is_error.d.ts.map +1 -0
- package/esm/deps/jsr.io/@std/assert/1.0.4/less.d.ts.map +1 -0
- package/esm/deps/jsr.io/@std/assert/1.0.4/less_or_equal.d.ts.map +1 -0
- package/esm/deps/jsr.io/@std/assert/1.0.4/match.d.ts.map +1 -0
- package/esm/deps/jsr.io/@std/assert/1.0.4/mod.d.ts.map +1 -0
- package/esm/deps/jsr.io/@std/assert/1.0.4/never.d.ts.map +1 -0
- package/esm/deps/jsr.io/@std/assert/1.0.4/not_equals.d.ts.map +1 -0
- package/esm/deps/jsr.io/@std/assert/1.0.4/not_instance_of.d.ts.map +1 -0
- package/esm/deps/jsr.io/@std/assert/1.0.4/not_match.d.ts.map +1 -0
- package/esm/deps/jsr.io/@std/assert/1.0.4/not_strict_equals.d.ts.map +1 -0
- package/esm/deps/jsr.io/@std/assert/1.0.4/object_match.d.ts.map +1 -0
- package/esm/deps/jsr.io/@std/assert/1.0.4/rejects.d.ts.map +1 -0
- package/esm/deps/jsr.io/@std/assert/1.0.4/strict_equals.d.ts.map +1 -0
- package/esm/deps/jsr.io/@std/assert/1.0.4/string_includes.d.ts.map +1 -0
- package/esm/deps/jsr.io/@std/assert/1.0.4/throws.d.ts.map +1 -0
- package/esm/deps/jsr.io/@std/assert/1.0.4/unimplemented.d.ts.map +1 -0
- package/esm/deps/jsr.io/@std/assert/1.0.4/unreachable.d.ts.map +1 -0
- package/esm/deps/jsr.io/@std/internal/1.0.3/build_message.d.ts.map +1 -0
- package/esm/deps/jsr.io/@std/internal/1.0.3/diff.d.ts.map +1 -0
- package/esm/deps/jsr.io/@std/internal/1.0.3/diff_str.d.ts.map +1 -0
- package/esm/deps/jsr.io/@std/internal/1.0.3/format.d.ts.map +1 -0
- package/esm/deps/jsr.io/@std/internal/1.0.3/mod.d.ts.map +1 -0
- package/esm/deps/jsr.io/@std/internal/1.0.3/styles.d.ts.map +1 -0
- package/esm/deps/jsr.io/@std/internal/1.0.3/types.d.ts.map +1 -0
- package/esm/dsl/ModelDriver.d.ts +1 -2
- package/esm/dsl/ModelDriver.d.ts.map +1 -1
- package/esm/dsl/ModelDriver.js +2 -19
- package/esm/dsl/OperationDriver.d.ts +1 -2
- package/esm/dsl/OperationDriver.d.ts.map +1 -1
- package/esm/dsl/OperationDriver.js +2 -20
- package/esm/dsl/ValueBase.d.ts +2 -2
- package/esm/dsl/ValueBase.d.ts.map +1 -1
- package/esm/dsl/ValueBase.js +2 -3
- package/esm/dsl/withConfig.d.ts +2 -2
- package/esm/oas/document/Document.d.ts +2 -2
- package/esm/oas/document/Document.d.ts.map +1 -1
- package/esm/oas/info/Info.d.ts +4 -4
- package/esm/oas/info/Info.d.ts.map +1 -1
- package/esm/oas/mediaType/MediaType.d.ts +5 -6
- package/esm/oas/mediaType/MediaType.d.ts.map +1 -1
- package/esm/oas/mediaType/MediaType.js +21 -24
- package/esm/oas/object/Object.d.ts +10 -11
- package/esm/oas/object/Object.d.ts.map +1 -1
- package/esm/oas/object/Object.js +55 -42
- package/esm/oas/object/toObject.js +1 -1
- package/esm/oas/operation/Operation.d.ts +18 -19
- package/esm/oas/operation/Operation.d.ts.map +1 -1
- package/esm/oas/operation/Operation.js +77 -48
- package/esm/oas/operation/mocks.d.ts.map +1 -0
- package/esm/oas/operation/toOperationsV3.d.ts +1 -1
- package/esm/oas/operation/toOperationsV3.d.ts.map +1 -1
- package/esm/oas/operation/toOperationsV3.js +3 -3
- package/esm/oas/operation/toOperationsV3.test.d.ts.map +1 -0
- package/esm/oas/parameter/Parameter.d.ts +20 -21
- package/esm/oas/parameter/Parameter.d.ts.map +1 -1
- package/esm/oas/parameter/Parameter.js +87 -52
- package/esm/oas/pathItem/PathItem.d.ts +7 -8
- package/esm/oas/pathItem/PathItem.d.ts.map +1 -1
- package/esm/oas/pathItem/PathItem.js +22 -25
- package/esm/oas/ref/Ref.d.ts +1 -1
- package/esm/oas/ref/Ref.d.ts.map +1 -1
- package/esm/oas/ref/Ref.js +7 -9
- package/esm/oas/requestBody/RequestBody.d.ts +5 -6
- package/esm/oas/requestBody/RequestBody.d.ts.map +1 -1
- package/esm/oas/requestBody/RequestBody.js +22 -25
- package/esm/oas/response/Response.d.ts +7 -8
- package/esm/oas/response/Response.d.ts.map +1 -1
- package/esm/oas/response/Response.js +23 -26
- package/esm/test/mockParseContext.d.ts.map +1 -0
- package/esm/types/GeneratedValue.d.ts +1 -1
- package/esm/types/GeneratedValue.d.ts.map +1 -1
- package/esm/typescript/List.d.ts +70 -3
- package/esm/typescript/List.d.ts.map +1 -1
- package/esm/typescript/List.js +94 -6
- package/package.json +1 -1
- package/script/_dnt.test_shims.d.ts.map +1 -0
- package/script/context/GenerateContext.d.ts +12 -4
- package/script/context/GenerateContext.d.ts.map +1 -1
- package/script/context/GenerateContext.js +57 -31
- package/script/deps/jsr.io/@std/assert/1.0.4/almost_equals.d.ts.map +1 -0
- package/script/deps/jsr.io/@std/assert/1.0.4/array_includes.d.ts.map +1 -0
- package/script/deps/jsr.io/@std/assert/1.0.4/assert.d.ts.map +1 -0
- package/script/deps/jsr.io/@std/assert/1.0.4/assertion_error.d.ts.map +1 -0
- package/script/deps/jsr.io/@std/assert/1.0.4/equal.d.ts.map +1 -0
- package/script/deps/jsr.io/@std/assert/1.0.4/equals.d.ts.map +1 -0
- package/script/deps/jsr.io/@std/assert/1.0.4/exists.d.ts.map +1 -0
- package/script/deps/jsr.io/@std/assert/1.0.4/fail.d.ts.map +1 -0
- package/script/deps/jsr.io/@std/assert/1.0.4/false.d.ts.map +1 -0
- package/script/deps/jsr.io/@std/assert/1.0.4/greater.d.ts.map +1 -0
- package/script/deps/jsr.io/@std/assert/1.0.4/greater_or_equal.d.ts.map +1 -0
- package/script/deps/jsr.io/@std/assert/1.0.4/instance_of.d.ts.map +1 -0
- package/script/deps/jsr.io/@std/assert/1.0.4/is_error.d.ts.map +1 -0
- package/script/deps/jsr.io/@std/assert/1.0.4/less.d.ts.map +1 -0
- package/script/deps/jsr.io/@std/assert/1.0.4/less_or_equal.d.ts.map +1 -0
- package/script/deps/jsr.io/@std/assert/1.0.4/match.d.ts.map +1 -0
- package/script/deps/jsr.io/@std/assert/1.0.4/mod.d.ts.map +1 -0
- package/script/deps/jsr.io/@std/assert/1.0.4/never.d.ts.map +1 -0
- package/script/deps/jsr.io/@std/assert/1.0.4/not_equals.d.ts.map +1 -0
- package/script/deps/jsr.io/@std/assert/1.0.4/not_instance_of.d.ts.map +1 -0
- package/script/deps/jsr.io/@std/assert/1.0.4/not_match.d.ts.map +1 -0
- package/script/deps/jsr.io/@std/assert/1.0.4/not_strict_equals.d.ts.map +1 -0
- package/script/deps/jsr.io/@std/assert/1.0.4/object_match.d.ts.map +1 -0
- package/script/deps/jsr.io/@std/assert/1.0.4/rejects.d.ts.map +1 -0
- package/script/deps/jsr.io/@std/assert/1.0.4/strict_equals.d.ts.map +1 -0
- package/script/deps/jsr.io/@std/assert/1.0.4/string_includes.d.ts.map +1 -0
- package/script/deps/jsr.io/@std/assert/1.0.4/throws.d.ts.map +1 -0
- package/script/deps/jsr.io/@std/assert/1.0.4/unimplemented.d.ts.map +1 -0
- package/script/deps/jsr.io/@std/assert/1.0.4/unreachable.d.ts.map +1 -0
- package/script/deps/jsr.io/@std/internal/1.0.3/build_message.d.ts.map +1 -0
- package/script/deps/jsr.io/@std/internal/1.0.3/diff.d.ts.map +1 -0
- package/script/deps/jsr.io/@std/internal/1.0.3/diff_str.d.ts.map +1 -0
- package/script/deps/jsr.io/@std/internal/1.0.3/format.d.ts.map +1 -0
- package/script/deps/jsr.io/@std/internal/1.0.3/mod.d.ts.map +1 -0
- package/script/deps/jsr.io/@std/internal/1.0.3/styles.d.ts.map +1 -0
- package/script/deps/jsr.io/@std/internal/1.0.3/types.d.ts.map +1 -0
- package/script/dsl/ModelDriver.d.ts +1 -2
- package/script/dsl/ModelDriver.d.ts.map +1 -1
- package/script/dsl/ModelDriver.js +2 -19
- package/script/dsl/OperationDriver.d.ts +1 -2
- package/script/dsl/OperationDriver.d.ts.map +1 -1
- package/script/dsl/OperationDriver.js +2 -20
- package/script/dsl/ValueBase.d.ts +2 -2
- package/script/dsl/ValueBase.d.ts.map +1 -1
- package/script/dsl/ValueBase.js +2 -3
- package/script/dsl/withConfig.d.ts +2 -2
- package/script/oas/document/Document.d.ts +2 -2
- package/script/oas/document/Document.d.ts.map +1 -1
- package/script/oas/info/Info.d.ts +4 -4
- package/script/oas/info/Info.d.ts.map +1 -1
- package/script/oas/mediaType/MediaType.d.ts +5 -6
- package/script/oas/mediaType/MediaType.d.ts.map +1 -1
- package/script/oas/mediaType/MediaType.js +21 -24
- package/script/oas/object/Object.d.ts +10 -11
- package/script/oas/object/Object.d.ts.map +1 -1
- package/script/oas/object/Object.js +55 -42
- package/script/oas/object/toObject.js +1 -1
- package/script/oas/operation/Operation.d.ts +18 -19
- package/script/oas/operation/Operation.d.ts.map +1 -1
- package/script/oas/operation/Operation.js +77 -48
- package/script/oas/operation/mocks.d.ts.map +1 -0
- package/script/oas/operation/toOperationsV3.d.ts +1 -1
- package/script/oas/operation/toOperationsV3.d.ts.map +1 -1
- package/script/oas/operation/toOperationsV3.js +3 -3
- package/script/oas/operation/toOperationsV3.test.d.ts.map +1 -0
- package/script/oas/parameter/Parameter.d.ts +20 -21
- package/script/oas/parameter/Parameter.d.ts.map +1 -1
- package/script/oas/parameter/Parameter.js +87 -52
- package/script/oas/pathItem/PathItem.d.ts +7 -8
- package/script/oas/pathItem/PathItem.d.ts.map +1 -1
- package/script/oas/pathItem/PathItem.js +22 -25
- package/script/oas/ref/Ref.d.ts +1 -1
- package/script/oas/ref/Ref.d.ts.map +1 -1
- package/script/oas/ref/Ref.js +7 -9
- package/script/oas/requestBody/RequestBody.d.ts +5 -6
- package/script/oas/requestBody/RequestBody.d.ts.map +1 -1
- package/script/oas/requestBody/RequestBody.js +22 -25
- package/script/oas/response/Response.d.ts +7 -8
- package/script/oas/response/Response.d.ts.map +1 -1
- package/script/oas/response/Response.js +23 -26
- package/script/test/mockParseContext.d.ts.map +1 -0
- package/script/types/GeneratedValue.d.ts +1 -1
- package/script/types/GeneratedValue.d.ts.map +1 -1
- package/script/typescript/List.d.ts +70 -3
- package/script/typescript/List.d.ts.map +1 -1
- package/script/typescript/List.js +94 -6
|
@@ -1,15 +1,3 @@
|
|
|
1
|
-
var __classPrivateFieldSet = (this && this.__classPrivateFieldSet) || function (receiver, state, value, kind, f) {
|
|
2
|
-
if (kind === "m") throw new TypeError("Private method is not writable");
|
|
3
|
-
if (kind === "a" && !f) throw new TypeError("Private accessor was defined without a setter");
|
|
4
|
-
if (typeof state === "function" ? receiver !== state || !f : !state.has(receiver)) throw new TypeError("Cannot write private member to an object whose class did not declare it");
|
|
5
|
-
return (kind === "a" ? f.call(receiver, value) : f ? f.value = value : state.set(receiver, value)), value;
|
|
6
|
-
};
|
|
7
|
-
var __classPrivateFieldGet = (this && this.__classPrivateFieldGet) || function (receiver, state, kind, f) {
|
|
8
|
-
if (kind === "a" && !f) throw new TypeError("Private accessor was defined without a getter");
|
|
9
|
-
if (typeof state === "function" ? receiver !== state || !f : !state.has(receiver)) throw new TypeError("Cannot read private member from an object whose class did not declare it");
|
|
10
|
-
return kind === "m" ? f : kind === "a" ? f.call(receiver) : f ? f.value : state.get(receiver);
|
|
11
|
-
};
|
|
12
|
-
var _OasMediaType_fields;
|
|
13
1
|
export class OasMediaType {
|
|
14
2
|
constructor(fields) {
|
|
15
3
|
Object.defineProperty(this, "oasType", {
|
|
@@ -18,17 +6,26 @@ export class OasMediaType {
|
|
|
18
6
|
writable: true,
|
|
19
7
|
value: 'mediaType'
|
|
20
8
|
});
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
9
|
+
Object.defineProperty(this, "mediaType", {
|
|
10
|
+
enumerable: true,
|
|
11
|
+
configurable: true,
|
|
12
|
+
writable: true,
|
|
13
|
+
value: void 0
|
|
14
|
+
});
|
|
15
|
+
Object.defineProperty(this, "schema", {
|
|
16
|
+
enumerable: true,
|
|
17
|
+
configurable: true,
|
|
18
|
+
writable: true,
|
|
19
|
+
value: void 0
|
|
20
|
+
});
|
|
21
|
+
Object.defineProperty(this, "examples", {
|
|
22
|
+
enumerable: true,
|
|
23
|
+
configurable: true,
|
|
24
|
+
writable: true,
|
|
25
|
+
value: void 0
|
|
26
|
+
});
|
|
27
|
+
this.mediaType = fields.mediaType;
|
|
28
|
+
this.schema = fields.schema;
|
|
29
|
+
this.examples = fields.examples;
|
|
32
30
|
}
|
|
33
31
|
}
|
|
34
|
-
_OasMediaType_fields = new WeakMap();
|
|
@@ -4,10 +4,10 @@ import type { CustomValue } from '../../types/CustomValue.js';
|
|
|
4
4
|
export type OasObjectFields = {
|
|
5
5
|
title?: string;
|
|
6
6
|
description?: string;
|
|
7
|
-
properties
|
|
8
|
-
required
|
|
9
|
-
additionalProperties?: boolean | OasSchema | OasRef<'schema'
|
|
10
|
-
nullable?: boolean;
|
|
7
|
+
properties?: Record<string, OasSchema | OasRef<'schema'> | CustomValue> | undefined;
|
|
8
|
+
required?: string[] | undefined;
|
|
9
|
+
additionalProperties?: boolean | OasSchema | OasRef<'schema'> | undefined;
|
|
10
|
+
nullable?: boolean | undefined;
|
|
11
11
|
};
|
|
12
12
|
export type RemovePropertyArgs = {
|
|
13
13
|
name: string;
|
|
@@ -18,18 +18,17 @@ export type AddPropertyArgs = {
|
|
|
18
18
|
required?: boolean;
|
|
19
19
|
};
|
|
20
20
|
export declare class OasObject {
|
|
21
|
-
#private;
|
|
22
21
|
oasType: 'schema';
|
|
23
22
|
type: 'object';
|
|
23
|
+
title?: string;
|
|
24
|
+
description?: string;
|
|
25
|
+
properties?: Record<string, OasSchema | OasRef<'schema'> | CustomValue> | undefined;
|
|
26
|
+
required?: string[] | undefined;
|
|
27
|
+
additionalProperties?: boolean | OasSchema | OasRef<'schema'> | undefined;
|
|
28
|
+
nullable?: boolean | undefined;
|
|
24
29
|
constructor(fields: OasObjectFields);
|
|
25
30
|
/** Creates new empty OasObject */
|
|
26
31
|
static empty(): OasObject;
|
|
27
|
-
get title(): string | undefined;
|
|
28
|
-
get description(): string | undefined;
|
|
29
|
-
get properties(): Record<string, OasSchema | OasRef<'schema'> | CustomValue> | undefined;
|
|
30
|
-
get required(): string[] | undefined;
|
|
31
|
-
get additionalProperties(): boolean | OasSchema | OasRef<'schema'> | undefined;
|
|
32
|
-
get nullable(): boolean | undefined;
|
|
33
32
|
addProperty({ name, schema, required }: AddPropertyArgs): OasObject;
|
|
34
33
|
removeProperty({ name }: RemovePropertyArgs): OasObject;
|
|
35
34
|
isRef(): this is OasRef<'schema'>;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Object.d.ts","sourceRoot":"","sources":["../../../src/oas/object/Object.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,eAAe,CAAA;AAC3C,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,qBAAqB,CAAA;AACpD,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,4BAA4B,CAAA;AAE7D,MAAM,MAAM,eAAe,GAAG;IAC5B,KAAK,CAAC,EAAE,MAAM,CAAA;IACd,WAAW,CAAC,EAAE,MAAM,CAAA;IACpB,UAAU,
|
|
1
|
+
{"version":3,"file":"Object.d.ts","sourceRoot":"","sources":["../../../src/oas/object/Object.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,eAAe,CAAA;AAC3C,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,qBAAqB,CAAA;AACpD,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,4BAA4B,CAAA;AAE7D,MAAM,MAAM,eAAe,GAAG;IAC5B,KAAK,CAAC,EAAE,MAAM,CAAA;IACd,WAAW,CAAC,EAAE,MAAM,CAAA;IACpB,UAAU,CAAC,EACP,MAAM,CAAC,MAAM,EAAE,SAAS,GAAG,MAAM,CAAC,QAAQ,CAAC,GAAG,WAAW,CAAC,GAC1D,SAAS,CAAA;IACb,QAAQ,CAAC,EAAE,MAAM,EAAE,GAAG,SAAS,CAAA;IAC/B,oBAAoB,CAAC,EAAE,OAAO,GAAG,SAAS,GAAG,MAAM,CAAC,QAAQ,CAAC,GAAG,SAAS,CAAA;IACzE,QAAQ,CAAC,EAAE,OAAO,GAAG,SAAS,CAAA;CAC/B,CAAA;AAED,MAAM,MAAM,kBAAkB,GAAG;IAC/B,IAAI,EAAE,MAAM,CAAA;CACb,CAAA;AAED,MAAM,MAAM,eAAe,GAAG;IAC5B,IAAI,EAAE,MAAM,CAAA;IACZ,MAAM,EAAE,SAAS,GAAG,MAAM,CAAC,QAAQ,CAAC,GAAG,WAAW,GAAG,SAAS,CAAA;IAC9D,QAAQ,CAAC,EAAE,OAAO,CAAA;CACnB,CAAA;AAED,qBAAa,SAAS;IACpB,OAAO,EAAE,QAAQ,CAAW;IAC5B,IAAI,EAAE,QAAQ,CAAW;IACzB,KAAK,CAAC,EAAE,MAAM,CAAA;IACd,WAAW,CAAC,EAAE,MAAM,CAAA;IACpB,UAAU,CAAC,EACP,MAAM,CAAC,MAAM,EAAE,SAAS,GAAG,MAAM,CAAC,QAAQ,CAAC,GAAG,WAAW,CAAC,GAC1D,SAAS,CAAA;IACb,QAAQ,CAAC,EAAE,MAAM,EAAE,GAAG,SAAS,CAAA;IAC/B,oBAAoB,CAAC,EAAE,OAAO,GAAG,SAAS,GAAG,MAAM,CAAC,QAAQ,CAAC,GAAG,SAAS,CAAA;IACzE,QAAQ,CAAC,EAAE,OAAO,GAAG,SAAS,CAAA;gBAElB,MAAM,EAAE,eAAe;IASnC,kCAAkC;IAClC,MAAM,CAAC,KAAK,IAAI,SAAS;IAOzB,WAAW,CAAC,EAAE,IAAI,EAAE,MAAM,EAAE,QAAQ,EAAE,EAAE,eAAe,GAAG,SAAS;IAkBnE,cAAc,CAAC,EAAE,IAAI,EAAE,EAAE,kBAAkB,GAAG,SAAS;IAiBvD,KAAK,IAAI,IAAI,IAAI,MAAM,CAAC,QAAQ,CAAC;IAIjC,OAAO,IAAI,SAAS;IAIpB,WAAW,IAAI,SAAS;CAGzB"}
|
package/esm/oas/object/Object.js
CHANGED
|
@@ -1,15 +1,3 @@
|
|
|
1
|
-
var __classPrivateFieldSet = (this && this.__classPrivateFieldSet) || function (receiver, state, value, kind, f) {
|
|
2
|
-
if (kind === "m") throw new TypeError("Private method is not writable");
|
|
3
|
-
if (kind === "a" && !f) throw new TypeError("Private accessor was defined without a setter");
|
|
4
|
-
if (typeof state === "function" ? receiver !== state || !f : !state.has(receiver)) throw new TypeError("Cannot write private member to an object whose class did not declare it");
|
|
5
|
-
return (kind === "a" ? f.call(receiver, value) : f ? f.value = value : state.set(receiver, value)), value;
|
|
6
|
-
};
|
|
7
|
-
var __classPrivateFieldGet = (this && this.__classPrivateFieldGet) || function (receiver, state, kind, f) {
|
|
8
|
-
if (kind === "a" && !f) throw new TypeError("Private accessor was defined without a getter");
|
|
9
|
-
if (typeof state === "function" ? receiver !== state || !f : !state.has(receiver)) throw new TypeError("Cannot read private member from an object whose class did not declare it");
|
|
10
|
-
return kind === "m" ? f : kind === "a" ? f.call(receiver) : f ? f.value : state.get(receiver);
|
|
11
|
-
};
|
|
12
|
-
var _OasObject_fields;
|
|
13
1
|
export class OasObject {
|
|
14
2
|
constructor(fields) {
|
|
15
3
|
Object.defineProperty(this, "oasType", {
|
|
@@ -24,8 +12,48 @@ export class OasObject {
|
|
|
24
12
|
writable: true,
|
|
25
13
|
value: 'object'
|
|
26
14
|
});
|
|
27
|
-
|
|
28
|
-
|
|
15
|
+
Object.defineProperty(this, "title", {
|
|
16
|
+
enumerable: true,
|
|
17
|
+
configurable: true,
|
|
18
|
+
writable: true,
|
|
19
|
+
value: void 0
|
|
20
|
+
});
|
|
21
|
+
Object.defineProperty(this, "description", {
|
|
22
|
+
enumerable: true,
|
|
23
|
+
configurable: true,
|
|
24
|
+
writable: true,
|
|
25
|
+
value: void 0
|
|
26
|
+
});
|
|
27
|
+
Object.defineProperty(this, "properties", {
|
|
28
|
+
enumerable: true,
|
|
29
|
+
configurable: true,
|
|
30
|
+
writable: true,
|
|
31
|
+
value: void 0
|
|
32
|
+
});
|
|
33
|
+
Object.defineProperty(this, "required", {
|
|
34
|
+
enumerable: true,
|
|
35
|
+
configurable: true,
|
|
36
|
+
writable: true,
|
|
37
|
+
value: void 0
|
|
38
|
+
});
|
|
39
|
+
Object.defineProperty(this, "additionalProperties", {
|
|
40
|
+
enumerable: true,
|
|
41
|
+
configurable: true,
|
|
42
|
+
writable: true,
|
|
43
|
+
value: void 0
|
|
44
|
+
});
|
|
45
|
+
Object.defineProperty(this, "nullable", {
|
|
46
|
+
enumerable: true,
|
|
47
|
+
configurable: true,
|
|
48
|
+
writable: true,
|
|
49
|
+
value: void 0
|
|
50
|
+
});
|
|
51
|
+
this.title = fields.title;
|
|
52
|
+
this.description = fields.description;
|
|
53
|
+
this.properties = fields.properties;
|
|
54
|
+
this.required = fields.required;
|
|
55
|
+
this.additionalProperties = fields.additionalProperties;
|
|
56
|
+
this.nullable = fields.nullable;
|
|
29
57
|
}
|
|
30
58
|
/** Creates new empty OasObject */
|
|
31
59
|
static empty() {
|
|
@@ -34,48 +62,34 @@ export class OasObject {
|
|
|
34
62
|
required: []
|
|
35
63
|
});
|
|
36
64
|
}
|
|
37
|
-
get title() {
|
|
38
|
-
return __classPrivateFieldGet(this, _OasObject_fields, "f").title;
|
|
39
|
-
}
|
|
40
|
-
get description() {
|
|
41
|
-
return __classPrivateFieldGet(this, _OasObject_fields, "f").description;
|
|
42
|
-
}
|
|
43
|
-
get properties() {
|
|
44
|
-
return __classPrivateFieldGet(this, _OasObject_fields, "f").properties;
|
|
45
|
-
}
|
|
46
|
-
get required() {
|
|
47
|
-
return __classPrivateFieldGet(this, _OasObject_fields, "f").required;
|
|
48
|
-
}
|
|
49
|
-
get additionalProperties() {
|
|
50
|
-
return __classPrivateFieldGet(this, _OasObject_fields, "f").additionalProperties;
|
|
51
|
-
}
|
|
52
|
-
get nullable() {
|
|
53
|
-
return __classPrivateFieldGet(this, _OasObject_fields, "f").nullable;
|
|
54
|
-
}
|
|
55
65
|
addProperty({ name, schema, required }) {
|
|
56
66
|
if (!schema) {
|
|
57
67
|
return this;
|
|
58
68
|
}
|
|
59
69
|
return new OasObject({
|
|
60
|
-
|
|
70
|
+
title: this.title,
|
|
71
|
+
description: this.description,
|
|
61
72
|
properties: {
|
|
62
|
-
...
|
|
73
|
+
...this.properties,
|
|
63
74
|
[name]: schema
|
|
64
75
|
},
|
|
65
|
-
required: required
|
|
66
|
-
|
|
67
|
-
|
|
76
|
+
required: required ? [...(this.required ?? []), name] : this.required,
|
|
77
|
+
additionalProperties: this.additionalProperties,
|
|
78
|
+
nullable: this.nullable
|
|
68
79
|
});
|
|
69
80
|
}
|
|
70
81
|
removeProperty({ name }) {
|
|
71
|
-
if (!
|
|
82
|
+
if (!this.properties?.[name]) {
|
|
72
83
|
return this;
|
|
73
84
|
}
|
|
74
|
-
const { [name]: _removed, ...properties } =
|
|
85
|
+
const { [name]: _removed, ...properties } = this.properties;
|
|
75
86
|
return new OasObject({
|
|
76
|
-
|
|
87
|
+
title: this.title,
|
|
88
|
+
description: this.description,
|
|
77
89
|
properties,
|
|
78
|
-
required:
|
|
90
|
+
required: this.required?.filter(n => n !== name),
|
|
91
|
+
additionalProperties: this.additionalProperties,
|
|
92
|
+
nullable: this.nullable
|
|
79
93
|
});
|
|
80
94
|
}
|
|
81
95
|
isRef() {
|
|
@@ -88,4 +102,3 @@ export class OasObject {
|
|
|
88
102
|
return this;
|
|
89
103
|
}
|
|
90
104
|
}
|
|
91
|
-
_OasObject_fields = new WeakMap();
|
|
@@ -12,7 +12,7 @@ export const toObject = ({ value, context }) => {
|
|
|
12
12
|
schemas: properties,
|
|
13
13
|
context
|
|
14
14
|
})),
|
|
15
|
-
required: required
|
|
15
|
+
required: required,
|
|
16
16
|
additionalProperties: context.trace('additionalProperties', () => toAdditionalPropertiesV3({ additionalProperties, context }))
|
|
17
17
|
};
|
|
18
18
|
return new OasObject(fields);
|
|
@@ -11,14 +11,14 @@ export type OperationFields = {
|
|
|
11
11
|
path: string;
|
|
12
12
|
method: Method;
|
|
13
13
|
pathItem: OasPathItem;
|
|
14
|
-
operationId
|
|
15
|
-
summary
|
|
16
|
-
tags
|
|
17
|
-
description
|
|
18
|
-
parameters
|
|
19
|
-
requestBody
|
|
14
|
+
operationId?: string | undefined;
|
|
15
|
+
summary?: string | undefined;
|
|
16
|
+
tags?: string[] | undefined;
|
|
17
|
+
description?: string | undefined;
|
|
18
|
+
parameters?: (OasParameter | OasRef<'parameter'>)[] | undefined;
|
|
19
|
+
requestBody?: OasRequestBody | OasRef<'requestBody'> | undefined;
|
|
20
20
|
responses: Record<string, OasResponse | OasRef<'response'>>;
|
|
21
|
-
deprecated
|
|
21
|
+
deprecated?: boolean | undefined;
|
|
22
22
|
};
|
|
23
23
|
type ToRequestBodyMapArgs = {
|
|
24
24
|
schema: OasSchema | OasRef<'schema'>;
|
|
@@ -26,8 +26,18 @@ type ToRequestBodyMapArgs = {
|
|
|
26
26
|
};
|
|
27
27
|
/** Operation represents a resource path and a method that can be enacted against it */
|
|
28
28
|
export declare class OasOperation {
|
|
29
|
-
#private;
|
|
30
29
|
oasType: 'operation';
|
|
30
|
+
path: string;
|
|
31
|
+
method: Method;
|
|
32
|
+
pathItem: OasPathItem;
|
|
33
|
+
operationId: string | undefined;
|
|
34
|
+
summary: string | undefined;
|
|
35
|
+
tags: string[] | undefined;
|
|
36
|
+
description: string | undefined;
|
|
37
|
+
parameters: (OasParameter | OasRef<'parameter'>)[] | undefined;
|
|
38
|
+
requestBody: OasRequestBody | OasRef<'requestBody'> | undefined;
|
|
39
|
+
responses: Record<string, OasResponse | OasRef<'response'>>;
|
|
40
|
+
deprecated: boolean | undefined;
|
|
31
41
|
constructor(fields: OperationFields);
|
|
32
42
|
toSuccessResponse(): OasResponse | OasRef<'response'>;
|
|
33
43
|
toRequestBody<V>(map: ({ schema, requestBody }: ToRequestBodyMapArgs) => V, mediaType?: string): V | undefined;
|
|
@@ -39,17 +49,6 @@ export declare class OasOperation {
|
|
|
39
49
|
*/
|
|
40
50
|
toParams(filter?: OasParameterLocation[]): OasParameter[];
|
|
41
51
|
toParametersObject(filter?: OasParameterLocation[]): OasObject;
|
|
42
|
-
get path(): string;
|
|
43
|
-
get method(): Method;
|
|
44
|
-
get pathItem(): OasPathItem;
|
|
45
|
-
get operationId(): string | undefined;
|
|
46
|
-
get summary(): string | undefined;
|
|
47
|
-
get tags(): string[] | undefined;
|
|
48
|
-
get description(): string | undefined;
|
|
49
|
-
get parameters(): (OasParameter | OasRef<'parameter'>)[] | undefined;
|
|
50
|
-
get requestBody(): OasRequestBody | OasRef<'requestBody'> | undefined;
|
|
51
|
-
get responses(): Record<string, OasResponse | OasRef<'response'>>;
|
|
52
|
-
get deprecated(): boolean | undefined;
|
|
53
52
|
}
|
|
54
53
|
export {};
|
|
55
54
|
//# 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,KAAK,EAAE,MAAM,EAAE,MAAM,uBAAuB,CAAA;AACnD,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,yBAAyB,CAAA;AAC1D,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,2BAA2B,CAAA;AAC7D,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,+BAA+B,CAAA;AACnE,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,yBAAyB,CAAA;AAC1D,OAAO,KAAK,EAAE,oBAAoB,EAAE,MAAM,iCAAiC,CAAA;AAC3E,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,qBAAqB,CAAA;AACpD,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,eAAe,CAAA;AAC3C,OAAO,EAAE,SAAS,EAAE,MAAM,qBAAqB,CAAA;AAE/C,MAAM,MAAM,eAAe,GAAG;IAC5B,IAAI,EAAE,MAAM,CAAA;IACZ,MAAM,EAAE,MAAM,CAAA;IACd,QAAQ,EAAE,WAAW,CAAA;IACrB,WAAW,EAAE,MAAM,GAAG,SAAS,CAAA;
|
|
1
|
+
{"version":3,"file":"Operation.d.ts","sourceRoot":"","sources":["../../../src/oas/operation/Operation.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,uBAAuB,CAAA;AACnD,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,yBAAyB,CAAA;AAC1D,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,2BAA2B,CAAA;AAC7D,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,+BAA+B,CAAA;AACnE,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,yBAAyB,CAAA;AAC1D,OAAO,KAAK,EAAE,oBAAoB,EAAE,MAAM,iCAAiC,CAAA;AAC3E,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,qBAAqB,CAAA;AACpD,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,eAAe,CAAA;AAC3C,OAAO,EAAE,SAAS,EAAE,MAAM,qBAAqB,CAAA;AAE/C,MAAM,MAAM,eAAe,GAAG;IAC5B,IAAI,EAAE,MAAM,CAAA;IACZ,MAAM,EAAE,MAAM,CAAA;IACd,QAAQ,EAAE,WAAW,CAAA;IACrB,WAAW,CAAC,EAAE,MAAM,GAAG,SAAS,CAAA;IAChC,OAAO,CAAC,EAAE,MAAM,GAAG,SAAS,CAAA;IAC5B,IAAI,CAAC,EAAE,MAAM,EAAE,GAAG,SAAS,CAAA;IAC3B,WAAW,CAAC,EAAE,MAAM,GAAG,SAAS,CAAA;IAChC,UAAU,CAAC,EAAE,CAAC,YAAY,GAAG,MAAM,CAAC,WAAW,CAAC,CAAC,EAAE,GAAG,SAAS,CAAA;IAC/D,WAAW,CAAC,EAAE,cAAc,GAAG,MAAM,CAAC,aAAa,CAAC,GAAG,SAAS,CAAA;IAChE,SAAS,EAAE,MAAM,CAAC,MAAM,EAAE,WAAW,GAAG,MAAM,CAAC,UAAU,CAAC,CAAC,CAAA;IAC3D,UAAU,CAAC,EAAE,OAAO,GAAG,SAAS,CAAA;CACjC,CAAA;AAED,KAAK,oBAAoB,GAAG;IAC1B,MAAM,EAAE,SAAS,GAAG,MAAM,CAAC,QAAQ,CAAC,CAAA;IACpC,WAAW,EAAE,cAAc,CAAA;CAC5B,CAAA;AAED,uFAAuF;AACvF,qBAAa,YAAY;IACvB,OAAO,EAAE,WAAW,CAAc;IAElC,IAAI,EAAE,MAAM,CAAA;IACZ,MAAM,EAAE,MAAM,CAAA;IACd,QAAQ,EAAE,WAAW,CAAA;IACrB,WAAW,EAAE,MAAM,GAAG,SAAS,CAAA;IAC/B,OAAO,EAAE,MAAM,GAAG,SAAS,CAAA;IAC3B,IAAI,EAAE,MAAM,EAAE,GAAG,SAAS,CAAA;IAC1B,WAAW,EAAE,MAAM,GAAG,SAAS,CAAA;IAC/B,UAAU,EAAE,CAAC,YAAY,GAAG,MAAM,CAAC,WAAW,CAAC,CAAC,EAAE,GAAG,SAAS,CAAA;IAC9D,WAAW,EAAE,cAAc,GAAG,MAAM,CAAC,aAAa,CAAC,GAAG,SAAS,CAAA;IAC/D,SAAS,EAAE,MAAM,CAAC,MAAM,EAAE,WAAW,GAAG,MAAM,CAAC,UAAU,CAAC,CAAC,CAAA;IAC3D,UAAU,EAAE,OAAO,GAAG,SAAS,CAAA;gBAEnB,MAAM,EAAE,eAAe;IAcnC,iBAAiB,IAAI,WAAW,GAAG,MAAM,CAAC,UAAU,CAAC;IAWrD,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;IAUzD,kBAAkB,CAAC,MAAM,CAAC,EAAE,oBAAoB,EAAE;CAWnD"}
|
|
@@ -1,15 +1,3 @@
|
|
|
1
|
-
var __classPrivateFieldSet = (this && this.__classPrivateFieldSet) || function (receiver, state, value, kind, f) {
|
|
2
|
-
if (kind === "m") throw new TypeError("Private method is not writable");
|
|
3
|
-
if (kind === "a" && !f) throw new TypeError("Private accessor was defined without a setter");
|
|
4
|
-
if (typeof state === "function" ? receiver !== state || !f : !state.has(receiver)) throw new TypeError("Cannot write private member to an object whose class did not declare it");
|
|
5
|
-
return (kind === "a" ? f.call(receiver, value) : f ? f.value = value : state.set(receiver, value)), value;
|
|
6
|
-
};
|
|
7
|
-
var __classPrivateFieldGet = (this && this.__classPrivateFieldGet) || function (receiver, state, kind, f) {
|
|
8
|
-
if (kind === "a" && !f) throw new TypeError("Private accessor was defined without a getter");
|
|
9
|
-
if (typeof state === "function" ? receiver !== state || !f : !state.has(receiver)) throw new TypeError("Cannot read private member from an object whose class did not declare it");
|
|
10
|
-
return kind === "m" ? f : kind === "a" ? f.call(receiver) : f ? f.value : state.get(receiver);
|
|
11
|
-
};
|
|
12
|
-
var _OasOperation_fields;
|
|
13
1
|
import { OasObject } from '../object/Object.js';
|
|
14
2
|
/** Operation represents a resource path and a method that can be enacted against it */
|
|
15
3
|
export class OasOperation {
|
|
@@ -20,8 +8,83 @@ export class OasOperation {
|
|
|
20
8
|
writable: true,
|
|
21
9
|
value: 'operation'
|
|
22
10
|
});
|
|
23
|
-
|
|
24
|
-
|
|
11
|
+
Object.defineProperty(this, "path", {
|
|
12
|
+
enumerable: true,
|
|
13
|
+
configurable: true,
|
|
14
|
+
writable: true,
|
|
15
|
+
value: void 0
|
|
16
|
+
});
|
|
17
|
+
Object.defineProperty(this, "method", {
|
|
18
|
+
enumerable: true,
|
|
19
|
+
configurable: true,
|
|
20
|
+
writable: true,
|
|
21
|
+
value: void 0
|
|
22
|
+
});
|
|
23
|
+
Object.defineProperty(this, "pathItem", {
|
|
24
|
+
enumerable: true,
|
|
25
|
+
configurable: true,
|
|
26
|
+
writable: true,
|
|
27
|
+
value: void 0
|
|
28
|
+
});
|
|
29
|
+
Object.defineProperty(this, "operationId", {
|
|
30
|
+
enumerable: true,
|
|
31
|
+
configurable: true,
|
|
32
|
+
writable: true,
|
|
33
|
+
value: void 0
|
|
34
|
+
});
|
|
35
|
+
Object.defineProperty(this, "summary", {
|
|
36
|
+
enumerable: true,
|
|
37
|
+
configurable: true,
|
|
38
|
+
writable: true,
|
|
39
|
+
value: void 0
|
|
40
|
+
});
|
|
41
|
+
Object.defineProperty(this, "tags", {
|
|
42
|
+
enumerable: true,
|
|
43
|
+
configurable: true,
|
|
44
|
+
writable: true,
|
|
45
|
+
value: void 0
|
|
46
|
+
});
|
|
47
|
+
Object.defineProperty(this, "description", {
|
|
48
|
+
enumerable: true,
|
|
49
|
+
configurable: true,
|
|
50
|
+
writable: true,
|
|
51
|
+
value: void 0
|
|
52
|
+
});
|
|
53
|
+
Object.defineProperty(this, "parameters", {
|
|
54
|
+
enumerable: true,
|
|
55
|
+
configurable: true,
|
|
56
|
+
writable: true,
|
|
57
|
+
value: void 0
|
|
58
|
+
});
|
|
59
|
+
Object.defineProperty(this, "requestBody", {
|
|
60
|
+
enumerable: true,
|
|
61
|
+
configurable: true,
|
|
62
|
+
writable: true,
|
|
63
|
+
value: void 0
|
|
64
|
+
});
|
|
65
|
+
Object.defineProperty(this, "responses", {
|
|
66
|
+
enumerable: true,
|
|
67
|
+
configurable: true,
|
|
68
|
+
writable: true,
|
|
69
|
+
value: void 0
|
|
70
|
+
});
|
|
71
|
+
Object.defineProperty(this, "deprecated", {
|
|
72
|
+
enumerable: true,
|
|
73
|
+
configurable: true,
|
|
74
|
+
writable: true,
|
|
75
|
+
value: void 0
|
|
76
|
+
});
|
|
77
|
+
this.path = fields.path;
|
|
78
|
+
this.method = fields.method;
|
|
79
|
+
this.pathItem = fields.pathItem;
|
|
80
|
+
this.operationId = fields.operationId;
|
|
81
|
+
this.summary = fields.summary;
|
|
82
|
+
this.tags = fields.tags;
|
|
83
|
+
this.description = fields.description;
|
|
84
|
+
this.parameters = fields.parameters;
|
|
85
|
+
this.requestBody = fields.requestBody;
|
|
86
|
+
this.responses = fields.responses;
|
|
87
|
+
this.deprecated = fields.deprecated;
|
|
25
88
|
}
|
|
26
89
|
toSuccessResponse() {
|
|
27
90
|
const { default: defaultResponse, ...httpCodeResponses } = this.responses;
|
|
@@ -57,38 +120,4 @@ export class OasOperation {
|
|
|
57
120
|
});
|
|
58
121
|
}, OasObject.empty());
|
|
59
122
|
}
|
|
60
|
-
get path() {
|
|
61
|
-
return __classPrivateFieldGet(this, _OasOperation_fields, "f").path;
|
|
62
|
-
}
|
|
63
|
-
get method() {
|
|
64
|
-
return __classPrivateFieldGet(this, _OasOperation_fields, "f").method;
|
|
65
|
-
}
|
|
66
|
-
get pathItem() {
|
|
67
|
-
return __classPrivateFieldGet(this, _OasOperation_fields, "f").pathItem;
|
|
68
|
-
}
|
|
69
|
-
get operationId() {
|
|
70
|
-
return __classPrivateFieldGet(this, _OasOperation_fields, "f").operationId;
|
|
71
|
-
}
|
|
72
|
-
get summary() {
|
|
73
|
-
return __classPrivateFieldGet(this, _OasOperation_fields, "f").summary;
|
|
74
|
-
}
|
|
75
|
-
get tags() {
|
|
76
|
-
return __classPrivateFieldGet(this, _OasOperation_fields, "f").tags;
|
|
77
|
-
}
|
|
78
|
-
get description() {
|
|
79
|
-
return __classPrivateFieldGet(this, _OasOperation_fields, "f").description;
|
|
80
|
-
}
|
|
81
|
-
get parameters() {
|
|
82
|
-
return __classPrivateFieldGet(this, _OasOperation_fields, "f").parameters;
|
|
83
|
-
}
|
|
84
|
-
get requestBody() {
|
|
85
|
-
return __classPrivateFieldGet(this, _OasOperation_fields, "f").requestBody;
|
|
86
|
-
}
|
|
87
|
-
get responses() {
|
|
88
|
-
return __classPrivateFieldGet(this, _OasOperation_fields, "f").responses;
|
|
89
|
-
}
|
|
90
|
-
get deprecated() {
|
|
91
|
-
return __classPrivateFieldGet(this, _OasOperation_fields, "f").deprecated;
|
|
92
|
-
}
|
|
93
123
|
}
|
|
94
|
-
_OasOperation_fields = new WeakMap();
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"mocks.d.ts","sourceRoot":"","sources":["../../../src/oas/operation/mocks.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,eAAe,CAAA;AAC9C,eAAO,MAAM,SAAS,EAAE,SAAS,CAAC,WA+IjC,CAAA"}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import type { OpenAPIV3 } from 'openapi-types';
|
|
2
|
-
import {
|
|
2
|
+
import type { Method } from '../../types/Method.js';
|
|
3
3
|
import type { ParseContext } from '../../context/ParseContext.js';
|
|
4
4
|
import { OasOperation } from './Operation.js';
|
|
5
5
|
import type { OasPathItem } from '../pathItem/PathItem.js';
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"toOperationsV3.d.ts","sourceRoot":"","sources":["../../../src/oas/operation/toOperationsV3.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,eAAe,CAAA;AAC9C,OAAO,
|
|
1
|
+
{"version":3,"file":"toOperationsV3.d.ts","sourceRoot":"","sources":["../../../src/oas/operation/toOperationsV3.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,eAAe,CAAA;AAC9C,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,uBAAuB,CAAA;AACnD,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,+BAA+B,CAAA;AAIjE,OAAO,EAAE,YAAY,EAAE,MAAM,gBAAgB,CAAA;AAG7C,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,yBAAyB,CAAA;AAG1D,KAAK,aAAa,GAAG;IACnB,MAAM,EAAE,MAAM,CAAA;IACd,IAAI,EAAE,MAAM,CAAA;IACZ,QAAQ,EAAE,WAAW,CAAA;CACtB,CAAA;AAED,KAAK,iBAAiB,GAAG;IACvB,SAAS,EAAE,SAAS,CAAC,eAAe,CAAA;IACpC,aAAa,EAAE,aAAa,CAAA;IAC5B,OAAO,EAAE,YAAY,CAAA;CACtB,CAAA;AAOD,eAAO,MAAM,aAAa,0CAIvB,iBAAiB,KAAG,YAqCtB,CAAA;AAED,KAAK,kBAAkB,GAAG;IACxB,KAAK,EAAE,SAAS,CAAC,WAAW,CAAA;IAC5B,OAAO,EAAE,YAAY,CAAA;CACtB,CAAA;AAED,eAAO,MAAM,cAAc,uBAGxB,kBAAkB,KAAG,YAAY,EAsDnC,CAAA"}
|
|
@@ -1,9 +1,9 @@
|
|
|
1
|
-
import { methodValues } from '../../types/Method.js';
|
|
2
1
|
import { toRequestBodyV3 } from '../requestBody/toRequestBodiesV3.js';
|
|
3
2
|
import { toResponsesV3 } from '../response/toResponseV3.js';
|
|
4
3
|
import { toParameterListV3 } from '../parameter/toParameterV3.js';
|
|
5
4
|
import { OasOperation } from './Operation.js';
|
|
6
5
|
import { toPathItemV3 } from '../pathItem/toPathItemV3.js';
|
|
6
|
+
import { methodValues } from '../../types/Method.js';
|
|
7
7
|
export const toOperationV3 = ({ operation, operationInfo, context }) => {
|
|
8
8
|
const { method, path, pathItem } = operationInfo;
|
|
9
9
|
const { operationId, tags, summary, description, parameters, requestBody, responses, deprecated, ...skipped } = operation;
|
|
@@ -32,12 +32,12 @@ export const toOperationsV3 = ({ paths, context }) => {
|
|
|
32
32
|
const cleaned = Object.entries(pathItem).reduce(({ rest, methodObject }, [key, operation]) => {
|
|
33
33
|
const isMethod = methodValues.includes(key);
|
|
34
34
|
if (isMethod) {
|
|
35
|
-
const { [key]:
|
|
35
|
+
const { [key]: _deleted, ...remaining } = rest;
|
|
36
36
|
return {
|
|
37
37
|
rest: remaining,
|
|
38
38
|
methodObject: {
|
|
39
39
|
...methodObject,
|
|
40
|
-
[
|
|
40
|
+
[key]: operation
|
|
41
41
|
}
|
|
42
42
|
};
|
|
43
43
|
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"toOperationsV3.test.d.ts","sourceRoot":"","sources":["../../../src/oas/operation/toOperationsV3.test.ts"],"names":[],"mappings":""}
|
|
@@ -6,33 +6,32 @@ import type { OasSchema } from '../schema/Schema.js';
|
|
|
6
6
|
export type ParameterFields = {
|
|
7
7
|
name: string;
|
|
8
8
|
location: OasParameterLocation;
|
|
9
|
-
description
|
|
10
|
-
required
|
|
11
|
-
deprecated
|
|
12
|
-
allowEmptyValue
|
|
13
|
-
allowReserved
|
|
14
|
-
schema
|
|
15
|
-
examples
|
|
16
|
-
content
|
|
9
|
+
description?: string | undefined;
|
|
10
|
+
required?: boolean | undefined;
|
|
11
|
+
deprecated?: boolean | undefined;
|
|
12
|
+
allowEmptyValue?: boolean | undefined;
|
|
13
|
+
allowReserved?: boolean | undefined;
|
|
14
|
+
schema?: OasSchema | OasRef<'schema'> | undefined;
|
|
15
|
+
examples?: Record<string, OasExample | OasRef<'example'>> | undefined;
|
|
16
|
+
content?: Record<string, OasMediaType> | undefined;
|
|
17
17
|
style: OasParameterStyle;
|
|
18
18
|
explode: boolean;
|
|
19
19
|
};
|
|
20
20
|
export declare class OasParameter {
|
|
21
|
-
#private;
|
|
22
21
|
oasType: 'parameter';
|
|
22
|
+
name: string;
|
|
23
|
+
location: OasParameterLocation;
|
|
24
|
+
description?: string | undefined;
|
|
25
|
+
required?: boolean | undefined;
|
|
26
|
+
deprecated?: boolean | undefined;
|
|
27
|
+
allowEmptyValue?: boolean | undefined;
|
|
28
|
+
allowReserved?: boolean | undefined;
|
|
29
|
+
schema?: OasSchema | OasRef<'schema'> | undefined;
|
|
30
|
+
examples?: Record<string, OasExample | OasRef<'example'>> | undefined;
|
|
31
|
+
content?: Record<string, OasMediaType> | undefined;
|
|
32
|
+
style: OasParameterStyle;
|
|
33
|
+
explode: boolean;
|
|
23
34
|
constructor(fields: ParameterFields);
|
|
24
|
-
get name(): string;
|
|
25
|
-
get location(): OasParameterLocation;
|
|
26
|
-
get description(): string | undefined;
|
|
27
|
-
get required(): boolean | undefined;
|
|
28
|
-
get deprecated(): boolean | undefined;
|
|
29
|
-
get allowEmptyValue(): boolean | undefined;
|
|
30
|
-
get schema(): OasSchema | OasRef<'schema'> | undefined;
|
|
31
|
-
get examples(): Record<string, OasExample | OasRef<'example'>> | undefined;
|
|
32
|
-
get content(): Record<string, OasMediaType> | undefined;
|
|
33
|
-
get style(): OasParameterStyle;
|
|
34
|
-
get explode(): boolean;
|
|
35
|
-
get allowReserved(): boolean | undefined;
|
|
36
35
|
isRef(): this is OasRef<'parameter'>;
|
|
37
36
|
resolve(): OasParameter;
|
|
38
37
|
resolveOnce(): OasParameter;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Parameter.d.ts","sourceRoot":"","sources":["../../../src/oas/parameter/Parameter.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EACV,oBAAoB,EACpB,iBAAiB,EAClB,MAAM,sBAAsB,CAAA;AAC7B,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,2BAA2B,CAAA;AAC7D,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,eAAe,CAAA;AAC3C,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,uBAAuB,CAAA;AACvD,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,qBAAqB,CAAA;AAKpD,MAAM,MAAM,eAAe,GAAG;IAC5B,IAAI,EAAE,MAAM,CAAA;IACZ,QAAQ,EAAE,oBAAoB,CAAA;IAC9B,WAAW,EAAE,MAAM,GAAG,SAAS,CAAA;
|
|
1
|
+
{"version":3,"file":"Parameter.d.ts","sourceRoot":"","sources":["../../../src/oas/parameter/Parameter.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EACV,oBAAoB,EACpB,iBAAiB,EAClB,MAAM,sBAAsB,CAAA;AAC7B,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,2BAA2B,CAAA;AAC7D,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,eAAe,CAAA;AAC3C,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,uBAAuB,CAAA;AACvD,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,qBAAqB,CAAA;AAKpD,MAAM,MAAM,eAAe,GAAG;IAC5B,IAAI,EAAE,MAAM,CAAA;IACZ,QAAQ,EAAE,oBAAoB,CAAA;IAC9B,WAAW,CAAC,EAAE,MAAM,GAAG,SAAS,CAAA;IAChC,QAAQ,CAAC,EAAE,OAAO,GAAG,SAAS,CAAA;IAC9B,UAAU,CAAC,EAAE,OAAO,GAAG,SAAS,CAAA;IAChC,eAAe,CAAC,EAAE,OAAO,GAAG,SAAS,CAAA;IACrC,aAAa,CAAC,EAAE,OAAO,GAAG,SAAS,CAAA;IACnC,MAAM,CAAC,EAAE,SAAS,GAAG,MAAM,CAAC,QAAQ,CAAC,GAAG,SAAS,CAAA;IACjD,QAAQ,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,UAAU,GAAG,MAAM,CAAC,SAAS,CAAC,CAAC,GAAG,SAAS,CAAA;IACrE,OAAO,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,YAAY,CAAC,GAAG,SAAS,CAAA;IAClD,KAAK,EAAE,iBAAiB,CAAA;IACxB,OAAO,EAAE,OAAO,CAAA;CACjB,CAAA;AAED,qBAAa,YAAY;IACvB,OAAO,EAAE,WAAW,CAAc;IAClC,IAAI,EAAE,MAAM,CAAA;IACZ,QAAQ,EAAE,oBAAoB,CAAA;IAC9B,WAAW,CAAC,EAAE,MAAM,GAAG,SAAS,CAAA;IAChC,QAAQ,CAAC,EAAE,OAAO,GAAG,SAAS,CAAA;IAC9B,UAAU,CAAC,EAAE,OAAO,GAAG,SAAS,CAAA;IAChC,eAAe,CAAC,EAAE,OAAO,GAAG,SAAS,CAAA;IACrC,aAAa,CAAC,EAAE,OAAO,GAAG,SAAS,CAAA;IACnC,MAAM,CAAC,EAAE,SAAS,GAAG,MAAM,CAAC,QAAQ,CAAC,GAAG,SAAS,CAAA;IACjD,QAAQ,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,UAAU,GAAG,MAAM,CAAC,SAAS,CAAC,CAAC,GAAG,SAAS,CAAA;IACrE,OAAO,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,YAAY,CAAC,GAAG,SAAS,CAAA;IAClD,KAAK,EAAE,iBAAiB,CAAA;IACxB,OAAO,EAAE,OAAO,CAAA;gBAEJ,MAAM,EAAE,eAAe;IAiBnC,KAAK,IAAI,IAAI,IAAI,MAAM,CAAC,WAAW,CAAC;IAIpC,OAAO,IAAI,YAAY;IAIvB,WAAW,IAAI,YAAY;IAI3B,QAAQ,CACN,SAAS,GAAE,MAA2B,GACrC,SAAS,GAAG,MAAM,CAAC,QAAQ,CAAC,GAAG,SAAS;CAa5C"}
|