@webitel/chat-web-sdk 0.0.10 → 0.0.12
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/gen/ws/AckPayload.d.ts.map +1 -1
- package/dist/gen/ws/AnonymousSchema_20.d.ts.map +1 -1
- package/dist/gen/ws/ConnectedPayload.d.ts.map +1 -1
- package/dist/gen/ws/DisconnectedPayload.d.ts.map +1 -1
- package/dist/gen/ws/ErrorPayload.d.ts.map +1 -1
- package/dist/gen/ws/EventPayload.d.ts +3 -3
- package/dist/gen/ws/EventPayload.d.ts.map +1 -1
- package/dist/gen/ws/EventPriority.d.ts.map +1 -1
- package/dist/gen/ws/PingPayload.d.ts.map +1 -1
- package/dist/gen/ws/ServerEventPayload.d.ts +1 -1
- package/dist/gen/ws/ServerEventPayload.d.ts.map +1 -1
- package/dist/gen/ws/WsMessage.d.ts +1 -1
- package/dist/gen/ws/WsMessage.d.ts.map +1 -1
- package/dist/gen/ws/WsPeer.d.ts.map +1 -1
- package/dist/gen/ws/WsThread.d.ts.map +1 -1
- package/dist/index.d.ts +4 -3
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +276 -247
- package/dist/index.js.map +1 -1
- package/dist/modules/messages/utils/sendDocumentMessage.d.ts.map +1 -1
- package/dist/modules/messages/utils/sendImageMessage.d.ts.map +1 -1
- package/dist/modules/socket/classes/ChatsSoketClient.d.ts +1 -1
- package/dist/modules/socket/classes/ChatsSoketClient.d.ts.map +1 -1
- package/dist/modules/socket/index.d.ts +3 -3
- package/dist/modules/socket/index.d.ts.map +1 -1
- package/dist/modules/socket/utils/instantiateSocketEventEntities.d.ts +1 -1
- package/dist/modules/socket/utils/instantiateSocketEventEntities.d.ts.map +1 -1
- package/dist/modules/socket/utils/processSocketEventPayload.d.ts +2 -2
- package/dist/modules/socket/utils/processSocketEventPayload.d.ts.map +1 -1
- package/dist/modules/threads/api/Threads.api.d.ts +2 -1
- package/dist/modules/threads/api/Threads.api.d.ts.map +1 -1
- package/dist/modules/threads/classes/Thread.class.d.ts.map +1 -1
- package/dist/modules/threads/enums/ThreadMemberRole.enum.d.ts +2 -0
- package/dist/modules/threads/enums/ThreadMemberRole.enum.d.ts.map +1 -0
- package/dist/modules/threads/index.d.ts +2 -1
- package/dist/modules/threads/index.d.ts.map +1 -1
- package/dist/modules/threads/modules/members/api/ThreadMembers.api.d.ts +18 -0
- package/dist/modules/threads/modules/members/api/ThreadMembers.api.d.ts.map +1 -0
- package/dist/modules/threads/modules/members/enums/ThreadMemberRole.enum.d.ts +2 -0
- package/dist/modules/threads/modules/members/enums/ThreadMemberRole.enum.d.ts.map +1 -0
- package/dist/modules/threads/modules/members/index.d.ts +5 -0
- package/dist/modules/threads/modules/members/index.d.ts.map +1 -0
- package/dist/modules/threads/modules/members/types/ThreadMember.types.d.ts +15 -0
- package/dist/modules/threads/modules/members/types/ThreadMember.types.d.ts.map +1 -0
- package/dist/modules/threads/modules/members/utils/addMember.d.ts +6 -0
- package/dist/modules/threads/modules/members/utils/addMember.d.ts.map +1 -0
- package/dist/modules/threads/modules/members/utils/removeMember.d.ts +6 -0
- package/dist/modules/threads/modules/members/utils/removeMember.d.ts.map +1 -0
- package/dist/modules/threads/threadsSevice.d.ts +9 -4
- package/dist/modules/threads/threadsSevice.d.ts.map +1 -1
- package/dist/modules/threads/types/Thread.types.d.ts +4 -1
- package/dist/modules/threads/types/Thread.types.d.ts.map +1 -1
- package/dist/modules/threads/utils/addMember.d.ts +8 -0
- package/dist/modules/threads/utils/addMember.d.ts.map +1 -0
- package/dist/modules/threads/utils/fetchThreads.d.ts +4 -2
- package/dist/modules/threads/utils/fetchThreads.d.ts.map +1 -1
- package/dist/modules/threads/utils/removeMember.d.ts +8 -0
- package/dist/modules/threads/utils/removeMember.d.ts.map +1 -0
- package/package.json +5 -2
package/dist/index.js
CHANGED
|
@@ -625,7 +625,7 @@ function gt(e) {
|
|
|
625
625
|
var _t = z.toFlatObject(z, {}, null, function(e) {
|
|
626
626
|
return /^is[A-Z]/.test(e);
|
|
627
627
|
});
|
|
628
|
-
function
|
|
628
|
+
function vt(e, t, n) {
|
|
629
629
|
if (!z.isObject(e)) throw TypeError("target must be an object");
|
|
630
630
|
t ||= new FormData(), n = z.toFlatObject(n, {
|
|
631
631
|
metaTokens: !0,
|
|
@@ -672,7 +672,7 @@ function V(e, t, n) {
|
|
|
672
672
|
}
|
|
673
673
|
//#endregion
|
|
674
674
|
//#region node_modules/axios/lib/helpers/AxiosURLSearchParams.js
|
|
675
|
-
function
|
|
675
|
+
function yt(e) {
|
|
676
676
|
let t = {
|
|
677
677
|
"!": "%21",
|
|
678
678
|
"'": "%27",
|
|
@@ -686,29 +686,29 @@ function vt(e) {
|
|
|
686
686
|
return t[e];
|
|
687
687
|
});
|
|
688
688
|
}
|
|
689
|
-
function
|
|
690
|
-
this._pairs = [], e &&
|
|
689
|
+
function bt(e, t) {
|
|
690
|
+
this._pairs = [], e && vt(e, this, t);
|
|
691
691
|
}
|
|
692
|
-
var
|
|
693
|
-
|
|
692
|
+
var xt = bt.prototype;
|
|
693
|
+
xt.append = function(e, t) {
|
|
694
694
|
this._pairs.push([e, t]);
|
|
695
|
-
},
|
|
695
|
+
}, xt.toString = function(e) {
|
|
696
696
|
let t = e ? function(t) {
|
|
697
|
-
return e.call(this, t,
|
|
698
|
-
} :
|
|
697
|
+
return e.call(this, t, yt);
|
|
698
|
+
} : yt;
|
|
699
699
|
return this._pairs.map(function(e) {
|
|
700
700
|
return t(e[0]) + "=" + t(e[1]);
|
|
701
701
|
}, "").join("&");
|
|
702
702
|
};
|
|
703
703
|
//#endregion
|
|
704
704
|
//#region node_modules/axios/lib/helpers/buildURL.js
|
|
705
|
-
function
|
|
705
|
+
function St(e) {
|
|
706
706
|
return encodeURIComponent(e).replace(/%3A/gi, ":").replace(/%24/g, "$").replace(/%2C/gi, ",").replace(/%20/g, "+");
|
|
707
707
|
}
|
|
708
|
-
function
|
|
708
|
+
function Ct(e, t, n) {
|
|
709
709
|
if (!t) return e;
|
|
710
|
-
let r = n && n.encode ||
|
|
711
|
-
if (o = a ? a(t, i) : z.isURLSearchParams(t) ? t.toString() : new
|
|
710
|
+
let r = n && n.encode || St, i = z.isFunction(n) ? { serialize: n } : n, a = i && i.serialize, o;
|
|
711
|
+
if (o = a ? a(t, i) : z.isURLSearchParams(t) ? t.toString() : new bt(t, i).toString(r), o) {
|
|
712
712
|
let t = e.indexOf("#");
|
|
713
713
|
t !== -1 && (e = e.slice(0, t)), e += (e.indexOf("?") === -1 ? "?" : "&") + o;
|
|
714
714
|
}
|
|
@@ -716,7 +716,7 @@ function St(e, t, n) {
|
|
|
716
716
|
}
|
|
717
717
|
//#endregion
|
|
718
718
|
//#region node_modules/axios/lib/core/InterceptorManager.js
|
|
719
|
-
var
|
|
719
|
+
var wt = class {
|
|
720
720
|
constructor() {
|
|
721
721
|
this.handlers = [];
|
|
722
722
|
}
|
|
@@ -739,15 +739,15 @@ var Ct = class {
|
|
|
739
739
|
t !== null && e(t);
|
|
740
740
|
});
|
|
741
741
|
}
|
|
742
|
-
},
|
|
742
|
+
}, Tt = {
|
|
743
743
|
silentJSONParsing: !0,
|
|
744
744
|
forcedJSONParsing: !0,
|
|
745
745
|
clarifyTimeoutError: !1,
|
|
746
746
|
legacyInterceptorReqResOrdering: !0
|
|
747
|
-
},
|
|
747
|
+
}, Et = {
|
|
748
748
|
isBrowser: !0,
|
|
749
749
|
classes: {
|
|
750
|
-
URLSearchParams: typeof URLSearchParams < "u" ? URLSearchParams :
|
|
750
|
+
URLSearchParams: typeof URLSearchParams < "u" ? URLSearchParams : bt,
|
|
751
751
|
FormData: typeof FormData < "u" ? FormData : null,
|
|
752
752
|
Blob: typeof Blob < "u" ? Blob : null
|
|
753
753
|
},
|
|
@@ -759,58 +759,58 @@ var Ct = class {
|
|
|
759
759
|
"url",
|
|
760
760
|
"data"
|
|
761
761
|
]
|
|
762
|
-
},
|
|
763
|
-
hasBrowserEnv: () =>
|
|
764
|
-
hasStandardBrowserEnv: () =>
|
|
765
|
-
hasStandardBrowserWebWorkerEnv: () =>
|
|
766
|
-
navigator: () =>
|
|
767
|
-
origin: () =>
|
|
768
|
-
}),
|
|
762
|
+
}, Dt = /* @__PURE__ */ n({
|
|
763
|
+
hasBrowserEnv: () => Ot,
|
|
764
|
+
hasStandardBrowserEnv: () => At,
|
|
765
|
+
hasStandardBrowserWebWorkerEnv: () => jt,
|
|
766
|
+
navigator: () => kt,
|
|
767
|
+
origin: () => Mt
|
|
768
|
+
}), Ot = typeof window < "u" && typeof document < "u", kt = typeof navigator == "object" && navigator || void 0, At = Ot && (!kt || [
|
|
769
769
|
"ReactNative",
|
|
770
770
|
"NativeScript",
|
|
771
771
|
"NS"
|
|
772
|
-
].indexOf(
|
|
773
|
-
...
|
|
774
|
-
...
|
|
772
|
+
].indexOf(kt.product) < 0), jt = typeof WorkerGlobalScope < "u" && self instanceof WorkerGlobalScope && typeof self.importScripts == "function", Mt = Ot && window.location.href || "http://localhost", V = {
|
|
773
|
+
...Dt,
|
|
774
|
+
...Et
|
|
775
775
|
};
|
|
776
776
|
//#endregion
|
|
777
777
|
//#region node_modules/axios/lib/helpers/toURLEncodedForm.js
|
|
778
|
-
function
|
|
779
|
-
return
|
|
778
|
+
function Nt(e, t) {
|
|
779
|
+
return vt(e, new V.classes.URLSearchParams(), {
|
|
780
780
|
visitor: function(e, t, n, r) {
|
|
781
|
-
return
|
|
781
|
+
return V.isNode && z.isBuffer(e) ? (this.append(t, e.toString("base64")), !1) : r.defaultVisitor.apply(this, arguments);
|
|
782
782
|
},
|
|
783
783
|
...t
|
|
784
784
|
});
|
|
785
785
|
}
|
|
786
786
|
//#endregion
|
|
787
787
|
//#region node_modules/axios/lib/helpers/formDataToJSON.js
|
|
788
|
-
function
|
|
788
|
+
function Pt(e) {
|
|
789
789
|
return z.matchAll(/\w+|\[(\w*)]/g, e).map((e) => e[0] === "[]" ? "" : e[1] || e[0]);
|
|
790
790
|
}
|
|
791
|
-
function
|
|
791
|
+
function Ft(e) {
|
|
792
792
|
let t = {}, n = Object.keys(e), r, i = n.length, a;
|
|
793
793
|
for (r = 0; r < i; r++) a = n[r], t[a] = e[a];
|
|
794
794
|
return t;
|
|
795
795
|
}
|
|
796
|
-
function
|
|
796
|
+
function It(e) {
|
|
797
797
|
function t(e, n, r, i) {
|
|
798
798
|
let a = e[i++];
|
|
799
799
|
if (a === "__proto__") return !0;
|
|
800
800
|
let o = Number.isFinite(+a), s = i >= e.length;
|
|
801
|
-
return a = !a && z.isArray(r) ? r.length : a, s ? (z.hasOwnProp(r, a) ? r[a] = [r[a], n] : r[a] = n, !o) : ((!r[a] || !z.isObject(r[a])) && (r[a] = []), t(e, n, r[a], i) && z.isArray(r[a]) && (r[a] =
|
|
801
|
+
return a = !a && z.isArray(r) ? r.length : a, s ? (z.hasOwnProp(r, a) ? r[a] = [r[a], n] : r[a] = n, !o) : ((!r[a] || !z.isObject(r[a])) && (r[a] = []), t(e, n, r[a], i) && z.isArray(r[a]) && (r[a] = Ft(r[a])), !o);
|
|
802
802
|
}
|
|
803
803
|
if (z.isFormData(e) && z.isFunction(e.entries)) {
|
|
804
804
|
let n = {};
|
|
805
805
|
return z.forEachEntry(e, (e, r) => {
|
|
806
|
-
t(
|
|
806
|
+
t(Pt(e), r, n, 0);
|
|
807
807
|
}), n;
|
|
808
808
|
}
|
|
809
809
|
return null;
|
|
810
810
|
}
|
|
811
811
|
//#endregion
|
|
812
812
|
//#region node_modules/axios/lib/defaults/index.js
|
|
813
|
-
function
|
|
813
|
+
function Lt(e, t, n) {
|
|
814
814
|
if (z.isString(e)) try {
|
|
815
815
|
return (t || JSON.parse)(e), z.trim(e);
|
|
816
816
|
} catch (e) {
|
|
@@ -818,8 +818,8 @@ function It(e, t, n) {
|
|
|
818
818
|
}
|
|
819
819
|
return (n || JSON.stringify)(e);
|
|
820
820
|
}
|
|
821
|
-
var
|
|
822
|
-
transitional:
|
|
821
|
+
var H = {
|
|
822
|
+
transitional: Tt,
|
|
823
823
|
adapter: [
|
|
824
824
|
"xhr",
|
|
825
825
|
"http",
|
|
@@ -827,22 +827,22 @@ var U = {
|
|
|
827
827
|
],
|
|
828
828
|
transformRequest: [function(e, t) {
|
|
829
829
|
let n = t.getContentType() || "", r = n.indexOf("application/json") > -1, i = z.isObject(e);
|
|
830
|
-
if (i && z.isHTMLForm(e) && (e = new FormData(e)), z.isFormData(e)) return r ? JSON.stringify(
|
|
830
|
+
if (i && z.isHTMLForm(e) && (e = new FormData(e)), z.isFormData(e)) return r ? JSON.stringify(It(e)) : e;
|
|
831
831
|
if (z.isArrayBuffer(e) || z.isBuffer(e) || z.isStream(e) || z.isFile(e) || z.isBlob(e) || z.isReadableStream(e)) return e;
|
|
832
832
|
if (z.isArrayBufferView(e)) return e.buffer;
|
|
833
833
|
if (z.isURLSearchParams(e)) return t.setContentType("application/x-www-form-urlencoded;charset=utf-8", !1), e.toString();
|
|
834
834
|
let a;
|
|
835
835
|
if (i) {
|
|
836
|
-
if (n.indexOf("application/x-www-form-urlencoded") > -1) return
|
|
836
|
+
if (n.indexOf("application/x-www-form-urlencoded") > -1) return Nt(e, this.formSerializer).toString();
|
|
837
837
|
if ((a = z.isFileList(e)) || n.indexOf("multipart/form-data") > -1) {
|
|
838
838
|
let t = this.env && this.env.FormData;
|
|
839
|
-
return
|
|
839
|
+
return vt(a ? { "files[]": e } : e, t && new t(), this.formSerializer);
|
|
840
840
|
}
|
|
841
841
|
}
|
|
842
|
-
return i || r ? (t.setContentType("application/json", !1),
|
|
842
|
+
return i || r ? (t.setContentType("application/json", !1), Lt(e)) : e;
|
|
843
843
|
}],
|
|
844
844
|
transformResponse: [function(e) {
|
|
845
|
-
let t = this.transitional ||
|
|
845
|
+
let t = this.transitional || H.transitional, n = t && t.forcedJSONParsing, r = this.responseType === "json";
|
|
846
846
|
if (z.isResponse(e) || z.isReadableStream(e)) return e;
|
|
847
847
|
if (e && z.isString(e) && (n && !this.responseType || r)) {
|
|
848
848
|
let n = !(t && t.silentJSONParsing) && r;
|
|
@@ -860,8 +860,8 @@ var U = {
|
|
|
860
860
|
maxContentLength: -1,
|
|
861
861
|
maxBodyLength: -1,
|
|
862
862
|
env: {
|
|
863
|
-
FormData:
|
|
864
|
-
Blob:
|
|
863
|
+
FormData: V.classes.FormData,
|
|
864
|
+
Blob: V.classes.Blob
|
|
865
865
|
},
|
|
866
866
|
validateStatus: function(e) {
|
|
867
867
|
return e >= 200 && e < 300;
|
|
@@ -879,11 +879,11 @@ z.forEach([
|
|
|
879
879
|
"put",
|
|
880
880
|
"patch"
|
|
881
881
|
], (e) => {
|
|
882
|
-
|
|
882
|
+
H.headers[e] = {};
|
|
883
883
|
});
|
|
884
884
|
//#endregion
|
|
885
885
|
//#region node_modules/axios/lib/helpers/parseHeaders.js
|
|
886
|
-
var
|
|
886
|
+
var Rt = z.toObjectSet([
|
|
887
887
|
"age",
|
|
888
888
|
"authorization",
|
|
889
889
|
"content-length",
|
|
@@ -901,35 +901,35 @@ var Lt = z.toObjectSet([
|
|
|
901
901
|
"referer",
|
|
902
902
|
"retry-after",
|
|
903
903
|
"user-agent"
|
|
904
|
-
]),
|
|
904
|
+
]), zt = (e) => {
|
|
905
905
|
let t = {}, n, r, i;
|
|
906
906
|
return e && e.split("\n").forEach(function(e) {
|
|
907
|
-
i = e.indexOf(":"), n = e.substring(0, i).trim().toLowerCase(), r = e.substring(i + 1).trim(), !(!n || t[n] &&
|
|
907
|
+
i = e.indexOf(":"), n = e.substring(0, i).trim().toLowerCase(), r = e.substring(i + 1).trim(), !(!n || t[n] && Rt[n]) && (n === "set-cookie" ? t[n] ? t[n].push(r) : t[n] = [r] : t[n] = t[n] ? t[n] + ", " + r : r);
|
|
908
908
|
}), t;
|
|
909
|
-
},
|
|
910
|
-
function
|
|
909
|
+
}, Bt = Symbol("internals");
|
|
910
|
+
function U(e) {
|
|
911
911
|
return e && String(e).trim().toLowerCase();
|
|
912
912
|
}
|
|
913
|
-
function Bt(e) {
|
|
914
|
-
return e === !1 || e == null ? e : z.isArray(e) ? e.map(Bt) : String(e);
|
|
915
|
-
}
|
|
916
913
|
function Vt(e) {
|
|
914
|
+
return e === !1 || e == null ? e : z.isArray(e) ? e.map(Vt) : String(e);
|
|
915
|
+
}
|
|
916
|
+
function Ht(e) {
|
|
917
917
|
let t = Object.create(null), n = /([^\s,;=]+)\s*(?:=\s*([^,;]+))?/g, r;
|
|
918
918
|
for (; r = n.exec(e);) t[r[1]] = r[2];
|
|
919
919
|
return t;
|
|
920
920
|
}
|
|
921
|
-
var
|
|
922
|
-
function
|
|
921
|
+
var Ut = (e) => /^[-_a-zA-Z0-9^`|~,!#$%&'*+.]+$/.test(e.trim());
|
|
922
|
+
function Wt(e, t, n, r, i) {
|
|
923
923
|
if (z.isFunction(r)) return r.call(this, t, n);
|
|
924
924
|
if (i && (t = n), z.isString(t)) {
|
|
925
925
|
if (z.isString(r)) return t.indexOf(r) !== -1;
|
|
926
926
|
if (z.isRegExp(r)) return r.test(t);
|
|
927
927
|
}
|
|
928
928
|
}
|
|
929
|
-
function
|
|
929
|
+
function Gt(e) {
|
|
930
930
|
return e.trim().toLowerCase().replace(/([a-z\d])(\w*)/g, (e, t, n) => t.toUpperCase() + n);
|
|
931
931
|
}
|
|
932
|
-
function
|
|
932
|
+
function Kt(e, t) {
|
|
933
933
|
let n = z.toCamelCase(" " + t);
|
|
934
934
|
[
|
|
935
935
|
"get",
|
|
@@ -944,21 +944,21 @@ function Gt(e, t) {
|
|
|
944
944
|
});
|
|
945
945
|
});
|
|
946
946
|
}
|
|
947
|
-
var
|
|
947
|
+
var W = class {
|
|
948
948
|
constructor(e) {
|
|
949
949
|
e && this.set(e);
|
|
950
950
|
}
|
|
951
951
|
set(e, t, n) {
|
|
952
952
|
let r = this;
|
|
953
953
|
function i(e, t, n) {
|
|
954
|
-
let i =
|
|
954
|
+
let i = U(t);
|
|
955
955
|
if (!i) throw Error("header name must be a non-empty string");
|
|
956
956
|
let a = z.findKey(r, i);
|
|
957
|
-
(!a || r[a] === void 0 || n === !0 || n === void 0 && r[a] !== !1) && (r[a || t] =
|
|
957
|
+
(!a || r[a] === void 0 || n === !0 || n === void 0 && r[a] !== !1) && (r[a || t] = Vt(e));
|
|
958
958
|
}
|
|
959
959
|
let a = (e, t) => z.forEach(e, (e, n) => i(e, n, t));
|
|
960
960
|
if (z.isPlainObject(e) || e instanceof this.constructor) a(e, t);
|
|
961
|
-
else if (z.isString(e) && (e = e.trim()) && !
|
|
961
|
+
else if (z.isString(e) && (e = e.trim()) && !Ut(e)) a(zt(e), t);
|
|
962
962
|
else if (z.isObject(e) && z.isIterable(e)) {
|
|
963
963
|
let n = {}, r, i;
|
|
964
964
|
for (let t of e) {
|
|
@@ -970,12 +970,12 @@ var G = class {
|
|
|
970
970
|
return this;
|
|
971
971
|
}
|
|
972
972
|
get(e, t) {
|
|
973
|
-
if (e =
|
|
973
|
+
if (e = U(e), e) {
|
|
974
974
|
let n = z.findKey(this, e);
|
|
975
975
|
if (n) {
|
|
976
976
|
let e = this[n];
|
|
977
977
|
if (!t) return e;
|
|
978
|
-
if (t === !0) return
|
|
978
|
+
if (t === !0) return Ht(e);
|
|
979
979
|
if (z.isFunction(t)) return t.call(this, e, n);
|
|
980
980
|
if (z.isRegExp(t)) return t.exec(e);
|
|
981
981
|
throw TypeError("parser must be boolean|regexp|function");
|
|
@@ -983,18 +983,18 @@ var G = class {
|
|
|
983
983
|
}
|
|
984
984
|
}
|
|
985
985
|
has(e, t) {
|
|
986
|
-
if (e =
|
|
986
|
+
if (e = U(e), e) {
|
|
987
987
|
let n = z.findKey(this, e);
|
|
988
|
-
return !!(n && this[n] !== void 0 && (!t ||
|
|
988
|
+
return !!(n && this[n] !== void 0 && (!t || Wt(this, this[n], n, t)));
|
|
989
989
|
}
|
|
990
990
|
return !1;
|
|
991
991
|
}
|
|
992
992
|
delete(e, t) {
|
|
993
993
|
let n = this, r = !1;
|
|
994
994
|
function i(e) {
|
|
995
|
-
if (e =
|
|
995
|
+
if (e = U(e), e) {
|
|
996
996
|
let i = z.findKey(n, e);
|
|
997
|
-
i && (!t ||
|
|
997
|
+
i && (!t || Wt(n, n[i], i, t)) && (delete n[i], r = !0);
|
|
998
998
|
}
|
|
999
999
|
}
|
|
1000
1000
|
return z.isArray(e) ? e.forEach(i) : i(e), r;
|
|
@@ -1003,7 +1003,7 @@ var G = class {
|
|
|
1003
1003
|
let t = Object.keys(this), n = t.length, r = !1;
|
|
1004
1004
|
for (; n--;) {
|
|
1005
1005
|
let i = t[n];
|
|
1006
|
-
(!e ||
|
|
1006
|
+
(!e || Wt(this, this[i], i, e, !0)) && (delete this[i], r = !0);
|
|
1007
1007
|
}
|
|
1008
1008
|
return r;
|
|
1009
1009
|
}
|
|
@@ -1012,11 +1012,11 @@ var G = class {
|
|
|
1012
1012
|
return z.forEach(this, (r, i) => {
|
|
1013
1013
|
let a = z.findKey(n, i);
|
|
1014
1014
|
if (a) {
|
|
1015
|
-
t[a] =
|
|
1015
|
+
t[a] = Vt(r), delete t[i];
|
|
1016
1016
|
return;
|
|
1017
1017
|
}
|
|
1018
|
-
let o = e ?
|
|
1019
|
-
o !== i && delete t[i], t[o] =
|
|
1018
|
+
let o = e ? Gt(i) : String(i).trim();
|
|
1019
|
+
o !== i && delete t[i], t[o] = Vt(r), n[o] = !0;
|
|
1020
1020
|
}), this;
|
|
1021
1021
|
}
|
|
1022
1022
|
concat(...e) {
|
|
@@ -1048,22 +1048,22 @@ var G = class {
|
|
|
1048
1048
|
return t.forEach((e) => n.set(e)), n;
|
|
1049
1049
|
}
|
|
1050
1050
|
static accessor(e) {
|
|
1051
|
-
let t = (this[
|
|
1051
|
+
let t = (this[Bt] = this[Bt] = { accessors: {} }).accessors, n = this.prototype;
|
|
1052
1052
|
function r(e) {
|
|
1053
|
-
let r =
|
|
1054
|
-
t[r] || (
|
|
1053
|
+
let r = U(e);
|
|
1054
|
+
t[r] || (Kt(n, e), t[r] = !0);
|
|
1055
1055
|
}
|
|
1056
1056
|
return z.isArray(e) ? e.forEach(r) : r(e), this;
|
|
1057
1057
|
}
|
|
1058
1058
|
};
|
|
1059
|
-
|
|
1059
|
+
W.accessor([
|
|
1060
1060
|
"Content-Type",
|
|
1061
1061
|
"Content-Length",
|
|
1062
1062
|
"Accept",
|
|
1063
1063
|
"Accept-Encoding",
|
|
1064
1064
|
"User-Agent",
|
|
1065
1065
|
"Authorization"
|
|
1066
|
-
]), z.reduceDescriptors(
|
|
1066
|
+
]), z.reduceDescriptors(W.prototype, ({ value: e }, t) => {
|
|
1067
1067
|
let n = t[0].toUpperCase() + t.slice(1);
|
|
1068
1068
|
return {
|
|
1069
1069
|
get: () => e,
|
|
@@ -1071,42 +1071,42 @@ G.accessor([
|
|
|
1071
1071
|
this[n] = e;
|
|
1072
1072
|
}
|
|
1073
1073
|
};
|
|
1074
|
-
}), z.freezeMethods(
|
|
1074
|
+
}), z.freezeMethods(W);
|
|
1075
1075
|
//#endregion
|
|
1076
1076
|
//#region node_modules/axios/lib/core/transformData.js
|
|
1077
|
-
function
|
|
1078
|
-
let n = this ||
|
|
1077
|
+
function qt(e, t) {
|
|
1078
|
+
let n = this || H, r = t || n, i = W.from(r.headers), a = r.data;
|
|
1079
1079
|
return z.forEach(e, function(e) {
|
|
1080
1080
|
a = e.call(n, a, i.normalize(), t ? t.status : void 0);
|
|
1081
1081
|
}), i.normalize(), a;
|
|
1082
1082
|
}
|
|
1083
1083
|
//#endregion
|
|
1084
1084
|
//#region node_modules/axios/lib/cancel/isCancel.js
|
|
1085
|
-
function
|
|
1085
|
+
function Jt(e) {
|
|
1086
1086
|
return !!(e && e.__CANCEL__);
|
|
1087
1087
|
}
|
|
1088
1088
|
//#endregion
|
|
1089
1089
|
//#region node_modules/axios/lib/cancel/CanceledError.js
|
|
1090
|
-
var
|
|
1090
|
+
var G = class extends B {
|
|
1091
1091
|
constructor(e, t, n) {
|
|
1092
1092
|
super(e ?? "canceled", B.ERR_CANCELED, t, n), this.name = "CanceledError", this.__CANCEL__ = !0;
|
|
1093
1093
|
}
|
|
1094
1094
|
};
|
|
1095
1095
|
//#endregion
|
|
1096
1096
|
//#region node_modules/axios/lib/core/settle.js
|
|
1097
|
-
function
|
|
1097
|
+
function Yt(e, t, n) {
|
|
1098
1098
|
let r = n.config.validateStatus;
|
|
1099
1099
|
!n.status || !r || r(n.status) ? e(n) : t(new B("Request failed with status code " + n.status, [B.ERR_BAD_REQUEST, B.ERR_BAD_RESPONSE][Math.floor(n.status / 100) - 4], n.config, n.request, n));
|
|
1100
1100
|
}
|
|
1101
1101
|
//#endregion
|
|
1102
1102
|
//#region node_modules/axios/lib/helpers/parseProtocol.js
|
|
1103
|
-
function
|
|
1103
|
+
function Xt(e) {
|
|
1104
1104
|
let t = /^([-+\w]{1,25})(:?\/\/|:)/.exec(e);
|
|
1105
1105
|
return t && t[1] || "";
|
|
1106
1106
|
}
|
|
1107
1107
|
//#endregion
|
|
1108
1108
|
//#region node_modules/axios/lib/helpers/speedometer.js
|
|
1109
|
-
function
|
|
1109
|
+
function Zt(e, t) {
|
|
1110
1110
|
e ||= 10;
|
|
1111
1111
|
let n = Array(e), r = Array(e), i = 0, a = 0, o;
|
|
1112
1112
|
return t = t === void 0 ? 1e3 : t, function(s) {
|
|
@@ -1121,7 +1121,7 @@ function Xt(e, t) {
|
|
|
1121
1121
|
}
|
|
1122
1122
|
//#endregion
|
|
1123
1123
|
//#region node_modules/axios/lib/helpers/throttle.js
|
|
1124
|
-
function
|
|
1124
|
+
function Qt(e, t) {
|
|
1125
1125
|
let n = 0, r = 1e3 / t, i, a, o = (t, r = Date.now()) => {
|
|
1126
1126
|
n = r, i = null, a &&= (clearTimeout(a), null), e(...t);
|
|
1127
1127
|
};
|
|
@@ -1134,9 +1134,9 @@ function Zt(e, t) {
|
|
|
1134
1134
|
}
|
|
1135
1135
|
//#endregion
|
|
1136
1136
|
//#region node_modules/axios/lib/helpers/progressEventReducer.js
|
|
1137
|
-
var
|
|
1138
|
-
let r = 0, i =
|
|
1139
|
-
return
|
|
1137
|
+
var $t = (e, t, n = 3) => {
|
|
1138
|
+
let r = 0, i = Zt(50, 250);
|
|
1139
|
+
return Qt((n) => {
|
|
1140
1140
|
let a = n.loaded, o = n.lengthComputable ? n.total : void 0, s = a - r, c = i(s), l = a <= o;
|
|
1141
1141
|
r = a, e({
|
|
1142
1142
|
loaded: a,
|
|
@@ -1150,14 +1150,14 @@ var Qt = (e, t, n = 3) => {
|
|
|
1150
1150
|
[t ? "download" : "upload"]: !0
|
|
1151
1151
|
});
|
|
1152
1152
|
}, n);
|
|
1153
|
-
},
|
|
1153
|
+
}, en = (e, t) => {
|
|
1154
1154
|
let n = e != null;
|
|
1155
1155
|
return [(r) => t[0]({
|
|
1156
1156
|
lengthComputable: n,
|
|
1157
1157
|
total: e,
|
|
1158
1158
|
loaded: r
|
|
1159
1159
|
}), t[1]];
|
|
1160
|
-
},
|
|
1160
|
+
}, tn = (e) => (...t) => z.asap(() => e(...t)), nn = V.hasStandardBrowserEnv ? ((e, t) => (n) => (n = new URL(n, V.origin), e.protocol === n.protocol && e.host === n.host && (t || e.port === n.port)))(new URL(V.origin), V.navigator && /(msie|trident)/i.test(V.navigator.userAgent)) : () => !0, rn = V.hasStandardBrowserEnv ? {
|
|
1161
1161
|
write(e, t, n, r, i, a, o) {
|
|
1162
1162
|
if (typeof document > "u") return;
|
|
1163
1163
|
let s = [`${e}=${encodeURIComponent(t)}`];
|
|
@@ -1180,24 +1180,24 @@ var Qt = (e, t, n = 3) => {
|
|
|
1180
1180
|
};
|
|
1181
1181
|
//#endregion
|
|
1182
1182
|
//#region node_modules/axios/lib/helpers/isAbsoluteURL.js
|
|
1183
|
-
function
|
|
1183
|
+
function an(e) {
|
|
1184
1184
|
return typeof e == "string" ? /^([a-z][a-z\d+\-.]*:)?\/\//i.test(e) : !1;
|
|
1185
1185
|
}
|
|
1186
1186
|
//#endregion
|
|
1187
1187
|
//#region node_modules/axios/lib/helpers/combineURLs.js
|
|
1188
|
-
function
|
|
1188
|
+
function on(e, t) {
|
|
1189
1189
|
return t ? e.replace(/\/?\/$/, "") + "/" + t.replace(/^\/+/, "") : e;
|
|
1190
1190
|
}
|
|
1191
1191
|
//#endregion
|
|
1192
1192
|
//#region node_modules/axios/lib/core/buildFullPath.js
|
|
1193
|
-
function
|
|
1194
|
-
let r = !
|
|
1195
|
-
return e && (r || n == 0) ?
|
|
1193
|
+
function sn(e, t, n) {
|
|
1194
|
+
let r = !an(t);
|
|
1195
|
+
return e && (r || n == 0) ? on(e, t) : t;
|
|
1196
1196
|
}
|
|
1197
1197
|
//#endregion
|
|
1198
1198
|
//#region node_modules/axios/lib/core/mergeConfig.js
|
|
1199
|
-
var
|
|
1200
|
-
function
|
|
1199
|
+
var cn = (e) => e instanceof W ? { ...e } : e;
|
|
1200
|
+
function K(e, t) {
|
|
1201
1201
|
t ||= {};
|
|
1202
1202
|
let n = {};
|
|
1203
1203
|
function r(e, t, n, r) {
|
|
@@ -1247,7 +1247,7 @@ function q(e, t) {
|
|
|
1247
1247
|
socketPath: o,
|
|
1248
1248
|
responseEncoding: o,
|
|
1249
1249
|
validateStatus: s,
|
|
1250
|
-
headers: (e, t, n) => i(
|
|
1250
|
+
headers: (e, t, n) => i(cn(e), cn(t), n, !0)
|
|
1251
1251
|
};
|
|
1252
1252
|
return z.forEach(Object.keys({
|
|
1253
1253
|
...e,
|
|
@@ -1260,10 +1260,10 @@ function q(e, t) {
|
|
|
1260
1260
|
}
|
|
1261
1261
|
//#endregion
|
|
1262
1262
|
//#region node_modules/axios/lib/helpers/resolveConfig.js
|
|
1263
|
-
var
|
|
1264
|
-
let t =
|
|
1265
|
-
if (t.headers = o =
|
|
1266
|
-
if (
|
|
1263
|
+
var ln = (e) => {
|
|
1264
|
+
let t = K({}, e), { data: n, withXSRFToken: r, xsrfHeaderName: i, xsrfCookieName: a, headers: o, auth: s } = t;
|
|
1265
|
+
if (t.headers = o = W.from(o), t.url = Ct(sn(t.baseURL, t.url, t.allowAbsoluteUrls), e.params, e.paramsSerializer), s && o.set("Authorization", "Basic " + btoa((s.username || "") + ":" + (s.password ? unescape(encodeURIComponent(s.password)) : ""))), z.isFormData(n)) {
|
|
1266
|
+
if (V.hasStandardBrowserEnv || V.hasStandardBrowserWebWorkerEnv) o.setContentType(void 0);
|
|
1267
1267
|
else if (z.isFunction(n.getHeaders)) {
|
|
1268
1268
|
let e = n.getHeaders(), t = ["content-type", "content-length"];
|
|
1269
1269
|
Object.entries(e).forEach(([e, n]) => {
|
|
@@ -1271,14 +1271,14 @@ var cn = (e) => {
|
|
|
1271
1271
|
});
|
|
1272
1272
|
}
|
|
1273
1273
|
}
|
|
1274
|
-
if (
|
|
1275
|
-
let e = i && a &&
|
|
1274
|
+
if (V.hasStandardBrowserEnv && (r && z.isFunction(r) && (r = r(t)), r || r !== !1 && nn(t.url))) {
|
|
1275
|
+
let e = i && a && rn.read(a);
|
|
1276
1276
|
e && o.set(i, e);
|
|
1277
1277
|
}
|
|
1278
1278
|
return t;
|
|
1279
|
-
},
|
|
1279
|
+
}, un = typeof XMLHttpRequest < "u" && function(e) {
|
|
1280
1280
|
return new Promise(function(t, n) {
|
|
1281
|
-
let r =
|
|
1281
|
+
let r = ln(e), i = r.data, a = W.from(r.headers).normalize(), { responseType: o, onUploadProgress: s, onDownloadProgress: c } = r, l, u, d, f, p;
|
|
1282
1282
|
function m() {
|
|
1283
1283
|
f && f(), p && p(), r.cancelToken && r.cancelToken.unsubscribe(l), r.signal && r.signal.removeEventListener("abort", l);
|
|
1284
1284
|
}
|
|
@@ -1286,8 +1286,8 @@ var cn = (e) => {
|
|
|
1286
1286
|
h.open(r.method.toUpperCase(), r.url, !0), h.timeout = r.timeout;
|
|
1287
1287
|
function g() {
|
|
1288
1288
|
if (!h) return;
|
|
1289
|
-
let r =
|
|
1290
|
-
|
|
1289
|
+
let r = W.from("getAllResponseHeaders" in h && h.getAllResponseHeaders());
|
|
1290
|
+
Yt(function(e) {
|
|
1291
1291
|
t(e), m();
|
|
1292
1292
|
}, function(e) {
|
|
1293
1293
|
n(e), m();
|
|
@@ -1308,28 +1308,28 @@ var cn = (e) => {
|
|
|
1308
1308
|
let r = new B(t && t.message ? t.message : "Network Error", B.ERR_NETWORK, e, h);
|
|
1309
1309
|
r.event = t || null, n(r), h = null;
|
|
1310
1310
|
}, h.ontimeout = function() {
|
|
1311
|
-
let t = r.timeout ? "timeout of " + r.timeout + "ms exceeded" : "timeout exceeded", i = r.transitional ||
|
|
1311
|
+
let t = r.timeout ? "timeout of " + r.timeout + "ms exceeded" : "timeout exceeded", i = r.transitional || Tt;
|
|
1312
1312
|
r.timeoutErrorMessage && (t = r.timeoutErrorMessage), n(new B(t, i.clarifyTimeoutError ? B.ETIMEDOUT : B.ECONNABORTED, e, h)), h = null;
|
|
1313
1313
|
}, i === void 0 && a.setContentType(null), "setRequestHeader" in h && z.forEach(a.toJSON(), function(e, t) {
|
|
1314
1314
|
h.setRequestHeader(t, e);
|
|
1315
|
-
}), z.isUndefined(r.withCredentials) || (h.withCredentials = !!r.withCredentials), o && o !== "json" && (h.responseType = r.responseType), c && ([d, p] =
|
|
1316
|
-
h &&= (n(!t || t.type ? new
|
|
1315
|
+
}), z.isUndefined(r.withCredentials) || (h.withCredentials = !!r.withCredentials), o && o !== "json" && (h.responseType = r.responseType), c && ([d, p] = $t(c, !0), h.addEventListener("progress", d)), s && h.upload && ([u, f] = $t(s), h.upload.addEventListener("progress", u), h.upload.addEventListener("loadend", f)), (r.cancelToken || r.signal) && (l = (t) => {
|
|
1316
|
+
h &&= (n(!t || t.type ? new G(null, e, h) : t), h.abort(), null);
|
|
1317
1317
|
}, r.cancelToken && r.cancelToken.subscribe(l), r.signal && (r.signal.aborted ? l() : r.signal.addEventListener("abort", l)));
|
|
1318
|
-
let _ =
|
|
1319
|
-
if (_ &&
|
|
1318
|
+
let _ = Xt(r.url);
|
|
1319
|
+
if (_ && V.protocols.indexOf(_) === -1) {
|
|
1320
1320
|
n(new B("Unsupported protocol " + _ + ":", B.ERR_BAD_REQUEST, e));
|
|
1321
1321
|
return;
|
|
1322
1322
|
}
|
|
1323
1323
|
h.send(i || null);
|
|
1324
1324
|
});
|
|
1325
|
-
},
|
|
1325
|
+
}, dn = (e, t) => {
|
|
1326
1326
|
let { length: n } = e = e ? e.filter(Boolean) : [];
|
|
1327
1327
|
if (t || n) {
|
|
1328
1328
|
let n = new AbortController(), r, i = function(e) {
|
|
1329
1329
|
if (!r) {
|
|
1330
1330
|
r = !0, o();
|
|
1331
1331
|
let t = e instanceof Error ? e : this.reason;
|
|
1332
|
-
n.abort(t instanceof B ? t : new
|
|
1332
|
+
n.abort(t instanceof B ? t : new G(t instanceof Error ? t.message : t));
|
|
1333
1333
|
}
|
|
1334
1334
|
}, a = t && setTimeout(() => {
|
|
1335
1335
|
a = null, i(new B(`timeout of ${t}ms exceeded`, B.ETIMEDOUT));
|
|
@@ -1342,7 +1342,7 @@ var cn = (e) => {
|
|
|
1342
1342
|
let { signal: s } = n;
|
|
1343
1343
|
return s.unsubscribe = () => z.asap(o), s;
|
|
1344
1344
|
}
|
|
1345
|
-
},
|
|
1345
|
+
}, fn = function* (e, t) {
|
|
1346
1346
|
let n = e.byteLength;
|
|
1347
1347
|
if (!t || n < t) {
|
|
1348
1348
|
yield e;
|
|
@@ -1350,9 +1350,9 @@ var cn = (e) => {
|
|
|
1350
1350
|
}
|
|
1351
1351
|
let r = 0, i;
|
|
1352
1352
|
for (; r < n;) i = r + t, yield e.slice(r, i), r = i;
|
|
1353
|
-
},
|
|
1354
|
-
for await (let n of
|
|
1355
|
-
},
|
|
1353
|
+
}, pn = async function* (e, t) {
|
|
1354
|
+
for await (let n of mn(e)) yield* fn(n, t);
|
|
1355
|
+
}, mn = async function* (e) {
|
|
1356
1356
|
if (e[Symbol.asyncIterator]) {
|
|
1357
1357
|
yield* e;
|
|
1358
1358
|
return;
|
|
@@ -1367,8 +1367,8 @@ var cn = (e) => {
|
|
|
1367
1367
|
} finally {
|
|
1368
1368
|
await t.cancel();
|
|
1369
1369
|
}
|
|
1370
|
-
},
|
|
1371
|
-
let i =
|
|
1370
|
+
}, hn = (e, t, n, r) => {
|
|
1371
|
+
let i = pn(e, t), a = 0, o, s = (e) => {
|
|
1372
1372
|
o || (o = !0, r && r(e));
|
|
1373
1373
|
};
|
|
1374
1374
|
return new ReadableStream({
|
|
@@ -1389,29 +1389,29 @@ var cn = (e) => {
|
|
|
1389
1389
|
return s(e), i.return();
|
|
1390
1390
|
}
|
|
1391
1391
|
}, { highWaterMark: 2 });
|
|
1392
|
-
},
|
|
1392
|
+
}, gn = 64 * 1024, { isFunction: _n } = z, vn = (({ Request: e, Response: t }) => ({
|
|
1393
1393
|
Request: e,
|
|
1394
1394
|
Response: t
|
|
1395
|
-
}))(z.global), { ReadableStream:
|
|
1395
|
+
}))(z.global), { ReadableStream: yn, TextEncoder: bn } = z.global, xn = (e, ...t) => {
|
|
1396
1396
|
try {
|
|
1397
1397
|
return !!e(...t);
|
|
1398
1398
|
} catch {
|
|
1399
1399
|
return !1;
|
|
1400
1400
|
}
|
|
1401
|
-
},
|
|
1402
|
-
e = z.merge.call({ skipUndefined: !0 },
|
|
1403
|
-
let { fetch: t, Request: n, Response: r } = e, i = t ?
|
|
1401
|
+
}, Sn = (e) => {
|
|
1402
|
+
e = z.merge.call({ skipUndefined: !0 }, vn, e);
|
|
1403
|
+
let { fetch: t, Request: n, Response: r } = e, i = t ? _n(t) : typeof fetch == "function", a = _n(n), o = _n(r);
|
|
1404
1404
|
if (!i) return !1;
|
|
1405
|
-
let s = i &&
|
|
1406
|
-
let e = !1, t = new n(
|
|
1407
|
-
body: new
|
|
1405
|
+
let s = i && _n(yn), c = i && (typeof bn == "function" ? ((e) => (t) => e.encode(t))(new bn()) : async (e) => new Uint8Array(await new n(e).arrayBuffer())), l = a && s && xn(() => {
|
|
1406
|
+
let e = !1, t = new n(V.origin, {
|
|
1407
|
+
body: new yn(),
|
|
1408
1408
|
method: "POST",
|
|
1409
1409
|
get duplex() {
|
|
1410
1410
|
return e = !0, "half";
|
|
1411
1411
|
}
|
|
1412
1412
|
}).headers.has("Content-Type");
|
|
1413
1413
|
return e && !t;
|
|
1414
|
-
}), u = o && s &&
|
|
1414
|
+
}), u = o && s && xn(() => z.isReadableStream(new r("").body)), d = { stream: u && ((e) => e.body) };
|
|
1415
1415
|
i && [
|
|
1416
1416
|
"text",
|
|
1417
1417
|
"arrayBuffer",
|
|
@@ -1428,7 +1428,7 @@ var cn = (e) => {
|
|
|
1428
1428
|
let f = async (e) => {
|
|
1429
1429
|
if (e == null) return 0;
|
|
1430
1430
|
if (z.isBlob(e)) return e.size;
|
|
1431
|
-
if (z.isSpecCompliantForm(e)) return (await new n(
|
|
1431
|
+
if (z.isSpecCompliantForm(e)) return (await new n(V.origin, {
|
|
1432
1432
|
method: "POST",
|
|
1433
1433
|
body: e
|
|
1434
1434
|
}).arrayBuffer()).byteLength;
|
|
@@ -1436,9 +1436,9 @@ var cn = (e) => {
|
|
|
1436
1436
|
if (z.isURLSearchParams(e) && (e += ""), z.isString(e)) return (await c(e)).byteLength;
|
|
1437
1437
|
}, p = async (e, t) => z.toFiniteNumber(e.getContentLength()) ?? f(t);
|
|
1438
1438
|
return async (e) => {
|
|
1439
|
-
let { url: i, method: o, data: s, signal: c, cancelToken: f, timeout: m, onDownloadProgress: h, onUploadProgress: g, responseType: _, headers: v, withCredentials: y = "same-origin", fetchOptions: b } =
|
|
1439
|
+
let { url: i, method: o, data: s, signal: c, cancelToken: f, timeout: m, onDownloadProgress: h, onUploadProgress: g, responseType: _, headers: v, withCredentials: y = "same-origin", fetchOptions: b } = ln(e), x = t || fetch;
|
|
1440
1440
|
_ = _ ? (_ + "").toLowerCase() : "text";
|
|
1441
|
-
let S =
|
|
1441
|
+
let S = dn([c, f && f.toAbortSignal()], m), C = null, w = S && S.unsubscribe && (() => {
|
|
1442
1442
|
S.unsubscribe();
|
|
1443
1443
|
}), T;
|
|
1444
1444
|
try {
|
|
@@ -1449,8 +1449,8 @@ var cn = (e) => {
|
|
|
1449
1449
|
duplex: "half"
|
|
1450
1450
|
}), t;
|
|
1451
1451
|
if (z.isFormData(s) && (t = e.headers.get("content-type")) && v.setContentType(t), e.body) {
|
|
1452
|
-
let [t, n] =
|
|
1453
|
-
s =
|
|
1452
|
+
let [t, n] = en(T, $t(tn(g)));
|
|
1453
|
+
s = hn(e.body, gn, t, n);
|
|
1454
1454
|
}
|
|
1455
1455
|
}
|
|
1456
1456
|
z.isString(y) || (y = y ? "include" : "omit");
|
|
@@ -1474,17 +1474,17 @@ var cn = (e) => {
|
|
|
1474
1474
|
].forEach((t) => {
|
|
1475
1475
|
e[t] = f[t];
|
|
1476
1476
|
});
|
|
1477
|
-
let t = z.toFiniteNumber(f.headers.get("content-length")), [n, i] = h &&
|
|
1478
|
-
f = new r(
|
|
1477
|
+
let t = z.toFiniteNumber(f.headers.get("content-length")), [n, i] = h && en(t, $t(tn(h), !0)) || [];
|
|
1478
|
+
f = new r(hn(f.body, gn, n, () => {
|
|
1479
1479
|
i && i(), w && w();
|
|
1480
1480
|
}), e);
|
|
1481
1481
|
}
|
|
1482
1482
|
_ ||= "text";
|
|
1483
1483
|
let ee = await d[z.findKey(d, _) || "text"](f, e);
|
|
1484
1484
|
return !m && w && w(), await new Promise((t, n) => {
|
|
1485
|
-
|
|
1485
|
+
Yt(t, n, {
|
|
1486
1486
|
data: ee,
|
|
1487
|
-
headers:
|
|
1487
|
+
headers: W.from(f.headers),
|
|
1488
1488
|
status: f.status,
|
|
1489
1489
|
statusText: f.statusText,
|
|
1490
1490
|
config: e,
|
|
@@ -1495,24 +1495,24 @@ var cn = (e) => {
|
|
|
1495
1495
|
throw w && w(), t && t.name === "TypeError" && /Load failed|fetch/i.test(t.message) ? Object.assign(new B("Network Error", B.ERR_NETWORK, e, C, t && t.response), { cause: t.cause || t }) : B.from(t, t && t.code, e, C, t && t.response);
|
|
1496
1496
|
}
|
|
1497
1497
|
};
|
|
1498
|
-
},
|
|
1498
|
+
}, Cn = /* @__PURE__ */ new Map(), wn = (e) => {
|
|
1499
1499
|
let t = e && e.env || {}, { fetch: n, Request: r, Response: i } = t, a = [
|
|
1500
1500
|
r,
|
|
1501
1501
|
i,
|
|
1502
1502
|
n
|
|
1503
|
-
], o = a.length, s, c, l =
|
|
1504
|
-
for (; o--;) s = a[o], c = l.get(s), c === void 0 && l.set(s, c = o ? /* @__PURE__ */ new Map() :
|
|
1503
|
+
], o = a.length, s, c, l = Cn;
|
|
1504
|
+
for (; o--;) s = a[o], c = l.get(s), c === void 0 && l.set(s, c = o ? /* @__PURE__ */ new Map() : Sn(t)), l = c;
|
|
1505
1505
|
return c;
|
|
1506
1506
|
};
|
|
1507
|
-
|
|
1507
|
+
wn();
|
|
1508
1508
|
//#endregion
|
|
1509
1509
|
//#region node_modules/axios/lib/adapters/adapters.js
|
|
1510
|
-
var
|
|
1510
|
+
var Tn = {
|
|
1511
1511
|
http: null,
|
|
1512
|
-
xhr:
|
|
1513
|
-
fetch: { get:
|
|
1512
|
+
xhr: un,
|
|
1513
|
+
fetch: { get: wn }
|
|
1514
1514
|
};
|
|
1515
|
-
z.forEach(
|
|
1515
|
+
z.forEach(Tn, (e, t) => {
|
|
1516
1516
|
if (e) {
|
|
1517
1517
|
try {
|
|
1518
1518
|
Object.defineProperty(e, "name", { value: t });
|
|
@@ -1520,46 +1520,46 @@ z.forEach(wn, (e, t) => {
|
|
|
1520
1520
|
Object.defineProperty(e, "adapterName", { value: t });
|
|
1521
1521
|
}
|
|
1522
1522
|
});
|
|
1523
|
-
var
|
|
1524
|
-
function
|
|
1523
|
+
var En = (e) => `- ${e}`, Dn = (e) => z.isFunction(e) || e === null || e === !1;
|
|
1524
|
+
function On(e, t) {
|
|
1525
1525
|
e = z.isArray(e) ? e : [e];
|
|
1526
1526
|
let { length: n } = e, r, i, a = {};
|
|
1527
1527
|
for (let o = 0; o < n; o++) {
|
|
1528
1528
|
r = e[o];
|
|
1529
1529
|
let n;
|
|
1530
|
-
if (i = r, !
|
|
1530
|
+
if (i = r, !Dn(r) && (i = Tn[(n = String(r)).toLowerCase()], i === void 0)) throw new B(`Unknown adapter '${n}'`);
|
|
1531
1531
|
if (i && (z.isFunction(i) || (i = i.get(t)))) break;
|
|
1532
1532
|
a[n || "#" + o] = i;
|
|
1533
1533
|
}
|
|
1534
1534
|
if (!i) {
|
|
1535
1535
|
let e = Object.entries(a).map(([e, t]) => `adapter ${e} ` + (t === !1 ? "is not supported by the environment" : "is not available in the build"));
|
|
1536
|
-
throw new B("There is no suitable adapter to dispatch the request " + (n ? e.length > 1 ? "since :\n" + e.map(
|
|
1536
|
+
throw new B("There is no suitable adapter to dispatch the request " + (n ? e.length > 1 ? "since :\n" + e.map(En).join("\n") : " " + En(e[0]) : "as no adapter specified"), "ERR_NOT_SUPPORT");
|
|
1537
1537
|
}
|
|
1538
1538
|
return i;
|
|
1539
1539
|
}
|
|
1540
|
-
var
|
|
1541
|
-
getAdapter:
|
|
1542
|
-
adapters:
|
|
1540
|
+
var kn = {
|
|
1541
|
+
getAdapter: On,
|
|
1542
|
+
adapters: Tn
|
|
1543
1543
|
};
|
|
1544
1544
|
//#endregion
|
|
1545
1545
|
//#region node_modules/axios/lib/core/dispatchRequest.js
|
|
1546
|
-
function kn(e) {
|
|
1547
|
-
if (e.cancelToken && e.cancelToken.throwIfRequested(), e.signal && e.signal.aborted) throw new K(null, e);
|
|
1548
|
-
}
|
|
1549
1546
|
function An(e) {
|
|
1550
|
-
|
|
1547
|
+
if (e.cancelToken && e.cancelToken.throwIfRequested(), e.signal && e.signal.aborted) throw new G(null, e);
|
|
1548
|
+
}
|
|
1549
|
+
function jn(e) {
|
|
1550
|
+
return An(e), e.headers = W.from(e.headers), e.data = qt.call(e, e.transformRequest), [
|
|
1551
1551
|
"post",
|
|
1552
1552
|
"put",
|
|
1553
1553
|
"patch"
|
|
1554
|
-
].indexOf(e.method) !== -1 && e.headers.setContentType("application/x-www-form-urlencoded", !1),
|
|
1555
|
-
return
|
|
1554
|
+
].indexOf(e.method) !== -1 && e.headers.setContentType("application/x-www-form-urlencoded", !1), kn.getAdapter(e.adapter || H.adapter, e)(e).then(function(t) {
|
|
1555
|
+
return An(e), t.data = qt.call(e, e.transformResponse, t), t.headers = W.from(t.headers), t;
|
|
1556
1556
|
}, function(t) {
|
|
1557
|
-
return
|
|
1557
|
+
return Jt(t) || (An(e), t && t.response && (t.response.data = qt.call(e, e.transformResponse, t.response), t.response.headers = W.from(t.response.headers))), Promise.reject(t);
|
|
1558
1558
|
});
|
|
1559
1559
|
}
|
|
1560
1560
|
//#endregion
|
|
1561
1561
|
//#region node_modules/axios/lib/env/data.js
|
|
1562
|
-
var
|
|
1562
|
+
var Mn = "1.13.6", q = {};
|
|
1563
1563
|
[
|
|
1564
1564
|
"object",
|
|
1565
1565
|
"boolean",
|
|
@@ -1568,20 +1568,20 @@ var jn = "1.13.6", Mn = {};
|
|
|
1568
1568
|
"string",
|
|
1569
1569
|
"symbol"
|
|
1570
1570
|
].forEach((e, t) => {
|
|
1571
|
-
|
|
1571
|
+
q[e] = function(n) {
|
|
1572
1572
|
return typeof n === e || "a" + (t < 1 ? "n " : " ") + e;
|
|
1573
1573
|
};
|
|
1574
1574
|
});
|
|
1575
1575
|
var Nn = {};
|
|
1576
|
-
|
|
1576
|
+
q.transitional = function(e, t, n) {
|
|
1577
1577
|
function r(e, t) {
|
|
1578
|
-
return "[Axios v" +
|
|
1578
|
+
return "[Axios v" + Mn + "] Transitional option '" + e + "'" + t + (n ? ". " + n : "");
|
|
1579
1579
|
}
|
|
1580
1580
|
return (n, i, a) => {
|
|
1581
1581
|
if (e === !1) throw new B(r(i, " has been removed" + (t ? " in " + t : "")), B.ERR_DEPRECATED);
|
|
1582
1582
|
return t && !Nn[i] && (Nn[i] = !0, console.warn(r(i, " has been deprecated since v" + t + " and will be removed in the near future"))), e ? e(n, i, a) : !0;
|
|
1583
1583
|
};
|
|
1584
|
-
},
|
|
1584
|
+
}, q.spelling = function(e) {
|
|
1585
1585
|
return (t, n) => (console.warn(`${n} is likely a misspelling of ${e}`), !0);
|
|
1586
1586
|
};
|
|
1587
1587
|
function Pn(e, t, n) {
|
|
@@ -1599,12 +1599,12 @@ function Pn(e, t, n) {
|
|
|
1599
1599
|
}
|
|
1600
1600
|
var Fn = {
|
|
1601
1601
|
assertOptions: Pn,
|
|
1602
|
-
validators:
|
|
1602
|
+
validators: q
|
|
1603
1603
|
}, J = Fn.validators, Y = class {
|
|
1604
1604
|
constructor(e) {
|
|
1605
1605
|
this.defaults = e || {}, this.interceptors = {
|
|
1606
|
-
request: new
|
|
1607
|
-
response: new
|
|
1606
|
+
request: new wt(),
|
|
1607
|
+
response: new wt()
|
|
1608
1608
|
};
|
|
1609
1609
|
}
|
|
1610
1610
|
async request(e, t) {
|
|
@@ -1623,7 +1623,7 @@ var Fn = {
|
|
|
1623
1623
|
}
|
|
1624
1624
|
}
|
|
1625
1625
|
_request(e, t) {
|
|
1626
|
-
typeof e == "string" ? (t ||= {}, t.url = e) : t = e || {}, t =
|
|
1626
|
+
typeof e == "string" ? (t ||= {}, t.url = e) : t = e || {}, t = K(this.defaults, t);
|
|
1627
1627
|
let { transitional: n, paramsSerializer: r, headers: i } = t;
|
|
1628
1628
|
n !== void 0 && Fn.assertOptions(n, {
|
|
1629
1629
|
silentJSONParsing: J.transitional(J.boolean),
|
|
@@ -1648,12 +1648,12 @@ var Fn = {
|
|
|
1648
1648
|
"common"
|
|
1649
1649
|
], (e) => {
|
|
1650
1650
|
delete i[e];
|
|
1651
|
-
}), t.headers =
|
|
1651
|
+
}), t.headers = W.concat(a, i);
|
|
1652
1652
|
let o = [], s = !0;
|
|
1653
1653
|
this.interceptors.request.forEach(function(e) {
|
|
1654
1654
|
if (typeof e.runWhen == "function" && e.runWhen(t) === !1) return;
|
|
1655
1655
|
s &&= e.synchronous;
|
|
1656
|
-
let n = t.transitional ||
|
|
1656
|
+
let n = t.transitional || Tt;
|
|
1657
1657
|
n && n.legacyInterceptorReqResOrdering ? o.unshift(e.fulfilled, e.rejected) : o.push(e.fulfilled, e.rejected);
|
|
1658
1658
|
});
|
|
1659
1659
|
let c = [];
|
|
@@ -1662,7 +1662,7 @@ var Fn = {
|
|
|
1662
1662
|
});
|
|
1663
1663
|
let l, u = 0, d;
|
|
1664
1664
|
if (!s) {
|
|
1665
|
-
let e = [
|
|
1665
|
+
let e = [jn.bind(this), void 0];
|
|
1666
1666
|
for (e.unshift(...o), e.push(...c), d = e.length, l = Promise.resolve(t); u < d;) l = l.then(e[u++], e[u++]);
|
|
1667
1667
|
return l;
|
|
1668
1668
|
}
|
|
@@ -1678,7 +1678,7 @@ var Fn = {
|
|
|
1678
1678
|
}
|
|
1679
1679
|
}
|
|
1680
1680
|
try {
|
|
1681
|
-
l =
|
|
1681
|
+
l = jn.call(this, f);
|
|
1682
1682
|
} catch (e) {
|
|
1683
1683
|
return Promise.reject(e);
|
|
1684
1684
|
}
|
|
@@ -1686,7 +1686,7 @@ var Fn = {
|
|
|
1686
1686
|
return l;
|
|
1687
1687
|
}
|
|
1688
1688
|
getUri(e) {
|
|
1689
|
-
return e =
|
|
1689
|
+
return e = K(this.defaults, e), Ct(sn(e.baseURL, e.url, e.allowAbsoluteUrls), e.params, e.paramsSerializer);
|
|
1690
1690
|
}
|
|
1691
1691
|
};
|
|
1692
1692
|
z.forEach([
|
|
@@ -1696,7 +1696,7 @@ z.forEach([
|
|
|
1696
1696
|
"options"
|
|
1697
1697
|
], function(e) {
|
|
1698
1698
|
Y.prototype[e] = function(t, n) {
|
|
1699
|
-
return this.request(
|
|
1699
|
+
return this.request(K(n || {}, {
|
|
1700
1700
|
method: e,
|
|
1701
1701
|
url: t,
|
|
1702
1702
|
data: (n || {}).data
|
|
@@ -1709,7 +1709,7 @@ z.forEach([
|
|
|
1709
1709
|
], function(e) {
|
|
1710
1710
|
function t(t) {
|
|
1711
1711
|
return function(n, r, i) {
|
|
1712
|
-
return this.request(
|
|
1712
|
+
return this.request(K(i || {}, {
|
|
1713
1713
|
method: e,
|
|
1714
1714
|
headers: t ? { "Content-Type": "multipart/form-data" } : {},
|
|
1715
1715
|
url: n,
|
|
@@ -1742,7 +1742,7 @@ var In = class e {
|
|
|
1742
1742
|
n.unsubscribe(t);
|
|
1743
1743
|
}, r;
|
|
1744
1744
|
}, e(function(e, r, i) {
|
|
1745
|
-
n.reason || (n.reason = new
|
|
1745
|
+
n.reason || (n.reason = new G(e, r, i), t(n.reason));
|
|
1746
1746
|
});
|
|
1747
1747
|
}
|
|
1748
1748
|
throwIfRequested() {
|
|
@@ -1869,13 +1869,13 @@ Object.entries(zn).forEach(([e, t]) => {
|
|
|
1869
1869
|
function Bn(e) {
|
|
1870
1870
|
let t = new Y(e), n = ue(Y.prototype.request, t);
|
|
1871
1871
|
return z.extend(n, Y.prototype, t, { allOwnKeys: !0 }), z.extend(n, t, null, { allOwnKeys: !0 }), n.create = function(t) {
|
|
1872
|
-
return Bn(
|
|
1872
|
+
return Bn(K(e, t));
|
|
1873
1873
|
}, n;
|
|
1874
1874
|
}
|
|
1875
|
-
var X = Bn(
|
|
1876
|
-
X.Axios = Y, X.CanceledError =
|
|
1875
|
+
var X = Bn(H);
|
|
1876
|
+
X.Axios = Y, X.CanceledError = G, X.CancelToken = In, X.isCancel = Jt, X.VERSION = Mn, X.toFormData = vt, X.AxiosError = B, X.Cancel = X.CanceledError, X.all = function(e) {
|
|
1877
1877
|
return Promise.all(e);
|
|
1878
|
-
}, X.spread = Ln, X.isAxiosError = Rn, X.mergeConfig =
|
|
1878
|
+
}, X.spread = Ln, X.isAxiosError = Rn, X.mergeConfig = K, X.AxiosHeaders = W, X.formToJSON = (e) => It(z.isHTMLForm(e) ? new FormData(e) : e), X.getAdapter = kn.getAdapter, X.HttpStatusCode = zn, X.default = X;
|
|
1879
1879
|
//#endregion
|
|
1880
1880
|
//#region src/modules/configs/serviceConfig/ServiceConfig.class.ts
|
|
1881
1881
|
var Vn = class {
|
|
@@ -1981,10 +1981,8 @@ var Z = {
|
|
|
1981
1981
|
}));
|
|
1982
1982
|
return s.sendDocumentMessage({
|
|
1983
1983
|
...i,
|
|
1984
|
-
|
|
1985
|
-
|
|
1986
|
-
documents: c
|
|
1987
|
-
}
|
|
1984
|
+
body: r,
|
|
1985
|
+
documents: c
|
|
1988
1986
|
});
|
|
1989
1987
|
}, $n = async (e, t) => {
|
|
1990
1988
|
let { files: n, body: r, ...i } = t, a = oe(n), o = Zn(i.to);
|
|
@@ -1996,10 +1994,8 @@ var Z = {
|
|
|
1996
1994
|
}));
|
|
1997
1995
|
return s.sendImageMessage({
|
|
1998
1996
|
...i,
|
|
1999
|
-
|
|
2000
|
-
|
|
2001
|
-
images: c
|
|
2002
|
-
}
|
|
1997
|
+
body: r,
|
|
1998
|
+
images: c
|
|
2003
1999
|
});
|
|
2004
2000
|
}, er = async (e, t) => qn(e).sendTextMessage(t);
|
|
2005
2001
|
//#endregion
|
|
@@ -2094,8 +2090,14 @@ function lr(e) {
|
|
|
2094
2090
|
};
|
|
2095
2091
|
}
|
|
2096
2092
|
//#endregion
|
|
2097
|
-
//#region src/modules/socket/enums/
|
|
2093
|
+
//#region src/modules/socket/enums/ChatsSocketConnectionStatus.enum.ts
|
|
2098
2094
|
var Q = {
|
|
2095
|
+
Idle: "idle",
|
|
2096
|
+
Connecting: "connecting",
|
|
2097
|
+
Connected: "connected",
|
|
2098
|
+
Disconnected: "disconnected",
|
|
2099
|
+
Error: "error"
|
|
2100
|
+
}, $ = {
|
|
2099
2101
|
Connected: "connectedEvent",
|
|
2100
2102
|
Disconnected: "disconnectedEvent",
|
|
2101
2103
|
Error: "errorEvent",
|
|
@@ -2103,13 +2105,16 @@ var Q = {
|
|
|
2103
2105
|
ThreadCreated: "threadCreatedEvent",
|
|
2104
2106
|
Ack: "ackEvent",
|
|
2105
2107
|
Ping: "pingEvent"
|
|
2106
|
-
},
|
|
2107
|
-
|
|
2108
|
-
|
|
2109
|
-
|
|
2110
|
-
|
|
2111
|
-
|
|
2112
|
-
|
|
2108
|
+
}, ur = ({ axiosInstance: e }) => ({
|
|
2109
|
+
addMember: async (t, { contact: n, role: i }) => r((await e.post(`/v1/threads/${t}/members`, {
|
|
2110
|
+
contact: {
|
|
2111
|
+
sub: n.sub,
|
|
2112
|
+
iss: n.iss
|
|
2113
|
+
},
|
|
2114
|
+
role: i
|
|
2115
|
+
})).data, [A()]),
|
|
2116
|
+
removeMember: async (t, { id: n }) => r((await e.delete(`/v1/threads/${t}/members/${n}`)).data, [A()])
|
|
2117
|
+
}), dr = (e) => async (t, n) => ur(e).addMember(t, n), fr = (e) => async (t, n) => ur(e).removeMember(t, n), pr = class {
|
|
2113
2118
|
_serviceConfig;
|
|
2114
2119
|
id;
|
|
2115
2120
|
constructor(e, { serviceConfig: t }) {
|
|
@@ -2140,66 +2145,72 @@ var Q = {
|
|
|
2140
2145
|
});
|
|
2141
2146
|
}
|
|
2142
2147
|
}
|
|
2148
|
+
async addMember(e) {
|
|
2149
|
+
return dr(this.serviceConfig)(this.id, e);
|
|
2150
|
+
}
|
|
2151
|
+
async removeMember(e) {
|
|
2152
|
+
return fr(this.serviceConfig)(this.id, e);
|
|
2153
|
+
}
|
|
2143
2154
|
get serviceConfig() {
|
|
2144
2155
|
return this._serviceConfig;
|
|
2145
2156
|
}
|
|
2146
2157
|
};
|
|
2147
|
-
function
|
|
2148
|
-
return new
|
|
2158
|
+
function mr(e, { serviceConfig: t }) {
|
|
2159
|
+
return new pr(e, { serviceConfig: t });
|
|
2149
2160
|
}
|
|
2150
2161
|
//#endregion
|
|
2151
2162
|
//#region src/modules/socket/utils/instantiateSocketEventEntities.ts
|
|
2152
|
-
function
|
|
2153
|
-
return e.name ===
|
|
2163
|
+
function hr(e, { serviceConfig: t }) {
|
|
2164
|
+
return e.name === $.ThreadMessage ? Kn(e.payload, { serviceConfig: t }) : mr(e.payload, { serviceConfig: t });
|
|
2154
2165
|
}
|
|
2155
2166
|
//#endregion
|
|
2156
2167
|
//#region src/modules/socket/utils/processSocketEventPayload.ts
|
|
2157
|
-
function
|
|
2158
|
-
if (e.connectedEvent) return
|
|
2159
|
-
if (e.disconnectedEvent) return
|
|
2160
|
-
if (e.errorEvent) return
|
|
2161
|
-
if (e.messageEvent) return
|
|
2162
|
-
if (e.threadCreatedEvent) return
|
|
2163
|
-
if (e.ackEvent) return
|
|
2164
|
-
if (e.pingEvent) return
|
|
2168
|
+
function gr(e) {
|
|
2169
|
+
if (e.connectedEvent) return $.Connected;
|
|
2170
|
+
if (e.disconnectedEvent) return $.Disconnected;
|
|
2171
|
+
if (e.errorEvent) return $.Error;
|
|
2172
|
+
if (e.messageEvent) return $.ThreadMessage;
|
|
2173
|
+
if (e.threadCreatedEvent) return $.ThreadCreated;
|
|
2174
|
+
if (e.ackEvent) return $.Ack;
|
|
2175
|
+
if (e.pingEvent) return $.Ping;
|
|
2165
2176
|
throw Error(`Unknown event: ${JSON.stringify(e)}`);
|
|
2166
2177
|
}
|
|
2167
|
-
function
|
|
2178
|
+
function _r(e, t) {
|
|
2168
2179
|
switch (t) {
|
|
2169
|
-
case
|
|
2170
|
-
case
|
|
2171
|
-
case
|
|
2172
|
-
case
|
|
2173
|
-
case
|
|
2174
|
-
case
|
|
2175
|
-
case
|
|
2180
|
+
case $.Connected: return e.connectedEvent;
|
|
2181
|
+
case $.Disconnected: return e.disconnectedEvent;
|
|
2182
|
+
case $.Error: return e.errorEvent;
|
|
2183
|
+
case $.ThreadMessage: return e.messageEvent;
|
|
2184
|
+
case $.ThreadCreated: return e.threadCreatedEvent;
|
|
2185
|
+
case $.Ack: return e.ackEvent;
|
|
2186
|
+
case $.Ping: return e.pingEvent;
|
|
2176
2187
|
}
|
|
2177
2188
|
}
|
|
2178
|
-
function
|
|
2179
|
-
let n =
|
|
2189
|
+
function vr(e, { serviceConfig: t }) {
|
|
2190
|
+
let n = gr(e);
|
|
2180
2191
|
return {
|
|
2181
2192
|
eventName: n,
|
|
2182
|
-
eventPayload:
|
|
2193
|
+
eventPayload: yr({
|
|
2183
2194
|
name: n,
|
|
2184
|
-
payload:
|
|
2195
|
+
payload: _r(e, n)
|
|
2185
2196
|
}, { serviceConfig: t })
|
|
2186
2197
|
};
|
|
2187
2198
|
}
|
|
2188
|
-
function
|
|
2189
|
-
return e ===
|
|
2199
|
+
function yr({ name: e, payload: t }, { serviceConfig: n }) {
|
|
2200
|
+
return e === $.ThreadMessage || e === $.ThreadCreated ? hr({
|
|
2190
2201
|
name: e,
|
|
2191
2202
|
payload: t
|
|
2192
2203
|
}, { serviceConfig: n }) : t;
|
|
2193
2204
|
}
|
|
2194
2205
|
//#endregion
|
|
2195
2206
|
//#region src/modules/socket/classes/ChatsSoketClient.ts
|
|
2196
|
-
var
|
|
2207
|
+
var br = class {
|
|
2197
2208
|
emitter = lr();
|
|
2198
2209
|
stateEmitter = lr();
|
|
2199
2210
|
socketConfig;
|
|
2200
2211
|
serviceConfig;
|
|
2201
2212
|
ws = null;
|
|
2202
|
-
wsConnectionState =
|
|
2213
|
+
wsConnectionState = Q.Idle;
|
|
2203
2214
|
constructor({ socketConfig: e, serviceConfig: t }) {
|
|
2204
2215
|
this.socketConfig = e, this.serviceConfig = t;
|
|
2205
2216
|
}
|
|
@@ -2212,15 +2223,15 @@ var _r = class {
|
|
|
2212
2223
|
}
|
|
2213
2224
|
async connect() {
|
|
2214
2225
|
return new Promise((e, t) => {
|
|
2215
|
-
this.setConnectionState(
|
|
2216
|
-
this.setConnectionState(
|
|
2226
|
+
this.setConnectionState(Q.Connecting), this.ws = new WebSocket(new URL(this.socketConfig.baseUrl).toString()), this.ws.onopen = () => {
|
|
2227
|
+
this.setConnectionState(Q.Connected), this.ws.send(JSON.stringify({ "x-webitel-access": this.socketConfig.accessToken }));
|
|
2217
2228
|
}, this.ws.onerror = () => {
|
|
2218
|
-
this.setConnectionState(
|
|
2229
|
+
this.setConnectionState(Q.Error), t(/* @__PURE__ */ Error("failed to connect to socket"));
|
|
2219
2230
|
}, this.ws.onclose = () => {
|
|
2220
|
-
this.setConnectionState(
|
|
2231
|
+
this.setConnectionState(Q.Disconnected), this.ws = null, t(/* @__PURE__ */ Error("socket disconnected"));
|
|
2221
2232
|
}, this.ws.onmessage = (t) => {
|
|
2222
|
-
let { eventName: n, eventPayload: i } =
|
|
2223
|
-
n ===
|
|
2233
|
+
let { eventName: n, eventPayload: i } = vr(r(JSON.parse(t.data), [A()]).payload, { serviceConfig: this.serviceConfig });
|
|
2234
|
+
n === $.Connected && e(), this.emitter.emit(n, i);
|
|
2224
2235
|
};
|
|
2225
2236
|
});
|
|
2226
2237
|
}
|
|
@@ -2228,7 +2239,7 @@ var _r = class {
|
|
|
2228
2239
|
throw Error("Not implemented");
|
|
2229
2240
|
}
|
|
2230
2241
|
async disconnect() {
|
|
2231
|
-
this.ws?.close(), this.setConnectionState(
|
|
2242
|
+
this.ws?.close(), this.setConnectionState(Q.Disconnected), this.ws = null;
|
|
2232
2243
|
}
|
|
2233
2244
|
onMessage(e, t) {
|
|
2234
2245
|
this.emitter.on(e, t);
|
|
@@ -2237,30 +2248,48 @@ var _r = class {
|
|
|
2237
2248
|
this.stateEmitter.on(e, t);
|
|
2238
2249
|
}
|
|
2239
2250
|
};
|
|
2240
|
-
function
|
|
2241
|
-
return new
|
|
2251
|
+
function xr({ socketConfig: e, serviceConfig: t }) {
|
|
2252
|
+
return new br({
|
|
2242
2253
|
socketConfig: e,
|
|
2243
2254
|
serviceConfig: t
|
|
2244
2255
|
});
|
|
2245
2256
|
}
|
|
2246
2257
|
//#endregion
|
|
2247
|
-
//#region src/
|
|
2248
|
-
var
|
|
2249
|
-
|
|
2250
|
-
|
|
2251
|
-
|
|
2252
|
-
|
|
2258
|
+
//#region node_modules/@webitel/api-services/src/gen/_models/webitelImApiGatewayV1ThreadRole.ts
|
|
2259
|
+
var Sr = {
|
|
2260
|
+
RoleUnspecified: "ROLE_UNSPECIFIED",
|
|
2261
|
+
RoleMember: "ROLE_MEMBER",
|
|
2262
|
+
RoleAdmin: "ROLE_ADMIN",
|
|
2263
|
+
RoleOwner: "ROLE_OWNER",
|
|
2264
|
+
RoleSupervisor: "ROLE_SUPERVISOR"
|
|
2265
|
+
}, Cr = ({ axiosInstance: e }) => ({
|
|
2266
|
+
getThreadsList: async (t = {}) => {
|
|
2267
|
+
let n = r(t, [l()]);
|
|
2268
|
+
return r((await e.get("/v1/threads", { params: n })).data, [A()]);
|
|
2269
|
+
},
|
|
2270
|
+
getThread: async (t) => {
|
|
2271
|
+
let n = r({ ids: [t] }, [l()]), i = r((await e.get("/v1/threads", { params: n })).data, [A()]).items?.[0];
|
|
2272
|
+
if (!i) throw Error(`Thread not found: ${t}`);
|
|
2273
|
+
return i;
|
|
2274
|
+
}
|
|
2275
|
+
}), wr = (e) => async (t = {}) => await Cr(e).getThreadsList(t), Tr = (e, { serviceConfig: t }) => e.map((e) => mr(e, { serviceConfig: t })), Er = async (e, t = {}) => {
|
|
2276
|
+
let n = await wr(e)(t);
|
|
2253
2277
|
return {
|
|
2254
2278
|
...n,
|
|
2255
|
-
items:
|
|
2279
|
+
items: Tr(n.items ?? [], { serviceConfig: e })
|
|
2256
2280
|
};
|
|
2257
|
-
};
|
|
2281
|
+
}, Dr = (e) => async (t) => Cr(e).getThread(t), Or = async (e, t) => mr(await Dr(e)(t), { serviceConfig: e });
|
|
2258
2282
|
//#endregion
|
|
2259
2283
|
//#region src/modules/threads/threadsSevice.ts
|
|
2260
|
-
function
|
|
2261
|
-
return {
|
|
2284
|
+
function kr(e) {
|
|
2285
|
+
return {
|
|
2286
|
+
fetchThread: (t) => Or(e, t),
|
|
2287
|
+
fetchThreads: (t) => Er(e, t ?? {}),
|
|
2288
|
+
addMember: (t, n) => dr(e)(t, n),
|
|
2289
|
+
removeMember: (t, n) => fr(e)(t, n)
|
|
2290
|
+
};
|
|
2262
2291
|
}
|
|
2263
2292
|
//#endregion
|
|
2264
|
-
export {
|
|
2293
|
+
export { Q as ChatsSocketConnectionStatus, $ as ChatsSocketMessage, Z as MessageAttachmentType, Sr as ThreadMemberRole, xr as createChatsSocketClient, Hn as createServiceConfig, Wn as createSocketConfig, le as useAccountService, cr as useContactsService, tr as useMessagesService, kr as useThreadsService };
|
|
2265
2294
|
|
|
2266
2295
|
//# sourceMappingURL=index.js.map
|