@open-wa/wa-automate 4.72.4 → 4.74.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.
@@ -1051,6 +1051,7 @@ export declare class Client {
1051
1051
  */
1052
1052
  logout(preserveSessionData?: boolean): Promise<boolean>;
1053
1053
  /**
1054
+ * @deprecated No longer works due to multi-device changes
1054
1055
  * Retrieves Battery Level
1055
1056
  * @returns Number
1056
1057
  */
@@ -321,6 +321,7 @@ class Client {
321
321
  return;
322
322
  yield this._autoEmojiQ.add(() => __awaiter(this, void 0, void 0, function* () { return this.sendEmoji(message.from, emojiId, message.id).catch(() => { }); }));
323
323
  }
324
+ return message;
324
325
  }));
325
326
  this._autoEmojiSet = true;
326
327
  }
@@ -672,7 +673,7 @@ class Client {
672
673
  if (this._registeredPageListeners.includes(event))
673
674
  return true;
674
675
  this._registeredPageListeners.push(event);
675
- logging_1.log.info(`setting page listener: ${event}`, this._registeredPageListeners);
676
+ logging_1.log.info(`setting page listener: ${String(event)}`, this._registeredPageListeners);
676
677
  this._page.on(event, (...args) => __awaiter(this, void 0, void 0, function* () {
677
678
  yield Promise.all(this._pageListeners.filter(l => l.event === event).filter(({ priority }) => priority !== -1).sort((a, b) => (b.priority || 0) - (a.priority || 0)).map(l => l.callback(...args)));
678
679
  yield Promise.all(this._pageListeners.filter(l => l.event === event).filter(({ priority }) => priority == -1).sort((a, b) => (b.priority || 0) - (a.priority || 0)).map(l => l.callback(...args)));
@@ -755,7 +756,7 @@ class Client {
755
756
  return this._queues;
756
757
  }
757
758
  // STANDARD SIMPLE LISTENERS
758
- preprocessMessage(message) {
759
+ preprocessMessage(message, source) {
759
760
  return __awaiter(this, void 0, void 0, function* () {
760
761
  let alreadyProcessed = false;
761
762
  if (this._preprocIdempotencyCheck[message.id]) {
@@ -786,10 +787,10 @@ class Client {
786
787
  const start = Date.now();
787
788
  if (typeof preproc === "function") {
788
789
  custom = true;
789
- _m = yield preproc(_m, this, alreadyProcessed);
790
+ _m = yield preproc(_m, this, alreadyProcessed, source);
790
791
  }
791
792
  else if (typeof preproc === "string" && preProcessors_1.MessagePreprocessors[preproc])
792
- _m = yield preProcessors_1.MessagePreprocessors[preproc](_m, this, alreadyProcessed);
793
+ _m = yield preProcessors_1.MessagePreprocessors[preproc](_m, this, alreadyProcessed, source);
793
794
  logging_1.log.info(`Preproc ${custom ? 'CUSTOM' : preproc} ${index} ${fil} ${message.id} ${m.id} ${Date.now() - start}ms`);
794
795
  return _m;
795
796
  })));
@@ -812,7 +813,7 @@ class Client {
812
813
  onMessage(fn, queueOptions) {
813
814
  var _a;
814
815
  return __awaiter(this, void 0, void 0, function* () {
815
- const _fn = (message) => __awaiter(this, void 0, void 0, function* () { return fn(yield this.preprocessMessage(message)); });
816
+ const _fn = (message) => __awaiter(this, void 0, void 0, function* () { return fn(yield this.preprocessMessage(message, 'onMessage')); });
816
817
  return this.registerListener(events_2.SimpleListener.Message, _fn, ((_a = this === null || this === void 0 ? void 0 : this._createConfig) === null || _a === void 0 ? void 0 : _a.pQueueDefault) || queueOptions);
817
818
  });
818
819
  }
@@ -827,7 +828,7 @@ class Client {
827
828
  onAnyMessage(fn, queueOptions) {
828
829
  var _a;
829
830
  return __awaiter(this, void 0, void 0, function* () {
830
- const _fn = (message) => __awaiter(this, void 0, void 0, function* () { return fn(yield this.preprocessMessage(message)); });
831
+ const _fn = (message) => __awaiter(this, void 0, void 0, function* () { return fn(yield this.preprocessMessage(message, 'onAnyMessage')); });
831
832
  return this.registerListener(events_2.SimpleListener.AnyMessage, _fn, ((_a = this === null || this === void 0 ? void 0 : this._createConfig) === null || _a === void 0 ? void 0 : _a.pQueueDefault) || queueOptions);
832
833
  });
833
834
  }
@@ -2371,6 +2372,7 @@ class Client {
2371
2372
  });
2372
2373
  }
2373
2374
  /**
2375
+ * @deprecated No longer works due to multi-device changes
2374
2376
  * Retrieves Battery Level
2375
2377
  * @returns Number
2376
2378
  */
@@ -158,7 +158,7 @@ const postmanRequestGeneratorGenerator = setup => method => {
158
158
  "apikey": [
159
159
  {
160
160
  "key": "value",
161
- "value": setup === null || setup === void 0 ? void 0 : setup.key,
161
+ "value": setup === null || setup === void 0 ? void 0 : setup.preAuthDocs && setup.key,
162
162
  "type": "string"
163
163
  },
164
164
  {
@@ -132,7 +132,7 @@ class QRManager {
132
132
  this.config = null;
133
133
  this.firstEmitted = false;
134
134
  this._internalQrPngLoaded = false;
135
- this.qrCheck = `document.querySelector("canvas[aria-label='Scan me!']")?document.querySelector("canvas[aria-label='Scan me!']").parentElement.getAttribute("data-ref"):false`;
135
+ this.qrCheck = `document.querySelector("canvas[aria-label]")?document.querySelector("canvas[aria-label]").parentElement.getAttribute("data-ref"):false`;
136
136
  this.config = config;
137
137
  this.setConfig(this.config);
138
138
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@open-wa/wa-automate",
3
- "version": "4.72.4",
3
+ "version": "4.74.0",
4
4
  "licenseCheckUrl": "https://funcs.openwa.dev/license-check",
5
5
  "brokenMethodReportUrl": "https://funcs.openwa.dev/report-bm",
6
6
  "patches": "https://cdn.openwa.dev/patches.json",
@@ -152,11 +152,11 @@
152
152
  "pidtree": "^0.6.0",
153
153
  "pidusage": "^3.0.0",
154
154
  "postman-2-swagger": "^0.5.0",
155
- "puppeteer": "^19.11.1",
156
- "puppeteer-extra": "^3.3.4",
157
- "puppeteer-extra-plugin-block-resources": "^2.4.2",
158
- "puppeteer-extra-plugin-devtools": "^2.4.4",
159
- "puppeteer-extra-plugin-stealth": "^2.11.1",
155
+ "puppeteer": "^23.6.0",
156
+ "puppeteer-extra": "^3.3.6",
157
+ "puppeteer-extra-plugin-block-resources": "^2.4.3",
158
+ "puppeteer-extra-plugin-devtools": "^2.4.6",
159
+ "puppeteer-extra-plugin-stealth": "^2.11.2",
160
160
  "qrcode-terminal": "^0.12.0",
161
161
  "qs": "^6.10.1",
162
162
  "rxjs": "^7.0.0",