@nocobase/plugin-workflow-javascript 2.0.3

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (81) hide show
  1. package/LICENSE +201 -0
  2. package/README.md +99 -0
  3. package/client.d.ts +2 -0
  4. package/client.js +1 -0
  5. package/dist/client/907399554f340b0a.js +10 -0
  6. package/dist/client/CodeEditor.d.ts +8 -0
  7. package/dist/client/ScriptInstruction.d.ts +129 -0
  8. package/dist/client/d608e8e5c2f2b5cf.js +10 -0
  9. package/dist/client/index.d.ts +5 -0
  10. package/dist/client/index.js +10 -0
  11. package/dist/externalVersion.js +23 -0
  12. package/dist/index.d.ts +2 -0
  13. package/dist/index.js +48 -0
  14. package/dist/locale/de-DE.json +33 -0
  15. package/dist/locale/en-US.json +33 -0
  16. package/dist/locale/es-ES.json +33 -0
  17. package/dist/locale/fr-FR.json +33 -0
  18. package/dist/locale/hu-HU.json +33 -0
  19. package/dist/locale/id-ID.json +33 -0
  20. package/dist/locale/index.d.ts +12 -0
  21. package/dist/locale/index.js +54 -0
  22. package/dist/locale/it-IT.json +33 -0
  23. package/dist/locale/ja-JP.json +33 -0
  24. package/dist/locale/ko-KR.json +33 -0
  25. package/dist/locale/ko_KR.json +25 -0
  26. package/dist/locale/nl-NL.json +33 -0
  27. package/dist/locale/pt-BR.json +33 -0
  28. package/dist/locale/ru-RU.json +33 -0
  29. package/dist/locale/tr-TR.json +33 -0
  30. package/dist/locale/uk-UA.json +33 -0
  31. package/dist/locale/vi-VN.json +33 -0
  32. package/dist/locale/zh-CN.json +33 -0
  33. package/dist/locale/zh-TW.json +33 -0
  34. package/dist/node_modules/winston-transport/.babelrc +3 -0
  35. package/dist/node_modules/winston-transport/.eslintrc +7 -0
  36. package/dist/node_modules/winston-transport/.gitattributes +1 -0
  37. package/dist/node_modules/winston-transport/.nyc_output/c1bd7935-644d-4c7a-89c1-24531a04e4cc.json +1 -0
  38. package/dist/node_modules/winston-transport/.nyc_output/processinfo/c1bd7935-644d-4c7a-89c1-24531a04e4cc.json +1 -0
  39. package/dist/node_modules/winston-transport/.nyc_output/processinfo/index.json +1 -0
  40. package/dist/node_modules/winston-transport/LICENSE +22 -0
  41. package/dist/node_modules/winston-transport/dist/index.js +8 -0
  42. package/dist/node_modules/winston-transport/dist/legacy.js +116 -0
  43. package/dist/node_modules/winston-transport/dist/modern.js +212 -0
  44. package/dist/node_modules/winston-transport/index.d.ts +39 -0
  45. package/dist/node_modules/winston-transport/index.js +3 -0
  46. package/dist/node_modules/winston-transport/legacy.js +119 -0
  47. package/dist/node_modules/winston-transport/modern.js +211 -0
  48. package/dist/node_modules/winston-transport/node_modules/readable-stream/errors-browser.js +127 -0
  49. package/dist/node_modules/winston-transport/node_modules/readable-stream/errors.js +116 -0
  50. package/dist/node_modules/winston-transport/node_modules/readable-stream/experimentalWarning.js +17 -0
  51. package/dist/node_modules/winston-transport/node_modules/readable-stream/lib/_stream_duplex.js +126 -0
  52. package/dist/node_modules/winston-transport/node_modules/readable-stream/lib/_stream_passthrough.js +37 -0
  53. package/dist/node_modules/winston-transport/node_modules/readable-stream/lib/_stream_readable.js +1027 -0
  54. package/dist/node_modules/winston-transport/node_modules/readable-stream/lib/_stream_transform.js +190 -0
  55. package/dist/node_modules/winston-transport/node_modules/readable-stream/lib/_stream_writable.js +641 -0
  56. package/dist/node_modules/winston-transport/node_modules/readable-stream/lib/internal/streams/async_iterator.js +180 -0
  57. package/dist/node_modules/winston-transport/node_modules/readable-stream/lib/internal/streams/buffer_list.js +183 -0
  58. package/dist/node_modules/winston-transport/node_modules/readable-stream/lib/internal/streams/destroy.js +96 -0
  59. package/dist/node_modules/winston-transport/node_modules/readable-stream/lib/internal/streams/end-of-stream.js +86 -0
  60. package/dist/node_modules/winston-transport/node_modules/readable-stream/lib/internal/streams/from-browser.js +3 -0
  61. package/dist/node_modules/winston-transport/node_modules/readable-stream/lib/internal/streams/from.js +52 -0
  62. package/dist/node_modules/winston-transport/node_modules/readable-stream/lib/internal/streams/pipeline.js +86 -0
  63. package/dist/node_modules/winston-transport/node_modules/readable-stream/lib/internal/streams/state.js +22 -0
  64. package/dist/node_modules/winston-transport/node_modules/readable-stream/lib/internal/streams/stream-browser.js +1 -0
  65. package/dist/node_modules/winston-transport/node_modules/readable-stream/lib/internal/streams/stream.js +1 -0
  66. package/dist/node_modules/winston-transport/node_modules/readable-stream/package.json +68 -0
  67. package/dist/node_modules/winston-transport/node_modules/readable-stream/readable-browser.js +9 -0
  68. package/dist/node_modules/winston-transport/node_modules/readable-stream/readable.js +16 -0
  69. package/dist/node_modules/winston-transport/package.json +1 -0
  70. package/dist/server/ScriptInstruction.d.ts +45 -0
  71. package/dist/server/ScriptInstruction.js +175 -0
  72. package/dist/server/Vm.js +100 -0
  73. package/dist/server/cache-logger.d.ts +6 -0
  74. package/dist/server/cache-logger.js +56 -0
  75. package/dist/server/index.d.ts +1 -0
  76. package/dist/server/index.js +42 -0
  77. package/dist/server/plugin.d.ts +11 -0
  78. package/dist/server/plugin.js +68 -0
  79. package/package.json +40 -0
  80. package/server.d.ts +2 -0
  81. package/server.js +1 -0
