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
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"MyPresenceMenu.d.ts","sourceRoot":"","sources":["../../../../../../src/features/presence/presentation/MyPresenceMenu.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,OAAO,CAAC;AA2C1C;;;;;;;;;GASG;AACH,eAAO,MAAM,cAAc,GAAI,aAAa;IAAE,QAAQ,CAAC,OAAO,EAAE,YAAY,CAAA;CAAE,KAAG,YAoDhF,CAAC;AAEF;;;;;;GAMG;AACH,eAAO,MAAM,eAAe,QAAO,YAYlC,CAAC"}
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import type { ReactElement, ReactNode } from 'react';
|
|
2
|
+
import type { PresenceModule } from '../presence-module';
|
|
3
|
+
export declare const PresenceModuleProvider: ({ module, children, }: {
|
|
4
|
+
readonly module: PresenceModule;
|
|
5
|
+
readonly children: ReactNode;
|
|
6
|
+
}) => ReactElement;
|
|
7
|
+
//# sourceMappingURL=PresenceModuleProvider.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"PresenceModuleProvider.d.ts","sourceRoot":"","sources":["../../../../../../src/features/presence/presentation/PresenceModuleProvider.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,YAAY,EAAE,SAAS,EAAE,MAAM,OAAO,CAAC;AAErD,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,oBAAoB,CAAC;AAEzD,eAAO,MAAM,sBAAsB,GAAI,uBAGpC;IACD,QAAQ,CAAC,MAAM,EAAE,cAAc,CAAC;IAChC,QAAQ,CAAC,QAAQ,EAAE,SAAS,CAAC;CAC9B,KAAG,YAEH,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../../src/features/presence/presentation/index.ts"],"names":[],"mappings":"AAAA,cAAc,0BAA0B,CAAC;AACzC,cAAc,uBAAuB,CAAC;AACtC,cAAc,mBAAmB,CAAC;AAClC,cAAc,kBAAkB,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"presence-module-context.d.ts","sourceRoot":"","sources":["../../../../../../src/features/presence/presentation/presence-module-context.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,oBAAoB,CAAC;AAEzD,eAAO,MAAM,qBAAqB,gDAA6C,CAAC"}
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import { useMutation, type UseQueryResult } from '@tanstack/react-query';
|
|
2
|
+
import type { MyPresence, SetMyPresenceInput } from '../domain';
|
|
3
|
+
/**
|
|
4
|
+
* The caller's own presence.
|
|
5
|
+
*
|
|
6
|
+
* <p>Refetched on focus and on a slow interval because a status ENDS on its own: an override expires
|
|
7
|
+
* and a calendar block starts with nothing to announce either. Without that, somebody who set "busy
|
|
8
|
+
* for 30 minutes" would still see it an hour later while everyone else had stopped.</p>
|
|
9
|
+
*/
|
|
10
|
+
export declare const useMyPresence: () => UseQueryResult<MyPresence>;
|
|
11
|
+
export declare const useSetMyPresence: () => ReturnType<typeof useMutation<MyPresence, Error, SetMyPresenceInput>>;
|
|
12
|
+
export declare const useClearMyPresence: () => ReturnType<typeof useMutation<MyPresence, Error, void>>;
|
|
13
|
+
//# sourceMappingURL=use-my-presence.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"use-my-presence.d.ts","sourceRoot":"","sources":["../../../../../../src/features/presence/presentation/use-my-presence.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,WAAW,EAA4B,KAAK,cAAc,EAAE,MAAM,uBAAuB,CAAC;AAEnG,OAAO,KAAK,EAAE,UAAU,EAAE,kBAAkB,EAAE,MAAM,WAAW,CAAC;AAKhE;;;;;;GAMG;AACH,eAAO,MAAM,aAAa,QAAO,cAAc,CAAC,UAAU,CAUzD,CAAC;AAaF,eAAO,MAAM,gBAAgB,QAAO,UAAU,CAC5C,OAAO,WAAW,CAAC,UAAU,EAAE,KAAK,EAAE,kBAAkB,CAAC,CAS1D,CAAC;AAEF,eAAO,MAAM,kBAAkB,QAAO,UAAU,CAAC,OAAO,WAAW,CAAC,UAAU,EAAE,KAAK,EAAE,IAAI,CAAC,CAQ3F,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"use-presence-module.d.ts","sourceRoot":"","sources":["../../../../../../src/features/presence/presentation/use-presence-module.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,oBAAoB,CAAC;AAEzD,eAAO,MAAM,iBAAiB,QAAO,cAMpC,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"FeedTemplatesTab.d.ts","sourceRoot":"","sources":["../../../../../../src/features/settings/presentation/FeedTemplatesTab.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,YAAY,EAAY,MAAM,OAAO,CAAC;
|
|
1
|
+
{"version":3,"file":"FeedTemplatesTab.d.ts","sourceRoot":"","sources":["../../../../../../src/features/settings/presentation/FeedTemplatesTab.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,YAAY,EAAY,MAAM,OAAO,CAAC;AAwRpD,eAAO,MAAM,gBAAgB,QAAO,YA+BnC,CAAC"}
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import type { PresenceStatus } from '@shared/presence';
|
|
1
2
|
export interface UserProps {
|
|
2
3
|
readonly id: string;
|
|
3
4
|
readonly fullName: string;
|
|
@@ -10,6 +11,16 @@ export interface UserProps {
|
|
|
10
11
|
readonly branchName: string;
|
|
11
12
|
readonly level: number;
|
|
12
13
|
readonly online: boolean;
|
|
14
|
+
/**
|
|
15
|
+
* What they are doing, which is a different question from whether their client is connected — see
|
|
16
|
+
* `PresenceBadge`.
|
|
17
|
+
*
|
|
18
|
+
* <p>Optional because absence is a real state, not an omission: a deployment whose API predates
|
|
19
|
+
* presence sends nothing, and so does every fixture that predates it. Both mean the same thing —
|
|
20
|
+
* nothing is known — and the constructor resolves that to `offline` rather than inventing a status.</p>
|
|
21
|
+
*/
|
|
22
|
+
readonly status?: PresenceStatus;
|
|
23
|
+
readonly statusUntilUtc?: string | null;
|
|
13
24
|
/** Whether the member has a signed-in account; false = directory-only (never onboarded). Defaults true. */
|
|
14
25
|
readonly hasAccount?: boolean | undefined;
|
|
15
26
|
readonly initials: string;
|
|
@@ -33,6 +44,8 @@ export declare class User {
|
|
|
33
44
|
readonly branchName: string;
|
|
34
45
|
readonly level: number;
|
|
35
46
|
readonly online: boolean;
|
|
47
|
+
readonly status: PresenceStatus;
|
|
48
|
+
readonly statusUntilUtc: string | null;
|
|
36
49
|
readonly hasAccount: boolean;
|
|
37
50
|
readonly initials: string;
|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AAgB,KAAK,EAAE,MAAM,CAAC;IAC9B,SAAgB,QAAQ,EAAE,MAAM,CAAC;IACjC,SAAgB,UAAU,EAAE,MAAM,CAAC;IACnC,SAAgB,SAAS,EAAE,MAAM,CAAC;IAClC,SAAgB,UAAU,EAAE,MAAM,CAAC;IACnC,SAAgB,KAAK,EAAE,MAAM,CAAC;IAC9B,SAAgB,MAAM,EAAE,OAAO,CAAC;IAEhC,SAAgB,MAAM,EAAE,cAAc,CAAC;IAEvC,SAAgB,cAAc,EAAE,MAAM,GAAG,IAAI,CAAC;IAC9C,SAAgB,UAAU,EAAE,OAAO,CAAC;IACpC,SAAgB,QAAQ,EAAE,MAAM,CAAC;IACjC,SAAgB,KAAK,EAAE,MAAM,CAAC;IAC9B,SAAgB,iBAAiB,CAAC,EAAE,MAAM,GAAG,SAAS,CAAC;IACvD,SAAgB,kBAAkB,CAAC,EAAE,MAAM,GAAG,SAAS,CAAC;gBAErC,KAAK,EAAE,SAAS;IAmBnC,+FAA+F;IAC/F,IAAW,QAAQ,IAAI,OAAO,CAE7B;CACF"}
|
|
@@ -13,6 +13,8 @@ export declare const StaffMemberSchema: z.ZodObject<{
|
|
|
13
13
|
branchName: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
14
14
|
level: z.ZodNumber;
|
|
15
15
|
online: z.ZodBoolean;
|
|
16
|
+
status: z.ZodOptional<z.ZodNullable<z.ZodNumber>>;
|
|
17
|
+
statusUntilUtc: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
16
18
|
hasAccount: z.ZodOptional<z.ZodNullable<z.ZodBoolean>>;
|
|
17
19
|
initials: z.ZodString;
|
|
18
20
|
color: z.ZodString;
|
|
@@ -28,8 +30,10 @@ export declare const StaffMemberSchema: z.ZodObject<{
|
|
|
28
30
|
roleName: string;
|
|
29
31
|
department: string;
|
|
30
32
|
level: number;
|
|
33
|
+
status?: number | null | undefined;
|
|
31
34
|
branchKey?: string | null | undefined;
|
|
32
35
|
branchName?: string | null | undefined;
|
|
36
|
+
statusUntilUtc?: string | null | undefined;
|
|
33
37
|
hasAccount?: boolean | null | undefined;
|
|
34
38
|
permissionSetName?: string | null | undefined;
|
|
35
39
|
permissionSetColor?: string | null | undefined;
|
|
@@ -43,8 +47,10 @@ export declare const StaffMemberSchema: z.ZodObject<{
|
|
|
43
47
|
roleName: string;
|
|
44
48
|
department: string;
|
|
45
49
|
level: number;
|
|
50
|
+
status?: number | null | undefined;
|
|
46
51
|
branchKey?: string | null | undefined;
|
|
47
52
|
branchName?: string | null | undefined;
|
|
53
|
+
statusUntilUtc?: string | null | undefined;
|
|
48
54
|
hasAccount?: boolean | null | undefined;
|
|
49
55
|
permissionSetName?: string | null | undefined;
|
|
50
56
|
permissionSetColor?: string | null | undefined;
|
|
@@ -62,6 +68,8 @@ export declare const PagedStaffMemberListSchema: z.ZodObject<{
|
|
|
62
68
|
branchName: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
63
69
|
level: z.ZodNumber;
|
|
64
70
|
online: z.ZodBoolean;
|
|
71
|
+
status: z.ZodOptional<z.ZodNullable<z.ZodNumber>>;
|
|
72
|
+
statusUntilUtc: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
65
73
|
hasAccount: z.ZodOptional<z.ZodNullable<z.ZodBoolean>>;
|
|
66
74
|
initials: z.ZodString;
|
|
67
75
|
color: z.ZodString;
|
|
@@ -77,8 +85,10 @@ export declare const PagedStaffMemberListSchema: z.ZodObject<{
|
|
|
77
85
|
roleName: string;
|
|
78
86
|
department: string;
|
|
79
87
|
level: number;
|
|
88
|
+
status?: number | null | undefined;
|
|
80
89
|
branchKey?: string | null | undefined;
|
|
81
90
|
branchName?: string | null | undefined;
|
|
91
|
+
statusUntilUtc?: string | null | undefined;
|
|
82
92
|
hasAccount?: boolean | null | undefined;
|
|
83
93
|
permissionSetName?: string | null | undefined;
|
|
84
94
|
permissionSetColor?: string | null | undefined;
|
|
@@ -92,8 +102,10 @@ export declare const PagedStaffMemberListSchema: z.ZodObject<{
|
|
|
92
102
|
roleName: string;
|
|
93
103
|
department: string;
|
|
94
104
|
level: number;
|
|
105
|
+
status?: number | null | undefined;
|
|
95
106
|
branchKey?: string | null | undefined;
|
|
96
107
|
branchName?: string | null | undefined;
|
|
108
|
+
statusUntilUtc?: string | null | undefined;
|
|
97
109
|
hasAccount?: boolean | null | undefined;
|
|
98
110
|
permissionSetName?: string | null | undefined;
|
|
99
111
|
permissionSetColor?: string | null | undefined;
|
|
@@ -109,8 +121,10 @@ export declare const PagedStaffMemberListSchema: z.ZodObject<{
|
|
|
109
121
|
roleName: string;
|
|
110
122
|
department: string;
|
|
111
123
|
level: number;
|
|
124
|
+
status?: number | null | undefined;
|
|
112
125
|
branchKey?: string | null | undefined;
|
|
113
126
|
branchName?: string | null | undefined;
|
|
127
|
+
statusUntilUtc?: string | null | undefined;
|
|
114
128
|
hasAccount?: boolean | null | undefined;
|
|
115
129
|
permissionSetName?: string | null | undefined;
|
|
116
130
|
permissionSetColor?: string | null | undefined;
|
|
@@ -127,8 +141,10 @@ export declare const PagedStaffMemberListSchema: z.ZodObject<{
|
|
|
127
141
|
roleName: string;
|
|
128
142
|
department: string;
|
|
129
143
|
level: number;
|
|
144
|
+
status?: number | null | undefined;
|
|
130
145
|
branchKey?: string | null | undefined;
|
|
131
146
|
branchName?: string | null | undefined;
|
|
147
|
+
statusUntilUtc?: string | null | undefined;
|
|
132
148
|
hasAccount?: boolean | null | undefined;
|
|
133
149
|
permissionSetName?: string | null | undefined;
|
|
134
150
|
permissionSetColor?: string | null | undefined;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"user-dtos.d.ts","sourceRoot":"","sources":["../../../../../../../src/features/users/infrastructure/dto/user-dtos.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAExB;;;GAGG;AACH,eAAO,MAAM,iBAAiB
|
|
1
|
+
{"version":3,"file":"user-dtos.d.ts","sourceRoot":"","sources":["../../../../../../../src/features/users/infrastructure/dto/user-dtos.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAExB;;;GAGG;AACH,eAAO,MAAM,iBAAiB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EAoB5B,CAAC;AAEH,MAAM,MAAM,cAAc,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,iBAAiB,CAAC,CAAC;AAE/D,eAAO,MAAM,0BAA0B;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EAGrC,CAAC;AAEH,MAAM,MAAM,uBAAuB,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,0BAA0B,CAAC,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"user-mappers.d.ts","sourceRoot":"","sources":["../../../../../../src/features/users/infrastructure/user-mappers.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"user-mappers.d.ts","sourceRoot":"","sources":["../../../../../../src/features/users/infrastructure/user-mappers.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,IAAI,EAAE,MAAM,WAAW,CAAC;AACjC,OAAO,EAAE,KAAK,cAAc,EAAE,MAAM,iBAAiB,CAAC;AAEtD,0EAA0E;AAC1E,eAAO,MAAM,MAAM,GAAI,KAAK,cAAc,KAAG,IAmBzC,CAAC"}
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
import type { ReactElement } from 'react';
|
|
2
|
+
import type { User } from '../domain';
|
|
3
|
+
/**
|
|
4
|
+
* One directory row's presence: the connection line, plus the status badge when it says something the
|
|
5
|
+
* line cannot.
|
|
6
|
+
*
|
|
7
|
+
* <p>Its own component because it reads the live store, and a hook cannot be called from inside the
|
|
8
|
+
* table's `.map`. That is a happy constraint — it keeps the live-versus-snapshot rule in one place
|
|
9
|
+
* instead of inlining it in a cell.</p>
|
|
10
|
+
*
|
|
11
|
+
* <p>An announced status also decides the dot. The server resolves Offline exactly when a person has
|
|
12
|
+
* no connection, so the badge and the dot cannot disagree once an event has arrived — and without
|
|
13
|
+
* this the row would keep the stale "Online" it was fetched with while its badge said otherwise.</p>
|
|
14
|
+
*/
|
|
15
|
+
export declare const UserPresenceCell: ({ user }: {
|
|
16
|
+
readonly user: User;
|
|
17
|
+
}) => ReactElement;
|
|
18
|
+
//# sourceMappingURL=UserPresenceCell.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"UserPresenceCell.d.ts","sourceRoot":"","sources":["../../../../../../src/features/users/presentation/UserPresenceCell.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,OAAO,CAAC;AAG1C,OAAO,KAAK,EAAE,IAAI,EAAE,MAAM,WAAW,CAAC;AAGtC;;;;;;;;;;;GAWG;AACH,eAAO,MAAM,gBAAgB,GAAI,UAAU;IAAE,QAAQ,CAAC,IAAI,EAAE,IAAI,CAAA;CAAE,KAAG,YAwBpE,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"UsersPage.d.ts","sourceRoot":"","sources":["../../../../../../src/features/users/presentation/UsersPage.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,YAAY,EAAY,MAAM,OAAO,CAAC;
|
|
1
|
+
{"version":3,"file":"UsersPage.d.ts","sourceRoot":"","sources":["../../../../../../src/features/users/presentation/UsersPage.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,YAAY,EAAY,MAAM,OAAO,CAAC;AA2LpD;;;GAGG;AACH,eAAO,MAAM,SAAS,QAAO,YAmF5B,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"SdkProviders.d.ts","sourceRoot":"","sources":["../../../../src/sdk/SdkProviders.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,YAAY,EAAE,SAAS,EAAE,MAAM,OAAO,CAAC;
|
|
1
|
+
{"version":3,"file":"SdkProviders.d.ts","sourceRoot":"","sources":["../../../../src/sdk/SdkProviders.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,YAAY,EAAE,SAAS,EAAE,MAAM,OAAO,CAAC;AAerD,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,gCAAgC,CAAC;AAErE,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,SAAS,CAAC;AAExC,MAAM,WAAW,iBAAiB;IAChC,QAAQ,CAAC,WAAW,EAAE,cAAc,CAAC;IACrC,QAAQ,CAAC,QAAQ,EAAE,SAAS,CAAC;IAC7B,4FAA4F;IAC5F,QAAQ,CAAC,OAAO,CAAC,EAAE,CAAC,CAAC,KAAK,EAAE,QAAQ,KAAK,IAAI,CAAC,GAAG,SAAS,CAAC;CAC5D;AAED;;;;;;;;;;;;GAYG;AACH,eAAO,MAAM,YAAY,GAAI,qCAI1B,iBAAiB,KAAG,YAmDtB,CAAC"}
|
package/types/sdk/index.d.ts
CHANGED
|
@@ -16,6 +16,11 @@ export { CommsProvider } from './CommsProvider';
|
|
|
16
16
|
* where no widget is mounted and `onEvent` therefore never fires — this reaches them anyway.
|
|
17
17
|
*/
|
|
18
18
|
export { createNotificationClient, type NotificationClient, type NotificationClientOptions, type SdkNotification, } from './notifications/notification-client';
|
|
19
|
+
/**
|
|
20
|
+
* The signed-in person's own status, without a widget. The widgets show everyone ELSE's status; this
|
|
21
|
+
* is how a host's own header lets somebody set theirs.
|
|
22
|
+
*/
|
|
23
|
+
export { createPresenceClient, type PresenceClient, type PresenceClientOptions, type SdkPresence, type SdkPresenceSource, type SdkPresenceStatus, type SetSdkPresenceInput, } from './presence/presence-client';
|
|
19
24
|
export { WidgetRoot, type WidgetRootProps } from './elements/WidgetRoot';
|
|
20
25
|
export { registerChatWidget, registerFeedWidget, registerBookingsWidget, registerScheduleWidget, };
|
|
21
26
|
export { SDK_MODULE_SCOPES, type AuthConfig, type CommsProviderProps, type SdkEvent, type SdkModuleScope, type ThemeConfig, type ThemeDensity, type ThemeMode, } from './types';
|
package/types/sdk/index.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/sdk/index.ts"],"names":[],"mappings":"AAAA;;;;;;;GAOG;AACH,OAAO,EAAE,kBAAkB,EAAE,MAAM,sBAAsB,CAAC;AAC1D,OAAO,EAAE,kBAAkB,EAAE,MAAM,sBAAsB,CAAC;AAC1D,OAAO,EAAE,sBAAsB,EAAE,MAAM,0BAA0B,CAAC;AAClE,OAAO,EAAE,sBAAsB,EAAE,MAAM,0BAA0B,CAAC;AAElE,OAAO,EAAE,aAAa,EAAE,MAAM,iBAAiB,CAAC;AAChD;;;GAGG;AACH,OAAO,EACL,wBAAwB,EACxB,KAAK,kBAAkB,EACvB,KAAK,yBAAyB,EAC9B,KAAK,eAAe,GACrB,MAAM,qCAAqC,CAAC;AAC7C,OAAO,EAAE,UAAU,EAAE,KAAK,eAAe,EAAE,MAAM,uBAAuB,CAAC;AACzE,OAAO,EACL,kBAAkB,EAClB,kBAAkB,EAClB,sBAAsB,EACtB,sBAAsB,GACvB,CAAC;AAEF,OAAO,EACL,iBAAiB,EACjB,KAAK,UAAU,EACf,KAAK,kBAAkB,EACvB,KAAK,QAAQ,EACb,KAAK,cAAc,EACnB,KAAK,WAAW,EAChB,KAAK,YAAY,EACjB,KAAK,SAAS,GACf,MAAM,SAAS,CAAC;AAEjB;;;GAGG;AACH,eAAO,MAAM,oBAAoB,QAAO,IAKvC,CAAC"}
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/sdk/index.ts"],"names":[],"mappings":"AAAA;;;;;;;GAOG;AACH,OAAO,EAAE,kBAAkB,EAAE,MAAM,sBAAsB,CAAC;AAC1D,OAAO,EAAE,kBAAkB,EAAE,MAAM,sBAAsB,CAAC;AAC1D,OAAO,EAAE,sBAAsB,EAAE,MAAM,0BAA0B,CAAC;AAClE,OAAO,EAAE,sBAAsB,EAAE,MAAM,0BAA0B,CAAC;AAElE,OAAO,EAAE,aAAa,EAAE,MAAM,iBAAiB,CAAC;AAChD;;;GAGG;AACH,OAAO,EACL,wBAAwB,EACxB,KAAK,kBAAkB,EACvB,KAAK,yBAAyB,EAC9B,KAAK,eAAe,GACrB,MAAM,qCAAqC,CAAC;AAC7C;;;GAGG;AACH,OAAO,EACL,oBAAoB,EACpB,KAAK,cAAc,EACnB,KAAK,qBAAqB,EAC1B,KAAK,WAAW,EAChB,KAAK,iBAAiB,EACtB,KAAK,iBAAiB,EACtB,KAAK,mBAAmB,GACzB,MAAM,4BAA4B,CAAC;AACpC,OAAO,EAAE,UAAU,EAAE,KAAK,eAAe,EAAE,MAAM,uBAAuB,CAAC;AACzE,OAAO,EACL,kBAAkB,EAClB,kBAAkB,EAClB,sBAAsB,EACtB,sBAAsB,GACvB,CAAC;AAEF,OAAO,EACL,iBAAiB,EACjB,KAAK,UAAU,EACf,KAAK,kBAAkB,EACvB,KAAK,QAAQ,EACb,KAAK,cAAc,EACnB,KAAK,WAAW,EAChB,KAAK,YAAY,EACjB,KAAK,SAAS,GACf,MAAM,SAAS,CAAC;AAEjB;;;GAGG;AACH,eAAO,MAAM,oBAAoB,QAAO,IAKvC,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"notification-client.d.ts","sourceRoot":"","sources":["../../../../../src/sdk/notifications/notification-client.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"notification-client.d.ts","sourceRoot":"","sources":["../../../../../src/sdk/notifications/notification-client.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,cAAc,CAAC;AAI3C,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,UAAU,CAAC;AAC/C,OAAO,EAAqB,KAAK,eAAe,EAAE,MAAM,wBAAwB,CAAC;AAGjF,YAAY,EAAE,eAAe,EAAE,CAAC;AAEhC,MAAM,WAAW,yBAAyB;IACxC,2CAA2C;IAC3C,QAAQ,CAAC,UAAU,EAAE,MAAM,CAAC;IAC5B,QAAQ,CAAC,SAAS,EAAE,MAAM,CAAC;IAC3B;;;OAGG;IACH,QAAQ,CAAC,YAAY,EAAE,MAAM,OAAO,CAAC,MAAM,CAAC,CAAC;IAC7C;;;OAGG;IACH,QAAQ,CAAC,OAAO,CAAC,EAAE,SAAS,cAAc,EAAE,CAAC;IAC7C,4EAA4E;IAC5E,QAAQ,CAAC,cAAc,EAAE,CAAC,YAAY,EAAE,eAAe,KAAK,IAAI,CAAC;IACjE,QAAQ,CAAC,MAAM,CAAC,EAAE,MAAM,CAAC;CAC1B;AAED,MAAM,WAAW,kBAAkB;IACjC,gFAAgF;IAChF,KAAK,EAAE,MAAM,OAAO,CAAC,IAAI,CAAC,CAAC;IAC3B,yEAAyE;IACzE,IAAI,EAAE,MAAM,OAAO,CAAC,IAAI,CAAC,CAAC;IAC1B,oFAAoF;IACpF,UAAU,EAAE,CAAC,EAAE,EAAE,MAAM,KAAK,OAAO,CAAC,IAAI,CAAC,CAAC;IAC1C,6EAA6E;IAC7E,MAAM,EAAE,MAAM,SAAS,eAAe,EAAE,CAAC;CAC1C;AA0CD;;;;;;;;;;;;;;;;;;;;;GAqBG;AACH,eAAO,MAAM,wBAAwB,GACnC,SAAS,yBAAyB,KACjC,kBA4DF,CAAC"}
|
|
@@ -0,0 +1,75 @@
|
|
|
1
|
+
import type { Logger } from '@core/logger';
|
|
2
|
+
import type { PresenceStatus } from '@shared/presence';
|
|
3
|
+
import type { SdkModuleScope } from '../types';
|
|
4
|
+
/**
|
|
5
|
+
* A status, by name. An alias rather than a copy of the union: a second literal list would drift from
|
|
6
|
+
* the one the wire mapping uses, and the failure would be a status that silently reads as offline.
|
|
7
|
+
*/
|
|
8
|
+
export type SdkPresenceStatus = PresenceStatus;
|
|
9
|
+
/** Which input decided the status — `override` is the only one the person can clear. */
|
|
10
|
+
export type SdkPresenceSource = 'override' | 'activity' | 'calendar' | 'connection';
|
|
11
|
+
/** The signed-in person's presence, as everyone else sees it. */
|
|
12
|
+
export interface SdkPresence {
|
|
13
|
+
readonly status: SdkPresenceStatus;
|
|
14
|
+
readonly source: SdkPresenceSource;
|
|
15
|
+
/** ISO 8601 UTC instant the status ends, or null when nothing bounds it. Format it locally. */
|
|
16
|
+
readonly untilUtc: string | null;
|
|
17
|
+
readonly note: string | null;
|
|
18
|
+
/** True only while a self-set status is in force — the one case `clearMine` applies to. */
|
|
19
|
+
readonly hasOverride: boolean;
|
|
20
|
+
}
|
|
21
|
+
export interface SetSdkPresenceInput {
|
|
22
|
+
readonly status: SdkPresenceStatus;
|
|
23
|
+
/**
|
|
24
|
+
* How long it lasts. A duration, never an end time: the server resolves it against ITS clock, so a
|
|
25
|
+
* device with a wrong clock cannot extend its own status. Capped at 24 hours server-side.
|
|
26
|
+
*/
|
|
27
|
+
readonly minutes: number;
|
|
28
|
+
readonly note?: string;
|
|
29
|
+
}
|
|
30
|
+
export interface PresenceClientOptions {
|
|
31
|
+
/** Origin of the Communication Hub API. */
|
|
32
|
+
readonly apiBaseUrl: string;
|
|
33
|
+
readonly clientKey: string;
|
|
34
|
+
/** Fetches a fresh single-use signed assertion from YOUR server. Called again on every renewal. */
|
|
35
|
+
readonly getAssertion: () => Promise<string>;
|
|
36
|
+
/** Any scope works — presence is reachable from all of them. Defaults to `commhub.chat`. */
|
|
37
|
+
readonly modules?: readonly SdkModuleScope[];
|
|
38
|
+
readonly logger?: Logger;
|
|
39
|
+
}
|
|
40
|
+
export interface PresenceClient {
|
|
41
|
+
/** The person's presence right now, or null when it could not be read. */
|
|
42
|
+
getMine: () => Promise<SdkPresence | null>;
|
|
43
|
+
/**
|
|
44
|
+
* Declares a status for a bounded time and answers with the RESOLVED presence — which is not always
|
|
45
|
+
* what was asked for, because a calendar block can outrank it. Render the answer, not the request.
|
|
46
|
+
*/
|
|
47
|
+
setMine: (input: SetSdkPresenceInput) => Promise<SdkPresence | null>;
|
|
48
|
+
/** Ends a self-set status early, falling back to whatever the system infers. */
|
|
49
|
+
clearMine: () => Promise<SdkPresence | null>;
|
|
50
|
+
}
|
|
51
|
+
/**
|
|
52
|
+
* The signed-in person's own status, WITHOUT a widget.
|
|
53
|
+
*
|
|
54
|
+
* <p>The widgets show everyone else's status beside their name, but they have no chrome of their own
|
|
55
|
+
* to set one from — a host application's user is on one of its own pages, under its own header. This
|
|
56
|
+
* is how that header gets a status control. Without it the feature is half-present in an embedded
|
|
57
|
+
* integration: you can see who not to interrupt, and never tell anyone not to interrupt you.</p>
|
|
58
|
+
*
|
|
59
|
+
* <p>Deliberately headless, and deliberately built on the same gateway the widgets use. The wire
|
|
60
|
+
* mapping is the part a host would get wrong on its own: `status` crosses as a NUMBER, and posting the
|
|
61
|
+
* name is a 400 that reads like a validation failure.</p>
|
|
62
|
+
*
|
|
63
|
+
* <p>Reads and writes only. It does not open a socket, so it will not tell you when somebody ELSE's
|
|
64
|
+
* status changes — mount a widget for that.</p>
|
|
65
|
+
*
|
|
66
|
+
* @example
|
|
67
|
+
* const presence = createPresenceClient({
|
|
68
|
+
* apiBaseUrl: 'https://api.commhub.example',
|
|
69
|
+
* clientKey: 'sk_live_…',
|
|
70
|
+
* getAssertion: () => fetch('/api/commhub-assertion').then((r) => r.text()),
|
|
71
|
+
* });
|
|
72
|
+
* await presence.setMine({ status: 'busy', minutes: 30, note: 'On a call' });
|
|
73
|
+
*/
|
|
74
|
+
export declare const createPresenceClient: (options: PresenceClientOptions) => PresenceClient;
|
|
75
|
+
//# sourceMappingURL=presence-client.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"presence-client.d.ts","sourceRoot":"","sources":["../../../../../src/sdk/presence/presence-client.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,cAAc,CAAC;AAC3C,OAAO,KAAK,EAAE,cAAc,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,CAAC,KAAK,EAAE,mBAAmB,KAAK,OAAO,CAAC,WAAW,GAAG,IAAI,CAAC,CAAC;IACrE,gFAAgF;IAChF,SAAS,EAAE,MAAM,OAAO,CAAC,WAAW,GAAG,IAAI,CAAC,CAAC;CAC9C;AAED;;;;;;;;;;;;;;;;;;;;;;GAsBG;AACH,eAAO,MAAM,oBAAoB,GAAI,SAAS,qBAAqB,KAAG,cAiCrE,CAAC"}
|
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
import { type HttpClient } from '@core/http';
|
|
2
|
+
import { type Logger } from '@core/logger';
|
|
3
|
+
import type { SdkModuleScope } from '../types';
|
|
4
|
+
/** What every headless (widget-less) client needs to reach the Hub as the signed-in person. */
|
|
5
|
+
export interface HeadlessSessionOptions {
|
|
6
|
+
/** Origin of the Communication Hub API. */
|
|
7
|
+
readonly apiBaseUrl: string;
|
|
8
|
+
readonly clientKey: string;
|
|
9
|
+
/**
|
|
10
|
+
* Fetches a fresh signed assertion from YOUR server. Called for the first token and again whenever
|
|
11
|
+
* one expires — each assertion is single-use, so this must mint a new one every time.
|
|
12
|
+
*/
|
|
13
|
+
readonly getAssertion: () => Promise<string>;
|
|
14
|
+
readonly modules: readonly SdkModuleScope[];
|
|
15
|
+
readonly logger?: Logger;
|
|
16
|
+
}
|
|
17
|
+
export interface HeadlessSession {
|
|
18
|
+
readonly httpClient: HttpClient;
|
|
19
|
+
readonly logger: Logger;
|
|
20
|
+
/** A valid access token, minted or renewed as needed. `undefined` when the exchange failed. */
|
|
21
|
+
readonly token: () => Promise<string | undefined>;
|
|
22
|
+
/** The current token without minting one — for a socket's per-handshake read. */
|
|
23
|
+
readonly currentToken: () => string | undefined;
|
|
24
|
+
}
|
|
25
|
+
/**
|
|
26
|
+
* The token + transport a headless client runs on.
|
|
27
|
+
*
|
|
28
|
+
* <p>Shared by every host-facing client rather than re-derived per feature, because the part hosts get
|
|
29
|
+
* wrong is not the endpoint — it is the lifetime. There is no refresh token in this flow by design, so
|
|
30
|
+
* renewal means another assertion, and a client that waits for a 401 to discover this has already
|
|
31
|
+
* dropped the call it was making. The skew is what turns "renew on failure" into "renew in time".</p>
|
|
32
|
+
*/
|
|
33
|
+
export declare const createHeadlessSession: (options: HeadlessSessionOptions) => HeadlessSession;
|
|
34
|
+
//# sourceMappingURL=headless-session.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"headless-session.d.ts","sourceRoot":"","sources":["../../../../../src/sdk/runtime/headless-session.ts"],"names":[],"mappings":"AAAA,OAAO,EAAuD,KAAK,UAAU,EAAE,MAAM,YAAY,CAAC;AAClG,OAAO,EAAiB,KAAK,MAAM,EAAE,MAAM,cAAc,CAAC;AAG1D,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,UAAU,CAAC;AAE/C,+FAA+F;AAC/F,MAAM,WAAW,sBAAsB;IACrC,2CAA2C;IAC3C,QAAQ,CAAC,UAAU,EAAE,MAAM,CAAC;IAC5B,QAAQ,CAAC,SAAS,EAAE,MAAM,CAAC;IAC3B;;;OAGG;IACH,QAAQ,CAAC,YAAY,EAAE,MAAM,OAAO,CAAC,MAAM,CAAC,CAAC;IAC7C,QAAQ,CAAC,OAAO,EAAE,SAAS,cAAc,EAAE,CAAC;IAC5C,QAAQ,CAAC,MAAM,CAAC,EAAE,MAAM,CAAC;CAC1B;AAED,MAAM,WAAW,eAAe;IAC9B,QAAQ,CAAC,UAAU,EAAE,UAAU,CAAC;IAChC,QAAQ,CAAC,MAAM,EAAE,MAAM,CAAC;IACxB,+FAA+F;IAC/F,QAAQ,CAAC,KAAK,EAAE,MAAM,OAAO,CAAC,MAAM,GAAG,SAAS,CAAC,CAAC;IAClD,iFAAiF;IACjF,QAAQ,CAAC,YAAY,EAAE,MAAM,MAAM,GAAG,SAAS,CAAC;CACjD;AAID;;;;;;;GAOG;AACH,eAAO,MAAM,qBAAqB,GAAI,SAAS,sBAAsB,KAAG,eA+CvE,CAAC"}
|
|
@@ -8,6 +8,7 @@ import { type MeetingsModule } from '@features/meetings';
|
|
|
8
8
|
import { type ScheduleModule } from '@features/schedule';
|
|
9
9
|
import { type SettingsModule } from '@features/settings';
|
|
10
10
|
import { type UsersModule } from '@features/users';
|
|
11
|
+
import { type PresenceModule } from '@features/presence';
|
|
11
12
|
import { type CallsModule } from '@features/calls';
|
|
12
13
|
import { type MeetingVideoModule } from '@features/meeting-video';
|
|
13
14
|
import type { SdkModuleScope } from '../types';
|
|
@@ -27,6 +28,7 @@ export interface SdkComposition {
|
|
|
27
28
|
*/
|
|
28
29
|
readonly settingsModule: SettingsModule;
|
|
29
30
|
readonly usersModule: UsersModule;
|
|
31
|
+
readonly presenceModule: PresenceModule;
|
|
30
32
|
readonly callsModule: CallsModule;
|
|
31
33
|
readonly queryClient: QueryClient;
|
|
32
34
|
/**
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"sdk-composition-root.d.ts","sourceRoot":"","sources":["../../../../../src/sdk/runtime/sdk-composition-root.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,WAAW,EAAE,MAAM,uBAAuB,CAAC;AACpD,OAAO,EAAiB,KAAK,MAAM,EAAE,MAAM,cAAc,CAAC;AAa1D,OAAO,EAAE,KAAK,SAAS,EAAE,MAAM,gBAAgB,CAAC;AAEhD,OAAO,KAAK,EAAE,kBAAkB,EAAE,MAAM,yBAAyB,CAAC;AAClE,OAAO,EAAoB,KAAK,UAAU,EAAE,MAAM,gBAAgB,CAAC;AACnE,OAAO,EAAoB,KAAK,UAAU,EAAE,MAAM,gBAAgB,CAAC;AACnE,OAAO,EAAwB,KAAK,cAAc,EAAE,MAAM,oBAAoB,CAAC;AAC/E,OAAO,EAAwB,KAAK,cAAc,EAAE,MAAM,oBAAoB,CAAC;AAC/E,OAAO,EAAwB,KAAK,cAAc,EAAE,MAAM,oBAAoB,CAAC;AAC/E,OAAO,EAAqB,KAAK,WAAW,EAAE,MAAM,iBAAiB,CAAC;AACtE,OAAO,EAAqB,KAAK,WAAW,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,EAAE,WAAW,CAAC;IAClC,QAAQ,CAAC,cAAc,EAAE,cAAc,CAAC;IACxC,QAAQ,CAAC,WAAW,EAAE,WAAW,CAAC;IAClC,QAAQ,CAAC,WAAW,EAAE,WAAW,CAAC;IAClC;;;;OAIG;IACH,OAAO,IAAI,OAAO,CAAC,IAAI,CAAC,CAAC;CAC1B;AAED,MAAM,WAAW,mBAAmB;IAClC,QAAQ,CAAC,UAAU,EAAE,MAAM,CAAC;IAC5B,QAAQ,CAAC,SAAS,EAAE,SAAS,CAAC;IAC9B,QAAQ,CAAC,OAAO,CAAC,EAAE,SAAS,cAAc,EAAE,GAAG,SAAS,CAAC;IACzD,QAAQ,CAAC,MAAM,CAAC,EAAE,MAAM,GAAG,SAAS,CAAC;CACtC;AA2CD,eAAO,MAAM,oBAAoB,GAAI,OAAO,mBAAmB,KAAG,cAqEjE,CAAC"}
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
import type { ReactElement } from 'react';
|
|
2
|
+
import { type PresenceStatus } from './presence-status';
|
|
3
|
+
export interface PresenceBadgeProps {
|
|
4
|
+
readonly status: PresenceStatus;
|
|
5
|
+
/** When the status ends. Rendered only when a formatter is supplied — see the note below. */
|
|
6
|
+
readonly untilUtc?: string | null;
|
|
7
|
+
/** Formats an ISO instant in the READER's locale and zone. Omit to show the bare label. */
|
|
8
|
+
readonly formatTime?: (iso: string) => string;
|
|
9
|
+
readonly size?: 'sm' | 'md';
|
|
10
|
+
}
|
|
11
|
+
/**
|
|
12
|
+
* The status badge — Available, Busy, In a meeting, Focus, Away, Offline.
|
|
13
|
+
*
|
|
14
|
+
* <p>Deliberately NOT the online dot. A person can be connected AND busy: the dot answers "is their
|
|
15
|
+
* client open", the badge answers "should I interrupt them". Collapsing the two would lose the more
|
|
16
|
+
* useful half — a green dot beside someone in a meeting is worse than no dot at all, because it
|
|
17
|
+
* invites exactly the interruption the status was set to prevent.</p>
|
|
18
|
+
*
|
|
19
|
+
* <p>One component for every surface. Five places rendering their own version is how the same person
|
|
20
|
+
* ends up a different colour in the chat header and the directory on the same screen.</p>
|
|
21
|
+
*/
|
|
22
|
+
export declare const PresenceBadge: ({ status, untilUtc, formatTime, size, }: PresenceBadgeProps) => ReactElement;
|
|
23
|
+
//# sourceMappingURL=PresenceBadge.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"PresenceBadge.d.ts","sourceRoot":"","sources":["../../../../../src/shared/presence/PresenceBadge.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,OAAO,CAAC;AAE1C,OAAO,EAAqC,KAAK,cAAc,EAAE,MAAM,mBAAmB,CAAC;AAE3F,MAAM,WAAW,kBAAkB;IACjC,QAAQ,CAAC,MAAM,EAAE,cAAc,CAAC;IAChC,6FAA6F;IAC7F,QAAQ,CAAC,QAAQ,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC;IAClC,2FAA2F;IAC3F,QAAQ,CAAC,UAAU,CAAC,EAAE,CAAC,GAAG,EAAE,MAAM,KAAK,MAAM,CAAC;IAC9C,QAAQ,CAAC,IAAI,CAAC,EAAE,IAAI,GAAG,IAAI,CAAC;CAC7B;AAED;;;;;;;;;;GAUG;AACH,eAAO,MAAM,aAAa,GAAI,yCAK3B,kBAAkB,KAAG,YAYvB,CAAC"}
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* The end of a status, in the READER's clock.
|
|
3
|
+
*
|
|
4
|
+
* <p>The server sends an instant and never a rendered string, so the zone is chosen here — and it is
|
|
5
|
+
* deliberately the browser's, not the viewer's configured schedule timezone. "Busy until 15:30" is
|
|
6
|
+
* read to decide whether to interrupt someone right now; the only clock that answers that is the one
|
|
7
|
+
* on the wall of whoever is reading it.</p>
|
|
8
|
+
*
|
|
9
|
+
* <p>Returns the raw value unchanged when it is not a parseable instant: showing the input beats
|
|
10
|
+
* "Invalid Date", and beats a badge that vanishes because formatting threw.</p>
|
|
11
|
+
*/
|
|
12
|
+
export declare const formatPresenceTime: (iso: string) => string;
|
|
13
|
+
//# sourceMappingURL=format-presence-time.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"format-presence-time.d.ts","sourceRoot":"","sources":["../../../../../src/shared/presence/format-presence-time.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;GAUG;AACH,eAAO,MAAM,kBAAkB,GAAI,KAAK,MAAM,KAAG,MAMhD,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../src/shared/presence/index.ts"],"names":[],"mappings":"AAAA,cAAc,mBAAmB,CAAC;AAClC,cAAc,wBAAwB,CAAC;AACvC,cAAc,uBAAuB,CAAC;AACtC,cAAc,iBAAiB,CAAC"}
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
import type { PresenceStatus } from './presence-status';
|
|
2
|
+
/** A person's status as last announced over the live connection. */
|
|
3
|
+
export interface LiveStatusEntry {
|
|
4
|
+
readonly status: PresenceStatus;
|
|
5
|
+
/** When it ends (ISO UTC), or null when it is open-ended. */
|
|
6
|
+
readonly untilUtc: string | null;
|
|
7
|
+
}
|
|
8
|
+
/**
|
|
9
|
+
* The live status announced for a person, or undefined when none has arrived.
|
|
10
|
+
*
|
|
11
|
+
* <p>Undefined rather than a default: "nothing announced" and "announced as offline" are different
|
|
12
|
+
* facts, and only the caller knows what to fall back to.</p>
|
|
13
|
+
*/
|
|
14
|
+
export declare const useLiveStatus: (userId: string | null | undefined) => LiveStatusEntry | undefined;
|
|
15
|
+
/** Record an announced status. Called by whichever transport owns the live connection. */
|
|
16
|
+
export declare const applyLiveStatus: (userId: string, status: PresenceStatus, untilUtc: string | null) => void;
|
|
17
|
+
/** Read a status outside React (tests, non-hook call sites). */
|
|
18
|
+
export declare const readLiveStatus: (userId: string) => LiveStatusEntry | undefined;
|
|
19
|
+
/** Wipe every announced status — on sign-out, and between tests. */
|
|
20
|
+
export declare const resetLivePresence: () => void;
|
|
21
|
+
//# sourceMappingURL=live-presence-store.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"live-presence-store.d.ts","sourceRoot":"","sources":["../../../../../src/shared/presence/live-presence-store.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,mBAAmB,CAAC;AAExD,oEAAoE;AACpE,MAAM,WAAW,eAAe;IAC9B,QAAQ,CAAC,MAAM,EAAE,cAAc,CAAC;IAChC,6DAA6D;IAC7D,QAAQ,CAAC,QAAQ,EAAE,MAAM,GAAG,IAAI,CAAC;CAClC;AAqCD;;;;;GAKG;AACH,eAAO,MAAM,aAAa,GAAI,QAAQ,MAAM,GAAG,IAAI,GAAG,SAAS,KAAG,eAAe,GAAG,SAGjF,CAAC;AAEJ,0FAA0F;AAC1F,eAAO,MAAM,eAAe,GAC1B,QAAQ,MAAM,EACd,QAAQ,cAAc,EACtB,UAAU,MAAM,GAAG,IAAI,KACtB,IAEF,CAAC;AAEF,gEAAgE;AAChE,eAAO,MAAM,cAAc,GAAI,QAAQ,MAAM,KAAG,eAAe,GAAG,SAClB,CAAC;AAEjD,oEAAoE;AACpE,eAAO,MAAM,iBAAiB,QAAO,IAEpC,CAAC"}
|
|
@@ -0,0 +1,41 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* What a person is doing, as shown beside their name.
|
|
3
|
+
*
|
|
4
|
+
* <p>Mirrors the backend `UserPresenceStatus` enum by NUMBER, because that is what crosses the wire.
|
|
5
|
+
* The names are the contract; the numbers are the wire format, and mixing them up produces a badge
|
|
6
|
+
* that is confidently wrong rather than obviously broken.</p>
|
|
7
|
+
*/
|
|
8
|
+
export type PresenceStatus = 'available' | 'busy' | 'inMeeting' | 'focus' | 'away' | 'offline';
|
|
9
|
+
/**
|
|
10
|
+
* Falls back to `offline` for anything unrecognised.
|
|
11
|
+
*
|
|
12
|
+
* <p>Not `available`: an unknown value most likely means the server grew a status this client predates,
|
|
13
|
+
* and announcing an unknown person as reachable is the failure that sends a colleague to a channel
|
|
14
|
+
* nobody is reading. Offline is the honest answer when the client does not understand.</p>
|
|
15
|
+
*/
|
|
16
|
+
export declare const presenceStatusFromNumber: (value: number | null | undefined) => PresenceStatus;
|
|
17
|
+
/**
|
|
18
|
+
* The wire value for a status, for anything the client SENDS.
|
|
19
|
+
*
|
|
20
|
+
* <p>The server binds `UserPresenceStatus` with the default JSON options, which accept the number and
|
|
21
|
+
* nothing else — posting the name is a 400 that reads like a validation failure. Kept next to
|
|
22
|
+
* {@link presenceStatusFromNumber} so the two halves of the mapping cannot drift apart.</p>
|
|
23
|
+
*/
|
|
24
|
+
export declare const presenceStatusToNumber: (status: PresenceStatus) => number;
|
|
25
|
+
export interface PresenceStatusMeta {
|
|
26
|
+
readonly id: PresenceStatus;
|
|
27
|
+
readonly label: string;
|
|
28
|
+
/** A `BadgeTone` from the design system, so a badge never hard-codes a colour. */
|
|
29
|
+
readonly tone: 'success' | 'danger' | 'warn' | 'primary' | 'neutral';
|
|
30
|
+
}
|
|
31
|
+
export declare const PRESENCE_STATUSES: readonly PresenceStatusMeta[];
|
|
32
|
+
export declare const presenceStatusMeta: (status: PresenceStatus) => PresenceStatusMeta;
|
|
33
|
+
/**
|
|
34
|
+
* The one-line label a header shows, bounded when the status has an end.
|
|
35
|
+
*
|
|
36
|
+
* <p>"Busy" invites a guess about when to try again; "Busy until 15:30" answers it. The time is
|
|
37
|
+
* formatted in the READER's locale — the server sends an instant, never a rendered string, because it
|
|
38
|
+
* cannot know which timezone the person reading this is in.</p>
|
|
39
|
+
*/
|
|
40
|
+
export declare const presenceLabel: (status: PresenceStatus, untilUtc: string | null | undefined, formatTime: (iso: string) => string) => string;
|
|
41
|
+
//# sourceMappingURL=presence-status.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"presence-status.d.ts","sourceRoot":"","sources":["../../../../../src/shared/presence/presence-status.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AACH,MAAM,MAAM,cAAc,GACtB,WAAW,GACX,MAAM,GACN,WAAW,GACX,OAAO,GACP,MAAM,GACN,SAAS,CAAC;AAYd;;;;;;GAMG;AACH,eAAO,MAAM,wBAAwB,GACnC,OAAO,MAAM,GAAG,IAAI,GAAG,SAAS,KAC/B,cAAqD,CAAC;AAEzD;;;;;;GAMG;AACH,eAAO,MAAM,sBAAsB,GAAI,QAAQ,cAAc,KAAG,MACrC,CAAC;AAE5B,MAAM,WAAW,kBAAkB;IACjC,QAAQ,CAAC,EAAE,EAAE,cAAc,CAAC;IAC5B,QAAQ,CAAC,KAAK,EAAE,MAAM,CAAC;IACvB,kFAAkF;IAClF,QAAQ,CAAC,IAAI,EAAE,SAAS,GAAG,QAAQ,GAAG,MAAM,GAAG,SAAS,GAAG,SAAS,CAAC;CACtE;AAED,eAAO,MAAM,iBAAiB,EAAE,SAAS,kBAAkB,EAO1D,CAAC;AASF,eAAO,MAAM,kBAAkB,GAAI,QAAQ,cAAc,KAAG,kBACU,CAAC;AAEvE;;;;;;GAMG;AACH,eAAO,MAAM,aAAa,GACxB,QAAQ,cAAc,EACtB,UAAU,MAAM,GAAG,IAAI,GAAG,SAAS,EACnC,YAAY,CAAC,GAAG,EAAE,MAAM,KAAK,MAAM,KAClC,MAMF,CAAC"}
|
|
@@ -1,12 +1,28 @@
|
|
|
1
1
|
import type { ReactElement, ReactNode } from 'react';
|
|
2
|
-
|
|
2
|
+
interface DropdownMenuEntry {
|
|
3
3
|
readonly id?: string;
|
|
4
4
|
readonly label: ReactNode;
|
|
5
|
-
readonly onSelect: () => void;
|
|
6
5
|
readonly icon?: ReactNode;
|
|
7
6
|
readonly danger?: boolean;
|
|
8
7
|
readonly disabled?: boolean;
|
|
9
8
|
}
|
|
9
|
+
/** A row that does something when chosen. */
|
|
10
|
+
export interface DropdownMenuLeafItem extends DropdownMenuEntry {
|
|
11
|
+
readonly onSelect: () => void;
|
|
12
|
+
readonly items?: undefined;
|
|
13
|
+
}
|
|
14
|
+
/** A row that opens a nested menu. Choosing it does nothing on its own, so it takes no `onSelect`. */
|
|
15
|
+
export interface DropdownMenuSubmenuItem extends DropdownMenuEntry {
|
|
16
|
+
readonly items: readonly DropdownMenuItem[];
|
|
17
|
+
readonly onSelect?: undefined;
|
|
18
|
+
}
|
|
19
|
+
/**
|
|
20
|
+
* A menu row: either a leaf or a submenu, never both.
|
|
21
|
+
*
|
|
22
|
+
* <p>The union is what stops the ambiguous middle case — a row with children AND a handler, where
|
|
23
|
+
* a click means one thing and a hover another. Existing leaf call sites are unaffected.</p>
|
|
24
|
+
*/
|
|
25
|
+
export type DropdownMenuItem = DropdownMenuLeafItem | DropdownMenuSubmenuItem;
|
|
10
26
|
export interface DropdownMenuProps {
|
|
11
27
|
/** The clickable element that opens the menu. */
|
|
12
28
|
readonly trigger: ReactNode;
|
|
@@ -20,4 +36,5 @@ export interface DropdownMenuProps {
|
|
|
20
36
|
* the caller supplies a `trigger` plus a typed `items` list. Token-styled content via CSS modules.
|
|
21
37
|
*/
|
|
22
38
|
export declare const DropdownMenu: ({ trigger, items, header, align, }: DropdownMenuProps) => ReactElement;
|
|
39
|
+
export {};
|
|
23
40
|
//# sourceMappingURL=DropdownMenu.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"DropdownMenu.d.ts","sourceRoot":"","sources":["../../../../../../src/shared/ui/DropdownMenu/DropdownMenu.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,YAAY,EAAE,SAAS,EAAE,MAAM,OAAO,CAAC;
|
|
1
|
+
{"version":3,"file":"DropdownMenu.d.ts","sourceRoot":"","sources":["../../../../../../src/shared/ui/DropdownMenu/DropdownMenu.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,YAAY,EAAE,SAAS,EAAE,MAAM,OAAO,CAAC;AAOrD,UAAU,iBAAiB;IACzB,QAAQ,CAAC,EAAE,CAAC,EAAE,MAAM,CAAC;IACrB,QAAQ,CAAC,KAAK,EAAE,SAAS,CAAC;IAC1B,QAAQ,CAAC,IAAI,CAAC,EAAE,SAAS,CAAC;IAC1B,QAAQ,CAAC,MAAM,CAAC,EAAE,OAAO,CAAC;IAC1B,QAAQ,CAAC,QAAQ,CAAC,EAAE,OAAO,CAAC;CAC7B;AAED,6CAA6C;AAC7C,MAAM,WAAW,oBAAqB,SAAQ,iBAAiB;IAC7D,QAAQ,CAAC,QAAQ,EAAE,MAAM,IAAI,CAAC;IAC9B,QAAQ,CAAC,KAAK,CAAC,EAAE,SAAS,CAAC;CAC5B;AAED,sGAAsG;AACtG,MAAM,WAAW,uBAAwB,SAAQ,iBAAiB;IAChE,QAAQ,CAAC,KAAK,EAAE,SAAS,gBAAgB,EAAE,CAAC;IAC5C,QAAQ,CAAC,QAAQ,CAAC,EAAE,SAAS,CAAC;CAC/B;AAED;;;;;GAKG;AACH,MAAM,MAAM,gBAAgB,GAAG,oBAAoB,GAAG,uBAAuB,CAAC;AAE9E,MAAM,WAAW,iBAAiB;IAChC,iDAAiD;IACjD,QAAQ,CAAC,OAAO,EAAE,SAAS,CAAC;IAC5B,QAAQ,CAAC,KAAK,EAAE,SAAS,gBAAgB,EAAE,CAAC;IAC5C,oFAAoF;IACpF,QAAQ,CAAC,MAAM,CAAC,EAAE,SAAS,CAAC;IAC5B,QAAQ,CAAC,KAAK,CAAC,EAAE,OAAO,GAAG,QAAQ,GAAG,KAAK,CAAC;CAC7C;AA0DD;;;GAGG;AACH,eAAO,MAAM,YAAY,GAAI,oCAK1B,iBAAiB,KAAG,YAmBtB,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"avatar.d.ts","sourceRoot":"","sources":["../../../../../src/shared/utils/avatar.ts"],"names":[],"mappings":"AAAA,oFAAoF;AACpF,eAAO,MAAM,gBAAgB,GAAI,MAAM,MAAM,KAAG,
|
|
1
|
+
{"version":3,"file":"avatar.d.ts","sourceRoot":"","sources":["../../../../../src/shared/utils/avatar.ts"],"names":[],"mappings":"AAAA,oFAAoF;AACpF,eAAO,MAAM,gBAAgB,GAAI,MAAM,MAAM,KAAG,MAY/C,CAAC;AAEF,2DAA2D;AAC3D,eAAO,MAAM,eAAe,GAAI,QAAQ,MAAM,KAAG,MAOhD,CAAC;AAEF,sGAAsG;AACtG,eAAO,MAAM,uBAAuB,GAAI,SAAS,MAAM,KAAG,MAOzD,CAAC"}
|