@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.
Files changed (246) hide show
  1. package/CHANGELOG.md +228 -0
  2. package/LICENSE +21 -0
  3. package/README.md +2558 -2
  4. package/bin/chatta.mjs +7 -0
  5. package/bin/lib/cli.d.mts +46 -0
  6. package/bin/lib/cli.mjs +2088 -0
  7. package/dist/cjs/livechatta.cjs.js +7259 -0
  8. package/dist/cjs/livechatta.cjs.js.map +1 -0
  9. package/dist/cjs/livechatta.cjs.min.js +2 -0
  10. package/dist/cjs/livechatta.cjs.min.js.map +1 -0
  11. package/dist/esm/livechatta.esm.js +7078 -0
  12. package/dist/esm/livechatta.esm.js.map +1 -0
  13. package/dist/esm/livechatta.esm.min.js +2 -0
  14. package/dist/esm/livechatta.esm.min.js.map +1 -0
  15. package/dist/platforms/android/LiveChattaClient.kt +367 -0
  16. package/dist/platforms/android/LiveChattaHttpAPI.kt +2630 -0
  17. package/dist/platforms/android/LiveChattaJson.kt +83 -0
  18. package/dist/platforms/android/LiveChattaModels.kt +22805 -0
  19. package/dist/platforms/android/LiveChattaSentFrom.kt +30 -0
  20. package/dist/platforms/android/LiveChattaSocketAPI.kt +2113 -0
  21. package/dist/platforms/android/LiveChattaTyped.kt +239 -0
  22. package/dist/platforms/android/LiveChattaWebView.kt +158 -0
  23. package/dist/platforms/angular/livechatta-bridge.service.d.ts +35 -0
  24. package/dist/platforms/angular/livechatta-bridge.service.js +1 -0
  25. package/dist/platforms/angular/livechatta-bridge.service.js.map +1 -0
  26. package/dist/platforms/angular/livechatta-embed.component.d.ts +46 -0
  27. package/dist/platforms/angular/livechatta-embed.component.js +1 -0
  28. package/dist/platforms/angular/livechatta-embed.component.js.map +1 -0
  29. package/dist/platforms/angular/livechatta.service.d.ts +66 -0
  30. package/dist/platforms/angular/livechatta.service.js +1 -0
  31. package/dist/platforms/angular/livechatta.service.js.map +1 -0
  32. package/dist/platforms/capacitor/CapacitorBridge.d.ts +27 -0
  33. package/dist/platforms/capacitor/CapacitorBridge.js +1 -0
  34. package/dist/platforms/capacitor/CapacitorBridge.js.map +1 -0
  35. package/dist/platforms/capacitor/CapacitorDeepLinks.d.ts +23 -0
  36. package/dist/platforms/capacitor/CapacitorDeepLinks.js +1 -0
  37. package/dist/platforms/capacitor/CapacitorDeepLinks.js.map +1 -0
  38. package/dist/platforms/capacitor/CapacitorPermissions.d.ts +29 -0
  39. package/dist/platforms/capacitor/CapacitorPermissions.js +1 -0
  40. package/dist/platforms/capacitor/CapacitorPermissions.js.map +1 -0
  41. package/dist/platforms/capacitor/CapacitorPush.d.ts +33 -0
  42. package/dist/platforms/capacitor/CapacitorPush.js +1 -0
  43. package/dist/platforms/capacitor/CapacitorPush.js.map +1 -0
  44. package/dist/platforms/capacitor/index.d.ts +24 -0
  45. package/dist/platforms/capacitor/index.js +1 -0
  46. package/dist/platforms/capacitor/index.js.map +1 -0
  47. package/dist/platforms/flutter/livechatta_client.dart +359 -0
  48. package/dist/platforms/flutter/livechatta_http_api.dart +1942 -0
  49. package/dist/platforms/flutter/livechatta_json.dart +57 -0
  50. package/dist/platforms/flutter/livechatta_models.dart +23531 -0
  51. package/dist/platforms/flutter/livechatta_sent_from.dart +35 -0
  52. package/dist/platforms/flutter/livechatta_socket_api.dart +1504 -0
  53. package/dist/platforms/flutter/livechatta_typed.dart +234 -0
  54. package/dist/platforms/flutter/livechatta_webview.dart +190 -0
  55. package/dist/platforms/ios/LiveChattaClient.swift +374 -0
  56. package/dist/platforms/ios/LiveChattaHttpAPI.swift +2431 -0
  57. package/dist/platforms/ios/LiveChattaJSON.swift +84 -0
  58. package/dist/platforms/ios/LiveChattaModels.swift +27050 -0
  59. package/dist/platforms/ios/LiveChattaSentFrom.swift +32 -0
  60. package/dist/platforms/ios/LiveChattaSocketAPI.swift +1446 -0
  61. package/dist/platforms/ios/LiveChattaTyped.swift +268 -0
  62. package/dist/platforms/ios/LiveChattaWebView.swift +191 -0
  63. package/dist/platforms/nuxt/LiveChattaView.d.ts +1 -0
  64. package/dist/platforms/nuxt/LiveChattaView.js +1 -0
  65. package/dist/platforms/nuxt/LiveChattaView.js.map +1 -0
  66. package/dist/platforms/nuxt/useChattaBridge.d.ts +9 -0
  67. package/dist/platforms/nuxt/useChattaBridge.js +1 -0
  68. package/dist/platforms/nuxt/useChattaBridge.js.map +1 -0
  69. package/dist/platforms/nuxt/useLiveChatta.d.ts +63 -0
  70. package/dist/platforms/nuxt/useLiveChatta.js +1 -0
  71. package/dist/platforms/nuxt/useLiveChatta.js.map +1 -0
  72. package/dist/platforms/react/LiveChattaView.d.ts +58 -0
  73. package/dist/platforms/react/LiveChattaView.js +1 -0
  74. package/dist/platforms/react/LiveChattaView.js.map +1 -0
  75. package/dist/platforms/react/useChattaBridge.d.ts +1 -0
  76. package/dist/platforms/react/useChattaBridge.js +1 -0
  77. package/dist/platforms/react/useChattaBridge.js.map +1 -0
  78. package/dist/platforms/react/useChattaDeepLink.d.ts +2 -0
  79. package/dist/platforms/react/useChattaDeepLink.js +1 -0
  80. package/dist/platforms/react/useChattaDeepLink.js.map +1 -0
  81. package/dist/platforms/react/useChattaPermissions.d.ts +9 -0
  82. package/dist/platforms/react/useChattaPermissions.js +1 -0
  83. package/dist/platforms/react/useChattaPermissions.js.map +1 -0
  84. package/dist/platforms/react/useChattaUnread.d.ts +1 -0
  85. package/dist/platforms/react/useChattaUnread.js +1 -0
  86. package/dist/platforms/react/useChattaUnread.js.map +1 -0
  87. package/dist/platforms/react/useLiveChatta.d.ts +29 -0
  88. package/dist/platforms/react/useLiveChatta.js +1 -0
  89. package/dist/platforms/react/useLiveChatta.js.map +1 -0
  90. package/dist/platforms/react-native/LiveChattaView.d.ts +52 -0
  91. package/dist/platforms/react-native/LiveChattaView.js +1 -0
  92. package/dist/platforms/react-native/LiveChattaView.js.map +1 -0
  93. package/dist/platforms/react-native/useChattaBridge.d.ts +12 -0
  94. package/dist/platforms/react-native/useChattaBridge.js +1 -0
  95. package/dist/platforms/react-native/useChattaBridge.js.map +1 -0
  96. package/dist/platforms/react-native/useLiveChatta.d.ts +29 -0
  97. package/dist/platforms/react-native/useLiveChatta.js +1 -0
  98. package/dist/platforms/react-native/useLiveChatta.js.map +1 -0
  99. package/dist/platforms/svelte/LiveChattaEmbed.d.ts +54 -0
  100. package/dist/platforms/svelte/LiveChattaEmbed.js +1 -0
  101. package/dist/platforms/svelte/LiveChattaEmbed.js.map +1 -0
  102. package/dist/platforms/svelte/chattaBridgeStore.d.ts +19 -0
  103. package/dist/platforms/svelte/chattaBridgeStore.js +1 -0
  104. package/dist/platforms/svelte/chattaBridgeStore.js.map +1 -0
  105. package/dist/platforms/svelte/useLiveChatta.d.ts +61 -0
  106. package/dist/platforms/svelte/useLiveChatta.js +1 -0
  107. package/dist/platforms/svelte/useLiveChatta.js.map +1 -0
  108. package/dist/platforms/tauri/TauriBridge.d.ts +34 -0
  109. package/dist/platforms/tauri/TauriBridge.js +1 -0
  110. package/dist/platforms/tauri/TauriBridge.js.map +1 -0
  111. package/dist/platforms/tauri/TauriDeepLinks.d.ts +29 -0
  112. package/dist/platforms/tauri/TauriDeepLinks.js +1 -0
  113. package/dist/platforms/tauri/TauriDeepLinks.js.map +1 -0
  114. package/dist/platforms/tauri/TauriPermissions.d.ts +21 -0
  115. package/dist/platforms/tauri/TauriPermissions.js +1 -0
  116. package/dist/platforms/tauri/TauriPermissions.js.map +1 -0
  117. package/dist/platforms/tauri/TauriUpdater.d.ts +31 -0
  118. package/dist/platforms/tauri/TauriUpdater.js +1 -0
  119. package/dist/platforms/tauri/TauriUpdater.js.map +1 -0
  120. package/dist/platforms/tauri/index.d.ts +22 -0
  121. package/dist/platforms/tauri/index.js +1 -0
  122. package/dist/platforms/tauri/index.js.map +1 -0
  123. package/dist/platforms/vue/LiveChattaView.d.ts +1 -0
  124. package/dist/platforms/vue/LiveChattaView.js +1 -0
  125. package/dist/platforms/vue/LiveChattaView.js.map +1 -0
  126. package/dist/platforms/vue/useChattaBridge.d.ts +11 -0
  127. package/dist/platforms/vue/useChattaBridge.js +1 -0
  128. package/dist/platforms/vue/useChattaBridge.js.map +1 -0
  129. package/dist/platforms/vue/useChattaDeepLink.d.ts +2 -0
  130. package/dist/platforms/vue/useChattaDeepLink.js +1 -0
  131. package/dist/platforms/vue/useChattaDeepLink.js.map +1 -0
  132. package/dist/platforms/vue/useChattaPermissions.d.ts +9 -0
  133. package/dist/platforms/vue/useChattaPermissions.js +1 -0
  134. package/dist/platforms/vue/useChattaPermissions.js.map +1 -0
  135. package/dist/platforms/vue/useChattaUnread.d.ts +8 -0
  136. package/dist/platforms/vue/useChattaUnread.js +1 -0
  137. package/dist/platforms/vue/useChattaUnread.js.map +1 -0
  138. package/dist/platforms/vue/useLiveChatta.d.ts +58 -0
  139. package/dist/platforms/vue/useLiveChatta.js +1 -0
  140. package/dist/platforms/vue/useLiveChatta.js.map +1 -0
  141. package/dist/platforms/web/LiveChattaEmbed.d.ts +94 -0
  142. package/dist/platforms/web/LiveChattaEmbed.js +1 -0
  143. package/dist/platforms/web/LiveChattaEmbed.js.map +1 -0
  144. package/dist/platforms/web/bridge.d.ts +8 -0
  145. package/dist/platforms/web/bridge.js +1 -0
  146. package/dist/platforms/web/bridge.js.map +1 -0
  147. package/dist/platforms/web/permissions.d.ts +8 -0
  148. package/dist/platforms/web/permissions.js +1 -0
  149. package/dist/platforms/web/permissions.js.map +1 -0
  150. package/dist/types/billing.d.ts +355 -0
  151. package/dist/types/billing.js +53 -0
  152. package/dist/types/billing.js.map +1 -0
  153. package/dist/types/calendar.d.ts +132 -0
  154. package/dist/types/calendar.js +15 -0
  155. package/dist/types/calendar.js.map +1 -0
  156. package/dist/types/chat-core.d.ts +901 -0
  157. package/dist/types/chat-core.js +98 -0
  158. package/dist/types/chat-core.js.map +1 -0
  159. package/dist/types/chat-features.d.ts +775 -0
  160. package/dist/types/chat-features.js +50 -0
  161. package/dist/types/chat-features.js.map +1 -0
  162. package/dist/types/content.d.ts +138 -0
  163. package/dist/types/content.js +2 -0
  164. package/dist/types/content.js.map +1 -0
  165. package/dist/types/core/AutoRefresh.d.ts +68 -0
  166. package/dist/types/core/Bridge.d.ts +124 -0
  167. package/dist/types/core/Config.d.ts +26 -0
  168. package/dist/types/core/DeepLinks.d.ts +38 -0
  169. package/dist/types/core/EventBus.d.ts +15 -0
  170. package/dist/types/core/GrantStore.d.ts +29 -0
  171. package/dist/types/core/LiveChatta.d.ts +128 -0
  172. package/dist/types/core/Permissions.d.ts +34 -0
  173. package/dist/types/core/TokenManager.d.ts +25 -0
  174. package/dist/types/core/events.d.ts +140 -0
  175. package/dist/types/csat.d.ts +110 -0
  176. package/dist/types/csat.js +12 -0
  177. package/dist/types/csat.js.map +1 -0
  178. package/dist/types/events.d.ts +242 -0
  179. package/dist/types/events.js +275 -0
  180. package/dist/types/events.js.map +1 -0
  181. package/dist/types/extras.d.ts +353 -0
  182. package/dist/types/extras.js +31 -0
  183. package/dist/types/extras.js.map +1 -0
  184. package/dist/types/http/HttpAPI.d.ts +944 -0
  185. package/dist/types/http/HttpTransport.d.ts +66 -0
  186. package/dist/types/http/incomingWebhook.d.ts +17 -0
  187. package/dist/types/incoming-webhooks.d.ts +78 -0
  188. package/dist/types/incoming-webhooks.js +16 -0
  189. package/dist/types/incoming-webhooks.js.map +1 -0
  190. package/dist/types/index.d.ts +15 -0
  191. package/dist/types/index.js +16 -0
  192. package/dist/types/index.js.map +1 -0
  193. package/dist/types/liveflex.d.ts +578 -0
  194. package/dist/types/liveflex.js +7 -0
  195. package/dist/types/liveflex.js.map +1 -0
  196. package/dist/types/models.d.ts +1753 -0
  197. package/dist/types/models.js +148 -0
  198. package/dist/types/models.js.map +1 -0
  199. package/dist/types/options.d.ts +190 -0
  200. package/dist/types/options.js +43 -0
  201. package/dist/types/options.js.map +1 -0
  202. package/dist/types/shared-channels.d.ts +236 -0
  203. package/dist/types/shared-channels.js +50 -0
  204. package/dist/types/shared-channels.js.map +1 -0
  205. package/dist/types/socket/SocketAPI.d.ts +1026 -0
  206. package/dist/types/socket/SocketTransport.d.ts +44 -0
  207. package/dist/types/types/billing.d.ts +355 -0
  208. package/dist/types/types/calendar.d.ts +132 -0
  209. package/dist/types/types/chat-core.d.ts +901 -0
  210. package/dist/types/types/chat-features.d.ts +775 -0
  211. package/dist/types/types/content.d.ts +138 -0
  212. package/dist/types/types/csat.d.ts +110 -0
  213. package/dist/types/types/events.d.ts +242 -0
  214. package/dist/types/types/extras.d.ts +353 -0
  215. package/dist/types/types/incoming-webhooks.d.ts +78 -0
  216. package/dist/types/types/index.d.ts +15 -0
  217. package/dist/types/types/liveflex.d.ts +578 -0
  218. package/dist/types/types/models.d.ts +1753 -0
  219. package/dist/types/types/options.d.ts +190 -0
  220. package/dist/types/types/shared-channels.d.ts +236 -0
  221. package/dist/types/types/workspace-gifs.d.ts +95 -0
  222. package/dist/types/types/workspace.d.ts +390 -0
  223. package/dist/types/ui/EmbedConfig.d.ts +38 -0
  224. package/dist/types/ui/EmbedUI.d.ts +44 -0
  225. package/dist/types/ui/Launcher.d.ts +122 -0
  226. package/dist/types/ui/brand.d.ts +27 -0
  227. package/dist/types/ui/embedMessages.d.ts +23 -0
  228. package/dist/types/ui/hours.d.ts +35 -0
  229. package/dist/types/ui/prechat.d.ts +35 -0
  230. package/dist/types/ui/widgetConfig.d.ts +4 -0
  231. package/dist/types/utils/crypto.d.ts +6 -0
  232. package/dist/types/utils/hmac.d.ts +40 -0
  233. package/dist/types/utils/permissions.d.ts +5 -0
  234. package/dist/types/utils/platform.d.ts +18 -0
  235. package/dist/types/utils/visitor.d.ts +2 -0
  236. package/dist/types/workspace-gifs.d.ts +95 -0
  237. package/dist/types/workspace-gifs.js +3 -0
  238. package/dist/types/workspace-gifs.js.map +1 -0
  239. package/dist/types/workspace.d.ts +390 -0
  240. package/dist/types/workspace.js +13 -0
  241. package/dist/types/workspace.js.map +1 -0
  242. package/dist/umd/livechatta.umd.js +7263 -0
  243. package/dist/umd/livechatta.umd.js.map +1 -0
  244. package/dist/umd/livechatta.umd.min.js +2 -0
  245. package/dist/umd/livechatta.umd.min.js.map +1 -0
  246. package/package.json +274 -4
