talkyzap-wapp-api 1.0.17 → 1.0.19

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 (73) hide show
  1. package/CHANGELOG.md +1 -1
  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/functions/forwardMessage.d.ts +4 -4
  6. package/dist/chat/functions/forwardMessages.d.ts +33 -0
  7. package/dist/chat/functions/getMessages.d.ts +7 -0
  8. package/dist/chat/functions/index.d.ts +2 -1
  9. package/dist/chat/functions/list.d.ts +4 -0
  10. package/dist/chat/functions/openChatAt.d.ts +3 -1
  11. package/dist/chat/functions/openChatBottom.d.ts +3 -1
  12. package/dist/chat/functions/openChatFromUnread.d.ts +3 -1
  13. package/dist/chat/functions/pinMsg.d.ts +19 -5
  14. package/dist/chat/functions/sendFileMessage.d.ts +13 -0
  15. package/dist/chat/functions/sendTextMessage.d.ts +2 -3
  16. package/dist/chat/index.d.ts +1 -0
  17. package/dist/chat/types.d.ts +11 -3
  18. package/dist/chat/util/index.d.ts +16 -0
  19. package/dist/chat/util/rehydrateMessage.d.ts +17 -0
  20. package/dist/conn/functions/changeEnviromentDevice.d.ts +19 -0
  21. package/dist/conn/functions/getBuildConstants.d.ts +37 -0
  22. package/dist/conn/functions/getMigrationState.d.ts +52 -0
  23. package/dist/conn/functions/index.d.ts +3 -0
  24. package/dist/contact/functions/get.d.ts +2 -0
  25. package/dist/contact/functions/getPnLidEntry.d.ts +59 -0
  26. package/dist/contact/functions/index.d.ts +1 -0
  27. package/dist/contact/functions/save.d.ts +3 -3
  28. package/dist/gtag/Tracker.d.ts +1 -1
  29. package/dist/order/functions/accept.d.ts +58 -0
  30. package/dist/order/functions/decline.d.ts +53 -0
  31. package/dist/order/functions/index.d.ts +3 -0
  32. package/dist/order/functions/update.d.ts +77 -0
  33. package/dist/order/index.d.ts +1 -0
  34. package/dist/order/types.d.ts +119 -0
  35. package/dist/util/fileHelpers.d.ts +29 -0
  36. package/dist/util/index.d.ts +1 -0
  37. package/dist/util/isUrl.d.ts +21 -0
  38. package/dist/whatsapp/collections/CallCollection.d.ts +16 -6
  39. package/dist/whatsapp/enums/ACK.d.ts +5 -3
  40. package/dist/whatsapp/enums/PinExpiryDurationOption.d.ts +25 -0
  41. package/dist/whatsapp/enums/index.d.ts +1 -0
  42. package/dist/whatsapp/functions/addAndSendMessageEdit.d.ts +2 -2
  43. package/dist/whatsapp/functions/addAndSendMsgToChat.d.ts +2 -2
  44. package/dist/whatsapp/functions/canSaveAsMyContacts.d.ts +7 -1
  45. package/dist/whatsapp/functions/createChat.d.ts +2 -0
  46. package/dist/whatsapp/functions/forwardMessages.d.ts +24 -0
  47. package/dist/whatsapp/functions/getPhoneLangPref.d.ts +25 -0
  48. package/dist/whatsapp/functions/getUploadLimit.d.ts +24 -0
  49. package/dist/whatsapp/functions/index.d.ts +4 -0
  50. package/dist/whatsapp/functions/isLidMigrated.d.ts +1 -1
  51. package/dist/whatsapp/functions/msgFindQuery.d.ts +4 -2
  52. package/dist/whatsapp/functions/queryOrder.d.ts +8 -7
  53. package/dist/whatsapp/functions/saveContactAction.d.ts +3 -1
  54. package/dist/whatsapp/functions/sendOrderStatusMessageAsMerchant.d.ts +47 -0
  55. package/dist/whatsapp/functions/sendPinInChatMsg.d.ts +4 -8
  56. package/dist/whatsapp/functions/updateMessageTable.d.ts +18 -0
  57. package/dist/whatsapp/index.d.ts +1 -0
  58. package/dist/whatsapp/misc/Cmd.d.ts +13 -0
  59. package/dist/whatsapp/misc/Enviroment.d.ts +22 -0
  60. package/dist/whatsapp/misc/LidPnCache.d.ts +39 -0
  61. package/dist/whatsapp/misc/MediaGatingUtils.d.ts +29 -0
  62. package/dist/whatsapp/misc/MediaPrep.d.ts +3 -2
  63. package/dist/whatsapp/misc/UserPrefs.d.ts +26 -7
  64. package/dist/whatsapp/misc/Wid.d.ts +8 -0
  65. package/dist/whatsapp/misc/WidFactory.d.ts +1 -0
  66. package/dist/whatsapp/misc/index.d.ts +3 -0
  67. package/dist/whatsapp/models/ChatModel.d.ts +1 -1
  68. package/dist/whatsapp/models/MsgModel.d.ts +17 -1
  69. package/dist/whatsapp/types.d.ts +21 -0
  70. package/dist/wppconnect-wa.js +1 -1
  71. package/dist/wppconnect-wa.js.LICENSE.txt +1 -1
  72. package/eslint.config.mjs +108 -0
  73. package/package.json +21 -23
