@speclynx/apidom-ns-json-schema-draft-6 1.12.2 → 2.1.0
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 +25 -0
- package/NOTICE +16 -7
- package/README.md +24 -24
- package/dist/apidom-ns-json-schema-draft-6.browser.js +1 -1
- package/package.json +11 -9
- package/src/elements/JSONSchema.cjs +14 -6
- package/src/elements/JSONSchema.mjs +14 -6
- package/src/elements/LinkDescription.cjs +4 -0
- package/src/elements/LinkDescription.mjs +4 -0
- package/src/index.cjs +8 -21
- package/src/index.mjs +2 -5
- package/src/predicates.cjs +4 -15
- package/src/predicates.mjs +2 -15
- package/src/refractor/index.cjs +38 -17
- package/src/refractor/index.mjs +33 -15
- package/src/refractor/inspect.cjs +47 -0
- package/src/refractor/inspect.mjs +39 -0
- package/src/refractor/plugins/replace-empty-element.cjs +28 -26
- package/src/refractor/plugins/replace-empty-element.mjs +14 -11
- package/src/refractor/specification.cjs +14 -2
- package/src/refractor/specification.mjs +14 -2
- package/src/refractor/toolbox.cjs +8 -3
- package/src/refractor/toolbox.mjs +6 -2
- package/src/refractor/visitors/json-schema/ExamplesVisitor.cjs +2 -3
- package/src/refractor/visitors/json-schema/ExamplesVisitor.mjs +2 -3
- package/src/refractor/visitors/json-schema/ItemsVisitor.cjs +3 -4
- package/src/refractor/visitors/json-schema/ItemsVisitor.mjs +3 -4
- package/src/refractor/visitors/json-schema/index.cjs +4 -3
- package/src/refractor/visitors/json-schema/index.mjs +4 -3
- package/src/refractor/visitors/json-schema/link-description/index.cjs +2 -0
- package/src/refractor/visitors/json-schema/link-description/index.mjs +2 -0
- package/types/apidom-ns-json-schema-draft-6.d.ts +90 -245
- package/src/refractor/registration.cjs +0 -13
- package/src/refractor/registration.mjs +0 -6
- package/src/traversal/visitor.cjs +0 -17
- package/src/traversal/visitor.mjs +0 -13
|
@@ -4,38 +4,23 @@ import { AlternatingVisitor } from '@speclynx/apidom-ns-json-schema-draft-4';
|
|
|
4
4
|
import { AlternatingVisitorOptions } from '@speclynx/apidom-ns-json-schema-draft-4';
|
|
5
5
|
import { AnyOfVisitor } from '@speclynx/apidom-ns-json-schema-draft-4';
|
|
6
6
|
import { AnyOfVisitorOptions } from '@speclynx/apidom-ns-json-schema-draft-4';
|
|
7
|
-
import { ArrayElement } from '@speclynx/apidom-
|
|
8
|
-
import { Attributes } from '@speclynx/apidom-
|
|
9
|
-
import { BooleanElement } from '@speclynx/apidom-
|
|
7
|
+
import { ArrayElement } from '@speclynx/apidom-datamodel';
|
|
8
|
+
import { Attributes } from '@speclynx/apidom-datamodel';
|
|
9
|
+
import { BooleanElement } from '@speclynx/apidom-datamodel';
|
|
10
10
|
import { DefinitionsVisitor } from '@speclynx/apidom-ns-json-schema-draft-4';
|
|
11
11
|
import { DefinitionsVisitorOptions } from '@speclynx/apidom-ns-json-schema-draft-4';
|
|
12
12
|
import { DependenciesVisitor } from '@speclynx/apidom-ns-json-schema-draft-4';
|
|
13
13
|
import { DependenciesVisitorOptions } from '@speclynx/apidom-ns-json-schema-draft-4';
|
|
14
|
-
import { Element as Element_2 } from '@speclynx/apidom-
|
|
15
|
-
import { ElementPredicate } from '@speclynx/apidom-core';
|
|
16
|
-
import { EnumVisitor } from '@speclynx/apidom-ns-json-schema-draft-4';
|
|
14
|
+
import { Element as Element_2 } from '@speclynx/apidom-datamodel';
|
|
17
15
|
import { FallbackVisitor } from '@speclynx/apidom-ns-json-schema-draft-4';
|
|
18
16
|
import { FallbackVisitorOptions } from '@speclynx/apidom-ns-json-schema-draft-4';
|
|
19
17
|
import { FixedFieldsVisitor } from '@speclynx/apidom-ns-json-schema-draft-4';
|
|
20
18
|
import { FixedFieldsVisitorOptions } from '@speclynx/apidom-ns-json-schema-draft-4';
|
|
21
|
-
import { getNodeType } from '@speclynx/apidom-ns-json-schema-draft-4';
|
|
22
|
-
import { isArrayElement } from '@speclynx/apidom-core';
|
|
23
|
-
import { isBooleanElement } from '@speclynx/apidom-core';
|
|
24
|
-
import { isElement } from '@speclynx/apidom-core';
|
|
25
19
|
import { isJSONReferenceElement } from '@speclynx/apidom-ns-json-schema-draft-4';
|
|
26
20
|
import { isJSONReferenceLikeElement } from '@speclynx/apidom-ns-json-schema-draft-4';
|
|
27
|
-
import { isLinkElement } from '@speclynx/apidom-core';
|
|
28
21
|
import { isMediaElement } from '@speclynx/apidom-ns-json-schema-draft-4';
|
|
29
|
-
import { isMemberElement } from '@speclynx/apidom-core';
|
|
30
|
-
import { isNullElement } from '@speclynx/apidom-core';
|
|
31
|
-
import { isNumberElement } from '@speclynx/apidom-core';
|
|
32
|
-
import { isObjectElement } from '@speclynx/apidom-core';
|
|
33
|
-
import { isRefElement } from '@speclynx/apidom-core';
|
|
34
|
-
import { isStringElement } from '@speclynx/apidom-core';
|
|
35
22
|
import { ItemsVisitorOptions } from '@speclynx/apidom-ns-json-schema-draft-4';
|
|
36
|
-
import { JSONReference$RefVisitor } from '@speclynx/apidom-ns-json-schema-draft-4';
|
|
37
23
|
import { JSONReferenceElement } from '@speclynx/apidom-ns-json-schema-draft-4';
|
|
38
|
-
import { JSONReferenceVisitor } from '@speclynx/apidom-ns-json-schema-draft-4';
|
|
39
24
|
import { ItemsVisitor as JSONSchemaDraft4ItemsVisitor } from '@speclynx/apidom-ns-json-schema-draft-4';
|
|
40
25
|
import { JSONSchemaElement as JSONSchemaElement_2 } from '@speclynx/apidom-ns-json-schema-draft-4';
|
|
41
26
|
import { JSONSchemaVisitor as JSONSchemaVisitor_2 } from '@speclynx/apidom-ns-json-schema-draft-4';
|
|
@@ -43,36 +28,33 @@ import { JSONSchemaVisitorOptions } from '@speclynx/apidom-ns-json-schema-draft-
|
|
|
43
28
|
import { LinkDescriptionElement as LinkDescriptionElement_2 } from '@speclynx/apidom-ns-json-schema-draft-4';
|
|
44
29
|
import { LinkDescriptionVisitor as LinkDescriptionVisitor_2 } from '@speclynx/apidom-ns-json-schema-draft-4';
|
|
45
30
|
import { LinkDescriptionVisitorOptions } from '@speclynx/apidom-ns-json-schema-draft-4';
|
|
46
|
-
import { LinksVisitor } from '@speclynx/apidom-ns-json-schema-draft-4';
|
|
47
31
|
import { MapVisitor } from '@speclynx/apidom-ns-json-schema-draft-4';
|
|
48
32
|
import { MapVisitorOptions } from '@speclynx/apidom-ns-json-schema-draft-4';
|
|
49
33
|
import { MediaElement } from '@speclynx/apidom-ns-json-schema-draft-4';
|
|
50
34
|
import { MediaTypes } from '@speclynx/apidom-core';
|
|
51
|
-
import {
|
|
52
|
-
import {
|
|
53
|
-
import {
|
|
54
|
-
import {
|
|
55
|
-
import {
|
|
56
|
-
import { ObjectElement } from '@speclynx/apidom-core';
|
|
35
|
+
import { Meta } from '@speclynx/apidom-datamodel';
|
|
36
|
+
import { Namespace } from '@speclynx/apidom-datamodel';
|
|
37
|
+
import { NamespacePlugin } from '@speclynx/apidom-datamodel';
|
|
38
|
+
import { NumberElement } from '@speclynx/apidom-datamodel';
|
|
39
|
+
import { ObjectElement } from '@speclynx/apidom-datamodel';
|
|
57
40
|
import { OneOfVisitor } from '@speclynx/apidom-ns-json-schema-draft-4';
|
|
58
41
|
import { OneOfVisitorOptions } from '@speclynx/apidom-ns-json-schema-draft-4';
|
|
59
42
|
import { ParentSchemaAwareVisitor } from '@speclynx/apidom-ns-json-schema-draft-4';
|
|
60
43
|
import { ParentSchemaAwareVisitorOptions } from '@speclynx/apidom-ns-json-schema-draft-4';
|
|
44
|
+
import { Path } from '@speclynx/apidom-traverse';
|
|
61
45
|
import { PatternedFieldsVisitor } from '@speclynx/apidom-ns-json-schema-draft-4';
|
|
62
46
|
import { PatternedFieldsVisitorOptions } from '@speclynx/apidom-ns-json-schema-draft-4';
|
|
63
47
|
import { PatternPropertiesVisitor } from '@speclynx/apidom-ns-json-schema-draft-4';
|
|
64
48
|
import { PatternPropertiesVisitorOptions } from '@speclynx/apidom-ns-json-schema-draft-4';
|
|
65
49
|
import { PropertiesVisitor } from '@speclynx/apidom-ns-json-schema-draft-4';
|
|
66
50
|
import { PropertiesVisitorOptions } from '@speclynx/apidom-ns-json-schema-draft-4';
|
|
67
|
-
import { RequiredVisitor } from '@speclynx/apidom-ns-json-schema-draft-4';
|
|
68
51
|
import { SchemaOrReferenceVisitor } from '@speclynx/apidom-ns-json-schema-draft-4';
|
|
69
52
|
import { SchemaOrReferenceVisitorOptions } from '@speclynx/apidom-ns-json-schema-draft-4';
|
|
70
53
|
import { specificationObj as specificationObj_2 } from '@speclynx/apidom-ns-json-schema-draft-4';
|
|
71
54
|
import { SpecificationVisitor } from '@speclynx/apidom-ns-json-schema-draft-4';
|
|
72
55
|
import { SpecificationVisitorOptions } from '@speclynx/apidom-ns-json-schema-draft-4';
|
|
73
56
|
import { SpecPath } from '@speclynx/apidom-ns-json-schema-draft-4';
|
|
74
|
-
import { StringElement } from '@speclynx/apidom-
|
|
75
|
-
import { TypeVisitor } from '@speclynx/apidom-ns-json-schema-draft-4';
|
|
57
|
+
import { StringElement } from '@speclynx/apidom-datamodel';
|
|
76
58
|
import { Visitor } from '@speclynx/apidom-ns-json-schema-draft-4';
|
|
77
59
|
import { VisitorOptions } from '@speclynx/apidom-ns-json-schema-draft-4';
|
|
78
60
|
|
|
@@ -88,11 +70,6 @@ export { AnyOfVisitor }
|
|
|
88
70
|
|
|
89
71
|
export { AnyOfVisitorOptions }
|
|
90
72
|
|
|
91
|
-
/**
|
|
92
|
-
* @public
|
|
93
|
-
*/
|
|
94
|
-
export declare const createRefractor: (specPath: string[]) => (value: unknown, options?: {}) => Element_2;
|
|
95
|
-
|
|
96
73
|
export { DefinitionsVisitor }
|
|
97
74
|
|
|
98
75
|
export { DefinitionsVisitorOptions }
|
|
@@ -105,8 +82,9 @@ export { DependenciesVisitorOptions }
|
|
|
105
82
|
* @public
|
|
106
83
|
*/
|
|
107
84
|
export declare class ExamplesVisitor extends FallbackVisitor {
|
|
85
|
+
// @ts-ignore
|
|
108
86
|
readonly element: ArrayElement;
|
|
109
|
-
ArrayElement(
|
|
87
|
+
ArrayElement(path: Path<ArrayElement>): void;
|
|
110
88
|
}
|
|
111
89
|
|
|
112
90
|
export { FallbackVisitor }
|
|
@@ -114,6 +92,15 @@ export { FallbackVisitor }
|
|
|
114
92
|
export { FallbackVisitorOptions as ExamplesVisitorOptions }
|
|
115
93
|
export { FallbackVisitorOptions }
|
|
116
94
|
|
|
95
|
+
/**
|
|
96
|
+
* @public
|
|
97
|
+
*/
|
|
98
|
+
export declare interface FixedField {
|
|
99
|
+
name: string;
|
|
100
|
+
alias?: string;
|
|
101
|
+
$visitor: unknown;
|
|
102
|
+
}
|
|
103
|
+
|
|
117
104
|
export { FixedFieldsVisitor }
|
|
118
105
|
|
|
119
106
|
export { FixedFieldsVisitorOptions }
|
|
@@ -123,14 +110,6 @@ export { FixedFieldsVisitorOptions }
|
|
|
123
110
|
*/
|
|
124
111
|
export declare type Format = 'generic' | 'json' | 'yaml';
|
|
125
112
|
|
|
126
|
-
export { getNodeType }
|
|
127
|
-
|
|
128
|
-
export { isArrayElement }
|
|
129
|
-
|
|
130
|
-
export { isBooleanElement }
|
|
131
|
-
|
|
132
|
-
export { isElement }
|
|
133
|
-
|
|
134
113
|
export { isJSONReferenceElement }
|
|
135
114
|
|
|
136
115
|
export { isJSONReferenceLikeElement }
|
|
@@ -138,34 +117,20 @@ export { isJSONReferenceLikeElement }
|
|
|
138
117
|
/**
|
|
139
118
|
* @public
|
|
140
119
|
*/
|
|
141
|
-
export declare const isJSONSchemaElement:
|
|
120
|
+
export declare const isJSONSchemaElement: (element: unknown) => element is JSONSchemaElement;
|
|
142
121
|
|
|
143
122
|
/**
|
|
144
123
|
* @public
|
|
145
124
|
*/
|
|
146
|
-
export declare const isLinkDescriptionElement:
|
|
147
|
-
|
|
148
|
-
export { isLinkElement }
|
|
125
|
+
export declare const isLinkDescriptionElement: (element: unknown) => element is LinkDescriptionElement;
|
|
149
126
|
|
|
150
127
|
export { isMediaElement }
|
|
151
128
|
|
|
152
|
-
export { isMemberElement }
|
|
153
|
-
|
|
154
|
-
export { isNullElement }
|
|
155
|
-
|
|
156
|
-
export { isNumberElement }
|
|
157
|
-
|
|
158
|
-
export { isObjectElement }
|
|
159
|
-
|
|
160
|
-
export { isRefElement }
|
|
161
|
-
|
|
162
|
-
export { isStringElement }
|
|
163
|
-
|
|
164
129
|
/**
|
|
165
130
|
* @public
|
|
166
131
|
*/
|
|
167
132
|
export declare class ItemsVisitor extends JSONSchemaDraft4ItemsVisitor {
|
|
168
|
-
BooleanElement(
|
|
133
|
+
BooleanElement(path: Path<BooleanElement>): void;
|
|
169
134
|
}
|
|
170
135
|
|
|
171
136
|
export { ItemsVisitorOptions }
|
|
@@ -177,9 +142,7 @@ export { JSONSchemaDraft4ItemsVisitor }
|
|
|
177
142
|
/**
|
|
178
143
|
* @public
|
|
179
144
|
*/
|
|
180
|
-
declare const jsonSchemaDraft6:
|
|
181
|
-
namespace: (options: NamespacePluginOptions) => Namespace;
|
|
182
|
-
};
|
|
145
|
+
declare const jsonSchemaDraft6: NamespacePlugin;
|
|
183
146
|
export default jsonSchemaDraft6;
|
|
184
147
|
|
|
185
148
|
/**
|
|
@@ -201,8 +164,8 @@ export declare class JSONSchemaElement extends JSONSchemaElement_2 {
|
|
|
201
164
|
*
|
|
202
165
|
* URI: https://datatracker.ietf.org/doc/html/draft-wright-json-schema-01
|
|
203
166
|
*/
|
|
204
|
-
get
|
|
205
|
-
set
|
|
167
|
+
get idField(): StringElement | undefined;
|
|
168
|
+
set idField(id: StringElement | undefined);
|
|
206
169
|
get $id(): StringElement | undefined;
|
|
207
170
|
set $id($id: StringElement | undefined);
|
|
208
171
|
/**
|
|
@@ -220,10 +183,12 @@ export declare class JSONSchemaElement extends JSONSchemaElement_2 {
|
|
|
220
183
|
/**
|
|
221
184
|
* Validation keywords for arrays
|
|
222
185
|
*/
|
|
223
|
-
get
|
|
224
|
-
set
|
|
225
|
-
|
|
226
|
-
|
|
186
|
+
get containsField(): this | BooleanElement | JSONReferenceElement | undefined;
|
|
187
|
+
set containsField(contains: this | BooleanElement | JSONReferenceElement | undefined);
|
|
188
|
+
// @ts-ignore
|
|
189
|
+
get itemsField(): this | BooleanElement | JSONReferenceElement | ArrayElement<this | BooleanElement | JSONReferenceElement> | undefined;
|
|
190
|
+
// @ts-ignore
|
|
191
|
+
set itemsField(items: this | BooleanElement | JSONReferenceElement | ArrayElement<this | BooleanElement | JSONReferenceElement> | undefined);
|
|
227
192
|
/**
|
|
228
193
|
* Validation keywords for objects
|
|
229
194
|
*/
|
|
@@ -234,53 +199,33 @@ export declare class JSONSchemaElement extends JSONSchemaElement_2 {
|
|
|
234
199
|
*/
|
|
235
200
|
get const(): Element_2 | undefined;
|
|
236
201
|
set const(constValue: Element_2 | undefined);
|
|
237
|
-
|
|
238
|
-
|
|
202
|
+
// @ts-ignore
|
|
203
|
+
get not(): this | BooleanElement | JSONReferenceElement | undefined;
|
|
204
|
+
// @ts-ignore
|
|
205
|
+
set not(not: this | BooleanElement | JSONReferenceElement | undefined);
|
|
239
206
|
/**
|
|
240
207
|
* Metadata keywords
|
|
241
208
|
*
|
|
242
209
|
* URI: https://datatracker.ietf.org/doc/html/draft-wright-json-schema-validation-01#section-7
|
|
243
210
|
*/
|
|
244
|
-
get examples(): ArrayElement | undefined;
|
|
245
|
-
set examples(examples: ArrayElement | undefined);
|
|
211
|
+
get examples(): ArrayElement<Element_2> | undefined;
|
|
212
|
+
set examples(examples: ArrayElement<Element_2> | undefined);
|
|
246
213
|
}
|
|
247
214
|
|
|
248
215
|
/**
|
|
249
216
|
* @public
|
|
250
217
|
*/
|
|
251
218
|
export declare class JSONSchemaVisitor extends JSONSchemaVisitor_2 {
|
|
252
|
-
|
|
219
|
+
// @ts-ignore
|
|
220
|
+
element: JSONSchemaElement | BooleanElement;
|
|
253
221
|
constructor(options: JSONSchemaVisitorOptions);
|
|
254
222
|
get defaultDialectIdentifier(): string;
|
|
255
|
-
BooleanElement(
|
|
223
|
+
BooleanElement(path: Path<BooleanElement>): void;
|
|
256
224
|
handleSchemaIdentifier(objectElement: ObjectElement, identifierKeyword?: string): void;
|
|
257
225
|
}
|
|
258
226
|
|
|
259
227
|
export { JSONSchemaVisitorOptions }
|
|
260
228
|
|
|
261
|
-
/**
|
|
262
|
-
* @public
|
|
263
|
-
*/
|
|
264
|
-
export declare const keyMap: {
|
|
265
|
-
ObjectElement: string[];
|
|
266
|
-
ArrayElement: string[];
|
|
267
|
-
MemberElement: string[];
|
|
268
|
-
StringElement: never[];
|
|
269
|
-
BooleanElement: never[];
|
|
270
|
-
NumberElement: never[];
|
|
271
|
-
NullElement: never[];
|
|
272
|
-
RefElement: never[];
|
|
273
|
-
LinkElement: never[];
|
|
274
|
-
Annotation: never[];
|
|
275
|
-
Comment: never[];
|
|
276
|
-
ParseResultElement: string[];
|
|
277
|
-
SourceMap: string[];
|
|
278
|
-
JSONSchemaDraft6Element: string[];
|
|
279
|
-
JSONReferenceElement: string[];
|
|
280
|
-
MediaElement: string[];
|
|
281
|
-
LinkDescriptionElement: string[];
|
|
282
|
-
};
|
|
283
|
-
|
|
284
229
|
/**
|
|
285
230
|
* URI: https://datatracker.ietf.org/doc/html/draft-wright-json-schema-hyperschema-01#section-6
|
|
286
231
|
* @public
|
|
@@ -288,10 +233,12 @@ export declare const keyMap: {
|
|
|
288
233
|
export declare class LinkDescriptionElement extends LinkDescriptionElement_2 {
|
|
289
234
|
get hrefSchema(): JSONSchemaElement | BooleanElement | JSONReferenceElement | undefined;
|
|
290
235
|
set hrefSchema(hrefSchema: JSONSchemaElement | BooleanElement | JSONReferenceElement | undefined);
|
|
291
|
-
|
|
292
|
-
|
|
293
|
-
|
|
294
|
-
set
|
|
236
|
+
// @ts-ignore
|
|
237
|
+
get targetSchema(): JSONSchemaElement | BooleanElement | JSONReferenceElement | undefined;
|
|
238
|
+
// @ts-ignore
|
|
239
|
+
set targetSchema(targetSchema: JSONSchemaElement | BooleanElement | JSONReferenceElement | undefined);
|
|
240
|
+
get schema(): JSONSchemaElement_2 | JSONReferenceElement | undefined;
|
|
241
|
+
set schema(schema: JSONSchemaElement_2 | JSONReferenceElement | undefined);
|
|
295
242
|
get submissionSchema(): JSONSchemaElement | BooleanElement | JSONReferenceElement | undefined;
|
|
296
243
|
set submissionSchema(submissionSchema: JSONSchemaElement | BooleanElement | JSONReferenceElement | undefined);
|
|
297
244
|
get method(): StringElement | undefined;
|
|
@@ -306,6 +253,7 @@ export declare class LinkDescriptionElement extends LinkDescriptionElement_2 {
|
|
|
306
253
|
* @public
|
|
307
254
|
*/
|
|
308
255
|
export declare class LinkDescriptionVisitor extends LinkDescriptionVisitor_2 {
|
|
256
|
+
// @ts-ignore
|
|
309
257
|
readonly element: LinkDescriptionElement;
|
|
310
258
|
constructor(options: LinkDescriptionVisitorOptions);
|
|
311
259
|
}
|
|
@@ -346,155 +294,44 @@ export { PropertiesVisitorOptions }
|
|
|
346
294
|
/**
|
|
347
295
|
* @public
|
|
348
296
|
*/
|
|
349
|
-
export declare const refract: <T extends Element_2>(value: unknown, {
|
|
350
|
-
|
|
351
|
-
|
|
352
|
-
|
|
353
|
-
|
|
354
|
-
|
|
355
|
-
|
|
356
|
-
|
|
357
|
-
|
|
358
|
-
|
|
359
|
-
|
|
360
|
-
|
|
361
|
-
|
|
362
|
-
|
|
363
|
-
|
|
364
|
-
|
|
365
|
-
|
|
366
|
-
|
|
367
|
-
|
|
368
|
-
|
|
369
|
-
|
|
370
|
-
|
|
371
|
-
|
|
372
|
-
|
|
373
|
-
|
|
374
|
-
|
|
375
|
-
|
|
376
|
-
|
|
377
|
-
|
|
378
|
-
|
|
379
|
-
|
|
380
|
-
$ref: string;
|
|
381
|
-
};
|
|
382
|
-
maxLength: {
|
|
383
|
-
$ref: string;
|
|
384
|
-
};
|
|
385
|
-
minLength: {
|
|
386
|
-
$ref: string;
|
|
387
|
-
};
|
|
388
|
-
pattern: {
|
|
389
|
-
$ref: string;
|
|
390
|
-
};
|
|
391
|
-
additionalItems: SchemaOrReferenceVisitor;
|
|
392
|
-
items: JSONSchemaDraft4ItemsVisitor;
|
|
393
|
-
maxItems: {
|
|
394
|
-
$ref: string;
|
|
395
|
-
};
|
|
396
|
-
minItems: {
|
|
397
|
-
$ref: string;
|
|
398
|
-
};
|
|
399
|
-
uniqueItems: {
|
|
400
|
-
$ref: string;
|
|
401
|
-
};
|
|
402
|
-
maxProperties: {
|
|
403
|
-
$ref: string;
|
|
404
|
-
};
|
|
405
|
-
minProperties: {
|
|
406
|
-
$ref: string;
|
|
407
|
-
};
|
|
408
|
-
required: RequiredVisitor;
|
|
409
|
-
properties: PropertiesVisitor;
|
|
410
|
-
additionalProperties: SchemaOrReferenceVisitor;
|
|
411
|
-
patternProperties: PatternPropertiesVisitor;
|
|
412
|
-
dependencies: DependenciesVisitor;
|
|
413
|
-
enum: EnumVisitor;
|
|
414
|
-
type: TypeVisitor;
|
|
415
|
-
allOf: AllOfVisitor;
|
|
416
|
-
anyOf: AnyOfVisitor;
|
|
417
|
-
oneOf: OneOfVisitor;
|
|
418
|
-
not: SchemaOrReferenceVisitor;
|
|
419
|
-
definitions: DefinitionsVisitor;
|
|
420
|
-
title: {
|
|
421
|
-
$ref: string;
|
|
422
|
-
};
|
|
423
|
-
description: {
|
|
424
|
-
$ref: string;
|
|
425
|
-
};
|
|
426
|
-
default: {
|
|
427
|
-
$ref: string;
|
|
428
|
-
};
|
|
429
|
-
format: {
|
|
430
|
-
$ref: string;
|
|
431
|
-
};
|
|
432
|
-
base: {
|
|
433
|
-
$ref: string;
|
|
434
|
-
};
|
|
435
|
-
links: LinksVisitor;
|
|
436
|
-
media: {
|
|
437
|
-
$ref: string;
|
|
438
|
-
};
|
|
439
|
-
readOnly: {
|
|
440
|
-
$ref: string;
|
|
441
|
-
};
|
|
442
|
-
};
|
|
443
|
-
};
|
|
444
|
-
JSONReference: {
|
|
445
|
-
$visitor: JSONReferenceVisitor;
|
|
446
|
-
fixedFields: {
|
|
447
|
-
$ref: JSONReference$RefVisitor;
|
|
448
|
-
};
|
|
449
|
-
};
|
|
450
|
-
Media: {
|
|
451
|
-
$visitor: MediaVisitor;
|
|
452
|
-
fixedFields: {
|
|
453
|
-
binaryEncoding: {
|
|
454
|
-
$ref: string;
|
|
455
|
-
};
|
|
456
|
-
type: {
|
|
457
|
-
$ref: string;
|
|
458
|
-
};
|
|
459
|
-
};
|
|
460
|
-
};
|
|
461
|
-
LinkDescription: {
|
|
462
|
-
$visitor: LinkDescriptionVisitor_2;
|
|
463
|
-
fixedFields: {
|
|
464
|
-
href: {
|
|
465
|
-
$ref: string;
|
|
466
|
-
};
|
|
467
|
-
rel: {
|
|
468
|
-
$ref: string;
|
|
469
|
-
};
|
|
470
|
-
title: {
|
|
471
|
-
$ref: string;
|
|
472
|
-
};
|
|
473
|
-
targetSchema: SchemaOrReferenceVisitor;
|
|
474
|
-
mediaType: {
|
|
475
|
-
$ref: string;
|
|
476
|
-
};
|
|
477
|
-
method: {
|
|
478
|
-
$ref: string;
|
|
479
|
-
};
|
|
480
|
-
encType: {
|
|
481
|
-
$ref: string;
|
|
482
|
-
};
|
|
483
|
-
schema: SchemaOrReferenceVisitor;
|
|
484
|
-
};
|
|
485
|
-
};
|
|
486
|
-
};
|
|
487
|
-
};
|
|
488
|
-
};
|
|
489
|
-
} | undefined;
|
|
490
|
-
}) => T;
|
|
297
|
+
export declare const refract: <T extends Element_2>(value: unknown, { element, plugins, specificationObj, }?: RefractorOptions) => T;
|
|
298
|
+
|
|
299
|
+
/**
|
|
300
|
+
* Refracts a value into a JSONSchemaElement.
|
|
301
|
+
* @public
|
|
302
|
+
*/
|
|
303
|
+
export declare const refractJSONSchema: <T extends Element_2 = JSONSchemaElement>(value: unknown, options?: Omit<RefractorOptions, "element">) => T;
|
|
304
|
+
|
|
305
|
+
/**
|
|
306
|
+
* Refracts a value into a LinkDescriptionElement.
|
|
307
|
+
* @public
|
|
308
|
+
*/
|
|
309
|
+
export declare const refractLinkDescription: <T extends Element_2 = LinkDescriptionElement>(value: unknown, options?: Omit<RefractorOptions, "element">) => T;
|
|
310
|
+
|
|
311
|
+
/**
|
|
312
|
+
* @public
|
|
313
|
+
*/
|
|
314
|
+
export declare interface RefractorOptions {
|
|
315
|
+
readonly element?: string;
|
|
316
|
+
readonly plugins?: RefractorPlugin[];
|
|
317
|
+
readonly specificationObj?: typeof specificationObj;
|
|
318
|
+
}
|
|
319
|
+
|
|
320
|
+
/**
|
|
321
|
+
* @public
|
|
322
|
+
*/
|
|
323
|
+
export declare type RefractorPlugin = (toolbox: Toolbox) => {
|
|
324
|
+
visitor?: object;
|
|
325
|
+
pre?: () => void;
|
|
326
|
+
post?: () => void;
|
|
327
|
+
};
|
|
491
328
|
|
|
492
329
|
/**
|
|
493
330
|
* @public
|
|
494
331
|
*/
|
|
495
332
|
export declare const refractorPluginReplaceEmptyElement: () => () => {
|
|
496
333
|
visitor: {
|
|
497
|
-
StringElement(
|
|
334
|
+
StringElement(path: Path<StringElement>): void;
|
|
498
335
|
};
|
|
499
336
|
};
|
|
500
337
|
|
|
@@ -510,6 +347,14 @@ export { SpecificationVisitorOptions }
|
|
|
510
347
|
|
|
511
348
|
export { SpecPath }
|
|
512
349
|
|
|
350
|
+
/**
|
|
351
|
+
* @public
|
|
352
|
+
*/
|
|
353
|
+
export declare interface Toolbox {
|
|
354
|
+
predicates: Record<string, (...args: any[]) => boolean>;
|
|
355
|
+
namespace: Namespace;
|
|
356
|
+
}
|
|
357
|
+
|
|
513
358
|
export { Visitor }
|
|
514
359
|
|
|
515
360
|
export { VisitorOptions }
|
|
@@ -1,13 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
|
|
3
|
-
var _interopRequireDefault = require("@babel/runtime-corejs3/helpers/interopRequireDefault").default;
|
|
4
|
-
exports.__esModule = true;
|
|
5
|
-
var _JSONSchema = _interopRequireDefault(require("../elements/JSONSchema.cjs"));
|
|
6
|
-
exports.JSONSchemaElement = _JSONSchema.default;
|
|
7
|
-
var _LinkDescription = _interopRequireDefault(require("../elements/LinkDescription.cjs"));
|
|
8
|
-
exports.LinkDescriptionElement = _LinkDescription.default;
|
|
9
|
-
var _index = require("./index.cjs");
|
|
10
|
-
// register refractors specific to element types
|
|
11
|
-
|
|
12
|
-
_JSONSchema.default.refract = (0, _index.createRefractor)(['visitors', 'document', 'objects', 'JSONSchema', '$visitor']);
|
|
13
|
-
_LinkDescription.default.refract = (0, _index.createRefractor)(['visitors', 'document', 'objects', 'LinkDescription', '$visitor']);
|
|
@@ -1,6 +0,0 @@
|
|
|
1
|
-
import JSONSchemaElement from "../elements/JSONSchema.mjs";
|
|
2
|
-
import LinkDescriptionElement from "../elements/LinkDescription.mjs";
|
|
3
|
-
import { createRefractor } from "./index.mjs"; // register refractors specific to element types
|
|
4
|
-
JSONSchemaElement.refract = createRefractor(['visitors', 'document', 'objects', 'JSONSchema', '$visitor']);
|
|
5
|
-
LinkDescriptionElement.refract = createRefractor(['visitors', 'document', 'objects', 'LinkDescription', '$visitor']);
|
|
6
|
-
export { JSONSchemaElement, LinkDescriptionElement };
|
|
@@ -1,17 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
|
|
3
|
-
exports.__esModule = true;
|
|
4
|
-
exports.keyMap = exports.getNodeType = void 0;
|
|
5
|
-
var _apidomCore = require("@speclynx/apidom-core");
|
|
6
|
-
var _apidomNsJsonSchemaDraft = require("@speclynx/apidom-ns-json-schema-draft-4");
|
|
7
|
-
exports.getNodeType = _apidomNsJsonSchemaDraft.getNodeType;
|
|
8
|
-
/**
|
|
9
|
-
* @public
|
|
10
|
-
*/
|
|
11
|
-
const keyMap = exports.keyMap = {
|
|
12
|
-
JSONSchemaDraft6Element: ['content'],
|
|
13
|
-
JSONReferenceElement: ['content'],
|
|
14
|
-
MediaElement: ['content'],
|
|
15
|
-
LinkDescriptionElement: ['content'],
|
|
16
|
-
..._apidomCore.keyMap
|
|
17
|
-
};
|
|
@@ -1,13 +0,0 @@
|
|
|
1
|
-
import { keyMap as keyMapBase } from '@speclynx/apidom-core';
|
|
2
|
-
export { getNodeType } from '@speclynx/apidom-ns-json-schema-draft-4';
|
|
3
|
-
|
|
4
|
-
/**
|
|
5
|
-
* @public
|
|
6
|
-
*/
|
|
7
|
-
export const keyMap = {
|
|
8
|
-
JSONSchemaDraft6Element: ['content'],
|
|
9
|
-
JSONReferenceElement: ['content'],
|
|
10
|
-
MediaElement: ['content'],
|
|
11
|
-
LinkDescriptionElement: ['content'],
|
|
12
|
-
...keyMapBase
|
|
13
|
-
};
|