@scalar/openapi-parser 0.8.1 → 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 (72) hide show
  1. package/CHANGELOG.md +6 -0
  2. package/dist/index.js +1 -1
  3. package/dist/lib/Validator/Validator.d.ts +1 -1
  4. package/dist/lib/Validator/Validator.d.ts.map +1 -1
  5. package/dist/types/index.d.ts +73 -4
  6. package/dist/types/index.d.ts.map +1 -1
  7. package/dist/utils/dereference.d.ts +3 -2
  8. package/dist/utils/dereference.d.ts.map +1 -1
  9. package/dist/utils/filter.d.ts +3 -2
  10. package/dist/utils/filter.d.ts.map +1 -1
  11. package/dist/utils/getEntrypoint.d.ts +2 -2
  12. package/dist/utils/getEntrypoint.d.ts.map +1 -1
  13. package/dist/utils/getEntrypoint.js +1 -1
  14. package/dist/utils/index.d.ts +1 -1
  15. package/dist/utils/load/load.d.ts +13 -3
  16. package/dist/utils/load/load.d.ts.map +1 -1
  17. package/dist/utils/load/load.js +1 -1
  18. package/dist/utils/openapi/actions/details.d.ts +7 -0
  19. package/dist/utils/openapi/actions/details.d.ts.map +1 -0
  20. package/dist/utils/openapi/actions/details.js +1 -0
  21. package/dist/utils/openapi/actions/files.d.ts +6 -0
  22. package/dist/utils/openapi/actions/files.d.ts.map +1 -0
  23. package/dist/utils/openapi/actions/files.js +1 -0
  24. package/dist/utils/openapi/actions/get.d.ts +6 -0
  25. package/dist/utils/openapi/actions/get.d.ts.map +1 -0
  26. package/dist/utils/openapi/actions/get.js +1 -0
  27. package/dist/utils/openapi/actions/toJson.d.ts +6 -0
  28. package/dist/utils/openapi/actions/toJson.d.ts.map +1 -0
  29. package/dist/utils/openapi/actions/toJson.js +1 -0
  30. package/dist/utils/openapi/actions/toYaml.d.ts +6 -0
  31. package/dist/utils/openapi/actions/toYaml.d.ts.map +1 -0
  32. package/dist/utils/openapi/actions/toYaml.js +1 -0
  33. package/dist/utils/openapi/commands/dereferenceCommand.d.ts +27 -0
  34. package/dist/utils/openapi/commands/dereferenceCommand.d.ts.map +1 -0
  35. package/dist/utils/openapi/commands/dereferenceCommand.js +1 -0
  36. package/dist/utils/openapi/commands/filterCommand.d.ts +41 -0
  37. package/dist/utils/openapi/commands/filterCommand.d.ts.map +1 -0
  38. package/dist/utils/openapi/commands/filterCommand.js +1 -0
  39. package/dist/utils/openapi/commands/loadCommand.d.ts +8321 -0
  40. package/dist/utils/openapi/commands/loadCommand.d.ts.map +1 -0
  41. package/dist/utils/openapi/commands/loadCommand.js +1 -0
  42. package/dist/utils/openapi/commands/upgradeCommand.d.ts +3406 -0
  43. package/dist/utils/openapi/commands/upgradeCommand.d.ts.map +1 -0
  44. package/dist/utils/openapi/commands/upgradeCommand.js +1 -0
  45. package/dist/utils/openapi/commands/validateCommand.d.ts +3451 -0
  46. package/dist/utils/openapi/commands/validateCommand.d.ts.map +1 -0
  47. package/dist/utils/openapi/commands/validateCommand.js +1 -0
  48. package/dist/utils/openapi/index.d.ts +2 -0
  49. package/dist/utils/openapi/index.d.ts.map +1 -0
  50. package/dist/utils/openapi/openapi.d.ts +1270 -0
  51. package/dist/utils/openapi/openapi.d.ts.map +1 -0
  52. package/dist/utils/openapi/openapi.js +1 -0
  53. package/dist/utils/openapi/openapi.test-d.d.ts +2 -0
  54. package/dist/utils/openapi/openapi.test-d.d.ts.map +1 -0
  55. package/dist/utils/openapi/utils/queueTask.d.ts +6 -0
  56. package/dist/utils/openapi/utils/queueTask.d.ts.map +1 -0
  57. package/dist/utils/openapi/utils/queueTask.js +1 -0
  58. package/dist/utils/openapi/utils/workThroughQueue.d.ts +6 -0
  59. package/dist/utils/openapi/utils/workThroughQueue.d.ts.map +1 -0
  60. package/dist/utils/openapi/utils/workThroughQueue.js +1 -0
  61. package/dist/utils/upgrade.d.ts +1 -1
  62. package/dist/utils/upgrade.d.ts.map +1 -1
  63. package/dist/utils/upgrade.js +1 -1
  64. package/dist/utils/validate.d.ts +2 -1
  65. package/dist/utils/validate.d.ts.map +1 -1
  66. package/package.json +2 -2
  67. package/dist/utils/openapi.d.ts +0 -183
  68. package/dist/utils/openapi.d.ts.map +0 -1
  69. package/dist/utils/openapi.js +0 -1
  70. package/dist/utils/workThroughQueue.d.ts +0 -11
  71. package/dist/utils/workThroughQueue.d.ts.map +0 -1
  72. package/dist/utils/workThroughQueue.js +0 -1
