talkyzap-wapp-api 1.0.16 → 1.0.18

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 (77) hide show
  1. package/CHANGELOG.md +1 -6
  2. package/README.md +78 -26
  3. package/dist/call/events/eventTypes.d.ts +2 -3
  4. package/dist/call/events/registerIncomingCallEvent.d.ts +1 -1
  5. package/dist/chat/events/eventTypes.d.ts +14 -0
  6. package/dist/chat/events/index.d.ts +1 -0
  7. package/dist/chat/events/registerUnreadCountEvent.d.ts +16 -0
  8. package/dist/chat/functions/forwardMessage.d.ts +4 -4
  9. package/dist/chat/functions/forwardMessages.d.ts +33 -0
  10. package/dist/chat/functions/getMessages.d.ts +7 -0
  11. package/dist/chat/functions/getUnreadChats.d.ts +23 -0
  12. package/dist/chat/functions/index.d.ts +3 -1
  13. package/dist/chat/functions/list.d.ts +4 -0
  14. package/dist/chat/functions/openChatAt.d.ts +3 -1
  15. package/dist/chat/functions/openChatBottom.d.ts +3 -1
  16. package/dist/chat/functions/openChatFromUnread.d.ts +3 -1
  17. package/dist/chat/functions/pinMsg.d.ts +19 -5
  18. package/dist/chat/functions/sendFileMessage.d.ts +13 -0
  19. package/dist/chat/functions/sendTextMessage.d.ts +2 -3
  20. package/dist/chat/index.d.ts +1 -0
  21. package/dist/chat/types.d.ts +11 -3
  22. package/dist/chat/util/index.d.ts +16 -0
  23. package/dist/chat/util/rehydrateMessage.d.ts +17 -0
  24. package/dist/conn/functions/changeEnviromentDevice.d.ts +19 -0
  25. package/dist/conn/functions/getBuildConstants.d.ts +37 -0
  26. package/dist/conn/functions/getMigrationState.d.ts +52 -0
  27. package/dist/conn/functions/index.d.ts +3 -0
  28. package/dist/contact/functions/get.d.ts +2 -0
  29. package/dist/contact/functions/getPnLidEntry.d.ts +59 -0
  30. package/dist/contact/functions/index.d.ts +1 -0
  31. package/dist/contact/functions/save.d.ts +3 -3
  32. package/dist/gtag/Tracker.d.ts +1 -1
  33. package/dist/order/functions/accept.d.ts +58 -0
  34. package/dist/order/functions/decline.d.ts +53 -0
  35. package/dist/order/functions/index.d.ts +3 -0
  36. package/dist/order/functions/update.d.ts +77 -0
  37. package/dist/order/index.d.ts +1 -0
  38. package/dist/order/types.d.ts +119 -0
  39. package/dist/util/fileHelpers.d.ts +29 -0
  40. package/dist/util/index.d.ts +1 -0
  41. package/dist/util/isUrl.d.ts +21 -0
  42. package/dist/whatsapp/collections/CallCollection.d.ts +16 -6
  43. package/dist/whatsapp/enums/ACK.d.ts +5 -3
  44. package/dist/whatsapp/enums/PinExpiryDurationOption.d.ts +25 -0
  45. package/dist/whatsapp/enums/index.d.ts +1 -0
  46. package/dist/whatsapp/functions/addAndSendMessageEdit.d.ts +2 -2
  47. package/dist/whatsapp/functions/addAndSendMsgToChat.d.ts +2 -2
  48. package/dist/whatsapp/functions/canSaveAsMyContacts.d.ts +7 -1
  49. package/dist/whatsapp/functions/createChat.d.ts +2 -0
  50. package/dist/whatsapp/functions/createGroup.d.ts +12 -2
  51. package/dist/whatsapp/functions/forwardMessages.d.ts +24 -0
  52. package/dist/whatsapp/functions/getPhoneLangPref.d.ts +25 -0
  53. package/dist/whatsapp/functions/getUploadLimit.d.ts +24 -0
  54. package/dist/whatsapp/functions/index.d.ts +4 -0
  55. package/dist/whatsapp/functions/msgFindQuery.d.ts +4 -2
  56. package/dist/whatsapp/functions/queryOrder.d.ts +8 -7
  57. package/dist/whatsapp/functions/saveContactAction.d.ts +3 -1
  58. package/dist/whatsapp/functions/sendOrderStatusMessageAsMerchant.d.ts +47 -0
  59. package/dist/whatsapp/functions/sendPinInChatMsg.d.ts +4 -8
  60. package/dist/whatsapp/functions/updateMessageTable.d.ts +18 -0
  61. package/dist/whatsapp/index.d.ts +1 -0
  62. package/dist/whatsapp/misc/Cmd.d.ts +13 -0
  63. package/dist/whatsapp/misc/Enviroment.d.ts +22 -0
  64. package/dist/whatsapp/misc/LidPnCache.d.ts +39 -0
  65. package/dist/whatsapp/misc/MediaGatingUtils.d.ts +29 -0
  66. package/dist/whatsapp/misc/MediaPrep.d.ts +3 -2
  67. package/dist/whatsapp/misc/UserPrefs.d.ts +27 -8
  68. package/dist/whatsapp/misc/Wid.d.ts +8 -0
  69. package/dist/whatsapp/misc/WidFactory.d.ts +2 -0
  70. package/dist/whatsapp/misc/index.d.ts +3 -0
  71. package/dist/whatsapp/models/ChatModel.d.ts +1 -1
  72. package/dist/whatsapp/models/MsgModel.d.ts +17 -1
  73. package/dist/whatsapp/types.d.ts +21 -0
  74. package/dist/wppconnect-wa.js +1 -1
  75. package/dist/wppconnect-wa.js.LICENSE.txt +1 -1
  76. package/eslint.config.mjs +108 -0
  77. package/package.json +30 -32
