@livechatta/sdk 0.0.0-stage → 1.0.0
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/CHANGELOG.md +218 -0
- package/LICENSE +21 -0
- package/README.md +2558 -2
- package/bin/chatta.mjs +7 -0
- package/bin/lib/cli.d.mts +46 -0
- package/bin/lib/cli.mjs +2088 -0
- package/dist/cjs/livechatta.cjs.js +7258 -0
- package/dist/cjs/livechatta.cjs.js.map +1 -0
- package/dist/cjs/livechatta.cjs.min.js +2 -0
- package/dist/cjs/livechatta.cjs.min.js.map +1 -0
- package/dist/esm/livechatta.esm.js +7077 -0
- package/dist/esm/livechatta.esm.js.map +1 -0
- package/dist/esm/livechatta.esm.min.js +2 -0
- package/dist/esm/livechatta.esm.min.js.map +1 -0
- package/dist/platforms/android/LiveChattaClient.kt +367 -0
- package/dist/platforms/android/LiveChattaHttpAPI.kt +2630 -0
- package/dist/platforms/android/LiveChattaJson.kt +83 -0
- package/dist/platforms/android/LiveChattaModels.kt +22805 -0
- package/dist/platforms/android/LiveChattaSentFrom.kt +30 -0
- package/dist/platforms/android/LiveChattaSocketAPI.kt +2113 -0
- package/dist/platforms/android/LiveChattaTyped.kt +239 -0
- package/dist/platforms/android/LiveChattaWebView.kt +158 -0
- package/dist/platforms/angular/livechatta-bridge.service.d.ts +35 -0
- package/dist/platforms/angular/livechatta-bridge.service.js +1 -0
- package/dist/platforms/angular/livechatta-bridge.service.js.map +1 -0
- package/dist/platforms/angular/livechatta-embed.component.d.ts +46 -0
- package/dist/platforms/angular/livechatta-embed.component.js +1 -0
- package/dist/platforms/angular/livechatta-embed.component.js.map +1 -0
- package/dist/platforms/angular/livechatta.service.d.ts +66 -0
- package/dist/platforms/angular/livechatta.service.js +1 -0
- package/dist/platforms/angular/livechatta.service.js.map +1 -0
- package/dist/platforms/capacitor/CapacitorBridge.d.ts +27 -0
- package/dist/platforms/capacitor/CapacitorBridge.js +1 -0
- package/dist/platforms/capacitor/CapacitorBridge.js.map +1 -0
- package/dist/platforms/capacitor/CapacitorDeepLinks.d.ts +23 -0
- package/dist/platforms/capacitor/CapacitorDeepLinks.js +1 -0
- package/dist/platforms/capacitor/CapacitorDeepLinks.js.map +1 -0
- package/dist/platforms/capacitor/CapacitorPermissions.d.ts +29 -0
- package/dist/platforms/capacitor/CapacitorPermissions.js +1 -0
- package/dist/platforms/capacitor/CapacitorPermissions.js.map +1 -0
- package/dist/platforms/capacitor/CapacitorPush.d.ts +33 -0
- package/dist/platforms/capacitor/CapacitorPush.js +1 -0
- package/dist/platforms/capacitor/CapacitorPush.js.map +1 -0
- package/dist/platforms/capacitor/index.d.ts +24 -0
- package/dist/platforms/capacitor/index.js +1 -0
- package/dist/platforms/capacitor/index.js.map +1 -0
- package/dist/platforms/flutter/livechatta_client.dart +359 -0
- package/dist/platforms/flutter/livechatta_http_api.dart +1942 -0
- package/dist/platforms/flutter/livechatta_json.dart +57 -0
- package/dist/platforms/flutter/livechatta_models.dart +23531 -0
- package/dist/platforms/flutter/livechatta_sent_from.dart +35 -0
- package/dist/platforms/flutter/livechatta_socket_api.dart +1504 -0
- package/dist/platforms/flutter/livechatta_typed.dart +234 -0
- package/dist/platforms/flutter/livechatta_webview.dart +190 -0
- package/dist/platforms/ios/LiveChattaClient.swift +374 -0
- package/dist/platforms/ios/LiveChattaHttpAPI.swift +2431 -0
- package/dist/platforms/ios/LiveChattaJSON.swift +84 -0
- package/dist/platforms/ios/LiveChattaModels.swift +27050 -0
- package/dist/platforms/ios/LiveChattaSentFrom.swift +32 -0
- package/dist/platforms/ios/LiveChattaSocketAPI.swift +1446 -0
- package/dist/platforms/ios/LiveChattaTyped.swift +268 -0
- package/dist/platforms/ios/LiveChattaWebView.swift +191 -0
- package/dist/platforms/nuxt/LiveChattaView.d.ts +1 -0
- package/dist/platforms/nuxt/LiveChattaView.js +1 -0
- package/dist/platforms/nuxt/LiveChattaView.js.map +1 -0
- package/dist/platforms/nuxt/useChattaBridge.d.ts +9 -0
- package/dist/platforms/nuxt/useChattaBridge.js +1 -0
- package/dist/platforms/nuxt/useChattaBridge.js.map +1 -0
- package/dist/platforms/nuxt/useLiveChatta.d.ts +63 -0
- package/dist/platforms/nuxt/useLiveChatta.js +1 -0
- package/dist/platforms/nuxt/useLiveChatta.js.map +1 -0
- package/dist/platforms/react/LiveChattaView.d.ts +58 -0
- package/dist/platforms/react/LiveChattaView.js +1 -0
- package/dist/platforms/react/LiveChattaView.js.map +1 -0
- package/dist/platforms/react/useChattaBridge.d.ts +1 -0
- package/dist/platforms/react/useChattaBridge.js +1 -0
- package/dist/platforms/react/useChattaBridge.js.map +1 -0
- package/dist/platforms/react/useChattaDeepLink.d.ts +2 -0
- package/dist/platforms/react/useChattaDeepLink.js +1 -0
- package/dist/platforms/react/useChattaDeepLink.js.map +1 -0
- package/dist/platforms/react/useChattaPermissions.d.ts +9 -0
- package/dist/platforms/react/useChattaPermissions.js +1 -0
- package/dist/platforms/react/useChattaPermissions.js.map +1 -0
- package/dist/platforms/react/useChattaUnread.d.ts +1 -0
- package/dist/platforms/react/useChattaUnread.js +1 -0
- package/dist/platforms/react/useChattaUnread.js.map +1 -0
- package/dist/platforms/react/useLiveChatta.d.ts +29 -0
- package/dist/platforms/react/useLiveChatta.js +1 -0
- package/dist/platforms/react/useLiveChatta.js.map +1 -0
- package/dist/platforms/react-native/LiveChattaView.d.ts +52 -0
- package/dist/platforms/react-native/LiveChattaView.js +1 -0
- package/dist/platforms/react-native/LiveChattaView.js.map +1 -0
- package/dist/platforms/react-native/useChattaBridge.d.ts +12 -0
- package/dist/platforms/react-native/useChattaBridge.js +1 -0
- package/dist/platforms/react-native/useChattaBridge.js.map +1 -0
- package/dist/platforms/react-native/useLiveChatta.d.ts +29 -0
- package/dist/platforms/react-native/useLiveChatta.js +1 -0
- package/dist/platforms/react-native/useLiveChatta.js.map +1 -0
- package/dist/platforms/svelte/LiveChattaEmbed.d.ts +54 -0
- package/dist/platforms/svelte/LiveChattaEmbed.js +1 -0
- package/dist/platforms/svelte/LiveChattaEmbed.js.map +1 -0
- package/dist/platforms/svelte/chattaBridgeStore.d.ts +19 -0
- package/dist/platforms/svelte/chattaBridgeStore.js +1 -0
- package/dist/platforms/svelte/chattaBridgeStore.js.map +1 -0
- package/dist/platforms/svelte/useLiveChatta.d.ts +61 -0
- package/dist/platforms/svelte/useLiveChatta.js +1 -0
- package/dist/platforms/svelte/useLiveChatta.js.map +1 -0
- package/dist/platforms/tauri/TauriBridge.d.ts +34 -0
- package/dist/platforms/tauri/TauriBridge.js +1 -0
- package/dist/platforms/tauri/TauriBridge.js.map +1 -0
- package/dist/platforms/tauri/TauriDeepLinks.d.ts +29 -0
- package/dist/platforms/tauri/TauriDeepLinks.js +1 -0
- package/dist/platforms/tauri/TauriDeepLinks.js.map +1 -0
- package/dist/platforms/tauri/TauriPermissions.d.ts +21 -0
- package/dist/platforms/tauri/TauriPermissions.js +1 -0
- package/dist/platforms/tauri/TauriPermissions.js.map +1 -0
- package/dist/platforms/tauri/TauriUpdater.d.ts +31 -0
- package/dist/platforms/tauri/TauriUpdater.js +1 -0
- package/dist/platforms/tauri/TauriUpdater.js.map +1 -0
- package/dist/platforms/tauri/index.d.ts +22 -0
- package/dist/platforms/tauri/index.js +1 -0
- package/dist/platforms/tauri/index.js.map +1 -0
- package/dist/platforms/vue/LiveChattaView.d.ts +1 -0
- package/dist/platforms/vue/LiveChattaView.js +1 -0
- package/dist/platforms/vue/LiveChattaView.js.map +1 -0
- package/dist/platforms/vue/useChattaBridge.d.ts +11 -0
- package/dist/platforms/vue/useChattaBridge.js +1 -0
- package/dist/platforms/vue/useChattaBridge.js.map +1 -0
- package/dist/platforms/vue/useChattaDeepLink.d.ts +2 -0
- package/dist/platforms/vue/useChattaDeepLink.js +1 -0
- package/dist/platforms/vue/useChattaDeepLink.js.map +1 -0
- package/dist/platforms/vue/useChattaPermissions.d.ts +9 -0
- package/dist/platforms/vue/useChattaPermissions.js +1 -0
- package/dist/platforms/vue/useChattaPermissions.js.map +1 -0
- package/dist/platforms/vue/useChattaUnread.d.ts +8 -0
- package/dist/platforms/vue/useChattaUnread.js +1 -0
- package/dist/platforms/vue/useChattaUnread.js.map +1 -0
- package/dist/platforms/vue/useLiveChatta.d.ts +58 -0
- package/dist/platforms/vue/useLiveChatta.js +1 -0
- package/dist/platforms/vue/useLiveChatta.js.map +1 -0
- package/dist/platforms/web/LiveChattaEmbed.d.ts +94 -0
- package/dist/platforms/web/LiveChattaEmbed.js +1 -0
- package/dist/platforms/web/LiveChattaEmbed.js.map +1 -0
- package/dist/platforms/web/bridge.d.ts +8 -0
- package/dist/platforms/web/bridge.js +1 -0
- package/dist/platforms/web/bridge.js.map +1 -0
- package/dist/platforms/web/permissions.d.ts +8 -0
- package/dist/platforms/web/permissions.js +1 -0
- package/dist/platforms/web/permissions.js.map +1 -0
- package/dist/types/billing.d.ts +355 -0
- package/dist/types/billing.js +53 -0
- package/dist/types/billing.js.map +1 -0
- package/dist/types/calendar.d.ts +132 -0
- package/dist/types/calendar.js +15 -0
- package/dist/types/calendar.js.map +1 -0
- package/dist/types/chat-core.d.ts +901 -0
- package/dist/types/chat-core.js +98 -0
- package/dist/types/chat-core.js.map +1 -0
- package/dist/types/chat-features.d.ts +775 -0
- package/dist/types/chat-features.js +50 -0
- package/dist/types/chat-features.js.map +1 -0
- package/dist/types/content.d.ts +138 -0
- package/dist/types/content.js +2 -0
- package/dist/types/content.js.map +1 -0
- package/dist/types/core/AutoRefresh.d.ts +68 -0
- package/dist/types/core/Bridge.d.ts +124 -0
- package/dist/types/core/Config.d.ts +26 -0
- package/dist/types/core/DeepLinks.d.ts +38 -0
- package/dist/types/core/EventBus.d.ts +15 -0
- package/dist/types/core/GrantStore.d.ts +29 -0
- package/dist/types/core/LiveChatta.d.ts +128 -0
- package/dist/types/core/Permissions.d.ts +34 -0
- package/dist/types/core/TokenManager.d.ts +25 -0
- package/dist/types/core/events.d.ts +140 -0
- package/dist/types/csat.d.ts +110 -0
- package/dist/types/csat.js +12 -0
- package/dist/types/csat.js.map +1 -0
- package/dist/types/events.d.ts +242 -0
- package/dist/types/events.js +275 -0
- package/dist/types/events.js.map +1 -0
- package/dist/types/extras.d.ts +353 -0
- package/dist/types/extras.js +31 -0
- package/dist/types/extras.js.map +1 -0
- package/dist/types/http/HttpAPI.d.ts +944 -0
- package/dist/types/http/HttpTransport.d.ts +66 -0
- package/dist/types/http/incomingWebhook.d.ts +17 -0
- package/dist/types/incoming-webhooks.d.ts +78 -0
- package/dist/types/incoming-webhooks.js +16 -0
- package/dist/types/incoming-webhooks.js.map +1 -0
- package/dist/types/index.d.ts +15 -0
- package/dist/types/index.js +16 -0
- package/dist/types/index.js.map +1 -0
- package/dist/types/liveflex.d.ts +578 -0
- package/dist/types/liveflex.js +7 -0
- package/dist/types/liveflex.js.map +1 -0
- package/dist/types/models.d.ts +1753 -0
- package/dist/types/models.js +148 -0
- package/dist/types/models.js.map +1 -0
- package/dist/types/options.d.ts +190 -0
- package/dist/types/options.js +43 -0
- package/dist/types/options.js.map +1 -0
- package/dist/types/shared-channels.d.ts +236 -0
- package/dist/types/shared-channels.js +50 -0
- package/dist/types/shared-channels.js.map +1 -0
- package/dist/types/socket/SocketAPI.d.ts +1026 -0
- package/dist/types/socket/SocketTransport.d.ts +44 -0
- package/dist/types/types/billing.d.ts +355 -0
- package/dist/types/types/calendar.d.ts +132 -0
- package/dist/types/types/chat-core.d.ts +901 -0
- package/dist/types/types/chat-features.d.ts +775 -0
- package/dist/types/types/content.d.ts +138 -0
- package/dist/types/types/csat.d.ts +110 -0
- package/dist/types/types/events.d.ts +242 -0
- package/dist/types/types/extras.d.ts +353 -0
- package/dist/types/types/incoming-webhooks.d.ts +78 -0
- package/dist/types/types/index.d.ts +15 -0
- package/dist/types/types/liveflex.d.ts +578 -0
- package/dist/types/types/models.d.ts +1753 -0
- package/dist/types/types/options.d.ts +190 -0
- package/dist/types/types/shared-channels.d.ts +236 -0
- package/dist/types/types/workspace-gifs.d.ts +95 -0
- package/dist/types/types/workspace.d.ts +390 -0
- package/dist/types/ui/EmbedConfig.d.ts +38 -0
- package/dist/types/ui/EmbedUI.d.ts +44 -0
- package/dist/types/ui/Launcher.d.ts +122 -0
- package/dist/types/ui/brand.d.ts +27 -0
- package/dist/types/ui/embedMessages.d.ts +23 -0
- package/dist/types/ui/hours.d.ts +35 -0
- package/dist/types/ui/prechat.d.ts +35 -0
- package/dist/types/ui/widgetConfig.d.ts +4 -0
- package/dist/types/utils/crypto.d.ts +6 -0
- package/dist/types/utils/hmac.d.ts +40 -0
- package/dist/types/utils/permissions.d.ts +5 -0
- package/dist/types/utils/platform.d.ts +18 -0
- package/dist/types/utils/visitor.d.ts +2 -0
- package/dist/types/workspace-gifs.d.ts +95 -0
- package/dist/types/workspace-gifs.js +3 -0
- package/dist/types/workspace-gifs.js.map +1 -0
- package/dist/types/workspace.d.ts +390 -0
- package/dist/types/workspace.js +13 -0
- package/dist/types/workspace.js.map +1 -0
- package/dist/umd/livechatta.umd.js +7262 -0
- package/dist/umd/livechatta.umd.js.map +1 -0
- package/dist/umd/livechatta.umd.min.js +2 -0
- package/dist/umd/livechatta.umd.min.js.map +1 -0
- package/package.json +278 -4
|
@@ -0,0 +1,901 @@
|
|
|
1
|
+
import type { Message, Member } from './models';
|
|
2
|
+
/** `conversation-read` ack and echo to every device of the reader. */
|
|
3
|
+
export interface ConversationReadState {
|
|
4
|
+
conversationId: string;
|
|
5
|
+
unreadCount: number;
|
|
6
|
+
lastReadAt: string;
|
|
7
|
+
}
|
|
8
|
+
/** Unread per sidebar lane over ALL your conversations in the link (chatta #427); pages hold 40, so don't sum rows. */
|
|
9
|
+
export interface SidebarUnreadTotals {
|
|
10
|
+
total: number;
|
|
11
|
+
active: number;
|
|
12
|
+
archived: number;
|
|
13
|
+
people: number;
|
|
14
|
+
groups: number;
|
|
15
|
+
channels: number;
|
|
16
|
+
saved: number;
|
|
17
|
+
}
|
|
18
|
+
/** `unread-totals` payload: leave out the rows you already count (max 1000 ids, the rest are ignored). */
|
|
19
|
+
export interface UnreadTotalsRequest {
|
|
20
|
+
excludeConversationIds?: string[];
|
|
21
|
+
}
|
|
22
|
+
/** `unread-totals` ack. */
|
|
23
|
+
export interface UnreadTotalsResult {
|
|
24
|
+
unreadTotals: SidebarUnreadTotals;
|
|
25
|
+
}
|
|
26
|
+
/** Max ids the server reads from `UnreadTotalsRequest.excludeConversationIds`. */
|
|
27
|
+
export declare const UNREAD_TOTALS_MAX_EXCLUDE = 1000;
|
|
28
|
+
export type MyLinksStatus = 'ACTIVE' | 'DISABLED' | 'EXPIRED' | 'ARCHIVED';
|
|
29
|
+
export interface MyChatLinksQuery {
|
|
30
|
+
[key: string]: string | undefined;
|
|
31
|
+
/** ≤ 64 chars; matches name, code or caption. */
|
|
32
|
+
search?: string;
|
|
33
|
+
status?: MyLinksStatus;
|
|
34
|
+
nextCursor?: string;
|
|
35
|
+
/** ≤ 20 */
|
|
36
|
+
limit?: string;
|
|
37
|
+
}
|
|
38
|
+
export interface MyChatLinkItem {
|
|
39
|
+
_id: string;
|
|
40
|
+
code: string;
|
|
41
|
+
name: string;
|
|
42
|
+
caption?: string;
|
|
43
|
+
profilePhoto?: string;
|
|
44
|
+
conversationType?: string;
|
|
45
|
+
linkType?: string;
|
|
46
|
+
status: string;
|
|
47
|
+
expiresAt?: string | null;
|
|
48
|
+
primaryColor?: string;
|
|
49
|
+
totalVisitors?: number;
|
|
50
|
+
createdAt?: string;
|
|
51
|
+
/** Live per-link unread sum. */
|
|
52
|
+
unreadCount: number;
|
|
53
|
+
/** Distinct ACTIVE members of the link ("42 members"). */
|
|
54
|
+
memberCount: number;
|
|
55
|
+
/** Your place in the link: business team (owner / admin / agent) or a plain member. */
|
|
56
|
+
role: MyLinkRole;
|
|
57
|
+
/** Your push level for the link ('all' when never changed); set with `setMyLinkNotify`. */
|
|
58
|
+
notifyLevel?: LinkNotifyLevel;
|
|
59
|
+
}
|
|
60
|
+
export declare const LINK_NOTIFY_LEVELS: readonly ["all", "mentions", "off"];
|
|
61
|
+
export type LinkNotifyLevel = (typeof LINK_NOTIFY_LEVELS)[number];
|
|
62
|
+
/** `PUT chat-users/me/links/:linkId/notify`: the stored level ('all' clears the override). */
|
|
63
|
+
export interface LinkNotifyResult {
|
|
64
|
+
chatLinkId: string;
|
|
65
|
+
level: LinkNotifyLevel;
|
|
66
|
+
}
|
|
67
|
+
/** One teammate from `GET chat-users/me/link-members` (first-run picker), online first. */
|
|
68
|
+
export interface LinkMemberSuggestion {
|
|
69
|
+
_id: string;
|
|
70
|
+
displayName: string;
|
|
71
|
+
handle: string;
|
|
72
|
+
photo?: string;
|
|
73
|
+
online: boolean;
|
|
74
|
+
}
|
|
75
|
+
export interface LinkMemberSuggestions {
|
|
76
|
+
results: LinkMemberSuggestion[];
|
|
77
|
+
}
|
|
78
|
+
export declare const MY_LINK_ROLES: readonly ["owner", "admin", "agent", "member"];
|
|
79
|
+
export type MyLinkRole = (typeof MY_LINK_ROLES)[number];
|
|
80
|
+
export interface MyChatLinksPage {
|
|
81
|
+
results: MyChatLinkItem[];
|
|
82
|
+
nextCursor: string | null;
|
|
83
|
+
prevCursor: string | null;
|
|
84
|
+
hasMore: boolean;
|
|
85
|
+
hasPrev: boolean;
|
|
86
|
+
}
|
|
87
|
+
/** One of the last distinct repliers on a thread parent (newest first, max 3). */
|
|
88
|
+
export interface ThreadParticipant {
|
|
89
|
+
userId: string;
|
|
90
|
+
displayName: string;
|
|
91
|
+
handle?: string;
|
|
92
|
+
photo?: string;
|
|
93
|
+
}
|
|
94
|
+
export type MessageDeleteScope = 'me' | 'everyone';
|
|
95
|
+
/** Senders may delete for everyone within this window; admins/moderators any time. */
|
|
96
|
+
export declare const DELETE_FOR_EVERYONE_WINDOW_MS: number;
|
|
97
|
+
export interface DeleteMessagePayload {
|
|
98
|
+
conversationId: string;
|
|
99
|
+
messageId: string;
|
|
100
|
+
scope: MessageDeleteScope;
|
|
101
|
+
}
|
|
102
|
+
/** `message-deleted`: conversation room for `everyone`, your `user:` room for `me`. */
|
|
103
|
+
export interface MessageDeletedEvent {
|
|
104
|
+
conversationId: string;
|
|
105
|
+
messageId: string;
|
|
106
|
+
scope: MessageDeleteScope;
|
|
107
|
+
deletedAt: string;
|
|
108
|
+
deletedBy: string;
|
|
109
|
+
parentMessageId: string | null;
|
|
110
|
+
}
|
|
111
|
+
export type SearchAllScope = 'all' | 'messages' | 'conversations' | 'people';
|
|
112
|
+
export interface SearchAllPayload {
|
|
113
|
+
/** 2–64 chars. */
|
|
114
|
+
q: string;
|
|
115
|
+
scope?: SearchAllScope;
|
|
116
|
+
/** Message page cursor; a cursor request returns messages only. */
|
|
117
|
+
nextCursor?: string;
|
|
118
|
+
}
|
|
119
|
+
export interface SearchAllSender {
|
|
120
|
+
_id: string;
|
|
121
|
+
displayName?: string;
|
|
122
|
+
handle?: string;
|
|
123
|
+
photo?: string;
|
|
124
|
+
}
|
|
125
|
+
export interface SearchAllMessageHit {
|
|
126
|
+
_id: string;
|
|
127
|
+
conversationId: string;
|
|
128
|
+
conversationName: string;
|
|
129
|
+
message: string;
|
|
130
|
+
/** Thread replies: open this parent's thread. */
|
|
131
|
+
parentMessageId: string | null;
|
|
132
|
+
createdAt: string;
|
|
133
|
+
sender: SearchAllSender | null;
|
|
134
|
+
}
|
|
135
|
+
export interface SearchAllConversationHit {
|
|
136
|
+
_id: string;
|
|
137
|
+
name: string;
|
|
138
|
+
type: string;
|
|
139
|
+
profilePhoto?: string;
|
|
140
|
+
}
|
|
141
|
+
export interface SearchAllPersonHit {
|
|
142
|
+
_id: string;
|
|
143
|
+
displayName?: string;
|
|
144
|
+
handle?: string;
|
|
145
|
+
photo?: string;
|
|
146
|
+
isChattingOnline?: boolean;
|
|
147
|
+
}
|
|
148
|
+
/** `search-all` ack (socket). The REST `globalSearch()` keeps its own `GlobalSearchResult`. */
|
|
149
|
+
export interface SearchAllResult {
|
|
150
|
+
q: string;
|
|
151
|
+
messages: {
|
|
152
|
+
results: SearchAllMessageHit[];
|
|
153
|
+
nextCursor: string | null;
|
|
154
|
+
hasMore: boolean;
|
|
155
|
+
};
|
|
156
|
+
/** ≤ 6 */
|
|
157
|
+
conversations: SearchAllConversationHit[];
|
|
158
|
+
/** ≤ 6 */
|
|
159
|
+
people: SearchAllPersonHit[];
|
|
160
|
+
}
|
|
161
|
+
/** Chat routes answer 410 for expired/disabled/archived and 404 for deleted links. */
|
|
162
|
+
export type LinkAccessState = 'ok' | 'expired' | 'disabled' | 'archived' | 'deleted';
|
|
163
|
+
/** Bridge `CHATTA_APP:onLinkUnavailable` posted by the 410 page inside an app iframe. */
|
|
164
|
+
export interface LinkUnavailablePayload {
|
|
165
|
+
state: Exclude<LinkAccessState, 'ok' | 'deleted'>;
|
|
166
|
+
code: string;
|
|
167
|
+
}
|
|
168
|
+
/** A signed-in member's access to the link: 'blocked' after owner → Members → Block; 'invite-only' when not on the list. */
|
|
169
|
+
export type MemberLinkAccess = 'ok' | 'blocked' | 'invite-only';
|
|
170
|
+
/** `code` on the 403 from `POST /in/:code/join-exist` (no token issued) for a blocked member. */
|
|
171
|
+
export declare const LINK_MEMBER_BLOCKED = "LINK_MEMBER_BLOCKED";
|
|
172
|
+
/** Body of that 403: `message` names the link ("An admin of Acme removed your access…"). */
|
|
173
|
+
export interface LinkMemberBlockedError {
|
|
174
|
+
statusCode: 403;
|
|
175
|
+
message: string;
|
|
176
|
+
code: typeof LINK_MEMBER_BLOCKED;
|
|
177
|
+
}
|
|
178
|
+
/** Owner Members list filter (`GET /chats/links/:linkId/member-list?status=`); `invited` = on the invite list, not joined yet. */
|
|
179
|
+
export declare const LINK_MEMBER_FILTERS: readonly ["all", "active", "blocked", "invited"];
|
|
180
|
+
export type LinkMemberFilter = (typeof LINK_MEMBER_FILTERS)[number];
|
|
181
|
+
export interface LinkMemberListQuery {
|
|
182
|
+
/** Name, handle or email. */
|
|
183
|
+
q?: string;
|
|
184
|
+
status?: LinkMemberFilter;
|
|
185
|
+
/** 1 – 100. */
|
|
186
|
+
limit?: number;
|
|
187
|
+
nextCursor?: string;
|
|
188
|
+
}
|
|
189
|
+
/** One row of the owner Members list. */
|
|
190
|
+
export interface LinkMemberRow {
|
|
191
|
+
_id: string;
|
|
192
|
+
name: string;
|
|
193
|
+
email: string;
|
|
194
|
+
photo: string;
|
|
195
|
+
role: string;
|
|
196
|
+
joinedAt: string | null;
|
|
197
|
+
status: 'active' | 'blocked' | 'left' | 'invited';
|
|
198
|
+
}
|
|
199
|
+
export interface LinkMemberPage {
|
|
200
|
+
results: LinkMemberRow[];
|
|
201
|
+
nextCursor: string | null;
|
|
202
|
+
hasMore: boolean;
|
|
203
|
+
total: number;
|
|
204
|
+
}
|
|
205
|
+
/** `DELETE /chats/links/:linkId/members/:memberId/invite`: `blocked` when they had already joined (access ends now). */
|
|
206
|
+
export interface RevokeLinkInviteResult {
|
|
207
|
+
status: true;
|
|
208
|
+
blocked: boolean;
|
|
209
|
+
}
|
|
210
|
+
/** `code` on the 400 from join / join-exist when the link reached its member cap. */
|
|
211
|
+
export declare const LINK_FULL = "LINK_FULL";
|
|
212
|
+
/** Body of that 400: "Acme Support has reached its 50-member limit. Try again later or contact the host." */
|
|
213
|
+
export interface LinkFullError {
|
|
214
|
+
statusCode: 400;
|
|
215
|
+
message: string;
|
|
216
|
+
code: typeof LINK_FULL;
|
|
217
|
+
}
|
|
218
|
+
/** `code` on the 400 from join-new / join-guest when the email already has an account: use join-exist. */
|
|
219
|
+
export declare const ACCOUNT_EXISTS = "ACCOUNT_EXISTS";
|
|
220
|
+
/** Body of that 400: "You already have an account with this email. Sign in to continue." */
|
|
221
|
+
export interface AccountExistsError {
|
|
222
|
+
statusCode: 400;
|
|
223
|
+
message: string;
|
|
224
|
+
code: typeof ACCOUNT_EXISTS;
|
|
225
|
+
}
|
|
226
|
+
/** 400 from join-new: that @handle is already used in this workspace; pick another. */
|
|
227
|
+
export declare const HANDLE_TAKEN = "HANDLE_TAKEN";
|
|
228
|
+
/** `code` on the 429 `chat-error` (and ack `error`) when messages are sent too fast; keep the message as not sent and offer Retry. */
|
|
229
|
+
export declare const RATE_LIMITED = "RATE_LIMITED";
|
|
230
|
+
/** Body of that 429 ("You’re sending too fast. Wait a few seconds, then try again."). */
|
|
231
|
+
export interface SendRateLimitedError {
|
|
232
|
+
statusCode: 429;
|
|
233
|
+
message: string;
|
|
234
|
+
code: typeof RATE_LIMITED;
|
|
235
|
+
}
|
|
236
|
+
/** True when `err` (a `chat-error`, an ack, or a thrown `LiveChattaError`) carries `RATE_LIMITED`. */
|
|
237
|
+
export declare function isRateLimited(err: unknown): boolean;
|
|
238
|
+
/** `code` on the 400 when `edit-message` comes after the edit window (default 24 h from sending). */
|
|
239
|
+
export declare const EDIT_WINDOW_CLOSED = "EDIT_WINDOW_CLOSED";
|
|
240
|
+
/** The default text of that 400; the hours follow the server's window. */
|
|
241
|
+
export declare const EDIT_WINDOW_CLOSED_MESSAGE = "Messages can only be edited within 24 hours of sending.";
|
|
242
|
+
/** True when `err` is the refused-edit error of `editMessage` (reads `code`, then the raw body). */
|
|
243
|
+
export declare function isEditWindowClosed(err: unknown): boolean;
|
|
244
|
+
/** 403 on an `/admin/*` console page the admin role can't open (body adds `area`). */
|
|
245
|
+
export declare const ADMIN_NO_ACCESS = "ADMIN_NO_ACCESS";
|
|
246
|
+
/** `GET /in/:code/online-count` ("Live now · N online"); members who hide their status are not counted. */
|
|
247
|
+
export interface LinkOnlineCount {
|
|
248
|
+
online: number;
|
|
249
|
+
}
|
|
250
|
+
/** Body of `POST /in/:code/join-guest`; email is optional (guests without one get a placeholder). */
|
|
251
|
+
export interface JoinLinkAsGuestPayload {
|
|
252
|
+
/** 2–30 chars. */
|
|
253
|
+
displayName: string;
|
|
254
|
+
/** ≤ 254 chars. Required with `meetingCode`. */
|
|
255
|
+
email?: string;
|
|
256
|
+
/** Scheduled-meeting code from a `/hop/{code}` link: joins as a meeting guest (host admits from the lobby). */
|
|
257
|
+
meetingCode?: string;
|
|
258
|
+
}
|
|
259
|
+
/** join-guest answer for a returning meeting guest: a 6-digit code was emailed; call `verifyMeetingGuest`. */
|
|
260
|
+
export interface MeetingGuestCodeSent {
|
|
261
|
+
verifyRequired: true;
|
|
262
|
+
message: string;
|
|
263
|
+
expiresInSeconds: number;
|
|
264
|
+
resendInSeconds: number;
|
|
265
|
+
}
|
|
266
|
+
/** Session returned by join-new / join-guest: pass `accessToken` to `setMemberToken()`. */
|
|
267
|
+
export interface LinkJoinSession {
|
|
268
|
+
chatUser: Member;
|
|
269
|
+
accessToken: string;
|
|
270
|
+
refreshToken: string;
|
|
271
|
+
expireInSeconds: number;
|
|
272
|
+
chatLink: {
|
|
273
|
+
_id: string;
|
|
274
|
+
code: string;
|
|
275
|
+
name: string;
|
|
276
|
+
[key: string]: unknown;
|
|
277
|
+
};
|
|
278
|
+
}
|
|
279
|
+
/** `POST /in/:code/notify-reopen` (paused link "Notify me when it reopens"). */
|
|
280
|
+
export interface LinkReopenWatchResult {
|
|
281
|
+
ok: true;
|
|
282
|
+
}
|
|
283
|
+
export interface LinkDiscoverableResult {
|
|
284
|
+
linkId: string;
|
|
285
|
+
discoverable: boolean;
|
|
286
|
+
}
|
|
287
|
+
export type PreChatFieldKey = 'name' | 'email' | 'phone' | 'topic';
|
|
288
|
+
export interface PreChatConfig {
|
|
289
|
+
enabled: boolean;
|
|
290
|
+
/** ≤ 280 chars. */
|
|
291
|
+
intro: string;
|
|
292
|
+
fields: {
|
|
293
|
+
key: PreChatFieldKey;
|
|
294
|
+
required: boolean;
|
|
295
|
+
}[];
|
|
296
|
+
}
|
|
297
|
+
/** `day` 0 = Sunday … 6 = Saturday in `timezone`; close <= open crosses midnight. */
|
|
298
|
+
export interface BusinessHoursDay {
|
|
299
|
+
day: number;
|
|
300
|
+
/** HH:mm */
|
|
301
|
+
open: string;
|
|
302
|
+
close: string;
|
|
303
|
+
}
|
|
304
|
+
export interface BusinessHoursConfig {
|
|
305
|
+
enabled: boolean;
|
|
306
|
+
/** IANA zone, e.g. Africa/Lagos. */
|
|
307
|
+
timezone: string;
|
|
308
|
+
awayMessage: string;
|
|
309
|
+
week: BusinessHoursDay[];
|
|
310
|
+
}
|
|
311
|
+
/** Server-side link widget config (`PUT chats/links/:id/widget`, normalised on save). */
|
|
312
|
+
export interface WidgetConfig {
|
|
313
|
+
preChat: PreChatConfig;
|
|
314
|
+
businessHours: BusinessHoursConfig;
|
|
315
|
+
}
|
|
316
|
+
/** GET /in/:linkCode/availability (public). */
|
|
317
|
+
export interface LinkAvailability {
|
|
318
|
+
enabled: boolean;
|
|
319
|
+
open: boolean;
|
|
320
|
+
timezone: string;
|
|
321
|
+
nextOpenLabel: string | null;
|
|
322
|
+
awayMessage: string;
|
|
323
|
+
}
|
|
324
|
+
export interface SubmitPreChatPayload {
|
|
325
|
+
conversationId: string;
|
|
326
|
+
name?: string;
|
|
327
|
+
email?: string;
|
|
328
|
+
phone?: string;
|
|
329
|
+
/** Must be one of the link's topic labels when topics exist. */
|
|
330
|
+
topic?: string;
|
|
331
|
+
}
|
|
332
|
+
export interface PreChatSubmission {
|
|
333
|
+
name?: string;
|
|
334
|
+
email?: string;
|
|
335
|
+
phone?: string;
|
|
336
|
+
topic?: string;
|
|
337
|
+
submittedBy: string;
|
|
338
|
+
submittedAt: string;
|
|
339
|
+
}
|
|
340
|
+
/** `submit-pre-chat` ack and `pre-chat-submitted` (conversation room + owner room). */
|
|
341
|
+
export interface PreChatSubmittedEvent extends PreChatSubmission {
|
|
342
|
+
conversationId: string;
|
|
343
|
+
ownerId: string;
|
|
344
|
+
}
|
|
345
|
+
export interface MessageGift {
|
|
346
|
+
kind: 'plan' | 'feature';
|
|
347
|
+
label: string;
|
|
348
|
+
}
|
|
349
|
+
/** The returned message carries the server-written `gift`. */
|
|
350
|
+
export type GiftAnnounceResult = Message & {
|
|
351
|
+
gift: MessageGift;
|
|
352
|
+
};
|
|
353
|
+
export interface HopPollSummary {
|
|
354
|
+
pollId: string;
|
|
355
|
+
sessionId: string;
|
|
356
|
+
question: string;
|
|
357
|
+
options: {
|
|
358
|
+
id: string;
|
|
359
|
+
text: string;
|
|
360
|
+
count: number;
|
|
361
|
+
}[];
|
|
362
|
+
total: number;
|
|
363
|
+
closed: boolean;
|
|
364
|
+
launchedBy: string;
|
|
365
|
+
launchedByName: string;
|
|
366
|
+
launchedAt: string;
|
|
367
|
+
myVote?: string;
|
|
368
|
+
}
|
|
369
|
+
/** `hop-poll-vote-updated` room broadcast (after a vote and after a close); never carries `myVote`. */
|
|
370
|
+
export interface HopPollVoteUpdatedEvent extends HopPollSummary {
|
|
371
|
+
/** @deprecated Older payload field; the backend no longer sends it. */
|
|
372
|
+
option?: string;
|
|
373
|
+
/** @deprecated Older payload field; the backend no longer sends it. */
|
|
374
|
+
votedBy?: string;
|
|
375
|
+
}
|
|
376
|
+
export interface HopCaptionsSwitch {
|
|
377
|
+
enabled: boolean;
|
|
378
|
+
byUserId?: string;
|
|
379
|
+
byName?: string;
|
|
380
|
+
at?: string;
|
|
381
|
+
}
|
|
382
|
+
/** `hop-collab-state` ack for a (re)joining participant. */
|
|
383
|
+
export interface HopCollabSnapshot {
|
|
384
|
+
ok: boolean;
|
|
385
|
+
sessionId: string;
|
|
386
|
+
polls: HopPollSummary[];
|
|
387
|
+
hands: {
|
|
388
|
+
userId: string;
|
|
389
|
+
displayName: string;
|
|
390
|
+
raisedAt: string;
|
|
391
|
+
}[];
|
|
392
|
+
captions: HopCaptionsSwitch;
|
|
393
|
+
recording: {
|
|
394
|
+
active: boolean;
|
|
395
|
+
starterId?: string;
|
|
396
|
+
startedAt?: string;
|
|
397
|
+
};
|
|
398
|
+
}
|
|
399
|
+
/** `hop-captions-state` broadcast. */
|
|
400
|
+
export interface HopCaptionsStateEvent extends HopCaptionsSwitch {
|
|
401
|
+
sessionId: string;
|
|
402
|
+
}
|
|
403
|
+
export interface HopCaptionPayload {
|
|
404
|
+
sessionId: string;
|
|
405
|
+
text: string;
|
|
406
|
+
final?: boolean;
|
|
407
|
+
lang?: string;
|
|
408
|
+
}
|
|
409
|
+
/** `hop-caption-text`, relayed to everyone else in the call. */
|
|
410
|
+
export interface HopCaptionTextEvent {
|
|
411
|
+
sessionId: string;
|
|
412
|
+
userId: string;
|
|
413
|
+
displayName: string;
|
|
414
|
+
text: string;
|
|
415
|
+
final: boolean;
|
|
416
|
+
lang: string;
|
|
417
|
+
/** Epoch ms. */
|
|
418
|
+
ts: number;
|
|
419
|
+
}
|
|
420
|
+
export interface HopRecordingListPayload {
|
|
421
|
+
conversationId: string;
|
|
422
|
+
nextCursor?: string;
|
|
423
|
+
/** ≤ 20 */
|
|
424
|
+
limit?: number;
|
|
425
|
+
}
|
|
426
|
+
export interface HopRecordingListItem {
|
|
427
|
+
messageId: string;
|
|
428
|
+
manifestUrl: string;
|
|
429
|
+
durationSec: number;
|
|
430
|
+
mode: string;
|
|
431
|
+
startedAt: string;
|
|
432
|
+
starterName: string;
|
|
433
|
+
participantCount: number;
|
|
434
|
+
createdAt: string;
|
|
435
|
+
/** The link's "Download call recordings" switch is on: `getRecordingDownloadLink` works. Absent on older servers. */
|
|
436
|
+
downloadable?: boolean;
|
|
437
|
+
}
|
|
438
|
+
export interface HopRecordingListResult {
|
|
439
|
+
ok: boolean;
|
|
440
|
+
results: HopRecordingListItem[];
|
|
441
|
+
nextCursor: string | null;
|
|
442
|
+
hasMore: boolean;
|
|
443
|
+
}
|
|
444
|
+
/** `POST /hops/recordings/:messageId/download` (member token): a signed link valid for 10 minutes. */
|
|
445
|
+
export interface RecordingDownloadLink {
|
|
446
|
+
/** Server-relative (`/api/v1/hops/recordings/download/<token>`); open it on the server origin, no auth header. */
|
|
447
|
+
url: string;
|
|
448
|
+
expiresAt: string;
|
|
449
|
+
/** e.g. `call-recording-2026-11-27.mp4`. */
|
|
450
|
+
filename: string;
|
|
451
|
+
}
|
|
452
|
+
/** 403 when the link's "Download call recordings" switch is off (asking for the link or opening it). */
|
|
453
|
+
export declare const RECORDING_DOWNLOAD_OFF = "RECORDING_DOWNLOAD_OFF";
|
|
454
|
+
/** 403 when the signed download link has expired: ask for a new one. */
|
|
455
|
+
export declare const RECORDING_DOWNLOAD_EXPIRED = "RECORDING_DOWNLOAD_EXPIRED";
|
|
456
|
+
/** `hop-pin-for-all` (host / co-host only); no `userId` clears the pin. */
|
|
457
|
+
export interface HopPinForAllPayload {
|
|
458
|
+
sessionId: string;
|
|
459
|
+
userId?: string;
|
|
460
|
+
}
|
|
461
|
+
/** Ack of `hop-pin-for-all`; a non-host gets a 403 `chat-error`. */
|
|
462
|
+
export interface HopPinForAllResult {
|
|
463
|
+
pinned: string | null;
|
|
464
|
+
}
|
|
465
|
+
/** Ack error on `hop-reaction`, `hop-vote`, `hop-raise-hand` and `hop-poll-vote` over the cap (chatta #409); nothing is broadcast. */
|
|
466
|
+
export declare const HOP_RATE_LIMITED = "RATE_LIMITED";
|
|
467
|
+
/** Window and per-user caps per session, as the server enforces them. */
|
|
468
|
+
export declare const HOP_RATE_WINDOW_SECONDS = 10;
|
|
469
|
+
export declare const HOP_RATE_LIMITS: {
|
|
470
|
+
readonly reaction: 20;
|
|
471
|
+
readonly vote: 20;
|
|
472
|
+
readonly hand: 6;
|
|
473
|
+
readonly pollVote: 10;
|
|
474
|
+
};
|
|
475
|
+
/** Ack of the four rate-limited Hop relays. */
|
|
476
|
+
export type HopRelayAck = {
|
|
477
|
+
ok: true;
|
|
478
|
+
} | {
|
|
479
|
+
ok: false;
|
|
480
|
+
error: typeof HOP_RATE_LIMITED | string;
|
|
481
|
+
};
|
|
482
|
+
/** `POST /hops/:sessionId/invite`: rings each valid id (≤ 50) over the socket and by incoming-call push. */
|
|
483
|
+
export interface HopInviteResult {
|
|
484
|
+
ok: true;
|
|
485
|
+
/** Valid ids that were rung. */
|
|
486
|
+
invited: number;
|
|
487
|
+
}
|
|
488
|
+
/** `hop-unmute-requested` (to you): a host asked you to unmute; your mic stays off until you turn it on. */
|
|
489
|
+
export interface HopUnmuteRequestedEvent {
|
|
490
|
+
sessionId: string;
|
|
491
|
+
/** Host who asked. */
|
|
492
|
+
by: string;
|
|
493
|
+
}
|
|
494
|
+
/** `hop-invite-answered` (to your other devices): you joined this call elsewhere, stop ringing. */
|
|
495
|
+
export interface HopInviteAnsweredEvent {
|
|
496
|
+
sessionId: string;
|
|
497
|
+
conversationId: string;
|
|
498
|
+
}
|
|
499
|
+
/** `hop-pinned-for-all` room broadcast: pin `userId`'s tile (null = unpin). */
|
|
500
|
+
export interface HopPinnedForAllEvent {
|
|
501
|
+
sessionId: string;
|
|
502
|
+
userId: string | null;
|
|
503
|
+
/** Host who pinned. */
|
|
504
|
+
by: string;
|
|
505
|
+
}
|
|
506
|
+
/** `POST /hops/:sessionId/decline`; the room still gets `hop-invite-declined`. */
|
|
507
|
+
export interface HopDeclineResult {
|
|
508
|
+
ok: true;
|
|
509
|
+
sessionId: string;
|
|
510
|
+
}
|
|
511
|
+
/** iOS notification category and Android channel the app shell registers for calls. */
|
|
512
|
+
export declare const INCOMING_CALL_CATEGORY = "INCOMING_CALL";
|
|
513
|
+
export declare const INCOMING_CALL_ANDROID_CHANNEL = "livechatta_calls";
|
|
514
|
+
/** The phone stops ringing after this (push TTL and the 30 s ring overlay). */
|
|
515
|
+
export declare const INCOMING_CALL_RING_SECONDS = 30;
|
|
516
|
+
export declare const INCOMING_CALL_ACTIONS: readonly ["ANSWER", "DECLINE"];
|
|
517
|
+
export type IncomingCallAction = (typeof INCOMING_CALL_ACTIONS)[number];
|
|
518
|
+
/** FCM `data` of an incoming-call push. Every value is a string (FCM rule). */
|
|
519
|
+
export interface IncomingCallPushData {
|
|
520
|
+
/** Kept for older shells. */
|
|
521
|
+
type: 'HOP_INVITE';
|
|
522
|
+
category: typeof INCOMING_CALL_CATEGORY;
|
|
523
|
+
/** Same as `sessionId`. */
|
|
524
|
+
callId: string;
|
|
525
|
+
sessionId: string;
|
|
526
|
+
/** '' when unknown. */
|
|
527
|
+
conversationId: string;
|
|
528
|
+
invitedByName: string;
|
|
529
|
+
/** Numeric string, e.g. '2'. */
|
|
530
|
+
participantCount: string;
|
|
531
|
+
/** Link to open before joining ('' when unknown). */
|
|
532
|
+
linkCode: string;
|
|
533
|
+
/** 'audio' | 'video' (chatta #426). */
|
|
534
|
+
media?: string;
|
|
535
|
+
/** Single-use token for `pushDeclineCall` from the native call screen (calls of up to 50 people). */
|
|
536
|
+
declineToken?: string;
|
|
537
|
+
/** Absolute URL of `POST /api/v1/hops/push-decline`. */
|
|
538
|
+
declineUrl?: string;
|
|
539
|
+
}
|
|
540
|
+
/** Public route the native call screen posts `declineToken` to (no session). */
|
|
541
|
+
export declare const HOP_PUSH_DECLINE_PATH = "/api/v1/hops/push-decline";
|
|
542
|
+
/** A decline token outlives the 30 s ring a little. */
|
|
543
|
+
export declare const CALL_DECLINE_TTL_SECONDS = 120;
|
|
544
|
+
/** `POST hops/push-decline`: 401 unknown / used / expired token, 403 when the call already ended. */
|
|
545
|
+
export interface PushDeclineResult {
|
|
546
|
+
ok: true;
|
|
547
|
+
sessionId: string;
|
|
548
|
+
}
|
|
549
|
+
export declare const CALL_CANCEL_PUSH_TYPE = "HOP_INVITE_CANCEL";
|
|
550
|
+
export declare const CALL_CANCEL_REASONS: readonly ["answered", "declined", "ended"];
|
|
551
|
+
export type CallCancelReason = (typeof CALL_CANCEL_REASONS)[number];
|
|
552
|
+
/** Push that stops a native ring: answered / declined on another device, or the caller stopped. */
|
|
553
|
+
export interface CallCancelPushData {
|
|
554
|
+
type: typeof CALL_CANCEL_PUSH_TYPE;
|
|
555
|
+
callId: string;
|
|
556
|
+
sessionId: string;
|
|
557
|
+
reason: CallCancelReason;
|
|
558
|
+
}
|
|
559
|
+
/** Either call push, by `type`; null for anything else. */
|
|
560
|
+
export declare function parseCallPush(data: {
|
|
561
|
+
[key: string]: unknown;
|
|
562
|
+
} | null | undefined): IncomingCallPushData | CallCancelPushData | null;
|
|
563
|
+
/** Body of `POST notifications/register-device`; send at least one token. */
|
|
564
|
+
export interface RegisterDevicePayload {
|
|
565
|
+
/** FCM token (Android / iOS). */
|
|
566
|
+
deviceToken?: string;
|
|
567
|
+
/** Web push token, at most 4096 characters. A browser belongs to one person: registering it removes it from anyone else; a person keeps up to 5 (the oldest drops). */
|
|
568
|
+
webToken?: string;
|
|
569
|
+
/** iOS PushKit VoIP token (hex, 64–200 chars): calls then ring through CallKit, even with the app closed. */
|
|
570
|
+
voipToken?: string;
|
|
571
|
+
/** e.g. 'mobile-android', 'mobile-ios' (default 'web'). */
|
|
572
|
+
platform?: string;
|
|
573
|
+
/** Android: the app draws chat pushes itself with an inline Reply (data-only pushes). */
|
|
574
|
+
inlineReply?: boolean;
|
|
575
|
+
}
|
|
576
|
+
/** `POST chats/messages/:id/send-now`: due now, delivered by the minute cron (≤ 1 min). */
|
|
577
|
+
export interface ScheduledSendNowResult {
|
|
578
|
+
_id: string;
|
|
579
|
+
scheduledAt: string;
|
|
580
|
+
queued: true;
|
|
581
|
+
}
|
|
582
|
+
/** `POST /health/subscribe`: one email per incident open / status change. */
|
|
583
|
+
export interface StatusSubscribeResult {
|
|
584
|
+
subscribed: true;
|
|
585
|
+
}
|
|
586
|
+
/** `GET /health/unsubscribe?email&token` (token comes from the email link). */
|
|
587
|
+
export interface StatusUnsubscribeResult {
|
|
588
|
+
unsubscribed: boolean;
|
|
589
|
+
}
|
|
590
|
+
/** `event` of the test delivery; same envelope `{ event, timestamp, data }` as real ones. */
|
|
591
|
+
export declare const WEBHOOK_TEST_EVENT = "webhook.test";
|
|
592
|
+
/** `POST chats/webhooks/:id/test`: one immediate delivery, never retried. */
|
|
593
|
+
export interface WebhookTestResult {
|
|
594
|
+
ok: boolean;
|
|
595
|
+
/** Your endpoint's HTTP status, or null on a network error. */
|
|
596
|
+
status: number | null;
|
|
597
|
+
durationMs: number;
|
|
598
|
+
/** 'HTTP 500', a network message, or null on success. */
|
|
599
|
+
error: string | null;
|
|
600
|
+
}
|
|
601
|
+
/** A row of `GET chats/webhooks/:id/deliveries`: delivered attempts plus open retries, newest first. */
|
|
602
|
+
export interface WebhookDeliveryRow {
|
|
603
|
+
/** Retry-queue id (pass to `retryWebhookDelivery`); null for a delivered attempt. */
|
|
604
|
+
id: string | null;
|
|
605
|
+
event: string;
|
|
606
|
+
/** "200", "502", "timeout". */
|
|
607
|
+
code: string;
|
|
608
|
+
at: string;
|
|
609
|
+
/** "1" or "3 / 10". */
|
|
610
|
+
attempt: string;
|
|
611
|
+
ok: boolean;
|
|
612
|
+
canRetry: boolean;
|
|
613
|
+
}
|
|
614
|
+
/** `POST …/deliveries/:deliveryId/retry`: picked up by the next retry run (≤ 30 s). */
|
|
615
|
+
export interface WebhookRetryResult {
|
|
616
|
+
queued: true;
|
|
617
|
+
}
|
|
618
|
+
/** One delivery kept while you listen (`GET chats/webhooks/:id/capture`): the exact body and signature sent, never the secret. */
|
|
619
|
+
export interface WebhookCaptureEntry {
|
|
620
|
+
seq: number;
|
|
621
|
+
at: string;
|
|
622
|
+
event: string;
|
|
623
|
+
attempt: number;
|
|
624
|
+
/** The `X-Webhook-Signature` header sent with it ('' when the webhook has no secret). */
|
|
625
|
+
signature: string;
|
|
626
|
+
/** The JSON text that was POSTed; '' when it was over 256 KB (`truncated`). */
|
|
627
|
+
body: string;
|
|
628
|
+
truncated: boolean;
|
|
629
|
+
}
|
|
630
|
+
/** What the capture endpoints return: the tap lasts 30 minutes, the last 50 deliveries are kept. */
|
|
631
|
+
export interface WebhookCaptureView {
|
|
632
|
+
active: boolean;
|
|
633
|
+
expiresAt: string | null;
|
|
634
|
+
/** The server's clock when this was read; entries are aged against it, not against the caller's clock. */
|
|
635
|
+
serverTime?: string;
|
|
636
|
+
results: WebhookCaptureEntry[];
|
|
637
|
+
/** Pass as `after` on the next read. */
|
|
638
|
+
lastSeq: number;
|
|
639
|
+
}
|
|
640
|
+
/** `DELETE chats/webhooks/:id/capture`. */
|
|
641
|
+
export interface WebhookCaptureStopped {
|
|
642
|
+
stopped: true;
|
|
643
|
+
}
|
|
644
|
+
/** `POST chats/webhooks/:id/rotate-secret`: the new `whsec_…` secret (shown once) and its masked hint. */
|
|
645
|
+
export interface WebhookSecretRotation {
|
|
646
|
+
secret: string;
|
|
647
|
+
hint: string;
|
|
648
|
+
}
|
|
649
|
+
export type WebinarPublicState = 'scheduled' | 'live' | 'ended' | 'cancelled';
|
|
650
|
+
/** `GET chats/conversations/:id/webinar/info` (public): counts only, no registrant data. */
|
|
651
|
+
export interface WebinarPublicInfo {
|
|
652
|
+
title: string | null;
|
|
653
|
+
description: string | null;
|
|
654
|
+
startAt: string | null;
|
|
655
|
+
endAt: string | null;
|
|
656
|
+
durationMinutes: number | null;
|
|
657
|
+
timezone: string | null;
|
|
658
|
+
state: WebinarPublicState;
|
|
659
|
+
registeredCount: number;
|
|
660
|
+
maxAttendees: number;
|
|
661
|
+
isFull: boolean;
|
|
662
|
+
hostName: string | null;
|
|
663
|
+
linkName: string | null;
|
|
664
|
+
/** `/hop/:code` while live, else null. */
|
|
665
|
+
joinPath: string | null;
|
|
666
|
+
/** Ended with a saved recording: offer "Watch recording" (`requestWebinarRecordingLink`). */
|
|
667
|
+
hasRecording?: boolean;
|
|
668
|
+
}
|
|
669
|
+
/** Body of the public `POST chats/conversations/:id/webinar/register`. */
|
|
670
|
+
export interface RegisterWebinarPayload {
|
|
671
|
+
name: string;
|
|
672
|
+
email: string;
|
|
673
|
+
/** ≤ 500 chars. */
|
|
674
|
+
notes?: string;
|
|
675
|
+
/** ≤ 120 chars. */
|
|
676
|
+
company?: string;
|
|
677
|
+
/** "Send me the recording". */
|
|
678
|
+
wantsRecording?: boolean;
|
|
679
|
+
/** Join the waitlist instead of a 400 when the webinar is full. */
|
|
680
|
+
waitlist?: boolean;
|
|
681
|
+
}
|
|
682
|
+
export type WebinarRegisterResult = {
|
|
683
|
+
registered: true;
|
|
684
|
+
name: string;
|
|
685
|
+
email: string;
|
|
686
|
+
} | {
|
|
687
|
+
alreadyRegistered: true;
|
|
688
|
+
waitlisted?: boolean;
|
|
689
|
+
email: string;
|
|
690
|
+
} | {
|
|
691
|
+
waitlisted: true;
|
|
692
|
+
email: string;
|
|
693
|
+
};
|
|
694
|
+
export declare const LINK_MODES: readonly ["standard", "support", "creator", "school", "community", "tech", "public", "private", "webinar"];
|
|
695
|
+
/** Space preset chosen when a link is made; links without one keep the pre-modes behaviour. */
|
|
696
|
+
export type LinkMode = (typeof LINK_MODES)[number];
|
|
697
|
+
export declare const CONVERSATION_MODES: readonly ["standard", "broadcast", "announcement", "qa", "voice", "support"];
|
|
698
|
+
/** Who posts inside a group or channel; broadcast lets members reply in threads only. */
|
|
699
|
+
export type ConversationMode = (typeof CONVERSATION_MODES)[number];
|
|
700
|
+
export declare const CONVERSATION_CATEGORY_MAX = 40;
|
|
701
|
+
/** How people may enter a link (enforced on join-guest / join-new / join-exist). */
|
|
702
|
+
export interface JoinPolicy {
|
|
703
|
+
guests: boolean;
|
|
704
|
+
emailRequired: boolean;
|
|
705
|
+
signInRequired: boolean;
|
|
706
|
+
inviteOnly: boolean;
|
|
707
|
+
/** Ask to join: people without an invite request access and staff approve (chatta #380; absent on older servers). */
|
|
708
|
+
approval?: boolean;
|
|
709
|
+
}
|
|
710
|
+
/** Body of `PATCH chats/links/:linkId/join-policy`: any subset, stored on top of the mode preset. */
|
|
711
|
+
export interface SetJoinPolicyPayload {
|
|
712
|
+
guests?: boolean;
|
|
713
|
+
emailRequired?: boolean;
|
|
714
|
+
signInRequired?: boolean;
|
|
715
|
+
/** On an invite-only (private) link, turns on Ask to join. */
|
|
716
|
+
approval?: boolean;
|
|
717
|
+
}
|
|
718
|
+
/** New link step 2 switches (`modeOptions` on `POST chats/links`); keys for another mode are ignored. */
|
|
719
|
+
export interface LinkModeOptions {
|
|
720
|
+
/** support: name + email before chatting. */
|
|
721
|
+
preChatEmail?: boolean;
|
|
722
|
+
/** support: agent inbox (assign, resolve, SLA). */
|
|
723
|
+
agentInbox?: boolean;
|
|
724
|
+
/** support: join-card topics (support groups), ≤ 8, each ≤ 40 chars. */
|
|
725
|
+
topics?: string[];
|
|
726
|
+
/** creator: followers reply in threads under Announcements (off = read-only). */
|
|
727
|
+
threadReplies?: boolean;
|
|
728
|
+
/** creator: 30 s slow mode in Community. */
|
|
729
|
+
communitySlowMode?: boolean;
|
|
730
|
+
/** school: sign-in required (off lets guests in). */
|
|
731
|
+
signInRequired?: boolean;
|
|
732
|
+
/** community: members can make channels (off sets `settings.staffOnlyCreate`). */
|
|
733
|
+
membersCanCreate?: boolean;
|
|
734
|
+
/** private: Ask to join (approval queue). */
|
|
735
|
+
joinApproval?: boolean;
|
|
736
|
+
/** webinar: registration asks for email. */
|
|
737
|
+
registrationEmail?: boolean;
|
|
738
|
+
}
|
|
739
|
+
/** Who a conversation is for; `followers` = a creator's followers-only room, kept in step with follow / unfollow. */
|
|
740
|
+
export type ConversationAudience = 'everyone' | 'followers';
|
|
741
|
+
/** Message when a member starts a group or channel on a staff-only link (mode preset or `settings.staffOnlyCreate`). */
|
|
742
|
+
export declare const STAFF_ONLY_CREATE_MESSAGE = "Only the team can start groups and channels here.";
|
|
743
|
+
/** Body of `PATCH chats/links/:linkId/mode`. */
|
|
744
|
+
export interface SetLinkModePayload {
|
|
745
|
+
mode: LinkMode;
|
|
746
|
+
/** Also create the mode's missing default conversations (matched by name). */
|
|
747
|
+
applyDefaults?: boolean;
|
|
748
|
+
}
|
|
749
|
+
/** `PATCH chats/links/:linkId/mode`, and `modeResult` on a link created with `mode`. */
|
|
750
|
+
export interface LinkModeChangeResult {
|
|
751
|
+
linkId: string;
|
|
752
|
+
mode: LinkMode;
|
|
753
|
+
linkType: 'STANDARD' | 'ANONYMOUS';
|
|
754
|
+
joinPolicy: JoinPolicy;
|
|
755
|
+
/** Names of the default conversations created by this call. */
|
|
756
|
+
created: string[];
|
|
757
|
+
}
|
|
758
|
+
/** `modeResult` on a link created with `mode` (owner and API-key routes). */
|
|
759
|
+
export interface LinkModeCreateResult extends LinkModeChangeResult {
|
|
760
|
+
/** false when the preset failed: the link is live, retry with `setLinkMode`. */
|
|
761
|
+
applied: boolean;
|
|
762
|
+
/** Set when `applied` is false. */
|
|
763
|
+
warning?: string;
|
|
764
|
+
}
|
|
765
|
+
/** Public `GET /in/:code`: the link card plus its mode and join rules. */
|
|
766
|
+
export interface PublicLinkInfo {
|
|
767
|
+
_id: string;
|
|
768
|
+
code: string;
|
|
769
|
+
name: string;
|
|
770
|
+
caption?: string;
|
|
771
|
+
status?: string;
|
|
772
|
+
/** Absent on links made before modes. */
|
|
773
|
+
mode?: LinkMode;
|
|
774
|
+
joinPolicy: JoinPolicy;
|
|
775
|
+
hideRunsOn?: boolean;
|
|
776
|
+
/** Join card and chat UI settings only (chatta #385 allowlist). */
|
|
777
|
+
settings?: PublicLinkSettings;
|
|
778
|
+
[key: string]: unknown;
|
|
779
|
+
}
|
|
780
|
+
/**
|
|
781
|
+
* What a visitor may read of a link's settings (chatta #385). Dropped from the public card: `embedDomains`,
|
|
782
|
+
* `autoJoinConversationIds`, `discoverable`, `autoTranscribe`, `staffOnlyCreate` and topic `assigneeId` / `teamId`. */
|
|
783
|
+
export interface PublicLinkSettings {
|
|
784
|
+
joinPolicy?: JoinPolicy;
|
|
785
|
+
agentInbox?: boolean;
|
|
786
|
+
preChat?: {
|
|
787
|
+
enabled?: boolean;
|
|
788
|
+
intro?: string;
|
|
789
|
+
fields?: Array<{
|
|
790
|
+
key: string;
|
|
791
|
+
required: boolean;
|
|
792
|
+
}>;
|
|
793
|
+
};
|
|
794
|
+
businessHours?: {
|
|
795
|
+
[key: string]: unknown;
|
|
796
|
+
};
|
|
797
|
+
/** Join-card topics, `{ id, label }` only. */
|
|
798
|
+
topics?: Array<{
|
|
799
|
+
id: string;
|
|
800
|
+
label: string;
|
|
801
|
+
}>;
|
|
802
|
+
slaTargetMinutes?: number | null;
|
|
803
|
+
defaultLayout?: 'bubbles' | 'lines';
|
|
804
|
+
allowAttachments?: boolean;
|
|
805
|
+
allowVoiceMessages?: boolean;
|
|
806
|
+
allowVideoMessages?: boolean;
|
|
807
|
+
allowMemberInvite?: boolean;
|
|
808
|
+
maxMembers?: number;
|
|
809
|
+
welcomeMessage?: string;
|
|
810
|
+
/** Members may download call recordings as MP4 (off unless true). */
|
|
811
|
+
allowRecordingDownload?: boolean;
|
|
812
|
+
}
|
|
813
|
+
/** One public channel on the join card (`GET /in/:code/channels`). */
|
|
814
|
+
export interface LinkChannelPreviewItem {
|
|
815
|
+
name: string;
|
|
816
|
+
type: 'CHANNEL' | 'GROUP';
|
|
817
|
+
mode: ConversationMode;
|
|
818
|
+
category: string | null;
|
|
819
|
+
members: number;
|
|
820
|
+
/** A voice room with a huddle running now. */
|
|
821
|
+
live: boolean;
|
|
822
|
+
/** Messages posted here since midnight (server time). */
|
|
823
|
+
messagesToday: number;
|
|
824
|
+
}
|
|
825
|
+
/** Public `GET /in/:code/channels`: ≤ 12 non-private channels grouped by category; 60 s cache. */
|
|
826
|
+
export interface LinkChannelPreview {
|
|
827
|
+
members: number;
|
|
828
|
+
online: number;
|
|
829
|
+
/** Sum of `messagesToday` over the listed channels. */
|
|
830
|
+
messagesToday: number;
|
|
831
|
+
channels: LinkChannelPreviewItem[];
|
|
832
|
+
}
|
|
833
|
+
export declare const JOIN_REQUEST_STATUSES: readonly ["pending", "approved", "denied"];
|
|
834
|
+
export type JoinRequestStatus = (typeof JOIN_REQUEST_STATUSES)[number];
|
|
835
|
+
/** Body of the public `POST /in/:code/join-request` (5 per minute). */
|
|
836
|
+
export interface JoinRequestPayload {
|
|
837
|
+
/** 2–60 chars. */
|
|
838
|
+
name: string;
|
|
839
|
+
email: string;
|
|
840
|
+
/** ≤ 300 chars. */
|
|
841
|
+
message?: string;
|
|
842
|
+
}
|
|
843
|
+
/** `member`: that email already has an account here, so sign in. `approved`: join as new with it. */
|
|
844
|
+
export interface JoinRequestPublicResult {
|
|
845
|
+
status: JoinRequestStatus | 'member';
|
|
846
|
+
}
|
|
847
|
+
/** One row of the staff review list. */
|
|
848
|
+
export interface JoinRequestView {
|
|
849
|
+
_id: string;
|
|
850
|
+
name: string;
|
|
851
|
+
email: string;
|
|
852
|
+
message: string;
|
|
853
|
+
status: JoinRequestStatus;
|
|
854
|
+
createdAt?: string;
|
|
855
|
+
reviewedAt?: string | null;
|
|
856
|
+
}
|
|
857
|
+
/** Query of `GET chats/links/:linkId/join-requests`. */
|
|
858
|
+
export interface JoinRequestListQuery {
|
|
859
|
+
/** Default `pending`. */
|
|
860
|
+
status?: JoinRequestStatus;
|
|
861
|
+
nextCursor?: string;
|
|
862
|
+
/** 1–20 (default 20). */
|
|
863
|
+
limit?: number;
|
|
864
|
+
}
|
|
865
|
+
/** Newest first; `pending` is the open count for the badge. */
|
|
866
|
+
export interface JoinRequestPage {
|
|
867
|
+
results: JoinRequestView[];
|
|
868
|
+
nextCursor: string | null;
|
|
869
|
+
hasMore: boolean;
|
|
870
|
+
pending: number;
|
|
871
|
+
}
|
|
872
|
+
/** `code` on the 403 from join-request when the link doesn't take requests. */
|
|
873
|
+
export declare const APPROVAL_OFF = "APPROVAL_OFF";
|
|
874
|
+
export interface JoinApprovalOffError {
|
|
875
|
+
statusCode: 403;
|
|
876
|
+
message: string;
|
|
877
|
+
code: typeof APPROVAL_OFF;
|
|
878
|
+
}
|
|
879
|
+
/** `code` on a guest join that needs a real email (400). */
|
|
880
|
+
export declare const EMAIL_REQUIRED = "EMAIL_REQUIRED";
|
|
881
|
+
/**
|
|
882
|
+
* `code` on a join the link refuses (403): invite only, or guests not allowed. Invite-only links also refuse
|
|
883
|
+
* sign-in, join-via-link and join-exist for anyone not on the invite list (after the password check). */
|
|
884
|
+
export declare const INVITE_ONLY = "INVITE_ONLY";
|
|
885
|
+
export interface JoinEmailRequiredError {
|
|
886
|
+
statusCode: 400;
|
|
887
|
+
message: string;
|
|
888
|
+
code: typeof EMAIL_REQUIRED;
|
|
889
|
+
}
|
|
890
|
+
export interface JoinInviteOnlyError {
|
|
891
|
+
statusCode: 403;
|
|
892
|
+
message: string;
|
|
893
|
+
code: typeof INVITE_ONLY;
|
|
894
|
+
}
|
|
895
|
+
/** `code` on a guest join refused because members may sign in or join as new but guests may not (403, chatta #385). */
|
|
896
|
+
export declare const SIGN_IN_REQUIRED = "SIGN_IN_REQUIRED";
|
|
897
|
+
export interface JoinSignInRequiredError {
|
|
898
|
+
statusCode: 403;
|
|
899
|
+
message: string;
|
|
900
|
+
code: typeof SIGN_IN_REQUIRED;
|
|
901
|
+
}
|