uapp-communication-sdk 1.0.0-dev.64 → 1.0.0-dev.66

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.
Files changed (116) hide show
  1. package/README.md +80 -2
  2. package/communication-sdk.cjs +15 -15
  3. package/communication-sdk.js +6042 -5682
  4. package/communication-sdk.standalone.js +154 -154
  5. package/package.json +1 -1
  6. package/types/app/App.d.ts.map +1 -1
  7. package/types/app/di/composition-root.d.ts +2 -0
  8. package/types/app/di/composition-root.d.ts.map +1 -1
  9. package/types/app/shell/AccountMenu.d.ts.map +1 -1
  10. package/types/app/shell/AccountProfilePanel.d.ts.map +1 -1
  11. package/types/app/shell/TopBar.d.ts.map +1 -1
  12. package/types/app/shell/use-account-profile.d.ts +1 -0
  13. package/types/app/shell/use-account-profile.d.ts.map +1 -1
  14. package/types/features/chat/domain/entities/conversation.d.ts +20 -0
  15. package/types/features/chat/domain/entities/conversation.d.ts.map +1 -1
  16. package/types/features/chat/infrastructure/chat-mappers.d.ts.map +1 -1
  17. package/types/features/chat/infrastructure/chat-realtime-parsers.d.ts +2 -1
  18. package/types/features/chat/infrastructure/chat-realtime-parsers.d.ts.map +1 -1
  19. package/types/features/chat/infrastructure/chat-realtime-protocol.d.ts +23 -0
  20. package/types/features/chat/infrastructure/chat-realtime-protocol.d.ts.map +1 -1
  21. package/types/features/chat/infrastructure/dto/chat-dtos.d.ts +100 -0
  22. package/types/features/chat/infrastructure/dto/chat-dtos.d.ts.map +1 -1
  23. package/types/features/chat/infrastructure/mock-chat-gateway.d.ts +20 -22
  24. package/types/features/chat/infrastructure/mock-chat-gateway.d.ts.map +1 -1
  25. package/types/features/chat/infrastructure/mock-chat-helpers.d.ts +3 -1
  26. package/types/features/chat/infrastructure/mock-chat-helpers.d.ts.map +1 -1
  27. package/types/features/chat/presentation/ChatConfirmDialogs.d.ts.map +1 -1
  28. package/types/features/chat/presentation/ConversationHeader.d.ts.map +1 -1
  29. package/types/features/chat/presentation/MemberRow.d.ts.map +1 -1
  30. package/types/features/chat/presentation/chat-realtime-handlers.d.ts.map +1 -1
  31. package/types/features/chat/presentation/dm-presence.d.ts +37 -0
  32. package/types/features/chat/presentation/dm-presence.d.ts.map +1 -0
  33. package/types/features/chat/presentation/use-chat.d.ts.map +1 -1
  34. package/types/features/chat/presentation/use-conversations.d.ts +6 -0
  35. package/types/features/chat/presentation/use-conversations.d.ts.map +1 -1
  36. package/types/features/chat/presentation/useChatRealtime.d.ts.map +1 -1
  37. package/types/features/feed/presentation/FeedComposer.d.ts.map +1 -1
  38. package/types/features/feed/presentation/PostComments.d.ts.map +1 -1
  39. package/types/features/feed/presentation/PromotionsPanel.d.ts.map +1 -1
  40. package/types/features/feed/presentation/composer-profile.d.ts +17 -0
  41. package/types/features/feed/presentation/composer-profile.d.ts.map +1 -0
  42. package/types/features/feed/presentation/use-feed.d.ts.map +1 -1
  43. package/types/features/meeting-video/presentation/experiences/CloudflareMeetingExperience.d.ts.map +1 -1
  44. package/types/features/meetings/presentation/ScheduledMeetings.d.ts.map +1 -1
  45. package/types/features/org/presentation/TeamFormModal.d.ts.map +1 -1
  46. package/types/features/presence/application/index.d.ts +2 -0
  47. package/types/features/presence/application/index.d.ts.map +1 -0
  48. package/types/features/presence/application/use-cases/my-presence-use-cases.d.ts +26 -0
  49. package/types/features/presence/application/use-cases/my-presence-use-cases.d.ts.map +1 -0
  50. package/types/features/presence/domain/errors/presence-errors.d.ts +8 -0
  51. package/types/features/presence/domain/errors/presence-errors.d.ts.map +1 -0
  52. package/types/features/presence/domain/index.d.ts +4 -0
  53. package/types/features/presence/domain/index.d.ts.map +1 -0
  54. package/types/features/presence/domain/my-presence.d.ts +28 -0
  55. package/types/features/presence/domain/my-presence.d.ts.map +1 -0
  56. package/types/features/presence/domain/ports/presence-gateway.d.ts +16 -0
  57. package/types/features/presence/domain/ports/presence-gateway.d.ts.map +1 -0
  58. package/types/features/presence/index.d.ts +4 -0
  59. package/types/features/presence/index.d.ts.map +1 -0
  60. package/types/features/presence/infrastructure/dto/presence-dtos.d.ts +29 -0
  61. package/types/features/presence/infrastructure/dto/presence-dtos.d.ts.map +1 -0
  62. package/types/features/presence/infrastructure/http-presence-gateway.d.ts +24 -0
  63. package/types/features/presence/infrastructure/http-presence-gateway.d.ts.map +1 -0
  64. package/types/features/presence/infrastructure/http-presence-routes.d.ts +10 -0
  65. package/types/features/presence/infrastructure/http-presence-routes.d.ts.map +1 -0
  66. package/types/features/presence/infrastructure/index.d.ts +3 -0
  67. package/types/features/presence/infrastructure/index.d.ts.map +1 -0
  68. package/types/features/presence/infrastructure/presence-mappers.d.ts +12 -0
  69. package/types/features/presence/infrastructure/presence-mappers.d.ts.map +1 -0
  70. package/types/features/presence/presence-module.d.ts +16 -0
  71. package/types/features/presence/presence-module.d.ts.map +1 -0
  72. package/types/features/presence/presentation/MyPresenceMenu.d.ts +23 -0
  73. package/types/features/presence/presentation/MyPresenceMenu.d.ts.map +1 -0
  74. package/types/features/presence/presentation/PresenceModuleProvider.d.ts +7 -0
  75. package/types/features/presence/presentation/PresenceModuleProvider.d.ts.map +1 -0
  76. package/types/features/presence/presentation/index.d.ts +5 -0
  77. package/types/features/presence/presentation/index.d.ts.map +1 -0
  78. package/types/features/presence/presentation/presence-module-context.d.ts +3 -0
  79. package/types/features/presence/presentation/presence-module-context.d.ts.map +1 -0
  80. package/types/features/presence/presentation/use-my-presence.d.ts +13 -0
  81. package/types/features/presence/presentation/use-my-presence.d.ts.map +1 -0
  82. package/types/features/presence/presentation/use-presence-module.d.ts +3 -0
  83. package/types/features/presence/presentation/use-presence-module.d.ts.map +1 -0
  84. package/types/features/settings/presentation/FeedTemplatesTab.d.ts.map +1 -1
  85. package/types/features/users/domain/entities/user.d.ts +13 -0
  86. package/types/features/users/domain/entities/user.d.ts.map +1 -1
  87. package/types/features/users/infrastructure/dto/user-dtos.d.ts +16 -0
  88. package/types/features/users/infrastructure/dto/user-dtos.d.ts.map +1 -1
  89. package/types/features/users/infrastructure/user-mappers.d.ts.map +1 -1
  90. package/types/features/users/presentation/UserPresenceCell.d.ts +18 -0
  91. package/types/features/users/presentation/UserPresenceCell.d.ts.map +1 -0
  92. package/types/features/users/presentation/UsersPage.d.ts.map +1 -1
  93. package/types/sdk/SdkProviders.d.ts.map +1 -1
  94. package/types/sdk/index.d.ts +5 -0
  95. package/types/sdk/index.d.ts.map +1 -1
  96. package/types/sdk/notifications/notification-client.d.ts +1 -1
  97. package/types/sdk/notifications/notification-client.d.ts.map +1 -1
  98. package/types/sdk/presence/presence-client.d.ts +75 -0
  99. package/types/sdk/presence/presence-client.d.ts.map +1 -0
  100. package/types/sdk/runtime/headless-session.d.ts +34 -0
  101. package/types/sdk/runtime/headless-session.d.ts.map +1 -0
  102. package/types/sdk/runtime/sdk-composition-root.d.ts +2 -0
  103. package/types/sdk/runtime/sdk-composition-root.d.ts.map +1 -1
  104. package/types/shared/presence/PresenceBadge.d.ts +23 -0
  105. package/types/shared/presence/PresenceBadge.d.ts.map +1 -0
  106. package/types/shared/presence/format-presence-time.d.ts +13 -0
  107. package/types/shared/presence/format-presence-time.d.ts.map +1 -0
  108. package/types/shared/presence/index.d.ts +5 -0
  109. package/types/shared/presence/index.d.ts.map +1 -0
  110. package/types/shared/presence/live-presence-store.d.ts +21 -0
  111. package/types/shared/presence/live-presence-store.d.ts.map +1 -0
  112. package/types/shared/presence/presence-status.d.ts +41 -0
  113. package/types/shared/presence/presence-status.d.ts.map +1 -0
  114. package/types/shared/ui/DropdownMenu/DropdownMenu.d.ts +19 -2
  115. package/types/shared/ui/DropdownMenu/DropdownMenu.d.ts.map +1 -1
  116. package/types/shared/utils/avatar.d.ts.map +1 -1
