@nivaro/react 0.3.8 → 0.3.9
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/full.css +1 -1
- package/dist/hooks/replayUploadQueue.js +107 -93
- package/dist/hooks/useSessionRecorder.js +103 -101
- package/dist/index.d.ts +46 -1
- package/dist/index.js +300 -292
- package/dist/shared/components/CollectionBrowserView.js +318 -318
- package/dist/shared/components/DataTable.js +230 -223
- package/dist/shared/components/QueryTable.js +49 -49
- package/dist/shared/components/chat/ChatPanel.js +288 -287
- package/dist/shared/components/panels/CommentPanel.js +237 -236
- package/dist/shared/components/profile/usePersonPresence.js +42 -37
- package/dist/shared/lib/presence-live.js +54 -0
- package/dist/shared/lib/presence-state.js +39 -31
- package/dist/shared/lib/request-gate.js +120 -102
- package/dist/shared/lib/rum.js +45 -36
- package/dist/shared/lib/signed-out.js +114 -0
- package/dist/shared/lib/socket-realtime.js +19 -17
- package/dist/shared/lib/use-online-users.js +11 -10
- package/dist/shared/lib/worker-socket.js +89 -79
- package/package.json +1 -1
|
@@ -1,53 +1,52 @@
|
|
|
1
1
|
import { endSessionRecording as $, appendSessionRecordingEvents as X, sessionRecordingEnabled as ce, startSessionRecording as T } from "@nivaro/sdk";
|
|
2
2
|
import { useRef as de, useEffect as fe } from "react";
|
|
3
|
-
import { sessionStore as pe, sharedChunkStore as
|
|
4
|
-
import { useAutoRecord as
|
|
5
|
-
import { useOptionalNivaroClient as
|
|
3
|
+
import { sessionStore as pe, sharedChunkStore as he, ReplayUploader as me, clearResume as P, ORPHAN_TTL_MS as we, readResume as ge, isResumable as ve, splitBySize as Z, writeResume as ye, KEEPALIVE_CHUNK_BYTES as be, CHUNK_BYTES as Re, backoffDelay as Se, errorStatus as ke, clipChunkFailure as Ee } from "./replayUploadQueue.js";
|
|
4
|
+
import { useAutoRecord as Ae } from "./useAutoRecord.js";
|
|
5
|
+
import { useOptionalNivaroClient as Ce } from "../shared/context.js";
|
|
6
6
|
import { normalizeReplayMasking as B, buildReplayMaskingOptions as z } from "../shared/lib/replay-masking.js";
|
|
7
|
-
import { normalizeReplaySampling as x, replaySampleDraw as
|
|
8
|
-
import { emitReplayTap as
|
|
9
|
-
import { instrumentConsole as
|
|
10
|
-
import { instrumentSocket as
|
|
11
|
-
const
|
|
12
|
-
function
|
|
7
|
+
import { normalizeReplaySampling as x, replaySampleDraw as Ie, currentReplayRoute as _, isReplayRouteSampled as Y, attributeChunkRoutes as ee } from "../shared/lib/replay-sampling.js";
|
|
8
|
+
import { emitReplayTap as _e, setReplayRecorderMode as N, registerReplayCapture as De, clipEndOffset as qe, withClipKind as Le } from "../shared/lib/replay-capture.js";
|
|
9
|
+
import { instrumentConsole as Te, instrumentRequests as Pe, redactSecrets as Ne } from "../shared/lib/replay-context.js";
|
|
10
|
+
import { instrumentSocket as Me } from "../shared/lib/replay-socket.js";
|
|
11
|
+
const Oe = "nivaro-react@0.3.9", j = 1e4, Ue = 150, We = 3e3, Fe = 600, He = (n) => `nvr_replay_resume${n ? `:${n}` : ""}`, G = () => typeof navigator > "u" || navigator.onLine !== !1;
|
|
12
|
+
function Ke(n) {
|
|
13
13
|
return typeof n.url != "string" || typeof fetch != "function" ? null : (f, a) => {
|
|
14
|
-
const
|
|
15
|
-
return
|
|
14
|
+
const u = typeof n.getToken == "function" ? n.getToken() : void 0, d = { "Content-Type": "application/json" };
|
|
15
|
+
return u && (d.Authorization = `Bearer ${u}`), fetch(`${n.url}/api/session-recordings/${f}/events`, {
|
|
16
16
|
method: "POST",
|
|
17
17
|
keepalive: !0,
|
|
18
|
-
credentials:
|
|
18
|
+
credentials: u ? "omit" : "include",
|
|
19
19
|
headers: d,
|
|
20
20
|
body: a
|
|
21
21
|
});
|
|
22
22
|
};
|
|
23
23
|
}
|
|
24
|
-
async function
|
|
25
|
-
|
|
26
|
-
const c
|
|
27
|
-
|
|
28
|
-
const h = a();
|
|
24
|
+
async function $e(n, f, a, u, d) {
|
|
25
|
+
const l = Z(u), { routes: b } = ee(l, d.startRoute);
|
|
26
|
+
for (const [c, e] of l.entries()) {
|
|
27
|
+
const g = a();
|
|
29
28
|
try {
|
|
30
29
|
await n.request(
|
|
31
|
-
X(f,
|
|
32
|
-
route:
|
|
30
|
+
X(f, g, e, {
|
|
31
|
+
route: b[c],
|
|
33
32
|
...d.build ? { build: d.build } : {}
|
|
34
33
|
})
|
|
35
34
|
);
|
|
36
35
|
} catch (v) {
|
|
37
|
-
const
|
|
38
|
-
if (
|
|
39
|
-
|
|
36
|
+
const y = ke(v);
|
|
37
|
+
if (Ee(y) === "stop") return "closed";
|
|
38
|
+
y === 413 && console.warn(`[session-recorder] chunk ${g} too large — dropped`);
|
|
40
39
|
}
|
|
41
40
|
}
|
|
42
41
|
return "ok";
|
|
43
42
|
}
|
|
44
|
-
const
|
|
45
|
-
let J = !1,
|
|
46
|
-
async function
|
|
47
|
-
if (!
|
|
43
|
+
const Be = 3e4, ze = 3e4;
|
|
44
|
+
let J = !1, w = null, S = null;
|
|
45
|
+
async function xe(n = "error") {
|
|
46
|
+
if (!S) return null;
|
|
48
47
|
try {
|
|
49
48
|
return await Promise.race([
|
|
50
|
-
|
|
49
|
+
S(n),
|
|
51
50
|
new Promise((f) => setTimeout(() => f(null), 4e3))
|
|
52
51
|
]);
|
|
53
52
|
} catch {
|
|
@@ -64,27 +63,27 @@ async function Q() {
|
|
|
64
63
|
}
|
|
65
64
|
}
|
|
66
65
|
function V(n, f) {
|
|
67
|
-
const a =
|
|
66
|
+
const a = Te(n), u = Pe(n), d = Me(n), l = () => {
|
|
68
67
|
f == null || f();
|
|
69
68
|
try {
|
|
70
69
|
n("route", {
|
|
71
|
-
path:
|
|
70
|
+
path: Ne(window.location.pathname + window.location.search)
|
|
72
71
|
});
|
|
73
72
|
} catch {
|
|
74
73
|
}
|
|
75
|
-
},
|
|
74
|
+
}, b = history.pushState.bind(history), c = history.replaceState.bind(history);
|
|
76
75
|
return history.pushState = (...e) => {
|
|
77
|
-
|
|
76
|
+
b(...e), l();
|
|
78
77
|
}, history.replaceState = (...e) => {
|
|
79
|
-
|
|
80
|
-
}, window.addEventListener("popstate",
|
|
81
|
-
a(),
|
|
78
|
+
c(...e), l();
|
|
79
|
+
}, window.addEventListener("popstate", l), l(), () => {
|
|
80
|
+
a(), u(), d(), history.pushState = b, history.replaceState = c, window.removeEventListener("popstate", l);
|
|
82
81
|
};
|
|
83
82
|
}
|
|
84
|
-
function
|
|
85
|
-
const f =
|
|
86
|
-
|
|
87
|
-
const
|
|
83
|
+
function nt(n = {}) {
|
|
84
|
+
const f = Ce(), a = n.client ?? f, u = n.app, d = n.disabled ?? !1, l = n.build ?? Oe;
|
|
85
|
+
Ae({ client: a, disabled: d });
|
|
86
|
+
const b = de({
|
|
88
87
|
buffer: [],
|
|
89
88
|
stop: null,
|
|
90
89
|
uninstrument: null,
|
|
@@ -102,21 +101,21 @@ function et(n = {}) {
|
|
|
102
101
|
});
|
|
103
102
|
fe(() => {
|
|
104
103
|
if (!a || d || typeof window > "u") return;
|
|
105
|
-
let
|
|
106
|
-
const e =
|
|
104
|
+
let c = !1;
|
|
105
|
+
const e = b.current;
|
|
107
106
|
e.dead = !1;
|
|
108
|
-
const
|
|
109
|
-
if (!
|
|
110
|
-
await
|
|
107
|
+
const g = a, v = pe(), y = He(u), k = he(), E = Ke(g), te = async (t, r, i, h, s = {}) => {
|
|
108
|
+
if (!h || !E) {
|
|
109
|
+
await g.request(X(t, r, i, s));
|
|
111
110
|
return;
|
|
112
111
|
}
|
|
113
112
|
const p = await E(t, JSON.stringify({ seq: r, events: i, ...s }));
|
|
114
113
|
if (!p.ok) throw Object.assign(new Error(`HTTP ${p.status}`), { status: p.status });
|
|
115
|
-
}, o = new
|
|
116
|
-
let
|
|
117
|
-
const re = () => document.readyState === "complete" && Date.now() - e.lastNavAt >=
|
|
114
|
+
}, o = new me({ store: k, send: te, online: G });
|
|
115
|
+
let R = null, A = 0;
|
|
116
|
+
const re = () => document.readyState === "complete" && Date.now() - e.lastNavAt >= We;
|
|
118
117
|
function C() {
|
|
119
|
-
o.recordingId && ye(
|
|
118
|
+
o.recordingId && ye(v, y, {
|
|
120
119
|
recordingId: o.recordingId,
|
|
121
120
|
nextSeq: o.nextSeq,
|
|
122
121
|
startedAt: e.startedAt,
|
|
@@ -124,71 +123,71 @@ function et(n = {}) {
|
|
|
124
123
|
});
|
|
125
124
|
}
|
|
126
125
|
function I() {
|
|
127
|
-
|
|
126
|
+
R && clearTimeout(R), R = null, A = 0;
|
|
128
127
|
}
|
|
129
128
|
function ne() {
|
|
130
129
|
I();
|
|
131
130
|
const t = Se(o.attempt);
|
|
132
|
-
A = Date.now() + t,
|
|
133
|
-
|
|
131
|
+
A = Date.now() + t, R = setTimeout(() => {
|
|
132
|
+
R = null, A = 0, m(!0);
|
|
134
133
|
}, t);
|
|
135
134
|
}
|
|
136
135
|
function M() {
|
|
137
136
|
var t;
|
|
138
|
-
e.dead = !0, (t = e.stop) == null || t.call(e), I(), o.discard(), P(
|
|
137
|
+
e.dead = !0, (t = e.stop) == null || t.call(e), e.stop = null, e.buffer = [], I(), o.discard(), o.stopped = !0, P(v, y);
|
|
139
138
|
}
|
|
140
139
|
function O(t) {
|
|
141
140
|
if (e.buffer.length === 0 || !o.recordingId) return;
|
|
142
141
|
const r = e.buffer;
|
|
143
142
|
e.buffer = [];
|
|
144
|
-
const i = Z(r, t ? be : Re), { routes:
|
|
143
|
+
const i = Z(r, t ? be : Re), { routes: h } = ee(i, e.bufferRoute);
|
|
145
144
|
for (const [s, p] of i.entries())
|
|
146
|
-
o.enqueue(p, { route:
|
|
145
|
+
o.enqueue(p, { route: h[s], ...l ? { build: l } : {} });
|
|
147
146
|
C();
|
|
148
147
|
}
|
|
149
148
|
async function oe(t) {
|
|
150
|
-
if (!
|
|
149
|
+
if (!c) {
|
|
151
150
|
if (t === "retry") ne();
|
|
152
151
|
else if (t === "closed" || t === "abandoned") M();
|
|
153
152
|
else if (t === "stale")
|
|
154
153
|
try {
|
|
155
|
-
const r = await
|
|
156
|
-
if (
|
|
154
|
+
const r = await g.request(T(u));
|
|
155
|
+
if (c) return;
|
|
157
156
|
o.rebase(r.data.id), e.startedAt = Date.now(), C(), e.flushAfter = !0;
|
|
158
157
|
} catch {
|
|
159
158
|
M();
|
|
160
159
|
}
|
|
161
160
|
}
|
|
162
161
|
}
|
|
163
|
-
function
|
|
164
|
-
return e.inFlight ? (t && (e.flushAfter = !0), e.inFlight) : e.dead || !o.recordingId || !t && !re() && e.buffer.length <
|
|
162
|
+
function m(t = !1, r = !1) {
|
|
163
|
+
return e.inFlight ? (t && (e.flushAfter = !0), e.inFlight) : e.dead || !o.recordingId || !t && !re() && e.buffer.length < Fe || (O(r), !o.hasPending() || Date.now() < A) ? Promise.resolve() : (e.inFlight = o.drain(r).then(oe).catch(() => {
|
|
165
164
|
}).finally(() => {
|
|
166
|
-
e.inFlight = null, e.flushAfter && (e.flushAfter = !1,
|
|
165
|
+
e.inFlight = null, e.flushAfter && (e.flushAfter = !1, m(!0));
|
|
167
166
|
}), e.inFlight);
|
|
168
167
|
}
|
|
169
168
|
function U() {
|
|
170
169
|
const t = window.requestIdleCallback;
|
|
171
|
-
t ? t(() => void
|
|
170
|
+
t ? t(() => void m(), { timeout: j }) : m();
|
|
172
171
|
}
|
|
173
172
|
async function ie() {
|
|
174
173
|
const t = await Q();
|
|
175
|
-
if (
|
|
176
|
-
|
|
177
|
-
const r = ge(
|
|
174
|
+
if (c || !t) return;
|
|
175
|
+
k.prune(Date.now() - we);
|
|
176
|
+
const r = ge(v, y);
|
|
178
177
|
if (r && ve(r, Date.now())) {
|
|
179
|
-
const s = await
|
|
180
|
-
if (
|
|
178
|
+
const s = await k.list(r.recordingId);
|
|
179
|
+
if (c) return;
|
|
181
180
|
o.begin(r.recordingId, r.nextSeq, { trusted: !1, restored: s }), e.startedAt = r.startedAt;
|
|
182
181
|
} else {
|
|
183
|
-
r && (
|
|
184
|
-
const s = await
|
|
185
|
-
if (
|
|
182
|
+
r && (k.clear(r.recordingId), P(v, y));
|
|
183
|
+
const s = await g.request(T(u));
|
|
184
|
+
if (c) return;
|
|
186
185
|
o.begin(s.data.id), e.startedAt = Date.now();
|
|
187
186
|
}
|
|
188
187
|
C(), e.lastNavAt = Date.now();
|
|
189
|
-
const i =
|
|
188
|
+
const i = Ie(v);
|
|
190
189
|
e.route = _(), e.bufferRoute = e.route, e.sampled = Y(q, e.route, i);
|
|
191
|
-
const
|
|
190
|
+
const h = () => {
|
|
192
191
|
var p;
|
|
193
192
|
e.route = _();
|
|
194
193
|
const s = e.sampled;
|
|
@@ -203,7 +202,7 @@ function et(n = {}) {
|
|
|
203
202
|
};
|
|
204
203
|
e.stop = t({
|
|
205
204
|
emit(s) {
|
|
206
|
-
e.sampled && (e.buffer.length === 0 && (e.bufferRoute = e.route), e.buffer.push(s), e.buffer.length >=
|
|
205
|
+
e.sampled && (e.buffer.length === 0 && (e.bufferRoute = e.route), e.buffer.push(s), e.buffer.length >= Ue && U());
|
|
207
206
|
},
|
|
208
207
|
...z(() => D),
|
|
209
208
|
checkoutEveryNms: 6e4
|
|
@@ -213,28 +212,28 @@ function et(n = {}) {
|
|
|
213
212
|
p
|
|
214
213
|
),
|
|
215
214
|
() => {
|
|
216
|
-
e.lastNavAt = Date.now(),
|
|
215
|
+
e.lastNavAt = Date.now(), h();
|
|
217
216
|
}
|
|
218
|
-
),
|
|
217
|
+
), S = async () => {
|
|
219
218
|
if (!o.recordingId) return null;
|
|
220
219
|
const s = Date.now() - e.startedAt;
|
|
221
|
-
return await
|
|
220
|
+
return await m(!0).catch(() => {
|
|
222
221
|
}), o.recordingId ? { recording_id: o.recordingId, offset_ms: s } : null;
|
|
223
|
-
}, N("full"),
|
|
222
|
+
}, N("full"), w = () => {
|
|
224
223
|
if (!o.recordingId) return null;
|
|
225
224
|
const s = Date.now() - e.startedAt;
|
|
226
|
-
return async () => (await
|
|
225
|
+
return async () => (await m(!0).catch(() => {
|
|
227
226
|
}), o.recordingId ? { recording_id: o.recordingId, offset_ms: s } : null);
|
|
228
227
|
};
|
|
229
228
|
}
|
|
230
229
|
async function se() {
|
|
231
230
|
const t = await Q();
|
|
232
|
-
|
|
231
|
+
c || !t || (e.buffer = [], e.prevWindow = [], e.route = _(), e.bufferRoute = e.route, e.prevWindowRoute = e.route, e.stop = t({
|
|
233
232
|
emit(r, i) {
|
|
234
|
-
|
|
233
|
+
_e(r), i ? (e.prevWindow = e.buffer, e.prevWindowRoute = e.bufferRoute, e.buffer = [r], e.bufferRoute = e.route) : e.buffer.push(r);
|
|
235
234
|
},
|
|
236
235
|
...z(() => D),
|
|
237
|
-
checkoutEveryNms:
|
|
236
|
+
checkoutEveryNms: Be
|
|
238
237
|
}) ?? null, e.uninstrument = V(
|
|
239
238
|
(r, i) => t.addCustomEvent(
|
|
240
239
|
r,
|
|
@@ -243,35 +242,38 @@ function et(n = {}) {
|
|
|
243
242
|
() => {
|
|
244
243
|
e.route = _();
|
|
245
244
|
}
|
|
246
|
-
), N("clip"),
|
|
247
|
-
const i = [...e.prevWindow, ...e.buffer],
|
|
245
|
+
), N("clip"), w = (r) => {
|
|
246
|
+
const i = [...e.prevWindow, ...e.buffer], h = e.prevWindow.length > 0 ? e.prevWindowRoute : e.bufferRoute;
|
|
248
247
|
if (i.length === 0 || !a) return null;
|
|
249
|
-
const s =
|
|
248
|
+
const s = qe(i, r);
|
|
250
249
|
return async () => {
|
|
251
250
|
const L = (await a.request(
|
|
252
|
-
|
|
251
|
+
Le(T(u ?? "error-clip", void 0, !0), r)
|
|
253
252
|
)).data.id;
|
|
254
253
|
let le = 0;
|
|
255
|
-
return await
|
|
254
|
+
return await $e(a, L, () => le++, i, {
|
|
255
|
+
startRoute: h,
|
|
256
|
+
build: l
|
|
257
|
+
}) === "ok" && await a.request($(L)).catch(() => {
|
|
256
258
|
}), { recording_id: L, offset_ms: s };
|
|
257
259
|
};
|
|
258
|
-
},
|
|
260
|
+
}, S = async (r) => {
|
|
259
261
|
if (r === "error") {
|
|
260
|
-
if (e.lastClip && Date.now() - e.lastClip.at <
|
|
262
|
+
if (e.lastClip && Date.now() - e.lastClip.at < ze)
|
|
261
263
|
return e.lastClip.link;
|
|
262
264
|
e.lastClip = { at: Date.now(), link: null };
|
|
263
265
|
}
|
|
264
|
-
const i =
|
|
266
|
+
const i = w == null ? void 0 : w(r);
|
|
265
267
|
if (!i) return null;
|
|
266
|
-
const
|
|
267
|
-
return r === "error" && (e.lastClip = { at: Date.now(), link:
|
|
268
|
+
const h = await i();
|
|
269
|
+
return r === "error" && (e.lastClip = { at: Date.now(), link: h }), h;
|
|
268
270
|
});
|
|
269
271
|
}
|
|
270
272
|
let W = !1, D = B(null), q = x(null);
|
|
271
273
|
async function ae() {
|
|
272
274
|
try {
|
|
273
275
|
const t = await a.request(ce());
|
|
274
|
-
if (
|
|
276
|
+
if (c) return;
|
|
275
277
|
D = B(t.data.masking), q = x(t.data.sampling);
|
|
276
278
|
const r = t.data.cap_reached === !0;
|
|
277
279
|
W = t.data.enabled === !0 && !r;
|
|
@@ -282,7 +284,7 @@ function et(n = {}) {
|
|
|
282
284
|
}
|
|
283
285
|
ae();
|
|
284
286
|
const ue = setInterval(U, j), F = () => {
|
|
285
|
-
document.visibilityState === "hidden" &&
|
|
287
|
+
document.visibilityState === "hidden" && m(!0, !0);
|
|
286
288
|
};
|
|
287
289
|
document.addEventListener("visibilitychange", F);
|
|
288
290
|
const H = () => {
|
|
@@ -296,23 +298,23 @@ function et(n = {}) {
|
|
|
296
298
|
};
|
|
297
299
|
window.addEventListener("pagehide", H);
|
|
298
300
|
const K = () => {
|
|
299
|
-
I(),
|
|
301
|
+
I(), m(!0);
|
|
300
302
|
};
|
|
301
303
|
return window.addEventListener("online", K), () => {
|
|
302
304
|
var t, r;
|
|
303
|
-
|
|
305
|
+
c = !0, S = null, w = null, N(null), document.removeEventListener("visibilitychange", F), window.removeEventListener("pagehide", H), window.removeEventListener("online", K), clearInterval(ue), I(), (t = e.uninstrument) == null || t.call(e), e.uninstrument = null, (r = e.stop) == null || r.call(e), e.stop = null, e.prevWindow = [], m(!0).then(() => {
|
|
304
306
|
const i = o.recordingId;
|
|
305
|
-
i && (e.dead ||
|
|
306
|
-
}), o.discard(), o.recordingId = null, P(
|
|
307
|
+
i && (e.dead || g.request($(i)).catch(() => {
|
|
308
|
+
}), o.discard(), o.recordingId = null, P(v, y));
|
|
307
309
|
});
|
|
308
310
|
};
|
|
309
|
-
}, [a, d,
|
|
311
|
+
}, [a, d, u, l]);
|
|
310
312
|
}
|
|
311
|
-
|
|
312
|
-
(n) =>
|
|
313
|
-
(n) => (
|
|
313
|
+
De(
|
|
314
|
+
(n) => xe(n),
|
|
315
|
+
(n) => (w == null ? void 0 : w(n)) ?? null
|
|
314
316
|
);
|
|
315
317
|
export {
|
|
316
|
-
|
|
317
|
-
|
|
318
|
+
xe as captureErrorClip,
|
|
319
|
+
nt as useSessionRecorder
|
|
318
320
|
};
|
package/dist/index.d.ts
CHANGED
|
@@ -3400,6 +3400,12 @@ declare interface GridSumCapConfig {
|
|
|
3400
3400
|
message?: string;
|
|
3401
3401
|
}
|
|
3402
3402
|
|
|
3403
|
+
/**
|
|
3404
|
+
* Run one identity call through the gate: `blocked()` answers without a request while the tab
|
|
3405
|
+
* is signed out (outside its probe window); a success opens the gate, a signed-out 401 closes it.
|
|
3406
|
+
*/
|
|
3407
|
+
export declare function guardIdentityCall<T>(call: () => Promise<T>, blocked: () => T | Promise<T>): Promise<T>;
|
|
3408
|
+
|
|
3403
3409
|
declare type GuardRule = {
|
|
3404
3410
|
field: string;
|
|
3405
3411
|
op: string;
|
|
@@ -4797,6 +4803,16 @@ export declare function isChatPanelPinned(): boolean;
|
|
|
4797
4803
|
|
|
4798
4804
|
export declare function isCleanRecording(): boolean;
|
|
4799
4805
|
|
|
4806
|
+
/** True once a 401 said this tab is signed out, until a sign-in is heard. */
|
|
4807
|
+
export declare function isSignedOut(): boolean;
|
|
4808
|
+
|
|
4809
|
+
/**
|
|
4810
|
+
* Does this error say the tab is signed out? `identity` = it came from a "who am I" call, where
|
|
4811
|
+
* any 401 (bar View-as) counts; elsewhere only the session-gone codes do (a public form's wrong
|
|
4812
|
+
* password is a 401 too).
|
|
4813
|
+
*/
|
|
4814
|
+
export declare function isSignedOutError(err: unknown, identity?: boolean): boolean;
|
|
4815
|
+
|
|
4800
4816
|
/**
|
|
4801
4817
|
* Stale code chunks after a deploy. Screens load lazily by hashed file names, and a new
|
|
4802
4818
|
* release no longer serves the previous build's files — so a tab opened before the deploy
|
|
@@ -5930,6 +5946,21 @@ export declare function NivaroProvider({ client, children, batchReads, persistMe
|
|
|
5930
5946
|
*/
|
|
5931
5947
|
export declare function normalizeFieldType(rawType: string, iface: string | null, relation: FormFieldDescriptor['relation']): FormFieldType;
|
|
5932
5948
|
|
|
5949
|
+
/** The host swapped credentials (a new bearer token): whatever was refused may work now. */
|
|
5950
|
+
export declare function noteCredentialChanged(): void;
|
|
5951
|
+
|
|
5952
|
+
/**
|
|
5953
|
+
* An identity call succeeded: this tab is signed in. Other tabs hear it when this tab was
|
|
5954
|
+
* signed out until now, or the first time this page learns it (a fresh page after sign-in).
|
|
5955
|
+
*/
|
|
5956
|
+
export declare function noteSignedIn(): void;
|
|
5957
|
+
|
|
5958
|
+
/**
|
|
5959
|
+
* A 401 from the API: close the gate and push the next probe further out. `escalate: false`
|
|
5960
|
+
* (a refusal from an ordinary read) only closes an open gate — it never lengthens the wait.
|
|
5961
|
+
*/
|
|
5962
|
+
export declare function noteUnauthorized(escalate?: boolean): void;
|
|
5963
|
+
|
|
5933
5964
|
declare type Notice = (message: string, tone?: 'error' | 'success') => void;
|
|
5934
5965
|
|
|
5935
5966
|
export declare function NotificationActions({ actions, notificationId, onDone, onError, size, className }: NotificationActionsProps): JSX.Element | null;
|
|
@@ -6279,6 +6310,9 @@ export declare function onFieldInterfacesChange(cb: () => void): () => void;
|
|
|
6279
6310
|
*/
|
|
6280
6311
|
export declare function onIdleChange(fn: (idle: boolean) => void): () => void;
|
|
6281
6312
|
|
|
6313
|
+
/** Called once each time the tab goes from signed out to signed in. Returns the unsubscribe. */
|
|
6314
|
+
export declare function onSignedIn(cb: () => void): () => void;
|
|
6315
|
+
|
|
6282
6316
|
export declare function openAskPanel(question?: string): void;
|
|
6283
6317
|
|
|
6284
6318
|
export declare function openCatalogItem(collection: string, id: string, context?: Record<string, unknown>): void;
|
|
@@ -10925,6 +10959,12 @@ export declare interface WorkerSocket extends FallbackSocket {
|
|
|
10925
10959
|
* disconnect and connect.
|
|
10926
10960
|
*/
|
|
10927
10961
|
chaosPause(down: boolean): void;
|
|
10962
|
+
/**
|
|
10963
|
+
* The person signed in (a host that learns it outside the signed-out gate calls this; the gate's
|
|
10964
|
+
* own `noteSignedIn` does it for every worker socket): the worker asks this tab for a token now
|
|
10965
|
+
* instead of staying parked or waiting out its backoff.
|
|
10966
|
+
*/
|
|
10967
|
+
signedIn(): void;
|
|
10928
10968
|
/** The transport the worker's socket uses (for status displays). */
|
|
10929
10969
|
io: {
|
|
10930
10970
|
engine: {
|
|
@@ -10947,7 +10987,12 @@ export declare interface WorkerSocketOptions {
|
|
|
10947
10987
|
features?: string[];
|
|
10948
10988
|
/** Build fields for `client:hello` (client-version.ts `clientVersion()`). */
|
|
10949
10989
|
version?: Record<string, unknown>;
|
|
10950
|
-
/**
|
|
10990
|
+
/**
|
|
10991
|
+
* Mint a `/auth/ws-token` for the worker's socket (the worker asks one tab per connect). A
|
|
10992
|
+
* null answer (signed out, or no token to be had) backs this tab off: the worker's next asks
|
|
10993
|
+
* are answered null without calling this until the wait (1 s doubling to 5 min, jittered)
|
|
10994
|
+
* passes, or the tab hears a sign-in (signed-out.ts).
|
|
10995
|
+
*/
|
|
10951
10996
|
authToken: () => Promise<string | null>;
|
|
10952
10997
|
/** The host's own socket, created only when the worker cannot serve this tab. */
|
|
10953
10998
|
fallback: () => FallbackSocket;
|