@open-wa/wa-automate-types-only 4.25.0 → 4.27.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.
@@ -39,6 +39,8 @@ export declare class Client {
39
39
  private _refreshing;
40
40
  private _l;
41
41
  private _prio;
42
+ private _pageListeners;
43
+ private _registeredPageListeners;
42
44
  private _queues;
43
45
  /**
44
46
  * This is used to track if a listener is already used via webhook. Before, webhooks used to be set once per listener. Now a listener can be set via multiple webhooks, or revoked from a specific webhook.
@@ -104,6 +106,7 @@ export declare class Client {
104
106
  *
105
107
  */
106
108
  private registerListener;
109
+ private registerPageEventListener;
107
110
  /**
108
111
  * Listens to a log out event
109
112
  *
@@ -111,7 +114,11 @@ export declare class Client {
111
114
  * @param fn callback
112
115
  * @fires `true`
113
116
  */
114
- onLogout(fn: (loggedOut?: boolean) => any): Promise<boolean>;
117
+ onLogout(fn: (loggedOut?: boolean) => any, priority?: number): Promise<boolean>;
118
+ /**
119
+ * Wait for the webhook queue to become idle. This is useful for ensuring webhooks are cleared before ending a process.
120
+ */
121
+ waitWhQIdle(): Promise<any>;
115
122
  /**
116
123
  * If you have set `onAnyMessage` or `onMessage` with the second parameter (PQueue options) then you may want to inspect their respective PQueue's.
117
124
  */
@@ -733,6 +733,10 @@ export interface ConfigObject {
733
733
  * wait for a valid headful session. Not required in recent versions.
734
734
  */
735
735
  waitForRipeSession?: boolean;
736
+ /**
737
+ * Automatically kill the process after a set amount of qr codes
738
+ */
739
+ qrMax?: number;
736
740
  /**@internal */
737
741
  [x: string]: any;
738
742
  }
@@ -0,0 +1,6 @@
1
+ import { Client } from '../..';
2
+ import { cliFlags } from '../server';
3
+ import { Request, Response } from "express";
4
+ export declare type expressMiddleware = (req: Request, res: Response) => Promise<Response<any, Record<string, any>>>;
5
+ export declare const chatwootMiddleware: (cliConfig: cliFlags, client: Client) => expressMiddleware;
6
+ export declare const setupChatwootOutgoingMessageHandler: (cliConfig: cliFlags, client: Client) => Promise<void>;
@@ -16,5 +16,6 @@ export declare const getCommands: () => any;
16
16
  export declare const listListeners: () => string[];
17
17
  export declare const setupMediaMiddleware: () => void;
18
18
  export declare const setupTwilioCompatibleWebhook: (cliConfig: cliFlags, client: Client) => void;
19
+ export declare const setupChatwoot: (cliConfig: cliFlags, client: Client) => void;
19
20
  export declare const setupBotPressHandler: (cliConfig: cliFlags, client: Client) => void;
20
21
  export declare const setupSocketServer: (cliConfig: any, client: Client) => Promise<void>;
@@ -1,4 +1,4 @@
1
- import { Page } from 'puppeteer';
1
+ import { Browser, Page } from 'puppeteer';
2
2
  import { Spin } from './events';
3
3
  import { ConfigObject } from '../api/model';
4
4
  export declare function initPage(sessionId?: string, config?: ConfigObject, customUserAgent?: string, spinner?: Spin, _page?: Page, skipAuth?: boolean): Promise<Page>;
@@ -6,3 +6,7 @@ export declare const deleteSessionData: (config: ConfigObject) => boolean;
6
6
  export declare const getSessionDataFilePath: (sessionId: string, config: ConfigObject) => string | boolean;
7
7
  export declare const addScript: (page: Page, js: string) => Promise<unknown>;
8
8
  export declare function injectApi(page: Page): Promise<Page>;
9
+ /**
10
+ * @internal
11
+ */
12
+ export declare const kill: (p: Page, b?: Browser, exit?: boolean) => Promise<void>;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@open-wa/wa-automate-types-only",
3
- "version": "4.25.0",
3
+ "version": "4.27.0",
4
4
  "description": "Types generated from the @open-wa/wa-automate package",
5
5
  "scripts": {
6
6
  "build": "tsc",