@wppconnect/wa-js 3.4.2 → 3.5.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,4 +1,9 @@
1
- ## 3.4.2 (2024-07-08)
1
+ # 3.5.0 (2024-07-12)
2
+
3
+
4
+ ### Features
5
+
6
+ * Added 'conn.logout_reason' event (close [#1899](https://github.com/wppconnect-team/wa-js/issues/1899)) ([2466c30](https://github.com/wppconnect-team/wa-js/commit/2466c30cad19eaa14c2119e476d44b2e2e61d265))
2
7
 
3
8
 
4
9
 
package/README.md CHANGED
@@ -19,6 +19,13 @@
19
19
  [![WhatsApp Group](https://img.shields.io/badge/WhatsApp-Group-25D366?logo=whatsapp)](https://chat.whatsapp.com/LJaQu6ZyNvnBPNAVRbX00K)
20
20
  [![YouTube](https://img.shields.io/youtube/channel/subscribers/UCD7J9LG08PmGQrF5IS7Yv9A?label=YouTube)](https://www.youtube.com/c/wppconnect)
21
21
 
22
+
23
+ ### Top Contributors (last 45 days) widget
24
+ ---
25
+ ![Top Contributors (Last 45 days) widget](https://embeddables.devactivity.com/orgs/wppconnect-team/508ecbcd-e55e-4e31-a647-6674f134b5bf.svg)
26
+ ---
27
+ <sup><sub>Check also our [Public Dashboard](https://app.devactivity.com/public/?organizationLogin=wppconnect-team) powered by [devActivity](https://devactivity.com/?ref=public_widget)</sub></sup>
28
+
22
29
  ## How does it work
23
30
 
24
31
  This project extract some functions of WhatsApp sources, that uses webpack.
@@ -13,6 +13,7 @@
13
13
  * See the License for the specific language governing permissions and
14
14
  * limitations under the License.
15
15
  */
16
+ import { LogoutReason } from '../../whatsapp/enums';
16
17
  import { AuthCode } from '../types';
17
18
  export interface ConnEventTypes {
18
19
  'conn.auth_code_change': AuthCode | null;
@@ -28,6 +29,7 @@ export interface ConnEventTypes {
28
29
  */
29
30
  'conn.authenticated': undefined;
30
31
  'conn.logout': undefined;
32
+ 'conn.logout_reason': LogoutReason;
31
33
  /**
32
34
  * Triggered when the interface is booting
33
35
  *
@@ -16,6 +16,7 @@
16
16
  import './registerAuthCodeChangeEvent';
17
17
  import './registerAuthenticatedEvent';
18
18
  import './registerLogoutEvent';
19
+ import './registerLogoutReasonEvent';
19
20
  import './registerMainInit';
20
21
  import './registerMainLoadedEvent';
21
22
  import './registerMainReadyEvent';
@@ -0,0 +1,16 @@
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
+ export {};
@@ -16,15 +16,32 @@
16
16
  /** @whatsapp 83578
17
17
  * @whatsapp 88950 >= 2.2218.4
18
18
  * @whatsapp 788950 >= 2.2222.8
19
+ * @whatsapp WAWebLogoutReasonConstants >= 2.3000.x
19
20
  */
20
21
  export declare enum LogoutReason {
21
- USER_INITIATED = "user_initiated",
22
- SYNCD_FAILURE = "syncd_failure",
23
- CRITICAL_SYNC_TIMEOUT = "critical_sync_timeout",
24
- UNKNOWN_COMPANION = "unknown_companion",
25
- CLIENT_VERSION_OUTDATED = "client_version_outdated",
26
- SYNCD_ERROR_DURING_BOOTSTRAP = "syncd_error_during_bootstrap",
27
- ACCOUNT_SYNC_ERROR = "account_sync_error",
28
- CLIENT_FATAL_ERROR = "client_fatal_error",
22
+ UserInitiated = "user_initiated",
23
+ SyncdFailure = "syncd_failure",
24
+ InvalidAdvStatus = "invalid_adv_status",
25
+ CriticalSyncTimeout = "critical_sync_timeout",
26
+ SyncdTimeout = "syncd_timeout",
27
+ HistorySyncTimeout = "history_sync_timeout",
28
+ AccountSyncTimeout = "account_sync_timeout",
29
+ MDOptOut = "md_opt_out",
30
+ UnknownCompanion = "unknown_companion",
31
+ ClientVersionOutdated = "client_version_outdated",
32
+ SyncdErrorDuringBootstrap = "syncd_error_during_bootstrap",
33
+ AccountSyncError = "account_sync_error",
34
+ ClientFatalError = "client_fatal_error",
35
+ StorageQuotaExceeded = "storage_quota_exceeded",
36
+ PrimaryIdentityKeyChange = "primary_identity_key_change",
37
+ MissingEncSalt = "missing_enc_salt",
38
+ MissingScreenLockSalt = "missing_screen_lock_salt",
39
+ AccountLocked = "account_locked",
29
40
  UNKNOWN = "unknown"
30
41
  }
42
+ export declare enum LOGOUT_REASON_CODE {
43
+ CLIENT_FATAL = "0",
44
+ SYNC_FAIL = "1",
45
+ INITIAL_HISTORY_SYNC_TIMEOUT = "2",
46
+ ACCOUNT_LOCKED = "3"
47
+ }
@@ -0,0 +1,20 @@
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 { LOGOUT_REASON_CODE, LogoutReason } from '../enums';
17
+ /**
18
+ * @whatsapp WAWebLogoutReason >= 2.3000.x
19
+ */
20
+ export declare function getErrorCodeFromLogoutReason(type: LogoutReason): LOGOUT_REASON_CODE | null;
@@ -55,6 +55,7 @@ export * from './getCommunityParticipants';
55
55
  export * from './getCountryShortcodeByPhone';
56
56
  export * from './getCurrentLid';
57
57
  export * from './getEphemeralFields';
58
+ export * from './getErrorCodeFromLogoutReason';
58
59
  export * from './getFanOutList';
59
60
  export * from './getGroupSenderKeyList';
60
61
  export * from './getGroupSizeLimit';