@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.mjs
CHANGED
|
@@ -4,8 +4,8 @@ import fs__default from 'fs';
|
|
|
4
4
|
import * as path from 'path';
|
|
5
5
|
import path__default from 'path';
|
|
6
6
|
import require$$0 from 'util';
|
|
7
|
-
import require$$1 from 'tty';
|
|
8
|
-
import require$$
|
|
7
|
+
import require$$0$1 from 'tty';
|
|
8
|
+
import require$$2 from 'os';
|
|
9
9
|
import require$$3 from 'crypto';
|
|
10
10
|
|
|
11
11
|
var commonjsGlobal = typeof globalThis !== 'undefined' ? globalThis : typeof window !== 'undefined' ? window : typeof global !== 'undefined' ? global : typeof self !== 'undefined' ? self : {};
|
|
@@ -17543,13 +17543,16 @@ function requireObjectInspect () {
|
|
|
17543
17543
|
return $replace.call(String(s), /"/g, '"');
|
|
17544
17544
|
}
|
|
17545
17545
|
|
|
17546
|
-
function
|
|
17547
|
-
|
|
17548
|
-
|
|
17549
|
-
function
|
|
17550
|
-
function
|
|
17551
|
-
function
|
|
17552
|
-
function
|
|
17546
|
+
function canTrustToString(obj) {
|
|
17547
|
+
return !toStringTag || !(typeof obj === 'object' && (toStringTag in obj || typeof obj[toStringTag] !== 'undefined'));
|
|
17548
|
+
}
|
|
17549
|
+
function isArray(obj) { return toStr(obj) === '[object Array]' && canTrustToString(obj); }
|
|
17550
|
+
function isDate(obj) { return toStr(obj) === '[object Date]' && canTrustToString(obj); }
|
|
17551
|
+
function isRegExp(obj) { return toStr(obj) === '[object RegExp]' && canTrustToString(obj); }
|
|
17552
|
+
function isError(obj) { return toStr(obj) === '[object Error]' && canTrustToString(obj); }
|
|
17553
|
+
function isString(obj) { return toStr(obj) === '[object String]' && canTrustToString(obj); }
|
|
17554
|
+
function isNumber(obj) { return toStr(obj) === '[object Number]' && canTrustToString(obj); }
|
|
17555
|
+
function isBoolean(obj) { return toStr(obj) === '[object Boolean]' && canTrustToString(obj); }
|
|
17553
17556
|
|
|
17554
17557
|
// Symbol and BigInt do have Symbol.toStringTag by spec, so that can't be used to eliminate false positives
|
|
17555
17558
|
function isSymbol(obj) {
|
|
@@ -18438,7 +18441,7 @@ function requireCallBindApplyHelpers () {
|
|
|
18438
18441
|
var $call = requireFunctionCall();
|
|
18439
18442
|
var $actualApply = requireActualApply();
|
|
18440
18443
|
|
|
18441
|
-
/** @type {import('.')
|
|
18444
|
+
/** @type {(args: [Function, thisArg?: unknown, ...args: unknown[]]) => Function} TODO FIXME, find a way to use import('.') */
|
|
18442
18445
|
callBindApplyHelpers = function callBindBasic(args) {
|
|
18443
18446
|
if (args.length < 1 || typeof args[0] !== 'function') {
|
|
18444
18447
|
throw new $TypeError('a function is required');
|
|
@@ -18634,6 +18637,7 @@ function requireGetIntrinsic () {
|
|
|
18634
18637
|
'%Error%': $Error,
|
|
18635
18638
|
'%eval%': eval, // eslint-disable-line no-eval
|
|
18636
18639
|
'%EvalError%': $EvalError,
|
|
18640
|
+
'%Float16Array%': typeof Float16Array === 'undefined' ? undefined$1 : Float16Array,
|
|
18637
18641
|
'%Float32Array%': typeof Float32Array === 'undefined' ? undefined$1 : Float32Array,
|
|
18638
18642
|
'%Float64Array%': typeof Float64Array === 'undefined' ? undefined$1 : Float64Array,
|
|
18639
18643
|
'%FinalizationRegistry%': typeof FinalizationRegistry === 'undefined' ? undefined$1 : FinalizationRegistry,
|
|
@@ -18938,10 +18942,11 @@ function requireCallBound () {
|
|
|
18938
18942
|
|
|
18939
18943
|
/** @type {import('.')} */
|
|
18940
18944
|
callBound = function callBoundIntrinsic(name, allowMissing) {
|
|
18941
|
-
|
|
18942
|
-
|
|
18945
|
+
/* eslint no-extra-parens: 0 */
|
|
18946
|
+
|
|
18947
|
+
var intrinsic = /** @type {(this: unknown, ...args: unknown[]) => unknown} */ (GetIntrinsic(name, !!allowMissing));
|
|
18943
18948
|
if (typeof intrinsic === 'function' && $indexOf(name, '.prototype.') > -1) {
|
|
18944
|
-
return callBindBasic([intrinsic]);
|
|
18949
|
+
return callBindBasic(/** @type {const} */ ([intrinsic]));
|
|
18945
18950
|
}
|
|
18946
18951
|
return intrinsic;
|
|
18947
18952
|
};
|
|
@@ -19205,7 +19210,7 @@ function requireUtils () {
|
|
|
19205
19210
|
if (hasRequiredUtils) return utils;
|
|
19206
19211
|
hasRequiredUtils = 1;
|
|
19207
19212
|
|
|
19208
|
-
var formats = requireFormats();
|
|
19213
|
+
var formats = /*@__PURE__*/ requireFormats();
|
|
19209
19214
|
|
|
19210
19215
|
var has = Object.prototype.hasOwnProperty;
|
|
19211
19216
|
var isArray = Array.isArray;
|
|
@@ -19239,7 +19244,7 @@ function requireUtils () {
|
|
|
19239
19244
|
};
|
|
19240
19245
|
|
|
19241
19246
|
var arrayToObject = function arrayToObject(source, options) {
|
|
19242
|
-
var obj = options && options.plainObjects ?
|
|
19247
|
+
var obj = options && options.plainObjects ? { __proto__: null } : {};
|
|
19243
19248
|
for (var i = 0; i < source.length; ++i) {
|
|
19244
19249
|
if (typeof source[i] !== 'undefined') {
|
|
19245
19250
|
obj[i] = source[i];
|
|
@@ -19255,11 +19260,14 @@ function requireUtils () {
|
|
|
19255
19260
|
return target;
|
|
19256
19261
|
}
|
|
19257
19262
|
|
|
19258
|
-
if (typeof source !== 'object') {
|
|
19263
|
+
if (typeof source !== 'object' && typeof source !== 'function') {
|
|
19259
19264
|
if (isArray(target)) {
|
|
19260
19265
|
target.push(source);
|
|
19261
19266
|
} else if (target && typeof target === 'object') {
|
|
19262
|
-
if (
|
|
19267
|
+
if (
|
|
19268
|
+
(options && (options.plainObjects || options.allowPrototypes))
|
|
19269
|
+
|| !has.call(Object.prototype, source)
|
|
19270
|
+
) {
|
|
19263
19271
|
target[source] = true;
|
|
19264
19272
|
}
|
|
19265
19273
|
} else {
|
|
@@ -19313,7 +19321,7 @@ function requireUtils () {
|
|
|
19313
19321
|
}, target);
|
|
19314
19322
|
};
|
|
19315
19323
|
|
|
19316
|
-
var decode = function (str,
|
|
19324
|
+
var decode = function (str, defaultDecoder, charset) {
|
|
19317
19325
|
var strWithoutPlus = str.replace(/\+/g, ' ');
|
|
19318
19326
|
if (charset === 'iso-8859-1') {
|
|
19319
19327
|
// unescape never throws, no try...catch needed:
|
|
@@ -19327,6 +19335,10 @@ function requireUtils () {
|
|
|
19327
19335
|
}
|
|
19328
19336
|
};
|
|
19329
19337
|
|
|
19338
|
+
var limit = 1024;
|
|
19339
|
+
|
|
19340
|
+
/* eslint operator-linebreak: [2, "before"] */
|
|
19341
|
+
|
|
19330
19342
|
var encode = function encode(str, defaultEncoder, charset, kind, format) {
|
|
19331
19343
|
// This code was originally written by Brian White (mscdex) for the io.js core querystring library.
|
|
19332
19344
|
// It has been adapted here for stricter adherence to RFC 3986
|
|
@@ -19348,45 +19360,54 @@ function requireUtils () {
|
|
|
19348
19360
|
}
|
|
19349
19361
|
|
|
19350
19362
|
var out = '';
|
|
19351
|
-
for (var
|
|
19352
|
-
var
|
|
19353
|
-
|
|
19354
|
-
|
|
19355
|
-
|
|
19356
|
-
|
|
19357
|
-
|
|
19358
|
-
|
|
19359
|
-
|
|
19360
|
-
|
|
19361
|
-
|
|
19362
|
-
|
|
19363
|
-
|
|
19364
|
-
|
|
19365
|
-
|
|
19366
|
-
|
|
19363
|
+
for (var j = 0; j < string.length; j += limit) {
|
|
19364
|
+
var segment = string.length >= limit ? string.slice(j, j + limit) : string;
|
|
19365
|
+
var arr = [];
|
|
19366
|
+
|
|
19367
|
+
for (var i = 0; i < segment.length; ++i) {
|
|
19368
|
+
var c = segment.charCodeAt(i);
|
|
19369
|
+
if (
|
|
19370
|
+
c === 0x2D // -
|
|
19371
|
+
|| c === 0x2E // .
|
|
19372
|
+
|| c === 0x5F // _
|
|
19373
|
+
|| c === 0x7E // ~
|
|
19374
|
+
|| (c >= 0x30 && c <= 0x39) // 0-9
|
|
19375
|
+
|| (c >= 0x41 && c <= 0x5A) // a-z
|
|
19376
|
+
|| (c >= 0x61 && c <= 0x7A) // A-Z
|
|
19377
|
+
|| (format === formats.RFC1738 && (c === 0x28 || c === 0x29)) // ( )
|
|
19378
|
+
) {
|
|
19379
|
+
arr[arr.length] = segment.charAt(i);
|
|
19380
|
+
continue;
|
|
19381
|
+
}
|
|
19367
19382
|
|
|
19368
|
-
|
|
19369
|
-
|
|
19370
|
-
|
|
19371
|
-
|
|
19383
|
+
if (c < 0x80) {
|
|
19384
|
+
arr[arr.length] = hexTable[c];
|
|
19385
|
+
continue;
|
|
19386
|
+
}
|
|
19372
19387
|
|
|
19373
|
-
|
|
19374
|
-
|
|
19375
|
-
|
|
19376
|
-
|
|
19388
|
+
if (c < 0x800) {
|
|
19389
|
+
arr[arr.length] = hexTable[0xC0 | (c >> 6)]
|
|
19390
|
+
+ hexTable[0x80 | (c & 0x3F)];
|
|
19391
|
+
continue;
|
|
19392
|
+
}
|
|
19377
19393
|
|
|
19378
|
-
|
|
19379
|
-
|
|
19380
|
-
|
|
19394
|
+
if (c < 0xD800 || c >= 0xE000) {
|
|
19395
|
+
arr[arr.length] = hexTable[0xE0 | (c >> 12)]
|
|
19396
|
+
+ hexTable[0x80 | ((c >> 6) & 0x3F)]
|
|
19397
|
+
+ hexTable[0x80 | (c & 0x3F)];
|
|
19398
|
+
continue;
|
|
19399
|
+
}
|
|
19400
|
+
|
|
19401
|
+
i += 1;
|
|
19402
|
+
c = 0x10000 + (((c & 0x3FF) << 10) | (segment.charCodeAt(i) & 0x3FF));
|
|
19403
|
+
|
|
19404
|
+
arr[arr.length] = hexTable[0xF0 | (c >> 18)]
|
|
19405
|
+
+ hexTable[0x80 | ((c >> 12) & 0x3F)]
|
|
19406
|
+
+ hexTable[0x80 | ((c >> 6) & 0x3F)]
|
|
19407
|
+
+ hexTable[0x80 | (c & 0x3F)];
|
|
19381
19408
|
}
|
|
19382
19409
|
|
|
19383
|
-
|
|
19384
|
-
c = 0x10000 + (((c & 0x3FF) << 10) | (string.charCodeAt(i) & 0x3FF));
|
|
19385
|
-
/* eslint operator-linebreak: [2, "before"] */
|
|
19386
|
-
out += hexTable[0xF0 | (c >> 18)]
|
|
19387
|
-
+ hexTable[0x80 | ((c >> 12) & 0x3F)]
|
|
19388
|
-
+ hexTable[0x80 | ((c >> 6) & 0x3F)]
|
|
19389
|
-
+ hexTable[0x80 | (c & 0x3F)];
|
|
19410
|
+
out += arr.join('');
|
|
19390
19411
|
}
|
|
19391
19412
|
|
|
19392
19413
|
return out;
|
|
@@ -19466,8 +19487,8 @@ function requireStringify () {
|
|
|
19466
19487
|
hasRequiredStringify = 1;
|
|
19467
19488
|
|
|
19468
19489
|
var getSideChannel = requireSideChannel();
|
|
19469
|
-
var utils = requireUtils();
|
|
19470
|
-
var formats = requireFormats();
|
|
19490
|
+
var utils = /*@__PURE__*/ requireUtils();
|
|
19491
|
+
var formats = /*@__PURE__*/ requireFormats();
|
|
19471
19492
|
var has = Object.prototype.hasOwnProperty;
|
|
19472
19493
|
|
|
19473
19494
|
var arrayPrefixGenerators = {
|
|
@@ -19495,12 +19516,17 @@ function requireStringify () {
|
|
|
19495
19516
|
var defaults = {
|
|
19496
19517
|
addQueryPrefix: false,
|
|
19497
19518
|
allowDots: false,
|
|
19519
|
+
allowEmptyArrays: false,
|
|
19520
|
+
arrayFormat: 'indices',
|
|
19498
19521
|
charset: 'utf-8',
|
|
19499
19522
|
charsetSentinel: false,
|
|
19523
|
+
commaRoundTrip: false,
|
|
19500
19524
|
delimiter: '&',
|
|
19501
19525
|
encode: true,
|
|
19526
|
+
encodeDotInKeys: false,
|
|
19502
19527
|
encoder: utils.encode,
|
|
19503
19528
|
encodeValuesOnly: false,
|
|
19529
|
+
filter: void 0,
|
|
19504
19530
|
format: defaultFormat,
|
|
19505
19531
|
formatter: formats.formatters[defaultFormat],
|
|
19506
19532
|
// deprecated
|
|
@@ -19527,8 +19553,10 @@ function requireStringify () {
|
|
|
19527
19553
|
prefix,
|
|
19528
19554
|
generateArrayPrefix,
|
|
19529
19555
|
commaRoundTrip,
|
|
19556
|
+
allowEmptyArrays,
|
|
19530
19557
|
strictNullHandling,
|
|
19531
19558
|
skipNulls,
|
|
19559
|
+
encodeDotInKeys,
|
|
19532
19560
|
encoder,
|
|
19533
19561
|
filter,
|
|
19534
19562
|
sort,
|
|
@@ -19610,19 +19638,28 @@ function requireStringify () {
|
|
|
19610
19638
|
objKeys = sort ? keys.sort(sort) : keys;
|
|
19611
19639
|
}
|
|
19612
19640
|
|
|
19613
|
-
var
|
|
19641
|
+
var encodedPrefix = encodeDotInKeys ? String(prefix).replace(/\./g, '%2E') : String(prefix);
|
|
19642
|
+
|
|
19643
|
+
var adjustedPrefix = commaRoundTrip && isArray(obj) && obj.length === 1 ? encodedPrefix + '[]' : encodedPrefix;
|
|
19644
|
+
|
|
19645
|
+
if (allowEmptyArrays && isArray(obj) && obj.length === 0) {
|
|
19646
|
+
return adjustedPrefix + '[]';
|
|
19647
|
+
}
|
|
19614
19648
|
|
|
19615
19649
|
for (var j = 0; j < objKeys.length; ++j) {
|
|
19616
19650
|
var key = objKeys[j];
|
|
19617
|
-
var value = typeof key === 'object' && typeof key.value !== 'undefined'
|
|
19651
|
+
var value = typeof key === 'object' && key && typeof key.value !== 'undefined'
|
|
19652
|
+
? key.value
|
|
19653
|
+
: obj[key];
|
|
19618
19654
|
|
|
19619
19655
|
if (skipNulls && value === null) {
|
|
19620
19656
|
continue;
|
|
19621
19657
|
}
|
|
19622
19658
|
|
|
19659
|
+
var encodedKey = allowDots && encodeDotInKeys ? String(key).replace(/\./g, '%2E') : String(key);
|
|
19623
19660
|
var keyPrefix = isArray(obj)
|
|
19624
|
-
? typeof generateArrayPrefix === 'function' ? generateArrayPrefix(adjustedPrefix,
|
|
19625
|
-
: adjustedPrefix + (allowDots ? '.' +
|
|
19661
|
+
? typeof generateArrayPrefix === 'function' ? generateArrayPrefix(adjustedPrefix, encodedKey) : adjustedPrefix
|
|
19662
|
+
: adjustedPrefix + (allowDots ? '.' + encodedKey : '[' + encodedKey + ']');
|
|
19626
19663
|
|
|
19627
19664
|
sideChannel.set(object, step);
|
|
19628
19665
|
var valueSideChannel = getSideChannel();
|
|
@@ -19632,8 +19669,10 @@ function requireStringify () {
|
|
|
19632
19669
|
keyPrefix,
|
|
19633
19670
|
generateArrayPrefix,
|
|
19634
19671
|
commaRoundTrip,
|
|
19672
|
+
allowEmptyArrays,
|
|
19635
19673
|
strictNullHandling,
|
|
19636
19674
|
skipNulls,
|
|
19675
|
+
encodeDotInKeys,
|
|
19637
19676
|
generateArrayPrefix === 'comma' && encodeValuesOnly && isArray(obj) ? null : encoder,
|
|
19638
19677
|
filter,
|
|
19639
19678
|
sort,
|
|
@@ -19655,6 +19694,14 @@ function requireStringify () {
|
|
|
19655
19694
|
return defaults;
|
|
19656
19695
|
}
|
|
19657
19696
|
|
|
19697
|
+
if (typeof opts.allowEmptyArrays !== 'undefined' && typeof opts.allowEmptyArrays !== 'boolean') {
|
|
19698
|
+
throw new TypeError('`allowEmptyArrays` option can only be `true` or `false`, when provided');
|
|
19699
|
+
}
|
|
19700
|
+
|
|
19701
|
+
if (typeof opts.encodeDotInKeys !== 'undefined' && typeof opts.encodeDotInKeys !== 'boolean') {
|
|
19702
|
+
throw new TypeError('`encodeDotInKeys` option can only be `true` or `false`, when provided');
|
|
19703
|
+
}
|
|
19704
|
+
|
|
19658
19705
|
if (opts.encoder !== null && typeof opts.encoder !== 'undefined' && typeof opts.encoder !== 'function') {
|
|
19659
19706
|
throw new TypeError('Encoder has to be a function.');
|
|
19660
19707
|
}
|
|
@@ -19678,13 +19725,32 @@ function requireStringify () {
|
|
|
19678
19725
|
filter = opts.filter;
|
|
19679
19726
|
}
|
|
19680
19727
|
|
|
19728
|
+
var arrayFormat;
|
|
19729
|
+
if (opts.arrayFormat in arrayPrefixGenerators) {
|
|
19730
|
+
arrayFormat = opts.arrayFormat;
|
|
19731
|
+
} else if ('indices' in opts) {
|
|
19732
|
+
arrayFormat = opts.indices ? 'indices' : 'repeat';
|
|
19733
|
+
} else {
|
|
19734
|
+
arrayFormat = defaults.arrayFormat;
|
|
19735
|
+
}
|
|
19736
|
+
|
|
19737
|
+
if ('commaRoundTrip' in opts && typeof opts.commaRoundTrip !== 'boolean') {
|
|
19738
|
+
throw new TypeError('`commaRoundTrip` must be a boolean, or absent');
|
|
19739
|
+
}
|
|
19740
|
+
|
|
19741
|
+
var allowDots = typeof opts.allowDots === 'undefined' ? opts.encodeDotInKeys === true ? true : defaults.allowDots : !!opts.allowDots;
|
|
19742
|
+
|
|
19681
19743
|
return {
|
|
19682
19744
|
addQueryPrefix: typeof opts.addQueryPrefix === 'boolean' ? opts.addQueryPrefix : defaults.addQueryPrefix,
|
|
19683
|
-
allowDots:
|
|
19745
|
+
allowDots: allowDots,
|
|
19746
|
+
allowEmptyArrays: typeof opts.allowEmptyArrays === 'boolean' ? !!opts.allowEmptyArrays : defaults.allowEmptyArrays,
|
|
19747
|
+
arrayFormat: arrayFormat,
|
|
19684
19748
|
charset: charset,
|
|
19685
19749
|
charsetSentinel: typeof opts.charsetSentinel === 'boolean' ? opts.charsetSentinel : defaults.charsetSentinel,
|
|
19750
|
+
commaRoundTrip: !!opts.commaRoundTrip,
|
|
19686
19751
|
delimiter: typeof opts.delimiter === 'undefined' ? defaults.delimiter : opts.delimiter,
|
|
19687
19752
|
encode: typeof opts.encode === 'boolean' ? opts.encode : defaults.encode,
|
|
19753
|
+
encodeDotInKeys: typeof opts.encodeDotInKeys === 'boolean' ? opts.encodeDotInKeys : defaults.encodeDotInKeys,
|
|
19688
19754
|
encoder: typeof opts.encoder === 'function' ? opts.encoder : defaults.encoder,
|
|
19689
19755
|
encodeValuesOnly: typeof opts.encodeValuesOnly === 'boolean' ? opts.encodeValuesOnly : defaults.encodeValuesOnly,
|
|
19690
19756
|
filter: filter,
|
|
@@ -19718,20 +19784,8 @@ function requireStringify () {
|
|
|
19718
19784
|
return '';
|
|
19719
19785
|
}
|
|
19720
19786
|
|
|
19721
|
-
var arrayFormat;
|
|
19722
|
-
|
|
19723
|
-
arrayFormat = opts.arrayFormat;
|
|
19724
|
-
} else if (opts && 'indices' in opts) {
|
|
19725
|
-
arrayFormat = opts.indices ? 'indices' : 'repeat';
|
|
19726
|
-
} else {
|
|
19727
|
-
arrayFormat = 'indices';
|
|
19728
|
-
}
|
|
19729
|
-
|
|
19730
|
-
var generateArrayPrefix = arrayPrefixGenerators[arrayFormat];
|
|
19731
|
-
if (opts && 'commaRoundTrip' in opts && typeof opts.commaRoundTrip !== 'boolean') {
|
|
19732
|
-
throw new TypeError('`commaRoundTrip` must be a boolean, or absent');
|
|
19733
|
-
}
|
|
19734
|
-
var commaRoundTrip = generateArrayPrefix === 'comma' && opts && opts.commaRoundTrip;
|
|
19787
|
+
var generateArrayPrefix = arrayPrefixGenerators[options.arrayFormat];
|
|
19788
|
+
var commaRoundTrip = generateArrayPrefix === 'comma' && options.commaRoundTrip;
|
|
19735
19789
|
|
|
19736
19790
|
if (!objKeys) {
|
|
19737
19791
|
objKeys = Object.keys(obj);
|
|
@@ -19744,17 +19798,20 @@ function requireStringify () {
|
|
|
19744
19798
|
var sideChannel = getSideChannel();
|
|
19745
19799
|
for (var i = 0; i < objKeys.length; ++i) {
|
|
19746
19800
|
var key = objKeys[i];
|
|
19801
|
+
var value = obj[key];
|
|
19747
19802
|
|
|
19748
|
-
if (options.skipNulls &&
|
|
19803
|
+
if (options.skipNulls && value === null) {
|
|
19749
19804
|
continue;
|
|
19750
19805
|
}
|
|
19751
19806
|
pushToArray(keys, stringify(
|
|
19752
|
-
|
|
19807
|
+
value,
|
|
19753
19808
|
key,
|
|
19754
19809
|
generateArrayPrefix,
|
|
19755
19810
|
commaRoundTrip,
|
|
19811
|
+
options.allowEmptyArrays,
|
|
19756
19812
|
options.strictNullHandling,
|
|
19757
19813
|
options.skipNulls,
|
|
19814
|
+
options.encodeDotInKeys,
|
|
19758
19815
|
options.encode ? options.encoder : null,
|
|
19759
19816
|
options.filter,
|
|
19760
19817
|
options.sort,
|
|
@@ -19793,28 +19850,33 @@ function requireParse () {
|
|
|
19793
19850
|
if (hasRequiredParse) return parse;
|
|
19794
19851
|
hasRequiredParse = 1;
|
|
19795
19852
|
|
|
19796
|
-
var utils = requireUtils();
|
|
19853
|
+
var utils = /*@__PURE__*/ requireUtils();
|
|
19797
19854
|
|
|
19798
19855
|
var has = Object.prototype.hasOwnProperty;
|
|
19799
19856
|
var isArray = Array.isArray;
|
|
19800
19857
|
|
|
19801
19858
|
var defaults = {
|
|
19802
19859
|
allowDots: false,
|
|
19860
|
+
allowEmptyArrays: false,
|
|
19803
19861
|
allowPrototypes: false,
|
|
19804
19862
|
allowSparse: false,
|
|
19805
19863
|
arrayLimit: 20,
|
|
19806
19864
|
charset: 'utf-8',
|
|
19807
19865
|
charsetSentinel: false,
|
|
19808
19866
|
comma: false,
|
|
19867
|
+
decodeDotInKeys: false,
|
|
19809
19868
|
decoder: utils.decode,
|
|
19810
19869
|
delimiter: '&',
|
|
19811
19870
|
depth: 5,
|
|
19871
|
+
duplicates: 'combine',
|
|
19812
19872
|
ignoreQueryPrefix: false,
|
|
19813
19873
|
interpretNumericEntities: false,
|
|
19814
19874
|
parameterLimit: 1000,
|
|
19815
19875
|
parseArrays: true,
|
|
19816
19876
|
plainObjects: false,
|
|
19817
|
-
|
|
19877
|
+
strictDepth: false,
|
|
19878
|
+
strictNullHandling: false,
|
|
19879
|
+
throwOnLimitExceeded: false
|
|
19818
19880
|
};
|
|
19819
19881
|
|
|
19820
19882
|
var interpretNumericEntities = function (str) {
|
|
@@ -19823,11 +19885,15 @@ function requireParse () {
|
|
|
19823
19885
|
});
|
|
19824
19886
|
};
|
|
19825
19887
|
|
|
19826
|
-
var parseArrayValue = function (val, options) {
|
|
19888
|
+
var parseArrayValue = function (val, options, currentArrayLength) {
|
|
19827
19889
|
if (val && typeof val === 'string' && options.comma && val.indexOf(',') > -1) {
|
|
19828
19890
|
return val.split(',');
|
|
19829
19891
|
}
|
|
19830
19892
|
|
|
19893
|
+
if (options.throwOnLimitExceeded && currentArrayLength >= options.arrayLimit) {
|
|
19894
|
+
throw new RangeError('Array limit exceeded. Only ' + options.arrayLimit + ' element' + (options.arrayLimit === 1 ? '' : 's') + ' allowed in an array.');
|
|
19895
|
+
}
|
|
19896
|
+
|
|
19831
19897
|
return val;
|
|
19832
19898
|
};
|
|
19833
19899
|
|
|
@@ -19842,10 +19908,21 @@ function requireParse () {
|
|
|
19842
19908
|
var charsetSentinel = 'utf8=%E2%9C%93'; // encodeURIComponent('✓')
|
|
19843
19909
|
|
|
19844
19910
|
var parseValues = function parseQueryStringValues(str, options) {
|
|
19845
|
-
var obj = {};
|
|
19911
|
+
var obj = { __proto__: null };
|
|
19912
|
+
|
|
19846
19913
|
var cleanStr = options.ignoreQueryPrefix ? str.replace(/^\?/, '') : str;
|
|
19914
|
+
cleanStr = cleanStr.replace(/%5B/gi, '[').replace(/%5D/gi, ']');
|
|
19915
|
+
|
|
19847
19916
|
var limit = options.parameterLimit === Infinity ? undefined : options.parameterLimit;
|
|
19848
|
-
var parts = cleanStr.split(
|
|
19917
|
+
var parts = cleanStr.split(
|
|
19918
|
+
options.delimiter,
|
|
19919
|
+
options.throwOnLimitExceeded ? limit + 1 : limit
|
|
19920
|
+
);
|
|
19921
|
+
|
|
19922
|
+
if (options.throwOnLimitExceeded && parts.length > limit) {
|
|
19923
|
+
throw new RangeError('Parameter limit exceeded. Only ' + limit + ' parameter' + (limit === 1 ? '' : 's') + ' allowed.');
|
|
19924
|
+
}
|
|
19925
|
+
|
|
19849
19926
|
var skipIndex = -1; // Keep track of where the utf8 sentinel was found
|
|
19850
19927
|
var i;
|
|
19851
19928
|
|
|
@@ -19873,14 +19950,20 @@ function requireParse () {
|
|
|
19873
19950
|
var bracketEqualsPos = part.indexOf(']=');
|
|
19874
19951
|
var pos = bracketEqualsPos === -1 ? part.indexOf('=') : bracketEqualsPos + 1;
|
|
19875
19952
|
|
|
19876
|
-
var key
|
|
19953
|
+
var key;
|
|
19954
|
+
var val;
|
|
19877
19955
|
if (pos === -1) {
|
|
19878
19956
|
key = options.decoder(part, defaults.decoder, charset, 'key');
|
|
19879
19957
|
val = options.strictNullHandling ? null : '';
|
|
19880
19958
|
} else {
|
|
19881
19959
|
key = options.decoder(part.slice(0, pos), defaults.decoder, charset, 'key');
|
|
19960
|
+
|
|
19882
19961
|
val = utils.maybeMap(
|
|
19883
|
-
parseArrayValue(
|
|
19962
|
+
parseArrayValue(
|
|
19963
|
+
part.slice(pos + 1),
|
|
19964
|
+
options,
|
|
19965
|
+
isArray(obj[key]) ? obj[key].length : 0
|
|
19966
|
+
),
|
|
19884
19967
|
function (encodedVal) {
|
|
19885
19968
|
return options.decoder(encodedVal, defaults.decoder, charset, 'value');
|
|
19886
19969
|
}
|
|
@@ -19888,16 +19971,17 @@ function requireParse () {
|
|
|
19888
19971
|
}
|
|
19889
19972
|
|
|
19890
19973
|
if (val && options.interpretNumericEntities && charset === 'iso-8859-1') {
|
|
19891
|
-
val = interpretNumericEntities(val);
|
|
19974
|
+
val = interpretNumericEntities(String(val));
|
|
19892
19975
|
}
|
|
19893
19976
|
|
|
19894
19977
|
if (part.indexOf('[]=') > -1) {
|
|
19895
19978
|
val = isArray(val) ? [val] : val;
|
|
19896
19979
|
}
|
|
19897
19980
|
|
|
19898
|
-
|
|
19981
|
+
var existing = has.call(obj, key);
|
|
19982
|
+
if (existing && options.duplicates === 'combine') {
|
|
19899
19983
|
obj[key] = utils.combine(obj[key], val);
|
|
19900
|
-
} else {
|
|
19984
|
+
} else if (!existing || options.duplicates === 'last') {
|
|
19901
19985
|
obj[key] = val;
|
|
19902
19986
|
}
|
|
19903
19987
|
}
|
|
@@ -19906,31 +19990,40 @@ function requireParse () {
|
|
|
19906
19990
|
};
|
|
19907
19991
|
|
|
19908
19992
|
var parseObject = function (chain, val, options, valuesParsed) {
|
|
19909
|
-
var
|
|
19993
|
+
var currentArrayLength = 0;
|
|
19994
|
+
if (chain.length > 0 && chain[chain.length - 1] === '[]') {
|
|
19995
|
+
var parentKey = chain.slice(0, -1).join('');
|
|
19996
|
+
currentArrayLength = Array.isArray(val) && val[parentKey] ? val[parentKey].length : 0;
|
|
19997
|
+
}
|
|
19998
|
+
|
|
19999
|
+
var leaf = valuesParsed ? val : parseArrayValue(val, options, currentArrayLength);
|
|
19910
20000
|
|
|
19911
20001
|
for (var i = chain.length - 1; i >= 0; --i) {
|
|
19912
20002
|
var obj;
|
|
19913
20003
|
var root = chain[i];
|
|
19914
20004
|
|
|
19915
20005
|
if (root === '[]' && options.parseArrays) {
|
|
19916
|
-
obj =
|
|
20006
|
+
obj = options.allowEmptyArrays && (leaf === '' || (options.strictNullHandling && leaf === null))
|
|
20007
|
+
? []
|
|
20008
|
+
: utils.combine([], leaf);
|
|
19917
20009
|
} else {
|
|
19918
|
-
obj = options.plainObjects ?
|
|
20010
|
+
obj = options.plainObjects ? { __proto__: null } : {};
|
|
19919
20011
|
var cleanRoot = root.charAt(0) === '[' && root.charAt(root.length - 1) === ']' ? root.slice(1, -1) : root;
|
|
19920
|
-
var
|
|
19921
|
-
|
|
20012
|
+
var decodedRoot = options.decodeDotInKeys ? cleanRoot.replace(/%2E/g, '.') : cleanRoot;
|
|
20013
|
+
var index = parseInt(decodedRoot, 10);
|
|
20014
|
+
if (!options.parseArrays && decodedRoot === '') {
|
|
19922
20015
|
obj = { 0: leaf };
|
|
19923
20016
|
} else if (
|
|
19924
20017
|
!isNaN(index)
|
|
19925
|
-
&& root !==
|
|
19926
|
-
&& String(index) ===
|
|
20018
|
+
&& root !== decodedRoot
|
|
20019
|
+
&& String(index) === decodedRoot
|
|
19927
20020
|
&& index >= 0
|
|
19928
20021
|
&& (options.parseArrays && index <= options.arrayLimit)
|
|
19929
20022
|
) {
|
|
19930
20023
|
obj = [];
|
|
19931
20024
|
obj[index] = leaf;
|
|
19932
|
-
} else if (
|
|
19933
|
-
obj[
|
|
20025
|
+
} else if (decodedRoot !== '__proto__') {
|
|
20026
|
+
obj[decodedRoot] = leaf;
|
|
19934
20027
|
}
|
|
19935
20028
|
}
|
|
19936
20029
|
|
|
@@ -19985,9 +20078,12 @@ function requireParse () {
|
|
|
19985
20078
|
keys.push(segment[1]);
|
|
19986
20079
|
}
|
|
19987
20080
|
|
|
19988
|
-
// If there's a remainder, just add whatever is left
|
|
20081
|
+
// If there's a remainder, check strictDepth option for throw, else just add whatever is left
|
|
19989
20082
|
|
|
19990
20083
|
if (segment) {
|
|
20084
|
+
if (options.strictDepth === true) {
|
|
20085
|
+
throw new RangeError('Input depth exceeded depth option of ' + options.depth + ' and strictDepth is true');
|
|
20086
|
+
}
|
|
19991
20087
|
keys.push('[' + key.slice(segment.index) + ']');
|
|
19992
20088
|
}
|
|
19993
20089
|
|
|
@@ -19999,33 +20095,59 @@ function requireParse () {
|
|
|
19999
20095
|
return defaults;
|
|
20000
20096
|
}
|
|
20001
20097
|
|
|
20002
|
-
if (
|
|
20098
|
+
if (typeof opts.allowEmptyArrays !== 'undefined' && typeof opts.allowEmptyArrays !== 'boolean') {
|
|
20099
|
+
throw new TypeError('`allowEmptyArrays` option can only be `true` or `false`, when provided');
|
|
20100
|
+
}
|
|
20101
|
+
|
|
20102
|
+
if (typeof opts.decodeDotInKeys !== 'undefined' && typeof opts.decodeDotInKeys !== 'boolean') {
|
|
20103
|
+
throw new TypeError('`decodeDotInKeys` option can only be `true` or `false`, when provided');
|
|
20104
|
+
}
|
|
20105
|
+
|
|
20106
|
+
if (opts.decoder !== null && typeof opts.decoder !== 'undefined' && typeof opts.decoder !== 'function') {
|
|
20003
20107
|
throw new TypeError('Decoder has to be a function.');
|
|
20004
20108
|
}
|
|
20005
20109
|
|
|
20006
20110
|
if (typeof opts.charset !== 'undefined' && opts.charset !== 'utf-8' && opts.charset !== 'iso-8859-1') {
|
|
20007
20111
|
throw new TypeError('The charset option must be either utf-8, iso-8859-1, or undefined');
|
|
20008
20112
|
}
|
|
20113
|
+
|
|
20114
|
+
if (typeof opts.throwOnLimitExceeded !== 'undefined' && typeof opts.throwOnLimitExceeded !== 'boolean') {
|
|
20115
|
+
throw new TypeError('`throwOnLimitExceeded` option must be a boolean');
|
|
20116
|
+
}
|
|
20117
|
+
|
|
20009
20118
|
var charset = typeof opts.charset === 'undefined' ? defaults.charset : opts.charset;
|
|
20010
20119
|
|
|
20120
|
+
var duplicates = typeof opts.duplicates === 'undefined' ? defaults.duplicates : opts.duplicates;
|
|
20121
|
+
|
|
20122
|
+
if (duplicates !== 'combine' && duplicates !== 'first' && duplicates !== 'last') {
|
|
20123
|
+
throw new TypeError('The duplicates option must be either combine, first, or last');
|
|
20124
|
+
}
|
|
20125
|
+
|
|
20126
|
+
var allowDots = typeof opts.allowDots === 'undefined' ? opts.decodeDotInKeys === true ? true : defaults.allowDots : !!opts.allowDots;
|
|
20127
|
+
|
|
20011
20128
|
return {
|
|
20012
|
-
allowDots:
|
|
20129
|
+
allowDots: allowDots,
|
|
20130
|
+
allowEmptyArrays: typeof opts.allowEmptyArrays === 'boolean' ? !!opts.allowEmptyArrays : defaults.allowEmptyArrays,
|
|
20013
20131
|
allowPrototypes: typeof opts.allowPrototypes === 'boolean' ? opts.allowPrototypes : defaults.allowPrototypes,
|
|
20014
20132
|
allowSparse: typeof opts.allowSparse === 'boolean' ? opts.allowSparse : defaults.allowSparse,
|
|
20015
20133
|
arrayLimit: typeof opts.arrayLimit === 'number' ? opts.arrayLimit : defaults.arrayLimit,
|
|
20016
20134
|
charset: charset,
|
|
20017
20135
|
charsetSentinel: typeof opts.charsetSentinel === 'boolean' ? opts.charsetSentinel : defaults.charsetSentinel,
|
|
20018
20136
|
comma: typeof opts.comma === 'boolean' ? opts.comma : defaults.comma,
|
|
20137
|
+
decodeDotInKeys: typeof opts.decodeDotInKeys === 'boolean' ? opts.decodeDotInKeys : defaults.decodeDotInKeys,
|
|
20019
20138
|
decoder: typeof opts.decoder === 'function' ? opts.decoder : defaults.decoder,
|
|
20020
20139
|
delimiter: typeof opts.delimiter === 'string' || utils.isRegExp(opts.delimiter) ? opts.delimiter : defaults.delimiter,
|
|
20021
20140
|
// eslint-disable-next-line no-implicit-coercion, no-extra-parens
|
|
20022
20141
|
depth: (typeof opts.depth === 'number' || opts.depth === false) ? +opts.depth : defaults.depth,
|
|
20142
|
+
duplicates: duplicates,
|
|
20023
20143
|
ignoreQueryPrefix: opts.ignoreQueryPrefix === true,
|
|
20024
20144
|
interpretNumericEntities: typeof opts.interpretNumericEntities === 'boolean' ? opts.interpretNumericEntities : defaults.interpretNumericEntities,
|
|
20025
20145
|
parameterLimit: typeof opts.parameterLimit === 'number' ? opts.parameterLimit : defaults.parameterLimit,
|
|
20026
20146
|
parseArrays: opts.parseArrays !== false,
|
|
20027
20147
|
plainObjects: typeof opts.plainObjects === 'boolean' ? opts.plainObjects : defaults.plainObjects,
|
|
20028
|
-
|
|
20148
|
+
strictDepth: typeof opts.strictDepth === 'boolean' ? !!opts.strictDepth : defaults.strictDepth,
|
|
20149
|
+
strictNullHandling: typeof opts.strictNullHandling === 'boolean' ? opts.strictNullHandling : defaults.strictNullHandling,
|
|
20150
|
+
throwOnLimitExceeded: typeof opts.throwOnLimitExceeded === 'boolean' ? opts.throwOnLimitExceeded : false
|
|
20029
20151
|
};
|
|
20030
20152
|
};
|
|
20031
20153
|
|
|
@@ -20033,11 +20155,11 @@ function requireParse () {
|
|
|
20033
20155
|
var options = normalizeParseOptions(opts);
|
|
20034
20156
|
|
|
20035
20157
|
if (str === '' || str === null || typeof str === 'undefined') {
|
|
20036
|
-
return options.plainObjects ?
|
|
20158
|
+
return options.plainObjects ? { __proto__: null } : {};
|
|
20037
20159
|
}
|
|
20038
20160
|
|
|
20039
20161
|
var tempObj = typeof str === 'string' ? parseValues(str, options) : str;
|
|
20040
|
-
var obj = options.plainObjects ?
|
|
20162
|
+
var obj = options.plainObjects ? { __proto__: null } : {};
|
|
20041
20163
|
|
|
20042
20164
|
// Iterate over the keys and setup the new object
|
|
20043
20165
|
|
|
@@ -20064,9 +20186,9 @@ function requireLib () {
|
|
|
20064
20186
|
if (hasRequiredLib) return lib;
|
|
20065
20187
|
hasRequiredLib = 1;
|
|
20066
20188
|
|
|
20067
|
-
var stringify = requireStringify();
|
|
20068
|
-
var parse = requireParse();
|
|
20069
|
-
var formats = requireFormats();
|
|
20189
|
+
var stringify = /*@__PURE__*/ requireStringify();
|
|
20190
|
+
var parse = /*@__PURE__*/ requireParse();
|
|
20191
|
+
var formats = /*@__PURE__*/ requireFormats();
|
|
20070
20192
|
|
|
20071
20193
|
lib = {
|
|
20072
20194
|
formats: formats,
|
|
@@ -20076,7 +20198,7 @@ function requireLib () {
|
|
|
20076
20198
|
return lib;
|
|
20077
20199
|
}
|
|
20078
20200
|
|
|
20079
|
-
var libExports = requireLib();
|
|
20201
|
+
var libExports = /*@__PURE__*/ requireLib();
|
|
20080
20202
|
var qs = /*@__PURE__*/getDefaultExportFromCjs(libExports);
|
|
20081
20203
|
|
|
20082
20204
|
var src = {exports: {}};
|
|
@@ -20838,165 +20960,6 @@ function requireBrowser () {
|
|
|
20838
20960
|
|
|
20839
20961
|
var node = {exports: {}};
|
|
20840
20962
|
|
|
20841
|
-
var hasFlag;
|
|
20842
|
-
var hasRequiredHasFlag;
|
|
20843
|
-
|
|
20844
|
-
function requireHasFlag () {
|
|
20845
|
-
if (hasRequiredHasFlag) return hasFlag;
|
|
20846
|
-
hasRequiredHasFlag = 1;
|
|
20847
|
-
|
|
20848
|
-
hasFlag = (flag, argv = process.argv) => {
|
|
20849
|
-
const prefix = flag.startsWith('-') ? '' : (flag.length === 1 ? '-' : '--');
|
|
20850
|
-
const position = argv.indexOf(prefix + flag);
|
|
20851
|
-
const terminatorPosition = argv.indexOf('--');
|
|
20852
|
-
return position !== -1 && (terminatorPosition === -1 || position < terminatorPosition);
|
|
20853
|
-
};
|
|
20854
|
-
return hasFlag;
|
|
20855
|
-
}
|
|
20856
|
-
|
|
20857
|
-
var supportsColor_1;
|
|
20858
|
-
var hasRequiredSupportsColor;
|
|
20859
|
-
|
|
20860
|
-
function requireSupportsColor () {
|
|
20861
|
-
if (hasRequiredSupportsColor) return supportsColor_1;
|
|
20862
|
-
hasRequiredSupportsColor = 1;
|
|
20863
|
-
const os = require$$0$1;
|
|
20864
|
-
const tty = require$$1;
|
|
20865
|
-
const hasFlag = requireHasFlag();
|
|
20866
|
-
|
|
20867
|
-
const {env} = process;
|
|
20868
|
-
|
|
20869
|
-
let forceColor;
|
|
20870
|
-
if (hasFlag('no-color') ||
|
|
20871
|
-
hasFlag('no-colors') ||
|
|
20872
|
-
hasFlag('color=false') ||
|
|
20873
|
-
hasFlag('color=never')) {
|
|
20874
|
-
forceColor = 0;
|
|
20875
|
-
} else if (hasFlag('color') ||
|
|
20876
|
-
hasFlag('colors') ||
|
|
20877
|
-
hasFlag('color=true') ||
|
|
20878
|
-
hasFlag('color=always')) {
|
|
20879
|
-
forceColor = 1;
|
|
20880
|
-
}
|
|
20881
|
-
|
|
20882
|
-
if ('FORCE_COLOR' in env) {
|
|
20883
|
-
if (env.FORCE_COLOR === 'true') {
|
|
20884
|
-
forceColor = 1;
|
|
20885
|
-
} else if (env.FORCE_COLOR === 'false') {
|
|
20886
|
-
forceColor = 0;
|
|
20887
|
-
} else {
|
|
20888
|
-
forceColor = env.FORCE_COLOR.length === 0 ? 1 : Math.min(parseInt(env.FORCE_COLOR, 10), 3);
|
|
20889
|
-
}
|
|
20890
|
-
}
|
|
20891
|
-
|
|
20892
|
-
function translateLevel(level) {
|
|
20893
|
-
if (level === 0) {
|
|
20894
|
-
return false;
|
|
20895
|
-
}
|
|
20896
|
-
|
|
20897
|
-
return {
|
|
20898
|
-
level,
|
|
20899
|
-
hasBasic: true,
|
|
20900
|
-
has256: level >= 2,
|
|
20901
|
-
has16m: level >= 3
|
|
20902
|
-
};
|
|
20903
|
-
}
|
|
20904
|
-
|
|
20905
|
-
function supportsColor(haveStream, streamIsTTY) {
|
|
20906
|
-
if (forceColor === 0) {
|
|
20907
|
-
return 0;
|
|
20908
|
-
}
|
|
20909
|
-
|
|
20910
|
-
if (hasFlag('color=16m') ||
|
|
20911
|
-
hasFlag('color=full') ||
|
|
20912
|
-
hasFlag('color=truecolor')) {
|
|
20913
|
-
return 3;
|
|
20914
|
-
}
|
|
20915
|
-
|
|
20916
|
-
if (hasFlag('color=256')) {
|
|
20917
|
-
return 2;
|
|
20918
|
-
}
|
|
20919
|
-
|
|
20920
|
-
if (haveStream && !streamIsTTY && forceColor === undefined) {
|
|
20921
|
-
return 0;
|
|
20922
|
-
}
|
|
20923
|
-
|
|
20924
|
-
const min = forceColor || 0;
|
|
20925
|
-
|
|
20926
|
-
if (env.TERM === 'dumb') {
|
|
20927
|
-
return min;
|
|
20928
|
-
}
|
|
20929
|
-
|
|
20930
|
-
if (process.platform === 'win32') {
|
|
20931
|
-
// Windows 10 build 10586 is the first Windows release that supports 256 colors.
|
|
20932
|
-
// Windows 10 build 14931 is the first release that supports 16m/TrueColor.
|
|
20933
|
-
const osRelease = os.release().split('.');
|
|
20934
|
-
if (
|
|
20935
|
-
Number(osRelease[0]) >= 10 &&
|
|
20936
|
-
Number(osRelease[2]) >= 10586
|
|
20937
|
-
) {
|
|
20938
|
-
return Number(osRelease[2]) >= 14931 ? 3 : 2;
|
|
20939
|
-
}
|
|
20940
|
-
|
|
20941
|
-
return 1;
|
|
20942
|
-
}
|
|
20943
|
-
|
|
20944
|
-
if ('CI' in env) {
|
|
20945
|
-
if (['TRAVIS', 'CIRCLECI', 'APPVEYOR', 'GITLAB_CI', 'GITHUB_ACTIONS', 'BUILDKITE'].some(sign => sign in env) || env.CI_NAME === 'codeship') {
|
|
20946
|
-
return 1;
|
|
20947
|
-
}
|
|
20948
|
-
|
|
20949
|
-
return min;
|
|
20950
|
-
}
|
|
20951
|
-
|
|
20952
|
-
if ('TEAMCITY_VERSION' in env) {
|
|
20953
|
-
return /^(9\.(0*[1-9]\d*)\.|\d{2,}\.)/.test(env.TEAMCITY_VERSION) ? 1 : 0;
|
|
20954
|
-
}
|
|
20955
|
-
|
|
20956
|
-
if (env.COLORTERM === 'truecolor') {
|
|
20957
|
-
return 3;
|
|
20958
|
-
}
|
|
20959
|
-
|
|
20960
|
-
if ('TERM_PROGRAM' in env) {
|
|
20961
|
-
const version = parseInt((env.TERM_PROGRAM_VERSION || '').split('.')[0], 10);
|
|
20962
|
-
|
|
20963
|
-
switch (env.TERM_PROGRAM) {
|
|
20964
|
-
case 'iTerm.app':
|
|
20965
|
-
return version >= 3 ? 3 : 2;
|
|
20966
|
-
case 'Apple_Terminal':
|
|
20967
|
-
return 2;
|
|
20968
|
-
// No default
|
|
20969
|
-
}
|
|
20970
|
-
}
|
|
20971
|
-
|
|
20972
|
-
if (/-256(color)?$/i.test(env.TERM)) {
|
|
20973
|
-
return 2;
|
|
20974
|
-
}
|
|
20975
|
-
|
|
20976
|
-
if (/^screen|^xterm|^vt100|^vt220|^rxvt|color|ansi|cygwin|linux/i.test(env.TERM)) {
|
|
20977
|
-
return 1;
|
|
20978
|
-
}
|
|
20979
|
-
|
|
20980
|
-
if ('COLORTERM' in env) {
|
|
20981
|
-
return 1;
|
|
20982
|
-
}
|
|
20983
|
-
|
|
20984
|
-
return min;
|
|
20985
|
-
}
|
|
20986
|
-
|
|
20987
|
-
function getSupportLevel(stream) {
|
|
20988
|
-
const level = supportsColor(stream, stream && stream.isTTY);
|
|
20989
|
-
return translateLevel(level);
|
|
20990
|
-
}
|
|
20991
|
-
|
|
20992
|
-
supportsColor_1 = {
|
|
20993
|
-
supportsColor: getSupportLevel,
|
|
20994
|
-
stdout: translateLevel(supportsColor(true, tty.isatty(1))),
|
|
20995
|
-
stderr: translateLevel(supportsColor(true, tty.isatty(2)))
|
|
20996
|
-
};
|
|
20997
|
-
return supportsColor_1;
|
|
20998
|
-
}
|
|
20999
|
-
|
|
21000
20963
|
/**
|
|
21001
20964
|
* Module dependencies.
|
|
21002
20965
|
*/
|
|
@@ -21007,7 +20970,7 @@ function requireNode () {
|
|
|
21007
20970
|
if (hasRequiredNode) return node.exports;
|
|
21008
20971
|
hasRequiredNode = 1;
|
|
21009
20972
|
(function (module, exports) {
|
|
21010
|
-
const tty = require$$1;
|
|
20973
|
+
const tty = require$$0$1;
|
|
21011
20974
|
const util = require$$0;
|
|
21012
20975
|
|
|
21013
20976
|
/**
|
|
@@ -21034,7 +20997,7 @@ function requireNode () {
|
|
|
21034
20997
|
try {
|
|
21035
20998
|
// Optional dependency (as in, doesn't need to be installed, NOT like optionalDependencies in package.json)
|
|
21036
20999
|
// eslint-disable-next-line import/no-extraneous-dependencies
|
|
21037
|
-
const supportsColor =
|
|
21000
|
+
const supportsColor = require('supports-color');
|
|
21038
21001
|
|
|
21039
21002
|
if (supportsColor && (supportsColor.stderr || supportsColor).level >= 2) {
|
|
21040
21003
|
exports.colors = [
|
|
@@ -21453,14 +21416,34 @@ class Strapi {
|
|
|
21453
21416
|
log(data);
|
|
21454
21417
|
return data;
|
|
21455
21418
|
}
|
|
21419
|
+
mergePermissionsPreferChild(parentPermissions, childPermissions) {
|
|
21420
|
+
// Child permissions should override parent on conflicts; missing entries inherit from parent
|
|
21421
|
+
return _.merge({}, parentPermissions, childPermissions);
|
|
21422
|
+
}
|
|
21423
|
+
async fetchRolePermissions(roleId) {
|
|
21424
|
+
const response = await this.fetchData(`users-permissions/roles/${roleId}`);
|
|
21425
|
+
const parentId = typeof response.role.parent === 'number' ? response.role.parent : response.role.parent?.id;
|
|
21426
|
+
return { permissions: response.role.permissions, parentId };
|
|
21427
|
+
}
|
|
21428
|
+
async collectRolePermissions(roleId) {
|
|
21429
|
+
// Start with the immediate role's permissions, then walk up parents, merging so child overrides parent
|
|
21430
|
+
const { permissions: initialPermissions, parentId: initialParentId } = await this.fetchRolePermissions(roleId);
|
|
21431
|
+
let accumulatedPermissions = _.cloneDeep(initialPermissions);
|
|
21432
|
+
let currentParentId = initialParentId;
|
|
21433
|
+
while (currentParentId) {
|
|
21434
|
+
const { permissions: parentPermissions, parentId } = await this.fetchRolePermissions(currentParentId);
|
|
21435
|
+
accumulatedPermissions = this.mergePermissionsPreferChild(parentPermissions, accumulatedPermissions);
|
|
21436
|
+
currentParentId = parentId;
|
|
21437
|
+
}
|
|
21438
|
+
return accumulatedPermissions;
|
|
21439
|
+
}
|
|
21456
21440
|
async can(uid, controller, action) {
|
|
21457
21441
|
if (!this.permissionsList) {
|
|
21458
21442
|
const user = await this.baseMe({ populate: { role: { fields: ["id"] } } });
|
|
21459
21443
|
if (user.error) {
|
|
21460
21444
|
return false;
|
|
21461
21445
|
}
|
|
21462
|
-
|
|
21463
|
-
this.permissionsList = response.role.permissions;
|
|
21446
|
+
this.permissionsList = await this.collectRolePermissions(user.role.id);
|
|
21464
21447
|
}
|
|
21465
21448
|
if (!this.permissionsList[uid]) {
|
|
21466
21449
|
throw new Error(`Permissions for ${uid} not found!`);
|
|
@@ -22088,7 +22071,7 @@ function requireMain () {
|
|
|
22088
22071
|
hasRequiredMain = 1;
|
|
22089
22072
|
const fs = fs__default;
|
|
22090
22073
|
const path = path__default;
|
|
22091
|
-
const os = require$$
|
|
22074
|
+
const os = require$$2;
|
|
22092
22075
|
const crypto = require$$3;
|
|
22093
22076
|
const packageJson = require$$4;
|
|
22094
22077
|
|