glitch-javascript-sdk 3.1.1 → 3.1.3

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/cjs/index.js CHANGED
@@ -8,8 +8,6 @@ var require$$4 = require('https');
8
8
  var require$$0$1 = require('url');
9
9
  var require$$6 = require('fs');
10
10
  var require$$4$1 = require('assert');
11
- var require$$0$3 = require('tty');
12
- var require$$0$2 = require('os');
13
11
  var zlib = require('zlib');
14
12
  var EventEmitter = require('events');
15
13
 
@@ -14345,1197 +14343,13 @@ var getProxyForUrl_1 = getProxyForUrl;
14345
14343
 
14346
14344
  var followRedirects$1 = {exports: {}};
14347
14345
 
14348
- var src = {exports: {}};
14349
-
14350
- var node = {exports: {}};
14351
-
14352
- var hasFlag;
14353
- var hasRequiredHasFlag;
14354
-
14355
- function requireHasFlag () {
14356
- if (hasRequiredHasFlag) return hasFlag;
14357
- hasRequiredHasFlag = 1;
14358
- hasFlag = (flag, argv) => {
14359
- argv = argv || process.argv;
14360
- const prefix = flag.startsWith('-') ? '' : (flag.length === 1 ? '-' : '--');
14361
- const pos = argv.indexOf(prefix + flag);
14362
- const terminatorPos = argv.indexOf('--');
14363
- return pos !== -1 && (terminatorPos === -1 ? true : pos < terminatorPos);
14364
- };
14365
- return hasFlag;
14366
- }
14367
-
14368
- var supportsColor_1;
14369
- var hasRequiredSupportsColor;
14370
-
14371
- function requireSupportsColor () {
14372
- if (hasRequiredSupportsColor) return supportsColor_1;
14373
- hasRequiredSupportsColor = 1;
14374
- const os = require$$0$2;
14375
- const hasFlag = requireHasFlag();
14376
-
14377
- const env = process.env;
14378
-
14379
- let forceColor;
14380
- if (hasFlag('no-color') ||
14381
- hasFlag('no-colors') ||
14382
- hasFlag('color=false')) {
14383
- forceColor = false;
14384
- } else if (hasFlag('color') ||
14385
- hasFlag('colors') ||
14386
- hasFlag('color=true') ||
14387
- hasFlag('color=always')) {
14388
- forceColor = true;
14389
- }
14390
- if ('FORCE_COLOR' in env) {
14391
- forceColor = env.FORCE_COLOR.length === 0 || parseInt(env.FORCE_COLOR, 10) !== 0;
14392
- }
14393
-
14394
- function translateLevel(level) {
14395
- if (level === 0) {
14396
- return false;
14397
- }
14398
-
14399
- return {
14400
- level,
14401
- hasBasic: true,
14402
- has256: level >= 2,
14403
- has16m: level >= 3
14404
- };
14405
- }
14406
-
14407
- function supportsColor(stream) {
14408
- if (forceColor === false) {
14409
- return 0;
14410
- }
14411
-
14412
- if (hasFlag('color=16m') ||
14413
- hasFlag('color=full') ||
14414
- hasFlag('color=truecolor')) {
14415
- return 3;
14416
- }
14417
-
14418
- if (hasFlag('color=256')) {
14419
- return 2;
14420
- }
14421
-
14422
- if (stream && !stream.isTTY && forceColor !== true) {
14423
- return 0;
14424
- }
14425
-
14426
- const min = forceColor ? 1 : 0;
14427
-
14428
- if (process.platform === 'win32') {
14429
- // Node.js 7.5.0 is the first version of Node.js to include a patch to
14430
- // libuv that enables 256 color output on Windows. Anything earlier and it
14431
- // won't work. However, here we target Node.js 8 at minimum as it is an LTS
14432
- // release, and Node.js 7 is not. Windows 10 build 10586 is the first Windows
14433
- // release that supports 256 colors. Windows 10 build 14931 is the first release
14434
- // that supports 16m/TrueColor.
14435
- const osRelease = os.release().split('.');
14436
- if (
14437
- Number(process.versions.node.split('.')[0]) >= 8 &&
14438
- Number(osRelease[0]) >= 10 &&
14439
- Number(osRelease[2]) >= 10586
14440
- ) {
14441
- return Number(osRelease[2]) >= 14931 ? 3 : 2;
14442
- }
14443
-
14444
- return 1;
14445
- }
14446
-
14447
- if ('CI' in env) {
14448
- if (['TRAVIS', 'CIRCLECI', 'APPVEYOR', 'GITLAB_CI'].some(sign => sign in env) || env.CI_NAME === 'codeship') {
14449
- return 1;
14450
- }
14451
-
14452
- return min;
14453
- }
14454
-
14455
- if ('TEAMCITY_VERSION' in env) {
14456
- return /^(9\.(0*[1-9]\d*)\.|\d{2,}\.)/.test(env.TEAMCITY_VERSION) ? 1 : 0;
14457
- }
14458
-
14459
- if (env.COLORTERM === 'truecolor') {
14460
- return 3;
14461
- }
14462
-
14463
- if ('TERM_PROGRAM' in env) {
14464
- const version = parseInt((env.TERM_PROGRAM_VERSION || '').split('.')[0], 10);
14465
-
14466
- switch (env.TERM_PROGRAM) {
14467
- case 'iTerm.app':
14468
- return version >= 3 ? 3 : 2;
14469
- case 'Apple_Terminal':
14470
- return 2;
14471
- // No default
14472
- }
14473
- }
14474
-
14475
- if (/-256(color)?$/i.test(env.TERM)) {
14476
- return 2;
14477
- }
14478
-
14479
- if (/^screen|^xterm|^vt100|^vt220|^rxvt|color|ansi|cygwin|linux/i.test(env.TERM)) {
14480
- return 1;
14481
- }
14482
-
14483
- if ('COLORTERM' in env) {
14484
- return 1;
14485
- }
14486
-
14487
- if (env.TERM === 'dumb') {
14488
- return min;
14489
- }
14490
-
14491
- return min;
14492
- }
14493
-
14494
- function getSupportLevel(stream) {
14495
- const level = supportsColor(stream);
14496
- return translateLevel(level);
14497
- }
14498
-
14499
- supportsColor_1 = {
14500
- supportsColor: getSupportLevel,
14501
- stdout: getSupportLevel(process.stdout),
14502
- stderr: getSupportLevel(process.stderr)
14503
- };
14504
- return supportsColor_1;
14505
- }
14506
-
14507
- /**
14508
- * Helpers.
14509
- */
14510
-
14511
- var ms;
14512
- var hasRequiredMs;
14513
-
14514
- function requireMs () {
14515
- if (hasRequiredMs) return ms;
14516
- hasRequiredMs = 1;
14517
- var s = 1000;
14518
- var m = s * 60;
14519
- var h = m * 60;
14520
- var d = h * 24;
14521
- var w = d * 7;
14522
- var y = d * 365.25;
14523
-
14524
- /**
14525
- * Parse or format the given `val`.
14526
- *
14527
- * Options:
14528
- *
14529
- * - `long` verbose formatting [false]
14530
- *
14531
- * @param {String|Number} val
14532
- * @param {Object} [options]
14533
- * @throws {Error} throw an error if val is not a non-empty string or a number
14534
- * @return {String|Number}
14535
- * @api public
14536
- */
14537
-
14538
- ms = function(val, options) {
14539
- options = options || {};
14540
- var type = typeof val;
14541
- if (type === 'string' && val.length > 0) {
14542
- return parse(val);
14543
- } else if (type === 'number' && isFinite(val)) {
14544
- return options.long ? fmtLong(val) : fmtShort(val);
14545
- }
14546
- throw new Error(
14547
- 'val is not a non-empty string or a valid number. val=' +
14548
- JSON.stringify(val)
14549
- );
14550
- };
14551
-
14552
- /**
14553
- * Parse the given `str` and return milliseconds.
14554
- *
14555
- * @param {String} str
14556
- * @return {Number}
14557
- * @api private
14558
- */
14559
-
14560
- function parse(str) {
14561
- str = String(str);
14562
- if (str.length > 100) {
14563
- return;
14564
- }
14565
- 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(
14566
- str
14567
- );
14568
- if (!match) {
14569
- return;
14570
- }
14571
- var n = parseFloat(match[1]);
14572
- var type = (match[2] || 'ms').toLowerCase();
14573
- switch (type) {
14574
- case 'years':
14575
- case 'year':
14576
- case 'yrs':
14577
- case 'yr':
14578
- case 'y':
14579
- return n * y;
14580
- case 'weeks':
14581
- case 'week':
14582
- case 'w':
14583
- return n * w;
14584
- case 'days':
14585
- case 'day':
14586
- case 'd':
14587
- return n * d;
14588
- case 'hours':
14589
- case 'hour':
14590
- case 'hrs':
14591
- case 'hr':
14592
- case 'h':
14593
- return n * h;
14594
- case 'minutes':
14595
- case 'minute':
14596
- case 'mins':
14597
- case 'min':
14598
- case 'm':
14599
- return n * m;
14600
- case 'seconds':
14601
- case 'second':
14602
- case 'secs':
14603
- case 'sec':
14604
- case 's':
14605
- return n * s;
14606
- case 'milliseconds':
14607
- case 'millisecond':
14608
- case 'msecs':
14609
- case 'msec':
14610
- case 'ms':
14611
- return n;
14612
- default:
14613
- return undefined;
14614
- }
14615
- }
14616
-
14617
- /**
14618
- * Short format for `ms`.
14619
- *
14620
- * @param {Number} ms
14621
- * @return {String}
14622
- * @api private
14623
- */
14624
-
14625
- function fmtShort(ms) {
14626
- var msAbs = Math.abs(ms);
14627
- if (msAbs >= d) {
14628
- return Math.round(ms / d) + 'd';
14629
- }
14630
- if (msAbs >= h) {
14631
- return Math.round(ms / h) + 'h';
14632
- }
14633
- if (msAbs >= m) {
14634
- return Math.round(ms / m) + 'm';
14635
- }
14636
- if (msAbs >= s) {
14637
- return Math.round(ms / s) + 's';
14638
- }
14639
- return ms + 'ms';
14640
- }
14641
-
14642
- /**
14643
- * Long format for `ms`.
14644
- *
14645
- * @param {Number} ms
14646
- * @return {String}
14647
- * @api private
14648
- */
14649
-
14650
- function fmtLong(ms) {
14651
- var msAbs = Math.abs(ms);
14652
- if (msAbs >= d) {
14653
- return plural(ms, msAbs, d, 'day');
14654
- }
14655
- if (msAbs >= h) {
14656
- return plural(ms, msAbs, h, 'hour');
14657
- }
14658
- if (msAbs >= m) {
14659
- return plural(ms, msAbs, m, 'minute');
14660
- }
14661
- if (msAbs >= s) {
14662
- return plural(ms, msAbs, s, 'second');
14663
- }
14664
- return ms + ' ms';
14665
- }
14666
-
14667
- /**
14668
- * Pluralization helper.
14669
- */
14670
-
14671
- function plural(ms, msAbs, n, name) {
14672
- var isPlural = msAbs >= n * 1.5;
14673
- return Math.round(ms / n) + ' ' + name + (isPlural ? 's' : '');
14674
- }
14675
- return ms;
14676
- }
14677
-
14678
- var common;
14679
- var hasRequiredCommon;
14680
-
14681
- function requireCommon () {
14682
- if (hasRequiredCommon) return common;
14683
- hasRequiredCommon = 1;
14684
- /**
14685
- * This is the common logic for both the Node.js and web browser
14686
- * implementations of `debug()`.
14687
- */
14688
-
14689
- function setup(env) {
14690
- createDebug.debug = createDebug;
14691
- createDebug.default = createDebug;
14692
- createDebug.coerce = coerce;
14693
- createDebug.disable = disable;
14694
- createDebug.enable = enable;
14695
- createDebug.enabled = enabled;
14696
- createDebug.humanize = requireMs();
14697
- createDebug.destroy = destroy;
14698
-
14699
- Object.keys(env).forEach(key => {
14700
- createDebug[key] = env[key];
14701
- });
14702
-
14703
- /**
14704
- * The currently active debug mode names, and names to skip.
14705
- */
14706
-
14707
- createDebug.names = [];
14708
- createDebug.skips = [];
14709
-
14710
- /**
14711
- * Map of special "%n" handling functions, for the debug "format" argument.
14712
- *
14713
- * Valid key names are a single, lower or upper-case letter, i.e. "n" and "N".
14714
- */
14715
- createDebug.formatters = {};
14716
-
14717
- /**
14718
- * Selects a color for a debug namespace
14719
- * @param {String} namespace The namespace string for the debug instance to be colored
14720
- * @return {Number|String} An ANSI color code for the given namespace
14721
- * @api private
14722
- */
14723
- function selectColor(namespace) {
14724
- let hash = 0;
14725
-
14726
- for (let i = 0; i < namespace.length; i++) {
14727
- hash = ((hash << 5) - hash) + namespace.charCodeAt(i);
14728
- hash |= 0; // Convert to 32bit integer
14729
- }
14730
-
14731
- return createDebug.colors[Math.abs(hash) % createDebug.colors.length];
14732
- }
14733
- createDebug.selectColor = selectColor;
14734
-
14735
- /**
14736
- * Create a debugger with the given `namespace`.
14737
- *
14738
- * @param {String} namespace
14739
- * @return {Function}
14740
- * @api public
14741
- */
14742
- function createDebug(namespace) {
14743
- let prevTime;
14744
- let enableOverride = null;
14745
- let namespacesCache;
14746
- let enabledCache;
14747
-
14748
- function debug(...args) {
14749
- // Disabled?
14750
- if (!debug.enabled) {
14751
- return;
14752
- }
14753
-
14754
- const self = debug;
14755
-
14756
- // Set `diff` timestamp
14757
- const curr = Number(new Date());
14758
- const ms = curr - (prevTime || curr);
14759
- self.diff = ms;
14760
- self.prev = prevTime;
14761
- self.curr = curr;
14762
- prevTime = curr;
14763
-
14764
- args[0] = createDebug.coerce(args[0]);
14765
-
14766
- if (typeof args[0] !== 'string') {
14767
- // Anything else let's inspect with %O
14768
- args.unshift('%O');
14769
- }
14770
-
14771
- // Apply any `formatters` transformations
14772
- let index = 0;
14773
- args[0] = args[0].replace(/%([a-zA-Z%])/g, (match, format) => {
14774
- // If we encounter an escaped % then don't increase the array index
14775
- if (match === '%%') {
14776
- return '%';
14777
- }
14778
- index++;
14779
- const formatter = createDebug.formatters[format];
14780
- if (typeof formatter === 'function') {
14781
- const val = args[index];
14782
- match = formatter.call(self, val);
14783
-
14784
- // Now we need to remove `args[index]` since it's inlined in the `format`
14785
- args.splice(index, 1);
14786
- index--;
14787
- }
14788
- return match;
14789
- });
14790
-
14791
- // Apply env-specific formatting (colors, etc.)
14792
- createDebug.formatArgs.call(self, args);
14793
-
14794
- const logFn = self.log || createDebug.log;
14795
- logFn.apply(self, args);
14796
- }
14797
-
14798
- debug.namespace = namespace;
14799
- debug.useColors = createDebug.useColors();
14800
- debug.color = createDebug.selectColor(namespace);
14801
- debug.extend = extend;
14802
- debug.destroy = createDebug.destroy; // XXX Temporary. Will be removed in the next major release.
14803
-
14804
- Object.defineProperty(debug, 'enabled', {
14805
- enumerable: true,
14806
- configurable: false,
14807
- get: () => {
14808
- if (enableOverride !== null) {
14809
- return enableOverride;
14810
- }
14811
- if (namespacesCache !== createDebug.namespaces) {
14812
- namespacesCache = createDebug.namespaces;
14813
- enabledCache = createDebug.enabled(namespace);
14814
- }
14815
-
14816
- return enabledCache;
14817
- },
14818
- set: v => {
14819
- enableOverride = v;
14820
- }
14821
- });
14822
-
14823
- // Env-specific initialization logic for debug instances
14824
- if (typeof createDebug.init === 'function') {
14825
- createDebug.init(debug);
14826
- }
14827
-
14828
- return debug;
14829
- }
14830
-
14831
- function extend(namespace, delimiter) {
14832
- const newDebug = createDebug(this.namespace + (typeof delimiter === 'undefined' ? ':' : delimiter) + namespace);
14833
- newDebug.log = this.log;
14834
- return newDebug;
14835
- }
14836
-
14837
- /**
14838
- * Enables a debug mode by namespaces. This can include modes
14839
- * separated by a colon and wildcards.
14840
- *
14841
- * @param {String} namespaces
14842
- * @api public
14843
- */
14844
- function enable(namespaces) {
14845
- createDebug.save(namespaces);
14846
- createDebug.namespaces = namespaces;
14847
-
14848
- createDebug.names = [];
14849
- createDebug.skips = [];
14850
-
14851
- let i;
14852
- const split = (typeof namespaces === 'string' ? namespaces : '').split(/[\s,]+/);
14853
- const len = split.length;
14854
-
14855
- for (i = 0; i < len; i++) {
14856
- if (!split[i]) {
14857
- // ignore empty strings
14858
- continue;
14859
- }
14860
-
14861
- namespaces = split[i].replace(/\*/g, '.*?');
14862
-
14863
- if (namespaces[0] === '-') {
14864
- createDebug.skips.push(new RegExp('^' + namespaces.slice(1) + '$'));
14865
- } else {
14866
- createDebug.names.push(new RegExp('^' + namespaces + '$'));
14867
- }
14868
- }
14869
- }
14870
-
14871
- /**
14872
- * Disable debug output.
14873
- *
14874
- * @return {String} namespaces
14875
- * @api public
14876
- */
14877
- function disable() {
14878
- const namespaces = [
14879
- ...createDebug.names.map(toNamespace),
14880
- ...createDebug.skips.map(toNamespace).map(namespace => '-' + namespace)
14881
- ].join(',');
14882
- createDebug.enable('');
14883
- return namespaces;
14884
- }
14885
-
14886
- /**
14887
- * Returns true if the given mode name is enabled, false otherwise.
14888
- *
14889
- * @param {String} name
14890
- * @return {Boolean}
14891
- * @api public
14892
- */
14893
- function enabled(name) {
14894
- if (name[name.length - 1] === '*') {
14895
- return true;
14896
- }
14897
-
14898
- let i;
14899
- let len;
14900
-
14901
- for (i = 0, len = createDebug.skips.length; i < len; i++) {
14902
- if (createDebug.skips[i].test(name)) {
14903
- return false;
14904
- }
14905
- }
14906
-
14907
- for (i = 0, len = createDebug.names.length; i < len; i++) {
14908
- if (createDebug.names[i].test(name)) {
14909
- return true;
14910
- }
14911
- }
14912
-
14913
- return false;
14914
- }
14915
-
14916
- /**
14917
- * Convert regexp to namespace
14918
- *
14919
- * @param {RegExp} regxep
14920
- * @return {String} namespace
14921
- * @api private
14922
- */
14923
- function toNamespace(regexp) {
14924
- return regexp.toString()
14925
- .substring(2, regexp.toString().length - 2)
14926
- .replace(/\.\*\?$/, '*');
14927
- }
14928
-
14929
- /**
14930
- * Coerce `val`.
14931
- *
14932
- * @param {Mixed} val
14933
- * @return {Mixed}
14934
- * @api private
14935
- */
14936
- function coerce(val) {
14937
- if (val instanceof Error) {
14938
- return val.stack || val.message;
14939
- }
14940
- return val;
14941
- }
14942
-
14943
- /**
14944
- * XXX DO NOT USE. This is a temporary stub function.
14945
- * XXX It WILL be removed in the next major release.
14946
- */
14947
- function destroy() {
14948
- console.warn('Instance method `debug.destroy()` is deprecated and no longer does anything. It will be removed in the next major version of `debug`.');
14949
- }
14950
-
14951
- createDebug.enable(createDebug.load());
14952
-
14953
- return createDebug;
14954
- }
14955
-
14956
- common = setup;
14957
- return common;
14958
- }
14959
-
14960
- /**
14961
- * Module dependencies.
14962
- */
14963
-
14964
- var hasRequiredNode;
14965
-
14966
- function requireNode () {
14967
- if (hasRequiredNode) return node.exports;
14968
- hasRequiredNode = 1;
14969
- (function (module, exports) {
14970
- const tty = require$$0$3;
14971
- const util = require$$1;
14972
-
14973
- /**
14974
- * This is the Node.js implementation of `debug()`.
14975
- */
14976
-
14977
- exports.init = init;
14978
- exports.log = log;
14979
- exports.formatArgs = formatArgs;
14980
- exports.save = save;
14981
- exports.load = load;
14982
- exports.useColors = useColors;
14983
- exports.destroy = util.deprecate(
14984
- () => {},
14985
- 'Instance method `debug.destroy()` is deprecated and no longer does anything. It will be removed in the next major version of `debug`.'
14986
- );
14987
-
14988
- /**
14989
- * Colors.
14990
- */
14991
-
14992
- exports.colors = [6, 2, 3, 4, 5, 1];
14993
-
14994
- try {
14995
- // Optional dependency (as in, doesn't need to be installed, NOT like optionalDependencies in package.json)
14996
- // eslint-disable-next-line import/no-extraneous-dependencies
14997
- const supportsColor = requireSupportsColor();
14998
-
14999
- if (supportsColor && (supportsColor.stderr || supportsColor).level >= 2) {
15000
- exports.colors = [
15001
- 20,
15002
- 21,
15003
- 26,
15004
- 27,
15005
- 32,
15006
- 33,
15007
- 38,
15008
- 39,
15009
- 40,
15010
- 41,
15011
- 42,
15012
- 43,
15013
- 44,
15014
- 45,
15015
- 56,
15016
- 57,
15017
- 62,
15018
- 63,
15019
- 68,
15020
- 69,
15021
- 74,
15022
- 75,
15023
- 76,
15024
- 77,
15025
- 78,
15026
- 79,
15027
- 80,
15028
- 81,
15029
- 92,
15030
- 93,
15031
- 98,
15032
- 99,
15033
- 112,
15034
- 113,
15035
- 128,
15036
- 129,
15037
- 134,
15038
- 135,
15039
- 148,
15040
- 149,
15041
- 160,
15042
- 161,
15043
- 162,
15044
- 163,
15045
- 164,
15046
- 165,
15047
- 166,
15048
- 167,
15049
- 168,
15050
- 169,
15051
- 170,
15052
- 171,
15053
- 172,
15054
- 173,
15055
- 178,
15056
- 179,
15057
- 184,
15058
- 185,
15059
- 196,
15060
- 197,
15061
- 198,
15062
- 199,
15063
- 200,
15064
- 201,
15065
- 202,
15066
- 203,
15067
- 204,
15068
- 205,
15069
- 206,
15070
- 207,
15071
- 208,
15072
- 209,
15073
- 214,
15074
- 215,
15075
- 220,
15076
- 221
15077
- ];
15078
- }
15079
- } catch (error) {
15080
- // Swallow - we only care if `supports-color` is available; it doesn't have to be.
15081
- }
15082
-
15083
- /**
15084
- * Build up the default `inspectOpts` object from the environment variables.
15085
- *
15086
- * $ DEBUG_COLORS=no DEBUG_DEPTH=10 DEBUG_SHOW_HIDDEN=enabled node script.js
15087
- */
15088
-
15089
- exports.inspectOpts = Object.keys(process.env).filter(key => {
15090
- return /^debug_/i.test(key);
15091
- }).reduce((obj, key) => {
15092
- // Camel-case
15093
- const prop = key
15094
- .substring(6)
15095
- .toLowerCase()
15096
- .replace(/_([a-z])/g, (_, k) => {
15097
- return k.toUpperCase();
15098
- });
15099
-
15100
- // Coerce string value into JS value
15101
- let val = process.env[key];
15102
- if (/^(yes|on|true|enabled)$/i.test(val)) {
15103
- val = true;
15104
- } else if (/^(no|off|false|disabled)$/i.test(val)) {
15105
- val = false;
15106
- } else if (val === 'null') {
15107
- val = null;
15108
- } else {
15109
- val = Number(val);
15110
- }
15111
-
15112
- obj[prop] = val;
15113
- return obj;
15114
- }, {});
15115
-
15116
- /**
15117
- * Is stdout a TTY? Colored output is enabled when `true`.
15118
- */
15119
-
15120
- function useColors() {
15121
- return 'colors' in exports.inspectOpts ?
15122
- Boolean(exports.inspectOpts.colors) :
15123
- tty.isatty(process.stderr.fd);
15124
- }
15125
-
15126
- /**
15127
- * Adds ANSI color escape codes if enabled.
15128
- *
15129
- * @api public
15130
- */
15131
-
15132
- function formatArgs(args) {
15133
- const {namespace: name, useColors} = this;
15134
-
15135
- if (useColors) {
15136
- const c = this.color;
15137
- const colorCode = '\u001B[3' + (c < 8 ? c : '8;5;' + c);
15138
- const prefix = ` ${colorCode};1m${name} \u001B[0m`;
15139
-
15140
- args[0] = prefix + args[0].split('\n').join('\n' + prefix);
15141
- args.push(colorCode + 'm+' + module.exports.humanize(this.diff) + '\u001B[0m');
15142
- } else {
15143
- args[0] = getDate() + name + ' ' + args[0];
15144
- }
15145
- }
15146
-
15147
- function getDate() {
15148
- if (exports.inspectOpts.hideDate) {
15149
- return '';
15150
- }
15151
- return new Date().toISOString() + ' ';
15152
- }
15153
-
15154
- /**
15155
- * Invokes `util.format()` with the specified arguments and writes to stderr.
15156
- */
15157
-
15158
- function log(...args) {
15159
- return process.stderr.write(util.format(...args) + '\n');
15160
- }
15161
-
15162
- /**
15163
- * Save `namespaces`.
15164
- *
15165
- * @param {String} namespaces
15166
- * @api private
15167
- */
15168
- function save(namespaces) {
15169
- if (namespaces) {
15170
- process.env.DEBUG = namespaces;
15171
- } else {
15172
- // If you set a process.env field to null or undefined, it gets cast to the
15173
- // string 'null' or 'undefined'. Just delete instead.
15174
- delete process.env.DEBUG;
15175
- }
15176
- }
15177
-
15178
- /**
15179
- * Load `namespaces`.
15180
- *
15181
- * @return {String} returns the previously persisted debug modes
15182
- * @api private
15183
- */
15184
-
15185
- function load() {
15186
- return process.env.DEBUG;
15187
- }
15188
-
15189
- /**
15190
- * Init logic for `debug` instances.
15191
- *
15192
- * Create a new `inspectOpts` object in case `useColors` is set
15193
- * differently for a particular `debug` instance.
15194
- */
15195
-
15196
- function init(debug) {
15197
- debug.inspectOpts = {};
15198
-
15199
- const keys = Object.keys(exports.inspectOpts);
15200
- for (let i = 0; i < keys.length; i++) {
15201
- debug.inspectOpts[keys[i]] = exports.inspectOpts[keys[i]];
15202
- }
15203
- }
15204
-
15205
- module.exports = requireCommon()(exports);
15206
-
15207
- const {formatters} = module.exports;
15208
-
15209
- /**
15210
- * Map %o to `util.inspect()`, all on a single line.
15211
- */
15212
-
15213
- formatters.o = function (v) {
15214
- this.inspectOpts.colors = this.useColors;
15215
- return util.inspect(v, this.inspectOpts)
15216
- .split('\n')
15217
- .map(str => str.trim())
15218
- .join(' ');
15219
- };
15220
-
15221
- /**
15222
- * Map %O to `util.inspect()`, allowing multiple lines if needed.
15223
- */
15224
-
15225
- formatters.O = function (v) {
15226
- this.inspectOpts.colors = this.useColors;
15227
- return util.inspect(v, this.inspectOpts);
15228
- };
15229
- } (node, node.exports));
15230
- return node.exports;
15231
- }
15232
-
15233
- var browser = {exports: {}};
15234
-
15235
- /* eslint-env browser */
15236
-
15237
- var hasRequiredBrowser;
15238
-
15239
- function requireBrowser () {
15240
- if (hasRequiredBrowser) return browser.exports;
15241
- hasRequiredBrowser = 1;
15242
- (function (module, exports) {
15243
- /**
15244
- * This is the web browser implementation of `debug()`.
15245
- */
15246
-
15247
- exports.formatArgs = formatArgs;
15248
- exports.save = save;
15249
- exports.load = load;
15250
- exports.useColors = useColors;
15251
- exports.storage = localstorage();
15252
- exports.destroy = (() => {
15253
- let warned = false;
15254
-
15255
- return () => {
15256
- if (!warned) {
15257
- warned = true;
15258
- console.warn('Instance method `debug.destroy()` is deprecated and no longer does anything. It will be removed in the next major version of `debug`.');
15259
- }
15260
- };
15261
- })();
15262
-
15263
- /**
15264
- * Colors.
15265
- */
15266
-
15267
- exports.colors = [
15268
- '#0000CC',
15269
- '#0000FF',
15270
- '#0033CC',
15271
- '#0033FF',
15272
- '#0066CC',
15273
- '#0066FF',
15274
- '#0099CC',
15275
- '#0099FF',
15276
- '#00CC00',
15277
- '#00CC33',
15278
- '#00CC66',
15279
- '#00CC99',
15280
- '#00CCCC',
15281
- '#00CCFF',
15282
- '#3300CC',
15283
- '#3300FF',
15284
- '#3333CC',
15285
- '#3333FF',
15286
- '#3366CC',
15287
- '#3366FF',
15288
- '#3399CC',
15289
- '#3399FF',
15290
- '#33CC00',
15291
- '#33CC33',
15292
- '#33CC66',
15293
- '#33CC99',
15294
- '#33CCCC',
15295
- '#33CCFF',
15296
- '#6600CC',
15297
- '#6600FF',
15298
- '#6633CC',
15299
- '#6633FF',
15300
- '#66CC00',
15301
- '#66CC33',
15302
- '#9900CC',
15303
- '#9900FF',
15304
- '#9933CC',
15305
- '#9933FF',
15306
- '#99CC00',
15307
- '#99CC33',
15308
- '#CC0000',
15309
- '#CC0033',
15310
- '#CC0066',
15311
- '#CC0099',
15312
- '#CC00CC',
15313
- '#CC00FF',
15314
- '#CC3300',
15315
- '#CC3333',
15316
- '#CC3366',
15317
- '#CC3399',
15318
- '#CC33CC',
15319
- '#CC33FF',
15320
- '#CC6600',
15321
- '#CC6633',
15322
- '#CC9900',
15323
- '#CC9933',
15324
- '#CCCC00',
15325
- '#CCCC33',
15326
- '#FF0000',
15327
- '#FF0033',
15328
- '#FF0066',
15329
- '#FF0099',
15330
- '#FF00CC',
15331
- '#FF00FF',
15332
- '#FF3300',
15333
- '#FF3333',
15334
- '#FF3366',
15335
- '#FF3399',
15336
- '#FF33CC',
15337
- '#FF33FF',
15338
- '#FF6600',
15339
- '#FF6633',
15340
- '#FF9900',
15341
- '#FF9933',
15342
- '#FFCC00',
15343
- '#FFCC33'
15344
- ];
15345
-
15346
- /**
15347
- * Currently only WebKit-based Web Inspectors, Firefox >= v31,
15348
- * and the Firebug extension (any Firefox version) are known
15349
- * to support "%c" CSS customizations.
15350
- *
15351
- * TODO: add a `localStorage` variable to explicitly enable/disable colors
15352
- */
15353
-
15354
- // eslint-disable-next-line complexity
15355
- function useColors() {
15356
- // NB: In an Electron preload script, document will be defined but not fully
15357
- // initialized. Since we know we're in Chrome, we'll just detect this case
15358
- // explicitly
15359
- if (typeof window !== 'undefined' && window.process && (window.process.type === 'renderer' || window.process.__nwjs)) {
15360
- return true;
15361
- }
15362
-
15363
- // Internet Explorer and Edge do not support colors.
15364
- if (typeof navigator !== 'undefined' && navigator.userAgent && navigator.userAgent.toLowerCase().match(/(edge|trident)\/(\d+)/)) {
15365
- return false;
15366
- }
15367
-
15368
- // Is webkit? http://stackoverflow.com/a/16459606/376773
15369
- // document is undefined in react-native: https://github.com/facebook/react-native/pull/1632
15370
- return (typeof document !== 'undefined' && document.documentElement && document.documentElement.style && document.documentElement.style.WebkitAppearance) ||
15371
- // Is firebug? http://stackoverflow.com/a/398120/376773
15372
- (typeof window !== 'undefined' && window.console && (window.console.firebug || (window.console.exception && window.console.table))) ||
15373
- // Is firefox >= v31?
15374
- // https://developer.mozilla.org/en-US/docs/Tools/Web_Console#Styling_messages
15375
- (typeof navigator !== 'undefined' && navigator.userAgent && navigator.userAgent.toLowerCase().match(/firefox\/(\d+)/) && parseInt(RegExp.$1, 10) >= 31) ||
15376
- // Double check webkit in userAgent just in case we are in a worker
15377
- (typeof navigator !== 'undefined' && navigator.userAgent && navigator.userAgent.toLowerCase().match(/applewebkit\/(\d+)/));
15378
- }
15379
-
15380
- /**
15381
- * Colorize log arguments if enabled.
15382
- *
15383
- * @api public
15384
- */
15385
-
15386
- function formatArgs(args) {
15387
- args[0] = (this.useColors ? '%c' : '') +
15388
- this.namespace +
15389
- (this.useColors ? ' %c' : ' ') +
15390
- args[0] +
15391
- (this.useColors ? '%c ' : ' ') +
15392
- '+' + module.exports.humanize(this.diff);
15393
-
15394
- if (!this.useColors) {
15395
- return;
15396
- }
15397
-
15398
- const c = 'color: ' + this.color;
15399
- args.splice(1, 0, c, 'color: inherit');
15400
-
15401
- // The final "%c" is somewhat tricky, because there could be other
15402
- // arguments passed either before or after the %c, so we need to
15403
- // figure out the correct index to insert the CSS into
15404
- let index = 0;
15405
- let lastC = 0;
15406
- args[0].replace(/%[a-zA-Z%]/g, match => {
15407
- if (match === '%%') {
15408
- return;
15409
- }
15410
- index++;
15411
- if (match === '%c') {
15412
- // We only are interested in the *last* %c
15413
- // (the user may have provided their own)
15414
- lastC = index;
15415
- }
15416
- });
15417
-
15418
- args.splice(lastC, 0, c);
15419
- }
15420
-
15421
- /**
15422
- * Invokes `console.debug()` when available.
15423
- * No-op when `console.debug` is not a "function".
15424
- * If `console.debug` is not available, falls back
15425
- * to `console.log`.
15426
- *
15427
- * @api public
15428
- */
15429
- exports.log = console.debug || console.log || (() => {});
15430
-
15431
- /**
15432
- * Save `namespaces`.
15433
- *
15434
- * @param {String} namespaces
15435
- * @api private
15436
- */
15437
- function save(namespaces) {
15438
- try {
15439
- if (namespaces) {
15440
- exports.storage.setItem('debug', namespaces);
15441
- } else {
15442
- exports.storage.removeItem('debug');
15443
- }
15444
- } catch (error) {
15445
- // Swallow
15446
- // XXX (@Qix-) should we be logging these?
15447
- }
15448
- }
15449
-
15450
- /**
15451
- * Load `namespaces`.
15452
- *
15453
- * @return {String} returns the previously persisted debug modes
15454
- * @api private
15455
- */
15456
- function load() {
15457
- let r;
15458
- try {
15459
- r = exports.storage.getItem('debug');
15460
- } catch (error) {
15461
- // Swallow
15462
- // XXX (@Qix-) should we be logging these?
15463
- }
15464
-
15465
- // If debug isn't set in LS, and we're in Electron, try to load $DEBUG
15466
- if (!r && typeof process !== 'undefined' && 'env' in process) {
15467
- r = process.env.DEBUG;
15468
- }
15469
-
15470
- return r;
15471
- }
15472
-
15473
- /**
15474
- * Localstorage attempts to return the localstorage.
15475
- *
15476
- * This is necessary because safari throws
15477
- * when a user disables cookies/localstorage
15478
- * and you attempt to access it.
15479
- *
15480
- * @return {LocalStorage}
15481
- * @api private
15482
- */
15483
-
15484
- function localstorage() {
15485
- try {
15486
- // TVMLKit (Apple TV JS Runtime) does not have a window object, just localStorage in the global context
15487
- // The Browser also has localStorage in the global context.
15488
- return localStorage;
15489
- } catch (error) {
15490
- // Swallow
15491
- // XXX (@Qix-) should we be logging these?
15492
- }
15493
- }
15494
-
15495
- module.exports = requireCommon()(exports);
15496
-
15497
- const {formatters} = module.exports;
15498
-
15499
- /**
15500
- * Map %j to `JSON.stringify()`, since no Web Inspectors do that by default.
15501
- */
15502
-
15503
- formatters.j = function (v) {
15504
- try {
15505
- return JSON.stringify(v);
15506
- } catch (error) {
15507
- return '[UnexpectedJSONParseError]: ' + error.message;
15508
- }
15509
- };
15510
- } (browser, browser.exports));
15511
- return browser.exports;
15512
- }
15513
-
15514
- /**
15515
- * Detect Electron renderer / nwjs process, which is node, but we should
15516
- * treat as a browser.
15517
- */
15518
-
15519
- var hasRequiredSrc;
15520
-
15521
- function requireSrc () {
15522
- if (hasRequiredSrc) return src.exports;
15523
- hasRequiredSrc = 1;
15524
- if (typeof process === 'undefined' || process.type === 'renderer' || process.browser === true || process.__nwjs) {
15525
- src.exports = requireBrowser();
15526
- } else {
15527
- src.exports = requireNode();
15528
- }
15529
- return src.exports;
15530
- }
15531
-
15532
14346
  var debug$1;