@@ -0,0 +1 @@
1
+ {"version":3,"file":"openapi.d.ts","sourceRoot":"","sources":["../../../src/utils/openapi/openapi.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,sBAAsB,EAAE,cAAc,EAAS,MAAM,aAAa,CAAA;AAChF,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,SAAS,CAAA;AAG1C;;GAEG;AACH,wBAAgB,OAAO,CAAC,aAAa,CAAC,EAAE,cAAc;kBASpC,sBAAsB,YAAY,WAAW;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EAG9D"}
@@ -0,0 +1 @@
1
+ import{loadCommand as o}from"./commands/loadCommand.js";function n(n){const t={input:null,options:n,tasks:[]};return{load:(n,m)=>o(t,n,m)}}export{n as openapi};
@@ -0,0 +1,2 @@
1
+ export {};
2
+ //# sourceMappingURL=openapi.test-d.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"openapi.test-d.d.ts","sourceRoot":"","sources":["../../../src/utils/openapi/openapi.test-d.ts"],"names":[],"mappings":""}
@@ -0,0 +1,6 @@
1
+ import type { Queue, Task } from '../../../types';
2
+ /**
3
+ * Add a new task to the existing queue
4
+ */
5
+ export declare function queueTask<T extends Task[]>(queue: Queue, task: Task): Queue<T>;
6
+ //# sourceMappingURL=queueTask.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"queueTask.d.ts","sourceRoot":"","sources":["../../../../src/utils/openapi/utils/queueTask.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,KAAK,EAAE,IAAI,EAAE,MAAM,gBAAgB,CAAA;AAEjD;;GAEG;AACH,wBAAgB,SAAS,CAAC,CAAC,SAAS,IAAI,EAAE,EAAE,KAAK,EAAE,KAAK,EAAE,IAAI,EAAE,IAAI,GAI7D,KAAK,CAAC,CAAC,CAAC,CACd"}
@@ -0,0 +1 @@
1
+ function t(t,s){return{...t,tasks:[...t.tasks,s]}}export{t as queueTask};
@@ -0,0 +1,6 @@
1
+ import type { CommandChain, Queue, Task } from '../../../types';
2
+ /**
3
+ * Takes a queue of tasks and works through them
4
+ */
5
+ export declare function workThroughQueue<T extends Task[]>(queue: Queue<T>): Promise<CommandChain<T>>;
6
+ //# sourceMappingURL=workThroughQueue.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"workThroughQueue.d.ts","sourceRoot":"","sources":["../../../../src/utils/openapi/utils/workThroughQueue.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,YAAY,EAAS,KAAK,EAAE,IAAI,EAAE,MAAM,gBAAgB,CAAA;AAOtE;;GAEG;AACH,wBAAsB,gBAAgB,CAAC,CAAC,SAAS,IAAI,EAAE,EACrD,KAAK,EAAE,KAAK,CAAC,CAAC,CAAC,GACd,OAAO,CAAC,YAAY,CAAC,CAAC,CAAC,CAAC,CA4E1B"}
@@ -0,0 +1 @@
1
+ import{dereference as o}from"../../dereference.js";import{filter as t}from"../../filter.js";import{load as e}from"../../load/load.js";import{upgrade as i}from"../../upgrade.js";import{validate as r}from"../../validate.js";async function a(a){const{input:n}={...a};let s={};for(const f of a.tasks){const a=f.name,p="options"in f?f.options:void 0,c=s.specification?s.specification:"object"==typeof n?structuredClone(n):n;"load"===a?s={...s,...await e(n,p)}:"filter"===a?s={...s,...t(c,p)}:"dereference"===a?s={...s,...await o(c,p)}:"upgrade"===a?s={...s,...i(c)}:"validate"===a&&(s={...s,...await r(c,p)})}return s}export{a as workThroughQueue};
@@ -3,5 +3,5 @@ import type { AnyObject, Filesystem, UpgradeResult } from '../types';
3
3
  /**
4
4
  * Upgrade specification to OpenAPI 3.1.0
5
5
  */
6
- export declare function upgrade(value: string | AnyObject | Filesystem, _options?: AnyObject): UpgradeResult<OpenAPIV3_1.Document>;
6
+ export declare function upgrade(value: string | AnyObject | Filesystem): UpgradeResult<OpenAPIV3_1.Document>;
7
7
  //# sourceMappingURL=upgrade.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"upgrade.d.ts","sourceRoot":"","sources":["../../src/utils/upgrade.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,uBAAuB,CAAA;AAExD,OAAO,KAAK,EAAE,SAAS,EAAE,UAAU,EAAE,aAAa,EAAE,MAAM,UAAU,CAAA;AAMpE;;GAEG;AACH,wBAAgB,OAAO,CACrB,KAAK,EAAE,MAAM,GAAG,SAAS,GAAG,UAAU,EACtC,QAAQ,CAAC,EAAE,SAAS,GACnB,aAAa,CAAC,WAAW,CAAC,QAAQ,CAAC,CAcrC"}
1
+ {"version":3,"file":"upgrade.d.ts","sourceRoot":"","sources":["../../src/utils/upgrade.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,uBAAuB,CAAA;AAExD,OAAO,KAAK,EAAE,SAAS,EAAE,UAAU,EAAE,aAAa,EAAE,MAAM,UAAU,CAAA;AAMpE;;GAEG;AACH,wBAAgB,OAAO,CACrB,KAAK,EAAE,MAAM,GAAG,SAAS,GAAG,UAAU,GACrC,aAAa,CAAC,WAAW,CAAC,QAAQ,CAAC,CAcrC"}
@@ -1 +1 @@
1
- import{getEntrypoint as r}from"./getEntrypoint.js";import{makeFilesystem as e}from"./makeFilesystem.js";import{upgradeFromThreeToThreeOne as o}from"./upgradeFromThreeToThreeOne.js";import{upgradeFromTwoToThree as i}from"./upgradeFromTwoToThree.js";function t(t,m){return{specification:[i,o].reduce(((r,e)=>e(r)),r(e(t)).specification),version:"3.1"}}export{t as upgrade};
1
+ import{getEntrypoint as r}from"./getEntrypoint.js";import{makeFilesystem as e}from"./makeFilesystem.js";import{upgradeFromThreeToThreeOne as o}from"./upgradeFromThreeToThreeOne.js";import{upgradeFromTwoToThree as i}from"./upgradeFromTwoToThree.js";function t(t){return{specification:[i,o].reduce(((r,e)=>e(r)),r(e(t)).specification),version:"3.1"}}export{t as upgrade};
@@ -1,6 +1,7 @@
1
1
  import type { AnyObject, Filesystem, ThrowOnErrorOption, ValidateResult } from '../types';
2
+ export type ValidateOptions = ThrowOnErrorOption;
2
3
  /**
3
4
  * Validates an OpenAPI schema.
4
5
  */
5
- export declare function validate(value: string | AnyObject | Filesystem, options?: ThrowOnErrorOption): Promise<ValidateResult>;
6
+ export declare function validate(value: string | AnyObject | Filesystem, options?: ValidateOptions): Promise<ValidateResult>;
6
7
  //# sourceMappingURL=validate.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"validate.d.ts","sourceRoot":"","sources":["../../src/utils/validate.ts"],"names":[],"mappings":"AAGA,OAAO,KAAK,EACV,SAAS,EACT,UAAU,EACV,kBAAkB,EAClB,cAAc,EACf,MAAM,UAAU,CAAA;AAGjB;;GAEG;AACH,wBAAsB,QAAQ,CAC5B,KAAK,EAAE,MAAM,GAAG,SAAS,GAAG,UAAU,EACtC,OAAO,CAAC,EAAE,kBAAkB,GAC3B,OAAO,CAAC,cAAc,CAAC,CAWzB"}
1
+ {"version":3,"file":"validate.d.ts","sourceRoot":"","sources":["../../src/utils/validate.ts"],"names":[],"mappings":"AAGA,OAAO,KAAK,EACV,SAAS,EACT,UAAU,EACV,kBAAkB,EAClB,cAAc,EACf,MAAM,UAAU,CAAA;AAGjB,MAAM,MAAM,eAAe,GAAG,kBAAkB,CAAA;AAEhD;;GAEG;AACH,wBAAsB,QAAQ,CAC5B,KAAK,EAAE,MAAM,GAAG,SAAS,GAAG,UAAU,EACtC,OAAO,CAAC,EAAE,eAAe,GACxB,OAAO,CAAC,cAAc,CAAC,CAWzB"}
package/package.json CHANGED
@@ -17,7 +17,7 @@
17
17
  "parser",
18
18
  "typescript"
19
19
  ],
20
- "version": "0.8.1",
20
+ "version": "0.8.2",
21
21
  "engines": {
22
22
  "node": ">=18"
23
23
  },
@@ -63,7 +63,7 @@
63
63
  "rollup": "^4.16.4",
64
64
  "rollup-plugin-output-size": "^1.4.1",
65
65
  "tinybench": "^2.8.0",
66
- "@scalar/openapi-types": "0.1.0"
66
+ "@scalar/openapi-types": "0.1.1"
67
67
  },
