@wppconnect-team/wppconnect 1.37.11 → 1.38.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 +4 -0
- package/dist/api/layers/profile.layer.d.ts +0 -6
- package/dist/api/layers/profile.layer.js +0 -8
- package/dist/api/layers/retriever.layer.d.ts +0 -6
- package/dist/api/layers/retriever.layer.js +0 -15
- package/dist/api/layers/ui.layer.d.ts +34 -0
- package/dist/api/layers/ui.layer.js +66 -0
- package/package.json +4 -4
package/CHANGELOG.md
CHANGED
|
@@ -1,3 +1,7 @@
|
|
|
1
|
+
## 1.38.0 (2026-01-21)
|
|
2
|
+
|
|
3
|
+
- feat(ui): add theme and auto download settings management methods (#2677) ([b2a63d3](https://github.com/wppconnect-team/wppconnect/commit/b2a63d3)), closes [#2677](https://github.com/wppconnect-team/wppconnect/issues/2677)
|
|
4
|
+
|
|
1
5
|
## <small>1.37.11 (2026-01-19)</small>
|
|
2
6
|
|
|
3
7
|
- chore(deps): update setup-node action to v6.2.0 and bump wa-version and puppeteer dependencies (#267 ([6da2727](https://github.com/wppconnect-team/wppconnect/commit/6da2727)), closes [#2670](https://github.com/wppconnect-team/wppconnect/issues/2670)
|
|
@@ -12,12 +12,6 @@ export declare class ProfileLayer extends StatusLayer {
|
|
|
12
12
|
* To remove the silence, just enter the contact parameter
|
|
13
13
|
*/
|
|
14
14
|
sendMute(id: string, time: number, type: string): Promise<object>;
|
|
15
|
-
/**
|
|
16
|
-
* Change the theme
|
|
17
|
-
* @category Host
|
|
18
|
-
* @param string types "dark" or "light"
|
|
19
|
-
*/
|
|
20
|
-
setTheme(type: string): Promise<boolean>;
|
|
21
15
|
/**
|
|
22
16
|
* Sets current user profile status
|
|
23
17
|
* @category Profile
|
|
@@ -100,14 +100,6 @@ var ProfileLayer = /** @class */ (function (_super) {
|
|
|
100
100
|
});
|
|
101
101
|
});
|
|
102
102
|
};
|
|
103
|
-
/**
|
|
104
|
-
* Change the theme
|
|
105
|
-
* @category Host
|
|
106
|
-
* @param string types "dark" or "light"
|
|
107
|
-
*/
|
|
108
|
-
ProfileLayer.prototype.setTheme = function (type) {
|
|
109
|
-
return (0, helpers_1.evaluateAndReturn)(this.page, function (type) { return WAPI.setTheme(type); }, type);
|
|
110
|
-
};
|
|
111
103
|
/**
|
|
112
104
|
* Sets current user profile status
|
|
113
105
|
* @category Profile
|
|
@@ -20,12 +20,6 @@ export declare class RetrieverLayer extends SenderLayer {
|
|
|
20
20
|
* @returns obj [token]
|
|
21
21
|
*/
|
|
22
22
|
getSessionTokenBrowser(removePath?: boolean): Promise<SessionToken>;
|
|
23
|
-
/**
|
|
24
|
-
* Receive the current theme
|
|
25
|
-
* @category Host
|
|
26
|
-
* @returns string light or dark
|
|
27
|
-
*/
|
|
28
|
-
getTheme(): Promise<string>;
|
|
29
23
|
/**
|
|
30
24
|
* Receive all blocked contacts
|
|
31
25
|
* @category Blocklist
|
|
@@ -145,21 +145,6 @@ var RetrieverLayer = /** @class */ (function (_super) {
|
|
|
145
145
|
});
|
|
146
146
|
});
|
|
147
147
|
};
|
|
148
|
-
/**
|
|
149
|
-
* Receive the current theme
|
|
150
|
-
* @category Host
|
|
151
|
-
* @returns string light or dark
|
|
152
|
-
*/
|
|
153
|
-
RetrieverLayer.prototype.getTheme = function () {
|
|
154
|
-
return __awaiter(this, void 0, void 0, function () {
|
|
155
|
-
return __generator(this, function (_a) {
|
|
156
|
-
switch (_a.label) {
|
|
157
|
-
case 0: return [4 /*yield*/, (0, helpers_1.evaluateAndReturn)(this.page, function () { return WAPI.getTheme(); })];
|
|
158
|
-
case 1: return [2 /*return*/, _a.sent()];
|
|
159
|
-
}
|
|
160
|
-
});
|
|
161
|
-
});
|
|
162
|
-
};
|
|
163
148
|
/**
|
|
164
149
|
* Receive all blocked contacts
|
|
165
150
|
* @category Blocklist
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import { AutoDownloadSettings, Theme } from '@wppconnect/wa-js/dist/conn';
|
|
1
2
|
import { Page } from 'puppeteer';
|
|
2
3
|
import { CreateConfig } from '../../config/create-config';
|
|
3
4
|
import { Wid } from '../model';
|
|
@@ -30,4 +31,37 @@ export declare class UILayer extends GroupLayer {
|
|
|
30
31
|
* @category UI
|
|
31
32
|
*/
|
|
32
33
|
getActiveChat(): Promise<import("@wppconnect/wa-js/dist/whatsapp").ChatModel>;
|
|
34
|
+
/**
|
|
35
|
+
* Get current theme
|
|
36
|
+
* @category UI
|
|
37
|
+
* @returns Current theme ('dark' or 'light')
|
|
38
|
+
*/
|
|
39
|
+
getTheme(): Promise<Theme>;
|
|
40
|
+
/**
|
|
41
|
+
* Set theme
|
|
42
|
+
* Note: This will force a reload of WhatsApp Web to take effect
|
|
43
|
+
* @category UI
|
|
44
|
+
* @param theme Theme to set ('dark' or 'light')
|
|
45
|
+
* @returns void
|
|
46
|
+
*/
|
|
47
|
+
setTheme(theme: Theme): Promise<void>;
|
|
48
|
+
/**
|
|
49
|
+
* Get auto download settings
|
|
50
|
+
* @category UI
|
|
51
|
+
* @returns Auto download settings
|
|
52
|
+
*/
|
|
53
|
+
getAutoDownloadSettings(): Promise<{
|
|
54
|
+
photos: boolean;
|
|
55
|
+
audio: boolean;
|
|
56
|
+
videos: boolean;
|
|
57
|
+
documents: boolean;
|
|
58
|
+
}>;
|
|
59
|
+
/**
|
|
60
|
+
* Set auto download settings
|
|
61
|
+
* Note: This will force a reload of WhatsApp Web to take effect
|
|
62
|
+
* @category UI
|
|
63
|
+
* @param settings Auto download settings to set
|
|
64
|
+
* @returns void
|
|
65
|
+
*/
|
|
66
|
+
setAutoDownloadSettings(settings: AutoDownloadSettings): Promise<void>;
|
|
33
67
|
}
|
|
@@ -124,6 +124,72 @@ var UILayer = /** @class */ (function (_super) {
|
|
|
124
124
|
UILayer.prototype.getActiveChat = function () {
|
|
125
125
|
return (0, helpers_1.evaluateAndReturn)(this.page, function () { return WPP.chat.getActiveChat(); });
|
|
126
126
|
};
|
|
127
|
+
/**
|
|
128
|
+
* Get current theme
|
|
129
|
+
* @category UI
|
|
130
|
+
* @returns Current theme ('dark' or 'light')
|
|
131
|
+
*/
|
|
132
|
+
UILayer.prototype.getTheme = function () {
|
|
133
|
+
return __awaiter(this, void 0, void 0, function () {
|
|
134
|
+
return __generator(this, function (_a) {
|
|
135
|
+
switch (_a.label) {
|
|
136
|
+
case 0: return [4 /*yield*/, (0, helpers_1.evaluateAndReturn)(this.page, function () { return WPP.conn.getTheme(); })];
|
|
137
|
+
case 1: return [2 /*return*/, _a.sent()];
|
|
138
|
+
}
|
|
139
|
+
});
|
|
140
|
+
});
|
|
141
|
+
};
|
|
142
|
+
/**
|
|
143
|
+
* Set theme
|
|
144
|
+
* Note: This will force a reload of WhatsApp Web to take effect
|
|
145
|
+
* @category UI
|
|
146
|
+
* @param theme Theme to set ('dark' or 'light')
|
|
147
|
+
* @returns void
|
|
148
|
+
*/
|
|
149
|
+
UILayer.prototype.setTheme = function (theme) {
|
|
150
|
+
return __awaiter(this, void 0, void 0, function () {
|
|
151
|
+
return __generator(this, function (_a) {
|
|
152
|
+
switch (_a.label) {
|
|
153
|
+
case 0: return [4 /*yield*/, (0, helpers_1.evaluateAndReturn)(this.page, function (theme) { return WPP.conn.setTheme(theme); }, theme)];
|
|
154
|
+
case 1: return [2 /*return*/, _a.sent()];
|
|
155
|
+
}
|
|
156
|
+
});
|
|
157
|
+
});
|
|
158
|
+
};
|
|
159
|
+
/**
|
|
160
|
+
* Get auto download settings
|
|
161
|
+
* @category UI
|
|
162
|
+
* @returns Auto download settings
|
|
163
|
+
*/
|
|
164
|
+
UILayer.prototype.getAutoDownloadSettings = function () {
|
|
165
|
+
return __awaiter(this, void 0, void 0, function () {
|
|
166
|
+
return __generator(this, function (_a) {
|
|
167
|
+
switch (_a.label) {
|
|
168
|
+
case 0: return [4 /*yield*/, (0, helpers_1.evaluateAndReturn)(this.page, function () {
|
|
169
|
+
return WPP.conn.getAutoDownloadSettings();
|
|
170
|
+
})];
|
|
171
|
+
case 1: return [2 /*return*/, _a.sent()];
|
|
172
|
+
}
|
|
173
|
+
});
|
|
174
|
+
});
|
|
175
|
+
};
|
|
176
|
+
/**
|
|
177
|
+
* Set auto download settings
|
|
178
|
+
* Note: This will force a reload of WhatsApp Web to take effect
|
|
179
|
+
* @category UI
|
|
180
|
+
* @param settings Auto download settings to set
|
|
181
|
+
* @returns void
|
|
182
|
+
*/
|
|
183
|
+
UILayer.prototype.setAutoDownloadSettings = function (settings) {
|
|
184
|
+
return __awaiter(this, void 0, void 0, function () {
|
|
185
|
+
return __generator(this, function (_a) {
|
|
186
|
+
switch (_a.label) {
|
|
187
|
+
case 0: return [4 /*yield*/, (0, helpers_1.evaluateAndReturn)(this.page, function (settings) { return WPP.conn.setAutoDownloadSettings(settings); }, settings)];
|
|
188
|
+
case 1: return [2 /*return*/, _a.sent()];
|
|
189
|
+
}
|
|
190
|
+
});
|
|
191
|
+
});
|
|
192
|
+
};
|
|
127
193
|
return UILayer;
|
|
128
194
|
}(group_layer_1.GroupLayer));
|
|
129
195
|
exports.UILayer = UILayer;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@wppconnect-team/wppconnect",
|
|
3
|
-
"version": "1.
|
|
3
|
+
"version": "1.38.0",
|
|
4
4
|
"description": "WPPConnect is an open source project developed by the JavaScript community with the aim of exporting functions from WhatsApp Web to the node, which can be used to support the creation of any interaction, such as customer service, media sending, intelligence recognition based on phrases artificial and many other things, use your imagination... 😀🤔💭",
|
|
5
5
|
"main": "dist/index.js",
|
|
6
6
|
"types": "dist/index.d.ts",
|
|
@@ -84,7 +84,7 @@
|
|
|
84
84
|
"prettier": "^2.8.8",
|
|
85
85
|
"pretty-quick": "^4.2.2",
|
|
86
86
|
"regenerator-runtime": "^0.14.1",
|
|
87
|
-
"release-it": "^19.2.
|
|
87
|
+
"release-it": "^19.2.4",
|
|
88
88
|
"shx": "^0.4.0",
|
|
89
89
|
"ts-node": "^10.9.2",
|
|
90
90
|
"typedoc": "^0.28.16",
|
|
@@ -93,8 +93,8 @@
|
|
|
93
93
|
"webpack-cli": "^6.0.1"
|
|
94
94
|
},
|
|
95
95
|
"dependencies": {
|
|
96
|
-
"@wppconnect/wa-js": "^3.
|
|
97
|
-
"@wppconnect/wa-version": "^1.5.
|
|
96
|
+
"@wppconnect/wa-js": "^3.20.0",
|
|
97
|
+
"@wppconnect/wa-version": "^1.5.3099",
|
|
98
98
|
"atob": "^2.1.2",
|
|
99
99
|
"axios": "^1.13.2",
|
|
100
100
|
"boxen": "^5.1.2",
|