@vitia.ai/secure-api-client-vue 0.1.2 → 0.1.3
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/index.cjs +2 -2
- package/dist/index.cjs.map +1 -1
- package/dist/index.mjs +14 -14
- package/dist/index.mjs.map +1 -1
- package/package.json +1 -1
package/dist/index.mjs
CHANGED
|
@@ -2742,22 +2742,22 @@ class Ms {
|
|
|
2742
2742
|
if (!(this.ws && (this.ws.readyState === WebSocket.OPEN || this.ws.readyState === WebSocket.CONNECTING))) {
|
|
2743
2743
|
if (this._connectPromise) return this._connectPromise;
|
|
2744
2744
|
this._connectPromise = (async () => {
|
|
2745
|
-
const {
|
|
2746
|
-
this.ws = new WebSocket(
|
|
2745
|
+
const { ans: t } = await this.client.get("/url/notifications"), { url: r } = t.data[0];
|
|
2746
|
+
this.ws = new WebSocket(r), this.ws.onopen = () => {
|
|
2747
2747
|
this._reconnectAttempt = 0, console.log("Notifications connected");
|
|
2748
|
-
}, this.ws.onmessage = async (
|
|
2748
|
+
}, this.ws.onmessage = async (s) => {
|
|
2749
2749
|
try {
|
|
2750
|
-
const
|
|
2751
|
-
|
|
2752
|
-
const
|
|
2753
|
-
|
|
2754
|
-
const
|
|
2755
|
-
|
|
2756
|
-
} catch (
|
|
2757
|
-
console.warn("Failed to process notification:",
|
|
2750
|
+
const i = JSON.parse(s.data), o = await this.client.decryptAndVerify(i), c = this.subscriptions.request[o == null ? void 0 : o.correlation_id];
|
|
2751
|
+
c && Object.values(c).length > 0 && Object.values(c).forEach((f) => f(o));
|
|
2752
|
+
const a = this.subscriptions.status[o == null ? void 0 : o.status];
|
|
2753
|
+
a && Object.values(a).length > 0 && Object.values(a).forEach((f) => f(o));
|
|
2754
|
+
const u = this.subscriptions.topic[o == null ? void 0 : o.topic];
|
|
2755
|
+
u && Object.values(u).length > 0 && Object.values(u).forEach((f) => f(o)), Object.values(this.listeners).forEach((f) => f(o));
|
|
2756
|
+
} catch (i) {
|
|
2757
|
+
console.warn("Failed to process notification:", i);
|
|
2758
2758
|
}
|
|
2759
|
-
}, this.ws.onerror = (
|
|
2760
|
-
console.error("Notifications error",
|
|
2759
|
+
}, this.ws.onerror = (s) => {
|
|
2760
|
+
console.error("Notifications error", s);
|
|
2761
2761
|
}, this.ws.onclose = () => {
|
|
2762
2762
|
this.scheduleReconnect(), console.log("Notifications closed");
|
|
2763
2763
|
};
|
|
@@ -3015,7 +3015,7 @@ ${c}`, l = await Hs(i, new TextEncoder().encode(h)), g = ne(l), w = new Headers(
|
|
|
3015
3015
|
token_type: i,
|
|
3016
3016
|
expires_at: o,
|
|
3017
3017
|
refresh_token: c
|
|
3018
|
-
} = r;
|
|
3018
|
+
} = r.data[0];
|
|
3019
3019
|
return s && this.updateSession({ accessToken: s }), i && this.updateSession({ tokenType: i }), o && this.updateSession({ expiresAt: o }), c && this.updateSession({ refreshToken: c }), {
|
|
3020
3020
|
accessToken: s,
|
|
3021
3021
|
tokenType: i,
|