@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
|
@@ -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 @@
|
|
|
1
|
+
{"version":3,"file":"openapi.test-d.d.ts","sourceRoot":"","sources":["../../../src/utils/openapi/openapi.test-d.ts"],"names":[],"mappings":""}
|
|
@@ -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};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"resolveReferences.d.ts","sourceRoot":"","sources":["../../src/utils/resolveReferences.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"resolveReferences.d.ts","sourceRoot":"","sources":["../../src/utils/resolveReferences.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,uBAAuB,CAAA;AAGpD,OAAO,KAAK,EACV,SAAS,EACT,WAAW,EACX,UAAU,EACV,eAAe,EACf,kBAAkB,EACnB,MAAM,UAAU,CAAA;AAejB,MAAM,MAAM,uBAAuB,GAAG;IACpC,KAAK,EAAE,OAAO,CAAA;IACd,MAAM,EAAE,WAAW,EAAE,CAAA;IACrB,MAAM,EAAE,OAAO,CAAC,QAAQ,CAAA;CACzB,CAAA;AAOD;;GAEG;AACH,wBAAgB,iBAAiB,CAE/B,KAAK,EAAE,SAAS,GAAG,UAAU,EAE7B,OAAO,CAAC,EAAE,kBAAkB,EAE5B,IAAI,CAAC,EAAE,eAAe,EAEtB,MAAM,CAAC,EAAE,WAAW,EAAE,GACrB,uBAAuB,CA+FzB"}
|
package/dist/utils/toJson.d.ts
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"toJson.d.ts","sourceRoot":"","sources":["../../src/utils/toJson.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,MAAM,UAAU,CAAA;
|
|
1
|
+
{"version":3,"file":"toJson.d.ts","sourceRoot":"","sources":["../../src/utils/toJson.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,UAAU,CAAA;AAEzC,eAAO,MAAM,MAAM,UAAW,SAAS,WAAmC,CAAA"}
|
package/dist/utils/toYaml.d.ts
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"toYaml.d.ts","sourceRoot":"","sources":["../../src/utils/toYaml.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,SAAS,EAAE,MAAM,UAAU,CAAA;
|
|
1
|
+
{"version":3,"file":"toYaml.d.ts","sourceRoot":"","sources":["../../src/utils/toYaml.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,UAAU,CAAA;AAEzC,eAAO,MAAM,MAAM,UAAW,SAAS,WAAqB,CAAA"}
|
package/dist/utils/traverse.d.ts
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"traverse.d.ts","sourceRoot":"","sources":["../../src/utils/traverse.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,MAAM,UAAU,CAAA;
|
|
1
|
+
{"version":3,"file":"traverse.d.ts","sourceRoot":"","sources":["../../src/utils/traverse.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,UAAU,CAAA;AAEzC;;GAEG;AACH,wBAAgB,QAAQ,CACtB,aAAa,EAAE,SAAS,EACxB,SAAS,EAAE,CAAC,aAAa,EAAE,SAAS,KAAK,SAAS,aAqBnD"}
|
package/dist/utils/upgrade.d.ts
CHANGED
|
@@ -1,6 +1,7 @@
|
|
|
1
|
+
import type { OpenAPIV3_1 } from '@scalar/openapi-types';
|
|
1
2
|
import type { AnyObject, Filesystem, UpgradeResult } from '../types';
|
|
2
3
|
/**
|
|
3
4
|
* Upgrade specification to OpenAPI 3.1.0
|
|
4
5
|
*/
|
|
5
|
-
export declare function upgrade(
|
|
6
|
+
export declare function upgrade(value: string | AnyObject | Filesystem): UpgradeResult<OpenAPIV3_1.Document>;
|
|
6
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,SAAS,EAAE,UAAU,EAAE,aAAa,EAAE,MAAM,UAAU,CAAA;AAMpE;;GAEG;AACH,wBAAgB,OAAO,CACrB,
|
|
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"}
|
package/dist/utils/upgrade.js
CHANGED
|
@@ -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
|
|
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};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"upgrade.test-d.d.ts","sourceRoot":"","sources":["../../src/utils/upgrade.test-d.ts"],"names":[],"mappings":""}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"upgradeFromThreeToThreeOne.d.ts","sourceRoot":"","sources":["../../src/utils/upgradeFromThreeToThreeOne.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,MAAM,UAAU,CAAA;
|
|
1
|
+
{"version":3,"file":"upgradeFromThreeToThreeOne.d.ts","sourceRoot":"","sources":["../../src/utils/upgradeFromThreeToThreeOne.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,UAAU,CAAA;AAGzC;;;;GAIG;AACH,wBAAgB,0BAA0B,CAAC,aAAa,EAAE,SAAS,aAkGlE"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"upgradeFromTwoToThree.d.ts","sourceRoot":"","sources":["../../src/utils/upgradeFromTwoToThree.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"upgradeFromTwoToThree.d.ts","sourceRoot":"","sources":["../../src/utils/upgradeFromTwoToThree.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,UAAU,CAAA;AAGzC;;;;GAIG;AACH,wBAAgB,qBAAqB,CAAC,aAAa,EAAE,SAAS,aAoJ7D"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
function n(n){return
|
|
1
|
+
import{traverse as e}from"./traverse.js";function t(t){if(!t.swagger?.startsWith("2.0"))return t;if(t.openapi="3.0.3",delete t.swagger,console.warn("[upgradeFromTwoToThree] The upgrade from Swagger 2.0 to OpenAPI 3.0 documents is experimental and lacks features."),t.host){const e=t.schemes?.length?t.schemes:["http"];t.servers=e.map((e=>({url:`${e}://${t.host}${t.basePath??""}`}))),delete t.basePath,delete t.schemes,delete t.host}if(t.definitions&&("object"!=typeof t.components&&(t.components={}),t.components.schemas=t.definitions,delete t.definitions,t=e(t,(e=>(e.$ref?.startsWith("#/definitions/")&&(e.$ref=e.$ref.replace(/^#\/definitions\//,"#/components/schemas/")),e)))),t.paths)for(const e in t.paths)if(Object.hasOwn(t.paths,e)){const s=t.paths[e];for(const e in s)if(Object.hasOwn(s,e)){const o=s[e];if(o.parameters){const e=structuredClone(o.parameters.find((e=>"body"===e.in))??{});if(e&&Object.keys(e).length){delete e.name,delete e.in;const s=t.consumes??o.consumes??["application/json"];"object"!=typeof o.requestBody&&(o.requestBody={}),"object"!=typeof o.requestBody.content&&(o.requestBody.content={});const{schema:n,...r}=e;o.requestBody={...o.requestBody,...r};for(const e of s)o.requestBody.content[e]={schema:n}}o.parameters=o.parameters.filter((e=>"body"!==e.in)),delete o.consumes}if(o.responses)for(const e in o.responses)if(Object.hasOwn(o.responses,e)){const s=o.responses[e];if(s.schema){const e=t.produces??o.produces??["application/json"];"object"!=typeof s.content&&(s.content={});for(const t of e)s.content[t]={schema:s.schema};delete s.schema}}delete o.produces,0===o.parameters?.length&&delete o.parameters}}return t}export{t as upgradeFromTwoToThree};
|
package/dist/utils/validate.d.ts
CHANGED
|
@@ -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?:
|
|
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":"
|
|
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
|
@@ -1,6 +1,15 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@scalar/openapi-parser",
|
|
3
3
|
"description": "modern OpenAPI parser written in TypeScript",
|
|
4
|
+
"license": "MIT",
|
|
5
|
+
"author": "Scalar (https://github.com/scalar)",
|
|
6
|
+
"homepage": "https://github.com/scalar/scalar",
|
|
7
|
+
"bugs": "https://github.com/scalar/scalar/issues/new/choose",
|
|
8
|
+
"repository": {
|
|
9
|
+
"type": "git",
|
|
10
|
+
"url": "https://github.com/scalar/scalar.git",
|
|
11
|
+
"directory": "packages/openapi-parser"
|
|
12
|
+
},
|
|
4
13
|
"keywords": [
|
|
5
14
|
"openapi",
|
|
6
15
|
"scalar",
|
|
@@ -8,22 +17,12 @@
|
|
|
8
17
|
"parser",
|
|
9
18
|
"typescript"
|
|
10
19
|
],
|
|
11
|
-
"
|
|
12
|
-
"author": "Scalar (https://github.com/scalar)",
|
|
13
|
-
"homepage": "https://github.com/scalar/scalar",
|
|
14
|
-
"bugs": "https://github.com/scalar/scalar/issues/new/choose",
|
|
15
|
-
"version": "0.7.2",
|
|
20
|
+
"version": "0.8.2",
|
|
16
21
|
"engines": {
|
|
17
22
|
"node": ">=18"
|
|
18
23
|
},
|
|
19
24
|
"type": "module",
|
|
20
|
-
"files": [
|
|
21
|
-
"dist",
|
|
22
|
-
"!dist/webpack-stats.json",
|
|
23
|
-
"CHANGELOG.md"
|
|
24
|
-
],
|
|
25
25
|
"main": "./dist/index.js",
|
|
26
|
-
"module": "./dist/index.js",
|
|
27
26
|
"types": "./dist/index.d.ts",
|
|
28
27
|
"exports": {
|
|
29
28
|
".": {
|
|
@@ -36,40 +35,45 @@
|
|
|
36
35
|
"import": "./dist/utils/load/plugins/readFiles.js"
|
|
37
36
|
}
|
|
38
37
|
},
|
|
38
|
+
"files": [
|
|
39
|
+
"dist",
|
|
40
|
+
"CHANGELOG.md"
|
|
41
|
+
],
|
|
42
|
+
"module": "./dist/index.js",
|
|
39
43
|
"sideEffects": false,
|
|
40
|
-
"
|
|
41
|
-
"
|
|
42
|
-
"
|
|
43
|
-
"
|
|
44
|
+
"dependencies": {
|
|
45
|
+
"ajv": "^8.17.1",
|
|
46
|
+
"ajv-draft-04": "^1.0.0",
|
|
47
|
+
"ajv-formats": "^3.0.1",
|
|
48
|
+
"jsonpointer": "^5.0.1",
|
|
49
|
+
"leven": "^4.0.0",
|
|
50
|
+
"yaml": "^2.4.5"
|
|
44
51
|
},
|
|
45
52
|
"devDependencies": {
|
|
46
53
|
"@apidevtools/swagger-parser": "^10.1.0",
|
|
54
|
+
"@babel/code-frame": "^7.24.7",
|
|
55
|
+
"@google-cloud/storage": "^7.12.1",
|
|
47
56
|
"@rollup/plugin-json": "^6.1.0",
|
|
48
57
|
"@rollup/plugin-terser": "^0.4.4",
|
|
49
58
|
"@rollup/plugin-typescript": "^11.1.6",
|
|
50
|
-
"@types/node": "^20.14.
|
|
51
|
-
"glob": "^10.
|
|
59
|
+
"@types/node": "^20.14.10",
|
|
60
|
+
"glob": "^10.3.10",
|
|
61
|
+
"json-to-ast": "^2.1.0",
|
|
52
62
|
"just-diff": "^6.0.2",
|
|
53
|
-
"rollup": "^4.
|
|
54
|
-
"rollup-plugin-output-size": "^1.4.
|
|
55
|
-
"rollup-plugin-webpack-stats": "^1.0.1",
|
|
63
|
+
"rollup": "^4.16.4",
|
|
64
|
+
"rollup-plugin-output-size": "^1.4.1",
|
|
56
65
|
"tinybench": "^2.8.0",
|
|
57
|
-
"
|
|
58
|
-
"tslib": "^2.6.3",
|
|
59
|
-
"typescript": "^5.5.3"
|
|
60
|
-
},
|
|
61
|
-
"dependencies": {
|
|
62
|
-
"ajv": "^8.16.0",
|
|
63
|
-
"ajv-draft-04": "^1.0.0",
|
|
64
|
-
"ajv-formats": "^3.0.1",
|
|
65
|
-
"jsonpointer": "^5.0.1",
|
|
66
|
-
"leven": "^4.0.0",
|
|
67
|
-
"yaml": "^2.4.5"
|
|
66
|
+
"@scalar/openapi-types": "0.1.1"
|
|
68
67
|
},
|
|
69
68
|
"scripts": {
|
|
70
|
-
"types:check": "tsc --noEmit --skipLibCheck",
|
|
71
69
|
"build": "pnpm types:check && rollup -c --configPlugin typescript && pnpm types:build",
|
|
70
|
+
"format": "prettier --write .",
|
|
71
|
+
"lint:check": "eslint .",
|
|
72
|
+
"lint:fix": "eslint . --fix",
|
|
73
|
+
"test": "vitest",
|
|
74
|
+
"test:prepare": "vite-node scripts/load-files.ts",
|
|
75
|
+
"test:unit": "vite-node scripts/load-files.ts && vitest",
|
|
72
76
|
"types:build": "tsc -p tsconfig.build.json && tsc-alias -p tsconfig.build.json",
|
|
73
|
-
"
|
|
77
|
+
"types:check": "tsc --noEmit --skipLibCheck"
|
|
74
78
|
}
|
|
75
79
|
}
|