tempest-react-sdk 0.83.0 → 0.84.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +1 -0
- package/dist/auth/create-tempest-auth.cjs +1 -1
- package/dist/auth/create-tempest-auth.cjs.map +1 -1
- package/dist/auth/create-tempest-auth.js +150 -105
- package/dist/auth/create-tempest-auth.js.map +1 -1
- package/dist/http/resumable-upload.cjs +1 -1
- package/dist/http/resumable-upload.cjs.map +1 -1
- package/dist/http/resumable-upload.js +1 -1
- package/dist/http/resumable-upload.js.map +1 -1
- package/dist/http/upload-with-progress.cjs +1 -1
- package/dist/http/upload-with-progress.cjs.map +1 -1
- package/dist/http/upload-with-progress.js +47 -39
- package/dist/http/upload-with-progress.js.map +1 -1
- package/dist/payments/PixCheckout.cjs +2 -0
- package/dist/payments/PixCheckout.cjs.map +1 -0
- package/dist/payments/PixCheckout.js +171 -0
- package/dist/payments/PixCheckout.js.map +1 -0
- package/dist/payments/PixCheckout.module.cjs +3 -0
- package/dist/payments/PixCheckout.module.cjs.map +1 -0
- package/dist/payments/PixCheckout.module.js +22 -0
- package/dist/payments/PixCheckout.module.js.map +1 -0
- package/dist/payments/format.cjs +2 -0
- package/dist/payments/format.cjs.map +1 -0
- package/dist/payments/format.js +9 -0
- package/dist/payments/format.js.map +1 -0
- package/dist/payments/mercado-pago.cjs +2 -0
- package/dist/payments/mercado-pago.cjs.map +1 -0
- package/dist/payments/mercado-pago.js +27 -0
- package/dist/payments/mercado-pago.js.map +1 -0
- package/dist/payments/outcome.cjs +2 -0
- package/dist/payments/outcome.cjs.map +1 -0
- package/dist/payments/outcome.js +108 -0
- package/dist/payments/outcome.js.map +1 -0
- package/dist/payments/types.cjs +2 -0
- package/dist/payments/types.cjs.map +1 -0
- package/dist/payments/types.js +16 -0
- package/dist/payments/types.js.map +1 -0
- package/dist/payments/use-mercado-pago-card.cjs +2 -0
- package/dist/payments/use-mercado-pago-card.cjs.map +1 -0
- package/dist/payments/use-mercado-pago-card.js +120 -0
- package/dist/payments/use-mercado-pago-card.js.map +1 -0
- package/dist/payments/use-pix-charge.cjs +2 -0
- package/dist/payments/use-pix-charge.cjs.map +1 -0
- package/dist/payments/use-pix-charge.js +63 -0
- package/dist/payments/use-pix-charge.js.map +1 -0
- package/dist/query/offline-persistence.cjs +1 -1
- package/dist/query/offline-persistence.cjs.map +1 -1
- package/dist/query/offline-persistence.js +3 -3
- package/dist/query/offline-persistence.js.map +1 -1
- package/dist/styles/PixCheckout.css +2 -0
- package/dist/styles/component/PixCheckout.css +18 -0
- package/dist/styles/manifest.json +6 -0
- package/dist/styles/payments.css +18 -0
- package/dist/styles.css +1 -1
- package/dist/sw/cache.cjs +1 -1
- package/dist/sw/cache.cjs.map +1 -1
- package/dist/sw/cache.js +1 -1
- package/dist/sw/cache.js.map +1 -1
- package/dist/tempest-react-sdk.cjs +1 -1
- package/dist/tempest-react-sdk.d.ts +677 -23
- package/dist/tempest-react-sdk.js +104 -97
- package/package.json +1 -1
|
@@ -3,10 +3,11 @@ import { SessionSupersededError as t } from "../http/errors.js";
|
|
|
3
3
|
import { createApiClient as n } from "../http/api-client.js";
|
|
4
4
|
import { bindSessionIdentity as r } from "./session-identity.js";
|
|
5
5
|
import { createAuthStore as i } from "./create-auth-store.js";
|
|
6
|
-
import {
|
|
6
|
+
import { decodeJWT as a } from "./jwt.js";
|
|
7
|
+
import { createRefreshQueue as o } from "./refresh-queue.js";
|
|
7
8
|
//#region src/auth/create-tempest-auth.ts
|
|
8
|
-
var
|
|
9
|
-
function
|
|
9
|
+
var s = 1e4, c = 1e4;
|
|
10
|
+
function l(e, t) {
|
|
10
11
|
return e.length === 0 ? Promise.resolve() : new Promise((n) => {
|
|
11
12
|
let r = setTimeout(n, t);
|
|
12
13
|
Promise.allSettled(e).then(() => {
|
|
@@ -14,13 +15,22 @@ function c(e, t) {
|
|
|
14
15
|
});
|
|
15
16
|
});
|
|
16
17
|
}
|
|
17
|
-
function
|
|
18
|
+
function u() {
|
|
18
19
|
let e = globalThis.crypto;
|
|
19
20
|
return typeof e?.randomUUID == "function" ? e.randomUUID() : `${Date.now().toString(36)}-${Math.random().toString(36).slice(2)}`;
|
|
20
21
|
}
|
|
21
|
-
var
|
|
22
|
+
var d = /* @__PURE__ */ new Set();
|
|
22
23
|
function ee(t) {
|
|
23
|
-
e() && !
|
|
24
|
+
e() && !d.has(t) && (d.add(t), console.warn("[tempest-react-sdk] createTempestAuth: withCredentials is set without logoutPath. logout() cannot clear the HttpOnly refresh cookie, so the next refresh() — the boot restore — signs the same account back in. Pass logoutPath (the backend's cookie logout route) so the server revokes it."));
|
|
25
|
+
}
|
|
26
|
+
function f(e) {
|
|
27
|
+
if (!e) return null;
|
|
28
|
+
try {
|
|
29
|
+
let { sub: t } = a(e).payload;
|
|
30
|
+
return typeof t == "string" && t !== "" ? t : null;
|
|
31
|
+
} catch {
|
|
32
|
+
return null;
|
|
33
|
+
}
|
|
24
34
|
}
|
|
25
35
|
function te(e) {
|
|
26
36
|
let t = e ?? {};
|
|
@@ -29,15 +39,15 @@ function te(e) {
|
|
|
29
39
|
refreshToken: t.refresh_token
|
|
30
40
|
};
|
|
31
41
|
}
|
|
32
|
-
function
|
|
33
|
-
let { baseURL: d, prefix:
|
|
34
|
-
|
|
42
|
+
function p(a) {
|
|
43
|
+
let { baseURL: d, prefix: p, loginPath: ne = "/api/auth/login", refreshPath: m = "/api/auth/refresh", logoutPath: h, onLogoutError: re, mePath: ie, storeName: g = "tempest-auth", storage: _ = "local", withCredentials: v = !1, csrf: ae, fetcher: y, parseTokens: b = te, parseUser: oe, refreshBody: x = (e) => e ? { refresh_token: e } : void 0, retry: se, redirectTo: S, onSessionEnd: ce } = a;
|
|
44
|
+
v && !h && ee(g);
|
|
35
45
|
let C = i({
|
|
36
|
-
name:
|
|
37
|
-
storage:
|
|
38
|
-
}), w = `${
|
|
46
|
+
name: g,
|
|
47
|
+
storage: _
|
|
48
|
+
}), w = `${g}-refresh`;
|
|
39
49
|
function T() {
|
|
40
|
-
return typeof window > "u" ? null :
|
|
50
|
+
return typeof window > "u" ? null : _ === "session" ? window.sessionStorage : window.localStorage;
|
|
41
51
|
}
|
|
42
52
|
function E() {
|
|
43
53
|
return T()?.getItem(w) ?? null;
|
|
@@ -48,33 +58,33 @@ function d(u) {
|
|
|
48
58
|
let t = T();
|
|
49
59
|
t && (e ? t.setItem(w, e) : t.removeItem(w));
|
|
50
60
|
}
|
|
51
|
-
let k = `${
|
|
61
|
+
let k = `${g}-lineage`, le = `tempest-react-sdk:${g}:refresh`, A = T()?.getItem(k) ?? null;
|
|
52
62
|
function j(e) {
|
|
53
63
|
A = e;
|
|
54
64
|
let t = T();
|
|
55
65
|
t && (e ? t.setItem(k, e) : t.removeItem(k));
|
|
56
66
|
}
|
|
57
67
|
let M = () => C.getState(), N = () => M().token;
|
|
58
|
-
async function
|
|
59
|
-
if (!
|
|
68
|
+
async function ue() {
|
|
69
|
+
if (!ie) return M().user;
|
|
60
70
|
let e = P, n;
|
|
61
71
|
try {
|
|
62
|
-
n = await Q.get(
|
|
72
|
+
n = await Q.get(ie, { skipAuthRetry: !0 });
|
|
63
73
|
} catch (n) {
|
|
64
74
|
throw P === e ? n : new t();
|
|
65
75
|
}
|
|
66
76
|
if (P !== e || !Z().continues) throw new t();
|
|
67
77
|
return M().setUser(n), n;
|
|
68
78
|
}
|
|
69
|
-
let P = 0,
|
|
79
|
+
let P = 0, de = Promise.resolve(), F = 0, I = /* @__PURE__ */ new Set(), L = /* @__PURE__ */ new Set(), R = /* @__PURE__ */ new Set(), z = /* @__PURE__ */ new Set();
|
|
70
80
|
function B(e) {
|
|
71
81
|
let t = e.then(() => void 0, () => void 0);
|
|
72
82
|
return R.add(t), t.then(() => R.delete(t)), e;
|
|
73
83
|
}
|
|
74
|
-
function
|
|
84
|
+
function fe(t) {
|
|
75
85
|
e() && console.warn("[tempest-react-sdk] createTempestAuth: logoutPath revocation failed", t);
|
|
76
86
|
try {
|
|
77
|
-
|
|
87
|
+
re?.(t);
|
|
78
88
|
} catch {
|
|
79
89
|
return;
|
|
80
90
|
}
|
|
@@ -84,116 +94,150 @@ function d(u) {
|
|
|
84
94
|
try {
|
|
85
95
|
await e();
|
|
86
96
|
} catch (e) {
|
|
87
|
-
|
|
97
|
+
fe(e);
|
|
88
98
|
}
|
|
89
99
|
})();
|
|
90
100
|
return L.add(t), t.then(() => L.delete(t)), t;
|
|
91
101
|
}
|
|
92
102
|
function H(e, t) {
|
|
93
|
-
|
|
103
|
+
h && !v && t && V(() => U(e).post(h, { body: x(t) }));
|
|
94
104
|
}
|
|
95
105
|
function U(e) {
|
|
96
106
|
return n({
|
|
97
107
|
baseURL: d,
|
|
98
|
-
prefix:
|
|
99
|
-
withCredentials:
|
|
108
|
+
prefix: p,
|
|
109
|
+
withCredentials: v,
|
|
100
110
|
csrf: ae,
|
|
101
|
-
fetcher:
|
|
111
|
+
fetcher: y,
|
|
102
112
|
getToken: () => e
|
|
103
113
|
});
|
|
104
114
|
}
|
|
105
115
|
function W() {
|
|
106
|
-
P += 1,
|
|
116
|
+
P += 1, q = o(G);
|
|
107
117
|
}
|
|
108
118
|
async function G() {
|
|
109
119
|
let e = N(), t = P;
|
|
110
120
|
z.add(t);
|
|
121
|
+
let n;
|
|
111
122
|
try {
|
|
112
|
-
await
|
|
123
|
+
n = await K(() => pe(e));
|
|
113
124
|
} finally {
|
|
114
125
|
z.delete(t);
|
|
115
126
|
}
|
|
127
|
+
n && await J(Y(n));
|
|
116
128
|
}
|
|
117
|
-
async function
|
|
118
|
-
let t =
|
|
129
|
+
async function K(e) {
|
|
130
|
+
let t = _ === "local" && typeof navigator < "u" ? navigator.locks : void 0;
|
|
119
131
|
if (!t) return e();
|
|
120
|
-
let n = new AbortController(), r = setTimeout(() => n.abort(),
|
|
132
|
+
let n = new AbortController(), r = setTimeout(() => n.abort(), c), i = !1, a;
|
|
121
133
|
try {
|
|
122
|
-
await t.request(
|
|
123
|
-
i = !0, clearTimeout(r), await e();
|
|
134
|
+
await t.request(le, { signal: n.signal }, async () => {
|
|
135
|
+
i = !0, clearTimeout(r), a = await e();
|
|
124
136
|
});
|
|
125
137
|
} catch (t) {
|
|
126
138
|
if (i) throw t;
|
|
127
|
-
clearTimeout(r),
|
|
139
|
+
return clearTimeout(r), e();
|
|
128
140
|
}
|
|
141
|
+
return a;
|
|
129
142
|
}
|
|
130
143
|
async function pe(e) {
|
|
131
144
|
let n = e !== null || M().user !== null || D !== null, r = Z();
|
|
132
|
-
if (!n && N() !== null) return;
|
|
145
|
+
if (!n && N() !== null) return null;
|
|
133
146
|
if (!r.continues) throw new t();
|
|
134
|
-
if (N() !== e) return;
|
|
147
|
+
if (N() !== e) return null;
|
|
135
148
|
let i = P, a;
|
|
136
149
|
try {
|
|
137
|
-
a = await B(Q.post(
|
|
138
|
-
body:
|
|
150
|
+
a = await B(Q.post(m, {
|
|
151
|
+
body: x(E()),
|
|
139
152
|
skipAuth: !0
|
|
140
153
|
}));
|
|
141
154
|
} catch (e) {
|
|
142
155
|
throw P === i ? e : new t();
|
|
143
156
|
}
|
|
144
|
-
let { token: o, refreshToken: s } =
|
|
157
|
+
let { token: o, refreshToken: s } = b(a);
|
|
145
158
|
if (P !== i || !Z().continues) throw H(o ?? null, s), new t();
|
|
146
|
-
|
|
159
|
+
let c = f(e), l = f(o);
|
|
160
|
+
return c !== null && l !== null && c !== l ? {
|
|
161
|
+
data: a,
|
|
162
|
+
token: o,
|
|
163
|
+
refreshToken: s
|
|
164
|
+
} : (n || j(u()), M().setToken(o), s && O(s), null);
|
|
147
165
|
}
|
|
148
|
-
let
|
|
149
|
-
function
|
|
166
|
+
let q = o(G);
|
|
167
|
+
function me(e) {
|
|
150
168
|
let t = N();
|
|
151
169
|
return t === null ? !1 : e.token === null || e.token !== t;
|
|
152
170
|
}
|
|
153
|
-
function
|
|
171
|
+
function he() {
|
|
154
172
|
return N() === null && E() === null;
|
|
155
173
|
}
|
|
156
|
-
async function
|
|
174
|
+
async function ge() {
|
|
157
175
|
if (!(I.size > 0 && F === 0 && (await Promise.allSettled([...I]), N() !== null))) throw Error("anonymous 401 with no session");
|
|
158
176
|
}
|
|
159
|
-
async function
|
|
177
|
+
async function _e(e) {
|
|
160
178
|
if (e.epoch !== null && e.epoch !== P) throw new t();
|
|
161
|
-
if (
|
|
179
|
+
if (me(e)) {
|
|
162
180
|
if (e.token === null) throw Error("anonymous 401 under a live session");
|
|
163
|
-
|
|
181
|
+
return;
|
|
182
|
+
}
|
|
183
|
+
if (e.token === null && he()) return z.has(P) ? q() : ge();
|
|
184
|
+
let n = P;
|
|
185
|
+
if (await q(), P !== n) throw new t();
|
|
164
186
|
}
|
|
165
|
-
async function
|
|
187
|
+
async function ve(e, n) {
|
|
166
188
|
if (n.epoch !== null && n.epoch !== P || !Z().continues) throw new t();
|
|
167
|
-
|
|
189
|
+
me(n) || n.token === null && he() || await De();
|
|
168
190
|
}
|
|
169
|
-
async function
|
|
170
|
-
L.size > 0 && await
|
|
171
|
-
|
|
172
|
-
|
|
191
|
+
async function ye(e) {
|
|
192
|
+
return L.size > 0 && await l([...L], s), J(Se(e));
|
|
193
|
+
}
|
|
194
|
+
async function be() {
|
|
195
|
+
return L.size > 0 && await l([...L], s), J(xe());
|
|
196
|
+
}
|
|
197
|
+
async function J(e) {
|
|
198
|
+
I.add(e);
|
|
173
199
|
try {
|
|
174
|
-
return await
|
|
200
|
+
return await e;
|
|
175
201
|
} finally {
|
|
176
|
-
I.delete(
|
|
202
|
+
I.delete(e);
|
|
177
203
|
}
|
|
178
204
|
}
|
|
179
|
-
async function
|
|
205
|
+
async function xe() {
|
|
206
|
+
let e = P, n = await K(() => B(Q.post(m, {
|
|
207
|
+
body: x(E()),
|
|
208
|
+
skipAuth: !0
|
|
209
|
+
}))), { token: r, refreshToken: i } = b(n);
|
|
210
|
+
if (P !== e) throw H(r ?? null, i), new t();
|
|
211
|
+
return Y({
|
|
212
|
+
data: n,
|
|
213
|
+
token: r,
|
|
214
|
+
refreshToken: i
|
|
215
|
+
});
|
|
216
|
+
}
|
|
217
|
+
async function Se(e) {
|
|
180
218
|
let n = P, r = await B(Q.post(ne, {
|
|
181
219
|
body: e,
|
|
182
220
|
skipAuth: !0
|
|
183
|
-
})), { token: i, refreshToken: a } =
|
|
221
|
+
})), { token: i, refreshToken: a } = b(r);
|
|
184
222
|
if (P !== n) throw H(i ?? null, a), new t();
|
|
185
|
-
H(N(), E() ?? void 0)
|
|
186
|
-
|
|
187
|
-
|
|
188
|
-
|
|
189
|
-
|
|
190
|
-
|
|
191
|
-
|
|
192
|
-
|
|
223
|
+
return H(N(), E() ?? void 0), Y({
|
|
224
|
+
data: r,
|
|
225
|
+
token: i,
|
|
226
|
+
refreshToken: a
|
|
227
|
+
});
|
|
228
|
+
}
|
|
229
|
+
async function Y(e) {
|
|
230
|
+
let { done: n } = X("switch"), r = P;
|
|
231
|
+
if (await n.catch(() => void 0), P !== r) throw new t();
|
|
232
|
+
j(u()), M().setToken(e.token), O(e.refreshToken ?? null);
|
|
233
|
+
let i = oe?.(e.data);
|
|
234
|
+
return i == null ? ue() : (M().setUser(i), i);
|
|
235
|
+
}
|
|
236
|
+
function X(e) {
|
|
193
237
|
let { user: t, token: n } = M(), r = n !== null || t !== null || E() !== null;
|
|
194
238
|
return (r || e !== "expired") && W(), M().logout(), O(null), j(null), r ? {
|
|
195
239
|
live: r,
|
|
196
|
-
done:
|
|
240
|
+
done: Ce({
|
|
197
241
|
reason: e,
|
|
198
242
|
user: t,
|
|
199
243
|
token: n,
|
|
@@ -201,16 +245,16 @@ function d(u) {
|
|
|
201
245
|
})
|
|
202
246
|
} : {
|
|
203
247
|
live: r,
|
|
204
|
-
done: e === "switch" || F === 0 ?
|
|
248
|
+
done: e === "switch" || F === 0 ? de : Promise.resolve()
|
|
205
249
|
};
|
|
206
250
|
}
|
|
207
|
-
function
|
|
208
|
-
if (!
|
|
251
|
+
function Ce(e) {
|
|
252
|
+
if (!ce) return Promise.resolve();
|
|
209
253
|
let t = U(e.token);
|
|
210
254
|
F += 1;
|
|
211
255
|
let n = (async () => {
|
|
212
256
|
try {
|
|
213
|
-
await
|
|
257
|
+
await ce({
|
|
214
258
|
...e,
|
|
215
259
|
api: t
|
|
216
260
|
});
|
|
@@ -218,12 +262,12 @@ function d(u) {
|
|
|
218
262
|
--F;
|
|
219
263
|
}
|
|
220
264
|
})();
|
|
221
|
-
return
|
|
265
|
+
return de = n.then(() => void 0, () => void 0), n.then(() => void 0);
|
|
222
266
|
}
|
|
223
|
-
function
|
|
267
|
+
function we() {
|
|
224
268
|
let e = T();
|
|
225
269
|
if (!e) return null;
|
|
226
|
-
let t = e.getItem(w), n = e.getItem(k), r = e.getItem(
|
|
270
|
+
let t = e.getItem(w), n = e.getItem(k), r = e.getItem(g);
|
|
227
271
|
if (!r) return {
|
|
228
272
|
user: null,
|
|
229
273
|
token: null,
|
|
@@ -248,7 +292,7 @@ function d(u) {
|
|
|
248
292
|
}
|
|
249
293
|
}
|
|
250
294
|
function Z() {
|
|
251
|
-
let e =
|
|
295
|
+
let e = we(), { user: t, token: n } = M();
|
|
252
296
|
if (e === null) return {
|
|
253
297
|
continues: !0,
|
|
254
298
|
done: Promise.resolve()
|
|
@@ -267,7 +311,7 @@ function d(u) {
|
|
|
267
311
|
continues: a,
|
|
268
312
|
done: Promise.resolve()
|
|
269
313
|
};
|
|
270
|
-
let s =
|
|
314
|
+
let s = Ce({
|
|
271
315
|
reason: e.token === null ? "logout" : "switch",
|
|
272
316
|
user: t,
|
|
273
317
|
token: n,
|
|
@@ -278,58 +322,59 @@ function d(u) {
|
|
|
278
322
|
done: s
|
|
279
323
|
};
|
|
280
324
|
}
|
|
281
|
-
function
|
|
282
|
-
if (!
|
|
283
|
-
let e =
|
|
284
|
-
if (!
|
|
285
|
-
let i =
|
|
286
|
-
return V(async () => (await
|
|
325
|
+
function Te() {
|
|
326
|
+
if (!h) return null;
|
|
327
|
+
let e = h, { token: t, user: n } = M(), r = E();
|
|
328
|
+
if (!v && t === null && n === null && r === null) return null;
|
|
329
|
+
let i = v ? [...R] : [];
|
|
330
|
+
return V(async () => (await l(i, s), U(t).post(e, { body: x(r) })));
|
|
287
331
|
}
|
|
288
|
-
function
|
|
332
|
+
function Ee() {
|
|
289
333
|
let e = Z();
|
|
290
334
|
if (!e.continues) return e.done;
|
|
291
|
-
let t =
|
|
335
|
+
let t = Te(), { done: n } = X("logout");
|
|
292
336
|
return t ? Promise.all([t, n]).then(() => void 0) : n;
|
|
293
337
|
}
|
|
294
|
-
async function
|
|
295
|
-
let { live: e, done: t } =
|
|
296
|
-
await t.catch(() => void 0), e &&
|
|
338
|
+
async function De() {
|
|
339
|
+
let { live: e, done: t } = X("expired");
|
|
340
|
+
await t.catch(() => void 0), e && S && typeof window < "u" && window.location.assign(S);
|
|
297
341
|
}
|
|
298
342
|
let Q = n({
|
|
299
343
|
baseURL: d,
|
|
300
|
-
prefix:
|
|
301
|
-
withCredentials:
|
|
344
|
+
prefix: p,
|
|
345
|
+
withCredentials: v,
|
|
302
346
|
csrf: ae,
|
|
303
|
-
fetcher:
|
|
347
|
+
fetcher: y,
|
|
304
348
|
getToken: N,
|
|
305
349
|
getSessionEpoch: () => P,
|
|
306
|
-
refresh:
|
|
350
|
+
refresh: _e,
|
|
307
351
|
retry: se,
|
|
308
|
-
onUnauthorized:
|
|
309
|
-
}),
|
|
352
|
+
onUnauthorized: ve
|
|
353
|
+
}), Oe = () => q(), $ = null, ke = () => N() === null ? null : A === null ? ($?.epoch !== P && ($ = {
|
|
310
354
|
epoch: P,
|
|
311
|
-
key:
|
|
312
|
-
}), $.key) : A,
|
|
313
|
-
current:
|
|
355
|
+
key: u()
|
|
356
|
+
}), $.key) : A, Ae = {
|
|
357
|
+
current: ke,
|
|
314
358
|
subscribe: (e) => C.subscribe(e)
|
|
315
359
|
};
|
|
316
|
-
r(Q,
|
|
317
|
-
function
|
|
318
|
-
e.storageArea === T() && (e.key === null || e.key ===
|
|
360
|
+
r(Q, Ae), r(N, Ae);
|
|
361
|
+
function je(e) {
|
|
362
|
+
e.storageArea === T() && (e.key === null || e.key === g || e.key === w || e.key === k) && Z();
|
|
319
363
|
}
|
|
320
|
-
let
|
|
321
|
-
return
|
|
364
|
+
let Me = typeof window > "u" ? null : window;
|
|
365
|
+
return Me?.addEventListener("storage", je), {
|
|
322
366
|
useAuthStore: C,
|
|
323
367
|
api: Q,
|
|
324
|
-
login:
|
|
325
|
-
logout:
|
|
326
|
-
refresh:
|
|
368
|
+
login: ye,
|
|
369
|
+
logout: Ee,
|
|
370
|
+
refresh: Oe,
|
|
371
|
+
restore: be,
|
|
327
372
|
getToken: N,
|
|
328
|
-
sessionKey:
|
|
329
|
-
dispose: () =>
|
|
373
|
+
sessionKey: ke,
|
|
374
|
+
dispose: () => Me?.removeEventListener("storage", je)
|
|
330
375
|
};
|
|
331
376
|
}
|
|
332
377
|
//#endregion
|
|
333
|
-
export {
|
|
378
|
+
export { p as createTempestAuth };
|
|
334
379
|
|
|
335
380
|
//# sourceMappingURL=create-tempest-auth.js.map
|