@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,775 @@
|
|
|
1
|
+
import type { PaginationQuery } from './options';
|
|
2
|
+
import type { ConversationMode, JoinPolicy, LinkMode, LinkModeCreateResult } from './chat-core';
|
|
3
|
+
import type { OwnerFlags } from './extras';
|
|
4
|
+
import type { CsatRating } from './csat';
|
|
5
|
+
/** `{ results, nextCursor, hasMore }` pages used by these routes (`_id` cursor). */
|
|
6
|
+
export interface ChatFeaturePage<T> {
|
|
7
|
+
results: T[];
|
|
8
|
+
nextCursor: string | null;
|
|
9
|
+
hasMore: boolean;
|
|
10
|
+
}
|
|
11
|
+
export interface MessageInfoMemberRow {
|
|
12
|
+
member: {
|
|
13
|
+
_id: string;
|
|
14
|
+
displayName?: string;
|
|
15
|
+
handle?: string;
|
|
16
|
+
photo?: string;
|
|
17
|
+
};
|
|
18
|
+
deliveredAt: string | null;
|
|
19
|
+
readAt: string | null;
|
|
20
|
+
}
|
|
21
|
+
/** Excludes the sender and system bots; `totals.members` = active members other than the sender. */
|
|
22
|
+
export interface MessageInfoResult extends ChatFeaturePage<MessageInfoMemberRow> {
|
|
23
|
+
messageId: string;
|
|
24
|
+
conversationId: string;
|
|
25
|
+
senderId: string;
|
|
26
|
+
sentAt: string;
|
|
27
|
+
/** 1.6.10: device class the message was sent from; absent on older messages. */
|
|
28
|
+
sentFrom?: SentFrom;
|
|
29
|
+
totals: {
|
|
30
|
+
members: number;
|
|
31
|
+
delivered: number;
|
|
32
|
+
read: number;
|
|
33
|
+
};
|
|
34
|
+
}
|
|
35
|
+
export interface MessageInfoQuery extends PaginationQuery {
|
|
36
|
+
/** ≤ 100 */
|
|
37
|
+
limit?: string;
|
|
38
|
+
}
|
|
39
|
+
export interface MessageInfoPayload {
|
|
40
|
+
conversationId: string;
|
|
41
|
+
messageId: string;
|
|
42
|
+
nextCursor?: string;
|
|
43
|
+
limit?: number;
|
|
44
|
+
}
|
|
45
|
+
/** `message-delivered`: up to 100 ids, emitted for messages you didn't send. */
|
|
46
|
+
export interface MarkMessagesDeliveredPayload {
|
|
47
|
+
conversationId: string;
|
|
48
|
+
messageIds: string[];
|
|
49
|
+
}
|
|
50
|
+
export interface MessageDeliveredResult {
|
|
51
|
+
conversationId: string;
|
|
52
|
+
userId: string;
|
|
53
|
+
messageIds: string[];
|
|
54
|
+
deliveredAt: string;
|
|
55
|
+
}
|
|
56
|
+
export type MuteDuration = '1h' | '8h' | '1w' | 'forever' | 'off';
|
|
57
|
+
/** "forever" is stored as this far-future date. */
|
|
58
|
+
export declare const MUTE_FOREVER_AT = "9999-12-31T23:59:59.000Z";
|
|
59
|
+
export interface ConversationMuteState {
|
|
60
|
+
conversationId: string;
|
|
61
|
+
mutedUntil: string | null;
|
|
62
|
+
isMuted: boolean;
|
|
63
|
+
isForever: boolean;
|
|
64
|
+
}
|
|
65
|
+
/** Push inside the window is suppressed (calls never are). end < start crosses midnight; start === end = off. */
|
|
66
|
+
export interface QuietHours {
|
|
67
|
+
enabled: boolean;
|
|
68
|
+
/** HH:mm (24h), local to `timezone`. */
|
|
69
|
+
start: string;
|
|
70
|
+
end: string;
|
|
71
|
+
/** IANA zone, e.g. Africa/Lagos. */
|
|
72
|
+
timezone: string;
|
|
73
|
+
}
|
|
74
|
+
/** Body of PUT /users/me/quiet-hours (and POST /chats/settings/quiet-hours). */
|
|
75
|
+
export type UpdateQuietHoursPayload = QuietHours;
|
|
76
|
+
/** GET /chats/settings/quiet-hours: your window plus the linked business account's (same e-mail), when on. */
|
|
77
|
+
export interface QuietHoursView extends QuietHours {
|
|
78
|
+
account: QuietHours | null;
|
|
79
|
+
}
|
|
80
|
+
export type AuthSessionDeviceType = 'desktop' | 'mobile' | 'tablet';
|
|
81
|
+
export type AuthSessionClient = 'web' | 'desktop-app' | 'mobile-app';
|
|
82
|
+
/** One row of GET /users/sessions or /chat-users/me/sessions. Dates are ISO strings. */
|
|
83
|
+
export interface AuthSessionView {
|
|
84
|
+
id: string;
|
|
85
|
+
browser: string;
|
|
86
|
+
os: string;
|
|
87
|
+
deviceType: AuthSessionDeviceType;
|
|
88
|
+
client: AuthSessionClient;
|
|
89
|
+
country: string | null;
|
|
90
|
+
city: string | null;
|
|
91
|
+
createdAt: string;
|
|
92
|
+
lastActiveAt: string;
|
|
93
|
+
current: boolean;
|
|
94
|
+
}
|
|
95
|
+
export interface AuthSessionList {
|
|
96
|
+
results: AuthSessionView[];
|
|
97
|
+
/** The session making this call, or null when it can't be identified. */
|
|
98
|
+
currentId: string | null;
|
|
99
|
+
}
|
|
100
|
+
/** DELETE one session → `{ revoked: 1 }`; revoke-others → how many were signed out. */
|
|
101
|
+
export interface AuthSessionRevokeResult {
|
|
102
|
+
revoked: number;
|
|
103
|
+
}
|
|
104
|
+
/** POST /users/sign-in-code → identical answer whether or not the email has an account. */
|
|
105
|
+
export interface SignInCodeRequestResult {
|
|
106
|
+
status: true;
|
|
107
|
+
message: string;
|
|
108
|
+
expiresInSeconds: number;
|
|
109
|
+
resendInSeconds: number;
|
|
110
|
+
}
|
|
111
|
+
/** Error `code` on a failed request/verify (HTTP 400 or 429). */
|
|
112
|
+
export type SignInCodeErrorCode = 'SIGN_IN_CODE_INVALID' | 'SIGN_IN_CODE_EXPIRED' | 'SIGN_IN_CODE_LOCKED' | 'SIGN_IN_CODE_COOLDOWN' | 'SIGN_IN_CODE_RATE_LIMITED';
|
|
113
|
+
/** Business session tokens, as the password login returns them. */
|
|
114
|
+
export interface BusinessSessionTokens {
|
|
115
|
+
accessToken: string;
|
|
116
|
+
refreshToken: string;
|
|
117
|
+
expireInSeconds: number;
|
|
118
|
+
}
|
|
119
|
+
/** Accounts with an authenticator app finish via `verifyBusinessTotp(pendingToken, code)`. */
|
|
120
|
+
export interface BusinessTotpChallenge {
|
|
121
|
+
require2fa: true;
|
|
122
|
+
pendingToken: string;
|
|
123
|
+
}
|
|
124
|
+
export type BusinessLoginResult = BusinessSessionTokens | BusinessTotpChallenge;
|
|
125
|
+
export type ReminderKind = 'remind' | 'read_later';
|
|
126
|
+
/** `tomorrow` = 09:00 next day in the user's timezone; `custom` needs remindAt (1 min – 365 days ahead). */
|
|
127
|
+
export type ReminderPreset = '20m' | '1h' | '3h' | 'tomorrow' | 'custom';
|
|
128
|
+
export type ReminderStatus = 'pending' | 'sent' | 'cancelled' | 'done';
|
|
129
|
+
export interface CreateMessageReminderPayload {
|
|
130
|
+
conversationId: string;
|
|
131
|
+
messageId: string;
|
|
132
|
+
kind: ReminderKind;
|
|
133
|
+
/** Required when kind = 'remind'. */
|
|
134
|
+
preset?: ReminderPreset;
|
|
135
|
+
/** ISO date; required when preset = 'custom'. */
|
|
136
|
+
remindAt?: string;
|
|
137
|
+
/** ≤ 280 chars. */
|
|
138
|
+
note?: string;
|
|
139
|
+
}
|
|
140
|
+
export interface MessageReminderView {
|
|
141
|
+
_id: string;
|
|
142
|
+
kind: ReminderKind;
|
|
143
|
+
status: ReminderStatus;
|
|
144
|
+
remindAt: string | null;
|
|
145
|
+
note?: string;
|
|
146
|
+
/** Plain text, ≤ 120 chars. */
|
|
147
|
+
messagePreview: string;
|
|
148
|
+
conversationId: string;
|
|
149
|
+
messageId: string;
|
|
150
|
+
conversation?: {
|
|
151
|
+
_id: string;
|
|
152
|
+
name?: string;
|
|
153
|
+
type?: string;
|
|
154
|
+
};
|
|
155
|
+
createdAt?: string;
|
|
156
|
+
}
|
|
157
|
+
export interface ReminderListQuery extends PaginationQuery {
|
|
158
|
+
kind?: ReminderKind;
|
|
159
|
+
/** ≤ 50 */
|
|
160
|
+
limit?: string;
|
|
161
|
+
}
|
|
162
|
+
export interface MessageRemindersChangedEvent {
|
|
163
|
+
action: 'upserted' | 'cancelled' | 'done';
|
|
164
|
+
reminder: MessageReminderView;
|
|
165
|
+
}
|
|
166
|
+
export interface ReminderDuePayload {
|
|
167
|
+
reminderId: string;
|
|
168
|
+
conversationId: string;
|
|
169
|
+
messageId: string;
|
|
170
|
+
messagePreview: string;
|
|
171
|
+
note?: string;
|
|
172
|
+
remindAt: string;
|
|
173
|
+
}
|
|
174
|
+
export interface ConversationPermissions {
|
|
175
|
+
membersCanSend: boolean;
|
|
176
|
+
membersCanAddPeople: boolean;
|
|
177
|
+
membersCanStartCalls: boolean;
|
|
178
|
+
membersCanShareMedia: boolean;
|
|
179
|
+
membersCanPin: boolean;
|
|
180
|
+
/** Plain members may create, rename, regenerate and revoke incoming webhooks here (off by default; admins always can). */
|
|
181
|
+
membersCanManageWebhooks: boolean;
|
|
182
|
+
/** 0 = off, max 21600. */
|
|
183
|
+
slowModeSeconds: number;
|
|
184
|
+
}
|
|
185
|
+
/** Older conversations have no permissions; treat missing values as these. */
|
|
186
|
+
export declare const DEFAULT_CONVERSATION_PERMISSIONS: Readonly<ConversationPermissions>;
|
|
187
|
+
export interface ConversationPermissionsPublic extends ConversationPermissions {
|
|
188
|
+
conversationId: string;
|
|
189
|
+
allowScreenshot: boolean;
|
|
190
|
+
isPrivate: boolean;
|
|
191
|
+
/** Conversation mode; 'standard' when unset. Also on `conversation-permissions-updated`. */
|
|
192
|
+
mode?: ConversationMode;
|
|
193
|
+
}
|
|
194
|
+
/** All optional. Note the request key is `allowScreenshots` (plural); the response key is `allowScreenshot`. */
|
|
195
|
+
export interface UpdateConversationPermissionsPayload extends Partial<ConversationPermissions> {
|
|
196
|
+
allowScreenshots?: boolean;
|
|
197
|
+
/** Private/Public for a group or channel: true stops new self-joins (members stay), false lists it and opens self-join. DMs, meetings, support rooms and shared channels get 400. */
|
|
198
|
+
isPrivate?: boolean;
|
|
199
|
+
}
|
|
200
|
+
export type ConversationPermissionAction = 'send' | 'shareMedia' | 'addPeople' | 'startCall' | 'pin';
|
|
201
|
+
/** Parsed server denial (see `parsePermissionDenial`). */
|
|
202
|
+
export interface PermissionDenial {
|
|
203
|
+
/** 'locked': the conversation is locked and only admins can send. */
|
|
204
|
+
action: ConversationPermissionAction | 'slowMode' | 'locked';
|
|
205
|
+
/** Slow mode only: seconds between messages. */
|
|
206
|
+
retryAfterSeconds?: number;
|
|
207
|
+
message: string;
|
|
208
|
+
}
|
|
209
|
+
export interface HuddleStartPayload {
|
|
210
|
+
conversationId: string;
|
|
211
|
+
initialMediaKind?: 'audio' | 'video';
|
|
212
|
+
}
|
|
213
|
+
/** Partial during the 5-min empty grace (`participantCount: 0, emptySince`); `active: false` when ended. */
|
|
214
|
+
export interface HuddleStatusView {
|
|
215
|
+
conversationId: string;
|
|
216
|
+
active: boolean;
|
|
217
|
+
sessionId: string | null;
|
|
218
|
+
startedAt: string | null;
|
|
219
|
+
startedBy: string | null;
|
|
220
|
+
participantIds: string[];
|
|
221
|
+
participantCount: number;
|
|
222
|
+
emptySince: string | null;
|
|
223
|
+
endpoint?: string;
|
|
224
|
+
}
|
|
225
|
+
export type TranscriptStatus = 'pending' | 'processing' | 'done' | 'failed';
|
|
226
|
+
/** Returned as data (`transcript.errorCode`), never as HTTP errors. */
|
|
227
|
+
export type TranscribeErrorCode = 'OUT_OF_AI_CREDITS' | 'NOT_AVAILABLE' | 'NO_MEDIA' | 'TOO_LONG' | 'PROVIDER_FAILED';
|
|
228
|
+
export declare const TRANSCRIBE_ERROR_CODES: readonly TranscribeErrorCode[];
|
|
229
|
+
export interface MessageTranscript {
|
|
230
|
+
status: TranscriptStatus;
|
|
231
|
+
text?: string;
|
|
232
|
+
language?: string;
|
|
233
|
+
summary?: string;
|
|
234
|
+
provider?: 'kimi' | 'stt';
|
|
235
|
+
model?: string;
|
|
236
|
+
mediaKind?: 'audio' | 'video';
|
|
237
|
+
attachmentLink?: string;
|
|
238
|
+
durationSec?: number;
|
|
239
|
+
errorCode?: TranscribeErrorCode;
|
|
240
|
+
requestedBy?: string;
|
|
241
|
+
isAuto?: boolean;
|
|
242
|
+
updatedAt?: string;
|
|
243
|
+
}
|
|
244
|
+
export interface TranscriptResponse {
|
|
245
|
+
conversationId: string;
|
|
246
|
+
messageId: string;
|
|
247
|
+
transcript: MessageTranscript;
|
|
248
|
+
}
|
|
249
|
+
export interface TranscribeAvailability {
|
|
250
|
+
enabled: boolean;
|
|
251
|
+
audio: boolean;
|
|
252
|
+
video: boolean;
|
|
253
|
+
autoTranscribe?: boolean;
|
|
254
|
+
}
|
|
255
|
+
export interface TranscriptSummaryResult {
|
|
256
|
+
conversationId: string;
|
|
257
|
+
messageId: string;
|
|
258
|
+
summary?: string;
|
|
259
|
+
errorCode?: TranscribeErrorCode;
|
|
260
|
+
}
|
|
261
|
+
export interface TranscriptTranslationResult {
|
|
262
|
+
conversationId: string;
|
|
263
|
+
messageId: string;
|
|
264
|
+
translation?: string;
|
|
265
|
+
language?: string;
|
|
266
|
+
errorCode?: TranscribeErrorCode;
|
|
267
|
+
}
|
|
268
|
+
export interface TranscribeMessagePayload {
|
|
269
|
+
conversationId: string;
|
|
270
|
+
messageId: string;
|
|
271
|
+
}
|
|
272
|
+
export type InboxStatus = 'open' | 'waiting' | 'resolved';
|
|
273
|
+
export type InboxLane = 'waiting' | 'mine' | 'unassigned' | 'resolved';
|
|
274
|
+
export interface InboxState {
|
|
275
|
+
status: InboxStatus;
|
|
276
|
+
assignedTo?: string | null;
|
|
277
|
+
assignedBy?: string | null;
|
|
278
|
+
assignedAt?: string | null;
|
|
279
|
+
firstCustomerMessageAt?: string | null;
|
|
280
|
+
lastCustomerMessageAt?: string | null;
|
|
281
|
+
firstResponseAt?: string | null;
|
|
282
|
+
firstResponseMs?: number | null;
|
|
283
|
+
lastAgentReplyAt?: string | null;
|
|
284
|
+
resolvedAt?: string | null;
|
|
285
|
+
resolvedBy?: string | null;
|
|
286
|
+
/** Set when an ASSIGN_TEAM rule routed through a named team. */
|
|
287
|
+
assignedTeam?: string | null;
|
|
288
|
+
assignedTeamName?: string | null;
|
|
289
|
+
/** Latest satisfaction score (1–5) for the current resolution; null until rated. */
|
|
290
|
+
csatScore?: number | null;
|
|
291
|
+
}
|
|
292
|
+
export interface InboxConversationView {
|
|
293
|
+
_id: string;
|
|
294
|
+
name: string;
|
|
295
|
+
type: string;
|
|
296
|
+
chatLink?: string;
|
|
297
|
+
lastMessageText?: string;
|
|
298
|
+
lastMessageAt?: string;
|
|
299
|
+
customer?: {
|
|
300
|
+
_id: string;
|
|
301
|
+
displayName?: string;
|
|
302
|
+
handle?: string;
|
|
303
|
+
photo?: string;
|
|
304
|
+
};
|
|
305
|
+
inbox: InboxState;
|
|
306
|
+
/** Customer messages after the last agent reply (0 once resolved). */
|
|
307
|
+
unreadCount?: number;
|
|
308
|
+
}
|
|
309
|
+
export interface InboxListQuery extends PaginationQuery {
|
|
310
|
+
lane: InboxLane;
|
|
311
|
+
chatLinkId?: string;
|
|
312
|
+
/** ≤ 20 */
|
|
313
|
+
limit?: string;
|
|
314
|
+
}
|
|
315
|
+
export interface InboxUpdatedPayload {
|
|
316
|
+
conversationId: string;
|
|
317
|
+
inbox: InboxState;
|
|
318
|
+
}
|
|
319
|
+
export interface LinkAutoTranscribeResult extends TranscribeAvailability {
|
|
320
|
+
autoTranscribe: boolean;
|
|
321
|
+
}
|
|
322
|
+
export interface LinkAgentInboxResult {
|
|
323
|
+
linkId: string;
|
|
324
|
+
agentInbox: boolean;
|
|
325
|
+
}
|
|
326
|
+
/** ZIP = messages.json + messages.html (+ media/ unless `includeMedia` is false). */
|
|
327
|
+
export type ConversationExportFormat = 'CSV' | 'PDF' | 'JSON' | 'ZIP';
|
|
328
|
+
/** 'mine' = only your own messages (any active member); 'all' (default) = conversation admins only. */
|
|
329
|
+
export type MemberExportScope = 'mine' | 'all';
|
|
330
|
+
/** Shared export filters; dates are ISO or YYYY-MM-DD (`to` as YYYY-MM-DD is inclusive). */
|
|
331
|
+
export interface ConversationExportRange {
|
|
332
|
+
/** ZIP only: include attachment files (default true). */
|
|
333
|
+
includeMedia?: boolean;
|
|
334
|
+
from?: string;
|
|
335
|
+
to?: string;
|
|
336
|
+
}
|
|
337
|
+
/** Body of `POST chats/conversations/:id/member-export` (member token). */
|
|
338
|
+
export interface MemberExportOptions extends ConversationExportRange {
|
|
339
|
+
/** Default CSV. */
|
|
340
|
+
format?: ConversationExportFormat;
|
|
341
|
+
scope?: MemberExportScope;
|
|
342
|
+
/** Email the link to your account (default true); false = poll `getMemberExportStatus`. */
|
|
343
|
+
emailMe?: boolean;
|
|
344
|
+
}
|
|
345
|
+
/** POST chats/conversations/:id/member-export result; `email` is null when `emailMe: false`. */
|
|
346
|
+
export interface MemberConversationExportResult {
|
|
347
|
+
success: boolean;
|
|
348
|
+
exportId: string;
|
|
349
|
+
email: string | null;
|
|
350
|
+
scope?: MemberExportScope;
|
|
351
|
+
message: string;
|
|
352
|
+
}
|
|
353
|
+
/** `GET chats/conversations/:id/member-export/:exportId`; poll until COMPLETED or FAILED. */
|
|
354
|
+
export interface ConversationExportStatus {
|
|
355
|
+
exportId: string;
|
|
356
|
+
/** e.g. PENDING | PROCESSING | COMPLETED | FAILED */
|
|
357
|
+
status: string;
|
|
358
|
+
format: string;
|
|
359
|
+
/** Set once COMPLETED. */
|
|
360
|
+
totalMessages: number | null;
|
|
361
|
+
downloadUrl: string | null;
|
|
362
|
+
error: string | null;
|
|
363
|
+
}
|
|
364
|
+
/** Body of the owner `POST chats/conversations/:id/export` (owner token). */
|
|
365
|
+
export interface OwnerExportPayload extends ConversationExportRange {
|
|
366
|
+
email: string;
|
|
367
|
+
format?: ConversationExportFormat;
|
|
368
|
+
}
|
|
369
|
+
export interface OwnerExportResult {
|
|
370
|
+
success: boolean;
|
|
371
|
+
exportId: string;
|
|
372
|
+
message: string;
|
|
373
|
+
}
|
|
374
|
+
/** `POST chat-users/me/links/:linkId/leave`: conversations left (history kept); the link leaves your list. */
|
|
375
|
+
export interface LeaveLinkResult {
|
|
376
|
+
left: number;
|
|
377
|
+
}
|
|
378
|
+
/** Body of `POST chat-users/me/claim-guest`: the live access token of the no-email guest session this device held. */
|
|
379
|
+
export interface ClaimGuestPayload {
|
|
380
|
+
guestToken: string;
|
|
381
|
+
}
|
|
382
|
+
/** `POST chat-users/me/claim-guest`: `merged` is false when the token was your own session or the guest was already folded in. */
|
|
383
|
+
export interface ClaimGuestResult {
|
|
384
|
+
merged: boolean;
|
|
385
|
+
outcome?: 'merged' | 'already' | 'refused';
|
|
386
|
+
/** Conversations that moved to your account as they were. */
|
|
387
|
+
moved?: number;
|
|
388
|
+
/** Direct chats with the same person that were folded into the one you already had. */
|
|
389
|
+
folded?: number;
|
|
390
|
+
/** Seats dropped because your account was already in that conversation. */
|
|
391
|
+
dropped?: number;
|
|
392
|
+
}
|
|
393
|
+
/** `POST chats/automations/test`: keywords tried on the link's last 7 days of messages. */
|
|
394
|
+
export interface AutomationKeywordTest {
|
|
395
|
+
matched: number;
|
|
396
|
+
scanned: number;
|
|
397
|
+
total: number;
|
|
398
|
+
/** True when the scan hit its message cap. */
|
|
399
|
+
capped: boolean;
|
|
400
|
+
/** The normalised keywords that were tested. */
|
|
401
|
+
keywords: string[];
|
|
402
|
+
}
|
|
403
|
+
/** Message audience; `internal` notes reach agent members only. */
|
|
404
|
+
export type MessageVisibility = 'public' | 'internal';
|
|
405
|
+
/** 1.6.10 (P-N13): the device class a message was sent from. Reported by the client and checked against its user agent; informational only, not for authorization or audit. `api`, `bot` and `automation` are set by the server. */
|
|
406
|
+
export type SentFrom = 'ios-app' | 'android-app' | 'desktop-app' | 'mobile-web' | 'web' | 'api' | 'bot' | 'automation';
|
|
407
|
+
/** Every `SentFrom` value, for validation and pickers. */
|
|
408
|
+
export declare const SENT_FROM_VALUES: readonly SentFrom[];
|
|
409
|
+
/** "iPhone app", "API", … for a message's `sentFrom`; '' when it has none (older messages) or an unknown value. */
|
|
410
|
+
export declare function sentFromLabel(value: string | null | undefined): string;
|
|
411
|
+
export type InboxTeamRole = 'OWNER' | 'ADMIN' | 'AGENT';
|
|
412
|
+
/** Topic auto-tags the backend accepts. */
|
|
413
|
+
export type InboxTag = 'urgent' | 'sales-lead' | 'support' | 'feedback' | 'general';
|
|
414
|
+
export declare const INTERNAL_NOTE_MAX_LENGTH = 3000;
|
|
415
|
+
export declare const CONVERSATION_NOTE_MAX_LENGTH = 2000;
|
|
416
|
+
export declare const INBOX_TOPIC_MAX = 8;
|
|
417
|
+
/** Catch-up summaries need at least this many unread messages. */
|
|
418
|
+
export declare const CATCH_UP_MIN_UNREAD = 8;
|
|
419
|
+
/** GET chats/agent-inbox/me; `agent: false` for non-team chat users. */
|
|
420
|
+
export interface InboxAgentProfile {
|
|
421
|
+
agent: boolean;
|
|
422
|
+
userId?: string;
|
|
423
|
+
teamRole?: InboxTeamRole;
|
|
424
|
+
team: {
|
|
425
|
+
userId: string;
|
|
426
|
+
name: string;
|
|
427
|
+
teamRole: InboxTeamRole;
|
|
428
|
+
}[];
|
|
429
|
+
}
|
|
430
|
+
export interface InboxCursorQuery extends PaginationQuery {
|
|
431
|
+
/** ≤ 20 */
|
|
432
|
+
limit?: string;
|
|
433
|
+
}
|
|
434
|
+
export interface CreateInternalNotePayload {
|
|
435
|
+
/** 1–3000 chars. */
|
|
436
|
+
message: string;
|
|
437
|
+
/** [A-Za-z0-9_-]{8,64}; makes retries idempotent. */
|
|
438
|
+
referenceId?: string;
|
|
439
|
+
}
|
|
440
|
+
export interface InternalNoteView {
|
|
441
|
+
_id: string;
|
|
442
|
+
conversationId: string;
|
|
443
|
+
message: string;
|
|
444
|
+
referenceId: string;
|
|
445
|
+
visibility: 'internal';
|
|
446
|
+
sender: {
|
|
447
|
+
_id: string;
|
|
448
|
+
displayName?: string;
|
|
449
|
+
photo?: string;
|
|
450
|
+
};
|
|
451
|
+
createdAt: string;
|
|
452
|
+
}
|
|
453
|
+
/** Customer-level team note (follows the customer across conversations). */
|
|
454
|
+
export interface ConversationNoteView {
|
|
455
|
+
_id: string;
|
|
456
|
+
conversationId: string;
|
|
457
|
+
customerId: string | null;
|
|
458
|
+
text: string;
|
|
459
|
+
author: {
|
|
460
|
+
userId: string;
|
|
461
|
+
name: string;
|
|
462
|
+
};
|
|
463
|
+
createdAt: string;
|
|
464
|
+
updatedAt: string;
|
|
465
|
+
}
|
|
466
|
+
export interface InboxNoteDeleted {
|
|
467
|
+
conversationId: string;
|
|
468
|
+
noteId: string;
|
|
469
|
+
}
|
|
470
|
+
export type SlaState = 'none' | 'running' | 'met' | 'breached';
|
|
471
|
+
export interface SlaProgress {
|
|
472
|
+
state: SlaState;
|
|
473
|
+
elapsedMs: number;
|
|
474
|
+
targetMs: number | null;
|
|
475
|
+
ratio: number | null;
|
|
476
|
+
}
|
|
477
|
+
export interface ConversationTopic {
|
|
478
|
+
id: string;
|
|
479
|
+
label: string;
|
|
480
|
+
}
|
|
481
|
+
export interface AgentInboxStateView {
|
|
482
|
+
conversationId: string;
|
|
483
|
+
inbox: InboxState | null;
|
|
484
|
+
slaTargetMinutes: number | null;
|
|
485
|
+
sla: SlaProgress;
|
|
486
|
+
topic: ConversationTopic | null;
|
|
487
|
+
tag: string | null;
|
|
488
|
+
/** Where the customer last connected from (agents only); null when unknown. */
|
|
489
|
+
customer?: InboxCustomerFacts | null;
|
|
490
|
+
/** Latest satisfaction request (open or rated, with the comment); null when none. */
|
|
491
|
+
csat?: CsatRating | null;
|
|
492
|
+
}
|
|
493
|
+
export interface InboxCustomerFacts {
|
|
494
|
+
country: string | null;
|
|
495
|
+
city: string | null;
|
|
496
|
+
/** "Chrome · Android 14". */
|
|
497
|
+
device: string | null;
|
|
498
|
+
/** Opening page, host + path ("acme.com/help"). */
|
|
499
|
+
page: string | null;
|
|
500
|
+
embed: boolean;
|
|
501
|
+
language: string | null;
|
|
502
|
+
autoTranslate: boolean;
|
|
503
|
+
}
|
|
504
|
+
/** Composer "Draft reply": an editable AI draft; never sent by itself. Failures come back as `errorCode`. */
|
|
505
|
+
export interface InboxDraftReplyView {
|
|
506
|
+
conversationId: string;
|
|
507
|
+
draft: string | null;
|
|
508
|
+
generatedAt: string | null;
|
|
509
|
+
errorCode?: ConversationSummaryErrorCode;
|
|
510
|
+
}
|
|
511
|
+
export type ConversationSummaryErrorCode = 'OUT_OF_AI_CREDITS' | 'NOT_ENOUGH_MESSAGES' | 'PROVIDER_FAILED';
|
|
512
|
+
/** AI summary / catch-up; failures come back as `errorCode`, not HTTP errors. */
|
|
513
|
+
export interface ConversationSummaryView {
|
|
514
|
+
conversationId: string;
|
|
515
|
+
summary: string | null;
|
|
516
|
+
messageCount: number;
|
|
517
|
+
generatedAt: string | null;
|
|
518
|
+
cached: boolean;
|
|
519
|
+
errorCode?: ConversationSummaryErrorCode;
|
|
520
|
+
}
|
|
521
|
+
export interface ConversationTopicResult {
|
|
522
|
+
conversationId: string;
|
|
523
|
+
topic: ConversationTopic;
|
|
524
|
+
tag: string | null;
|
|
525
|
+
/** True when the topic auto-assigned the thread. */
|
|
526
|
+
assigned: boolean;
|
|
527
|
+
}
|
|
528
|
+
/** Join-card topic; `assigneeId` auto-assigns, `tag` tags the conversation. */
|
|
529
|
+
export interface InboxTopic {
|
|
530
|
+
id: string;
|
|
531
|
+
/** ≤ 40 chars. */
|
|
532
|
+
label: string;
|
|
533
|
+
tag?: InboxTag | null;
|
|
534
|
+
assigneeId?: string | null;
|
|
535
|
+
/** Named team (WorkspaceTeam id) that gets this topic's chats round-robin; wins over `assigneeId`. */
|
|
536
|
+
teamId?: string | null;
|
|
537
|
+
}
|
|
538
|
+
/** `GET` / `PATCH chats/conversations/:id/support-team`: the named team a support group's topic routes to. */
|
|
539
|
+
export interface SupportGroupTeamView {
|
|
540
|
+
conversationId: string;
|
|
541
|
+
topicId: string | null;
|
|
542
|
+
teamId: string | null;
|
|
543
|
+
name: string;
|
|
544
|
+
/** The owner's teams to pick from. */
|
|
545
|
+
teams: Array<{
|
|
546
|
+
_id: string;
|
|
547
|
+
name: string;
|
|
548
|
+
memberCount: number;
|
|
549
|
+
}>;
|
|
550
|
+
}
|
|
551
|
+
export interface InboxLinkSettingsPayload {
|
|
552
|
+
/** 1 – 10080 minutes; null clears. */
|
|
553
|
+
slaTargetMinutes?: number | null;
|
|
554
|
+
/** Resolve open conversations idle this many days; null = never. */
|
|
555
|
+
autoCloseDays?: number | null;
|
|
556
|
+
/** ≤ 8; omit `id` on new topics. */
|
|
557
|
+
topics?: Array<Partial<InboxTopic> & {
|
|
558
|
+
label: string;
|
|
559
|
+
}>;
|
|
560
|
+
/** Ask for a satisfaction rating after a resolve; null = default (on for Support links only). */
|
|
561
|
+
csatEnabled?: boolean | null;
|
|
562
|
+
/** The rating question, ≤ 140 characters; null or empty uses the default. */
|
|
563
|
+
csatQuestion?: string | null;
|
|
564
|
+
}
|
|
565
|
+
export interface InboxLinkSettingsView {
|
|
566
|
+
linkId: string;
|
|
567
|
+
slaTargetMinutes: number | null;
|
|
568
|
+
/** Absent on servers before the auto-close setting. */
|
|
569
|
+
autoCloseDays?: number | null;
|
|
570
|
+
topics: InboxTopic[];
|
|
571
|
+
/** Resolved value (the default applied); absent on servers before CSAT. */
|
|
572
|
+
csatEnabled?: boolean;
|
|
573
|
+
csatQuestion?: string;
|
|
574
|
+
}
|
|
575
|
+
/** GET /in/:linkCode/presence-stats (public, counts only). */
|
|
576
|
+
export interface JoinPresenceStats {
|
|
577
|
+
enabled: boolean;
|
|
578
|
+
agentsOnline: number;
|
|
579
|
+
typicalReplyMinutes: number | null;
|
|
580
|
+
}
|
|
581
|
+
/** `internal-note` (agent `user:` rooms). */
|
|
582
|
+
export interface InternalNoteEvent {
|
|
583
|
+
conversationId: string;
|
|
584
|
+
note: InternalNoteView;
|
|
585
|
+
}
|
|
586
|
+
/** `conversation-notes-updated`: `note` on created/updated, `noteId` on deleted. */
|
|
587
|
+
export interface ConversationNotesUpdatedEvent {
|
|
588
|
+
conversationId: string;
|
|
589
|
+
action: 'created' | 'updated' | 'deleted';
|
|
590
|
+
note?: ConversationNoteView;
|
|
591
|
+
noteId?: string;
|
|
592
|
+
}
|
|
593
|
+
export declare const SOUND_PRESETS: readonly ["default", "gentle", "chime", "pop", "none"];
|
|
594
|
+
export type SoundPreset = (typeof SOUND_PRESETS)[number];
|
|
595
|
+
export interface SoundPreferences {
|
|
596
|
+
message?: SoundPreset;
|
|
597
|
+
conversationInvite?: SoundPreset;
|
|
598
|
+
mention?: SoundPreset;
|
|
599
|
+
system?: SoundPreset;
|
|
600
|
+
}
|
|
601
|
+
/** "Notify me about" topics on the business profile. */
|
|
602
|
+
export interface NotifyTopics {
|
|
603
|
+
newConversations?: boolean;
|
|
604
|
+
mentions?: boolean;
|
|
605
|
+
slaBreach?: boolean;
|
|
606
|
+
webhookFailures?: boolean;
|
|
607
|
+
billingAlerts?: boolean;
|
|
608
|
+
productNews?: boolean;
|
|
609
|
+
}
|
|
610
|
+
export declare const PREFERENCE_LANGUAGES: readonly ["en", "fr", "es", "ar", "pt", "de", "yo", "ha", "ig", "sw", "zh", "hi"];
|
|
611
|
+
export type PreferenceLanguage = (typeof PREFERENCE_LANGUAGES)[number];
|
|
612
|
+
/** Merged by key server side: sending one field never wipes the others. */
|
|
613
|
+
export interface AccountPreferencesPayload {
|
|
614
|
+
/** `system` follows the device. */
|
|
615
|
+
theme?: 'light' | 'dark' | 'system';
|
|
616
|
+
emailNotifications?: boolean;
|
|
617
|
+
pushNotifications?: boolean;
|
|
618
|
+
soundEnabled?: boolean;
|
|
619
|
+
sidebarOrder?: string[];
|
|
620
|
+
currencyPreference?: 'USD' | 'NGN' | 'EUR' | 'GBP';
|
|
621
|
+
soundPreferences?: SoundPreferences;
|
|
622
|
+
notifyTopics?: NotifyTopics;
|
|
623
|
+
/** Interface language. */
|
|
624
|
+
language?: PreferenceLanguage;
|
|
625
|
+
/** Translate incoming messages to this language; 'off' turns it off (stored as null). */
|
|
626
|
+
translateIncomingTo?: PreferenceLanguage | 'off';
|
|
627
|
+
}
|
|
628
|
+
/** Body of `PATCH /users/me` (backend `UpdateProfileDto`). */
|
|
629
|
+
export interface UpdateAccountProfilePayload {
|
|
630
|
+
firstName?: string;
|
|
631
|
+
lastName?: string;
|
|
632
|
+
phone?: string;
|
|
633
|
+
handle?: string;
|
|
634
|
+
website?: string;
|
|
635
|
+
aboutMe?: string;
|
|
636
|
+
/** https URL or a base64 data URI (uploaded server side). */
|
|
637
|
+
photo?: string;
|
|
638
|
+
country?: string;
|
|
639
|
+
deviceToken?: string;
|
|
640
|
+
webToken?: string;
|
|
641
|
+
preferences?: AccountPreferencesPayload;
|
|
642
|
+
}
|
|
643
|
+
/** The updated business account (password and 2FA secrets are never returned). */
|
|
644
|
+
export interface AccountProfile {
|
|
645
|
+
_id: string;
|
|
646
|
+
email?: string;
|
|
647
|
+
firstName?: string;
|
|
648
|
+
lastName?: string;
|
|
649
|
+
handle?: string;
|
|
650
|
+
photo?: string;
|
|
651
|
+
country?: string;
|
|
652
|
+
preferences?: Omit<AccountPreferencesPayload, 'translateIncomingTo'> & {
|
|
653
|
+
translateIncomingTo?: PreferenceLanguage | null;
|
|
654
|
+
};
|
|
655
|
+
/** Feature flags evaluated for this workspace (`GET users/me`). */
|
|
656
|
+
flags?: OwnerFlags;
|
|
657
|
+
[key: string]: unknown;
|
|
658
|
+
}
|
|
659
|
+
export type NotifyCategory = 'dms' | 'mentions' | 'channels' | 'system';
|
|
660
|
+
export interface NotifyChannelPrefs {
|
|
661
|
+
push?: boolean;
|
|
662
|
+
sound?: boolean;
|
|
663
|
+
/** Email digest for the category. */
|
|
664
|
+
email?: boolean;
|
|
665
|
+
}
|
|
666
|
+
/** Category × channel switches; a missing value means on. */
|
|
667
|
+
export type NotifyMatrix = {
|
|
668
|
+
[K in NotifyCategory]?: NotifyChannelPrefs;
|
|
669
|
+
};
|
|
670
|
+
/** `preferences` on `PATCH /chat-users/me` (backend `UpdateUserPreferencesDto`), merged by key. */
|
|
671
|
+
export interface ChatUserPreferencesPayload {
|
|
672
|
+
[key: string]: unknown;
|
|
673
|
+
emailNotifications?: boolean;
|
|
674
|
+
pushNotifications?: boolean;
|
|
675
|
+
soundEnabled?: boolean;
|
|
676
|
+
soundPreferences?: SoundPreferences;
|
|
677
|
+
showOnlineStatus?: boolean;
|
|
678
|
+
readReceipts?: boolean;
|
|
679
|
+
typingIndicator?: boolean;
|
|
680
|
+
/** IANA zone, or 'auto' to follow the device. */
|
|
681
|
+
timezone?: string;
|
|
682
|
+
notifyMatrix?: NotifyMatrix;
|
|
683
|
+
/** Default message layout; `auto` = lines for channels. */
|
|
684
|
+
messageLayout?: MessageLayoutPref;
|
|
685
|
+
/** Text size for messages and lists. */
|
|
686
|
+
textSize?: TextSizePref;
|
|
687
|
+
/** Call sounds, e.g. the waiting tune. */
|
|
688
|
+
callSounds?: CallSoundsPrefs;
|
|
689
|
+
}
|
|
690
|
+
export declare const MESSAGE_LAYOUT_PREFS: readonly ["auto", "bubbles", "lines"];
|
|
691
|
+
export type MessageLayoutPref = (typeof MESSAGE_LAYOUT_PREFS)[number];
|
|
692
|
+
export declare const TEXT_SIZE_PREFS: readonly ["s", "m", "l", "xl"];
|
|
693
|
+
export type TextSizePref = (typeof TEXT_SIZE_PREFS)[number];
|
|
694
|
+
/** Waiting tune for a caller or host who is alone in a call; `off` is no tune (unset plays `drift`). */
|
|
695
|
+
export declare const CALL_WAITING_TUNES: readonly ["drift", "pebble", "lantern", "tide", "meadow", "off"];
|
|
696
|
+
export type CallWaitingTune = (typeof CALL_WAITING_TUNES)[number];
|
|
697
|
+
/** `preferences.callSounds` on `PATCH /chat-users/me`. */
|
|
698
|
+
export interface CallSoundsPrefs {
|
|
699
|
+
waitingTune?: CallWaitingTune;
|
|
700
|
+
}
|
|
701
|
+
export type ChatLinkLayout = 'bubbles' | 'lines';
|
|
702
|
+
/** `settings` on link create / PATCH. The PATCH replaces it whole, so send the merged object. */
|
|
703
|
+
export interface ChatLinkSettings {
|
|
704
|
+
[key: string]: unknown;
|
|
705
|
+
/** Default view for group / channel chats; each person can still switch. */
|
|
706
|
+
defaultLayout?: ChatLinkLayout;
|
|
707
|
+
/** Mode join rules; change single rules with `setLinkJoinPolicy`. */
|
|
708
|
+
joinPolicy?: JoinPolicy;
|
|
709
|
+
/** Only staff start groups and channels (community "Members can make channels" off). */
|
|
710
|
+
staffOnlyCreate?: boolean | null;
|
|
711
|
+
/** Hide "Runs on livechatta" on the join card; honoured only while the plan has `allowWhiteLabel`. */
|
|
712
|
+
hideRunsOn?: boolean;
|
|
713
|
+
}
|
|
714
|
+
/** Keys `settings` accepts on link create / update (chatta #408); others are dropped and PATCH merges key by key. */
|
|
715
|
+
export declare const CHAT_LINK_SETTINGS_KEYS: readonly ["maxMembers", "allowAttachments", "allowVoiceMessages", "allowVideoMessages", "allowMemberInvite", "welcomeMessage", "defaultLayout", "hideRunsOn", "allowMemberStart", "allowHopCalls", "allowScreenshots", "retentionDays", "allowLiveFlex", "editHistoryAdminsOnly", "allowSharedDms", "isolated", "allowRecordingDownload"];
|
|
716
|
+
/** `settings` body on create / update: send only the keys you change; the rest of the stored settings stay. */
|
|
717
|
+
export interface ChatLinkSettingsPatch {
|
|
718
|
+
maxMembers?: number;
|
|
719
|
+
allowAttachments?: boolean;
|
|
720
|
+
allowVoiceMessages?: boolean;
|
|
721
|
+
allowVideoMessages?: boolean;
|
|
722
|
+
allowMemberInvite?: boolean;
|
|
723
|
+
welcomeMessage?: string;
|
|
724
|
+
defaultLayout?: ChatLinkLayout;
|
|
725
|
+
/** Honoured only while the plan has `allowWhiteLabel`. */
|
|
726
|
+
hideRunsOn?: boolean;
|
|
727
|
+
/** Members may start new conversations (off: only your team starts them). Unset = on. */
|
|
728
|
+
allowMemberStart?: boolean;
|
|
729
|
+
/** Members may start Hop calls (conversation admins always can). Unset = on. */
|
|
730
|
+
allowHopCalls?: boolean;
|
|
731
|
+
/** Off asks the chat UI and apps to block screenshots and copying. Unset = on. */
|
|
732
|
+
allowScreenshots?: boolean;
|
|
733
|
+
/** Days messages are kept, 1–3650, never longer than the plan; null = the plan default. */
|
|
734
|
+
retentionDays?: number | null;
|
|
735
|
+
/** 1.6.0: LiveFlex money (sends, LiveFlex gifts, @chatta money) in this link. Unset = on; off still lets people withdraw. */
|
|
736
|
+
allowLiveFlex?: boolean;
|
|
737
|
+
/** 1.6.2: when true, only admins/owner can view a message's edit history. Unset = everyone. */
|
|
738
|
+
editHistoryAdminsOnly?: boolean;
|
|
739
|
+
/** Direct messages with people of shared-channel partner workspaces. Off unless both workspaces turn it on. */
|
|
740
|
+
allowSharedDms?: boolean;
|
|
741
|
+
/** Isolated workspace, per link (default off): no LiveFlex, new shared channels or account links cross this link, in either direction. Only the account owner may change it (a team admin or API key gets 403); shares that already exist stay until they end or expire. */
|
|
742
|
+
isolated?: boolean;
|
|
743
|
+
/** Members may download call recordings as MP4 (`getRecordingDownloadLink`). Off unless true: watch in the chat only. */
|
|
744
|
+
allowRecordingDownload?: boolean;
|
|
745
|
+
}
|
|
746
|
+
/** 1.6.2: one version of an edited message; `current` marks the live text. */
|
|
747
|
+
export interface MessageEditVersion {
|
|
748
|
+
text: string;
|
|
749
|
+
at: string | null;
|
|
750
|
+
current: boolean;
|
|
751
|
+
}
|
|
752
|
+
export interface MessageEditHistory {
|
|
753
|
+
versions: MessageEditVersion[];
|
|
754
|
+
}
|
|
755
|
+
/** A link created with `mode`: the row plus `modeResult` (`applied: false` + `warning` when the preset failed). */
|
|
756
|
+
export type CreatedChatLink = AccountChatLink & {
|
|
757
|
+
mode?: LinkMode;
|
|
758
|
+
modeResult?: LinkModeCreateResult;
|
|
759
|
+
};
|
|
760
|
+
/** A row of the owner's `GET /chats/links`. */
|
|
761
|
+
export interface AccountChatLink {
|
|
762
|
+
_id: string;
|
|
763
|
+
code: string;
|
|
764
|
+
name: string;
|
|
765
|
+
caption?: string;
|
|
766
|
+
status: string;
|
|
767
|
+
linkType?: string;
|
|
768
|
+
conversationType?: string;
|
|
769
|
+
expiresAt?: string | null;
|
|
770
|
+
maxMembers?: number;
|
|
771
|
+
totalVisitors?: number;
|
|
772
|
+
settings?: ChatLinkSettings;
|
|
773
|
+
createdAt?: string;
|
|
774
|
+
[key: string]: unknown;
|
|
775
|
+
}
|