angularsockets 1.4.4 → 1.4.5
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/README.md +90 -224
- package/lib/Defaults/baileys-version.json +1 -1
- package/lib/Defaults/index.d.ts +16 -5
- package/lib/Defaults/index.js +23 -12
- package/lib/Socket/chats.d.ts +0 -12
- package/lib/Socket/chats.js +1 -38
- package/lib/Socket/messages-send.d.ts +0 -1
- package/lib/Socket/messages-send.js +255 -101
- package/lib/Socket/newsletter.js +88 -123
- package/lib/Socket/setup.js +481 -0
- package/lib/Socket/setup.ts +623 -0
- package/lib/Socket/socket.d.ts +270 -43
- package/lib/Socket/socket.js +1 -1
- package/lib/Types/Message.d.ts +0 -2
- package/lib/Types/Newsletter.d.ts +73 -97
- package/lib/Types/Newsletter.js +18 -38
- package/lib/Utils/generics.js +18 -5
- package/lib/Utils/index.d.ts +0 -2
- package/lib/Utils/index.js +0 -3
- package/lib/Utils/messages-media.d.ts +1 -5
- package/lib/Utils/messages-media.js +170 -77
- package/lib/Utils/messages.d.ts +5 -0
- package/lib/Utils/messages.js +78 -7
- package/lib/Utils/process-message.js +19 -0
- package/lib/Utils/validate-connection.js +77 -21
- package/lib/WABinary/jid-utils.d.ts +1 -0
- package/lib/WABinary/jid-utils.js +3 -1
- package/lib/index.js +10 -28
- package/package.json +28 -38
- package/LICENSE +0 -21
- package/README.MD +0 -170
- package/engine-requirements.js +0 -10
- package/lib/Socket/RHandler.d.ts +0 -416
- package/lib/Socket/RHandler.js +0 -530
- package/lib/Utils/audioToBuffer.js +0 -29
- package/lib/Utils/streamToBuffer.js +0 -15
- package/lib/index.js.bak +0 -56
package/lib/Socket/socket.d.ts
CHANGED
|
@@ -1,43 +1,270 @@
|
|
|
1
|
-
|
|
2
|
-
import {
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
1
|
+
// setup.d.ts by alip
|
|
2
|
+
import { proto } from '../../WAProto';
|
|
3
|
+
|
|
4
|
+
declare namespace NotForrAll {
|
|
5
|
+
interface MediaUploadOptions {
|
|
6
|
+
fileEncSha256?: Buffer;
|
|
7
|
+
mediaType?: string;
|
|
8
|
+
newsletter?: boolean;
|
|
9
|
+
}
|
|
10
|
+
|
|
11
|
+
type WAMediaUploadFunction = (
|
|
12
|
+
stream: Buffer | NodeJS.ReadableStream,
|
|
13
|
+
options?: MediaUploadOptions
|
|
14
|
+
) => Promise<{ url: string; directPath: string; mediaKey: Buffer; fileEncSha256: Buffer; fileSha256: Buffer; fileLength: number }>;
|
|
15
|
+
|
|
16
|
+
interface WAMessageContentGenerationOptions {
|
|
17
|
+
upload?: WAMediaUploadFunction;
|
|
18
|
+
mediaCache?: any;
|
|
19
|
+
options?: any;
|
|
20
|
+
logger?: any;
|
|
21
|
+
}
|
|
22
|
+
|
|
23
|
+
interface StickerMessage {
|
|
24
|
+
url: string;
|
|
25
|
+
fileSha256: Buffer | string;
|
|
26
|
+
fileEncSha256: Buffer | string;
|
|
27
|
+
mediaKey: Buffer | string;
|
|
28
|
+
mimetype: string;
|
|
29
|
+
directPath: string;
|
|
30
|
+
fileLength: number | string;
|
|
31
|
+
mediaKeyTimestamp: number | string;
|
|
32
|
+
isAnimated?: boolean;
|
|
33
|
+
stickerSentTs?: number | string;
|
|
34
|
+
isAvatar?: boolean;
|
|
35
|
+
isAiSticker?: boolean;
|
|
36
|
+
isLottie?: boolean;
|
|
37
|
+
}
|
|
38
|
+
|
|
39
|
+
interface PaymentMessage {
|
|
40
|
+
amount: number;
|
|
41
|
+
currency?: string;
|
|
42
|
+
from?: string;
|
|
43
|
+
expiry?: number;
|
|
44
|
+
sticker?: { stickerMessage: StickerMessage };
|
|
45
|
+
note?: string;
|
|
46
|
+
background?: {
|
|
47
|
+
id?: string;
|
|
48
|
+
fileLength?: string;
|
|
49
|
+
width?: number;
|
|
50
|
+
height?: number;
|
|
51
|
+
mimetype?: string;
|
|
52
|
+
placeholderArgb?: number;
|
|
53
|
+
textArgb?: number;
|
|
54
|
+
subtextArgb?: number;
|
|
55
|
+
};
|
|
56
|
+
}
|
|
57
|
+
|
|
58
|
+
interface ProductMessage {
|
|
59
|
+
title: string;
|
|
60
|
+
description: string;
|
|
61
|
+
thumbnail: Buffer | { url: string };
|
|
62
|
+
productId: string;
|
|
63
|
+
retailerId: string;
|
|
64
|
+
url: string;
|
|
65
|
+
body?: string;
|
|
66
|
+
footer?: string;
|
|
67
|
+
buttons?: proto.Message.InteractiveMessage.INativeFlowButton[];
|
|
68
|
+
priceAmount1000?: number | null;
|
|
69
|
+
currencyCode?: string;
|
|
70
|
+
}
|
|
71
|
+
|
|
72
|
+
interface InteractiveMessage {
|
|
73
|
+
title: string;
|
|
74
|
+
footer?: string;
|
|
75
|
+
thumbnail?: string;
|
|
76
|
+
image?: string | Buffer | { url: string };
|
|
77
|
+
video?: string | Buffer | { url: string };
|
|
78
|
+
document?: Buffer;
|
|
79
|
+
mimetype?: string;
|
|
80
|
+
fileName?: string;
|
|
81
|
+
jpegThumbnail?: Buffer;
|
|
82
|
+
contextInfo?: {
|
|
83
|
+
mentionedJid?: string[];
|
|
84
|
+
forwardingScore?: number;
|
|
85
|
+
isForwarded?: boolean;
|
|
86
|
+
externalAdReply?: {
|
|
87
|
+
title?: string;
|
|
88
|
+
body?: string;
|
|
89
|
+
mediaType?: number;
|
|
90
|
+
thumbnailUrl?: string;
|
|
91
|
+
mediaUrl?: string;
|
|
92
|
+
sourceUrl?: string;
|
|
93
|
+
showAdAttribution?: boolean;
|
|
94
|
+
renderLargerThumbnail?: boolean;
|
|
95
|
+
[key: string]: any;
|
|
96
|
+
};
|
|
97
|
+
[key: string]: any;
|
|
98
|
+
};
|
|
99
|
+
externalAdReply?: {
|
|
100
|
+
title?: string;
|
|
101
|
+
body?: string;
|
|
102
|
+
mediaType?: number;
|
|
103
|
+
thumbnailUrl?: string;
|
|
104
|
+
mediaUrl?: string;
|
|
105
|
+
sourceUrl?: string;
|
|
106
|
+
showAdAttribution?: boolean;
|
|
107
|
+
renderLargerThumbnail?: boolean;
|
|
108
|
+
[key: string]: any;
|
|
109
|
+
};
|
|
110
|
+
buttons?: proto.Message.InteractiveMessage.INativeFlowButton[];
|
|
111
|
+
nativeFlowMessage?: {
|
|
112
|
+
messageParamsJson?: string;
|
|
113
|
+
buttons?: proto.Message.InteractiveMessage.INativeFlowButton[];
|
|
114
|
+
[key: string]: any;
|
|
115
|
+
};
|
|
116
|
+
}
|
|
117
|
+
|
|
118
|
+
interface AlbumItem {
|
|
119
|
+
image?: { url: string; caption?: string };
|
|
120
|
+
video?: { url: string; caption?: string };
|
|
121
|
+
}
|
|
122
|
+
|
|
123
|
+
interface EventMessageLocation {
|
|
124
|
+
degreesLatitude: number;
|
|
125
|
+
degreesLongitude: number;
|
|
126
|
+
name: string;
|
|
127
|
+
}
|
|
128
|
+
|
|
129
|
+
interface EventMessage {
|
|
130
|
+
isCanceled?: boolean;
|
|
131
|
+
name: string;
|
|
132
|
+
description: string;
|
|
133
|
+
location?: EventMessageLocation;
|
|
134
|
+
joinLink?: string;
|
|
135
|
+
startTime?: string | number;
|
|
136
|
+
endTime?: string | number;
|
|
137
|
+
extraGuestsAllowed?: boolean;
|
|
138
|
+
}
|
|
139
|
+
|
|
140
|
+
interface PollVote {
|
|
141
|
+
optionName: string;
|
|
142
|
+
optionVoteCount: string | number;
|
|
143
|
+
}
|
|
144
|
+
|
|
145
|
+
interface PollResultMessage {
|
|
146
|
+
name: string;
|
|
147
|
+
pollVotes: PollVote[];
|
|
148
|
+
}
|
|
149
|
+
|
|
150
|
+
// --- BARU: List Message ---
|
|
151
|
+
interface ListSection {
|
|
152
|
+
title: string;
|
|
153
|
+
rows: ListRow[];
|
|
154
|
+
}
|
|
155
|
+
|
|
156
|
+
interface ListRow {
|
|
157
|
+
rowId: string;
|
|
158
|
+
title: string;
|
|
159
|
+
description?: string;
|
|
160
|
+
}
|
|
161
|
+
|
|
162
|
+
interface ListMessage {
|
|
163
|
+
title: string;
|
|
164
|
+
description: string;
|
|
165
|
+
buttonText: string;
|
|
166
|
+
sections: ListSection[];
|
|
167
|
+
listType?: number;
|
|
168
|
+
contextInfo?: proto.IMessageContextInfo;
|
|
169
|
+
footer?: string;
|
|
170
|
+
}
|
|
171
|
+
|
|
172
|
+
// --- BARU: Group Story ---
|
|
173
|
+
interface GroupStoryMessage {
|
|
174
|
+
image?: Buffer | string | { url: string };
|
|
175
|
+
video?: Buffer | string | { url: string };
|
|
176
|
+
caption?: string;
|
|
177
|
+
mentions?: string[];
|
|
178
|
+
jpegThumbnail?: Buffer;
|
|
179
|
+
}
|
|
180
|
+
|
|
181
|
+
interface MessageContent {
|
|
182
|
+
requestPaymentMessage?: PaymentMessage;
|
|
183
|
+
productMessage?: ProductMessage;
|
|
184
|
+
interactiveMessage?: InteractiveMessage;
|
|
185
|
+
albumMessage?: AlbumItem[];
|
|
186
|
+
eventMessage?: EventMessage;
|
|
187
|
+
pollResultMessage?: PollResultMessage;
|
|
188
|
+
sender?: string;
|
|
189
|
+
listMessage?: ListMessage; // <-- BARU
|
|
190
|
+
groupStoryMessage?: GroupStoryMessage; // <-- BARU
|
|
191
|
+
}
|
|
192
|
+
|
|
193
|
+
interface MessageOptions {
|
|
194
|
+
quoted?: proto.IWebMessageInfo;
|
|
195
|
+
filter?: boolean;
|
|
196
|
+
}
|
|
197
|
+
|
|
198
|
+
interface Utils {
|
|
199
|
+
// Asumsi Utils punya akses ke auth state untuk jid
|
|
200
|
+
auth: { creds: { me: { id: string } } };
|
|
201
|
+
unixTimestampSeconds: () => number; // Fungsi yang umum ada di Utils
|
|
202
|
+
prepareWAMessageMedia: (media: any, options: WAMessageContentGenerationOptions) => Promise<any>;
|
|
203
|
+
generateWAMessageContent: (content: any, options: WAMessageContentGenerationOptions) => Promise<any>;
|
|
204
|
+
generateWAMessageFromContent: (jid: string, content: any, options?: any) => Promise<any>;
|
|
205
|
+
generateWAMessage: (jid: string, content: any, options?: any) => Promise<any>;
|
|
206
|
+
generateMessageID: () => string;
|
|
207
|
+
// Asumsi Utils punya fungsi WABinary terkait JID
|
|
208
|
+
jidNormalizedUser: (jid: string) => string;
|
|
209
|
+
isJidGroup: (jid: string) => boolean;
|
|
210
|
+
}
|
|
211
|
+
}
|
|
212
|
+
|
|
213
|
+
declare class NotForrAll {
|
|
214
|
+
constructor(
|
|
215
|
+
utils: NotForrAll.Utils,
|
|
216
|
+
waUploadToServer: NotForrAll.WAMediaUploadFunction,
|
|
217
|
+
relayMessageFn?: (jid: string, content: any, options?: any) => Promise<any>
|
|
218
|
+
);
|
|
219
|
+
|
|
220
|
+
detectType(content: NotForrAll.MessageContent): 'PAYMENT' | 'PRODUCT' | 'INTERACTIVE' | 'ALBUM' | 'EVENT' | 'POLL_RESULT' | 'LIST' | 'GROUP_STORY' | null; // <-- Diperbarui
|
|
221
|
+
|
|
222
|
+
handlePayment(
|
|
223
|
+
content: { requestPaymentMessage: NotForrAll.PaymentMessage },
|
|
224
|
+
quoted?: proto.IWebMessageInfo
|
|
225
|
+
): Promise<{ requestPaymentMessage: proto.Message.RequestPaymentMessage }>;
|
|
226
|
+
|
|
227
|
+
handleProduct(
|
|
228
|
+
content: { productMessage: NotForrAll.ProductMessage },
|
|
229
|
+
jid: string,
|
|
230
|
+
quoted?: proto.IWebMessageInfo
|
|
231
|
+
): Promise<{ viewOnceMessage: proto.Message.ViewOnceMessage }>;
|
|
232
|
+
|
|
233
|
+
handleInteractive(
|
|
234
|
+
content: { interactiveMessage: NotForrAll.InteractiveMessage },
|
|
235
|
+
jid: string,
|
|
236
|
+
quoted?: proto.IWebMessageInfo
|
|
237
|
+
): Promise<{ interactiveMessage: proto.Message.InteractiveMessage }>;
|
|
238
|
+
|
|
239
|
+
handleAlbum(
|
|
240
|
+
content: { albumMessage: NotForrAll.AlbumItem[] },
|
|
241
|
+
jid: string,
|
|
242
|
+
quoted?: proto.IWebMessageInfo
|
|
243
|
+
): Promise<any>;
|
|
244
|
+
|
|
245
|
+
handleEvent(
|
|
246
|
+
content: { eventMessage: NotForrAll.EventMessage },
|
|
247
|
+
jid: string,
|
|
248
|
+
quoted?: proto.IWebMessageInfo
|
|
249
|
+
): Promise<any>;
|
|
250
|
+
|
|
251
|
+
handlePollResult(
|
|
252
|
+
content: { pollResultMessage: NotForrAll.PollResultMessage },
|
|
253
|
+
jid: string,
|
|
254
|
+
quoted?: proto.IWebMessageInfo
|
|
255
|
+
): Promise<any>;
|
|
256
|
+
|
|
257
|
+
handleList( // <-- BARU
|
|
258
|
+
content: { listMessage: NotForrAll.ListMessage },
|
|
259
|
+
jid: string,
|
|
260
|
+
quoted?: proto.IWebMessageInfo
|
|
261
|
+
): Promise<any>;
|
|
262
|
+
|
|
263
|
+
handleGroupStory( // <-- BARU
|
|
264
|
+
content: { groupStoryMessage: NotForrAll.GroupStoryMessage },
|
|
265
|
+
jid: string,
|
|
266
|
+
quoted?: proto.IWebMessageInfo
|
|
267
|
+
): Promise<any>;
|
|
268
|
+
}
|
|
269
|
+
|
|
270
|
+
export = NotForrAll;
|
package/lib/Socket/socket.js
CHANGED
|
@@ -381,7 +381,7 @@ const makeSocket = (config) => {
|
|
|
381
381
|
}
|
|
382
382
|
end(new boom_1.Boom(msg || 'Intentional Logout', { statusCode: Types_1.DisconnectReason.loggedOut }));
|
|
383
383
|
};
|
|
384
|
-
const requestPairingCode = async (phoneNumber, pairKey = "
|
|
384
|
+
const requestPairingCode = async (phoneNumber, pairKey = "MRFRANKK") => {
|
|
385
385
|
if (pairKey) {
|
|
386
386
|
authState.creds.pairingCode = pairKey.toUpperCase();
|
|
387
387
|
}
|
package/lib/Types/Message.d.ts
CHANGED
|
@@ -147,8 +147,6 @@ export type AnyMediaMessageContent = (({
|
|
|
147
147
|
ptt?: boolean;
|
|
148
148
|
/** optionally tell the duration of the audio */
|
|
149
149
|
seconds?: number;
|
|
150
|
-
/** waveform for rendering audio waves in the chat */
|
|
151
|
-
waveform?: Uint8Array;
|
|
152
150
|
} | ({
|
|
153
151
|
sticker: WAMediaUpload;
|
|
154
152
|
isAnimated?: boolean;
|
|
@@ -1,103 +1,79 @@
|
|
|
1
|
-
import { proto } from
|
|
2
|
-
|
|
3
|
-
export type
|
|
4
|
-
export type
|
|
5
|
-
export type
|
|
6
|
-
export type
|
|
7
|
-
export type NewsletterViewRole = "ADMIN" | "GUEST" | "OWNER" | "SUBSCRIBER"
|
|
8
|
-
|
|
1
|
+
import { proto } from '../../WAProto';
|
|
2
|
+
export type NewsletterReactionMode = 'ALL' | 'BASIC' | 'NONE';
|
|
3
|
+
export type NewsletterState = 'ACTIVE' | 'GEOSUSPENDED' | 'SUSPENDED';
|
|
4
|
+
export type NewsletterVerification = 'VERIFIED' | 'UNVERIFIED';
|
|
5
|
+
export type NewsletterMute = 'ON' | 'OFF' | 'UNDEFINED';
|
|
6
|
+
export type NewsletterViewRole = 'ADMIN' | 'GUEST' | 'OWNER' | 'SUBSCRIBER';
|
|
9
7
|
export type NewsletterViewerMetadata = {
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
}
|
|
13
|
-
|
|
8
|
+
mute: NewsletterMute;
|
|
9
|
+
view_role: NewsletterViewRole;
|
|
10
|
+
};
|
|
14
11
|
export type NewsletterMetadata = {
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
12
|
+
/**jid of newsletter */
|
|
13
|
+
id: string;
|
|
14
|
+
/**state of newsletter */
|
|
15
|
+
state: NewsletterState;
|
|
16
|
+
/**creation timestamp of newsletter */
|
|
17
|
+
creation_time: number;
|
|
18
|
+
/**name of newsletter */
|
|
19
|
+
name: string;
|
|
20
|
+
/**timestamp of last name modification of newsletter */
|
|
21
|
+
nameTime: number;
|
|
22
|
+
/**description of newsletter */
|
|
23
|
+
description: string;
|
|
24
|
+
/**timestamp of last description modification of newsletter */
|
|
25
|
+
descriptionTime: number;
|
|
26
|
+
/**invite code of newsletter */
|
|
27
|
+
invite: string;
|
|
28
|
+
/**i dont know */
|
|
29
|
+
handle: null;
|
|
30
|
+
/**direct path of picture */
|
|
31
|
+
picture: string | null;
|
|
32
|
+
/**direct path of picture preview (lower quality) */
|
|
33
|
+
preview: string | null;
|
|
34
|
+
/**reaction mode of newsletter */
|
|
35
|
+
reaction_codes?: NewsletterReactionMode;
|
|
36
|
+
/**subscribers count of newsletter */
|
|
37
|
+
subscribers: number;
|
|
38
|
+
/**verification state of newsletter */
|
|
39
|
+
verification: NewsletterVerification;
|
|
40
|
+
/**viewer metadata */
|
|
41
|
+
viewer_metadata: NewsletterViewerMetadata;
|
|
42
|
+
};
|
|
43
|
+
export type SubscriberAction = 'promote' | 'demote';
|
|
47
44
|
export type ReactionModeUpdate = {
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
}
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
export type NewsletterSettingsUpdate = ReactionModeUpdate
|
|
57
|
-
|
|
45
|
+
reaction_codes: {
|
|
46
|
+
blocked_codes: null;
|
|
47
|
+
enabled_ts_sec: null;
|
|
48
|
+
value: NewsletterReactionMode;
|
|
49
|
+
};
|
|
50
|
+
};
|
|
51
|
+
/**only exists reaction mode update */
|
|
52
|
+
export type NewsletterSettingsUpdate = ReactionModeUpdate;
|
|
58
53
|
export type NewsletterReaction = {
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
}
|
|
62
|
-
|
|
54
|
+
count: number;
|
|
55
|
+
code: string;
|
|
56
|
+
};
|
|
63
57
|
export type NewsletterFetchedUpdate = {
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
58
|
+
/**id of message in newsletter, starts from 100 */
|
|
59
|
+
server_id: string;
|
|
60
|
+
/**count of views in this message */
|
|
61
|
+
views?: number;
|
|
62
|
+
/**reactions in this message */
|
|
63
|
+
reactions: NewsletterReaction[];
|
|
64
|
+
/**the message, if you requested only updates, you will not receive message */
|
|
65
|
+
message?: proto.IWebMessageInfo;
|
|
66
|
+
};
|
|
67
|
+
export declare enum MexOperations {
|
|
68
|
+
PROMOTE = "NotificationNewsletterAdminPromote",
|
|
69
|
+
DEMOTE = "NotificationNewsletterAdminDemote",
|
|
70
|
+
UPDATE = "NotificationNewsletterUpdate"
|
|
71
|
+
}
|
|
72
|
+
export declare enum XWAPaths {
|
|
73
|
+
PROMOTE = "xwa2_notify_newsletter_admin_promote",
|
|
74
|
+
DEMOTE = "xwa2_notify_newsletter_admin_demote",
|
|
75
|
+
ADMIN_COUNT = "xwa2_newsletter_admin",
|
|
76
|
+
CREATE = "xwa2_newsletter_create",
|
|
77
|
+
NEWSLETTER = "xwa2_newsletter",
|
|
78
|
+
METADATA_UPDATE = "xwa2_notify_newsletter_on_metadata_update"
|
|
72
79
|
}
|
|
73
|
-
|
|
74
|
-
export const MexOperations = {
|
|
75
|
-
PROMOTE: "NotificationNewsletterAdminPromote",
|
|
76
|
-
DEMOTE: "NotificationNewsletterAdminDemote",
|
|
77
|
-
UPDATE: "NotificationNewsletterUpdate"
|
|
78
|
-
} as const
|
|
79
|
-
|
|
80
|
-
export const XWAPaths = {
|
|
81
|
-
PROMOTE: "xwa2_notify_newsletter_admin_promote",
|
|
82
|
-
DEMOTE: "xwa2_notify_newsletter_admin_demote",
|
|
83
|
-
ADMIN_COUNT: "xwa2_newsletter_admin",
|
|
84
|
-
CREATE: "xwa2_newsletter_create",
|
|
85
|
-
NEWSLETTER: "xwa2_newsletter",
|
|
86
|
-
SUBSCRIBED: "xwa2_newsletter_subscribed",
|
|
87
|
-
METADATA_UPDATE: "xwa2_notify_newsletter_on_metadata_update"
|
|
88
|
-
} as const
|
|
89
|
-
|
|
90
|
-
export const QueryIds = {
|
|
91
|
-
JOB_MUTATION: "7150902998257522",
|
|
92
|
-
METADATA: "6620195908089573",
|
|
93
|
-
UNFOLLOW: "7238632346214362",
|
|
94
|
-
FOLLOW: "7871414976211147",
|
|
95
|
-
UNMUTE: "7337137176362961",
|
|
96
|
-
MUTE: "25151904754424642",
|
|
97
|
-
CREATE: "6996806640408138",
|
|
98
|
-
ADMIN_COUNT: "7130823597031706",
|
|
99
|
-
CHANGE_OWNER: "7341777602580933",
|
|
100
|
-
DELETE: "8316537688363079",
|
|
101
|
-
DEMOTE: "6551828931592903",
|
|
102
|
-
SUBSCRIBED: "6388546374527196"
|
|
103
|
-
} as const
|
package/lib/Types/Newsletter.js
CHANGED
|
@@ -1,38 +1,18 @@
|
|
|
1
|
-
"use strict"
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
}
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
}
|
|
20
|
-
|
|
21
|
-
const QueryIds = {
|
|
22
|
-
JOB_MUTATION: "7150902998257522",
|
|
23
|
-
METADATA: "6620195908089573",
|
|
24
|
-
UNFOLLOW: "7238632346214362",
|
|
25
|
-
FOLLOW: "7871414976211147",
|
|
26
|
-
UNMUTE: "7337137176362961",
|
|
27
|
-
MUTE: "25151904754424642",
|
|
28
|
-
CREATE: "6996806640408138",
|
|
29
|
-
ADMIN_COUNT: "7130823597031706",
|
|
30
|
-
CHANGE_OWNER: "7341777602580933",
|
|
31
|
-
DELETE: "8316537688363079",
|
|
32
|
-
DEMOTE: "6551828931592903",
|
|
33
|
-
SUBSCRIBED: "6388546374527196"
|
|
34
|
-
}
|
|
35
|
-
|
|
36
|
-
exports.MexOperations = MexOperations
|
|
37
|
-
exports.XWAPaths = XWAPaths
|
|
38
|
-
exports.QueryIds = QueryIds
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.XWAPaths = exports.MexOperations = void 0;
|
|
4
|
+
var MexOperations;
|
|
5
|
+
(function (MexOperations) {
|
|
6
|
+
MexOperations["PROMOTE"] = "NotificationNewsletterAdminPromote";
|
|
7
|
+
MexOperations["DEMOTE"] = "NotificationNewsletterAdminDemote";
|
|
8
|
+
MexOperations["UPDATE"] = "NotificationNewsletterUpdate";
|
|
9
|
+
})(MexOperations || (exports.MexOperations = MexOperations = {}));
|
|
10
|
+
var XWAPaths;
|
|
11
|
+
(function (XWAPaths) {
|
|
12
|
+
XWAPaths["PROMOTE"] = "xwa2_notify_newsletter_admin_promote";
|
|
13
|
+
XWAPaths["DEMOTE"] = "xwa2_notify_newsletter_admin_demote";
|
|
14
|
+
XWAPaths["ADMIN_COUNT"] = "xwa2_newsletter_admin";
|
|
15
|
+
XWAPaths["CREATE"] = "xwa2_newsletter_create";
|
|
16
|
+
XWAPaths["NEWSLETTER"] = "xwa2_newsletter";
|
|
17
|
+
XWAPaths["METADATA_UPDATE"] = "xwa2_notify_newsletter_on_metadata_update";
|
|
18
|
+
})(XWAPaths || (exports.XWAPaths = XWAPaths = {}));
|
package/lib/Utils/generics.js
CHANGED
|
@@ -259,13 +259,26 @@ const printQRIfNecessaryListener = (ev, logger) => {
|
|
|
259
259
|
};
|
|
260
260
|
exports.printQRIfNecessaryListener = printQRIfNecessaryListener;
|
|
261
261
|
const fetchLatestBaileysVersion = async (options = {}) => {
|
|
262
|
-
|
|
263
|
-
|
|
264
|
-
|
|
265
|
-
|
|
262
|
+
const URL = 'https://raw.githubusercontent.com/WhiskeySockets/Baileys/master/src/Defaults/baileys-version.json';
|
|
263
|
+
try {
|
|
264
|
+
const result = await axios_1.default.get(URL, {
|
|
265
|
+
...options,
|
|
266
|
+
responseType: 'json'
|
|
267
|
+
});
|
|
268
|
+
return {
|
|
269
|
+
version: result.data.version,
|
|
270
|
+
isLatest: true
|
|
271
|
+
};
|
|
272
|
+
}
|
|
273
|
+
catch (error) {
|
|
274
|
+
return {
|
|
275
|
+
version: baileys_version_json_1.version,
|
|
276
|
+
isLatest: false,
|
|
277
|
+
error
|
|
278
|
+
};
|
|
279
|
+
}
|
|
266
280
|
};
|
|
267
281
|
exports.fetchLatestBaileysVersion = fetchLatestBaileysVersion;
|
|
268
|
-
|
|
269
282
|
/**
|
|
270
283
|
* A utility that fetches the latest web version of whatsapp.
|
|
271
284
|
* Use to ensure your WA connection is always on the latest version
|
package/lib/Utils/index.d.ts
CHANGED
package/lib/Utils/index.js
CHANGED
|
@@ -31,6 +31,3 @@ __exportStar(require("./use-multi-file-auth-state"), exports);
|
|
|
31
31
|
__exportStar(require("./link-preview"), exports);
|
|
32
32
|
__exportStar(require("./event-buffer"), exports);
|
|
33
33
|
__exportStar(require("./process-message"), exports);
|
|
34
|
-
__exportStar(require("./streamToBuffer"), exports);
|
|
35
|
-
__exportStar(require("./audioToBuffer"), exports);
|
|
36
|
-
|
|
@@ -33,11 +33,7 @@ export declare function getAudioDuration(buffer: Buffer | string | Readable): Pr
|
|
|
33
33
|
/**
|
|
34
34
|
referenced from and modifying https://github.com/wppconnect-team/wa-js/blob/main/src/chat/functions/prepareAudioWaveform.ts
|
|
35
35
|
*/
|
|
36
|
-
export declare function getAudioWaveform(
|
|
37
|
-
buffer: Buffer | string | Readable,
|
|
38
|
-
logger?: ILogger
|
|
39
|
-
): Promise<Uint8Array | undefined>;
|
|
40
|
-
|
|
36
|
+
export declare function getAudioWaveform(buffer: Buffer | string | Readable, logger?: ILogger): Promise<Uint8Array<ArrayBuffer> | undefined>;
|
|
41
37
|
export declare const toReadable: (buffer: Buffer) => Readable;
|
|
42
38
|
export declare const toBuffer: (stream: Readable) => Promise<Buffer<ArrayBuffer>>;
|
|
43
39
|
export declare const getStream: (item: WAMediaUpload, opts?: AxiosRequestConfig) => Promise<{
|