@kohost/api-client 3.0.0-beta.99 → 3.0.1
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/Client/index.js +374 -67
- package/dist/cjs/Commands/CreateShortLinkCommand.js +2 -2
- package/dist/cjs/Commands/OCRDocumentCommand.js +2 -2
- package/dist/cjs/Commands/SetAlarmCommand.js +2 -2
- package/dist/cjs/Commands/SetCourtesyCommand.js +2 -2
- package/dist/cjs/Commands/SetDimmerCommand.js +2 -2
- package/dist/cjs/Commands/SetLockCommand.js +2 -2
- package/dist/cjs/Commands/SetSwitchCommand.js +2 -2
- package/dist/cjs/Commands/SetThermostatCommand.js +2 -2
- package/dist/cjs/Commands/SetWindowCoveringCommand.js +2 -2
- package/dist/cjs/Events/ReservationCheckInEvent.js +23 -0
- package/dist/cjs/Events/ReservationCheckOutEvent.js +23 -0
- package/dist/cjs/Events/index.js +6 -0
- package/dist/cjs/SocketIoClient/index.js +23 -4
- package/dist/cjs/schemas/AlarmSchema.d.ts +14 -2
- package/dist/cjs/schemas/CameraSchema.d.ts +1 -0
- package/dist/cjs/schemas/CategorySchema.d.ts +1 -0
- package/dist/cjs/schemas/CourtesySchema.d.ts +1 -0
- package/dist/cjs/schemas/CredentialSchema.d.ts +2 -1
- package/dist/cjs/schemas/DimmerSchema.d.ts +1 -0
- package/dist/cjs/schemas/DiscoveredDeviceSchema.d.ts +4 -0
- package/dist/cjs/schemas/GatewaySchema.d.ts +1 -0
- package/dist/cjs/schemas/LockSchema.d.ts +1 -0
- package/dist/cjs/schemas/MediaSourceSchema.d.ts +4 -1
- package/dist/cjs/schemas/MotionSensorSchema.d.ts +1 -0
- package/dist/cjs/schemas/OrganizationSchema.d.ts +30 -0
- package/dist/cjs/schemas/ProductSchema.d.ts +1 -0
- package/dist/cjs/schemas/PropertySchema.d.ts +26 -35
- package/dist/cjs/schemas/ReservationSchema.d.ts +2 -0
- package/dist/cjs/schemas/RoomSchema.d.ts +28 -4
- package/dist/cjs/schemas/SceneSchema.d.ts +2 -1
- package/dist/cjs/schemas/SpaceSchema.d.ts +1 -0
- package/dist/cjs/schemas/SwitchSchema.d.ts +1 -0
- package/dist/cjs/schemas/SystemUserSchema.d.ts +1 -0
- package/dist/cjs/schemas/ThermostatSchema.d.ts +1 -0
- package/dist/cjs/schemas/UserSchema.d.ts +2 -0
- package/dist/cjs/schemas/WindowCoveringSchema.d.ts +3 -1
- package/dist/cjs/schemas/alarm.json +4 -4
- package/dist/cjs/schemas/credential.json +1 -0
- package/dist/cjs/schemas/definitions.json +1 -0
- package/dist/cjs/schemas/discoveredDevice.json +4 -0
- package/dist/cjs/schemas/mediaSource.json +11 -1
- package/dist/cjs/schemas/organization.json +109 -0
- package/dist/cjs/schemas/property.json +39 -116
- package/dist/cjs/schemas/reservation.json +3 -0
- package/dist/cjs/schemas/scene.json +3 -0
- package/dist/cjs/schemas/windowCovering.json +8 -2
- package/dist/esm/Client.js +504 -193
- package/dist/esm/Client.js.map +4 -4
- package/dist/esm/Commands.js +18 -18
- package/dist/esm/Commands.js.map +2 -2
- package/dist/esm/Events.js +55 -1
- package/dist/esm/Events.js.map +3 -3
- package/dist/esm/Models.js +182 -122
- package/dist/esm/Models.js.map +2 -2
- package/dist/esm/SocketIoClient.js +26 -7
- package/dist/esm/SocketIoClient.js.map +2 -2
- package/dist/esm/defs.js +162 -131
- package/dist/esm/defs.js.map +4 -4
- package/dist/esm/utils.js +1 -0
- package/dist/esm/utils.js.map +2 -2
- package/dist/useCases/{LoginUser.js → CreateScene.js} +2 -2
- package/dist/useCases/DescribeAlarmConfig.js +32 -0
- package/dist/useCases/{DescribeMyProperty.js → DescribeMyOrganization.js} +2 -2
- package/dist/useCases/DescribeMyPasskeyRegistrations.js +32 -0
- package/dist/useCases/FinishRegisterPasskey.js +32 -0
- package/dist/useCases/{RequestLoginLink.js → ListMyProperties.js} +3 -3
- package/dist/useCases/{RequestPWAToken.js → LoginFinish.js} +3 -3
- package/dist/useCases/LoginStart.js +32 -0
- package/dist/useCases/{RequestMyKeyToken.js → RequestLoginToken.js} +3 -3
- package/dist/useCases/SetAlarm.js +32 -0
- package/dist/useCases/SetCustomScene.js +32 -0
- package/dist/useCases/StartRegisterPasskey.js +32 -0
- package/package.json +3 -4
package/dist/esm/defs.js
CHANGED
|
@@ -744,7 +744,7 @@ var require_axios = __commonJS({
|
|
|
744
744
|
}, "toJSONObject");
|
|
745
745
|
var isAsyncFn = kindOfTest("AsyncFunction");
|
|
746
746
|
var isThenable = /* @__PURE__ */ __name((thing) => thing && (isObject(thing) || isFunction(thing)) && isFunction(thing.then) && isFunction(thing.catch), "isThenable");
|
|
747
|
-
var utils = {
|
|
747
|
+
var utils$1 = {
|
|
748
748
|
isArray,
|
|
749
749
|
isArrayBuffer,
|
|
750
750
|
isBuffer,
|
|
@@ -813,7 +813,7 @@ var require_axios = __commonJS({
|
|
|
813
813
|
response && (this.response = response);
|
|
814
814
|
}
|
|
815
815
|
__name(AxiosError, "AxiosError");
|
|
816
|
-
utils.inherits(AxiosError, Error, {
|
|
816
|
+
utils$1.inherits(AxiosError, Error, {
|
|
817
817
|
toJSON: /* @__PURE__ */ __name(function toJSON() {
|
|
818
818
|
return {
|
|
819
819
|
// Standard
|
|
@@ -828,7 +828,7 @@ var require_axios = __commonJS({
|
|
|
828
828
|
columnNumber: this.columnNumber,
|
|
829
829
|
stack: this.stack,
|
|
830
830
|
// Axios
|
|
831
|
-
config: utils.toJSONObject(this.config),
|
|
831
|
+
config: utils$1.toJSONObject(this.config),
|
|
832
832
|
code: this.code,
|
|
833
833
|
status: this.response && this.response.status ? this.response.status : null
|
|
834
834
|
};
|
|
@@ -857,7 +857,7 @@ var require_axios = __commonJS({
|
|
|
857
857
|
Object.defineProperty(prototype$1, "isAxiosError", { value: true });
|
|
858
858
|
AxiosError.from = (error, code, config, request, response, customProps) => {
|
|
859
859
|
const axiosError = Object.create(prototype$1);
|
|
860
|
-
utils.toFlatObject(error, axiosError, /* @__PURE__ */ __name(function filter(obj) {
|
|
860
|
+
utils$1.toFlatObject(error, axiosError, /* @__PURE__ */ __name(function filter(obj) {
|
|
861
861
|
return obj !== Error.prototype;
|
|
862
862
|
}, "filter"), (prop) => {
|
|
863
863
|
return prop !== "isAxiosError";
|
|
@@ -870,11 +870,11 @@ var require_axios = __commonJS({
|
|
|
870
870
|
};
|
|
871
871
|
var httpAdapter = null;
|
|
872
872
|
function isVisitable(thing) {
|
|
873
|
-
return utils.isPlainObject(thing) || utils.isArray(thing);
|
|
873
|
+
return utils$1.isPlainObject(thing) || utils$1.isArray(thing);
|
|
874
874
|
}
|
|
875
875
|
__name(isVisitable, "isVisitable");
|
|
876
876
|
function removeBrackets(key) {
|
|
877
|
-
return utils.endsWith(key, "[]") ? key.slice(0, -2) : key;
|
|
877
|
+
return utils$1.endsWith(key, "[]") ? key.slice(0, -2) : key;
|
|
878
878
|
}
|
|
879
879
|
__name(removeBrackets, "removeBrackets");
|
|
880
880
|
function renderKey(path, key, dots) {
|
|
@@ -887,43 +887,43 @@ var require_axios = __commonJS({
|
|
|
887
887
|
}
|
|
888
888
|
__name(renderKey, "renderKey");
|
|
889
889
|
function isFlatArray(arr) {
|
|
890
|
-
return utils.isArray(arr) && !arr.some(isVisitable);
|
|
890
|
+
return utils$1.isArray(arr) && !arr.some(isVisitable);
|
|
891
891
|
}
|
|
892
892
|
__name(isFlatArray, "isFlatArray");
|
|
893
|
-
var predicates = utils.toFlatObject(utils, {}, null, /* @__PURE__ */ __name(function filter(prop) {
|
|
893
|
+
var predicates = utils$1.toFlatObject(utils$1, {}, null, /* @__PURE__ */ __name(function filter(prop) {
|
|
894
894
|
return /^is[A-Z]/.test(prop);
|
|
895
895
|
}, "filter"));
|
|
896
896
|
function toFormData(obj, formData, options) {
|
|
897
|
-
if (!utils.isObject(obj)) {
|
|
897
|
+
if (!utils$1.isObject(obj)) {
|
|
898
898
|
throw new TypeError("target must be an object");
|
|
899
899
|
}
|
|
900
900
|
formData = formData || new FormData();
|
|
901
|
-
options = utils.toFlatObject(options, {
|
|
901
|
+
options = utils$1.toFlatObject(options, {
|
|
902
902
|
metaTokens: true,
|
|
903
903
|
dots: false,
|
|
904
904
|
indexes: false
|
|
905
905
|
}, false, /* @__PURE__ */ __name(function defined(option, source) {
|
|
906
|
-
return !utils.isUndefined(source[option]);
|
|
906
|
+
return !utils$1.isUndefined(source[option]);
|
|
907
907
|
}, "defined"));
|
|
908
908
|
const metaTokens = options.metaTokens;
|
|
909
909
|
const visitor = options.visitor || defaultVisitor;
|
|
910
910
|
const dots = options.dots;
|
|
911
911
|
const indexes = options.indexes;
|
|
912
912
|
const _Blob = options.Blob || typeof Blob !== "undefined" && Blob;
|
|
913
|
-
const useBlob = _Blob && utils.isSpecCompliantForm(formData);
|
|
914
|
-
if (!utils.isFunction(visitor)) {
|
|
913
|
+
const useBlob = _Blob && utils$1.isSpecCompliantForm(formData);
|
|
914
|
+
if (!utils$1.isFunction(visitor)) {
|
|
915
915
|
throw new TypeError("visitor must be a function");
|
|
916
916
|
}
|
|
917
917
|
function convertValue(value) {
|
|
918
918
|
if (value === null)
|
|
919
919
|
return "";
|
|
920
|
-
if (utils.isDate(value)) {
|
|
920
|
+
if (utils$1.isDate(value)) {
|
|
921
921
|
return value.toISOString();
|
|
922
922
|
}
|
|
923
|
-
if (!useBlob && utils.isBlob(value)) {
|
|
923
|
+
if (!useBlob && utils$1.isBlob(value)) {
|
|
924
924
|
throw new AxiosError("Blob is not supported. Use a Buffer instead.");
|
|
925
925
|
}
|
|
926
|
-
if (utils.isArrayBuffer(value) || utils.isTypedArray(value)) {
|
|
926
|
+
if (utils$1.isArrayBuffer(value) || utils$1.isTypedArray(value)) {
|
|
927
927
|
return useBlob && typeof Blob === "function" ? new Blob([value]) : Buffer.from(value);
|
|
928
928
|
}
|
|
929
929
|
return value;
|
|
@@ -932,13 +932,13 @@ var require_axios = __commonJS({
|
|
|
932
932
|
function defaultVisitor(value, key, path) {
|
|
933
933
|
let arr = value;
|
|
934
934
|
if (value && !path && typeof value === "object") {
|
|
935
|
-
if (utils.endsWith(key, "{}")) {
|
|
935
|
+
if (utils$1.endsWith(key, "{}")) {
|
|
936
936
|
key = metaTokens ? key : key.slice(0, -2);
|
|
937
937
|
value = JSON.stringify(value);
|
|
938
|
-
} else if (utils.isArray(value) && isFlatArray(value) || (utils.isFileList(value) || utils.endsWith(key, "[]")) && (arr = utils.toArray(value))) {
|
|
938
|
+
} else if (utils$1.isArray(value) && isFlatArray(value) || (utils$1.isFileList(value) || utils$1.endsWith(key, "[]")) && (arr = utils$1.toArray(value))) {
|
|
939
939
|
key = removeBrackets(key);
|
|
940
940
|
arr.forEach(/* @__PURE__ */ __name(function each(el, index) {
|
|
941
|
-
!(utils.isUndefined(el) || el === null) && formData.append(
|
|
941
|
+
!(utils$1.isUndefined(el) || el === null) && formData.append(
|
|
942
942
|
// eslint-disable-next-line no-nested-ternary
|
|
943
943
|
indexes === true ? renderKey([key], index, dots) : indexes === null ? key : key + "[]",
|
|
944
944
|
convertValue(el)
|
|
@@ -961,17 +961,17 @@ var require_axios = __commonJS({
|
|
|
961
961
|
isVisitable
|
|
962
962
|
});
|
|
963
963
|
function build(value, path) {
|
|
964
|
-
if (utils.isUndefined(value))
|
|
964
|
+
if (utils$1.isUndefined(value))
|
|
965
965
|
return;
|
|
966
966
|
if (stack.indexOf(value) !== -1) {
|
|
967
967
|
throw Error("Circular reference detected in " + path.join("."));
|
|
968
968
|
}
|
|
969
969
|
stack.push(value);
|
|
970
|
-
utils.forEach(value, /* @__PURE__ */ __name(function each(el, key) {
|
|
971
|
-
const result = !(utils.isUndefined(el) || el === null) && visitor.call(
|
|
970
|
+
utils$1.forEach(value, /* @__PURE__ */ __name(function each(el, key) {
|
|
971
|
+
const result = !(utils$1.isUndefined(el) || el === null) && visitor.call(
|
|
972
972
|
formData,
|
|
973
973
|
el,
|
|
974
|
-
utils.isString(key) ? key.trim() : key,
|
|
974
|
+
utils$1.isString(key) ? key.trim() : key,
|
|
975
975
|
path,
|
|
976
976
|
exposedHelpers
|
|
977
977
|
);
|
|
@@ -982,7 +982,7 @@ var require_axios = __commonJS({
|
|
|
982
982
|
stack.pop();
|
|
983
983
|
}
|
|
984
984
|
__name(build, "build");
|
|
985
|
-
if (!utils.isObject(obj)) {
|
|
985
|
+
if (!utils$1.isObject(obj)) {
|
|
986
986
|
throw new TypeError("data must be an object");
|
|
987
987
|
}
|
|
988
988
|
build(obj);
|
|
@@ -1035,7 +1035,7 @@ var require_axios = __commonJS({
|
|
|
1035
1035
|
if (serializeFn) {
|
|
1036
1036
|
serializedParams = serializeFn(params, options);
|
|
1037
1037
|
} else {
|
|
1038
|
-
serializedParams = utils.isURLSearchParams(params) ? params.toString() : new AxiosURLSearchParams(params, options).toString(_encode);
|
|
1038
|
+
serializedParams = utils$1.isURLSearchParams(params) ? params.toString() : new AxiosURLSearchParams(params, options).toString(_encode);
|
|
1039
1039
|
}
|
|
1040
1040
|
if (serializedParams) {
|
|
1041
1041
|
const hashmarkIndex = url.indexOf("#");
|
|
@@ -1104,7 +1104,7 @@ var require_axios = __commonJS({
|
|
|
1104
1104
|
* @returns {void}
|
|
1105
1105
|
*/
|
|
1106
1106
|
forEach(fn) {
|
|
1107
|
-
utils.forEach(this.handlers, /* @__PURE__ */ __name(function forEachHandler(h) {
|
|
1107
|
+
utils$1.forEach(this.handlers, /* @__PURE__ */ __name(function forEachHandler(h) {
|
|
1108
1108
|
if (h !== null) {
|
|
1109
1109
|
fn(h);
|
|
1110
1110
|
}
|
|
@@ -1120,32 +1120,37 @@ var require_axios = __commonJS({
|
|
|
1120
1120
|
var URLSearchParams$1 = typeof URLSearchParams !== "undefined" ? URLSearchParams : AxiosURLSearchParams;
|
|
1121
1121
|
var FormData$1 = typeof FormData !== "undefined" ? FormData : null;
|
|
1122
1122
|
var Blob$1 = typeof Blob !== "undefined" ? Blob : null;
|
|
1123
|
-
var
|
|
1124
|
-
let product;
|
|
1125
|
-
if (typeof navigator !== "undefined" && ((product = navigator.product) === "ReactNative" || product === "NativeScript" || product === "NS")) {
|
|
1126
|
-
return false;
|
|
1127
|
-
}
|
|
1128
|
-
return typeof window !== "undefined" && typeof document !== "undefined";
|
|
1129
|
-
})();
|
|
1130
|
-
var isStandardBrowserWebWorkerEnv = (() => {
|
|
1131
|
-
return typeof WorkerGlobalScope !== "undefined" && // eslint-disable-next-line no-undef
|
|
1132
|
-
self instanceof WorkerGlobalScope && typeof self.importScripts === "function";
|
|
1133
|
-
})();
|
|
1134
|
-
var platform = {
|
|
1123
|
+
var platform$1 = {
|
|
1135
1124
|
isBrowser: true,
|
|
1136
1125
|
classes: {
|
|
1137
1126
|
URLSearchParams: URLSearchParams$1,
|
|
1138
1127
|
FormData: FormData$1,
|
|
1139
1128
|
Blob: Blob$1
|
|
1140
1129
|
},
|
|
1141
|
-
isStandardBrowserEnv,
|
|
1142
|
-
isStandardBrowserWebWorkerEnv,
|
|
1143
1130
|
protocols: ["http", "https", "file", "blob", "url", "data"]
|
|
1144
1131
|
};
|
|
1132
|
+
var hasBrowserEnv = typeof window !== "undefined" && typeof document !== "undefined";
|
|
1133
|
+
var hasStandardBrowserEnv = ((product) => {
|
|
1134
|
+
return hasBrowserEnv && ["ReactNative", "NativeScript", "NS"].indexOf(product) < 0;
|
|
1135
|
+
})(typeof navigator !== "undefined" && navigator.product);
|
|
1136
|
+
var hasStandardBrowserWebWorkerEnv = (() => {
|
|
1137
|
+
return typeof WorkerGlobalScope !== "undefined" && // eslint-disable-next-line no-undef
|
|
1138
|
+
self instanceof WorkerGlobalScope && typeof self.importScripts === "function";
|
|
1139
|
+
})();
|
|
1140
|
+
var utils = /* @__PURE__ */ Object.freeze({
|
|
1141
|
+
__proto__: null,
|
|
1142
|
+
hasBrowserEnv,
|
|
1143
|
+
hasStandardBrowserWebWorkerEnv,
|
|
1144
|
+
hasStandardBrowserEnv
|
|
1145
|
+
});
|
|
1146
|
+
var platform = {
|
|
1147
|
+
...utils,
|
|
1148
|
+
...platform$1
|
|
1149
|
+
};
|
|
1145
1150
|
function toURLEncodedForm(data, options) {
|
|
1146
1151
|
return toFormData(data, new platform.classes.URLSearchParams(), Object.assign({
|
|
1147
1152
|
visitor: function(value, key, path, helpers) {
|
|
1148
|
-
if (platform.isNode && utils.isBuffer(value)) {
|
|
1153
|
+
if (platform.isNode && utils$1.isBuffer(value)) {
|
|
1149
1154
|
this.append(key, value.toString("base64"));
|
|
1150
1155
|
return false;
|
|
1151
1156
|
}
|
|
@@ -1155,7 +1160,7 @@ var require_axios = __commonJS({
|
|
|
1155
1160
|
}
|
|
1156
1161
|
__name(toURLEncodedForm, "toURLEncodedForm");
|
|
1157
1162
|
function parsePropPath(name) {
|
|
1158
|
-
return utils.matchAll(/\w+|\[(\w*)]/g, name).map((match) => {
|
|
1163
|
+
return utils$1.matchAll(/\w+|\[(\w*)]/g, name).map((match) => {
|
|
1159
1164
|
return match[0] === "[]" ? "" : match[1] || match[0];
|
|
1160
1165
|
});
|
|
1161
1166
|
}
|
|
@@ -1178,28 +1183,28 @@ var require_axios = __commonJS({
|
|
|
1178
1183
|
let name = path[index++];
|
|
1179
1184
|
const isNumericKey = Number.isFinite(+name);
|
|
1180
1185
|
const isLast = index >= path.length;
|
|
1181
|
-
name = !name && utils.isArray(target) ? target.length : name;
|
|
1186
|
+
name = !name && utils$1.isArray(target) ? target.length : name;
|
|
1182
1187
|
if (isLast) {
|
|
1183
|
-
if (utils.hasOwnProp(target, name)) {
|
|
1188
|
+
if (utils$1.hasOwnProp(target, name)) {
|
|
1184
1189
|
target[name] = [target[name], value];
|
|
1185
1190
|
} else {
|
|
1186
1191
|
target[name] = value;
|
|
1187
1192
|
}
|
|
1188
1193
|
return !isNumericKey;
|
|
1189
1194
|
}
|
|
1190
|
-
if (!target[name] || !utils.isObject(target[name])) {
|
|
1195
|
+
if (!target[name] || !utils$1.isObject(target[name])) {
|
|
1191
1196
|
target[name] = [];
|
|
1192
1197
|
}
|
|
1193
1198
|
const result = buildPath(path, value, target[name], index);
|
|
1194
|
-
if (result && utils.isArray(target[name])) {
|
|
1199
|
+
if (result && utils$1.isArray(target[name])) {
|
|
1195
1200
|
target[name] = arrayToObject(target[name]);
|
|
1196
1201
|
}
|
|
1197
1202
|
return !isNumericKey;
|
|
1198
1203
|
}
|
|
1199
1204
|
__name(buildPath, "buildPath");
|
|
1200
|
-
if (utils.isFormData(formData) && utils.isFunction(formData.entries)) {
|
|
1205
|
+
if (utils$1.isFormData(formData) && utils$1.isFunction(formData.entries)) {
|
|
1201
1206
|
const obj = {};
|
|
1202
|
-
utils.forEachEntry(formData, (name, value) => {
|
|
1207
|
+
utils$1.forEachEntry(formData, (name, value) => {
|
|
1203
1208
|
buildPath(parsePropPath(name), value, obj, 0);
|
|
1204
1209
|
});
|
|
1205
1210
|
return obj;
|
|
@@ -1208,10 +1213,10 @@ var require_axios = __commonJS({
|
|
|
1208
1213
|
}
|
|
1209
1214
|
__name(formDataToJSON, "formDataToJSON");
|
|
1210
1215
|
function stringifySafely(rawValue, parser, encoder) {
|
|
1211
|
-
if (utils.isString(rawValue)) {
|
|
1216
|
+
if (utils$1.isString(rawValue)) {
|
|
1212
1217
|
try {
|
|
1213
1218
|
(parser || JSON.parse)(rawValue);
|
|
1214
|
-
return utils.trim(rawValue);
|
|
1219
|
+
return utils$1.trim(rawValue);
|
|
1215
1220
|
} catch (e) {
|
|
1216
1221
|
if (e.name !== "SyntaxError") {
|
|
1217
1222
|
throw e;
|
|
@@ -1227,24 +1232,24 @@ var require_axios = __commonJS({
|
|
|
1227
1232
|
transformRequest: [/* @__PURE__ */ __name(function transformRequest(data, headers) {
|
|
1228
1233
|
const contentType = headers.getContentType() || "";
|
|
1229
1234
|
const hasJSONContentType = contentType.indexOf("application/json") > -1;
|
|
1230
|
-
const isObjectPayload = utils.isObject(data);
|
|
1231
|
-
if (isObjectPayload && utils.isHTMLForm(data)) {
|
|
1235
|
+
const isObjectPayload = utils$1.isObject(data);
|
|
1236
|
+
if (isObjectPayload && utils$1.isHTMLForm(data)) {
|
|
1232
1237
|
data = new FormData(data);
|
|
1233
1238
|
}
|
|
1234
|
-
const isFormData2 = utils.isFormData(data);
|
|
1239
|
+
const isFormData2 = utils$1.isFormData(data);
|
|
1235
1240
|
if (isFormData2) {
|
|
1236
1241
|
if (!hasJSONContentType) {
|
|
1237
1242
|
return data;
|
|
1238
1243
|
}
|
|
1239
1244
|
return hasJSONContentType ? JSON.stringify(formDataToJSON(data)) : data;
|
|
1240
1245
|
}
|
|
1241
|
-
if (utils.isArrayBuffer(data) || utils.isBuffer(data) || utils.isStream(data) || utils.isFile(data) || utils.isBlob(data)) {
|
|
1246
|
+
if (utils$1.isArrayBuffer(data) || utils$1.isBuffer(data) || utils$1.isStream(data) || utils$1.isFile(data) || utils$1.isBlob(data)) {
|
|
1242
1247
|
return data;
|
|
1243
1248
|
}
|
|
1244
|
-
if (utils.isArrayBufferView(data)) {
|
|
1249
|
+
if (utils$1.isArrayBufferView(data)) {
|
|
1245
1250
|
return data.buffer;
|
|
1246
1251
|
}
|
|
1247
|
-
if (utils.isURLSearchParams(data)) {
|
|
1252
|
+
if (utils$1.isURLSearchParams(data)) {
|
|
1248
1253
|
headers.setContentType("application/x-www-form-urlencoded;charset=utf-8", false);
|
|
1249
1254
|
return data.toString();
|
|
1250
1255
|
}
|
|
@@ -1253,7 +1258,7 @@ var require_axios = __commonJS({
|
|
|
1253
1258
|
if (contentType.indexOf("application/x-www-form-urlencoded") > -1) {
|
|
1254
1259
|
return toURLEncodedForm(data, this.formSerializer).toString();
|
|
1255
1260
|
}
|
|
1256
|
-
if ((isFileList2 = utils.isFileList(data)) || contentType.indexOf("multipart/form-data") > -1) {
|
|
1261
|
+
if ((isFileList2 = utils$1.isFileList(data)) || contentType.indexOf("multipart/form-data") > -1) {
|
|
1257
1262
|
const _FormData = this.env && this.env.FormData;
|
|
1258
1263
|
return toFormData(
|
|
1259
1264
|
isFileList2 ? { "files[]": data } : data,
|
|
@@ -1272,7 +1277,7 @@ var require_axios = __commonJS({
|
|
|
1272
1277
|
const transitional = this.transitional || defaults.transitional;
|
|
1273
1278
|
const forcedJSONParsing = transitional && transitional.forcedJSONParsing;
|
|
1274
1279
|
const JSONRequested = this.responseType === "json";
|
|
1275
|
-
if (data && utils.isString(data) && (forcedJSONParsing && !this.responseType || JSONRequested)) {
|
|
1280
|
+
if (data && utils$1.isString(data) && (forcedJSONParsing && !this.responseType || JSONRequested)) {
|
|
1276
1281
|
const silentJSONParsing = transitional && transitional.silentJSONParsing;
|
|
1277
1282
|
const strictJSONParsing = !silentJSONParsing && JSONRequested;
|
|
1278
1283
|
try {
|
|
@@ -1311,11 +1316,11 @@ var require_axios = __commonJS({
|
|
|
1311
1316
|
}
|
|
1312
1317
|
}
|
|
1313
1318
|
};
|
|
1314
|
-
utils.forEach(["delete", "get", "head", "post", "put", "patch"], (method) => {
|
|
1319
|
+
utils$1.forEach(["delete", "get", "head", "post", "put", "patch"], (method) => {
|
|
1315
1320
|
defaults.headers[method] = {};
|
|
1316
1321
|
});
|
|
1317
1322
|
var defaults$1 = defaults;
|
|
1318
|
-
var ignoreDuplicateOf = utils.toObjectSet([
|
|
1323
|
+
var ignoreDuplicateOf = utils$1.toObjectSet([
|
|
1319
1324
|
"age",
|
|
1320
1325
|
"authorization",
|
|
1321
1326
|
"content-length",
|
|
@@ -1367,7 +1372,7 @@ var require_axios = __commonJS({
|
|
|
1367
1372
|
if (value === false || value == null) {
|
|
1368
1373
|
return value;
|
|
1369
1374
|
}
|
|
1370
|
-
return utils.isArray(value) ? value.map(normalizeValue) : String(value);
|
|
1375
|
+
return utils$1.isArray(value) ? value.map(normalizeValue) : String(value);
|
|
1371
1376
|
}
|
|
1372
1377
|
__name(normalizeValue, "normalizeValue");
|
|
1373
1378
|
function parseTokens(str) {
|
|
@@ -1382,18 +1387,18 @@ var require_axios = __commonJS({
|
|
|
1382
1387
|
__name(parseTokens, "parseTokens");
|
|
1383
1388
|
var isValidHeaderName = /* @__PURE__ */ __name((str) => /^[-_a-zA-Z0-9^`|~,!#$%&'*+.]+$/.test(str.trim()), "isValidHeaderName");
|
|
1384
1389
|
function matchHeaderValue(context, value, header, filter, isHeaderNameFilter) {
|
|
1385
|
-
if (utils.isFunction(filter)) {
|
|
1390
|
+
if (utils$1.isFunction(filter)) {
|
|
1386
1391
|
return filter.call(this, value, header);
|
|
1387
1392
|
}
|
|
1388
1393
|
if (isHeaderNameFilter) {
|
|
1389
1394
|
value = header;
|
|
1390
1395
|
}
|
|
1391
|
-
if (!utils.isString(value))
|
|
1396
|
+
if (!utils$1.isString(value))
|
|
1392
1397
|
return;
|
|
1393
|
-
if (utils.isString(filter)) {
|
|
1398
|
+
if (utils$1.isString(filter)) {
|
|
1394
1399
|
return value.indexOf(filter) !== -1;
|
|
1395
1400
|
}
|
|
1396
|
-
if (utils.isRegExp(filter)) {
|
|
1401
|
+
if (utils$1.isRegExp(filter)) {
|
|
1397
1402
|
return filter.test(value);
|
|
1398
1403
|
}
|
|
1399
1404
|
}
|
|
@@ -1405,7 +1410,7 @@ var require_axios = __commonJS({
|
|
|
1405
1410
|
}
|
|
1406
1411
|
__name(formatHeader, "formatHeader");
|
|
1407
1412
|
function buildAccessors(obj, header) {
|
|
1408
|
-
const accessorName = utils.toCamelCase(" " + header);
|
|
1413
|
+
const accessorName = utils$1.toCamelCase(" " + header);
|
|
1409
1414
|
["get", "set", "has"].forEach((methodName) => {
|
|
1410
1415
|
Object.defineProperty(obj, methodName + accessorName, {
|
|
1411
1416
|
value: function(arg1, arg2, arg3) {
|
|
@@ -1430,16 +1435,16 @@ var require_axios = __commonJS({
|
|
|
1430
1435
|
if (!lHeader) {
|
|
1431
1436
|
throw new Error("header name must be a non-empty string");
|
|
1432
1437
|
}
|
|
1433
|
-
const key = utils.findKey(self2, lHeader);
|
|
1438
|
+
const key = utils$1.findKey(self2, lHeader);
|
|
1434
1439
|
if (!key || self2[key] === void 0 || _rewrite === true || _rewrite === void 0 && self2[key] !== false) {
|
|
1435
1440
|
self2[key || _header] = normalizeValue(_value);
|
|
1436
1441
|
}
|
|
1437
1442
|
}
|
|
1438
1443
|
__name(setHeader, "setHeader");
|
|
1439
|
-
const setHeaders = /* @__PURE__ */ __name((headers, _rewrite) => utils.forEach(headers, (_value, _header) => setHeader(_value, _header, _rewrite)), "setHeaders");
|
|
1440
|
-
if (utils.isPlainObject(header) || header instanceof this.constructor) {
|
|
1444
|
+
const setHeaders = /* @__PURE__ */ __name((headers, _rewrite) => utils$1.forEach(headers, (_value, _header) => setHeader(_value, _header, _rewrite)), "setHeaders");
|
|
1445
|
+
if (utils$1.isPlainObject(header) || header instanceof this.constructor) {
|
|
1441
1446
|
setHeaders(header, valueOrRewrite);
|
|
1442
|
-
} else if (utils.isString(header) && (header = header.trim()) && !isValidHeaderName(header)) {
|
|
1447
|
+
} else if (utils$1.isString(header) && (header = header.trim()) && !isValidHeaderName(header)) {
|
|
1443
1448
|
setHeaders(parseHeaders(header), valueOrRewrite);
|
|
1444
1449
|
} else {
|
|
1445
1450
|
header != null && setHeader(valueOrRewrite, header, rewrite);
|
|
@@ -1449,7 +1454,7 @@ var require_axios = __commonJS({
|
|
|
1449
1454
|
get(header, parser) {
|
|
1450
1455
|
header = normalizeHeader(header);
|
|
1451
1456
|
if (header) {
|
|
1452
|
-
const key = utils.findKey(this, header);
|
|
1457
|
+
const key = utils$1.findKey(this, header);
|
|
1453
1458
|
if (key) {
|
|
1454
1459
|
const value = this[key];
|
|
1455
1460
|
if (!parser) {
|
|
@@ -1458,10 +1463,10 @@ var require_axios = __commonJS({
|
|
|
1458
1463
|
if (parser === true) {
|
|
1459
1464
|
return parseTokens(value);
|
|
1460
1465
|
}
|
|
1461
|
-
if (utils.isFunction(parser)) {
|
|
1466
|
+
if (utils$1.isFunction(parser)) {
|
|
1462
1467
|
return parser.call(this, value, key);
|
|
1463
1468
|
}
|
|
1464
|
-
if (utils.isRegExp(parser)) {
|
|
1469
|
+
if (utils$1.isRegExp(parser)) {
|
|
1465
1470
|
return parser.exec(value);
|
|
1466
1471
|
}
|
|
1467
1472
|
throw new TypeError("parser must be boolean|regexp|function");
|
|
@@ -1471,7 +1476,7 @@ var require_axios = __commonJS({
|
|
|
1471
1476
|
has(header, matcher) {
|
|
1472
1477
|
header = normalizeHeader(header);
|
|
1473
1478
|
if (header) {
|
|
1474
|
-
const key = utils.findKey(this, header);
|
|
1479
|
+
const key = utils$1.findKey(this, header);
|
|
1475
1480
|
return !!(key && this[key] !== void 0 && (!matcher || matchHeaderValue(this, this[key], key, matcher)));
|
|
1476
1481
|
}
|
|
1477
1482
|
return false;
|
|
@@ -1482,7 +1487,7 @@ var require_axios = __commonJS({
|
|
|
1482
1487
|
function deleteHeader(_header) {
|
|
1483
1488
|
_header = normalizeHeader(_header);
|
|
1484
1489
|
if (_header) {
|
|
1485
|
-
const key = utils.findKey(self2, _header);
|
|
1490
|
+
const key = utils$1.findKey(self2, _header);
|
|
1486
1491
|
if (key && (!matcher || matchHeaderValue(self2, self2[key], key, matcher))) {
|
|
1487
1492
|
delete self2[key];
|
|
1488
1493
|
deleted = true;
|
|
@@ -1490,7 +1495,7 @@ var require_axios = __commonJS({
|
|
|
1490
1495
|
}
|
|
1491
1496
|
}
|
|
1492
1497
|
__name(deleteHeader, "deleteHeader");
|
|
1493
|
-
if (utils.isArray(header)) {
|
|
1498
|
+
if (utils$1.isArray(header)) {
|
|
1494
1499
|
header.forEach(deleteHeader);
|
|
1495
1500
|
} else {
|
|
1496
1501
|
deleteHeader(header);
|
|
@@ -1513,8 +1518,8 @@ var require_axios = __commonJS({
|
|
|
1513
1518
|
normalize(format) {
|
|
1514
1519
|
const self2 = this;
|
|
1515
1520
|
const headers = {};
|
|
1516
|
-
utils.forEach(this, (value, header) => {
|
|
1517
|
-
const key = utils.findKey(headers, header);
|
|
1521
|
+
utils$1.forEach(this, (value, header) => {
|
|
1522
|
+
const key = utils$1.findKey(headers, header);
|
|
1518
1523
|
if (key) {
|
|
1519
1524
|
self2[key] = normalizeValue(value);
|
|
1520
1525
|
delete self2[header];
|
|
@@ -1534,8 +1539,8 @@ var require_axios = __commonJS({
|
|
|
1534
1539
|
}
|
|
1535
1540
|
toJSON(asStrings) {
|
|
1536
1541
|
const obj = /* @__PURE__ */ Object.create(null);
|
|
1537
|
-
utils.forEach(this, (value, header) => {
|
|
1538
|
-
value != null && value !== false && (obj[header] = asStrings && utils.isArray(value) ? value.join(", ") : value);
|
|
1542
|
+
utils$1.forEach(this, (value, header) => {
|
|
1543
|
+
value != null && value !== false && (obj[header] = asStrings && utils$1.isArray(value) ? value.join(", ") : value);
|
|
1539
1544
|
});
|
|
1540
1545
|
return obj;
|
|
1541
1546
|
}
|
|
@@ -1570,12 +1575,12 @@ var require_axios = __commonJS({
|
|
|
1570
1575
|
}
|
|
1571
1576
|
}
|
|
1572
1577
|
__name(defineAccessor, "defineAccessor");
|
|
1573
|
-
utils.isArray(header) ? header.forEach(defineAccessor) : defineAccessor(header);
|
|
1578
|
+
utils$1.isArray(header) ? header.forEach(defineAccessor) : defineAccessor(header);
|
|
1574
1579
|
return this;
|
|
1575
1580
|
}
|
|
1576
1581
|
};
|
|
1577
1582
|
AxiosHeaders.accessor(["Content-Type", "Content-Length", "Accept", "Accept-Encoding", "User-Agent", "Authorization"]);
|
|
1578
|
-
utils.reduceDescriptors(AxiosHeaders.prototype, ({ value }, key) => {
|
|
1583
|
+
utils$1.reduceDescriptors(AxiosHeaders.prototype, ({ value }, key) => {
|
|
1579
1584
|
let mapped = key[0].toUpperCase() + key.slice(1);
|
|
1580
1585
|
return {
|
|
1581
1586
|
get: () => value,
|
|
@@ -1584,14 +1589,14 @@ var require_axios = __commonJS({
|
|
|
1584
1589
|
}
|
|
1585
1590
|
};
|
|
1586
1591
|
});
|
|
1587
|
-
utils.freezeMethods(AxiosHeaders);
|
|
1592
|
+
utils$1.freezeMethods(AxiosHeaders);
|
|
1588
1593
|
var AxiosHeaders$1 = AxiosHeaders;
|
|
1589
1594
|
function transformData(fns, response) {
|
|
1590
1595
|
const config = this || defaults$1;
|
|
1591
1596
|
const context = response || config;
|
|
1592
1597
|
const headers = AxiosHeaders$1.from(context.headers);
|
|
1593
1598
|
let data = context.data;
|
|
1594
|
-
utils.forEach(fns, /* @__PURE__ */ __name(function transform(fn) {
|
|
1599
|
+
utils$1.forEach(fns, /* @__PURE__ */ __name(function transform(fn) {
|
|
1595
1600
|
data = fn.call(config, data, headers.normalize(), response ? response.status : void 0);
|
|
1596
1601
|
}, "transform"));
|
|
1597
1602
|
headers.normalize();
|
|
@@ -1607,7 +1612,7 @@ var require_axios = __commonJS({
|
|
|
1607
1612
|
this.name = "CanceledError";
|
|
1608
1613
|
}
|
|
1609
1614
|
__name(CanceledError, "CanceledError");
|
|
1610
|
-
utils.inherits(CanceledError, AxiosError, {
|
|
1615
|
+
utils$1.inherits(CanceledError, AxiosError, {
|
|
1611
1616
|
__CANCEL__: true
|
|
1612
1617
|
});
|
|
1613
1618
|
function settle(resolve, reject, response) {
|
|
@@ -1625,20 +1630,20 @@ var require_axios = __commonJS({
|
|
|
1625
1630
|
}
|
|
1626
1631
|
}
|
|
1627
1632
|
__name(settle, "settle");
|
|
1628
|
-
var cookies = platform.
|
|
1633
|
+
var cookies = platform.hasStandardBrowserEnv ? (
|
|
1629
1634
|
// Standard browser envs support document.cookie
|
|
1630
1635
|
(/* @__PURE__ */ __name(function standardBrowserEnv() {
|
|
1631
1636
|
return {
|
|
1632
1637
|
write: /* @__PURE__ */ __name(function write(name, value, expires, path, domain, secure) {
|
|
1633
1638
|
const cookie = [];
|
|
1634
1639
|
cookie.push(name + "=" + encodeURIComponent(value));
|
|
1635
|
-
if (utils.isNumber(expires)) {
|
|
1640
|
+
if (utils$1.isNumber(expires)) {
|
|
1636
1641
|
cookie.push("expires=" + new Date(expires).toGMTString());
|
|
1637
1642
|
}
|
|
1638
|
-
if (utils.isString(path)) {
|
|
1643
|
+
if (utils$1.isString(path)) {
|
|
1639
1644
|
cookie.push("path=" + path);
|
|
1640
1645
|
}
|
|
1641
|
-
if (utils.isString(domain)) {
|
|
1646
|
+
if (utils$1.isString(domain)) {
|
|
1642
1647
|
cookie.push("domain=" + domain);
|
|
1643
1648
|
}
|
|
1644
1649
|
if (secure === true) {
|
|
@@ -1684,7 +1689,7 @@ var require_axios = __commonJS({
|
|
|
1684
1689
|
return requestedURL;
|
|
1685
1690
|
}
|
|
1686
1691
|
__name(buildFullPath, "buildFullPath");
|
|
1687
|
-
var isURLSameOrigin = platform.
|
|
1692
|
+
var isURLSameOrigin = platform.hasStandardBrowserEnv ? (
|
|
1688
1693
|
// Standard browser envs have full support of the APIs needed to test
|
|
1689
1694
|
// whether the request URL is of the same origin as current location.
|
|
1690
1695
|
(/* @__PURE__ */ __name(function standardBrowserEnv() {
|
|
@@ -1712,7 +1717,7 @@ var require_axios = __commonJS({
|
|
|
1712
1717
|
__name(resolveURL, "resolveURL");
|
|
1713
1718
|
originURL = resolveURL(window.location.href);
|
|
1714
1719
|
return /* @__PURE__ */ __name(function isURLSameOrigin2(requestURL) {
|
|
1715
|
-
const parsed = utils.isString(requestURL) ? resolveURL(requestURL) : requestURL;
|
|
1720
|
+
const parsed = utils$1.isString(requestURL) ? resolveURL(requestURL) : requestURL;
|
|
1716
1721
|
return parsed.protocol === originURL.protocol && parsed.host === originURL.host;
|
|
1717
1722
|
}, "isURLSameOrigin");
|
|
1718
1723
|
}, "standardBrowserEnv"))()
|
|
@@ -1804,13 +1809,12 @@ var require_axios = __commonJS({
|
|
|
1804
1809
|
}
|
|
1805
1810
|
__name(done, "done");
|
|
1806
1811
|
let contentType;
|
|
1807
|
-
if (utils.isFormData(requestData)) {
|
|
1808
|
-
if (platform.
|
|
1812
|
+
if (utils$1.isFormData(requestData)) {
|
|
1813
|
+
if (platform.hasStandardBrowserEnv || platform.hasStandardBrowserWebWorkerEnv) {
|
|
1809
1814
|
requestHeaders.setContentType(false);
|
|
1810
|
-
} else if (
|
|
1811
|
-
|
|
1812
|
-
|
|
1813
|
-
requestHeaders.setContentType(contentType.replace(/^\s*(multipart\/form-data);+/, "$1"));
|
|
1815
|
+
} else if ((contentType = requestHeaders.getContentType()) !== false) {
|
|
1816
|
+
const [type, ...tokens] = contentType ? contentType.split(";").map((token) => token.trim()).filter(Boolean) : [];
|
|
1817
|
+
requestHeaders.setContentType([type || "multipart/form-data", ...tokens].join("; "));
|
|
1814
1818
|
}
|
|
1815
1819
|
}
|
|
1816
1820
|
let request = new XMLHttpRequest();
|
|
@@ -1886,19 +1890,19 @@ var require_axios = __commonJS({
|
|
|
1886
1890
|
));
|
|
1887
1891
|
request = null;
|
|
1888
1892
|
}, "handleTimeout");
|
|
1889
|
-
if (platform.
|
|
1890
|
-
const xsrfValue =
|
|
1893
|
+
if (platform.hasStandardBrowserEnv) {
|
|
1894
|
+
const xsrfValue = isURLSameOrigin(fullPath) && config.xsrfCookieName && cookies.read(config.xsrfCookieName);
|
|
1891
1895
|
if (xsrfValue) {
|
|
1892
1896
|
requestHeaders.set(config.xsrfHeaderName, xsrfValue);
|
|
1893
1897
|
}
|
|
1894
1898
|
}
|
|
1895
1899
|
requestData === void 0 && requestHeaders.setContentType(null);
|
|
1896
1900
|
if ("setRequestHeader" in request) {
|
|
1897
|
-
utils.forEach(requestHeaders.toJSON(), /* @__PURE__ */ __name(function setRequestHeader(val, key) {
|
|
1901
|
+
utils$1.forEach(requestHeaders.toJSON(), /* @__PURE__ */ __name(function setRequestHeader(val, key) {
|
|
1898
1902
|
request.setRequestHeader(key, val);
|
|
1899
1903
|
}, "setRequestHeader"));
|
|
1900
1904
|
}
|
|
1901
|
-
if (!utils.isUndefined(config.withCredentials)) {
|
|
1905
|
+
if (!utils$1.isUndefined(config.withCredentials)) {
|
|
1902
1906
|
request.withCredentials = !!config.withCredentials;
|
|
1903
1907
|
}
|
|
1904
1908
|
if (responseType && responseType !== "json") {
|
|
@@ -1936,7 +1940,7 @@ var require_axios = __commonJS({
|
|
|
1936
1940
|
http: httpAdapter,
|
|
1937
1941
|
xhr: xhrAdapter
|
|
1938
1942
|
};
|
|
1939
|
-
utils.forEach(knownAdapters, (fn, value) => {
|
|
1943
|
+
utils$1.forEach(knownAdapters, (fn, value) => {
|
|
1940
1944
|
if (fn) {
|
|
1941
1945
|
try {
|
|
1942
1946
|
Object.defineProperty(fn, "name", { value });
|
|
@@ -1946,10 +1950,10 @@ var require_axios = __commonJS({
|
|
|
1946
1950
|
}
|
|
1947
1951
|
});
|
|
1948
1952
|
var renderReason = /* @__PURE__ */ __name((reason) => `- ${reason}`, "renderReason");
|
|
1949
|
-
var isResolvedHandle = /* @__PURE__ */ __name((adapter) => utils.isFunction(adapter) || adapter === null || adapter === false, "isResolvedHandle");
|
|
1953
|
+
var isResolvedHandle = /* @__PURE__ */ __name((adapter) => utils$1.isFunction(adapter) || adapter === null || adapter === false, "isResolvedHandle");
|
|
1950
1954
|
var adapters = {
|
|
1951
1955
|
getAdapter: (adapters2) => {
|
|
1952
|
-
adapters2 = utils.isArray(adapters2) ? adapters2 : [adapters2];
|
|
1956
|
+
adapters2 = utils$1.isArray(adapters2) ? adapters2 : [adapters2];
|
|
1953
1957
|
const { length } = adapters2;
|
|
1954
1958
|
let nameOrAdapter;
|
|
1955
1959
|
let adapter;
|
|
@@ -2033,34 +2037,34 @@ var require_axios = __commonJS({
|
|
|
2033
2037
|
config2 = config2 || {};
|
|
2034
2038
|
const config = {};
|
|
2035
2039
|
function getMergedValue(target, source, caseless) {
|
|
2036
|
-
if (utils.isPlainObject(target) && utils.isPlainObject(source)) {
|
|
2037
|
-
return utils.merge.call({ caseless }, target, source);
|
|
2038
|
-
} else if (utils.isPlainObject(source)) {
|
|
2039
|
-
return utils.merge({}, source);
|
|
2040
|
-
} else if (utils.isArray(source)) {
|
|
2040
|
+
if (utils$1.isPlainObject(target) && utils$1.isPlainObject(source)) {
|
|
2041
|
+
return utils$1.merge.call({ caseless }, target, source);
|
|
2042
|
+
} else if (utils$1.isPlainObject(source)) {
|
|
2043
|
+
return utils$1.merge({}, source);
|
|
2044
|
+
} else if (utils$1.isArray(source)) {
|
|
2041
2045
|
return source.slice();
|
|
2042
2046
|
}
|
|
2043
2047
|
return source;
|
|
2044
2048
|
}
|
|
2045
2049
|
__name(getMergedValue, "getMergedValue");
|
|
2046
2050
|
function mergeDeepProperties(a, b, caseless) {
|
|
2047
|
-
if (!utils.isUndefined(b)) {
|
|
2051
|
+
if (!utils$1.isUndefined(b)) {
|
|
2048
2052
|
return getMergedValue(a, b, caseless);
|
|
2049
|
-
} else if (!utils.isUndefined(a)) {
|
|
2053
|
+
} else if (!utils$1.isUndefined(a)) {
|
|
2050
2054
|
return getMergedValue(void 0, a, caseless);
|
|
2051
2055
|
}
|
|
2052
2056
|
}
|
|
2053
2057
|
__name(mergeDeepProperties, "mergeDeepProperties");
|
|
2054
2058
|
function valueFromConfig2(a, b) {
|
|
2055
|
-
if (!utils.isUndefined(b)) {
|
|
2059
|
+
if (!utils$1.isUndefined(b)) {
|
|
2056
2060
|
return getMergedValue(void 0, b);
|
|
2057
2061
|
}
|
|
2058
2062
|
}
|
|
2059
2063
|
__name(valueFromConfig2, "valueFromConfig2");
|
|
2060
2064
|
function defaultToConfig2(a, b) {
|
|
2061
|
-
if (!utils.isUndefined(b)) {
|
|
2065
|
+
if (!utils$1.isUndefined(b)) {
|
|
2062
2066
|
return getMergedValue(void 0, b);
|
|
2063
|
-
} else if (!utils.isUndefined(a)) {
|
|
2067
|
+
} else if (!utils$1.isUndefined(a)) {
|
|
2064
2068
|
return getMergedValue(void 0, a);
|
|
2065
2069
|
}
|
|
2066
2070
|
}
|
|
@@ -2103,15 +2107,15 @@ var require_axios = __commonJS({
|
|
|
2103
2107
|
validateStatus: mergeDirectKeys,
|
|
2104
2108
|
headers: (a, b) => mergeDeepProperties(headersToObject(a), headersToObject(b), true)
|
|
2105
2109
|
};
|
|
2106
|
-
utils.forEach(Object.keys(Object.assign({}, config1, config2)), /* @__PURE__ */ __name(function computeConfigValue(prop) {
|
|
2110
|
+
utils$1.forEach(Object.keys(Object.assign({}, config1, config2)), /* @__PURE__ */ __name(function computeConfigValue(prop) {
|
|
2107
2111
|
const merge2 = mergeMap[prop] || mergeDeepProperties;
|
|
2108
2112
|
const configValue = merge2(config1[prop], config2[prop], prop);
|
|
2109
|
-
utils.isUndefined(configValue) && merge2 !== mergeDirectKeys || (config[prop] = configValue);
|
|
2113
|
+
utils$1.isUndefined(configValue) && merge2 !== mergeDirectKeys || (config[prop] = configValue);
|
|
2110
2114
|
}, "computeConfigValue"));
|
|
2111
2115
|
return config;
|
|
2112
2116
|
}
|
|
2113
2117
|
__name(mergeConfig, "mergeConfig");
|
|
2114
|
-
var VERSION = "1.
|
|
2118
|
+
var VERSION = "1.6.1";
|
|
2115
2119
|
var validators$1 = {};
|
|
2116
2120
|
["object", "boolean", "number", "function", "string", "symbol"].forEach((type, i) => {
|
|
2117
2121
|
validators$1[type] = /* @__PURE__ */ __name(function validator2(thing) {
|
|
@@ -2207,7 +2211,7 @@ var require_axios = __commonJS({
|
|
|
2207
2211
|
}, false);
|
|
2208
2212
|
}
|
|
2209
2213
|
if (paramsSerializer != null) {
|
|
2210
|
-
if (utils.isFunction(paramsSerializer)) {
|
|
2214
|
+
if (utils$1.isFunction(paramsSerializer)) {
|
|
2211
2215
|
config.paramsSerializer = {
|
|
2212
2216
|
serialize: paramsSerializer
|
|
2213
2217
|
};
|
|
@@ -2219,11 +2223,11 @@ var require_axios = __commonJS({
|
|
|
2219
2223
|
}
|
|
2220
2224
|
}
|
|
2221
2225
|
config.method = (config.method || this.defaults.method || "get").toLowerCase();
|
|
2222
|
-
let contextHeaders = headers && utils.merge(
|
|
2226
|
+
let contextHeaders = headers && utils$1.merge(
|
|
2223
2227
|
headers.common,
|
|
2224
2228
|
headers[config.method]
|
|
2225
2229
|
);
|
|
2226
|
-
headers && utils.forEach(
|
|
2230
|
+
headers && utils$1.forEach(
|
|
2227
2231
|
["delete", "get", "head", "post", "put", "patch", "common"],
|
|
2228
2232
|
(method) => {
|
|
2229
2233
|
delete headers[method];
|
|
@@ -2288,7 +2292,7 @@ var require_axios = __commonJS({
|
|
|
2288
2292
|
return buildURL(fullPath, config.params, config.paramsSerializer);
|
|
2289
2293
|
}
|
|
2290
2294
|
};
|
|
2291
|
-
utils.forEach(["delete", "get", "head", "options"], /* @__PURE__ */ __name(function forEachMethodNoData(method) {
|
|
2295
|
+
utils$1.forEach(["delete", "get", "head", "options"], /* @__PURE__ */ __name(function forEachMethodNoData(method) {
|
|
2292
2296
|
Axios.prototype[method] = function(url, config) {
|
|
2293
2297
|
return this.request(mergeConfig(config || {}, {
|
|
2294
2298
|
method,
|
|
@@ -2297,7 +2301,7 @@ var require_axios = __commonJS({
|
|
|
2297
2301
|
}));
|
|
2298
2302
|
};
|
|
2299
2303
|
}, "forEachMethodNoData"));
|
|
2300
|
-
utils.forEach(["post", "put", "patch"], /* @__PURE__ */ __name(function forEachMethodWithData(method) {
|
|
2304
|
+
utils$1.forEach(["post", "put", "patch"], /* @__PURE__ */ __name(function forEachMethodWithData(method) {
|
|
2301
2305
|
function generateHTTPMethod(isForm) {
|
|
2302
2306
|
return /* @__PURE__ */ __name(function httpMethod(url, data, config) {
|
|
2303
2307
|
return this.request(mergeConfig(config || {}, {
|
|
@@ -2413,7 +2417,7 @@ var require_axios = __commonJS({
|
|
|
2413
2417
|
}
|
|
2414
2418
|
__name(spread, "spread");
|
|
2415
2419
|
function isAxiosError(payload) {
|
|
2416
|
-
return utils.isObject(payload) && payload.isAxiosError === true;
|
|
2420
|
+
return utils$1.isObject(payload) && payload.isAxiosError === true;
|
|
2417
2421
|
}
|
|
2418
2422
|
__name(isAxiosError, "isAxiosError");
|
|
2419
2423
|
var HttpStatusCode = {
|
|
@@ -2488,8 +2492,8 @@ var require_axios = __commonJS({
|
|
|
2488
2492
|
function createInstance(defaultConfig) {
|
|
2489
2493
|
const context = new Axios$1(defaultConfig);
|
|
2490
2494
|
const instance = bind(Axios$1.prototype.request, context);
|
|
2491
|
-
utils.extend(instance, Axios$1.prototype, context, { allOwnKeys: true });
|
|
2492
|
-
utils.extend(instance, context, null, { allOwnKeys: true });
|
|
2495
|
+
utils$1.extend(instance, Axios$1.prototype, context, { allOwnKeys: true });
|
|
2496
|
+
utils$1.extend(instance, context, null, { allOwnKeys: true });
|
|
2493
2497
|
instance.create = /* @__PURE__ */ __name(function create(instanceConfig) {
|
|
2494
2498
|
return createInstance(mergeConfig(defaultConfig, instanceConfig));
|
|
2495
2499
|
}, "create");
|
|
@@ -2512,7 +2516,7 @@ var require_axios = __commonJS({
|
|
|
2512
2516
|
axios.isAxiosError = isAxiosError;
|
|
2513
2517
|
axios.mergeConfig = mergeConfig;
|
|
2514
2518
|
axios.AxiosHeaders = AxiosHeaders$1;
|
|
2515
|
-
axios.formToJSON = (thing) => formDataToJSON(utils.isHTMLForm(thing) ? new FormData(thing) : thing);
|
|
2519
|
+
axios.formToJSON = (thing) => formDataToJSON(utils$1.isHTMLForm(thing) ? new FormData(thing) : thing);
|
|
2516
2520
|
axios.getAdapter = adapters.getAdapter;
|
|
2517
2521
|
axios.HttpStatusCode = HttpStatusCode$1;
|
|
2518
2522
|
axios.default = axios;
|
|
@@ -2529,8 +2533,9 @@ var require_Client = __commonJS({
|
|
|
2529
2533
|
static {
|
|
2530
2534
|
__name(this, "KohostApiClient");
|
|
2531
2535
|
}
|
|
2532
|
-
|
|
2536
|
+
/**
|
|
2533
2537
|
@param {Object} options - The options to create the client
|
|
2538
|
+
@param {String} options.organizationId - The organization ID
|
|
2534
2539
|
@param {String} options.propertyId - The property ID
|
|
2535
2540
|
@param {String} options.url - The base URL for the API endpint
|
|
2536
2541
|
@param {Object} options.headers - Additional headers to send with each request
|
|
@@ -2546,8 +2551,6 @@ var require_Client = __commonJS({
|
|
|
2546
2551
|
super();
|
|
2547
2552
|
if (!options.url)
|
|
2548
2553
|
throw new Error("options.url is required");
|
|
2549
|
-
if (!options.propertyId)
|
|
2550
|
-
throw new Error("options.property is required");
|
|
2551
2554
|
this.options = options;
|
|
2552
2555
|
this.isBrowser = typeof window !== "undefined";
|
|
2553
2556
|
this.isRefreshingToken = false;
|
|
@@ -2558,23 +2561,51 @@ var require_Client = __commonJS({
|
|
|
2558
2561
|
headers: {
|
|
2559
2562
|
"Content-Type": "application/json",
|
|
2560
2563
|
Accept: "application/json",
|
|
2561
|
-
[_KohostApiClient.defs.propertyHeader]: options.propertyId,
|
|
2562
2564
|
...options.headers
|
|
2563
2565
|
}
|
|
2564
2566
|
};
|
|
2565
2567
|
if (options.apiKey) {
|
|
2566
2568
|
config.headers[_KohostApiClient.defs.apiKeyHeader] = options.apiKey;
|
|
2567
2569
|
}
|
|
2570
|
+
if (options.propertyId) {
|
|
2571
|
+
config.headers[_KohostApiClient.defs.propertyHeader] = options.propertyId;
|
|
2572
|
+
}
|
|
2573
|
+
if (options.organizationId) {
|
|
2574
|
+
config.headers[_KohostApiClient.defs.organizationHeader] = options.organizationId;
|
|
2575
|
+
}
|
|
2568
2576
|
this._http = axios.create(config);
|
|
2569
2577
|
this._http.interceptors.response.use(
|
|
2570
2578
|
this._handleResponse.bind(this),
|
|
2571
2579
|
this._handleResponseError.bind(this)
|
|
2572
2580
|
);
|
|
2573
2581
|
}
|
|
2582
|
+
/**
|
|
2583
|
+
* @param {string} orgId
|
|
2584
|
+
* @returns {void}
|
|
2585
|
+
* @memberof KohostApiClient
|
|
2586
|
+
* @example
|
|
2587
|
+
* client.organizationId = "1234";
|
|
2588
|
+
*/
|
|
2589
|
+
set organizationId(orgId) {
|
|
2590
|
+
const key = _KohostApiClient.defs.organizationHeader;
|
|
2591
|
+
this._http.defaults.headers.common[key] = orgId;
|
|
2592
|
+
}
|
|
2593
|
+
/**
|
|
2594
|
+
* @param {string} propertyId
|
|
2595
|
+
* @returns {void}
|
|
2596
|
+
* @memberof KohostApiClient
|
|
2597
|
+
* @example
|
|
2598
|
+
* client.propertyId = "1234";
|
|
2599
|
+
*/
|
|
2600
|
+
set propertyId(propertyId) {
|
|
2601
|
+
const key = _KohostApiClient.defs.propertyHeader;
|
|
2602
|
+
this._http.defaults.headers.common[key] = propertyId;
|
|
2603
|
+
}
|
|
2574
2604
|
static get defs() {
|
|
2575
2605
|
return {
|
|
2576
2606
|
apiKeyHeader: "X-Api-Key",
|
|
2577
|
-
propertyHeader: "X-Property-Id"
|
|
2607
|
+
propertyHeader: "X-Property-Id",
|
|
2608
|
+
organizationHeader: "X-Organization-Id"
|
|
2578
2609
|
};
|
|
2579
2610
|
}
|
|
2580
2611
|
_handleResponse(response) {
|