@mx-space/api-client 1.2.0 → 1.3.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/controllers/index.ts +4 -0
- package/controllers/subscribe.ts +47 -0
- package/dist/adaptors/axios.global.js +320 -151
- package/dist/index.cjs +33 -0
- package/dist/index.d.ts +42 -3
- package/dist/index.global.js +31 -0
- package/dist/index.js +32 -0
- package/models/subscribe.ts +5 -0
- package/package.json +5 -5
- package/tsconfig.json +4 -1
|
@@ -33,7 +33,7 @@
|
|
|
33
33
|
var require_delayed_stream = __commonJS({
|
|
34
34
|
"../../node_modules/.pnpm/delayed-stream@1.0.0/node_modules/delayed-stream/lib/delayed_stream.js"(exports, module) {
|
|
35
35
|
var Stream = __require("stream").Stream;
|
|
36
|
-
var
|
|
36
|
+
var util2 = __require("util");
|
|
37
37
|
module.exports = DelayedStream;
|
|
38
38
|
function DelayedStream() {
|
|
39
39
|
this.source = null;
|
|
@@ -44,7 +44,7 @@
|
|
|
44
44
|
this._released = false;
|
|
45
45
|
this._bufferedEvents = [];
|
|
46
46
|
}
|
|
47
|
-
|
|
47
|
+
util2.inherits(DelayedStream, Stream);
|
|
48
48
|
DelayedStream.create = function(source, options) {
|
|
49
49
|
var delayedStream = new this();
|
|
50
50
|
options = options || {};
|
|
@@ -123,7 +123,7 @@
|
|
|
123
123
|
// ../../node_modules/.pnpm/combined-stream@1.0.8/node_modules/combined-stream/lib/combined_stream.js
|
|
124
124
|
var require_combined_stream = __commonJS({
|
|
125
125
|
"../../node_modules/.pnpm/combined-stream@1.0.8/node_modules/combined-stream/lib/combined_stream.js"(exports, module) {
|
|
126
|
-
var
|
|
126
|
+
var util2 = __require("util");
|
|
127
127
|
var Stream = __require("stream").Stream;
|
|
128
128
|
var DelayedStream = require_delayed_stream();
|
|
129
129
|
module.exports = CombinedStream;
|
|
@@ -139,7 +139,7 @@
|
|
|
139
139
|
this._insideLoop = false;
|
|
140
140
|
this._pendingNext = false;
|
|
141
141
|
}
|
|
142
|
-
|
|
142
|
+
util2.inherits(CombinedStream, Stream);
|
|
143
143
|
CombinedStream.create = function(options) {
|
|
144
144
|
var combinedStream = new this();
|
|
145
145
|
options = options || {};
|
|
@@ -148,26 +148,26 @@
|
|
|
148
148
|
}
|
|
149
149
|
return combinedStream;
|
|
150
150
|
};
|
|
151
|
-
CombinedStream.isStreamLike = function(
|
|
152
|
-
return typeof
|
|
151
|
+
CombinedStream.isStreamLike = function(stream4) {
|
|
152
|
+
return typeof stream4 !== "function" && typeof stream4 !== "string" && typeof stream4 !== "boolean" && typeof stream4 !== "number" && !Buffer.isBuffer(stream4);
|
|
153
153
|
};
|
|
154
|
-
CombinedStream.prototype.append = function(
|
|
155
|
-
var isStreamLike = CombinedStream.isStreamLike(
|
|
154
|
+
CombinedStream.prototype.append = function(stream4) {
|
|
155
|
+
var isStreamLike = CombinedStream.isStreamLike(stream4);
|
|
156
156
|
if (isStreamLike) {
|
|
157
|
-
if (!(
|
|
158
|
-
var newStream = DelayedStream.create(
|
|
157
|
+
if (!(stream4 instanceof DelayedStream)) {
|
|
158
|
+
var newStream = DelayedStream.create(stream4, {
|
|
159
159
|
maxDataSize: Infinity,
|
|
160
160
|
pauseStream: this.pauseStreams
|
|
161
161
|
});
|
|
162
|
-
|
|
163
|
-
|
|
162
|
+
stream4.on("data", this._checkDataSize.bind(this));
|
|
163
|
+
stream4 = newStream;
|
|
164
164
|
}
|
|
165
|
-
this._handleErrors(
|
|
165
|
+
this._handleErrors(stream4);
|
|
166
166
|
if (this.pauseStreams) {
|
|
167
|
-
|
|
167
|
+
stream4.pause();
|
|
168
168
|
}
|
|
169
169
|
}
|
|
170
|
-
this._streams.push(
|
|
170
|
+
this._streams.push(stream4);
|
|
171
171
|
return this;
|
|
172
172
|
};
|
|
173
173
|
CombinedStream.prototype.pipe = function(dest, options) {
|
|
@@ -192,40 +192,40 @@
|
|
|
192
192
|
}
|
|
193
193
|
};
|
|
194
194
|
CombinedStream.prototype._realGetNext = function() {
|
|
195
|
-
var
|
|
196
|
-
if (typeof
|
|
195
|
+
var stream4 = this._streams.shift();
|
|
196
|
+
if (typeof stream4 == "undefined") {
|
|
197
197
|
this.end();
|
|
198
198
|
return;
|
|
199
199
|
}
|
|
200
|
-
if (typeof
|
|
201
|
-
this._pipeNext(
|
|
200
|
+
if (typeof stream4 !== "function") {
|
|
201
|
+
this._pipeNext(stream4);
|
|
202
202
|
return;
|
|
203
203
|
}
|
|
204
|
-
var getStream =
|
|
205
|
-
getStream(function(
|
|
206
|
-
var isStreamLike = CombinedStream.isStreamLike(
|
|
204
|
+
var getStream = stream4;
|
|
205
|
+
getStream(function(stream5) {
|
|
206
|
+
var isStreamLike = CombinedStream.isStreamLike(stream5);
|
|
207
207
|
if (isStreamLike) {
|
|
208
|
-
|
|
209
|
-
this._handleErrors(
|
|
208
|
+
stream5.on("data", this._checkDataSize.bind(this));
|
|
209
|
+
this._handleErrors(stream5);
|
|
210
210
|
}
|
|
211
|
-
this._pipeNext(
|
|
211
|
+
this._pipeNext(stream5);
|
|
212
212
|
}.bind(this));
|
|
213
213
|
};
|
|
214
|
-
CombinedStream.prototype._pipeNext = function(
|
|
215
|
-
this._currentStream =
|
|
216
|
-
var isStreamLike = CombinedStream.isStreamLike(
|
|
214
|
+
CombinedStream.prototype._pipeNext = function(stream4) {
|
|
215
|
+
this._currentStream = stream4;
|
|
216
|
+
var isStreamLike = CombinedStream.isStreamLike(stream4);
|
|
217
217
|
if (isStreamLike) {
|
|
218
|
-
|
|
219
|
-
|
|
218
|
+
stream4.on("end", this._getNext.bind(this));
|
|
219
|
+
stream4.pipe(this, { end: false });
|
|
220
220
|
return;
|
|
221
221
|
}
|
|
222
|
-
var value =
|
|
222
|
+
var value = stream4;
|
|
223
223
|
this.write(value);
|
|
224
224
|
this._getNext();
|
|
225
225
|
};
|
|
226
|
-
CombinedStream.prototype._handleErrors = function(
|
|
226
|
+
CombinedStream.prototype._handleErrors = function(stream4) {
|
|
227
227
|
var self2 = this;
|
|
228
|
-
|
|
228
|
+
stream4.on("error", function(err) {
|
|
229
229
|
self2._emitError(err);
|
|
230
230
|
});
|
|
231
231
|
};
|
|
@@ -274,11 +274,11 @@
|
|
|
274
274
|
CombinedStream.prototype._updateDataSize = function() {
|
|
275
275
|
this.dataSize = 0;
|
|
276
276
|
var self2 = this;
|
|
277
|
-
this._streams.forEach(function(
|
|
278
|
-
if (!
|
|
277
|
+
this._streams.forEach(function(stream4) {
|
|
278
|
+
if (!stream4.dataSize) {
|
|
279
279
|
return;
|
|
280
280
|
}
|
|
281
|
-
self2.dataSize +=
|
|
281
|
+
self2.dataSize += stream4.dataSize;
|
|
282
282
|
});
|
|
283
283
|
if (this._currentStream && this._currentStream.dataSize) {
|
|
284
284
|
this.dataSize += this._currentStream.dataSize;
|
|
@@ -9139,7 +9139,7 @@
|
|
|
9139
9139
|
var require_form_data = __commonJS({
|
|
9140
9140
|
"../../node_modules/.pnpm/form-data@4.0.0/node_modules/form-data/lib/form_data.js"(exports, module) {
|
|
9141
9141
|
var CombinedStream = require_combined_stream();
|
|
9142
|
-
var
|
|
9142
|
+
var util2 = __require("util");
|
|
9143
9143
|
var path = __require("path");
|
|
9144
9144
|
var http2 = __require("http");
|
|
9145
9145
|
var https2 = __require("https");
|
|
@@ -9149,11 +9149,11 @@
|
|
|
9149
9149
|
var mime = require_mime_types();
|
|
9150
9150
|
var asynckit = require_asynckit();
|
|
9151
9151
|
var populate = require_populate();
|
|
9152
|
-
module.exports =
|
|
9153
|
-
|
|
9154
|
-
function
|
|
9155
|
-
if (!(this instanceof
|
|
9156
|
-
return new
|
|
9152
|
+
module.exports = FormData3;
|
|
9153
|
+
util2.inherits(FormData3, CombinedStream);
|
|
9154
|
+
function FormData3(options) {
|
|
9155
|
+
if (!(this instanceof FormData3)) {
|
|
9156
|
+
return new FormData3(options);
|
|
9157
9157
|
}
|
|
9158
9158
|
this._overheadLength = 0;
|
|
9159
9159
|
this._valueLength = 0;
|
|
@@ -9164,9 +9164,9 @@
|
|
|
9164
9164
|
this[option] = options[option];
|
|
9165
9165
|
}
|
|
9166
9166
|
}
|
|
9167
|
-
|
|
9168
|
-
|
|
9169
|
-
|
|
9167
|
+
FormData3.LINE_BREAK = "\r\n";
|
|
9168
|
+
FormData3.DEFAULT_CONTENT_TYPE = "application/octet-stream";
|
|
9169
|
+
FormData3.prototype.append = function(field, value, options) {
|
|
9170
9170
|
options = options || {};
|
|
9171
9171
|
if (typeof options == "string") {
|
|
9172
9172
|
options = { filename: options };
|
|
@@ -9175,7 +9175,7 @@
|
|
|
9175
9175
|
if (typeof value == "number") {
|
|
9176
9176
|
value = "" + value;
|
|
9177
9177
|
}
|
|
9178
|
-
if (
|
|
9178
|
+
if (util2.isArray(value)) {
|
|
9179
9179
|
this._error(new Error("Arrays are not supported."));
|
|
9180
9180
|
return;
|
|
9181
9181
|
}
|
|
@@ -9186,7 +9186,7 @@
|
|
|
9186
9186
|
append2(footer);
|
|
9187
9187
|
this._trackLength(header, value, options);
|
|
9188
9188
|
};
|
|
9189
|
-
|
|
9189
|
+
FormData3.prototype._trackLength = function(header, value, options) {
|
|
9190
9190
|
var valueLength = 0;
|
|
9191
9191
|
if (options.knownLength != null) {
|
|
9192
9192
|
valueLength += +options.knownLength;
|
|
@@ -9196,7 +9196,7 @@
|
|
|
9196
9196
|
valueLength = Buffer.byteLength(value);
|
|
9197
9197
|
}
|
|
9198
9198
|
this._valueLength += valueLength;
|
|
9199
|
-
this._overheadLength += Buffer.byteLength(header) +
|
|
9199
|
+
this._overheadLength += Buffer.byteLength(header) + FormData3.LINE_BREAK.length;
|
|
9200
9200
|
if (!value || !value.path && !(value.readable && value.hasOwnProperty("httpVersion")) && !(value instanceof Stream)) {
|
|
9201
9201
|
return;
|
|
9202
9202
|
}
|
|
@@ -9204,7 +9204,7 @@
|
|
|
9204
9204
|
this._valuesToMeasure.push(value);
|
|
9205
9205
|
}
|
|
9206
9206
|
};
|
|
9207
|
-
|
|
9207
|
+
FormData3.prototype._lengthRetriever = function(value, callback) {
|
|
9208
9208
|
if (value.hasOwnProperty("fd")) {
|
|
9209
9209
|
if (value.end != void 0 && value.end != Infinity && value.start != void 0) {
|
|
9210
9210
|
callback(null, value.end + 1 - (value.start ? value.start : 0));
|
|
@@ -9231,7 +9231,7 @@
|
|
|
9231
9231
|
callback("Unknown stream");
|
|
9232
9232
|
}
|
|
9233
9233
|
};
|
|
9234
|
-
|
|
9234
|
+
FormData3.prototype._multiPartHeader = function(field, value, options) {
|
|
9235
9235
|
if (typeof options.header == "string") {
|
|
9236
9236
|
return options.header;
|
|
9237
9237
|
}
|
|
@@ -9257,12 +9257,12 @@
|
|
|
9257
9257
|
header = [header];
|
|
9258
9258
|
}
|
|
9259
9259
|
if (header.length) {
|
|
9260
|
-
contents += prop + ": " + header.join("; ") +
|
|
9260
|
+
contents += prop + ": " + header.join("; ") + FormData3.LINE_BREAK;
|
|
9261
9261
|
}
|
|
9262
9262
|
}
|
|
9263
|
-
return "--" + this.getBoundary() +
|
|
9263
|
+
return "--" + this.getBoundary() + FormData3.LINE_BREAK + contents + FormData3.LINE_BREAK;
|
|
9264
9264
|
};
|
|
9265
|
-
|
|
9265
|
+
FormData3.prototype._getContentDisposition = function(value, options) {
|
|
9266
9266
|
var filename, contentDisposition;
|
|
9267
9267
|
if (typeof options.filepath === "string") {
|
|
9268
9268
|
filename = path.normalize(options.filepath).replace(/\\/g, "/");
|
|
@@ -9276,7 +9276,7 @@
|
|
|
9276
9276
|
}
|
|
9277
9277
|
return contentDisposition;
|
|
9278
9278
|
};
|
|
9279
|
-
|
|
9279
|
+
FormData3.prototype._getContentType = function(value, options) {
|
|
9280
9280
|
var contentType = options.contentType;
|
|
9281
9281
|
if (!contentType && value.name) {
|
|
9282
9282
|
contentType = mime.lookup(value.name);
|
|
@@ -9291,13 +9291,13 @@
|
|
|
9291
9291
|
contentType = mime.lookup(options.filepath || options.filename);
|
|
9292
9292
|
}
|
|
9293
9293
|
if (!contentType && typeof value == "object") {
|
|
9294
|
-
contentType =
|
|
9294
|
+
contentType = FormData3.DEFAULT_CONTENT_TYPE;
|
|
9295
9295
|
}
|
|
9296
9296
|
return contentType;
|
|
9297
9297
|
};
|
|
9298
|
-
|
|
9298
|
+
FormData3.prototype._multiPartFooter = function() {
|
|
9299
9299
|
return function(next) {
|
|
9300
|
-
var footer =
|
|
9300
|
+
var footer = FormData3.LINE_BREAK;
|
|
9301
9301
|
var lastPart = this._streams.length === 0;
|
|
9302
9302
|
if (lastPart) {
|
|
9303
9303
|
footer += this._lastBoundary();
|
|
@@ -9305,10 +9305,10 @@
|
|
|
9305
9305
|
next(footer);
|
|
9306
9306
|
}.bind(this);
|
|
9307
9307
|
};
|
|
9308
|
-
|
|
9309
|
-
return "--" + this.getBoundary() + "--" +
|
|
9308
|
+
FormData3.prototype._lastBoundary = function() {
|
|
9309
|
+
return "--" + this.getBoundary() + "--" + FormData3.LINE_BREAK;
|
|
9310
9310
|
};
|
|
9311
|
-
|
|
9311
|
+
FormData3.prototype.getHeaders = function(userHeaders) {
|
|
9312
9312
|
var header;
|
|
9313
9313
|
var formHeaders = {
|
|
9314
9314
|
"content-type": "multipart/form-data; boundary=" + this.getBoundary()
|
|
@@ -9320,16 +9320,16 @@
|
|
|
9320
9320
|
}
|
|
9321
9321
|
return formHeaders;
|
|
9322
9322
|
};
|
|
9323
|
-
|
|
9323
|
+
FormData3.prototype.setBoundary = function(boundary) {
|
|
9324
9324
|
this._boundary = boundary;
|
|
9325
9325
|
};
|
|
9326
|
-
|
|
9326
|
+
FormData3.prototype.getBoundary = function() {
|
|
9327
9327
|
if (!this._boundary) {
|
|
9328
9328
|
this._generateBoundary();
|
|
9329
9329
|
}
|
|
9330
9330
|
return this._boundary;
|
|
9331
9331
|
};
|
|
9332
|
-
|
|
9332
|
+
FormData3.prototype.getBuffer = function() {
|
|
9333
9333
|
var dataBuffer = new Buffer.alloc(0);
|
|
9334
9334
|
var boundary = this.getBoundary();
|
|
9335
9335
|
for (var i = 0, len = this._streams.length; i < len; i++) {
|
|
@@ -9340,20 +9340,20 @@
|
|
|
9340
9340
|
dataBuffer = Buffer.concat([dataBuffer, Buffer.from(this._streams[i])]);
|
|
9341
9341
|
}
|
|
9342
9342
|
if (typeof this._streams[i] !== "string" || this._streams[i].substring(2, boundary.length + 2) !== boundary) {
|
|
9343
|
-
dataBuffer = Buffer.concat([dataBuffer, Buffer.from(
|
|
9343
|
+
dataBuffer = Buffer.concat([dataBuffer, Buffer.from(FormData3.LINE_BREAK)]);
|
|
9344
9344
|
}
|
|
9345
9345
|
}
|
|
9346
9346
|
}
|
|
9347
9347
|
return Buffer.concat([dataBuffer, Buffer.from(this._lastBoundary())]);
|
|
9348
9348
|
};
|
|
9349
|
-
|
|
9349
|
+
FormData3.prototype._generateBoundary = function() {
|
|
9350
9350
|
var boundary = "--------------------------";
|
|
9351
9351
|
for (var i = 0; i < 24; i++) {
|
|
9352
9352
|
boundary += Math.floor(Math.random() * 10).toString(16);
|
|
9353
9353
|
}
|
|
9354
9354
|
this._boundary = boundary;
|
|
9355
9355
|
};
|
|
9356
|
-
|
|
9356
|
+
FormData3.prototype.getLengthSync = function() {
|
|
9357
9357
|
var knownLength = this._overheadLength + this._valueLength;
|
|
9358
9358
|
if (this._streams.length) {
|
|
9359
9359
|
knownLength += this._lastBoundary().length;
|
|
@@ -9363,14 +9363,14 @@
|
|
|
9363
9363
|
}
|
|
9364
9364
|
return knownLength;
|
|
9365
9365
|
};
|
|
9366
|
-
|
|
9366
|
+
FormData3.prototype.hasKnownLength = function() {
|
|
9367
9367
|
var hasKnownLength = true;
|
|
9368
9368
|
if (this._valuesToMeasure.length) {
|
|
9369
9369
|
hasKnownLength = false;
|
|
9370
9370
|
}
|
|
9371
9371
|
return hasKnownLength;
|
|
9372
9372
|
};
|
|
9373
|
-
|
|
9373
|
+
FormData3.prototype.getLength = function(cb) {
|
|
9374
9374
|
var knownLength = this._overheadLength + this._valueLength;
|
|
9375
9375
|
if (this._streams.length) {
|
|
9376
9376
|
knownLength += this._lastBoundary().length;
|
|
@@ -9390,7 +9390,7 @@
|
|
|
9390
9390
|
cb(null, knownLength);
|
|
9391
9391
|
});
|
|
9392
9392
|
};
|
|
9393
|
-
|
|
9393
|
+
FormData3.prototype.submit = function(params, cb) {
|
|
9394
9394
|
var request, options, defaults2 = { method: "post" };
|
|
9395
9395
|
if (typeof params == "string") {
|
|
9396
9396
|
params = parseUrl(params);
|
|
@@ -9435,14 +9435,14 @@
|
|
|
9435
9435
|
}.bind(this));
|
|
9436
9436
|
return request;
|
|
9437
9437
|
};
|
|
9438
|
-
|
|
9438
|
+
FormData3.prototype._error = function(err) {
|
|
9439
9439
|
if (!this.error) {
|
|
9440
9440
|
this.error = err;
|
|
9441
9441
|
this.pause();
|
|
9442
9442
|
this.emit("error", err);
|
|
9443
9443
|
}
|
|
9444
9444
|
};
|
|
9445
|
-
|
|
9445
|
+
FormData3.prototype.toString = function() {
|
|
9446
9446
|
return "[object FormData]";
|
|
9447
9447
|
};
|
|
9448
9448
|
}
|
|
@@ -10065,8 +10065,8 @@
|
|
|
10065
10065
|
}
|
|
10066
10066
|
return min;
|
|
10067
10067
|
}
|
|
10068
|
-
function getSupportLevel(
|
|
10069
|
-
const level = supportsColor(
|
|
10068
|
+
function getSupportLevel(stream4) {
|
|
10069
|
+
const level = supportsColor(stream4, stream4 && stream4.isTTY);
|
|
10070
10070
|
return translateLevel(level);
|
|
10071
10071
|
}
|
|
10072
10072
|
module.exports = {
|
|
@@ -10081,14 +10081,14 @@
|
|
|
10081
10081
|
var require_node = __commonJS({
|
|
10082
10082
|
"../../node_modules/.pnpm/debug@4.3.4/node_modules/debug/src/node.js"(exports, module) {
|
|
10083
10083
|
var tty = __require("tty");
|
|
10084
|
-
var
|
|
10084
|
+
var util2 = __require("util");
|
|
10085
10085
|
exports.init = init;
|
|
10086
10086
|
exports.log = log;
|
|
10087
10087
|
exports.formatArgs = formatArgs;
|
|
10088
10088
|
exports.save = save;
|
|
10089
10089
|
exports.load = load;
|
|
10090
10090
|
exports.useColors = useColors;
|
|
10091
|
-
exports.destroy =
|
|
10091
|
+
exports.destroy = util2.deprecate(
|
|
10092
10092
|
() => {
|
|
10093
10093
|
},
|
|
10094
10094
|
"Instance method `debug.destroy()` is deprecated and no longer does anything. It will be removed in the next major version of `debug`."
|
|
@@ -10219,7 +10219,7 @@
|
|
|
10219
10219
|
return new Date().toISOString() + " ";
|
|
10220
10220
|
}
|
|
10221
10221
|
function log(...args) {
|
|
10222
|
-
return process.stderr.write(
|
|
10222
|
+
return process.stderr.write(util2.format(...args) + "\n");
|
|
10223
10223
|
}
|
|
10224
10224
|
function save(namespaces) {
|
|
10225
10225
|
if (namespaces) {
|
|
@@ -10242,11 +10242,11 @@
|
|
|
10242
10242
|
var { formatters } = module.exports;
|
|
10243
10243
|
formatters.o = function(v) {
|
|
10244
10244
|
this.inspectOpts.colors = this.useColors;
|
|
10245
|
-
return
|
|
10245
|
+
return util2.inspect(v, this.inspectOpts).split("\n").map((str) => str.trim()).join(" ");
|
|
10246
10246
|
};
|
|
10247
10247
|
formatters.O = function(v) {
|
|
10248
10248
|
this.inspectOpts.colors = this.useColors;
|
|
10249
|
-
return
|
|
10249
|
+
return util2.inspect(v, this.inspectOpts);
|
|
10250
10250
|
};
|
|
10251
10251
|
}
|
|
10252
10252
|
});
|
|
@@ -10719,14 +10719,14 @@
|
|
|
10719
10719
|
}
|
|
10720
10720
|
});
|
|
10721
10721
|
|
|
10722
|
-
// ../../node_modules/.pnpm/axios@1.
|
|
10722
|
+
// ../../node_modules/.pnpm/axios@1.3.1/node_modules/axios/lib/helpers/bind.js
|
|
10723
10723
|
function bind(fn, thisArg) {
|
|
10724
10724
|
return function wrap() {
|
|
10725
10725
|
return fn.apply(thisArg, arguments);
|
|
10726
10726
|
};
|
|
10727
10727
|
}
|
|
10728
10728
|
|
|
10729
|
-
// ../../node_modules/.pnpm/axios@1.
|
|
10729
|
+
// ../../node_modules/.pnpm/axios@1.3.1/node_modules/axios/lib/utils.js
|
|
10730
10730
|
var { toString } = Object.prototype;
|
|
10731
10731
|
var { getPrototypeOf } = Object;
|
|
10732
10732
|
var kindOf = ((cache) => (thing) => {
|
|
@@ -10932,7 +10932,7 @@
|
|
|
10932
10932
|
var isHTMLForm = kindOfTest("HTMLFormElement");
|
|
10933
10933
|
var toCamelCase = (str) => {
|
|
10934
10934
|
return str.toLowerCase().replace(
|
|
10935
|
-
/[_
|
|
10935
|
+
/[-_\s]([a-z\d])(\w*)/g,
|
|
10936
10936
|
function replacer(m, p1, p2) {
|
|
10937
10937
|
return p1.toUpperCase() + p2;
|
|
10938
10938
|
}
|
|
@@ -10986,6 +10986,24 @@
|
|
|
10986
10986
|
value = +value;
|
|
10987
10987
|
return Number.isFinite(value) ? value : defaultValue;
|
|
10988
10988
|
};
|
|
10989
|
+
var ALPHA = "abcdefghijklmnopqrstuvwxyz";
|
|
10990
|
+
var DIGIT = "0123456789";
|
|
10991
|
+
var ALPHABET = {
|
|
10992
|
+
DIGIT,
|
|
10993
|
+
ALPHA,
|
|
10994
|
+
ALPHA_DIGIT: ALPHA + ALPHA.toUpperCase() + DIGIT
|
|
10995
|
+
};
|
|
10996
|
+
var generateString = (size = 16, alphabet = ALPHABET.ALPHA_DIGIT) => {
|
|
10997
|
+
let str = "";
|
|
10998
|
+
const { length } = alphabet;
|
|
10999
|
+
while (size--) {
|
|
11000
|
+
str += alphabet[Math.random() * length | 0];
|
|
11001
|
+
}
|
|
11002
|
+
return str;
|
|
11003
|
+
};
|
|
11004
|
+
function isSpecCompliantForm(thing) {
|
|
11005
|
+
return !!(thing && isFunction(thing.append) && thing[Symbol.toStringTag] === "FormData" && thing[Symbol.iterator]);
|
|
11006
|
+
}
|
|
10989
11007
|
var toJSONObject = (obj) => {
|
|
10990
11008
|
const stack = new Array(10);
|
|
10991
11009
|
const visit = (source, i) => {
|
|
@@ -11054,10 +11072,13 @@
|
|
|
11054
11072
|
findKey,
|
|
11055
11073
|
global: _global,
|
|
11056
11074
|
isContextDefined,
|
|
11075
|
+
ALPHABET,
|
|
11076
|
+
generateString,
|
|
11077
|
+
isSpecCompliantForm,
|
|
11057
11078
|
toJSONObject
|
|
11058
11079
|
};
|
|
11059
11080
|
|
|
11060
|
-
// ../../node_modules/.pnpm/axios@1.
|
|
11081
|
+
// ../../node_modules/.pnpm/axios@1.3.1/node_modules/axios/lib/core/AxiosError.js
|
|
11061
11082
|
function AxiosError(message, code, config, request, response) {
|
|
11062
11083
|
Error.call(this);
|
|
11063
11084
|
if (Error.captureStackTrace) {
|
|
@@ -11124,11 +11145,11 @@
|
|
|
11124
11145
|
};
|
|
11125
11146
|
var AxiosError_default = AxiosError;
|
|
11126
11147
|
|
|
11127
|
-
// ../../node_modules/.pnpm/axios@1.
|
|
11148
|
+
// ../../node_modules/.pnpm/axios@1.3.1/node_modules/axios/lib/platform/node/classes/FormData.js
|
|
11128
11149
|
var import_form_data = __toESM(require_form_data(), 1);
|
|
11129
11150
|
var FormData_default = import_form_data.default;
|
|
11130
11151
|
|
|
11131
|
-
// ../../node_modules/.pnpm/axios@1.
|
|
11152
|
+
// ../../node_modules/.pnpm/axios@1.3.1/node_modules/axios/lib/helpers/toFormData.js
|
|
11132
11153
|
function isVisitable(thing) {
|
|
11133
11154
|
return utils_default.isPlainObject(thing) || utils_default.isArray(thing);
|
|
11134
11155
|
}
|
|
@@ -11149,9 +11170,6 @@
|
|
|
11149
11170
|
var predicates = utils_default.toFlatObject(utils_default, {}, null, function filter(prop) {
|
|
11150
11171
|
return /^is[A-Z]/.test(prop);
|
|
11151
11172
|
});
|
|
11152
|
-
function isSpecCompliant(thing) {
|
|
11153
|
-
return thing && utils_default.isFunction(thing.append) && thing[Symbol.toStringTag] === "FormData" && thing[Symbol.iterator];
|
|
11154
|
-
}
|
|
11155
11173
|
function toFormData(obj, formData, options) {
|
|
11156
11174
|
if (!utils_default.isObject(obj)) {
|
|
11157
11175
|
throw new TypeError("target must be an object");
|
|
@@ -11169,7 +11187,7 @@
|
|
|
11169
11187
|
const dots = options.dots;
|
|
11170
11188
|
const indexes = options.indexes;
|
|
11171
11189
|
const _Blob = options.Blob || typeof Blob !== "undefined" && Blob;
|
|
11172
|
-
const useBlob = _Blob &&
|
|
11190
|
+
const useBlob = _Blob && utils_default.isSpecCompliantForm(formData);
|
|
11173
11191
|
if (!utils_default.isFunction(visitor)) {
|
|
11174
11192
|
throw new TypeError("visitor must be a function");
|
|
11175
11193
|
}
|
|
@@ -11193,7 +11211,7 @@
|
|
|
11193
11211
|
if (utils_default.endsWith(key, "{}")) {
|
|
11194
11212
|
key = metaTokens ? key : key.slice(0, -2);
|
|
11195
11213
|
value = JSON.stringify(value);
|
|
11196
|
-
} else if (utils_default.isArray(value) && isFlatArray(value) || (utils_default.isFileList(value) || utils_default.endsWith(key, "[]") && (arr = utils_default.toArray(value)))
|
|
11214
|
+
} else if (utils_default.isArray(value) && isFlatArray(value) || (utils_default.isFileList(value) || utils_default.endsWith(key, "[]")) && (arr = utils_default.toArray(value))) {
|
|
11197
11215
|
key = removeBrackets(key);
|
|
11198
11216
|
arr.forEach(function each(el, index) {
|
|
11199
11217
|
!(utils_default.isUndefined(el) || el === null) && formData.append(
|
|
@@ -11245,7 +11263,7 @@
|
|
|
11245
11263
|
}
|
|
11246
11264
|
var toFormData_default = toFormData;
|
|
11247
11265
|
|
|
11248
|
-
// ../../node_modules/.pnpm/axios@1.
|
|
11266
|
+
// ../../node_modules/.pnpm/axios@1.3.1/node_modules/axios/lib/helpers/AxiosURLSearchParams.js
|
|
11249
11267
|
function encode(str) {
|
|
11250
11268
|
const charMap = {
|
|
11251
11269
|
"!": "%21",
|
|
@@ -11278,7 +11296,7 @@
|
|
|
11278
11296
|
};
|
|
11279
11297
|
var AxiosURLSearchParams_default = AxiosURLSearchParams;
|
|
11280
11298
|
|
|
11281
|
-
// ../../node_modules/.pnpm/axios@1.
|
|
11299
|
+
// ../../node_modules/.pnpm/axios@1.3.1/node_modules/axios/lib/helpers/buildURL.js
|
|
11282
11300
|
function encode2(val) {
|
|
11283
11301
|
return encodeURIComponent(val).replace(/%3A/gi, ":").replace(/%24/g, "$").replace(/%2C/gi, ",").replace(/%20/g, "+").replace(/%5B/gi, "[").replace(/%5D/gi, "]");
|
|
11284
11302
|
}
|
|
@@ -11304,7 +11322,7 @@
|
|
|
11304
11322
|
return url2;
|
|
11305
11323
|
}
|
|
11306
11324
|
|
|
11307
|
-
// ../../node_modules/.pnpm/axios@1.
|
|
11325
|
+
// ../../node_modules/.pnpm/axios@1.3.1/node_modules/axios/lib/core/InterceptorManager.js
|
|
11308
11326
|
var InterceptorManager = class {
|
|
11309
11327
|
constructor() {
|
|
11310
11328
|
this.handlers = [];
|
|
@@ -11338,33 +11356,29 @@
|
|
|
11338
11356
|
};
|
|
11339
11357
|
var InterceptorManager_default = InterceptorManager;
|
|
11340
11358
|
|
|
11341
|
-
// ../../node_modules/.pnpm/axios@1.
|
|
11359
|
+
// ../../node_modules/.pnpm/axios@1.3.1/node_modules/axios/lib/defaults/transitional.js
|
|
11342
11360
|
var transitional_default = {
|
|
11343
11361
|
silentJSONParsing: true,
|
|
11344
11362
|
forcedJSONParsing: true,
|
|
11345
11363
|
clarifyTimeoutError: false
|
|
11346
11364
|
};
|
|
11347
11365
|
|
|
11348
|
-
// ../../node_modules/.pnpm/axios@1.
|
|
11366
|
+
// ../../node_modules/.pnpm/axios@1.3.1/node_modules/axios/lib/platform/node/classes/URLSearchParams.js
|
|
11349
11367
|
var import_url = __toESM(__require("url"), 1);
|
|
11350
11368
|
var URLSearchParams_default = import_url.default.URLSearchParams;
|
|
11351
11369
|
|
|
11352
|
-
// ../../node_modules/.pnpm/axios@1.
|
|
11353
|
-
var import_form_data2 = __toESM(require_form_data(), 1);
|
|
11354
|
-
var FormData_default2 = import_form_data2.default;
|
|
11355
|
-
|
|
11356
|
-
// ../../node_modules/.pnpm/axios@1.2.2/node_modules/axios/lib/platform/node/index.js
|
|
11370
|
+
// ../../node_modules/.pnpm/axios@1.3.1/node_modules/axios/lib/platform/node/index.js
|
|
11357
11371
|
var node_default = {
|
|
11358
11372
|
isNode: true,
|
|
11359
11373
|
classes: {
|
|
11360
11374
|
URLSearchParams: URLSearchParams_default,
|
|
11361
|
-
FormData:
|
|
11375
|
+
FormData: FormData_default,
|
|
11362
11376
|
Blob: typeof Blob !== "undefined" && Blob || null
|
|
11363
11377
|
},
|
|
11364
11378
|
protocols: ["http", "https", "file", "data"]
|
|
11365
11379
|
};
|
|
11366
11380
|
|
|
11367
|
-
// ../../node_modules/.pnpm/axios@1.
|
|
11381
|
+
// ../../node_modules/.pnpm/axios@1.3.1/node_modules/axios/lib/helpers/toURLEncodedForm.js
|
|
11368
11382
|
function toURLEncodedForm(data, options) {
|
|
11369
11383
|
return toFormData_default(data, new node_default.classes.URLSearchParams(), Object.assign({
|
|
11370
11384
|
visitor: function(value, key, path, helpers) {
|
|
@@ -11377,7 +11391,7 @@
|
|
|
11377
11391
|
}, options));
|
|
11378
11392
|
}
|
|
11379
11393
|
|
|
11380
|
-
// ../../node_modules/.pnpm/axios@1.
|
|
11394
|
+
// ../../node_modules/.pnpm/axios@1.3.1/node_modules/axios/lib/helpers/formDataToJSON.js
|
|
11381
11395
|
function parsePropPath(name) {
|
|
11382
11396
|
return utils_default.matchAll(/\w+|\[(\w*)]/g, name).map((match) => {
|
|
11383
11397
|
return match[0] === "[]" ? "" : match[1] || match[0];
|
|
@@ -11429,7 +11443,7 @@
|
|
|
11429
11443
|
}
|
|
11430
11444
|
var formDataToJSON_default = formDataToJSON;
|
|
11431
11445
|
|
|
11432
|
-
// ../../node_modules/.pnpm/axios@1.
|
|
11446
|
+
// ../../node_modules/.pnpm/axios@1.3.1/node_modules/axios/lib/defaults/index.js
|
|
11433
11447
|
var DEFAULT_CONTENT_TYPE = {
|
|
11434
11448
|
"Content-Type": void 0
|
|
11435
11449
|
};
|
|
@@ -11539,7 +11553,7 @@
|
|
|
11539
11553
|
});
|
|
11540
11554
|
var defaults_default = defaults;
|
|
11541
11555
|
|
|
11542
|
-
// ../../node_modules/.pnpm/axios@1.
|
|
11556
|
+
// ../../node_modules/.pnpm/axios@1.3.1/node_modules/axios/lib/helpers/parseHeaders.js
|
|
11543
11557
|
var ignoreDuplicateOf = utils_default.toObjectSet([
|
|
11544
11558
|
"age",
|
|
11545
11559
|
"authorization",
|
|
@@ -11584,7 +11598,7 @@
|
|
|
11584
11598
|
return parsed;
|
|
11585
11599
|
};
|
|
11586
11600
|
|
|
11587
|
-
// ../../node_modules/.pnpm/axios@1.
|
|
11601
|
+
// ../../node_modules/.pnpm/axios@1.3.1/node_modules/axios/lib/core/AxiosHeaders.js
|
|
11588
11602
|
var $internals = Symbol("internals");
|
|
11589
11603
|
function normalizeHeader(header) {
|
|
11590
11604
|
return header && String(header).trim().toLowerCase();
|
|
@@ -11688,7 +11702,7 @@
|
|
|
11688
11702
|
header = normalizeHeader(header);
|
|
11689
11703
|
if (header) {
|
|
11690
11704
|
const key = utils_default.findKey(this, header);
|
|
11691
|
-
return !!(key && (!matcher || matchHeaderValue(this, this[key], key, matcher)));
|
|
11705
|
+
return !!(key && this[key] !== void 0 && (!matcher || matchHeaderValue(this, this[key], key, matcher)));
|
|
11692
11706
|
}
|
|
11693
11707
|
return false;
|
|
11694
11708
|
}
|
|
@@ -11712,8 +11726,18 @@
|
|
|
11712
11726
|
}
|
|
11713
11727
|
return deleted;
|
|
11714
11728
|
}
|
|
11715
|
-
clear() {
|
|
11716
|
-
|
|
11729
|
+
clear(matcher) {
|
|
11730
|
+
const keys = Object.keys(this);
|
|
11731
|
+
let i = keys.length;
|
|
11732
|
+
let deleted = false;
|
|
11733
|
+
while (i--) {
|
|
11734
|
+
const key = keys[i];
|
|
11735
|
+
if (!matcher || matchHeaderValue(this, this[key], key, matcher)) {
|
|
11736
|
+
delete this[key];
|
|
11737
|
+
deleted = true;
|
|
11738
|
+
}
|
|
11739
|
+
}
|
|
11740
|
+
return deleted;
|
|
11717
11741
|
}
|
|
11718
11742
|
normalize(format) {
|
|
11719
11743
|
const self2 = this;
|
|
@@ -11778,12 +11802,12 @@
|
|
|
11778
11802
|
return this;
|
|
11779
11803
|
}
|
|
11780
11804
|
};
|
|
11781
|
-
AxiosHeaders.accessor(["Content-Type", "Content-Length", "Accept", "Accept-Encoding", "User-Agent"]);
|
|
11805
|
+
AxiosHeaders.accessor(["Content-Type", "Content-Length", "Accept", "Accept-Encoding", "User-Agent", "Authorization"]);
|
|
11782
11806
|
utils_default.freezeMethods(AxiosHeaders.prototype);
|
|
11783
11807
|
utils_default.freezeMethods(AxiosHeaders);
|
|
11784
11808
|
var AxiosHeaders_default = AxiosHeaders;
|
|
11785
11809
|
|
|
11786
|
-
// ../../node_modules/.pnpm/axios@1.
|
|
11810
|
+
// ../../node_modules/.pnpm/axios@1.3.1/node_modules/axios/lib/core/transformData.js
|
|
11787
11811
|
function transformData(fns, response) {
|
|
11788
11812
|
const config = this || defaults_default;
|
|
11789
11813
|
const context = response || config;
|
|
@@ -11796,12 +11820,12 @@
|
|
|
11796
11820
|
return data;
|
|
11797
11821
|
}
|
|
11798
11822
|
|
|
11799
|
-
// ../../node_modules/.pnpm/axios@1.
|
|
11823
|
+
// ../../node_modules/.pnpm/axios@1.3.1/node_modules/axios/lib/cancel/isCancel.js
|
|
11800
11824
|
function isCancel(value) {
|
|
11801
11825
|
return !!(value && value.__CANCEL__);
|
|
11802
11826
|
}
|
|
11803
11827
|
|
|
11804
|
-
// ../../node_modules/.pnpm/axios@1.
|
|
11828
|
+
// ../../node_modules/.pnpm/axios@1.3.1/node_modules/axios/lib/cancel/CanceledError.js
|
|
11805
11829
|
function CanceledError(message, config, request) {
|
|
11806
11830
|
AxiosError_default.call(this, message == null ? "canceled" : message, AxiosError_default.ERR_CANCELED, config, request);
|
|
11807
11831
|
this.name = "CanceledError";
|
|
@@ -11811,7 +11835,7 @@
|
|
|
11811
11835
|
});
|
|
11812
11836
|
var CanceledError_default = CanceledError;
|
|
11813
11837
|
|
|
11814
|
-
// ../../node_modules/.pnpm/axios@1.
|
|
11838
|
+
// ../../node_modules/.pnpm/axios@1.3.1/node_modules/axios/lib/core/settle.js
|
|
11815
11839
|
function settle(resolve, reject, response) {
|
|
11816
11840
|
const validateStatus2 = response.config.validateStatus;
|
|
11817
11841
|
if (!response.status || !validateStatus2 || validateStatus2(response.status)) {
|
|
@@ -11827,17 +11851,17 @@
|
|
|
11827
11851
|
}
|
|
11828
11852
|
}
|
|
11829
11853
|
|
|
11830
|
-
// ../../node_modules/.pnpm/axios@1.
|
|
11854
|
+
// ../../node_modules/.pnpm/axios@1.3.1/node_modules/axios/lib/helpers/isAbsoluteURL.js
|
|
11831
11855
|
function isAbsoluteURL(url2) {
|
|
11832
11856
|
return /^([a-z][a-z\d+\-.]*:)?\/\//i.test(url2);
|
|
11833
11857
|
}
|
|
11834
11858
|
|
|
11835
|
-
// ../../node_modules/.pnpm/axios@1.
|
|
11859
|
+
// ../../node_modules/.pnpm/axios@1.3.1/node_modules/axios/lib/helpers/combineURLs.js
|
|
11836
11860
|
function combineURLs(baseURL, relativeURL) {
|
|
11837
11861
|
return relativeURL ? baseURL.replace(/\/+$/, "") + "/" + relativeURL.replace(/^\/+/, "") : baseURL;
|
|
11838
11862
|
}
|
|
11839
11863
|
|
|
11840
|
-
// ../../node_modules/.pnpm/axios@1.
|
|
11864
|
+
// ../../node_modules/.pnpm/axios@1.3.1/node_modules/axios/lib/core/buildFullPath.js
|
|
11841
11865
|
function buildFullPath(baseURL, requestedURL) {
|
|
11842
11866
|
if (baseURL && !isAbsoluteURL(requestedURL)) {
|
|
11843
11867
|
return combineURLs(baseURL, requestedURL);
|
|
@@ -11845,23 +11869,24 @@
|
|
|
11845
11869
|
return requestedURL;
|
|
11846
11870
|
}
|
|
11847
11871
|
|
|
11848
|
-
// ../../node_modules/.pnpm/axios@1.
|
|
11872
|
+
// ../../node_modules/.pnpm/axios@1.3.1/node_modules/axios/lib/adapters/http.js
|
|
11849
11873
|
var import_proxy_from_env = __toESM(require_proxy_from_env(), 1);
|
|
11850
11874
|
var import_http = __toESM(__require("http"), 1);
|
|
11851
11875
|
var import_https = __toESM(__require("https"), 1);
|
|
11876
|
+
var import_util = __toESM(__require("util"), 1);
|
|
11852
11877
|
var import_follow_redirects = __toESM(require_follow_redirects(), 1);
|
|
11853
11878
|
var import_zlib = __toESM(__require("zlib"), 1);
|
|
11854
11879
|
|
|
11855
|
-
// ../../node_modules/.pnpm/axios@1.
|
|
11856
|
-
var VERSION = "1.
|
|
11880
|
+
// ../../node_modules/.pnpm/axios@1.3.1/node_modules/axios/lib/env/data.js
|
|
11881
|
+
var VERSION = "1.3.1";
|
|
11857
11882
|
|
|
11858
|
-
// ../../node_modules/.pnpm/axios@1.
|
|
11883
|
+
// ../../node_modules/.pnpm/axios@1.3.1/node_modules/axios/lib/helpers/parseProtocol.js
|
|
11859
11884
|
function parseProtocol(url2) {
|
|
11860
11885
|
const match = /^([-+\w]{1,25})(:?\/\/|:)/.exec(url2);
|
|
11861
11886
|
return match && match[1] || "";
|
|
11862
11887
|
}
|
|
11863
11888
|
|
|
11864
|
-
// ../../node_modules/.pnpm/axios@1.
|
|
11889
|
+
// ../../node_modules/.pnpm/axios@1.3.1/node_modules/axios/lib/helpers/fromDataURI.js
|
|
11865
11890
|
var DATA_URL_PATTERN = /^(?:([^;]+);)?(?:[^;]+;)?(base64|),([\s\S]*)$/;
|
|
11866
11891
|
function fromDataURI(uri, asBlob, options) {
|
|
11867
11892
|
const _Blob = options && options.Blob || node_default.classes.Blob;
|
|
@@ -11890,13 +11915,13 @@
|
|
|
11890
11915
|
throw new AxiosError_default("Unsupported protocol " + protocol, AxiosError_default.ERR_NOT_SUPPORT);
|
|
11891
11916
|
}
|
|
11892
11917
|
|
|
11893
|
-
// ../../node_modules/.pnpm/axios@1.
|
|
11894
|
-
var
|
|
11918
|
+
// ../../node_modules/.pnpm/axios@1.3.1/node_modules/axios/lib/adapters/http.js
|
|
11919
|
+
var import_stream4 = __toESM(__require("stream"), 1);
|
|
11895
11920
|
|
|
11896
|
-
// ../../node_modules/.pnpm/axios@1.
|
|
11921
|
+
// ../../node_modules/.pnpm/axios@1.3.1/node_modules/axios/lib/helpers/AxiosTransformStream.js
|
|
11897
11922
|
var import_stream = __toESM(__require("stream"), 1);
|
|
11898
11923
|
|
|
11899
|
-
// ../../node_modules/.pnpm/axios@1.
|
|
11924
|
+
// ../../node_modules/.pnpm/axios@1.3.1/node_modules/axios/lib/helpers/throttle.js
|
|
11900
11925
|
function throttle(fn, freq) {
|
|
11901
11926
|
let timestamp = 0;
|
|
11902
11927
|
const threshold = 1e3 / freq;
|
|
@@ -11922,7 +11947,7 @@
|
|
|
11922
11947
|
}
|
|
11923
11948
|
var throttle_default = throttle;
|
|
11924
11949
|
|
|
11925
|
-
// ../../node_modules/.pnpm/axios@1.
|
|
11950
|
+
// ../../node_modules/.pnpm/axios@1.3.1/node_modules/axios/lib/helpers/speedometer.js
|
|
11926
11951
|
function speedometer(samplesCount, min) {
|
|
11927
11952
|
samplesCount = samplesCount || 10;
|
|
11928
11953
|
const bytes = new Array(samplesCount);
|
|
@@ -11958,7 +11983,7 @@
|
|
|
11958
11983
|
}
|
|
11959
11984
|
var speedometer_default = speedometer;
|
|
11960
11985
|
|
|
11961
|
-
// ../../node_modules/.pnpm/axios@1.
|
|
11986
|
+
// ../../node_modules/.pnpm/axios@1.3.1/node_modules/axios/lib/helpers/AxiosTransformStream.js
|
|
11962
11987
|
var kInternals = Symbol("internals");
|
|
11963
11988
|
var AxiosTransformStream = class extends import_stream.default.Transform {
|
|
11964
11989
|
constructor(options) {
|
|
@@ -12108,8 +12133,129 @@
|
|
|
12108
12133
|
};
|
|
12109
12134
|
var AxiosTransformStream_default = AxiosTransformStream;
|
|
12110
12135
|
|
|
12111
|
-
// ../../node_modules/.pnpm/axios@1.
|
|
12136
|
+
// ../../node_modules/.pnpm/axios@1.3.1/node_modules/axios/lib/adapters/http.js
|
|
12112
12137
|
var import_events = __toESM(__require("events"), 1);
|
|
12138
|
+
|
|
12139
|
+
// ../../node_modules/.pnpm/axios@1.3.1/node_modules/axios/lib/helpers/formDataToStream.js
|
|
12140
|
+
var import_stream2 = __require("stream");
|
|
12141
|
+
|
|
12142
|
+
// ../../node_modules/.pnpm/axios@1.3.1/node_modules/axios/lib/helpers/readBlob.js
|
|
12143
|
+
var { asyncIterator } = Symbol;
|
|
12144
|
+
var readBlob = async function* (blob) {
|
|
12145
|
+
if (blob.stream) {
|
|
12146
|
+
yield* blob.stream();
|
|
12147
|
+
} else if (blob.arrayBuffer) {
|
|
12148
|
+
yield await blob.arrayBuffer();
|
|
12149
|
+
} else if (blob[asyncIterator]) {
|
|
12150
|
+
yield* blob[asyncIterator]();
|
|
12151
|
+
} else {
|
|
12152
|
+
yield blob;
|
|
12153
|
+
}
|
|
12154
|
+
};
|
|
12155
|
+
var readBlob_default = readBlob;
|
|
12156
|
+
|
|
12157
|
+
// ../../node_modules/.pnpm/axios@1.3.1/node_modules/axios/lib/helpers/formDataToStream.js
|
|
12158
|
+
var BOUNDARY_ALPHABET = utils_default.ALPHABET.ALPHA_DIGIT + "-_";
|
|
12159
|
+
var textEncoder = new TextEncoder();
|
|
12160
|
+
var CRLF = "\r\n";
|
|
12161
|
+
var CRLF_BYTES = textEncoder.encode(CRLF);
|
|
12162
|
+
var CRLF_BYTES_COUNT = 2;
|
|
12163
|
+
var FormDataPart = class {
|
|
12164
|
+
constructor(name, value) {
|
|
12165
|
+
const { escapeName } = this.constructor;
|
|
12166
|
+
const isStringValue = utils_default.isString(value);
|
|
12167
|
+
let headers = `Content-Disposition: form-data; name="${escapeName(name)}"${!isStringValue && value.name ? `; filename="${escapeName(value.name)}"` : ""}${CRLF}`;
|
|
12168
|
+
if (isStringValue) {
|
|
12169
|
+
value = textEncoder.encode(String(value).replace(/\r?\n|\r\n?/g, CRLF));
|
|
12170
|
+
} else {
|
|
12171
|
+
headers += `Content-Type: ${value.type || "application/octet-stream"}${CRLF}`;
|
|
12172
|
+
}
|
|
12173
|
+
this.headers = textEncoder.encode(headers + CRLF);
|
|
12174
|
+
this.contentLength = isStringValue ? value.byteLength : value.size;
|
|
12175
|
+
this.size = this.headers.byteLength + this.contentLength + CRLF_BYTES_COUNT;
|
|
12176
|
+
this.name = name;
|
|
12177
|
+
this.value = value;
|
|
12178
|
+
}
|
|
12179
|
+
async *encode() {
|
|
12180
|
+
yield this.headers;
|
|
12181
|
+
const { value } = this;
|
|
12182
|
+
if (utils_default.isTypedArray(value)) {
|
|
12183
|
+
yield value;
|
|
12184
|
+
} else {
|
|
12185
|
+
yield* readBlob_default(value);
|
|
12186
|
+
}
|
|
12187
|
+
yield CRLF_BYTES;
|
|
12188
|
+
}
|
|
12189
|
+
static escapeName(name) {
|
|
12190
|
+
return String(name).replace(/[\r\n"]/g, (match) => ({
|
|
12191
|
+
"\r": "%0D",
|
|
12192
|
+
"\n": "%0A",
|
|
12193
|
+
'"': "%22"
|
|
12194
|
+
})[match]);
|
|
12195
|
+
}
|
|
12196
|
+
};
|
|
12197
|
+
var formDataToStream = (form, headersHandler, options) => {
|
|
12198
|
+
const {
|
|
12199
|
+
tag = "form-data-boundary",
|
|
12200
|
+
size = 25,
|
|
12201
|
+
boundary = tag + "-" + utils_default.generateString(size, BOUNDARY_ALPHABET)
|
|
12202
|
+
} = options || {};
|
|
12203
|
+
if (!utils_default.isFormData(form)) {
|
|
12204
|
+
throw TypeError("FormData instance required");
|
|
12205
|
+
}
|
|
12206
|
+
if (boundary.length < 1 || boundary.length > 70) {
|
|
12207
|
+
throw Error("boundary must be 10-70 characters long");
|
|
12208
|
+
}
|
|
12209
|
+
const boundaryBytes = textEncoder.encode("--" + boundary + CRLF);
|
|
12210
|
+
const footerBytes = textEncoder.encode("--" + boundary + "--" + CRLF + CRLF);
|
|
12211
|
+
let contentLength = footerBytes.byteLength;
|
|
12212
|
+
const parts = Array.from(form.entries()).map(([name, value]) => {
|
|
12213
|
+
const part = new FormDataPart(name, value);
|
|
12214
|
+
contentLength += part.size;
|
|
12215
|
+
return part;
|
|
12216
|
+
});
|
|
12217
|
+
contentLength += boundaryBytes.byteLength * parts.length;
|
|
12218
|
+
contentLength = utils_default.toFiniteNumber(contentLength);
|
|
12219
|
+
const computedHeaders = {
|
|
12220
|
+
"Content-Type": `multipart/form-data; boundary=${boundary}`
|
|
12221
|
+
};
|
|
12222
|
+
if (Number.isFinite(contentLength)) {
|
|
12223
|
+
computedHeaders["Content-Length"] = contentLength;
|
|
12224
|
+
}
|
|
12225
|
+
headersHandler && headersHandler(computedHeaders);
|
|
12226
|
+
return import_stream2.Readable.from(async function* () {
|
|
12227
|
+
for (const part of parts) {
|
|
12228
|
+
yield boundaryBytes;
|
|
12229
|
+
yield* part.encode();
|
|
12230
|
+
}
|
|
12231
|
+
yield footerBytes;
|
|
12232
|
+
}());
|
|
12233
|
+
};
|
|
12234
|
+
var formDataToStream_default = formDataToStream;
|
|
12235
|
+
|
|
12236
|
+
// ../../node_modules/.pnpm/axios@1.3.1/node_modules/axios/lib/helpers/ZlibHeaderTransformStream.js
|
|
12237
|
+
var import_stream3 = __toESM(__require("stream"), 1);
|
|
12238
|
+
var ZlibHeaderTransformStream = class extends import_stream3.default.Transform {
|
|
12239
|
+
__transform(chunk, encoding, callback) {
|
|
12240
|
+
this.push(chunk);
|
|
12241
|
+
callback();
|
|
12242
|
+
}
|
|
12243
|
+
_transform(chunk, encoding, callback) {
|
|
12244
|
+
if (chunk.length !== 0) {
|
|
12245
|
+
this._transform = this.__transform;
|
|
12246
|
+
if (chunk[0] !== 120) {
|
|
12247
|
+
const header = Buffer.alloc(2);
|
|
12248
|
+
header[0] = 120;
|
|
12249
|
+
header[1] = 156;
|
|
12250
|
+
this.push(header, encoding);
|
|
12251
|
+
}
|
|
12252
|
+
}
|
|
12253
|
+
this.__transform(chunk, encoding, callback);
|
|
12254
|
+
}
|
|
12255
|
+
};
|
|
12256
|
+
var ZlibHeaderTransformStream_default = ZlibHeaderTransformStream;
|
|
12257
|
+
|
|
12258
|
+
// ../../node_modules/.pnpm/axios@1.3.1/node_modules/axios/lib/adapters/http.js
|
|
12113
12259
|
var zlibOptions = {
|
|
12114
12260
|
flush: import_zlib.default.constants.Z_SYNC_FLUSH,
|
|
12115
12261
|
finishFlush: import_zlib.default.constants.Z_SYNC_FLUSH
|
|
@@ -12167,7 +12313,7 @@
|
|
|
12167
12313
|
}
|
|
12168
12314
|
var isHttpAdapterSupported = typeof process !== "undefined" && utils_default.kindOf(process) === "process";
|
|
12169
12315
|
var http_default = isHttpAdapterSupported && function httpAdapter(config) {
|
|
12170
|
-
return new Promise(function dispatchHttpRequest(resolvePromise, rejectPromise) {
|
|
12316
|
+
return new Promise(async function dispatchHttpRequest(resolvePromise, rejectPromise) {
|
|
12171
12317
|
let data = config.data;
|
|
12172
12318
|
const responseType = config.responseType;
|
|
12173
12319
|
const responseEncoding = config.responseEncoding;
|
|
@@ -12238,10 +12384,10 @@
|
|
|
12238
12384
|
if (responseType === "text") {
|
|
12239
12385
|
convertedData = convertedData.toString(responseEncoding);
|
|
12240
12386
|
if (!responseEncoding || responseEncoding === "utf8") {
|
|
12241
|
-
|
|
12387
|
+
convertedData = utils_default.stripBOM(convertedData);
|
|
12242
12388
|
}
|
|
12243
12389
|
} else if (responseType === "stream") {
|
|
12244
|
-
convertedData =
|
|
12390
|
+
convertedData = import_stream4.default.Readable.from(convertedData);
|
|
12245
12391
|
}
|
|
12246
12392
|
return settle(resolve, reject, {
|
|
12247
12393
|
data: convertedData,
|
|
@@ -12265,8 +12411,27 @@
|
|
|
12265
12411
|
const maxRate = config.maxRate;
|
|
12266
12412
|
let maxUploadRate = void 0;
|
|
12267
12413
|
let maxDownloadRate = void 0;
|
|
12268
|
-
if (utils_default.
|
|
12414
|
+
if (utils_default.isSpecCompliantForm(data)) {
|
|
12415
|
+
const userBoundary = headers.getContentType(/boundary=([-_\w\d]{10,70})/i);
|
|
12416
|
+
data = formDataToStream_default(data, (formHeaders) => {
|
|
12417
|
+
headers.set(formHeaders);
|
|
12418
|
+
}, {
|
|
12419
|
+
tag: `axios-${VERSION}-boundary`,
|
|
12420
|
+
boundary: userBoundary && userBoundary[1] || void 0
|
|
12421
|
+
});
|
|
12422
|
+
} else if (utils_default.isFormData(data) && utils_default.isFunction(data.getHeaders)) {
|
|
12269
12423
|
headers.set(data.getHeaders());
|
|
12424
|
+
if (!headers.hasContentLength()) {
|
|
12425
|
+
try {
|
|
12426
|
+
const knownLength = await import_util.default.promisify(data.getLength).call(data);
|
|
12427
|
+
headers.setContentLength(knownLength);
|
|
12428
|
+
} catch (e) {
|
|
12429
|
+
}
|
|
12430
|
+
}
|
|
12431
|
+
} else if (utils_default.isBlob(data)) {
|
|
12432
|
+
data.size && headers.setContentType(data.type || "application/octet-stream");
|
|
12433
|
+
headers.setContentLength(data.size || 0);
|
|
12434
|
+
data = import_stream4.default.Readable.from(readBlob_default(data));
|
|
12270
12435
|
} else if (data && !utils_default.isStream(data)) {
|
|
12271
12436
|
if (Buffer.isBuffer(data)) {
|
|
12272
12437
|
} else if (utils_default.isArrayBuffer(data)) {
|
|
@@ -12280,7 +12445,7 @@
|
|
|
12280
12445
|
config
|
|
12281
12446
|
));
|
|
12282
12447
|
}
|
|
12283
|
-
headers.
|
|
12448
|
+
headers.setContentLength(data.length, false);
|
|
12284
12449
|
if (config.maxBodyLength > -1 && data.length > config.maxBodyLength) {
|
|
12285
12450
|
return reject(new AxiosError_default(
|
|
12286
12451
|
"Request body larger than maxBodyLength limit",
|
|
@@ -12298,9 +12463,9 @@
|
|
|
12298
12463
|
}
|
|
12299
12464
|
if (data && (onUploadProgress || maxUploadRate)) {
|
|
12300
12465
|
if (!utils_default.isStream(data)) {
|
|
12301
|
-
data =
|
|
12466
|
+
data = import_stream4.default.Readable.from(data, { objectMode: false });
|
|
12302
12467
|
}
|
|
12303
|
-
data =
|
|
12468
|
+
data = import_stream4.default.pipeline([data, new AxiosTransformStream_default({
|
|
12304
12469
|
length: contentLength,
|
|
12305
12470
|
maxRate: utils_default.toFiniteNumber(maxUploadRate)
|
|
12306
12471
|
})], utils_default.noop);
|
|
@@ -12410,7 +12575,11 @@
|
|
|
12410
12575
|
case "x-gzip":
|
|
12411
12576
|
case "compress":
|
|
12412
12577
|
case "x-compress":
|
|
12578
|
+
streams.push(import_zlib.default.createUnzip(zlibOptions));
|
|
12579
|
+
delete res.headers["content-encoding"];
|
|
12580
|
+
break;
|
|
12413
12581
|
case "deflate":
|
|
12582
|
+
streams.push(new ZlibHeaderTransformStream_default());
|
|
12414
12583
|
streams.push(import_zlib.default.createUnzip(zlibOptions));
|
|
12415
12584
|
delete res.headers["content-encoding"];
|
|
12416
12585
|
break;
|
|
@@ -12421,8 +12590,8 @@
|
|
|
12421
12590
|
}
|
|
12422
12591
|
}
|
|
12423
12592
|
}
|
|
12424
|
-
responseStream = streams.length > 1 ?
|
|
12425
|
-
const offListeners =
|
|
12593
|
+
responseStream = streams.length > 1 ? import_stream4.default.pipeline(streams, utils_default.noop) : streams[0];
|
|
12594
|
+
const offListeners = import_stream4.default.finished(responseStream, () => {
|
|
12426
12595
|
offListeners();
|
|
12427
12596
|
onFinished();
|
|
12428
12597
|
});
|
|
@@ -12554,7 +12723,7 @@
|
|
|
12554
12723
|
});
|
|
12555
12724
|
};
|
|
12556
12725
|
|
|
12557
|
-
// ../../node_modules/.pnpm/axios@1.
|
|
12726
|
+
// ../../node_modules/.pnpm/axios@1.3.1/node_modules/axios/lib/helpers/cookies.js
|
|
12558
12727
|
var cookies_default = node_default.isStandardBrowserEnv ? function standardBrowserEnv() {
|
|
12559
12728
|
return {
|
|
12560
12729
|
write: function write(name, value, expires, path, domain, secure) {
|
|
@@ -12594,7 +12763,7 @@
|
|
|
12594
12763
|
};
|
|
12595
12764
|
}();
|
|
12596
12765
|
|
|
12597
|
-
// ../../node_modules/.pnpm/axios@1.
|
|
12766
|
+
// ../../node_modules/.pnpm/axios@1.3.1/node_modules/axios/lib/helpers/isURLSameOrigin.js
|
|
12598
12767
|
var isURLSameOrigin_default = node_default.isStandardBrowserEnv ? function standardBrowserEnv2() {
|
|
12599
12768
|
const msie = /(msie|trident)/i.test(navigator.userAgent);
|
|
12600
12769
|
const urlParsingNode = document.createElement("a");
|
|
@@ -12628,7 +12797,7 @@
|
|
|
12628
12797
|
};
|
|
12629
12798
|
}();
|
|
12630
12799
|
|
|
12631
|
-
// ../../node_modules/.pnpm/axios@1.
|
|
12800
|
+
// ../../node_modules/.pnpm/axios@1.3.1/node_modules/axios/lib/adapters/xhr.js
|
|
12632
12801
|
function progressEventReducer(listener, isDownloadStream) {
|
|
12633
12802
|
let bytesNotified = 0;
|
|
12634
12803
|
const _speedometer = speedometer_default(50, 250);
|
|
@@ -12789,7 +12958,7 @@
|
|
|
12789
12958
|
});
|
|
12790
12959
|
};
|
|
12791
12960
|
|
|
12792
|
-
// ../../node_modules/.pnpm/axios@1.
|
|
12961
|
+
// ../../node_modules/.pnpm/axios@1.3.1/node_modules/axios/lib/adapters/adapters.js
|
|
12793
12962
|
var knownAdapters = {
|
|
12794
12963
|
http: http_default,
|
|
12795
12964
|
xhr: xhr_default
|
|
@@ -12834,7 +13003,7 @@
|
|
|
12834
13003
|
adapters: knownAdapters
|
|
12835
13004
|
};
|
|
12836
13005
|
|
|
12837
|
-
// ../../node_modules/.pnpm/axios@1.
|
|
13006
|
+
// ../../node_modules/.pnpm/axios@1.3.1/node_modules/axios/lib/core/dispatchRequest.js
|
|
12838
13007
|
function throwIfCancellationRequested(config) {
|
|
12839
13008
|
if (config.cancelToken) {
|
|
12840
13009
|
config.cancelToken.throwIfRequested();
|
|
@@ -12879,7 +13048,7 @@
|
|
|
12879
13048
|
});
|
|
12880
13049
|
}
|
|
12881
13050
|
|
|
12882
|
-
// ../../node_modules/.pnpm/axios@1.
|
|
13051
|
+
// ../../node_modules/.pnpm/axios@1.3.1/node_modules/axios/lib/core/mergeConfig.js
|
|
12883
13052
|
var headersToObject = (thing) => thing instanceof AxiosHeaders_default ? thing.toJSON() : thing;
|
|
12884
13053
|
function mergeConfig(config1, config2) {
|
|
12885
13054
|
config2 = config2 || {};
|
|
@@ -12958,7 +13127,7 @@
|
|
|
12958
13127
|
return config;
|
|
12959
13128
|
}
|
|
12960
13129
|
|
|
12961
|
-
// ../../node_modules/.pnpm/axios@1.
|
|
13130
|
+
// ../../node_modules/.pnpm/axios@1.3.1/node_modules/axios/lib/helpers/validator.js
|
|
12962
13131
|
var validators = {};
|
|
12963
13132
|
["object", "boolean", "number", "function", "string", "symbol"].forEach((type, i) => {
|
|
12964
13133
|
validators[type] = function validator(thing) {
|
|
@@ -13016,7 +13185,7 @@
|
|
|
13016
13185
|
validators
|
|
13017
13186
|
};
|
|
13018
13187
|
|
|
13019
|
-
// ../../node_modules/.pnpm/axios@1.
|
|
13188
|
+
// ../../node_modules/.pnpm/axios@1.3.1/node_modules/axios/lib/core/Axios.js
|
|
13020
13189
|
var validators2 = validator_default.validators;
|
|
13021
13190
|
var Axios = class {
|
|
13022
13191
|
constructor(instanceConfig) {
|
|
@@ -13146,7 +13315,7 @@
|
|
|
13146
13315
|
});
|
|
13147
13316
|
var Axios_default = Axios;
|
|
13148
13317
|
|
|
13149
|
-
// ../../node_modules/.pnpm/axios@1.
|
|
13318
|
+
// ../../node_modules/.pnpm/axios@1.3.1/node_modules/axios/lib/cancel/CancelToken.js
|
|
13150
13319
|
var CancelToken = class {
|
|
13151
13320
|
constructor(executor) {
|
|
13152
13321
|
if (typeof executor !== "function") {
|
|
@@ -13223,19 +13392,19 @@
|
|
|
13223
13392
|
};
|
|
13224
13393
|
var CancelToken_default = CancelToken;
|
|
13225
13394
|
|
|
13226
|
-
// ../../node_modules/.pnpm/axios@1.
|
|
13395
|
+
// ../../node_modules/.pnpm/axios@1.3.1/node_modules/axios/lib/helpers/spread.js
|
|
13227
13396
|
function spread(callback) {
|
|
13228
13397
|
return function wrap(arr) {
|
|
13229
13398
|
return callback.apply(null, arr);
|
|
13230
13399
|
};
|
|
13231
13400
|
}
|
|
13232
13401
|
|
|
13233
|
-
// ../../node_modules/.pnpm/axios@1.
|
|
13402
|
+
// ../../node_modules/.pnpm/axios@1.3.1/node_modules/axios/lib/helpers/isAxiosError.js
|
|
13234
13403
|
function isAxiosError(payload) {
|
|
13235
13404
|
return utils_default.isObject(payload) && payload.isAxiosError === true;
|
|
13236
13405
|
}
|
|
13237
13406
|
|
|
13238
|
-
// ../../node_modules/.pnpm/axios@1.
|
|
13407
|
+
// ../../node_modules/.pnpm/axios@1.3.1/node_modules/axios/lib/helpers/HttpStatusCode.js
|
|
13239
13408
|
var HttpStatusCode = {
|
|
13240
13409
|
Continue: 100,
|
|
13241
13410
|
SwitchingProtocols: 101,
|
|
@@ -13306,7 +13475,7 @@
|
|
|
13306
13475
|
});
|
|
13307
13476
|
var HttpStatusCode_default = HttpStatusCode;
|
|
13308
13477
|
|
|
13309
|
-
// ../../node_modules/.pnpm/axios@1.
|
|
13478
|
+
// ../../node_modules/.pnpm/axios@1.3.1/node_modules/axios/lib/axios.js
|
|
13310
13479
|
function createInstance(defaultConfig) {
|
|
13311
13480
|
const context = new Axios_default(defaultConfig);
|
|
13312
13481
|
const instance = bind(Axios_default.prototype.request, context);
|
|
@@ -13338,7 +13507,7 @@
|
|
|
13338
13507
|
axios.default = axios;
|
|
13339
13508
|
var axios_default = axios;
|
|
13340
13509
|
|
|
13341
|
-
// ../../node_modules/.pnpm/axios@1.
|
|
13510
|
+
// ../../node_modules/.pnpm/axios@1.3.1/node_modules/axios/index.js
|
|
13342
13511
|
var {
|
|
13343
13512
|
Axios: Axios2,
|
|
13344
13513
|
AxiosError: AxiosError2,
|