@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.
Files changed (109) hide show
  1. package/CHANGELOG.md +26 -0
  2. package/LICENSE +1 -1
  3. package/README.md +193 -24
  4. package/dist/configuration/index.d.ts +2 -1
  5. package/dist/configuration/index.d.ts.map +1 -1
  6. package/dist/configuration/index.js +1 -1
  7. package/dist/index.js +1 -1
  8. package/dist/lib/Validator/Validator.d.ts +1 -1
  9. package/dist/lib/Validator/Validator.d.ts.map +1 -1
  10. package/dist/lib/Validator/Validator.js +1 -1
  11. package/dist/polyfills/path.d.ts +3 -3
  12. package/dist/polyfills/path.d.ts.map +1 -1
  13. package/dist/polyfills/path.js +1 -1
  14. package/dist/types/index.d.ts +78 -9
  15. package/dist/types/index.d.ts.map +1 -1
  16. package/dist/utils/betterAjvErrors/helpers.d.ts.map +1 -1
  17. package/dist/utils/betterAjvErrors/helpers.js +1 -1
  18. package/dist/utils/dereference.d.ts +3 -2
  19. package/dist/utils/dereference.d.ts.map +1 -1
  20. package/dist/utils/filter.d.ts +3 -2
  21. package/dist/utils/filter.d.ts.map +1 -1
  22. package/dist/utils/getEntrypoint.d.ts +2 -2
  23. package/dist/utils/getEntrypoint.d.ts.map +1 -1
  24. package/dist/utils/getEntrypoint.js +1 -1
  25. package/dist/utils/getListOfReferences.d.ts +1 -1
  26. package/dist/utils/getListOfReferences.d.ts.map +1 -1
  27. package/dist/utils/index.d.ts +1 -1
  28. package/dist/utils/isFilesystem.js +1 -1
  29. package/dist/utils/load/load.d.ts +13 -3
  30. package/dist/utils/load/load.d.ts.map +1 -1
  31. package/dist/utils/load/load.js +1 -1
  32. package/dist/utils/load/plugins/fetchUrls.d.ts +1 -1
  33. package/dist/utils/load/plugins/fetchUrls.d.ts.map +1 -1
  34. package/dist/utils/load/plugins/readFiles.d.ts +1 -1
  35. package/dist/utils/load/plugins/readFiles.d.ts.map +1 -1
  36. package/dist/utils/normalize.d.ts +1 -1
  37. package/dist/utils/normalize.d.ts.map +1 -1
  38. package/dist/utils/openapi/actions/details.d.ts +7 -0
  39. package/dist/utils/openapi/actions/details.d.ts.map +1 -0
  40. package/dist/utils/openapi/actions/details.js +1 -0
  41. package/dist/utils/openapi/actions/files.d.ts +6 -0
  42. package/dist/utils/openapi/actions/files.d.ts.map +1 -0
  43. package/dist/utils/openapi/actions/files.js +1 -0
  44. package/dist/utils/openapi/actions/get.d.ts +6 -0
  45. package/dist/utils/openapi/actions/get.d.ts.map +1 -0
  46. package/dist/utils/openapi/actions/get.js +1 -0
  47. package/dist/utils/openapi/actions/toJson.d.ts +6 -0
  48. package/dist/utils/openapi/actions/toJson.d.ts.map +1 -0
  49. package/dist/utils/openapi/actions/toJson.js +1 -0
  50. package/dist/utils/openapi/actions/toYaml.d.ts +6 -0
  51. package/dist/utils/openapi/actions/toYaml.d.ts.map +1 -0
  52. package/dist/utils/openapi/actions/toYaml.js +1 -0
  53. package/dist/utils/openapi/commands/dereferenceCommand.d.ts +27 -0
  54. package/dist/utils/openapi/commands/dereferenceCommand.d.ts.map +1 -0
  55. package/dist/utils/openapi/commands/dereferenceCommand.js +1 -0
  56. package/dist/utils/openapi/commands/filterCommand.d.ts +41 -0
  57. package/dist/utils/openapi/commands/filterCommand.d.ts.map +1 -0
  58. package/dist/utils/openapi/commands/filterCommand.js +1 -0
  59. package/dist/utils/openapi/commands/loadCommand.d.ts +8321 -0
  60. package/dist/utils/openapi/commands/loadCommand.d.ts.map +1 -0
  61. package/dist/utils/openapi/commands/loadCommand.js +1 -0
  62. package/dist/utils/openapi/commands/upgradeCommand.d.ts +3406 -0
  63. package/dist/utils/openapi/commands/upgradeCommand.d.ts.map +1 -0
  64. package/dist/utils/openapi/commands/upgradeCommand.js +1 -0
  65. package/dist/utils/openapi/commands/validateCommand.d.ts +3451 -0
  66. package/dist/utils/openapi/commands/validateCommand.d.ts.map +1 -0
  67. package/dist/utils/openapi/commands/validateCommand.js +1 -0
  68. package/dist/utils/openapi/index.d.ts +2 -0
  69. package/dist/utils/openapi/index.d.ts.map +1 -0
  70. package/dist/utils/openapi/openapi.d.ts +1270 -0
  71. package/dist/utils/openapi/openapi.d.ts.map +1 -0
  72. package/dist/utils/openapi/openapi.js +1 -0
  73. package/dist/utils/openapi/openapi.test-d.d.ts +2 -0
  74. package/dist/utils/openapi/openapi.test-d.d.ts.map +1 -0
  75. package/dist/utils/openapi/utils/queueTask.d.ts +6 -0
  76. package/dist/utils/openapi/utils/queueTask.d.ts.map +1 -0
  77. package/dist/utils/openapi/utils/queueTask.js +1 -0
  78. package/dist/utils/openapi/utils/workThroughQueue.d.ts +6 -0
  79. package/dist/utils/openapi/utils/workThroughQueue.d.ts.map +1 -0
  80. package/dist/utils/openapi/utils/workThroughQueue.js +1 -0
  81. package/dist/utils/resolveReferences.d.ts +1 -1
  82. package/dist/utils/resolveReferences.d.ts.map +1 -1
  83. package/dist/utils/toJson.d.ts +1 -1
  84. package/dist/utils/toJson.d.ts.map +1 -1
  85. package/dist/utils/toYaml.d.ts +1 -1
  86. package/dist/utils/toYaml.d.ts.map +1 -1
  87. package/dist/utils/traverse.d.ts +1 -1
  88. package/dist/utils/traverse.d.ts.map +1 -1
  89. package/dist/utils/upgrade.d.ts +2 -1
  90. package/dist/utils/upgrade.d.ts.map +1 -1
  91. package/dist/utils/upgrade.js +1 -1
  92. package/dist/utils/upgrade.test-d.d.ts +2 -0
  93. package/dist/utils/upgrade.test-d.d.ts.map +1 -0
  94. package/dist/utils/upgradeFromThreeToThreeOne.d.ts +1 -1
  95. package/dist/utils/upgradeFromThreeToThreeOne.d.ts.map +1 -1
  96. package/dist/utils/upgradeFromTwoToThree.d.ts +1 -1
  97. package/dist/utils/upgradeFromTwoToThree.d.ts.map +1 -1
  98. package/dist/utils/upgradeFromTwoToThree.js +1 -1
  99. package/dist/utils/validate.d.ts +2 -1
  100. package/dist/utils/validate.d.ts.map +1 -1
  101. package/package.json +37 -33
  102. package/dist/types/openapi-types.d.ts +0 -746
  103. package/dist/types/openapi-types.d.ts.map +0 -1
  104. package/dist/utils/openapi.d.ts +0 -183
  105. package/dist/utils/openapi.d.ts.map +0 -1
  106. package/dist/utils/openapi.js +0 -1
  107. package/dist/utils/workThroughQueue.d.ts +0 -11
  108. package/dist/utils/workThroughQueue.d.ts.map +0 -1
  109. package/dist/utils/workThroughQueue.js +0 -1
