@wppconnect/wa-js 3.18.7 → 3.18.8

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.
Files changed (35) hide show
  1. package/CHANGELOG.md +1 -6
  2. package/dist/call/events/eventTypes.d.ts +2 -3
  3. package/dist/call/events/registerIncomingCallEvent.d.ts +1 -1
  4. package/dist/chat/functions/forwardMessage.d.ts +4 -4
  5. package/dist/chat/functions/forwardMessages.d.ts +33 -0
  6. package/dist/chat/functions/index.d.ts +2 -1
  7. package/dist/chat/functions/openChatAt.d.ts +3 -1
  8. package/dist/chat/functions/openChatBottom.d.ts +3 -1
  9. package/dist/chat/functions/openChatFromUnread.d.ts +3 -1
  10. package/dist/chat/index.d.ts +1 -0
  11. package/dist/chat/types.d.ts +7 -0
  12. package/dist/chat/util/index.d.ts +16 -0
  13. package/dist/chat/util/rehydrateMessage.d.ts +17 -0
  14. package/dist/conn/functions/changeEnviromentDevice.d.ts +19 -0
  15. package/dist/conn/functions/getBuildConstants.d.ts +37 -0
  16. package/dist/conn/functions/index.d.ts +2 -0
  17. package/dist/contact/functions/get.d.ts +2 -0
  18. package/dist/contact/functions/getPnLidEntry.d.ts +59 -0
  19. package/dist/contact/functions/index.d.ts +1 -0
  20. package/dist/contact/functions/save.d.ts +3 -3
  21. package/dist/util/fileHelpers.d.ts +29 -0
  22. package/dist/whatsapp/collections/CallCollection.d.ts +16 -6
  23. package/dist/whatsapp/functions/canSaveAsMyContacts.d.ts +7 -1
  24. package/dist/whatsapp/functions/forwardMessages.d.ts +24 -0
  25. package/dist/whatsapp/functions/getUploadLimit.d.ts +24 -0
  26. package/dist/whatsapp/functions/index.d.ts +1 -0
  27. package/dist/whatsapp/functions/saveContactAction.d.ts +3 -1
  28. package/dist/whatsapp/misc/Cmd.d.ts +13 -0
  29. package/dist/whatsapp/misc/Enviroment.d.ts +22 -0
  30. package/dist/whatsapp/misc/LidPnCache.d.ts +39 -0
  31. package/dist/whatsapp/misc/MediaGatingUtils.d.ts +29 -0
  32. package/dist/whatsapp/misc/index.d.ts +3 -0
  33. package/dist/wppconnect-wa.js +1 -1
  34. package/dist/wppconnect-wa.js.LICENSE.txt +1 -1
  35. package/package.json +11 -11
