@mdbase-dev/connect-protocol 0.1.0-beta.31 → 0.1.0-beta.32

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.
@@ -53,11 +53,39 @@
53
53
  }
54
54
  },
55
55
  "authority_authorization_changed": { "category": "authorization", "recovery": "reauthorize" },
56
+ "authorization_binding_incompatible": {
57
+ "category": "compatibility",
58
+ "recovery": "upgrade_application",
59
+ "details": {
60
+ "required": ["contract", "required", "supported", "peer"],
61
+ "properties": {
62
+ "contract": { "type": "string" },
63
+ "required": { "type": "array", "items": { "type": "integer" } },
64
+ "supported": { "type": "array", "items": { "type": "integer" } },
65
+ "peer": { "type": "string" },
66
+ "operation": { "type": "string" }
67
+ }
68
+ }
69
+ },
56
70
  "authorization_cancelled": { "category": "cancellation", "recovery": "none" },
57
71
  "authorization_expired": { "category": "authorization", "recovery": "reauthorize" },
58
72
  "authorization_replayed": { "category": "integrity", "recovery": "reauthorize" },
59
73
  "browser_required": { "category": "compatibility", "recovery": "none" },
60
74
  "callback_url_required": { "category": "validation", "recovery": "fix_request" },
75
+ "capability_contract_incompatible": {
76
+ "category": "compatibility",
77
+ "recovery": "upgrade_application",
78
+ "details": {
79
+ "required": ["contract", "required", "supported", "peer"],
80
+ "properties": {
81
+ "contract": { "type": "string" },
82
+ "required": { "type": "array", "items": { "type": "integer" } },
83
+ "supported": { "type": "array", "items": { "type": "integer" } },
84
+ "peer": { "type": "string" },
85
+ "operation": { "type": "string" }
86
+ }
87
+ }
88
+ },
61
89
  "change_cursor_reset": { "category": "conflict", "recovery": "refresh" },
62
90
  "collection_access_denied": { "category": "authorization", "recovery": "reauthorize" },
63
91
  "collection_configuration_invalid": {
@@ -143,6 +171,20 @@
143
171
  "device_authorization_failed": { "category": "authorization", "recovery": "reauthorize" },
144
172
  "direct_operation_rejected": { "category": "authorization", "recovery": "reauthorize" },
145
173
  "discovery_failed": { "category": "availability", "recovery": "retry" },
174
+ "durable_mutation_unsupported": {
175
+ "category": "compatibility",
176
+ "recovery": "upgrade_connector",
177
+ "details": {
178
+ "required": ["contract", "required", "supported", "peer"],
179
+ "properties": {
180
+ "contract": { "type": "string" },
181
+ "required": { "type": "array", "items": { "type": "integer" } },
182
+ "supported": { "type": "array", "items": { "type": "integer" } },
183
+ "peer": { "type": "string" },
184
+ "operation": { "type": "string" }
185
+ }
186
+ }
187
+ },
146
188
  "encrypted_relay_rejected": { "category": "authorization", "recovery": "reauthorize" },
147
189
  "encryption_required": { "category": "authorization", "recovery": "reauthorize" },
148
190
  "expired_token": { "category": "authorization", "recovery": "reauthorize" },
@@ -205,6 +247,15 @@
205
247
  "manifest_load_failed": { "category": "availability", "recovery": "retry" },
206
248
  "manifest_required": { "category": "validation", "recovery": "fix_request" },
207
249
  "missing_grant_key": { "category": "authorization", "recovery": "reauthorize" },
250
+ "mutation_recovery_expired": { "category": "compatibility", "recovery": "none" },
251
+ "mutation_request_conflict": {
252
+ "category": "conflict",
253
+ "recovery": "resolve_conflict",
254
+ "details": {
255
+ "required": ["request_id"],
256
+ "properties": { "request_id": { "type": "string" } }
257
+ }
258
+ },
208
259
  "no_pending_mutation": { "category": "conflict", "recovery": "refresh" },
209
260
  "not_authorized": { "category": "authorization", "recovery": "reauthorize" },
210
261
  "not_remote_authority": { "category": "compatibility", "recovery": "choose_collection" },
@@ -227,7 +278,14 @@
227
278
  }
228
279
  }
229
280
  },
