@swagger-api/apidom-parser-adapter-openapi-yaml-3-1 1.0.0-alpha.8 → 1.0.0-beta.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +12 -0
- package/dist/20cf92ce276cf3be872fb26fd7985dd3.wasm +0 -0
- package/dist/apidom-parser-adapter-openapi-yaml-3-1.browser.js +5580 -1720
- package/dist/apidom-parser-adapter-openapi-yaml-3-1.browser.min.js +1 -1
- package/dist/fcc2efc64ace4e98eaa856cf3b3edf1f.wasm +0 -0
- package/package.json +24 -24
- package/{cjs → src}/adapter.cjs +15 -0
- package/{es → src}/adapter.mjs +15 -0
- package/{cjs → src}/media-types.cjs +3 -0
- package/{es → src}/media-types.mjs +4 -0
- package/types/apidom-parser-adapter-openapi-yaml-3-1.d.ts +30 -0
- package/dist/23aac571c96605dc25219087ad291441.wasm +0 -0
- package/dist/d396281e11774e0afa7a40d620779b6d.wasm +0 -0
- package/types/dist.d.ts +0 -12
|
Binary file
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@swagger-api/apidom-parser-adapter-openapi-yaml-3-1",
|
|
3
|
-
"version": "1.0.0-
|
|
3
|
+
"version": "1.0.0-beta.0",
|
|
4
4
|
"description": "Parser adapter for parsing YAML documents into OpenAPI 3.1.x namespace.",
|
|
5
5
|
"publishConfig": {
|
|
6
6
|
"access": "public",
|
|
@@ -9,29 +9,29 @@
|
|
|
9
9
|
"type": "module",
|
|
10
10
|
"sideEffects": false,
|
|
11
11
|
"unpkg": "./dist/apidom-parser-apdater-openapi-yaml-3-1.browser.min.js",
|
|
12
|
-
"main": "./
|
|
12
|
+
"main": "./src/adapter.cjs",
|
|
13
13
|
"exports": {
|
|
14
|
-
"types": "./types/
|
|
15
|
-
"import": "./
|
|
16
|
-
"require": "./
|
|
14
|
+
"types": "./types/apidom-parser-adapter-openapi-yaml-3-1.d.ts",
|
|
15
|
+
"import": "./src/adapter.mjs",
|
|
16
|
+
"require": "./src/adapter.cjs"
|
|
17
17
|
},
|
|
18
|
-
"types": "./types/
|
|
18
|
+
"types": "./types/apidom-parser-adapter-openapi-yaml-3-1.d.ts",
|
|
19
19
|
"scripts": {
|
|
20
20
|
"build": "npm run clean && run-p --max-parallel ${CPU_CORES:-2} typescript:declaration build:es build:cjs build:umd:browser",
|
|
21
|
-
"build:es": "cross-env BABEL_ENV=es babel src --out-dir
|
|
22
|
-
"build:cjs": "cross-env BABEL_ENV=cjs babel src --out-dir
|
|
21
|
+
"build:es": "cross-env BABEL_ENV=es babel src --out-dir src --extensions '.ts' --out-file-extension '.mjs' --root-mode 'upward'",
|
|
22
|
+
"build:cjs": "cross-env BABEL_ENV=cjs babel src --out-dir src --extensions '.ts' --out-file-extension '.cjs' --root-mode 'upward'",
|
|
23
23
|
"build:umd:browser": "cross-env BABEL_ENV=browser webpack --config config/webpack/browser.config.js --progress",
|
|
24
24
|
"lint": "eslint ./",
|
|
25
25
|
"lint:fix": "eslint ./ --fix",
|
|
26
|
-
"clean": "rimraf
|
|
27
|
-
"typescript:check-types": "tsc --noEmit",
|
|
28
|
-
"typescript:declaration": "tsc -p declaration.
|
|
29
|
-
"test": "cross-env
|
|
30
|
-
"perf": "cross-env
|
|
31
|
-
"perf:lexical-analysis": "cross-env
|
|
32
|
-
"perf:syntactic-analysis": "cross-env
|
|
33
|
-
"perf:refract": "cross-env
|
|
34
|
-
"perf:parse": "cross-env
|
|
26
|
+
"clean": "rimraf --glob 'src/**/*.mjs' 'src/**/*.cjs' 'test/**/*.mjs' ./dist ./types",
|
|
27
|
+
"typescript:check-types": "tsc --noEmit && tsc -p ./test/tsconfig.json --noEmit",
|
|
28
|
+
"typescript:declaration": "tsc -p tsconfig.declaration.json && api-extractor run -l -c ./config/api-extractor/api-extractor.json",
|
|
29
|
+
"test": "npm run build:es && cross-env BABEL_ENV=es babel test --out-dir test --extensions '.ts' --out-file-extension '.mjs' --root-mode 'upward' && cross-env NODE_ENV=test mocha",
|
|
30
|
+
"perf": "cross-env BABEL_ENV=es babel ./test/perf/index.ts --out-file ./test/perf/index.mjs --root-mode 'upward' && cross-env NODE_ENV=test node ./test/perf/index.mjs",
|
|
31
|
+
"perf:lexical-analysis": "cross-env BABEL_ENV=es babel ./test/perf/lexical-analysis.ts --out-file ./test/perf/lexical-analysis.mjs --root-mode 'upward' && cross-env NODE_ENV=test node ./test/perf/lexical-analysis.mjs",
|
|
32
|
+
"perf:syntactic-analysis": "cross-env BABEL_ENV=es babel ./test/perf/syntactic-analysis.ts --out-file ./test/perf/syntactic-analysis.mjs --root-mode 'upward' && cross-env NODE_ENV=test node ./test/perf/syntactic-analysis.mjs",
|
|
33
|
+
"perf:refract": "cross-env BABEL_ENV=es babel ./test/perf/refract.ts --out-file ./test/perf/refract.mjs --root-mode 'upward' && cross-env NODE_ENV=test node ./test/perf/refract.mjs",
|
|
34
|
+
"perf:parse": "cross-env BABEL_ENV=es babel ./test/perf/parse.ts --out-file ./test/perf/parse.mjs --root-mode 'upward' && cross-env NODE_ENV=test node ./test/perf/parse.mjs",
|
|
35
35
|
"prepack": "copyfiles -u 3 ../../LICENSES/* LICENSES && copyfiles -u 2 ../../NOTICE .",
|
|
36
36
|
"postpack": "rimraf NOTICE LICENSES"
|
|
37
37
|
},
|
|
@@ -43,22 +43,22 @@
|
|
|
43
43
|
"license": "Apache-2.0",
|
|
44
44
|
"dependencies": {
|
|
45
45
|
"@babel/runtime-corejs3": "^7.20.7",
|
|
46
|
-
"@swagger-api/apidom-core": "^1.0.0-
|
|
47
|
-
"@swagger-api/apidom-ns-openapi-3-1": "^1.0.0-
|
|
48
|
-
"@swagger-api/apidom-parser-adapter-yaml-1-2": "^1.0.0-
|
|
46
|
+
"@swagger-api/apidom-core": "^1.0.0-beta.0",
|
|
47
|
+
"@swagger-api/apidom-ns-openapi-3-1": "^1.0.0-beta.0",
|
|
48
|
+
"@swagger-api/apidom-parser-adapter-yaml-1-2": "^1.0.0-beta.0",
|
|
49
49
|
"@types/ramda": "~0.30.0",
|
|
50
50
|
"ramda": "~0.30.0",
|
|
51
51
|
"ramda-adjunct": "^5.0.0"
|
|
52
52
|
},
|
|
53
53
|
"files": [
|
|
54
|
-
"
|
|
54
|
+
"src/**/*.mjs",
|
|
55
|
+
"src/**/*.cjs",
|
|
55
56
|
"dist/",
|
|
56
|
-
"
|
|
57
|
-
"types/dist.d.ts",
|
|
57
|
+
"types/apidom-parser-adapter-openapi-yaml-3-1.d.ts",
|
|
58
58
|
"LICENSES",
|
|
59
59
|
"NOTICE",
|
|
60
60
|
"README.md",
|
|
61
61
|
"CHANGELOG.md"
|
|
62
62
|
],
|
|
63
|
-
"gitHead": "
|
|
63
|
+
"gitHead": "ed1426743ba9d9d581146e617ec1762df670320c"
|
|
64
64
|
}
|
package/{cjs → src}/adapter.cjs
RENAMED
|
@@ -11,8 +11,19 @@ var _apidomParserAdapterYaml = require("@swagger-api/apidom-parser-adapter-yaml-
|
|
|
11
11
|
var _apidomNsOpenapi = _interopRequireWildcard(require("@swagger-api/apidom-ns-openapi-3-1"));
|
|
12
12
|
var _mediaTypes = _interopRequireDefault(require("./media-types.cjs"));
|
|
13
13
|
exports.mediaTypes = _mediaTypes.default;
|
|
14
|
+
/**
|
|
15
|
+
* @public
|
|
16
|
+
*/
|
|
14
17
|
const detectionRegExp = exports.detectionRegExp = /(?<YAML>^(["']?)openapi\2\s*:\s*(["']?)(?<version_yaml>3\.1\.(?:[1-9]\d*|0))\3(?:\s+|$))|(?<JSON>"openapi"\s*:\s*"(?<version_json>3\.1\.(?:[1-9]\d*|0))")/m;
|
|
18
|
+
|
|
19
|
+
/**
|
|
20
|
+
* @public
|
|
21
|
+
*/
|
|
15
22
|
const detect = async source => detectionRegExp.test(source) && (await (0, _apidomParserAdapterYaml.detect)(source));
|
|
23
|
+
|
|
24
|
+
/**
|
|
25
|
+
* @public
|
|
26
|
+
*/
|
|
16
27
|
exports.detect = detect;
|
|
17
28
|
const parse = async (source, options = {}) => {
|
|
18
29
|
const refractorOpts = (0, _ramda.propOr)({}, 'refractorOpts', options);
|
|
@@ -28,5 +39,9 @@ const parse = async (source, options = {}) => {
|
|
|
28
39
|
}
|
|
29
40
|
return parseResultElement;
|
|
30
41
|
};
|
|
42
|
+
|
|
43
|
+
/**
|
|
44
|
+
* @public
|
|
45
|
+
*/
|
|
31
46
|
exports.parse = parse;
|
|
32
47
|
const namespace = exports.namespace = (0, _apidomCore.createNamespace)(_apidomNsOpenapi.default);
|
package/{es → src}/adapter.mjs
RENAMED
|
@@ -4,8 +4,19 @@ import { createNamespace } from '@swagger-api/apidom-core';
|
|
|
4
4
|
import { parse as parseYAML, detect as detectYAML } from '@swagger-api/apidom-parser-adapter-yaml-1-2';
|
|
5
5
|
import openApiNamespace, { OpenApi3_1Element } from '@swagger-api/apidom-ns-openapi-3-1';
|
|
6
6
|
export { default as mediaTypes } from "./media-types.mjs";
|
|
7
|
+
/**
|
|
8
|
+
* @public
|
|
9
|
+
*/
|
|
7
10
|
export const detectionRegExp = /(?<YAML>^(["']?)openapi\2\s*:\s*(["']?)(?<version_yaml>3\.1\.(?:[1-9]\d*|0))\3(?:\s+|$))|(?<JSON>"openapi"\s*:\s*"(?<version_json>3\.1\.(?:[1-9]\d*|0))")/m;
|
|
11
|
+
|
|
12
|
+
/**
|
|
13
|
+
* @public
|
|
14
|
+
*/
|
|
8
15
|
export const detect = async source => detectionRegExp.test(source) && (await detectYAML(source));
|
|
16
|
+
|
|
17
|
+
/**
|
|
18
|
+
* @public
|
|
19
|
+
*/
|
|
9
20
|
export const parse = async (source, options = {}) => {
|
|
10
21
|
const refractorOpts = propOr({}, 'refractorOpts', options);
|
|
11
22
|
const parserOpts = omit(['refractorOpts'], options);
|
|
@@ -20,4 +31,8 @@ export const parse = async (source, options = {}) => {
|
|
|
20
31
|
}
|
|
21
32
|
return parseResultElement;
|
|
22
33
|
};
|
|
34
|
+
|
|
35
|
+
/**
|
|
36
|
+
* @public
|
|
37
|
+
*/
|
|
23
38
|
export const namespace = createNamespace(openApiNamespace);
|
|
@@ -3,5 +3,8 @@
|
|
|
3
3
|
exports.__esModule = true;
|
|
4
4
|
exports.default = void 0;
|
|
5
5
|
var _apidomNsOpenapi = require("@swagger-api/apidom-ns-openapi-3-1");
|
|
6
|
+
/**
|
|
7
|
+
* @public
|
|
8
|
+
*/
|
|
6
9
|
const yamlMediaTypes = new _apidomNsOpenapi.OpenAPIMediaTypes(..._apidomNsOpenapi.mediaTypes.filterByFormat('generic'), ..._apidomNsOpenapi.mediaTypes.filterByFormat('yaml'));
|
|
7
10
|
var _default = exports.default = yamlMediaTypes;
|
|
@@ -1,3 +1,7 @@
|
|
|
1
1
|
import { mediaTypes, OpenAPIMediaTypes } from '@swagger-api/apidom-ns-openapi-3-1';
|
|
2
|
+
|
|
3
|
+
/**
|
|
4
|
+
* @public
|
|
5
|
+
*/
|
|
2
6
|
const yamlMediaTypes = new OpenAPIMediaTypes(...mediaTypes.filterByFormat('generic'), ...mediaTypes.filterByFormat('yaml'));
|
|
3
7
|
export default yamlMediaTypes;
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
import { Namespace } from '@swagger-api/apidom-core';
|
|
2
|
+
import { OpenAPIMediaTypes } from '@swagger-api/apidom-ns-openapi-3-1';
|
|
3
|
+
import { ParseResultElement } from '@swagger-api/apidom-core';
|
|
4
|
+
|
|
5
|
+
/**
|
|
6
|
+
* @public
|
|
7
|
+
*/
|
|
8
|
+
export declare const detect: (source: string) => Promise<boolean>;
|
|
9
|
+
|
|
10
|
+
/**
|
|
11
|
+
* @public
|
|
12
|
+
*/
|
|
13
|
+
export declare const detectionRegExp: RegExp;
|
|
14
|
+
|
|
15
|
+
/**
|
|
16
|
+
* @public
|
|
17
|
+
*/
|
|
18
|
+
export declare const mediaTypes: OpenAPIMediaTypes;
|
|
19
|
+
|
|
20
|
+
/**
|
|
21
|
+
* @public
|
|
22
|
+
*/
|
|
23
|
+
export declare const namespace: Namespace;
|
|
24
|
+
|
|
25
|
+
/**
|
|
26
|
+
* @public
|
|
27
|
+
*/
|
|
28
|
+
export declare const parse: (source: string, options?: Record<string, unknown>) => Promise<ParseResultElement>;
|
|
29
|
+
|
|
30
|
+
export { }
|
|
Binary file
|
|
Binary file
|
package/types/dist.d.ts
DELETED
|
@@ -1,12 +0,0 @@
|
|
|
1
|
-
import * as _swagger_api_apidom_core from '@swagger-api/apidom-core';
|
|
2
|
-
import { ParseResultElement } from '@swagger-api/apidom-core';
|
|
3
|
-
import { OpenAPIMediaTypes } from '@swagger-api/apidom-ns-openapi-3-1';
|
|
4
|
-
|
|
5
|
-
declare const yamlMediaTypes: OpenAPIMediaTypes;
|
|
6
|
-
|
|
7
|
-
declare const detectionRegExp: RegExp;
|
|
8
|
-
declare const detect: (source: string) => Promise<boolean>;
|
|
9
|
-
declare const parse: (source: string, options?: Record<string, unknown>) => Promise<ParseResultElement>;
|
|
10
|
-
declare const namespace: _swagger_api_apidom_core.Namespace;
|
|
11
|
-
|
|
12
|
-
export { detect, detectionRegExp, yamlMediaTypes as mediaTypes, namespace, parse };
|