@kohost/api-client 3.4.5 → 3.4.7
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/cjs/schemas/definitions.json +2 -0
- package/dist/cjs/schemas/mediaSource.json +2 -1
- package/dist/esm/Client.js +136 -77
- package/dist/esm/Client.js.map +3 -3
- package/dist/esm/Models.js +4 -1
- package/dist/esm/Models.js.map +2 -2
- package/dist/esm/defs.js +136 -77
- package/dist/esm/defs.js.map +3 -3
- package/dist/esm/utils.js +4 -1
- package/dist/esm/utils.js.map +2 -2
- package/dist/types/Errors/AppError.d.ts +1 -1
- package/dist/types/Errors/AppError.d.ts.map +1 -1
- package/dist/types/Events/ApplicationInUse.d.ts +1 -0
- package/dist/types/Events/ApplicationInUse.d.ts.map +1 -1
- package/dist/types/Events/ApplicationOutOfUse.d.ts +1 -0
- package/dist/types/Events/ApplicationOutOfUse.d.ts.map +1 -1
- package/dist/types/Events/EmailEvent.d.ts +1 -0
- package/dist/types/Events/EmailEvent.d.ts.map +1 -1
- package/dist/types/Events/Event.d.ts +0 -44
- package/dist/types/Events/Event.d.ts.map +1 -1
- package/dist/types/Events/ReservationCheckedIn.d.ts +1 -0
- package/dist/types/Events/ReservationCheckedIn.d.ts.map +1 -1
- package/dist/types/Events/ReservationCheckedOut.d.ts +1 -0
- package/dist/types/Events/ReservationCheckedOut.d.ts.map +1 -1
- package/dist/types/Events/ReservationSpaceChanged.d.ts +1 -0
- package/dist/types/Events/ReservationSpaceChanged.d.ts.map +1 -1
- package/dist/types/Events/SMSEvent.d.ts +1 -0
- package/dist/types/Events/SMSEvent.d.ts.map +1 -1
- package/dist/types/Events/SceneSet.d.ts +1 -0
- package/dist/types/Events/SceneSet.d.ts.map +1 -1
- package/dist/types/Events/ShortLinkCreated.d.ts +1 -0
- package/dist/types/Events/ShortLinkCreated.d.ts.map +1 -1
- package/dist/types/Events/SystemAlarmUpdated.d.ts +1 -0
- package/dist/types/Events/SystemAlarmUpdated.d.ts.map +1 -1
- package/dist/types/Events/SystemCameraUpdated.d.ts +1 -0
- package/dist/types/Events/SystemCameraUpdated.d.ts.map +1 -1
- package/dist/types/Events/SystemCategoryUpdated.d.ts +1 -0
- package/dist/types/Events/SystemCategoryUpdated.d.ts.map +1 -1
- package/dist/types/Events/SystemCourtesyUpdated.d.ts +1 -0
- package/dist/types/Events/SystemCourtesyUpdated.d.ts.map +1 -1
- package/dist/types/Events/SystemCredentialUpdated.d.ts +1 -0
- package/dist/types/Events/SystemCredentialUpdated.d.ts.map +1 -1
- package/dist/types/Events/SystemDimmerUpdated.d.ts +1 -0
- package/dist/types/Events/SystemDimmerUpdated.d.ts.map +1 -1
- package/dist/types/Events/SystemEntityDeleted.d.ts +1 -0
- package/dist/types/Events/SystemEntityDeleted.d.ts.map +1 -1
- package/dist/types/Events/SystemGatewayUpdated.d.ts +1 -0
- package/dist/types/Events/SystemGatewayUpdated.d.ts.map +1 -1
- package/dist/types/Events/SystemLockUpdated.d.ts +1 -0
- package/dist/types/Events/SystemLockUpdated.d.ts.map +1 -1
- package/dist/types/Events/SystemMediaSourceUpdated.d.ts +1 -0
- package/dist/types/Events/SystemMediaSourceUpdated.d.ts.map +1 -1
- package/dist/types/Events/SystemMotionSensorUpdated.d.ts +1 -0
- package/dist/types/Events/SystemMotionSensorUpdated.d.ts.map +1 -1
- package/dist/types/Events/SystemOrganizationUpdated.d.ts +1 -0
- package/dist/types/Events/SystemOrganizationUpdated.d.ts.map +1 -1
- package/dist/types/Events/SystemProductUpdated.d.ts +1 -0
- package/dist/types/Events/SystemProductUpdated.d.ts.map +1 -1
- package/dist/types/Events/SystemPropertyUpdated.d.ts +1 -0
- package/dist/types/Events/SystemPropertyUpdated.d.ts.map +1 -1
- package/dist/types/Events/SystemReservationUpdated.d.ts +1 -0
- package/dist/types/Events/SystemReservationUpdated.d.ts.map +1 -1
- package/dist/types/Events/SystemSpaceUpdated.d.ts +1 -0
- package/dist/types/Events/SystemSpaceUpdated.d.ts.map +1 -1
- package/dist/types/Events/SystemSwitchUpdated.d.ts +1 -0
- package/dist/types/Events/SystemSwitchUpdated.d.ts.map +1 -1
- package/dist/types/Events/SystemThermostatUpdated.d.ts +1 -0
- package/dist/types/Events/SystemThermostatUpdated.d.ts.map +1 -1
- package/dist/types/Events/SystemUserUpdated.d.ts +1 -0
- package/dist/types/Events/SystemUserUpdated.d.ts.map +1 -1
- package/dist/types/Events/SystemWindowCoveringUpdated.d.ts +1 -0
- package/dist/types/Events/SystemWindowCoveringUpdated.d.ts.map +1 -1
- package/dist/types/Models/Entity.d.ts +1 -1
- package/dist/types/Models/Entity.d.ts.map +1 -1
- package/dist/types/Models/Ticket.d.ts +1 -1
- package/dist/types/Models/Ticket.d.ts.map +1 -1
- package/dist/types/Models/TimeSheet.d.ts +1 -1
- package/dist/types/Models/TimeSheet.d.ts.map +1 -1
- package/dist/types/Models/User.d.ts +2 -2
- package/dist/types/Models/User.d.ts.map +1 -1
- package/dist/types/defs/index.d.ts +1 -0
- package/dist/types/index.d.ts +9 -0
- package/dist/types/schemas/AlarmSchema.d.ts +2 -0
- package/dist/types/schemas/CameraSchema.d.ts +2 -0
- package/dist/types/schemas/CategorySchema.d.ts +2 -0
- package/dist/types/schemas/CourtesySchema.d.ts +2 -0
- package/dist/types/schemas/CredentialSchema.d.ts +2 -0
- package/dist/types/schemas/DimmerSchema.d.ts +2 -0
- package/dist/types/schemas/GatewaySchema.d.ts +2 -0
- package/dist/types/schemas/LockSchema.d.ts +2 -0
- package/dist/types/schemas/MediaSourceSchema.d.ts +3 -1
- package/dist/types/schemas/MotionSensorSchema.d.ts +2 -0
- package/dist/types/schemas/ProductSchema.d.ts +2 -0
- package/dist/types/schemas/ReservationSchema.d.ts +2 -0
- package/dist/types/schemas/RoomSchema.d.ts +21 -1
- package/dist/types/schemas/SpaceSchema.d.ts +2 -0
- package/dist/types/schemas/SwitchSchema.d.ts +2 -0
- package/dist/types/schemas/SystemUserSchema.d.ts +2 -0
- package/dist/types/schemas/ThermostatSchema.d.ts +2 -0
- package/dist/types/schemas/UserSchema.d.ts +2 -0
- package/dist/types/schemas/WindowCoveringSchema.d.ts +2 -0
- package/dist/types/utils/entityFactory.d.ts +2 -1
- package/dist/types/utils/entityFactory.d.ts.map +1 -1
- package/package.json +1 -1
package/dist/esm/Client.js
CHANGED
|
@@ -7572,6 +7572,26 @@ var require_axios = __commonJS({
|
|
|
7572
7572
|
}, "toJSONObject");
|
|
7573
7573
|
var isAsyncFn = kindOfTest("AsyncFunction");
|
|
7574
7574
|
var isThenable = /* @__PURE__ */ __name((thing) => thing && (isObject(thing) || isFunction(thing)) && isFunction(thing.then) && isFunction(thing.catch), "isThenable");
|
|
7575
|
+
var _setImmediate = ((setImmediateSupported, postMessageSupported) => {
|
|
7576
|
+
if (setImmediateSupported) {
|
|
7577
|
+
return setImmediate;
|
|
7578
|
+
}
|
|
7579
|
+
return postMessageSupported ? ((token, callbacks) => {
|
|
7580
|
+
_global.addEventListener("message", ({ source, data }) => {
|
|
7581
|
+
if (source === _global && data === token) {
|
|
7582
|
+
callbacks.length && callbacks.shift()();
|
|
7583
|
+
}
|
|
7584
|
+
}, false);
|
|
7585
|
+
return (cb) => {
|
|
7586
|
+
callbacks.push(cb);
|
|
7587
|
+
_global.postMessage(token, "*");
|
|
7588
|
+
};
|
|
7589
|
+
})(`axios@${Math.random()}`, []) : (cb) => setTimeout(cb);
|
|
7590
|
+
})(
|
|
7591
|
+
typeof setImmediate === "function",
|
|
7592
|
+
isFunction(_global.postMessage)
|
|
7593
|
+
);
|
|
7594
|
+
var asap = typeof queueMicrotask !== "undefined" ? queueMicrotask.bind(_global) : typeof process !== "undefined" && process.nextTick || _setImmediate;
|
|
7575
7595
|
var utils$1 = {
|
|
7576
7596
|
isArray,
|
|
7577
7597
|
isArrayBuffer,
|
|
@@ -7628,7 +7648,9 @@ var require_axios = __commonJS({
|
|
|
7628
7648
|
isSpecCompliantForm,
|
|
7629
7649
|
toJSONObject,
|
|
7630
7650
|
isAsyncFn,
|
|
7631
|
-
isThenable
|
|
7651
|
+
isThenable,
|
|
7652
|
+
setImmediate: _setImmediate,
|
|
7653
|
+
asap
|
|
7632
7654
|
};
|
|
7633
7655
|
function AxiosError(message, code, config, request, response) {
|
|
7634
7656
|
Error.call(this);
|
|
@@ -7642,7 +7664,10 @@ var require_axios = __commonJS({
|
|
|
7642
7664
|
code && (this.code = code);
|
|
7643
7665
|
config && (this.config = config);
|
|
7644
7666
|
request && (this.request = request);
|
|
7645
|
-
|
|
7667
|
+
if (response) {
|
|
7668
|
+
this.response = response;
|
|
7669
|
+
this.status = response.status ? response.status : null;
|
|
7670
|
+
}
|
|
7646
7671
|
}
|
|
7647
7672
|
__name(AxiosError, "AxiosError");
|
|
7648
7673
|
utils$1.inherits(AxiosError, Error, {
|
|
@@ -7662,7 +7687,7 @@ var require_axios = __commonJS({
|
|
|
7662
7687
|
// Axios
|
|
7663
7688
|
config: utils$1.toJSONObject(this.config),
|
|
7664
7689
|
code: this.code,
|
|
7665
|
-
status: this.
|
|
7690
|
+
status: this.status
|
|
7666
7691
|
};
|
|
7667
7692
|
}, "toJSON")
|
|
7668
7693
|
});
|
|
@@ -7959,9 +7984,8 @@ var require_axios = __commonJS({
|
|
|
7959
7984
|
protocols: ["http", "https", "file", "blob", "url", "data"]
|
|
7960
7985
|
};
|
|
7961
7986
|
var hasBrowserEnv = typeof window !== "undefined" && typeof document !== "undefined";
|
|
7962
|
-
var
|
|
7963
|
-
|
|
7964
|
-
})(typeof navigator !== "undefined" && navigator.product);
|
|
7987
|
+
var _navigator = typeof navigator === "object" && navigator || void 0;
|
|
7988
|
+
var hasStandardBrowserEnv = hasBrowserEnv && (!_navigator || ["ReactNative", "NativeScript", "NS"].indexOf(_navigator.product) < 0);
|
|
7965
7989
|
var hasStandardBrowserWebWorkerEnv = (() => {
|
|
7966
7990
|
return typeof WorkerGlobalScope !== "undefined" && // eslint-disable-next-line no-undef
|
|
7967
7991
|
self instanceof WorkerGlobalScope && typeof self.importScripts === "function";
|
|
@@ -7972,6 +7996,7 @@ var require_axios = __commonJS({
|
|
|
7972
7996
|
hasBrowserEnv,
|
|
7973
7997
|
hasStandardBrowserWebWorkerEnv,
|
|
7974
7998
|
hasStandardBrowserEnv,
|
|
7999
|
+
navigator: _navigator,
|
|
7975
8000
|
origin
|
|
7976
8001
|
});
|
|
7977
8002
|
var platform = {
|
|
@@ -8506,27 +8531,35 @@ var require_axios = __commonJS({
|
|
|
8506
8531
|
__name(speedometer, "speedometer");
|
|
8507
8532
|
function throttle(fn, freq) {
|
|
8508
8533
|
let timestamp = 0;
|
|
8509
|
-
|
|
8510
|
-
let
|
|
8511
|
-
|
|
8512
|
-
|
|
8534
|
+
let threshold = 1e3 / freq;
|
|
8535
|
+
let lastArgs;
|
|
8536
|
+
let timer;
|
|
8537
|
+
const invoke = /* @__PURE__ */ __name((args, now = Date.now()) => {
|
|
8538
|
+
timestamp = now;
|
|
8539
|
+
lastArgs = null;
|
|
8540
|
+
if (timer) {
|
|
8541
|
+
clearTimeout(timer);
|
|
8542
|
+
timer = null;
|
|
8543
|
+
}
|
|
8544
|
+
fn.apply(null, args);
|
|
8545
|
+
}, "invoke");
|
|
8546
|
+
const throttled = /* @__PURE__ */ __name((...args) => {
|
|
8513
8547
|
const now = Date.now();
|
|
8514
|
-
|
|
8515
|
-
|
|
8516
|
-
|
|
8517
|
-
|
|
8548
|
+
const passed = now - timestamp;
|
|
8549
|
+
if (passed >= threshold) {
|
|
8550
|
+
invoke(args, now);
|
|
8551
|
+
} else {
|
|
8552
|
+
lastArgs = args;
|
|
8553
|
+
if (!timer) {
|
|
8554
|
+
timer = setTimeout(() => {
|
|
8555
|
+
timer = null;
|
|
8556
|
+
invoke(lastArgs);
|
|
8557
|
+
}, threshold - passed);
|
|
8518
8558
|
}
|
|
8519
|
-
timestamp = now;
|
|
8520
|
-
return fn.apply(null, arguments);
|
|
8521
|
-
}
|
|
8522
|
-
if (!timer) {
|
|
8523
|
-
timer = setTimeout(() => {
|
|
8524
|
-
timer = null;
|
|
8525
|
-
timestamp = Date.now();
|
|
8526
|
-
return fn.apply(null, arguments);
|
|
8527
|
-
}, threshold - (now - timestamp));
|
|
8528
8559
|
}
|
|
8529
8560
|
}, "throttled");
|
|
8561
|
+
const flush = /* @__PURE__ */ __name(() => lastArgs && invoke(lastArgs), "flush");
|
|
8562
|
+
return [throttled, flush];
|
|
8530
8563
|
}
|
|
8531
8564
|
__name(throttle, "throttle");
|
|
8532
8565
|
var progressEventReducer = /* @__PURE__ */ __name((listener, isDownloadStream, freq = 3) => {
|
|
@@ -8547,17 +8580,26 @@ var require_axios = __commonJS({
|
|
|
8547
8580
|
rate: rate ? rate : void 0,
|
|
8548
8581
|
estimated: rate && total && inRange ? (total - loaded) / rate : void 0,
|
|
8549
8582
|
event: e,
|
|
8550
|
-
lengthComputable: total != null
|
|
8583
|
+
lengthComputable: total != null,
|
|
8584
|
+
[isDownloadStream ? "download" : "upload"]: true
|
|
8551
8585
|
};
|
|
8552
|
-
data[isDownloadStream ? "download" : "upload"] = true;
|
|
8553
8586
|
listener(data);
|
|
8554
8587
|
}, freq);
|
|
8555
8588
|
}, "progressEventReducer");
|
|
8589
|
+
var progressEventDecorator = /* @__PURE__ */ __name((total, throttled) => {
|
|
8590
|
+
const lengthComputable = total != null;
|
|
8591
|
+
return [(loaded) => throttled[0]({
|
|
8592
|
+
lengthComputable,
|
|
8593
|
+
total,
|
|
8594
|
+
loaded
|
|
8595
|
+
}), throttled[1]];
|
|
8596
|
+
}, "progressEventDecorator");
|
|
8597
|
+
var asyncDecorator = /* @__PURE__ */ __name((fn) => (...args) => utils$1.asap(() => fn(...args)), "asyncDecorator");
|
|
8556
8598
|
var isURLSameOrigin = platform.hasStandardBrowserEnv ? (
|
|
8557
8599
|
// Standard browser envs have full support of the APIs needed to test
|
|
8558
8600
|
// whether the request URL is of the same origin as current location.
|
|
8559
8601
|
(/* @__PURE__ */ __name(function standardBrowserEnv() {
|
|
8560
|
-
const msie = /(msie|trident)/i.test(navigator.userAgent);
|
|
8602
|
+
const msie = platform.navigator && /(msie|trident)/i.test(platform.navigator.userAgent);
|
|
8561
8603
|
const urlParsingNode = document.createElement("a");
|
|
8562
8604
|
let originURL;
|
|
8563
8605
|
function resolveURL(url) {
|
|
@@ -8760,15 +8802,15 @@ var require_axios = __commonJS({
|
|
|
8760
8802
|
const _config = resolveConfig(config);
|
|
8761
8803
|
let requestData = _config.data;
|
|
8762
8804
|
const requestHeaders = AxiosHeaders$1.from(_config.headers).normalize();
|
|
8763
|
-
let { responseType } = _config;
|
|
8805
|
+
let { responseType, onUploadProgress, onDownloadProgress } = _config;
|
|
8764
8806
|
let onCanceled;
|
|
8807
|
+
let uploadThrottled, downloadThrottled;
|
|
8808
|
+
let flushUpload, flushDownload;
|
|
8765
8809
|
function done() {
|
|
8766
|
-
|
|
8767
|
-
|
|
8768
|
-
|
|
8769
|
-
|
|
8770
|
-
_config.signal.removeEventListener("abort", onCanceled);
|
|
8771
|
-
}
|
|
8810
|
+
flushUpload && flushUpload();
|
|
8811
|
+
flushDownload && flushDownload();
|
|
8812
|
+
_config.cancelToken && _config.cancelToken.unsubscribe(onCanceled);
|
|
8813
|
+
_config.signal && _config.signal.removeEventListener("abort", onCanceled);
|
|
8772
8814
|
}
|
|
8773
8815
|
__name(done, "done");
|
|
8774
8816
|
let request = new XMLHttpRequest();
|
|
@@ -8817,11 +8859,11 @@ var require_axios = __commonJS({
|
|
|
8817
8859
|
if (!request) {
|
|
8818
8860
|
return;
|
|
8819
8861
|
}
|
|
8820
|
-
reject(new AxiosError("Request aborted", AxiosError.ECONNABORTED,
|
|
8862
|
+
reject(new AxiosError("Request aborted", AxiosError.ECONNABORTED, config, request));
|
|
8821
8863
|
request = null;
|
|
8822
8864
|
}, "handleAbort");
|
|
8823
8865
|
request.onerror = /* @__PURE__ */ __name(function handleError() {
|
|
8824
|
-
reject(new AxiosError("Network Error", AxiosError.ERR_NETWORK,
|
|
8866
|
+
reject(new AxiosError("Network Error", AxiosError.ERR_NETWORK, config, request));
|
|
8825
8867
|
request = null;
|
|
8826
8868
|
}, "handleError");
|
|
8827
8869
|
request.ontimeout = /* @__PURE__ */ __name(function handleTimeout() {
|
|
@@ -8833,7 +8875,7 @@ var require_axios = __commonJS({
|
|
|
8833
8875
|
reject(new AxiosError(
|
|
8834
8876
|
timeoutErrorMessage,
|
|
8835
8877
|
transitional.clarifyTimeoutError ? AxiosError.ETIMEDOUT : AxiosError.ECONNABORTED,
|
|
8836
|
-
|
|
8878
|
+
config,
|
|
8837
8879
|
request
|
|
8838
8880
|
));
|
|
8839
8881
|
request = null;
|
|
@@ -8850,11 +8892,14 @@ var require_axios = __commonJS({
|
|
|
8850
8892
|
if (responseType && responseType !== "json") {
|
|
8851
8893
|
request.responseType = _config.responseType;
|
|
8852
8894
|
}
|
|
8853
|
-
if (
|
|
8854
|
-
|
|
8895
|
+
if (onDownloadProgress) {
|
|
8896
|
+
[downloadThrottled, flushDownload] = progressEventReducer(onDownloadProgress, true);
|
|
8897
|
+
request.addEventListener("progress", downloadThrottled);
|
|
8855
8898
|
}
|
|
8856
|
-
if (
|
|
8857
|
-
|
|
8899
|
+
if (onUploadProgress && request.upload) {
|
|
8900
|
+
[uploadThrottled, flushUpload] = progressEventReducer(onUploadProgress);
|
|
8901
|
+
request.upload.addEventListener("progress", uploadThrottled);
|
|
8902
|
+
request.upload.addEventListener("loadend", flushUpload);
|
|
8858
8903
|
}
|
|
8859
8904
|
if (_config.cancelToken || _config.signal) {
|
|
8860
8905
|
onCanceled = /* @__PURE__ */ __name((cancel) => {
|
|
@@ -8933,39 +8978,52 @@ var require_axios = __commonJS({
|
|
|
8933
8978
|
var trackStream = /* @__PURE__ */ __name((stream, chunkSize, onProgress, onFinish, encode2) => {
|
|
8934
8979
|
const iterator = readBytes(stream, chunkSize, encode2);
|
|
8935
8980
|
let bytes = 0;
|
|
8981
|
+
let done;
|
|
8982
|
+
let _onFinish = /* @__PURE__ */ __name((e) => {
|
|
8983
|
+
if (!done) {
|
|
8984
|
+
done = true;
|
|
8985
|
+
onFinish && onFinish(e);
|
|
8986
|
+
}
|
|
8987
|
+
}, "_onFinish");
|
|
8936
8988
|
return new ReadableStream({
|
|
8937
|
-
type: "bytes",
|
|
8938
8989
|
async pull(controller) {
|
|
8939
|
-
|
|
8940
|
-
|
|
8941
|
-
|
|
8942
|
-
|
|
8943
|
-
|
|
8990
|
+
try {
|
|
8991
|
+
const { done: done2, value } = await iterator.next();
|
|
8992
|
+
if (done2) {
|
|
8993
|
+
_onFinish();
|
|
8994
|
+
controller.close();
|
|
8995
|
+
return;
|
|
8996
|
+
}
|
|
8997
|
+
let len = value.byteLength;
|
|
8998
|
+
if (onProgress) {
|
|
8999
|
+
let loadedBytes = bytes += len;
|
|
9000
|
+
onProgress(loadedBytes);
|
|
9001
|
+
}
|
|
9002
|
+
controller.enqueue(new Uint8Array(value));
|
|
9003
|
+
} catch (err) {
|
|
9004
|
+
_onFinish(err);
|
|
9005
|
+
throw err;
|
|
8944
9006
|
}
|
|
8945
|
-
let len = value.byteLength;
|
|
8946
|
-
onProgress && onProgress(bytes += len);
|
|
8947
|
-
controller.enqueue(new Uint8Array(value));
|
|
8948
9007
|
},
|
|
8949
9008
|
cancel(reason) {
|
|
8950
|
-
|
|
9009
|
+
_onFinish(reason);
|
|
8951
9010
|
return iterator.return();
|
|
8952
9011
|
}
|
|
8953
9012
|
}, {
|
|
8954
9013
|
highWaterMark: 2
|
|
8955
9014
|
});
|
|
8956
9015
|
}, "trackStream");
|
|
8957
|
-
var fetchProgressDecorator = /* @__PURE__ */ __name((total, fn) => {
|
|
8958
|
-
const lengthComputable = total != null;
|
|
8959
|
-
return (loaded) => setTimeout(() => fn({
|
|
8960
|
-
lengthComputable,
|
|
8961
|
-
total,
|
|
8962
|
-
loaded
|
|
8963
|
-
}));
|
|
8964
|
-
}, "fetchProgressDecorator");
|
|
8965
9016
|
var isFetchSupported = typeof fetch === "function" && typeof Request === "function" && typeof Response === "function";
|
|
8966
9017
|
var isReadableStreamSupported = isFetchSupported && typeof ReadableStream === "function";
|
|
8967
9018
|
var encodeText = isFetchSupported && (typeof TextEncoder === "function" ? /* @__PURE__ */ ((encoder) => (str) => encoder.encode(str))(new TextEncoder()) : async (str) => new Uint8Array(await new Response(str).arrayBuffer()));
|
|
8968
|
-
var
|
|
9019
|
+
var test = /* @__PURE__ */ __name((fn, ...args) => {
|
|
9020
|
+
try {
|
|
9021
|
+
return !!fn(...args);
|
|
9022
|
+
} catch (e) {
|
|
9023
|
+
return false;
|
|
9024
|
+
}
|
|
9025
|
+
}, "test");
|
|
9026
|
+
var supportsRequestStream = isReadableStreamSupported && test(() => {
|
|
8969
9027
|
let duplexAccessed = false;
|
|
8970
9028
|
const hasContentType = new Request(platform.origin, {
|
|
8971
9029
|
body: new ReadableStream(),
|
|
@@ -8976,14 +9034,9 @@ var require_axios = __commonJS({
|
|
|
8976
9034
|
}
|
|
8977
9035
|
}).headers.has("Content-Type");
|
|
8978
9036
|
return duplexAccessed && !hasContentType;
|
|
8979
|
-
})
|
|
9037
|
+
});
|
|
8980
9038
|
var DEFAULT_CHUNK_SIZE = 64 * 1024;
|
|
8981
|
-
var supportsResponseStream = isReadableStreamSupported &&
|
|
8982
|
-
try {
|
|
8983
|
-
return utils$1.isReadableStream(new Response("").body);
|
|
8984
|
-
} catch (err) {
|
|
8985
|
-
}
|
|
8986
|
-
})();
|
|
9039
|
+
var supportsResponseStream = isReadableStreamSupported && test(() => utils$1.isReadableStream(new Response("").body));
|
|
8987
9040
|
var resolvers = {
|
|
8988
9041
|
stream: supportsResponseStream && ((res) => res.body)
|
|
8989
9042
|
};
|
|
@@ -9004,7 +9057,7 @@ var require_axios = __commonJS({
|
|
|
9004
9057
|
if (utils$1.isSpecCompliantForm(body)) {
|
|
9005
9058
|
return (await new Request(body).arrayBuffer()).byteLength;
|
|
9006
9059
|
}
|
|
9007
|
-
if (utils$1.isArrayBufferView(body)) {
|
|
9060
|
+
if (utils$1.isArrayBufferView(body) || utils$1.isArrayBuffer(body)) {
|
|
9008
9061
|
return body.byteLength;
|
|
9009
9062
|
}
|
|
9010
9063
|
if (utils$1.isURLSearchParams(body)) {
|
|
@@ -9055,15 +9108,17 @@ var require_axios = __commonJS({
|
|
|
9055
9108
|
headers.setContentType(contentTypeHeader);
|
|
9056
9109
|
}
|
|
9057
9110
|
if (_request.body) {
|
|
9058
|
-
|
|
9111
|
+
const [onProgress, flush] = progressEventDecorator(
|
|
9059
9112
|
requestContentLength,
|
|
9060
|
-
progressEventReducer(onUploadProgress)
|
|
9061
|
-
)
|
|
9113
|
+
progressEventReducer(asyncDecorator(onUploadProgress))
|
|
9114
|
+
);
|
|
9115
|
+
data = trackStream(_request.body, DEFAULT_CHUNK_SIZE, onProgress, flush, encodeText);
|
|
9062
9116
|
}
|
|
9063
9117
|
}
|
|
9064
9118
|
if (!utils$1.isString(withCredentials)) {
|
|
9065
|
-
withCredentials = withCredentials ? "
|
|
9119
|
+
withCredentials = withCredentials ? "include" : "omit";
|
|
9066
9120
|
}
|
|
9121
|
+
const isCredentialsSupported = "credentials" in Request.prototype;
|
|
9067
9122
|
request = new Request(url, {
|
|
9068
9123
|
...fetchOptions,
|
|
9069
9124
|
signal: composedSignal,
|
|
@@ -9071,7 +9126,7 @@ var require_axios = __commonJS({
|
|
|
9071
9126
|
headers: headers.normalize().toJSON(),
|
|
9072
9127
|
body: data,
|
|
9073
9128
|
duplex: "half",
|
|
9074
|
-
withCredentials
|
|
9129
|
+
credentials: isCredentialsSupported ? withCredentials : void 0
|
|
9075
9130
|
});
|
|
9076
9131
|
let response = await fetch(request);
|
|
9077
9132
|
const isStreamResponse = supportsResponseStream && (responseType === "stream" || responseType === "response");
|
|
@@ -9081,11 +9136,15 @@ var require_axios = __commonJS({
|
|
|
9081
9136
|
options[prop] = response[prop];
|
|
9082
9137
|
});
|
|
9083
9138
|
const responseContentLength = utils$1.toFiniteNumber(response.headers.get("content-length"));
|
|
9139
|
+
const [onProgress, flush] = onDownloadProgress && progressEventDecorator(
|
|
9140
|
+
responseContentLength,
|
|
9141
|
+
progressEventReducer(asyncDecorator(onDownloadProgress), true)
|
|
9142
|
+
) || [];
|
|
9084
9143
|
response = new Response(
|
|
9085
|
-
trackStream(response.body, DEFAULT_CHUNK_SIZE,
|
|
9086
|
-
|
|
9087
|
-
|
|
9088
|
-
|
|
9144
|
+
trackStream(response.body, DEFAULT_CHUNK_SIZE, onProgress, () => {
|
|
9145
|
+
flush && flush();
|
|
9146
|
+
isStreamResponse && onFinish();
|
|
9147
|
+
}, encodeText),
|
|
9089
9148
|
options
|
|
9090
9149
|
);
|
|
9091
9150
|
}
|
|
@@ -9213,7 +9272,7 @@ var require_axios = __commonJS({
|
|
|
9213
9272
|
}, "onAdapterRejection"));
|
|
9214
9273
|
}
|
|
9215
9274
|
__name(dispatchRequest, "dispatchRequest");
|
|
9216
|
-
var VERSION = "1.7.
|
|
9275
|
+
var VERSION = "1.7.5";
|
|
9217
9276
|
var validators$1 = {};
|
|
9218
9277
|
["object", "boolean", "number", "function", "string", "symbol"].forEach((type, i) => {
|
|
9219
9278
|
validators$1[type] = /* @__PURE__ */ __name(function validator2(thing) {
|