@skmtc/core 0.0.513 → 0.0.515
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/oas/document/Document.d.ts +2 -0
- package/esm/oas/document/Document.d.ts.map +1 -1
- package/esm/oas/document/toDocumentFieldsV3.d.ts.map +1 -1
- package/esm/oas/document/toDocumentFieldsV3.js +3 -1
- package/esm/oas/object/toAdditionalPropertiesV3.d.ts.map +1 -1
- package/esm/oas/server/Server.d.ts +19 -0
- package/esm/oas/server/Server.d.ts.map +1 -0
- package/esm/oas/server/Server.js +46 -0
- package/esm/oas/server/toServerV3.d.ts +20 -0
- package/esm/oas/server/toServerV3.d.ts.map +1 -0
- package/esm/oas/server/toServerV3.js +26 -0
- package/package.json +1 -1
- package/script/oas/document/Document.d.ts +2 -0
- package/script/oas/document/Document.d.ts.map +1 -1
- package/script/oas/document/toDocumentFieldsV3.d.ts.map +1 -1
- package/script/oas/document/toDocumentFieldsV3.js +3 -1
- package/script/oas/object/toAdditionalPropertiesV3.d.ts.map +1 -1
- package/script/oas/server/Server.d.ts +19 -0
- package/script/oas/server/Server.d.ts.map +1 -0
- package/script/oas/server/Server.js +50 -0
- package/script/oas/server/toServerV3.d.ts +20 -0
- package/script/oas/server/toServerV3.d.ts.map +1 -0
- package/script/oas/server/toServerV3.js +32 -0
|
@@ -2,9 +2,11 @@ import type { OasTag } from '../tag/Tag.js';
|
|
|
2
2
|
import type { OasComponents } from '../components/Components.js';
|
|
3
3
|
import type { OasOperation } from '../operation/Operation.js';
|
|
4
4
|
import type { OasInfo } from '../info/Info.js';
|
|
5
|
+
import type { OasServer } from '../server/Server.js';
|
|
5
6
|
export type DocumentFields = {
|
|
6
7
|
openapi: string;
|
|
7
8
|
info: OasInfo;
|
|
9
|
+
servers?: OasServer[] | undefined;
|
|
8
10
|
operations: OasOperation[];
|
|
9
11
|
components?: OasComponents | undefined;
|
|
10
12
|
tags?: OasTag[] | undefined;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Document.d.ts","sourceRoot":"","sources":["../../../src/oas/document/Document.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,eAAe,CAAA;AAC3C,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,6BAA6B,CAAA;AAChE,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,2BAA2B,CAAA;AAC7D,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,iBAAiB,CAAA;
|
|
1
|
+
{"version":3,"file":"Document.d.ts","sourceRoot":"","sources":["../../../src/oas/document/Document.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,eAAe,CAAA;AAC3C,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,6BAA6B,CAAA;AAChE,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,2BAA2B,CAAA;AAC7D,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,iBAAiB,CAAA;AAC9C,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,qBAAqB,CAAA;AAEpD,MAAM,MAAM,cAAc,GAAG;IAC3B,OAAO,EAAE,MAAM,CAAA;IACf,IAAI,EAAE,OAAO,CAAA;IACb,OAAO,CAAC,EAAE,SAAS,EAAE,GAAG,SAAS,CAAA;IACjC,UAAU,EAAE,YAAY,EAAE,CAAA;IAC1B,UAAU,CAAC,EAAE,aAAa,GAAG,SAAS,CAAA;IACtC,IAAI,CAAC,EAAE,MAAM,EAAE,GAAG,SAAS,CAAA;IAC3B,eAAe,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAA;CAC1C,CAAA;AAED,mDAAmD;AACnD,qBAAa,WAAW;;IACtB,iDAAiD;IACjD,OAAO,EAAE,SAAS,CAAY;gBAIlB,MAAM,CAAC,EAAE,cAAc;IAInC,IAAI,MAAM,CAAC,MAAM,EAAE,cAAc,EAEhC;IAED,oCAAoC;IACpC,IAAI,OAAO,IAAI,MAAM,CAMpB;IAED,mBAAmB;IACnB,IAAI,IAAI,IAAI,OAAO,CAMlB;IAED,yCAAyC;IACzC,IAAI,UAAU,IAAI,YAAY,EAAE,CAM/B;IAED,iEAAiE;IACjE,IAAI,UAAU,IAAI,aAAa,GAAG,SAAS,CAM1C;IAED,wDAAwD;IACxD,IAAI,IAAI,IAAI,MAAM,EAAE,GAAG,SAAS,CAM/B;IAED,qCAAqC;IACrC,IAAI,eAAe,IAAI,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,GAAG,SAAS,CAMzD;CACF"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"toDocumentFieldsV3.d.ts","sourceRoot":"","sources":["../../../src/oas/document/toDocumentFieldsV3.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,eAAe,CAAA;AAC9C,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,+BAA+B,CAAA;AAKjE,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,eAAe,CAAA;
|
|
1
|
+
{"version":3,"file":"toDocumentFieldsV3.d.ts","sourceRoot":"","sources":["../../../src/oas/document/toDocumentFieldsV3.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,eAAe,CAAA;AAC9C,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,+BAA+B,CAAA;AAKjE,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,eAAe,CAAA;AAInD,KAAK,gBAAgB,GAAG;IACtB,cAAc,EAAE,SAAS,CAAC,QAAQ,CAAA;IAClC,OAAO,EAAE,YAAY,CAAA;CACtB,CAAA;AAED,eAAO,MAAM,kBAAkB,gCAG5B,gBAAgB,KAAG,cAmBrB,CAAA"}
|
|
@@ -3,8 +3,9 @@ import { toOperationsV3 } from '../operation/toOperationsV3.js';
|
|
|
3
3
|
import { toComponentsV3 } from '../components/toComponentsV3.js';
|
|
4
4
|
import { toInfoV3 } from '../info/toInfoV3.js';
|
|
5
5
|
import { toSpecificationExtensionsV3 } from '../specificationExtensions/toSpecificationExtensionsV3.js';
|
|
6
|
+
import { toOptionalServersV3 } from '../server/toServerV3.js';
|
|
6
7
|
export const toDocumentFieldsV3 = ({ documentObject, context }) => {
|
|
7
|
-
const { openapi, info, paths, components, tags, ...skipped } = documentObject;
|
|
8
|
+
const { openapi, info, paths, components, tags, servers, ...skipped } = documentObject;
|
|
8
9
|
const extensionFields = toSpecificationExtensionsV3({
|
|
9
10
|
skipped,
|
|
10
11
|
context
|
|
@@ -12,6 +13,7 @@ export const toDocumentFieldsV3 = ({ documentObject, context }) => {
|
|
|
12
13
|
const fields = {
|
|
13
14
|
openapi,
|
|
14
15
|
info: context.trace('info', () => toInfoV3({ info, context })),
|
|
16
|
+
servers: context.trace('servers', () => toOptionalServersV3({ servers, context })),
|
|
15
17
|
operations: context.trace('paths', () => toOperationsV3({ paths, context })),
|
|
16
18
|
components: context.trace('components', () => toComponentsV3({ components, context })),
|
|
17
19
|
tags: context.trace('tags', () => toTagsV3({ tags, context })),
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"toAdditionalPropertiesV3.d.ts","sourceRoot":"","sources":["../../../src/oas/object/toAdditionalPropertiesV3.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,eAAe,CAAA;AAC9C,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,+BAA+B,CAAA;AAEjE,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,qBAAqB,CAAA;AACpD,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,eAAe,CAAA;AAE3C,KAAK,4BAA4B,GAAG;IAClC,oBAAoB,
|
|
1
|
+
{"version":3,"file":"toAdditionalPropertiesV3.d.ts","sourceRoot":"","sources":["../../../src/oas/object/toAdditionalPropertiesV3.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,eAAe,CAAA;AAC9C,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,+BAA+B,CAAA;AAEjE,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,qBAAqB,CAAA;AACpD,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,eAAe,CAAA;AAE3C,KAAK,4BAA4B,GAAG;IAClC,oBAAoB,EAAE,OAAO,GAAG,SAAS,CAAC,eAAe,GAAG,SAAS,CAAC,YAAY,GAAG,SAAS,CAAA;IAC9F,OAAO,EAAE,YAAY,CAAA;CACtB,CAAA;AAED,eAAO,MAAM,wBAAwB,sCAGlC,4BAA4B,KAAG,SAAS,GAAG,MAAM,CAAC,QAAQ,CAAC,GAAG,OAAO,GAAG,SAU1E,CAAA"}
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
import type { ToJsonSchemaOptions } from '../schema/Schema.js';
|
|
2
|
+
import type { OpenAPIV3 } from 'openapi-types';
|
|
3
|
+
export type ServerFields = {
|
|
4
|
+
description?: string | undefined;
|
|
5
|
+
url: string;
|
|
6
|
+
extensionFields?: Record<string, unknown>;
|
|
7
|
+
};
|
|
8
|
+
export declare class OasServer {
|
|
9
|
+
oasType: 'server';
|
|
10
|
+
description: string | undefined;
|
|
11
|
+
url: string;
|
|
12
|
+
extensionFields: Record<string, unknown> | undefined;
|
|
13
|
+
constructor(fields: ServerFields);
|
|
14
|
+
isRef(): boolean;
|
|
15
|
+
resolve(): OasServer;
|
|
16
|
+
resolveOnce(): OasServer;
|
|
17
|
+
toJsonSchema(_options: ToJsonSchemaOptions): OpenAPIV3.ServerObject;
|
|
18
|
+
}
|
|
19
|
+
//# sourceMappingURL=Server.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"Server.d.ts","sourceRoot":"","sources":["../../../src/oas/server/Server.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,mBAAmB,EAAE,MAAM,qBAAqB,CAAA;AAC9D,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,eAAe,CAAA;AAE9C,MAAM,MAAM,YAAY,GAAG;IACzB,WAAW,CAAC,EAAE,MAAM,GAAG,SAAS,CAAA;IAChC,GAAG,EAAE,MAAM,CAAA;IACX,eAAe,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAA;CAC1C,CAAA;AAED,qBAAa,SAAS;IACpB,OAAO,EAAE,QAAQ,CAAW;IAC5B,WAAW,EAAE,MAAM,GAAG,SAAS,CAAA;IAC/B,GAAG,EAAE,MAAM,CAAA;IACX,eAAe,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,GAAG,SAAS,CAAA;gBACxC,MAAM,EAAE,YAAY;IAMhC,KAAK;IAIL,OAAO,IAAI,SAAS;IAIpB,WAAW,IAAI,SAAS;IAIxB,YAAY,CAAC,QAAQ,EAAE,mBAAmB,GAAG,SAAS,CAAC,YAAY;CAMpE"}
|
|
@@ -0,0 +1,46 @@
|
|
|
1
|
+
export class OasServer {
|
|
2
|
+
constructor(fields) {
|
|
3
|
+
Object.defineProperty(this, "oasType", {
|
|
4
|
+
enumerable: true,
|
|
5
|
+
configurable: true,
|
|
6
|
+
writable: true,
|
|
7
|
+
value: 'server'
|
|
8
|
+
});
|
|
9
|
+
Object.defineProperty(this, "description", {
|
|
10
|
+
enumerable: true,
|
|
11
|
+
configurable: true,
|
|
12
|
+
writable: true,
|
|
13
|
+
value: void 0
|
|
14
|
+
});
|
|
15
|
+
Object.defineProperty(this, "url", {
|
|
16
|
+
enumerable: true,
|
|
17
|
+
configurable: true,
|
|
18
|
+
writable: true,
|
|
19
|
+
value: void 0
|
|
20
|
+
});
|
|
21
|
+
Object.defineProperty(this, "extensionFields", {
|
|
22
|
+
enumerable: true,
|
|
23
|
+
configurable: true,
|
|
24
|
+
writable: true,
|
|
25
|
+
value: void 0
|
|
26
|
+
});
|
|
27
|
+
this.description = fields.description;
|
|
28
|
+
this.url = fields.url;
|
|
29
|
+
this.extensionFields = fields.extensionFields;
|
|
30
|
+
}
|
|
31
|
+
isRef() {
|
|
32
|
+
return false;
|
|
33
|
+
}
|
|
34
|
+
resolve() {
|
|
35
|
+
return this;
|
|
36
|
+
}
|
|
37
|
+
resolveOnce() {
|
|
38
|
+
return this;
|
|
39
|
+
}
|
|
40
|
+
toJsonSchema(_options) {
|
|
41
|
+
return {
|
|
42
|
+
description: this.description,
|
|
43
|
+
url: this.url
|
|
44
|
+
};
|
|
45
|
+
}
|
|
46
|
+
}
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
import type { ParseContext } from '../../context/ParseContext.js';
|
|
2
|
+
import type { OpenAPIV3 } from 'openapi-types';
|
|
3
|
+
import { OasServer } from './Server.js';
|
|
4
|
+
type ToServersV3Args = {
|
|
5
|
+
servers: OpenAPIV3.ServerObject[];
|
|
6
|
+
context: ParseContext;
|
|
7
|
+
};
|
|
8
|
+
export declare const toServersV3: ({ servers, context }: ToServersV3Args) => OasServer[];
|
|
9
|
+
type ToOptionalServersV3Args = {
|
|
10
|
+
servers: OpenAPIV3.ServerObject[] | undefined;
|
|
11
|
+
context: ParseContext;
|
|
12
|
+
};
|
|
13
|
+
export declare const toOptionalServersV3: ({ servers, context }: ToOptionalServersV3Args) => OasServer[] | undefined;
|
|
14
|
+
type ToServerV3Args = {
|
|
15
|
+
server: OpenAPIV3.ServerObject;
|
|
16
|
+
context: ParseContext;
|
|
17
|
+
};
|
|
18
|
+
export declare const toServerV3: ({ server, context }: ToServerV3Args) => OasServer;
|
|
19
|
+
export {};
|
|
20
|
+
//# sourceMappingURL=toServerV3.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"toServerV3.d.ts","sourceRoot":"","sources":["../../../src/oas/server/toServerV3.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,+BAA+B,CAAA;AACjE,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,eAAe,CAAA;AAC9C,OAAO,EAAE,SAAS,EAAE,MAAM,aAAa,CAAA;AAIvC,KAAK,eAAe,GAAG;IACrB,OAAO,EAAE,SAAS,CAAC,YAAY,EAAE,CAAA;IACjC,OAAO,EAAE,YAAY,CAAA;CACtB,CAAA;AAED,eAAO,MAAM,WAAW,yBAA0B,eAAe,KAAG,SAAS,EAI5E,CAAA;AAED,KAAK,uBAAuB,GAAG;IAC7B,OAAO,EAAE,SAAS,CAAC,YAAY,EAAE,GAAG,SAAS,CAAA;IAC7C,OAAO,EAAE,YAAY,CAAA;CACtB,CAAA;AAED,eAAO,MAAM,mBAAmB,yBAG7B,uBAAuB,KAAG,SAAS,EAAE,GAAG,SAM1C,CAAA;AAED,KAAK,cAAc,GAAG;IACpB,MAAM,EAAE,SAAS,CAAC,YAAY,CAAA;IAC9B,OAAO,EAAE,YAAY,CAAA;CACtB,CAAA;AAED,eAAO,MAAM,UAAU,wBAAyB,cAAc,KAAG,SAehE,CAAA"}
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
import { OasServer } from './Server.js';
|
|
2
|
+
import { toSpecificationExtensionsV3 } from '../specificationExtensions/toSpecificationExtensionsV3.js';
|
|
3
|
+
export const toServersV3 = ({ servers, context }) => {
|
|
4
|
+
return servers.map((server, index) => {
|
|
5
|
+
return context.trace(server.url ?? index, () => toServerV3({ server, context }));
|
|
6
|
+
});
|
|
7
|
+
};
|
|
8
|
+
export const toOptionalServersV3 = ({ servers, context }) => {
|
|
9
|
+
if (!servers) {
|
|
10
|
+
return undefined;
|
|
11
|
+
}
|
|
12
|
+
return toServersV3({ servers, context });
|
|
13
|
+
};
|
|
14
|
+
export const toServerV3 = ({ server, context }) => {
|
|
15
|
+
const { description, url, ...skipped } = server;
|
|
16
|
+
const extensionFields = toSpecificationExtensionsV3({
|
|
17
|
+
skipped,
|
|
18
|
+
context
|
|
19
|
+
});
|
|
20
|
+
const fields = {
|
|
21
|
+
description,
|
|
22
|
+
url,
|
|
23
|
+
extensionFields
|
|
24
|
+
};
|
|
25
|
+
return new OasServer(fields);
|
|
26
|
+
};
|
package/package.json
CHANGED
|
@@ -2,9 +2,11 @@ import type { OasTag } from '../tag/Tag.js';
|
|
|
2
2
|
import type { OasComponents } from '../components/Components.js';
|
|
3
3
|
import type { OasOperation } from '../operation/Operation.js';
|
|
4
4
|
import type { OasInfo } from '../info/Info.js';
|
|
5
|
+
import type { OasServer } from '../server/Server.js';
|
|
5
6
|
export type DocumentFields = {
|
|
6
7
|
openapi: string;
|
|
7
8
|
info: OasInfo;
|
|
9
|
+
servers?: OasServer[] | undefined;
|
|
8
10
|
operations: OasOperation[];
|
|
9
11
|
components?: OasComponents | undefined;
|
|
10
12
|
tags?: OasTag[] | undefined;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Document.d.ts","sourceRoot":"","sources":["../../../src/oas/document/Document.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,eAAe,CAAA;AAC3C,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,6BAA6B,CAAA;AAChE,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,2BAA2B,CAAA;AAC7D,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,iBAAiB,CAAA;
|
|
1
|
+
{"version":3,"file":"Document.d.ts","sourceRoot":"","sources":["../../../src/oas/document/Document.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,eAAe,CAAA;AAC3C,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,6BAA6B,CAAA;AAChE,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,2BAA2B,CAAA;AAC7D,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,iBAAiB,CAAA;AAC9C,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,qBAAqB,CAAA;AAEpD,MAAM,MAAM,cAAc,GAAG;IAC3B,OAAO,EAAE,MAAM,CAAA;IACf,IAAI,EAAE,OAAO,CAAA;IACb,OAAO,CAAC,EAAE,SAAS,EAAE,GAAG,SAAS,CAAA;IACjC,UAAU,EAAE,YAAY,EAAE,CAAA;IAC1B,UAAU,CAAC,EAAE,aAAa,GAAG,SAAS,CAAA;IACtC,IAAI,CAAC,EAAE,MAAM,EAAE,GAAG,SAAS,CAAA;IAC3B,eAAe,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAA;CAC1C,CAAA;AAED,mDAAmD;AACnD,qBAAa,WAAW;;IACtB,iDAAiD;IACjD,OAAO,EAAE,SAAS,CAAY;gBAIlB,MAAM,CAAC,EAAE,cAAc;IAInC,IAAI,MAAM,CAAC,MAAM,EAAE,cAAc,EAEhC;IAED,oCAAoC;IACpC,IAAI,OAAO,IAAI,MAAM,CAMpB;IAED,mBAAmB;IACnB,IAAI,IAAI,IAAI,OAAO,CAMlB;IAED,yCAAyC;IACzC,IAAI,UAAU,IAAI,YAAY,EAAE,CAM/B;IAED,iEAAiE;IACjE,IAAI,UAAU,IAAI,aAAa,GAAG,SAAS,CAM1C;IAED,wDAAwD;IACxD,IAAI,IAAI,IAAI,MAAM,EAAE,GAAG,SAAS,CAM/B;IAED,qCAAqC;IACrC,IAAI,eAAe,IAAI,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,GAAG,SAAS,CAMzD;CACF"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"toDocumentFieldsV3.d.ts","sourceRoot":"","sources":["../../../src/oas/document/toDocumentFieldsV3.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,eAAe,CAAA;AAC9C,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,+BAA+B,CAAA;AAKjE,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,eAAe,CAAA;
|
|
1
|
+
{"version":3,"file":"toDocumentFieldsV3.d.ts","sourceRoot":"","sources":["../../../src/oas/document/toDocumentFieldsV3.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,eAAe,CAAA;AAC9C,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,+BAA+B,CAAA;AAKjE,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,eAAe,CAAA;AAInD,KAAK,gBAAgB,GAAG;IACtB,cAAc,EAAE,SAAS,CAAC,QAAQ,CAAA;IAClC,OAAO,EAAE,YAAY,CAAA;CACtB,CAAA;AAED,eAAO,MAAM,kBAAkB,gCAG5B,gBAAgB,KAAG,cAmBrB,CAAA"}
|
|
@@ -6,8 +6,9 @@ const toOperationsV3_js_1 = require("../operation/toOperationsV3.js");
|
|
|
6
6
|
const toComponentsV3_js_1 = require("../components/toComponentsV3.js");
|
|
7
7
|
const toInfoV3_js_1 = require("../info/toInfoV3.js");
|
|
8
8
|
const toSpecificationExtensionsV3_js_1 = require("../specificationExtensions/toSpecificationExtensionsV3.js");
|
|
9
|
+
const toServerV3_js_1 = require("../server/toServerV3.js");
|
|
9
10
|
const toDocumentFieldsV3 = ({ documentObject, context }) => {
|
|
10
|
-
const { openapi, info, paths, components, tags, ...skipped } = documentObject;
|
|
11
|
+
const { openapi, info, paths, components, tags, servers, ...skipped } = documentObject;
|
|
11
12
|
const extensionFields = (0, toSpecificationExtensionsV3_js_1.toSpecificationExtensionsV3)({
|
|
12
13
|
skipped,
|
|
13
14
|
context
|
|
@@ -15,6 +16,7 @@ const toDocumentFieldsV3 = ({ documentObject, context }) => {
|
|
|
15
16
|
const fields = {
|
|
16
17
|
openapi,
|
|
17
18
|
info: context.trace('info', () => (0, toInfoV3_js_1.toInfoV3)({ info, context })),
|
|
19
|
+
servers: context.trace('servers', () => (0, toServerV3_js_1.toOptionalServersV3)({ servers, context })),
|
|
18
20
|
operations: context.trace('paths', () => (0, toOperationsV3_js_1.toOperationsV3)({ paths, context })),
|
|
19
21
|
components: context.trace('components', () => (0, toComponentsV3_js_1.toComponentsV3)({ components, context })),
|
|
20
22
|
tags: context.trace('tags', () => (0, toTagsV3_js_1.toTagsV3)({ tags, context })),
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"toAdditionalPropertiesV3.d.ts","sourceRoot":"","sources":["../../../src/oas/object/toAdditionalPropertiesV3.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,eAAe,CAAA;AAC9C,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,+BAA+B,CAAA;AAEjE,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,qBAAqB,CAAA;AACpD,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,eAAe,CAAA;AAE3C,KAAK,4BAA4B,GAAG;IAClC,oBAAoB,
|
|
1
|
+
{"version":3,"file":"toAdditionalPropertiesV3.d.ts","sourceRoot":"","sources":["../../../src/oas/object/toAdditionalPropertiesV3.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,eAAe,CAAA;AAC9C,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,+BAA+B,CAAA;AAEjE,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,qBAAqB,CAAA;AACpD,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,eAAe,CAAA;AAE3C,KAAK,4BAA4B,GAAG;IAClC,oBAAoB,EAAE,OAAO,GAAG,SAAS,CAAC,eAAe,GAAG,SAAS,CAAC,YAAY,GAAG,SAAS,CAAA;IAC9F,OAAO,EAAE,YAAY,CAAA;CACtB,CAAA;AAED,eAAO,MAAM,wBAAwB,sCAGlC,4BAA4B,KAAG,SAAS,GAAG,MAAM,CAAC,QAAQ,CAAC,GAAG,OAAO,GAAG,SAU1E,CAAA"}
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
import type { ToJsonSchemaOptions } from '../schema/Schema.js';
|
|
2
|
+
import type { OpenAPIV3 } from 'openapi-types';
|
|
3
|
+
export type ServerFields = {
|
|
4
|
+
description?: string | undefined;
|
|
5
|
+
url: string;
|
|
6
|
+
extensionFields?: Record<string, unknown>;
|
|
7
|
+
};
|
|
8
|
+
export declare class OasServer {
|
|
9
|
+
oasType: 'server';
|
|
10
|
+
description: string | undefined;
|
|
11
|
+
url: string;
|
|
12
|
+
extensionFields: Record<string, unknown> | undefined;
|
|
13
|
+
constructor(fields: ServerFields);
|
|
14
|
+
isRef(): boolean;
|
|
15
|
+
resolve(): OasServer;
|
|
16
|
+
resolveOnce(): OasServer;
|
|
17
|
+
toJsonSchema(_options: ToJsonSchemaOptions): OpenAPIV3.ServerObject;
|
|
18
|
+
}
|
|
19
|
+
//# sourceMappingURL=Server.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"Server.d.ts","sourceRoot":"","sources":["../../../src/oas/server/Server.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,mBAAmB,EAAE,MAAM,qBAAqB,CAAA;AAC9D,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,eAAe,CAAA;AAE9C,MAAM,MAAM,YAAY,GAAG;IACzB,WAAW,CAAC,EAAE,MAAM,GAAG,SAAS,CAAA;IAChC,GAAG,EAAE,MAAM,CAAA;IACX,eAAe,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAA;CAC1C,CAAA;AAED,qBAAa,SAAS;IACpB,OAAO,EAAE,QAAQ,CAAW;IAC5B,WAAW,EAAE,MAAM,GAAG,SAAS,CAAA;IAC/B,GAAG,EAAE,MAAM,CAAA;IACX,eAAe,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,GAAG,SAAS,CAAA;gBACxC,MAAM,EAAE,YAAY;IAMhC,KAAK;IAIL,OAAO,IAAI,SAAS;IAIpB,WAAW,IAAI,SAAS;IAIxB,YAAY,CAAC,QAAQ,EAAE,mBAAmB,GAAG,SAAS,CAAC,YAAY;CAMpE"}
|
|
@@ -0,0 +1,50 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.OasServer = void 0;
|
|
4
|
+
class OasServer {
|
|
5
|
+
constructor(fields) {
|
|
6
|
+
Object.defineProperty(this, "oasType", {
|
|
7
|
+
enumerable: true,
|
|
8
|
+
configurable: true,
|
|
9
|
+
writable: true,
|
|
10
|
+
value: 'server'
|
|
11
|
+
});
|
|
12
|
+
Object.defineProperty(this, "description", {
|
|
13
|
+
enumerable: true,
|
|
14
|
+
configurable: true,
|
|
15
|
+
writable: true,
|
|
16
|
+
value: void 0
|
|
17
|
+
});
|
|
18
|
+
Object.defineProperty(this, "url", {
|
|
19
|
+
enumerable: true,
|
|
20
|
+
configurable: true,
|
|
21
|
+
writable: true,
|
|
22
|
+
value: void 0
|
|
23
|
+
});
|
|
24
|
+
Object.defineProperty(this, "extensionFields", {
|
|
25
|
+
enumerable: true,
|
|
26
|
+
configurable: true,
|
|
27
|
+
writable: true,
|
|
28
|
+
value: void 0
|
|
29
|
+
});
|
|
30
|
+
this.description = fields.description;
|
|
31
|
+
this.url = fields.url;
|
|
32
|
+
this.extensionFields = fields.extensionFields;
|
|
33
|
+
}
|
|
34
|
+
isRef() {
|
|
35
|
+
return false;
|
|
36
|
+
}
|
|
37
|
+
resolve() {
|
|
38
|
+
return this;
|
|
39
|
+
}
|
|
40
|
+
resolveOnce() {
|
|
41
|
+
return this;
|
|
42
|
+
}
|
|
43
|
+
toJsonSchema(_options) {
|
|
44
|
+
return {
|
|
45
|
+
description: this.description,
|
|
46
|
+
url: this.url
|
|
47
|
+
};
|
|
48
|
+
}
|
|
49
|
+
}
|
|
50
|
+
exports.OasServer = OasServer;
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
import type { ParseContext } from '../../context/ParseContext.js';
|
|
2
|
+
import type { OpenAPIV3 } from 'openapi-types';
|
|
3
|
+
import { OasServer } from './Server.js';
|
|
4
|
+
type ToServersV3Args = {
|
|
5
|
+
servers: OpenAPIV3.ServerObject[];
|
|
6
|
+
context: ParseContext;
|
|
7
|
+
};
|
|
8
|
+
export declare const toServersV3: ({ servers, context }: ToServersV3Args) => OasServer[];
|
|
9
|
+
type ToOptionalServersV3Args = {
|
|
10
|
+
servers: OpenAPIV3.ServerObject[] | undefined;
|
|
11
|
+
context: ParseContext;
|
|
12
|
+
};
|
|
13
|
+
export declare const toOptionalServersV3: ({ servers, context }: ToOptionalServersV3Args) => OasServer[] | undefined;
|
|
14
|
+
type ToServerV3Args = {
|
|
15
|
+
server: OpenAPIV3.ServerObject;
|
|
16
|
+
context: ParseContext;
|
|
17
|
+
};
|
|
18
|
+
export declare const toServerV3: ({ server, context }: ToServerV3Args) => OasServer;
|
|
19
|
+
export {};
|
|
20
|
+
//# sourceMappingURL=toServerV3.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"toServerV3.d.ts","sourceRoot":"","sources":["../../../src/oas/server/toServerV3.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,+BAA+B,CAAA;AACjE,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,eAAe,CAAA;AAC9C,OAAO,EAAE,SAAS,EAAE,MAAM,aAAa,CAAA;AAIvC,KAAK,eAAe,GAAG;IACrB,OAAO,EAAE,SAAS,CAAC,YAAY,EAAE,CAAA;IACjC,OAAO,EAAE,YAAY,CAAA;CACtB,CAAA;AAED,eAAO,MAAM,WAAW,yBAA0B,eAAe,KAAG,SAAS,EAI5E,CAAA;AAED,KAAK,uBAAuB,GAAG;IAC7B,OAAO,EAAE,SAAS,CAAC,YAAY,EAAE,GAAG,SAAS,CAAA;IAC7C,OAAO,EAAE,YAAY,CAAA;CACtB,CAAA;AAED,eAAO,MAAM,mBAAmB,yBAG7B,uBAAuB,KAAG,SAAS,EAAE,GAAG,SAM1C,CAAA;AAED,KAAK,cAAc,GAAG;IACpB,MAAM,EAAE,SAAS,CAAC,YAAY,CAAA;IAC9B,OAAO,EAAE,YAAY,CAAA;CACtB,CAAA;AAED,eAAO,MAAM,UAAU,wBAAyB,cAAc,KAAG,SAehE,CAAA"}
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.toServerV3 = exports.toOptionalServersV3 = exports.toServersV3 = void 0;
|
|
4
|
+
const Server_js_1 = require("./Server.js");
|
|
5
|
+
const toSpecificationExtensionsV3_js_1 = require("../specificationExtensions/toSpecificationExtensionsV3.js");
|
|
6
|
+
const toServersV3 = ({ servers, context }) => {
|
|
7
|
+
return servers.map((server, index) => {
|
|
8
|
+
return context.trace(server.url ?? index, () => (0, exports.toServerV3)({ server, context }));
|
|
9
|
+
});
|
|
10
|
+
};
|
|
11
|
+
exports.toServersV3 = toServersV3;
|
|
12
|
+
const toOptionalServersV3 = ({ servers, context }) => {
|
|
13
|
+
if (!servers) {
|
|
14
|
+
return undefined;
|
|
15
|
+
}
|
|
16
|
+
return (0, exports.toServersV3)({ servers, context });
|
|
17
|
+
};
|
|
18
|
+
exports.toOptionalServersV3 = toOptionalServersV3;
|
|
19
|
+
const toServerV3 = ({ server, context }) => {
|
|
20
|
+
const { description, url, ...skipped } = server;
|
|
21
|
+
const extensionFields = (0, toSpecificationExtensionsV3_js_1.toSpecificationExtensionsV3)({
|
|
22
|
+
skipped,
|
|
23
|
+
context
|
|
24
|
+
});
|
|
25
|
+
const fields = {
|
|
26
|
+
description,
|
|
27
|
+
url,
|
|
28
|
+
extensionFields
|
|
29
|
+
};
|
|
30
|
+
return new Server_js_1.OasServer(fields);
|
|
31
|
+
};
|
|
32
|
+
exports.toServerV3 = toServerV3;
|