package/CHANGELOG.md CHANGED
@@ -1,9 +1,4 @@
1
- ## 3.18.7 (2025-10-16)
2
-
3
-
4
- ### Bug Fixes
5
-
6
- * Fixed WidFactory.createUserWid ([#2948](https://github.com/wppconnect-team/wa-js/issues/2948)) ([043b38a](https://github.com/wppconnect-team/wa-js/commit/043b38a623ce295e8acabfd054ac6b72292455ba))
1
+ ## 3.18.8 (2025-11-10)
7
2
 
8
3
 
9
4
 
@@ -13,7 +13,6 @@
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';
17
16
  export interface CallEventTypes {
18
17
  /**
19
18
  * Triggered when you a incoming call
@@ -47,10 +46,10 @@ export interface CallEventTypes {
47
46
  /**
48
47
  * Wid of sender without device id
49
48
  */
50
- sender: Wid;
49
+ sender: any;
51
50
  /**
52
51
  * Wid of sender with device id
53
52
  */
54
- peerJid: Wid;
53
+ peerJid: any;
55
54
  };
56
55
  }
@@ -1,5 +1,5 @@
1
1
  /*!
2
- * Copyright 2022 WPPConnect Team
2
+ * Copyright 2025 WPPConnect Team
3
3
  *
4
4
  * Licensed under the Apache License, Version 2.0 (the "License");
5
5
  * you may not use this file except in compliance with the License.
@@ -14,19 +14,19 @@
14
14
  * limitations under the License.
15
15
  */
16
16
  import { MsgKey, Wid } from '../../whatsapp';
17
- export interface ForwardMessagesOptions {
17
+ export interface ForwardMessageOptions {
18
18
  displayCaptionText?: boolean;
19
19
  multicast?: boolean;
20
20
  }
21
21
  /**
22
- * Forward messages to a chat
22
+ * Forward message to a chat
23
23
  *
24
24
  * @example
25
25
  * ```javascript
26
- * // Forward messages
26
+ * // Forward message
27
27
  * WPP.chat.forwardMessage('[number]@c.us', 'true_[number]@c.us_ABCDEF');
28
28
  * ```
29
29
  * @category Message
30
30
  * @return {any} Any
31
31
  */
32
- export declare function forwardMessage(toChatId: string | Wid, msgId: string | MsgKey, options?: ForwardMessagesOptions): Promise<boolean>;
32
+ export declare function forwardMessage(toChatId: string | Wid, msgId: string | MsgKey, options?: ForwardMessageOptions): Promise<boolean>;
@@ -0,0 +1,33 @@
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
+ import { MsgKey, MsgModel, Wid } from '../../whatsapp';
17
+ export interface ForwardMessagesOptions {
18
+ displayCaptionText?: boolean;
19
+ multicast?: boolean;
20
+ appendedText?: boolean;
21
+ }
22
+ /**
23
+ * Forward many messages to a chat
24
+ *
25
+ * @example
26
+ * ```javascript
27
+ * // Forward messages
28
+ * WPP.chat.forwardMessagesWhatsApp('[number]@c.us', ['true_[number]@c.us_ABCDEF', ...]);
29
+ * ```
30
+ * @category Message
31
+ * @return {any} Any
32
+ */
33
+ export declare function forwardMessages(toChatId: string | Wid, msgsId: string[] | MsgKey[] | MsgModel[], options?: ForwardMessagesOptions): Promise<Array<any>>;
@@ -24,7 +24,8 @@ export { deleteMessage, DeleteMessageReturn } from './deleteMessage';
24
24
  export { downloadMedia } from './downloadMedia';
25
25
  export { editMessage } from './editMessage';
26
26
  export { find } from './find';
27
- export { forwardMessage, ForwardMessagesOptions } from './forwardMessage';
27
+ export { forwardMessage, ForwardMessageOptions } from './forwardMessage';
28
+ export { forwardMessages, ForwardMessagesOptions } from './forwardMessages';
28
29
  export { generateMessageID } from './generateMessageID';
29
30
  export { get } from './get';
30
31
  export { getActiveChat } from './getActiveChat';
@@ -22,6 +22,8 @@ import { Wid } from '../../whatsapp';
22
22
  * await WPP.chat.openChatAt('[number]@c.us', <message_id>);
23
23
  * ```
24
24
  *
25
+ * @argument chatEntryPoint Optional chat entry point: "Chatlist" for any existing chat in the left panel, undefined for any other case.
26
+ *
25
27
  * @category Chat
26
28
  */
27
- export declare function openChatAt(chatId: string | Wid, messageId: string): Promise<boolean>;
29
+ export declare function openChatAt(chatId: string | Wid, messageId: string, chatEntryPoint: string | undefined): Promise<boolean>;
@@ -22,6 +22,8 @@ import { Wid } from '../../whatsapp';
22
22
  * await WPP.chat.openChatBottom('[number]@c.us');
23
23
  * ```
24
24
  *
25
+ * @argument chatEntryPoint Optional chat entry point: "Chatlist" for any existing chat in the left panel, undefined for any other case.
26
+ *
25
27
  * @category Chat
26
28
  */
27
- export declare function openChatBottom(chatId: string | Wid): Promise<boolean>;
29
+ export declare function openChatBottom(chatId: string | Wid, chatEntryPoint: string | undefined): Promise<boolean>;
@@ -22,6 +22,8 @@ import { Wid } from '../../whatsapp';
22
22
  * await WPP.chat.openChatFromUnread('[number]@c.us');
23
23
  * ```
24
24
  *
25
+ * @argument chatEntryPoint Optional chat entry point: "Chatlist" for any existing chat in the left panel, undefined for any other case.
26
+ *
25
27
  * @category Chat
26
28
  */
27
- export declare function openChatFromUnread(chatId: string | Wid): Promise<boolean>;
29
+ export declare function openChatFromUnread(chatId: string | Wid, chatEntryPoint: string | undefined): Promise<boolean>;
@@ -18,3 +18,4 @@ import './patch';
18
18
  export * from './defaultSendMessageOptions';
19
19
  export * from './functions';
20
20
  export * from './types';
21
+ export * from './util';
@@ -82,6 +82,13 @@ export interface SendMessageOptions {
82
82
  * ```
83
83
  */
84
84
  quotedMsg?: string | MsgKey | MsgModel;
85
+ /**
86
+ * Quote a message using a previously saved payload.
87
+ * The payload must be the JSON string representation of a raw message.
88
+ * Raw messages can be obtained when using {@link getMessageById} or {@link getMessages}
89
+ * When provided it has priority over {@link quotedMsg}.
90
+ */
91
+ quotedMsgPayload?: string;
85
92
  /**
86
93
  * Wait for send while the ACK of message is SENT(1)
87
94
  *
@@ -0,0 +1,16 @@
1
+ /*!
2
+ * Copyright 2025 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 './rehydrateMessage';
@@ -0,0 +1,17 @@
1
+ /*!
2
+ * Copyright 2025 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 } from '../../whatsapp';
17
+ export declare function rehydrateMessage(value: any): MsgModel | undefined;
@@ -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
+ * Change the current environment device between Web and Windows.
18
+ */
19
+ export declare function changeEnviromentDevice(): void;
@@ -0,0 +1,37 @@
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
+ * Get the WhatsApp Web build constants
18
+ * Retrieves the internal WAWebBuildConstants module from WhatsApp source
19
+ *
20
+ * @example
21
+ * ```javascript
22
+ * const buildConstants = WPP.conn.getBuildConstants();
23
+ * console.log('Version:', buildConstants.VERSION_STR);
24
+ * console.log('Base Version:', buildConstants.VERSION_BASE);
25
+ * console.log('Windows Build:', buildConstants.WINDOWS_BUILD);
26
+ * ```
27
+ *
28
+ * @returns {object|null} Object containing version constants or null if not available
29
+ * - VERSION_STR: Full version string (e.g., "2.3000.1234567")
30
+ * - VERSION_BASE: Base version (e.g., "2.3000.1234567")
31
+ * - VERSION_PRIMARY: Primary version number
32
+ * - VERSION_SECONDARY: Secondary version number
33
+ * - VERSION_TERTIARY: Tertiary version number
34
+ * - WINDOWS_BUILD: Windows build number (if applicable)
35
+ * - And other build-related constants
36
+ */
37
+ export declare function getBuildConstants(): string | null;
@@ -13,8 +13,10 @@
13
13
  * See the License for the specific language governing permissions and
14
14
  * limitations under the License.
15
15
  */
16
+ export { changeEnviromentDevice } from './changeEnviromentDevice';
16
17
  export { genLinkDeviceCodeForPhoneNumber } from './genLinkDeviceCodeForPhoneNumber';
17
18
  export { getAuthCode } from './getAuthCode';
19
+ export { getBuildConstants } from './getBuildConstants';
18
20
  export { getHistorySyncProgress, HistorySyncProgress, } from './getHistorySyncProgress';
19
21
  export { getMyDeviceId } from './getMyDeviceId';
20
22
  export { getMyUserId } from './getMyUserId';
@@ -20,6 +20,8 @@ import { ContactModel, Wid } from '../../whatsapp';
20
20
  * @example
21
21
  * ```javascript
22
22
  * await WPP.contact.get('[number]@c.us');
23
+ * await WPP.contact.get('[number]@lid');
24
+ * await WPP.contact.get('[number]@g.us');
23
25
  * ```
24
26
  *
25
27
  * @category Contact
@@ -0,0 +1,59 @@
1
+ /*!
2
+ * Copyright 2023 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 { WPPError } from '../../util';
17
+ import { Wid } from '../../whatsapp';
18
+ export interface PnLidWid {
19
+ id: string;
20
+ server: string;
21
+ _serialized: string;
22
+ }
23
+ export interface PnLidContactInfo {
24
+ name?: string;
25
+ shortName?: string;
26
+ pushname?: string;
27
+ type?: 'in' | 'out';
28
+ verifiedName?: string;
29
+ isBusiness?: boolean;
30
+ isEnterprise?: boolean;
31
+ verifiedLevel?: number;
32
+ syncToAddressbook?: boolean;
33
+ isContactSyncCompleted?: number;
34
+ }
35
+ export interface PnLidEntryResult {
36
+ lid?: PnLidWid;
37
+ phoneNumber?: PnLidWid;
38
+ contact?: PnLidContactInfo;
39
+ }
40
+ export declare class InvalidWidForGetPnLidEntry extends WPPError {
41
+ readonly id: string | {
42
+ _serialized: string;
43
+ };
44
+ constructor(id: string | {
45
+ _serialized: string;
46
+ });
47
+ }
48
+ /**
49
+ * Get LID/PhoneNumber mapping and Contact information
50
+ *
51
+ * @example
52
+ * ```javascript
53
+ * await WPP.contact.getPnLidEntry('[number]@c.us');
54
+ * await WPP.contact.getPnLidEntry('[number]@lid');
55
+ * ```
56
+ *
57
+ * @category Contact
58
+ */
59
+ export declare function getPnLidEntry(contactId: string | Wid): Promise<PnLidEntryResult>;
@@ -16,6 +16,7 @@
16
16
  export { get } from './get';
17
17
  export { getBusinessProfile } from './getBusinessProfile';
18
18
  export { getCommonGroups } from './getCommonGroups';
19
+ export { getPnLidEntry, InvalidWidForGetPnLidEntry, PnLidContactInfo, PnLidEntryResult, PnLidWid, } from './getPnLidEntry';
19
20
  export { getProfilePictureUrl } from './getProfilePictureUrl';
20
21
  export { getStatus } from './getStatus';
21
22
  export { ContactListOptions, list } from './list';
@@ -1,5 +1,5 @@
1
1
  /*!
2
- * Copyright 2024 WPPConnect Team
2
+ * Copyright 2025 WPPConnect Team
3
3
  *
4
4
  * Licensed under the Apache License, Version 2.0 (the "License");
5
5
  * you may not use this file except in compliance with the License.
@@ -13,7 +13,7 @@
13
13
  * See the License for the specific language governing permissions and
14
14
  * limitations under the License.
15
15
  */
16
- import { ContactModel, Wid } from '../../whatsapp';
16
+ import { ContactModel } from '../../whatsapp';
17
17
  /**
18
18
  * Create new or update a contact in the device
19
19
  *
@@ -27,7 +27,7 @@ import { ContactModel, Wid } from '../../whatsapp';
27
27
  *
28
28
  * @category Contact
29
29
  */
30
- export declare function save(contactId: string | Wid, name: string, options?: {
30
+ export declare function save(contactId: string | any, name: string, options?: {
31
31
  surname?: string;
32
32
  syncAdressBook?: boolean;
33
33
  }): Promise<ContactModel | undefined>;
@@ -0,0 +1,29 @@
1
+ /*!
2
+ * Copyright 2022 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
+ * Format bytes as human-readable text.
18
+ *
19
+ * @param bytes Number of bytes.
20
+ * @returns Formatted string.
21
+ */
22
+ export declare function formatFileSize(bytes: number): string;
23
+ /**
24
+ * Determine the media type for file size validation
25
+ * @param optionsType The media type specified in options ('image', 'video', 'audio', 'document', or 'auto-detect')
26
+ * @param mimeType The MIME type of the file (e.g., 'image/png', 'video/mp4')
27
+ * @returns The determined media type for validation ('image', 'video', 'audio', or 'document')
28
+ */
29
+ export declare function getMediaTypeForValidation(optionsType: string, mimeType: string): string;
@@ -21,10 +21,20 @@ import { Collection } from './Collection';
21
21
  */
22
22
  export declare class CallCollection extends Collection<CallModel> {
23
23
  static model: CallModel;
24
- pendingOffers?: any;
25
- pendingVoipCapChecks?: any;
26
- handleQuery(): any;
27
- processIncomingCall(e?: any, t?: any, r?: any): any;
28
- cleanupPendingOffer(e?: any): any;
29
- setActiveCall(e?: any): any;
24
+ $CallCollectionImpl$p_1?: () => any;
25
+ activeCall: CallModel | null;
26
+ isInConnectedCall: boolean;
27
+ pendingOffers: Record<string, any>;
28
+ pendingVoipCapChecks: Record<string, any>;
29
+ _cachePolicy: any;
30
+ _events: Record<string, any>;
31
+ _index: Record<string, any>;
32
+ _inflight: Record<string, any>;
33
+ _listenId: string;
34
+ _models: CallModel[];
35
+ _staleCollection: boolean;
36
+ cleanupPendingOffer(a?: any): any;
37
+ processIncomingCall(a?: any, b?: any, e?: any): any;
38
+ setActiveCall(a?: any): any;
39
+ setIsInConnectedCall(flag: boolean): any;
30
40
  }
@@ -15,6 +15,12 @@
15
15
  */
16
16
  import { Wid } from '../misc';
17
17
  /**
18
- * @whatsapp WAWebContactEditUtils >= 2.3000.0
18
+ * Check if a contact can be saved to contacts
19
+ * @whatsapp WAWebContactUtils >= 2.3000.0
20
+ * @note Function name changed from canSaveAsMyContacts (plural) to canSaveAsMyContact (singular) in newer versions (>= 2.3000.10286.x)
21
+ */
22
+ export declare function canSaveAsMyContact(wid: Wid): boolean;
23
+ /**
24
+ * @deprecated Use canSaveAsMyContact instead. This alias is kept for backward compatibility.
19
25
  */
20
26
  export declare function canSaveAsMyContacts(wid: Wid): boolean;
@@ -0,0 +1,24 @@
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
+ import { ChatModel, MsgModel } from '../models';
17
+ export type ForwardMessagesParams = {
18
+ chat: ChatModel;
19
+ msgs: MsgModel[];
20
+ multicast: boolean;
21
+ includeCaption: boolean;
22
+ appendedText: boolean;
23
+ };
24
+ export declare function forwardMessages(params: ForwardMessagesParams): Promise<Array<any>>;
@@ -0,0 +1,24 @@
1
+ /*!
2
+ * Copyright 2024 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
+ * Get upload limit for media files based on media type and status origin
18
+ * @whatsapp WAWebMediaGatingUtils
19
+ * @param mediaType Media type ('audio', 'video', 'image', 'document', 'sticker', 'sticker-pack')
20
+ * @param fileOrigin File origin for status uploads (e.g., 'STATUS_TAB_CAMERA_PHOTO_LIBRARY')
21
+ * @param isVcardOverMmsDocument Whether this is a vCard over MMS document
22
+ * @returns Upload limit in bytes
23
+ */
24
+ export declare function getUploadLimit(mediaType: string, fileOrigin?: string | null, isVcardOverMmsDocument?: boolean): number;
@@ -54,6 +54,7 @@ export * from './findChat';
54
54
  export * from './findCommonGroups';
55
55
  export * from './findFirstWebLink';
56
56
  export * from './findOrCreateLatestChat';
57
+ export * from './forwardMessages';
57
58
  export * from './forwardMessagesToChats';
58
59
  export * from './frontendFireAndForget';
59
60
  export * from './genBotMsgSecretFromMsgSecret';
@@ -19,8 +19,10 @@
19
19
  /**
20
20
  * @param user 5521980809090
21
21
  * @param userToDelete 5521980809090
22
+ * @param e_fullName Contact Full Name
23
+ * @param f_firstName Contact First Name
22
24
  * @param name Contact Name
23
25
  * @param surname Contact Surname
24
26
  * @param syncToAddressbook Sync to Addressbook boolean
25
27
  */
26
- export declare function saveContactAction(userToCreate: string, userToDelete: string | null, name?: any, surname?: any, syncToAddressbook?: boolean): Promise<undefined>;
28
+ export declare function saveContactAction(userToCreate: string, userToDelete: string | null, e_fullName?: any, f_firstName?: any, name?: any, surname?: any, syncToAddressbook?: boolean): Promise<undefined>;
@@ -76,10 +76,23 @@ export declare class CmdClass extends EventEmitter {
76
76
  openChatAt(chat: ChatModel, msgContext: ReturnType<typeof getSearchContext>): Promise<boolean>;
77
77
  openChatAt(params?: {
78
78
  chat: ChatModel;
79
+ chatEntryPoint?: string;
79
80
  msgContext: ReturnType<typeof getSearchContext>;
81
+ onSuccess?: {
82
+ onScrollToQuotedCarouselCard?: void;
83
+ mediaMsgToOpenInMediaViewer?: void;
84
+ };
80
85
  }): Promise<boolean>;
81
86
  openChatFromUnread(chat: ChatModel): Promise<boolean>;
87
+ openChatFromUnread(params: {
88
+ chat: ChatModel;
89
+ chatEntryPoint?: string;
90
+ }): Promise<boolean>;
82
91
  openChatBottom(chat: ChatModel): Promise<boolean>;
92
+ openChatBottom(params: {
93
+ chat: ChatModel;
94
+ chatEntryPoint?: string;
95
+ }): Promise<boolean>;
83
96
  scrollToPtt(e?: any): void;
84
97
  _scrollToFocusedMsg(e?: any): void;
85
98
  _scrollChatToBottom(): void;
@@ -0,0 +1,22 @@
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 declare const Enviroment: {
17
+ default: {
18
+ isWeb: boolean;
19
+ isWindows: boolean;
20
+ isGuest: boolean;
21
+ };
22
+ };
@@ -0,0 +1,39 @@
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
+ import { Wid } from './Wid';
17
+ /**
18
+ * @whatsapp WAWebApiContact
19
+ * Exposing Lid / PhoneNumber cache functions
20
+ * These functions manage the cache mapping between LID and Phone Numbers.
21
+ * Without hitting whatsapp api.
22
+ */
23
+ export declare namespace lidPnCache {
24
+ function getPhoneNumber(lidWid: Wid): Wid | undefined;
25
+ function getCurrentLid(phoneWid: Wid): Wid | undefined;
26
+ function getLidEntry(lidWid: Wid): {
27
+ lid: Wid;
28
+ phoneNumber: Wid;
29
+ phoneNumberCreatedAt: number;
30
+ } | undefined;
31
+ function add(lidWid: Wid, entry: {
32
+ lid: Wid;
33
+ phoneNumber: Wid;
34
+ phoneNumberCreatedAt: number;
35
+ }): void;
36
+ function getAllLids(): Wid[];
37
+ function clear(): void;
38
+ function remove(lidWid: Wid): void;
39
+ }
@@ -0,0 +1,29 @@
1
+ /*!
2
+ * Copyright 2024 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 WAWebMediaGatingUtils
18
+ */
19
+ export declare namespace MediaGatingUtils {
20
+ /**
21
+ * Get upload limit for media files based on media type and status origin
22
+ * @whatsapp >= 2.3000.1027640936
23
+ * @param mediaType Media type ('audio', 'video', 'image', 'document', 'sticker', 'sticker-pack')
24
+ * @param fileOrigin File origin for status uploads (e.g., 'STATUS_TAB_CAMERA_PHOTO_LIBRARY')
25
+ * @param isVcardOverMmsDocument Whether this is a vCard over MMS document
26
+ * @returns Upload limit in bytes
27
+ */
28
+ function getUploadLimit(mediaType: string, fileOrigin?: string | null, isVcardOverMmsDocument?: boolean): number;
29
+ }