@livechatta/sdk 0.0.0-stage → 1.0.1
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 +228 -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 +7259 -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 +7078 -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 +7263 -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 +274 -4
|
@@ -0,0 +1,353 @@
|
|
|
1
|
+
import type { JoinPolicy, LinkMode, ConversationMode, LinkModeOptions } from './chat-core';
|
|
2
|
+
import type { PaymentChannel } from './billing';
|
|
3
|
+
/** Reasons the server refuses a link `code`; create answers 400 with `code: 'LINK_CODE_<reason>'`. */
|
|
4
|
+
export declare const LINK_CODE_REASONS: readonly ["TOO_SHORT", "TOO_LONG", "INVALID", "RESERVED", "TAKEN"];
|
|
5
|
+
export type LinkCodeReason = (typeof LINK_CODE_REASONS)[number];
|
|
6
|
+
/** `LiveChattaError.code` values of a refused link create: LINK_CODE_TOO_SHORT … LINK_CODE_TAKEN. */
|
|
7
|
+
export type LinkCodeErrorCode = `LINK_CODE_${LinkCodeReason}`;
|
|
8
|
+
export declare const LINK_CODE_ERROR_CODES: readonly LinkCodeErrorCode[];
|
|
9
|
+
export declare const LINK_CODE_MIN = 3;
|
|
10
|
+
export declare const LINK_CODE_MAX = 40;
|
|
11
|
+
/** `GET chats/links/code-available?code=`; `code` is the normalised form (lowercase, hyphens). */
|
|
12
|
+
export interface LinkCodeCheck {
|
|
13
|
+
code: string;
|
|
14
|
+
available: boolean;
|
|
15
|
+
reason?: LinkCodeReason;
|
|
16
|
+
message?: string;
|
|
17
|
+
/** Up to three free variants when the code is taken or reserved. */
|
|
18
|
+
suggestions?: string[];
|
|
19
|
+
}
|
|
20
|
+
/** True for a `LiveChattaError.code` raised by a refused custom link address. */
|
|
21
|
+
export declare function isLinkCodeError(code: string | undefined): code is LinkCodeErrorCode;
|
|
22
|
+
export interface LinkModeOptionTemplate {
|
|
23
|
+
key: keyof LinkModeOptions;
|
|
24
|
+
label: string;
|
|
25
|
+
hint: string;
|
|
26
|
+
default: boolean | string[];
|
|
27
|
+
}
|
|
28
|
+
export interface LinkModeDefaultTemplate {
|
|
29
|
+
name: string;
|
|
30
|
+
type: 'GROUP' | 'CHANNEL';
|
|
31
|
+
mode: ConversationMode;
|
|
32
|
+
isPrivate: boolean;
|
|
33
|
+
autoJoin: boolean;
|
|
34
|
+
category: string | null;
|
|
35
|
+
}
|
|
36
|
+
export interface LinkModeTemplate {
|
|
37
|
+
mode: LinkMode;
|
|
38
|
+
label: string;
|
|
39
|
+
description: string;
|
|
40
|
+
recommendedFor: string;
|
|
41
|
+
/** SVG path data (24×24, stroked). */
|
|
42
|
+
icon: string;
|
|
43
|
+
isDefault: boolean;
|
|
44
|
+
conversationType: 'SINGLE' | 'GROUP';
|
|
45
|
+
linkType: 'STANDARD' | 'ANONYMOUS';
|
|
46
|
+
staffOnlyCreate: boolean;
|
|
47
|
+
joinPolicy: JoinPolicy;
|
|
48
|
+
agentInbox: boolean;
|
|
49
|
+
discoverable: boolean;
|
|
50
|
+
whatYouGet: string;
|
|
51
|
+
summary: string[];
|
|
52
|
+
switchCopy: string;
|
|
53
|
+
next: string | null;
|
|
54
|
+
defaults: LinkModeDefaultTemplate[];
|
|
55
|
+
options: LinkModeOptionTemplate[];
|
|
56
|
+
planFeature: 'allowWebinarMode' | null;
|
|
57
|
+
/** False when the caller's plan lacks `planFeature` (picking it answers 403 PLAN_FEATURE_REQUIRED). */
|
|
58
|
+
available: boolean;
|
|
59
|
+
}
|
|
60
|
+
export interface ConversationModeTemplate {
|
|
61
|
+
mode: ConversationMode;
|
|
62
|
+
label: string;
|
|
63
|
+
description: string;
|
|
64
|
+
icon: string;
|
|
65
|
+
types: Array<'GROUP' | 'CHANNEL'>;
|
|
66
|
+
/** Only staff on the link may pick it (support group). */
|
|
67
|
+
staffOnly: boolean;
|
|
68
|
+
membersCanPost: boolean;
|
|
69
|
+
membersThreadReplies: boolean;
|
|
70
|
+
slowModeSeconds: number;
|
|
71
|
+
}
|
|
72
|
+
export interface ModeCatalog {
|
|
73
|
+
linkModes: LinkModeTemplate[];
|
|
74
|
+
conversationModes: ConversationModeTemplate[];
|
|
75
|
+
}
|
|
76
|
+
export declare const LINK_WHO_CAN_JOIN: readonly ["guest", "members", "invite"];
|
|
77
|
+
/** Settings › Access radio; maps onto the join policy (guests / sign-in required / invite only). */
|
|
78
|
+
export type LinkWhoCanJoin = (typeof LINK_WHO_CAN_JOIN)[number];
|
|
79
|
+
/** `PATCH chats/links/:linkId/who-can-join` answer. */
|
|
80
|
+
export interface LinkWhoCanJoinResult {
|
|
81
|
+
who: LinkWhoCanJoin;
|
|
82
|
+
}
|
|
83
|
+
/** `GET`/`PUT chats/links/:linkId/custom-domain` and `POST …/verify` (white-label plans). */
|
|
84
|
+
export interface LinkCustomDomainView {
|
|
85
|
+
/** null when none is set. */
|
|
86
|
+
domain: string | null;
|
|
87
|
+
/** The host the domain must CNAME to. */
|
|
88
|
+
target: string;
|
|
89
|
+
verified: boolean;
|
|
90
|
+
verifiedAt: string | null;
|
|
91
|
+
/** Why the last check failed (no CNAME, points elsewhere); null when verified or unset. */
|
|
92
|
+
error: string | null;
|
|
93
|
+
}
|
|
94
|
+
export interface ChatLinkOverviewDay {
|
|
95
|
+
date: string;
|
|
96
|
+
visitors: number;
|
|
97
|
+
}
|
|
98
|
+
/** `GET chats/links/:linkId/overview`: the link Overview cards (30 day windows). */
|
|
99
|
+
export interface ChatLinkOverviewStats {
|
|
100
|
+
linkId: string;
|
|
101
|
+
visitors30d: number;
|
|
102
|
+
visitorsPrev30d: number;
|
|
103
|
+
visitorsDeltaPct: number | null;
|
|
104
|
+
conversations: number;
|
|
105
|
+
conversations30d: number;
|
|
106
|
+
conversationsPrev30d: number;
|
|
107
|
+
conversationsDeltaPct: number | null;
|
|
108
|
+
messages: number;
|
|
109
|
+
firstReplyMedianMs: number | null;
|
|
110
|
+
firstReplyPrevMedianMs: number | null;
|
|
111
|
+
firstReplySamples: number;
|
|
112
|
+
members: number;
|
|
113
|
+
maxMembers: number;
|
|
114
|
+
visitorsDaily: ChatLinkOverviewDay[];
|
|
115
|
+
generatedAt: string;
|
|
116
|
+
}
|
|
117
|
+
/** `POST chats/links/:linkId/wipe-messages`: deletes every message, keeps the link and its conversations. */
|
|
118
|
+
export interface WipeLinkMessagesResult {
|
|
119
|
+
status: boolean;
|
|
120
|
+
deleted: number;
|
|
121
|
+
}
|
|
122
|
+
export declare const PERSONAL_NOTE_MAX_LENGTH = 2000;
|
|
123
|
+
/** `GET`/`PUT chats/conversations/:id/my-note`: only the member sees it. */
|
|
124
|
+
export interface PersonalNote {
|
|
125
|
+
conversationId: string;
|
|
126
|
+
text: string;
|
|
127
|
+
updatedAt: string | null;
|
|
128
|
+
}
|
|
129
|
+
/** `PUT chats/conversations/:id/pin`: per-member flag shared by the chat list and /my home. */
|
|
130
|
+
export interface ConversationPinResult {
|
|
131
|
+
conversationId: string;
|
|
132
|
+
isPinned: boolean;
|
|
133
|
+
}
|
|
134
|
+
export interface StarredPerson {
|
|
135
|
+
_id: string;
|
|
136
|
+
displayName: string;
|
|
137
|
+
handle: string;
|
|
138
|
+
photo: string;
|
|
139
|
+
isOnline: boolean;
|
|
140
|
+
starredAt?: string;
|
|
141
|
+
}
|
|
142
|
+
export interface StarredPeoplePage {
|
|
143
|
+
items: StarredPerson[];
|
|
144
|
+
/** Offset cursor, null on the last page. */
|
|
145
|
+
nextCursor: string | null;
|
|
146
|
+
total: number;
|
|
147
|
+
}
|
|
148
|
+
export interface StarredPeopleQuery {
|
|
149
|
+
[key: string]: string | undefined;
|
|
150
|
+
nextCursor?: string;
|
|
151
|
+
/** 1–20, default 20. */
|
|
152
|
+
limit?: string;
|
|
153
|
+
}
|
|
154
|
+
export interface StarredIdsResult {
|
|
155
|
+
ids: string[];
|
|
156
|
+
}
|
|
157
|
+
export interface StarToggleResult {
|
|
158
|
+
memberId: string;
|
|
159
|
+
starred: boolean;
|
|
160
|
+
total: number;
|
|
161
|
+
}
|
|
162
|
+
/** Evaluated flags for the workspace; read on `GET users/me`, `GET chat-users/me` and `chatParams.flags`. */
|
|
163
|
+
export interface OwnerFlags {
|
|
164
|
+
[key: string]: boolean;
|
|
165
|
+
}
|
|
166
|
+
export type KnownFlagKey = 'hop_calls' | 'voice_transcribe' | 'automation_delays';
|
|
167
|
+
/** `GET admins/feature-flags/known` (LiveChatta staff token): flags the server reads. */
|
|
168
|
+
export interface FlagRegistryEntry {
|
|
169
|
+
key: KnownFlagKey;
|
|
170
|
+
description: string;
|
|
171
|
+
/** Value when no stored flag exists for the key. */
|
|
172
|
+
defaultOn: boolean;
|
|
173
|
+
}
|
|
174
|
+
export declare const PENDING_TRANSFER_KINDS: readonly ["plan_change", "extra_seats"];
|
|
175
|
+
export type PendingTransferKind = (typeof PENDING_TRANSFER_KINDS)[number];
|
|
176
|
+
/** awaiting: account shown and still payable; processing: Paystack waits on the bank. */
|
|
177
|
+
export type PendingTransferState = 'awaiting' | 'processing';
|
|
178
|
+
/** A plan change or extra-seats checkout paid by bank transfer that is not settled yet. */
|
|
179
|
+
export interface PendingTransfer {
|
|
180
|
+
reference: string;
|
|
181
|
+
kind: PendingTransferKind;
|
|
182
|
+
state: PendingTransferState;
|
|
183
|
+
description: string;
|
|
184
|
+
amountUsd: number;
|
|
185
|
+
amountNgn: number;
|
|
186
|
+
createdAt: string;
|
|
187
|
+
expiresAt: string;
|
|
188
|
+
authorizationUrl: string | null;
|
|
189
|
+
seats: number | null;
|
|
190
|
+
planName: string | null;
|
|
191
|
+
}
|
|
192
|
+
export interface PendingTransfersResult {
|
|
193
|
+
pending: PendingTransfer[];
|
|
194
|
+
}
|
|
195
|
+
/** Body of `POST subscriptions/extra-seats`. */
|
|
196
|
+
export interface PurchaseExtraSeatsPayload {
|
|
197
|
+
quantity: number;
|
|
198
|
+
/** bank_transfer always opens a transfer checkout; card (or unset) charges the saved card when there is one. */
|
|
199
|
+
paymentMethod?: PaymentChannel;
|
|
200
|
+
}
|
|
201
|
+
/** Transfer or first-time card: finish with `verifyExtraSeats(reference)`. */
|
|
202
|
+
export interface ExtraSeatsCheckout {
|
|
203
|
+
status: 'pending';
|
|
204
|
+
authorizationUrl: string;
|
|
205
|
+
/** Paystack access code for Paystack Inline; empty for crypto. */
|
|
206
|
+
accessCode?: string;
|
|
207
|
+
reference: string;
|
|
208
|
+
seats: number;
|
|
209
|
+
proratedUsd: number;
|
|
210
|
+
totalNgn: number;
|
|
211
|
+
remainingDays: number;
|
|
212
|
+
periodEnd: string;
|
|
213
|
+
paymentMethod: PaymentChannel;
|
|
214
|
+
expiresAt: string | null;
|
|
215
|
+
}
|
|
216
|
+
/** Saved card charged right away. */
|
|
217
|
+
export interface ExtraSeatsPaid {
|
|
218
|
+
status: 'success';
|
|
219
|
+
seats: number;
|
|
220
|
+
proratedUsd: number;
|
|
221
|
+
totalNgn: number;
|
|
222
|
+
remainingDays: number;
|
|
223
|
+
newExtraSeats: number;
|
|
224
|
+
newMaxMembers: number;
|
|
225
|
+
paymentMethod: 'card';
|
|
226
|
+
}
|
|
227
|
+
export type ExtraSeatsResult = ExtraSeatsCheckout | ExtraSeatsPaid;
|
|
228
|
+
/** `POST subscriptions/storage/addons/:purchaseId/auto-renew`. */
|
|
229
|
+
export interface StorageAddonView {
|
|
230
|
+
id: string;
|
|
231
|
+
name: string;
|
|
232
|
+
gb: number;
|
|
233
|
+
/** Paid coverage end (ISO). */
|
|
234
|
+
paidUntil: string;
|
|
235
|
+
/** Access end (ISO): the paid end, or the plan renewal day + 1 while auto-renew is on. */
|
|
236
|
+
expiresAt: string;
|
|
237
|
+
autoRenew: boolean;
|
|
238
|
+
renewsAt: string | null;
|
|
239
|
+
canAutoRenew: boolean;
|
|
240
|
+
blockedReason: string | null;
|
|
241
|
+
monthlyUsd: number;
|
|
242
|
+
periodUsd: number;
|
|
243
|
+
channel: 'card' | 'bank_transfer' | null;
|
|
244
|
+
line: string;
|
|
245
|
+
}
|
|
246
|
+
export declare const API_KEY_MAX_ORIGINS = 20;
|
|
247
|
+
/** Part of the message when a key with `allowedOrigins` is used from another site (HTTP 403, socket `connect_error`). */
|
|
248
|
+
export declare const API_KEY_ORIGIN_ERROR_MARKER = "isn't allowed from";
|
|
249
|
+
/** True for the 403 / socket `connect_error` raised when an API key is used from a site not on its allowed origins. */
|
|
250
|
+
export declare function isApiKeyOriginError(err: {
|
|
251
|
+
message?: unknown;
|
|
252
|
+
} | string | null | undefined): boolean;
|
|
253
|
+
/** Body of `POST api-keys`. `allowedOrigins`: acme.com, https://app.acme.com or *.acme.com; empty = any site. */
|
|
254
|
+
export interface CreateApiKeyPayload {
|
|
255
|
+
name: string;
|
|
256
|
+
description?: string;
|
|
257
|
+
allowedOrigins?: string[];
|
|
258
|
+
}
|
|
259
|
+
/** Body of `PATCH api-keys/:keyId`. */
|
|
260
|
+
export interface UpdateApiKeyPayload {
|
|
261
|
+
name?: string;
|
|
262
|
+
description?: string;
|
|
263
|
+
/** Replaces the list; `[]` allows any site again. */
|
|
264
|
+
allowedOrigins?: string[];
|
|
265
|
+
}
|
|
266
|
+
/** A key row. The secret value is only returned when the key is created or rotated. */
|
|
267
|
+
export interface ApiKeyView {
|
|
268
|
+
_id: string;
|
|
269
|
+
name: string;
|
|
270
|
+
description?: string;
|
|
271
|
+
status: string;
|
|
272
|
+
allowedOrigins?: string[];
|
|
273
|
+
[key: string]: unknown;
|
|
274
|
+
}
|
|
275
|
+
/** `GET api-keys/:keyId/usage`: one entry per day, oldest first, gaps filled with 0. */
|
|
276
|
+
export interface ApiKeyUsage {
|
|
277
|
+
labels: string[];
|
|
278
|
+
requests: number[];
|
|
279
|
+
errors: number[];
|
|
280
|
+
}
|
|
281
|
+
export type ApiKeyUsagePeriod = '7d' | '30d' | '90d';
|
|
282
|
+
export type CallHistoryKind = 'call' | 'huddle' | 'meeting';
|
|
283
|
+
/** One ended call; the same conversation appears once per call. */
|
|
284
|
+
export interface CallHistoryItem {
|
|
285
|
+
sessionId: string;
|
|
286
|
+
conversationId: string;
|
|
287
|
+
conversationCode: string;
|
|
288
|
+
conversationType: string;
|
|
289
|
+
/** Who: the other person on a 1:1, else the conversation name. */
|
|
290
|
+
title: string;
|
|
291
|
+
peerId?: string;
|
|
292
|
+
photo?: string;
|
|
293
|
+
mode: 'NOW' | 'CIRCLE' | 'MEETING';
|
|
294
|
+
kind: CallHistoryKind;
|
|
295
|
+
media: 'voice' | 'video';
|
|
296
|
+
direction: 'outgoing' | 'incoming';
|
|
297
|
+
/** A ring you neither started nor joined; huddles and meetings are never missed. */
|
|
298
|
+
missed: boolean;
|
|
299
|
+
durationSec: number;
|
|
300
|
+
startedAt: string;
|
|
301
|
+
endedAt: string;
|
|
302
|
+
/** You declined the ring. */
|
|
303
|
+
declined: boolean;
|
|
304
|
+
/** People who joined the call. */
|
|
305
|
+
participantCount: number;
|
|
306
|
+
}
|
|
307
|
+
export interface UpcomingMeetingItem {
|
|
308
|
+
conversationId: string;
|
|
309
|
+
conversationCode: string;
|
|
310
|
+
title: string;
|
|
311
|
+
startAt: string;
|
|
312
|
+
endAt?: string;
|
|
313
|
+
}
|
|
314
|
+
export interface CallHistoryQuery {
|
|
315
|
+
[key: string]: string | undefined;
|
|
316
|
+
/** Page number from the last response. */
|
|
317
|
+
nextCursor?: string;
|
|
318
|
+
/** Default and max 20. */
|
|
319
|
+
limit?: string;
|
|
320
|
+
/** all (default), missed (rung, never joined) or history (calls you made or joined). Upcoming meetings come with all only. */
|
|
321
|
+
view?: 'all' | 'missed' | 'history';
|
|
322
|
+
}
|
|
323
|
+
export interface CallHistoryPage {
|
|
324
|
+
results: CallHistoryItem[];
|
|
325
|
+
/** Page 1 only: up to 3 scheduled meetings. */
|
|
326
|
+
upcoming: UpcomingMeetingItem[];
|
|
327
|
+
nextCursor: string | null;
|
|
328
|
+
prevCursor: string | null;
|
|
329
|
+
hasMore: boolean;
|
|
330
|
+
hasPrev: boolean;
|
|
331
|
+
limit: number;
|
|
332
|
+
}
|
|
333
|
+
/** Body of the public `POST /public/contact`. */
|
|
334
|
+
export interface ContactMessagePayload {
|
|
335
|
+
/** ≤ 100 chars. */
|
|
336
|
+
name: string;
|
|
337
|
+
email: string;
|
|
338
|
+
/** 5–4000 chars. */
|
|
339
|
+
message: string;
|
|
340
|
+
/** Honeypot: leave empty. */
|
|
341
|
+
website?: string;
|
|
342
|
+
}
|
|
343
|
+
export interface ContactMessageResult {
|
|
344
|
+
success: boolean;
|
|
345
|
+
message: string;
|
|
346
|
+
}
|
|
347
|
+
/** Why `GET users/google/callback` sent the browser back to the login page (`?google_error=`). */
|
|
348
|
+
export declare const GOOGLE_SIGN_IN_ERRORS: readonly ["not_configured", "state", "exchange", "invalid_token", "expired", "email_unverified", "no_account", "linked_elsewhere", "denied"];
|
|
349
|
+
export type GoogleSignInError = (typeof GOOGLE_SIGN_IN_ERRORS)[number];
|
|
350
|
+
/** Body of `POST users/google/redeem`: the one-time handoff in the login page URL (`#google=<handoff>`). */
|
|
351
|
+
export interface GoogleRedeemPayload {
|
|
352
|
+
handoff: string;
|
|
353
|
+
}
|
|
@@ -0,0 +1,78 @@
|
|
|
1
|
+
export type IncomingWebhookStatus = 'active' | 'revoked';
|
|
2
|
+
/** Limits the server enforces (it answers 400, 429 or 413 past them). */
|
|
3
|
+
export declare const INCOMING_WEBHOOK_LIMITS: {
|
|
4
|
+
readonly nameMax: 60;
|
|
5
|
+
readonly botNameMax: 40;
|
|
6
|
+
readonly textMax: 7500;
|
|
7
|
+
readonly iconUrlMax: 500;
|
|
8
|
+
readonly activePerConversation: 10;
|
|
9
|
+
readonly blocksMax: 20;
|
|
10
|
+
readonly attachmentsMax: 10;
|
|
11
|
+
readonly postsPerMinutePerUrl: 150;
|
|
12
|
+
readonly bodyMaxBytes: number;
|
|
13
|
+
readonly listPageSize: 20;
|
|
14
|
+
};
|
|
15
|
+
/** One hook. The secret and its hash are never returned; `url` is set only by create and regenerate, once. */
|
|
16
|
+
export interface IncomingWebhook {
|
|
17
|
+
id: string;
|
|
18
|
+
conversationId: string;
|
|
19
|
+
chatLinkId: string;
|
|
20
|
+
name: string;
|
|
21
|
+
/** The name shown on its posts (defaults to `name`). */
|
|
22
|
+
botName: string;
|
|
23
|
+
/** https picture shown on its posts, or an empty string. */
|
|
24
|
+
botAvatar: string;
|
|
25
|
+
status: IncomingWebhookStatus;
|
|
26
|
+
/** The last four characters of the secret, to tell hooks apart. */
|
|
27
|
+
tokenHint: string;
|
|
28
|
+
createdBy: string;
|
|
29
|
+
createdByName: string;
|
|
30
|
+
createdAt: string;
|
|
31
|
+
lastUsedAt: string | null;
|
|
32
|
+
/** Posts delivered. */
|
|
33
|
+
messageCount: number;
|
|
34
|
+
/** Posts refused (bad body, over a limit, locked or expired). */
|
|
35
|
+
rejectedCount: number;
|
|
36
|
+
revokedAt: string | null;
|
|
37
|
+
regeneratedAt: string | null;
|
|
38
|
+
/** The full secret URL (`https://<host>/hooks/in/lhk_...`). Present once: store it now. */
|
|
39
|
+
url?: string;
|
|
40
|
+
}
|
|
41
|
+
export interface IncomingWebhookPage {
|
|
42
|
+
results: IncomingWebhook[];
|
|
43
|
+
nextCursor: string | null;
|
|
44
|
+
prevCursor: string | null;
|
|
45
|
+
hasMore: boolean;
|
|
46
|
+
hasPrev: boolean;
|
|
47
|
+
}
|
|
48
|
+
export interface IncomingWebhooksQuery {
|
|
49
|
+
/** Default `active`. */
|
|
50
|
+
status?: IncomingWebhookStatus | 'all';
|
|
51
|
+
nextCursor?: string;
|
|
52
|
+
/** 1 to 20. */
|
|
53
|
+
limit?: number;
|
|
54
|
+
}
|
|
55
|
+
export interface CreateIncomingWebhookPayload {
|
|
56
|
+
name: string;
|
|
57
|
+
/** Name shown on its posts; defaults to `name`. */
|
|
58
|
+
botName?: string;
|
|
59
|
+
/** https picture URL shown on its posts. */
|
|
60
|
+
botAvatar?: string;
|
|
61
|
+
}
|
|
62
|
+
export interface UpdateIncomingWebhookPayload {
|
|
63
|
+
name?: string;
|
|
64
|
+
botName?: string;
|
|
65
|
+
botAvatar?: string;
|
|
66
|
+
}
|
|
67
|
+
/** Body of `POST /hooks/in/:token`. `text` is needed unless `blocks` or `attachments` carry some. */
|
|
68
|
+
export interface IncomingWebhookMessagePayload {
|
|
69
|
+
text?: string;
|
|
70
|
+
/** Name for this post only (40 characters). */
|
|
71
|
+
username?: string;
|
|
72
|
+
/** Picture for this post only (https). */
|
|
73
|
+
icon_url?: string;
|
|
74
|
+
/** A simple subset of Slack blocks (header, section, context, divider; up to 20). */
|
|
75
|
+
blocks?: Array<Record<string, unknown>>;
|
|
76
|
+
/** A simple subset of Slack attachments (title, title_link, text, fields, footer; up to 10). */
|
|
77
|
+
attachments?: Array<Record<string, unknown>>;
|
|
78
|
+
}
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
export * from './events';
|
|
2
|
+
export * from './models';
|
|
3
|
+
export * from './options';
|
|
4
|
+
export * from './content';
|
|
5
|
+
export * from './chat-features';
|
|
6
|
+
export * from './chat-core';
|
|
7
|
+
export * from './workspace';
|
|
8
|
+
export * from './billing';
|
|
9
|
+
export * from './extras';
|
|
10
|
+
export * from './liveflex';
|
|
11
|
+
export * from './calendar';
|
|
12
|
+
export * from './workspace-gifs';
|
|
13
|
+
export * from './shared-channels';
|
|
14
|
+
export * from './incoming-webhooks';
|
|
15
|
+
export * from './csat';
|