@sap/ux-ui5-tooling 1.12.3 → 1.12.5
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/CHANGELOG.md +4 -0
- package/dist/cli/index.js +5168 -2391
- package/dist/middlewares/fiori-tools-appreload.js +3148 -269
- package/dist/middlewares/fiori-tools-preview.js +3864 -1993
- package/dist/middlewares/fiori-tools-proxy.js +9663 -7466
- package/dist/middlewares/fiori-tools-servestatic.js +3144 -291
- package/dist/tasks/cf-deploy/index.js +4182 -2312
- package/dist/tasks/deploy/index.js +8923 -6151
- package/package.json +20 -20
|
@@ -9307,10 +9307,10 @@ var require_common = __commonJS({
|
|
|
9307
9307
|
createDebug.enable = enable;
|
|
9308
9308
|
createDebug.enabled = enabled;
|
|
9309
9309
|
createDebug.humanize = require_ms();
|
|
9310
|
+
createDebug.destroy = destroy;
|
|
9310
9311
|
Object.keys(env).forEach((key) => {
|
|
9311
9312
|
createDebug[key] = env[key];
|
|
9312
9313
|
});
|
|
9313
|
-
createDebug.instances = [];
|
|
9314
9314
|
createDebug.names = [];
|
|
9315
9315
|
createDebug.skips = [];
|
|
9316
9316
|
createDebug.formatters = {};
|
|
@@ -9325,6 +9325,9 @@ var require_common = __commonJS({
|
|
|
9325
9325
|
createDebug.selectColor = selectColor;
|
|
9326
9326
|
function createDebug(namespace) {
|
|
9327
9327
|
let prevTime;
|
|
9328
|
+
let enableOverride = null;
|
|
9329
|
+
let namespacesCache;
|
|
9330
|
+
let enabledCache;
|
|
9328
9331
|
function debug(...args) {
|
|
9329
9332
|
if (!debug.enabled) {
|
|
9330
9333
|
return;
|
|
@@ -9343,7 +9346,7 @@ var require_common = __commonJS({
|
|
|
9343
9346
|
let index2 = 0;
|
|
9344
9347
|
args[0] = args[0].replace(/%([a-zA-Z%])/g, (match, format2) => {
|
|
9345
9348
|
if (match === "%%") {
|
|
9346
|
-
return
|
|
9349
|
+
return "%";
|
|
9347
9350
|
}
|
|
9348
9351
|
index2++;
|
|
9349
9352
|
const formatter = createDebug.formatters[format2];
|
|
@@ -9360,25 +9363,32 @@ var require_common = __commonJS({
|
|
|
9360
9363
|
logFn.apply(self2, args);
|
|
9361
9364
|
}
|
|
9362
9365
|
debug.namespace = namespace;
|
|
9363
|
-
debug.enabled = createDebug.enabled(namespace);
|
|
9364
9366
|
debug.useColors = createDebug.useColors();
|
|
9365
9367
|
debug.color = createDebug.selectColor(namespace);
|
|
9366
|
-
debug.destroy = destroy;
|
|
9367
9368
|
debug.extend = extend2;
|
|
9369
|
+
debug.destroy = createDebug.destroy;
|
|
9370
|
+
Object.defineProperty(debug, "enabled", {
|
|
9371
|
+
enumerable: true,
|
|
9372
|
+
configurable: false,
|
|
9373
|
+
get: () => {
|
|
9374
|
+
if (enableOverride !== null) {
|
|
9375
|
+
return enableOverride;
|
|
9376
|
+
}
|
|
9377
|
+
if (namespacesCache !== createDebug.namespaces) {
|
|
9378
|
+
namespacesCache = createDebug.namespaces;
|
|
9379
|
+
enabledCache = createDebug.enabled(namespace);
|
|
9380
|
+
}
|
|
9381
|
+
return enabledCache;
|
|
9382
|
+
},
|
|
9383
|
+
set: (v) => {
|
|
9384
|
+
enableOverride = v;
|
|
9385
|
+
}
|
|
9386
|
+
});
|
|
9368
9387
|
if (typeof createDebug.init === "function") {
|
|
9369
9388
|
createDebug.init(debug);
|
|
9370
9389
|
}
|
|
9371
|
-
createDebug.instances.push(debug);
|
|
9372
9390
|
return debug;
|
|
9373
9391
|
}
|
|
9374
|
-
function destroy() {
|
|
9375
|
-
const index2 = createDebug.instances.indexOf(this);
|
|
9376
|
-
if (index2 !== -1) {
|
|
9377
|
-
createDebug.instances.splice(index2, 1);
|
|
9378
|
-
return true;
|
|
9379
|
-
}
|
|
9380
|
-
return false;
|
|
9381
|
-
}
|
|
9382
9392
|
function extend2(namespace, delimiter) {
|
|
9383
9393
|
const newDebug = createDebug(this.namespace + (typeof delimiter === "undefined" ? ":" : delimiter) + namespace);
|
|
9384
9394
|
newDebug.log = this.log;
|
|
@@ -9386,6 +9396,7 @@ var require_common = __commonJS({
|
|
|
9386
9396
|
}
|
|
9387
9397
|
function enable(namespaces) {
|
|
9388
9398
|
createDebug.save(namespaces);
|
|
9399
|
+
createDebug.namespaces = namespaces;
|
|
9389
9400
|
createDebug.names = [];
|
|
9390
9401
|
createDebug.skips = [];
|
|
9391
9402
|
let i;
|
|
@@ -9397,15 +9408,11 @@ var require_common = __commonJS({
|
|
|
9397
9408
|
}
|
|
9398
9409
|
namespaces = split[i].replace(/\*/g, ".*?");
|
|
9399
9410
|
if (namespaces[0] === "-") {
|
|
9400
|
-
createDebug.skips.push(new RegExp("^" + namespaces.
|
|
9411
|
+
createDebug.skips.push(new RegExp("^" + namespaces.slice(1) + "$"));
|
|
9401
9412
|
} else {
|
|
9402
9413
|
createDebug.names.push(new RegExp("^" + namespaces + "$"));
|
|
9403
9414
|
}
|
|
9404
9415
|
}
|
|
9405
|
-
for (i = 0; i < createDebug.instances.length; i++) {
|
|
9406
|
-
const instance = createDebug.instances[i];
|
|
9407
|
-
instance.enabled = createDebug.enabled(instance.namespace);
|
|
9408
|
-
}
|
|
9409
9416
|
}
|
|
9410
9417
|
function disable() {
|
|
9411
9418
|
const namespaces = [
|
|
@@ -9442,6 +9449,9 @@ var require_common = __commonJS({
|
|
|
9442
9449
|
}
|
|
9443
9450
|
return val;
|
|
9444
9451
|
}
|
|
9452
|
+
function destroy() {
|
|
9453
|
+
console.warn("Instance method `debug.destroy()` is deprecated and no longer does anything. It will be removed in the next major version of `debug`.");
|
|
9454
|
+
}
|
|
9445
9455
|
createDebug.enable(createDebug.load());
|
|
9446
9456
|
return createDebug;
|
|
9447
9457
|
}
|
|
@@ -9457,6 +9467,15 @@ var require_browser = __commonJS({
|
|
|
9457
9467
|
exports.load = load;
|
|
9458
9468
|
exports.useColors = useColors;
|
|
9459
9469
|
exports.storage = localstorage();
|
|
9470
|
+
exports.destroy = (() => {
|
|
9471
|
+
let warned = false;
|
|
9472
|
+
return () => {
|
|
9473
|
+
if (!warned) {
|
|
9474
|
+
warned = true;
|
|
9475
|
+
console.warn("Instance method `debug.destroy()` is deprecated and no longer does anything. It will be removed in the next major version of `debug`.");
|
|
9476
|
+
}
|
|
9477
|
+
};
|
|
9478
|
+
})();
|
|
9460
9479
|
exports.colors = [
|
|
9461
9480
|
"#0000CC",
|
|
9462
9481
|
"#0000FF",
|
|
@@ -9735,6 +9754,11 @@ var require_node = __commonJS({
|
|
|
9735
9754
|
exports.save = save;
|
|
9736
9755
|
exports.load = load;
|
|
9737
9756
|
exports.useColors = useColors;
|
|
9757
|
+
exports.destroy = util2.deprecate(
|
|
9758
|
+
() => {
|
|
9759
|
+
},
|
|
9760
|
+
"Instance method `debug.destroy()` is deprecated and no longer does anything. It will be removed in the next major version of `debug`."
|
|
9761
|
+
);
|
|
9738
9762
|
exports.colors = [6, 2, 3, 4, 5, 1];
|
|
9739
9763
|
try {
|
|
9740
9764
|
const supportsColor = require_supports_color();
|
|
@@ -9884,7 +9908,7 @@ var require_node = __commonJS({
|
|
|
9884
9908
|
var { formatters } = module2.exports;
|
|
9885
9909
|
formatters.o = function(v) {
|
|
9886
9910
|
this.inspectOpts.colors = this.useColors;
|
|
9887
|
-
return util2.inspect(v, this.inspectOpts).
|
|
9911
|
+
return util2.inspect(v, this.inspectOpts).split("\n").map((str) => str.trim()).join(" ");
|
|
9888
9912
|
};
|
|
9889
9913
|
formatters.O = function(v) {
|
|
9890
9914
|
this.inspectOpts.colors = this.useColors;
|
|
@@ -12667,7 +12691,9 @@ var require_node2 = __commonJS({
|
|
|
12667
12691
|
var formatters = module2.exports.formatters;
|
|
12668
12692
|
formatters.o = function(v) {
|
|
12669
12693
|
this.inspectOpts.colors = this.useColors;
|
|
12670
|
-
return util2.inspect(v, this.inspectOpts).
|
|
12694
|
+
return util2.inspect(v, this.inspectOpts).split("\n").map(function(str) {
|
|
12695
|
+
return str.trim();
|
|
12696
|
+
}).join(" ");
|
|
12671
12697
|
};
|
|
12672
12698
|
formatters.O = function(v) {
|
|
12673
12699
|
this.inspectOpts.colors = this.useColors;
|
|
@@ -14840,7 +14866,7 @@ var require_types = __commonJS({
|
|
|
14840
14866
|
LogLevel2[LogLevel2["Verbose"] = 3] = "Verbose";
|
|
14841
14867
|
LogLevel2[LogLevel2["Debug"] = 4] = "Debug";
|
|
14842
14868
|
LogLevel2[LogLevel2["Silly"] = 5] = "Silly";
|
|
14843
|
-
})(LogLevel
|
|
14869
|
+
})(LogLevel || (exports.LogLevel = LogLevel = {}));
|
|
14844
14870
|
var Transport = class {
|
|
14845
14871
|
/**
|
|
14846
14872
|
* A utility copy method to make immutable, deep copies of objects
|
|
@@ -14863,16 +14889,16 @@ var require_node3 = __commonJS({
|
|
|
14863
14889
|
}
|
|
14864
14890
|
});
|
|
14865
14891
|
|
|
14866
|
-
// ../../node_modules
|
|
14892
|
+
// ../../node_modules/@sap-ux/logger/node_modules/readable-stream/lib/internal/streams/stream.js
|
|
14867
14893
|
var require_stream = __commonJS({
|
|
14868
|
-
"../../node_modules
|
|
14894
|
+
"../../node_modules/@sap-ux/logger/node_modules/readable-stream/lib/internal/streams/stream.js"(exports, module2) {
|
|
14869
14895
|
module2.exports = require("stream");
|
|
14870
14896
|
}
|
|
14871
14897
|
});
|
|
14872
14898
|
|
|
14873
|
-
// ../../node_modules
|
|
14899
|
+
// ../../node_modules/@sap-ux/logger/node_modules/readable-stream/lib/internal/streams/destroy.js
|
|
14874
14900
|
var require_destroy = __commonJS({
|
|
14875
|
-
"../../node_modules
|
|
14901
|
+
"../../node_modules/@sap-ux/logger/node_modules/readable-stream/lib/internal/streams/destroy.js"(exports, module2) {
|
|
14876
14902
|
"use strict";
|
|
14877
14903
|
function destroy(err, cb) {
|
|
14878
14904
|
var _this = this;
|
|
@@ -14963,9 +14989,9 @@ var require_destroy = __commonJS({
|
|
|
14963
14989
|
}
|
|
14964
14990
|
});
|
|
14965
14991
|
|
|
14966
|
-
// ../../node_modules
|
|
14992
|
+
// ../../node_modules/@sap-ux/logger/node_modules/readable-stream/errors.js
|
|
14967
14993
|
var require_errors = __commonJS({
|
|
14968
|
-
"../../node_modules
|
|
14994
|
+
"../../node_modules/@sap-ux/logger/node_modules/readable-stream/errors.js"(exports, module2) {
|
|
14969
14995
|
"use strict";
|
|
14970
14996
|
var codes = {};
|
|
14971
14997
|
function createErrorType(code, message, Base) {
|
|
@@ -15063,9 +15089,9 @@ var require_errors = __commonJS({
|
|
|
15063
15089
|
}
|
|
15064
15090
|
});
|
|
15065
15091
|
|
|
15066
|
-
// ../../node_modules
|
|
15092
|
+
// ../../node_modules/@sap-ux/logger/node_modules/readable-stream/lib/internal/streams/state.js
|
|
15067
15093
|
var require_state2 = __commonJS({
|
|
15068
|
-
"../../node_modules
|
|
15094
|
+
"../../node_modules/@sap-ux/logger/node_modules/readable-stream/lib/internal/streams/state.js"(exports, module2) {
|
|
15069
15095
|
"use strict";
|
|
15070
15096
|
var ERR_INVALID_OPT_VALUE = require_errors().codes.ERR_INVALID_OPT_VALUE;
|
|
15071
15097
|
function highWaterMarkFrom(options, isDuplex, duplexKey) {
|
|
@@ -15135,9 +15161,9 @@ var require_inherits = __commonJS({
|
|
|
15135
15161
|
}
|
|
15136
15162
|
});
|
|
15137
15163
|
|
|
15138
|
-
// ../../node_modules
|
|
15164
|
+
// ../../node_modules/@sap-ux/logger/node_modules/readable-stream/lib/internal/streams/buffer_list.js
|
|
15139
15165
|
var require_buffer_list = __commonJS({
|
|
15140
|
-
"../../node_modules
|
|
15166
|
+
"../../node_modules/@sap-ux/logger/node_modules/readable-stream/lib/internal/streams/buffer_list.js"(exports, module2) {
|
|
15141
15167
|
"use strict";
|
|
15142
15168
|
function ownKeys(object, enumerableOnly) {
|
|
15143
15169
|
var keys = Object.keys(object);
|
|
@@ -15446,9 +15472,9 @@ var require_safe_buffer = __commonJS({
|
|
|
15446
15472
|
}
|
|
15447
15473
|
});
|
|
15448
15474
|
|
|
15449
|
-
// ../../node_modules
|
|
15475
|
+
// ../../node_modules/@sap-ux/logger/node_modules/string_decoder/lib/string_decoder.js
|
|
15450
15476
|
var require_string_decoder = __commonJS({
|
|
15451
|
-
"../../node_modules
|
|
15477
|
+
"../../node_modules/@sap-ux/logger/node_modules/string_decoder/lib/string_decoder.js"(exports) {
|
|
15452
15478
|
"use strict";
|
|
15453
15479
|
var Buffer2 = require_safe_buffer().Buffer;
|
|
15454
15480
|
var isEncoding = Buffer2.isEncoding || function(encoding) {
|
|
@@ -15706,9 +15732,9 @@ var require_string_decoder = __commonJS({
|
|
|
15706
15732
|
}
|
|
15707
15733
|
});
|
|
15708
15734
|
|
|
15709
|
-
// ../../node_modules
|
|
15735
|
+
// ../../node_modules/@sap-ux/logger/node_modules/readable-stream/lib/internal/streams/end-of-stream.js
|
|
15710
15736
|
var require_end_of_stream = __commonJS({
|
|
15711
|
-
"../../node_modules
|
|
15737
|
+
"../../node_modules/@sap-ux/logger/node_modules/readable-stream/lib/internal/streams/end-of-stream.js"(exports, module2) {
|
|
15712
15738
|
"use strict";
|
|
15713
15739
|
var ERR_STREAM_PREMATURE_CLOSE = require_errors().codes.ERR_STREAM_PREMATURE_CLOSE;
|
|
15714
15740
|
function once2(callback) {
|
|
@@ -15807,9 +15833,9 @@ var require_end_of_stream = __commonJS({
|
|
|
15807
15833
|
}
|
|
15808
15834
|
});
|
|
15809
15835
|
|
|
15810
|
-
// ../../node_modules
|
|
15836
|
+
// ../../node_modules/@sap-ux/logger/node_modules/readable-stream/lib/internal/streams/async_iterator.js
|
|
15811
15837
|
var require_async_iterator = __commonJS({
|
|
15812
|
-
"../../node_modules
|
|
15838
|
+
"../../node_modules/@sap-ux/logger/node_modules/readable-stream/lib/internal/streams/async_iterator.js"(exports, module2) {
|
|
15813
15839
|
"use strict";
|
|
15814
15840
|
var _Object$setPrototypeO;
|
|
15815
15841
|
function _defineProperty2(obj, key, value) {
|
|
@@ -15975,9 +16001,9 @@ var require_async_iterator = __commonJS({
|
|
|
15975
16001
|
}
|
|
15976
16002
|
});
|
|
15977
16003
|
|
|
15978
|
-
// ../../node_modules
|
|
16004
|
+
// ../../node_modules/@sap-ux/logger/node_modules/readable-stream/lib/internal/streams/from.js
|
|
15979
16005
|
var require_from = __commonJS({
|
|
15980
|
-
"../../node_modules
|
|
16006
|
+
"../../node_modules/@sap-ux/logger/node_modules/readable-stream/lib/internal/streams/from.js"(exports, module2) {
|
|
15981
16007
|
"use strict";
|
|
15982
16008
|
function asyncGeneratorStep(gen, resolve, reject2, _next, _throw, key, arg) {
|
|
15983
16009
|
try {
|
|
@@ -16092,9 +16118,9 @@ var require_from = __commonJS({
|
|
|
16092
16118
|
}
|
|
16093
16119
|
});
|
|
16094
16120
|
|
|
16095
|
-
// ../../node_modules
|
|
16121
|
+
// ../../node_modules/@sap-ux/logger/node_modules/readable-stream/lib/_stream_readable.js
|
|
16096
16122
|
var require_stream_readable = __commonJS({
|
|
16097
|
-
"../../node_modules
|
|
16123
|
+
"../../node_modules/@sap-ux/logger/node_modules/readable-stream/lib/_stream_readable.js"(exports, module2) {
|
|
16098
16124
|
"use strict";
|
|
16099
16125
|
module2.exports = Readable2;
|
|
16100
16126
|
var Duplex;
|
|
@@ -16890,9 +16916,9 @@ var require_stream_readable = __commonJS({
|
|
|
16890
16916
|
}
|
|
16891
16917
|
});
|
|
16892
16918
|
|
|
16893
|
-
// ../../node_modules
|
|
16919
|
+
// ../../node_modules/@sap-ux/logger/node_modules/readable-stream/lib/_stream_duplex.js
|
|
16894
16920
|
var require_stream_duplex = __commonJS({
|
|
16895
|
-
"../../node_modules
|
|
16921
|
+
"../../node_modules/@sap-ux/logger/node_modules/readable-stream/lib/_stream_duplex.js"(exports, module2) {
|
|
16896
16922
|
"use strict";
|
|
16897
16923
|
var objectKeys = Object.keys || function(obj) {
|
|
16898
16924
|
var keys2 = [];
|
|
@@ -16990,9 +17016,9 @@ var require_stream_duplex = __commonJS({
|
|
|
16990
17016
|
}
|
|
16991
17017
|
});
|
|
16992
17018
|
|
|
16993
|
-
// ../../node_modules
|
|
17019
|
+
// ../../node_modules/@sap-ux/logger/node_modules/readable-stream/lib/_stream_writable.js
|
|
16994
17020
|
var require_stream_writable = __commonJS({
|
|
16995
|
-
"../../node_modules
|
|
17021
|
+
"../../node_modules/@sap-ux/logger/node_modules/readable-stream/lib/_stream_writable.js"(exports, module2) {
|
|
16996
17022
|
"use strict";
|
|
16997
17023
|
module2.exports = Writable;
|
|
16998
17024
|
function CorkedRequest(state) {
|
|
@@ -17608,75 +17634,9 @@ var require_triple_beam = __commonJS({
|
|
|
17608
17634
|
}
|
|
17609
17635
|
});
|
|
17610
17636
|
|
|
17611
|
-
// ../../node_modules/winston-transport/
|
|
17612
|
-
var
|
|
17613
|
-
"../../node_modules/winston-transport/
|
|
17614
|
-
"use strict";
|
|
17615
|
-
var util2 = require("util");
|
|
17616
|
-
var { LEVEL } = require_triple_beam();
|
|
17617
|
-
var TransportStream = require_winston_transport();
|
|
17618
|
-
var LegacyTransportStream = module2.exports = function LegacyTransportStream2(options = {}) {
|
|
17619
|
-
TransportStream.call(this, options);
|
|
17620
|
-
if (!options.transport || typeof options.transport.log !== "function") {
|
|
17621
|
-
throw new Error("Invalid transport, must be an object with a log method.");
|
|
17622
|
-
}
|
|
17623
|
-
this.transport = options.transport;
|
|
17624
|
-
this.level = this.level || options.transport.level;
|
|
17625
|
-
this.handleExceptions = this.handleExceptions || options.transport.handleExceptions;
|
|
17626
|
-
this._deprecated();
|
|
17627
|
-
function transportError(err) {
|
|
17628
|
-
this.emit("error", err, this.transport);
|
|
17629
|
-
}
|
|
17630
|
-
if (!this.transport.__winstonError) {
|
|
17631
|
-
this.transport.__winstonError = transportError.bind(this);
|
|
17632
|
-
this.transport.on("error", this.transport.__winstonError);
|
|
17633
|
-
}
|
|
17634
|
-
};
|
|
17635
|
-
util2.inherits(LegacyTransportStream, TransportStream);
|
|
17636
|
-
LegacyTransportStream.prototype._write = function _write(info, enc, callback) {
|
|
17637
|
-
if (this.silent || info.exception === true && !this.handleExceptions) {
|
|
17638
|
-
return callback(null);
|
|
17639
|
-
}
|
|
17640
|
-
if (!this.level || this.levels[this.level] >= this.levels[info[LEVEL]]) {
|
|
17641
|
-
this.transport.log(info[LEVEL], info.message, info, this._nop);
|
|
17642
|
-
}
|
|
17643
|
-
callback(null);
|
|
17644
|
-
};
|
|
17645
|
-
LegacyTransportStream.prototype._writev = function _writev(chunks, callback) {
|
|
17646
|
-
for (let i = 0; i < chunks.length; i++) {
|
|
17647
|
-
if (this._accept(chunks[i])) {
|
|
17648
|
-
this.transport.log(
|
|
17649
|
-
chunks[i].chunk[LEVEL],
|
|
17650
|
-
chunks[i].chunk.message,
|
|
17651
|
-
chunks[i].chunk,
|
|
17652
|
-
this._nop
|
|
17653
|
-
);
|
|
17654
|
-
chunks[i].callback();
|
|
17655
|
-
}
|
|
17656
|
-
}
|
|
17657
|
-
return callback(null);
|
|
17658
|
-
};
|
|
17659
|
-
LegacyTransportStream.prototype._deprecated = function _deprecated() {
|
|
17660
|
-
console.error([
|
|
17661
|
-
`${this.transport.name} is a legacy winston transport. Consider upgrading: `,
|
|
17662
|
-
"- Upgrade docs: https://github.com/winstonjs/winston/blob/master/UPGRADE-3.0.md"
|
|
17663
|
-
].join("\n"));
|
|
17664
|
-
};
|
|
17665
|
-
LegacyTransportStream.prototype.close = function close() {
|
|
17666
|
-
if (this.transport.close) {
|
|
17667
|
-
this.transport.close();
|
|
17668
|
-
}
|
|
17669
|
-
if (this.transport.__winstonError) {
|
|
17670
|
-
this.transport.removeListener("error", this.transport.__winstonError);
|
|
17671
|
-
this.transport.__winstonError = null;
|
|
17672
|
-
}
|
|
17673
|
-
};
|
|
17674
|
-
}
|
|
17675
|
-
});
|
|
17676
|
-
|
|
17677
|
-
// ../../node_modules/winston-transport/index.js
|
|
17678
|
-
var require_winston_transport = __commonJS({
|
|
17679
|
-
"../../node_modules/winston-transport/index.js"(exports, module2) {
|
|
17637
|
+
// ../../node_modules/@sap-ux/logger/node_modules/winston-transport/modern.js
|
|
17638
|
+
var require_modern = __commonJS({
|
|
17639
|
+
"../../node_modules/@sap-ux/logger/node_modules/winston-transport/modern.js"(exports, module2) {
|
|
17680
17640
|
"use strict";
|
|
17681
17641
|
var util2 = require("util");
|
|
17682
17642
|
var Writable = require_stream_writable();
|
|
@@ -17788,6 +17748,80 @@ var require_winston_transport = __commonJS({
|
|
|
17788
17748
|
TransportStream.prototype._nop = function _nop() {
|
|
17789
17749
|
return void 0;
|
|
17790
17750
|
};
|
|
17751
|
+
}
|
|
17752
|
+
});
|
|
17753
|
+
|
|
17754
|
+
// ../../node_modules/@sap-ux/logger/node_modules/winston-transport/legacy.js
|
|
17755
|
+
var require_legacy = __commonJS({
|
|
17756
|
+
"../../node_modules/@sap-ux/logger/node_modules/winston-transport/legacy.js"(exports, module2) {
|
|
17757
|
+
"use strict";
|
|
17758
|
+
var util2 = require("util");
|
|
17759
|
+
var { LEVEL } = require_triple_beam();
|
|
17760
|
+
var TransportStream = require_modern();
|
|
17761
|
+
var LegacyTransportStream = module2.exports = function LegacyTransportStream2(options = {}) {
|
|
17762
|
+
TransportStream.call(this, options);
|
|
17763
|
+
if (!options.transport || typeof options.transport.log !== "function") {
|
|
17764
|
+
throw new Error("Invalid transport, must be an object with a log method.");
|
|
17765
|
+
}
|
|
17766
|
+
this.transport = options.transport;
|
|
17767
|
+
this.level = this.level || options.transport.level;
|
|
17768
|
+
this.handleExceptions = this.handleExceptions || options.transport.handleExceptions;
|
|
17769
|
+
this._deprecated();
|
|
17770
|
+
function transportError(err) {
|
|
17771
|
+
this.emit("error", err, this.transport);
|
|
17772
|
+
}
|
|
17773
|
+
if (!this.transport.__winstonError) {
|
|
17774
|
+
this.transport.__winstonError = transportError.bind(this);
|
|
17775
|
+
this.transport.on("error", this.transport.__winstonError);
|
|
17776
|
+
}
|
|
17777
|
+
};
|
|
17778
|
+
util2.inherits(LegacyTransportStream, TransportStream);
|
|
17779
|
+
LegacyTransportStream.prototype._write = function _write(info, enc, callback) {
|
|
17780
|
+
if (this.silent || info.exception === true && !this.handleExceptions) {
|
|
17781
|
+
return callback(null);
|
|
17782
|
+
}
|
|
17783
|
+
if (!this.level || this.levels[this.level] >= this.levels[info[LEVEL]]) {
|
|
17784
|
+
this.transport.log(info[LEVEL], info.message, info, this._nop);
|
|
17785
|
+
}
|
|
17786
|
+
callback(null);
|
|
17787
|
+
};
|
|
17788
|
+
LegacyTransportStream.prototype._writev = function _writev(chunks, callback) {
|
|
17789
|
+
for (let i = 0; i < chunks.length; i++) {
|
|
17790
|
+
if (this._accept(chunks[i])) {
|
|
17791
|
+
this.transport.log(
|
|
17792
|
+
chunks[i].chunk[LEVEL],
|
|
17793
|
+
chunks[i].chunk.message,
|
|
17794
|
+
chunks[i].chunk,
|
|
17795
|
+
this._nop
|
|
17796
|
+
);
|
|
17797
|
+
chunks[i].callback();
|
|
17798
|
+
}
|
|
17799
|
+
}
|
|
17800
|
+
return callback(null);
|
|
17801
|
+
};
|
|
17802
|
+
LegacyTransportStream.prototype._deprecated = function _deprecated() {
|
|
17803
|
+
console.error([
|
|
17804
|
+
`${this.transport.name} is a legacy winston transport. Consider upgrading: `,
|
|
17805
|
+
"- Upgrade docs: https://github.com/winstonjs/winston/blob/master/UPGRADE-3.0.md"
|
|
17806
|
+
].join("\n"));
|
|
17807
|
+
};
|
|
17808
|
+
LegacyTransportStream.prototype.close = function close() {
|
|
17809
|
+
if (this.transport.close) {
|
|
17810
|
+
this.transport.close();
|
|
17811
|
+
}
|
|
17812
|
+
if (this.transport.__winstonError) {
|
|
17813
|
+
this.transport.removeListener("error", this.transport.__winstonError);
|
|
17814
|
+
this.transport.__winstonError = null;
|
|
17815
|
+
}
|
|
17816
|
+
};
|
|
17817
|
+
}
|
|
17818
|
+
});
|
|
17819
|
+
|
|
17820
|
+
// ../../node_modules/@sap-ux/logger/node_modules/winston-transport/index.js
|
|
17821
|
+
var require_winston_transport = __commonJS({
|
|
17822
|
+
"../../node_modules/@sap-ux/logger/node_modules/winston-transport/index.js"(exports, module2) {
|
|
17823
|
+
"use strict";
|
|
17824
|
+
module2.exports = require_modern();
|
|
17791
17825
|
module2.exports.LegacyTransportStream = require_legacy();
|
|
17792
17826
|
}
|
|
17793
17827
|
});
|
|
@@ -17866,9 +17900,10 @@ var require_transport = __commonJS({
|
|
|
17866
17900
|
VSCodeTransport.instances = /* @__PURE__ */ new Map();
|
|
17867
17901
|
var ArrayTransport = class extends winston_transport_1.default {
|
|
17868
17902
|
constructor(opts) {
|
|
17903
|
+
var _a;
|
|
17869
17904
|
super({ level: typeof (opts === null || opts === void 0 ? void 0 : opts.logLevel) === "number" ? types_1.LogLevel[opts.logLevel].toLowerCase() : "debug" });
|
|
17870
17905
|
this.copy = types_1.Transport.prototype.copy;
|
|
17871
|
-
this.logs = (opts === null || opts === void 0 ? void 0 : opts.logs)
|
|
17906
|
+
this.logs = (_a = opts === null || opts === void 0 ? void 0 : opts.logs) !== null && _a !== void 0 ? _a : [];
|
|
17872
17907
|
}
|
|
17873
17908
|
log(info, next) {
|
|
17874
17909
|
this.logs.push(info);
|
|
@@ -20352,20 +20387,6 @@ var require_common3 = __commonJS({
|
|
|
20352
20387
|
obj[prop] = exports.warn[type](prop);
|
|
20353
20388
|
});
|
|
20354
20389
|
},
|
|
20355
|
-
moved(obj, movedTo, prop) {
|
|
20356
|
-
function movedNotice() {
|
|
20357
|
-
return () => {
|
|
20358
|
-
throw new Error([
|
|
20359
|
-
format2("winston.%s was moved in winston@3.0.0.", prop),
|
|
20360
|
-
format2("Use a winston.%s instead.", movedTo)
|
|
20361
|
-
].join("\n"));
|
|
20362
|
-
};
|
|
20363
|
-
}
|
|
20364
|
-
Object.defineProperty(obj, prop, {
|
|
20365
|
-
get: movedNotice,
|
|
20366
|
-
set: movedNotice
|
|
20367
|
-
});
|
|
20368
|
-
},
|
|
20369
20390
|
forProperties(obj, type, props) {
|
|
20370
20391
|
props.forEach((prop) => {
|
|
20371
20392
|
const notice = exports.warn[type](prop);
|
|
@@ -20385,7 +20406,7 @@ var require_package = __commonJS({
|
|
|
20385
20406
|
module2.exports = {
|
|
20386
20407
|
name: "winston",
|
|
20387
20408
|
description: "A logger for just about everything.",
|
|
20388
|
-
version: "3.
|
|
20409
|
+
version: "3.11.0",
|
|
20389
20410
|
author: "Charlie Robbins <charlie.robbins@gmail.com>",
|
|
20390
20411
|
maintainers: [
|
|
20391
20412
|
"David Hyde <dabh@alumni.stanford.edu>"
|
|
@@ -20409,6 +20430,7 @@ var require_package = __commonJS({
|
|
|
20409
20430
|
],
|
|
20410
20431
|
dependencies: {
|
|
20411
20432
|
"@dabh/diagnostics": "^2.0.2",
|
|
20433
|
+
"@colors/colors": "^1.6.0",
|
|
20412
20434
|
async: "^3.2.3",
|
|
20413
20435
|
"is-stream": "^2.0.0",
|
|
20414
20436
|
logform: "^2.4.0",
|
|
@@ -20423,9 +20445,8 @@ var require_package = __commonJS({
|
|
|
20423
20445
|
"@babel/cli": "^7.17.0",
|
|
20424
20446
|
"@babel/core": "^7.17.2",
|
|
20425
20447
|
"@babel/preset-env": "^7.16.7",
|
|
20426
|
-
"@colors/colors": "1.5.0",
|
|
20427
20448
|
"@dabh/eslint-config-populist": "^5.0.0",
|
|
20428
|
-
"@types/node": "^
|
|
20449
|
+
"@types/node": "^20.3.1",
|
|
20429
20450
|
"abstract-winston-transport": "^0.5.1",
|
|
20430
20451
|
assume: "^2.2.0",
|
|
20431
20452
|
"cross-spawn-async": "^2.2.5",
|
|
@@ -20433,13 +20454,13 @@ var require_package = __commonJS({
|
|
|
20433
20454
|
hock: "^1.4.1",
|
|
20434
20455
|
mocha: "8.1.3",
|
|
20435
20456
|
nyc: "^15.1.0",
|
|
20436
|
-
rimraf: "^
|
|
20457
|
+
rimraf: "^5.0.5",
|
|
20437
20458
|
split2: "^4.1.0",
|
|
20438
20459
|
"std-mocks": "^1.0.1",
|
|
20439
20460
|
through2: "^4.0.2",
|
|
20440
20461
|
"winston-compat": "^0.1.5"
|
|
20441
20462
|
},
|
|
20442
|
-
main: "./lib/winston",
|
|
20463
|
+
main: "./lib/winston.js",
|
|
20443
20464
|
browser: "./dist/winston",
|
|
20444
20465
|
types: "./index.d.ts",
|
|
20445
20466
|
scripts: {
|
|
@@ -20459,48 +20480,2754 @@ var require_package = __commonJS({
|
|
|
20459
20480
|
}
|
|
20460
20481
|
});
|
|
20461
20482
|
|
|
20462
|
-
// ../../node_modules/winston/lib/
|
|
20463
|
-
var
|
|
20464
|
-
"../../node_modules/winston/lib/
|
|
20483
|
+
// ../../node_modules/winston-transport/node_modules/readable-stream/lib/internal/streams/stream.js
|
|
20484
|
+
var require_stream2 = __commonJS({
|
|
20485
|
+
"../../node_modules/winston-transport/node_modules/readable-stream/lib/internal/streams/stream.js"(exports, module2) {
|
|
20486
|
+
module2.exports = require("stream");
|
|
20487
|
+
}
|
|
20488
|
+
});
|
|
20489
|
+
|
|
20490
|
+
// ../../node_modules/winston-transport/node_modules/readable-stream/lib/internal/streams/destroy.js
|
|
20491
|
+
var require_destroy2 = __commonJS({
|
|
20492
|
+
"../../node_modules/winston-transport/node_modules/readable-stream/lib/internal/streams/destroy.js"(exports, module2) {
|
|
20465
20493
|
"use strict";
|
|
20466
|
-
|
|
20467
|
-
|
|
20468
|
-
|
|
20469
|
-
|
|
20470
|
-
|
|
20471
|
-
|
|
20472
|
-
|
|
20473
|
-
|
|
20474
|
-
|
|
20475
|
-
|
|
20476
|
-
|
|
20477
|
-
|
|
20478
|
-
|
|
20479
|
-
this.consoleWarnLevels = this._stringArrayToSet(options.consoleWarnLevels);
|
|
20480
|
-
this.eol = typeof options.eol === "string" ? options.eol : os.EOL;
|
|
20481
|
-
this.setMaxListeners(30);
|
|
20482
|
-
}
|
|
20483
|
-
/**
|
|
20484
|
-
* Core logging method exposed to Winston.
|
|
20485
|
-
* @param {Object} info - TODO: add param description.
|
|
20486
|
-
* @param {Function} callback - TODO: add param description.
|
|
20487
|
-
* @returns {undefined}
|
|
20488
|
-
*/
|
|
20489
|
-
log(info, callback) {
|
|
20490
|
-
setImmediate(() => this.emit("logged", info));
|
|
20491
|
-
if (this.stderrLevels[info[LEVEL]]) {
|
|
20492
|
-
if (console._stderr) {
|
|
20493
|
-
console._stderr.write(`${info[MESSAGE]}${this.eol}`);
|
|
20494
|
-
} else {
|
|
20495
|
-
console.error(info[MESSAGE]);
|
|
20496
|
-
}
|
|
20497
|
-
if (callback) {
|
|
20498
|
-
callback();
|
|
20494
|
+
function destroy(err, cb) {
|
|
20495
|
+
var _this = this;
|
|
20496
|
+
var readableDestroyed = this._readableState && this._readableState.destroyed;
|
|
20497
|
+
var writableDestroyed = this._writableState && this._writableState.destroyed;
|
|
20498
|
+
if (readableDestroyed || writableDestroyed) {
|
|
20499
|
+
if (cb) {
|
|
20500
|
+
cb(err);
|
|
20501
|
+
} else if (err) {
|
|
20502
|
+
if (!this._writableState) {
|
|
20503
|
+
process.nextTick(emitErrorNT, this, err);
|
|
20504
|
+
} else if (!this._writableState.errorEmitted) {
|
|
20505
|
+
this._writableState.errorEmitted = true;
|
|
20506
|
+
process.nextTick(emitErrorNT, this, err);
|
|
20499
20507
|
}
|
|
20500
|
-
|
|
20501
|
-
|
|
20502
|
-
|
|
20503
|
-
|
|
20508
|
+
}
|
|
20509
|
+
return this;
|
|
20510
|
+
}
|
|
20511
|
+
if (this._readableState) {
|
|
20512
|
+
this._readableState.destroyed = true;
|
|
20513
|
+
}
|
|
20514
|
+
if (this._writableState) {
|
|
20515
|
+
this._writableState.destroyed = true;
|
|
20516
|
+
}
|
|
20517
|
+
this._destroy(err || null, function(err2) {
|
|
20518
|
+
if (!cb && err2) {
|
|
20519
|
+
if (!_this._writableState) {
|
|
20520
|
+
process.nextTick(emitErrorAndCloseNT, _this, err2);
|
|
20521
|
+
} else if (!_this._writableState.errorEmitted) {
|
|
20522
|
+
_this._writableState.errorEmitted = true;
|
|
20523
|
+
process.nextTick(emitErrorAndCloseNT, _this, err2);
|
|
20524
|
+
} else {
|
|
20525
|
+
process.nextTick(emitCloseNT, _this);
|
|
20526
|
+
}
|
|
20527
|
+
} else if (cb) {
|
|
20528
|
+
process.nextTick(emitCloseNT, _this);
|
|
20529
|
+
cb(err2);
|
|
20530
|
+
} else {
|
|
20531
|
+
process.nextTick(emitCloseNT, _this);
|
|
20532
|
+
}
|
|
20533
|
+
});
|
|
20534
|
+
return this;
|
|
20535
|
+
}
|
|
20536
|
+
function emitErrorAndCloseNT(self2, err) {
|
|
20537
|
+
emitErrorNT(self2, err);
|
|
20538
|
+
emitCloseNT(self2);
|
|
20539
|
+
}
|
|
20540
|
+
function emitCloseNT(self2) {
|
|
20541
|
+
if (self2._writableState && !self2._writableState.emitClose)
|
|
20542
|
+
return;
|
|
20543
|
+
if (self2._readableState && !self2._readableState.emitClose)
|
|
20544
|
+
return;
|
|
20545
|
+
self2.emit("close");
|
|
20546
|
+
}
|
|
20547
|
+
function undestroy() {
|
|
20548
|
+
if (this._readableState) {
|
|
20549
|
+
this._readableState.destroyed = false;
|
|
20550
|
+
this._readableState.reading = false;
|
|
20551
|
+
this._readableState.ended = false;
|
|
20552
|
+
this._readableState.endEmitted = false;
|
|
20553
|
+
}
|
|
20554
|
+
if (this._writableState) {
|
|
20555
|
+
this._writableState.destroyed = false;
|
|
20556
|
+
this._writableState.ended = false;
|
|
20557
|
+
this._writableState.ending = false;
|
|
20558
|
+
this._writableState.finalCalled = false;
|
|
20559
|
+
this._writableState.prefinished = false;
|
|
20560
|
+
this._writableState.finished = false;
|
|
20561
|
+
this._writableState.errorEmitted = false;
|
|
20562
|
+
}
|
|
20563
|
+
}
|
|
20564
|
+
function emitErrorNT(self2, err) {
|
|
20565
|
+
self2.emit("error", err);
|
|
20566
|
+
}
|
|
20567
|
+
function errorOrDestroy(stream4, err) {
|
|
20568
|
+
var rState = stream4._readableState;
|
|
20569
|
+
var wState = stream4._writableState;
|
|
20570
|
+
if (rState && rState.autoDestroy || wState && wState.autoDestroy)
|
|
20571
|
+
stream4.destroy(err);
|
|
20572
|
+
else
|
|
20573
|
+
stream4.emit("error", err);
|
|
20574
|
+
}
|
|
20575
|
+
module2.exports = {
|
|
20576
|
+
destroy,
|
|
20577
|
+
undestroy,
|
|
20578
|
+
errorOrDestroy
|
|
20579
|
+
};
|
|
20580
|
+
}
|
|
20581
|
+
});
|
|
20582
|
+
|
|
20583
|
+
// ../../node_modules/winston-transport/node_modules/readable-stream/errors.js
|
|
20584
|
+
var require_errors3 = __commonJS({
|
|
20585
|
+
"../../node_modules/winston-transport/node_modules/readable-stream/errors.js"(exports, module2) {
|
|
20586
|
+
"use strict";
|
|
20587
|
+
var codes = {};
|
|
20588
|
+
function createErrorType(code, message, Base) {
|
|
20589
|
+
if (!Base) {
|
|
20590
|
+
Base = Error;
|
|
20591
|
+
}
|
|
20592
|
+
function getMessage(arg1, arg2, arg3) {
|
|
20593
|
+
if (typeof message === "string") {
|
|
20594
|
+
return message;
|
|
20595
|
+
} else {
|
|
20596
|
+
return message(arg1, arg2, arg3);
|
|
20597
|
+
}
|
|
20598
|
+
}
|
|
20599
|
+
class NodeError extends Base {
|
|
20600
|
+
constructor(arg1, arg2, arg3) {
|
|
20601
|
+
super(getMessage(arg1, arg2, arg3));
|
|
20602
|
+
}
|
|
20603
|
+
}
|
|
20604
|
+
NodeError.prototype.name = Base.name;
|
|
20605
|
+
NodeError.prototype.code = code;
|
|
20606
|
+
codes[code] = NodeError;
|
|
20607
|
+
}
|
|
20608
|
+
function oneOf(expected, thing) {
|
|
20609
|
+
if (Array.isArray(expected)) {
|
|
20610
|
+
const len = expected.length;
|
|
20611
|
+
expected = expected.map((i) => String(i));
|
|
20612
|
+
if (len > 2) {
|
|
20613
|
+
return `one of ${thing} ${expected.slice(0, len - 1).join(", ")}, or ` + expected[len - 1];
|
|
20614
|
+
} else if (len === 2) {
|
|
20615
|
+
return `one of ${thing} ${expected[0]} or ${expected[1]}`;
|
|
20616
|
+
} else {
|
|
20617
|
+
return `of ${thing} ${expected[0]}`;
|
|
20618
|
+
}
|
|
20619
|
+
} else {
|
|
20620
|
+
return `of ${thing} ${String(expected)}`;
|
|
20621
|
+
}
|
|
20622
|
+
}
|
|
20623
|
+
function startsWith(str, search, pos) {
|
|
20624
|
+
return str.substr(!pos || pos < 0 ? 0 : +pos, search.length) === search;
|
|
20625
|
+
}
|
|
20626
|
+
function endsWith2(str, search, this_len) {
|
|
20627
|
+
if (this_len === void 0 || this_len > str.length) {
|
|
20628
|
+
this_len = str.length;
|
|
20629
|
+
}
|
|
20630
|
+
return str.substring(this_len - search.length, this_len) === search;
|
|
20631
|
+
}
|
|
20632
|
+
function includes(str, search, start) {
|
|
20633
|
+
if (typeof start !== "number") {
|
|
20634
|
+
start = 0;
|
|
20635
|
+
}
|
|
20636
|
+
if (start + search.length > str.length) {
|
|
20637
|
+
return false;
|
|
20638
|
+
} else {
|
|
20639
|
+
return str.indexOf(search, start) !== -1;
|
|
20640
|
+
}
|
|
20641
|
+
}
|
|
20642
|
+
createErrorType("ERR_INVALID_OPT_VALUE", function(name, value) {
|
|
20643
|
+
return 'The value "' + value + '" is invalid for option "' + name + '"';
|
|
20644
|
+
}, TypeError);
|
|
20645
|
+
createErrorType("ERR_INVALID_ARG_TYPE", function(name, expected, actual) {
|
|
20646
|
+
let determiner;
|
|
20647
|
+
if (typeof expected === "string" && startsWith(expected, "not ")) {
|
|
20648
|
+
determiner = "must not be";
|
|
20649
|
+
expected = expected.replace(/^not /, "");
|
|
20650
|
+
} else {
|
|
20651
|
+
determiner = "must be";
|
|
20652
|
+
}
|
|
20653
|
+
let msg;
|
|
20654
|
+
if (endsWith2(name, " argument")) {
|
|
20655
|
+
msg = `The ${name} ${determiner} ${oneOf(expected, "type")}`;
|
|
20656
|
+
} else {
|
|
20657
|
+
const type = includes(name, ".") ? "property" : "argument";
|
|
20658
|
+
msg = `The "${name}" ${type} ${determiner} ${oneOf(expected, "type")}`;
|
|
20659
|
+
}
|
|
20660
|
+
msg += `. Received type ${typeof actual}`;
|
|
20661
|
+
return msg;
|
|
20662
|
+
}, TypeError);
|
|
20663
|
+
createErrorType("ERR_STREAM_PUSH_AFTER_EOF", "stream.push() after EOF");
|
|
20664
|
+
createErrorType("ERR_METHOD_NOT_IMPLEMENTED", function(name) {
|
|
20665
|
+
return "The " + name + " method is not implemented";
|
|
20666
|
+
});
|
|
20667
|
+
createErrorType("ERR_STREAM_PREMATURE_CLOSE", "Premature close");
|
|
20668
|
+
createErrorType("ERR_STREAM_DESTROYED", function(name) {
|
|
20669
|
+
return "Cannot call " + name + " after a stream was destroyed";
|
|
20670
|
+
});
|
|
20671
|
+
createErrorType("ERR_MULTIPLE_CALLBACK", "Callback called multiple times");
|
|
20672
|
+
createErrorType("ERR_STREAM_CANNOT_PIPE", "Cannot pipe, not readable");
|
|
20673
|
+
createErrorType("ERR_STREAM_WRITE_AFTER_END", "write after end");
|
|
20674
|
+
createErrorType("ERR_STREAM_NULL_VALUES", "May not write null values to stream", TypeError);
|
|
20675
|
+
createErrorType("ERR_UNKNOWN_ENCODING", function(arg) {
|
|
20676
|
+
return "Unknown encoding: " + arg;
|
|
20677
|
+
}, TypeError);
|
|
20678
|
+
createErrorType("ERR_STREAM_UNSHIFT_AFTER_END_EVENT", "stream.unshift() after end event");
|
|
20679
|
+
module2.exports.codes = codes;
|
|
20680
|
+
}
|
|
20681
|
+
});
|
|
20682
|
+
|
|
20683
|
+
// ../../node_modules/winston-transport/node_modules/readable-stream/lib/internal/streams/state.js
|
|
20684
|
+
var require_state3 = __commonJS({
|
|
20685
|
+
"../../node_modules/winston-transport/node_modules/readable-stream/lib/internal/streams/state.js"(exports, module2) {
|
|
20686
|
+
"use strict";
|
|
20687
|
+
var ERR_INVALID_OPT_VALUE = require_errors3().codes.ERR_INVALID_OPT_VALUE;
|
|
20688
|
+
function highWaterMarkFrom(options, isDuplex, duplexKey) {
|
|
20689
|
+
return options.highWaterMark != null ? options.highWaterMark : isDuplex ? options[duplexKey] : null;
|
|
20690
|
+
}
|
|
20691
|
+
function getHighWaterMark(state, options, duplexKey, isDuplex) {
|
|
20692
|
+
var hwm = highWaterMarkFrom(options, isDuplex, duplexKey);
|
|
20693
|
+
if (hwm != null) {
|
|
20694
|
+
if (!(isFinite(hwm) && Math.floor(hwm) === hwm) || hwm < 0) {
|
|
20695
|
+
var name = isDuplex ? duplexKey : "highWaterMark";
|
|
20696
|
+
throw new ERR_INVALID_OPT_VALUE(name, hwm);
|
|
20697
|
+
}
|
|
20698
|
+
return Math.floor(hwm);
|
|
20699
|
+
}
|
|
20700
|
+
return state.objectMode ? 16 : 16 * 1024;
|
|
20701
|
+
}
|
|
20702
|
+
module2.exports = {
|
|
20703
|
+
getHighWaterMark
|
|
20704
|
+
};
|
|
20705
|
+
}
|
|
20706
|
+
});
|
|
20707
|
+
|
|
20708
|
+
// ../../node_modules/winston-transport/node_modules/readable-stream/lib/internal/streams/buffer_list.js
|
|
20709
|
+
var require_buffer_list2 = __commonJS({
|
|
20710
|
+
"../../node_modules/winston-transport/node_modules/readable-stream/lib/internal/streams/buffer_list.js"(exports, module2) {
|
|
20711
|
+
"use strict";
|
|
20712
|
+
function ownKeys(object, enumerableOnly) {
|
|
20713
|
+
var keys = Object.keys(object);
|
|
20714
|
+
if (Object.getOwnPropertySymbols) {
|
|
20715
|
+
var symbols = Object.getOwnPropertySymbols(object);
|
|
20716
|
+
if (enumerableOnly)
|
|
20717
|
+
symbols = symbols.filter(function(sym) {
|
|
20718
|
+
return Object.getOwnPropertyDescriptor(object, sym).enumerable;
|
|
20719
|
+
});
|
|
20720
|
+
keys.push.apply(keys, symbols);
|
|
20721
|
+
}
|
|
20722
|
+
return keys;
|
|
20723
|
+
}
|
|
20724
|
+
function _objectSpread2(target) {
|
|
20725
|
+
for (var i = 1; i < arguments.length; i++) {
|
|
20726
|
+
var source = arguments[i] != null ? arguments[i] : {};
|
|
20727
|
+
if (i % 2) {
|
|
20728
|
+
ownKeys(Object(source), true).forEach(function(key) {
|
|
20729
|
+
_defineProperty2(target, key, source[key]);
|
|
20730
|
+
});
|
|
20731
|
+
} else if (Object.getOwnPropertyDescriptors) {
|
|
20732
|
+
Object.defineProperties(target, Object.getOwnPropertyDescriptors(source));
|
|
20733
|
+
} else {
|
|
20734
|
+
ownKeys(Object(source)).forEach(function(key) {
|
|
20735
|
+
Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key));
|
|
20736
|
+
});
|
|
20737
|
+
}
|
|
20738
|
+
}
|
|
20739
|
+
return target;
|
|
20740
|
+
}
|
|
20741
|
+
function _defineProperty2(obj, key, value) {
|
|
20742
|
+
if (key in obj) {
|
|
20743
|
+
Object.defineProperty(obj, key, { value, enumerable: true, configurable: true, writable: true });
|
|
20744
|
+
} else {
|
|
20745
|
+
obj[key] = value;
|
|
20746
|
+
}
|
|
20747
|
+
return obj;
|
|
20748
|
+
}
|
|
20749
|
+
function _classCallCheck2(instance, Constructor) {
|
|
20750
|
+
if (!(instance instanceof Constructor)) {
|
|
20751
|
+
throw new TypeError("Cannot call a class as a function");
|
|
20752
|
+
}
|
|
20753
|
+
}
|
|
20754
|
+
function _defineProperties2(target, props) {
|
|
20755
|
+
for (var i = 0; i < props.length; i++) {
|
|
20756
|
+
var descriptor = props[i];
|
|
20757
|
+
descriptor.enumerable = descriptor.enumerable || false;
|
|
20758
|
+
descriptor.configurable = true;
|
|
20759
|
+
if ("value" in descriptor)
|
|
20760
|
+
descriptor.writable = true;
|
|
20761
|
+
Object.defineProperty(target, descriptor.key, descriptor);
|
|
20762
|
+
}
|
|
20763
|
+
}
|
|
20764
|
+
function _createClass2(Constructor, protoProps, staticProps) {
|
|
20765
|
+
if (protoProps)
|
|
20766
|
+
_defineProperties2(Constructor.prototype, protoProps);
|
|
20767
|
+
if (staticProps)
|
|
20768
|
+
_defineProperties2(Constructor, staticProps);
|
|
20769
|
+
return Constructor;
|
|
20770
|
+
}
|
|
20771
|
+
var _require = require("buffer");
|
|
20772
|
+
var Buffer2 = _require.Buffer;
|
|
20773
|
+
var _require2 = require("util");
|
|
20774
|
+
var inspect = _require2.inspect;
|
|
20775
|
+
var custom = inspect && inspect.custom || "inspect";
|
|
20776
|
+
function copyBuffer(src, target, offset) {
|
|
20777
|
+
Buffer2.prototype.copy.call(src, target, offset);
|
|
20778
|
+
}
|
|
20779
|
+
module2.exports = /* @__PURE__ */ function() {
|
|
20780
|
+
function BufferList() {
|
|
20781
|
+
_classCallCheck2(this, BufferList);
|
|
20782
|
+
this.head = null;
|
|
20783
|
+
this.tail = null;
|
|
20784
|
+
this.length = 0;
|
|
20785
|
+
}
|
|
20786
|
+
_createClass2(BufferList, [{
|
|
20787
|
+
key: "push",
|
|
20788
|
+
value: function push(v) {
|
|
20789
|
+
var entry = {
|
|
20790
|
+
data: v,
|
|
20791
|
+
next: null
|
|
20792
|
+
};
|
|
20793
|
+
if (this.length > 0)
|
|
20794
|
+
this.tail.next = entry;
|
|
20795
|
+
else
|
|
20796
|
+
this.head = entry;
|
|
20797
|
+
this.tail = entry;
|
|
20798
|
+
++this.length;
|
|
20799
|
+
}
|
|
20800
|
+
}, {
|
|
20801
|
+
key: "unshift",
|
|
20802
|
+
value: function unshift(v) {
|
|
20803
|
+
var entry = {
|
|
20804
|
+
data: v,
|
|
20805
|
+
next: this.head
|
|
20806
|
+
};
|
|
20807
|
+
if (this.length === 0)
|
|
20808
|
+
this.tail = entry;
|
|
20809
|
+
this.head = entry;
|
|
20810
|
+
++this.length;
|
|
20811
|
+
}
|
|
20812
|
+
}, {
|
|
20813
|
+
key: "shift",
|
|
20814
|
+
value: function shift() {
|
|
20815
|
+
if (this.length === 0)
|
|
20816
|
+
return;
|
|
20817
|
+
var ret = this.head.data;
|
|
20818
|
+
if (this.length === 1)
|
|
20819
|
+
this.head = this.tail = null;
|
|
20820
|
+
else
|
|
20821
|
+
this.head = this.head.next;
|
|
20822
|
+
--this.length;
|
|
20823
|
+
return ret;
|
|
20824
|
+
}
|
|
20825
|
+
}, {
|
|
20826
|
+
key: "clear",
|
|
20827
|
+
value: function clear() {
|
|
20828
|
+
this.head = this.tail = null;
|
|
20829
|
+
this.length = 0;
|
|
20830
|
+
}
|
|
20831
|
+
}, {
|
|
20832
|
+
key: "join",
|
|
20833
|
+
value: function join2(s) {
|
|
20834
|
+
if (this.length === 0)
|
|
20835
|
+
return "";
|
|
20836
|
+
var p = this.head;
|
|
20837
|
+
var ret = "" + p.data;
|
|
20838
|
+
while (p = p.next) {
|
|
20839
|
+
ret += s + p.data;
|
|
20840
|
+
}
|
|
20841
|
+
return ret;
|
|
20842
|
+
}
|
|
20843
|
+
}, {
|
|
20844
|
+
key: "concat",
|
|
20845
|
+
value: function concat2(n) {
|
|
20846
|
+
if (this.length === 0)
|
|
20847
|
+
return Buffer2.alloc(0);
|
|
20848
|
+
var ret = Buffer2.allocUnsafe(n >>> 0);
|
|
20849
|
+
var p = this.head;
|
|
20850
|
+
var i = 0;
|
|
20851
|
+
while (p) {
|
|
20852
|
+
copyBuffer(p.data, ret, i);
|
|
20853
|
+
i += p.data.length;
|
|
20854
|
+
p = p.next;
|
|
20855
|
+
}
|
|
20856
|
+
return ret;
|
|
20857
|
+
}
|
|
20858
|
+
// Consumes a specified amount of bytes or characters from the buffered data.
|
|
20859
|
+
}, {
|
|
20860
|
+
key: "consume",
|
|
20861
|
+
value: function consume(n, hasStrings) {
|
|
20862
|
+
var ret;
|
|
20863
|
+
if (n < this.head.data.length) {
|
|
20864
|
+
ret = this.head.data.slice(0, n);
|
|
20865
|
+
this.head.data = this.head.data.slice(n);
|
|
20866
|
+
} else if (n === this.head.data.length) {
|
|
20867
|
+
ret = this.shift();
|
|
20868
|
+
} else {
|
|
20869
|
+
ret = hasStrings ? this._getString(n) : this._getBuffer(n);
|
|
20870
|
+
}
|
|
20871
|
+
return ret;
|
|
20872
|
+
}
|
|
20873
|
+
}, {
|
|
20874
|
+
key: "first",
|
|
20875
|
+
value: function first() {
|
|
20876
|
+
return this.head.data;
|
|
20877
|
+
}
|
|
20878
|
+
// Consumes a specified amount of characters from the buffered data.
|
|
20879
|
+
}, {
|
|
20880
|
+
key: "_getString",
|
|
20881
|
+
value: function _getString(n) {
|
|
20882
|
+
var p = this.head;
|
|
20883
|
+
var c = 1;
|
|
20884
|
+
var ret = p.data;
|
|
20885
|
+
n -= ret.length;
|
|
20886
|
+
while (p = p.next) {
|
|
20887
|
+
var str = p.data;
|
|
20888
|
+
var nb = n > str.length ? str.length : n;
|
|
20889
|
+
if (nb === str.length)
|
|
20890
|
+
ret += str;
|
|
20891
|
+
else
|
|
20892
|
+
ret += str.slice(0, n);
|
|
20893
|
+
n -= nb;
|
|
20894
|
+
if (n === 0) {
|
|
20895
|
+
if (nb === str.length) {
|
|
20896
|
+
++c;
|
|
20897
|
+
if (p.next)
|
|
20898
|
+
this.head = p.next;
|
|
20899
|
+
else
|
|
20900
|
+
this.head = this.tail = null;
|
|
20901
|
+
} else {
|
|
20902
|
+
this.head = p;
|
|
20903
|
+
p.data = str.slice(nb);
|
|
20904
|
+
}
|
|
20905
|
+
break;
|
|
20906
|
+
}
|
|
20907
|
+
++c;
|
|
20908
|
+
}
|
|
20909
|
+
this.length -= c;
|
|
20910
|
+
return ret;
|
|
20911
|
+
}
|
|
20912
|
+
// Consumes a specified amount of bytes from the buffered data.
|
|
20913
|
+
}, {
|
|
20914
|
+
key: "_getBuffer",
|
|
20915
|
+
value: function _getBuffer(n) {
|
|
20916
|
+
var ret = Buffer2.allocUnsafe(n);
|
|
20917
|
+
var p = this.head;
|
|
20918
|
+
var c = 1;
|
|
20919
|
+
p.data.copy(ret);
|
|
20920
|
+
n -= p.data.length;
|
|
20921
|
+
while (p = p.next) {
|
|
20922
|
+
var buf = p.data;
|
|
20923
|
+
var nb = n > buf.length ? buf.length : n;
|
|
20924
|
+
buf.copy(ret, ret.length - n, 0, nb);
|
|
20925
|
+
n -= nb;
|
|
20926
|
+
if (n === 0) {
|
|
20927
|
+
if (nb === buf.length) {
|
|
20928
|
+
++c;
|
|
20929
|
+
if (p.next)
|
|
20930
|
+
this.head = p.next;
|
|
20931
|
+
else
|
|
20932
|
+
this.head = this.tail = null;
|
|
20933
|
+
} else {
|
|
20934
|
+
this.head = p;
|
|
20935
|
+
p.data = buf.slice(nb);
|
|
20936
|
+
}
|
|
20937
|
+
break;
|
|
20938
|
+
}
|
|
20939
|
+
++c;
|
|
20940
|
+
}
|
|
20941
|
+
this.length -= c;
|
|
20942
|
+
return ret;
|
|
20943
|
+
}
|
|
20944
|
+
// Make sure the linked list only shows the minimal necessary information.
|
|
20945
|
+
}, {
|
|
20946
|
+
key: custom,
|
|
20947
|
+
value: function value(_23, options) {
|
|
20948
|
+
return inspect(this, _objectSpread2({}, options, {
|
|
20949
|
+
// Only inspect one level.
|
|
20950
|
+
depth: 0,
|
|
20951
|
+
// It should not recurse.
|
|
20952
|
+
customInspect: false
|
|
20953
|
+
}));
|
|
20954
|
+
}
|
|
20955
|
+
}]);
|
|
20956
|
+
return BufferList;
|
|
20957
|
+
}();
|
|
20958
|
+
}
|
|
20959
|
+
});
|
|
20960
|
+
|
|
20961
|
+
// ../../node_modules/winston-transport/node_modules/string_decoder/lib/string_decoder.js
|
|
20962
|
+
var require_string_decoder2 = __commonJS({
|
|
20963
|
+
"../../node_modules/winston-transport/node_modules/string_decoder/lib/string_decoder.js"(exports) {
|
|
20964
|
+
"use strict";
|
|
20965
|
+
var Buffer2 = require_safe_buffer().Buffer;
|
|
20966
|
+
var isEncoding = Buffer2.isEncoding || function(encoding) {
|
|
20967
|
+
encoding = "" + encoding;
|
|
20968
|
+
switch (encoding && encoding.toLowerCase()) {
|
|
20969
|
+
case "hex":
|
|
20970
|
+
case "utf8":
|
|
20971
|
+
case "utf-8":
|
|
20972
|
+
case "ascii":
|
|
20973
|
+
case "binary":
|
|
20974
|
+
case "base64":
|
|
20975
|
+
case "ucs2":
|
|
20976
|
+
case "ucs-2":
|
|
20977
|
+
case "utf16le":
|
|
20978
|
+
case "utf-16le":
|
|
20979
|
+
case "raw":
|
|
20980
|
+
return true;
|
|
20981
|
+
default:
|
|
20982
|
+
return false;
|
|
20983
|
+
}
|
|
20984
|
+
};
|
|
20985
|
+
function _normalizeEncoding(enc) {
|
|
20986
|
+
if (!enc)
|
|
20987
|
+
return "utf8";
|
|
20988
|
+
var retried;
|
|
20989
|
+
while (true) {
|
|
20990
|
+
switch (enc) {
|
|
20991
|
+
case "utf8":
|
|
20992
|
+
case "utf-8":
|
|
20993
|
+
return "utf8";
|
|
20994
|
+
case "ucs2":
|
|
20995
|
+
case "ucs-2":
|
|
20996
|
+
case "utf16le":
|
|
20997
|
+
case "utf-16le":
|
|
20998
|
+
return "utf16le";
|
|
20999
|
+
case "latin1":
|
|
21000
|
+
case "binary":
|
|
21001
|
+
return "latin1";
|
|
21002
|
+
case "base64":
|
|
21003
|
+
case "ascii":
|
|
21004
|
+
case "hex":
|
|
21005
|
+
return enc;
|
|
21006
|
+
default:
|
|
21007
|
+
if (retried)
|
|
21008
|
+
return;
|
|
21009
|
+
enc = ("" + enc).toLowerCase();
|
|
21010
|
+
retried = true;
|
|
21011
|
+
}
|
|
21012
|
+
}
|
|
21013
|
+
}
|
|
21014
|
+
function normalizeEncoding(enc) {
|
|
21015
|
+
var nenc = _normalizeEncoding(enc);
|
|
21016
|
+
if (typeof nenc !== "string" && (Buffer2.isEncoding === isEncoding || !isEncoding(enc)))
|
|
21017
|
+
throw new Error("Unknown encoding: " + enc);
|
|
21018
|
+
return nenc || enc;
|
|
21019
|
+
}
|
|
21020
|
+
exports.StringDecoder = StringDecoder;
|
|
21021
|
+
function StringDecoder(encoding) {
|
|
21022
|
+
this.encoding = normalizeEncoding(encoding);
|
|
21023
|
+
var nb;
|
|
21024
|
+
switch (this.encoding) {
|
|
21025
|
+
case "utf16le":
|
|
21026
|
+
this.text = utf16Text;
|
|
21027
|
+
this.end = utf16End;
|
|
21028
|
+
nb = 4;
|
|
21029
|
+
break;
|
|
21030
|
+
case "utf8":
|
|
21031
|
+
this.fillLast = utf8FillLast;
|
|
21032
|
+
nb = 4;
|
|
21033
|
+
break;
|
|
21034
|
+
case "base64":
|
|
21035
|
+
this.text = base64Text;
|
|
21036
|
+
this.end = base64End;
|
|
21037
|
+
nb = 3;
|
|
21038
|
+
break;
|
|
21039
|
+
default:
|
|
21040
|
+
this.write = simpleWrite;
|
|
21041
|
+
this.end = simpleEnd;
|
|
21042
|
+
return;
|
|
21043
|
+
}
|
|
21044
|
+
this.lastNeed = 0;
|
|
21045
|
+
this.lastTotal = 0;
|
|
21046
|
+
this.lastChar = Buffer2.allocUnsafe(nb);
|
|
21047
|
+
}
|
|
21048
|
+
StringDecoder.prototype.write = function(buf) {
|
|
21049
|
+
if (buf.length === 0)
|
|
21050
|
+
return "";
|
|
21051
|
+
var r;
|
|
21052
|
+
var i;
|
|
21053
|
+
if (this.lastNeed) {
|
|
21054
|
+
r = this.fillLast(buf);
|
|
21055
|
+
if (r === void 0)
|
|
21056
|
+
return "";
|
|
21057
|
+
i = this.lastNeed;
|
|
21058
|
+
this.lastNeed = 0;
|
|
21059
|
+
} else {
|
|
21060
|
+
i = 0;
|
|
21061
|
+
}
|
|
21062
|
+
if (i < buf.length)
|
|
21063
|
+
return r ? r + this.text(buf, i) : this.text(buf, i);
|
|
21064
|
+
return r || "";
|
|
21065
|
+
};
|
|
21066
|
+
StringDecoder.prototype.end = utf8End;
|
|
21067
|
+
StringDecoder.prototype.text = utf8Text;
|
|
21068
|
+
StringDecoder.prototype.fillLast = function(buf) {
|
|
21069
|
+
if (this.lastNeed <= buf.length) {
|
|
21070
|
+
buf.copy(this.lastChar, this.lastTotal - this.lastNeed, 0, this.lastNeed);
|
|
21071
|
+
return this.lastChar.toString(this.encoding, 0, this.lastTotal);
|
|
21072
|
+
}
|
|
21073
|
+
buf.copy(this.lastChar, this.lastTotal - this.lastNeed, 0, buf.length);
|
|
21074
|
+
this.lastNeed -= buf.length;
|
|
21075
|
+
};
|
|
21076
|
+
function utf8CheckByte(byte) {
|
|
21077
|
+
if (byte <= 127)
|
|
21078
|
+
return 0;
|
|
21079
|
+
else if (byte >> 5 === 6)
|
|
21080
|
+
return 2;
|
|
21081
|
+
else if (byte >> 4 === 14)
|
|
21082
|
+
return 3;
|
|
21083
|
+
else if (byte >> 3 === 30)
|
|
21084
|
+
return 4;
|
|
21085
|
+
return byte >> 6 === 2 ? -1 : -2;
|
|
21086
|
+
}
|
|
21087
|
+
function utf8CheckIncomplete(self2, buf, i) {
|
|
21088
|
+
var j = buf.length - 1;
|
|
21089
|
+
if (j < i)
|
|
21090
|
+
return 0;
|
|
21091
|
+
var nb = utf8CheckByte(buf[j]);
|
|
21092
|
+
if (nb >= 0) {
|
|
21093
|
+
if (nb > 0)
|
|
21094
|
+
self2.lastNeed = nb - 1;
|
|
21095
|
+
return nb;
|
|
21096
|
+
}
|
|
21097
|
+
if (--j < i || nb === -2)
|
|
21098
|
+
return 0;
|
|
21099
|
+
nb = utf8CheckByte(buf[j]);
|
|
21100
|
+
if (nb >= 0) {
|
|
21101
|
+
if (nb > 0)
|
|
21102
|
+
self2.lastNeed = nb - 2;
|
|
21103
|
+
return nb;
|
|
21104
|
+
}
|
|
21105
|
+
if (--j < i || nb === -2)
|
|
21106
|
+
return 0;
|
|
21107
|
+
nb = utf8CheckByte(buf[j]);
|
|
21108
|
+
if (nb >= 0) {
|
|
21109
|
+
if (nb > 0) {
|
|
21110
|
+
if (nb === 2)
|
|
21111
|
+
nb = 0;
|
|
21112
|
+
else
|
|
21113
|
+
self2.lastNeed = nb - 3;
|
|
21114
|
+
}
|
|
21115
|
+
return nb;
|
|
21116
|
+
}
|
|
21117
|
+
return 0;
|
|
21118
|
+
}
|
|
21119
|
+
function utf8CheckExtraBytes(self2, buf, p) {
|
|
21120
|
+
if ((buf[0] & 192) !== 128) {
|
|
21121
|
+
self2.lastNeed = 0;
|
|
21122
|
+
return "\uFFFD";
|
|
21123
|
+
}
|
|
21124
|
+
if (self2.lastNeed > 1 && buf.length > 1) {
|
|
21125
|
+
if ((buf[1] & 192) !== 128) {
|
|
21126
|
+
self2.lastNeed = 1;
|
|
21127
|
+
return "\uFFFD";
|
|
21128
|
+
}
|
|
21129
|
+
if (self2.lastNeed > 2 && buf.length > 2) {
|
|
21130
|
+
if ((buf[2] & 192) !== 128) {
|
|
21131
|
+
self2.lastNeed = 2;
|
|
21132
|
+
return "\uFFFD";
|
|
21133
|
+
}
|
|
21134
|
+
}
|
|
21135
|
+
}
|
|
21136
|
+
}
|
|
21137
|
+
function utf8FillLast(buf) {
|
|
21138
|
+
var p = this.lastTotal - this.lastNeed;
|
|
21139
|
+
var r = utf8CheckExtraBytes(this, buf, p);
|
|
21140
|
+
if (r !== void 0)
|
|
21141
|
+
return r;
|
|
21142
|
+
if (this.lastNeed <= buf.length) {
|
|
21143
|
+
buf.copy(this.lastChar, p, 0, this.lastNeed);
|
|
21144
|
+
return this.lastChar.toString(this.encoding, 0, this.lastTotal);
|
|
21145
|
+
}
|
|
21146
|
+
buf.copy(this.lastChar, p, 0, buf.length);
|
|
21147
|
+
this.lastNeed -= buf.length;
|
|
21148
|
+
}
|
|
21149
|
+
function utf8Text(buf, i) {
|
|
21150
|
+
var total = utf8CheckIncomplete(this, buf, i);
|
|
21151
|
+
if (!this.lastNeed)
|
|
21152
|
+
return buf.toString("utf8", i);
|
|
21153
|
+
this.lastTotal = total;
|
|
21154
|
+
var end = buf.length - (total - this.lastNeed);
|
|
21155
|
+
buf.copy(this.lastChar, 0, end);
|
|
21156
|
+
return buf.toString("utf8", i, end);
|
|
21157
|
+
}
|
|
21158
|
+
function utf8End(buf) {
|
|
21159
|
+
var r = buf && buf.length ? this.write(buf) : "";
|
|
21160
|
+
if (this.lastNeed)
|
|
21161
|
+
return r + "\uFFFD";
|
|
21162
|
+
return r;
|
|
21163
|
+
}
|
|
21164
|
+
function utf16Text(buf, i) {
|
|
21165
|
+
if ((buf.length - i) % 2 === 0) {
|
|
21166
|
+
var r = buf.toString("utf16le", i);
|
|
21167
|
+
if (r) {
|
|
21168
|
+
var c = r.charCodeAt(r.length - 1);
|
|
21169
|
+
if (c >= 55296 && c <= 56319) {
|
|
21170
|
+
this.lastNeed = 2;
|
|
21171
|
+
this.lastTotal = 4;
|
|
21172
|
+
this.lastChar[0] = buf[buf.length - 2];
|
|
21173
|
+
this.lastChar[1] = buf[buf.length - 1];
|
|
21174
|
+
return r.slice(0, -1);
|
|
21175
|
+
}
|
|
21176
|
+
}
|
|
21177
|
+
return r;
|
|
21178
|
+
}
|
|
21179
|
+
this.lastNeed = 1;
|
|
21180
|
+
this.lastTotal = 2;
|
|
21181
|
+
this.lastChar[0] = buf[buf.length - 1];
|
|
21182
|
+
return buf.toString("utf16le", i, buf.length - 1);
|
|
21183
|
+
}
|
|
21184
|
+
function utf16End(buf) {
|
|
21185
|
+
var r = buf && buf.length ? this.write(buf) : "";
|
|
21186
|
+
if (this.lastNeed) {
|
|
21187
|
+
var end = this.lastTotal - this.lastNeed;
|
|
21188
|
+
return r + this.lastChar.toString("utf16le", 0, end);
|
|
21189
|
+
}
|
|
21190
|
+
return r;
|
|
21191
|
+
}
|
|
21192
|
+
function base64Text(buf, i) {
|
|
21193
|
+
var n = (buf.length - i) % 3;
|
|
21194
|
+
if (n === 0)
|
|
21195
|
+
return buf.toString("base64", i);
|
|
21196
|
+
this.lastNeed = 3 - n;
|
|
21197
|
+
this.lastTotal = 3;
|
|
21198
|
+
if (n === 1) {
|
|
21199
|
+
this.lastChar[0] = buf[buf.length - 1];
|
|
21200
|
+
} else {
|
|
21201
|
+
this.lastChar[0] = buf[buf.length - 2];
|
|
21202
|
+
this.lastChar[1] = buf[buf.length - 1];
|
|
21203
|
+
}
|
|
21204
|
+
return buf.toString("base64", i, buf.length - n);
|
|
21205
|
+
}
|
|
21206
|
+
function base64End(buf) {
|
|
21207
|
+
var r = buf && buf.length ? this.write(buf) : "";
|
|
21208
|
+
if (this.lastNeed)
|
|
21209
|
+
return r + this.lastChar.toString("base64", 0, 3 - this.lastNeed);
|
|
21210
|
+
return r;
|
|
21211
|
+
}
|
|
21212
|
+
function simpleWrite(buf) {
|
|
21213
|
+
return buf.toString(this.encoding);
|
|
21214
|
+
}
|
|
21215
|
+
function simpleEnd(buf) {
|
|
21216
|
+
return buf && buf.length ? this.write(buf) : "";
|
|
21217
|
+
}
|
|
21218
|
+
}
|
|
21219
|
+
});
|
|
21220
|
+
|
|
21221
|
+
// ../../node_modules/winston-transport/node_modules/readable-stream/lib/internal/streams/end-of-stream.js
|
|
21222
|
+
var require_end_of_stream2 = __commonJS({
|
|
21223
|
+
"../../node_modules/winston-transport/node_modules/readable-stream/lib/internal/streams/end-of-stream.js"(exports, module2) {
|
|
21224
|
+
"use strict";
|
|
21225
|
+
var ERR_STREAM_PREMATURE_CLOSE = require_errors3().codes.ERR_STREAM_PREMATURE_CLOSE;
|
|
21226
|
+
function once2(callback) {
|
|
21227
|
+
var called = false;
|
|
21228
|
+
return function() {
|
|
21229
|
+
if (called)
|
|
21230
|
+
return;
|
|
21231
|
+
called = true;
|
|
21232
|
+
for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) {
|
|
21233
|
+
args[_key] = arguments[_key];
|
|
21234
|
+
}
|
|
21235
|
+
callback.apply(this, args);
|
|
21236
|
+
};
|
|
21237
|
+
}
|
|
21238
|
+
function noop3() {
|
|
21239
|
+
}
|
|
21240
|
+
function isRequest(stream4) {
|
|
21241
|
+
return stream4.setHeader && typeof stream4.abort === "function";
|
|
21242
|
+
}
|
|
21243
|
+
function eos(stream4, opts, callback) {
|
|
21244
|
+
if (typeof opts === "function")
|
|
21245
|
+
return eos(stream4, null, opts);
|
|
21246
|
+
if (!opts)
|
|
21247
|
+
opts = {};
|
|
21248
|
+
callback = once2(callback || noop3);
|
|
21249
|
+
var readable = opts.readable || opts.readable !== false && stream4.readable;
|
|
21250
|
+
var writable = opts.writable || opts.writable !== false && stream4.writable;
|
|
21251
|
+
var onlegacyfinish = function onlegacyfinish2() {
|
|
21252
|
+
if (!stream4.writable)
|
|
21253
|
+
onfinish();
|
|
21254
|
+
};
|
|
21255
|
+
var writableEnded = stream4._writableState && stream4._writableState.finished;
|
|
21256
|
+
var onfinish = function onfinish2() {
|
|
21257
|
+
writable = false;
|
|
21258
|
+
writableEnded = true;
|
|
21259
|
+
if (!readable)
|
|
21260
|
+
callback.call(stream4);
|
|
21261
|
+
};
|
|
21262
|
+
var readableEnded = stream4._readableState && stream4._readableState.endEmitted;
|
|
21263
|
+
var onend = function onend2() {
|
|
21264
|
+
readable = false;
|
|
21265
|
+
readableEnded = true;
|
|
21266
|
+
if (!writable)
|
|
21267
|
+
callback.call(stream4);
|
|
21268
|
+
};
|
|
21269
|
+
var onerror = function onerror2(err) {
|
|
21270
|
+
callback.call(stream4, err);
|
|
21271
|
+
};
|
|
21272
|
+
var onclose = function onclose2() {
|
|
21273
|
+
var err;
|
|
21274
|
+
if (readable && !readableEnded) {
|
|
21275
|
+
if (!stream4._readableState || !stream4._readableState.ended)
|
|
21276
|
+
err = new ERR_STREAM_PREMATURE_CLOSE();
|
|
21277
|
+
return callback.call(stream4, err);
|
|
21278
|
+
}
|
|
21279
|
+
if (writable && !writableEnded) {
|
|
21280
|
+
if (!stream4._writableState || !stream4._writableState.ended)
|
|
21281
|
+
err = new ERR_STREAM_PREMATURE_CLOSE();
|
|
21282
|
+
return callback.call(stream4, err);
|
|
21283
|
+
}
|
|
21284
|
+
};
|
|
21285
|
+
var onrequest = function onrequest2() {
|
|
21286
|
+
stream4.req.on("finish", onfinish);
|
|
21287
|
+
};
|
|
21288
|
+
if (isRequest(stream4)) {
|
|
21289
|
+
stream4.on("complete", onfinish);
|
|
21290
|
+
stream4.on("abort", onclose);
|
|
21291
|
+
if (stream4.req)
|
|
21292
|
+
onrequest();
|
|
21293
|
+
else
|
|
21294
|
+
stream4.on("request", onrequest);
|
|
21295
|
+
} else if (writable && !stream4._writableState) {
|
|
21296
|
+
stream4.on("end", onlegacyfinish);
|
|
21297
|
+
stream4.on("close", onlegacyfinish);
|
|
21298
|
+
}
|
|
21299
|
+
stream4.on("end", onend);
|
|
21300
|
+
stream4.on("finish", onfinish);
|
|
21301
|
+
if (opts.error !== false)
|
|
21302
|
+
stream4.on("error", onerror);
|
|
21303
|
+
stream4.on("close", onclose);
|
|
21304
|
+
return function() {
|
|
21305
|
+
stream4.removeListener("complete", onfinish);
|
|
21306
|
+
stream4.removeListener("abort", onclose);
|
|
21307
|
+
stream4.removeListener("request", onrequest);
|
|
21308
|
+
if (stream4.req)
|
|
21309
|
+
stream4.req.removeListener("finish", onfinish);
|
|
21310
|
+
stream4.removeListener("end", onlegacyfinish);
|
|
21311
|
+
stream4.removeListener("close", onlegacyfinish);
|
|
21312
|
+
stream4.removeListener("finish", onfinish);
|
|
21313
|
+
stream4.removeListener("end", onend);
|
|
21314
|
+
stream4.removeListener("error", onerror);
|
|
21315
|
+
stream4.removeListener("close", onclose);
|
|
21316
|
+
};
|
|
21317
|
+
}
|
|
21318
|
+
module2.exports = eos;
|
|
21319
|
+
}
|
|
21320
|
+
});
|
|
21321
|
+
|
|
21322
|
+
// ../../node_modules/winston-transport/node_modules/readable-stream/lib/internal/streams/async_iterator.js
|
|
21323
|
+
var require_async_iterator2 = __commonJS({
|
|
21324
|
+
"../../node_modules/winston-transport/node_modules/readable-stream/lib/internal/streams/async_iterator.js"(exports, module2) {
|
|
21325
|
+
"use strict";
|
|
21326
|
+
var _Object$setPrototypeO;
|
|
21327
|
+
function _defineProperty2(obj, key, value) {
|
|
21328
|
+
if (key in obj) {
|
|
21329
|
+
Object.defineProperty(obj, key, { value, enumerable: true, configurable: true, writable: true });
|
|
21330
|
+
} else {
|
|
21331
|
+
obj[key] = value;
|
|
21332
|
+
}
|
|
21333
|
+
return obj;
|
|
21334
|
+
}
|
|
21335
|
+
var finished = require_end_of_stream2();
|
|
21336
|
+
var kLastResolve = Symbol("lastResolve");
|
|
21337
|
+
var kLastReject = Symbol("lastReject");
|
|
21338
|
+
var kError = Symbol("error");
|
|
21339
|
+
var kEnded = Symbol("ended");
|
|
21340
|
+
var kLastPromise = Symbol("lastPromise");
|
|
21341
|
+
var kHandlePromise = Symbol("handlePromise");
|
|
21342
|
+
var kStream = Symbol("stream");
|
|
21343
|
+
function createIterResult(value, done) {
|
|
21344
|
+
return {
|
|
21345
|
+
value,
|
|
21346
|
+
done
|
|
21347
|
+
};
|
|
21348
|
+
}
|
|
21349
|
+
function readAndResolve(iter) {
|
|
21350
|
+
var resolve = iter[kLastResolve];
|
|
21351
|
+
if (resolve !== null) {
|
|
21352
|
+
var data = iter[kStream].read();
|
|
21353
|
+
if (data !== null) {
|
|
21354
|
+
iter[kLastPromise] = null;
|
|
21355
|
+
iter[kLastResolve] = null;
|
|
21356
|
+
iter[kLastReject] = null;
|
|
21357
|
+
resolve(createIterResult(data, false));
|
|
21358
|
+
}
|
|
21359
|
+
}
|
|
21360
|
+
}
|
|
21361
|
+
function onReadable(iter) {
|
|
21362
|
+
process.nextTick(readAndResolve, iter);
|
|
21363
|
+
}
|
|
21364
|
+
function wrapForNext(lastPromise, iter) {
|
|
21365
|
+
return function(resolve, reject2) {
|
|
21366
|
+
lastPromise.then(function() {
|
|
21367
|
+
if (iter[kEnded]) {
|
|
21368
|
+
resolve(createIterResult(void 0, true));
|
|
21369
|
+
return;
|
|
21370
|
+
}
|
|
21371
|
+
iter[kHandlePromise](resolve, reject2);
|
|
21372
|
+
}, reject2);
|
|
21373
|
+
};
|
|
21374
|
+
}
|
|
21375
|
+
var AsyncIteratorPrototype = Object.getPrototypeOf(function() {
|
|
21376
|
+
});
|
|
21377
|
+
var ReadableStreamAsyncIteratorPrototype = Object.setPrototypeOf((_Object$setPrototypeO = {
|
|
21378
|
+
get stream() {
|
|
21379
|
+
return this[kStream];
|
|
21380
|
+
},
|
|
21381
|
+
next: function next() {
|
|
21382
|
+
var _this = this;
|
|
21383
|
+
var error2 = this[kError];
|
|
21384
|
+
if (error2 !== null) {
|
|
21385
|
+
return Promise.reject(error2);
|
|
21386
|
+
}
|
|
21387
|
+
if (this[kEnded]) {
|
|
21388
|
+
return Promise.resolve(createIterResult(void 0, true));
|
|
21389
|
+
}
|
|
21390
|
+
if (this[kStream].destroyed) {
|
|
21391
|
+
return new Promise(function(resolve, reject2) {
|
|
21392
|
+
process.nextTick(function() {
|
|
21393
|
+
if (_this[kError]) {
|
|
21394
|
+
reject2(_this[kError]);
|
|
21395
|
+
} else {
|
|
21396
|
+
resolve(createIterResult(void 0, true));
|
|
21397
|
+
}
|
|
21398
|
+
});
|
|
21399
|
+
});
|
|
21400
|
+
}
|
|
21401
|
+
var lastPromise = this[kLastPromise];
|
|
21402
|
+
var promise;
|
|
21403
|
+
if (lastPromise) {
|
|
21404
|
+
promise = new Promise(wrapForNext(lastPromise, this));
|
|
21405
|
+
} else {
|
|
21406
|
+
var data = this[kStream].read();
|
|
21407
|
+
if (data !== null) {
|
|
21408
|
+
return Promise.resolve(createIterResult(data, false));
|
|
21409
|
+
}
|
|
21410
|
+
promise = new Promise(this[kHandlePromise]);
|
|
21411
|
+
}
|
|
21412
|
+
this[kLastPromise] = promise;
|
|
21413
|
+
return promise;
|
|
21414
|
+
}
|
|
21415
|
+
}, _defineProperty2(_Object$setPrototypeO, Symbol.asyncIterator, function() {
|
|
21416
|
+
return this;
|
|
21417
|
+
}), _defineProperty2(_Object$setPrototypeO, "return", function _return() {
|
|
21418
|
+
var _this2 = this;
|
|
21419
|
+
return new Promise(function(resolve, reject2) {
|
|
21420
|
+
_this2[kStream].destroy(null, function(err) {
|
|
21421
|
+
if (err) {
|
|
21422
|
+
reject2(err);
|
|
21423
|
+
return;
|
|
21424
|
+
}
|
|
21425
|
+
resolve(createIterResult(void 0, true));
|
|
21426
|
+
});
|
|
21427
|
+
});
|
|
21428
|
+
}), _Object$setPrototypeO), AsyncIteratorPrototype);
|
|
21429
|
+
var createReadableStreamAsyncIterator = function createReadableStreamAsyncIterator2(stream4) {
|
|
21430
|
+
var _Object$create;
|
|
21431
|
+
var iterator = Object.create(ReadableStreamAsyncIteratorPrototype, (_Object$create = {}, _defineProperty2(_Object$create, kStream, {
|
|
21432
|
+
value: stream4,
|
|
21433
|
+
writable: true
|
|
21434
|
+
}), _defineProperty2(_Object$create, kLastResolve, {
|
|
21435
|
+
value: null,
|
|
21436
|
+
writable: true
|
|
21437
|
+
}), _defineProperty2(_Object$create, kLastReject, {
|
|
21438
|
+
value: null,
|
|
21439
|
+
writable: true
|
|
21440
|
+
}), _defineProperty2(_Object$create, kError, {
|
|
21441
|
+
value: null,
|
|
21442
|
+
writable: true
|
|
21443
|
+
}), _defineProperty2(_Object$create, kEnded, {
|
|
21444
|
+
value: stream4._readableState.endEmitted,
|
|
21445
|
+
writable: true
|
|
21446
|
+
}), _defineProperty2(_Object$create, kHandlePromise, {
|
|
21447
|
+
value: function value(resolve, reject2) {
|
|
21448
|
+
var data = iterator[kStream].read();
|
|
21449
|
+
if (data) {
|
|
21450
|
+
iterator[kLastPromise] = null;
|
|
21451
|
+
iterator[kLastResolve] = null;
|
|
21452
|
+
iterator[kLastReject] = null;
|
|
21453
|
+
resolve(createIterResult(data, false));
|
|
21454
|
+
} else {
|
|
21455
|
+
iterator[kLastResolve] = resolve;
|
|
21456
|
+
iterator[kLastReject] = reject2;
|
|
21457
|
+
}
|
|
21458
|
+
},
|
|
21459
|
+
writable: true
|
|
21460
|
+
}), _Object$create));
|
|
21461
|
+
iterator[kLastPromise] = null;
|
|
21462
|
+
finished(stream4, function(err) {
|
|
21463
|
+
if (err && err.code !== "ERR_STREAM_PREMATURE_CLOSE") {
|
|
21464
|
+
var reject2 = iterator[kLastReject];
|
|
21465
|
+
if (reject2 !== null) {
|
|
21466
|
+
iterator[kLastPromise] = null;
|
|
21467
|
+
iterator[kLastResolve] = null;
|
|
21468
|
+
iterator[kLastReject] = null;
|
|
21469
|
+
reject2(err);
|
|
21470
|
+
}
|
|
21471
|
+
iterator[kError] = err;
|
|
21472
|
+
return;
|
|
21473
|
+
}
|
|
21474
|
+
var resolve = iterator[kLastResolve];
|
|
21475
|
+
if (resolve !== null) {
|
|
21476
|
+
iterator[kLastPromise] = null;
|
|
21477
|
+
iterator[kLastResolve] = null;
|
|
21478
|
+
iterator[kLastReject] = null;
|
|
21479
|
+
resolve(createIterResult(void 0, true));
|
|
21480
|
+
}
|
|
21481
|
+
iterator[kEnded] = true;
|
|
21482
|
+
});
|
|
21483
|
+
stream4.on("readable", onReadable.bind(null, iterator));
|
|
21484
|
+
return iterator;
|
|
21485
|
+
};
|
|
21486
|
+
module2.exports = createReadableStreamAsyncIterator;
|
|
21487
|
+
}
|
|
21488
|
+
});
|
|
21489
|
+
|
|
21490
|
+
// ../../node_modules/winston-transport/node_modules/readable-stream/lib/internal/streams/from.js
|
|
21491
|
+
var require_from2 = __commonJS({
|
|
21492
|
+
"../../node_modules/winston-transport/node_modules/readable-stream/lib/internal/streams/from.js"(exports, module2) {
|
|
21493
|
+
"use strict";
|
|
21494
|
+
function asyncGeneratorStep(gen, resolve, reject2, _next, _throw, key, arg) {
|
|
21495
|
+
try {
|
|
21496
|
+
var info = gen[key](arg);
|
|
21497
|
+
var value = info.value;
|
|
21498
|
+
} catch (error2) {
|
|
21499
|
+
reject2(error2);
|
|
21500
|
+
return;
|
|
21501
|
+
}
|
|
21502
|
+
if (info.done) {
|
|
21503
|
+
resolve(value);
|
|
21504
|
+
} else {
|
|
21505
|
+
Promise.resolve(value).then(_next, _throw);
|
|
21506
|
+
}
|
|
21507
|
+
}
|
|
21508
|
+
function _asyncToGenerator(fn) {
|
|
21509
|
+
return function() {
|
|
21510
|
+
var self2 = this, args = arguments;
|
|
21511
|
+
return new Promise(function(resolve, reject2) {
|
|
21512
|
+
var gen = fn.apply(self2, args);
|
|
21513
|
+
function _next(value) {
|
|
21514
|
+
asyncGeneratorStep(gen, resolve, reject2, _next, _throw, "next", value);
|
|
21515
|
+
}
|
|
21516
|
+
function _throw(err) {
|
|
21517
|
+
asyncGeneratorStep(gen, resolve, reject2, _next, _throw, "throw", err);
|
|
21518
|
+
}
|
|
21519
|
+
_next(void 0);
|
|
21520
|
+
});
|
|
21521
|
+
};
|
|
21522
|
+
}
|
|
21523
|
+
function ownKeys(object, enumerableOnly) {
|
|
21524
|
+
var keys = Object.keys(object);
|
|
21525
|
+
if (Object.getOwnPropertySymbols) {
|
|
21526
|
+
var symbols = Object.getOwnPropertySymbols(object);
|
|
21527
|
+
if (enumerableOnly)
|
|
21528
|
+
symbols = symbols.filter(function(sym) {
|
|
21529
|
+
return Object.getOwnPropertyDescriptor(object, sym).enumerable;
|
|
21530
|
+
});
|
|
21531
|
+
keys.push.apply(keys, symbols);
|
|
21532
|
+
}
|
|
21533
|
+
return keys;
|
|
21534
|
+
}
|
|
21535
|
+
function _objectSpread2(target) {
|
|
21536
|
+
for (var i = 1; i < arguments.length; i++) {
|
|
21537
|
+
var source = arguments[i] != null ? arguments[i] : {};
|
|
21538
|
+
if (i % 2) {
|
|
21539
|
+
ownKeys(Object(source), true).forEach(function(key) {
|
|
21540
|
+
_defineProperty2(target, key, source[key]);
|
|
21541
|
+
});
|
|
21542
|
+
} else if (Object.getOwnPropertyDescriptors) {
|
|
21543
|
+
Object.defineProperties(target, Object.getOwnPropertyDescriptors(source));
|
|
21544
|
+
} else {
|
|
21545
|
+
ownKeys(Object(source)).forEach(function(key) {
|
|
21546
|
+
Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key));
|
|
21547
|
+
});
|
|
21548
|
+
}
|
|
21549
|
+
}
|
|
21550
|
+
return target;
|
|
21551
|
+
}
|
|
21552
|
+
function _defineProperty2(obj, key, value) {
|
|
21553
|
+
if (key in obj) {
|
|
21554
|
+
Object.defineProperty(obj, key, { value, enumerable: true, configurable: true, writable: true });
|
|
21555
|
+
} else {
|
|
21556
|
+
obj[key] = value;
|
|
21557
|
+
}
|
|
21558
|
+
return obj;
|
|
21559
|
+
}
|
|
21560
|
+
var ERR_INVALID_ARG_TYPE = require_errors3().codes.ERR_INVALID_ARG_TYPE;
|
|
21561
|
+
function from(Readable2, iterable, opts) {
|
|
21562
|
+
var iterator;
|
|
21563
|
+
if (iterable && typeof iterable.next === "function") {
|
|
21564
|
+
iterator = iterable;
|
|
21565
|
+
} else if (iterable && iterable[Symbol.asyncIterator])
|
|
21566
|
+
iterator = iterable[Symbol.asyncIterator]();
|
|
21567
|
+
else if (iterable && iterable[Symbol.iterator])
|
|
21568
|
+
iterator = iterable[Symbol.iterator]();
|
|
21569
|
+
else
|
|
21570
|
+
throw new ERR_INVALID_ARG_TYPE("iterable", ["Iterable"], iterable);
|
|
21571
|
+
var readable = new Readable2(_objectSpread2({
|
|
21572
|
+
objectMode: true
|
|
21573
|
+
}, opts));
|
|
21574
|
+
var reading = false;
|
|
21575
|
+
readable._read = function() {
|
|
21576
|
+
if (!reading) {
|
|
21577
|
+
reading = true;
|
|
21578
|
+
next();
|
|
21579
|
+
}
|
|
21580
|
+
};
|
|
21581
|
+
function next() {
|
|
21582
|
+
return _next2.apply(this, arguments);
|
|
21583
|
+
}
|
|
21584
|
+
function _next2() {
|
|
21585
|
+
_next2 = _asyncToGenerator(function* () {
|
|
21586
|
+
try {
|
|
21587
|
+
var _ref = yield iterator.next(), value = _ref.value, done = _ref.done;
|
|
21588
|
+
if (done) {
|
|
21589
|
+
readable.push(null);
|
|
21590
|
+
} else if (readable.push(yield value)) {
|
|
21591
|
+
next();
|
|
21592
|
+
} else {
|
|
21593
|
+
reading = false;
|
|
21594
|
+
}
|
|
21595
|
+
} catch (err) {
|
|
21596
|
+
readable.destroy(err);
|
|
21597
|
+
}
|
|
21598
|
+
});
|
|
21599
|
+
return _next2.apply(this, arguments);
|
|
21600
|
+
}
|
|
21601
|
+
return readable;
|
|
21602
|
+
}
|
|
21603
|
+
module2.exports = from;
|
|
21604
|
+
}
|
|
21605
|
+
});
|
|
21606
|
+
|
|
21607
|
+
// ../../node_modules/winston-transport/node_modules/readable-stream/lib/_stream_readable.js
|
|
21608
|
+
var require_stream_readable2 = __commonJS({
|
|
21609
|
+
"../../node_modules/winston-transport/node_modules/readable-stream/lib/_stream_readable.js"(exports, module2) {
|
|
21610
|
+
"use strict";
|
|
21611
|
+
module2.exports = Readable2;
|
|
21612
|
+
var Duplex;
|
|
21613
|
+
Readable2.ReadableState = ReadableState;
|
|
21614
|
+
var EE = require("events").EventEmitter;
|
|
21615
|
+
var EElistenerCount = function EElistenerCount2(emitter, type) {
|
|
21616
|
+
return emitter.listeners(type).length;
|
|
21617
|
+
};
|
|
21618
|
+
var Stream = require_stream2();
|
|
21619
|
+
var Buffer2 = require("buffer").Buffer;
|
|
21620
|
+
var OurUint8Array = global.Uint8Array || function() {
|
|
21621
|
+
};
|
|
21622
|
+
function _uint8ArrayToBuffer(chunk) {
|
|
21623
|
+
return Buffer2.from(chunk);
|
|
21624
|
+
}
|
|
21625
|
+
function _isUint8Array(obj) {
|
|
21626
|
+
return Buffer2.isBuffer(obj) || obj instanceof OurUint8Array;
|
|
21627
|
+
}
|
|
21628
|
+
var debugUtil = require("util");
|
|
21629
|
+
var debug;
|
|
21630
|
+
if (debugUtil && debugUtil.debuglog) {
|
|
21631
|
+
debug = debugUtil.debuglog("stream");
|
|
21632
|
+
} else {
|
|
21633
|
+
debug = function debug2() {
|
|
21634
|
+
};
|
|
21635
|
+
}
|
|
21636
|
+
var BufferList = require_buffer_list2();
|
|
21637
|
+
var destroyImpl = require_destroy2();
|
|
21638
|
+
var _require = require_state3();
|
|
21639
|
+
var getHighWaterMark = _require.getHighWaterMark;
|
|
21640
|
+
var _require$codes = require_errors3().codes;
|
|
21641
|
+
var ERR_INVALID_ARG_TYPE = _require$codes.ERR_INVALID_ARG_TYPE;
|
|
21642
|
+
var ERR_STREAM_PUSH_AFTER_EOF = _require$codes.ERR_STREAM_PUSH_AFTER_EOF;
|
|
21643
|
+
var ERR_METHOD_NOT_IMPLEMENTED = _require$codes.ERR_METHOD_NOT_IMPLEMENTED;
|
|
21644
|
+
var ERR_STREAM_UNSHIFT_AFTER_END_EVENT = _require$codes.ERR_STREAM_UNSHIFT_AFTER_END_EVENT;
|
|
21645
|
+
var StringDecoder;
|
|
21646
|
+
var createReadableStreamAsyncIterator;
|
|
21647
|
+
var from;
|
|
21648
|
+
require_inherits()(Readable2, Stream);
|
|
21649
|
+
var errorOrDestroy = destroyImpl.errorOrDestroy;
|
|
21650
|
+
var kProxyEvents = ["error", "close", "destroy", "pause", "resume"];
|
|
21651
|
+
function prependListener(emitter, event, fn) {
|
|
21652
|
+
if (typeof emitter.prependListener === "function")
|
|
21653
|
+
return emitter.prependListener(event, fn);
|
|
21654
|
+
if (!emitter._events || !emitter._events[event])
|
|
21655
|
+
emitter.on(event, fn);
|
|
21656
|
+
else if (Array.isArray(emitter._events[event]))
|
|
21657
|
+
emitter._events[event].unshift(fn);
|
|
21658
|
+
else
|
|
21659
|
+
emitter._events[event] = [fn, emitter._events[event]];
|
|
21660
|
+
}
|
|
21661
|
+
function ReadableState(options, stream4, isDuplex) {
|
|
21662
|
+
Duplex = Duplex || require_stream_duplex2();
|
|
21663
|
+
options = options || {};
|
|
21664
|
+
if (typeof isDuplex !== "boolean")
|
|
21665
|
+
isDuplex = stream4 instanceof Duplex;
|
|
21666
|
+
this.objectMode = !!options.objectMode;
|
|
21667
|
+
if (isDuplex)
|
|
21668
|
+
this.objectMode = this.objectMode || !!options.readableObjectMode;
|
|
21669
|
+
this.highWaterMark = getHighWaterMark(this, options, "readableHighWaterMark", isDuplex);
|
|
21670
|
+
this.buffer = new BufferList();
|
|
21671
|
+
this.length = 0;
|
|
21672
|
+
this.pipes = null;
|
|
21673
|
+
this.pipesCount = 0;
|
|
21674
|
+
this.flowing = null;
|
|
21675
|
+
this.ended = false;
|
|
21676
|
+
this.endEmitted = false;
|
|
21677
|
+
this.reading = false;
|
|
21678
|
+
this.sync = true;
|
|
21679
|
+
this.needReadable = false;
|
|
21680
|
+
this.emittedReadable = false;
|
|
21681
|
+
this.readableListening = false;
|
|
21682
|
+
this.resumeScheduled = false;
|
|
21683
|
+
this.paused = true;
|
|
21684
|
+
this.emitClose = options.emitClose !== false;
|
|
21685
|
+
this.autoDestroy = !!options.autoDestroy;
|
|
21686
|
+
this.destroyed = false;
|
|
21687
|
+
this.defaultEncoding = options.defaultEncoding || "utf8";
|
|
21688
|
+
this.awaitDrain = 0;
|
|
21689
|
+
this.readingMore = false;
|
|
21690
|
+
this.decoder = null;
|
|
21691
|
+
this.encoding = null;
|
|
21692
|
+
if (options.encoding) {
|
|
21693
|
+
if (!StringDecoder)
|
|
21694
|
+
StringDecoder = require_string_decoder2().StringDecoder;
|
|
21695
|
+
this.decoder = new StringDecoder(options.encoding);
|
|
21696
|
+
this.encoding = options.encoding;
|
|
21697
|
+
}
|
|
21698
|
+
}
|
|
21699
|
+
function Readable2(options) {
|
|
21700
|
+
Duplex = Duplex || require_stream_duplex2();
|
|
21701
|
+
if (!(this instanceof Readable2))
|
|
21702
|
+
return new Readable2(options);
|
|
21703
|
+
var isDuplex = this instanceof Duplex;
|
|
21704
|
+
this._readableState = new ReadableState(options, this, isDuplex);
|
|
21705
|
+
this.readable = true;
|
|
21706
|
+
if (options) {
|
|
21707
|
+
if (typeof options.read === "function")
|
|
21708
|
+
this._read = options.read;
|
|
21709
|
+
if (typeof options.destroy === "function")
|
|
21710
|
+
this._destroy = options.destroy;
|
|
21711
|
+
}
|
|
21712
|
+
Stream.call(this);
|
|
21713
|
+
}
|
|
21714
|
+
Object.defineProperty(Readable2.prototype, "destroyed", {
|
|
21715
|
+
// making it explicit this property is not enumerable
|
|
21716
|
+
// because otherwise some prototype manipulation in
|
|
21717
|
+
// userland will fail
|
|
21718
|
+
enumerable: false,
|
|
21719
|
+
get: function get2() {
|
|
21720
|
+
if (this._readableState === void 0) {
|
|
21721
|
+
return false;
|
|
21722
|
+
}
|
|
21723
|
+
return this._readableState.destroyed;
|
|
21724
|
+
},
|
|
21725
|
+
set: function set(value) {
|
|
21726
|
+
if (!this._readableState) {
|
|
21727
|
+
return;
|
|
21728
|
+
}
|
|
21729
|
+
this._readableState.destroyed = value;
|
|
21730
|
+
}
|
|
21731
|
+
});
|
|
21732
|
+
Readable2.prototype.destroy = destroyImpl.destroy;
|
|
21733
|
+
Readable2.prototype._undestroy = destroyImpl.undestroy;
|
|
21734
|
+
Readable2.prototype._destroy = function(err, cb) {
|
|
21735
|
+
cb(err);
|
|
21736
|
+
};
|
|
21737
|
+
Readable2.prototype.push = function(chunk, encoding) {
|
|
21738
|
+
var state = this._readableState;
|
|
21739
|
+
var skipChunkCheck;
|
|
21740
|
+
if (!state.objectMode) {
|
|
21741
|
+
if (typeof chunk === "string") {
|
|
21742
|
+
encoding = encoding || state.defaultEncoding;
|
|
21743
|
+
if (encoding !== state.encoding) {
|
|
21744
|
+
chunk = Buffer2.from(chunk, encoding);
|
|
21745
|
+
encoding = "";
|
|
21746
|
+
}
|
|
21747
|
+
skipChunkCheck = true;
|
|
21748
|
+
}
|
|
21749
|
+
} else {
|
|
21750
|
+
skipChunkCheck = true;
|
|
21751
|
+
}
|
|
21752
|
+
return readableAddChunk(this, chunk, encoding, false, skipChunkCheck);
|
|
21753
|
+
};
|
|
21754
|
+
Readable2.prototype.unshift = function(chunk) {
|
|
21755
|
+
return readableAddChunk(this, chunk, null, true, false);
|
|
21756
|
+
};
|
|
21757
|
+
function readableAddChunk(stream4, chunk, encoding, addToFront, skipChunkCheck) {
|
|
21758
|
+
debug("readableAddChunk", chunk);
|
|
21759
|
+
var state = stream4._readableState;
|
|
21760
|
+
if (chunk === null) {
|
|
21761
|
+
state.reading = false;
|
|
21762
|
+
onEofChunk(stream4, state);
|
|
21763
|
+
} else {
|
|
21764
|
+
var er;
|
|
21765
|
+
if (!skipChunkCheck)
|
|
21766
|
+
er = chunkInvalid(state, chunk);
|
|
21767
|
+
if (er) {
|
|
21768
|
+
errorOrDestroy(stream4, er);
|
|
21769
|
+
} else if (state.objectMode || chunk && chunk.length > 0) {
|
|
21770
|
+
if (typeof chunk !== "string" && !state.objectMode && Object.getPrototypeOf(chunk) !== Buffer2.prototype) {
|
|
21771
|
+
chunk = _uint8ArrayToBuffer(chunk);
|
|
21772
|
+
}
|
|
21773
|
+
if (addToFront) {
|
|
21774
|
+
if (state.endEmitted)
|
|
21775
|
+
errorOrDestroy(stream4, new ERR_STREAM_UNSHIFT_AFTER_END_EVENT());
|
|
21776
|
+
else
|
|
21777
|
+
addChunk(stream4, state, chunk, true);
|
|
21778
|
+
} else if (state.ended) {
|
|
21779
|
+
errorOrDestroy(stream4, new ERR_STREAM_PUSH_AFTER_EOF());
|
|
21780
|
+
} else if (state.destroyed) {
|
|
21781
|
+
return false;
|
|
21782
|
+
} else {
|
|
21783
|
+
state.reading = false;
|
|
21784
|
+
if (state.decoder && !encoding) {
|
|
21785
|
+
chunk = state.decoder.write(chunk);
|
|
21786
|
+
if (state.objectMode || chunk.length !== 0)
|
|
21787
|
+
addChunk(stream4, state, chunk, false);
|
|
21788
|
+
else
|
|
21789
|
+
maybeReadMore(stream4, state);
|
|
21790
|
+
} else {
|
|
21791
|
+
addChunk(stream4, state, chunk, false);
|
|
21792
|
+
}
|
|
21793
|
+
}
|
|
21794
|
+
} else if (!addToFront) {
|
|
21795
|
+
state.reading = false;
|
|
21796
|
+
maybeReadMore(stream4, state);
|
|
21797
|
+
}
|
|
21798
|
+
}
|
|
21799
|
+
return !state.ended && (state.length < state.highWaterMark || state.length === 0);
|
|
21800
|
+
}
|
|
21801
|
+
function addChunk(stream4, state, chunk, addToFront) {
|
|
21802
|
+
if (state.flowing && state.length === 0 && !state.sync) {
|
|
21803
|
+
state.awaitDrain = 0;
|
|
21804
|
+
stream4.emit("data", chunk);
|
|
21805
|
+
} else {
|
|
21806
|
+
state.length += state.objectMode ? 1 : chunk.length;
|
|
21807
|
+
if (addToFront)
|
|
21808
|
+
state.buffer.unshift(chunk);
|
|
21809
|
+
else
|
|
21810
|
+
state.buffer.push(chunk);
|
|
21811
|
+
if (state.needReadable)
|
|
21812
|
+
emitReadable(stream4);
|
|
21813
|
+
}
|
|
21814
|
+
maybeReadMore(stream4, state);
|
|
21815
|
+
}
|
|
21816
|
+
function chunkInvalid(state, chunk) {
|
|
21817
|
+
var er;
|
|
21818
|
+
if (!_isUint8Array(chunk) && typeof chunk !== "string" && chunk !== void 0 && !state.objectMode) {
|
|
21819
|
+
er = new ERR_INVALID_ARG_TYPE("chunk", ["string", "Buffer", "Uint8Array"], chunk);
|
|
21820
|
+
}
|
|
21821
|
+
return er;
|
|
21822
|
+
}
|
|
21823
|
+
Readable2.prototype.isPaused = function() {
|
|
21824
|
+
return this._readableState.flowing === false;
|
|
21825
|
+
};
|
|
21826
|
+
Readable2.prototype.setEncoding = function(enc) {
|
|
21827
|
+
if (!StringDecoder)
|
|
21828
|
+
StringDecoder = require_string_decoder2().StringDecoder;
|
|
21829
|
+
var decoder = new StringDecoder(enc);
|
|
21830
|
+
this._readableState.decoder = decoder;
|
|
21831
|
+
this._readableState.encoding = this._readableState.decoder.encoding;
|
|
21832
|
+
var p = this._readableState.buffer.head;
|
|
21833
|
+
var content = "";
|
|
21834
|
+
while (p !== null) {
|
|
21835
|
+
content += decoder.write(p.data);
|
|
21836
|
+
p = p.next;
|
|
21837
|
+
}
|
|
21838
|
+
this._readableState.buffer.clear();
|
|
21839
|
+
if (content !== "")
|
|
21840
|
+
this._readableState.buffer.push(content);
|
|
21841
|
+
this._readableState.length = content.length;
|
|
21842
|
+
return this;
|
|
21843
|
+
};
|
|
21844
|
+
var MAX_HWM = 1073741824;
|
|
21845
|
+
function computeNewHighWaterMark(n) {
|
|
21846
|
+
if (n >= MAX_HWM) {
|
|
21847
|
+
n = MAX_HWM;
|
|
21848
|
+
} else {
|
|
21849
|
+
n--;
|
|
21850
|
+
n |= n >>> 1;
|
|
21851
|
+
n |= n >>> 2;
|
|
21852
|
+
n |= n >>> 4;
|
|
21853
|
+
n |= n >>> 8;
|
|
21854
|
+
n |= n >>> 16;
|
|
21855
|
+
n++;
|
|
21856
|
+
}
|
|
21857
|
+
return n;
|
|
21858
|
+
}
|
|
21859
|
+
function howMuchToRead(n, state) {
|
|
21860
|
+
if (n <= 0 || state.length === 0 && state.ended)
|
|
21861
|
+
return 0;
|
|
21862
|
+
if (state.objectMode)
|
|
21863
|
+
return 1;
|
|
21864
|
+
if (n !== n) {
|
|
21865
|
+
if (state.flowing && state.length)
|
|
21866
|
+
return state.buffer.head.data.length;
|
|
21867
|
+
else
|
|
21868
|
+
return state.length;
|
|
21869
|
+
}
|
|
21870
|
+
if (n > state.highWaterMark)
|
|
21871
|
+
state.highWaterMark = computeNewHighWaterMark(n);
|
|
21872
|
+
if (n <= state.length)
|
|
21873
|
+
return n;
|
|
21874
|
+
if (!state.ended) {
|
|
21875
|
+
state.needReadable = true;
|
|
21876
|
+
return 0;
|
|
21877
|
+
}
|
|
21878
|
+
return state.length;
|
|
21879
|
+
}
|
|
21880
|
+
Readable2.prototype.read = function(n) {
|
|
21881
|
+
debug("read", n);
|
|
21882
|
+
n = parseInt(n, 10);
|
|
21883
|
+
var state = this._readableState;
|
|
21884
|
+
var nOrig = n;
|
|
21885
|
+
if (n !== 0)
|
|
21886
|
+
state.emittedReadable = false;
|
|
21887
|
+
if (n === 0 && state.needReadable && ((state.highWaterMark !== 0 ? state.length >= state.highWaterMark : state.length > 0) || state.ended)) {
|
|
21888
|
+
debug("read: emitReadable", state.length, state.ended);
|
|
21889
|
+
if (state.length === 0 && state.ended)
|
|
21890
|
+
endReadable(this);
|
|
21891
|
+
else
|
|
21892
|
+
emitReadable(this);
|
|
21893
|
+
return null;
|
|
21894
|
+
}
|
|
21895
|
+
n = howMuchToRead(n, state);
|
|
21896
|
+
if (n === 0 && state.ended) {
|
|
21897
|
+
if (state.length === 0)
|
|
21898
|
+
endReadable(this);
|
|
21899
|
+
return null;
|
|
21900
|
+
}
|
|
21901
|
+
var doRead = state.needReadable;
|
|
21902
|
+
debug("need readable", doRead);
|
|
21903
|
+
if (state.length === 0 || state.length - n < state.highWaterMark) {
|
|
21904
|
+
doRead = true;
|
|
21905
|
+
debug("length less than watermark", doRead);
|
|
21906
|
+
}
|
|
21907
|
+
if (state.ended || state.reading) {
|
|
21908
|
+
doRead = false;
|
|
21909
|
+
debug("reading or ended", doRead);
|
|
21910
|
+
} else if (doRead) {
|
|
21911
|
+
debug("do read");
|
|
21912
|
+
state.reading = true;
|
|
21913
|
+
state.sync = true;
|
|
21914
|
+
if (state.length === 0)
|
|
21915
|
+
state.needReadable = true;
|
|
21916
|
+
this._read(state.highWaterMark);
|
|
21917
|
+
state.sync = false;
|
|
21918
|
+
if (!state.reading)
|
|
21919
|
+
n = howMuchToRead(nOrig, state);
|
|
21920
|
+
}
|
|
21921
|
+
var ret;
|
|
21922
|
+
if (n > 0)
|
|
21923
|
+
ret = fromList(n, state);
|
|
21924
|
+
else
|
|
21925
|
+
ret = null;
|
|
21926
|
+
if (ret === null) {
|
|
21927
|
+
state.needReadable = state.length <= state.highWaterMark;
|
|
21928
|
+
n = 0;
|
|
21929
|
+
} else {
|
|
21930
|
+
state.length -= n;
|
|
21931
|
+
state.awaitDrain = 0;
|
|
21932
|
+
}
|
|
21933
|
+
if (state.length === 0) {
|
|
21934
|
+
if (!state.ended)
|
|
21935
|
+
state.needReadable = true;
|
|
21936
|
+
if (nOrig !== n && state.ended)
|
|
21937
|
+
endReadable(this);
|
|
21938
|
+
}
|
|
21939
|
+
if (ret !== null)
|
|
21940
|
+
this.emit("data", ret);
|
|
21941
|
+
return ret;
|
|
21942
|
+
};
|
|
21943
|
+
function onEofChunk(stream4, state) {
|
|
21944
|
+
debug("onEofChunk");
|
|
21945
|
+
if (state.ended)
|
|
21946
|
+
return;
|
|
21947
|
+
if (state.decoder) {
|
|
21948
|
+
var chunk = state.decoder.end();
|
|
21949
|
+
if (chunk && chunk.length) {
|
|
21950
|
+
state.buffer.push(chunk);
|
|
21951
|
+
state.length += state.objectMode ? 1 : chunk.length;
|
|
21952
|
+
}
|
|
21953
|
+
}
|
|
21954
|
+
state.ended = true;
|
|
21955
|
+
if (state.sync) {
|
|
21956
|
+
emitReadable(stream4);
|
|
21957
|
+
} else {
|
|
21958
|
+
state.needReadable = false;
|
|
21959
|
+
if (!state.emittedReadable) {
|
|
21960
|
+
state.emittedReadable = true;
|
|
21961
|
+
emitReadable_(stream4);
|
|
21962
|
+
}
|
|
21963
|
+
}
|
|
21964
|
+
}
|
|
21965
|
+
function emitReadable(stream4) {
|
|
21966
|
+
var state = stream4._readableState;
|
|
21967
|
+
debug("emitReadable", state.needReadable, state.emittedReadable);
|
|
21968
|
+
state.needReadable = false;
|
|
21969
|
+
if (!state.emittedReadable) {
|
|
21970
|
+
debug("emitReadable", state.flowing);
|
|
21971
|
+
state.emittedReadable = true;
|
|
21972
|
+
process.nextTick(emitReadable_, stream4);
|
|
21973
|
+
}
|
|
21974
|
+
}
|
|
21975
|
+
function emitReadable_(stream4) {
|
|
21976
|
+
var state = stream4._readableState;
|
|
21977
|
+
debug("emitReadable_", state.destroyed, state.length, state.ended);
|
|
21978
|
+
if (!state.destroyed && (state.length || state.ended)) {
|
|
21979
|
+
stream4.emit("readable");
|
|
21980
|
+
state.emittedReadable = false;
|
|
21981
|
+
}
|
|
21982
|
+
state.needReadable = !state.flowing && !state.ended && state.length <= state.highWaterMark;
|
|
21983
|
+
flow(stream4);
|
|
21984
|
+
}
|
|
21985
|
+
function maybeReadMore(stream4, state) {
|
|
21986
|
+
if (!state.readingMore) {
|
|
21987
|
+
state.readingMore = true;
|
|
21988
|
+
process.nextTick(maybeReadMore_, stream4, state);
|
|
21989
|
+
}
|
|
21990
|
+
}
|
|
21991
|
+
function maybeReadMore_(stream4, state) {
|
|
21992
|
+
while (!state.reading && !state.ended && (state.length < state.highWaterMark || state.flowing && state.length === 0)) {
|
|
21993
|
+
var len = state.length;
|
|
21994
|
+
debug("maybeReadMore read 0");
|
|
21995
|
+
stream4.read(0);
|
|
21996
|
+
if (len === state.length)
|
|
21997
|
+
break;
|
|
21998
|
+
}
|
|
21999
|
+
state.readingMore = false;
|
|
22000
|
+
}
|
|
22001
|
+
Readable2.prototype._read = function(n) {
|
|
22002
|
+
errorOrDestroy(this, new ERR_METHOD_NOT_IMPLEMENTED("_read()"));
|
|
22003
|
+
};
|
|
22004
|
+
Readable2.prototype.pipe = function(dest, pipeOpts) {
|
|
22005
|
+
var src = this;
|
|
22006
|
+
var state = this._readableState;
|
|
22007
|
+
switch (state.pipesCount) {
|
|
22008
|
+
case 0:
|
|
22009
|
+
state.pipes = dest;
|
|
22010
|
+
break;
|
|
22011
|
+
case 1:
|
|
22012
|
+
state.pipes = [state.pipes, dest];
|
|
22013
|
+
break;
|
|
22014
|
+
default:
|
|
22015
|
+
state.pipes.push(dest);
|
|
22016
|
+
break;
|
|
22017
|
+
}
|
|
22018
|
+
state.pipesCount += 1;
|
|
22019
|
+
debug("pipe count=%d opts=%j", state.pipesCount, pipeOpts);
|
|
22020
|
+
var doEnd = (!pipeOpts || pipeOpts.end !== false) && dest !== process.stdout && dest !== process.stderr;
|
|
22021
|
+
var endFn = doEnd ? onend : unpipe;
|
|
22022
|
+
if (state.endEmitted)
|
|
22023
|
+
process.nextTick(endFn);
|
|
22024
|
+
else
|
|
22025
|
+
src.once("end", endFn);
|
|
22026
|
+
dest.on("unpipe", onunpipe);
|
|
22027
|
+
function onunpipe(readable, unpipeInfo) {
|
|
22028
|
+
debug("onunpipe");
|
|
22029
|
+
if (readable === src) {
|
|
22030
|
+
if (unpipeInfo && unpipeInfo.hasUnpiped === false) {
|
|
22031
|
+
unpipeInfo.hasUnpiped = true;
|
|
22032
|
+
cleanup();
|
|
22033
|
+
}
|
|
22034
|
+
}
|
|
22035
|
+
}
|
|
22036
|
+
function onend() {
|
|
22037
|
+
debug("onend");
|
|
22038
|
+
dest.end();
|
|
22039
|
+
}
|
|
22040
|
+
var ondrain = pipeOnDrain(src);
|
|
22041
|
+
dest.on("drain", ondrain);
|
|
22042
|
+
var cleanedUp = false;
|
|
22043
|
+
function cleanup() {
|
|
22044
|
+
debug("cleanup");
|
|
22045
|
+
dest.removeListener("close", onclose);
|
|
22046
|
+
dest.removeListener("finish", onfinish);
|
|
22047
|
+
dest.removeListener("drain", ondrain);
|
|
22048
|
+
dest.removeListener("error", onerror);
|
|
22049
|
+
dest.removeListener("unpipe", onunpipe);
|
|
22050
|
+
src.removeListener("end", onend);
|
|
22051
|
+
src.removeListener("end", unpipe);
|
|
22052
|
+
src.removeListener("data", ondata);
|
|
22053
|
+
cleanedUp = true;
|
|
22054
|
+
if (state.awaitDrain && (!dest._writableState || dest._writableState.needDrain))
|
|
22055
|
+
ondrain();
|
|
22056
|
+
}
|
|
22057
|
+
src.on("data", ondata);
|
|
22058
|
+
function ondata(chunk) {
|
|
22059
|
+
debug("ondata");
|
|
22060
|
+
var ret = dest.write(chunk);
|
|
22061
|
+
debug("dest.write", ret);
|
|
22062
|
+
if (ret === false) {
|
|
22063
|
+
if ((state.pipesCount === 1 && state.pipes === dest || state.pipesCount > 1 && indexOf(state.pipes, dest) !== -1) && !cleanedUp) {
|
|
22064
|
+
debug("false write response, pause", state.awaitDrain);
|
|
22065
|
+
state.awaitDrain++;
|
|
22066
|
+
}
|
|
22067
|
+
src.pause();
|
|
22068
|
+
}
|
|
22069
|
+
}
|
|
22070
|
+
function onerror(er) {
|
|
22071
|
+
debug("onerror", er);
|
|
22072
|
+
unpipe();
|
|
22073
|
+
dest.removeListener("error", onerror);
|
|
22074
|
+
if (EElistenerCount(dest, "error") === 0)
|
|
22075
|
+
errorOrDestroy(dest, er);
|
|
22076
|
+
}
|
|
22077
|
+
prependListener(dest, "error", onerror);
|
|
22078
|
+
function onclose() {
|
|
22079
|
+
dest.removeListener("finish", onfinish);
|
|
22080
|
+
unpipe();
|
|
22081
|
+
}
|
|
22082
|
+
dest.once("close", onclose);
|
|
22083
|
+
function onfinish() {
|
|
22084
|
+
debug("onfinish");
|
|
22085
|
+
dest.removeListener("close", onclose);
|
|
22086
|
+
unpipe();
|
|
22087
|
+
}
|
|
22088
|
+
dest.once("finish", onfinish);
|
|
22089
|
+
function unpipe() {
|
|
22090
|
+
debug("unpipe");
|
|
22091
|
+
src.unpipe(dest);
|
|
22092
|
+
}
|
|
22093
|
+
dest.emit("pipe", src);
|
|
22094
|
+
if (!state.flowing) {
|
|
22095
|
+
debug("pipe resume");
|
|
22096
|
+
src.resume();
|
|
22097
|
+
}
|
|
22098
|
+
return dest;
|
|
22099
|
+
};
|
|
22100
|
+
function pipeOnDrain(src) {
|
|
22101
|
+
return function pipeOnDrainFunctionResult() {
|
|
22102
|
+
var state = src._readableState;
|
|
22103
|
+
debug("pipeOnDrain", state.awaitDrain);
|
|
22104
|
+
if (state.awaitDrain)
|
|
22105
|
+
state.awaitDrain--;
|
|
22106
|
+
if (state.awaitDrain === 0 && EElistenerCount(src, "data")) {
|
|
22107
|
+
state.flowing = true;
|
|
22108
|
+
flow(src);
|
|
22109
|
+
}
|
|
22110
|
+
};
|
|
22111
|
+
}
|
|
22112
|
+
Readable2.prototype.unpipe = function(dest) {
|
|
22113
|
+
var state = this._readableState;
|
|
22114
|
+
var unpipeInfo = {
|
|
22115
|
+
hasUnpiped: false
|
|
22116
|
+
};
|
|
22117
|
+
if (state.pipesCount === 0)
|
|
22118
|
+
return this;
|
|
22119
|
+
if (state.pipesCount === 1) {
|
|
22120
|
+
if (dest && dest !== state.pipes)
|
|
22121
|
+
return this;
|
|
22122
|
+
if (!dest)
|
|
22123
|
+
dest = state.pipes;
|
|
22124
|
+
state.pipes = null;
|
|
22125
|
+
state.pipesCount = 0;
|
|
22126
|
+
state.flowing = false;
|
|
22127
|
+
if (dest)
|
|
22128
|
+
dest.emit("unpipe", this, unpipeInfo);
|
|
22129
|
+
return this;
|
|
22130
|
+
}
|
|
22131
|
+
if (!dest) {
|
|
22132
|
+
var dests = state.pipes;
|
|
22133
|
+
var len = state.pipesCount;
|
|
22134
|
+
state.pipes = null;
|
|
22135
|
+
state.pipesCount = 0;
|
|
22136
|
+
state.flowing = false;
|
|
22137
|
+
for (var i = 0; i < len; i++) {
|
|
22138
|
+
dests[i].emit("unpipe", this, {
|
|
22139
|
+
hasUnpiped: false
|
|
22140
|
+
});
|
|
22141
|
+
}
|
|
22142
|
+
return this;
|
|
22143
|
+
}
|
|
22144
|
+
var index2 = indexOf(state.pipes, dest);
|
|
22145
|
+
if (index2 === -1)
|
|
22146
|
+
return this;
|
|
22147
|
+
state.pipes.splice(index2, 1);
|
|
22148
|
+
state.pipesCount -= 1;
|
|
22149
|
+
if (state.pipesCount === 1)
|
|
22150
|
+
state.pipes = state.pipes[0];
|
|
22151
|
+
dest.emit("unpipe", this, unpipeInfo);
|
|
22152
|
+
return this;
|
|
22153
|
+
};
|
|
22154
|
+
Readable2.prototype.on = function(ev, fn) {
|
|
22155
|
+
var res = Stream.prototype.on.call(this, ev, fn);
|
|
22156
|
+
var state = this._readableState;
|
|
22157
|
+
if (ev === "data") {
|
|
22158
|
+
state.readableListening = this.listenerCount("readable") > 0;
|
|
22159
|
+
if (state.flowing !== false)
|
|
22160
|
+
this.resume();
|
|
22161
|
+
} else if (ev === "readable") {
|
|
22162
|
+
if (!state.endEmitted && !state.readableListening) {
|
|
22163
|
+
state.readableListening = state.needReadable = true;
|
|
22164
|
+
state.flowing = false;
|
|
22165
|
+
state.emittedReadable = false;
|
|
22166
|
+
debug("on readable", state.length, state.reading);
|
|
22167
|
+
if (state.length) {
|
|
22168
|
+
emitReadable(this);
|
|
22169
|
+
} else if (!state.reading) {
|
|
22170
|
+
process.nextTick(nReadingNextTick, this);
|
|
22171
|
+
}
|
|
22172
|
+
}
|
|
22173
|
+
}
|
|
22174
|
+
return res;
|
|
22175
|
+
};
|
|
22176
|
+
Readable2.prototype.addListener = Readable2.prototype.on;
|
|
22177
|
+
Readable2.prototype.removeListener = function(ev, fn) {
|
|
22178
|
+
var res = Stream.prototype.removeListener.call(this, ev, fn);
|
|
22179
|
+
if (ev === "readable") {
|
|
22180
|
+
process.nextTick(updateReadableListening, this);
|
|
22181
|
+
}
|
|
22182
|
+
return res;
|
|
22183
|
+
};
|
|
22184
|
+
Readable2.prototype.removeAllListeners = function(ev) {
|
|
22185
|
+
var res = Stream.prototype.removeAllListeners.apply(this, arguments);
|
|
22186
|
+
if (ev === "readable" || ev === void 0) {
|
|
22187
|
+
process.nextTick(updateReadableListening, this);
|
|
22188
|
+
}
|
|
22189
|
+
return res;
|
|
22190
|
+
};
|
|
22191
|
+
function updateReadableListening(self2) {
|
|
22192
|
+
var state = self2._readableState;
|
|
22193
|
+
state.readableListening = self2.listenerCount("readable") > 0;
|
|
22194
|
+
if (state.resumeScheduled && !state.paused) {
|
|
22195
|
+
state.flowing = true;
|
|
22196
|
+
} else if (self2.listenerCount("data") > 0) {
|
|
22197
|
+
self2.resume();
|
|
22198
|
+
}
|
|
22199
|
+
}
|
|
22200
|
+
function nReadingNextTick(self2) {
|
|
22201
|
+
debug("readable nexttick read 0");
|
|
22202
|
+
self2.read(0);
|
|
22203
|
+
}
|
|
22204
|
+
Readable2.prototype.resume = function() {
|
|
22205
|
+
var state = this._readableState;
|
|
22206
|
+
if (!state.flowing) {
|
|
22207
|
+
debug("resume");
|
|
22208
|
+
state.flowing = !state.readableListening;
|
|
22209
|
+
resume(this, state);
|
|
22210
|
+
}
|
|
22211
|
+
state.paused = false;
|
|
22212
|
+
return this;
|
|
22213
|
+
};
|
|
22214
|
+
function resume(stream4, state) {
|
|
22215
|
+
if (!state.resumeScheduled) {
|
|
22216
|
+
state.resumeScheduled = true;
|
|
22217
|
+
process.nextTick(resume_, stream4, state);
|
|
22218
|
+
}
|
|
22219
|
+
}
|
|
22220
|
+
function resume_(stream4, state) {
|
|
22221
|
+
debug("resume", state.reading);
|
|
22222
|
+
if (!state.reading) {
|
|
22223
|
+
stream4.read(0);
|
|
22224
|
+
}
|
|
22225
|
+
state.resumeScheduled = false;
|
|
22226
|
+
stream4.emit("resume");
|
|
22227
|
+
flow(stream4);
|
|
22228
|
+
if (state.flowing && !state.reading)
|
|
22229
|
+
stream4.read(0);
|
|
22230
|
+
}
|
|
22231
|
+
Readable2.prototype.pause = function() {
|
|
22232
|
+
debug("call pause flowing=%j", this._readableState.flowing);
|
|
22233
|
+
if (this._readableState.flowing !== false) {
|
|
22234
|
+
debug("pause");
|
|
22235
|
+
this._readableState.flowing = false;
|
|
22236
|
+
this.emit("pause");
|
|
22237
|
+
}
|
|
22238
|
+
this._readableState.paused = true;
|
|
22239
|
+
return this;
|
|
22240
|
+
};
|
|
22241
|
+
function flow(stream4) {
|
|
22242
|
+
var state = stream4._readableState;
|
|
22243
|
+
debug("flow", state.flowing);
|
|
22244
|
+
while (state.flowing && stream4.read() !== null) {
|
|
22245
|
+
;
|
|
22246
|
+
}
|
|
22247
|
+
}
|
|
22248
|
+
Readable2.prototype.wrap = function(stream4) {
|
|
22249
|
+
var _this = this;
|
|
22250
|
+
var state = this._readableState;
|
|
22251
|
+
var paused = false;
|
|
22252
|
+
stream4.on("end", function() {
|
|
22253
|
+
debug("wrapped end");
|
|
22254
|
+
if (state.decoder && !state.ended) {
|
|
22255
|
+
var chunk = state.decoder.end();
|
|
22256
|
+
if (chunk && chunk.length)
|
|
22257
|
+
_this.push(chunk);
|
|
22258
|
+
}
|
|
22259
|
+
_this.push(null);
|
|
22260
|
+
});
|
|
22261
|
+
stream4.on("data", function(chunk) {
|
|
22262
|
+
debug("wrapped data");
|
|
22263
|
+
if (state.decoder)
|
|
22264
|
+
chunk = state.decoder.write(chunk);
|
|
22265
|
+
if (state.objectMode && (chunk === null || chunk === void 0))
|
|
22266
|
+
return;
|
|
22267
|
+
else if (!state.objectMode && (!chunk || !chunk.length))
|
|
22268
|
+
return;
|
|
22269
|
+
var ret = _this.push(chunk);
|
|
22270
|
+
if (!ret) {
|
|
22271
|
+
paused = true;
|
|
22272
|
+
stream4.pause();
|
|
22273
|
+
}
|
|
22274
|
+
});
|
|
22275
|
+
for (var i in stream4) {
|
|
22276
|
+
if (this[i] === void 0 && typeof stream4[i] === "function") {
|
|
22277
|
+
this[i] = function methodWrap(method) {
|
|
22278
|
+
return function methodWrapReturnFunction() {
|
|
22279
|
+
return stream4[method].apply(stream4, arguments);
|
|
22280
|
+
};
|
|
22281
|
+
}(i);
|
|
22282
|
+
}
|
|
22283
|
+
}
|
|
22284
|
+
for (var n = 0; n < kProxyEvents.length; n++) {
|
|
22285
|
+
stream4.on(kProxyEvents[n], this.emit.bind(this, kProxyEvents[n]));
|
|
22286
|
+
}
|
|
22287
|
+
this._read = function(n2) {
|
|
22288
|
+
debug("wrapped _read", n2);
|
|
22289
|
+
if (paused) {
|
|
22290
|
+
paused = false;
|
|
22291
|
+
stream4.resume();
|
|
22292
|
+
}
|
|
22293
|
+
};
|
|
22294
|
+
return this;
|
|
22295
|
+
};
|
|
22296
|
+
if (typeof Symbol === "function") {
|
|
22297
|
+
Readable2.prototype[Symbol.asyncIterator] = function() {
|
|
22298
|
+
if (createReadableStreamAsyncIterator === void 0) {
|
|
22299
|
+
createReadableStreamAsyncIterator = require_async_iterator2();
|
|
22300
|
+
}
|
|
22301
|
+
return createReadableStreamAsyncIterator(this);
|
|
22302
|
+
};
|
|
22303
|
+
}
|
|
22304
|
+
Object.defineProperty(Readable2.prototype, "readableHighWaterMark", {
|
|
22305
|
+
// making it explicit this property is not enumerable
|
|
22306
|
+
// because otherwise some prototype manipulation in
|
|
22307
|
+
// userland will fail
|
|
22308
|
+
enumerable: false,
|
|
22309
|
+
get: function get2() {
|
|
22310
|
+
return this._readableState.highWaterMark;
|
|
22311
|
+
}
|
|
22312
|
+
});
|
|
22313
|
+
Object.defineProperty(Readable2.prototype, "readableBuffer", {
|
|
22314
|
+
// making it explicit this property is not enumerable
|
|
22315
|
+
// because otherwise some prototype manipulation in
|
|
22316
|
+
// userland will fail
|
|
22317
|
+
enumerable: false,
|
|
22318
|
+
get: function get2() {
|
|
22319
|
+
return this._readableState && this._readableState.buffer;
|
|
22320
|
+
}
|
|
22321
|
+
});
|
|
22322
|
+
Object.defineProperty(Readable2.prototype, "readableFlowing", {
|
|
22323
|
+
// making it explicit this property is not enumerable
|
|
22324
|
+
// because otherwise some prototype manipulation in
|
|
22325
|
+
// userland will fail
|
|
22326
|
+
enumerable: false,
|
|
22327
|
+
get: function get2() {
|
|
22328
|
+
return this._readableState.flowing;
|
|
22329
|
+
},
|
|
22330
|
+
set: function set(state) {
|
|
22331
|
+
if (this._readableState) {
|
|
22332
|
+
this._readableState.flowing = state;
|
|
22333
|
+
}
|
|
22334
|
+
}
|
|
22335
|
+
});
|
|
22336
|
+
Readable2._fromList = fromList;
|
|
22337
|
+
Object.defineProperty(Readable2.prototype, "readableLength", {
|
|
22338
|
+
// making it explicit this property is not enumerable
|
|
22339
|
+
// because otherwise some prototype manipulation in
|
|
22340
|
+
// userland will fail
|
|
22341
|
+
enumerable: false,
|
|
22342
|
+
get: function get2() {
|
|
22343
|
+
return this._readableState.length;
|
|
22344
|
+
}
|
|
22345
|
+
});
|
|
22346
|
+
function fromList(n, state) {
|
|
22347
|
+
if (state.length === 0)
|
|
22348
|
+
return null;
|
|
22349
|
+
var ret;
|
|
22350
|
+
if (state.objectMode)
|
|
22351
|
+
ret = state.buffer.shift();
|
|
22352
|
+
else if (!n || n >= state.length) {
|
|
22353
|
+
if (state.decoder)
|
|
22354
|
+
ret = state.buffer.join("");
|
|
22355
|
+
else if (state.buffer.length === 1)
|
|
22356
|
+
ret = state.buffer.first();
|
|
22357
|
+
else
|
|
22358
|
+
ret = state.buffer.concat(state.length);
|
|
22359
|
+
state.buffer.clear();
|
|
22360
|
+
} else {
|
|
22361
|
+
ret = state.buffer.consume(n, state.decoder);
|
|
22362
|
+
}
|
|
22363
|
+
return ret;
|
|
22364
|
+
}
|
|
22365
|
+
function endReadable(stream4) {
|
|
22366
|
+
var state = stream4._readableState;
|
|
22367
|
+
debug("endReadable", state.endEmitted);
|
|
22368
|
+
if (!state.endEmitted) {
|
|
22369
|
+
state.ended = true;
|
|
22370
|
+
process.nextTick(endReadableNT, state, stream4);
|
|
22371
|
+
}
|
|
22372
|
+
}
|
|
22373
|
+
function endReadableNT(state, stream4) {
|
|
22374
|
+
debug("endReadableNT", state.endEmitted, state.length);
|
|
22375
|
+
if (!state.endEmitted && state.length === 0) {
|
|
22376
|
+
state.endEmitted = true;
|
|
22377
|
+
stream4.readable = false;
|
|
22378
|
+
stream4.emit("end");
|
|
22379
|
+
if (state.autoDestroy) {
|
|
22380
|
+
var wState = stream4._writableState;
|
|
22381
|
+
if (!wState || wState.autoDestroy && wState.finished) {
|
|
22382
|
+
stream4.destroy();
|
|
22383
|
+
}
|
|
22384
|
+
}
|
|
22385
|
+
}
|
|
22386
|
+
}
|
|
22387
|
+
if (typeof Symbol === "function") {
|
|
22388
|
+
Readable2.from = function(iterable, opts) {
|
|
22389
|
+
if (from === void 0) {
|
|
22390
|
+
from = require_from2();
|
|
22391
|
+
}
|
|
22392
|
+
return from(Readable2, iterable, opts);
|
|
22393
|
+
};
|
|
22394
|
+
}
|
|
22395
|
+
function indexOf(xs, x) {
|
|
22396
|
+
for (var i = 0, l = xs.length; i < l; i++) {
|
|
22397
|
+
if (xs[i] === x)
|
|
22398
|
+
return i;
|
|
22399
|
+
}
|
|
22400
|
+
return -1;
|
|
22401
|
+
}
|
|
22402
|
+
}
|
|
22403
|
+
});
|
|
22404
|
+
|
|
22405
|
+
// ../../node_modules/winston-transport/node_modules/readable-stream/lib/_stream_duplex.js
|
|
22406
|
+
var require_stream_duplex2 = __commonJS({
|
|
22407
|
+
"../../node_modules/winston-transport/node_modules/readable-stream/lib/_stream_duplex.js"(exports, module2) {
|
|
22408
|
+
"use strict";
|
|
22409
|
+
var objectKeys = Object.keys || function(obj) {
|
|
22410
|
+
var keys2 = [];
|
|
22411
|
+
for (var key in obj) {
|
|
22412
|
+
keys2.push(key);
|
|
22413
|
+
}
|
|
22414
|
+
return keys2;
|
|
22415
|
+
};
|
|
22416
|
+
module2.exports = Duplex;
|
|
22417
|
+
var Readable2 = require_stream_readable2();
|
|
22418
|
+
var Writable = require_stream_writable2();
|
|
22419
|
+
require_inherits()(Duplex, Readable2);
|
|
22420
|
+
{
|
|
22421
|
+
keys = objectKeys(Writable.prototype);
|
|
22422
|
+
for (v = 0; v < keys.length; v++) {
|
|
22423
|
+
method = keys[v];
|
|
22424
|
+
if (!Duplex.prototype[method])
|
|
22425
|
+
Duplex.prototype[method] = Writable.prototype[method];
|
|
22426
|
+
}
|
|
22427
|
+
}
|
|
22428
|
+
var keys;
|
|
22429
|
+
var method;
|
|
22430
|
+
var v;
|
|
22431
|
+
function Duplex(options) {
|
|
22432
|
+
if (!(this instanceof Duplex))
|
|
22433
|
+
return new Duplex(options);
|
|
22434
|
+
Readable2.call(this, options);
|
|
22435
|
+
Writable.call(this, options);
|
|
22436
|
+
this.allowHalfOpen = true;
|
|
22437
|
+
if (options) {
|
|
22438
|
+
if (options.readable === false)
|
|
22439
|
+
this.readable = false;
|
|
22440
|
+
if (options.writable === false)
|
|
22441
|
+
this.writable = false;
|
|
22442
|
+
if (options.allowHalfOpen === false) {
|
|
22443
|
+
this.allowHalfOpen = false;
|
|
22444
|
+
this.once("end", onend);
|
|
22445
|
+
}
|
|
22446
|
+
}
|
|
22447
|
+
}
|
|
22448
|
+
Object.defineProperty(Duplex.prototype, "writableHighWaterMark", {
|
|
22449
|
+
// making it explicit this property is not enumerable
|
|
22450
|
+
// because otherwise some prototype manipulation in
|
|
22451
|
+
// userland will fail
|
|
22452
|
+
enumerable: false,
|
|
22453
|
+
get: function get2() {
|
|
22454
|
+
return this._writableState.highWaterMark;
|
|
22455
|
+
}
|
|
22456
|
+
});
|
|
22457
|
+
Object.defineProperty(Duplex.prototype, "writableBuffer", {
|
|
22458
|
+
// making it explicit this property is not enumerable
|
|
22459
|
+
// because otherwise some prototype manipulation in
|
|
22460
|
+
// userland will fail
|
|
22461
|
+
enumerable: false,
|
|
22462
|
+
get: function get2() {
|
|
22463
|
+
return this._writableState && this._writableState.getBuffer();
|
|
22464
|
+
}
|
|
22465
|
+
});
|
|
22466
|
+
Object.defineProperty(Duplex.prototype, "writableLength", {
|
|
22467
|
+
// making it explicit this property is not enumerable
|
|
22468
|
+
// because otherwise some prototype manipulation in
|
|
22469
|
+
// userland will fail
|
|
22470
|
+
enumerable: false,
|
|
22471
|
+
get: function get2() {
|
|
22472
|
+
return this._writableState.length;
|
|
22473
|
+
}
|
|
22474
|
+
});
|
|
22475
|
+
function onend() {
|
|
22476
|
+
if (this._writableState.ended)
|
|
22477
|
+
return;
|
|
22478
|
+
process.nextTick(onEndNT, this);
|
|
22479
|
+
}
|
|
22480
|
+
function onEndNT(self2) {
|
|
22481
|
+
self2.end();
|
|
22482
|
+
}
|
|
22483
|
+
Object.defineProperty(Duplex.prototype, "destroyed", {
|
|
22484
|
+
// making it explicit this property is not enumerable
|
|
22485
|
+
// because otherwise some prototype manipulation in
|
|
22486
|
+
// userland will fail
|
|
22487
|
+
enumerable: false,
|
|
22488
|
+
get: function get2() {
|
|
22489
|
+
if (this._readableState === void 0 || this._writableState === void 0) {
|
|
22490
|
+
return false;
|
|
22491
|
+
}
|
|
22492
|
+
return this._readableState.destroyed && this._writableState.destroyed;
|
|
22493
|
+
},
|
|
22494
|
+
set: function set(value) {
|
|
22495
|
+
if (this._readableState === void 0 || this._writableState === void 0) {
|
|
22496
|
+
return;
|
|
22497
|
+
}
|
|
22498
|
+
this._readableState.destroyed = value;
|
|
22499
|
+
this._writableState.destroyed = value;
|
|
22500
|
+
}
|
|
22501
|
+
});
|
|
22502
|
+
}
|
|
22503
|
+
});
|
|
22504
|
+
|
|
22505
|
+
// ../../node_modules/winston-transport/node_modules/readable-stream/lib/_stream_writable.js
|
|
22506
|
+
var require_stream_writable2 = __commonJS({
|
|
22507
|
+
"../../node_modules/winston-transport/node_modules/readable-stream/lib/_stream_writable.js"(exports, module2) {
|
|
22508
|
+
"use strict";
|
|
22509
|
+
module2.exports = Writable;
|
|
22510
|
+
function CorkedRequest(state) {
|
|
22511
|
+
var _this = this;
|
|
22512
|
+
this.next = null;
|
|
22513
|
+
this.entry = null;
|
|
22514
|
+
this.finish = function() {
|
|
22515
|
+
onCorkedFinish(_this, state);
|
|
22516
|
+
};
|
|
22517
|
+
}
|
|
22518
|
+
var Duplex;
|
|
22519
|
+
Writable.WritableState = WritableState;
|
|
22520
|
+
var internalUtil = {
|
|
22521
|
+
deprecate: require_node3()
|
|
22522
|
+
};
|
|
22523
|
+
var Stream = require_stream2();
|
|
22524
|
+
var Buffer2 = require("buffer").Buffer;
|
|
22525
|
+
var OurUint8Array = global.Uint8Array || function() {
|
|
22526
|
+
};
|
|
22527
|
+
function _uint8ArrayToBuffer(chunk) {
|
|
22528
|
+
return Buffer2.from(chunk);
|
|
22529
|
+
}
|
|
22530
|
+
function _isUint8Array(obj) {
|
|
22531
|
+
return Buffer2.isBuffer(obj) || obj instanceof OurUint8Array;
|
|
22532
|
+
}
|
|
22533
|
+
var destroyImpl = require_destroy2();
|
|
22534
|
+
var _require = require_state3();
|
|
22535
|
+
var getHighWaterMark = _require.getHighWaterMark;
|
|
22536
|
+
var _require$codes = require_errors3().codes;
|
|
22537
|
+
var ERR_INVALID_ARG_TYPE = _require$codes.ERR_INVALID_ARG_TYPE;
|
|
22538
|
+
var ERR_METHOD_NOT_IMPLEMENTED = _require$codes.ERR_METHOD_NOT_IMPLEMENTED;
|
|
22539
|
+
var ERR_MULTIPLE_CALLBACK = _require$codes.ERR_MULTIPLE_CALLBACK;
|
|
22540
|
+
var ERR_STREAM_CANNOT_PIPE = _require$codes.ERR_STREAM_CANNOT_PIPE;
|
|
22541
|
+
var ERR_STREAM_DESTROYED = _require$codes.ERR_STREAM_DESTROYED;
|
|
22542
|
+
var ERR_STREAM_NULL_VALUES = _require$codes.ERR_STREAM_NULL_VALUES;
|
|
22543
|
+
var ERR_STREAM_WRITE_AFTER_END = _require$codes.ERR_STREAM_WRITE_AFTER_END;
|
|
22544
|
+
var ERR_UNKNOWN_ENCODING = _require$codes.ERR_UNKNOWN_ENCODING;
|
|
22545
|
+
var errorOrDestroy = destroyImpl.errorOrDestroy;
|
|
22546
|
+
require_inherits()(Writable, Stream);
|
|
22547
|
+
function nop() {
|
|
22548
|
+
}
|
|
22549
|
+
function WritableState(options, stream4, isDuplex) {
|
|
22550
|
+
Duplex = Duplex || require_stream_duplex2();
|
|
22551
|
+
options = options || {};
|
|
22552
|
+
if (typeof isDuplex !== "boolean")
|
|
22553
|
+
isDuplex = stream4 instanceof Duplex;
|
|
22554
|
+
this.objectMode = !!options.objectMode;
|
|
22555
|
+
if (isDuplex)
|
|
22556
|
+
this.objectMode = this.objectMode || !!options.writableObjectMode;
|
|
22557
|
+
this.highWaterMark = getHighWaterMark(this, options, "writableHighWaterMark", isDuplex);
|
|
22558
|
+
this.finalCalled = false;
|
|
22559
|
+
this.needDrain = false;
|
|
22560
|
+
this.ending = false;
|
|
22561
|
+
this.ended = false;
|
|
22562
|
+
this.finished = false;
|
|
22563
|
+
this.destroyed = false;
|
|
22564
|
+
var noDecode = options.decodeStrings === false;
|
|
22565
|
+
this.decodeStrings = !noDecode;
|
|
22566
|
+
this.defaultEncoding = options.defaultEncoding || "utf8";
|
|
22567
|
+
this.length = 0;
|
|
22568
|
+
this.writing = false;
|
|
22569
|
+
this.corked = 0;
|
|
22570
|
+
this.sync = true;
|
|
22571
|
+
this.bufferProcessing = false;
|
|
22572
|
+
this.onwrite = function(er) {
|
|
22573
|
+
onwrite(stream4, er);
|
|
22574
|
+
};
|
|
22575
|
+
this.writecb = null;
|
|
22576
|
+
this.writelen = 0;
|
|
22577
|
+
this.bufferedRequest = null;
|
|
22578
|
+
this.lastBufferedRequest = null;
|
|
22579
|
+
this.pendingcb = 0;
|
|
22580
|
+
this.prefinished = false;
|
|
22581
|
+
this.errorEmitted = false;
|
|
22582
|
+
this.emitClose = options.emitClose !== false;
|
|
22583
|
+
this.autoDestroy = !!options.autoDestroy;
|
|
22584
|
+
this.bufferedRequestCount = 0;
|
|
22585
|
+
this.corkedRequestsFree = new CorkedRequest(this);
|
|
22586
|
+
}
|
|
22587
|
+
WritableState.prototype.getBuffer = function getBuffer() {
|
|
22588
|
+
var current = this.bufferedRequest;
|
|
22589
|
+
var out = [];
|
|
22590
|
+
while (current) {
|
|
22591
|
+
out.push(current);
|
|
22592
|
+
current = current.next;
|
|
22593
|
+
}
|
|
22594
|
+
return out;
|
|
22595
|
+
};
|
|
22596
|
+
(function() {
|
|
22597
|
+
try {
|
|
22598
|
+
Object.defineProperty(WritableState.prototype, "buffer", {
|
|
22599
|
+
get: internalUtil.deprecate(function writableStateBufferGetter() {
|
|
22600
|
+
return this.getBuffer();
|
|
22601
|
+
}, "_writableState.buffer is deprecated. Use _writableState.getBuffer instead.", "DEP0003")
|
|
22602
|
+
});
|
|
22603
|
+
} catch (_23) {
|
|
22604
|
+
}
|
|
22605
|
+
})();
|
|
22606
|
+
var realHasInstance;
|
|
22607
|
+
if (typeof Symbol === "function" && Symbol.hasInstance && typeof Function.prototype[Symbol.hasInstance] === "function") {
|
|
22608
|
+
realHasInstance = Function.prototype[Symbol.hasInstance];
|
|
22609
|
+
Object.defineProperty(Writable, Symbol.hasInstance, {
|
|
22610
|
+
value: function value(object) {
|
|
22611
|
+
if (realHasInstance.call(this, object))
|
|
22612
|
+
return true;
|
|
22613
|
+
if (this !== Writable)
|
|
22614
|
+
return false;
|
|
22615
|
+
return object && object._writableState instanceof WritableState;
|
|
22616
|
+
}
|
|
22617
|
+
});
|
|
22618
|
+
} else {
|
|
22619
|
+
realHasInstance = function realHasInstance2(object) {
|
|
22620
|
+
return object instanceof this;
|
|
22621
|
+
};
|
|
22622
|
+
}
|
|
22623
|
+
function Writable(options) {
|
|
22624
|
+
Duplex = Duplex || require_stream_duplex2();
|
|
22625
|
+
var isDuplex = this instanceof Duplex;
|
|
22626
|
+
if (!isDuplex && !realHasInstance.call(Writable, this))
|
|
22627
|
+
return new Writable(options);
|
|
22628
|
+
this._writableState = new WritableState(options, this, isDuplex);
|
|
22629
|
+
this.writable = true;
|
|
22630
|
+
if (options) {
|
|
22631
|
+
if (typeof options.write === "function")
|
|
22632
|
+
this._write = options.write;
|
|
22633
|
+
if (typeof options.writev === "function")
|
|
22634
|
+
this._writev = options.writev;
|
|
22635
|
+
if (typeof options.destroy === "function")
|
|
22636
|
+
this._destroy = options.destroy;
|
|
22637
|
+
if (typeof options.final === "function")
|
|
22638
|
+
this._final = options.final;
|
|
22639
|
+
}
|
|
22640
|
+
Stream.call(this);
|
|
22641
|
+
}
|
|
22642
|
+
Writable.prototype.pipe = function() {
|
|
22643
|
+
errorOrDestroy(this, new ERR_STREAM_CANNOT_PIPE());
|
|
22644
|
+
};
|
|
22645
|
+
function writeAfterEnd(stream4, cb) {
|
|
22646
|
+
var er = new ERR_STREAM_WRITE_AFTER_END();
|
|
22647
|
+
errorOrDestroy(stream4, er);
|
|
22648
|
+
process.nextTick(cb, er);
|
|
22649
|
+
}
|
|
22650
|
+
function validChunk(stream4, state, chunk, cb) {
|
|
22651
|
+
var er;
|
|
22652
|
+
if (chunk === null) {
|
|
22653
|
+
er = new ERR_STREAM_NULL_VALUES();
|
|
22654
|
+
} else if (typeof chunk !== "string" && !state.objectMode) {
|
|
22655
|
+
er = new ERR_INVALID_ARG_TYPE("chunk", ["string", "Buffer"], chunk);
|
|
22656
|
+
}
|
|
22657
|
+
if (er) {
|
|
22658
|
+
errorOrDestroy(stream4, er);
|
|
22659
|
+
process.nextTick(cb, er);
|
|
22660
|
+
return false;
|
|
22661
|
+
}
|
|
22662
|
+
return true;
|
|
22663
|
+
}
|
|
22664
|
+
Writable.prototype.write = function(chunk, encoding, cb) {
|
|
22665
|
+
var state = this._writableState;
|
|
22666
|
+
var ret = false;
|
|
22667
|
+
var isBuf = !state.objectMode && _isUint8Array(chunk);
|
|
22668
|
+
if (isBuf && !Buffer2.isBuffer(chunk)) {
|
|
22669
|
+
chunk = _uint8ArrayToBuffer(chunk);
|
|
22670
|
+
}
|
|
22671
|
+
if (typeof encoding === "function") {
|
|
22672
|
+
cb = encoding;
|
|
22673
|
+
encoding = null;
|
|
22674
|
+
}
|
|
22675
|
+
if (isBuf)
|
|
22676
|
+
encoding = "buffer";
|
|
22677
|
+
else if (!encoding)
|
|
22678
|
+
encoding = state.defaultEncoding;
|
|
22679
|
+
if (typeof cb !== "function")
|
|
22680
|
+
cb = nop;
|
|
22681
|
+
if (state.ending)
|
|
22682
|
+
writeAfterEnd(this, cb);
|
|
22683
|
+
else if (isBuf || validChunk(this, state, chunk, cb)) {
|
|
22684
|
+
state.pendingcb++;
|
|
22685
|
+
ret = writeOrBuffer(this, state, isBuf, chunk, encoding, cb);
|
|
22686
|
+
}
|
|
22687
|
+
return ret;
|
|
22688
|
+
};
|
|
22689
|
+
Writable.prototype.cork = function() {
|
|
22690
|
+
this._writableState.corked++;
|
|
22691
|
+
};
|
|
22692
|
+
Writable.prototype.uncork = function() {
|
|
22693
|
+
var state = this._writableState;
|
|
22694
|
+
if (state.corked) {
|
|
22695
|
+
state.corked--;
|
|
22696
|
+
if (!state.writing && !state.corked && !state.bufferProcessing && state.bufferedRequest)
|
|
22697
|
+
clearBuffer(this, state);
|
|
22698
|
+
}
|
|
22699
|
+
};
|
|
22700
|
+
Writable.prototype.setDefaultEncoding = function setDefaultEncoding(encoding) {
|
|
22701
|
+
if (typeof encoding === "string")
|
|
22702
|
+
encoding = encoding.toLowerCase();
|
|
22703
|
+
if (!(["hex", "utf8", "utf-8", "ascii", "binary", "base64", "ucs2", "ucs-2", "utf16le", "utf-16le", "raw"].indexOf((encoding + "").toLowerCase()) > -1))
|
|
22704
|
+
throw new ERR_UNKNOWN_ENCODING(encoding);
|
|
22705
|
+
this._writableState.defaultEncoding = encoding;
|
|
22706
|
+
return this;
|
|
22707
|
+
};
|
|
22708
|
+
Object.defineProperty(Writable.prototype, "writableBuffer", {
|
|
22709
|
+
// making it explicit this property is not enumerable
|
|
22710
|
+
// because otherwise some prototype manipulation in
|
|
22711
|
+
// userland will fail
|
|
22712
|
+
enumerable: false,
|
|
22713
|
+
get: function get2() {
|
|
22714
|
+
return this._writableState && this._writableState.getBuffer();
|
|
22715
|
+
}
|
|
22716
|
+
});
|
|
22717
|
+
function decodeChunk(state, chunk, encoding) {
|
|
22718
|
+
if (!state.objectMode && state.decodeStrings !== false && typeof chunk === "string") {
|
|
22719
|
+
chunk = Buffer2.from(chunk, encoding);
|
|
22720
|
+
}
|
|
22721
|
+
return chunk;
|
|
22722
|
+
}
|
|
22723
|
+
Object.defineProperty(Writable.prototype, "writableHighWaterMark", {
|
|
22724
|
+
// making it explicit this property is not enumerable
|
|
22725
|
+
// because otherwise some prototype manipulation in
|
|
22726
|
+
// userland will fail
|
|
22727
|
+
enumerable: false,
|
|
22728
|
+
get: function get2() {
|
|
22729
|
+
return this._writableState.highWaterMark;
|
|
22730
|
+
}
|
|
22731
|
+
});
|
|
22732
|
+
function writeOrBuffer(stream4, state, isBuf, chunk, encoding, cb) {
|
|
22733
|
+
if (!isBuf) {
|
|
22734
|
+
var newChunk = decodeChunk(state, chunk, encoding);
|
|
22735
|
+
if (chunk !== newChunk) {
|
|
22736
|
+
isBuf = true;
|
|
22737
|
+
encoding = "buffer";
|
|
22738
|
+
chunk = newChunk;
|
|
22739
|
+
}
|
|
22740
|
+
}
|
|
22741
|
+
var len = state.objectMode ? 1 : chunk.length;
|
|
22742
|
+
state.length += len;
|
|
22743
|
+
var ret = state.length < state.highWaterMark;
|
|
22744
|
+
if (!ret)
|
|
22745
|
+
state.needDrain = true;
|
|
22746
|
+
if (state.writing || state.corked) {
|
|
22747
|
+
var last = state.lastBufferedRequest;
|
|
22748
|
+
state.lastBufferedRequest = {
|
|
22749
|
+
chunk,
|
|
22750
|
+
encoding,
|
|
22751
|
+
isBuf,
|
|
22752
|
+
callback: cb,
|
|
22753
|
+
next: null
|
|
22754
|
+
};
|
|
22755
|
+
if (last) {
|
|
22756
|
+
last.next = state.lastBufferedRequest;
|
|
22757
|
+
} else {
|
|
22758
|
+
state.bufferedRequest = state.lastBufferedRequest;
|
|
22759
|
+
}
|
|
22760
|
+
state.bufferedRequestCount += 1;
|
|
22761
|
+
} else {
|
|
22762
|
+
doWrite(stream4, state, false, len, chunk, encoding, cb);
|
|
22763
|
+
}
|
|
22764
|
+
return ret;
|
|
22765
|
+
}
|
|
22766
|
+
function doWrite(stream4, state, writev, len, chunk, encoding, cb) {
|
|
22767
|
+
state.writelen = len;
|
|
22768
|
+
state.writecb = cb;
|
|
22769
|
+
state.writing = true;
|
|
22770
|
+
state.sync = true;
|
|
22771
|
+
if (state.destroyed)
|
|
22772
|
+
state.onwrite(new ERR_STREAM_DESTROYED("write"));
|
|
22773
|
+
else if (writev)
|
|
22774
|
+
stream4._writev(chunk, state.onwrite);
|
|
22775
|
+
else
|
|
22776
|
+
stream4._write(chunk, encoding, state.onwrite);
|
|
22777
|
+
state.sync = false;
|
|
22778
|
+
}
|
|
22779
|
+
function onwriteError(stream4, state, sync, er, cb) {
|
|
22780
|
+
--state.pendingcb;
|
|
22781
|
+
if (sync) {
|
|
22782
|
+
process.nextTick(cb, er);
|
|
22783
|
+
process.nextTick(finishMaybe, stream4, state);
|
|
22784
|
+
stream4._writableState.errorEmitted = true;
|
|
22785
|
+
errorOrDestroy(stream4, er);
|
|
22786
|
+
} else {
|
|
22787
|
+
cb(er);
|
|
22788
|
+
stream4._writableState.errorEmitted = true;
|
|
22789
|
+
errorOrDestroy(stream4, er);
|
|
22790
|
+
finishMaybe(stream4, state);
|
|
22791
|
+
}
|
|
22792
|
+
}
|
|
22793
|
+
function onwriteStateUpdate(state) {
|
|
22794
|
+
state.writing = false;
|
|
22795
|
+
state.writecb = null;
|
|
22796
|
+
state.length -= state.writelen;
|
|
22797
|
+
state.writelen = 0;
|
|
22798
|
+
}
|
|
22799
|
+
function onwrite(stream4, er) {
|
|
22800
|
+
var state = stream4._writableState;
|
|
22801
|
+
var sync = state.sync;
|
|
22802
|
+
var cb = state.writecb;
|
|
22803
|
+
if (typeof cb !== "function")
|
|
22804
|
+
throw new ERR_MULTIPLE_CALLBACK();
|
|
22805
|
+
onwriteStateUpdate(state);
|
|
22806
|
+
if (er)
|
|
22807
|
+
onwriteError(stream4, state, sync, er, cb);
|
|
22808
|
+
else {
|
|
22809
|
+
var finished = needFinish(state) || stream4.destroyed;
|
|
22810
|
+
if (!finished && !state.corked && !state.bufferProcessing && state.bufferedRequest) {
|
|
22811
|
+
clearBuffer(stream4, state);
|
|
22812
|
+
}
|
|
22813
|
+
if (sync) {
|
|
22814
|
+
process.nextTick(afterWrite, stream4, state, finished, cb);
|
|
22815
|
+
} else {
|
|
22816
|
+
afterWrite(stream4, state, finished, cb);
|
|
22817
|
+
}
|
|
22818
|
+
}
|
|
22819
|
+
}
|
|
22820
|
+
function afterWrite(stream4, state, finished, cb) {
|
|
22821
|
+
if (!finished)
|
|
22822
|
+
onwriteDrain(stream4, state);
|
|
22823
|
+
state.pendingcb--;
|
|
22824
|
+
cb();
|
|
22825
|
+
finishMaybe(stream4, state);
|
|
22826
|
+
}
|
|
22827
|
+
function onwriteDrain(stream4, state) {
|
|
22828
|
+
if (state.length === 0 && state.needDrain) {
|
|
22829
|
+
state.needDrain = false;
|
|
22830
|
+
stream4.emit("drain");
|
|
22831
|
+
}
|
|
22832
|
+
}
|
|
22833
|
+
function clearBuffer(stream4, state) {
|
|
22834
|
+
state.bufferProcessing = true;
|
|
22835
|
+
var entry = state.bufferedRequest;
|
|
22836
|
+
if (stream4._writev && entry && entry.next) {
|
|
22837
|
+
var l = state.bufferedRequestCount;
|
|
22838
|
+
var buffer = new Array(l);
|
|
22839
|
+
var holder = state.corkedRequestsFree;
|
|
22840
|
+
holder.entry = entry;
|
|
22841
|
+
var count = 0;
|
|
22842
|
+
var allBuffers = true;
|
|
22843
|
+
while (entry) {
|
|
22844
|
+
buffer[count] = entry;
|
|
22845
|
+
if (!entry.isBuf)
|
|
22846
|
+
allBuffers = false;
|
|
22847
|
+
entry = entry.next;
|
|
22848
|
+
count += 1;
|
|
22849
|
+
}
|
|
22850
|
+
buffer.allBuffers = allBuffers;
|
|
22851
|
+
doWrite(stream4, state, true, state.length, buffer, "", holder.finish);
|
|
22852
|
+
state.pendingcb++;
|
|
22853
|
+
state.lastBufferedRequest = null;
|
|
22854
|
+
if (holder.next) {
|
|
22855
|
+
state.corkedRequestsFree = holder.next;
|
|
22856
|
+
holder.next = null;
|
|
22857
|
+
} else {
|
|
22858
|
+
state.corkedRequestsFree = new CorkedRequest(state);
|
|
22859
|
+
}
|
|
22860
|
+
state.bufferedRequestCount = 0;
|
|
22861
|
+
} else {
|
|
22862
|
+
while (entry) {
|
|
22863
|
+
var chunk = entry.chunk;
|
|
22864
|
+
var encoding = entry.encoding;
|
|
22865
|
+
var cb = entry.callback;
|
|
22866
|
+
var len = state.objectMode ? 1 : chunk.length;
|
|
22867
|
+
doWrite(stream4, state, false, len, chunk, encoding, cb);
|
|
22868
|
+
entry = entry.next;
|
|
22869
|
+
state.bufferedRequestCount--;
|
|
22870
|
+
if (state.writing) {
|
|
22871
|
+
break;
|
|
22872
|
+
}
|
|
22873
|
+
}
|
|
22874
|
+
if (entry === null)
|
|
22875
|
+
state.lastBufferedRequest = null;
|
|
22876
|
+
}
|
|
22877
|
+
state.bufferedRequest = entry;
|
|
22878
|
+
state.bufferProcessing = false;
|
|
22879
|
+
}
|
|
22880
|
+
Writable.prototype._write = function(chunk, encoding, cb) {
|
|
22881
|
+
cb(new ERR_METHOD_NOT_IMPLEMENTED("_write()"));
|
|
22882
|
+
};
|
|
22883
|
+
Writable.prototype._writev = null;
|
|
22884
|
+
Writable.prototype.end = function(chunk, encoding, cb) {
|
|
22885
|
+
var state = this._writableState;
|
|
22886
|
+
if (typeof chunk === "function") {
|
|
22887
|
+
cb = chunk;
|
|
22888
|
+
chunk = null;
|
|
22889
|
+
encoding = null;
|
|
22890
|
+
} else if (typeof encoding === "function") {
|
|
22891
|
+
cb = encoding;
|
|
22892
|
+
encoding = null;
|
|
22893
|
+
}
|
|
22894
|
+
if (chunk !== null && chunk !== void 0)
|
|
22895
|
+
this.write(chunk, encoding);
|
|
22896
|
+
if (state.corked) {
|
|
22897
|
+
state.corked = 1;
|
|
22898
|
+
this.uncork();
|
|
22899
|
+
}
|
|
22900
|
+
if (!state.ending)
|
|
22901
|
+
endWritable(this, state, cb);
|
|
22902
|
+
return this;
|
|
22903
|
+
};
|
|
22904
|
+
Object.defineProperty(Writable.prototype, "writableLength", {
|
|
22905
|
+
// making it explicit this property is not enumerable
|
|
22906
|
+
// because otherwise some prototype manipulation in
|
|
22907
|
+
// userland will fail
|
|
22908
|
+
enumerable: false,
|
|
22909
|
+
get: function get2() {
|
|
22910
|
+
return this._writableState.length;
|
|
22911
|
+
}
|
|
22912
|
+
});
|
|
22913
|
+
function needFinish(state) {
|
|
22914
|
+
return state.ending && state.length === 0 && state.bufferedRequest === null && !state.finished && !state.writing;
|
|
22915
|
+
}
|
|
22916
|
+
function callFinal(stream4, state) {
|
|
22917
|
+
stream4._final(function(err) {
|
|
22918
|
+
state.pendingcb--;
|
|
22919
|
+
if (err) {
|
|
22920
|
+
errorOrDestroy(stream4, err);
|
|
22921
|
+
}
|
|
22922
|
+
state.prefinished = true;
|
|
22923
|
+
stream4.emit("prefinish");
|
|
22924
|
+
finishMaybe(stream4, state);
|
|
22925
|
+
});
|
|
22926
|
+
}
|
|
22927
|
+
function prefinish(stream4, state) {
|
|
22928
|
+
if (!state.prefinished && !state.finalCalled) {
|
|
22929
|
+
if (typeof stream4._final === "function" && !state.destroyed) {
|
|
22930
|
+
state.pendingcb++;
|
|
22931
|
+
state.finalCalled = true;
|
|
22932
|
+
process.nextTick(callFinal, stream4, state);
|
|
22933
|
+
} else {
|
|
22934
|
+
state.prefinished = true;
|
|
22935
|
+
stream4.emit("prefinish");
|
|
22936
|
+
}
|
|
22937
|
+
}
|
|
22938
|
+
}
|
|
22939
|
+
function finishMaybe(stream4, state) {
|
|
22940
|
+
var need = needFinish(state);
|
|
22941
|
+
if (need) {
|
|
22942
|
+
prefinish(stream4, state);
|
|
22943
|
+
if (state.pendingcb === 0) {
|
|
22944
|
+
state.finished = true;
|
|
22945
|
+
stream4.emit("finish");
|
|
22946
|
+
if (state.autoDestroy) {
|
|
22947
|
+
var rState = stream4._readableState;
|
|
22948
|
+
if (!rState || rState.autoDestroy && rState.endEmitted) {
|
|
22949
|
+
stream4.destroy();
|
|
22950
|
+
}
|
|
22951
|
+
}
|
|
22952
|
+
}
|
|
22953
|
+
}
|
|
22954
|
+
return need;
|
|
22955
|
+
}
|
|
22956
|
+
function endWritable(stream4, state, cb) {
|
|
22957
|
+
state.ending = true;
|
|
22958
|
+
finishMaybe(stream4, state);
|
|
22959
|
+
if (cb) {
|
|
22960
|
+
if (state.finished)
|
|
22961
|
+
process.nextTick(cb);
|
|
22962
|
+
else
|
|
22963
|
+
stream4.once("finish", cb);
|
|
22964
|
+
}
|
|
22965
|
+
state.ended = true;
|
|
22966
|
+
stream4.writable = false;
|
|
22967
|
+
}
|
|
22968
|
+
function onCorkedFinish(corkReq, state, err) {
|
|
22969
|
+
var entry = corkReq.entry;
|
|
22970
|
+
corkReq.entry = null;
|
|
22971
|
+
while (entry) {
|
|
22972
|
+
var cb = entry.callback;
|
|
22973
|
+
state.pendingcb--;
|
|
22974
|
+
cb(err);
|
|
22975
|
+
entry = entry.next;
|
|
22976
|
+
}
|
|
22977
|
+
state.corkedRequestsFree.next = corkReq;
|
|
22978
|
+
}
|
|
22979
|
+
Object.defineProperty(Writable.prototype, "destroyed", {
|
|
22980
|
+
// making it explicit this property is not enumerable
|
|
22981
|
+
// because otherwise some prototype manipulation in
|
|
22982
|
+
// userland will fail
|
|
22983
|
+
enumerable: false,
|
|
22984
|
+
get: function get2() {
|
|
22985
|
+
if (this._writableState === void 0) {
|
|
22986
|
+
return false;
|
|
22987
|
+
}
|
|
22988
|
+
return this._writableState.destroyed;
|
|
22989
|
+
},
|
|
22990
|
+
set: function set(value) {
|
|
22991
|
+
if (!this._writableState) {
|
|
22992
|
+
return;
|
|
22993
|
+
}
|
|
22994
|
+
this._writableState.destroyed = value;
|
|
22995
|
+
}
|
|
22996
|
+
});
|
|
22997
|
+
Writable.prototype.destroy = destroyImpl.destroy;
|
|
22998
|
+
Writable.prototype._undestroy = destroyImpl.undestroy;
|
|
22999
|
+
Writable.prototype._destroy = function(err, cb) {
|
|
23000
|
+
cb(err);
|
|
23001
|
+
};
|
|
23002
|
+
}
|
|
23003
|
+
});
|
|
23004
|
+
|
|
23005
|
+
// ../../node_modules/winston-transport/legacy.js
|
|
23006
|
+
var require_legacy2 = __commonJS({
|
|
23007
|
+
"../../node_modules/winston-transport/legacy.js"(exports, module2) {
|
|
23008
|
+
"use strict";
|
|
23009
|
+
var util2 = require("util");
|
|
23010
|
+
var { LEVEL } = require_triple_beam();
|
|
23011
|
+
var TransportStream = require_winston_transport2();
|
|
23012
|
+
var LegacyTransportStream = module2.exports = function LegacyTransportStream2(options = {}) {
|
|
23013
|
+
TransportStream.call(this, options);
|
|
23014
|
+
if (!options.transport || typeof options.transport.log !== "function") {
|
|
23015
|
+
throw new Error("Invalid transport, must be an object with a log method.");
|
|
23016
|
+
}
|
|
23017
|
+
this.transport = options.transport;
|
|
23018
|
+
this.level = this.level || options.transport.level;
|
|
23019
|
+
this.handleExceptions = this.handleExceptions || options.transport.handleExceptions;
|
|
23020
|
+
this._deprecated();
|
|
23021
|
+
function transportError(err) {
|
|
23022
|
+
this.emit("error", err, this.transport);
|
|
23023
|
+
}
|
|
23024
|
+
if (!this.transport.__winstonError) {
|
|
23025
|
+
this.transport.__winstonError = transportError.bind(this);
|
|
23026
|
+
this.transport.on("error", this.transport.__winstonError);
|
|
23027
|
+
}
|
|
23028
|
+
};
|
|
23029
|
+
util2.inherits(LegacyTransportStream, TransportStream);
|
|
23030
|
+
LegacyTransportStream.prototype._write = function _write(info, enc, callback) {
|
|
23031
|
+
if (this.silent || info.exception === true && !this.handleExceptions) {
|
|
23032
|
+
return callback(null);
|
|
23033
|
+
}
|
|
23034
|
+
if (!this.level || this.levels[this.level] >= this.levels[info[LEVEL]]) {
|
|
23035
|
+
this.transport.log(info[LEVEL], info.message, info, this._nop);
|
|
23036
|
+
}
|
|
23037
|
+
callback(null);
|
|
23038
|
+
};
|
|
23039
|
+
LegacyTransportStream.prototype._writev = function _writev(chunks, callback) {
|
|
23040
|
+
for (let i = 0; i < chunks.length; i++) {
|
|
23041
|
+
if (this._accept(chunks[i])) {
|
|
23042
|
+
this.transport.log(
|
|
23043
|
+
chunks[i].chunk[LEVEL],
|
|
23044
|
+
chunks[i].chunk.message,
|
|
23045
|
+
chunks[i].chunk,
|
|
23046
|
+
this._nop
|
|
23047
|
+
);
|
|
23048
|
+
chunks[i].callback();
|
|
23049
|
+
}
|
|
23050
|
+
}
|
|
23051
|
+
return callback(null);
|
|
23052
|
+
};
|
|
23053
|
+
LegacyTransportStream.prototype._deprecated = function _deprecated() {
|
|
23054
|
+
console.error([
|
|
23055
|
+
`${this.transport.name} is a legacy winston transport. Consider upgrading: `,
|
|
23056
|
+
"- Upgrade docs: https://github.com/winstonjs/winston/blob/master/UPGRADE-3.0.md"
|
|
23057
|
+
].join("\n"));
|
|
23058
|
+
};
|
|
23059
|
+
LegacyTransportStream.prototype.close = function close() {
|
|
23060
|
+
if (this.transport.close) {
|
|
23061
|
+
this.transport.close();
|
|
23062
|
+
}
|
|
23063
|
+
if (this.transport.__winstonError) {
|
|
23064
|
+
this.transport.removeListener("error", this.transport.__winstonError);
|
|
23065
|
+
this.transport.__winstonError = null;
|
|
23066
|
+
}
|
|
23067
|
+
};
|
|
23068
|
+
}
|
|
23069
|
+
});
|
|
23070
|
+
|
|
23071
|
+
// ../../node_modules/winston-transport/index.js
|
|
23072
|
+
var require_winston_transport2 = __commonJS({
|
|
23073
|
+
"../../node_modules/winston-transport/index.js"(exports, module2) {
|
|
23074
|
+
"use strict";
|
|
23075
|
+
var util2 = require("util");
|
|
23076
|
+
var Writable = require_stream_writable2();
|
|
23077
|
+
var { LEVEL } = require_triple_beam();
|
|
23078
|
+
var TransportStream = module2.exports = function TransportStream2(options = {}) {
|
|
23079
|
+
Writable.call(this, { objectMode: true, highWaterMark: options.highWaterMark });
|
|
23080
|
+
this.format = options.format;
|
|
23081
|
+
this.level = options.level;
|
|
23082
|
+
this.handleExceptions = options.handleExceptions;
|
|
23083
|
+
this.handleRejections = options.handleRejections;
|
|
23084
|
+
this.silent = options.silent;
|
|
23085
|
+
if (options.log)
|
|
23086
|
+
this.log = options.log;
|
|
23087
|
+
if (options.logv)
|
|
23088
|
+
this.logv = options.logv;
|
|
23089
|
+
if (options.close)
|
|
23090
|
+
this.close = options.close;
|
|
23091
|
+
this.once("pipe", (logger) => {
|
|
23092
|
+
this.levels = logger.levels;
|
|
23093
|
+
this.parent = logger;
|
|
23094
|
+
});
|
|
23095
|
+
this.once("unpipe", (src) => {
|
|
23096
|
+
if (src === this.parent) {
|
|
23097
|
+
this.parent = null;
|
|
23098
|
+
if (this.close) {
|
|
23099
|
+
this.close();
|
|
23100
|
+
}
|
|
23101
|
+
}
|
|
23102
|
+
});
|
|
23103
|
+
};
|
|
23104
|
+
util2.inherits(TransportStream, Writable);
|
|
23105
|
+
TransportStream.prototype._write = function _write(info, enc, callback) {
|
|
23106
|
+
if (this.silent || info.exception === true && !this.handleExceptions) {
|
|
23107
|
+
return callback(null);
|
|
23108
|
+
}
|
|
23109
|
+
const level = this.level || this.parent && this.parent.level;
|
|
23110
|
+
if (!level || this.levels[level] >= this.levels[info[LEVEL]]) {
|
|
23111
|
+
if (info && !this.format) {
|
|
23112
|
+
return this.log(info, callback);
|
|
23113
|
+
}
|
|
23114
|
+
let errState;
|
|
23115
|
+
let transformed;
|
|
23116
|
+
try {
|
|
23117
|
+
transformed = this.format.transform(Object.assign({}, info), this.format.options);
|
|
23118
|
+
} catch (err) {
|
|
23119
|
+
errState = err;
|
|
23120
|
+
}
|
|
23121
|
+
if (errState || !transformed) {
|
|
23122
|
+
callback();
|
|
23123
|
+
if (errState)
|
|
23124
|
+
throw errState;
|
|
23125
|
+
return;
|
|
23126
|
+
}
|
|
23127
|
+
return this.log(transformed, callback);
|
|
23128
|
+
}
|
|
23129
|
+
this._writableState.sync = false;
|
|
23130
|
+
return callback(null);
|
|
23131
|
+
};
|
|
23132
|
+
TransportStream.prototype._writev = function _writev(chunks, callback) {
|
|
23133
|
+
if (this.logv) {
|
|
23134
|
+
const infos = chunks.filter(this._accept, this);
|
|
23135
|
+
if (!infos.length) {
|
|
23136
|
+
return callback(null);
|
|
23137
|
+
}
|
|
23138
|
+
return this.logv(infos, callback);
|
|
23139
|
+
}
|
|
23140
|
+
for (let i = 0; i < chunks.length; i++) {
|
|
23141
|
+
if (!this._accept(chunks[i]))
|
|
23142
|
+
continue;
|
|
23143
|
+
if (chunks[i].chunk && !this.format) {
|
|
23144
|
+
this.log(chunks[i].chunk, chunks[i].callback);
|
|
23145
|
+
continue;
|
|
23146
|
+
}
|
|
23147
|
+
let errState;
|
|
23148
|
+
let transformed;
|
|
23149
|
+
try {
|
|
23150
|
+
transformed = this.format.transform(
|
|
23151
|
+
Object.assign({}, chunks[i].chunk),
|
|
23152
|
+
this.format.options
|
|
23153
|
+
);
|
|
23154
|
+
} catch (err) {
|
|
23155
|
+
errState = err;
|
|
23156
|
+
}
|
|
23157
|
+
if (errState || !transformed) {
|
|
23158
|
+
chunks[i].callback();
|
|
23159
|
+
if (errState) {
|
|
23160
|
+
callback(null);
|
|
23161
|
+
throw errState;
|
|
23162
|
+
}
|
|
23163
|
+
} else {
|
|
23164
|
+
this.log(transformed, chunks[i].callback);
|
|
23165
|
+
}
|
|
23166
|
+
}
|
|
23167
|
+
return callback(null);
|
|
23168
|
+
};
|
|
23169
|
+
TransportStream.prototype._accept = function _accept(write) {
|
|
23170
|
+
const info = write.chunk;
|
|
23171
|
+
if (this.silent) {
|
|
23172
|
+
return false;
|
|
23173
|
+
}
|
|
23174
|
+
const level = this.level || this.parent && this.parent.level;
|
|
23175
|
+
if (info.exception === true || !level || this.levels[level] >= this.levels[info[LEVEL]]) {
|
|
23176
|
+
if (this.handleExceptions || info.exception !== true) {
|
|
23177
|
+
return true;
|
|
23178
|
+
}
|
|
23179
|
+
}
|
|
23180
|
+
return false;
|
|
23181
|
+
};
|
|
23182
|
+
TransportStream.prototype._nop = function _nop() {
|
|
23183
|
+
return void 0;
|
|
23184
|
+
};
|
|
23185
|
+
module2.exports.LegacyTransportStream = require_legacy2();
|
|
23186
|
+
}
|
|
23187
|
+
});
|
|
23188
|
+
|
|
23189
|
+
// ../../node_modules/winston/lib/winston/transports/console.js
|
|
23190
|
+
var require_console = __commonJS({
|
|
23191
|
+
"../../node_modules/winston/lib/winston/transports/console.js"(exports, module2) {
|
|
23192
|
+
"use strict";
|
|
23193
|
+
var os = require("os");
|
|
23194
|
+
var { LEVEL, MESSAGE } = require_triple_beam();
|
|
23195
|
+
var TransportStream = require_winston_transport2();
|
|
23196
|
+
module2.exports = class Console extends TransportStream {
|
|
23197
|
+
/**
|
|
23198
|
+
* Constructor function for the Console transport object responsible for
|
|
23199
|
+
* persisting log messages and metadata to a terminal or TTY.
|
|
23200
|
+
* @param {!Object} [options={}] - Options for this instance.
|
|
23201
|
+
*/
|
|
23202
|
+
constructor(options = {}) {
|
|
23203
|
+
super(options);
|
|
23204
|
+
this.name = options.name || "console";
|
|
23205
|
+
this.stderrLevels = this._stringArrayToSet(options.stderrLevels);
|
|
23206
|
+
this.consoleWarnLevels = this._stringArrayToSet(options.consoleWarnLevels);
|
|
23207
|
+
this.eol = typeof options.eol === "string" ? options.eol : os.EOL;
|
|
23208
|
+
this.setMaxListeners(30);
|
|
23209
|
+
}
|
|
23210
|
+
/**
|
|
23211
|
+
* Core logging method exposed to Winston.
|
|
23212
|
+
* @param {Object} info - TODO: add param description.
|
|
23213
|
+
* @param {Function} callback - TODO: add param description.
|
|
23214
|
+
* @returns {undefined}
|
|
23215
|
+
*/
|
|
23216
|
+
log(info, callback) {
|
|
23217
|
+
setImmediate(() => this.emit("logged", info));
|
|
23218
|
+
if (this.stderrLevels[info[LEVEL]]) {
|
|
23219
|
+
if (console._stderr) {
|
|
23220
|
+
console._stderr.write(`${info[MESSAGE]}${this.eol}`);
|
|
23221
|
+
} else {
|
|
23222
|
+
console.error(info[MESSAGE]);
|
|
23223
|
+
}
|
|
23224
|
+
if (callback) {
|
|
23225
|
+
callback();
|
|
23226
|
+
}
|
|
23227
|
+
return;
|
|
23228
|
+
} else if (this.consoleWarnLevels[info[LEVEL]]) {
|
|
23229
|
+
if (console._stderr) {
|
|
23230
|
+
console._stderr.write(`${info[MESSAGE]}${this.eol}`);
|
|
20504
23231
|
} else {
|
|
20505
23232
|
console.warn(info[MESSAGE]);
|
|
20506
23233
|
}
|
|
@@ -21109,14 +23836,14 @@ var require_series = __commonJS({
|
|
|
21109
23836
|
});
|
|
21110
23837
|
|
|
21111
23838
|
// ../../node_modules/winston/node_modules/readable-stream/lib/internal/streams/stream.js
|
|
21112
|
-
var
|
|
23839
|
+
var require_stream3 = __commonJS({
|
|
21113
23840
|
"../../node_modules/winston/node_modules/readable-stream/lib/internal/streams/stream.js"(exports, module2) {
|
|
21114
23841
|
module2.exports = require("stream");
|
|
21115
23842
|
}
|
|
21116
23843
|
});
|
|
21117
23844
|
|
|
21118
23845
|
// ../../node_modules/winston/node_modules/readable-stream/lib/internal/streams/buffer_list.js
|
|
21119
|
-
var
|
|
23846
|
+
var require_buffer_list3 = __commonJS({
|
|
21120
23847
|
"../../node_modules/winston/node_modules/readable-stream/lib/internal/streams/buffer_list.js"(exports, module2) {
|
|
21121
23848
|
"use strict";
|
|
21122
23849
|
function ownKeys(object, enumerableOnly) {
|
|
@@ -21369,7 +24096,7 @@ var require_buffer_list2 = __commonJS({
|
|
|
21369
24096
|
});
|
|
21370
24097
|
|
|
21371
24098
|
// ../../node_modules/winston/node_modules/readable-stream/lib/internal/streams/destroy.js
|
|
21372
|
-
var
|
|
24099
|
+
var require_destroy3 = __commonJS({
|
|
21373
24100
|
"../../node_modules/winston/node_modules/readable-stream/lib/internal/streams/destroy.js"(exports, module2) {
|
|
21374
24101
|
"use strict";
|
|
21375
24102
|
function destroy(err, cb) {
|
|
@@ -21462,7 +24189,7 @@ var require_destroy2 = __commonJS({
|
|
|
21462
24189
|
});
|
|
21463
24190
|
|
|
21464
24191
|
// ../../node_modules/winston/node_modules/readable-stream/errors.js
|
|
21465
|
-
var
|
|
24192
|
+
var require_errors4 = __commonJS({
|
|
21466
24193
|
"../../node_modules/winston/node_modules/readable-stream/errors.js"(exports, module2) {
|
|
21467
24194
|
"use strict";
|
|
21468
24195
|
var codes = {};
|
|
@@ -21562,10 +24289,10 @@ var require_errors3 = __commonJS({
|
|
|
21562
24289
|
});
|
|
21563
24290
|
|
|
21564
24291
|
// ../../node_modules/winston/node_modules/readable-stream/lib/internal/streams/state.js
|
|
21565
|
-
var
|
|
24292
|
+
var require_state4 = __commonJS({
|
|
21566
24293
|
"../../node_modules/winston/node_modules/readable-stream/lib/internal/streams/state.js"(exports, module2) {
|
|
21567
24294
|
"use strict";
|
|
21568
|
-
var ERR_INVALID_OPT_VALUE =
|
|
24295
|
+
var ERR_INVALID_OPT_VALUE = require_errors4().codes.ERR_INVALID_OPT_VALUE;
|
|
21569
24296
|
function highWaterMarkFrom(options, isDuplex, duplexKey) {
|
|
21570
24297
|
return options.highWaterMark != null ? options.highWaterMark : isDuplex ? options[duplexKey] : null;
|
|
21571
24298
|
}
|
|
@@ -21587,7 +24314,7 @@ var require_state3 = __commonJS({
|
|
|
21587
24314
|
});
|
|
21588
24315
|
|
|
21589
24316
|
// ../../node_modules/winston/node_modules/readable-stream/lib/_stream_writable.js
|
|
21590
|
-
var
|
|
24317
|
+
var require_stream_writable3 = __commonJS({
|
|
21591
24318
|
"../../node_modules/winston/node_modules/readable-stream/lib/_stream_writable.js"(exports, module2) {
|
|
21592
24319
|
"use strict";
|
|
21593
24320
|
module2.exports = Writable;
|
|
@@ -21604,7 +24331,7 @@ var require_stream_writable2 = __commonJS({
|
|
|
21604
24331
|
var internalUtil = {
|
|
21605
24332
|
deprecate: require_node3()
|
|
21606
24333
|
};
|
|
21607
|
-
var Stream =
|
|
24334
|
+
var Stream = require_stream3();
|
|
21608
24335
|
var Buffer2 = require("buffer").Buffer;
|
|
21609
24336
|
var OurUint8Array = global.Uint8Array || function() {
|
|
21610
24337
|
};
|
|
@@ -21614,10 +24341,10 @@ var require_stream_writable2 = __commonJS({
|
|
|
21614
24341
|
function _isUint8Array(obj) {
|
|
21615
24342
|
return Buffer2.isBuffer(obj) || obj instanceof OurUint8Array;
|
|
21616
24343
|
}
|
|
21617
|
-
var destroyImpl =
|
|
21618
|
-
var _require =
|
|
24344
|
+
var destroyImpl = require_destroy3();
|
|
24345
|
+
var _require = require_state4();
|
|
21619
24346
|
var getHighWaterMark = _require.getHighWaterMark;
|
|
21620
|
-
var _require$codes =
|
|
24347
|
+
var _require$codes = require_errors4().codes;
|
|
21621
24348
|
var ERR_INVALID_ARG_TYPE = _require$codes.ERR_INVALID_ARG_TYPE;
|
|
21622
24349
|
var ERR_METHOD_NOT_IMPLEMENTED = _require$codes.ERR_METHOD_NOT_IMPLEMENTED;
|
|
21623
24350
|
var ERR_MULTIPLE_CALLBACK = _require$codes.ERR_MULTIPLE_CALLBACK;
|
|
@@ -21631,7 +24358,7 @@ var require_stream_writable2 = __commonJS({
|
|
|
21631
24358
|
function nop() {
|
|
21632
24359
|
}
|
|
21633
24360
|
function WritableState(options, stream4, isDuplex) {
|
|
21634
|
-
Duplex = Duplex ||
|
|
24361
|
+
Duplex = Duplex || require_stream_duplex3();
|
|
21635
24362
|
options = options || {};
|
|
21636
24363
|
if (typeof isDuplex !== "boolean")
|
|
21637
24364
|
isDuplex = stream4 instanceof Duplex;
|
|
@@ -21705,7 +24432,7 @@ var require_stream_writable2 = __commonJS({
|
|
|
21705
24432
|
};
|
|
21706
24433
|
}
|
|
21707
24434
|
function Writable(options) {
|
|
21708
|
-
Duplex = Duplex ||
|
|
24435
|
+
Duplex = Duplex || require_stream_duplex3();
|
|
21709
24436
|
var isDuplex = this instanceof Duplex;
|
|
21710
24437
|
if (!isDuplex && !realHasInstance.call(Writable, this))
|
|
21711
24438
|
return new Writable(options);
|
|
@@ -22087,7 +24814,7 @@ var require_stream_writable2 = __commonJS({
|
|
|
22087
24814
|
});
|
|
22088
24815
|
|
|
22089
24816
|
// ../../node_modules/winston/node_modules/readable-stream/lib/_stream_duplex.js
|
|
22090
|
-
var
|
|
24817
|
+
var require_stream_duplex3 = __commonJS({
|
|
22091
24818
|
"../../node_modules/winston/node_modules/readable-stream/lib/_stream_duplex.js"(exports, module2) {
|
|
22092
24819
|
"use strict";
|
|
22093
24820
|
var objectKeys = Object.keys || function(obj) {
|
|
@@ -22098,8 +24825,8 @@ var require_stream_duplex2 = __commonJS({
|
|
|
22098
24825
|
return keys2;
|
|
22099
24826
|
};
|
|
22100
24827
|
module2.exports = Duplex;
|
|
22101
|
-
var Readable2 =
|
|
22102
|
-
var Writable =
|
|
24828
|
+
var Readable2 = require_stream_readable3();
|
|
24829
|
+
var Writable = require_stream_writable3();
|
|
22103
24830
|
require_inherits()(Duplex, Readable2);
|
|
22104
24831
|
{
|
|
22105
24832
|
keys = objectKeys(Writable.prototype);
|
|
@@ -22187,7 +24914,7 @@ var require_stream_duplex2 = __commonJS({
|
|
|
22187
24914
|
});
|
|
22188
24915
|
|
|
22189
24916
|
// ../../node_modules/winston/node_modules/string_decoder/lib/string_decoder.js
|
|
22190
|
-
var
|
|
24917
|
+
var require_string_decoder3 = __commonJS({
|
|
22191
24918
|
"../../node_modules/winston/node_modules/string_decoder/lib/string_decoder.js"(exports) {
|
|
22192
24919
|
"use strict";
|
|
22193
24920
|
var Buffer2 = require_safe_buffer().Buffer;
|
|
@@ -22447,10 +25174,10 @@ var require_string_decoder2 = __commonJS({
|
|
|
22447
25174
|
});
|
|
22448
25175
|
|
|
22449
25176
|
// ../../node_modules/winston/node_modules/readable-stream/lib/internal/streams/end-of-stream.js
|
|
22450
|
-
var
|
|
25177
|
+
var require_end_of_stream3 = __commonJS({
|
|
22451
25178
|
"../../node_modules/winston/node_modules/readable-stream/lib/internal/streams/end-of-stream.js"(exports, module2) {
|
|
22452
25179
|
"use strict";
|
|
22453
|
-
var ERR_STREAM_PREMATURE_CLOSE =
|
|
25180
|
+
var ERR_STREAM_PREMATURE_CLOSE = require_errors4().codes.ERR_STREAM_PREMATURE_CLOSE;
|
|
22454
25181
|
function once2(callback) {
|
|
22455
25182
|
var called = false;
|
|
22456
25183
|
return function() {
|
|
@@ -22548,7 +25275,7 @@ var require_end_of_stream2 = __commonJS({
|
|
|
22548
25275
|
});
|
|
22549
25276
|
|
|
22550
25277
|
// ../../node_modules/winston/node_modules/readable-stream/lib/internal/streams/async_iterator.js
|
|
22551
|
-
var
|
|
25278
|
+
var require_async_iterator3 = __commonJS({
|
|
22552
25279
|
"../../node_modules/winston/node_modules/readable-stream/lib/internal/streams/async_iterator.js"(exports, module2) {
|
|
22553
25280
|
"use strict";
|
|
22554
25281
|
var _Object$setPrototypeO;
|
|
@@ -22560,7 +25287,7 @@ var require_async_iterator2 = __commonJS({
|
|
|
22560
25287
|
}
|
|
22561
25288
|
return obj;
|
|
22562
25289
|
}
|
|
22563
|
-
var finished =
|
|
25290
|
+
var finished = require_end_of_stream3();
|
|
22564
25291
|
var kLastResolve = Symbol("lastResolve");
|
|
22565
25292
|
var kLastReject = Symbol("lastReject");
|
|
22566
25293
|
var kError = Symbol("error");
|
|
@@ -22716,7 +25443,7 @@ var require_async_iterator2 = __commonJS({
|
|
|
22716
25443
|
});
|
|
22717
25444
|
|
|
22718
25445
|
// ../../node_modules/winston/node_modules/readable-stream/lib/internal/streams/from.js
|
|
22719
|
-
var
|
|
25446
|
+
var require_from3 = __commonJS({
|
|
22720
25447
|
"../../node_modules/winston/node_modules/readable-stream/lib/internal/streams/from.js"(exports, module2) {
|
|
22721
25448
|
"use strict";
|
|
22722
25449
|
function asyncGeneratorStep(gen, resolve, reject2, _next, _throw, key, arg) {
|
|
@@ -22785,7 +25512,7 @@ var require_from2 = __commonJS({
|
|
|
22785
25512
|
}
|
|
22786
25513
|
return obj;
|
|
22787
25514
|
}
|
|
22788
|
-
var ERR_INVALID_ARG_TYPE =
|
|
25515
|
+
var ERR_INVALID_ARG_TYPE = require_errors4().codes.ERR_INVALID_ARG_TYPE;
|
|
22789
25516
|
function from(Readable2, iterable, opts) {
|
|
22790
25517
|
var iterator;
|
|
22791
25518
|
if (iterable && typeof iterable.next === "function") {
|
|
@@ -22833,7 +25560,7 @@ var require_from2 = __commonJS({
|
|
|
22833
25560
|
});
|
|
22834
25561
|
|
|
22835
25562
|
// ../../node_modules/winston/node_modules/readable-stream/lib/_stream_readable.js
|
|
22836
|
-
var
|
|
25563
|
+
var require_stream_readable3 = __commonJS({
|
|
22837
25564
|
"../../node_modules/winston/node_modules/readable-stream/lib/_stream_readable.js"(exports, module2) {
|
|
22838
25565
|
"use strict";
|
|
22839
25566
|
module2.exports = Readable2;
|
|
@@ -22843,7 +25570,7 @@ var require_stream_readable2 = __commonJS({
|
|
|
22843
25570
|
var EElistenerCount = function EElistenerCount2(emitter, type) {
|
|
22844
25571
|
return emitter.listeners(type).length;
|
|
22845
25572
|
};
|
|
22846
|
-
var Stream =
|
|
25573
|
+
var Stream = require_stream3();
|
|
22847
25574
|
var Buffer2 = require("buffer").Buffer;
|
|
22848
25575
|
var OurUint8Array = global.Uint8Array || function() {
|
|
22849
25576
|
};
|
|
@@ -22861,11 +25588,11 @@ var require_stream_readable2 = __commonJS({
|
|
|
22861
25588
|
debug = function debug2() {
|
|
22862
25589
|
};
|
|
22863
25590
|
}
|
|
22864
|
-
var BufferList =
|
|
22865
|
-
var destroyImpl =
|
|
22866
|
-
var _require =
|
|
25591
|
+
var BufferList = require_buffer_list3();
|
|
25592
|
+
var destroyImpl = require_destroy3();
|
|
25593
|
+
var _require = require_state4();
|
|
22867
25594
|
var getHighWaterMark = _require.getHighWaterMark;
|
|
22868
|
-
var _require$codes =
|
|
25595
|
+
var _require$codes = require_errors4().codes;
|
|
22869
25596
|
var ERR_INVALID_ARG_TYPE = _require$codes.ERR_INVALID_ARG_TYPE;
|
|
22870
25597
|
var ERR_STREAM_PUSH_AFTER_EOF = _require$codes.ERR_STREAM_PUSH_AFTER_EOF;
|
|
22871
25598
|
var ERR_METHOD_NOT_IMPLEMENTED = _require$codes.ERR_METHOD_NOT_IMPLEMENTED;
|
|
@@ -22887,7 +25614,7 @@ var require_stream_readable2 = __commonJS({
|
|
|
22887
25614
|
emitter._events[event] = [fn, emitter._events[event]];
|
|
22888
25615
|
}
|
|
22889
25616
|
function ReadableState(options, stream4, isDuplex) {
|
|
22890
|
-
Duplex = Duplex ||
|
|
25617
|
+
Duplex = Duplex || require_stream_duplex3();
|
|
22891
25618
|
options = options || {};
|
|
22892
25619
|
if (typeof isDuplex !== "boolean")
|
|
22893
25620
|
isDuplex = stream4 instanceof Duplex;
|
|
@@ -22919,13 +25646,13 @@ var require_stream_readable2 = __commonJS({
|
|
|
22919
25646
|
this.encoding = null;
|
|
22920
25647
|
if (options.encoding) {
|
|
22921
25648
|
if (!StringDecoder)
|
|
22922
|
-
StringDecoder =
|
|
25649
|
+
StringDecoder = require_string_decoder3().StringDecoder;
|
|
22923
25650
|
this.decoder = new StringDecoder(options.encoding);
|
|
22924
25651
|
this.encoding = options.encoding;
|
|
22925
25652
|
}
|
|
22926
25653
|
}
|
|
22927
25654
|
function Readable2(options) {
|
|
22928
|
-
Duplex = Duplex ||
|
|
25655
|
+
Duplex = Duplex || require_stream_duplex3();
|
|
22929
25656
|
if (!(this instanceof Readable2))
|
|
22930
25657
|
return new Readable2(options);
|
|
22931
25658
|
var isDuplex = this instanceof Duplex;
|
|
@@ -23053,7 +25780,7 @@ var require_stream_readable2 = __commonJS({
|
|
|
23053
25780
|
};
|
|
23054
25781
|
Readable2.prototype.setEncoding = function(enc) {
|
|
23055
25782
|
if (!StringDecoder)
|
|
23056
|
-
StringDecoder =
|
|
25783
|
+
StringDecoder = require_string_decoder3().StringDecoder;
|
|
23057
25784
|
var decoder = new StringDecoder(enc);
|
|
23058
25785
|
this._readableState.decoder = decoder;
|
|
23059
25786
|
this._readableState.encoding = this._readableState.decoder.encoding;
|
|
@@ -23524,7 +26251,7 @@ var require_stream_readable2 = __commonJS({
|
|
|
23524
26251
|
if (typeof Symbol === "function") {
|
|
23525
26252
|
Readable2.prototype[Symbol.asyncIterator] = function() {
|
|
23526
26253
|
if (createReadableStreamAsyncIterator === void 0) {
|
|
23527
|
-
createReadableStreamAsyncIterator =
|
|
26254
|
+
createReadableStreamAsyncIterator = require_async_iterator3();
|
|
23528
26255
|
}
|
|
23529
26256
|
return createReadableStreamAsyncIterator(this);
|
|
23530
26257
|
};
|
|
@@ -23615,7 +26342,7 @@ var require_stream_readable2 = __commonJS({
|
|
|
23615
26342
|
if (typeof Symbol === "function") {
|
|
23616
26343
|
Readable2.from = function(iterable, opts) {
|
|
23617
26344
|
if (from === void 0) {
|
|
23618
|
-
from =
|
|
26345
|
+
from = require_from3();
|
|
23619
26346
|
}
|
|
23620
26347
|
return from(Readable2, iterable, opts);
|
|
23621
26348
|
};
|
|
@@ -23635,12 +26362,12 @@ var require_stream_transform = __commonJS({
|
|
|
23635
26362
|
"../../node_modules/winston/node_modules/readable-stream/lib/_stream_transform.js"(exports, module2) {
|
|
23636
26363
|
"use strict";
|
|
23637
26364
|
module2.exports = Transform;
|
|
23638
|
-
var _require$codes =
|
|
26365
|
+
var _require$codes = require_errors4().codes;
|
|
23639
26366
|
var ERR_METHOD_NOT_IMPLEMENTED = _require$codes.ERR_METHOD_NOT_IMPLEMENTED;
|
|
23640
26367
|
var ERR_MULTIPLE_CALLBACK = _require$codes.ERR_MULTIPLE_CALLBACK;
|
|
23641
26368
|
var ERR_TRANSFORM_ALREADY_TRANSFORMING = _require$codes.ERR_TRANSFORM_ALREADY_TRANSFORMING;
|
|
23642
26369
|
var ERR_TRANSFORM_WITH_LENGTH_0 = _require$codes.ERR_TRANSFORM_WITH_LENGTH_0;
|
|
23643
|
-
var Duplex =
|
|
26370
|
+
var Duplex = require_stream_duplex3();
|
|
23644
26371
|
require_inherits()(Transform, Duplex);
|
|
23645
26372
|
function afterTransform(er, data) {
|
|
23646
26373
|
var ts = this._transformState;
|
|
@@ -23770,7 +26497,7 @@ var require_pipeline = __commonJS({
|
|
|
23770
26497
|
callback.apply(void 0, arguments);
|
|
23771
26498
|
};
|
|
23772
26499
|
}
|
|
23773
|
-
var _require$codes =
|
|
26500
|
+
var _require$codes = require_errors4().codes;
|
|
23774
26501
|
var ERR_MISSING_ARGS = _require$codes.ERR_MISSING_ARGS;
|
|
23775
26502
|
var ERR_STREAM_DESTROYED = _require$codes.ERR_STREAM_DESTROYED;
|
|
23776
26503
|
function noop3(err) {
|
|
@@ -23787,7 +26514,7 @@ var require_pipeline = __commonJS({
|
|
|
23787
26514
|
closed = true;
|
|
23788
26515
|
});
|
|
23789
26516
|
if (eos === void 0)
|
|
23790
|
-
eos =
|
|
26517
|
+
eos = require_end_of_stream3();
|
|
23791
26518
|
eos(stream4, {
|
|
23792
26519
|
readable: reading,
|
|
23793
26520
|
writable: writing
|
|
@@ -23864,14 +26591,14 @@ var require_readable = __commonJS({
|
|
|
23864
26591
|
Object.assign(module2.exports, Stream);
|
|
23865
26592
|
module2.exports.Stream = Stream;
|
|
23866
26593
|
} else {
|
|
23867
|
-
exports = module2.exports =
|
|
26594
|
+
exports = module2.exports = require_stream_readable3();
|
|
23868
26595
|
exports.Stream = Stream || exports;
|
|
23869
26596
|
exports.Readable = exports;
|
|
23870
|
-
exports.Writable =
|
|
23871
|
-
exports.Duplex =
|
|
26597
|
+
exports.Writable = require_stream_writable3();
|
|
26598
|
+
exports.Duplex = require_stream_duplex3();
|
|
23872
26599
|
exports.Transform = require_stream_transform();
|
|
23873
26600
|
exports.PassThrough = require_stream_passthrough();
|
|
23874
|
-
exports.finished =
|
|
26601
|
+
exports.finished = require_end_of_stream3();
|
|
23875
26602
|
exports.pipeline = require_pipeline();
|
|
23876
26603
|
}
|
|
23877
26604
|
}
|
|
@@ -26039,7 +28766,7 @@ var require_file = __commonJS({
|
|
|
26039
28766
|
var zlib2 = require("zlib");
|
|
26040
28767
|
var { MESSAGE } = require_triple_beam();
|
|
26041
28768
|
var { Stream, PassThrough } = require_readable();
|
|
26042
|
-
var TransportStream =
|
|
28769
|
+
var TransportStream = require_winston_transport2();
|
|
26043
28770
|
var debug = require_node4()("winston:file");
|
|
26044
28771
|
var os = require("os");
|
|
26045
28772
|
var tailFile = require_tail_file();
|
|
@@ -26081,15 +28808,18 @@ var require_file = __commonJS({
|
|
|
26081
28808
|
this.maxFiles = options.maxFiles || null;
|
|
26082
28809
|
this.eol = typeof options.eol === "string" ? options.eol : os.EOL;
|
|
26083
28810
|
this.tailable = options.tailable || false;
|
|
28811
|
+
this.lazy = options.lazy || false;
|
|
26084
28812
|
this._size = 0;
|
|
26085
28813
|
this._pendingSize = 0;
|
|
26086
28814
|
this._created = 0;
|
|
26087
28815
|
this._drain = false;
|
|
26088
28816
|
this._opening = false;
|
|
26089
28817
|
this._ending = false;
|
|
28818
|
+
this._fileExist = false;
|
|
26090
28819
|
if (this.dirname)
|
|
26091
28820
|
this._createLogDirIfNotExist(this.dirname);
|
|
26092
|
-
this.
|
|
28821
|
+
if (!this.lazy)
|
|
28822
|
+
this.open();
|
|
26093
28823
|
}
|
|
26094
28824
|
finishIfEnding() {
|
|
26095
28825
|
if (this._ending) {
|
|
@@ -26130,6 +28860,32 @@ var require_file = __commonJS({
|
|
|
26130
28860
|
});
|
|
26131
28861
|
return;
|
|
26132
28862
|
}
|
|
28863
|
+
if (this.lazy) {
|
|
28864
|
+
if (!this._fileExist) {
|
|
28865
|
+
if (!this._opening) {
|
|
28866
|
+
this.open();
|
|
28867
|
+
}
|
|
28868
|
+
this.once("open", () => {
|
|
28869
|
+
this._fileExist = true;
|
|
28870
|
+
this.log(info, callback);
|
|
28871
|
+
return;
|
|
28872
|
+
});
|
|
28873
|
+
return;
|
|
28874
|
+
}
|
|
28875
|
+
if (this._needsNewFile(this._pendingSize)) {
|
|
28876
|
+
this._dest.once("close", () => {
|
|
28877
|
+
if (!this._opening) {
|
|
28878
|
+
this.open();
|
|
28879
|
+
}
|
|
28880
|
+
this.once("open", () => {
|
|
28881
|
+
this.log(info, callback);
|
|
28882
|
+
return;
|
|
28883
|
+
});
|
|
28884
|
+
return;
|
|
28885
|
+
});
|
|
28886
|
+
return;
|
|
28887
|
+
}
|
|
28888
|
+
}
|
|
26133
28889
|
const output2 = `${info[MESSAGE]}${this.eol}`;
|
|
26134
28890
|
const bytes = Buffer.byteLength(output2);
|
|
26135
28891
|
function logged() {
|
|
@@ -26137,12 +28893,21 @@ var require_file = __commonJS({
|
|
|
26137
28893
|
this._pendingSize -= bytes;
|
|
26138
28894
|
debug("logged %s %s", this._size, output2);
|
|
26139
28895
|
this.emit("logged", info);
|
|
28896
|
+
if (this._rotate) {
|
|
28897
|
+
return;
|
|
28898
|
+
}
|
|
26140
28899
|
if (this._opening) {
|
|
26141
28900
|
return;
|
|
26142
28901
|
}
|
|
26143
28902
|
if (!this._needsNewFile()) {
|
|
26144
28903
|
return;
|
|
26145
28904
|
}
|
|
28905
|
+
if (this.lazy) {
|
|
28906
|
+
this._endStream(() => {
|
|
28907
|
+
this.emit("fileclosed");
|
|
28908
|
+
});
|
|
28909
|
+
return;
|
|
28910
|
+
}
|
|
26146
28911
|
this._rotate = true;
|
|
26147
28912
|
this._endStream(() => this._rotateFile());
|
|
26148
28913
|
}
|
|
@@ -26404,6 +29169,7 @@ var require_file = __commonJS({
|
|
|
26404
29169
|
*/
|
|
26405
29170
|
_cleanupStream(stream4) {
|
|
26406
29171
|
stream4.removeListener("error", this._onError);
|
|
29172
|
+
stream4.destroy();
|
|
26407
29173
|
return stream4;
|
|
26408
29174
|
}
|
|
26409
29175
|
/**
|
|
@@ -26435,7 +29201,7 @@ var require_file = __commonJS({
|
|
|
26435
29201
|
* Returns the WritableStream for the active file on this instance. If we
|
|
26436
29202
|
* should gzip the file then a zlib stream is returned.
|
|
26437
29203
|
*
|
|
26438
|
-
* @param {ReadableStream} source –
|
|
29204
|
+
* @param {ReadableStream} source –PassThrough to pipe to the file when open.
|
|
26439
29205
|
* @returns {WritableStream} Stream that writes to disk for the active file.
|
|
26440
29206
|
*/
|
|
26441
29207
|
_createStream(source) {
|
|
@@ -26564,7 +29330,7 @@ var require_http = __commonJS({
|
|
|
26564
29330
|
var http2 = require("http");
|
|
26565
29331
|
var https2 = require("https");
|
|
26566
29332
|
var { Stream } = require_readable();
|
|
26567
|
-
var TransportStream =
|
|
29333
|
+
var TransportStream = require_winston_transport2();
|
|
26568
29334
|
var jsonStringify = require_safe_stable_stringify();
|
|
26569
29335
|
module2.exports = class Http extends TransportStream {
|
|
26570
29336
|
/**
|
|
@@ -26602,7 +29368,7 @@ var require_http = __commonJS({
|
|
|
26602
29368
|
* @returns {undefined}
|
|
26603
29369
|
*/
|
|
26604
29370
|
log(info, callback) {
|
|
26605
|
-
this._request(info, (err, res) => {
|
|
29371
|
+
this._request(info, null, null, (err, res) => {
|
|
26606
29372
|
if (res && res.statusCode !== 200) {
|
|
26607
29373
|
err = new Error(`Invalid HTTP Status Code: ${res.statusCode}`);
|
|
26608
29374
|
}
|
|
@@ -26631,15 +29397,11 @@ var require_http = __commonJS({
|
|
|
26631
29397
|
method: "query",
|
|
26632
29398
|
params: this.normalizeQuery(options)
|
|
26633
29399
|
};
|
|
26634
|
-
|
|
26635
|
-
|
|
26636
|
-
|
|
26637
|
-
|
|
26638
|
-
|
|
26639
|
-
options.auth = options.params.auth;
|
|
26640
|
-
delete options.params.auth;
|
|
26641
|
-
}
|
|
26642
|
-
this._request(options, (err, res, body) => {
|
|
29400
|
+
const auth = options.params.auth || null;
|
|
29401
|
+
delete options.params.auth;
|
|
29402
|
+
const path = options.params.path || null;
|
|
29403
|
+
delete options.params.path;
|
|
29404
|
+
this._request(options, auth, path, (err, res, body) => {
|
|
26643
29405
|
if (res && res.statusCode !== 200) {
|
|
26644
29406
|
err = new Error(`Invalid HTTP Status Code: ${res.statusCode}`);
|
|
26645
29407
|
}
|
|
@@ -26667,16 +29429,12 @@ var require_http = __commonJS({
|
|
|
26667
29429
|
method: "stream",
|
|
26668
29430
|
params: options
|
|
26669
29431
|
};
|
|
26670
|
-
|
|
26671
|
-
|
|
26672
|
-
|
|
26673
|
-
|
|
26674
|
-
if (options.params.auth) {
|
|
26675
|
-
options.auth = options.params.auth;
|
|
26676
|
-
delete options.params.auth;
|
|
26677
|
-
}
|
|
29432
|
+
const path = options.params.path || null;
|
|
29433
|
+
delete options.params.path;
|
|
29434
|
+
const auth = options.params.auth || null;
|
|
29435
|
+
delete options.params.auth;
|
|
26678
29436
|
let buff = "";
|
|
26679
|
-
const req = this._request(options);
|
|
29437
|
+
const req = this._request(options, auth, path);
|
|
26680
29438
|
stream4.destroy = () => req.destroy();
|
|
26681
29439
|
req.on("data", (data) => {
|
|
26682
29440
|
data = (buff + data).split(/\n+/);
|
|
@@ -26698,14 +29456,14 @@ var require_http = __commonJS({
|
|
|
26698
29456
|
* Make a request to a winstond server or any http server which can
|
|
26699
29457
|
* handle json-rpc.
|
|
26700
29458
|
* @param {function} options - Options to sent the request.
|
|
29459
|
+
* @param {Object?} auth - authentication options
|
|
29460
|
+
* @param {string} path - request path
|
|
26701
29461
|
* @param {function} callback - Continuation to respond to when complete.
|
|
26702
29462
|
*/
|
|
26703
|
-
_request(options, callback) {
|
|
29463
|
+
_request(options, auth, path, callback) {
|
|
26704
29464
|
options = options || {};
|
|
26705
|
-
|
|
26706
|
-
|
|
26707
|
-
delete options.auth;
|
|
26708
|
-
delete options.path;
|
|
29465
|
+
auth = auth || this.auth;
|
|
29466
|
+
path = path || this.path || "";
|
|
26709
29467
|
if (this.batch) {
|
|
26710
29468
|
this._doBatch(options, callback, auth, path);
|
|
26711
29469
|
} else {
|
|
@@ -26773,7 +29531,7 @@ var require_http = __commonJS({
|
|
|
26773
29531
|
});
|
|
26774
29532
|
req.on("error", callback);
|
|
26775
29533
|
req.on("response", (res) => res.on("end", () => callback(null, res)).resume());
|
|
26776
|
-
req.end(Buffer.from(jsonStringify(options), "utf8"));
|
|
29534
|
+
req.end(Buffer.from(jsonStringify(options, this.options.replacer), "utf8"));
|
|
26777
29535
|
}
|
|
26778
29536
|
};
|
|
26779
29537
|
}
|
|
@@ -26793,13 +29551,13 @@ var require_is_stream = __commonJS({
|
|
|
26793
29551
|
});
|
|
26794
29552
|
|
|
26795
29553
|
// ../../node_modules/winston/lib/winston/transports/stream.js
|
|
26796
|
-
var
|
|
29554
|
+
var require_stream4 = __commonJS({
|
|
26797
29555
|
"../../node_modules/winston/lib/winston/transports/stream.js"(exports, module2) {
|
|
26798
29556
|
"use strict";
|
|
26799
29557
|
var isStream2 = require_is_stream();
|
|
26800
29558
|
var { MESSAGE } = require_triple_beam();
|
|
26801
29559
|
var os = require("os");
|
|
26802
|
-
var TransportStream =
|
|
29560
|
+
var TransportStream = require_winston_transport2();
|
|
26803
29561
|
module2.exports = class Stream extends TransportStream {
|
|
26804
29562
|
/**
|
|
26805
29563
|
* Constructor function for the Console transport object responsible for
|
|
@@ -26870,7 +29628,7 @@ var require_transports2 = __commonJS({
|
|
|
26870
29628
|
configurable: true,
|
|
26871
29629
|
enumerable: true,
|
|
26872
29630
|
get() {
|
|
26873
|
-
return
|
|
29631
|
+
return require_stream4();
|
|
26874
29632
|
}
|
|
26875
29633
|
});
|
|
26876
29634
|
}
|
|
@@ -27253,9 +30011,9 @@ var require_exception_handler = __commonJS({
|
|
|
27253
30011
|
* @returns {mixed} - TODO: add return description.
|
|
27254
30012
|
*/
|
|
27255
30013
|
getAllInfo(err) {
|
|
27256
|
-
let
|
|
27257
|
-
if (
|
|
27258
|
-
message = err;
|
|
30014
|
+
let message = null;
|
|
30015
|
+
if (err) {
|
|
30016
|
+
message = typeof err === "string" ? err : err.message;
|
|
27259
30017
|
}
|
|
27260
30018
|
return {
|
|
27261
30019
|
error: err,
|
|
@@ -27263,9 +30021,9 @@ var require_exception_handler = __commonJS({
|
|
|
27263
30021
|
level: "error",
|
|
27264
30022
|
message: [
|
|
27265
30023
|
`uncaughtException: ${message || "(no error message)"}`,
|
|
27266
|
-
err.stack || " No stack trace"
|
|
30024
|
+
err && err.stack || " No stack trace"
|
|
27267
30025
|
].join("\n"),
|
|
27268
|
-
stack: err.stack,
|
|
30026
|
+
stack: err && err.stack,
|
|
27269
30027
|
exception: true,
|
|
27270
30028
|
date: (/* @__PURE__ */ new Date()).toString(),
|
|
27271
30029
|
process: this.getProcessInfo(),
|
|
@@ -27602,7 +30360,7 @@ var require_rejection_handler = __commonJS({
|
|
|
27602
30360
|
var require_profiler = __commonJS({
|
|
27603
30361
|
"../../node_modules/winston/lib/winston/profiler.js"(exports, module2) {
|
|
27604
30362
|
"use strict";
|
|
27605
|
-
|
|
30363
|
+
var Profiler = class {
|
|
27606
30364
|
/**
|
|
27607
30365
|
* Constructor function for the Profiler instance used by
|
|
27608
30366
|
* `Logger.prototype.startTimer`. When done is called the timer will finish
|
|
@@ -27611,11 +30369,13 @@ var require_profiler = __commonJS({
|
|
|
27611
30369
|
* @private
|
|
27612
30370
|
*/
|
|
27613
30371
|
constructor(logger) {
|
|
27614
|
-
|
|
27615
|
-
|
|
30372
|
+
const Logger2 = require_logger();
|
|
30373
|
+
if (typeof logger !== "object" || Array.isArray(logger) || !(logger instanceof Logger2)) {
|
|
30374
|
+
throw new Error("Logger is required for profiling");
|
|
30375
|
+
} else {
|
|
30376
|
+
this.logger = logger;
|
|
30377
|
+
this.start = Date.now();
|
|
27616
30378
|
}
|
|
27617
|
-
this.logger = logger;
|
|
27618
|
-
this.start = Date.now();
|
|
27619
30379
|
}
|
|
27620
30380
|
/**
|
|
27621
30381
|
* Ends the current timer (i.e. Profiler) instance and logs the `msg` along
|
|
@@ -27634,6 +30394,7 @@ var require_profiler = __commonJS({
|
|
|
27634
30394
|
return this.logger.write(info);
|
|
27635
30395
|
}
|
|
27636
30396
|
};
|
|
30397
|
+
module2.exports = Profiler;
|
|
27637
30398
|
}
|
|
27638
30399
|
});
|
|
27639
30400
|
|
|
@@ -27647,7 +30408,7 @@ var require_logger = __commonJS({
|
|
|
27647
30408
|
var isStream2 = require_is_stream();
|
|
27648
30409
|
var ExceptionHandler = require_exception_handler();
|
|
27649
30410
|
var RejectionHandler = require_rejection_handler();
|
|
27650
|
-
var LegacyTransportStream =
|
|
30411
|
+
var LegacyTransportStream = require_legacy2();
|
|
27651
30412
|
var Profiler = require_profiler();
|
|
27652
30413
|
var { warn: warn2 } = require_common3();
|
|
27653
30414
|
var config = require_config2();
|
|
@@ -27860,7 +30621,7 @@ var require_logger = __commonJS({
|
|
|
27860
30621
|
}
|
|
27861
30622
|
if (!this._readableState.pipes) {
|
|
27862
30623
|
console.error(
|
|
27863
|
-
"[winston] Attempt to write logs with no transports %j",
|
|
30624
|
+
"[winston] Attempt to write logs with no transports, which can increase memory usage: %j",
|
|
27864
30625
|
info
|
|
27865
30626
|
);
|
|
27866
30627
|
}
|
|
@@ -28242,7 +31003,11 @@ var require_container = __commonJS({
|
|
|
28242
31003
|
if (!this.loggers.has(id)) {
|
|
28243
31004
|
options = Object.assign({}, options || this.options);
|
|
28244
31005
|
const existing = options.transports || this.options.transports;
|
|
28245
|
-
|
|
31006
|
+
if (existing) {
|
|
31007
|
+
options.transports = Array.isArray(existing) ? existing.slice() : [existing];
|
|
31008
|
+
} else {
|
|
31009
|
+
options.transports = [];
|
|
31010
|
+
}
|
|
28246
31011
|
const logger = createLogger(options);
|
|
28247
31012
|
logger.on("close", () => this._delete(id));
|
|
28248
31013
|
this.loggers.set(id, logger);
|
|
@@ -28320,10 +31085,11 @@ var require_winston = __commonJS({
|
|
|
28320
31085
|
exports.addColors = logform.levels;
|
|
28321
31086
|
exports.format = logform.format;
|
|
28322
31087
|
exports.createLogger = require_create_logger();
|
|
31088
|
+
exports.Logger = require_logger();
|
|
28323
31089
|
exports.ExceptionHandler = require_exception_handler();
|
|
28324
31090
|
exports.RejectionHandler = require_rejection_handler();
|
|
28325
31091
|
exports.Container = require_container();
|
|
28326
|
-
exports.Transport =
|
|
31092
|
+
exports.Transport = require_winston_transport2();
|
|
28327
31093
|
exports.loggers = new exports.Container();
|
|
28328
31094
|
var defaultLogger = exports.createLogger();
|
|
28329
31095
|
Object.keys(exports.config.npm.levels).concat([
|
|
@@ -28386,7 +31152,6 @@ var require_winston = __commonJS({
|
|
|
28386
31152
|
"extend"
|
|
28387
31153
|
]);
|
|
28388
31154
|
warn2.forProperties(exports, "deprecated", ["emitErrs", "levelLength"]);
|
|
28389
|
-
warn2.moved(exports, "createLogger", "Logger");
|
|
28390
31155
|
}
|
|
28391
31156
|
});
|
|
28392
31157
|
|
|
@@ -28422,14 +31187,27 @@ var require_vscode_output_channel_transport = __commonJS({
|
|
|
28422
31187
|
var VSCodeTransport = class extends winston_transport_1.default {
|
|
28423
31188
|
constructor(options) {
|
|
28424
31189
|
super(options);
|
|
28425
|
-
this.
|
|
31190
|
+
this.winstonToVSCodeMap = /* @__PURE__ */ new Map([
|
|
31191
|
+
["error", "error"],
|
|
31192
|
+
["warn", "warn"],
|
|
31193
|
+
["info", "info"],
|
|
31194
|
+
["verbose", "debug"],
|
|
31195
|
+
["debug", "debug"],
|
|
31196
|
+
["silly", "trace"]
|
|
31197
|
+
]);
|
|
31198
|
+
this.channel = getVSCodeInstance().window.createOutputChannel(options.channelName, { log: true });
|
|
28426
31199
|
}
|
|
28427
31200
|
log(data, callback) {
|
|
28428
31201
|
setImmediate(() => {
|
|
28429
|
-
|
|
31202
|
+
var _a;
|
|
31203
|
+
const logFunction = (_a = this.winstonToVSCodeMap.get(data.level)) !== null && _a !== void 0 ? _a : "info";
|
|
31204
|
+
this.channel[logFunction](data.message);
|
|
28430
31205
|
});
|
|
28431
31206
|
callback();
|
|
28432
31207
|
}
|
|
31208
|
+
show() {
|
|
31209
|
+
this.channel.show();
|
|
31210
|
+
}
|
|
28433
31211
|
};
|
|
28434
31212
|
exports.VSCodeTransport = VSCodeTransport;
|
|
28435
31213
|
function getVSCodeInstance() {
|
|
@@ -30007,7 +32785,7 @@ var require_logger2 = __commonJS({
|
|
|
30007
32785
|
const logger = winston_1.default.createLogger({
|
|
30008
32786
|
level,
|
|
30009
32787
|
transports: Array.from(transportMap.values()),
|
|
30010
|
-
format: winston_1.format.combine(winston_1.format.timestamp(), winston_1.format.json()),
|
|
32788
|
+
format: winston_1.format.combine(winston_1.format.timestamp(), winston_1.format.json(), winston_1.format.splat()),
|
|
30011
32789
|
defaultMeta: { label: logPrefix, labelColor: (0, utils_1.nextColor)() }
|
|
30012
32790
|
});
|
|
30013
32791
|
const winstonLevel = level !== null && level !== void 0 ? level : logger.level;
|
|
@@ -30031,6 +32809,102 @@ var require_winston_logger = __commonJS({
|
|
|
30031
32809
|
}
|
|
30032
32810
|
});
|
|
30033
32811
|
|
|
32812
|
+
// ../../node_modules/@sap-ux/logger/dist/extension-logger/index.js
|
|
32813
|
+
var require_extension_logger = __commonJS({
|
|
32814
|
+
"../../node_modules/@sap-ux/logger/dist/extension-logger/index.js"(exports) {
|
|
32815
|
+
"use strict";
|
|
32816
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
32817
|
+
exports.ExtensionLogger = void 0;
|
|
32818
|
+
var transports_1 = require_transports();
|
|
32819
|
+
var vscode_output_channel_transport_1 = require_vscode_output_channel_transport();
|
|
32820
|
+
var winston_logger_1 = require_winston_logger();
|
|
32821
|
+
var types_1 = require_types();
|
|
32822
|
+
var adapter_1 = require_adapter();
|
|
32823
|
+
var ExtensionLogger = class extends winston_logger_1.WinstonLogger {
|
|
32824
|
+
constructor(channelName) {
|
|
32825
|
+
const vscodeTransport = new transports_1.VSCodeTransport({ channelName });
|
|
32826
|
+
super({
|
|
32827
|
+
logLevel: types_1.LogLevel.Silly,
|
|
32828
|
+
// set to lowest level, let VSCode filter levels
|
|
32829
|
+
transports: [vscodeTransport],
|
|
32830
|
+
logPrefix: ""
|
|
32831
|
+
});
|
|
32832
|
+
}
|
|
32833
|
+
/**
|
|
32834
|
+
* Private function to enable adding additional arguments to the log message.
|
|
32835
|
+
* Prepares the message for formatting with format.splat().
|
|
32836
|
+
*
|
|
32837
|
+
* @param level - log level
|
|
32838
|
+
* @param message - log message
|
|
32839
|
+
* @param args - additional arguments like objects, arrays, etc.
|
|
32840
|
+
*/
|
|
32841
|
+
logWithArgs(level, message, ...args) {
|
|
32842
|
+
var _a;
|
|
32843
|
+
const winstonLevel = (_a = (0, adapter_1.toWinstonLogLevel)(level)) !== null && _a !== void 0 ? _a : this._logger.level;
|
|
32844
|
+
if (args.length > 0) {
|
|
32845
|
+
message += " %O".repeat(args.length);
|
|
32846
|
+
}
|
|
32847
|
+
this._logger.log(winstonLevel, message, ...args);
|
|
32848
|
+
}
|
|
32849
|
+
/**
|
|
32850
|
+
* Log an error message.
|
|
32851
|
+
*
|
|
32852
|
+
* @param message - error message
|
|
32853
|
+
* @param args - additional arguments like objects, arrays, etc.
|
|
32854
|
+
*/
|
|
32855
|
+
error(message, ...args) {
|
|
32856
|
+
this.logWithArgs(types_1.LogLevel.Error, message, ...args);
|
|
32857
|
+
}
|
|
32858
|
+
/**
|
|
32859
|
+
* Log a warning message.
|
|
32860
|
+
*
|
|
32861
|
+
* @param message - warning message
|
|
32862
|
+
* @param args - additional arguments like objects, arrays, etc.
|
|
32863
|
+
*/
|
|
32864
|
+
warn(message, ...args) {
|
|
32865
|
+
this.logWithArgs(types_1.LogLevel.Warn, message, ...args);
|
|
32866
|
+
}
|
|
32867
|
+
/**
|
|
32868
|
+
* Log an info message.
|
|
32869
|
+
*
|
|
32870
|
+
* @param message - info message
|
|
32871
|
+
* @param args - additional arguments like objects, arrays, etc.
|
|
32872
|
+
*/
|
|
32873
|
+
info(message, ...args) {
|
|
32874
|
+
this.logWithArgs(types_1.LogLevel.Info, message, ...args);
|
|
32875
|
+
}
|
|
32876
|
+
/**
|
|
32877
|
+
* Log a debug message.
|
|
32878
|
+
*
|
|
32879
|
+
* @param message - debug message
|
|
32880
|
+
* @param args - additional arguments like objects, arrays, etc.
|
|
32881
|
+
*/
|
|
32882
|
+
debug(message, ...args) {
|
|
32883
|
+
this.logWithArgs(types_1.LogLevel.Debug, message, ...args);
|
|
32884
|
+
}
|
|
32885
|
+
/**
|
|
32886
|
+
* Log a trace message.
|
|
32887
|
+
*
|
|
32888
|
+
* @param message - log message
|
|
32889
|
+
* @param args - additional arguments like objects, arrays, etc.
|
|
32890
|
+
*/
|
|
32891
|
+
trace(message, ...args) {
|
|
32892
|
+
this.logWithArgs(types_1.LogLevel.Silly, message, ...args);
|
|
32893
|
+
}
|
|
32894
|
+
/**
|
|
32895
|
+
* Show the output channel in Visual Studio Code.
|
|
32896
|
+
*/
|
|
32897
|
+
show() {
|
|
32898
|
+
const winstonVSCodeTransport = this._logger.transports.find((t) => t instanceof vscode_output_channel_transport_1.VSCodeTransport);
|
|
32899
|
+
if (winstonVSCodeTransport) {
|
|
32900
|
+
winstonVSCodeTransport.show();
|
|
32901
|
+
}
|
|
32902
|
+
}
|
|
32903
|
+
};
|
|
32904
|
+
exports.ExtensionLogger = ExtensionLogger;
|
|
32905
|
+
}
|
|
32906
|
+
});
|
|
32907
|
+
|
|
30034
32908
|
// ../../node_modules/@sap-ux/logger/dist/index.js
|
|
30035
32909
|
var require_dist = __commonJS({
|
|
30036
32910
|
"../../node_modules/@sap-ux/logger/dist/index.js"(exports) {
|
|
@@ -30056,13 +32930,17 @@ var require_dist = __commonJS({
|
|
|
30056
32930
|
__createBinding(exports2, m, p);
|
|
30057
32931
|
};
|
|
30058
32932
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
30059
|
-
exports.ToolsLogger = void 0;
|
|
32933
|
+
exports.ExtensionLogger = exports.ToolsLogger = void 0;
|
|
30060
32934
|
__exportStar(require_types(), exports);
|
|
30061
32935
|
__exportStar(require_transports(), exports);
|
|
30062
32936
|
var winston_logger_1 = require_winston_logger();
|
|
30063
32937
|
Object.defineProperty(exports, "ToolsLogger", { enumerable: true, get: function() {
|
|
30064
32938
|
return winston_logger_1.WinstonLogger;
|
|
30065
32939
|
} });
|
|
32940
|
+
var extension_logger_1 = require_extension_logger();
|
|
32941
|
+
Object.defineProperty(exports, "ExtensionLogger", { enumerable: true, get: function() {
|
|
32942
|
+
return extension_logger_1.ExtensionLogger;
|
|
32943
|
+
} });
|
|
30066
32944
|
}
|
|
30067
32945
|
});
|
|
30068
32946
|
|
|
@@ -32464,7 +35342,7 @@ var i18n_default = {
|
|
|
32464
35342
|
INDEX_EXISTS_NOT_OVERWRITING: "'index.html' already exists, not generating one",
|
|
32465
35343
|
INDEX_HTML_ADDED: "index.html added",
|
|
32466
35344
|
INFO_CREATE_ARCHIVE: "Create Archive",
|
|
32467
|
-
INFO_COMMAND_FAILED: "Command {{cmd}} failed with error {{-message}}",
|
|
35345
|
+
INFO_COMMAND_FAILED: "Command {{cmd}} failed with error : {{-message}}",
|
|
32468
35346
|
INFO_DEPLOYMENT_SUCCESSFUL: "Deployment Successful.",
|
|
32469
35347
|
INFO_TEST_MODE: "Deployment in TestMode completed. A successful TestMode execution does not necessarily mean that your upload will be successful",
|
|
32470
35348
|
ERROR_NO_SYSTEM_IN_STORE: "Error in deployment. The BTP system used in the deployment configuration could not be found as one of your local saved SAP systems. Please ensure you have saved this system locally so that it can be used for deployment.",
|
|
@@ -32549,6 +35427,7 @@ var i18n_default = {
|
|
|
32549
35427
|
ARCHIVE_PATH_CREATED: "Archive path created {{-archivePath}}",
|
|
32550
35428
|
ARCHIVE_PATH_AVAILABLE: "Archive read from {{-archivePath}}",
|
|
32551
35429
|
ERROR_UPDATE_DEPLOY_CONFIG: "Error while updating config file, error was: {{-error}}",
|
|
35430
|
+
ERROR_NO_DEPLOY_CONFIG: "Error loading deployment configuration. Please ensure the YAML syntax and indentation is correct.",
|
|
32552
35431
|
TELEMETRY_CALL_FAILED: "Error while sending telemetry data",
|
|
32553
35432
|
ERROR_TRANSPORT_REQUEST_CREATION: "Transport request could not be created for application {{appName}}. Please create it manually and re-run deployment configuration for this project.",
|
|
32554
35433
|
UPDATE_UI5_CLI: "The UI5 CLI version of the project is outdated. Please upgrade your project to UI5 CLI v3:\nhttps://sap.github.io/ui5-tooling/v3/updates/migrate-v3/."
|