@enbox/dwn-sdk-js 0.4.2 → 0.4.3

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 (37) hide show
  1. package/dist/browser.mjs +3 -3
  2. package/dist/browser.mjs.map +3 -3
  3. package/dist/esm/generated/precompiled-validators.js +1065 -2160
  4. package/dist/esm/generated/precompiled-validators.js.map +1 -1
  5. package/dist/esm/src/core/grant-authorization.js +14 -1
  6. package/dist/esm/src/core/grant-authorization.js.map +1 -1
  7. package/dist/esm/src/types/permission-types.js.map +1 -1
  8. package/dist/esm/tests/core/grant-authorization.spec.js +82 -4
  9. package/dist/esm/tests/core/grant-authorization.spec.js.map +1 -1
  10. package/dist/esm/tests/core/records-grant-authorization.spec.js +22 -5
  11. package/dist/esm/tests/core/records-grant-authorization.spec.js.map +1 -1
  12. package/dist/esm/tests/features/author-delegated-grant.spec.js +134 -10
  13. package/dist/esm/tests/features/author-delegated-grant.spec.js.map +1 -1
  14. package/dist/esm/tests/features/permissions.spec.js +6 -6
  15. package/dist/esm/tests/features/permissions.spec.js.map +1 -1
  16. package/dist/esm/tests/handlers/records-count.spec.js +2 -2
  17. package/dist/esm/tests/handlers/records-count.spec.js.map +1 -1
  18. package/dist/esm/tests/handlers/records-query.spec.js +2 -2
  19. package/dist/esm/tests/handlers/records-query.spec.js.map +1 -1
  20. package/dist/esm/tests/handlers/records-read.spec.js +8 -2
  21. package/dist/esm/tests/handlers/records-read.spec.js.map +1 -1
  22. package/dist/esm/tests/handlers/records-subscribe.spec.js +2 -2
  23. package/dist/esm/tests/handlers/records-subscribe.spec.js.map +1 -1
  24. package/dist/esm/tests/protocols/permission-request.spec.js +4 -4
  25. package/dist/esm/tests/protocols/permission-request.spec.js.map +1 -1
  26. package/dist/esm/tests/protocols/permissions.spec.js +35 -2
  27. package/dist/esm/tests/protocols/permissions.spec.js.map +1 -1
  28. package/dist/types/generated/precompiled-validators.d.ts.map +1 -1
  29. package/dist/types/src/core/grant-authorization.d.ts +2 -1
  30. package/dist/types/src/core/grant-authorization.d.ts.map +1 -1
  31. package/dist/types/src/types/permission-types.d.ts +4 -1
  32. package/dist/types/src/types/permission-types.d.ts.map +1 -1
  33. package/dist/types/tests/features/author-delegated-grant.spec.d.ts.map +1 -1
  34. package/dist/types/tests/handlers/records-read.spec.d.ts.map +1 -1
  35. package/package.json +1 -1
  36. package/src/core/grant-authorization.ts +18 -1
  37. package/src/types/permission-types.ts +4 -1