@@ -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>;
@@ -47,6 +47,6 @@ export declare class Tracker {
47
47
  * Send a user engagement each 5 minutes
48
48
  */
49
49
  private processUserEngagement;
50
- trackEvent(eventName: string, params?: Record<string, string | number | boolean>): void;
50
+ trackEvent(_eventName: string, _params?: Record<string, string | number | boolean>): void;
51
51
  setUserProperty(key: string, value: any): void;
52
52
  }
@@ -0,0 +1,58 @@
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 '../../whatsapp';
17
+ /**
18
+ * Options for accepting an order
19
+ */
20
+ export interface AcceptOrderOptions {
21
+ /** The message ID or message key of the order message */
22
+ msgId: string | MsgKey;
23
+ }
24
+ /**
25
+ * Accept an order
26
+ *
27
+ * This function performs TWO critical operations:
28
+ * 1. Updates the order message's status field from INQUIRY (1) to ACCEPTED (2)
29
+ * - This hides the "Accept Order" button in the UI
30
+ * 2. Sends an order status update message to the customer
31
+ * - Shows "Processing" or "Confirmed" status
32
+ *
33
+ * The order information is automatically retrieved from the message.
34
+ *
35
+ * @example
36
+ * ```javascript
37
+ * // Accept an order with default "Processing" status
38
+ * await WPP.order.accept({
39
+ * msgId: 'message_id_here',
40
+ * acceptNote: 'Your order has been confirmed and is being processed'
41
+ * });
42
+ *
43
+ * // Accept with "Confirmed" status
44
+ * await WPP.order.accept({
45
+ * msgId: 'message_id_here',
46
+ * orderStatus: WPP.order.OrderStatus.Confirmed,
47
+ * acceptNote: 'Your order has been confirmed'
48
+ * });
49
+ *
50
+ * // Accept without a note
51
+ * await WPP.order.accept({
52
+ * msgId: 'message_id_here'
53
+ * });
54
+ * ```
55
+ *
56
+ * @category Order
57
+ */
58
+ export declare function accept(options: AcceptOrderOptions): Promise<void>;
@@ -0,0 +1,53 @@
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 '../../whatsapp';
17
+ /**
18
+ * Options for declining an order
19
+ */
20
+ export interface DeclineOrderOptions {
21
+ /** The message ID or message key of the order message */
22
+ msgId: string | MsgKey;
23
+ /** Optional note to include with the decline message (recommended) */
24
+ declineNote?: string;
25
+ }
26
+ /**
27
+ * Decline an order
28
+ *
29
+ * This function performs TWO critical operations:
30
+ * 1. Updates the order message's status field from INQUIRY (1) to DECLINED (3)
31
+ * - This changes the UI to show the order as declined
32
+ * 2. Sends an order cancellation message to the customer
33
+ * - Shows "Canceled" status with optional note
34
+ *
35
+ * The order information is automatically retrieved from the message.
36
+ *
37
+ * @example
38
+ * ```javascript
39
+ * // Decline an order with a note
40
+ * await WPP.order.decline({
41
+ * msgId: 'message_id_here',
42
+ * declineNote: 'Sorry, we cannot fulfill this order at this time'
43
+ * });
44
+ *
45
+ * // Decline without a note
46
+ * await WPP.order.decline({
47
+ * msgId: 'message_id_here'
48
+ * });
49
+ * ```
50
+ *
51
+ * @category Order
52
+ */
53
+ export declare function decline(options: DeclineOrderOptions): Promise<void>;
@@ -13,4 +13,7 @@
13
13
  * See the License for the specific language governing permissions and
14
14
  * limitations under the License.
15
15
  */
16
+ export { accept } from './accept';
17
+ export { decline } from './decline';
16
18
  export { get } from './get';
