node-consul-service 1.0.75 → 1.0.77

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/index.cjs.js CHANGED
@@ -9,8 +9,6 @@ var require$$0$1 = require('url');
9
9
  var require$$6 = require('fs');
10
10
  var crypto = require('crypto');
11
11
  var require$$4$1 = require('assert');
12
- var require$$1$1 = require('tty');
13
- var require$$0$2 = require('os');
14
12
  var zlib = require('zlib');
15
13
  var events = require('events');
16
14
 
@@ -15537,1196 +15535,6 @@ var proxyFromEnv = /*@__PURE__*/getDefaultExportFromCjs(proxyFromEnvExports);
15537
15535
 
15538
15536
  var followRedirects$1 = {exports: {}};
15539
15537
 
15540
- var src = {exports: {}};
15541
-
15542
- var browser = {exports: {}};
15543
-
15544
- /**
15545
- * Helpers.
15546
- */
15547
-
15548
- var ms;
15549
- var hasRequiredMs;
15550
-
15551
- function requireMs () {
15552
- if (hasRequiredMs) return ms;
15553
- hasRequiredMs = 1;
15554
- var s = 1000;
15555
- var m = s * 60;
15556
- var h = m * 60;
15557
- var d = h * 24;
15558
- var w = d * 7;
15559
- var y = d * 365.25;
15560
-
15561
- /**
15562
- * Parse or format the given `val`.
15563
- *
15564
- * Options:
15565
- *
15566
- * - `long` verbose formatting [false]
15567
- *
15568
- * @param {String|Number} val
15569
- * @param {Object} [options]
15570
- * @throws {Error} throw an error if val is not a non-empty string or a number
15571
- * @return {String|Number}
15572
- * @api public
15573
- */
15574
-
15575
- ms = function (val, options) {
15576
- options = options || {};
15577
- var type = typeof val;
15578
- if (type === 'string' && val.length > 0) {
15579
- return parse(val);
15580
- } else if (type === 'number' && isFinite(val)) {
15581
- return options.long ? fmtLong(val) : fmtShort(val);
15582
- }
15583
- throw new Error(
15584
- 'val is not a non-empty string or a valid number. val=' +
15585
- JSON.stringify(val)
15586
- );
15587
- };
15588
-
15589
- /**
15590
- * Parse the given `str` and return milliseconds.
15591
- *
15592
- * @param {String} str
15593
- * @return {Number}
15594
- * @api private
15595
- */
15596
-
15597
- function parse(str) {
15598
- str = String(str);
15599
- if (str.length > 100) {
15600
- return;
15601
- }
15602
- 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(
15603
- str
15604
- );
15605
- if (!match) {
15606
- return;
15607
- }
15608
- var n = parseFloat(match[1]);
15609
- var type = (match[2] || 'ms').toLowerCase();
15610
- switch (type) {
15611
- case 'years':
15612
- case 'year':
15613
- case 'yrs':
15614
- case 'yr':
15615
- case 'y':
15616
- return n * y;
15617
- case 'weeks':
15618
- case 'week':
15619
- case 'w':
15620
- return n * w;
15621
- case 'days':
15622
- case 'day':
15623
- case 'd':
15624
- return n * d;
15625
- case 'hours':
15626
- case 'hour':
15627
- case 'hrs':
15628
- case 'hr':
15629
- case 'h':
15630
- return n * h;
15631
- case 'minutes':
15632
- case 'minute':
15633
- case 'mins':
15634
- case 'min':
15635
- case 'm':
15636
- return n * m;
15637
- case 'seconds':
15638
- case 'second':
15639
- case 'secs':
15640
- case 'sec':
15641
- case 's':
15642
- return n * s;
15643
- case 'milliseconds':
15644
- case 'millisecond':
15645
- case 'msecs':
15646
- case 'msec':
15647
- case 'ms':
15648
- return n;
15649
- default:
15650
- return undefined;
15651
- }
15652
- }
15653
-
15654
- /**
15655
- * Short format for `ms`.
15656
- *
15657
- * @param {Number} ms
15658
- * @return {String}
15659
- * @api private
15660
- */
15661
-
15662
- function fmtShort(ms) {
15663
- var msAbs = Math.abs(ms);
15664
- if (msAbs >= d) {
15665
- return Math.round(ms / d) + 'd';
15666
- }
15667
- if (msAbs >= h) {
15668
- return Math.round(ms / h) + 'h';
15669
- }
15670
- if (msAbs >= m) {
15671
- return Math.round(ms / m) + 'm';
15672
- }
15673
- if (msAbs >= s) {
15674
- return Math.round(ms / s) + 's';
15675
- }
15676
- return ms + 'ms';
15677
- }
15678
-
15679
- /**
15680
- * Long format for `ms`.
15681
- *
15682
- * @param {Number} ms
15683
- * @return {String}
15684
- * @api private
15685
- */
15686
-
15687
- function fmtLong(ms) {
15688
- var msAbs = Math.abs(ms);
15689
- if (msAbs >= d) {
15690
- return plural(ms, msAbs, d, 'day');
15691
- }
15692
- if (msAbs >= h) {
15693
- return plural(ms, msAbs, h, 'hour');
15694
- }
15695
- if (msAbs >= m) {
15696
- return plural(ms, msAbs, m, 'minute');
15697
- }
15698
- if (msAbs >= s) {
15699
- return plural(ms, msAbs, s, 'second');
15700
- }
15701
- return ms + ' ms';
15702
- }
15703
-
15704
- /**
15705
- * Pluralization helper.
15706
- */
15707
-
15708
- function plural(ms, msAbs, n, name) {
15709
- var isPlural = msAbs >= n * 1.5;
15710
- return Math.round(ms / n) + ' ' + name + (isPlural ? 's' : '');
15711
- }
15712
- return ms;
15713
- }
15714
-
15715
- var common;
15716
- var hasRequiredCommon;
15717
-
15718
- function requireCommon () {
15719
- if (hasRequiredCommon) return common;
15720
- hasRequiredCommon = 1;
15721
- /**
15722
- * This is the common logic for both the Node.js and web browser
15723
- * implementations of `debug()`.
15724
- */
15725
-
15726
- function setup(env) {
15727
- createDebug.debug = createDebug;
15728
- createDebug.default = createDebug;
15729
- createDebug.coerce = coerce;
15730
- createDebug.disable = disable;
15731
- createDebug.enable = enable;
15732
- createDebug.enabled = enabled;
15733
- createDebug.humanize = requireMs();
15734
- createDebug.destroy = destroy;
15735
-
15736
- Object.keys(env).forEach(key => {
15737
- createDebug[key] = env[key];
15738
- });
15739
-
15740
- /**
15741
- * The currently active debug mode names, and names to skip.
15742
- */
15743
-
15744
- createDebug.names = [];
15745
- createDebug.skips = [];
15746
-
15747
- /**
15748
- * Map of special "%n" handling functions, for the debug "format" argument.
15749
- *
15750
- * Valid key names are a single, lower or upper-case letter, i.e. "n" and "N".
15751
- */
15752
- createDebug.formatters = {};
15753
-
15754
- /**
15755
- * Selects a color for a debug namespace
15756
- * @param {String} namespace The namespace string for the debug instance to be colored
15757
- * @return {Number|String} An ANSI color code for the given namespace
15758
- * @api private
15759
- */
15760
- function selectColor(namespace) {
15761
- let hash = 0;
15762
-
15763
- for (let i = 0; i < namespace.length; i++) {
15764
- hash = ((hash << 5) - hash) + namespace.charCodeAt(i);
15765
- hash |= 0; // Convert to 32bit integer
15766
- }
15767
-
15768
- return createDebug.colors[Math.abs(hash) % createDebug.colors.length];
15769
- }
15770
- createDebug.selectColor = selectColor;
15771
-
15772
- /**
15773
- * Create a debugger with the given `namespace`.
15774
- *
15775
- * @param {String} namespace
15776
- * @return {Function}
15777
- * @api public
15778
- */
15779
- function createDebug(namespace) {
15780
- let prevTime;
15781
- let enableOverride = null;
15782
- let namespacesCache;
15783
- let enabledCache;
15784
-
15785
- function debug(...args) {
15786
- // Disabled?
15787
- if (!debug.enabled) {
15788
- return;
15789
- }
15790
-
15791
- const self = debug;
15792
-
15793
- // Set `diff` timestamp
15794
- const curr = Number(new Date());
15795
- const ms = curr - (prevTime || curr);
15796
- self.diff = ms;
15797
- self.prev = prevTime;
15798
- self.curr = curr;
15799
- prevTime = curr;
15800
-
15801
- args[0] = createDebug.coerce(args[0]);
15802
-
15803
- if (typeof args[0] !== 'string') {
15804
- // Anything else let's inspect with %O
15805
- args.unshift('%O');
15806
- }
15807
-
15808
- // Apply any `formatters` transformations
15809
- let index = 0;
15810
- args[0] = args[0].replace(/%([a-zA-Z%])/g, (match, format) => {
15811
- // If we encounter an escaped % then don't increase the array index
15812
- if (match === '%%') {
15813
- return '%';
15814
- }
15815
- index++;
15816
- const formatter = createDebug.formatters[format];
15817
- if (typeof formatter === 'function') {
15818
- const val = args[index];
15819
- match = formatter.call(self, val);
15820
-
15821
- // Now we need to remove `args[index]` since it's inlined in the `format`
15822
- args.splice(index, 1);
15823
- index--;
15824
- }
15825
- return match;
15826
- });
15827
-
15828
- // Apply env-specific formatting (colors, etc.)
15829
- createDebug.formatArgs.call(self, args);
15830
-
15831
- const logFn = self.log || createDebug.log;
15832
- logFn.apply(self, args);
15833
- }
15834
-
15835
- debug.namespace = namespace;
15836
- debug.useColors = createDebug.useColors();
15837
- debug.color = createDebug.selectColor(namespace);
15838
- debug.extend = extend;
15839
- debug.destroy = createDebug.destroy; // XXX Temporary. Will be removed in the next major release.
15840
-
15841
- Object.defineProperty(debug, 'enabled', {
15842
- enumerable: true,
15843
- configurable: false,
15844
- get: () => {
15845
- if (enableOverride !== null) {
15846
- return enableOverride;
15847
- }
15848
- if (namespacesCache !== createDebug.namespaces) {
15849
- namespacesCache = createDebug.namespaces;
15850
- enabledCache = createDebug.enabled(namespace);
15851
- }
15852
-
15853
- return enabledCache;
15854
- },
15855
- set: v => {
15856
- enableOverride = v;
15857
- }
15858
- });
15859
-
15860
- // Env-specific initialization logic for debug instances
15861
- if (typeof createDebug.init === 'function') {
15862
- createDebug.init(debug);
15863
- }
15864
-
15865
- return debug;
15866
- }
15867
-
15868
- function extend(namespace, delimiter) {
15869
- const newDebug = createDebug(this.namespace + (typeof delimiter === 'undefined' ? ':' : delimiter) + namespace);
15870
- newDebug.log = this.log;
15871
- return newDebug;
15872
- }
15873
-
15874
- /**
15875
- * Enables a debug mode by namespaces. This can include modes
15876
- * separated by a colon and wildcards.
15877
- *
15878
- * @param {String} namespaces
15879
- * @api public
15880
- */
15881
- function enable(namespaces) {
15882
- createDebug.save(namespaces);
15883
- createDebug.namespaces = namespaces;
15884
-
15885
- createDebug.names = [];
15886
- createDebug.skips = [];
15887
-
15888
- let i;
15889
- const split = (typeof namespaces === 'string' ? namespaces : '').split(/[\s,]+/);
15890
- const len = split.length;
15891
-
15892
- for (i = 0; i < len; i++) {
15893
- if (!split[i]) {
15894
- // ignore empty strings
15895
- continue;
15896
- }
15897
-
15898
- namespaces = split[i].replace(/\*/g, '.*?');
15899
-
15900
- if (namespaces[0] === '-') {
15901
- createDebug.skips.push(new RegExp('^' + namespaces.slice(1) + '$'));
15902
- } else {
15903
- createDebug.names.push(new RegExp('^' + namespaces + '$'));
15904
- }
15905
- }
15906
- }
15907
-
15908
- /**
15909
- * Disable debug output.
15910
- *
15911
- * @return {String} namespaces
15912
- * @api public
15913
- */
15914
- function disable() {
15915
- const namespaces = [
15916
- ...createDebug.names.map(toNamespace),
15917
- ...createDebug.skips.map(toNamespace).map(namespace => '-' + namespace)
15918
- ].join(',');
15919
- createDebug.enable('');
15920
- return namespaces;
15921
- }
15922
-
15923
- /**
15924
- * Returns true if the given mode name is enabled, false otherwise.
15925
- *
15926
- * @param {String} name
15927
- * @return {Boolean}
15928
- * @api public
15929
- */
15930
- function enabled(name) {
15931
- if (name[name.length - 1] === '*') {
15932
- return true;
15933
- }
15934
-
15935
- let i;
15936
- let len;
15937
-
15938
- for (i = 0, len = createDebug.skips.length; i < len; i++) {
15939
- if (createDebug.skips[i].test(name)) {
15940
- return false;
15941
- }
15942
- }
15943
-
15944
- for (i = 0, len = createDebug.names.length; i < len; i++) {
15945
- if (createDebug.names[i].test(name)) {
15946
- return true;
15947
- }
15948
- }
15949
-
15950
- return false;
15951
- }
15952
-
15953
- /**
15954
- * Convert regexp to namespace
15955
- *
15956
- * @param {RegExp} regxep
15957
- * @return {String} namespace
15958
- * @api private
15959
- */
15960
- function toNamespace(regexp) {
15961
- return regexp.toString()
15962
- .substring(2, regexp.toString().length - 2)
15963
- .replace(/\.\*\?$/, '*');
15964
- }
15965
-
15966
- /**
15967
- * Coerce `val`.
15968
- *
15969
- * @param {Mixed} val
15970
- * @return {Mixed}
15971
- * @api private
15972
- */
15973
- function coerce(val) {
15974
- if (val instanceof Error) {
15975
- return val.stack || val.message;
15976
- }
15977
- return val;
15978
- }
15979
-
15980
- /**
15981
- * XXX DO NOT USE. This is a temporary stub function.
15982
- * XXX It WILL be removed in the next major release.
15983
- */
15984
- function destroy() {
15985
- console.warn('Instance method `debug.destroy()` is deprecated and no longer does anything. It will be removed in the next major version of `debug`.');
15986
- }
15987
-
15988
- createDebug.enable(createDebug.load());
15989
-
15990
- return createDebug;
15991
- }
15992
-
15993
- common = setup;
15994
- return common;
15995
- }
15996
-
15997
- /* eslint-env browser */
15998
-
15999
- var hasRequiredBrowser;
16000
-
16001
- function requireBrowser () {
16002
- if (hasRequiredBrowser) return browser.exports;
16003
- hasRequiredBrowser = 1;
16004
- (function (module, exports) {
16005
- /**
16006
- * This is the web browser implementation of `debug()`.
16007
- */
16008
-
16009
- exports.formatArgs = formatArgs;
16010
- exports.save = save;
16011
- exports.load = load;
16012
- exports.useColors = useColors;
16013
- exports.storage = localstorage();
16014
- exports.destroy = (() => {
16015
- let warned = false;
16016
-
16017
- return () => {
16018
- if (!warned) {
16019
- warned = true;
16020
- console.warn('Instance method `debug.destroy()` is deprecated and no longer does anything. It will be removed in the next major version of `debug`.');
16021
- }
16022
- };
16023
- })();
16024
-
16025
- /**
16026
- * Colors.
16027
- */
16028
-
16029
- exports.colors = [
16030
- '#0000CC',
16031
- '#0000FF',
16032
- '#0033CC',
16033
- '#0033FF',
16034
- '#0066CC',
16035
- '#0066FF',
16036
- '#0099CC',
16037
- '#0099FF',
16038
- '#00CC00',
16039
- '#00CC33',
16040
- '#00CC66',
16041
- '#00CC99',
16042
- '#00CCCC',
16043
- '#00CCFF',
16044
- '#3300CC',
16045
- '#3300FF',
16046
- '#3333CC',
16047
- '#3333FF',
16048
- '#3366CC',
16049
- '#3366FF',
16050
- '#3399CC',
16051
- '#3399FF',
16052
- '#33CC00',
16053
- '#33CC33',
16054
- '#33CC66',
16055
- '#33CC99',
16056
- '#33CCCC',
16057
- '#33CCFF',
16058
- '#6600CC',
16059
- '#6600FF',
16060
- '#6633CC',
16061
- '#6633FF',
16062
- '#66CC00',
16063
- '#66CC33',
16064
- '#9900CC',
16065
- '#9900FF',
16066
- '#9933CC',
16067
- '#9933FF',
16068
- '#99CC00',
16069
- '#99CC33',
16070
- '#CC0000',
16071
- '#CC0033',
16072
- '#CC0066',
16073
- '#CC0099',
16074
- '#CC00CC',
16075
- '#CC00FF',
16076
- '#CC3300',
16077
- '#CC3333',
16078
- '#CC3366',
16079
- '#CC3399',
16080
- '#CC33CC',
16081
- '#CC33FF',
16082
- '#CC6600',
16083
- '#CC6633',
16084
- '#CC9900',
16085
- '#CC9933',
16086
- '#CCCC00',
16087
- '#CCCC33',
16088
- '#FF0000',
16089
- '#FF0033',
16090
- '#FF0066',
16091
- '#FF0099',
16092
- '#FF00CC',
16093
- '#FF00FF',
16094
- '#FF3300',
16095
- '#FF3333',
16096
- '#FF3366',
16097
- '#FF3399',
16098
- '#FF33CC',
16099
- '#FF33FF',
16100
- '#FF6600',
16101
- '#FF6633',
16102
- '#FF9900',
16103
- '#FF9933',
16104
- '#FFCC00',
16105
- '#FFCC33'
16106
- ];
16107
-
16108
- /**
16109
- * Currently only WebKit-based Web Inspectors, Firefox >= v31,
16110
- * and the Firebug extension (any Firefox version) are known
16111
- * to support "%c" CSS customizations.
16112
- *
16113
- * TODO: add a `localStorage` variable to explicitly enable/disable colors
16114
- */
16115
-
16116
- // eslint-disable-next-line complexity
16117
- function useColors() {
16118
- // NB: In an Electron preload script, document will be defined but not fully
16119
- // initialized. Since we know we're in Chrome, we'll just detect this case
16120
- // explicitly
16121
- if (typeof window !== 'undefined' && window.process && (window.process.type === 'renderer' || window.process.__nwjs)) {
16122
- return true;
16123
- }
16124
-
16125
- // Internet Explorer and Edge do not support colors.
16126
- if (typeof navigator !== 'undefined' && navigator.userAgent && navigator.userAgent.toLowerCase().match(/(edge|trident)\/(\d+)/)) {
16127
- return false;
16128
- }
16129
-
16130
- let m;
16131
-
16132
- // Is webkit? http://stackoverflow.com/a/16459606/376773
16133
- // document is undefined in react-native: https://github.com/facebook/react-native/pull/1632
16134
- return (typeof document !== 'undefined' && document.documentElement && document.documentElement.style && document.documentElement.style.WebkitAppearance) ||
16135
- // Is firebug? http://stackoverflow.com/a/398120/376773
16136
- (typeof window !== 'undefined' && window.console && (window.console.firebug || (window.console.exception && window.console.table))) ||
16137
- // Is firefox >= v31?
16138
- // https://developer.mozilla.org/en-US/docs/Tools/Web_Console#Styling_messages
16139
- (typeof navigator !== 'undefined' && navigator.userAgent && (m = navigator.userAgent.toLowerCase().match(/firefox\/(\d+)/)) && parseInt(m[1], 10) >= 31) ||
16140
- // Double check webkit in userAgent just in case we are in a worker
16141
- (typeof navigator !== 'undefined' && navigator.userAgent && navigator.userAgent.toLowerCase().match(/applewebkit\/(\d+)/));
16142
- }
16143
-
16144
- /**
16145
- * Colorize log arguments if enabled.
16146
- *
16147
- * @api public
16148
- */
16149
-
16150
- function formatArgs(args) {
16151
- args[0] = (this.useColors ? '%c' : '') +
16152
- this.namespace +
16153
- (this.useColors ? ' %c' : ' ') +
16154
- args[0] +
16155
- (this.useColors ? '%c ' : ' ') +
16156
- '+' + module.exports.humanize(this.diff);
16157
-
16158
- if (!this.useColors) {
16159
- return;
16160
- }
16161
-
16162
- const c = 'color: ' + this.color;
16163
- args.splice(1, 0, c, 'color: inherit');
16164
-
16165
- // The final "%c" is somewhat tricky, because there could be other
16166
- // arguments passed either before or after the %c, so we need to
16167
- // figure out the correct index to insert the CSS into
16168
- let index = 0;
16169
- let lastC = 0;
16170
- args[0].replace(/%[a-zA-Z%]/g, match => {
16171
- if (match === '%%') {
16172
- return;
16173
- }
16174
- index++;
16175
- if (match === '%c') {
16176
- // We only are interested in the *last* %c
16177
- // (the user may have provided their own)
16178
- lastC = index;
16179
- }
16180
- });
16181
-
16182
- args.splice(lastC, 0, c);
16183
- }
16184
-
16185
- /**
16186
- * Invokes `console.debug()` when available.
16187
- * No-op when `console.debug` is not a "function".
16188
- * If `console.debug` is not available, falls back
16189
- * to `console.log`.
16190
- *
16191
- * @api public
16192
- */
16193
- exports.log = console.debug || console.log || (() => {});
16194
-
16195
- /**
16196
- * Save `namespaces`.
16197
- *
16198
- * @param {String} namespaces
16199
- * @api private
16200
- */
16201
- function save(namespaces) {
16202
- try {
16203
- if (namespaces) {
16204
- exports.storage.setItem('debug', namespaces);
16205
- } else {
16206
- exports.storage.removeItem('debug');
16207
- }
16208
- } catch (error) {
16209
- // Swallow
16210
- // XXX (@Qix-) should we be logging these?
16211
- }
16212
- }
16213
-
16214
- /**
16215
- * Load `namespaces`.
16216
- *
16217
- * @return {String} returns the previously persisted debug modes
16218
- * @api private
16219
- */
16220
- function load() {
16221
- let r;
16222
- try {
16223
- r = exports.storage.getItem('debug');
16224
- } catch (error) {
16225
- // Swallow
16226
- // XXX (@Qix-) should we be logging these?
16227
- }
16228
-
16229
- // If debug isn't set in LS, and we're in Electron, try to load $DEBUG
16230
- if (!r && typeof process !== 'undefined' && 'env' in process) {
16231
- r = process.env.DEBUG;
16232
- }
16233
-
16234
- return r;
16235
- }
16236
-
16237
- /**
16238
- * Localstorage attempts to return the localstorage.
16239
- *
16240
- * This is necessary because safari throws
16241
- * when a user disables cookies/localstorage
16242
- * and you attempt to access it.
16243
- *
16244
- * @return {LocalStorage}
16245
- * @api private
16246
- */
16247
-
16248
- function localstorage() {
16249
- try {
16250
- // TVMLKit (Apple TV JS Runtime) does not have a window object, just localStorage in the global context
16251
- // The Browser also has localStorage in the global context.
16252
- return localStorage;
16253
- } catch (error) {
16254
- // Swallow
16255
- // XXX (@Qix-) should we be logging these?
16256
- }
16257
- }
16258
-
16259
- module.exports = requireCommon()(exports);
16260
-
16261
- const {formatters} = module.exports;
16262
-
16263
- /**
16264
- * Map %j to `JSON.stringify()`, since no Web Inspectors do that by default.
16265
- */
16266
-
16267
- formatters.j = function (v) {
16268
- try {
16269
- return JSON.stringify(v);
16270
- } catch (error) {
16271
- return '[UnexpectedJSONParseError]: ' + error.message;
16272
- }
16273
- };
16274
- } (browser, browser.exports));
16275
- return browser.exports;
16276
- }
16277
-
16278
- var node = {exports: {}};
16279
-
16280
- var hasFlag;
16281
- var hasRequiredHasFlag;
16282
-
16283
- function requireHasFlag () {
16284
- if (hasRequiredHasFlag) return hasFlag;
16285
- hasRequiredHasFlag = 1;
16286
-
16287
- hasFlag = (flag, argv = process.argv) => {
16288
- const prefix = flag.startsWith('-') ? '' : (flag.length === 1 ? '-' : '--');
16289
- const position = argv.indexOf(prefix + flag);
16290
- const terminatorPosition = argv.indexOf('--');
16291
- return position !== -1 && (terminatorPosition === -1 || position < terminatorPosition);
16292
- };
16293
- return hasFlag;
16294
- }
16295
-
16296
- var supportsColor_1;
16297
- var hasRequiredSupportsColor;
16298
-
16299
- function requireSupportsColor () {
16300
- if (hasRequiredSupportsColor) return supportsColor_1;
16301
- hasRequiredSupportsColor = 1;
16302
- const os = require$$0$2;
16303
- const tty = require$$1$1;
16304
- const hasFlag = requireHasFlag();
16305
-
16306
- const {env} = process;
16307
-
16308
- let forceColor;
16309
- if (hasFlag('no-color') ||
16310
- hasFlag('no-colors') ||
16311
- hasFlag('color=false') ||
16312
- hasFlag('color=never')) {
16313
- forceColor = 0;
16314
- } else if (hasFlag('color') ||
16315
- hasFlag('colors') ||
16316
- hasFlag('color=true') ||
16317
- hasFlag('color=always')) {
16318
- forceColor = 1;
16319
- }
16320
-
16321
- if ('FORCE_COLOR' in env) {
16322
- if (env.FORCE_COLOR === 'true') {
16323
- forceColor = 1;
16324
- } else if (env.FORCE_COLOR === 'false') {
16325
- forceColor = 0;
16326
- } else {
16327
- forceColor = env.FORCE_COLOR.length === 0 ? 1 : Math.min(parseInt(env.FORCE_COLOR, 10), 3);
16328
- }
16329
- }
16330
-
16331
- function translateLevel(level) {
16332
- if (level === 0) {
16333
- return false;
16334
- }
16335
-
16336
- return {
16337
- level,
16338
- hasBasic: true,
16339
- has256: level >= 2,
16340
- has16m: level >= 3
16341
- };
16342
- }
16343
-
16344
- function supportsColor(haveStream, streamIsTTY) {
16345
- if (forceColor === 0) {
16346
- return 0;
16347
- }
16348
-
16349
- if (hasFlag('color=16m') ||
16350
- hasFlag('color=full') ||
16351
- hasFlag('color=truecolor')) {
16352
- return 3;
16353
- }
16354
-
16355
- if (hasFlag('color=256')) {
16356
- return 2;
16357
- }
16358
-
16359
- if (haveStream && !streamIsTTY && forceColor === undefined) {
16360
- return 0;
16361
- }
16362
-
16363
- const min = forceColor || 0;
16364
-
16365
- if (env.TERM === 'dumb') {
16366
- return min;
16367
- }
16368
-
16369
- if (process.platform === 'win32') {
16370
- // Windows 10 build 10586 is the first Windows release that supports 256 colors.
16371
- // Windows 10 build 14931 is the first release that supports 16m/TrueColor.
16372
- const osRelease = os.release().split('.');
16373
- if (
16374
- Number(osRelease[0]) >= 10 &&
16375
- Number(osRelease[2]) >= 10586
16376
- ) {
16377
- return Number(osRelease[2]) >= 14931 ? 3 : 2;
16378
- }
16379
-
16380
- return 1;
16381
- }
16382
-
16383
- if ('CI' in env) {
16384
- if (['TRAVIS', 'CIRCLECI', 'APPVEYOR', 'GITLAB_CI', 'GITHUB_ACTIONS', 'BUILDKITE'].some(sign => sign in env) || env.CI_NAME === 'codeship') {
16385
- return 1;
16386
- }
16387
-
16388
- return min;
16389
- }
16390
-
16391
- if ('TEAMCITY_VERSION' in env) {
16392
- return /^(9\.(0*[1-9]\d*)\.|\d{2,}\.)/.test(env.TEAMCITY_VERSION) ? 1 : 0;
16393
- }
16394
-
16395
- if (env.COLORTERM === 'truecolor') {
16396
- return 3;
16397
- }
16398
-
16399
- if ('TERM_PROGRAM' in env) {
16400
- const version = parseInt((env.TERM_PROGRAM_VERSION || '').split('.')[0], 10);
16401
-
16402
- switch (env.TERM_PROGRAM) {
16403
- case 'iTerm.app':
16404
- return version >= 3 ? 3 : 2;
16405
- case 'Apple_Terminal':
16406
- return 2;
16407
- // No default
16408
- }
16409
- }
16410
-
16411
- if (/-256(color)?$/i.test(env.TERM)) {
16412
- return 2;
16413
- }
16414
-
16415
- if (/^screen|^xterm|^vt100|^vt220|^rxvt|color|ansi|cygwin|linux/i.test(env.TERM)) {
16416
- return 1;
16417
- }
16418
-
16419
- if ('COLORTERM' in env) {
16420
- return 1;
16421
- }
16422
-
16423
- return min;
16424
- }
16425
-
16426
- function getSupportLevel(stream) {
16427
- const level = supportsColor(stream, stream && stream.isTTY);
16428
- return translateLevel(level);
16429
- }
16430
-
16431
- supportsColor_1 = {
16432
- supportsColor: getSupportLevel,
16433
- stdout: translateLevel(supportsColor(true, tty.isatty(1))),
16434
- stderr: translateLevel(supportsColor(true, tty.isatty(2)))
16435
- };
16436
- return supportsColor_1;
16437
- }
16438
-
16439
- /**
16440
- * Module dependencies.
16441
- */
16442
-
16443
- var hasRequiredNode;
16444
-
16445
- function requireNode () {
16446
- if (hasRequiredNode) return node.exports;
16447
- hasRequiredNode = 1;
16448
- (function (module, exports) {
16449
- const tty = require$$1$1;
16450
- const util = require$$1;
16451
-
16452
- /**
16453
- * This is the Node.js implementation of `debug()`.
16454
- */
16455
-
16456
- exports.init = init;
16457
- exports.log = log;
16458
- exports.formatArgs = formatArgs;
16459
- exports.save = save;
16460
- exports.load = load;
16461
- exports.useColors = useColors;
16462
- exports.destroy = util.deprecate(
16463
- () => {},
16464
- 'Instance method `debug.destroy()` is deprecated and no longer does anything. It will be removed in the next major version of `debug`.'
16465
- );
16466
-
16467
- /**
16468
- * Colors.
16469
- */
16470
-
16471
- exports.colors = [6, 2, 3, 4, 5, 1];
16472
-
16473
- try {
16474
- // Optional dependency (as in, doesn't need to be installed, NOT like optionalDependencies in package.json)
16475
- // eslint-disable-next-line import/no-extraneous-dependencies
16476
- const supportsColor = requireSupportsColor();
16477
-
16478
- if (supportsColor && (supportsColor.stderr || supportsColor).level >= 2) {
16479
- exports.colors = [
16480
- 20,
16481
- 21,
16482
- 26,
16483
- 27,
16484
- 32,
16485
- 33,
16486
- 38,
16487
- 39,
16488
- 40,
16489
- 41,
16490
- 42,
16491
- 43,
16492
- 44,
16493
- 45,
16494
- 56,
16495
- 57,
16496
- 62,
16497
- 63,
16498
- 68,
16499
- 69,
16500
- 74,
16501
- 75,
16502
- 76,
16503
- 77,
16504
- 78,
16505
- 79,
16506
- 80,
16507
- 81,
16508
- 92,
16509
- 93,
16510
- 98,
16511
- 99,
16512
- 112,
16513
- 113,
16514
- 128,
16515
- 129,
16516
- 134,
16517
- 135,
16518
- 148,
16519
- 149,
16520
- 160,
16521
- 161,
16522
- 162,
16523
- 163,
16524
- 164,
16525
- 165,
16526
- 166,
16527
- 167,
16528
- 168,
16529
- 169,
16530
- 170,
16531
- 171,
16532
- 172,
16533
- 173,
16534
- 178,
16535
- 179,
16536
- 184,
16537
- 185,
16538
- 196,
16539
- 197,
16540
- 198,
16541
- 199,
16542
- 200,
16543
- 201,
16544
- 202,
16545
- 203,
16546
- 204,
16547
- 205,
16548
- 206,
16549
- 207,
16550
- 208,
16551
- 209,
16552
- 214,
16553
- 215,
16554
- 220,
16555
- 221
16556
- ];
16557
- }
16558
- } catch (error) {
16559
- // Swallow - we only care if `supports-color` is available; it doesn't have to be.
16560
- }
16561
-
16562
- /**
16563
- * Build up the default `inspectOpts` object from the environment variables.
16564
- *
16565
- * $ DEBUG_COLORS=no DEBUG_DEPTH=10 DEBUG_SHOW_HIDDEN=enabled node script.js
16566
- */
16567
-
16568
- exports.inspectOpts = Object.keys(process.env).filter(key => {
16569
- return /^debug_/i.test(key);
16570
- }).reduce((obj, key) => {
16571
- // Camel-case
16572
- const prop = key
16573
- .substring(6)
16574
- .toLowerCase()
16575
- .replace(/_([a-z])/g, (_, k) => {
16576
- return k.toUpperCase();
16577
- });
16578
-
16579
- // Coerce string value into JS value
16580
- let val = process.env[key];
16581
- if (/^(yes|on|true|enabled)$/i.test(val)) {
16582
- val = true;
16583
- } else if (/^(no|off|false|disabled)$/i.test(val)) {
16584
- val = false;
16585
- } else if (val === 'null') {
16586
- val = null;
16587
- } else {
16588
- val = Number(val);
16589
- }
16590
-
16591
- obj[prop] = val;
16592
- return obj;
16593
- }, {});
16594
-
16595
- /**
16596
- * Is stdout a TTY? Colored output is enabled when `true`.
16597
- */
16598
-
16599
- function useColors() {
16600
- return 'colors' in exports.inspectOpts ?
16601
- Boolean(exports.inspectOpts.colors) :
16602
- tty.isatty(process.stderr.fd);
16603
- }
16604
-
16605
- /**
16606
- * Adds ANSI color escape codes if enabled.
16607
- *
16608
- * @api public
16609
- */
16610
-
16611
- function formatArgs(args) {
16612
- const {namespace: name, useColors} = this;
16613
-
16614
- if (useColors) {
16615
- const c = this.color;
16616
- const colorCode = '\u001B[3' + (c < 8 ? c : '8;5;' + c);
16617
- const prefix = ` ${colorCode};1m${name} \u001B[0m`;
16618
-
16619
- args[0] = prefix + args[0].split('\n').join('\n' + prefix);
16620
- args.push(colorCode + 'm+' + module.exports.humanize(this.diff) + '\u001B[0m');
16621
- } else {
16622
- args[0] = getDate() + name + ' ' + args[0];
16623
- }
16624
- }
16625
-
16626
- function getDate() {
16627
- if (exports.inspectOpts.hideDate) {
16628
- return '';
16629
- }
16630
- return new Date().toISOString() + ' ';
16631
- }
16632
-
16633
- /**
16634
- * Invokes `util.formatWithOptions()` with the specified arguments and writes to stderr.
16635
- */
16636
-
16637
- function log(...args) {
16638
- return process.stderr.write(util.formatWithOptions(exports.inspectOpts, ...args) + '\n');
16639
- }
16640
-
16641
- /**
16642
- * Save `namespaces`.
16643
- *
16644
- * @param {String} namespaces
16645
- * @api private
16646
- */
16647
- function save(namespaces) {
16648
- if (namespaces) {
16649
- process.env.DEBUG = namespaces;
16650
- } else {
16651
- // If you set a process.env field to null or undefined, it gets cast to the
16652
- // string 'null' or 'undefined'. Just delete instead.
16653
- delete process.env.DEBUG;
16654
- }
16655
- }
16656
-
16657
- /**
16658
- * Load `namespaces`.
16659
- *
16660
- * @return {String} returns the previously persisted debug modes
16661
- * @api private
16662
- */
16663
-
16664
- function load() {
16665
- return process.env.DEBUG;
16666
- }
16667
-
16668
- /**
16669
- * Init logic for `debug` instances.
16670
- *
16671
- * Create a new `inspectOpts` object in case `useColors` is set
16672
- * differently for a particular `debug` instance.
16673
- */
16674
-
16675
- function init(debug) {
16676
- debug.inspectOpts = {};
16677
-
16678
- const keys = Object.keys(exports.inspectOpts);
16679
- for (let i = 0; i < keys.length; i++) {
16680
- debug.inspectOpts[keys[i]] = exports.inspectOpts[keys[i]];
16681
- }
16682
- }
16683
-
16684
- module.exports = requireCommon()(exports);
16685
-
16686
- const {formatters} = module.exports;
16687
-
16688
- /**
16689
- * Map %o to `util.inspect()`, all on a single line.
16690
- */
16691
-
16692
- formatters.o = function (v) {
16693
- this.inspectOpts.colors = this.useColors;
16694
- return util.inspect(v, this.inspectOpts)
16695
- .split('\n')
16696
- .map(str => str.trim())
16697
- .join(' ');
16698
- };
16699
-
16700
- /**
16701
- * Map %O to `util.inspect()`, allowing multiple lines if needed.
16702
- */
16703
-
16704
- formatters.O = function (v) {
16705
- this.inspectOpts.colors = this.useColors;
16706
- return util.inspect(v, this.inspectOpts);
16707
- };
16708
- } (node, node.exports));
16709
- return node.exports;
16710
- }
16711
-
16712
- /**
16713
- * Detect Electron renderer / nwjs process, which is node, but we should
16714
- * treat as a browser.
16715
- */
16716
-
16717
- var hasRequiredSrc;
16718
-
16719
- function requireSrc () {
16720
- if (hasRequiredSrc) return src.exports;
16721
- hasRequiredSrc = 1;
16722
- if (typeof process === 'undefined' || process.type === 'renderer' || process.browser === true || process.__nwjs) {
16723
- src.exports = requireBrowser();
16724
- } else {
16725
- src.exports = requireNode();
16726
- }
16727
- return src.exports;
16728
- }
16729
-
16730
15538
  var debug_1;
