@vinzsocket/baileys 3.3.0 → 3.3.2
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/lib/Modded/message_builder.js +2330 -0
- package/lib/Socket/dugong.js +30 -0
- package/lib/Types/Newsletter.d.ts +135 -0
- package/lib/Types/Newsletter.js +31 -0
- package/lib/Utils/index.js +2 -0
- package/lib/Utils/rich-messages.d.ts +277 -0
- package/lib/Utils/rich-messages.js +1144 -0
- package/lib/Utils/sticker-pack.d.ts +10 -0
- package/lib/Utils/sticker-pack.js +111 -0
- package/lib/VoIP/audio-feeder.d.ts +15 -0
- package/lib/VoIP/audio-feeder.js +132 -0
- package/lib/VoIP/index.js +277 -0
- package/lib/VoIP/relay-transport.d.ts +43 -0
- package/lib/VoIP/relay-transport.js +559 -0
- package/lib/VoIP/signaling.js +594 -0
- package/lib/VoIP/types.d.ts +69 -0
- package/lib/VoIP/types.js +17 -0
- package/lib/VoIP/wasm-engine.d.ts +103 -0
- package/lib/VoIP/wasm-engine.js +1214 -0
- package/lib/VoIP/worker-bootstrap.js +1042 -0
- package/lib/assets/wasm/loader.js +5 -0
- package/lib/assets/wasm/whatsapp.wasm +0 -0
- package/lib/assets/wasm/worker-modules.js +273 -0
- package/lib/index.js +2 -0
- package/package.json +7 -3
package/lib/Socket/dugong.js
CHANGED
|
@@ -497,6 +497,36 @@ export class ExtendedMessageBuilder {
|
|
|
497
497
|
innerMessage = await this.bail.generateWAMessageContent(s, { upload: this.waUploadToServer });
|
|
498
498
|
}
|
|
499
499
|
|
|
500
|
+
// PATCH V4 (diambil dari Ourin Baileys, kebukti jalan lewat testing user —
|
|
501
|
+
// lihat CHANGELOG): WA butuh contextInfo.isGroupStatus + statusSourceType di
|
|
502
|
+
// level pesan supaya klien nge-render sebagai ring status, bukan cuma nampil
|
|
503
|
+
// sebagai pesan grup biasa. additionalNodes <meta is_vsn2> di bawah TETAP
|
|
504
|
+
// dipertahankan (gak ada bukti itu bikin masalah), tapi contextInfo ini yang
|
|
505
|
+
// di implementasi Ourin kebukti jadi kunci utamanya — dan itu diverifikasi
|
|
506
|
+
// jalan buat foto & video langsung dari testing user, bukan cuma teori.
|
|
507
|
+
const statusMsgKey = Object.keys(innerMessage).find(
|
|
508
|
+
(k) => innerMessage[k] && typeof innerMessage[k] === 'object'
|
|
509
|
+
);
|
|
510
|
+
if (statusMsgKey) {
|
|
511
|
+
innerMessage[statusMsgKey].contextInfo = innerMessage[statusMsgKey].contextInfo || {};
|
|
512
|
+
innerMessage[statusMsgKey].contextInfo.isGroupStatus = true;
|
|
513
|
+
if (typeof innerMessage[statusMsgKey].contextInfo.statusSourceType === 'undefined') {
|
|
514
|
+
// Nilai ini persis enum StatusSourceType resmi di WAProto.proto:
|
|
515
|
+
// IMAGE=0, VIDEO=1, GIF=2, AUDIO=3, TEXT=4, MUSIC_STANDALONE=5.
|
|
516
|
+
// Implementasi Ourin sendiri cuma isi image/video/audio/text (gif ikut
|
|
517
|
+
// video); di sini gif dipisah ke nilai 2 miliknya sendiri karena memang
|
|
518
|
+
// ada di enum resminya. sticker & document SENGAJA gak diisi — gak ada
|
|
519
|
+
// nilai enum yang cocok buat keduanya (kemungkinan besar memang gak
|
|
520
|
+
// didukung sebagai tipe status asli oleh WhatsApp), sama seperti
|
|
521
|
+
// implementasi Ourin yang jadi rujukan di sini.
|
|
522
|
+
if (s.image || s.card) innerMessage[statusMsgKey].contextInfo.statusSourceType = 0;
|
|
523
|
+
else if (s.gif) innerMessage[statusMsgKey].contextInfo.statusSourceType = 2;
|
|
524
|
+
else if (s.video) innerMessage[statusMsgKey].contextInfo.statusSourceType = 1;
|
|
525
|
+
else if (s.audio) innerMessage[statusMsgKey].contextInfo.statusSourceType = 3;
|
|
526
|
+
else if (statusMsgKey === 'extendedTextMessage') innerMessage[statusMsgKey].contextInfo.statusSourceType = 4;
|
|
527
|
+
}
|
|
528
|
+
}
|
|
529
|
+
|
|
500
530
|
// Wrap dengan messageContextInfo + messageSecret — WAJIB supaya konten bisa ditampilkan
|
|
501
531
|
const wrapped = {
|
|
502
532
|
groupStatusMessageV2: {
|
|
@@ -0,0 +1,135 @@
|
|
|
1
|
+
export declare enum XWAPaths {
|
|
2
|
+
xwa2_newsletter_create = "xwa2_newsletter_create",
|
|
3
|
+
xwa2_newsletter_subscribers = "xwa2_newsletter_subscribers",
|
|
4
|
+
xwa2_newsletter_view = "xwa2_newsletter_view",
|
|
5
|
+
xwa2_newsletter_metadata = "xwa2_newsletter",
|
|
6
|
+
xwa2_newsletter_admin_count = "xwa2_newsletter_admin",
|
|
7
|
+
xwa2_newsletter_mute_v2 = "xwa2_newsletter_mute_v2",
|
|
8
|
+
xwa2_newsletter_unmute_v2 = "xwa2_newsletter_unmute_v2",
|
|
9
|
+
xwa2_newsletter_follow = "xwa2_newsletter_follow",
|
|
10
|
+
xwa2_newsletter_unfollow = "xwa2_newsletter_unfollow",
|
|
11
|
+
xwa2_newsletter_change_owner = "xwa2_newsletter_change_owner",
|
|
12
|
+
xwa2_newsletter_demote = "xwa2_newsletter_demote",
|
|
13
|
+
xwa2_newsletter_delete_v2 = "xwa2_newsletter_delete_v2"
|
|
14
|
+
}
|
|
15
|
+
export declare enum QueryIds {
|
|
16
|
+
CREATE = "8823471724422422",
|
|
17
|
+
UPDATE_METADATA = "24250201037901610",
|
|
18
|
+
METADATA = "6563316087068696",
|
|
19
|
+
SUBSCRIBERS = "9783111038412085",
|
|
20
|
+
FOLLOW = "7871414976211147",
|
|
21
|
+
UNFOLLOW = "7238632346214362",
|
|
22
|
+
MUTE = "29766401636284406",
|
|
23
|
+
UNMUTE = "9864994326891137",
|
|
24
|
+
ADMIN_COUNT = "7130823597031706",
|
|
25
|
+
CHANGE_OWNER = "7341777602580933",
|
|
26
|
+
DEMOTE = "6551828931592903",
|
|
27
|
+
DELETE = "30062808666639665"
|
|
28
|
+
}
|
|
29
|
+
export type NewsletterUpdate = {
|
|
30
|
+
name?: string;
|
|
31
|
+
description?: string;
|
|
32
|
+
picture?: string;
|
|
33
|
+
};
|
|
34
|
+
export interface NewsletterCreateResponse {
|
|
35
|
+
id: string;
|
|
36
|
+
state: {
|
|
37
|
+
type: string;
|
|
38
|
+
};
|
|
39
|
+
thread_metadata: {
|
|
40
|
+
creation_time: string;
|
|
41
|
+
description: {
|
|
42
|
+
id: string;
|
|
43
|
+
text: string;
|
|
44
|
+
update_time: string;
|
|
45
|
+
};
|
|
46
|
+
handle: string | null;
|
|
47
|
+
invite: string;
|
|
48
|
+
name: {
|
|
49
|
+
id: string;
|
|
50
|
+
text: string;
|
|
51
|
+
update_time: string;
|
|
52
|
+
};
|
|
53
|
+
picture: {
|
|
54
|
+
direct_path: string;
|
|
55
|
+
id: string;
|
|
56
|
+
type: string;
|
|
57
|
+
};
|
|
58
|
+
preview: {
|
|
59
|
+
direct_path: string;
|
|
60
|
+
id: string;
|
|
61
|
+
type: string;
|
|
62
|
+
};
|
|
63
|
+
subscribers_count: string;
|
|
64
|
+
verification: 'VERIFIED' | 'UNVERIFIED';
|
|
65
|
+
};
|
|
66
|
+
viewer_metadata: {
|
|
67
|
+
mute: 'ON' | 'OFF';
|
|
68
|
+
role: NewsletterViewRole;
|
|
69
|
+
};
|
|
70
|
+
}
|
|
71
|
+
export interface NewsletterCreateResponse {
|
|
72
|
+
id: string;
|
|
73
|
+
state: {
|
|
74
|
+
type: string;
|
|
75
|
+
};
|
|
76
|
+
thread_metadata: {
|
|
77
|
+
creation_time: string;
|
|
78
|
+
description: {
|
|
79
|
+
id: string;
|
|
80
|
+
text: string;
|
|
81
|
+
update_time: string;
|
|
82
|
+
};
|
|
83
|
+
handle: string | null;
|
|
84
|
+
invite: string;
|
|
85
|
+
name: {
|
|
86
|
+
id: string;
|
|
87
|
+
text: string;
|
|
88
|
+
update_time: string;
|
|
89
|
+
};
|
|
90
|
+
picture: {
|
|
91
|
+
direct_path: string;
|
|
92
|
+
id: string;
|
|
93
|
+
type: string;
|
|
94
|
+
};
|
|
95
|
+
preview: {
|
|
96
|
+
direct_path: string;
|
|
97
|
+
id: string;
|
|
98
|
+
type: string;
|
|
99
|
+
};
|
|
100
|
+
subscribers_count: string;
|
|
101
|
+
verification: 'VERIFIED' | 'UNVERIFIED';
|
|
102
|
+
};
|
|
103
|
+
viewer_metadata: {
|
|
104
|
+
mute: 'ON' | 'OFF';
|
|
105
|
+
role: NewsletterViewRole;
|
|
106
|
+
};
|
|
107
|
+
}
|
|
108
|
+
export type NewsletterViewRole = 'ADMIN' | 'GUEST' | 'OWNER' | 'SUBSCRIBER';
|
|
109
|
+
export interface NewsletterMetadata {
|
|
110
|
+
id: string;
|
|
111
|
+
owner?: string;
|
|
112
|
+
name: string;
|
|
113
|
+
description?: string;
|
|
114
|
+
invite?: string;
|
|
115
|
+
creation_time?: number;
|
|
116
|
+
subscribers?: number;
|
|
117
|
+
picture?: {
|
|
118
|
+
url?: string;
|
|
119
|
+
directPath?: string;
|
|
120
|
+
mediaKey?: string;
|
|
121
|
+
id?: string;
|
|
122
|
+
};
|
|
123
|
+
verification?: 'VERIFIED' | 'UNVERIFIED';
|
|
124
|
+
reaction_codes?: {
|
|
125
|
+
code: string;
|
|
126
|
+
count: number;
|
|
127
|
+
}[];
|
|
128
|
+
mute_state?: 'ON' | 'OFF';
|
|
129
|
+
thread_metadata?: {
|
|
130
|
+
creation_time?: number;
|
|
131
|
+
name?: string;
|
|
132
|
+
description?: string;
|
|
133
|
+
};
|
|
134
|
+
}
|
|
135
|
+
//# sourceMappingURL=Newsletter.d.ts.map
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
export var XWAPaths;
|
|
2
|
+
(function (XWAPaths) {
|
|
3
|
+
XWAPaths["xwa2_newsletter_create"] = "xwa2_newsletter_create";
|
|
4
|
+
XWAPaths["xwa2_newsletter_subscribers"] = "xwa2_newsletter_subscribers";
|
|
5
|
+
XWAPaths["xwa2_newsletter_view"] = "xwa2_newsletter_view";
|
|
6
|
+
XWAPaths["xwa2_newsletter_metadata"] = "xwa2_newsletter";
|
|
7
|
+
XWAPaths["xwa2_newsletter_admin_count"] = "xwa2_newsletter_admin";
|
|
8
|
+
XWAPaths["xwa2_newsletter_mute_v2"] = "xwa2_newsletter_mute_v2";
|
|
9
|
+
XWAPaths["xwa2_newsletter_unmute_v2"] = "xwa2_newsletter_unmute_v2";
|
|
10
|
+
XWAPaths["xwa2_newsletter_follow"] = "xwa2_newsletter_follow";
|
|
11
|
+
XWAPaths["xwa2_newsletter_unfollow"] = "xwa2_newsletter_unfollow";
|
|
12
|
+
XWAPaths["xwa2_newsletter_change_owner"] = "xwa2_newsletter_change_owner";
|
|
13
|
+
XWAPaths["xwa2_newsletter_demote"] = "xwa2_newsletter_demote";
|
|
14
|
+
XWAPaths["xwa2_newsletter_delete_v2"] = "xwa2_newsletter_delete_v2";
|
|
15
|
+
})(XWAPaths || (XWAPaths = {}));
|
|
16
|
+
export var QueryIds;
|
|
17
|
+
(function (QueryIds) {
|
|
18
|
+
QueryIds["CREATE"] = "8823471724422422";
|
|
19
|
+
QueryIds["UPDATE_METADATA"] = "24250201037901610";
|
|
20
|
+
QueryIds["METADATA"] = "6563316087068696";
|
|
21
|
+
QueryIds["SUBSCRIBERS"] = "9783111038412085";
|
|
22
|
+
QueryIds["FOLLOW"] = "7871414976211147";
|
|
23
|
+
QueryIds["UNFOLLOW"] = "7238632346214362";
|
|
24
|
+
QueryIds["MUTE"] = "29766401636284406";
|
|
25
|
+
QueryIds["UNMUTE"] = "9864994326891137";
|
|
26
|
+
QueryIds["ADMIN_COUNT"] = "7130823597031706";
|
|
27
|
+
QueryIds["CHANGE_OWNER"] = "7341777602580933";
|
|
28
|
+
QueryIds["DEMOTE"] = "6551828931592903";
|
|
29
|
+
QueryIds["DELETE"] = "30062808666639665";
|
|
30
|
+
})(QueryIds || (QueryIds = {}));
|
|
31
|
+
//# sourceMappingURL=Newsletter.js.map
|
package/lib/Utils/index.js
CHANGED
|
@@ -0,0 +1,277 @@
|
|
|
1
|
+
import { proto } from "../../WAProto/index.js";
|
|
2
|
+
export declare const JS_KEYWORDS: Set<string>;
|
|
3
|
+
export declare const PYTHON_KEYWORDS: Set<string>;
|
|
4
|
+
export declare const GO_KEYWORDS: Set<string>;
|
|
5
|
+
export declare const LUA_KEYWORDS: Set<string>;
|
|
6
|
+
export declare const BASH_KEYWORDS: Set<string>;
|
|
7
|
+
export declare const LANGUAGE_KEYWORDS: Record<string, Set<string>>;
|
|
8
|
+
export declare enum CodeHighlightType {
|
|
9
|
+
DEFAULT = 0,
|
|
10
|
+
KEYWORD = 1,
|
|
11
|
+
METHOD = 2,
|
|
12
|
+
STRING = 3,
|
|
13
|
+
NUMBER = 4,
|
|
14
|
+
COMMENT = 5,
|
|
15
|
+
}
|
|
16
|
+
export declare enum RichSubMessageType {
|
|
17
|
+
UNKNOWN = 0,
|
|
18
|
+
GRID_IMAGE = 1,
|
|
19
|
+
TEXT = 2,
|
|
20
|
+
INLINE_IMAGE = 3,
|
|
21
|
+
TABLE = 4,
|
|
22
|
+
CODE = 5,
|
|
23
|
+
DYNAMIC = 6,
|
|
24
|
+
MAP = 7,
|
|
25
|
+
LATEX = 8,
|
|
26
|
+
CONTENT_ITEMS = 9,
|
|
27
|
+
}
|
|
28
|
+
export interface RichMessageOptions {
|
|
29
|
+
headerText?: string;
|
|
30
|
+
footer?: string;
|
|
31
|
+
title?: string;
|
|
32
|
+
language?: string;
|
|
33
|
+
}
|
|
34
|
+
export interface CodeBlockOptions extends RichMessageOptions {
|
|
35
|
+
language?: string;
|
|
36
|
+
}
|
|
37
|
+
export interface LatexExpression {
|
|
38
|
+
latexExpression: string;
|
|
39
|
+
url: string;
|
|
40
|
+
width: number;
|
|
41
|
+
height: number;
|
|
42
|
+
fontHeight?: number;
|
|
43
|
+
imageTopPadding?: number;
|
|
44
|
+
imageLeadingPadding?: number;
|
|
45
|
+
imageBottomPadding?: number;
|
|
46
|
+
imageTrailingPadding?: number;
|
|
47
|
+
}
|
|
48
|
+
export interface LatexOptions extends RichMessageOptions {
|
|
49
|
+
text?: string;
|
|
50
|
+
expressions: LatexExpression[];
|
|
51
|
+
}
|
|
52
|
+
export interface LatexImageOptions extends RichMessageOptions {
|
|
53
|
+
text?: string;
|
|
54
|
+
expressions: {
|
|
55
|
+
latexExpression: string;
|
|
56
|
+
}[];
|
|
57
|
+
}
|
|
58
|
+
export type LatexRenderFn = (latex: string) => Promise<{
|
|
59
|
+
buffer: Buffer;
|
|
60
|
+
width: number;
|
|
61
|
+
height: number;
|
|
62
|
+
}>;
|
|
63
|
+
export type MediaUploadFn = (
|
|
64
|
+
imageBuffer: Buffer,
|
|
65
|
+
mediaType: string,
|
|
66
|
+
) => Promise<{
|
|
67
|
+
url: string;
|
|
68
|
+
directPath: string;
|
|
69
|
+
}>;
|
|
70
|
+
export interface UnifiedResponseOptions {
|
|
71
|
+
data: Buffer | Uint8Array;
|
|
72
|
+
headerText?: string;
|
|
73
|
+
footer?: string;
|
|
74
|
+
}
|
|
75
|
+
export interface CapturedUnifiedResponse {
|
|
76
|
+
unifiedResponse: {
|
|
77
|
+
data: Uint8Array;
|
|
78
|
+
};
|
|
79
|
+
submessages: any[];
|
|
80
|
+
contextInfo: any;
|
|
81
|
+
}
|
|
82
|
+
export interface QuotedMessage {
|
|
83
|
+
key: {
|
|
84
|
+
id?: string | null;
|
|
85
|
+
participant?: string | null;
|
|
86
|
+
remoteJid?: string | null;
|
|
87
|
+
fromMe?: boolean | null;
|
|
88
|
+
};
|
|
89
|
+
sender?: string;
|
|
90
|
+
message?: proto.IMessage | null;
|
|
91
|
+
}
|
|
92
|
+
interface CodeToken {
|
|
93
|
+
highlightType: number;
|
|
94
|
+
codeContent: string;
|
|
95
|
+
}
|
|
96
|
+
export declare const tokenizeCode: (
|
|
97
|
+
codeStr: string,
|
|
98
|
+
language?: string,
|
|
99
|
+
) => CodeToken[];
|
|
100
|
+
export declare const buildRichContextInfo: (
|
|
101
|
+
quoted?: QuotedMessage | null,
|
|
102
|
+
) => Record<string, any>;
|
|
103
|
+
export declare const buildBotForwardedMessage: (
|
|
104
|
+
submessages: any[],
|
|
105
|
+
contextInfo: Record<string, any>,
|
|
106
|
+
unifiedResponse?: {
|
|
107
|
+
data: Buffer | Uint8Array;
|
|
108
|
+
} | null,
|
|
109
|
+
) => any;
|
|
110
|
+
export declare const generateTableContent: (
|
|
111
|
+
title: string,
|
|
112
|
+
headers: string[],
|
|
113
|
+
rows: string[][],
|
|
114
|
+
quoted?: QuotedMessage | null,
|
|
115
|
+
options?: RichMessageOptions,
|
|
116
|
+
) => {
|
|
117
|
+
message: any;
|
|
118
|
+
messageId: string;
|
|
119
|
+
};
|
|
120
|
+
export declare const generateListContent: (
|
|
121
|
+
title: string,
|
|
122
|
+
items: (string | string[])[],
|
|
123
|
+
quoted?: QuotedMessage | null,
|
|
124
|
+
options?: RichMessageOptions,
|
|
125
|
+
) => {
|
|
126
|
+
message: any;
|
|
127
|
+
messageId: string;
|
|
128
|
+
};
|
|
129
|
+
export declare const generateCodeBlockContent: (
|
|
130
|
+
code: string,
|
|
131
|
+
quoted?: QuotedMessage | null,
|
|
132
|
+
options?: CodeBlockOptions,
|
|
133
|
+
) => {
|
|
134
|
+
message: any;
|
|
135
|
+
messageId: string;
|
|
136
|
+
};
|
|
137
|
+
export declare const generateLatexContent: (
|
|
138
|
+
quoted: QuotedMessage | null | undefined,
|
|
139
|
+
options: LatexOptions,
|
|
140
|
+
) => {
|
|
141
|
+
message: any;
|
|
142
|
+
messageId: string;
|
|
143
|
+
};
|
|
144
|
+
export declare const generateLatexImageContent: (
|
|
145
|
+
quoted: QuotedMessage | null | undefined,
|
|
146
|
+
options: LatexImageOptions,
|
|
147
|
+
uploadFn: MediaUploadFn,
|
|
148
|
+
renderLatexToPng: LatexRenderFn,
|
|
149
|
+
) => Promise<{
|
|
150
|
+
message: any;
|
|
151
|
+
messageId: string;
|
|
152
|
+
}>;
|
|
153
|
+
export declare const generateLatexInlineImageContent: (
|
|
154
|
+
quoted: QuotedMessage | null | undefined,
|
|
155
|
+
options: LatexImageOptions,
|
|
156
|
+
uploadFn: MediaUploadFn,
|
|
157
|
+
renderLatexToPng: LatexRenderFn,
|
|
158
|
+
) => Promise<{
|
|
159
|
+
message: any;
|
|
160
|
+
messageId: string;
|
|
161
|
+
}>;
|
|
162
|
+
export declare const captureUnifiedResponse: (
|
|
163
|
+
msg: proto.IMessage,
|
|
164
|
+
) => CapturedUnifiedResponse | null;
|
|
165
|
+
export declare const generateUnifiedResponseContent: (
|
|
166
|
+
quoted: QuotedMessage | null | undefined,
|
|
167
|
+
captured: CapturedUnifiedResponse,
|
|
168
|
+
) => {
|
|
169
|
+
message: any;
|
|
170
|
+
messageId: string;
|
|
171
|
+
};
|
|
172
|
+
export declare const generateRichMessageContent: (
|
|
173
|
+
submessages: any[],
|
|
174
|
+
quoted?: QuotedMessage | null,
|
|
175
|
+
) => {
|
|
176
|
+
message: any;
|
|
177
|
+
messageId: string;
|
|
178
|
+
};
|
|
179
|
+
export interface CodeBlockV2Options extends RichMessageOptions {
|
|
180
|
+
language?: string;
|
|
181
|
+
text?: string;
|
|
182
|
+
}
|
|
183
|
+
interface UnifiedCodeToken {
|
|
184
|
+
content: string;
|
|
185
|
+
type: "DEFAULT" | "KEYWORD" | "METHOD" | "STR" | "NUMBER" | "COMMENT";
|
|
186
|
+
}
|
|
187
|
+
interface TokenizeCodeV2Result {
|
|
188
|
+
codeBlock: CodeToken[];
|
|
189
|
+
unified_codeBlock: UnifiedCodeToken[];
|
|
190
|
+
}
|
|
191
|
+
export declare const tokenizeCodeV2: (
|
|
192
|
+
code: string,
|
|
193
|
+
language?: string,
|
|
194
|
+
) => TokenizeCodeV2Result;
|
|
195
|
+
interface UnifiedTableRow {
|
|
196
|
+
is_header: boolean;
|
|
197
|
+
cells: string[];
|
|
198
|
+
}
|
|
199
|
+
interface TableMetadataV2Result {
|
|
200
|
+
title: string;
|
|
201
|
+
rows: {
|
|
202
|
+
items: string[];
|
|
203
|
+
isHeading?: boolean;
|
|
204
|
+
}[];
|
|
205
|
+
unified_rows: UnifiedTableRow[];
|
|
206
|
+
}
|
|
207
|
+
export declare const toTableMetadataV2: (
|
|
208
|
+
arr: string[],
|
|
209
|
+
) => TableMetadataV2Result;
|
|
210
|
+
export interface TableV2Options extends RichMessageOptions {
|
|
211
|
+
text?: string;
|
|
212
|
+
}
|
|
213
|
+
export declare const generateTableContentV2: (
|
|
214
|
+
table: string[],
|
|
215
|
+
quoted?: QuotedMessage | null,
|
|
216
|
+
options?: TableV2Options,
|
|
217
|
+
) => {
|
|
218
|
+
message: any;
|
|
219
|
+
messageId: string;
|
|
220
|
+
};
|
|
221
|
+
export declare const generateCodeBlockContentV2: (
|
|
222
|
+
code: string,
|
|
223
|
+
quoted?: QuotedMessage | null,
|
|
224
|
+
options?: CodeBlockV2Options,
|
|
225
|
+
) => {
|
|
226
|
+
message: any;
|
|
227
|
+
messageId: string;
|
|
228
|
+
};
|
|
229
|
+
export interface Citation {
|
|
230
|
+
sourceQuery?: string;
|
|
231
|
+
faviconCdnUrl?: string;
|
|
232
|
+
citationNumber?: number;
|
|
233
|
+
sourceTitle?: string;
|
|
234
|
+
}
|
|
235
|
+
export interface Proof {
|
|
236
|
+
version?: number;
|
|
237
|
+
useCase?: number;
|
|
238
|
+
signature?: string;
|
|
239
|
+
certificateChain?: string[];
|
|
240
|
+
}
|
|
241
|
+
export interface LinkMessageOptions extends RichMessageOptions {
|
|
242
|
+
botJid?: string;
|
|
243
|
+
forwardingScore?: number;
|
|
244
|
+
citations?: Citation[];
|
|
245
|
+
proofs?: Proof[];
|
|
246
|
+
}
|
|
247
|
+
export interface LinkV2MessageOptions extends RichMessageOptions {
|
|
248
|
+
searchEngine?: string;
|
|
249
|
+
}
|
|
250
|
+
export declare const generateLinkContent: (
|
|
251
|
+
text: string,
|
|
252
|
+
links: (string | { url: string; displayName?: string })[],
|
|
253
|
+
quoted?: QuotedMessage | null,
|
|
254
|
+
options?: LinkMessageOptions,
|
|
255
|
+
) => {
|
|
256
|
+
message: any;
|
|
257
|
+
messageId: string;
|
|
258
|
+
};
|
|
259
|
+
export declare const generateLinkContentV2: (
|
|
260
|
+
text: string,
|
|
261
|
+
links: (
|
|
262
|
+
| string
|
|
263
|
+
| {
|
|
264
|
+
url: string;
|
|
265
|
+
displayName?: string;
|
|
266
|
+
sourceDisplayName?: string;
|
|
267
|
+
sourceSubtitle?: string;
|
|
268
|
+
}
|
|
269
|
+
)[],
|
|
270
|
+
quoted?: QuotedMessage | null,
|
|
271
|
+
options?: LinkV2MessageOptions,
|
|
272
|
+
) => {
|
|
273
|
+
message: any;
|
|
274
|
+
messageId: string;
|
|
275
|
+
};
|
|
276
|
+
export {};
|
|
277
|
+
//# sourceMappingURL=rich-messages.d.ts.map
|