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