package/README.md CHANGED
@@ -601,7 +601,74 @@ Before going live, verify:
601
601
 
602
602
  ---
603
603
 
604
- ## 13. Package exports
604
+ ## 13. Without a widget: status and notifications
605
+
606
+ A widget only exists on the page it is mounted on, and the person using your application is usually
607
+ somewhere else in it. Two headless clients cover that. Both render nothing, hold no React, and take
608
+ the same options as a widget — including `getAssertion`, which must mint a **fresh** assertion every
609
+ time it is called.
610
+
611
+ ### Their own status
612
+
613
+ The widgets show everyone **else's** status beside their name — Available, Busy, In a meeting, Focus,
614
+ Away — but they have no chrome of their own to set one from. This is how your header gets a status
615
+ control:
616
+
617
+ ```ts
618
+ import { createPresenceClient } from 'uapp-communication-sdk';
619
+
620
+ const presence = createPresenceClient({
621
+ apiBaseUrl: 'https://api.commhub.example',
622
+ clientKey: 'sk_live_…',
623
+ getAssertion: () => fetch('/api/commhub-assertion').then((r) => r.text()),
624
+ });
625
+
626
+ const current = await presence.getMine(); // { status: 'available', source: 'connection', … }
627
+ await presence.setMine({ status: 'busy', minutes: 30, note: 'On a call' });
628
+ await presence.clearMine();
629
+ ```
630
+
631
+ Three things to build against:
632
+
633
+ - **`minutes`, not an end time.** The server resolves the duration against its own clock and caps it
634
+ at 24 hours, so a device with a wrong clock cannot extend its own status. Every status ends: there
635
+ is no "until I turn it off", because a status nobody remembers to clear is still showing days later
636
+ and an indicator nobody believes is worse than none.
637
+ - **Render the answer, not the request.** All three calls return the RESOLVED presence, which is not
638
+ always what you asked for — a calendar block can outrank a self-set status. `source` tells you which
639
+ input won (`override`, `activity`, `calendar`, `connection`), so your UI can say "from your calendar"
640
+ instead of leaving somebody to wonder why they look busy.
641
+ - **Offer "clear" only when `hasOverride` is true.** A status that came from a calendar is not theirs
642
+ to clear, and a dead control is a promise the feature does not keep.
643
+
644
+ Every call answers `null` rather than throwing — on a failed exchange, an unreachable API, or a
645
+ response that does not match the contract. A half-parsed status in your header is worse than none.
646
+
647
+ This client reads and writes; it opens no socket. It will not tell you when somebody **else's** status
648
+ changes — mount a widget for that.
649
+
650
+ ### Notifications
651
+
652
+ ```ts
653
+ import { createNotificationClient } from 'uapp-communication-sdk';
654
+
655
+ const client = createNotificationClient({
656
+ apiBaseUrl: 'https://api.commhub.example',
657
+ clientKey: 'sk_live_…',
658
+ getAssertion: () => fetch('/api/commhub-assertion').then((r) => r.text()),
659
+ onNotification: (n) => bell.add(n),
660
+ });
661
+ await client.start();
662
+ ```
663
+
664
+ `start()` loads what is already unread and then opens the live connection — without the first half a
665
+ badge reads zero on every page load however long the person was away. `markAsRead(id)` keeps the count
666
+ agreeing with the Hub. Requires the `commhub.feed` scope: that is what the notification hub is scoped
667
+ to.
668
+
669
+ ---
670
+
671
+ ## 14. Package exports
605
672
 
606
673
  ```ts
607
674
  import {
@@ -613,6 +680,8 @@ import {
613
680
  CommsProvider,
614
681
  WidgetRoot,
615
682
  SDK_MODULE_SCOPES,
683
+ createPresenceClient,
684
+ createNotificationClient,
616
685
  } from 'uapp-communication-sdk';
617
686
 
618
687
  import type {
@@ -624,6 +693,15 @@ import type {
624
693
  ThemeDensity,
625
694
  ThemeMode,
626
695
  WidgetRootProps,
696
+ PresenceClient,
697
+ PresenceClientOptions,
698
+ SdkPresence,
699
+ SdkPresenceSource,
700
+ SdkPresenceStatus,
701
+ SetSdkPresenceInput,
702
+ NotificationClient,
703
+ NotificationClientOptions,
704
+ SdkNotification,
627
705
  } from 'uapp-communication-sdk';
628
706
  ```
629
707
 
@@ -631,7 +709,7 @@ Most integrations only need `defineCustomElements()`.
631
709
 
632
710
  ---
633
711
 
634
- ## 14. Support information to collect
712
+ ## 15. Support information to collect
635
713
 
636
714
  If an integration fails, collect:
637
715