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