mailschema 0.2.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -0,0 +1,1033 @@
1
+ {
2
+ "$schema": "https://json-schema.org/draft/2020-12/schema",
3
+ "$id": "https://mailschema.org/schemas/map-0.2.schema.json",
4
+ "title": "Mail Action Protocol 0.2",
5
+ "description": "Description, request, result and problem documents for MAP 0.2: a type-agnostic core whose types are defined by digest-bound contracts, with credential or possession authority over HTTPS.",
6
+ "oneOf": [
7
+ {
8
+ "$ref": "#/$defs/description"
9
+ },
10
+ {
11
+ "$ref": "#/$defs/request"
12
+ },
13
+ {
14
+ "$ref": "#/$defs/result"
15
+ },
16
+ {
17
+ "$ref": "#/$defs/problem"
18
+ }
19
+ ],
20
+ "$defs": {
21
+ "profile": {
22
+ "const": "https://mailschema.org/profiles/map/0.2"
23
+ },
24
+ "nonBlank": {
25
+ "type": "string",
26
+ "pattern": "[^\\t\\n\\u000b\\f\\r \\u00a0\\u1680\\u2000-\\u200a\\u2028\\u2029\\u202f\\u205f\\u3000\\ufeff]"
27
+ },
28
+ "dateTime": {
29
+ "type": "string",
30
+ "pattern": "^(?:[0-9]{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12][0-9]|3[01])|(?:0[469]|11)-(?:0[1-9]|[12][0-9]|30)|02-(?:0[1-9]|1[0-9]|2[0-8]))|(?:[0-9]{2}(?:0[48]|[2468][048]|[13579][26])|(?:[02468][048]|[13579][26])00)-02-29)T(?:[01][0-9]|2[0-3]):[0-5][0-9]:[0-5][0-9](?:\\.[0-9]{1,3})?(?:Z|[+-](?:[01][0-9]|2[0-3]):[0-5][0-9])$"
31
+ },
32
+ "date": {
33
+ "type": "string",
34
+ "pattern": "^(?:[0-9]{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12][0-9]|3[01])|(?:0[469]|11)-(?:0[1-9]|[12][0-9]|30)|02-(?:0[1-9]|1[0-9]|2[0-8]))|(?:[0-9]{2}(?:0[48]|[2468][048]|[13579][26])|(?:[02468][048]|[13579][26])00)-02-29)$"
35
+ },
36
+ "identifier": {
37
+ "type": "string",
38
+ "pattern": "^[A-Za-z][A-Za-z0-9+.-]*:(?:[A-Za-z0-9._~:/?#@!$&'()*+,;=-]|%[0-9A-Fa-f]{2})+$",
39
+ "maxLength": 2048
40
+ },
41
+ "httpsIdentifier": {
42
+ "type": "string",
43
+ "pattern": "^https://(?:[A-Za-z0-9](?:[A-Za-z0-9-]{0,61}[A-Za-z0-9])?\\.)*[A-Za-z](?:[A-Za-z0-9-]{0,61}[A-Za-z0-9])?(?::(?:[1-9][0-9]{0,3}|[1-5][0-9]{4}|6[0-4][0-9]{3}|65[0-4][0-9]{2}|655[0-2][0-9]|6553[0-5]))?(?:[/?#](?:[A-Za-z0-9._~:/?#@!$&'()*+,;=-]|%[0-9A-Fa-f]{2})*)?$",
44
+ "maxLength": 2048
45
+ },
46
+ "httpsTarget": {
47
+ "type": "string",
48
+ "pattern": "^https://(?:[A-Za-z0-9](?:[A-Za-z0-9-]{0,61}[A-Za-z0-9])?\\.)*[A-Za-z](?:[A-Za-z0-9-]{0,61}[A-Za-z0-9])?(?::(?:[1-9][0-9]{0,3}|[1-5][0-9]{4}|6[0-4][0-9]{3}|65[0-4][0-9]{2}|655[0-2][0-9]|6553[0-5]))?(?:[/?](?:[A-Za-z0-9._~:/?@!$&'()*+,;=-]|%[0-9A-Fa-f]{2})*)?$",
49
+ "maxLength": 2048
50
+ },
51
+ "httpsOrigin": {
52
+ "type": "string",
53
+ "pattern": "^https://(?:[A-Za-z0-9](?:[A-Za-z0-9-]{0,61}[A-Za-z0-9])?\\.)*[A-Za-z](?:[A-Za-z0-9-]{0,61}[A-Za-z0-9])?(?::(?:[1-9][0-9]{0,3}|[1-5][0-9]{4}|6[0-4][0-9]{3}|65[0-4][0-9]{2}|655[0-2][0-9]|6553[0-5]))?$",
54
+ "maxLength": 300
55
+ },
56
+ "urlTemplate": {
57
+ "type": "string",
58
+ "pattern": "^https://(?:[A-Za-z0-9](?:[A-Za-z0-9-]{0,61}[A-Za-z0-9])?\\.)*[A-Za-z](?:[A-Za-z0-9-]{0,61}[A-Za-z0-9])?(?::(?:[1-9][0-9]{0,3}|[1-5][0-9]{4}|6[0-4][0-9]{3}|65[0-4][0-9]{2}|655[0-2][0-9]|6553[0-5]))?[/?](?:[A-Za-z0-9._~:/?@!$&'()*+,;=-]|%[0-9A-Fa-f]{2})*\\{requestId\\}(?:[A-Za-z0-9._~:/?#@!$&'()*+,;=-]|%[0-9A-Fa-f]{2})*$",
59
+ "maxLength": 2048
60
+ },
61
+ "address": {
62
+ "type": "string",
63
+ "pattern": "^(?:[A-Za-z0-9.!#$%&'*+/=?^_`{|}~-]|[^\\u0000-\\u00a0\\u1680\\u2000-\\u200f\\u2028-\\u202f\\u205f-\\u206f\\u3000\\ufeff])+@[A-Za-z0-9](?:[A-Za-z0-9-]{0,61}[A-Za-z0-9])?(?:\\.[A-Za-z0-9](?:[A-Za-z0-9-]{0,61}[A-Za-z0-9])?)*$",
64
+ "maxLength": 320
65
+ },
66
+ "uuidUrn": {
67
+ "type": "string",
68
+ "pattern": "^urn:uuid:[0-9a-f]{8}-[0-9a-f]{4}-[1-8][0-9a-f]{3}-[89ab][0-9a-f]{3}-[0-9a-f]{12}$"
69
+ },
70
+ "digest": {
71
+ "type": "string",
72
+ "pattern": "^sha-256:[a-f0-9]{64}$"
73
+ },
74
+ "contractDigest": {
75
+ "type": "string",
76
+ "pattern": "^sha-256:[a-f0-9]{64}$"
77
+ },
78
+ "typeReference": {
79
+ "type": "object",
80
+ "additionalProperties": false,
81
+ "properties": {
82
+ "id": {
83
+ "$ref": "#/$defs/identifier"
84
+ },
85
+ "version": {
86
+ "type": "string",
87
+ "pattern": "^[0-9]+\\.[0-9]+(?:\\.[0-9]+)?(?:-[a-zA-Z0-9.-]+)?$",
88
+ "maxLength": 80
89
+ },
90
+ "contractDigest": {
91
+ "$ref": "#/$defs/contractDigest"
92
+ }
93
+ },
94
+ "required": ["id", "version", "contractDigest"]
95
+ },
96
+ "token": {
97
+ "type": "string",
98
+ "pattern": "^[a-z][a-z0-9]*(?:-[a-z0-9]+)*$",
99
+ "maxLength": 100
100
+ },
101
+ "target": {
102
+ "type": "object",
103
+ "additionalProperties": false,
104
+ "properties": {
105
+ "id": {
106
+ "$ref": "#/$defs/identifier"
107
+ },
108
+ "revision": {
109
+ "type": "string",
110
+ "minLength": 1,
111
+ "maxLength": 240
112
+ },
113
+ "title": {
114
+ "type": "string",
115
+ "minLength": 1,
116
+ "maxLength": 500
117
+ },
118
+ "digest": {
119
+ "$ref": "#/$defs/digest"
120
+ }
121
+ },
122
+ "required": ["id", "revision", "digest"]
123
+ },
124
+ "operation": {
125
+ "type": "object",
126
+ "additionalProperties": false,
127
+ "properties": {
128
+ "id": {
129
+ "$ref": "#/$defs/token"
130
+ },
131
+ "name": {
132
+ "type": "string",
133
+ "minLength": 1,
134
+ "maxLength": 240
135
+ },
136
+ "description": {
137
+ "type": "string",
138
+ "minLength": 1,
139
+ "maxLength": 2000
140
+ }
141
+ },
142
+ "required": ["id", "name", "description"]
143
+ },
144
+ "description": {
145
+ "type": "object",
146
+ "additionalProperties": false,
147
+ "properties": {
148
+ "@context": {
149
+ "const": "https://mailschema.org/contexts/map-0.2.jsonld"
150
+ },
151
+ "@type": {
152
+ "const": "MailAction"
153
+ },
154
+ "@id": {
155
+ "$ref": "#/$defs/uuidUrn"
156
+ },
157
+ "profile": {
158
+ "$ref": "#/$defs/profile"
159
+ },
160
+ "type": {
161
+ "$ref": "#/$defs/typeReference"
162
+ },
163
+ "describedAt": {
164
+ "$ref": "#/$defs/dateTime"
165
+ },
166
+ "expiresAt": {
167
+ "$ref": "#/$defs/dateTime"
168
+ },
169
+ "service": {
170
+ "type": "object",
171
+ "additionalProperties": false,
172
+ "properties": {
173
+ "id": {
174
+ "$ref": "#/$defs/httpsIdentifier"
175
+ },
176
+ "name": {
177
+ "type": "string",
178
+ "minLength": 1,
179
+ "maxLength": 240
180
+ },
181
+ "authority": {
182
+ "enum": ["credential", "possession"]
183
+ },
184
+ "onBehalfOf": {
185
+ "type": "object",
186
+ "additionalProperties": false,
187
+ "properties": {
188
+ "id": {
189
+ "$ref": "#/$defs/identifier"
190
+ },
191
+ "name": {
192
+ "type": "string",
193
+ "minLength": 1,
194
+ "maxLength": 240
195
+ }
196
+ },
197
+ "required": ["id", "name"]
198
+ },
199
+ "resource": {
200
+ "$ref": "#/$defs/httpsTarget"
201
+ },
202
+ "execution": {
203
+ "type": "object",
204
+ "additionalProperties": false,
205
+ "properties": {
206
+ "url": {
207
+ "$ref": "#/$defs/httpsTarget"
208
+ },
209
+ "resultUrlTemplate": {
210
+ "$ref": "#/$defs/urlTemplate"
211
+ },
212
+ "resultRetentionSeconds": {
213
+ "type": "integer",
214
+ "minimum": 300,
215
+ "maximum": 31536000
216
+ }
217
+ },
218
+ "required": ["url", "resultUrlTemplate", "resultRetentionSeconds"]
219
+ },
220
+ "humanUrl": {
221
+ "$ref": "#/$defs/httpsIdentifier"
222
+ }
223
+ },
224
+ "required": ["id", "name", "authority", "execution", "humanUrl"]
225
+ },
226
+ "recipient": {
227
+ "$ref": "#/$defs/address"
228
+ },
229
+ "target": {
230
+ "$ref": "#/$defs/target"
231
+ },
232
+ "details": {
233
+ "type": "object",
234
+ "maxProperties": 100,
235
+ "propertyNames": {
236
+ "$ref": "#/$defs/detailsKey"
237
+ },
238
+ "additionalProperties": {
239
+ "$ref": "#/$defs/detailsValue"
240
+ }
241
+ },
242
+ "operations": {
243
+ "type": "array",
244
+ "items": {
245
+ "$ref": "#/$defs/operation"
246
+ },
247
+ "minItems": 1,
248
+ "maxItems": 100
249
+ }
250
+ },
251
+ "required": [
252
+ "@context",
253
+ "@type",
254
+ "@id",
255
+ "profile",
256
+ "type",
257
+ "describedAt",
258
+ "expiresAt",
259
+ "service",
260
+ "target",
261
+ "operations"
262
+ ],
263
+ "allOf": [
264
+ {
265
+ "if": {
266
+ "type": "object",
267
+ "properties": {
268
+ "service": {
269
+ "type": "object",
270
+ "properties": {
271
+ "authority": {
272
+ "const": "credential"
273
+ }
274
+ }
275
+ }
276
+ }
277
+ },
278
+ "then": {
279
+ "type": "object",
280
+ "properties": {
281
+ "service": {
282
+ "type": "object",
283
+ "required": ["resource"]
284
+ }
285
+ },
286
+ "not": {
287
+ "required": ["recipient"]
288
+ }
289
+ },
290
+ "else": {
291
+ "type": "object",
292
+ "properties": {
293
+ "service": {
294
+ "type": "object",
295
+ "properties": {
296
+ "resource": false,
297
+ "onBehalfOf": false
298
+ }
299
+ }
300
+ },
301
+ "required": ["recipient"]
302
+ }
303
+ }
304
+ ]
305
+ },
306
+ "request": {
307
+ "type": "object",
308
+ "additionalProperties": false,
309
+ "properties": {
310
+ "kind": {
311
+ "const": "MapRequest"
312
+ },
313
+ "profile": {
314
+ "$ref": "#/$defs/profile"
315
+ },
316
+ "requestId": {
317
+ "$ref": "#/$defs/uuidUrn"
318
+ },
319
+ "interactionId": {
320
+ "$ref": "#/$defs/uuidUrn"
321
+ },
322
+ "descriptionDigest": {
323
+ "$ref": "#/$defs/digest"
324
+ },
325
+ "type": {
326
+ "$ref": "#/$defs/typeReference"
327
+ },
328
+ "operation": {
329
+ "$ref": "#/$defs/token"
330
+ },
331
+ "input": {
332
+ "type": "object",
333
+ "maxProperties": 100
334
+ }
335
+ },
336
+ "required": [
337
+ "kind",
338
+ "profile",
339
+ "requestId",
340
+ "interactionId",
341
+ "descriptionDigest",
342
+ "type",
343
+ "operation",
344
+ "input"
345
+ ]
346
+ },
347
+ "result": {
348
+ "type": "object",
349
+ "additionalProperties": false,
350
+ "properties": {
351
+ "kind": {
352
+ "const": "MapResult"
353
+ },
354
+ "profile": {
355
+ "$ref": "#/$defs/profile"
356
+ },
357
+ "requestId": {
358
+ "$ref": "#/$defs/uuidUrn"
359
+ },
360
+ "interactionId": {
361
+ "$ref": "#/$defs/uuidUrn"
362
+ },
363
+ "descriptionDigest": {
364
+ "$ref": "#/$defs/digest"
365
+ },
366
+ "type": {
367
+ "$ref": "#/$defs/typeReference"
368
+ },
369
+ "operation": {
370
+ "$ref": "#/$defs/token"
371
+ },
372
+ "state": {
373
+ "enum": ["accepted", "completed", "failed", "pending", "approval-required"]
374
+ },
375
+ "target": {
376
+ "$ref": "#/$defs/target"
377
+ },
378
+ "recordedAt": {
379
+ "$ref": "#/$defs/dateTime"
380
+ },
381
+ "resultUrl": {
382
+ "$ref": "#/$defs/httpsIdentifier"
383
+ },
384
+ "actor": {
385
+ "type": "string",
386
+ "minLength": 1,
387
+ "maxLength": 240
388
+ },
389
+ "approvalUrl": {
390
+ "$ref": "#/$defs/httpsIdentifier"
391
+ },
392
+ "reason": {
393
+ "$ref": "#/$defs/token"
394
+ },
395
+ "output": {
396
+ "type": "object",
397
+ "maxProperties": 100
398
+ }
399
+ },
400
+ "required": [
401
+ "kind",
402
+ "profile",
403
+ "requestId",
404
+ "interactionId",
405
+ "descriptionDigest",
406
+ "type",
407
+ "operation",
408
+ "state",
409
+ "target",
410
+ "recordedAt",
411
+ "resultUrl",
412
+ "output"
413
+ ],
414
+ "allOf": [
415
+ {
416
+ "if": {
417
+ "type": "object",
418
+ "properties": {
419
+ "state": {
420
+ "const": "approval-required"
421
+ }
422
+ }
423
+ },
424
+ "then": {
425
+ "type": "object",
426
+ "required": ["approvalUrl"]
427
+ },
428
+ "else": {
429
+ "type": "object",
430
+ "not": {
431
+ "required": ["approvalUrl"]
432
+ }
433
+ }
434
+ },
435
+ {
436
+ "if": {
437
+ "type": "object",
438
+ "properties": {
439
+ "state": {
440
+ "const": "failed"
441
+ }
442
+ }
443
+ },
444
+ "then": {
445
+ "type": "object",
446
+ "required": ["reason"]
447
+ },
448
+ "else": {
449
+ "type": "object",
450
+ "not": {
451
+ "required": ["reason"]
452
+ }
453
+ }
454
+ }
455
+ ]
456
+ },
457
+ "problem": {
458
+ "type": "object",
459
+ "additionalProperties": false,
460
+ "properties": {
461
+ "type": {
462
+ "enum": [
463
+ "https://mailschema.org/problems/refused",
464
+ "https://mailschema.org/problems/authentication-required",
465
+ "https://mailschema.org/problems/result-not-found",
466
+ "https://mailschema.org/problems/stale-target",
467
+ "https://mailschema.org/problems/expired-interaction",
468
+ "https://mailschema.org/problems/invalid-request",
469
+ "https://mailschema.org/problems/unsupported-type",
470
+ "https://mailschema.org/problems/unsupported-operation",
471
+ "https://mailschema.org/problems/idempotency-conflict",
472
+ "https://mailschema.org/problems/request-in-progress",
473
+ "https://mailschema.org/problems/already-decided"
474
+ ]
475
+ },
476
+ "title": {
477
+ "type": "string",
478
+ "minLength": 1,
479
+ "maxLength": 240
480
+ },
481
+ "status": {
482
+ "type": "integer",
483
+ "minimum": 400,
484
+ "maximum": 599
485
+ },
486
+ "detail": {
487
+ "type": "string",
488
+ "minLength": 1,
489
+ "maxLength": 4000
490
+ },
491
+ "instance": {
492
+ "$ref": "#/$defs/identifier"
493
+ },
494
+ "profile": {
495
+ "$ref": "#/$defs/profile"
496
+ },
497
+ "requestId": {
498
+ "$ref": "#/$defs/uuidUrn"
499
+ },
500
+ "interactionId": {
501
+ "$ref": "#/$defs/uuidUrn"
502
+ },
503
+ "code": {
504
+ "enum": [
505
+ "refused",
506
+ "result-not-found",
507
+ "stale-target",
508
+ "expired-interaction",
509
+ "invalid-request",
510
+ "unsupported-type",
511
+ "unsupported-operation",
512
+ "idempotency-conflict",
513
+ "request-in-progress",
514
+ "already-decided"
515
+ ]
516
+ },
517
+ "target": {
518
+ "$ref": "#/$defs/target"
519
+ },
520
+ "errors": {
521
+ "type": "array",
522
+ "minItems": 1,
523
+ "maxItems": 100,
524
+ "items": {
525
+ "type": "object",
526
+ "additionalProperties": false,
527
+ "properties": {
528
+ "detail": {
529
+ "type": "string",
530
+ "minLength": 1,
531
+ "maxLength": 2000
532
+ },
533
+ "pointer": {
534
+ "type": "string",
535
+ "pattern": "^(?:/(?:[^~/]|~[01])*)*$",
536
+ "maxLength": 1000
537
+ }
538
+ },
539
+ "required": ["detail", "pointer"]
540
+ }
541
+ }
542
+ },
543
+ "required": ["type", "title", "status", "detail"],
544
+ "dependentRequired": {
545
+ "instance": ["profile", "requestId", "code"],
546
+ "profile": ["instance", "requestId", "code"],
547
+ "requestId": ["instance", "profile", "code"],
548
+ "interactionId": ["instance", "profile", "requestId", "code"],
549
+ "code": ["instance", "profile", "requestId"]
550
+ },
551
+ "allOf": [
552
+ {
553
+ "if": {
554
+ "properties": {
555
+ "type": {
556
+ "enum": [
557
+ "https://mailschema.org/problems/result-not-found",
558
+ "https://mailschema.org/problems/stale-target",
559
+ "https://mailschema.org/problems/expired-interaction",
560
+ "https://mailschema.org/problems/unsupported-type",
561
+ "https://mailschema.org/problems/unsupported-operation",
562
+ "https://mailschema.org/problems/idempotency-conflict",
563
+ "https://mailschema.org/problems/request-in-progress",
564
+ "https://mailschema.org/problems/already-decided"
565
+ ]
566
+ }
567
+ },
568
+ "required": ["type"]
569
+ },
570
+ "then": {
571
+ "required": ["code"]
572
+ }
573
+ },
574
+ {
575
+ "if": {
576
+ "required": ["errors"]
577
+ },
578
+ "then": {
579
+ "properties": {
580
+ "code": {
581
+ "const": "invalid-request"
582
+ }
583
+ },
584
+ "required": ["code"]
585
+ }
586
+ },
587
+ {
588
+ "if": {
589
+ "properties": {
590
+ "code": {
591
+ "not": {
592
+ "const": "result-not-found"
593
+ }
594
+ }
595
+ },
596
+ "required": ["code"]
597
+ },
598
+ "then": {
599
+ "required": ["interactionId"]
600
+ }
601
+ },
602
+ {
603
+ "if": {
604
+ "properties": {
605
+ "code": {
606
+ "const": "invalid-request"
607
+ }
608
+ },
609
+ "required": ["code"]
610
+ },
611
+ "then": {
612
+ "properties": {
613
+ "type": {
614
+ "const": "https://mailschema.org/problems/invalid-request"
615
+ },
616
+ "status": {
617
+ "const": 400
618
+ }
619
+ }
620
+ }
621
+ },
622
+ {
623
+ "if": {
624
+ "properties": {
625
+ "code": {
626
+ "const": "refused"
627
+ }
628
+ },
629
+ "required": ["code"]
630
+ },
631
+ "then": {
632
+ "properties": {
633
+ "type": {
634
+ "const": "https://mailschema.org/problems/refused"
635
+ },
636
+ "status": {
637
+ "const": 403
638
+ }
639
+ }
640
+ }
641
+ },
642
+ {
643
+ "if": {
644
+ "properties": {
645
+ "code": {
646
+ "const": "result-not-found"
647
+ }
648
+ },
649
+ "required": ["code"]
650
+ },
651
+ "then": {
652
+ "properties": {
653
+ "type": {
654
+ "const": "https://mailschema.org/problems/result-not-found"
655
+ },
656
+ "status": {
657
+ "const": 404
658
+ }
659
+ }
660
+ }
661
+ },
662
+ {
663
+ "if": {
664
+ "properties": {
665
+ "code": {
666
+ "const": "stale-target"
667
+ }
668
+ },
669
+ "required": ["code"]
670
+ },
671
+ "then": {
672
+ "properties": {
673
+ "type": {
674
+ "const": "https://mailschema.org/problems/stale-target"
675
+ },
676
+ "status": {
677
+ "const": 409
678
+ }
679
+ },
680
+ "required": ["target"]
681
+ }
682
+ },
683
+ {
684
+ "if": {
685
+ "properties": {
686
+ "code": {
687
+ "const": "idempotency-conflict"
688
+ }
689
+ },
690
+ "required": ["code"]
691
+ },
692
+ "then": {
693
+ "properties": {
694
+ "type": {
695
+ "const": "https://mailschema.org/problems/idempotency-conflict"
696
+ },
697
+ "status": {
698
+ "const": 409
699
+ }
700
+ }
701
+ }
702
+ },
703
+ {
704
+ "if": {
705
+ "properties": {
706
+ "code": {
707
+ "const": "request-in-progress"
708
+ }
709
+ },
710
+ "required": ["code"]
711
+ },
712
+ "then": {
713
+ "properties": {
714
+ "type": {
715
+ "const": "https://mailschema.org/problems/request-in-progress"
716
+ },
717
+ "status": {
718
+ "const": 409
719
+ }
720
+ }
721
+ }
722
+ },
723
+ {
724
+ "if": {
725
+ "properties": {
726
+ "code": {
727
+ "const": "already-decided"
728
+ }
729
+ },
730
+ "required": ["code"]
731
+ },
732
+ "then": {
733
+ "properties": {
734
+ "type": {
735
+ "const": "https://mailschema.org/problems/already-decided"
736
+ },
737
+ "status": {
738
+ "const": 409
739
+ }
740
+ }
741
+ }
742
+ },
743
+ {
744
+ "if": {
745
+ "properties": {
746
+ "code": {
747
+ "const": "expired-interaction"
748
+ }
749
+ },
750
+ "required": ["code"]
751
+ },
752
+ "then": {
753
+ "properties": {
754
+ "type": {
755
+ "const": "https://mailschema.org/problems/expired-interaction"
756
+ },
757
+ "status": {
758
+ "const": 410
759
+ }
760
+ }
761
+ }
762
+ },
763
+ {
764
+ "if": {
765
+ "properties": {
766
+ "code": {
767
+ "const": "unsupported-type"
768
+ }
769
+ },
770
+ "required": ["code"]
771
+ },
772
+ "then": {
773
+ "properties": {
774
+ "type": {
775
+ "const": "https://mailschema.org/problems/unsupported-type"
776
+ },
777
+ "status": {
778
+ "const": 422
779
+ }
780
+ }
781
+ }
782
+ },
783
+ {
784
+ "if": {
785
+ "properties": {
786
+ "code": {
787
+ "const": "unsupported-operation"
788
+ }
789
+ },
790
+ "required": ["code"]
791
+ },
792
+ "then": {
793
+ "properties": {
794
+ "type": {
795
+ "const": "https://mailschema.org/problems/unsupported-operation"
796
+ },
797
+ "status": {
798
+ "const": 422
799
+ }
800
+ }
801
+ }
802
+ },
803
+ {
804
+ "if": {
805
+ "properties": {
806
+ "type": {
807
+ "const": "https://mailschema.org/problems/invalid-request"
808
+ }
809
+ },
810
+ "required": ["type"]
811
+ },
812
+ "then": {
813
+ "properties": {
814
+ "status": {
815
+ "const": 400
816
+ }
817
+ }
818
+ }
819
+ },
820
+ {
821
+ "if": {
822
+ "properties": {
823
+ "type": {
824
+ "const": "https://mailschema.org/problems/authentication-required"
825
+ }
826
+ },
827
+ "required": ["type"]
828
+ },
829
+ "then": {
830
+ "properties": {
831
+ "status": {
832
+ "const": 401
833
+ }
834
+ }
835
+ }
836
+ },
837
+ {
838
+ "if": {
839
+ "properties": {
840
+ "type": {
841
+ "const": "https://mailschema.org/problems/refused"
842
+ }
843
+ },
844
+ "required": ["type"]
845
+ },
846
+ "then": {
847
+ "properties": {
848
+ "status": {
849
+ "const": 403
850
+ }
851
+ }
852
+ }
853
+ },
854
+ {
855
+ "if": {
856
+ "properties": {
857
+ "type": {
858
+ "const": "https://mailschema.org/problems/result-not-found"
859
+ }
860
+ },
861
+ "required": ["type"]
862
+ },
863
+ "then": {
864
+ "properties": {
865
+ "status": {
866
+ "const": 404
867
+ }
868
+ }
869
+ }
870
+ },
871
+ {
872
+ "if": {
873
+ "properties": {
874
+ "type": {
875
+ "const": "https://mailschema.org/problems/stale-target"
876
+ }
877
+ },
878
+ "required": ["type"]
879
+ },
880
+ "then": {
881
+ "properties": {
882
+ "status": {
883
+ "const": 409
884
+ }
885
+ }
886
+ }
887
+ },
888
+ {
889
+ "if": {
890
+ "properties": {
891
+ "type": {
892
+ "const": "https://mailschema.org/problems/idempotency-conflict"
893
+ }
894
+ },
895
+ "required": ["type"]
896
+ },
897
+ "then": {
898
+ "properties": {
899
+ "status": {
900
+ "const": 409
901
+ }
902
+ }
903
+ }
904
+ },
905
+ {
906
+ "if": {
907
+ "properties": {
908
+ "type": {
909
+ "const": "https://mailschema.org/problems/request-in-progress"
910
+ }
911
+ },
912
+ "required": ["type"]
913
+ },
914
+ "then": {
915
+ "properties": {
916
+ "status": {
917
+ "const": 409
918
+ }
919
+ }
920
+ }
921
+ },
922
+ {
923
+ "if": {
924
+ "properties": {
925
+ "type": {
926
+ "const": "https://mailschema.org/problems/already-decided"
927
+ }
928
+ },
929
+ "required": ["type"]
930
+ },
931
+ "then": {
932
+ "properties": {
933
+ "status": {
934
+ "const": 409
935
+ }
936
+ }
937
+ }
938
+ },
939
+ {
940
+ "if": {
941
+ "properties": {
942
+ "type": {
943
+ "const": "https://mailschema.org/problems/expired-interaction"
944
+ }
945
+ },
946
+ "required": ["type"]
947
+ },
948
+ "then": {
949
+ "properties": {
950
+ "status": {
951
+ "const": 410
952
+ }
953
+ }
954
+ }
955
+ },
956
+ {
957
+ "if": {
958
+ "properties": {
959
+ "type": {
960
+ "const": "https://mailschema.org/problems/unsupported-type"
961
+ }
962
+ },
963
+ "required": ["type"]
964
+ },
965
+ "then": {
966
+ "properties": {
967
+ "status": {
968
+ "const": 422
969
+ }
970
+ }
971
+ }
972
+ },
973
+ {
974
+ "if": {
975
+ "properties": {
976
+ "type": {
977
+ "const": "https://mailschema.org/problems/unsupported-operation"
978
+ }
979
+ },
980
+ "required": ["type"]
981
+ },
982
+ "then": {
983
+ "properties": {
984
+ "status": {
985
+ "const": 422
986
+ }
987
+ }
988
+ }
989
+ }
990
+ ]
991
+ },
992
+ "detailsKey": {
993
+ "type": "string",
994
+ "pattern": "^[A-Za-z][A-Za-z0-9_]{0,63}$"
995
+ },
996
+ "detailsValue": {
997
+ "anyOf": [
998
+ {
999
+ "type": "string",
1000
+ "maxLength": 12000
1001
+ },
1002
+ {
1003
+ "type": "integer",
1004
+ "minimum": -9007199254740991,
1005
+ "maximum": 9007199254740991
1006
+ },
1007
+ {
1008
+ "type": "boolean"
1009
+ },
1010
+ {
1011
+ "type": "null"
1012
+ },
1013
+ {
1014
+ "type": "array",
1015
+ "maxItems": 100,
1016
+ "items": {
1017
+ "$ref": "#/$defs/detailsValue"
1018
+ }
1019
+ },
1020
+ {
1021
+ "type": "object",
1022
+ "maxProperties": 100,
1023
+ "propertyNames": {
1024
+ "$ref": "#/$defs/detailsKey"
1025
+ },
1026
+ "additionalProperties": {
1027
+ "$ref": "#/$defs/detailsValue"
1028
+ }
1029
+ }
1030
+ ]
1031
+ }
1032
+ }
1033
+ }