@wppconnect/wa-js 3.17.7 → 3.18.0

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 CHANGED
@@ -1,9 +1,4 @@
1
- ## 3.17.7 (2025-05-27)
2
-
3
-
4
- ### Bug Fixes
5
-
6
- * improovments on queryExist ([1429676](https://github.com/wppconnect-team/wa-js/commit/14296766d99be4d76eb74fc757ce861c9833994e))
1
+ # 3.18.0 (2025-07-23)
7
2
 
8
3
 
9
4
 
@@ -20,5 +20,7 @@ export { getProfilePictureUrl } from './getProfilePictureUrl';
20
20
  export { getStatus } from './getStatus';
21
21
  export { ContactListOptions, list } from './list';
22
22
  export { queryExists } from './queryExists';
23
+ export { remove } from './remove';
24
+ export { save } from './save';
23
25
  export { subscribePresence } from './subscribePresence';
24
26
  export { unsubscribePresence } from './unsubscribePresence';
@@ -31,6 +31,7 @@ export interface QueryExistsResult {
31
31
  settingTimestamp: number;
32
32
  };
33
33
  status?: string;
34
+ lid?: Wid;
34
35
  }
35
36
  /**
36
37
  * Check if the number exists and what is correct ID
@@ -0,0 +1,27 @@
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
+ import { ContactModel, Wid } from '../../whatsapp';
17
+ /**
18
+ * Remove/delete contact in the device
19
+ *
20
+ * @example
21
+ * ```javascript
22
+ * await WPP.contact.remove('5533999999999@c.us');
23
+ * ```
24
+ *
25
+ * @category Contact
26
+ */
27
+ export declare function remove(contactId: string | Wid): Promise<ContactModel | undefined>;
@@ -0,0 +1,33 @@
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
+ import { ContactModel, Wid } from '../../whatsapp';
17
+ /**
18
+ * Create new or update a contact in the device
19
+ *
20
+ * @example
21
+ * ```javascript
22
+ * await WPP.contact.save('5533999999999@c.us', 'John', {
23
+ * surname: 'Doe',
24
+ * syncAdressBook: true,
25
+ * });
26
+ * ```
27
+ *
28
+ * @category Contact
29
+ */
30
+ export declare function save(contactId: string | Wid, name: string, options?: {
31
+ surname?: string;
32
+ syncAdressBook?: boolean;
33
+ }): Promise<ContactModel | undefined>;
@@ -0,0 +1,20 @@
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
+ import { Wid } from '../misc';
17
+ /**
18
+ * @whatsapp WAWebContactEditUtils >= 2.3000.0
19
+ */
20
+ export declare function canSaveAsMyContacts(wid: Wid): boolean;
@@ -0,0 +1,19 @@
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 WAWebDeleteContactAction >= 2.3000.0
18
+ */
19
+ export declare function deleteContactAction(number: string): Promise<void>;
@@ -22,6 +22,7 @@ export * from './calculateFilehashFromBlob';
22
22
  export * from './canEditCaption';
23
23
  export * from './canEditMsg';
24
24
  export * from './canReplyMsg';
25
+ export * from './canSaveAsMyContacts';
25
26
  export * from './changeOptInStatusForExternalWebBeta';
26
27
  export * from './checkChatExistedOrCreate';
27
28
  export * from './collections';
@@ -37,6 +38,7 @@ export * from './createNewsletterQuery';
37
38
  export * from './createOrder';
38
39
  export * from './createOrUpdateReactions';
39
40
  export * from './currencyForCountryShortcode';
41
+ export * from './deleteContactAction';
40
42
  export * from './deleteNewsletter';
41
43
  export * from './editBusinessProfile';
42
44
  export * from './editNewsletterMetadataAction';
@@ -97,6 +99,7 @@ export * from './initializeAltDeviceLinking';
97
99
  export * from './isAnimatedWebp';
98
100
  export * from './isAuthenticated';
99
101
  export * from './isFilterExcludedFromSearchTreatmentInInboxFlow';
102
+ export * from './isLidMigrated';
100
103
  export * from './isRegistered';
101
104
  export * from './isUnreadTypeMsg';
102
105
  export * from './isWid';
@@ -124,6 +127,7 @@ export * from './randomId';
124
127
  export * from './removeStatusMessage';
125
128
  export * from './resetGroupInviteCode';
126
129
  export * from './revokeStatus';
130
+ export * from './saveContactAction';
127
131
  export * from './selectChatForOneOnOneMessage';
128
132
  export * from './sendClear';
129
133
  export * from './sendCreateCommunity';
@@ -145,11 +149,13 @@ export * from './setGroup';
145
149
  export * from './setPin';
146
150
  export * from './setPrivacyForOneCategory';
147
151
  export * from './setPushname';
152
+ export * from './shouldHaveAccountLid';
148
153
  export * from './status';
149
154
  export * from './STATUS_JID';
150
155
  export * from './statusEnable';
151
156
  export * from './subscribePresence';
152
157
  export * from './syncABPropsTask';
158
+ export * from './toUserLid';
153
159
  export * from './typeAttributeFromProtobuf';
154
160
  export * from './unixTime';
155
161
  export * from './unmuteNewsletter';
@@ -0,0 +1,19 @@
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 WAWebLidMigrationUtils >= 2.3000.x
18
+ */
19
+ export declare function isLidMigrated(): boolean;
@@ -0,0 +1,26 @@
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 WAWebSaveContactAction >= 2.3000.0
18
+ */
19
+ /**
20
+ * @param user 5521980809090
21
+ * @param userToDelete 5521980809090
22
+ * @param name Contact Name
23
+ * @param surname Contact Surname
24
+ * @param syncToAddressbook Sync to Addressbook boolean
25
+ */
26
+ export declare function saveContactAction(userToCreate: string, userToDelete: string | null, name?: any, surname?: any, syncToAddressbook?: boolean): Promise<undefined>;
@@ -15,40 +15,43 @@
15
15
  */
16
16
  import { Wid } from '..';
17
17
  export interface QueryGroupInviteResult {
18
- announce: boolean;
19
- creation: number;
20
- /** description of the group; linebreaks are formatted using `"\n"` */
21
- desc: string;
22
- descId: string;
23
- descOwner?: Wid;
24
- descTime: number;
25
- id: Wid;
26
- noFrequentlyForwarded: boolean;
27
- owner?: Wid;
28
- parent: boolean;
29
- participants: {
18
+ groupInfo: {
19
+ announce: boolean;
20
+ creation: number;
21
+ /** description of the group; linebreaks are formatted using `"\n"` */
22
+ desc: string;
23
+ descId: string;
24
+ descOwner?: Wid;
25
+ descTime: number;
30
26
  id: Wid;
31
- isAdmin: boolean;
32
- isSuperAdmin: boolean;
33
- }[];
34
- pvId?: string;
35
- restrict: boolean;
36
- /** how many members the group currently has */
37
- size: number;
27
+ noFrequentlyForwarded: boolean;
28
+ owner?: Wid;
29
+ parent: boolean;
30
+ participants: {
31
+ id: Wid;
32
+ isAdmin: boolean;
33
+ isSuperAdmin: boolean;
34
+ }[];
35
+ pvId?: string;
36
+ restrict: boolean;
37
+ /** how many members the group currently has */
38
+ size: number;
39
+ status: number;
40
+ /** title of the group */
41
+ subject: string;
42
+ subjectOwner?: Wid;
43
+ subjectTime: number;
44
+ support: boolean;
45
+ suspended: boolean;
46
+ isParentGroup: boolean;
47
+ isParentGroupClosed: boolean;
48
+ defaultSubgroup: boolean;
49
+ generalSubgroup: boolean;
50
+ membershipApprovalMode: boolean;
51
+ isLidAddressingMode: boolean;
52
+ generalChatAutoAddDisabled: boolean;
53
+ };
38
54
  status: number;
39
- /** title of the group */
40
- subject: string;
41
- subjectOwner?: Wid;
42
- subjectTime: number;
43
- support: boolean;
44
- suspended: boolean;
45
- isParentGroup: boolean;
46
- isParentGroupClosed: boolean;
47
- defaultSubgroup: boolean;
48
- generalSubgroup: boolean;
49
- membershipApprovalMode: boolean;
50
- isLidAddressingMode: boolean;
51
- generalChatAutoAddDisabled: boolean;
52
55
  }
53
56
  /** @whatsapp 10790
54
57
  * @whatsapp 810790 >= 2.2222.8
@@ -0,0 +1,19 @@
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 WAWebLidMigrationUtils >= 2.3000.x
18
+ */
19
+ export declare function shouldHaveAccountLid(): boolean;
@@ -0,0 +1,20 @@
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
+ import { Wid } from '../misc';
17
+ /**
18
+ * @whatsapp WAWebLidMigrationUtils >= 2.3000.x
19
+ */
20
+ export declare function toUserLid(wid: Wid): Wid;