@nerxa/socketon 0.0.0-stage → 1.21.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/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 +125 -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 +77 -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,449 @@
|
|
|
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;
|