@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 +6 -1
- package/README.md +7 -0
- package/dist/conn/events/eventTypes.d.ts +2 -0
- package/dist/conn/events/index.d.ts +1 -0
- package/dist/conn/events/registerLogoutReasonEvent.d.ts +16 -0
- package/dist/whatsapp/enums/LogoutReason.d.ts +25 -8
- package/dist/whatsapp/functions/getErrorCodeFromLogoutReason.d.ts +20 -0
- package/dist/whatsapp/functions/index.d.ts +1 -0
- package/dist/wppconnect-wa.js +1 -1
- package/dist/wppconnect-wa.js.LICENSE.txt +1 -1
- package/package.json +8 -8
package/CHANGELOG.md
CHANGED
|
@@ -1,4 +1,9 @@
|
|
|
1
|
-
|
|
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
|
[](https://chat.whatsapp.com/LJaQu6ZyNvnBPNAVRbX00K)
|
|
20
20
|
[](https://www.youtube.com/c/wppconnect)
|
|
21
21
|
|
|
22
|
+
|
|
23
|
+
### Top Contributors (last 45 days) widget
|
|
24
|
+
---
|
|
25
|
+

|
|
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
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
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';
|