@speclynx/apidom-parser-adapter-asyncapi-json-2 1.12.1 → 2.0.1
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 +18 -0
- package/NOTICE +16 -7
- package/dist/167.apidom-parser-adapter-asyncapi-json-2.browser.min.js +1 -1
- package/dist/451.apidom-parser-adapter-asyncapi-json-2.browser.min.js +1 -1
- package/dist/apidom-parser-adapter-asyncapi-json-2.browser.js +9544 -15118
- package/dist/apidom-parser-adapter-asyncapi-json-2.browser.min.js +1 -1
- package/package.json +6 -6
- package/src/adapter.cjs +3 -3
- package/src/adapter.mjs +4 -4
- package/types/apidom-parser-adapter-asyncapi-json-2.d.ts +2 -2
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@speclynx/apidom-parser-adapter-asyncapi-json-2",
|
|
3
|
-
"version": "
|
|
3
|
+
"version": "2.0.1",
|
|
4
4
|
"description": "Parser adapter for parsing JSON documents into AsyncAPI 2.x.y namespace.",
|
|
5
5
|
"publishConfig": {
|
|
6
6
|
"access": "public",
|
|
@@ -44,10 +44,10 @@
|
|
|
44
44
|
"license": "Apache-2.0",
|
|
45
45
|
"dependencies": {
|
|
46
46
|
"@babel/runtime-corejs3": "^7.28.4",
|
|
47
|
-
"@speclynx/apidom-core": "^
|
|
48
|
-
"@speclynx/apidom-
|
|
49
|
-
"@speclynx/apidom-
|
|
50
|
-
"@
|
|
47
|
+
"@speclynx/apidom-core": "^2.0.1",
|
|
48
|
+
"@speclynx/apidom-datamodel": "^2.0.1",
|
|
49
|
+
"@speclynx/apidom-ns-asyncapi-2": "^2.0.1",
|
|
50
|
+
"@speclynx/apidom-parser-adapter-json": "^2.0.1",
|
|
51
51
|
"ramda": "~0.32.0",
|
|
52
52
|
"ramda-adjunct": "^6.0.0"
|
|
53
53
|
},
|
|
@@ -61,5 +61,5 @@
|
|
|
61
61
|
"README.md",
|
|
62
62
|
"CHANGELOG.md"
|
|
63
63
|
],
|
|
64
|
-
"gitHead": "
|
|
64
|
+
"gitHead": "6a9caf87f445f76ffd69afa760990ffa784bc82d"
|
|
65
65
|
}
|
package/src/adapter.cjs
CHANGED
|
@@ -6,7 +6,7 @@ exports.__esModule = true;
|
|
|
6
6
|
exports.parse = exports.namespace = exports.mediaTypes = exports.detectionRegExp = exports.detect = void 0;
|
|
7
7
|
var _ramda = require("ramda");
|
|
8
8
|
var _ramdaAdjunct = require("ramda-adjunct");
|
|
9
|
-
var
|
|
9
|
+
var _apidomDatamodel = require("@speclynx/apidom-datamodel");
|
|
10
10
|
var _apidomParserAdapterJson = require("@speclynx/apidom-parser-adapter-json");
|
|
11
11
|
var _apidomNsAsyncapi = _interopRequireWildcard(require("@speclynx/apidom-ns-asyncapi-2"));
|
|
12
12
|
var _mediaTypes = _interopRequireDefault(require("./media-types.cjs"));
|
|
@@ -33,7 +33,7 @@ const parse = async (source, options = {}) => {
|
|
|
33
33
|
result
|
|
34
34
|
} = parseResultElement;
|
|
35
35
|
if ((0, _ramdaAdjunct.isNotUndefined)(result)) {
|
|
36
|
-
const asyncApiElement = _apidomNsAsyncapi.
|
|
36
|
+
const asyncApiElement = (0, _apidomNsAsyncapi.refractAsyncApi2)(result, refractorOpts);
|
|
37
37
|
asyncApiElement.classes.push('result');
|
|
38
38
|
parseResultElement.replaceResult(asyncApiElement);
|
|
39
39
|
}
|
|
@@ -44,4 +44,4 @@ const parse = async (source, options = {}) => {
|
|
|
44
44
|
* @public
|
|
45
45
|
*/
|
|
46
46
|
exports.parse = parse;
|
|
47
|
-
const namespace = exports.namespace =
|
|
47
|
+
const namespace = exports.namespace = new _apidomDatamodel.Namespace().use(_apidomNsAsyncapi.default);
|
package/src/adapter.mjs
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import { propOr, omit } from 'ramda';
|
|
2
2
|
import { isNotUndefined } from 'ramda-adjunct';
|
|
3
|
-
import {
|
|
3
|
+
import { Namespace } from '@speclynx/apidom-datamodel';
|
|
4
4
|
import { parse as parseJSON, detect as detectJSON } from '@speclynx/apidom-parser-adapter-json';
|
|
5
|
-
import
|
|
5
|
+
import asyncApiNamespacePlugin, { refractAsyncApi2 } from '@speclynx/apidom-ns-asyncapi-2';
|
|
6
6
|
export { default as mediaTypes } from "./media-types.mjs";
|
|
7
7
|
/**
|
|
8
8
|
* @public
|
|
@@ -25,7 +25,7 @@ export const parse = async (source, options = {}) => {
|
|
|
25
25
|
result
|
|
26
26
|
} = parseResultElement;
|
|
27
27
|
if (isNotUndefined(result)) {
|
|
28
|
-
const asyncApiElement =
|
|
28
|
+
const asyncApiElement = refractAsyncApi2(result, refractorOpts);
|
|
29
29
|
asyncApiElement.classes.push('result');
|
|
30
30
|
parseResultElement.replaceResult(asyncApiElement);
|
|
31
31
|
}
|
|
@@ -35,4 +35,4 @@ export const parse = async (source, options = {}) => {
|
|
|
35
35
|
/**
|
|
36
36
|
* @public
|
|
37
37
|
*/
|
|
38
|
-
export const namespace =
|
|
38
|
+
export const namespace = new Namespace().use(asyncApiNamespacePlugin);
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { AsyncAPIMediaTypes } from '@speclynx/apidom-ns-asyncapi-2';
|
|
2
|
-
import { Namespace } from '@speclynx/apidom-
|
|
3
|
-
import { ParseResultElement } from '@speclynx/apidom-
|
|
2
|
+
import { Namespace } from '@speclynx/apidom-datamodel';
|
|
3
|
+
import { ParseResultElement } from '@speclynx/apidom-datamodel';
|
|
4
4
|
|
|
5
5
|
/**
|
|
6
6
|
* @public
|