@scalar/openapi-parser 0.7.2 → 0.8.2
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 +26 -0
- package/LICENSE +1 -1
- package/README.md +193 -24
- package/dist/configuration/index.d.ts +2 -1
- package/dist/configuration/index.d.ts.map +1 -1
- package/dist/configuration/index.js +1 -1
- package/dist/index.js +1 -1
- package/dist/lib/Validator/Validator.d.ts +1 -1
- package/dist/lib/Validator/Validator.d.ts.map +1 -1
- package/dist/lib/Validator/Validator.js +1 -1
- package/dist/polyfills/path.d.ts +3 -3
- package/dist/polyfills/path.d.ts.map +1 -1
- package/dist/polyfills/path.js +1 -1
- package/dist/types/index.d.ts +78 -9
- package/dist/types/index.d.ts.map +1 -1
- package/dist/utils/betterAjvErrors/helpers.d.ts.map +1 -1
- package/dist/utils/betterAjvErrors/helpers.js +1 -1
- package/dist/utils/dereference.d.ts +3 -2
- package/dist/utils/dereference.d.ts.map +1 -1
- package/dist/utils/filter.d.ts +3 -2
- package/dist/utils/filter.d.ts.map +1 -1
- package/dist/utils/getEntrypoint.d.ts +2 -2
- package/dist/utils/getEntrypoint.d.ts.map +1 -1
- package/dist/utils/getEntrypoint.js +1 -1
- package/dist/utils/getListOfReferences.d.ts +1 -1
- package/dist/utils/getListOfReferences.d.ts.map +1 -1
- package/dist/utils/index.d.ts +1 -1
- package/dist/utils/isFilesystem.js +1 -1
- package/dist/utils/load/load.d.ts +13 -3
- package/dist/utils/load/load.d.ts.map +1 -1
- package/dist/utils/load/load.js +1 -1
- package/dist/utils/load/plugins/fetchUrls.d.ts +1 -1
- package/dist/utils/load/plugins/fetchUrls.d.ts.map +1 -1
- package/dist/utils/load/plugins/readFiles.d.ts +1 -1
- package/dist/utils/load/plugins/readFiles.d.ts.map +1 -1
- package/dist/utils/normalize.d.ts +1 -1
- package/dist/utils/normalize.d.ts.map +1 -1
- 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 +1 -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 +1 -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 +1 -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 +1 -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 +1 -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 +1 -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 +1 -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 +1 -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 +1 -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 +1 -0
- package/dist/utils/openapi/index.d.ts +2 -0
- package/dist/utils/openapi/index.d.ts.map +1 -0
- package/dist/utils/openapi/openapi.d.ts +1270 -0
- package/dist/utils/openapi/openapi.d.ts.map +1 -0
- package/dist/utils/openapi/openapi.js +1 -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/utils/queueTask.d.ts +6 -0
- package/dist/utils/openapi/utils/queueTask.d.ts.map +1 -0
- package/dist/utils/openapi/utils/queueTask.js +1 -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 +1 -0
- package/dist/utils/resolveReferences.d.ts +1 -1
- package/dist/utils/resolveReferences.d.ts.map +1 -1
- package/dist/utils/toJson.d.ts +1 -1
- package/dist/utils/toJson.d.ts.map +1 -1
- package/dist/utils/toYaml.d.ts +1 -1
- package/dist/utils/toYaml.d.ts.map +1 -1
- package/dist/utils/traverse.d.ts +1 -1
- package/dist/utils/traverse.d.ts.map +1 -1
- package/dist/utils/upgrade.d.ts +2 -1
- package/dist/utils/upgrade.d.ts.map +1 -1
- package/dist/utils/upgrade.js +1 -1
- package/dist/utils/upgrade.test-d.d.ts +2 -0
- package/dist/utils/upgrade.test-d.d.ts.map +1 -0
- package/dist/utils/upgradeFromThreeToThreeOne.d.ts +1 -1
- package/dist/utils/upgradeFromThreeToThreeOne.d.ts.map +1 -1
- package/dist/utils/upgradeFromTwoToThree.d.ts +1 -1
- package/dist/utils/upgradeFromTwoToThree.d.ts.map +1 -1
- package/dist/utils/upgradeFromTwoToThree.js +1 -1
- package/dist/utils/validate.d.ts +2 -1
- package/dist/utils/validate.d.ts.map +1 -1
- package/package.json +37 -33
- package/dist/types/openapi-types.d.ts +0 -746
- package/dist/types/openapi-types.d.ts.map +0 -1
- package/dist/utils/openapi.d.ts +0 -183
- package/dist/utils/openapi.d.ts.map +0 -1
- package/dist/utils/openapi.js +0 -1
- package/dist/utils/workThroughQueue.d.ts +0 -11
- package/dist/utils/workThroughQueue.d.ts.map +0 -1
- package/dist/utils/workThroughQueue.js +0 -1
package/dist/utils/index.d.ts
CHANGED
|
@@ -12,7 +12,7 @@ export * from './isYaml.js';
|
|
|
12
12
|
export * from './load';
|
|
13
13
|
export * from './load/load.js';
|
|
14
14
|
export * from './normalize.js';
|
|
15
|
-
export * from './openapi
|
|
15
|
+
export * from './openapi';
|
|
16
16
|
export * from './resolveReferences.js';
|
|
17
17
|
export * from './toJson.js';
|
|
18
18
|
export * from './toYaml.js';
|
|
@@ -1 +1 @@
|
|
|
1
|
-
function r(r){return void 0!==
|
|
1
|
+
function r(r){return void 0!==r&&Array.isArray(r)&&r.length>0&&r.some((r=>!0===r.isEntrypoint))}export{r as isFilesystem};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import type { Filesystem, LoadResult } from '../../types';
|
|
1
|
+
import type { AnyApiDefinitionFormat, Filesystem, LoadResult, ThrowOnErrorOption } from '../../types';
|
|
2
2
|
export type LoadPlugin = {
|
|
3
3
|
check: (value?: any) => boolean;
|
|
4
4
|
get: (value: any) => any;
|
|
@@ -6,9 +6,19 @@ export type LoadPlugin = {
|
|
|
6
6
|
getDir?: (value: any) => string;
|
|
7
7
|
getFilename?: (value: any) => string;
|
|
8
8
|
};
|
|
9
|
-
export
|
|
9
|
+
export type LoadOptions = {
|
|
10
10
|
plugins?: LoadPlugin[];
|
|
11
11
|
filename?: string;
|
|
12
12
|
filesystem?: Filesystem;
|
|
13
|
-
}
|
|
13
|
+
} & ThrowOnErrorOption;
|
|
14
|
+
/**
|
|
15
|
+
* Loads an OpenAPI document, including any external references.
|
|
16
|
+
*
|
|
17
|
+
* This function handles loading content from various sources, normalizes the content,
|
|
18
|
+
* and recursively loads any external references found within the definition.
|
|
19
|
+
*
|
|
20
|
+
* It builds a filesystem representation of all loaded content and collects any errors
|
|
21
|
+
* encountered during the process.
|
|
22
|
+
*/
|
|
23
|
+
export declare function load(value: AnyApiDefinitionFormat, options?: LoadOptions): Promise<LoadResult>;
|
|
14
24
|
//# sourceMappingURL=load.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"load.d.ts","sourceRoot":"","sources":["../../../src/utils/load/load.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"load.d.ts","sourceRoot":"","sources":["../../../src/utils/load/load.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EACV,sBAAsB,EAGtB,UAAU,EACV,UAAU,EACV,kBAAkB,EACnB,MAAM,aAAa,CAAA;AAMpB,MAAM,MAAM,UAAU,GAAG;IACvB,KAAK,EAAE,CAAC,KAAK,CAAC,EAAE,GAAG,KAAK,OAAO,CAAA;IAC/B,GAAG,EAAE,CAAC,KAAK,EAAE,GAAG,KAAK,GAAG,CAAA;IACxB,WAAW,CAAC,EAAE,CAAC,KAAK,EAAE,GAAG,EAAE,SAAS,EAAE,MAAM,KAAK,MAAM,CAAA;IACvD,MAAM,CAAC,EAAE,CAAC,KAAK,EAAE,GAAG,KAAK,MAAM,CAAA;IAC/B,WAAW,CAAC,EAAE,CAAC,KAAK,EAAE,GAAG,KAAK,MAAM,CAAA;CACrC,CAAA;AAED,MAAM,MAAM,WAAW,GAAG;IACxB,OAAO,CAAC,EAAE,UAAU,EAAE,CAAA;IACtB,QAAQ,CAAC,EAAE,MAAM,CAAA;IACjB,UAAU,CAAC,EAAE,UAAU,CAAA;CACxB,GAAG,kBAAkB,CAAA;AAEtB;;;;;;;;GAQG;AACH,wBAAsB,IAAI,CACxB,KAAK,EAAE,sBAAsB,EAC7B,OAAO,CAAC,EAAE,WAAW,GACpB,OAAO,CAAC,UAAU,CAAC,CAqIrB"}
|
package/dist/utils/load/load.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
import{
|
|
1
|
+
import{ERRORS as e}from"../../configuration/index.js";import{getEntrypoint as i}from"../getEntrypoint.js";import{getListOfReferences as r}from"../getListOfReferences.js";import{makeFilesystem as s}from"../makeFilesystem.js";import{normalize as t}from"../normalize.js";async function n(o,f){const c=[];if(f?.filesystem?.find((e=>e.filename===o)))return{specification:i(f.filesystem)?.specification,filesystem:f.filesystem,errors:c};const l=f?.plugins?.find((e=>e.check(o)));let a;if(l)try{a=t(await l.get(o))}catch(i){if(f?.throwOnError)throw new Error(e.EXTERNAL_REFERENCE_NOT_FOUND.replace("%s",o));return c.push({code:"EXTERNAL_REFERENCE_NOT_FOUND",message:e.EXTERNAL_REFERENCE_NOT_FOUND.replace("%s",o)}),{specification:null,filesystem:[],errors:c}}else a=t(o);if(void 0===a){if(f?.throwOnError)throw new Error("No content to load");return c.push({code:"NO_CONTENT",message:e.NO_CONTENT}),{specification:null,filesystem:[],errors:c}}let m=s(a,{filename:f?.filename??null});const E=(f?.filename?m.find((e=>e.filename===f?.filename)):i(m)).references??r(a);if(0===E.length)return{specification:i(m)?.specification,filesystem:m,errors:c};for(const e of E){const i=f?.plugins?.find((i=>i.check(e)));if(!i)continue;const r=i.check(e)&&i.resolvePath?i.resolvePath(o,e):e;if(m.find((i=>i.filename===e)))continue;const{filesystem:s,errors:t}=await n(r,{...f,filename:e});c.push(...t),m=[...m,...s.map((e=>({...e,isEntrypoint:!1})))]}return{specification:i(m)?.specification,filesystem:m,errors:c}}export{n as load};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"fetchUrls.d.ts","sourceRoot":"","sources":["../../../../src/utils/load/plugins/fetchUrls.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAE,MAAM,SAAS,CAAA;
|
|
1
|
+
{"version":3,"file":"fetchUrls.d.ts","sourceRoot":"","sources":["../../../../src/utils/load/plugins/fetchUrls.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,SAAS,CAAA;AAEzC,eAAO,MAAM,6BAA6B;;CAEzC,CAAA;AAED,eAAO,MAAM,SAAS,EAAE,CAAC,mBAAmB,CAAC,EAAE;IAC7C;;OAEG;IACH,KAAK,CAAC,EAAE,MAAM,GAAG,KAAK,CAAA;IACtB;;OAEG;IACH,KAAK,CAAC,EAAE,CAAC,GAAG,EAAE,MAAM,KAAK,OAAO,CAAC,QAAQ,CAAC,CAAA;CAC3C,KAAK,UAiDL,CAAA"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"readFiles.d.ts","sourceRoot":"","sources":["../../../../src/utils/load/plugins/readFiles.ts"],"names":[],"mappings":"AAMA,OAAO,EAAE,UAAU,EAAE,MAAM,SAAS,CAAA;
|
|
1
|
+
{"version":3,"file":"readFiles.d.ts","sourceRoot":"","sources":["../../../../src/utils/load/plugins/readFiles.ts"],"names":[],"mappings":"AAMA,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,SAAS,CAAA;AAEzC,eAAO,MAAM,SAAS,EAAE,MAAM,UAoD7B,CAAA"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"normalize.d.ts","sourceRoot":"","sources":["../../src/utils/normalize.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,SAAS,EAAE,UAAU,EAAE,MAAM,UAAU,CAAA;
|
|
1
|
+
{"version":3,"file":"normalize.d.ts","sourceRoot":"","sources":["../../src/utils/normalize.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,SAAS,EAAE,UAAU,EAAE,MAAM,UAAU,CAAA;AAGrD;;;GAGG;AACH,wBAAgB,SAAS,CACvB,aAAa,EAAE,MAAM,GAAG,SAAS,GAAG,UAAU,GAC7C,SAAS,GAAG,UAAU,CAgBxB"}
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import type { Queue, Task } from '../../../types';
|
|
2
|
+
import { details as detailsUtility } from '../../details.js';
|
|
3
|
+
/**
|
|
4
|
+
* Run the chained tasks and return just some basic information about the OpenAPI document
|
|
5
|
+
*/
|
|
6
|
+
export declare function details<T extends Task[]>(queue: Queue<T>): Promise<ReturnType<typeof detailsUtility>>;
|
|
7
|
+
//# sourceMappingURL=details.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"details.d.ts","sourceRoot":"","sources":["../../../../src/utils/openapi/actions/details.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,KAAK,EAAE,IAAI,EAAE,MAAM,gBAAgB,CAAA;AACjD,OAAO,EAAE,OAAO,IAAI,cAAc,EAAE,MAAM,eAAe,CAAA;AAIzD;;GAEG;AACH,wBAAsB,OAAO,CAAC,CAAC,SAAS,IAAI,EAAE,EAC5C,KAAK,EAAE,KAAK,CAAC,CAAC,CAAC,GACd,OAAO,CAAC,UAAU,CAAC,OAAO,cAAc,CAAC,CAAC,CAI5C"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{details as t}from"../../details.js";import{getEntrypoint as i}from"../../getEntrypoint.js";import{workThroughQueue as o}from"../utils/workThroughQueue.js";async function r(r){const{filesystem:s}=await o(r);return t(i(s).specification)}export{r as details};
|
|
@@ -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,gBAAgB,CAAA;AAG7D;;GAEG;AACH,wBAAsB,KAAK,CAAC,CAAC,SAAS,IAAI,EAAE,EAC1C,KAAK,EAAE,KAAK,CAAC,CAAC,CAAC,GACd,OAAO,CAAC,UAAU,CAAC,CAIrB"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{workThroughQueue as t}from"../utils/workThroughQueue.js";async function o(o){const{filesystem:r}=await t(o);return r}export{o as files};
|
|
@@ -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,gBAAgB,CAAA;AAG/D;;GAEG;AACH,wBAAsB,GAAG,CAAC,CAAC,SAAS,IAAI,EAAE,EACxC,KAAK,EAAE,KAAK,CAAC,CAAC,CAAC,GACd,OAAO,CAAC,YAAY,CAAC,CAAC,CAAC,CAAC,CAK1B"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{workThroughQueue as r}from"../utils/workThroughQueue.js";async function t(t){return{filesystem:[],...await r(t)}}export{t as get};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"toJson.d.ts","sourceRoot":"","sources":["../../../../src/utils/openapi/actions/toJson.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,KAAK,EAAE,IAAI,EAAE,MAAM,gBAAgB,CAAA;AAKjD;;GAEG;AACH,wBAAsB,MAAM,CAAC,CAAC,SAAS,IAAI,EAAE,EAC3C,KAAK,EAAE,KAAK,CAAC,CAAC,CAAC,GACd,OAAO,CAAC,MAAM,GAAG,SAAS,CAAC,CAI7B"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{getEntrypoint as o}from"../../getEntrypoint.js";import{toJson as t}from"../../toJson.js";import{workThroughQueue as r}from"../utils/workThroughQueue.js";async function s(s){const{filesystem:i}=await r(s);return t(o(i).specification)}export{s as toJson};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"toYaml.d.ts","sourceRoot":"","sources":["../../../../src/utils/openapi/actions/toYaml.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,KAAK,EAAE,IAAI,EAAE,MAAM,gBAAgB,CAAA;AAKjD;;GAEG;AACH,wBAAsB,MAAM,CAAC,CAAC,SAAS,IAAI,EAAE,EAC3C,KAAK,EAAE,KAAK,CAAC,CAAC,CAAC,GACd,OAAO,CAAC,MAAM,CAAC,CAIjB"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{getEntrypoint as t}from"../../getEntrypoint.js";import{toYaml as o}from"../../toYaml.js";import{workThroughQueue as r}from"../utils/workThroughQueue.js";async function i(i){const{filesystem:s}=await r(i);return o(t(s).specification)}export{i as toYaml};
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
import type { DereferenceResult, Queue, Task } from '../../../types';
|
|
2
|
+
import type { DereferenceOptions } from '../../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").DetailsResult>;
|
|
19
|
+
files: () => Promise<import("../../../types").Filesystem>;
|
|
20
|
+
get: () => Promise<import("../../../types").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,gBAAgB,CAAA;AACpE,OAAO,KAAK,EAAE,kBAAkB,EAAE,MAAM,mBAAmB,CAAA;AAQ3D,OAAO,CAAC,MAAM,CAAC;IAEb,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,EACjD,aAAa,EAAE,KAAK,CAAC,CAAC,CAAC,EACvB,OAAO,CAAC,EAAE,kBAAkB;;;;cAbhB,aAAa;kBACT,kBAAkB;;;;EA+BnC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{details as o}from"../actions/details.js";import{files as t}from"../actions/files.js";import{get as r}from"../actions/get.js";import{toJson as s}from"../actions/toJson.js";import{toYaml as i}from"../actions/toYaml.js";import{queueTask as n}from"../utils/queueTask.js";function e(e,m){const a={name:"dereference",options:{throwOnError:e.options?.throwOnError,...m??{}}},f=n(e,a);return{details:()=>o(f),files:()=>t(f),get:()=>r(f),toJson:()=>s(f),toYaml:()=>i(f)}}export{e as dereferenceCommand};
|
|
@@ -0,0 +1,41 @@
|
|
|
1
|
+
import type { FilterResult, Queue, Task } from '../../../types';
|
|
2
|
+
import type { DereferenceOptions } from '../../dereference.js';
|
|
3
|
+
import type { FilterCallback } from '../../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").DetailsResult>;
|
|
21
|
+
files: () => Promise<import("../../../types").Filesystem>;
|
|
22
|
+
get: () => Promise<import("../../../types").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").DetailsResult>;
|
|
33
|
+
files: () => Promise<import("../../../types").Filesystem>;
|
|
34
|
+
get: () => Promise<import("../../../types").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,gBAAgB,CAAA;AAC/D,OAAO,KAAK,EAAE,kBAAkB,EAAE,MAAM,mBAAmB,CAAA;AAC3D,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,cAAc,CAAA;AASlD,OAAO,CAAC,MAAM,CAAC;IAEb,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,EAC5C,aAAa,EAAE,KAAK,CAAC,CAAC,CAAC,EACvB,OAAO,CAAC,EAAE,cAAc;uCAUa,kBAAkB;;;;kBAvB3C,QAAQ;sBACJ,cAAc;;;;;;;;;;;cADlB,QAAQ;kBACJ,cAAc;;;;EA8B/B"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{details as o}from"../actions/details.js";import{files as t}from"../actions/files.js";import{get as e}from"../actions/get.js";import{toJson as r}from"../actions/toJson.js";import{toYaml as s}from"../actions/toYaml.js";import{queueTask as i}from"../utils/queueTask.js";import{dereferenceCommand as m}from"./dereferenceCommand.js";function n(n,f){const a=i(n,{name:"filter",options:f});return{dereference:o=>m(a,o),details:()=>o(a),files:()=>t(a),get:()=>e(a),toJson:()=>r(a),toYaml:()=>s(a)}}export{n as filterCommand};
|