@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/index.mjs
CHANGED
|
@@ -1,6 +1,5 @@
|
|
|
1
1
|
import require$$0 from 'util';
|
|
2
|
-
import require$$1 from 'tty';
|
|
3
|
-
import require$$0$1 from 'os';
|
|
2
|
+
import require$$0$1 from 'tty';
|
|
4
3
|
|
|
5
4
|
var commonjsGlobal = typeof globalThis !== 'undefined' ? globalThis : typeof window !== 'undefined' ? window : typeof global !== 'undefined' ? global : typeof self !== 'undefined' ? self : {};
|
|
6
5
|
|
|
@@ -17537,13 +17536,16 @@ function requireObjectInspect () {
|
|
|
17537
17536
|
return $replace.call(String(s), /"/g, '"');
|
|
17538
17537
|
}
|
|
17539
17538
|
|
|
17540
|
-
function
|
|
17541
|
-
|
|
17542
|
-
|
|
17543
|
-
function
|
|
17544
|
-
function
|
|
17545
|
-
function
|
|
17546
|
-
function
|
|
17539
|
+
function canTrustToString(obj) {
|
|
17540
|
+
return !toStringTag || !(typeof obj === 'object' && (toStringTag in obj || typeof obj[toStringTag] !== 'undefined'));
|
|
17541
|
+
}
|
|
17542
|
+
function isArray(obj) { return toStr(obj) === '[object Array]' && canTrustToString(obj); }
|
|
17543
|
+
function isDate(obj) { return toStr(obj) === '[object Date]' && canTrustToString(obj); }
|
|
17544
|
+
function isRegExp(obj) { return toStr(obj) === '[object RegExp]' && canTrustToString(obj); }
|
|
17545
|
+
function isError(obj) { return toStr(obj) === '[object Error]' && canTrustToString(obj); }
|
|
17546
|
+
function isString(obj) { return toStr(obj) === '[object String]' && canTrustToString(obj); }
|
|
17547
|
+
function isNumber(obj) { return toStr(obj) === '[object Number]' && canTrustToString(obj); }
|
|
17548
|
+
function isBoolean(obj) { return toStr(obj) === '[object Boolean]' && canTrustToString(obj); }
|
|
17547
17549
|
|
|
17548
17550
|
// Symbol and BigInt do have Symbol.toStringTag by spec, so that can't be used to eliminate false positives
|
|
17549
17551
|
function isSymbol(obj) {
|
|
@@ -18432,7 +18434,7 @@ function requireCallBindApplyHelpers () {
|
|
|
18432
18434
|
var $call = requireFunctionCall();
|
|
18433
18435
|
var $actualApply = requireActualApply();
|
|
18434
18436
|
|
|
18435
|
-
/** @type {import('.')
|
|
18437
|
+
/** @type {(args: [Function, thisArg?: unknown, ...args: unknown[]]) => Function} TODO FIXME, find a way to use import('.') */
|
|
18436
18438
|
callBindApplyHelpers = function callBindBasic(args) {
|
|
18437
18439
|
if (args.length < 1 || typeof args[0] !== 'function') {
|
|
18438
18440
|
throw new $TypeError('a function is required');
|
|
@@ -18628,6 +18630,7 @@ function requireGetIntrinsic () {
|
|
|
18628
18630
|
'%Error%': $Error,
|
|
18629
18631
|
'%eval%': eval, // eslint-disable-line no-eval
|
|
18630
18632
|
'%EvalError%': $EvalError,
|
|
18633
|
+
'%Float16Array%': typeof Float16Array === 'undefined' ? undefined$1 : Float16Array,
|
|
18631
18634
|
'%Float32Array%': typeof Float32Array === 'undefined' ? undefined$1 : Float32Array,
|
|
18632
18635
|
'%Float64Array%': typeof Float64Array === 'undefined' ? undefined$1 : Float64Array,
|
|
18633
18636
|
'%FinalizationRegistry%': typeof FinalizationRegistry === 'undefined' ? undefined$1 : FinalizationRegistry,
|
|
@@ -18932,10 +18935,11 @@ function requireCallBound () {
|
|
|
18932
18935
|
|
|
18933
18936
|
/** @type {import('.')} */
|
|
18934
18937
|
callBound = function callBoundIntrinsic(name, allowMissing) {
|
|
18935
|
-
|
|
18936
|
-
|
|
18938
|
+
/* eslint no-extra-parens: 0 */
|
|
18939
|
+
|
|
18940
|
+
var intrinsic = /** @type {(this: unknown, ...args: unknown[]) => unknown} */ (GetIntrinsic(name, !!allowMissing));
|
|
18937
18941
|
if (typeof intrinsic === 'function' && $indexOf(name, '.prototype.') > -1) {
|
|
18938
|
-
return callBindBasic([intrinsic]);
|
|
18942
|
+
return callBindBasic(/** @type {const} */ ([intrinsic]));
|
|
18939
18943
|
}
|
|
18940
18944
|
return intrinsic;
|
|
18941
18945
|
};
|
|
@@ -19199,7 +19203,7 @@ function requireUtils () {
|
|
|
19199
19203
|
if (hasRequiredUtils) return utils;
|
|
19200
19204
|
hasRequiredUtils = 1;
|
|
19201
19205
|
|
|
19202
|
-
var formats = requireFormats();
|
|
19206
|
+
var formats = /*@__PURE__*/ requireFormats();
|
|
19203
19207
|
|
|
19204
19208
|
var has = Object.prototype.hasOwnProperty;
|
|
19205
19209
|
var isArray = Array.isArray;
|
|
@@ -19233,7 +19237,7 @@ function requireUtils () {
|
|
|
19233
19237
|
};
|
|
19234
19238
|
|
|
19235
19239
|
var arrayToObject = function arrayToObject(source, options) {
|
|
19236
|
-
var obj = options && options.plainObjects ?
|
|
19240
|
+
var obj = options && options.plainObjects ? { __proto__: null } : {};
|
|
19237
19241
|
for (var i = 0; i < source.length; ++i) {
|
|
19238
19242
|
if (typeof source[i] !== 'undefined') {
|
|
19239
19243
|
obj[i] = source[i];
|
|
@@ -19249,11 +19253,14 @@ function requireUtils () {
|
|
|
19249
19253
|
return target;
|
|
19250
19254
|
}
|
|
19251
19255
|
|
|
19252
|
-
if (typeof source !== 'object') {
|
|
19256
|
+
if (typeof source !== 'object' && typeof source !== 'function') {
|
|
19253
19257
|
if (isArray(target)) {
|
|
19254
19258
|
target.push(source);
|
|
19255
19259
|
} else if (target && typeof target === 'object') {
|
|
19256
|
-
if (
|
|
19260
|
+
if (
|
|
19261
|
+
(options && (options.plainObjects || options.allowPrototypes))
|
|
19262
|
+
|| !has.call(Object.prototype, source)
|
|
19263
|
+
) {
|
|
19257
19264
|
target[source] = true;
|
|
19258
19265
|
}
|
|
19259
19266
|
} else {
|
|
@@ -19307,7 +19314,7 @@ function requireUtils () {
|
|
|
19307
19314
|
}, target);
|
|
19308
19315
|
};
|
|
19309
19316
|
|
|
19310
|
-
var decode = function (str,
|
|
19317
|
+
var decode = function (str, defaultDecoder, charset) {
|
|
19311
19318
|
var strWithoutPlus = str.replace(/\+/g, ' ');
|
|
19312
19319
|
if (charset === 'iso-8859-1') {
|
|
19313
19320
|
// unescape never throws, no try...catch needed:
|
|
@@ -19321,6 +19328,10 @@ function requireUtils () {
|
|
|
19321
19328
|
}
|
|
19322
19329
|
};
|
|
19323
19330
|
|
|
19331
|
+
var limit = 1024;
|
|
19332
|
+
|
|
19333
|
+
/* eslint operator-linebreak: [2, "before"] */
|
|
19334
|
+
|
|
19324
19335
|
var encode = function encode(str, defaultEncoder, charset, kind, format) {
|
|
19325
19336
|
// This code was originally written by Brian White (mscdex) for the io.js core querystring library.
|
|
19326
19337
|
// It has been adapted here for stricter adherence to RFC 3986
|
|
@@ -19342,45 +19353,54 @@ function requireUtils () {
|
|
|
19342
19353
|
}
|
|
19343
19354
|
|
|
19344
19355
|
var out = '';
|
|
19345
|
-
for (var
|
|
19346
|
-
var
|
|
19347
|
-
|
|
19348
|
-
|
|
19349
|
-
|
|
19350
|
-
|
|
19351
|
-
|
|
19352
|
-
|
|
19353
|
-
|
|
19354
|
-
|
|
19355
|
-
|
|
19356
|
-
|
|
19357
|
-
|
|
19358
|
-
|
|
19359
|
-
|
|
19360
|
-
|
|
19356
|
+
for (var j = 0; j < string.length; j += limit) {
|
|
19357
|
+
var segment = string.length >= limit ? string.slice(j, j + limit) : string;
|
|
19358
|
+
var arr = [];
|
|
19359
|
+
|
|
19360
|
+
for (var i = 0; i < segment.length; ++i) {
|
|
19361
|
+
var c = segment.charCodeAt(i);
|
|
19362
|
+
if (
|
|
19363
|
+
c === 0x2D // -
|
|
19364
|
+
|| c === 0x2E // .
|
|
19365
|
+
|| c === 0x5F // _
|
|
19366
|
+
|| c === 0x7E // ~
|
|
19367
|
+
|| (c >= 0x30 && c <= 0x39) // 0-9
|
|
19368
|
+
|| (c >= 0x41 && c <= 0x5A) // a-z
|
|
19369
|
+
|| (c >= 0x61 && c <= 0x7A) // A-Z
|
|
19370
|
+
|| (format === formats.RFC1738 && (c === 0x28 || c === 0x29)) // ( )
|
|
19371
|
+
) {
|
|
19372
|
+
arr[arr.length] = segment.charAt(i);
|
|
19373
|
+
continue;
|
|
19374
|
+
}
|
|
19361
19375
|
|
|
19362
|
-
|
|
19363
|
-
|
|
19364
|
-
|
|
19365
|
-
|
|
19376
|
+
if (c < 0x80) {
|
|
19377
|
+
arr[arr.length] = hexTable[c];
|
|
19378
|
+
continue;
|
|
19379
|
+
}
|
|
19366
19380
|
|
|
19367
|
-
|
|
19368
|
-
|
|
19369
|
-
|
|
19370
|
-
|
|
19381
|
+
if (c < 0x800) {
|
|
19382
|
+
arr[arr.length] = hexTable[0xC0 | (c >> 6)]
|
|
19383
|
+
+ hexTable[0x80 | (c & 0x3F)];
|
|
19384
|
+
continue;
|
|
19385
|
+
}
|
|
19371
19386
|
|
|
19372
|
-
|
|
19373
|
-
|
|
19374
|
-
|
|
19387
|
+
if (c < 0xD800 || c >= 0xE000) {
|
|
19388
|
+
arr[arr.length] = hexTable[0xE0 | (c >> 12)]
|
|
19389
|
+
+ hexTable[0x80 | ((c >> 6) & 0x3F)]
|
|
19390
|
+
+ hexTable[0x80 | (c & 0x3F)];
|
|
19391
|
+
continue;
|
|
19392
|
+
}
|
|
19393
|
+
|
|
19394
|
+
i += 1;
|
|
19395
|
+
c = 0x10000 + (((c & 0x3FF) << 10) | (segment.charCodeAt(i) & 0x3FF));
|
|
19396
|
+
|
|
19397
|
+
arr[arr.length] = hexTable[0xF0 | (c >> 18)]
|
|
19398
|
+
+ hexTable[0x80 | ((c >> 12) & 0x3F)]
|
|
19399
|
+
+ hexTable[0x80 | ((c >> 6) & 0x3F)]
|
|
19400
|
+
+ hexTable[0x80 | (c & 0x3F)];
|
|
19375
19401
|
}
|
|
19376
19402
|
|
|
19377
|
-
|
|
19378
|
-
c = 0x10000 + (((c & 0x3FF) << 10) | (string.charCodeAt(i) & 0x3FF));
|
|
19379
|
-
/* eslint operator-linebreak: [2, "before"] */
|
|
19380
|
-
out += hexTable[0xF0 | (c >> 18)]
|
|
19381
|
-
+ hexTable[0x80 | ((c >> 12) & 0x3F)]
|
|
19382
|
-
+ hexTable[0x80 | ((c >> 6) & 0x3F)]
|
|
19383
|
-
+ hexTable[0x80 | (c & 0x3F)];
|
|
19403
|
+
out += arr.join('');
|
|
19384
19404
|
}
|
|
19385
19405
|
|
|
19386
19406
|
return out;
|
|
@@ -19460,8 +19480,8 @@ function requireStringify () {
|
|
|
19460
19480
|
hasRequiredStringify = 1;
|
|
19461
19481
|
|
|
19462
19482
|
var getSideChannel = requireSideChannel();
|
|
19463
|
-
var utils = requireUtils();
|
|
19464
|
-
var formats = requireFormats();
|
|
19483
|
+
var utils = /*@__PURE__*/ requireUtils();
|
|
19484
|
+
var formats = /*@__PURE__*/ requireFormats();
|
|
19465
19485
|
var has = Object.prototype.hasOwnProperty;
|
|
19466
19486
|
|
|
19467
19487
|
var arrayPrefixGenerators = {
|
|
@@ -19489,12 +19509,17 @@ function requireStringify () {
|
|
|
19489
19509
|
var defaults = {
|
|
19490
19510
|
addQueryPrefix: false,
|
|
19491
19511
|
allowDots: false,
|
|
19512
|
+
allowEmptyArrays: false,
|
|
19513
|
+
arrayFormat: 'indices',
|
|
19492
19514
|
charset: 'utf-8',
|
|
19493
19515
|
charsetSentinel: false,
|
|
19516
|
+
commaRoundTrip: false,
|
|
19494
19517
|
delimiter: '&',
|
|
19495
19518
|
encode: true,
|
|
19519
|
+
encodeDotInKeys: false,
|
|
19496
19520
|
encoder: utils.encode,
|
|
19497
19521
|
encodeValuesOnly: false,
|
|
19522
|
+
filter: void 0,
|
|
19498
19523
|
format: defaultFormat,
|
|
19499
19524
|
formatter: formats.formatters[defaultFormat],
|
|
19500
19525
|
// deprecated
|
|
@@ -19521,8 +19546,10 @@ function requireStringify () {
|
|
|
19521
19546
|
prefix,
|
|
19522
19547
|
generateArrayPrefix,
|
|
19523
19548
|
commaRoundTrip,
|
|
19549
|
+
allowEmptyArrays,
|
|
19524
19550
|
strictNullHandling,
|
|
19525
19551
|
skipNulls,
|
|
19552
|
+
encodeDotInKeys,
|
|
19526
19553
|
encoder,
|
|
19527
19554
|
filter,
|
|
19528
19555
|
sort,
|
|
@@ -19604,19 +19631,28 @@ function requireStringify () {
|
|
|
19604
19631
|
objKeys = sort ? keys.sort(sort) : keys;
|
|
19605
19632
|
}
|
|
19606
19633
|
|
|
19607
|
-
var
|
|
19634
|
+
var encodedPrefix = encodeDotInKeys ? String(prefix).replace(/\./g, '%2E') : String(prefix);
|
|
19635
|
+
|
|
19636
|
+
var adjustedPrefix = commaRoundTrip && isArray(obj) && obj.length === 1 ? encodedPrefix + '[]' : encodedPrefix;
|
|
19637
|
+
|
|
19638
|
+
if (allowEmptyArrays && isArray(obj) && obj.length === 0) {
|
|
19639
|
+
return adjustedPrefix + '[]';
|
|
19640
|
+
}
|
|
19608
19641
|
|
|
19609
19642
|
for (var j = 0; j < objKeys.length; ++j) {
|
|
19610
19643
|
var key = objKeys[j];
|
|
19611
|
-
var value = typeof key === 'object' && typeof key.value !== 'undefined'
|
|
19644
|
+
var value = typeof key === 'object' && key && typeof key.value !== 'undefined'
|
|
19645
|
+
? key.value
|
|
19646
|
+
: obj[key];
|
|
19612
19647
|
|
|
19613
19648
|
if (skipNulls && value === null) {
|
|
19614
19649
|
continue;
|
|
19615
19650
|
}
|
|
19616
19651
|
|
|
19652
|
+
var encodedKey = allowDots && encodeDotInKeys ? String(key).replace(/\./g, '%2E') : String(key);
|
|
19617
19653
|
var keyPrefix = isArray(obj)
|
|
19618
|
-
? typeof generateArrayPrefix === 'function' ? generateArrayPrefix(adjustedPrefix,
|
|
19619
|
-
: adjustedPrefix + (allowDots ? '.' +
|
|
19654
|
+
? typeof generateArrayPrefix === 'function' ? generateArrayPrefix(adjustedPrefix, encodedKey) : adjustedPrefix
|
|
19655
|
+
: adjustedPrefix + (allowDots ? '.' + encodedKey : '[' + encodedKey + ']');
|
|
19620
19656
|
|
|
19621
19657
|
sideChannel.set(object, step);
|
|
19622
19658
|
var valueSideChannel = getSideChannel();
|
|
@@ -19626,8 +19662,10 @@ function requireStringify () {
|
|
|
19626
19662
|
keyPrefix,
|
|
19627
19663
|
generateArrayPrefix,
|
|
19628
19664
|
commaRoundTrip,
|
|
19665
|
+
allowEmptyArrays,
|
|
19629
19666
|
strictNullHandling,
|
|
19630
19667
|
skipNulls,
|
|
19668
|
+
encodeDotInKeys,
|
|
19631
19669
|
generateArrayPrefix === 'comma' && encodeValuesOnly && isArray(obj) ? null : encoder,
|
|
19632
19670
|
filter,
|
|
19633
19671
|
sort,
|
|
@@ -19649,6 +19687,14 @@ function requireStringify () {
|
|
|
19649
19687
|
return defaults;
|
|
19650
19688
|
}
|
|
19651
19689
|
|
|
19690
|
+
if (typeof opts.allowEmptyArrays !== 'undefined' && typeof opts.allowEmptyArrays !== 'boolean') {
|
|
19691
|
+
throw new TypeError('`allowEmptyArrays` option can only be `true` or `false`, when provided');
|
|
19692
|
+
}
|
|
19693
|
+
|
|
19694
|
+
if (typeof opts.encodeDotInKeys !== 'undefined' && typeof opts.encodeDotInKeys !== 'boolean') {
|
|
19695
|
+
throw new TypeError('`encodeDotInKeys` option can only be `true` or `false`, when provided');
|
|
19696
|
+
}
|
|
19697
|
+
|
|
19652
19698
|
if (opts.encoder !== null && typeof opts.encoder !== 'undefined' && typeof opts.encoder !== 'function') {
|
|
19653
19699
|
throw new TypeError('Encoder has to be a function.');
|
|
19654
19700
|
}
|
|
@@ -19672,13 +19718,32 @@ function requireStringify () {
|
|
|
19672
19718
|
filter = opts.filter;
|
|
19673
19719
|
}
|
|
19674
19720
|
|
|
19721
|
+
var arrayFormat;
|
|
19722
|
+
if (opts.arrayFormat in arrayPrefixGenerators) {
|
|
19723
|
+
arrayFormat = opts.arrayFormat;
|
|
19724
|
+
} else if ('indices' in opts) {
|
|
19725
|
+
arrayFormat = opts.indices ? 'indices' : 'repeat';
|
|
19726
|
+
} else {
|
|
19727
|
+
arrayFormat = defaults.arrayFormat;
|
|
19728
|
+
}
|
|
19729
|
+
|
|
19730
|
+
if ('commaRoundTrip' in opts && typeof opts.commaRoundTrip !== 'boolean') {
|
|
19731
|
+
throw new TypeError('`commaRoundTrip` must be a boolean, or absent');
|
|
19732
|
+
}
|
|
19733
|
+
|
|
19734
|
+
var allowDots = typeof opts.allowDots === 'undefined' ? opts.encodeDotInKeys === true ? true : defaults.allowDots : !!opts.allowDots;
|
|
19735
|
+
|
|
19675
19736
|
return {
|
|
19676
19737
|
addQueryPrefix: typeof opts.addQueryPrefix === 'boolean' ? opts.addQueryPrefix : defaults.addQueryPrefix,
|
|
19677
|
-
allowDots:
|
|
19738
|
+
allowDots: allowDots,
|
|
19739
|
+
allowEmptyArrays: typeof opts.allowEmptyArrays === 'boolean' ? !!opts.allowEmptyArrays : defaults.allowEmptyArrays,
|
|
19740
|
+
arrayFormat: arrayFormat,
|
|
19678
19741
|
charset: charset,
|
|
19679
19742
|
charsetSentinel: typeof opts.charsetSentinel === 'boolean' ? opts.charsetSentinel : defaults.charsetSentinel,
|
|
19743
|
+
commaRoundTrip: !!opts.commaRoundTrip,
|
|
19680
19744
|
delimiter: typeof opts.delimiter === 'undefined' ? defaults.delimiter : opts.delimiter,
|
|
19681
19745
|
encode: typeof opts.encode === 'boolean' ? opts.encode : defaults.encode,
|
|
19746
|
+
encodeDotInKeys: typeof opts.encodeDotInKeys === 'boolean' ? opts.encodeDotInKeys : defaults.encodeDotInKeys,
|
|
19682
19747
|
encoder: typeof opts.encoder === 'function' ? opts.encoder : defaults.encoder,
|
|
19683
19748
|
encodeValuesOnly: typeof opts.encodeValuesOnly === 'boolean' ? opts.encodeValuesOnly : defaults.encodeValuesOnly,
|
|
19684
19749
|
filter: filter,
|
|
@@ -19712,20 +19777,8 @@ function requireStringify () {
|
|
|
19712
19777
|
return '';
|
|
19713
19778
|
}
|
|
19714
19779
|
|
|
19715
|
-
var arrayFormat;
|
|
19716
|
-
|
|
19717
|
-
arrayFormat = opts.arrayFormat;
|
|
19718
|
-
} else if (opts && 'indices' in opts) {
|
|
19719
|
-
arrayFormat = opts.indices ? 'indices' : 'repeat';
|
|
19720
|
-
} else {
|
|
19721
|
-
arrayFormat = 'indices';
|
|
19722
|
-
}
|
|
19723
|
-
|
|
19724
|
-
var generateArrayPrefix = arrayPrefixGenerators[arrayFormat];
|
|
19725
|
-
if (opts && 'commaRoundTrip' in opts && typeof opts.commaRoundTrip !== 'boolean') {
|
|
19726
|
-
throw new TypeError('`commaRoundTrip` must be a boolean, or absent');
|
|
19727
|
-
}
|
|
19728
|
-
var commaRoundTrip = generateArrayPrefix === 'comma' && opts && opts.commaRoundTrip;
|
|
19780
|
+
var generateArrayPrefix = arrayPrefixGenerators[options.arrayFormat];
|
|
19781
|
+
var commaRoundTrip = generateArrayPrefix === 'comma' && options.commaRoundTrip;
|
|
19729
19782
|
|
|
19730
19783
|
if (!objKeys) {
|
|
19731
19784
|
objKeys = Object.keys(obj);
|
|
@@ -19738,17 +19791,20 @@ function requireStringify () {
|
|
|
19738
19791
|
var sideChannel = getSideChannel();
|
|
19739
19792
|
for (var i = 0; i < objKeys.length; ++i) {
|
|
19740
19793
|
var key = objKeys[i];
|
|
19794
|
+
var value = obj[key];
|
|
19741
19795
|
|
|
19742
|
-
if (options.skipNulls &&
|
|
19796
|
+
if (options.skipNulls && value === null) {
|
|
19743
19797
|
continue;
|
|
19744
19798
|
}
|
|
19745
19799
|
pushToArray(keys, stringify(
|
|
19746
|
-
|
|
19800
|
+
value,
|
|
19747
19801
|
key,
|
|
19748
19802
|
generateArrayPrefix,
|
|
19749
19803
|
commaRoundTrip,
|
|
19804
|
+
options.allowEmptyArrays,
|
|
19750
19805
|
options.strictNullHandling,
|
|
19751
19806
|
options.skipNulls,
|
|
19807
|
+
options.encodeDotInKeys,
|
|
19752
19808
|
options.encode ? options.encoder : null,
|
|
19753
19809
|
options.filter,
|
|
19754
19810
|
options.sort,
|
|
@@ -19787,28 +19843,33 @@ function requireParse () {
|
|
|
19787
19843
|
if (hasRequiredParse) return parse;
|
|
19788
19844
|
hasRequiredParse = 1;
|
|
19789
19845
|
|
|
19790
|
-
var utils = requireUtils();
|
|
19846
|
+
var utils = /*@__PURE__*/ requireUtils();
|
|
19791
19847
|
|
|
19792
19848
|
var has = Object.prototype.hasOwnProperty;
|
|
19793
19849
|
var isArray = Array.isArray;
|
|
19794
19850
|
|
|
19795
19851
|
var defaults = {
|
|
19796
19852
|
allowDots: false,
|
|
19853
|
+
allowEmptyArrays: false,
|
|
19797
19854
|
allowPrototypes: false,
|
|
19798
19855
|
allowSparse: false,
|
|
19799
19856
|
arrayLimit: 20,
|
|
19800
19857
|
charset: 'utf-8',
|
|
19801
19858
|
charsetSentinel: false,
|
|
19802
19859
|
comma: false,
|
|
19860
|
+
decodeDotInKeys: false,
|
|
19803
19861
|
decoder: utils.decode,
|
|
19804
19862
|
delimiter: '&',
|
|
19805
19863
|
depth: 5,
|
|
19864
|
+
duplicates: 'combine',
|
|
19806
19865
|
ignoreQueryPrefix: false,
|
|
19807
19866
|
interpretNumericEntities: false,
|
|
19808
19867
|
parameterLimit: 1000,
|
|
19809
19868
|
parseArrays: true,
|
|
19810
19869
|
plainObjects: false,
|
|
19811
|
-
|
|
19870
|
+
strictDepth: false,
|
|
19871
|
+
strictNullHandling: false,
|
|
19872
|
+
throwOnLimitExceeded: false
|
|
19812
19873
|
};
|
|
19813
19874
|
|
|
19814
19875
|
var interpretNumericEntities = function (str) {
|
|
@@ -19817,11 +19878,15 @@ function requireParse () {
|
|
|
19817
19878
|
});
|
|
19818
19879
|
};
|
|
19819
19880
|
|
|
19820
|
-
var parseArrayValue = function (val, options) {
|
|
19881
|
+
var parseArrayValue = function (val, options, currentArrayLength) {
|
|
19821
19882
|
if (val && typeof val === 'string' && options.comma && val.indexOf(',') > -1) {
|
|
19822
19883
|
return val.split(',');
|
|
19823
19884
|
}
|
|
19824
19885
|
|
|
19886
|
+
if (options.throwOnLimitExceeded && currentArrayLength >= options.arrayLimit) {
|
|
19887
|
+
throw new RangeError('Array limit exceeded. Only ' + options.arrayLimit + ' element' + (options.arrayLimit === 1 ? '' : 's') + ' allowed in an array.');
|
|
19888
|
+
}
|
|
19889
|
+
|
|
19825
19890
|
return val;
|
|
19826
19891
|
};
|
|
19827
19892
|
|
|
@@ -19836,10 +19901,21 @@ function requireParse () {
|
|
|
19836
19901
|
var charsetSentinel = 'utf8=%E2%9C%93'; // encodeURIComponent('✓')
|
|
19837
19902
|
|
|
19838
19903
|
var parseValues = function parseQueryStringValues(str, options) {
|
|
19839
|
-
var obj = {};
|
|
19904
|
+
var obj = { __proto__: null };
|
|
19905
|
+
|
|
19840
19906
|
var cleanStr = options.ignoreQueryPrefix ? str.replace(/^\?/, '') : str;
|
|
19907
|
+
cleanStr = cleanStr.replace(/%5B/gi, '[').replace(/%5D/gi, ']');
|
|
19908
|
+
|
|
19841
19909
|
var limit = options.parameterLimit === Infinity ? undefined : options.parameterLimit;
|
|
19842
|
-
var parts = cleanStr.split(
|
|
19910
|
+
var parts = cleanStr.split(
|
|
19911
|
+
options.delimiter,
|
|
19912
|
+
options.throwOnLimitExceeded ? limit + 1 : limit
|
|
19913
|
+
);
|
|
19914
|
+
|
|
19915
|
+
if (options.throwOnLimitExceeded && parts.length > limit) {
|
|
19916
|
+
throw new RangeError('Parameter limit exceeded. Only ' + limit + ' parameter' + (limit === 1 ? '' : 's') + ' allowed.');
|
|
19917
|
+
}
|
|
19918
|
+
|
|
19843
19919
|
var skipIndex = -1; // Keep track of where the utf8 sentinel was found
|
|
19844
19920
|
var i;
|
|
19845
19921
|
|
|
@@ -19867,14 +19943,20 @@ function requireParse () {
|
|
|
19867
19943
|
var bracketEqualsPos = part.indexOf(']=');
|
|
19868
19944
|
var pos = bracketEqualsPos === -1 ? part.indexOf('=') : bracketEqualsPos + 1;
|
|
19869
19945
|
|
|
19870
|
-
var key
|
|
19946
|
+
var key;
|
|
19947
|
+
var val;
|
|
19871
19948
|
if (pos === -1) {
|
|
19872
19949
|
key = options.decoder(part, defaults.decoder, charset, 'key');
|
|
19873
19950
|
val = options.strictNullHandling ? null : '';
|
|
19874
19951
|
} else {
|
|
19875
19952
|
key = options.decoder(part.slice(0, pos), defaults.decoder, charset, 'key');
|
|
19953
|
+
|
|
19876
19954
|
val = utils.maybeMap(
|
|
19877
|
-
parseArrayValue(
|
|
19955
|
+
parseArrayValue(
|
|
19956
|
+
part.slice(pos + 1),
|
|
19957
|
+
options,
|
|
19958
|
+
isArray(obj[key]) ? obj[key].length : 0
|
|
19959
|
+
),
|
|
19878
19960
|
function (encodedVal) {
|
|
19879
19961
|
return options.decoder(encodedVal, defaults.decoder, charset, 'value');
|
|
19880
19962
|
}
|
|
@@ -19882,16 +19964,17 @@ function requireParse () {
|
|
|
19882
19964
|
}
|
|
19883
19965
|
|
|
19884
19966
|
if (val && options.interpretNumericEntities && charset === 'iso-8859-1') {
|
|
19885
|
-
val = interpretNumericEntities(val);
|
|
19967
|
+
val = interpretNumericEntities(String(val));
|
|
19886
19968
|
}
|
|
19887
19969
|
|
|
19888
19970
|
if (part.indexOf('[]=') > -1) {
|
|
19889
19971
|
val = isArray(val) ? [val] : val;
|
|
19890
19972
|
}
|
|
19891
19973
|
|
|
19892
|
-
|
|
19974
|
+
var existing = has.call(obj, key);
|
|
19975
|
+
if (existing && options.duplicates === 'combine') {
|
|
19893
19976
|
obj[key] = utils.combine(obj[key], val);
|
|
19894
|
-
} else {
|
|
19977
|
+
} else if (!existing || options.duplicates === 'last') {
|
|
19895
19978
|
obj[key] = val;
|
|
19896
19979
|
}
|
|
19897
19980
|
}
|
|
@@ -19900,31 +19983,40 @@ function requireParse () {
|
|
|
19900
19983
|
};
|
|
19901
19984
|
|
|
19902
19985
|
var parseObject = function (chain, val, options, valuesParsed) {
|
|
19903
|
-
var
|
|
19986
|
+
var currentArrayLength = 0;
|
|
19987
|
+
if (chain.length > 0 && chain[chain.length - 1] === '[]') {
|
|
19988
|
+
var parentKey = chain.slice(0, -1).join('');
|
|
19989
|
+
currentArrayLength = Array.isArray(val) && val[parentKey] ? val[parentKey].length : 0;
|
|
19990
|
+
}
|
|
19991
|
+
|
|
19992
|
+
var leaf = valuesParsed ? val : parseArrayValue(val, options, currentArrayLength);
|
|
19904
19993
|
|
|
19905
19994
|
for (var i = chain.length - 1; i >= 0; --i) {
|
|
19906
19995
|
var obj;
|
|
19907
19996
|
var root = chain[i];
|
|
19908
19997
|
|
|
19909
19998
|
if (root === '[]' && options.parseArrays) {
|
|
19910
|
-
obj =
|
|
19999
|
+
obj = options.allowEmptyArrays && (leaf === '' || (options.strictNullHandling && leaf === null))
|
|
20000
|
+
? []
|
|
20001
|
+
: utils.combine([], leaf);
|
|
19911
20002
|
} else {
|
|
19912
|
-
obj = options.plainObjects ?
|
|
20003
|
+
obj = options.plainObjects ? { __proto__: null } : {};
|
|
19913
20004
|
var cleanRoot = root.charAt(0) === '[' && root.charAt(root.length - 1) === ']' ? root.slice(1, -1) : root;
|
|
19914
|
-
var
|
|
19915
|
-
|
|
20005
|
+
var decodedRoot = options.decodeDotInKeys ? cleanRoot.replace(/%2E/g, '.') : cleanRoot;
|
|
20006
|
+
var index = parseInt(decodedRoot, 10);
|
|
20007
|
+
if (!options.parseArrays && decodedRoot === '') {
|
|
19916
20008
|
obj = { 0: leaf };
|
|
19917
20009
|
} else if (
|
|
19918
20010
|
!isNaN(index)
|
|
19919
|
-
&& root !==
|
|
19920
|
-
&& String(index) ===
|
|
20011
|
+
&& root !== decodedRoot
|
|
20012
|
+
&& String(index) === decodedRoot
|
|
19921
20013
|
&& index >= 0
|
|
19922
20014
|
&& (options.parseArrays && index <= options.arrayLimit)
|
|
19923
20015
|
) {
|
|
19924
20016
|
obj = [];
|
|
19925
20017
|
obj[index] = leaf;
|
|
19926
|
-
} else if (
|
|
19927
|
-
obj[
|
|
20018
|
+
} else if (decodedRoot !== '__proto__') {
|
|
20019
|
+
obj[decodedRoot] = leaf;
|
|
19928
20020
|
}
|
|
19929
20021
|
}
|
|
19930
20022
|
|
|
@@ -19979,9 +20071,12 @@ function requireParse () {
|
|
|
19979
20071
|
keys.push(segment[1]);
|
|
19980
20072
|
}
|
|
19981
20073
|
|
|
19982
|
-
// If there's a remainder, just add whatever is left
|
|
20074
|
+
// If there's a remainder, check strictDepth option for throw, else just add whatever is left
|
|
19983
20075
|
|
|
19984
20076
|
if (segment) {
|
|
20077
|
+
if (options.strictDepth === true) {
|
|
20078
|
+
throw new RangeError('Input depth exceeded depth option of ' + options.depth + ' and strictDepth is true');
|
|
20079
|
+
}
|
|
19985
20080
|
keys.push('[' + key.slice(segment.index) + ']');
|
|
19986
20081
|
}
|
|
19987
20082
|
|
|
@@ -19993,33 +20088,59 @@ function requireParse () {
|
|
|
19993
20088
|
return defaults;
|
|
19994
20089
|
}
|
|
19995
20090
|
|
|
19996
|
-
if (
|
|
20091
|
+
if (typeof opts.allowEmptyArrays !== 'undefined' && typeof opts.allowEmptyArrays !== 'boolean') {
|
|
20092
|
+
throw new TypeError('`allowEmptyArrays` option can only be `true` or `false`, when provided');
|
|
20093
|
+
}
|
|
20094
|
+
|
|
20095
|
+
if (typeof opts.decodeDotInKeys !== 'undefined' && typeof opts.decodeDotInKeys !== 'boolean') {
|
|
20096
|
+
throw new TypeError('`decodeDotInKeys` option can only be `true` or `false`, when provided');
|
|
20097
|
+
}
|
|
20098
|
+
|
|
20099
|
+
if (opts.decoder !== null && typeof opts.decoder !== 'undefined' && typeof opts.decoder !== 'function') {
|
|
19997
20100
|
throw new TypeError('Decoder has to be a function.');
|
|
19998
20101
|
}
|
|
19999
20102
|
|
|
20000
20103
|
if (typeof opts.charset !== 'undefined' && opts.charset !== 'utf-8' && opts.charset !== 'iso-8859-1') {
|
|
20001
20104
|
throw new TypeError('The charset option must be either utf-8, iso-8859-1, or undefined');
|
|
20002
20105
|
}
|
|
20106
|
+
|
|
20107
|
+
if (typeof opts.throwOnLimitExceeded !== 'undefined' && typeof opts.throwOnLimitExceeded !== 'boolean') {
|
|
20108
|
+
throw new TypeError('`throwOnLimitExceeded` option must be a boolean');
|
|
20109
|
+
}
|
|
20110
|
+
|
|
20003
20111
|
var charset = typeof opts.charset === 'undefined' ? defaults.charset : opts.charset;
|
|
20004
20112
|
|
|
20113
|
+
var duplicates = typeof opts.duplicates === 'undefined' ? defaults.duplicates : opts.duplicates;
|
|
20114
|
+
|
|
20115
|
+
if (duplicates !== 'combine' && duplicates !== 'first' && duplicates !== 'last') {
|
|
20116
|
+
throw new TypeError('The duplicates option must be either combine, first, or last');
|
|
20117
|
+
}
|
|
20118
|
+
|
|
20119
|
+
var allowDots = typeof opts.allowDots === 'undefined' ? opts.decodeDotInKeys === true ? true : defaults.allowDots : !!opts.allowDots;
|
|
20120
|
+
|
|
20005
20121
|
return {
|
|
20006
|
-
allowDots:
|
|
20122
|
+
allowDots: allowDots,
|
|
20123
|
+
allowEmptyArrays: typeof opts.allowEmptyArrays === 'boolean' ? !!opts.allowEmptyArrays : defaults.allowEmptyArrays,
|
|
20007
20124
|
allowPrototypes: typeof opts.allowPrototypes === 'boolean' ? opts.allowPrototypes : defaults.allowPrototypes,
|
|
20008
20125
|
allowSparse: typeof opts.allowSparse === 'boolean' ? opts.allowSparse : defaults.allowSparse,
|
|
20009
20126
|
arrayLimit: typeof opts.arrayLimit === 'number' ? opts.arrayLimit : defaults.arrayLimit,
|
|
20010
20127
|
charset: charset,
|
|
20011
20128
|
charsetSentinel: typeof opts.charsetSentinel === 'boolean' ? opts.charsetSentinel : defaults.charsetSentinel,
|
|
20012
20129
|
comma: typeof opts.comma === 'boolean' ? opts.comma : defaults.comma,
|
|
20130
|
+
decodeDotInKeys: typeof opts.decodeDotInKeys === 'boolean' ? opts.decodeDotInKeys : defaults.decodeDotInKeys,
|
|
20013
20131
|
decoder: typeof opts.decoder === 'function' ? opts.decoder : defaults.decoder,
|
|
20014
20132
|
delimiter: typeof opts.delimiter === 'string' || utils.isRegExp(opts.delimiter) ? opts.delimiter : defaults.delimiter,
|
|
20015
20133
|
// eslint-disable-next-line no-implicit-coercion, no-extra-parens
|
|
20016
20134
|
depth: (typeof opts.depth === 'number' || opts.depth === false) ? +opts.depth : defaults.depth,
|
|
20135
|
+
duplicates: duplicates,
|
|
20017
20136
|
ignoreQueryPrefix: opts.ignoreQueryPrefix === true,
|
|
20018
20137
|
interpretNumericEntities: typeof opts.interpretNumericEntities === 'boolean' ? opts.interpretNumericEntities : defaults.interpretNumericEntities,
|
|
20019
20138
|
parameterLimit: typeof opts.parameterLimit === 'number' ? opts.parameterLimit : defaults.parameterLimit,
|
|
20020
20139
|
parseArrays: opts.parseArrays !== false,
|
|
20021
20140
|
plainObjects: typeof opts.plainObjects === 'boolean' ? opts.plainObjects : defaults.plainObjects,
|
|
20022
|
-
|
|
20141
|
+
strictDepth: typeof opts.strictDepth === 'boolean' ? !!opts.strictDepth : defaults.strictDepth,
|
|
20142
|
+
strictNullHandling: typeof opts.strictNullHandling === 'boolean' ? opts.strictNullHandling : defaults.strictNullHandling,
|
|
20143
|
+
throwOnLimitExceeded: typeof opts.throwOnLimitExceeded === 'boolean' ? opts.throwOnLimitExceeded : false
|
|
20023
20144
|
};
|
|
20024
20145
|
};
|
|
20025
20146
|
|
|
@@ -20027,11 +20148,11 @@ function requireParse () {
|
|
|
20027
20148
|
var options = normalizeParseOptions(opts);
|
|
20028
20149
|
|
|
20029
20150
|
if (str === '' || str === null || typeof str === 'undefined') {
|
|
20030
|
-
return options.plainObjects ?
|
|
20151
|
+
return options.plainObjects ? { __proto__: null } : {};
|
|
20031
20152
|
}
|
|
20032
20153
|
|
|
20033
20154
|
var tempObj = typeof str === 'string' ? parseValues(str, options) : str;
|
|
20034
|
-
var obj = options.plainObjects ?
|
|
20155
|
+
var obj = options.plainObjects ? { __proto__: null } : {};
|
|
20035
20156
|
|
|
20036
20157
|
// Iterate over the keys and setup the new object
|
|
20037
20158
|
|
|
@@ -20058,9 +20179,9 @@ function requireLib () {
|
|
|
20058
20179
|
if (hasRequiredLib) return lib;
|
|
20059
20180
|
hasRequiredLib = 1;
|
|
20060
20181
|
|
|
20061
|
-
var stringify = requireStringify();
|
|
20062
|
-
var parse = requireParse();
|
|
20063
|
-
var formats = requireFormats();
|
|
20182
|
+
var stringify = /*@__PURE__*/ requireStringify();
|
|
20183
|
+
var parse = /*@__PURE__*/ requireParse();
|
|
20184
|
+
var formats = /*@__PURE__*/ requireFormats();
|
|
20064
20185
|
|
|
20065
20186
|
lib = {
|
|
20066
20187
|
formats: formats,
|
|
@@ -20070,7 +20191,7 @@ function requireLib () {
|
|
|
20070
20191
|
return lib;
|
|
20071
20192
|
}
|
|
20072
20193
|
|
|
20073
|
-
var libExports = requireLib();
|
|
20194
|
+
var libExports = /*@__PURE__*/ requireLib();
|
|
20074
20195
|
var qs = /*@__PURE__*/getDefaultExportFromCjs(libExports);
|
|
20075
20196
|
|
|
20076
20197
|
var src = {exports: {}};
|
|
@@ -20832,165 +20953,6 @@ function requireBrowser () {
|
|
|
20832
20953
|
|
|
20833
20954
|
var node = {exports: {}};
|
|
20834
20955
|
|
|
20835
|
-
var hasFlag;
|
|
20836
|
-
var hasRequiredHasFlag;
|
|
20837
|
-
|
|
20838
|
-
function requireHasFlag () {
|
|
20839
|
-
if (hasRequiredHasFlag) return hasFlag;
|
|
20840
|
-
hasRequiredHasFlag = 1;
|
|
20841
|
-
|
|
20842
|
-
hasFlag = (flag, argv = process.argv) => {
|
|
20843
|
-
const prefix = flag.startsWith('-') ? '' : (flag.length === 1 ? '-' : '--');
|
|
20844
|
-
const position = argv.indexOf(prefix + flag);
|
|
20845
|
-
const terminatorPosition = argv.indexOf('--');
|
|
20846
|
-
return position !== -1 && (terminatorPosition === -1 || position < terminatorPosition);
|
|
20847
|
-
};
|
|
20848
|
-
return hasFlag;
|
|
20849
|
-
}
|
|
20850
|
-
|
|
20851
|
-
var supportsColor_1;
|
|
20852
|
-
var hasRequiredSupportsColor;
|
|
20853
|
-
|
|
20854
|
-
function requireSupportsColor () {
|
|
20855
|
-
if (hasRequiredSupportsColor) return supportsColor_1;
|
|
20856
|
-
hasRequiredSupportsColor = 1;
|
|
20857
|
-
const os = require$$0$1;
|
|
20858
|
-
const tty = require$$1;
|
|
20859
|
-
const hasFlag = requireHasFlag();
|
|
20860
|
-
|
|
20861
|
-
const {env} = process;
|
|
20862
|
-
|
|
20863
|
-
let forceColor;
|
|
20864
|
-
if (hasFlag('no-color') ||
|
|
20865
|
-
hasFlag('no-colors') ||
|
|
20866
|
-
hasFlag('color=false') ||
|
|
20867
|
-
hasFlag('color=never')) {
|
|
20868
|
-
forceColor = 0;
|
|
20869
|
-
} else if (hasFlag('color') ||
|
|
20870
|
-
hasFlag('colors') ||
|
|
20871
|
-
hasFlag('color=true') ||
|
|
20872
|
-
hasFlag('color=always')) {
|
|
20873
|
-
forceColor = 1;
|
|
20874
|
-
}
|
|
20875
|
-
|
|
20876
|
-
if ('FORCE_COLOR' in env) {
|
|
20877
|
-
if (env.FORCE_COLOR === 'true') {
|
|
20878
|
-
forceColor = 1;
|
|
20879
|
-
} else if (env.FORCE_COLOR === 'false') {
|
|
20880
|
-
forceColor = 0;
|
|
20881
|
-
} else {
|
|
20882
|
-
forceColor = env.FORCE_COLOR.length === 0 ? 1 : Math.min(parseInt(env.FORCE_COLOR, 10), 3);
|
|
20883
|
-
}
|
|
20884
|
-
}
|
|
20885
|
-
|
|
20886
|
-
function translateLevel(level) {
|
|
20887
|
-
if (level === 0) {
|
|
20888
|
-
return false;
|
|
20889
|
-
}
|
|
20890
|
-
|
|
20891
|
-
return {
|
|
20892
|
-
level,
|
|
20893
|
-
hasBasic: true,
|
|
20894
|
-
has256: level >= 2,
|
|
20895
|
-
has16m: level >= 3
|
|
20896
|
-
};
|
|
20897
|
-
}
|
|
20898
|
-
|
|
20899
|
-
function supportsColor(haveStream, streamIsTTY) {
|
|
20900
|
-
if (forceColor === 0) {
|
|
20901
|
-
return 0;
|
|
20902
|
-
}
|
|
20903
|
-
|
|
20904
|
-
if (hasFlag('color=16m') ||
|
|
20905
|
-
hasFlag('color=full') ||
|
|
20906
|
-
hasFlag('color=truecolor')) {
|
|
20907
|
-
return 3;
|
|
20908
|
-
}
|
|
20909
|
-
|
|
20910
|
-
if (hasFlag('color=256')) {
|
|
20911
|
-
return 2;
|
|
20912
|
-
}
|
|
20913
|
-
|
|
20914
|
-
if (haveStream && !streamIsTTY && forceColor === undefined) {
|
|
20915
|
-
return 0;
|
|
20916
|
-
}
|
|
20917
|
-
|
|
20918
|
-
const min = forceColor || 0;
|
|
20919
|
-
|
|
20920
|
-
if (env.TERM === 'dumb') {
|
|
20921
|
-
return min;
|
|
20922
|
-
}
|
|
20923
|
-
|
|
20924
|
-
if (process.platform === 'win32') {
|
|
20925
|
-
// Windows 10 build 10586 is the first Windows release that supports 256 colors.
|
|
20926
|
-
// Windows 10 build 14931 is the first release that supports 16m/TrueColor.
|
|
20927
|
-
const osRelease = os.release().split('.');
|
|
20928
|
-
if (
|
|
20929
|
-
Number(osRelease[0]) >= 10 &&
|
|
20930
|
-
Number(osRelease[2]) >= 10586
|
|
20931
|
-
) {
|
|
20932
|
-
return Number(osRelease[2]) >= 14931 ? 3 : 2;
|
|
20933
|
-
}
|
|
20934
|
-
|
|
20935
|
-
return 1;
|
|
20936
|
-
}
|
|
20937
|
-
|
|
20938
|
-
if ('CI' in env) {
|
|
20939
|
-
if (['TRAVIS', 'CIRCLECI', 'APPVEYOR', 'GITLAB_CI', 'GITHUB_ACTIONS', 'BUILDKITE'].some(sign => sign in env) || env.CI_NAME === 'codeship') {
|
|
20940
|
-
return 1;
|
|
20941
|
-
}
|
|
20942
|
-
|
|
20943
|
-
return min;
|
|
20944
|
-
}
|
|
20945
|
-
|
|
20946
|
-
if ('TEAMCITY_VERSION' in env) {
|
|
20947
|
-
return /^(9\.(0*[1-9]\d*)\.|\d{2,}\.)/.test(env.TEAMCITY_VERSION) ? 1 : 0;
|
|
20948
|
-
}
|
|
20949
|
-
|
|
20950
|
-
if (env.COLORTERM === 'truecolor') {
|
|
20951
|
-
return 3;
|
|
20952
|
-
}
|
|
20953
|
-
|
|
20954
|
-
if ('TERM_PROGRAM' in env) {
|
|
20955
|
-
const version = parseInt((env.TERM_PROGRAM_VERSION || '').split('.')[0], 10);
|
|
20956
|
-
|
|
20957
|
-
switch (env.TERM_PROGRAM) {
|
|
20958
|
-
case 'iTerm.app':
|
|
20959
|
-
return version >= 3 ? 3 : 2;
|
|
20960
|
-
case 'Apple_Terminal':
|
|
20961
|
-
return 2;
|
|
20962
|
-
// No default
|
|
20963
|
-
}
|
|
20964
|
-
}
|
|
20965
|
-
|
|
20966
|
-
if (/-256(color)?$/i.test(env.TERM)) {
|
|
20967
|
-
return 2;
|
|
20968
|
-
}
|
|
20969
|
-
|
|
20970
|
-
if (/^screen|^xterm|^vt100|^vt220|^rxvt|color|ansi|cygwin|linux/i.test(env.TERM)) {
|
|
20971
|
-
return 1;
|
|
20972
|
-
}
|
|
20973
|
-
|
|
20974
|
-
if ('COLORTERM' in env) {
|
|
20975
|
-
return 1;
|
|
20976
|
-
}
|
|
20977
|
-
|
|
20978
|
-
return min;
|
|
20979
|
-
}
|
|
20980
|
-
|
|
20981
|
-
function getSupportLevel(stream) {
|
|
20982
|
-
const level = supportsColor(stream, stream && stream.isTTY);
|
|
20983
|
-
return translateLevel(level);
|
|
20984
|
-
}
|
|
20985
|
-
|
|
20986
|
-
supportsColor_1 = {
|
|
20987
|
-
supportsColor: getSupportLevel,
|
|
20988
|
-
stdout: translateLevel(supportsColor(true, tty.isatty(1))),
|
|
20989
|
-
stderr: translateLevel(supportsColor(true, tty.isatty(2)))
|
|
20990
|
-
};
|
|
20991
|
-
return supportsColor_1;
|
|
20992
|
-
}
|
|
20993
|
-
|
|
20994
20956
|
/**
|
|
20995
20957
|
* Module dependencies.
|
|
20996
20958
|
*/
|
|
@@ -21001,7 +20963,7 @@ function requireNode () {
|
|
|
21001
20963
|
if (hasRequiredNode) return node.exports;
|
|
21002
20964
|
hasRequiredNode = 1;
|
|
21003
20965
|
(function (module, exports) {
|
|
21004
|
-
const tty = require$$1;
|
|
20966
|
+
const tty = require$$0$1;
|
|
21005
20967
|
const util = require$$0;
|
|
21006
20968
|
|
|
21007
20969
|
/**
|
|
@@ -21028,7 +20990,7 @@ function requireNode () {
|
|
|
21028
20990
|
try {
|
|
21029
20991
|
// Optional dependency (as in, doesn't need to be installed, NOT like optionalDependencies in package.json)
|
|
21030
20992
|
// eslint-disable-next-line import/no-extraneous-dependencies
|
|
21031
|
-
const supportsColor =
|
|
20993
|
+
const supportsColor = require('supports-color');
|
|
21032
20994
|
|
|
21033
20995
|
if (supportsColor && (supportsColor.stderr || supportsColor).level >= 2) {
|
|
21034
20996
|
exports.colors = [
|
|
@@ -21447,14 +21409,34 @@ class Strapi {
|
|
|
21447
21409
|
log(data);
|
|
21448
21410
|
return data;
|
|
21449
21411
|
}
|
|
21412
|
+
mergePermissionsPreferChild(parentPermissions, childPermissions) {
|
|
21413
|
+
// Child permissions should override parent on conflicts; missing entries inherit from parent
|
|
21414
|
+
return _.merge({}, parentPermissions, childPermissions);
|
|
21415
|
+
}
|
|
21416
|
+
async fetchRolePermissions(roleId) {
|
|
21417
|
+
const response = await this.fetchData(`users-permissions/roles/${roleId}`);
|
|
21418
|
+
const parentId = typeof response.role.parent === 'number' ? response.role.parent : response.role.parent?.id;
|
|
21419
|
+
return { permissions: response.role.permissions, parentId };
|
|
21420
|
+
}
|
|
21421
|
+
async collectRolePermissions(roleId) {
|
|
21422
|
+
// Start with the immediate role's permissions, then walk up parents, merging so child overrides parent
|
|
21423
|
+
const { permissions: initialPermissions, parentId: initialParentId } = await this.fetchRolePermissions(roleId);
|
|
21424
|
+
let accumulatedPermissions = _.cloneDeep(initialPermissions);
|
|
21425
|
+
let currentParentId = initialParentId;
|
|
21426
|
+
while (currentParentId) {
|
|
21427
|
+
const { permissions: parentPermissions, parentId } = await this.fetchRolePermissions(currentParentId);
|
|
21428
|
+
accumulatedPermissions = this.mergePermissionsPreferChild(parentPermissions, accumulatedPermissions);
|
|
21429
|
+
currentParentId = parentId;
|
|
21430
|
+
}
|
|
21431
|
+
return accumulatedPermissions;
|
|
21432
|
+
}
|
|
21450
21433
|
async can(uid, controller, action) {
|
|
21451
21434
|
if (!this.permissionsList) {
|
|
21452
21435
|
const user = await this.baseMe({ populate: { role: { fields: ["id"] } } });
|
|
21453
21436
|
if (user.error) {
|
|
21454
21437
|
return false;
|
|
21455
21438
|
}
|
|
21456
|
-
|
|
21457
|
-
this.permissionsList = response.role.permissions;
|
|
21439
|
+
this.permissionsList = await this.collectRolePermissions(user.role.id);
|
|
21458
21440
|
}
|
|
21459
21441
|
if (!this.permissionsList[uid]) {
|
|
21460
21442
|
throw new Error(`Permissions for ${uid} not found!`);
|