230
- "operation_outcome_unknown": { "category": "conflict", "recovery": "resolve_outcome" },
281
+ "operation_outcome_unknown": {
282
+ "category": "conflict",
283
+ "recovery": "resolve_outcome",
284
+ "details": {
285
+ "required": ["request_id"],
286
+ "properties": { "request_id": { "type": "string" } }
287
+ }
288
+ },
231
289
  "path_occupied": { "category": "conflict", "recovery": "resolve_conflict" },
232
290
  "pending_mutation_unresolved": { "category": "conflict", "recovery": "resolve_outcome" },
233
291
  "query_snapshot_changed": { "category": "conflict", "recovery": "refresh" },
@@ -244,6 +302,11 @@
244
302
  "reconnect_required": { "category": "authorization", "recovery": "reauthorize" },
245
303
  "redirect_uri_required": { "category": "validation", "recovery": "fix_request" },
246
304
  "reference_updates_unsupported": { "category": "compatibility", "recovery": "fix_request" },
305
+ "registry_backup_invalid": { "category": "integrity", "recovery": "contact_support" },
306
+ "registry_busy": { "category": "availability", "recovery": "retry" },
307
+ "registry_corrupt": { "category": "integrity", "recovery": "repair_collection" },
308
+ "registry_migration_failed": { "category": "internal", "recovery": "contact_support" },
309
+ "registry_schema_incompatible": { "category": "compatibility", "recovery": "upgrade_connector" },
247
310
  "relay_authorization_expired": { "category": "authorization", "recovery": "reauthorize" },
248
311
  "relay_unavailable": { "category": "availability", "recovery": "retry" },
249
312
  "sandbox_unsupported": { "category": "compatibility", "recovery": "fix_request" },
@@ -254,6 +317,20 @@
254
317
  "temporarily_unavailable": { "category": "availability", "recovery": "retry" },
255
318
  "timeout": { "category": "availability", "recovery": "retry" },
256
319
  "token_exchange_failed": { "category": "availability", "recovery": "retry" },
320
+ "transport_protocol_incompatible": {
321
+ "category": "compatibility",
322
+ "recovery": "upgrade_connector",
323
+ "details": {
324
+ "required": ["contract", "required", "supported", "peer"],
325
+ "properties": {
326
+ "contract": { "type": "string" },
327
+ "required": { "type": "array", "items": { "type": "integer" } },
328
+ "supported": { "type": "array", "items": { "type": "integer" } },
329
+ "peer": { "type": "string" },
330
+ "operation": { "type": "string" }
331
+ }
332
+ }
333
+ },
257
334
  "type_pack_provision_failed": { "category": "validation", "recovery": "repair_collection" },
258
335
  "unknown_collection": { "category": "selection", "recovery": "choose_collection" },
259
336
  "unsafe_file_path": { "category": "validation", "recovery": "fix_request" },
@@ -24,6 +24,34 @@
24
24
  "operation": {
25
25
  "enum": ["describe", "changes", "read", "query", "list_views", "execute_view", "read_view_source", "create_view_source", "update_view_source", "delete_view_source", "validate", "create", "update", "delete", "rename", "read_type", "create_type", "update_type", "assess_type_pack", "apply_type_pack", "list_timers", "put_timer", "cancel_timer", "reconcile_timers", "sync"]
26
26
  },
27
+ "connectContractRequirements": {
28
+ "type": "object",
29
+ "additionalProperties": false,
30
+ "required": ["operation_transport", "authorization_binding", "semantic_capabilities"],
31
+ "properties": {
32
+ "operation_transport": { "type": "integer", "minimum": 1 },
33
+ "authorization_binding": { "type": "integer", "minimum": 1 },
34
+ "semantic_capabilities": { "type": "integer", "minimum": 1 },
35
+ "durable_mutation": { "type": "integer", "minimum": 1 }
36
+ }
37
+ },
38
+ "connectContractSupport": {
39
+ "type": "object",
40
+ "additionalProperties": false,
41
+ "required": ["operation_transport", "authorization_binding", "semantic_capabilities", "durable_mutation"],
42
+ "properties": {
43
+ "operation_transport": { "$ref": "#/$defs/versionSet" },
44
+ "authorization_binding": { "$ref": "#/$defs/versionSet" },
45
+ "semantic_capabilities": { "$ref": "#/$defs/versionSet" },
46
+ "durable_mutation": { "$ref": "#/$defs/versionSet" }
47
+ }
48
+ },
49
+ "versionSet": {
50
+ "type": "array",
51
+ "minItems": 1,
52
+ "uniqueItems": true,
53
+ "items": { "type": "integer", "minimum": 1 }
54
+ },
27
55
  "contractRequirement": {
28
56
  "type": "object",
29
57
  "additionalProperties": false,
@@ -83,7 +111,7 @@
83
111
  "relayHello": {
84
112
  "type": "object",
85
113
  "additionalProperties": false,
86
- "required": ["type", "protocol_version", "connector_version", "capabilities"],
114
+ "required": ["type", "protocol_version", "connector_version", "capabilities", "contract_support"],
87
115
  "properties": {
88
116
  "type": { "const": "relay_hello" },
89
117
  "protocol_version": { "const": 1 },
@@ -92,13 +120,14 @@
92
120
  "type": "array",
93
121
  "uniqueItems": true,
94
122
  "items": { "type": "string", "minLength": 1, "maxLength": 100 }
95
- }
123
+ },
124
+ "contract_support": { "$ref": "#/$defs/connectContractSupport" }
96
125
  }
