@mdbase-dev/connect-protocol 0.1.0-beta.90 → 0.1.0-beta.92

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/dist/index.d.ts CHANGED
@@ -24,12 +24,15 @@ export declare const SYNC_PROTOCOL_VERSION: 1;
24
24
  export declare const CONTRACT_SETUP_CAPABILITY: "contract-setup-v1";
25
25
  export declare const FILE_RELAY_CAPABILITY: "file-relay-v1";
26
26
  export declare const PROTOCOL_USAGE_REPORT_CAPABILITY: "protocol-usage-report-v1";
27
+ export declare const POLICY_FRESHNESS_LEASE_CAPABILITY: "policy-freshness-lease-v1";
28
+ /** Advertised beta capabilities are intentionally broader than the beta baseline. */
27
29
  export declare const RELAY_REQUIRED_CAPABILITIES: readonly ["application-authorization-v4", "authorization-activation", "encrypted-relay", "policy-ack"];
28
30
  export declare const MINIMUM_CONNECTOR_VERSION: "0.1.0-beta.33";
31
+ export declare const POLICY_FRESHNESS_LEASE_MINIMUM_CONNECTOR_VERSION: "0.1.0-beta.91";
29
32
  export declare const HOSTED_PROVIDER_REQUIRED_CAPABILITIES: readonly ["durable-mutation-journal-v1", "durable-file-lifecycle-v1"];
30
33
  export declare const HOSTED_CANDIDATE_B_ACTIVATION_CAPABILITY: "candidate-b-activation-v1";
31
34
  export declare const HOSTED_PROVIDER_CAPABILITIES: readonly ["durable-mutation-journal-v1", "durable-file-lifecycle-v1", "mutation-replay-after-credential-retirement-v1", "candidate-b-activation-v1"];
32
- export declare const RELAY_CAPABILITIES: readonly ["application-authorization-v4", "authorization-activation", "encrypted-relay", "policy-ack", "application-authorization-v5", "contract-setup-v1", "file-relay-v1", "protocol-usage-report-v1"];
35
+ export declare const RELAY_CAPABILITIES: readonly ["application-authorization-v4", "authorization-activation", "encrypted-relay", "policy-ack", "policy-freshness-lease-v1", "application-authorization-v5", "contract-setup-v1", "file-relay-v1", "protocol-usage-report-v1"];
33
36
  export declare const AUTHORITY_PROOF_VERSION: 1;
34
37
  export declare const AUTHORITY_PROOF_ALGORITHM: "P256-SHA256";
35
38
  export declare const AUTHORITY_PROOF_DOMAIN: "mdbase-authority-request-proof-v1";
@@ -516,6 +519,10 @@ export interface RelayPolicySnapshot {
516
519
  protocol_version: 1;
517
520
  request_id: string;
518
521
  revision: string;
522
+ connector_id: string;
523
+ sequence: number;
524
+ lease_issued_at_ms: number;
525
+ lease_expires_at_ms: number;
519
526
  grants: GrantPolicy[];
520
527
  }
