kage-baileys 25.0.2 → 25.0.3
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/WAProto/index.js +10 -0
- package/package.json +1 -1
- package/extras/MessageBuilder/bot-signature.d.ts +0 -22
- package/extras/MessageBuilder/extras.d.ts +0 -449
- package/extras/MessageBuilder/index.d.ts +0 -210
- package/extras/MessageBuilder/metaai.d.ts +0 -438
- package/extras/WAProto/Adv/Adv.d.ts +0 -643
- package/extras/WAProto/BotMetadata/BotMetadata.d.ts +0 -5745
- package/extras/WAProto/Cert/Cert.d.ts +0 -613
- package/extras/WAProto/ChatLockSettings/ChatLockSettings.d.ts +0 -476
- package/extras/WAProto/CompanionReg/CompanionReg.d.ts +0 -1334
- package/extras/WAProto/DeviceCapabilities/DeviceCapabilities.d.ts +0 -224
- package/extras/WAProto/E2E/E2E.d.ts +0 -34368
- package/extras/WAProto/Ephemeral/Ephemeral.d.ts +0 -114
- package/extras/WAProto/HistorySync/HistorySync.d.ts +0 -48918
- package/extras/WAProto/LidMigrationSyncPayload/LidMigrationSyncPayload.d.ts +0 -217
- package/extras/WAProto/MdStorageChatRowOpaqueData/MdStorageChatRowOpaqueData.d.ts +0 -583
- package/extras/WAProto/MdStorageMsgRowOpaqueData/MdStorageMsgRowOpaqueData.d.ts +0 -35355
- package/extras/WAProto/MmsRetry/MmsRetry.d.ts +0 -243
- package/extras/WAProto/Protocol/Protocol.d.ts +0 -270
- package/extras/WAProto/Reporting/Reporting.d.ts +0 -371
- package/extras/WAProto/ServerSync/ServerSync.d.ts +0 -1285
- package/extras/WAProto/SignalLocalStorageProtocol/SignalLocalStorageProtocol.d.ts +0 -1868
- package/extras/WAProto/SignalWhisperTextProtocol/SignalWhisperTextProtocol.d.ts +0 -767
- package/extras/WAProto/StatusAttributions/StatusAttributions.d.ts +0 -906
- package/extras/WAProto/SyncAction/SyncAction.d.ts +0 -8893
- package/extras/WAProto/UserPassword/UserPassword.d.ts +0 -363
- package/extras/WAProto/VnameCert/VnameCert.d.ts +0 -821
- package/extras/WAProto/Wa6/Wa6.d.ts +0 -2055
- package/extras/WAProto/Web/Web.d.ts +0 -38023
- package/extras/WAProto/index.d.ts +0 -53
- package/licenses/whiskeysockets-MIT.txt +0 -21
package/WAProto/index.js
ADDED
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
'use strict';
|
|
2
|
+
// Fixed: the distributed package was missing the generated WAProto/index.js
|
|
3
|
+
// (normally produced by scripts/generate-protobuf.cjs from WAProto.proto)
|
|
4
|
+
// We re-export the pre-compiled split protos and apply the same compatibility patches.
|
|
5
|
+
const { proto } = require('../extras/WAProto');
|
|
6
|
+
require('./compat.cjs')(proto);
|
|
7
|
+
module.exports = { proto };
|
|
8
|
+
// also re-export everything for __exportStar compatibility
|
|
9
|
+
module.exports.proto = proto;
|
|
10
|
+
Object.assign(module.exports, { proto });
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "kage-baileys",
|
|
3
|
-
"version": "25.0.
|
|
3
|
+
"version": "25.0.3",
|
|
4
4
|
"description": "Kage Baileys completo — API WhatsApp Web con MessageBuilder extendido, Native Flows, review_and_pay, módulos proto, miniaturas base64/Buffer, rich UI, VoIP, canales, comunidades y más.",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"kage-baileys",
|
|
@@ -1,22 +0,0 @@
|
|
|
1
|
-
export declare const BOT_SIGNATURE_VERSION: '1';
|
|
2
|
-
export declare const BOT_SIGNATURE_USE_CASE_WA_BOT_MSG: 1;
|
|
3
|
-
export declare const BOT_SIGNATURE_ROOT_VERSION: string;
|
|
4
|
-
export declare const BOT_SIGNATURE_ROOT_CERTIFICATE: string;
|
|
5
|
-
|
|
6
|
-
export declare function loadBotSignatureRoot(): import('crypto').X509Certificate;
|
|
7
|
-
|
|
8
|
-
export declare function constructSignaturePayload(options: {
|
|
9
|
-
botFbid: string;
|
|
10
|
-
messageDigest: Buffer | Uint8Array;
|
|
11
|
-
version?: string;
|
|
12
|
-
}): Buffer;
|
|
13
|
-
|
|
14
|
-
export declare function verifyBotSignature(options: {
|
|
15
|
-
botJid?: string;
|
|
16
|
-
unifiedResponseBytes?: Buffer | Uint8Array;
|
|
17
|
-
proof?: any;
|
|
18
|
-
at?: number;
|
|
19
|
-
root?: import('crypto').X509Certificate;
|
|
20
|
-
}): { status: 'passed' | 'failed'; reason?: string };
|
|
21
|
-
|
|
22
|
-
export declare function isParsableCertificateChain(chain?: unknown): boolean;
|
|
@@ -1,449 +0,0 @@
|
|
|
1
|
-
export declare const AI_RICH_LAYOUTS: readonly string[];
|
|
2
|
-
export declare const AI_RICH_PRIMITIVES: readonly string[];
|
|
3
|
-
export declare const AI_RICH_INLINE_ENTITIES: readonly string[];
|
|
4
|
-
export declare const AI_RICH_ITEMS: readonly string[];
|
|
5
|
-
export declare const AI_RICH_PRIMITIVES_WEB_RENDERED: readonly string[];
|
|
6
|
-
export declare const AI_RICH_PRIMITIVE_INTERFACE: 'GenAIUXPrimitive';
|
|
7
|
-
export declare const AI_RICH_PRIMITIVES_WITHOUT_SCHEMA: readonly string[];
|
|
8
|
-
export declare const AI_RICH_HTML_PRIMITIVE: 'GenAIaeacdsnwHtmlPrimitive';
|
|
9
|
-
|
|
10
|
-
export declare const DividerType: Readonly<{ DOT: 'DOT'; HORIZONTAL_LINE: 'HORIZONTAL_LINE' }>;
|
|
11
|
-
export declare const ImagineType: Readonly<{ IMAGINE: 'IMAGINE'; ANIMATE: 'ANIMATE'; MEMU: 'MEMU' }>;
|
|
12
|
-
export declare const ImagineStatus: Readonly<{ GENERATING: 'GENERATING'; READY: 'READY'; FAILED: 'FAILED' }>;
|
|
13
|
-
export declare const ThinkingIcon: Readonly<{ THINKING: 'THINKING'; WEB_SEARCH: 'WEB_SEARCH'; META_SEARCH: 'META_SEARCH' }>;
|
|
14
|
-
export declare const TaskStatus: Readonly<{ PENDING: 'PENDING'; RUNNING: 'RUNNING'; DONE: 'DONE' }>;
|
|
15
|
-
export declare const FooterActionType: Readonly<Record<string, string>>;
|
|
16
|
-
export declare const AddonActionType: Readonly<Record<string, string>>;
|
|
17
|
-
|
|
18
|
-
export declare function dividerSection(options?: { dividerType?: string }): any;
|
|
19
|
-
export declare function spacerSection(options?: { spacing?: number }): any;
|
|
20
|
-
export declare function imageSection(url: string, options?: {
|
|
21
|
-
fallbackUrl?: string;
|
|
22
|
-
previewUrl?: string;
|
|
23
|
-
previewFallbackUrl?: string;
|
|
24
|
-
}): any;
|
|
25
|
-
export declare function taskSection(options: {
|
|
26
|
-
taskId: string | number;
|
|
27
|
-
title?: string;
|
|
28
|
-
subtitle?: string;
|
|
29
|
-
status?: string;
|
|
30
|
-
}): any;
|
|
31
|
-
export declare function latexSection(expression: string, options?: {
|
|
32
|
-
image?: string;
|
|
33
|
-
width?: number;
|
|
34
|
-
height?: number;
|
|
35
|
-
fontHeight?: number;
|
|
36
|
-
padding?: number;
|
|
37
|
-
}): any;
|
|
38
|
-
export declare function thinkingSection(title: string, options?: {
|
|
39
|
-
icon?: string;
|
|
40
|
-
inProgress?: boolean;
|
|
41
|
-
metaSearchApps?: string[];
|
|
42
|
-
thoughtDurationSec?: number;
|
|
43
|
-
}): any;
|
|
44
|
-
export declare function progressSection(title: string, options?: {
|
|
45
|
-
icon?: string;
|
|
46
|
-
inProgress?: boolean;
|
|
47
|
-
metaSearchApps?: string[];
|
|
48
|
-
thoughtDurationSec?: number;
|
|
49
|
-
}): any;
|
|
50
|
-
|
|
51
|
-
export declare function lockHeight(height: number): string;
|
|
52
|
-
|
|
53
|
-
export declare const HTML_APP_BRIDGE: 'AndroidBridge';
|
|
54
|
-
|
|
55
|
-
export declare function dataUri(bytes: Buffer | Uint8Array, mimetype: string): string;
|
|
56
|
-
|
|
57
|
-
export declare function htmlMedia(bytes: Buffer | Uint8Array, options: {
|
|
58
|
-
mimetype: string;
|
|
59
|
-
tag?: 'video' | 'audio' | 'img';
|
|
60
|
-
label?: string;
|
|
61
|
-
poster?: string;
|
|
62
|
-
id?: string;
|
|
63
|
-
attributes?: string;
|
|
64
|
-
}): string;
|
|
65
|
-
|
|
66
|
-
export interface AutoHeightOptions {
|
|
67
|
-
min?: number;
|
|
68
|
-
max?: number;
|
|
69
|
-
settleMs?: number;
|
|
70
|
-
maxReports?: number;
|
|
71
|
-
}
|
|
72
|
-
|
|
73
|
-
export declare function autoHeight(options?: AutoHeightOptions): string;
|
|
74
|
-
|
|
75
|
-
export interface ScrollControlsOptions {
|
|
76
|
-
/** CSS selector for the pane to scroll. Defaults to the #__wrap that height creates. */
|
|
77
|
-
target?: string;
|
|
78
|
-
/** Pixels per tap, and per repeat while held. */
|
|
79
|
-
step?: number;
|
|
80
|
-
/** Repeat interval while a button is held down, at least 16. */
|
|
81
|
-
holdMs?: number;
|
|
82
|
-
/** Button edge length in pixels, at least 24. */
|
|
83
|
-
size?: number;
|
|
84
|
-
side?: 'right' | 'left';
|
|
85
|
-
inset?: number;
|
|
86
|
-
}
|
|
87
|
-
|
|
88
|
-
/**
|
|
89
|
-
* On-screen scroll buttons. Touch scrolling inside the bubble is taken by the
|
|
90
|
-
* chat list behind it, so a page taller than its bubble cannot be scrolled by
|
|
91
|
-
* dragging; these move the pane programmatically instead. Hidden when the
|
|
92
|
-
* content already fits.
|
|
93
|
-
*/
|
|
94
|
-
export declare function scrollControls(options?: ScrollControlsOptions): string;
|
|
95
|
-
|
|
96
|
-
export declare const AI_RICH_HTML_PRIMITIVE_CLASS: 'FOAHtmlPrimitive';
|
|
97
|
-
|
|
98
|
-
export declare function htmlSection(html: string, options?: {
|
|
99
|
-
trustedSources?: string[];
|
|
100
|
-
height?: number;
|
|
101
|
-
typename?: string;
|
|
102
|
-
}): any;
|
|
103
|
-
|
|
104
|
-
export declare function sendHtmlApp(sock: any, jid: string, html: string, options?: {
|
|
105
|
-
title?: string;
|
|
106
|
-
label?: string;
|
|
107
|
-
trustedSources?: string[];
|
|
108
|
-
height?: number;
|
|
109
|
-
autoHeight?: boolean | AutoHeightOptions;
|
|
110
|
-
scrollButtons?: boolean | ScrollControlsOptions;
|
|
111
|
-
typename?: string;
|
|
112
|
-
id?: string;
|
|
113
|
-
bypassDownload?: boolean;
|
|
114
|
-
guard?: boolean | 'warn';
|
|
115
|
-
[key: string]: any;
|
|
116
|
-
}): Promise<any>;
|
|
117
|
-
|
|
118
|
-
export declare const HTML_MIME_TYPE: 'text/html';
|
|
119
|
-
|
|
120
|
-
export declare function sendHtmlDocument(sock: any, jid: string, html: string, options?: {
|
|
121
|
-
fileName?: string;
|
|
122
|
-
caption?: string;
|
|
123
|
-
[key: string]: any;
|
|
124
|
-
}): Promise<any>;
|
|
125
|
-
|
|
126
|
-
export interface FileSectionOptions {
|
|
127
|
-
title?: string;
|
|
128
|
-
fileExtension?: string;
|
|
129
|
-
fileLength?: number;
|
|
130
|
-
pageCount?: number;
|
|
131
|
-
previewImage?: any;
|
|
132
|
-
}
|
|
133
|
-
|
|
134
|
-
export declare function fileSection(url: string, options?: FileSectionOptions): any;
|
|
135
|
-
export declare function fileLinkSection(url: string, options?: FileSectionOptions): any;
|
|
136
|
-
|
|
137
|
-
export interface BotMediaMetadata {
|
|
138
|
-
fileSha256?: string;
|
|
139
|
-
mediaKey?: string;
|
|
140
|
-
fileEncSha256?: string;
|
|
141
|
-
directPath?: string;
|
|
142
|
-
mediaKeyTimestamp?: number;
|
|
143
|
-
mimetype?: string;
|
|
144
|
-
}
|
|
145
|
-
|
|
146
|
-
export declare function botMediaMetadata(documentMessage: any): BotMediaMetadata;
|
|
147
|
-
|
|
148
|
-
export declare function prepareFileArtifact(sock: any, content: string | Uint8Array, options?: {
|
|
149
|
-
mimetype?: string;
|
|
150
|
-
fileName?: string;
|
|
151
|
-
title?: string;
|
|
152
|
-
id?: string;
|
|
153
|
-
}): Promise<{
|
|
154
|
-
mediaId: string;
|
|
155
|
-
media: BotMediaMetadata;
|
|
156
|
-
documentMessage: any;
|
|
157
|
-
section: any;
|
|
158
|
-
mediaDetails: { id: string; previewMedia: BotMediaMetadata; highResMedia: BotMediaMetadata };
|
|
159
|
-
}>;
|
|
160
|
-
|
|
161
|
-
export declare function sendHtmlArtifact(sock: any, jid: string, html: string, options?: {
|
|
162
|
-
fileName?: string;
|
|
163
|
-
title?: string;
|
|
164
|
-
label?: string;
|
|
165
|
-
id?: string;
|
|
166
|
-
bypassDownload?: boolean;
|
|
167
|
-
[key: string]: any;
|
|
168
|
-
}): Promise<{ message: any; mediaId: string }>;
|
|
169
|
-
|
|
170
|
-
export declare const SourceProvider: Readonly<{ UNKNOWN: 0; BING: 1; GOOGLE: 2; SUPPORT: 3; OTHER: 4 }>;
|
|
171
|
-
|
|
172
|
-
export interface SourceInput {
|
|
173
|
-
url: string;
|
|
174
|
-
title?: string;
|
|
175
|
-
query?: string;
|
|
176
|
-
favicon?: string;
|
|
177
|
-
thumbnail?: string;
|
|
178
|
-
citation?: number;
|
|
179
|
-
provider?: number;
|
|
180
|
-
}
|
|
181
|
-
|
|
182
|
-
export declare function botSourcesMetadata(sources: SourceInput[]): { sources: any[] };
|
|
183
|
-
|
|
184
|
-
export declare const EMBEDDED_SCREEN_PRESENTATION: Readonly<{ HALF_HEIGHT: 'HALF_HEIGHT'; FULL_HEIGHT: 'FULL_HEIGHT' }>;
|
|
185
|
-
|
|
186
|
-
export declare const EMBEDDED_SCREEN_TYPENAME: string;
|
|
187
|
-
export declare const EMBEDDED_SCREEN_TABBED_TYPENAME: string;
|
|
188
|
-
export declare const EMBEDDED_SCREEN_TAB_TYPENAME: string;
|
|
189
|
-
export declare const AI_RICH_SECTION_TYPENAME: string;
|
|
190
|
-
export declare const AI_RICH_UNIFIED_RESPONSE_TYPENAME: string;
|
|
191
|
-
export declare const AI_RICH_UNIFIED_RESPONSE_TYPENAME_APP: string;
|
|
192
|
-
export declare const AI_RICH_NESTED_UNIFIED_RESPONSE_TYPENAME: string;
|
|
193
|
-
export declare const EMBEDDED_SCREEN_SINGLE_TYPENAME: string;
|
|
194
|
-
export declare const EMBEDDED_SCREEN_CONTEXTUAL_TYPENAME: string;
|
|
195
|
-
export declare const AI_RICH_NODES: readonly string[];
|
|
196
|
-
export declare function collectTypenames(root: any, options?: { limit?: number }): string[];
|
|
197
|
-
|
|
198
|
-
export declare function embeddedTab(options?: {
|
|
199
|
-
id?: string;
|
|
200
|
-
header?: any;
|
|
201
|
-
tabHeader?: any;
|
|
202
|
-
sections?: any[];
|
|
203
|
-
typename?: string;
|
|
204
|
-
}): any;
|
|
205
|
-
|
|
206
|
-
export declare function embeddedTabbedContent(tabs: any[], options?: { typename?: string }): any;
|
|
207
|
-
|
|
208
|
-
export declare const AI_RICH_RESPONSE_KEYS: readonly string[];
|
|
209
|
-
|
|
210
|
-
export declare function embeddedScreen(options?: {
|
|
211
|
-
id?: string;
|
|
212
|
-
title?: string;
|
|
213
|
-
content?: any[];
|
|
214
|
-
tabs?: any[];
|
|
215
|
-
tabsTypename?: string;
|
|
216
|
-
typename?: string;
|
|
217
|
-
header?: any;
|
|
218
|
-
body?: any;
|
|
219
|
-
artifacts?: any[];
|
|
220
|
-
steps?: any[];
|
|
221
|
-
stepEntries?: any[];
|
|
222
|
-
sources?: any[];
|
|
223
|
-
pollId?: string;
|
|
224
|
-
}): any;
|
|
225
|
-
|
|
226
|
-
export declare function readEmbeddedTabs(screen: any): any[];
|
|
227
|
-
|
|
228
|
-
export declare function readEmbeddedSections(screen: any): any[];
|
|
229
|
-
|
|
230
|
-
export declare function footerActionSection(actionType: string, options?: {
|
|
231
|
-
buttonText?: string;
|
|
232
|
-
url?: string;
|
|
233
|
-
}): any;
|
|
234
|
-
|
|
235
|
-
export declare const A2UI_VERSION: 'v0.9';
|
|
236
|
-
export declare const A2UI_BASIC_CATALOG: string;
|
|
237
|
-
export declare const A2UI_ROOT_ID: 'root';
|
|
238
|
-
|
|
239
|
-
export interface A2UIComponent {
|
|
240
|
-
id: string;
|
|
241
|
-
component: string;
|
|
242
|
-
[key: string]: any;
|
|
243
|
-
}
|
|
244
|
-
|
|
245
|
-
export interface A2UIElement {
|
|
246
|
-
type: 'info_card' | 'list_card';
|
|
247
|
-
[key: string]: any;
|
|
248
|
-
}
|
|
249
|
-
|
|
250
|
-
export declare function a2uiText(id: string, text: string, options?: { variant?: string }): A2UIComponent;
|
|
251
|
-
export declare function a2uiImage(id: string, url: string, options?: { variant?: string; fit?: string }): A2UIComponent;
|
|
252
|
-
export declare function a2uiColumn(id: string, children?: string[]): A2UIComponent;
|
|
253
|
-
export declare function a2uiRow(id: string, children?: string[]): A2UIComponent;
|
|
254
|
-
export declare function a2uiCard(id: string, child: string): A2UIComponent;
|
|
255
|
-
export declare function a2uiInfoCard(element?: Record<string, any>): A2UIElement;
|
|
256
|
-
export declare function a2uiListCard(element?: Record<string, any>): A2UIElement;
|
|
257
|
-
export declare function a2uiFallback(components: any[]): string;
|
|
258
|
-
|
|
259
|
-
export declare function a2uiSurface(components: A2UIComponent[], options?: {
|
|
260
|
-
surfaceId?: string;
|
|
261
|
-
root?: string;
|
|
262
|
-
catalogId?: string;
|
|
263
|
-
sendDataModel?: boolean;
|
|
264
|
-
version?: string;
|
|
265
|
-
type?: string;
|
|
266
|
-
title?: string;
|
|
267
|
-
}): any;
|
|
268
|
-
|
|
269
|
-
export declare function a2uiWidget(components: A2UIComponent[], options?: {
|
|
270
|
-
uuid?: string;
|
|
271
|
-
surfaceId?: string;
|
|
272
|
-
root?: string;
|
|
273
|
-
catalogId?: string;
|
|
274
|
-
sendDataModel?: boolean;
|
|
275
|
-
version?: string;
|
|
276
|
-
type?: string;
|
|
277
|
-
title?: string;
|
|
278
|
-
fallback?: string;
|
|
279
|
-
data?: any;
|
|
280
|
-
}): BloksWidget;
|
|
281
|
-
|
|
282
|
-
export declare function sendA2UI(sock: any, jid: string, components: A2UIComponent[], options?: {
|
|
283
|
-
buttons?: any[];
|
|
284
|
-
contextInfo?: any;
|
|
285
|
-
uuid?: string;
|
|
286
|
-
surfaceId?: string;
|
|
287
|
-
root?: string;
|
|
288
|
-
catalogId?: string;
|
|
289
|
-
sendDataModel?: boolean;
|
|
290
|
-
type?: string;
|
|
291
|
-
title?: string;
|
|
292
|
-
fallback?: string;
|
|
293
|
-
messageId?: string;
|
|
294
|
-
additionalNodes?: any[];
|
|
295
|
-
[key: string]: any;
|
|
296
|
-
}): Promise<any>;
|
|
297
|
-
|
|
298
|
-
export declare function buildA2UISection(components: A2UIComponent[], options?: {
|
|
299
|
-
uuid?: string;
|
|
300
|
-
surfaceId?: string;
|
|
301
|
-
root?: string;
|
|
302
|
-
catalogId?: string;
|
|
303
|
-
sendDataModel?: boolean;
|
|
304
|
-
version?: string;
|
|
305
|
-
type?: string;
|
|
306
|
-
title?: string;
|
|
307
|
-
data?: any;
|
|
308
|
-
initialResponse?: string;
|
|
309
|
-
versioningId?: string;
|
|
310
|
-
}): any;
|
|
311
|
-
|
|
312
|
-
export declare function sendA2UIBloks(sock: any, jid: string, components: A2UIComponent[], options?: {
|
|
313
|
-
uuid?: string;
|
|
314
|
-
surfaceId?: string;
|
|
315
|
-
root?: string;
|
|
316
|
-
catalogId?: string;
|
|
317
|
-
sendDataModel?: boolean;
|
|
318
|
-
version?: string;
|
|
319
|
-
type?: string;
|
|
320
|
-
title?: string;
|
|
321
|
-
data?: any;
|
|
322
|
-
initialResponse?: string;
|
|
323
|
-
versioningId?: string;
|
|
324
|
-
[key: string]: any;
|
|
325
|
-
}): Promise<any>;
|
|
326
|
-
|
|
327
|
-
export declare const BLOKS_A2UI_TYPE: 'im_a2ui';
|
|
328
|
-
export declare const BLOKS_A2UI_REPLY_ACTION: 'a2ui_reply_action';
|
|
329
|
-
export declare const BLOKS_A2UI_SUPPORTED_ELEMENTS: readonly string[];
|
|
330
|
-
|
|
331
|
-
export interface AIRichSubmessage {
|
|
332
|
-
messageType: number;
|
|
333
|
-
messageText?: string;
|
|
334
|
-
imageMetadata?: any;
|
|
335
|
-
tableMetadata?: any;
|
|
336
|
-
contentItemsMetadata?: any;
|
|
337
|
-
[key: string]: any;
|
|
338
|
-
}
|
|
339
|
-
|
|
340
|
-
export type AIRichSubmessageKind = 'text' | 'inline_image' | 'table' | 'content_items';
|
|
341
|
-
|
|
342
|
-
export declare const AI_RICH_SUBMESSAGE_TEXT: 2;
|
|
343
|
-
export declare const AI_RICH_SUBMESSAGE_INLINE_IMAGE: 3;
|
|
344
|
-
export declare const AI_RICH_SUBMESSAGE_TABLE: 4;
|
|
345
|
-
export declare const AI_RICH_SUBMESSAGE_CONTENT_ITEMS: 9;
|
|
346
|
-
export declare const AI_RICH_SUBMESSAGE_KINDS: readonly AIRichSubmessageKind[];
|
|
347
|
-
|
|
348
|
-
export declare function aiRichSubmessage(kind: AIRichSubmessageKind, payload?: any): AIRichSubmessage;
|
|
349
|
-
export declare function aiRichText(text: string): AIRichSubmessage;
|
|
350
|
-
export declare function aiRichInlineImage(image: {
|
|
351
|
-
previewUrl: string;
|
|
352
|
-
highResUrl?: string;
|
|
353
|
-
sourceUrl?: string;
|
|
354
|
-
text?: string;
|
|
355
|
-
alignment?: number;
|
|
356
|
-
tapLinkUrl?: string;
|
|
357
|
-
}): AIRichSubmessage;
|
|
358
|
-
export declare function aiRichTable(table: {
|
|
359
|
-
rows: { items: string[]; isHeading?: boolean }[];
|
|
360
|
-
title?: string;
|
|
361
|
-
}): AIRichSubmessage;
|
|
362
|
-
export declare function aiRichContentItems(content: { items: any[]; [key: string]: any }): AIRichSubmessage;
|
|
363
|
-
|
|
364
|
-
export declare const AIRichMessage: {
|
|
365
|
-
SUBMESSAGE_KINDS: readonly AIRichSubmessageKind[];
|
|
366
|
-
text: typeof aiRichText;
|
|
367
|
-
inlineImage: typeof aiRichInlineImage;
|
|
368
|
-
table: typeof aiRichTable;
|
|
369
|
-
contentItems: typeof aiRichContentItems;
|
|
370
|
-
submessage: typeof aiRichSubmessage;
|
|
371
|
-
textSection: (text: string) => any;
|
|
372
|
-
nativeFlowSection: (name: string, params?: any, options?: { uuid?: string; initialResponse?: string; versioningId?: string }) => any;
|
|
373
|
-
};
|
|
374
|
-
|
|
375
|
-
export declare function sendAIRichMessage(sock: any, jid: string, options?: {
|
|
376
|
-
sections?: any[];
|
|
377
|
-
text?: string;
|
|
378
|
-
nativeFlow?: { name: string; params?: any };
|
|
379
|
-
submessages?: AIRichSubmessage[];
|
|
380
|
-
forwardWrapper?: boolean;
|
|
381
|
-
[key: string]: any;
|
|
382
|
-
}): Promise<any>;
|
|
383
|
-
|
|
384
|
-
export interface BloksWidget {
|
|
385
|
-
type: string;
|
|
386
|
-
data: string;
|
|
387
|
-
uuid: string;
|
|
388
|
-
fallback: string;
|
|
389
|
-
}
|
|
390
|
-
|
|
391
|
-
export declare function bloksSection(type: string, data?: string | Record<string, any>, options?: {
|
|
392
|
-
uuid?: string;
|
|
393
|
-
initialResponse?: string;
|
|
394
|
-
versioningId?: string;
|
|
395
|
-
}): any;
|
|
396
|
-
|
|
397
|
-
export declare function bloksWidget(options: {
|
|
398
|
-
type: string;
|
|
399
|
-
data?: string | Record<string, any>;
|
|
400
|
-
uuid?: string;
|
|
401
|
-
fallback?: string;
|
|
402
|
-
}): BloksWidget;
|
|
403
|
-
|
|
404
|
-
export declare function sendBloksWidget(sock: any, jid: string, options: {
|
|
405
|
-
type: string;
|
|
406
|
-
data?: string | Record<string, any>;
|
|
407
|
-
uuid?: string;
|
|
408
|
-
fallback?: string;
|
|
409
|
-
body?: string;
|
|
410
|
-
contextInfo?: any;
|
|
411
|
-
messageId?: string;
|
|
412
|
-
additionalNodes?: any[];
|
|
413
|
-
[key: string]: any;
|
|
414
|
-
}): Promise<any>;
|
|
415
|
-
|
|
416
|
-
export declare function decodeBloksWidget(msg: any): (BloksWidget & { params: any }) | null;
|
|
417
|
-
|
|
418
|
-
export interface RichMessageRead {
|
|
419
|
-
kind: 'airich' | 'a2ui' | 'bloks' | 'interactive';
|
|
420
|
-
text: string;
|
|
421
|
-
title: string;
|
|
422
|
-
buttons: { name: string; params: any }[];
|
|
423
|
-
html: string[];
|
|
424
|
-
typenames: string[];
|
|
425
|
-
sections: any[];
|
|
426
|
-
footerSections: any[];
|
|
427
|
-
embeddedScreens: any[];
|
|
428
|
-
embeddedTabs: any[];
|
|
429
|
-
submessages: any[];
|
|
430
|
-
responseId?: string;
|
|
431
|
-
a2ui?: { surfaceId: string; root?: string; catalogId?: string; version: string; components: A2UIComponent[] };
|
|
432
|
-
bloks?: { type: string; uuid: string; fallback: string; params: any };
|
|
433
|
-
}
|
|
434
|
-
|
|
435
|
-
export declare function readRichMessage(msg: any): RichMessageRead | null;
|
|
436
|
-
|
|
437
|
-
export declare function decodeAIRich(msg: any): {
|
|
438
|
-
responseId?: string;
|
|
439
|
-
layouts: string[];
|
|
440
|
-
typenames: string[];
|
|
441
|
-
footerTypenames: string[];
|
|
442
|
-
sections: any[];
|
|
443
|
-
footerSections: any[];
|
|
444
|
-
embeddedScreens: any[];
|
|
445
|
-
embeddedTabs: any[];
|
|
446
|
-
embeddedSections: any[];
|
|
447
|
-
submessages: any[];
|
|
448
|
-
unified: any;
|
|
449
|
-
} | null;
|
|
@@ -1,210 +0,0 @@
|
|
|
1
|
-
export declare const VERSION: "4.7";
|
|
2
|
-
export declare const MESSAGE_BUILDER_VERSION: "4.7";
|
|
3
|
-
|
|
4
|
-
export interface AIRichItemOptions {
|
|
5
|
-
id?: string;
|
|
6
|
-
replace?: string | number;
|
|
7
|
-
insertAt?: string | number;
|
|
8
|
-
}
|
|
9
|
-
|
|
10
|
-
export declare class AIRichError extends Error {
|
|
11
|
-
constructor(message: string, code: string, meta?: Record<string, any>);
|
|
12
|
-
code: string;
|
|
13
|
-
}
|
|
14
|
-
|
|
15
|
-
export declare class ItemNotFoundError extends AIRichError {
|
|
16
|
-
constructor(id: string, availableIds?: string[]);
|
|
17
|
-
id: string;
|
|
18
|
-
availableIds: string[];
|
|
19
|
-
}
|
|
20
|
-
|
|
21
|
-
export declare class DuplicateIdError extends AIRichError {
|
|
22
|
-
constructor(id: string);
|
|
23
|
-
id: string;
|
|
24
|
-
}
|
|
25
|
-
|
|
26
|
-
export declare class InvalidTargetError extends AIRichError {
|
|
27
|
-
constructor(message: string, meta?: Record<string, any>);
|
|
28
|
-
}
|
|
29
|
-
|
|
30
|
-
export declare class ContentValidationError extends AIRichError {
|
|
31
|
-
constructor(message: string, meta?: Record<string, any>);
|
|
32
|
-
}
|
|
33
|
-
|
|
34
|
-
export declare class Toolkit {
|
|
35
|
-
constructor();
|
|
36
|
-
static extractIE(text: string, options?: Record<string, any>): any;
|
|
37
|
-
static resize(buffer: Buffer, x: number, y: number, fit?: string): Promise<Buffer>;
|
|
38
|
-
static waitAllPromises(input: any): Promise<any>;
|
|
39
|
-
static fetchBuffer(url: string, options?: Record<string, any>, settings?: { silent?: boolean }): Promise<Buffer>;
|
|
40
|
-
static toUrl(client: any, path: any, mediaType?: string): Promise<any>;
|
|
41
|
-
static resolveMedia(client: any, media: any, mediaType?: string, options?: Record<string, any>): Promise<any>;
|
|
42
|
-
static getMp4Duration(buffer: Buffer, options?: { silent?: boolean }): number;
|
|
43
|
-
static getMp4Preview(videoBuffer: Buffer, options?: Record<string, any>): Promise<Buffer | string>;
|
|
44
|
-
static stringifyEscaped(obj: any): string;
|
|
45
|
-
}
|
|
46
|
-
|
|
47
|
-
declare class BaseBuilder {
|
|
48
|
-
setTitle(title: string): this;
|
|
49
|
-
setSubtitle(subtitle: string): this;
|
|
50
|
-
setBody(body: string): this;
|
|
51
|
-
setFooter(footer: string): this;
|
|
52
|
-
setContextInfo(obj: Record<string, any>): this;
|
|
53
|
-
addPayload(obj: Record<string, any>): this;
|
|
54
|
-
}
|
|
55
|
-
|
|
56
|
-
export declare class Button extends BaseBuilder {
|
|
57
|
-
constructor(client: any);
|
|
58
|
-
loadFrom(msg: any): this;
|
|
59
|
-
setVideo(path: any, options?: Record<string, any>): this;
|
|
60
|
-
setImage(path: any, options?: Record<string, any>): this;
|
|
61
|
-
setDocument(path: any, options?: Record<string, any>): this;
|
|
62
|
-
setMedia(obj: Record<string, any>): this;
|
|
63
|
-
clearButtons(): this;
|
|
64
|
-
setParams(obj: Record<string, any>): this;
|
|
65
|
-
addButton(name: string, params: Record<string, any> | string): this;
|
|
66
|
-
makeRow(header?: string, title?: string, description?: string, id?: string): this;
|
|
67
|
-
makeSection(title?: string, highlightLabel?: string): this;
|
|
68
|
-
addSelection(title: string, options?: Record<string, any>): this;
|
|
69
|
-
addReply(displayText?: string, id?: string, options?: Record<string, any>): this;
|
|
70
|
-
addCall(displayText?: string, id?: string, options?: Record<string, any>): this;
|
|
71
|
-
addReminder(displayText?: string, id?: string, options?: Record<string, any>): this;
|
|
72
|
-
addCancelReminder(displayText?: string, id?: string, options?: Record<string, any>): this;
|
|
73
|
-
addAddress(displayText?: string, id?: string, options?: Record<string, any>): this;
|
|
74
|
-
addLocation(options?: Record<string, any>): this;
|
|
75
|
-
addUrl(displayText?: string, url?: string, webviewInteraction?: boolean, options?: Record<string, any>): this;
|
|
76
|
-
addCopy(displayText?: string, copyCode?: string, options?: Record<string, any>): this;
|
|
77
|
-
static paramsList: Record<string, any>;
|
|
78
|
-
toCard(): Promise<any>;
|
|
79
|
-
build(jid: string, options?: Record<string, any>): Promise<any>;
|
|
80
|
-
send(jid: string, options?: Record<string, any>): Promise<any>;
|
|
81
|
-
}
|
|
82
|
-
|
|
83
|
-
export declare class ButtonV2 extends BaseBuilder {
|
|
84
|
-
constructor(client: any);
|
|
85
|
-
loadFrom(msg: any): this;
|
|
86
|
-
addButton(displayText?: string, buttonId?: string): this;
|
|
87
|
-
addRawButton(obj: Record<string, any>): this;
|
|
88
|
-
setRawThumbnail(thumbnail: string): this;
|
|
89
|
-
setThumbnail(path: any): this;
|
|
90
|
-
setMedia(obj: Record<string, any>): this;
|
|
91
|
-
build(jid: string, options?: Record<string, any>): Promise<any>;
|
|
92
|
-
send(jid: string, options?: Record<string, any>): Promise<any>;
|
|
93
|
-
}
|
|
94
|
-
|
|
95
|
-
export declare class Carousel extends BaseBuilder {
|
|
96
|
-
constructor(client: any);
|
|
97
|
-
loadFrom(msg: any): this;
|
|
98
|
-
addCard(card: any): this;
|
|
99
|
-
build(jid: string, options?: Record<string, any>): any;
|
|
100
|
-
send(jid: string, options?: Record<string, any>): Promise<any>;
|
|
101
|
-
}
|
|
102
|
-
|
|
103
|
-
export declare class AIRich extends BaseBuilder {
|
|
104
|
-
constructor(client: any, options?: { dynamic?: boolean; unsupportedTypeAlert?: boolean });
|
|
105
|
-
static readonly DEFAULT_BOT_JID: string;
|
|
106
|
-
static readonly MAP_DELTA: number;
|
|
107
|
-
static readonly LAYOUT_FIELDS: Readonly<Record<string, string>>;
|
|
108
|
-
static readonly SECTION_TYPENAME: string;
|
|
109
|
-
static readonly UNIFIED_RESPONSE_TYPENAME: string;
|
|
110
|
-
static tokenizer(code: string, lang?: string): any;
|
|
111
|
-
static toTableMetadata(rows: any[], options?: Record<string, any>): any;
|
|
112
|
-
static generateVerificationMetadata(): any;
|
|
113
|
-
static isMetaSignature(verificationMetadata: any): boolean;
|
|
114
|
-
static readonly PLACEHOLDER_MARKER: Buffer;
|
|
115
|
-
static wrapRichResponse(richResponseMessage: any, forwardWrapper?: boolean): any;
|
|
116
|
-
static newLayout(name: string, data: any, extra?: Record<string, any>): any;
|
|
117
|
-
static normalizeSection(section: any): any;
|
|
118
|
-
/** True while the loaded proof and its signed bytes are still going out untouched. */
|
|
119
|
-
readonly isSignaturePreserved: boolean;
|
|
120
|
-
loadFrom(msg: any): this;
|
|
121
|
-
setResponseMeta(meta: Record<string, any>): this;
|
|
122
|
-
setResponseId(id: string): this;
|
|
123
|
-
refreshResponseId(): this;
|
|
124
|
-
setBotResponseId(id: string): this;
|
|
125
|
-
refreshBotResponseId(): this;
|
|
126
|
-
createAlert(type: string): any;
|
|
127
|
-
hasId(id: string): boolean;
|
|
128
|
-
getIds(): string[];
|
|
129
|
-
peek(id?: string | number): any;
|
|
130
|
-
assignId(target: string | number, id: string): this;
|
|
131
|
-
delete(target: string | number): this;
|
|
132
|
-
addSubmessage(submessage: any, options?: AIRichItemOptions): this;
|
|
133
|
-
/**
|
|
134
|
-
* A section with no submessage travels as submessages: [], which every
|
|
135
|
-
* rendered AI Rich message has non-empty. Pass text for the plain-text
|
|
136
|
-
* twin, or submessage to shape it yourself.
|
|
137
|
-
*/
|
|
138
|
-
addSection(section: any, options?: AIRichItemOptions & { text?: string; submessage?: any }): this;
|
|
139
|
-
addFooterSection(section: any): this;
|
|
140
|
-
addEmbeddedScreen(screen: any): this;
|
|
141
|
-
setBotMetadata(extra: Record<string, any>): this;
|
|
142
|
-
clearFooterSections(): this;
|
|
143
|
-
addText(text: string, options?: AIRichItemOptions & { hyperlink?: boolean; citation?: boolean; latex?: boolean }): this;
|
|
144
|
-
addFOAText(text: string, options?: AIRichItemOptions): this;
|
|
145
|
-
addCode(language: string, code: string, options?: AIRichItemOptions): this;
|
|
146
|
-
addTable(table: string[][], options?: AIRichItemOptions & { hyperlink?: boolean; citation?: boolean; latex?: boolean }): this;
|
|
147
|
-
addMap(
|
|
148
|
-
places: {
|
|
149
|
-
latitude: number;
|
|
150
|
-
longitude: number;
|
|
151
|
-
title?: string;
|
|
152
|
-
name?: string;
|
|
153
|
-
body?: string;
|
|
154
|
-
description?: string;
|
|
155
|
-
address?: string;
|
|
156
|
-
id?: string | number;
|
|
157
|
-
imageUrl?: string;
|
|
158
|
-
itemType?: string;
|
|
159
|
-
}[],
|
|
160
|
-
options?: AIRichItemOptions & {
|
|
161
|
-
center?: { latitude: number; longitude: number };
|
|
162
|
-
latitudeDelta?: number;
|
|
163
|
-
longitudeDelta?: number;
|
|
164
|
-
showInfoList?: boolean;
|
|
165
|
-
motivation?: string;
|
|
166
|
-
staticMapUrl?: string;
|
|
167
|
-
staticMapDarkUrl?: string;
|
|
168
|
-
}
|
|
169
|
-
): this;
|
|
170
|
-
addSource(sources?: any[], options?: AIRichItemOptions): this;
|
|
171
|
-
addReels(reelsItems?: any, options?: AIRichItemOptions): this;
|
|
172
|
-
addImage(imageUrl: any, options?: AIRichItemOptions & { width?: number; height?: number; status?: string; update_text?: string; resolveUrl?: boolean }): this;
|
|
173
|
-
addVideo(videoUrl: any, options?: AIRichItemOptions & { autoFill?: boolean; status?: string; estimatedTime?: number }): this;
|
|
174
|
-
addProduct(data?: any, options?: AIRichItemOptions): this;
|
|
175
|
-
addPost(data?: any, options?: AIRichItemOptions): this;
|
|
176
|
-
addMetadata(text: string, options?: AIRichItemOptions): this;
|
|
177
|
-
addTip(text: string, options?: AIRichItemOptions): this;
|
|
178
|
-
addWidget(data: any, options?: AIRichItemOptions & { layout?: string }): this;
|
|
179
|
-
addFooterAction(data: any, options?: AIRichItemOptions & { layout?: string }): this;
|
|
180
|
-
addSuggest(suggestion: string | string[], options?: AIRichItemOptions & { scroll?: boolean; layout?: string }): this;
|
|
181
|
-
build(jid: string, options?: Record<string, any>): Promise<any>;
|
|
182
|
-
buildEdit(targetJid: string, targetId: string, options?: Record<string, any>): Promise<any>;
|
|
183
|
-
send(jid: string, options?: Record<string, any>): Promise<any>;
|
|
184
|
-
sendEdit(jid?: string, id?: string, options?: Record<string, any>): Promise<any>;
|
|
185
|
-
readonly sections: any[];
|
|
186
|
-
readonly items: any[];
|
|
187
|
-
static tokenizer(code: string, lang?: string): any;
|
|
188
|
-
static toTableMetadata(arr: string[][], options?: Record<string, any>): any;
|
|
189
|
-
static readonly SECTION_TYPENAME: 'GenAIUnifiedResponseSection';
|
|
190
|
-
static readonly UNIFIED_RESPONSE_TYPENAME: 'XMSGGenAIUnifiedResponse';
|
|
191
|
-
static newLayout(name: string, data: any, extra?: Record<string, any>): any;
|
|
192
|
-
static normalizeSection(section: any): any;
|
|
193
|
-
static generateVerificationMetadata(): any;
|
|
194
|
-
}
|
|
195
|
-
|
|
196
|
-
export declare const MessageBuilder: Readonly<{
|
|
197
|
-
VERSION: "4.7";
|
|
198
|
-
Button: typeof Button;
|
|
199
|
-
ButtonV2: typeof ButtonV2;
|
|
200
|
-
Carousel: typeof Carousel;
|
|
201
|
-
AIRich: typeof AIRich;
|
|
202
|
-
Toolkit: typeof Toolkit;
|
|
203
|
-
AIRichError: typeof AIRichError;
|
|
204
|
-
ItemNotFoundError: typeof ItemNotFoundError;
|
|
205
|
-
DuplicateIdError: typeof DuplicateIdError;
|
|
206
|
-
InvalidTargetError: typeof InvalidTargetError;
|
|
207
|
-
ContentValidationError: typeof ContentValidationError;
|
|
208
|
-
}>;
|
|
209
|
-
|
|
210
|
-
export declare const MB: typeof MessageBuilder;
|