@speclynx/apidom-reference 1.12.2 → 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.
Files changed (112) hide show
  1. package/CHANGELOG.md +21 -0
  2. package/NOTICE +16 -7
  3. package/README.md +0 -33
  4. package/dist/167.apidom-reference.browser.min.js +1 -1
  5. package/dist/451.apidom-reference.browser.min.js +1 -1
  6. package/dist/apidom-reference.browser.js +24594 -23365
  7. package/dist/apidom-reference.browser.min.js +1 -1
  8. package/package.json +24 -57
  9. package/src/configuration/saturated.cjs +34 -42
  10. package/src/configuration/saturated.mjs +0 -8
  11. package/src/dereference/index.cjs +4 -4
  12. package/src/dereference/index.mjs +1 -1
  13. package/src/dereference/strategies/apidom/index.cjs +7 -7
  14. package/src/dereference/strategies/apidom/index.mjs +5 -6
  15. package/src/dereference/strategies/apidom/selectors/element-id.cjs +4 -2
  16. package/src/dereference/strategies/apidom/selectors/element-id.mjs +5 -3
  17. package/src/dereference/strategies/apidom/visitor.cjs +31 -17
  18. package/src/dereference/strategies/apidom/visitor.mjs +25 -12
  19. package/src/dereference/strategies/asyncapi-2/index.cjs +6 -9
  20. package/src/dereference/strategies/asyncapi-2/index.mjs +6 -10
  21. package/src/dereference/strategies/asyncapi-2/visitor.cjs +67 -80
  22. package/src/dereference/strategies/asyncapi-2/visitor.mjs +59 -72
  23. package/src/dereference/strategies/openapi-2/index.cjs +6 -9
  24. package/src/dereference/strategies/openapi-2/index.mjs +6 -10
  25. package/src/dereference/strategies/openapi-2/visitor.cjs +91 -100
  26. package/src/dereference/strategies/openapi-2/visitor.mjs +81 -90
  27. package/src/dereference/strategies/openapi-3-0/index.cjs +6 -9
  28. package/src/dereference/strategies/openapi-3-0/index.mjs +6 -10
  29. package/src/dereference/strategies/openapi-3-0/visitor.cjs +92 -115
  30. package/src/dereference/strategies/openapi-3-0/visitor.mjs +74 -97
  31. package/src/dereference/strategies/openapi-3-1/index.cjs +6 -9
  32. package/src/dereference/strategies/openapi-3-1/index.mjs +6 -10
  33. package/src/dereference/strategies/openapi-3-1/selectors/$anchor.cjs +2 -1
  34. package/src/dereference/strategies/openapi-3-1/selectors/$anchor.mjs +3 -2
  35. package/src/dereference/strategies/openapi-3-1/selectors/uri.cjs +2 -2
  36. package/src/dereference/strategies/openapi-3-1/selectors/uri.mjs +2 -2
  37. package/src/dereference/strategies/openapi-3-1/util.cjs +3 -2
  38. package/src/dereference/strategies/openapi-3-1/util.mjs +4 -3
  39. package/src/dereference/strategies/openapi-3-1/visitor.cjs +130 -156
  40. package/src/dereference/strategies/openapi-3-1/visitor.mjs +106 -132
  41. package/src/dereference/util.cjs +2 -2
  42. package/src/dereference/util.mjs +1 -1
  43. package/src/parse/parsers/apidom-json/index.cjs +5 -5
  44. package/src/parse/parsers/apidom-json/index.mjs +2 -2
  45. package/src/parse/parsers/arazzo-json-1/index.cjs +1 -2
  46. package/src/parse/parsers/arazzo-json-1/index.mjs +1 -2
  47. package/src/parse/parsers/asyncapi-json-2/index.cjs +1 -2
  48. package/src/parse/parsers/asyncapi-json-2/index.mjs +1 -2
  49. package/src/parse/parsers/binary/index-browser.cjs +3 -3
  50. package/src/parse/parsers/binary/index-browser.mjs +1 -1
  51. package/src/parse/parsers/binary/index-node.cjs +3 -3
  52. package/src/parse/parsers/binary/index-node.mjs +1 -1
  53. package/src/parse/parsers/json/index.cjs +1 -2
  54. package/src/parse/parsers/json/index.mjs +1 -2
  55. package/src/parse/parsers/openapi-json-2/index.cjs +1 -2
  56. package/src/parse/parsers/openapi-json-2/index.mjs +1 -2
  57. package/src/parse/parsers/openapi-json-3-0/index.cjs +1 -2
  58. package/src/parse/parsers/openapi-json-3-0/index.mjs +1 -2
  59. package/src/parse/parsers/openapi-json-3-1/index.cjs +1 -2
  60. package/src/parse/parsers/openapi-json-3-1/index.mjs +1 -2
  61. package/src/resolve/index.cjs +4 -4
  62. package/src/resolve/index.mjs +1 -1
  63. package/types/File.d.ts +1 -1
  64. package/types/Reference.d.ts +1 -1
  65. package/types/ReferenceSet.d.ts +1 -1
  66. package/types/apidom-reference.d.ts +8 -9
  67. package/types/bundle/index.d.ts +1 -1
  68. package/types/bundle/strategies/BundleStrategy.d.ts +1 -1
  69. package/types/bundle/strategies/openapi-3-1/index.d.ts +1 -1
  70. package/types/dereference/index.d.ts +1 -1
  71. package/types/dereference/strategies/DereferenceStrategy.d.ts +1 -1
  72. package/types/dereference/strategies/apidom/index.d.ts +1 -1
  73. package/types/dereference/strategies/apidom/selectors/element-id.d.ts +1 -1
  74. package/types/dereference/strategies/apidom/visitor.d.ts +3 -2
  75. package/types/dereference/strategies/asyncapi-2/index.d.ts +2 -2
  76. package/types/dereference/strategies/asyncapi-2/visitor.d.ts +5 -14
  77. package/types/dereference/strategies/openapi-2/index.d.ts +2 -2
  78. package/types/dereference/strategies/openapi-2/visitor.d.ts +6 -17
  79. package/types/dereference/strategies/openapi-3-0/index.d.ts +2 -2
  80. package/types/dereference/strategies/openapi-3-0/visitor.d.ts +7 -20
  81. package/types/dereference/strategies/openapi-3-1/index.d.ts +2 -2
  82. package/types/dereference/strategies/openapi-3-1/selectors/$anchor.d.ts +1 -1
  83. package/types/dereference/strategies/openapi-3-1/selectors/uri.d.ts +1 -1
  84. package/types/dereference/strategies/openapi-3-1/util.d.ts +1 -1
  85. package/types/dereference/strategies/openapi-3-1/visitor.d.ts +8 -23
  86. package/types/dereference/util.d.ts +1 -1
  87. package/types/index.d.ts +1 -1
  88. package/types/options/index.d.ts +1 -1
  89. package/types/parse/index.d.ts +1 -1
  90. package/types/parse/parsers/Parser.d.ts +1 -1
  91. package/types/parse/parsers/apidom-json/index.d.ts +1 -1
  92. package/types/parse/parsers/arazzo-json-1/index.d.ts +1 -2
  93. package/types/parse/parsers/arazzo-yaml-1/index.d.ts +1 -1
  94. package/types/parse/parsers/asyncapi-json-2/index.d.ts +1 -2
  95. package/types/parse/parsers/asyncapi-yaml-2/index.d.ts +1 -1
  96. package/types/parse/parsers/binary/index-browser.d.ts +1 -1
  97. package/types/parse/parsers/binary/index-node.d.ts +1 -1
  98. package/types/parse/parsers/json/index.d.ts +1 -2
  99. package/types/parse/parsers/openapi-json-2/index.d.ts +1 -2
  100. package/types/parse/parsers/openapi-json-3-0/index.d.ts +1 -2
  101. package/types/parse/parsers/openapi-json-3-1/index.d.ts +1 -2
  102. package/types/parse/parsers/openapi-yaml-2/index.d.ts +1 -1
  103. package/types/parse/parsers/openapi-yaml-3-0/index.d.ts +1 -1
  104. package/types/parse/parsers/openapi-yaml-3-1/index.d.ts +1 -1
  105. package/types/parse/parsers/yaml-1-2/index.d.ts +1 -1
  106. package/types/resolve/index.d.ts +1 -1
  107. package/src/parse/parsers/api-design-systems-json/index.cjs +0 -55
  108. package/src/parse/parsers/api-design-systems-json/index.mjs +0 -49
  109. package/src/parse/parsers/api-design-systems-yaml/index.cjs +0 -54
  110. package/src/parse/parsers/api-design-systems-yaml/index.mjs +0 -48
  111. package/types/parse/parsers/api-design-systems-json/index.d.ts +0 -21
  112. package/types/parse/parsers/api-design-systems-yaml/index.d.ts +0 -20
