@wppconnect/wa-js 1.1.17 → 1.2.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.
Files changed (197) hide show
  1. package/CHANGELOG.md +17 -0
  2. package/dist/{auth → conn}/eventEmitter.d.ts +37 -3
  3. package/dist/conn/events/index.d.ts +22 -0
  4. package/dist/{auth/events/registerChangeEvent.d.ts → conn/events/registerAuthCodeChangeEvent.d.ts} +0 -0
  5. package/dist/{auth/events/registerIdleEvent.d.ts → conn/events/registerAuthenticatedEvent.d.ts} +0 -0
  6. package/dist/{auth → conn}/events/registerLogoutEvent.d.ts +0 -0
  7. package/dist/{auth/functions/poke.d.ts → conn/events/registerMainLoadedEvent.d.ts} +1 -1
  8. package/dist/conn/events/registerMainReadyEvent.d.ts +16 -0
  9. package/dist/conn/events/registerQRCodeIdleEvent.d.ts +16 -0
  10. package/dist/conn/events/registerRequireAuthEvent.d.ts +16 -0
  11. package/dist/{auth → conn}/functions/getAuthCode.d.ts +0 -0
  12. package/dist/{auth → conn}/functions/index.d.ts +2 -1
  13. package/dist/{auth → conn}/functions/isAuthenticated.d.ts +0 -0
  14. package/dist/{auth → conn}/functions/isIdle.d.ts +0 -0
  15. package/dist/conn/functions/isMainLoaded.d.ts +24 -0
  16. package/dist/{auth → conn}/functions/isMultiDevice.d.ts +0 -0
  17. package/dist/{auth → conn}/functions/logout.d.ts +0 -0
  18. package/dist/conn/functions/refreshQR.d.ts +28 -0
  19. package/dist/{auth → conn}/functions/setMultiDevice.d.ts +1 -1
  20. package/dist/{auth → conn}/index.d.ts +0 -0
  21. package/dist/{auth → conn}/types.d.ts +0 -0
  22. package/dist/group/functions/canAdd.d.ts +1 -1
  23. package/dist/group/functions/canDemote.d.ts +1 -1
  24. package/dist/group/functions/canPromote.d.ts +1 -1
  25. package/dist/group/functions/canRemove.d.ts +1 -1
  26. package/dist/group/functions/ensureGroup.d.ts +1 -1
  27. package/dist/group/functions/ensureGroupAndParticipants.d.ts +2 -2
  28. package/dist/group/functions/getParticipants.d.ts +1 -1
  29. package/dist/group/functions/iAmAdmin.d.ts +1 -1
  30. package/dist/group/functions/iAmMember.d.ts +1 -1
  31. package/dist/group/functions/iAmRestrictedMember.d.ts +1 -1
  32. package/dist/group/functions/iAmSuperAdmin.d.ts +1 -1
  33. package/dist/index.d.ts +1 -1
  34. package/dist/whatsapp/collections/BaseCollection.d.ts +1 -1
  35. package/dist/whatsapp/collections/BlocklistCollection.d.ts +1 -1
  36. package/dist/whatsapp/collections/BusinessCategoriesResultCollection.d.ts +1 -1
  37. package/dist/whatsapp/collections/BusinessProfileCollection.d.ts +1 -1
  38. package/dist/whatsapp/collections/ButtonCollection.d.ts +1 -1
  39. package/dist/whatsapp/collections/CallCollection.d.ts +1 -1
  40. package/dist/whatsapp/collections/CartCollection.d.ts +1 -1
  41. package/dist/whatsapp/collections/CartItemCollection.d.ts +1 -1
  42. package/dist/whatsapp/collections/CatalogCollection.d.ts +1 -1
  43. package/dist/whatsapp/collections/ChatCollection.d.ts +1 -1
  44. package/dist/whatsapp/collections/ChatstateCollection.d.ts +1 -1
  45. package/dist/whatsapp/collections/Collection.d.ts +2 -2
  46. package/dist/whatsapp/collections/ContactCollection.d.ts +1 -1
  47. package/dist/whatsapp/collections/EmojiVariantCollection.d.ts +1 -1
  48. package/dist/whatsapp/collections/GroupMetadataCollection.d.ts +1 -1
  49. package/dist/whatsapp/collections/LabelCollection.d.ts +1 -1
  50. package/dist/whatsapp/collections/LabelItemCollection.d.ts +1 -1
  51. package/dist/whatsapp/collections/LiveLocationCollection.d.ts +1 -1
  52. package/dist/whatsapp/collections/MsgCollection.d.ts +1 -1
  53. package/dist/whatsapp/collections/MsgInfoCollection.d.ts +1 -1
  54. package/dist/whatsapp/collections/MuteCollection.d.ts +1 -1
  55. package/dist/whatsapp/collections/OrderCollection.d.ts +1 -1
  56. package/dist/whatsapp/collections/OrderItemCollection.d.ts +1 -1
  57. package/dist/whatsapp/collections/ParticipantCollection.d.ts +1 -1
  58. package/dist/whatsapp/collections/PresenceCollection.d.ts +1 -1
  59. package/dist/whatsapp/collections/ProductCollCollection.d.ts +1 -1
  60. package/dist/whatsapp/collections/ProductCollection.d.ts +1 -1
  61. package/dist/whatsapp/collections/ProductImageCollection.d.ts +1 -1
  62. package/dist/whatsapp/collections/ProductMessageListCollection.d.ts +1 -1
  63. package/dist/whatsapp/collections/ProfilePicThumbCollection.d.ts +1 -1
  64. package/dist/whatsapp/collections/QuickReplyCollection.d.ts +1 -1
  65. package/dist/whatsapp/collections/RecentEmojiCollection.d.ts +1 -1
  66. package/dist/whatsapp/collections/RecentStickerCollection.d.ts +1 -1
  67. package/dist/whatsapp/collections/StarredMsgCollection.d.ts +1 -1
  68. package/dist/whatsapp/collections/StarredStickerCollection.d.ts +1 -1
  69. package/dist/whatsapp/collections/StatusCollection.d.ts +1 -1
  70. package/dist/whatsapp/collections/StatusV3Collection.d.ts +1 -1
  71. package/dist/whatsapp/collections/StickerCollection.d.ts +1 -1
  72. package/dist/whatsapp/collections/StickerPackCollection.d.ts +1 -1
  73. package/dist/whatsapp/collections/StickerSearchCollection.d.ts +1 -1
  74. package/dist/whatsapp/collections/TemplateButtonCollection.d.ts +1 -1
  75. package/dist/whatsapp/enums/ACK.d.ts +46 -0
  76. package/dist/whatsapp/enums/GROUP_SETTING_TYPE.d.ts +1 -1
  77. package/dist/whatsapp/enums/LogoutReason.d.ts +1 -1
  78. package/dist/whatsapp/enums/MSG_TYPE.d.ts +54 -0
  79. package/dist/whatsapp/enums/OUTWARD_TYPES.d.ts +1 -1
  80. package/dist/whatsapp/enums/SOCKET_STATE.d.ts +42 -0
  81. package/dist/whatsapp/enums/SendMsgResult.d.ts +1 -1
  82. package/dist/whatsapp/enums/index.d.ts +2 -0
  83. package/dist/whatsapp/functions/addAndSendMsgToChat.d.ts +1 -1
  84. package/dist/whatsapp/functions/blockContact.d.ts +2 -2
  85. package/dist/whatsapp/functions/createMsgProtobuf.d.ts +1 -1
  86. package/dist/whatsapp/functions/fetchLinkPreview.d.ts +1 -1
  87. package/dist/whatsapp/functions/findChat.d.ts +1 -1
  88. package/dist/whatsapp/functions/findFirstWebLink.d.ts +1 -1
  89. package/dist/whatsapp/functions/getOrGenerate.d.ts +1 -1
  90. package/dist/whatsapp/functions/groupParticipants.d.ts +4 -4
  91. package/dist/whatsapp/functions/handleAck.d.ts +3 -3
  92. package/dist/whatsapp/functions/isAuthenticated.d.ts +1 -1
  93. package/dist/whatsapp/functions/markSeen.d.ts +3 -3
  94. package/dist/whatsapp/functions/msgFindQuery.d.ts +1 -1
  95. package/dist/whatsapp/functions/products.d.ts +4 -4
  96. package/dist/whatsapp/functions/profilePic.d.ts +1 -1
  97. package/dist/whatsapp/functions/randomId.d.ts +2 -2
  98. package/dist/whatsapp/functions/sendCallSignalingMsg.d.ts +1 -1
  99. package/dist/whatsapp/functions/sendClear.d.ts +1 -1
  100. package/dist/whatsapp/functions/sendCreateGroup.d.ts +1 -1
  101. package/dist/whatsapp/functions/sendDelete.d.ts +1 -1
  102. package/dist/whatsapp/functions/sendExitGroup.d.ts +1 -1
  103. package/dist/whatsapp/functions/sendJoinGroupViaInvite.d.ts +1 -1
  104. package/dist/whatsapp/functions/sendQueryExists.d.ts +1 -1
  105. package/dist/whatsapp/functions/sendQueryGroupInvite.d.ts +1 -1
  106. package/dist/whatsapp/functions/sendRevokeGroupInviteCode.d.ts +1 -1
  107. package/dist/whatsapp/functions/sendTextMsgToChat.d.ts +1 -1
  108. package/dist/whatsapp/functions/setGroup.d.ts +3 -3
  109. package/dist/whatsapp/functions/status.d.ts +2 -2
  110. package/dist/whatsapp/functions/uploadProductImage.d.ts +1 -1
  111. package/dist/whatsapp/misc/Base64.d.ts +1 -1
  112. package/dist/whatsapp/misc/Browser.d.ts +1 -1
  113. package/dist/whatsapp/misc/ChatPresence.d.ts +1 -1
  114. package/dist/whatsapp/misc/Clock.d.ts +2 -2
  115. package/dist/whatsapp/misc/Cmd.d.ts +2 -2
  116. package/dist/whatsapp/misc/Conn.d.ts +1 -1
  117. package/dist/whatsapp/misc/Constants.d.ts +83 -430
  118. package/dist/whatsapp/misc/EventEmitter.d.ts +1 -1
  119. package/dist/whatsapp/misc/Features.d.ts +1 -1
  120. package/dist/whatsapp/misc/ImageUtils.d.ts +1 -1
  121. package/dist/whatsapp/misc/Locale.d.ts +1 -1
  122. package/dist/whatsapp/misc/MediaBlobCache.d.ts +2 -2
  123. package/dist/whatsapp/misc/MediaObject.d.ts +1 -1
  124. package/dist/whatsapp/misc/MediaObjectUtil.d.ts +1 -1
  125. package/dist/whatsapp/misc/MediaPrep.d.ts +1 -1
  126. package/dist/whatsapp/misc/MediaUtils.d.ts +1 -1
  127. package/dist/whatsapp/misc/MsgKey.d.ts +1 -1
  128. package/dist/whatsapp/misc/MsgLoadState.d.ts +2 -2
  129. package/dist/whatsapp/misc/OpaqueData.d.ts +2 -2
  130. package/dist/whatsapp/misc/Socket.d.ts +18 -0
  131. package/dist/{auth/events/index.d.ts → whatsapp/misc/Stream.d.ts} +3 -3
  132. package/dist/whatsapp/misc/UserPrefs.d.ts +1 -1
  133. package/dist/whatsapp/misc/VCard.d.ts +1 -1
  134. package/dist/whatsapp/misc/Wap.d.ts +2 -2
  135. package/dist/whatsapp/misc/Wid.d.ts +1 -1
  136. package/dist/whatsapp/misc/WidFactory.d.ts +1 -1
  137. package/dist/whatsapp/misc/index.d.ts +2 -1
  138. package/dist/whatsapp/models/AttachMediaModel.d.ts +2 -2
  139. package/dist/whatsapp/models/BlocklistModel.d.ts +2 -2
  140. package/dist/whatsapp/models/BusinessCategoriesResultModel.d.ts +2 -2
  141. package/dist/whatsapp/models/BusinessProfileModel.d.ts +2 -2
  142. package/dist/whatsapp/models/CallModel.d.ts +2 -2
  143. package/dist/whatsapp/models/CallParticipantModel.d.ts +2 -2
  144. package/dist/whatsapp/models/CartItemModel.d.ts +2 -2
  145. package/dist/whatsapp/models/CartModel.d.ts +2 -2
  146. package/dist/whatsapp/models/CatalogModel.d.ts +2 -2
  147. package/dist/whatsapp/models/ChatModel.d.ts +2 -2
  148. package/dist/whatsapp/models/ChatPreferenceModel.d.ts +2 -2
  149. package/dist/whatsapp/models/ChatstateModel.d.ts +2 -2
  150. package/dist/whatsapp/models/ConnModel.d.ts +2 -2
  151. package/dist/whatsapp/models/ContactModel.d.ts +2 -2
  152. package/dist/whatsapp/models/ConversionTupleModel.d.ts +2 -2
  153. package/dist/whatsapp/models/EmojiVariantModel.d.ts +2 -2
  154. package/dist/whatsapp/models/GroupMetadataModel.d.ts +2 -2
  155. package/dist/whatsapp/models/LabelItemModel.d.ts +2 -2
  156. package/dist/whatsapp/models/LabelModel.d.ts +2 -2
  157. package/dist/whatsapp/models/LiveLocationModel.d.ts +2 -2
  158. package/dist/whatsapp/models/LiveLocationParticipantModel.d.ts +2 -2
  159. package/dist/whatsapp/models/MediaDataModel.d.ts +2 -2
  160. package/dist/whatsapp/models/Model.d.ts +1 -1
  161. package/dist/whatsapp/models/ModelChatBase.d.ts +1 -1
  162. package/dist/whatsapp/models/MsgButtonReplyMsgModel.d.ts +2 -2
  163. package/dist/whatsapp/models/MsgInfoModel.d.ts +2 -2
  164. package/dist/whatsapp/models/MsgModel.d.ts +2 -2
  165. package/dist/whatsapp/models/MuteModel.d.ts +2 -2
  166. package/dist/whatsapp/models/OrderItemModel.d.ts +2 -2
  167. package/dist/whatsapp/models/OrderModel.d.ts +2 -2
  168. package/dist/whatsapp/models/ParticipantModel.d.ts +2 -2
  169. package/dist/whatsapp/models/ProductCollModel.d.ts +2 -2
  170. package/dist/whatsapp/models/ProductImageModel.d.ts +2 -2
  171. package/dist/whatsapp/models/ProductMessageListModel.d.ts +2 -2
  172. package/dist/whatsapp/models/ProductModel.d.ts +2 -2
  173. package/dist/whatsapp/models/ProfilePicThumbModel.d.ts +2 -2
  174. package/dist/whatsapp/models/QuickReplyModel.d.ts +2 -2
  175. package/dist/whatsapp/models/RecentEmojiModel.d.ts +2 -2
  176. package/dist/whatsapp/models/RecentStickerModel.d.ts +2 -2
  177. package/dist/whatsapp/models/ReplyButtonModel.d.ts +2 -2
  178. package/dist/whatsapp/models/{StateModel.d.ts → SocketModel.d.ts} +5 -5
  179. package/dist/whatsapp/models/StatusModel.d.ts +2 -2
  180. package/dist/whatsapp/models/StatusV3Model.d.ts +2 -2
  181. package/dist/whatsapp/models/StickerModel.d.ts +2 -2
  182. package/dist/whatsapp/models/StickerPackModel.d.ts +2 -2
  183. package/dist/whatsapp/models/StreamModel.d.ts +61 -0
  184. package/dist/whatsapp/models/TemplateButtonModel.d.ts +2 -2
  185. package/dist/whatsapp/models/UnreadMentionModel.d.ts +2 -2
  186. package/dist/whatsapp/models/WebCallModel.d.ts +2 -2
  187. package/dist/whatsapp/models/index.d.ts +2 -1
  188. package/dist/whatsapp/multidevice/adv.d.ts +1 -1
  189. package/dist/whatsapp/multidevice/waNoiseInfo.d.ts +1 -1
  190. package/dist/whatsapp/multidevice/waSignalStore.d.ts +1 -1
  191. package/dist/whatsapp/stores.d.ts +29 -29
  192. package/dist/wppconnect-wa.js +1 -1
  193. package/package.json +20 -25
  194. package/tests/check-auth.ts +2 -2
  195. package/tests/prepare.ts +3 -3
  196. package/dist/internal.d.ts +0 -21
  197. package/dist/whatsapp/misc/State.d.ts +0 -18