@@ -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;
@@ -15,5 +15,7 @@
15
15
  */
16
16
  /**
17
17
  * @whatsapp WAWebCreateChat >= 2.3000.0
18
+ * findChat internally uses this function to create a new chat
19
+ * to create a chat use Chat.findChat(wid) instead
18
20
  */
19
21
  export declare function createChat(chatParams: any, context: any, options: any, extra: any): Promise<any>;
@@ -17,7 +17,15 @@ import { Wid } from '..';
17
17
  /**
18
18
  * @whatsapp 247355
19
19
  */
20
- export declare function createGroup(groupName: string, participants: Wid[], ephemeral?: number, parentGroup?: Wid): Promise<{
20
+ export declare function createGroup(options: {
21
+ title: string;
22
+ ephemeralDuration: number;
23
+ restrict: boolean;
24
+ announce: boolean;
25
+ membershipApprovalMode: boolean;
26
+ memberAddMode: boolean;
27
+ parentGroupId?: Wid;
28
+ }, participants: Wid[]): Promise<{
21
29
  wid: Wid;
22
30
  participants: {
23
31
  wid: Wid;
@@ -34,7 +42,9 @@ export declare function createGroup(options: {
34
42
  membershipApprovalMode: boolean;
35
43
  memberAddMode: boolean;
36
44
  parentGroupId?: Wid;
37
- }, participants: Wid[]): Promise<{
45
+ }, participants: {
46
+ phoneNumber: Wid;
47
+ }[]): Promise<{
38
48
  wid: Wid;
39
49
  participants: {
40
50
  wid: Wid;
@@ -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,25 @@
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 phone language preference
18
+ * @whatsapp WAWebUserPrefsLocales
19
+ */
20
+ export declare function getPhoneLangPref(): string | null;
21
+ /**
22
+ * Set phone language preference
23
+ * @whatsapp WAWebUserPrefsLocales
24
+ */
25
+ export declare function setPhoneLangPref(locale: string): void;
@@ -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';
@@ -80,6 +81,7 @@ export * from './getNextLabelId';
80
81
  export * from './getNumChatsPinned';
81
82
  export * from './getOrderInfo';
82
83
  export * from './getParticipants';
84
+ export * from './getPhoneLangPref';
83
85
  export * from './getPhoneNumber';
84
86
  export * from './getPrivacyDisallowedListTable';
85
87
  export * from './getPushname';
@@ -137,6 +139,7 @@ export * from './sendExitGroup';
137
139
  export * from './sendGroupParticipants';
138
140
  export * from './sendJoinGroupViaInvite';
139
141
  export * from './sendNewsletterMessageJob';
142
+ export * from './sendOrderStatusMessageAsMerchant';
140
143
  export * from './sendPinInChatMsg';
141
144
  export * from './sendQueryExists';
142
145
  export * from './sendQueryGroupInvite';
@@ -162,6 +165,7 @@ export * from './unmuteNewsletter';
162
165
  export * from './updateCart';
163
166
  export * from './updateCartEnabled';
164
167
  export * from './updateDBForGroupAction';
168
+ export * from './updateMessageTable';
165
169
  export * from './updateNewsletterMsgRecord';
166
170
  export * from './updateParticipants';
167
171
  export * from './uploadMedia';
@@ -24,5 +24,7 @@ export interface MsgFindQueryParams {
24
24
  participant?: any;
25
25
  media?: 'url' | 'document';
26
26
  }
27
- /** @whatsapp 76581 */
28
- export declare function msgFindQuery(direction: 'after' | 'before' | 'media', params: MsgFindQueryParams): Promise<ModelPropertiesContructor<MsgModel>[] | any>;
27
+ /**
28
+ * @whatsapp WAWebDBMessageFindLocal >= 2.3000.1029x
29
+ */
30
+ export declare function msgFindQuery(type: 'after' | 'before' | 'call_log' | 'event' | 'media' | 'search' | 'star', params: MsgFindQueryParams): Promise<ModelPropertiesContructor<MsgModel>[] | any>;
@@ -19,14 +19,15 @@ export declare function queryOrder(productId: string, imageWidth: number, imageH
19
19
  createdAt: number;
20
20
  products: {
21
21
  id: string;
22
- price: number;
23
- thumbnailId: string;
24
- thumbnailUrl: string;
25
- currency: string;
22
+ price: number | null;
23
+ thumbnailId: string | null;
24
+ thumbnailUrl: string | null;
25
+ currency: string | null;
26
26
  name: string;
27
- quantity: number;
27
+ quantity: number | null;
28
+ properties: [string, string][];
28
29
  }[];
29
- subtotal: number;
30
- total: number;
30
+ subtotal: number | null;
31
+ total: number | null;
31
32
  tax: number | null;
32
33
  }>;
@@ -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>;
@@ -0,0 +1,47 @@
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 interface SendOrderStatusParams {
17
+ chat: any;
18
+ sellerJid: string | any;
19
+ orderInfo: {
20
+ items: Array<{
21
+ id: string;
22
+ name: string;
23
+ amount: number;
24
+ quantity: number;
25
+ isCustomItem?: boolean;
26
+ isQuantitySet?: boolean;
27
+ }>;
28
+ totalAmount: number;
29
+ subtotal: number;
30
+ tax?: number;
31
+ shipping?: number;
32
+ discount?: number;
33
+ currency: string;
34
+ referenceId?: string;
35
+ };
36
+ orderNote?: string;
37
+ orderStatus: string;
38
+ offset: number;
39
+ paymentStatus: string;
40
+ paymentMethod?: string;
41
+ contextInfo?: any;
42
+ }
43
+ /**
44
+ * Function to send order status update message as merchant
45
+ * @internal
46
+ */
47
+ export declare function sendOrderStatusMessageAsMerchant(params: SendOrderStatusParams): Promise<any>;
@@ -13,13 +13,9 @@
13
13
  * See the License for the specific language governing permissions and
14
14
  * limitations under the License.
15
15
  */
16
- import { SendMsgResult } from '../enums';
17
- import { PIN_STATE } from '../enums/PIN_STATE';
16
+ import { ACK, PIN_STATE, PinExpiryDurationOption } from '../enums';
18
17
  import { MsgModel } from '../models';
19
- /** @whatsapp WAWebSendPinMessageAction >= 2.3000.1012170943
18
+ import { SendMsgResultObject } from '../types';
19
+ /** @whatsapp WAWebSendPinMessageAction >= 2.3000.1029839609
20
20
  */
21
- export declare function sendPinInChatMsg(msg: MsgModel, type: PIN_STATE, time?: number, d?: any): Promise<{
22
- count: number;
23
- messageSendResult: SendMsgResult;
24
- t: number;
25
- }>;
21
+ export declare function sendPinInChatMsg(msg: MsgModel, type: PIN_STATE, pinExpiryOption?: PinExpiryDurationOption, ack?: ACK): Promise<SendMsgResultObject | null>;
@@ -0,0 +1,18 @@
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 { MsgKey } from '../misc';
17
+ /** @whatsapp WAWebDBUpdateMessageTable */
18
+ export declare function updateMessageTable(msgKey: MsgKey, updateFields: Record<string, any>): Promise<void>;
@@ -22,4 +22,5 @@ export * from './misc';
22
22
  export * from './models';
23
23
  export * as multidevice from './multidevice';
24
24
  export * from './stores';
25
+ export * from './types';
25
26
  export * as websocket from './websocket';
@@ -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
+ }
@@ -14,7 +14,8 @@
14
14
  * limitations under the License.
15
15
  */
16
16
  import { ChatModel, MediaDataModel, ModelPropertiesContructor, MsgModel } from '..';
17
- import { OUTWARD_TYPES, SendMsgResult } from '../enums';
17
+ import { OUTWARD_TYPES } from '../enums';
18
+ import { SendMsgResultObject } from '../types';
18
19
  import { OpaqueData } from '.';
19
20
  /** @whatsapp 78986
20
21
  * @whatsapp 778986 >= 2.2222.8
@@ -43,7 +44,7 @@ export declare namespace MediaPrep {
43
44
  forwardedFromWeb?: boolean;
44
45
  ctwaContext?: any;
45
46
  isViewOnce?: boolean;
46
- }): Promise<SendMsgResult>;
47
+ }): Promise<SendMsgResultObject>;
47
48
  waitForPrep(): Promise<MediaDataModel>;
48
49
  }
49
50
  }
@@ -1,5 +1,5 @@
1
1
  /*!
2
- * Copyright 2021 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.
@@ -15,28 +15,43 @@
15
15
  */
16
16
  import { Wid } from './Wid';
17
17
  /**
18
- * @whatsapp 459857 >= 2.2310.5
18
+ * @whatsapp >= 2.3000
19
19
  */
20
20
  export declare namespace UserPrefs {
21
- function getMaybeMeDevicePn(...args: any[]): any;
22
- function assertGetMe(): Wid;
23
- function assertGetMeUser(): Wid;
21
+ function clearGetMaybeLidUserCache(...args: any[]): any;
24
22
  function clearGetMaybeMePnUserCache(...args: any[]): any;
25
- function getMaybeMeDisplayName(...args: any[]): any;
26
23
  function getMaybeMeDeviceLid(...args: any[]): any;
24
+ function getMaybeMeDevicePn(...args: any[]): any;
25
+ function getMaybeMeDisplayName(...args: any[]): any;
27
26
  function getMaybeMeLidUser(...args: any[]): any;
28
27
  function getMaybeMePnUser(): Wid;
29
28
  function getMaybeMeUser(): Wid;
30
- function getMePNandLIDWids(...args: any[]): any;
31
- function getMeUser(): Wid;
29
+ function getMeDeviceLidOrThrow(...args: any[]): any;
30
+ function getMeDevicePnOrThrow(...args: any[]): any;
31
+ function getMeDisplayNameOrThrow(...args: any[]): any;
32
+ function getMeLidUserOrThrow(...args: any[]): any;
33
+ function getMePNandLIDWids(...args: any[]): [Wid | undefined, Wid | undefined];
34
+ function getMePnUserOrThrow(...args: any[]): any;
35
+ function getUnknownId(...args: any[]): any;
32
36
  function isMeAccount(...args: any[]): any;
37
+ function isMeAccountNonLid(...args: any[]): any;
33
38
  function isMeDevice(...args: any[]): any;
34
39
  function isMePrimary(...args: any[]): any;
35
40
  function isMePrimaryNonLid(...args: any[]): any;
41
+ function isMeUser(...args: any[]): any;
36
42
  function isSerializedWidMe(...args: any[]): any;
37
43
  function setMe(...args: any[]): any;
38
44
  function setMeDisplayName(...args: any[]): any;
39
45
  function setMeLid(...args: any[]): any;
46
+ function setUnknownId(...args: any[]): any;
47
+ /**
48
+ * @deprecated
49
+ */
50
+ function assertGetMe(): Wid;
51
+ /**
52
+ * @deprecated
53
+ */
54
+ function assertGetMeUser(): Wid;
40
55
  /**
41
56
  * @deprecated
42
57
  */
@@ -45,6 +60,10 @@ export declare namespace UserPrefs {
45
60
  * @deprecated
46
61
  */
47
62
  function getMeDevicePn(...args: any[]): any;
63
+ /**
64
+ * @deprecated
65
+ */
66
+ function getMeUser(): Wid;
48
67
  /**
49
68
  * @deprecated
50
69
  */
@@ -41,6 +41,14 @@ export declare class Wid {
41
41
  isServer(): boolean;
42
42
  isStatusV3(): boolean;
43
43
  isStatus(): boolean;
44
+ /**
45
+ * @whatsapp >= 2.3000.1029594945
46
+ * this.server==="c.us" ||
47
+ * this.server==="lid" ||
48
+ * this.server==="bot" ||
49
+ * this.server==="hosted" || (probably used for cloud api)
50
+ * this.server==="hosted.lid" (probably used for cloud api)
51
+ */
44
52
  isUser(): boolean;
45
53
  isLid(): boolean;
46
54
  isUserNotPSA(): boolean;
@@ -22,6 +22,7 @@ export declare namespace WidFactory {
22
22
  function createDeviceWid(wid: string): Wid;
23
23
  function createDeviceWidFromUserAndDevice(user: string, device: string): Wid;
24
24
  function createUserWid(user: string, server?: string): Wid;
25
+ function createUserWidOrThrow(user: string, server?: string): Wid;
25
26
  function createWid(wid: string): Wid;
26
27
  function createWidFromWidLike(wid: string | {
27
28
  _serialized: string;
@@ -33,4 +34,5 @@ export declare namespace WidFactory {
33
34
  function userJidToUserWid(wid: string): Wid;
34
35
  function toUserLidOrThrow(wid: Wid): Wid;
35
36
  function toUserWidOrThrow(wid: Wid): Wid;
37
+ function createWid(wid: Wid): Wid;
36
38
  }
@@ -21,12 +21,15 @@ export * from './Cmd';
21
21
  export * from './ComposeBoxActions';
22
22
  export * from './Conn';
23
23
  export * from './Constants';
24
+ export * from './Enviroment';
24
25
  export * from './EventEmitter';
25
26
  export * from './ImageUtils';
26
27
  export * from './IsOfficialClient';
27
28
  export * from './Lid1X1MigrationUtils';
29
+ export * from './LidPnCache';
28
30
  export * from './MediaBlobCache';
29
31
  export * from './MediaEntry';
32
+ export * from './MediaGatingUtils';
30
33
  export * from './MediaObject';
31
34
  export * from './MediaObjectUtil';
32
35
  export * from './MediaPrep';
@@ -23,7 +23,7 @@ interface Props extends PropsChatBase {
23
23
  lastReceivedKey?: MsgKey;
24
24
  t?: number;
25
25
  unreadCount: number;
26
- archive?: any;
26
+ archive?: boolean;
27
27
  isReadOnly: boolean;
28
28
  isAnnounceGrpRestrict: boolean;
29
29
  modifyTag?: any;
@@ -198,7 +198,23 @@ interface Props {
198
198
  broadcastParticipants?: any;
199
199
  broadcastEphSettings?: any;
200
200
  broadcastId?: any;
201
- ctwaContext?: any;
201
+ ctwaContext?: {
202
+ conversionSource?: string;
203
+ conversionData?: object;
204
+ sourceUrl?: string;
205
+ description?: string;
206
+ title?: string;
207
+ thumbnail?: string;
208
+ thumbnailUrl?: string;
209
+ mediaType?: number;
210
+ adContextPreviewDismissed?: boolean;
211
+ sourceApp?: string;
212
+ greetingMessageBody?: string;
213
+ automatedGreetingMessageShown?: boolean;
214
+ sourceId?: string;
215
+ originalImageUrl?: string;
216
+ mediaUrl?: string;
217
+ };
202
218
  list?: {
203
219
  buttonText: string;
204
220
  description: string;
@@ -0,0 +1,21 @@
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 { SendMsgResult } from './enums';
17
+ export interface SendMsgResultObject {
18
+ messageSendResult: SendMsgResult;
19
+ t?: number;
20
+ count?: number | null;
21
+ }