@open-wa/wa-automate 4.76.0 → 5.0.0-alpha.2
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/README.md +14 -165
- package/dist/cli-runtime-B7_3MM0c.cjs +798 -0
- package/dist/cli-runtime-B7_3MM0c.cjs.map +1 -0
- package/dist/cli-runtime-CmpYxFCk.d.cts +31 -0
- package/dist/cli-runtime-CmpYxFCk.d.cts.map +1 -0
- package/dist/cli.cjs +17 -0
- package/dist/cli.cjs.map +1 -0
- package/dist/cli.d.cts +2 -0
- package/dist/index.cjs +224 -0
- package/dist/index.cjs.map +1 -0
- package/dist/index.d.cts +81 -0
- package/dist/index.d.cts.map +1 -0
- package/package.json +34 -177
- package/CNAME +0 -1
- package/_tsconfig.docs.json +0 -140
- package/bin/config-schema.json +0 -1
- package/bin/oas-type-schemas.json +0 -1
- package/bin/server.js +0 -45
- package/build/build-config-json-for-bin.ts +0 -56
- package/build/generate-oas-types.ts +0 -31
- package/dist/api/Client.d.ts +0 -2255
- package/dist/api/Client.js +0 -4358
- package/dist/api/functions/exposed.enum.d.ts +0 -7
- package/dist/api/functions/exposed.enum.js +0 -11
- package/dist/api/model/aliases.d.ts +0 -110
- package/dist/api/model/aliases.js +0 -3
- package/dist/api/model/button.d.ts +0 -24
- package/dist/api/model/button.js +0 -2
- package/dist/api/model/call.d.ts +0 -51
- package/dist/api/model/call.js +0 -18
- package/dist/api/model/chat.d.ts +0 -221
- package/dist/api/model/chat.js +0 -52
- package/dist/api/model/config.d.ts +0 -836
- package/dist/api/model/config.js +0 -111
- package/dist/api/model/contact.d.ts +0 -143
- package/dist/api/model/contact.js +0 -2
- package/dist/api/model/errors.d.ts +0 -90
- package/dist/api/model/errors.js +0 -117
- package/dist/api/model/events.d.ts +0 -120
- package/dist/api/model/events.js +0 -127
- package/dist/api/model/group-metadata.d.ts +0 -124
- package/dist/api/model/group-metadata.js +0 -25
- package/dist/api/model/id.d.ts +0 -5
- package/dist/api/model/id.js +0 -2
- package/dist/api/model/index.d.ts +0 -110
- package/dist/api/model/index.js +0 -128
- package/dist/api/model/label.d.ts +0 -24
- package/dist/api/model/label.js +0 -2
- package/dist/api/model/media.d.ts +0 -93
- package/dist/api/model/media.js +0 -12
- package/dist/api/model/message.d.ts +0 -422
- package/dist/api/model/message.js +0 -40
- package/dist/api/model/product.d.ts +0 -141
- package/dist/api/model/product.js +0 -2
- package/dist/api/model/reactions.d.ts +0 -76
- package/dist/api/model/reactions.js +0 -2
- package/dist/api/model/sessionInfo.d.ts +0 -77
- package/dist/api/model/sessionInfo.js +0 -2
- package/dist/build/build-postman.d.ts +0 -1
- package/dist/build/build-postman.js +0 -262
- package/dist/cli/cli-options.d.ts +0 -9
- package/dist/cli/cli-options.js +0 -289
- package/dist/cli/collections.d.ts +0 -2
- package/dist/cli/collections.js +0 -251
- package/dist/cli/file-utils.d.ts +0 -1
- package/dist/cli/file-utils.js +0 -71
- package/dist/cli/index.d.ts +0 -1
- package/dist/cli/index.js +0 -231
- package/dist/cli/integrations/chatwoot.d.ts +0 -49
- package/dist/cli/integrations/chatwoot.js +0 -672
- package/dist/cli/integrations/cloudflare.d.ts +0 -6
- package/dist/cli/integrations/cloudflare.js +0 -76
- package/dist/cli/logo.d.ts +0 -1
- package/dist/cli/logo.js +0 -49
- package/dist/cli/server.d.ts +0 -24
- package/dist/cli/server.js +0 -540
- package/dist/cli/setup.d.ts +0 -30
- package/dist/cli/setup.js +0 -308
- package/dist/config/puppeteer.config.d.ts +0 -11
- package/dist/config/puppeteer.config.js +0 -65
- package/dist/controllers/auth.d.ts +0 -36
- package/dist/controllers/auth.js +0 -322
- package/dist/controllers/browser.d.ts +0 -17
- package/dist/controllers/browser.js +0 -603
- package/dist/controllers/events.d.ts +0 -82
- package/dist/controllers/events.js +0 -173
- package/dist/controllers/init_patch.d.ts +0 -13
- package/dist/controllers/init_patch.js +0 -42
- package/dist/controllers/initializer.d.ts +0 -22
- package/dist/controllers/initializer.js +0 -511
- package/dist/controllers/launch_checks.d.ts +0 -8
- package/dist/controllers/launch_checks.js +0 -130
- package/dist/controllers/patch_manager.d.ts +0 -37
- package/dist/controllers/patch_manager.js +0 -231
- package/dist/controllers/popup/index.d.ts +0 -3
- package/dist/controllers/popup/index.html +0 -168
- package/dist/controllers/popup/index.js +0 -148
- package/dist/controllers/script_preloader.d.ts +0 -17
- package/dist/controllers/script_preloader.js +0 -88
- package/dist/index.d.ts +0 -13
- package/dist/index.js +0 -36
- package/dist/lib/README.md +0 -5
- package/dist/lib/base64.js +0 -1
- package/dist/lib/hash.js +0 -1
- package/dist/lib/jsSha.min.js +0 -1
- package/dist/lib/launch.js +0 -1
- package/dist/lib/qr.min.js +0 -1
- package/dist/lib/wapi.js +0 -2163
- package/dist/logging/custom_transport.d.ts +0 -9
- package/dist/logging/custom_transport.js +0 -35
- package/dist/logging/logging.d.ts +0 -50
- package/dist/logging/logging.js +0 -196
- package/dist/structures/Collector.d.ts +0 -202
- package/dist/structures/Collector.js +0 -391
- package/dist/structures/Dialog.d.ts +0 -55
- package/dist/structures/Dialog.js +0 -21
- package/dist/structures/MessageCollector.d.ts +0 -78
- package/dist/structures/MessageCollector.js +0 -145
- package/dist/structures/preProcessors.d.ts +0 -58
- package/dist/structures/preProcessors.js +0 -181
- package/dist/utils/pid_utils.d.ts +0 -1
- package/dist/utils/pid_utils.js +0 -26
- package/dist/utils/tools.d.ts +0 -152
- package/dist/utils/tools.js +0 -494
- package/tos.md +0 -77
|
@@ -1,836 +0,0 @@
|
|
|
1
|
-
import { AxiosRequestConfig } from 'axios';
|
|
2
|
-
import { ConfigLogTransport } from '../../logging/logging';
|
|
3
|
-
import { Base64 } from "./aliases";
|
|
4
|
-
import { SimpleListener } from './events';
|
|
5
|
-
/**
|
|
6
|
-
* The different types of qr code output.
|
|
7
|
-
*/
|
|
8
|
-
export declare enum QRFormat {
|
|
9
|
-
PNG = "png",
|
|
10
|
-
JPEG = "jpeg",
|
|
11
|
-
WEBM = "webm"
|
|
12
|
-
}
|
|
13
|
-
export declare enum CLOUD_PROVIDERS {
|
|
14
|
-
GCP = "GCP",
|
|
15
|
-
WASABI = "WASABI",
|
|
16
|
-
AWS = "AWS",
|
|
17
|
-
CONTABO = "CONTABO",
|
|
18
|
-
DO = "DO",
|
|
19
|
-
MINIO = "MINIO"
|
|
20
|
-
}
|
|
21
|
-
export declare enum DIRECTORY_STRATEGY {
|
|
22
|
-
/**
|
|
23
|
-
* E.g `/2021-08-16/`
|
|
24
|
-
*/
|
|
25
|
-
DATE = "DATE",
|
|
26
|
-
/**
|
|
27
|
-
* E.g `/447123456789/`
|
|
28
|
-
*/
|
|
29
|
-
CHAT = "CHAT",
|
|
30
|
-
/**
|
|
31
|
-
* E.g `/447123456789/2021-08-16/`
|
|
32
|
-
*/
|
|
33
|
-
CHAT_DATE = "CHAT_DATE",
|
|
34
|
-
/**
|
|
35
|
-
* E.g `/2021-08-16/447123456789/`
|
|
36
|
-
*/
|
|
37
|
-
DATE_CHAT = "DATE_CHAT"
|
|
38
|
-
}
|
|
39
|
-
type SessionId = string;
|
|
40
|
-
type LicenseKey = string;
|
|
41
|
-
type HostAccountNumber = `${number}`;
|
|
42
|
-
type HostAccountNumberOrSessionID = HostAccountNumber | SessionId;
|
|
43
|
-
type LicenseKeyConfigObject = {
|
|
44
|
-
[key: HostAccountNumberOrSessionID]: LicenseKey;
|
|
45
|
-
};
|
|
46
|
-
type LicenseKeyConfigFunctionReturn = LicenseKeyConfigObject | LicenseKey;
|
|
47
|
-
type LicenseKeyConfigFunction = (sessionId?: SessionId, number?: HostAccountNumber) => LicenseKeyConfigFunctionReturn | Promise<LicenseKeyConfigFunctionReturn>;
|
|
48
|
-
type LicenseKeyConfig = LicenseKeyConfigFunction | LicenseKeyConfigObject | LicenseKey;
|
|
49
|
-
/**
|
|
50
|
-
* The available languages for the host security notification
|
|
51
|
-
*/
|
|
52
|
-
export declare enum NotificationLanguage {
|
|
53
|
-
PTBR = "pt-br",
|
|
54
|
-
ENGB = "en-gb",
|
|
55
|
-
DEDE = "de-de",
|
|
56
|
-
IDID = "id-id",
|
|
57
|
-
ITIT = "it-it",
|
|
58
|
-
NLNL = "nl-nl",
|
|
59
|
-
ES = "es"
|
|
60
|
-
}
|
|
61
|
-
export declare enum OnError {
|
|
62
|
-
/**
|
|
63
|
-
* Return it as a string
|
|
64
|
-
*/
|
|
65
|
-
AS_STRING = "AS_STRING",
|
|
66
|
-
/**
|
|
67
|
-
* Do not log anything, just return `false`
|
|
68
|
-
*/
|
|
69
|
-
RETURN_FALSE = "RETURN_FALSE",
|
|
70
|
-
/**
|
|
71
|
-
* throw the error
|
|
72
|
-
*/
|
|
73
|
-
THROW = "THROW",
|
|
74
|
-
/**
|
|
75
|
-
* Log the error and return false
|
|
76
|
-
*/
|
|
77
|
-
LOG_AND_FALSE = "LOG_AND_FALSE",
|
|
78
|
-
/**
|
|
79
|
-
* Log the error AND return the string
|
|
80
|
-
*/
|
|
81
|
-
LOG_AND_STRING = "LOG_AND_STRING",
|
|
82
|
-
/**
|
|
83
|
-
* Return the error object
|
|
84
|
-
*/
|
|
85
|
-
RETURN_ERROR = "RETURN_ERROR",
|
|
86
|
-
/**
|
|
87
|
-
* Do nothing.
|
|
88
|
-
*/
|
|
89
|
-
NOTHING = "NOTHING"
|
|
90
|
-
}
|
|
91
|
-
/**
|
|
92
|
-
* The set values of quality you can set for the quality of the qr code output. Ten being the highest quality.
|
|
93
|
-
*/
|
|
94
|
-
export declare enum QRQuality {
|
|
95
|
-
ONE = 0.1,
|
|
96
|
-
TWO = 0.2,
|
|
97
|
-
THREE = 0.3,
|
|
98
|
-
FOUR = 0.4,
|
|
99
|
-
FIVE = 0.5,
|
|
100
|
-
SIX = 0.6,
|
|
101
|
-
SEVEN = 0.7,
|
|
102
|
-
EIGHT = 0.8,
|
|
103
|
-
NINE = 0.9,
|
|
104
|
-
TEN = 1
|
|
105
|
-
}
|
|
106
|
-
export declare enum LicenseType {
|
|
107
|
-
CUSTOM = "CUSTOM",
|
|
108
|
-
B2B_RESTRICTED_VOLUME_LICENSE = "B2B_RESTRICTED_VOLUME_LICENSE",
|
|
109
|
-
INSIDER = "Insiders Program",
|
|
110
|
-
TEXT_STORY = "Text Story License Key",
|
|
111
|
-
IMAGE_STORY = "Image Story License Key",
|
|
112
|
-
VIDEO_STORY = "Video Story License Key",
|
|
113
|
-
PREMIUM = "Premium License Key",
|
|
114
|
-
NONE = "NONE"
|
|
115
|
-
}
|
|
116
|
-
export interface SessionData {
|
|
117
|
-
WABrowserId?: string;
|
|
118
|
-
WASecretBundle?: string;
|
|
119
|
-
WAToken1?: string;
|
|
120
|
-
WAToken2?: string;
|
|
121
|
-
}
|
|
122
|
-
export interface DevTools {
|
|
123
|
-
/**
|
|
124
|
-
* Username for devtools
|
|
125
|
-
*/
|
|
126
|
-
user: string;
|
|
127
|
-
/**
|
|
128
|
-
* Password for devtools
|
|
129
|
-
*/
|
|
130
|
-
pass: string;
|
|
131
|
-
}
|
|
132
|
-
export interface EventPayload {
|
|
133
|
-
ts: number;
|
|
134
|
-
sessionId: string;
|
|
135
|
-
id: string;
|
|
136
|
-
event: SimpleListener;
|
|
137
|
-
data: any;
|
|
138
|
-
[k: string]: any;
|
|
139
|
-
}
|
|
140
|
-
export interface Webhook {
|
|
141
|
-
/**
|
|
142
|
-
* The endpoint to send (POST) the event to.
|
|
143
|
-
*/
|
|
144
|
-
url: string;
|
|
145
|
-
/**
|
|
146
|
-
* The optional AxiosRequestConfig to use for firing the webhook event. This can be useful if you want to add some authentication when POSTing data to your server.
|
|
147
|
-
*
|
|
148
|
-
* For example, if your webhook requires the username `admin` and password `1234` for authentication, you can set the requestConfig to:
|
|
149
|
-
* ```
|
|
150
|
-
* {
|
|
151
|
-
* auth: {
|
|
152
|
-
* username: "admin",
|
|
153
|
-
* password: "1234",
|
|
154
|
-
* }
|
|
155
|
-
* }
|
|
156
|
-
* ```
|
|
157
|
-
*
|
|
158
|
-
* Please note, for security reasons, this is not returned when listing webhooks however it is returned when registering a webhook for verification purposes.
|
|
159
|
-
*/
|
|
160
|
-
requestConfig?: AxiosRequestConfig;
|
|
161
|
-
/**
|
|
162
|
-
* The ID of the given webhook setup. Use this ID with [[removeWebhook]]
|
|
163
|
-
*/
|
|
164
|
-
id: string;
|
|
165
|
-
/**
|
|
166
|
-
* An array of events that are registered to be sent to this webhook.
|
|
167
|
-
*/
|
|
168
|
-
events: SimpleListener[];
|
|
169
|
-
/**
|
|
170
|
-
* Time when the webhook was registered in epoch time
|
|
171
|
-
*/
|
|
172
|
-
ts: number;
|
|
173
|
-
}
|
|
174
|
-
export interface ProxyServerCredentials {
|
|
175
|
-
/**
|
|
176
|
-
* The protocol on which the proxy is running. E.g `http`, `https`, `socks4` or `socks5`. This is optional and can be automatically determined from the address.
|
|
177
|
-
*/
|
|
178
|
-
protocol?: string;
|
|
179
|
-
/**
|
|
180
|
-
* Proxy Server address. This can include the port e.g '127.0.0.1:5005'
|
|
181
|
-
*/
|
|
182
|
-
address: string;
|
|
183
|
-
/**
|
|
184
|
-
* Username for Proxy Server authentication
|
|
185
|
-
*/
|
|
186
|
-
username: string;
|
|
187
|
-
/**
|
|
188
|
-
* Password for Proxy Server authentication
|
|
189
|
-
*/
|
|
190
|
-
password: string;
|
|
191
|
-
}
|
|
192
|
-
export interface ConfigObject {
|
|
193
|
-
/**
|
|
194
|
-
* @deprecated
|
|
195
|
-
* The authentication object (as a JSON object or a base64 encoded string) that is required to migrate a session from one instance to another or to just restart an existing instance.
|
|
196
|
-
* This sessionData is provided in a generated JSON file (it's a json file but contains the JSON data as a base64 encoded string) upon QR scan or an event.
|
|
197
|
-
*
|
|
198
|
-
* You can capture the event like so:
|
|
199
|
-
* ```javascript
|
|
200
|
-
* import {create, ev} from '@open-wa/wa-automate';
|
|
201
|
-
*
|
|
202
|
-
* ev.on('sessionData.**', async (sessionData, sessionId) =>{
|
|
203
|
-
* console.log(sessionId, sessionData)
|
|
204
|
-
* })
|
|
205
|
-
*
|
|
206
|
-
* //or as base64 encoded string
|
|
207
|
-
*
|
|
208
|
-
* ev.on('sessionDataBase64.**', async (sessionDatastring, sessionId) =>{
|
|
209
|
-
* console.log(sessionId, sessionDatastring)
|
|
210
|
-
* })
|
|
211
|
-
* ```
|
|
212
|
-
* NOTE: You can set sessionData as an evironmental variable also! The variable name has to be [sessionId (default = 'session) in all caps]_DATA_JSON. You have to make sure to surround your session data with single quotes to maintain the formatting.
|
|
213
|
-
*
|
|
214
|
-
* For example:
|
|
215
|
-
*
|
|
216
|
-
* sessionId = 'session'
|
|
217
|
-
*
|
|
218
|
-
* To set env var:
|
|
219
|
-
* ```bash
|
|
220
|
-
* export SESSION_DATA_JSON=`...`
|
|
221
|
-
* ```
|
|
222
|
-
* where ... is copied from session.data.json this will be a string most likley starting in `ey...` and ending with `==`
|
|
223
|
-
*
|
|
224
|
-
* Setting the sessionData in the environmental variable will override the sessionData object in the config.
|
|
225
|
-
*/
|
|
226
|
-
sessionData?: SessionData | Base64;
|
|
227
|
-
/**
|
|
228
|
-
* There is a new way to login to your host account by entering a link code after a confirmation step from the host account device. In order to use this feature you MUST set the host account number as a string or number beforehand as a property of the config object.
|
|
229
|
-
*
|
|
230
|
-
* e.g
|
|
231
|
-
* ```
|
|
232
|
-
* linkCode: '1234567890'
|
|
233
|
-
* ```
|
|
234
|
-
*/
|
|
235
|
-
linkCode?: string;
|
|
236
|
-
/**
|
|
237
|
-
* ALPHA EXPERIMENTAL FEATURE! DO NOT USE IN PRODUCTION, REQUIRES TESTING.
|
|
238
|
-
*
|
|
239
|
-
* Learn more:
|
|
240
|
-
*
|
|
241
|
-
* https://pptr.dev/#?product=Puppeteer&version=v3.1.0&show=api-puppeteerconnectoptions
|
|
242
|
-
*
|
|
243
|
-
* https://medium.com/@jaredpotter1/connecting-puppeteer-to-existing-chrome-window-8a10828149e0
|
|
244
|
-
*/
|
|
245
|
-
browserWSEndpoint?: string;
|
|
246
|
-
/**
|
|
247
|
-
* This flag allows you to disable or enable the use of the puppeteer stealth plugin. It is a good idea to use it, however it can cause issues sometimes. Set this to false if you are experiencing `browser.setMaxListeneres` issue. For now the default for this is false.
|
|
248
|
-
* @default `false`
|
|
249
|
-
*/
|
|
250
|
-
useStealth?: boolean;
|
|
251
|
-
/**
|
|
252
|
-
* The path relative to the current working directory (i.e where you run the command to start your process). This will be used to store and read your `.data.json` files. defualt to ''
|
|
253
|
-
*/
|
|
254
|
-
sessionDataPath?: string;
|
|
255
|
-
/**
|
|
256
|
-
* Disable cors see: https://pptr.dev/#?product=Puppeteer&version=v3.0.4&show=api-pagesetbypasscspenabled If you are having an issue with sending media try to set this to true. Otherwise leave it set to false.
|
|
257
|
-
* @default `false`
|
|
258
|
-
*/
|
|
259
|
-
bypassCSP?: boolean;
|
|
260
|
-
/**
|
|
261
|
-
* This allows you to pass any array of custom chrome/chromium argument strings to the puppeteer instance.
|
|
262
|
-
* You can find all possible arguements [here](https://peter.sh/experiments/chromium-command-line-switches/).
|
|
263
|
-
*/
|
|
264
|
-
chromiumArgs?: string[];
|
|
265
|
-
/**
|
|
266
|
-
* If set to true, skipBrokenMethodsCheck will bypass the health check before startup. It is highly suggested to not set this to true.
|
|
267
|
-
* @default `false`
|
|
268
|
-
*/
|
|
269
|
-
skipBrokenMethodsCheck?: boolean;
|
|
270
|
-
/**
|
|
271
|
-
* If set to true, `skipUpdateCheck` will bypass the latest version check. This saves some time on boot (around 150 ms).
|
|
272
|
-
* @default `false`
|
|
273
|
-
*/
|
|
274
|
-
skipUpdateCheck?: boolean;
|
|
275
|
-
/**
|
|
276
|
-
* This is the name of the session. You have to make sure that this is unique for every session.
|
|
277
|
-
* @default `session`
|
|
278
|
-
*/
|
|
279
|
-
sessionId?: string;
|
|
280
|
-
/**
|
|
281
|
-
* In order to unlock the functionality to send texts to unknown numbers, you need a License key.
|
|
282
|
-
* One License Key is valid for each number. Each License Key starts from £5 per month.
|
|
283
|
-
*
|
|
284
|
-
* Please check README for instructions on how to get a license key.
|
|
285
|
-
*
|
|
286
|
-
* Notes:
|
|
287
|
-
* 1. You can change the number assigned to that License Key at any time, just message me the new number on the private discord channel.
|
|
288
|
-
* 2. In order to cancel your License Key, simply stop your membership.
|
|
289
|
-
*/
|
|
290
|
-
licenseKey?: LicenseKey;
|
|
291
|
-
/**
|
|
292
|
-
* You may set a custom user agent. However, due to recent developments, this is not really neccessary any more.
|
|
293
|
-
*/
|
|
294
|
-
customUserAgent?: string;
|
|
295
|
-
/**
|
|
296
|
-
* You can enable remote devtools by setting this to trye. If you set this to true there will be security on the devtools url.
|
|
297
|
-
* If you want, you can also pass a username & password.
|
|
298
|
-
*/
|
|
299
|
-
devtools?: boolean | DevTools;
|
|
300
|
-
/**
|
|
301
|
-
* Setting this to true will block any network calls to crash log servers. This should keep anything you do under the radar.
|
|
302
|
-
* @default `true`
|
|
303
|
-
*/
|
|
304
|
-
blockCrashLogs?: boolean;
|
|
305
|
-
/**
|
|
306
|
-
* Setting this to false turn off the cache. This may improve memory usage.
|
|
307
|
-
* @default `false`
|
|
308
|
-
*/
|
|
309
|
-
cacheEnabled?: boolean;
|
|
310
|
-
/**
|
|
311
|
-
* This is the specific browser revision to be downlaoded and used. You can find browser revision strings here: http://omahaproxy.appspot.com/
|
|
312
|
-
* Learn more about it here: https://github.com/puppeteer/puppeteer/blob/master/docs/api.md#class-browserfetcher
|
|
313
|
-
* If you're having trouble with sending images, try '737027'.
|
|
314
|
-
* If you go too far back things will start breaking !!!!!!
|
|
315
|
-
* NOTE: THIS WILL OVERRIDE useChrome and executablePath. ONLY USE THIS IF YOU KNOW WHAT YOU ARE DOING.
|
|
316
|
-
*/
|
|
317
|
-
browserRevision?: string;
|
|
318
|
-
/**
|
|
319
|
-
* Setting this to true will throw an error if a session is not able to get a QR code or is unable to restart a session.
|
|
320
|
-
*/
|
|
321
|
-
throwErrorOnTosBlock?: boolean;
|
|
322
|
-
/**
|
|
323
|
-
* By default, all instances of @open-wa/wa-automate are headless (i.e you don't see a chrome window open), you can set this to false to show the chrome/chromium window.
|
|
324
|
-
* @default `true`
|
|
325
|
-
*/
|
|
326
|
-
headless?: boolean;
|
|
327
|
-
/**
|
|
328
|
-
* @deprecated
|
|
329
|
-
*
|
|
330
|
-
* THIS IS LOCKED TO `true` AND CANNOT BE TURNED OFF. PLEASE SEE [[authTimeout]]
|
|
331
|
-
*
|
|
332
|
-
* Setting this to true will result in new QR codes being generated if the end user takes too long to scan the QR code.
|
|
333
|
-
* @default `true`
|
|
334
|
-
*/
|
|
335
|
-
autoRefresh?: boolean;
|
|
336
|
-
/**
|
|
337
|
-
* @deprecated
|
|
338
|
-
*
|
|
339
|
-
* This now has no effect
|
|
340
|
-
*
|
|
341
|
-
* This determines the interval at which to refresh the QR code. By default, WA updates the qr code every 18-19 seconds so make sure this value is set to UNDER 18 seconds!!
|
|
342
|
-
*/
|
|
343
|
-
qrRefreshS?: number;
|
|
344
|
-
/**
|
|
345
|
-
* This determines how long the process should wait for a QR code to be scanned before killing the process entirely. To have the system wait continuously, set this to `0`.
|
|
346
|
-
* @default 60
|
|
347
|
-
*/
|
|
348
|
-
qrTimeout?: number;
|
|
349
|
-
/**
|
|
350
|
-
* This determines how long the process should wait for a session to load fully before continuing the launch process.
|
|
351
|
-
* Set this to 0 to wait forever. Default is 5 seconds.
|
|
352
|
-
* @default 5
|
|
353
|
-
*/
|
|
354
|
-
waitForRipeSessionTimeout?: number;
|
|
355
|
-
/**
|
|
356
|
-
* Some features, like video upload, do not work without a chrome instance. Set this to the path of your chrome instance or you can use `useChrome:true` to automatically detect a chrome instance for you. Please note, this overrides `useChrome`.
|
|
357
|
-
*/
|
|
358
|
-
executablePath?: string;
|
|
359
|
-
/**
|
|
360
|
-
* If true, the program will automatically try to detect the instance of chorme on the machine. Please note this DOES NOT override executablePath.
|
|
361
|
-
* @default `false`
|
|
362
|
-
*/
|
|
363
|
-
useChrome?: boolean;
|
|
364
|
-
/**
|
|
365
|
-
* If sent, adds a call to waPage.authenticate with those credentials. Set `corsFix` to true if using a proxy results in CORS errors.
|
|
366
|
-
*/
|
|
367
|
-
proxyServerCredentials?: ProxyServerCredentials;
|
|
368
|
-
/**
|
|
369
|
-
* If true, skips logging the QR Code to the console.
|
|
370
|
-
* @default `false`
|
|
371
|
-
*/
|
|
372
|
-
qrLogSkip?: boolean;
|
|
373
|
-
/**
|
|
374
|
-
* If set, the program will try to recreate itself when the page crashes. You have to pass the function that you want called upon restart. Please note that when the page crashes you may miss some messages.
|
|
375
|
-
* E.g:
|
|
376
|
-
* ```javascript
|
|
377
|
-
* const start = async (client: Client) => {...}
|
|
378
|
-
* create({
|
|
379
|
-
* ...
|
|
380
|
-
* restartOnCrash: start,
|
|
381
|
-
* ...
|
|
382
|
-
* })
|
|
383
|
-
* ```
|
|
384
|
-
*/
|
|
385
|
-
restartOnCrash?: any;
|
|
386
|
-
/**
|
|
387
|
-
* Setting this to true will simplify logs for use within docker containers by disabling spins (will still print raw messages).
|
|
388
|
-
* @default `false`
|
|
389
|
-
*/
|
|
390
|
-
disableSpins?: boolean;
|
|
391
|
-
/**
|
|
392
|
-
* If true, this will log any console messages from the browser.
|
|
393
|
-
* @default `false`
|
|
394
|
-
*/
|
|
395
|
-
logConsole?: boolean;
|
|
396
|
-
/**
|
|
397
|
-
* If true, this will log any error messages from the browser instance
|
|
398
|
-
* @default `false`
|
|
399
|
-
*/
|
|
400
|
-
logConsoleErrors?: boolean;
|
|
401
|
-
/**
|
|
402
|
-
* This determines how long the process should wait for the session authentication. If exceeded, checks if phone is out of reach (turned of or without internet connection) and throws an error. It does not relate to the amount of time spent waiting for a qr code scan (see [[qrTimeout]]). To have the system wait continuously, set this to `0`.
|
|
403
|
-
* @default `60`
|
|
404
|
-
*/
|
|
405
|
-
authTimeout?: number;
|
|
406
|
-
/**
|
|
407
|
-
* phoneIsOutOfReach check timeout
|
|
408
|
-
* @default `60`
|
|
409
|
-
*/
|
|
410
|
-
oorTimeout?: number;
|
|
411
|
-
/**
|
|
412
|
-
* Setting this to `true` will kill the whole process when the client is disconnected from the page or if the browser is closed.
|
|
413
|
-
* @default `false`
|
|
414
|
-
*/
|
|
415
|
-
killProcessOnBrowserClose?: boolean;
|
|
416
|
-
/**
|
|
417
|
-
* If true, client will check if the page is valid before each command. If page is not valid, it will throw an error.
|
|
418
|
-
* @default `false`
|
|
419
|
-
*/
|
|
420
|
-
safeMode?: boolean;
|
|
421
|
-
/**
|
|
422
|
-
* If true, the process will not save a data.json file. This means that sessions will not be saved and you will need to pass sessionData as a config param or create the session data.json file yourself
|
|
423
|
-
* @default `false`
|
|
424
|
-
*/
|
|
425
|
-
skipSessionSave?: boolean;
|
|
426
|
-
/**
|
|
427
|
-
* If true, the process will open a browser window where you will see basic event logs and QR codes to authenticate the session. Usually it will open on port 3000. It can also be set to a preferred port.
|
|
428
|
-
*
|
|
429
|
-
* You can also get the QR code png at (if localhost and port 3000):
|
|
430
|
-
*
|
|
431
|
-
* `http://localhost:3000/qr`
|
|
432
|
-
*
|
|
433
|
-
* or if you have multiple session:
|
|
434
|
-
*
|
|
435
|
-
* `http://localhost:3000/qr?sessionId=[sessionId]`
|
|
436
|
-
*
|
|
437
|
-
* @default `false | 3000`
|
|
438
|
-
*/
|
|
439
|
-
popup?: boolean | number;
|
|
440
|
-
/**
|
|
441
|
-
* This needs to be used in conjuction with `popup`, if `popup` is not true or a number (representing a desired port) then this will not work.
|
|
442
|
-
*
|
|
443
|
-
* Setting this to true will make sure that only the qr code png is served via the web server. This is useful if you do not need the whole status page.
|
|
444
|
-
*
|
|
445
|
-
* As mentioned in [popup](#popup), the url for the qr code is `http://localhost:3000/qr` if the port is 3000.
|
|
446
|
-
*/
|
|
447
|
-
qrPopUpOnly?: boolean;
|
|
448
|
-
/**
|
|
449
|
-
* If true, the process will try infer as many config variables as possible from the environment variables. The format of the variables are as below:
|
|
450
|
-
* ```
|
|
451
|
-
* sessionData ==> WA_SESSION_DATA
|
|
452
|
-
* sessionDataPath ==> WA_SESSION_DATA_PATH
|
|
453
|
-
* sessionId ==> WA_SESSION_ID
|
|
454
|
-
* customUserAgent ==> WA_CUSTOM_USER_AGENT
|
|
455
|
-
* blockCrashLogs ==> WA_BLOCK_CRASH_LOGS
|
|
456
|
-
* blockAssets ==> WA_BLOCK_ASSETS
|
|
457
|
-
* corsFix ==> WA_CORS_FIX
|
|
458
|
-
* cacheEnabled ==> WA_CACHE_ENABLED
|
|
459
|
-
* headless ==> WA_HEADLESS
|
|
460
|
-
* qrTimeout ==> WA_QR_TIMEOUT
|
|
461
|
-
* useChrome ==> WA_USE_CHROME
|
|
462
|
-
* qrLogSkip ==> WA_QR_LOG_SKIP
|
|
463
|
-
* disableSpins ==> WA_DISABLE_SPINS
|
|
464
|
-
* logConsole ==> WA_LOG_CONSOLE
|
|
465
|
-
* logConsoleErrors==> WA_LOG_CONSOLE_ERRORS
|
|
466
|
-
* authTimeout ==> WA_AUTH_TIMEOUT
|
|
467
|
-
* safeMode ==> WA_SAFE_MODE
|
|
468
|
-
* skipSessionSave ==> WA_SKIP_SESSION_SAVE
|
|
469
|
-
* popup ==> WA_POPUP
|
|
470
|
-
* licensekey ==> WA_LICENSE_KEY
|
|
471
|
-
* ```
|
|
472
|
-
* @default `false`
|
|
473
|
-
*/
|
|
474
|
-
inDocker?: boolean;
|
|
475
|
-
/**
|
|
476
|
-
* The output quality of the qr code during authentication. This can be any increment of 0.1 from 0.1 to 1.0.
|
|
477
|
-
* @default `1.0`
|
|
478
|
-
*/
|
|
479
|
-
qrQuality?: QRQuality;
|
|
480
|
-
/**
|
|
481
|
-
* The output format of the qr code. `png`, `jpeg` or `webm`.
|
|
482
|
-
*
|
|
483
|
-
* @default `png`
|
|
484
|
-
*/
|
|
485
|
-
qrFormat?: QRFormat;
|
|
486
|
-
/**
|
|
487
|
-
* The language of the host notification. See: https://github.com/open-wa/wa-automate-nodejs/issues/709#issuecomment-673419088
|
|
488
|
-
*/
|
|
489
|
-
hostNotificationLang?: NotificationLanguage;
|
|
490
|
-
/**
|
|
491
|
-
* Setting this to true will block all assets from loading onto the page. This may result in some load time improvements but also increases instability.
|
|
492
|
-
* @default `false`
|
|
493
|
-
*/
|
|
494
|
-
blockAssets?: boolean;
|
|
495
|
-
/**
|
|
496
|
-
* [ALPHA FEATURE - ONLY IMPLEMENTED FOR TESTING - DO NOT USE IN PRODUCTION YET]
|
|
497
|
-
* Setting this to true will result in the library making sure it is always starting with the latest version of itself. This overrides `skipUpdateCheck`.
|
|
498
|
-
* @default `false`
|
|
499
|
-
*/
|
|
500
|
-
keepUpdated?: boolean;
|
|
501
|
-
/**
|
|
502
|
-
* Syncs the viewport size with the window size which is how normal browsers act. Only relevant when `headless: false` and this overrides `viewport` config.
|
|
503
|
-
* @default `true`
|
|
504
|
-
*/
|
|
505
|
-
resizable?: boolean;
|
|
506
|
-
/**
|
|
507
|
-
* Set the desired viewport height and width. For CLI, use [width]x[height] format. E.g `--viewport 1920x1080`.
|
|
508
|
-
*/
|
|
509
|
-
viewport?: {
|
|
510
|
-
/**
|
|
511
|
-
* Page width in pixels
|
|
512
|
-
* @default `1440`
|
|
513
|
-
*/
|
|
514
|
-
width?: number;
|
|
515
|
-
/**
|
|
516
|
-
* Page height in pixels
|
|
517
|
-
* @default `900`
|
|
518
|
-
*/
|
|
519
|
-
height?: number;
|
|
520
|
-
};
|
|
521
|
-
/**
|
|
522
|
-
* As the library is constantly evolving, some parts will be replaced with more efficient and improved code. In some of the infinite edge cases these new changes may not work for you. Set this to true to roll back on 'late beta' features. The reason why legacy is false by default is that in order for features to be tested they have to be released and used by everyone to find the edge cases and fix them.
|
|
523
|
-
* @default `false`
|
|
524
|
-
*/
|
|
525
|
-
legacy?: boolean;
|
|
526
|
-
/**
|
|
527
|
-
* Deletes the session data file (if found) on logout event. This results in a quicker login when you restart the process.
|
|
528
|
-
* @default `false`
|
|
529
|
-
*/
|
|
530
|
-
deleteSessionDataOnLogout?: boolean;
|
|
531
|
-
/**
|
|
532
|
-
* If set to true, the system will kill the whole node process when either an [[authTimeout]] or a [[qrTimeout]] has been reached. This is useful to prevent hanging processes.
|
|
533
|
-
* @default `false`
|
|
534
|
-
*/
|
|
535
|
-
killProcessOnTimeout?: boolean;
|
|
536
|
-
/**
|
|
537
|
-
* If set to true, the system will kill the whole node process when a "TEMPORARY BAN" is detected. This is useful to prevent hanging processes.
|
|
538
|
-
* It is `true` by default because it is a very rare event and it is better to kill the process than to leave it hanging.
|
|
539
|
-
* @default `true`
|
|
540
|
-
*/
|
|
541
|
-
killProcessOnBan?: boolean;
|
|
542
|
-
/**
|
|
543
|
-
* Setting this to true will bypass web security. DO NOT DO THIS IF YOU DO NOT HAVE TO. CORS issue may arise when using a proxy.
|
|
544
|
-
* @default `false`
|
|
545
|
-
*/
|
|
546
|
-
corsFix?: boolean;
|
|
547
|
-
/**
|
|
548
|
-
* Amount of time (in ms) to wait for a client method (specifically methods that interact with the WA web session) to resolve. If a client method results takes longer than the timout value then it will result in a [[PageEvaluationTimeout]] error.
|
|
549
|
-
*
|
|
550
|
-
* If you get this error, it does not automatically mean that the method failed - it just stops your program from waiting for a client method to resolve.
|
|
551
|
-
*
|
|
552
|
-
* This is useful if you do not rely on the results of a client method (e.g the message ID).
|
|
553
|
-
*
|
|
554
|
-
* If set to `0`, the process will wait indefinitely for a client method to resolve.
|
|
555
|
-
* @default 0
|
|
556
|
-
*/
|
|
557
|
-
callTimeout?: number;
|
|
558
|
-
/**
|
|
559
|
-
* When true, this option will take a screenshot of the browser when an unexpected error occurs within the browser during `create` initialization. The path will be `[working directory]/logs/[session ID]/[start timestamp]/[timestamp].jpg`
|
|
560
|
-
* @default `false`
|
|
561
|
-
*/
|
|
562
|
-
screenshotOnInitializationBrowserError?: boolean;
|
|
563
|
-
/**
|
|
564
|
-
* Setting listeners may not be your cup of tea. With eventMode, all [[SimpleListener]] events will be registered automatically and be filed via the built in Events Listener.
|
|
565
|
-
*
|
|
566
|
-
* This is useful because you can register/deregister the event listener as needed whereas the legacy method of setting callbacks are only be set once
|
|
567
|
-
*
|
|
568
|
-
* @default `true`;
|
|
569
|
-
*/
|
|
570
|
-
eventMode?: boolean;
|
|
571
|
-
/**
|
|
572
|
-
* If true, the system will automatically create a log of all processes relating to actions sent to the web session.
|
|
573
|
-
*
|
|
574
|
-
* The location of the file will be relative to the process directory (pd)
|
|
575
|
-
*
|
|
576
|
-
* `[pd]/[sessionId]/[start timestamp].log`
|
|
577
|
-
* @default false
|
|
578
|
-
*/
|
|
579
|
-
logFile?: boolean;
|
|
580
|
-
/**
|
|
581
|
-
* When true, the system will attempt to correct chatIds and groupChatIds. This means you can ignore `@c.us` and `@g.us` distinctions in some parameters.
|
|
582
|
-
* @default false
|
|
583
|
-
*/
|
|
584
|
-
idCorrection?: boolean;
|
|
585
|
-
/**
|
|
586
|
-
*
|
|
587
|
-
* Redundant until self-hostable sticker server is available.
|
|
588
|
-
*
|
|
589
|
-
* @default `https://sticker-api.openwa.dev`
|
|
590
|
-
*/
|
|
591
|
-
stickerServerEndpoint?: string | boolean;
|
|
592
|
-
/**
|
|
593
|
-
* 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.
|
|
594
|
-
* @default `false`
|
|
595
|
-
*/
|
|
596
|
-
ghPatch?: boolean;
|
|
597
|
-
/**
|
|
598
|
-
* 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.
|
|
599
|
-
* @default `false`
|
|
600
|
-
*/
|
|
601
|
-
cachedPatch?: boolean;
|
|
602
|
-
/**
|
|
603
|
-
* 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`.
|
|
604
|
-
* @default `false`
|
|
605
|
-
*/
|
|
606
|
-
logDebugInfoAsObject?: boolean;
|
|
607
|
-
/**
|
|
608
|
-
* This will make the library log all internal wa web events to the console. This is useful for debugging purposes. DO NOT TURN THIS ON UNLESS ASKED TO.
|
|
609
|
-
*/
|
|
610
|
-
logInternalEvents?: boolean;
|
|
611
|
-
/**
|
|
612
|
-
* Kill the client when a logout is detected
|
|
613
|
-
* @default `false`
|
|
614
|
-
*/
|
|
615
|
-
killClientOnLogout?: boolean;
|
|
616
|
-
/**
|
|
617
|
-
* This will make the `create` command return `false` if the detected session data is expired.
|
|
618
|
-
*
|
|
619
|
-
* This will mean, the process will not attempt to automatically get a new QR code.
|
|
620
|
-
*
|
|
621
|
-
* @default `false`
|
|
622
|
-
*/
|
|
623
|
-
throwOnExpiredSessionData?: boolean;
|
|
624
|
-
/**
|
|
625
|
-
* Some sessions may experience issues with sending media when using proxies. Using the native proxy system instead of the recommended 3rd party library may fix these issues.
|
|
626
|
-
*
|
|
627
|
-
* @default `false`
|
|
628
|
-
*/
|
|
629
|
-
useNativeProxy?: boolean;
|
|
630
|
-
/**
|
|
631
|
-
* Set this to `true` to make the library work on Raspberry Pi OS.
|
|
632
|
-
*
|
|
633
|
-
* Make sure to run the following command before running the library the first time:
|
|
634
|
-
*
|
|
635
|
-
* ```
|
|
636
|
-
* > sudo apt update -y && sudo apt install chromium-browser chromium-codecs-ffmpeg -y && sudo apt upgrade
|
|
637
|
-
* ```
|
|
638
|
-
*
|
|
639
|
-
* If you're using the CLI, you can set this value to `true` by adding the following flag to the CLI command
|
|
640
|
-
*
|
|
641
|
-
* ```
|
|
642
|
-
* > npx @open-wa/wa-automate ... --raspi
|
|
643
|
-
* ```
|
|
644
|
-
*
|
|
645
|
-
* @default `false`
|
|
646
|
-
*/
|
|
647
|
-
raspi?: boolean;
|
|
648
|
-
/**
|
|
649
|
-
* Default pqueue options applied to all listeners that can take pqueue options as a second optional parameter. For now, this only includes `onMessage` and `onAnyMessage`.
|
|
650
|
-
*
|
|
651
|
-
* See: https://github.com/sindresorhus/p-queue#options
|
|
652
|
-
*
|
|
653
|
-
* Example: process 5 events within every 3 seconds window. Make sure to only process at most 2 at any one time. Make sure there is at least 100ms between each event processing.
|
|
654
|
-
*
|
|
655
|
-
* ```javascript
|
|
656
|
-
* {
|
|
657
|
-
* intervalCap: 5, //process 5 events
|
|
658
|
-
* interval: 3000, //within every three second window
|
|
659
|
-
* concurrency: 2, //make sure to process, at most, 2 events at any one time
|
|
660
|
-
* timeout: 100, //make sure there is a 100ms gap between each event processing.
|
|
661
|
-
* carryoverConcurrencyCount: true //If there are more than 5 events in that period, process them within the next 3 second period. Make sure this is always set to true!!!
|
|
662
|
-
* }
|
|
663
|
-
* ```
|
|
664
|
-
*
|
|
665
|
-
* @default `undefined`
|
|
666
|
-
*/
|
|
667
|
-
pQueueDefault?: any;
|
|
668
|
-
/**
|
|
669
|
-
* Set a preprocessor, or multiple chained preprocessors, for messages. See [MPConfigType](/) for more info.
|
|
670
|
-
*
|
|
671
|
-
* options: `SCRUB`, `BODY_ONLY`, `AUTO_DECRYPT`, `AUTO_DECRYPT_SAVE`, `UPLOAD_CLOUD`.
|
|
672
|
-
* @default `undefined`
|
|
673
|
-
*/
|
|
674
|
-
messagePreprocessor?: any;
|
|
675
|
-
/**
|
|
676
|
-
* Set an array filter to be used with messagePreprocessor to limit which messages are preprocessed.
|
|
677
|
-
*
|
|
678
|
-
* E.g if you want to scrub all messages that are not from a group, you can do the following:
|
|
679
|
-
* `"m=>!m.isGroupMsg"`
|
|
680
|
-
*
|
|
681
|
-
* @default `undefined`
|
|
682
|
-
*/
|
|
683
|
-
preprocFilter?: string;
|
|
684
|
-
/**
|
|
685
|
-
* REQUIRED IF `messagePreprocessor` IS SET TO `UPLOAD_CLOUD`.
|
|
686
|
-
*
|
|
687
|
-
* This can be set via the config or the corresponding environment variables.
|
|
688
|
-
*/
|
|
689
|
-
cloudUploadOptions?: {
|
|
690
|
-
/**
|
|
691
|
-
* `AWS`, `GCP` or `WASABI`
|
|
692
|
-
*
|
|
693
|
-
* env: `OW_CLOUD_ACCESS_KEY_ID`
|
|
694
|
-
*/
|
|
695
|
-
provider: CLOUD_PROVIDERS;
|
|
696
|
-
/**
|
|
697
|
-
* S3 compatible access key ID.
|
|
698
|
-
*
|
|
699
|
-
* e.g: `AKIAIOSFODNN7EXAMPLE` or `GOOGTS7C7FUP3AIRVJTE2BCD`
|
|
700
|
-
*
|
|
701
|
-
* env: `OW_CLOUD_ACCESS_KEY_ID`
|
|
702
|
-
*/
|
|
703
|
-
accessKeyId: string;
|
|
704
|
-
/**
|
|
705
|
-
* S3 compatible secret access key.
|
|
706
|
-
*
|
|
707
|
-
* e.g `wJalrXUtnFEMI/K7MDENG/bPxRfiCYEXAMPLEKEY`
|
|
708
|
-
*
|
|
709
|
-
* env: `OW_CLOUD_SECRET_ACCESS_KEY`
|
|
710
|
-
*/
|
|
711
|
-
secretAccessKey: string;
|
|
712
|
-
/**
|
|
713
|
-
* Bucket name
|
|
714
|
-
*
|
|
715
|
-
* env: `OW_CLOUD_BUCKET`
|
|
716
|
-
*/
|
|
717
|
-
bucket: string;
|
|
718
|
-
/**
|
|
719
|
-
* Bucket region.
|
|
720
|
-
*
|
|
721
|
-
* Not required for `GCP` provider
|
|
722
|
-
*
|
|
723
|
-
* env: `OW_CLOUD_REGION`
|
|
724
|
-
*
|
|
725
|
-
*/
|
|
726
|
-
region?: string;
|
|
727
|
-
/**
|
|
728
|
-
* Ignore processing of messages that are sent by the host account itself
|
|
729
|
-
*
|
|
730
|
-
* env: `OW_CLOUD_IGNORE_HOST`
|
|
731
|
-
*/
|
|
732
|
-
ignoreHostAccount?: boolean;
|
|
733
|
-
/**
|
|
734
|
-
* The directory strategy to use when uploading files. Or just set it to a custom directory string.
|
|
735
|
-
*
|
|
736
|
-
* env: `OW_DIRECTORY`
|
|
737
|
-
*/
|
|
738
|
-
directory?: DIRECTORY_STRATEGY | string;
|
|
739
|
-
/**
|
|
740
|
-
* Setting this to true will make the uploaded file public
|
|
741
|
-
*/
|
|
742
|
-
public?: boolean;
|
|
743
|
-
/**
|
|
744
|
-
* Extra headers to add to the upload request
|
|
745
|
-
*/
|
|
746
|
-
headers?: {
|
|
747
|
-
[k: string]: string;
|
|
748
|
-
};
|
|
749
|
-
};
|
|
750
|
-
/**
|
|
751
|
-
* What to do when an error is detected on a client method.
|
|
752
|
-
*
|
|
753
|
-
* @default `OnError.NOTHING`
|
|
754
|
-
*/
|
|
755
|
-
onError?: OnError;
|
|
756
|
-
/**
|
|
757
|
-
*
|
|
758
|
-
* Please note that multi-device is still in beta so a lot of things may not work. It is HIGHLY suggested to NOT use this in production!!!!
|
|
759
|
-
*
|
|
760
|
-
* Set this to true if you're using the multidevice beta.
|
|
761
|
-
*
|
|
762
|
-
* @default `true`
|
|
763
|
-
* :::danger
|
|
764
|
-
* Some features (e.g [[sendLinkWithAutoPreview]]) **do not** work with multi-device beta. Check [this `api`](#).
|
|
765
|
-
* :::
|
|
766
|
-
*/
|
|
767
|
-
multiDevice?: boolean;
|
|
768
|
-
/**
|
|
769
|
-
* Base64 encoded S3 Bucket & Authentication object for session data files. The object should be in the same format as cloudUploadOptions.
|
|
770
|
-
*/
|
|
771
|
-
sessionDataBucketAuth?: string;
|
|
772
|
-
/**
|
|
773
|
-
* Set the automatic emoji detection character. Set this to `false` to disable auto emoji. Default is `:`.
|
|
774
|
-
*
|
|
775
|
-
* @default `:`
|
|
776
|
-
*/
|
|
777
|
-
autoEmoji?: string | false;
|
|
778
|
-
/**
|
|
779
|
-
* Set the maximum amount of chats to be present in a session.
|
|
780
|
-
*/
|
|
781
|
-
maxChats?: number;
|
|
782
|
-
/**
|
|
783
|
-
* Set the maximum amount of messages to be present in a session.
|
|
784
|
-
*/
|
|
785
|
-
maxMessages?: number;
|
|
786
|
-
/**
|
|
787
|
-
* Your Discord ID to get onto the sticker leaderboard!
|
|
788
|
-
*/
|
|
789
|
-
discord?: string;
|
|
790
|
-
/**
|
|
791
|
-
* Don't implicitly determine if the host logged out.
|
|
792
|
-
*/
|
|
793
|
-
ignoreNuke?: boolean;
|
|
794
|
-
/**
|
|
795
|
-
* Makes sure the headless session is usable even on first login.
|
|
796
|
-
* Headful sessions are ususally only usable on reauthentication.
|
|
797
|
-
*/
|
|
798
|
-
ensureHeadfulIntegrity?: boolean;
|
|
799
|
-
/**
|
|
800
|
-
* wait for a valid headful session. Not required in recent versions.
|
|
801
|
-
* default: `true`
|
|
802
|
-
*/
|
|
803
|
-
waitForRipeSession?: boolean;
|
|
804
|
-
/**
|
|
805
|
-
* Automatically kill the process after a set amount of qr codes
|
|
806
|
-
*/
|
|
807
|
-
qrMax?: number;
|
|
808
|
-
/**
|
|
809
|
-
* Expose a URL where you can easily scan the qr code
|
|
810
|
-
*/
|
|
811
|
-
ezqr?: boolean;
|
|
812
|
-
/**
|
|
813
|
-
* An array of [winston](https://github.com/winstonjs/winston/blob/master/docs/transports.md#additional-transports) logging transport configurations.
|
|
814
|
-
*
|
|
815
|
-
* [Check this discussion to see how to set up logging](https://github.com/open-wa/wa-automate-nodejs/discussions/2373)
|
|
816
|
-
*/
|
|
817
|
-
logging?: ConfigLogTransport[];
|
|
818
|
-
/**
|
|
819
|
-
* The URL of your instance of [serverless meta grabber](https://github.com/RemiixInc/meta-grabber-serverless) by [RemiixInc](https://github.com/RemiixInc).
|
|
820
|
-
*
|
|
821
|
-
* default: `https://link.openwa.cloud/api`
|
|
822
|
-
*/
|
|
823
|
-
linkParser?: string;
|
|
824
|
-
/**
|
|
825
|
-
* Setting this to true will run `gc()` on before every command sent to the browser.
|
|
826
|
-
*
|
|
827
|
-
* This is experimental and may not work or it may have unforeseen sideeffects.
|
|
828
|
-
*/
|
|
829
|
-
aggressiveGarbageCollection?: boolean;
|
|
830
|
-
/**@internal */
|
|
831
|
-
[x: string]: any;
|
|
832
|
-
}
|
|
833
|
-
export type AdvancedConfig = ConfigObject & {
|
|
834
|
-
licenseKey: LicenseKeyConfig;
|
|
835
|
-
};
|
|
836
|
-
export {};
|