@@ -7963,17 +7963,14 @@ function validate67(data, { instancePath = "", parentData, parentDataProperty, r
7963
7963
  validate67.evaluated = { "props": true, "dynamicProps": false, "dynamicItems": false };
7964
7964
  export const PermissionGrantData = validate68;
7965
7965
  const schema94 = { "$schema": "https://json-schema.org/draft/2020-12/schema", "$id": "https://identity.foundation/dwn/json-schemas/permission-grant-data.json", "type": "object", "additionalProperties": false, "required": ["dateExpires", "scope"], "properties": { "description": { "type": "string" }, "dateExpires": { "$ref": "https://identity.foundation/dwn/json-schemas/defs.json#/$defs/date-time" }, "requestId": { "type": "string" }, "delegated": { "type": "boolean" }, "scope": { "$ref": "https://identity.foundation/dwn/json-schemas/permissions/defs.json#/$defs/scope" }, "conditions": { "$ref": "https://identity.foundation/dwn/json-schemas/permissions/defs.json#/$defs/conditions" }, "delegateKeyDelivery": { "type": "object", "additionalProperties": false, "required": ["rootKeyId", "publicKeyJwk"], "properties": { "rootKeyId": { "type": "string" }, "publicKeyJwk": { "type": "object" } } } } };
7966
- const schema108 = { "type": "object", "additionalProperties": false, "properties": { "publication": { "enum": ["Required", "Prohibited"], "type": "string" } } };
7967
- const schema97 = { "oneOf": [{ "$ref": "https://identity.foundation/dwn/json-schemas/permissions/scopes.json#/$defs/messages-read-scope" }, { "$ref": "https://identity.foundation/dwn/json-schemas/permissions/scopes.json#/$defs/protocols-configure-scope" }, { "$ref": "https://identity.foundation/dwn/json-schemas/permissions/scopes.json#/$defs/protocols-query-scope" }, { "$ref": "https://identity.foundation/dwn/json-schemas/permissions/scopes.json#/$defs/records-read-scope" }, { "$ref": "https://identity.foundation/dwn/json-schemas/permissions/scopes.json#/$defs/records-delete-scope" }, { "$ref": "https://identity.foundation/dwn/json-schemas/permissions/scopes.json#/$defs/records-write-scope" }, { "$ref": "https://identity.foundation/dwn/json-schemas/permissions/scopes.json#/$defs/records-query-scope" }, { "$ref": "https://identity.foundation/dwn/json-schemas/permissions/scopes.json#/$defs/records-subscribe-scope" }, { "$ref": "https://identity.foundation/dwn/json-schemas/permissions/scopes.json#/$defs/records-count-scope" }] };
7966
+ const schema105 = { "type": "object", "additionalProperties": false, "properties": { "publication": { "enum": ["Required", "Prohibited"], "type": "string" } } };
7967
+ const schema97 = { "oneOf": [{ "$ref": "https://identity.foundation/dwn/json-schemas/permissions/scopes.json#/$defs/messages-read-scope" }, { "$ref": "https://identity.foundation/dwn/json-schemas/permissions/scopes.json#/$defs/protocols-configure-scope" }, { "$ref": "https://identity.foundation/dwn/json-schemas/permissions/scopes.json#/$defs/protocols-query-scope" }, { "$ref": "https://identity.foundation/dwn/json-schemas/permissions/scopes.json#/$defs/records-read-scope" }, { "$ref": "https://identity.foundation/dwn/json-schemas/permissions/scopes.json#/$defs/records-delete-scope" }, { "$ref": "https://identity.foundation/dwn/json-schemas/permissions/scopes.json#/$defs/records-write-scope" }] };
7968
7968
  const schema99 = { "type": "object", "additionalProperties": false, "required": ["interface", "method"], "properties": { "interface": { "const": "Messages" }, "method": { "const": "Read" }, "protocol": { "type": "string" }, "contextId": { "type": "string", "maxLength": 600 }, "protocolPath": { "type": "string", "maxLength": 600 } }, "allOf": [{ "not": { "required": ["contextId", "protocolPath"] } }, { "if": { "anyOf": [{ "required": ["contextId"] }, { "required": ["protocolPath"] }] }, "then": { "required": ["protocol"] } }] };
7969
7969
  const schema100 = { "type": "object", "additionalProperties": false, "required": ["interface", "method"], "properties": { "interface": { "const": "Protocols" }, "method": { "const": "Configure" }, "protocol": { "type": "string" } } };
7970
7970
  const schema101 = { "type": "object", "additionalProperties": false, "required": ["interface", "method"], "properties": { "interface": { "const": "Protocols" }, "method": { "const": "Query" }, "protocol": { "type": "string" } } };
7971
7971
  const schema102 = { "type": "object", "additionalProperties": false, "required": ["interface", "method", "protocol"], "properties": { "interface": { "const": "Records" }, "method": { "const": "Read" }, "protocol": { "type": "string" }, "contextId": { "type": "string", "maxLength": 600 }, "protocolPath": { "type": "string", "maxLength": 600 } } };
7972
7972
  const schema103 = { "type": "object", "additionalProperties": false, "required": ["interface", "method", "protocol"], "properties": { "interface": { "const": "Records" }, "method": { "const": "Delete" }, "protocol": { "type": "string" }, "contextId": { "type": "string", "maxLength": 600 }, "protocolPath": { "type": "string", "maxLength": 600 } } };
7973
7973
  const schema104 = { "type": "object", "additionalProperties": false, "required": ["interface", "method", "protocol"], "properties": { "interface": { "const": "Records" }, "method": { "const": "Write" }, "protocol": { "type": "string" }, "contextId": { "type": "string", "maxLength": 600 }, "protocolPath": { "type": "string", "maxLength": 600 } } };
7974
- const schema105 = { "type": "object", "additionalProperties": false, "required": ["interface", "method", "protocol"], "properties": { "interface": { "const": "Records" }, "method": { "const": "Query" }, "protocol": { "type": "string" }, "contextId": { "type": "string", "maxLength": 600 }, "protocolPath": { "type": "string", "maxLength": 600 } } };
7975
- const schema106 = { "type": "object", "additionalProperties": false, "required": ["interface", "method", "protocol"], "properties": { "interface": { "const": "Records" }, "method": { "const": "Subscribe" }, "protocol": { "type": "string" }, "contextId": { "type": "string", "maxLength": 600 }, "protocolPath": { "type": "string", "maxLength": 600 } } };
7976
- const schema107 = { "type": "object", "additionalProperties": false, "required": ["interface", "method", "protocol"], "properties": { "interface": { "const": "Records" }, "method": { "const": "Count" }, "protocol": { "type": "string" }, "contextId": { "type": "string", "maxLength": 600 }, "protocolPath": { "type": "string", "maxLength": 600 } } };
7977
7974
  function validate70(data, { instancePath = "", parentData, parentDataProperty, rootData = data, dynamicAnchors = {} } = {}) { let vErrors = null; let errors = 0; const evaluated0 = validate70.evaluated; if (evaluated0.dynamicProps) {
7978
7975
  evaluated0.props = undefined;
7979
7976
  } if (evaluated0.dynamicItems) {
@@ -9043,816 +9040,270 @@ else {
9043
9040
  props0 = true;
9044
9041
  }
9045
9042
  }
9046
- const _errs75 = errors;
9047
- const _errs76 = errors;
9048
- if (errors === _errs76) {
9049
- if (data && typeof data == "object" && !Array.isArray(data)) {
9050
- let missing10;
9051
- if ((((data.interface === undefined) && (missing10 = "interface")) || ((data.method === undefined) && (missing10 = "method"))) || ((data.protocol === undefined) && (missing10 = "protocol"))) {
9052
- const err59 = { instancePath, schemaPath: "https://identity.foundation/dwn/json-schemas/permissions/scopes.json#/$defs/records-query-scope/required", keyword: "required", params: { missingProperty: missing10 }, message: "must have required property '" + missing10 + "'" };
9053
- if (vErrors === null) {
9054
- vErrors = [err59];
9043
+ }
9044
+ }
9045
+ }
9046
+ }
9047
+ } if (!valid0) {
9048
+ const err59 = { instancePath, schemaPath: "#/oneOf", keyword: "oneOf", params: { passingSchemas: passing0 }, message: "must match exactly one schema in oneOf" };
9049
+ if (vErrors === null) {
9050
+ vErrors = [err59];
9051
+ }
9052
+ else {
9053
+ vErrors.push(err59);
9054
+ }
9055
+ errors++;
9056
+ validate70.errors = vErrors;
9057
+ return false;
9058
+ }
9059
+ else {
9060
+ errors = _errs0;
9061
+ if (vErrors !== null) {
9062
+ if (_errs0) {
9063
+ vErrors.length = _errs0;
9064
+ }
9065
+ else {
9066
+ vErrors = null;
9067
+ }
9068
+ }
9069
+ } validate70.errors = vErrors; evaluated0.props = props0; return errors === 0; }
9070
+ validate70.evaluated = { "dynamicProps": true, "dynamicItems": false };
9071
+ function validate68(data, { instancePath = "", parentData, parentDataProperty, rootData = data, dynamicAnchors = {} } = {}) { /*# sourceURL="https://identity.foundation/dwn/json-schemas/permission-grant-data.json" */ ; let vErrors = null; let errors = 0; const evaluated0 = validate68.evaluated; if (evaluated0.dynamicProps) {
9072
+ evaluated0.props = undefined;
9073
+ } if (evaluated0.dynamicItems) {
9074
+ evaluated0.items = undefined;
9075
+ } if (errors === 0) {
9076
+ if (data && typeof data == "object" && !Array.isArray(data)) {
9077
+ let missing0;
9078
+ if (((data.dateExpires === undefined) && (missing0 = "dateExpires")) || ((data.scope === undefined) && (missing0 = "scope"))) {
9079
+ validate68.errors = [{ instancePath, schemaPath: "#/required", keyword: "required", params: { missingProperty: missing0 }, message: "must have required property '" + missing0 + "'" }];
9080
+ return false;
9081
+ }
9082
+ else {
9083
+ const _errs1 = errors;
9084
+ for (const key0 in data) {
9085
+ if (!(((((((key0 === "description") || (key0 === "dateExpires")) || (key0 === "requestId")) || (key0 === "delegated")) || (key0 === "scope")) || (key0 === "conditions")) || (key0 === "delegateKeyDelivery"))) {
9086
+ validate68.errors = [{ instancePath, schemaPath: "#/additionalProperties", keyword: "additionalProperties", params: { additionalProperty: key0 }, message: "must NOT have additional properties" }];
9087
+ return false;
9088
+ break;
9089
+ }
9090
+ }
9091
+ if (_errs1 === errors) {
9092
+ if (data.description !== undefined) {
9093
+ const _errs2 = errors;
9094
+ if (typeof data.description !== "string") {
9095
+ validate68.errors = [{ instancePath: instancePath + "/description", schemaPath: "#/properties/description/type", keyword: "type", params: { type: "string" }, message: "must be string" }];
9096
+ return false;
9097
+ }
9098
+ var valid0 = _errs2 === errors;
9099
+ }
9100
+ else {
9101
+ var valid0 = true;
9102
+ }
9103
+ if (valid0) {
9104
+ if (data.dateExpires !== undefined) {
9105
+ let data1 = data.dateExpires;
9106
+ const _errs4 = errors;
9107
+ const _errs5 = errors;
9108
+ if (errors === _errs5) {
9109
+ if (typeof data1 === "string") {
9110
+ if (!pattern14.test(data1)) {
9111
+ validate68.errors = [{ instancePath: instancePath + "/dateExpires", 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$" + "\"" }];
9112
+ return false;
9055
9113
  }
9056
- else {
9057
- vErrors.push(err59);
9114
+ }
9115
+ else {
9116
+ validate68.errors = [{ instancePath: instancePath + "/dateExpires", schemaPath: "https://identity.foundation/dwn/json-schemas/defs.json#/$defs/date-time/type", keyword: "type", params: { type: "string" }, message: "must be string" }];
9117
+ return false;
9118
+ }
9119
+ }
9120
+ var valid0 = _errs4 === errors;
9121
+ }
9122
+ else {
9123
+ var valid0 = true;
9124
+ }
9125
+ if (valid0) {
9126
+ if (data.requestId !== undefined) {
9127
+ const _errs7 = errors;
9128
+ if (typeof data.requestId !== "string") {
9129
+ validate68.errors = [{ instancePath: instancePath + "/requestId", schemaPath: "#/properties/requestId/type", keyword: "type", params: { type: "string" }, message: "must be string" }];
9130
+ return false;
9131
+ }
9132
+ var valid0 = _errs7 === errors;
9133
+ }
9134
+ else {
9135
+ var valid0 = true;
9136
+ }
9137
+ if (valid0) {
9138
+ if (data.delegated !== undefined) {
9139
+ const _errs9 = errors;
9140
+ if (typeof data.delegated !== "boolean") {
9141
+ validate68.errors = [{ instancePath: instancePath + "/delegated", schemaPath: "#/properties/delegated/type", keyword: "type", params: { type: "boolean" }, message: "must be boolean" }];
9142
+ return false;
9058
9143
  }
9059
- errors++;
9144
+ var valid0 = _errs9 === errors;
9060
9145
  }
9061
9146
  else {
9062
- const _errs78 = errors;
9063
- for (const key6 in data) {
9064
- if (!(((((key6 === "interface") || (key6 === "method")) || (key6 === "protocol")) || (key6 === "contextId")) || (key6 === "protocolPath"))) {
9065
- const err60 = { instancePath, schemaPath: "https://identity.foundation/dwn/json-schemas/permissions/scopes.json#/$defs/records-query-scope/additionalProperties", keyword: "additionalProperties", params: { additionalProperty: key6 }, message: "must NOT have additional properties" };
9066
- if (vErrors === null) {
9067
- vErrors = [err60];
9068
- }
9069
- else {
9070
- vErrors.push(err60);
9071
- }
9072
- errors++;
9073
- break;
9147
+ var valid0 = true;
9148
+ }
9149
+ if (valid0) {
9150
+ if (data.scope !== undefined) {
9151
+ const _errs11 = errors;
9152
+ if (!(validate70(data.scope, { instancePath: instancePath + "/scope", parentData: data, parentDataProperty: "scope", rootData, dynamicAnchors }))) {
9153
+ vErrors = vErrors === null ? validate70.errors : vErrors.concat(validate70.errors);
9154
+ errors = vErrors.length;
9074
9155
  }
9156
+ var valid0 = _errs11 === errors;
9075
9157
  }
9076
- if (_errs78 === errors) {
9077
- if (data.interface !== undefined) {
9078
- const _errs79 = errors;
9079
- if ("Records" !== data.interface) {
9080
- const err61 = { instancePath: instancePath + "/interface", schemaPath: "https://identity.foundation/dwn/json-schemas/permissions/scopes.json#/$defs/records-query-scope/properties/interface/const", keyword: "const", params: { allowedValue: "Records" }, message: "must be equal to constant" };
9081
- if (vErrors === null) {
9082
- vErrors = [err61];
9158
+ else {
9159
+ var valid0 = true;
9160
+ }
9161
+ if (valid0) {
9162
+ if (data.conditions !== undefined) {
9163
+ let data5 = data.conditions;
9164
+ const _errs12 = errors;
9165
+ const _errs13 = errors;
9166
+ if (errors === _errs13) {
9167
+ if (data5 && typeof data5 == "object" && !Array.isArray(data5)) {
9168
+ const _errs15 = errors;
9169
+ for (const key1 in data5) {
9170
+ if (!(key1 === "publication")) {
9171
+ validate68.errors = [{ instancePath: instancePath + "/conditions", schemaPath: "https://identity.foundation/dwn/json-schemas/permissions/defs.json#/$defs/conditions/additionalProperties", keyword: "additionalProperties", params: { additionalProperty: key1 }, message: "must NOT have additional properties" }];
9172
+ return false;
9173
+ break;
9174
+ }
9175
+ }
9176
+ if (_errs15 === errors) {
9177
+ if (data5.publication !== undefined) {
9178
+ let data6 = data5.publication;
9179
+ if (typeof data6 !== "string") {
9180
+ validate68.errors = [{ instancePath: instancePath + "/conditions/publication", schemaPath: "https://identity.foundation/dwn/json-schemas/permissions/defs.json#/$defs/conditions/properties/publication/type", keyword: "type", params: { type: "string" }, message: "must be string" }];
9181
+ return false;
9182
+ }
9183
+ if (!((data6 === "Required") || (data6 === "Prohibited"))) {
9184
+ validate68.errors = [{ instancePath: instancePath + "/conditions/publication", schemaPath: "https://identity.foundation/dwn/json-schemas/permissions/defs.json#/$defs/conditions/properties/publication/enum", keyword: "enum", params: { allowedValues: schema105.properties.publication.enum }, message: "must be equal to one of the allowed values" }];
9185
+ return false;
9186
+ }
9187
+ }
9188
+ }
9083
9189
  }
9084
9190
  else {
9085
- vErrors.push(err61);
9191
+ validate68.errors = [{ instancePath: instancePath + "/conditions", schemaPath: "https://identity.foundation/dwn/json-schemas/permissions/defs.json#/$defs/conditions/type", keyword: "type", params: { type: "object" }, message: "must be object" }];
9192
+ return false;
9086
9193
  }
9087
- errors++;
9088
9194
  }
9089
- var valid18 = _errs79 === errors;
9195
+ var valid0 = _errs12 === errors;
9090
9196
  }
9091
9197
  else {
9092
- var valid18 = true;
9198
+ var valid0 = true;
9093
9199
  }
9094
- if (valid18) {
9095
- if (data.method !== undefined) {
9096
- const _errs80 = errors;
9097
- if ("Query" !== data.method) {
9098
- const err62 = { instancePath: instancePath + "/method", schemaPath: "https://identity.foundation/dwn/json-schemas/permissions/scopes.json#/$defs/records-query-scope/properties/method/const", keyword: "const", params: { allowedValue: "Query" }, message: "must be equal to constant" };
9099
- if (vErrors === null) {
9100
- vErrors = [err62];
9101
- }
9102
- else {
9103
- vErrors.push(err62);
9104
- }
9105
- errors++;
9106
- }
9107
- var valid18 = _errs80 === errors;
9108
- }
9109
- else {
9110
- var valid18 = true;
9111
- }
9112
- if (valid18) {
9113
- if (data.protocol !== undefined) {
9114
- const _errs81 = errors;
9115
- if (typeof data.protocol !== "string") {
9116
- const err63 = { instancePath: instancePath + "/protocol", schemaPath: "https://identity.foundation/dwn/json-schemas/permissions/scopes.json#/$defs/records-query-scope/properties/protocol/type", keyword: "type", params: { type: "string" }, message: "must be string" };
9117
- if (vErrors === null) {
9118
- vErrors = [err63];
9200
+ if (valid0) {
9201
+ if (data.delegateKeyDelivery !== undefined) {
9202
+ let data7 = data.delegateKeyDelivery;
9203
+ const _errs18 = errors;
9204
+ if (errors === _errs18) {
9205
+ if (data7 && typeof data7 == "object" && !Array.isArray(data7)) {
9206
+ let missing1;
9207
+ if (((data7.rootKeyId === undefined) && (missing1 = "rootKeyId")) || ((data7.publicKeyJwk === undefined) && (missing1 = "publicKeyJwk"))) {
9208
+ validate68.errors = [{ instancePath: instancePath + "/delegateKeyDelivery", schemaPath: "#/properties/delegateKeyDelivery/required", keyword: "required", params: { missingProperty: missing1 }, message: "must have required property '" + missing1 + "'" }];
9209
+ return false;
9119
9210
  }
9120
9211
  else {
9121
- vErrors.push(err63);
9122
- }
9123
- errors++;
9124
- }
9125
- var valid18 = _errs81 === errors;
9126
- }
9127
- else {
9128
- var valid18 = true;
9129
- }
9130
- if (valid18) {
9131
- if (data.contextId !== undefined) {
9132
- let data29 = data.contextId;
9133
- const _errs83 = errors;
9134
- if (errors === _errs83) {
9135
- if (typeof data29 === "string") {
9136
- if (func1(data29) > 600) {
9137
- const err64 = { instancePath: instancePath + "/contextId", schemaPath: "https://identity.foundation/dwn/json-schemas/permissions/scopes.json#/$defs/records-query-scope/properties/contextId/maxLength", keyword: "maxLength", params: { limit: 600 }, message: "must NOT have more than 600 characters" };
9138
- if (vErrors === null) {
9139
- vErrors = [err64];
9140
- }
9141
- else {
9142
- vErrors.push(err64);
9143
- }
9144
- errors++;
9212
+ const _errs20 = errors;
9213
+ for (const key2 in data7) {
9214
+ if (!((key2 === "rootKeyId") || (key2 === "publicKeyJwk"))) {
9215
+ validate68.errors = [{ instancePath: instancePath + "/delegateKeyDelivery", schemaPath: "#/properties/delegateKeyDelivery/additionalProperties", keyword: "additionalProperties", params: { additionalProperty: key2 }, message: "must NOT have additional properties" }];
9216
+ return false;
9217
+ break;
9145
9218
  }
9146
9219
  }
9147
- else {
9148
- const err65 = { instancePath: instancePath + "/contextId", schemaPath: "https://identity.foundation/dwn/json-schemas/permissions/scopes.json#/$defs/records-query-scope/properties/contextId/type", keyword: "type", params: { type: "string" }, message: "must be string" };
9149
- if (vErrors === null) {
9150
- vErrors = [err65];
9220
+ if (_errs20 === errors) {
9221
+ if (data7.rootKeyId !== undefined) {
9222
+ const _errs21 = errors;
9223
+ if (typeof data7.rootKeyId !== "string") {
9224
+ validate68.errors = [{ instancePath: instancePath + "/delegateKeyDelivery/rootKeyId", schemaPath: "#/properties/delegateKeyDelivery/properties/rootKeyId/type", keyword: "type", params: { type: "string" }, message: "must be string" }];
9225
+ return false;
9226
+ }
9227
+ var valid4 = _errs21 === errors;
9151
9228
  }
9152
9229
  else {
9153
- vErrors.push(err65);
9230
+ var valid4 = true;
9154
9231
  }
9155
- errors++;
9156
- }
9157
- }
9158
- var valid18 = _errs83 === errors;
9159
- }
9160
- else {
9161
- var valid18 = true;
9162
- }
9163
- if (valid18) {
9164
- if (data.protocolPath !== undefined) {
9165
- let data30 = data.protocolPath;
9166
- const _errs85 = errors;
9167
- if (errors === _errs85) {
9168
- if (typeof data30 === "string") {
9169
- if (func1(data30) > 600) {
9170
- const err66 = { instancePath: instancePath + "/protocolPath", schemaPath: "https://identity.foundation/dwn/json-schemas/permissions/scopes.json#/$defs/records-query-scope/properties/protocolPath/maxLength", keyword: "maxLength", params: { limit: 600 }, message: "must NOT have more than 600 characters" };
9171
- if (vErrors === null) {
9172
- vErrors = [err66];
9173
- }
9174
- else {
9175
- vErrors.push(err66);
9232
+ if (valid4) {
9233
+ if (data7.publicKeyJwk !== undefined) {
9234
+ let data9 = data7.publicKeyJwk;
9235
+ const _errs23 = errors;
9236
+ if (!(data9 && typeof data9 == "object" && !Array.isArray(data9))) {
9237
+ validate68.errors = [{ instancePath: instancePath + "/delegateKeyDelivery/publicKeyJwk", schemaPath: "#/properties/delegateKeyDelivery/properties/publicKeyJwk/type", keyword: "type", params: { type: "object" }, message: "must be object" }];
9238
+ return false;
9176
9239
  }
9177
- errors++;
9178
- }
9179
- }
9180
- else {
9181
- const err67 = { instancePath: instancePath + "/protocolPath", schemaPath: "https://identity.foundation/dwn/json-schemas/permissions/scopes.json#/$defs/records-query-scope/properties/protocolPath/type", keyword: "type", params: { type: "string" }, message: "must be string" };
9182
- if (vErrors === null) {
9183
- vErrors = [err67];
9240
+ var valid4 = _errs23 === errors;
9184
9241
  }
9185
9242
  else {
9186
- vErrors.push(err67);
9243
+ var valid4 = true;
9187
9244
  }
9188
- errors++;
9189
9245
  }
9190
9246
  }
9191
- var valid18 = _errs85 === errors;
9192
- }
9193
- else {
9194
- var valid18 = true;
9195
9247
  }
9196
9248
  }
9249
+ else {
9250
+ validate68.errors = [{ instancePath: instancePath + "/delegateKeyDelivery", schemaPath: "#/properties/delegateKeyDelivery/type", keyword: "type", params: { type: "object" }, message: "must be object" }];
9251
+ return false;
9252
+ }
9197
9253
  }
9254
+ var valid0 = _errs18 === errors;
9255
+ }
9256
+ else {
9257
+ var valid0 = true;
9198
9258
  }
9199
9259
  }
9200
9260
  }
9201
9261
  }
9202
9262
  }
9203
- else {
9204
- const err68 = { instancePath, schemaPath: "https://identity.foundation/dwn/json-schemas/permissions/scopes.json#/$defs/records-query-scope/type", keyword: "type", params: { type: "object" }, message: "must be object" };
9205
- if (vErrors === null) {
9206
- vErrors = [err68];
9207
- }
9208
- else {
9209
- vErrors.push(err68);
9210
- }
9211
- errors++;
9212
- }
9213
- }
9214
- var _valid0 = _errs75 === errors;
9215
- if (_valid0 && valid0) {
9216
- valid0 = false;
9217
- passing0 = [passing0, 6];
9218
- }
9219
- else {
9220
- if (_valid0) {
9221
- valid0 = true;
9222
- passing0 = 6;
9223
- if (props0 !== true) {
9224
- props0 = true;
9225
- }
9226
- }
9227
- const _errs87 = errors;
9228
- const _errs88 = errors;
9229
- if (errors === _errs88) {
9230
- if (data && typeof data == "object" && !Array.isArray(data)) {
9231
- let missing11;
9232
- if ((((data.interface === undefined) && (missing11 = "interface")) || ((data.method === undefined) && (missing11 = "method"))) || ((data.protocol === undefined) && (missing11 = "protocol"))) {
9233
- const err69 = { instancePath, schemaPath: "https://identity.foundation/dwn/json-schemas/permissions/scopes.json#/$defs/records-subscribe-scope/required", keyword: "required", params: { missingProperty: missing11 }, message: "must have required property '" + missing11 + "'" };
9234
- if (vErrors === null) {
9235
- vErrors = [err69];
9236
- }
9237
- else {
9238
- vErrors.push(err69);
9239
- }
9240
- errors++;
9241
- }
9242
- else {
9243
- const _errs90 = errors;
9244
- for (const key7 in data) {
9245
- if (!(((((key7 === "interface") || (key7 === "method")) || (key7 === "protocol")) || (key7 === "contextId")) || (key7 === "protocolPath"))) {
9246
- const err70 = { instancePath, schemaPath: "https://identity.foundation/dwn/json-schemas/permissions/scopes.json#/$defs/records-subscribe-scope/additionalProperties", keyword: "additionalProperties", params: { additionalProperty: key7 }, message: "must NOT have additional properties" };
9247
- if (vErrors === null) {
9248
- vErrors = [err70];
9249
- }
9250
- else {
9251
- vErrors.push(err70);
9252
- }
9253
- errors++;
9254
- break;
9255
- }
9256
- }
9257
- if (_errs90 === errors) {
9258
- if (data.interface !== undefined) {
9259
- const _errs91 = errors;
9260
- if ("Records" !== data.interface) {
9261
- const err71 = { instancePath: instancePath + "/interface", schemaPath: "https://identity.foundation/dwn/json-schemas/permissions/scopes.json#/$defs/records-subscribe-scope/properties/interface/const", keyword: "const", params: { allowedValue: "Records" }, message: "must be equal to constant" };
9262
- if (vErrors === null) {
9263
- vErrors = [err71];
9264
- }
9265
- else {
9266
- vErrors.push(err71);
9267
- }
9268
- errors++;
9269
- }
9270
- var valid20 = _errs91 === errors;
9271
- }
9272
- else {
9273
- var valid20 = true;
9274
- }
9275
- if (valid20) {
9276
- if (data.method !== undefined) {
9277
- const _errs92 = errors;
9278
- if ("Subscribe" !== data.method) {
9279
- const err72 = { instancePath: instancePath + "/method", schemaPath: "https://identity.foundation/dwn/json-schemas/permissions/scopes.json#/$defs/records-subscribe-scope/properties/method/const", keyword: "const", params: { allowedValue: "Subscribe" }, message: "must be equal to constant" };
9280
- if (vErrors === null) {
9281
- vErrors = [err72];
9282
- }
9283
- else {
9284
- vErrors.push(err72);
9285
- }
9286
- errors++;
9287
- }
9288
- var valid20 = _errs92 === errors;
9289
- }
9290
- else {
9291
- var valid20 = true;
9292
- }
9293
- if (valid20) {
9294
- if (data.protocol !== undefined) {
9295
- const _errs93 = errors;
9296
- if (typeof data.protocol !== "string") {
9297
- const err73 = { instancePath: instancePath + "/protocol", schemaPath: "https://identity.foundation/dwn/json-schemas/permissions/scopes.json#/$defs/records-subscribe-scope/properties/protocol/type", keyword: "type", params: { type: "string" }, message: "must be string" };
9298
- if (vErrors === null) {
9299
- vErrors = [err73];
9300
- }
9301
- else {
9302
- vErrors.push(err73);
9303
- }
9304
- errors++;
9305
- }
9306
- var valid20 = _errs93 === errors;
9307
- }
9308
- else {
9309
- var valid20 = true;
9310
- }
9311
- if (valid20) {
9312
- if (data.contextId !== undefined) {
9313
- let data34 = data.contextId;
9314
- const _errs95 = errors;
9315
- if (errors === _errs95) {
9316
- if (typeof data34 === "string") {
9317
- if (func1(data34) > 600) {
9318
- const err74 = { instancePath: instancePath + "/contextId", schemaPath: "https://identity.foundation/dwn/json-schemas/permissions/scopes.json#/$defs/records-subscribe-scope/properties/contextId/maxLength", keyword: "maxLength", params: { limit: 600 }, message: "must NOT have more than 600 characters" };
9319
- if (vErrors === null) {
9320
- vErrors = [err74];
9321
- }
9322
- else {
9323
- vErrors.push(err74);
9324
- }
9325
- errors++;
9326
- }
9327
- }
9328
- else {
9329
- const err75 = { instancePath: instancePath + "/contextId", schemaPath: "https://identity.foundation/dwn/json-schemas/permissions/scopes.json#/$defs/records-subscribe-scope/properties/contextId/type", keyword: "type", params: { type: "string" }, message: "must be string" };
9330
- if (vErrors === null) {
9331
- vErrors = [err75];
9332
- }
9333
- else {
9334
- vErrors.push(err75);
9335
- }
9336
- errors++;
9337
- }
9338
- }
9339
- var valid20 = _errs95 === errors;
9340
- }
9341
- else {
9342
- var valid20 = true;
9343
- }
9344
- if (valid20) {
9345
- if (data.protocolPath !== undefined) {
9346
- let data35 = data.protocolPath;
9347
- const _errs97 = errors;
9348
- if (errors === _errs97) {
9349
- if (typeof data35 === "string") {
9350
- if (func1(data35) > 600) {
9351
- const err76 = { instancePath: instancePath + "/protocolPath", schemaPath: "https://identity.foundation/dwn/json-schemas/permissions/scopes.json#/$defs/records-subscribe-scope/properties/protocolPath/maxLength", keyword: "maxLength", params: { limit: 600 }, message: "must NOT have more than 600 characters" };
9352
- if (vErrors === null) {
9353
- vErrors = [err76];
9354
- }
9355
- else {
9356
- vErrors.push(err76);
9357
- }
9358
- errors++;
9359
- }
9360
- }
9361
- else {
9362
- const err77 = { instancePath: instancePath + "/protocolPath", schemaPath: "https://identity.foundation/dwn/json-schemas/permissions/scopes.json#/$defs/records-subscribe-scope/properties/protocolPath/type", keyword: "type", params: { type: "string" }, message: "must be string" };
9363
- if (vErrors === null) {
9364
- vErrors = [err77];
9365
- }
9366
- else {
9367
- vErrors.push(err77);
9368
- }
9369
- errors++;
9370
- }
9371
- }
9372
- var valid20 = _errs97 === errors;
9373
- }
9374
- else {
9375
- var valid20 = true;
9376
- }
9377
- }
9378
- }
9379
- }
9380
- }
9381
- }
9382
- }
9383
- }
9384
- else {
9385
- const err78 = { instancePath, schemaPath: "https://identity.foundation/dwn/json-schemas/permissions/scopes.json#/$defs/records-subscribe-scope/type", keyword: "type", params: { type: "object" }, message: "must be object" };
9386
- if (vErrors === null) {
9387
- vErrors = [err78];
9388
- }
9389
- else {
9390
- vErrors.push(err78);
9391
- }
9392
- errors++;
9393
- }
9394
- }
9395
- var _valid0 = _errs87 === errors;
9396
- if (_valid0 && valid0) {
9397
- valid0 = false;
9398
- passing0 = [passing0, 7];
9399
- }
9400
- else {
9401
- if (_valid0) {
9402
- valid0 = true;
9403
- passing0 = 7;
9404
- if (props0 !== true) {
9405
- props0 = true;
9406
- }
9407
- }
9408
- const _errs99 = errors;
9409
- const _errs100 = errors;
9410
- if (errors === _errs100) {
9411
- if (data && typeof data == "object" && !Array.isArray(data)) {
9412
- let missing12;
9413
- if ((((data.interface === undefined) && (missing12 = "interface")) || ((data.method === undefined) && (missing12 = "method"))) || ((data.protocol === undefined) && (missing12 = "protocol"))) {
9414
- const err79 = { instancePath, schemaPath: "https://identity.foundation/dwn/json-schemas/permissions/scopes.json#/$defs/records-count-scope/required", keyword: "required", params: { missingProperty: missing12 }, message: "must have required property '" + missing12 + "'" };
9415
- if (vErrors === null) {
9416
- vErrors = [err79];
9417
- }
9418
- else {
9419
- vErrors.push(err79);
9420
- }
9421
- errors++;
9422
- }
9423
- else {
9424
- const _errs102 = errors;
9425
- for (const key8 in data) {
9426
- if (!(((((key8 === "interface") || (key8 === "method")) || (key8 === "protocol")) || (key8 === "contextId")) || (key8 === "protocolPath"))) {
9427
- const err80 = { instancePath, schemaPath: "https://identity.foundation/dwn/json-schemas/permissions/scopes.json#/$defs/records-count-scope/additionalProperties", keyword: "additionalProperties", params: { additionalProperty: key8 }, message: "must NOT have additional properties" };
9428
- if (vErrors === null) {
9429
- vErrors = [err80];
9430
- }
9431
- else {
9432
- vErrors.push(err80);
9433
- }
9434
- errors++;
9435
- break;
9436
- }
9437
- }
9438
- if (_errs102 === errors) {
9439
- if (data.interface !== undefined) {
9440
- const _errs103 = errors;
9441
- if ("Records" !== data.interface) {
9442
- const err81 = { instancePath: instancePath + "/interface", schemaPath: "https://identity.foundation/dwn/json-schemas/permissions/scopes.json#/$defs/records-count-scope/properties/interface/const", keyword: "const", params: { allowedValue: "Records" }, message: "must be equal to constant" };
9443
- if (vErrors === null) {
9444
- vErrors = [err81];
9445
- }
9446
- else {
9447
- vErrors.push(err81);
9448
- }
9449
- errors++;
9450
- }
9451
- var valid22 = _errs103 === errors;
9452
- }
9453
- else {
9454
- var valid22 = true;
9455
- }
9456
- if (valid22) {
9457
- if (data.method !== undefined) {
9458
- const _errs104 = errors;
9459
- if ("Count" !== data.method) {
9460
- const err82 = { instancePath: instancePath + "/method", schemaPath: "https://identity.foundation/dwn/json-schemas/permissions/scopes.json#/$defs/records-count-scope/properties/method/const", keyword: "const", params: { allowedValue: "Count" }, message: "must be equal to constant" };
9461
- if (vErrors === null) {
9462
- vErrors = [err82];
9463
- }
9464
- else {
9465
- vErrors.push(err82);
9466
- }
9467
- errors++;
9468
- }
9469
- var valid22 = _errs104 === errors;
9470
- }
9471
- else {
9472
- var valid22 = true;
9473
- }
9474
- if (valid22) {
9475
- if (data.protocol !== undefined) {
9476
- const _errs105 = errors;
9477
- if (typeof data.protocol !== "string") {
9478
- const err83 = { instancePath: instancePath + "/protocol", schemaPath: "https://identity.foundation/dwn/json-schemas/permissions/scopes.json#/$defs/records-count-scope/properties/protocol/type", keyword: "type", params: { type: "string" }, message: "must be string" };
9479
- if (vErrors === null) {
9480
- vErrors = [err83];
9481
- }
9482
- else {
9483
- vErrors.push(err83);
9484
- }
9485
- errors++;
9486
- }
9487
- var valid22 = _errs105 === errors;
9488
- }
9489
- else {
9490
- var valid22 = true;
9491
- }
9492
- if (valid22) {
9493
- if (data.contextId !== undefined) {
9494
- let data39 = data.contextId;
9495
- const _errs107 = errors;
9496
- if (errors === _errs107) {
9497
- if (typeof data39 === "string") {
9498
- if (func1(data39) > 600) {
9499
- const err84 = { instancePath: instancePath + "/contextId", schemaPath: "https://identity.foundation/dwn/json-schemas/permissions/scopes.json#/$defs/records-count-scope/properties/contextId/maxLength", keyword: "maxLength", params: { limit: 600 }, message: "must NOT have more than 600 characters" };
9500
- if (vErrors === null) {
9501
- vErrors = [err84];
9502
- }
9503
- else {
9504
- vErrors.push(err84);
9505
- }
9506
- errors++;
9507
- }
9508
- }
9509
- else {
9510
- const err85 = { instancePath: instancePath + "/contextId", schemaPath: "https://identity.foundation/dwn/json-schemas/permissions/scopes.json#/$defs/records-count-scope/properties/contextId/type", keyword: "type", params: { type: "string" }, message: "must be string" };
9511
- if (vErrors === null) {
9512
- vErrors = [err85];
9513
- }
9514
- else {
9515
- vErrors.push(err85);
9516
- }
9517
- errors++;
9518
- }
9519
- }
9520
- var valid22 = _errs107 === errors;
9521
- }
9522
- else {
9523
- var valid22 = true;
9524
- }
9525
- if (valid22) {
9526
- if (data.protocolPath !== undefined) {
9527
- let data40 = data.protocolPath;
9528
- const _errs109 = errors;
9529
- if (errors === _errs109) {
9530
- if (typeof data40 === "string") {
9531
- if (func1(data40) > 600) {
9532
- const err86 = { instancePath: instancePath + "/protocolPath", schemaPath: "https://identity.foundation/dwn/json-schemas/permissions/scopes.json#/$defs/records-count-scope/properties/protocolPath/maxLength", keyword: "maxLength", params: { limit: 600 }, message: "must NOT have more than 600 characters" };
9533
- if (vErrors === null) {
9534
- vErrors = [err86];
9535
- }
9536
- else {
9537
- vErrors.push(err86);
9538
- }
9539
- errors++;
9540
- }
9541
- }
9542
- else {
9543
- const err87 = { instancePath: instancePath + "/protocolPath", schemaPath: "https://identity.foundation/dwn/json-schemas/permissions/scopes.json#/$defs/records-count-scope/properties/protocolPath/type", keyword: "type", params: { type: "string" }, message: "must be string" };
9544
- if (vErrors === null) {
9545
- vErrors = [err87];
9546
- }
9547
- else {
9548
- vErrors.push(err87);
9549
- }
9550
- errors++;
9551
- }
9552
- }
9553
- var valid22 = _errs109 === errors;
9554
- }
9555
- else {
9556
- var valid22 = true;
9557
- }
9558
- }
9559
- }
9560
- }
9561
- }
9562
- }
9563
- }
9564
- }
9565
- else {
9566
- const err88 = { instancePath, schemaPath: "https://identity.foundation/dwn/json-schemas/permissions/scopes.json#/$defs/records-count-scope/type", keyword: "type", params: { type: "object" }, message: "must be object" };
9567
- if (vErrors === null) {
9568
- vErrors = [err88];
9569
- }
9570
- else {
9571
- vErrors.push(err88);
9572
- }
9573
- errors++;
9574
- }
9575
- }
9576
- var _valid0 = _errs99 === errors;
9577
- if (_valid0 && valid0) {
9578
- valid0 = false;
9579
- passing0 = [passing0, 8];
9580
- }
9581
- else {
9582
- if (_valid0) {
9583
- valid0 = true;
9584
- passing0 = 8;
9585
- if (props0 !== true) {
9586
- props0 = true;
9587
- }
9588
- }
9589
- }
9590
- }
9591
9263
  }
9592
9264
  }
9593
9265
  }
9594
9266
  }
9595
9267
  }
9596
- } if (!valid0) {
9597
- const err89 = { instancePath, schemaPath: "#/oneOf", keyword: "oneOf", params: { passingSchemas: passing0 }, message: "must match exactly one schema in oneOf" };
9268
+ else {
9269
+ validate68.errors = [{ instancePath, schemaPath: "#/type", keyword: "type", params: { type: "object" }, message: "must be object" }];
9270
+ return false;
9271
+ }
9272
+ } validate68.errors = vErrors; return errors === 0; }
9273
+ validate68.evaluated = { "props": true, "dynamicProps": false, "dynamicItems": false };
9274
+ export const PermissionRequestData = validate73;
9275
+ const schema106 = { "$schema": "https://json-schema.org/draft/2020-12/schema", "$id": "https://identity.foundation/dwn/json-schemas/permission-request-data.json", "type": "object", "additionalProperties": false, "required": ["delegated", "scope"], "properties": { "description": { "type": "string" }, "delegated": { "type": "boolean" }, "scope": { "$ref": "https://identity.foundation/dwn/json-schemas/permissions/defs.json#/$defs/scope" }, "conditions": { "$ref": "https://identity.foundation/dwn/json-schemas/permissions/defs.json#/$defs/conditions" } } };
9276
+ function validate74(data, { instancePath = "", parentData, parentDataProperty, rootData = data, dynamicAnchors = {} } = {}) { let vErrors = null; let errors = 0; const evaluated0 = validate74.evaluated; if (evaluated0.dynamicProps) {
9277
+ evaluated0.props = undefined;
9278
+ } if (evaluated0.dynamicItems) {
9279
+ evaluated0.items = undefined;
9280
+ } const _errs0 = errors; let valid0 = false; let passing0 = null; const _errs1 = errors; const _errs2 = errors; const _errs4 = errors; const _errs5 = errors; const _errs6 = errors; if (data && typeof data == "object" && !Array.isArray(data)) {
9281
+ let missing0;
9282
+ if (((data.contextId === undefined) && (missing0 = "contextId")) || ((data.protocolPath === undefined) && (missing0 = "protocolPath"))) {
9283
+ const err0 = {};
9284
+ if (vErrors === null) {
9285
+ vErrors = [err0];
9286
+ }
9287
+ else {
9288
+ vErrors.push(err0);
9289
+ }
9290
+ errors++;
9291
+ }
9292
+ } var valid3 = _errs6 === errors; if (valid3) {
9293
+ const err1 = { instancePath, schemaPath: "https://identity.foundation/dwn/json-schemas/permissions/scopes.json#/$defs/messages-read-scope/allOf/0/not", keyword: "not", params: {}, message: "must NOT be valid" };
9598
9294
  if (vErrors === null) {
9599
- vErrors = [err89];
9295
+ vErrors = [err1];
9600
9296
  }
9601
9297
  else {
9602
- vErrors.push(err89);
9298
+ vErrors.push(err1);
9603
9299
  }
9604
9300
  errors++;
9605
- validate70.errors = vErrors;
9606
- return false;
9607
9301
  }
9608
9302
  else {
9609
- errors = _errs0;
9303
+ errors = _errs5;
9610
9304
  if (vErrors !== null) {
9611
- if (_errs0) {
9612
- vErrors.length = _errs0;
9613
- }
9614
- else {
9615
- vErrors = null;
9616
- }
9617
- }
9618
- } validate70.errors = vErrors; evaluated0.props = props0; return errors === 0; }
9619
- validate70.evaluated = { "dynamicProps": true, "dynamicItems": false };
9620
- function validate68(data, { instancePath = "", parentData, parentDataProperty, rootData = data, dynamicAnchors = {} } = {}) { /*# sourceURL="https://identity.foundation/dwn/json-schemas/permission-grant-data.json" */ ; let vErrors = null; let errors = 0; const evaluated0 = validate68.evaluated; if (evaluated0.dynamicProps) {
9621
- evaluated0.props = undefined;
9622
- } if (evaluated0.dynamicItems) {
9623
- evaluated0.items = undefined;
9624
- } if (errors === 0) {
9625
- if (data && typeof data == "object" && !Array.isArray(data)) {
9626
- let missing0;
9627
- if (((data.dateExpires === undefined) && (missing0 = "dateExpires")) || ((data.scope === undefined) && (missing0 = "scope"))) {
9628
- validate68.errors = [{ instancePath, schemaPath: "#/required", keyword: "required", params: { missingProperty: missing0 }, message: "must have required property '" + missing0 + "'" }];
9629
- return false;
9630
- }
9631
- else {
9632
- const _errs1 = errors;
9633
- for (const key0 in data) {
9634
- if (!(((((((key0 === "description") || (key0 === "dateExpires")) || (key0 === "requestId")) || (key0 === "delegated")) || (key0 === "scope")) || (key0 === "conditions")) || (key0 === "delegateKeyDelivery"))) {
9635
- validate68.errors = [{ instancePath, schemaPath: "#/additionalProperties", keyword: "additionalProperties", params: { additionalProperty: key0 }, message: "must NOT have additional properties" }];
9636
- return false;
9637
- break;
9638
- }
9639
- }
9640
- if (_errs1 === errors) {
9641
- if (data.description !== undefined) {
9642
- const _errs2 = errors;
9643
- if (typeof data.description !== "string") {
9644
- validate68.errors = [{ instancePath: instancePath + "/description", schemaPath: "#/properties/description/type", keyword: "type", params: { type: "string" }, message: "must be string" }];
9645
- return false;
9646
- }
9647
- var valid0 = _errs2 === errors;
9648
- }
9649
- else {
9650
- var valid0 = true;
9651
- }
9652
- if (valid0) {
9653
- if (data.dateExpires !== undefined) {
9654
- let data1 = data.dateExpires;
9655
- const _errs4 = errors;
9656
- const _errs5 = errors;
9657
- if (errors === _errs5) {
9658
- if (typeof data1 === "string") {
9659
- if (!pattern14.test(data1)) {
9660
- validate68.errors = [{ instancePath: instancePath + "/dateExpires", 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$" + "\"" }];
9661
- return false;
9662
- }
9663
- }
9664
- else {
9665
- validate68.errors = [{ instancePath: instancePath + "/dateExpires", schemaPath: "https://identity.foundation/dwn/json-schemas/defs.json#/$defs/date-time/type", keyword: "type", params: { type: "string" }, message: "must be string" }];
9666
- return false;
9667
- }
9668
- }
9669
- var valid0 = _errs4 === errors;
9670
- }
9671
- else {
9672
- var valid0 = true;
9673
- }
9674
- if (valid0) {
9675
- if (data.requestId !== undefined) {
9676
- const _errs7 = errors;
9677
- if (typeof data.requestId !== "string") {
9678
- validate68.errors = [{ instancePath: instancePath + "/requestId", schemaPath: "#/properties/requestId/type", keyword: "type", params: { type: "string" }, message: "must be string" }];
9679
- return false;
9680
- }
9681
- var valid0 = _errs7 === errors;
9682
- }
9683
- else {
9684
- var valid0 = true;
9685
- }
9686
- if (valid0) {
9687
- if (data.delegated !== undefined) {
9688
- const _errs9 = errors;
9689
- if (typeof data.delegated !== "boolean") {
9690
- validate68.errors = [{ instancePath: instancePath + "/delegated", schemaPath: "#/properties/delegated/type", keyword: "type", params: { type: "boolean" }, message: "must be boolean" }];
9691
- return false;
9692
- }
9693
- var valid0 = _errs9 === errors;
9694
- }
9695
- else {
9696
- var valid0 = true;
9697
- }
9698
- if (valid0) {
9699
- if (data.scope !== undefined) {
9700
- const _errs11 = errors;
9701
- if (!(validate70(data.scope, { instancePath: instancePath + "/scope", parentData: data, parentDataProperty: "scope", rootData, dynamicAnchors }))) {
9702
- vErrors = vErrors === null ? validate70.errors : vErrors.concat(validate70.errors);
9703
- errors = vErrors.length;
9704
- }
9705
- var valid0 = _errs11 === errors;
9706
- }
9707
- else {
9708
- var valid0 = true;
9709
- }
9710
- if (valid0) {
9711
- if (data.conditions !== undefined) {
9712
- let data5 = data.conditions;
9713
- const _errs12 = errors;
9714
- const _errs13 = errors;
9715
- if (errors === _errs13) {
9716
- if (data5 && typeof data5 == "object" && !Array.isArray(data5)) {
9717
- const _errs15 = errors;
9718
- for (const key1 in data5) {
9719
- if (!(key1 === "publication")) {
9720
- validate68.errors = [{ instancePath: instancePath + "/conditions", schemaPath: "https://identity.foundation/dwn/json-schemas/permissions/defs.json#/$defs/conditions/additionalProperties", keyword: "additionalProperties", params: { additionalProperty: key1 }, message: "must NOT have additional properties" }];
9721
- return false;
9722
- break;
9723
- }
9724
- }
9725
- if (_errs15 === errors) {
9726
- if (data5.publication !== undefined) {
9727
- let data6 = data5.publication;
9728
- if (typeof data6 !== "string") {
9729
- validate68.errors = [{ instancePath: instancePath + "/conditions/publication", schemaPath: "https://identity.foundation/dwn/json-schemas/permissions/defs.json#/$defs/conditions/properties/publication/type", keyword: "type", params: { type: "string" }, message: "must be string" }];
9730
- return false;
9731
- }
9732
- if (!((data6 === "Required") || (data6 === "Prohibited"))) {
9733
- validate68.errors = [{ instancePath: instancePath + "/conditions/publication", schemaPath: "https://identity.foundation/dwn/json-schemas/permissions/defs.json#/$defs/conditions/properties/publication/enum", keyword: "enum", params: { allowedValues: schema108.properties.publication.enum }, message: "must be equal to one of the allowed values" }];
9734
- return false;
9735
- }
9736
- }
9737
- }
9738
- }
9739
- else {
9740
- validate68.errors = [{ instancePath: instancePath + "/conditions", schemaPath: "https://identity.foundation/dwn/json-schemas/permissions/defs.json#/$defs/conditions/type", keyword: "type", params: { type: "object" }, message: "must be object" }];
9741
- return false;
9742
- }
9743
- }
9744
- var valid0 = _errs12 === errors;
9745
- }
9746
- else {
9747
- var valid0 = true;
9748
- }
9749
- if (valid0) {
9750
- if (data.delegateKeyDelivery !== undefined) {
9751
- let data7 = data.delegateKeyDelivery;
9752
- const _errs18 = errors;
9753
- if (errors === _errs18) {
9754
- if (data7 && typeof data7 == "object" && !Array.isArray(data7)) {
9755
- let missing1;
9756
- if (((data7.rootKeyId === undefined) && (missing1 = "rootKeyId")) || ((data7.publicKeyJwk === undefined) && (missing1 = "publicKeyJwk"))) {
9757
- validate68.errors = [{ instancePath: instancePath + "/delegateKeyDelivery", schemaPath: "#/properties/delegateKeyDelivery/required", keyword: "required", params: { missingProperty: missing1 }, message: "must have required property '" + missing1 + "'" }];
9758
- return false;
9759
- }
9760
- else {
9761
- const _errs20 = errors;
9762
- for (const key2 in data7) {
9763
- if (!((key2 === "rootKeyId") || (key2 === "publicKeyJwk"))) {
9764
- validate68.errors = [{ instancePath: instancePath + "/delegateKeyDelivery", schemaPath: "#/properties/delegateKeyDelivery/additionalProperties", keyword: "additionalProperties", params: { additionalProperty: key2 }, message: "must NOT have additional properties" }];
9765
- return false;
9766
- break;
9767
- }
9768
- }
9769
- if (_errs20 === errors) {
9770
- if (data7.rootKeyId !== undefined) {
9771
- const _errs21 = errors;
9772
- if (typeof data7.rootKeyId !== "string") {
9773
- validate68.errors = [{ instancePath: instancePath + "/delegateKeyDelivery/rootKeyId", schemaPath: "#/properties/delegateKeyDelivery/properties/rootKeyId/type", keyword: "type", params: { type: "string" }, message: "must be string" }];
9774
- return false;
9775
- }
9776
- var valid4 = _errs21 === errors;
9777
- }
9778
- else {
9779
- var valid4 = true;
9780
- }
9781
- if (valid4) {
9782
- if (data7.publicKeyJwk !== undefined) {
9783
- let data9 = data7.publicKeyJwk;
9784
- const _errs23 = errors;
9785
- if (!(data9 && typeof data9 == "object" && !Array.isArray(data9))) {
9786
- validate68.errors = [{ instancePath: instancePath + "/delegateKeyDelivery/publicKeyJwk", schemaPath: "#/properties/delegateKeyDelivery/properties/publicKeyJwk/type", keyword: "type", params: { type: "object" }, message: "must be object" }];
9787
- return false;
9788
- }
9789
- var valid4 = _errs23 === errors;
9790
- }
9791
- else {
9792
- var valid4 = true;
9793
- }
9794
- }
9795
- }
9796
- }
9797
- }
9798
- else {
9799
- validate68.errors = [{ instancePath: instancePath + "/delegateKeyDelivery", schemaPath: "#/properties/delegateKeyDelivery/type", keyword: "type", params: { type: "object" }, message: "must be object" }];
9800
- return false;
9801
- }
9802
- }
9803
- var valid0 = _errs18 === errors;
9804
- }
9805
- else {
9806
- var valid0 = true;
9807
- }
9808
- }
9809
- }
9810
- }
9811
- }
9812
- }
9813
- }
9814
- }
9815
- }
9816
- }
9817
- else {
9818
- validate68.errors = [{ instancePath, schemaPath: "#/type", keyword: "type", params: { type: "object" }, message: "must be object" }];
9819
- return false;
9820
- }
9821
- } validate68.errors = vErrors; return errors === 0; }
9822
- validate68.evaluated = { "props": true, "dynamicProps": false, "dynamicItems": false };
9823
- export const PermissionRequestData = validate73;
9824
- const schema109 = { "$schema": "https://json-schema.org/draft/2020-12/schema", "$id": "https://identity.foundation/dwn/json-schemas/permission-request-data.json", "type": "object", "additionalProperties": false, "required": ["delegated", "scope"], "properties": { "description": { "type": "string" }, "delegated": { "type": "boolean" }, "scope": { "$ref": "https://identity.foundation/dwn/json-schemas/permissions/defs.json#/$defs/scope" }, "conditions": { "$ref": "https://identity.foundation/dwn/json-schemas/permissions/defs.json#/$defs/conditions" } } };
9825
- function validate74(data, { instancePath = "", parentData, parentDataProperty, rootData = data, dynamicAnchors = {} } = {}) { let vErrors = null; let errors = 0; const evaluated0 = validate74.evaluated; if (evaluated0.dynamicProps) {
9826
- evaluated0.props = undefined;
9827
- } if (evaluated0.dynamicItems) {
9828
- evaluated0.items = undefined;
9829
- } const _errs0 = errors; let valid0 = false; let passing0 = null; const _errs1 = errors; const _errs2 = errors; const _errs4 = errors; const _errs5 = errors; const _errs6 = errors; if (data && typeof data == "object" && !Array.isArray(data)) {
9830
- let missing0;
9831
- if (((data.contextId === undefined) && (missing0 = "contextId")) || ((data.protocolPath === undefined) && (missing0 = "protocolPath"))) {
9832
- const err0 = {};
9833
- if (vErrors === null) {
9834
- vErrors = [err0];
9835
- }
9836
- else {
9837
- vErrors.push(err0);
9838
- }
9839
- errors++;
9840
- }
9841
- } var valid3 = _errs6 === errors; if (valid3) {
9842
- const err1 = { instancePath, schemaPath: "https://identity.foundation/dwn/json-schemas/permissions/scopes.json#/$defs/messages-read-scope/allOf/0/not", keyword: "not", params: {}, message: "must NOT be valid" };
9843
- if (vErrors === null) {
9844
- vErrors = [err1];
9845
- }
9846
- else {
9847
- vErrors.push(err1);
9848
- }
9849
- errors++;
9850
- }
9851
- else {
9852
- errors = _errs5;
9853
- if (vErrors !== null) {
9854
- if (_errs5) {
9855
- vErrors.length = _errs5;
9305
+ if (_errs5) {
9306
+ vErrors.length = _errs5;
9856
9307
  }
9857
9308
  else {
9858
9309
  vErrors = null;
@@ -9860,1594 +9311,1048 @@ else {
9860
9311
  }
9861
9312
  } var valid2 = _errs4 === errors; if (valid2) {
9862
9313
  const _errs7 = errors;
9863
- const _errs8 = errors;
9864
- let valid4 = true;
9865
- const _errs9 = errors;
9866
- const _errs10 = errors;
9867
- let valid5 = false;
9868
- const _errs11 = errors;
9869
- if (data && typeof data == "object" && !Array.isArray(data)) {
9870
- let missing1;
9871
- if ((data.contextId === undefined) && (missing1 = "contextId")) {
9872
- const err2 = {};
9873
- if (vErrors === null) {
9874
- vErrors = [err2];
9875
- }
9876
- else {
9877
- vErrors.push(err2);
9878
- }
9879
- errors++;
9880
- }
9881
- }
9882
- var _valid2 = _errs11 === errors;
9883
- valid5 = valid5 || _valid2;
9884
- const _errs12 = errors;
9885
- if (data && typeof data == "object" && !Array.isArray(data)) {
9886
- let missing2;
9887
- if ((data.protocolPath === undefined) && (missing2 = "protocolPath")) {
9888
- const err3 = {};
9889
- if (vErrors === null) {
9890
- vErrors = [err3];
9891
- }
9892
- else {
9893
- vErrors.push(err3);
9894
- }
9895
- errors++;
9896
- }
9897
- }
9898
- var _valid2 = _errs12 === errors;
9899
- valid5 = valid5 || _valid2;
9900
- if (!valid5) {
9901
- const err4 = {};
9902
- if (vErrors === null) {
9903
- vErrors = [err4];
9904
- }
9905
- else {
9906
- vErrors.push(err4);
9907
- }
9908
- errors++;
9909
- }
9910
- else {
9911
- errors = _errs10;
9912
- if (vErrors !== null) {
9913
- if (_errs10) {
9914
- vErrors.length = _errs10;
9915
- }
9916
- else {
9917
- vErrors = null;
9918
- }
9919
- }
9920
- }
9921
- var _valid1 = _errs9 === errors;
9922
- errors = _errs8;
9923
- if (vErrors !== null) {
9924
- if (_errs8) {
9925
- vErrors.length = _errs8;
9926
- }
9927
- else {
9928
- vErrors = null;
9929
- }
9930
- }
9931
- if (_valid1) {
9932
- const _errs13 = errors;
9933
- if (data && typeof data == "object" && !Array.isArray(data)) {
9934
- let missing3;
9935
- if ((data.protocol === undefined) && (missing3 = "protocol")) {
9936
- const err5 = { instancePath, schemaPath: "https://identity.foundation/dwn/json-schemas/permissions/scopes.json#/$defs/messages-read-scope/allOf/1/then/required", keyword: "required", params: { missingProperty: missing3 }, message: "must have required property '" + missing3 + "'" };
9937
- if (vErrors === null) {
9938
- vErrors = [err5];
9939
- }
9940
- else {
9941
- vErrors.push(err5);
9942
- }
9943
- errors++;
9944
- }
9945
- }
9946
- var _valid1 = _errs13 === errors;
9947
- valid4 = _valid1;
9948
- }
9949
- if (!valid4) {
9950
- const err6 = { instancePath, schemaPath: "https://identity.foundation/dwn/json-schemas/permissions/scopes.json#/$defs/messages-read-scope/allOf/1/if", keyword: "if", params: { failingKeyword: "then" }, message: "must match \"then\" schema" };
9951
- if (vErrors === null) {
9952
- vErrors = [err6];
9953
- }
9954
- else {
9955
- vErrors.push(err6);
9956
- }
9957
- errors++;
9958
- }
9959
- var valid2 = _errs7 === errors;
9960
- } if (errors === _errs2) {
9961
- if (data && typeof data == "object" && !Array.isArray(data)) {
9962
- let missing4;
9963
- if (((data.interface === undefined) && (missing4 = "interface")) || ((data.method === undefined) && (missing4 = "method"))) {
9964
- const err7 = { instancePath, schemaPath: "https://identity.foundation/dwn/json-schemas/permissions/scopes.json#/$defs/messages-read-scope/required", keyword: "required", params: { missingProperty: missing4 }, message: "must have required property '" + missing4 + "'" };
9965
- if (vErrors === null) {
9966
- vErrors = [err7];
9967
- }
9968
- else {
9969
- vErrors.push(err7);
9970
- }
9971
- errors++;
9972
- }
9973
- else {
9974
- const _errs14 = errors;
9975
- for (const key0 in data) {
9976
- if (!(((((key0 === "interface") || (key0 === "method")) || (key0 === "protocol")) || (key0 === "contextId")) || (key0 === "protocolPath"))) {
9977
- const err8 = { instancePath, schemaPath: "https://identity.foundation/dwn/json-schemas/permissions/scopes.json#/$defs/messages-read-scope/additionalProperties", keyword: "additionalProperties", params: { additionalProperty: key0 }, message: "must NOT have additional properties" };
9978
- if (vErrors === null) {
9979
- vErrors = [err8];
9980
- }
9981
- else {
9982
- vErrors.push(err8);
9983
- }
9984
- errors++;
9985
- break;
9986
- }
9987
- }
9988
- if (_errs14 === errors) {
9989
- if (data.interface !== undefined) {
9990
- const _errs15 = errors;
9991
- if ("Messages" !== data.interface) {
9992
- const err9 = { instancePath: instancePath + "/interface", schemaPath: "https://identity.foundation/dwn/json-schemas/permissions/scopes.json#/$defs/messages-read-scope/properties/interface/const", keyword: "const", params: { allowedValue: "Messages" }, message: "must be equal to constant" };
9993
- if (vErrors === null) {
9994
- vErrors = [err9];
9995
- }
9996
- else {
9997
- vErrors.push(err9);
9998
- }
9999
- errors++;
10000
- }
10001
- var valid6 = _errs15 === errors;
10002
- }
10003
- else {
10004
- var valid6 = true;
10005
- }
10006
- if (valid6) {
10007
- if (data.method !== undefined) {
10008
- const _errs16 = errors;
10009
- if ("Read" !== data.method) {
10010
- const err10 = { instancePath: instancePath + "/method", schemaPath: "https://identity.foundation/dwn/json-schemas/permissions/scopes.json#/$defs/messages-read-scope/properties/method/const", keyword: "const", params: { allowedValue: "Read" }, message: "must be equal to constant" };
10011
- if (vErrors === null) {
10012
- vErrors = [err10];
10013
- }
10014
- else {
10015
- vErrors.push(err10);
10016
- }
10017
- errors++;
10018
- }
10019
- var valid6 = _errs16 === errors;
10020
- }
10021
- else {
10022
- var valid6 = true;
10023
- }
10024
- if (valid6) {
10025
- if (data.protocol !== undefined) {
10026
- const _errs17 = errors;
10027
- if (typeof data.protocol !== "string") {
10028
- const err11 = { instancePath: instancePath + "/protocol", schemaPath: "https://identity.foundation/dwn/json-schemas/permissions/scopes.json#/$defs/messages-read-scope/properties/protocol/type", keyword: "type", params: { type: "string" }, message: "must be string" };
10029
- if (vErrors === null) {
10030
- vErrors = [err11];
10031
- }
10032
- else {
10033
- vErrors.push(err11);
10034
- }
10035
- errors++;
10036
- }
10037
- var valid6 = _errs17 === errors;
10038
- }
10039
- else {
10040
- var valid6 = true;
10041
- }
10042
- if (valid6) {
10043
- if (data.contextId !== undefined) {
10044
- let data3 = data.contextId;
10045
- const _errs19 = errors;
10046
- if (errors === _errs19) {
10047
- if (typeof data3 === "string") {
10048
- if (func1(data3) > 600) {
10049
- const err12 = { instancePath: instancePath + "/contextId", schemaPath: "https://identity.foundation/dwn/json-schemas/permissions/scopes.json#/$defs/messages-read-scope/properties/contextId/maxLength", keyword: "maxLength", params: { limit: 600 }, message: "must NOT have more than 600 characters" };
10050
- if (vErrors === null) {
10051
- vErrors = [err12];
10052
- }
10053
- else {
10054
- vErrors.push(err12);
10055
- }
10056
- errors++;
10057
- }
10058
- }
10059
- else {
10060
- const err13 = { instancePath: instancePath + "/contextId", schemaPath: "https://identity.foundation/dwn/json-schemas/permissions/scopes.json#/$defs/messages-read-scope/properties/contextId/type", keyword: "type", params: { type: "string" }, message: "must be string" };
10061
- if (vErrors === null) {
10062
- vErrors = [err13];
10063
- }
10064
- else {
10065
- vErrors.push(err13);
10066
- }
10067
- errors++;
10068
- }
10069
- }
10070
- var valid6 = _errs19 === errors;
10071
- }
10072
- else {
10073
- var valid6 = true;
10074
- }
10075
- if (valid6) {
10076
- if (data.protocolPath !== undefined) {
10077
- let data4 = data.protocolPath;
10078
- const _errs21 = errors;
10079
- if (errors === _errs21) {
10080
- if (typeof data4 === "string") {
10081
- if (func1(data4) > 600) {
10082
- const err14 = { instancePath: instancePath + "/protocolPath", schemaPath: "https://identity.foundation/dwn/json-schemas/permissions/scopes.json#/$defs/messages-read-scope/properties/protocolPath/maxLength", keyword: "maxLength", params: { limit: 600 }, message: "must NOT have more than 600 characters" };
10083
- if (vErrors === null) {
10084
- vErrors = [err14];
10085
- }
10086
- else {
10087
- vErrors.push(err14);
10088
- }
10089
- errors++;
10090
- }
10091
- }
10092
- else {
10093
- const err15 = { instancePath: instancePath + "/protocolPath", schemaPath: "https://identity.foundation/dwn/json-schemas/permissions/scopes.json#/$defs/messages-read-scope/properties/protocolPath/type", keyword: "type", params: { type: "string" }, message: "must be string" };
10094
- if (vErrors === null) {
10095
- vErrors = [err15];
10096
- }
10097
- else {
10098
- vErrors.push(err15);
10099
- }
10100
- errors++;
10101
- }
10102
- }
10103
- var valid6 = _errs21 === errors;
10104
- }
10105
- else {
10106
- var valid6 = true;
10107
- }
10108
- }
10109
- }
10110
- }
10111
- }
10112
- }
10113
- }
10114
- }
10115
- else {
10116
- const err16 = { instancePath, schemaPath: "https://identity.foundation/dwn/json-schemas/permissions/scopes.json#/$defs/messages-read-scope/type", keyword: "type", params: { type: "object" }, message: "must be object" };
10117
- if (vErrors === null) {
10118
- vErrors = [err16];
10119
- }
10120
- else {
10121
- vErrors.push(err16);
10122
- }
10123
- errors++;
10124
- }
10125
- } var _valid0 = _errs1 === errors; if (_valid0) {
10126
- valid0 = true;
10127
- passing0 = 0;
10128
- var props0 = true;
10129
- } const _errs23 = errors; const _errs24 = errors; if (errors === _errs24) {
10130
- if (data && typeof data == "object" && !Array.isArray(data)) {
10131
- let missing5;
10132
- if (((data.interface === undefined) && (missing5 = "interface")) || ((data.method === undefined) && (missing5 = "method"))) {
10133
- const err17 = { instancePath, schemaPath: "https://identity.foundation/dwn/json-schemas/permissions/scopes.json#/$defs/protocols-configure-scope/required", keyword: "required", params: { missingProperty: missing5 }, message: "must have required property '" + missing5 + "'" };
10134
- if (vErrors === null) {
10135
- vErrors = [err17];
10136
- }
10137
- else {
10138
- vErrors.push(err17);
10139
- }
10140
- errors++;
10141
- }
10142
- else {
10143
- const _errs26 = errors;
10144
- for (const key1 in data) {
10145
- if (!(((key1 === "interface") || (key1 === "method")) || (key1 === "protocol"))) {
10146
- const err18 = { instancePath, schemaPath: "https://identity.foundation/dwn/json-schemas/permissions/scopes.json#/$defs/protocols-configure-scope/additionalProperties", keyword: "additionalProperties", params: { additionalProperty: key1 }, message: "must NOT have additional properties" };
10147
- if (vErrors === null) {
10148
- vErrors = [err18];
10149
- }
10150
- else {
10151
- vErrors.push(err18);
10152
- }
10153
- errors++;
10154
- break;
10155
- }
10156
- }
10157
- if (_errs26 === errors) {
10158
- if (data.interface !== undefined) {
10159
- const _errs27 = errors;
10160
- if ("Protocols" !== data.interface) {
10161
- const err19 = { instancePath: instancePath + "/interface", schemaPath: "https://identity.foundation/dwn/json-schemas/permissions/scopes.json#/$defs/protocols-configure-scope/properties/interface/const", keyword: "const", params: { allowedValue: "Protocols" }, message: "must be equal to constant" };
10162
- if (vErrors === null) {
10163
- vErrors = [err19];
10164
- }
10165
- else {
10166
- vErrors.push(err19);
10167
- }
10168
- errors++;
10169
- }
10170
- var valid8 = _errs27 === errors;
10171
- }
10172
- else {
10173
- var valid8 = true;
10174
- }
10175
- if (valid8) {
10176
- if (data.method !== undefined) {
10177
- const _errs28 = errors;
10178
- if ("Configure" !== data.method) {
10179
- const err20 = { instancePath: instancePath + "/method", schemaPath: "https://identity.foundation/dwn/json-schemas/permissions/scopes.json#/$defs/protocols-configure-scope/properties/method/const", keyword: "const", params: { allowedValue: "Configure" }, message: "must be equal to constant" };
10180
- if (vErrors === null) {
10181
- vErrors = [err20];
10182
- }
10183
- else {
10184
- vErrors.push(err20);
10185
- }
10186
- errors++;
10187
- }
10188
- var valid8 = _errs28 === errors;
10189
- }
10190
- else {
10191
- var valid8 = true;
10192
- }
10193
- if (valid8) {
10194
- if (data.protocol !== undefined) {
10195
- const _errs29 = errors;
10196
- if (typeof data.protocol !== "string") {
10197
- const err21 = { instancePath: instancePath + "/protocol", schemaPath: "https://identity.foundation/dwn/json-schemas/permissions/scopes.json#/$defs/protocols-configure-scope/properties/protocol/type", keyword: "type", params: { type: "string" }, message: "must be string" };
10198
- if (vErrors === null) {
10199
- vErrors = [err21];
10200
- }
10201
- else {
10202
- vErrors.push(err21);
10203
- }
10204
- errors++;
10205
- }
10206
- var valid8 = _errs29 === errors;
10207
- }
10208
- else {
10209
- var valid8 = true;
10210
- }
10211
- }
10212
- }
10213
- }
10214
- }
10215
- }
10216
- else {
10217
- const err22 = { instancePath, schemaPath: "https://identity.foundation/dwn/json-schemas/permissions/scopes.json#/$defs/protocols-configure-scope/type", keyword: "type", params: { type: "object" }, message: "must be object" };
10218
- if (vErrors === null) {
10219
- vErrors = [err22];
10220
- }
10221
- else {
10222
- vErrors.push(err22);
10223
- }
10224
- errors++;
10225
- }
10226
- } var _valid0 = _errs23 === errors; if (_valid0 && valid0) {
10227
- valid0 = false;
10228
- passing0 = [passing0, 1];
10229
- }
10230
- else {
10231
- if (_valid0) {
10232
- valid0 = true;
10233
- passing0 = 1;
10234
- if (props0 !== true) {
10235
- props0 = true;
10236
- }
10237
- }
10238
- const _errs31 = errors;
10239
- const _errs32 = errors;
10240
- if (errors === _errs32) {
10241
- if (data && typeof data == "object" && !Array.isArray(data)) {
10242
- let missing6;
10243
- if (((data.interface === undefined) && (missing6 = "interface")) || ((data.method === undefined) && (missing6 = "method"))) {
10244
- const err23 = { instancePath, schemaPath: "https://identity.foundation/dwn/json-schemas/permissions/scopes.json#/$defs/protocols-query-scope/required", keyword: "required", params: { missingProperty: missing6 }, message: "must have required property '" + missing6 + "'" };
10245
- if (vErrors === null) {
10246
- vErrors = [err23];
10247
- }
10248
- else {
10249
- vErrors.push(err23);
10250
- }
10251
- errors++;
10252
- }
10253
- else {
10254
- const _errs34 = errors;
10255
- for (const key2 in data) {
10256
- if (!(((key2 === "interface") || (key2 === "method")) || (key2 === "protocol"))) {
10257
- const err24 = { instancePath, schemaPath: "https://identity.foundation/dwn/json-schemas/permissions/scopes.json#/$defs/protocols-query-scope/additionalProperties", keyword: "additionalProperties", params: { additionalProperty: key2 }, message: "must NOT have additional properties" };
10258
- if (vErrors === null) {
10259
- vErrors = [err24];
10260
- }
10261
- else {
10262
- vErrors.push(err24);
10263
- }
10264
- errors++;
10265
- break;
10266
- }
10267
- }
10268
- if (_errs34 === errors) {
10269
- if (data.interface !== undefined) {
10270
- const _errs35 = errors;
10271
- if ("Protocols" !== data.interface) {
10272
- const err25 = { instancePath: instancePath + "/interface", schemaPath: "https://identity.foundation/dwn/json-schemas/permissions/scopes.json#/$defs/protocols-query-scope/properties/interface/const", keyword: "const", params: { allowedValue: "Protocols" }, message: "must be equal to constant" };
10273
- if (vErrors === null) {
10274
- vErrors = [err25];
10275
- }
10276
- else {
10277
- vErrors.push(err25);
10278
- }
10279
- errors++;
10280
- }
10281
- var valid10 = _errs35 === errors;
10282
- }
10283
- else {
10284
- var valid10 = true;
10285
- }
10286
- if (valid10) {
10287
- if (data.method !== undefined) {
10288
- const _errs36 = errors;
10289
- if ("Query" !== data.method) {
10290
- const err26 = { instancePath: instancePath + "/method", schemaPath: "https://identity.foundation/dwn/json-schemas/permissions/scopes.json#/$defs/protocols-query-scope/properties/method/const", keyword: "const", params: { allowedValue: "Query" }, message: "must be equal to constant" };
10291
- if (vErrors === null) {
10292
- vErrors = [err26];
10293
- }
10294
- else {
10295
- vErrors.push(err26);
10296
- }
10297
- errors++;
10298
- }
10299
- var valid10 = _errs36 === errors;
10300
- }
10301
- else {
10302
- var valid10 = true;
10303
- }
10304
- if (valid10) {
10305
- if (data.protocol !== undefined) {
10306
- const _errs37 = errors;
10307
- if (typeof data.protocol !== "string") {
10308
- const err27 = { instancePath: instancePath + "/protocol", schemaPath: "https://identity.foundation/dwn/json-schemas/permissions/scopes.json#/$defs/protocols-query-scope/properties/protocol/type", keyword: "type", params: { type: "string" }, message: "must be string" };
10309
- if (vErrors === null) {
10310
- vErrors = [err27];
10311
- }
10312
- else {
10313
- vErrors.push(err27);
10314
- }
10315
- errors++;
10316
- }
10317
- var valid10 = _errs37 === errors;
10318
- }
10319
- else {
10320
- var valid10 = true;
10321
- }
10322
- }
10323
- }
10324
- }
10325
- }
10326
- }
10327
- else {
10328
- const err28 = { instancePath, schemaPath: "https://identity.foundation/dwn/json-schemas/permissions/scopes.json#/$defs/protocols-query-scope/type", keyword: "type", params: { type: "object" }, message: "must be object" };
10329
- if (vErrors === null) {
10330
- vErrors = [err28];
10331
- }
10332
- else {
10333
- vErrors.push(err28);
10334
- }
10335
- errors++;
10336
- }
10337
- }
10338
- var _valid0 = _errs31 === errors;
10339
- if (_valid0 && valid0) {
10340
- valid0 = false;
10341
- passing0 = [passing0, 2];
10342
- }
10343
- else {
10344
- if (_valid0) {
10345
- valid0 = true;
10346
- passing0 = 2;
10347
- if (props0 !== true) {
10348
- props0 = true;
10349
- }
10350
- }
10351
- const _errs39 = errors;
10352
- const _errs40 = errors;
10353
- if (errors === _errs40) {
10354
- if (data && typeof data == "object" && !Array.isArray(data)) {
10355
- let missing7;
10356
- if ((((data.interface === undefined) && (missing7 = "interface")) || ((data.method === undefined) && (missing7 = "method"))) || ((data.protocol === undefined) && (missing7 = "protocol"))) {
10357
- const err29 = { instancePath, schemaPath: "https://identity.foundation/dwn/json-schemas/permissions/scopes.json#/$defs/records-read-scope/required", keyword: "required", params: { missingProperty: missing7 }, message: "must have required property '" + missing7 + "'" };
10358
- if (vErrors === null) {
10359
- vErrors = [err29];
10360
- }
10361
- else {
10362
- vErrors.push(err29);
10363
- }
10364
- errors++;
10365
- }
10366
- else {
10367
- const _errs42 = errors;
10368
- for (const key3 in data) {
10369
- if (!(((((key3 === "interface") || (key3 === "method")) || (key3 === "protocol")) || (key3 === "contextId")) || (key3 === "protocolPath"))) {
10370
- const err30 = { instancePath, schemaPath: "https://identity.foundation/dwn/json-schemas/permissions/scopes.json#/$defs/records-read-scope/additionalProperties", keyword: "additionalProperties", params: { additionalProperty: key3 }, message: "must NOT have additional properties" };
10371
- if (vErrors === null) {
10372
- vErrors = [err30];
10373
- }
10374
- else {
10375
- vErrors.push(err30);
10376
- }
10377
- errors++;
10378
- break;
10379
- }
10380
- }
10381
- if (_errs42 === errors) {
10382
- if (data.interface !== undefined) {
10383
- const _errs43 = errors;
10384
- if ("Records" !== data.interface) {
10385
- const err31 = { instancePath: instancePath + "/interface", schemaPath: "https://identity.foundation/dwn/json-schemas/permissions/scopes.json#/$defs/records-read-scope/properties/interface/const", keyword: "const", params: { allowedValue: "Records" }, message: "must be equal to constant" };
10386
- if (vErrors === null) {
10387
- vErrors = [err31];
10388
- }
10389
- else {
10390
- vErrors.push(err31);
10391
- }
10392
- errors++;
10393
- }
10394
- var valid12 = _errs43 === errors;
10395
- }
10396
- else {
10397
- var valid12 = true;
10398
- }
10399
- if (valid12) {
10400
- if (data.method !== undefined) {
10401
- const _errs44 = errors;
10402
- if ("Read" !== data.method) {
10403
- const err32 = { instancePath: instancePath + "/method", schemaPath: "https://identity.foundation/dwn/json-schemas/permissions/scopes.json#/$defs/records-read-scope/properties/method/const", keyword: "const", params: { allowedValue: "Read" }, message: "must be equal to constant" };
10404
- if (vErrors === null) {
10405
- vErrors = [err32];
10406
- }
10407
- else {
10408
- vErrors.push(err32);
10409
- }
10410
- errors++;
10411
- }
10412
- var valid12 = _errs44 === errors;
10413
- }
10414
- else {
10415
- var valid12 = true;
10416
- }
10417
- if (valid12) {
10418
- if (data.protocol !== undefined) {
10419
- const _errs45 = errors;
10420
- if (typeof data.protocol !== "string") {
10421
- const err33 = { instancePath: instancePath + "/protocol", schemaPath: "https://identity.foundation/dwn/json-schemas/permissions/scopes.json#/$defs/records-read-scope/properties/protocol/type", keyword: "type", params: { type: "string" }, message: "must be string" };
10422
- if (vErrors === null) {
10423
- vErrors = [err33];
10424
- }
10425
- else {
10426
- vErrors.push(err33);
10427
- }
10428
- errors++;
10429
- }
10430
- var valid12 = _errs45 === errors;
10431
- }
10432
- else {
10433
- var valid12 = true;
10434
- }
10435
- if (valid12) {
10436
- if (data.contextId !== undefined) {
10437
- let data14 = data.contextId;
10438
- const _errs47 = errors;
10439
- if (errors === _errs47) {
10440
- if (typeof data14 === "string") {
10441
- if (func1(data14) > 600) {
10442
- const err34 = { instancePath: instancePath + "/contextId", schemaPath: "https://identity.foundation/dwn/json-schemas/permissions/scopes.json#/$defs/records-read-scope/properties/contextId/maxLength", keyword: "maxLength", params: { limit: 600 }, message: "must NOT have more than 600 characters" };
10443
- if (vErrors === null) {
10444
- vErrors = [err34];
10445
- }
10446
- else {
10447
- vErrors.push(err34);
10448
- }
10449
- errors++;
10450
- }
10451
- }
10452
- else {
10453
- const err35 = { instancePath: instancePath + "/contextId", schemaPath: "https://identity.foundation/dwn/json-schemas/permissions/scopes.json#/$defs/records-read-scope/properties/contextId/type", keyword: "type", params: { type: "string" }, message: "must be string" };
10454
- if (vErrors === null) {
10455
- vErrors = [err35];
10456
- }
10457
- else {
10458
- vErrors.push(err35);
10459
- }
10460
- errors++;
10461
- }
10462
- }
10463
- var valid12 = _errs47 === errors;
10464
- }
10465
- else {
10466
- var valid12 = true;
10467
- }
10468
- if (valid12) {
10469
- if (data.protocolPath !== undefined) {
10470
- let data15 = data.protocolPath;
10471
- const _errs49 = errors;
10472
- if (errors === _errs49) {
10473
- if (typeof data15 === "string") {
10474
- if (func1(data15) > 600) {
10475
- const err36 = { instancePath: instancePath + "/protocolPath", schemaPath: "https://identity.foundation/dwn/json-schemas/permissions/scopes.json#/$defs/records-read-scope/properties/protocolPath/maxLength", keyword: "maxLength", params: { limit: 600 }, message: "must NOT have more than 600 characters" };
10476
- if (vErrors === null) {
10477
- vErrors = [err36];
10478
- }
10479
- else {
10480
- vErrors.push(err36);
10481
- }
10482
- errors++;
10483
- }
10484
- }
10485
- else {
10486
- const err37 = { instancePath: instancePath + "/protocolPath", schemaPath: "https://identity.foundation/dwn/json-schemas/permissions/scopes.json#/$defs/records-read-scope/properties/protocolPath/type", keyword: "type", params: { type: "string" }, message: "must be string" };
10487
- if (vErrors === null) {
10488
- vErrors = [err37];
10489
- }
10490
- else {
10491
- vErrors.push(err37);
10492
- }
10493
- errors++;
10494
- }
10495
- }
10496
- var valid12 = _errs49 === errors;
10497
- }
10498
- else {
10499
- var valid12 = true;
10500
- }
10501
- }
10502
- }
10503
- }
10504
- }
10505
- }
10506
- }
9314
+ const _errs8 = errors;
9315
+ let valid4 = true;
9316
+ const _errs9 = errors;
9317
+ const _errs10 = errors;
9318
+ let valid5 = false;
9319
+ const _errs11 = errors;
9320
+ if (data && typeof data == "object" && !Array.isArray(data)) {
9321
+ let missing1;
9322
+ if ((data.contextId === undefined) && (missing1 = "contextId")) {
9323
+ const err2 = {};
9324
+ if (vErrors === null) {
9325
+ vErrors = [err2];
10507
9326
  }
10508
9327
  else {
10509
- const err38 = { instancePath, schemaPath: "https://identity.foundation/dwn/json-schemas/permissions/scopes.json#/$defs/records-read-scope/type", keyword: "type", params: { type: "object" }, message: "must be object" };
9328
+ vErrors.push(err2);
9329
+ }
9330
+ errors++;
9331
+ }
9332
+ }
9333
+ var _valid2 = _errs11 === errors;
9334
+ valid5 = valid5 || _valid2;
9335
+ const _errs12 = errors;
9336
+ if (data && typeof data == "object" && !Array.isArray(data)) {
9337
+ let missing2;
9338
+ if ((data.protocolPath === undefined) && (missing2 = "protocolPath")) {
9339
+ const err3 = {};
9340
+ if (vErrors === null) {
9341
+ vErrors = [err3];
9342
+ }
9343
+ else {
9344
+ vErrors.push(err3);
9345
+ }
9346
+ errors++;
9347
+ }
9348
+ }
9349
+ var _valid2 = _errs12 === errors;
9350
+ valid5 = valid5 || _valid2;
9351
+ if (!valid5) {
9352
+ const err4 = {};
9353
+ if (vErrors === null) {
9354
+ vErrors = [err4];
9355
+ }
9356
+ else {
9357
+ vErrors.push(err4);
9358
+ }
9359
+ errors++;
9360
+ }
9361
+ else {
9362
+ errors = _errs10;
9363
+ if (vErrors !== null) {
9364
+ if (_errs10) {
9365
+ vErrors.length = _errs10;
9366
+ }
9367
+ else {
9368
+ vErrors = null;
9369
+ }
9370
+ }
9371
+ }
9372
+ var _valid1 = _errs9 === errors;
9373
+ errors = _errs8;
9374
+ if (vErrors !== null) {
9375
+ if (_errs8) {
9376
+ vErrors.length = _errs8;
9377
+ }
9378
+ else {
9379
+ vErrors = null;
9380
+ }
9381
+ }
9382
+ if (_valid1) {
9383
+ const _errs13 = errors;
9384
+ if (data && typeof data == "object" && !Array.isArray(data)) {
9385
+ let missing3;
9386
+ if ((data.protocol === undefined) && (missing3 = "protocol")) {
9387
+ const err5 = { instancePath, schemaPath: "https://identity.foundation/dwn/json-schemas/permissions/scopes.json#/$defs/messages-read-scope/allOf/1/then/required", keyword: "required", params: { missingProperty: missing3 }, message: "must have required property '" + missing3 + "'" };
10510
9388
  if (vErrors === null) {
10511
- vErrors = [err38];
9389
+ vErrors = [err5];
10512
9390
  }
10513
9391
  else {
10514
- vErrors.push(err38);
9392
+ vErrors.push(err5);
10515
9393
  }
10516
9394
  errors++;
10517
9395
  }
10518
9396
  }
10519
- var _valid0 = _errs39 === errors;
10520
- if (_valid0 && valid0) {
10521
- valid0 = false;
10522
- passing0 = [passing0, 3];
9397
+ var _valid1 = _errs13 === errors;
9398
+ valid4 = _valid1;
9399
+ }
9400
+ if (!valid4) {
9401
+ const err6 = { instancePath, schemaPath: "https://identity.foundation/dwn/json-schemas/permissions/scopes.json#/$defs/messages-read-scope/allOf/1/if", keyword: "if", params: { failingKeyword: "then" }, message: "must match \"then\" schema" };
9402
+ if (vErrors === null) {
9403
+ vErrors = [err6];
10523
9404
  }
10524
9405
  else {
10525
- if (_valid0) {
10526
- valid0 = true;
10527
- passing0 = 3;
10528
- if (props0 !== true) {
10529
- props0 = true;
9406
+ vErrors.push(err6);
9407
+ }
9408
+ errors++;
9409
+ }
9410
+ var valid2 = _errs7 === errors;
9411
+ } if (errors === _errs2) {
9412
+ if (data && typeof data == "object" && !Array.isArray(data)) {
9413
+ let missing4;
9414
+ if (((data.interface === undefined) && (missing4 = "interface")) || ((data.method === undefined) && (missing4 = "method"))) {
9415
+ const err7 = { instancePath, schemaPath: "https://identity.foundation/dwn/json-schemas/permissions/scopes.json#/$defs/messages-read-scope/required", keyword: "required", params: { missingProperty: missing4 }, message: "must have required property '" + missing4 + "'" };
9416
+ if (vErrors === null) {
9417
+ vErrors = [err7];
9418
+ }
9419
+ else {
9420
+ vErrors.push(err7);
9421
+ }
9422
+ errors++;
9423
+ }
9424
+ else {
9425
+ const _errs14 = errors;
9426
+ for (const key0 in data) {
9427
+ if (!(((((key0 === "interface") || (key0 === "method")) || (key0 === "protocol")) || (key0 === "contextId")) || (key0 === "protocolPath"))) {
9428
+ const err8 = { instancePath, schemaPath: "https://identity.foundation/dwn/json-schemas/permissions/scopes.json#/$defs/messages-read-scope/additionalProperties", keyword: "additionalProperties", params: { additionalProperty: key0 }, message: "must NOT have additional properties" };
9429
+ if (vErrors === null) {
9430
+ vErrors = [err8];
9431
+ }
9432
+ else {
9433
+ vErrors.push(err8);
9434
+ }
9435
+ errors++;
9436
+ break;
10530
9437
  }
10531
9438
  }
10532
- const _errs51 = errors;
10533
- const _errs52 = errors;
10534
- if (errors === _errs52) {
10535
- if (data && typeof data == "object" && !Array.isArray(data)) {
10536
- let missing8;
10537
- if ((((data.interface === undefined) && (missing8 = "interface")) || ((data.method === undefined) && (missing8 = "method"))) || ((data.protocol === undefined) && (missing8 = "protocol"))) {
10538
- const err39 = { instancePath, schemaPath: "https://identity.foundation/dwn/json-schemas/permissions/scopes.json#/$defs/records-delete-scope/required", keyword: "required", params: { missingProperty: missing8 }, message: "must have required property '" + missing8 + "'" };
9439
+ if (_errs14 === errors) {
9440
+ if (data.interface !== undefined) {
9441
+ const _errs15 = errors;
9442
+ if ("Messages" !== data.interface) {
9443
+ const err9 = { instancePath: instancePath + "/interface", schemaPath: "https://identity.foundation/dwn/json-schemas/permissions/scopes.json#/$defs/messages-read-scope/properties/interface/const", keyword: "const", params: { allowedValue: "Messages" }, message: "must be equal to constant" };
10539
9444
  if (vErrors === null) {
10540
- vErrors = [err39];
9445
+ vErrors = [err9];
10541
9446
  }
10542
9447
  else {
10543
- vErrors.push(err39);
9448
+ vErrors.push(err9);
10544
9449
  }
10545
9450
  errors++;
10546
9451
  }
9452
+ var valid6 = _errs15 === errors;
9453
+ }
9454
+ else {
9455
+ var valid6 = true;
9456
+ }
9457
+ if (valid6) {
9458
+ if (data.method !== undefined) {
9459
+ const _errs16 = errors;
9460
+ if ("Read" !== data.method) {
9461
+ const err10 = { instancePath: instancePath + "/method", schemaPath: "https://identity.foundation/dwn/json-schemas/permissions/scopes.json#/$defs/messages-read-scope/properties/method/const", keyword: "const", params: { allowedValue: "Read" }, message: "must be equal to constant" };
9462
+ if (vErrors === null) {
9463
+ vErrors = [err10];
9464
+ }
9465
+ else {
9466
+ vErrors.push(err10);
9467
+ }
9468
+ errors++;
9469
+ }
9470
+ var valid6 = _errs16 === errors;
9471
+ }
10547
9472
  else {
10548
- const _errs54 = errors;
10549
- for (const key4 in data) {
10550
- if (!(((((key4 === "interface") || (key4 === "method")) || (key4 === "protocol")) || (key4 === "contextId")) || (key4 === "protocolPath"))) {
10551
- const err40 = { instancePath, schemaPath: "https://identity.foundation/dwn/json-schemas/permissions/scopes.json#/$defs/records-delete-scope/additionalProperties", keyword: "additionalProperties", params: { additionalProperty: key4 }, message: "must NOT have additional properties" };
9473
+ var valid6 = true;
9474
+ }
9475
+ if (valid6) {
9476
+ if (data.protocol !== undefined) {
9477
+ const _errs17 = errors;
9478
+ if (typeof data.protocol !== "string") {
9479
+ const err11 = { instancePath: instancePath + "/protocol", schemaPath: "https://identity.foundation/dwn/json-schemas/permissions/scopes.json#/$defs/messages-read-scope/properties/protocol/type", keyword: "type", params: { type: "string" }, message: "must be string" };
10552
9480
  if (vErrors === null) {
10553
- vErrors = [err40];
9481
+ vErrors = [err11];
10554
9482
  }
10555
9483
  else {
10556
- vErrors.push(err40);
9484
+ vErrors.push(err11);
10557
9485
  }
10558
9486
  errors++;
10559
- break;
10560
9487
  }
9488
+ var valid6 = _errs17 === errors;
10561
9489
  }
10562
- if (_errs54 === errors) {
10563
- if (data.interface !== undefined) {
10564
- const _errs55 = errors;
10565
- if ("Records" !== data.interface) {
10566
- const err41 = { instancePath: instancePath + "/interface", schemaPath: "https://identity.foundation/dwn/json-schemas/permissions/scopes.json#/$defs/records-delete-scope/properties/interface/const", keyword: "const", params: { allowedValue: "Records" }, message: "must be equal to constant" };
10567
- if (vErrors === null) {
10568
- vErrors = [err41];
10569
- }
10570
- else {
10571
- vErrors.push(err41);
10572
- }
10573
- errors++;
10574
- }
10575
- var valid14 = _errs55 === errors;
10576
- }
10577
- else {
10578
- var valid14 = true;
10579
- }
10580
- if (valid14) {
10581
- if (data.method !== undefined) {
10582
- const _errs56 = errors;
10583
- if ("Delete" !== data.method) {
10584
- const err42 = { instancePath: instancePath + "/method", schemaPath: "https://identity.foundation/dwn/json-schemas/permissions/scopes.json#/$defs/records-delete-scope/properties/method/const", keyword: "const", params: { allowedValue: "Delete" }, message: "must be equal to constant" };
10585
- if (vErrors === null) {
10586
- vErrors = [err42];
10587
- }
10588
- else {
10589
- vErrors.push(err42);
10590
- }
10591
- errors++;
10592
- }
10593
- var valid14 = _errs56 === errors;
10594
- }
10595
- else {
10596
- var valid14 = true;
10597
- }
10598
- if (valid14) {
10599
- if (data.protocol !== undefined) {
10600
- const _errs57 = errors;
10601
- if (typeof data.protocol !== "string") {
10602
- const err43 = { instancePath: instancePath + "/protocol", schemaPath: "https://identity.foundation/dwn/json-schemas/permissions/scopes.json#/$defs/records-delete-scope/properties/protocol/type", keyword: "type", params: { type: "string" }, message: "must be string" };
9490
+ else {
9491
+ var valid6 = true;
9492
+ }
9493
+ if (valid6) {
9494
+ if (data.contextId !== undefined) {
9495
+ let data3 = data.contextId;
9496
+ const _errs19 = errors;
9497
+ if (errors === _errs19) {
9498
+ if (typeof data3 === "string") {
9499
+ if (func1(data3) > 600) {
9500
+ const err12 = { instancePath: instancePath + "/contextId", schemaPath: "https://identity.foundation/dwn/json-schemas/permissions/scopes.json#/$defs/messages-read-scope/properties/contextId/maxLength", keyword: "maxLength", params: { limit: 600 }, message: "must NOT have more than 600 characters" };
10603
9501
  if (vErrors === null) {
10604
- vErrors = [err43];
9502
+ vErrors = [err12];
10605
9503
  }
10606
9504
  else {
10607
- vErrors.push(err43);
9505
+ vErrors.push(err12);
10608
9506
  }
10609
9507
  errors++;
10610
9508
  }
10611
- var valid14 = _errs57 === errors;
10612
9509
  }
10613
9510
  else {
10614
- var valid14 = true;
10615
- }
10616
- if (valid14) {
10617
- if (data.contextId !== undefined) {
10618
- let data19 = data.contextId;
10619
- const _errs59 = errors;
10620
- if (errors === _errs59) {
10621
- if (typeof data19 === "string") {
10622
- if (func1(data19) > 600) {
10623
- const err44 = { instancePath: instancePath + "/contextId", schemaPath: "https://identity.foundation/dwn/json-schemas/permissions/scopes.json#/$defs/records-delete-scope/properties/contextId/maxLength", keyword: "maxLength", params: { limit: 600 }, message: "must NOT have more than 600 characters" };
10624
- if (vErrors === null) {
10625
- vErrors = [err44];
10626
- }
10627
- else {
10628
- vErrors.push(err44);
10629
- }
10630
- errors++;
10631
- }
9511
+ const err13 = { instancePath: instancePath + "/contextId", schemaPath: "https://identity.foundation/dwn/json-schemas/permissions/scopes.json#/$defs/messages-read-scope/properties/contextId/type", keyword: "type", params: { type: "string" }, message: "must be string" };
9512
+ if (vErrors === null) {
9513
+ vErrors = [err13];
9514
+ }
9515
+ else {
9516
+ vErrors.push(err13);
9517
+ }
9518
+ errors++;
9519
+ }
9520
+ }
9521
+ var valid6 = _errs19 === errors;
9522
+ }
9523
+ else {
9524
+ var valid6 = true;
9525
+ }
9526
+ if (valid6) {
9527
+ if (data.protocolPath !== undefined) {
9528
+ let data4 = data.protocolPath;
9529
+ const _errs21 = errors;
9530
+ if (errors === _errs21) {
9531
+ if (typeof data4 === "string") {
9532
+ if (func1(data4) > 600) {
9533
+ const err14 = { instancePath: instancePath + "/protocolPath", schemaPath: "https://identity.foundation/dwn/json-schemas/permissions/scopes.json#/$defs/messages-read-scope/properties/protocolPath/maxLength", keyword: "maxLength", params: { limit: 600 }, message: "must NOT have more than 600 characters" };
9534
+ if (vErrors === null) {
9535
+ vErrors = [err14];
10632
9536
  }
10633
9537
  else {
10634
- const err45 = { instancePath: instancePath + "/contextId", schemaPath: "https://identity.foundation/dwn/json-schemas/permissions/scopes.json#/$defs/records-delete-scope/properties/contextId/type", keyword: "type", params: { type: "string" }, message: "must be string" };
10635
- if (vErrors === null) {
10636
- vErrors = [err45];
10637
- }
10638
- else {
10639
- vErrors.push(err45);
10640
- }
10641
- errors++;
9538
+ vErrors.push(err14);
10642
9539
  }
9540
+ errors++;
10643
9541
  }
10644
- var valid14 = _errs59 === errors;
10645
9542
  }
10646
9543
  else {
10647
- var valid14 = true;
10648
- }
10649
- if (valid14) {
10650
- if (data.protocolPath !== undefined) {
10651
- let data20 = data.protocolPath;
10652
- const _errs61 = errors;
10653
- if (errors === _errs61) {
10654
- if (typeof data20 === "string") {
10655
- if (func1(data20) > 600) {
10656
- const err46 = { instancePath: instancePath + "/protocolPath", schemaPath: "https://identity.foundation/dwn/json-schemas/permissions/scopes.json#/$defs/records-delete-scope/properties/protocolPath/maxLength", keyword: "maxLength", params: { limit: 600 }, message: "must NOT have more than 600 characters" };
10657
- if (vErrors === null) {
10658
- vErrors = [err46];
10659
- }
10660
- else {
10661
- vErrors.push(err46);
10662
- }
10663
- errors++;
10664
- }
10665
- }
10666
- else {
10667
- const err47 = { instancePath: instancePath + "/protocolPath", schemaPath: "https://identity.foundation/dwn/json-schemas/permissions/scopes.json#/$defs/records-delete-scope/properties/protocolPath/type", keyword: "type", params: { type: "string" }, message: "must be string" };
10668
- if (vErrors === null) {
10669
- vErrors = [err47];
10670
- }
10671
- else {
10672
- vErrors.push(err47);
10673
- }
10674
- errors++;
10675
- }
10676
- }
10677
- var valid14 = _errs61 === errors;
9544
+ const err15 = { instancePath: instancePath + "/protocolPath", schemaPath: "https://identity.foundation/dwn/json-schemas/permissions/scopes.json#/$defs/messages-read-scope/properties/protocolPath/type", keyword: "type", params: { type: "string" }, message: "must be string" };
9545
+ if (vErrors === null) {
9546
+ vErrors = [err15];
10678
9547
  }
10679
9548
  else {
10680
- var valid14 = true;
9549
+ vErrors.push(err15);
10681
9550
  }
9551
+ errors++;
10682
9552
  }
10683
9553
  }
9554
+ var valid6 = _errs21 === errors;
9555
+ }
9556
+ else {
9557
+ var valid6 = true;
10684
9558
  }
10685
9559
  }
10686
9560
  }
10687
9561
  }
10688
9562
  }
10689
- else {
10690
- const err48 = { instancePath, schemaPath: "https://identity.foundation/dwn/json-schemas/permissions/scopes.json#/$defs/records-delete-scope/type", keyword: "type", params: { type: "object" }, message: "must be object" };
9563
+ }
9564
+ }
9565
+ }
9566
+ else {
9567
+ const err16 = { instancePath, schemaPath: "https://identity.foundation/dwn/json-schemas/permissions/scopes.json#/$defs/messages-read-scope/type", keyword: "type", params: { type: "object" }, message: "must be object" };
9568
+ if (vErrors === null) {
9569
+ vErrors = [err16];
9570
+ }
9571
+ else {
9572
+ vErrors.push(err16);
9573
+ }
9574
+ errors++;
9575
+ }
9576
+ } var _valid0 = _errs1 === errors; if (_valid0) {
9577
+ valid0 = true;
9578
+ passing0 = 0;
9579
+ var props0 = true;
9580
+ } const _errs23 = errors; const _errs24 = errors; if (errors === _errs24) {
9581
+ if (data && typeof data == "object" && !Array.isArray(data)) {
9582
+ let missing5;
9583
+ if (((data.interface === undefined) && (missing5 = "interface")) || ((data.method === undefined) && (missing5 = "method"))) {
9584
+ const err17 = { instancePath, schemaPath: "https://identity.foundation/dwn/json-schemas/permissions/scopes.json#/$defs/protocols-configure-scope/required", keyword: "required", params: { missingProperty: missing5 }, message: "must have required property '" + missing5 + "'" };
9585
+ if (vErrors === null) {
9586
+ vErrors = [err17];
9587
+ }
9588
+ else {
9589
+ vErrors.push(err17);
9590
+ }
9591
+ errors++;
9592
+ }
9593
+ else {
9594
+ const _errs26 = errors;
9595
+ for (const key1 in data) {
9596
+ if (!(((key1 === "interface") || (key1 === "method")) || (key1 === "protocol"))) {
9597
+ const err18 = { instancePath, schemaPath: "https://identity.foundation/dwn/json-schemas/permissions/scopes.json#/$defs/protocols-configure-scope/additionalProperties", keyword: "additionalProperties", params: { additionalProperty: key1 }, message: "must NOT have additional properties" };
10691
9598
  if (vErrors === null) {
10692
- vErrors = [err48];
9599
+ vErrors = [err18];
10693
9600
  }
10694
9601
  else {
10695
- vErrors.push(err48);
9602
+ vErrors.push(err18);
10696
9603
  }
10697
9604
  errors++;
9605
+ break;
10698
9606
  }
10699
9607
  }
10700
- var _valid0 = _errs51 === errors;
10701
- if (_valid0 && valid0) {
10702
- valid0 = false;
10703
- passing0 = [passing0, 4];
9608
+ if (_errs26 === errors) {
9609
+ if (data.interface !== undefined) {
9610
+ const _errs27 = errors;
9611
+ if ("Protocols" !== data.interface) {
9612
+ const err19 = { instancePath: instancePath + "/interface", schemaPath: "https://identity.foundation/dwn/json-schemas/permissions/scopes.json#/$defs/protocols-configure-scope/properties/interface/const", keyword: "const", params: { allowedValue: "Protocols" }, message: "must be equal to constant" };
9613
+ if (vErrors === null) {
9614
+ vErrors = [err19];
9615
+ }
9616
+ else {
9617
+ vErrors.push(err19);
9618
+ }
9619
+ errors++;
9620
+ }
9621
+ var valid8 = _errs27 === errors;
9622
+ }
9623
+ else {
9624
+ var valid8 = true;
9625
+ }
9626
+ if (valid8) {
9627
+ if (data.method !== undefined) {
9628
+ const _errs28 = errors;
9629
+ if ("Configure" !== data.method) {
9630
+ const err20 = { instancePath: instancePath + "/method", schemaPath: "https://identity.foundation/dwn/json-schemas/permissions/scopes.json#/$defs/protocols-configure-scope/properties/method/const", keyword: "const", params: { allowedValue: "Configure" }, message: "must be equal to constant" };
9631
+ if (vErrors === null) {
9632
+ vErrors = [err20];
9633
+ }
9634
+ else {
9635
+ vErrors.push(err20);
9636
+ }
9637
+ errors++;
9638
+ }
9639
+ var valid8 = _errs28 === errors;
9640
+ }
9641
+ else {
9642
+ var valid8 = true;
9643
+ }
9644
+ if (valid8) {
9645
+ if (data.protocol !== undefined) {
9646
+ const _errs29 = errors;
9647
+ if (typeof data.protocol !== "string") {
9648
+ const err21 = { instancePath: instancePath + "/protocol", schemaPath: "https://identity.foundation/dwn/json-schemas/permissions/scopes.json#/$defs/protocols-configure-scope/properties/protocol/type", keyword: "type", params: { type: "string" }, message: "must be string" };
9649
+ if (vErrors === null) {
9650
+ vErrors = [err21];
9651
+ }
9652
+ else {
9653
+ vErrors.push(err21);
9654
+ }
9655
+ errors++;
9656
+ }
9657
+ var valid8 = _errs29 === errors;
9658
+ }
9659
+ else {
9660
+ var valid8 = true;
9661
+ }
9662
+ }
9663
+ }
9664
+ }
9665
+ }
9666
+ }
9667
+ else {
9668
+ const err22 = { instancePath, schemaPath: "https://identity.foundation/dwn/json-schemas/permissions/scopes.json#/$defs/protocols-configure-scope/type", keyword: "type", params: { type: "object" }, message: "must be object" };
9669
+ if (vErrors === null) {
9670
+ vErrors = [err22];
9671
+ }
9672
+ else {
9673
+ vErrors.push(err22);
9674
+ }
9675
+ errors++;
9676
+ }
9677
+ } var _valid0 = _errs23 === errors; if (_valid0 && valid0) {
9678
+ valid0 = false;
9679
+ passing0 = [passing0, 1];
9680
+ }
9681
+ else {
9682
+ if (_valid0) {
9683
+ valid0 = true;
9684
+ passing0 = 1;
9685
+ if (props0 !== true) {
9686
+ props0 = true;
9687
+ }
9688
+ }
9689
+ const _errs31 = errors;
9690
+ const _errs32 = errors;
9691
+ if (errors === _errs32) {
9692
+ if (data && typeof data == "object" && !Array.isArray(data)) {
9693
+ let missing6;
9694
+ if (((data.interface === undefined) && (missing6 = "interface")) || ((data.method === undefined) && (missing6 = "method"))) {
9695
+ const err23 = { instancePath, schemaPath: "https://identity.foundation/dwn/json-schemas/permissions/scopes.json#/$defs/protocols-query-scope/required", keyword: "required", params: { missingProperty: missing6 }, message: "must have required property '" + missing6 + "'" };
9696
+ if (vErrors === null) {
9697
+ vErrors = [err23];
9698
+ }
9699
+ else {
9700
+ vErrors.push(err23);
9701
+ }
9702
+ errors++;
10704
9703
  }
10705
9704
  else {
10706
- if (_valid0) {
10707
- valid0 = true;
10708
- passing0 = 4;
10709
- if (props0 !== true) {
10710
- props0 = true;
9705
+ const _errs34 = errors;
9706
+ for (const key2 in data) {
9707
+ if (!(((key2 === "interface") || (key2 === "method")) || (key2 === "protocol"))) {
9708
+ const err24 = { instancePath, schemaPath: "https://identity.foundation/dwn/json-schemas/permissions/scopes.json#/$defs/protocols-query-scope/additionalProperties", keyword: "additionalProperties", params: { additionalProperty: key2 }, message: "must NOT have additional properties" };
9709
+ if (vErrors === null) {
9710
+ vErrors = [err24];
9711
+ }
9712
+ else {
9713
+ vErrors.push(err24);
9714
+ }
9715
+ errors++;
9716
+ break;
10711
9717
  }
10712
9718
  }
10713
- const _errs63 = errors;
10714
- const _errs64 = errors;
10715
- if (errors === _errs64) {
10716
- if (data && typeof data == "object" && !Array.isArray(data)) {
10717
- let missing9;
10718
- if ((((data.interface === undefined) && (missing9 = "interface")) || ((data.method === undefined) && (missing9 = "method"))) || ((data.protocol === undefined) && (missing9 = "protocol"))) {
10719
- const err49 = { instancePath, schemaPath: "https://identity.foundation/dwn/json-schemas/permissions/scopes.json#/$defs/records-write-scope/required", keyword: "required", params: { missingProperty: missing9 }, message: "must have required property '" + missing9 + "'" };
9719
+ if (_errs34 === errors) {
9720
+ if (data.interface !== undefined) {
9721
+ const _errs35 = errors;
9722
+ if ("Protocols" !== data.interface) {
9723
+ const err25 = { instancePath: instancePath + "/interface", schemaPath: "https://identity.foundation/dwn/json-schemas/permissions/scopes.json#/$defs/protocols-query-scope/properties/interface/const", keyword: "const", params: { allowedValue: "Protocols" }, message: "must be equal to constant" };
10720
9724
  if (vErrors === null) {
10721
- vErrors = [err49];
9725
+ vErrors = [err25];
10722
9726
  }
10723
9727
  else {
10724
- vErrors.push(err49);
9728
+ vErrors.push(err25);
9729
+ }
9730
+ errors++;
9731
+ }
9732
+ var valid10 = _errs35 === errors;
9733
+ }
9734
+ else {
9735
+ var valid10 = true;
9736
+ }
9737
+ if (valid10) {
9738
+ if (data.method !== undefined) {
9739
+ const _errs36 = errors;
9740
+ if ("Query" !== data.method) {
9741
+ const err26 = { instancePath: instancePath + "/method", schemaPath: "https://identity.foundation/dwn/json-schemas/permissions/scopes.json#/$defs/protocols-query-scope/properties/method/const", keyword: "const", params: { allowedValue: "Query" }, message: "must be equal to constant" };
9742
+ if (vErrors === null) {
9743
+ vErrors = [err26];
9744
+ }
9745
+ else {
9746
+ vErrors.push(err26);
9747
+ }
9748
+ errors++;
10725
9749
  }
10726
- errors++;
9750
+ var valid10 = _errs36 === errors;
10727
9751
  }
10728
9752
  else {
10729
- const _errs66 = errors;
10730
- for (const key5 in data) {
10731
- if (!(((((key5 === "interface") || (key5 === "method")) || (key5 === "protocol")) || (key5 === "contextId")) || (key5 === "protocolPath"))) {
10732
- const err50 = { instancePath, schemaPath: "https://identity.foundation/dwn/json-schemas/permissions/scopes.json#/$defs/records-write-scope/additionalProperties", keyword: "additionalProperties", params: { additionalProperty: key5 }, message: "must NOT have additional properties" };
9753
+ var valid10 = true;
9754
+ }
9755
+ if (valid10) {
9756
+ if (data.protocol !== undefined) {
9757
+ const _errs37 = errors;
9758
+ if (typeof data.protocol !== "string") {
9759
+ const err27 = { instancePath: instancePath + "/protocol", schemaPath: "https://identity.foundation/dwn/json-schemas/permissions/scopes.json#/$defs/protocols-query-scope/properties/protocol/type", keyword: "type", params: { type: "string" }, message: "must be string" };
10733
9760
  if (vErrors === null) {
10734
- vErrors = [err50];
9761
+ vErrors = [err27];
10735
9762
  }
10736
9763
  else {
10737
- vErrors.push(err50);
9764
+ vErrors.push(err27);
10738
9765
  }
10739
9766
  errors++;
10740
- break;
10741
9767
  }
9768
+ var valid10 = _errs37 === errors;
10742
9769
  }
10743
- if (_errs66 === errors) {
10744
- if (data.interface !== undefined) {
10745
- const _errs67 = errors;
10746
- if ("Records" !== data.interface) {
10747
- const err51 = { instancePath: instancePath + "/interface", schemaPath: "https://identity.foundation/dwn/json-schemas/permissions/scopes.json#/$defs/records-write-scope/properties/interface/const", keyword: "const", params: { allowedValue: "Records" }, message: "must be equal to constant" };
10748
- if (vErrors === null) {
10749
- vErrors = [err51];
10750
- }
10751
- else {
10752
- vErrors.push(err51);
10753
- }
10754
- errors++;
10755
- }
10756
- var valid16 = _errs67 === errors;
10757
- }
10758
- else {
10759
- var valid16 = true;
10760
- }
10761
- if (valid16) {
10762
- if (data.method !== undefined) {
10763
- const _errs68 = errors;
10764
- if ("Write" !== data.method) {
10765
- const err52 = { instancePath: instancePath + "/method", schemaPath: "https://identity.foundation/dwn/json-schemas/permissions/scopes.json#/$defs/records-write-scope/properties/method/const", keyword: "const", params: { allowedValue: "Write" }, message: "must be equal to constant" };
10766
- if (vErrors === null) {
10767
- vErrors = [err52];
10768
- }
10769
- else {
10770
- vErrors.push(err52);
10771
- }
10772
- errors++;
10773
- }
10774
- var valid16 = _errs68 === errors;
10775
- }
10776
- else {
10777
- var valid16 = true;
10778
- }
10779
- if (valid16) {
10780
- if (data.protocol !== undefined) {
10781
- const _errs69 = errors;
10782
- if (typeof data.protocol !== "string") {
10783
- const err53 = { instancePath: instancePath + "/protocol", schemaPath: "https://identity.foundation/dwn/json-schemas/permissions/scopes.json#/$defs/records-write-scope/properties/protocol/type", keyword: "type", params: { type: "string" }, message: "must be string" };
10784
- if (vErrors === null) {
10785
- vErrors = [err53];
10786
- }
10787
- else {
10788
- vErrors.push(err53);
10789
- }
10790
- errors++;
10791
- }
10792
- var valid16 = _errs69 === errors;
10793
- }
10794
- else {
10795
- var valid16 = true;
10796
- }
10797
- if (valid16) {
10798
- if (data.contextId !== undefined) {
10799
- let data24 = data.contextId;
10800
- const _errs71 = errors;
10801
- if (errors === _errs71) {
10802
- if (typeof data24 === "string") {
10803
- if (func1(data24) > 600) {
10804
- const err54 = { instancePath: instancePath + "/contextId", schemaPath: "https://identity.foundation/dwn/json-schemas/permissions/scopes.json#/$defs/records-write-scope/properties/contextId/maxLength", keyword: "maxLength", params: { limit: 600 }, message: "must NOT have more than 600 characters" };
10805
- if (vErrors === null) {
10806
- vErrors = [err54];
10807
- }
10808
- else {
10809
- vErrors.push(err54);
10810
- }
10811
- errors++;
10812
- }
10813
- }
10814
- else {
10815
- const err55 = { instancePath: instancePath + "/contextId", schemaPath: "https://identity.foundation/dwn/json-schemas/permissions/scopes.json#/$defs/records-write-scope/properties/contextId/type", keyword: "type", params: { type: "string" }, message: "must be string" };
10816
- if (vErrors === null) {
10817
- vErrors = [err55];
10818
- }
10819
- else {
10820
- vErrors.push(err55);
10821
- }
10822
- errors++;
10823
- }
10824
- }
10825
- var valid16 = _errs71 === errors;
10826
- }
10827
- else {
10828
- var valid16 = true;
10829
- }
10830
- if (valid16) {
10831
- if (data.protocolPath !== undefined) {
10832
- let data25 = data.protocolPath;
10833
- const _errs73 = errors;
10834
- if (errors === _errs73) {
10835
- if (typeof data25 === "string") {
10836
- if (func1(data25) > 600) {
10837
- const err56 = { instancePath: instancePath + "/protocolPath", schemaPath: "https://identity.foundation/dwn/json-schemas/permissions/scopes.json#/$defs/records-write-scope/properties/protocolPath/maxLength", keyword: "maxLength", params: { limit: 600 }, message: "must NOT have more than 600 characters" };
10838
- if (vErrors === null) {
10839
- vErrors = [err56];
10840
- }
10841
- else {
10842
- vErrors.push(err56);
10843
- }
10844
- errors++;
10845
- }
10846
- }
10847
- else {
10848
- const err57 = { instancePath: instancePath + "/protocolPath", schemaPath: "https://identity.foundation/dwn/json-schemas/permissions/scopes.json#/$defs/records-write-scope/properties/protocolPath/type", keyword: "type", params: { type: "string" }, message: "must be string" };
10849
- if (vErrors === null) {
10850
- vErrors = [err57];
10851
- }
10852
- else {
10853
- vErrors.push(err57);
10854
- }
10855
- errors++;
10856
- }
10857
- }
10858
- var valid16 = _errs73 === errors;
10859
- }
10860
- else {
10861
- var valid16 = true;
10862
- }
10863
- }
10864
- }
10865
- }
10866
- }
9770
+ else {
9771
+ var valid10 = true;
10867
9772
  }
10868
9773
  }
10869
9774
  }
9775
+ }
9776
+ }
9777
+ }
9778
+ else {
9779
+ const err28 = { instancePath, schemaPath: "https://identity.foundation/dwn/json-schemas/permissions/scopes.json#/$defs/protocols-query-scope/type", keyword: "type", params: { type: "object" }, message: "must be object" };
9780
+ if (vErrors === null) {
9781
+ vErrors = [err28];
9782
+ }
9783
+ else {
9784
+ vErrors.push(err28);
9785
+ }
9786
+ errors++;
9787
+ }
9788
+ }
9789
+ var _valid0 = _errs31 === errors;
9790
+ if (_valid0 && valid0) {
9791
+ valid0 = false;
9792
+ passing0 = [passing0, 2];
9793
+ }
9794
+ else {
9795
+ if (_valid0) {
9796
+ valid0 = true;
9797
+ passing0 = 2;
9798
+ if (props0 !== true) {
9799
+ props0 = true;
9800
+ }
9801
+ }
9802
+ const _errs39 = errors;
9803
+ const _errs40 = errors;
9804
+ if (errors === _errs40) {
9805
+ if (data && typeof data == "object" && !Array.isArray(data)) {
9806
+ let missing7;
9807
+ if ((((data.interface === undefined) && (missing7 = "interface")) || ((data.method === undefined) && (missing7 = "method"))) || ((data.protocol === undefined) && (missing7 = "protocol"))) {
9808
+ const err29 = { instancePath, schemaPath: "https://identity.foundation/dwn/json-schemas/permissions/scopes.json#/$defs/records-read-scope/required", keyword: "required", params: { missingProperty: missing7 }, message: "must have required property '" + missing7 + "'" };
9809
+ if (vErrors === null) {
9810
+ vErrors = [err29];
9811
+ }
10870
9812
  else {
10871
- const err58 = { instancePath, schemaPath: "https://identity.foundation/dwn/json-schemas/permissions/scopes.json#/$defs/records-write-scope/type", keyword: "type", params: { type: "object" }, message: "must be object" };
10872
- if (vErrors === null) {
10873
- vErrors = [err58];
10874
- }
10875
- else {
10876
- vErrors.push(err58);
10877
- }
10878
- errors++;
9813
+ vErrors.push(err29);
10879
9814
  }
10880
- }
10881
- var _valid0 = _errs63 === errors;
10882
- if (_valid0 && valid0) {
10883
- valid0 = false;
10884
- passing0 = [passing0, 5];
9815
+ errors++;
10885
9816
  }
10886
9817
  else {
10887
- if (_valid0) {
10888
- valid0 = true;
10889
- passing0 = 5;
10890
- if (props0 !== true) {
10891
- props0 = true;
9818
+ const _errs42 = errors;
9819
+ for (const key3 in data) {
9820
+ if (!(((((key3 === "interface") || (key3 === "method")) || (key3 === "protocol")) || (key3 === "contextId")) || (key3 === "protocolPath"))) {
9821
+ const err30 = { instancePath, schemaPath: "https://identity.foundation/dwn/json-schemas/permissions/scopes.json#/$defs/records-read-scope/additionalProperties", keyword: "additionalProperties", params: { additionalProperty: key3 }, message: "must NOT have additional properties" };
9822
+ if (vErrors === null) {
9823
+ vErrors = [err30];
9824
+ }
9825
+ else {
9826
+ vErrors.push(err30);
9827
+ }
9828
+ errors++;
9829
+ break;
10892
9830
  }
10893
9831
  }
10894
- const _errs75 = errors;
10895
- const _errs76 = errors;
10896
- if (errors === _errs76) {
10897
- if (data && typeof data == "object" && !Array.isArray(data)) {
10898
- let missing10;
10899
- if ((((data.interface === undefined) && (missing10 = "interface")) || ((data.method === undefined) && (missing10 = "method"))) || ((data.protocol === undefined) && (missing10 = "protocol"))) {
10900
- const err59 = { instancePath, schemaPath: "https://identity.foundation/dwn/json-schemas/permissions/scopes.json#/$defs/records-query-scope/required", keyword: "required", params: { missingProperty: missing10 }, message: "must have required property '" + missing10 + "'" };
9832
+ if (_errs42 === errors) {
9833
+ if (data.interface !== undefined) {
9834
+ const _errs43 = errors;
9835
+ if ("Records" !== data.interface) {
9836
+ const err31 = { instancePath: instancePath + "/interface", schemaPath: "https://identity.foundation/dwn/json-schemas/permissions/scopes.json#/$defs/records-read-scope/properties/interface/const", keyword: "const", params: { allowedValue: "Records" }, message: "must be equal to constant" };
10901
9837
  if (vErrors === null) {
10902
- vErrors = [err59];
9838
+ vErrors = [err31];
10903
9839
  }
10904
9840
  else {
10905
- vErrors.push(err59);
9841
+ vErrors.push(err31);
10906
9842
  }
10907
9843
  errors++;
10908
9844
  }
9845
+ var valid12 = _errs43 === errors;
9846
+ }
9847
+ else {
9848
+ var valid12 = true;
9849
+ }
9850
+ if (valid12) {
9851
+ if (data.method !== undefined) {
9852
+ const _errs44 = errors;
9853
+ if ("Read" !== data.method) {
9854
+ const err32 = { instancePath: instancePath + "/method", schemaPath: "https://identity.foundation/dwn/json-schemas/permissions/scopes.json#/$defs/records-read-scope/properties/method/const", keyword: "const", params: { allowedValue: "Read" }, message: "must be equal to constant" };
9855
+ if (vErrors === null) {
9856
+ vErrors = [err32];
9857
+ }
9858
+ else {
9859
+ vErrors.push(err32);
9860
+ }
9861
+ errors++;
9862
+ }
9863
+ var valid12 = _errs44 === errors;
9864
+ }
10909
9865
  else {
10910
- const _errs78 = errors;
10911
- for (const key6 in data) {
10912
- if (!(((((key6 === "interface") || (key6 === "method")) || (key6 === "protocol")) || (key6 === "contextId")) || (key6 === "protocolPath"))) {
10913
- const err60 = { instancePath, schemaPath: "https://identity.foundation/dwn/json-schemas/permissions/scopes.json#/$defs/records-query-scope/additionalProperties", keyword: "additionalProperties", params: { additionalProperty: key6 }, message: "must NOT have additional properties" };
9866
+ var valid12 = true;
9867
+ }
9868
+ if (valid12) {
9869
+ if (data.protocol !== undefined) {
9870
+ const _errs45 = errors;
9871
+ if (typeof data.protocol !== "string") {
9872
+ const err33 = { instancePath: instancePath + "/protocol", schemaPath: "https://identity.foundation/dwn/json-schemas/permissions/scopes.json#/$defs/records-read-scope/properties/protocol/type", keyword: "type", params: { type: "string" }, message: "must be string" };
10914
9873
  if (vErrors === null) {
10915
- vErrors = [err60];
9874
+ vErrors = [err33];
10916
9875
  }
10917
9876
  else {
10918
- vErrors.push(err60);
9877
+ vErrors.push(err33);
10919
9878
  }
10920
9879
  errors++;
10921
- break;
10922
9880
  }
9881
+ var valid12 = _errs45 === errors;
10923
9882
  }
10924
- if (_errs78 === errors) {
10925
- if (data.interface !== undefined) {
10926
- const _errs79 = errors;
10927
- if ("Records" !== data.interface) {
10928
- const err61 = { instancePath: instancePath + "/interface", schemaPath: "https://identity.foundation/dwn/json-schemas/permissions/scopes.json#/$defs/records-query-scope/properties/interface/const", keyword: "const", params: { allowedValue: "Records" }, message: "must be equal to constant" };
10929
- if (vErrors === null) {
10930
- vErrors = [err61];
9883
+ else {
9884
+ var valid12 = true;
9885
+ }
9886
+ if (valid12) {
9887
+ if (data.contextId !== undefined) {
9888
+ let data14 = data.contextId;
9889
+ const _errs47 = errors;
9890
+ if (errors === _errs47) {
9891
+ if (typeof data14 === "string") {
9892
+ if (func1(data14) > 600) {
9893
+ const err34 = { instancePath: instancePath + "/contextId", schemaPath: "https://identity.foundation/dwn/json-schemas/permissions/scopes.json#/$defs/records-read-scope/properties/contextId/maxLength", keyword: "maxLength", params: { limit: 600 }, message: "must NOT have more than 600 characters" };
9894
+ if (vErrors === null) {
9895
+ vErrors = [err34];
9896
+ }
9897
+ else {
9898
+ vErrors.push(err34);
9899
+ }
9900
+ errors++;
9901
+ }
10931
9902
  }
10932
9903
  else {
10933
- vErrors.push(err61);
10934
- }
10935
- errors++;
10936
- }
10937
- var valid18 = _errs79 === errors;
10938
- }
10939
- else {
10940
- var valid18 = true;
10941
- }
10942
- if (valid18) {
10943
- if (data.method !== undefined) {
10944
- const _errs80 = errors;
10945
- if ("Query" !== data.method) {
10946
- const err62 = { instancePath: instancePath + "/method", schemaPath: "https://identity.foundation/dwn/json-schemas/permissions/scopes.json#/$defs/records-query-scope/properties/method/const", keyword: "const", params: { allowedValue: "Query" }, message: "must be equal to constant" };
9904
+ const err35 = { instancePath: instancePath + "/contextId", schemaPath: "https://identity.foundation/dwn/json-schemas/permissions/scopes.json#/$defs/records-read-scope/properties/contextId/type", keyword: "type", params: { type: "string" }, message: "must be string" };
10947
9905
  if (vErrors === null) {
10948
- vErrors = [err62];
9906
+ vErrors = [err35];
10949
9907
  }
10950
9908
  else {
10951
- vErrors.push(err62);
9909
+ vErrors.push(err35);
10952
9910
  }
10953
9911
  errors++;
10954
9912
  }
10955
- var valid18 = _errs80 === errors;
10956
- }
10957
- else {
10958
- var valid18 = true;
10959
9913
  }
10960
- if (valid18) {
10961
- if (data.protocol !== undefined) {
10962
- const _errs81 = errors;
10963
- if (typeof data.protocol !== "string") {
10964
- const err63 = { instancePath: instancePath + "/protocol", schemaPath: "https://identity.foundation/dwn/json-schemas/permissions/scopes.json#/$defs/records-query-scope/properties/protocol/type", keyword: "type", params: { type: "string" }, message: "must be string" };
10965
- if (vErrors === null) {
10966
- vErrors = [err63];
10967
- }
10968
- else {
10969
- vErrors.push(err63);
10970
- }
10971
- errors++;
10972
- }
10973
- var valid18 = _errs81 === errors;
10974
- }
10975
- else {
10976
- var valid18 = true;
10977
- }
10978
- if (valid18) {
10979
- if (data.contextId !== undefined) {
10980
- let data29 = data.contextId;
10981
- const _errs83 = errors;
10982
- if (errors === _errs83) {
10983
- if (typeof data29 === "string") {
10984
- if (func1(data29) > 600) {
10985
- const err64 = { instancePath: instancePath + "/contextId", schemaPath: "https://identity.foundation/dwn/json-schemas/permissions/scopes.json#/$defs/records-query-scope/properties/contextId/maxLength", keyword: "maxLength", params: { limit: 600 }, message: "must NOT have more than 600 characters" };
10986
- if (vErrors === null) {
10987
- vErrors = [err64];
10988
- }
10989
- else {
10990
- vErrors.push(err64);
10991
- }
10992
- errors++;
10993
- }
9914
+ var valid12 = _errs47 === errors;
9915
+ }
9916
+ else {
9917
+ var valid12 = true;
9918
+ }
9919
+ if (valid12) {
9920
+ if (data.protocolPath !== undefined) {
9921
+ let data15 = data.protocolPath;
9922
+ const _errs49 = errors;
9923
+ if (errors === _errs49) {
9924
+ if (typeof data15 === "string") {
9925
+ if (func1(data15) > 600) {
9926
+ const err36 = { instancePath: instancePath + "/protocolPath", schemaPath: "https://identity.foundation/dwn/json-schemas/permissions/scopes.json#/$defs/records-read-scope/properties/protocolPath/maxLength", keyword: "maxLength", params: { limit: 600 }, message: "must NOT have more than 600 characters" };
9927
+ if (vErrors === null) {
9928
+ vErrors = [err36];
10994
9929
  }
10995
9930
  else {
10996
- const err65 = { instancePath: instancePath + "/contextId", schemaPath: "https://identity.foundation/dwn/json-schemas/permissions/scopes.json#/$defs/records-query-scope/properties/contextId/type", keyword: "type", params: { type: "string" }, message: "must be string" };
10997
- if (vErrors === null) {
10998
- vErrors = [err65];
10999
- }
11000
- else {
11001
- vErrors.push(err65);
11002
- }
11003
- errors++;
9931
+ vErrors.push(err36);
11004
9932
  }
9933
+ errors++;
11005
9934
  }
11006
- var valid18 = _errs83 === errors;
11007
9935
  }
11008
9936
  else {
11009
- var valid18 = true;
11010
- }
11011
- if (valid18) {
11012
- if (data.protocolPath !== undefined) {
11013
- let data30 = data.protocolPath;
11014
- const _errs85 = errors;
11015
- if (errors === _errs85) {
11016
- if (typeof data30 === "string") {
11017
- if (func1(data30) > 600) {
11018
- const err66 = { instancePath: instancePath + "/protocolPath", schemaPath: "https://identity.foundation/dwn/json-schemas/permissions/scopes.json#/$defs/records-query-scope/properties/protocolPath/maxLength", keyword: "maxLength", params: { limit: 600 }, message: "must NOT have more than 600 characters" };
11019
- if (vErrors === null) {
11020
- vErrors = [err66];
11021
- }
11022
- else {
11023
- vErrors.push(err66);
11024
- }
11025
- errors++;
11026
- }
11027
- }
11028
- else {
11029
- const err67 = { instancePath: instancePath + "/protocolPath", schemaPath: "https://identity.foundation/dwn/json-schemas/permissions/scopes.json#/$defs/records-query-scope/properties/protocolPath/type", keyword: "type", params: { type: "string" }, message: "must be string" };
11030
- if (vErrors === null) {
11031
- vErrors = [err67];
11032
- }
11033
- else {
11034
- vErrors.push(err67);
11035
- }
11036
- errors++;
11037
- }
11038
- }
11039
- var valid18 = _errs85 === errors;
9937
+ const err37 = { instancePath: instancePath + "/protocolPath", schemaPath: "https://identity.foundation/dwn/json-schemas/permissions/scopes.json#/$defs/records-read-scope/properties/protocolPath/type", keyword: "type", params: { type: "string" }, message: "must be string" };
9938
+ if (vErrors === null) {
9939
+ vErrors = [err37];
11040
9940
  }
11041
9941
  else {
11042
- var valid18 = true;
9942
+ vErrors.push(err37);
11043
9943
  }
9944
+ errors++;
11044
9945
  }
11045
9946
  }
9947
+ var valid12 = _errs49 === errors;
9948
+ }
9949
+ else {
9950
+ var valid12 = true;
11046
9951
  }
11047
9952
  }
11048
9953
  }
11049
9954
  }
11050
9955
  }
9956
+ }
9957
+ }
9958
+ }
9959
+ else {
9960
+ const err38 = { instancePath, schemaPath: "https://identity.foundation/dwn/json-schemas/permissions/scopes.json#/$defs/records-read-scope/type", keyword: "type", params: { type: "object" }, message: "must be object" };
9961
+ if (vErrors === null) {
9962
+ vErrors = [err38];
9963
+ }
9964
+ else {
9965
+ vErrors.push(err38);
9966
+ }
9967
+ errors++;
9968
+ }
9969
+ }
9970
+ var _valid0 = _errs39 === errors;
9971
+ if (_valid0 && valid0) {
9972
+ valid0 = false;
9973
+ passing0 = [passing0, 3];
9974
+ }
9975
+ else {
9976
+ if (_valid0) {
9977
+ valid0 = true;
9978
+ passing0 = 3;
9979
+ if (props0 !== true) {
9980
+ props0 = true;
9981
+ }
9982
+ }
9983
+ const _errs51 = errors;
9984
+ const _errs52 = errors;
9985
+ if (errors === _errs52) {
9986
+ if (data && typeof data == "object" && !Array.isArray(data)) {
9987
+ let missing8;
9988
+ if ((((data.interface === undefined) && (missing8 = "interface")) || ((data.method === undefined) && (missing8 = "method"))) || ((data.protocol === undefined) && (missing8 = "protocol"))) {
9989
+ const err39 = { instancePath, schemaPath: "https://identity.foundation/dwn/json-schemas/permissions/scopes.json#/$defs/records-delete-scope/required", keyword: "required", params: { missingProperty: missing8 }, message: "must have required property '" + missing8 + "'" };
9990
+ if (vErrors === null) {
9991
+ vErrors = [err39];
9992
+ }
11051
9993
  else {
11052
- const err68 = { instancePath, schemaPath: "https://identity.foundation/dwn/json-schemas/permissions/scopes.json#/$defs/records-query-scope/type", keyword: "type", params: { type: "object" }, message: "must be object" };
11053
- if (vErrors === null) {
11054
- vErrors = [err68];
11055
- }
11056
- else {
11057
- vErrors.push(err68);
11058
- }
11059
- errors++;
9994
+ vErrors.push(err39);
11060
9995
  }
11061
- }
11062
- var _valid0 = _errs75 === errors;
11063
- if (_valid0 && valid0) {
11064
- valid0 = false;
11065
- passing0 = [passing0, 6];
9996
+ errors++;
11066
9997
  }
11067
9998
  else {
11068
- if (_valid0) {
11069
- valid0 = true;
11070
- passing0 = 6;
11071
- if (props0 !== true) {
11072
- props0 = true;
9999
+ const _errs54 = errors;
10000
+ for (const key4 in data) {
10001
+ if (!(((((key4 === "interface") || (key4 === "method")) || (key4 === "protocol")) || (key4 === "contextId")) || (key4 === "protocolPath"))) {
10002
+ const err40 = { instancePath, schemaPath: "https://identity.foundation/dwn/json-schemas/permissions/scopes.json#/$defs/records-delete-scope/additionalProperties", keyword: "additionalProperties", params: { additionalProperty: key4 }, message: "must NOT have additional properties" };
10003
+ if (vErrors === null) {
10004
+ vErrors = [err40];
10005
+ }
10006
+ else {
10007
+ vErrors.push(err40);
10008
+ }
10009
+ errors++;
10010
+ break;
11073
10011
  }
11074
10012
  }
11075
- const _errs87 = errors;
11076
- const _errs88 = errors;
11077
- if (errors === _errs88) {
11078
- if (data && typeof data == "object" && !Array.isArray(data)) {
11079
- let missing11;
11080
- if ((((data.interface === undefined) && (missing11 = "interface")) || ((data.method === undefined) && (missing11 = "method"))) || ((data.protocol === undefined) && (missing11 = "protocol"))) {
11081
- const err69 = { instancePath, schemaPath: "https://identity.foundation/dwn/json-schemas/permissions/scopes.json#/$defs/records-subscribe-scope/required", keyword: "required", params: { missingProperty: missing11 }, message: "must have required property '" + missing11 + "'" };
10013
+ if (_errs54 === errors) {
10014
+ if (data.interface !== undefined) {
10015
+ const _errs55 = errors;
10016
+ if ("Records" !== data.interface) {
10017
+ const err41 = { instancePath: instancePath + "/interface", schemaPath: "https://identity.foundation/dwn/json-schemas/permissions/scopes.json#/$defs/records-delete-scope/properties/interface/const", keyword: "const", params: { allowedValue: "Records" }, message: "must be equal to constant" };
11082
10018
  if (vErrors === null) {
11083
- vErrors = [err69];
10019
+ vErrors = [err41];
11084
10020
  }
11085
10021
  else {
11086
- vErrors.push(err69);
10022
+ vErrors.push(err41);
11087
10023
  }
11088
10024
  errors++;
11089
10025
  }
10026
+ var valid14 = _errs55 === errors;
10027
+ }
10028
+ else {
10029
+ var valid14 = true;
10030
+ }
10031
+ if (valid14) {
10032
+ if (data.method !== undefined) {
10033
+ const _errs56 = errors;
10034
+ if ("Delete" !== data.method) {
10035
+ const err42 = { instancePath: instancePath + "/method", schemaPath: "https://identity.foundation/dwn/json-schemas/permissions/scopes.json#/$defs/records-delete-scope/properties/method/const", keyword: "const", params: { allowedValue: "Delete" }, message: "must be equal to constant" };
10036
+ if (vErrors === null) {
10037
+ vErrors = [err42];
10038
+ }
10039
+ else {
10040
+ vErrors.push(err42);
10041
+ }
10042
+ errors++;
10043
+ }
10044
+ var valid14 = _errs56 === errors;
10045
+ }
11090
10046
  else {
11091
- const _errs90 = errors;
11092
- for (const key7 in data) {
11093
- if (!(((((key7 === "interface") || (key7 === "method")) || (key7 === "protocol")) || (key7 === "contextId")) || (key7 === "protocolPath"))) {
11094
- const err70 = { instancePath, schemaPath: "https://identity.foundation/dwn/json-schemas/permissions/scopes.json#/$defs/records-subscribe-scope/additionalProperties", keyword: "additionalProperties", params: { additionalProperty: key7 }, message: "must NOT have additional properties" };
10047
+ var valid14 = true;
10048
+ }
10049
+ if (valid14) {
10050
+ if (data.protocol !== undefined) {
10051
+ const _errs57 = errors;
10052
+ if (typeof data.protocol !== "string") {
10053
+ const err43 = { instancePath: instancePath + "/protocol", schemaPath: "https://identity.foundation/dwn/json-schemas/permissions/scopes.json#/$defs/records-delete-scope/properties/protocol/type", keyword: "type", params: { type: "string" }, message: "must be string" };
11095
10054
  if (vErrors === null) {
11096
- vErrors = [err70];
10055
+ vErrors = [err43];
11097
10056
  }
11098
10057
  else {
11099
- vErrors.push(err70);
10058
+ vErrors.push(err43);
11100
10059
  }
11101
10060
  errors++;
11102
- break;
11103
10061
  }
10062
+ var valid14 = _errs57 === errors;
11104
10063
  }
11105
- if (_errs90 === errors) {
11106
- if (data.interface !== undefined) {
11107
- const _errs91 = errors;
11108
- if ("Records" !== data.interface) {
11109
- const err71 = { instancePath: instancePath + "/interface", schemaPath: "https://identity.foundation/dwn/json-schemas/permissions/scopes.json#/$defs/records-subscribe-scope/properties/interface/const", keyword: "const", params: { allowedValue: "Records" }, message: "must be equal to constant" };
11110
- if (vErrors === null) {
11111
- vErrors = [err71];
10064
+ else {
10065
+ var valid14 = true;
10066
+ }
10067
+ if (valid14) {
10068
+ if (data.contextId !== undefined) {
10069
+ let data19 = data.contextId;
10070
+ const _errs59 = errors;
10071
+ if (errors === _errs59) {
10072
+ if (typeof data19 === "string") {
10073
+ if (func1(data19) > 600) {
10074
+ const err44 = { instancePath: instancePath + "/contextId", schemaPath: "https://identity.foundation/dwn/json-schemas/permissions/scopes.json#/$defs/records-delete-scope/properties/contextId/maxLength", keyword: "maxLength", params: { limit: 600 }, message: "must NOT have more than 600 characters" };
10075
+ if (vErrors === null) {
10076
+ vErrors = [err44];
10077
+ }
10078
+ else {
10079
+ vErrors.push(err44);
10080
+ }
10081
+ errors++;
10082
+ }
11112
10083
  }
11113
10084
  else {
11114
- vErrors.push(err71);
11115
- }
11116
- errors++;
11117
- }
11118
- var valid20 = _errs91 === errors;
11119
- }
11120
- else {
11121
- var valid20 = true;
11122
- }
11123
- if (valid20) {
11124
- if (data.method !== undefined) {
11125
- const _errs92 = errors;
11126
- if ("Subscribe" !== data.method) {
11127
- const err72 = { instancePath: instancePath + "/method", schemaPath: "https://identity.foundation/dwn/json-schemas/permissions/scopes.json#/$defs/records-subscribe-scope/properties/method/const", keyword: "const", params: { allowedValue: "Subscribe" }, message: "must be equal to constant" };
10085
+ const err45 = { instancePath: instancePath + "/contextId", schemaPath: "https://identity.foundation/dwn/json-schemas/permissions/scopes.json#/$defs/records-delete-scope/properties/contextId/type", keyword: "type", params: { type: "string" }, message: "must be string" };
11128
10086
  if (vErrors === null) {
11129
- vErrors = [err72];
10087
+ vErrors = [err45];
11130
10088
  }
11131
10089
  else {
11132
- vErrors.push(err72);
10090
+ vErrors.push(err45);
11133
10091
  }
11134
10092
  errors++;
11135
10093
  }
11136
- var valid20 = _errs92 === errors;
11137
- }
11138
- else {
11139
- var valid20 = true;
11140
10094
  }
11141
- if (valid20) {
11142
- if (data.protocol !== undefined) {
11143
- const _errs93 = errors;
11144
- if (typeof data.protocol !== "string") {
11145
- const err73 = { instancePath: instancePath + "/protocol", schemaPath: "https://identity.foundation/dwn/json-schemas/permissions/scopes.json#/$defs/records-subscribe-scope/properties/protocol/type", keyword: "type", params: { type: "string" }, message: "must be string" };
11146
- if (vErrors === null) {
11147
- vErrors = [err73];
11148
- }
11149
- else {
11150
- vErrors.push(err73);
11151
- }
11152
- errors++;
11153
- }
11154
- var valid20 = _errs93 === errors;
11155
- }
11156
- else {
11157
- var valid20 = true;
11158
- }
11159
- if (valid20) {
11160
- if (data.contextId !== undefined) {
11161
- let data34 = data.contextId;
11162
- const _errs95 = errors;
11163
- if (errors === _errs95) {
11164
- if (typeof data34 === "string") {
11165
- if (func1(data34) > 600) {
11166
- const err74 = { instancePath: instancePath + "/contextId", schemaPath: "https://identity.foundation/dwn/json-schemas/permissions/scopes.json#/$defs/records-subscribe-scope/properties/contextId/maxLength", keyword: "maxLength", params: { limit: 600 }, message: "must NOT have more than 600 characters" };
11167
- if (vErrors === null) {
11168
- vErrors = [err74];
11169
- }
11170
- else {
11171
- vErrors.push(err74);
11172
- }
11173
- errors++;
11174
- }
10095
+ var valid14 = _errs59 === errors;
10096
+ }
10097
+ else {
10098
+ var valid14 = true;
10099
+ }
10100
+ if (valid14) {
10101
+ if (data.protocolPath !== undefined) {
10102
+ let data20 = data.protocolPath;
10103
+ const _errs61 = errors;
10104
+ if (errors === _errs61) {
10105
+ if (typeof data20 === "string") {
10106
+ if (func1(data20) > 600) {
10107
+ const err46 = { instancePath: instancePath + "/protocolPath", schemaPath: "https://identity.foundation/dwn/json-schemas/permissions/scopes.json#/$defs/records-delete-scope/properties/protocolPath/maxLength", keyword: "maxLength", params: { limit: 600 }, message: "must NOT have more than 600 characters" };
10108
+ if (vErrors === null) {
10109
+ vErrors = [err46];
11175
10110
  }
11176
10111
  else {
11177
- const err75 = { instancePath: instancePath + "/contextId", schemaPath: "https://identity.foundation/dwn/json-schemas/permissions/scopes.json#/$defs/records-subscribe-scope/properties/contextId/type", keyword: "type", params: { type: "string" }, message: "must be string" };
11178
- if (vErrors === null) {
11179
- vErrors = [err75];
11180
- }
11181
- else {
11182
- vErrors.push(err75);
11183
- }
11184
- errors++;
10112
+ vErrors.push(err46);
11185
10113
  }
10114
+ errors++;
11186
10115
  }
11187
- var valid20 = _errs95 === errors;
11188
10116
  }
11189
10117
  else {
11190
- var valid20 = true;
11191
- }
11192
- if (valid20) {
11193
- if (data.protocolPath !== undefined) {
11194
- let data35 = data.protocolPath;
11195
- const _errs97 = errors;
11196
- if (errors === _errs97) {
11197
- if (typeof data35 === "string") {
11198
- if (func1(data35) > 600) {
11199
- const err76 = { instancePath: instancePath + "/protocolPath", schemaPath: "https://identity.foundation/dwn/json-schemas/permissions/scopes.json#/$defs/records-subscribe-scope/properties/protocolPath/maxLength", keyword: "maxLength", params: { limit: 600 }, message: "must NOT have more than 600 characters" };
11200
- if (vErrors === null) {
11201
- vErrors = [err76];
11202
- }
11203
- else {
11204
- vErrors.push(err76);
11205
- }
11206
- errors++;
11207
- }
11208
- }
11209
- else {
11210
- const err77 = { instancePath: instancePath + "/protocolPath", schemaPath: "https://identity.foundation/dwn/json-schemas/permissions/scopes.json#/$defs/records-subscribe-scope/properties/protocolPath/type", keyword: "type", params: { type: "string" }, message: "must be string" };
11211
- if (vErrors === null) {
11212
- vErrors = [err77];
11213
- }
11214
- else {
11215
- vErrors.push(err77);
11216
- }
11217
- errors++;
11218
- }
11219
- }
11220
- var valid20 = _errs97 === errors;
10118
+ const err47 = { instancePath: instancePath + "/protocolPath", schemaPath: "https://identity.foundation/dwn/json-schemas/permissions/scopes.json#/$defs/records-delete-scope/properties/protocolPath/type", keyword: "type", params: { type: "string" }, message: "must be string" };
10119
+ if (vErrors === null) {
10120
+ vErrors = [err47];
11221
10121
  }
11222
10122
  else {
11223
- var valid20 = true;
10123
+ vErrors.push(err47);
11224
10124
  }
10125
+ errors++;
11225
10126
  }
11226
10127
  }
10128
+ var valid14 = _errs61 === errors;
10129
+ }
10130
+ else {
10131
+ var valid14 = true;
11227
10132
  }
11228
10133
  }
11229
10134
  }
11230
10135
  }
11231
10136
  }
10137
+ }
10138
+ }
10139
+ }
10140
+ else {
10141
+ const err48 = { instancePath, schemaPath: "https://identity.foundation/dwn/json-schemas/permissions/scopes.json#/$defs/records-delete-scope/type", keyword: "type", params: { type: "object" }, message: "must be object" };
10142
+ if (vErrors === null) {
10143
+ vErrors = [err48];
10144
+ }
10145
+ else {
10146
+ vErrors.push(err48);
10147
+ }
10148
+ errors++;
10149
+ }
10150
+ }
10151
+ var _valid0 = _errs51 === errors;
10152
+ if (_valid0 && valid0) {
10153
+ valid0 = false;
10154
+ passing0 = [passing0, 4];
10155
+ }
10156
+ else {
10157
+ if (_valid0) {
10158
+ valid0 = true;
10159
+ passing0 = 4;
10160
+ if (props0 !== true) {
10161
+ props0 = true;
10162
+ }
10163
+ }
10164
+ const _errs63 = errors;
10165
+ const _errs64 = errors;
10166
+ if (errors === _errs64) {
10167
+ if (data && typeof data == "object" && !Array.isArray(data)) {
10168
+ let missing9;
10169
+ if ((((data.interface === undefined) && (missing9 = "interface")) || ((data.method === undefined) && (missing9 = "method"))) || ((data.protocol === undefined) && (missing9 = "protocol"))) {
10170
+ const err49 = { instancePath, schemaPath: "https://identity.foundation/dwn/json-schemas/permissions/scopes.json#/$defs/records-write-scope/required", keyword: "required", params: { missingProperty: missing9 }, message: "must have required property '" + missing9 + "'" };
10171
+ if (vErrors === null) {
10172
+ vErrors = [err49];
10173
+ }
11232
10174
  else {
11233
- const err78 = { instancePath, schemaPath: "https://identity.foundation/dwn/json-schemas/permissions/scopes.json#/$defs/records-subscribe-scope/type", keyword: "type", params: { type: "object" }, message: "must be object" };
11234
- if (vErrors === null) {
11235
- vErrors = [err78];
11236
- }
11237
- else {
11238
- vErrors.push(err78);
11239
- }
11240
- errors++;
10175
+ vErrors.push(err49);
11241
10176
  }
11242
- }
11243
- var _valid0 = _errs87 === errors;
11244
- if (_valid0 && valid0) {
11245
- valid0 = false;
11246
- passing0 = [passing0, 7];
10177
+ errors++;
11247
10178
  }
11248
10179
  else {
11249
- if (_valid0) {
11250
- valid0 = true;
11251
- passing0 = 7;
11252
- if (props0 !== true) {
11253
- props0 = true;
10180
+ const _errs66 = errors;
10181
+ for (const key5 in data) {
10182
+ if (!(((((key5 === "interface") || (key5 === "method")) || (key5 === "protocol")) || (key5 === "contextId")) || (key5 === "protocolPath"))) {
10183
+ const err50 = { instancePath, schemaPath: "https://identity.foundation/dwn/json-schemas/permissions/scopes.json#/$defs/records-write-scope/additionalProperties", keyword: "additionalProperties", params: { additionalProperty: key5 }, message: "must NOT have additional properties" };
10184
+ if (vErrors === null) {
10185
+ vErrors = [err50];
10186
+ }
10187
+ else {
10188
+ vErrors.push(err50);
10189
+ }
10190
+ errors++;
10191
+ break;
11254
10192
  }
11255
10193
  }
11256
- const _errs99 = errors;
11257
- const _errs100 = errors;
11258
- if (errors === _errs100) {
11259
- if (data && typeof data == "object" && !Array.isArray(data)) {
11260
- let missing12;
11261
- if ((((data.interface === undefined) && (missing12 = "interface")) || ((data.method === undefined) && (missing12 = "method"))) || ((data.protocol === undefined) && (missing12 = "protocol"))) {
11262
- const err79 = { instancePath, schemaPath: "https://identity.foundation/dwn/json-schemas/permissions/scopes.json#/$defs/records-count-scope/required", keyword: "required", params: { missingProperty: missing12 }, message: "must have required property '" + missing12 + "'" };
10194
+ if (_errs66 === errors) {
10195
+ if (data.interface !== undefined) {
10196
+ const _errs67 = errors;
10197
+ if ("Records" !== data.interface) {
10198
+ const err51 = { instancePath: instancePath + "/interface", schemaPath: "https://identity.foundation/dwn/json-schemas/permissions/scopes.json#/$defs/records-write-scope/properties/interface/const", keyword: "const", params: { allowedValue: "Records" }, message: "must be equal to constant" };
11263
10199
  if (vErrors === null) {
11264
- vErrors = [err79];
10200
+ vErrors = [err51];
11265
10201
  }
11266
10202
  else {
11267
- vErrors.push(err79);
10203
+ vErrors.push(err51);
11268
10204
  }
11269
10205
  errors++;
11270
10206
  }
10207
+ var valid16 = _errs67 === errors;
10208
+ }
10209
+ else {
10210
+ var valid16 = true;
10211
+ }
10212
+ if (valid16) {
10213
+ if (data.method !== undefined) {
10214
+ const _errs68 = errors;
10215
+ if ("Write" !== data.method) {
10216
+ const err52 = { instancePath: instancePath + "/method", schemaPath: "https://identity.foundation/dwn/json-schemas/permissions/scopes.json#/$defs/records-write-scope/properties/method/const", keyword: "const", params: { allowedValue: "Write" }, message: "must be equal to constant" };
10217
+ if (vErrors === null) {
10218
+ vErrors = [err52];
10219
+ }
10220
+ else {
10221
+ vErrors.push(err52);
10222
+ }
10223
+ errors++;
10224
+ }
10225
+ var valid16 = _errs68 === errors;
10226
+ }
11271
10227
  else {
11272
- const _errs102 = errors;
11273
- for (const key8 in data) {
11274
- if (!(((((key8 === "interface") || (key8 === "method")) || (key8 === "protocol")) || (key8 === "contextId")) || (key8 === "protocolPath"))) {
11275
- const err80 = { instancePath, schemaPath: "https://identity.foundation/dwn/json-schemas/permissions/scopes.json#/$defs/records-count-scope/additionalProperties", keyword: "additionalProperties", params: { additionalProperty: key8 }, message: "must NOT have additional properties" };
10228
+ var valid16 = true;
10229
+ }
10230
+ if (valid16) {
10231
+ if (data.protocol !== undefined) {
10232
+ const _errs69 = errors;
10233
+ if (typeof data.protocol !== "string") {
10234
+ const err53 = { instancePath: instancePath + "/protocol", schemaPath: "https://identity.foundation/dwn/json-schemas/permissions/scopes.json#/$defs/records-write-scope/properties/protocol/type", keyword: "type", params: { type: "string" }, message: "must be string" };
11276
10235
  if (vErrors === null) {
11277
- vErrors = [err80];
10236
+ vErrors = [err53];
11278
10237
  }
11279
10238
  else {
11280
- vErrors.push(err80);
10239
+ vErrors.push(err53);
11281
10240
  }
11282
10241
  errors++;
11283
- break;
11284
10242
  }
10243
+ var valid16 = _errs69 === errors;
11285
10244
  }
11286
- if (_errs102 === errors) {
11287
- if (data.interface !== undefined) {
11288
- const _errs103 = errors;
11289
- if ("Records" !== data.interface) {
11290
- const err81 = { instancePath: instancePath + "/interface", schemaPath: "https://identity.foundation/dwn/json-schemas/permissions/scopes.json#/$defs/records-count-scope/properties/interface/const", keyword: "const", params: { allowedValue: "Records" }, message: "must be equal to constant" };
11291
- if (vErrors === null) {
11292
- vErrors = [err81];
10245
+ else {
10246
+ var valid16 = true;
10247
+ }
10248
+ if (valid16) {
10249
+ if (data.contextId !== undefined) {
10250
+ let data24 = data.contextId;
10251
+ const _errs71 = errors;
10252
+ if (errors === _errs71) {
10253
+ if (typeof data24 === "string") {
10254
+ if (func1(data24) > 600) {
10255
+ const err54 = { instancePath: instancePath + "/contextId", schemaPath: "https://identity.foundation/dwn/json-schemas/permissions/scopes.json#/$defs/records-write-scope/properties/contextId/maxLength", keyword: "maxLength", params: { limit: 600 }, message: "must NOT have more than 600 characters" };
10256
+ if (vErrors === null) {
10257
+ vErrors = [err54];
10258
+ }
10259
+ else {
10260
+ vErrors.push(err54);
10261
+ }
10262
+ errors++;
10263
+ }
11293
10264
  }
11294
10265
  else {
11295
- vErrors.push(err81);
11296
- }
11297
- errors++;
11298
- }
11299
- var valid22 = _errs103 === errors;
11300
- }
11301
- else {
11302
- var valid22 = true;
11303
- }
11304
- if (valid22) {
11305
- if (data.method !== undefined) {
11306
- const _errs104 = errors;
11307
- if ("Count" !== data.method) {
11308
- const err82 = { instancePath: instancePath + "/method", schemaPath: "https://identity.foundation/dwn/json-schemas/permissions/scopes.json#/$defs/records-count-scope/properties/method/const", keyword: "const", params: { allowedValue: "Count" }, message: "must be equal to constant" };
10266
+ const err55 = { instancePath: instancePath + "/contextId", schemaPath: "https://identity.foundation/dwn/json-schemas/permissions/scopes.json#/$defs/records-write-scope/properties/contextId/type", keyword: "type", params: { type: "string" }, message: "must be string" };
11309
10267
  if (vErrors === null) {
11310
- vErrors = [err82];
10268
+ vErrors = [err55];
11311
10269
  }
11312
10270
  else {
11313
- vErrors.push(err82);
10271
+ vErrors.push(err55);
11314
10272
  }
11315
10273
  errors++;
11316
10274
  }
11317
- var valid22 = _errs104 === errors;
11318
- }
11319
- else {
11320
- var valid22 = true;
11321
10275
  }
11322
- if (valid22) {
11323
- if (data.protocol !== undefined) {
11324
- const _errs105 = errors;
11325
- if (typeof data.protocol !== "string") {
11326
- const err83 = { instancePath: instancePath + "/protocol", schemaPath: "https://identity.foundation/dwn/json-schemas/permissions/scopes.json#/$defs/records-count-scope/properties/protocol/type", keyword: "type", params: { type: "string" }, message: "must be string" };
11327
- if (vErrors === null) {
11328
- vErrors = [err83];
11329
- }
11330
- else {
11331
- vErrors.push(err83);
11332
- }
11333
- errors++;
11334
- }
11335
- var valid22 = _errs105 === errors;
11336
- }
11337
- else {
11338
- var valid22 = true;
11339
- }
11340
- if (valid22) {
11341
- if (data.contextId !== undefined) {
11342
- let data39 = data.contextId;
11343
- const _errs107 = errors;
11344
- if (errors === _errs107) {
11345
- if (typeof data39 === "string") {
11346
- if (func1(data39) > 600) {
11347
- const err84 = { instancePath: instancePath + "/contextId", schemaPath: "https://identity.foundation/dwn/json-schemas/permissions/scopes.json#/$defs/records-count-scope/properties/contextId/maxLength", keyword: "maxLength", params: { limit: 600 }, message: "must NOT have more than 600 characters" };
11348
- if (vErrors === null) {
11349
- vErrors = [err84];
11350
- }
11351
- else {
11352
- vErrors.push(err84);
11353
- }
11354
- errors++;
11355
- }
10276
+ var valid16 = _errs71 === errors;
10277
+ }
10278
+ else {
10279
+ var valid16 = true;
10280
+ }
10281
+ if (valid16) {
10282
+ if (data.protocolPath !== undefined) {
10283
+ let data25 = data.protocolPath;
10284
+ const _errs73 = errors;
10285
+ if (errors === _errs73) {
10286
+ if (typeof data25 === "string") {
10287
+ if (func1(data25) > 600) {
10288
+ const err56 = { instancePath: instancePath + "/protocolPath", schemaPath: "https://identity.foundation/dwn/json-schemas/permissions/scopes.json#/$defs/records-write-scope/properties/protocolPath/maxLength", keyword: "maxLength", params: { limit: 600 }, message: "must NOT have more than 600 characters" };
10289
+ if (vErrors === null) {
10290
+ vErrors = [err56];
11356
10291
  }
11357
10292
  else {
11358
- const err85 = { instancePath: instancePath + "/contextId", schemaPath: "https://identity.foundation/dwn/json-schemas/permissions/scopes.json#/$defs/records-count-scope/properties/contextId/type", keyword: "type", params: { type: "string" }, message: "must be string" };
11359
- if (vErrors === null) {
11360
- vErrors = [err85];
11361
- }
11362
- else {
11363
- vErrors.push(err85);
11364
- }
11365
- errors++;
10293
+ vErrors.push(err56);
11366
10294
  }
10295
+ errors++;
11367
10296
  }
11368
- var valid22 = _errs107 === errors;
11369
10297
  }
11370
10298
  else {
11371
- var valid22 = true;
11372
- }
11373
- if (valid22) {
11374
- if (data.protocolPath !== undefined) {
11375
- let data40 = data.protocolPath;
11376
- const _errs109 = errors;
11377
- if (errors === _errs109) {
11378
- if (typeof data40 === "string") {
11379
- if (func1(data40) > 600) {
11380
- const err86 = { instancePath: instancePath + "/protocolPath", schemaPath: "https://identity.foundation/dwn/json-schemas/permissions/scopes.json#/$defs/records-count-scope/properties/protocolPath/maxLength", keyword: "maxLength", params: { limit: 600 }, message: "must NOT have more than 600 characters" };
11381
- if (vErrors === null) {
11382
- vErrors = [err86];
11383
- }
11384
- else {
11385
- vErrors.push(err86);
11386
- }
11387
- errors++;
11388
- }
11389
- }
11390
- else {
11391
- const err87 = { instancePath: instancePath + "/protocolPath", schemaPath: "https://identity.foundation/dwn/json-schemas/permissions/scopes.json#/$defs/records-count-scope/properties/protocolPath/type", keyword: "type", params: { type: "string" }, message: "must be string" };
11392
- if (vErrors === null) {
11393
- vErrors = [err87];
11394
- }
11395
- else {
11396
- vErrors.push(err87);
11397
- }
11398
- errors++;
11399
- }
11400
- }
11401
- var valid22 = _errs109 === errors;
10299
+ const err57 = { instancePath: instancePath + "/protocolPath", schemaPath: "https://identity.foundation/dwn/json-schemas/permissions/scopes.json#/$defs/records-write-scope/properties/protocolPath/type", keyword: "type", params: { type: "string" }, message: "must be string" };
10300
+ if (vErrors === null) {
10301
+ vErrors = [err57];
11402
10302
  }
11403
10303
  else {
11404
- var valid22 = true;
10304
+ vErrors.push(err57);
11405
10305
  }
10306
+ errors++;
11406
10307
  }
11407
10308
  }
10309
+ var valid16 = _errs73 === errors;
10310
+ }
10311
+ else {
10312
+ var valid16 = true;
11408
10313
  }
11409
10314
  }
11410
10315
  }
11411
10316
  }
11412
10317
  }
11413
- else {
11414
- const err88 = { instancePath, schemaPath: "https://identity.foundation/dwn/json-schemas/permissions/scopes.json#/$defs/records-count-scope/type", keyword: "type", params: { type: "object" }, message: "must be object" };
11415
- if (vErrors === null) {
11416
- vErrors = [err88];
11417
- }
11418
- else {
11419
- vErrors.push(err88);
11420
- }
11421
- errors++;
11422
- }
11423
- }
11424
- var _valid0 = _errs99 === errors;
11425
- if (_valid0 && valid0) {
11426
- valid0 = false;
11427
- passing0 = [passing0, 8];
11428
- }
11429
- else {
11430
- if (_valid0) {
11431
- valid0 = true;
11432
- passing0 = 8;
11433
- if (props0 !== true) {
11434
- props0 = true;
11435
- }
11436
- }
11437
10318
  }
11438
10319
  }
11439
10320
  }
10321
+ else {
10322
+ const err58 = { instancePath, schemaPath: "https://identity.foundation/dwn/json-schemas/permissions/scopes.json#/$defs/records-write-scope/type", keyword: "type", params: { type: "object" }, message: "must be object" };
10323
+ if (vErrors === null) {
10324
+ vErrors = [err58];
10325
+ }
10326
+ else {
10327
+ vErrors.push(err58);
10328
+ }
10329
+ errors++;
10330
+ }
10331
+ }
10332
+ var _valid0 = _errs63 === errors;
10333
+ if (_valid0 && valid0) {
10334
+ valid0 = false;
10335
+ passing0 = [passing0, 5];
10336
+ }
10337
+ else {
10338
+ if (_valid0) {
10339
+ valid0 = true;
10340
+ passing0 = 5;
10341
+ if (props0 !== true) {
10342
+ props0 = true;
10343
+ }
10344
+ }
11440
10345
  }
11441
10346
  }
11442
10347
  }
11443
10348
  }
11444
10349
  } if (!valid0) {
11445
- const err89 = { instancePath, schemaPath: "#/oneOf", keyword: "oneOf", params: { passingSchemas: passing0 }, message: "must match exactly one schema in oneOf" };
10350
+ const err59 = { instancePath, schemaPath: "#/oneOf", keyword: "oneOf", params: { passingSchemas: passing0 }, message: "must match exactly one schema in oneOf" };
11446
10351
  if (vErrors === null) {
11447
- vErrors = [err89];
10352
+ vErrors = [err59];
11448
10353
  }
11449
10354
  else {
11450
- vErrors.push(err89);
10355
+ vErrors.push(err59);
11451
10356
  }
11452
10357
  errors++;
11453
10358
  validate74.errors = vErrors;
@@ -11544,7 +10449,7 @@ function validate73(data, { instancePath = "", parentData, parentDataProperty, r
11544
10449
  return false;
11545
10450
  }
11546
10451
  if (!((data4 === "Required") || (data4 === "Prohibited"))) {
11547
- validate73.errors = [{ instancePath: instancePath + "/conditions/publication", schemaPath: "https://identity.foundation/dwn/json-schemas/permissions/defs.json#/$defs/conditions/properties/publication/enum", keyword: "enum", params: { allowedValues: schema108.properties.publication.enum }, message: "must be equal to one of the allowed values" }];
10452
+ validate73.errors = [{ instancePath: instancePath + "/conditions/publication", schemaPath: "https://identity.foundation/dwn/json-schemas/permissions/defs.json#/$defs/conditions/properties/publication/enum", keyword: "enum", params: { allowedValues: schema105.properties.publication.enum }, message: "must be equal to one of the allowed values" }];
11548
10453
  return false;
11549
10454
  }
11550
10455
  }
@@ -11573,7 +10478,7 @@ function validate73(data, { instancePath = "", parentData, parentDataProperty, r
11573
10478
  } validate73.errors = vErrors; return errors === 0; }
11574
10479
  validate73.evaluated = { "props": true, "dynamicProps": false, "dynamicItems": false };
11575
10480
  export const PermissionRevocationData = validate76;
11576
- const schema121 = { "$schema": "https://json-schema.org/draft/2020-12/schema", "$id": "https://identity.foundation/dwn/json-schemas/permission-revoke-data.json", "type": "object", "additionalProperties": false, "properties": { "description": { "type": "string" } } };
10481
+ const schema115 = { "$schema": "https://json-schema.org/draft/2020-12/schema", "$id": "https://identity.foundation/dwn/json-schemas/permission-revoke-data.json", "type": "object", "additionalProperties": false, "properties": { "description": { "type": "string" } } };
11577
10482
  function validate76(data, { instancePath = "", parentData, parentDataProperty, rootData = data, dynamicAnchors = {} } = {}) { /*# sourceURL="https://identity.foundation/dwn/json-schemas/permission-revoke-data.json" */ ; let vErrors = null; let errors = 0; const evaluated0 = validate76.evaluated; if (evaluated0.dynamicProps) {
11578
10483
  evaluated0.props = undefined;
11579
10484
  } if (evaluated0.dynamicItems) {
@@ -11604,7 +10509,7 @@ function validate76(data, { instancePath = "", parentData, parentDataProperty, r
11604
10509
  } validate76.errors = vErrors; return errors === 0; }
11605
10510
  validate76.evaluated = { "props": true, "dynamicProps": false, "dynamicItems": false };
11606
10511
  export const PermissionsDefinitions = validate69;
11607
- const schema96 = { "$schema": "https://json-schema.org/draft/2020-12/schema", "$id": "https://identity.foundation/dwn/json-schemas/permissions/defs.json", "type": "object", "$defs": { "scope": { "oneOf": [{ "$ref": "https://identity.foundation/dwn/json-schemas/permissions/scopes.json#/$defs/messages-read-scope" }, { "$ref": "https://identity.foundation/dwn/json-schemas/permissions/scopes.json#/$defs/protocols-configure-scope" }, { "$ref": "https://identity.foundation/dwn/json-schemas/permissions/scopes.json#/$defs/protocols-query-scope" }, { "$ref": "https://identity.foundation/dwn/json-schemas/permissions/scopes.json#/$defs/records-read-scope" }, { "$ref": "https://identity.foundation/dwn/json-schemas/permissions/scopes.json#/$defs/records-delete-scope" }, { "$ref": "https://identity.foundation/dwn/json-schemas/permissions/scopes.json#/$defs/records-write-scope" }, { "$ref": "https://identity.foundation/dwn/json-schemas/permissions/scopes.json#/$defs/records-query-scope" }, { "$ref": "https://identity.foundation/dwn/json-schemas/permissions/scopes.json#/$defs/records-subscribe-scope" }, { "$ref": "https://identity.foundation/dwn/json-schemas/permissions/scopes.json#/$defs/records-count-scope" }] }, "conditions": { "type": "object", "additionalProperties": false, "properties": { "publication": { "enum": ["Required", "Prohibited"], "type": "string" } } } } };
10512
+ const schema96 = { "$schema": "https://json-schema.org/draft/2020-12/schema", "$id": "https://identity.foundation/dwn/json-schemas/permissions/defs.json", "type": "object", "$defs": { "scope": { "oneOf": [{ "$ref": "https://identity.foundation/dwn/json-schemas/permissions/scopes.json#/$defs/messages-read-scope" }, { "$ref": "https://identity.foundation/dwn/json-schemas/permissions/scopes.json#/$defs/protocols-configure-scope" }, { "$ref": "https://identity.foundation/dwn/json-schemas/permissions/scopes.json#/$defs/protocols-query-scope" }, { "$ref": "https://identity.foundation/dwn/json-schemas/permissions/scopes.json#/$defs/records-read-scope" }, { "$ref": "https://identity.foundation/dwn/json-schemas/permissions/scopes.json#/$defs/records-delete-scope" }, { "$ref": "https://identity.foundation/dwn/json-schemas/permissions/scopes.json#/$defs/records-write-scope" }] }, "conditions": { "type": "object", "additionalProperties": false, "properties": { "publication": { "enum": ["Required", "Prohibited"], "type": "string" } } } } };
11608
10513
  function validate69(data, { instancePath = "", parentData, parentDataProperty, rootData = data, dynamicAnchors = {} } = {}) { /*# sourceURL="https://identity.foundation/dwn/json-schemas/permissions/defs.json" */ ; let vErrors = null; let errors = 0; const evaluated0 = validate69.evaluated; if (evaluated0.dynamicProps) {
11609
10514
  evaluated0.props = undefined;
11610
10515
  } if (evaluated0.dynamicItems) {
@@ -11615,7 +10520,7 @@ function validate69(data, { instancePath = "", parentData, parentDataProperty, r
11615
10520
  } validate69.errors = vErrors; return errors === 0; }
11616
10521
  validate69.evaluated = { "dynamicProps": false, "dynamicItems": false };
11617
10522
  export const PermissionsScopes = validate71;
11618
- const schema98 = { "$schema": "https://json-schema.org/draft/2020-12/schema", "$id": "https://identity.foundation/dwn/json-schemas/permissions/scopes.json", "type": "object", "$defs": { "messages-read-scope": { "type": "object", "additionalProperties": false, "required": ["interface", "method"], "properties": { "interface": { "const": "Messages" }, "method": { "const": "Read" }, "protocol": { "type": "string" }, "contextId": { "type": "string", "maxLength": 600 }, "protocolPath": { "type": "string", "maxLength": 600 } }, "allOf": [{ "not": { "required": ["contextId", "protocolPath"] } }, { "if": { "anyOf": [{ "required": ["contextId"] }, { "required": ["protocolPath"] }] }, "then": { "required": ["protocol"] } }] }, "protocols-configure-scope": { "type": "object", "additionalProperties": false, "required": ["interface", "method"], "properties": { "interface": { "const": "Protocols" }, "method": { "const": "Configure" }, "protocol": { "type": "string" } } }, "protocols-query-scope": { "type": "object", "additionalProperties": false, "required": ["interface", "method"], "properties": { "interface": { "const": "Protocols" }, "method": { "const": "Query" }, "protocol": { "type": "string" } } }, "records-delete-scope": { "type": "object", "additionalProperties": false, "required": ["interface", "method", "protocol"], "properties": { "interface": { "const": "Records" }, "method": { "const": "Delete" }, "protocol": { "type": "string" }, "contextId": { "type": "string", "maxLength": 600 }, "protocolPath": { "type": "string", "maxLength": 600 } } }, "records-read-scope": { "type": "object", "additionalProperties": false, "required": ["interface", "method", "protocol"], "properties": { "interface": { "const": "Records" }, "method": { "const": "Read" }, "protocol": { "type": "string" }, "contextId": { "type": "string", "maxLength": 600 }, "protocolPath": { "type": "string", "maxLength": 600 } } }, "records-write-scope": { "type": "object", "additionalProperties": false, "required": ["interface", "method", "protocol"], "properties": { "interface": { "const": "Records" }, "method": { "const": "Write" }, "protocol": { "type": "string" }, "contextId": { "type": "string", "maxLength": 600 }, "protocolPath": { "type": "string", "maxLength": 600 } } }, "records-query-scope": { "type": "object", "additionalProperties": false, "required": ["interface", "method", "protocol"], "properties": { "interface": { "const": "Records" }, "method": { "const": "Query" }, "protocol": { "type": "string" }, "contextId": { "type": "string", "maxLength": 600 }, "protocolPath": { "type": "string", "maxLength": 600 } } }, "records-subscribe-scope": { "type": "object", "additionalProperties": false, "required": ["interface", "method", "protocol"], "properties": { "interface": { "const": "Records" }, "method": { "const": "Subscribe" }, "protocol": { "type": "string" }, "contextId": { "type": "string", "maxLength": 600 }, "protocolPath": { "type": "string", "maxLength": 600 } } }, "records-count-scope": { "type": "object", "additionalProperties": false, "required": ["interface", "method", "protocol"], "properties": { "interface": { "const": "Records" }, "method": { "const": "Count" }, "protocol": { "type": "string" }, "contextId": { "type": "string", "maxLength": 600 }, "protocolPath": { "type": "string", "maxLength": 600 } } } } };
10523
+ const schema98 = { "$schema": "https://json-schema.org/draft/2020-12/schema", "$id": "https://identity.foundation/dwn/json-schemas/permissions/scopes.json", "type": "object", "$defs": { "messages-read-scope": { "type": "object", "additionalProperties": false, "required": ["interface", "method"], "properties": { "interface": { "const": "Messages" }, "method": { "const": "Read" }, "protocol": { "type": "string" }, "contextId": { "type": "string", "maxLength": 600 }, "protocolPath": { "type": "string", "maxLength": 600 } }, "allOf": [{ "not": { "required": ["contextId", "protocolPath"] } }, { "if": { "anyOf": [{ "required": ["contextId"] }, { "required": ["protocolPath"] }] }, "then": { "required": ["protocol"] } }] }, "protocols-configure-scope": { "type": "object", "additionalProperties": false, "required": ["interface", "method"], "properties": { "interface": { "const": "Protocols" }, "method": { "const": "Configure" }, "protocol": { "type": "string" } } }, "protocols-query-scope": { "type": "object", "additionalProperties": false, "required": ["interface", "method"], "properties": { "interface": { "const": "Protocols" }, "method": { "const": "Query" }, "protocol": { "type": "string" } } }, "records-delete-scope": { "type": "object", "additionalProperties": false, "required": ["interface", "method", "protocol"], "properties": { "interface": { "const": "Records" }, "method": { "const": "Delete" }, "protocol": { "type": "string" }, "contextId": { "type": "string", "maxLength": 600 }, "protocolPath": { "type": "string", "maxLength": 600 } } }, "records-read-scope": { "type": "object", "additionalProperties": false, "required": ["interface", "method", "protocol"], "properties": { "interface": { "const": "Records" }, "method": { "const": "Read" }, "protocol": { "type": "string" }, "contextId": { "type": "string", "maxLength": 600 }, "protocolPath": { "type": "string", "maxLength": 600 } } }, "records-write-scope": { "type": "object", "additionalProperties": false, "required": ["interface", "method", "protocol"], "properties": { "interface": { "const": "Records" }, "method": { "const": "Write" }, "protocol": { "type": "string" }, "contextId": { "type": "string", "maxLength": 600 }, "protocolPath": { "type": "string", "maxLength": 600 } } } } };
11619
10524
  function validate71(data, { instancePath = "", parentData, parentDataProperty, rootData = data, dynamicAnchors = {} } = {}) { /*# sourceURL="https://identity.foundation/dwn/json-schemas/permissions/scopes.json" */ ; let vErrors = null; let errors = 0; const evaluated0 = validate71.evaluated; if (evaluated0.dynamicProps) {
11620
10525
  evaluated0.props = undefined;
11621
10526
  } if (evaluated0.dynamicItems) {
@@ -11626,10 +10531,10 @@ function validate71(data, { instancePath = "", parentData, parentDataProperty, r
11626
10531
  } validate71.errors = vErrors; return errors === 0; }
11627
10532
  validate71.evaluated = { "dynamicProps": false, "dynamicItems": false };
11628
10533
  export const ProtocolDefinition = validate77;
11629
- const schema122 = { "$id": "https://identity.foundation/dwn/json-schemas/protocol-definition.json", "$schema": "https://json-schema.org/draft/2020-12/schema", "type": "object", "additionalProperties": false, "required": ["protocol", "published", "types", "structure"], "properties": { "protocol": { "type": "string" }, "published": { "type": "boolean" }, "uses": { "$comment": "Maps alias names to external protocol URIs for composition. Each alias can be used in $ref values and cross-protocol role/of references using 'alias:path' syntax.", "type": "object", "minProperties": 1, "patternProperties": { "^[a-zA-Z][a-zA-Z0-9_-]*$": { "type": "string" } }, "additionalProperties": false }, "types": { "type": "object", "patternProperties": { ".*": { "type": "object", "additionalProperties": false, "properties": { "schema": { "type": "string" }, "dataFormats": { "type": "array", "minItems": 1, "items": { "type": "string" } }, "encryptionRequired": { "type": "boolean" } } } } }, "structure": { "type": "object", "patternProperties": { ".*": { "$ref": "https://identity.foundation/dwn/json-schemas/protocol-rule-set.json" } } } } };
10534
+ const schema116 = { "$id": "https://identity.foundation/dwn/json-schemas/protocol-definition.json", "$schema": "https://json-schema.org/draft/2020-12/schema", "type": "object", "additionalProperties": false, "required": ["protocol", "published", "types", "structure"], "properties": { "protocol": { "type": "string" }, "published": { "type": "boolean" }, "uses": { "$comment": "Maps alias names to external protocol URIs for composition. Each alias can be used in $ref values and cross-protocol role/of references using 'alias:path' syntax.", "type": "object", "minProperties": 1, "patternProperties": { "^[a-zA-Z][a-zA-Z0-9_-]*$": { "type": "string" } }, "additionalProperties": false }, "types": { "type": "object", "patternProperties": { ".*": { "type": "object", "additionalProperties": false, "properties": { "schema": { "type": "string" }, "dataFormats": { "type": "array", "minItems": 1, "items": { "type": "string" } }, "encryptionRequired": { "type": "boolean" } } } } }, "structure": { "type": "object", "patternProperties": { ".*": { "$ref": "https://identity.foundation/dwn/json-schemas/protocol-rule-set.json" } } } } };
11630
10535
  const pattern38 = new RegExp("^[a-zA-Z][a-zA-Z0-9_-]*$", "u");
11631
10536
  const pattern40 = new RegExp(".*", "u");
11632
- const schema123 = { "$id": "https://identity.foundation/dwn/json-schemas/protocol-rule-set.json", "$schema": "https://json-schema.org/draft/2020-12/schema", "type": "object", "additionalProperties": false, "properties": { "$encryption": { "type": "object", "additionalProperties": false, "properties": { "rootKeyId": { "type": "string" }, "publicKeyJwk": { "$ref": "https://identity.foundation/dwn/json-schemas/public-jwk.json" } }, "required": ["rootKeyId", "publicKeyJwk"] }, "$actions": { "type": "array", "minItems": 1, "items": { "type": "object", "oneOf": [{ "required": ["who", "can"], "additionalProperties": false, "properties": { "who": { "type": "string", "enum": ["anyone", "author", "recipient"] }, "of": { "type": "string" }, "can": { "type": "array", "minItems": 1, "items": { "type": "string", "enum": ["co-delete", "co-prune", "co-update", "create", "delete", "prune", "read", "squash", "update"] } } } }, { "required": ["role", "can"], "additionalProperties": false, "properties": { "role": { "$comment": "Must be the protocol path of a role record type", "type": "string" }, "can": { "type": "array", "minItems": 1, "items": { "type": "string", "enum": ["co-delete", "co-prune", "co-update", "create", "delete", "prune", "read", "squash", "update"] } } } }] } }, "$role": { "$comment": "When `true`, this turns a record into `role` that may be used within a context/sub-context", "type": "boolean" }, "$ref": { "$comment": "References a type from an external protocol declared in `uses`. Format: 'alias:typePath'. A $ref node is a pure attachment point and must not have $actions, $role, $size, $tags, or $encryption.", "type": "string", "pattern": "^[a-zA-Z][a-zA-Z0-9_-]*:.+$" }, "$size": { "type": "object", "additionalProperties": false, "properties": { "min": { "type": "number", "minimum": 0 }, "max": { "type": "number", "minimum": 0 } } }, "$recordLimit": { "type": "object", "additionalProperties": false, "required": ["max", "strategy"], "properties": { "max": { "type": "integer", "minimum": 1 }, "strategy": { "type": "string", "enum": ["reject", "purgeOldest"] } } }, "$immutable": { "$comment": "When true, records at this protocol path cannot be updated after initial write", "type": "boolean" }, "$delivery": { "$comment": "Delivery strategy hint for records at this protocol path. 'direct' = origin pushes to all participant DWN endpoints; 'subscribe' = participant providers subscribe to the origin DWN.", "type": "string", "enum": ["direct", "subscribe"] }, "$squash": { "$comment": "When true, enables squash writes at this protocol path — a RecordsWrite with squash: true atomically creates a snapshot and deletes all older sibling records", "type": "boolean", "enum": [true] }, "$tags": { "type": "object", "minProperties": 1, "properties": { "$requiredTags": { "type": "array", "items": { "type": "string" } }, "$allowUndefinedTags": { "type": "boolean" } }, "patternProperties": { "^(?!\\$requiredTags$|\\$allowUndefinedTags$).*$": { "type": "object", "additionalProperties": false, "properties": { "type": { "enum": ["string", "number", "integer", "boolean", "array"] }, "items": { "type": "object", "properties": { "type": { "enum": ["string", "number", "integer"] } }, "patternProperties": { "^(enum|minimum|maximum|exclusiveMinimum|exclusiveMaximum|minLength|maxLength)$": {} } }, "contains": { "type": "object", "properties": { "type": { "enum": ["string", "number", "integer"] } }, "patternProperties": { "^(enum|minimum|maximum|exclusiveMinimum|exclusiveMaximum|minLength|maxLength)$": {} } } }, "patternProperties": { "^(enum|minimum|maximum|exclusiveMinimum|exclusiveMaximum|minLength|maxLength|minItems|maxItems|uniqueItems|minContains|maxContains)$": {} } } } } }, "patternProperties": { "^[^$].*$": { "$ref": "https://identity.foundation/dwn/json-schemas/protocol-rule-set.json" } } };
10537
+ const schema117 = { "$id": "https://identity.foundation/dwn/json-schemas/protocol-rule-set.json", "$schema": "https://json-schema.org/draft/2020-12/schema", "type": "object", "additionalProperties": false, "properties": { "$encryption": { "type": "object", "additionalProperties": false, "properties": { "rootKeyId": { "type": "string" }, "publicKeyJwk": { "$ref": "https://identity.foundation/dwn/json-schemas/public-jwk.json" } }, "required": ["rootKeyId", "publicKeyJwk"] }, "$actions": { "type": "array", "minItems": 1, "items": { "type": "object", "oneOf": [{ "required": ["who", "can"], "additionalProperties": false, "properties": { "who": { "type": "string", "enum": ["anyone", "author", "recipient"] }, "of": { "type": "string" }, "can": { "type": "array", "minItems": 1, "items": { "type": "string", "enum": ["co-delete", "co-prune", "co-update", "create", "delete", "prune", "read", "squash", "update"] } } } }, { "required": ["role", "can"], "additionalProperties": false, "properties": { "role": { "$comment": "Must be the protocol path of a role record type", "type": "string" }, "can": { "type": "array", "minItems": 1, "items": { "type": "string", "enum": ["co-delete", "co-prune", "co-update", "create", "delete", "prune", "read", "squash", "update"] } } } }] } }, "$role": { "$comment": "When `true`, this turns a record into `role` that may be used within a context/sub-context", "type": "boolean" }, "$ref": { "$comment": "References a type from an external protocol declared in `uses`. Format: 'alias:typePath'. A $ref node is a pure attachment point and must not have $actions, $role, $size, $tags, or $encryption.", "type": "string", "pattern": "^[a-zA-Z][a-zA-Z0-9_-]*:.+$" }, "$size": { "type": "object", "additionalProperties": false, "properties": { "min": { "type": "number", "minimum": 0 }, "max": { "type": "number", "minimum": 0 } } }, "$recordLimit": { "type": "object", "additionalProperties": false, "required": ["max", "strategy"], "properties": { "max": { "type": "integer", "minimum": 1 }, "strategy": { "type": "string", "enum": ["reject", "purgeOldest"] } } }, "$immutable": { "$comment": "When true, records at this protocol path cannot be updated after initial write", "type": "boolean" }, "$delivery": { "$comment": "Delivery strategy hint for records at this protocol path. 'direct' = origin pushes to all participant DWN endpoints; 'subscribe' = participant providers subscribe to the origin DWN.", "type": "string", "enum": ["direct", "subscribe"] }, "$squash": { "$comment": "When true, enables squash writes at this protocol path — a RecordsWrite with squash: true atomically creates a snapshot and deletes all older sibling records", "type": "boolean", "enum": [true] }, "$tags": { "type": "object", "minProperties": 1, "properties": { "$requiredTags": { "type": "array", "items": { "type": "string" } }, "$allowUndefinedTags": { "type": "boolean" } }, "patternProperties": { "^(?!\\$requiredTags$|\\$allowUndefinedTags$).*$": { "type": "object", "additionalProperties": false, "properties": { "type": { "enum": ["string", "number", "integer", "boolean", "array"] }, "items": { "type": "object", "properties": { "type": { "enum": ["string", "number", "integer"] } }, "patternProperties": { "^(enum|minimum|maximum|exclusiveMinimum|exclusiveMaximum|minLength|maxLength)$": {} } }, "contains": { "type": "object", "properties": { "type": { "enum": ["string", "number", "integer"] } }, "patternProperties": { "^(enum|minimum|maximum|exclusiveMinimum|exclusiveMaximum|minLength|maxLength)$": {} } } }, "patternProperties": { "^(enum|minimum|maximum|exclusiveMinimum|exclusiveMaximum|minLength|maxLength|minItems|maxItems|uniqueItems|minContains|maxContains)$": {} } } } } }, "patternProperties": { "^[^$].*$": { "$ref": "https://identity.foundation/dwn/json-schemas/protocol-rule-set.json" } } };
11633
10538
  const pattern42 = new RegExp("^[^$].*$", "u");
11634
10539
  const pattern43 = new RegExp("^[a-zA-Z][a-zA-Z0-9_-]*:.+$", "u");
11635
10540
  const pattern44 = new RegExp("^(?!\\$requiredTags$|\\$allowUndefinedTags$).*$", "u");
@@ -11644,7 +10549,7 @@ function validate78(data, { instancePath = "", parentData, parentDataProperty, r
11644
10549
  if (data && typeof data == "object" && !Array.isArray(data)) {
11645
10550
  const _errs1 = errors;
11646
10551
  for (const key0 in data) {
11647
- if (!((func2.call(schema123.properties, key0)) || (pattern42.test(key0)))) {
10552
+ if (!((func2.call(schema117.properties, key0)) || (pattern42.test(key0)))) {
11648
10553
  validate78.errors = [{ instancePath, schemaPath: "#/additionalProperties", keyword: "additionalProperties", params: { additionalProperty: key0 }, message: "must NOT have additional properties" }];
11649
10554
  return false;
11650
10555
  break;
@@ -11774,7 +10679,7 @@ function validate78(data, { instancePath = "", parentData, parentDataProperty, r
11774
10679
  errors++;
11775
10680
  }
11776
10681
  if (!(((data5 === "anyone") || (data5 === "author")) || (data5 === "recipient"))) {
11777
- const err3 = { instancePath: instancePath + "/$actions/" + i0 + "/who", schemaPath: "#/properties/%24actions/items/oneOf/0/properties/who/enum", keyword: "enum", params: { allowedValues: schema123.properties.$actions.items.oneOf[0].properties.who.enum }, message: "must be equal to one of the allowed values" };
10682
+ const err3 = { instancePath: instancePath + "/$actions/" + i0 + "/who", schemaPath: "#/properties/%24actions/items/oneOf/0/properties/who/enum", keyword: "enum", params: { allowedValues: schema117.properties.$actions.items.oneOf[0].properties.who.enum }, message: "must be equal to one of the allowed values" };
11778
10683
  if (vErrors === null) {
11779
10684
  vErrors = [err3];
11780
10685
  }
@@ -11839,7 +10744,7 @@ function validate78(data, { instancePath = "", parentData, parentDataProperty, r
11839
10744
  errors++;
11840
10745
  }
11841
10746
  if (!(((((((((data8 === "co-delete") || (data8 === "co-prune")) || (data8 === "co-update")) || (data8 === "create")) || (data8 === "delete")) || (data8 === "prune")) || (data8 === "read")) || (data8 === "squash")) || (data8 === "update"))) {
11842
- const err7 = { instancePath: instancePath + "/$actions/" + i0 + "/can/" + i1, schemaPath: "#/properties/%24actions/items/oneOf/0/properties/can/items/enum", keyword: "enum", params: { allowedValues: schema123.properties.$actions.items.oneOf[0].properties.can.items.enum }, message: "must be equal to one of the allowed values" };
10747
+ const err7 = { instancePath: instancePath + "/$actions/" + i0 + "/can/" + i1, schemaPath: "#/properties/%24actions/items/oneOf/0/properties/can/items/enum", keyword: "enum", params: { allowedValues: schema117.properties.$actions.items.oneOf[0].properties.can.items.enum }, message: "must be equal to one of the allowed values" };
11843
10748
  if (vErrors === null) {
11844
10749
  vErrors = [err7];
11845
10750
  }
@@ -11961,7 +10866,7 @@ function validate78(data, { instancePath = "", parentData, parentDataProperty, r
11961
10866
  errors++;
11962
10867
  }
11963
10868
  if (!(((((((((data11 === "co-delete") || (data11 === "co-prune")) || (data11 === "co-update")) || (data11 === "create")) || (data11 === "delete")) || (data11 === "prune")) || (data11 === "read")) || (data11 === "squash")) || (data11 === "update"))) {
11964
- const err14 = { instancePath: instancePath + "/$actions/" + i0 + "/can/" + i2, schemaPath: "#/properties/%24actions/items/oneOf/1/properties/can/items/enum", keyword: "enum", params: { allowedValues: schema123.properties.$actions.items.oneOf[1].properties.can.items.enum }, message: "must be equal to one of the allowed values" };
10869
+ const err14 = { instancePath: instancePath + "/$actions/" + i0 + "/can/" + i2, schemaPath: "#/properties/%24actions/items/oneOf/1/properties/can/items/enum", keyword: "enum", params: { allowedValues: schema117.properties.$actions.items.oneOf[1].properties.can.items.enum }, message: "must be equal to one of the allowed values" };
11965
10870
  if (vErrors === null) {
11966
10871
  vErrors = [err14];
11967
10872
  }
@@ -12203,7 +11108,7 @@ function validate78(data, { instancePath = "", parentData, parentDataProperty, r
12203
11108
  return false;
12204
11109
  }
12205
11110
  if (!((data19 === "reject") || (data19 === "purgeOldest"))) {
12206
- validate78.errors = [{ instancePath: instancePath + "/$recordLimit/strategy", schemaPath: "#/properties/%24recordLimit/properties/strategy/enum", keyword: "enum", params: { allowedValues: schema123.properties.$recordLimit.properties.strategy.enum }, message: "must be equal to one of the allowed values" }];
11111
+ validate78.errors = [{ instancePath: instancePath + "/$recordLimit/strategy", schemaPath: "#/properties/%24recordLimit/properties/strategy/enum", keyword: "enum", params: { allowedValues: schema117.properties.$recordLimit.properties.strategy.enum }, message: "must be equal to one of the allowed values" }];
12207
11112
  return false;
12208
11113
  }
12209
11114
  var valid9 = _errs50 === errors;
@@ -12246,7 +11151,7 @@ function validate78(data, { instancePath = "", parentData, parentDataProperty, r
12246
11151
  return false;
12247
11152
  }
12248
11153
  if (!((data21 === "direct") || (data21 === "subscribe"))) {
12249
- validate78.errors = [{ instancePath: instancePath + "/$delivery", schemaPath: "#/properties/%24delivery/enum", keyword: "enum", params: { allowedValues: schema123.properties.$delivery.enum }, message: "must be equal to one of the allowed values" }];
11154
+ validate78.errors = [{ instancePath: instancePath + "/$delivery", schemaPath: "#/properties/%24delivery/enum", keyword: "enum", params: { allowedValues: schema117.properties.$delivery.enum }, message: "must be equal to one of the allowed values" }];
12250
11155
  return false;
12251
11156
  }
12252
11157
  var valid0 = _errs55 === errors;
@@ -12263,7 +11168,7 @@ function validate78(data, { instancePath = "", parentData, parentDataProperty, r
12263
11168
  return false;
12264
11169
  }
12265
11170
  if (!(data22 === true)) {
12266
- validate78.errors = [{ instancePath: instancePath + "/$squash", schemaPath: "#/properties/%24squash/enum", keyword: "enum", params: { allowedValues: schema123.properties.$squash.enum }, message: "must be equal to one of the allowed values" }];
11171
+ validate78.errors = [{ instancePath: instancePath + "/$squash", schemaPath: "#/properties/%24squash/enum", keyword: "enum", params: { allowedValues: schema117.properties.$squash.enum }, message: "must be equal to one of the allowed values" }];
12267
11172
  return false;
12268
11173
  }
12269
11174
  var valid0 = _errs58 === errors;
@@ -12346,7 +11251,7 @@ function validate78(data, { instancePath = "", parentData, parentDataProperty, r
12346
11251
  let data28 = data27.type;
12347
11252
  const _errs72 = errors;
12348
11253
  if (!(((((data28 === "string") || (data28 === "number")) || (data28 === "integer")) || (data28 === "boolean")) || (data28 === "array"))) {
12349
- validate78.errors = [{ instancePath: instancePath + "/$tags/" + key6.replace(/~/g, "~0").replace(/\//g, "~1") + "/type", schemaPath: "#/properties/%24tags/patternProperties/%5E(%3F!%5C%24requiredTags%24%7C%5C%24allowUndefinedTags%24).*%24/properties/type/enum", keyword: "enum", params: { allowedValues: schema123.properties.$tags.patternProperties["^(?!\\$requiredTags$|\\$allowUndefinedTags$).*$"].properties.type.enum }, message: "must be equal to one of the allowed values" }];
11254
+ validate78.errors = [{ instancePath: instancePath + "/$tags/" + key6.replace(/~/g, "~0").replace(/\//g, "~1") + "/type", schemaPath: "#/properties/%24tags/patternProperties/%5E(%3F!%5C%24requiredTags%24%7C%5C%24allowUndefinedTags%24).*%24/properties/type/enum", keyword: "enum", params: { allowedValues: schema117.properties.$tags.patternProperties["^(?!\\$requiredTags$|\\$allowUndefinedTags$).*$"].properties.type.enum }, message: "must be equal to one of the allowed values" }];
12350
11255
  return false;
12351
11256
  }
12352
11257
  var valid13 = _errs72 === errors;
@@ -12364,7 +11269,7 @@ function validate78(data, { instancePath = "", parentData, parentDataProperty, r
12364
11269
  let data30 = data29.type;
12365
11270
  const _errs75 = errors;
12366
11271
  if (!(((data30 === "string") || (data30 === "number")) || (data30 === "integer"))) {
12367
- validate78.errors = [{ instancePath: instancePath + "/$tags/" + key6.replace(/~/g, "~0").replace(/\//g, "~1") + "/items/type", schemaPath: "#/properties/%24tags/patternProperties/%5E(%3F!%5C%24requiredTags%24%7C%5C%24allowUndefinedTags%24).*%24/properties/items/properties/type/enum", keyword: "enum", params: { allowedValues: schema123.properties.$tags.patternProperties["^(?!\\$requiredTags$|\\$allowUndefinedTags$).*$"].properties.items.properties.type.enum }, message: "must be equal to one of the allowed values" }];
11272
+ validate78.errors = [{ instancePath: instancePath + "/$tags/" + key6.replace(/~/g, "~0").replace(/\//g, "~1") + "/items/type", schemaPath: "#/properties/%24tags/patternProperties/%5E(%3F!%5C%24requiredTags%24%7C%5C%24allowUndefinedTags%24).*%24/properties/items/properties/type/enum", keyword: "enum", params: { allowedValues: schema117.properties.$tags.patternProperties["^(?!\\$requiredTags$|\\$allowUndefinedTags$).*$"].properties.items.properties.type.enum }, message: "must be equal to one of the allowed values" }];
12368
11273
  return false;
12369
11274
  }
12370
11275
  var valid14 = _errs75 === errors;
@@ -12402,7 +11307,7 @@ function validate78(data, { instancePath = "", parentData, parentDataProperty, r
12402
11307
  let data32 = data31.type;
12403
11308
  const _errs78 = errors;
12404
11309
  if (!(((data32 === "string") || (data32 === "number")) || (data32 === "integer"))) {
12405
- validate78.errors = [{ instancePath: instancePath + "/$tags/" + key6.replace(/~/g, "~0").replace(/\//g, "~1") + "/contains/type", schemaPath: "#/properties/%24tags/patternProperties/%5E(%3F!%5C%24requiredTags%24%7C%5C%24allowUndefinedTags%24).*%24/properties/contains/properties/type/enum", keyword: "enum", params: { allowedValues: schema123.properties.$tags.patternProperties["^(?!\\$requiredTags$|\\$allowUndefinedTags$).*$"].properties.contains.properties.type.enum }, message: "must be equal to one of the allowed values" }];
11310
+ validate78.errors = [{ instancePath: instancePath + "/$tags/" + key6.replace(/~/g, "~0").replace(/\//g, "~1") + "/contains/type", schemaPath: "#/properties/%24tags/patternProperties/%5E(%3F!%5C%24requiredTags%24%7C%5C%24allowUndefinedTags%24).*%24/properties/contains/properties/type/enum", keyword: "enum", params: { allowedValues: schema117.properties.$tags.patternProperties["^(?!\\$requiredTags$|\\$allowUndefinedTags$).*$"].properties.contains.properties.type.enum }, message: "must be equal to one of the allowed values" }];
12406
11311
  return false;
12407
11312
  }
12408
11313
  var valid16 = _errs78 === errors;
@@ -12726,7 +11631,7 @@ function validate77(data, { instancePath = "", parentData, parentDataProperty, r
12726
11631
  validate77.evaluated = { "props": true, "dynamicProps": false, "dynamicItems": false };
12727
11632
  export const ProtocolRuleSet = validate78;
12728
11633
  export const ProtocolsConfigure = validate81;
12729
- const schema124 = { "$schema": "https://json-schema.org/draft/2020-12/schema", "$id": "https://identity.foundation/dwn/json-schemas/protocols-configure.json", "type": "object", "additionalProperties": false, "required": ["authorization", "descriptor"], "properties": { "authorization": { "$ref": "https://identity.foundation/dwn/json-schemas/authorization-delegated-grant.json" }, "descriptor": { "type": "object", "additionalProperties": false, "required": ["interface", "method", "messageTimestamp", "definition"], "properties": { "interface": { "enum": ["Protocols"], "type": "string" }, "method": { "enum": ["Configure"], "type": "string" }, "messageTimestamp": { "$ref": "https://identity.foundation/dwn/json-schemas/defs.json#/$defs/date-time" }, "definition": { "$ref": "https://identity.foundation/dwn/json-schemas/protocol-definition.json" }, "permissionGrantId": { "type": "string" } } } } };
11634
+ const schema118 = { "$schema": "https://json-schema.org/draft/2020-12/schema", "$id": "https://identity.foundation/dwn/json-schemas/protocols-configure.json", "type": "object", "additionalProperties": false, "required": ["authorization", "descriptor"], "properties": { "authorization": { "$ref": "https://identity.foundation/dwn/json-schemas/authorization-delegated-grant.json" }, "descriptor": { "type": "object", "additionalProperties": false, "required": ["interface", "method", "messageTimestamp", "definition"], "properties": { "interface": { "enum": ["Protocols"], "type": "string" }, "method": { "enum": ["Configure"], "type": "string" }, "messageTimestamp": { "$ref": "https://identity.foundation/dwn/json-schemas/defs.json#/$defs/date-time" }, "definition": { "$ref": "https://identity.foundation/dwn/json-schemas/protocol-definition.json" }, "permissionGrantId": { "type": "string" } } } } };
12730
11635
  function validate81(data, { instancePath = "", parentData, parentDataProperty, rootData = data, dynamicAnchors = {} } = {}) { /*# sourceURL="https://identity.foundation/dwn/json-schemas/protocols-configure.json" */ ; let vErrors = null; let errors = 0; const evaluated0 = validate81.evaluated; if (evaluated0.dynamicProps) {
12731
11636
  evaluated0.props = undefined;
12732
11637
  } if (evaluated0.dynamicItems) {
@@ -12788,7 +11693,7 @@ function validate81(data, { instancePath = "", parentData, parentDataProperty, r
12788
11693
  return false;
12789
11694
  }
12790
11695
  if (!(data2 === "Protocols")) {
12791
- validate81.errors = [{ instancePath: instancePath + "/descriptor/interface", schemaPath: "#/properties/descriptor/properties/interface/enum", keyword: "enum", params: { allowedValues: schema124.properties.descriptor.properties.interface.enum }, message: "must be equal to one of the allowed values" }];
11696
+ validate81.errors = [{ instancePath: instancePath + "/descriptor/interface", schemaPath: "#/properties/descriptor/properties/interface/enum", keyword: "enum", params: { allowedValues: schema118.properties.descriptor.properties.interface.enum }, message: "must be equal to one of the allowed values" }];
12792
11697
  return false;
12793
11698
  }
12794
11699
  var valid1 = _errs6 === errors;
@@ -12805,7 +11710,7 @@ function validate81(data, { instancePath = "", parentData, parentDataProperty, r
12805
11710
  return false;
12806
11711
  }
12807
11712
  if (!(data3 === "Configure")) {
12808
- validate81.errors = [{ instancePath: instancePath + "/descriptor/method", schemaPath: "#/properties/descriptor/properties/method/enum", keyword: "enum", params: { allowedValues: schema124.properties.descriptor.properties.method.enum }, message: "must be equal to one of the allowed values" }];
11713
+ validate81.errors = [{ instancePath: instancePath + "/descriptor/method", schemaPath: "#/properties/descriptor/properties/method/enum", keyword: "enum", params: { allowedValues: schema118.properties.descriptor.properties.method.enum }, message: "must be equal to one of the allowed values" }];
12809
11714
  return false;
12810
11715
  }
12811
11716
  var valid1 = _errs8 === errors;
@@ -12887,7 +11792,7 @@ function validate81(data, { instancePath = "", parentData, parentDataProperty, r
12887
11792
  } validate81.errors = vErrors; return errors === 0; }
12888
11793
  validate81.evaluated = { "props": true, "dynamicProps": false, "dynamicItems": false };
12889
11794
  export const ProtocolsQuery = validate84;
12890
- const schema126 = { "$schema": "https://json-schema.org/draft/2020-12/schema", "$id": "https://identity.foundation/dwn/json-schemas/protocols-query.json", "type": "object", "additionalProperties": false, "required": ["descriptor"], "properties": { "authorization": { "$ref": "https://identity.foundation/dwn/json-schemas/authorization.json" }, "descriptor": { "type": "object", "additionalProperties": false, "required": ["interface", "method", "messageTimestamp"], "properties": { "interface": { "enum": ["Protocols"], "type": "string" }, "method": { "enum": ["Query"], "type": "string" }, "messageTimestamp": { "$ref": "https://identity.foundation/dwn/json-schemas/defs.json#/$defs/date-time" }, "filter": { "type": "object", "minProperties": 1, "additionalProperties": false, "properties": { "protocol": { "type": "string" }, "recipient": { "$ref": "https://identity.foundation/dwn/json-schemas/defs.json#/$defs/did" } } }, "permissionGrantId": { "type": "string" } } } } };
11795
+ const schema120 = { "$schema": "https://json-schema.org/draft/2020-12/schema", "$id": "https://identity.foundation/dwn/json-schemas/protocols-query.json", "type": "object", "additionalProperties": false, "required": ["descriptor"], "properties": { "authorization": { "$ref": "https://identity.foundation/dwn/json-schemas/authorization.json" }, "descriptor": { "type": "object", "additionalProperties": false, "required": ["interface", "method", "messageTimestamp"], "properties": { "interface": { "enum": ["Protocols"], "type": "string" }, "method": { "enum": ["Query"], "type": "string" }, "messageTimestamp": { "$ref": "https://identity.foundation/dwn/json-schemas/defs.json#/$defs/date-time" }, "filter": { "type": "object", "minProperties": 1, "additionalProperties": false, "properties": { "protocol": { "type": "string" }, "recipient": { "$ref": "https://identity.foundation/dwn/json-schemas/defs.json#/$defs/did" } } }, "permissionGrantId": { "type": "string" } } } } };
12891
11796
  function validate84(data, { instancePath = "", parentData, parentDataProperty, rootData = data, dynamicAnchors = {} } = {}) { /*# sourceURL="https://identity.foundation/dwn/json-schemas/protocols-query.json" */ ; let vErrors = null; let errors = 0; const evaluated0 = validate84.evaluated; if (evaluated0.dynamicProps) {
12892
11797
  evaluated0.props = undefined;
12893
11798
  } if (evaluated0.dynamicItems) {
@@ -12949,7 +11854,7 @@ function validate84(data, { instancePath = "", parentData, parentDataProperty, r
12949
11854
  return false;
12950
11855
  }
12951
11856
  if (!(data2 === "Protocols")) {
12952
- validate84.errors = [{ instancePath: instancePath + "/descriptor/interface", schemaPath: "#/properties/descriptor/properties/interface/enum", keyword: "enum", params: { allowedValues: schema126.properties.descriptor.properties.interface.enum }, message: "must be equal to one of the allowed values" }];
11857
+ validate84.errors = [{ instancePath: instancePath + "/descriptor/interface", schemaPath: "#/properties/descriptor/properties/interface/enum", keyword: "enum", params: { allowedValues: schema120.properties.descriptor.properties.interface.enum }, message: "must be equal to one of the allowed values" }];
12953
11858
  return false;
12954
11859
  }
12955
11860
  var valid1 = _errs6 === errors;
@@ -12966,7 +11871,7 @@ function validate84(data, { instancePath = "", parentData, parentDataProperty, r
12966
11871
  return false;
12967
11872
  }
12968
11873
  if (!(data3 === "Query")) {
12969
- validate84.errors = [{ instancePath: instancePath + "/descriptor/method", schemaPath: "#/properties/descriptor/properties/method/enum", keyword: "enum", params: { allowedValues: schema126.properties.descriptor.properties.method.enum }, message: "must be equal to one of the allowed values" }];
11874
+ validate84.errors = [{ instancePath: instancePath + "/descriptor/method", schemaPath: "#/properties/descriptor/properties/method/enum", keyword: "enum", params: { allowedValues: schema120.properties.descriptor.properties.method.enum }, message: "must be equal to one of the allowed values" }];
12970
11875
  return false;
12971
11876
  }
12972
11877
  var valid1 = _errs8 === errors;
@@ -13103,7 +12008,7 @@ function validate84(data, { instancePath = "", parentData, parentDataProperty, r
13103
12008
  } validate84.errors = vErrors; return errors === 0; }
13104
12009
  validate84.evaluated = { "props": true, "dynamicProps": false, "dynamicItems": false };
13105
12010
  export const RecordsRead = validate86;
13106
- const schema129 = { "$schema": "https://json-schema.org/draft/2020-12/schema", "$id": "https://identity.foundation/dwn/json-schemas/records-read.json", "type": "object", "additionalProperties": false, "required": ["descriptor"], "properties": { "authorization": { "$ref": "https://identity.foundation/dwn/json-schemas/authorization-delegated-grant.json" }, "descriptor": { "type": "object", "additionalProperties": false, "required": ["interface", "method", "messageTimestamp", "filter"], "properties": { "interface": { "enum": ["Records"], "type": "string" }, "method": { "enum": ["Read"], "type": "string" }, "messageTimestamp": { "$ref": "https://identity.foundation/dwn/json-schemas/defs.json#/$defs/date-time" }, "filter": { "$ref": "https://identity.foundation/dwn/json-schemas/records-filter.json" }, "permissionGrantId": { "type": "string" }, "dateSort": { "enum": ["createdAscending", "createdDescending", "publishedAscending", "publishedDescending", "updatedAscending", "updatedDescending"], "type": "string" } } } } };
12011
+ const schema123 = { "$schema": "https://json-schema.org/draft/2020-12/schema", "$id": "https://identity.foundation/dwn/json-schemas/records-read.json", "type": "object", "additionalProperties": false, "required": ["descriptor"], "properties": { "authorization": { "$ref": "https://identity.foundation/dwn/json-schemas/authorization-delegated-grant.json" }, "descriptor": { "type": "object", "additionalProperties": false, "required": ["interface", "method", "messageTimestamp", "filter"], "properties": { "interface": { "enum": ["Records"], "type": "string" }, "method": { "enum": ["Read"], "type": "string" }, "messageTimestamp": { "$ref": "https://identity.foundation/dwn/json-schemas/defs.json#/$defs/date-time" }, "filter": { "$ref": "https://identity.foundation/dwn/json-schemas/records-filter.json" }, "permissionGrantId": { "type": "string" }, "dateSort": { "enum": ["createdAscending", "createdDescending", "publishedAscending", "publishedDescending", "updatedAscending", "updatedDescending"], "type": "string" } } } } };
13107
12012
  function validate86(data, { instancePath = "", parentData, parentDataProperty, rootData = data, dynamicAnchors = {} } = {}) { /*# sourceURL="https://identity.foundation/dwn/json-schemas/records-read.json" */ ; let vErrors = null; let errors = 0; const evaluated0 = validate86.evaluated; if (evaluated0.dynamicProps) {
13108
12013
  evaluated0.props = undefined;
13109
12014
  } if (evaluated0.dynamicItems) {
@@ -13165,7 +12070,7 @@ function validate86(data, { instancePath = "", parentData, parentDataProperty, r
13165
12070
  return false;
13166
12071
  }
13167
12072
  if (!(data2 === "Records")) {
13168
- validate86.errors = [{ instancePath: instancePath + "/descriptor/interface", schemaPath: "#/properties/descriptor/properties/interface/enum", keyword: "enum", params: { allowedValues: schema129.properties.descriptor.properties.interface.enum }, message: "must be equal to one of the allowed values" }];
12073
+ validate86.errors = [{ instancePath: instancePath + "/descriptor/interface", schemaPath: "#/properties/descriptor/properties/interface/enum", keyword: "enum", params: { allowedValues: schema123.properties.descriptor.properties.interface.enum }, message: "must be equal to one of the allowed values" }];
13169
12074
  return false;
13170
12075
  }
13171
12076
  var valid1 = _errs6 === errors;
@@ -13182,7 +12087,7 @@ function validate86(data, { instancePath = "", parentData, parentDataProperty, r
13182
12087
  return false;
13183
12088
  }
13184
12089
  if (!(data3 === "Read")) {
13185
- validate86.errors = [{ instancePath: instancePath + "/descriptor/method", schemaPath: "#/properties/descriptor/properties/method/enum", keyword: "enum", params: { allowedValues: schema129.properties.descriptor.properties.method.enum }, message: "must be equal to one of the allowed values" }];
12090
+ validate86.errors = [{ instancePath: instancePath + "/descriptor/method", schemaPath: "#/properties/descriptor/properties/method/enum", keyword: "enum", params: { allowedValues: schema123.properties.descriptor.properties.method.enum }, message: "must be equal to one of the allowed values" }];
13186
12091
  return false;
13187
12092
  }
13188
12093
  var valid1 = _errs8 === errors;
@@ -13245,7 +12150,7 @@ function validate86(data, { instancePath = "", parentData, parentDataProperty, r
13245
12150
  return false;
13246
12151
  }
13247
12152
  if (!((((((data7 === "createdAscending") || (data7 === "createdDescending")) || (data7 === "publishedAscending")) || (data7 === "publishedDescending")) || (data7 === "updatedAscending")) || (data7 === "updatedDescending"))) {
13248
- validate86.errors = [{ instancePath: instancePath + "/descriptor/dateSort", schemaPath: "#/properties/descriptor/properties/dateSort/enum", keyword: "enum", params: { allowedValues: schema129.properties.descriptor.properties.dateSort.enum }, message: "must be equal to one of the allowed values" }];
12153
+ validate86.errors = [{ instancePath: instancePath + "/descriptor/dateSort", schemaPath: "#/properties/descriptor/properties/dateSort/enum", keyword: "enum", params: { allowedValues: schema123.properties.descriptor.properties.dateSort.enum }, message: "must be equal to one of the allowed values" }];
13249
12154
  return false;
13250
12155
  }
13251
12156
  var valid1 = _errs16 === errors;
@@ -13284,7 +12189,7 @@ validate86.evaluated = { "props": true, "dynamicProps": false, "dynamicItems": f
13284
12189
  export const RecordsFilter = validate41;
13285
12190
  export const PublicJwk = validate32;
13286
12191
  export const GenericSignaturePayload = validate89;
13287
- const schema131 = { "$schema": "https://json-schema.org/draft/2020-12/schema", "$id": "https://identity.foundation/dwn/json-schemas/signature-payloads/generic-signature-payload.json", "type": "object", "additionalProperties": false, "required": ["descriptorCid"], "properties": { "descriptorCid": { "type": "string" }, "delegatedGrantId": { "type": "string" }, "permissionGrantId": { "$comment": "Direct Records and Protocols operations invoke a single grant with permissionGrantId. Message.createSignature rejects payloads that also include permissionGrantIds.", "type": "string" }, "permissionGrantIds": { "$comment": "Messages operations invoke grants with permissionGrantIds, including the single-grant case. Message.createSignature rejects payloads that also include permissionGrantId.", "type": "array", "items": { "type": "string" }, "minItems": 1, "uniqueItems": true }, "protocolRole": { "$comment": "Used in the Records interface to authorize role-authorized actions for protocol records", "type": "string" } } };
12192
+ const schema125 = { "$schema": "https://json-schema.org/draft/2020-12/schema", "$id": "https://identity.foundation/dwn/json-schemas/signature-payloads/generic-signature-payload.json", "type": "object", "additionalProperties": false, "required": ["descriptorCid"], "properties": { "descriptorCid": { "type": "string" }, "delegatedGrantId": { "type": "string" }, "permissionGrantId": { "$comment": "Direct Records and Protocols operations invoke a single grant with permissionGrantId. Message.createSignature rejects payloads that also include permissionGrantIds.", "type": "string" }, "permissionGrantIds": { "$comment": "Messages operations invoke grants with permissionGrantIds, including the single-grant case. Message.createSignature rejects payloads that also include permissionGrantId.", "type": "array", "items": { "type": "string" }, "minItems": 1, "uniqueItems": true }, "protocolRole": { "$comment": "Used in the Records interface to authorize role-authorized actions for protocol records", "type": "string" } } };
13288
12193
  function validate89(data, { instancePath = "", parentData, parentDataProperty, rootData = data, dynamicAnchors = {} } = {}) { /*# sourceURL="https://identity.foundation/dwn/json-schemas/signature-payloads/generic-signature-payload.json" */ ; let vErrors = null; let errors = 0; const evaluated0 = validate89.evaluated; if (evaluated0.dynamicProps) {
13289
12194
  evaluated0.props = undefined;
13290
12195
  } if (evaluated0.dynamicItems) {
@@ -13423,7 +12328,7 @@ function validate89(data, { instancePath = "", parentData, parentDataProperty, r
13423
12328
  } validate89.errors = vErrors; return errors === 0; }
13424
12329
  validate89.evaluated = { "props": true, "dynamicProps": false, "dynamicItems": false };
13425
12330
  export const RecordsWriteSignaturePayload = validate90;
13426
- const schema132 = { "$schema": "https://json-schema.org/draft/2020-12/schema", "$id": "https://identity.foundation/dwn/json-schemas/signature-payloads/records-write-signature-payload.json", "type": "object", "additionalProperties": false, "required": ["descriptorCid", "recordId"], "properties": { "descriptorCid": { "type": "string" }, "recordId": { "type": "string" }, "contextId": { "type": "string", "maxLength": 600 }, "attestationCid": { "type": "string" }, "encryptionCid": { "type": "string" }, "delegatedGrantId": { "type": "string" }, "permissionGrantId": { "type": "string" }, "protocolRole": { "type": "string" } } };
12331
+ const schema126 = { "$schema": "https://json-schema.org/draft/2020-12/schema", "$id": "https://identity.foundation/dwn/json-schemas/signature-payloads/records-write-signature-payload.json", "type": "object", "additionalProperties": false, "required": ["descriptorCid", "recordId"], "properties": { "descriptorCid": { "type": "string" }, "recordId": { "type": "string" }, "contextId": { "type": "string", "maxLength": 600 }, "attestationCid": { "type": "string" }, "encryptionCid": { "type": "string" }, "delegatedGrantId": { "type": "string" }, "permissionGrantId": { "type": "string" }, "protocolRole": { "type": "string" } } };
13427
12332
  function validate90(data, { instancePath = "", parentData, parentDataProperty, rootData = data, dynamicAnchors = {} } = {}) { /*# sourceURL="https://identity.foundation/dwn/json-schemas/signature-payloads/records-write-signature-payload.json" */ ; let vErrors = null; let errors = 0; const evaluated0 = validate90.evaluated; if (evaluated0.dynamicProps) {
13428
12333
  evaluated0.props = undefined;
13429
12334
  } if (evaluated0.dynamicItems) {