@speclynx/apidom-reference 1.12.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 +86 -0
- package/LICENSE +202 -0
- package/LICENSES/AFL-3.0.txt +182 -0
- package/LICENSES/Apache-2.0.txt +202 -0
- package/LICENSES/BSD-3-Clause.txt +26 -0
- package/LICENSES/MIT.txt +9 -0
- package/NOTICE +65 -0
- package/README.md +2107 -0
- package/dist/167.apidom-reference.browser.js +10 -0
- package/dist/167.apidom-reference.browser.min.js +1 -0
- package/dist/451.apidom-reference.browser.js +10 -0
- package/dist/451.apidom-reference.browser.min.js +1 -0
- package/dist/9786785aaddf11f37840fad896531940.wasm +0 -0
- package/dist/apidom-reference.browser.js +85376 -0
- package/dist/apidom-reference.browser.min.js +1 -0
- package/package.json +304 -0
- package/src/File.cjs +50 -0
- package/src/File.mjs +44 -0
- package/src/Reference.cjs +31 -0
- package/src/Reference.mjs +27 -0
- package/src/ReferenceSet.cjs +60 -0
- package/src/ReferenceSet.mjs +57 -0
- package/src/bundle/index.cjs +61 -0
- package/src/bundle/index.mjs +55 -0
- package/src/bundle/strategies/BundleStrategy.cjs +20 -0
- package/src/bundle/strategies/BundleStrategy.mjs +16 -0
- package/src/bundle/strategies/openapi-3-1/index.cjs +35 -0
- package/src/bundle/strategies/openapi-3-1/index.mjs +29 -0
- package/src/configuration/empty.cjs +9 -0
- package/src/configuration/empty.mjs +1 -0
- package/src/configuration/saturated.cjs +95 -0
- package/src/configuration/saturated.mjs +87 -0
- package/src/dereference/index.cjs +86 -0
- package/src/dereference/index.mjs +79 -0
- package/src/dereference/strategies/DereferenceStrategy.cjs +20 -0
- package/src/dereference/strategies/DereferenceStrategy.mjs +16 -0
- package/src/dereference/strategies/apidom/index.cjs +89 -0
- package/src/dereference/strategies/apidom/index.mjs +84 -0
- package/src/dereference/strategies/apidom/selectors/element-id.cjs +36 -0
- package/src/dereference/strategies/apidom/selectors/element-id.mjs +30 -0
- package/src/dereference/strategies/apidom/visitor.cjs +165 -0
- package/src/dereference/strategies/apidom/visitor.mjs +159 -0
- package/src/dereference/strategies/asyncapi-2/index.cjs +100 -0
- package/src/dereference/strategies/asyncapi-2/index.mjs +94 -0
- package/src/dereference/strategies/asyncapi-2/visitor.cjs +412 -0
- package/src/dereference/strategies/asyncapi-2/visitor.mjs +406 -0
- package/src/dereference/strategies/openapi-2/index.cjs +102 -0
- package/src/dereference/strategies/openapi-2/index.mjs +96 -0
- package/src/dereference/strategies/openapi-2/visitor.cjs +530 -0
- package/src/dereference/strategies/openapi-2/visitor.mjs +524 -0
- package/src/dereference/strategies/openapi-3-0/index.cjs +102 -0
- package/src/dereference/strategies/openapi-3-0/index.mjs +96 -0
- package/src/dereference/strategies/openapi-3-0/visitor.cjs +519 -0
- package/src/dereference/strategies/openapi-3-0/visitor.mjs +513 -0
- package/src/dereference/strategies/openapi-3-1/index.cjs +105 -0
- package/src/dereference/strategies/openapi-3-1/index.mjs +96 -0
- package/src/dereference/strategies/openapi-3-1/selectors/$anchor.cjs +66 -0
- package/src/dereference/strategies/openapi-3-1/selectors/$anchor.mjs +55 -0
- package/src/dereference/strategies/openapi-3-1/selectors/uri.cjs +50 -0
- package/src/dereference/strategies/openapi-3-1/selectors/uri.mjs +42 -0
- package/src/dereference/strategies/openapi-3-1/util.cjs +67 -0
- package/src/dereference/strategies/openapi-3-1/util.mjs +58 -0
- package/src/dereference/strategies/openapi-3-1/visitor.cjs +776 -0
- package/src/dereference/strategies/openapi-3-1/visitor.mjs +770 -0
- package/src/dereference/util.cjs +31 -0
- package/src/dereference/util.mjs +27 -0
- package/src/errors/BundleError.cjs +10 -0
- package/src/errors/BundleError.mjs +7 -0
- package/src/errors/DereferenceError.cjs +10 -0
- package/src/errors/DereferenceError.mjs +7 -0
- package/src/errors/EvaluationElementIdError.cjs +10 -0
- package/src/errors/EvaluationElementIdError.mjs +7 -0
- package/src/errors/EvaluationJsonSchema$anchorError.cjs +11 -0
- package/src/errors/EvaluationJsonSchema$anchorError.mjs +6 -0
- package/src/errors/EvaluationJsonSchemaUriError.cjs +11 -0
- package/src/errors/EvaluationJsonSchemaUriError.mjs +6 -0
- package/src/errors/InvalidJsonSchema$anchorError.cjs +15 -0
- package/src/errors/InvalidJsonSchema$anchorError.mjs +10 -0
- package/src/errors/JsonSchema$anchorError.cjs +10 -0
- package/src/errors/JsonSchema$anchorError.mjs +7 -0
- package/src/errors/JsonSchemaUriError.cjs +10 -0
- package/src/errors/JsonSchemaUriError.mjs +7 -0
- package/src/errors/MaximumBundleDepthError.cjs +11 -0
- package/src/errors/MaximumBundleDepthError.mjs +6 -0
- package/src/errors/MaximumDereferenceDepthError.cjs +11 -0
- package/src/errors/MaximumDereferenceDepthError.mjs +6 -0
- package/src/errors/MaximumResolveDepthError.cjs +11 -0
- package/src/errors/MaximumResolveDepthError.mjs +6 -0
- package/src/errors/ParseError.cjs +10 -0
- package/src/errors/ParseError.mjs +7 -0
- package/src/errors/ParserError.cjs +11 -0
- package/src/errors/ParserError.mjs +6 -0
- package/src/errors/PluginError.cjs +18 -0
- package/src/errors/PluginError.mjs +15 -0
- package/src/errors/ResolveError.cjs +10 -0
- package/src/errors/ResolveError.mjs +7 -0
- package/src/errors/ResolverError.cjs +11 -0
- package/src/errors/ResolverError.mjs +6 -0
- package/src/errors/UnmatchedBundleStrategyError.cjs +11 -0
- package/src/errors/UnmatchedBundleStrategyError.mjs +6 -0
- package/src/errors/UnmatchedDereferenceStrategyError.cjs +11 -0
- package/src/errors/UnmatchedDereferenceStrategyError.mjs +6 -0
- package/src/errors/UnmatchedResolveStrategyError.cjs +11 -0
- package/src/errors/UnmatchedResolveStrategyError.mjs +6 -0
- package/src/errors/UnmatchedResolverError.cjs +11 -0
- package/src/errors/UnmatchedResolverError.mjs +6 -0
- package/src/index.cjs +142 -0
- package/src/index.mjs +101 -0
- package/src/options/index.cjs +185 -0
- package/src/options/index.mjs +182 -0
- package/src/options/util.cjs +24 -0
- package/src/options/util.mjs +19 -0
- package/src/parse/index.cjs +69 -0
- package/src/parse/index.mjs +63 -0
- package/src/parse/parsers/Parser.cjs +48 -0
- package/src/parse/parsers/Parser.mjs +44 -0
- package/src/parse/parsers/api-design-systems-json/index.cjs +55 -0
- package/src/parse/parsers/api-design-systems-json/index.mjs +49 -0
- package/src/parse/parsers/api-design-systems-yaml/index.cjs +54 -0
- package/src/parse/parsers/api-design-systems-yaml/index.mjs +48 -0
- package/src/parse/parsers/apidom-json/index.cjs +70 -0
- package/src/parse/parsers/apidom-json/index.mjs +64 -0
- package/src/parse/parsers/arazzo-json-1/index.cjs +55 -0
- package/src/parse/parsers/arazzo-json-1/index.mjs +49 -0
- package/src/parse/parsers/arazzo-yaml-1/index.cjs +54 -0
- package/src/parse/parsers/arazzo-yaml-1/index.mjs +48 -0
- package/src/parse/parsers/asyncapi-json-2/index.cjs +55 -0
- package/src/parse/parsers/asyncapi-json-2/index.mjs +49 -0
- package/src/parse/parsers/asyncapi-yaml-2/index.cjs +54 -0
- package/src/parse/parsers/asyncapi-yaml-2/index.mjs +48 -0
- package/src/parse/parsers/binary/index-browser.cjs +56 -0
- package/src/parse/parsers/binary/index-browser.mjs +50 -0
- package/src/parse/parsers/binary/index-node.cjs +51 -0
- package/src/parse/parsers/binary/index-node.mjs +45 -0
- package/src/parse/parsers/json/index.cjs +54 -0
- package/src/parse/parsers/json/index.mjs +48 -0
- package/src/parse/parsers/openapi-json-2/index.cjs +55 -0
- package/src/parse/parsers/openapi-json-2/index.mjs +49 -0
- package/src/parse/parsers/openapi-json-3-0/index.cjs +55 -0
- package/src/parse/parsers/openapi-json-3-0/index.mjs +49 -0
- package/src/parse/parsers/openapi-json-3-1/index.cjs +55 -0
- package/src/parse/parsers/openapi-json-3-1/index.mjs +49 -0
- package/src/parse/parsers/openapi-yaml-2/index.cjs +54 -0
- package/src/parse/parsers/openapi-yaml-2/index.mjs +48 -0
- package/src/parse/parsers/openapi-yaml-3-0/index.cjs +54 -0
- package/src/parse/parsers/openapi-yaml-3-0/index.mjs +48 -0
- package/src/parse/parsers/openapi-yaml-3-1/index.cjs +54 -0
- package/src/parse/parsers/openapi-yaml-3-1/index.mjs +48 -0
- package/src/parse/parsers/yaml-1-2/index.cjs +54 -0
- package/src/parse/parsers/yaml-1-2/index.mjs +48 -0
- package/src/resolve/index.cjs +67 -0
- package/src/resolve/index.mjs +60 -0
- package/src/resolve/resolvers/HTTPResolver.cjs +38 -0
- package/src/resolve/resolvers/HTTPResolver.mjs +31 -0
- package/src/resolve/resolvers/Resolver.cjs +20 -0
- package/src/resolve/resolvers/Resolver.mjs +16 -0
- package/src/resolve/resolvers/file/index-browser.cjs +24 -0
- package/src/resolve/resolvers/file/index-browser.mjs +19 -0
- package/src/resolve/resolvers/file/index-node.cjs +49 -0
- package/src/resolve/resolvers/file/index-node.mjs +42 -0
- package/src/resolve/resolvers/http-axios/index.cjs +80 -0
- package/src/resolve/resolvers/http-axios/index.mjs +73 -0
- package/src/resolve/strategies/ResolveStrategy.cjs +20 -0
- package/src/resolve/strategies/ResolveStrategy.mjs +16 -0
- package/src/resolve/strategies/apidom/index.cjs +49 -0
- package/src/resolve/strategies/apidom/index.mjs +43 -0
- package/src/resolve/strategies/asyncapi-2/index.cjs +49 -0
- package/src/resolve/strategies/asyncapi-2/index.mjs +43 -0
- package/src/resolve/strategies/openapi-2/index.cjs +49 -0
- package/src/resolve/strategies/openapi-2/index.mjs +43 -0
- package/src/resolve/strategies/openapi-3-0/index.cjs +49 -0
- package/src/resolve/strategies/openapi-3-0/index.mjs +43 -0
- package/src/resolve/strategies/openapi-3-1/index.cjs +49 -0
- package/src/resolve/strategies/openapi-3-1/index.mjs +43 -0
- package/src/resolve/util.cjs +37 -0
- package/src/resolve/util.mjs +30 -0
- package/src/util/plugins.cjs +44 -0
- package/src/util/plugins.mjs +37 -0
- package/src/util/url.cjs +288 -0
- package/src/util/url.mjs +274 -0
- package/types/File.d.ts +24 -0
- package/types/Reference.d.ts +23 -0
- package/types/ReferenceSet.d.ts +25 -0
- package/types/apidom-reference.d.ts +584 -0
- package/types/bundle/index.d.ts +7 -0
- package/types/bundle/strategies/BundleStrategy.d.ts +19 -0
- package/types/bundle/strategies/openapi-3-1/index.d.ts +26 -0
- package/types/configuration/empty.d.ts +1 -0
- package/types/configuration/saturated.d.ts +1 -0
- package/types/dereference/index.d.ts +11 -0
- package/types/dereference/strategies/DereferenceStrategy.d.ts +19 -0
- package/types/dereference/strategies/apidom/index.d.ts +30 -0
- package/types/dereference/strategies/apidom/selectors/element-id.d.ts +11 -0
- package/types/dereference/strategies/apidom/visitor.d.ts +32 -0
- package/types/dereference/strategies/asyncapi-2/index.d.ts +31 -0
- package/types/dereference/strategies/asyncapi-2/visitor.d.ts +43 -0
- package/types/dereference/strategies/openapi-2/index.d.ts +32 -0
- package/types/dereference/strategies/openapi-2/visitor.d.ts +47 -0
- package/types/dereference/strategies/openapi-3-0/index.d.ts +31 -0
- package/types/dereference/strategies/openapi-3-0/visitor.d.ts +49 -0
- package/types/dereference/strategies/openapi-3-1/index.d.ts +32 -0
- package/types/dereference/strategies/openapi-3-1/selectors/$anchor.d.ts +22 -0
- package/types/dereference/strategies/openapi-3-1/selectors/uri.d.ts +12 -0
- package/types/dereference/strategies/openapi-3-1/util.d.ts +21 -0
- package/types/dereference/strategies/openapi-3-1/visitor.d.ts +52 -0
- package/types/dereference/util.d.ts +9 -0
- package/types/errors/BundleError.d.ts +7 -0
- package/types/errors/DereferenceError.d.ts +7 -0
- package/types/errors/EvaluationElementIdError.d.ts +7 -0
- package/types/errors/EvaluationJsonSchema$anchorError.d.ts +7 -0
- package/types/errors/EvaluationJsonSchemaUriError.d.ts +7 -0
- package/types/errors/InvalidJsonSchema$anchorError.d.ts +8 -0
- package/types/errors/JsonSchema$anchorError.d.ts +7 -0
- package/types/errors/JsonSchemaUriError.d.ts +7 -0
- package/types/errors/MaximumBundleDepthError.d.ts +7 -0
- package/types/errors/MaximumDereferenceDepthError.d.ts +7 -0
- package/types/errors/MaximumResolveDepthError.d.ts +7 -0
- package/types/errors/ParseError.d.ts +7 -0
- package/types/errors/ParserError.d.ts +7 -0
- package/types/errors/PluginError.d.ts +12 -0
- package/types/errors/ResolveError.d.ts +7 -0
- package/types/errors/ResolverError.d.ts +7 -0
- package/types/errors/UnmatchedBundleStrategyError.d.ts +7 -0
- package/types/errors/UnmatchedDereferenceStrategyError.d.ts +7 -0
- package/types/errors/UnmatchedResolveStrategyError.d.ts +7 -0
- package/types/errors/UnmatchedResolverError.d.ts +7 -0
- package/types/index.d.ts +75 -0
- package/types/options/index.d.ts +62 -0
- package/types/options/util.d.ts +5 -0
- package/types/parse/index.d.ts +7 -0
- package/types/parse/parsers/Parser.d.ts +38 -0
- package/types/parse/parsers/api-design-systems-json/index.d.ts +21 -0
- package/types/parse/parsers/api-design-systems-yaml/index.d.ts +20 -0
- package/types/parse/parsers/apidom-json/index.d.ts +24 -0
- package/types/parse/parsers/arazzo-json-1/index.d.ts +21 -0
- package/types/parse/parsers/arazzo-yaml-1/index.d.ts +20 -0
- package/types/parse/parsers/asyncapi-json-2/index.d.ts +21 -0
- package/types/parse/parsers/asyncapi-yaml-2/index.d.ts +20 -0
- package/types/parse/parsers/binary/index-browser.d.ts +21 -0
- package/types/parse/parsers/binary/index-node.d.ts +21 -0
- package/types/parse/parsers/json/index.d.ts +20 -0
- package/types/parse/parsers/openapi-json-2/index.d.ts +21 -0
- package/types/parse/parsers/openapi-json-3-0/index.d.ts +21 -0
- package/types/parse/parsers/openapi-json-3-1/index.d.ts +21 -0
- package/types/parse/parsers/openapi-yaml-2/index.d.ts +20 -0
- package/types/parse/parsers/openapi-yaml-3-0/index.d.ts +20 -0
- package/types/parse/parsers/openapi-yaml-3-1/index.d.ts +20 -0
- package/types/parse/parsers/yaml-1-2/index.d.ts +20 -0
- package/types/resolve/index.d.ts +12 -0
- package/types/resolve/resolvers/HTTPResolver.d.ts +22 -0
- package/types/resolve/resolvers/Resolver.d.ts +17 -0
- package/types/resolve/resolvers/file/index-browser.d.ts +12 -0
- package/types/resolve/resolvers/file/index-node.d.ts +20 -0
- package/types/resolve/resolvers/http-axios/index.d.ts +30 -0
- package/types/resolve/strategies/ResolveStrategy.d.ts +19 -0
- package/types/resolve/strategies/apidom/index.d.ts +27 -0
- package/types/resolve/strategies/asyncapi-2/index.d.ts +27 -0
- package/types/resolve/strategies/openapi-2/index.d.ts +27 -0
- package/types/resolve/strategies/openapi-3-0/index.d.ts +27 -0
- package/types/resolve/strategies/openapi-3-1/index.d.ts +27 -0
- package/types/resolve/util.d.ts +6 -0
- package/types/util/plugins.d.ts +14 -0
- package/types/util/url.d.ts +106 -0
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import { Element } from '@speclynx/apidom-core';
|
|
2
|
+
import EvaluationElementIdError from '../../../../errors/EvaluationElementIdError.ts';
|
|
3
|
+
/**
|
|
4
|
+
* Evaluates element ID against ApiDOM fragment.
|
|
5
|
+
* @public
|
|
6
|
+
*/
|
|
7
|
+
export declare const evaluate: {
|
|
8
|
+
<T extends Element>(elementID: string, element: T): Element | undefined;
|
|
9
|
+
cache: WeakMap<WeakKey, any>;
|
|
10
|
+
};
|
|
11
|
+
export { EvaluationElementIdError };
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
import { Element, RefElement } from '@speclynx/apidom-core';
|
|
2
|
+
import Reference from '../../../Reference.ts';
|
|
3
|
+
import type { ReferenceOptions } from '../../../options/index.ts';
|
|
4
|
+
/**
|
|
5
|
+
* The following rules apply:
|
|
6
|
+
*
|
|
7
|
+
* 1. When referencing an element in the local document, the id of the element MAY be used
|
|
8
|
+
* 2. When referencing remote elements, an absolute URL or relative URL MAY be used
|
|
9
|
+
* 3. When a URL fragment exists in the URL given, it references the element with the matching id in the given document. The URL fragment MAY need to be URL decoded before making a match.
|
|
10
|
+
* 4. When a URL fragment does not exist, the URL references the root element
|
|
11
|
+
* 5. When path is used, it references the given property of the referenced element
|
|
12
|
+
* 6. When path is used in an element that includes the data of the pointer (such as with ref), the referenced path MAY need to be converted to a refract structure in order to be valid
|
|
13
|
+
*
|
|
14
|
+
* WARNING: this implementation only supports referencing elements in the local document. Points 2-4 are not supported.
|
|
15
|
+
* @public
|
|
16
|
+
*/
|
|
17
|
+
export interface ApiDOMDereferenceVisitorOptions {
|
|
18
|
+
readonly reference: Reference;
|
|
19
|
+
readonly options: ReferenceOptions;
|
|
20
|
+
}
|
|
21
|
+
/**
|
|
22
|
+
* @public
|
|
23
|
+
*/
|
|
24
|
+
declare class ApiDOMDereferenceVisitor {
|
|
25
|
+
protected readonly reference: Reference;
|
|
26
|
+
protected readonly options: ReferenceOptions;
|
|
27
|
+
constructor({ reference, options }: ApiDOMDereferenceVisitorOptions);
|
|
28
|
+
protected toBaseURI(uri: string): string;
|
|
29
|
+
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
|
+
}
|
|
32
|
+
export default ApiDOMDereferenceVisitor;
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
import { Element } from '@speclynx/apidom-core';
|
|
2
|
+
import DereferenceStrategy, { DereferenceStrategyOptions } from '../DereferenceStrategy.ts';
|
|
3
|
+
import File from '../../../File.ts';
|
|
4
|
+
import AsyncAPI2DereferenceVisitor from './visitor.ts';
|
|
5
|
+
import type { ReferenceOptions } from '../../../options/index.ts';
|
|
6
|
+
export type { default as DereferenceStrategy, DereferenceStrategyOptions, } from '../DereferenceStrategy.ts';
|
|
7
|
+
export type { default as File, FileOptions } from '../../../File.ts';
|
|
8
|
+
export type { default as Reference, ReferenceOptions } from '../../../Reference.ts';
|
|
9
|
+
export type { default as ReferenceSet, ReferenceSetOptions } from '../../../ReferenceSet.ts';
|
|
10
|
+
export type { AsyncAPI2DereferenceVisitorOptions, mutationReplacer } from './visitor.ts';
|
|
11
|
+
export type { ReferenceOptions as ApiDOMReferenceOptions, ReferenceBundleOptions as ApiDOMReferenceBundleOptions, ReferenceDereferenceOptions as ApiDOMReferenceDereferenceOptions, ReferenceParseOptions as ApiDOMReferenceParseOptions, ReferenceResolveOptions as ApiDOMReferenceResolveOptions, } from '../../../options/index.ts';
|
|
12
|
+
export type { default as Parser, ParserOptions } from '../../../parse/parsers/Parser.ts';
|
|
13
|
+
export type { default as Resolver, ResolverOptions } from '../../../resolve/resolvers/Resolver.ts';
|
|
14
|
+
export type { default as ResolveStrategy, ResolveStrategyOptions, } from '../../../resolve/strategies/ResolveStrategy.ts';
|
|
15
|
+
export type { default as BundleStrategy, BundleStrategyOptions, } from '../../../bundle/strategies/BundleStrategy.ts';
|
|
16
|
+
export type { AncestorLineage } from '../../util.ts';
|
|
17
|
+
/**
|
|
18
|
+
* @public
|
|
19
|
+
*/
|
|
20
|
+
export interface AsyncAPI2DeferenceStrategyOptions extends Omit<DereferenceStrategyOptions, 'name'> {
|
|
21
|
+
}
|
|
22
|
+
/**
|
|
23
|
+
* @public
|
|
24
|
+
*/
|
|
25
|
+
declare class AsyncAPI2DereferenceStrategy extends DereferenceStrategy {
|
|
26
|
+
constructor(options?: AsyncAPI2DeferenceStrategyOptions);
|
|
27
|
+
canDereference(file: File): boolean;
|
|
28
|
+
dereference(file: File, options: ReferenceOptions): Promise<Element>;
|
|
29
|
+
}
|
|
30
|
+
export { AsyncAPI2DereferenceVisitor };
|
|
31
|
+
export default AsyncAPI2DereferenceStrategy;
|
|
@@ -0,0 +1,43 @@
|
|
|
1
|
+
import { Namespace, Element } from '@speclynx/apidom-core';
|
|
2
|
+
import { ChannelItemElement, ReferenceElement } from '@speclynx/apidom-ns-asyncapi-2';
|
|
3
|
+
import { AncestorLineage } from '../../util.ts';
|
|
4
|
+
import Reference from '../../../Reference.ts';
|
|
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
|
+
/**
|
|
12
|
+
* @public
|
|
13
|
+
*/
|
|
14
|
+
export interface AsyncAPI2DereferenceVisitorOptions {
|
|
15
|
+
readonly namespace: Namespace;
|
|
16
|
+
readonly reference: Reference;
|
|
17
|
+
readonly options: ReferenceOptions;
|
|
18
|
+
readonly indirections?: Element[];
|
|
19
|
+
readonly ancestors?: AncestorLineage<Element>;
|
|
20
|
+
readonly refractCache?: Map<string, Element>;
|
|
21
|
+
}
|
|
22
|
+
/**
|
|
23
|
+
* @public
|
|
24
|
+
*/
|
|
25
|
+
declare class AsyncAPI2DereferenceVisitor {
|
|
26
|
+
protected readonly indirections: Element[];
|
|
27
|
+
protected readonly namespace: Namespace;
|
|
28
|
+
protected readonly reference: Reference;
|
|
29
|
+
protected readonly options: ReferenceOptions;
|
|
30
|
+
protected readonly ancestors: AncestorLineage<Element>;
|
|
31
|
+
protected readonly refractCache: Map<string, Element>;
|
|
32
|
+
constructor({ reference, namespace, options, indirections, ancestors, refractCache, }: AsyncAPI2DereferenceVisitorOptions);
|
|
33
|
+
protected toBaseURI(uri: string): string;
|
|
34
|
+
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>;
|
|
42
|
+
}
|
|
43
|
+
export default AsyncAPI2DereferenceVisitor;
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
import { Element } from '@speclynx/apidom-core';
|
|
2
|
+
import DereferenceStrategy, { DereferenceStrategyOptions } from '../DereferenceStrategy.ts';
|
|
3
|
+
import File from '../../../File.ts';
|
|
4
|
+
import OpenAPI2DereferenceVisitor from './visitor.ts';
|
|
5
|
+
import type { ReferenceOptions } from '../../../options/index.ts';
|
|
6
|
+
export type { default as DereferenceStrategy, DereferenceStrategyOptions, } from '../DereferenceStrategy.ts';
|
|
7
|
+
export type { default as File, FileOptions } from '../../../File.ts';
|
|
8
|
+
export type { default as Reference, ReferenceOptions } from '../../../Reference.ts';
|
|
9
|
+
export type { default as ReferenceSet, ReferenceSetOptions } from '../../../ReferenceSet.ts';
|
|
10
|
+
export type { OpenAPI2DereferenceVisitorOptions, mutationReplacer } from './visitor.ts';
|
|
11
|
+
export type { ReferenceOptions as ApiDOMReferenceOptions, ReferenceBundleOptions as ApiDOMReferenceBundleOptions, ReferenceDereferenceOptions as ApiDOMReferenceDereferenceOptions, ReferenceParseOptions as ApiDOMReferenceParseOptions, ReferenceResolveOptions as ApiDOMReferenceResolveOptions, } from '../../../options/index.ts';
|
|
12
|
+
export type { default as Parser, ParserOptions } from '../../../parse/parsers/Parser.ts';
|
|
13
|
+
export type { default as Resolver, ResolverOptions } from '../../../resolve/resolvers/Resolver.ts';
|
|
14
|
+
export type { default as ResolveStrategy, ResolveStrategyOptions, } from '../../../resolve/strategies/ResolveStrategy.ts';
|
|
15
|
+
export type { default as BundleStrategy, BundleStrategyOptions, } from '../../../bundle/strategies/BundleStrategy.ts';
|
|
16
|
+
export type { AncestorLineage } from '../../util.ts';
|
|
17
|
+
export type { AsyncAPI2DereferenceVisitorOptions } from '../asyncapi-2/visitor.ts';
|
|
18
|
+
/**
|
|
19
|
+
* @public
|
|
20
|
+
*/
|
|
21
|
+
export interface OpenAPI2DereferenceStrategyOptions extends Omit<DereferenceStrategyOptions, 'name'> {
|
|
22
|
+
}
|
|
23
|
+
/**
|
|
24
|
+
* @public
|
|
25
|
+
*/
|
|
26
|
+
declare class OpenAPI2DereferenceStrategy extends DereferenceStrategy {
|
|
27
|
+
constructor(options?: OpenAPI2DereferenceStrategyOptions);
|
|
28
|
+
canDereference(file: File): boolean;
|
|
29
|
+
dereference(file: File, options: ReferenceOptions): Promise<Element>;
|
|
30
|
+
}
|
|
31
|
+
export { OpenAPI2DereferenceVisitor };
|
|
32
|
+
export default OpenAPI2DereferenceStrategy;
|
|
@@ -0,0 +1,47 @@
|
|
|
1
|
+
import { Element, Namespace } from '@speclynx/apidom-core';
|
|
2
|
+
import { ReferenceElement, PathItemElement, JSONReferenceElement } from '@speclynx/apidom-ns-openapi-2';
|
|
3
|
+
import { AncestorLineage } from '../../util.ts';
|
|
4
|
+
import Reference from '../../../Reference.ts';
|
|
5
|
+
import type { ReferenceOptions } from '../../../options/index.ts';
|
|
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
|
+
/**
|
|
13
|
+
* @public
|
|
14
|
+
*/
|
|
15
|
+
export interface OpenAPI2DereferenceVisitorOptions {
|
|
16
|
+
readonly namespace: Namespace;
|
|
17
|
+
readonly reference: Reference;
|
|
18
|
+
readonly options: ReferenceOptions;
|
|
19
|
+
readonly indirections?: Element[];
|
|
20
|
+
readonly ancestors?: AncestorLineage<Element>;
|
|
21
|
+
readonly refractCache?: Map<string, Element>;
|
|
22
|
+
}
|
|
23
|
+
/**
|
|
24
|
+
* @public
|
|
25
|
+
*/
|
|
26
|
+
declare class OpenAPI2DereferenceVisitor {
|
|
27
|
+
protected readonly indirections: Element[];
|
|
28
|
+
protected readonly namespace: Namespace;
|
|
29
|
+
protected readonly reference: Reference;
|
|
30
|
+
protected readonly options: ReferenceOptions;
|
|
31
|
+
protected readonly ancestors: AncestorLineage<Element>;
|
|
32
|
+
protected readonly refractCache: Map<string, Element>;
|
|
33
|
+
constructor({ reference, namespace, options, indirections, ancestors, refractCache, }: AsyncAPI2DereferenceVisitorOptions);
|
|
34
|
+
protected toBaseURI(uri: string): string;
|
|
35
|
+
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>;
|
|
46
|
+
}
|
|
47
|
+
export default OpenAPI2DereferenceVisitor;
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
import { Element } from '@speclynx/apidom-core';
|
|
2
|
+
import DereferenceStrategy, { DereferenceStrategyOptions } from '../DereferenceStrategy.ts';
|
|
3
|
+
import File from '../../../File.ts';
|
|
4
|
+
import OpenAPI3_0DereferenceVisitor from './visitor.ts';
|
|
5
|
+
import type { ReferenceOptions } from '../../../options/index.ts';
|
|
6
|
+
export type { default as DereferenceStrategy, DereferenceStrategyOptions, } from '../DereferenceStrategy.ts';
|
|
7
|
+
export type { default as File, FileOptions } from '../../../File.ts';
|
|
8
|
+
export type { default as Reference, ReferenceOptions } from '../../../Reference.ts';
|
|
9
|
+
export type { default as ReferenceSet, ReferenceSetOptions } from '../../../ReferenceSet.ts';
|
|
10
|
+
export type { OpenAPI3_0DereferenceVisitorOptions, mutationReplacer } from './visitor.ts';
|
|
11
|
+
export type { ReferenceOptions as ApiDOMReferenceOptions, ReferenceBundleOptions as ApiDOMReferenceBundleOptions, ReferenceDereferenceOptions as ApiDOMReferenceDereferenceOptions, ReferenceParseOptions as ApiDOMReferenceParseOptions, ReferenceResolveOptions as ApiDOMReferenceResolveOptions, } from '../../../options/index.ts';
|
|
12
|
+
export type { default as Parser, ParserOptions } from '../../../parse/parsers/Parser.ts';
|
|
13
|
+
export type { default as Resolver, ResolverOptions } from '../../../resolve/resolvers/Resolver.ts';
|
|
14
|
+
export type { default as ResolveStrategy, ResolveStrategyOptions, } from '../../../resolve/strategies/ResolveStrategy.ts';
|
|
15
|
+
export type { default as BundleStrategy, BundleStrategyOptions, } from '../../../bundle/strategies/BundleStrategy.ts';
|
|
16
|
+
export type { AncestorLineage } from '../../util.ts';
|
|
17
|
+
/**
|
|
18
|
+
* @public
|
|
19
|
+
*/
|
|
20
|
+
export interface OpenAPI3_0DereferenceStrategyOptions extends Omit<DereferenceStrategyOptions, 'name'> {
|
|
21
|
+
}
|
|
22
|
+
/**
|
|
23
|
+
* @public
|
|
24
|
+
*/
|
|
25
|
+
declare class OpenAPI3_0DereferenceStrategy extends DereferenceStrategy {
|
|
26
|
+
constructor(options?: OpenAPI3_0DereferenceStrategyOptions);
|
|
27
|
+
canDereference(file: File): boolean;
|
|
28
|
+
dereference(file: File, options: ReferenceOptions): Promise<Element>;
|
|
29
|
+
}
|
|
30
|
+
export { OpenAPI3_0DereferenceVisitor };
|
|
31
|
+
export default OpenAPI3_0DereferenceStrategy;
|
|
@@ -0,0 +1,49 @@
|
|
|
1
|
+
import { Element, Namespace } from '@speclynx/apidom-core';
|
|
2
|
+
import { ReferenceElement, ExampleElement, LinkElement, PathItemElement } from '@speclynx/apidom-ns-openapi-3-0';
|
|
3
|
+
import Reference from '../../../Reference.ts';
|
|
4
|
+
import { AncestorLineage } from '../../util.ts';
|
|
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
|
+
/**
|
|
12
|
+
* @public
|
|
13
|
+
*/
|
|
14
|
+
export interface OpenAPI3_0DereferenceVisitorOptions {
|
|
15
|
+
readonly namespace: Namespace;
|
|
16
|
+
readonly reference: Reference;
|
|
17
|
+
readonly options: ReferenceOptions;
|
|
18
|
+
readonly indirections?: Element[];
|
|
19
|
+
readonly ancestors?: AncestorLineage<Element>;
|
|
20
|
+
readonly refractCache?: Map<string, Element>;
|
|
21
|
+
}
|
|
22
|
+
/**
|
|
23
|
+
* @public
|
|
24
|
+
*/
|
|
25
|
+
declare class OpenAPI3_0DereferenceVisitor {
|
|
26
|
+
protected readonly indirections: Element[];
|
|
27
|
+
protected readonly namespace: Namespace;
|
|
28
|
+
protected readonly reference: Reference;
|
|
29
|
+
protected readonly options: ReferenceOptions;
|
|
30
|
+
protected readonly ancestors: AncestorLineage<Element>;
|
|
31
|
+
protected readonly refractCache: Map<string, Element>;
|
|
32
|
+
constructor({ reference, namespace, options, indirections, ancestors, refractCache, }: OpenAPI3_0DereferenceVisitorOptions);
|
|
33
|
+
protected toBaseURI(uri: string): string;
|
|
34
|
+
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>;
|
|
48
|
+
}
|
|
49
|
+
export default OpenAPI3_0DereferenceVisitor;
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
import { Element } from '@speclynx/apidom-core';
|
|
2
|
+
import DereferenceStrategy, { DereferenceStrategyOptions } from '../DereferenceStrategy.ts';
|
|
3
|
+
import File from '../../../File.ts';
|
|
4
|
+
import OpenAPI3_1DereferenceVisitor from './visitor.ts';
|
|
5
|
+
import type { ReferenceOptions } from '../../../options/index.ts';
|
|
6
|
+
export type { default as DereferenceStrategy, DereferenceStrategyOptions, } from '../DereferenceStrategy.ts';
|
|
7
|
+
export type { default as File, FileOptions } from '../../../File.ts';
|
|
8
|
+
export type { default as Reference, ReferenceOptions } from '../../../Reference.ts';
|
|
9
|
+
export type { default as ReferenceSet, ReferenceSetOptions } from '../../../ReferenceSet.ts';
|
|
10
|
+
export type { OpenAPI3_1DereferenceVisitorOptions, mutationReplacer } from './visitor.ts';
|
|
11
|
+
export type { ReferenceOptions as ApiDOMReferenceOptions, ReferenceBundleOptions as ApiDOMReferenceBundleOptions, ReferenceDereferenceOptions as ApiDOMReferenceDereferenceOptions, ReferenceParseOptions as ApiDOMReferenceParseOptions, ReferenceResolveOptions as ApiDOMReferenceResolveOptions, } from '../../../options/index.ts';
|
|
12
|
+
export type { default as Parser, ParserOptions } from '../../../parse/parsers/Parser.ts';
|
|
13
|
+
export type { default as Resolver, ResolverOptions } from '../../../resolve/resolvers/Resolver.ts';
|
|
14
|
+
export type { default as ResolveStrategy, ResolveStrategyOptions, } from '../../../resolve/strategies/ResolveStrategy.ts';
|
|
15
|
+
export type { default as BundleStrategy, BundleStrategyOptions, } from '../../../bundle/strategies/BundleStrategy.ts';
|
|
16
|
+
export type { AncestorLineage } from '../../util.ts';
|
|
17
|
+
/**
|
|
18
|
+
* @public
|
|
19
|
+
*/
|
|
20
|
+
export interface OpenAPI3_1DereferenceStrategyOptions extends Omit<DereferenceStrategyOptions, 'name'> {
|
|
21
|
+
}
|
|
22
|
+
/**
|
|
23
|
+
* @public
|
|
24
|
+
*/
|
|
25
|
+
declare class OpenAPI3_1DereferenceStrategy extends DereferenceStrategy {
|
|
26
|
+
constructor(options?: OpenAPI3_1DereferenceStrategyOptions);
|
|
27
|
+
canDereference(file: File): boolean;
|
|
28
|
+
dereference(file: File, options: ReferenceOptions): Promise<Element>;
|
|
29
|
+
}
|
|
30
|
+
export { OpenAPI3_1DereferenceVisitor };
|
|
31
|
+
export { resolveSchema$refField, resolveSchema$idField, maybeRefractToSchemaElement, } from './util.ts';
|
|
32
|
+
export default OpenAPI3_1DereferenceStrategy;
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
import { Element } from '@speclynx/apidom-core';
|
|
2
|
+
import EvaluationJsonSchema$anchorError from '../../../../errors/EvaluationJsonSchema$anchorError.ts';
|
|
3
|
+
import InvalidJsonSchema$anchorError from '../../../../errors/InvalidJsonSchema$anchorError.ts';
|
|
4
|
+
/**
|
|
5
|
+
* @public
|
|
6
|
+
*/
|
|
7
|
+
export declare const isAnchor: (uri: string) => boolean;
|
|
8
|
+
/**
|
|
9
|
+
* @public
|
|
10
|
+
*/
|
|
11
|
+
export declare const uriToAnchor: (uri: string) => string;
|
|
12
|
+
/**
|
|
13
|
+
* @public
|
|
14
|
+
*/
|
|
15
|
+
export declare const parse: (anchor: string) => string;
|
|
16
|
+
/**
|
|
17
|
+
* Evaluates JSON Schema $anchor against ApiDOM fragment.
|
|
18
|
+
* @public
|
|
19
|
+
*/
|
|
20
|
+
export declare const evaluate: <T extends Element>(anchor: string, element: T) => Element | undefined;
|
|
21
|
+
export { EvaluationJsonSchema$anchorError, InvalidJsonSchema$anchorError };
|
|
22
|
+
export { default as JsonSchema$anchorError } from '../../../../errors/JsonSchema$anchorError.ts';
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import { Element } from '@speclynx/apidom-core';
|
|
2
|
+
import EvaluationJsonSchemaUriError from '../../../../errors/EvaluationJsonSchemaUriError.ts';
|
|
3
|
+
/**
|
|
4
|
+
* Evaluates JSON Schema $ref containing unknown URI against ApiDOM fragment.
|
|
5
|
+
* @public
|
|
6
|
+
*/
|
|
7
|
+
export declare const evaluate: {
|
|
8
|
+
<T extends Element>(uri: string, element: T): Element | undefined;
|
|
9
|
+
cache: WeakMap<WeakKey, any>;
|
|
10
|
+
};
|
|
11
|
+
export { EvaluationJsonSchemaUriError };
|
|
12
|
+
export { default as JsonSchemaUriError } from '../../../../errors/JsonSchemaUriError.ts';
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
import { Element } from '@speclynx/apidom-core';
|
|
2
|
+
import { SchemaElement } from '@speclynx/apidom-ns-openapi-3-1';
|
|
3
|
+
/**
|
|
4
|
+
* @public
|
|
5
|
+
*/
|
|
6
|
+
export declare const resolveSchema$refField: (retrievalURI: string, schemaElement: SchemaElement) => string | undefined;
|
|
7
|
+
/**
|
|
8
|
+
* @public
|
|
9
|
+
*/
|
|
10
|
+
export declare const resolveSchema$idField: (retrievalURI: string, schemaElement: SchemaElement) => string | undefined;
|
|
11
|
+
/**
|
|
12
|
+
* Cached version of SchemaElement.refract.
|
|
13
|
+
*/
|
|
14
|
+
export declare const refractToSchemaElement: {
|
|
15
|
+
<T extends Element>(element: T): any;
|
|
16
|
+
cache: WeakMap<WeakKey, any>;
|
|
17
|
+
};
|
|
18
|
+
/**
|
|
19
|
+
* @public
|
|
20
|
+
*/
|
|
21
|
+
export declare const maybeRefractToSchemaElement: <T extends Element>(element: T) => any;
|
|
@@ -0,0 +1,52 @@
|
|
|
1
|
+
import { Element, Namespace } from '@speclynx/apidom-core';
|
|
2
|
+
import { ReferenceElement, PathItemElement, LinkElement, ExampleElement, SchemaElement } from '@speclynx/apidom-ns-openapi-3-1';
|
|
3
|
+
import Reference from '../../../Reference.ts';
|
|
4
|
+
import { AncestorLineage } from '../../util.ts';
|
|
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
|
+
/**
|
|
12
|
+
* @public
|
|
13
|
+
*/
|
|
14
|
+
export interface OpenAPI3_1DereferenceVisitorOptions {
|
|
15
|
+
readonly namespace: Namespace;
|
|
16
|
+
readonly reference: Reference;
|
|
17
|
+
readonly options: ReferenceOptions;
|
|
18
|
+
readonly indirections?: Element[];
|
|
19
|
+
readonly ancestors?: AncestorLineage<Element>;
|
|
20
|
+
readonly refractCache?: Map<string, Element>;
|
|
21
|
+
}
|
|
22
|
+
/**
|
|
23
|
+
* @public
|
|
24
|
+
*/
|
|
25
|
+
declare class OpenAPI3_1DereferenceVisitor {
|
|
26
|
+
protected readonly indirections: Element[];
|
|
27
|
+
protected readonly namespace: Namespace;
|
|
28
|
+
protected readonly reference: Reference;
|
|
29
|
+
protected readonly options: ReferenceOptions;
|
|
30
|
+
protected readonly ancestors: AncestorLineage<Element>;
|
|
31
|
+
protected readonly refractCache: Map<string, Element>;
|
|
32
|
+
constructor({ reference, namespace, options, indirections, ancestors, refractCache, }: OpenAPI3_1DereferenceVisitorOptions);
|
|
33
|
+
protected toBaseURI(uri: string): string;
|
|
34
|
+
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>;
|
|
48
|
+
SchemaElement(referencingElement: SchemaElement, key: string | number, parent: Element | undefined, path: (string | number)[], ancestors: [Element | Element[]], link: {
|
|
49
|
+
replaceWith: (element: Element, replacer: typeof mutationReplacer) => void;
|
|
50
|
+
}): Promise<any>;
|
|
51
|
+
}
|
|
52
|
+
export default OpenAPI3_1DereferenceVisitor;
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import { Element } from '@speclynx/apidom-core';
|
|
2
|
+
/**
|
|
3
|
+
* @public
|
|
4
|
+
*/
|
|
5
|
+
export declare class AncestorLineage<T extends Element> extends Array<Set<T>> {
|
|
6
|
+
includesCycle(element: T): boolean;
|
|
7
|
+
includes(searchElement: Set<T> | T, fromIndex?: number): boolean;
|
|
8
|
+
findItem(predicate: (item: T) => boolean): T | undefined;
|
|
9
|
+
}
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import { ApiDOMError } from '@speclynx/apidom-error';
|
|
2
|
+
/**
|
|
3
|
+
* @public
|
|
4
|
+
*/
|
|
5
|
+
declare class PluginError extends ApiDOMError {
|
|
6
|
+
plugin: any;
|
|
7
|
+
constructor(message: string, options: {
|
|
8
|
+
cause?: Error;
|
|
9
|
+
plugin: any;
|
|
10
|
+
});
|
|
11
|
+
}
|
|
12
|
+
export default PluginError;
|