@bedrock/vc-delivery 7.0.0 → 7.0.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@bedrock/vc-delivery",
3
- "version": "7.0.0",
3
+ "version": "7.0.2",
4
4
  "type": "module",
5
5
  "description": "Bedrock Verifiable Credential Delivery",
6
6
  "main": "./lib/index.js",
@@ -24,6 +24,23 @@ const vcContext = {
24
24
  }
25
25
  };
26
26
 
27
+ const vcContext2StringOrArray = {
28
+ oneOf: [{
29
+ const: VC_CONTEXT_2
30
+ }, {
31
+ type: 'array',
32
+ minItems: 1,
33
+ // the first context must be the VC 2.0 context
34
+ items: [{
35
+ const: VC_CONTEXT_2
36
+ }],
37
+ // additional contexts maybe strings or objects
38
+ additionalItems: {
39
+ anyOf: [{type: 'string'}, {type: 'object'}]
40
+ }
41
+ }]
42
+ };
43
+
27
44
  function idOrObjectWithId() {
28
45
  return {
29
46
  title: 'identifier or an object with an id',
@@ -84,9 +101,7 @@ const envelopedVerifiableCredential = {
84
101
  type: 'object',
85
102
  additionalProperties: true,
86
103
  properties: {
87
- '@context': {
88
- const: VC_CONTEXT_2
89
- },
104
+ '@context': vcContext2StringOrArray,
90
105
  id: {
91
106
  type: 'string'
92
107
  },