@hyperjump/json-schema 0.18.0 → 0.18.4
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/dist/json-schema-amd.js +19 -196
- package/dist/json-schema-amd.js.map +1 -1
- package/dist/json-schema-amd.min.js +1 -1
- package/dist/json-schema-amd.min.js.map +1 -1
- package/dist/json-schema-cjs.js +17 -194
- package/dist/json-schema-cjs.js.map +1 -1
- package/dist/json-schema-cjs.min.js +1 -1
- package/dist/json-schema-cjs.min.js.map +1 -1
- package/dist/json-schema-esm.js +16 -193
- package/dist/json-schema-esm.js.map +1 -1
- package/dist/json-schema-esm.min.js +1 -1
- package/dist/json-schema-esm.min.js.map +1 -1
- package/dist/json-schema-iife.js +18 -195
- package/dist/json-schema-iife.js.map +1 -1
- package/dist/json-schema-iife.min.js +1 -1
- package/dist/json-schema-iife.min.js.map +1 -1
- package/dist/json-schema-system.js +20 -197
- package/dist/json-schema-system.js.map +1 -1
- package/dist/json-schema-system.min.js +1 -1
- package/dist/json-schema-system.min.js.map +1 -1
- package/dist/json-schema-umd.js +19 -196
- package/dist/json-schema-umd.js.map +1 -1
- package/dist/json-schema-umd.min.js +1 -1
- package/dist/json-schema-umd.min.js.map +1 -1
- package/lib/draft-04.js +0 -48
- package/lib/draft-07.d.ts +1 -1
- package/lib/draft-2019-09.d.ts +2 -2
- package/lib/draft-2020-12.d.ts +4 -3
- package/lib/index.d.ts +12 -0
- package/package.json +5 -4
- package/meta/draft-04/hyper-schema.js +0 -136
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
System.register('JsonSchema', [], function (exports) {
|
|
1
|
+
System.register('JsonSchema', [], (function (exports) {
|
|
2
2
|
'use strict';
|
|
3
3
|
return {
|
|
4
|
-
execute: function () {
|
|
4
|
+
execute: (function () {
|
|
5
5
|
|
|
6
6
|
var justCurryIt = curry;
|
|
7
7
|
|
|
@@ -61,8 +61,14 @@ System.register('JsonSchema', [], function (exports) {
|
|
|
61
61
|
(function (root, factory){
|
|
62
62
|
|
|
63
63
|
var PubSub = {};
|
|
64
|
-
|
|
65
|
-
|
|
64
|
+
|
|
65
|
+
if (root.PubSub) {
|
|
66
|
+
PubSub = root.PubSub;
|
|
67
|
+
console.warn("PubSub already loaded, using existing version");
|
|
68
|
+
} else {
|
|
69
|
+
root.PubSub = PubSub;
|
|
70
|
+
factory(PubSub);
|
|
71
|
+
}
|
|
66
72
|
// CommonJS and Node.js module support
|
|
67
73
|
{
|
|
68
74
|
if (module !== undefined && module.exports) {
|
|
@@ -798,6 +804,10 @@ System.register('JsonSchema', [], function (exports) {
|
|
|
798
804
|
const value$2 = (ref) => ref[$__value];
|
|
799
805
|
|
|
800
806
|
var reference = { cons: cons$1, isReference, href, value: value$2 };
|
|
807
|
+
reference.cons;
|
|
808
|
+
reference.isReference;
|
|
809
|
+
reference.href;
|
|
810
|
+
reference.value;
|
|
801
811
|
|
|
802
812
|
const { jsonTypeOf: jsonTypeOf$1 } = common$1;
|
|
803
813
|
|
|
@@ -1234,7 +1244,7 @@ System.register('JsonSchema', [], function (exports) {
|
|
|
1234
1244
|
validated: false
|
|
1235
1245
|
};
|
|
1236
1246
|
|
|
1237
|
-
return
|
|
1247
|
+
return id;
|
|
1238
1248
|
};
|
|
1239
1249
|
|
|
1240
1250
|
const processSchema = (subject, id, schemaVersion, pointer, anchors, dynamicAnchors) => {
|
|
@@ -1590,10 +1600,8 @@ System.register('JsonSchema', [], function (exports) {
|
|
|
1590
1600
|
};
|
|
1591
1601
|
|
|
1592
1602
|
const add = (schema, url = "", defaultSchemaVersion = "") => {
|
|
1593
|
-
const
|
|
1594
|
-
delete metaValidators[
|
|
1595
|
-
|
|
1596
|
-
return doc;
|
|
1603
|
+
const id = schema$5.add(schema, url, defaultSchemaVersion);
|
|
1604
|
+
delete metaValidators[id];
|
|
1597
1605
|
};
|
|
1598
1606
|
|
|
1599
1607
|
var core$2 = {
|
|
@@ -1727,7 +1735,7 @@ System.register('JsonSchema', [], function (exports) {
|
|
|
1727
1735
|
keywords$1.metaData;
|
|
1728
1736
|
keywords$1.validate;
|
|
1729
1737
|
|
|
1730
|
-
var lib$1 = { Core: core$2, Schema: schema$5, Instance: instance, Keywords: keywords$1 };
|
|
1738
|
+
var lib$1 = { Core: core$2, Schema: schema$5, Instance: instance, Reference: reference, Keywords: keywords$1, InvalidSchemaError: invalidSchemaError };
|
|
1731
1739
|
|
|
1732
1740
|
const { Core: Core$v, Schema: Schema$N, Instance: Instance$B } = lib$1;
|
|
1733
1741
|
|
|
@@ -3107,149 +3115,11 @@ System.register('JsonSchema', [], function (exports) {
|
|
|
3107
3115
|
"default": {}
|
|
3108
3116
|
}`;
|
|
3109
3117
|
|
|
3110
|
-
var hyperSchema = `{
|
|
3111
|
-
"$schema": "http://json-schema.org/draft-04/hyper-schema#",
|
|
3112
|
-
"id": "http://json-schema.org/draft-04/hyper-schema#",
|
|
3113
|
-
"title": "JSON Hyper-Schema",
|
|
3114
|
-
"allOf": [
|
|
3115
|
-
{"$ref": "http://json-schema.org/draft-04/schema#"}
|
|
3116
|
-
],
|
|
3117
|
-
"properties": {
|
|
3118
|
-
"additionalItems": {
|
|
3119
|
-
"anyOf": [
|
|
3120
|
-
{"type": "boolean"},
|
|
3121
|
-
{"$ref": "#"}
|
|
3122
|
-
]
|
|
3123
|
-
},
|
|
3124
|
-
"additionalProperties": {
|
|
3125
|
-
"anyOf": [
|
|
3126
|
-
{"type": "boolean"},
|
|
3127
|
-
{"$ref": "#"}
|
|
3128
|
-
]
|
|
3129
|
-
},
|
|
3130
|
-
"dependencies": {
|
|
3131
|
-
"additionalProperties": {
|
|
3132
|
-
"anyOf": [
|
|
3133
|
-
{"$ref": "#"},
|
|
3134
|
-
{"type": "array"}
|
|
3135
|
-
]
|
|
3136
|
-
}
|
|
3137
|
-
},
|
|
3138
|
-
"items": {
|
|
3139
|
-
"anyOf": [
|
|
3140
|
-
{"$ref": "#"},
|
|
3141
|
-
{"$ref": "#/definitions/schemaArray"}
|
|
3142
|
-
]
|
|
3143
|
-
},
|
|
3144
|
-
"definitions": {
|
|
3145
|
-
"additionalProperties": {"$ref": "#"}
|
|
3146
|
-
},
|
|
3147
|
-
"patternProperties": {
|
|
3148
|
-
"additionalProperties": {"$ref": "#"}
|
|
3149
|
-
},
|
|
3150
|
-
"properties": {
|
|
3151
|
-
"additionalProperties": {"$ref": "#"}
|
|
3152
|
-
},
|
|
3153
|
-
"allOf": {"$ref": "#/definitions/schemaArray"},
|
|
3154
|
-
"anyOf": {"$ref": "#/definitions/schemaArray"},
|
|
3155
|
-
"oneOf": {"$ref": "#/definitions/schemaArray"},
|
|
3156
|
-
"not": { "$ref": "#" },
|
|
3157
|
-
|
|
3158
|
-
"links": {
|
|
3159
|
-
"type": "array",
|
|
3160
|
-
"items": {"$ref": "#/definitions/linkDescription"}
|
|
3161
|
-
},
|
|
3162
|
-
"fragmentResolution": {
|
|
3163
|
-
"type": "string"
|
|
3164
|
-
},
|
|
3165
|
-
"media": {
|
|
3166
|
-
"type": "object",
|
|
3167
|
-
"properties": {
|
|
3168
|
-
"type": {
|
|
3169
|
-
"description": "A media type, as described in RFC 2046",
|
|
3170
|
-
"type": "string"
|
|
3171
|
-
},
|
|
3172
|
-
"binaryEncoding": {
|
|
3173
|
-
"description": "A content encoding scheme, as described in RFC 2045",
|
|
3174
|
-
"type": "string"
|
|
3175
|
-
}
|
|
3176
|
-
}
|
|
3177
|
-
},
|
|
3178
|
-
"pathStart": {
|
|
3179
|
-
"description": "Instances' URIs must start with this value for this schema to apply to them",
|
|
3180
|
-
"type": "string",
|
|
3181
|
-
"format": "uri"
|
|
3182
|
-
}
|
|
3183
|
-
},
|
|
3184
|
-
"definitions": {
|
|
3185
|
-
"schemaArray": {
|
|
3186
|
-
"type": "array",
|
|
3187
|
-
"items": {"$ref": "#"}
|
|
3188
|
-
},
|
|
3189
|
-
"linkDescription": {
|
|
3190
|
-
"title": "Link Description Object",
|
|
3191
|
-
"type": "object",
|
|
3192
|
-
"required": ["href", "rel"],
|
|
3193
|
-
"properties": {
|
|
3194
|
-
"href": {
|
|
3195
|
-
"description": "a URI template, as defined by RFC 6570, with the addition of the $, ( and ) characters for pre-processing",
|
|
3196
|
-
"type": "string"
|
|
3197
|
-
},
|
|
3198
|
-
"rel": {
|
|
3199
|
-
"description": "relation to the target resource of the link",
|
|
3200
|
-
"type": "string"
|
|
3201
|
-
},
|
|
3202
|
-
"title": {
|
|
3203
|
-
"description": "a title for the link",
|
|
3204
|
-
"type": "string"
|
|
3205
|
-
},
|
|
3206
|
-
"targetSchema": {
|
|
3207
|
-
"description": "JSON Schema describing the link target",
|
|
3208
|
-
"$ref": "#"
|
|
3209
|
-
},
|
|
3210
|
-
"mediaType": {
|
|
3211
|
-
"description": "media type (as defined by RFC 2046) describing the link target",
|
|
3212
|
-
"type": "string"
|
|
3213
|
-
},
|
|
3214
|
-
"method": {
|
|
3215
|
-
"description": "method for requesting the target of the link (e.g. for HTTP this might be \\"GET\\" or \\"DELETE\\")",
|
|
3216
|
-
"type": "string"
|
|
3217
|
-
},
|
|
3218
|
-
"encType": {
|
|
3219
|
-
"description": "The media type in which to submit data along with the request",
|
|
3220
|
-
"type": "string",
|
|
3221
|
-
"default": "application/json"
|
|
3222
|
-
},
|
|
3223
|
-
"schema": {
|
|
3224
|
-
"description": "Schema describing the data to submit along with the request",
|
|
3225
|
-
"$ref": "#"
|
|
3226
|
-
}
|
|
3227
|
-
}
|
|
3228
|
-
},
|
|
3229
|
-
"readOnly": {
|
|
3230
|
-
"description": "If true, indicates that the value of this property is controlled by the server.",
|
|
3231
|
-
"type": "boolean",
|
|
3232
|
-
"default": false
|
|
3233
|
-
}
|
|
3234
|
-
},
|
|
3235
|
-
"links": [
|
|
3236
|
-
{
|
|
3237
|
-
"rel": "self",
|
|
3238
|
-
"href": "{+id}"
|
|
3239
|
-
},
|
|
3240
|
-
{
|
|
3241
|
-
"rel": "full",
|
|
3242
|
-
"href": "{+($ref)}"
|
|
3243
|
-
}
|
|
3244
|
-
]
|
|
3245
|
-
}`;
|
|
3246
|
-
|
|
3247
3118
|
const { Core: Core$5, Schema: Schema$5 } = lib$1;
|
|
3248
3119
|
|
|
3249
3120
|
|
|
3250
3121
|
|
|
3251
3122
|
|
|
3252
|
-
|
|
3253
3123
|
// JSON Schema Draft-04
|
|
3254
3124
|
const schemaVersion$4 = "http://json-schema.org/draft-04/schema";
|
|
3255
3125
|
|
|
@@ -3292,53 +3162,6 @@ System.register('JsonSchema', [], function (exports) {
|
|
|
3292
3162
|
"uniqueItems": keywords.uniqueItems
|
|
3293
3163
|
});
|
|
3294
3164
|
|
|
3295
|
-
// JSON Hyper-Schema Draft-04
|
|
3296
|
-
const hyperSchemaVersion = "http://json-schema.org/draft-04/hyper-schema";
|
|
3297
|
-
|
|
3298
|
-
Schema$5.setConfig(hyperSchemaVersion, "baseToken", "id");
|
|
3299
|
-
Schema$5.setConfig(hyperSchemaVersion, "embeddedToken", "id");
|
|
3300
|
-
Schema$5.setConfig(hyperSchemaVersion, "anchorToken", "id");
|
|
3301
|
-
Schema$5.setConfig(hyperSchemaVersion, "jrefToken", "$ref");
|
|
3302
|
-
|
|
3303
|
-
Schema$5.add(JSON.parse(hyperSchema));
|
|
3304
|
-
Core$5.defineVocabulary(hyperSchemaVersion, {
|
|
3305
|
-
"validate": keywords.validate,
|
|
3306
|
-
"additionalItems": keywords.additionalItems,
|
|
3307
|
-
"additionalProperties": keywords.additionalProperties,
|
|
3308
|
-
"allOf": keywords.allOf,
|
|
3309
|
-
"anyOf": keywords.anyOf,
|
|
3310
|
-
"default": keywords.metaData,
|
|
3311
|
-
"definitions": keywords.definitions,
|
|
3312
|
-
"dependencies": keywords.dependencies,
|
|
3313
|
-
"description": keywords.metaData,
|
|
3314
|
-
"enum": keywords.enum,
|
|
3315
|
-
"format": keywords.metaData,
|
|
3316
|
-
"fragmentResolution": keywords.metaData,
|
|
3317
|
-
"items": keywords.items,
|
|
3318
|
-
"maxItems": keywords.maxItems,
|
|
3319
|
-
"minProperties": keywords.minProperties,
|
|
3320
|
-
"maxProperties": keywords.maxProperties,
|
|
3321
|
-
"maximum": keywords.maximumExclusiveMaximum,
|
|
3322
|
-
"media": keywords.metaData,
|
|
3323
|
-
"minItems": keywords.minItems,
|
|
3324
|
-
"minLength": keywords.minLength,
|
|
3325
|
-
"maxLength": keywords.maxLength,
|
|
3326
|
-
"minimum": keywords.minimumExclusiveMinimum,
|
|
3327
|
-
"multipleOf": keywords.multipleOf,
|
|
3328
|
-
"links": keywords.metaData,
|
|
3329
|
-
"not": keywords.not,
|
|
3330
|
-
"oneOf": keywords.oneOf,
|
|
3331
|
-
"pathStart": keywords.metaData,
|
|
3332
|
-
"pattern": keywords.pattern,
|
|
3333
|
-
"patternProperties": keywords.patternProperties,
|
|
3334
|
-
"properties": keywords.properties,
|
|
3335
|
-
"readOnly": keywords.metaData,
|
|
3336
|
-
"required": keywords.required,
|
|
3337
|
-
"title": keywords.metaData,
|
|
3338
|
-
"type": keywords.type,
|
|
3339
|
-
"uniqueItems": keywords.uniqueItems
|
|
3340
|
-
});
|
|
3341
|
-
|
|
3342
3165
|
var schema$3 = `{
|
|
3343
3166
|
"$schema": "http://json-schema.org/draft-06/schema#",
|
|
3344
3167
|
"$id": "http://json-schema.org/draft-06/schema#",
|
|
@@ -4692,7 +4515,7 @@ System.register('JsonSchema', [], function (exports) {
|
|
|
4692
4515
|
var lib_12 = exports('Keywords', lib.Keywords);
|
|
4693
4516
|
var lib_13 = exports('InvalidSchemaError', lib.InvalidSchemaError);
|
|
4694
4517
|
|
|
4695
|
-
}
|
|
4518
|
+
})
|
|
4696
4519
|
};
|
|
4697
|
-
});
|
|
4520
|
+
}));
|
|
4698
4521
|
//# sourceMappingURL=json-schema-system.js.map
|