@@ -23,6 +23,13 @@ const id = {
2323 maxLength : 4096
2424} ;
2525
26+ const sequence = {
27+ title : 'sequence' ,
28+ type : 'integer' ,
29+ minimum : 0 ,
30+ maximum : Number . MAX_SAFE_INTEGER - 1
31+ } ;
32+
2633// this should match query objects with an account in them
2734const accountQuery = {
2835 title : 'Account Query' ,
@@ -272,24 +279,11 @@ const createInteraction = {
272279 exchange : {
273280 type : 'object' ,
274281 required : [ 'variables' ] ,
275- variables : {
276- type : 'object' ,
277- additionalProperties : false ,
278- oneOf : [ {
279- required : [ 'verifiablePresentation' ]
280- } , {
281- required : [ 'verifiablePresentationRequest' ]
282- } ] ,
283- properties : {
284- allowUnprotectedPresentation : {
285- type : 'boolean'
286- } ,
287- verifiablePresentation : {
288- type : 'object'
289- } ,
290- verifiablePresentationRequest : {
291- type : 'object'
292- }
282+ additionalProperties : false ,
283+ properties : {
284+ variables : {
285+ type : 'object' ,
286+ additionalProperties : true
293287 }
294288 }
295289 }
@@ -308,13 +302,62 @@ const getInteractionQuery = {
308302 }
309303} ;
310304
305+ const zcapPolicy = {
306+ title : 'Zcap Policy' ,
307+ type : 'object' ,
308+ required : [ 'sequence' , 'refresh' ] ,
309+ additionalProperties : false ,
310+ properties : {
311+ sequence,
312+ refresh : {
313+ anyOf : [ {
314+ const : false
315+ } , {
316+ type : 'object' ,
317+ additionalProperties : false ,
318+ properties : {
319+ constraints : {
320+ type : 'object' ,
321+ additionalProperties : false ,
322+ properties : {
323+ maxTtlBeforeRefresh : {
324+ type : 'number'
325+ }
326+ }
327+ }
328+ }
329+ } ]
330+ }
331+ }
332+ } ;
333+
334+ const createZcapPolicyBody = {
335+ title : 'Create Zcap Policy' ,
336+ type : 'object' ,
337+ required : [ 'policy' ] ,
338+ additionalProperties : false ,
339+ properties : {
340+ policy : zcapPolicy
341+ }
342+ } ;
343+ const getZcapPoliciesQuery = {
344+ title : 'Zcap Policy Query' ,
345+ type : 'object' ,
346+ additionalProperties : false ,
347+ properties : { }
348+ } ;
349+ const updateZcapPolicyBody = createZcapPolicyBody ;
350+
311351export {
312352 profileAgent ,
313353 profileAgents ,
314354 accountQuery ,
315355 delegateCapability ,
316356 createInteraction ,
317357 getInteractionQuery ,
358+ createZcapPolicyBody ,
359+ getZcapPoliciesQuery ,
360+ updateZcapPolicyBody ,
318361 zcaps ,
319362 refreshableZcap
320363} ;
0 commit comments