@open-wa/wa-automate-types-only 4.23.18 → 4.25.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.
@@ -552,6 +552,11 @@ export interface ConfigObject {
|
|
552
552
|
* This will force the library to use the default cached raw github link for patches to shave a few hundred milliseconds from your launch time. If you use this option, you will need to wait about 5 minutes before trying out new patches.
|
553
553
|
* @default `false`
|
554
554
|
*/
|
555
|
+
ghPatch?: boolean;
|
556
|
+
/**
|
557
|
+
* Setting this to `true` will save a local copy of the patches.json file (as patches.ignore.data.json) which will be used in subsequent instantiations of the session. While the rest of the launch procedure is running, the library will fetch and save a recent version of the patches to ensure your patches don't go stale. This will be ignored if the cached patches are more than a day old.
|
558
|
+
* @default `false`
|
559
|
+
*/
|
555
560
|
cachedPatch?: boolean;
|
556
561
|
/**
|
557
562
|
* Setting `this` to true will replace the `console.table` with a stringified logging of the debug info object instead. This would be useful to set for smaller terminal windows. If `disableSpins` is `true` then this will also be `true`.
|
@@ -4,8 +4,8 @@ declare const puppeteerConfig: {
|
|
4
4
|
height: number;
|
5
5
|
chromiumArgs: string[];
|
6
6
|
};
|
7
|
-
export declare const useragent = "WhatsApp/2.2108.8 Mozilla/5.0 (Macintosh; Intel Mac OS X 11_2_2) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/89.0.4389.90 Safari/537.36";
|
8
7
|
export declare const createUserAgent: (waVersion: string) => string;
|
8
|
+
export declare const useragent: string;
|
9
9
|
export { puppeteerConfig };
|
10
10
|
export declare const width: number;
|
11
11
|
export declare const height: number;
|
@@ -1,8 +1,6 @@
|
|
1
1
|
import { Client } from '../api/Client';
|
2
2
|
import { ConfigObject } from '../api/model/index';
|
3
|
-
|
4
|
-
import { SessionInfo } from '../api/model/sessionInfo';
|
5
|
-
import { Page } from 'puppeteer';
|
3
|
+
export declare const pkg: any, configWithCases: any, timeout: (ms: number) => Promise<unknown>;
|
6
4
|
export declare let screenshot: any;
|
7
5
|
/**
|
8
6
|
* Used to initialize the client session.
|
@@ -22,36 +20,3 @@ export declare let screenshot: any;
|
|
22
20
|
* @param config ConfigObject] The extended custom configuration
|
23
21
|
*/
|
24
22
|
export declare function create(config?: ConfigObject): Promise<Client>;
|
25
|
-
/**
|
26
|
-
* @private
|
27
|
-
*/
|
28
|
-
export declare function getPatch(config: ConfigObject, spinner?: Spin, sessionInfo?: SessionInfo): Promise<{
|
29
|
-
data: any;
|
30
|
-
tag: string;
|
31
|
-
}>;
|
32
|
-
/**
|
33
|
-
* @private
|
34
|
-
* @param page
|
35
|
-
* @param spinner
|
36
|
-
*/
|
37
|
-
export declare function injectLivePatch(page: Page, patch: {
|
38
|
-
data: any;
|
39
|
-
tag: string;
|
40
|
-
}, spinner?: Spin): Promise<void>;
|
41
|
-
/**
|
42
|
-
* @private
|
43
|
-
*/
|
44
|
-
export declare function getAndInjectLivePatch(page: Page, spinner?: Spin, preloadedPatch?: {
|
45
|
-
data: any;
|
46
|
-
tag: string;
|
47
|
-
}, config?: ConfigObject, sessionInfo?: SessionInfo): Promise<void>;
|
48
|
-
/**
|
49
|
-
* @private
|
50
|
-
*/
|
51
|
-
export declare function getLicense(config: ConfigObject, me: {
|
52
|
-
_serialized: string;
|
53
|
-
}, debugInfo: SessionInfo, spinner?: Spin): Promise<string | false>;
|
54
|
-
export declare function earlyInjectionCheck(page: Page): Promise<(page: Page) => boolean>;
|
55
|
-
export declare function getAndInjectLicense(page: Page, config: ConfigObject, me: {
|
56
|
-
_serialized: string;
|
57
|
-
}, debugInfo: SessionInfo, spinner?: Spin, preloadedLicense?: string | false): Promise<boolean>;
|
@@ -0,0 +1,37 @@
|
|
1
|
+
import { ConfigObject } from '../api/model/index';
|
2
|
+
import { Spin } from './events';
|
3
|
+
import { SessionInfo } from '../api/model/sessionInfo';
|
4
|
+
import { Page } from 'puppeteer';
|
5
|
+
/**
|
6
|
+
* @private
|
7
|
+
*/
|
8
|
+
export declare function getPatch(config: ConfigObject, spinner?: Spin, sessionInfo?: SessionInfo): Promise<{
|
9
|
+
data: any;
|
10
|
+
tag: string;
|
11
|
+
}>;
|
12
|
+
/**
|
13
|
+
* @private
|
14
|
+
* @param page
|
15
|
+
* @param spinner
|
16
|
+
*/
|
17
|
+
export declare function injectLivePatch(page: Page, patch: {
|
18
|
+
data: any;
|
19
|
+
tag: string;
|
20
|
+
}, spinner?: Spin): Promise<void>;
|
21
|
+
/**
|
22
|
+
* @private
|
23
|
+
*/
|
24
|
+
export declare function getAndInjectLivePatch(page: Page, spinner?: Spin, preloadedPatch?: {
|
25
|
+
data: any;
|
26
|
+
tag: string;
|
27
|
+
}, config?: ConfigObject, sessionInfo?: SessionInfo): Promise<void>;
|
28
|
+
/**
|
29
|
+
* @private
|
30
|
+
*/
|
31
|
+
export declare function getLicense(config: ConfigObject, me: {
|
32
|
+
_serialized: string;
|
33
|
+
}, debugInfo: SessionInfo, spinner?: Spin): Promise<string | false>;
|
34
|
+
export declare function earlyInjectionCheck(page: Page): Promise<(page: Page) => boolean>;
|
35
|
+
export declare function getAndInjectLicense(page: Page, config: ConfigObject, me: {
|
36
|
+
_serialized: string;
|
37
|
+
}, debugInfo: SessionInfo, spinner?: Spin, preloadedLicense?: string | false): Promise<boolean>;
|
@@ -0,0 +1,55 @@
|
|
1
|
+
import { Message } from "..";
|
2
|
+
export interface CurrentDialogProps {
|
3
|
+
[k: string]: any;
|
4
|
+
}
|
5
|
+
export interface DialogState {
|
6
|
+
currentStep: number;
|
7
|
+
currentProps: any;
|
8
|
+
lastInput: any;
|
9
|
+
isComplete: boolean;
|
10
|
+
isError: boolean;
|
11
|
+
errorMessage: string;
|
12
|
+
}
|
13
|
+
export interface DialogTemplate {
|
14
|
+
"dialogId": string;
|
15
|
+
"privateOnly": boolean;
|
16
|
+
"identifier": string;
|
17
|
+
"successMessage": string;
|
18
|
+
"startMessage": string;
|
19
|
+
"properties": {
|
20
|
+
[key: string]: DialogProperty;
|
21
|
+
};
|
22
|
+
}
|
23
|
+
export declare type CheckFunction = (lastReceivedMessage: Message, currentProps: CurrentDialogProps) => boolean;
|
24
|
+
export interface DialogProperty {
|
25
|
+
"order": number;
|
26
|
+
"key": string;
|
27
|
+
"prompt": string;
|
28
|
+
"type": string;
|
29
|
+
"skipCondition"?: CheckFunction;
|
30
|
+
"options"?: DialogButtons[] | DialogListMessageSection[];
|
31
|
+
"validation": DialogValidation[];
|
32
|
+
}
|
33
|
+
export interface DialogButtons {
|
34
|
+
label: string;
|
35
|
+
value: string;
|
36
|
+
}
|
37
|
+
export interface DialogListMessageSection {
|
38
|
+
title: string;
|
39
|
+
rows: DialogListMessageRow[];
|
40
|
+
}
|
41
|
+
export interface DialogListMessageRow {
|
42
|
+
title: string;
|
43
|
+
description: string;
|
44
|
+
value: string;
|
45
|
+
}
|
46
|
+
export interface DialogValidation {
|
47
|
+
"type": ValidationType;
|
48
|
+
"value": string | CheckFunction;
|
49
|
+
"errorMessage": string;
|
50
|
+
}
|
51
|
+
export declare enum ValidationType {
|
52
|
+
REGEX = "regex",
|
53
|
+
LENGTH = "length",
|
54
|
+
CHECK = "check"
|
55
|
+
}
|
package/dist/utils/tools.d.ts
CHANGED
@@ -24,3 +24,4 @@ export declare const getDUrl: (url: string, optionsOverride?: AxiosRequestConfig
|
|
24
24
|
* Use this to extract the mime type from a [[DataURL]]
|
25
25
|
*/
|
26
26
|
export declare const base64MimeType: (dUrl: DataURL) => string;
|
27
|
+
export declare const processSend: (message: string) => void;
|