@malevich-studio/strapi-sdk-typescript 1.2.26 → 1.2.28
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/cli.cjs +251 -268
- package/dist/cli.cjs.map +1 -1
- package/dist/cli.mjs +251 -268
- package/dist/cli.mjs.map +1 -1
- package/dist/index.cjs +249 -267
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.ts +3 -0
- package/dist/index.mjs +249 -267
- package/dist/index.mjs.map +1 -1
- package/package.json +7 -2
package/dist/cli.cjs
CHANGED
|
@@ -4,8 +4,8 @@
|
|
|
4
4
|
var fs = require('fs');
|
|
5
5
|
var path = require('path');
|
|
6
6
|
var require$$0 = require('util');
|
|
7
|
-
var require$$1 = require('tty');
|
|
8
|
-
var require$$
|
|
7
|
+
var require$$0$1 = require('tty');
|
|
8
|
+
var require$$2 = require('os');
|
|
9
9
|
var require$$3 = require('crypto');
|
|
10
10
|
|
|
11
11
|
function _interopNamespaceDefault(e) {
|
|
@@ -17563,13 +17563,16 @@ function requireObjectInspect () {
|
|
|
17563
17563
|
return $replace.call(String(s), /"/g, '"');
|
|
17564
17564
|
}
|
|
17565
17565
|
|
|
17566
|
-
function
|
|
17567
|
-
|
|
17568
|
-
|
|
17569
|
-
function
|
|
17570
|
-
function
|
|
17571
|
-
function
|
|
17572
|
-
function
|
|
17566
|
+
function canTrustToString(obj) {
|
|
17567
|
+
return !toStringTag || !(typeof obj === 'object' && (toStringTag in obj || typeof obj[toStringTag] !== 'undefined'));
|
|
17568
|
+
}
|
|
17569
|
+
function isArray(obj) { return toStr(obj) === '[object Array]' && canTrustToString(obj); }
|
|
17570
|
+
function isDate(obj) { return toStr(obj) === '[object Date]' && canTrustToString(obj); }
|
|
17571
|
+
function isRegExp(obj) { return toStr(obj) === '[object RegExp]' && canTrustToString(obj); }
|
|
17572
|
+
function isError(obj) { return toStr(obj) === '[object Error]' && canTrustToString(obj); }
|
|
17573
|
+
function isString(obj) { return toStr(obj) === '[object String]' && canTrustToString(obj); }
|
|
17574
|
+
function isNumber(obj) { return toStr(obj) === '[object Number]' && canTrustToString(obj); }
|
|
17575
|
+
function isBoolean(obj) { return toStr(obj) === '[object Boolean]' && canTrustToString(obj); }
|
|
17573
17576
|
|
|
17574
17577
|
// Symbol and BigInt do have Symbol.toStringTag by spec, so that can't be used to eliminate false positives
|
|
17575
17578
|
function isSymbol(obj) {
|
|
@@ -18458,7 +18461,7 @@ function requireCallBindApplyHelpers () {
|
|
|
18458
18461
|
var $call = requireFunctionCall();
|
|
18459
18462
|
var $actualApply = requireActualApply();
|
|
18460
18463
|
|
|
18461
|
-
/** @type {import('.')
|
|
18464
|
+
/** @type {(args: [Function, thisArg?: unknown, ...args: unknown[]]) => Function} TODO FIXME, find a way to use import('.') */
|
|
18462
18465
|
callBindApplyHelpers = function callBindBasic(args) {
|
|
18463
18466
|
if (args.length < 1 || typeof args[0] !== 'function') {
|
|
18464
18467
|
throw new $TypeError('a function is required');
|
|
@@ -18654,6 +18657,7 @@ function requireGetIntrinsic () {
|
|
|
18654
18657
|
'%Error%': $Error,
|
|
18655
18658
|
'%eval%': eval, // eslint-disable-line no-eval
|
|
18656
18659
|
'%EvalError%': $EvalError,
|
|
18660
|
+
'%Float16Array%': typeof Float16Array === 'undefined' ? undefined$1 : Float16Array,
|
|
18657
18661
|
'%Float32Array%': typeof Float32Array === 'undefined' ? undefined$1 : Float32Array,
|
|
18658
18662
|
'%Float64Array%': typeof Float64Array === 'undefined' ? undefined$1 : Float64Array,
|
|
18659
18663
|
'%FinalizationRegistry%': typeof FinalizationRegistry === 'undefined' ? undefined$1 : FinalizationRegistry,
|
|
@@ -18958,10 +18962,11 @@ function requireCallBound () {
|
|
|
18958
18962
|
|
|
18959
18963
|
/** @type {import('.')} */
|
|
18960
18964
|
callBound = function callBoundIntrinsic(name, allowMissing) {
|
|
18961
|
-
|
|
18962
|
-
|
|
18965
|
+
/* eslint no-extra-parens: 0 */
|
|
18966
|
+
|
|
18967
|
+
var intrinsic = /** @type {(this: unknown, ...args: unknown[]) => unknown} */ (GetIntrinsic(name, !!allowMissing));
|
|
18963
18968
|
if (typeof intrinsic === 'function' && $indexOf(name, '.prototype.') > -1) {
|
|
18964
|
-
return callBindBasic([intrinsic]);
|
|
18969
|
+
return callBindBasic(/** @type {const} */ ([intrinsic]));
|
|
18965
18970
|
}
|
|
18966
18971
|
return intrinsic;
|
|
18967
18972
|
};
|
|
@@ -19225,7 +19230,7 @@ function requireUtils () {
|
|
|
19225
19230
|
if (hasRequiredUtils) return utils;
|
|
19226
19231
|
hasRequiredUtils = 1;
|
|
19227
19232
|
|
|
19228
|
-
var formats = requireFormats();
|
|
19233
|
+
var formats = /*@__PURE__*/ requireFormats();
|
|
19229
19234
|
|
|
19230
19235
|
var has = Object.prototype.hasOwnProperty;
|
|
19231
19236
|
var isArray = Array.isArray;
|
|
@@ -19259,7 +19264,7 @@ function requireUtils () {
|
|
|
19259
19264
|
};
|
|
19260
19265
|
|
|
19261
19266
|
var arrayToObject = function arrayToObject(source, options) {
|
|
19262
|
-
var obj = options && options.plainObjects ?
|
|
19267
|
+
var obj = options && options.plainObjects ? { __proto__: null } : {};
|
|
19263
19268
|
for (var i = 0; i < source.length; ++i) {
|
|
19264
19269
|
if (typeof source[i] !== 'undefined') {
|
|
19265
19270
|
obj[i] = source[i];
|
|
@@ -19275,11 +19280,14 @@ function requireUtils () {
|
|
|
19275
19280
|
return target;
|
|
19276
19281
|
}
|
|
19277
19282
|
|
|
19278
|
-
if (typeof source !== 'object') {
|
|
19283
|
+
if (typeof source !== 'object' && typeof source !== 'function') {
|
|
19279
19284
|
if (isArray(target)) {
|
|
19280
19285
|
target.push(source);
|
|
19281
19286
|
} else if (target && typeof target === 'object') {
|
|
19282
|
-
if (
|
|
19287
|
+
if (
|
|
19288
|
+
(options && (options.plainObjects || options.allowPrototypes))
|
|
19289
|
+
|| !has.call(Object.prototype, source)
|
|
19290
|
+
) {
|
|
19283
19291
|
target[source] = true;
|
|
19284
19292
|
}
|
|
19285
19293
|
} else {
|
|
@@ -19333,7 +19341,7 @@ function requireUtils () {
|
|
|
19333
19341
|
}, target);
|
|
19334
19342
|
};
|
|
19335
19343
|
|
|
19336
|
-
var decode = function (str,
|
|
19344
|
+
var decode = function (str, defaultDecoder, charset) {
|
|
19337
19345
|
var strWithoutPlus = str.replace(/\+/g, ' ');
|
|
19338
19346
|
if (charset === 'iso-8859-1') {
|
|
19339
19347
|
// unescape never throws, no try...catch needed:
|
|
@@ -19347,6 +19355,10 @@ function requireUtils () {
|
|
|
19347
19355
|
}
|
|
19348
19356
|
};
|
|
19349
19357
|
|
|
19358
|
+
var limit = 1024;
|
|
19359
|
+
|
|
19360
|
+
/* eslint operator-linebreak: [2, "before"] */
|
|
19361
|
+
|
|
19350
19362
|
var encode = function encode(str, defaultEncoder, charset, kind, format) {
|
|
19351
19363
|
// This code was originally written by Brian White (mscdex) for the io.js core querystring library.
|
|
19352
19364
|
// It has been adapted here for stricter adherence to RFC 3986
|
|
@@ -19368,45 +19380,54 @@ function requireUtils () {
|
|
|
19368
19380
|
}
|
|
19369
19381
|
|
|
19370
19382
|
var out = '';
|
|
19371
|
-
for (var
|
|
19372
|
-
var
|
|
19373
|
-
|
|
19374
|
-
|
|
19375
|
-
|
|
19376
|
-
|
|
19377
|
-
|
|
19378
|
-
|
|
19379
|
-
|
|
19380
|
-
|
|
19381
|
-
|
|
19382
|
-
|
|
19383
|
-
|
|
19384
|
-
|
|
19385
|
-
|
|
19386
|
-
|
|
19383
|
+
for (var j = 0; j < string.length; j += limit) {
|
|
19384
|
+
var segment = string.length >= limit ? string.slice(j, j + limit) : string;
|
|
19385
|
+
var arr = [];
|
|
19386
|
+
|
|
19387
|
+
for (var i = 0; i < segment.length; ++i) {
|
|
19388
|
+
var c = segment.charCodeAt(i);
|
|
19389
|
+
if (
|
|
19390
|
+
c === 0x2D // -
|
|
19391
|
+
|| c === 0x2E // .
|
|
19392
|
+
|| c === 0x5F // _
|
|
19393
|
+
|| c === 0x7E // ~
|
|
19394
|
+
|| (c >= 0x30 && c <= 0x39) // 0-9
|
|
19395
|
+
|| (c >= 0x41 && c <= 0x5A) // a-z
|
|
19396
|
+
|| (c >= 0x61 && c <= 0x7A) // A-Z
|
|
19397
|
+
|| (format === formats.RFC1738 && (c === 0x28 || c === 0x29)) // ( )
|
|
19398
|
+
) {
|
|
19399
|
+
arr[arr.length] = segment.charAt(i);
|
|
19400
|
+
continue;
|
|
19401
|
+
}
|
|
19387
19402
|
|
|
19388
|
-
|
|
19389
|
-
|
|
19390
|
-
|
|
19391
|
-
|
|
19403
|
+
if (c < 0x80) {
|
|
19404
|
+
arr[arr.length] = hexTable[c];
|
|
19405
|
+
continue;
|
|
19406
|
+
}
|
|
19392
19407
|
|
|
19393
|
-
|
|
19394
|
-
|
|
19395
|
-
|
|
19396
|
-
|
|
19408
|
+
if (c < 0x800) {
|
|
19409
|
+
arr[arr.length] = hexTable[0xC0 | (c >> 6)]
|
|
19410
|
+
+ hexTable[0x80 | (c & 0x3F)];
|
|
19411
|
+
continue;
|
|
19412
|
+
}
|
|
19397
19413
|
|
|
19398
|
-
|
|
19399
|
-
|
|
19400
|
-
|
|
19414
|
+
if (c < 0xD800 || c >= 0xE000) {
|
|
19415
|
+
arr[arr.length] = hexTable[0xE0 | (c >> 12)]
|
|
19416
|
+
+ hexTable[0x80 | ((c >> 6) & 0x3F)]
|
|
19417
|
+
+ hexTable[0x80 | (c & 0x3F)];
|
|
19418
|
+
continue;
|
|
19419
|
+
}
|
|
19420
|
+
|
|
19421
|
+
i += 1;
|
|
19422
|
+
c = 0x10000 + (((c & 0x3FF) << 10) | (segment.charCodeAt(i) & 0x3FF));
|
|
19423
|
+
|
|
19424
|
+
arr[arr.length] = hexTable[0xF0 | (c >> 18)]
|
|
19425
|
+
+ hexTable[0x80 | ((c >> 12) & 0x3F)]
|
|
19426
|
+
+ hexTable[0x80 | ((c >> 6) & 0x3F)]
|
|
19427
|
+
+ hexTable[0x80 | (c & 0x3F)];
|
|
19401
19428
|
}
|
|
19402
19429
|
|
|
19403
|
-
|
|
19404
|
-
c = 0x10000 + (((c & 0x3FF) << 10) | (string.charCodeAt(i) & 0x3FF));
|
|
19405
|
-
/* eslint operator-linebreak: [2, "before"] */
|
|
19406
|
-
out += hexTable[0xF0 | (c >> 18)]
|
|
19407
|
-
+ hexTable[0x80 | ((c >> 12) & 0x3F)]
|
|
19408
|
-
+ hexTable[0x80 | ((c >> 6) & 0x3F)]
|
|
19409
|
-
+ hexTable[0x80 | (c & 0x3F)];
|
|
19430
|
+
out += arr.join('');
|
|
19410
19431
|
}
|
|
19411
19432
|
|
|
19412
19433
|
return out;
|
|
@@ -19486,8 +19507,8 @@ function requireStringify () {
|
|
|
19486
19507
|
hasRequiredStringify = 1;
|
|
19487
19508
|
|
|
19488
19509
|
var getSideChannel = requireSideChannel();
|
|
19489
|
-
var utils = requireUtils();
|
|
19490
|
-
var formats = requireFormats();
|
|
19510
|
+
var utils = /*@__PURE__*/ requireUtils();
|
|
19511
|
+
var formats = /*@__PURE__*/ requireFormats();
|
|
19491
19512
|
var has = Object.prototype.hasOwnProperty;
|
|
19492
19513
|
|
|
19493
19514
|
var arrayPrefixGenerators = {
|
|
@@ -19515,12 +19536,17 @@ function requireStringify () {
|
|
|
19515
19536
|
var defaults = {
|
|
19516
19537
|
addQueryPrefix: false,
|
|
19517
19538
|
allowDots: false,
|
|
19539
|
+
allowEmptyArrays: false,
|
|
19540
|
+
arrayFormat: 'indices',
|
|
19518
19541
|
charset: 'utf-8',
|
|
19519
19542
|
charsetSentinel: false,
|
|
19543
|
+
commaRoundTrip: false,
|
|
19520
19544
|
delimiter: '&',
|
|
19521
19545
|
encode: true,
|
|
19546
|
+
encodeDotInKeys: false,
|
|
19522
19547
|
encoder: utils.encode,
|
|
19523
19548
|
encodeValuesOnly: false,
|
|
19549
|
+
filter: void 0,
|
|
19524
19550
|
format: defaultFormat,
|
|
19525
19551
|
formatter: formats.formatters[defaultFormat],
|
|
19526
19552
|
// deprecated
|
|
@@ -19547,8 +19573,10 @@ function requireStringify () {
|
|
|
19547
19573
|
prefix,
|
|
19548
19574
|
generateArrayPrefix,
|
|
19549
19575
|
commaRoundTrip,
|
|
19576
|
+
allowEmptyArrays,
|
|
19550
19577
|
strictNullHandling,
|
|
19551
19578
|
skipNulls,
|
|
19579
|
+
encodeDotInKeys,
|
|
19552
19580
|
encoder,
|
|
19553
19581
|
filter,
|
|
19554
19582
|
sort,
|
|
@@ -19630,19 +19658,28 @@ function requireStringify () {
|
|
|
19630
19658
|
objKeys = sort ? keys.sort(sort) : keys;
|
|
19631
19659
|
}
|
|
19632
19660
|
|
|
19633
|
-
var
|
|
19661
|
+
var encodedPrefix = encodeDotInKeys ? String(prefix).replace(/\./g, '%2E') : String(prefix);
|
|
19662
|
+
|
|
19663
|
+
var adjustedPrefix = commaRoundTrip && isArray(obj) && obj.length === 1 ? encodedPrefix + '[]' : encodedPrefix;
|
|
19664
|
+
|
|
19665
|
+
if (allowEmptyArrays && isArray(obj) && obj.length === 0) {
|
|
19666
|
+
return adjustedPrefix + '[]';
|
|
19667
|
+
}
|
|
19634
19668
|
|
|
19635
19669
|
for (var j = 0; j < objKeys.length; ++j) {
|
|
19636
19670
|
var key = objKeys[j];
|
|
19637
|
-
var value = typeof key === 'object' && typeof key.value !== 'undefined'
|
|
19671
|
+
var value = typeof key === 'object' && key && typeof key.value !== 'undefined'
|
|
19672
|
+
? key.value
|
|
19673
|
+
: obj[key];
|
|
19638
19674
|
|
|
19639
19675
|
if (skipNulls && value === null) {
|
|
19640
19676
|
continue;
|
|
19641
19677
|
}
|
|
19642
19678
|
|
|
19679
|
+
var encodedKey = allowDots && encodeDotInKeys ? String(key).replace(/\./g, '%2E') : String(key);
|
|
19643
19680
|
var keyPrefix = isArray(obj)
|
|
19644
|
-
? typeof generateArrayPrefix === 'function' ? generateArrayPrefix(adjustedPrefix,
|
|
19645
|
-
: adjustedPrefix + (allowDots ? '.' +
|
|
19681
|
+
? typeof generateArrayPrefix === 'function' ? generateArrayPrefix(adjustedPrefix, encodedKey) : adjustedPrefix
|
|
19682
|
+
: adjustedPrefix + (allowDots ? '.' + encodedKey : '[' + encodedKey + ']');
|
|
19646
19683
|
|
|
19647
19684
|
sideChannel.set(object, step);
|
|
19648
19685
|
var valueSideChannel = getSideChannel();
|
|
@@ -19652,8 +19689,10 @@ function requireStringify () {
|
|
|
19652
19689
|
keyPrefix,
|
|
19653
19690
|
generateArrayPrefix,
|
|
19654
19691
|
commaRoundTrip,
|
|
19692
|
+
allowEmptyArrays,
|
|
19655
19693
|
strictNullHandling,
|
|
19656
19694
|
skipNulls,
|
|
19695
|
+
encodeDotInKeys,
|
|
19657
19696
|
generateArrayPrefix === 'comma' && encodeValuesOnly && isArray(obj) ? null : encoder,
|
|
19658
19697
|
filter,
|
|
19659
19698
|
sort,
|
|
@@ -19675,6 +19714,14 @@ function requireStringify () {
|
|
|
19675
19714
|
return defaults;
|
|
19676
19715
|
}
|
|
19677
19716
|
|
|
19717
|
+
if (typeof opts.allowEmptyArrays !== 'undefined' && typeof opts.allowEmptyArrays !== 'boolean') {
|
|
19718
|
+
throw new TypeError('`allowEmptyArrays` option can only be `true` or `false`, when provided');
|
|
19719
|
+
}
|
|
19720
|
+
|
|
19721
|
+
if (typeof opts.encodeDotInKeys !== 'undefined' && typeof opts.encodeDotInKeys !== 'boolean') {
|
|
19722
|
+
throw new TypeError('`encodeDotInKeys` option can only be `true` or `false`, when provided');
|
|
19723
|
+
}
|
|
19724
|
+
|
|
19678
19725
|
if (opts.encoder !== null && typeof opts.encoder !== 'undefined' && typeof opts.encoder !== 'function') {
|
|
19679
19726
|
throw new TypeError('Encoder has to be a function.');
|
|
19680
19727
|
}
|
|
@@ -19698,13 +19745,32 @@ function requireStringify () {
|
|
|
19698
19745
|
filter = opts.filter;
|
|
19699
19746
|
}
|
|
19700
19747
|
|
|
19748
|
+
var arrayFormat;
|
|
19749
|
+
if (opts.arrayFormat in arrayPrefixGenerators) {
|
|
19750
|
+
arrayFormat = opts.arrayFormat;
|
|
19751
|
+
} else if ('indices' in opts) {
|
|
19752
|
+
arrayFormat = opts.indices ? 'indices' : 'repeat';
|
|
19753
|
+
} else {
|
|
19754
|
+
arrayFormat = defaults.arrayFormat;
|
|
19755
|
+
}
|
|
19756
|
+
|
|
19757
|
+
if ('commaRoundTrip' in opts && typeof opts.commaRoundTrip !== 'boolean') {
|
|
19758
|
+
throw new TypeError('`commaRoundTrip` must be a boolean, or absent');
|
|
19759
|
+
}
|
|
19760
|
+
|
|
19761
|
+
var allowDots = typeof opts.allowDots === 'undefined' ? opts.encodeDotInKeys === true ? true : defaults.allowDots : !!opts.allowDots;
|
|
19762
|
+
|
|
19701
19763
|
return {
|
|
19702
19764
|
addQueryPrefix: typeof opts.addQueryPrefix === 'boolean' ? opts.addQueryPrefix : defaults.addQueryPrefix,
|
|
19703
|
-
allowDots:
|
|
19765
|
+
allowDots: allowDots,
|
|
19766
|
+
allowEmptyArrays: typeof opts.allowEmptyArrays === 'boolean' ? !!opts.allowEmptyArrays : defaults.allowEmptyArrays,
|
|
19767
|
+
arrayFormat: arrayFormat,
|
|
19704
19768
|
charset: charset,
|
|
19705
19769
|
charsetSentinel: typeof opts.charsetSentinel === 'boolean' ? opts.charsetSentinel : defaults.charsetSentinel,
|
|
19770
|
+
commaRoundTrip: !!opts.commaRoundTrip,
|
|
19706
19771
|
delimiter: typeof opts.delimiter === 'undefined' ? defaults.delimiter : opts.delimiter,
|
|
19707
19772
|
encode: typeof opts.encode === 'boolean' ? opts.encode : defaults.encode,
|
|
19773
|
+
encodeDotInKeys: typeof opts.encodeDotInKeys === 'boolean' ? opts.encodeDotInKeys : defaults.encodeDotInKeys,
|
|
19708
19774
|
encoder: typeof opts.encoder === 'function' ? opts.encoder : defaults.encoder,
|
|
19709
19775
|
encodeValuesOnly: typeof opts.encodeValuesOnly === 'boolean' ? opts.encodeValuesOnly : defaults.encodeValuesOnly,
|
|
19710
19776
|
filter: filter,
|
|
@@ -19738,20 +19804,8 @@ function requireStringify () {
|
|
|
19738
19804
|
return '';
|
|
19739
19805
|
}
|
|
19740
19806
|
|
|
19741
|
-
var arrayFormat;
|
|
19742
|
-
|
|
19743
|
-
arrayFormat = opts.arrayFormat;
|
|
19744
|
-
} else if (opts && 'indices' in opts) {
|
|
19745
|
-
arrayFormat = opts.indices ? 'indices' : 'repeat';
|
|
19746
|
-
} else {
|
|
19747
|
-
arrayFormat = 'indices';
|
|
19748
|
-
}
|
|
19749
|
-
|
|
19750
|
-
var generateArrayPrefix = arrayPrefixGenerators[arrayFormat];
|
|
19751
|
-
if (opts && 'commaRoundTrip' in opts && typeof opts.commaRoundTrip !== 'boolean') {
|
|
19752
|
-
throw new TypeError('`commaRoundTrip` must be a boolean, or absent');
|
|
19753
|
-
}
|
|
19754
|
-
var commaRoundTrip = generateArrayPrefix === 'comma' && opts && opts.commaRoundTrip;
|
|
19807
|
+
var generateArrayPrefix = arrayPrefixGenerators[options.arrayFormat];
|
|
19808
|
+
var commaRoundTrip = generateArrayPrefix === 'comma' && options.commaRoundTrip;
|
|
19755
19809
|
|
|
19756
19810
|
if (!objKeys) {
|
|
19757
19811
|
objKeys = Object.keys(obj);
|
|
@@ -19764,17 +19818,20 @@ function requireStringify () {
|
|
|
19764
19818
|
var sideChannel = getSideChannel();
|
|
19765
19819
|
for (var i = 0; i < objKeys.length; ++i) {
|
|
19766
19820
|
var key = objKeys[i];
|
|
19821
|
+
var value = obj[key];
|
|
19767
19822
|
|
|
19768
|
-
if (options.skipNulls &&
|
|
19823
|
+
if (options.skipNulls && value === null) {
|
|
19769
19824
|
continue;
|
|
19770
19825
|
}
|
|
19771
19826
|
pushToArray(keys, stringify(
|
|
19772
|
-
|
|
19827
|
+
value,
|
|
19773
19828
|
key,
|
|
19774
19829
|
generateArrayPrefix,
|
|
19775
19830
|
commaRoundTrip,
|
|
19831
|
+
options.allowEmptyArrays,
|
|
19776
19832
|
options.strictNullHandling,
|
|
19777
19833
|
options.skipNulls,
|
|
19834
|
+
options.encodeDotInKeys,
|
|
19778
19835
|
options.encode ? options.encoder : null,
|
|
19779
19836
|
options.filter,
|
|
19780
19837
|
options.sort,
|
|
@@ -19813,28 +19870,33 @@ function requireParse () {
|
|
|
19813
19870
|
if (hasRequiredParse) return parse;
|
|
19814
19871
|
hasRequiredParse = 1;
|
|
19815
19872
|
|
|
19816
|
-
var utils = requireUtils();
|
|
19873
|
+
var utils = /*@__PURE__*/ requireUtils();
|
|
19817
19874
|
|
|
19818
19875
|
var has = Object.prototype.hasOwnProperty;
|
|
19819
19876
|
var isArray = Array.isArray;
|
|
19820
19877
|
|
|
19821
19878
|
var defaults = {
|
|
19822
19879
|
allowDots: false,
|
|
19880
|
+
allowEmptyArrays: false,
|
|
19823
19881
|
allowPrototypes: false,
|
|
19824
19882
|
allowSparse: false,
|
|
19825
19883
|
arrayLimit: 20,
|
|
19826
19884
|
charset: 'utf-8',
|
|
19827
19885
|
charsetSentinel: false,
|
|
19828
19886
|
comma: false,
|
|
19887
|
+
decodeDotInKeys: false,
|
|
19829
19888
|
decoder: utils.decode,
|
|
19830
19889
|
delimiter: '&',
|
|
19831
19890
|
depth: 5,
|
|
19891
|
+
duplicates: 'combine',
|
|
19832
19892
|
ignoreQueryPrefix: false,
|
|
19833
19893
|
interpretNumericEntities: false,
|
|
19834
19894
|
parameterLimit: 1000,
|
|
19835
19895
|
parseArrays: true,
|
|
19836
19896
|
plainObjects: false,
|
|
19837
|
-
|
|
19897
|
+
strictDepth: false,
|
|
19898
|
+
strictNullHandling: false,
|
|
19899
|
+
throwOnLimitExceeded: false
|
|
19838
19900
|
};
|
|
19839
19901
|
|
|
19840
19902
|
var interpretNumericEntities = function (str) {
|
|
@@ -19843,11 +19905,15 @@ function requireParse () {
|
|
|
19843
19905
|
});
|
|
19844
19906
|
};
|
|
19845
19907
|
|
|
19846
|
-
var parseArrayValue = function (val, options) {
|
|
19908
|
+
var parseArrayValue = function (val, options, currentArrayLength) {
|
|
19847
19909
|
if (val && typeof val === 'string' && options.comma && val.indexOf(',') > -1) {
|
|
19848
19910
|
return val.split(',');
|
|
19849
19911
|
}
|
|
19850
19912
|
|
|
19913
|
+
if (options.throwOnLimitExceeded && currentArrayLength >= options.arrayLimit) {
|
|
19914
|
+
throw new RangeError('Array limit exceeded. Only ' + options.arrayLimit + ' element' + (options.arrayLimit === 1 ? '' : 's') + ' allowed in an array.');
|
|
19915
|
+
}
|
|
19916
|
+
|
|
19851
19917
|
return val;
|
|
19852
19918
|
};
|
|
19853
19919
|
|
|
@@ -19862,10 +19928,21 @@ function requireParse () {
|
|
|
19862
19928
|
var charsetSentinel = 'utf8=%E2%9C%93'; // encodeURIComponent('✓')
|
|
19863
19929
|
|
|
19864
19930
|
var parseValues = function parseQueryStringValues(str, options) {
|
|
19865
|
-
var obj = {};
|
|
19931
|
+
var obj = { __proto__: null };
|
|
19932
|
+
|
|
19866
19933
|
var cleanStr = options.ignoreQueryPrefix ? str.replace(/^\?/, '') : str;
|
|
19934
|
+
cleanStr = cleanStr.replace(/%5B/gi, '[').replace(/%5D/gi, ']');
|
|
19935
|
+
|
|
19867
19936
|
var limit = options.parameterLimit === Infinity ? undefined : options.parameterLimit;
|
|
19868
|
-
var parts = cleanStr.split(
|
|
19937
|
+
var parts = cleanStr.split(
|
|
19938
|
+
options.delimiter,
|
|
19939
|
+
options.throwOnLimitExceeded ? limit + 1 : limit
|
|
19940
|
+
);
|
|
19941
|
+
|
|
19942
|
+
if (options.throwOnLimitExceeded && parts.length > limit) {
|
|
19943
|
+
throw new RangeError('Parameter limit exceeded. Only ' + limit + ' parameter' + (limit === 1 ? '' : 's') + ' allowed.');
|
|
19944
|
+
}
|
|
19945
|
+
|
|
19869
19946
|
var skipIndex = -1; // Keep track of where the utf8 sentinel was found
|
|
19870
19947
|
var i;
|
|
19871
19948
|
|
|
@@ -19893,14 +19970,20 @@ function requireParse () {
|
|
|
19893
19970
|
var bracketEqualsPos = part.indexOf(']=');
|
|
19894
19971
|
var pos = bracketEqualsPos === -1 ? part.indexOf('=') : bracketEqualsPos + 1;
|
|
19895
19972
|
|
|
19896
|
-
var key
|
|
19973
|
+
var key;
|
|
19974
|
+
var val;
|
|
19897
19975
|
if (pos === -1) {
|
|
19898
19976
|
key = options.decoder(part, defaults.decoder, charset, 'key');
|
|
19899
19977
|
val = options.strictNullHandling ? null : '';
|
|
19900
19978
|
} else {
|
|
19901
19979
|
key = options.decoder(part.slice(0, pos), defaults.decoder, charset, 'key');
|
|
19980
|
+
|
|
19902
19981
|
val = utils.maybeMap(
|
|
19903
|
-
parseArrayValue(
|
|
19982
|
+
parseArrayValue(
|
|
19983
|
+
part.slice(pos + 1),
|
|
19984
|
+
options,
|
|
19985
|
+
isArray(obj[key]) ? obj[key].length : 0
|
|
19986
|
+
),
|
|
19904
19987
|
function (encodedVal) {
|
|
19905
19988
|
return options.decoder(encodedVal, defaults.decoder, charset, 'value');
|
|
19906
19989
|
}
|
|
@@ -19908,16 +19991,17 @@ function requireParse () {
|
|
|
19908
19991
|
}
|
|
19909
19992
|
|
|
19910
19993
|
if (val && options.interpretNumericEntities && charset === 'iso-8859-1') {
|
|
19911
|
-
val = interpretNumericEntities(val);
|
|
19994
|
+
val = interpretNumericEntities(String(val));
|
|
19912
19995
|
}
|
|
19913
19996
|
|
|
19914
19997
|
if (part.indexOf('[]=') > -1) {
|
|
19915
19998
|
val = isArray(val) ? [val] : val;
|
|
19916
19999
|
}
|
|
19917
20000
|
|
|
19918
|
-
|
|
20001
|
+
var existing = has.call(obj, key);
|
|
20002
|
+
if (existing && options.duplicates === 'combine') {
|
|
19919
20003
|
obj[key] = utils.combine(obj[key], val);
|
|
19920
|
-
} else {
|
|
20004
|
+
} else if (!existing || options.duplicates === 'last') {
|
|
19921
20005
|
obj[key] = val;
|
|
19922
20006
|
}
|
|
19923
20007
|
}
|
|
@@ -19926,31 +20010,40 @@ function requireParse () {
|
|
|
19926
20010
|
};
|
|
19927
20011
|
|
|
19928
20012
|
var parseObject = function (chain, val, options, valuesParsed) {
|
|
19929
|
-
var
|
|
20013
|
+
var currentArrayLength = 0;
|
|
20014
|
+
if (chain.length > 0 && chain[chain.length - 1] === '[]') {
|
|
20015
|
+
var parentKey = chain.slice(0, -1).join('');
|
|
20016
|
+
currentArrayLength = Array.isArray(val) && val[parentKey] ? val[parentKey].length : 0;
|
|
20017
|
+
}
|
|
20018
|
+
|
|
20019
|
+
var leaf = valuesParsed ? val : parseArrayValue(val, options, currentArrayLength);
|
|
19930
20020
|
|
|
19931
20021
|
for (var i = chain.length - 1; i >= 0; --i) {
|
|
19932
20022
|
var obj;
|
|
19933
20023
|
var root = chain[i];
|
|
19934
20024
|
|
|
19935
20025
|
if (root === '[]' && options.parseArrays) {
|
|
19936
|
-
obj =
|
|
20026
|
+
obj = options.allowEmptyArrays && (leaf === '' || (options.strictNullHandling && leaf === null))
|
|
20027
|
+
? []
|
|
20028
|
+
: utils.combine([], leaf);
|
|
19937
20029
|
} else {
|
|
19938
|
-
obj = options.plainObjects ?
|
|
20030
|
+
obj = options.plainObjects ? { __proto__: null } : {};
|
|
19939
20031
|
var cleanRoot = root.charAt(0) === '[' && root.charAt(root.length - 1) === ']' ? root.slice(1, -1) : root;
|
|
19940
|
-
var
|
|
19941
|
-
|
|
20032
|
+
var decodedRoot = options.decodeDotInKeys ? cleanRoot.replace(/%2E/g, '.') : cleanRoot;
|
|
20033
|
+
var index = parseInt(decodedRoot, 10);
|
|
20034
|
+
if (!options.parseArrays && decodedRoot === '') {
|
|
19942
20035
|
obj = { 0: leaf };
|
|
19943
20036
|
} else if (
|
|
19944
20037
|
!isNaN(index)
|
|
19945
|
-
&& root !==
|
|
19946
|
-
&& String(index) ===
|
|
20038
|
+
&& root !== decodedRoot
|
|
20039
|
+
&& String(index) === decodedRoot
|
|
19947
20040
|
&& index >= 0
|
|
19948
20041
|
&& (options.parseArrays && index <= options.arrayLimit)
|
|
19949
20042
|
) {
|
|
19950
20043
|
obj = [];
|
|
19951
20044
|
obj[index] = leaf;
|
|
19952
|
-
} else if (
|
|
19953
|
-
obj[
|
|
20045
|
+
} else if (decodedRoot !== '__proto__') {
|
|
20046
|
+
obj[decodedRoot] = leaf;
|
|
19954
20047
|
}
|
|
19955
20048
|
}
|
|
19956
20049
|
|
|
@@ -20005,9 +20098,12 @@ function requireParse () {
|
|
|
20005
20098
|
keys.push(segment[1]);
|
|
20006
20099
|
}
|
|
20007
20100
|
|
|
20008
|
-
// If there's a remainder, just add whatever is left
|
|
20101
|
+
// If there's a remainder, check strictDepth option for throw, else just add whatever is left
|
|
20009
20102
|
|
|
20010
20103
|
if (segment) {
|
|
20104
|
+
if (options.strictDepth === true) {
|
|
20105
|
+
throw new RangeError('Input depth exceeded depth option of ' + options.depth + ' and strictDepth is true');
|
|
20106
|
+
}
|
|
20011
20107
|
keys.push('[' + key.slice(segment.index) + ']');
|
|
20012
20108
|
}
|
|
20013
20109
|
|
|
@@ -20019,33 +20115,59 @@ function requireParse () {
|
|
|
20019
20115
|
return defaults;
|
|
20020
20116
|
}
|
|
20021
20117
|
|
|
20022
|
-
if (
|
|
20118
|
+
if (typeof opts.allowEmptyArrays !== 'undefined' && typeof opts.allowEmptyArrays !== 'boolean') {
|
|
20119
|
+
throw new TypeError('`allowEmptyArrays` option can only be `true` or `false`, when provided');
|
|
20120
|
+
}
|
|
20121
|
+
|
|
20122
|
+
if (typeof opts.decodeDotInKeys !== 'undefined' && typeof opts.decodeDotInKeys !== 'boolean') {
|
|
20123
|
+
throw new TypeError('`decodeDotInKeys` option can only be `true` or `false`, when provided');
|
|
20124
|
+
}
|
|
20125
|
+
|
|
20126
|
+
if (opts.decoder !== null && typeof opts.decoder !== 'undefined' && typeof opts.decoder !== 'function') {
|
|
20023
20127
|
throw new TypeError('Decoder has to be a function.');
|
|
20024
20128
|
}
|
|
20025
20129
|
|
|
20026
20130
|
if (typeof opts.charset !== 'undefined' && opts.charset !== 'utf-8' && opts.charset !== 'iso-8859-1') {
|
|
20027
20131
|
throw new TypeError('The charset option must be either utf-8, iso-8859-1, or undefined');
|
|
20028
20132
|
}
|
|
20133
|
+
|
|
20134
|
+
if (typeof opts.throwOnLimitExceeded !== 'undefined' && typeof opts.throwOnLimitExceeded !== 'boolean') {
|
|
20135
|
+
throw new TypeError('`throwOnLimitExceeded` option must be a boolean');
|
|
20136
|
+
}
|
|
20137
|
+
|
|
20029
20138
|
var charset = typeof opts.charset === 'undefined' ? defaults.charset : opts.charset;
|
|
20030
20139
|
|
|
20140
|
+
var duplicates = typeof opts.duplicates === 'undefined' ? defaults.duplicates : opts.duplicates;
|
|
20141
|
+
|
|
20142
|
+
if (duplicates !== 'combine' && duplicates !== 'first' && duplicates !== 'last') {
|
|
20143
|
+
throw new TypeError('The duplicates option must be either combine, first, or last');
|
|
20144
|
+
}
|
|
20145
|
+
|
|
20146
|
+
var allowDots = typeof opts.allowDots === 'undefined' ? opts.decodeDotInKeys === true ? true : defaults.allowDots : !!opts.allowDots;
|
|
20147
|
+
|
|
20031
20148
|
return {
|
|
20032
|
-
allowDots:
|
|
20149
|
+
allowDots: allowDots,
|
|
20150
|
+
allowEmptyArrays: typeof opts.allowEmptyArrays === 'boolean' ? !!opts.allowEmptyArrays : defaults.allowEmptyArrays,
|
|
20033
20151
|
allowPrototypes: typeof opts.allowPrototypes === 'boolean' ? opts.allowPrototypes : defaults.allowPrototypes,
|
|
20034
20152
|
allowSparse: typeof opts.allowSparse === 'boolean' ? opts.allowSparse : defaults.allowSparse,
|
|
20035
20153
|
arrayLimit: typeof opts.arrayLimit === 'number' ? opts.arrayLimit : defaults.arrayLimit,
|
|
20036
20154
|
charset: charset,
|
|
20037
20155
|
charsetSentinel: typeof opts.charsetSentinel === 'boolean' ? opts.charsetSentinel : defaults.charsetSentinel,
|
|
20038
20156
|
comma: typeof opts.comma === 'boolean' ? opts.comma : defaults.comma,
|
|
20157
|
+
decodeDotInKeys: typeof opts.decodeDotInKeys === 'boolean' ? opts.decodeDotInKeys : defaults.decodeDotInKeys,
|
|
20039
20158
|
decoder: typeof opts.decoder === 'function' ? opts.decoder : defaults.decoder,
|
|
20040
20159
|
delimiter: typeof opts.delimiter === 'string' || utils.isRegExp(opts.delimiter) ? opts.delimiter : defaults.delimiter,
|
|
20041
20160
|
// eslint-disable-next-line no-implicit-coercion, no-extra-parens
|
|
20042
20161
|
depth: (typeof opts.depth === 'number' || opts.depth === false) ? +opts.depth : defaults.depth,
|
|
20162
|
+
duplicates: duplicates,
|
|
20043
20163
|
ignoreQueryPrefix: opts.ignoreQueryPrefix === true,
|
|
20044
20164
|
interpretNumericEntities: typeof opts.interpretNumericEntities === 'boolean' ? opts.interpretNumericEntities : defaults.interpretNumericEntities,
|
|
20045
20165
|
parameterLimit: typeof opts.parameterLimit === 'number' ? opts.parameterLimit : defaults.parameterLimit,
|
|
20046
20166
|
parseArrays: opts.parseArrays !== false,
|
|
20047
20167
|
plainObjects: typeof opts.plainObjects === 'boolean' ? opts.plainObjects : defaults.plainObjects,
|
|
20048
|
-
|
|
20168
|
+
strictDepth: typeof opts.strictDepth === 'boolean' ? !!opts.strictDepth : defaults.strictDepth,
|
|
20169
|
+
strictNullHandling: typeof opts.strictNullHandling === 'boolean' ? opts.strictNullHandling : defaults.strictNullHandling,
|
|
20170
|
+
throwOnLimitExceeded: typeof opts.throwOnLimitExceeded === 'boolean' ? opts.throwOnLimitExceeded : false
|
|
20049
20171
|
};
|
|
20050
20172
|
};
|
|
20051
20173
|
|
|
@@ -20053,11 +20175,11 @@ function requireParse () {
|
|
|
20053
20175
|
var options = normalizeParseOptions(opts);
|
|
20054
20176
|
|
|
20055
20177
|
if (str === '' || str === null || typeof str === 'undefined') {
|
|
20056
|
-
return options.plainObjects ?
|
|
20178
|
+
return options.plainObjects ? { __proto__: null } : {};
|
|
20057
20179
|
}
|
|
20058
20180
|
|
|
20059
20181
|
var tempObj = typeof str === 'string' ? parseValues(str, options) : str;
|
|
20060
|
-
var obj = options.plainObjects ?
|
|
20182
|
+
var obj = options.plainObjects ? { __proto__: null } : {};
|
|
20061
20183
|
|
|
20062
20184
|
// Iterate over the keys and setup the new object
|
|
20063
20185
|
|
|
@@ -20084,9 +20206,9 @@ function requireLib () {
|
|
|
20084
20206
|
if (hasRequiredLib) return lib;
|
|
20085
20207
|
hasRequiredLib = 1;
|
|
20086
20208
|
|
|
20087
|
-
var stringify = requireStringify();
|
|
20088
|
-
var parse = requireParse();
|
|
20089
|
-
var formats = requireFormats();
|
|
20209
|
+
var stringify = /*@__PURE__*/ requireStringify();
|
|
20210
|
+
var parse = /*@__PURE__*/ requireParse();
|
|
20211
|
+
var formats = /*@__PURE__*/ requireFormats();
|
|
20090
20212
|
|
|
20091
20213
|
lib = {
|
|
20092
20214
|
formats: formats,
|
|
@@ -20096,7 +20218,7 @@ function requireLib () {
|
|
|
20096
20218
|
return lib;
|
|
20097
20219
|
}
|
|
20098
20220
|
|
|
20099
|
-
var libExports = requireLib();
|
|
20221
|
+
var libExports = /*@__PURE__*/ requireLib();
|
|
20100
20222
|
var qs = /*@__PURE__*/getDefaultExportFromCjs(libExports);
|
|
20101
20223
|
|
|
20102
20224
|
var src = {exports: {}};
|
|
@@ -20858,165 +20980,6 @@ function requireBrowser () {
|
|
|
20858
20980
|
|
|
20859
20981
|
var node = {exports: {}};
|
|
20860
20982
|
|
|
20861
|
-
var hasFlag;
|
|
20862
|
-
var hasRequiredHasFlag;
|
|
20863
|
-
|
|
20864
|
-
function requireHasFlag () {
|
|
20865
|
-
if (hasRequiredHasFlag) return hasFlag;
|
|
20866
|
-
hasRequiredHasFlag = 1;
|
|
20867
|
-
|
|
20868
|
-
hasFlag = (flag, argv = process.argv) => {
|
|
20869
|
-
const prefix = flag.startsWith('-') ? '' : (flag.length === 1 ? '-' : '--');
|
|
20870
|
-
const position = argv.indexOf(prefix + flag);
|
|
20871
|
-
const terminatorPosition = argv.indexOf('--');
|
|
20872
|
-
return position !== -1 && (terminatorPosition === -1 || position < terminatorPosition);
|
|
20873
|
-
};
|
|
20874
|
-
return hasFlag;
|
|
20875
|
-
}
|
|
20876
|
-
|
|
20877
|
-
var supportsColor_1;
|
|
20878
|
-
var hasRequiredSupportsColor;
|
|
20879
|
-
|
|
20880
|
-
function requireSupportsColor () {
|
|
20881
|
-
if (hasRequiredSupportsColor) return supportsColor_1;
|
|
20882
|
-
hasRequiredSupportsColor = 1;
|
|
20883
|
-
const os = require$$0$1;
|
|
20884
|
-
const tty = require$$1;
|
|
20885
|
-
const hasFlag = requireHasFlag();
|
|
20886
|
-
|
|
20887
|
-
const {env} = process;
|
|
20888
|
-
|
|
20889
|
-
let forceColor;
|
|
20890
|
-
if (hasFlag('no-color') ||
|
|
20891
|
-
hasFlag('no-colors') ||
|
|
20892
|
-
hasFlag('color=false') ||
|
|
20893
|
-
hasFlag('color=never')) {
|
|
20894
|
-
forceColor = 0;
|
|
20895
|
-
} else if (hasFlag('color') ||
|
|
20896
|
-
hasFlag('colors') ||
|
|
20897
|
-
hasFlag('color=true') ||
|
|
20898
|
-
hasFlag('color=always')) {
|
|
20899
|
-
forceColor = 1;
|
|
20900
|
-
}
|
|
20901
|
-
|
|
20902
|
-
if ('FORCE_COLOR' in env) {
|
|
20903
|
-
if (env.FORCE_COLOR === 'true') {
|
|
20904
|
-
forceColor = 1;
|
|
20905
|
-
} else if (env.FORCE_COLOR === 'false') {
|
|
20906
|
-
forceColor = 0;
|
|
20907
|
-
} else {
|
|
20908
|
-
forceColor = env.FORCE_COLOR.length === 0 ? 1 : Math.min(parseInt(env.FORCE_COLOR, 10), 3);
|
|
20909
|
-
}
|
|
20910
|
-
}
|
|
20911
|
-
|
|
20912
|
-
function translateLevel(level) {
|
|
20913
|
-
if (level === 0) {
|
|
20914
|
-
return false;
|
|
20915
|
-
}
|
|
20916
|
-
|
|
20917
|
-
return {
|
|
20918
|
-
level,
|
|
20919
|
-
hasBasic: true,
|
|
20920
|
-
has256: level >= 2,
|
|
20921
|
-
has16m: level >= 3
|
|
20922
|
-
};
|
|
20923
|
-
}
|
|
20924
|
-
|
|
20925
|
-
function supportsColor(haveStream, streamIsTTY) {
|
|
20926
|
-
if (forceColor === 0) {
|
|
20927
|
-
return 0;
|
|
20928
|
-
}
|
|
20929
|
-
|
|
20930
|
-
if (hasFlag('color=16m') ||
|
|
20931
|
-
hasFlag('color=full') ||
|
|
20932
|
-
hasFlag('color=truecolor')) {
|
|
20933
|
-
return 3;
|
|
20934
|
-
}
|
|
20935
|
-
|
|
20936
|
-
if (hasFlag('color=256')) {
|
|
20937
|
-
return 2;
|
|
20938
|
-
}
|
|
20939
|
-
|
|
20940
|
-
if (haveStream && !streamIsTTY && forceColor === undefined) {
|
|
20941
|
-
return 0;
|
|
20942
|
-
}
|
|
20943
|
-
|
|
20944
|
-
const min = forceColor || 0;
|
|
20945
|
-
|
|
20946
|
-
if (env.TERM === 'dumb') {
|
|
20947
|
-
return min;
|
|
20948
|
-
}
|
|
20949
|
-
|
|
20950
|
-
if (process.platform === 'win32') {
|
|
20951
|
-
// Windows 10 build 10586 is the first Windows release that supports 256 colors.
|
|
20952
|
-
// Windows 10 build 14931 is the first release that supports 16m/TrueColor.
|
|
20953
|
-
const osRelease = os.release().split('.');
|
|
20954
|
-
if (
|
|
20955
|
-
Number(osRelease[0]) >= 10 &&
|
|
20956
|
-
Number(osRelease[2]) >= 10586
|
|
20957
|
-
) {
|
|
20958
|
-
return Number(osRelease[2]) >= 14931 ? 3 : 2;
|
|
20959
|
-
}
|
|
20960
|
-
|
|
20961
|
-
return 1;
|
|
20962
|
-
}
|
|
20963
|
-
|
|
20964
|
-
if ('CI' in env) {
|
|
20965
|
-
if (['TRAVIS', 'CIRCLECI', 'APPVEYOR', 'GITLAB_CI', 'GITHUB_ACTIONS', 'BUILDKITE'].some(sign => sign in env) || env.CI_NAME === 'codeship') {
|
|
20966
|
-
return 1;
|
|
20967
|
-
}
|
|
20968
|
-
|
|
20969
|
-
return min;
|
|
20970
|
-
}
|
|
20971
|
-
|
|
20972
|
-
if ('TEAMCITY_VERSION' in env) {
|
|
20973
|
-
return /^(9\.(0*[1-9]\d*)\.|\d{2,}\.)/.test(env.TEAMCITY_VERSION) ? 1 : 0;
|
|
20974
|
-
}
|
|
20975
|
-
|
|
20976
|
-
if (env.COLORTERM === 'truecolor') {
|
|
20977
|
-
return 3;
|
|
20978
|
-
}
|
|
20979
|
-
|
|
20980
|
-
if ('TERM_PROGRAM' in env) {
|
|
20981
|
-
const version = parseInt((env.TERM_PROGRAM_VERSION || '').split('.')[0], 10);
|
|
20982
|
-
|
|
20983
|
-
switch (env.TERM_PROGRAM) {
|
|
20984
|
-
case 'iTerm.app':
|
|
20985
|
-
return version >= 3 ? 3 : 2;
|
|
20986
|
-
case 'Apple_Terminal':
|
|
20987
|
-
return 2;
|
|
20988
|
-
// No default
|
|
20989
|
-
}
|
|
20990
|
-
}
|
|
20991
|
-
|
|
20992
|
-
if (/-256(color)?$/i.test(env.TERM)) {
|
|
20993
|
-
return 2;
|
|
20994
|
-
}
|
|
20995
|
-
|
|
20996
|
-
if (/^screen|^xterm|^vt100|^vt220|^rxvt|color|ansi|cygwin|linux/i.test(env.TERM)) {
|
|
20997
|
-
return 1;
|
|
20998
|
-
}
|
|
20999
|
-
|
|
21000
|
-
if ('COLORTERM' in env) {
|
|
21001
|
-
return 1;
|
|
21002
|
-
}
|
|
21003
|
-
|
|
21004
|
-
return min;
|
|
21005
|
-
}
|
|
21006
|
-
|
|
21007
|
-
function getSupportLevel(stream) {
|
|
21008
|
-
const level = supportsColor(stream, stream && stream.isTTY);
|
|
21009
|
-
return translateLevel(level);
|
|
21010
|
-
}
|
|
21011
|
-
|
|
21012
|
-
supportsColor_1 = {
|
|
21013
|
-
supportsColor: getSupportLevel,
|
|
21014
|
-
stdout: translateLevel(supportsColor(true, tty.isatty(1))),
|
|
21015
|
-
stderr: translateLevel(supportsColor(true, tty.isatty(2)))
|
|
21016
|
-
};
|
|
21017
|
-
return supportsColor_1;
|
|
21018
|
-
}
|
|
21019
|
-
|
|
21020
20983
|
/**
|
|
21021
20984
|
* Module dependencies.
|
|
21022
20985
|
*/
|
|
@@ -21027,7 +20990,7 @@ function requireNode () {
|
|
|
21027
20990
|
if (hasRequiredNode) return node.exports;
|
|
21028
20991
|
hasRequiredNode = 1;
|
|
21029
20992
|
(function (module, exports) {
|
|
21030
|
-
const tty = require$$1;
|
|
20993
|
+
const tty = require$$0$1;
|
|
21031
20994
|
const util = require$$0;
|
|
21032
20995
|
|
|
21033
20996
|
/**
|
|
@@ -21054,7 +21017,7 @@ function requireNode () {
|
|
|
21054
21017
|
try {
|
|
21055
21018
|
// Optional dependency (as in, doesn't need to be installed, NOT like optionalDependencies in package.json)
|
|
21056
21019
|
// eslint-disable-next-line import/no-extraneous-dependencies
|
|
21057
|
-
const supportsColor =
|
|
21020
|
+
const supportsColor = require('supports-color');
|
|
21058
21021
|
|
|
21059
21022
|
if (supportsColor && (supportsColor.stderr || supportsColor).level >= 2) {
|
|
21060
21023
|
exports.colors = [
|
|
@@ -21473,14 +21436,34 @@ class Strapi {
|
|
|
21473
21436
|
log(data);
|
|
21474
21437
|
return data;
|
|
21475
21438
|
}
|
|
21439
|
+
mergePermissionsPreferChild(parentPermissions, childPermissions) {
|
|
21440
|
+
// Child permissions should override parent on conflicts; missing entries inherit from parent
|
|
21441
|
+
return _.merge({}, parentPermissions, childPermissions);
|
|
21442
|
+
}
|
|
21443
|
+
async fetchRolePermissions(roleId) {
|
|
21444
|
+
const response = await this.fetchData(`users-permissions/roles/${roleId}`);
|
|
21445
|
+
const parentId = typeof response.role.parent === 'number' ? response.role.parent : response.role.parent?.id;
|
|
21446
|
+
return { permissions: response.role.permissions, parentId };
|
|
21447
|
+
}
|
|
21448
|
+
async collectRolePermissions(roleId) {
|
|
21449
|
+
// Start with the immediate role's permissions, then walk up parents, merging so child overrides parent
|
|
21450
|
+
const { permissions: initialPermissions, parentId: initialParentId } = await this.fetchRolePermissions(roleId);
|
|
21451
|
+
let accumulatedPermissions = _.cloneDeep(initialPermissions);
|
|
21452
|
+
let currentParentId = initialParentId;
|
|
21453
|
+
while (currentParentId) {
|
|
21454
|
+
const { permissions: parentPermissions, parentId } = await this.fetchRolePermissions(currentParentId);
|
|
21455
|
+
accumulatedPermissions = this.mergePermissionsPreferChild(parentPermissions, accumulatedPermissions);
|
|
21456
|
+
currentParentId = parentId;
|
|
21457
|
+
}
|
|
21458
|
+
return accumulatedPermissions;
|
|
21459
|
+
}
|
|
21476
21460
|
async can(uid, controller, action) {
|
|
21477
21461
|
if (!this.permissionsList) {
|
|
21478
21462
|
const user = await this.baseMe({ populate: { role: { fields: ["id"] } } });
|
|
21479
21463
|
if (user.error) {
|
|
21480
21464
|
return false;
|
|
21481
21465
|
}
|
|
21482
|
-
|
|
21483
|
-
this.permissionsList = response.role.permissions;
|
|
21466
|
+
this.permissionsList = await this.collectRolePermissions(user.role.id);
|
|
21484
21467
|
}
|
|
21485
21468
|
if (!this.permissionsList[uid]) {
|
|
21486
21469
|
throw new Error(`Permissions for ${uid} not found!`);
|
|
@@ -22108,7 +22091,7 @@ function requireMain () {
|
|
|
22108
22091
|
hasRequiredMain = 1;
|
|
22109
22092
|
const fs$1 = fs;
|
|
22110
22093
|
const path$1 = path;
|
|
22111
|
-
const os = require$$
|
|
22094
|
+
const os = require$$2;
|
|
22112
22095
|
const crypto = require$$3;
|
|
22113
22096
|
const packageJson = require$$4;
|
|
22114
22097
|
|