@qwen-code/qwen-code 0.16.2 → 0.17.0
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/bundled/qc-helper/docs/configuration/settings.md +5 -1
- package/bundled/qc-helper/docs/features/channels/_meta.ts +1 -0
- package/bundled/qc-helper/docs/features/channels/feishu.md +170 -0
- package/chunks/{agent-RY5EB3XR.js → agent-KVXFGIOU.js} +17 -12
- package/chunks/{anthropicContentGenerator-LYI3OHBB.js → anthropicContentGenerator-L4HWAOIV.js} +5 -5
- package/chunks/{askUserQuestion-R3MKD2JT.js → askUserQuestion-DC6OWQIL.js} +5 -3
- package/chunks/chunk-24YKA2DA.js +233 -0
- package/chunks/{chunk-UFC57OYT.js → chunk-33RDTIU6.js} +5 -3
- package/chunks/{chunk-C6WMLUNB.js → chunk-3BJBCG2K.js} +1 -1
- package/chunks/chunk-3HX5LZ6R.js +1798 -0
- package/chunks/{chunk-GQXXO5HJ.js → chunk-4O2TWJK4.js} +25 -5
- package/chunks/{chunk-RDYWTWEM.js → chunk-5IFG2VC4.js} +299 -232
- package/chunks/chunk-6RQTH7UQ.js +115 -0
- package/chunks/{chunk-7HM6OB7M.js → chunk-7EHPK6TK.js} +1336 -5164
- package/chunks/{chunk-PJLEMR7N.js → chunk-7NNBQRV7.js} +6 -6
- package/chunks/{chunk-K5PGHDBN.js → chunk-AKBFRR6J.js} +112 -132
- package/chunks/{chunk-C27V5A2J.js → chunk-EMVEDSVZ.js} +1 -1
- package/chunks/{chunk-TXQI3VZ7.js → chunk-GJHMAWS7.js} +1 -1
- package/chunks/{chunk-K72FHBFO.js → chunk-HAQCNXSG.js} +1 -0
- package/chunks/{chunk-T4VD6OJ4.js → chunk-HCSJIOLR.js} +1 -1
- package/chunks/chunk-J37FGIOA.js +1623 -0
- package/chunks/chunk-J5VCSWPA.js +1467 -0
- package/chunks/{chunk-UE5LPQF7.js → chunk-JI7FDD65.js} +7 -7
- package/chunks/{chunk-4YNZFYJY.js → chunk-MEN6IEKX.js} +2533 -3943
- package/chunks/{chunk-USE2VQ5P.js → chunk-NP3ICQCN.js} +1 -1
- package/chunks/{chunk-66CJCYYZ.js → chunk-QEXSIXLX.js} +1 -1
- package/chunks/{chunk-YMDXEEOW.js → chunk-R2B65CAN.js} +1 -82
- package/chunks/chunk-SZOEIL6S.js +35 -0
- package/chunks/chunk-TI4GXJKO.js +4277 -0
- package/chunks/{chunk-E7E2MFYM.js → chunk-U2K6HDUJ.js} +434 -13
- package/chunks/{chunk-FO7BIVSR.js → chunk-UQRYJQBE.js} +5 -3
- package/chunks/{chunk-VMOWXTRC.js → chunk-V7LMZR76.js} +1 -1
- package/chunks/chunk-W57YDFU5.js +41 -0
- package/chunks/computer-use-2J5ZXEER.js +768 -0
- package/chunks/{contextCommand-DDGVLQSF.js → contextCommand-52NTEMCT.js} +19 -14
- package/chunks/{cron-create-BTEOGHPH.js → cron-create-FXRORK2U.js} +5 -3
- package/chunks/{cron-delete-56CEWELN.js → cron-delete-D24IN6CA.js} +5 -3
- package/chunks/{cron-list-SV6QRZW2.js → cron-list-SMOX26SL.js} +5 -3
- package/chunks/{devtools-WN62SQPV.js → devtools-IXE4UP72.js} +31 -3748
- package/chunks/{dist-MN2PDDPR.js → dist-6RUZ2JD6.js} +13 -1612
- package/chunks/{dist-R2SXPG74.js → dist-AHZNZWRI.js} +5 -4
- package/chunks/dist-GRQVFL3G.js +94147 -0
- package/chunks/{dist-BXDUQ2QY.js → dist-XTTPOFAH.js} +4 -3
- package/chunks/{edit-4LLGNYVZ.js → edit-RLFUTT5F.js} +20 -14
- package/chunks/{enter-worktree-E2R5XAFT.js → enter-worktree-CYRAPQKJ.js} +20 -14
- package/chunks/{exit-worktree-YVBYYYDD.js → exit-worktree-WQZM72QD.js} +20 -14
- package/chunks/{exitPlanMode-WD5IH7NS.js → exitPlanMode-STFEBQZE.js} +20 -14
- package/chunks/{geminiContentGenerator-LM65ADWM.js → geminiContentGenerator-DIV32SKO.js} +4 -3
- package/chunks/{glob-6X6OCEWE.js → glob-N3XO4RVI.js} +20 -14
- package/chunks/{grep-2UUPSSIQ.js → grep-AK5MP7P3.js} +20 -14
- package/chunks/{ls-MYXAM7LJ.js → ls-7FYQHPWF.js} +5 -3
- package/chunks/{lsp-PFGI35JL.js → lsp-DKG34USR.js} +5 -3
- package/chunks/{monitor-VUHPEGUW.js → monitor-IVBWJZEZ.js} +20 -14
- package/chunks/{notebook-edit-P4QVLW6I.js → notebook-edit-PM46AXFS.js} +21 -15
- package/chunks/{openaiContentGenerator-JH4YNZ3H.js → openaiContentGenerator-4QXCH7L2.js} +13 -10
- package/chunks/{qwenContentGenerator-5FE4UYUT.js → qwenContentGenerator-BLXQIIMX.js} +21 -16
- package/chunks/{read-file-J7DH4OKV.js → read-file-IEQAS3EZ.js} +10 -6
- package/chunks/{ripGrep-33DECY4F.js → ripGrep-HQO7IE4C.js} +17 -12
- package/chunks/{send-message-JUFP62VD.js → send-message-ZL7CDM7K.js} +5 -3
- package/chunks/{serve-7FX7MREA.js → serve-CYRAK4UM.js} +63 -1837
- package/chunks/{shell-ZNTQIRK6.js → shell-UZBGNO2Q.js} +17 -12
- package/chunks/{skill-CFCUIY23.js → skill-JVC34QYN.js} +24 -13
- package/chunks/{src-AHV2CWEQ.js → src-FOODLH7B.js} +49 -41
- package/chunks/{syntheticOutput-AKTXC6FR.js → syntheticOutput-U3YJ3GOO.js} +3 -2
- package/chunks/{task-stop-2NYFR2ES.js → task-stop-NPUI3YBA.js} +5 -3
- package/chunks/{todoWrite-WHZ2O2XP.js → todoWrite-Y6F7YEIM.js} +6 -4
- package/chunks/{tool-search-C2EMLFBJ.js → tool-search-P7PRPOW3.js} +13 -8
- package/chunks/{web-fetch-S6MZXPZ5.js → web-fetch-XWEK4TFX.js} +6 -4
- package/chunks/{write-file-EEPVRS4Q.js → write-file-SIIEUON5.js} +21 -15
- package/cli.js +412 -329
- package/package.json +2 -2
- package/chunks/chunk-JVD46YJV.js +0 -434
- package/chunks/undici-4ARNOH74.js +0 -8
|
@@ -1,1622 +1,33 @@
|
|
|
1
1
|
// Force strict mode and setup for ESM
|
|
2
2
|
"use strict";
|
|
3
3
|
import {
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
4
|
+
require_follow_redirects,
|
|
5
|
+
require_form_data,
|
|
6
|
+
require_proxy_from_env
|
|
7
|
+
} from "./chunk-J37FGIOA.js";
|
|
8
|
+
import "./chunk-7RYW5LQV.js";
|
|
9
9
|
import {
|
|
10
10
|
ChannelBase
|
|
11
|
-
} from "./chunk-
|
|
12
|
-
import "./chunk-
|
|
13
|
-
import "./chunk-
|
|
14
|
-
import
|
|
15
|
-
|
|
16
|
-
} from "./chunk-UWCTAVOD.js";
|
|
11
|
+
} from "./chunk-NP3ICQCN.js";
|
|
12
|
+
import "./chunk-33RDTIU6.js";
|
|
13
|
+
import "./chunk-24YKA2DA.js";
|
|
14
|
+
import "./chunk-AKBFRR6J.js";
|
|
15
|
+
import "./chunk-UWCTAVOD.js";
|
|
17
16
|
import {
|
|
18
17
|
wrapper_default
|
|
19
|
-
} from "./chunk-
|
|
20
|
-
import
|
|
21
|
-
|
|
22
|
-
} from "./chunk-QN5NZ3UQ.js";
|
|
18
|
+
} from "./chunk-SZOEIL6S.js";
|
|
19
|
+
import "./chunk-5IFG2VC4.js";
|
|
20
|
+
import "./chunk-QN5NZ3UQ.js";
|
|
23
21
|
import "./chunk-BR4QREVK.js";
|
|
24
22
|
import {
|
|
25
23
|
init_esbuild_shims
|
|
26
24
|
} from "./chunk-A4BMJM77.js";
|
|
27
25
|
import {
|
|
28
|
-
__commonJS,
|
|
29
26
|
__export,
|
|
30
27
|
__name,
|
|
31
|
-
__require,
|
|
32
28
|
__toESM
|
|
33
29
|
} from "./chunk-J2S4EL5Y.js";
|
|
34
30
|
|
|
35
|
-
// node_modules/delayed-stream/lib/delayed_stream.js
|
|
36
|
-
var require_delayed_stream = __commonJS({
|
|
37
|
-
"node_modules/delayed-stream/lib/delayed_stream.js"(exports, module) {
|
|
38
|
-
init_esbuild_shims();
|
|
39
|
-
var Stream = __require("stream").Stream;
|
|
40
|
-
var util3 = __require("util");
|
|
41
|
-
module.exports = DelayedStream;
|
|
42
|
-
function DelayedStream() {
|
|
43
|
-
this.source = null;
|
|
44
|
-
this.dataSize = 0;
|
|
45
|
-
this.maxDataSize = 1024 * 1024;
|
|
46
|
-
this.pauseStream = true;
|
|
47
|
-
this._maxDataSizeExceeded = false;
|
|
48
|
-
this._released = false;
|
|
49
|
-
this._bufferedEvents = [];
|
|
50
|
-
}
|
|
51
|
-
__name(DelayedStream, "DelayedStream");
|
|
52
|
-
util3.inherits(DelayedStream, Stream);
|
|
53
|
-
DelayedStream.create = function(source, options) {
|
|
54
|
-
var delayedStream = new this();
|
|
55
|
-
options = options || {};
|
|
56
|
-
for (var option in options) {
|
|
57
|
-
delayedStream[option] = options[option];
|
|
58
|
-
}
|
|
59
|
-
delayedStream.source = source;
|
|
60
|
-
var realEmit = source.emit;
|
|
61
|
-
source.emit = function() {
|
|
62
|
-
delayedStream._handleEmit(arguments);
|
|
63
|
-
return realEmit.apply(source, arguments);
|
|
64
|
-
};
|
|
65
|
-
source.on("error", function() {
|
|
66
|
-
});
|
|
67
|
-
if (delayedStream.pauseStream) {
|
|
68
|
-
source.pause();
|
|
69
|
-
}
|
|
70
|
-
return delayedStream;
|
|
71
|
-
};
|
|
72
|
-
Object.defineProperty(DelayedStream.prototype, "readable", {
|
|
73
|
-
configurable: true,
|
|
74
|
-
enumerable: true,
|
|
75
|
-
get: /* @__PURE__ */ __name(function() {
|
|
76
|
-
return this.source.readable;
|
|
77
|
-
}, "get")
|
|
78
|
-
});
|
|
79
|
-
DelayedStream.prototype.setEncoding = function() {
|
|
80
|
-
return this.source.setEncoding.apply(this.source, arguments);
|
|
81
|
-
};
|
|
82
|
-
DelayedStream.prototype.resume = function() {
|
|
83
|
-
if (!this._released) {
|
|
84
|
-
this.release();
|
|
85
|
-
}
|
|
86
|
-
this.source.resume();
|
|
87
|
-
};
|
|
88
|
-
DelayedStream.prototype.pause = function() {
|
|
89
|
-
this.source.pause();
|
|
90
|
-
};
|
|
91
|
-
DelayedStream.prototype.release = function() {
|
|
92
|
-
this._released = true;
|
|
93
|
-
this._bufferedEvents.forEach(function(args) {
|
|
94
|
-
this.emit.apply(this, args);
|
|
95
|
-
}.bind(this));
|
|
96
|
-
this._bufferedEvents = [];
|
|
97
|
-
};
|
|
98
|
-
DelayedStream.prototype.pipe = function() {
|
|
99
|
-
var r = Stream.prototype.pipe.apply(this, arguments);
|
|
100
|
-
this.resume();
|
|
101
|
-
return r;
|
|
102
|
-
};
|
|
103
|
-
DelayedStream.prototype._handleEmit = function(args) {
|
|
104
|
-
if (this._released) {
|
|
105
|
-
this.emit.apply(this, args);
|
|
106
|
-
return;
|
|
107
|
-
}
|
|
108
|
-
if (args[0] === "data") {
|
|
109
|
-
this.dataSize += args[1].length;
|
|
110
|
-
this._checkIfMaxDataSizeExceeded();
|
|
111
|
-
}
|
|
112
|
-
this._bufferedEvents.push(args);
|
|
113
|
-
};
|
|
114
|
-
DelayedStream.prototype._checkIfMaxDataSizeExceeded = function() {
|
|
115
|
-
if (this._maxDataSizeExceeded) {
|
|
116
|
-
return;
|
|
117
|
-
}
|
|
118
|
-
if (this.dataSize <= this.maxDataSize) {
|
|
119
|
-
return;
|
|
120
|
-
}
|
|
121
|
-
this._maxDataSizeExceeded = true;
|
|
122
|
-
var message = "DelayedStream#maxDataSize of " + this.maxDataSize + " bytes exceeded.";
|
|
123
|
-
this.emit("error", new Error(message));
|
|
124
|
-
};
|
|
125
|
-
}
|
|
126
|
-
});
|
|
127
|
-
|
|
128
|
-
// node_modules/combined-stream/lib/combined_stream.js
|
|
129
|
-
var require_combined_stream = __commonJS({
|
|
130
|
-
"node_modules/combined-stream/lib/combined_stream.js"(exports, module) {
|
|
131
|
-
init_esbuild_shims();
|
|
132
|
-
var util3 = __require("util");
|
|
133
|
-
var Stream = __require("stream").Stream;
|
|
134
|
-
var DelayedStream = require_delayed_stream();
|
|
135
|
-
module.exports = CombinedStream;
|
|
136
|
-
function CombinedStream() {
|
|
137
|
-
this.writable = false;
|
|
138
|
-
this.readable = true;
|
|
139
|
-
this.dataSize = 0;
|
|
140
|
-
this.maxDataSize = 2 * 1024 * 1024;
|
|
141
|
-
this.pauseStreams = true;
|
|
142
|
-
this._released = false;
|
|
143
|
-
this._streams = [];
|
|
144
|
-
this._currentStream = null;
|
|
145
|
-
this._insideLoop = false;
|
|
146
|
-
this._pendingNext = false;
|
|
147
|
-
}
|
|
148
|
-
__name(CombinedStream, "CombinedStream");
|
|
149
|
-
util3.inherits(CombinedStream, Stream);
|
|
150
|
-
CombinedStream.create = function(options) {
|
|
151
|
-
var combinedStream = new this();
|
|
152
|
-
options = options || {};
|
|
153
|
-
for (var option in options) {
|
|
154
|
-
combinedStream[option] = options[option];
|
|
155
|
-
}
|
|
156
|
-
return combinedStream;
|
|
157
|
-
};
|
|
158
|
-
CombinedStream.isStreamLike = function(stream4) {
|
|
159
|
-
return typeof stream4 !== "function" && typeof stream4 !== "string" && typeof stream4 !== "boolean" && typeof stream4 !== "number" && !Buffer.isBuffer(stream4);
|
|
160
|
-
};
|
|
161
|
-
CombinedStream.prototype.append = function(stream4) {
|
|
162
|
-
var isStreamLike = CombinedStream.isStreamLike(stream4);
|
|
163
|
-
if (isStreamLike) {
|
|
164
|
-
if (!(stream4 instanceof DelayedStream)) {
|
|
165
|
-
var newStream = DelayedStream.create(stream4, {
|
|
166
|
-
maxDataSize: Infinity,
|
|
167
|
-
pauseStream: this.pauseStreams
|
|
168
|
-
});
|
|
169
|
-
stream4.on("data", this._checkDataSize.bind(this));
|
|
170
|
-
stream4 = newStream;
|
|
171
|
-
}
|
|
172
|
-
this._handleErrors(stream4);
|
|
173
|
-
if (this.pauseStreams) {
|
|
174
|
-
stream4.pause();
|
|
175
|
-
}
|
|
176
|
-
}
|
|
177
|
-
this._streams.push(stream4);
|
|
178
|
-
return this;
|
|
179
|
-
};
|
|
180
|
-
CombinedStream.prototype.pipe = function(dest, options) {
|
|
181
|
-
Stream.prototype.pipe.call(this, dest, options);
|
|
182
|
-
this.resume();
|
|
183
|
-
return dest;
|
|
184
|
-
};
|
|
185
|
-
CombinedStream.prototype._getNext = function() {
|
|
186
|
-
this._currentStream = null;
|
|
187
|
-
if (this._insideLoop) {
|
|
188
|
-
this._pendingNext = true;
|
|
189
|
-
return;
|
|
190
|
-
}
|
|
191
|
-
this._insideLoop = true;
|
|
192
|
-
try {
|
|
193
|
-
do {
|
|
194
|
-
this._pendingNext = false;
|
|
195
|
-
this._realGetNext();
|
|
196
|
-
} while (this._pendingNext);
|
|
197
|
-
} finally {
|
|
198
|
-
this._insideLoop = false;
|
|
199
|
-
}
|
|
200
|
-
};
|
|
201
|
-
CombinedStream.prototype._realGetNext = function() {
|
|
202
|
-
var stream4 = this._streams.shift();
|
|
203
|
-
if (typeof stream4 == "undefined") {
|
|
204
|
-
this.end();
|
|
205
|
-
return;
|
|
206
|
-
}
|
|
207
|
-
if (typeof stream4 !== "function") {
|
|
208
|
-
this._pipeNext(stream4);
|
|
209
|
-
return;
|
|
210
|
-
}
|
|
211
|
-
var getStream = stream4;
|
|
212
|
-
getStream(function(stream5) {
|
|
213
|
-
var isStreamLike = CombinedStream.isStreamLike(stream5);
|
|
214
|
-
if (isStreamLike) {
|
|
215
|
-
stream5.on("data", this._checkDataSize.bind(this));
|
|
216
|
-
this._handleErrors(stream5);
|
|
217
|
-
}
|
|
218
|
-
this._pipeNext(stream5);
|
|
219
|
-
}.bind(this));
|
|
220
|
-
};
|
|
221
|
-
CombinedStream.prototype._pipeNext = function(stream4) {
|
|
222
|
-
this._currentStream = stream4;
|
|
223
|
-
var isStreamLike = CombinedStream.isStreamLike(stream4);
|
|
224
|
-
if (isStreamLike) {
|
|
225
|
-
stream4.on("end", this._getNext.bind(this));
|
|
226
|
-
stream4.pipe(this, { end: false });
|
|
227
|
-
return;
|
|
228
|
-
}
|
|
229
|
-
var value = stream4;
|
|
230
|
-
this.write(value);
|
|
231
|
-
this._getNext();
|
|
232
|
-
};
|
|
233
|
-
CombinedStream.prototype._handleErrors = function(stream4) {
|
|
234
|
-
var self2 = this;
|
|
235
|
-
stream4.on("error", function(err) {
|
|
236
|
-
self2._emitError(err);
|
|
237
|
-
});
|
|
238
|
-
};
|
|
239
|
-
CombinedStream.prototype.write = function(data) {
|
|
240
|
-
this.emit("data", data);
|
|
241
|
-
};
|
|
242
|
-
CombinedStream.prototype.pause = function() {
|
|
243
|
-
if (!this.pauseStreams) {
|
|
244
|
-
return;
|
|
245
|
-
}
|
|
246
|
-
if (this.pauseStreams && this._currentStream && typeof this._currentStream.pause == "function") this._currentStream.pause();
|
|
247
|
-
this.emit("pause");
|
|
248
|
-
};
|
|
249
|
-
CombinedStream.prototype.resume = function() {
|
|
250
|
-
if (!this._released) {
|
|
251
|
-
this._released = true;
|
|
252
|
-
this.writable = true;
|
|
253
|
-
this._getNext();
|
|
254
|
-
}
|
|
255
|
-
if (this.pauseStreams && this._currentStream && typeof this._currentStream.resume == "function") this._currentStream.resume();
|
|
256
|
-
this.emit("resume");
|
|
257
|
-
};
|
|
258
|
-
CombinedStream.prototype.end = function() {
|
|
259
|
-
this._reset();
|
|
260
|
-
this.emit("end");
|
|
261
|
-
};
|
|
262
|
-
CombinedStream.prototype.destroy = function() {
|
|
263
|
-
this._reset();
|
|
264
|
-
this.emit("close");
|
|
265
|
-
};
|
|
266
|
-
CombinedStream.prototype._reset = function() {
|
|
267
|
-
this.writable = false;
|
|
268
|
-
this._streams = [];
|
|
269
|
-
this._currentStream = null;
|
|
270
|
-
};
|
|
271
|
-
CombinedStream.prototype._checkDataSize = function() {
|
|
272
|
-
this._updateDataSize();
|
|
273
|
-
if (this.dataSize <= this.maxDataSize) {
|
|
274
|
-
return;
|
|
275
|
-
}
|
|
276
|
-
var message = "DelayedStream#maxDataSize of " + this.maxDataSize + " bytes exceeded.";
|
|
277
|
-
this._emitError(new Error(message));
|
|
278
|
-
};
|
|
279
|
-
CombinedStream.prototype._updateDataSize = function() {
|
|
280
|
-
this.dataSize = 0;
|
|
281
|
-
var self2 = this;
|
|
282
|
-
this._streams.forEach(function(stream4) {
|
|
283
|
-
if (!stream4.dataSize) {
|
|
284
|
-
return;
|
|
285
|
-
}
|
|
286
|
-
self2.dataSize += stream4.dataSize;
|
|
287
|
-
});
|
|
288
|
-
if (this._currentStream && this._currentStream.dataSize) {
|
|
289
|
-
this.dataSize += this._currentStream.dataSize;
|
|
290
|
-
}
|
|
291
|
-
};
|
|
292
|
-
CombinedStream.prototype._emitError = function(err) {
|
|
293
|
-
this._reset();
|
|
294
|
-
this.emit("error", err);
|
|
295
|
-
};
|
|
296
|
-
}
|
|
297
|
-
});
|
|
298
|
-
|
|
299
|
-
// node_modules/form-data/node_modules/mime-types/index.js
|
|
300
|
-
var require_mime_types = __commonJS({
|
|
301
|
-
"node_modules/form-data/node_modules/mime-types/index.js"(exports) {
|
|
302
|
-
"use strict";
|
|
303
|
-
init_esbuild_shims();
|
|
304
|
-
var db = require_mime_db();
|
|
305
|
-
var extname = __require("path").extname;
|
|
306
|
-
var EXTRACT_TYPE_REGEXP = /^\s*([^;\s]*)(?:;|\s|$)/;
|
|
307
|
-
var TEXT_TYPE_REGEXP = /^text\//i;
|
|
308
|
-
exports.charset = charset;
|
|
309
|
-
exports.charsets = { lookup: charset };
|
|
310
|
-
exports.contentType = contentType;
|
|
311
|
-
exports.extension = extension;
|
|
312
|
-
exports.extensions = /* @__PURE__ */ Object.create(null);
|
|
313
|
-
exports.lookup = lookup;
|
|
314
|
-
exports.types = /* @__PURE__ */ Object.create(null);
|
|
315
|
-
populateMaps(exports.extensions, exports.types);
|
|
316
|
-
function charset(type) {
|
|
317
|
-
if (!type || typeof type !== "string") {
|
|
318
|
-
return false;
|
|
319
|
-
}
|
|
320
|
-
var match = EXTRACT_TYPE_REGEXP.exec(type);
|
|
321
|
-
var mime = match && db[match[1].toLowerCase()];
|
|
322
|
-
if (mime && mime.charset) {
|
|
323
|
-
return mime.charset;
|
|
324
|
-
}
|
|
325
|
-
if (match && TEXT_TYPE_REGEXP.test(match[1])) {
|
|
326
|
-
return "UTF-8";
|
|
327
|
-
}
|
|
328
|
-
return false;
|
|
329
|
-
}
|
|
330
|
-
__name(charset, "charset");
|
|
331
|
-
function contentType(str) {
|
|
332
|
-
if (!str || typeof str !== "string") {
|
|
333
|
-
return false;
|
|
334
|
-
}
|
|
335
|
-
var mime = str.indexOf("/") === -1 ? exports.lookup(str) : str;
|
|
336
|
-
if (!mime) {
|
|
337
|
-
return false;
|
|
338
|
-
}
|
|
339
|
-
if (mime.indexOf("charset") === -1) {
|
|
340
|
-
var charset2 = exports.charset(mime);
|
|
341
|
-
if (charset2) mime += "; charset=" + charset2.toLowerCase();
|
|
342
|
-
}
|
|
343
|
-
return mime;
|
|
344
|
-
}
|
|
345
|
-
__name(contentType, "contentType");
|
|
346
|
-
function extension(type) {
|
|
347
|
-
if (!type || typeof type !== "string") {
|
|
348
|
-
return false;
|
|
349
|
-
}
|
|
350
|
-
var match = EXTRACT_TYPE_REGEXP.exec(type);
|
|
351
|
-
var exts = match && exports.extensions[match[1].toLowerCase()];
|
|
352
|
-
if (!exts || !exts.length) {
|
|
353
|
-
return false;
|
|
354
|
-
}
|
|
355
|
-
return exts[0];
|
|
356
|
-
}
|
|
357
|
-
__name(extension, "extension");
|
|
358
|
-
function lookup(path) {
|
|
359
|
-
if (!path || typeof path !== "string") {
|
|
360
|
-
return false;
|
|
361
|
-
}
|
|
362
|
-
var extension2 = extname("x." + path).toLowerCase().substr(1);
|
|
363
|
-
if (!extension2) {
|
|
364
|
-
return false;
|
|
365
|
-
}
|
|
366
|
-
return exports.types[extension2] || false;
|
|
367
|
-
}
|
|
368
|
-
__name(lookup, "lookup");
|
|
369
|
-
function populateMaps(extensions, types) {
|
|
370
|
-
var preference = ["nginx", "apache", void 0, "iana"];
|
|
371
|
-
Object.keys(db).forEach(/* @__PURE__ */ __name(function forEachMimeType(type) {
|
|
372
|
-
var mime = db[type];
|
|
373
|
-
var exts = mime.extensions;
|
|
374
|
-
if (!exts || !exts.length) {
|
|
375
|
-
return;
|
|
376
|
-
}
|
|
377
|
-
extensions[type] = exts;
|
|
378
|
-
for (var i = 0; i < exts.length; i++) {
|
|
379
|
-
var extension2 = exts[i];
|
|
380
|
-
if (types[extension2]) {
|
|
381
|
-
var from = preference.indexOf(db[types[extension2]].source);
|
|
382
|
-
var to = preference.indexOf(mime.source);
|
|
383
|
-
if (types[extension2] !== "application/octet-stream" && (from > to || from === to && types[extension2].substr(0, 12) === "application/")) {
|
|
384
|
-
continue;
|
|
385
|
-
}
|
|
386
|
-
}
|
|
387
|
-
types[extension2] = type;
|
|
388
|
-
}
|
|
389
|
-
}, "forEachMimeType"));
|
|
390
|
-
}
|
|
391
|
-
__name(populateMaps, "populateMaps");
|
|
392
|
-
}
|
|
393
|
-
});
|
|
394
|
-
|
|
395
|
-
// node_modules/asynckit/lib/defer.js
|
|
396
|
-
var require_defer = __commonJS({
|
|
397
|
-
"node_modules/asynckit/lib/defer.js"(exports, module) {
|
|
398
|
-
init_esbuild_shims();
|
|
399
|
-
module.exports = defer;
|
|
400
|
-
function defer(fn) {
|
|
401
|
-
var nextTick = typeof setImmediate == "function" ? setImmediate : typeof process == "object" && typeof process.nextTick == "function" ? process.nextTick : null;
|
|
402
|
-
if (nextTick) {
|
|
403
|
-
nextTick(fn);
|
|
404
|
-
} else {
|
|
405
|
-
setTimeout(fn, 0);
|
|
406
|
-
}
|
|
407
|
-
}
|
|
408
|
-
__name(defer, "defer");
|
|
409
|
-
}
|
|
410
|
-
});
|
|
411
|
-
|
|
412
|
-
// node_modules/asynckit/lib/async.js
|
|
413
|
-
var require_async = __commonJS({
|
|
414
|
-
"node_modules/asynckit/lib/async.js"(exports, module) {
|
|
415
|
-
init_esbuild_shims();
|
|
416
|
-
var defer = require_defer();
|
|
417
|
-
module.exports = async;
|
|
418
|
-
function async(callback) {
|
|
419
|
-
var isAsync = false;
|
|
420
|
-
defer(function() {
|
|
421
|
-
isAsync = true;
|
|
422
|
-
});
|
|
423
|
-
return /* @__PURE__ */ __name(function async_callback(err, result) {
|
|
424
|
-
if (isAsync) {
|
|
425
|
-
callback(err, result);
|
|
426
|
-
} else {
|
|
427
|
-
defer(/* @__PURE__ */ __name(function nextTick_callback() {
|
|
428
|
-
callback(err, result);
|
|
429
|
-
}, "nextTick_callback"));
|
|
430
|
-
}
|
|
431
|
-
}, "async_callback");
|
|
432
|
-
}
|
|
433
|
-
__name(async, "async");
|
|
434
|
-
}
|
|
435
|
-
});
|
|
436
|
-
|
|
437
|
-
// node_modules/asynckit/lib/abort.js
|
|
438
|
-
var require_abort = __commonJS({
|
|
439
|
-
"node_modules/asynckit/lib/abort.js"(exports, module) {
|
|
440
|
-
init_esbuild_shims();
|
|
441
|
-
module.exports = abort;
|
|
442
|
-
function abort(state) {
|
|
443
|
-
Object.keys(state.jobs).forEach(clean.bind(state));
|
|
444
|
-
state.jobs = {};
|
|
445
|
-
}
|
|
446
|
-
__name(abort, "abort");
|
|
447
|
-
function clean(key) {
|
|
448
|
-
if (typeof this.jobs[key] == "function") {
|
|
449
|
-
this.jobs[key]();
|
|
450
|
-
}
|
|
451
|
-
}
|
|
452
|
-
__name(clean, "clean");
|
|
453
|
-
}
|
|
454
|
-
});
|
|
455
|
-
|
|
456
|
-
// node_modules/asynckit/lib/iterate.js
|
|
457
|
-
var require_iterate = __commonJS({
|
|
458
|
-
"node_modules/asynckit/lib/iterate.js"(exports, module) {
|
|
459
|
-
init_esbuild_shims();
|
|
460
|
-
var async = require_async();
|
|
461
|
-
var abort = require_abort();
|
|
462
|
-
module.exports = iterate;
|
|
463
|
-
function iterate(list, iterator2, state, callback) {
|
|
464
|
-
var key = state["keyedList"] ? state["keyedList"][state.index] : state.index;
|
|
465
|
-
state.jobs[key] = runJob(iterator2, key, list[key], function(error, output) {
|
|
466
|
-
if (!(key in state.jobs)) {
|
|
467
|
-
return;
|
|
468
|
-
}
|
|
469
|
-
delete state.jobs[key];
|
|
470
|
-
if (error) {
|
|
471
|
-
abort(state);
|
|
472
|
-
} else {
|
|
473
|
-
state.results[key] = output;
|
|
474
|
-
}
|
|
475
|
-
callback(error, state.results);
|
|
476
|
-
});
|
|
477
|
-
}
|
|
478
|
-
__name(iterate, "iterate");
|
|
479
|
-
function runJob(iterator2, key, item, callback) {
|
|
480
|
-
var aborter;
|
|
481
|
-
if (iterator2.length == 2) {
|
|
482
|
-
aborter = iterator2(item, async(callback));
|
|
483
|
-
} else {
|
|
484
|
-
aborter = iterator2(item, key, async(callback));
|
|
485
|
-
}
|
|
486
|
-
return aborter;
|
|
487
|
-
}
|
|
488
|
-
__name(runJob, "runJob");
|
|
489
|
-
}
|
|
490
|
-
});
|
|
491
|
-
|
|
492
|
-
// node_modules/asynckit/lib/state.js
|
|
493
|
-
var require_state = __commonJS({
|
|
494
|
-
"node_modules/asynckit/lib/state.js"(exports, module) {
|
|
495
|
-
init_esbuild_shims();
|
|
496
|
-
module.exports = state;
|
|
497
|
-
function state(list, sortMethod) {
|
|
498
|
-
var isNamedList = !Array.isArray(list), initState = {
|
|
499
|
-
index: 0,
|
|
500
|
-
keyedList: isNamedList || sortMethod ? Object.keys(list) : null,
|
|
501
|
-
jobs: {},
|
|
502
|
-
results: isNamedList ? {} : [],
|
|
503
|
-
size: isNamedList ? Object.keys(list).length : list.length
|
|
504
|
-
};
|
|
505
|
-
if (sortMethod) {
|
|
506
|
-
initState.keyedList.sort(isNamedList ? sortMethod : function(a, b) {
|
|
507
|
-
return sortMethod(list[a], list[b]);
|
|
508
|
-
});
|
|
509
|
-
}
|
|
510
|
-
return initState;
|
|
511
|
-
}
|
|
512
|
-
__name(state, "state");
|
|
513
|
-
}
|
|
514
|
-
});
|
|
515
|
-
|
|
516
|
-
// node_modules/asynckit/lib/terminator.js
|
|
517
|
-
var require_terminator = __commonJS({
|
|
518
|
-
"node_modules/asynckit/lib/terminator.js"(exports, module) {
|
|
519
|
-
init_esbuild_shims();
|
|
520
|
-
var abort = require_abort();
|
|
521
|
-
var async = require_async();
|
|
522
|
-
module.exports = terminator;
|
|
523
|
-
function terminator(callback) {
|
|
524
|
-
if (!Object.keys(this.jobs).length) {
|
|
525
|
-
return;
|
|
526
|
-
}
|
|
527
|
-
this.index = this.size;
|
|
528
|
-
abort(this);
|
|
529
|
-
async(callback)(null, this.results);
|
|
530
|
-
}
|
|
531
|
-
__name(terminator, "terminator");
|
|
532
|
-
}
|
|
533
|
-
});
|
|
534
|
-
|
|
535
|
-
// node_modules/asynckit/parallel.js
|
|
536
|
-
var require_parallel = __commonJS({
|
|
537
|
-
"node_modules/asynckit/parallel.js"(exports, module) {
|
|
538
|
-
init_esbuild_shims();
|
|
539
|
-
var iterate = require_iterate();
|
|
540
|
-
var initState = require_state();
|
|
541
|
-
var terminator = require_terminator();
|
|
542
|
-
module.exports = parallel;
|
|
543
|
-
function parallel(list, iterator2, callback) {
|
|
544
|
-
var state = initState(list);
|
|
545
|
-
while (state.index < (state["keyedList"] || list).length) {
|
|
546
|
-
iterate(list, iterator2, state, function(error, result) {
|
|
547
|
-
if (error) {
|
|
548
|
-
callback(error, result);
|
|
549
|
-
return;
|
|
550
|
-
}
|
|
551
|
-
if (Object.keys(state.jobs).length === 0) {
|
|
552
|
-
callback(null, state.results);
|
|
553
|
-
return;
|
|
554
|
-
}
|
|
555
|
-
});
|
|
556
|
-
state.index++;
|
|
557
|
-
}
|
|
558
|
-
return terminator.bind(state, callback);
|
|
559
|
-
}
|
|
560
|
-
__name(parallel, "parallel");
|
|
561
|
-
}
|
|
562
|
-
});
|
|
563
|
-
|
|
564
|
-
// node_modules/asynckit/serialOrdered.js
|
|
565
|
-
var require_serialOrdered = __commonJS({
|
|
566
|
-
"node_modules/asynckit/serialOrdered.js"(exports, module) {
|
|
567
|
-
init_esbuild_shims();
|
|
568
|
-
var iterate = require_iterate();
|
|
569
|
-
var initState = require_state();
|
|
570
|
-
var terminator = require_terminator();
|
|
571
|
-
module.exports = serialOrdered;
|
|
572
|
-
module.exports.ascending = ascending;
|
|
573
|
-
module.exports.descending = descending;
|
|
574
|
-
function serialOrdered(list, iterator2, sortMethod, callback) {
|
|
575
|
-
var state = initState(list, sortMethod);
|
|
576
|
-
iterate(list, iterator2, state, /* @__PURE__ */ __name(function iteratorHandler(error, result) {
|
|
577
|
-
if (error) {
|
|
578
|
-
callback(error, result);
|
|
579
|
-
return;
|
|
580
|
-
}
|
|
581
|
-
state.index++;
|
|
582
|
-
if (state.index < (state["keyedList"] || list).length) {
|
|
583
|
-
iterate(list, iterator2, state, iteratorHandler);
|
|
584
|
-
return;
|
|
585
|
-
}
|
|
586
|
-
callback(null, state.results);
|
|
587
|
-
}, "iteratorHandler"));
|
|
588
|
-
return terminator.bind(state, callback);
|
|
589
|
-
}
|
|
590
|
-
__name(serialOrdered, "serialOrdered");
|
|
591
|
-
function ascending(a, b) {
|
|
592
|
-
return a < b ? -1 : a > b ? 1 : 0;
|
|
593
|
-
}
|
|
594
|
-
__name(ascending, "ascending");
|
|
595
|
-
function descending(a, b) {
|
|
596
|
-
return -1 * ascending(a, b);
|
|
597
|
-
}
|
|
598
|
-
__name(descending, "descending");
|
|
599
|
-
}
|
|
600
|
-
});
|
|
601
|
-
|
|
602
|
-
// node_modules/asynckit/serial.js
|
|
603
|
-
var require_serial = __commonJS({
|
|
604
|
-
"node_modules/asynckit/serial.js"(exports, module) {
|
|
605
|
-
init_esbuild_shims();
|
|
606
|
-
var serialOrdered = require_serialOrdered();
|
|
607
|
-
module.exports = serial;
|
|
608
|
-
function serial(list, iterator2, callback) {
|
|
609
|
-
return serialOrdered(list, iterator2, null, callback);
|
|
610
|
-
}
|
|
611
|
-
__name(serial, "serial");
|
|
612
|
-
}
|
|
613
|
-
});
|
|
614
|
-
|
|
615
|
-
// node_modules/asynckit/index.js
|
|
616
|
-
var require_asynckit = __commonJS({
|
|
617
|
-
"node_modules/asynckit/index.js"(exports, module) {
|
|
618
|
-
init_esbuild_shims();
|
|
619
|
-
module.exports = {
|
|
620
|
-
parallel: require_parallel(),
|
|
621
|
-
serial: require_serial(),
|
|
622
|
-
serialOrdered: require_serialOrdered()
|
|
623
|
-
};
|
|
624
|
-
}
|
|
625
|
-
});
|
|
626
|
-
|
|
627
|
-
// node_modules/has-tostringtag/shams.js
|
|
628
|
-
var require_shams2 = __commonJS({
|
|
629
|
-
"node_modules/has-tostringtag/shams.js"(exports, module) {
|
|
630
|
-
"use strict";
|
|
631
|
-
init_esbuild_shims();
|
|
632
|
-
var hasSymbols = require_shams();
|
|
633
|
-
module.exports = /* @__PURE__ */ __name(function hasToStringTagShams() {
|
|
634
|
-
return hasSymbols() && !!Symbol.toStringTag;
|
|
635
|
-
}, "hasToStringTagShams");
|
|
636
|
-
}
|
|
637
|
-
});
|
|
638
|
-
|
|
639
|
-
// node_modules/es-set-tostringtag/index.js
|
|
640
|
-
var require_es_set_tostringtag = __commonJS({
|
|
641
|
-
"node_modules/es-set-tostringtag/index.js"(exports, module) {
|
|
642
|
-
"use strict";
|
|
643
|
-
init_esbuild_shims();
|
|
644
|
-
var GetIntrinsic = require_get_intrinsic();
|
|
645
|
-
var $defineProperty = GetIntrinsic("%Object.defineProperty%", true);
|
|
646
|
-
var hasToStringTag = require_shams2()();
|
|
647
|
-
var hasOwn = require_hasown();
|
|
648
|
-
var $TypeError = require_type();
|
|
649
|
-
var toStringTag2 = hasToStringTag ? Symbol.toStringTag : null;
|
|
650
|
-
module.exports = /* @__PURE__ */ __name(function setToStringTag(object, value) {
|
|
651
|
-
var overrideIfSet = arguments.length > 2 && !!arguments[2] && arguments[2].force;
|
|
652
|
-
var nonConfigurable = arguments.length > 2 && !!arguments[2] && arguments[2].nonConfigurable;
|
|
653
|
-
if (typeof overrideIfSet !== "undefined" && typeof overrideIfSet !== "boolean" || typeof nonConfigurable !== "undefined" && typeof nonConfigurable !== "boolean") {
|
|
654
|
-
throw new $TypeError("if provided, the `overrideIfSet` and `nonConfigurable` options must be booleans");
|
|
655
|
-
}
|
|
656
|
-
if (toStringTag2 && (overrideIfSet || !hasOwn(object, toStringTag2))) {
|
|
657
|
-
if ($defineProperty) {
|
|
658
|
-
$defineProperty(object, toStringTag2, {
|
|
659
|
-
configurable: !nonConfigurable,
|
|
660
|
-
enumerable: false,
|
|
661
|
-
value,
|
|
662
|
-
writable: false
|
|
663
|
-
});
|
|
664
|
-
} else {
|
|
665
|
-
object[toStringTag2] = value;
|
|
666
|
-
}
|
|
667
|
-
}
|
|
668
|
-
}, "setToStringTag");
|
|
669
|
-
}
|
|
670
|
-
});
|
|
671
|
-
|
|
672
|
-
// node_modules/form-data/lib/populate.js
|
|
673
|
-
var require_populate = __commonJS({
|
|
674
|
-
"node_modules/form-data/lib/populate.js"(exports, module) {
|
|
675
|
-
"use strict";
|
|
676
|
-
init_esbuild_shims();
|
|
677
|
-
module.exports = function(dst, src) {
|
|
678
|
-
Object.keys(src).forEach(function(prop) {
|
|
679
|
-
dst[prop] = dst[prop] || src[prop];
|
|
680
|
-
});
|
|
681
|
-
return dst;
|
|
682
|
-
};
|
|
683
|
-
}
|
|
684
|
-
});
|
|
685
|
-
|
|
686
|
-
// node_modules/form-data/lib/form_data.js
|
|
687
|
-
var require_form_data = __commonJS({
|
|
688
|
-
"node_modules/form-data/lib/form_data.js"(exports, module) {
|
|
689
|
-
"use strict";
|
|
690
|
-
init_esbuild_shims();
|
|
691
|
-
var CombinedStream = require_combined_stream();
|
|
692
|
-
var util3 = __require("util");
|
|
693
|
-
var path = __require("path");
|
|
694
|
-
var http3 = __require("http");
|
|
695
|
-
var https2 = __require("https");
|
|
696
|
-
var parseUrl = __require("url").parse;
|
|
697
|
-
var fs = __require("fs");
|
|
698
|
-
var Stream = __require("stream").Stream;
|
|
699
|
-
var crypto2 = __require("crypto");
|
|
700
|
-
var mime = require_mime_types();
|
|
701
|
-
var asynckit = require_asynckit();
|
|
702
|
-
var setToStringTag = require_es_set_tostringtag();
|
|
703
|
-
var hasOwn = require_hasown();
|
|
704
|
-
var populate = require_populate();
|
|
705
|
-
function FormData3(options) {
|
|
706
|
-
if (!(this instanceof FormData3)) {
|
|
707
|
-
return new FormData3(options);
|
|
708
|
-
}
|
|
709
|
-
this._overheadLength = 0;
|
|
710
|
-
this._valueLength = 0;
|
|
711
|
-
this._valuesToMeasure = [];
|
|
712
|
-
CombinedStream.call(this);
|
|
713
|
-
options = options || {};
|
|
714
|
-
for (var option in options) {
|
|
715
|
-
this[option] = options[option];
|
|
716
|
-
}
|
|
717
|
-
}
|
|
718
|
-
__name(FormData3, "FormData");
|
|
719
|
-
util3.inherits(FormData3, CombinedStream);
|
|
720
|
-
FormData3.LINE_BREAK = "\r\n";
|
|
721
|
-
FormData3.DEFAULT_CONTENT_TYPE = "application/octet-stream";
|
|
722
|
-
FormData3.prototype.append = function(field, value, options) {
|
|
723
|
-
options = options || {};
|
|
724
|
-
if (typeof options === "string") {
|
|
725
|
-
options = { filename: options };
|
|
726
|
-
}
|
|
727
|
-
var append2 = CombinedStream.prototype.append.bind(this);
|
|
728
|
-
if (typeof value === "number" || value == null) {
|
|
729
|
-
value = String(value);
|
|
730
|
-
}
|
|
731
|
-
if (Array.isArray(value)) {
|
|
732
|
-
this._error(new Error("Arrays are not supported."));
|
|
733
|
-
return;
|
|
734
|
-
}
|
|
735
|
-
var header = this._multiPartHeader(field, value, options);
|
|
736
|
-
var footer = this._multiPartFooter();
|
|
737
|
-
append2(header);
|
|
738
|
-
append2(value);
|
|
739
|
-
append2(footer);
|
|
740
|
-
this._trackLength(header, value, options);
|
|
741
|
-
};
|
|
742
|
-
FormData3.prototype._trackLength = function(header, value, options) {
|
|
743
|
-
var valueLength = 0;
|
|
744
|
-
if (options.knownLength != null) {
|
|
745
|
-
valueLength += Number(options.knownLength);
|
|
746
|
-
} else if (Buffer.isBuffer(value)) {
|
|
747
|
-
valueLength = value.length;
|
|
748
|
-
} else if (typeof value === "string") {
|
|
749
|
-
valueLength = Buffer.byteLength(value);
|
|
750
|
-
}
|
|
751
|
-
this._valueLength += valueLength;
|
|
752
|
-
this._overheadLength += Buffer.byteLength(header) + FormData3.LINE_BREAK.length;
|
|
753
|
-
if (!value || !value.path && !(value.readable && hasOwn(value, "httpVersion")) && !(value instanceof Stream)) {
|
|
754
|
-
return;
|
|
755
|
-
}
|
|
756
|
-
if (!options.knownLength) {
|
|
757
|
-
this._valuesToMeasure.push(value);
|
|
758
|
-
}
|
|
759
|
-
};
|
|
760
|
-
FormData3.prototype._lengthRetriever = function(value, callback) {
|
|
761
|
-
if (hasOwn(value, "fd")) {
|
|
762
|
-
if (value.end != void 0 && value.end != Infinity && value.start != void 0) {
|
|
763
|
-
callback(null, value.end + 1 - (value.start ? value.start : 0));
|
|
764
|
-
} else {
|
|
765
|
-
fs.stat(value.path, function(err, stat) {
|
|
766
|
-
if (err) {
|
|
767
|
-
callback(err);
|
|
768
|
-
return;
|
|
769
|
-
}
|
|
770
|
-
var fileSize = stat.size - (value.start ? value.start : 0);
|
|
771
|
-
callback(null, fileSize);
|
|
772
|
-
});
|
|
773
|
-
}
|
|
774
|
-
} else if (hasOwn(value, "httpVersion")) {
|
|
775
|
-
callback(null, Number(value.headers["content-length"]));
|
|
776
|
-
} else if (hasOwn(value, "httpModule")) {
|
|
777
|
-
value.on("response", function(response) {
|
|
778
|
-
value.pause();
|
|
779
|
-
callback(null, Number(response.headers["content-length"]));
|
|
780
|
-
});
|
|
781
|
-
value.resume();
|
|
782
|
-
} else {
|
|
783
|
-
callback("Unknown stream");
|
|
784
|
-
}
|
|
785
|
-
};
|
|
786
|
-
FormData3.prototype._multiPartHeader = function(field, value, options) {
|
|
787
|
-
if (typeof options.header === "string") {
|
|
788
|
-
return options.header;
|
|
789
|
-
}
|
|
790
|
-
var contentDisposition = this._getContentDisposition(value, options);
|
|
791
|
-
var contentType = this._getContentType(value, options);
|
|
792
|
-
var contents = "";
|
|
793
|
-
var headers = {
|
|
794
|
-
// add custom disposition as third element or keep it two elements if not
|
|
795
|
-
"Content-Disposition": ["form-data", 'name="' + field + '"'].concat(contentDisposition || []),
|
|
796
|
-
// if no content type. allow it to be empty array
|
|
797
|
-
"Content-Type": [].concat(contentType || [])
|
|
798
|
-
};
|
|
799
|
-
if (typeof options.header === "object") {
|
|
800
|
-
populate(headers, options.header);
|
|
801
|
-
}
|
|
802
|
-
var header;
|
|
803
|
-
for (var prop in headers) {
|
|
804
|
-
if (hasOwn(headers, prop)) {
|
|
805
|
-
header = headers[prop];
|
|
806
|
-
if (header == null) {
|
|
807
|
-
continue;
|
|
808
|
-
}
|
|
809
|
-
if (!Array.isArray(header)) {
|
|
810
|
-
header = [header];
|
|
811
|
-
}
|
|
812
|
-
if (header.length) {
|
|
813
|
-
contents += prop + ": " + header.join("; ") + FormData3.LINE_BREAK;
|
|
814
|
-
}
|
|
815
|
-
}
|
|
816
|
-
}
|
|
817
|
-
return "--" + this.getBoundary() + FormData3.LINE_BREAK + contents + FormData3.LINE_BREAK;
|
|
818
|
-
};
|
|
819
|
-
FormData3.prototype._getContentDisposition = function(value, options) {
|
|
820
|
-
var filename;
|
|
821
|
-
if (typeof options.filepath === "string") {
|
|
822
|
-
filename = path.normalize(options.filepath).replace(/\\/g, "/");
|
|
823
|
-
} else if (options.filename || value && (value.name || value.path)) {
|
|
824
|
-
filename = path.basename(options.filename || value && (value.name || value.path));
|
|
825
|
-
} else if (value && value.readable && hasOwn(value, "httpVersion")) {
|
|
826
|
-
filename = path.basename(value.client._httpMessage.path || "");
|
|
827
|
-
}
|
|
828
|
-
if (filename) {
|
|
829
|
-
return 'filename="' + filename + '"';
|
|
830
|
-
}
|
|
831
|
-
};
|
|
832
|
-
FormData3.prototype._getContentType = function(value, options) {
|
|
833
|
-
var contentType = options.contentType;
|
|
834
|
-
if (!contentType && value && value.name) {
|
|
835
|
-
contentType = mime.lookup(value.name);
|
|
836
|
-
}
|
|
837
|
-
if (!contentType && value && value.path) {
|
|
838
|
-
contentType = mime.lookup(value.path);
|
|
839
|
-
}
|
|
840
|
-
if (!contentType && value && value.readable && hasOwn(value, "httpVersion")) {
|
|
841
|
-
contentType = value.headers["content-type"];
|
|
842
|
-
}
|
|
843
|
-
if (!contentType && (options.filepath || options.filename)) {
|
|
844
|
-
contentType = mime.lookup(options.filepath || options.filename);
|
|
845
|
-
}
|
|
846
|
-
if (!contentType && value && typeof value === "object") {
|
|
847
|
-
contentType = FormData3.DEFAULT_CONTENT_TYPE;
|
|
848
|
-
}
|
|
849
|
-
return contentType;
|
|
850
|
-
};
|
|
851
|
-
FormData3.prototype._multiPartFooter = function() {
|
|
852
|
-
return function(next) {
|
|
853
|
-
var footer = FormData3.LINE_BREAK;
|
|
854
|
-
var lastPart = this._streams.length === 0;
|
|
855
|
-
if (lastPart) {
|
|
856
|
-
footer += this._lastBoundary();
|
|
857
|
-
}
|
|
858
|
-
next(footer);
|
|
859
|
-
}.bind(this);
|
|
860
|
-
};
|
|
861
|
-
FormData3.prototype._lastBoundary = function() {
|
|
862
|
-
return "--" + this.getBoundary() + "--" + FormData3.LINE_BREAK;
|
|
863
|
-
};
|
|
864
|
-
FormData3.prototype.getHeaders = function(userHeaders) {
|
|
865
|
-
var header;
|
|
866
|
-
var formHeaders = {
|
|
867
|
-
"content-type": "multipart/form-data; boundary=" + this.getBoundary()
|
|
868
|
-
};
|
|
869
|
-
for (header in userHeaders) {
|
|
870
|
-
if (hasOwn(userHeaders, header)) {
|
|
871
|
-
formHeaders[header.toLowerCase()] = userHeaders[header];
|
|
872
|
-
}
|
|
873
|
-
}
|
|
874
|
-
return formHeaders;
|
|
875
|
-
};
|
|
876
|
-
FormData3.prototype.setBoundary = function(boundary) {
|
|
877
|
-
if (typeof boundary !== "string") {
|
|
878
|
-
throw new TypeError("FormData boundary must be a string");
|
|
879
|
-
}
|
|
880
|
-
this._boundary = boundary;
|
|
881
|
-
};
|
|
882
|
-
FormData3.prototype.getBoundary = function() {
|
|
883
|
-
if (!this._boundary) {
|
|
884
|
-
this._generateBoundary();
|
|
885
|
-
}
|
|
886
|
-
return this._boundary;
|
|
887
|
-
};
|
|
888
|
-
FormData3.prototype.getBuffer = function() {
|
|
889
|
-
var dataBuffer = new Buffer.alloc(0);
|
|
890
|
-
var boundary = this.getBoundary();
|
|
891
|
-
for (var i = 0, len = this._streams.length; i < len; i++) {
|
|
892
|
-
if (typeof this._streams[i] !== "function") {
|
|
893
|
-
if (Buffer.isBuffer(this._streams[i])) {
|
|
894
|
-
dataBuffer = Buffer.concat([dataBuffer, this._streams[i]]);
|
|
895
|
-
} else {
|
|
896
|
-
dataBuffer = Buffer.concat([dataBuffer, Buffer.from(this._streams[i])]);
|
|
897
|
-
}
|
|
898
|
-
if (typeof this._streams[i] !== "string" || this._streams[i].substring(2, boundary.length + 2) !== boundary) {
|
|
899
|
-
dataBuffer = Buffer.concat([dataBuffer, Buffer.from(FormData3.LINE_BREAK)]);
|
|
900
|
-
}
|
|
901
|
-
}
|
|
902
|
-
}
|
|
903
|
-
return Buffer.concat([dataBuffer, Buffer.from(this._lastBoundary())]);
|
|
904
|
-
};
|
|
905
|
-
FormData3.prototype._generateBoundary = function() {
|
|
906
|
-
this._boundary = "--------------------------" + crypto2.randomBytes(12).toString("hex");
|
|
907
|
-
};
|
|
908
|
-
FormData3.prototype.getLengthSync = function() {
|
|
909
|
-
var knownLength = this._overheadLength + this._valueLength;
|
|
910
|
-
if (this._streams.length) {
|
|
911
|
-
knownLength += this._lastBoundary().length;
|
|
912
|
-
}
|
|
913
|
-
if (!this.hasKnownLength()) {
|
|
914
|
-
this._error(new Error("Cannot calculate proper length in synchronous way."));
|
|
915
|
-
}
|
|
916
|
-
return knownLength;
|
|
917
|
-
};
|
|
918
|
-
FormData3.prototype.hasKnownLength = function() {
|
|
919
|
-
var hasKnownLength = true;
|
|
920
|
-
if (this._valuesToMeasure.length) {
|
|
921
|
-
hasKnownLength = false;
|
|
922
|
-
}
|
|
923
|
-
return hasKnownLength;
|
|
924
|
-
};
|
|
925
|
-
FormData3.prototype.getLength = function(cb) {
|
|
926
|
-
var knownLength = this._overheadLength + this._valueLength;
|
|
927
|
-
if (this._streams.length) {
|
|
928
|
-
knownLength += this._lastBoundary().length;
|
|
929
|
-
}
|
|
930
|
-
if (!this._valuesToMeasure.length) {
|
|
931
|
-
process.nextTick(cb.bind(this, null, knownLength));
|
|
932
|
-
return;
|
|
933
|
-
}
|
|
934
|
-
asynckit.parallel(this._valuesToMeasure, this._lengthRetriever, function(err, values) {
|
|
935
|
-
if (err) {
|
|
936
|
-
cb(err);
|
|
937
|
-
return;
|
|
938
|
-
}
|
|
939
|
-
values.forEach(function(length) {
|
|
940
|
-
knownLength += length;
|
|
941
|
-
});
|
|
942
|
-
cb(null, knownLength);
|
|
943
|
-
});
|
|
944
|
-
};
|
|
945
|
-
FormData3.prototype.submit = function(params, cb) {
|
|
946
|
-
var request;
|
|
947
|
-
var options;
|
|
948
|
-
var defaults2 = { method: "post" };
|
|
949
|
-
if (typeof params === "string") {
|
|
950
|
-
params = parseUrl(params);
|
|
951
|
-
options = populate({
|
|
952
|
-
port: params.port,
|
|
953
|
-
path: params.pathname,
|
|
954
|
-
host: params.hostname,
|
|
955
|
-
protocol: params.protocol
|
|
956
|
-
}, defaults2);
|
|
957
|
-
} else {
|
|
958
|
-
options = populate(params, defaults2);
|
|
959
|
-
if (!options.port) {
|
|
960
|
-
options.port = options.protocol === "https:" ? 443 : 80;
|
|
961
|
-
}
|
|
962
|
-
}
|
|
963
|
-
options.headers = this.getHeaders(params.headers);
|
|
964
|
-
if (options.protocol === "https:") {
|
|
965
|
-
request = https2.request(options);
|
|
966
|
-
} else {
|
|
967
|
-
request = http3.request(options);
|
|
968
|
-
}
|
|
969
|
-
this.getLength(function(err, length) {
|
|
970
|
-
if (err && err !== "Unknown stream") {
|
|
971
|
-
this._error(err);
|
|
972
|
-
return;
|
|
973
|
-
}
|
|
974
|
-
if (length) {
|
|
975
|
-
request.setHeader("Content-Length", length);
|
|
976
|
-
}
|
|
977
|
-
this.pipe(request);
|
|
978
|
-
if (cb) {
|
|
979
|
-
var onResponse;
|
|
980
|
-
var callback = /* @__PURE__ */ __name(function(error, responce) {
|
|
981
|
-
request.removeListener("error", callback);
|
|
982
|
-
request.removeListener("response", onResponse);
|
|
983
|
-
return cb.call(this, error, responce);
|
|
984
|
-
}, "callback");
|
|
985
|
-
onResponse = callback.bind(this, null);
|
|
986
|
-
request.on("error", callback);
|
|
987
|
-
request.on("response", onResponse);
|
|
988
|
-
}
|
|
989
|
-
}.bind(this));
|
|
990
|
-
return request;
|
|
991
|
-
};
|
|
992
|
-
FormData3.prototype._error = function(err) {
|
|
993
|
-
if (!this.error) {
|
|
994
|
-
this.error = err;
|
|
995
|
-
this.pause();
|
|
996
|
-
this.emit("error", err);
|
|
997
|
-
}
|
|
998
|
-
};
|
|
999
|
-
FormData3.prototype.toString = function() {
|
|
1000
|
-
return "[object FormData]";
|
|
1001
|
-
};
|
|
1002
|
-
setToStringTag(FormData3.prototype, "FormData");
|
|
1003
|
-
module.exports = FormData3;
|
|
1004
|
-
}
|
|
1005
|
-
});
|
|
1006
|
-
|
|
1007
|
-
// node_modules/proxy-from-env/index.js
|
|
1008
|
-
var require_proxy_from_env = __commonJS({
|
|
1009
|
-
"node_modules/proxy-from-env/index.js"(exports) {
|
|
1010
|
-
"use strict";
|
|
1011
|
-
init_esbuild_shims();
|
|
1012
|
-
var parseUrl = __require("url").parse;
|
|
1013
|
-
var DEFAULT_PORTS = {
|
|
1014
|
-
ftp: 21,
|
|
1015
|
-
gopher: 70,
|
|
1016
|
-
http: 80,
|
|
1017
|
-
https: 443,
|
|
1018
|
-
ws: 80,
|
|
1019
|
-
wss: 443
|
|
1020
|
-
};
|
|
1021
|
-
var stringEndsWith = String.prototype.endsWith || function(s) {
|
|
1022
|
-
return s.length <= this.length && this.indexOf(s, this.length - s.length) !== -1;
|
|
1023
|
-
};
|
|
1024
|
-
function getProxyForUrl(url2) {
|
|
1025
|
-
var parsedUrl = typeof url2 === "string" ? parseUrl(url2) : url2 || {};
|
|
1026
|
-
var proto = parsedUrl.protocol;
|
|
1027
|
-
var hostname = parsedUrl.host;
|
|
1028
|
-
var port = parsedUrl.port;
|
|
1029
|
-
if (typeof hostname !== "string" || !hostname || typeof proto !== "string") {
|
|
1030
|
-
return "";
|
|
1031
|
-
}
|
|
1032
|
-
proto = proto.split(":", 1)[0];
|
|
1033
|
-
hostname = hostname.replace(/:\d*$/, "");
|
|
1034
|
-
port = parseInt(port) || DEFAULT_PORTS[proto] || 0;
|
|
1035
|
-
if (!shouldProxy(hostname, port)) {
|
|
1036
|
-
return "";
|
|
1037
|
-
}
|
|
1038
|
-
var proxy = getEnv("npm_config_" + proto + "_proxy") || getEnv(proto + "_proxy") || getEnv("npm_config_proxy") || getEnv("all_proxy");
|
|
1039
|
-
if (proxy && proxy.indexOf("://") === -1) {
|
|
1040
|
-
proxy = proto + "://" + proxy;
|
|
1041
|
-
}
|
|
1042
|
-
return proxy;
|
|
1043
|
-
}
|
|
1044
|
-
__name(getProxyForUrl, "getProxyForUrl");
|
|
1045
|
-
function shouldProxy(hostname, port) {
|
|
1046
|
-
var NO_PROXY = (getEnv("npm_config_no_proxy") || getEnv("no_proxy")).toLowerCase();
|
|
1047
|
-
if (!NO_PROXY) {
|
|
1048
|
-
return true;
|
|
1049
|
-
}
|
|
1050
|
-
if (NO_PROXY === "*") {
|
|
1051
|
-
return false;
|
|
1052
|
-
}
|
|
1053
|
-
return NO_PROXY.split(/[,\s]/).every(function(proxy) {
|
|
1054
|
-
if (!proxy) {
|
|
1055
|
-
return true;
|
|
1056
|
-
}
|
|
1057
|
-
var parsedProxy = proxy.match(/^(.+):(\d+)$/);
|
|
1058
|
-
var parsedProxyHostname = parsedProxy ? parsedProxy[1] : proxy;
|
|
1059
|
-
var parsedProxyPort = parsedProxy ? parseInt(parsedProxy[2]) : 0;
|
|
1060
|
-
if (parsedProxyPort && parsedProxyPort !== port) {
|
|
1061
|
-
return true;
|
|
1062
|
-
}
|
|
1063
|
-
if (!/^[.*]/.test(parsedProxyHostname)) {
|
|
1064
|
-
return hostname !== parsedProxyHostname;
|
|
1065
|
-
}
|
|
1066
|
-
if (parsedProxyHostname.charAt(0) === "*") {
|
|
1067
|
-
parsedProxyHostname = parsedProxyHostname.slice(1);
|
|
1068
|
-
}
|
|
1069
|
-
return !stringEndsWith.call(hostname, parsedProxyHostname);
|
|
1070
|
-
});
|
|
1071
|
-
}
|
|
1072
|
-
__name(shouldProxy, "shouldProxy");
|
|
1073
|
-
function getEnv(key) {
|
|
1074
|
-
return process.env[key.toLowerCase()] || process.env[key.toUpperCase()] || "";
|
|
1075
|
-
}
|
|
1076
|
-
__name(getEnv, "getEnv");
|
|
1077
|
-
exports.getProxyForUrl = getProxyForUrl;
|
|
1078
|
-
}
|
|
1079
|
-
});
|
|
1080
|
-
|
|
1081
|
-
// node_modules/follow-redirects/debug.js
|
|
1082
|
-
var require_debug = __commonJS({
|
|
1083
|
-
"node_modules/follow-redirects/debug.js"(exports, module) {
|
|
1084
|
-
init_esbuild_shims();
|
|
1085
|
-
var debug;
|
|
1086
|
-
module.exports = function() {
|
|
1087
|
-
if (!debug) {
|
|
1088
|
-
try {
|
|
1089
|
-
debug = require_src()("follow-redirects");
|
|
1090
|
-
} catch (error) {
|
|
1091
|
-
}
|
|
1092
|
-
if (typeof debug !== "function") {
|
|
1093
|
-
debug = /* @__PURE__ */ __name(function() {
|
|
1094
|
-
}, "debug");
|
|
1095
|
-
}
|
|
1096
|
-
}
|
|
1097
|
-
debug.apply(null, arguments);
|
|
1098
|
-
};
|
|
1099
|
-
}
|
|
1100
|
-
});
|
|
1101
|
-
|
|
1102
|
-
// node_modules/follow-redirects/index.js
|
|
1103
|
-
var require_follow_redirects = __commonJS({
|
|
1104
|
-
"node_modules/follow-redirects/index.js"(exports, module) {
|
|
1105
|
-
init_esbuild_shims();
|
|
1106
|
-
var url2 = __require("url");
|
|
1107
|
-
var URL2 = url2.URL;
|
|
1108
|
-
var http3 = __require("http");
|
|
1109
|
-
var https2 = __require("https");
|
|
1110
|
-
var Writable = __require("stream").Writable;
|
|
1111
|
-
var assert = __require("assert");
|
|
1112
|
-
var debug = require_debug();
|
|
1113
|
-
(/* @__PURE__ */ __name(function detectUnsupportedEnvironment() {
|
|
1114
|
-
var looksLikeNode = typeof process !== "undefined";
|
|
1115
|
-
var looksLikeBrowser = typeof window !== "undefined" && typeof document !== "undefined";
|
|
1116
|
-
var looksLikeV8 = isFunction3(Error.captureStackTrace);
|
|
1117
|
-
if (!looksLikeNode && (looksLikeBrowser || !looksLikeV8)) {
|
|
1118
|
-
console.warn("The follow-redirects package should be excluded from browser builds.");
|
|
1119
|
-
}
|
|
1120
|
-
}, "detectUnsupportedEnvironment"))();
|
|
1121
|
-
var useNativeURL = false;
|
|
1122
|
-
try {
|
|
1123
|
-
assert(new URL2(""));
|
|
1124
|
-
} catch (error) {
|
|
1125
|
-
useNativeURL = error.code === "ERR_INVALID_URL";
|
|
1126
|
-
}
|
|
1127
|
-
var preservedUrlFields = [
|
|
1128
|
-
"auth",
|
|
1129
|
-
"host",
|
|
1130
|
-
"hostname",
|
|
1131
|
-
"href",
|
|
1132
|
-
"path",
|
|
1133
|
-
"pathname",
|
|
1134
|
-
"port",
|
|
1135
|
-
"protocol",
|
|
1136
|
-
"query",
|
|
1137
|
-
"search",
|
|
1138
|
-
"hash"
|
|
1139
|
-
];
|
|
1140
|
-
var events = ["abort", "aborted", "connect", "error", "socket", "timeout"];
|
|
1141
|
-
var eventHandlers = /* @__PURE__ */ Object.create(null);
|
|
1142
|
-
events.forEach(function(event) {
|
|
1143
|
-
eventHandlers[event] = function(arg1, arg2, arg3) {
|
|
1144
|
-
this._redirectable.emit(event, arg1, arg2, arg3);
|
|
1145
|
-
};
|
|
1146
|
-
});
|
|
1147
|
-
var InvalidUrlError = createErrorType(
|
|
1148
|
-
"ERR_INVALID_URL",
|
|
1149
|
-
"Invalid URL",
|
|
1150
|
-
TypeError
|
|
1151
|
-
);
|
|
1152
|
-
var RedirectionError = createErrorType(
|
|
1153
|
-
"ERR_FR_REDIRECTION_FAILURE",
|
|
1154
|
-
"Redirected request failed"
|
|
1155
|
-
);
|
|
1156
|
-
var TooManyRedirectsError = createErrorType(
|
|
1157
|
-
"ERR_FR_TOO_MANY_REDIRECTS",
|
|
1158
|
-
"Maximum number of redirects exceeded",
|
|
1159
|
-
RedirectionError
|
|
1160
|
-
);
|
|
1161
|
-
var MaxBodyLengthExceededError = createErrorType(
|
|
1162
|
-
"ERR_FR_MAX_BODY_LENGTH_EXCEEDED",
|
|
1163
|
-
"Request body larger than maxBodyLength limit"
|
|
1164
|
-
);
|
|
1165
|
-
var WriteAfterEndError = createErrorType(
|
|
1166
|
-
"ERR_STREAM_WRITE_AFTER_END",
|
|
1167
|
-
"write after end"
|
|
1168
|
-
);
|
|
1169
|
-
var destroy = Writable.prototype.destroy || noop2;
|
|
1170
|
-
function RedirectableRequest(options, responseCallback) {
|
|
1171
|
-
Writable.call(this);
|
|
1172
|
-
this._sanitizeOptions(options);
|
|
1173
|
-
this._options = options;
|
|
1174
|
-
this._ended = false;
|
|
1175
|
-
this._ending = false;
|
|
1176
|
-
this._redirectCount = 0;
|
|
1177
|
-
this._redirects = [];
|
|
1178
|
-
this._requestBodyLength = 0;
|
|
1179
|
-
this._requestBodyBuffers = [];
|
|
1180
|
-
if (responseCallback) {
|
|
1181
|
-
this.on("response", responseCallback);
|
|
1182
|
-
}
|
|
1183
|
-
var self2 = this;
|
|
1184
|
-
this._onNativeResponse = function(response) {
|
|
1185
|
-
try {
|
|
1186
|
-
self2._processResponse(response);
|
|
1187
|
-
} catch (cause) {
|
|
1188
|
-
self2.emit("error", cause instanceof RedirectionError ? cause : new RedirectionError({ cause }));
|
|
1189
|
-
}
|
|
1190
|
-
};
|
|
1191
|
-
this._performRequest();
|
|
1192
|
-
}
|
|
1193
|
-
__name(RedirectableRequest, "RedirectableRequest");
|
|
1194
|
-
RedirectableRequest.prototype = Object.create(Writable.prototype);
|
|
1195
|
-
RedirectableRequest.prototype.abort = function() {
|
|
1196
|
-
destroyRequest(this._currentRequest);
|
|
1197
|
-
this._currentRequest.abort();
|
|
1198
|
-
this.emit("abort");
|
|
1199
|
-
};
|
|
1200
|
-
RedirectableRequest.prototype.destroy = function(error) {
|
|
1201
|
-
destroyRequest(this._currentRequest, error);
|
|
1202
|
-
destroy.call(this, error);
|
|
1203
|
-
return this;
|
|
1204
|
-
};
|
|
1205
|
-
RedirectableRequest.prototype.write = function(data, encoding, callback) {
|
|
1206
|
-
if (this._ending) {
|
|
1207
|
-
throw new WriteAfterEndError();
|
|
1208
|
-
}
|
|
1209
|
-
if (!isString2(data) && !isBuffer2(data)) {
|
|
1210
|
-
throw new TypeError("data should be a string, Buffer or Uint8Array");
|
|
1211
|
-
}
|
|
1212
|
-
if (isFunction3(encoding)) {
|
|
1213
|
-
callback = encoding;
|
|
1214
|
-
encoding = null;
|
|
1215
|
-
}
|
|
1216
|
-
if (data.length === 0) {
|
|
1217
|
-
if (callback) {
|
|
1218
|
-
callback();
|
|
1219
|
-
}
|
|
1220
|
-
return;
|
|
1221
|
-
}
|
|
1222
|
-
if (this._requestBodyLength + data.length <= this._options.maxBodyLength) {
|
|
1223
|
-
this._requestBodyLength += data.length;
|
|
1224
|
-
this._requestBodyBuffers.push({ data, encoding });
|
|
1225
|
-
this._currentRequest.write(data, encoding, callback);
|
|
1226
|
-
} else {
|
|
1227
|
-
this.emit("error", new MaxBodyLengthExceededError());
|
|
1228
|
-
this.abort();
|
|
1229
|
-
}
|
|
1230
|
-
};
|
|
1231
|
-
RedirectableRequest.prototype.end = function(data, encoding, callback) {
|
|
1232
|
-
if (isFunction3(data)) {
|
|
1233
|
-
callback = data;
|
|
1234
|
-
data = encoding = null;
|
|
1235
|
-
} else if (isFunction3(encoding)) {
|
|
1236
|
-
callback = encoding;
|
|
1237
|
-
encoding = null;
|
|
1238
|
-
}
|
|
1239
|
-
if (!data) {
|
|
1240
|
-
this._ended = this._ending = true;
|
|
1241
|
-
this._currentRequest.end(null, null, callback);
|
|
1242
|
-
} else {
|
|
1243
|
-
var self2 = this;
|
|
1244
|
-
var currentRequest = this._currentRequest;
|
|
1245
|
-
this.write(data, encoding, function() {
|
|
1246
|
-
self2._ended = true;
|
|
1247
|
-
currentRequest.end(null, null, callback);
|
|
1248
|
-
});
|
|
1249
|
-
this._ending = true;
|
|
1250
|
-
}
|
|
1251
|
-
};
|
|
1252
|
-
RedirectableRequest.prototype.setHeader = function(name, value) {
|
|
1253
|
-
this._options.headers[name] = value;
|
|
1254
|
-
this._currentRequest.setHeader(name, value);
|
|
1255
|
-
};
|
|
1256
|
-
RedirectableRequest.prototype.removeHeader = function(name) {
|
|
1257
|
-
delete this._options.headers[name];
|
|
1258
|
-
this._currentRequest.removeHeader(name);
|
|
1259
|
-
};
|
|
1260
|
-
RedirectableRequest.prototype.setTimeout = function(msecs, callback) {
|
|
1261
|
-
var self2 = this;
|
|
1262
|
-
function destroyOnTimeout(socket) {
|
|
1263
|
-
socket.setTimeout(msecs);
|
|
1264
|
-
socket.removeListener("timeout", socket.destroy);
|
|
1265
|
-
socket.addListener("timeout", socket.destroy);
|
|
1266
|
-
}
|
|
1267
|
-
__name(destroyOnTimeout, "destroyOnTimeout");
|
|
1268
|
-
function startTimer(socket) {
|
|
1269
|
-
if (self2._timeout) {
|
|
1270
|
-
clearTimeout(self2._timeout);
|
|
1271
|
-
}
|
|
1272
|
-
self2._timeout = setTimeout(function() {
|
|
1273
|
-
self2.emit("timeout");
|
|
1274
|
-
clearTimer();
|
|
1275
|
-
}, msecs);
|
|
1276
|
-
destroyOnTimeout(socket);
|
|
1277
|
-
}
|
|
1278
|
-
__name(startTimer, "startTimer");
|
|
1279
|
-
function clearTimer() {
|
|
1280
|
-
if (self2._timeout) {
|
|
1281
|
-
clearTimeout(self2._timeout);
|
|
1282
|
-
self2._timeout = null;
|
|
1283
|
-
}
|
|
1284
|
-
self2.removeListener("abort", clearTimer);
|
|
1285
|
-
self2.removeListener("error", clearTimer);
|
|
1286
|
-
self2.removeListener("response", clearTimer);
|
|
1287
|
-
self2.removeListener("close", clearTimer);
|
|
1288
|
-
if (callback) {
|
|
1289
|
-
self2.removeListener("timeout", callback);
|
|
1290
|
-
}
|
|
1291
|
-
if (!self2.socket) {
|
|
1292
|
-
self2._currentRequest.removeListener("socket", startTimer);
|
|
1293
|
-
}
|
|
1294
|
-
}
|
|
1295
|
-
__name(clearTimer, "clearTimer");
|
|
1296
|
-
if (callback) {
|
|
1297
|
-
this.on("timeout", callback);
|
|
1298
|
-
}
|
|
1299
|
-
if (this.socket) {
|
|
1300
|
-
startTimer(this.socket);
|
|
1301
|
-
} else {
|
|
1302
|
-
this._currentRequest.once("socket", startTimer);
|
|
1303
|
-
}
|
|
1304
|
-
this.on("socket", destroyOnTimeout);
|
|
1305
|
-
this.on("abort", clearTimer);
|
|
1306
|
-
this.on("error", clearTimer);
|
|
1307
|
-
this.on("response", clearTimer);
|
|
1308
|
-
this.on("close", clearTimer);
|
|
1309
|
-
return this;
|
|
1310
|
-
};
|
|
1311
|
-
[
|
|
1312
|
-
"flushHeaders",
|
|
1313
|
-
"getHeader",
|
|
1314
|
-
"setNoDelay",
|
|
1315
|
-
"setSocketKeepAlive"
|
|
1316
|
-
].forEach(function(method) {
|
|
1317
|
-
RedirectableRequest.prototype[method] = function(a, b) {
|
|
1318
|
-
return this._currentRequest[method](a, b);
|
|
1319
|
-
};
|
|
1320
|
-
});
|
|
1321
|
-
["aborted", "connection", "socket"].forEach(function(property) {
|
|
1322
|
-
Object.defineProperty(RedirectableRequest.prototype, property, {
|
|
1323
|
-
get: /* @__PURE__ */ __name(function() {
|
|
1324
|
-
return this._currentRequest[property];
|
|
1325
|
-
}, "get")
|
|
1326
|
-
});
|
|
1327
|
-
});
|
|
1328
|
-
RedirectableRequest.prototype._sanitizeOptions = function(options) {
|
|
1329
|
-
if (!options.headers) {
|
|
1330
|
-
options.headers = {};
|
|
1331
|
-
}
|
|
1332
|
-
if (options.host) {
|
|
1333
|
-
if (!options.hostname) {
|
|
1334
|
-
options.hostname = options.host;
|
|
1335
|
-
}
|
|
1336
|
-
delete options.host;
|
|
1337
|
-
}
|
|
1338
|
-
if (!options.pathname && options.path) {
|
|
1339
|
-
var searchPos = options.path.indexOf("?");
|
|
1340
|
-
if (searchPos < 0) {
|
|
1341
|
-
options.pathname = options.path;
|
|
1342
|
-
} else {
|
|
1343
|
-
options.pathname = options.path.substring(0, searchPos);
|
|
1344
|
-
options.search = options.path.substring(searchPos);
|
|
1345
|
-
}
|
|
1346
|
-
}
|
|
1347
|
-
};
|
|
1348
|
-
RedirectableRequest.prototype._performRequest = function() {
|
|
1349
|
-
var protocol = this._options.protocol;
|
|
1350
|
-
var nativeProtocol = this._options.nativeProtocols[protocol];
|
|
1351
|
-
if (!nativeProtocol) {
|
|
1352
|
-
throw new TypeError("Unsupported protocol " + protocol);
|
|
1353
|
-
}
|
|
1354
|
-
if (this._options.agents) {
|
|
1355
|
-
var scheme = protocol.slice(0, -1);
|
|
1356
|
-
this._options.agent = this._options.agents[scheme];
|
|
1357
|
-
}
|
|
1358
|
-
var request = this._currentRequest = nativeProtocol.request(this._options, this._onNativeResponse);
|
|
1359
|
-
request._redirectable = this;
|
|
1360
|
-
for (var event of events) {
|
|
1361
|
-
request.on(event, eventHandlers[event]);
|
|
1362
|
-
}
|
|
1363
|
-
this._currentUrl = /^\//.test(this._options.path) ? url2.format(this._options) : (
|
|
1364
|
-
// When making a request to a proxy, […]
|
|
1365
|
-
// a client MUST send the target URI in absolute-form […].
|
|
1366
|
-
this._options.path
|
|
1367
|
-
);
|
|
1368
|
-
if (this._isRedirect) {
|
|
1369
|
-
var i = 0;
|
|
1370
|
-
var self2 = this;
|
|
1371
|
-
var buffers = this._requestBodyBuffers;
|
|
1372
|
-
(/* @__PURE__ */ __name(function writeNext(error) {
|
|
1373
|
-
if (request === self2._currentRequest) {
|
|
1374
|
-
if (error) {
|
|
1375
|
-
self2.emit("error", error);
|
|
1376
|
-
} else if (i < buffers.length) {
|
|
1377
|
-
var buffer = buffers[i++];
|
|
1378
|
-
if (!request.finished) {
|
|
1379
|
-
request.write(buffer.data, buffer.encoding, writeNext);
|
|
1380
|
-
}
|
|
1381
|
-
} else if (self2._ended) {
|
|
1382
|
-
request.end();
|
|
1383
|
-
}
|
|
1384
|
-
}
|
|
1385
|
-
}, "writeNext"))();
|
|
1386
|
-
}
|
|
1387
|
-
};
|
|
1388
|
-
RedirectableRequest.prototype._processResponse = function(response) {
|
|
1389
|
-
var statusCode = response.statusCode;
|
|
1390
|
-
if (this._options.trackRedirects) {
|
|
1391
|
-
this._redirects.push({
|
|
1392
|
-
url: this._currentUrl,
|
|
1393
|
-
headers: response.headers,
|
|
1394
|
-
statusCode
|
|
1395
|
-
});
|
|
1396
|
-
}
|
|
1397
|
-
var location = response.headers.location;
|
|
1398
|
-
if (!location || this._options.followRedirects === false || statusCode < 300 || statusCode >= 400) {
|
|
1399
|
-
response.responseUrl = this._currentUrl;
|
|
1400
|
-
response.redirects = this._redirects;
|
|
1401
|
-
this.emit("response", response);
|
|
1402
|
-
this._requestBodyBuffers = [];
|
|
1403
|
-
return;
|
|
1404
|
-
}
|
|
1405
|
-
destroyRequest(this._currentRequest);
|
|
1406
|
-
response.destroy();
|
|
1407
|
-
if (++this._redirectCount > this._options.maxRedirects) {
|
|
1408
|
-
throw new TooManyRedirectsError();
|
|
1409
|
-
}
|
|
1410
|
-
var requestHeaders;
|
|
1411
|
-
var beforeRedirect = this._options.beforeRedirect;
|
|
1412
|
-
if (beforeRedirect) {
|
|
1413
|
-
requestHeaders = Object.assign({
|
|
1414
|
-
// The Host header was set by nativeProtocol.request
|
|
1415
|
-
Host: response.req.getHeader("host")
|
|
1416
|
-
}, this._options.headers);
|
|
1417
|
-
}
|
|
1418
|
-
var method = this._options.method;
|
|
1419
|
-
if ((statusCode === 301 || statusCode === 302) && this._options.method === "POST" || // RFC7231§6.4.4: The 303 (See Other) status code indicates that
|
|
1420
|
-
// the server is redirecting the user agent to a different resource […]
|
|
1421
|
-
// A user agent can perform a retrieval request targeting that URI
|
|
1422
|
-
// (a GET or HEAD request if using HTTP) […]
|
|
1423
|
-
statusCode === 303 && !/^(?:GET|HEAD)$/.test(this._options.method)) {
|
|
1424
|
-
this._options.method = "GET";
|
|
1425
|
-
this._requestBodyBuffers = [];
|
|
1426
|
-
removeMatchingHeaders(/^content-/i, this._options.headers);
|
|
1427
|
-
}
|
|
1428
|
-
var currentHostHeader = removeMatchingHeaders(/^host$/i, this._options.headers);
|
|
1429
|
-
var currentUrlParts = parseUrl(this._currentUrl);
|
|
1430
|
-
var currentHost = currentHostHeader || currentUrlParts.host;
|
|
1431
|
-
var currentUrl = /^\w+:/.test(location) ? this._currentUrl : url2.format(Object.assign(currentUrlParts, { host: currentHost }));
|
|
1432
|
-
var redirectUrl = resolveUrl(location, currentUrl);
|
|
1433
|
-
debug("redirecting to", redirectUrl.href);
|
|
1434
|
-
this._isRedirect = true;
|
|
1435
|
-
spreadUrlObject(redirectUrl, this._options);
|
|
1436
|
-
if (redirectUrl.protocol !== currentUrlParts.protocol && redirectUrl.protocol !== "https:" || redirectUrl.host !== currentHost && !isSubdomain(redirectUrl.host, currentHost)) {
|
|
1437
|
-
removeMatchingHeaders(/^(?:(?:proxy-)?authorization|cookie)$/i, this._options.headers);
|
|
1438
|
-
}
|
|
1439
|
-
if (isFunction3(beforeRedirect)) {
|
|
1440
|
-
var responseDetails = {
|
|
1441
|
-
headers: response.headers,
|
|
1442
|
-
statusCode
|
|
1443
|
-
};
|
|
1444
|
-
var requestDetails = {
|
|
1445
|
-
url: currentUrl,
|
|
1446
|
-
method,
|
|
1447
|
-
headers: requestHeaders
|
|
1448
|
-
};
|
|
1449
|
-
beforeRedirect(this._options, responseDetails, requestDetails);
|
|
1450
|
-
this._sanitizeOptions(this._options);
|
|
1451
|
-
}
|
|
1452
|
-
this._performRequest();
|
|
1453
|
-
};
|
|
1454
|
-
function wrap(protocols) {
|
|
1455
|
-
var exports2 = {
|
|
1456
|
-
maxRedirects: 21,
|
|
1457
|
-
maxBodyLength: 10 * 1024 * 1024
|
|
1458
|
-
};
|
|
1459
|
-
var nativeProtocols = {};
|
|
1460
|
-
Object.keys(protocols).forEach(function(scheme) {
|
|
1461
|
-
var protocol = scheme + ":";
|
|
1462
|
-
var nativeProtocol = nativeProtocols[protocol] = protocols[scheme];
|
|
1463
|
-
var wrappedProtocol = exports2[scheme] = Object.create(nativeProtocol);
|
|
1464
|
-
function request(input, options, callback) {
|
|
1465
|
-
if (isURL(input)) {
|
|
1466
|
-
input = spreadUrlObject(input);
|
|
1467
|
-
} else if (isString2(input)) {
|
|
1468
|
-
input = spreadUrlObject(parseUrl(input));
|
|
1469
|
-
} else {
|
|
1470
|
-
callback = options;
|
|
1471
|
-
options = validateUrl(input);
|
|
1472
|
-
input = { protocol };
|
|
1473
|
-
}
|
|
1474
|
-
if (isFunction3(options)) {
|
|
1475
|
-
callback = options;
|
|
1476
|
-
options = null;
|
|
1477
|
-
}
|
|
1478
|
-
options = Object.assign({
|
|
1479
|
-
maxRedirects: exports2.maxRedirects,
|
|
1480
|
-
maxBodyLength: exports2.maxBodyLength
|
|
1481
|
-
}, input, options);
|
|
1482
|
-
options.nativeProtocols = nativeProtocols;
|
|
1483
|
-
if (!isString2(options.host) && !isString2(options.hostname)) {
|
|
1484
|
-
options.hostname = "::1";
|
|
1485
|
-
}
|
|
1486
|
-
assert.equal(options.protocol, protocol, "protocol mismatch");
|
|
1487
|
-
debug("options", options);
|
|
1488
|
-
return new RedirectableRequest(options, callback);
|
|
1489
|
-
}
|
|
1490
|
-
__name(request, "request");
|
|
1491
|
-
function get(input, options, callback) {
|
|
1492
|
-
var wrappedRequest = wrappedProtocol.request(input, options, callback);
|
|
1493
|
-
wrappedRequest.end();
|
|
1494
|
-
return wrappedRequest;
|
|
1495
|
-
}
|
|
1496
|
-
__name(get, "get");
|
|
1497
|
-
Object.defineProperties(wrappedProtocol, {
|
|
1498
|
-
request: { value: request, configurable: true, enumerable: true, writable: true },
|
|
1499
|
-
get: { value: get, configurable: true, enumerable: true, writable: true }
|
|
1500
|
-
});
|
|
1501
|
-
});
|
|
1502
|
-
return exports2;
|
|
1503
|
-
}
|
|
1504
|
-
__name(wrap, "wrap");
|
|
1505
|
-
function noop2() {
|
|
1506
|
-
}
|
|
1507
|
-
__name(noop2, "noop");
|
|
1508
|
-
function parseUrl(input) {
|
|
1509
|
-
var parsed;
|
|
1510
|
-
if (useNativeURL) {
|
|
1511
|
-
parsed = new URL2(input);
|
|
1512
|
-
} else {
|
|
1513
|
-
parsed = validateUrl(url2.parse(input));
|
|
1514
|
-
if (!isString2(parsed.protocol)) {
|
|
1515
|
-
throw new InvalidUrlError({ input });
|
|
1516
|
-
}
|
|
1517
|
-
}
|
|
1518
|
-
return parsed;
|
|
1519
|
-
}
|
|
1520
|
-
__name(parseUrl, "parseUrl");
|
|
1521
|
-
function resolveUrl(relative, base) {
|
|
1522
|
-
return useNativeURL ? new URL2(relative, base) : parseUrl(url2.resolve(base, relative));
|
|
1523
|
-
}
|
|
1524
|
-
__name(resolveUrl, "resolveUrl");
|
|
1525
|
-
function validateUrl(input) {
|
|
1526
|
-
if (/^\[/.test(input.hostname) && !/^\[[:0-9a-f]+\]$/i.test(input.hostname)) {
|
|
1527
|
-
throw new InvalidUrlError({ input: input.href || input });
|
|
1528
|
-
}
|
|
1529
|
-
if (/^\[/.test(input.host) && !/^\[[:0-9a-f]+\](:\d+)?$/i.test(input.host)) {
|
|
1530
|
-
throw new InvalidUrlError({ input: input.href || input });
|
|
1531
|
-
}
|
|
1532
|
-
return input;
|
|
1533
|
-
}
|
|
1534
|
-
__name(validateUrl, "validateUrl");
|
|
1535
|
-
function spreadUrlObject(urlObject, target) {
|
|
1536
|
-
var spread3 = target || {};
|
|
1537
|
-
for (var key of preservedUrlFields) {
|
|
1538
|
-
spread3[key] = urlObject[key];
|
|
1539
|
-
}
|
|
1540
|
-
if (spread3.hostname.startsWith("[")) {
|
|
1541
|
-
spread3.hostname = spread3.hostname.slice(1, -1);
|
|
1542
|
-
}
|
|
1543
|
-
if (spread3.port !== "") {
|
|
1544
|
-
spread3.port = Number(spread3.port);
|
|
1545
|
-
}
|
|
1546
|
-
spread3.path = spread3.search ? spread3.pathname + spread3.search : spread3.pathname;
|
|
1547
|
-
return spread3;
|
|
1548
|
-
}
|
|
1549
|
-
__name(spreadUrlObject, "spreadUrlObject");
|
|
1550
|
-
function removeMatchingHeaders(regex, headers) {
|
|
1551
|
-
var lastValue;
|
|
1552
|
-
for (var header in headers) {
|
|
1553
|
-
if (regex.test(header)) {
|
|
1554
|
-
lastValue = headers[header];
|
|
1555
|
-
delete headers[header];
|
|
1556
|
-
}
|
|
1557
|
-
}
|
|
1558
|
-
return lastValue === null || typeof lastValue === "undefined" ? void 0 : String(lastValue).trim();
|
|
1559
|
-
}
|
|
1560
|
-
__name(removeMatchingHeaders, "removeMatchingHeaders");
|
|
1561
|
-
function createErrorType(code, message, baseClass) {
|
|
1562
|
-
function CustomError(properties) {
|
|
1563
|
-
if (isFunction3(Error.captureStackTrace)) {
|
|
1564
|
-
Error.captureStackTrace(this, this.constructor);
|
|
1565
|
-
}
|
|
1566
|
-
Object.assign(this, properties || {});
|
|
1567
|
-
this.code = code;
|
|
1568
|
-
this.message = this.cause ? message + ": " + this.cause.message : message;
|
|
1569
|
-
}
|
|
1570
|
-
__name(CustomError, "CustomError");
|
|
1571
|
-
CustomError.prototype = new (baseClass || Error)();
|
|
1572
|
-
Object.defineProperties(CustomError.prototype, {
|
|
1573
|
-
constructor: {
|
|
1574
|
-
value: CustomError,
|
|
1575
|
-
enumerable: false
|
|
1576
|
-
},
|
|
1577
|
-
name: {
|
|
1578
|
-
value: "Error [" + code + "]",
|
|
1579
|
-
enumerable: false
|
|
1580
|
-
}
|
|
1581
|
-
});
|
|
1582
|
-
return CustomError;
|
|
1583
|
-
}
|
|
1584
|
-
__name(createErrorType, "createErrorType");
|
|
1585
|
-
function destroyRequest(request, error) {
|
|
1586
|
-
for (var event of events) {
|
|
1587
|
-
request.removeListener(event, eventHandlers[event]);
|
|
1588
|
-
}
|
|
1589
|
-
request.on("error", noop2);
|
|
1590
|
-
request.destroy(error);
|
|
1591
|
-
}
|
|
1592
|
-
__name(destroyRequest, "destroyRequest");
|
|
1593
|
-
function isSubdomain(subdomain, domain) {
|
|
1594
|
-
assert(isString2(subdomain) && isString2(domain));
|
|
1595
|
-
var dot = subdomain.length - domain.length - 1;
|
|
1596
|
-
return dot > 0 && subdomain[dot] === "." && subdomain.endsWith(domain);
|
|
1597
|
-
}
|
|
1598
|
-
__name(isSubdomain, "isSubdomain");
|
|
1599
|
-
function isString2(value) {
|
|
1600
|
-
return typeof value === "string" || value instanceof String;
|
|
1601
|
-
}
|
|
1602
|
-
__name(isString2, "isString");
|
|
1603
|
-
function isFunction3(value) {
|
|
1604
|
-
return typeof value === "function";
|
|
1605
|
-
}
|
|
1606
|
-
__name(isFunction3, "isFunction");
|
|
1607
|
-
function isBuffer2(value) {
|
|
1608
|
-
return typeof value === "object" && "length" in value;
|
|
1609
|
-
}
|
|
1610
|
-
__name(isBuffer2, "isBuffer");
|
|
1611
|
-
function isURL(value) {
|
|
1612
|
-
return URL2 && value instanceof URL2;
|
|
1613
|
-
}
|
|
1614
|
-
__name(isURL, "isURL");
|
|
1615
|
-
module.exports = wrap({ http: http3, https: https2 });
|
|
1616
|
-
module.exports.wrap = wrap;
|
|
1617
|
-
}
|
|
1618
|
-
});
|
|
1619
|
-
|
|
1620
31
|
// packages/channels/dingtalk/dist/index.js
|
|
1621
32
|
init_esbuild_shims();
|
|
1622
33
|
|
|
@@ -6417,13 +4828,3 @@ export {
|
|
|
6417
4828
|
downloadMedia,
|
|
6418
4829
|
plugin
|
|
6419
4830
|
};
|
|
6420
|
-
/*! Bundled license information:
|
|
6421
|
-
|
|
6422
|
-
mime-types/index.js:
|
|
6423
|
-
(*!
|
|
6424
|
-
* mime-types
|
|
6425
|
-
* Copyright(c) 2014 Jonathan Ong
|
|
6426
|
-
* Copyright(c) 2015 Douglas Christopher Wilson
|
|
6427
|
-
* MIT Licensed
|
|
6428
|
-
*)
|
|
6429
|
-
*/
|