@@ -0,0 +1,212 @@
1
+ 'use strict';
2
+
3
+ var util = require('util');
4
+ var Writable = require('readable-stream/lib/_stream_writable.js');
5
+
6
+ var _require = require('triple-beam'),
7
+ LEVEL = _require.LEVEL;
8
+
9
+ /**
10
+ * Constructor function for the TransportStream. This is the base prototype
11
+ * that all `winston >= 3` transports should inherit from.
12
+ * @param {Object} options - Options for this TransportStream instance
13
+ * @param {String} options.level - Highest level according to RFC5424.
14
+ * @param {Boolean} options.handleExceptions - If true, info with
15
+ * { exception: true } will be written.
16
+ * @param {Function} options.log - Custom log function for simple Transport
17
+ * creation
18
+ * @param {Function} options.close - Called on "unpipe" from parent.
19
+ */
20
+
21
+
22
+ var TransportStream = module.exports = function TransportStream() {
23
+ var _this = this;
24
+
25
+ var options = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
26
+
27
+ Writable.call(this, { objectMode: true, highWaterMark: options.highWaterMark });
28
+
29
+ this.format = options.format;
30
+ this.level = options.level;
31
+ this.handleExceptions = options.handleExceptions;
32
+ this.handleRejections = options.handleRejections;
33
+ this.silent = options.silent;
34
+
35
+ if (options.log) this.log = options.log;
36
+ if (options.logv) this.logv = options.logv;
37
+ if (options.close) this.close = options.close;
38
+
39
+ // Get the levels from the source we are piped from.
40
+ this.once('pipe', function (logger) {
41
+ // Remark (indexzero): this bookkeeping can only support multiple
42
+ // Logger parents with the same `levels`. This comes into play in
43
+ // the `winston.Container` code in which `container.add` takes
44
+ // a fully realized set of options with pre-constructed TransportStreams.
45
+ _this.levels = logger.levels;
46
+ _this.parent = logger;
47
+ });
48
+
49
+ // If and/or when the transport is removed from this instance
50
+ this.once('unpipe', function (src) {
51
+ // Remark (indexzero): this bookkeeping can only support multiple
52
+ // Logger parents with the same `levels`. This comes into play in
53
+ // the `winston.Container` code in which `container.add` takes
54
+ // a fully realized set of options with pre-constructed TransportStreams.
55
+ if (src === _this.parent) {
56
+ _this.parent = null;
57
+ if (_this.close) {
58
+ _this.close();
59
+ }
60
+ }
61
+ });
62
+ };
63
+
64
+ /*
65
+ * Inherit from Writeable using Node.js built-ins
66
+ */
67
+ util.inherits(TransportStream, Writable);
68
+
69
+ /**
70
+ * Writes the info object to our transport instance.
71
+ * @param {mixed} info - TODO: add param description.
72
+ * @param {mixed} enc - TODO: add param description.
73
+ * @param {function} callback - TODO: add param description.
74
+ * @returns {undefined}
75
+ * @private
76
+ */
77
+ TransportStream.prototype._write = function _write(info, enc, callback) {
78
+ if (this.silent || info.exception === true && !this.handleExceptions) {
79
+ return callback(null);
80
+ }
81
+
82
+ // Remark: This has to be handled in the base transport now because we
83
+ // cannot conditionally write to our pipe targets as stream. We always
84
+ // prefer any explicit level set on the Transport itself falling back to
85
+ // any level set on the parent.
86
+ var level = this.level || this.parent && this.parent.level;
87
+
88
+ if (!level || this.levels[level] >= this.levels[info[LEVEL]]) {
89
+ if (info && !this.format) {
90
+ return this.log(info, callback);
91
+ }
92
+
93
+ var errState = void 0;
94
+ var transformed = void 0;
95
+
96
+ // We trap(and re-throw) any errors generated by the user-provided format, but also
97
+ // guarantee that the streams callback is invoked so that we can continue flowing.
98
+ try {
99
+ transformed = this.format.transform(Object.assign({}, info), this.format.options);
100
+ } catch (err) {
101
+ errState = err;
102
+ }
103
+
104
+ if (errState || !transformed) {
105
+ // eslint-disable-next-line callback-return
106
+ callback();
107
+ if (errState) throw errState;
108
+ return;
109
+ }
110
+
111
+ return this.log(transformed, callback);
112
+ }
113
+ this._writableState.sync = false;
114
+ return callback(null);
115
+ };
116
+
117
+ /**
118
+ * Writes the batch of info objects (i.e. "object chunks") to our transport
119
+ * instance after performing any necessary filtering.
120
+ * @param {mixed} chunks - TODO: add params description.
121
+ * @param {function} callback - TODO: add params description.
122
+ * @returns {mixed} - TODO: add returns description.
123
+ * @private
124
+ */
125
+ TransportStream.prototype._writev = function _writev(chunks, callback) {
126
+ if (this.logv) {
127
+ var infos = chunks.filter(this._accept, this);
128
+ if (!infos.length) {
129
+ return callback(null);
130
+ }
131
+
132
+ // Remark (indexzero): from a performance perspective if Transport
133
+ // implementers do choose to implement logv should we make it their
134
+ // responsibility to invoke their format?
135
+ return this.logv(infos, callback);
136
+ }
137
+
138
+ for (var i = 0; i < chunks.length; i++) {
139
+ if (!this._accept(chunks[i])) continue;
140
+
141
+ if (chunks[i].chunk && !this.format) {
142
+ this.log(chunks[i].chunk, chunks[i].callback);
143
+ continue;
144
+ }
145
+
146
+ var errState = void 0;
147
+ var transformed = void 0;
148
+
149
+ // We trap(and re-throw) any errors generated by the user-provided format, but also
150
+ // guarantee that the streams callback is invoked so that we can continue flowing.
151
+ try {
152
+ transformed = this.format.transform(Object.assign({}, chunks[i].chunk), this.format.options);
153
+ } catch (err) {
154
+ errState = err;
155
+ }
156
+
157
+ if (errState || !transformed) {
158
+ // eslint-disable-next-line callback-return
159
+ chunks[i].callback();
160
+ if (errState) {
161
+ // eslint-disable-next-line callback-return
162
+ callback(null);
163
+ throw errState;
164
+ }
165
+ } else {
166
+ this.log(transformed, chunks[i].callback);
167
+ }
168
+ }
169
+
170
+ return callback(null);
171
+ };
172
+
173
+ /**
174
+ * Predicate function that returns true if the specfied `info` on the
175
+ * WriteReq, `write`, should be passed down into the derived
176
+ * TransportStream's I/O via `.log(info, callback)`.
177
+ * @param {WriteReq} write - winston@3 Node.js WriteReq for the `info` object
178
+ * representing the log message.
179
+ * @returns {Boolean} - Value indicating if the `write` should be accepted &
180
+ * logged.
181
+ */
182
+ TransportStream.prototype._accept = function _accept(write) {
183
+ var info = write.chunk;
184
+ if (this.silent) {
185
+ return false;
186
+ }
187
+
188
+ // We always prefer any explicit level set on the Transport itself
189
+ // falling back to any level set on the parent.
190
+ var level = this.level || this.parent && this.parent.level;
191
+
192
+ // Immediately check the average case: log level filtering.
193
+ if (info.exception === true || !level || this.levels[level] >= this.levels[info[LEVEL]]) {
194
+ // Ensure the info object is valid based on `{ exception }`:
195
+ // 1. { handleExceptions: true }: all `info` objects are valid
196
+ // 2. { exception: false }: accepted by all transports.
197
+ if (this.handleExceptions || info.exception !== true) {
198
+ return true;
199
+ }
200
+ }
201
+
202
+ return false;
203
+ };
204
+
205
+ /**
206
+ * _nop is short for "No operation"
207
+ * @returns {Boolean} Intentionally false.
208
+ */
209
+ TransportStream.prototype._nop = function _nop() {
210
+ // eslint-disable-next-line no-undefined
211
+ return void undefined;
212
+ };
@@ -0,0 +1,39 @@
1
+ // Type definitions for winston-transport 3.0
2
+ // Project: https://github.com/winstonjs/winston-transport
3
+ // Definitions by: DABH <https://github.com/DABH>
4
+ // Definitions: https://github.com/winstonjs/winston-transport
5
+
6
+ /// <reference types="node" />
7
+
8
+ import * as stream from 'stream';
9
+ import * as logform from 'logform';
10
+
11
+ declare class TransportStream extends stream.Writable {
12
+ public format?: logform.Format;
13
+ public level?: string;
14
+ public silent?: boolean;
15
+ public handleExceptions?: boolean;
16
+ public handleRejections?: boolean;
17
+
18
+ constructor(opts?: TransportStream.TransportStreamOptions);
19
+
20
+ public log?(info: any, next: () => void): any;
21
+ public logv?(info: any, next: () => void): any;
22
+ public close?(): void;
23
+ }
24
+
25
+ declare namespace TransportStream {
26
+ interface TransportStreamOptions {
27
+ format?: logform.Format;
28
+ level?: string;
29
+ silent?: boolean;
30
+ handleExceptions?: boolean;
31
+ handleRejections?: boolean;
32
+
33
+ log?(info: any, next: () => void): any;
34
+ logv?(info: any, next: () => void): any;
35
+ close?(): void;
36
+ }
37
+ }
38
+
39
+ export = TransportStream;
@@ -0,0 +1,3 @@
1
+ (function(){var e={124:function(e,t,r){try{var n=r(837);if(typeof n.inherits!=="function")throw"";e.exports=n.inherits}catch(t){e.exports=r(544)}},544:function(e){if(typeof Object.create==="function"){e.exports=function inherits(e,t){if(t){e.super_=t;e.prototype=Object.create(t.prototype,{constructor:{value:e,enumerable:false,writable:true,configurable:true}})}}}else{e.exports=function inherits(e,t){if(t){e.super_=t;var TempCtor=function(){};TempCtor.prototype=t.prototype;e.prototype=new TempCtor;e.prototype.constructor=e}}}},867:function(e,t,r){
2
+ /*! safe-buffer. MIT License. Feross Aboukhadijeh <https://feross.org/opensource> */
3
+ var n=r(300);var i=n.Buffer;function copyProps(e,t){for(var r in e){t[r]=e[r]}}if(i.from&&i.alloc&&i.allocUnsafe&&i.allocUnsafeSlow){e.exports=n}else{copyProps(n,t);t.Buffer=SafeBuffer}function SafeBuffer(e,t,r){return i(e,t,r)}SafeBuffer.prototype=Object.create(i.prototype);copyProps(i,SafeBuffer);SafeBuffer.from=function(e,t,r){if(typeof e==="number"){throw new TypeError("Argument must not be a number")}return i(e,t,r)};SafeBuffer.alloc=function(e,t,r){if(typeof e!=="number"){throw new TypeError("Argument must be a number")}var n=i(e);if(t!==undefined){if(typeof r==="string"){n.fill(t,r)}else{n.fill(t)}}else{n.fill(0)}return n};SafeBuffer.allocUnsafe=function(e){if(typeof e!=="number"){throw new TypeError("Argument must be a number")}return i(e)};SafeBuffer.allocUnsafeSlow=function(e){if(typeof e!=="number"){throw new TypeError("Argument must be a number")}return n.SlowBuffer(e)}},841:function(e,t,r){"use strict";var n=r(867).Buffer;var i=n.isEncoding||function(e){e=""+e;switch(e&&e.toLowerCase()){case"hex":case"utf8":case"utf-8":case"ascii":case"binary":case"base64":case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":case"raw":return true;default:return false}};function _normalizeEncoding(e){if(!e)return"utf8";var t;while(true){switch(e){case"utf8":case"utf-8":return"utf8";case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return"utf16le";case"latin1":case"binary":return"latin1";case"base64":case"ascii":case"hex":return e;default:if(t)return;e=(""+e).toLowerCase();t=true}}}function normalizeEncoding(e){var t=_normalizeEncoding(e);if(typeof t!=="string"&&(n.isEncoding===i||!i(e)))throw new Error("Unknown encoding: "+e);return t||e}t.s=StringDecoder;function StringDecoder(e){this.encoding=normalizeEncoding(e);var t;switch(this.encoding){case"utf16le":this.text=utf16Text;this.end=utf16End;t=4;break;case"utf8":this.fillLast=utf8FillLast;t=4;break;case"base64":this.text=base64Text;this.end=base64End;t=3;break;default:this.write=simpleWrite;this.end=simpleEnd;return}this.lastNeed=0;this.lastTotal=0;this.lastChar=n.allocUnsafe(t)}StringDecoder.prototype.write=function(e){if(e.length===0)return"";var t;var r;if(this.lastNeed){t=this.fillLast(e);if(t===undefined)return"";r=this.lastNeed;this.lastNeed=0}else{r=0}if(r<e.length)return t?t+this.text(e,r):this.text(e,r);return t||""};StringDecoder.prototype.end=utf8End;StringDecoder.prototype.text=utf8Text;StringDecoder.prototype.fillLast=function(e){if(this.lastNeed<=e.length){e.copy(this.lastChar,this.lastTotal-this.lastNeed,0,this.lastNeed);return this.lastChar.toString(this.encoding,0,this.lastTotal)}e.copy(this.lastChar,this.lastTotal-this.lastNeed,0,e.length);this.lastNeed-=e.length};function utf8CheckByte(e){if(e<=127)return 0;else if(e>>5===6)return 2;else if(e>>4===14)return 3;else if(e>>3===30)return 4;return e>>6===2?-1:-2}function utf8CheckIncomplete(e,t,r){var n=t.length-1;if(n<r)return 0;var i=utf8CheckByte(t[n]);if(i>=0){if(i>0)e.lastNeed=i-1;return i}if(--n<r||i===-2)return 0;i=utf8CheckByte(t[n]);if(i>=0){if(i>0)e.lastNeed=i-2;return i}if(--n<r||i===-2)return 0;i=utf8CheckByte(t[n]);if(i>=0){if(i>0){if(i===2)i=0;else e.lastNeed=i-3}return i}return 0}function utf8CheckExtraBytes(e,t,r){if((t[0]&192)!==128){e.lastNeed=0;return"�"}if(e.lastNeed>1&&t.length>1){if((t[1]&192)!==128){e.lastNeed=1;return"�"}if(e.lastNeed>2&&t.length>2){if((t[2]&192)!==128){e.lastNeed=2;return"�"}}}}function utf8FillLast(e){var t=this.lastTotal-this.lastNeed;var r=utf8CheckExtraBytes(this,e,t);if(r!==undefined)return r;if(this.lastNeed<=e.length){e.copy(this.lastChar,t,0,this.lastNeed);return this.lastChar.toString(this.encoding,0,this.lastTotal)}e.copy(this.lastChar,t,0,e.length);this.lastNeed-=e.length}function utf8Text(e,t){var r=utf8CheckIncomplete(this,e,t);if(!this.lastNeed)return e.toString("utf8",t);this.lastTotal=r;var n=e.length-(r-this.lastNeed);e.copy(this.lastChar,0,n);return e.toString("utf8",t,n)}function utf8End(e){var t=e&&e.length?this.write(e):"";if(this.lastNeed)return t+"�";return t}function utf16Text(e,t){if((e.length-t)%2===0){var r=e.toString("utf16le",t);if(r){var n=r.charCodeAt(r.length-1);if(n>=55296&&n<=56319){this.lastNeed=2;this.lastTotal=4;this.lastChar[0]=e[e.length-2];this.lastChar[1]=e[e.length-1];return r.slice(0,-1)}}return r}this.lastNeed=1;this.lastTotal=2;this.lastChar[0]=e[e.length-1];return e.toString("utf16le",t,e.length-1)}function utf16End(e){var t=e&&e.length?this.write(e):"";if(this.lastNeed){var r=this.lastTotal-this.lastNeed;return t+this.lastChar.toString("utf16le",0,r)}return t}function base64Text(e,t){var r=(e.length-t)%3;if(r===0)return e.toString("base64",t);this.lastNeed=3-r;this.lastTotal=3;if(r===1){this.lastChar[0]=e[e.length-1]}else{this.lastChar[0]=e[e.length-2];this.lastChar[1]=e[e.length-1]}return e.toString("base64",t,e.length-r)}function base64End(e){var t=e&&e.length?this.write(e):"";if(this.lastNeed)return t+this.lastChar.toString("base64",0,3-this.lastNeed);return t}function simpleWrite(e){return e.toString(this.encoding)}function simpleEnd(e){return e&&e.length?this.write(e):""}},416:function(e,t){"use strict";t.levels={error:0,warn:1,help:2,data:3,info:4,debug:5,prompt:6,verbose:7,input:8,silly:9};t.colors={error:"red",warn:"yellow",help:"cyan",data:"grey",info:"green",debug:"blue",prompt:"grey",verbose:"cyan",input:"grey",silly:"magenta"}},113:function(e,t,r){"use strict";Object.defineProperty(t,"cli",{value:r(416)});Object.defineProperty(t,"npm",{value:r(568)});Object.defineProperty(t,"syslog",{value:r(990)})},568:function(e,t){"use strict";t.levels={error:0,warn:1,info:2,http:3,verbose:4,debug:5,silly:6};t.colors={error:"red",warn:"yellow",info:"green",http:"green",verbose:"cyan",debug:"blue",silly:"magenta"}},990:function(e,t){"use strict";t.levels={emerg:0,alert:1,crit:2,error:3,warning:4,notice:5,info:6,debug:7};t.colors={emerg:"red",alert:"yellow",crit:"red",error:"red",warning:"red",notice:"yellow",info:"green",debug:"blue"}},937:function(e,t,r){"use strict";Object.defineProperty(t,"LEVEL",{value:Symbol.for("level")});Object.defineProperty(t,"MESSAGE",{value:Symbol.for("message")});Object.defineProperty(t,"SPLAT",{value:Symbol.for("splat")});Object.defineProperty(t,"configs",{value:r(113)})},278:function(e,t,r){e.exports=r(837).deprecate},281:function(e,t,r){"use strict";e.exports=r(429);e.exports.LegacyTransportStream=r(201)},201:function(e,t,r){"use strict";const n=r(837);const{LEVEL:i}=r(937);const a=r(429);const o=e.exports=function LegacyTransportStream(e={}){a.call(this,e);if(!e.transport||typeof e.transport.log!=="function"){throw new Error("Invalid transport, must be an object with a log method.")}this.transport=e.transport;this.level=this.level||e.transport.level;this.handleExceptions=this.handleExceptions||e.transport.handleExceptions;this._deprecated();function transportError(e){this.emit("error",e,this.transport)}if(!this.transport.__winstonError){this.transport.__winstonError=transportError.bind(this);this.transport.on("error",this.transport.__winstonError)}};n.inherits(o,a);o.prototype._write=function _write(e,t,r){if(this.silent||e.exception===true&&!this.handleExceptions){return r(null)}if(!this.level||this.levels[this.level]>=this.levels[e[i]]){this.transport.log(e[i],e.message,e,this._nop)}r(null)};o.prototype._writev=function _writev(e,t){for(let t=0;t<e.length;t++){if(this._accept(e[t])){this.transport.log(e[t].chunk[i],e[t].chunk.message,e[t].chunk,this._nop);e[t].callback()}}return t(null)};o.prototype._deprecated=function _deprecated(){console.error([`${this.transport.name} is a legacy winston transport. Consider upgrading: `,"- Upgrade docs: https://github.com/winstonjs/winston/blob/master/UPGRADE-3.0.md"].join("\n"))};o.prototype.close=function close(){if(this.transport.close){this.transport.close()}if(this.transport.__winstonError){this.transport.removeListener("error",this.transport.__winstonError);this.transport.__winstonError=null}}},429:function(e,t,r){"use strict";const n=r(837);const i=r(137);const{LEVEL:a}=r(937);const o=e.exports=function TransportStream(e={}){i.call(this,{objectMode:true,highWaterMark:e.highWaterMark});this.format=e.format;this.level=e.level;this.handleExceptions=e.handleExceptions;this.handleRejections=e.handleRejections;this.silent=e.silent;if(e.log)this.log=e.log;if(e.logv)this.logv=e.logv;if(e.close)this.close=e.close;this.once("pipe",(e=>{this.levels=e.levels;this.parent=e}));this.once("unpipe",(e=>{if(e===this.parent){this.parent=null;if(this.close){this.close()}}}))};n.inherits(o,i);o.prototype._write=function _write(e,t,r){if(this.silent||e.exception===true&&!this.handleExceptions){return r(null)}const n=this.level||this.parent&&this.parent.level;if(!n||this.levels[n]>=this.levels[e[a]]){if(e&&!this.format){return this.log(e,r)}let t;let n;try{n=this.format.transform(Object.assign({},e),this.format.options)}catch(e){t=e}if(t||!n){r();if(t)throw t;return}return this.log(n,r)}this._writableState.sync=false;return r(null)};o.prototype._writev=function _writev(e,t){if(this.logv){const r=e.filter(this._accept,this);if(!r.length){return t(null)}return this.logv(r,t)}for(let r=0;r<e.length;r++){if(!this._accept(e[r]))continue;if(e[r].chunk&&!this.format){this.log(e[r].chunk,e[r].callback);continue}let n;let i;try{i=this.format.transform(Object.assign({},e[r].chunk),this.format.options)}catch(e){n=e}if(n||!i){e[r].callback();if(n){t(null);throw n}}else{this.log(i,e[r].callback)}}return t(null)};o.prototype._accept=function _accept(e){const t=e.chunk;if(this.silent){return false}const r=this.level||this.parent&&this.parent.level;if(t.exception===true||!r||this.levels[r]>=this.levels[t[a]]){if(this.handleExceptions||t.exception!==true){return true}}return false};o.prototype._nop=function _nop(){return void undefined}},238:function(e){"use strict";const t={};function createErrorType(e,r,n){if(!n){n=Error}function getMessage(e,t,n){if(typeof r==="string"){return r}else{return r(e,t,n)}}class NodeError extends n{constructor(e,t,r){super(getMessage(e,t,r))}}NodeError.prototype.name=n.name;NodeError.prototype.code=e;t[e]=NodeError}function oneOf(e,t){if(Array.isArray(e)){const r=e.length;e=e.map((e=>String(e)));if(r>2){return`one of ${t} ${e.slice(0,r-1).join(", ")}, or `+e[r-1]}else if(r===2){return`one of ${t} ${e[0]} or ${e[1]}`}else{return`of ${t} ${e[0]}`}}else{return`of ${t} ${String(e)}`}}function startsWith(e,t,r){return e.substr(!r||r<0?0:+r,t.length)===t}function endsWith(e,t,r){if(r===undefined||r>e.length){r=e.length}return e.substring(r-t.length,r)===t}function includes(e,t,r){if(typeof r!=="number"){r=0}if(r+t.length>e.length){return false}else{return e.indexOf(t,r)!==-1}}createErrorType("ERR_INVALID_OPT_VALUE",(function(e,t){return'The value "'+t+'" is invalid for option "'+e+'"'}),TypeError);createErrorType("ERR_INVALID_ARG_TYPE",(function(e,t,r){let n;if(typeof t==="string"&&startsWith(t,"not ")){n="must not be";t=t.replace(/^not /,"")}else{n="must be"}let i;if(endsWith(e," argument")){i=`The ${e} ${n} ${oneOf(t,"type")}`}else{const r=includes(e,".")?"property":"argument";i=`The "${e}" ${r} ${n} ${oneOf(t,"type")}`}i+=`. Received type ${typeof r}`;return i}),TypeError);createErrorType("ERR_STREAM_PUSH_AFTER_EOF","stream.push() after EOF");createErrorType("ERR_METHOD_NOT_IMPLEMENTED",(function(e){return"The "+e+" method is not implemented"}));createErrorType("ERR_STREAM_PREMATURE_CLOSE","Premature close");createErrorType("ERR_STREAM_DESTROYED",(function(e){return"Cannot call "+e+" after a stream was destroyed"}));createErrorType("ERR_MULTIPLE_CALLBACK","Callback called multiple times");createErrorType("ERR_STREAM_CANNOT_PIPE","Cannot pipe, not readable");createErrorType("ERR_STREAM_WRITE_AFTER_END","write after end");createErrorType("ERR_STREAM_NULL_VALUES","May not write null values to stream",TypeError);createErrorType("ERR_UNKNOWN_ENCODING",(function(e){return"Unknown encoding: "+e}),TypeError);createErrorType("ERR_STREAM_UNSHIFT_AFTER_END_EVENT","stream.unshift() after end event");e.exports.q=t},135:function(e,t,r){"use strict";var n=Object.keys||function(e){var t=[];for(var r in e)t.push(r);return t};e.exports=Duplex;var i=r(646);var a=r(137);r(124)(Duplex,i);{var o=n(a.prototype);for(var s=0;s<o.length;s++){var l=o[s];if(!Duplex.prototype[l])Duplex.prototype[l]=a.prototype[l]}}function Duplex(e){if(!(this instanceof Duplex))return new Duplex(e);i.call(this,e);a.call(this,e);this.allowHalfOpen=true;if(e){if(e.readable===false)this.readable=false;if(e.writable===false)this.writable=false;if(e.allowHalfOpen===false){this.allowHalfOpen=false;this.once("end",onend)}}}Object.defineProperty(Duplex.prototype,"writableHighWaterMark",{enumerable:false,get:function get(){return this._writableState.highWaterMark}});Object.defineProperty(Duplex.prototype,"writableBuffer",{enumerable:false,get:function get(){return this._writableState&&this._writableState.getBuffer()}});Object.defineProperty(Duplex.prototype,"writableLength",{enumerable:false,get:function get(){return this._writableState.length}});function onend(){if(this._writableState.ended)return;process.nextTick(onEndNT,this)}function onEndNT(e){e.end()}Object.defineProperty(Duplex.prototype,"destroyed",{enumerable:false,get:function get(){if(this._readableState===undefined||this._writableState===undefined){return false}return this._readableState.destroyed&&this._writableState.destroyed},set:function set(e){if(this._readableState===undefined||this._writableState===undefined){return}this._readableState.destroyed=e;this._writableState.destroyed=e}})},646:function(e,t,r){"use strict";e.exports=Readable;var n;Readable.ReadableState=ReadableState;var i=r(361).EventEmitter;var a=function EElistenerCount(e,t){return e.listeners(t).length};var o=r(917);var s=r(300).Buffer;var l=(typeof global!=="undefined"?global:typeof window!=="undefined"?window:typeof self!=="undefined"?self:{}).Uint8Array||function(){};function _uint8ArrayToBuffer(e){return s.from(e)}function _isUint8Array(e){return s.isBuffer(e)||e instanceof l}var f=r(837);var u;if(f&&f.debuglog){u=f.debuglog("stream")}else{u=function debug(){}}var d=r(233);var c=r(61);var h=r(318),p=h.getHighWaterMark;var b=r(238).q,y=b.ERR_INVALID_ARG_TYPE,g=b.ERR_STREAM_PUSH_AFTER_EOF,v=b.ERR_METHOD_NOT_IMPLEMENTED,_=b.ERR_STREAM_UNSHIFT_AFTER_END_EVENT;var w;var m;var S;r(124)(Readable,o);var R=c.errorOrDestroy;var E=["error","close","destroy","pause","resume"];function prependListener(e,t,r){if(typeof e.prependListener==="function")return e.prependListener(t,r);if(!e._events||!e._events[t])e.on(t,r);else if(Array.isArray(e._events[t]))e._events[t].unshift(r);else e._events[t]=[r,e._events[t]]}function ReadableState(e,t,i){n=n||r(135);e=e||{};if(typeof i!=="boolean")i=t instanceof n;this.objectMode=!!e.objectMode;if(i)this.objectMode=this.objectMode||!!e.readableObjectMode;this.highWaterMark=p(this,e,"readableHighWaterMark",i);this.buffer=new d;this.length=0;this.pipes=null;this.pipesCount=0;this.flowing=null;this.ended=false;this.endEmitted=false;this.reading=false;this.sync=true;this.needReadable=false;this.emittedReadable=false;this.readableListening=false;this.resumeScheduled=false;this.paused=true;this.emitClose=e.emitClose!==false;this.autoDestroy=!!e.autoDestroy;this.destroyed=false;this.defaultEncoding=e.defaultEncoding||"utf8";this.awaitDrain=0;this.readingMore=false;this.decoder=null;this.encoding=null;if(e.encoding){if(!w)w=r(841).s;this.decoder=new w(e.encoding);this.encoding=e.encoding}}function Readable(e){n=n||r(135);if(!(this instanceof Readable))return new Readable(e);var t=this instanceof n;this._readableState=new ReadableState(e,this,t);this.readable=true;if(e){if(typeof e.read==="function")this._read=e.read;if(typeof e.destroy==="function")this._destroy=e.destroy}o.call(this)}Object.defineProperty(Readable.prototype,"destroyed",{enumerable:false,get:function get(){if(this._readableState===undefined){return false}return this._readableState.destroyed},set:function set(e){if(!this._readableState){return}this._readableState.destroyed=e}});Readable.prototype.destroy=c.destroy;Readable.prototype._undestroy=c.undestroy;Readable.prototype._destroy=function(e,t){t(e)};Readable.prototype.push=function(e,t){var r=this._readableState;var n;if(!r.objectMode){if(typeof e==="string"){t=t||r.defaultEncoding;if(t!==r.encoding){e=s.from(e,t);t=""}n=true}}else{n=true}return readableAddChunk(this,e,t,false,n)};Readable.prototype.unshift=function(e){return readableAddChunk(this,e,null,true,false)};function readableAddChunk(e,t,r,n,i){u("readableAddChunk",t);var a=e._readableState;if(t===null){a.reading=false;onEofChunk(e,a)}else{var o;if(!i)o=chunkInvalid(a,t);if(o){R(e,o)}else if(a.objectMode||t&&t.length>0){if(typeof t!=="string"&&!a.objectMode&&Object.getPrototypeOf(t)!==s.prototype){t=_uint8ArrayToBuffer(t)}if(n){if(a.endEmitted)R(e,new _);else addChunk(e,a,t,true)}else if(a.ended){R(e,new g)}else if(a.destroyed){return false}else{a.reading=false;if(a.decoder&&!r){t=a.decoder.write(t);if(a.objectMode||t.length!==0)addChunk(e,a,t,false);else maybeReadMore(e,a)}else{addChunk(e,a,t,false)}}}else if(!n){a.reading=false;maybeReadMore(e,a)}}return!a.ended&&(a.length<a.highWaterMark||a.length===0)}function addChunk(e,t,r,n){if(t.flowing&&t.length===0&&!t.sync){t.awaitDrain=0;e.emit("data",r)}else{t.length+=t.objectMode?1:r.length;if(n)t.buffer.unshift(r);else t.buffer.push(r);if(t.needReadable)emitReadable(e)}maybeReadMore(e,t)}function chunkInvalid(e,t){var r;if(!_isUint8Array(t)&&typeof t!=="string"&&t!==undefined&&!e.objectMode){r=new y("chunk",["string","Buffer","Uint8Array"],t)}return r}Readable.prototype.isPaused=function(){return this._readableState.flowing===false};Readable.prototype.setEncoding=function(e){if(!w)w=r(841).s;var t=new w(e);this._readableState.decoder=t;this._readableState.encoding=this._readableState.decoder.encoding;var n=this._readableState.buffer.head;var i="";while(n!==null){i+=t.write(n.data);n=n.next}this._readableState.buffer.clear();if(i!=="")this._readableState.buffer.push(i);this._readableState.length=i.length;return this};var k=1073741824;function computeNewHighWaterMark(e){if(e>=k){e=k}else{e--;e|=e>>>1;e|=e>>>2;e|=e>>>4;e|=e>>>8;e|=e>>>16;e++}return e}function howMuchToRead(e,t){if(e<=0||t.length===0&&t.ended)return 0;if(t.objectMode)return 1;if(e!==e){if(t.flowing&&t.length)return t.buffer.head.data.length;else return t.length}if(e>t.highWaterMark)t.highWaterMark=computeNewHighWaterMark(e);if(e<=t.length)return e;if(!t.ended){t.needReadable=true;return 0}return t.length}Readable.prototype.read=function(e){u("read",e);e=parseInt(e,10);var t=this._readableState;var r=e;if(e!==0)t.emittedReadable=false;if(e===0&&t.needReadable&&((t.highWaterMark!==0?t.length>=t.highWaterMark:t.length>0)||t.ended)){u("read: emitReadable",t.length,t.ended);if(t.length===0&&t.ended)endReadable(this);else emitReadable(this);return null}e=howMuchToRead(e,t);if(e===0&&t.ended){if(t.length===0)endReadable(this);return null}var n=t.needReadable;u("need readable",n);if(t.length===0||t.length-e<t.highWaterMark){n=true;u("length less than watermark",n)}if(t.ended||t.reading){n=false;u("reading or ended",n)}else if(n){u("do read");t.reading=true;t.sync=true;if(t.length===0)t.needReadable=true;this._read(t.highWaterMark);t.sync=false;if(!t.reading)e=howMuchToRead(r,t)}var i;if(e>0)i=fromList(e,t);else i=null;if(i===null){t.needReadable=t.length<=t.highWaterMark;e=0}else{t.length-=e;t.awaitDrain=0}if(t.length===0){if(!t.ended)t.needReadable=true;if(r!==e&&t.ended)endReadable(this)}if(i!==null)this.emit("data",i);return i};function onEofChunk(e,t){u("onEofChunk");if(t.ended)return;if(t.decoder){var r=t.decoder.end();if(r&&r.length){t.buffer.push(r);t.length+=t.objectMode?1:r.length}}t.ended=true;if(t.sync){emitReadable(e)}else{t.needReadable=false;if(!t.emittedReadable){t.emittedReadable=true;emitReadable_(e)}}}function emitReadable(e){var t=e._readableState;u("emitReadable",t.needReadable,t.emittedReadable);t.needReadable=false;if(!t.emittedReadable){u("emitReadable",t.flowing);t.emittedReadable=true;process.nextTick(emitReadable_,e)}}function emitReadable_(e){var t=e._readableState;u("emitReadable_",t.destroyed,t.length,t.ended);if(!t.destroyed&&(t.length||t.ended)){e.emit("readable");t.emittedReadable=false}t.needReadable=!t.flowing&&!t.ended&&t.length<=t.highWaterMark;flow(e)}function maybeReadMore(e,t){if(!t.readingMore){t.readingMore=true;process.nextTick(maybeReadMore_,e,t)}}function maybeReadMore_(e,t){while(!t.reading&&!t.ended&&(t.length<t.highWaterMark||t.flowing&&t.length===0)){var r=t.length;u("maybeReadMore read 0");e.read(0);if(r===t.length)break}t.readingMore=false}Readable.prototype._read=function(e){R(this,new v("_read()"))};Readable.prototype.pipe=function(e,t){var r=this;var n=this._readableState;switch(n.pipesCount){case 0:n.pipes=e;break;case 1:n.pipes=[n.pipes,e];break;default:n.pipes.push(e);break}n.pipesCount+=1;u("pipe count=%d opts=%j",n.pipesCount,t);var i=(!t||t.end!==false)&&e!==process.stdout&&e!==process.stderr;var o=i?onend:unpipe;if(n.endEmitted)process.nextTick(o);else r.once("end",o);e.on("unpipe",onunpipe);function onunpipe(e,t){u("onunpipe");if(e===r){if(t&&t.hasUnpiped===false){t.hasUnpiped=true;cleanup()}}}function onend(){u("onend");e.end()}var s=pipeOnDrain(r);e.on("drain",s);var l=false;function cleanup(){u("cleanup");e.removeListener("close",onclose);e.removeListener("finish",onfinish);e.removeListener("drain",s);e.removeListener("error",onerror);e.removeListener("unpipe",onunpipe);r.removeListener("end",onend);r.removeListener("end",unpipe);r.removeListener("data",ondata);l=true;if(n.awaitDrain&&(!e._writableState||e._writableState.needDrain))s()}r.on("data",ondata);function ondata(t){u("ondata");var i=e.write(t);u("dest.write",i);if(i===false){if((n.pipesCount===1&&n.pipes===e||n.pipesCount>1&&indexOf(n.pipes,e)!==-1)&&!l){u("false write response, pause",n.awaitDrain);n.awaitDrain++}r.pause()}}function onerror(t){u("onerror",t);unpipe();e.removeListener("error",onerror);if(a(e,"error")===0)R(e,t)}prependListener(e,"error",onerror);function onclose(){e.removeListener("finish",onfinish);unpipe()}e.once("close",onclose);function onfinish(){u("onfinish");e.removeListener("close",onclose);unpipe()}e.once("finish",onfinish);function unpipe(){u("unpipe");r.unpipe(e)}e.emit("pipe",r);if(!n.flowing){u("pipe resume");r.resume()}return e};function pipeOnDrain(e){return function pipeOnDrainFunctionResult(){var t=e._readableState;u("pipeOnDrain",t.awaitDrain);if(t.awaitDrain)t.awaitDrain--;if(t.awaitDrain===0&&a(e,"data")){t.flowing=true;flow(e)}}}Readable.prototype.unpipe=function(e){var t=this._readableState;var r={hasUnpiped:false};if(t.pipesCount===0)return this;if(t.pipesCount===1){if(e&&e!==t.pipes)return this;if(!e)e=t.pipes;t.pipes=null;t.pipesCount=0;t.flowing=false;if(e)e.emit("unpipe",this,r);return this}if(!e){var n=t.pipes;var i=t.pipesCount;t.pipes=null;t.pipesCount=0;t.flowing=false;for(var a=0;a<i;a++)n[a].emit("unpipe",this,{hasUnpiped:false});return this}var o=indexOf(t.pipes,e);if(o===-1)return this;t.pipes.splice(o,1);t.pipesCount-=1;if(t.pipesCount===1)t.pipes=t.pipes[0];e.emit("unpipe",this,r);return this};Readable.prototype.on=function(e,t){var r=o.prototype.on.call(this,e,t);var n=this._readableState;if(e==="data"){n.readableListening=this.listenerCount("readable")>0;if(n.flowing!==false)this.resume()}else if(e==="readable"){if(!n.endEmitted&&!n.readableListening){n.readableListening=n.needReadable=true;n.flowing=false;n.emittedReadable=false;u("on readable",n.length,n.reading);if(n.length){emitReadable(this)}else if(!n.reading){process.nextTick(nReadingNextTick,this)}}}return r};Readable.prototype.addListener=Readable.prototype.on;Readable.prototype.removeListener=function(e,t){var r=o.prototype.removeListener.call(this,e,t);if(e==="readable"){process.nextTick(updateReadableListening,this)}return r};Readable.prototype.removeAllListeners=function(e){var t=o.prototype.removeAllListeners.apply(this,arguments);if(e==="readable"||e===undefined){process.nextTick(updateReadableListening,this)}return t};function updateReadableListening(e){var t=e._readableState;t.readableListening=e.listenerCount("readable")>0;if(t.resumeScheduled&&!t.paused){t.flowing=true}else if(e.listenerCount("data")>0){e.resume()}}function nReadingNextTick(e){u("readable nexttick read 0");e.read(0)}Readable.prototype.resume=function(){var e=this._readableState;if(!e.flowing){u("resume");e.flowing=!e.readableListening;resume(this,e)}e.paused=false;return this};function resume(e,t){if(!t.resumeScheduled){t.resumeScheduled=true;process.nextTick(resume_,e,t)}}function resume_(e,t){u("resume",t.reading);if(!t.reading){e.read(0)}t.resumeScheduled=false;e.emit("resume");flow(e);if(t.flowing&&!t.reading)e.read(0)}Readable.prototype.pause=function(){u("call pause flowing=%j",this._readableState.flowing);if(this._readableState.flowing!==false){u("pause");this._readableState.flowing=false;this.emit("pause")}this._readableState.paused=true;return this};function flow(e){var t=e._readableState;u("flow",t.flowing);while(t.flowing&&e.read()!==null);}Readable.prototype.wrap=function(e){var t=this;var r=this._readableState;var n=false;e.on("end",(function(){u("wrapped end");if(r.decoder&&!r.ended){var e=r.decoder.end();if(e&&e.length)t.push(e)}t.push(null)}));e.on("data",(function(i){u("wrapped data");if(r.decoder)i=r.decoder.write(i);if(r.objectMode&&(i===null||i===undefined))return;else if(!r.objectMode&&(!i||!i.length))return;var a=t.push(i);if(!a){n=true;e.pause()}}));for(var i in e){if(this[i]===undefined&&typeof e[i]==="function"){this[i]=function methodWrap(t){return function methodWrapReturnFunction(){return e[t].apply(e,arguments)}}(i)}}for(var a=0;a<E.length;a++){e.on(E[a],this.emit.bind(this,E[a]))}this._read=function(t){u("wrapped _read",t);if(n){n=false;e.resume()}};return this};if(typeof Symbol==="function"){Readable.prototype[Symbol.asyncIterator]=function(){if(m===undefined){m=r(258)}return m(this)}}Object.defineProperty(Readable.prototype,"readableHighWaterMark",{enumerable:false,get:function get(){return this._readableState.highWaterMark}});Object.defineProperty(Readable.prototype,"readableBuffer",{enumerable:false,get:function get(){return this._readableState&&this._readableState.buffer}});Object.defineProperty(Readable.prototype,"readableFlowing",{enumerable:false,get:function get(){return this._readableState.flowing},set:function set(e){if(this._readableState){this._readableState.flowing=e}}});Readable._fromList=fromList;Object.defineProperty(Readable.prototype,"readableLength",{enumerable:false,get:function get(){return this._readableState.length}});function fromList(e,t){if(t.length===0)return null;var r;if(t.objectMode)r=t.buffer.shift();else if(!e||e>=t.length){if(t.decoder)r=t.buffer.join("");else if(t.buffer.length===1)r=t.buffer.first();else r=t.buffer.concat(t.length);t.buffer.clear()}else{r=t.buffer.consume(e,t.decoder)}return r}function endReadable(e){var t=e._readableState;u("endReadable",t.endEmitted);if(!t.endEmitted){t.ended=true;process.nextTick(endReadableNT,t,e)}}function endReadableNT(e,t){u("endReadableNT",e.endEmitted,e.length);if(!e.endEmitted&&e.length===0){e.endEmitted=true;t.readable=false;t.emit("end");if(e.autoDestroy){var r=t._writableState;if(!r||r.autoDestroy&&r.finished){t.destroy()}}}}if(typeof Symbol==="function"){Readable.from=function(e,t){if(S===undefined){S=r(217)}return S(Readable,e,t)}}function indexOf(e,t){for(var r=0,n=e.length;r<n;r++){if(e[r]===t)return r}return-1}},137:function(e,t,r){"use strict";e.exports=Writable;function WriteReq(e,t,r){this.chunk=e;this.encoding=t;this.callback=r;this.next=null}function CorkedRequest(e){var t=this;this.next=null;this.entry=null;this.finish=function(){onCorkedFinish(t,e)}}var n;Writable.WritableState=WritableState;var i={deprecate:r(278)};var a=r(917);var o=r(300).Buffer;var s=(typeof global!=="undefined"?global:typeof window!=="undefined"?window:typeof self!=="undefined"?self:{}).Uint8Array||function(){};function _uint8ArrayToBuffer(e){return o.from(e)}function _isUint8Array(e){return o.isBuffer(e)||e instanceof s}var l=r(61);var f=r(318),u=f.getHighWaterMark;var d=r(238).q,c=d.ERR_INVALID_ARG_TYPE,h=d.ERR_METHOD_NOT_IMPLEMENTED,p=d.ERR_MULTIPLE_CALLBACK,b=d.ERR_STREAM_CANNOT_PIPE,y=d.ERR_STREAM_DESTROYED,g=d.ERR_STREAM_NULL_VALUES,v=d.ERR_STREAM_WRITE_AFTER_END,_=d.ERR_UNKNOWN_ENCODING;var w=l.errorOrDestroy;r(124)(Writable,a);function nop(){}function WritableState(e,t,i){n=n||r(135);e=e||{};if(typeof i!=="boolean")i=t instanceof n;this.objectMode=!!e.objectMode;if(i)this.objectMode=this.objectMode||!!e.writableObjectMode;this.highWaterMark=u(this,e,"writableHighWaterMark",i);this.finalCalled=false;this.needDrain=false;this.ending=false;this.ended=false;this.finished=false;this.destroyed=false;var a=e.decodeStrings===false;this.decodeStrings=!a;this.defaultEncoding=e.defaultEncoding||"utf8";this.length=0;this.writing=false;this.corked=0;this.sync=true;this.bufferProcessing=false;this.onwrite=function(e){onwrite(t,e)};this.writecb=null;this.writelen=0;this.bufferedRequest=null;this.lastBufferedRequest=null;this.pendingcb=0;this.prefinished=false;this.errorEmitted=false;this.emitClose=e.emitClose!==false;this.autoDestroy=!!e.autoDestroy;this.bufferedRequestCount=0;this.corkedRequestsFree=new CorkedRequest(this)}WritableState.prototype.getBuffer=function getBuffer(){var e=this.bufferedRequest;var t=[];while(e){t.push(e);e=e.next}return t};(function(){try{Object.defineProperty(WritableState.prototype,"buffer",{get:i.deprecate((function writableStateBufferGetter(){return this.getBuffer()}),"_writableState.buffer is deprecated. Use _writableState.getBuffer "+"instead.","DEP0003")})}catch(e){}})();var m;if(typeof Symbol==="function"&&Symbol.hasInstance&&typeof Function.prototype[Symbol.hasInstance]==="function"){m=Function.prototype[Symbol.hasInstance];Object.defineProperty(Writable,Symbol.hasInstance,{value:function value(e){if(m.call(this,e))return true;if(this!==Writable)return false;return e&&e._writableState instanceof WritableState}})}else{m=function realHasInstance(e){return e instanceof this}}function Writable(e){n=n||r(135);var t=this instanceof n;if(!t&&!m.call(Writable,this))return new Writable(e);this._writableState=new WritableState(e,this,t);this.writable=true;if(e){if(typeof e.write==="function")this._write=e.write;if(typeof e.writev==="function")this._writev=e.writev;if(typeof e.destroy==="function")this._destroy=e.destroy;if(typeof e.final==="function")this._final=e.final}a.call(this)}Writable.prototype.pipe=function(){w(this,new b)};function writeAfterEnd(e,t){var r=new v;w(e,r);process.nextTick(t,r)}function validChunk(e,t,r,n){var i;if(r===null){i=new g}else if(typeof r!=="string"&&!t.objectMode){i=new c("chunk",["string","Buffer"],r)}if(i){w(e,i);process.nextTick(n,i);return false}return true}Writable.prototype.write=function(e,t,r){var n=this._writableState;var i=false;var a=!n.objectMode&&_isUint8Array(e);if(a&&!o.isBuffer(e)){e=_uint8ArrayToBuffer(e)}if(typeof t==="function"){r=t;t=null}if(a)t="buffer";else if(!t)t=n.defaultEncoding;if(typeof r!=="function")r=nop;if(n.ending)writeAfterEnd(this,r);else if(a||validChunk(this,n,e,r)){n.pendingcb++;i=writeOrBuffer(this,n,a,e,t,r)}return i};Writable.prototype.cork=function(){this._writableState.corked++};Writable.prototype.uncork=function(){var e=this._writableState;if(e.corked){e.corked--;if(!e.writing&&!e.corked&&!e.bufferProcessing&&e.bufferedRequest)clearBuffer(this,e)}};Writable.prototype.setDefaultEncoding=function setDefaultEncoding(e){if(typeof e==="string")e=e.toLowerCase();if(!(["hex","utf8","utf-8","ascii","binary","base64","ucs2","ucs-2","utf16le","utf-16le","raw"].indexOf((e+"").toLowerCase())>-1))throw new _(e);this._writableState.defaultEncoding=e;return this};Object.defineProperty(Writable.prototype,"writableBuffer",{enumerable:false,get:function get(){return this._writableState&&this._writableState.getBuffer()}});function decodeChunk(e,t,r){if(!e.objectMode&&e.decodeStrings!==false&&typeof t==="string"){t=o.from(t,r)}return t}Object.defineProperty(Writable.prototype,"writableHighWaterMark",{enumerable:false,get:function get(){return this._writableState.highWaterMark}});function writeOrBuffer(e,t,r,n,i,a){if(!r){var o=decodeChunk(t,n,i);if(n!==o){r=true;i="buffer";n=o}}var s=t.objectMode?1:n.length;t.length+=s;var l=t.length<t.highWaterMark;if(!l)t.needDrain=true;if(t.writing||t.corked){var f=t.lastBufferedRequest;t.lastBufferedRequest={chunk:n,encoding:i,isBuf:r,callback:a,next:null};if(f){f.next=t.lastBufferedRequest}else{t.bufferedRequest=t.lastBufferedRequest}t.bufferedRequestCount+=1}else{doWrite(e,t,false,s,n,i,a)}return l}function doWrite(e,t,r,n,i,a,o){t.writelen=n;t.writecb=o;t.writing=true;t.sync=true;if(t.destroyed)t.onwrite(new y("write"));else if(r)e._writev(i,t.onwrite);else e._write(i,a,t.onwrite);t.sync=false}function onwriteError(e,t,r,n,i){--t.pendingcb;if(r){process.nextTick(i,n);process.nextTick(finishMaybe,e,t);e._writableState.errorEmitted=true;w(e,n)}else{i(n);e._writableState.errorEmitted=true;w(e,n);finishMaybe(e,t)}}function onwriteStateUpdate(e){e.writing=false;e.writecb=null;e.length-=e.writelen;e.writelen=0}function onwrite(e,t){var r=e._writableState;var n=r.sync;var i=r.writecb;if(typeof i!=="function")throw new p;onwriteStateUpdate(r);if(t)onwriteError(e,r,n,t,i);else{var a=needFinish(r)||e.destroyed;if(!a&&!r.corked&&!r.bufferProcessing&&r.bufferedRequest){clearBuffer(e,r)}if(n){process.nextTick(afterWrite,e,r,a,i)}else{afterWrite(e,r,a,i)}}}function afterWrite(e,t,r,n){if(!r)onwriteDrain(e,t);t.pendingcb--;n();finishMaybe(e,t)}function onwriteDrain(e,t){if(t.length===0&&t.needDrain){t.needDrain=false;e.emit("drain")}}function clearBuffer(e,t){t.bufferProcessing=true;var r=t.bufferedRequest;if(e._writev&&r&&r.next){var n=t.bufferedRequestCount;var i=new Array(n);var a=t.corkedRequestsFree;a.entry=r;var o=0;var s=true;while(r){i[o]=r;if(!r.isBuf)s=false;r=r.next;o+=1}i.allBuffers=s;doWrite(e,t,true,t.length,i,"",a.finish);t.pendingcb++;t.lastBufferedRequest=null;if(a.next){t.corkedRequestsFree=a.next;a.next=null}else{t.corkedRequestsFree=new CorkedRequest(t)}t.bufferedRequestCount=0}else{while(r){var l=r.chunk;var f=r.encoding;var u=r.callback;var d=t.objectMode?1:l.length;doWrite(e,t,false,d,l,f,u);r=r.next;t.bufferedRequestCount--;if(t.writing){break}}if(r===null)t.lastBufferedRequest=null}t.bufferedRequest=r;t.bufferProcessing=false}Writable.prototype._write=function(e,t,r){r(new h("_write()"))};Writable.prototype._writev=null;Writable.prototype.end=function(e,t,r){var n=this._writableState;if(typeof e==="function"){r=e;e=null;t=null}else if(typeof t==="function"){r=t;t=null}if(e!==null&&e!==undefined)this.write(e,t);if(n.corked){n.corked=1;this.uncork()}if(!n.ending)endWritable(this,n,r);return this};Object.defineProperty(Writable.prototype,"writableLength",{enumerable:false,get:function get(){return this._writableState.length}});function needFinish(e){return e.ending&&e.length===0&&e.bufferedRequest===null&&!e.finished&&!e.writing}function callFinal(e,t){e._final((function(r){t.pendingcb--;if(r){w(e,r)}t.prefinished=true;e.emit("prefinish");finishMaybe(e,t)}))}function prefinish(e,t){if(!t.prefinished&&!t.finalCalled){if(typeof e._final==="function"&&!t.destroyed){t.pendingcb++;t.finalCalled=true;process.nextTick(callFinal,e,t)}else{t.prefinished=true;e.emit("prefinish")}}}function finishMaybe(e,t){var r=needFinish(t);if(r){prefinish(e,t);if(t.pendingcb===0){t.finished=true;e.emit("finish");if(t.autoDestroy){var n=e._readableState;if(!n||n.autoDestroy&&n.endEmitted){e.destroy()}}}}return r}function endWritable(e,t,r){t.ending=true;finishMaybe(e,t);if(r){if(t.finished)process.nextTick(r);else e.once("finish",r)}t.ended=true;e.writable=false}function onCorkedFinish(e,t,r){var n=e.entry;e.entry=null;while(n){var i=n.callback;t.pendingcb--;i(r);n=n.next}t.corkedRequestsFree.next=e}Object.defineProperty(Writable.prototype,"destroyed",{enumerable:false,get:function get(){if(this._writableState===undefined){return false}return this._writableState.destroyed},set:function set(e){if(!this._writableState){return}this._writableState.destroyed=e}});Writable.prototype.destroy=l.destroy;Writable.prototype._undestroy=l.undestroy;Writable.prototype._destroy=function(e,t){t(e)}},258:function(e,t,r){"use strict";var n;function _defineProperty(e,t,r){t=_toPropertyKey(t);if(t in e){Object.defineProperty(e,t,{value:r,enumerable:true,configurable:true,writable:true})}else{e[t]=r}return e}function _toPropertyKey(e){var t=_toPrimitive(e,"string");return typeof t==="symbol"?t:String(t)}function _toPrimitive(e,t){if(typeof e!=="object"||e===null)return e;var r=e[Symbol.toPrimitive];if(r!==undefined){var n=r.call(e,t||"default");if(typeof n!=="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}var i=r(242);var a=Symbol("lastResolve");var o=Symbol("lastReject");var s=Symbol("error");var l=Symbol("ended");var f=Symbol("lastPromise");var u=Symbol("handlePromise");var d=Symbol("stream");function createIterResult(e,t){return{value:e,done:t}}function readAndResolve(e){var t=e[a];if(t!==null){var r=e[d].read();if(r!==null){e[f]=null;e[a]=null;e[o]=null;t(createIterResult(r,false))}}}function onReadable(e){process.nextTick(readAndResolve,e)}function wrapForNext(e,t){return function(r,n){e.then((function(){if(t[l]){r(createIterResult(undefined,true));return}t[u](r,n)}),n)}}var c=Object.getPrototypeOf((function(){}));var h=Object.setPrototypeOf((n={get stream(){return this[d]},next:function next(){var e=this;var t=this[s];if(t!==null){return Promise.reject(t)}if(this[l]){return Promise.resolve(createIterResult(undefined,true))}if(this[d].destroyed){return new Promise((function(t,r){process.nextTick((function(){if(e[s]){r(e[s])}else{t(createIterResult(undefined,true))}}))}))}var r=this[f];var n;if(r){n=new Promise(wrapForNext(r,this))}else{var i=this[d].read();if(i!==null){return Promise.resolve(createIterResult(i,false))}n=new Promise(this[u])}this[f]=n;return n}},_defineProperty(n,Symbol.asyncIterator,(function(){return this})),_defineProperty(n,"return",(function _return(){var e=this;return new Promise((function(t,r){e[d].destroy(null,(function(e){if(e){r(e);return}t(createIterResult(undefined,true))}))}))})),n),c);var p=function createReadableStreamAsyncIterator(e){var t;var r=Object.create(h,(t={},_defineProperty(t,d,{value:e,writable:true}),_defineProperty(t,a,{value:null,writable:true}),_defineProperty(t,o,{value:null,writable:true}),_defineProperty(t,s,{value:null,writable:true}),_defineProperty(t,l,{value:e._readableState.endEmitted,writable:true}),_defineProperty(t,u,{value:function value(e,t){var n=r[d].read();if(n){r[f]=null;r[a]=null;r[o]=null;e(createIterResult(n,false))}else{r[a]=e;r[o]=t}},writable:true}),t));r[f]=null;i(e,(function(e){if(e&&e.code!=="ERR_STREAM_PREMATURE_CLOSE"){var t=r[o];if(t!==null){r[f]=null;r[a]=null;r[o]=null;t(e)}r[s]=e;return}var n=r[a];if(n!==null){r[f]=null;r[a]=null;r[o]=null;n(createIterResult(undefined,true))}r[l]=true}));e.on("readable",onReadable.bind(null,r));return r};e.exports=p},233:function(e,t,r){"use strict";function ownKeys(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),r.push.apply(r,n)}return r}function _objectSpread(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?ownKeys(Object(r),!0).forEach((function(t){_defineProperty(e,t,r[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):ownKeys(Object(r)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))}))}return e}function _defineProperty(e,t,r){t=_toPropertyKey(t);if(t in e){Object.defineProperty(e,t,{value:r,enumerable:true,configurable:true,writable:true})}else{e[t]=r}return e}function _classCallCheck(e,t){if(!(e instanceof t)){throw new TypeError("Cannot call a class as a function")}}function _defineProperties(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||false;n.configurable=true;if("value"in n)n.writable=true;Object.defineProperty(e,_toPropertyKey(n.key),n)}}function _createClass(e,t,r){if(t)_defineProperties(e.prototype,t);if(r)_defineProperties(e,r);Object.defineProperty(e,"prototype",{writable:false});return e}function _toPropertyKey(e){var t=_toPrimitive(e,"string");return typeof t==="symbol"?t:String(t)}function _toPrimitive(e,t){if(typeof e!=="object"||e===null)return e;var r=e[Symbol.toPrimitive];if(r!==undefined){var n=r.call(e,t||"default");if(typeof n!=="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}var n=r(300),i=n.Buffer;var a=r(837),o=a.inspect;var s=o&&o.custom||"inspect";function copyBuffer(e,t,r){i.prototype.copy.call(e,t,r)}e.exports=function(){function BufferList(){_classCallCheck(this,BufferList);this.head=null;this.tail=null;this.length=0}_createClass(BufferList,[{key:"push",value:function push(e){var t={data:e,next:null};if(this.length>0)this.tail.next=t;else this.head=t;this.tail=t;++this.length}},{key:"unshift",value:function unshift(e){var t={data:e,next:this.head};if(this.length===0)this.tail=t;this.head=t;++this.length}},{key:"shift",value:function shift(){if(this.length===0)return;var e=this.head.data;if(this.length===1)this.head=this.tail=null;else this.head=this.head.next;--this.length;return e}},{key:"clear",value:function clear(){this.head=this.tail=null;this.length=0}},{key:"join",value:function join(e){if(this.length===0)return"";var t=this.head;var r=""+t.data;while(t=t.next)r+=e+t.data;return r}},{key:"concat",value:function concat(e){if(this.length===0)return i.alloc(0);var t=i.allocUnsafe(e>>>0);var r=this.head;var n=0;while(r){copyBuffer(r.data,t,n);n+=r.data.length;r=r.next}return t}},{key:"consume",value:function consume(e,t){var r;if(e<this.head.data.length){r=this.head.data.slice(0,e);this.head.data=this.head.data.slice(e)}else if(e===this.head.data.length){r=this.shift()}else{r=t?this._getString(e):this._getBuffer(e)}return r}},{key:"first",value:function first(){return this.head.data}},{key:"_getString",value:function _getString(e){var t=this.head;var r=1;var n=t.data;e-=n.length;while(t=t.next){var i=t.data;var a=e>i.length?i.length:e;if(a===i.length)n+=i;else n+=i.slice(0,e);e-=a;if(e===0){if(a===i.length){++r;if(t.next)this.head=t.next;else this.head=this.tail=null}else{this.head=t;t.data=i.slice(a)}break}++r}this.length-=r;return n}},{key:"_getBuffer",value:function _getBuffer(e){var t=i.allocUnsafe(e);var r=this.head;var n=1;r.data.copy(t);e-=r.data.length;while(r=r.next){var a=r.data;var o=e>a.length?a.length:e;a.copy(t,t.length-e,0,o);e-=o;if(e===0){if(o===a.length){++n;if(r.next)this.head=r.next;else this.head=this.tail=null}else{this.head=r;r.data=a.slice(o)}break}++n}this.length-=n;return t}},{key:s,value:function value(e,t){return o(this,_objectSpread(_objectSpread({},t),{},{depth:0,customInspect:false}))}}]);return BufferList}()},61:function(e){"use strict";function destroy(e,t){var r=this;var n=this._readableState&&this._readableState.destroyed;var i=this._writableState&&this._writableState.destroyed;if(n||i){if(t){t(e)}else if(e){if(!this._writableState){process.nextTick(emitErrorNT,this,e)}else if(!this._writableState.errorEmitted){this._writableState.errorEmitted=true;process.nextTick(emitErrorNT,this,e)}}return this}if(this._readableState){this._readableState.destroyed=true}if(this._writableState){this._writableState.destroyed=true}this._destroy(e||null,(function(e){if(!t&&e){if(!r._writableState){process.nextTick(emitErrorAndCloseNT,r,e)}else if(!r._writableState.errorEmitted){r._writableState.errorEmitted=true;process.nextTick(emitErrorAndCloseNT,r,e)}else{process.nextTick(emitCloseNT,r)}}else if(t){process.nextTick(emitCloseNT,r);t(e)}else{process.nextTick(emitCloseNT,r)}}));return this}function emitErrorAndCloseNT(e,t){emitErrorNT(e,t);emitCloseNT(e)}function emitCloseNT(e){if(e._writableState&&!e._writableState.emitClose)return;if(e._readableState&&!e._readableState.emitClose)return;e.emit("close")}function undestroy(){if(this._readableState){this._readableState.destroyed=false;this._readableState.reading=false;this._readableState.ended=false;this._readableState.endEmitted=false}if(this._writableState){this._writableState.destroyed=false;this._writableState.ended=false;this._writableState.ending=false;this._writableState.finalCalled=false;this._writableState.prefinished=false;this._writableState.finished=false;this._writableState.errorEmitted=false}}function emitErrorNT(e,t){e.emit("error",t)}function errorOrDestroy(e,t){var r=e._readableState;var n=e._writableState;if(r&&r.autoDestroy||n&&n.autoDestroy)e.destroy(t);else e.emit("error",t)}e.exports={destroy:destroy,undestroy:undestroy,errorOrDestroy:errorOrDestroy}},242:function(e,t,r){"use strict";var n=r(238).q.ERR_STREAM_PREMATURE_CLOSE;function once(e){var t=false;return function(){if(t)return;t=true;for(var r=arguments.length,n=new Array(r),i=0;i<r;i++){n[i]=arguments[i]}e.apply(this,n)}}function noop(){}function isRequest(e){return e.setHeader&&typeof e.abort==="function"}function eos(e,t,r){if(typeof t==="function")return eos(e,null,t);if(!t)t={};r=once(r||noop);var i=t.readable||t.readable!==false&&e.readable;var a=t.writable||t.writable!==false&&e.writable;var o=function onlegacyfinish(){if(!e.writable)l()};var s=e._writableState&&e._writableState.finished;var l=function onfinish(){a=false;s=true;if(!i)r.call(e)};var f=e._readableState&&e._readableState.endEmitted;var u=function onend(){i=false;f=true;if(!a)r.call(e)};var d=function onerror(t){r.call(e,t)};var c=function onclose(){var t;if(i&&!f){if(!e._readableState||!e._readableState.ended)t=new n;return r.call(e,t)}if(a&&!s){if(!e._writableState||!e._writableState.ended)t=new n;return r.call(e,t)}};var h=function onrequest(){e.req.on("finish",l)};if(isRequest(e)){e.on("complete",l);e.on("abort",c);if(e.req)h();else e.on("request",h)}else if(a&&!e._writableState){e.on("end",o);e.on("close",o)}e.on("end",u);e.on("finish",l);if(t.error!==false)e.on("error",d);e.on("close",c);return function(){e.removeListener("complete",l);e.removeListener("abort",c);e.removeListener("request",h);if(e.req)e.req.removeListener("finish",l);e.removeListener("end",o);e.removeListener("close",o);e.removeListener("finish",l);e.removeListener("end",u);e.removeListener("error",d);e.removeListener("close",c)}}e.exports=eos},217:function(e,t,r){"use strict";function asyncGeneratorStep(e,t,r,n,i,a,o){try{var s=e[a](o);var l=s.value}catch(e){r(e);return}if(s.done){t(l)}else{Promise.resolve(l).then(n,i)}}function _asyncToGenerator(e){return function(){var t=this,r=arguments;return new Promise((function(n,i){var a=e.apply(t,r);function _next(e){asyncGeneratorStep(a,n,i,_next,_throw,"next",e)}function _throw(e){asyncGeneratorStep(a,n,i,_next,_throw,"throw",e)}_next(undefined)}))}}function ownKeys(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),r.push.apply(r,n)}return r}function _objectSpread(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?ownKeys(Object(r),!0).forEach((function(t){_defineProperty(e,t,r[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):ownKeys(Object(r)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))}))}return e}function _defineProperty(e,t,r){t=_toPropertyKey(t);if(t in e){Object.defineProperty(e,t,{value:r,enumerable:true,configurable:true,writable:true})}else{e[t]=r}return e}function _toPropertyKey(e){var t=_toPrimitive(e,"string");return typeof t==="symbol"?t:String(t)}function _toPrimitive(e,t){if(typeof e!=="object"||e===null)return e;var r=e[Symbol.toPrimitive];if(r!==undefined){var n=r.call(e,t||"default");if(typeof n!=="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}var n=r(238).q.ERR_INVALID_ARG_TYPE;function from(e,t,r){var i;if(t&&typeof t.next==="function"){i=t}else if(t&&t[Symbol.asyncIterator])i=t[Symbol.asyncIterator]();else if(t&&t[Symbol.iterator])i=t[Symbol.iterator]();else throw new n("iterable",["Iterable"],t);var a=new e(_objectSpread({objectMode:true},r));var o=false;a._read=function(){if(!o){o=true;next()}};function next(){return _next2.apply(this,arguments)}function _next2(){_next2=_asyncToGenerator((function*(){try{var e=yield i.next(),t=e.value,r=e.done;if(r){a.push(null)}else if(a.push(yield t)){next()}else{o=false}}catch(e){a.destroy(e)}}));return _next2.apply(this,arguments)}return a}e.exports=from},318:function(e,t,r){"use strict";var n=r(238).q.ERR_INVALID_OPT_VALUE;function highWaterMarkFrom(e,t,r){return e.highWaterMark!=null?e.highWaterMark:t?e[r]:null}function getHighWaterMark(e,t,r,i){var a=highWaterMarkFrom(t,i,r);if(a!=null){if(!(isFinite(a)&&Math.floor(a)===a)||a<0){var o=i?r:"highWaterMark";throw new n(o,a)}return Math.floor(a)}return e.objectMode?16:16*1024}e.exports={getHighWaterMark:getHighWaterMark}},917:function(e,t,r){e.exports=r(781)},300:function(e){"use strict";e.exports=require("buffer")},361:function(e){"use strict";e.exports=require("events")},781:function(e){"use strict";e.exports=require("stream")},837:function(e){"use strict";e.exports=require("util")}};var t={};function __nccwpck_require__(r){var n=t[r];if(n!==undefined){return n.exports}var i=t[r]={exports:{}};var a=true;try{e[r](i,i.exports,__nccwpck_require__);a=false}finally{if(a)delete t[r]}return i.exports}if(typeof __nccwpck_require__!=="undefined")__nccwpck_require__.ab=__dirname+"/";var r=__nccwpck_require__(281);module.exports=r})();
@@ -0,0 +1,119 @@
1
+ 'use strict';
2
+
3
+ const util = require('util');
4
+ const { LEVEL } = require('triple-beam');
5
+ const TransportStream = require('./modern');
6
+
7
+ /**
8
+ * Constructor function for the LegacyTransportStream. This is an internal
9
+ * wrapper `winston >= 3` uses to wrap older transports implementing
10
+ * log(level, message, meta).
11
+ * @param {Object} options - Options for this TransportStream instance.
12
+ * @param {Transpot} options.transport - winston@2 or older Transport to wrap.
13
+ */
14
+
15
+ const LegacyTransportStream = module.exports = function LegacyTransportStream(options = {}) {
16
+ TransportStream.call(this, options);
17
+ if (!options.transport || typeof options.transport.log !== 'function') {
18
+ throw new Error('Invalid transport, must be an object with a log method.');
19
+ }
20
+
21
+ this.transport = options.transport;
22
+ this.level = this.level || options.transport.level;
23
+ this.handleExceptions = this.handleExceptions || options.transport.handleExceptions;
24
+
25
+ // Display our deprecation notice.
26
+ this._deprecated();
27
+
28
+ // Properly bubble up errors from the transport to the
29
+ // LegacyTransportStream instance, but only once no matter how many times
30
+ // this transport is shared.
31
+ function transportError(err) {
32
+ this.emit('error', err, this.transport);
33
+ }
34
+
35
+ if (!this.transport.__winstonError) {
36
+ this.transport.__winstonError = transportError.bind(this);
37
+ this.transport.on('error', this.transport.__winstonError);
38
+ }
39
+ };
40
+
41
+ /*
42
+ * Inherit from TransportStream using Node.js built-ins
43
+ */
44
+ util.inherits(LegacyTransportStream, TransportStream);
45
+
46
+ /**
47
+ * Writes the info object to our transport instance.
48
+ * @param {mixed} info - TODO: add param description.
49
+ * @param {mixed} enc - TODO: add param description.
50
+ * @param {function} callback - TODO: add param description.
51
+ * @returns {undefined}
52
+ * @private
53
+ */
54
+ LegacyTransportStream.prototype._write = function _write(info, enc, callback) {
55
+ if (this.silent || (info.exception === true && !this.handleExceptions)) {
56
+ return callback(null);
57
+ }
58
+
59
+ // Remark: This has to be handled in the base transport now because we
60
+ // cannot conditionally write to our pipe targets as stream.
61
+ if (!this.level || this.levels[this.level] >= this.levels[info[LEVEL]]) {
62
+ this.transport.log(info[LEVEL], info.message, info, this._nop);
63
+ }
64
+
65
+ callback(null);
66
+ };
67
+
68
+ /**
69
+ * Writes the batch of info objects (i.e. "object chunks") to our transport
70
+ * instance after performing any necessary filtering.
71
+ * @param {mixed} chunks - TODO: add params description.
72
+ * @param {function} callback - TODO: add params description.
73
+ * @returns {mixed} - TODO: add returns description.
74
+ * @private
75
+ */
76
+ LegacyTransportStream.prototype._writev = function _writev(chunks, callback) {
77
+ for (let i = 0; i < chunks.length; i++) {
78
+ if (this._accept(chunks[i])) {
79
+ this.transport.log(
80
+ chunks[i].chunk[LEVEL],
81
+ chunks[i].chunk.message,
82
+ chunks[i].chunk,
83
+ this._nop
84
+ );
85
+ chunks[i].callback();
86
+ }
87
+ }
88
+
89
+ return callback(null);
90
+ };
91
+
92
+ /**
93
+ * Displays a deprecation notice. Defined as a function so it can be
94
+ * overriden in tests.
95
+ * @returns {undefined}
96
+ */
97
+ LegacyTransportStream.prototype._deprecated = function _deprecated() {
98
+ // eslint-disable-next-line no-console
99
+ console.error([
100
+ `${this.transport.name} is a legacy winston transport. Consider upgrading: `,
101
+ '- Upgrade docs: https://github.com/winstonjs/winston/blob/master/UPGRADE-3.0.md'
102
+ ].join('\n'));
103
+ };
104
+
105
+ /**
106
+ * Clean up error handling state on the legacy transport associated
107
+ * with this instance.
108
+ * @returns {undefined}
109
+ */
110
+ LegacyTransportStream.prototype.close = function close() {
111
+ if (this.transport.close) {
112
+ this.transport.close();
113
+ }
114
+
115
+ if (this.transport.__winstonError) {
116
+ this.transport.removeListener('error', this.transport.__winstonError);
117
+ this.transport.__winstonError = null;
118
+ }
119
+ };