@@ -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.js';
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!==typeof r&&Array.isArray(r)&&r.length>0&&r.some((r=>!0===r.isEntrypoint))}export{r as isFilesystem};
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 declare function load(value: any, options?: {
9
+ export type LoadOptions = {
10
10
  plugins?: LoadPlugin[];
11
11
  filename?: string;
12
12
  filesystem?: Filesystem;
13
- }): Promise<LoadResult>;
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":"AAAA,OAAO,KAAK,EAAE,UAAU,EAAE,UAAU,EAAE,MAAM,aAAa,CAAA;AAMzD,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,wBAAsB,IAAI,CACxB,KAAK,EAAE,GAAG,EACV,OAAO,CAAC,EAAE;IACR,OAAO,CAAC,EAAE,UAAU,EAAE,CAAA;IACtB,QAAQ,CAAC,EAAE,MAAM,CAAA;IACjB,UAAU,CAAC,EAAE,UAAU,CAAA;CACxB,GACA,OAAO,CAAC,UAAU,CAAC,CAiFrB"}
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"}
@@ -1 +1 @@
1
- import{getEntrypoint as e}from"../getEntrypoint.js";import{getListOfReferences as i}from"../getListOfReferences.js";import{makeFilesystem as n}from"../makeFilesystem.js";import{normalize as t}from"../normalize.js";async function s(f,m){if(m?.filesystem&&m?.filesystem.find((e=>e.filename===f)))return{filesystem:m.filesystem};const l=m?.plugins?.find((e=>e.check(f))),o=t(l?await l.get(f):f);if(void 0===o)return{filesystem:[]};let r=n(o,{filename:m?.filename??null});const a=(m?.filename?r.find((e=>e.filename===m?.filename)):e(r)).references??i(o);if(0===a.length)return{filesystem:r};for(const e of a){const i=m?.plugins?.find((i=>i.check(e)));if(!i)continue;const n=i.check(e)&&i.resolvePath?i.resolvePath(f,e):e;if(r.find((i=>i.filename===e)))continue;const{filesystem:t}=await s(n,{...m,filename:e});r=[...r,...t.map((e=>({...e,isEntrypoint:!1})))]}return{filesystem:r}}export{s as load};
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,4 +1,4 @@
1
- import { LoadPlugin } from '../load.js';
1
+ import type { LoadPlugin } from '../load.js';
2
2
  export declare const fetchUrlsDefaultConfiguration: {
3
3
  limit: number;
4
4
  };
@@ -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;AAEpC,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
+ {"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,3 +1,3 @@
1
- import { LoadPlugin } from '../load.js';
1
+ import type { LoadPlugin } from '../load.js';
2
2
  export declare const readFiles: () => LoadPlugin;
3
3
  //# sourceMappingURL=readFiles.d.ts.map
@@ -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;AAEpC,eAAO,MAAM,SAAS,EAAE,MAAM,UAoD7B,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,4 +1,4 @@
1
- import { AnyObject, Filesystem } from '../types';
1
+ import type { AnyObject, Filesystem } from '../types';
2
2
  /**
3
3
  * Normalize the OpenAPI specification to a JavaScript object.
4
4
  * Don’t touch the object if it’s a `Filesystem` (multiple files).
@@ -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;AAGhD;;;GAGG;AACH,wBAAgB,SAAS,CACvB,aAAa,EAAE,MAAM,GAAG,SAAS,GAAG,UAAU,GAC7C,SAAS,GAAG,UAAU,CAgBxB"}
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,6 @@
1
+ import type { Filesystem, Queue, Task } from '../../../types';
2
+ /**
3
+ * Run the chained tasks and return just the filesystem
4
+ */
5
+ export declare function files<T extends Task[]>(queue: Queue<T>): Promise<Filesystem>;
6
+ //# sourceMappingURL=files.d.ts.map
@@ -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,6 @@
1
+ import type { CommandChain, Queue, Task } from '../../../types';
2
+ /**
3
+ * Run the chained tasks and return the results
4
+ */
5
+ export declare function get<T extends Task[]>(queue: Queue<T>): Promise<CommandChain<T>>;
6
+ //# sourceMappingURL=get.d.ts.map
@@ -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,6 @@
1
+ import type { Queue, Task } from '../../../types';
2
+ /**
3
+ * Run the chained tasks and return the results
4
+ */
5
+ export declare function toJson<T extends Task[]>(queue: Queue<T>): Promise<string | undefined>;
6
+ //# sourceMappingURL=toJson.d.ts.map
@@ -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,6 @@
1
+ import type { Queue, Task } from '../../../types';
2
+ /**
3
+ * Run the chained tasks and return the results
4
+ */
5
+ export declare function toYaml<T extends Task[]>(queue: Queue<T>): Promise<string>;
6
+ //# sourceMappingURL=toYaml.d.ts.map
@@ -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};