@wppconnect/wa-js 3.19.8 → 3.20.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/dist/conn/functions/getAutoDownloadSettings.d.ts +34 -0
- package/dist/conn/functions/getTheme.d.ts +39 -0
- package/dist/conn/functions/index.d.ts +4 -0
- package/dist/conn/functions/setAutoDownloadSettings.d.ts +56 -0
- package/dist/conn/functions/setTheme.d.ts +36 -0
- package/dist/whatsapp/misc/UserPrefsGeneral.d.ts +67 -0
- package/dist/whatsapp/misc/index.d.ts +1 -0
- package/dist/wppconnect-wa.js +1 -1
- package/dist/wppconnect-wa.js.LICENSE.txt +17 -1
- package/package.json +7 -7
package/CHANGELOG.md
CHANGED
|
@@ -1,4 +1,9 @@
|
|
|
1
|
-
|
|
1
|
+
# 3.20.0 (2026-01-21)
|
|
2
|
+
|
|
3
|
+
|
|
4
|
+
### Features
|
|
5
|
+
|
|
6
|
+
* Ability to manage whatsapp theme ([#3233](https://github.com/wppconnect-team/wa-js/issues/3233)) ([9530a49](https://github.com/wppconnect-team/wa-js/commit/9530a497db49704215668fa068b5a0c1fe06b9f8))
|
|
2
7
|
|
|
3
8
|
|
|
4
9
|
|
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
/*!
|
|
2
|
+
* Copyright 2026 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
|
+
* Get auto-download settings for media types
|
|
18
|
+
*
|
|
19
|
+
* @example
|
|
20
|
+
* ```javascript
|
|
21
|
+
* // Get current settings
|
|
22
|
+
* const settings = WPP.conn.getAutoDownloadSettings();
|
|
23
|
+
* console.log(settings);
|
|
24
|
+
* // { photos: true, audio: true, videos: false, documents: false }
|
|
25
|
+
* ```
|
|
26
|
+
*
|
|
27
|
+
* @category Config
|
|
28
|
+
*/
|
|
29
|
+
export declare function getAutoDownloadSettings(): {
|
|
30
|
+
photos: boolean;
|
|
31
|
+
audio: boolean;
|
|
32
|
+
videos: boolean;
|
|
33
|
+
documents: boolean;
|
|
34
|
+
};
|
|
@@ -0,0 +1,39 @@
|
|
|
1
|
+
/*!
|
|
2
|
+
* Copyright 2026 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 declare enum Theme {
|
|
17
|
+
LIGHT = "light",
|
|
18
|
+
DARK = "dark",
|
|
19
|
+
SYSTEM = "system"
|
|
20
|
+
}
|
|
21
|
+
/**
|
|
22
|
+
* Get current theme setting
|
|
23
|
+
*
|
|
24
|
+
* @example
|
|
25
|
+
* ```javascript
|
|
26
|
+
* // Get current theme
|
|
27
|
+
* const theme = WPP.conn.getTheme();
|
|
28
|
+
* console.log(theme); // "light", "dark", or "system"
|
|
29
|
+
*
|
|
30
|
+
* // Using enum
|
|
31
|
+
* import { Theme } from '@wppconnect/wa-js';
|
|
32
|
+
* if (theme === Theme.DARK) {
|
|
33
|
+
* console.log('Dark mode is enabled');
|
|
34
|
+
* }
|
|
35
|
+
* ```
|
|
36
|
+
*
|
|
37
|
+
* @category Config
|
|
38
|
+
*/
|
|
39
|
+
export declare function getTheme(): Theme;
|
|
@@ -17,12 +17,14 @@ export { changeEnviromentDevice } from './changeEnviromentDevice';
|
|
|
17
17
|
export { genLinkDeviceCodeForPhoneNumber } from './genLinkDeviceCodeForPhoneNumber';
|
|
18
18
|
export { ABPropConfig, getABPropName, getABProps, getABPropsMap, } from './getABProps';
|
|
19
19
|
export { getAuthCode } from './getAuthCode';
|
|
20
|
+
export { getAutoDownloadSettings } from './getAutoDownloadSettings';
|
|
20
21
|
export { BuildConstants, getBuildConstants, isWhatsAppVersionGTE, } from './getBuildConstants';
|
|
21
22
|
export { getHistorySyncProgress, HistorySyncProgress, } from './getHistorySyncProgress';
|
|
22
23
|
export { getMigrationState, MigrationState } from './getMigrationState';
|
|
23
24
|
export { getMyDeviceId } from './getMyDeviceId';
|
|
24
25
|
export { getMyUserId } from './getMyUserId';
|
|
25
26
|
export { getPlatform } from './getPlatform';
|
|
27
|
+
export { getTheme, Theme } from './getTheme';
|
|
26
28
|
export { isAuthenticated } from './isAuthenticated';
|
|
27
29
|
export { isIdle } from './isIdle';
|
|
28
30
|
export { isMainInit } from './isMainInit';
|
|
@@ -36,6 +38,8 @@ export { logout } from './logout';
|
|
|
36
38
|
export { markAvailable, markUnavailable } from './markAvailable';
|
|
37
39
|
export { needsUpdate } from './needsUpdate';
|
|
38
40
|
export { refreshQR } from './refreshQR';
|
|
41
|
+
export { AutoDownloadSettings, setAutoDownloadSettings, } from './setAutoDownloadSettings';
|
|
39
42
|
export { setKeepAlive } from './setKeepAlive';
|
|
40
43
|
export { setLimit } from './setLimit';
|
|
41
44
|
export { setMultiDevice } from './setMultiDevice';
|
|
45
|
+
export { setTheme } from './setTheme';
|
|
@@ -0,0 +1,56 @@
|
|
|
1
|
+
/*!
|
|
2
|
+
* Copyright 2026 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 interface AutoDownloadSettings {
|
|
17
|
+
/**
|
|
18
|
+
* Enable/disable auto-download for photos
|
|
19
|
+
*/
|
|
20
|
+
photos?: boolean;
|
|
21
|
+
/**
|
|
22
|
+
* Enable/disable auto-download for audio
|
|
23
|
+
*/
|
|
24
|
+
audio?: boolean;
|
|
25
|
+
/**
|
|
26
|
+
* Enable/disable auto-download for videos
|
|
27
|
+
*/
|
|
28
|
+
videos?: boolean;
|
|
29
|
+
/**
|
|
30
|
+
* Enable/disable auto-download for documents
|
|
31
|
+
*/
|
|
32
|
+
documents?: boolean;
|
|
33
|
+
}
|
|
34
|
+
/**
|
|
35
|
+
* Set auto-download settings for media types
|
|
36
|
+
*
|
|
37
|
+
* @example
|
|
38
|
+
* ```javascript
|
|
39
|
+
* // Disable video and document auto-download
|
|
40
|
+
* await WPP.conn.setAutoDownloadSettings({
|
|
41
|
+
* videos: false,
|
|
42
|
+
* documents: false
|
|
43
|
+
* });
|
|
44
|
+
*
|
|
45
|
+
* // Enable only photos
|
|
46
|
+
* await WPP.conn.setAutoDownloadSettings({
|
|
47
|
+
* photos: true,
|
|
48
|
+
* audio: false,
|
|
49
|
+
* videos: false,
|
|
50
|
+
* documents: false
|
|
51
|
+
* });
|
|
52
|
+
* ```
|
|
53
|
+
*
|
|
54
|
+
* @category Config
|
|
55
|
+
*/
|
|
56
|
+
export declare function setAutoDownloadSettings(settings: AutoDownloadSettings): Promise<void>;
|
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
/*!
|
|
2
|
+
* Copyright 2026 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 { Theme } from './getTheme';
|
|
17
|
+
/**
|
|
18
|
+
* Set theme and reload the page to apply changes
|
|
19
|
+
*
|
|
20
|
+
* @example
|
|
21
|
+
* ```javascript
|
|
22
|
+
* // Using Enum
|
|
23
|
+
* import { Theme } from '@wppconnect/wa-js';
|
|
24
|
+
* await WPP.conn.setTheme(Theme.LIGHT);
|
|
25
|
+
* await WPP.conn.setTheme(Theme.DARK);
|
|
26
|
+
* await WPP.conn.setTheme(Theme.SYSTEM);
|
|
27
|
+
*
|
|
28
|
+
* // Using string ("light", "dark", "system")
|
|
29
|
+
* await WPP.conn.setTheme("light");
|
|
30
|
+
* await WPP.conn.setTheme("dark");
|
|
31
|
+
* await WPP.conn.setTheme("system");
|
|
32
|
+
* ```
|
|
33
|
+
*
|
|
34
|
+
* @category Config
|
|
35
|
+
*/
|
|
36
|
+
export declare function setTheme(theme: Theme): Promise<void>;
|
|
@@ -0,0 +1,67 @@
|
|
|
1
|
+
/*!
|
|
2
|
+
* Copyright 2026 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
|
+
* Get auto-download setting for photos
|
|
18
|
+
* @whatsapp WAWebUserPrefsGeneral >= 2.3000.0
|
|
19
|
+
*/
|
|
20
|
+
export declare function getAutoDownloadPhotos(): boolean;
|
|
21
|
+
/**
|
|
22
|
+
* Set auto-download setting for photos
|
|
23
|
+
* @whatsapp WAWebUserPrefsGeneral >= 2.3000.0
|
|
24
|
+
*/
|
|
25
|
+
export declare function setAutoDownloadPhotos(value: boolean): void;
|
|
26
|
+
/**
|
|
27
|
+
* Get auto-download setting for audio
|
|
28
|
+
* @whatsapp WAWebUserPrefsGeneral >= 2.3000.0
|
|
29
|
+
*/
|
|
30
|
+
export declare function getAutoDownloadAudio(): boolean;
|
|
31
|
+
/**
|
|
32
|
+
* Set auto-download setting for audio
|
|
33
|
+
* @whatsapp WAWebUserPrefsGeneral >= 2.3000.1032022795
|
|
34
|
+
*/
|
|
35
|
+
export declare function setAutoDownloadAudio(value: boolean): void;
|
|
36
|
+
/**
|
|
37
|
+
* Get auto-download setting for videos
|
|
38
|
+
* @whatsapp WAWebUserPrefsGeneral >= 2.3000.1032022795
|
|
39
|
+
*/
|
|
40
|
+
export declare function getAutoDownloadVideos(): boolean;
|
|
41
|
+
/**
|
|
42
|
+
* Set auto-download setting for videos
|
|
43
|
+
* @whatsapp WAWebUserPrefsGeneral >= 2.3000.1032022795
|
|
44
|
+
*/
|
|
45
|
+
export declare function setAutoDownloadVideos(value: boolean): void;
|
|
46
|
+
/**
|
|
47
|
+
* Get auto-download setting for documents
|
|
48
|
+
* @whatsapp WAWebUserPrefsGeneral >= 2.3000.1032022795
|
|
49
|
+
*/
|
|
50
|
+
export declare function getAutoDownloadDocuments(): boolean;
|
|
51
|
+
/**
|
|
52
|
+
* Set auto-download setting for documents
|
|
53
|
+
* @whatsapp WAWebUserPrefsGeneral >= 2.3000.1032022795
|
|
54
|
+
*/
|
|
55
|
+
export declare function setAutoDownloadDocuments(value: boolean): void;
|
|
56
|
+
/**
|
|
57
|
+
* Get theme setting
|
|
58
|
+
* @whatsapp WAWebUserPrefsGeneral >= 2.3000.1032022795
|
|
59
|
+
* @returns Theme value: "light" or "dark"
|
|
60
|
+
*/
|
|
61
|
+
export declare function getTheme(): string;
|
|
62
|
+
/**
|
|
63
|
+
* Set theme setting
|
|
64
|
+
* @whatsapp WAWebUserPrefsGeneral >= 2.3000.1032022795
|
|
65
|
+
* @param value Theme value: "light" or "dark"
|
|
66
|
+
*/
|
|
67
|
+
export declare function setTheme(value: string): void;
|