[d24f17c] | 1 | import File from "./util/File.mjs";
|
---|
| 2 | import * as url from "./util/url.mjs";
|
---|
| 3 | import defaultOptions from "./options/index.mjs";
|
---|
| 4 | import { merge as mergeOptions } from "./options/util.mjs";
|
---|
| 5 | import parseFn from "./parse/index.mjs";
|
---|
| 6 | import resolveFn, { resolveApiDOM as resolveApiDOMFn } from "./resolve/index.mjs";
|
---|
| 7 | import { readFile as readFileFn } from "./resolve/util.mjs";
|
---|
| 8 | import dereferenceFn, { dereferenceApiDOM as dereferenceApiDOMFn } from "./dereference/index.mjs";
|
---|
| 9 | import bundleFn from "./bundle/index.mjs";
|
---|
| 10 | export { url, File };
|
---|
| 11 | export { default as Parser } from "./parse/parsers/Parser.mjs";
|
---|
| 12 | export { default as Resolver } from "./resolve/resolvers/Resolver.mjs";
|
---|
| 13 | export { default as HttpResolver } from "./resolve/resolvers/HttpResolver.mjs";
|
---|
| 14 | export { default as ResolveStrategy } from "./resolve/strategies/ResolveStrategy.mjs";
|
---|
| 15 | export { default as DereferenceStrategy } from "./dereference/strategies/DereferenceStrategy.mjs";
|
---|
| 16 | export { AncestorLineage as DereferenceAncestorLineage } from "./dereference/util.mjs";
|
---|
| 17 | export { default as BundleStrategy } from "./bundle/strategies/BundleStrategy.mjs";
|
---|
| 18 | export { default as options } from "./options/index.mjs";
|
---|
| 19 | export { merge as mergeOptions } from "./options/util.mjs";
|
---|
| 20 | export { default as Reference } from "./Reference.mjs";
|
---|
| 21 | export { default as ReferenceSet } from "./ReferenceSet.mjs";
|
---|
| 22 | export { default as BundleError } from "./errors/BundleError.mjs";
|
---|
| 23 | export { default as MaximumBundleDepthError } from "./errors/MaximumBundleDepthError.mjs";
|
---|
| 24 | export { default as UnmatchedBundleStrategyError } from "./errors/UnmatchedBundleStrategyError.mjs";
|
---|
| 25 | export { default as DereferenceError } from "./errors/DereferenceError.mjs";
|
---|
| 26 | export { default as EvaluationJsonSchema$anchorError } from "./errors/EvaluationJsonSchema$anchorError.mjs";
|
---|
| 27 | export { default as EvaluationJsonSchemaUriError } from "./errors/EvaluationJsonSchemaUriError.mjs";
|
---|
| 28 | export { default as InvalidJsonSchema$anchorError } from "./errors/InvalidJsonSchema$anchorError.mjs";
|
---|
| 29 | export { default as JsonSchema$anchorError } from "./errors/JsonSchema$anchorError.mjs";
|
---|
| 30 | export { default as JsonSchemaURIError } from "./errors/JsonSchemaUriError.mjs";
|
---|
| 31 | export { default as MaximumDereferenceDepthError } from "./errors/MaximumDereferenceDepthError.mjs";
|
---|
| 32 | export { default as MaximumResolveDepthError } from "./errors/MaximumResolveDepthError.mjs";
|
---|
| 33 | export { default as ParseError } from "./errors/ParseError.mjs";
|
---|
| 34 | export { default as ParserError } from "./errors/ParserError.mjs";
|
---|
| 35 | export { default as PluginError } from "./errors/PluginError.mjs";
|
---|
| 36 | export { default as ResolveError } from "./errors/ResolveError.mjs";
|
---|
| 37 | export { default as ResolverError } from "./errors/ResolverError.mjs";
|
---|
| 38 | export { default as UnmatchedDereferenceStrategyError } from "./errors/UnmatchedDereferenceStrategyError.mjs";
|
---|
| 39 | export { default as UnmatchedResolveStrategyError } from "./errors/UnmatchedResolveStrategyError.mjs";
|
---|
| 40 | export { default as UnmatchedResolverError } from "./errors/UnmatchedResolverError.mjs";
|
---|
| 41 | export const readFile = async (uri, options = {}) => {
|
---|
| 42 | const mergedOptions = mergeOptions(defaultOptions, options);
|
---|
| 43 | const file = File({
|
---|
| 44 | uri: url.sanitize(uri)
|
---|
| 45 | });
|
---|
| 46 | return readFileFn(file, mergedOptions);
|
---|
| 47 | };
|
---|
| 48 | export const parse = async (uri, options = {}) => {
|
---|
| 49 | const mergedOptions = mergeOptions(defaultOptions, options);
|
---|
| 50 | return parseFn(uri, mergedOptions);
|
---|
| 51 | };
|
---|
| 52 | export const resolve = async (uri, options = {}) => {
|
---|
| 53 | const mergedOptions = mergeOptions(defaultOptions, options);
|
---|
| 54 | return resolveFn(uri, mergedOptions);
|
---|
| 55 | };
|
---|
| 56 | export const resolveApiDOM = async (element, options = {}) => {
|
---|
| 57 | const mergedOptions = mergeOptions(defaultOptions, options);
|
---|
| 58 | return resolveApiDOMFn(element, mergedOptions);
|
---|
| 59 | };
|
---|
| 60 | export const dereference = async (uri, options = {}) => {
|
---|
| 61 | const mergedOptions = mergeOptions(defaultOptions, options);
|
---|
| 62 | return dereferenceFn(uri, mergedOptions);
|
---|
| 63 | };
|
---|
| 64 | export const dereferenceApiDOM = async (element, options = {}) => {
|
---|
| 65 | const mergedOptions = mergeOptions(defaultOptions, options);
|
---|
| 66 | return dereferenceApiDOMFn(element, mergedOptions);
|
---|
| 67 | };
|
---|
| 68 | export const bundle = async (uri, options = {}) => {
|
---|
| 69 | const mergedOptions = mergeOptions(defaultOptions, options);
|
---|
| 70 | return bundleFn(uri, mergedOptions);
|
---|
| 71 | }; |
---|