19
+ export { update } from './update';
@@ -0,0 +1,77 @@
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 { UpdateOrderOptions } from '../types';
17
+ /**
18
+ * Update an order status and/or payment information
19
+ *
20
+ * This function sends an order status update message to the customer.
21
+ *
22
+ * **Important:** For accepting or declining orders, use the dedicated `accept()` and `decline()`
23
+ * functions instead. Those functions properly update both the message status field (UI state)
24
+ * and send the status update message.
25
+ *
26
+ * This function is best used for status updates after an order has been accepted, such as:
27
+ * - Marking as shipped
28
+ * - Marking as delivered
29
+ * - Marking as complete
30
+ * - Updating payment information
31
+ *
32
+ * @example
33
+ * ```javascript
34
+ * // Mark as shipped
35
+ * await WPP.order.update({
36
+ * msgId: 'message_id_here',
37
+ * orderInfo: {
38
+ * items: [
39
+ * {
40
+ * id: 'product_1',
41
+ * name: 'Product Name',
42
+ * amount: 1000,
43
+ * quantity: 2,
44
+ * isCustomItem: false,
45
+ * isQuantitySet: true
46
+ * }
47
+ * ],
48
+ * totalAmount: 2000,
49
+ * subtotal: 2000,
50
+ * currency: 'USD'
51
+ * },
52
+ * orderStatus: WPP.order.OrderStatus.Shipped,
53
+ * orderNote: 'Your order has been shipped',
54
+ * referenceId: 'ORDER_12345'
55
+ * });
56
+ *
57
+ * // Mark as delivered
58
+ * await WPP.order.update({
59
+ * msgId: 'message_id_here',
60
+ * orderInfo: { ... },
61
+ * orderStatus: WPP.order.OrderStatus.Delivered,
62
+ * orderNote: 'Your order has been delivered'
63
+ * });
64
+ *
65
+ * // Update payment status
66
+ * await WPP.order.update({
67
+ * msgId: 'message_id_here',
68
+ * orderInfo: { ... },
69
+ * orderStatus: WPP.order.OrderStatus.Complete,
70
+ * paymentStatus: WPP.order.PaymentStatus.Captured,
71
+ * orderNote: 'Order completed and payment received'
72
+ * });
73
+ * ```
74
+ *
75
+ * @category Order
76
+ */
77
+ export declare function update(options: UpdateOrderOptions): Promise<void>;
@@ -15,3 +15,4 @@
15
15
  */
16
16
  export * from './events';
17
17
  export * from './functions';
18
+ export * from './types';
@@ -0,0 +1,119 @@
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 '../whatsapp';
17
+ /**
18
+ * Order item information
19
+ */
20
+ export interface OrderItem {
21
+ id: string;
22
+ name: string;
23
+ amount: number;
24
+ quantity: number;
25
+ isCustomItem?: boolean;
26
+ isQuantitySet?: boolean;
27
+ }
28
+ /**
29
+ * Order information structure
30
+ */
31
+ export interface OrderInfo {
32
+ items: OrderItem[];
33
+ totalAmount: number;
34
+ subtotal: number;
35
+ tax?: number;
36
+ shipping?: number;
37
+ discount?: number;
38
+ currency: string;
39
+ }
40
+ /**
41
+ * Options for updating an order status
42
+ */
43
+ export interface UpdateOrderOptions {
44
+ /** The message ID or message key of the order message */
45
+ msgId: string | MsgKey;
46
+ /** The new order status */
47
+ orderStatus: OrderStatus;
48
+ /** Optional note to include with the status update */
49
+ orderNote?: string;
50
+ /** The decimal offset for amount values (default: 2 for cents) */
51
+ offset?: number;
52
+ /** Reference ID for the order */
53
+ referenceId?: string;
54
+ /** Optional payment status update */
55
+ paymentStatus?: PaymentStatus;
56
+ /** Optional payment method */
57
+ paymentMethod?: string;
58
+ }
59
+ /**
60
+ * Order status values from WhatsApp's OrderStatus enum
61
+ * Based on WAWebOrderStatus module
62
+ */
63
+ export declare enum OrderStatus {
64
+ /** Order is pending confirmation */
65
+ Pending = "pending",
66
+ /** Order is being processed */
67
+ Processing = "processing",
68
+ /** Order has been partially shipped */
69
+ PartiallyShipped = "partially_shipped",
70
+ /** Order has been shipped */
71
+ Shipped = "shipped",
72
+ /** Order is complete */
73
+ Complete = "completed",
74
+ /** Order has been canceled */
75
+ Canceled = "canceled",
76
+ /** Payment has been requested */
77
+ PaymentRequested = "payment_requested",
78
+ /** Order is being prepared for shipping */
79
+ PreparingToShip = "preparing_to_ship",
80
+ /** Order has been delivered */
81
+ Delivered = "delivered",
82
+ /** Order has been confirmed */
83
+ Confirmed = "confirmed",
84
+ /** Order delivery is delayed */
85
+ Delayed = "delayed",
86
+ /** Order has failed */
87
+ Failed = "failed",
88
+ /** Order is out for delivery */
89
+ OutForDelivery = "out_for_delivery",
90
+ /** Order has been refunded */
91
+ Refunded = "refunded"
92
+ }
93
+ /**
94
+ * Payment status values from WhatsApp's OrderPaymentStatus enum
95
+ * Based on WAWebOrderPaymentStatus module
96
+ */
97
+ export declare enum PaymentStatus {
98
+ /** Payment is pending */
99
+ Pending = "pending",
100
+ /** Payment has been captured/completed */
101
+ Captured = "captured",
102
+ /** Payment has failed */
103
+ Failed = "failed",
104
+ /** Payment has been canceled */
105
+ Canceled = "canceled"
106
+ }
107
+ /**
108
+ * Order message status from Message$OrderMessage$OrderStatus protobuf enum
109
+ * This controls the UI state (whether "Accept Order" button is shown)
110
+ * Based on WAWebProtobufsE2E.pb.Message$OrderMessage$OrderStatus
111
+ */
112
+ export declare enum OrderMessageStatus {
113
+ /** Initial order inquiry state - shows "Accept Order" button */
114
+ INQUIRY = 1,
115
+ /** Order accepted by merchant - hides "Accept Order" button */
116
+ ACCEPTED = 2,
117
+ /** Order declined by merchant */
118
+ DECLINED = 3
119
+ }
@@ -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;
@@ -23,6 +23,7 @@ export * from './fetchDataFromPNG';
23
23
  export * from './generateOrderUniqueId';