15533
14347
 
15534
14348
  var debug_1 = function () {
15535
14349
  if (!debug$1) {
15536
14350
  try {
15537
14351
  /* eslint global-require: off */
15538
- debug$1 = requireSrc()("follow-redirects");
14352
+ debug$1 = require("debug")("follow-redirects");
15539
14353
  }
15540
14354
  catch (error) { /* */ }
15541
14355
  if (typeof debug$1 !== "function") {
@@ -22578,9 +21392,10 @@ var Users = /** @class */ (function () {
22578
21392
  };
22579
21393
  /**
22580
21394
  * Share a library item to social media as User Generated Content (UGC).
21395
+ * This uses the player media share route, not the developer/scheduler post route.
22581
21396
  *
22582
21397
  * @param id The UUID of the UserMedia record.
22583
- * @param data { platform: string, title?: string, content: string }
21398
+ * @param data Player post payload, including platform/channel/schedule options.
22584
21399
  */
22585
21400
  Users.shareMedia = function (id, data) {
22586
21401
  return Requests.processRoute(UserRoutes.routes.shareMedia, data, { id: id });
@@ -25882,8 +24697,8 @@ var Titles = /** @class */ (function () {
25882
24697
  /**
25883
24698
  * Get the total earnings and playtime summary for a title.
25884
24699
  */
25885
- Titles.getDeveloperPayoutSummary = function (title_id) {
25886
- return Requests.processRoute(TitlesRoute.routes.developerPayoutSummary, {}, { title_id: title_id });
24700
+ Titles.getDeveloperPayoutSummary = function (title_id, params) {
24701
+ return Requests.processRoute(TitlesRoute.routes.developerPayoutSummary, {}, { title_id: title_id }, params);
25887
24702
  };
25888
24703
  /**
25889
24704
  * The Aegis Handshake: Verify if a player is allowed to play.