contentful-management 7.45.2 → 7.45.6
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/contentful-management.browser.js +111 -72
- package/dist/contentful-management.browser.js.map +1 -1
- package/dist/contentful-management.browser.min.js +1 -1
- package/dist/contentful-management.legacy.js +111 -72
- package/dist/contentful-management.legacy.js.map +1 -1
- package/dist/contentful-management.legacy.min.js +1 -1
- package/dist/contentful-management.node.js +633 -578
- package/dist/contentful-management.node.js.map +1 -1
- package/dist/contentful-management.node.min.js +1 -1
- package/dist/es-modules/adapters/REST/endpoints/entry.js +4 -3
- package/dist/es-modules/constants/editor-interface-defaults/sidebar-defaults.js +1 -8
- package/dist/es-modules/contentful-management.js +2 -1
- package/dist/es-modules/create-entry-api.js +1 -1
- package/dist/es-modules/create-environment-api.js +9 -4
- package/dist/es-modules/create-space-api.js +12 -8
- package/dist/es-modules/entities/scheduled-action.js +12 -8
- package/dist/typings/common-types.d.ts +4 -0
- package/dist/typings/contentful-management.d.ts +1 -0
- package/dist/typings/create-environment-api.d.ts +4 -3
- package/dist/typings/create-space-api.d.ts +12 -8
- package/dist/typings/entities/entry.d.ts +6 -2
- package/dist/typings/entities/preview-api-key.d.ts +1 -0
- package/dist/typings/plain/common-types.d.ts +4 -0
- package/package.json +8 -7
|
@@ -3015,15 +3015,16 @@ var rateLimitThrottle = (function (axiosInstance) {
|
|
|
3015
3015
|
};
|
|
3016
3016
|
});
|
|
3017
3017
|
|
|
3018
|
-
var attempts = {};
|
|
3019
|
-
var networkErrorAttempts = 0;
|
|
3020
|
-
|
|
3021
3018
|
var delay = function delay(ms) {
|
|
3022
3019
|
return new Promise(function (resolve) {
|
|
3023
3020
|
setTimeout(resolve, ms);
|
|
3024
3021
|
});
|
|
3025
3022
|
};
|
|
3026
3023
|
|
|
3024
|
+
var defaultWait = function defaultWait(attempts) {
|
|
3025
|
+
return Math.pow(Math.SQRT2, attempts);
|
|
3026
|
+
};
|
|
3027
|
+
|
|
3027
3028
|
function rateLimit(instance) {
|
|
3028
3029
|
var maxRetry = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : 5;
|
|
3029
3030
|
var _instance$defaults = instance.defaults,
|
|
@@ -3049,40 +3050,24 @@ function rateLimit(instance) {
|
|
|
3049
3050
|
|
|
3050
3051
|
if (!config || !instance.defaults.retryOnError) {
|
|
3051
3052
|
return Promise.reject(error);
|
|
3053
|
+
} // Retried already for max attempts
|
|
3054
|
+
|
|
3055
|
+
|
|
3056
|
+
var doneAttempts = config.attempts || 1;
|
|
3057
|
+
|
|
3058
|
+
if (doneAttempts > maxRetry) {
|
|
3059
|
+
error.attempts = config.attempts;
|
|
3060
|
+
return Promise.reject(error);
|
|
3052
3061
|
}
|
|
3053
3062
|
|
|
3054
3063
|
var retryErrorType = null;
|
|
3055
|
-
var wait =
|
|
3064
|
+
var wait = defaultWait(doneAttempts); // Errors without response did not receive anything from the server
|
|
3056
3065
|
|
|
3057
3066
|
if (!response) {
|
|
3058
3067
|
retryErrorType = 'Connection';
|
|
3059
|
-
|
|
3060
|
-
|
|
3061
|
-
if (networkErrorAttempts > maxRetry) {
|
|
3062
|
-
error.attempts = networkErrorAttempts;
|
|
3063
|
-
return Promise.reject(error);
|
|
3064
|
-
}
|
|
3065
|
-
|
|
3066
|
-
wait = Math.pow(Math.SQRT2, networkErrorAttempts);
|
|
3067
|
-
response = {};
|
|
3068
|
-
} else {
|
|
3069
|
-
networkErrorAttempts = 0;
|
|
3070
|
-
}
|
|
3071
|
-
|
|
3072
|
-
if (response.status >= 500 && response.status < 600) {
|
|
3068
|
+
} else if (response.status >= 500 && response.status < 600) {
|
|
3073
3069
|
// 5** errors are server related
|
|
3074
3070
|
retryErrorType = "Server ".concat(response.status);
|
|
3075
|
-
var headers = response.headers || {};
|
|
3076
|
-
var requestId = headers['x-contentful-request-id'] || null;
|
|
3077
|
-
attempts[requestId] = attempts[requestId] || 0;
|
|
3078
|
-
attempts[requestId]++; // we reject if there are too many errors with the same request id or request id is not defined
|
|
3079
|
-
|
|
3080
|
-
if (attempts[requestId] > maxRetry || !requestId) {
|
|
3081
|
-
error.attempts = attempts[requestId];
|
|
3082
|
-
return Promise.reject(error);
|
|
3083
|
-
}
|
|
3084
|
-
|
|
3085
|
-
wait = Math.pow(Math.SQRT2, attempts[requestId]);
|
|
3086
3071
|
} else if (response.status === 429) {
|
|
3087
3072
|
// 429 errors are exceeded rate limit exceptions
|
|
3088
3073
|
retryErrorType = 'Rate limit'; // all headers are lowercased by axios https://github.com/mzabriskie/axios/issues/413
|
|
@@ -3095,7 +3080,9 @@ function rateLimit(instance) {
|
|
|
3095
3080
|
if (retryErrorType) {
|
|
3096
3081
|
// convert to ms and add jitter
|
|
3097
3082
|
wait = Math.floor(wait * 1000 + Math.random() * 200 + 500);
|
|
3098
|
-
instance.defaults.logHandler('warning', "".concat(retryErrorType, " error occurred. Waiting for ").concat(wait, " ms before retrying..."));
|
|
3083
|
+
instance.defaults.logHandler('warning', "".concat(retryErrorType, " error occurred. Waiting for ").concat(wait, " ms before retrying...")); // increase attempts counter
|
|
3084
|
+
|
|
3085
|
+
config.attempts = doneAttempts + 1;
|
|
3099
3086
|
/* Somehow between the interceptor and retrying the request the httpAgent/httpsAgent gets transformed from an Agent-like object
|
|
3100
3087
|
to a regular object, causing failures on retries after rate limits. Removing these properties here fixes the error, but retry
|
|
3101
3088
|
requests still use the original http/httpsAgent property */
|
|
@@ -3519,6 +3506,179 @@ function errorHandler(errorResponse) {
|
|
|
3519
3506
|
|
|
3520
3507
|
|
|
3521
3508
|
|
|
3509
|
+
/***/ }),
|
|
3510
|
+
|
|
3511
|
+
/***/ "../node_modules/debug/node_modules/ms/index.js":
|
|
3512
|
+
/*!******************************************************!*\
|
|
3513
|
+
!*** ../node_modules/debug/node_modules/ms/index.js ***!
|
|
3514
|
+
\******************************************************/
|
|
3515
|
+
/*! no static exports found */
|
|
3516
|
+
/***/ (function(module, exports) {
|
|
3517
|
+
|
|
3518
|
+
/**
|
|
3519
|
+
* Helpers.
|
|
3520
|
+
*/
|
|
3521
|
+
|
|
3522
|
+
var s = 1000;
|
|
3523
|
+
var m = s * 60;
|
|
3524
|
+
var h = m * 60;
|
|
3525
|
+
var d = h * 24;
|
|
3526
|
+
var w = d * 7;
|
|
3527
|
+
var y = d * 365.25;
|
|
3528
|
+
|
|
3529
|
+
/**
|
|
3530
|
+
* Parse or format the given `val`.
|
|
3531
|
+
*
|
|
3532
|
+
* Options:
|
|
3533
|
+
*
|
|
3534
|
+
* - `long` verbose formatting [false]
|
|
3535
|
+
*
|
|
3536
|
+
* @param {String|Number} val
|
|
3537
|
+
* @param {Object} [options]
|
|
3538
|
+
* @throws {Error} throw an error if val is not a non-empty string or a number
|
|
3539
|
+
* @return {String|Number}
|
|
3540
|
+
* @api public
|
|
3541
|
+
*/
|
|
3542
|
+
|
|
3543
|
+
module.exports = function (val, options) {
|
|
3544
|
+
options = options || {};
|
|
3545
|
+
var type = typeof val;
|
|
3546
|
+
if (type === 'string' && val.length > 0) {
|
|
3547
|
+
return parse(val);
|
|
3548
|
+
} else if (type === 'number' && isFinite(val)) {
|
|
3549
|
+
return options.long ? fmtLong(val) : fmtShort(val);
|
|
3550
|
+
}
|
|
3551
|
+
throw new Error(
|
|
3552
|
+
'val is not a non-empty string or a valid number. val=' +
|
|
3553
|
+
JSON.stringify(val)
|
|
3554
|
+
);
|
|
3555
|
+
};
|
|
3556
|
+
|
|
3557
|
+
/**
|
|
3558
|
+
* Parse the given `str` and return milliseconds.
|
|
3559
|
+
*
|
|
3560
|
+
* @param {String} str
|
|
3561
|
+
* @return {Number}
|
|
3562
|
+
* @api private
|
|
3563
|
+
*/
|
|
3564
|
+
|
|
3565
|
+
function parse(str) {
|
|
3566
|
+
str = String(str);
|
|
3567
|
+
if (str.length > 100) {
|
|
3568
|
+
return;
|
|
3569
|
+
}
|
|
3570
|
+
var match = /^(-?(?:\d+)?\.?\d+) *(milliseconds?|msecs?|ms|seconds?|secs?|s|minutes?|mins?|m|hours?|hrs?|h|days?|d|weeks?|w|years?|yrs?|y)?$/i.exec(
|
|
3571
|
+
str
|
|
3572
|
+
);
|
|
3573
|
+
if (!match) {
|
|
3574
|
+
return;
|
|
3575
|
+
}
|
|
3576
|
+
var n = parseFloat(match[1]);
|
|
3577
|
+
var type = (match[2] || 'ms').toLowerCase();
|
|
3578
|
+
switch (type) {
|
|
3579
|
+
case 'years':
|
|
3580
|
+
case 'year':
|
|
3581
|
+
case 'yrs':
|
|
3582
|
+
case 'yr':
|
|
3583
|
+
case 'y':
|
|
3584
|
+
return n * y;
|
|
3585
|
+
case 'weeks':
|
|
3586
|
+
case 'week':
|
|
3587
|
+
case 'w':
|
|
3588
|
+
return n * w;
|
|
3589
|
+
case 'days':
|
|
3590
|
+
case 'day':
|
|
3591
|
+
case 'd':
|
|
3592
|
+
return n * d;
|
|
3593
|
+
case 'hours':
|
|
3594
|
+
case 'hour':
|
|
3595
|
+
case 'hrs':
|
|
3596
|
+
case 'hr':
|
|
3597
|
+
case 'h':
|
|
3598
|
+
return n * h;
|
|
3599
|
+
case 'minutes':
|
|
3600
|
+
case 'minute':
|
|
3601
|
+
case 'mins':
|
|
3602
|
+
case 'min':
|
|
3603
|
+
case 'm':
|
|
3604
|
+
return n * m;
|
|
3605
|
+
case 'seconds':
|
|
3606
|
+
case 'second':
|
|
3607
|
+
case 'secs':
|
|
3608
|
+
case 'sec':
|
|
3609
|
+
case 's':
|
|
3610
|
+
return n * s;
|
|
3611
|
+
case 'milliseconds':
|
|
3612
|
+
case 'millisecond':
|
|
3613
|
+
case 'msecs':
|
|
3614
|
+
case 'msec':
|
|
3615
|
+
case 'ms':
|
|
3616
|
+
return n;
|
|
3617
|
+
default:
|
|
3618
|
+
return undefined;
|
|
3619
|
+
}
|
|
3620
|
+
}
|
|
3621
|
+
|
|
3622
|
+
/**
|
|
3623
|
+
* Short format for `ms`.
|
|
3624
|
+
*
|
|
3625
|
+
* @param {Number} ms
|
|
3626
|
+
* @return {String}
|
|
3627
|
+
* @api private
|
|
3628
|
+
*/
|
|
3629
|
+
|
|
3630
|
+
function fmtShort(ms) {
|
|
3631
|
+
var msAbs = Math.abs(ms);
|
|
3632
|
+
if (msAbs >= d) {
|
|
3633
|
+
return Math.round(ms / d) + 'd';
|
|
3634
|
+
}
|
|
3635
|
+
if (msAbs >= h) {
|
|
3636
|
+
return Math.round(ms / h) + 'h';
|
|
3637
|
+
}
|
|
3638
|
+
if (msAbs >= m) {
|
|
3639
|
+
return Math.round(ms / m) + 'm';
|
|
3640
|
+
}
|
|
3641
|
+
if (msAbs >= s) {
|
|
3642
|
+
return Math.round(ms / s) + 's';
|
|
3643
|
+
}
|
|
3644
|
+
return ms + 'ms';
|
|
3645
|
+
}
|
|
3646
|
+
|
|
3647
|
+
/**
|
|
3648
|
+
* Long format for `ms`.
|
|
3649
|
+
*
|
|
3650
|
+
* @param {Number} ms
|
|
3651
|
+
* @return {String}
|
|
3652
|
+
* @api private
|
|
3653
|
+
*/
|
|
3654
|
+
|
|
3655
|
+
function fmtLong(ms) {
|
|
3656
|
+
var msAbs = Math.abs(ms);
|
|
3657
|
+
if (msAbs >= d) {
|
|
3658
|
+
return plural(ms, msAbs, d, 'day');
|
|
3659
|
+
}
|
|
3660
|
+
if (msAbs >= h) {
|
|
3661
|
+
return plural(ms, msAbs, h, 'hour');
|
|
3662
|
+
}
|
|
3663
|
+
if (msAbs >= m) {
|
|
3664
|
+
return plural(ms, msAbs, m, 'minute');
|
|
3665
|
+
}
|
|
3666
|
+
if (msAbs >= s) {
|
|
3667
|
+
return plural(ms, msAbs, s, 'second');
|
|
3668
|
+
}
|
|
3669
|
+
return ms + ' ms';
|
|
3670
|
+
}
|
|
3671
|
+
|
|
3672
|
+
/**
|
|
3673
|
+
* Pluralization helper.
|
|
3674
|
+
*/
|
|
3675
|
+
|
|
3676
|
+
function plural(ms, msAbs, n, name) {
|
|
3677
|
+
var isPlural = msAbs >= n * 1.5;
|
|
3678
|
+
return Math.round(ms / n) + ' ' + name + (isPlural ? 's' : '');
|
|
3679
|
+
}
|
|
3680
|
+
|
|
3681
|
+
|
|
3522
3682
|
/***/ }),
|
|
3523
3683
|
|
|
3524
3684
|
/***/ "../node_modules/debug/src/browser.js":
|
|
@@ -3528,41 +3688,27 @@ function errorHandler(errorResponse) {
|
|
|
3528
3688
|
/*! no static exports found */
|
|
3529
3689
|
/***/ (function(module, exports, __webpack_require__) {
|
|
3530
3690
|
|
|
3691
|
+
"use strict";
|
|
3692
|
+
|
|
3693
|
+
|
|
3694
|
+
function _typeof(obj) { if (typeof Symbol === "function" && typeof Symbol.iterator === "symbol") { _typeof = function _typeof(obj) { return typeof obj; }; } else { _typeof = function _typeof(obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }; } return _typeof(obj); }
|
|
3695
|
+
|
|
3696
|
+
/* eslint-env browser */
|
|
3697
|
+
|
|
3531
3698
|
/**
|
|
3532
3699
|
* This is the web browser implementation of `debug()`.
|
|
3533
|
-
*
|
|
3534
|
-
* Expose `debug()` as the module.
|
|
3535
3700
|
*/
|
|
3536
|
-
|
|
3537
|
-
exports = module.exports = __webpack_require__(/*! ./debug */ "../node_modules/debug/src/debug.js");
|
|
3538
3701
|
exports.log = log;
|
|
3539
3702
|
exports.formatArgs = formatArgs;
|
|
3540
3703
|
exports.save = save;
|
|
3541
3704
|
exports.load = load;
|
|
3542
3705
|
exports.useColors = useColors;
|
|
3543
|
-
exports.storage =
|
|
3544
|
-
&& 'undefined' != typeof chrome.storage
|
|
3545
|
-
? chrome.storage.local
|
|
3546
|
-
: localstorage();
|
|
3547
|
-
|
|
3706
|
+
exports.storage = localstorage();
|
|
3548
3707
|
/**
|
|
3549
3708
|
* Colors.
|
|
3550
3709
|
*/
|
|
3551
3710
|
|
|
3552
|
-
exports.colors = [
|
|
3553
|
-
'#0000CC', '#0000FF', '#0033CC', '#0033FF', '#0066CC', '#0066FF', '#0099CC',
|
|
3554
|
-
'#0099FF', '#00CC00', '#00CC33', '#00CC66', '#00CC99', '#00CCCC', '#00CCFF',
|
|
3555
|
-
'#3300CC', '#3300FF', '#3333CC', '#3333FF', '#3366CC', '#3366FF', '#3399CC',
|
|
3556
|
-
'#3399FF', '#33CC00', '#33CC33', '#33CC66', '#33CC99', '#33CCCC', '#33CCFF',
|
|
3557
|
-
'#6600CC', '#6600FF', '#6633CC', '#6633FF', '#66CC00', '#66CC33', '#9900CC',
|
|
3558
|
-
'#9900FF', '#9933CC', '#9933FF', '#99CC00', '#99CC33', '#CC0000', '#CC0033',
|
|
3559
|
-
'#CC0066', '#CC0099', '#CC00CC', '#CC00FF', '#CC3300', '#CC3333', '#CC3366',
|
|
3560
|
-
'#CC3399', '#CC33CC', '#CC33FF', '#CC6600', '#CC6633', '#CC9900', '#CC9933',
|
|
3561
|
-
'#CCCC00', '#CCCC33', '#FF0000', '#FF0033', '#FF0066', '#FF0099', '#FF00CC',
|
|
3562
|
-
'#FF00FF', '#FF3300', '#FF3333', '#FF3366', '#FF3399', '#FF33CC', '#FF33FF',
|
|
3563
|
-
'#FF6600', '#FF6633', '#FF9900', '#FF9933', '#FFCC00', '#FFCC33'
|
|
3564
|
-
];
|
|
3565
|
-
|
|
3711
|
+
exports.colors = ['#0000CC', '#0000FF', '#0033CC', '#0033FF', '#0066CC', '#0066FF', '#0099CC', '#0099FF', '#00CC00', '#00CC33', '#00CC66', '#00CC99', '#00CCCC', '#00CCFF', '#3300CC', '#3300FF', '#3333CC', '#3333FF', '#3366CC', '#3366FF', '#3399CC', '#3399FF', '#33CC00', '#33CC33', '#33CC66', '#33CC99', '#33CCCC', '#33CCFF', '#6600CC', '#6600FF', '#6633CC', '#6633FF', '#66CC00', '#66CC33', '#9900CC', '#9900FF', '#9933CC', '#9933FF', '#99CC00', '#99CC33', '#CC0000', '#CC0033', '#CC0066', '#CC0099', '#CC00CC', '#CC00FF', '#CC3300', '#CC3333', '#CC3366', '#CC3399', '#CC33CC', '#CC33FF', '#CC6600', '#CC6633', '#CC9900', '#CC9933', '#CCCC00', '#CCCC33', '#FF0000', '#FF0033', '#FF0066', '#FF0099', '#FF00CC', '#FF00FF', '#FF3300', '#FF3333', '#FF3366', '#FF3399', '#FF33CC', '#FF33FF', '#FF6600', '#FF6633', '#FF9900', '#FF9933', '#FFCC00', '#FFCC33'];
|
|
3566
3712
|
/**
|
|
3567
3713
|
* Currently only WebKit-based Web Inspectors, Firefox >= v31,
|
|
3568
3714
|
* and the Firebug extension (any Firefox version) are known
|
|
@@ -3570,84 +3716,65 @@ exports.colors = [
|
|
|
3570
3716
|
*
|
|
3571
3717
|
* TODO: add a `localStorage` variable to explicitly enable/disable colors
|
|
3572
3718
|
*/
|
|
3719
|
+
// eslint-disable-next-line complexity
|
|
3573
3720
|
|
|
3574
3721
|
function useColors() {
|
|
3575
3722
|
// NB: In an Electron preload script, document will be defined but not fully
|
|
3576
3723
|
// initialized. Since we know we're in Chrome, we'll just detect this case
|
|
3577
3724
|
// explicitly
|
|
3578
|
-
if (typeof window !== 'undefined' && window.process && window.process.type === 'renderer') {
|
|
3725
|
+
if (typeof window !== 'undefined' && window.process && (window.process.type === 'renderer' || window.process.__nwjs)) {
|
|
3579
3726
|
return true;
|
|
3580
|
-
}
|
|
3727
|
+
} // Internet Explorer and Edge do not support colors.
|
|
3728
|
+
|
|
3581
3729
|
|
|
3582
|
-
// Internet Explorer and Edge do not support colors.
|
|
3583
3730
|
if (typeof navigator !== 'undefined' && navigator.userAgent && navigator.userAgent.toLowerCase().match(/(edge|trident)\/(\d+)/)) {
|
|
3584
3731
|
return false;
|
|
3585
|
-
}
|
|
3586
|
-
|
|
3587
|
-
// is webkit? http://stackoverflow.com/a/16459606/376773
|
|
3732
|
+
} // Is webkit? http://stackoverflow.com/a/16459606/376773
|
|
3588
3733
|
// document is undefined in react-native: https://github.com/facebook/react-native/pull/1632
|
|
3589
|
-
return (typeof document !== 'undefined' && document.documentElement && document.documentElement.style && document.documentElement.style.WebkitAppearance) ||
|
|
3590
|
-
// is firebug? http://stackoverflow.com/a/398120/376773
|
|
3591
|
-
(typeof window !== 'undefined' && window.console && (window.console.firebug || (window.console.exception && window.console.table))) ||
|
|
3592
|
-
// is firefox >= v31?
|
|
3593
|
-
// https://developer.mozilla.org/en-US/docs/Tools/Web_Console#Styling_messages
|
|
3594
|
-
(typeof navigator !== 'undefined' && navigator.userAgent && navigator.userAgent.toLowerCase().match(/firefox\/(\d+)/) && parseInt(RegExp.$1, 10) >= 31) ||
|
|
3595
|
-
// double check webkit in userAgent just in case we are in a worker
|
|
3596
|
-
(typeof navigator !== 'undefined' && navigator.userAgent && navigator.userAgent.toLowerCase().match(/applewebkit\/(\d+)/));
|
|
3597
|
-
}
|
|
3598
|
-
|
|
3599
|
-
/**
|
|
3600
|
-
* Map %j to `JSON.stringify()`, since no Web Inspectors do that by default.
|
|
3601
|
-
*/
|
|
3602
|
-
|
|
3603
|
-
exports.formatters.j = function(v) {
|
|
3604
|
-
try {
|
|
3605
|
-
return JSON.stringify(v);
|
|
3606
|
-
} catch (err) {
|
|
3607
|
-
return '[UnexpectedJSONParseError]: ' + err.message;
|
|
3608
|
-
}
|
|
3609
|
-
};
|
|
3610
3734
|
|
|
3611
3735
|
|
|
3736
|
+
return typeof document !== 'undefined' && document.documentElement && document.documentElement.style && document.documentElement.style.WebkitAppearance || // Is firebug? http://stackoverflow.com/a/398120/376773
|
|
3737
|
+
typeof window !== 'undefined' && window.console && (window.console.firebug || window.console.exception && window.console.table) || // Is firefox >= v31?
|
|
3738
|
+
// https://developer.mozilla.org/en-US/docs/Tools/Web_Console#Styling_messages
|
|
3739
|
+
typeof navigator !== 'undefined' && navigator.userAgent && navigator.userAgent.toLowerCase().match(/firefox\/(\d+)/) && parseInt(RegExp.$1, 10) >= 31 || // Double check webkit in userAgent just in case we are in a worker
|
|
3740
|
+
typeof navigator !== 'undefined' && navigator.userAgent && navigator.userAgent.toLowerCase().match(/applewebkit\/(\d+)/);
|
|
3741
|
+
}
|
|
3612
3742
|
/**
|
|
3613
3743
|
* Colorize log arguments if enabled.
|
|
3614
3744
|
*
|
|
3615
3745
|
* @api public
|
|
3616
3746
|
*/
|
|
3617
3747
|
|
|
3618
|
-
function formatArgs(args) {
|
|
3619
|
-
var useColors = this.useColors;
|
|
3620
3748
|
|
|
3621
|
-
|
|
3622
|
-
|
|
3623
|
-
+ (useColors ? ' %c' : ' ')
|
|
3624
|
-
+ args[0]
|
|
3625
|
-
+ (useColors ? '%c ' : ' ')
|
|
3626
|
-
+ '+' + exports.humanize(this.diff);
|
|
3749
|
+
function formatArgs(args) {
|
|
3750
|
+
args[0] = (this.useColors ? '%c' : '') + this.namespace + (this.useColors ? ' %c' : ' ') + args[0] + (this.useColors ? '%c ' : ' ') + '+' + module.exports.humanize(this.diff);
|
|
3627
3751
|
|
|
3628
|
-
if (!useColors)
|
|
3752
|
+
if (!this.useColors) {
|
|
3753
|
+
return;
|
|
3754
|
+
}
|
|
3629
3755
|
|
|
3630
3756
|
var c = 'color: ' + this.color;
|
|
3631
|
-
args.splice(1, 0, c, 'color: inherit')
|
|
3632
|
-
|
|
3633
|
-
// the final "%c" is somewhat tricky, because there could be other
|
|
3757
|
+
args.splice(1, 0, c, 'color: inherit'); // The final "%c" is somewhat tricky, because there could be other
|
|
3634
3758
|
// arguments passed either before or after the %c, so we need to
|
|
3635
3759
|
// figure out the correct index to insert the CSS into
|
|
3760
|
+
|
|
3636
3761
|
var index = 0;
|
|
3637
3762
|
var lastC = 0;
|
|
3638
|
-
args[0].replace(/%[a-zA-Z%]/g, function(match) {
|
|
3639
|
-
if ('%%'
|
|
3763
|
+
args[0].replace(/%[a-zA-Z%]/g, function (match) {
|
|
3764
|
+
if (match === '%%') {
|
|
3765
|
+
return;
|
|
3766
|
+
}
|
|
3767
|
+
|
|
3640
3768
|
index++;
|
|
3641
|
-
|
|
3642
|
-
|
|
3769
|
+
|
|
3770
|
+
if (match === '%c') {
|
|
3771
|
+
// We only are interested in the *last* %c
|
|
3643
3772
|
// (the user may have provided their own)
|
|
3644
3773
|
lastC = index;
|
|
3645
3774
|
}
|
|
3646
3775
|
});
|
|
3647
|
-
|
|
3648
3776
|
args.splice(lastC, 0, c);
|
|
3649
3777
|
}
|
|
3650
|
-
|
|
3651
3778
|
/**
|
|
3652
3779
|
* Invokes `console.log()` when available.
|
|
3653
3780
|
* No-op when `console.log` is not a "function".
|
|
@@ -3655,14 +3782,14 @@ function formatArgs(args) {
|
|
|
3655
3782
|
* @api public
|
|
3656
3783
|
*/
|
|
3657
3784
|
|
|
3785
|
+
|
|
3658
3786
|
function log() {
|
|
3659
|
-
|
|
3787
|
+
var _console;
|
|
3788
|
+
|
|
3789
|
+
// This hackery is required for IE8/9, where
|
|
3660
3790
|
// the `console.log` function doesn't have 'apply'
|
|
3661
|
-
return 'object'
|
|
3662
|
-
&& console.log
|
|
3663
|
-
&& Function.prototype.apply.call(console.log, console, arguments);
|
|
3791
|
+
return (typeof console === "undefined" ? "undefined" : _typeof(console)) === 'object' && console.log && (_console = console).log.apply(_console, arguments);
|
|
3664
3792
|
}
|
|
3665
|
-
|
|
3666
3793
|
/**
|
|
3667
3794
|
* Save `namespaces`.
|
|
3668
3795
|
*
|
|
@@ -3670,16 +3797,18 @@ function log() {
|
|
|
3670
3797
|
* @api private
|
|
3671
3798
|
*/
|
|
3672
3799
|
|
|
3800
|
+
|
|
3673
3801
|
function save(namespaces) {
|
|
3674
3802
|
try {
|
|
3675
|
-
if (
|
|
3676
|
-
exports.storage.
|
|
3803
|
+
if (namespaces) {
|
|
3804
|
+
exports.storage.setItem('debug', namespaces);
|
|
3677
3805
|
} else {
|
|
3678
|
-
exports.storage.debug
|
|
3806
|
+
exports.storage.removeItem('debug');
|
|
3679
3807
|
}
|
|
3680
|
-
} catch(
|
|
3808
|
+
} catch (error) {// Swallow
|
|
3809
|
+
// XXX (@Qix-) should we be logging these?
|
|
3810
|
+
}
|
|
3681
3811
|
}
|
|
3682
|
-
|
|
3683
3812
|
/**
|
|
3684
3813
|
* Load `namespaces`.
|
|
3685
3814
|
*
|
|
@@ -3687,26 +3816,23 @@ function save(namespaces) {
|
|
|
3687
3816
|
* @api private
|
|
3688
3817
|
*/
|
|
3689
3818
|
|
|
3819
|
+
|
|
3690
3820
|
function load() {
|
|
3691
3821
|
var r;
|
|
3692
|
-
try {
|
|
3693
|
-
r = exports.storage.debug;
|
|
3694
|
-
} catch(e) {}
|
|
3695
3822
|
|
|
3823
|
+
try {
|
|
3824
|
+
r = exports.storage.getItem('debug');
|
|
3825
|
+
} catch (error) {} // Swallow
|
|
3826
|
+
// XXX (@Qix-) should we be logging these?
|
|
3696
3827
|
// If debug isn't set in LS, and we're in Electron, try to load $DEBUG
|
|
3828
|
+
|
|
3829
|
+
|
|
3697
3830
|
if (!r && typeof process !== 'undefined' && 'env' in process) {
|
|
3698
3831
|
r = process.env.DEBUG;
|
|
3699
3832
|
}
|
|
3700
3833
|
|
|
3701
3834
|
return r;
|
|
3702
3835
|
}
|
|
3703
|
-
|
|
3704
|
-
/**
|
|
3705
|
-
* Enable namespaces listed in `localStorage.debug` initially.
|
|
3706
|
-
*/
|
|
3707
|
-
|
|
3708
|
-
exports.enable(load());
|
|
3709
|
-
|
|
3710
3836
|
/**
|
|
3711
3837
|
* Localstorage attempts to return the localstorage.
|
|
3712
3838
|
*
|
|
@@ -3718,247 +3844,292 @@ exports.enable(load());
|
|
|
3718
3844
|
* @api private
|
|
3719
3845
|
*/
|
|
3720
3846
|
|
|
3847
|
+
|
|
3721
3848
|
function localstorage() {
|
|
3722
3849
|
try {
|
|
3723
|
-
|
|
3724
|
-
|
|
3850
|
+
// TVMLKit (Apple TV JS Runtime) does not have a window object, just localStorage in the global context
|
|
3851
|
+
// The Browser also has localStorage in the global context.
|
|
3852
|
+
return localStorage;
|
|
3853
|
+
} catch (error) {// Swallow
|
|
3854
|
+
// XXX (@Qix-) should we be logging these?
|
|
3855
|
+
}
|
|
3725
3856
|
}
|
|
3726
3857
|
|
|
3858
|
+
module.exports = __webpack_require__(/*! ./common */ "../node_modules/debug/src/common.js")(exports);
|
|
3859
|
+
var formatters = module.exports.formatters;
|
|
3860
|
+
/**
|
|
3861
|
+
* Map %j to `JSON.stringify()`, since no Web Inspectors do that by default.
|
|
3862
|
+
*/
|
|
3863
|
+
|
|
3864
|
+
formatters.j = function (v) {
|
|
3865
|
+
try {
|
|
3866
|
+
return JSON.stringify(v);
|
|
3867
|
+
} catch (error) {
|
|
3868
|
+
return '[UnexpectedJSONParseError]: ' + error.message;
|
|
3869
|
+
}
|
|
3870
|
+
};
|
|
3871
|
+
|
|
3872
|
+
|
|
3727
3873
|
|
|
3728
3874
|
/***/ }),
|
|
3729
3875
|
|
|
3730
|
-
/***/ "../node_modules/debug/src/
|
|
3731
|
-
|
|
3732
|
-
!*** ../node_modules/debug/src/
|
|
3733
|
-
|
|
3876
|
+
/***/ "../node_modules/debug/src/common.js":
|
|
3877
|
+
/*!*******************************************!*\
|
|
3878
|
+
!*** ../node_modules/debug/src/common.js ***!
|
|
3879
|
+
\*******************************************/
|
|
3734
3880
|
/*! no static exports found */
|
|
3735
3881
|
/***/ (function(module, exports, __webpack_require__) {
|
|
3736
3882
|
|
|
3883
|
+
"use strict";
|
|
3884
|
+
|
|
3737
3885
|
|
|
3738
3886
|
/**
|
|
3739
3887
|
* This is the common logic for both the Node.js and web browser
|
|
3740
3888
|
* implementations of `debug()`.
|
|
3741
|
-
*
|
|
3742
|
-
* Expose `debug()` as the module.
|
|
3743
|
-
*/
|
|
3744
|
-
|
|
3745
|
-
exports = module.exports = createDebug.debug = createDebug['default'] = createDebug;
|
|
3746
|
-
exports.coerce = coerce;
|
|
3747
|
-
exports.disable = disable;
|
|
3748
|
-
exports.enable = enable;
|
|
3749
|
-
exports.enabled = enabled;
|
|
3750
|
-
exports.humanize = __webpack_require__(/*! ms */ "../node_modules/ms/index.js");
|
|
3751
|
-
|
|
3752
|
-
/**
|
|
3753
|
-
* Active `debug` instances.
|
|
3754
|
-
*/
|
|
3755
|
-
exports.instances = [];
|
|
3756
|
-
|
|
3757
|
-
/**
|
|
3758
|
-
* The currently active debug mode names, and names to skip.
|
|
3759
3889
|
*/
|
|
3890
|
+
function setup(env) {
|
|
3891
|
+
createDebug.debug = createDebug;
|
|
3892
|
+
createDebug.default = createDebug;
|
|
3893
|
+
createDebug.coerce = coerce;
|
|
3894
|
+
createDebug.disable = disable;
|
|
3895
|
+
createDebug.enable = enable;
|
|
3896
|
+
createDebug.enabled = enabled;
|
|
3897
|
+
createDebug.humanize = __webpack_require__(/*! ms */ "../node_modules/debug/node_modules/ms/index.js");
|
|
3898
|
+
Object.keys(env).forEach(function (key) {
|
|
3899
|
+
createDebug[key] = env[key];
|
|
3900
|
+
});
|
|
3901
|
+
/**
|
|
3902
|
+
* Active `debug` instances.
|
|
3903
|
+
*/
|
|
3760
3904
|
|
|
3761
|
-
|
|
3762
|
-
|
|
3905
|
+
createDebug.instances = [];
|
|
3906
|
+
/**
|
|
3907
|
+
* The currently active debug mode names, and names to skip.
|
|
3908
|
+
*/
|
|
3763
3909
|
|
|
3764
|
-
|
|
3765
|
-
|
|
3766
|
-
|
|
3767
|
-
|
|
3768
|
-
|
|
3910
|
+
createDebug.names = [];
|
|
3911
|
+
createDebug.skips = [];
|
|
3912
|
+
/**
|
|
3913
|
+
* Map of special "%n" handling functions, for the debug "format" argument.
|
|
3914
|
+
*
|
|
3915
|
+
* Valid key names are a single, lower or upper-case letter, i.e. "n" and "N".
|
|
3916
|
+
*/
|
|
3769
3917
|
|
|
3770
|
-
|
|
3918
|
+
createDebug.formatters = {};
|
|
3919
|
+
/**
|
|
3920
|
+
* Selects a color for a debug namespace
|
|
3921
|
+
* @param {String} namespace The namespace string for the for the debug instance to be colored
|
|
3922
|
+
* @return {Number|String} An ANSI color code for the given namespace
|
|
3923
|
+
* @api private
|
|
3924
|
+
*/
|
|
3771
3925
|
|
|
3772
|
-
|
|
3773
|
-
|
|
3774
|
-
* @param {String} namespace
|
|
3775
|
-
* @return {Number}
|
|
3776
|
-
* @api private
|
|
3777
|
-
*/
|
|
3926
|
+
function selectColor(namespace) {
|
|
3927
|
+
var hash = 0;
|
|
3778
3928
|
|
|
3779
|
-
|
|
3780
|
-
|
|
3929
|
+
for (var i = 0; i < namespace.length; i++) {
|
|
3930
|
+
hash = (hash << 5) - hash + namespace.charCodeAt(i);
|
|
3931
|
+
hash |= 0; // Convert to 32bit integer
|
|
3932
|
+
}
|
|
3781
3933
|
|
|
3782
|
-
|
|
3783
|
-
hash = ((hash << 5) - hash) + namespace.charCodeAt(i);
|
|
3784
|
-
hash |= 0; // Convert to 32bit integer
|
|
3934
|
+
return createDebug.colors[Math.abs(hash) % createDebug.colors.length];
|
|
3785
3935
|
}
|
|
3786
3936
|
|
|
3787
|
-
|
|
3788
|
-
|
|
3789
|
-
|
|
3790
|
-
|
|
3791
|
-
|
|
3792
|
-
|
|
3793
|
-
|
|
3794
|
-
|
|
3795
|
-
|
|
3796
|
-
|
|
3937
|
+
createDebug.selectColor = selectColor;
|
|
3938
|
+
/**
|
|
3939
|
+
* Create a debugger with the given `namespace`.
|
|
3940
|
+
*
|
|
3941
|
+
* @param {String} namespace
|
|
3942
|
+
* @return {Function}
|
|
3943
|
+
* @api public
|
|
3944
|
+
*/
|
|
3945
|
+
|
|
3946
|
+
function createDebug(namespace) {
|
|
3947
|
+
var prevTime;
|
|
3948
|
+
|
|
3949
|
+
function debug() {
|
|
3950
|
+
// Disabled?
|
|
3951
|
+
if (!debug.enabled) {
|
|
3952
|
+
return;
|
|
3953
|
+
}
|
|
3797
3954
|
|
|
3798
|
-
|
|
3955
|
+
for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) {
|
|
3956
|
+
args[_key] = arguments[_key];
|
|
3957
|
+
}
|
|
3799
3958
|
|
|
3800
|
-
|
|
3959
|
+
var self = debug; // Set `diff` timestamp
|
|
3801
3960
|
|
|
3802
|
-
|
|
3803
|
-
|
|
3804
|
-
|
|
3961
|
+
var curr = Number(new Date());
|
|
3962
|
+
var ms = curr - (prevTime || curr);
|
|
3963
|
+
self.diff = ms;
|
|
3964
|
+
self.prev = prevTime;
|
|
3965
|
+
self.curr = curr;
|
|
3966
|
+
prevTime = curr;
|
|
3967
|
+
args[0] = createDebug.coerce(args[0]);
|
|
3805
3968
|
|
|
3806
|
-
|
|
3969
|
+
if (typeof args[0] !== 'string') {
|
|
3970
|
+
// Anything else let's inspect with %O
|
|
3971
|
+
args.unshift('%O');
|
|
3972
|
+
} // Apply any `formatters` transformations
|
|
3807
3973
|
|
|
3808
|
-
// set `diff` timestamp
|
|
3809
|
-
var curr = +new Date();
|
|
3810
|
-
var ms = curr - (prevTime || curr);
|
|
3811
|
-
self.diff = ms;
|
|
3812
|
-
self.prev = prevTime;
|
|
3813
|
-
self.curr = curr;
|
|
3814
|
-
prevTime = curr;
|
|
3815
3974
|
|
|
3816
|
-
|
|
3817
|
-
|
|
3818
|
-
|
|
3819
|
-
|
|
3820
|
-
|
|
3975
|
+
var index = 0;
|
|
3976
|
+
args[0] = args[0].replace(/%([a-zA-Z%])/g, function (match, format) {
|
|
3977
|
+
// If we encounter an escaped % then don't increase the array index
|
|
3978
|
+
if (match === '%%') {
|
|
3979
|
+
return match;
|
|
3980
|
+
}
|
|
3821
3981
|
|
|
3822
|
-
|
|
3982
|
+
index++;
|
|
3983
|
+
var formatter = createDebug.formatters[format];
|
|
3823
3984
|
|
|
3824
|
-
|
|
3825
|
-
|
|
3826
|
-
|
|
3827
|
-
}
|
|
3985
|
+
if (typeof formatter === 'function') {
|
|
3986
|
+
var val = args[index];
|
|
3987
|
+
match = formatter.call(self, val); // Now we need to remove `args[index]` since it's inlined in the `format`
|
|
3828
3988
|
|
|
3829
|
-
|
|
3830
|
-
|
|
3831
|
-
|
|
3832
|
-
// if we encounter an escaped % then don't increase the array index
|
|
3833
|
-
if (match === '%%') return match;
|
|
3834
|
-
index++;
|
|
3835
|
-
var formatter = exports.formatters[format];
|
|
3836
|
-
if ('function' === typeof formatter) {
|
|
3837
|
-
var val = args[index];
|
|
3838
|
-
match = formatter.call(self, val);
|
|
3989
|
+
args.splice(index, 1);
|
|
3990
|
+
index--;
|
|
3991
|
+
}
|
|
3839
3992
|
|
|
3840
|
-
|
|
3841
|
-
|
|
3842
|
-
index--;
|
|
3843
|
-
}
|
|
3844
|
-
return match;
|
|
3845
|
-
});
|
|
3993
|
+
return match;
|
|
3994
|
+
}); // Apply env-specific formatting (colors, etc.)
|
|
3846
3995
|
|
|
3847
|
-
|
|
3848
|
-
|
|
3996
|
+
createDebug.formatArgs.call(self, args);
|
|
3997
|
+
var logFn = self.log || createDebug.log;
|
|
3998
|
+
logFn.apply(self, args);
|
|
3999
|
+
}
|
|
3849
4000
|
|
|
3850
|
-
|
|
3851
|
-
|
|
3852
|
-
|
|
4001
|
+
debug.namespace = namespace;
|
|
4002
|
+
debug.enabled = createDebug.enabled(namespace);
|
|
4003
|
+
debug.useColors = createDebug.useColors();
|
|
4004
|
+
debug.color = selectColor(namespace);
|
|
4005
|
+
debug.destroy = destroy;
|
|
4006
|
+
debug.extend = extend; // Debug.formatArgs = formatArgs;
|
|
4007
|
+
// debug.rawLog = rawLog;
|
|
4008
|
+
// env-specific initialization logic for debug instances
|
|
3853
4009
|
|
|
3854
|
-
|
|
3855
|
-
|
|
3856
|
-
|
|
3857
|
-
debug.color = selectColor(namespace);
|
|
3858
|
-
debug.destroy = destroy;
|
|
4010
|
+
if (typeof createDebug.init === 'function') {
|
|
4011
|
+
createDebug.init(debug);
|
|
4012
|
+
}
|
|
3859
4013
|
|
|
3860
|
-
|
|
3861
|
-
|
|
3862
|
-
exports.init(debug);
|
|
4014
|
+
createDebug.instances.push(debug);
|
|
4015
|
+
return debug;
|
|
3863
4016
|
}
|
|
3864
4017
|
|
|
3865
|
-
|
|
4018
|
+
function destroy() {
|
|
4019
|
+
var index = createDebug.instances.indexOf(this);
|
|
3866
4020
|
|
|
3867
|
-
|
|
3868
|
-
|
|
4021
|
+
if (index !== -1) {
|
|
4022
|
+
createDebug.instances.splice(index, 1);
|
|
4023
|
+
return true;
|
|
4024
|
+
}
|
|
3869
4025
|
|
|
3870
|
-
function destroy () {
|
|
3871
|
-
var index = exports.instances.indexOf(this);
|
|
3872
|
-
if (index !== -1) {
|
|
3873
|
-
exports.instances.splice(index, 1);
|
|
3874
|
-
return true;
|
|
3875
|
-
} else {
|
|
3876
4026
|
return false;
|
|
3877
4027
|
}
|
|
3878
|
-
}
|
|
3879
4028
|
|
|
3880
|
-
|
|
3881
|
-
|
|
3882
|
-
|
|
3883
|
-
|
|
3884
|
-
|
|
3885
|
-
|
|
3886
|
-
|
|
4029
|
+
function extend(namespace, delimiter) {
|
|
4030
|
+
return createDebug(this.namespace + (typeof delimiter === 'undefined' ? ':' : delimiter) + namespace);
|
|
4031
|
+
}
|
|
4032
|
+
/**
|
|
4033
|
+
* Enables a debug mode by namespaces. This can include modes
|
|
4034
|
+
* separated by a colon and wildcards.
|
|
4035
|
+
*
|
|
4036
|
+
* @param {String} namespaces
|
|
4037
|
+
* @api public
|
|
4038
|
+
*/
|
|
4039
|
+
|
|
4040
|
+
|
|
4041
|
+
function enable(namespaces) {
|
|
4042
|
+
createDebug.save(namespaces);
|
|
4043
|
+
createDebug.names = [];
|
|
4044
|
+
createDebug.skips = [];
|
|
4045
|
+
var i;
|
|
4046
|
+
var split = (typeof namespaces === 'string' ? namespaces : '').split(/[\s,]+/);
|
|
4047
|
+
var len = split.length;
|
|
3887
4048
|
|
|
3888
|
-
|
|
3889
|
-
|
|
4049
|
+
for (i = 0; i < len; i++) {
|
|
4050
|
+
if (!split[i]) {
|
|
4051
|
+
// ignore empty strings
|
|
4052
|
+
continue;
|
|
4053
|
+
}
|
|
3890
4054
|
|
|
3891
|
-
|
|
3892
|
-
exports.skips = [];
|
|
4055
|
+
namespaces = split[i].replace(/\*/g, '.*?');
|
|
3893
4056
|
|
|
3894
|
-
|
|
3895
|
-
|
|
3896
|
-
|
|
3897
|
-
|
|
3898
|
-
|
|
3899
|
-
|
|
3900
|
-
|
|
3901
|
-
|
|
3902
|
-
|
|
3903
|
-
|
|
3904
|
-
exports.names.push(new RegExp('^' + namespaces + '$'));
|
|
4057
|
+
if (namespaces[0] === '-') {
|
|
4058
|
+
createDebug.skips.push(new RegExp('^' + namespaces.substr(1) + '$'));
|
|
4059
|
+
} else {
|
|
4060
|
+
createDebug.names.push(new RegExp('^' + namespaces + '$'));
|
|
4061
|
+
}
|
|
4062
|
+
}
|
|
4063
|
+
|
|
4064
|
+
for (i = 0; i < createDebug.instances.length; i++) {
|
|
4065
|
+
var instance = createDebug.instances[i];
|
|
4066
|
+
instance.enabled = createDebug.enabled(instance.namespace);
|
|
3905
4067
|
}
|
|
3906
4068
|
}
|
|
4069
|
+
/**
|
|
4070
|
+
* Disable debug output.
|
|
4071
|
+
*
|
|
4072
|
+
* @api public
|
|
4073
|
+
*/
|
|
4074
|
+
|
|
3907
4075
|
|
|
3908
|
-
|
|
3909
|
-
|
|
3910
|
-
instance.enabled = exports.enabled(instance.namespace);
|
|
4076
|
+
function disable() {
|
|
4077
|
+
createDebug.enable('');
|
|
3911
4078
|
}
|
|
3912
|
-
|
|
4079
|
+
/**
|
|
4080
|
+
* Returns true if the given mode name is enabled, false otherwise.
|
|
4081
|
+
*
|
|
4082
|
+
* @param {String} name
|
|
4083
|
+
* @return {Boolean}
|
|
4084
|
+
* @api public
|
|
4085
|
+
*/
|
|
3913
4086
|
|
|
3914
|
-
/**
|
|
3915
|
-
* Disable debug output.
|
|
3916
|
-
*
|
|
3917
|
-
* @api public
|
|
3918
|
-
*/
|
|
3919
4087
|
|
|
3920
|
-
function
|
|
3921
|
-
|
|
3922
|
-
|
|
4088
|
+
function enabled(name) {
|
|
4089
|
+
if (name[name.length - 1] === '*') {
|
|
4090
|
+
return true;
|
|
4091
|
+
}
|
|
3923
4092
|
|
|
3924
|
-
|
|
3925
|
-
|
|
3926
|
-
*
|
|
3927
|
-
* @param {String} name
|
|
3928
|
-
* @return {Boolean}
|
|
3929
|
-
* @api public
|
|
3930
|
-
*/
|
|
4093
|
+
var i;
|
|
4094
|
+
var len;
|
|
3931
4095
|
|
|
3932
|
-
|
|
3933
|
-
|
|
3934
|
-
|
|
3935
|
-
|
|
3936
|
-
var i, len;
|
|
3937
|
-
for (i = 0, len = exports.skips.length; i < len; i++) {
|
|
3938
|
-
if (exports.skips[i].test(name)) {
|
|
3939
|
-
return false;
|
|
4096
|
+
for (i = 0, len = createDebug.skips.length; i < len; i++) {
|
|
4097
|
+
if (createDebug.skips[i].test(name)) {
|
|
4098
|
+
return false;
|
|
4099
|
+
}
|
|
3940
4100
|
}
|
|
4101
|
+
|
|
4102
|
+
for (i = 0, len = createDebug.names.length; i < len; i++) {
|
|
4103
|
+
if (createDebug.names[i].test(name)) {
|
|
4104
|
+
return true;
|
|
4105
|
+
}
|
|
4106
|
+
}
|
|
4107
|
+
|
|
4108
|
+
return false;
|
|
3941
4109
|
}
|
|
3942
|
-
|
|
3943
|
-
|
|
3944
|
-
|
|
4110
|
+
/**
|
|
4111
|
+
* Coerce `val`.
|
|
4112
|
+
*
|
|
4113
|
+
* @param {Mixed} val
|
|
4114
|
+
* @return {Mixed}
|
|
4115
|
+
* @api private
|
|
4116
|
+
*/
|
|
4117
|
+
|
|
4118
|
+
|
|
4119
|
+
function coerce(val) {
|
|
4120
|
+
if (val instanceof Error) {
|
|
4121
|
+
return val.stack || val.message;
|
|
3945
4122
|
}
|
|
4123
|
+
|
|
4124
|
+
return val;
|
|
3946
4125
|
}
|
|
3947
|
-
|
|
4126
|
+
|
|
4127
|
+
createDebug.enable(createDebug.load());
|
|
4128
|
+
return createDebug;
|
|
3948
4129
|
}
|
|
3949
4130
|
|
|
3950
|
-
|
|
3951
|
-
* Coerce `val`.
|
|
3952
|
-
*
|
|
3953
|
-
* @param {Mixed} val
|
|
3954
|
-
* @return {Mixed}
|
|
3955
|
-
* @api private
|
|
3956
|
-
*/
|
|
4131
|
+
module.exports = setup;
|
|
3957
4132
|
|
|
3958
|
-
function coerce(val) {
|
|
3959
|
-
if (val instanceof Error) return val.stack || val.message;
|
|
3960
|
-
return val;
|
|
3961
|
-
}
|
|
3962
4133
|
|
|
3963
4134
|
|
|
3964
4135
|
/***/ }),
|
|
@@ -3970,18 +4141,21 @@ function coerce(val) {
|
|
|
3970
4141
|
/*! no static exports found */
|
|
3971
4142
|
/***/ (function(module, exports, __webpack_require__) {
|
|
3972
4143
|
|
|
4144
|
+
"use strict";
|
|
4145
|
+
|
|
4146
|
+
|
|
3973
4147
|
/**
|
|
3974
|
-
* Detect Electron renderer process, which is node, but we should
|
|
4148
|
+
* Detect Electron renderer / nwjs process, which is node, but we should
|
|
3975
4149
|
* treat as a browser.
|
|
3976
4150
|
*/
|
|
3977
|
-
|
|
3978
|
-
if (typeof process === 'undefined' || process.type === 'renderer') {
|
|
4151
|
+
if (typeof process === 'undefined' || process.type === 'renderer' || process.browser === true || process.__nwjs) {
|
|
3979
4152
|
module.exports = __webpack_require__(/*! ./browser.js */ "../node_modules/debug/src/browser.js");
|
|
3980
4153
|
} else {
|
|
3981
4154
|
module.exports = __webpack_require__(/*! ./node.js */ "../node_modules/debug/src/node.js");
|
|
3982
4155
|
}
|
|
3983
4156
|
|
|
3984
4157
|
|
|
4158
|
+
|
|
3985
4159
|
/***/ }),
|
|
3986
4160
|
|
|
3987
4161
|
/***/ "../node_modules/debug/src/node.js":
|
|
@@ -3991,47 +4165,41 @@ if (typeof process === 'undefined' || process.type === 'renderer') {
|
|
|
3991
4165
|
/*! no static exports found */
|
|
3992
4166
|
/***/ (function(module, exports, __webpack_require__) {
|
|
3993
4167
|
|
|
4168
|
+
"use strict";
|
|
4169
|
+
|
|
4170
|
+
|
|
3994
4171
|
/**
|
|
3995
4172
|
* Module dependencies.
|
|
3996
4173
|
*/
|
|
3997
|
-
|
|
3998
4174
|
var tty = __webpack_require__(/*! tty */ "tty");
|
|
3999
|
-
var util = __webpack_require__(/*! util */ "util");
|
|
4000
4175
|
|
|
4176
|
+
var util = __webpack_require__(/*! util */ "util");
|
|
4001
4177
|
/**
|
|
4002
4178
|
* This is the Node.js implementation of `debug()`.
|
|
4003
|
-
*
|
|
4004
|
-
* Expose `debug()` as the module.
|
|
4005
4179
|
*/
|
|
4006
4180
|
|
|
4007
|
-
|
|
4181
|
+
|
|
4008
4182
|
exports.init = init;
|
|
4009
4183
|
exports.log = log;
|
|
4010
4184
|
exports.formatArgs = formatArgs;
|
|
4011
4185
|
exports.save = save;
|
|
4012
4186
|
exports.load = load;
|
|
4013
4187
|
exports.useColors = useColors;
|
|
4014
|
-
|
|
4015
4188
|
/**
|
|
4016
4189
|
* Colors.
|
|
4017
4190
|
*/
|
|
4018
4191
|
|
|
4019
|
-
exports.colors = [
|
|
4192
|
+
exports.colors = [6, 2, 3, 4, 5, 1];
|
|
4020
4193
|
|
|
4021
4194
|
try {
|
|
4195
|
+
// Optional dependency (as in, doesn't need to be installed, NOT like optionalDependencies in package.json)
|
|
4196
|
+
// eslint-disable-next-line import/no-extraneous-dependencies
|
|
4022
4197
|
var supportsColor = __webpack_require__(/*! supports-color */ "../node_modules/supports-color/index.js");
|
|
4023
|
-
|
|
4024
|
-
|
|
4025
|
-
|
|
4026
|
-
69, 74, 75, 76, 77, 78, 79, 80, 81, 92, 93, 98, 99, 112, 113, 128, 129, 134,
|
|
4027
|
-
135, 148, 149, 160, 161, 162, 163, 164, 165, 166, 167, 168, 169, 170, 171,
|
|
4028
|
-
172, 173, 178, 179, 184, 185, 196, 197, 198, 199, 200, 201, 202, 203, 204,
|
|
4029
|
-
205, 206, 207, 208, 209, 214, 215, 220, 221
|
|
4030
|
-
];
|
|
4198
|
+
|
|
4199
|
+
if (supportsColor && (supportsColor.stderr || supportsColor).level >= 2) {
|
|
4200
|
+
exports.colors = [20, 21, 26, 27, 32, 33, 38, 39, 40, 41, 42, 43, 44, 45, 56, 57, 62, 63, 68, 69, 74, 75, 76, 77, 78, 79, 80, 81, 92, 93, 98, 99, 112, 113, 128, 129, 134, 135, 148, 149, 160, 161, 162, 163, 164, 165, 166, 167, 168, 169, 170, 171, 172, 173, 178, 179, 184, 185, 196, 197, 198, 199, 200, 201, 202, 203, 204, 205, 206, 207, 208, 209, 214, 215, 220, 221];
|
|
4031
4201
|
}
|
|
4032
|
-
} catch (
|
|
4033
|
-
// swallow - we only care if `supports-color` is available; it doesn't have to be.
|
|
4034
|
-
}
|
|
4202
|
+
} catch (error) {} // Swallow - we only care if `supports-color` is available; it doesn't have to be.
|
|
4035
4203
|
|
|
4036
4204
|
/**
|
|
4037
4205
|
* Build up the default `inspectOpts` object from the environment variables.
|
|
@@ -4039,74 +4207,54 @@ try {
|
|
|
4039
4207
|
* $ DEBUG_COLORS=no DEBUG_DEPTH=10 DEBUG_SHOW_HIDDEN=enabled node script.js
|
|
4040
4208
|
*/
|
|
4041
4209
|
|
|
4210
|
+
|
|
4042
4211
|
exports.inspectOpts = Object.keys(process.env).filter(function (key) {
|
|
4043
4212
|
return /^debug_/i.test(key);
|
|
4044
4213
|
}).reduce(function (obj, key) {
|
|
4045
|
-
//
|
|
4046
|
-
var prop = key
|
|
4047
|
-
.
|
|
4048
|
-
|
|
4049
|
-
.replace(/_([a-z])/g, function (_, k) { return k.toUpperCase() });
|
|
4214
|
+
// Camel-case
|
|
4215
|
+
var prop = key.substring(6).toLowerCase().replace(/_([a-z])/g, function (_, k) {
|
|
4216
|
+
return k.toUpperCase();
|
|
4217
|
+
}); // Coerce string value into JS value
|
|
4050
4218
|
|
|
4051
|
-
// coerce string value into JS value
|
|
4052
4219
|
var val = process.env[key];
|
|
4053
|
-
|
|
4054
|
-
|
|
4055
|
-
|
|
4056
|
-
else
|
|
4220
|
+
|
|
4221
|
+
if (/^(yes|on|true|enabled)$/i.test(val)) {
|
|
4222
|
+
val = true;
|
|
4223
|
+
} else if (/^(no|off|false|disabled)$/i.test(val)) {
|
|
4224
|
+
val = false;
|
|
4225
|
+
} else if (val === 'null') {
|
|
4226
|
+
val = null;
|
|
4227
|
+
} else {
|
|
4228
|
+
val = Number(val);
|
|
4229
|
+
}
|
|
4057
4230
|
|
|
4058
4231
|
obj[prop] = val;
|
|
4059
4232
|
return obj;
|
|
4060
4233
|
}, {});
|
|
4061
|
-
|
|
4062
4234
|
/**
|
|
4063
4235
|
* Is stdout a TTY? Colored output is enabled when `true`.
|
|
4064
4236
|
*/
|
|
4065
4237
|
|
|
4066
4238
|
function useColors() {
|
|
4067
|
-
return 'colors' in exports.inspectOpts
|
|
4068
|
-
? Boolean(exports.inspectOpts.colors)
|
|
4069
|
-
: tty.isatty(process.stderr.fd);
|
|
4239
|
+
return 'colors' in exports.inspectOpts ? Boolean(exports.inspectOpts.colors) : tty.isatty(process.stderr.fd);
|
|
4070
4240
|
}
|
|
4071
|
-
|
|
4072
|
-
/**
|
|
4073
|
-
* Map %o to `util.inspect()`, all on a single line.
|
|
4074
|
-
*/
|
|
4075
|
-
|
|
4076
|
-
exports.formatters.o = function(v) {
|
|
4077
|
-
this.inspectOpts.colors = this.useColors;
|
|
4078
|
-
return util.inspect(v, this.inspectOpts)
|
|
4079
|
-
.split('\n').map(function(str) {
|
|
4080
|
-
return str.trim()
|
|
4081
|
-
}).join(' ');
|
|
4082
|
-
};
|
|
4083
|
-
|
|
4084
|
-
/**
|
|
4085
|
-
* Map %o to `util.inspect()`, allowing multiple lines if needed.
|
|
4086
|
-
*/
|
|
4087
|
-
|
|
4088
|
-
exports.formatters.O = function(v) {
|
|
4089
|
-
this.inspectOpts.colors = this.useColors;
|
|
4090
|
-
return util.inspect(v, this.inspectOpts);
|
|
4091
|
-
};
|
|
4092
|
-
|
|
4093
4241
|
/**
|
|
4094
4242
|
* Adds ANSI color escape codes if enabled.
|
|
4095
4243
|
*
|
|
4096
4244
|
* @api public
|
|
4097
4245
|
*/
|
|
4098
4246
|
|
|
4247
|
+
|
|
4099
4248
|
function formatArgs(args) {
|
|
4100
|
-
var name = this.namespace
|
|
4101
|
-
|
|
4249
|
+
var name = this.namespace,
|
|
4250
|
+
useColors = this.useColors;
|
|
4102
4251
|
|
|
4103
4252
|
if (useColors) {
|
|
4104
4253
|
var c = this.color;
|
|
4105
|
-
var colorCode =
|
|
4106
|
-
var prefix =
|
|
4107
|
-
|
|
4254
|
+
var colorCode = "\x1B[3" + (c < 8 ? c : '8;5;' + c);
|
|
4255
|
+
var prefix = " ".concat(colorCode, ";1m").concat(name, " \x1B[0m");
|
|
4108
4256
|
args[0] = prefix + args[0].split('\n').join('\n' + prefix);
|
|
4109
|
-
args.push(colorCode + 'm+' + exports.humanize(this.diff) +
|
|
4257
|
+
args.push(colorCode + 'm+' + module.exports.humanize(this.diff) + "\x1B[0m");
|
|
4110
4258
|
} else {
|
|
4111
4259
|
args[0] = getDate() + name + ' ' + args[0];
|
|
4112
4260
|
}
|
|
@@ -4115,19 +4263,18 @@ function formatArgs(args) {
|
|
|
4115
4263
|
function getDate() {
|
|
4116
4264
|
if (exports.inspectOpts.hideDate) {
|
|
4117
4265
|
return '';
|
|
4118
|
-
} else {
|
|
4119
|
-
return new Date().toISOString() + ' ';
|
|
4120
4266
|
}
|
|
4121
|
-
}
|
|
4122
4267
|
|
|
4268
|
+
return new Date().toISOString() + ' ';
|
|
4269
|
+
}
|
|
4123
4270
|
/**
|
|
4124
4271
|
* Invokes `util.format()` with the specified arguments and writes to stderr.
|
|
4125
4272
|
*/
|
|
4126
4273
|
|
|
4274
|
+
|
|
4127
4275
|
function log() {
|
|
4128
4276
|
return process.stderr.write(util.format.apply(util, arguments) + '\n');
|
|
4129
4277
|
}
|
|
4130
|
-
|
|
4131
4278
|
/**
|
|
4132
4279
|
* Save `namespaces`.
|
|
4133
4280
|
*
|
|
@@ -4135,16 +4282,16 @@ function log() {
|
|
|
4135
4282
|
* @api private
|
|
4136
4283
|
*/
|
|
4137
4284
|
|
|
4285
|
+
|
|
4138
4286
|
function save(namespaces) {
|
|
4139
|
-
if (
|
|
4287
|
+
if (namespaces) {
|
|
4288
|
+
process.env.DEBUG = namespaces;
|
|
4289
|
+
} else {
|
|
4140
4290
|
// If you set a process.env field to null or undefined, it gets cast to the
|
|
4141
4291
|
// string 'null' or 'undefined'. Just delete instead.
|
|
4142
4292
|
delete process.env.DEBUG;
|
|
4143
|
-
} else {
|
|
4144
|
-
process.env.DEBUG = namespaces;
|
|
4145
4293
|
}
|
|
4146
4294
|
}
|
|
4147
|
-
|
|
4148
4295
|
/**
|
|
4149
4296
|
* Load `namespaces`.
|
|
4150
4297
|
*
|
|
@@ -4152,10 +4299,10 @@ function save(namespaces) {
|
|
|
4152
4299
|
* @api private
|
|
4153
4300
|
*/
|
|
4154
4301
|
|
|
4302
|
+
|
|
4155
4303
|
function load() {
|
|
4156
4304
|
return process.env.DEBUG;
|
|
4157
4305
|
}
|
|
4158
|
-
|
|
4159
4306
|
/**
|
|
4160
4307
|
* Init logic for `debug` instances.
|
|
4161
4308
|
*
|
|
@@ -4163,20 +4310,39 @@ function load() {
|
|
|
4163
4310
|
* differently for a particular `debug` instance.
|
|
4164
4311
|
*/
|
|
4165
4312
|
|
|
4166
|
-
function init (debug) {
|
|
4167
|
-
debug.inspectOpts = {};
|
|
4168
4313
|
|
|
4314
|
+
function init(debug) {
|
|
4315
|
+
debug.inspectOpts = {};
|
|
4169
4316
|
var keys = Object.keys(exports.inspectOpts);
|
|
4317
|
+
|
|
4170
4318
|
for (var i = 0; i < keys.length; i++) {
|
|
4171
4319
|
debug.inspectOpts[keys[i]] = exports.inspectOpts[keys[i]];
|
|
4172
4320
|
}
|
|
4173
4321
|
}
|
|
4174
4322
|
|
|
4323
|
+
module.exports = __webpack_require__(/*! ./common */ "../node_modules/debug/src/common.js")(exports);
|
|
4324
|
+
var formatters = module.exports.formatters;
|
|
4175
4325
|
/**
|
|
4176
|
-
*
|
|
4326
|
+
* Map %o to `util.inspect()`, all on a single line.
|
|
4327
|
+
*/
|
|
4328
|
+
|
|
4329
|
+
formatters.o = function (v) {
|
|
4330
|
+
this.inspectOpts.colors = this.useColors;
|
|
4331
|
+
return util.inspect(v, this.inspectOpts)
|
|
4332
|
+
.split('\n')
|
|
4333
|
+
.map(function (str) { return str.trim(); })
|
|
4334
|
+
.join(' ');
|
|
4335
|
+
};
|
|
4336
|
+
/**
|
|
4337
|
+
* Map %O to `util.inspect()`, allowing multiple lines if needed.
|
|
4177
4338
|
*/
|
|
4178
4339
|
|
|
4179
|
-
|
|
4340
|
+
|
|
4341
|
+
formatters.O = function (v) {
|
|
4342
|
+
this.inspectOpts.colors = this.useColors;
|
|
4343
|
+
return util.inspect(v, this.inspectOpts);
|
|
4344
|
+
};
|
|
4345
|
+
|
|
4180
4346
|
|
|
4181
4347
|
|
|
4182
4348
|
/***/ }),
|
|
@@ -5909,169 +6075,6 @@ function isString(value) {
|
|
|
5909
6075
|
module.exports = isString;
|
|
5910
6076
|
|
|
5911
6077
|
|
|
5912
|
-
/***/ }),
|
|
5913
|
-
|
|
5914
|
-
/***/ "../node_modules/ms/index.js":
|
|
5915
|
-
/*!***********************************!*\
|
|
5916
|
-
!*** ../node_modules/ms/index.js ***!
|
|
5917
|
-
\***********************************/
|
|
5918
|
-
/*! no static exports found */
|
|
5919
|
-
/***/ (function(module, exports) {
|
|
5920
|
-
|
|
5921
|
-
/**
|
|
5922
|
-
* Helpers.
|
|
5923
|
-
*/
|
|
5924
|
-
|
|
5925
|
-
var s = 1000;
|
|
5926
|
-
var m = s * 60;
|
|
5927
|
-
var h = m * 60;
|
|
5928
|
-
var d = h * 24;
|
|
5929
|
-
var y = d * 365.25;
|
|
5930
|
-
|
|
5931
|
-
/**
|
|
5932
|
-
* Parse or format the given `val`.
|
|
5933
|
-
*
|
|
5934
|
-
* Options:
|
|
5935
|
-
*
|
|
5936
|
-
* - `long` verbose formatting [false]
|
|
5937
|
-
*
|
|
5938
|
-
* @param {String|Number} val
|
|
5939
|
-
* @param {Object} [options]
|
|
5940
|
-
* @throws {Error} throw an error if val is not a non-empty string or a number
|
|
5941
|
-
* @return {String|Number}
|
|
5942
|
-
* @api public
|
|
5943
|
-
*/
|
|
5944
|
-
|
|
5945
|
-
module.exports = function(val, options) {
|
|
5946
|
-
options = options || {};
|
|
5947
|
-
var type = typeof val;
|
|
5948
|
-
if (type === 'string' && val.length > 0) {
|
|
5949
|
-
return parse(val);
|
|
5950
|
-
} else if (type === 'number' && isNaN(val) === false) {
|
|
5951
|
-
return options.long ? fmtLong(val) : fmtShort(val);
|
|
5952
|
-
}
|
|
5953
|
-
throw new Error(
|
|
5954
|
-
'val is not a non-empty string or a valid number. val=' +
|
|
5955
|
-
JSON.stringify(val)
|
|
5956
|
-
);
|
|
5957
|
-
};
|
|
5958
|
-
|
|
5959
|
-
/**
|
|
5960
|
-
* Parse the given `str` and return milliseconds.
|
|
5961
|
-
*
|
|
5962
|
-
* @param {String} str
|
|
5963
|
-
* @return {Number}
|
|
5964
|
-
* @api private
|
|
5965
|
-
*/
|
|
5966
|
-
|
|
5967
|
-
function parse(str) {
|
|
5968
|
-
str = String(str);
|
|
5969
|
-
if (str.length > 100) {
|
|
5970
|
-
return;
|
|
5971
|
-
}
|
|
5972
|
-
var match = /^((?:\d+)?\.?\d+) *(milliseconds?|msecs?|ms|seconds?|secs?|s|minutes?|mins?|m|hours?|hrs?|h|days?|d|years?|yrs?|y)?$/i.exec(
|
|
5973
|
-
str
|
|
5974
|
-
);
|
|
5975
|
-
if (!match) {
|
|
5976
|
-
return;
|
|
5977
|
-
}
|
|
5978
|
-
var n = parseFloat(match[1]);
|
|
5979
|
-
var type = (match[2] || 'ms').toLowerCase();
|
|
5980
|
-
switch (type) {
|
|
5981
|
-
case 'years':
|
|
5982
|
-
case 'year':
|
|
5983
|
-
case 'yrs':
|
|
5984
|
-
case 'yr':
|
|
5985
|
-
case 'y':
|
|
5986
|
-
return n * y;
|
|
5987
|
-
case 'days':
|
|
5988
|
-
case 'day':
|
|
5989
|
-
case 'd':
|
|
5990
|
-
return n * d;
|
|
5991
|
-
case 'hours':
|
|
5992
|
-
case 'hour':
|
|
5993
|
-
case 'hrs':
|
|
5994
|
-
case 'hr':
|
|
5995
|
-
case 'h':
|
|
5996
|
-
return n * h;
|
|
5997
|
-
case 'minutes':
|
|
5998
|
-
case 'minute':
|
|
5999
|
-
case 'mins':
|
|
6000
|
-
case 'min':
|
|
6001
|
-
case 'm':
|
|
6002
|
-
return n * m;
|
|
6003
|
-
case 'seconds':
|
|
6004
|
-
case 'second':
|
|
6005
|
-
case 'secs':
|
|
6006
|
-
case 'sec':
|
|
6007
|
-
case 's':
|
|
6008
|
-
return n * s;
|
|
6009
|
-
case 'milliseconds':
|
|
6010
|
-
case 'millisecond':
|
|
6011
|
-
case 'msecs':
|
|
6012
|
-
case 'msec':
|
|
6013
|
-
case 'ms':
|
|
6014
|
-
return n;
|
|
6015
|
-
default:
|
|
6016
|
-
return undefined;
|
|
6017
|
-
}
|
|
6018
|
-
}
|
|
6019
|
-
|
|
6020
|
-
/**
|
|
6021
|
-
* Short format for `ms`.
|
|
6022
|
-
*
|
|
6023
|
-
* @param {Number} ms
|
|
6024
|
-
* @return {String}
|
|
6025
|
-
* @api private
|
|
6026
|
-
*/
|
|
6027
|
-
|
|
6028
|
-
function fmtShort(ms) {
|
|
6029
|
-
if (ms >= d) {
|
|
6030
|
-
return Math.round(ms / d) + 'd';
|
|
6031
|
-
}
|
|
6032
|
-
if (ms >= h) {
|
|
6033
|
-
return Math.round(ms / h) + 'h';
|
|
6034
|
-
}
|
|
6035
|
-
if (ms >= m) {
|
|
6036
|
-
return Math.round(ms / m) + 'm';
|
|
6037
|
-
}
|
|
6038
|
-
if (ms >= s) {
|
|
6039
|
-
return Math.round(ms / s) + 's';
|
|
6040
|
-
}
|
|
6041
|
-
return ms + 'ms';
|
|
6042
|
-
}
|
|
6043
|
-
|
|
6044
|
-
/**
|
|
6045
|
-
* Long format for `ms`.
|
|
6046
|
-
*
|
|
6047
|
-
* @param {Number} ms
|
|
6048
|
-
* @return {String}
|
|
6049
|
-
* @api private
|
|
6050
|
-
*/
|
|
6051
|
-
|
|
6052
|
-
function fmtLong(ms) {
|
|
6053
|
-
return plural(ms, d, 'day') ||
|
|
6054
|
-
plural(ms, h, 'hour') ||
|
|
6055
|
-
plural(ms, m, 'minute') ||
|
|
6056
|
-
plural(ms, s, 'second') ||
|
|
6057
|
-
ms + ' ms';
|
|
6058
|
-
}
|
|
6059
|
-
|
|
6060
|
-
/**
|
|
6061
|
-
* Pluralization helper.
|
|
6062
|
-
*/
|
|
6063
|
-
|
|
6064
|
-
function plural(ms, n, name) {
|
|
6065
|
-
if (ms < n) {
|
|
6066
|
-
return;
|
|
6067
|
-
}
|
|
6068
|
-
if (ms < n * 1.5) {
|
|
6069
|
-
return Math.floor(ms / n) + ' ' + name;
|
|
6070
|
-
}
|
|
6071
|
-
return Math.ceil(ms / n) + ' ' + name + 's';
|
|
6072
|
-
}
|
|
6073
|
-
|
|
6074
|
-
|
|
6075
6078
|
/***/ }),
|
|
6076
6079
|
|
|
6077
6080
|
/***/ "../node_modules/object-inspect/index.js":
|
|
@@ -6102,6 +6105,7 @@ var match = String.prototype.match;
|
|
|
6102
6105
|
var bigIntValueOf = typeof BigInt === 'function' ? BigInt.prototype.valueOf : null;
|
|
6103
6106
|
var gOPS = Object.getOwnPropertySymbols;
|
|
6104
6107
|
var symToString = typeof Symbol === 'function' && typeof Symbol.iterator === 'symbol' ? Symbol.prototype.toString : null;
|
|
6108
|
+
var hasShammedSymbols = typeof Symbol === 'function' && typeof Symbol.iterator === 'object';
|
|
6105
6109
|
var isEnumerable = Object.prototype.propertyIsEnumerable;
|
|
6106
6110
|
|
|
6107
6111
|
var gPO = (typeof Reflect === 'function' ? Reflect.getPrototypeOf : Object.getPrototypeOf) || (
|
|
@@ -6114,7 +6118,7 @@ var gPO = (typeof Reflect === 'function' ? Reflect.getPrototypeOf : Object.getPr
|
|
|
6114
6118
|
|
|
6115
6119
|
var inspectCustom = __webpack_require__(/*! ./util.inspect */ "../node_modules/object-inspect/util.inspect.js").custom;
|
|
6116
6120
|
var inspectSymbol = inspectCustom && isSymbol(inspectCustom) ? inspectCustom : null;
|
|
6117
|
-
var toStringTag = typeof Symbol === 'function' && typeof Symbol.toStringTag
|
|
6121
|
+
var toStringTag = typeof Symbol === 'function' && typeof Symbol.toStringTag !== 'undefined' ? Symbol.toStringTag : null;
|
|
6118
6122
|
|
|
6119
6123
|
module.exports = function inspect_(obj, options, depth, seen) {
|
|
6120
6124
|
var opts = options || {};
|
|
@@ -6131,8 +6135,8 @@ module.exports = function inspect_(obj, options, depth, seen) {
|
|
|
6131
6135
|
throw new TypeError('option "maxStringLength", if provided, must be a positive integer, Infinity, or `null`');
|
|
6132
6136
|
}
|
|
6133
6137
|
var customInspect = has(opts, 'customInspect') ? opts.customInspect : true;
|
|
6134
|
-
if (typeof customInspect !== 'boolean') {
|
|
6135
|
-
throw new TypeError('option "customInspect", if provided, must be `true` or `
|
|
6138
|
+
if (typeof customInspect !== 'boolean' && customInspect !== 'symbol') {
|
|
6139
|
+
throw new TypeError('option "customInspect", if provided, must be `true`, `false`, or `\'symbol\'`');
|
|
6136
6140
|
}
|
|
6137
6141
|
|
|
6138
6142
|
if (
|
|
@@ -6204,8 +6208,8 @@ module.exports = function inspect_(obj, options, depth, seen) {
|
|
|
6204
6208
|
return '[Function' + (name ? ': ' + name : ' (anonymous)') + ']' + (keys.length > 0 ? ' { ' + keys.join(', ') + ' }' : '');
|
|
6205
6209
|
}
|
|
6206
6210
|
if (isSymbol(obj)) {
|
|
6207
|
-
var symString = symToString.call(obj);
|
|
6208
|
-
return typeof obj === 'object' ? markBoxed(symString) : symString;
|
|
6211
|
+
var symString = hasShammedSymbols ? String(obj).replace(/^(Symbol\(.*\))_[^)]*$/, '$1') : symToString.call(obj);
|
|
6212
|
+
return typeof obj === 'object' && !hasShammedSymbols ? markBoxed(symString) : symString;
|
|
6209
6213
|
}
|
|
6210
6214
|
if (isElement(obj)) {
|
|
6211
6215
|
var s = '<' + String(obj.nodeName).toLowerCase();
|
|
@@ -6234,7 +6238,7 @@ module.exports = function inspect_(obj, options, depth, seen) {
|
|
|
6234
6238
|
if (typeof obj === 'object' && customInspect) {
|
|
6235
6239
|
if (inspectSymbol && typeof obj[inspectSymbol] === 'function') {
|
|
6236
6240
|
return obj[inspectSymbol]();
|
|
6237
|
-
} else if (typeof obj.inspect === 'function') {
|
|
6241
|
+
} else if (customInspect !== 'symbol' && typeof obj.inspect === 'function') {
|
|
6238
6242
|
return obj.inspect();
|
|
6239
6243
|
}
|
|
6240
6244
|
}
|
|
@@ -6308,6 +6312,9 @@ function isBoolean(obj) { return toStr(obj) === '[object Boolean]' && (!toString
|
|
|
6308
6312
|
|
|
6309
6313
|
// Symbol and BigInt do have Symbol.toStringTag by spec, so that can't be used to eliminate false positives
|
|
6310
6314
|
function isSymbol(obj) {
|
|
6315
|
+
if (hasShammedSymbols) {
|
|
6316
|
+
return obj && typeof obj === 'object' && obj instanceof Symbol;
|
|
6317
|
+
}
|
|
6311
6318
|
if (typeof obj === 'symbol') {
|
|
6312
6319
|
return true;
|
|
6313
6320
|
}
|
|
@@ -6515,17 +6522,28 @@ function arrObjKeys(obj, inspect) {
|
|
|
6515
6522
|
xs[i] = has(obj, i) ? inspect(obj[i], obj) : '';
|
|
6516
6523
|
}
|
|
6517
6524
|
}
|
|
6525
|
+
var syms = typeof gOPS === 'function' ? gOPS(obj) : [];
|
|
6526
|
+
var symMap;
|
|
6527
|
+
if (hasShammedSymbols) {
|
|
6528
|
+
symMap = {};
|
|
6529
|
+
for (var k = 0; k < syms.length; k++) {
|
|
6530
|
+
symMap['$' + syms[k]] = syms[k];
|
|
6531
|
+
}
|
|
6532
|
+
}
|
|
6533
|
+
|
|
6518
6534
|
for (var key in obj) { // eslint-disable-line no-restricted-syntax
|
|
6519
6535
|
if (!has(obj, key)) { continue; } // eslint-disable-line no-restricted-syntax, no-continue
|
|
6520
6536
|
if (isArr && String(Number(key)) === key && key < obj.length) { continue; } // eslint-disable-line no-restricted-syntax, no-continue
|
|
6521
|
-
if (
|
|
6537
|
+
if (hasShammedSymbols && symMap['$' + key] instanceof Symbol) {
|
|
6538
|
+
// this is to prevent shammed Symbols, which are stored as strings, from being included in the string key section
|
|
6539
|
+
continue; // eslint-disable-line no-restricted-syntax, no-continue
|
|
6540
|
+
} else if ((/[^\w$]/).test(key)) {
|
|
6522
6541
|
xs.push(inspect(key, obj) + ': ' + inspect(obj[key], obj));
|
|
6523
6542
|
} else {
|
|
6524
6543
|
xs.push(key + ': ' + inspect(obj[key], obj));
|
|
6525
6544
|
}
|
|
6526
6545
|
}
|
|
6527
6546
|
if (typeof gOPS === 'function') {
|
|
6528
|
-
var syms = gOPS(obj);
|
|
6529
6547
|
for (var j = 0; j < syms.length; j++) {
|
|
6530
6548
|
if (isEnumerable.call(obj, syms[j])) {
|
|
6531
6549
|
xs.push('[' + inspect(syms[j]) + ']: ' + inspect(obj[syms[j]], obj));
|
|
@@ -8797,9 +8815,10 @@ const references = (http, params) => {
|
|
|
8797
8815
|
const spaceId = params.spaceId,
|
|
8798
8816
|
environmentId = params.environmentId,
|
|
8799
8817
|
entryId = params.entryId,
|
|
8800
|
-
|
|
8801
|
-
|
|
8802
|
-
|
|
8818
|
+
maxDepth = params.maxDepth,
|
|
8819
|
+
include = params.include;
|
|
8820
|
+
const level = include || maxDepth || 2;
|
|
8821
|
+
return _raw__WEBPACK_IMPORTED_MODULE_1__["get"](http, `/spaces/${spaceId}/environments/${environmentId}/entries/${entryId}/references?include=${level}`);
|
|
8803
8822
|
};
|
|
8804
8823
|
|
|
8805
8824
|
/***/ }),
|
|
@@ -10571,6 +10590,19 @@ class RestAdapter {
|
|
|
10571
10590
|
|
|
10572
10591
|
}
|
|
10573
10592
|
|
|
10593
|
+
/***/ }),
|
|
10594
|
+
|
|
10595
|
+
/***/ "./common-types.ts":
|
|
10596
|
+
/*!*************************!*\
|
|
10597
|
+
!*** ./common-types.ts ***!
|
|
10598
|
+
\*************************/
|
|
10599
|
+
/*! no exports provided */
|
|
10600
|
+
/***/ (function(module, __webpack_exports__, __webpack_require__) {
|
|
10601
|
+
|
|
10602
|
+
"use strict";
|
|
10603
|
+
__webpack_require__.r(__webpack_exports__);
|
|
10604
|
+
|
|
10605
|
+
|
|
10574
10606
|
/***/ }),
|
|
10575
10607
|
|
|
10576
10608
|
/***/ "./common-utils.ts":
|
|
@@ -10971,7 +11003,6 @@ const SidebarWidgetTypes = {
|
|
|
10971
11003
|
VERSIONS: 'versions-widget',
|
|
10972
11004
|
INFO_PANEL: 'info-panel',
|
|
10973
11005
|
JOBS: 'jobs-widget',
|
|
10974
|
-
TASKS: 'content-workflows-tasks-widget',
|
|
10975
11006
|
COMMENTS_PANEL: 'comments-panel'
|
|
10976
11007
|
};
|
|
10977
11008
|
const Publication = {
|
|
@@ -10986,12 +11017,6 @@ const Releases = {
|
|
|
10986
11017
|
name: 'Release',
|
|
10987
11018
|
description: 'Built-in - View release, add to it, etc.'
|
|
10988
11019
|
};
|
|
10989
|
-
const Tasks = {
|
|
10990
|
-
widgetId: SidebarWidgetTypes.TASKS,
|
|
10991
|
-
widgetNamespace: _types__WEBPACK_IMPORTED_MODULE_0__["WidgetNamespace"].SIDEBAR_BUILTIN,
|
|
10992
|
-
name: 'Tasks',
|
|
10993
|
-
description: 'Built-in - Assign tasks to be completed before publishing. Currently only supported for master environment.'
|
|
10994
|
-
};
|
|
10995
11020
|
const ContentPreview = {
|
|
10996
11021
|
widgetId: SidebarWidgetTypes.CONTENT_PREVIEW,
|
|
10997
11022
|
widgetNamespace: _types__WEBPACK_IMPORTED_MODULE_0__["WidgetNamespace"].SIDEBAR_BUILTIN,
|
|
@@ -11022,7 +11047,7 @@ const Users = {
|
|
|
11022
11047
|
name: 'Users',
|
|
11023
11048
|
description: 'Built-in - Displays users on the same entry.'
|
|
11024
11049
|
};
|
|
11025
|
-
const SidebarEntryConfiguration = [Publication, Releases,
|
|
11050
|
+
const SidebarEntryConfiguration = [Publication, Releases, ContentPreview, Links, Translation, Versions, Users];
|
|
11026
11051
|
const SidebarAssetConfiguration = [Publication, Releases, Links, Translation, Users];
|
|
11027
11052
|
|
|
11028
11053
|
/***/ }),
|
|
@@ -11087,7 +11112,8 @@ __webpack_require__.r(__webpack_exports__);
|
|
|
11087
11112
|
/* harmony import */ var _adapters_REST_rest_adapter__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! ./adapters/REST/rest-adapter */ "./adapters/REST/rest-adapter.ts");
|
|
11088
11113
|
/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "RestAdapter", function() { return _adapters_REST_rest_adapter__WEBPACK_IMPORTED_MODULE_7__["RestAdapter"]; });
|
|
11089
11114
|
|
|
11090
|
-
|
|
11115
|
+
/* harmony import */ var _export_types__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(/*! ./export-types */ "./export-types.ts");
|
|
11116
|
+
/* empty/unused harmony star reexport */function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); if (enumerableOnly) { symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; }); } keys.push.apply(keys, symbols); } return keys; }
|
|
11091
11117
|
|
|
11092
11118
|
function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i] != null ? arguments[i] : {}; if (i % 2) { ownKeys(Object(source), true).forEach(function (key) { _defineProperty(target, key, source[key]); }); } else if (Object.getOwnPropertyDescriptors) { Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)); } else { ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } } return target; }
|
|
11093
11119
|
|
|
@@ -11109,10 +11135,11 @@ function _defineProperty(obj, key, value) { if (key in obj) { Object.definePrope
|
|
|
11109
11135
|
|
|
11110
11136
|
|
|
11111
11137
|
|
|
11138
|
+
|
|
11112
11139
|
function createClient(params, opts = {}) {
|
|
11113
11140
|
const sdkMain = opts.type === 'plain' ? 'contentful-management-plain.js' : 'contentful-management.js';
|
|
11114
11141
|
const userAgent = Object(contentful_sdk_core__WEBPACK_IMPORTED_MODULE_0__["getUserAgentHeader"])( // @ts-expect-error
|
|
11115
|
-
`${sdkMain}/${"7.45.
|
|
11142
|
+
`${sdkMain}/${"7.45.6"}`, params.application, params.integration, params.feature);
|
|
11116
11143
|
const adapter = Object(_create_adapter__WEBPACK_IMPORTED_MODULE_1__["createAdapter"])(params); // Parameters<?> and ReturnType<?> only return the types of the last overload
|
|
11117
11144
|
// https://github.com/microsoft/TypeScript/issues/26591
|
|
11118
11145
|
// @ts-expect-error
|
|
@@ -12285,7 +12312,7 @@ function createEntryApi(makeRequest) {
|
|
|
12285
12312
|
spaceId: raw.sys.space.sys.id,
|
|
12286
12313
|
environmentId: raw.sys.environment.sys.id,
|
|
12287
12314
|
entryId: raw.sys.id,
|
|
12288
|
-
maxDepth: options === null || options === void 0 ? void 0 : options.maxDepth
|
|
12315
|
+
maxDepth: (options === null || options === void 0 ? void 0 : options.include) || (options === null || options === void 0 ? void 0 : options.maxDepth)
|
|
12289
12316
|
}
|
|
12290
12317
|
}).then(response => wrapEntryCollection(makeRequest, response));
|
|
12291
12318
|
}
|
|
@@ -13090,7 +13117,8 @@ function createEnvironmentApi(makeRequest) {
|
|
|
13090
13117
|
/**
|
|
13091
13118
|
* Get entry references
|
|
13092
13119
|
* @param entryId - Entry ID
|
|
13093
|
-
* @param {Object} options.
|
|
13120
|
+
* @param {Object} options.include - Level of the entry descendants from 1 up to 10 maximum
|
|
13121
|
+
* @param {Object} options.maxDepth - alias for `include`. Deprecated, please use `include`
|
|
13094
13122
|
* @returns Promise of Entry references
|
|
13095
13123
|
* @example ```javascript
|
|
13096
13124
|
* const contentful = require('contentful-management');
|
|
@@ -13102,10 +13130,10 @@ function createEnvironmentApi(makeRequest) {
|
|
|
13102
13130
|
* // Get entry references
|
|
13103
13131
|
* client.getSpace('<space_id>')
|
|
13104
13132
|
* .then((space) => space.getEnvironment('<environment_id>'))
|
|
13105
|
-
* .then((environment) => environment.getEntryReferences('<entry_id>', {
|
|
13133
|
+
* .then((environment) => environment.getEntryReferences('<entry_id>', {include: number}))
|
|
13106
13134
|
* .then((entry) => console.log(entry.includes))
|
|
13107
13135
|
* // or
|
|
13108
|
-
* .then((environment) => environment.getEntry('<entry_id>')).then((entry) => entry.references({
|
|
13136
|
+
* .then((environment) => environment.getEntry('<entry_id>')).then((entry) => entry.references({include: number}))
|
|
13109
13137
|
* .catch(console.error)
|
|
13110
13138
|
* ```
|
|
13111
13139
|
*/
|
|
@@ -13118,7 +13146,11 @@ function createEnvironmentApi(makeRequest) {
|
|
|
13118
13146
|
spaceId: raw.sys.space.sys.id,
|
|
13119
13147
|
environmentId: raw.sys.id,
|
|
13120
13148
|
entryId: entryId,
|
|
13121
|
-
|
|
13149
|
+
|
|
13150
|
+
/**
|
|
13151
|
+
* @deprecated use `include` instead
|
|
13152
|
+
*/
|
|
13153
|
+
maxDepth: (options === null || options === void 0 ? void 0 : options.include) || (options === null || options === void 0 ? void 0 : options.maxDepth)
|
|
13122
13154
|
}
|
|
13123
13155
|
}).then(response => wrapEntryCollection(makeRequest, response));
|
|
13124
13156
|
},
|
|
@@ -16432,13 +16464,15 @@ function createSpaceApi(makeRequest) {
|
|
|
16432
16464
|
* }
|
|
16433
16465
|
* },
|
|
16434
16466
|
* environment: {
|
|
16435
|
-
*
|
|
16436
|
-
*
|
|
16437
|
-
*
|
|
16467
|
+
* sys: {
|
|
16468
|
+
* type: 'Link',
|
|
16469
|
+
* linkType: 'Environment',
|
|
16470
|
+
* id: '<environment_id>'
|
|
16471
|
+
* }
|
|
16438
16472
|
* },
|
|
16439
16473
|
* action: 'publish',
|
|
16440
16474
|
* scheduledFor: {
|
|
16441
|
-
*
|
|
16475
|
+
* datetime: <ISO_date_string>,
|
|
16442
16476
|
* timezone: 'Europe/Berlin'
|
|
16443
16477
|
* }
|
|
16444
16478
|
* }))
|
|
@@ -16483,13 +16517,15 @@ function createSpaceApi(makeRequest) {
|
|
|
16483
16517
|
* }
|
|
16484
16518
|
* },
|
|
16485
16519
|
* environment: {
|
|
16486
|
-
*
|
|
16487
|
-
*
|
|
16488
|
-
*
|
|
16520
|
+
* sys: {
|
|
16521
|
+
* type: 'Link',
|
|
16522
|
+
* linkType: 'Environment',
|
|
16523
|
+
* id: '<environment_id>'
|
|
16524
|
+
* }
|
|
16489
16525
|
* },
|
|
16490
16526
|
* action: 'publish',
|
|
16491
16527
|
* scheduledFor: {
|
|
16492
|
-
*
|
|
16528
|
+
* datetime: <ISO_date_string>,
|
|
16493
16529
|
* timezone: 'Europe/Berlin'
|
|
16494
16530
|
* }
|
|
16495
16531
|
* })
|
|
@@ -18719,13 +18755,15 @@ function getInstanceMethods(makeRequest) {
|
|
|
18719
18755
|
* }
|
|
18720
18756
|
* },
|
|
18721
18757
|
* environment: {
|
|
18722
|
-
*
|
|
18723
|
-
*
|
|
18724
|
-
*
|
|
18758
|
+
* sys: {
|
|
18759
|
+
* type: 'Link',
|
|
18760
|
+
* linkType: 'Environment',
|
|
18761
|
+
* id: '<environment_id>'
|
|
18762
|
+
* }
|
|
18725
18763
|
* },
|
|
18726
18764
|
* action: 'publish',
|
|
18727
18765
|
* scheduledFor: {
|
|
18728
|
-
*
|
|
18766
|
+
* datetime: <ISO_date_string>,
|
|
18729
18767
|
* timezone: 'Europe/Berlin'
|
|
18730
18768
|
* }
|
|
18731
18769
|
* })
|
|
@@ -18768,13 +18806,15 @@ function getInstanceMethods(makeRequest) {
|
|
|
18768
18806
|
* }
|
|
18769
18807
|
* },
|
|
18770
18808
|
* environment: {
|
|
18771
|
-
*
|
|
18772
|
-
*
|
|
18773
|
-
*
|
|
18809
|
+
* sys: {
|
|
18810
|
+
* type: 'Link',
|
|
18811
|
+
* linkType: 'Environment',
|
|
18812
|
+
* id: '<environment_id>'
|
|
18813
|
+
* }
|
|
18774
18814
|
* },
|
|
18775
18815
|
* action: 'publish',
|
|
18776
18816
|
* scheduledFor: {
|
|
18777
|
-
*
|
|
18817
|
+
* datetime: <ISO_date_string>,
|
|
18778
18818
|
* timezone: 'Europe/Berlin'
|
|
18779
18819
|
* }
|
|
18780
18820
|
* })
|
|
@@ -19640,6 +19680,21 @@ function wrapWebhook(makeRequest, data) {
|
|
|
19640
19680
|
|
|
19641
19681
|
const wrapWebhookCollection = Object(_common_utils__WEBPACK_IMPORTED_MODULE_2__["wrapCollection"])(wrapWebhook);
|
|
19642
19682
|
|
|
19683
|
+
/***/ }),
|
|
19684
|
+
|
|
19685
|
+
/***/ "./export-types.ts":
|
|
19686
|
+
/*!*************************!*\
|
|
19687
|
+
!*** ./export-types.ts ***!
|
|
19688
|
+
\*************************/
|
|
19689
|
+
/*! no exports provided */
|
|
19690
|
+
/***/ (function(module, __webpack_exports__, __webpack_require__) {
|
|
19691
|
+
|
|
19692
|
+
"use strict";
|
|
19693
|
+
__webpack_require__.r(__webpack_exports__);
|
|
19694
|
+
/* harmony import */ var _common_types__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./common-types */ "./common-types.ts");
|
|
19695
|
+
/* empty/unused harmony star reexport */
|
|
19696
|
+
|
|
19697
|
+
|
|
19643
19698
|
/***/ }),
|
|
19644
19699
|
|
|
19645
19700
|
/***/ "./methods/action.ts":
|