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