16731
15539
  var hasRequiredDebug;
16732
15540
 
@@ -16739,7 +15547,7 @@ function requireDebug () {
16739
15547
  if (!debug) {
16740
15548
  try {
16741
15549
  /* eslint global-require: off */
16742
- debug = requireSrc()("follow-redirects");
15550
+ debug = require("debug")("follow-redirects");
16743
15551
  }
16744
15552
  catch (error) { /* */ }
16745
15553
  if (typeof debug !== "function") {
@@ -20171,10 +18979,10 @@ function toBoolean(value) {
20171
18979
  return value.toLowerCase() === 'true';
20172
18980
  return false;
20173
18981
  }
20174
- function initClient({ host = '127.0.0.1', port = 8500, secure = false }) {
18982
+ function initClient({ host = '127.0.0.1', port = 3371, secure = false }) {
20175
18983
  atlasClient = new AtlasClient({
20176
18984
  host: host !== null && host !== void 0 ? host : '127.0.0.1',
20177
- port: 371,
18985
+ port,
20178
18986
  version: '1',
20179
18987
  });
20180
18988
  }
@@ -20199,7 +19007,7 @@ async function registerService(options) {
20199
19007
  });
20200
19008
  }
20201
19009
 
20202
- const BASE_LOG_DIR$2 = '/home/log';
19010
+ const BASE_LOG_DIR$2 = '/home/coder371/log';
20203
19011
  // اسم السيرفس الحالي اللي بيعمل الـ discovery
20204
19012
  const CURRENT_SERVICE$2 = process.env.SERVICE_NAME || 'unknown-service';
20205
19013
  async function ensureLogDir$2(dir) {
@@ -20311,7 +19119,7 @@ async function getServiceUrl(serviceName) {
20311
19119
  return url;
20312
19120
  }
20313
19121
 
20314
- const BASE_LOG_DIR$1 = '/home/log';
19122
+ const BASE_LOG_DIR$1 = '/home/coder371/log';
20315
19123
  const CURRENT_SERVICE$1 = process.env.SERVICE_NAME || 'unknown-service';
20316
19124
  async function ensureLogDir$1(dir) {
20317
19125
  await require$$6.promises.mkdir(dir, { recursive: true });
@@ -20345,7 +19153,7 @@ async function appendCallLog(targetService, url, method, status, elapsedMs, erro
20345
19153
  }
20346
19154
  }
20347
19155
 
20348
- const BASE_LOG_DIR = '/home/log';
19156
+ const BASE_LOG_DIR = '/home/coder371/log';
20349
19157
  const CURRENT_SERVICE = process.env.SERVICE_NAME || 'unknown-service';
20350
19158
  const THRESHOLD = Number(process.env.SLOW_CALL_THRESHOLD || 200); // الافتراضي 200ms
20351
19159
  async function ensureLogDir(dir) {