@scalar/openapi-parser 0.13.0 → 0.15.0
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/CHANGELOG.md +19 -0
- package/README.md +157 -0
- package/dist/index.d.ts +2 -0
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +4 -0
- package/dist/index.js.map +2 -2
- package/dist/types/index.d.ts +1 -0
- package/dist/types/index.d.ts.map +1 -1
- package/dist/utils/bundle/bundle.d.ts +279 -0
- package/dist/utils/bundle/bundle.d.ts.map +1 -0
- package/dist/utils/bundle/bundle.js +215 -0
- package/dist/utils/bundle/bundle.js.map +7 -0
- package/dist/utils/bundle/create-limiter.d.ts +21 -0
- package/dist/utils/bundle/create-limiter.d.ts.map +1 -0
- package/dist/utils/bundle/create-limiter.js +31 -0
- package/dist/utils/bundle/create-limiter.js.map +7 -0
- package/dist/utils/bundle/index.d.ts +4 -0
- package/dist/utils/bundle/index.d.ts.map +1 -0
- package/dist/utils/bundle/index.js +9 -0
- package/dist/utils/bundle/index.js.map +7 -0
- package/dist/utils/bundle/plugins/fetch-urls/index.d.ts +39 -0
- package/dist/utils/bundle/plugins/fetch-urls/index.d.ts.map +1 -0
- package/dist/utils/bundle/plugins/fetch-urls/index.js +41 -0
- package/dist/utils/bundle/plugins/fetch-urls/index.js.map +7 -0
- package/dist/utils/bundle/plugins/read-files/index.d.ts +29 -0
- package/dist/utils/bundle/plugins/read-files/index.d.ts.map +1 -0
- package/dist/utils/bundle/plugins/read-files/index.js +30 -0
- package/dist/utils/bundle/plugins/read-files/index.js.map +7 -0
- package/dist/utils/normalize.js +2 -2
- package/dist/utils/normalize.js.map +2 -2
- package/dist/utils/openapi/actions/details.d.ts +7 -0
- package/dist/utils/openapi/actions/details.d.ts.map +1 -0
- package/dist/utils/openapi/actions/details.js +11 -0
- package/dist/utils/openapi/actions/details.js.map +7 -0
- package/dist/utils/openapi/actions/files.d.ts +6 -0
- package/dist/utils/openapi/actions/files.d.ts.map +1 -0
- package/dist/utils/openapi/actions/files.js +9 -0
- package/dist/utils/openapi/actions/files.js.map +7 -0
- package/dist/utils/openapi/actions/get.d.ts +6 -0
- package/dist/utils/openapi/actions/get.d.ts.map +1 -0
- package/dist/utils/openapi/actions/get.js +11 -0
- package/dist/utils/openapi/actions/get.js.map +7 -0
- package/dist/utils/openapi/actions/toJson.d.ts +6 -0
- package/dist/utils/openapi/actions/toJson.d.ts.map +1 -0
- package/dist/utils/openapi/actions/toJson.js +11 -0
- package/dist/utils/openapi/actions/toJson.js.map +7 -0
- package/dist/utils/openapi/actions/toYaml.d.ts +6 -0
- package/dist/utils/openapi/actions/toYaml.d.ts.map +1 -0
- package/dist/utils/openapi/actions/toYaml.js +11 -0
- package/dist/utils/openapi/actions/toYaml.js.map +7 -0
- package/dist/utils/openapi/commands/dereferenceCommand.d.ts +27 -0
- package/dist/utils/openapi/commands/dereferenceCommand.d.ts.map +1 -0
- package/dist/utils/openapi/commands/dereferenceCommand.js +27 -0
- package/dist/utils/openapi/commands/dereferenceCommand.js.map +7 -0
- package/dist/utils/openapi/commands/filterCommand.d.ts +41 -0
- package/dist/utils/openapi/commands/filterCommand.d.ts.map +1 -0
- package/dist/utils/openapi/commands/filterCommand.js +26 -0
- package/dist/utils/openapi/commands/filterCommand.js.map +7 -0
- package/dist/utils/openapi/commands/loadCommand.d.ts +8321 -0
- package/dist/utils/openapi/commands/loadCommand.d.ts.map +1 -0
- package/dist/utils/openapi/commands/loadCommand.js +42 -0
- package/dist/utils/openapi/commands/loadCommand.js.map +7 -0
- package/dist/utils/openapi/commands/upgradeCommand.d.ts +3406 -0
- package/dist/utils/openapi/commands/upgradeCommand.d.ts.map +1 -0
- package/dist/utils/openapi/commands/upgradeCommand.js +29 -0
- package/dist/utils/openapi/commands/upgradeCommand.js.map +7 -0
- package/dist/utils/openapi/commands/validateCommand.d.ts +3451 -0
- package/dist/utils/openapi/commands/validateCommand.d.ts.map +1 -0
- package/dist/utils/openapi/commands/validateCommand.js +33 -0
- package/dist/utils/openapi/commands/validateCommand.js.map +7 -0
- package/dist/utils/openapi/openapi.d.ts +1272 -0
- package/dist/utils/openapi/openapi.d.ts.map +1 -0
- package/dist/utils/openapi/openapi.js +15 -0
- package/dist/utils/openapi/openapi.js.map +7 -0
- package/dist/utils/openapi/openapi.test-d.d.ts +2 -0
- package/dist/utils/openapi/openapi.test-d.d.ts.map +1 -0
- package/dist/utils/openapi/openapi.test-d.js +14 -0
- package/dist/utils/openapi/openapi.test-d.js.map +7 -0
- package/dist/utils/openapi/utils/queueTask.d.ts +6 -0
- package/dist/utils/openapi/utils/queueTask.d.ts.map +1 -0
- package/dist/utils/openapi/utils/queueTask.js +10 -0
- package/dist/utils/openapi/utils/queueTask.js.map +7 -0
- package/dist/utils/openapi/utils/workThroughQueue.d.ts +6 -0
- package/dist/utils/openapi/utils/workThroughQueue.d.ts.map +1 -0
- package/dist/utils/openapi/utils/workThroughQueue.js +52 -0
- package/dist/utils/openapi/utils/workThroughQueue.js.map +7 -0
- package/dist/utils/upgrade-from-two-to-three.js +45 -1
- package/dist/utils/upgrade-from-two-to-three.js.map +2 -2
- package/package.json +16 -6
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"files.d.ts","sourceRoot":"","sources":["../../../../src/utils/openapi/actions/files.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,UAAU,EAAE,KAAK,EAAE,IAAI,EAAE,MAAM,eAAe,CAAA;AAG5D;;GAEG;AACH,wBAAsB,KAAK,CAAC,CAAC,SAAS,IAAI,EAAE,EAAE,KAAK,EAAE,KAAK,CAAC,CAAC,CAAC,GAAG,OAAO,CAAC,UAAU,CAAC,CAIlF"}
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
{
|
|
2
|
+
"version": 3,
|
|
3
|
+
"sources": ["../../../../src/utils/openapi/actions/files.ts"],
|
|
4
|
+
"sourcesContent": ["import type { Filesystem, Queue, Task } from '@/types/index'\nimport { workThroughQueue } from '../utils/workThroughQueue'\n\n/**\n * Run the chained tasks and return just the filesystem\n */\nexport async function files<T extends Task[]>(queue: Queue<T>): Promise<Filesystem> {\n const { filesystem } = await workThroughQueue(queue)\n\n return filesystem\n}\n"],
|
|
5
|
+
"mappings": "AACA,SAAS,wBAAwB;AAKjC,eAAsB,MAAwB,OAAsC;AAClF,QAAM,EAAE,WAAW,IAAI,MAAM,iBAAiB,KAAK;AAEnD,SAAO;AACT;",
|
|
6
|
+
"names": []
|
|
7
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"get.d.ts","sourceRoot":"","sources":["../../../../src/utils/openapi/actions/get.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,YAAY,EAAE,KAAK,EAAE,IAAI,EAAE,MAAM,eAAe,CAAA;AAG9D;;GAEG;AACH,wBAAsB,GAAG,CAAC,CAAC,SAAS,IAAI,EAAE,EAAE,KAAK,EAAE,KAAK,CAAC,CAAC,CAAC,GAAG,OAAO,CAAC,YAAY,CAAC,CAAC,CAAC,CAAC,CAKrF"}
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
{
|
|
2
|
+
"version": 3,
|
|
3
|
+
"sources": ["../../../../src/utils/openapi/actions/get.ts"],
|
|
4
|
+
"sourcesContent": ["import type { CommandChain, Queue, Task } from '@/types/index'\nimport { workThroughQueue } from '../utils/workThroughQueue'\n\n/**\n * Run the chained tasks and return the results\n */\nexport async function get<T extends Task[]>(queue: Queue<T>): Promise<CommandChain<T>> {\n return {\n filesystem: [],\n ...(await workThroughQueue(queue)),\n }\n}\n"],
|
|
5
|
+
"mappings": "AACA,SAAS,wBAAwB;AAKjC,eAAsB,IAAsB,OAA2C;AACrF,SAAO;AAAA,IACL,YAAY,CAAC;AAAA,IACb,GAAI,MAAM,iBAAiB,KAAK;AAAA,EAClC;AACF;",
|
|
6
|
+
"names": []
|
|
7
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"toJson.d.ts","sourceRoot":"","sources":["../../../../src/utils/openapi/actions/toJson.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,KAAK,EAAE,IAAI,EAAE,MAAM,eAAe,CAAA;AAIhD;;GAEG;AACH,wBAAsB,MAAM,CAAC,CAAC,SAAS,IAAI,EAAE,EAAE,KAAK,EAAE,KAAK,CAAC,CAAC,CAAC,GAAG,OAAO,CAAC,MAAM,GAAG,SAAS,CAAC,CAI3F"}
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import { getEntrypoint } from "../../../utils/get-entrypoint.js";
|
|
2
|
+
import { toJson as toJsonUtility } from "../../../utils/to-json.js";
|
|
3
|
+
import { workThroughQueue } from "../utils/workThroughQueue.js";
|
|
4
|
+
async function toJson(queue) {
|
|
5
|
+
const { filesystem } = await workThroughQueue(queue);
|
|
6
|
+
return toJsonUtility(getEntrypoint(filesystem).specification);
|
|
7
|
+
}
|
|
8
|
+
export {
|
|
9
|
+
toJson
|
|
10
|
+
};
|
|
11
|
+
//# sourceMappingURL=toJson.js.map
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
{
|
|
2
|
+
"version": 3,
|
|
3
|
+
"sources": ["../../../../src/utils/openapi/actions/toJson.ts"],
|
|
4
|
+
"sourcesContent": ["import { getEntrypoint } from '@/utils/get-entrypoint'\nimport type { Queue, Task } from '@/types/index'\nimport { toJson as toJsonUtility } from '@/utils/to-json'\nimport { workThroughQueue } from '../utils/workThroughQueue'\n\n/**\n * Run the chained tasks and return the results\n */\nexport async function toJson<T extends Task[]>(queue: Queue<T>): Promise<string | undefined> {\n const { filesystem } = await workThroughQueue(queue)\n\n return toJsonUtility(getEntrypoint(filesystem).specification)\n}\n"],
|
|
5
|
+
"mappings": "AAAA,SAAS,qBAAqB;AAE9B,SAAS,UAAU,qBAAqB;AACxC,SAAS,wBAAwB;AAKjC,eAAsB,OAAyB,OAA8C;AAC3F,QAAM,EAAE,WAAW,IAAI,MAAM,iBAAiB,KAAK;AAEnD,SAAO,cAAc,cAAc,UAAU,EAAE,aAAa;AAC9D;",
|
|
6
|
+
"names": []
|
|
7
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"toYaml.d.ts","sourceRoot":"","sources":["../../../../src/utils/openapi/actions/toYaml.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,KAAK,EAAE,IAAI,EAAE,MAAM,eAAe,CAAA;AAIhD;;GAEG;AACH,wBAAsB,MAAM,CAAC,CAAC,SAAS,IAAI,EAAE,EAAE,KAAK,EAAE,KAAK,CAAC,CAAC,CAAC,GAAG,OAAO,CAAC,MAAM,CAAC,CAI/E"}
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import { getEntrypoint } from "../../../utils/get-entrypoint.js";
|
|
2
|
+
import { toYaml as toYamlUtility } from "../../../utils/to-yaml.js";
|
|
3
|
+
import { workThroughQueue } from "../utils/workThroughQueue.js";
|
|
4
|
+
async function toYaml(queue) {
|
|
5
|
+
const { filesystem } = await workThroughQueue(queue);
|
|
6
|
+
return toYamlUtility(getEntrypoint(filesystem).specification);
|
|
7
|
+
}
|
|
8
|
+
export {
|
|
9
|
+
toYaml
|
|
10
|
+
};
|
|
11
|
+
//# sourceMappingURL=toYaml.js.map
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
{
|
|
2
|
+
"version": 3,
|
|
3
|
+
"sources": ["../../../../src/utils/openapi/actions/toYaml.ts"],
|
|
4
|
+
"sourcesContent": ["import { getEntrypoint } from '@/utils/get-entrypoint'\nimport type { Queue, Task } from '@/types/index'\nimport { toYaml as toYamlUtility } from '@/utils/to-yaml'\nimport { workThroughQueue } from '../utils/workThroughQueue'\n\n/**\n * Run the chained tasks and return the results\n */\nexport async function toYaml<T extends Task[]>(queue: Queue<T>): Promise<string> {\n const { filesystem } = await workThroughQueue(queue)\n\n return toYamlUtility(getEntrypoint(filesystem).specification)\n}\n"],
|
|
5
|
+
"mappings": "AAAA,SAAS,qBAAqB;AAE9B,SAAS,UAAU,qBAAqB;AACxC,SAAS,wBAAwB;AAKjC,eAAsB,OAAyB,OAAkC;AAC/E,QAAM,EAAE,WAAW,IAAI,MAAM,iBAAiB,KAAK;AAEnD,SAAO,cAAc,cAAc,UAAU,EAAE,aAAa;AAC9D;",
|
|
6
|
+
"names": []
|
|
7
|
+
}
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
import type { DereferenceResult, Queue, Task } from '../../../types/index.js';
|
|
2
|
+
import type { DereferenceOptions } from '../../../utils/dereference.js';
|
|
3
|
+
declare global {
|
|
4
|
+
interface Commands {
|
|
5
|
+
dereference: {
|
|
6
|
+
task: {
|
|
7
|
+
name: 'dereference';
|
|
8
|
+
options?: DereferenceOptions;
|
|
9
|
+
};
|
|
10
|
+
result: DereferenceResult;
|
|
11
|
+
};
|
|
12
|
+
}
|
|
13
|
+
}
|
|
14
|
+
/**
|
|
15
|
+
* Dereference the given OpenAPI document
|
|
16
|
+
*/
|
|
17
|
+
export declare function dereferenceCommand<T extends Task[]>(previousQueue: Queue<T>, options?: DereferenceOptions): {
|
|
18
|
+
details: () => Promise<import("../../../types/index.js").DetailsResult>;
|
|
19
|
+
files: () => Promise<import("../../../types/index.js").Filesystem>;
|
|
20
|
+
get: () => Promise<import("../../../types/index.js").CommandChain<[...T, {
|
|
21
|
+
name: "dereference";
|
|
22
|
+
options?: DereferenceOptions;
|
|
23
|
+
}]>>;
|
|
24
|
+
toJson: () => Promise<string>;
|
|
25
|
+
toYaml: () => Promise<string>;
|
|
26
|
+
};
|
|
27
|
+
//# sourceMappingURL=dereferenceCommand.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"dereferenceCommand.d.ts","sourceRoot":"","sources":["../../../../src/utils/openapi/commands/dereferenceCommand.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,iBAAiB,EAAE,KAAK,EAAE,IAAI,EAAE,MAAM,eAAe,CAAA;AACnE,OAAO,KAAK,EAAE,kBAAkB,EAAE,MAAM,qBAAqB,CAAA;AAQ7D,OAAO,CAAC,MAAM,CAAC;IACb,UAAU,QAAQ;QAChB,WAAW,EAAE;YACX,IAAI,EAAE;gBACJ,IAAI,EAAE,aAAa,CAAA;gBACnB,OAAO,CAAC,EAAE,kBAAkB,CAAA;aAC7B,CAAA;YACD,MAAM,EAAE,iBAAiB,CAAA;SAC1B,CAAA;KACF;CACF;AAED;;GAEG;AACH,wBAAgB,kBAAkB,CAAC,CAAC,SAAS,IAAI,EAAE,EAAE,aAAa,EAAE,KAAK,CAAC,CAAC,CAAC,EAAE,OAAO,CAAC,EAAE,kBAAkB;;;;cAX5F,aAAa;kBACT,kBAAkB;;;;EA4BnC"}
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
import { details } from "../actions/details.js";
|
|
2
|
+
import { files } from "../actions/files.js";
|
|
3
|
+
import { get } from "../actions/get.js";
|
|
4
|
+
import { toJson } from "../actions/toJson.js";
|
|
5
|
+
import { toYaml } from "../actions/toYaml.js";
|
|
6
|
+
import { queueTask } from "../utils/queueTask.js";
|
|
7
|
+
function dereferenceCommand(previousQueue, options) {
|
|
8
|
+
const task = {
|
|
9
|
+
name: "dereference",
|
|
10
|
+
options: {
|
|
11
|
+
throwOnError: previousQueue.options?.throwOnError,
|
|
12
|
+
...options ?? {}
|
|
13
|
+
}
|
|
14
|
+
};
|
|
15
|
+
const queue = queueTask(previousQueue, task);
|
|
16
|
+
return {
|
|
17
|
+
details: () => details(queue),
|
|
18
|
+
files: () => files(queue),
|
|
19
|
+
get: () => get(queue),
|
|
20
|
+
toJson: () => toJson(queue),
|
|
21
|
+
toYaml: () => toYaml(queue)
|
|
22
|
+
};
|
|
23
|
+
}
|
|
24
|
+
export {
|
|
25
|
+
dereferenceCommand
|
|
26
|
+
};
|
|
27
|
+
//# sourceMappingURL=dereferenceCommand.js.map
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
{
|
|
2
|
+
"version": 3,
|
|
3
|
+
"sources": ["../../../../src/utils/openapi/commands/dereferenceCommand.ts"],
|
|
4
|
+
"sourcesContent": ["import type { DereferenceResult, Queue, Task } from '@/types/index'\nimport type { DereferenceOptions } from '@/utils/dereference'\nimport { details } from '../actions/details'\nimport { files } from '../actions/files'\nimport { get } from '../actions/get'\nimport { toJson } from '../actions/toJson'\nimport { toYaml } from '../actions/toYaml'\nimport { queueTask } from '../utils/queueTask'\n\ndeclare global {\n interface Commands {\n dereference: {\n task: {\n name: 'dereference'\n options?: DereferenceOptions\n }\n result: DereferenceResult\n }\n }\n}\n\n/**\n * Dereference the given OpenAPI document\n */\nexport function dereferenceCommand<T extends Task[]>(previousQueue: Queue<T>, options?: DereferenceOptions) {\n const task: Task = {\n name: 'dereference',\n options: {\n throwOnError: previousQueue.options?.throwOnError,\n ...(options ?? {}),\n },\n }\n\n const queue = queueTask<[...T, typeof task]>(previousQueue, task as Task)\n\n return {\n details: () => details(queue),\n files: () => files(queue),\n get: () => get(queue),\n toJson: () => toJson(queue),\n toYaml: () => toYaml(queue),\n }\n}\n"],
|
|
5
|
+
"mappings": "AAEA,SAAS,eAAe;AACxB,SAAS,aAAa;AACtB,SAAS,WAAW;AACpB,SAAS,cAAc;AACvB,SAAS,cAAc;AACvB,SAAS,iBAAiB;AAiBnB,SAAS,mBAAqC,eAAyB,SAA8B;AAC1G,QAAM,OAAa;AAAA,IACjB,MAAM;AAAA,IACN,SAAS;AAAA,MACP,cAAc,cAAc,SAAS;AAAA,MACrC,GAAI,WAAW,CAAC;AAAA,IAClB;AAAA,EACF;AAEA,QAAM,QAAQ,UAA+B,eAAe,IAAY;AAExE,SAAO;AAAA,IACL,SAAS,MAAM,QAAQ,KAAK;AAAA,IAC5B,OAAO,MAAM,MAAM,KAAK;AAAA,IACxB,KAAK,MAAM,IAAI,KAAK;AAAA,IACpB,QAAQ,MAAM,OAAO,KAAK;AAAA,IAC1B,QAAQ,MAAM,OAAO,KAAK;AAAA,EAC5B;AACF;",
|
|
6
|
+
"names": []
|
|
7
|
+
}
|
|
@@ -0,0 +1,41 @@
|
|
|
1
|
+
import type { FilterResult, Queue, Task } from '../../../types/index.js';
|
|
2
|
+
import type { DereferenceOptions } from '../../../utils/dereference.js';
|
|
3
|
+
import type { FilterCallback } from '../../../utils/filter.js';
|
|
4
|
+
declare global {
|
|
5
|
+
interface Commands {
|
|
6
|
+
filter: {
|
|
7
|
+
task: {
|
|
8
|
+
name: 'filter';
|
|
9
|
+
options?: FilterCallback;
|
|
10
|
+
};
|
|
11
|
+
result: FilterResult;
|
|
12
|
+
};
|
|
13
|
+
}
|
|
14
|
+
}
|
|
15
|
+
/**
|
|
16
|
+
* Filter the given OpenAPI document
|
|
17
|
+
*/
|
|
18
|
+
export declare function filterCommand<T extends Task[]>(previousQueue: Queue<T>, options?: FilterCallback): {
|
|
19
|
+
dereference: (dereferenceOptions?: DereferenceOptions) => {
|
|
20
|
+
details: () => Promise<import("../../../types/index.js").DetailsResult>;
|
|
21
|
+
files: () => Promise<import("../../../types/index.js").Filesystem>;
|
|
22
|
+
get: () => Promise<import("../../../types/index.js").CommandChain<[...T, {
|
|
23
|
+
name: "filter";
|
|
24
|
+
options?: FilterCallback;
|
|
25
|
+
}, {
|
|
26
|
+
name: "dereference";
|
|
27
|
+
options?: DereferenceOptions;
|
|
28
|
+
}]>>;
|
|
29
|
+
toJson: () => Promise<string>;
|
|
30
|
+
toYaml: () => Promise<string>;
|
|
31
|
+
};
|
|
32
|
+
details: () => Promise<import("../../../types/index.js").DetailsResult>;
|
|
33
|
+
files: () => Promise<import("../../../types/index.js").Filesystem>;
|
|
34
|
+
get: () => Promise<import("../../../types/index.js").CommandChain<[...T, {
|
|
35
|
+
name: "filter";
|
|
36
|
+
options?: FilterCallback;
|
|
37
|
+
}]>>;
|
|
38
|
+
toJson: () => Promise<string>;
|
|
39
|
+
toYaml: () => Promise<string>;
|
|
40
|
+
};
|
|
41
|
+
//# sourceMappingURL=filterCommand.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"filterCommand.d.ts","sourceRoot":"","sources":["../../../../src/utils/openapi/commands/filterCommand.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,YAAY,EAAE,KAAK,EAAE,IAAI,EAAE,MAAM,eAAe,CAAA;AAC9D,OAAO,KAAK,EAAE,kBAAkB,EAAE,MAAM,qBAAqB,CAAA;AAC7D,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,gBAAgB,CAAA;AASpD,OAAO,CAAC,MAAM,CAAC;IACb,UAAU,QAAQ;QAChB,MAAM,EAAE;YACN,IAAI,EAAE;gBACJ,IAAI,EAAE,QAAQ,CAAA;gBACd,OAAO,CAAC,EAAE,cAAc,CAAA;aACzB,CAAA;YACD,MAAM,EAAE,YAAY,CAAA;SACrB,CAAA;KACF;CACF;AAED;;GAEG;AACH,wBAAgB,aAAa,CAAC,CAAC,SAAS,IAAI,EAAE,EAAE,aAAa,EAAE,KAAK,CAAC,CAAC,CAAC,EAAE,OAAO,CAAC,EAAE,cAAc;uCAS1D,kBAAkB;;;;kBApB3C,QAAQ;sBACJ,cAAc;;;;;;;;;;;cADlB,QAAQ;kBACJ,cAAc;;;;EA0B/B"}
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
import { details } from "../actions/details.js";
|
|
2
|
+
import { files } from "../actions/files.js";
|
|
3
|
+
import { get } from "../actions/get.js";
|
|
4
|
+
import { toJson } from "../actions/toJson.js";
|
|
5
|
+
import { toYaml } from "../actions/toYaml.js";
|
|
6
|
+
import { queueTask } from "../utils/queueTask.js";
|
|
7
|
+
import { dereferenceCommand } from "./dereferenceCommand.js";
|
|
8
|
+
function filterCommand(previousQueue, options) {
|
|
9
|
+
const task = {
|
|
10
|
+
name: "filter",
|
|
11
|
+
options
|
|
12
|
+
};
|
|
13
|
+
const queue = queueTask(previousQueue, task);
|
|
14
|
+
return {
|
|
15
|
+
dereference: (dereferenceOptions) => dereferenceCommand(queue, dereferenceOptions),
|
|
16
|
+
details: () => details(queue),
|
|
17
|
+
files: () => files(queue),
|
|
18
|
+
get: () => get(queue),
|
|
19
|
+
toJson: () => toJson(queue),
|
|
20
|
+
toYaml: () => toYaml(queue)
|
|
21
|
+
};
|
|
22
|
+
}
|
|
23
|
+
export {
|
|
24
|
+
filterCommand
|
|
25
|
+
};
|
|
26
|
+
//# sourceMappingURL=filterCommand.js.map
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
{
|
|
2
|
+
"version": 3,
|
|
3
|
+
"sources": ["../../../../src/utils/openapi/commands/filterCommand.ts"],
|
|
4
|
+
"sourcesContent": ["import type { FilterResult, Queue, Task } from '@/types/index'\nimport type { DereferenceOptions } from '@/utils/dereference'\nimport type { FilterCallback } from '@/utils/filter'\nimport { details } from '../actions/details'\nimport { files } from '../actions/files'\nimport { get } from '../actions/get'\nimport { toJson } from '../actions/toJson'\nimport { toYaml } from '../actions/toYaml'\nimport { queueTask } from '../utils/queueTask'\nimport { dereferenceCommand } from './dereferenceCommand'\n\ndeclare global {\n interface Commands {\n filter: {\n task: {\n name: 'filter'\n options?: FilterCallback\n }\n result: FilterResult\n }\n }\n}\n\n/**\n * Filter the given OpenAPI document\n */\nexport function filterCommand<T extends Task[]>(previousQueue: Queue<T>, options?: FilterCallback) {\n const task: Task = {\n name: 'filter',\n options,\n }\n\n const queue = queueTask<[...T, typeof task]>(previousQueue, task as Task)\n\n return {\n dereference: (dereferenceOptions?: DereferenceOptions) => dereferenceCommand(queue, dereferenceOptions),\n details: () => details(queue),\n files: () => files(queue),\n get: () => get(queue),\n toJson: () => toJson(queue),\n toYaml: () => toYaml(queue),\n }\n}\n"],
|
|
5
|
+
"mappings": "AAGA,SAAS,eAAe;AACxB,SAAS,aAAa;AACtB,SAAS,WAAW;AACpB,SAAS,cAAc;AACvB,SAAS,cAAc;AACvB,SAAS,iBAAiB;AAC1B,SAAS,0BAA0B;AAiB5B,SAAS,cAAgC,eAAyB,SAA0B;AACjG,QAAM,OAAa;AAAA,IACjB,MAAM;AAAA,IACN;AAAA,EACF;AAEA,QAAM,QAAQ,UAA+B,eAAe,IAAY;AAExE,SAAO;AAAA,IACL,aAAa,CAAC,uBAA4C,mBAAmB,OAAO,kBAAkB;AAAA,IACtG,SAAS,MAAM,QAAQ,KAAK;AAAA,IAC5B,OAAO,MAAM,MAAM,KAAK;AAAA,IACxB,KAAK,MAAM,IAAI,KAAK;AAAA,IACpB,QAAQ,MAAM,OAAO,KAAK;AAAA,IAC1B,QAAQ,MAAM,OAAO,KAAK;AAAA,EAC5B;AACF;",
|
|
6
|
+
"names": []
|
|
7
|
+
}
|