@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.
@@ -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
- * Default options for parsing Arazzo Documents.
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 defaultParseOptions: Required<ParseOptions>;
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 - Parsing 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 parse(source: Record<string, unknown>, options?: ParseOptions): Promise<ParseResultElement>;
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 - Parsing 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 parse(source: string, options?: ParseOptions): Promise<ParseResultElement>;
47
+ export declare function parseArazzo(source: string, options?: ArazzoOptions): Promise<ParseResultElement>;
27
48
 
28
49
  /**
29
- * Options for parsing Arazzo Documents.
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 interface ParseOptions {
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