@arbidocs/react 0.5.105 → 0.5.107
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 +9 -1
- package/dist/artifacts/index.cjs +13 -13
- package/dist/artifacts/index.js +3 -3
- package/dist/calls/livekit/index.cjs +48 -48
- package/dist/calls/livekit/index.js +3 -3
- package/dist/{chunk-XOS7ISIR.cjs → chunk-5HDKL6XB.cjs} +57 -57
- package/dist/chunk-5HDKL6XB.cjs.map +1 -0
- package/dist/{chunk-M74JCOXW.js → chunk-6H3O63TQ.js} +7 -4
- package/dist/chunk-6H3O63TQ.js.map +1 -0
- package/dist/{chunk-Q2GNEVG2.cjs → chunk-7LIMHY56.cjs} +7 -4
- package/dist/chunk-7LIMHY56.cjs.map +1 -0
- package/dist/{chunk-4UUZ67JL.js → chunk-CPQ3CU4B.js} +18 -6
- package/dist/chunk-CPQ3CU4B.js.map +1 -0
- package/dist/{chunk-PJMCBB6E.js → chunk-DQALOQPI.js} +5 -4
- package/dist/chunk-DQALOQPI.js.map +1 -0
- package/dist/{chunk-RKTBXAS4.js → chunk-FZJMA32S.js} +4 -4
- package/dist/{chunk-RKTBXAS4.js.map → chunk-FZJMA32S.js.map} +1 -1
- package/dist/{chunk-AXKIOI2U.js → chunk-H5M7FXLB.js} +4 -4
- package/dist/chunk-H5M7FXLB.js.map +1 -0
- package/dist/{chunk-TV4QQVZM.cjs → chunk-HD5H2PPP.cjs} +67 -66
- package/dist/chunk-HD5H2PPP.cjs.map +1 -0
- package/dist/{chunk-MAUZSNQY.js → chunk-P6WLV5UY.js} +3 -3
- package/dist/{chunk-MAUZSNQY.js.map → chunk-P6WLV5UY.js.map} +1 -1
- package/dist/{chunk-DM4KTNKI.cjs → chunk-QF2BW6HZ.cjs} +38 -38
- package/dist/{chunk-DM4KTNKI.cjs.map → chunk-QF2BW6HZ.cjs.map} +1 -1
- package/dist/{chunk-IXE7HCCA.cjs → chunk-RVUGSM65.cjs} +44 -44
- package/dist/{chunk-IXE7HCCA.cjs.map → chunk-RVUGSM65.cjs.map} +1 -1
- package/dist/{chunk-XBYVYPU5.cjs → chunk-W2FATOTX.cjs} +19 -7
- package/dist/chunk-W2FATOTX.cjs.map +1 -0
- package/dist/document-tools/core.cjs +98 -98
- package/dist/document-tools/core.d.cts +4 -3
- package/dist/document-tools/core.d.ts +4 -3
- package/dist/document-tools/core.js +3 -3
- package/dist/document-tools/index.cjs +100 -100
- package/dist/document-tools/index.d.cts +1 -1
- package/dist/document-tools/index.d.ts +1 -1
- package/dist/document-tools/index.js +4 -4
- package/dist/index.cjs +1724 -1320
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +315 -14
- package/dist/index.d.ts +315 -14
- package/dist/index.js +414 -23
- package/dist/index.js.map +1 -1
- package/dist/{query-keys.d-Bpb7R_lB.d.cts → query-keys.d-ChgpJLPF.d.cts} +5 -2
- package/dist/{query-keys.d-Bpb7R_lB.d.ts → query-keys.d-ChgpJLPF.d.ts} +5 -2
- package/package.json +3 -3
- package/dist/chunk-4UUZ67JL.js.map +0 -1
- package/dist/chunk-AXKIOI2U.js.map +0 -1
- package/dist/chunk-M74JCOXW.js.map +0 -1
- package/dist/chunk-PJMCBB6E.js.map +0 -1
- package/dist/chunk-Q2GNEVG2.cjs.map +0 -1
- package/dist/chunk-TV4QQVZM.cjs.map +0 -1
- package/dist/chunk-XBYVYPU5.cjs.map +0 -1
- package/dist/chunk-XOS7ISIR.cjs.map +0 -1
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
'use strict';
|
|
2
2
|
|
|
3
|
-
var
|
|
4
|
-
var
|
|
3
|
+
var chunk5HDKL6XB_cjs = require('./chunk-5HDKL6XB.cjs');
|
|
4
|
+
var chunk7LIMHY56_cjs = require('./chunk-7LIMHY56.cjs');
|
|
5
5
|
var chunkRLSBRZ6Z_cjs = require('./chunk-RLSBRZ6Z.cjs');
|
|
6
6
|
var chunkEEIYXVM4_cjs = require('./chunk-EEIYXVM4.cjs');
|
|
7
7
|
var reactQuery = require('@tanstack/react-query');
|
|
@@ -10,33 +10,34 @@ var browser = require('@arbidocs/sdk/browser');
|
|
|
10
10
|
var client = require('@arbidocs/client');
|
|
11
11
|
|
|
12
12
|
function useUserSettings(options) {
|
|
13
|
-
const arbi =
|
|
13
|
+
const arbi = chunk7LIMHY56_cjs.useArbi();
|
|
14
14
|
return reactQuery.useQuery({
|
|
15
|
-
queryKey:
|
|
15
|
+
queryKey: chunk7LIMHY56_cjs.arbiQueryKeys.userSettings(),
|
|
16
16
|
queryFn: () => arbi.settings.get(),
|
|
17
17
|
// Edited about once a month, and every write here patches the cache: no refetch on each mount.
|
|
18
18
|
staleTime: 30 * 60 * 1e3,
|
|
19
|
+
refetchOnMount: options?.refetchOnMount,
|
|
19
20
|
enabled: (options?.enabled ?? true) && arbi.isLoggedIn
|
|
20
21
|
});
|
|
21
22
|
}
|
|
22
23
|
function useUpdateUserSettings() {
|
|
23
|
-
const arbi =
|
|
24
|
+
const arbi = chunk7LIMHY56_cjs.useArbi();
|
|
24
25
|
const qc = reactQuery.useQueryClient();
|
|
25
26
|
return reactQuery.useMutation({
|
|
26
27
|
mutationFn: (patch) => arbi.settings.update(patch),
|
|
27
28
|
onMutate: async (patch) => {
|
|
28
|
-
await qc.cancelQueries({ queryKey:
|
|
29
|
-
const previous = qc.getQueryData(
|
|
29
|
+
await qc.cancelQueries({ queryKey: chunk7LIMHY56_cjs.arbiQueryKeys.userSettings() });
|
|
30
|
+
const previous = qc.getQueryData(chunk7LIMHY56_cjs.arbiQueryKeys.userSettings());
|
|
30
31
|
qc.setQueryData(
|
|
31
|
-
|
|
32
|
+
chunk7LIMHY56_cjs.arbiQueryKeys.userSettings(),
|
|
32
33
|
(old) => old ? { ...old, ...patch } : old
|
|
33
34
|
);
|
|
34
35
|
return { previous };
|
|
35
36
|
},
|
|
36
37
|
onError: (_err, _patch, context) => {
|
|
37
|
-
qc.setQueryData(
|
|
38
|
+
qc.setQueryData(chunk7LIMHY56_cjs.arbiQueryKeys.userSettings(), context?.previous);
|
|
38
39
|
},
|
|
39
|
-
onSettled: () => qc.invalidateQueries({ queryKey:
|
|
40
|
+
onSettled: () => qc.invalidateQueries({ queryKey: chunk7LIMHY56_cjs.arbiQueryKeys.userSettings() })
|
|
40
41
|
});
|
|
41
42
|
}
|
|
42
43
|
var ALWAYS_ON = { on: true, set: () => {
|
|
@@ -59,7 +60,7 @@ function useLocalSwitch(source, feature) {
|
|
|
59
60
|
return { on: saved ?? fallback, set };
|
|
60
61
|
}
|
|
61
62
|
function useFeatureSwitch(feature) {
|
|
62
|
-
const source =
|
|
63
|
+
const source = chunk7LIMHY56_cjs.useArbiHost().features?.[feature];
|
|
63
64
|
const useSource = !source ? useUnlisted : "userSetting" in source ? useUserSettingSwitch : useLocalSwitch;
|
|
64
65
|
return useSource(source, feature);
|
|
65
66
|
}
|
|
@@ -70,7 +71,7 @@ function useNoSettings() {
|
|
|
70
71
|
return { data: void 0 };
|
|
71
72
|
}
|
|
72
73
|
function useFeatureCheck() {
|
|
73
|
-
const features =
|
|
74
|
+
const features = chunk7LIMHY56_cjs.useArbiHost().features;
|
|
74
75
|
const useSettings = Object.values(features ?? {}).some(
|
|
75
76
|
(source) => !!source && "userSetting" in source
|
|
76
77
|
) ? useUserSettings : useNoSettings;
|
|
@@ -182,7 +183,7 @@ var LISTS = {
|
|
|
182
183
|
};
|
|
183
184
|
function patchConversationList(queryClient, workspaceId, reducer) {
|
|
184
185
|
if (!workspaceId) return;
|
|
185
|
-
const key =
|
|
186
|
+
const key = chunk7LIMHY56_cjs.arbiQueryKeys.conversations(workspaceId);
|
|
186
187
|
const current = queryClient.getQueryData(key) ?? [];
|
|
187
188
|
const next = reducer(current);
|
|
188
189
|
if (next !== current) queryClient.setQueryData(key, next);
|
|
@@ -246,13 +247,13 @@ function byActivity(a, b) {
|
|
|
246
247
|
return bt - at;
|
|
247
248
|
}
|
|
248
249
|
function cachedChats(queryClient) {
|
|
249
|
-
return queryClient.getQueryData(
|
|
250
|
+
return queryClient.getQueryData(chunk7LIMHY56_cjs.arbiQueryKeys.chatList()) ?? [];
|
|
250
251
|
}
|
|
251
252
|
function cachedChat(queryClient, chatExtId) {
|
|
252
253
|
return cachedChats(queryClient).find((c) => c.external_id === chatExtId);
|
|
253
254
|
}
|
|
254
255
|
function upsertChat(queryClient, chat) {
|
|
255
|
-
queryClient.setQueryData(
|
|
256
|
+
queryClient.setQueryData(chunk7LIMHY56_cjs.arbiQueryKeys.chatList(), (old) => {
|
|
256
257
|
if (!old) return old;
|
|
257
258
|
const rest = old.filter((c) => c.external_id !== chat.external_id);
|
|
258
259
|
return [chat, ...rest].sort(byActivity);
|
|
@@ -260,13 +261,13 @@ function upsertChat(queryClient, chat) {
|
|
|
260
261
|
}
|
|
261
262
|
function removeChat(queryClient, chatExtId) {
|
|
262
263
|
queryClient.setQueryData(
|
|
263
|
-
|
|
264
|
+
chunk7LIMHY56_cjs.arbiQueryKeys.chatList(),
|
|
264
265
|
(old) => old?.filter((c) => c.external_id !== chatExtId)
|
|
265
266
|
);
|
|
266
|
-
queryClient.removeQueries({ queryKey:
|
|
267
|
+
queryClient.removeQueries({ queryKey: chunk7LIMHY56_cjs.arbiQueryKeys.chatThread(chatExtId) });
|
|
267
268
|
}
|
|
268
269
|
function appendToThread(queryClient, chatExtId, message, replaceOptimisticId) {
|
|
269
|
-
queryClient.setQueryData(
|
|
270
|
+
queryClient.setQueryData(chunk7LIMHY56_cjs.arbiQueryKeys.chatThread(chatExtId), (old) => {
|
|
270
271
|
if (!old) return old;
|
|
271
272
|
const without = old.messages.filter(
|
|
272
273
|
(m) => m.external_id !== message.external_id && m.external_id !== replaceOptimisticId
|
|
@@ -276,12 +277,12 @@ function appendToThread(queryClient, chatExtId, message, replaceOptimisticId) {
|
|
|
276
277
|
}
|
|
277
278
|
function dropFromThread(queryClient, chatExtId, messageExtId) {
|
|
278
279
|
queryClient.setQueryData(
|
|
279
|
-
|
|
280
|
+
chunk7LIMHY56_cjs.arbiQueryKeys.chatThread(chatExtId),
|
|
280
281
|
(old) => old ? { ...old, messages: old.messages.filter((m) => m.external_id !== messageExtId) } : old
|
|
281
282
|
);
|
|
282
283
|
}
|
|
283
284
|
function replaceInThread(queryClient, chatExtId, message) {
|
|
284
|
-
queryClient.setQueryData(
|
|
285
|
+
queryClient.setQueryData(chunk7LIMHY56_cjs.arbiQueryKeys.chatThread(chatExtId), (old) => {
|
|
285
286
|
if (!old || !old.messages.some((m) => m.external_id === message.external_id)) return old;
|
|
286
287
|
return {
|
|
287
288
|
...old,
|
|
@@ -291,14 +292,14 @@ function replaceInThread(queryClient, chatExtId, message) {
|
|
|
291
292
|
}
|
|
292
293
|
function patchLastMessage(queryClient, chatExtId, message) {
|
|
293
294
|
queryClient.setQueryData(
|
|
294
|
-
|
|
295
|
+
chunk7LIMHY56_cjs.arbiQueryKeys.chatList(),
|
|
295
296
|
(old) => old?.map(
|
|
296
297
|
(c) => c.external_id === chatExtId && c.last_message?.external_id === message.external_id ? { ...c, last_message: message } : c
|
|
297
298
|
)
|
|
298
299
|
);
|
|
299
300
|
}
|
|
300
301
|
async function deleteChatMessage(arbi, queryClient, chatExtId, messageExtId) {
|
|
301
|
-
const thread = queryClient.getQueryData(
|
|
302
|
+
const thread = queryClient.getQueryData(chunk7LIMHY56_cjs.arbiQueryKeys.chatThread(chatExtId));
|
|
302
303
|
const before = thread?.messages.find((m) => m.external_id === messageExtId);
|
|
303
304
|
const listed = cachedChat(queryClient, chatExtId);
|
|
304
305
|
const wasLast = listed?.last_message?.external_id === messageExtId ? listed.last_message : null;
|
|
@@ -319,7 +320,7 @@ async function applyChangedMessage(arbi, queryClient, chatExtId, message) {
|
|
|
319
320
|
return;
|
|
320
321
|
}
|
|
321
322
|
const chat = cachedChat(queryClient, chatExtId);
|
|
322
|
-
if (!chat || !queryClient.getQueryData(
|
|
323
|
+
if (!chat || !queryClient.getQueryData(chunk7LIMHY56_cjs.arbiQueryKeys.chatThread(chatExtId))) return;
|
|
323
324
|
try {
|
|
324
325
|
replaceInThread(queryClient, chatExtId, await arbi.chats.decrypt(chat, message));
|
|
325
326
|
} catch (err) {
|
|
@@ -331,7 +332,7 @@ async function applyChatMessage(arbi, queryClient, chatExtId, message) {
|
|
|
331
332
|
const me = myChatId(arbi);
|
|
332
333
|
const chat = cachedChat(queryClient, chatExtId);
|
|
333
334
|
if (!chat) {
|
|
334
|
-
void queryClient.invalidateQueries({ queryKey:
|
|
335
|
+
void queryClient.invalidateQueries({ queryKey: chunk7LIMHY56_cjs.arbiQueryKeys.chatList() });
|
|
335
336
|
return;
|
|
336
337
|
}
|
|
337
338
|
const mine = message.sender_ext_id === me;
|
|
@@ -345,7 +346,7 @@ async function applyChatMessage(arbi, queryClient, chatExtId, message) {
|
|
|
345
346
|
(m) => m.user.external_id === me ? { ...m, last_read_at: message.created_at } : m
|
|
346
347
|
) : chat.members
|
|
347
348
|
});
|
|
348
|
-
if (queryClient.getQueryData(
|
|
349
|
+
if (queryClient.getQueryData(chunk7LIMHY56_cjs.arbiQueryKeys.chatThread(chatExtId))) {
|
|
349
350
|
try {
|
|
350
351
|
appendToThread(queryClient, chatExtId, await arbi.chats.decrypt(chat, message));
|
|
351
352
|
} catch (err) {
|
|
@@ -356,7 +357,7 @@ async function applyChatMessage(arbi, queryClient, chatExtId, message) {
|
|
|
356
357
|
function applyChatRead(arbi, queryClient, chatExtId, userExtId, lastReadAt) {
|
|
357
358
|
const me = myChatId(arbi);
|
|
358
359
|
queryClient.setQueryData(
|
|
359
|
-
|
|
360
|
+
chunk7LIMHY56_cjs.arbiQueryKeys.chatList(),
|
|
360
361
|
(old) => old?.map(
|
|
361
362
|
(c) => c.external_id !== chatExtId ? c : {
|
|
362
363
|
...c,
|
|
@@ -382,11 +383,11 @@ async function applyChatUpdated(arbi, queryClient, chatExtId, message) {
|
|
|
382
383
|
}
|
|
383
384
|
upsertChat(queryClient, chat);
|
|
384
385
|
if (!message)
|
|
385
|
-
void queryClient.invalidateQueries({ queryKey:
|
|
386
|
+
void queryClient.invalidateQueries({ queryKey: chunk7LIMHY56_cjs.arbiQueryKeys.chatThread(chatExtId) });
|
|
386
387
|
}
|
|
387
388
|
function applyAgentDmStatus(queryClient, status) {
|
|
388
389
|
if (!["queued", "working", "done", "failed"].includes(status.status)) return;
|
|
389
|
-
queryClient.setQueryData(
|
|
390
|
+
queryClient.setQueryData(chunk7LIMHY56_cjs.arbiQueryKeys.agentDmStatus(status.agent_ext_id), status);
|
|
390
391
|
}
|
|
391
392
|
async function applyChatEvent(arbi, queryClient, event) {
|
|
392
393
|
const e = event;
|
|
@@ -401,13 +402,13 @@ async function applyChatEvent(arbi, queryClient, event) {
|
|
|
401
402
|
|
|
402
403
|
// src/calls/keys.ts
|
|
403
404
|
function serverCallsExperimental(queryClient) {
|
|
404
|
-
return queryClient.getQueryData(
|
|
405
|
+
return queryClient.getQueryData(chunk7LIMHY56_cjs.callQueryKeys.config())?.experimental !== false;
|
|
405
406
|
}
|
|
406
407
|
function invalidateCall(queryClient, message) {
|
|
407
|
-
void queryClient.invalidateQueries({ queryKey:
|
|
408
|
+
void queryClient.invalidateQueries({ queryKey: chunk7LIMHY56_cjs.callQueryKeys.call(message.call_ext_id) });
|
|
408
409
|
const thread = message.log_conversation_ext_id;
|
|
409
410
|
if (thread) {
|
|
410
|
-
void queryClient.invalidateQueries({ queryKey:
|
|
411
|
+
void queryClient.invalidateQueries({ queryKey: chunk7LIMHY56_cjs.arbiQueryKeys.conversationActivity(thread) });
|
|
411
412
|
}
|
|
412
413
|
}
|
|
413
414
|
|
|
@@ -658,19 +659,19 @@ function applyCallEvent(queryClient, event, options = {}) {
|
|
|
658
659
|
}
|
|
659
660
|
case "call.recording": {
|
|
660
661
|
if (callExtId)
|
|
661
|
-
void queryClient.invalidateQueries({ queryKey:
|
|
662
|
+
void queryClient.invalidateQueries({ queryKey: chunk7LIMHY56_cjs.callQueryKeys.recordingsOf(callExtId) });
|
|
662
663
|
const state2 = browser.calls.recordingStateFrom(m);
|
|
663
664
|
relay("call.recording", callExtId && state2 ? { ...state2, call_ext_id: callExtId } : null);
|
|
664
665
|
return true;
|
|
665
666
|
}
|
|
666
667
|
case "call.recording_updated": {
|
|
667
668
|
if (callExtId)
|
|
668
|
-
void queryClient.invalidateQueries({ queryKey:
|
|
669
|
+
void queryClient.invalidateQueries({ queryKey: chunk7LIMHY56_cjs.callQueryKeys.recordingsOf(callExtId) });
|
|
669
670
|
return true;
|
|
670
671
|
}
|
|
671
672
|
case "call.recording_deleted": {
|
|
672
673
|
if (callExtId)
|
|
673
|
-
void queryClient.invalidateQueries({ queryKey:
|
|
674
|
+
void queryClient.invalidateQueries({ queryKey: chunk7LIMHY56_cjs.callQueryKeys.recordingsOf(callExtId) });
|
|
674
675
|
const recordingExtId = str(m.recording_ext_id);
|
|
675
676
|
relay(
|
|
676
677
|
"call.recording_deleted",
|
|
@@ -963,11 +964,11 @@ function useProfile(options) {
|
|
|
963
964
|
const { client, enabled } = useAccountClient();
|
|
964
965
|
const qc = reactQuery.useQueryClient();
|
|
965
966
|
react.useEffect(
|
|
966
|
-
() => client.onProfileChange(() => qc.setQueryData(
|
|
967
|
+
() => client.onProfileChange(() => qc.setQueryData(chunk7LIMHY56_cjs.arbiQueryKeys.profile(), client.profile())),
|
|
967
968
|
[client, qc]
|
|
968
969
|
);
|
|
969
970
|
return reactQuery.useQuery({
|
|
970
|
-
queryKey:
|
|
971
|
+
queryKey: chunk7LIMHY56_cjs.arbiQueryKeys.profile(),
|
|
971
972
|
queryFn: () => client.profile(),
|
|
972
973
|
enabled: (options?.enabled ?? true) && enabled,
|
|
973
974
|
staleTime: Infinity
|
|
@@ -982,9 +983,9 @@ function useUpdateProfile() {
|
|
|
982
983
|
return client.profile();
|
|
983
984
|
},
|
|
984
985
|
onSuccess: (profile) => {
|
|
985
|
-
qc.setQueryData(
|
|
986
|
-
void qc.invalidateQueries({ queryKey:
|
|
987
|
-
return qc.invalidateQueries({ queryKey:
|
|
986
|
+
qc.setQueryData(chunk7LIMHY56_cjs.arbiQueryKeys.profile(), profile);
|
|
987
|
+
void qc.invalidateQueries({ queryKey: chunk7LIMHY56_cjs.arbiQueryKeys.identity() });
|
|
988
|
+
return qc.invalidateQueries({ queryKey: chunk7LIMHY56_cjs.arbiQueryKeys.workspaces() });
|
|
988
989
|
}
|
|
989
990
|
});
|
|
990
991
|
}
|
|
@@ -1086,7 +1087,7 @@ function arbiAccountClient(arbi, overrides = {}) {
|
|
|
1086
1087
|
if (everywhere) await arbi.sessions.logoutAll();
|
|
1087
1088
|
else await arbi.logout();
|
|
1088
1089
|
} finally {
|
|
1089
|
-
|
|
1090
|
+
chunk5HDKL6XB_cjs.clearSealedDrafts();
|
|
1090
1091
|
chunkRLSBRZ6Z_cjs.clearChatArtifacts();
|
|
1091
1092
|
await wipeOfflineMail().catch(() => {
|
|
1092
1093
|
});
|
|
@@ -1133,7 +1134,7 @@ var NO_ACCOUNT = {
|
|
|
1133
1134
|
};
|
|
1134
1135
|
var ALWAYS = () => true;
|
|
1135
1136
|
function useAccountClient() {
|
|
1136
|
-
const { account, arbi } =
|
|
1137
|
+
const { account, arbi } = chunk7LIMHY56_cjs.useArbiHost();
|
|
1137
1138
|
const fallback = react.useMemo(() => arbi ? arbiAccountClient(arbi) : null, [arbi]);
|
|
1138
1139
|
const useEnabled = account?.useEnabled ?? ALWAYS;
|
|
1139
1140
|
const enabled = useEnabled();
|
|
@@ -1144,9 +1145,9 @@ function useAccountClient() {
|
|
|
1144
1145
|
return { client: fallback, enabled: arbi.isLoggedIn };
|
|
1145
1146
|
}
|
|
1146
1147
|
function useEntitlements() {
|
|
1147
|
-
const { arbi } =
|
|
1148
|
+
const { arbi } = chunk7LIMHY56_cjs.useArbiHost();
|
|
1148
1149
|
return reactQuery.useQuery({
|
|
1149
|
-
queryKey:
|
|
1150
|
+
queryKey: chunk7LIMHY56_cjs.arbiQueryKeys.entitlements(),
|
|
1150
1151
|
queryFn: () => arbi.account.entitlements(),
|
|
1151
1152
|
enabled: !!arbi?.isLoggedIn,
|
|
1152
1153
|
// A plan change shows on the next read; the API enforces it at once either way.
|
|
@@ -1155,7 +1156,7 @@ function useEntitlements() {
|
|
|
1155
1156
|
}
|
|
1156
1157
|
function useInvalidateEntitlements() {
|
|
1157
1158
|
const qc = reactQuery.useQueryClient();
|
|
1158
|
-
return () => qc.invalidateQueries({ queryKey:
|
|
1159
|
+
return () => qc.invalidateQueries({ queryKey: chunk7LIMHY56_cjs.arbiQueryKeys.entitlements() });
|
|
1159
1160
|
}
|
|
1160
1161
|
function useIsEntitled(feature) {
|
|
1161
1162
|
const { data } = useEntitlements();
|
|
@@ -1279,7 +1280,7 @@ function ensureMeetingChat(arbi, queryClient, callExtId, callKey) {
|
|
|
1279
1280
|
});
|
|
1280
1281
|
if (!ref) throw new Error("The server did not return a meeting chat");
|
|
1281
1282
|
if (ref.kind === "chat")
|
|
1282
|
-
void queryClient.invalidateQueries({ queryKey:
|
|
1283
|
+
void queryClient.invalidateQueries({ queryKey: chunk7LIMHY56_cjs.arbiQueryKeys.chatList() });
|
|
1283
1284
|
else void invalidateConversationLists(queryClient);
|
|
1284
1285
|
return ref;
|
|
1285
1286
|
})();
|
|
@@ -2285,9 +2286,9 @@ async function transcribeRecording(params) {
|
|
|
2285
2286
|
return { stored, failed };
|
|
2286
2287
|
}
|
|
2287
2288
|
function useCallsConfig() {
|
|
2288
|
-
const arbi =
|
|
2289
|
+
const arbi = chunk7LIMHY56_cjs.useArbi();
|
|
2289
2290
|
const { data } = reactQuery.useQuery({
|
|
2290
|
-
queryKey:
|
|
2291
|
+
queryKey: chunk7LIMHY56_cjs.callQueryKeys.config(),
|
|
2291
2292
|
queryFn: () => arbi.calls.config(),
|
|
2292
2293
|
enabled: arbi.isLoggedIn,
|
|
2293
2294
|
staleTime: 5 * 6e4,
|
|
@@ -2305,9 +2306,9 @@ function useCallTranscriptionAvailable() {
|
|
|
2305
2306
|
return useCallsConfig()?.transcription_available === true;
|
|
2306
2307
|
}
|
|
2307
2308
|
function useCall(callExtId) {
|
|
2308
|
-
const arbi =
|
|
2309
|
+
const arbi = chunk7LIMHY56_cjs.useArbi();
|
|
2309
2310
|
return reactQuery.useQuery({
|
|
2310
|
-
queryKey:
|
|
2311
|
+
queryKey: chunk7LIMHY56_cjs.callQueryKeys.call(callExtId ?? ""),
|
|
2311
2312
|
queryFn: () => arbi.calls.get(callExtId),
|
|
2312
2313
|
enabled: !!callExtId && arbi.isLoggedIn,
|
|
2313
2314
|
staleTime: 6e4,
|
|
@@ -2315,18 +2316,18 @@ function useCall(callExtId) {
|
|
|
2315
2316
|
});
|
|
2316
2317
|
}
|
|
2317
2318
|
function useCallRecordings(callExtId, enabled = true) {
|
|
2318
|
-
const arbi =
|
|
2319
|
+
const arbi = chunk7LIMHY56_cjs.useArbi();
|
|
2319
2320
|
return reactQuery.useQuery({
|
|
2320
|
-
queryKey:
|
|
2321
|
+
queryKey: chunk7LIMHY56_cjs.callQueryKeys.recordings(callExtId ?? ""),
|
|
2321
2322
|
queryFn: () => arbi.calls.recording.list(callExtId),
|
|
2322
2323
|
enabled: !!callExtId && enabled && arbi.isLoggedIn,
|
|
2323
2324
|
retry: false
|
|
2324
2325
|
});
|
|
2325
2326
|
}
|
|
2326
2327
|
function useCallRecording(callExtId, recordingExtId) {
|
|
2327
|
-
const arbi =
|
|
2328
|
+
const arbi = chunk7LIMHY56_cjs.useArbi();
|
|
2328
2329
|
return reactQuery.useQuery({
|
|
2329
|
-
queryKey:
|
|
2330
|
+
queryKey: chunk7LIMHY56_cjs.callQueryKeys.recording(callExtId ?? "", recordingExtId ?? ""),
|
|
2330
2331
|
queryFn: () => arbi.calls.recording.get(callExtId, recordingExtId),
|
|
2331
2332
|
enabled: !!callExtId && !!recordingExtId && arbi.isLoggedIn,
|
|
2332
2333
|
retry: false
|
|
@@ -2338,21 +2339,21 @@ function useRecordingWindows(callExtId, enabled) {
|
|
|
2338
2339
|
return react.useMemo(() => data ? recordingWindowsOf(data) : NO_WINDOWS, [data]);
|
|
2339
2340
|
}
|
|
2340
2341
|
function useCallInviteLinks(callExtId) {
|
|
2341
|
-
const arbi =
|
|
2342
|
+
const arbi = chunk7LIMHY56_cjs.useArbi();
|
|
2342
2343
|
return reactQuery.useQuery({
|
|
2343
|
-
queryKey:
|
|
2344
|
+
queryKey: chunk7LIMHY56_cjs.callQueryKeys.inviteLinks(callExtId ?? ""),
|
|
2344
2345
|
queryFn: () => arbi.calls.inviteLinks.list(callExtId),
|
|
2345
2346
|
enabled: !!callExtId && arbi.isLoggedIn,
|
|
2346
2347
|
retry: false
|
|
2347
2348
|
});
|
|
2348
2349
|
}
|
|
2349
2350
|
function useRecordingActions(call) {
|
|
2350
|
-
const arbi =
|
|
2351
|
+
const arbi = chunk7LIMHY56_cjs.useArbi();
|
|
2351
2352
|
const queryClient = reactQuery.useQueryClient();
|
|
2352
2353
|
return react.useMemo(
|
|
2353
2354
|
() => ({
|
|
2354
2355
|
refresh: () => void queryClient.invalidateQueries({
|
|
2355
|
-
queryKey:
|
|
2356
|
+
queryKey: chunk7LIMHY56_cjs.callQueryKeys.recordingsOf(call.external_id)
|
|
2356
2357
|
}),
|
|
2357
2358
|
open: (recording) => openRecording(arbi, queryClient, call, recording.external_id, recording),
|
|
2358
2359
|
transcribe: async (opened, onProgress) => transcribeRecording({
|
|
@@ -2368,12 +2369,12 @@ function useRecordingActions(call) {
|
|
|
2368
2369
|
);
|
|
2369
2370
|
}
|
|
2370
2371
|
function useRevokeCallInviteLink(callExtId) {
|
|
2371
|
-
const arbi =
|
|
2372
|
+
const arbi = chunk7LIMHY56_cjs.useArbi();
|
|
2372
2373
|
const queryClient = reactQuery.useQueryClient();
|
|
2373
2374
|
return react.useCallback(
|
|
2374
2375
|
async (inviteExtId) => {
|
|
2375
2376
|
await arbi.calls.inviteLinks.revoke(callExtId, inviteExtId);
|
|
2376
|
-
void queryClient.invalidateQueries({ queryKey:
|
|
2377
|
+
void queryClient.invalidateQueries({ queryKey: chunk7LIMHY56_cjs.callQueryKeys.inviteLinks(callExtId) });
|
|
2377
2378
|
},
|
|
2378
2379
|
[arbi, queryClient, callExtId]
|
|
2379
2380
|
);
|
|
@@ -2431,7 +2432,7 @@ async function saveRecordingFilesToThread(arbi, params) {
|
|
|
2431
2432
|
});
|
|
2432
2433
|
}
|
|
2433
2434
|
function useSaveToThread() {
|
|
2434
|
-
const arbi =
|
|
2435
|
+
const arbi = chunk7LIMHY56_cjs.useArbi();
|
|
2435
2436
|
const queryClient = reactQuery.useQueryClient();
|
|
2436
2437
|
return react.useMemo(() => {
|
|
2437
2438
|
const thenRefresh = async (run) => {
|
|
@@ -2718,9 +2719,9 @@ function isWorkspaceGuestOf(workspaces, workspaceExtId, me) {
|
|
|
2718
2719
|
return workspace?.users?.find((wu) => wu.user.external_id === me)?.role === "guest";
|
|
2719
2720
|
}
|
|
2720
2721
|
function useMeetingReadOnly(lockedWorkspaceExtId) {
|
|
2721
|
-
const arbi =
|
|
2722
|
+
const arbi = chunk7LIMHY56_cjs.useArbi();
|
|
2722
2723
|
const me = arbi.isLoggedIn ? arbi.user.identity()?.externalId ?? null : null;
|
|
2723
|
-
const { data: workspaces } =
|
|
2724
|
+
const { data: workspaces } = chunk5HDKL6XB_cjs.useWorkspaces({
|
|
2724
2725
|
enabled: !!lockedWorkspaceExtId && arbi.isLoggedIn
|
|
2725
2726
|
});
|
|
2726
2727
|
return isWorkspaceGuestOf(
|
|
@@ -2743,9 +2744,9 @@ function useCanHostCalls() {
|
|
|
2743
2744
|
return callsEnabled && entitled;
|
|
2744
2745
|
}
|
|
2745
2746
|
function useOpenCallMeetingChat() {
|
|
2746
|
-
const arbi =
|
|
2747
|
+
const arbi = chunk7LIMHY56_cjs.useArbi();
|
|
2747
2748
|
const queryClient = reactQuery.useQueryClient();
|
|
2748
|
-
const open =
|
|
2749
|
+
const open = chunk7LIMHY56_cjs.useArbiHost().calls?.openMeetingChat;
|
|
2749
2750
|
return react.useCallback(
|
|
2750
2751
|
async (target) => {
|
|
2751
2752
|
try {
|
|
@@ -2982,5 +2983,5 @@ exports.useUserSettings = useUserSettings;
|
|
|
2982
2983
|
exports.wipeOfflineMail = wipeOfflineMail;
|
|
2983
2984
|
exports.wrapTrackKey = wrapTrackKey;
|
|
2984
2985
|
exports.writeSamples = writeSamples;
|
|
2985
|
-
//# sourceMappingURL=chunk-
|
|
2986
|
-
//# sourceMappingURL=chunk-
|
|
2986
|
+
//# sourceMappingURL=chunk-HD5H2PPP.cjs.map
|
|
2987
|
+
//# sourceMappingURL=chunk-HD5H2PPP.cjs.map
|