@open-wa/wa-automate 4.35.12 → 4.35.13

Sign up to get free protection for your applications and to get access to all the features.
@@ -705,6 +705,11 @@ export declare class Client {
705
705
  * @returns `Promise<DataURL>`
706
706
  */
707
707
  getSnapshot(chatId?: ChatId): Promise<DataURL>;
708
+ /**
709
+ * Returns some metrics of the session/page.
710
+ * @returns `Promise<any>`
711
+ */
712
+ metrics(): Promise<any>;
708
713
  /**
709
714
  * Returns an array of group ids where the host account is admin
710
715
  */
@@ -1713,6 +1713,19 @@ class Client {
1713
1713
  return `data:image/png;base64,${screenshot}`;
1714
1714
  });
1715
1715
  }
1716
+ /**
1717
+ * Returns some metrics of the session/page.
1718
+ * @returns `Promise<any>`
1719
+ */
1720
+ metrics() {
1721
+ return __awaiter(this, void 0, void 0, function* () {
1722
+ const metrics = yield this._page.metrics();
1723
+ const sessionMetrics = yield this.pup(() => WAPI.launchMetrics());
1724
+ const res = Object.assign(Object.assign({}, (metrics || {})), (sessionMetrics || {}));
1725
+ logging_1.log.info("Metrics:", res);
1726
+ return res;
1727
+ });
1728
+ }
1716
1729
  /**
1717
1730
  * Returns an array of group ids where the host account is admin
1718
1731
  */
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@open-wa/wa-automate",
3
- "version": "4.35.12",
3
+ "version": "4.35.13",
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",