@wppconnect/wa-js 3.20.1 → 3.22.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/CHANGELOG.md +6 -1
- package/dist/call/functions/enableCallInterface.d.ts +19 -0
- package/dist/call/functions/index.d.ts +1 -0
- package/dist/chat/events/eventTypes.d.ts +11 -0
- package/dist/chat/events/index.d.ts +3 -2
- package/dist/chat/events/registerNewChat.d.ts +16 -0
- package/dist/{whatsapp/misc/UsernameGatingUtils.d.ts → conn/functions/getMyUserLid.d.ts} +9 -9
- package/dist/conn/functions/index.d.ts +2 -0
- package/dist/contact/functions/index.d.ts +1 -0
- package/dist/contact/functions/reportContact.d.ts +62 -0
- package/dist/index.d.ts +1 -0
- package/dist/indexdb/functions/getMessagesFromRowId.d.ts +55 -0
- package/dist/indexdb/functions/index.d.ts +16 -0
- package/dist/indexdb/index.d.ts +16 -0
- package/dist/newsletter/functions/follow.d.ts +27 -0
- package/dist/newsletter/functions/index.d.ts +3 -0
- package/dist/newsletter/functions/search.d.ts +64 -0
- package/dist/newsletter/functions/unfollow.d.ts +27 -0
- package/dist/util/index.d.ts +1 -0
- package/dist/util/toArrayBuffer.d.ts +21 -0
- package/dist/whatsapp/enums/CHANNEL_EVENT_SURFACE.d.ts +27 -0
- package/dist/whatsapp/enums/index.d.ts +1 -0
- package/dist/whatsapp/functions/index.d.ts +11 -0
- package/dist/whatsapp/functions/mexFetchNewsletterDirectorySearchResults.d.ts +24 -0
- package/dist/whatsapp/functions/mexJoinNewsletter.d.ts +19 -0
- package/dist/whatsapp/functions/mexLeaveNewsletter.d.ts +19 -0
- package/dist/whatsapp/functions/msgFindByDirection.d.ts +45 -0
- package/dist/whatsapp/functions/msgFindCallLog.d.ts +26 -0
- package/dist/whatsapp/functions/msgFindEvents.d.ts +27 -0
- package/dist/whatsapp/functions/msgFindMedia.d.ts +34 -0
- package/dist/whatsapp/functions/msgFindQuery.d.ts +12 -1
- package/dist/whatsapp/functions/msgFindSearch.d.ts +33 -0
- package/dist/whatsapp/functions/msgFindStarred.d.ts +27 -0
- package/dist/whatsapp/functions/reportSpam.d.ts +34 -0
- package/dist/whatsapp/functions/toggleNewsletterAdminActivityMuteStateAction.d.ts +22 -0
- package/dist/whatsapp/misc/LruMediaStore.d.ts +24 -0
- package/dist/whatsapp/misc/MediaPrep.d.ts +28 -16
- package/dist/whatsapp/misc/index.d.ts +1 -1
- package/dist/whatsapp/stores.d.ts +67 -56
- package/dist/wppconnect-wa.js +1 -1
- package/dist/wppconnect-wa.js.LICENSE.txt +1 -1
- package/eslint.config.mjs +1 -0
- package/package.json +17 -16
package/CHANGELOG.md
CHANGED
|
@@ -1,4 +1,9 @@
|
|
|
1
|
-
## 3.
|
|
1
|
+
## 3.22.1 (2026-02-28)
|
|
2
|
+
|
|
3
|
+
|
|
4
|
+
### Bug Fixes
|
|
5
|
+
|
|
6
|
+
* getMessages (msgs.push is not a function) ([#3364](https://github.com/wppconnect-team/wa-js/issues/3364)) ([bdd2224](https://github.com/wppconnect-team/wa-js/commit/bdd222400e594e98b74cadc06a3a21eef3f2ecd8))
|
|
2
7
|
|
|
3
8
|
|
|
4
9
|
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
/*!
|
|
2
|
+
* Copyright 2021 WPPConnect Team
|
|
3
|
+
*
|
|
4
|
+
* Licensed under the Apache License, Version 2.0 (the "License");
|
|
5
|
+
* you may not use this file except in compliance with the License.
|
|
6
|
+
* You may obtain a copy of the License at
|
|
7
|
+
*
|
|
8
|
+
* http://www.apache.org/licenses/LICENSE-2.0
|
|
9
|
+
*
|
|
10
|
+
* Unless required by applicable law or agreed to in writing, software
|
|
11
|
+
* distributed under the License is distributed on an "AS IS" BASIS,
|
|
12
|
+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
13
|
+
* See the License for the specific language governing permissions and
|
|
14
|
+
* limitations under the License.
|
|
15
|
+
*/
|
|
16
|
+
/**
|
|
17
|
+
* Enable call interface from desktop app
|
|
18
|
+
*/
|
|
19
|
+
export declare function enableCallInterface(): Promise<void>;
|
|
@@ -14,6 +14,7 @@
|
|
|
14
14
|
* limitations under the License.
|
|
15
15
|
*/
|
|
16
16
|
export { accept } from './accept';
|
|
17
|
+
export { enableCallInterface } from './enableCallInterface';
|
|
17
18
|
export { end } from './end';
|
|
18
19
|
export { offer } from './offer';
|
|
19
20
|
export { reject, reject as rejectCall } from './reject';
|
|
@@ -27,6 +27,17 @@ export interface ChatEventTypes {
|
|
|
27
27
|
* ```
|
|
28
28
|
*/
|
|
29
29
|
'chat.active_chat': ChatModel | null;
|
|
30
|
+
/**
|
|
31
|
+
* Triggered when a new chat is created
|
|
32
|
+
*
|
|
33
|
+
* @example
|
|
34
|
+
* ```javascript
|
|
35
|
+
* WPP.on('chat.new_chat', (chat) => {
|
|
36
|
+
* // Your code
|
|
37
|
+
* });
|
|
38
|
+
* ```
|
|
39
|
+
*/
|
|
40
|
+
'chat.new_chat': ChatModel;
|
|
30
41
|
/**
|
|
31
42
|
* Triggered when new message is received
|
|
32
43
|
*
|
|
@@ -15,12 +15,13 @@
|
|
|
15
15
|
*/
|
|
16
16
|
import './registerAckMessageEvent';
|
|
17
17
|
import './registerActiveChatEvent';
|
|
18
|
+
import './registerEditedMessageEvent';
|
|
19
|
+
import './registerLabelEvent';
|
|
18
20
|
import './registerLiveLocationUpdateEvent';
|
|
21
|
+
import './registerNewChat';
|
|
19
22
|
import './registerNewMessageEvent';
|
|
20
23
|
import './registerPollEvent';
|
|
21
24
|
import './registerPresenceChange';
|
|
22
25
|
import './registerReactionsEvent';
|
|
23
26
|
import './registerRevokeMessageEvent';
|
|
24
|
-
import './registerLabelEvent';
|
|
25
|
-
import './registerEditedMessageEvent';
|
|
26
27
|
import './registerUnreadCountEvent';
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
/*!
|
|
2
|
+
* Copyright 2021 WPPConnect Team
|
|
3
|
+
*
|
|
4
|
+
* Licensed under the Apache License, Version 2.0 (the "License");
|
|
5
|
+
* you may not use this file except in compliance with the License.
|
|
6
|
+
* You may obtain a copy of the License at
|
|
7
|
+
*
|
|
8
|
+
* http://www.apache.org/licenses/LICENSE-2.0
|
|
9
|
+
*
|
|
10
|
+
* Unless required by applicable law or agreed to in writing, software
|
|
11
|
+
* distributed under the License is distributed on an "AS IS" BASIS,
|
|
12
|
+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
13
|
+
* See the License for the specific language governing permissions and
|
|
14
|
+
* limitations under the License.
|
|
15
|
+
*/
|
|
16
|
+
export {};
|
|
@@ -13,14 +13,14 @@
|
|
|
13
13
|
* See the License for the specific language governing permissions and
|
|
14
14
|
* limitations under the License.
|
|
15
15
|
*/
|
|
16
|
+
import { Wid } from '../../whatsapp';
|
|
16
17
|
/**
|
|
17
|
-
*
|
|
18
|
+
* Return the current logged user LID (Locally Identified) without device id
|
|
19
|
+
*
|
|
20
|
+
* @example
|
|
21
|
+
* ```javascript
|
|
22
|
+
* const lid = WPP.conn.getMyUserLid();
|
|
23
|
+
* console.log(lid.toString()); // Output: 123@lid
|
|
24
|
+
* ```
|
|
18
25
|
*/
|
|
19
|
-
export declare
|
|
20
|
-
/**
|
|
21
|
-
* Check if username feature is supported
|
|
22
|
-
* @whatsapp >= 2.3000.1030318976
|
|
23
|
-
* @returns true if username feature is supported
|
|
24
|
-
*/
|
|
25
|
-
function usernameSupported(): boolean;
|
|
26
|
-
}
|
|
26
|
+
export declare function getMyUserLid(): Wid;
|
|
@@ -23,6 +23,8 @@ export { getHistorySyncProgress, HistorySyncProgress, } from './getHistorySyncPr
|
|
|
23
23
|
export { getMigrationState, MigrationState } from './getMigrationState';
|
|
24
24
|
export { getMyDeviceId } from './getMyDeviceId';
|
|
25
25
|
export { getMyUserId } from './getMyUserId';
|
|
26
|
+
export { getMyUserLid } from './getMyUserLid';
|
|
27
|
+
export { getMyUserWid } from './getMyUserWid';
|
|
26
28
|
export { getPlatform } from './getPlatform';
|
|
27
29
|
export { getTheme, Theme } from './getTheme';
|
|
28
30
|
export { isAuthenticated } from './isAuthenticated';
|
|
@@ -22,6 +22,7 @@ export { getStatus } from './getStatus';
|
|
|
22
22
|
export { ContactListOptions, list } from './list';
|
|
23
23
|
export { queryExists } from './queryExists';
|
|
24
24
|
export { remove } from './remove';
|
|
25
|
+
export { reportContact, ReportContactResult } from './reportContact';
|
|
25
26
|
export { save } from './save';
|
|
26
27
|
export { subscribePresence } from './subscribePresence';
|
|
27
28
|
export { unsubscribePresence } from './unsubscribePresence';
|
|
@@ -0,0 +1,62 @@
|
|
|
1
|
+
/*!
|
|
2
|
+
* Copyright 2026 WPPConnect Team
|
|
3
|
+
*
|
|
4
|
+
* Licensed under the Apache License, Version 2.0 (the "License");
|
|
5
|
+
* you may not use this file except in compliance with the License.
|
|
6
|
+
* You may obtain a copy of the License at
|
|
7
|
+
*
|
|
8
|
+
* http://www.apache.org/licenses/LICENSE-2.0
|
|
9
|
+
*
|
|
10
|
+
* Unless required by applicable law or agreed to in writing, software
|
|
11
|
+
* distributed under the License is distributed on an "AS IS" BASIS,
|
|
12
|
+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
13
|
+
* See the License for the specific language governing permissions and
|
|
14
|
+
* limitations under the License.
|
|
15
|
+
*/
|
|
16
|
+
import { MsgModel, Wid } from '../../whatsapp';
|
|
17
|
+
export interface ReportContactResult {
|
|
18
|
+
wid: Wid;
|
|
19
|
+
reportId?: string;
|
|
20
|
+
errorCode?: number;
|
|
21
|
+
errorText?: string;
|
|
22
|
+
}
|
|
23
|
+
/**
|
|
24
|
+
* Report a contact or chat to WhatsApp
|
|
25
|
+
*
|
|
26
|
+
* This function allows you to report contacts for spam, inappropriate behavior, or other violations.
|
|
27
|
+
*
|
|
28
|
+
* Available spam flow types:
|
|
29
|
+
* - 'ChatInfoReport' (default) - Report from chat info screen
|
|
30
|
+
* - 'MessageMenu' - Report from message menu
|
|
31
|
+
* - 'GroupInfoReport' - Report from group info screen
|
|
32
|
+
* - 'ChatFmxCardSafetyToolsReport' - Report from safety tools (trusted)
|
|
33
|
+
* - 'ChatFmxCardSafetyToolsReportSuspicious' - Report suspicious contact
|
|
34
|
+
* - 'GroupInfoLeaveReportUpsell' - Report when leaving group
|
|
35
|
+
*
|
|
36
|
+
* @example
|
|
37
|
+
* ```javascript
|
|
38
|
+
* // Basic contact report
|
|
39
|
+
* const result = await WPP.contact.reportContact('5511999999999@c.us');
|
|
40
|
+
* console.log('Report ID:', result.reportId);
|
|
41
|
+
* ```
|
|
42
|
+
*
|
|
43
|
+
* @example
|
|
44
|
+
* ```javascript
|
|
45
|
+
* // Report with specific type
|
|
46
|
+
* await WPP.contact.reportContact('5511999999999@c.us', 'ChatFmxCardSafetyToolsReportSuspicious');
|
|
47
|
+
* ```
|
|
48
|
+
*
|
|
49
|
+
* @example
|
|
50
|
+
* ```javascript
|
|
51
|
+
* // Report specific message
|
|
52
|
+
* const msg = await WPP.chat.getMessageById('msgId');
|
|
53
|
+
* await WPP.contact.reportContact('5511999999999@c.us', 'MessageMenu', msg);
|
|
54
|
+
* ```
|
|
55
|
+
*
|
|
56
|
+
* @category Contact
|
|
57
|
+
* @param contactId - Contact ID or Wid to report
|
|
58
|
+
* @param spamFlow - Optional spam flow type (default: 'ChatInfoReport')
|
|
59
|
+
* @param msg - Optional specific message to report
|
|
60
|
+
* @returns Promise with report result containing reportId or error details
|
|
61
|
+
*/
|
|
62
|
+
export declare function reportContact(contactId: string | Wid, spamFlow?: string, msg?: MsgModel): Promise<ReportContactResult>;
|
package/dist/index.d.ts
CHANGED
|
@@ -31,6 +31,7 @@ export * as contact from './contact';
|
|
|
31
31
|
export * as ev from './eventEmitter';
|
|
32
32
|
export * as community from './community';
|
|
33
33
|
export * as group from './group';
|
|
34
|
+
export * as indexdb from './indexdb';
|
|
34
35
|
export * as labels from './labels';
|
|
35
36
|
export * as profile from './profile';
|
|
36
37
|
export * as status from './status';
|
|
@@ -0,0 +1,55 @@
|
|
|
1
|
+
/*!
|
|
2
|
+
* Copyright 2026 WPPConnect Team
|
|
3
|
+
*
|
|
4
|
+
* Licensed under the Apache License, Version 2.0 (the "License");
|
|
5
|
+
* you may not use this file except in compliance with the License.
|
|
6
|
+
* You may obtain a copy of the License at
|
|
7
|
+
*
|
|
8
|
+
* http://www.apache.org/licenses/LICENSE-2.0
|
|
9
|
+
*
|
|
10
|
+
* Unless required by applicable law or agreed to in writing, software
|
|
11
|
+
* distributed under the License is distributed on an "AS IS" BASIS,
|
|
12
|
+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
13
|
+
* See the License for the specific language governing permissions and
|
|
14
|
+
* limitations under the License.
|
|
15
|
+
*/
|
|
16
|
+
export interface GetMessagesFromRowIdOptions {
|
|
17
|
+
/**
|
|
18
|
+
* The minimum rowId (exclusive) to start fetching messages from
|
|
19
|
+
*/
|
|
20
|
+
minRowId: number;
|
|
21
|
+
/**
|
|
22
|
+
* Maximum number of messages to return
|
|
23
|
+
* @default 1000
|
|
24
|
+
* Use -1 to get all available messages (use with caution on large datasets)
|
|
25
|
+
*/
|
|
26
|
+
limit?: number;
|
|
27
|
+
}
|
|
28
|
+
/**
|
|
29
|
+
* Get messages from IndexedDB 'model-storage' database starting from a specific rowId
|
|
30
|
+
*
|
|
31
|
+
* This function queries the IndexedDB database directly using the rowId index,
|
|
32
|
+
* retrieving messages with rowId greater than the specified value.
|
|
33
|
+
* It's useful for pagination or fetching messages in chronological order.
|
|
34
|
+
*
|
|
35
|
+
* @example
|
|
36
|
+
* ```javascript
|
|
37
|
+
* // Get 1000 messages after rowId 999960610
|
|
38
|
+
* const messages = await WPP.indexdb.getMessagesFromRowId({ minRowId: 999960610 });
|
|
39
|
+
*
|
|
40
|
+
* // Get 500 messages after rowId 999960610
|
|
41
|
+
* const messages = await WPP.indexdb.getMessagesFromRowId({
|
|
42
|
+
* minRowId: 999960610,
|
|
43
|
+
* limit: 500
|
|
44
|
+
* });
|
|
45
|
+
*
|
|
46
|
+
* // Get all available messages after rowId (use with caution)
|
|
47
|
+
* const messages = await WPP.indexdb.getMessagesFromRowId({
|
|
48
|
+
* minRowId: 999960610,
|
|
49
|
+
* limit: -1
|
|
50
|
+
* });
|
|
51
|
+
* ```
|
|
52
|
+
* @category IndexedDB
|
|
53
|
+
* @return Promise that resolves to an array of message objects from IndexedDB
|
|
54
|
+
*/
|
|
55
|
+
export declare function getMessagesFromRowId(options: GetMessagesFromRowIdOptions): Promise<any[]>;
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
/*!
|
|
2
|
+
* Copyright 2026 WPPConnect Team
|
|
3
|
+
*
|
|
4
|
+
* Licensed under the Apache License, Version 2.0 (the "License");
|
|
5
|
+
* you may not use this file except in compliance with the License.
|
|
6
|
+
* You may obtain a copy of the License at
|
|
7
|
+
*
|
|
8
|
+
* http://www.apache.org/licenses/LICENSE-2.0
|
|
9
|
+
*
|
|
10
|
+
* Unless required by applicable law or agreed to in writing, software
|
|
11
|
+
* distributed under the License is distributed on an "AS IS" BASIS,
|
|
12
|
+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
13
|
+
* See the License for the specific language governing permissions and
|
|
14
|
+
* limitations under the License.
|
|
15
|
+
*/
|
|
16
|
+
export { getMessagesFromRowId, GetMessagesFromRowIdOptions, } from './getMessagesFromRowId';
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
/*!
|
|
2
|
+
* Copyright 2026 WPPConnect Team
|
|
3
|
+
*
|
|
4
|
+
* Licensed under the Apache License, Version 2.0 (the "License");
|
|
5
|
+
* you may not use this file except in compliance with the License.
|
|
6
|
+
* You may obtain a copy of the License at
|
|
7
|
+
*
|
|
8
|
+
* http://www.apache.org/licenses/LICENSE-2.0
|
|
9
|
+
*
|
|
10
|
+
* Unless required by applicable law or agreed to in writing, software
|
|
11
|
+
* distributed under the License is distributed on an "AS IS" BASIS,
|
|
12
|
+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
13
|
+
* See the License for the specific language governing permissions and
|
|
14
|
+
* limitations under the License.
|
|
15
|
+
*/
|
|
16
|
+
export * from './functions';
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
/*!
|
|
2
|
+
* Copyright 2026 WPPConnect Team
|
|
3
|
+
*
|
|
4
|
+
* Licensed under the Apache License, Version 2.0 (the "License");
|
|
5
|
+
* you may not use this file except in compliance with the License.
|
|
6
|
+
* You may obtain a copy of the License at
|
|
7
|
+
*
|
|
8
|
+
* http://www.apache.org/licenses/LICENSE-2.0
|
|
9
|
+
*
|
|
10
|
+
* Unless required by applicable law or agreed to in writing, software
|
|
11
|
+
* distributed under the License is distributed on an "AS IS" BASIS,
|
|
12
|
+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
13
|
+
* See the License for the specific language governing permissions and
|
|
14
|
+
* limitations under the License.
|
|
15
|
+
*/
|
|
16
|
+
/**
|
|
17
|
+
* Follow/subscribe to a newsletter
|
|
18
|
+
*
|
|
19
|
+
* @example
|
|
20
|
+
* ```javascript
|
|
21
|
+
* // Follow a newsletter
|
|
22
|
+
* const success = await WPP.newsletter.follow('120363xxxxx@newsletter');
|
|
23
|
+
* ```
|
|
24
|
+
*
|
|
25
|
+
* @category Newsletter
|
|
26
|
+
*/
|
|
27
|
+
export declare function follow(id: string): Promise<boolean>;
|
|
@@ -16,5 +16,8 @@
|
|
|
16
16
|
export { create } from './create';
|
|
17
17
|
export { destroy } from './destroy';
|
|
18
18
|
export { edit } from './edit';
|
|
19
|
+
export { follow } from './follow';
|
|
19
20
|
export { getSubscribers } from './getSubscribers';
|
|
20
21
|
export { mute } from './mute';
|
|
22
|
+
export { search } from './search';
|
|
23
|
+
export { unfollow } from './unfollow';
|
|
@@ -0,0 +1,64 @@
|
|
|
1
|
+
/*!
|
|
2
|
+
* Copyright 2026 WPPConnect Team
|
|
3
|
+
*
|
|
4
|
+
* Licensed under the Apache License, Version 2.0 (the "License");
|
|
5
|
+
* you may not use this file except in compliance with the License.
|
|
6
|
+
* You may obtain a copy of the License at
|
|
7
|
+
*
|
|
8
|
+
* http://www.apache.org/licenses/LICENSE-2.0
|
|
9
|
+
*
|
|
10
|
+
* Unless required by applicable law or agreed to in writing, software
|
|
11
|
+
* distributed under the License is distributed on an "AS IS" BASIS,
|
|
12
|
+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
13
|
+
* See the License for the specific language governing permissions and
|
|
14
|
+
* limitations under the License.
|
|
15
|
+
*/
|
|
16
|
+
export interface NewsletterSearchOptions {
|
|
17
|
+
categories?: string[];
|
|
18
|
+
limit?: number;
|
|
19
|
+
cursorToken?: string;
|
|
20
|
+
}
|
|
21
|
+
export interface NewsletterSearchResult {
|
|
22
|
+
newsletters: Array<{
|
|
23
|
+
idJid: string;
|
|
24
|
+
name: string;
|
|
25
|
+
description: string;
|
|
26
|
+
picture: string;
|
|
27
|
+
subscribersCount: number;
|
|
28
|
+
verification: string;
|
|
29
|
+
handle: string | null;
|
|
30
|
+
inviteCode: string;
|
|
31
|
+
creationTime: number;
|
|
32
|
+
_raw?: any;
|
|
33
|
+
}>;
|
|
34
|
+
pageInfo?: {
|
|
35
|
+
hasNextPage?: boolean;
|
|
36
|
+
endCursor?: string;
|
|
37
|
+
};
|
|
38
|
+
}
|
|
39
|
+
/**
|
|
40
|
+
* Search for newsletters in the directory
|
|
41
|
+
*
|
|
42
|
+
* @example
|
|
43
|
+
* ```javascript
|
|
44
|
+
* // Basic search
|
|
45
|
+
* const result = await WPP.newsletter.search('technology');
|
|
46
|
+
*
|
|
47
|
+
* // Search with options
|
|
48
|
+
* const result = await WPP.newsletter.search('news', {
|
|
49
|
+
* limit: 10,
|
|
50
|
+
* categories: ['TECHNOLOGY', 'NEWS']
|
|
51
|
+
* });
|
|
52
|
+
*
|
|
53
|
+
* // Pagination
|
|
54
|
+
* const firstPage = await WPP.newsletter.search('tech');
|
|
55
|
+
* if (firstPage.pageInfo?.hasNextPage) {
|
|
56
|
+
* const nextPage = await WPP.newsletter.search('tech', {
|
|
57
|
+
* cursorToken: firstPage.pageInfo.endCursor
|
|
58
|
+
* });
|
|
59
|
+
* }
|
|
60
|
+
* ```
|
|
61
|
+
*
|
|
62
|
+
* @category Newsletter
|
|
63
|
+
*/
|
|
64
|
+
export declare function search(query: string, options?: NewsletterSearchOptions): Promise<NewsletterSearchResult>;
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
/*!
|
|
2
|
+
* Copyright 2026 WPPConnect Team
|
|
3
|
+
*
|
|
4
|
+
* Licensed under the Apache License, Version 2.0 (the "License");
|
|
5
|
+
* you may not use this file except in compliance with the License.
|
|
6
|
+
* You may obtain a copy of the License at
|
|
7
|
+
*
|
|
8
|
+
* http://www.apache.org/licenses/LICENSE-2.0
|
|
9
|
+
*
|
|
10
|
+
* Unless required by applicable law or agreed to in writing, software
|
|
11
|
+
* distributed under the License is distributed on an "AS IS" BASIS,
|
|
12
|
+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
13
|
+
* See the License for the specific language governing permissions and
|
|
14
|
+
* limitations under the License.
|
|
15
|
+
*/
|
|
16
|
+
/**
|
|
17
|
+
* Unfollow/unsubscribe from a newsletter
|
|
18
|
+
*
|
|
19
|
+
* @example
|
|
20
|
+
* ```javascript
|
|
21
|
+
* // Unfollow a newsletter
|
|
22
|
+
* const success = await WPP.newsletter.unfollow('120363xxxxx@newsletter');
|
|
23
|
+
* ```
|
|
24
|
+
*
|
|
25
|
+
* @category Newsletter
|
|
26
|
+
*/
|
|
27
|
+
export declare function unfollow(id: string): Promise<boolean>;
|
package/dist/util/index.d.ts
CHANGED
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
/*!
|
|
2
|
+
* Copyright 2026 WPPConnect Team
|
|
3
|
+
*
|
|
4
|
+
* Licensed under the Apache License, Version 2.0 (the "License");
|
|
5
|
+
* you may not use this file except in compliance with the License.
|
|
6
|
+
* You may obtain a copy of the License at
|
|
7
|
+
*
|
|
8
|
+
* http://www.apache.org/licenses/LICENSE-2.0
|
|
9
|
+
*
|
|
10
|
+
* Unless required by applicable law or agreed to in writing, software
|
|
11
|
+
* distributed under the License is distributed on an "AS IS" BASIS,
|
|
12
|
+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
13
|
+
* See the License for the specific language governing permissions and
|
|
14
|
+
* limitations under the License.
|
|
15
|
+
*/
|
|
16
|
+
/**
|
|
17
|
+
* Convert different binary container types to a plain ArrayBuffer.
|
|
18
|
+
*
|
|
19
|
+
* Useful when dealing with APIs that may return TypedArrays or SharedArrayBuffer.
|
|
20
|
+
*/
|
|
21
|
+
export declare function toArrayBuffer(data: ArrayBuffer | ArrayBufferView | ArrayBufferLike | null | undefined): ArrayBuffer | null;
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
/*!
|
|
2
|
+
* Copyright 2026 WPPConnect Team
|
|
3
|
+
*
|
|
4
|
+
* Licensed under the Apache License, Version 2.0 (the "License");
|
|
5
|
+
* you may not use this file except in compliance with the License.
|
|
6
|
+
* You may obtain a copy of the License at
|
|
7
|
+
*
|
|
8
|
+
* http://www.apache.org/licenses/LICENSE-2.0
|
|
9
|
+
*
|
|
10
|
+
* Unless required by applicable law or agreed to in writing, software
|
|
11
|
+
* distributed under the License is distributed on an "AS IS" BASIS,
|
|
12
|
+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
13
|
+
* See the License for the specific language governing permissions and
|
|
14
|
+
* limitations under the License.
|
|
15
|
+
*/
|
|
16
|
+
/** @whatsapp WAWebWamEnumChannelEventSurface >= 2.3000.1032373751
|
|
17
|
+
*/
|
|
18
|
+
export declare enum CHANNEL_EVENT_SURFACE {
|
|
19
|
+
CHANNEL_UPDATES_HOME = 1,
|
|
20
|
+
CHANNEL_THREAD = 2,
|
|
21
|
+
CHANNEL_DIRECTORY = 3,
|
|
22
|
+
CHANNEL_DIRECTORY_SEARCH = 4,
|
|
23
|
+
CHANNEL_PROFILE = 5,
|
|
24
|
+
CHANNEL_UPDATES_HOME_SEARCH = 6,
|
|
25
|
+
CHANNEL_DIRECTORY_CATEGORIES = 7,
|
|
26
|
+
CHANNEL_DIRECTORY_CATEGORIES_SEARCH = 8
|
|
27
|
+
}
|
|
@@ -112,8 +112,17 @@ export * from './labelAddAction';
|
|
|
112
112
|
export * from './markSeen';
|
|
113
113
|
export * from './mediaTypeFromProtobuf';
|
|
114
114
|
export * from './membershipApprovalRequestAction';
|
|
115
|
+
export * from './mexFetchNewsletterDirectorySearchResults';
|
|
116
|
+
export * from './mexJoinNewsletter';
|
|
117
|
+
export * from './mexLeaveNewsletter';
|
|
115
118
|
export * from './msgDataFromMsgModel';
|
|
119
|
+
export * from './msgFindByDirection';
|
|
120
|
+
export * from './msgFindCallLog';
|
|
121
|
+
export * from './msgFindEvents';
|
|
122
|
+
export * from './msgFindMedia';
|
|
116
123
|
export * from './msgFindQuery';
|
|
124
|
+
export * from './msgFindSearch';
|
|
125
|
+
export * from './msgFindStarred';
|
|
117
126
|
export * from './muteNewsletter';
|
|
118
127
|
export * from './processRawAudioVideo';
|
|
119
128
|
export * from './processRawMedia';
|
|
@@ -128,6 +137,7 @@ export * from './queryOrder';
|
|
|
128
137
|
export * from './randomHex';
|
|
129
138
|
export * from './randomId';
|
|
130
139
|
export * from './removeStatusMessage';
|
|
140
|
+
export * from './reportSpam';
|
|
131
141
|
export * from './resetGroupInviteCode';
|
|
132
142
|
export * from './revokeStatus';
|
|
133
143
|
export * from './saveContactAction';
|
|
@@ -159,6 +169,7 @@ export * from './STATUS_JID';
|
|
|
159
169
|
export * from './statusEnable';
|
|
160
170
|
export * from './subscribePresence';
|
|
161
171
|
export * from './syncABPropsTask';
|
|
172
|
+
export * from './toggleNewsletterAdminActivityMuteStateAction';
|
|
162
173
|
export * from './toUserLid';
|
|
163
174
|
export * from './typeAttributeFromProtobuf';
|
|
164
175
|
export * from './unixTime';
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
/*!
|
|
2
|
+
* Copyright 2026 WPPConnect Team
|
|
3
|
+
*
|
|
4
|
+
* Licensed under the Apache License, Version 2.0 (the "License");
|
|
5
|
+
* you may not use this file except in compliance with the License.
|
|
6
|
+
* You may obtain a copy of the License at
|
|
7
|
+
*
|
|
8
|
+
* http://www.apache.org/licenses/LICENSE-2.0
|
|
9
|
+
*
|
|
10
|
+
* Unless required by applicable law or agreed to in writing, software
|
|
11
|
+
* distributed under the License is distributed on an "AS IS" BASIS,
|
|
12
|
+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
13
|
+
* See the License for the specific language governing permissions and
|
|
14
|
+
* limitations under the License.
|
|
15
|
+
*/
|
|
16
|
+
/**
|
|
17
|
+
* @whatsapp WAWebMexFetchNewsletterDirectorySearchResultsJob
|
|
18
|
+
*/
|
|
19
|
+
export declare function mexFetchNewsletterDirectorySearchResults(params: {
|
|
20
|
+
searchText: string;
|
|
21
|
+
categories: string[];
|
|
22
|
+
limit: number;
|
|
23
|
+
cursorToken?: string;
|
|
24
|
+
}): Promise<any>;
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
/*!
|
|
2
|
+
* Copyright 2026 WPPConnect Team
|
|
3
|
+
*
|
|
4
|
+
* Licensed under the Apache License, Version 2.0 (the "License");
|
|
5
|
+
* you may not use this file except in compliance with the License.
|
|
6
|
+
* You may obtain a copy of the License at
|
|
7
|
+
*
|
|
8
|
+
* http://www.apache.org/licenses/LICENSE-2.0
|
|
9
|
+
*
|
|
10
|
+
* Unless required by applicable law or agreed to in writing, software
|
|
11
|
+
* distributed under the License is distributed on an "AS IS" BASIS,
|
|
12
|
+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
13
|
+
* See the License for the specific language governing permissions and
|
|
14
|
+
* limitations under the License.
|
|
15
|
+
*/
|
|
16
|
+
/**
|
|
17
|
+
* @whatsapp WAWebMexJoinNewsletterJob
|
|
18
|
+
*/
|
|
19
|
+
export declare function mexJoinNewsletter(newsletterId: string): Promise<any>;
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
/*!
|
|
2
|
+
* Copyright 2026 WPPConnect Team
|
|
3
|
+
*
|
|
4
|
+
* Licensed under the Apache License, Version 2.0 (the "License");
|
|
5
|
+
* you may not use this file except in compliance with the License.
|
|
6
|
+
* You may obtain a copy of the License at
|
|
7
|
+
*
|
|
8
|
+
* http://www.apache.org/licenses/LICENSE-2.0
|
|
9
|
+
*
|
|
10
|
+
* Unless required by applicable law or agreed to in writing, software
|
|
11
|
+
* distributed under the License is distributed on an "AS IS" BASIS,
|
|
12
|
+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
13
|
+
* See the License for the specific language governing permissions and
|
|
14
|
+
* limitations under the License.
|
|
15
|
+
*/
|
|
16
|
+
/**
|
|
17
|
+
* @whatsapp WAWebMexLeaveNewsletterJob
|
|
18
|
+
*/
|
|
19
|
+
export declare function mexLeaveNewsletter(newsletterId: string): Promise<any>;
|
|
@@ -0,0 +1,45 @@
|
|
|
1
|
+
/*!
|
|
2
|
+
* Copyright 2026 WPPConnect Team
|
|
3
|
+
*
|
|
4
|
+
* Licensed under the Apache License, Version 2.0 (the "License");
|
|
5
|
+
* you may not use this file except in compliance with the License.
|
|
6
|
+
* You may obtain a copy of the License at
|
|
7
|
+
*
|
|
8
|
+
* http://www.apache.org/licenses/LICENSE-2.0
|
|
9
|
+
*
|
|
10
|
+
* Unless required by applicable law or agreed to in writing, software
|
|
11
|
+
* distributed under the License is distributed on an "AS IS" BASIS,
|
|
12
|
+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
13
|
+
* See the License for the specific language governing permissions and
|
|
14
|
+
* limitations under the License.
|
|
15
|
+
*/
|
|
16
|
+
import { MsgKey } from '..';
|
|
17
|
+
import { ModelPropertiesContructor, MsgModel } from '../models';
|
|
18
|
+
export interface MsgFindDirectionParams {
|
|
19
|
+
anchor: MsgKey;
|
|
20
|
+
count: number;
|
|
21
|
+
}
|
|
22
|
+
export interface MsgFindDirectionResult {
|
|
23
|
+
messages: ModelPropertiesContructor<MsgModel>[];
|
|
24
|
+
status: number;
|
|
25
|
+
}
|
|
26
|
+
/**
|
|
27
|
+
* Find messages before a specific message
|
|
28
|
+
* @whatsapp WAWebDBMessageFindLocal >= 2.3000.1034162388
|
|
29
|
+
* @returns Object with messages array and status code (200 on success, 404 if anchor not found)
|
|
30
|
+
*/
|
|
31
|
+
export declare function msgFindBefore(params: MsgFindDirectionParams): Promise<MsgFindDirectionResult>;
|
|
32
|
+
/**
|
|
33
|
+
* Find messages after a specific message
|
|
34
|
+
* @whatsapp WAWebDBMessageFindLocal >= 2.3000.1034162388
|
|
35
|
+
* @returns Object with messages array and status code (200 on success, 404 if anchor not found)
|
|
36
|
+
*/
|
|
37
|
+
export declare function msgFindAfter(params: MsgFindDirectionParams): Promise<MsgFindDirectionResult>;
|
|
38
|
+
/**
|
|
39
|
+
* Find messages by direction (before or after)
|
|
40
|
+
* @whatsapp WAWebDBMessageFindLocal >= 2.3000.1034162388
|
|
41
|
+
* @returns Object with messages array and status code (200 on success, 404 if anchor not found)
|
|
42
|
+
*/
|
|
43
|
+
export declare function msgFindByDirection(params: MsgFindDirectionParams & {
|
|
44
|
+
direction: 'before' | 'after';
|
|
45
|
+
}): Promise<MsgFindDirectionResult>;
|