@open-wa/wa-automate 4.51.0 → 4.51.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/dist/controllers/browser.js +1 -1
- package/dist/utils/tools.js +11 -2
- package/package.json +1 -1
|
@@ -446,7 +446,7 @@ function initBrowser(sessionId, config = {}, spinner) {
|
|
|
446
446
|
let args = [...puppeteer_config_1.puppeteerConfig.chromiumArgs, ...((config === null || config === void 0 ? void 0 : config.chromiumArgs) || [])];
|
|
447
447
|
if (config === null || config === void 0 ? void 0 : config.multiDevice) {
|
|
448
448
|
args = args.filter(x => x != '--incognito');
|
|
449
|
-
config["userDataDir"] = config["userDataDir"] || `${(config === null || config === void 0 ? void 0 : config.inDocker) ? '/sessions' : (config === null || config === void 0 ? void 0 : config.sessionDataPath) || '.'}/_IGNORE_${(config === null || config === void 0 ? void 0 : config.sessionId) || 'session'}`;
|
|
449
|
+
config["userDataDir"] = config["userDataDir"] || `${(config === null || config === void 0 ? void 0 : config.sessionDataPath) || (config === null || config === void 0 ? void 0 : config.inDocker) ? '/sessions' : (config === null || config === void 0 ? void 0 : config.sessionDataPath) || '.'}/_IGNORE_${(config === null || config === void 0 ? void 0 : config.sessionId) || 'session'}`;
|
|
450
450
|
spinner === null || spinner === void 0 ? void 0 : spinner.info('MD Enabled, turning off incognito mode.');
|
|
451
451
|
spinner === null || spinner === void 0 ? void 0 : spinner.info(`Data dir: ${config["userDataDir"]}`);
|
|
452
452
|
}
|
package/dist/utils/tools.js
CHANGED
|
@@ -63,6 +63,15 @@ const os_2 = require("os");
|
|
|
63
63
|
const stream_1 = require("stream");
|
|
64
64
|
const logging_1 = require("../logging/logging");
|
|
65
65
|
const import_1 = require("@brillout/import");
|
|
66
|
+
const fsconstants = fsp.constants || {
|
|
67
|
+
F_OK: 0,
|
|
68
|
+
R_OK: 4,
|
|
69
|
+
W_OK: 2,
|
|
70
|
+
X_OK: 1
|
|
71
|
+
};
|
|
72
|
+
const IGNORE_FILE_EXTS = [
|
|
73
|
+
'mpga'
|
|
74
|
+
];
|
|
66
75
|
let _ft = null;
|
|
67
76
|
const ft = () => __awaiter(void 0, void 0, void 0, function* () {
|
|
68
77
|
if (!_ft) {
|
|
@@ -411,7 +420,7 @@ const assertFile = (file, outfileName, desiredOutputType, requestConfig) => __aw
|
|
|
411
420
|
if (inputType != exports.FileInputTypes.BUFFER) {
|
|
412
421
|
file = yield (0, exports.ensureDUrl)(file, requestConfig, outfileName);
|
|
413
422
|
const ext = mime_1.default.extension(file.match(/[^:]\w+\/[\w-+\d.]+(?=;|,)/)[0]);
|
|
414
|
-
if (ext && !tfn.endsWith(ext))
|
|
423
|
+
if (ext && !IGNORE_FILE_EXTS.includes(ext) && !tfn.endsWith(ext))
|
|
415
424
|
tfn = `${tfn}.${ext}`;
|
|
416
425
|
file = Buffer.from(file.split(',')[1], 'base64');
|
|
417
426
|
}
|
|
@@ -448,7 +457,7 @@ exports.assertFile = assertFile;
|
|
|
448
457
|
const pathExists = (_path, failSilent) => __awaiter(void 0, void 0, void 0, function* () {
|
|
449
458
|
_path = (0, exports.fixPath)(_path);
|
|
450
459
|
try {
|
|
451
|
-
yield fsp.access(_path,
|
|
460
|
+
yield fsp.access(_path, fsconstants.R_OK | fsconstants.W_OK);
|
|
452
461
|
return _path;
|
|
453
462
|
}
|
|
454
463
|
catch (error) {
|
package/package.json
CHANGED