@open-wa/wa-automate 4.36.4 → 4.36.5
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/dist/api/Client.js
CHANGED
|
@@ -3516,6 +3516,8 @@ class Client {
|
|
|
3516
3516
|
this._registeredWebhooks = {};
|
|
3517
3517
|
const validListeners = [];
|
|
3518
3518
|
events.map(event => {
|
|
3519
|
+
if (!event.startsWith("on"))
|
|
3520
|
+
event = `on${event}`;
|
|
3519
3521
|
if (this[event]) {
|
|
3520
3522
|
validListeners.push(event);
|
|
3521
3523
|
if (this._registeredWebhookListeners[event] === undefined) {
|
package/dist/cli/index.js
CHANGED
|
@@ -184,7 +184,6 @@ function start() {
|
|
|
184
184
|
server_1.server.listen(PORT, () => __awaiter(this, void 0, void 0, function* () {
|
|
185
185
|
spinner.succeed(`\n• Listening on port ${PORT}!`);
|
|
186
186
|
(0, index_1.processSendData)({ port: PORT });
|
|
187
|
-
yield ready(Object.assign(Object.assign(Object.assign(Object.assign({}, cliConfig), createConfig), client.getSessionInfo()), { hostAccountNumber: yield client.getHostNumber() }));
|
|
188
187
|
}));
|
|
189
188
|
process.on('message', function (data) {
|
|
190
189
|
var _a;
|
|
@@ -199,6 +198,7 @@ function start() {
|
|
|
199
198
|
if (cliConfig.tunnel) {
|
|
200
199
|
spinner.info(`\n• Setting up external tunnel`);
|
|
201
200
|
const tunnel = yield (0, localtunnel_1.default)({ port: PORT });
|
|
201
|
+
cliConfig.tunnel = tunnel.url;
|
|
202
202
|
spinner.succeed(`\n\t${(0, terminal_link_1.default)('External address', tunnel.url)}`);
|
|
203
203
|
}
|
|
204
204
|
const apiDocsUrl = cliConfig.apiHost ? `${cliConfig.apiHost}/api-docs/ ` : `${cliConfig.host.includes('http') ? '' : 'http://'}${cliConfig.host}:${PORT}/api-docs/ `;
|
|
@@ -211,8 +211,7 @@ function start() {
|
|
|
211
211
|
spinner.succeed(`\n\t${statsLink}`);
|
|
212
212
|
}
|
|
213
213
|
}
|
|
214
|
-
|
|
215
|
-
ready(Object.assign(Object.assign(Object.assign(Object.assign({}, cliConfig), createConfig), client.getSessionInfo()), { hostAccountNumber: yield client.getHostNumber() }));
|
|
214
|
+
yield ready(Object.assign(Object.assign(Object.assign(Object.assign({}, createConfig), cliConfig), client.getSessionInfo()), { hostAccountNumber: yield client.getHostNumber() }));
|
|
216
215
|
if (cliConfig.emitUnread) {
|
|
217
216
|
yield client.emitUnreadMessages();
|
|
218
217
|
}
|
|
@@ -17,7 +17,7 @@ export declare function getPatch(config: ConfigObject, spinner?: Spin, sessionIn
|
|
|
17
17
|
export declare function injectLivePatch(page: Page, patch: {
|
|
18
18
|
data: any;
|
|
19
19
|
tag: string;
|
|
20
|
-
}, spinner?: Spin): Promise<
|
|
20
|
+
}, spinner?: Spin): Promise<string>;
|
|
21
21
|
/**
|
|
22
22
|
* @private
|
|
23
23
|
*/
|
|
@@ -122,6 +122,7 @@ function injectLivePatch(page, patch, spinner) {
|
|
|
122
122
|
spinner === null || spinner === void 0 ? void 0 : spinner.info('Installing patches');
|
|
123
123
|
yield Promise.all(data.map(patch => page.evaluate(`${patch}`)));
|
|
124
124
|
spinner === null || spinner === void 0 ? void 0 : spinner.succeed(`Patches Installed: ${tag}`);
|
|
125
|
+
return tag;
|
|
125
126
|
});
|
|
126
127
|
}
|
|
127
128
|
exports.injectLivePatch = injectLivePatch;
|
|
@@ -133,7 +134,8 @@ function getAndInjectLivePatch(page, spinner, preloadedPatch, config, sessionInf
|
|
|
133
134
|
let patch = preloadedPatch;
|
|
134
135
|
if (!patch)
|
|
135
136
|
patch = yield getPatch(config, spinner, sessionInfo);
|
|
136
|
-
yield injectLivePatch(page, patch, spinner);
|
|
137
|
+
const patch_hash = yield injectLivePatch(page, patch, spinner);
|
|
138
|
+
sessionInfo.PATCH_HASH = patch_hash;
|
|
137
139
|
});
|
|
138
140
|
}
|
|
139
141
|
exports.getAndInjectLivePatch = getAndInjectLivePatch;
|
package/package.json
CHANGED