@open-wa/wa-automate 4.30.10 → 4.31.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.
- package/README.md +3 -3
- package/bin/config-schema.json +1 -1
- package/dist/api/Client.d.ts +28 -40
- package/dist/api/Client.js +30 -43
- package/dist/api/model/aliases.d.ts +10 -6
- package/dist/api/model/aliases.js +1 -0
- package/dist/api/model/config.d.ts +4 -1
- package/dist/api/model/index.d.ts +1 -0
- package/dist/api/model/index.js +1 -0
- package/dist/api/model/product.d.ts +1 -1
- package/dist/cli/cli-options.d.ts +9 -0
- package/dist/cli/cli-options.js +229 -0
- package/dist/cli/setup.d.ts +1 -1
- package/dist/cli/setup.js +7 -232
- package/dist/controllers/auth.d.ts +5 -1
- package/dist/controllers/auth.js +26 -9
- package/dist/controllers/browser.js +72 -11
- package/dist/controllers/initializer.js +3 -1
- package/dist/controllers/patch_manager.js +3 -1
- package/dist/controllers/script_preloader.d.ts +17 -0
- package/dist/controllers/script_preloader.js +83 -0
- package/dist/lib/wapi.js +3 -3
- package/package.json +13 -13
package/dist/api/Client.js
CHANGED
@@ -257,7 +257,7 @@ class Client {
|
|
257
257
|
const emojiId = message.body.replace(new RegExp(ident, 'g'), "");
|
258
258
|
if (!emojiId)
|
259
259
|
return;
|
260
|
-
return yield this.sendEmoji(message.from, emojiId, message.id);
|
260
|
+
return yield this.sendEmoji(message.from, emojiId, message.id).catch(() => { });
|
261
261
|
}
|
262
262
|
}));
|
263
263
|
this._autoEmojiSet = true;
|
@@ -303,7 +303,7 @@ class Client {
|
|
303
303
|
}
|
304
304
|
_reInjectWapi(newTab) {
|
305
305
|
return __awaiter(this, void 0, void 0, function* () {
|
306
|
-
yield (0, browser_1.injectApi)(newTab || this._page);
|
306
|
+
yield (0, browser_1.injectApi)(newTab || this._page, null, true);
|
307
307
|
});
|
308
308
|
}
|
309
309
|
_reRegisterListeners() {
|
@@ -315,7 +315,7 @@ class Client {
|
|
315
315
|
* A convinience method to download the [[DataURL]] of a file
|
316
316
|
* @param url The url
|
317
317
|
* @param optionsOverride You can use this to override the [axios request config](https://github.com/axios/axios#request-config)
|
318
|
-
* @returns Promise<DataURL
|
318
|
+
* @returns `Promise<DataURL>`
|
319
319
|
*/
|
320
320
|
download(url, optionsOverride = {}) {
|
321
321
|
return __awaiter(this, void 0, void 0, function* () {
|
@@ -364,7 +364,6 @@ class Client {
|
|
364
364
|
/**
|
365
365
|
* Wait for the new page to be loaded up before closing existing page
|
366
366
|
*/
|
367
|
-
yield (0, patch_manager_1.earlyInjectionCheck)(newTab);
|
368
367
|
spinner.info("Checking if fresh session is authenticated...");
|
369
368
|
if (yield (0, auth_1.isAuthenticated)(newTab)) {
|
370
369
|
/**
|
@@ -813,7 +812,8 @@ class Client {
|
|
813
812
|
*
|
814
813
|
* Here is an example of the fired object:
|
815
814
|
*
|
816
|
-
* @fires
|
815
|
+
* @fires
|
816
|
+
* ```javascript
|
817
817
|
* {
|
818
818
|
* "chat": "00000000000-1111111111@g.us", //the chat in which this state is occuring
|
819
819
|
* "user": "22222222222@c.us", //the user that is causing this state
|
@@ -931,7 +931,7 @@ class Client {
|
|
931
931
|
* @param chatId the chat from which you want to subscribes to live location updates
|
932
932
|
* @param fn callback that takes in a LiveLocationChangedEvent
|
933
933
|
* @returns boolean, if returns false then there were no valid live locations in the chat of chatId
|
934
|
-
* @emits
|
934
|
+
* @emits `<LiveLocationChangedEvent>` LiveLocationChangedEvent
|
935
935
|
*/
|
936
936
|
onLiveLocation(chatId, fn) {
|
937
937
|
return __awaiter(this, void 0, void 0, function* () {
|
@@ -1148,7 +1148,7 @@ class Client {
|
|
1148
1148
|
* A list of participants in the chat who have their live location on. If the chat does not exist, or the chat does not have any contacts actively sharing their live locations, it will return false. If it's a chat with a single contact, there will be only 1 value in the array if the contact has their livelocation on.
|
1149
1149
|
* Please note. This should only be called once every 30 or so seconds. This forces the phone to grab the latest live location data for the number. This can be used in conjunction with onLiveLocation (this will trigger onLiveLocation).
|
1150
1150
|
* @param chatId string Id of the chat you want to force the phone to get the livelocation data for.
|
1151
|
-
* @returns Promise<LiveLocationChangedEvent []
|
1151
|
+
* @returns `Promise<LiveLocationChangedEvent []>` | boolean
|
1152
1152
|
*/
|
1153
1153
|
forceUpdateLiveLocation(chatId) {
|
1154
1154
|
return __awaiter(this, void 0, void 0, function* () {
|
@@ -1266,6 +1266,8 @@ class Client {
|
|
1266
1266
|
});
|
1267
1267
|
}
|
1268
1268
|
/**
|
1269
|
+
* {@license:insiders@}
|
1270
|
+
* <span theme="badge contrast license">Insiders</span>
|
1269
1271
|
* [REQUIRES AN INSIDERS LICENSE-KEY](https://gum.co/open-wa?tier=Insiders%20Program)
|
1270
1272
|
*
|
1271
1273
|
* Send a list message. This will not work when being sent from business accounts!
|
@@ -1310,7 +1312,7 @@ class Client {
|
|
1310
1312
|
* @param groupId group chat id: `xxxxx@g.us`
|
1311
1313
|
* @param content text message to add under all of the tags
|
1312
1314
|
* @param hideTags Removes all tags within the message
|
1313
|
-
* @returns Promise<MessageId
|
1315
|
+
* @returns `Promise<MessageId>`
|
1314
1316
|
*/
|
1315
1317
|
tagEveryone(groupId, content, hideTags) {
|
1316
1318
|
return __awaiter(this, void 0, void 0, function* () {
|
@@ -1367,7 +1369,7 @@ class Client {
|
|
1367
1369
|
/**
|
1368
1370
|
* Decrypts a media message.
|
1369
1371
|
* @param message This can be the serialized [[MessageId]] or the whole [[Message]] object. It is advised to just use the serialized message ID.
|
1370
|
-
* @returns Promise<[[DataURL]]
|
1372
|
+
* @returns `Promise<[[DataURL]]>`
|
1371
1373
|
*/
|
1372
1374
|
decryptMedia(message) {
|
1373
1375
|
return __awaiter(this, void 0, void 0, function* () {
|
@@ -1398,7 +1400,7 @@ class Client {
|
|
1398
1400
|
* @param caption string xxxxx
|
1399
1401
|
* @param waitForKey boolean default: false set this to true if you want to wait for the id of the message. By default this is set to false as it will take a few seconds to retrieve to the key of the message and this waiting may not be desirable for the majority of users.
|
1400
1402
|
* @param hideTags boolean default: false [INSIDERS] set this to try silent tag someone in the caption
|
1401
|
-
* @returns Promise <boolean | string
|
1403
|
+
* @returns `Promise <boolean | string>` This will either return true or the id of the message. It will return true after 10 seconds even if waitForId is true
|
1402
1404
|
*/
|
1403
1405
|
sendImage(to, file, filename, caption, quotedMsgId, waitForId, ptt, withoutPreview, hideTags, viewOnce) {
|
1404
1406
|
return __awaiter(this, void 0, void 0, function* () {
|
@@ -1462,7 +1464,7 @@ class Client {
|
|
1462
1464
|
* @param content string reply text
|
1463
1465
|
* @param quotedMsgId string the msg id to reply to.
|
1464
1466
|
* @param sendSeen boolean If set to true, the chat will 'blue tick' all messages before sending the reply
|
1465
|
-
* @returns Promise<MessageId | false
|
1467
|
+
* @returns `Promise<MessageId | false>` false if didn't work, otherwise returns message id.
|
1466
1468
|
*/
|
1467
1469
|
reply(to, content, quotedMsgId, sendSeen) {
|
1468
1470
|
return __awaiter(this, void 0, void 0, function* () {
|
@@ -1479,7 +1481,7 @@ class Client {
|
|
1479
1481
|
* This will only work if you have chats sent back and forth between you and the contact 1-1.
|
1480
1482
|
*
|
1481
1483
|
* @param contactId The Id of the contact with which you have an existing conversation with messages already.
|
1482
|
-
* @returns Promise<string | boolean
|
1484
|
+
* @returns `Promise<string | boolean>` true or false or a string with an explaintaion of why it wasn't able to determine the read receipts.
|
1483
1485
|
*
|
1484
1486
|
*/
|
1485
1487
|
checkReadReceipts(contactId) {
|
@@ -1504,7 +1506,7 @@ class Client {
|
|
1504
1506
|
* @param ptt boolean default: false set this to true if you want to send the file as a push to talk file.
|
1505
1507
|
* @param withoutPreview boolean default: false set this to true if you want to send the file without a preview (i.e as a file). This is useful for preventing auto downloads on recipient devices.
|
1506
1508
|
* @param hideTags boolean default: false [INSIDERS] set this to try silent tag someone in the caption
|
1507
|
-
* @returns Promise <boolean | MessageId
|
1509
|
+
* @returns `Promise <boolean | MessageId>` This will either return true or the id of the message. It will return true after 10 seconds even if waitForId is true
|
1508
1510
|
*/
|
1509
1511
|
sendFile(to, file, filename, caption, quotedMsgId, waitForId, ptt, withoutPreview, hideTags, viewOnce) {
|
1510
1512
|
return __awaiter(this, void 0, void 0, function* () {
|
@@ -1516,7 +1518,7 @@ class Client {
|
|
1516
1518
|
*
|
1517
1519
|
* Checks whether or not the group id provided is known to be unsafe by the contributors of the library.
|
1518
1520
|
* @param groupChatId The group chat you want to deteremine is unsafe
|
1519
|
-
* @returns Promise <boolean | string
|
1521
|
+
* @returns `Promise <boolean | string>` This will either return a boolean indiciating whether this group chat id is considered unsafe or an error message as a string
|
1520
1522
|
*/
|
1521
1523
|
isGroupIdUnsafe(groupChatId) {
|
1522
1524
|
return __awaiter(this, void 0, void 0, function* () {
|
@@ -1535,7 +1537,7 @@ class Client {
|
|
1535
1537
|
* @param to chat id `xxxxx@c.us`
|
1536
1538
|
* @param file base64 data:image/xxx;base64,xxx or the path of the file you want to send.
|
1537
1539
|
* @param quotedMsgId string true_0000000000@c.us_JHB2HB23HJ4B234HJB to send as a reply to a message
|
1538
|
-
* @returns Promise <boolean | string
|
1540
|
+
* @returns `Promise <boolean | string>` This will either return true or the id of the message. It will return true after 10 seconds even if waitForId is true
|
1539
1541
|
*/
|
1540
1542
|
sendPtt(to, file, quotedMsgId) {
|
1541
1543
|
return __awaiter(this, void 0, void 0, function* () {
|
@@ -1635,7 +1637,7 @@ class Client {
|
|
1635
1637
|
}
|
1636
1638
|
/**
|
1637
1639
|
* Returns a PNG DataURL screenshot of the session
|
1638
|
-
* @returns Promise<DataURL
|
1640
|
+
* @returns `Promise<DataURL>`
|
1639
1641
|
*/
|
1640
1642
|
getSnapshot() {
|
1641
1643
|
return __awaiter(this, void 0, void 0, function* () {
|
@@ -1825,7 +1827,7 @@ class Client {
|
|
1825
1827
|
* Any potential abuse of this method will see it become paywalled.
|
1826
1828
|
* @param to: Chat id to forward the message to
|
1827
1829
|
* @param messageId: message id of the message to forward. Please note that if it is not loaded, this will return false - even if it exists.
|
1828
|
-
* @returns Promise<MessageId | boolean
|
1830
|
+
* @returns `Promise<MessageId | boolean>`
|
1829
1831
|
*/
|
1830
1832
|
ghostForward(to, messageId) {
|
1831
1833
|
return __awaiter(this, void 0, void 0, function* () {
|
@@ -1944,7 +1946,7 @@ class Client {
|
|
1944
1946
|
}
|
1945
1947
|
/**
|
1946
1948
|
* retrieves an array of IDs of accounts blocked by the host account.
|
1947
|
-
* @returns Promise<ChatId[]
|
1949
|
+
* @returns `Promise<ChatId[]>`
|
1948
1950
|
*/
|
1949
1951
|
getBlockedIds() {
|
1950
1952
|
return __awaiter(this, void 0, void 0, function* () {
|
@@ -2011,7 +2013,7 @@ class Client {
|
|
2011
2013
|
* @param returnChatObj boolean When this is set to true and if the group was joined successfully, it will return a serialzed Chat object which includes group information and metadata. This is useful when you want to immediately do something with group metadata.
|
2012
2014
|
*
|
2013
2015
|
*
|
2014
|
-
* @returns Promise<string | boolean | number
|
2016
|
+
* @returns `Promise<string | boolean | number>` Either false if it didn't work, or the group id.
|
2015
2017
|
*/
|
2016
2018
|
joinGroupViaLink(link, returnChatObj) {
|
2017
2019
|
return __awaiter(this, void 0, void 0, function* () {
|
@@ -2407,7 +2409,7 @@ class Client {
|
|
2407
2409
|
/**
|
2408
2410
|
* Retrieves an invite link for a group chat. returns false if chat is not a group.
|
2409
2411
|
* @param chatId
|
2410
|
-
* @returns Promise<string
|
2412
|
+
* @returns `Promise<string>`
|
2411
2413
|
*/
|
2412
2414
|
getGroupInviteLink(chatId) {
|
2413
2415
|
return __awaiter(this, void 0, void 0, function* () {
|
@@ -2427,7 +2429,7 @@ class Client {
|
|
2427
2429
|
/**
|
2428
2430
|
* Revokes the current invite link for a group chat. Any previous links will stop working
|
2429
2431
|
* @param chatId
|
2430
|
-
* @returns Promise<boolean
|
2432
|
+
* @returns `Promise<boolean>`
|
2431
2433
|
*/
|
2432
2434
|
revokeGroupInviteLink(chatId) {
|
2433
2435
|
return __awaiter(this, void 0, void 0, function* () {
|
@@ -2542,21 +2544,6 @@ class Client {
|
|
2542
2544
|
*
|
2543
2545
|
* @param groupName group name: 'New group'
|
2544
2546
|
* @param contacts: A single contact id or an array of contact ids.
|
2545
|
-
* @returns Promise<GroupCreationResponse> :
|
2546
|
-
* ```javascript
|
2547
|
-
* {
|
2548
|
-
* status: 200,
|
2549
|
-
* gid: {
|
2550
|
-
* server: 'g.us',
|
2551
|
-
* user: '447777777777-1583678870',
|
2552
|
-
* _serialized: '447777777777-1583678870@g.us'
|
2553
|
-
* },
|
2554
|
-
* participants: [
|
2555
|
-
* { '447777777777@c.us': [Object] },
|
2556
|
-
* { '447444444444@c.us': [Object] }
|
2557
|
-
* ]
|
2558
|
-
* }
|
2559
|
-
* ```
|
2560
2547
|
*/
|
2561
2548
|
createGroup(groupName, contacts) {
|
2562
2549
|
return __awaiter(this, void 0, void 0, function* () {
|
@@ -2791,7 +2778,7 @@ class Client {
|
|
2791
2778
|
* @param url: The url of the image
|
2792
2779
|
* @param requestConfig {} By default the request is a get request, however you can override that and many other options by sending this parameter. You can read more about this parameter here: https://github.com/axios/axios#request-config
|
2793
2780
|
*
|
2794
|
-
* @returns Promise<MessageId | boolean
|
2781
|
+
* @returns `Promise<MessageId | boolean>`
|
2795
2782
|
*/
|
2796
2783
|
sendStickerfromUrl(to, url, requestConfig = {}, stickerMetadata) {
|
2797
2784
|
return __awaiter(this, void 0, void 0, function* () {
|
@@ -2808,7 +2795,7 @@ class Client {
|
|
2808
2795
|
* @param messageId The id of the message to reply to
|
2809
2796
|
* @param requestConfig {} By default the request is a get request, however you can override that and many other options by sending this parameter. You can read more about this parameter here: https://github.com/axios/axios#request-config
|
2810
2797
|
*
|
2811
|
-
* @returns Promise<MessageId | boolean
|
2798
|
+
* @returns `Promise<MessageId | boolean>`
|
2812
2799
|
*/
|
2813
2800
|
sendStickerfromUrlAsReply(to, url, messageId, requestConfig = {}, stickerMetadata) {
|
2814
2801
|
return __awaiter(this, void 0, void 0, function* () {
|
@@ -3096,7 +3083,7 @@ class Client {
|
|
3096
3083
|
* Turn the ephemeral setting in a chat to on or off
|
3097
3084
|
* @param chatId The ID of the chat
|
3098
3085
|
* @param ephemeral `true` to turn on the ephemeral setting, `false` to turn off the ephemeral setting. Please note, if the setting is already on the requested setting, this method will return `true`.
|
3099
|
-
* @returns Promise<boolean
|
3086
|
+
* @returns `Promise<boolean>` true if the setting was set, `false` if the chat does not exist
|
3100
3087
|
*/
|
3101
3088
|
setChatEphemeral(chatId, ephemeral) {
|
3102
3089
|
return __awaiter(this, void 0, void 0, function* () {
|
@@ -3127,7 +3114,7 @@ class Client {
|
|
3127
3114
|
* 3: [Bryndan Write](https://www.dafontfree.net/freefonts-bryndan-write-f160189.htm)
|
3128
3115
|
* 4: [Bebasneue Regular](https://www.dafont.com/bebas-neue.font)
|
3129
3116
|
* 5: [Oswald Heavy](https://www.fontsquirrel.com/fonts/oswald)
|
3130
|
-
* @returns Promise<string | boolean
|
3117
|
+
* @returns `Promise<string | boolean>` returns status id if it worked, false if it didn't
|
3131
3118
|
*/
|
3132
3119
|
postTextStatus(text, textRgba, backgroundRgba, font) {
|
3133
3120
|
return __awaiter(this, void 0, void 0, function* () {
|
@@ -3140,7 +3127,7 @@ class Client {
|
|
3140
3127
|
* Posts an image story.
|
3141
3128
|
* @param data data url string `data:[<MIME-type>][;charset=<encoding>][;base64],<data>`
|
3142
3129
|
* @param caption The caption for the story
|
3143
|
-
* @returns Promise<string | boolean
|
3130
|
+
* @returns `Promise<string | boolean>` returns status id if it worked, false if it didn't
|
3144
3131
|
*/
|
3145
3132
|
postImageStatus(data, caption) {
|
3146
3133
|
return __awaiter(this, void 0, void 0, function* () {
|
@@ -3153,7 +3140,7 @@ class Client {
|
|
3153
3140
|
* Posts a video story.
|
3154
3141
|
* @param data data url string `data:[<MIME-type>][;charset=<encoding>][;base64],<data>`
|
3155
3142
|
* @param caption The caption for the story
|
3156
|
-
* @returns Promise<string | boolean
|
3143
|
+
* @returns `Promise<string | boolean>` returns status id if it worked, false if it didn't
|
3157
3144
|
*/
|
3158
3145
|
postVideoStatus(data, caption) {
|
3159
3146
|
return __awaiter(this, void 0, void 0, function* () {
|
@@ -3276,7 +3263,7 @@ class Client {
|
|
3276
3263
|
*
|
3277
3264
|
* Sets the profile pic of the host number.
|
3278
3265
|
* @param data string data url image string.
|
3279
|
-
* @returns Promise<boolean
|
3266
|
+
* @returns `Promise<boolean>` success if true
|
3280
3267
|
*/
|
3281
3268
|
setProfilePic(data) {
|
3282
3269
|
return __awaiter(this, void 0, void 0, function* () {
|
@@ -1,3 +1,6 @@
|
|
1
|
+
declare type Brand<K, T> = K & {
|
2
|
+
__brand?: T;
|
3
|
+
};
|
1
4
|
/**
|
2
5
|
* The suffix used to identify a non-group chat id
|
3
6
|
*/
|
@@ -33,7 +36,7 @@ export declare type GroupChatId = `${AccountNumber}-${number}@${GroupChatServer}
|
|
33
36
|
*
|
34
37
|
* `"447123456789@c.us"`
|
35
38
|
*/
|
36
|
-
export declare type ContactId =
|
39
|
+
export declare type ContactId = Brand<`${AccountNumber}@${ChatServer}`, "ContactId">;
|
37
40
|
/**
|
38
41
|
* A chat id ends with `@c.us` or `@g.us` for group chats.
|
39
42
|
*
|
@@ -51,7 +54,7 @@ export declare type ChatId = ContactId | GroupChatId;
|
|
51
54
|
*
|
52
55
|
* `"false_447123456789@c.us_9C4D0965EA5C09D591334AB6BDB07FEB"`
|
53
56
|
*/
|
54
|
-
export declare type MessageId =
|
57
|
+
export declare type MessageId = Brand<`${boolean}_${ChatId}_${string}`, "MessageId">;
|
55
58
|
/**
|
56
59
|
* This is a generic type alias for the content of a message
|
57
60
|
*
|
@@ -59,7 +62,7 @@ export declare type MessageId = `${boolean}_${ChatId}_${string}`;
|
|
59
62
|
*
|
60
63
|
* `"hello!"`
|
61
64
|
*/
|
62
|
-
export declare type Content = string
|
65
|
+
export declare type Content = Brand<string, "Content">;
|
63
66
|
export declare type NonSerializedId = {
|
64
67
|
server: WaServers;
|
65
68
|
user: AccountNumber;
|
@@ -77,7 +80,7 @@ export declare type NonSerializedId = {
|
|
77
80
|
*
|
78
81
|
* Learn more here: https://developer.mozilla.org/en-US/docs/Web/HTTP/Basics_of_HTTP/Data_URIs
|
79
82
|
*/
|
80
|
-
export declare type DataURL = string;
|
83
|
+
export declare type DataURL = Brand<`data:${string};base64,${Base64}`, "DataURL">;
|
81
84
|
/**
|
82
85
|
* Base64 is basically a file encoded as a string.
|
83
86
|
*
|
@@ -85,10 +88,11 @@ export declare type DataURL = string;
|
|
85
88
|
*
|
86
89
|
* Learn more here: https://developer.mozilla.org/en-US/docs/Glossary/Base64
|
87
90
|
*/
|
88
|
-
export declare type Base64 = string
|
91
|
+
export declare type Base64 = Brand<string, "Base64">;
|
89
92
|
/**
|
90
93
|
* The relative or absolute path of a file
|
91
94
|
*
|
92
95
|
* Learn more here: https://www.w3schools.com/html/html_filepaths.asp
|
93
96
|
*/
|
94
|
-
export declare type FilePath = string
|
97
|
+
export declare type FilePath = Brand<string, "FilePath">;
|
98
|
+
export {};
|
@@ -687,7 +687,7 @@ export interface ConfigObject {
|
|
687
687
|
/**
|
688
688
|
* What to do when an error is detected on a client method.
|
689
689
|
*
|
690
|
-
* @default `NOTHING`
|
690
|
+
* @default `OnError.NOTHING`
|
691
691
|
*/
|
692
692
|
onError?: OnError;
|
693
693
|
/**
|
@@ -697,6 +697,9 @@ export interface ConfigObject {
|
|
697
697
|
* Set this to true if you're using the multidevice beta.
|
698
698
|
*
|
699
699
|
* @default `false`
|
700
|
+
* :::danger
|
701
|
+
* Some features (e.g [[sendLinkWithAutoPreview]]) **do not** work with multi-device beta. Check [this `api`](#).
|
702
|
+
* :::
|
700
703
|
*/
|
701
704
|
multiDevice?: boolean;
|
702
705
|
/**
|
package/dist/api/model/index.js
CHANGED
@@ -16,6 +16,7 @@ __exportStar(require("./contact"), exports);
|
|
16
16
|
__exportStar(require("./message"), exports);
|
17
17
|
__exportStar(require("./errors"), exports);
|
18
18
|
__exportStar(require("./events"), exports);
|
19
|
+
__exportStar(require("./product"), exports);
|
19
20
|
/**
|
20
21
|
* Client status
|
21
22
|
* @readonly
|
@@ -0,0 +1,229 @@
|
|
1
|
+
"use strict";
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
3
|
+
exports.optionList = void 0;
|
4
|
+
exports.optionList = [{
|
5
|
+
name: 'no-api',
|
6
|
+
default: false,
|
7
|
+
alias: 'n',
|
8
|
+
type: Boolean,
|
9
|
+
description: "Don't expose the api. This may be useful if you just want to set the webhooks."
|
10
|
+
}, {
|
11
|
+
name: 'bot-press-url',
|
12
|
+
alias: 'b',
|
13
|
+
type: String,
|
14
|
+
typeLabel: '{blue {underline http://localhost:3000/api/v1/bots/cool-bot}}',
|
15
|
+
description: "The Botpress URL that ends with your bot id."
|
16
|
+
}, {
|
17
|
+
name: 'twilio-webhook',
|
18
|
+
alias: 't',
|
19
|
+
type: String,
|
20
|
+
typeLabel: '{blue {underline http://localhost:5555/incoming}}',
|
21
|
+
description: "Send twillio payloads to this URL. EASY API will also parse and processes twillio response message payloads."
|
22
|
+
}, {
|
23
|
+
name: 'chatwoot-url',
|
24
|
+
type: String,
|
25
|
+
typeLabel: '{blue {underline http://localhost:3000/api/v1/accounts/3/inboxes/1}}',
|
26
|
+
description: "The URL of the specific Chatwoot inbox you set up for this session"
|
27
|
+
}, {
|
28
|
+
name: 'chatwoot-api-access-token',
|
29
|
+
type: String,
|
30
|
+
typeLabel: '{blue {underline mEEwUGEEML2ZThMm252rLg1M}}',
|
31
|
+
description: "The access token of the specific Chatwoot inbox you set up for this session"
|
32
|
+
},
|
33
|
+
{
|
34
|
+
name: 'port',
|
35
|
+
alias: 'p',
|
36
|
+
default: 8002,
|
37
|
+
type: Number,
|
38
|
+
typeLabel: '{blue {underline 8080}}',
|
39
|
+
description: "Set the port for the api. Default to 8002."
|
40
|
+
},
|
41
|
+
{
|
42
|
+
name: 'api-host',
|
43
|
+
type: String,
|
44
|
+
typeLabel: '{yellow {underline localhost}}',
|
45
|
+
description: "The easy API may be sitting behind a reverse proxy. In this case set --api-host in order to make sure the api docs and api explorer are working properly. You will need to include the protocol as well."
|
46
|
+
},
|
47
|
+
{
|
48
|
+
name: 'host',
|
49
|
+
alias: 'h',
|
50
|
+
default: 'localhost',
|
51
|
+
type: String,
|
52
|
+
typeLabel: '{red {underline localhost}}',
|
53
|
+
description: "Set the hostname for the api documantation and statistics. Overrides --api-host. Default: localhost."
|
54
|
+
},
|
55
|
+
{
|
56
|
+
name: 'webhook',
|
57
|
+
alias: 'w',
|
58
|
+
type: String,
|
59
|
+
typeLabel: '{yellow {underline https://webhook.site/....}}',
|
60
|
+
description: "Webhook to use for the listeners."
|
61
|
+
},
|
62
|
+
{
|
63
|
+
name: 'ev',
|
64
|
+
alias: 'e',
|
65
|
+
type: String,
|
66
|
+
typeLabel: '{green {underline https://webhook.site/....}}',
|
67
|
+
description: "Send launch events to this URL."
|
68
|
+
},
|
69
|
+
{
|
70
|
+
name: 'ef',
|
71
|
+
type: String,
|
72
|
+
//@ts-ignore
|
73
|
+
default: ["qr", "STARTUP", "MD_DETECT"],
|
74
|
+
isMultiple: true,
|
75
|
+
typeLabel: '{blueBright {underline qr,STARTUP}}',
|
76
|
+
description: "Filters which namespaces trigger the webhook set in -e/--ev."
|
77
|
+
},
|
78
|
+
{
|
79
|
+
name: 'allow-session-data-wh',
|
80
|
+
alias: 'x',
|
81
|
+
default: false,
|
82
|
+
type: Boolean,
|
83
|
+
description: "By default, if you set -e flag, the session data is not transferred to the webhook as it is extremely sensitive data. In order to bypass this security measure, use this flag."
|
84
|
+
},
|
85
|
+
{
|
86
|
+
name: 'key',
|
87
|
+
alias: 'k',
|
88
|
+
type: String,
|
89
|
+
typeLabel: '{redBright {underline apikey}}',
|
90
|
+
description: "Specify an api key to use as a check for all requests. If you add -k by itself, a key will be autogenerated for you."
|
91
|
+
},
|
92
|
+
{
|
93
|
+
name: 'config',
|
94
|
+
alias: 'c',
|
95
|
+
type: String,
|
96
|
+
typeLabel: '{yellowBright {underline ./config.json}}',
|
97
|
+
description: "The relative json file that contains the config. By default the system will look for config.json which will override any config variables set. Default: './config.json'."
|
98
|
+
},
|
99
|
+
{
|
100
|
+
name: 'session',
|
101
|
+
alias: 's',
|
102
|
+
type: String,
|
103
|
+
typeLabel: '{magentaBright {underline BASE64}}',
|
104
|
+
description: "A base64 string representing the session data."
|
105
|
+
},
|
106
|
+
{
|
107
|
+
name: 'keep-alive',
|
108
|
+
alias: 'a',
|
109
|
+
type: Boolean,
|
110
|
+
description: "If true, the system will force the session to refocus in this process. This will prevent you from opening a session elsewhere."
|
111
|
+
},
|
112
|
+
{
|
113
|
+
name: 'use-session-id-in-path',
|
114
|
+
alias: 'i',
|
115
|
+
type: Boolean,
|
116
|
+
description: "If true, all API paths will include the session id. default to false and the default session Id is 'session'."
|
117
|
+
},
|
118
|
+
{
|
119
|
+
name: 'generate-api-docs',
|
120
|
+
alias: 'd',
|
121
|
+
type: Boolean,
|
122
|
+
default: true,
|
123
|
+
description: "Generate postman collection and expose api docs to open in browser."
|
124
|
+
},
|
125
|
+
{
|
126
|
+
name: 'session-data-only',
|
127
|
+
alias: 'o',
|
128
|
+
type: Boolean,
|
129
|
+
description: "Kill the process when the session data is saved.",
|
130
|
+
default: false
|
131
|
+
},
|
132
|
+
{
|
133
|
+
name: 'skip-save-postman-collection',
|
134
|
+
type: Boolean,
|
135
|
+
description: "Don't save the postman collection.",
|
136
|
+
default: false
|
137
|
+
},
|
138
|
+
{
|
139
|
+
name: 'headful',
|
140
|
+
type: Boolean,
|
141
|
+
description: "Show the browser window on your machine.",
|
142
|
+
default: false
|
143
|
+
},
|
144
|
+
{
|
145
|
+
name: 'pre-auth-docs',
|
146
|
+
type: Boolean,
|
147
|
+
description: "Pre authenticate documentation site [High security risk]."
|
148
|
+
},
|
149
|
+
{
|
150
|
+
name: 'stats',
|
151
|
+
type: Boolean,
|
152
|
+
description: "Exposes API swagger-statistics.",
|
153
|
+
default: false
|
154
|
+
},
|
155
|
+
{
|
156
|
+
name: 'pre-auth-docs',
|
157
|
+
type: Boolean,
|
158
|
+
description: "Grab config options from the environment variables.",
|
159
|
+
default: false
|
160
|
+
},
|
161
|
+
{
|
162
|
+
name: 'no-kill-on-logout',
|
163
|
+
type: Boolean,
|
164
|
+
description: "Keeps the process alive when host account logs out of session. default is false",
|
165
|
+
default: false
|
166
|
+
},
|
167
|
+
{
|
168
|
+
name: 'debug',
|
169
|
+
type: Boolean,
|
170
|
+
description: "Print out the CLI flag values and the WA_* env vars. default is false",
|
171
|
+
default: false
|
172
|
+
},
|
173
|
+
{
|
174
|
+
name: 'cors',
|
175
|
+
type: Boolean,
|
176
|
+
description: "Enable all cors requests",
|
177
|
+
default: false
|
178
|
+
},
|
179
|
+
{
|
180
|
+
name: 'socket',
|
181
|
+
type: Boolean,
|
182
|
+
description: "Expose a socket.io middleware on the server.",
|
183
|
+
default: false
|
184
|
+
},
|
185
|
+
{
|
186
|
+
name: 'license-key',
|
187
|
+
alias: 'l',
|
188
|
+
type: String,
|
189
|
+
typeLabel: '{yellowBright {underline B2BJ4JFB-2UN2J3ND-2J5I.....}}',
|
190
|
+
description: "The license key you want to use for this server. License keys are used to unlock features. Learn more here https://github.com/open-wa/wa-automate-nodejs#license-key"
|
191
|
+
},
|
192
|
+
{
|
193
|
+
name: 'ready-webhook',
|
194
|
+
type: String,
|
195
|
+
typeLabel: '{yellow {underline https://webhook.site/....}}',
|
196
|
+
description: "Webhook that fires when the EASY API is completely ready"
|
197
|
+
},
|
198
|
+
{
|
199
|
+
name: 'on-call',
|
200
|
+
type: String,
|
201
|
+
typeLabel: '{yellow {underline "Please do not call this number"}}',
|
202
|
+
description: "A default message to send to any number that is trying to call the host account"
|
203
|
+
},
|
204
|
+
{
|
205
|
+
name: 'auto-reject',
|
206
|
+
type: Boolean,
|
207
|
+
description: "Automatically reject incoming phone and video calls to the host account."
|
208
|
+
},
|
209
|
+
{
|
210
|
+
name: 'emit-unread',
|
211
|
+
type: Boolean,
|
212
|
+
description: "Emit all unread messages via onMessage webhooks on launch.",
|
213
|
+
default: false
|
214
|
+
},
|
215
|
+
{
|
216
|
+
name: 'skip-url-check',
|
217
|
+
type: Boolean,
|
218
|
+
description: "Don't validate webhook URLs. Enables use of non-FQDNs."
|
219
|
+
},
|
220
|
+
{
|
221
|
+
name: 'tunnel',
|
222
|
+
type: Boolean,
|
223
|
+
description: "Expose a tunnel to your EASY API session - this is for testing and it is unsecured."
|
224
|
+
},
|
225
|
+
{
|
226
|
+
name: 'help',
|
227
|
+
description: 'Print this usage guide.'
|
228
|
+
}
|
229
|
+
];
|
package/dist/cli/setup.d.ts
CHANGED
@@ -14,7 +14,7 @@ export declare const cliOptionNames: import("type-fest").Simplify<import("type-f
|
|
14
14
|
description?: string;
|
15
15
|
typeLabel?: string;
|
16
16
|
}, meow.AnyFlag>>, {
|
17
|
-
type?:
|
17
|
+
type?: StringConstructor | BooleanConstructor | NumberConstructor;
|
18
18
|
}>>;
|
19
19
|
export declare const meowFlags: () => AnyFlags;
|
20
20
|
export declare const helptext: string;
|