@wppconnect/wa-js 3.18.8 → 3.19.2
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/README.md +78 -26
- package/dist/chat/functions/getMessages.d.ts +7 -0
- package/dist/chat/functions/list.d.ts +4 -0
- package/dist/chat/functions/openChatAt.d.ts +1 -1
- package/dist/chat/functions/openChatBottom.d.ts +1 -1
- package/dist/chat/functions/openChatFromUnread.d.ts +1 -1
- package/dist/chat/functions/pinMsg.d.ts +19 -5
- package/dist/chat/functions/sendTextMessage.d.ts +2 -3
- package/dist/chat/types.d.ts +4 -3
- package/dist/conn/functions/getBuildConstants.d.ts +31 -2
- package/dist/conn/functions/getMigrationState.d.ts +52 -0
- package/dist/conn/functions/index.d.ts +2 -1
- package/dist/contact/functions/save.d.ts +6 -2
- package/dist/order/functions/accept.d.ts +58 -0
- package/dist/order/functions/decline.d.ts +53 -0
- package/dist/order/functions/index.d.ts +3 -0
- package/dist/order/functions/update.d.ts +77 -0
- package/dist/order/index.d.ts +1 -0
- package/dist/order/types.d.ts +119 -0
- package/dist/whatsapp/enums/ACK.d.ts +5 -3
- package/dist/whatsapp/enums/PinExpiryDurationOption.d.ts +25 -0
- package/dist/whatsapp/enums/index.d.ts +1 -0
- package/dist/whatsapp/functions/addAndSendMessageEdit.d.ts +2 -2
- package/dist/whatsapp/functions/addAndSendMsgToChat.d.ts +2 -2
- package/dist/whatsapp/functions/contactFunctions.d.ts +8 -8
- package/dist/whatsapp/functions/createChat.d.ts +2 -0
- package/dist/whatsapp/functions/deleteContactAction.d.ts +39 -0
- package/dist/whatsapp/functions/getPhoneLangPref.d.ts +25 -0
- package/dist/whatsapp/functions/index.d.ts +3 -0
- package/dist/whatsapp/functions/isFilterExcludedFromSearchTreatmentInInboxFlow.d.ts +1 -1
- package/dist/whatsapp/functions/isLidMigrated.d.ts +1 -1
- package/dist/whatsapp/functions/msgFindQuery.d.ts +4 -2
- package/dist/whatsapp/functions/queryOrder.d.ts +8 -7
- package/dist/whatsapp/functions/saveContactAction.d.ts +21 -2
- package/dist/whatsapp/functions/sendOrderStatusMessageAsMerchant.d.ts +47 -0
- package/dist/whatsapp/functions/sendPinInChatMsg.d.ts +4 -8
- package/dist/whatsapp/functions/updateMessageTable.d.ts +18 -0
- package/dist/whatsapp/index.d.ts +1 -0
- package/dist/whatsapp/misc/MediaPrep.d.ts +3 -2
- package/dist/whatsapp/misc/UserPrefs.d.ts +26 -7
- package/dist/whatsapp/misc/UsernameGatingUtils.d.ts +26 -0
- package/dist/whatsapp/misc/Wid.d.ts +8 -0
- package/dist/whatsapp/misc/index.d.ts +1 -0
- package/dist/whatsapp/models/ChatModel.d.ts +4 -1
- package/dist/whatsapp/models/ContactModel.d.ts +1 -0
- package/dist/whatsapp/models/MsgModel.d.ts +17 -1
- package/dist/whatsapp/types.d.ts +21 -0
- package/dist/wppconnect-wa.js +1 -1
- package/dist/wppconnect-wa.js.LICENSE.txt +1 -1
- package/eslint.config.mjs +108 -0
- package/package.json +11 -13
package/dist/order/index.d.ts
CHANGED
|
@@ -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
|
+
}
|
|
@@ -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
|
-
/**
|
|
17
|
-
*
|
|
18
|
-
* @whatsapp
|
|
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
|
+
}
|
|
@@ -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<
|
|
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<
|
|
22
|
+
export declare function addAndSendMsgToChat(chat: ChatModel, message: ModelPropertiesContructor<MsgModel>): Promise<[Promise<MsgModel>, Promise<SendMsgResultObject>]>;
|
|
@@ -14,10 +14,6 @@
|
|
|
14
14
|
* limitations under the License.
|
|
15
15
|
*/
|
|
16
16
|
import { ContactModel } from '../models';
|
|
17
|
-
/**
|
|
18
|
-
* @whatsapp 660666 >= 2.2327.4
|
|
19
|
-
*/
|
|
20
|
-
export declare function getMentionName(contact: ContactModel): string;
|
|
21
17
|
/**
|
|
22
18
|
* @whatsapp 660666 >= 2.2327.4
|
|
23
19
|
*/
|
|
@@ -78,10 +74,6 @@ export declare function getIsSupportAccount(contact: ContactModel): any;
|
|
|
78
74
|
* @whatsapp 660666 >= 2.2327.4
|
|
79
75
|
*/
|
|
80
76
|
export declare function getIsWAContact(contact: ContactModel): any;
|
|
81
|
-
/**
|
|
82
|
-
* @whatsapp 660666 >= 2.2327.4
|
|
83
|
-
*/
|
|
84
|
-
export declare function getIsMyContact(contact: ContactModel): boolean;
|
|
85
77
|
/**
|
|
86
78
|
* @whatsapp 660666 >= 2.2327.4
|
|
87
79
|
*/
|
|
@@ -147,3 +139,11 @@ export declare function getFormattedName(contact: ContactModel): any;
|
|
|
147
139
|
* @whatsapp 714574 >= 2.2327.4
|
|
148
140
|
*/
|
|
149
141
|
export declare function getFormattedUser(contact: ContactModel): any;
|
|
142
|
+
/**
|
|
143
|
+
* @whatsapp >= 2.3000.1030318976 (last check)
|
|
144
|
+
*/
|
|
145
|
+
export declare function getIsMyContact(contact: ContactModel): boolean;
|
|
146
|
+
/**
|
|
147
|
+
* @whatsapp >= 2.3000.1030318976 (last check)
|
|
148
|
+
*/
|
|
149
|
+
export declare function getMentionName(contact: ContactModel): string;
|
|
@@ -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>;
|
|
@@ -13,7 +13,46 @@
|
|
|
13
13
|
* See the License for the specific language governing permissions and
|
|
14
14
|
* limitations under the License.
|
|
15
15
|
*/
|
|
16
|
+
import { Wid } from '../misc';
|
|
16
17
|
/**
|
|
18
|
+
* Deletes a contact from the contact list (legacy API).
|
|
19
|
+
*
|
|
17
20
|
* @whatsapp WAWebDeleteContactAction >= 2.3000.0
|
|
21
|
+
* @whatsapp ~2.3000.1030040369
|
|
22
|
+
*
|
|
23
|
+
* @param number - Phone number string
|
|
24
|
+
*
|
|
25
|
+
* @deprecated Since around WhatsApp version 2.3000.1030110621. Use the new object-based API instead.
|
|
26
|
+
* Use `deleteContactActionV2({ phoneNumber: wid })` for regular contacts
|
|
27
|
+
* or `deleteContactActionV2({ username, lid })` for username contacts.
|
|
28
|
+
*
|
|
29
|
+
* @example
|
|
30
|
+
* // Deprecated usage
|
|
31
|
+
* await deleteContactAction('5511999999999');
|
|
32
|
+
*
|
|
33
|
+
* // Use this instead
|
|
34
|
+
* await deleteContactActionV2({ phoneNumber: wid });
|
|
18
35
|
*/
|
|
19
36
|
export declare function deleteContactAction(number: string): Promise<void>;
|
|
37
|
+
/**
|
|
38
|
+
* Deletes a contact from the contact list.
|
|
39
|
+
*
|
|
40
|
+
* @whatsapp WAWebDeleteContactAction >= 2.3000.1030110621
|
|
41
|
+
*
|
|
42
|
+
* @param params - Object with contact identifiers
|
|
43
|
+
* @param params.phoneNumber - Contact phone number as Wid (for regular contacts)
|
|
44
|
+
* @param params.username - Contact username (for username contacts)
|
|
45
|
+
* @param params.lid - Contact LID (for username contacts)
|
|
46
|
+
*
|
|
47
|
+
* @example
|
|
48
|
+
* // Delete regular contact by phone number
|
|
49
|
+
* await deleteContactActionV2({ phoneNumber: wid });
|
|
50
|
+
*
|
|
51
|
+
* // Delete username contact
|
|
52
|
+
* await deleteContactActionV2({ username: 'john', lid: '123' });
|
|
53
|
+
*/
|
|
54
|
+
export declare function deleteContactActionV2(params: {
|
|
55
|
+
phoneNumber?: Wid;
|
|
56
|
+
username?: string;
|
|
57
|
+
lid?: string;
|
|
58
|
+
}): Promise<void>;
|
|
@@ -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;
|
|
@@ -81,6 +81,7 @@ export * from './getNextLabelId';
|
|
|
81
81
|
export * from './getNumChatsPinned';
|
|
82
82
|
export * from './getOrderInfo';
|
|
83
83
|
export * from './getParticipants';
|
|
84
|
+
export * from './getPhoneLangPref';
|
|
84
85
|
export * from './getPhoneNumber';
|
|
85
86
|
export * from './getPrivacyDisallowedListTable';
|
|
86
87
|
export * from './getPushname';
|
|
@@ -138,6 +139,7 @@ export * from './sendExitGroup';
|
|
|
138
139
|
export * from './sendGroupParticipants';
|
|
139
140
|
export * from './sendJoinGroupViaInvite';
|
|
140
141
|
export * from './sendNewsletterMessageJob';
|
|
142
|
+
export * from './sendOrderStatusMessageAsMerchant';
|
|
141
143
|
export * from './sendPinInChatMsg';
|
|
142
144
|
export * from './sendQueryExists';
|
|
143
145
|
export * from './sendQueryGroupInvite';
|
|
@@ -163,6 +165,7 @@ export * from './unmuteNewsletter';
|
|
|
163
165
|
export * from './updateCart';
|
|
164
166
|
export * from './updateCartEnabled';
|
|
165
167
|
export * from './updateDBForGroupAction';
|
|
168
|
+
export * from './updateMessageTable';
|
|
166
169
|
export * from './updateNewsletterMsgRecord';
|
|
167
170
|
export * from './updateParticipants';
|
|
168
171
|
export * from './uploadMedia';
|
|
@@ -13,4 +13,4 @@
|
|
|
13
13
|
* See the License for the specific language governing permissions and
|
|
14
14
|
* limitations under the License.
|
|
15
15
|
*/
|
|
16
|
-
export declare function isFilterExcludedFromSearchTreatmentInInboxFlow(type?: string):
|
|
16
|
+
export declare function isFilterExcludedFromSearchTreatmentInInboxFlow(type?: string): boolean;
|
|
@@ -24,5 +24,7 @@ export interface MsgFindQueryParams {
|
|
|
24
24
|
participant?: any;
|
|
25
25
|
media?: 'url' | 'document';
|
|
26
26
|
}
|
|
27
|
-
/**
|
|
28
|
-
|
|
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
|
}>;
|
|
@@ -14,9 +14,10 @@
|
|
|
14
14
|
* limitations under the License.
|
|
15
15
|
*/
|
|
16
16
|
/**
|
|
17
|
+
* Save contact action (legacy positional parameters API)
|
|
17
18
|
* @whatsapp WAWebSaveContactAction >= 2.3000.0
|
|
18
|
-
|
|
19
|
-
|
|
19
|
+
* @deprecated Use saveContactActionV2 instead for versions >= 2.3000.1030209354
|
|
20
|
+
* @whatsapp WAWebSaveContactAction >= 2.3000.0, < 2.3000.1030209354
|
|
20
21
|
* @param user 5521980809090
|
|
21
22
|
* @param userToDelete 5521980809090
|
|
22
23
|
* @param e_fullName Contact Full Name
|
|
@@ -26,3 +27,21 @@
|
|
|
26
27
|
* @param syncToAddressbook Sync to Addressbook boolean
|
|
27
28
|
*/
|
|
28
29
|
export declare function saveContactAction(userToCreate: string, userToDelete: string | null, e_fullName?: any, f_firstName?: any, name?: any, surname?: any, syncToAddressbook?: boolean): Promise<undefined>;
|
|
30
|
+
/**
|
|
31
|
+
* Object parameter interface for saveContactActionV2 (>= 2.3000.1030209354)
|
|
32
|
+
*/
|
|
33
|
+
export interface SaveContactActionParamsV2 {
|
|
34
|
+
phoneNumber?: string | null;
|
|
35
|
+
prevPhoneNumber?: string | null;
|
|
36
|
+
lid?: string | null;
|
|
37
|
+
username?: string | null;
|
|
38
|
+
firstName: string;
|
|
39
|
+
lastName: string;
|
|
40
|
+
syncToAddressbook?: boolean;
|
|
41
|
+
}
|
|
42
|
+
/**
|
|
43
|
+
* Save contact action (new object parameter API)
|
|
44
|
+
* @whatsapp WAWebSaveContactAction >= 2.3000.1030209354
|
|
45
|
+
* @param params Contact parameters object
|
|
46
|
+
*/
|
|
47
|
+
export declare function saveContactActionV2(params: SaveContactActionParamsV2): 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 {
|
|
17
|
-
import { PIN_STATE } from '../enums/PIN_STATE';
|
|
16
|
+
import { ACK, PIN_STATE, PinExpiryDurationOption } from '../enums';
|
|
18
17
|
import { MsgModel } from '../models';
|
|
19
|
-
|
|
18
|
+
import { SendMsgResultObject } from '../types';
|
|
19
|
+
/** @whatsapp WAWebSendPinMessageAction >= 2.3000.1029839609
|
|
20
20
|
*/
|
|
21
|
-
export declare function sendPinInChatMsg(msg: MsgModel, type: PIN_STATE,
|
|
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>;
|
package/dist/whatsapp/index.d.ts
CHANGED
|
@@ -14,7 +14,8 @@
|
|
|
14
14
|
* limitations under the License.
|
|
15
15
|
*/
|
|
16
16
|
import { ChatModel, MediaDataModel, ModelPropertiesContructor, MsgModel } from '..';
|
|
17
|
-
import { OUTWARD_TYPES
|
|
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<
|
|
47
|
+
}): Promise<SendMsgResultObject>;
|
|
47
48
|
waitForPrep(): Promise<MediaDataModel>;
|
|
48
49
|
}
|
|
49
50
|
}
|
|
@@ -15,28 +15,43 @@
|
|
|
15
15
|
*/
|
|
16
16
|
import { Wid } from './Wid';
|
|
17
17
|
/**
|
|
18
|
-
* @whatsapp
|
|
18
|
+
* @whatsapp >= 2.3000
|
|
19
19
|
*/
|
|
20
20
|
export declare namespace UserPrefs {
|
|
21
|
-
function
|
|
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
|
|
31
|
-
function
|
|
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
|
*/
|
|
@@ -0,0 +1,26 @@
|
|
|
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
|
+
/**
|
|
17
|
+
* @whatsapp WAWebUsernameGatingUtils
|
|
18
|
+
*/
|
|
19
|
+
export declare namespace UsernameGatingUtils {
|
|
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
|
+
}
|
|
@@ -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;
|
|
@@ -43,6 +43,7 @@ export * from './ServerProps';
|
|
|
43
43
|
export * from './ServerPropsConstants';
|
|
44
44
|
export * from './Socket';
|
|
45
45
|
export * from './Stream';
|
|
46
|
+
export * from './UsernameGatingUtils';
|
|
46
47
|
export * from './UserPrefs';
|
|
47
48
|
export * from './USyncQuery';
|
|
48
49
|
export * from './USyncUser';
|