24
24
  export * from './getVideoInfoFromBuffer';
25
25
  export * from './isBase64';
26
+ export * from './isUrl';
26
27
  export * from './resizeImage';
27
28
  export * from './types';
28
29
  export * from './wrapFunction';
@@ -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
+ /**
17
+ * Check if a string is a valid HTTP or HTTPS URL
18
+ * @param url The string to check
19
+ * @returns true if the string is a valid HTTP/HTTPS URL, false otherwise
20
+ */
21
+ export declare function isUrl(url: string): boolean;
@@ -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
  }
@@ -13,9 +13,11 @@
13
13
  * See the License for the specific language governing permissions and
14
14
  * limitations under the License.
15
15
  */
16
- /** @whatsapp 35470
17
- * @whatsapp 69618 >= 2.2204.13
18
- * @whatsapp 535470 >= 2.2222.8
16
+ /**
17
+ * Versions when this enum was added/modified/revalidated:
18
+ * @whatsapp >= 2.2204.13
19
+ * @whatsapp >= 2.2222.8
20
+ * @whatsapp >= 2.3000.1029594945
19
21
  */
20
22
  export declare enum ACK {
21
23
  MD_DOWNGRADE = -7,
@@ -0,0 +1,25 @@
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
+ /** @whatsapp WAWebPinMsgConstants >= 2.3000.1029839609
17
+ */
18
+ export declare enum PinExpiryDurationOption {
19
+ FiveSeconds = "FiveSeconds",
20
+ FifteenSeconds = "FifteenSeconds",
21
+ OneMinute = "OneMinute",
22
+ OneDay = "OneDay",
23
+ SevenDays = "SevenDays",
24
+ ThirtyDays = "ThirtyDays"
25
+ }
@@ -21,4 +21,5 @@ export * from './LogoutReason';
21
21
  export * from './MSG_TYPE';
22
22
  export * from './OUTWARD_TYPES';
23
23
  export * from './PIN_STATE';
24
+ export * from './PinExpiryDurationOption';
24
25
  export * from './SendMsgResult';
@@ -13,8 +13,8 @@
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
16
  import { ModelPropertiesContructor, MsgModel } from '../models';
17
+ import { SendMsgResultObject } from '../types';
18
18
  /** @whatsapp 375399
19
19
  */
20
- export declare function addAndSendMessageEdit(editMsg: MsgModel, message: ModelPropertiesContructor<MsgModel>): Promise<[Promise<MsgModel>, Promise<SendMsgResult>]>;
20
+ export declare function addAndSendMessageEdit(editMsg: MsgModel, message: ModelPropertiesContructor<MsgModel>): Promise<[Promise<MsgModel>, Promise<SendMsgResultObject>]>;
@@ -13,10 +13,10 @@
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
16
  import { ChatModel, ModelPropertiesContructor, MsgModel } from '../models';
17
+ import { SendMsgResultObject } from '../types';
18
18
  /** @whatsapp 75887
19
19
  * @whatsapp 975887 >= 2.2222.8
20
20
  * @whatsapp 623631 >= 2.2228.4
21
21
  */
22
- export declare function addAndSendMsgToChat(chat: ChatModel, message: ModelPropertiesContructor<MsgModel>): Promise<[Promise<MsgModel>, Promise<SendMsgResult>]>;
22
+ export declare function addAndSendMsgToChat(chat: ChatModel, message: ModelPropertiesContructor<MsgModel>): Promise<[Promise<MsgModel>, Promise<SendMsgResultObject>]>;
@@ -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>;
@@ -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;