package/CHANGELOG.md CHANGED
@@ -1,3 +1,20 @@
1
+ # 1.2.0 (2022-03-03)
2
+
3
+
4
+
5
+ ## 1.1.19 (2022-02-25)
6
+
7
+
8
+
9
+ ## 1.1.18 (2022-02-17)
10
+
11
+
12
+ ### Bug Fixes
13
+
14
+ * Fixed group functions when there are a lot of chats (fix wppconnect-team/wppconnect[#871](https://github.com/wppconnect-team/wa-js/issues/871)) ([1ff6a50](https://github.com/wppconnect-team/wa-js/commit/1ff6a5053cdd6ccc2ddc5df09dc3e73497987ad5))
15
+
16
+
17
+
1
18
  ## 1.1.17 (2022-02-12)
2
19
 
3
20
 
@@ -17,11 +17,45 @@ import Emittery from 'emittery';
17
17
  import { AuthCode } from '.';
18
18
  export declare type UnsubscribeFn = () => void;
19
19
  export interface EventTypes {
20
- change: AuthCode;
21
- idle: undefined;
20
+ auth_code_change: AuthCode | null;
21
+ /**
22
+ * Triggered afted a success QR code scan
23
+ *
24
+ * @example
25
+ * ```javascript
26
+ * WPP.conn.on('authenticated', () => {
27
+ * // Your code
28
+ * });
29
+ * ```
30
+ */
31
+ authenticated: undefined;
22
32
  logout: undefined;
33
+ /**
34
+ * Triggered when the main interface is loaded, but is syncing
35
+ *
36
+ * @example
37
+ * ```javascript
38
+ * WPP.conn.on('main_loaded', () => {
39
+ * // Your code
40
+ * });
41
+ * ```
42
+ */
43
+ main_loaded: undefined;
44
+ /**
45
+ * Triggered when the main interface is loaded, authenticated and ready to send message
46
+ *
47
+ * @example
48
+ * ```javascript
49
+ * WPP.conn.on('main_ready', () => {
50
+ * // Your code
51
+ * });
52
+ * ```
53
+ */
54
+ main_ready: undefined;
55
+ qrcode_idle: undefined;
56
+ require_auth: undefined;
23
57
  }
24
- export declare const eventEmitter: Emittery<EventTypes, EventTypes, "idle" | "logout">;
58
+ export declare const eventEmitter: Emittery<EventTypes, EventTypes, "authenticated" | "logout" | "main_loaded" | "main_ready" | "qrcode_idle" | "require_auth">;
25
59
  /**
26
60
  * Subscribe to one event.
27
61
  * @event
@@ -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
+ import './registerAuthCodeChangeEvent';
17
+ import './registerAuthenticatedEvent';
18
+ import './registerLogoutEvent';
19
+ import './registerMainLoadedEvent';
20
+ import './registerMainReadyEvent';
21
+ import './registerQRCodeIdleEvent';
22
+ import './registerRequireAuthEvent';
@@ -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 poke(): void;
16
+ export {};
@@ -0,0 +1,16 @@
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 {};
@@ -0,0 +1,16 @@
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 {};
@@ -0,0 +1,16 @@
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 {};
File without changes
@@ -16,7 +16,8 @@
16
16
  export { getAuthCode } from './getAuthCode';
17
17
  export { isAuthenticated } from './isAuthenticated';
18
18
  export { isIdle } from './isIdle';
19
+ export { isMainLoaded } from './isMainLoaded';
19
20
  export { isMultiDevice } from './isMultiDevice';
20
21
  export { logout } from './logout';
21
- export { poke } from './poke';
22
+ export { refreshQR } from './refreshQR';
22
23
  export { setMultiDevice } from './setMultiDevice';
File without changes
@@ -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
+ /**
17
+ * Check is main interface is loaded and authenticated
18
+ *
19
+ * @example
20
+ * ```javascript
21
+ * const isMainLoaded = WPP.conn.isMainLoaded();
22
+ * ```
23
+ */
24
+ export declare function isMainLoaded(): boolean;
File without changes
File without changes
@@ -0,0 +1,28 @@
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 { AuthCode } from '..';
17
+ /**
18
+ * Refresh the current QRCode when is waiting for scan and return the current code
19
+ *
20
+ * For legacy: It will wait for next code
21
+ * For multidevice: It will generate a new one
22
+ *
23
+ * @example
24
+ * ```javascript
25
+ * await WPP.conn.refreshQR();
26
+ * ```
27
+ */
28
+ export declare function refreshQR(): Promise<AuthCode | null>;
@@ -17,7 +17,7 @@
17
17
  * @param md If it's true, WhatsApp WEB will switch to MD. If it's false, WhatsApp WEB will switch to Legacy.
18
18
  * @example
19
19
  * ```javascript
20
- * WPP.auth.setMultiDevice(true)
20
+ * WPP.conn.setMultiDevice(true)
21
21
  * ```
22
22
  */
23
23
  export declare function setMultiDevice(md?: boolean): boolean;
File without changes
File without changes
@@ -14,4 +14,4 @@
14
14
  * limitations under the License.
15
15
  */
16
16
  import { Wid } from '../../whatsapp';
17
- export declare function canAdd(groupId: string | Wid): boolean;
17
+ export declare function canAdd(groupId: string | Wid): Promise<boolean>;
@@ -14,4 +14,4 @@
14
14
  * limitations under the License.
15
15
  */
16
16
  import { Wid } from '../../whatsapp';
17
- export declare function canDemote(groupId: string | Wid, participantsIds: (string | Wid) | (string | Wid)[]): boolean;
17
+ export declare function canDemote(groupId: string | Wid, participantsIds: (string | Wid) | (string | Wid)[]): Promise<boolean>;
@@ -14,4 +14,4 @@
14
14
  * limitations under the License.
15
15
  */
16
16
  import { Wid } from '../../whatsapp';
17
- export declare function canPromote(groupId: string | Wid, participantsIds: (string | Wid) | (string | Wid)[]): boolean;
17
+ export declare function canPromote(groupId: string | Wid, participantsIds: (string | Wid) | (string | Wid)[]): Promise<boolean>;
@@ -14,4 +14,4 @@
14
14
  * limitations under the License.
15
15
  */
16
16
  import { Wid } from '../../whatsapp';
17
- export declare function canRemove(groupId: string | Wid, participantsIds: (string | Wid) | (string | Wid)[]): boolean;
17
+ export declare function canRemove(groupId: string | Wid, participantsIds: (string | Wid) | (string | Wid)[]): Promise<boolean>;
@@ -14,4 +14,4 @@
14
14
  * limitations under the License.
15
15
  */
16
16
  import { Wid } from '../../whatsapp';
17
- export declare function ensureGroup(groupId: string | Wid, checkIsAdmin?: boolean): import("../../whatsapp").ChatModel;
17
+ export declare function ensureGroup(groupId: string | Wid, checkIsAdmin?: boolean): Promise<import("../../whatsapp").ChatModel>;
@@ -14,7 +14,7 @@
14
14
  * limitations under the License.
15
15
  */
16
16
  import { ParticipantModel, Wid } from '../../whatsapp';
17
- export declare function ensureGroupAndParticipants(groupId: string | Wid, participantsIds: (string | Wid) | (string | Wid)[], createIfNotExists?: boolean): {
17
+ export declare function ensureGroupAndParticipants(groupId: string | Wid, participantsIds: (string | Wid) | (string | Wid)[], createIfNotExists?: boolean): Promise<{
18
18
  groupChat: import("../../whatsapp").ChatModel;
19
19
  participants: ParticipantModel[];
20
- };
20
+ }>;
@@ -22,4 +22,4 @@ import { Wid } from '../../whatsapp';
22
22
  * WPP.group.getParticipants('<group-id>@g.us');
23
23
  * ```
24
24
  */
25
- export declare function getParticipants(groupId: string | Wid): import("../../whatsapp").ParticipantModel[];
25
+ export declare function getParticipants(groupId: string | Wid): Promise<import("../../whatsapp").ParticipantModel[]>;
@@ -14,4 +14,4 @@
14
14
  * limitations under the License.
15
15
  */
16
16
  import { Wid } from '../../whatsapp';
17
- export declare function iAmAdmin(groupId: string | Wid): boolean;
17
+ export declare function iAmAdmin(groupId: string | Wid): Promise<boolean>;
@@ -14,4 +14,4 @@
14
14
  * limitations under the License.
15
15
  */
16
16
  import { Wid } from '../../whatsapp';
17
- export declare function iAmMember(groupId: string | Wid): boolean;
17
+ export declare function iAmMember(groupId: string | Wid): Promise<boolean>;
@@ -14,4 +14,4 @@
14
14
  * limitations under the License.
15
15
  */
16
16
  import { Wid } from '../../whatsapp';
17
- export declare function iAmRestrictedMember(groupId: string | Wid): boolean;
17
+ export declare function iAmRestrictedMember(groupId: string | Wid): Promise<boolean>;
@@ -14,4 +14,4 @@
14
14
  * limitations under the License.
15
15
  */
16
16
  import { Wid } from '../../whatsapp';
17
- export declare function iAmSuperAdmin(groupId: string | Wid): boolean;
17
+ export declare function iAmSuperAdmin(groupId: string | Wid): Promise<boolean>;
package/dist/index.d.ts CHANGED
@@ -20,9 +20,9 @@ import * as webpack from './webpack';
20
20
  export { webpack };
21
21
  export { isInjected, isReady } from './webpack';
22
22
  export * as config from './config';
23
- export * as auth from './auth';
24
23
  export * as blocklist from './blocklist';
25
24
  export * as chat from './chat';
25
+ export * as conn from './conn';
26
26
  export * as contact from './contact';
27
27
  export * as group from './group';
28
28
  export * as labels from './labels';
@@ -15,7 +15,7 @@
15
15
  */
16
16
  import { Stringable } from '../../types';
17
17
  import { Collection } from './Collection';
18
- /** @whatsapp 30765 */
18
+ /** @whatsapp 1255 */
19
19
  export declare class BaseCollection<C, A = C | C[]> extends Collection<C> {
20
20
  static cachePolicy: {
21
21
  id: string;
@@ -15,7 +15,7 @@
15
15
  */
16
16
  import { BlocklistModel } from '../models';
17
17
  import { Collection } from './Collection';
18
- /** @whatsapp 48192 */
18
+ /** @whatsapp 32826 */
19
19
  export declare class BlocklistCollection extends Collection<BlocklistModel> {
20
20
  static model: BlocklistModel;
21
21
  blockContact(e?: any): any;
@@ -15,7 +15,7 @@
15
15
  */
16
16
  import { BusinessCategoriesResultModel } from '../models';
17
17
  import { Collection } from './Collection';
18
- /** @whatsapp 23420 */
18
+ /** @whatsapp 3754 */
19
19
  export declare class BusinessCategoriesResultCollection extends Collection<BusinessCategoriesResultModel> {
20
20
  static model: BusinessCategoriesResultModel;
21
21
  static staleCollection?: any;
@@ -15,7 +15,7 @@
15
15
  */
16
16
  import { BusinessProfileModel } from '../models';
17
17
  import { Collection } from './Collection';
18
- /** @whatsapp 45209 */
18
+ /** @whatsapp 93581 */
19
19
  export declare class BusinessProfileCollection extends Collection<BusinessProfileModel> {
20
20
  static model: BusinessProfileModel;
21
21
  static staleCollection?: any;
@@ -15,7 +15,7 @@
15
15
  */
16
16
  import { ReplyButtonModel } from '../models';
17
17
  import { BaseCollection } from './BaseCollection';
18
- /** @whatsapp 6136 */
18
+ /** @whatsapp 47688 */
19
19
  export declare class ButtonCollection extends BaseCollection<ReplyButtonModel> {
20
20
  static model: ReplyButtonModel;
21
21
  static comparator(): any;
@@ -15,7 +15,7 @@
15
15
  */
16
16
  import { CallModel } from '../models';
17
17
  import { Collection } from './Collection';
18
- /** @whatsapp 78230 */
18
+ /** @whatsapp 31218 */
19
19
  export declare class CallCollection extends Collection<CallModel> {
20
20
  static model: CallModel;
21
21
  pendingOffers?: any;
@@ -15,7 +15,7 @@
15
15
  */
16
16
  import { CartModel } from '../models';
17
17
  import { Collection } from './Collection';
18
- /** @whatsapp 93987 */
18
+ /** @whatsapp 12392 */
19
19
  export declare class CartCollection extends Collection<CartModel> {
20
20
  static model: CartModel;
21
21
  static cachePolicy?: any;
@@ -15,7 +15,7 @@
15
15
  */
16
16
  import { CartItemModel } from '../models';
17
17
  import { Collection } from './Collection';
18
- /** @whatsapp 51317 */
18
+ /** @whatsapp 57037 */
19
19
  export declare class CartItemCollection extends Collection<CartItemModel> {
20
20
  static model: CartItemModel;
21
21
  }
@@ -15,7 +15,7 @@
15
15
  */
16
16
  import { CatalogModel } from '../models';
17
17
  import { Collection } from './Collection';
18
- /** @whatsapp 39985 */
18
+ /** @whatsapp 99989 */
19
19
  export declare class CatalogCollection extends Collection<CatalogModel> {
20
20
  static model: CatalogModel;
21
21
  static staleCollection?: any;
@@ -15,7 +15,7 @@
15
15
  */
16
16
  import { ChatModel } from '../models';
17
17
  import { BaseCollection } from './BaseCollection';
18
- /** @whatsapp 91129 */
18
+ /** @whatsapp 69951 */
19
19
  export declare class ChatCollection extends BaseCollection<ChatModel> {
20
20
  static model: ChatModel;
21
21
  static comparator(): any;
@@ -15,7 +15,7 @@
15
15
  */
16
16
  import { ChatstateModel } from '../models';
17
17
  import { Collection } from './Collection';
18
- /** @whatsapp 74378 */
18
+ /** @whatsapp 30000 */
19
19
  export declare class ChatstateCollection extends Collection<ChatstateModel> {
20
20
  static model: ChatstateModel;
21
21
  }
@@ -21,10 +21,10 @@ interface Option {
21
21
  merge: boolean;
22
22
  remove: boolean;
23
23
  }
24
- /** @whatsapp 93458 */
24
+ /** @whatsapp 31727 */
25
25
  export declare interface Collection<M> extends EventEmitter, Pick<Array<M>, 'indexOf' | 'lastIndexOf' | 'every' | 'some' | 'forEach' | 'map' | 'filter' | 'reduce' | 'slice'> {
26
26
  }
27
- /** @whatsapp 93458 */
27
+ /** @whatsapp 31727 */
28
28
  export declare class Collection<M, A = M | M[]> extends EventEmitter {
29
29
  static model: any;
30
30
  static comparator: (a: any, b: any) => number;
@@ -15,7 +15,7 @@
15
15
  */
16
16
  import { ContactModel } from '../models';
17
17
  import { Collection } from './Collection';
18
- /** @whatsapp 49798 */
18
+ /** @whatsapp 19380 */
19
19
  export declare class ContactCollection extends Collection<ContactModel> {
20
20
  static model: ContactModel;
21
21
  static cachePolicy?: any;
@@ -15,7 +15,7 @@
15
15
  */
16
16
  import { EmojiVariantModel } from '../models';
17
17
  import { Collection } from './Collection';
18
- /** @whatsapp 96539 */
18
+ /** @whatsapp 13185 */
19
19
  export declare class EmojiVariantCollection extends Collection<EmojiVariantModel> {
20
20
  static model: EmojiVariantModel;
21
21
  static cachePolicy?: any;
@@ -15,7 +15,7 @@
15
15
  */
16
16
  import { GroupMetadataModel } from '../models';
17
17
  import { BaseCollection } from '.';
18
- /** @whatsapp 20029 */
18
+ /** @whatsapp 63928 */
19
19
  export declare class GroupMetadataCollection extends BaseCollection<GroupMetadataModel> {
20
20
  static model: GroupMetadataModel;
21
21
  handlePendingInvite(): any;
@@ -15,7 +15,7 @@
15
15
  */
16
16
  import { ChatModel, LabelModel } from '../models';
17
17
  import { Collection } from './Collection';
18
- /** @whatsapp 79491 */
18
+ /** @whatsapp 16770 */
19
19
  export declare class LabelCollection extends Collection<LabelModel> {
20
20
  static model: LabelModel;
21
21
  static staleCollection?: any;
@@ -15,7 +15,7 @@
15
15
  */
16
16
  import { LabelItemModel } from '../models';
17
17
  import { Collection } from './Collection';
18
- /** @whatsapp 62004 */
18
+ /** @whatsapp 34741 */
19
19
  export declare class LabelItemCollection extends Collection<LabelItemModel> {
20
20
  static model: LabelItemModel;
21
21
  }
@@ -15,7 +15,7 @@
15
15
  */
16
16
  import { LiveLocationModel } from '../models';
17
17
  import { BaseCollection } from '.';
18
- /** @whatsapp 28920 */
18
+ /** @whatsapp 85865 */
19
19
  export declare class LiveLocationCollection extends BaseCollection<LiveLocationModel> {
20
20
  static model: LiveLocationModel;
21
21
  static staleCollection?: any;
@@ -16,7 +16,7 @@
16
16
  import { Wid } from '..';
17
17
  import { ModelPropertiesContructor, MsgModel } from '../models';
18
18
  import { BaseCollection } from './BaseCollection';
19
- /** @whatsapp 51610 */
19
+ /** @whatsapp 59871 */
20
20
  export declare class MsgCollection extends BaseCollection<MsgModel> {
21
21
  static model: MsgModel;
22
22
  lastReceivedReceipt?: any;
@@ -15,7 +15,7 @@
15
15
  */
16
16
  import { MsgInfoModel } from '../models';
17
17
  import { Collection } from './Collection';
18
- /** @whatsapp 65018 */
18
+ /** @whatsapp 17972 */
19
19
  export declare class MsgInfoCollection extends Collection<MsgInfoModel> {
20
20
  static model: MsgInfoModel;
21
21
  static staleCollection?: any;
@@ -15,7 +15,7 @@
15
15
  */
16
16
  import { MuteModel } from '../models';
17
17
  import { Collection } from './Collection';
18
- /** @whatsapp 23297 */
18
+ /** @whatsapp 72472 */
19
19
  export declare class MuteCollection extends Collection<MuteModel> {
20
20
  static model: MuteModel;
21
21
  static cachePolicy?: any;
@@ -15,7 +15,7 @@
15
15
  */
16
16
  import { OrderModel } from '../models';
17
17
  import { Collection } from './Collection';
18
- /** @whatsapp 10492 */
18
+ /** @whatsapp 84312 */
19
19
  export declare class OrderCollection extends Collection<OrderModel> {
20
20
  static model: OrderModel;
21
21
  static staleCollection?: any;
@@ -15,7 +15,7 @@
15
15
  */
16
16
  import { OrderItemModel } from '../models';
17
17
  import { Collection } from './Collection';
18
- /** @whatsapp 67180 */
18
+ /** @whatsapp 23412 */
19
19
  export declare class OrderItemCollection extends Collection<OrderItemModel> {
20
20
  static model: OrderItemModel;
21
21
  }
@@ -15,7 +15,7 @@
15
15
  */
16
16
  import { ParticipantModel } from '../models';
17
17
  import { Collection } from './Collection';
18
- /** @whatsapp 69125 */
18
+ /** @whatsapp 96091 */
19
19
  export declare class ParticipantCollection extends Collection<ParticipantModel> {
20
20
  static model: ParticipantModel;
21
21
  static comparator(): any;
@@ -15,7 +15,7 @@
15
15
  */
16
16
  import { ChatstateModel } from '../models';
17
17
  import { Collection } from './Collection';
18
- /** @whatsapp 67652 */
18
+ /** @whatsapp 68315 */
19
19
  export declare class PresenceCollection extends Collection<ChatstateModel> {
20
20
  static model: ChatstateModel;
21
21
  static staleCollection?: any;
@@ -15,7 +15,7 @@
15
15
  */
16
16
  import { ProductCollModel } from '../models';
17
17
  import { Collection } from './Collection';
18
- /** @whatsapp 49675 */
18
+ /** @whatsapp 12496 */
19
19
  export declare class ProductCollCollection extends Collection<ProductCollModel> {
20
20
  static model: ProductCollModel;
21
21
  static staleCollection?: any;
@@ -15,7 +15,7 @@
15
15
  */
16
16
  import { ProductModel } from '../models';
17
17
  import { Collection } from './Collection';
18
- /** @whatsapp 77470 */
18
+ /** @whatsapp 5641 */
19
19
  export declare class ProductCollection extends Collection<ProductModel> {
20
20
  static model: ProductModel;
21
21
  getProductModels(e?: boolean): any;