97
126
  },
98
127
  "relayWelcome": {
99
128
  "type": "object",
100
129
  "additionalProperties": false,
101
- "required": ["type", "protocol_version", "session_id", "capabilities"],
130
+ "required": ["type", "protocol_version", "session_id", "capabilities", "contract_support"],
102
131
  "properties": {
103
132
  "type": { "const": "relay_welcome" },
104
133
  "protocol_version": { "const": 1 },
@@ -107,18 +136,31 @@
107
136
  "type": "array",
108
137
  "uniqueItems": true,
109
138
  "items": { "type": "string", "minLength": 1, "maxLength": 100 }
110
- }
139
+ },
140
+ "contract_support": { "$ref": "#/$defs/connectContractSupport" }
111
141
  }
112
142
  },
113
143
  "relayIncompatible": {
114
144
  "type": "object",
115
145
  "additionalProperties": false,
116
- "required": ["type", "protocol_version", "code", "message", "update_url"],
146
+ "required": ["type", "protocol_version", "code", "message", "minimum_connector_version", "update_url"],
117
147
  "properties": {
118
148
  "type": { "const": "relay_incompatible" },
119
149
  "protocol_version": { "const": 1 },
120
- "code": { "const": "connector_upgrade_required" },
150
+ "code": { "enum": ["connector_upgrade_required", "transport_protocol_incompatible", "authorization_binding_incompatible", "capability_contract_incompatible", "durable_mutation_unsupported"] },
121
151
  "message": { "type": "string", "minLength": 1 },
152
+ "details": {
153
+ "type": "object",
154
+ "additionalProperties": false,
155
+ "required": ["contract", "required", "supported", "peer"],
156
+ "properties": {
157
+ "contract": { "enum": ["operation_transport", "authorization_binding", "semantic_capabilities", "durable_mutation"] },
158
+ "required": { "$ref": "#/$defs/versionSet" },
159
+ "supported": { "type": "array", "uniqueItems": true, "items": { "type": "integer", "minimum": 1 } },
160
+ "peer": { "const": "connector" }
161
+ }
162
+ },
163
+ "minimum_connector_version": { "type": "string", "pattern": "^[0-9]+\\.[0-9]+\\.[0-9]+(?:-[0-9A-Za-z.-]+)?$" },
122
164
  "update_url": { "type": "string", "format": "uri", "pattern": "^https://" }
123
165
  }
124
166
  },
@@ -128,7 +170,7 @@
128
170
  "required": ["type", "protocol_version", "request_id", "grant_id", "collection_id", "application_id", "operation", "input"],
