@wppconnect-team/wppconnect 1.15.0 → 1.16.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/CHANGELOG.md +9 -0
- package/dist/api/layers/host.layer.d.ts +2 -1
- package/dist/api/layers/host.layer.js +2 -1
- package/dist/api/layers/labels.layer.d.ts +1 -1
- package/dist/api/layers/labels.layer.js +1 -6
- package/dist/api/layers/listener.layer.d.ts +2 -2
- package/dist/api/layers/listener.layer.js +19 -13
- package/dist/api/model/enum/index.d.ts +0 -1
- package/dist/api/model/enum/index.js +1 -3
- package/dist/api/model/initializer.d.ts +8 -0
- package/dist/api/model/participant-event.d.ts +4 -3
- package/dist/controllers/browser.d.ts +3 -1
- package/dist/controllers/browser.js +59 -2
- package/dist/controllers/initializer.d.ts +2 -2
- package/dist/controllers/initializer.js +3 -1
- package/package.json +18 -24
- package/LICENSE.header +0 -14
- package/dist/api/model/enum/group-change-event.d.ts +0 -6
- package/dist/api/model/enum/group-change-event.js +0 -26
- package/license-checker-config.json +0 -19
package/CHANGELOG.md
CHANGED
|
@@ -4,7 +4,7 @@ import { SocketState } from '../model/enum';
|
|
|
4
4
|
import { ScrapQrcode } from '../model/qrcode';
|
|
5
5
|
import { LogLevel } from '../../utils/logger';
|
|
6
6
|
import { Logger } from 'winston';
|
|
7
|
-
import { CatchQRCallback, HostDevice, StatusFindCallback } from '../model';
|
|
7
|
+
import { CatchQRCallback, HostDevice, LoadingScreenCallback, StatusFindCallback } from '../model';
|
|
8
8
|
import { TokenStore } from '../../token-store';
|
|
9
9
|
export declare class HostLayer {
|
|
10
10
|
page: Page;
|
|
@@ -15,6 +15,7 @@ export declare class HostLayer {
|
|
|
15
15
|
protected autoCloseInterval: any;
|
|
16
16
|
protected autoCloseCalled: boolean;
|
|
17
17
|
protected statusFind?: StatusFindCallback;
|
|
18
|
+
onLoadingScreen?: LoadingScreenCallback;
|
|
18
19
|
constructor(page: Page, session?: string, options?: CreateConfig);
|
|
19
20
|
protected log(level: LogLevel, message: string, meta?: object): void;
|
|
20
21
|
protected initialize(): Promise<void>;
|
|
@@ -77,6 +77,7 @@ var HostLayer = /** @class */ (function () {
|
|
|
77
77
|
this.autoCloseInterval = null;
|
|
78
78
|
this.autoCloseCalled = false;
|
|
79
79
|
this.statusFind = null;
|
|
80
|
+
this.onLoadingScreen = null;
|
|
80
81
|
this.session = session;
|
|
81
82
|
this.options = __assign(__assign({}, create_config_1.defaultOptions), options);
|
|
82
83
|
this.logger = this.options.logger || logger_1.defaultLogger;
|
|
@@ -137,7 +138,7 @@ var HostLayer = /** @class */ (function () {
|
|
|
137
138
|
}
|
|
138
139
|
hasUserDataDir = !!((_b = (_a = this.options) === null || _a === void 0 ? void 0 : _a.puppeteerOptions) === null || _b === void 0 ? void 0 : _b.userDataDir);
|
|
139
140
|
clear = !hasUserDataDir || (hasUserDataDir && !isValidToken);
|
|
140
|
-
return [4 /*yield*/, (0, browser_1.initWhatsapp)(this.page, sessionToken, clear, this.options.whatsappVersion)];
|
|
141
|
+
return [4 /*yield*/, (0, browser_1.initWhatsapp)(this.page, sessionToken, clear, this.options.whatsappVersion, this.onLoadingScreen)];
|
|
141
142
|
case 3:
|
|
142
143
|
_c.sent();
|
|
143
144
|
this.page.on('load', function () {
|
|
@@ -140,12 +140,7 @@ var LabelsLayer = /** @class */ (function (_super) {
|
|
|
140
140
|
LabelsLayer.prototype.getAllLabels = function () {
|
|
141
141
|
return __awaiter(this, void 0, void 0, function () {
|
|
142
142
|
return __generator(this, function (_a) {
|
|
143
|
-
|
|
144
|
-
case 0: return [4 /*yield*/, (0, helpers_1.evaluateAndReturn)(this.page, function () {
|
|
145
|
-
WPP.labels.getAllLabels();
|
|
146
|
-
})];
|
|
147
|
-
case 1: return [2 /*return*/, _a.sent()];
|
|
148
|
-
}
|
|
143
|
+
return [2 /*return*/, (0, helpers_1.evaluateAndReturn)(this.page, function () { return WPP.labels.getAllLabels(); })];
|
|
149
144
|
});
|
|
150
145
|
});
|
|
151
146
|
};
|
|
@@ -109,7 +109,7 @@ export declare class ListenerLayer extends ProfileLayer {
|
|
|
109
109
|
* @param to callback
|
|
110
110
|
* @returns Stream of ParticipantEvent
|
|
111
111
|
*/
|
|
112
|
-
onParticipantsChanged(callback: (
|
|
112
|
+
onParticipantsChanged(callback: (evData: ParticipantEvent) => void): {
|
|
113
113
|
dispose: () => void;
|
|
114
114
|
};
|
|
115
115
|
/**
|
|
@@ -118,7 +118,7 @@ export declare class ListenerLayer extends ProfileLayer {
|
|
|
118
118
|
* @param to callback
|
|
119
119
|
* @returns Stream of ParticipantEvent
|
|
120
120
|
*/
|
|
121
|
-
onParticipantsChanged(groupId: string, callback: (
|
|
121
|
+
onParticipantsChanged(groupId: string, callback: (evData: ParticipantEvent) => void): {
|
|
122
122
|
dispose: () => void;
|
|
123
123
|
};
|
|
124
124
|
/**
|
|
@@ -80,7 +80,6 @@ exports.ListenerLayer = void 0;
|
|
|
80
80
|
var events_1 = require("events");
|
|
81
81
|
var helpers_1 = require("../helpers");
|
|
82
82
|
var exposed_enum_1 = require("../helpers/exposed.enum");
|
|
83
|
-
var enum_1 = require("../model/enum");
|
|
84
83
|
var profile_layer_1 = require("./profile.layer");
|
|
85
84
|
var ListenerLayer = /** @class */ (function (_super) {
|
|
86
85
|
__extends(ListenerLayer, _super);
|
|
@@ -318,6 +317,17 @@ var ListenerLayer = /** @class */ (function (_super) {
|
|
|
318
317
|
catch (error) {
|
|
319
318
|
console.error(error);
|
|
320
319
|
}
|
|
320
|
+
try {
|
|
321
|
+
if (!window['onParticipantsChanged'].exposed) {
|
|
322
|
+
WPP.on('group.participant_changed', function (participantChangedEvent) {
|
|
323
|
+
window['onParticipantsChanged'](participantChangedEvent);
|
|
324
|
+
});
|
|
325
|
+
window['onParticipantsChanged'].exposed = true;
|
|
326
|
+
}
|
|
327
|
+
}
|
|
328
|
+
catch (error) {
|
|
329
|
+
console.error(error);
|
|
330
|
+
}
|
|
321
331
|
})
|
|
322
332
|
.catch(function () { })];
|
|
323
333
|
case 6:
|
|
@@ -419,21 +429,17 @@ var ListenerLayer = /** @class */ (function (_super) {
|
|
|
419
429
|
callback = groupId;
|
|
420
430
|
groupId = null;
|
|
421
431
|
}
|
|
422
|
-
|
|
423
|
-
|
|
424
|
-
// Only group events
|
|
425
|
-
if (message.type !== enum_1.MessageType.GP2 ||
|
|
426
|
-
!subtypeEvents.includes(message.subtype)) {
|
|
427
|
-
return;
|
|
428
|
-
}
|
|
429
|
-
if (groupId && groupId !== message.id) {
|
|
432
|
+
return this.registerEvent(exposed_enum_1.ExposedFn.onParticipantsChanged, function (evData) {
|
|
433
|
+
if (groupId && groupId !== evData.groupId) {
|
|
430
434
|
return;
|
|
431
435
|
}
|
|
432
436
|
callback({
|
|
433
|
-
by:
|
|
434
|
-
|
|
435
|
-
|
|
436
|
-
|
|
437
|
+
by: evData.author,
|
|
438
|
+
byPushName: evData.authorPushName,
|
|
439
|
+
groupId: evData.groupId,
|
|
440
|
+
action: evData.action,
|
|
441
|
+
operation: evData.operation,
|
|
442
|
+
who: evData.participants,
|
|
437
443
|
});
|
|
438
444
|
});
|
|
439
445
|
};
|
|
@@ -1,6 +1,5 @@
|
|
|
1
1
|
export { AckType } from './ack-type';
|
|
2
2
|
export { ChatState } from './chat-state';
|
|
3
|
-
export { GroupChangeEvent } from './group-change-event';
|
|
4
3
|
export { GroupNotificationType } from './group-notification-type';
|
|
5
4
|
export { SocketState, SocketStream } from './socket-state';
|
|
6
5
|
export { MessageType, MediaType } from './message-type';
|
|
@@ -30,13 +30,11 @@ var __exportStar = (this && this.__exportStar) || function(m, exports) {
|
|
|
30
30
|
for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
|
|
31
31
|
};
|
|
32
32
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
33
|
-
exports.MediaType = exports.MessageType = exports.SocketStream = exports.SocketState = exports.GroupNotificationType = exports.
|
|
33
|
+
exports.MediaType = exports.MessageType = exports.SocketStream = exports.SocketState = exports.GroupNotificationType = exports.ChatState = exports.AckType = void 0;
|
|
34
34
|
var ack_type_1 = require("./ack-type");
|
|
35
35
|
Object.defineProperty(exports, "AckType", { enumerable: true, get: function () { return ack_type_1.AckType; } });
|
|
36
36
|
var chat_state_1 = require("./chat-state");
|
|
37
37
|
Object.defineProperty(exports, "ChatState", { enumerable: true, get: function () { return chat_state_1.ChatState; } });
|
|
38
|
-
var group_change_event_1 = require("./group-change-event");
|
|
39
|
-
Object.defineProperty(exports, "GroupChangeEvent", { enumerable: true, get: function () { return group_change_event_1.GroupChangeEvent; } });
|
|
40
38
|
var group_notification_type_1 = require("./group-notification-type");
|
|
41
39
|
Object.defineProperty(exports, "GroupNotificationType", { enumerable: true, get: function () { return group_notification_type_1.GroupNotificationType; } });
|
|
42
40
|
var socket_state_1 = require("./socket-state");
|
|
@@ -9,6 +9,10 @@ export declare type CatchQRCallback = (qrCode: string, asciiQR: string, attempt:
|
|
|
9
9
|
* A callback will be received, informing the customer's status
|
|
10
10
|
*/
|
|
11
11
|
export declare type StatusFindCallback = (status: StatusFind | keyof typeof StatusFind, session: string) => void;
|
|
12
|
+
/**
|
|
13
|
+
* A callback will be received, informing data as percentage and loading screen message
|
|
14
|
+
*/
|
|
15
|
+
export declare type LoadingScreenCallback = (percent: number, message: string) => void;
|
|
12
16
|
export interface CreateOptions extends CreateConfig {
|
|
13
17
|
/**
|
|
14
18
|
* You must pass a string type parameter, this parameter will be the name of the client's session. If the parameter is not passed, the section name will be "session".
|
|
@@ -22,6 +26,10 @@ export interface CreateOptions extends CreateConfig {
|
|
|
22
26
|
* A callback will be received, informing the customer's status
|
|
23
27
|
*/
|
|
24
28
|
statusFind?: StatusFindCallback;
|
|
29
|
+
/**
|
|
30
|
+
* A callback will be received, informing data as percentage and loading screen message
|
|
31
|
+
*/
|
|
32
|
+
onLoadingScreen?: LoadingScreenCallback;
|
|
25
33
|
/**
|
|
26
34
|
* Pass the session token information you can receive this token with the await client.getSessionTokenBrowser () function
|
|
27
35
|
* @deprecated in favor of `sessionToken`
|
|
@@ -1,7 +1,8 @@
|
|
|
1
|
-
import { GroupChangeEvent } from './enum';
|
|
2
1
|
export interface ParticipantEvent {
|
|
3
|
-
by
|
|
2
|
+
by?: string;
|
|
3
|
+
byPushName?: string;
|
|
4
4
|
groupId: string;
|
|
5
|
-
action:
|
|
5
|
+
action: 'add' | 'remove' | 'demote' | 'promote' | 'leaver' | 'join';
|
|
6
|
+
operation: 'add' | 'remove' | 'demote' | 'promote';
|
|
6
7
|
who: string[];
|
|
7
8
|
}
|
|
@@ -2,6 +2,7 @@ import { Browser, BrowserContext, Page } from 'puppeteer';
|
|
|
2
2
|
import { CreateConfig } from '../config/create-config';
|
|
3
3
|
import { Logger } from 'winston';
|
|
4
4
|
import { SessionToken } from '../token-store';
|
|
5
|
+
import { LoadingScreenCallback } from '../api/model';
|
|
5
6
|
export declare function unregisterServiceWorker(page: Page): Promise<void>;
|
|
6
7
|
/**
|
|
7
8
|
* Força o carregamento de uma versão específica do WhatsApp WEB
|
|
@@ -9,7 +10,8 @@ export declare function unregisterServiceWorker(page: Page): Promise<void>;
|
|
|
9
10
|
* @param version Versão ou expressão semver
|
|
10
11
|
*/
|
|
11
12
|
export declare function setWhatsappVersion(page: Page, version: string): Promise<void>;
|
|
12
|
-
export declare function initWhatsapp(page: Page, token?: SessionToken, clear?: boolean, version?: string): Promise<Page>;
|
|
13
|
+
export declare function initWhatsapp(page: Page, token?: SessionToken, clear?: boolean, version?: string, onLoadingScreenCallBack?: LoadingScreenCallback): Promise<Page>;
|
|
14
|
+
export declare function onLoadingScreen(page: Page, onLoadingScreenCallBack?: LoadingScreenCallback): Promise<void>;
|
|
13
15
|
export declare function injectApi(page: Page): Promise<boolean | import("puppeteer").JSHandle<unknown>>;
|
|
14
16
|
/**
|
|
15
17
|
* Initializes browser, will try to use chrome as default
|
|
@@ -98,7 +98,7 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
|
98
98
|
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
99
99
|
};
|
|
100
100
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
101
|
-
exports.getOrCreatePage = exports.initBrowser = exports.injectApi = exports.initWhatsapp = exports.setWhatsappVersion = exports.unregisterServiceWorker = void 0;
|
|
101
|
+
exports.getOrCreatePage = exports.initBrowser = exports.injectApi = exports.onLoadingScreen = exports.initWhatsapp = exports.setWhatsappVersion = exports.unregisterServiceWorker = void 0;
|
|
102
102
|
var ChromeLauncher = __importStar(require("chrome-launcher"));
|
|
103
103
|
var os = __importStar(require("os"));
|
|
104
104
|
var path = __importStar(require("path"));
|
|
@@ -176,7 +176,7 @@ function setWhatsappVersion(page, version) {
|
|
|
176
176
|
});
|
|
177
177
|
}
|
|
178
178
|
exports.setWhatsappVersion = setWhatsappVersion;
|
|
179
|
-
function initWhatsapp(page, token, clear, version) {
|
|
179
|
+
function initWhatsapp(page, token, clear, version, onLoadingScreenCallBack) {
|
|
180
180
|
if (clear === void 0) { clear = true; }
|
|
181
181
|
return __awaiter(this, void 0, void 0, function () {
|
|
182
182
|
var timeout;
|
|
@@ -204,6 +204,9 @@ function initWhatsapp(page, token, clear, version) {
|
|
|
204
204
|
})
|
|
205
205
|
.catch(function () { })];
|
|
206
206
|
case 5:
|
|
207
|
+
_a.sent();
|
|
208
|
+
return [4 /*yield*/, onLoadingScreen(page, onLoadingScreenCallBack)];
|
|
209
|
+
case 6:
|
|
207
210
|
_a.sent();
|
|
208
211
|
return [2 /*return*/, page];
|
|
209
212
|
}
|
|
@@ -211,6 +214,60 @@ function initWhatsapp(page, token, clear, version) {
|
|
|
211
214
|
});
|
|
212
215
|
}
|
|
213
216
|
exports.initWhatsapp = initWhatsapp;
|
|
217
|
+
var lastPercent = null;
|
|
218
|
+
var lastPercentMessage = null;
|
|
219
|
+
function onLoadingScreen(page, onLoadingScreenCallBack) {
|
|
220
|
+
return __awaiter(this, void 0, void 0, function () {
|
|
221
|
+
var _this = this;
|
|
222
|
+
return __generator(this, function (_a) {
|
|
223
|
+
switch (_a.label) {
|
|
224
|
+
case 0: return [4 /*yield*/, page.evaluate("function getElementByXpath(path) {\n return document.evaluate(path, document, null, XPathResult.FIRST_ORDERED_NODE_TYPE, null).singleNodeValue;\n }")];
|
|
225
|
+
case 1:
|
|
226
|
+
_a.sent();
|
|
227
|
+
return [4 /*yield*/, page.exposeFunction('loadingScreen', function (percent, message) { return __awaiter(_this, void 0, void 0, function () {
|
|
228
|
+
return __generator(this, function (_a) {
|
|
229
|
+
if (lastPercent !== percent || lastPercentMessage !== message) {
|
|
230
|
+
onLoadingScreenCallBack && onLoadingScreenCallBack(percent, message);
|
|
231
|
+
lastPercent = percent;
|
|
232
|
+
lastPercentMessage = message;
|
|
233
|
+
}
|
|
234
|
+
return [2 /*return*/];
|
|
235
|
+
});
|
|
236
|
+
}); })];
|
|
237
|
+
case 2:
|
|
238
|
+
_a.sent();
|
|
239
|
+
return [4 /*yield*/, page.evaluate(function (selectors) {
|
|
240
|
+
var observer = new MutationObserver(function () {
|
|
241
|
+
var window2 = window;
|
|
242
|
+
var progressBar = window2.getElementByXpath(selectors.PROGRESS);
|
|
243
|
+
var progressMessage = window2.getElementByXpath(selectors.PROGRESS_MESSAGE);
|
|
244
|
+
if (progressBar) {
|
|
245
|
+
if (this.lastPercent !== progressBar.value ||
|
|
246
|
+
this.lastPercentMessage !== progressMessage.innerText) {
|
|
247
|
+
window2.loadingScreen(progressBar.value, progressMessage.innerText);
|
|
248
|
+
this.lastPercent = progressBar.value;
|
|
249
|
+
this.lastPercentMessage = progressMessage.innerText;
|
|
250
|
+
}
|
|
251
|
+
}
|
|
252
|
+
});
|
|
253
|
+
observer.observe(document, {
|
|
254
|
+
attributes: true,
|
|
255
|
+
childList: true,
|
|
256
|
+
characterData: true,
|
|
257
|
+
subtree: true,
|
|
258
|
+
});
|
|
259
|
+
}, {
|
|
260
|
+
PROGRESS: "//*[@id='app']/div/div/div[2]/progress",
|
|
261
|
+
PROGRESS_MESSAGE: "//*[@id='app']/div/div/div[3]",
|
|
262
|
+
})];
|
|
263
|
+
case 3:
|
|
264
|
+
_a.sent();
|
|
265
|
+
return [2 /*return*/];
|
|
266
|
+
}
|
|
267
|
+
});
|
|
268
|
+
});
|
|
269
|
+
}
|
|
270
|
+
exports.onLoadingScreen = onLoadingScreen;
|
|
214
271
|
function injectApi(page) {
|
|
215
272
|
return __awaiter(this, void 0, void 0, function () {
|
|
216
273
|
var injected;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { Whatsapp } from '../api/whatsapp';
|
|
2
2
|
import { CreateConfig } from '../config/create-config';
|
|
3
|
-
import { CatchQRCallback, CreateOptions, StatusFindCallback } from '../api/model/initializer';
|
|
3
|
+
import { CatchQRCallback, CreateOptions, LoadingScreenCallback, StatusFindCallback } from '../api/model/initializer';
|
|
4
4
|
import { SessionToken } from '../token-store';
|
|
5
5
|
/**
|
|
6
6
|
* Start the bot
|
|
@@ -13,4 +13,4 @@ export declare function create(createOption: CreateOptions): Promise<Whatsapp>;
|
|
|
13
13
|
* @returns Whatsapp page, with this parameter you will be able to access the bot functions
|
|
14
14
|
* @deprecated Deprecated in favor of create with {@link CreateOptions} (e.g., wppconnect.create({session: 'test'})).
|
|
15
15
|
*/
|
|
16
|
-
export declare function create(sessionName: string, catchQR?: CatchQRCallback, statusFind?: StatusFindCallback, options?: CreateConfig, browserSessionToken?: SessionToken): Promise<Whatsapp>;
|
|
16
|
+
export declare function create(sessionName: string, catchQR?: CatchQRCallback, statusFind?: StatusFindCallback, onLoadingScreen?: LoadingScreenCallback, options?: CreateConfig, browserSessionToken?: SessionToken): Promise<Whatsapp>;
|
|
@@ -114,7 +114,7 @@ process.on('unhandledRejection', function (reason, promise) {
|
|
|
114
114
|
}
|
|
115
115
|
logger_1.defaultLogger.error(message);
|
|
116
116
|
});
|
|
117
|
-
function create(sessionOrOption, catchQR, statusFind, options, browserSessionToken) {
|
|
117
|
+
function create(sessionOrOption, catchQR, statusFind, onLoadingScreen, options, browserSessionToken) {
|
|
118
118
|
var _a;
|
|
119
119
|
return __awaiter(this, void 0, void 0, function () {
|
|
120
120
|
var session, usingDeprecatedCreate, mergedOptions, logger, browser, page, client_1, isLogged, waitLoginPromise_1;
|
|
@@ -139,6 +139,7 @@ function create(sessionOrOption, catchQR, statusFind, options, browserSessionTok
|
|
|
139
139
|
session = sessionOrOption.session;
|
|
140
140
|
catchQR = sessionOrOption.catchQR || catchQR;
|
|
141
141
|
statusFind = sessionOrOption.statusFind || statusFind;
|
|
142
|
+
onLoadingScreen = sessionOrOption.onLoadingScreen || onLoadingScreen;
|
|
142
143
|
if (!options.sessionToken) {
|
|
143
144
|
options.sessionToken =
|
|
144
145
|
sessionOrOption.browserSessionToken || browserSessionToken;
|
|
@@ -263,6 +264,7 @@ function create(sessionOrOption, catchQR, statusFind, options, browserSessionTok
|
|
|
263
264
|
case 7:
|
|
264
265
|
if (!page) return [3 /*break*/, 10];
|
|
265
266
|
client_1 = new whatsapp_1.Whatsapp(page, session, mergedOptions);
|
|
267
|
+
client_1.onLoadingScreen = onLoadingScreen;
|
|
266
268
|
if (!mergedOptions.waitForLogin) return [3 /*break*/, 9];
|
|
267
269
|
return [4 /*yield*/, client_1.waitForLogin(catchQR, statusFind)];
|
|
268
270
|
case 8:
|
package/package.json
CHANGED
|
@@ -1,11 +1,10 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@wppconnect-team/wppconnect",
|
|
3
|
-
"version": "1.
|
|
3
|
+
"version": "1.16.0",
|
|
4
4
|
"description": "WPPConnect is an open source project developed by the JavaScript community with the aim of exporting functions from WhatsApp Web to the node, which can be used to support the creation of any interaction, such as customer service, media sending, intelligence recognition based on phrases artificial and many other things, use your imagination... 😀🤔💭",
|
|
5
5
|
"main": "dist/index.js",
|
|
6
6
|
"types": "dist/index.d.ts",
|
|
7
7
|
"scripts": {
|
|
8
|
-
"build:docs": "typedoc && git add docs/*",
|
|
9
8
|
"build:client": "tsc",
|
|
10
9
|
"build:wapi": "cd src/lib/wapi/ && webpack",
|
|
11
10
|
"build": "npm run build:wapi && npm run build:client",
|
|
@@ -14,12 +13,9 @@
|
|
|
14
13
|
"changelog:update": "conventional-changelog -p angular -i CHANGELOG.md -s",
|
|
15
14
|
"clean": "shx rm -rf session dist",
|
|
16
15
|
"commit": "cz",
|
|
17
|
-
"docs:build": "npm run docs:clean &&
|
|
16
|
+
"docs:build": "npm run docs:clean && typedoc && npm run docs:copy-images",
|
|
18
17
|
"docs:clean": "shx rm -rf api-docs",
|
|
19
18
|
"docs:copy-images": "shx cp -R ./img ./api-docs",
|
|
20
|
-
"docs:fix": "ts-node ./docs/layouts/fix-docs.ts",
|
|
21
|
-
"license:add": "license-check-and-add add",
|
|
22
|
-
"license:check": "license-check-and-add check",
|
|
23
19
|
"lint:js": "npx eslint -c .eslintrc.js --ext .js src",
|
|
24
20
|
"lint:ts": "npx eslint -c .eslintrc.js --ext .ts src",
|
|
25
21
|
"lint": "npm run lint:ts && npm run lint:js",
|
|
@@ -58,17 +54,18 @@
|
|
|
58
54
|
},
|
|
59
55
|
"homepage": "https://github.com/wppconnect-team/wppconnect#readme",
|
|
60
56
|
"devDependencies": {
|
|
61
|
-
"@babel/core": "^7.18.
|
|
62
|
-
"@babel/eslint-parser": "^7.18.
|
|
63
|
-
"@babel/eslint-plugin": "^7.
|
|
64
|
-
"@babel/preset-env": "^7.18.
|
|
57
|
+
"@babel/core": "^7.18.10",
|
|
58
|
+
"@babel/eslint-parser": "^7.18.9",
|
|
59
|
+
"@babel/eslint-plugin": "^7.18.10",
|
|
60
|
+
"@babel/preset-env": "^7.18.10",
|
|
65
61
|
"@commitlint/cli": "^17.0.3",
|
|
66
62
|
"@commitlint/config-conventional": "^17.0.3",
|
|
67
63
|
"@commitlint/cz-commitlint": "^17.0.3",
|
|
64
|
+
"@knodes/typedoc-plugin-pages": "^0.23.1",
|
|
68
65
|
"@types/atob": "^2.1.2",
|
|
69
66
|
"@types/mime-types": "^2.1.1",
|
|
70
67
|
"@types/mocha": "^9.1.1",
|
|
71
|
-
"@types/node": "^16.11.
|
|
68
|
+
"@types/node": "^16.11.47",
|
|
72
69
|
"@types/rimraf": "^3.0.2",
|
|
73
70
|
"@types/sharp": "^0.30.4",
|
|
74
71
|
"@types/shelljs": "^0.8.11",
|
|
@@ -77,32 +74,29 @@
|
|
|
77
74
|
"@typescript-eslint/eslint-plugin": "^5.29.0",
|
|
78
75
|
"@typescript-eslint/parser": "^5.29.0",
|
|
79
76
|
"babel-loader": "^8.2.5",
|
|
80
|
-
"commitizen": "^4.2.
|
|
81
|
-
"concurrently": "^7.
|
|
77
|
+
"commitizen": "^4.2.5",
|
|
78
|
+
"concurrently": "^7.3.0",
|
|
82
79
|
"conventional-changelog-cli": "^2.2.2",
|
|
83
|
-
"
|
|
84
|
-
"eslint": "^8.18.0",
|
|
80
|
+
"eslint": "^8.21.0",
|
|
85
81
|
"eslint-config-prettier": "^8.5.0",
|
|
86
|
-
"eslint-plugin-
|
|
87
|
-
"
|
|
82
|
+
"eslint-plugin-header": "^3.1.1",
|
|
83
|
+
"eslint-plugin-prettier": "^4.2.1",
|
|
88
84
|
"husky": "^8.0.1",
|
|
89
|
-
"license-check-and-add": "^4.0.5",
|
|
90
85
|
"mocha": "^10.0.0",
|
|
91
86
|
"prettier": "^2.7.1",
|
|
92
87
|
"pretty-quick": "^3.1.3",
|
|
93
88
|
"regenerator-runtime": "^0.13.9",
|
|
94
|
-
"release-it": "^15.
|
|
89
|
+
"release-it": "^15.2.0",
|
|
95
90
|
"shx": "^0.3.4",
|
|
96
91
|
"ts-node": "^10.8.2",
|
|
97
|
-
"typedoc": "^0.
|
|
98
|
-
"typedoc-plugin-pages": "^1.1.0",
|
|
92
|
+
"typedoc": "^0.23.10",
|
|
99
93
|
"typescript": "^4.7.4",
|
|
100
94
|
"webpack": "^5.73.0",
|
|
101
95
|
"webpack-cli": "^4.10.0"
|
|
102
96
|
},
|
|
103
97
|
"dependencies": {
|
|
104
|
-
"@wppconnect/wa-js": "^2.
|
|
105
|
-
"@wppconnect/wa-version": "^1.1.
|
|
98
|
+
"@wppconnect/wa-js": "^2.10.0",
|
|
99
|
+
"@wppconnect/wa-version": "^1.1.122",
|
|
106
100
|
"atob": "^2.1.2",
|
|
107
101
|
"axios": "^0.27.2",
|
|
108
102
|
"boxen": "^5.1.2",
|
|
@@ -110,7 +104,7 @@
|
|
|
110
104
|
"chalk": "~4.1.2",
|
|
111
105
|
"chrome-launcher": "^0.15.1",
|
|
112
106
|
"execa": "^5.1.1",
|
|
113
|
-
"file-type": "~16.5.
|
|
107
|
+
"file-type": "~16.5.4",
|
|
114
108
|
"futoin-hkdf": "^1.5.1",
|
|
115
109
|
"latest-version": "^5.1.0",
|
|
116
110
|
"logform": "^2.4.2",
|
package/LICENSE.header
DELETED
|
@@ -1,14 +0,0 @@
|
|
|
1
|
-
This file is part of WPPConnect.
|
|
2
|
-
|
|
3
|
-
WPPConnect is free software: you can redistribute it and/or modify
|
|
4
|
-
it under the terms of the GNU Lesser General Public License as published by
|
|
5
|
-
the Free Software Foundation, either version 3 of the License, or
|
|
6
|
-
(at your option) any later version.
|
|
7
|
-
|
|
8
|
-
WPPConnect is distributed in the hope that it will be useful,
|
|
9
|
-
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
10
|
-
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
11
|
-
GNU Lesser General Public License for more details.
|
|
12
|
-
|
|
13
|
-
You should have received a copy of the GNU Lesser General Public License
|
|
14
|
-
along with WPPConnect. If not, see <https://www.gnu.org/licenses/>.
|
|
@@ -1,26 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
/*
|
|
3
|
-
* This file is part of WPPConnect.
|
|
4
|
-
*
|
|
5
|
-
* WPPConnect is free software: you can redistribute it and/or modify
|
|
6
|
-
* it under the terms of the GNU Lesser General Public License as published by
|
|
7
|
-
* the Free Software Foundation, either version 3 of the License, or
|
|
8
|
-
* (at your option) any later version.
|
|
9
|
-
*
|
|
10
|
-
* WPPConnect is distributed in the hope that it will be useful,
|
|
11
|
-
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
12
|
-
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
13
|
-
* GNU Lesser General Public License for more details.
|
|
14
|
-
*
|
|
15
|
-
* You should have received a copy of the GNU Lesser General Public License
|
|
16
|
-
* along with WPPConnect. If not, see <https://www.gnu.org/licenses/>.
|
|
17
|
-
*/
|
|
18
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
19
|
-
exports.GroupChangeEvent = void 0;
|
|
20
|
-
var GroupChangeEvent;
|
|
21
|
-
(function (GroupChangeEvent) {
|
|
22
|
-
GroupChangeEvent["Add"] = "add";
|
|
23
|
-
GroupChangeEvent["Inivite"] = "invite";
|
|
24
|
-
GroupChangeEvent["Leave"] = "leave";
|
|
25
|
-
GroupChangeEvent["Remove"] = "remove";
|
|
26
|
-
})(GroupChangeEvent = exports.GroupChangeEvent || (exports.GroupChangeEvent = {}));
|
|
@@ -1,19 +0,0 @@
|
|
|
1
|
-
{
|
|
2
|
-
"ignore": ["**/.*", "**/*.md", ".github", ".husky", "api-docs", "tokens"],
|
|
3
|
-
"license": "LICENSE.header",
|
|
4
|
-
"licenseFormats": {
|
|
5
|
-
"js|ts": {
|
|
6
|
-
"prepend": "/*",
|
|
7
|
-
"append": " */",
|
|
8
|
-
"eachLine": {
|
|
9
|
-
"prepend": " * "
|
|
10
|
-
}
|
|
11
|
-
},
|
|
12
|
-
"dotfile": {
|
|
13
|
-
"eachLine": {
|
|
14
|
-
"prepend": "# "
|
|
15
|
-
}
|
|
16
|
-
}
|
|
17
|
-
},
|
|
18
|
-
"trailingWhitespace": "TRIM"
|
|
19
|
-
}
|