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.
- package/README.md +80 -2
- package/communication-sdk.cjs +15 -15
- package/communication-sdk.js +6042 -5682
- package/communication-sdk.standalone.js +154 -154
- package/package.json +1 -1
- package/types/app/App.d.ts.map +1 -1
- package/types/app/di/composition-root.d.ts +2 -0
- package/types/app/di/composition-root.d.ts.map +1 -1
- package/types/app/shell/AccountMenu.d.ts.map +1 -1
- package/types/app/shell/AccountProfilePanel.d.ts.map +1 -1
- package/types/app/shell/TopBar.d.ts.map +1 -1
- package/types/app/shell/use-account-profile.d.ts +1 -0
- package/types/app/shell/use-account-profile.d.ts.map +1 -1
- package/types/features/chat/domain/entities/conversation.d.ts +20 -0
- package/types/features/chat/domain/entities/conversation.d.ts.map +1 -1
- package/types/features/chat/infrastructure/chat-mappers.d.ts.map +1 -1
- package/types/features/chat/infrastructure/chat-realtime-parsers.d.ts +2 -1
- package/types/features/chat/infrastructure/chat-realtime-parsers.d.ts.map +1 -1
- package/types/features/chat/infrastructure/chat-realtime-protocol.d.ts +23 -0
- package/types/features/chat/infrastructure/chat-realtime-protocol.d.ts.map +1 -1
- package/types/features/chat/infrastructure/dto/chat-dtos.d.ts +100 -0
- package/types/features/chat/infrastructure/dto/chat-dtos.d.ts.map +1 -1
- package/types/features/chat/infrastructure/mock-chat-gateway.d.ts +20 -22
- package/types/features/chat/infrastructure/mock-chat-gateway.d.ts.map +1 -1
- package/types/features/chat/infrastructure/mock-chat-helpers.d.ts +3 -1
- package/types/features/chat/infrastructure/mock-chat-helpers.d.ts.map +1 -1
- package/types/features/chat/presentation/ChatConfirmDialogs.d.ts.map +1 -1
- package/types/features/chat/presentation/ConversationHeader.d.ts.map +1 -1
- package/types/features/chat/presentation/MemberRow.d.ts.map +1 -1
- package/types/features/chat/presentation/chat-realtime-handlers.d.ts.map +1 -1
- package/types/features/chat/presentation/dm-presence.d.ts +37 -0
- package/types/features/chat/presentation/dm-presence.d.ts.map +1 -0
- package/types/features/chat/presentation/use-chat.d.ts.map +1 -1
- package/types/features/chat/presentation/use-conversations.d.ts +6 -0
- package/types/features/chat/presentation/use-conversations.d.ts.map +1 -1
- package/types/features/chat/presentation/useChatRealtime.d.ts.map +1 -1
- package/types/features/feed/presentation/FeedComposer.d.ts.map +1 -1
- package/types/features/feed/presentation/PostComments.d.ts.map +1 -1
- package/types/features/feed/presentation/PromotionsPanel.d.ts.map +1 -1
- package/types/features/feed/presentation/composer-profile.d.ts +17 -0
- package/types/features/feed/presentation/composer-profile.d.ts.map +1 -0
- package/types/features/feed/presentation/use-feed.d.ts.map +1 -1
- package/types/features/meeting-video/presentation/experiences/CloudflareMeetingExperience.d.ts.map +1 -1
- package/types/features/meetings/presentation/ScheduledMeetings.d.ts.map +1 -1
- package/types/features/org/presentation/TeamFormModal.d.ts.map +1 -1
- package/types/features/presence/application/index.d.ts +2 -0
- package/types/features/presence/application/index.d.ts.map +1 -0
- package/types/features/presence/application/use-cases/my-presence-use-cases.d.ts +26 -0
- package/types/features/presence/application/use-cases/my-presence-use-cases.d.ts.map +1 -0
- package/types/features/presence/domain/errors/presence-errors.d.ts +8 -0
- package/types/features/presence/domain/errors/presence-errors.d.ts.map +1 -0
- package/types/features/presence/domain/index.d.ts +4 -0
- package/types/features/presence/domain/index.d.ts.map +1 -0
- package/types/features/presence/domain/my-presence.d.ts +28 -0
- package/types/features/presence/domain/my-presence.d.ts.map +1 -0
- package/types/features/presence/domain/ports/presence-gateway.d.ts +16 -0
- package/types/features/presence/domain/ports/presence-gateway.d.ts.map +1 -0
- package/types/features/presence/index.d.ts +4 -0
- package/types/features/presence/index.d.ts.map +1 -0
- package/types/features/presence/infrastructure/dto/presence-dtos.d.ts +29 -0
- package/types/features/presence/infrastructure/dto/presence-dtos.d.ts.map +1 -0
- package/types/features/presence/infrastructure/http-presence-gateway.d.ts +24 -0
- package/types/features/presence/infrastructure/http-presence-gateway.d.ts.map +1 -0
- package/types/features/presence/infrastructure/http-presence-routes.d.ts +10 -0
- package/types/features/presence/infrastructure/http-presence-routes.d.ts.map +1 -0
- package/types/features/presence/infrastructure/index.d.ts +3 -0
- package/types/features/presence/infrastructure/index.d.ts.map +1 -0
- package/types/features/presence/infrastructure/presence-mappers.d.ts +12 -0
- package/types/features/presence/infrastructure/presence-mappers.d.ts.map +1 -0
- package/types/features/presence/presence-module.d.ts +16 -0
- package/types/features/presence/presence-module.d.ts.map +1 -0
- package/types/features/presence/presentation/MyPresenceMenu.d.ts +23 -0
- package/types/features/presence/presentation/MyPresenceMenu.d.ts.map +1 -0
- package/types/features/presence/presentation/PresenceModuleProvider.d.ts +7 -0
- package/types/features/presence/presentation/PresenceModuleProvider.d.ts.map +1 -0
- package/types/features/presence/presentation/index.d.ts +5 -0
- package/types/features/presence/presentation/index.d.ts.map +1 -0
- package/types/features/presence/presentation/presence-module-context.d.ts +3 -0
- package/types/features/presence/presentation/presence-module-context.d.ts.map +1 -0
- package/types/features/presence/presentation/use-my-presence.d.ts +13 -0
- package/types/features/presence/presentation/use-my-presence.d.ts.map +1 -0
- package/types/features/presence/presentation/use-presence-module.d.ts +3 -0
- package/types/features/presence/presentation/use-presence-module.d.ts.map +1 -0
- package/types/features/settings/presentation/FeedTemplatesTab.d.ts.map +1 -1
- package/types/features/users/domain/entities/user.d.ts +13 -0
- package/types/features/users/domain/entities/user.d.ts.map +1 -1
- package/types/features/users/infrastructure/dto/user-dtos.d.ts +16 -0
- package/types/features/users/infrastructure/dto/user-dtos.d.ts.map +1 -1
- package/types/features/users/infrastructure/user-mappers.d.ts.map +1 -1
- package/types/features/users/presentation/UserPresenceCell.d.ts +18 -0
- package/types/features/users/presentation/UserPresenceCell.d.ts.map +1 -0
- package/types/features/users/presentation/UsersPage.d.ts.map +1 -1
- package/types/sdk/SdkProviders.d.ts.map +1 -1
- package/types/sdk/index.d.ts +5 -0
- package/types/sdk/index.d.ts.map +1 -1
- package/types/sdk/notifications/notification-client.d.ts +1 -1
- package/types/sdk/notifications/notification-client.d.ts.map +1 -1
- package/types/sdk/presence/presence-client.d.ts +75 -0
- package/types/sdk/presence/presence-client.d.ts.map +1 -0
- package/types/sdk/runtime/headless-session.d.ts +34 -0
- package/types/sdk/runtime/headless-session.d.ts.map +1 -0
- package/types/sdk/runtime/sdk-composition-root.d.ts +2 -0
- package/types/sdk/runtime/sdk-composition-root.d.ts.map +1 -1
- package/types/shared/presence/PresenceBadge.d.ts +23 -0
- package/types/shared/presence/PresenceBadge.d.ts.map +1 -0
- package/types/shared/presence/format-presence-time.d.ts +13 -0
- package/types/shared/presence/format-presence-time.d.ts.map +1 -0
- package/types/shared/presence/index.d.ts +5 -0
- package/types/shared/presence/index.d.ts.map +1 -0
- package/types/shared/presence/live-presence-store.d.ts +21 -0
- package/types/shared/presence/live-presence-store.d.ts.map +1 -0
- package/types/shared/presence/presence-status.d.ts +41 -0
- package/types/shared/presence/presence-status.d.ts.map +1 -0
- package/types/shared/ui/DropdownMenu/DropdownMenu.d.ts +19 -2
- package/types/shared/ui/DropdownMenu/DropdownMenu.d.ts.map +1 -1
- 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.
|
|
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
|
-
##
|
|
712
|
+
## 15. Support information to collect
|
|
635
713
|
|
|
636
714
|
If an integration fails, collect:
|
|
637
715
|
|