@skmtc/core 0.0.597 → 0.0.599
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/GenerateContext.d.ts +2 -2
- package/esm/context/GenerateContext.d.ts.map +1 -1
- package/esm/context/GenerateContext.js +2 -2
- package/esm/context/ParseContext.d.ts +2 -2
- package/esm/context/ParseContext.d.ts.map +1 -1
- package/esm/context/ParseContext.js +2 -2
- package/esm/context/StackTrail.d.ts +1 -6
- package/esm/context/StackTrail.d.ts.map +1 -1
- package/esm/context/StackTrail.js +1 -23
- package/esm/dsl/model/ModelDriver.d.ts.map +1 -1
- package/esm/dsl/model/ModelDriver.js +12 -16
- package/esm/helpers/tracer.d.ts +2 -2
- package/esm/helpers/tracer.d.ts.map +1 -1
- package/esm/helpers/tracer.js +2 -2
- package/esm/oas/components/toComponentsV3.d.ts.map +1 -1
- package/esm/oas/components/toComponentsV3.js +4 -14
- package/esm/oas/example/toExamplesV3.d.ts +1 -2
- package/esm/oas/example/toExamplesV3.d.ts.map +1 -1
- package/esm/oas/example/toExamplesV3.js +4 -8
- package/esm/oas/header/toHeadersV3.d.ts +1 -2
- package/esm/oas/header/toHeadersV3.d.ts.map +1 -1
- package/esm/oas/header/toHeadersV3.js +2 -2
- package/esm/oas/parameter/toParameterV3.d.ts +2 -3
- package/esm/oas/parameter/toParameterV3.d.ts.map +1 -1
- package/esm/oas/parameter/toParameterV3.js +4 -4
- package/esm/oas/requestBody/toRequestBodiesV3.d.ts +1 -2
- package/esm/oas/requestBody/toRequestBodiesV3.d.ts.map +1 -1
- package/esm/oas/requestBody/toRequestBodiesV3.js +2 -6
- package/esm/oas/response/toResponseV3.d.ts +2 -3
- package/esm/oas/response/toResponseV3.d.ts.map +1 -1
- package/esm/oas/response/toResponseV3.js +4 -4
- package/esm/oas/schema/toSchemasV3.d.ts +2 -3
- package/esm/oas/schema/toSchemasV3.d.ts.map +1 -1
- package/esm/oas/schema/toSchemasV3.js +9 -4
- package/esm/oas/string/String.d.ts +2 -2
- package/esm/oas/string/String.d.ts.map +1 -1
- package/esm/oas/string/string-types.d.ts +1 -13
- package/esm/oas/string/string-types.d.ts.map +1 -1
- package/esm/oas/string/string-types.js +15 -32
- package/package.json +1 -1
- package/script/context/GenerateContext.d.ts +2 -2
- package/script/context/GenerateContext.d.ts.map +1 -1
- package/script/context/GenerateContext.js +2 -2
- package/script/context/ParseContext.d.ts +2 -2
- package/script/context/ParseContext.d.ts.map +1 -1
- package/script/context/ParseContext.js +2 -2
- package/script/context/StackTrail.d.ts +1 -6
- package/script/context/StackTrail.d.ts.map +1 -1
- package/script/context/StackTrail.js +1 -23
- package/script/dsl/model/ModelDriver.d.ts.map +1 -1
- package/script/dsl/model/ModelDriver.js +12 -16
- package/script/helpers/tracer.d.ts +2 -2
- package/script/helpers/tracer.d.ts.map +1 -1
- package/script/helpers/tracer.js +2 -2
- package/script/oas/components/toComponentsV3.d.ts.map +1 -1
- package/script/oas/components/toComponentsV3.js +4 -14
- package/script/oas/example/toExamplesV3.d.ts +1 -2
- package/script/oas/example/toExamplesV3.d.ts.map +1 -1
- package/script/oas/example/toExamplesV3.js +4 -8
- package/script/oas/header/toHeadersV3.d.ts +1 -2
- package/script/oas/header/toHeadersV3.d.ts.map +1 -1
- package/script/oas/header/toHeadersV3.js +2 -2
- package/script/oas/parameter/toParameterV3.d.ts +2 -3
- package/script/oas/parameter/toParameterV3.d.ts.map +1 -1
- package/script/oas/parameter/toParameterV3.js +4 -4
- package/script/oas/requestBody/toRequestBodiesV3.d.ts +1 -2
- package/script/oas/requestBody/toRequestBodiesV3.d.ts.map +1 -1
- package/script/oas/requestBody/toRequestBodiesV3.js +2 -6
- package/script/oas/response/toResponseV3.d.ts +2 -3
- package/script/oas/response/toResponseV3.d.ts.map +1 -1
- package/script/oas/response/toResponseV3.js +4 -4
- package/script/oas/schema/toSchemasV3.d.ts +2 -3
- package/script/oas/schema/toSchemasV3.d.ts.map +1 -1
- package/script/oas/schema/toSchemasV3.js +9 -4
- package/script/oas/string/String.d.ts +2 -2
- package/script/oas/string/String.d.ts.map +1 -1
- package/script/oas/string/string-types.d.ts +1 -13
- package/script/oas/string/string-types.d.ts.map +1 -1
- package/script/oas/string/string-types.js +15 -32
|
@@ -13,7 +13,7 @@ import { ContentSettings } from '../dsl/ContentSettings.js';
|
|
|
13
13
|
import type { RefName } from '../types/RefName.js';
|
|
14
14
|
import type * as log from '../deps/jsr.io/@std/log/0.224.8/mod.js';
|
|
15
15
|
import type { ResultType } from '../types/Results.js';
|
|
16
|
-
import type { StackTrail
|
|
16
|
+
import type { StackTrail } from './StackTrail.js';
|
|
17
17
|
import type { Identifier } from '../dsl/Identifier.js';
|
|
18
18
|
import type { SchemaToValueFn, SchemaType, TypeSystemOutput } from '../types/TypeSystem.js';
|
|
19
19
|
import { Inserted } from '../dsl/Inserted.js';
|
|
@@ -118,7 +118,7 @@ export declare class GenerateContext {
|
|
|
118
118
|
* @internal
|
|
119
119
|
*/
|
|
120
120
|
generate(): GenerateResult;
|
|
121
|
-
trace<T>(token: string | string[], fn: () => T
|
|
121
|
+
trace<T>(token: string | string[], fn: () => T): T;
|
|
122
122
|
/**
|
|
123
123
|
* Converts schema to value using `schemaToValueFn` and creates definition
|
|
124
124
|
* with the given `identifier` at `destinationPath`.
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"GenerateContext.d.ts","sourceRoot":"","sources":["../../src/context/GenerateContext.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,kBAAkB,CAAA;AAErD,OAAO,EAAE,UAAU,EAAE,MAAM,sBAAsB,CAAA;AACjD,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,6BAA6B,CAAA;AAC9D,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,yBAAyB,CAAA;AACxD,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,mBAAmB,CAAA;AAE/C,OAAO,KAAK,EAAE,cAAc,E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MAAM,EAAE,EAAE,wBAAwB,GAAG,eAAe;IAa7F,eAAe,CAAC,EAAE,WAAW,EAAE,OAAO,EAAE,EAAE,mBAAmB,GAAG,eAAe;IAwB/E;;;;;OAKG;IACH,oBAAoB,CAAC,OAAO,EAAE,OAAO,GAAG,SAAS,GAAG,MAAM,CAAC,QAAQ,CAAC;IAUpE;;;;;;OAMG;IACH,cAAc,CAAC,EAAE,IAAI,EAAE,UAAU,EAAE,EAAE,QAAQ,GAAG,UAAU,GAAG,SAAS;CAGvE"}
|
|
@@ -90,8 +90,8 @@ export class GenerateContext {
|
|
|
90
90
|
schemaOptions: __classPrivateFieldGet(this, _GenerateContext_schemaOptions, "f")
|
|
91
91
|
};
|
|
92
92
|
}
|
|
93
|
-
trace(token, fn
|
|
94
|
-
return tracer(__classPrivateFieldGet(this, _GenerateContext_stackTrail, "f"), token, fn
|
|
93
|
+
trace(token, fn) {
|
|
94
|
+
return tracer(__classPrivateFieldGet(this, _GenerateContext_stackTrail, "f"), token, fn);
|
|
95
95
|
}
|
|
96
96
|
/**
|
|
97
97
|
* Converts schema to value using `schemaToValueFn` and creates definition
|
|
@@ -2,7 +2,7 @@ import "../_dnt.polyfills.js";
|
|
|
2
2
|
import type { OpenAPIV3 } from 'openapi-types';
|
|
3
3
|
import { OasDocument } from '../oas/document/Document.js';
|
|
4
4
|
import type * as log from '../deps/jsr.io/@std/log/0.224.8/mod.js';
|
|
5
|
-
import type { StackTrail
|
|
5
|
+
import type { StackTrail } from './StackTrail.js';
|
|
6
6
|
type ConstructorArgs = {
|
|
7
7
|
documentObject: OpenAPIV3.Document;
|
|
8
8
|
logger: log.Logger;
|
|
@@ -18,7 +18,7 @@ export declare class ParseContext {
|
|
|
18
18
|
stackTrail: StackTrail;
|
|
19
19
|
constructor({ documentObject, logger, stackTrail }: ConstructorArgs);
|
|
20
20
|
parse(): OasDocument;
|
|
21
|
-
trace<T>(token: string | string[], fn: () => T
|
|
21
|
+
trace<T>(token: string | string[], fn: () => T): T;
|
|
22
22
|
logSkippedFields(skipped: Record<string, unknown>): void;
|
|
23
23
|
}
|
|
24
24
|
export declare const parseSchema: (schema: string) => OpenAPIV3.Document<{}>;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ParseContext.d.ts","sourceRoot":"","sources":["../../src/context/ParseContext.ts"],"names":[],"mappings":"AAAA,OAAO,sBAAsB,CAAC;AAC9B,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,eAAe,CAAA;AAG9C,OAAO,EAAE,WAAW,EAAE,MAAM,6BAA6B,CAAA;AACzD,OAAO,KAAK,KAAK,GAAG,MAAM,wCAAwC,CAAA;AAClE,OAAO,KAAK,EAAE,UAAU,EAAE,
|
|
1
|
+
{"version":3,"file":"ParseContext.d.ts","sourceRoot":"","sources":["../../src/context/ParseContext.ts"],"names":[],"mappings":"AAAA,OAAO,sBAAsB,CAAC;AAC9B,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,eAAe,CAAA;AAG9C,OAAO,EAAE,WAAW,EAAE,MAAM,6BAA6B,CAAA;AACzD,OAAO,KAAK,KAAK,GAAG,MAAM,wCAAwC,CAAA;AAClE,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,iBAAiB,CAAA;AAGjD,KAAK,eAAe,GAAG;IACrB,cAAc,EAAE,SAAS,CAAC,QAAQ,CAAA;IAClC,MAAM,EAAE,GAAG,CAAC,MAAM,CAAA;IAClB,UAAU,EAAE,UAAU,CAAA;CACvB,CAAA;AAED,MAAM,MAAM,WAAW,GAAG;IACxB,WAAW,EAAE,WAAW,CAAA;CACzB,CAAA;AAED,qBAAa,YAAY;IACvB,cAAc,EAAE,SAAS,CAAC,QAAQ,CAAA;IAClC,MAAM,EAAE,GAAG,CAAC,MAAM,CAAA;IAClB,WAAW,EAAE,WAAW,CAAA;IACxB,UAAU,EAAE,UAAU,CAAA;gBAEV,EAAE,cAAc,EAAE,MAAM,EAAE,UAAU,EAAE,EAAE,eAAe;IAOnE,KAAK;IASL,KAAK,CAAC,CAAC,EAAE,KAAK,EAAE,MAAM,GAAG,MAAM,EAAE,EAAE,EAAE,EAAE,MAAM,CAAC,GAAG,CAAC;IAIlD,gBAAgB,CAAC,OAAO,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC;CAUlD;AAED,eAAO,MAAM,WAAW,WAAY,MAAM,2BAMzC,CAAA"}
|
|
@@ -41,8 +41,8 @@ export class ParseContext {
|
|
|
41
41
|
});
|
|
42
42
|
return this.oasDocument;
|
|
43
43
|
}
|
|
44
|
-
trace(token, fn
|
|
45
|
-
return tracer(this.stackTrail, token, fn
|
|
44
|
+
trace(token, fn) {
|
|
45
|
+
return tracer(this.stackTrail, token, fn);
|
|
46
46
|
}
|
|
47
47
|
logSkippedFields(skipped) {
|
|
48
48
|
Object.entries(skipped).forEach(([key, value]) => {
|
|
@@ -1,16 +1,11 @@
|
|
|
1
1
|
import "../_dnt.polyfills.js";
|
|
2
|
-
export type TraceOptions = {
|
|
3
|
-
checkCycles?: boolean;
|
|
4
|
-
};
|
|
5
2
|
export declare class StackTrail {
|
|
6
3
|
#private;
|
|
7
4
|
constructor(stack?: (string | number)[]);
|
|
8
5
|
clone(): StackTrail;
|
|
9
6
|
slice(start: number, end?: number): StackTrail;
|
|
10
7
|
get stackTrail(): (string | number)[];
|
|
11
|
-
append(frame: string | string[]
|
|
12
|
-
checkCycles(frame: string | string[]): boolean;
|
|
13
|
-
checkCyclesArray(frames: string[]): boolean;
|
|
8
|
+
append(frame: string | string[]): StackTrail;
|
|
14
9
|
getParentOf(frame: string): string | undefined;
|
|
15
10
|
remove(frame: string | string[]): StackTrail;
|
|
16
11
|
static join(...stacks: (StackTrail | string)[]): string;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"StackTrail.d.ts","sourceRoot":"","sources":["../../src/context/StackTrail.ts"],"names":[],"mappings":"AAAA,OAAO,sBAAsB,CAAC;AAC9B,
|
|
1
|
+
{"version":3,"file":"StackTrail.d.ts","sourceRoot":"","sources":["../../src/context/StackTrail.ts"],"names":[],"mappings":"AAAA,OAAO,sBAAsB,CAAC;AAC9B,qBAAa,UAAU;;gBAGT,KAAK,GAAE,CAAC,MAAM,GAAG,MAAM,CAAC,EAAO;IAI3C,KAAK;IAIL,KAAK,CAAC,KAAK,EAAE,MAAM,EAAE,GAAG,CAAC,EAAE,MAAM;IAIjC,IAAI,UAAU,wBAEb;IAED,MAAM,CAAC,KAAK,EAAE,MAAM,GAAG,MAAM,EAAE,GAAG,UAAU;IAgB5C,WAAW,CAAC,KAAK,EAAE,MAAM,GAAG,MAAM,GAAG,SAAS;IAW9C,MAAM,CAAC,KAAK,EAAE,MAAM,GAAG,MAAM,EAAE,GAAG,UAAU;IAsB5C,MAAM,CAAC,IAAI,CAAC,GAAG,MAAM,EAAE,CAAC,UAAU,GAAG,MAAM,CAAC,EAAE,GAAG,MAAM;IAIvD,MAAM,CAAC,KAAK,CAAC,KAAK,EAAE,MAAM,GAAG,UAAU;IAYvC,QAAQ;CAOT"}
|
|
@@ -25,10 +25,7 @@ export class StackTrail {
|
|
|
25
25
|
get stackTrail() {
|
|
26
26
|
return __classPrivateFieldGet(this, _StackTrail_stack, "f");
|
|
27
27
|
}
|
|
28
|
-
append(frame
|
|
29
|
-
if (options?.checkCycles && this.checkCycles(frame)) {
|
|
30
|
-
throw new Error(`Cycle detected in stack trail: ${this}`);
|
|
31
|
-
}
|
|
28
|
+
append(frame) {
|
|
32
29
|
if (typeof frame === 'string') {
|
|
33
30
|
__classPrivateFieldGet(this, _StackTrail_stack, "f").push(frame);
|
|
34
31
|
return this;
|
|
@@ -39,25 +36,6 @@ export class StackTrail {
|
|
|
39
36
|
}
|
|
40
37
|
throw new Error(`Unexpected stack frame: ${frame}`);
|
|
41
38
|
}
|
|
42
|
-
checkCycles(frame) {
|
|
43
|
-
if (typeof frame === 'string') {
|
|
44
|
-
return __classPrivateFieldGet(this, _StackTrail_stack, "f").includes(frame);
|
|
45
|
-
}
|
|
46
|
-
return this.checkCyclesArray(frame);
|
|
47
|
-
}
|
|
48
|
-
checkCyclesArray(frames) {
|
|
49
|
-
if (frames.length === 0) {
|
|
50
|
-
return false;
|
|
51
|
-
}
|
|
52
|
-
const lastFrame = frames[frames.length - 1];
|
|
53
|
-
const indexOfLastFrame = __classPrivateFieldGet(this, _StackTrail_stack, "f").indexOf(lastFrame);
|
|
54
|
-
if (indexOfLastFrame === -1) {
|
|
55
|
-
return false;
|
|
56
|
-
}
|
|
57
|
-
return frames.toReversed().every((frame, index) => {
|
|
58
|
-
return frame === __classPrivateFieldGet(this, _StackTrail_stack, "f")[indexOfLastFrame - index];
|
|
59
|
-
});
|
|
60
|
-
}
|
|
61
39
|
getParentOf(frame) {
|
|
62
40
|
const lastItemIndex = this.stackTrail.length - 1;
|
|
63
41
|
if (this.stackTrail?.[lastItemIndex] === frame &&
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ModelDriver.d.ts","sourceRoot":"","sources":["../../../src/dsl/model/ModelDriver.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,YAAY,CAAA;AACjD,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,kCAAkC,CAAA;AACvE,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,uBAAuB,CAAA;AAI5D,OAAO,KAAK,EAAE,mBAAmB,EAAE,cAAc,EAAE,MAAM,+BAA+B,CAAA;AACxF,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,+BAA+B,CAAA;AACnE,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,wBAAwB,CAAA;AAGrD,KAAK,eAAe,CAAC,CAAC,SAAS,cAAc,EAAE,CAAC,SAAS,cAAc,EAAE,cAAc,IAAI;IACzF,OAAO,EAAE,eAAe,CAAA;IACxB,UAAU,EAAE,eAAe,CAAC,CAAC,EAAE,cAAc,CAAC,CAAA;IAC9C,OAAO,EAAE,OAAO,CAAA;IAChB,UAAU,CAAC,EAAE,C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CAAC,CAAA;IACd,eAAe,CAAC,EAAE,MAAM,CAAA;CACzB,CAAA;AAWD,qBAAa,WAAW,CAAC,CAAC,SAAS,cAAc,EAAE,CAAC,SAAS,cAAc,EAAE,cAAc;IACzF,OAAO,EAAE,eAAe,CAAA;IACxB,UAAU,EAAE,eAAe,CAAC,CAAC,EAAE,cAAc,CAAC,CAAA;IAC9C,OAAO,EAAE,OAAO,CAAA;IAChB,QAAQ,EAAE,eAAe,CAAC,cAAc,CAAC,CAAA;IACzC,eAAe,CAAC,EAAE,MAAM,CAAA;IACxB,UAAU,EAAE,mBAAmB,CAAC,CAAC,EAAE,CAAC,CAAC,CAAA;gBACzB,EACV,OAAO,EACP,UAAU,EACV,OAAO,EACP,UAAU,EACV,eAAe,EAChB,EAAE,eAAe,CAAC,CAAC,EAAE,CAAC,EAAE,cAAc,CAAC;IAWxC,OAAO,CAAC,KAAK;IAsBb,OAAO,CAAC,aAAa;IA+BrB,OAAO,CAAC,gBAAgB;CAqBzB"}
|
|
@@ -47,22 +47,18 @@ export class ModelDriver {
|
|
|
47
47
|
this.definition = this.apply({ generation, destinationPath });
|
|
48
48
|
}
|
|
49
49
|
apply({ generation, destinationPath } = {}) {
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
return definition;
|
|
63
|
-
}, {
|
|
64
|
-
checkCycles: true
|
|
65
|
-
});
|
|
50
|
+
const { identifier, exportPath, selected } = this.settings;
|
|
51
|
+
if (!selected && generation !== 'force') {
|
|
52
|
+
return undefined;
|
|
53
|
+
}
|
|
54
|
+
const definition = this.getDefinition({ identifier, exportPath });
|
|
55
|
+
if (destinationPath && normalize(exportPath) !== normalize(destinationPath)) {
|
|
56
|
+
this.context.register({
|
|
57
|
+
imports: { [exportPath]: [identifier.name] },
|
|
58
|
+
destinationPath
|
|
59
|
+
});
|
|
60
|
+
}
|
|
61
|
+
return definition;
|
|
66
62
|
}
|
|
67
63
|
getDefinition({ identifier, exportPath }) {
|
|
68
64
|
const cachedDefinition = this.context.findDefinition({
|
package/esm/helpers/tracer.d.ts
CHANGED
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
import type { StackTrail
|
|
2
|
-
export declare const tracer: <T>(stackTrail: StackTrail, token: string | string[], fn: () => T
|
|
1
|
+
import type { StackTrail } from '../context/StackTrail.js';
|
|
2
|
+
export declare const tracer: <T>(stackTrail: StackTrail, token: string | string[], fn: () => T) => T;
|
|
3
3
|
//# sourceMappingURL=tracer.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"tracer.d.ts","sourceRoot":"","sources":["../../src/helpers/tracer.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,UAAU,EAAE,
|
|
1
|
+
{"version":3,"file":"tracer.d.ts","sourceRoot":"","sources":["../../src/helpers/tracer.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,0BAA0B,CAAA;AAE1D,eAAO,MAAM,MAAM,GAAI,CAAC,cACV,UAAU,SACf,MAAM,GAAG,MAAM,EAAE,MACpB,MAAM,CAAC,MASZ,CAAA"}
|
package/esm/helpers/tracer.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"toComponentsV3.d.ts","sourceRoot":"","sources":["../../../src/oas/components/toComponentsV3.ts"],"names":[],"mappings":"AAIA,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,eAAe,CAAA;AAC9C,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,+BAA+B,CAAA;AAGjE,OAAO,EAAE,aAAa,EAAE,MAAM,iBAAiB,CAAA;AAI/C,KAAK,kBAAkB,GAAG;IACxB,UAAU,EAAE,SAAS,CAAC,gBAAgB,GAAG,SAAS,CAAA;IAClD,OAAO,EAAE,YAAY,CAAA;CACtB,CAAA;AAED,eAAO,MAAM,cAAc,4BAGxB,kBAAkB,KAAG,aAAa,GAAG,
|
|
1
|
+
{"version":3,"file":"toComponentsV3.d.ts","sourceRoot":"","sources":["../../../src/oas/components/toComponentsV3.ts"],"names":[],"mappings":"AAIA,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,eAAe,CAAA;AAC9C,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,+BAA+B,CAAA;AAGjE,OAAO,EAAE,aAAa,EAAE,MAAM,iBAAiB,CAAA;AAI/C,KAAK,kBAAkB,GAAG;IACxB,UAAU,EAAE,SAAS,CAAC,gBAAgB,GAAG,SAAS,CAAA;IAClD,OAAO,EAAE,YAAY,CAAA;CACtB,CAAA;AAED,eAAO,MAAM,cAAc,4BAGxB,kBAAkB,KAAG,aAAa,GAAG,SAgCvC,CAAA"}
|
|
@@ -13,30 +13,20 @@ export const toComponentsV3 = ({ components, context }) => {
|
|
|
13
13
|
const { schemas, responses, parameters, examples, requestBodies, headers, ...skipped } = components;
|
|
14
14
|
const extensionFields = toSpecificationExtensionsV3({ skipped, context });
|
|
15
15
|
const fields = {
|
|
16
|
-
schemas: context.trace('schemas', () => toOptionalSchemasV3({ schemas, context }
|
|
17
|
-
responses: context.trace('responses', () => toOptionalResponsesV3({ responses, context },
|
|
18
|
-
checkCycles: true
|
|
19
|
-
})),
|
|
16
|
+
schemas: context.trace('schemas', () => toOptionalSchemasV3({ schemas, context })),
|
|
17
|
+
responses: context.trace('responses', () => toOptionalResponsesV3({ responses, context })),
|
|
20
18
|
parameters: context.trace('parameters', () => toOptionalParametersV3({
|
|
21
19
|
parameters,
|
|
22
20
|
context
|
|
23
|
-
}, {
|
|
24
|
-
checkCycles: true
|
|
25
21
|
})),
|
|
26
22
|
examples: toExamplesV3({
|
|
27
23
|
examples,
|
|
28
24
|
example: undefined,
|
|
29
25
|
exampleKey: 'TEMP',
|
|
30
26
|
context
|
|
31
|
-
}, {
|
|
32
|
-
checkCycles: true
|
|
33
27
|
}),
|
|
34
|
-
requestBodies: context.trace('requestBodies', () => toRequestBodiesV3({ requestBodies, context },
|
|
35
|
-
|
|
36
|
-
})),
|
|
37
|
-
headers: context.trace('headers', () => toHeadersV3({ headers, context }, {
|
|
38
|
-
checkCycles: true
|
|
39
|
-
})),
|
|
28
|
+
requestBodies: context.trace('requestBodies', () => toRequestBodiesV3({ requestBodies, context })),
|
|
29
|
+
headers: context.trace('headers', () => toHeadersV3({ headers, context })),
|
|
40
30
|
extensionFields
|
|
41
31
|
};
|
|
42
32
|
return new OasComponents(fields);
|
|
@@ -2,7 +2,6 @@ import type { ParseContext } from '../../context/ParseContext.js';
|
|
|
2
2
|
import type { OpenAPIV3 } from 'openapi-types';
|
|
3
3
|
import { OasExample } from './Example.js';
|
|
4
4
|
import type { OasRef } from '../ref/Ref.js';
|
|
5
|
-
import type { TraceOptions } from '../../context/StackTrail.js';
|
|
6
5
|
type ToExampleSimpleV3Args = {
|
|
7
6
|
example: unknown;
|
|
8
7
|
};
|
|
@@ -13,7 +12,7 @@ export type ToExamplesV3Args = {
|
|
|
13
12
|
exampleKey: string;
|
|
14
13
|
context: ParseContext;
|
|
15
14
|
};
|
|
16
|
-
export declare const toExamplesV3: ({ example, examples, exampleKey, context }: ToExamplesV3Args
|
|
15
|
+
export declare const toExamplesV3: ({ example, examples, exampleKey, context }: ToExamplesV3Args) => Record<string, OasExample | OasRef<"example">> | undefined;
|
|
17
16
|
type ToExampleV3Args = {
|
|
18
17
|
example: OpenAPIV3.ExampleObject | OpenAPIV3.ReferenceObject;
|
|
19
18
|
context: ParseContext;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"toExamplesV3.d.ts","sourceRoot":"","sources":["../../../src/oas/example/toExamplesV3.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,+BAA+B,CAAA;AACjE,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,eAAe,CAAA;AAG9C,OAAO,EAAE,UAAU,EAAE,MAAM,cAAc,CAAA;AAEzC,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,eAAe,CAAA;
|
|
1
|
+
{"version":3,"file":"toExamplesV3.d.ts","sourceRoot":"","sources":["../../../src/oas/example/toExamplesV3.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,+BAA+B,CAAA;AACjE,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,eAAe,CAAA;AAG9C,OAAO,EAAE,UAAU,EAAE,MAAM,cAAc,CAAA;AAEzC,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,eAAe,CAAA;AAG3C,KAAK,qBAAqB,GAAG;IAC3B,OAAO,EAAE,OAAO,CAAA;CACjB,CAAA;AAED,eAAO,MAAM,iBAAiB,gBAE3B,qBAAqB,KAAG,UAAU,GAAG,MAAM,CAAC,SAAS,CAQvD,CAAA;AAED,MAAM,MAAM,gBAAgB,GAAG;IAC7B,OAAO,EAAE,SAAS,CAAC,aAAa,GAAG,SAAS,CAAA;IAC5C,QAAQ,EAAE,MAAM,CAAC,MAAM,EAAE,SAAS,CAAC,aAAa,GAAG,SAAS,CAAC,eAAe,CAAC,GAAG,SAAS,CAAA;IACzF,UAAU,EAAE,MAAM,CAAA;IAClB,OAAO,EAAE,YAAY,CAAA;CACtB,CAAA;AAED,eAAO,MAAM,YAAY,+CAKtB,gBAAgB,KAAG,MAAM,CAAC,MAAM,EAAE,UAAU,GAAG,MAAM,CAAC,SAAS,CAAC,CAAC,GAAG,SAsBtE,CAAA;AAED,KAAK,eAAe,GAAG;IACrB,OAAO,EAAE,SAAS,CAAC,aAAa,GAAG,SAAS,CAAC,eAAe,CAAA;IAC5D,OAAO,EAAE,YAAY,CAAA;CACtB,CAAA;AAED,eAAO,MAAM,WAAW,yBAGrB,eAAe,KAAG,UAAU,GAAG,MAAM,CAAC,SAAS,CAejD,CAAA"}
|
|
@@ -10,25 +10,21 @@ export const toExampleSimpleV3 = ({ example }) => {
|
|
|
10
10
|
};
|
|
11
11
|
return new OasExample(fields);
|
|
12
12
|
};
|
|
13
|
-
export const toExamplesV3 = ({ example, examples, exampleKey, context }
|
|
13
|
+
export const toExamplesV3 = ({ example, examples, exampleKey, context }) => {
|
|
14
14
|
if (example && examples) {
|
|
15
15
|
context.logger.warn(`Both example and examples are defined for ${exampleKey}`);
|
|
16
16
|
}
|
|
17
17
|
if (example) {
|
|
18
18
|
return {
|
|
19
|
-
[exampleKey]: context.trace('example', () => toExampleSimpleV3({ example })
|
|
19
|
+
[exampleKey]: context.trace('example', () => toExampleSimpleV3({ example }))
|
|
20
20
|
};
|
|
21
21
|
}
|
|
22
22
|
if (examples) {
|
|
23
23
|
context.trace('examples', () => {
|
|
24
24
|
return Object.fromEntries(Object.entries(examples).map(([key, value]) => {
|
|
25
|
-
return [
|
|
26
|
-
key,
|
|
27
|
-
context.trace(key, () => toExampleV3({ example: value, context })),
|
|
28
|
-
options
|
|
29
|
-
];
|
|
25
|
+
return [key, context.trace(key, () => toExampleV3({ example: value, context }))];
|
|
30
26
|
}));
|
|
31
|
-
}
|
|
27
|
+
});
|
|
32
28
|
}
|
|
33
29
|
return undefined;
|
|
34
30
|
};
|
|
@@ -2,11 +2,10 @@ import type { ParseContext } from '../../context/ParseContext.js';
|
|
|
2
2
|
import type { OpenAPIV3 } from 'openapi-types';
|
|
3
3
|
import { OasHeader } from './Header.js';
|
|
4
4
|
import type { OasRef } from '../ref/Ref.js';
|
|
5
|
-
import type { TraceOptions } from '../../context/StackTrail.js';
|
|
6
5
|
type ToHeadersV3Args = {
|
|
7
6
|
headers: Record<string, OpenAPIV3.ReferenceObject | OpenAPIV3.HeaderObject> | undefined;
|
|
8
7
|
context: ParseContext;
|
|
9
8
|
};
|
|
10
|
-
export declare const toHeadersV3: ({ headers, context }: ToHeadersV3Args
|
|
9
|
+
export declare const toHeadersV3: ({ headers, context }: ToHeadersV3Args) => Record<string, OasHeader | OasRef<"header">> | undefined;
|
|
11
10
|
export {};
|
|
12
11
|
//# sourceMappingURL=toHeadersV3.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"toHeadersV3.d.ts","sourceRoot":"","sources":["../../../src/oas/header/toHeadersV3.ts"],"names":[],"mappings":"AAGA,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,+BAA+B,CAAA;AAEjE,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,eAAe,CAAA;AAE9C,OAAO,EAAE,SAAS,EAAE,MAAM,aAAa,CAAA;AAEvC,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,eAAe,CAAA;
|
|
1
|
+
{"version":3,"file":"toHeadersV3.d.ts","sourceRoot":"","sources":["../../../src/oas/header/toHeadersV3.ts"],"names":[],"mappings":"AAGA,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,+BAA+B,CAAA;AAEjE,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,eAAe,CAAA;AAE9C,OAAO,EAAE,SAAS,EAAE,MAAM,aAAa,CAAA;AAEvC,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,eAAe,CAAA;AAG3C,KAAK,eAAe,GAAG;IACrB,OAAO,EAAE,MAAM,CAAC,MAAM,EAAE,SAAS,CAAC,eAAe,GAAG,SAAS,CAAC,YAAY,CAAC,GAAG,SAAS,CAAA;IACvF,OAAO,EAAE,YAAY,CAAA;CACtB,CAAA;AAED,eAAO,MAAM,WAAW,yBAGrB,eAAe,KAAG,MAAM,CAAC,MAAM,EAAE,SAAS,GAAG,MAAM,CAAC,QAAQ,CAAC,CAAC,GAAG,SAUnE,CAAA"}
|
|
@@ -5,12 +5,12 @@ import { isRef } from '../../helpers/refFns.js';
|
|
|
5
5
|
import { toOptionalMediaTypeItemsV3 } from '../mediaType/toMediaTypeItemV3.js';
|
|
6
6
|
import { OasHeader } from './Header.js';
|
|
7
7
|
import { toSpecificationExtensionsV3 } from '../specificationExtensions/toSpecificationExtensionsV3.js';
|
|
8
|
-
export const toHeadersV3 = ({ headers, context }
|
|
8
|
+
export const toHeadersV3 = ({ headers, context }) => {
|
|
9
9
|
if (!headers) {
|
|
10
10
|
return undefined;
|
|
11
11
|
}
|
|
12
12
|
return Object.fromEntries(Object.entries(headers).map(([key, value]) => {
|
|
13
|
-
return [key, context.trace(key, () => toHeaderV3({ header: value, context }))
|
|
13
|
+
return [key, context.trace(key, () => toHeaderV3({ header: value, context }))];
|
|
14
14
|
}));
|
|
15
15
|
};
|
|
16
16
|
const toHeaderV3 = ({ header, context }) => {
|
|
@@ -2,7 +2,6 @@ import type { ParseContext } from '../../context/ParseContext.js';
|
|
|
2
2
|
import type { OpenAPIV3 } from 'openapi-types';
|
|
3
3
|
import { OasParameter } from './Parameter.js';
|
|
4
4
|
import type { OasRef } from '../ref/Ref.js';
|
|
5
|
-
import type { TraceOptions } from '../../context/StackTrail.js';
|
|
6
5
|
type ToParameterListV3Args = {
|
|
7
6
|
parameters: (OpenAPIV3.ParameterObject | OpenAPIV3.ReferenceObject)[] | undefined;
|
|
8
7
|
context: ParseContext;
|
|
@@ -12,11 +11,11 @@ type ToParametersV3Args = {
|
|
|
12
11
|
parameters: Record<string, OpenAPIV3.ParameterObject | OpenAPIV3.ReferenceObject>;
|
|
13
12
|
context: ParseContext;
|
|
14
13
|
};
|
|
15
|
-
export declare const toParametersV3: ({ parameters, context }: ToParametersV3Args
|
|
14
|
+
export declare const toParametersV3: ({ parameters, context }: ToParametersV3Args) => Record<string, OasParameter | OasRef<"parameter">>;
|
|
16
15
|
type ToOptionalParametersV3Args = {
|
|
17
16
|
parameters: Record<string, OpenAPIV3.ParameterObject | OpenAPIV3.ReferenceObject> | undefined;
|
|
18
17
|
context: ParseContext;
|
|
19
18
|
};
|
|
20
|
-
export declare const toOptionalParametersV3: ({ parameters, context }: ToOptionalParametersV3Args
|
|
19
|
+
export declare const toOptionalParametersV3: ({ parameters, context }: ToOptionalParametersV3Args) => Record<string, OasParameter | OasRef<"parameter">> | undefined;
|
|
21
20
|
export {};
|
|
22
21
|
//# sourceMappingURL=toParameterV3.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"toParameterV3.d.ts","sourceRoot":"","sources":["../../../src/oas/parameter/toParameterV3.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,+BAA+B,CAAA;AAQjE,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,eAAe,CAAA;AAK9C,OAAO,EAAE,YAAY,EAAE,MAAM,gBAAgB,CAAA;AAE7C,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,eAAe,CAAA;
|
|
1
|
+
{"version":3,"file":"toParameterV3.d.ts","sourceRoot":"","sources":["../../../src/oas/parameter/toParameterV3.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,+BAA+B,CAAA;AAQjE,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,eAAe,CAAA;AAK9C,OAAO,EAAE,YAAY,EAAE,MAAM,gBAAgB,CAAA;AAE7C,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,eAAe,CAAA;AAI3C,KAAK,qBAAqB,GAAG;IAC3B,UAAU,EAAE,CAAC,SAAS,CAAC,eAAe,GAAG,SAAS,CAAC,eAAe,CAAC,EAAE,GAAG,SAAS,CAAA;IACjF,OAAO,EAAE,YAAY,CAAA;CACtB,CAAA;AAED,eAAO,MAAM,iBAAiB,4BAG3B,qBAAqB,KAAG,CAAC,YAAY,GAAG,MAAM,CAAC,WAAW,CAAC,CAAC,EAAE,GAAG,SAQnE,CAAA;AAED,KAAK,kBAAkB,GAAG;IACxB,UAAU,EAAE,MAAM,CAAC,MAAM,EAAE,SAAS,CAAC,eAAe,GAAG,SAAS,CAAC,eAAe,CAAC,CAAA;IACjF,OAAO,EAAE,YAAY,CAAA;CACtB,CAAA;AAED,eAAO,MAAM,cAAc,4BAGxB,kBAAkB,KAAG,MAAM,CAAC,MAAM,EAAE,YAAY,GAAG,MAAM,CAAC,WAAW,CAAC,CAMxE,CAAA;AAED,KAAK,0BAA0B,GAAG;IAChC,UAAU,EAAE,MAAM,CAAC,MAAM,EAAE,SAAS,CAAC,eAAe,GAAG,SAAS,CAAC,eAAe,CAAC,GAAG,SAAS,CAAA;IAC7F,OAAO,EAAE,YAAY,CAAA;CACtB,CAAA;AAED,eAAO,MAAM,sBAAsB,4BAGhC,0BAA0B,KAAG,MAAM,CAAC,MAAM,EAAE,YAAY,GAAG,MAAM,CAAC,WAAW,CAAC,CAAC,GAAG,SAMpF,CAAA"}
|
|
@@ -15,16 +15,16 @@ export const toParameterListV3 = ({ parameters, context }) => {
|
|
|
15
15
|
return context.trace(`${index}`, () => toParameterV3({ parameter, context }));
|
|
16
16
|
});
|
|
17
17
|
};
|
|
18
|
-
export const toParametersV3 = ({ parameters, context }
|
|
18
|
+
export const toParametersV3 = ({ parameters, context }) => {
|
|
19
19
|
return Object.fromEntries(Object.entries(parameters).map(([key, value]) => {
|
|
20
|
-
return [key, context.trace(key, () => toParameterV3({ parameter: value, context })
|
|
20
|
+
return [key, context.trace(key, () => toParameterV3({ parameter: value, context }))];
|
|
21
21
|
}));
|
|
22
22
|
};
|
|
23
|
-
export const toOptionalParametersV3 = ({ parameters, context }
|
|
23
|
+
export const toOptionalParametersV3 = ({ parameters, context }) => {
|
|
24
24
|
if (!parameters) {
|
|
25
25
|
return undefined;
|
|
26
26
|
}
|
|
27
|
-
return toParametersV3({ parameters, context }
|
|
27
|
+
return toParametersV3({ parameters, context });
|
|
28
28
|
};
|
|
29
29
|
const toParameterV3 = ({ parameter, context }) => {
|
|
30
30
|
if (isRef(parameter)) {
|
|
@@ -2,7 +2,6 @@ import type { OpenAPIV3 } from 'openapi-types';
|
|
|
2
2
|
import type { ParseContext } from '../../context/ParseContext.js';
|
|
3
3
|
import { OasRequestBody } from './RequestBody.js';
|
|
4
4
|
import type { OasRef } from '../ref/Ref.js';
|
|
5
|
-
import type { TraceOptions } from '../../context/StackTrail.js';
|
|
6
5
|
type ToRequestBodyV3Args = {
|
|
7
6
|
requestBody: OpenAPIV3.ReferenceObject | OpenAPIV3.RequestBodyObject | undefined;
|
|
8
7
|
forceRef?: boolean;
|
|
@@ -13,6 +12,6 @@ type ToRequestBodiesV3Args = {
|
|
|
13
12
|
requestBodies: Record<string, OpenAPIV3.ReferenceObject | OpenAPIV3.RequestBodyObject> | undefined;
|
|
14
13
|
context: ParseContext;
|
|
15
14
|
};
|
|
16
|
-
export declare const toRequestBodiesV3: ({ requestBodies, context }: ToRequestBodiesV3Args
|
|
15
|
+
export declare const toRequestBodiesV3: ({ requestBodies, context }: ToRequestBodiesV3Args) => Record<string, OasRequestBody | OasRef<"requestBody">> | undefined;
|
|
17
16
|
export {};
|
|
18
17
|
//# sourceMappingURL=toRequestBodiesV3.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"toRequestBodiesV3.d.ts","sourceRoot":"","sources":["../../../src/oas/requestBody/toRequestBodiesV3.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,eAAe,CAAA;AAC9C,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,+BAA+B,CAAA;AAIjE,OAAO,EAAE,cAAc,EAAE,MAAM,kBAAkB,CAAA;AAEjD,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,eAAe,CAAA;
|
|
1
|
+
{"version":3,"file":"toRequestBodiesV3.d.ts","sourceRoot":"","sources":["../../../src/oas/requestBody/toRequestBodiesV3.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,eAAe,CAAA;AAC9C,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,+BAA+B,CAAA;AAIjE,OAAO,EAAE,cAAc,EAAE,MAAM,kBAAkB,CAAA;AAEjD,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,eAAe,CAAA;AAG3C,KAAK,mBAAmB,GAAG;IACzB,WAAW,EAAE,SAAS,CAAC,eAAe,GAAG,SAAS,CAAC,iBAAiB,GAAG,SAAS,CAAA;IAChF,QAAQ,CAAC,EAAE,OAAO,CAAA;IAClB,OAAO,EAAE,YAAY,CAAA;CACtB,CAAA;AAED,eAAO,MAAM,eAAe,6BAGzB,mBAAmB,KAAG,cAAc,GAAG,MAAM,CAAC,aAAa,CAAC,GAAG,SA0BjE,CAAA;AAED,KAAK,qBAAqB,GAAG;IAC3B,aAAa,EAAE,MAAM,CAAC,MAAM,EAAE,SAAS,CAAC,eAAe,GAAG,SAAS,CAAC,iBAAiB,CAAC,GAAG,SAAS,CAAA;IAClG,OAAO,EAAE,YAAY,CAAA;CACtB,CAAA;AAED,eAAO,MAAM,iBAAiB,+BAG3B,qBAAqB,KAAG,MAAM,CAAC,MAAM,EAAE,cAAc,GAAG,MAAM,CAAC,aAAa,CAAC,CAAC,GAAG,SAYnF,CAAA"}
|
|
@@ -25,17 +25,13 @@ export const toRequestBodyV3 = ({ requestBody, context }) => {
|
|
|
25
25
|
};
|
|
26
26
|
return new OasRequestBody(fields);
|
|
27
27
|
};
|
|
28
|
-
export const toRequestBodiesV3 = ({ requestBodies, context }
|
|
28
|
+
export const toRequestBodiesV3 = ({ requestBodies, context }) => {
|
|
29
29
|
if (!requestBodies) {
|
|
30
30
|
return undefined;
|
|
31
31
|
}
|
|
32
32
|
const entries = Object.entries(requestBodies)
|
|
33
33
|
.map(([key, value]) => {
|
|
34
|
-
return [
|
|
35
|
-
key,
|
|
36
|
-
context.trace(key, () => toRequestBodyV3({ requestBody: value, context })),
|
|
37
|
-
options
|
|
38
|
-
];
|
|
34
|
+
return [key, context.trace(key, () => toRequestBodyV3({ requestBody: value, context }))];
|
|
39
35
|
})
|
|
40
36
|
.filter(([, value]) => Boolean(value));
|
|
41
37
|
return Object.fromEntries(entries);
|
|
@@ -2,17 +2,16 @@ import type { ParseContext } from '../../context/ParseContext.js';
|
|
|
2
2
|
import type { OpenAPIV3 } from 'openapi-types';
|
|
3
3
|
import { OasResponse } from './Response.js';
|
|
4
4
|
import type { OasRef } from '../ref/Ref.js';
|
|
5
|
-
import type { TraceOptions } from '../../context/StackTrail.js';
|
|
6
5
|
type ToResponsesV3Args = {
|
|
7
6
|
responses: OpenAPIV3.ResponsesObject;
|
|
8
7
|
context: ParseContext;
|
|
9
8
|
};
|
|
10
|
-
export declare const toResponsesV3: ({ responses, context }: ToResponsesV3Args
|
|
9
|
+
export declare const toResponsesV3: ({ responses, context }: ToResponsesV3Args) => Record<string, OasResponse | OasRef<"response">>;
|
|
11
10
|
type ToOptionalResponsesV3Args = {
|
|
12
11
|
responses: OpenAPIV3.ResponsesObject | undefined;
|
|
13
12
|
context: ParseContext;
|
|
14
13
|
};
|
|
15
|
-
export declare const toOptionalResponsesV3: ({ responses, context }: ToOptionalResponsesV3Args
|
|
14
|
+
export declare const toOptionalResponsesV3: ({ responses, context }: ToOptionalResponsesV3Args) => Record<string, OasResponse | OasRef<"response">> | undefined;
|
|
16
15
|
type ToResponseV3Args = {
|
|
17
16
|
response: OpenAPIV3.ReferenceObject | OpenAPIV3.ResponseObject;
|
|
18
17
|
context: ParseContext;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"toResponseV3.d.ts","sourceRoot":"","sources":["../../../src/oas/response/toResponseV3.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,+BAA+B,CAAA;AAEjE,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,eAAe,CAAA;AAE9C,OAAO,EAAE,WAAW,EAAE,MAAM,eAAe,CAAA;AAE3C,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,eAAe,CAAA;
|
|
1
|
+
{"version":3,"file":"toResponseV3.d.ts","sourceRoot":"","sources":["../../../src/oas/response/toResponseV3.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,+BAA+B,CAAA;AAEjE,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,eAAe,CAAA;AAE9C,OAAO,EAAE,WAAW,EAAE,MAAM,eAAe,CAAA;AAE3C,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,eAAe,CAAA;AAG3C,KAAK,iBAAiB,GAAG;IACvB,SAAS,EAAE,SAAS,CAAC,eAAe,CAAA;IACpC,OAAO,EAAE,YAAY,CAAA;CACtB,CAAA;AAED,eAAO,MAAM,aAAa,2BAGvB,iBAAiB,KAAG,MAAM,CAAC,MAAM,EAAE,WAAW,GAAG,MAAM,CAAC,UAAU,CAAC,CAMrE,CAAA;AAED,KAAK,yBAAyB,GAAG;IAC/B,SAAS,EAAE,SAAS,CAAC,eAAe,GAAG,SAAS,CAAA;IAChD,OAAO,EAAE,YAAY,CAAA;CACtB,CAAA;AAED,eAAO,MAAM,qBAAqB,2BAG/B,yBAAyB,KAAG,MAAM,CAAC,MAAM,EAAE,WAAW,GAAG,MAAM,CAAC,UAAU,CAAC,CAAC,GAAG,SAMjF,CAAA;AAED,KAAK,gBAAgB,GAAG;IACtB,QAAQ,EAAE,SAAS,CAAC,eAAe,GAAG,SAAS,CAAC,cAAc,CAAA;IAC9D,OAAO,EAAE,YAAY,CAAA;CACtB,CAAA;AAED,eAAO,MAAM,YAAY,0BAGtB,gBAAgB,KAAG,WAAW,GAAG,MAAM,CAAC,UAAU,CAoBpD,CAAA"}
|
|
@@ -4,16 +4,16 @@ import { isRef } from '../../helpers/refFns.js';
|
|
|
4
4
|
import { toOptionalMediaTypeItemsV3 } from '../mediaType/toMediaTypeItemV3.js';
|
|
5
5
|
import { OasResponse } from './Response.js';
|
|
6
6
|
import { toSpecificationExtensionsV3 } from '../specificationExtensions/toSpecificationExtensionsV3.js';
|
|
7
|
-
export const toResponsesV3 = ({ responses, context }
|
|
7
|
+
export const toResponsesV3 = ({ responses, context }) => {
|
|
8
8
|
return Object.fromEntries(Object.entries(responses).map(([key, value]) => {
|
|
9
|
-
return [key, context.trace(key, () => toResponseV3({ response: value, context })
|
|
9
|
+
return [key, context.trace(key, () => toResponseV3({ response: value, context }))];
|
|
10
10
|
}));
|
|
11
11
|
};
|
|
12
|
-
export const toOptionalResponsesV3 = ({ responses, context }
|
|
12
|
+
export const toOptionalResponsesV3 = ({ responses, context }) => {
|
|
13
13
|
if (!responses) {
|
|
14
14
|
return undefined;
|
|
15
15
|
}
|
|
16
|
-
return toResponsesV3({ responses, context }
|
|
16
|
+
return toResponsesV3({ responses, context });
|
|
17
17
|
};
|
|
18
18
|
export const toResponseV3 = ({ response, context }) => {
|
|
19
19
|
if (isRef(response)) {
|
|
@@ -2,17 +2,16 @@ import type { ParseContext } from '../../context/ParseContext.js';
|
|
|
2
2
|
import type { OpenAPIV3 } from 'openapi-types';
|
|
3
3
|
import type { OasSchema } from './Schema.js';
|
|
4
4
|
import type { OasRef } from '../ref/Ref.js';
|
|
5
|
-
import type { TraceOptions } from '../../context/StackTrail.js';
|
|
6
5
|
type ToSchemasV3Args = {
|
|
7
6
|
schemas: Record<string, OpenAPIV3.ReferenceObject | OpenAPIV3.SchemaObject>;
|
|
8
7
|
context: ParseContext;
|
|
9
8
|
};
|
|
10
|
-
export declare const toSchemasV3: ({ schemas, context }: ToSchemasV3Args
|
|
9
|
+
export declare const toSchemasV3: ({ schemas, context }: ToSchemasV3Args) => Record<string, OasSchema | OasRef<"schema">>;
|
|
11
10
|
type ToOptionalSchemasV3Args = {
|
|
12
11
|
schemas: Record<string, OpenAPIV3.ReferenceObject | OpenAPIV3.SchemaObject> | undefined;
|
|
13
12
|
context: ParseContext;
|
|
14
13
|
};
|
|
15
|
-
export declare const toOptionalSchemasV3: ({ schemas, context }: ToOptionalSchemasV3Args
|
|
14
|
+
export declare const toOptionalSchemasV3: ({ schemas, context }: ToOptionalSchemasV3Args) => Record<string, OasSchema | OasRef<"schema">> | undefined;
|
|
16
15
|
type ToSchemaV3Args = {
|
|
17
16
|
schema: OpenAPIV3.ReferenceObject | OpenAPIV3.SchemaObject;
|
|
18
17
|
context: ParseContext;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"toSchemasV3.d.ts","sourceRoot":"","sources":["../../../src/oas/schema/toSchemasV3.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,+BAA+B,CAAA;AAEjE,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,eAAe,CAAA;AAE9C,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,aAAa,CAAA;AAC5C,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,eAAe,CAAA;
|
|
1
|
+
{"version":3,"file":"toSchemasV3.d.ts","sourceRoot":"","sources":["../../../src/oas/schema/toSchemasV3.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,+BAA+B,CAAA;AAEjE,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,eAAe,CAAA;AAE9C,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,aAAa,CAAA;AAC5C,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,eAAe,CAAA;AAW3C,KAAK,eAAe,GAAG;IACrB,OAAO,EAAE,MAAM,CAAC,MAAM,EAAE,SAAS,CAAC,eAAe,GAAG,SAAS,CAAC,YAAY,CAAC,CAAA;IAC3E,OAAO,EAAE,YAAY,CAAA;CACtB,CAAA;AAED,eAAO,MAAM,WAAW,yBAGrB,eAAe,KAAG,MAAM,CAAC,MAAM,EAAE,SAAS,GAAG,MAAM,CAAC,QAAQ,CAAC,CAW/D,CAAA;AAED,KAAK,uBAAuB,GAAG;IAC7B,OAAO,EAAE,MAAM,CAAC,MAAM,EAAE,SAAS,CAAC,eAAe,GAAG,SAAS,CAAC,YAAY,CAAC,GAAG,SAAS,CAAA;IACvF,OAAO,EAAE,YAAY,CAAA;CACtB,CAAA;AAED,eAAO,MAAM,mBAAmB,yBAG7B,uBAAuB,KAAG,MAAM,CAAC,MAAM,EAAE,SAAS,GAAG,MAAM,CAAC,QAAQ,CAAC,CAAC,GAAG,SAM3E,CAAA;AAED,KAAK,cAAc,GAAG;IACpB,MAAM,EAAE,SAAS,CAAC,eAAe,GAAG,SAAS,CAAC,YAAY,CAAA;IAC1D,OAAO,EAAE,YAAY,CAAA;CACtB,CAAA;AAED,eAAO,MAAM,UAAU,wBAAyB,cAAc,KAAG,SAAS,GAAG,MAAM,CAAC,QAAQ,CAuC3F,CAAA;AAED,KAAK,sBAAsB,GAAG;IAC5B,MAAM,EAAE,SAAS,CAAC,eAAe,GAAG,SAAS,CAAC,YAAY,GAAG,SAAS,CAAA;IACtE,OAAO,EAAE,YAAY,CAAA;CACtB,CAAA;AAED,eAAO,MAAM,kBAAkB,wBAG5B,sBAAsB,KAAG,SAAS,GAAG,MAAM,CAAC,QAAQ,CAAC,GAAG,SAM1D,CAAA"}
|
|
@@ -10,16 +10,21 @@ import { toString } from '../string/toString.js';
|
|
|
10
10
|
import { toUnknown } from '../unknown/toUnknown.js';
|
|
11
11
|
import { toUnion } from '../union/toUnion.js';
|
|
12
12
|
import { toIntersection } from '../intersection/toIntersection.js';
|
|
13
|
-
export const toSchemasV3 = ({ schemas, context }
|
|
13
|
+
export const toSchemasV3 = ({ schemas, context }) => {
|
|
14
14
|
return Object.fromEntries(Object.entries(schemas).map(([key, schema]) => {
|
|
15
|
-
return [
|
|
15
|
+
return [
|
|
16
|
+
key,
|
|
17
|
+
context.trace(key, () => {
|
|
18
|
+
return toSchemaV3({ schema, context });
|
|
19
|
+
})
|
|
20
|
+
];
|
|
16
21
|
}));
|
|
17
22
|
};
|
|
18
|
-
export const toOptionalSchemasV3 = ({ schemas, context }
|
|
23
|
+
export const toOptionalSchemasV3 = ({ schemas, context }) => {
|
|
19
24
|
if (!schemas) {
|
|
20
25
|
return undefined;
|
|
21
26
|
}
|
|
22
|
-
return toSchemasV3({ schemas, context }
|
|
27
|
+
return toSchemasV3({ schemas, context });
|
|
23
28
|
};
|
|
24
29
|
export const toSchemaV3 = ({ schema, context }) => {
|
|
25
30
|
if (isRef(schema)) {
|
|
@@ -6,7 +6,7 @@ export type StringFields = {
|
|
|
6
6
|
title?: string;
|
|
7
7
|
description?: string;
|
|
8
8
|
format?: string;
|
|
9
|
-
enums?:
|
|
9
|
+
enums?: string[];
|
|
10
10
|
maxLength?: number;
|
|
11
11
|
minLength?: number;
|
|
12
12
|
nullable?: boolean;
|
|
@@ -41,7 +41,7 @@ export declare class OasString {
|
|
|
41
41
|
/**
|
|
42
42
|
* An array of allowed values for the string.
|
|
43
43
|
*/
|
|
44
|
-
enums:
|
|
44
|
+
enums: string[] | undefined;
|
|
45
45
|
/**
|
|
46
46
|
* The maximum length of the string.
|
|
47
47
|
*/
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"String.d.ts","sourceRoot":"","sources":["../../../src/oas/string/String.ts"],"names":[],"mappings":"AAAA,OAAO,yBAAyB,CAAC;AACjC,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,eAAe,CAAA;AAC3C,OAAO,KAAK,EAAE,mBAAmB,EAAE,MAAM,qBAAqB,CAAA;AAC9D,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,eAAe,CAAA;AAE9C,MAAM,MAAM,YAAY,GAAG;IACzB,KAAK,CAAC,EAAE,MAAM,CAAA;IACd,WAAW,CAAC,EAAE,MAAM,CAAA;IACpB,MAAM,CAAC,EAAE,MAAM,CAAA;IAEf,KAAK,CAAC,EAAE,
|
|
1
|
+
{"version":3,"file":"String.d.ts","sourceRoot":"","sources":["../../../src/oas/string/String.ts"],"names":[],"mappings":"AAAA,OAAO,yBAAyB,CAAC;AACjC,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,eAAe,CAAA;AAC3C,OAAO,KAAK,EAAE,mBAAmB,EAAE,MAAM,qBAAqB,CAAA;AAC9D,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,eAAe,CAAA;AAE9C,MAAM,MAAM,YAAY,GAAG;IACzB,KAAK,CAAC,EAAE,MAAM,CAAA;IACd,WAAW,CAAC,EAAE,MAAM,CAAA;IACpB,MAAM,CAAC,EAA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