@bigbinary/neeto-playwright-commons 1.8.36 → 1.8.38
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/index.cjs.js +419 -254
- package/index.cjs.js.map +1 -1
- package/index.d.ts +10 -2
- package/index.js +419 -254
- package/index.js.map +1 -1
- package/package.json +43 -43
package/index.cjs.js
CHANGED
|
@@ -245,9 +245,13 @@ function getDefaultExportFromCjs (x) {
|
|
|
245
245
|
}
|
|
246
246
|
|
|
247
247
|
function getAugmentedNamespace(n) {
|
|
248
|
+
if (n.__esModule) return n;
|
|
248
249
|
var f = n.default;
|
|
249
250
|
if (typeof f == "function") {
|
|
250
|
-
var a = function () {
|
|
251
|
+
var a = function a () {
|
|
252
|
+
if (this instanceof a) {
|
|
253
|
+
return Reflect.construct(f, arguments, this.constructor);
|
|
254
|
+
}
|
|
251
255
|
return f.apply(this, arguments);
|
|
252
256
|
};
|
|
253
257
|
a.prototype = f.prototype;
|
|
@@ -928,6 +932,8 @@ var setFunctionLength = function setFunctionLength(fn, length) {
|
|
|
928
932
|
return fn;
|
|
929
933
|
};
|
|
930
934
|
|
|
935
|
+
callBind$1.exports;
|
|
936
|
+
|
|
931
937
|
(function (module) {
|
|
932
938
|
|
|
933
939
|
var bind = functionBind;
|
|
@@ -971,12 +977,14 @@ var setFunctionLength = function setFunctionLength(fn, length) {
|
|
|
971
977
|
$defineProperty(module.exports, 'apply', { value: applyBind });
|
|
972
978
|
} else {
|
|
973
979
|
module.exports.apply = applyBind;
|
|
974
|
-
}
|
|
980
|
+
}
|
|
975
981
|
} (callBind$1));
|
|
976
982
|
|
|
983
|
+
var callBindExports = callBind$1.exports;
|
|
984
|
+
|
|
977
985
|
var GetIntrinsic$1 = getIntrinsic;
|
|
978
986
|
|
|
979
|
-
var callBind =
|
|
987
|
+
var callBind = callBindExports;
|
|
980
988
|
|
|
981
989
|
var $indexOf = callBind(GetIntrinsic$1('String.prototype.indexOf'));
|
|
982
990
|
|
|
@@ -2503,6 +2511,8 @@ var lib$7 = {
|
|
|
2503
2511
|
stringify: stringify$5
|
|
2504
2512
|
};
|
|
2505
2513
|
|
|
2514
|
+
var qs$1 = /*@__PURE__*/getDefaultExportFromCjs(lib$7);
|
|
2515
|
+
|
|
2506
2516
|
class CustomCommands {
|
|
2507
2517
|
constructor(page, request, baseURL = process.env.BASE_URL) {
|
|
2508
2518
|
this.interceptMultipleResponses = ({ responseUrl = "", responseStatus = 200, times = 1, baseUrl, customPageContext, timeout = 35000, } = {}) => {
|
|
@@ -2553,6 +2563,18 @@ class CustomCommands {
|
|
|
2553
2563
|
await pageContext.reload();
|
|
2554
2564
|
await reloadRequests;
|
|
2555
2565
|
};
|
|
2566
|
+
this.waitForPageLoad = async ({ visiblityTimeout = 35000, customPageContext, }) => {
|
|
2567
|
+
const pageContext = customPageContext !== null && customPageContext !== void 0 ? customPageContext : this.page;
|
|
2568
|
+
await pageContext.waitForLoadState("load");
|
|
2569
|
+
await Promise.all([
|
|
2570
|
+
test$1.expect(pageContext.getByTestId(COMMON_SELECTORS.pageLoader)).toBeHidden({
|
|
2571
|
+
timeout: visiblityTimeout,
|
|
2572
|
+
}),
|
|
2573
|
+
test$1.expect(pageContext.getByTestId(COMMON_SELECTORS.spinner)).toBeHidden({
|
|
2574
|
+
timeout: visiblityTimeout,
|
|
2575
|
+
}),
|
|
2576
|
+
]);
|
|
2577
|
+
};
|
|
2556
2578
|
this.apiRequest = async ({ url, failOnStatusCode = true, headers: additionalHeaders, body: data, method = "get", params = {}, ...otherOptions }) => {
|
|
2557
2579
|
const csrfToken = await this.page
|
|
2558
2580
|
.locator("[name='csrf-token']")
|
|
@@ -2569,7 +2591,7 @@ class CustomCommands {
|
|
|
2569
2591
|
};
|
|
2570
2592
|
const formattedUrl = ramda.isEmpty(params)
|
|
2571
2593
|
? url
|
|
2572
|
-
: `${url}?${
|
|
2594
|
+
: `${url}?${qs$1.stringify(params, {
|
|
2573
2595
|
arrayFormat: "brackets",
|
|
2574
2596
|
})}`;
|
|
2575
2597
|
return await this.request[method](formattedUrl, requestOptions);
|
|
@@ -2604,12 +2626,18 @@ class CustomCommands {
|
|
|
2604
2626
|
|
|
2605
2627
|
class MailosaurUtils {
|
|
2606
2628
|
constructor(mailosaur) {
|
|
2629
|
+
this.getEmailContent = ({ email, subjectSubstring = "", timeout = 2 * 60 * 1000, receivedAfter = new Date(), }) => this.mailosaur.messages.get(this.serverId, { sentTo: email, subject: subjectSubstring }, { timeout, receivedAfter });
|
|
2607
2630
|
this.fetchOtpFromEmail = async ({ email, subjectSubstring = OTP_EMAIL_PATTERN, timeout = 2 * 60 * 1000, receivedAfter = new Date(), }) => {
|
|
2608
2631
|
var _a, _b, _c;
|
|
2609
|
-
const receivedEmail = await this.
|
|
2632
|
+
const receivedEmail = await this.getEmailContent({
|
|
2633
|
+
email,
|
|
2634
|
+
subjectSubstring,
|
|
2635
|
+
timeout,
|
|
2636
|
+
receivedAfter,
|
|
2637
|
+
});
|
|
2610
2638
|
const otp = (_c = (_b = (_a = receivedEmail === null || receivedEmail === void 0 ? void 0 : receivedEmail.text) === null || _a === void 0 ? void 0 : _a.codes) === null || _b === void 0 ? void 0 : _b[0]) === null || _c === void 0 ? void 0 : _c.value;
|
|
2611
2639
|
if (ramda.isNil(otp)) {
|
|
2612
|
-
throw new Error(`No codes found in the email with subject: ${receivedEmail.subject}. Please re-evaluate the filtering parameters.`);
|
|
2640
|
+
throw new Error(`No codes found in the email with subject: ${receivedEmail === null || receivedEmail === void 0 ? void 0 : receivedEmail.subject}. Please re-evaluate the filtering parameters.`);
|
|
2613
2641
|
}
|
|
2614
2642
|
return otp;
|
|
2615
2643
|
};
|
|
@@ -3132,6 +3160,7 @@ function requireCommon$1 () {
|
|
|
3132
3160
|
}
|
|
3133
3161
|
|
|
3134
3162
|
/* eslint-env browser */
|
|
3163
|
+
browser$1.exports;
|
|
3135
3164
|
|
|
3136
3165
|
var hasRequiredBrowser;
|
|
3137
3166
|
|
|
@@ -3405,8 +3434,8 @@ function requireBrowser () {
|
|
|
3405
3434
|
} catch (error) {
|
|
3406
3435
|
return '[UnexpectedJSONParseError]: ' + error.message;
|
|
3407
3436
|
}
|
|
3408
|
-
};
|
|
3409
|
-
} (browser$1, browser$1.exports));
|
|
3437
|
+
};
|
|
3438
|
+
} (browser$1, browser$1.exports));
|
|
3410
3439
|
return browser$1.exports;
|
|
3411
3440
|
}
|
|
3412
3441
|
|
|
@@ -3574,6 +3603,7 @@ function requireSupportsColor () {
|
|
|
3574
3603
|
/**
|
|
3575
3604
|
* Module dependencies.
|
|
3576
3605
|
*/
|
|
3606
|
+
node.exports;
|
|
3577
3607
|
|
|
3578
3608
|
var hasRequiredNode;
|
|
3579
3609
|
|
|
@@ -3839,8 +3869,8 @@ function requireNode () {
|
|
|
3839
3869
|
formatters.O = function (v) {
|
|
3840
3870
|
this.inspectOpts.colors = this.useColors;
|
|
3841
3871
|
return util.inspect(v, this.inspectOpts);
|
|
3842
|
-
};
|
|
3843
|
-
} (node, node.exports));
|
|
3872
|
+
};
|
|
3873
|
+
} (node, node.exports));
|
|
3844
3874
|
return node.exports;
|
|
3845
3875
|
}
|
|
3846
3876
|
|
|
@@ -3849,15 +3879,14 @@ function requireNode () {
|
|
|
3849
3879
|
* treat as a browser.
|
|
3850
3880
|
*/
|
|
3851
3881
|
|
|
3852
|
-
(
|
|
3853
|
-
|
|
3854
|
-
|
|
3855
|
-
|
|
3856
|
-
|
|
3857
|
-
}
|
|
3858
|
-
} (src$1));
|
|
3882
|
+
if (typeof process === 'undefined' || process.type === 'renderer' || process.browser === true || process.__nwjs) {
|
|
3883
|
+
src$1.exports = requireBrowser();
|
|
3884
|
+
} else {
|
|
3885
|
+
src$1.exports = requireNode();
|
|
3886
|
+
}
|
|
3859
3887
|
|
|
3860
|
-
var
|
|
3888
|
+
var srcExports = src$1.exports;
|
|
3889
|
+
var debug$3 = /*@__PURE__*/getDefaultExportFromCjs(srcExports);
|
|
3861
3890
|
|
|
3862
3891
|
/*!
|
|
3863
3892
|
* playwright-extra v4.3.5 by berstend
|
|
@@ -5452,10 +5481,16 @@ class StealthPlugin extends PuppeteerExtraPlugin {
|
|
|
5452
5481
|
const defaultExport = opts => new StealthPlugin(opts);
|
|
5453
5482
|
var puppeteerExtraPluginStealth = defaultExport;
|
|
5454
5483
|
|
|
5484
|
+
// const moduleExport = defaultExport
|
|
5485
|
+
// moduleExport.StealthPlugin = StealthPlugin
|
|
5486
|
+
// module.exports = moduleExport
|
|
5487
|
+
|
|
5488
|
+
var stealth$1 = /*@__PURE__*/getDefaultExportFromCjs(puppeteerExtraPluginStealth);
|
|
5489
|
+
|
|
5455
5490
|
var stealth = test$1.test.extend({
|
|
5456
5491
|
browser: async ({ browser }, use) => {
|
|
5457
5492
|
await browser.close();
|
|
5458
|
-
chromium.use(
|
|
5493
|
+
chromium.use(stealth$1());
|
|
5459
5494
|
const stealthBrowser = await chromium.launch();
|
|
5460
5495
|
await use(stealthBrowser);
|
|
5461
5496
|
await stealthBrowser.close();
|
|
@@ -5974,7 +6009,7 @@ var utils$k = {};
|
|
|
5974
6009
|
};
|
|
5975
6010
|
flat(args);
|
|
5976
6011
|
return result;
|
|
5977
|
-
};
|
|
6012
|
+
};
|
|
5978
6013
|
} (utils$k));
|
|
5979
6014
|
|
|
5980
6015
|
const utils$j = utils$k;
|
|
@@ -7281,8 +7316,6 @@ braces$1.create = (input, options = {}) => {
|
|
|
7281
7316
|
|
|
7282
7317
|
var braces_1 = braces$1;
|
|
7283
7318
|
|
|
7284
|
-
var picomatch$2 = {exports: {}};
|
|
7285
|
-
|
|
7286
7319
|
var utils$g = {};
|
|
7287
7320
|
|
|
7288
7321
|
const path$8 = Path__default["default"];
|
|
@@ -7526,7 +7559,7 @@ var constants$b = {
|
|
|
7526
7559
|
output = `(?:^(?!${output}).*$)`;
|
|
7527
7560
|
}
|
|
7528
7561
|
return output;
|
|
7529
|
-
};
|
|
7562
|
+
};
|
|
7530
7563
|
} (utils$g));
|
|
7531
7564
|
|
|
7532
7565
|
const utils$f = utils$g;
|
|
@@ -9038,9 +9071,9 @@ const isObject$1 = val => val && typeof val === 'object' && !Array.isArray(val);
|
|
|
9038
9071
|
* @api public
|
|
9039
9072
|
*/
|
|
9040
9073
|
|
|
9041
|
-
const picomatch$
|
|
9074
|
+
const picomatch$2 = (glob, options, returnState = false) => {
|
|
9042
9075
|
if (Array.isArray(glob)) {
|
|
9043
|
-
const fns = glob.map(input => picomatch$
|
|
9076
|
+
const fns = glob.map(input => picomatch$2(input, options, returnState));
|
|
9044
9077
|
const arrayMatcher = str => {
|
|
9045
9078
|
for (const isMatch of fns) {
|
|
9046
9079
|
const state = isMatch(str);
|
|
@@ -9060,8 +9093,8 @@ const picomatch$1 = (glob, options, returnState = false) => {
|
|
|
9060
9093
|
const opts = options || {};
|
|
9061
9094
|
const posix = utils$d.isWindows(options);
|
|
9062
9095
|
const regex = isState
|
|
9063
|
-
? picomatch$
|
|
9064
|
-
: picomatch$
|
|
9096
|
+
? picomatch$2.compileRe(glob, options)
|
|
9097
|
+
: picomatch$2.makeRe(glob, options, false, true);
|
|
9065
9098
|
|
|
9066
9099
|
const state = regex.state;
|
|
9067
9100
|
delete regex.state;
|
|
@@ -9069,11 +9102,11 @@ const picomatch$1 = (glob, options, returnState = false) => {
|
|
|
9069
9102
|
let isIgnored = () => false;
|
|
9070
9103
|
if (opts.ignore) {
|
|
9071
9104
|
const ignoreOpts = { ...options, ignore: null, onMatch: null, onResult: null };
|
|
9072
|
-
isIgnored = picomatch$
|
|
9105
|
+
isIgnored = picomatch$2(opts.ignore, ignoreOpts, returnState);
|
|
9073
9106
|
}
|
|
9074
9107
|
|
|
9075
9108
|
const matcher = (input, returnObject = false) => {
|
|
9076
|
-
const { isMatch, match, output } = picomatch$
|
|
9109
|
+
const { isMatch, match, output } = picomatch$2.test(input, regex, options, { glob, posix });
|
|
9077
9110
|
const result = { glob, state, regex, posix, input, output, match, isMatch };
|
|
9078
9111
|
|
|
9079
9112
|
if (typeof opts.onResult === 'function') {
|
|
@@ -9123,7 +9156,7 @@ const picomatch$1 = (glob, options, returnState = false) => {
|
|
|
9123
9156
|
* @api public
|
|
9124
9157
|
*/
|
|
9125
9158
|
|
|
9126
|
-
picomatch$
|
|
9159
|
+
picomatch$2.test = (input, regex, options, { glob, posix } = {}) => {
|
|
9127
9160
|
if (typeof input !== 'string') {
|
|
9128
9161
|
throw new TypeError('Expected input to be a string');
|
|
9129
9162
|
}
|
|
@@ -9144,7 +9177,7 @@ picomatch$1.test = (input, regex, options, { glob, posix } = {}) => {
|
|
|
9144
9177
|
|
|
9145
9178
|
if (match === false || opts.capture === true) {
|
|
9146
9179
|
if (opts.matchBase === true || opts.basename === true) {
|
|
9147
|
-
match = picomatch$
|
|
9180
|
+
match = picomatch$2.matchBase(input, regex, options, posix);
|
|
9148
9181
|
} else {
|
|
9149
9182
|
match = regex.exec(output);
|
|
9150
9183
|
}
|
|
@@ -9167,8 +9200,8 @@ picomatch$1.test = (input, regex, options, { glob, posix } = {}) => {
|
|
|
9167
9200
|
* @api public
|
|
9168
9201
|
*/
|
|
9169
9202
|
|
|
9170
|
-
picomatch$
|
|
9171
|
-
const regex = glob instanceof RegExp ? glob : picomatch$
|
|
9203
|
+
picomatch$2.matchBase = (input, glob, options, posix = utils$d.isWindows(options)) => {
|
|
9204
|
+
const regex = glob instanceof RegExp ? glob : picomatch$2.makeRe(glob, options);
|
|
9172
9205
|
return regex.test(path$7.basename(input));
|
|
9173
9206
|
};
|
|
9174
9207
|
|
|
@@ -9189,7 +9222,7 @@ picomatch$1.matchBase = (input, glob, options, posix = utils$d.isWindows(options
|
|
|
9189
9222
|
* @api public
|
|
9190
9223
|
*/
|
|
9191
9224
|
|
|
9192
|
-
picomatch$
|
|
9225
|
+
picomatch$2.isMatch = (str, patterns, options) => picomatch$2(patterns, options)(str);
|
|
9193
9226
|
|
|
9194
9227
|
/**
|
|
9195
9228
|
* Parse a glob pattern to create the source string for a regular
|
|
@@ -9205,8 +9238,8 @@ picomatch$1.isMatch = (str, patterns, options) => picomatch$1(patterns, options)
|
|
|
9205
9238
|
* @api public
|
|
9206
9239
|
*/
|
|
9207
9240
|
|
|
9208
|
-
picomatch$
|
|
9209
|
-
if (Array.isArray(pattern)) return pattern.map(p => picomatch$
|
|
9241
|
+
picomatch$2.parse = (pattern, options) => {
|
|
9242
|
+
if (Array.isArray(pattern)) return pattern.map(p => picomatch$2.parse(p, options));
|
|
9210
9243
|
return parse$2(pattern, { ...options, fastpaths: false });
|
|
9211
9244
|
};
|
|
9212
9245
|
|
|
@@ -9237,7 +9270,7 @@ picomatch$1.parse = (pattern, options) => {
|
|
|
9237
9270
|
* @api public
|
|
9238
9271
|
*/
|
|
9239
9272
|
|
|
9240
|
-
picomatch$
|
|
9273
|
+
picomatch$2.scan = (input, options) => scan$1(input, options);
|
|
9241
9274
|
|
|
9242
9275
|
/**
|
|
9243
9276
|
* Compile a regular expression from the `state` object returned by the
|
|
@@ -9251,7 +9284,7 @@ picomatch$1.scan = (input, options) => scan$1(input, options);
|
|
|
9251
9284
|
* @api public
|
|
9252
9285
|
*/
|
|
9253
9286
|
|
|
9254
|
-
picomatch$
|
|
9287
|
+
picomatch$2.compileRe = (state, options, returnOutput = false, returnState = false) => {
|
|
9255
9288
|
if (returnOutput === true) {
|
|
9256
9289
|
return state.output;
|
|
9257
9290
|
}
|
|
@@ -9265,7 +9298,7 @@ picomatch$1.compileRe = (state, options, returnOutput = false, returnState = fal
|
|
|
9265
9298
|
source = `^(?!${source}).*$`;
|
|
9266
9299
|
}
|
|
9267
9300
|
|
|
9268
|
-
const regex = picomatch$
|
|
9301
|
+
const regex = picomatch$2.toRegex(source, options);
|
|
9269
9302
|
if (returnState === true) {
|
|
9270
9303
|
regex.state = state;
|
|
9271
9304
|
}
|
|
@@ -9292,7 +9325,7 @@ picomatch$1.compileRe = (state, options, returnOutput = false, returnState = fal
|
|
|
9292
9325
|
* @api public
|
|
9293
9326
|
*/
|
|
9294
9327
|
|
|
9295
|
-
picomatch$
|
|
9328
|
+
picomatch$2.makeRe = (input, options = {}, returnOutput = false, returnState = false) => {
|
|
9296
9329
|
if (!input || typeof input !== 'string') {
|
|
9297
9330
|
throw new TypeError('Expected a non-empty string');
|
|
9298
9331
|
}
|
|
@@ -9307,7 +9340,7 @@ picomatch$1.makeRe = (input, options = {}, returnOutput = false, returnState = f
|
|
|
9307
9340
|
parsed = parse$2(input, options);
|
|
9308
9341
|
}
|
|
9309
9342
|
|
|
9310
|
-
return picomatch$
|
|
9343
|
+
return picomatch$2.compileRe(parsed, options, returnOutput, returnState);
|
|
9311
9344
|
};
|
|
9312
9345
|
|
|
9313
9346
|
/**
|
|
@@ -9327,7 +9360,7 @@ picomatch$1.makeRe = (input, options = {}, returnOutput = false, returnState = f
|
|
|
9327
9360
|
* @api public
|
|
9328
9361
|
*/
|
|
9329
9362
|
|
|
9330
|
-
picomatch$
|
|
9363
|
+
picomatch$2.toRegex = (source, options) => {
|
|
9331
9364
|
try {
|
|
9332
9365
|
const opts = options || {};
|
|
9333
9366
|
return new RegExp(source, opts.flags || (opts.nocase ? 'i' : ''));
|
|
@@ -9342,22 +9375,19 @@ picomatch$1.toRegex = (source, options) => {
|
|
|
9342
9375
|
* @return {Object}
|
|
9343
9376
|
*/
|
|
9344
9377
|
|
|
9345
|
-
picomatch$
|
|
9378
|
+
picomatch$2.constants = constants$9;
|
|
9346
9379
|
|
|
9347
9380
|
/**
|
|
9348
9381
|
* Expose "picomatch"
|
|
9349
9382
|
*/
|
|
9350
9383
|
|
|
9351
|
-
var picomatch_1 = picomatch$
|
|
9384
|
+
var picomatch_1 = picomatch$2;
|
|
9352
9385
|
|
|
9353
|
-
|
|
9354
|
-
|
|
9355
|
-
module.exports = picomatch_1;
|
|
9356
|
-
} (picomatch$2));
|
|
9386
|
+
var picomatch$1 = picomatch_1;
|
|
9357
9387
|
|
|
9358
9388
|
const util$7 = require$$0__default["default"];
|
|
9359
9389
|
const braces = braces_1;
|
|
9360
|
-
const picomatch = picomatch$
|
|
9390
|
+
const picomatch = picomatch$1;
|
|
9361
9391
|
const utils$c = utils$g;
|
|
9362
9392
|
const isEmptyString = val => val === '' || val === './';
|
|
9363
9393
|
|
|
@@ -10411,7 +10441,7 @@ var fs$a = {};
|
|
|
10411
10441
|
}
|
|
10412
10442
|
return Object.assign(Object.assign({}, exports.FILE_SYSTEM_ADAPTER), fsMethods);
|
|
10413
10443
|
}
|
|
10414
|
-
exports.createFileSystemAdapter = createFileSystemAdapter;
|
|
10444
|
+
exports.createFileSystemAdapter = createFileSystemAdapter;
|
|
10415
10445
|
} (fs$a));
|
|
10416
10446
|
|
|
10417
10447
|
Object.defineProperty(settings$3, "__esModule", { value: true });
|
|
@@ -10764,7 +10794,7 @@ var fs$6 = {};
|
|
|
10764
10794
|
}
|
|
10765
10795
|
return Object.assign(Object.assign({}, exports.FILE_SYSTEM_ADAPTER), fsMethods);
|
|
10766
10796
|
}
|
|
10767
|
-
exports.createFileSystemAdapter = createFileSystemAdapter;
|
|
10797
|
+
exports.createFileSystemAdapter = createFileSystemAdapter;
|
|
10768
10798
|
} (fs$6));
|
|
10769
10799
|
|
|
10770
10800
|
Object.defineProperty(settings$2, "__esModule", { value: true });
|
|
@@ -11140,6 +11170,8 @@ function queueAsPromised (context, worker, concurrency) {
|
|
|
11140
11170
|
queue.exports = fastqueue;
|
|
11141
11171
|
queue.exports.promise = queueAsPromised;
|
|
11142
11172
|
|
|
11173
|
+
var queueExports = queue.exports;
|
|
11174
|
+
|
|
11143
11175
|
var common$4 = {};
|
|
11144
11176
|
|
|
11145
11177
|
Object.defineProperty(common$4, "__esModule", { value: true });
|
|
@@ -11189,7 +11221,7 @@ reader$1.default = Reader$1;
|
|
|
11189
11221
|
Object.defineProperty(async$4, "__esModule", { value: true });
|
|
11190
11222
|
const events_1 = require$$0__default$2["default"];
|
|
11191
11223
|
const fsScandir$2 = out$2;
|
|
11192
|
-
const fastq =
|
|
11224
|
+
const fastq = queueExports;
|
|
11193
11225
|
const common$2 = common$4;
|
|
11194
11226
|
const reader_1$4 = reader$1;
|
|
11195
11227
|
class AsyncReader extends reader_1$4.default {
|
|
@@ -12112,7 +12144,7 @@ var settings = {};
|
|
|
12112
12144
|
return Object.assign(Object.assign({}, exports.DEFAULT_FILE_SYSTEM_ADAPTER), methods);
|
|
12113
12145
|
}
|
|
12114
12146
|
}
|
|
12115
|
-
exports.default = Settings;
|
|
12147
|
+
exports.default = Settings;
|
|
12116
12148
|
} (settings));
|
|
12117
12149
|
|
|
12118
12150
|
const taskManager = tasks;
|
|
@@ -13706,6 +13738,8 @@ anyBase.HEX = '0123456789abcdef';
|
|
|
13706
13738
|
|
|
13707
13739
|
var anyBase_1 = anyBase;
|
|
13708
13740
|
|
|
13741
|
+
var anyBase$1 = /*@__PURE__*/getDefaultExportFromCjs(anyBase_1);
|
|
13742
|
+
|
|
13709
13743
|
var pixelmatch_1 = pixelmatch;
|
|
13710
13744
|
|
|
13711
13745
|
function pixelmatch(img1, img2, output, width, height, options) {
|
|
@@ -13863,6 +13897,8 @@ function grayPixel(img, i) {
|
|
|
13863
13897
|
return rgb2y(r, g, b);
|
|
13864
13898
|
}
|
|
13865
13899
|
|
|
13900
|
+
var pixelMatch = /*@__PURE__*/getDefaultExportFromCjs(pixelmatch_1);
|
|
13901
|
+
|
|
13866
13902
|
// This file is autogenerated. It's used to publish ESM to npm.
|
|
13867
13903
|
function _typeof$1(obj) {
|
|
13868
13904
|
"@babel/helpers - typeof";
|
|
@@ -15159,13 +15195,23 @@ ImagePHash.prototype.getHash = function (img) {
|
|
|
15159
15195
|
|
|
15160
15196
|
// DCT function stolen from http://stackoverflow.com/questions/4240490/problems-with-dct-and-idct-algorithm-in-java
|
|
15161
15197
|
|
|
15198
|
+
/**
|
|
15199
|
+
Convert a 32-bit integer color value to an RGBA object.
|
|
15200
|
+
*/
|
|
15162
15201
|
function intToRGBA(i) {
|
|
15163
|
-
const
|
|
15164
|
-
|
|
15165
|
-
|
|
15166
|
-
|
|
15167
|
-
|
|
15168
|
-
|
|
15202
|
+
const a = i & 0xff;
|
|
15203
|
+
i >>>= 8;
|
|
15204
|
+
const b = i & 0xff;
|
|
15205
|
+
i >>>= 8;
|
|
15206
|
+
const g = i & 0xff;
|
|
15207
|
+
i >>>= 8;
|
|
15208
|
+
const r = i & 0xff;
|
|
15209
|
+
return {
|
|
15210
|
+
r,
|
|
15211
|
+
g,
|
|
15212
|
+
b,
|
|
15213
|
+
a
|
|
15214
|
+
};
|
|
15169
15215
|
}
|
|
15170
15216
|
const c$1 = [];
|
|
15171
15217
|
function initCoefficients(size) {
|
|
@@ -15389,6 +15435,8 @@ conversions["RegExp"] = function (V, opts) {
|
|
|
15389
15435
|
|
|
15390
15436
|
var utils = {exports: {}};
|
|
15391
15437
|
|
|
15438
|
+
utils.exports;
|
|
15439
|
+
|
|
15392
15440
|
(function (module) {
|
|
15393
15441
|
|
|
15394
15442
|
module.exports.mixin = function mixin(target, source) {
|
|
@@ -15407,9 +15455,11 @@ var utils = {exports: {}};
|
|
|
15407
15455
|
|
|
15408
15456
|
module.exports.implForWrapper = function (wrapper) {
|
|
15409
15457
|
return wrapper[module.exports.implSymbol];
|
|
15410
|
-
};
|
|
15458
|
+
};
|
|
15411
15459
|
} (utils));
|
|
15412
15460
|
|
|
15461
|
+
var utilsExports = utils.exports;
|
|
15462
|
+
|
|
15413
15463
|
var URLImpl = {};
|
|
15414
15464
|
|
|
15415
15465
|
var urlStateMachine = {exports: {}};
|
|
@@ -93259,6 +93309,8 @@ tr46.toUnicode = function(domain_name, useSTD3) {
|
|
|
93259
93309
|
|
|
93260
93310
|
tr46.PROCESSING_OPTIONS = PROCESSING_OPTIONS;
|
|
93261
93311
|
|
|
93312
|
+
urlStateMachine.exports;
|
|
93313
|
+
|
|
93262
93314
|
(function (module) {
|
|
93263
93315
|
const punycode = require$$0__default$3["default"];
|
|
93264
93316
|
const tr46$1 = tr46;
|
|
@@ -94554,10 +94606,12 @@ tr46.PROCESSING_OPTIONS = PROCESSING_OPTIONS;
|
|
|
94554
94606
|
|
|
94555
94607
|
// We don't handle blobs, so this just delegates:
|
|
94556
94608
|
return module.exports.basicURLParse(input, { baseURL: options.baseURL, encodingOverride: options.encodingOverride });
|
|
94557
|
-
};
|
|
94609
|
+
};
|
|
94558
94610
|
} (urlStateMachine));
|
|
94559
94611
|
|
|
94560
|
-
|
|
94612
|
+
var urlStateMachineExports = urlStateMachine.exports;
|
|
94613
|
+
|
|
94614
|
+
const usm = urlStateMachineExports;
|
|
94561
94615
|
|
|
94562
94616
|
URLImpl.implementation = class URLImpl {
|
|
94563
94617
|
constructor(constructorArgs) {
|
|
@@ -94757,13 +94811,15 @@ URLImpl.implementation = class URLImpl {
|
|
|
94757
94811
|
}
|
|
94758
94812
|
};
|
|
94759
94813
|
|
|
94814
|
+
URL$2.exports;
|
|
94815
|
+
|
|
94760
94816
|
(function (module) {
|
|
94761
94817
|
|
|
94762
94818
|
const conversions = lib$6;
|
|
94763
|
-
const utils
|
|
94819
|
+
const utils = utilsExports;
|
|
94764
94820
|
const Impl = URLImpl;
|
|
94765
94821
|
|
|
94766
|
-
const impl = utils
|
|
94822
|
+
const impl = utils.implSymbol;
|
|
94767
94823
|
|
|
94768
94824
|
function URL(url) {
|
|
94769
94825
|
if (!this || this[impl] || !(this instanceof URL)) {
|
|
@@ -94944,25 +95000,27 @@ URLImpl.implementation = class URLImpl {
|
|
|
94944
95000
|
privateData.wrapper = obj;
|
|
94945
95001
|
|
|
94946
95002
|
obj[impl] = new Impl.implementation(constructorArgs, privateData);
|
|
94947
|
-
obj[impl][utils
|
|
95003
|
+
obj[impl][utils.wrapperSymbol] = obj;
|
|
94948
95004
|
},
|
|
94949
95005
|
interface: URL,
|
|
94950
95006
|
expose: {
|
|
94951
95007
|
Window: { URL: URL },
|
|
94952
95008
|
Worker: { URL: URL }
|
|
94953
95009
|
}
|
|
94954
|
-
};
|
|
95010
|
+
};
|
|
94955
95011
|
} (URL$2));
|
|
94956
95012
|
|
|
94957
|
-
|
|
94958
|
-
|
|
94959
|
-
publicApi.
|
|
94960
|
-
publicApi.
|
|
94961
|
-
publicApi.
|
|
94962
|
-
publicApi.
|
|
94963
|
-
publicApi.
|
|
94964
|
-
publicApi.
|
|
94965
|
-
publicApi.
|
|
95013
|
+
var URLExports = URL$2.exports;
|
|
95014
|
+
|
|
95015
|
+
publicApi.URL = URLExports.interface;
|
|
95016
|
+
publicApi.serializeURL = urlStateMachineExports.serializeURL;
|
|
95017
|
+
publicApi.serializeURLOrigin = urlStateMachineExports.serializeURLOrigin;
|
|
95018
|
+
publicApi.basicURLParse = urlStateMachineExports.basicURLParse;
|
|
95019
|
+
publicApi.setTheUsername = urlStateMachineExports.setTheUsername;
|
|
95020
|
+
publicApi.setThePassword = urlStateMachineExports.setThePassword;
|
|
95021
|
+
publicApi.serializeHost = urlStateMachineExports.serializeHost;
|
|
95022
|
+
publicApi.serializeInteger = urlStateMachineExports.serializeInteger;
|
|
95023
|
+
publicApi.parseURL = urlStateMachineExports.parseURL;
|
|
94966
95024
|
|
|
94967
95025
|
// Based on https://github.com/tmpvar/jsdom/blob/aa85b2abf07766ff7bf5c1f6daafb3726f2f2db5/lib/jsdom/living/blob.js
|
|
94968
95026
|
|
|
@@ -96742,6 +96800,8 @@ var lib$5 = /*#__PURE__*/Object.freeze({
|
|
|
96742
96800
|
|
|
96743
96801
|
var require$$0 = /*@__PURE__*/getAugmentedNamespace(lib$5);
|
|
96744
96802
|
|
|
96803
|
+
fetchNpmNode.exports;
|
|
96804
|
+
|
|
96745
96805
|
(function (module) {
|
|
96746
96806
|
|
|
96747
96807
|
var realFetch = require$$0;
|
|
@@ -96757,9 +96817,11 @@ var require$$0 = /*@__PURE__*/getAugmentedNamespace(lib$5);
|
|
|
96757
96817
|
commonjsGlobal.Response = realFetch.Response;
|
|
96758
96818
|
commonjsGlobal.Headers = realFetch.Headers;
|
|
96759
96819
|
commonjsGlobal.Request = realFetch.Request;
|
|
96760
|
-
}
|
|
96820
|
+
}
|
|
96761
96821
|
} (fetchNpmNode));
|
|
96762
96822
|
|
|
96823
|
+
fetchNpmNode.exports;
|
|
96824
|
+
|
|
96763
96825
|
var request$1 = ((_ref, cb) => {
|
|
96764
96826
|
let {
|
|
96765
96827
|
url,
|
|
@@ -97273,7 +97335,7 @@ var EndOfFileStream = {};
|
|
|
97273
97335
|
super(exports.defaultMessages);
|
|
97274
97336
|
}
|
|
97275
97337
|
}
|
|
97276
|
-
exports.EndOfStreamError = EndOfStreamError;
|
|
97338
|
+
exports.EndOfStreamError = EndOfStreamError;
|
|
97277
97339
|
} (EndOfFileStream));
|
|
97278
97340
|
|
|
97279
97341
|
var StreamReader = {};
|
|
@@ -97427,7 +97489,7 @@ Deferred$1.Deferred = Deferred;
|
|
|
97427
97489
|
}
|
|
97428
97490
|
}
|
|
97429
97491
|
}
|
|
97430
|
-
exports.StreamReader = StreamReader;
|
|
97492
|
+
exports.StreamReader = StreamReader;
|
|
97431
97493
|
} (StreamReader));
|
|
97432
97494
|
|
|
97433
97495
|
(function (exports) {
|
|
@@ -97436,7 +97498,7 @@ Deferred$1.Deferred = Deferred;
|
|
|
97436
97498
|
var EndOfFileStream_1 = EndOfFileStream;
|
|
97437
97499
|
Object.defineProperty(exports, "EndOfStreamError", { enumerable: true, get: function () { return EndOfFileStream_1.EndOfStreamError; } });
|
|
97438
97500
|
var StreamReader_1 = StreamReader;
|
|
97439
|
-
Object.defineProperty(exports, "StreamReader", { enumerable: true, get: function () { return StreamReader_1.StreamReader; } });
|
|
97501
|
+
Object.defineProperty(exports, "StreamReader", { enumerable: true, get: function () { return StreamReader_1.StreamReader; } });
|
|
97440
97502
|
} (lib$3));
|
|
97441
97503
|
|
|
97442
97504
|
Object.defineProperty(AbstractTokenizer$1, "__esModule", { value: true });
|
|
@@ -97726,7 +97788,7 @@ BufferTokenizer$1.BufferTokenizer = BufferTokenizer;
|
|
|
97726
97788
|
function fromBuffer(uint8Array, fileInfo) {
|
|
97727
97789
|
return new BufferTokenizer_1.BufferTokenizer(uint8Array, fileInfo);
|
|
97728
97790
|
}
|
|
97729
|
-
exports.fromBuffer = fromBuffer;
|
|
97791
|
+
exports.fromBuffer = fromBuffer;
|
|
97730
97792
|
} (core$2));
|
|
97731
97793
|
|
|
97732
97794
|
var FileTokenizer$1 = {};
|
|
@@ -97812,7 +97874,7 @@ FileTokenizer$1.fromFile = fromFile$1;
|
|
|
97812
97874
|
}
|
|
97813
97875
|
return core.fromStream(stream, fileInfo);
|
|
97814
97876
|
}
|
|
97815
|
-
exports.fromStream = fromStream;
|
|
97877
|
+
exports.fromStream = fromStream;
|
|
97816
97878
|
} (lib$4));
|
|
97817
97879
|
|
|
97818
97880
|
var lib$2 = {};
|
|
@@ -98360,7 +98422,7 @@ ieee754.write = function (buffer, value, offset, isLE, mLen, nBytes) {
|
|
|
98360
98422
|
201, 202, 203, 204, 205, 206, 207, 208, 209, 210, 211, 212, 213, 214, 215, 216,
|
|
98361
98423
|
217, 218, 219, 220, 221, 222, 223, 224, 225, 226, 227, 228, 229, 230, 231, 232,
|
|
98362
98424
|
233, 234, 235, 236, 237, 238, 239, 240, 241, 242, 243, 244, 245, 246, 247,
|
|
98363
|
-
248, 249, 250, 251, 252, 253, 254, 255];
|
|
98425
|
+
248, 249, 250, 251, 252, 253, 254, 255];
|
|
98364
98426
|
} (lib$2));
|
|
98365
98427
|
|
|
98366
98428
|
var util$6 = {};
|
|
@@ -100179,6 +100241,8 @@ Object.defineProperty(fileType, 'mimeTypes', {
|
|
|
100179
100241
|
|
|
100180
100242
|
var fileType_1 = fileType;
|
|
100181
100243
|
|
|
100244
|
+
var FileType = /*@__PURE__*/getDefaultExportFromCjs(fileType_1);
|
|
100245
|
+
|
|
100182
100246
|
/*jslint browser: true, devel: true, bitwise: false, debug: true, eqeq: false, es5: true, evil: false, forin: false, newcap: false, nomen: true, plusplus: true, regexp: false, unparam: false, sloppy: true, stupid: false, sub: false, todo: true, vars: true, white: true */
|
|
100183
100247
|
|
|
100184
100248
|
var jpeg$2 = {
|
|
@@ -101480,8 +101544,10 @@ var exifParser = {
|
|
|
101480
101544
|
}
|
|
101481
101545
|
};
|
|
101482
101546
|
|
|
101547
|
+
var EXIFParser = /*@__PURE__*/getDefaultExportFromCjs(exifParser);
|
|
101548
|
+
|
|
101483
101549
|
async function getMIMEFromBuffer(buffer, path) {
|
|
101484
|
-
const fileTypeFromBuffer = await
|
|
101550
|
+
const fileTypeFromBuffer = await FileType.fromBuffer(buffer);
|
|
101485
101551
|
if (fileTypeFromBuffer) {
|
|
101486
101552
|
// If fileType returns something for buffer, then return the mime given
|
|
101487
101553
|
return fileTypeFromBuffer.mime;
|
|
@@ -101627,7 +101693,7 @@ async function parseBitmap(data, path, cb) {
|
|
|
101627
101693
|
return cb.call(this, error, this);
|
|
101628
101694
|
}
|
|
101629
101695
|
try {
|
|
101630
|
-
this._exif =
|
|
101696
|
+
this._exif = EXIFParser.create(data).parse();
|
|
101631
101697
|
exifRotate(this); // EXIF data
|
|
101632
101698
|
} catch (error) {
|
|
101633
101699
|
/* meh */
|
|
@@ -101693,7 +101759,7 @@ const alphabet = "0123456789abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ
|
|
|
101693
101759
|
// 0 and 1 do not exist as possible hash lengths
|
|
101694
101760
|
const maxHashLength = [NaN, NaN];
|
|
101695
101761
|
for (let i = 2; i < 65; i++) {
|
|
101696
|
-
const maxHash =
|
|
101762
|
+
const maxHash = anyBase$1(anyBase$1.BIN, alphabet.slice(0, i))(new Array(64 + 1).join("1"));
|
|
101697
101763
|
maxHashLength.push(maxHash.length);
|
|
101698
101764
|
}
|
|
101699
101765
|
|
|
@@ -102166,7 +102232,7 @@ class Jimp$1 extends require$$0__default$2["default"] {
|
|
|
102166
102232
|
return throwError.call(this, "base must be a number between 2 and 64", cb);
|
|
102167
102233
|
}
|
|
102168
102234
|
let hash = this.pHash();
|
|
102169
|
-
hash =
|
|
102235
|
+
hash = anyBase$1(anyBase$1.BIN, alphabet.slice(0, base))(hash);
|
|
102170
102236
|
while (hash.length < maxHashLength[base]) {
|
|
102171
102237
|
hash = "0" + hash; // pad out with leading zeros
|
|
102172
102238
|
}
|
|
@@ -102275,10 +102341,6 @@ class Jimp$1 extends require$$0__default$2["default"] {
|
|
|
102275
102341
|
*/
|
|
102276
102342
|
getPixelColor(x, y, cb) {
|
|
102277
102343
|
if (typeof x !== "number" || typeof y !== "number") return throwError.call(this, "x and y must be numbers", cb);
|
|
102278
|
-
|
|
102279
|
-
// round input
|
|
102280
|
-
x = Math.round(x);
|
|
102281
|
-
y = Math.round(y);
|
|
102282
102344
|
const idx = this.getPixelIndex(x, y);
|
|
102283
102345
|
const hex = this.bitmap.data.readUInt32BE(idx);
|
|
102284
102346
|
if (isNodePattern(cb)) {
|
|
@@ -102296,10 +102358,6 @@ class Jimp$1 extends require$$0__default$2["default"] {
|
|
|
102296
102358
|
*/
|
|
102297
102359
|
setPixelColor(hex, x, y, cb) {
|
|
102298
102360
|
if (typeof hex !== "number" || typeof x !== "number" || typeof y !== "number") return throwError.call(this, "hex, x and y must be numbers", cb);
|
|
102299
|
-
|
|
102300
|
-
// round input
|
|
102301
|
-
x = Math.round(x);
|
|
102302
|
-
y = Math.round(y);
|
|
102303
102361
|
const idx = this.getPixelIndex(x, y);
|
|
102304
102362
|
this.bitmap.data.writeUInt32BE(hex, idx);
|
|
102305
102363
|
if (isNodePattern(cb)) {
|
|
@@ -102312,13 +102370,15 @@ class Jimp$1 extends require$$0__default$2["default"] {
|
|
|
102312
102370
|
* @return {boolean} hasAlpha whether the image contains opaque pixels
|
|
102313
102371
|
*/
|
|
102314
102372
|
hasAlpha() {
|
|
102315
|
-
|
|
102316
|
-
|
|
102317
|
-
|
|
102318
|
-
|
|
102319
|
-
|
|
102320
|
-
|
|
102321
|
-
|
|
102373
|
+
const {
|
|
102374
|
+
width,
|
|
102375
|
+
height,
|
|
102376
|
+
data
|
|
102377
|
+
} = this.bitmap;
|
|
102378
|
+
const byteLen = width * height << 2;
|
|
102379
|
+
for (let idx = 3; idx < byteLen; idx += 4) {
|
|
102380
|
+
if (data[idx] !== 0xff) {
|
|
102381
|
+
return true;
|
|
102322
102382
|
}
|
|
102323
102383
|
}
|
|
102324
102384
|
return false;
|
|
@@ -102418,11 +102478,16 @@ Jimp$1.rgbaToInt = function (r, g, b, a, cb) {
|
|
|
102418
102478
|
if (a < 0 || a > 255) {
|
|
102419
102479
|
return throwError.call(this, "a must be between 0 and 255", cb);
|
|
102420
102480
|
}
|
|
102421
|
-
|
|
102422
|
-
|
|
102423
|
-
g
|
|
102424
|
-
|
|
102425
|
-
|
|
102481
|
+
let i = r & 0xff;
|
|
102482
|
+
i <<= 8;
|
|
102483
|
+
i |= g & 0xff;
|
|
102484
|
+
i <<= 8;
|
|
102485
|
+
i |= b & 0xff;
|
|
102486
|
+
i <<= 8;
|
|
102487
|
+
i |= a & 0xff;
|
|
102488
|
+
|
|
102489
|
+
// Ensure sign is correct
|
|
102490
|
+
i >>>= 0;
|
|
102426
102491
|
if (isNodePattern(cb)) {
|
|
102427
102492
|
cb.call(this, null, i);
|
|
102428
102493
|
}
|
|
@@ -102498,7 +102563,7 @@ Jimp$1.diff = function (img1, img2) {
|
|
|
102498
102563
|
return throwError.call(this, "threshold must be a number between 0 and 1");
|
|
102499
102564
|
}
|
|
102500
102565
|
const diff = new Jimp$1(bmp1.width, bmp1.height, 0xffffffff);
|
|
102501
|
-
const numDiffPixels =
|
|
102566
|
+
const numDiffPixels = pixelMatch(bmp1.data, bmp2.data, diff.bitmap.data, diff.bitmap.width, diff.bitmap.height, {
|
|
102502
102567
|
threshold
|
|
102503
102568
|
});
|
|
102504
102569
|
return {
|
|
@@ -103460,6 +103525,7 @@ var encoder$1 = {exports: {}};
|
|
|
103460
103525
|
NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
|
|
103461
103526
|
SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
|
103462
103527
|
*/
|
|
103528
|
+
encoder$1.exports;
|
|
103463
103529
|
|
|
103464
103530
|
(function (module) {
|
|
103465
103531
|
|
|
@@ -104205,10 +104271,13 @@ var encoder$1 = {exports: {}};
|
|
|
104205
104271
|
}
|
|
104206
104272
|
} (encoder$1));
|
|
104207
104273
|
|
|
104274
|
+
var encoderExports = encoder$1.exports;
|
|
104275
|
+
|
|
104208
104276
|
var decoder$1 = {exports: {}};
|
|
104209
104277
|
|
|
104210
104278
|
/* -*- tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- /
|
|
104211
104279
|
/* vim: set shiftwidth=2 tabstop=2 autoindent cindent expandtab: */
|
|
104280
|
+
decoder$1.exports;
|
|
104212
104281
|
|
|
104213
104282
|
(function (module) {
|
|
104214
104283
|
/*
|
|
@@ -105353,17 +105422,21 @@ var decoder$1 = {exports: {}};
|
|
|
105353
105422
|
decoder.copyToImageData(image, opts.formatAsRGBA);
|
|
105354
105423
|
|
|
105355
105424
|
return image;
|
|
105356
|
-
}
|
|
105425
|
+
}
|
|
105357
105426
|
} (decoder$1));
|
|
105358
105427
|
|
|
105359
|
-
var
|
|
105360
|
-
|
|
105428
|
+
var decoderExports = decoder$1.exports;
|
|
105429
|
+
|
|
105430
|
+
var encode$2 = encoderExports,
|
|
105431
|
+
decode$2 = decoderExports;
|
|
105361
105432
|
|
|
105362
105433
|
var jpegJs = {
|
|
105363
105434
|
encode: encode$2,
|
|
105364
105435
|
decode: decode$2
|
|
105365
105436
|
};
|
|
105366
105437
|
|
|
105438
|
+
var JPEG = /*@__PURE__*/getDefaultExportFromCjs(jpegJs);
|
|
105439
|
+
|
|
105367
105440
|
const MIME_TYPE$4 = "image/jpeg";
|
|
105368
105441
|
var jpeg = (() => ({
|
|
105369
105442
|
mime: {
|
|
@@ -105373,10 +105446,10 @@ var jpeg = (() => ({
|
|
|
105373
105446
|
MIME_JPEG: MIME_TYPE$4
|
|
105374
105447
|
},
|
|
105375
105448
|
decoders: {
|
|
105376
|
-
[MIME_TYPE$4]:
|
|
105449
|
+
[MIME_TYPE$4]: JPEG.decode
|
|
105377
105450
|
},
|
|
105378
105451
|
encoders: {
|
|
105379
|
-
[MIME_TYPE$4]: image =>
|
|
105452
|
+
[MIME_TYPE$4]: image => JPEG.encode(image.bitmap, image._quality).data
|
|
105380
105453
|
},
|
|
105381
105454
|
class: {
|
|
105382
105455
|
// The quality to be used when saving JPEG images
|
|
@@ -105595,6 +105668,8 @@ ChunkStream$2.prototype._process = function () {
|
|
|
105595
105668
|
}
|
|
105596
105669
|
};
|
|
105597
105670
|
|
|
105671
|
+
var chunkstreamExports = chunkstream.exports;
|
|
105672
|
+
|
|
105598
105673
|
var filterParseAsync = {exports: {}};
|
|
105599
105674
|
|
|
105600
105675
|
var filterParse = {exports: {}};
|
|
@@ -105886,9 +105961,11 @@ Filter$2.prototype._reverseFilterLine = function (rawData) {
|
|
|
105886
105961
|
}
|
|
105887
105962
|
};
|
|
105888
105963
|
|
|
105964
|
+
var filterParseExports = filterParse.exports;
|
|
105965
|
+
|
|
105889
105966
|
let util$4 = require$$0__default["default"];
|
|
105890
|
-
let ChunkStream$1 =
|
|
105891
|
-
let Filter$1 =
|
|
105967
|
+
let ChunkStream$1 = chunkstreamExports;
|
|
105968
|
+
let Filter$1 = filterParseExports;
|
|
105892
105969
|
|
|
105893
105970
|
let FilterAsync$1 = (filterParseAsync.exports = function (bitmapInfo) {
|
|
105894
105971
|
ChunkStream$1.call(this);
|
|
@@ -105909,6 +105986,8 @@ let FilterAsync$1 = (filterParseAsync.exports = function (bitmapInfo) {
|
|
|
105909
105986
|
});
|
|
105910
105987
|
util$4.inherits(FilterAsync$1, ChunkStream$1);
|
|
105911
105988
|
|
|
105989
|
+
var filterParseAsyncExports = filterParseAsync.exports;
|
|
105990
|
+
|
|
105912
105991
|
var parser$1 = {exports: {}};
|
|
105913
105992
|
|
|
105914
105993
|
var constants$6 = {
|
|
@@ -105983,8 +106062,10 @@ CrcCalculator$1.crc32 = function (buf) {
|
|
|
105983
106062
|
return crc ^ -1;
|
|
105984
106063
|
};
|
|
105985
106064
|
|
|
106065
|
+
var crcExports = crc.exports;
|
|
106066
|
+
|
|
105986
106067
|
let constants$5 = constants$6;
|
|
105987
|
-
let CrcCalculator =
|
|
106068
|
+
let CrcCalculator = crcExports;
|
|
105988
106069
|
|
|
105989
106070
|
let Parser$3 = (parser$1.exports = function (options, dependencies) {
|
|
105990
106071
|
this._options = options;
|
|
@@ -106272,6 +106353,8 @@ Parser$3.prototype._parseIEND = function (data) {
|
|
|
106272
106353
|
}
|
|
106273
106354
|
};
|
|
106274
106355
|
|
|
106356
|
+
var parserExports = parser$1.exports;
|
|
106357
|
+
|
|
106275
106358
|
var bitmapper$2 = {};
|
|
106276
106359
|
|
|
106277
106360
|
let interlaceUtils = interlace;
|
|
@@ -106634,9 +106717,9 @@ var formatNormaliser$2 = function (indata, imageData, skipRescale = false) {
|
|
|
106634
106717
|
|
|
106635
106718
|
let util$3 = require$$0__default["default"];
|
|
106636
106719
|
let zlib$4 = zlib__default["default"];
|
|
106637
|
-
let ChunkStream =
|
|
106638
|
-
let FilterAsync =
|
|
106639
|
-
let Parser$2 =
|
|
106720
|
+
let ChunkStream = chunkstreamExports;
|
|
106721
|
+
let FilterAsync = filterParseAsyncExports;
|
|
106722
|
+
let Parser$2 = parserExports;
|
|
106640
106723
|
let bitmapper$1 = bitmapper$2;
|
|
106641
106724
|
let formatNormaliser$1 = formatNormaliser$2;
|
|
106642
106725
|
|
|
@@ -106800,6 +106883,8 @@ ParserAsync.prototype._complete = function (filteredData) {
|
|
|
106800
106883
|
this.emit("parsed", normalisedBitmapData);
|
|
106801
106884
|
};
|
|
106802
106885
|
|
|
106886
|
+
var parserAsyncExports = parserAsync.exports;
|
|
106887
|
+
|
|
106803
106888
|
var packerAsync = {exports: {}};
|
|
106804
106889
|
|
|
106805
106890
|
var packer = {exports: {}};
|
|
@@ -107132,7 +107217,7 @@ var filterPack = function (pxData, width, height, options, bpp) {
|
|
|
107132
107217
|
};
|
|
107133
107218
|
|
|
107134
107219
|
let constants$3 = constants$6;
|
|
107135
|
-
let CrcStream =
|
|
107220
|
+
let CrcStream = crcExports;
|
|
107136
107221
|
let bitPacker = bitpacker;
|
|
107137
107222
|
let filter = filterPack;
|
|
107138
107223
|
let zlib$3 = zlib__default["default"];
|
|
@@ -107259,10 +107344,12 @@ Packer$3.prototype.packIEND = function () {
|
|
|
107259
107344
|
return this._packChunk(constants$3.TYPE_IEND, null);
|
|
107260
107345
|
};
|
|
107261
107346
|
|
|
107347
|
+
var packerExports = packer.exports;
|
|
107348
|
+
|
|
107262
107349
|
let util$2 = require$$0__default["default"];
|
|
107263
107350
|
let Stream$1 = Stream__default["default"];
|
|
107264
107351
|
let constants$2 = constants$6;
|
|
107265
|
-
let Packer$2 =
|
|
107352
|
+
let Packer$2 = packerExports;
|
|
107266
107353
|
|
|
107267
107354
|
let PackerAsync = (packerAsync.exports = function (opt) {
|
|
107268
107355
|
Stream$1.call(this);
|
|
@@ -107308,10 +107395,14 @@ PackerAsync.prototype.pack = function (data, width, height, gamma) {
|
|
|
107308
107395
|
this._deflate.end(filteredData);
|
|
107309
107396
|
};
|
|
107310
107397
|
|
|
107398
|
+
var packerAsyncExports = packerAsync.exports;
|
|
107399
|
+
|
|
107311
107400
|
var pngSync = {};
|
|
107312
107401
|
|
|
107313
107402
|
var syncInflate = {exports: {}};
|
|
107314
107403
|
|
|
107404
|
+
syncInflate.exports;
|
|
107405
|
+
|
|
107315
107406
|
(function (module, exports) {
|
|
107316
107407
|
|
|
107317
107408
|
let assert = require$$0__default$4["default"].ok;
|
|
@@ -107479,9 +107570,11 @@ var syncInflate = {exports: {}};
|
|
|
107479
107570
|
module.exports = exports = inflateSync;
|
|
107480
107571
|
exports.Inflate = Inflate;
|
|
107481
107572
|
exports.createInflate = createInflate;
|
|
107482
|
-
exports.inflateSync = inflateSync;
|
|
107573
|
+
exports.inflateSync = inflateSync;
|
|
107483
107574
|
} (syncInflate, syncInflate.exports));
|
|
107484
107575
|
|
|
107576
|
+
var syncInflateExports = syncInflate.exports;
|
|
107577
|
+
|
|
107485
107578
|
var syncReader = {exports: {}};
|
|
107486
107579
|
|
|
107487
107580
|
let SyncReader$2 = (syncReader.exports = function (buffer) {
|
|
@@ -107528,10 +107621,12 @@ SyncReader$2.prototype.process = function () {
|
|
|
107528
107621
|
}
|
|
107529
107622
|
};
|
|
107530
107623
|
|
|
107624
|
+
var syncReaderExports = syncReader.exports;
|
|
107625
|
+
|
|
107531
107626
|
var filterParseSync = {};
|
|
107532
107627
|
|
|
107533
|
-
let SyncReader$1 =
|
|
107534
|
-
let Filter =
|
|
107628
|
+
let SyncReader$1 = syncReaderExports;
|
|
107629
|
+
let Filter = filterParseExports;
|
|
107535
107630
|
|
|
107536
107631
|
filterParseSync.process = function (inBuffer, bitmapInfo) {
|
|
107537
107632
|
let outBuffers = [];
|
|
@@ -107552,13 +107647,13 @@ filterParseSync.process = function (inBuffer, bitmapInfo) {
|
|
|
107552
107647
|
|
|
107553
107648
|
let hasSyncZlib$1 = true;
|
|
107554
107649
|
let zlib$2 = zlib__default["default"];
|
|
107555
|
-
let inflateSync =
|
|
107650
|
+
let inflateSync = syncInflateExports;
|
|
107556
107651
|
if (!zlib$2.deflateSync) {
|
|
107557
107652
|
hasSyncZlib$1 = false;
|
|
107558
107653
|
}
|
|
107559
|
-
let SyncReader =
|
|
107654
|
+
let SyncReader = syncReaderExports;
|
|
107560
107655
|
let FilterSync = filterParseSync;
|
|
107561
|
-
let Parser$1 =
|
|
107656
|
+
let Parser$1 = parserExports;
|
|
107562
107657
|
let bitmapper = bitmapper$2;
|
|
107563
107658
|
let formatNormaliser = formatNormaliser$2;
|
|
107564
107659
|
|
|
@@ -107667,7 +107762,7 @@ if (!zlib$1.deflateSync) {
|
|
|
107667
107762
|
hasSyncZlib = false;
|
|
107668
107763
|
}
|
|
107669
107764
|
let constants$1 = constants$6;
|
|
107670
|
-
let Packer$1 =
|
|
107765
|
+
let Packer$1 = packerExports;
|
|
107671
107766
|
|
|
107672
107767
|
var packerSync = function (metaData, opt) {
|
|
107673
107768
|
if (!hasSyncZlib) {
|
|
@@ -107731,8 +107826,8 @@ var PNG_1;
|
|
|
107731
107826
|
|
|
107732
107827
|
let util$1 = require$$0__default["default"];
|
|
107733
107828
|
let Stream = Stream__default["default"];
|
|
107734
|
-
let Parser =
|
|
107735
|
-
let Packer =
|
|
107829
|
+
let Parser = parserAsyncExports;
|
|
107830
|
+
let Packer = packerAsyncExports;
|
|
107736
107831
|
let PNGSync = pngSync;
|
|
107737
107832
|
|
|
107738
107833
|
let PNG = (PNG_1 = function (options) {
|
|
@@ -108633,6 +108728,8 @@ var bmpJs = {
|
|
|
108633
108728
|
decode: decode$1
|
|
108634
108729
|
};
|
|
108635
108730
|
|
|
108731
|
+
var BMP = /*@__PURE__*/getDefaultExportFromCjs(bmpJs);
|
|
108732
|
+
|
|
108636
108733
|
const MIME_TYPE$2 = "image/bmp";
|
|
108637
108734
|
const MIME_TYPE_SECOND = "image/x-ms-bmp";
|
|
108638
108735
|
function toAGBR(image) {
|
|
@@ -108661,8 +108758,8 @@ function fromAGBR(bitmap) {
|
|
|
108661
108758
|
this.bitmap.data[index + 3] = bitmap.is_with_alpha ? alpha : 0xff;
|
|
108662
108759
|
}).bitmap;
|
|
108663
108760
|
}
|
|
108664
|
-
const decode = data => fromAGBR(
|
|
108665
|
-
const encode = image =>
|
|
108761
|
+
const decode = data => fromAGBR(BMP.decode(data));
|
|
108762
|
+
const encode = image => BMP.encode(toAGBR(image)).data;
|
|
108666
108763
|
var bmp = (() => ({
|
|
108667
108764
|
mime: {
|
|
108668
108765
|
[MIME_TYPE$2]: ["bmp"]
|
|
@@ -108798,8 +108895,8 @@ function requireCommon () {
|
|
|
108798
108895
|
}
|
|
108799
108896
|
};
|
|
108800
108897
|
|
|
108801
|
-
exports.setTyped(TYPED_OK);
|
|
108802
|
-
} (common));
|
|
108898
|
+
exports.setTyped(TYPED_OK);
|
|
108899
|
+
} (common));
|
|
108803
108900
|
return common;
|
|
108804
108901
|
}
|
|
108805
108902
|
|
|
@@ -115603,6 +115700,8 @@ function requirePako () {
|
|
|
115603
115700
|
return pako_1;
|
|
115604
115701
|
}
|
|
115605
115702
|
|
|
115703
|
+
UTIF.exports;
|
|
115704
|
+
|
|
115606
115705
|
(function (module) {
|
|
115607
115706
|
(function(){
|
|
115608
115707
|
var UTIF = {};
|
|
@@ -117239,10 +117338,11 @@ function requirePako () {
|
|
|
117239
117338
|
|
|
117240
117339
|
|
|
117241
117340
|
})(UTIF, pako);
|
|
117242
|
-
})();
|
|
117341
|
+
})();
|
|
117243
117342
|
} (UTIF));
|
|
117244
117343
|
|
|
117245
|
-
var
|
|
117344
|
+
var UTIFExports = UTIF.exports;
|
|
117345
|
+
var utif = /*@__PURE__*/getDefaultExportFromCjs(UTIFExports);
|
|
117246
117346
|
|
|
117247
117347
|
const MIME_TYPE$1 = "image/tiff";
|
|
117248
117348
|
var tiff = (() => ({
|
|
@@ -121616,8 +121716,8 @@ function requireGifutil () {
|
|
|
121616
121716
|
return resolve();
|
|
121617
121717
|
});
|
|
121618
121718
|
});
|
|
121619
|
-
}
|
|
121620
|
-
} (gifutil));
|
|
121719
|
+
}
|
|
121720
|
+
} (gifutil));
|
|
121621
121721
|
return gifutil;
|
|
121622
121722
|
}
|
|
121623
121723
|
|
|
@@ -129779,8 +129879,8 @@ function requireSax () {
|
|
|
129779
129879
|
}
|
|
129780
129880
|
}());
|
|
129781
129881
|
}
|
|
129782
|
-
})(exports);
|
|
129783
|
-
} (sax));
|
|
129882
|
+
})(exports);
|
|
129883
|
+
} (sax));
|
|
129784
129884
|
return sax;
|
|
129785
129885
|
}
|
|
129786
129886
|
|
|
@@ -130237,8 +130337,8 @@ function requireParser () {
|
|
|
130237
130337
|
return parser.parseStringPromise(str);
|
|
130238
130338
|
};
|
|
130239
130339
|
|
|
130240
|
-
}).call(commonjsGlobal);
|
|
130241
|
-
} (parser));
|
|
130340
|
+
}).call(commonjsGlobal);
|
|
130341
|
+
} (parser));
|
|
130242
130342
|
return parser;
|
|
130243
130343
|
}
|
|
130244
130344
|
|
|
@@ -133467,6 +133567,8 @@ var loadBmfont = function loadFont(opt, cb) {
|
|
|
133467
133567
|
}
|
|
133468
133568
|
};
|
|
133469
133569
|
|
|
133570
|
+
var bMFont = /*@__PURE__*/getDefaultExportFromCjs(loadBmfont);
|
|
133571
|
+
|
|
133470
133572
|
function measureText(font, text) {
|
|
133471
133573
|
let x = 0;
|
|
133472
133574
|
for (let i = 0; i < text.length; i++) {
|
|
@@ -133478,21 +133580,21 @@ function measureText(font, text) {
|
|
|
133478
133580
|
return x;
|
|
133479
133581
|
}
|
|
133480
133582
|
function splitLines(font, text, maxWidth) {
|
|
133481
|
-
const words = text.split(" ");
|
|
133583
|
+
const words = text.replace(/[\r\n]+/g, " \n").split(" ");
|
|
133482
133584
|
const lines = [];
|
|
133483
133585
|
let currentLine = [];
|
|
133484
133586
|
let longestLine = 0;
|
|
133485
133587
|
words.forEach(word => {
|
|
133486
133588
|
const line = [...currentLine, word].join(" ");
|
|
133487
133589
|
const length = measureText(font, line);
|
|
133488
|
-
if (length <= maxWidth) {
|
|
133590
|
+
if (length <= maxWidth && !word.includes("\n")) {
|
|
133489
133591
|
if (length > longestLine) {
|
|
133490
133592
|
longestLine = length;
|
|
133491
133593
|
}
|
|
133492
133594
|
currentLine.push(word);
|
|
133493
133595
|
} else {
|
|
133494
133596
|
lines.push(currentLine);
|
|
133495
|
-
currentLine = [word];
|
|
133597
|
+
currentLine = [word.replace("\n", "")];
|
|
133496
133598
|
}
|
|
133497
133599
|
});
|
|
133498
133600
|
lines.push(currentLine);
|
|
@@ -133577,7 +133679,7 @@ var print = (() => ({
|
|
|
133577
133679
|
cb = cb || function (err, font) {
|
|
133578
133680
|
if (err) reject(err);else resolve(font);
|
|
133579
133681
|
};
|
|
133580
|
-
|
|
133682
|
+
bMFont(file, (err, font) => {
|
|
133581
133683
|
const chars = {};
|
|
133582
133684
|
const kernings = {};
|
|
133583
133685
|
if (err) {
|
|
@@ -134718,6 +134820,8 @@ var Jimp = configure({
|
|
|
134718
134820
|
|
|
134719
134821
|
var jsQR$1 = {exports: {}};
|
|
134720
134822
|
|
|
134823
|
+
jsQR$1.exports;
|
|
134824
|
+
|
|
134721
134825
|
(function (module, exports) {
|
|
134722
134826
|
(function webpackUniversalModuleDefinition(root, factory) {
|
|
134723
134827
|
module.exports = factory();
|
|
@@ -144787,10 +144891,11 @@ var jsQR$1 = {exports: {}};
|
|
|
144787
144891
|
|
|
144788
144892
|
/***/ })
|
|
144789
144893
|
/******/ ])["default"];
|
|
144790
|
-
});
|
|
144791
|
-
} (jsQR$1));
|
|
144894
|
+
});
|
|
144895
|
+
} (jsQR$1, jsQR$1.exports));
|
|
144792
144896
|
|
|
144793
|
-
var
|
|
144897
|
+
var jsQRExports = jsQR$1.exports;
|
|
144898
|
+
var jsQR = /*@__PURE__*/getDefaultExportFromCjs(jsQRExports);
|
|
144794
144899
|
|
|
144795
144900
|
const decodeQRCodeFromFile = async (filePath) => {
|
|
144796
144901
|
let decodedString;
|
|
@@ -146349,7 +146454,7 @@ const executeWithThrottledResources = async ({ code: emulatedCode, kind = "both"
|
|
|
146349
146454
|
var main$2 = {exports: {}};
|
|
146350
146455
|
|
|
146351
146456
|
var name = "dotenv";
|
|
146352
|
-
var version$1 = "16.
|
|
146457
|
+
var version$1 = "16.4.5";
|
|
146353
146458
|
var description = "Loads environment variables from .env file";
|
|
146354
146459
|
var main$1 = "lib/main.js";
|
|
146355
146460
|
var types = "lib/main.d.ts";
|
|
@@ -146373,6 +146478,7 @@ var scripts = {
|
|
|
146373
146478
|
"lint-readme": "standard-markdown",
|
|
146374
146479
|
pretest: "npm run lint && npm run dts-check",
|
|
146375
146480
|
test: "tap tests/*.js --100 -Rspec",
|
|
146481
|
+
"test:coverage": "tap --coverage-report=lcov",
|
|
146376
146482
|
prerelease: "npm test",
|
|
146377
146483
|
release: "standard-version"
|
|
146378
146484
|
};
|
|
@@ -146380,7 +146486,7 @@ var repository = {
|
|
|
146380
146486
|
type: "git",
|
|
146381
146487
|
url: "git://github.com/motdotla/dotenv.git"
|
|
146382
146488
|
};
|
|
146383
|
-
var funding = "https://
|
|
146489
|
+
var funding = "https://dotenvx.com";
|
|
146384
146490
|
var keywords = [
|
|
146385
146491
|
"dotenv",
|
|
146386
146492
|
"env",
|
|
@@ -146483,11 +146589,13 @@ function _parseVault (options) {
|
|
|
146483
146589
|
// Parse .env.vault
|
|
146484
146590
|
const result = DotenvModule.configDotenv({ path: vaultPath });
|
|
146485
146591
|
if (!result.parsed) {
|
|
146486
|
-
|
|
146592
|
+
const err = new Error(`MISSING_DATA: Cannot parse ${vaultPath} for an unknown reason`);
|
|
146593
|
+
err.code = 'MISSING_DATA';
|
|
146594
|
+
throw err
|
|
146487
146595
|
}
|
|
146488
146596
|
|
|
146489
146597
|
// handle scenario for comma separated keys - for use with key rotation
|
|
146490
|
-
// example: DOTENV_KEY="dotenv://:key_1234@
|
|
146598
|
+
// example: DOTENV_KEY="dotenv://:key_1234@dotenvx.com/vault/.env.vault?environment=prod,dotenv://:key_7890@dotenvx.com/vault/.env.vault?environment=prod"
|
|
146491
146599
|
const keys = _dotenvKey(options).split(',');
|
|
146492
146600
|
const length = keys.length;
|
|
146493
146601
|
|
|
@@ -146551,7 +146659,9 @@ function _instructions (result, dotenvKey) {
|
|
|
146551
146659
|
uri = new URL(dotenvKey);
|
|
146552
146660
|
} catch (error) {
|
|
146553
146661
|
if (error.code === 'ERR_INVALID_URL') {
|
|
146554
|
-
|
|
146662
|
+
const err = new Error('INVALID_DOTENV_KEY: Wrong format. Must be in valid uri format like dotenv://:key_1234@dotenvx.com/vault/.env.vault?environment=development');
|
|
146663
|
+
err.code = 'INVALID_DOTENV_KEY';
|
|
146664
|
+
throw err
|
|
146555
146665
|
}
|
|
146556
146666
|
|
|
146557
146667
|
throw error
|
|
@@ -146560,34 +146670,53 @@ function _instructions (result, dotenvKey) {
|
|
|
146560
146670
|
// Get decrypt key
|
|
146561
146671
|
const key = uri.password;
|
|
146562
146672
|
if (!key) {
|
|
146563
|
-
|
|
146673
|
+
const err = new Error('INVALID_DOTENV_KEY: Missing key part');
|
|
146674
|
+
err.code = 'INVALID_DOTENV_KEY';
|
|
146675
|
+
throw err
|
|
146564
146676
|
}
|
|
146565
146677
|
|
|
146566
146678
|
// Get environment
|
|
146567
146679
|
const environment = uri.searchParams.get('environment');
|
|
146568
146680
|
if (!environment) {
|
|
146569
|
-
|
|
146681
|
+
const err = new Error('INVALID_DOTENV_KEY: Missing environment part');
|
|
146682
|
+
err.code = 'INVALID_DOTENV_KEY';
|
|
146683
|
+
throw err
|
|
146570
146684
|
}
|
|
146571
146685
|
|
|
146572
146686
|
// Get ciphertext payload
|
|
146573
146687
|
const environmentKey = `DOTENV_VAULT_${environment.toUpperCase()}`;
|
|
146574
146688
|
const ciphertext = result.parsed[environmentKey]; // DOTENV_VAULT_PRODUCTION
|
|
146575
146689
|
if (!ciphertext) {
|
|
146576
|
-
|
|
146690
|
+
const err = new Error(`NOT_FOUND_DOTENV_ENVIRONMENT: Cannot locate environment ${environmentKey} in your .env.vault file.`);
|
|
146691
|
+
err.code = 'NOT_FOUND_DOTENV_ENVIRONMENT';
|
|
146692
|
+
throw err
|
|
146577
146693
|
}
|
|
146578
146694
|
|
|
146579
146695
|
return { ciphertext, key }
|
|
146580
146696
|
}
|
|
146581
146697
|
|
|
146582
146698
|
function _vaultPath (options) {
|
|
146583
|
-
let
|
|
146699
|
+
let possibleVaultPath = null;
|
|
146584
146700
|
|
|
146585
146701
|
if (options && options.path && options.path.length > 0) {
|
|
146586
|
-
|
|
146702
|
+
if (Array.isArray(options.path)) {
|
|
146703
|
+
for (const filepath of options.path) {
|
|
146704
|
+
if (fs.existsSync(filepath)) {
|
|
146705
|
+
possibleVaultPath = filepath.endsWith('.vault') ? filepath : `${filepath}.vault`;
|
|
146706
|
+
}
|
|
146707
|
+
}
|
|
146708
|
+
} else {
|
|
146709
|
+
possibleVaultPath = options.path.endsWith('.vault') ? options.path : `${options.path}.vault`;
|
|
146710
|
+
}
|
|
146711
|
+
} else {
|
|
146712
|
+
possibleVaultPath = path.resolve(process.cwd(), '.env.vault');
|
|
146713
|
+
}
|
|
146714
|
+
|
|
146715
|
+
if (fs.existsSync(possibleVaultPath)) {
|
|
146716
|
+
return possibleVaultPath
|
|
146587
146717
|
}
|
|
146588
146718
|
|
|
146589
|
-
|
|
146590
|
-
return dotenvPath.endsWith('.vault') ? dotenvPath : `${dotenvPath}.vault`
|
|
146719
|
+
return null
|
|
146591
146720
|
}
|
|
146592
146721
|
|
|
146593
146722
|
function _resolveHome (envPath) {
|
|
@@ -146610,51 +146739,73 @@ function _configVault (options) {
|
|
|
146610
146739
|
}
|
|
146611
146740
|
|
|
146612
146741
|
function configDotenv (options) {
|
|
146613
|
-
|
|
146742
|
+
const dotenvPath = path.resolve(process.cwd(), '.env');
|
|
146614
146743
|
let encoding = 'utf8';
|
|
146615
146744
|
const debug = Boolean(options && options.debug);
|
|
146616
146745
|
|
|
146617
|
-
if (options) {
|
|
146618
|
-
|
|
146619
|
-
|
|
146746
|
+
if (options && options.encoding) {
|
|
146747
|
+
encoding = options.encoding;
|
|
146748
|
+
} else {
|
|
146749
|
+
if (debug) {
|
|
146750
|
+
_debug('No encoding is specified. UTF-8 is used by default');
|
|
146620
146751
|
}
|
|
146621
|
-
|
|
146622
|
-
|
|
146752
|
+
}
|
|
146753
|
+
|
|
146754
|
+
let optionPaths = [dotenvPath]; // default, look for .env
|
|
146755
|
+
if (options && options.path) {
|
|
146756
|
+
if (!Array.isArray(options.path)) {
|
|
146757
|
+
optionPaths = [_resolveHome(options.path)];
|
|
146758
|
+
} else {
|
|
146759
|
+
optionPaths = []; // reset default
|
|
146760
|
+
for (const filepath of options.path) {
|
|
146761
|
+
optionPaths.push(_resolveHome(filepath));
|
|
146762
|
+
}
|
|
146623
146763
|
}
|
|
146624
146764
|
}
|
|
146625
146765
|
|
|
146626
|
-
|
|
146627
|
-
|
|
146628
|
-
|
|
146766
|
+
// Build the parsed data in a temporary object (because we need to return it). Once we have the final
|
|
146767
|
+
// parsed data, we will combine it with process.env (or options.processEnv if provided).
|
|
146768
|
+
let lastError;
|
|
146769
|
+
const parsedAll = {};
|
|
146770
|
+
for (const path of optionPaths) {
|
|
146771
|
+
try {
|
|
146772
|
+
// Specifying an encoding returns a string instead of a buffer
|
|
146773
|
+
const parsed = DotenvModule.parse(fs.readFileSync(path, { encoding }));
|
|
146629
146774
|
|
|
146630
|
-
|
|
146631
|
-
|
|
146632
|
-
|
|
146775
|
+
DotenvModule.populate(parsedAll, parsed, options);
|
|
146776
|
+
} catch (e) {
|
|
146777
|
+
if (debug) {
|
|
146778
|
+
_debug(`Failed to load ${path} ${e.message}`);
|
|
146779
|
+
}
|
|
146780
|
+
lastError = e;
|
|
146633
146781
|
}
|
|
146782
|
+
}
|
|
146634
146783
|
|
|
146635
|
-
|
|
146784
|
+
let processEnv = process.env;
|
|
146785
|
+
if (options && options.processEnv != null) {
|
|
146786
|
+
processEnv = options.processEnv;
|
|
146787
|
+
}
|
|
146636
146788
|
|
|
146637
|
-
|
|
146638
|
-
} catch (e) {
|
|
146639
|
-
if (debug) {
|
|
146640
|
-
_debug(`Failed to load ${dotenvPath} ${e.message}`);
|
|
146641
|
-
}
|
|
146789
|
+
DotenvModule.populate(processEnv, parsedAll, options);
|
|
146642
146790
|
|
|
146643
|
-
|
|
146791
|
+
if (lastError) {
|
|
146792
|
+
return { parsed: parsedAll, error: lastError }
|
|
146793
|
+
} else {
|
|
146794
|
+
return { parsed: parsedAll }
|
|
146644
146795
|
}
|
|
146645
146796
|
}
|
|
146646
146797
|
|
|
146647
146798
|
// Populates process.env from .env file
|
|
146648
146799
|
function config (options) {
|
|
146649
|
-
const vaultPath = _vaultPath(options);
|
|
146650
|
-
|
|
146651
146800
|
// fallback to original dotenv if DOTENV_KEY is not set
|
|
146652
146801
|
if (_dotenvKey(options).length === 0) {
|
|
146653
146802
|
return DotenvModule.configDotenv(options)
|
|
146654
146803
|
}
|
|
146655
146804
|
|
|
146805
|
+
const vaultPath = _vaultPath(options);
|
|
146806
|
+
|
|
146656
146807
|
// dotenvKey exists but .env.vault file does not exist
|
|
146657
|
-
if (!
|
|
146808
|
+
if (!vaultPath) {
|
|
146658
146809
|
_warn(`You set DOTENV_KEY but you are missing a .env.vault file at ${vaultPath}. Did you forget to build it?`);
|
|
146659
146810
|
|
|
146660
146811
|
return DotenvModule.configDotenv(options)
|
|
@@ -146667,9 +146818,9 @@ function decrypt (encrypted, keyStr) {
|
|
|
146667
146818
|
const key = Buffer.from(keyStr.slice(-64), 'hex');
|
|
146668
146819
|
let ciphertext = Buffer.from(encrypted, 'base64');
|
|
146669
146820
|
|
|
146670
|
-
const nonce = ciphertext.
|
|
146671
|
-
const authTag = ciphertext.
|
|
146672
|
-
ciphertext = ciphertext.
|
|
146821
|
+
const nonce = ciphertext.subarray(0, 12);
|
|
146822
|
+
const authTag = ciphertext.subarray(-16);
|
|
146823
|
+
ciphertext = ciphertext.subarray(12, -16);
|
|
146673
146824
|
|
|
146674
146825
|
try {
|
|
146675
146826
|
const aesgcm = crypto.createDecipheriv('aes-256-gcm', key, nonce);
|
|
@@ -146681,14 +146832,14 @@ function decrypt (encrypted, keyStr) {
|
|
|
146681
146832
|
const decryptionFailed = error.message === 'Unsupported state or unable to authenticate data';
|
|
146682
146833
|
|
|
146683
146834
|
if (isRange || invalidKeyLength) {
|
|
146684
|
-
const
|
|
146685
|
-
|
|
146835
|
+
const err = new Error('INVALID_DOTENV_KEY: It must be 64 characters long (or more)');
|
|
146836
|
+
err.code = 'INVALID_DOTENV_KEY';
|
|
146837
|
+
throw err
|
|
146686
146838
|
} else if (decryptionFailed) {
|
|
146687
|
-
const
|
|
146688
|
-
|
|
146839
|
+
const err = new Error('DECRYPTION_FAILED: Please check your DOTENV_KEY');
|
|
146840
|
+
err.code = 'DECRYPTION_FAILED';
|
|
146841
|
+
throw err
|
|
146689
146842
|
} else {
|
|
146690
|
-
console.error('Error: ', error.code);
|
|
146691
|
-
console.error('Error: ', error.message);
|
|
146692
146843
|
throw error
|
|
146693
146844
|
}
|
|
146694
146845
|
}
|
|
@@ -146700,7 +146851,9 @@ function populate (processEnv, parsed, options = {}) {
|
|
|
146700
146851
|
const override = Boolean(options && options.override);
|
|
146701
146852
|
|
|
146702
146853
|
if (typeof parsed !== 'object') {
|
|
146703
|
-
|
|
146854
|
+
const err = new Error('OBJECT_REQUIRED: Please check the processEnv argument being passed to populate');
|
|
146855
|
+
err.code = 'OBJECT_REQUIRED';
|
|
146856
|
+
throw err
|
|
146704
146857
|
}
|
|
146705
146858
|
|
|
146706
146859
|
// Set process.env
|
|
@@ -146743,82 +146896,94 @@ main$2.exports.populate = DotenvModule.populate;
|
|
|
146743
146896
|
|
|
146744
146897
|
main$2.exports = DotenvModule;
|
|
146745
146898
|
|
|
146899
|
+
var mainExports = main$2.exports;
|
|
146900
|
+
var dotenv = /*@__PURE__*/getDefaultExportFromCjs(mainExports);
|
|
146901
|
+
|
|
146746
146902
|
var main = {};
|
|
146747
146903
|
|
|
146748
|
-
//
|
|
146749
|
-
|
|
146750
|
-
|
|
146751
|
-
|
|
146752
|
-
|
|
146904
|
+
// * /
|
|
146905
|
+
// * (\\)? # is it escaped with a backslash?
|
|
146906
|
+
// * (\$) # literal $
|
|
146907
|
+
// * (?!\() # shouldnt be followed by parenthesis
|
|
146908
|
+
// * (\{?) # first brace wrap opening
|
|
146909
|
+
// * ([\w.]+) # key
|
|
146910
|
+
// * (?::-((?:\$\{(?:\$\{(?:\$\{[^}]*\}|[^}])*}|[^}])*}|[^}])+))? # optional default nested 3 times
|
|
146911
|
+
// * (\}?) # last brace warp closing
|
|
146912
|
+
// * /xi
|
|
146753
146913
|
|
|
146754
|
-
|
|
146755
|
-
// find the last unescaped dollar sign in the
|
|
146756
|
-
// value so that we can evaluate it
|
|
146757
|
-
const lastUnescapedDollarSignIndex = _searchLast(envValue, /(?!(?<=\\))\$/g);
|
|
146914
|
+
const DOTENV_SUBSTITUTION_REGEX = /(\\)?(\$)(?!\()(\{?)([\w.]+)(?::?-((?:\$\{(?:\$\{(?:\$\{[^}]*\}|[^}])*}|[^}])*}|[^}])+))?(\}?)/gi;
|
|
146758
146915
|
|
|
146759
|
-
|
|
146760
|
-
|
|
146761
|
-
|
|
146916
|
+
function _resolveEscapeSequences (value) {
|
|
146917
|
+
return value.replace(/\\\$/g, '$')
|
|
146918
|
+
}
|
|
146762
146919
|
|
|
146763
|
-
|
|
146764
|
-
|
|
146920
|
+
function interpolate (value, processEnv, parsed) {
|
|
146921
|
+
return value.replace(DOTENV_SUBSTITUTION_REGEX, (match, escaped, dollarSign, openBrace, key, defaultValue, closeBrace) => {
|
|
146922
|
+
if (escaped === '\\') {
|
|
146923
|
+
return match.slice(1)
|
|
146924
|
+
} else {
|
|
146925
|
+
if (processEnv[key]) {
|
|
146926
|
+
if (processEnv[key] === parsed[key]) {
|
|
146927
|
+
return processEnv[key]
|
|
146928
|
+
} else {
|
|
146929
|
+
// scenario: PASSWORD_EXPAND_NESTED=${PASSWORD_EXPAND}
|
|
146930
|
+
return interpolate(processEnv[key], processEnv, parsed)
|
|
146931
|
+
}
|
|
146932
|
+
}
|
|
146765
146933
|
|
|
146766
|
-
|
|
146767
|
-
|
|
146768
|
-
|
|
146769
|
-
|
|
146770
|
-
|
|
146771
|
-
|
|
146772
|
-
|
|
146773
|
-
|
|
146774
|
-
* }? // optional closing curly brace
|
|
146775
|
-
* )
|
|
146776
|
-
*/
|
|
146777
|
-
const matchGroup = /((?!(?<=\\))\${?([\w]+)(?::-([^}\\]*))?}?)/;
|
|
146778
|
-
const match = rightMostGroup.match(matchGroup);
|
|
146779
|
-
|
|
146780
|
-
if (match != null) {
|
|
146781
|
-
const [, group, variableName, defaultValue] = match;
|
|
146782
|
-
|
|
146783
|
-
return _interpolate(
|
|
146784
|
-
envValue.replace(
|
|
146785
|
-
group,
|
|
146786
|
-
environment[variableName] ||
|
|
146787
|
-
defaultValue ||
|
|
146788
|
-
config.parsed[variableName] ||
|
|
146789
|
-
''
|
|
146790
|
-
),
|
|
146791
|
-
environment,
|
|
146792
|
-
config
|
|
146793
|
-
)
|
|
146794
|
-
}
|
|
146934
|
+
if (parsed[key]) {
|
|
146935
|
+
// avoid recursion from EXPAND_SELF=$EXPAND_SELF
|
|
146936
|
+
if (parsed[key] === value) {
|
|
146937
|
+
return parsed[key]
|
|
146938
|
+
} else {
|
|
146939
|
+
return interpolate(parsed[key], processEnv, parsed)
|
|
146940
|
+
}
|
|
146941
|
+
}
|
|
146795
146942
|
|
|
146796
|
-
|
|
146797
|
-
|
|
146943
|
+
if (defaultValue) {
|
|
146944
|
+
if (defaultValue.startsWith('$')) {
|
|
146945
|
+
return interpolate(defaultValue, processEnv, parsed)
|
|
146946
|
+
} else {
|
|
146947
|
+
return defaultValue
|
|
146948
|
+
}
|
|
146949
|
+
}
|
|
146798
146950
|
|
|
146799
|
-
|
|
146800
|
-
|
|
146951
|
+
return ''
|
|
146952
|
+
}
|
|
146953
|
+
})
|
|
146801
146954
|
}
|
|
146802
146955
|
|
|
146803
|
-
function expand (
|
|
146804
|
-
|
|
146805
|
-
|
|
146956
|
+
function expand (options) {
|
|
146957
|
+
let processEnv = process.env;
|
|
146958
|
+
if (options && options.processEnv != null) {
|
|
146959
|
+
processEnv = options.processEnv;
|
|
146960
|
+
}
|
|
146806
146961
|
|
|
146807
|
-
for (const
|
|
146808
|
-
|
|
146809
|
-
? environment[configKey]
|
|
146810
|
-
: config.parsed[configKey];
|
|
146962
|
+
for (const key in options.parsed) {
|
|
146963
|
+
let value = options.parsed[key];
|
|
146811
146964
|
|
|
146812
|
-
|
|
146813
|
-
|
|
146814
|
-
|
|
146965
|
+
const inProcessEnv = Object.prototype.hasOwnProperty.call(processEnv, key);
|
|
146966
|
+
if (inProcessEnv) {
|
|
146967
|
+
if (processEnv[key] === options.parsed[key]) {
|
|
146968
|
+
// assume was set to processEnv from the .env file if the values match and therefore interpolate
|
|
146969
|
+
value = interpolate(value, processEnv, options.parsed);
|
|
146970
|
+
} else {
|
|
146971
|
+
// do not interpolate - assume processEnv had the intended value even if containing a $.
|
|
146972
|
+
value = processEnv[key];
|
|
146973
|
+
}
|
|
146974
|
+
} else {
|
|
146975
|
+
// not inProcessEnv so assume interpolation for this .env key
|
|
146976
|
+
value = interpolate(value, processEnv, options.parsed);
|
|
146977
|
+
}
|
|
146978
|
+
|
|
146979
|
+
options.parsed[key] = _resolveEscapeSequences(value);
|
|
146815
146980
|
}
|
|
146816
146981
|
|
|
146817
|
-
for (const processKey in
|
|
146818
|
-
|
|
146982
|
+
for (const processKey in options.parsed) {
|
|
146983
|
+
processEnv[processKey] = options.parsed[processKey];
|
|
146819
146984
|
}
|
|
146820
146985
|
|
|
146821
|
-
return
|
|
146986
|
+
return options
|
|
146822
146987
|
}
|
|
146823
146988
|
|
|
146824
146989
|
main.expand = expand;
|
|
@@ -146826,12 +146991,12 @@ main.expand = expand;
|
|
|
146826
146991
|
// @ts-check
|
|
146827
146992
|
var _a, _b;
|
|
146828
146993
|
process.env.TEST_ENV = (_a = process.env.TEST_ENV) !== null && _a !== void 0 ? _a : ENVIRONMENT.development;
|
|
146829
|
-
const env =
|
|
146994
|
+
const env = dotenv.config({
|
|
146830
146995
|
path: `./e2e/config/.env.${process.env.TEST_ENV}`,
|
|
146831
146996
|
});
|
|
146832
146997
|
main.expand(env);
|
|
146833
146998
|
if (fs__namespace.existsSync("./e2e/config/.env.local")) {
|
|
146834
|
-
const localEnv =
|
|
146999
|
+
const localEnv = dotenv.config({
|
|
146835
147000
|
path: "./e2e/config/.env.local",
|
|
146836
147001
|
});
|
|
146837
147002
|
main.expand(localEnv);
|