@wppconnect-team/wppconnect 1.16.0 → 1.16.1
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
|
@@ -138,7 +138,7 @@ var HostLayer = /** @class */ (function () {
|
|
|
138
138
|
}
|
|
139
139
|
hasUserDataDir = !!((_b = (_a = this.options) === null || _a === void 0 ? void 0 : _a.puppeteerOptions) === null || _b === void 0 ? void 0 : _b.userDataDir);
|
|
140
140
|
clear = !hasUserDataDir || (hasUserDataDir && !isValidToken);
|
|
141
|
-
return [4 /*yield*/, (0, browser_1.initWhatsapp)(this.page, sessionToken, clear, this.options.whatsappVersion
|
|
141
|
+
return [4 /*yield*/, (0, browser_1.initWhatsapp)(this.page, sessionToken, clear, this.options.whatsappVersion)];
|
|
142
142
|
case 3:
|
|
143
143
|
_c.sent();
|
|
144
144
|
this.page.on('load', function () {
|
|
@@ -174,7 +174,7 @@ var HostLayer = /** @class */ (function () {
|
|
|
174
174
|
}, options)];
|
|
175
175
|
case 1:
|
|
176
176
|
_a.sent();
|
|
177
|
-
return [4 /*yield*/, (0, browser_1.injectApi)(this.page)
|
|
177
|
+
return [4 /*yield*/, (0, browser_1.injectApi)(this.page, this.onLoadingScreen)
|
|
178
178
|
.then(function () {
|
|
179
179
|
_this.log('verbose', 'wapi.js injected');
|
|
180
180
|
_this.getWAVersion()
|
|
@@ -10,9 +10,9 @@ export declare function unregisterServiceWorker(page: Page): Promise<void>;
|
|
|
10
10
|
* @param version Versão ou expressão semver
|
|
11
11
|
*/
|
|
12
12
|
export declare function setWhatsappVersion(page: Page, version: string): Promise<void>;
|
|
13
|
-
export declare function initWhatsapp(page: Page, token?: SessionToken, clear?: boolean, version?: string
|
|
13
|
+
export declare function initWhatsapp(page: Page, token?: SessionToken, clear?: boolean, version?: string): Promise<Page>;
|
|
14
14
|
export declare function onLoadingScreen(page: Page, onLoadingScreenCallBack?: LoadingScreenCallback): Promise<void>;
|
|
15
|
-
export declare function injectApi(page: Page): Promise<boolean | import("puppeteer").JSHandle<unknown>>;
|
|
15
|
+
export declare function injectApi(page: Page, onLoadingScreenCallBack?: LoadingScreenCallback): Promise<boolean | import("puppeteer").JSHandle<unknown>>;
|
|
16
16
|
/**
|
|
17
17
|
* Initializes browser, will try to use chrome as default
|
|
18
18
|
* @param session
|
|
@@ -176,7 +176,7 @@ function setWhatsappVersion(page, version) {
|
|
|
176
176
|
});
|
|
177
177
|
}
|
|
178
178
|
exports.setWhatsappVersion = setWhatsappVersion;
|
|
179
|
-
function initWhatsapp(page, token, clear, version
|
|
179
|
+
function initWhatsapp(page, token, clear, version) {
|
|
180
180
|
if (clear === void 0) { clear = true; }
|
|
181
181
|
return __awaiter(this, void 0, void 0, function () {
|
|
182
182
|
var timeout;
|
|
@@ -204,9 +204,6 @@ function initWhatsapp(page, token, clear, version, onLoadingScreenCallBack) {
|
|
|
204
204
|
})
|
|
205
205
|
.catch(function () { })];
|
|
206
206
|
case 5:
|
|
207
|
-
_a.sent();
|
|
208
|
-
return [4 /*yield*/, onLoadingScreen(page, onLoadingScreenCallBack)];
|
|
209
|
-
case 6:
|
|
210
207
|
_a.sent();
|
|
211
208
|
return [2 /*return*/, page];
|
|
212
209
|
}
|
|
@@ -268,7 +265,7 @@ function onLoadingScreen(page, onLoadingScreenCallBack) {
|
|
|
268
265
|
});
|
|
269
266
|
}
|
|
270
267
|
exports.onLoadingScreen = onLoadingScreen;
|
|
271
|
-
function injectApi(page) {
|
|
268
|
+
function injectApi(page, onLoadingScreenCallBack) {
|
|
272
269
|
return __awaiter(this, void 0, void 0, function () {
|
|
273
270
|
var injected;
|
|
274
271
|
return __generator(this, function (_a) {
|
|
@@ -311,6 +308,9 @@ function injectApi(page) {
|
|
|
311
308
|
path: require.resolve(path.join(__dirname, '../../dist/lib/wapi', 'wapi.js')),
|
|
312
309
|
})];
|
|
313
310
|
case 5:
|
|
311
|
+
_a.sent();
|
|
312
|
+
return [4 /*yield*/, onLoadingScreen(page, onLoadingScreenCallBack)];
|
|
313
|
+
case 6:
|
|
314
314
|
_a.sent();
|
|
315
315
|
return [4 /*yield*/, page
|
|
316
316
|
.waitForFunction(function () {
|
|
@@ -318,7 +318,7 @@ function injectApi(page) {
|
|
|
318
318
|
typeof window.Store !== 'undefined');
|
|
319
319
|
})
|
|
320
320
|
.catch(function () { return false; })];
|
|
321
|
-
case
|
|
321
|
+
case 7:
|
|
322
322
|
// Make sure WAPI is initialized
|
|
323
323
|
return [2 /*return*/, _a.sent()];
|
|
324
324
|
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@wppconnect-team/wppconnect",
|
|
3
|
-
"version": "1.16.
|
|
3
|
+
"version": "1.16.1",
|
|
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",
|
|
@@ -71,8 +71,8 @@
|
|
|
71
71
|
"@types/shelljs": "^0.8.11",
|
|
72
72
|
"@types/tmp": "^0.2.3",
|
|
73
73
|
"@types/ws": "^8.5.3",
|
|
74
|
-
"@typescript-eslint/eslint-plugin": "^5.
|
|
75
|
-
"@typescript-eslint/parser": "^5.
|
|
74
|
+
"@typescript-eslint/eslint-plugin": "^5.32.0",
|
|
75
|
+
"@typescript-eslint/parser": "^5.32.0",
|
|
76
76
|
"babel-loader": "^8.2.5",
|
|
77
77
|
"commitizen": "^4.2.5",
|
|
78
78
|
"concurrently": "^7.3.0",
|
|
@@ -88,15 +88,15 @@
|
|
|
88
88
|
"regenerator-runtime": "^0.13.9",
|
|
89
89
|
"release-it": "^15.2.0",
|
|
90
90
|
"shx": "^0.3.4",
|
|
91
|
-
"ts-node": "^10.
|
|
91
|
+
"ts-node": "^10.9.1",
|
|
92
92
|
"typedoc": "^0.23.10",
|
|
93
93
|
"typescript": "^4.7.4",
|
|
94
|
-
"webpack": "^5.
|
|
94
|
+
"webpack": "^5.74.0",
|
|
95
95
|
"webpack-cli": "^4.10.0"
|
|
96
96
|
},
|
|
97
97
|
"dependencies": {
|
|
98
|
-
"@wppconnect/wa-js": "^2.10.
|
|
99
|
-
"@wppconnect/wa-version": "^1.1.
|
|
98
|
+
"@wppconnect/wa-js": "^2.10.1",
|
|
99
|
+
"@wppconnect/wa-version": "^1.1.123",
|
|
100
100
|
"atob": "^2.1.2",
|
|
101
101
|
"axios": "^0.27.2",
|
|
102
102
|
"boxen": "^5.1.2",
|