129
171
  "properties": {
130
172
  "type": { "const": "operation_request" },
131
- "protocol_version": { "const": 1 },
173
+ "protocol_version": { "const": 2 },
132
174
  "request_id": { "$ref": "#/$defs/uuid" },
133
175
  "grant_id": { "$ref": "#/$defs/uuid" },
134
176
  "collection_id": { "$ref": "#/$defs/uuid" },
@@ -142,7 +184,7 @@
142
184
  "additionalProperties": false,
143
185
  "required": ["protocol_version", "request_id", "input"],
144
186
  "properties": {
145
- "protocol_version": { "const": 1 },
187
+ "protocol_version": { "const": 2 },
146
188
  "request_id": { "$ref": "#/$defs/uuid" },
147
189
  "input": true
148
190
  }
@@ -152,7 +194,7 @@
152
194
  "additionalProperties": false,
153
195
  "required": ["protocol_version", "request_id", "ok"],
154
196
  "properties": {
155
- "protocol_version": { "const": 1 },
197
+ "protocol_version": { "const": 2 },
156
198
  "request_id": { "$ref": "#/$defs/uuid" },
157
199
  "ok": { "type": "boolean" },
158
200
  "result": true,
@@ -178,7 +220,7 @@
178
220
  "required": ["type", "protocol_version", "request_id", "ok"],
179
221
  "properties": {
180
222
  "type": { "const": "operation_response" },
181
- "protocol_version": { "const": 1 },
223
+ "protocol_version": { "const": 2 },
182
224
  "request_id": { "$ref": "#/$defs/uuid" },
183
225
  "ok": { "type": "boolean" },
184
226
  "result": true,
@@ -247,9 +289,9 @@
247
289
  "applicationAuthorizationBinding": {
248
290
  "type": "object",
249
291
  "additionalProperties": false,
250
- "required": ["protocol_version", "authorization_id", "application_id", "application_manifest_digest", "application_installation_id", "installation_signing_public_key", "grant_agreement_public_key", "grant_signing_public_key", "flow", "authorization_nonce", "issued_at", "expires_at", "code_challenge", "requested_operations"],
292
+ "required": ["protocol_version", "authorization_id", "application_id", "application_manifest_digest", "application_installation_id", "installation_signing_public_key", "grant_agreement_public_key", "grant_signing_public_key", "flow", "authorization_nonce", "issued_at", "expires_at", "code_challenge", "contracts", "requested_operations"],
251
293
  "properties": {
252
- "protocol_version": { "const": 2 },
294
+ "protocol_version": { "const": 3 },
253
295
  "authorization_id": { "$ref": "#/$defs/uuid" },
254
296
  "application_id": { "$ref": "#/$defs/uuid" },
255
297
  "application_manifest_digest": { "type": "string", "pattern": "^[0-9a-f]{64}$" },
@@ -264,6 +306,7 @@
264
306
  "redirect_uri": { "type": "string", "format": "uri" },
265
307
  "state": { "type": "string", "maxLength": 500 },
266
308
  "code_challenge": { "type": "string", "pattern": "^[A-Za-z0-9_-]{43}$" },
309
+ "contracts": { "$ref": "#/$defs/connectContractRequirements" },
267
310
  "requested_operations": {
268
311
  "type": "array",
269
312
  "uniqueItems": true,
@@ -0,0 +1,63 @@
1
+ {
2
+ "$schema": "https://json-schema.org/draft/2020-12/schema",
3
+ "$id": "https://mdbase.dev/connect/schemas/encrypted-relay.v2.json",
4
+ "title": "mdbase connect encrypted operation transport 2",
5
+ "description": "Opaque authenticated operation envelopes routed between an application and authority.",
6
+ "oneOf": [
7
+ { "$ref": "#/$defs/request" },
8
+ { "$ref": "#/$defs/response" },
9
+ { "$ref": "#/$defs/rejected" }
10
+ ],
11
+ "$defs": {
12
+ "uuid": {
13
+ "type": "string",
14
+ "pattern": "^[0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}$"
15
+ },
16
+ "operation": {
17
+ "enum": ["describe", "changes", "read", "query", "list_views", "execute_view", "read_view_source", "create_view_source", "update_view_source", "delete_view_source", "validate", "create", "update", "delete", "rename", "read_type", "create_type", "update_type", "assess_type_pack", "apply_type_pack", "list_timers", "put_timer", "cancel_timer", "reconcile_timers", "sync", "file_control"]
18
+ },
19
+ "envelope": {
20
+ "type": "object",
21
+ "additionalProperties": false,
22
+ "required": ["type", "protocol_version", "suite", "request_id", "grant_id", "application_id", "connector_id", "collection_id", "operation", "scope_epoch", "key_id", "counter", "ciphertext"],
23
+ "properties": {
24
+ "type": { "enum": ["encrypted_operation_request", "encrypted_operation_response"] },
25
+ "protocol_version": { "const": 2 },
26
+ "suite": { "const": "P256-HKDF-SHA256-AES256GCM" },
27
+ "request_id": { "$ref": "#/$defs/uuid" },
28
+ "grant_id": { "$ref": "#/$defs/uuid" },
29
+ "application_id": { "$ref": "#/$defs/uuid" },
30
+ "connector_id": { "$ref": "#/$defs/uuid" },
31
+ "collection_id": { "$ref": "#/$defs/uuid" },
32
+ "operation": { "$ref": "#/$defs/operation" },
33
+ "scope_epoch": { "type": "integer", "minimum": 1, "maximum": 9007199254740991 },
34
+ "key_id": { "type": "string", "minLength": 1, "maxLength": 200 },
35
+ "counter": { "type": "string", "pattern": "^[1-9][0-9]{0,19}$" },
36
+ "ciphertext": { "type": "string", "minLength": 1, "maxLength": 2800000, "pattern": "^[A-Za-z0-9_-]+$" }
37
+ }
38
+ },
39
+ "request": {
40
+ "allOf": [
41
+ { "$ref": "#/$defs/envelope" },
42
+ { "type": "object", "properties": { "type": { "const": "encrypted_operation_request" } } }
43
+ ]
44
+ },
45
+ "response": {
46
+ "allOf": [
47
+ { "$ref": "#/$defs/envelope" },
48
+ { "type": "object", "properties": { "type": { "const": "encrypted_operation_response" } } }
49
+ ]
50
+ },
51
+ "rejected": {
52
+ "type": "object",
53
+ "additionalProperties": false,
54
+ "required": ["type", "protocol_version", "request_id", "problem"],
55
+ "properties": {
56
+ "type": { "const": "encrypted_operation_rejected" },
57
+ "protocol_version": { "const": 2 },
58
+ "request_id": { "$ref": "#/$defs/uuid" },
59
+ "problem": { "$ref": "https://schemas.mdbase.dev/connect/problem/v1" }
60
+ }
61
+ }
62
+ }
63
+ }
@@ -0,0 +1,40 @@
1
+ {
2
+ "catalog_version": 1,
3
+ "collection_operations": [
4
+ { "id": "describe", "input_schema_version": 1, "mutation": "never" },
5
+ { "id": "changes", "input_schema_version": 1, "mutation": "never" },
6
+ { "id": "read", "input_schema_version": 1, "mutation": "never" },
7
+ { "id": "query", "input_schema_version": 1, "mutation": "never" },
8
+ { "id": "list_views", "input_schema_version": 1, "mutation": "never" },
9
+ { "id": "execute_view", "input_schema_version": 1, "mutation": "never" },
10
+ { "id": "read_view_source", "input_schema_version": 1, "mutation": "never" },
11
+ { "id": "create_view_source", "input_schema_version": 1, "mutation": "always" },
12
+ { "id": "update_view_source", "input_schema_version": 1, "mutation": "always" },
13
+ { "id": "delete_view_source", "input_schema_version": 1, "mutation": "always" },
14
+ { "id": "validate", "input_schema_version": 1, "mutation": "never" },
15
+ { "id": "create", "input_schema_version": 1, "mutation": "always" },
16
+ { "id": "update", "input_schema_version": 1, "mutation": "always" },
17
+ { "id": "delete", "input_schema_version": 1, "mutation": "always" },
18
+ { "id": "rename", "input_schema_version": 1, "mutation": "always" },
19
+ { "id": "read_type", "input_schema_version": 1, "mutation": "never" },
20
+ { "id": "create_type", "input_schema_version": 1, "mutation": "always" },
21
+ { "id": "update_type", "input_schema_version": 1, "mutation": "always" },
22
+ { "id": "assess_type_pack", "input_schema_version": 1, "mutation": "never" },
23
+ { "id": "apply_type_pack", "input_schema_version": 1, "mutation": "always" },
24
+ { "id": "list_timers", "input_schema_version": 1, "mutation": "never" },
25
+ { "id": "put_timer", "input_schema_version": 1, "mutation": "always" },
26
+ { "id": "cancel_timer", "input_schema_version": 1, "mutation": "always" },
27
+ { "id": "reconcile_timers", "input_schema_version": 1, "mutation": "always" },
28
+ { "id": "sync", "input_schema_version": 1, "mutation": "sync_action" }
29
+ ],
30
+ "file_control_messages": [
31
+ { "id": "list_files", "input_schema_version": 1, "mutation": false },
32
+ { "id": "open_file_upload", "input_schema_version": 1, "mutation": true },
33
+ { "id": "open_file_download", "input_schema_version": 1, "mutation": false },
34
+ { "id": "move_file", "input_schema_version": 1, "mutation": true },
35
+ { "id": "delete_file", "input_schema_version": 1, "mutation": true },
36
+ { "id": "get_file_transfer_status", "input_schema_version": 1, "mutation": false },
37
+ { "id": "commit_file_upload", "input_schema_version": 1, "mutation": true },
38
+ { "id": "abort_file_transfer", "input_schema_version": 1, "mutation": true }
39
+ ]
40
+ }