@nerxa/socketon 0.0.0-stage → 1.21.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/EXPERIMENTAL.md +350 -0
- package/LICENSE +24 -0
- package/README.md +6317 -2
- package/WAProto/index.d.ts +17301 -0
- package/WAProto/index.js +125088 -0
- package/engine-requirements.js +14 -0
- package/package.json +100 -4
- package/src/Defaults/index.d.ts +152 -0
- package/src/Defaults/index.js +164 -0
- package/src/MessageBuilder/bot-signature.d.ts +22 -0
- package/src/MessageBuilder/bot-signature.js +122 -0
- package/src/MessageBuilder/extras.d.ts +449 -0
- package/src/MessageBuilder/extras.js +1356 -0
- package/src/MessageBuilder/index.d.ts +210 -0
- package/src/MessageBuilder/index.js +3594 -0
- package/src/MessageBuilder/metaai.d.ts +438 -0
- package/src/MessageBuilder/metaai.js +890 -0
- package/src/Signal/Group/ciphertext-message.d.ts +9 -0
- package/src/Signal/Group/ciphertext-message.js +11 -0
- package/src/Signal/Group/group-session-builder.d.ts +7 -0
- package/src/Signal/Group/group-session-builder.js +27 -0
- package/src/Signal/Group/group_cipher.d.ts +11 -0
- package/src/Signal/Group/group_cipher.js +78 -0
- package/src/Signal/Group/index.d.ts +11 -0
- package/src/Signal/Group/index.js +11 -0
- package/src/Signal/Group/keyhelper.d.ts +6 -0
- package/src/Signal/Group/keyhelper.js +17 -0
- package/src/Signal/Group/sender-chain-key.d.ts +13 -0
- package/src/Signal/Group/sender-chain-key.js +25 -0
- package/src/Signal/Group/sender-key-distribution-message.d.ts +16 -0
- package/src/Signal/Group/sender-key-distribution-message.js +62 -0
- package/src/Signal/Group/sender-key-message.d.ts +18 -0
- package/src/Signal/Group/sender-key-message.js +65 -0
- package/src/Signal/Group/sender-key-name.d.ts +11 -0
- package/src/Signal/Group/sender-key-name.js +47 -0
- package/src/Signal/Group/sender-key-record.d.ts +12 -0
- package/src/Signal/Group/sender-key-record.js +40 -0
- package/src/Signal/Group/sender-key-state.d.ts +16 -0
- package/src/Signal/Group/sender-key-state.js +83 -0
- package/src/Signal/Group/sender-message-key.d.ts +11 -0
- package/src/Signal/Group/sender-message-key.js +25 -0
- package/src/Signal/libsignal.d.ts +54 -0
- package/src/Signal/libsignal.js +427 -0
- package/src/Signal/lid-mapping.d.ts +20 -0
- package/src/Signal/lid-mapping.js +274 -0
- package/src/Socket/Client/index.d.ts +2 -0
- package/src/Socket/Client/index.js +3 -0
- package/src/Socket/Client/tcp.js +177 -0
- package/src/Socket/Client/types.d.ts +5 -0
- package/src/Socket/Client/types.js +9 -0
- package/src/Socket/Client/websocket.d.ts +12 -0
- package/src/Socket/Client/websocket.js +53 -0
- package/src/Socket/business.d.ts +431 -0
- package/src/Socket/business.js +379 -0
- package/src/Socket/chats.d.ts +247 -0
- package/src/Socket/chats.js +1484 -0
- package/src/Socket/communities.d.ts +598 -0
- package/src/Socket/communities.js +421 -0
- package/src/Socket/email.js +145 -0
- package/src/Socket/groups.d.ts +298 -0
- package/src/Socket/groups.js +339 -0
- package/src/Socket/index.d.ts +581 -0
- package/src/Socket/index.js +37 -0
- package/src/Socket/messages-recv.d.ts +370 -0
- package/src/Socket/messages-recv.js +1864 -0
- package/src/Socket/messages-send.d.ts +390 -0
- package/src/Socket/messages-send.js +1574 -0
- package/src/Socket/mex.d.ts +1 -0
- package/src/Socket/mex.js +44 -0
- package/src/Socket/mobile-builders.js +72 -0
- package/src/Socket/mobile.js +424 -0
- package/src/Socket/newsletter.d.ts +468 -0
- package/src/Socket/newsletter.js +671 -0
- package/src/Socket/socket.d.ts +77 -0
- package/src/Socket/socket.js +1106 -0
- package/src/Store/index.d.ts +3 -0
- package/src/Store/index.js +3 -0
- package/src/Store/make-in-memory-store.d.ts +62 -0
- package/src/Store/make-in-memory-store.js +396 -0
- package/src/Store/make-ordered-dictionary.d.ts +12 -0
- package/src/Store/make-ordered-dictionary.js +78 -0
- package/src/Store/object-repository.d.ts +10 -0
- package/src/Store/object-repository.js +23 -0
- package/src/Types/Auth.d.ts +1 -0
- package/src/Types/Auth.js +1 -0
- package/src/Types/Bussines.d.ts +1 -0
- package/src/Types/Bussines.js +1 -0
- package/src/Types/Call.d.ts +1 -0
- package/src/Types/Call.js +1 -0
- package/src/Types/Chat.d.ts +2 -0
- package/src/Types/Chat.js +24 -0
- package/src/Types/Contact.d.ts +1 -0
- package/src/Types/Contact.js +1 -0
- package/src/Types/Events.d.ts +1 -0
- package/src/Types/Events.js +0 -0
- package/src/Types/GroupMetadata.d.ts +5 -0
- package/src/Types/GroupMetadata.js +6 -0
- package/src/Types/Label.d.ts +2 -0
- package/src/Types/Label.js +24 -0
- package/src/Types/LabelAssociation.d.ts +2 -0
- package/src/Types/LabelAssociation.js +6 -0
- package/src/Types/Message.d.ts +13 -0
- package/src/Types/Message.js +23 -0
- package/src/Types/Mex.d.ts +2 -0
- package/src/Types/Mex.js +95 -0
- package/src/Types/Product.d.ts +1 -0
- package/src/Types/Product.js +1 -0
- package/src/Types/Signal.d.ts +1 -0
- package/src/Types/Signal.js +0 -0
- package/src/Types/Socket.d.ts +1 -0
- package/src/Types/Socket.js +0 -0
- package/src/Types/State.d.ts +5 -0
- package/src/Types/State.js +54 -0
- package/src/Types/USync.d.ts +1 -0
- package/src/Types/USync.js +0 -0
- package/src/Types/index.d.ts +13 -0
- package/src/Types/index.js +25 -0
- package/src/Utils/auth-store.d.ts +29 -0
- package/src/Utils/auth-store.js +76 -0
- package/src/Utils/auth-utils.d.ts +58 -0
- package/src/Utils/auth-utils.js +273 -0
- package/src/Utils/browser-utils.d.ts +9 -0
- package/src/Utils/browser-utils.js +28 -0
- package/src/Utils/business.d.ts +49 -0
- package/src/Utils/business.js +226 -0
- package/src/Utils/chat-utils.d.ts +408 -0
- package/src/Utils/chat-utils.js +846 -0
- package/src/Utils/companion-reg-client-utils.d.ts +4 -0
- package/src/Utils/companion-reg-client-utils.js +39 -0
- package/src/Utils/crypto.d.ts +39 -0
- package/src/Utils/crypto.js +110 -0
- package/src/Utils/decode-wa-message.d.ts +99 -0
- package/src/Utils/decode-wa-message.js +373 -0
- package/src/Utils/event-buffer.d.ts +22 -0
- package/src/Utils/event-buffer.js +624 -0
- package/src/Utils/generics.d.ts +63 -0
- package/src/Utils/generics.js +375 -0
- package/src/Utils/group-metadata-cache.d.ts +4 -0
- package/src/Utils/group-metadata-cache.js +25 -0
- package/src/Utils/history.d.ts +75 -0
- package/src/Utils/history.js +131 -0
- package/src/Utils/html-app.d.ts +19 -0
- package/src/Utils/html-app.js +96 -0
- package/src/Utils/html-multiplayer.d.ts +10 -0
- package/src/Utils/html-multiplayer.js +94 -0
- package/src/Utils/identity-change-handler.d.ts +13 -0
- package/src/Utils/identity-change-handler.js +48 -0
- package/src/Utils/index.d.ts +44 -0
- package/src/Utils/index.js +44 -0
- package/src/Utils/link-preview-metadata.d.ts +47 -0
- package/src/Utils/link-preview-metadata.js +88 -0
- package/src/Utils/link-preview.d.ts +12 -0
- package/src/Utils/link-preview.js +79 -0
- package/src/Utils/logger.d.ts +2 -0
- package/src/Utils/logger.js +2 -0
- package/src/Utils/lt-hash.d.ts +6 -0
- package/src/Utils/lt-hash.js +3 -0
- package/src/Utils/make-mutex.d.ts +6 -0
- package/src/Utils/make-mutex.js +32 -0
- package/src/Utils/message-retry-manager.d.ts +79 -0
- package/src/Utils/message-retry-manager.js +255 -0
- package/src/Utils/messages-media.d.ts +136 -0
- package/src/Utils/messages-media.js +814 -0
- package/src/Utils/messages.d.ts +62 -0
- package/src/Utils/messages.js +2223 -0
- package/src/Utils/mobile-companion-crypto.js +191 -0
- package/src/Utils/modern-messages.d.ts +150 -0
- package/src/Utils/modern-messages.js +496 -0
- package/src/Utils/native-flow.d.ts +11 -0
- package/src/Utils/native-flow.js +115 -0
- package/src/Utils/newsletter-status.d.ts +158 -0
- package/src/Utils/newsletter-status.js +651 -0
- package/src/Utils/noise-handler.d.ts +20 -0
- package/src/Utils/noise-handler.js +200 -0
- package/src/Utils/offline-node-processor.d.ts +9 -0
- package/src/Utils/offline-node-processor.js +33 -0
- package/src/Utils/optional-media.d.ts +3 -0
- package/src/Utils/optional-media.js +45 -0
- package/src/Utils/payment-messages.d.ts +66 -0
- package/src/Utils/payment-messages.js +160 -0
- package/src/Utils/pre-key-manager.d.ts +25 -0
- package/src/Utils/pre-key-manager.js +95 -0
- package/src/Utils/process-message.d.ts +60 -0
- package/src/Utils/process-message.js +688 -0
- package/src/Utils/reporting-utils.d.ts +12 -0
- package/src/Utils/reporting-utils.js +256 -0
- package/src/Utils/scheduled-message.d.ts +51 -0
- package/src/Utils/scheduled-message.js +112 -0
- package/src/Utils/sender-key-memory.d.ts +19 -0
- package/src/Utils/sender-key-memory.js +51 -0
- package/src/Utils/signal.d.ts +82 -0
- package/src/Utils/signal.js +193 -0
- package/src/Utils/stanza-ack.d.ts +16 -0
- package/src/Utils/stanza-ack.js +30 -0
- package/src/Utils/status-stickers.d.ts +127 -0
- package/src/Utils/status-stickers.js +260 -0
- package/src/Utils/sync-action-utils.d.ts +2 -0
- package/src/Utils/sync-action-utils.js +44 -0
- package/src/Utils/tc-token-utils.d.ts +29 -0
- package/src/Utils/tc-token-utils.js +155 -0
- package/src/Utils/ttl-cache.d.ts +28 -0
- package/src/Utils/ttl-cache.js +120 -0
- package/src/Utils/use-mongo-auth-state.d.ts +21 -0
- package/src/Utils/use-mongo-auth-state.js +67 -0
- package/src/Utils/use-multi-file-auth-state.d.ts +11 -0
- package/src/Utils/use-multi-file-auth-state.js +106 -0
- package/src/Utils/use-mysql-auth-state.d.ts +19 -0
- package/src/Utils/use-mysql-auth-state.js +79 -0
- package/src/Utils/use-postgres-auth-state.d.ts +19 -0
- package/src/Utils/use-postgres-auth-state.js +79 -0
- package/src/Utils/use-redis-auth-state.d.ts +19 -0
- package/src/Utils/use-redis-auth-state.js +89 -0
- package/src/Utils/use-single-file-auth-state.d.ts +10 -0
- package/src/Utils/use-single-file-auth-state.js +108 -0
- package/src/Utils/use-sqlite-auth-state.d.ts +12 -0
- package/src/Utils/use-sqlite-auth-state.js +120 -0
- package/src/Utils/useNekoDBAuth.d.ts +19 -0
- package/src/Utils/useNekoDBAuth.js +111 -0
- package/src/Utils/username.d.ts +12 -0
- package/src/Utils/username.js +58 -0
- package/src/Utils/validate-connection.d.ts +43 -0
- package/src/Utils/validate-connection.js +277 -0
- package/src/Utils/voice-recognition.d.ts +53 -0
- package/src/Utils/voice-recognition.js +219 -0
- package/src/Voip/audio-feeder.d.ts +24 -0
- package/src/Voip/audio-feeder.js +268 -0
- package/src/Voip/index.d.ts +88 -0
- package/src/Voip/index.js +936 -0
- package/src/Voip/relay-transport.d.ts +5 -0
- package/src/Voip/relay-transport.js +824 -0
- package/src/Voip/signaling.d.ts +11 -0
- package/src/Voip/signaling.js +1099 -0
- package/src/Voip/types.d.ts +2 -0
- package/src/Voip/types.js +12 -0
- package/src/Voip/video-feeder.d.ts +24 -0
- package/src/Voip/video-feeder.js +268 -0
- package/src/Voip/wasm-engine.d.ts +26 -0
- package/src/Voip/wasm-engine.js +1307 -0
- package/src/Voip/worker-bootstrap.js +1023 -0
- package/src/WABinary/constants.d.ts +22 -0
- package/src/WABinary/constants.js +1300 -0
- package/src/WABinary/decode.d.ts +9 -0
- package/src/WABinary/decode.js +261 -0
- package/src/WABinary/encode.d.ts +2 -0
- package/src/WABinary/encode.js +219 -0
- package/src/WABinary/generic-utils.d.ts +76 -0
- package/src/WABinary/generic-utils.js +214 -0
- package/src/WABinary/index.d.ts +5 -0
- package/src/WABinary/index.js +5 -0
- package/src/WABinary/jid-utils.d.ts +30 -0
- package/src/WABinary/jid-utils.js +97 -0
- package/src/WABinary/types.d.ts +1 -0
- package/src/WABinary/types.js +0 -0
- package/src/WAM/BinaryInfo.d.ts +7 -0
- package/src/WAM/BinaryInfo.js +9 -0
- package/src/WAM/constants.d.ts +34926 -0
- package/src/WAM/constants.js +22852 -0
- package/src/WAM/encode.d.ts +1 -0
- package/src/WAM/encode.js +148 -0
- package/src/WAM/index.d.ts +3 -0
- package/src/WAM/index.js +3 -0
- package/src/WAUSync/Protocols/USyncContactProtocol.d.ts +36 -0
- package/src/WAUSync/Protocols/USyncContactProtocol.js +50 -0
- package/src/WAUSync/Protocols/USyncDeviceProtocol.d.ts +22 -0
- package/src/WAUSync/Protocols/USyncDeviceProtocol.js +51 -0
- package/src/WAUSync/Protocols/USyncDisappearingModeProtocol.d.ts +12 -0
- package/src/WAUSync/Protocols/USyncDisappearingModeProtocol.js +26 -0
- package/src/WAUSync/Protocols/USyncStatusProtocol.d.ts +12 -0
- package/src/WAUSync/Protocols/USyncStatusProtocol.js +37 -0
- package/src/WAUSync/Protocols/USyncUsernameProtocol.d.ts +9 -0
- package/src/WAUSync/Protocols/USyncUsernameProtocol.js +23 -0
- package/src/WAUSync/Protocols/UsyncBotProfileProtocol.d.ts +38 -0
- package/src/WAUSync/Protocols/UsyncBotProfileProtocol.js +49 -0
- package/src/WAUSync/Protocols/UsyncLIDProtocol.d.ts +14 -0
- package/src/WAUSync/Protocols/UsyncLIDProtocol.js +28 -0
- package/src/WAUSync/Protocols/index.d.ts +5 -0
- package/src/WAUSync/Protocols/index.js +5 -0
- package/src/WAUSync/USyncQuery.d.ts +20 -0
- package/src/WAUSync/USyncQuery.js +93 -0
- package/src/WAUSync/USyncUser.d.ts +16 -0
- package/src/WAUSync/USyncUser.js +30 -0
- package/src/WAUSync/index.d.ts +3 -0
- package/src/WAUSync/index.js +3 -0
- package/src/assets/wasm/README.md +76 -0
- package/src/assets/wasm/loader.js +5 -0
- package/src/assets/wasm/whatsapp.wasm +0 -0
- package/src/assets/wasm/worker-modules.js +273 -0
- package/src/index.d.ts +43 -0
- package/src/index.js +48 -0
|
@@ -0,0 +1,210 @@
|
|
|
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;
|