Commit 54590cc
committed
@pryv/cmc: API ergonomics — revokeRelationship({inviteEventId}) + require explicit scopeStreamId on accept/refuse
Surfaced while adapting Plan 68 validation scenarios to use the new
package. Pre-publish polish of the v1.0.0 surface.
revokeRelationship
- Now accepts EITHER { accessId, scopeStreamId, reason? } (existing power-user
path) OR { inviteEventId, scopeStreamId?, reason? } (new convenience path).
- The inviteEventId path reads the invite event + the matching consent/accept-cmc
on :_cmc:inbox (matched via originalEventId / requestEventId / inviteEventId
in the accept's content) and pulls backChannelAccessId from there.
- scopeStreamId auto-derived from the invite event's own stream when not
given.
acceptInvite + refuseInvite
- Previous default scopeStreamId was ':_cmc:apps:patient:incoming' which (a)
requires the accepter to pre-create that sub-stream and (b) the
default-fallback case isn't actually safer than throwing. Now REQUIRED.
- Bad-default trap: ':_cmc:inbox' is the inbox stream — events written there
route through the peer-delivered handleIncomingAccept path, not the local
handleAccept. The error message points this out so callers don't
accidentally pick it.
listAcceptedRelationships
- Default scopeStreamId changed from ':_cmc:apps:patient:incoming' to NS_APPS
(':_cmc:apps') so the recursive default covers every app scope on the
account (matches the user mental model of 'list everything I've accepted').
Tests: 4 [CMCL1A*] tests updated to pass explicit scopeStreamId. 43/43 still
passing. common.js in _plans/68/tests/ continues to load (already passed
explicit scopeStreamId).
createInvite features key
- Spec asked for {chat, system}; server-side validators.ts requires
{chat, systemMessaging}. Kept current (correct) {chat, systemMessaging}
shape. Documented in CHANGELOG.
Bumps minor not needed — this is still pre-publish work on the same v1.0.0
release branch.1 parent de3f25e commit 54590cc
3 files changed
Lines changed: 96 additions & 25 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
185 | 185 | | |
186 | 186 | | |
187 | 187 | | |
188 | | - | |
189 | | - | |
190 | | - | |
191 | | - | |
192 | | - | |
| 188 | + | |
| 189 | + | |
| 190 | + | |
| 191 | + | |
| 192 | + | |
| 193 | + | |
| 194 | + | |
| 195 | + | |
| 196 | + | |
| 197 | + | |
| 198 | + | |
193 | 199 | | |
194 | 200 | | |
195 | 201 | | |
| |||
214 | 220 | | |
215 | 221 | | |
216 | 222 | | |
217 | | - | |
218 | | - | |
| 223 | + | |
| 224 | + | |
| 225 | + | |
| 226 | + | |
| 227 | + | |
| 228 | + | |
| 229 | + | |
219 | 230 | | |
220 | 231 | | |
221 | 232 | | |
| |||
226 | 237 | | |
227 | 238 | | |
228 | 239 | | |
229 | | - | |
230 | | - | |
| 240 | + | |
| 241 | + | |
| 242 | + | |
| 243 | + | |
| 244 | + | |
| 245 | + | |
231 | 246 | | |
232 | 247 | | |
233 | 248 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
411 | 411 | | |
412 | 412 | | |
413 | 413 | | |
| 414 | + | |
| 415 | + | |
| 416 | + | |
| 417 | + | |
| 418 | + | |
| 419 | + | |
| 420 | + | |
| 421 | + | |
414 | 422 | | |
415 | 423 | | |
416 | | - | |
417 | | - | |
| 424 | + | |
| 425 | + | |
| 426 | + | |
418 | 427 | | |
419 | 428 | | |
420 | 429 | | |
421 | 430 | | |
422 | 431 | | |
423 | | - | |
| 432 | + | |
| 433 | + | |
| 434 | + | |
| 435 | + | |
| 436 | + | |
| 437 | + | |
| 438 | + | |
| 439 | + | |
| 440 | + | |
| 441 | + | |
| 442 | + | |
| 443 | + | |
| 444 | + | |
| 445 | + | |
| 446 | + | |
| 447 | + | |
| 448 | + | |
| 449 | + | |
| 450 | + | |
| 451 | + | |
| 452 | + | |
| 453 | + | |
| 454 | + | |
| 455 | + | |
| 456 | + | |
| 457 | + | |
| 458 | + | |
| 459 | + | |
| 460 | + | |
| 461 | + | |
| 462 | + | |
| 463 | + | |
| 464 | + | |
| 465 | + | |
| 466 | + | |
| 467 | + | |
424 | 468 | | |
425 | 469 | | |
426 | | - | |
| 470 | + | |
427 | 471 | | |
428 | 472 | | |
429 | 473 | | |
| |||
560 | 604 | | |
561 | 605 | | |
562 | 606 | | |
563 | | - | |
564 | | - | |
| 607 | + | |
| 608 | + | |
565 | 609 | | |
566 | 610 | | |
567 | 611 | | |
| |||
571 | 615 | | |
572 | 616 | | |
573 | 617 | | |
574 | | - | |
| 618 | + | |
| 619 | + | |
| 620 | + | |
| 621 | + | |
| 622 | + | |
| 623 | + | |
575 | 624 | | |
576 | 625 | | |
577 | 626 | | |
| |||
632 | 681 | | |
633 | 682 | | |
634 | 683 | | |
635 | | - | |
636 | | - | |
| 684 | + | |
| 685 | + | |
637 | 686 | | |
638 | 687 | | |
639 | 688 | | |
640 | 689 | | |
641 | 690 | | |
642 | | - | |
| 691 | + | |
| 692 | + | |
| 693 | + | |
| 694 | + | |
| 695 | + | |
643 | 696 | | |
644 | 697 | | |
645 | 698 | | |
| |||
677 | 730 | | |
678 | 731 | | |
679 | 732 | | |
680 | | - | |
| 733 | + | |
681 | 734 | | |
682 | 735 | | |
683 | 736 | | |
684 | 737 | | |
685 | 738 | | |
686 | | - | |
| 739 | + | |
| 740 | + | |
| 741 | + | |
| 742 | + | |
687 | 743 | | |
688 | 744 | | |
689 | 745 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
414 | 414 | | |
415 | 415 | | |
416 | 416 | | |
417 | | - | |
| 417 | + | |
418 | 418 | | |
419 | 419 | | |
420 | 420 | | |
| |||
443 | 443 | | |
444 | 444 | | |
445 | 445 | | |
446 | | - | |
| 446 | + | |
447 | 447 | | |
448 | 448 | | |
449 | 449 | | |
| |||
463 | 463 | | |
464 | 464 | | |
465 | 465 | | |
466 | | - | |
| 466 | + | |
467 | 467 | | |
468 | 468 | | |
469 | 469 | | |
| |||
478 | 478 | | |
479 | 479 | | |
480 | 480 | | |
481 | | - | |
| 481 | + | |
482 | 482 | | |
483 | 483 | | |
484 | 484 | | |
| |||
0 commit comments