talkyzap-wapp-api 1.0.14 → 1.0.16

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,9 @@
1
- ## 3.17.7 (2025-05-27)
1
+ ## 3.18.2 (2025-08-29)
2
2
 
3
3
 
4
4
  ### Bug Fixes
5
5
 
6
- * improovments on queryExist ([1429676](https://github.com/wppconnect-team/wa-js/commit/14296766d99be4d76eb74fc757ce861c9833994e))
6
+ * Fixed getMyDeviceId >= 2.3000.1026498050 ([#2869](https://github.com/wppconnect-team/wa-js/issues/2869)) ([56ee7de](https://github.com/wppconnect-team/wa-js/commit/56ee7de458fcd62ef59409cd307b1cc5ef9d76ec))
7
7
 
8
8
 
9
9
 
@@ -15,12 +15,12 @@
15
15
  */
16
16
  import { WPPError } from '../util';
17
17
  export declare class InvalidColor extends WPPError {
18
- readonly color?: (string | number | {
18
+ readonly color?: string | number | {
19
19
  _serialized: string;
20
- }) | undefined;
21
- constructor(color?: (string | number | {
20
+ } | undefined;
21
+ constructor(color?: string | number | {
22
22
  _serialized: string;
23
- }) | undefined);
23
+ } | undefined);
24
24
  }
25
25
  /**
26
26
  * Return the color in positive decimal
@@ -164,7 +164,7 @@ export interface VideoMessageOptions extends FileMessageOptions, MessageButtonsO
164
164
  * // A simple video
165
165
  * WPP.chat.sendFileMessage(
166
166
  * '[number]@c.us',
167
- * 'data:application/msword;base64,<a long base64 file...>',
167
+ * 'data:video/mp4;base64,<a long base64 file...>',
168
168
  * {
169
169
  * type: 'video',
170
170
  * }
@@ -173,7 +173,7 @@ export interface VideoMessageOptions extends FileMessageOptions, MessageButtonsO
173
173
  * // A PTV Video (micro video)
174
174
  * WPP.chat.sendFileMessage(
175
175
  * '[number]@c.us',
176
- * 'data:application/msword;base64,<a long base64 file...>',
176
+ * 'data:video/mp4;base64,<a long base64 file...>',
177
177
  * {
178
178
  * type: 'video',
179
179
  * isPtv: true,
@@ -0,0 +1,26 @@
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 '../../whatsapp';
17
+ /**
18
+ * Return the current logged user ID without device id
19
+ *
20
+ * @example
21
+ * ```javascript
22
+ * const wid = WPP.conn.getMyUserId();
23
+ * console.log(wid.toString()); // Output: 123@c.us
24
+ * ```
25
+ */
26
+ export declare function getMyUserWid(): Wid;
@@ -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>;
@@ -23,11 +23,11 @@ import { BusinessProfileModel } from '../../whatsapp';
23
23
  * ```
24
24
  *
25
25
  * ```javascript
26
- * await WPP.profile.editBusinessProfile({categories: {
26
+ * await WPP.profile.editBusinessProfile({categories: [{
27
27
  id: "133436743388217",
28
28
  localized_display_name: "Artes e entretenimento",
29
29
  not_a_biz: false,
30
- }});
30
+ }]});
31
31
  * ```
32
32
  *
33
33
  * ```javascript
@@ -144,31 +144,65 @@ import { BusinessProfileModel } from '../../whatsapp';
144
144
  *
145
145
  * Change businessHours for Appointment Only
146
146
  * ```javascript
147
- * await WPP.profile.editBusinessProfile({ businessHours: { {
148
- mon: {
149
- mode: "appointment_only",
147
+ * await WPP.profile.editBusinessProfile({ {
148
+ "config": {
149
+ "mon": {
150
+ "mode": "specific_hours",
151
+ "hours": [
152
+ [
153
+ 480,
154
+ 1260
155
+ ]
156
+ ]
157
+ },
158
+ "tue": {
159
+ "mode": "specific_hours",
160
+ "hours": [
161
+ [
162
+ 480,
163
+ 1260
164
+ ]
165
+ ]
166
+ },
167
+ "wed": {
168
+ "mode": "specific_hours",
169
+ "hours": [
170
+ [
171
+ 480,
172
+ 1260
173
+ ]
174
+ ]
175
+ },
176
+ "thu": {
177
+ "mode": "specific_hours",
178
+ "hours": [
179
+ [
180
+ 480,
181
+ 1260
182
+ ]
183
+ ]
184
+ },
185
+ "fri": {
186
+ "mode": "specific_hours",
187
+ "hours": [
188
+ [
189
+ 480,
190
+ 1260
191
+ ]
192
+ ]
193
+ },
194
+ "sat": {
195
+ "mode": "specific_hours",
196
+ "hours": [
197
+ [
198
+ 660,
199
+ 1320
200
+ ]
201
+ ]
202
+ }
150
203
  },
151
- tue: {
152
- mode: "appointment_only",
153
- },
154
- wed: {
155
- mode: "appointment_only",
156
- },
157
- thu: {
158
- mode: "appointment_only",
159
- },
160
- fri: {
161
- mode: "appointment_only",
162
- },
163
- sat: {
164
- mode: "appointment_only",
165
- },
166
- sun: {
167
- mode: "appointment_only",
168
- },
169
- }
170
- timezone: "America/Sao_Paulo"
171
- });
204
+ "timezone": "America/Sao_Paulo"
205
+ });
172
206
  *
173
207
  *
174
208
  * ```
@@ -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;
@@ -18,4 +18,4 @@ export interface ProductVisibilitySetParams {
18
18
  productId: number;
19
19
  }
20
20
  /** @whatsapp 621374 >= 2.2228.14 */
21
- export declare function productVisibilitySet(params: ProductVisibilitySetParams[]): any;
21
+ export declare function productVisibilitySet(productId: string, isHidden: boolean): any;
@@ -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;
@@ -18,14 +18,15 @@ import { Wid } from './Wid';
18
18
  * @whatsapp 459857 >= 2.2310.5
19
19
  */
20
20
  export declare namespace UserPrefs {
21
+ function getMaybeMeDevicePn(...args: any[]): any;
21
22
  function assertGetMe(): Wid;
22
23
  function assertGetMeUser(): Wid;
23
- function clearGetMaybeMeUserCache(...args: any[]): any;
24
+ function clearGetMaybeMePnUserCache(...args: any[]): any;
24
25
  function getMaybeMeDisplayName(...args: any[]): any;
25
- function getMaybeMeLid(...args: any[]): any;
26
+ function getMaybeMeDeviceLid(...args: any[]): any;
26
27
  function getMaybeMeLidUser(...args: any[]): any;
28
+ function getMaybeMePnUser(): Wid;
27
29
  function getMaybeMeUser(): Wid;
28
- function getMe(...args: any[]): any;
29
30
  function getMePNandLIDWids(...args: any[]): any;
30
31
  function getMeUser(): Wid;
31
32
  function isMeAccount(...args: any[]): any;
@@ -36,4 +37,21 @@ export declare namespace UserPrefs {
36
37
  function setMe(...args: any[]): any;
37
38
  function setMeDisplayName(...args: any[]): any;
38
39
  function setMeLid(...args: any[]): any;
40
+ /**
41
+ * @deprecated
42
+ */
43
+ function clearGetMaybeMeUserCache(...args: any[]): any;
44
+ /**
45
+ * @deprecated
46
+ */
47
+ function getMeDevicePn(...args: any[]): any;
48
+ /**
49
+ * @deprecated
50
+ */
51
+ function getMaybeMeLid(...args: any[]): any;
52
+ /**
53
+ * @deprecated
54
+ * @whatsapp 498050 >= 2.3000.1026
55
+ **/
56
+ function getMe(...args: any[]): any;
39
57
  }
@@ -29,5 +29,8 @@ export declare namespace WidFactory {
29
29
  function isWidlike(wid: any): wid is Wid;
30
30
  function toChatWid(wid: Wid): Wid;
31
31
  function toUserWid(wid: Wid): Wid;
32
+ function toGroupWid(wid: Wid): Wid;
32
33
  function userJidToUserWid(wid: string): Wid;
34
+ function toUserLidOrThrow(wid: Wid): Wid;
35
+ function toUserWidOrThrow(wid: Wid): Wid;
33
36
  }