@@ -0,0 +1,578 @@
1
+ export type LiveFlexProvider = 'paystack' | 'cryptomus' | 'wallet';
2
+ export type LiveFlexTxnKind = 'fund' | 'withdraw' | 'transfer_in' | 'transfer_out' | 'gift_sent' | 'gift_received' | 'payment' | 'refund' | 'migration' | 'pot_out' | 'pot_payout' | 'pot_refund' | 'refund_out' | 'refund_in' | 'pay_link' | 'withdraw_reversal';
3
+ export type LiveFlexTxnStatus = 'pending' | 'success' | 'failed';
4
+ export interface LiveFlexWithdrawLimits {
5
+ minMinor: number;
6
+ maxMinor: number;
7
+ dailyMinor: number;
8
+ usedTodayMinor: number;
9
+ }
10
+ /** Coins and networks a crypto payout can go to (USDT and USDC first). */
11
+ export interface LiveFlexCryptoCoin {
12
+ currency: string;
13
+ label: string;
14
+ networks: {
15
+ code: string;
16
+ label: string;
17
+ }[];
18
+ }
19
+ /** `GET /wallet`: your balance, masked payout details, limits and holds. */
20
+ export interface LiveFlexView {
21
+ id: string;
22
+ currency: string;
23
+ balanceMinor: number;
24
+ pendingWithdrawMinor: number;
25
+ lifetimeInMinor: number;
26
+ lifetimeOutMinor: number;
27
+ payoutBank: {
28
+ bankCode: string;
29
+ bankName: string;
30
+ accountName: string;
31
+ accountLast4: string;
32
+ } | null;
33
+ payoutCrypto: {
34
+ currency: string;
35
+ network: string;
36
+ addressHint: string;
37
+ } | null;
38
+ /** Withdrawals open again at this time after a payout change (null = open). */
39
+ payoutHoldUntil: string | null;
40
+ /** 1.5.8: received in a member's first 24 h; can't be sent on or withdrawn until `heldUntil`. */
41
+ heldMinor?: number;
42
+ heldUntil?: string | null;
43
+ /** 1.5.9: sends and withdrawals over `pinOverMinor` need the LiveFlex PIN (0 = never). */
44
+ pinSet?: boolean;
45
+ pinOverMinor?: number;
46
+ pinLockedUntil?: string | null;
47
+ /** 1.6.0: why LiveFlex is off (platform, workspace or link); withdrawals still work. */
48
+ liveflexOff?: 'platform' | 'workspace' | 'link' | null;
49
+ /** 1.6.0 (members): one LiveFlex per person; `elsewhere` = one exists in another workspace to link to. */
50
+ link?: {
51
+ linked: boolean;
52
+ accounts: number;
53
+ canLink: boolean;
54
+ elsewhere: boolean;
55
+ } | null;
56
+ tag?: string | null;
57
+ /** True when this link is isolated: sends, requests, splits and account links stay inside it; withdrawals still work. The business LiveFlex is never itself isolated. */
58
+ isolated?: boolean;
59
+ /** Sends by `$tag` outside your workspaces in 24 h (`capMinor` 0 = no cap). */
60
+ crossDaily?: {
61
+ capMinor: number;
62
+ usedTodayMinor: number;
63
+ };
64
+ frozen: boolean;
65
+ frozenReason: string;
66
+ /** Where payout confirmation codes go (masked). */
67
+ confirmEmailHint: string;
68
+ serviceFeeBps: number;
69
+ serviceFeeCapMinor: number;
70
+ /** The flat network/provider fee charged on top of every crypto withdrawal (0 = none; bank withdrawals never pay it). */
71
+ cryptoProviderFeeMinor?: number;
72
+ withdrawLimits: LiveFlexWithdrawLimits;
73
+ /** The largest bank `amountMinor` you can withdraw now: amount + fee fits what is spendable, the single cap and what is left of today's limit. */
74
+ maxWithdrawMinor?: number;
75
+ /** The same for a crypto withdrawal, where the flat provider fee also has to fit. */
76
+ maxWithdrawCryptoMinor?: number;
77
+ /** False when crypto payouts are switched off for the whole platform: don't offer crypto. */
78
+ cryptoPayoutsEnabled?: boolean;
79
+ cryptoCoins: LiveFlexCryptoCoin[];
80
+ providers: {
81
+ paystack: boolean;
82
+ cryptomus: boolean;
83
+ };
84
+ }
85
+ export interface LiveFlexTransaction {
86
+ id: string;
87
+ kind: LiveFlexTxnKind;
88
+ status: LiveFlexTxnStatus;
89
+ amountMinor: number;
90
+ /** The platform fee. On a withdrawal it is inside `amountMinor`, which is the whole debit (what was paid out plus both fees). */
91
+ serviceFeeMinor: number;
92
+ /** Withdrawals only: the flat network/provider fee inside the debit (crypto; 0 or absent on bank and older rows). Kept apart from `serviceFeeMinor`. */
93
+ providerFeeMinor?: number;
94
+ /** Withdrawals only: what the bank or address received (`|amountMinor| - serviceFeeMinor - providerFeeMinor`). */
95
+ paidOutMinor?: number;
96
+ provider: LiveFlexProvider;
97
+ reference: string;
98
+ description: string;
99
+ counterpartyName?: string;
100
+ createdAt: string;
101
+ }
102
+ export interface LiveFlexTransactionPage {
103
+ results: LiveFlexTransaction[];
104
+ nextCursor: string | null;
105
+ hasMore: boolean;
106
+ }
107
+ export interface LiveFlexTransactionQuery {
108
+ cursor?: string;
109
+ limit?: string;
110
+ kind?: 'all' | LiveFlexTxnKind;
111
+ }
112
+ export interface LiveFlexFundPayload {
113
+ amountMinor: number;
114
+ provider?: 'paystack' | 'cryptomus';
115
+ }
116
+ export interface LiveFlexFundStart {
117
+ provider: LiveFlexProvider;
118
+ reference: string;
119
+ authorizationUrl: string | null;
120
+ accessCode?: string;
121
+ serviceFeeMinor: number;
122
+ totalMinor: number;
123
+ }
124
+ export interface LiveFlexFundVerify {
125
+ status: 'success' | 'pending';
126
+ reference: string;
127
+ channel?: string;
128
+ }
129
+ export interface LiveFlexRecipient {
130
+ id: string;
131
+ name: string;
132
+ handle: string;
133
+ }
134
+ export interface LiveFlexBank {
135
+ name: string;
136
+ code: string;
137
+ }
138
+ export interface LiveFlexPayoutBankPayload {
139
+ bankCode: string;
140
+ accountNumber: string;
141
+ }
142
+ export interface LiveFlexPayoutCryptoPayload {
143
+ currency: string;
144
+ network: string;
145
+ address: string;
146
+ }
147
+ /** A payout change waits for the 6-digit code emailed to you (`confirmLiveFlexPayout`). */
148
+ export interface LiveFlexPayoutPending {
149
+ pending: true;
150
+ sentTo: string;
151
+ accountName?: string;
152
+ bankName?: string;
153
+ accountLast4?: string;
154
+ addressHint?: string;
155
+ }
156
+ /**
157
+ * `amountMinor` is what the destination receives; the 1.5% fee (max 2 FlexCoin), plus a flat network/provider fee on crypto, is charged on top.
158
+ * `expectedTotalMinor`: the total you showed; if the fees changed, the call fails with `FEES_CHANGED` and takes nothing.
159
+ */
160
+ export interface LiveFlexWithdrawPayload {
161
+ amountMinor: number;
162
+ method: 'bank' | 'crypto';
163
+ pin?: string;
164
+ expectedTotalMinor?: number;
165
+ }
166
+ /**
167
+ * `netMinor` is what the destination receives (the amount you asked for), `serviceFeeMinor` the platform fee on top, `providerFeeMinor` the flat network/provider fee on top (crypto only),
168
+ * `totalMinor` = all three, what left your LiveFlex. `processing: true` means the provider has not confirmed yet: show "processing", not "sent". `provider` is the payout rail. */
169
+ export interface LiveFlexPayoutResult {
170
+ reference: string;
171
+ status: 'pending' | 'success';
172
+ netMinor: number;
173
+ serviceFeeMinor: number;
174
+ providerFeeMinor?: number;
175
+ totalMinor: number;
176
+ destination: string;
177
+ processing?: boolean;
178
+ provider?: 'paystack' | 'cryptomus';
179
+ }
180
+ /** `POST /wallet/send`: a member (`recipientId`) or the business here, or anyone by `toTag` (1.6.0; first time needs the emailed `code`). */
181
+ export interface LiveFlexSendPayload {
182
+ recipientId?: string;
183
+ toBusiness?: 'business';
184
+ toTag?: string;
185
+ amountMinor: number;
186
+ note?: string;
187
+ idempotencyKey?: string;
188
+ pin?: string;
189
+ code?: string;
190
+ }
191
+ export interface LiveFlexLinkResult {
192
+ linked: true;
193
+ movedMinor: number;
194
+ accounts: number;
195
+ }
196
+ /** 1.6.0: `LIVEFLEX_OFF`; `LIVEFLEX_CODE_REQUIRED` / `_WRONG` on a first send by tag (code emailed to you). `WORKSPACE_ISOLATED` (403): a link on either side is isolated. `FEES_CHANGED` (400): the withdrawal's `expectedTotalMinor` is stale. */
197
+ export declare const LIVEFLEX_ERRORS: readonly ["LIVEFLEX_OFF", "LIVEFLEX_CODE_REQUIRED", "LIVEFLEX_CODE_WRONG", "WORKSPACE_ISOLATED", "FEES_CHANGED"];
198
+ export type LiveFlexError = (typeof LIVEFLEX_ERRORS)[number];
199
+ /** 1.5.9: errors over the PIN amount carry one of these `code`s. */
200
+ export declare const LIVEFLEX_PIN_ERRORS: readonly ["LIVEFLEX_PIN_SETUP", "LIVEFLEX_PIN_REQUIRED", "LIVEFLEX_PIN_WRONG", "LIVEFLEX_PIN_LOCKED"];
201
+ export type LiveFlexPinError = (typeof LIVEFLEX_PIN_ERRORS)[number];
202
+ export interface LiveFlexSendResult {
203
+ reference: string;
204
+ balanceMinor: number;
205
+ }
206
+ /** 1.5.8: a team admin's business send or withdrawal over the owner's threshold waits for the owner instead. */
207
+ export interface LiveFlexApprovalWaiting {
208
+ approvalRequired: true;
209
+ approvalId: string;
210
+ message: string;
211
+ }
212
+ export interface LiveFlexTeamApproval {
213
+ id: string;
214
+ ownerId: string;
215
+ actor: {
216
+ userId: string;
217
+ name: string;
218
+ isOwner: boolean;
219
+ };
220
+ op: {
221
+ kind: 'transfer' | 'refund';
222
+ toName: string;
223
+ amountMinor: number;
224
+ note: string;
225
+ } | {
226
+ kind: 'withdraw';
227
+ method: 'bank' | 'crypto';
228
+ amountMinor: number;
229
+ };
230
+ summary: string;
231
+ createdAt: string;
232
+ expiresAt: string;
233
+ }
234
+ /** Cents; 0 = off. `custom` when the owner set them for this workspace. */
235
+ export interface LiveFlexTeamLimits {
236
+ approveOverMinor: number;
237
+ dailyCapMinor: number;
238
+ custom: boolean;
239
+ }
240
+ export interface LiveFlexTeamLimitsPayload {
241
+ approveOverMinor: number | null;
242
+ dailyCapMinor: number | null;
243
+ }
244
+ export interface LiveFlexApprovalDecision {
245
+ status: 'approved' | 'declined';
246
+ summary: string;
247
+ reference?: string;
248
+ }
249
+ export type MoneyCardKind = 'request' | 'split' | 'pot' | 'paylink';
250
+ export type MoneyRequestStatus = 'pending' | 'paying' | 'paid' | 'declined' | 'cancelled' | 'expired';
251
+ /** `awaiting-owner`: a team admin's business standing payment, waiting for the owner's OK (nothing runs until then). */
252
+ export type StandingStatus = 'active' | 'paused' | 'cancelled' | 'completed' | 'awaiting-owner';
253
+ export type StandingInterval = 'week' | '2weeks' | 'month';
254
+ export type MoneyPotStatus = 'open' | 'closing' | 'closed' | 'cancelled';
255
+ export type PayLinkStatus = 'open' | 'paying' | 'paid' | 'cancelled' | 'expired';
256
+ export interface MoneyParty {
257
+ id: string;
258
+ name: string;
259
+ }
260
+ /** Name one person: a member `id` or `handle` in your workspace, or a LiveFlex `tag` (without the `$`). */
261
+ export interface MoneyPersonRef {
262
+ id?: string;
263
+ handle?: string;
264
+ tag?: string;
265
+ }
266
+ /** The payer's own confirmation: the PIN over the limit, or the emailed first-payment code. */
267
+ export interface MoneyConfirm {
268
+ pin?: string;
269
+ code?: string;
270
+ }
271
+ export interface MoneyRequestCard {
272
+ kind: 'request';
273
+ id: string;
274
+ status: MoneyRequestStatus;
275
+ requester: MoneyParty;
276
+ payer: MoneyParty;
277
+ crossWorkspace: boolean;
278
+ amountMinor: number;
279
+ note: string;
280
+ createdAt: string;
281
+ expiresAt: string;
282
+ paidAt: string | null;
283
+ refundedMinor: number;
284
+ splitId: string | null;
285
+ /** Only the requester sees the ledger id; everyone else gets `null` and uses `refundable`. */
286
+ receivedTxnId: string | null;
287
+ refundable: boolean;
288
+ }
289
+ export interface MoneySplitShare {
290
+ requestId: string;
291
+ payerId: string;
292
+ name: string;
293
+ amountMinor: number;
294
+ status: MoneyRequestStatus;
295
+ }
296
+ export interface MoneySplitCard {
297
+ kind: 'split';
298
+ id: string;
299
+ status: 'open' | 'complete' | 'cancelled';
300
+ requester: MoneyParty;
301
+ note: string;
302
+ totalMinor: number;
303
+ requesterShareMinor: number;
304
+ shares: MoneySplitShare[];
305
+ paidMinor: number;
306
+ paidCount: number;
307
+ createdAt: string;
308
+ }
309
+ export interface MoneyPotCard {
310
+ kind: 'pot';
311
+ id: string;
312
+ status: MoneyPotStatus;
313
+ organizer: MoneyParty;
314
+ title: string;
315
+ fixedMinor: number;
316
+ targetMinor: number;
317
+ collectedMinor: number;
318
+ contributorCount: number;
319
+ contributors: {
320
+ id: string;
321
+ name: string;
322
+ amountMinor: number;
323
+ }[];
324
+ closesAt: string;
325
+ createdAt: string;
326
+ paidOutMinor: number;
327
+ /** Only on a card you read (not on live updates): you may cancel and refund everyone (organizer, owner or team admin). */
328
+ viewerCanCancel?: boolean;
329
+ }
330
+ export interface MoneyPayLinkCard {
331
+ kind: 'paylink';
332
+ id: string;
333
+ status: PayLinkStatus;
334
+ description: string;
335
+ reference: string;
336
+ amountMinor: number;
337
+ businessName: string;
338
+ createdBy: MoneyParty;
339
+ expiresAt: string;
340
+ paidAt: string | null;
341
+ paidWith: 'wallet' | 'paystack' | null;
342
+ refundedMinor: number;
343
+ receivedTxnId: string | null;
344
+ refundable: boolean;
345
+ cardEnabled: boolean;
346
+ }
347
+ export type MoneyCard = MoneyRequestCard | MoneySplitCard | MoneyPotCard | MoneyPayLinkCard;
348
+ export interface MoneyRequestCreatePayload extends MoneyPersonRef {
349
+ conversationId: string;
350
+ amountMinor: number;
351
+ note?: string;
352
+ }
353
+ export interface MoneySplitCreatePayload {
354
+ conversationId: string;
355
+ totalMinor: number;
356
+ payers: (MoneyPersonRef & {
357
+ amountMinor?: number;
358
+ })[];
359
+ includeMe?: boolean;
360
+ note?: string;
361
+ }
362
+ export interface MoneyStandingCreatePayload extends MoneyPersonRef, MoneyConfirm {
363
+ amountMinor: number;
364
+ interval: StandingInterval;
365
+ startAt?: string;
366
+ until?: string;
367
+ maxRuns?: number;
368
+ note?: string;
369
+ }
370
+ export interface MoneyStanding {
371
+ id: string;
372
+ status: StandingStatus;
373
+ toName: string;
374
+ payerName: string;
375
+ amountMinor: number;
376
+ interval: StandingInterval;
377
+ nextRunAt: string | null;
378
+ startAt: string;
379
+ until: string | null;
380
+ maxRuns: number | null;
381
+ runsDone: number;
382
+ failStreak: number;
383
+ totalMinor: number | null;
384
+ fromBusiness: boolean;
385
+ note: string;
386
+ lastRunStatus: 'running' | 'success' | 'failed' | 'skipped' | 'awaiting-approval' | null;
387
+ lastRunAt: string | null;
388
+ mine: boolean;
389
+ }
390
+ export interface MoneyPotCreatePayload {
391
+ conversationId: string;
392
+ title: string;
393
+ amountMinor?: number;
394
+ goalMinor?: number;
395
+ closesAt?: string;
396
+ }
397
+ export interface MoneyRefundPayload extends MoneyConfirm {
398
+ amountMinor?: number;
399
+ note?: string;
400
+ key?: string;
401
+ }
402
+ export interface MoneyRefundResult {
403
+ reference: string;
404
+ refundedMinor: number;
405
+ remainingMinor: number;
406
+ }
407
+ export interface MoneyPayLinkCreatePayload {
408
+ conversationId: string;
409
+ amountMinor: number;
410
+ description: string;
411
+ reference?: string;
412
+ }
413
+ export interface MoneyPayLinkPayPayload extends MoneyConfirm {
414
+ method: 'wallet' | 'card';
415
+ }
416
+ export interface MoneyPayLinkPaid {
417
+ status: 'paid';
418
+ reference: string;
419
+ balanceMinor: number;
420
+ }
421
+ export interface MoneyPayLinkCheckout {
422
+ authorizationUrl: string;
423
+ reference: string;
424
+ accessCode: string;
425
+ }
426
+ /** Signed link, valid for 10 minutes and only for the person it was made for. */
427
+ export interface MoneyReceiptLink {
428
+ reference: string;
429
+ title: string;
430
+ amountMinor: number;
431
+ createdAt: string;
432
+ url: string;
433
+ }
434
+ export interface MoneyStatementLinks {
435
+ month: string;
436
+ scope: 'personal' | 'business';
437
+ pdfUrl: string;
438
+ csvUrl: string;
439
+ }
440
+ export interface MoneyCardGetPayload {
441
+ kind: MoneyCardKind;
442
+ id: string;
443
+ }
444
+ export type MoneyCardActionId = 'pay' | 'decline' | 'cancel' | 'contribute' | 'close' | 'refund' | 'wallet' | 'card' | 'block';
445
+ /** Money-moving actions answer with a private `chatta-money-card` to confirm; the rest just update the card. */
446
+ export interface MoneyCardActionPayload {
447
+ conversationId: string;
448
+ kind: MoneyCardKind;
449
+ id: string;
450
+ action: MoneyCardActionId;
451
+ amount?: number;
452
+ }
453
+ /** In-app notification `data` for money events (sent, received, funded, withdrawals, gifts). */
454
+ export interface LiveFlexNoticeData {
455
+ kind: 'liveflex' | 'gift';
456
+ event?: 'sent' | 'received' | 'funded' | 'withdraw_started' | 'withdrawn' | 'withdraw_failed' | 'gift_sent' | 'gift_received' | 'approval_needed' | 'approval_approved' | 'approval_declined' | 'approval_failed' | 'request_new' | 'request_declined' | 'request_cancelled' | 'request_expired' | 'refunded' | 'refund_sent' | 'standing_created' | 'standing_soon' | 'standing_ran' | 'standing_failed' | 'standing_paused' | 'refund_needed' | 'pot_contributed' | 'pot_paid_out' | 'pot_refunded' | 'paylink_paid' | 'paylink_paid_by_you';
457
+ reference?: string;
458
+ amountMinor?: number;
459
+ url?: string;
460
+ }
461
+ export interface StickerView {
462
+ id: string;
463
+ name: string;
464
+ url: string;
465
+ width: number;
466
+ height: number;
467
+ animated: boolean;
468
+ useCount: number;
469
+ mine?: boolean;
470
+ uploadedByMe?: boolean;
471
+ source?: 'uploaded' | 'added' | 'used';
472
+ /** The automatic content check flagged it; it still sends. */
473
+ flagged?: boolean;
474
+ /** Workspace review list only. */
475
+ review?: 'pending' | 'ok' | 'flagged';
476
+ reviewReasons?: string[];
477
+ blocked?: boolean;
478
+ fromWorkspace?: boolean;
479
+ createdAt?: string;
480
+ }
481
+ /** GET chats/stickers: review = all | flagged | ok; scope = all | workspace (your members' uploads). */
482
+ export interface WorkspaceStickerQuery {
483
+ [key: string]: string | undefined;
484
+ review?: 'all' | 'flagged' | 'ok';
485
+ scope?: 'all' | 'workspace';
486
+ q?: string;
487
+ nextCursor?: string;
488
+ }
489
+ export interface StickerPage {
490
+ results: StickerView[];
491
+ nextCursor: string | null;
492
+ hasMore: boolean;
493
+ }
494
+ export interface StickersSearchPayload {
495
+ q?: string;
496
+ nextCursor?: string;
497
+ }
498
+ /** PNG / GIF / WebP data URI, 64–512 px, ≤ 512 KB; `name` 2–40 chars; ≤ 8 tags. 30 uploads a day. */
499
+ export interface StickerUploadPayload {
500
+ image: string;
501
+ name: string;
502
+ tags?: string[];
503
+ }
504
+ export interface StickerRefPayload {
505
+ stickerId: string;
506
+ everywhere?: boolean;
507
+ }
508
+ /** A card action with a `url` is a payment page: open `accessCode` with Paystack Inline v2 to pay in place, or `url` in a new tab; then call the `verify` route with `reference`. */
509
+ export interface ChattaMoneyAction {
510
+ id: string;
511
+ label: string;
512
+ style: 'primary' | 'secondary' | 'ghost';
513
+ url?: string;
514
+ accessCode?: string;
515
+ reference?: string;
516
+ verify?: 'wallet-fund' | 'paylink';
517
+ }
518
+ /** Private card sent only to the member who typed the @chatta money request. */
519
+ export interface ChattaMoneyCard {
520
+ intentId: string;
521
+ conversationId: string;
522
+ tone: 'confirm' | 'success' | 'error' | 'info';
523
+ title: string;
524
+ lines: string[];
525
+ actions: ChattaMoneyAction[];
526
+ needsCode?: boolean;
527
+ expiresAt?: string;
528
+ referenceId?: string;
529
+ request?: string;
530
+ }
531
+ export interface ChattaMoneyConfirmPayload {
532
+ intentId: string;
533
+ actionId: string;
534
+ code?: string;
535
+ conversationId: string;
536
+ }
537
+ /** `call-logged`: the call is in the log; `missed` is true for members who were rung and didn't join. */
538
+ export interface CallLoggedEvent {
539
+ sessionId: string;
540
+ conversationId: string;
541
+ hostId: string;
542
+ media: 'voice' | 'video';
543
+ missed: boolean;
544
+ startedAt: string;
545
+ }
546
+ export interface LinkSettingsUpdatedEvent {
547
+ chatLinkId: string;
548
+ code: string;
549
+ name?: string;
550
+ mode?: string;
551
+ status?: string;
552
+ [key: string]: unknown;
553
+ }
554
+ export interface WebinarViewerCountEvent {
555
+ conversationId: string;
556
+ count: number;
557
+ }
558
+ export interface WebinarQaRefPayload {
559
+ conversationId: string;
560
+ qaId: string;
561
+ }
562
+ export interface WebinarQaAnswerLiveResult {
563
+ conversationId: string;
564
+ qaId: string;
565
+ attendeeId: string;
566
+ promoted: true;
567
+ }
568
+ export type StaffAccessGrantHours = 1 | 24 | 72 | 168;
569
+ export interface StaffAccessGrantPayload {
570
+ mode: 'view' | 'act';
571
+ hours: StaffAccessGrantHours;
572
+ }
573
+ export interface StaffAccessGrantView {
574
+ on: boolean;
575
+ mode: 'view' | 'act' | null;
576
+ until: string | null;
577
+ grantedByName: string;
578
+ }