@@ -9,7 +9,6 @@ import Parser from "../Parser.mjs";
9
9
  * @public
10
10
  */
11
11
  class ArazzoJSON1Parser extends Parser {
12
- syntacticAnalysis;
13
12
  refractorOpts;
14
13
  constructor(options) {
15
14
  const {
@@ -37,7 +36,7 @@ class ArazzoJSON1Parser extends Parser {
37
36
  async parse(file) {
38
37
  const source = file.toString();
39
38
  try {
40
- const parserOpts = pick(['sourceMap', 'syntacticAnalysis', 'refractorOpts'], this);
39
+ const parserOpts = pick(['sourceMap', 'refractorOpts'], this);
41
40
  return await parse(source, parserOpts);
42
41
  } catch (error) {
43
42
  throw new ParserError(`Error parsing "${file.uri}"`, {
@@ -15,7 +15,6 @@ var _Parser = _interopRequireDefault(require("../Parser.cjs"));
15
15
  * @public
16
16
  */
17
17
  class AsyncAPIJSON2Parser extends _Parser.default {
18
- syntacticAnalysis;
19
18
  refractorOpts;
20
19
  constructor(options) {
21
20
  const {
@@ -43,7 +42,7 @@ class AsyncAPIJSON2Parser extends _Parser.default {
43
42
  async parse(file) {
44
43
  const source = file.toString();
45
44
  try {
46
- const parserOpts = (0, _ramda.pick)(['sourceMap', 'syntacticAnalysis', 'refractorOpts'], this);
45
+ const parserOpts = (0, _ramda.pick)(['sourceMap', 'refractorOpts'], this);
47
46
  return await (0, _apidomParserAdapterAsyncapiJson.parse)(source, parserOpts);
48
47
  } catch (error) {
49
48
  throw new _ParserError.default(`Error parsing "${file.uri}"`, {
@@ -9,7 +9,6 @@ import Parser from "../Parser.mjs";
9
9
  * @public
10
10
  */
11
11
  class AsyncAPIJSON2Parser extends Parser {
12
- syntacticAnalysis;
13
12
  refractorOpts;
14
13
  constructor(options) {
15
14
  const {
@@ -37,7 +36,7 @@ class AsyncAPIJSON2Parser extends Parser {
37
36
  async parse(file) {
38
37
  const source = file.toString();
39
38
  try {
40
- const parserOpts = pick(['sourceMap', 'syntacticAnalysis', 'refractorOpts'], this);
39
+ const parserOpts = pick(['sourceMap', 'refractorOpts'], this);
41
40
  return await parse(source, parserOpts);
42
41
  } catch (error) {
43
42
  throw new ParserError(`Error parsing "${file.uri}"`, {
@@ -3,7 +3,7 @@
3
3
  var _interopRequireDefault = require("@babel/runtime-corejs3/helpers/interopRequireDefault").default;
4
4
  exports.__esModule = true;
5
5
  exports.default = void 0;
6
- var _apidomCore = require("@speclynx/apidom-core");
6
+ var _apidomDatamodel = require("@speclynx/apidom-datamodel");
7
7
  var _ParserError = _interopRequireDefault(require("../../../errors/ParserError.cjs"));
8
8
  var _Parser = _interopRequireDefault(require("../Parser.cjs"));
9
9
  /**
@@ -39,9 +39,9 @@ class BinaryParser extends _Parser.default {
39
39
  */
40
40
  const binaryString = unescape(encodeURIComponent(file.toString()));
41
41
  const base64String = btoa(binaryString);
42
- const parseResultElement = new _apidomCore.ParseResultElement();
42
+ const parseResultElement = new _apidomDatamodel.ParseResultElement();
43
43
  if (base64String.length !== 0) {
44
- const base64StringElement = new _apidomCore.StringElement(base64String);
44
+ const base64StringElement = new _apidomDatamodel.StringElement(base64String);
45
45
  base64StringElement.classes.push('result');
46
46
  parseResultElement.push(base64StringElement);
47
47
  }
@@ -1,4 +1,4 @@
1
- import { ParseResultElement, StringElement } from '@speclynx/apidom-core';
1
+ import { ParseResultElement, StringElement } from '@speclynx/apidom-datamodel';
2
2
  import ParserError from "../../../errors/ParserError.mjs";
3
3
  import Parser from "../Parser.mjs";
4
4
  /**
@@ -4,7 +4,7 @@ var _interopRequireDefault = require("@babel/runtime-corejs3/helpers/interopRequ
4
4
  exports.__esModule = true;
5
5
  exports.default = void 0;
6
6
  var _nodeBuffer = require("node:buffer");
7
- var _apidomCore = require("@speclynx/apidom-core");
7
+ var _apidomDatamodel = require("@speclynx/apidom-datamodel");
8
8
  var _ParserError = _interopRequireDefault(require("../../../errors/ParserError.cjs"));
9
9
  var _Parser = _interopRequireDefault(require("../Parser.cjs"));
10
10
  /**
@@ -34,9 +34,9 @@ class BinaryParser extends _Parser.default {
34
34
  base64String = _nodeBuffer.Buffer.from(file.toString()).toString('base64');
35
35
  }
36
36
  try {
37
- const parseResultElement = new _apidomCore.ParseResultElement();
37
+ const parseResultElement = new _apidomDatamodel.ParseResultElement();
38
38
  if (base64String.length !== 0) {
39
- const base64StringElement = new _apidomCore.StringElement(base64String);
39
+ const base64StringElement = new _apidomDatamodel.StringElement(base64String);
40
40
  base64StringElement.classes.push('result');
41
41
  parseResultElement.push(base64StringElement);
42
42
  }
@@ -1,5 +1,5 @@
1
1
  import { Buffer } from 'node:buffer';
2
- import { ParseResultElement, StringElement } from '@speclynx/apidom-core';
2
+ import { ParseResultElement, StringElement } from '@speclynx/apidom-datamodel';
3
3
  import ParserError from "../../../errors/ParserError.mjs";
4
4
  import Parser from "../Parser.mjs";
5
5
  /**
@@ -15,7 +15,6 @@ var _Parser = _interopRequireDefault(require("../Parser.cjs"));
15
15
  * @public
16
16
  */
17
17
  class JSONParser extends _Parser.default {
18
- syntacticAnalysis;
19
18
  constructor(options) {
20
19
  const {
21
20
  fileExtensions = [],
@@ -42,7 +41,7 @@ class JSONParser extends _Parser.default {
42
41
  async parse(file) {
43
42
  const source = file.toString();
44
43
  try {
45
- const parserOpts = (0, _ramda.pick)(['sourceMap', 'syntacticAnalysis'], this);
44
+ const parserOpts = (0, _ramda.pick)(['sourceMap'], this);
46
45
  return await (0, _apidomParserAdapterJson.parse)(source, parserOpts);
47
46
  } catch (error) {
48
47
  throw new _ParserError.default(`Error parsing "${file.uri}"`, {
@@ -9,7 +9,6 @@ import Parser from "../Parser.mjs";
9
9
  * @public
10
10
  */
11
11
  class JSONParser extends Parser {
12
- syntacticAnalysis;
13
12
  constructor(options) {
14
13
  const {
15
14
  fileExtensions = [],
@@ -36,7 +35,7 @@ class JSONParser extends Parser {
36
35
  async parse(file) {
37
36
  const source = file.toString();
38
37
  try {
39
- const parserOpts = pick(['sourceMap', 'syntacticAnalysis'], this);
38
+ const parserOpts = pick(['sourceMap'], this);
40
39
  return await parse(source, parserOpts);
41
40
  } catch (error) {
42
41
  throw new ParserError(`Error parsing "${file.uri}"`, {
@@ -15,7 +15,6 @@ var _Parser = _interopRequireDefault(require("../Parser.cjs"));
15
15
  * @public
16
16
  */
17
17
  class OpenAPIJSON2Parser extends _Parser.default {
18
- syntacticAnalysis;
19
18
  refractorOpts;
20
19
  constructor(options) {
21
20
  const {
@@ -43,7 +42,7 @@ class OpenAPIJSON2Parser extends _Parser.default {
43
42
  async parse(file) {
44
43
  const source = file.toString();
45
44
  try {
46
- const parserOpts = (0, _ramda.pick)(['sourceMap', 'syntacticAnalysis', 'refractorOpts'], this);
45
+ const parserOpts = (0, _ramda.pick)(['sourceMap', 'refractorOpts'], this);
47
46
  return await (0, _apidomParserAdapterOpenapiJson.parse)(source, parserOpts);
48
47
  } catch (error) {
49
48
  throw new _ParserError.default(`Error parsing "${file.uri}"`, {
@@ -9,7 +9,6 @@ import Parser from "../Parser.mjs";
9
9
  * @public
10
10
  */
11
11
  class OpenAPIJSON2Parser extends Parser {
12
- syntacticAnalysis;
13
12
  refractorOpts;
14
13
  constructor(options) {
15
14
  const {
@@ -37,7 +36,7 @@ class OpenAPIJSON2Parser extends Parser {
37
36
  async parse(file) {
38
37
  const source = file.toString();
39
38
  try {
40
- const parserOpts = pick(['sourceMap', 'syntacticAnalysis', 'refractorOpts'], this);
39
+ const parserOpts = pick(['sourceMap', 'refractorOpts'], this);
41
40
  return await parse(source, parserOpts);
42
41
  } catch (error) {
43
42
  throw new ParserError(`Error parsing "${file.uri}"`, {
@@ -15,7 +15,6 @@ var _Parser = _interopRequireDefault(require("../Parser.cjs"));
15
15
  * @public
16
16
  */
17
17
  class OpenAPIJSON3_0Parser extends _Parser.default {
18
- syntacticAnalysis;
19
18
  refractorOpts;
20
19
  constructor(options) {
21
20
  const {
@@ -43,7 +42,7 @@ class OpenAPIJSON3_0Parser extends _Parser.default {
43
42
  async parse(file) {
44
43
  const source = file.toString();
45
44
  try {
46
- const parserOpts = (0, _ramda.pick)(['sourceMap', 'syntacticAnalysis', 'refractorOpts'], this);
45
+ const parserOpts = (0, _ramda.pick)(['sourceMap', 'refractorOpts'], this);
47
46
  return await (0, _apidomParserAdapterOpenapiJson.parse)(source, parserOpts);
48
47
  } catch (error) {
49
48
  throw new _ParserError.default(`Error parsing "${file.uri}"`, {
@@ -9,7 +9,6 @@ import Parser from "../Parser.mjs";
9
9
  * @public
10
10
  */
11
11
  class OpenAPIJSON3_0Parser extends Parser {
12
- syntacticAnalysis;
13
12
  refractorOpts;
14
13
  constructor(options) {
15
14
  const {
@@ -37,7 +36,7 @@ class OpenAPIJSON3_0Parser extends Parser {
37
36
  async parse(file) {
38
37
  const source = file.toString();
39
38
  try {
40
- const parserOpts = pick(['sourceMap', 'syntacticAnalysis', 'refractorOpts'], this);
39
+ const parserOpts = pick(['sourceMap', 'refractorOpts'], this);
41
40
  return await parse(source, parserOpts);
42
41
  } catch (error) {
43
42
  throw new ParserError(`Error parsing "${file.uri}"`, {
@@ -15,7 +15,6 @@ var _Parser = _interopRequireDefault(require("../Parser.cjs"));
15
15
  * @public
16
16
  */
17
17
  class OpenAPIJSON3_1Parser extends _Parser.default {
18
- syntacticAnalysis;
19
18
  refractorOpts;
20
19
  constructor(options) {
21
20
  const {
@@ -43,7 +42,7 @@ class OpenAPIJSON3_1Parser extends _Parser.default {
43
42
  async parse(file) {
44
43
  const source = file.toString();
45
44
  try {
46
- const parserOpts = (0, _ramda.pick)(['sourceMap', 'syntacticAnalysis', 'refractorOpts'], this);
45
+ const parserOpts = (0, _ramda.pick)(['sourceMap', 'refractorOpts'], this);
47
46
  return await (0, _apidomParserAdapterOpenapiJson.parse)(source, parserOpts);
48
47
  } catch (error) {
49
48
  throw new _ParserError.default(`Error parsing "${file.uri}"`, {
@@ -9,7 +9,6 @@ import Parser from "../Parser.mjs";
9
9
  * @public
10
10
  */
11
11
  class OpenAPIJSON3_1Parser extends Parser {
12
- syntacticAnalysis;
13
12
  refractorOpts;
14
13
  constructor(options) {
15
14
  const {
@@ -37,7 +36,7 @@ class OpenAPIJSON3_1Parser extends Parser {
37
36
  async parse(file) {
38
37
  const source = file.toString();
39
38
  try {
40
- const parserOpts = pick(['sourceMap', 'syntacticAnalysis', 'refractorOpts'], this);
39
+ const parserOpts = pick(['sourceMap', 'refractorOpts'], this);
41
40
  return await parse(source, parserOpts);
42
41
  } catch (error) {
43
42
  throw new ParserError(`Error parsing "${file.uri}"`, {
@@ -5,7 +5,7 @@ var _interopRequireDefault = require("@babel/runtime-corejs3/helpers/interopRequ
5
5
  exports.__esModule = true;
6
6
  exports.resolveApiDOM = exports.default = void 0;
7
7
  var _ramda = require("ramda");
8
- var _apidomCore = require("@speclynx/apidom-core");
8
+ var _apidomDatamodel = require("@speclynx/apidom-datamodel");
9
9
  var _util = require("../options/util.cjs");
10
10
  var _index = _interopRequireDefault(require("../parse/index.cjs"));
11
11
  var plugins = _interopRequireWildcard(require("../util/plugins.cjs"));
@@ -21,11 +21,11 @@ const resolveApiDOM = async (element, options) => {
21
21
  let parseResult = element;
22
22
 
23
23
  // wrap element into parse result
24
- if (!(0, _apidomCore.isParseResultElement)(element)) {
24
+ if (!(0, _apidomDatamodel.isParseResultElement)(element)) {
25
25
  // shallow clone of the element
26
- const elementClone = (0, _apidomCore.cloneShallow)(element);
26
+ const elementClone = (0, _apidomDatamodel.cloneShallow)(element);
27
27
  elementClone.classes.push('result');
28
- parseResult = new _apidomCore.ParseResultElement([elementClone]);
28
+ parseResult = new _apidomDatamodel.ParseResultElement([elementClone]);
29
29
  }
30
30
  const sanitizedURI = url.sanitize(url.stripHash(options.resolve.baseURI));
31
31
  const file = new _File.default({
@@ -1,5 +1,5 @@
1
1
  import { isEmpty } from 'ramda';
2
- import { isParseResultElement, ParseResultElement, cloneShallow } from '@speclynx/apidom-core';
2
+ import { isParseResultElement, ParseResultElement, cloneShallow } from '@speclynx/apidom-datamodel';
3
3
  import { merge as mergeOptions } from "../options/util.mjs";
4
4
  import parse from "../parse/index.mjs";
5
5
  import * as plugins from "../util/plugins.mjs";
package/types/File.d.ts CHANGED
@@ -1,4 +1,4 @@
1
- import { ParseResultElement } from '@speclynx/apidom-core';
1
+ import { ParseResultElement } from '@speclynx/apidom-datamodel';
2
2
  /**
3
3
  * This class represents a File object with url and data.
4
4
  * @public
@@ -1,4 +1,4 @@
1
- import { Element } from '@speclynx/apidom-core';
1
+ import { Element } from '@speclynx/apidom-datamodel';
2
2
  import ReferenceSet from './ReferenceSet.ts';
3
3
  /**
4
4
  * @public
@@ -19,7 +19,7 @@ declare class ReferenceSet {
19
19
  merge(anotherRefSet: this): this;
20
20
  has(thing: string | Reference): boolean;
21
21
  find(predicate: (value: Reference, index: number, obj: Reference[]) => boolean): Reference | undefined;
22
- values(): Generator<Reference<import("minim").Element>, void, unknown>;
22
+ values(): Generator<Reference<import("@speclynx/apidom-datamodel").Element>, void, unknown>;
23
23
  clean(): void;
24
24
  }
25
25
  export default ReferenceSet;
@@ -1,8 +1,7 @@
1
1
  import { ApiDOMError } from '@speclynx/apidom-error';
2
- import { Element as Element_2 } from 'minim';
3
- import { Element as Element_3 } from '@speclynx/apidom-core';
4
- import { ParseResultElement } from '@speclynx/apidom-core';
5
- import { RefElement } from 'minim';
2
+ import { Element as Element_2 } from '@speclynx/apidom-datamodel';
3
+ import { ParseResultElement } from '@speclynx/apidom-datamodel';
4
+ import type { RefElement } from '@speclynx/apidom-datamodel';
6
5
 
7
6
  /**
8
7
  * @public
@@ -101,7 +100,7 @@ export declare const dereference: (uri: string, options?: {}) => Promise<ParseRe
101
100
  /**
102
101
  * @public
103
102
  */
104
- export declare class DereferenceAncestorLineage<T extends Element_3> extends Array<Set<T>> {
103
+ export declare class DereferenceAncestorLineage<T extends Element_2> extends Array<Set<T>> {
105
104
  includesCycle(element: T): boolean;
106
105
  includes(searchElement: Set<T> | T, fromIndex?: number): boolean;
107
106
  findItem(predicate: (item: T) => boolean): T | undefined;
@@ -110,7 +109,7 @@ export declare class DereferenceAncestorLineage<T extends Element_3> extends Arr
110
109
  /**
111
110
  * @public
112
111
  */
113
- export declare const dereferenceApiDOM: <T extends Element_3>(element: T, options?: {}) => Promise<T>;
112
+ export declare const dereferenceApiDOM: <T extends Element_2>(element: T, options?: {}) => Promise<T>;
114
113
 
115
114
  /**
116
115
  * @public
@@ -381,7 +380,7 @@ export declare const readFile: (uri: string, options?: {}) => Promise<Buffer>;
381
380
  /**
382
381
  * @public
383
382
  */
384
- export declare class Reference<T = Element_3> {
383
+ export declare class Reference<T = Element_2> {
385
384
  readonly uri: string;
386
385
  readonly depth: number;
387
386
  readonly value: T;
@@ -393,7 +392,7 @@ export declare class Reference<T = Element_3> {
393
392
  /**
394
393
  * @public
395
394
  */
396
- export declare interface ReferenceOptions<T = Element_3> {
395
+ export declare interface ReferenceOptions<T = Element_2> {
397
396
  readonly uri: string;
398
397
  readonly depth?: number;
399
398
  readonly refSet?: ReferenceSet;
@@ -439,7 +438,7 @@ declare const resolve_2: (from: string, to: string) => string;
439
438
  /**
440
439
  * @public
441
440
  */
442
- export declare const resolveApiDOM: <T extends Element_3>(element: T, options?: {}) => Promise<ReferenceSet>;
441
+ export declare const resolveApiDOM: <T extends Element_2>(element: T, options?: {}) => Promise<ReferenceSet>;
443
442
 
444
443
  /**
445
444
  * @public
@@ -1,4 +1,4 @@
1
- import { ParseResultElement } from '@speclynx/apidom-core';
1
+ import { ParseResultElement } from '@speclynx/apidom-datamodel';
2
2
  import type { ReferenceOptions } from '../options/index.ts';
3
3
  /**
4
4
  * Bundle a file with all its external references to a compound document.
@@ -1,4 +1,4 @@
1
- import { ParseResultElement } from '@speclynx/apidom-core';
1
+ import { ParseResultElement } from '@speclynx/apidom-datamodel';
2
2
  import File from '../../File.ts';
3
3
  import type { ReferenceOptions } from '../../options/index.ts';
4
4
  /**
@@ -1,4 +1,4 @@
1
- import { ParseResultElement } from '@speclynx/apidom-core';
1
+ import { ParseResultElement } from '@speclynx/apidom-datamodel';
2
2
  import File from '../../../File.ts';
3
3
  import BundleStrategy, { BundleStrategyOptions } from '../BundleStrategy.ts';
4
4
  export type { default as DereferenceStrategy, DereferenceStrategyOptions, } from '../../../dereference/strategies/DereferenceStrategy.ts';
@@ -1,4 +1,4 @@
1
- import { Element, ParseResultElement } from '@speclynx/apidom-core';
1
+ import { Element, ParseResultElement } from '@speclynx/apidom-datamodel';
2
2
  import type { ReferenceOptions } from '../options/index.ts';
3
3
  /**
4
4
  * Dereferences ApiDOM with all its external references.
@@ -1,4 +1,4 @@
1
- import { Element } from 'minim';
1
+ import { Element } from '@speclynx/apidom-datamodel';
2
2
  import File from '../../File.ts';
3
3
  import type { ReferenceOptions } from '../../options/index.ts';
4
4
  /**
@@ -1,4 +1,4 @@
1
- import { Element } from '@speclynx/apidom-core';
1
+ import { Element } from '@speclynx/apidom-datamodel';
2
2
  import DereferenceStrategy, { DereferenceStrategyOptions } from '../DereferenceStrategy.ts';
3
3
  import File from '../../../File.ts';
4
4
  import ApiDOMDereferenceVisitor from './visitor.ts';
@@ -1,4 +1,4 @@
1
- import { Element } from '@speclynx/apidom-core';
1
+ import { Element } from '@speclynx/apidom-datamodel';
2
2
  import EvaluationElementIdError from '../../../../errors/EvaluationElementIdError.ts';
3
3
  /**
4
4
  * Evaluates element ID against ApiDOM fragment.
@@ -1,4 +1,5 @@
1
- import { Element, RefElement } from '@speclynx/apidom-core';
1
+ import { Element } from '@speclynx/apidom-datamodel';
2
+ import { Path } from '@speclynx/apidom-traverse';
2
3
  import Reference from '../../../Reference.ts';
3
4
  import type { ReferenceOptions } from '../../../options/index.ts';
4
5
  /**
@@ -27,6 +28,6 @@ declare class ApiDOMDereferenceVisitor {
27
28
  constructor({ reference, options }: ApiDOMDereferenceVisitorOptions);
28
29
  protected toBaseURI(uri: string): string;
29
30
  protected toReference(uri: string): Promise<Reference>;
30
- RefElement(refElement: RefElement, key: string | number, parent: Element | undefined, path: (string | number)[], ancestors: [Element | Element[]]): Promise<unknown>;
31
+ RefElement(path: Path<Element>): Promise<void>;
31
32
  }
32
33
  export default ApiDOMDereferenceVisitor;
@@ -1,4 +1,4 @@
1
- import { Element } from '@speclynx/apidom-core';
1
+ import { Element } from '@speclynx/apidom-datamodel';
2
2
  import DereferenceStrategy, { DereferenceStrategyOptions } from '../DereferenceStrategy.ts';
3
3
  import File from '../../../File.ts';
4
4
  import AsyncAPI2DereferenceVisitor from './visitor.ts';
@@ -7,7 +7,7 @@ export type { default as DereferenceStrategy, DereferenceStrategyOptions, } from
7
7
  export type { default as File, FileOptions } from '../../../File.ts';
8
8
  export type { default as Reference, ReferenceOptions } from '../../../Reference.ts';
9
9
  export type { default as ReferenceSet, ReferenceSetOptions } from '../../../ReferenceSet.ts';
10
- export type { AsyncAPI2DereferenceVisitorOptions, mutationReplacer } from './visitor.ts';
10
+ export type { AsyncAPI2DereferenceVisitorOptions } from './visitor.ts';
11
11
  export type { ReferenceOptions as ApiDOMReferenceOptions, ReferenceBundleOptions as ApiDOMReferenceBundleOptions, ReferenceDereferenceOptions as ApiDOMReferenceDereferenceOptions, ReferenceParseOptions as ApiDOMReferenceParseOptions, ReferenceResolveOptions as ApiDOMReferenceResolveOptions, } from '../../../options/index.ts';
12
12
  export type { default as Parser, ParserOptions } from '../../../parse/parsers/Parser.ts';
13
13
  export type { default as Resolver, ResolverOptions } from '../../../resolve/resolvers/Resolver.ts';
@@ -1,13 +1,8 @@
1
- import { Namespace, Element } from '@speclynx/apidom-core';
2
- import { ChannelItemElement, ReferenceElement } from '@speclynx/apidom-ns-asyncapi-2';
1
+ import { Namespace, Element } from '@speclynx/apidom-datamodel';
2
+ import { Path } from '@speclynx/apidom-traverse';
3
3
  import { AncestorLineage } from '../../util.ts';
4
4
  import Reference from '../../../Reference.ts';
5
5
  import type { ReferenceOptions } from '../../../options/index.ts';
6
- /**
7
- * Custom mutation replacer.
8
- * @public
9
- */
10
- export declare const mutationReplacer: (newElement: Element, oldElement: Element, key: string | number, parent: Element | undefined) => void;
11
6
  /**
12
7
  * @public
13
8
  */
@@ -32,12 +27,8 @@ declare class AsyncAPI2DereferenceVisitor {
32
27
  constructor({ reference, namespace, options, indirections, ancestors, refractCache, }: AsyncAPI2DereferenceVisitorOptions);
33
28
  protected toBaseURI(uri: string): string;
34
29
  protected toReference(uri: string): Promise<Reference>;
35
- protected toAncestorLineage(ancestors: (Element | Element[] | undefined)[]): [AncestorLineage<Element>, Set<Element>];
36
- ReferenceElement(referencingElement: ReferenceElement, key: string | number, parent: Element | undefined, path: (string | number)[], ancestors: [Element | Element[]], link: {
37
- replaceWith: (element: Element, replacer: typeof mutationReplacer) => void;
38
- }): Promise<any>;
39
- ChannelItemElement(referencingElement: ChannelItemElement, key: string | number, parent: Element | undefined, path: (string | number)[], ancestors: [Element | Element[]], link: {
40
- replaceWith: (element: Element, replacer: typeof mutationReplacer) => void;
41
- }): Promise<any>;
30
+ protected toAncestorLineage(path: Path<Element>): [AncestorLineage<Element>, Set<Element>];
31
+ ReferenceElement(path: Path<Element>): Promise<void>;
32
+ ChannelItemElement(path: Path<Element>): Promise<void>;
42
33
  }
43
34
  export default AsyncAPI2DereferenceVisitor;
@@ -1,4 +1,4 @@
1
- import { Element } from '@speclynx/apidom-core';
1
+ import { Element } from '@speclynx/apidom-datamodel';
2
2
  import DereferenceStrategy, { DereferenceStrategyOptions } from '../DereferenceStrategy.ts';
3
3
  import File from '../../../File.ts';
4
4
  import OpenAPI2DereferenceVisitor from './visitor.ts';
@@ -7,7 +7,7 @@ export type { default as DereferenceStrategy, DereferenceStrategyOptions, } from
7
7
  export type { default as File, FileOptions } from '../../../File.ts';
8
8
  export type { default as Reference, ReferenceOptions } from '../../../Reference.ts';
9
9
  export type { default as ReferenceSet, ReferenceSetOptions } from '../../../ReferenceSet.ts';
10
- export type { OpenAPI2DereferenceVisitorOptions, mutationReplacer } from './visitor.ts';
10
+ export type { OpenAPI2DereferenceVisitorOptions } from './visitor.ts';
11
11
  export type { ReferenceOptions as ApiDOMReferenceOptions, ReferenceBundleOptions as ApiDOMReferenceBundleOptions, ReferenceDereferenceOptions as ApiDOMReferenceDereferenceOptions, ReferenceParseOptions as ApiDOMReferenceParseOptions, ReferenceResolveOptions as ApiDOMReferenceResolveOptions, } from '../../../options/index.ts';
12
12
  export type { default as Parser, ParserOptions } from '../../../parse/parsers/Parser.ts';
13
13
  export type { default as Resolver, ResolverOptions } from '../../../resolve/resolvers/Resolver.ts';
@@ -1,14 +1,9 @@
1
- import { Element, Namespace } from '@speclynx/apidom-core';
2
- import { ReferenceElement, PathItemElement, JSONReferenceElement } from '@speclynx/apidom-ns-openapi-2';
1
+ import { Element, Namespace } from '@speclynx/apidom-datamodel';
2
+ import { Path } from '@speclynx/apidom-traverse';
3
3
  import { AncestorLineage } from '../../util.ts';
4
4
  import Reference from '../../../Reference.ts';
5
5
  import type { ReferenceOptions } from '../../../options/index.ts';
6
6
  import { AsyncAPI2DereferenceVisitorOptions } from '../asyncapi-2/visitor.ts';
7
- /**
8
- * Custom mutation replacer.
9
- * @public
10
- */
11
- export declare const mutationReplacer: (newElement: Element, oldElement: Element, key: string | number, parent: Element | undefined) => void;
12
7
  /**
13
8
  * @public
14
9
  */
@@ -33,15 +28,9 @@ declare class OpenAPI2DereferenceVisitor {
33
28
  constructor({ reference, namespace, options, indirections, ancestors, refractCache, }: AsyncAPI2DereferenceVisitorOptions);
34
29
  protected toBaseURI(uri: string): string;
35
30
  protected toReference(uri: string): Promise<Reference>;
36
- protected toAncestorLineage(ancestors: (Element | Element[] | undefined)[]): [AncestorLineage<Element>, Set<Element>];
37
- ReferenceElement(referencingElement: ReferenceElement, key: string | number, parent: Element | undefined, path: (string | number)[], ancestors: [Element | Element[]], link: {
38
- replaceWith: (element: Element, replacer: typeof mutationReplacer) => void;
39
- }): Promise<any>;
40
- PathItemElement(referencingElement: PathItemElement, key: string | number, parent: Element | undefined, path: (string | number)[], ancestors: [Element | Element[]], link: {
41
- replaceWith: (element: Element, replacer: typeof mutationReplacer) => void;
42
- }): Promise<any>;
43
- JSONReferenceElement(referencingElement: JSONReferenceElement, key: string | number, parent: Element | undefined, path: (string | number)[], ancestors: [Element | Element[]], link: {
44
- replaceWith: (element: Element, replacer: typeof mutationReplacer) => void;
45
- }): Promise<any>;
31
+ protected toAncestorLineage(path: Path<Element>): [AncestorLineage<Element>, Set<Element>];
32
+ ReferenceElement(path: Path<Element>): Promise<void>;
33
+ PathItemElement(path: Path<Element>): Promise<void>;
34
+ JSONReferenceElement(path: Path<Element>): Promise<void>;
46
35
  }
47
36
  export default OpenAPI2DereferenceVisitor;
@@ -1,4 +1,4 @@
1
- import { Element } from '@speclynx/apidom-core';
1
+ import { Element } from '@speclynx/apidom-datamodel';
2
2
  import DereferenceStrategy, { DereferenceStrategyOptions } from '../DereferenceStrategy.ts';
3
3
  import File from '../../../File.ts';
4
4
  import OpenAPI3_0DereferenceVisitor from './visitor.ts';
@@ -7,7 +7,7 @@ export type { default as DereferenceStrategy, DereferenceStrategyOptions, } from
7
7
  export type { default as File, FileOptions } from '../../../File.ts';
8
8
  export type { default as Reference, ReferenceOptions } from '../../../Reference.ts';
9
9
  export type { default as ReferenceSet, ReferenceSetOptions } from '../../../ReferenceSet.ts';
10
- export type { OpenAPI3_0DereferenceVisitorOptions, mutationReplacer } from './visitor.ts';
10
+ export type { OpenAPI3_0DereferenceVisitorOptions } from './visitor.ts';
11
11
  export type { ReferenceOptions as ApiDOMReferenceOptions, ReferenceBundleOptions as ApiDOMReferenceBundleOptions, ReferenceDereferenceOptions as ApiDOMReferenceDereferenceOptions, ReferenceParseOptions as ApiDOMReferenceParseOptions, ReferenceResolveOptions as ApiDOMReferenceResolveOptions, } from '../../../options/index.ts';
12
12
  export type { default as Parser, ParserOptions } from '../../../parse/parsers/Parser.ts';
13
13
  export type { default as Resolver, ResolverOptions } from '../../../resolve/resolvers/Resolver.ts';
@@ -1,13 +1,8 @@
1
- import { Element, Namespace } from '@speclynx/apidom-core';
2
- import { ReferenceElement, ExampleElement, LinkElement, PathItemElement } from '@speclynx/apidom-ns-openapi-3-0';
1
+ import { Element, Namespace } from '@speclynx/apidom-datamodel';
2
+ import { Path } from '@speclynx/apidom-traverse';
3
3
  import Reference from '../../../Reference.ts';
4
4
  import { AncestorLineage } from '../../util.ts';
5
5
  import type { ReferenceOptions } from '../../../options/index.ts';
6
- /**
7
- * Custom mutation replacer.
8
- * @public
9
- */
10
- export declare const mutationReplacer: (newElement: Element, oldElement: Element, key: string | number, parent: Element | undefined) => void;
11
6
  /**
12
7
  * @public
13
8
  */
@@ -32,18 +27,10 @@ declare class OpenAPI3_0DereferenceVisitor {
32
27
  constructor({ reference, namespace, options, indirections, ancestors, refractCache, }: OpenAPI3_0DereferenceVisitorOptions);
33
28
  protected toBaseURI(uri: string): string;
34
29
  protected toReference(uri: string): Promise<Reference>;
35
- protected toAncestorLineage(ancestors: (Element | Element[] | undefined)[]): [AncestorLineage<Element>, Set<Element>];
36
- ReferenceElement(referencingElement: ReferenceElement, key: string | number, parent: Element | undefined, path: (string | number)[], ancestors: [Element | Element[]], link: {
37
- replaceWith: (element: Element, replacer: typeof mutationReplacer) => void;
38
- }): Promise<any>;
39
- PathItemElement(referencingElement: PathItemElement, key: string | number, parent: Element | undefined, path: (string | number)[], ancestors: [Element | Element[]], link: {
40
- replaceWith: (element: Element, replacer: typeof mutationReplacer) => void;
41
- }): Promise<any>;
42
- LinkElement(linkElement: LinkElement, key: string | number, parent: Element | undefined, path: (string | number)[], ancestors: [Element | Element[]], link: {
43
- replaceWith: (element: Element, replacer: typeof mutationReplacer) => void;
44
- }): Promise<LinkElement | undefined>;
45
- ExampleElement(exampleElement: ExampleElement, key: string | number, parent: Element | undefined, path: (string | number)[], ancestors: [Element | Element[]], link: {
46
- replaceWith: (element: Element, replacer: typeof mutationReplacer) => void;
47
- }): Promise<ExampleElement | undefined>;
30
+ protected toAncestorLineage(path: Path<Element>): [AncestorLineage<Element>, Set<Element>];
31
+ ReferenceElement(path: Path<Element>): Promise<void>;
32
+ PathItemElement(path: Path<Element>): Promise<void>;
33
+ LinkElement(path: Path<Element>): Promise<void>;
34
+ ExampleElement(path: Path<Element>): Promise<void>;
48
35
  }
49
36
  export default OpenAPI3_0DereferenceVisitor;
@@ -1,4 +1,4 @@
1
- import { Element } from '@speclynx/apidom-core';
1
+ import { Element } from '@speclynx/apidom-datamodel';
2
2
  import DereferenceStrategy, { DereferenceStrategyOptions } from '../DereferenceStrategy.ts';
3
3
  import File from '../../../File.ts';
4
4
  import OpenAPI3_1DereferenceVisitor from './visitor.ts';
@@ -7,7 +7,7 @@ export type { default as DereferenceStrategy, DereferenceStrategyOptions, } from
7
7
  export type { default as File, FileOptions } from '../../../File.ts';
8
8
  export type { default as Reference, ReferenceOptions } from '../../../Reference.ts';
9
9
  export type { default as ReferenceSet, ReferenceSetOptions } from '../../../ReferenceSet.ts';
10
- export type { OpenAPI3_1DereferenceVisitorOptions, mutationReplacer } from './visitor.ts';
10
+ export type { OpenAPI3_1DereferenceVisitorOptions } from './visitor.ts';
11
11
  export type { ReferenceOptions as ApiDOMReferenceOptions, ReferenceBundleOptions as ApiDOMReferenceBundleOptions, ReferenceDereferenceOptions as ApiDOMReferenceDereferenceOptions, ReferenceParseOptions as ApiDOMReferenceParseOptions, ReferenceResolveOptions as ApiDOMReferenceResolveOptions, } from '../../../options/index.ts';
12
12
  export type { default as Parser, ParserOptions } from '../../../parse/parsers/Parser.ts';
13
13
  export type { default as Resolver, ResolverOptions } from '../../../resolve/resolvers/Resolver.ts';
@@ -1,4 +1,4 @@
1
- import { Element } from '@speclynx/apidom-core';
1
+ import { Element } from '@speclynx/apidom-datamodel';
2
2
  import EvaluationJsonSchema$anchorError from '../../../../errors/EvaluationJsonSchema$anchorError.ts';
3
3
  import InvalidJsonSchema$anchorError from '../../../../errors/InvalidJsonSchema$anchorError.ts';
4
4
  /**
@@ -1,4 +1,4 @@
1
- import { Element } from '@speclynx/apidom-core';
1
+ import { Element } from '@speclynx/apidom-datamodel';
2
2
  import EvaluationJsonSchemaUriError from '../../../../errors/EvaluationJsonSchemaUriError.ts';
3
3
  /**
4
4
  * Evaluates JSON Schema $ref containing unknown URI against ApiDOM fragment.