@jentic/arazzo-parser 1.0.0-alpha.2 → 1.0.0-alpha.21
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 +104 -0
- package/README.md +453 -49
- package/dist/jentic-arazzo-parser.browser.js +70344 -46424
- package/dist/jentic-arazzo-parser.browser.min.js +1 -1
- package/package.json +25 -10
- package/src/index.cjs +7 -152
- package/src/index.mjs +2 -147
- package/src/parse-arazzo.cjs +195 -0
- package/src/parse-arazzo.mjs +188 -0
- package/src/parse-openapi.cjs +234 -0
- package/src/parse-openapi.mjs +227 -0
- package/src/resolve/resolvers/memory/index.cjs +29 -0
- package/src/resolve/resolvers/memory/index.mjs +25 -0
- package/types/arazzo-parser.d.ts +43 -30
- package/dist/937fc7a248317278ae14.wasm +0 -0
package/types/arazzo-parser.d.ts
CHANGED
|
@@ -1,56 +1,69 @@
|
|
|
1
|
+
import type { ApiDOMReferenceOptions } from '@speclynx/apidom-reference';
|
|
1
2
|
import { ParseResultElement } from '@speclynx/apidom-datamodel';
|
|
3
|
+
import type { PartialDeep } from 'type-fest';
|
|
2
4
|
|
|
3
5
|
/**
|
|
4
|
-
*
|
|
6
|
+
* Options for parsing Arazzo Documents.
|
|
7
|
+
* @public
|
|
8
|
+
*/
|
|
9
|
+
export declare type ArazzoOptions = PartialDeep<ApiDOMReferenceOptions>;
|
|
10
|
+
|
|
11
|
+
/**
|
|
12
|
+
* Default reference options for parsing Arazzo Documents.
|
|
5
13
|
* @public
|
|
6
14
|
*/
|
|
7
|
-
export declare const
|
|
15
|
+
export declare const defaultArazzoOptions: ArazzoOptions;
|
|
16
|
+
|
|
17
|
+
/**
|
|
18
|
+
* Default reference options for parsing OpenAPI Documents.
|
|
19
|
+
* @public
|
|
20
|
+
*/
|
|
21
|
+
export declare const defaultOpenAPIOptions: OpenAPIOptions;
|
|
22
|
+
|
|
23
|
+
/**
|
|
24
|
+
* Options for parsing OpenAPI Documents.
|
|
25
|
+
* @public
|
|
26
|
+
*/
|
|
27
|
+
export declare type OpenAPIOptions = PartialDeep<ApiDOMReferenceOptions>;
|
|
8
28
|
|
|
9
29
|
/**
|
|
10
30
|
* Parses an Arazzo Document from an object.
|
|
11
31
|
* @param source - The Arazzo Document as a plain object
|
|
12
|
-
* @param options -
|
|
32
|
+
* @param options - Reference options (uses defaultOptions when not provided)
|
|
13
33
|
* @returns A promise that resolves to the parsed Arazzo Document as ApiDOM data model
|
|
34
|
+
* @throws ParseError - When parsing fails for any reason. The original error is available via the `cause` property.
|
|
14
35
|
* @public
|
|
15
36
|
*/
|
|
16
|
-
export declare function
|
|
37
|
+
export declare function parseArazzo(source: Record<string, unknown>, options?: ArazzoOptions): Promise<ParseResultElement>;
|
|
17
38
|
|
|
18
39
|
/**
|
|
19
40
|
* Parses an Arazzo Document from a string or URI.
|
|
20
41
|
* @param source - The Arazzo Document as string content, or a file system path / HTTP(S) URL
|
|
21
|
-
* @param options -
|
|
42
|
+
* @param options - Reference options (uses defaultOptions when not provided)
|
|
22
43
|
* @returns A promise that resolves to the parsed Arazzo Document as ApiDOM data model
|
|
23
44
|
* @throws ParseError - When parsing fails for any reason. The original error is available via the `cause` property.
|
|
24
45
|
* @public
|
|
25
46
|
*/
|
|
26
|
-
export declare function
|
|
47
|
+
export declare function parseArazzo(source: string, options?: ArazzoOptions): Promise<ParseResultElement>;
|
|
27
48
|
|
|
28
49
|
/**
|
|
29
|
-
*
|
|
50
|
+
* Parses an OpenAPI Document from an object.
|
|
51
|
+
* @param source - The OpenAPI Document as a plain object
|
|
52
|
+
* @param options - Reference options (uses defaultOptions when not provided)
|
|
53
|
+
* @returns A promise that resolves to the parsed OpenAPI Document as ApiDOM data model
|
|
54
|
+
* @throws ParseError - When parsing fails for any reason. The original error is available via the `cause` property.
|
|
55
|
+
* @public
|
|
56
|
+
*/
|
|
57
|
+
export declare function parseOpenAPI(source: Record<string, unknown>, options?: OpenAPIOptions): Promise<ParseResultElement>;
|
|
58
|
+
|
|
59
|
+
/**
|
|
60
|
+
* Parses an OpenAPI Document from a string or URI.
|
|
61
|
+
* @param source - The OpenAPI Document as string content, or a file system path / HTTP(S) URL
|
|
62
|
+
* @param options - Reference options (uses defaultOptions when not provided)
|
|
63
|
+
* @returns A promise that resolves to the parsed OpenAPI Document as ApiDOM data model
|
|
64
|
+
* @throws ParseError - When parsing fails for any reason. The original error is available via the `cause` property.
|
|
30
65
|
* @public
|
|
31
66
|
*/
|
|
32
|
-
export declare
|
|
33
|
-
/**
|
|
34
|
-
* Whether to enforce strict parsing mode.
|
|
35
|
-
* Strict parsing mode is using native JSON and YAML parsers without source maps and error recovery.
|
|
36
|
-
* @defaultValue true
|
|
37
|
-
*/
|
|
38
|
-
readonly strict?: boolean;
|
|
39
|
-
/**
|
|
40
|
-
* Whether to include source maps in the parsed result.
|
|
41
|
-
* @defaultValue false
|
|
42
|
-
*/
|
|
43
|
-
readonly sourceMap?: boolean;
|
|
44
|
-
/**
|
|
45
|
-
* Additional options passed to the underlying parsers.
|
|
46
|
-
* @defaultValue \{\}
|
|
47
|
-
*/
|
|
48
|
-
readonly parserOpts?: Record<string, unknown>;
|
|
49
|
-
/**
|
|
50
|
-
* Additional options passed to the underlying resolvers.
|
|
51
|
-
* @defaultValue \{\}
|
|
52
|
-
*/
|
|
53
|
-
readonly resolverOpts?: Record<string, unknown>;
|
|
54
|
-
}
|
|
67
|
+
export declare function parseOpenAPI(source: string, options?: OpenAPIOptions): Promise<ParseResultElement>;
|
|
55
68
|
|
|
56
69
|
export { }
|
|
Binary file
|