@enbox/dwn-sdk-js 0.3.8 → 0.4.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.
Files changed (79) hide show
  1. package/dist/browser.mjs +11 -11
  2. package/dist/browser.mjs.map +4 -4
  3. package/dist/esm/generated/precompiled-validators.js +175 -512
  4. package/dist/esm/generated/precompiled-validators.js.map +1 -1
  5. package/dist/esm/src/core/dwn-error.js +1 -3
  6. package/dist/esm/src/core/dwn-error.js.map +1 -1
  7. package/dist/esm/src/core/messages-grant-authorization.js +1 -17
  8. package/dist/esm/src/core/messages-grant-authorization.js.map +1 -1
  9. package/dist/esm/src/core/protocol-authorization-validation.js +1 -1
  10. package/dist/esm/src/core/protocol-authorization-validation.js.map +1 -1
  11. package/dist/esm/src/core/replication-apply.js +200 -0
  12. package/dist/esm/src/core/replication-apply.js.map +1 -0
  13. package/dist/esm/src/dwn.js +212 -0
  14. package/dist/esm/src/dwn.js.map +1 -1
  15. package/dist/esm/src/handlers/messages-sync.js +66 -369
  16. package/dist/esm/src/handlers/messages-sync.js.map +1 -1
  17. package/dist/esm/src/handlers/records-write.js +18 -12
  18. package/dist/esm/src/handlers/records-write.js.map +1 -1
  19. package/dist/esm/src/index.js +1 -1
  20. package/dist/esm/src/index.js.map +1 -1
  21. package/dist/esm/src/interfaces/messages-sync.js +0 -11
  22. package/dist/esm/src/interfaces/messages-sync.js.map +1 -1
  23. package/dist/esm/tests/core/replication-apply.spec.js +220 -0
  24. package/dist/esm/tests/core/replication-apply.spec.js.map +1 -0
  25. package/dist/esm/tests/dwn.spec.js +139 -2
  26. package/dist/esm/tests/dwn.spec.js.map +1 -1
  27. package/dist/esm/tests/features/records-record-limit.spec.js +14 -0
  28. package/dist/esm/tests/features/records-record-limit.spec.js.map +1 -1
  29. package/dist/esm/tests/handlers/messages-sync.spec.js +1 -684
  30. package/dist/esm/tests/handlers/messages-sync.spec.js.map +1 -1
  31. package/dist/esm/tests/handlers/records-write.spec.js +43 -2
  32. package/dist/esm/tests/handlers/records-write.spec.js.map +1 -1
  33. package/dist/esm/tests/test-suite.js +0 -2
  34. package/dist/esm/tests/test-suite.js.map +1 -1
  35. package/dist/types/generated/precompiled-validators.d.ts.map +1 -1
  36. package/dist/types/src/core/dwn-error.d.ts +1 -3
  37. package/dist/types/src/core/dwn-error.d.ts.map +1 -1
  38. package/dist/types/src/core/messages-grant-authorization.d.ts +0 -1
  39. package/dist/types/src/core/messages-grant-authorization.d.ts.map +1 -1
  40. package/dist/types/src/core/replication-apply.d.ts +93 -0
  41. package/dist/types/src/core/replication-apply.d.ts.map +1 -0
  42. package/dist/types/src/dwn.d.ts +22 -1
  43. package/dist/types/src/dwn.d.ts.map +1 -1
  44. package/dist/types/src/handlers/messages-sync.d.ts +10 -54
  45. package/dist/types/src/handlers/messages-sync.d.ts.map +1 -1
  46. package/dist/types/src/handlers/records-write.d.ts.map +1 -1
  47. package/dist/types/src/index.d.ts +3 -3
  48. package/dist/types/src/index.d.ts.map +1 -1
  49. package/dist/types/src/interfaces/messages-sync.d.ts +0 -3
  50. package/dist/types/src/interfaces/messages-sync.d.ts.map +1 -1
  51. package/dist/types/src/types/messages-types.d.ts +0 -18
  52. package/dist/types/src/types/messages-types.d.ts.map +1 -1
  53. package/dist/types/tests/core/replication-apply.spec.d.ts +2 -0
  54. package/dist/types/tests/core/replication-apply.spec.d.ts.map +1 -0
  55. package/dist/types/tests/dwn.spec.d.ts.map +1 -1
  56. package/dist/types/tests/features/records-record-limit.spec.d.ts.map +1 -1
  57. package/dist/types/tests/handlers/messages-sync.spec.d.ts.map +1 -1
  58. package/dist/types/tests/handlers/records-write.spec.d.ts.map +1 -1
  59. package/dist/types/tests/test-suite.d.ts.map +1 -1
  60. package/package.json +1 -1
  61. package/src/core/dwn-error.ts +1 -3
  62. package/src/core/messages-grant-authorization.ts +1 -31
  63. package/src/core/protocol-authorization-validation.ts +2 -2
  64. package/src/core/replication-apply.ts +272 -0
  65. package/src/dwn.ts +296 -2
  66. package/src/handlers/messages-sync.ts +92 -585
  67. package/src/handlers/records-write.ts +18 -13
  68. package/src/index.ts +3 -4
  69. package/src/interfaces/messages-sync.ts +8 -25
  70. package/src/types/messages-types.ts +0 -20
  71. package/dist/esm/src/sync/records-projection.js +0 -228
  72. package/dist/esm/src/sync/records-projection.js.map +0 -1
  73. package/dist/esm/tests/sync/records-projection.spec.js +0 -245
  74. package/dist/esm/tests/sync/records-projection.spec.js.map +0 -1
  75. package/dist/types/src/sync/records-projection.d.ts +0 -98
  76. package/dist/types/src/sync/records-projection.d.ts.map +0 -1
  77. package/dist/types/tests/sync/records-projection.spec.d.ts +0 -2
  78. package/dist/types/tests/sync/records-projection.spec.d.ts.map +0 -1
  79. package/src/sync/records-projection.ts +0 -328
@@ -7159,7 +7159,7 @@ function validate59(data, { instancePath = "", parentData, parentDataProperty, r
7159
7159
  } validate59.errors = vErrors; return errors === 0; }
7160
7160
  validate59.evaluated = { "props": true, "dynamicProps": false, "dynamicItems": false };
7161
7161
  export const MessagesSync = validate62;
