@speclynx/apidom-ns-json-schema-draft-4 3.2.0 → 4.0.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 +16 -0
- package/dist/apidom-ns-json-schema-draft-4.browser.js +24 -20
- package/package.json +5 -5
- package/src/elements/JSONReference.cjs +0 -29
- package/src/elements/JSONReference.mjs +0 -25
- package/src/elements/JSONSchema.cjs +0 -296
- package/src/elements/JSONSchema.mjs +0 -292
- package/src/elements/LinkDescription.cjs +0 -65
- package/src/elements/LinkDescription.mjs +0 -61
- package/src/elements/Media.cjs +0 -29
- package/src/elements/Media.mjs +0 -25
- package/src/index.cjs +0 -69
- package/src/index.mjs +0 -23
- package/src/media-types.cjs +0 -34
- package/src/media-types.mjs +0 -30
- package/src/namespace.cjs +0 -25
- package/src/namespace.mjs +0 -20
- package/src/predicates.cjs +0 -32
- package/src/predicates.mjs +0 -23
- package/src/refractor/index.cjs +0 -96
- package/src/refractor/index.mjs +0 -85
- package/src/refractor/inspect.cjs +0 -55
- package/src/refractor/inspect.mjs +0 -47
- package/src/refractor/plugins/replace-empty-element.cjs +0 -208
- package/src/refractor/plugins/replace-empty-element.mjs +0 -202
- package/src/refractor/predicates.cjs +0 -16
- package/src/refractor/predicates.mjs +0 -12
- package/src/refractor/specification.cjs +0 -193
- package/src/refractor/specification.mjs +0 -188
- package/src/refractor/toolbox.cjs +0 -28
- package/src/refractor/toolbox.mjs +0 -21
- package/src/refractor/visitors/FallbackVisitor.cjs +0 -25
- package/src/refractor/visitors/FallbackVisitor.mjs +0 -19
- package/src/refractor/visitors/SpecificationVisitor.cjs +0 -75
- package/src/refractor/visitors/SpecificationVisitor.mjs +0 -69
- package/src/refractor/visitors/Visitor.cjs +0 -36
- package/src/refractor/visitors/Visitor.mjs +0 -33
- package/src/refractor/visitors/generics/AlternatingVisitor.cjs +0 -42
- package/src/refractor/visitors/generics/AlternatingVisitor.mjs +0 -35
- package/src/refractor/visitors/generics/FixedFieldsVisitor.cjs +0 -57
- package/src/refractor/visitors/generics/FixedFieldsVisitor.mjs +0 -50
- package/src/refractor/visitors/generics/MapVisitor.cjs +0 -21
- package/src/refractor/visitors/generics/MapVisitor.mjs +0 -15
- package/src/refractor/visitors/generics/PatternedFieldsVisitor.cjs +0 -58
- package/src/refractor/visitors/generics/PatternedFieldsVisitor.mjs +0 -52
- package/src/refractor/visitors/json-schema/AllOfVisitor.cjs +0 -32
- package/src/refractor/visitors/json-schema/AllOfVisitor.mjs +0 -27
- package/src/refractor/visitors/json-schema/AnyOfVisitor.cjs +0 -32
- package/src/refractor/visitors/json-schema/AnyOfVisitor.mjs +0 -27
- package/src/refractor/visitors/json-schema/DefinitionsVisitor.cjs +0 -23
- package/src/refractor/visitors/json-schema/DefinitionsVisitor.mjs +0 -18
- package/src/refractor/visitors/json-schema/DependenciesVisitor.cjs +0 -23
- package/src/refractor/visitors/json-schema/DependenciesVisitor.mjs +0 -18
- package/src/refractor/visitors/json-schema/EnumVisitor.cjs +0 -16
- package/src/refractor/visitors/json-schema/EnumVisitor.mjs +0 -11
- package/src/refractor/visitors/json-schema/ItemsVisitor.cjs +0 -35
- package/src/refractor/visitors/json-schema/ItemsVisitor.mjs +0 -30
- package/src/refractor/visitors/json-schema/JSONSchemaOrJSONReferenceVisitor.cjs +0 -24
- package/src/refractor/visitors/json-schema/JSONSchemaOrJSONReferenceVisitor.mjs +0 -19
- package/src/refractor/visitors/json-schema/LinksVisitor.cjs +0 -30
- package/src/refractor/visitors/json-schema/LinksVisitor.mjs +0 -25
- package/src/refractor/visitors/json-schema/OneOfVisitor.cjs +0 -32
- package/src/refractor/visitors/json-schema/OneOfVisitor.mjs +0 -27
- package/src/refractor/visitors/json-schema/ParentSchemaAwareVisitor.cjs +0 -20
- package/src/refractor/visitors/json-schema/ParentSchemaAwareVisitor.mjs +0 -16
- package/src/refractor/visitors/json-schema/PatternPropertiesVisitor.cjs +0 -23
- package/src/refractor/visitors/json-schema/PatternPropertiesVisitor.mjs +0 -18
- package/src/refractor/visitors/json-schema/PropertiesVisitor.cjs +0 -23
- package/src/refractor/visitors/json-schema/PropertiesVisitor.mjs +0 -18
- package/src/refractor/visitors/json-schema/RequiredVisitor.cjs +0 -16
- package/src/refractor/visitors/json-schema/RequiredVisitor.mjs +0 -11
- package/src/refractor/visitors/json-schema/TypeVisitor.cjs +0 -20
- package/src/refractor/visitors/json-schema/TypeVisitor.mjs +0 -15
- package/src/refractor/visitors/json-schema/bases.cjs +0 -45
- package/src/refractor/visitors/json-schema/bases.mjs +0 -39
- package/src/refractor/visitors/json-schema/index.cjs +0 -65
- package/src/refractor/visitors/json-schema/index.mjs +0 -59
- package/src/refractor/visitors/json-schema/json-reference/$RefVisitor.cjs +0 -16
- package/src/refractor/visitors/json-schema/json-reference/$RefVisitor.mjs +0 -11
- package/src/refractor/visitors/json-schema/json-reference/index.cjs +0 -33
- package/src/refractor/visitors/json-schema/json-reference/index.mjs +0 -27
- package/src/refractor/visitors/json-schema/link-description/index.cjs +0 -23
- package/src/refractor/visitors/json-schema/link-description/index.mjs +0 -17
- package/src/refractor/visitors/json-schema/media/index.cjs +0 -23
- package/src/refractor/visitors/json-schema/media/index.mjs +0 -17
|
@@ -1,292 +0,0 @@
|
|
|
1
|
-
import { ObjectElement } from '@speclynx/apidom-datamodel';
|
|
2
|
-
/**
|
|
3
|
-
* @public
|
|
4
|
-
*/
|
|
5
|
-
class JSONSchema extends ObjectElement {
|
|
6
|
-
constructor(content, meta, attributes) {
|
|
7
|
-
super(content, meta, attributes);
|
|
8
|
-
this.element = 'JSONSchemaDraft4';
|
|
9
|
-
}
|
|
10
|
-
|
|
11
|
-
/**
|
|
12
|
-
* Core vocabulary
|
|
13
|
-
*
|
|
14
|
-
* URI: https://tools.ietf.org/html/draft-wright-json-schema-00
|
|
15
|
-
*/
|
|
16
|
-
|
|
17
|
-
get idField() {
|
|
18
|
-
return this.get('id');
|
|
19
|
-
}
|
|
20
|
-
set idField(idField) {
|
|
21
|
-
this.set('id', idField);
|
|
22
|
-
}
|
|
23
|
-
get $schema() {
|
|
24
|
-
return this.get('$schema');
|
|
25
|
-
}
|
|
26
|
-
set $schema($schema) {
|
|
27
|
-
this.set('$schema', $schema);
|
|
28
|
-
}
|
|
29
|
-
|
|
30
|
-
/**
|
|
31
|
-
* Validation vocabulary
|
|
32
|
-
*
|
|
33
|
-
* URI: https://tools.ietf.org/html/draft-wright-json-schema-validation-00
|
|
34
|
-
*/
|
|
35
|
-
|
|
36
|
-
/**
|
|
37
|
-
* Validation keywords for numeric instances (number and integer)
|
|
38
|
-
*/
|
|
39
|
-
|
|
40
|
-
get multipleOf() {
|
|
41
|
-
return this.get('multipleOf');
|
|
42
|
-
}
|
|
43
|
-
set multipleOf(multipleOf) {
|
|
44
|
-
this.set('multipleOf', multipleOf);
|
|
45
|
-
}
|
|
46
|
-
get maximum() {
|
|
47
|
-
return this.get('maximum');
|
|
48
|
-
}
|
|
49
|
-
set maximum(maximum) {
|
|
50
|
-
this.set('maximum', maximum);
|
|
51
|
-
}
|
|
52
|
-
get exclusiveMaximum() {
|
|
53
|
-
return this.get('exclusiveMaximum');
|
|
54
|
-
}
|
|
55
|
-
set exclusiveMaximum(exclusiveMaximum) {
|
|
56
|
-
this.set('exclusiveMaximum', exclusiveMaximum);
|
|
57
|
-
}
|
|
58
|
-
get minimum() {
|
|
59
|
-
return this.get('minimum');
|
|
60
|
-
}
|
|
61
|
-
set minimum(minimum) {
|
|
62
|
-
this.set('minimum', minimum);
|
|
63
|
-
}
|
|
64
|
-
get exclusiveMinimum() {
|
|
65
|
-
return this.get('exclusiveMinimum');
|
|
66
|
-
}
|
|
67
|
-
set exclusiveMinimum(exclusiveMinimum) {
|
|
68
|
-
this.set('exclusiveMinimum', exclusiveMinimum);
|
|
69
|
-
}
|
|
70
|
-
|
|
71
|
-
/**
|
|
72
|
-
* Validation keywords for strings
|
|
73
|
-
*/
|
|
74
|
-
|
|
75
|
-
get maxLength() {
|
|
76
|
-
return this.get('maxLength');
|
|
77
|
-
}
|
|
78
|
-
set maxLength(maxLength) {
|
|
79
|
-
this.set('maxLength', maxLength);
|
|
80
|
-
}
|
|
81
|
-
get minLength() {
|
|
82
|
-
return this.get('minLength');
|
|
83
|
-
}
|
|
84
|
-
set minLength(minLength) {
|
|
85
|
-
this.set('minLength', minLength);
|
|
86
|
-
}
|
|
87
|
-
get pattern() {
|
|
88
|
-
return this.get('pattern');
|
|
89
|
-
}
|
|
90
|
-
set pattern(pattern) {
|
|
91
|
-
this.set('pattern', pattern);
|
|
92
|
-
}
|
|
93
|
-
|
|
94
|
-
/**
|
|
95
|
-
* Validation keywords for arrays
|
|
96
|
-
*/
|
|
97
|
-
|
|
98
|
-
get additionalItems() {
|
|
99
|
-
return this.get('additionalItems');
|
|
100
|
-
}
|
|
101
|
-
set additionalItems(additionalItems) {
|
|
102
|
-
this.set('additionalItems', additionalItems);
|
|
103
|
-
}
|
|
104
|
-
get itemsField() {
|
|
105
|
-
return this.get('items');
|
|
106
|
-
}
|
|
107
|
-
set itemsField(items) {
|
|
108
|
-
this.set('items', items);
|
|
109
|
-
}
|
|
110
|
-
get maxItems() {
|
|
111
|
-
return this.get('maxItems');
|
|
112
|
-
}
|
|
113
|
-
set maxItems(maxItems) {
|
|
114
|
-
this.set('maxItems', maxItems);
|
|
115
|
-
}
|
|
116
|
-
get minItems() {
|
|
117
|
-
return this.get('minItems');
|
|
118
|
-
}
|
|
119
|
-
set minItems(minItems) {
|
|
120
|
-
this.set('minItems', minItems);
|
|
121
|
-
}
|
|
122
|
-
get uniqueItems() {
|
|
123
|
-
return this.get('uniqueItems');
|
|
124
|
-
}
|
|
125
|
-
set uniqueItems(uniqueItems) {
|
|
126
|
-
this.set('uniqueItems', uniqueItems);
|
|
127
|
-
}
|
|
128
|
-
|
|
129
|
-
/**
|
|
130
|
-
* Validation keywords for objects
|
|
131
|
-
*/
|
|
132
|
-
|
|
133
|
-
get maxProperties() {
|
|
134
|
-
return this.get('maxProperties');
|
|
135
|
-
}
|
|
136
|
-
set maxProperties(maxProperties) {
|
|
137
|
-
this.set('maxProperties', maxProperties);
|
|
138
|
-
}
|
|
139
|
-
get minProperties() {
|
|
140
|
-
return this.get('minProperties');
|
|
141
|
-
}
|
|
142
|
-
set minProperties(minProperties) {
|
|
143
|
-
this.set('minProperties', minProperties);
|
|
144
|
-
}
|
|
145
|
-
get required() {
|
|
146
|
-
return this.get('required');
|
|
147
|
-
}
|
|
148
|
-
set required(required) {
|
|
149
|
-
this.set('required', required);
|
|
150
|
-
}
|
|
151
|
-
get properties() {
|
|
152
|
-
return this.get('properties');
|
|
153
|
-
}
|
|
154
|
-
set properties(properties) {
|
|
155
|
-
this.set('properties', properties);
|
|
156
|
-
}
|
|
157
|
-
get additionalProperties() {
|
|
158
|
-
return this.get('additionalProperties');
|
|
159
|
-
}
|
|
160
|
-
set additionalProperties(additionalProperties) {
|
|
161
|
-
this.set('additionalProperties', additionalProperties);
|
|
162
|
-
}
|
|
163
|
-
get patternProperties() {
|
|
164
|
-
return this.get('patternProperties');
|
|
165
|
-
}
|
|
166
|
-
set patternProperties(patternProperties) {
|
|
167
|
-
this.set('patternProperties', patternProperties);
|
|
168
|
-
}
|
|
169
|
-
get dependencies() {
|
|
170
|
-
return this.get('dependencies');
|
|
171
|
-
}
|
|
172
|
-
set dependencies(dependencies) {
|
|
173
|
-
this.set('dependencies', dependencies);
|
|
174
|
-
}
|
|
175
|
-
|
|
176
|
-
/**
|
|
177
|
-
* Validation keywords for any instance type
|
|
178
|
-
*/
|
|
179
|
-
|
|
180
|
-
get enum() {
|
|
181
|
-
return this.get('enum');
|
|
182
|
-
}
|
|
183
|
-
set enum(enumValue) {
|
|
184
|
-
this.set('enum', enumValue);
|
|
185
|
-
}
|
|
186
|
-
get type() {
|
|
187
|
-
return this.get('type');
|
|
188
|
-
}
|
|
189
|
-
set type(type) {
|
|
190
|
-
this.set('type', type);
|
|
191
|
-
}
|
|
192
|
-
get allOf() {
|
|
193
|
-
return this.get('allOf');
|
|
194
|
-
}
|
|
195
|
-
set allOf(allOf) {
|
|
196
|
-
this.set('allOf', allOf);
|
|
197
|
-
}
|
|
198
|
-
get anyOf() {
|
|
199
|
-
return this.get('anyOf');
|
|
200
|
-
}
|
|
201
|
-
set anyOf(anyOf) {
|
|
202
|
-
this.set('anyOf', anyOf);
|
|
203
|
-
}
|
|
204
|
-
get oneOf() {
|
|
205
|
-
return this.get('oneOf');
|
|
206
|
-
}
|
|
207
|
-
set oneOf(oneOf) {
|
|
208
|
-
this.set('oneOf', oneOf);
|
|
209
|
-
}
|
|
210
|
-
get not() {
|
|
211
|
-
return this.get('not');
|
|
212
|
-
}
|
|
213
|
-
set not(not) {
|
|
214
|
-
this.set('not', not);
|
|
215
|
-
}
|
|
216
|
-
get definitions() {
|
|
217
|
-
return this.get('definitions');
|
|
218
|
-
}
|
|
219
|
-
set definitions(definitions) {
|
|
220
|
-
this.set('definitions', definitions);
|
|
221
|
-
}
|
|
222
|
-
|
|
223
|
-
/**
|
|
224
|
-
* Metadata keywords
|
|
225
|
-
*
|
|
226
|
-
* URI: https://datatracker.ietf.org/doc/html/draft-wright-json-schema-validation-00#section-6
|
|
227
|
-
*/
|
|
228
|
-
|
|
229
|
-
get title() {
|
|
230
|
-
return this.get('title');
|
|
231
|
-
}
|
|
232
|
-
set title(title) {
|
|
233
|
-
this.set('title', title);
|
|
234
|
-
}
|
|
235
|
-
get description() {
|
|
236
|
-
return this.get('description');
|
|
237
|
-
}
|
|
238
|
-
set description(description) {
|
|
239
|
-
this.set('description', description);
|
|
240
|
-
}
|
|
241
|
-
get default() {
|
|
242
|
-
return this.get('default');
|
|
243
|
-
}
|
|
244
|
-
set default(defaultValue) {
|
|
245
|
-
this.set('default', defaultValue);
|
|
246
|
-
}
|
|
247
|
-
|
|
248
|
-
/**
|
|
249
|
-
* Semantic validation with "format"
|
|
250
|
-
*
|
|
251
|
-
* URI: https://datatracker.ietf.org/doc/html/draft-wright-json-schema-validation-00#section-7
|
|
252
|
-
*/
|
|
253
|
-
|
|
254
|
-
get format() {
|
|
255
|
-
return this.get('format');
|
|
256
|
-
}
|
|
257
|
-
set format(format) {
|
|
258
|
-
this.set('format', format);
|
|
259
|
-
}
|
|
260
|
-
|
|
261
|
-
/**
|
|
262
|
-
* JSON Hyper-Schema
|
|
263
|
-
*
|
|
264
|
-
* URI: https://datatracker.ietf.org/doc/html/draft-wright-json-schema-hyperschema-00
|
|
265
|
-
*/
|
|
266
|
-
|
|
267
|
-
get base() {
|
|
268
|
-
return this.get('base');
|
|
269
|
-
}
|
|
270
|
-
set base(base) {
|
|
271
|
-
this.set('base', base);
|
|
272
|
-
}
|
|
273
|
-
get linksField() {
|
|
274
|
-
return this.get('links');
|
|
275
|
-
}
|
|
276
|
-
set linksField(links) {
|
|
277
|
-
this.set('links', links);
|
|
278
|
-
}
|
|
279
|
-
get media() {
|
|
280
|
-
return this.get('media');
|
|
281
|
-
}
|
|
282
|
-
set media(media) {
|
|
283
|
-
this.set('media', media);
|
|
284
|
-
}
|
|
285
|
-
get readOnly() {
|
|
286
|
-
return this.get('readOnly');
|
|
287
|
-
}
|
|
288
|
-
set readOnly(readOnly) {
|
|
289
|
-
this.set('readOnly', readOnly);
|
|
290
|
-
}
|
|
291
|
-
}
|
|
292
|
-
export default JSONSchema;
|
|
@@ -1,65 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
|
|
3
|
-
exports.__esModule = true;
|
|
4
|
-
exports.default = void 0;
|
|
5
|
-
var _apidomDatamodel = require("@speclynx/apidom-datamodel");
|
|
6
|
-
/**
|
|
7
|
-
* URI: https://datatracker.ietf.org/doc/html/draft-wright-json-schema-hyperschema-00#section-5
|
|
8
|
-
* @public
|
|
9
|
-
*/
|
|
10
|
-
|
|
11
|
-
class LinkDescription extends _apidomDatamodel.ObjectElement {
|
|
12
|
-
constructor(content, meta, attributes) {
|
|
13
|
-
super(content, meta, attributes);
|
|
14
|
-
this.element = 'linkDescription';
|
|
15
|
-
}
|
|
16
|
-
get href() {
|
|
17
|
-
return this.get('href');
|
|
18
|
-
}
|
|
19
|
-
set href(href) {
|
|
20
|
-
this.set('href', href);
|
|
21
|
-
}
|
|
22
|
-
get rel() {
|
|
23
|
-
return this.get('rel');
|
|
24
|
-
}
|
|
25
|
-
set rel(rel) {
|
|
26
|
-
this.set('rel', rel);
|
|
27
|
-
}
|
|
28
|
-
get title() {
|
|
29
|
-
return this.get('title');
|
|
30
|
-
}
|
|
31
|
-
set title(title) {
|
|
32
|
-
this.set('title', title);
|
|
33
|
-
}
|
|
34
|
-
get targetSchema() {
|
|
35
|
-
return this.get('targetSchema');
|
|
36
|
-
}
|
|
37
|
-
set targetSchema(targetSchema) {
|
|
38
|
-
this.set('targetSchema', targetSchema);
|
|
39
|
-
}
|
|
40
|
-
get mediaType() {
|
|
41
|
-
return this.get('mediaType');
|
|
42
|
-
}
|
|
43
|
-
set mediaType(mediaType) {
|
|
44
|
-
this.set('mediaType', mediaType);
|
|
45
|
-
}
|
|
46
|
-
get method() {
|
|
47
|
-
return this.get('method');
|
|
48
|
-
}
|
|
49
|
-
set method(method) {
|
|
50
|
-
this.set('method', method);
|
|
51
|
-
}
|
|
52
|
-
get encType() {
|
|
53
|
-
return this.get('encType');
|
|
54
|
-
}
|
|
55
|
-
set encType(encType) {
|
|
56
|
-
this.set('encType', encType);
|
|
57
|
-
}
|
|
58
|
-
get schema() {
|
|
59
|
-
return this.get('schema');
|
|
60
|
-
}
|
|
61
|
-
set schema(schema) {
|
|
62
|
-
this.set('schema', schema);
|
|
63
|
-
}
|
|
64
|
-
}
|
|
65
|
-
var _default = exports.default = LinkDescription;
|
|
@@ -1,61 +0,0 @@
|
|
|
1
|
-
import { ObjectElement } from '@speclynx/apidom-datamodel';
|
|
2
|
-
/**
|
|
3
|
-
* URI: https://datatracker.ietf.org/doc/html/draft-wright-json-schema-hyperschema-00#section-5
|
|
4
|
-
* @public
|
|
5
|
-
*/
|
|
6
|
-
|
|
7
|
-
class LinkDescription extends ObjectElement {
|
|
8
|
-
constructor(content, meta, attributes) {
|
|
9
|
-
super(content, meta, attributes);
|
|
10
|
-
this.element = 'linkDescription';
|
|
11
|
-
}
|
|
12
|
-
get href() {
|
|
13
|
-
return this.get('href');
|
|
14
|
-
}
|
|
15
|
-
set href(href) {
|
|
16
|
-
this.set('href', href);
|
|
17
|
-
}
|
|
18
|
-
get rel() {
|
|
19
|
-
return this.get('rel');
|
|
20
|
-
}
|
|
21
|
-
set rel(rel) {
|
|
22
|
-
this.set('rel', rel);
|
|
23
|
-
}
|
|
24
|
-
get title() {
|
|
25
|
-
return this.get('title');
|
|
26
|
-
}
|
|
27
|
-
set title(title) {
|
|
28
|
-
this.set('title', title);
|
|
29
|
-
}
|
|
30
|
-
get targetSchema() {
|
|
31
|
-
return this.get('targetSchema');
|
|
32
|
-
}
|
|
33
|
-
set targetSchema(targetSchema) {
|
|
34
|
-
this.set('targetSchema', targetSchema);
|
|
35
|
-
}
|
|
36
|
-
get mediaType() {
|
|
37
|
-
return this.get('mediaType');
|
|
38
|
-
}
|
|
39
|
-
set mediaType(mediaType) {
|
|
40
|
-
this.set('mediaType', mediaType);
|
|
41
|
-
}
|
|
42
|
-
get method() {
|
|
43
|
-
return this.get('method');
|
|
44
|
-
}
|
|
45
|
-
set method(method) {
|
|
46
|
-
this.set('method', method);
|
|
47
|
-
}
|
|
48
|
-
get encType() {
|
|
49
|
-
return this.get('encType');
|
|
50
|
-
}
|
|
51
|
-
set encType(encType) {
|
|
52
|
-
this.set('encType', encType);
|
|
53
|
-
}
|
|
54
|
-
get schema() {
|
|
55
|
-
return this.get('schema');
|
|
56
|
-
}
|
|
57
|
-
set schema(schema) {
|
|
58
|
-
this.set('schema', schema);
|
|
59
|
-
}
|
|
60
|
-
}
|
|
61
|
-
export default LinkDescription;
|
package/src/elements/Media.cjs
DELETED
|
@@ -1,29 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
|
|
3
|
-
exports.__esModule = true;
|
|
4
|
-
exports.default = void 0;
|
|
5
|
-
var _apidomDatamodel = require("@speclynx/apidom-datamodel");
|
|
6
|
-
/**
|
|
7
|
-
* URI: https://datatracker.ietf.org/doc/html/draft-wright-json-schema-hyperschema-00#section-4.3
|
|
8
|
-
* @public
|
|
9
|
-
*/
|
|
10
|
-
|
|
11
|
-
class Media extends _apidomDatamodel.ObjectElement {
|
|
12
|
-
constructor(content, meta, attributes) {
|
|
13
|
-
super(content, meta, attributes);
|
|
14
|
-
this.element = 'media';
|
|
15
|
-
}
|
|
16
|
-
get binaryEncoding() {
|
|
17
|
-
return this.get('binaryEncoding');
|
|
18
|
-
}
|
|
19
|
-
set binaryEncoding(binaryEncoding) {
|
|
20
|
-
this.set('binaryEncoding', binaryEncoding);
|
|
21
|
-
}
|
|
22
|
-
get type() {
|
|
23
|
-
return this.get('type');
|
|
24
|
-
}
|
|
25
|
-
set type(type) {
|
|
26
|
-
this.set('type', type);
|
|
27
|
-
}
|
|
28
|
-
}
|
|
29
|
-
var _default = exports.default = Media;
|
package/src/elements/Media.mjs
DELETED
|
@@ -1,25 +0,0 @@
|
|
|
1
|
-
import { ObjectElement } from '@speclynx/apidom-datamodel';
|
|
2
|
-
/**
|
|
3
|
-
* URI: https://datatracker.ietf.org/doc/html/draft-wright-json-schema-hyperschema-00#section-4.3
|
|
4
|
-
* @public
|
|
5
|
-
*/
|
|
6
|
-
|
|
7
|
-
class Media extends ObjectElement {
|
|
8
|
-
constructor(content, meta, attributes) {
|
|
9
|
-
super(content, meta, attributes);
|
|
10
|
-
this.element = 'media';
|
|
11
|
-
}
|
|
12
|
-
get binaryEncoding() {
|
|
13
|
-
return this.get('binaryEncoding');
|
|
14
|
-
}
|
|
15
|
-
set binaryEncoding(binaryEncoding) {
|
|
16
|
-
this.set('binaryEncoding', binaryEncoding);
|
|
17
|
-
}
|
|
18
|
-
get type() {
|
|
19
|
-
return this.get('type');
|
|
20
|
-
}
|
|
21
|
-
set type(type) {
|
|
22
|
-
this.set('type', type);
|
|
23
|
-
}
|
|
24
|
-
}
|
|
25
|
-
export default Media;
|
package/src/index.cjs
DELETED
|
@@ -1,69 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
|
|
3
|
-
var _interopRequireDefault = require("@babel/runtime-corejs3/helpers/interopRequireDefault").default;
|
|
4
|
-
var _interopRequireWildcard = require("@babel/runtime-corejs3/helpers/interopRequireWildcard").default;
|
|
5
|
-
exports.__esModule = true;
|
|
6
|
-
exports.specificationObj = exports.refractorPluginReplaceEmptyElement = exports.refractMedia = exports.refractLinkDescription = exports.refractJSONSchema = exports.refractJSONReference = exports.refract = exports.mediaTypes = exports.isMediaElement = exports.isLinkDescriptionElement = exports.isJSONSchemaElement = exports.isJSONReferenceLikeElement = exports.isJSONReferenceElement = exports.default = exports.Visitor = exports.SpecificationVisitor = exports.PropertiesVisitorBase = exports.PatternedFieldsVisitor = exports.PatternPropertiesVisitorBase = exports.ParentSchemaAwareVisitor = exports.OneOfVisitorBase = exports.MediaVisitorBase = exports.MediaElement = exports.MapVisitor = exports.LinksVisitorBase = exports.LinkDescriptionVisitorBase = exports.LinkDescriptionVisitor = exports.LinkDescriptionElement = exports.JSONSchemaVisitorBase = exports.JSONSchemaVisitor = exports.JSONSchemaElement = exports.JSONSchemaDraft4MediaTypes = exports.JSONReferenceVisitorBase = exports.JSONReferenceElement = exports.ItemsVisitorBase = exports.ItemsVisitor = exports.FixedFieldsVisitor = exports.FallbackVisitor = exports.DependenciesVisitorBase = exports.DefinitionsVisitorBase = exports.AnyOfVisitorBase = exports.AlternatingVisitor = exports.AllOfVisitorBase = void 0;
|
|
7
|
-
var _mediaTypes = _interopRequireWildcard(require("./media-types.cjs"));
|
|
8
|
-
exports.mediaTypes = _mediaTypes.default;
|
|
9
|
-
exports.JSONSchemaDraft4MediaTypes = _mediaTypes.JSONSchemaDraft4MediaTypes;
|
|
10
|
-
var _namespace = _interopRequireDefault(require("./namespace.cjs"));
|
|
11
|
-
exports.default = _namespace.default;
|
|
12
|
-
var _replaceEmptyElement = _interopRequireDefault(require("./refractor/plugins/replace-empty-element.cjs"));
|
|
13
|
-
exports.refractorPluginReplaceEmptyElement = _replaceEmptyElement.default;
|
|
14
|
-
var _index = _interopRequireWildcard(require("./refractor/index.cjs"));
|
|
15
|
-
exports.refract = _index.default;
|
|
16
|
-
exports.refractJSONSchema = _index.refractJSONSchema;
|
|
17
|
-
exports.refractJSONReference = _index.refractJSONReference;
|
|
18
|
-
exports.refractMedia = _index.refractMedia;
|
|
19
|
-
exports.refractLinkDescription = _index.refractLinkDescription;
|
|
20
|
-
var _specification = _interopRequireDefault(require("./refractor/specification.cjs"));
|
|
21
|
-
exports.specificationObj = _specification.default;
|
|
22
|
-
var _predicates = require("./predicates.cjs");
|
|
23
|
-
exports.isJSONReferenceElement = _predicates.isJSONReferenceElement;
|
|
24
|
-
exports.isJSONSchemaElement = _predicates.isJSONSchemaElement;
|
|
25
|
-
exports.isLinkDescriptionElement = _predicates.isLinkDescriptionElement;
|
|
26
|
-
exports.isMediaElement = _predicates.isMediaElement;
|
|
27
|
-
var _predicates2 = require("./refractor/predicates.cjs");
|
|
28
|
-
exports.isJSONReferenceLikeElement = _predicates2.isJSONReferenceLikeElement;
|
|
29
|
-
var _Visitor = _interopRequireDefault(require("./refractor/visitors/Visitor.cjs"));
|
|
30
|
-
exports.Visitor = _Visitor.default;
|
|
31
|
-
var _SpecificationVisitor = _interopRequireDefault(require("./refractor/visitors/SpecificationVisitor.cjs"));
|
|
32
|
-
exports.SpecificationVisitor = _SpecificationVisitor.default;
|
|
33
|
-
var _FallbackVisitor = _interopRequireDefault(require("./refractor/visitors/FallbackVisitor.cjs"));
|
|
34
|
-
exports.FallbackVisitor = _FallbackVisitor.default;
|
|
35
|
-
var _FixedFieldsVisitor = _interopRequireDefault(require("./refractor/visitors/generics/FixedFieldsVisitor.cjs"));
|
|
36
|
-
exports.FixedFieldsVisitor = _FixedFieldsVisitor.default;
|
|
37
|
-
var _PatternedFieldsVisitor = _interopRequireDefault(require("./refractor/visitors/generics/PatternedFieldsVisitor.cjs"));
|
|
38
|
-
exports.PatternedFieldsVisitor = _PatternedFieldsVisitor.default;
|
|
39
|
-
var _MapVisitor = _interopRequireDefault(require("./refractor/visitors/generics/MapVisitor.cjs"));
|
|
40
|
-
exports.MapVisitor = _MapVisitor.default;
|
|
41
|
-
var _AlternatingVisitor = _interopRequireDefault(require("./refractor/visitors/generics/AlternatingVisitor.cjs"));
|
|
42
|
-
exports.AlternatingVisitor = _AlternatingVisitor.default;
|
|
43
|
-
var _ParentSchemaAwareVisitor = _interopRequireDefault(require("./refractor/visitors/json-schema/ParentSchemaAwareVisitor.cjs"));
|
|
44
|
-
exports.ParentSchemaAwareVisitor = _ParentSchemaAwareVisitor.default;
|
|
45
|
-
var _bases = require("./refractor/visitors/json-schema/bases.cjs");
|
|
46
|
-
exports.JSONSchemaVisitorBase = _bases.JSONSchemaVisitorBase;
|
|
47
|
-
exports.JSONReferenceVisitorBase = _bases.JSONReferenceVisitorBase;
|
|
48
|
-
exports.LinkDescriptionVisitorBase = _bases.LinkDescriptionVisitorBase;
|
|
49
|
-
exports.MediaVisitorBase = _bases.MediaVisitorBase;
|
|
50
|
-
exports.AllOfVisitorBase = _bases.AllOfVisitorBase;
|
|
51
|
-
exports.AnyOfVisitorBase = _bases.AnyOfVisitorBase;
|
|
52
|
-
exports.OneOfVisitorBase = _bases.OneOfVisitorBase;
|
|
53
|
-
exports.ItemsVisitorBase = _bases.ItemsVisitorBase;
|
|
54
|
-
exports.LinksVisitorBase = _bases.LinksVisitorBase;
|
|
55
|
-
exports.DefinitionsVisitorBase = _bases.DefinitionsVisitorBase;
|
|
56
|
-
exports.DependenciesVisitorBase = _bases.DependenciesVisitorBase;
|
|
57
|
-
exports.PatternPropertiesVisitorBase = _bases.PatternPropertiesVisitorBase;
|
|
58
|
-
exports.PropertiesVisitorBase = _bases.PropertiesVisitorBase;
|
|
59
|
-
var _index2 = _interopRequireDefault(require("./refractor/visitors/json-schema/link-description/index.cjs"));
|
|
60
|
-
exports.LinkDescriptionVisitor = _index2.default;
|
|
61
|
-
var _index3 = _interopRequireDefault(require("./refractor/visitors/json-schema/index.cjs"));
|
|
62
|
-
exports.JSONSchemaVisitor = _index3.default;
|
|
63
|
-
var _ItemsVisitor = _interopRequireDefault(require("./refractor/visitors/json-schema/ItemsVisitor.cjs"));
|
|
64
|
-
exports.ItemsVisitor = _ItemsVisitor.default;
|
|
65
|
-
var _inspect = require("./refractor/inspect.cjs");
|
|
66
|
-
exports.JSONSchemaElement = _inspect.JSONSchemaElement;
|
|
67
|
-
exports.JSONReferenceElement = _inspect.JSONReferenceElement;
|
|
68
|
-
exports.MediaElement = _inspect.MediaElement;
|
|
69
|
-
exports.LinkDescriptionElement = _inspect.LinkDescriptionElement;
|
package/src/index.mjs
DELETED
|
@@ -1,23 +0,0 @@
|
|
|
1
|
-
export { default as mediaTypes, JSONSchemaDraft4MediaTypes } from "./media-types.mjs";
|
|
2
|
-
export { default } from "./namespace.mjs";
|
|
3
|
-
export { default as refractorPluginReplaceEmptyElement } from "./refractor/plugins/replace-empty-element.mjs";
|
|
4
|
-
export { default as refract, refractJSONSchema, refractJSONReference, refractMedia, refractLinkDescription } from "./refractor/index.mjs";
|
|
5
|
-
export { default as specificationObj } from "./refractor/specification.mjs";
|
|
6
|
-
export { isJSONReferenceElement, isJSONSchemaElement, isLinkDescriptionElement, isMediaElement } from "./predicates.mjs";
|
|
7
|
-
export { isJSONReferenceLikeElement } from "./refractor/predicates.mjs";
|
|
8
|
-
export { default as Visitor } from "./refractor/visitors/Visitor.mjs";
|
|
9
|
-
export { default as SpecificationVisitor } from "./refractor/visitors/SpecificationVisitor.mjs";
|
|
10
|
-
export { default as FallbackVisitor } from "./refractor/visitors/FallbackVisitor.mjs";
|
|
11
|
-
export { default as FixedFieldsVisitor } from "./refractor/visitors/generics/FixedFieldsVisitor.mjs";
|
|
12
|
-
export { default as PatternedFieldsVisitor } from "./refractor/visitors/generics/PatternedFieldsVisitor.mjs";
|
|
13
|
-
export { default as MapVisitor } from "./refractor/visitors/generics/MapVisitor.mjs";
|
|
14
|
-
export { default as AlternatingVisitor } from "./refractor/visitors/generics/AlternatingVisitor.mjs";
|
|
15
|
-
export { default as ParentSchemaAwareVisitor } from "./refractor/visitors/json-schema/ParentSchemaAwareVisitor.mjs";
|
|
16
|
-
export { JSONSchemaVisitorBase, JSONReferenceVisitorBase, LinkDescriptionVisitorBase, MediaVisitorBase, AllOfVisitorBase, AnyOfVisitorBase, OneOfVisitorBase, ItemsVisitorBase, LinksVisitorBase, DefinitionsVisitorBase, DependenciesVisitorBase, PatternPropertiesVisitorBase, PropertiesVisitorBase } from "./refractor/visitors/json-schema/bases.mjs";
|
|
17
|
-
export { default as LinkDescriptionVisitor } from "./refractor/visitors/json-schema/link-description/index.mjs";
|
|
18
|
-
export { default as JSONSchemaVisitor } from "./refractor/visitors/json-schema/index.mjs";
|
|
19
|
-
export { default as ItemsVisitor } from "./refractor/visitors/json-schema/ItemsVisitor.mjs";
|
|
20
|
-
/**
|
|
21
|
-
* JSON Schema Draft 4 specification elements.
|
|
22
|
-
*/
|
|
23
|
-
export { JSONSchemaElement, JSONReferenceElement, MediaElement, LinkDescriptionElement } from "./refractor/inspect.mjs";
|
package/src/media-types.cjs
DELETED
|
@@ -1,34 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
|
|
3
|
-
exports.__esModule = true;
|
|
4
|
-
exports.default = exports.JSONSchemaDraft4MediaTypes = void 0;
|
|
5
|
-
var _ramda = require("ramda");
|
|
6
|
-
var _apidomCore = require("@speclynx/apidom-core");
|
|
7
|
-
/**
|
|
8
|
-
* @public
|
|
9
|
-
*/
|
|
10
|
-
|
|
11
|
-
/**
|
|
12
|
-
* @public
|
|
13
|
-
*/
|
|
14
|
-
class JSONSchemaDraft4MediaTypes extends _apidomCore.MediaTypes {
|
|
15
|
-
filterByFormat(format = 'generic') {
|
|
16
|
-
const effectiveFormat = format === 'generic' ? 'schema;version' : format;
|
|
17
|
-
return this.filter(mediaType => mediaType.includes(effectiveFormat));
|
|
18
|
-
}
|
|
19
|
-
findBy(version = 'draft-04', format = 'generic') {
|
|
20
|
-
const search = format === 'generic' ? `schema;version=${version}` : `schema+${format};version=${version}`;
|
|
21
|
-
const found = this.find(mediaType => mediaType.includes(search));
|
|
22
|
-
return found || this.unknownMediaType;
|
|
23
|
-
}
|
|
24
|
-
latest(format = 'generic') {
|
|
25
|
-
return (0, _ramda.last)(this.filterByFormat(format));
|
|
26
|
-
}
|
|
27
|
-
}
|
|
28
|
-
|
|
29
|
-
/**
|
|
30
|
-
* @public
|
|
31
|
-
*/
|
|
32
|
-
exports.JSONSchemaDraft4MediaTypes = JSONSchemaDraft4MediaTypes;
|
|
33
|
-
const mediaTypes = new JSONSchemaDraft4MediaTypes('application/schema;version=draft-04', 'application/schema+json;version=draft-04', 'application/schema+yaml;version=draft-04');
|
|
34
|
-
var _default = exports.default = mediaTypes;
|
package/src/media-types.mjs
DELETED
|
@@ -1,30 +0,0 @@
|
|
|
1
|
-
import { last } from 'ramda';
|
|
2
|
-
import { MediaTypes } from '@speclynx/apidom-core';
|
|
3
|
-
|
|
4
|
-
/**
|
|
5
|
-
* @public
|
|
6
|
-
*/
|
|
7
|
-
|
|
8
|
-
/**
|
|
9
|
-
* @public
|
|
10
|
-
*/
|
|
11
|
-
export class JSONSchemaDraft4MediaTypes extends MediaTypes {
|
|
12
|
-
filterByFormat(format = 'generic') {
|
|
13
|
-
const effectiveFormat = format === 'generic' ? 'schema;version' : format;
|
|
14
|
-
return this.filter(mediaType => mediaType.includes(effectiveFormat));
|
|
15
|
-
}
|
|
16
|
-
findBy(version = 'draft-04', format = 'generic') {
|
|
17
|
-
const search = format === 'generic' ? `schema;version=${version}` : `schema+${format};version=${version}`;
|
|
18
|
-
const found = this.find(mediaType => mediaType.includes(search));
|
|
19
|
-
return found || this.unknownMediaType;
|
|
20
|
-
}
|
|
21
|
-
latest(format = 'generic') {
|
|
22
|
-
return last(this.filterByFormat(format));
|
|
23
|
-
}
|
|
24
|
-
}
|
|
25
|
-
|
|
26
|
-
/**
|
|
27
|
-
* @public
|
|
28
|
-
*/
|
|
29
|
-
const mediaTypes = new JSONSchemaDraft4MediaTypes('application/schema;version=draft-04', 'application/schema+json;version=draft-04', 'application/schema+yaml;version=draft-04');
|
|
30
|
-
export default mediaTypes;
|
package/src/namespace.cjs
DELETED
|
@@ -1,25 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
|
|
3
|
-
var _interopRequireDefault = require("@babel/runtime-corejs3/helpers/interopRequireDefault").default;
|
|
4
|
-
exports.__esModule = true;
|
|
5
|
-
exports.default = void 0;
|
|
6
|
-
var _JSONSchema = _interopRequireDefault(require("./elements/JSONSchema.cjs"));
|
|
7
|
-
var _JSONReference = _interopRequireDefault(require("./elements/JSONReference.cjs"));
|
|
8
|
-
var _Media = _interopRequireDefault(require("./elements/Media.cjs"));
|
|
9
|
-
var _LinkDescription = _interopRequireDefault(require("./elements/LinkDescription.cjs"));
|
|
10
|
-
/**
|
|
11
|
-
* @public
|
|
12
|
-
*/
|
|
13
|
-
const jsonSchemaDraft4 = {
|
|
14
|
-
namespace: options => {
|
|
15
|
-
const {
|
|
16
|
-
base
|
|
17
|
-
} = options;
|
|
18
|
-
base.register('jSONSchemaDraft4', _JSONSchema.default);
|
|
19
|
-
base.register('jSONReference', _JSONReference.default);
|
|
20
|
-
base.register('media', _Media.default);
|
|
21
|
-
base.register('linkDescription', _LinkDescription.default);
|
|
22
|
-
return base;
|
|
23
|
-
}
|
|
24
|
-
};
|
|
25
|
-
var _default = exports.default = jsonSchemaDraft4;
|
package/src/namespace.mjs
DELETED
|
@@ -1,20 +0,0 @@
|
|
|
1
|
-
import JSONSchemaElement from "./elements/JSONSchema.mjs";
|
|
2
|
-
import JSONReferenceElement from "./elements/JSONReference.mjs";
|
|
3
|
-
import MediaElement from "./elements/Media.mjs";
|
|
4
|
-
import LinkDescriptionElement from "./elements/LinkDescription.mjs";
|
|
5
|
-
/**
|
|
6
|
-
* @public
|
|
7
|
-
*/
|
|
8
|
-
const jsonSchemaDraft4 = {
|
|
9
|
-
namespace: options => {
|
|
10
|
-
const {
|
|
11
|
-
base
|
|
12
|
-
} = options;
|
|
13
|
-
base.register('jSONSchemaDraft4', JSONSchemaElement);
|
|
14
|
-
base.register('jSONReference', JSONReferenceElement);
|
|
15
|
-
base.register('media', MediaElement);
|
|
16
|
-
base.register('linkDescription', LinkDescriptionElement);
|
|
17
|
-
return base;
|
|
18
|
-
}
|
|
19
|
-
};
|
|
20
|
-
export default jsonSchemaDraft4;
|