68
68
  "scripts": {
69
69
  "build": "pnpm types:check && rollup -c --configPlugin typescript && pnpm types:build",
@@ -1,183 +0,0 @@
1
- import type { AnyObject, DetailsResult, Filesystem, ThrowOnErrorOption } from '../types';
2
- import { dereference } from './dereference.js';
3
- import { filter } from './filter.js';
4
- import { type LoadPlugin, load } from './load';
5
- import { upgrade } from './upgrade.js';
6
- import { validate } from './validate.js';
7
- /**
8
- * A queuable action for the pipeline
9
- */
10
- export type Action = {
11
- action: typeof load | typeof upgrade | typeof filter | typeof dereference | typeof validate;
12
- options?: AnyObject;
13
- };
14
- /**
15
- * A queue of tasks to run on an OpenAPI specification
16
- */
17
- export type Queue = {
18
- specification: AnyApiDefinitionFormat;
19
- tasks: Action[];
20
- };
21
- /**
22
- * JSON, YAML or object representation of an OpenAPI API definition
23
- */
24
- export type AnyApiDefinitionFormat = string | AnyObject;
25
- /**
26
- * Creates a new pipeline
27
- */
28
- export declare function openapi(globalOptions?: ThrowOnErrorOption): {
29
- load: (specification: AnyApiDefinitionFormat, options?: {
30
- plugins?: LoadPlugin[];
31
- }) => {
32
- get: () => Promise<Partial<import("../types").LoadResult & import("../types").DereferenceResult & import("../types").ValidateResult & import("../types").UpgradeResult & import("../types").FilterResult & {
33
- filesystem: Filesystem;
34
- }>>;
35
- files: () => Promise<Filesystem>;
36
- details: () => Promise<DetailsResult>;
37
- filter: (callback: (Specification: AnyObject) => boolean) => {
38
- get: () => Promise<Partial<import("../types").LoadResult & import("../types").DereferenceResult & import("../types").ValidateResult & import("../types").UpgradeResult & import("../types").FilterResult & {
39
- filesystem: Filesystem;
40
- }>>;
41
- files: () => Promise<Filesystem>;
42
- details: () => Promise<DetailsResult>;
43
- filter: () => any;
44
- upgrade: () => {
45
- get: () => Promise<Partial<import("../types").LoadResult & import("../types").DereferenceResult & import("../types").ValidateResult & import("../types").UpgradeResult & import("../types").FilterResult & {
46
- filesystem: Filesystem;
47
- }>>;
48
- files: () => Promise<Filesystem>;
49
- details: () => Promise<DetailsResult>;
50
- filter: (callback: (Specification: AnyObject) => boolean) => any;
51
- validate: (validateOptions?: ThrowOnErrorOption) => {
52
- filter: (callback: (Specification: AnyObject) => boolean) => any;
53
- get: () => Promise<Partial<import("../types").LoadResult & import("../types").DereferenceResult & import("../types").ValidateResult & import("../types").UpgradeResult & import("../types").FilterResult & {
54
- filesystem: Filesystem;
55
- }>>;
56
- files: () => Promise<Filesystem>;
57
- details: () => Promise<DetailsResult>;
58
- dereference: (dereferenceOptions?: ThrowOnErrorOption) => {
59
- get: () => Promise<Partial<import("../types").LoadResult & import("../types").DereferenceResult & import("../types").ValidateResult & import("../types").UpgradeResult & import("../types").FilterResult & {
60
- filesystem: Filesystem;
61
- }>>;
62
- files: () => Promise<Filesystem>;
63
- filter: (callback: (Specification: AnyObject) => boolean) => any;
64
- toJson: () => Promise<string>;
65
- toYaml: () => Promise<string>;
66
- };
67
- toJson: () => Promise<string>;
68
- toYaml: () => Promise<string>;
69
- };
70
- dereference: (dereferenceOptions?: ThrowOnErrorOption) => {
71
- get: () => Promise<Partial<import("../types").LoadResult & import("../types").DereferenceResult & import("../types").ValidateResult & import("../types").UpgradeResult & import("../types").FilterResult & {
72
- filesystem: Filesystem;
73
- }>>;
74
- files: () => Promise<Filesystem>;
75
- filter: (callback: (Specification: AnyObject) => boolean) => any;
76
- toJson: () => Promise<string>;
77
- toYaml: () => Promise<string>;
78
- };
79
- toJson: () => Promise<string>;
80
- toYaml: () => Promise<string>;
81
- };
82
- validate: (validateOptions?: ThrowOnErrorOption) => {
83
- filter: (callback: (Specification: AnyObject) => boolean) => any;
84
- get: () => Promise<Partial<import("../types").LoadResult & import("../types").DereferenceResult & import("../types").ValidateResult & import("../types").UpgradeResult & import("../types").FilterResult & {
85
- filesystem: Filesystem;
86
- }>>;
87
- files: () => Promise<Filesystem>;
88
- details: () => Promise<DetailsResult>;
89
- dereference: (dereferenceOptions?: ThrowOnErrorOption) => {
90
- get: () => Promise<Partial<import("../types").LoadResult & import("../types").DereferenceResult & import("../types").ValidateResult & import("../types").UpgradeResult & import("../types").FilterResult & {
91
- filesystem: Filesystem;
92
- }>>;
93
- files: () => Promise<Filesystem>;
94
- filter: (callback: (Specification: AnyObject) => boolean) => any;
95
- toJson: () => Promise<string>;
96
- toYaml: () => Promise<string>;
97
- };
98
- toJson: () => Promise<string>;
99
- toYaml: () => Promise<string>;
100
- };
101
- dereference: (dereferenceOptions?: ThrowOnErrorOption) => {
102
- get: () => Promise<Partial<import("../types").LoadResult & import("../types").DereferenceResult & import("../types").ValidateResult & import("../types").UpgradeResult & import("../types").FilterResult & {
103
- filesystem: Filesystem;
104
- }>>;
105
- files: () => Promise<Filesystem>;
106
- filter: (callback: (Specification: AnyObject) => boolean) => any;
107
- toJson: () => Promise<string>;
108
- toYaml: () => Promise<string>;
109
- };
110
- toJson: () => Promise<string>;
111
- toYaml: () => Promise<string>;
112
- };
113
- upgrade: () => {
114
- get: () => Promise<Partial<import("../types").LoadResult & import("../types").DereferenceResult & import("../types").ValidateResult & import("../types").UpgradeResult & import("../types").FilterResult & {
115
- filesystem: Filesystem;
116
- }>>;
117
- files: () => Promise<Filesystem>;
118
- details: () => Promise<DetailsResult>;
119
- filter: (callback: (Specification: AnyObject) => boolean) => any;
120
- validate: (validateOptions?: ThrowOnErrorOption) => {
121
- filter: (callback: (Specification: AnyObject) => boolean) => any;
122
- get: () => Promise<Partial<import("../types").LoadResult & import("../types").DereferenceResult & import("../types").ValidateResult & import("../types").UpgradeResult & import("../types").FilterResult & {
123
- filesystem: Filesystem;
124
- }>>;
125
- files: () => Promise<Filesystem>;
126
- details: () => Promise<DetailsResult>;
127
- dereference: (dereferenceOptions?: ThrowOnErrorOption) => {
128
- get: () => Promise<Partial<import("../types").LoadResult & import("../types").DereferenceResult & import("../types").ValidateResult & import("../types").UpgradeResult & import("../types").FilterResult & {
129
- filesystem: Filesystem;
130
- }>>;
131
- files: () => Promise<Filesystem>;
132
- filter: (callback: (Specification: AnyObject) => boolean) => any;
133
- toJson: () => Promise<string>;
134
- toYaml: () => Promise<string>;
135
- };
136
- toJson: () => Promise<string>;
137
- toYaml: () => Promise<string>;
138
- };
139
- dereference: (dereferenceOptions?: ThrowOnErrorOption) => {
140
- get: () => Promise<Partial<import("../types").LoadResult & import("../types").DereferenceResult & import("../types").ValidateResult & import("../types").UpgradeResult & import("../types").FilterResult & {
141
- filesystem: Filesystem;
142
- }>>;
143
- files: () => Promise<Filesystem>;
144
- filter: (callback: (Specification: AnyObject) => boolean) => any;
145
- toJson: () => Promise<string>;
146
- toYaml: () => Promise<string>;
147
- };
148
- toJson: () => Promise<string>;
149
- toYaml: () => Promise<string>;
150
- };
151
- validate: (validateOptions?: ThrowOnErrorOption) => {
152
- filter: (callback: (Specification: AnyObject) => boolean) => any;
153
- get: () => Promise<Partial<import("../types").LoadResult & import("../types").DereferenceResult & import("../types").ValidateResult & import("../types").UpgradeResult & import("../types").FilterResult & {
154
- filesystem: Filesystem;
155
- }>>;
156
- files: () => Promise<Filesystem>;
157
- details: () => Promise<DetailsResult>;
158
- dereference: (dereferenceOptions?: ThrowOnErrorOption) => {
159
- get: () => Promise<Partial<import("../types").LoadResult & import("../types").DereferenceResult & import("../types").ValidateResult & import("../types").UpgradeResult & import("../types").FilterResult & {
160
- filesystem: Filesystem;
161
- }>>;
162
- files: () => Promise<Filesystem>;
163
- filter: (callback: (Specification: AnyObject) => boolean) => any;
164
- toJson: () => Promise<string>;
165
- toYaml: () => Promise<string>;
166
- };
167
- toJson: () => Promise<string>;
168
- toYaml: () => Promise<string>;
169
- };
170
- dereference: (dereferenceOptions?: ThrowOnErrorOption) => {
171
- get: () => Promise<Partial<import("../types").LoadResult & import("../types").DereferenceResult & import("../types").ValidateResult & import("../types").UpgradeResult & import("../types").FilterResult & {
172
- filesystem: Filesystem;
173
- }>>;
174
- files: () => Promise<Filesystem>;
175
- filter: (callback: (Specification: AnyObject) => boolean) => any;
176
- toJson: () => Promise<string>;
177
- toYaml: () => Promise<string>;
178
- };
179
- toJson: () => Promise<string>;
180
- toYaml: () => Promise<string>;
181
- };
182
- };
183
- //# sourceMappingURL=openapi.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"openapi.d.ts","sourceRoot":"","sources":["../../src/utils/openapi.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EACV,SAAS,EACT,aAAa,EACb,UAAU,EACV,kBAAkB,EACnB,MAAM,UAAU,CAAA;AACjB,OAAO,EAAE,WAAW,EAAE,MAAM,eAAe,CAAA;AAE3C,OAAO,EAAE,MAAM,EAAE,MAAM,UAAU,CAAA;AAEjC,OAAO,EAAE,KAAK,UAAU,EAAE,IAAI,EAAE,MAAM,QAAQ,CAAA;AAG9C,OAAO,EAAE,OAAO,EAAE,MAAM,WAAW,CAAA;AACnC,OAAO,EAAE,QAAQ,EAAE,MAAM,YAAY,CAAA;AAGrC;;GAEG;AACH,MAAM,MAAM,MAAM,GAAG;IACnB,MAAM,EACF,OAAO,IAAI,GACX,OAAO,OAAO,GACd,OAAO,MAAM,GACb,OAAO,WAAW,GAClB,OAAO,QAAQ,CAAA;IACnB,OAAO,CAAC,EAAE,SAAS,CAAA;CACpB,CAAA;AAED;;GAEG;AACH,MAAM,MAAM,KAAK,GAAG;IAClB,aAAa,EAAE,sBAAsB,CAAA;IACrC,KAAK,EAAE,MAAM,EAAE,CAAA;CAChB,CAAA;AAED;;GAEG;AACH,MAAM,MAAM,sBAAsB,GAAG,MAAM,GAAG,SAAS,CAAA;AAEvD;;GAEG;AACH,wBAAgB,OAAO,CAAC,aAAa,CAAC,EAAE,kBAAkB;0BAGrC,sBAAsB,YAC3B;QACR,OAAO,CAAC,EAAE,UAAU,EAAE,CAAA;KACvB;;;;;;2BAqCgB,CAAC,aAAa,EAAE,SAAS,KAAK,OAAO;;;;;;;;;;;;;mCAkCrC,CAAC,aAAa,EAAE,SAAS,KAAK,OAAO;6CAI3B,kBAAkB;uCA0B5B,CAAC,aAAa,EAAE,SAAS,KAAK,OAAO;;;;;;uDAOrB,kBAAkB;;;;;2CAwBlC,CAAC,aAAa,EAAE,SAAS,KAAK,OAAO;;;;;;;mDArDrB,kBAAkB;;;;;uCAqDlC,CAAC,aAAa,EAAE,SAAS,KAAK,OAAO;;;;;;;yCA4B3B,kBAAkB;mCA3D5B,CAAC,aAAa,EAAE,SAAS,KAAK,OAAO;;;;;;mDAOrB,kBAAkB;;;;;uCAwBlC,CAAC,aAAa,EAAE,SAAS,KAAK,OAAO;;;;;;;+CAgCrB,kBAAkB;;;;;mCAhClC,CAAC,aAAa,EAAE,SAAS,KAAK,OAAO;;;;;;;;;;;;;+BA7DrC,CAAC,aAAa,EAAE,SAAS,KAAK,OAAO;yCAI3B,kBAAkB;mCA0B5B,CAAC,aAAa,EAAE,SAAS,KAAK,OAAO;;;;;;mDAOrB,kBAAkB;;;;;uCAwBlC,CAAC,aAAa,EAAE,SAAS,KAAK,OAAO;;;;;;;+CArDrB,kBAAkB;;;;;mCAqDlC,CAAC,aAAa,EAAE,SAAS,KAAK,OAAO;;;;;;;qCAvF3B,kBAAkB;+BAwD5B,CAAC,aAAa,EAAE,SAAS,KAAK,OAAO;;;;;;+CAOrB,kBAAkB;;;;;mCAwBlC,CAAC,aAAa,EAAE,SAAS,KAAK,OAAO;;;;;;;2CAnFrB,kBAAkB;;;;;+BAmFlC,CAAC,aAAa,EAAE,SAAS,KAAK,OAAO;;;;;;;EA7H3D"}
@@ -1 +0,0 @@
1
- import{dereference as r}from"./dereference.js";import{details as o}from"./details.js";import{filter as t}from"./filter.js";import{getEntrypoint as n}from"./getEntrypoint.js";import{load as e}from"./load/load.js";import{toJson as i}from"./toJson.js";import{toYaml as s}from"./toYaml.js";import{upgrade as a}from"./upgrade.js";import{validate as f}from"./validate.js";import{workThroughQueue as c}from"./workThroughQueue.js";function l(r){return{load:(o,t)=>function(r,o){const t={specification:r,tasks:[{action:e,options:{plugins:o?.plugins}}]};return{get:()=>w(t),files:()=>E(t),details:()=>O(t),filter:r=>h(t,r,{throwOnError:o?.throwOnError}),upgrade:()=>u(t,{throwOnError:o?.throwOnError}),validate:r=>p(t,{throwOnError:r?.throwOnError??o?.throwOnError}),dereference:r=>m(t,{...o??{},...r??{}}),toJson:()=>d(t),toYaml:()=>g(t)}}(o,{...r??{},...t??{}})}}function u(r,o){return r.tasks.push({action:a}),{get:()=>w(r),files:()=>E(r),details:()=>O(r),filter:t=>h(r,t,{throwOnError:o?.throwOnError}),validate:t=>p(r,{throwOnError:t?.throwOnError??o?.throwOnError}),dereference:t=>m(r,{...o??{},...t??{}}),toJson:()=>d(r),toYaml:()=>g(r)}}function p(r,o){return r.tasks.push({action:f,options:{throwOnError:o?.throwOnError}}),{filter:t=>h(r,t,{throwOnError:o?.throwOnError}),get:()=>w(r),files:()=>E(r),details:()=>O(r),dereference:t=>m(r,{...o??{},...t??{}}),toJson:()=>d(r),toYaml:()=>g(r)}}function m(o,t){return o.tasks.push({action:r,options:{throwOnError:t?.throwOnError}}),{get:()=>w(o),files:()=>E(o),filter:r=>h(o,r,{throwOnError:t?.throwOnError}),toJson:()=>d(o),toYaml:()=>g(o)}}function h(r,o,n){return r.tasks.push({action:t,options:o}),{get:()=>w(r),files:()=>E(r),details:()=>O(r),filter:()=>h(r,o,n),upgrade:()=>u(r,n),validate:o=>p(r,{throwOnError:o?.throwOnError??n?.throwOnError}),dereference:o=>m(r,{...n??{},...o??{}}),toJson:()=>d(r),toYaml:()=>g(r)}}async function w(r){const o=await c(r);return void 0===o.specification&&(o.specification=n(o.filesystem).specification),o}async function E(r){const{filesystem:o}=await c(r);return o}async function O(r){const{filesystem:t}=await c(r);return o(n(t).specification)}async function d(r){const{filesystem:o}=await c(r);return i(n(o).specification)}async function g(r){const{filesystem:o}=await c(r);return s(n(o).specification)}export{l as openapi};
@@ -1,11 +0,0 @@
1
- import type { DereferenceResult, Filesystem, FilterResult, LoadResult, UpgradeResult, ValidateResult } from '../types';
2
- import type { Queue } from './openapi.js';
3
- type WorkThroughQueueResult = Partial<LoadResult & DereferenceResult & ValidateResult & UpgradeResult & FilterResult & {
4
- filesystem: Filesystem;
5
- }>;
6
- /**
7
- * Run through a queue of tasks
8
- */
9
- export declare function workThroughQueue(queue: Queue): Promise<WorkThroughQueueResult>;
10
- export {};
11
- //# sourceMappingURL=workThroughQueue.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"workThroughQueue.d.ts","sourceRoot":"","sources":["../../src/utils/workThroughQueue.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EACV,iBAAiB,EACjB,UAAU,EACV,YAAY,EACZ,UAAU,EACV,aAAa,EACb,cAAc,EACf,MAAM,UAAU,CAAA;AACjB,OAAO,KAAK,EAAE,KAAK,EAAE,MAAM,WAAW,CAAA;AAEtC,KAAK,sBAAsB,GAAG,OAAO,CACnC,UAAU,GACR,iBAAiB,GACjB,cAAc,GACd,aAAa,GACb,YAAY,GAAG;IACb,UAAU,EAAE,UAAU,CAAA;CACvB,CACJ,CAAA;AAED;;GAEG;AACH,wBAAsB,gBAAgB,CAAC,KAAK,EAAE,KAAK,GACnD,OAAO,CAAC,sBAAsB,CAAC,CA4B9B"}
@@ -1 +0,0 @@
1
- async function n(n){const t=n.specification;let o;for(const{action:c,options:e}of n.tasks)"function"==typeof c?o="AsyncFunction"===c.constructor.name?{...o,...await c(o?.filesystem??t,e)}:{...o,...c(o?.filesystem??t,e)}:console.warn("[queue] The given action is not a function:",c);return o}export{n as workThroughQueue};