7162
- const schema88 = { "$schema": "https://json-schema.org/draft/2020-12/schema", "$id": "https://identity.foundation/dwn/json-schemas/messages-sync.json", "type": "object", "additionalProperties": false, "required": ["authorization", "descriptor"], "properties": { "authorization": { "$ref": "https://identity.foundation/dwn/json-schemas/authorization.json" }, "descriptor": { "type": "object", "additionalProperties": false, "required": ["interface", "method", "messageTimestamp", "action"], "properties": { "interface": { "enum": ["Messages"], "type": "string" }, "method": { "enum": ["Sync"], "type": "string" }, "messageTimestamp": { "$ref": "https://identity.foundation/dwn/json-schemas/defs.json#/$defs/date-time" }, "action": { "enum": ["root", "subtree", "leaves", "diff"], "type": "string" }, "protocol": { "type": "string" }, "projectionRootVersion": { "enum": ["records-primary-scope-root-v1"], "type": "string" }, "projectionScopes": { "type": "array", "minItems": 1, "items": { "type": "object", "additionalProperties": false, "required": ["protocol"], "properties": { "protocol": { "type": "string" }, "protocolPath": { "type": "string", "maxLength": 600 }, "contextId": { "type": "string", "maxLength": 600 } }, "not": { "required": ["protocolPath", "contextId"] } } }, "prefix": { "type": "string", "pattern": "^[01]*$" }, "permissionGrantIds": { "type": "array", "items": { "type": "string" }, "minItems": 1, "uniqueItems": true }, "hashes": { "type": "object", "additionalProperties": { "type": "string" }, "description": "Map of { bitPrefix: hexHash } for the 'diff' action." }, "depth": { "type": "integer", "minimum": 1, "maximum": 256, "description": "Bit depth at which the client computed its subtree hashes." } }, "allOf": [{ "if": { "required": ["projectionRootVersion"] }, "then": { "required": ["projectionScopes"], "not": { "required": ["protocol"] } } }, { "if": { "required": ["projectionScopes"] }, "then": { "required": ["projectionRootVersion"], "not": { "required": ["protocol"] } } }, { "if": { "properties": { "action": { "const": "subtree" } } }, "then": { "required": ["prefix"] } }, { "if": { "properties": { "action": { "const": "leaves" } } }, "then": { "required": ["prefix"] } }, { "if": { "properties": { "action": { "const": "diff" } } }, "then": { "required": ["hashes", "depth"] } }] } } };
7162
+ const schema88 = { "$schema": "https://json-schema.org/draft/2020-12/schema", "$id": "https://identity.foundation/dwn/json-schemas/messages-sync.json", "type": "object", "additionalProperties": false, "required": ["authorization", "descriptor"], "properties": { "authorization": { "$ref": "https://identity.foundation/dwn/json-schemas/authorization.json" }, "descriptor": { "type": "object", "additionalProperties": false, "required": ["interface", "method", "messageTimestamp", "action"], "properties": { "interface": { "enum": ["Messages"], "type": "string" }, "method": { "enum": ["Sync"], "type": "string" }, "messageTimestamp": { "$ref": "https://identity.foundation/dwn/json-schemas/defs.json#/$defs/date-time" }, "action": { "enum": ["root", "subtree", "leaves", "diff"], "type": "string" }, "protocol": { "type": "string" }, "prefix": { "type": "string", "pattern": "^[01]*$" }, "permissionGrantIds": { "type": "array", "items": { "type": "string" }, "minItems": 1, "uniqueItems": true }, "hashes": { "type": "object", "additionalProperties": { "type": "string" }, "description": "Map of { bitPrefix: hexHash } for the 'diff' action." }, "depth": { "type": "integer", "minimum": 1, "maximum": 256, "description": "Bit depth at which the client computed its subtree hashes." } }, "allOf": [{ "if": { "properties": { "action": { "const": "subtree" } } }, "then": { "required": ["prefix"] } }, { "if": { "properties": { "action": { "const": "leaves" } } }, "then": { "required": ["prefix"] } }, { "if": { "properties": { "action": { "const": "diff" } } }, "then": { "required": ["hashes", "depth"] } }] } } };
7163
7163
  const pattern37 = new RegExp("^[01]*$", "u");