521
528
  export interface RelayHello {
package/dist/index.js CHANGED
@@ -17,6 +17,8 @@ export const SYNC_PROTOCOL_VERSION = 1;
17
17
  export const CONTRACT_SETUP_CAPABILITY = "contract-setup-v1";
18
18
  export const FILE_RELAY_CAPABILITY = "file-relay-v1";
19
19
  export const PROTOCOL_USAGE_REPORT_CAPABILITY = "protocol-usage-report-v1";
20
+ export const POLICY_FRESHNESS_LEASE_CAPABILITY = "policy-freshness-lease-v1";
21
+ /** Advertised beta capabilities are intentionally broader than the beta baseline. */
20
22
  export const RELAY_REQUIRED_CAPABILITIES = [
21
23
  "application-authorization-v4",
22
24
  "authorization-activation",
@@ -24,6 +26,7 @@ export const RELAY_REQUIRED_CAPABILITIES = [
24
26
  "policy-ack"
25
27
  ];
26
28
  export const MINIMUM_CONNECTOR_VERSION = "0.1.0-beta.33";
29
+ export const POLICY_FRESHNESS_LEASE_MINIMUM_CONNECTOR_VERSION = "0.1.0-beta.91";
27
30
  export const HOSTED_PROVIDER_REQUIRED_CAPABILITIES = [
28
31
  "durable-mutation-journal-v1",
29
32
  "durable-file-lifecycle-v1"
@@ -36,6 +39,7 @@ export const HOSTED_PROVIDER_CAPABILITIES = [
36
39
  ];
37
40
  export const RELAY_CAPABILITIES = [
38
41
  ...RELAY_REQUIRED_CAPABILITIES,
42
+ POLICY_FRESHNESS_LEASE_CAPABILITY,
39
43
  "application-authorization-v5",
40
44
  CONTRACT_SETUP_CAPABILITY,
41
45
  FILE_RELAY_CAPABILITY,
@@ -114,6 +114,10 @@ const MUTATING_FILE_CONTROL_MESSAGE_TYPES = new Set([
114
114
  "commit_file_upload",
115
115
  "abort_file_transfer"
116
116
  ]);
117
+ const NONMUTATING_DRY_RUN_OPERATIONS = new Set([
118
+ "delete",
119
+ "rename"
120
+ ]);
117
121
  export const MUTATING_OPERATION_IDENTIFIERS = [
118
122
  "create_view_source",
119
123
  "update_view_source",
@@ -167,7 +171,7 @@ export function operationInputSchemaVersion(operation, input) {
167
171
  }
168
172
  export function mutationOperationIdentifier(operation, input) {
169
173
  const object = isObject(input) ? input : {};
170
- if (object.dry_run === true)
174
+ if (object.dry_run === true && NONMUTATING_DRY_RUN_OPERATIONS.has(operation))
171
175
  return null;
172
176
  if (operation === "file_control") {
173
177
  const type = typeof object.type === "string" ? object.type : "";
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@mdbase-dev/connect-protocol",
3
- "version": "0.1.0-beta.90",
3
+ "version": "0.1.0-beta.92",
4
4
  "private": false,
5
5
  "type": "module",
6
6
  "license": "MIT",
@@ -613,11 +613,24 @@
613
613
  "type": "object",
614
614
  "additionalProperties": false,
615
615
  "required": ["type", "protocol_version", "request_id", "revision", "grants"],
616
+ "oneOf": [
617
+ { "required": ["connector_id", "sequence", "lease_issued_at_ms", "lease_expires_at_ms"] },
618
+ { "not": { "anyOf": [
619
+ { "required": ["connector_id"] },
620
+ { "required": ["sequence"] },
621
+ { "required": ["lease_issued_at_ms"] },
622
+ { "required": ["lease_expires_at_ms"] }
623
+ ] } }
624
+ ],
616
625
  "properties": {
617
626
  "type": { "const": "policy_snapshot" },
618
627
  "protocol_version": { "const": 1 },
619
628
  "request_id": { "$ref": "#/$defs/uuid" },
620
629
  "revision": { "$ref": "#/$defs/digest" },
630
+ "connector_id": { "$ref": "#/$defs/uuid" },
631
+ "sequence": { "type": "integer", "minimum": 1, "maximum": 9007199254740991 },
632
+ "lease_issued_at_ms": { "type": "integer", "minimum": 0, "maximum": 9007199254740991 },
633
+ "lease_expires_at_ms": { "type": "integer", "minimum": 1, "maximum": 9007199254740991 },
621
634
  "grants": { "type": "array", "items": { "$ref": "#/$defs/grantPolicy" } }
622
635
  }
623
636
  },
@@ -14,8 +14,8 @@
14
14
  { "id": "validate", "input_schema_version": 1, "mutation": "never" },
15
15
  { "id": "create", "input_schema_version": 1, "mutation": "always" },
16
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" },
17
+ { "id": "delete", "input_schema_version": 1, "mutation": "always", "dry_run": "nonmutating" },
18
+ { "id": "rename", "input_schema_version": 1, "mutation": "always", "dry_run": "nonmutating" },
19
19
  { "id": "read_type", "input_schema_version": 1, "mutation": "never" },
20
20
  { "id": "create_type", "input_schema_version": 1, "mutation": "always" },
21
21
  { "id": "update_type", "input_schema_version": 1, "mutation": "always" },
@@ -0,0 +1,537 @@
1
+ {
2
+ "catalog_version": 1,
3
+ "cases": [
4
+ {
5
+ "operation": "describe",
6
+ "input": {},
7
+ "schema_version": 1,
8
+ "identifier": null
9
+ },
10
+ {
11
+ "operation": "describe",
12
+ "input": {
13
+ "dry_run": true
14
+ },
15
+ "schema_version": 1,
16
+ "identifier": null
17
+ },
18
+ {
19
+ "operation": "changes",
20
+ "input": {},
21
+ "schema_version": 1,
22
+ "identifier": null
23
+ },
24
+ {
25
+ "operation": "changes",
26
+ "input": {
27
+ "dry_run": true
28
+ },
29
+ "schema_version": 1,
30
+ "identifier": null
31
+ },
32
+ {
33
+ "operation": "read",
34
+ "input": {},
35
+ "schema_version": 1,
36
+ "identifier": null
37
+ },
38
+ {
39
+ "operation": "read",
40
+ "input": {
41
+ "dry_run": true
42
+ },
43
+ "schema_version": 1,
44
+ "identifier": null
45
+ },
46
+ {
47
+ "operation": "query",
48
+ "input": {},
49
+ "schema_version": 1,
50
+ "identifier": null
51
+ },
52
+ {
53
+ "operation": "query",
54
+ "input": {
55
+ "dry_run": true
56
+ },
57
+ "schema_version": 1,
58
+ "identifier": null
59
+ },
60
+ {
61
+ "operation": "list_views",
62
+ "input": {},
63
+ "schema_version": 1,
64
+ "identifier": null
65
+ },
66
+ {
67
+ "operation": "list_views",
68
+ "input": {
69
+ "dry_run": true
70
+ },
71
+ "schema_version": 1,
72
+ "identifier": null
73
+ },
74
+ {
75
+ "operation": "execute_view",
76
+ "input": {},
77
+ "schema_version": 1,
78
+ "identifier": null
79
+ },
80
+ {
81
+ "operation": "execute_view",
82
+ "input": {
83
+ "dry_run": true
84
+ },
85
+ "schema_version": 1,
86
+ "identifier": null
87
+ },
88
+ {
89
+ "operation": "read_view_source",
90
+ "input": {},
91
+ "schema_version": 1,
92
+ "identifier": null
93
+ },
94
+ {
95
+ "operation": "read_view_source",
96
+ "input": {
97
+ "dry_run": true
98
+ },
99
+ "schema_version": 1,
100
+ "identifier": null
101
+ },
102
+ {
103
+ "operation": "create_view_source",
104
+ "input": {},
105
+ "schema_version": 1,
106
+ "identifier": "create_view_source"
107
+ },
108
+ {
109
+ "operation": "create_view_source",
110
+ "input": {
111
+ "dry_run": true
112
+ },
113
+ "schema_version": 1,
114
+ "identifier": "create_view_source"
115
+ },
116
+ {
117
+ "operation": "update_view_source",
118
+ "input": {},
119
+ "schema_version": 1,
120
+ "identifier": "update_view_source"
121
+ },
122
+ {
123
+ "operation": "update_view_source",
124
+ "input": {
125
+ "dry_run": true
126
+ },
127
+ "schema_version": 1,
128
+ "identifier": "update_view_source"
129
+ },
130
+ {
131
+ "operation": "delete_view_source",
132
+ "input": {},
133
+ "schema_version": 1,
134
+ "identifier": "delete_view_source"
135
+ },
136
+ {
137
+ "operation": "delete_view_source",
138
+ "input": {
139
+ "dry_run": true
140
+ },
141
+ "schema_version": 1,
142
+ "identifier": "delete_view_source"
143
+ },
144
+ {
145
+ "operation": "validate",
146
+ "input": {},
147
+ "schema_version": 1,
148
+ "identifier": null
149
+ },
150
+ {
151
+ "operation": "validate",
152
+ "input": {
153
+ "dry_run": true
154
+ },
155
+ "schema_version": 1,
156
+ "identifier": null
157
+ },
158
+ {
159
+ "operation": "create",
160
+ "input": {},
161
+ "schema_version": 1,
162
+ "identifier": "create"
163
+ },
164
+ {
165
+ "operation": "create",
166
+ "input": {
167
+ "dry_run": true
168
+ },
169
+ "schema_version": 1,
170
+ "identifier": "create"
171
+ },
172
+ {
173
+ "operation": "update",
174
+ "input": {},
175
+ "schema_version": 1,
176
+ "identifier": "update"
177
+ },
178
+ {
179
+ "operation": "update",
180
+ "input": {
181
+ "dry_run": true
182
+ },
183
+ "schema_version": 1,
184
+ "identifier": "update"
185
+ },
186
+ {
187
+ "operation": "delete",
188
+ "input": {},
189
+ "schema_version": 1,
190
+ "identifier": "delete"
191
+ },
192
+ {
193
+ "operation": "delete",
194
+ "input": {
195
+ "dry_run": true
196
+ },
197
+ "schema_version": 1,
198
+ "identifier": null
199
+ },
200
+ {
201
+ "operation": "rename",
202
+ "input": {},
203
+ "schema_version": 1,
204
+ "identifier": "rename"
205
+ },
206
+ {
207
+ "operation": "rename",
208
+ "input": {
209
+ "dry_run": true
210
+ },
211
+ "schema_version": 1,
212
+ "identifier": null
213
+ },
214
+ {
215
+ "operation": "read_type",
216
+ "input": {},
217
+ "schema_version": 1,
218
+ "identifier": null
219
+ },
220
+ {
221
+ "operation": "read_type",
222
+ "input": {
223
+ "dry_run": true
224
+ },
225
+ "schema_version": 1,
226
+ "identifier": null
227
+ },
228
+ {
229
+ "operation": "create_type",
230
+ "input": {},
231
+ "schema_version": 1,
232
+ "identifier": "create_type"
233
+ },
234
+ {
235
+ "operation": "create_type",
236
+ "input": {
237
+ "dry_run": true
238
+ },
239
+ "schema_version": 1,
240
+ "identifier": "create_type"
241
+ },
242
+ {
243
+ "operation": "update_type",
244
+ "input": {},
245
+ "schema_version": 1,
246
+ "identifier": "update_type"
247
+ },
248
+ {
249
+ "operation": "update_type",
250
+ "input": {
251
+ "dry_run": true
252
+ },
253
+ "schema_version": 1,
254
+ "identifier": "update_type"
255
+ },
256
+ {
257
+ "operation": "assess_type_pack",
258
+ "input": {},
259
+ "schema_version": 1,
260
+ "identifier": null
261
+ },
262
+ {
263
+ "operation": "assess_type_pack",
264
+ "input": {
265
+ "dry_run": true
266
+ },
267
+ "schema_version": 1,
268
+ "identifier": null
269
+ },
270
+ {
271
+ "operation": "apply_type_pack",
272
+ "input": {},
273
+ "schema_version": 1,
274
+ "identifier": "apply_type_pack"
275
+ },
276
+ {
277
+ "operation": "apply_type_pack",
278
+ "input": {
279
+ "dry_run": true
280
+ },
281
+ "schema_version": 1,
282
+ "identifier": "apply_type_pack"
283
+ },
284
+ {
285
+ "operation": "assess_collection_setup",
286
+ "input": {},
287
+ "schema_version": 1,
288
+ "identifier": null
289
+ },
290
+ {
291
+ "operation": "assess_collection_setup",
292
+ "input": {
293
+ "dry_run": true
294
+ },
295
+ "schema_version": 1,
296
+ "identifier": null
297
+ },
298
+ {
299
+ "operation": "apply_collection_setup",
300
+ "input": {},
301
+ "schema_version": 1,
302
+ "identifier": "apply_collection_setup"
303
+ },
304
+ {
305
+ "operation": "apply_collection_setup",
306
+ "input": {
307
+ "dry_run": true
308
+ },
309
+ "schema_version": 1,
310
+ "identifier": "apply_collection_setup"
311
+ },
312
+ {
313
+ "operation": "list_timers",
314
+ "input": {},
315
+ "schema_version": 1,
316
+ "identifier": null
317
+ },
318
+ {
319
+ "operation": "list_timers",
320
+ "input": {
321
+ "dry_run": true
322
+ },
323
+ "schema_version": 1,
324
+ "identifier": null
325
+ },
326
+ {
327
+ "operation": "put_timer",
328
+ "input": {},
329
+ "schema_version": 1,
330
+ "identifier": "put_timer"
331
+ },
332
+ {
333
+ "operation": "put_timer",
334
+ "input": {
335
+ "dry_run": true
336
+ },
337
+ "schema_version": 1,
338
+ "identifier": "put_timer"
339
+ },
340
+ {
341
+ "operation": "cancel_timer",
342
+ "input": {},
343
+ "schema_version": 1,
344
+ "identifier": "cancel_timer"
345
+ },
346
+ {
347
+ "operation": "cancel_timer",
348
+ "input": {
349
+ "dry_run": true
350
+ },
351
+ "schema_version": 1,
352
+ "identifier": "cancel_timer"
353
+ },
354
+ {
355
+ "operation": "reconcile_timers",
356
+ "input": {},
357
+ "schema_version": 1,
358
+ "identifier": "reconcile_timers"
359
+ },
360
+ {
361
+ "operation": "reconcile_timers",
362
+ "input": {
363
+ "dry_run": true
364
+ },
365
+ "schema_version": 1,
366
+ "identifier": "reconcile_timers"
367
+ },
368
+ {
369
+ "operation": "sync",
370
+ "input": {},
371
+ "schema_version": 1,
372
+ "identifier": null
373
+ },
374
+ {
375
+ "operation": "sync",
376
+ "input": {
377
+ "dry_run": true
378
+ },
379
+ "schema_version": 1,
380
+ "identifier": null
381
+ },
382
+ {
383
+ "operation": "sync",
384
+ "input": {
385
+ "action": "changes",
386
+ "dry_run": true
387
+ },
388
+ "schema_version": 1,
389
+ "identifier": null
390
+ },
391
+ {
392
+ "operation": "sync",
393
+ "input": {
394
+ "action": "mutate",
395
+ "dry_run": true
396
+ },
397
+ "schema_version": 1,
398
+ "identifier": "sync:mutate"
399
+ },
400
+ {
401
+ "operation": "file_control",
402
+ "input": {
403
+ "type": "list_files"
404
+ },
405
+ "schema_version": 1,
406
+ "identifier": null
407
+ },
408
+ {
409
+ "operation": "file_control",
410
+ "input": {
411
+ "type": "list_files",
412
+ "dry_run": true
413
+ },
414
+ "schema_version": 1,
415
+ "identifier": null
416
+ },
417
+ {
418
+ "operation": "file_control",
419
+ "input": {
420
+ "type": "open_file_upload"
421
+ },
422
+ "schema_version": 1,
423
+ "identifier": "file_control:open_file_upload"
424
+ },
425
+ {
426
+ "operation": "file_control",
427
+ "input": {
428
+ "type": "open_file_upload",
429
+ "dry_run": true
430
+ },
431
+ "schema_version": 1,
432
+ "identifier": "file_control:open_file_upload"
433
+ },
434
+ {
435
+ "operation": "file_control",
436
+ "input": {
437
+ "type": "open_file_download"
438
+ },
439
+ "schema_version": 1,
440
+ "identifier": null
441
+ },
442
+ {
443
+ "operation": "file_control",
444
+ "input": {
445
+ "type": "open_file_download",
446
+ "dry_run": true
447
+ },
448
+ "schema_version": 1,
449
+ "identifier": null
450
+ },
451
+ {
452
+ "operation": "file_control",
453
+ "input": {
454
+ "type": "move_file"
455
+ },
456
+ "schema_version": 1,
457
+ "identifier": "file_control:move_file"
458
+ },
459
+ {
460
+ "operation": "file_control",
461
+ "input": {
462
+ "type": "move_file",
463
+ "dry_run": true
464
+ },
465
+ "schema_version": 1,
466
+ "identifier": "file_control:move_file"
467
+ },
468
+ {
469
+ "operation": "file_control",
470
+ "input": {
471
+ "type": "delete_file"
472
+ },
473
+ "schema_version": 1,
474
+ "identifier": "file_control:delete_file"
475
+ },
476
+ {
477
+ "operation": "file_control",
478
+ "input": {
479
+ "type": "delete_file",
480
+ "dry_run": true
481
+ },
482
+ "schema_version": 1,
483
+ "identifier": "file_control:delete_file"
484
+ },
485
+ {
486
+ "operation": "file_control",
487
+ "input": {
488
+ "type": "get_file_transfer_status"
489
+ },
490
+ "schema_version": 1,
491
+ "identifier": null
492
+ },
493
+ {
494
+ "operation": "file_control",
495
+ "input": {
496
+ "type": "get_file_transfer_status",
497
+ "dry_run": true
498
+ },
499
+ "schema_version": 1,
500
+ "identifier": null
501
+ },
502
+ {
503
+ "operation": "file_control",
504
+ "input": {
505
+ "type": "commit_file_upload"
506
+ },
507
+ "schema_version": 1,
508
+ "identifier": "file_control:commit_file_upload"
509
+ },
510
+ {
511
+ "operation": "file_control",
512
+ "input": {
513
+ "type": "commit_file_upload",
514
+ "dry_run": true
515
+ },
516
+ "schema_version": 1,
517
+ "identifier": "file_control:commit_file_upload"
518
+ },
519
+ {
520
+ "operation": "file_control",
521
+ "input": {
522
+ "type": "abort_file_transfer"
523
+ },
524
+ "schema_version": 1,
525
+ "identifier": "file_control:abort_file_transfer"
526
+ },
527
+ {
528
+ "operation": "file_control",
529
+ "input": {
530
+ "type": "abort_file_transfer",
531
+ "dry_run": true
532
+ },
533
+ "schema_version": 1,
534
+ "identifier": "file_control:abort_file_transfer"
535
+ }
536
+ ]
537
+ }