mailschema 0.1.2 → 0.1.4
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/README.md +12 -1
- package/dist/content-review-0.1.contract.json +58 -0
- package/dist/content-review-0.1.schema.json +46 -44
- package/dist/content-review-0.2.contract.json +91 -0
- package/dist/content-review-0.2.schema.json +54 -0
- package/dist/contribution.schema.json +846 -846
- package/dist/index.d.ts +1 -1
- package/dist/index.js +1 -1
- package/dist/map-0.1.schema.json +388 -252
- package/dist/map.d.ts +5 -0
- package/dist/map.js +27 -5
- package/package.json +5 -2
package/dist/map-0.1.schema.json
CHANGED
|
@@ -1,275 +1,411 @@
|
|
|
1
1
|
{
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
2
|
+
"$schema": "https://json-schema.org/draft/2020-12/schema",
|
|
3
|
+
"$id": "https://mailschema.org/schemas/map-0.1.schema.json",
|
|
4
|
+
"title": "Mail Action Protocol 0.1",
|
|
5
|
+
"description": "Description, request, result and problem documents for the MAP 0.1 authenticated HTTPS profile.",
|
|
6
|
+
"oneOf": [
|
|
7
|
+
{ "$ref": "#/$defs/description" },
|
|
8
|
+
{ "$ref": "#/$defs/request" },
|
|
9
|
+
{ "$ref": "#/$defs/result" },
|
|
10
|
+
{ "$ref": "#/$defs/problem" }
|
|
11
|
+
],
|
|
12
|
+
"$defs": {
|
|
13
|
+
"profile": {
|
|
14
|
+
"const": "https://mailschema.org/profiles/map/0.1"
|
|
15
|
+
},
|
|
16
|
+
"identifier": {
|
|
17
|
+
"type": "string",
|
|
18
|
+
"format": "uri",
|
|
19
|
+
"maxLength": 2048
|
|
20
|
+
},
|
|
21
|
+
"httpsIdentifier": {
|
|
22
|
+
"type": "string",
|
|
23
|
+
"format": "uri",
|
|
24
|
+
"pattern": "^https://",
|
|
25
|
+
"maxLength": 2048
|
|
26
|
+
},
|
|
27
|
+
"uuidUrn": {
|
|
28
|
+
"type": "string",
|
|
29
|
+
"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}$"
|
|
30
|
+
},
|
|
31
|
+
"digest": {
|
|
32
|
+
"type": "string",
|
|
33
|
+
"pattern": "^sha-256:[a-f0-9]{64}$"
|
|
34
|
+
},
|
|
35
|
+
"contractDigest": {
|
|
36
|
+
"type": "string",
|
|
37
|
+
"pattern": "^sha-256:[a-f0-9]{64}$"
|
|
38
|
+
},
|
|
39
|
+
"typeReference": {
|
|
40
|
+
"type": "object",
|
|
41
|
+
"additionalProperties": false,
|
|
42
|
+
"properties": {
|
|
43
|
+
"id": { "$ref": "#/$defs/identifier" },
|
|
44
|
+
"version": {
|
|
45
|
+
"type": "string",
|
|
46
|
+
"pattern": "^[0-9]+\\.[0-9]+(?:\\.[0-9]+)?(?:-[a-zA-Z0-9.-]+)?$",
|
|
47
|
+
"maxLength": 80
|
|
15
48
|
},
|
|
16
|
-
"
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
49
|
+
"contractDigest": { "$ref": "#/$defs/contractDigest" }
|
|
50
|
+
},
|
|
51
|
+
"required": ["id", "version", "contractDigest"]
|
|
52
|
+
},
|
|
53
|
+
"target": {
|
|
54
|
+
"type": "object",
|
|
55
|
+
"additionalProperties": false,
|
|
56
|
+
"properties": {
|
|
57
|
+
"id": { "$ref": "#/$defs/identifier" },
|
|
58
|
+
"revision": { "type": "string", "minLength": 1, "maxLength": 240 },
|
|
59
|
+
"title": { "type": "string", "minLength": 1, "maxLength": 500 },
|
|
60
|
+
"digest": { "$ref": "#/$defs/digest" }
|
|
61
|
+
},
|
|
62
|
+
"required": ["id", "revision", "digest"]
|
|
63
|
+
},
|
|
64
|
+
"operation": {
|
|
65
|
+
"type": "object",
|
|
66
|
+
"additionalProperties": false,
|
|
67
|
+
"properties": {
|
|
68
|
+
"id": {
|
|
69
|
+
"type": "string",
|
|
70
|
+
"pattern": "^[a-z][a-z0-9]*(?:-[a-z0-9]+)*$",
|
|
71
|
+
"maxLength": 100
|
|
20
72
|
},
|
|
21
|
-
"
|
|
22
|
-
|
|
23
|
-
|
|
73
|
+
"name": { "type": "string", "minLength": 1, "maxLength": 240 },
|
|
74
|
+
"description": { "type": "string", "minLength": 1, "maxLength": 2000 },
|
|
75
|
+
"inputSchema": { "$ref": "#/$defs/identifier" }
|
|
76
|
+
},
|
|
77
|
+
"required": ["id", "name", "description", "inputSchema"]
|
|
78
|
+
},
|
|
79
|
+
"description": {
|
|
80
|
+
"type": "object",
|
|
81
|
+
"additionalProperties": false,
|
|
82
|
+
"properties": {
|
|
83
|
+
"@context": {
|
|
84
|
+
"const": "https://mailschema.org/contexts/map-0.1.jsonld"
|
|
24
85
|
},
|
|
25
|
-
"
|
|
26
|
-
|
|
27
|
-
|
|
86
|
+
"@type": { "const": "MailAction" },
|
|
87
|
+
"@id": { "$ref": "#/$defs/uuidUrn" },
|
|
88
|
+
"profile": { "$ref": "#/$defs/profile" },
|
|
89
|
+
"type": { "$ref": "#/$defs/typeReference" },
|
|
90
|
+
"describedAt": { "type": "string", "format": "date-time" },
|
|
91
|
+
"expiresAt": { "type": "string", "format": "date-time" },
|
|
92
|
+
"service": {
|
|
93
|
+
"type": "object",
|
|
94
|
+
"additionalProperties": false,
|
|
95
|
+
"properties": {
|
|
96
|
+
"id": { "$ref": "#/$defs/identifier" },
|
|
97
|
+
"name": { "type": "string", "minLength": 1, "maxLength": 240 },
|
|
98
|
+
"execution": {
|
|
99
|
+
"type": "object",
|
|
100
|
+
"additionalProperties": false,
|
|
101
|
+
"properties": {
|
|
102
|
+
"url": { "$ref": "#/$defs/httpsIdentifier" },
|
|
103
|
+
"method": { "const": "POST" },
|
|
104
|
+
"requestMediaType": { "const": "application/json" },
|
|
105
|
+
"resultMediaType": { "const": "application/json" },
|
|
106
|
+
"resultUrlTemplate": {
|
|
107
|
+
"type": "string",
|
|
108
|
+
"format": "uri-template",
|
|
109
|
+
"pattern": "^https://.*\\{requestId\\}.*$",
|
|
110
|
+
"maxLength": 2048
|
|
111
|
+
},
|
|
112
|
+
"resultRetentionSeconds": {
|
|
113
|
+
"type": "integer",
|
|
114
|
+
"minimum": 300,
|
|
115
|
+
"maximum": 31536000
|
|
116
|
+
}
|
|
117
|
+
},
|
|
118
|
+
"required": [
|
|
119
|
+
"url",
|
|
120
|
+
"method",
|
|
121
|
+
"requestMediaType",
|
|
122
|
+
"resultMediaType",
|
|
123
|
+
"resultUrlTemplate",
|
|
124
|
+
"resultRetentionSeconds"
|
|
125
|
+
]
|
|
126
|
+
},
|
|
127
|
+
"humanUrl": { "$ref": "#/$defs/httpsIdentifier" },
|
|
128
|
+
"authorization": {
|
|
129
|
+
"type": "object",
|
|
130
|
+
"additionalProperties": false,
|
|
131
|
+
"properties": {
|
|
132
|
+
"kind": { "const": "service-configured" },
|
|
133
|
+
"schemes": {
|
|
134
|
+
"type": "array",
|
|
135
|
+
"items": { "enum": ["oauth2", "bearer", "session"] },
|
|
136
|
+
"minItems": 1,
|
|
137
|
+
"uniqueItems": true
|
|
138
|
+
},
|
|
139
|
+
"audience": { "type": "string", "minLength": 1, "maxLength": 500 }
|
|
140
|
+
},
|
|
141
|
+
"required": ["kind", "schemes"]
|
|
142
|
+
}
|
|
143
|
+
},
|
|
144
|
+
"required": ["id", "name", "execution", "humanUrl", "authorization"]
|
|
145
|
+
},
|
|
146
|
+
"target": { "$ref": "#/$defs/target" },
|
|
147
|
+
"operations": {
|
|
148
|
+
"type": "array",
|
|
149
|
+
"items": { "$ref": "#/$defs/operation" },
|
|
150
|
+
"minItems": 1,
|
|
151
|
+
"maxItems": 100
|
|
152
|
+
}
|
|
153
|
+
},
|
|
154
|
+
"required": [
|
|
155
|
+
"@context",
|
|
156
|
+
"@type",
|
|
157
|
+
"@id",
|
|
158
|
+
"profile",
|
|
159
|
+
"type",
|
|
160
|
+
"describedAt",
|
|
161
|
+
"expiresAt",
|
|
162
|
+
"service",
|
|
163
|
+
"target",
|
|
164
|
+
"operations"
|
|
165
|
+
]
|
|
166
|
+
},
|
|
167
|
+
"request": {
|
|
168
|
+
"type": "object",
|
|
169
|
+
"additionalProperties": false,
|
|
170
|
+
"properties": {
|
|
171
|
+
"kind": { "const": "MapRequest" },
|
|
172
|
+
"profile": { "$ref": "#/$defs/profile" },
|
|
173
|
+
"requestId": { "$ref": "#/$defs/uuidUrn" },
|
|
174
|
+
"interactionId": { "$ref": "#/$defs/uuidUrn" },
|
|
175
|
+
"type": { "$ref": "#/$defs/typeReference" },
|
|
176
|
+
"operation": {
|
|
177
|
+
"type": "string",
|
|
178
|
+
"pattern": "^[a-z][a-z0-9]*(?:-[a-z0-9]+)*$",
|
|
179
|
+
"maxLength": 100
|
|
180
|
+
},
|
|
181
|
+
"target": { "$ref": "#/$defs/target" },
|
|
182
|
+
"input": { "type": "object", "maxProperties": 100 }
|
|
183
|
+
},
|
|
184
|
+
"required": [
|
|
185
|
+
"kind",
|
|
186
|
+
"profile",
|
|
187
|
+
"requestId",
|
|
188
|
+
"interactionId",
|
|
189
|
+
"type",
|
|
190
|
+
"operation",
|
|
191
|
+
"target",
|
|
192
|
+
"input"
|
|
193
|
+
]
|
|
194
|
+
},
|
|
195
|
+
"result": {
|
|
196
|
+
"type": "object",
|
|
197
|
+
"additionalProperties": false,
|
|
198
|
+
"properties": {
|
|
199
|
+
"kind": { "const": "MapResult" },
|
|
200
|
+
"profile": { "$ref": "#/$defs/profile" },
|
|
201
|
+
"requestId": { "$ref": "#/$defs/uuidUrn" },
|
|
202
|
+
"interactionId": { "$ref": "#/$defs/uuidUrn" },
|
|
203
|
+
"type": { "$ref": "#/$defs/typeReference" },
|
|
204
|
+
"operation": {
|
|
205
|
+
"type": "string",
|
|
206
|
+
"pattern": "^[a-z][a-z0-9]*(?:-[a-z0-9]+)*$",
|
|
207
|
+
"maxLength": 100
|
|
28
208
|
},
|
|
29
|
-
"
|
|
30
|
-
|
|
31
|
-
"pattern": "^sha-256:[a-f0-9]{64}$"
|
|
209
|
+
"state": {
|
|
210
|
+
"enum": ["accepted", "completed", "failed", "pending", "approval-required"]
|
|
32
211
|
},
|
|
33
|
-
"
|
|
34
|
-
|
|
35
|
-
|
|
212
|
+
"target": { "$ref": "#/$defs/target" },
|
|
213
|
+
"recordedAt": { "type": "string", "format": "date-time" },
|
|
214
|
+
"resultUrl": { "$ref": "#/$defs/httpsIdentifier" },
|
|
215
|
+
"output": { "type": "object", "maxProperties": 100 }
|
|
216
|
+
},
|
|
217
|
+
"required": [
|
|
218
|
+
"kind",
|
|
219
|
+
"profile",
|
|
220
|
+
"requestId",
|
|
221
|
+
"interactionId",
|
|
222
|
+
"type",
|
|
223
|
+
"operation",
|
|
224
|
+
"state",
|
|
225
|
+
"target",
|
|
226
|
+
"recordedAt",
|
|
227
|
+
"resultUrl",
|
|
228
|
+
"output"
|
|
229
|
+
]
|
|
230
|
+
},
|
|
231
|
+
"problem": {
|
|
232
|
+
"type": "object",
|
|
233
|
+
"additionalProperties": false,
|
|
234
|
+
"properties": {
|
|
235
|
+
"type": {
|
|
236
|
+
"enum": [
|
|
237
|
+
"https://mailschema.org/problems/refused",
|
|
238
|
+
"https://mailschema.org/problems/authentication-required",
|
|
239
|
+
"https://mailschema.org/problems/result-not-found",
|
|
240
|
+
"https://mailschema.org/problems/stale-target",
|
|
241
|
+
"https://mailschema.org/problems/expired-interaction",
|
|
242
|
+
"https://mailschema.org/problems/invalid-request",
|
|
243
|
+
"https://mailschema.org/problems/unsupported-profile",
|
|
244
|
+
"https://mailschema.org/problems/unsupported-type",
|
|
245
|
+
"https://mailschema.org/problems/unsupported-operation",
|
|
246
|
+
"https://mailschema.org/problems/idempotency-conflict",
|
|
247
|
+
"https://mailschema.org/problems/request-in-progress"
|
|
248
|
+
]
|
|
249
|
+
},
|
|
250
|
+
"title": { "type": "string", "minLength": 1, "maxLength": 240 },
|
|
251
|
+
"status": { "type": "integer", "minimum": 400, "maximum": 599 },
|
|
252
|
+
"detail": { "type": "string", "minLength": 1, "maxLength": 4000 },
|
|
253
|
+
"instance": { "$ref": "#/$defs/identifier" },
|
|
254
|
+
"profile": { "$ref": "#/$defs/profile" },
|
|
255
|
+
"requestId": { "$ref": "#/$defs/uuidUrn" },
|
|
256
|
+
"interactionId": { "$ref": "#/$defs/uuidUrn" },
|
|
257
|
+
"code": {
|
|
258
|
+
"enum": [
|
|
259
|
+
"refused",
|
|
260
|
+
"authentication-required",
|
|
261
|
+
"result-not-found",
|
|
262
|
+
"stale-target",
|
|
263
|
+
"expired-interaction",
|
|
264
|
+
"invalid-request",
|
|
265
|
+
"unsupported-profile",
|
|
266
|
+
"unsupported-type",
|
|
267
|
+
"unsupported-operation",
|
|
268
|
+
"idempotency-conflict",
|
|
269
|
+
"request-in-progress"
|
|
270
|
+
]
|
|
271
|
+
},
|
|
272
|
+
"target": { "$ref": "#/$defs/target" }
|
|
273
|
+
},
|
|
274
|
+
"required": ["type", "title", "status", "detail"],
|
|
275
|
+
"dependentRequired": {
|
|
276
|
+
"instance": ["profile", "requestId", "code"],
|
|
277
|
+
"profile": ["instance", "requestId", "code"],
|
|
278
|
+
"requestId": ["instance", "profile", "code"],
|
|
279
|
+
"interactionId": ["instance", "profile", "requestId", "code"],
|
|
280
|
+
"code": ["instance", "profile", "requestId"]
|
|
281
|
+
},
|
|
282
|
+
"allOf": [
|
|
283
|
+
{
|
|
284
|
+
"if": {
|
|
285
|
+
"properties": { "code": { "not": { "const": "result-not-found" } } },
|
|
286
|
+
"required": ["code"]
|
|
287
|
+
},
|
|
288
|
+
"then": { "required": ["interactionId"] }
|
|
289
|
+
},
|
|
290
|
+
{
|
|
291
|
+
"if": { "properties": { "code": { "const": "invalid-request" } }, "required": ["code"] },
|
|
292
|
+
"then": {
|
|
36
293
|
"properties": {
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
"maxLength": 80
|
|
42
|
-
},
|
|
43
|
-
"recordDigest": { "$ref": "#/$defs/recordDigest" }
|
|
44
|
-
},
|
|
45
|
-
"required": ["id", "version", "recordDigest"]
|
|
294
|
+
"type": { "const": "https://mailschema.org/problems/invalid-request" },
|
|
295
|
+
"status": { "const": 400 }
|
|
296
|
+
}
|
|
297
|
+
}
|
|
46
298
|
},
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
"
|
|
299
|
+
{
|
|
300
|
+
"if": {
|
|
301
|
+
"properties": { "code": { "const": "authentication-required" } },
|
|
302
|
+
"required": ["code"]
|
|
303
|
+
},
|
|
304
|
+
"then": {
|
|
50
305
|
"properties": {
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
},
|
|
56
|
-
"required": ["id", "revision", "digest"]
|
|
306
|
+
"type": { "const": "https://mailschema.org/problems/authentication-required" },
|
|
307
|
+
"status": { "const": 401 }
|
|
308
|
+
}
|
|
309
|
+
}
|
|
57
310
|
},
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
311
|
+
{
|
|
312
|
+
"if": { "properties": { "code": { "const": "refused" } }, "required": ["code"] },
|
|
313
|
+
"then": {
|
|
61
314
|
"properties": {
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
},
|
|
67
|
-
"name": { "type": "string", "minLength": 1, "maxLength": 240 },
|
|
68
|
-
"description": { "type": "string", "minLength": 1, "maxLength": 2000 },
|
|
69
|
-
"inputSchema": { "$ref": "#/$defs/identifier" }
|
|
70
|
-
},
|
|
71
|
-
"required": ["id", "name", "description", "inputSchema"]
|
|
315
|
+
"type": { "const": "https://mailschema.org/problems/refused" },
|
|
316
|
+
"status": { "const": 403 }
|
|
317
|
+
}
|
|
318
|
+
}
|
|
72
319
|
},
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
320
|
+
{
|
|
321
|
+
"if": { "properties": { "code": { "const": "result-not-found" } }, "required": ["code"] },
|
|
322
|
+
"then": {
|
|
76
323
|
"properties": {
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
"@id": { "$ref": "#/$defs/uuidUrn" },
|
|
82
|
-
"profile": { "$ref": "#/$defs/profile" },
|
|
83
|
-
"type": { "$ref": "#/$defs/typeReference" },
|
|
84
|
-
"describedAt": { "type": "string", "format": "date-time" },
|
|
85
|
-
"expiresAt": { "type": "string", "format": "date-time" },
|
|
86
|
-
"service": {
|
|
87
|
-
"type": "object",
|
|
88
|
-
"additionalProperties": false,
|
|
89
|
-
"properties": {
|
|
90
|
-
"id": { "$ref": "#/$defs/identifier" },
|
|
91
|
-
"name": { "type": "string", "minLength": 1, "maxLength": 240 },
|
|
92
|
-
"execution": {
|
|
93
|
-
"type": "object",
|
|
94
|
-
"additionalProperties": false,
|
|
95
|
-
"properties": {
|
|
96
|
-
"url": { "$ref": "#/$defs/identifier" },
|
|
97
|
-
"method": { "const": "POST" },
|
|
98
|
-
"requestMediaType": { "const": "application/json" },
|
|
99
|
-
"resultMediaType": { "const": "application/json" },
|
|
100
|
-
"resultUrlTemplate": {
|
|
101
|
-
"type": "string",
|
|
102
|
-
"format": "uri-template",
|
|
103
|
-
"pattern": "^https://.*\\{requestId\\}.*$",
|
|
104
|
-
"maxLength": 2048
|
|
105
|
-
},
|
|
106
|
-
"resultRetentionSeconds": {
|
|
107
|
-
"type": "integer",
|
|
108
|
-
"minimum": 300,
|
|
109
|
-
"maximum": 31536000
|
|
110
|
-
}
|
|
111
|
-
},
|
|
112
|
-
"required": [
|
|
113
|
-
"url",
|
|
114
|
-
"method",
|
|
115
|
-
"requestMediaType",
|
|
116
|
-
"resultMediaType",
|
|
117
|
-
"resultUrlTemplate",
|
|
118
|
-
"resultRetentionSeconds"
|
|
119
|
-
]
|
|
120
|
-
},
|
|
121
|
-
"humanUrl": { "$ref": "#/$defs/identifier" },
|
|
122
|
-
"authorization": {
|
|
123
|
-
"type": "object",
|
|
124
|
-
"additionalProperties": false,
|
|
125
|
-
"properties": {
|
|
126
|
-
"kind": { "const": "service-configured" },
|
|
127
|
-
"schemes": {
|
|
128
|
-
"type": "array",
|
|
129
|
-
"items": { "enum": ["oauth2", "bearer", "session"] },
|
|
130
|
-
"minItems": 1,
|
|
131
|
-
"uniqueItems": true
|
|
132
|
-
},
|
|
133
|
-
"audience": { "type": "string", "minLength": 1, "maxLength": 500 }
|
|
134
|
-
},
|
|
135
|
-
"required": ["kind", "schemes"]
|
|
136
|
-
}
|
|
137
|
-
},
|
|
138
|
-
"required": ["id", "name", "execution", "humanUrl", "authorization"]
|
|
139
|
-
},
|
|
140
|
-
"target": { "$ref": "#/$defs/target" },
|
|
141
|
-
"operations": {
|
|
142
|
-
"type": "array",
|
|
143
|
-
"items": { "$ref": "#/$defs/operation" },
|
|
144
|
-
"minItems": 1,
|
|
145
|
-
"maxItems": 100
|
|
146
|
-
}
|
|
147
|
-
},
|
|
148
|
-
"required": [
|
|
149
|
-
"@context",
|
|
150
|
-
"@type",
|
|
151
|
-
"@id",
|
|
152
|
-
"profile",
|
|
153
|
-
"type",
|
|
154
|
-
"describedAt",
|
|
155
|
-
"expiresAt",
|
|
156
|
-
"service",
|
|
157
|
-
"target",
|
|
158
|
-
"operations"
|
|
159
|
-
]
|
|
324
|
+
"type": { "const": "https://mailschema.org/problems/result-not-found" },
|
|
325
|
+
"status": { "const": 404 }
|
|
326
|
+
}
|
|
327
|
+
}
|
|
160
328
|
},
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
|
|
329
|
+
{
|
|
330
|
+
"if": { "properties": { "code": { "const": "stale-target" } }, "required": ["code"] },
|
|
331
|
+
"then": {
|
|
164
332
|
"properties": {
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
"requestId": { "$ref": "#/$defs/uuidUrn" },
|
|
168
|
-
"interactionId": { "$ref": "#/$defs/uuidUrn" },
|
|
169
|
-
"requestedAt": { "type": "string", "format": "date-time" },
|
|
170
|
-
"type": { "$ref": "#/$defs/typeReference" },
|
|
171
|
-
"operation": {
|
|
172
|
-
"type": "string",
|
|
173
|
-
"pattern": "^[a-z][a-z0-9]*(?:-[a-z0-9]+)*$",
|
|
174
|
-
"maxLength": 100
|
|
175
|
-
},
|
|
176
|
-
"target": { "$ref": "#/$defs/target" },
|
|
177
|
-
"input": { "type": "object", "maxProperties": 100 }
|
|
333
|
+
"type": { "const": "https://mailschema.org/problems/stale-target" },
|
|
334
|
+
"status": { "const": 409 }
|
|
178
335
|
},
|
|
179
|
-
"required": [
|
|
180
|
-
|
|
181
|
-
"profile",
|
|
182
|
-
"requestId",
|
|
183
|
-
"interactionId",
|
|
184
|
-
"requestedAt",
|
|
185
|
-
"type",
|
|
186
|
-
"operation",
|
|
187
|
-
"target",
|
|
188
|
-
"input"
|
|
189
|
-
]
|
|
336
|
+
"required": ["target"]
|
|
337
|
+
}
|
|
190
338
|
},
|
|
191
|
-
|
|
192
|
-
|
|
193
|
-
"
|
|
339
|
+
{
|
|
340
|
+
"if": {
|
|
341
|
+
"properties": { "code": { "const": "idempotency-conflict" } },
|
|
342
|
+
"required": ["code"]
|
|
343
|
+
},
|
|
344
|
+
"then": {
|
|
194
345
|
"properties": {
|
|
195
|
-
|
|
196
|
-
|
|
197
|
-
|
|
198
|
-
|
|
199
|
-
"operation": {
|
|
200
|
-
"type": "string",
|
|
201
|
-
"pattern": "^[a-z][a-z0-9]*(?:-[a-z0-9]+)*$",
|
|
202
|
-
"maxLength": 100
|
|
203
|
-
},
|
|
204
|
-
"state": { "enum": ["accepted", "completed", "pending", "approval-required"] },
|
|
205
|
-
"target": { "$ref": "#/$defs/target" },
|
|
206
|
-
"recordedAt": { "type": "string", "format": "date-time" },
|
|
207
|
-
"resultUrl": { "$ref": "#/$defs/identifier" },
|
|
208
|
-
"output": { "type": "object", "maxProperties": 100 }
|
|
209
|
-
},
|
|
210
|
-
"required": [
|
|
211
|
-
"kind",
|
|
212
|
-
"profile",
|
|
213
|
-
"requestId",
|
|
214
|
-
"interactionId",
|
|
215
|
-
"operation",
|
|
216
|
-
"state",
|
|
217
|
-
"target",
|
|
218
|
-
"recordedAt",
|
|
219
|
-
"resultUrl",
|
|
220
|
-
"output"
|
|
221
|
-
]
|
|
346
|
+
"type": { "const": "https://mailschema.org/problems/idempotency-conflict" },
|
|
347
|
+
"status": { "const": 409 }
|
|
348
|
+
}
|
|
349
|
+
}
|
|
222
350
|
},
|
|
223
|
-
|
|
224
|
-
|
|
225
|
-
"
|
|
351
|
+
{
|
|
352
|
+
"if": {
|
|
353
|
+
"properties": { "code": { "const": "request-in-progress" } },
|
|
354
|
+
"required": ["code"]
|
|
355
|
+
},
|
|
356
|
+
"then": {
|
|
226
357
|
"properties": {
|
|
227
|
-
|
|
228
|
-
|
|
229
|
-
|
|
230
|
-
|
|
231
|
-
|
|
232
|
-
|
|
233
|
-
|
|
234
|
-
|
|
235
|
-
|
|
236
|
-
|
|
237
|
-
|
|
238
|
-
|
|
239
|
-
|
|
240
|
-
|
|
241
|
-
|
|
242
|
-
|
|
243
|
-
|
|
244
|
-
|
|
245
|
-
|
|
246
|
-
|
|
247
|
-
|
|
248
|
-
|
|
249
|
-
|
|
250
|
-
|
|
251
|
-
|
|
252
|
-
|
|
253
|
-
|
|
254
|
-
|
|
255
|
-
|
|
256
|
-
|
|
257
|
-
|
|
258
|
-
|
|
259
|
-
|
|
260
|
-
|
|
261
|
-
|
|
262
|
-
|
|
263
|
-
|
|
264
|
-
|
|
265
|
-
|
|
266
|
-
|
|
267
|
-
|
|
268
|
-
|
|
269
|
-
|
|
270
|
-
|
|
271
|
-
|
|
272
|
-
|
|
358
|
+
"type": { "const": "https://mailschema.org/problems/request-in-progress" },
|
|
359
|
+
"status": { "const": 409 }
|
|
360
|
+
}
|
|
361
|
+
}
|
|
362
|
+
},
|
|
363
|
+
{
|
|
364
|
+
"if": {
|
|
365
|
+
"properties": { "code": { "const": "expired-interaction" } },
|
|
366
|
+
"required": ["code"]
|
|
367
|
+
},
|
|
368
|
+
"then": {
|
|
369
|
+
"properties": {
|
|
370
|
+
"type": { "const": "https://mailschema.org/problems/expired-interaction" },
|
|
371
|
+
"status": { "const": 410 }
|
|
372
|
+
}
|
|
373
|
+
}
|
|
374
|
+
},
|
|
375
|
+
{
|
|
376
|
+
"if": {
|
|
377
|
+
"properties": { "code": { "const": "unsupported-profile" } },
|
|
378
|
+
"required": ["code"]
|
|
379
|
+
},
|
|
380
|
+
"then": {
|
|
381
|
+
"properties": {
|
|
382
|
+
"type": { "const": "https://mailschema.org/problems/unsupported-profile" },
|
|
383
|
+
"status": { "const": 422 }
|
|
384
|
+
}
|
|
385
|
+
}
|
|
386
|
+
},
|
|
387
|
+
{
|
|
388
|
+
"if": { "properties": { "code": { "const": "unsupported-type" } }, "required": ["code"] },
|
|
389
|
+
"then": {
|
|
390
|
+
"properties": {
|
|
391
|
+
"type": { "const": "https://mailschema.org/problems/unsupported-type" },
|
|
392
|
+
"status": { "const": 422 }
|
|
393
|
+
}
|
|
394
|
+
}
|
|
395
|
+
},
|
|
396
|
+
{
|
|
397
|
+
"if": {
|
|
398
|
+
"properties": { "code": { "const": "unsupported-operation" } },
|
|
399
|
+
"required": ["code"]
|
|
400
|
+
},
|
|
401
|
+
"then": {
|
|
402
|
+
"properties": {
|
|
403
|
+
"type": { "const": "https://mailschema.org/problems/unsupported-operation" },
|
|
404
|
+
"status": { "const": 422 }
|
|
405
|
+
}
|
|
406
|
+
}
|
|
273
407
|
}
|
|
408
|
+
]
|
|
274
409
|
}
|
|
410
|
+
}
|
|
275
411
|
}
|