7164
7164
  function validate62(data, { instancePath = "", parentData, parentDataProperty, rootData = data, dynamicAnchors = {} } = {}) { /*# sourceURL="https://identity.foundation/dwn/json-schemas/messages-sync.json" */ ; let vErrors = null; let errors = 0; const evaluated0 = validate62.evaluated; if (evaluated0.dynamicProps) {
7165
7165
  evaluated0.props = undefined;
@@ -7202,16 +7202,17 @@ function validate62(data, { instancePath = "", parentData, parentDataProperty, r
7202
7202
  let valid2 = true;
7203
7203
  const _errs7 = errors;
7204
7204
  if (data1 && typeof data1 == "object" && !Array.isArray(data1)) {
7205
- let missing1;
7206
- if ((data1.projectionRootVersion === undefined) && (missing1 = "projectionRootVersion")) {
7207
- const err0 = {};
7208
- if (vErrors === null) {
7209
- vErrors = [err0];
7210
- }
7211
- else {
7212
- vErrors.push(err0);
7205
+ if (data1.action !== undefined) {
7206
+ if ("subtree" !== data1.action) {
7207
+ const err0 = {};
7208
+ if (vErrors === null) {
7209
+ vErrors = [err0];
7210
+ }
7211
+ else {
7212
+ vErrors.push(err0);
7213
+ }
7214
+ errors++;
7213
7215
  }
7214
- errors++;
7215
7216
  }
7216
7217
  }
7217
7218
  var _valid0 = _errs7 === errors;
@@ -7225,57 +7226,24 @@ function validate62(data, { instancePath = "", parentData, parentDataProperty, r
7225
7226
  }
7226
7227
  }
7227
7228
  if (_valid0) {
7228
- const _errs8 = errors;
7229
7229
  const _errs9 = errors;
7230
- const _errs10 = errors;
7231
7230
  if (data1 && typeof data1 == "object" && !Array.isArray(data1)) {
7232
- let missing2;
7233
- if ((data1.protocol === undefined) && (missing2 = "protocol")) {
7234
- const err1 = {};
7235
- if (vErrors === null) {
7236
- vErrors = [err1];
7237
- }
7238
- else {
7239
- vErrors.push(err1);
7240
- }
7241
- errors++;
7242
- }
7243
- }
7244
- var valid3 = _errs10 === errors;
7245
- if (valid3) {
7246
- validate62.errors = [{ instancePath: instancePath + "/descriptor", schemaPath: "#/properties/descriptor/allOf/0/then/not", keyword: "not", params: {}, message: "must NOT be valid" }];
7247
- return false;
7248
- }
7249
- else {
7250
- errors = _errs9;
7251
- if (vErrors !== null) {
7252
- if (_errs9) {
7253
- vErrors.length = _errs9;
7254
- }
7255
- else {
7256
- vErrors = null;
7257
- }
7258
- }
7259
- }
7260
- if (errors === _errs8) {
7261
- if (data1 && typeof data1 == "object" && !Array.isArray(data1)) {
7262
- let missing3;
7263
- if ((data1.projectionScopes === undefined) && (missing3 = "projectionScopes")) {
7264
- validate62.errors = [{ instancePath: instancePath + "/descriptor", schemaPath: "#/properties/descriptor/allOf/0/then/required", keyword: "required", params: { missingProperty: missing3 }, message: "must have required property '" + missing3 + "'" }];
7265
- return false;
7266
- }
7231
+ let missing1;
7232
+ if ((data1.prefix === undefined) && (missing1 = "prefix")) {
7233
+ validate62.errors = [{ instancePath: instancePath + "/descriptor", schemaPath: "#/properties/descriptor/allOf/0/then/required", keyword: "required", params: { missingProperty: missing1 }, message: "must have required property '" + missing1 + "'" }];
7234
+ return false;
7267
7235
  }
7268
7236
  }
7269
- var _valid0 = _errs8 === errors;
7237
+ var _valid0 = _errs9 === errors;
7270
7238
  valid2 = _valid0;
7271
7239
  }
7272
7240
  if (!valid2) {
7273
- const err2 = { instancePath: instancePath + "/descriptor", schemaPath: "#/properties/descriptor/allOf/0/if", keyword: "if", params: { failingKeyword: "then" }, message: "must match \"then\" schema" };
7241
+ const err1 = { instancePath: instancePath + "/descriptor", schemaPath: "#/properties/descriptor/allOf/0/if", keyword: "if", params: { failingKeyword: "then" }, message: "must match \"then\" schema" };
7274
7242
  if (vErrors === null) {
7275
- vErrors = [err2];
7243
+ vErrors = [err1];
7276
7244
  }
7277
7245
  else {
7278
- vErrors.push(err2);
7246
+ vErrors.push(err1);
7279
7247
  }
7280
7248
  errors++;
7281
7249
  validate62.errors = vErrors;
@@ -7283,28 +7251,29 @@ function validate62(data, { instancePath = "", parentData, parentDataProperty, r
7283
7251
  }
7284
7252
  var valid1 = _errs5 === errors;
7285
7253
  if (valid1) {
7254
+ const _errs10 = errors;
7286
7255
  const _errs11 = errors;
7287
- const _errs12 = errors;
7288
7256
  let valid4 = true;
7289
- const _errs13 = errors;
7257
+ const _errs12 = errors;
7290
7258
  if (data1 && typeof data1 == "object" && !Array.isArray(data1)) {
7291
- let missing4;
7292
- if ((data1.projectionScopes === undefined) && (missing4 = "projectionScopes")) {
7293
- const err3 = {};
7294
- if (vErrors === null) {
7295
- vErrors = [err3];
7296
- }
7297
- else {
7298
- vErrors.push(err3);
7259
+ if (data1.action !== undefined) {
7260
+ if ("leaves" !== data1.action) {
7261
+ const err2 = {};
7262
+ if (vErrors === null) {
7263
+ vErrors = [err2];
7264
+ }
7265
+ else {
7266
+ vErrors.push(err2);
7267
+ }
7268
+ errors++;
7299
7269
  }
7300
- errors++;
7301
7270
  }
7302
7271
  }
7303
- var _valid1 = _errs13 === errors;
7304
- errors = _errs12;
7272
+ var _valid1 = _errs12 === errors;
7273
+ errors = _errs11;
7305
7274
  if (vErrors !== null) {
7306
- if (_errs12) {
7307
- vErrors.length = _errs12;
7275
+ if (_errs11) {
7276
+ vErrors.length = _errs11;
7308
7277
  }
7309
7278
  else {
7310
7279
  vErrors = null;
@@ -7312,237 +7281,94 @@ function validate62(data, { instancePath = "", parentData, parentDataProperty, r
7312
7281
  }
7313
7282
  if (_valid1) {
7314
7283
  const _errs14 = errors;
7315
- const _errs15 = errors;
7316
- const _errs16 = errors;
7317
7284
  if (data1 && typeof data1 == "object" && !Array.isArray(data1)) {
7318
- let missing5;
7319
- if ((data1.protocol === undefined) && (missing5 = "protocol")) {
7320
- const err4 = {};
7321
- if (vErrors === null) {
7322
- vErrors = [err4];
7323
- }
7324
- else {
7325
- vErrors.push(err4);
7326
- }
7327
- errors++;
7328
- }
7329
- }
7330
- var valid5 = _errs16 === errors;
7331
- if (valid5) {
7332
- validate62.errors = [{ instancePath: instancePath + "/descriptor", schemaPath: "#/properties/descriptor/allOf/1/then/not", keyword: "not", params: {}, message: "must NOT be valid" }];
7333
- return false;
7334
- }
7335
- else {
7336
- errors = _errs15;
7337
- if (vErrors !== null) {
7338
- if (_errs15) {
7339
- vErrors.length = _errs15;
7340
- }
7341
- else {
7342
- vErrors = null;
7343
- }
7344
- }
7345
- }
7346
- if (errors === _errs14) {
7347
- if (data1 && typeof data1 == "object" && !Array.isArray(data1)) {
7348
- let missing6;
7349
- if ((data1.projectionRootVersion === undefined) && (missing6 = "projectionRootVersion")) {
7350
- validate62.errors = [{ instancePath: instancePath + "/descriptor", schemaPath: "#/properties/descriptor/allOf/1/then/required", keyword: "required", params: { missingProperty: missing6 }, message: "must have required property '" + missing6 + "'" }];
7351
- return false;
7352
- }
7285
+ let missing2;
7286
+ if ((data1.prefix === undefined) && (missing2 = "prefix")) {
7287
+ validate62.errors = [{ instancePath: instancePath + "/descriptor", schemaPath: "#/properties/descriptor/allOf/1/then/required", keyword: "required", params: { missingProperty: missing2 }, message: "must have required property '" + missing2 + "'" }];
7288
+ return false;
7353
7289
  }
7354
7290
  }
7355
7291
  var _valid1 = _errs14 === errors;
7356
7292
  valid4 = _valid1;
7357
7293
  }
7358
7294
  if (!valid4) {
7359
- const err5 = { instancePath: instancePath + "/descriptor", schemaPath: "#/properties/descriptor/allOf/1/if", keyword: "if", params: { failingKeyword: "then" }, message: "must match \"then\" schema" };
7295
+ const err3 = { instancePath: instancePath + "/descriptor", schemaPath: "#/properties/descriptor/allOf/1/if", keyword: "if", params: { failingKeyword: "then" }, message: "must match \"then\" schema" };
7360
7296
  if (vErrors === null) {
7361
- vErrors = [err5];
7297
+ vErrors = [err3];
7362
7298
  }
7363
7299
  else {
7364
- vErrors.push(err5);
7300
+ vErrors.push(err3);
7365
7301
  }
7366
7302
  errors++;
7367
7303
  validate62.errors = vErrors;
7368
7304
  return false;
7369
7305
  }
7370
- var valid1 = _errs11 === errors;
7306
+ var valid1 = _errs10 === errors;
7371
7307
  if (valid1) {
7372
- const _errs17 = errors;
7373
- const _errs18 = errors;
7308
+ const _errs15 = errors;
7309
+ const _errs16 = errors;
7374
7310
  let valid6 = true;
7375
- const _errs19 = errors;
7311
+ const _errs17 = errors;
7376
7312
  if (data1 && typeof data1 == "object" && !Array.isArray(data1)) {
7377
7313
  if (data1.action !== undefined) {
7378
- if ("subtree" !== data1.action) {
7379
- const err6 = {};
7314
+ if ("diff" !== data1.action) {
7315
+ const err4 = {};
7380
7316
  if (vErrors === null) {
7381
- vErrors = [err6];
7317
+ vErrors = [err4];
7382
7318
  }
7383
7319
  else {
7384
- vErrors.push(err6);
7320
+ vErrors.push(err4);
7385
7321
  }
7386
7322
  errors++;
7387
7323
  }
7388
7324
  }
7389
7325
  }
7390
- var _valid2 = _errs19 === errors;
7391
- errors = _errs18;
7326
+ var _valid2 = _errs17 === errors;
7327
+ errors = _errs16;
7392
7328
  if (vErrors !== null) {
7393
- if (_errs18) {
7394
- vErrors.length = _errs18;
7329
+ if (_errs16) {
7330
+ vErrors.length = _errs16;
7395
7331
  }
7396
7332
  else {
7397
7333
  vErrors = null;
7398
7334
  }
7399
7335
  }
7400
7336
  if (_valid2) {
7401
- const _errs21 = errors;
7337
+ const _errs19 = errors;
7402
7338
  if (data1 && typeof data1 == "object" && !Array.isArray(data1)) {
7403
- let missing7;
7404
- if ((data1.prefix === undefined) && (missing7 = "prefix")) {
7405
- validate62.errors = [{ instancePath: instancePath + "/descriptor", schemaPath: "#/properties/descriptor/allOf/2/then/required", keyword: "required", params: { missingProperty: missing7 }, message: "must have required property '" + missing7 + "'" }];
7339
+ let missing3;
7340
+ if (((data1.hashes === undefined) && (missing3 = "hashes")) || ((data1.depth === undefined) && (missing3 = "depth"))) {
7341
+ validate62.errors = [{ instancePath: instancePath + "/descriptor", schemaPath: "#/properties/descriptor/allOf/2/then/required", keyword: "required", params: { missingProperty: missing3 }, message: "must have required property '" + missing3 + "'" }];
7406
7342
  return false;
7407
7343
  }
7408
7344
  }
7409
- var _valid2 = _errs21 === errors;
7345
+ var _valid2 = _errs19 === errors;
7410
7346
  valid6 = _valid2;
7411
7347
  }
7412
7348
  if (!valid6) {
7413
- const err7 = { instancePath: instancePath + "/descriptor", schemaPath: "#/properties/descriptor/allOf/2/if", keyword: "if", params: { failingKeyword: "then" }, message: "must match \"then\" schema" };
7349
+ const err5 = { instancePath: instancePath + "/descriptor", schemaPath: "#/properties/descriptor/allOf/2/if", keyword: "if", params: { failingKeyword: "then" }, message: "must match \"then\" schema" };
7414
7350
  if (vErrors === null) {
7415
- vErrors = [err7];
7351
+ vErrors = [err5];
7416
7352
  }
7417
7353
  else {
7418
- vErrors.push(err7);
7354
+ vErrors.push(err5);
7419
7355
  }
7420
7356
  errors++;
7421
7357
  validate62.errors = vErrors;
7422
7358
  return false;
7423
7359
  }
7424
- var valid1 = _errs17 === errors;
7425
- if (valid1) {
7426
- const _errs22 = errors;
7427
- const _errs23 = errors;
7428
- let valid8 = true;
7429
- const _errs24 = errors;
7430
- if (data1 && typeof data1 == "object" && !Array.isArray(data1)) {
7431
- if (data1.action !== undefined) {
7432
- if ("leaves" !== data1.action) {
7433
- const err8 = {};
7434
- if (vErrors === null) {
7435
- vErrors = [err8];
7436
- }
7437
- else {
7438
- vErrors.push(err8);
7439
- }
7440
- errors++;
7441
- }
7442
- }
7443
- }
7444
- var _valid3 = _errs24 === errors;
7445
- errors = _errs23;
7446
- if (vErrors !== null) {
7447
- if (_errs23) {
7448
- vErrors.length = _errs23;
7449
- }
7450
- else {
7451
- vErrors = null;
7452
- }
7453
- }
7454
- if (_valid3) {
7455
- const _errs26 = errors;
7456
- if (data1 && typeof data1 == "object" && !Array.isArray(data1)) {
7457
- let missing8;
7458
- if ((data1.prefix === undefined) && (missing8 = "prefix")) {
7459
- validate62.errors = [{ instancePath: instancePath + "/descriptor", schemaPath: "#/properties/descriptor/allOf/3/then/required", keyword: "required", params: { missingProperty: missing8 }, message: "must have required property '" + missing8 + "'" }];
7460
- return false;
7461
- }
7462
- }
7463
- var _valid3 = _errs26 === errors;
7464
- valid8 = _valid3;
7465
- }
7466
- if (!valid8) {
7467
- const err9 = { instancePath: instancePath + "/descriptor", schemaPath: "#/properties/descriptor/allOf/3/if", keyword: "if", params: { failingKeyword: "then" }, message: "must match \"then\" schema" };
7468
- if (vErrors === null) {
7469
- vErrors = [err9];
7470
- }
7471
- else {
7472
- vErrors.push(err9);
7473
- }
7474
- errors++;
7475
- validate62.errors = vErrors;
7476
- return false;
7477
- }
7478
- var valid1 = _errs22 === errors;
7479
- if (valid1) {
7480
- const _errs27 = errors;
7481
- const _errs28 = errors;
7482
- let valid10 = true;
7483
- const _errs29 = errors;
7484
- if (data1 && typeof data1 == "object" && !Array.isArray(data1)) {
7485
- if (data1.action !== undefined) {
7486
- if ("diff" !== data1.action) {
7487
- const err10 = {};
7488
- if (vErrors === null) {
7489
- vErrors = [err10];
7490
- }
7491
- else {
7492
- vErrors.push(err10);
7493
- }
7494
- errors++;
7495
- }
7496
- }
7497
- }
7498
- var _valid4 = _errs29 === errors;
7499
- errors = _errs28;
7500
- if (vErrors !== null) {
7501
- if (_errs28) {
7502
- vErrors.length = _errs28;
7503
- }
7504
- else {
7505
- vErrors = null;
7506
- }
7507
- }
7508
- if (_valid4) {
7509
- const _errs31 = errors;
7510
- if (data1 && typeof data1 == "object" && !Array.isArray(data1)) {
7511
- let missing9;
7512
- if (((data1.hashes === undefined) && (missing9 = "hashes")) || ((data1.depth === undefined) && (missing9 = "depth"))) {
7513
- validate62.errors = [{ instancePath: instancePath + "/descriptor", schemaPath: "#/properties/descriptor/allOf/4/then/required", keyword: "required", params: { missingProperty: missing9 }, message: "must have required property '" + missing9 + "'" }];
7514
- return false;
7515
- }
7516
- }
7517
- var _valid4 = _errs31 === errors;
7518
- valid10 = _valid4;
7519
- }
7520
- if (!valid10) {
7521
- const err11 = { instancePath: instancePath + "/descriptor", schemaPath: "#/properties/descriptor/allOf/4/if", keyword: "if", params: { failingKeyword: "then" }, message: "must match \"then\" schema" };
7522
- if (vErrors === null) {
7523
- vErrors = [err11];
7524
- }
7525
- else {
7526
- vErrors.push(err11);
7527
- }
7528
- errors++;
7529
- validate62.errors = vErrors;
7530
- return false;
7531
- }
7532
- var valid1 = _errs27 === errors;
7533
- }
7534
- }
7360
+ var valid1 = _errs15 === errors;
7535
7361
  }
7536
7362
  }
7537
7363
  if (errors === _errs3) {
7538
7364
  if (data1 && typeof data1 == "object" && !Array.isArray(data1)) {
7539
- let missing10;
7540
- if (((((data1.interface === undefined) && (missing10 = "interface")) || ((data1.method === undefined) && (missing10 = "method"))) || ((data1.messageTimestamp === undefined) && (missing10 = "messageTimestamp"))) || ((data1.action === undefined) && (missing10 = "action"))) {
7541
- validate62.errors = [{ instancePath: instancePath + "/descriptor", schemaPath: "#/properties/descriptor/required", keyword: "required", params: { missingProperty: missing10 }, message: "must have required property '" + missing10 + "'" }];
7365
+ let missing4;
7366
+ if (((((data1.interface === undefined) && (missing4 = "interface")) || ((data1.method === undefined) && (missing4 = "method"))) || ((data1.messageTimestamp === undefined) && (missing4 = "messageTimestamp"))) || ((data1.action === undefined) && (missing4 = "action"))) {
7367
+ validate62.errors = [{ instancePath: instancePath + "/descriptor", schemaPath: "#/properties/descriptor/required", keyword: "required", params: { missingProperty: missing4 }, message: "must have required property '" + missing4 + "'" }];
7542
7368
  return false;
7543
7369
  }
7544
7370
  else {
7545
- const _errs32 = errors;
7371
+ const _errs20 = errors;
7546
7372
  for (const key1 in data1) {
7547
7373
  if (!(func2.call(schema88.properties.descriptor.properties, key1))) {
7548
7374
  validate62.errors = [{ instancePath: instancePath + "/descriptor", schemaPath: "#/properties/descriptor/additionalProperties", keyword: "additionalProperties", params: { additionalProperty: key1 }, message: "must NOT have additional properties" }];
@@ -7550,10 +7376,10 @@ function validate62(data, { instancePath = "", parentData, parentDataProperty, r
7550
7376
  break;
7551
7377
  }
7552
7378
  }
7553
- if (_errs32 === errors) {
7379
+ if (_errs20 === errors) {
7554
7380
  if (data1.interface !== undefined) {
7555
7381
  let data5 = data1.interface;
7556
- const _errs33 = errors;
7382
+ const _errs21 = errors;
7557
7383
  if (typeof data5 !== "string") {
7558
7384
  validate62.errors = [{ instancePath: instancePath + "/descriptor/interface", schemaPath: "#/properties/descriptor/properties/interface/type", keyword: "type", params: { type: "string" }, message: "must be string" }];
7559
7385
  return false;
@@ -7562,15 +7388,15 @@ function validate62(data, { instancePath = "", parentData, parentDataProperty, r
7562
7388
  validate62.errors = [{ instancePath: instancePath + "/descriptor/interface", schemaPath: "#/properties/descriptor/properties/interface/enum", keyword: "enum", params: { allowedValues: schema88.properties.descriptor.properties.interface.enum }, message: "must be equal to one of the allowed values" }];
7563
7389
  return false;
7564
7390
  }
7565
- var valid12 = _errs33 === errors;
7391
+ var valid8 = _errs21 === errors;
7566
7392
  }
7567
7393
  else {
7568
- var valid12 = true;
7394
+ var valid8 = true;
7569
7395
  }
7570
- if (valid12) {
7396
+ if (valid8) {
7571
7397
  if (data1.method !== undefined) {
7572
7398
  let data6 = data1.method;
7573
- const _errs35 = errors;
7399
+ const _errs23 = errors;
7574
7400
  if (typeof data6 !== "string") {
7575
7401
  validate62.errors = [{ instancePath: instancePath + "/descriptor/method", schemaPath: "#/properties/descriptor/properties/method/type", keyword: "type", params: { type: "string" }, message: "must be string" }];
7576
7402
  return false;
@@ -7579,17 +7405,17 @@ function validate62(data, { instancePath = "", parentData, parentDataProperty, r
7579
7405
  validate62.errors = [{ instancePath: instancePath + "/descriptor/method", schemaPath: "#/properties/descriptor/properties/method/enum", keyword: "enum", params: { allowedValues: schema88.properties.descriptor.properties.method.enum }, message: "must be equal to one of the allowed values" }];
7580
7406
  return false;
7581
7407
  }
7582
- var valid12 = _errs35 === errors;
7408
+ var valid8 = _errs23 === errors;
7583
7409
  }
7584
7410
  else {
7585
- var valid12 = true;
7411
+ var valid8 = true;
7586
7412
  }
7587
- if (valid12) {
7413
+ if (valid8) {
7588
7414
  if (data1.messageTimestamp !== undefined) {
7589
7415
  let data7 = data1.messageTimestamp;
7590
- const _errs37 = errors;
7591
- const _errs38 = errors;
7592
- if (errors === _errs38) {
7416
+ const _errs25 = errors;
7417
+ const _errs26 = errors;
7418
+ if (errors === _errs26) {
7593
7419
  if (typeof data7 === "string") {
7594
7420
  if (!pattern14.test(data7)) {
7595
7421
  validate62.errors = [{ instancePath: instancePath + "/descriptor/messageTimestamp", schemaPath: "https://identity.foundation/dwn/json-schemas/defs.json#/$defs/date-time/pattern", keyword: "pattern", params: { pattern: "^\\d{4}-[0-1]\\d-[0-3]\\dT(?:[0-2]\\d:[0-5]\\d:[0-5]\\d|23:59:60)\\.\\d{6}Z$" }, message: "must match pattern \"" + "^\\d{4}-[0-1]\\d-[0-3]\\dT(?:[0-2]\\d:[0-5]\\d:[0-5]\\d|23:59:60)\\.\\d{6}Z$" + "\"" }];
@@ -7601,15 +7427,15 @@ function validate62(data, { instancePath = "", parentData, parentDataProperty, r
7601
7427
  return false;
7602
7428
  }
7603
7429
  }
7604
- var valid12 = _errs37 === errors;
7430
+ var valid8 = _errs25 === errors;
7605
7431
  }
7606
7432
  else {
7607
- var valid12 = true;
7433
+ var valid8 = true;
7608
7434
  }
7609
- if (valid12) {
7435
+ if (valid8) {
7610
7436
  if (data1.action !== undefined) {
7611
7437
  let data8 = data1.action;
7612
- const _errs40 = errors;
7438
+ const _errs28 = errors;
7613
7439
  if (typeof data8 !== "string") {
7614
7440
  validate62.errors = [{ instancePath: instancePath + "/descriptor/action", schemaPath: "#/properties/descriptor/properties/action/type", keyword: "type", params: { type: "string" }, message: "must be string" }];
7615
7441
  return false;
@@ -7618,317 +7444,154 @@ function validate62(data, { instancePath = "", parentData, parentDataProperty, r
7618
7444
  validate62.errors = [{ instancePath: instancePath + "/descriptor/action", schemaPath: "#/properties/descriptor/properties/action/enum", keyword: "enum", params: { allowedValues: schema88.properties.descriptor.properties.action.enum }, message: "must be equal to one of the allowed values" }];
7619
7445
  return false;
7620
7446
  }
7621
- var valid12 = _errs40 === errors;
7447
+ var valid8 = _errs28 === errors;
7622
7448
  }
7623
7449
  else {
7624
- var valid12 = true;
7450
+ var valid8 = true;
7625
7451
  }
7626
- if (valid12) {
7452
+ if (valid8) {
7627
7453
  if (data1.protocol !== undefined) {
7628
- const _errs42 = errors;
7454
+ const _errs30 = errors;
7629
7455
  if (typeof data1.protocol !== "string") {
7630
7456
  validate62.errors = [{ instancePath: instancePath + "/descriptor/protocol", schemaPath: "#/properties/descriptor/properties/protocol/type", keyword: "type", params: { type: "string" }, message: "must be string" }];
7631
7457
  return false;
7632
7458
  }
7633
- var valid12 = _errs42 === errors;
7459
+ var valid8 = _errs30 === errors;
7634
7460
  }
7635
7461
  else {
7636
- var valid12 = true;
7637
- }
7638
- if (valid12) {
7639
- if (data1.projectionRootVersion !== undefined) {
7640
- let data10 = data1.projectionRootVersion;
7641
- const _errs44 = errors;
7642
- if (typeof data10 !== "string") {
7643
- validate62.errors = [{ instancePath: instancePath + "/descriptor/projectionRootVersion", schemaPath: "#/properties/descriptor/properties/projectionRootVersion/type", keyword: "type", params: { type: "string" }, message: "must be string" }];
7644
- return false;
7645
- }
7646
- if (!(data10 === "records-primary-scope-root-v1")) {
7647
- validate62.errors = [{ instancePath: instancePath + "/descriptor/projectionRootVersion", schemaPath: "#/properties/descriptor/properties/projectionRootVersion/enum", keyword: "enum", params: { allowedValues: schema88.properties.descriptor.properties.projectionRootVersion.enum }, message: "must be equal to one of the allowed values" }];
7648
- return false;
7462
+ var valid8 = true;
7463
+ }
7464
+ if (valid8) {
7465
+ if (data1.prefix !== undefined) {
7466
+ let data10 = data1.prefix;
7467
+ const _errs32 = errors;
7468
+ if (errors === _errs32) {
7469
+ if (typeof data10 === "string") {
7470
+ if (!pattern37.test(data10)) {
7471
+ validate62.errors = [{ instancePath: instancePath + "/descriptor/prefix", schemaPath: "#/properties/descriptor/properties/prefix/pattern", keyword: "pattern", params: { pattern: "^[01]*$" }, message: "must match pattern \"" + "^[01]*$" + "\"" }];
7472
+ return false;
7473
+ }
7474
+ }
7475
+ else {
7476
+ validate62.errors = [{ instancePath: instancePath + "/descriptor/prefix", schemaPath: "#/properties/descriptor/properties/prefix/type", keyword: "type", params: { type: "string" }, message: "must be string" }];
7477
+ return false;
7478
+ }
7649
7479
  }
7650
- var valid12 = _errs44 === errors;
7480
+ var valid8 = _errs32 === errors;
7651
7481
  }
7652
7482
  else {
7653
- var valid12 = true;
7483
+ var valid8 = true;
7654
7484
  }
7655
- if (valid12) {
7656
- if (data1.projectionScopes !== undefined) {
7657
- let data11 = data1.projectionScopes;
7658
- const _errs46 = errors;
7659
- if (errors === _errs46) {
7485
+ if (valid8) {
7486
+ if (data1.permissionGrantIds !== undefined) {
7487
+ let data11 = data1.permissionGrantIds;
7488
+ const _errs34 = errors;
7489
+ if (errors === _errs34) {
7660
7490
  if (Array.isArray(data11)) {
7661
7491
  if (data11.length < 1) {
7662
- validate62.errors = [{ instancePath: instancePath + "/descriptor/projectionScopes", schemaPath: "#/properties/descriptor/properties/projectionScopes/minItems", keyword: "minItems", params: { limit: 1 }, message: "must NOT have fewer than 1 items" }];
7492
+ validate62.errors = [{ instancePath: instancePath + "/descriptor/permissionGrantIds", schemaPath: "#/properties/descriptor/properties/permissionGrantIds/minItems", keyword: "minItems", params: { limit: 1 }, message: "must NOT have fewer than 1 items" }];
7663
7493
  return false;
7664
7494
  }
7665
7495
  else {
7666
- var valid14 = true;
7496
+ var valid10 = true;
7667
7497
  const len0 = data11.length;
7668
7498
  for (let i0 = 0; i0 < len0; i0++) {
7669
- let data12 = data11[i0];
7670
- const _errs48 = errors;
7671
- const _errs50 = errors;
7672
- const _errs51 = errors;
7673
- if (data12 && typeof data12 == "object" && !Array.isArray(data12)) {
7674
- let missing11;
7675
- if (((data12.protocolPath === undefined) && (missing11 = "protocolPath")) || ((data12.contextId === undefined) && (missing11 = "contextId"))) {
7676
- const err12 = {};
7677
- if (vErrors === null) {
7678
- vErrors = [err12];
7679
- }
7680
- else {
7681
- vErrors.push(err12);
7682
- }
7683
- errors++;
7684
- }
7685
- }
7686
- var valid15 = _errs51 === errors;
7687
- if (valid15) {
7688
- validate62.errors = [{ instancePath: instancePath + "/descriptor/projectionScopes/" + i0, schemaPath: "#/properties/descriptor/properties/projectionScopes/items/not", keyword: "not", params: {}, message: "must NOT be valid" }];
7499
+ const _errs36 = errors;
7500
+ if (typeof data11[i0] !== "string") {
7501
+ validate62.errors = [{ instancePath: instancePath + "/descriptor/permissionGrantIds/" + i0, schemaPath: "#/properties/descriptor/properties/permissionGrantIds/items/type", keyword: "type", params: { type: "string" }, message: "must be string" }];
7689
7502
  return false;
7690
7503
  }
7691
- else {
7692
- errors = _errs50;
7693
- if (vErrors !== null) {
7694
- if (_errs50) {
7695
- vErrors.length = _errs50;
7696
- }
7697
- else {
7698
- vErrors = null;
7699
- }
7700
- }
7504
+ var valid10 = _errs36 === errors;
7505
+ if (!valid10) {
7506
+ break;
7701
7507
  }
7702
- if (errors === _errs48) {
7703
- if (data12 && typeof data12 == "object" && !Array.isArray(data12)) {
7704
- let missing12;
7705
- if ((data12.protocol === undefined) && (missing12 = "protocol")) {
7706
- validate62.errors = [{ instancePath: instancePath + "/descriptor/projectionScopes/" + i0, schemaPath: "#/properties/descriptor/properties/projectionScopes/items/required", keyword: "required", params: { missingProperty: missing12 }, message: "must have required property '" + missing12 + "'" }];
7707
- return false;
7508
+ }
7509
+ if (valid10) {
7510
+ let i1 = data11.length;
7511
+ let j0;
7512
+ if (i1 > 1) {
7513
+ const indices0 = {};
7514
+ for (; i1--;) {
7515
+ let item0 = data11[i1];
7516
+ if (typeof item0 !== "string") {
7517
+ continue;
7708
7518
  }
7709
- else {
7710
- const _errs52 = errors;
7711
- for (const key2 in data12) {
7712
- if (!(((key2 === "protocol") || (key2 === "protocolPath")) || (key2 === "contextId"))) {
7713
- validate62.errors = [{ instancePath: instancePath + "/descriptor/projectionScopes/" + i0, schemaPath: "#/properties/descriptor/properties/projectionScopes/items/additionalProperties", keyword: "additionalProperties", params: { additionalProperty: key2 }, message: "must NOT have additional properties" }];
7714
- return false;
7715
- break;
7716
- }
7717
- }
7718
- if (_errs52 === errors) {
7719
- if (data12.protocol !== undefined) {
7720
- const _errs53 = errors;
7721
- if (typeof data12.protocol !== "string") {
7722
- validate62.errors = [{ instancePath: instancePath + "/descriptor/projectionScopes/" + i0 + "/protocol", schemaPath: "#/properties/descriptor/properties/projectionScopes/items/properties/protocol/type", keyword: "type", params: { type: "string" }, message: "must be string" }];
7723
- return false;
7724
- }
7725
- var valid16 = _errs53 === errors;
7726
- }
7727
- else {
7728
- var valid16 = true;
7729
- }
7730
- if (valid16) {
7731
- if (data12.protocolPath !== undefined) {
7732
- let data14 = data12.protocolPath;
7733
- const _errs55 = errors;
7734
- if (errors === _errs55) {
7735
- if (typeof data14 === "string") {
7736
- if (func1(data14) > 600) {
7737
- validate62.errors = [{ instancePath: instancePath + "/descriptor/projectionScopes/" + i0 + "/protocolPath", schemaPath: "#/properties/descriptor/properties/projectionScopes/items/properties/protocolPath/maxLength", keyword: "maxLength", params: { limit: 600 }, message: "must NOT have more than 600 characters" }];
7738
- return false;
7739
- }
7740
- }
7741
- else {
7742
- validate62.errors = [{ instancePath: instancePath + "/descriptor/projectionScopes/" + i0 + "/protocolPath", schemaPath: "#/properties/descriptor/properties/projectionScopes/items/properties/protocolPath/type", keyword: "type", params: { type: "string" }, message: "must be string" }];
7743
- return false;
7744
- }
7745
- }
7746
- var valid16 = _errs55 === errors;
7747
- }
7748
- else {
7749
- var valid16 = true;
7750
- }
7751
- if (valid16) {
7752
- if (data12.contextId !== undefined) {
7753
- let data15 = data12.contextId;
7754
- const _errs57 = errors;
7755
- if (errors === _errs57) {
7756
- if (typeof data15 === "string") {
7757
- if (func1(data15) > 600) {
7758
- validate62.errors = [{ instancePath: instancePath + "/descriptor/projectionScopes/" + i0 + "/contextId", schemaPath: "#/properties/descriptor/properties/projectionScopes/items/properties/contextId/maxLength", keyword: "maxLength", params: { limit: 600 }, message: "must NOT have more than 600 characters" }];
7759
- return false;
7760
- }
7761
- }
7762
- else {
7763
- validate62.errors = [{ instancePath: instancePath + "/descriptor/projectionScopes/" + i0 + "/contextId", schemaPath: "#/properties/descriptor/properties/projectionScopes/items/properties/contextId/type", keyword: "type", params: { type: "string" }, message: "must be string" }];
7764
- return false;
7765
- }
7766
- }
7767
- var valid16 = _errs57 === errors;
7768
- }
7769
- else {
7770
- var valid16 = true;
7771
- }
7772
- }
7773
- }
7774
- }
7519
+ if (typeof indices0[item0] == "number") {
7520
+ j0 = indices0[item0];
7521
+ validate62.errors = [{ instancePath: instancePath + "/descriptor/permissionGrantIds", schemaPath: "#/properties/descriptor/properties/permissionGrantIds/uniqueItems", keyword: "uniqueItems", params: { i: i1, j: j0 }, message: "must NOT have duplicate items (items ## " + j0 + " and " + i1 + " are identical)" }];
7522
+ return false;
7523
+ break;
7775
7524
  }
7776
- }
7777
- else {
7778
- validate62.errors = [{ instancePath: instancePath + "/descriptor/projectionScopes/" + i0, schemaPath: "#/properties/descriptor/properties/projectionScopes/items/type", keyword: "type", params: { type: "object" }, message: "must be object" }];
7779
- return false;
7525
+ indices0[item0] = i1;
7780
7526
  }
7781
7527
  }
7782
- var valid14 = _errs48 === errors;
7783
- if (!valid14) {
7784
- break;
7785
- }
7786
7528
  }
7787
7529
  }
7788
7530
  }
7789
7531
  else {
7790
- validate62.errors = [{ instancePath: instancePath + "/descriptor/projectionScopes", schemaPath: "#/properties/descriptor/properties/projectionScopes/type", keyword: "type", params: { type: "array" }, message: "must be array" }];
7532
+ validate62.errors = [{ instancePath: instancePath + "/descriptor/permissionGrantIds", schemaPath: "#/properties/descriptor/properties/permissionGrantIds/type", keyword: "type", params: { type: "array" }, message: "must be array" }];
7791
7533
  return false;
7792
7534
  }
7793
7535
  }
7794
- var valid12 = _errs46 === errors;
7536
+ var valid8 = _errs34 === errors;
7795
7537
  }
7796
7538
  else {
7797
- var valid12 = true;
7539
+ var valid8 = true;
7798
7540
  }
7799
- if (valid12) {
7800
- if (data1.prefix !== undefined) {
7801
- let data16 = data1.prefix;
7802
- const _errs59 = errors;
7803
- if (errors === _errs59) {
7804
- if (typeof data16 === "string") {
7805
- if (!pattern37.test(data16)) {
7806
- validate62.errors = [{ instancePath: instancePath + "/descriptor/prefix", schemaPath: "#/properties/descriptor/properties/prefix/pattern", keyword: "pattern", params: { pattern: "^[01]*$" }, message: "must match pattern \"" + "^[01]*$" + "\"" }];
7807
- return false;
7541
+ if (valid8) {
7542
+ if (data1.hashes !== undefined) {
7543
+ let data13 = data1.hashes;
7544
+ const _errs38 = errors;
7545
+ if (errors === _errs38) {
7546
+ if (data13 && typeof data13 == "object" && !Array.isArray(data13)) {
7547
+ for (const key2 in data13) {
7548
+ const _errs41 = errors;
7549
+ if (typeof data13[key2] !== "string") {
7550
+ validate62.errors = [{ instancePath: instancePath + "/descriptor/hashes/" + key2.replace(/~/g, "~0").replace(/\//g, "~1"), schemaPath: "#/properties/descriptor/properties/hashes/additionalProperties/type", keyword: "type", params: { type: "string" }, message: "must be string" }];
7551
+ return false;
7552
+ }
7553
+ var valid12 = _errs41 === errors;
7554
+ if (!valid12) {
7555
+ break;
7556
+ }
7808
7557
  }
7809
7558
  }
7810
7559
  else {
7811
- validate62.errors = [{ instancePath: instancePath + "/descriptor/prefix", schemaPath: "#/properties/descriptor/properties/prefix/type", keyword: "type", params: { type: "string" }, message: "must be string" }];
7560
+ validate62.errors = [{ instancePath: instancePath + "/descriptor/hashes", schemaPath: "#/properties/descriptor/properties/hashes/type", keyword: "type", params: { type: "object" }, message: "must be object" }];
7812
7561
  return false;
7813
7562
  }
7814
7563
  }
7815
- var valid12 = _errs59 === errors;
7564
+ var valid8 = _errs38 === errors;
7816
7565
  }
7817
7566
  else {
7818
- var valid12 = true;
7567
+ var valid8 = true;
7819
7568
  }
7820
- if (valid12) {
7821
- if (data1.permissionGrantIds !== undefined) {
7822
- let data17 = data1.permissionGrantIds;
7823
- const _errs61 = errors;
7824
- if (errors === _errs61) {
7825
- if (Array.isArray(data17)) {
7826
- if (data17.length < 1) {
7827
- validate62.errors = [{ instancePath: instancePath + "/descriptor/permissionGrantIds", schemaPath: "#/properties/descriptor/properties/permissionGrantIds/minItems", keyword: "minItems", params: { limit: 1 }, message: "must NOT have fewer than 1 items" }];
7569
+ if (valid8) {
7570
+ if (data1.depth !== undefined) {
7571
+ let data15 = data1.depth;
7572
+ const _errs43 = errors;
7573
+ if (!(((typeof data15 == "number") && (!(data15 % 1) && !isNaN(data15))) && (isFinite(data15)))) {
7574
+ validate62.errors = [{ instancePath: instancePath + "/descriptor/depth", schemaPath: "#/properties/descriptor/properties/depth/type", keyword: "type", params: { type: "integer" }, message: "must be integer" }];
7575
+ return false;
7576
+ }
7577
+ if (errors === _errs43) {
7578
+ if ((typeof data15 == "number") && (isFinite(data15))) {
7579
+ if (data15 > 256 || isNaN(data15)) {
7580
+ validate62.errors = [{ instancePath: instancePath + "/descriptor/depth", schemaPath: "#/properties/descriptor/properties/depth/maximum", keyword: "maximum", params: { comparison: "<=", limit: 256 }, message: "must be <= 256" }];
7828
7581
  return false;
7829
7582
  }
7830
7583
  else {
7831
- var valid17 = true;
7832
- const len1 = data17.length;
7833
- for (let i1 = 0; i1 < len1; i1++) {
7834
- const _errs63 = errors;
7835
- if (typeof data17[i1] !== "string") {
7836
- validate62.errors = [{ instancePath: instancePath + "/descriptor/permissionGrantIds/" + i1, schemaPath: "#/properties/descriptor/properties/permissionGrantIds/items/type", keyword: "type", params: { type: "string" }, message: "must be string" }];
7837
- return false;
7838
- }
7839
- var valid17 = _errs63 === errors;
7840
- if (!valid17) {
7841
- break;
7842
- }
7843
- }
7844
- if (valid17) {
7845
- let i2 = data17.length;
7846
- let j0;
7847
- if (i2 > 1) {
7848
- const indices0 = {};
7849
- for (; i2--;) {
7850
- let item0 = data17[i2];
7851
- if (typeof item0 !== "string") {
7852
- continue;
7853
- }
7854
- if (typeof indices0[item0] == "number") {
7855
- j0 = indices0[item0];
7856
- validate62.errors = [{ instancePath: instancePath + "/descriptor/permissionGrantIds", schemaPath: "#/properties/descriptor/properties/permissionGrantIds/uniqueItems", keyword: "uniqueItems", params: { i: i2, j: j0 }, message: "must NOT have duplicate items (items ## " + j0 + " and " + i2 + " are identical)" }];
7857
- return false;
7858
- break;
7859
- }
7860
- indices0[item0] = i2;
7861
- }
7862
- }
7584
+ if (data15 < 1 || isNaN(data15)) {
7585
+ validate62.errors = [{ instancePath: instancePath + "/descriptor/depth", schemaPath: "#/properties/descriptor/properties/depth/minimum", keyword: "minimum", params: { comparison: ">=", limit: 1 }, message: "must be >= 1" }];
7586
+ return false;
7863
7587
  }
7864
7588
  }
7865
7589
  }
7866
- else {
7867
- validate62.errors = [{ instancePath: instancePath + "/descriptor/permissionGrantIds", schemaPath: "#/properties/descriptor/properties/permissionGrantIds/type", keyword: "type", params: { type: "array" }, message: "must be array" }];
7868
- return false;
7869
- }
7870
7590
  }
7871
- var valid12 = _errs61 === errors;
7591
+ var valid8 = _errs43 === errors;
7872
7592
  }
7873
7593
  else {
7874
- var valid12 = true;
7875
- }
7876
- if (valid12) {
7877
- if (data1.hashes !== undefined) {
7878
- let data19 = data1.hashes;
7879
- const _errs65 = errors;
7880
- if (errors === _errs65) {
7881
- if (data19 && typeof data19 == "object" && !Array.isArray(data19)) {
7882
- for (const key3 in data19) {
7883
- const _errs68 = errors;
7884
- if (typeof data19[key3] !== "string") {
7885
- validate62.errors = [{ instancePath: instancePath + "/descriptor/hashes/" + key3.replace(/~/g, "~0").replace(/\//g, "~1"), schemaPath: "#/properties/descriptor/properties/hashes/additionalProperties/type", keyword: "type", params: { type: "string" }, message: "must be string" }];
7886
- return false;
7887
- }
7888
- var valid19 = _errs68 === errors;
7889
- if (!valid19) {
7890
- break;
7891
- }
7892
- }
7893
- }
7894
- else {
7895
- validate62.errors = [{ instancePath: instancePath + "/descriptor/hashes", schemaPath: "#/properties/descriptor/properties/hashes/type", keyword: "type", params: { type: "object" }, message: "must be object" }];
7896
- return false;
7897
- }
7898
- }
7899
- var valid12 = _errs65 === errors;
7900
- }
7901
- else {
7902
- var valid12 = true;
7903
- }
7904
- if (valid12) {
7905
- if (data1.depth !== undefined) {
7906
- let data21 = data1.depth;
7907
- const _errs70 = errors;
7908
- if (!(((typeof data21 == "number") && (!(data21 % 1) && !isNaN(data21))) && (isFinite(data21)))) {
7909
- validate62.errors = [{ instancePath: instancePath + "/descriptor/depth", schemaPath: "#/properties/descriptor/properties/depth/type", keyword: "type", params: { type: "integer" }, message: "must be integer" }];
7910
- return false;
7911
- }
7912
- if (errors === _errs70) {
7913
- if ((typeof data21 == "number") && (isFinite(data21))) {
7914
- if (data21 > 256 || isNaN(data21)) {
7915
- validate62.errors = [{ instancePath: instancePath + "/descriptor/depth", schemaPath: "#/properties/descriptor/properties/depth/maximum", keyword: "maximum", params: { comparison: "<=", limit: 256 }, message: "must be <= 256" }];
7916
- return false;
7917
- }
7918
- else {
7919
- if (data21 < 1 || isNaN(data21)) {
7920
- validate62.errors = [{ instancePath: instancePath + "/descriptor/depth", schemaPath: "#/properties/descriptor/properties/depth/minimum", keyword: "minimum", params: { comparison: ">=", limit: 1 }, message: "must be >= 1" }];
7921
- return false;
7922
- }
7923
- }
7924
- }
7925
- }
7926
- var valid12 = _errs70 === errors;
7927
- }
7928
- else {
7929
- var valid12 = true;
7930
- }
7931
- }
7594
+ var valid8 = true;
7932
7595
  }
7933
7596
  }
7934
7597
  }