@arbidocs/react 0.5.183 → 0.5.185
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/artifacts/index.cjs +14 -14
- package/dist/calls/actions.js +9 -1
- package/dist/calls/actions.js.map +2 -2
- package/dist/calls/livekit/call-media-player.js +88 -20
- package/dist/calls/livekit/call-media-player.js.map +2 -2
- package/dist/calls/livekit/call-timing.js +12 -0
- package/dist/calls/livekit/call-timing.js.map +2 -2
- package/dist/calls/livekit/index.cjs +209 -74
- package/dist/calls/livekit/index.cjs.map +1 -1
- package/dist/calls/livekit/index.d.ts +11 -4
- package/dist/calls/livekit/useCallMedia.js +66 -8
- package/dist/calls/livekit/useCallMedia.js.map +2 -2
- package/dist/{chunk-K6MO6YML.cjs → chunk-4LFADBRL.cjs} +10 -10
- package/dist/{chunk-K6MO6YML.cjs.map → chunk-4LFADBRL.cjs.map} +1 -1
- package/dist/{chunk-NBES77PB.cjs → chunk-BEOHXA2Z.cjs} +60 -60
- package/dist/{chunk-NBES77PB.cjs.map → chunk-BEOHXA2Z.cjs.map} +1 -1
- package/dist/{chunk-Q7BGWKHP.cjs → chunk-KAMOFYV2.cjs} +44 -44
- package/dist/{chunk-Q7BGWKHP.cjs.map → chunk-KAMOFYV2.cjs.map} +1 -1
- package/dist/{chunk-5QOZLKAY.cjs → chunk-SJZRVX7T.cjs} +7 -2
- package/dist/chunk-SJZRVX7T.cjs.map +1 -0
- package/dist/{chunk-VCYRQZ3R.cjs → chunk-TKPBJCWQ.cjs} +78 -70
- package/dist/chunk-TKPBJCWQ.cjs.map +1 -0
- package/dist/{chunk-3IBQW2UD.cjs → chunk-XQIUGZPV.cjs} +37 -37
- package/dist/{chunk-3IBQW2UD.cjs.map → chunk-XQIUGZPV.cjs.map} +1 -1
- package/dist/databases.js +36 -1
- package/dist/databases.js.map +2 -2
- package/dist/document-tools/core.cjs +100 -100
- package/dist/document-tools/core.d.ts +2 -2
- package/dist/document-tools/index.cjs +102 -102
- package/dist/document-tools/index.d.ts +2 -2
- package/dist/{file-shares.d-Dlt7pKRi.d.ts → file-shares.d-DyS7nSIy.d.ts} +5 -0
- package/dist/index.cjs +1444 -1405
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.ts +25 -4
- package/dist/query-keys.js +5 -0
- package/dist/query-keys.js.map +2 -2
- package/package.json +3 -3
- package/dist/chunk-5QOZLKAY.cjs.map +0 -1
- package/dist/chunk-VCYRQZ3R.cjs.map +0 -1
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
'use strict';
|
|
2
2
|
|
|
3
|
-
var
|
|
3
|
+
var chunkSJZRVX7T_cjs = require('./chunk-SJZRVX7T.cjs');
|
|
4
4
|
var chunkN73IMVFF_cjs = require('./chunk-N73IMVFF.cjs');
|
|
5
5
|
var chunkDQODLWFX_cjs = require('./chunk-DQODLWFX.cjs');
|
|
6
6
|
var client = require('@arbidocs/client');
|
|
@@ -1562,7 +1562,7 @@ var createOwnStore = (host) => createArbiSessionStore(
|
|
|
1562
1562
|
var moduleDefault = null;
|
|
1563
1563
|
var defaultStore = () => moduleDefault ??= createArbiSessionStore();
|
|
1564
1564
|
function useArbiSessionStore() {
|
|
1565
|
-
const host =
|
|
1565
|
+
const host = chunkSJZRVX7T_cjs.useArbiHost();
|
|
1566
1566
|
if (host.session) return host.session;
|
|
1567
1567
|
const own = host[chunkN73IMVFF_cjs.OWN_SESSION_SLOT];
|
|
1568
1568
|
if (own) return own.current ??= createOwnStore(host);
|
|
@@ -1601,7 +1601,7 @@ var SIGNED_OUT = {
|
|
|
1601
1601
|
var noSubscription = () => () => {
|
|
1602
1602
|
};
|
|
1603
1603
|
function useArbiSession() {
|
|
1604
|
-
return useSignedInSession(
|
|
1604
|
+
return useSignedInSession(chunkSJZRVX7T_cjs.useArbiHost().arbi?.session ?? null);
|
|
1605
1605
|
}
|
|
1606
1606
|
function useSignedInSession(session) {
|
|
1607
1607
|
const state = react.useSyncExternalStore(
|
|
@@ -1925,27 +1925,27 @@ function isUsageMetered(usage, subscription) {
|
|
|
1925
1925
|
return !(empty && subscription === "dev");
|
|
1926
1926
|
}
|
|
1927
1927
|
function useWorkspaces(options) {
|
|
1928
|
-
const arbi =
|
|
1928
|
+
const arbi = chunkSJZRVX7T_cjs.useArbi();
|
|
1929
1929
|
return reactQuery.useQuery({
|
|
1930
|
-
queryKey:
|
|
1930
|
+
queryKey: chunkSJZRVX7T_cjs.arbiQueryKeys.workspaces(),
|
|
1931
1931
|
queryFn: () => arbi.workspaces.list(),
|
|
1932
1932
|
enabled: (options?.enabled ?? true) && arbi.isLoggedIn
|
|
1933
1933
|
});
|
|
1934
1934
|
}
|
|
1935
1935
|
function useDocumentVersionList(docId, options) {
|
|
1936
|
-
const arbi =
|
|
1936
|
+
const arbi = chunkSJZRVX7T_cjs.useArbi();
|
|
1937
1937
|
return reactQuery.useQuery({
|
|
1938
|
-
queryKey:
|
|
1938
|
+
queryKey: chunkSJZRVX7T_cjs.arbiQueryKeys.documentVersions(docId ?? ""),
|
|
1939
1939
|
queryFn: () => arbi.documents.versions(docId),
|
|
1940
1940
|
enabled: (options?.enabled ?? true) && !!docId && arbi.hasWorkspace
|
|
1941
1941
|
});
|
|
1942
1942
|
}
|
|
1943
1943
|
function useConversations(workspaceId, options) {
|
|
1944
|
-
const arbi =
|
|
1944
|
+
const arbi = chunkSJZRVX7T_cjs.useArbi();
|
|
1945
1945
|
const queryClient = reactQuery.useQueryClient();
|
|
1946
1946
|
const live = options?.live === true;
|
|
1947
1947
|
return reactQuery.useQuery({
|
|
1948
|
-
queryKey:
|
|
1948
|
+
queryKey: chunkSJZRVX7T_cjs.arbiQueryKeys.conversations(workspaceId ?? ""),
|
|
1949
1949
|
// The request names the workspace, so a switch while it runs cannot answer for another.
|
|
1950
1950
|
queryFn: () => readConversationList(
|
|
1951
1951
|
queryClient,
|
|
@@ -1960,9 +1960,9 @@ function useConversations(workspaceId, options) {
|
|
|
1960
1960
|
});
|
|
1961
1961
|
}
|
|
1962
1962
|
function useBuiltinCommands() {
|
|
1963
|
-
const arbi =
|
|
1963
|
+
const arbi = chunkSJZRVX7T_cjs.useArbi();
|
|
1964
1964
|
const query = reactQuery.useQuery({
|
|
1965
|
-
queryKey:
|
|
1965
|
+
queryKey: chunkSJZRVX7T_cjs.arbiQueryKeys.assistantCommands(),
|
|
1966
1966
|
queryFn: () => arbi.assistant.commands(),
|
|
1967
1967
|
staleTime: 30 * 1e3,
|
|
1968
1968
|
enabled: arbi.isLoggedIn
|
|
@@ -1971,18 +1971,18 @@ function useBuiltinCommands() {
|
|
|
1971
1971
|
return { commands, isLoading: query.isLoading };
|
|
1972
1972
|
}
|
|
1973
1973
|
function useMessageDetails(messageId, options) {
|
|
1974
|
-
const arbi =
|
|
1974
|
+
const arbi = chunkSJZRVX7T_cjs.useArbi();
|
|
1975
1975
|
return reactQuery.useQuery({
|
|
1976
|
-
queryKey:
|
|
1976
|
+
queryKey: chunkSJZRVX7T_cjs.arbiQueryKeys.messageDetails(messageId ?? ""),
|
|
1977
1977
|
queryFn: () => arbi.conversations.getMessage(messageId),
|
|
1978
1978
|
enabled: (options?.enabled ?? true) && !!messageId && arbi.isLoggedIn
|
|
1979
1979
|
});
|
|
1980
1980
|
}
|
|
1981
1981
|
function useConversationThreads(conversationId, options) {
|
|
1982
|
-
const arbi =
|
|
1982
|
+
const arbi = chunkSJZRVX7T_cjs.useArbi();
|
|
1983
1983
|
const session = useArbiSessionStore();
|
|
1984
1984
|
return reactQuery.useQuery({
|
|
1985
|
-
queryKey:
|
|
1985
|
+
queryKey: chunkSJZRVX7T_cjs.arbiQueryKeys.conversationThreads(conversationId ?? ""),
|
|
1986
1986
|
queryFn: () => arbi.conversations.getThreads(conversationId),
|
|
1987
1987
|
enabled: (options?.enabled ?? true) && !!conversationId && arbi.hasWorkspace,
|
|
1988
1988
|
staleTime: 2 * 60 * 1e3,
|
|
@@ -1998,12 +1998,12 @@ var tagListKey = (query) => [
|
|
|
1998
1998
|
query.linksLimit !== void 0 ? `links:${query.linksLimit}` : ""
|
|
1999
1999
|
].filter(Boolean).join("|");
|
|
2000
2000
|
function useTags(workspaceId, options) {
|
|
2001
|
-
const arbi =
|
|
2001
|
+
const arbi = chunkSJZRVX7T_cjs.useArbi();
|
|
2002
2002
|
const { enabled, ...query } = options ?? {};
|
|
2003
2003
|
const workspace = workspaceId ?? (arbi.hasWorkspace ? arbi.getWorkspaceId() : "");
|
|
2004
2004
|
const key = tagListKey(query);
|
|
2005
2005
|
return reactQuery.useQuery({
|
|
2006
|
-
queryKey: key ?
|
|
2006
|
+
queryKey: key ? chunkSJZRVX7T_cjs.arbiQueryKeys.tagList(workspace, key) : chunkSJZRVX7T_cjs.arbiQueryKeys.tags(workspace),
|
|
2007
2007
|
// The request names the workspace (opened for this session first when it is not the current
|
|
2008
2008
|
// one), so another workspace's tags can be listed and a switch cannot answer for it. The
|
|
2009
2009
|
// current workspace's list is also read under the switch guard.
|
|
@@ -2016,18 +2016,18 @@ function useTags(workspaceId, options) {
|
|
|
2016
2016
|
});
|
|
2017
2017
|
}
|
|
2018
2018
|
function useThumbnails(docIds, options) {
|
|
2019
|
-
const arbi =
|
|
2019
|
+
const arbi = chunkSJZRVX7T_cjs.useArbi();
|
|
2020
2020
|
return reactQuery.useQuery({
|
|
2021
|
-
queryKey:
|
|
2021
|
+
queryKey: chunkSJZRVX7T_cjs.arbiQueryKeys.thumbnails(docIds),
|
|
2022
2022
|
queryFn: () => arbi.documents.getThumbnails(docIds),
|
|
2023
2023
|
enabled: (options?.enabled ?? true) && docIds.length > 0 && arbi.hasWorkspace,
|
|
2024
2024
|
staleTime: 5 * 6e4
|
|
2025
2025
|
});
|
|
2026
2026
|
}
|
|
2027
2027
|
function useParsedDocument(docId, stage = "final", options) {
|
|
2028
|
-
const arbi =
|
|
2028
|
+
const arbi = chunkSJZRVX7T_cjs.useArbi();
|
|
2029
2029
|
return reactQuery.useQuery({
|
|
2030
|
-
queryKey:
|
|
2030
|
+
queryKey: chunkSJZRVX7T_cjs.arbiQueryKeys.parsedDoc(docId ?? "", stage),
|
|
2031
2031
|
queryFn: () => {
|
|
2032
2032
|
const { docId: id, version } = chunkDQODLWFX_cjs.parseVersionRef(docId);
|
|
2033
2033
|
return arbi.documents.getParsedContent(
|
|
@@ -2040,84 +2040,84 @@ function useParsedDocument(docId, stage = "final", options) {
|
|
|
2040
2040
|
});
|
|
2041
2041
|
}
|
|
2042
2042
|
function useAssistantQuery() {
|
|
2043
|
-
const arbi =
|
|
2043
|
+
const arbi = chunkSJZRVX7T_cjs.useArbi();
|
|
2044
2044
|
return reactQuery.useMutation({
|
|
2045
2045
|
mutationFn: ({ request, handlers }) => arbi.assistant.ask(request, handlers)
|
|
2046
2046
|
});
|
|
2047
2047
|
}
|
|
2048
2048
|
function useAgents(options) {
|
|
2049
|
-
const arbi =
|
|
2049
|
+
const arbi = chunkSJZRVX7T_cjs.useArbi();
|
|
2050
2050
|
return reactQuery.useQuery({
|
|
2051
|
-
queryKey:
|
|
2051
|
+
queryKey: chunkSJZRVX7T_cjs.arbiQueryKeys.agents(),
|
|
2052
2052
|
queryFn: () => arbi.agents.list(),
|
|
2053
2053
|
enabled: (options?.enabled ?? true) && arbi.isLoggedIn
|
|
2054
2054
|
});
|
|
2055
2055
|
}
|
|
2056
2056
|
function useDeleteAgents() {
|
|
2057
|
-
const arbi =
|
|
2057
|
+
const arbi = chunkSJZRVX7T_cjs.useArbi();
|
|
2058
2058
|
const qc = reactQuery.useQueryClient();
|
|
2059
2059
|
return reactQuery.useMutation({
|
|
2060
2060
|
mutationFn: ({ agentExtIds }) => arbi.agents.delete(agentExtIds),
|
|
2061
2061
|
onSuccess: (_result, { agentExtIds }) => {
|
|
2062
2062
|
for (const id of agentExtIds) {
|
|
2063
|
-
qc.removeQueries({ queryKey:
|
|
2064
|
-
qc.removeQueries({ queryKey:
|
|
2063
|
+
qc.removeQueries({ queryKey: chunkSJZRVX7T_cjs.arbiQueryKeys.agentConfig(id) });
|
|
2064
|
+
qc.removeQueries({ queryKey: chunkSJZRVX7T_cjs.arbiQueryKeys.agentWorkspaces(id) });
|
|
2065
2065
|
}
|
|
2066
2066
|
return Promise.all([
|
|
2067
|
-
qc.invalidateQueries({ queryKey:
|
|
2068
|
-
qc.invalidateQueries({ queryKey:
|
|
2069
|
-
qc.invalidateQueries({ queryKey:
|
|
2070
|
-
qc.invalidateQueries({ queryKey:
|
|
2067
|
+
qc.invalidateQueries({ queryKey: chunkSJZRVX7T_cjs.arbiQueryKeys.agents() }),
|
|
2068
|
+
qc.invalidateQueries({ queryKey: chunkSJZRVX7T_cjs.arbiQueryKeys.workflows() }),
|
|
2069
|
+
qc.invalidateQueries({ queryKey: chunkSJZRVX7T_cjs.arbiQueryKeys.allConversations() }),
|
|
2070
|
+
qc.invalidateQueries({ queryKey: chunkSJZRVX7T_cjs.arbiQueryKeys.configs() })
|
|
2071
2071
|
]);
|
|
2072
2072
|
}
|
|
2073
2073
|
});
|
|
2074
2074
|
}
|
|
2075
2075
|
function useHealth(options) {
|
|
2076
|
-
const arbi =
|
|
2076
|
+
const arbi = chunkSJZRVX7T_cjs.useArbi();
|
|
2077
2077
|
return reactQuery.useQuery({
|
|
2078
|
-
queryKey:
|
|
2078
|
+
queryKey: chunkSJZRVX7T_cjs.arbiQueryKeys.health(),
|
|
2079
2079
|
queryFn: () => arbi.health.check(),
|
|
2080
2080
|
enabled: options?.enabled
|
|
2081
2081
|
});
|
|
2082
2082
|
}
|
|
2083
2083
|
function useAvailableModels(options) {
|
|
2084
|
-
const arbi =
|
|
2084
|
+
const arbi = chunkSJZRVX7T_cjs.useArbi();
|
|
2085
2085
|
return reactQuery.useQuery({
|
|
2086
|
-
queryKey:
|
|
2086
|
+
queryKey: chunkSJZRVX7T_cjs.arbiQueryKeys.availableModels(),
|
|
2087
2087
|
queryFn: () => arbi.health.models(),
|
|
2088
2088
|
staleTime: Infinity,
|
|
2089
2089
|
enabled: (options?.enabled ?? true) && arbi.isLoggedIn
|
|
2090
2090
|
});
|
|
2091
2091
|
}
|
|
2092
2092
|
function useConfigs(options) {
|
|
2093
|
-
const arbi =
|
|
2093
|
+
const arbi = chunkSJZRVX7T_cjs.useArbi();
|
|
2094
2094
|
return reactQuery.useQuery({
|
|
2095
|
-
queryKey:
|
|
2095
|
+
queryKey: chunkSJZRVX7T_cjs.arbiQueryKeys.configVersions(),
|
|
2096
2096
|
queryFn: () => arbi.agentConfig.list(),
|
|
2097
2097
|
enabled: options?.enabled ?? arbi.isLoggedIn
|
|
2098
2098
|
});
|
|
2099
2099
|
}
|
|
2100
2100
|
function useConfig(configId, options) {
|
|
2101
|
-
const arbi =
|
|
2101
|
+
const arbi = chunkSJZRVX7T_cjs.useArbi();
|
|
2102
2102
|
return reactQuery.useQuery({
|
|
2103
|
-
queryKey:
|
|
2103
|
+
queryKey: chunkSJZRVX7T_cjs.arbiQueryKeys.config(configId ?? ""),
|
|
2104
2104
|
queryFn: () => arbi.agentConfig.get(configId),
|
|
2105
2105
|
staleTime: 10 * 60 * 1e3,
|
|
2106
2106
|
enabled: (options?.enabled ?? true) && !!configId && arbi.isLoggedIn
|
|
2107
2107
|
});
|
|
2108
2108
|
}
|
|
2109
2109
|
function useActivity(options) {
|
|
2110
|
-
const arbi =
|
|
2110
|
+
const arbi = chunkSJZRVX7T_cjs.useArbi();
|
|
2111
2111
|
return reactQuery.useQuery({
|
|
2112
|
-
queryKey:
|
|
2112
|
+
queryKey: chunkSJZRVX7T_cjs.arbiQueryKeys.activity(),
|
|
2113
2113
|
queryFn: () => arbi.dm.listActivity({ limit: options?.limit, offset: options?.offset }),
|
|
2114
2114
|
enabled: options?.enabled ?? arbi.isLoggedIn
|
|
2115
2115
|
});
|
|
2116
2116
|
}
|
|
2117
2117
|
function useWorkspaceActivity(workspaceId, options) {
|
|
2118
|
-
const arbi =
|
|
2118
|
+
const arbi = chunkSJZRVX7T_cjs.useArbi();
|
|
2119
2119
|
return reactQuery.useInfiniteQuery({
|
|
2120
|
-
queryKey:
|
|
2120
|
+
queryKey: chunkSJZRVX7T_cjs.arbiQueryKeys.workspaceActivity(workspaceId ?? "", options?.limit),
|
|
2121
2121
|
queryFn: async ({ pageParam }) => {
|
|
2122
2122
|
await options?.beforeFetch?.();
|
|
2123
2123
|
return arbi.workspaces.activity(workspaceId, {
|
|
@@ -2131,17 +2131,17 @@ function useWorkspaceActivity(workspaceId, options) {
|
|
|
2131
2131
|
});
|
|
2132
2132
|
}
|
|
2133
2133
|
function useProjects(options) {
|
|
2134
|
-
const arbi =
|
|
2134
|
+
const arbi = chunkSJZRVX7T_cjs.useArbi();
|
|
2135
2135
|
return reactQuery.useQuery({
|
|
2136
|
-
queryKey:
|
|
2136
|
+
queryKey: chunkSJZRVX7T_cjs.arbiQueryKeys.projects(),
|
|
2137
2137
|
queryFn: () => arbi.projects.list(),
|
|
2138
2138
|
enabled: options?.enabled ?? arbi.isLoggedIn
|
|
2139
2139
|
});
|
|
2140
2140
|
}
|
|
2141
2141
|
function useProjectUsage(projectExtId, monthsBack = 0, options) {
|
|
2142
|
-
const arbi =
|
|
2142
|
+
const arbi = chunkSJZRVX7T_cjs.useArbi();
|
|
2143
2143
|
const usage = reactQuery.useQuery({
|
|
2144
|
-
queryKey:
|
|
2144
|
+
queryKey: chunkSJZRVX7T_cjs.arbiQueryKeys.projectUsage(projectExtId ?? "", monthsBack),
|
|
2145
2145
|
queryFn: () => arbi.projects.usage(projectExtId, monthsBack),
|
|
2146
2146
|
enabled: (options?.enabled ?? true) && !!projectExtId && arbi.isLoggedIn
|
|
2147
2147
|
});
|
|
@@ -2151,17 +2151,17 @@ function useProjectUsage(projectExtId, monthsBack = 0, options) {
|
|
|
2151
2151
|
return { ...usage, metered };
|
|
2152
2152
|
}
|
|
2153
2153
|
function useProjectInvoices(projectExtId, options) {
|
|
2154
|
-
const arbi =
|
|
2154
|
+
const arbi = chunkSJZRVX7T_cjs.useArbi();
|
|
2155
2155
|
return reactQuery.useQuery({
|
|
2156
|
-
queryKey:
|
|
2156
|
+
queryKey: chunkSJZRVX7T_cjs.arbiQueryKeys.projectInvoices(projectExtId ?? ""),
|
|
2157
2157
|
queryFn: () => arbi.projects.invoices(projectExtId),
|
|
2158
2158
|
enabled: (options?.enabled ?? true) && !!projectExtId && arbi.isLoggedIn
|
|
2159
2159
|
});
|
|
2160
2160
|
}
|
|
2161
2161
|
function useCurrentUser(options) {
|
|
2162
|
-
const arbi =
|
|
2162
|
+
const arbi = chunkSJZRVX7T_cjs.useArbi();
|
|
2163
2163
|
return reactQuery.useQuery({
|
|
2164
|
-
queryKey:
|
|
2164
|
+
queryKey: chunkSJZRVX7T_cjs.arbiQueryKeys.currentUser(),
|
|
2165
2165
|
queryFn: () => arbi.user.me(),
|
|
2166
2166
|
enabled: options?.enabled ?? arbi.isLoggedIn,
|
|
2167
2167
|
refetchOnWindowFocus: true,
|
|
@@ -2169,9 +2169,9 @@ function useCurrentUser(options) {
|
|
|
2169
2169
|
});
|
|
2170
2170
|
}
|
|
2171
2171
|
function useFirmPool(options) {
|
|
2172
|
-
const arbi =
|
|
2172
|
+
const arbi = chunkSJZRVX7T_cjs.useArbi();
|
|
2173
2173
|
return reactQuery.useQuery({
|
|
2174
|
-
queryKey:
|
|
2174
|
+
queryKey: chunkSJZRVX7T_cjs.arbiQueryKeys.firmPool(),
|
|
2175
2175
|
queryFn: () => arbi.firm.pool(),
|
|
2176
2176
|
enabled: (options?.enabled ?? true) && arbi.isLoggedIn,
|
|
2177
2177
|
retry: false,
|
|
@@ -2222,9 +2222,9 @@ function useCanCreateWorkspaces() {
|
|
|
2222
2222
|
return me && (me.can_create_workspaces ?? me.can_create_projects);
|
|
2223
2223
|
}
|
|
2224
2224
|
function useUserUsageToday(options) {
|
|
2225
|
-
const arbi =
|
|
2225
|
+
const arbi = chunkSJZRVX7T_cjs.useArbi();
|
|
2226
2226
|
return reactQuery.useQuery({
|
|
2227
|
-
queryKey:
|
|
2227
|
+
queryKey: chunkSJZRVX7T_cjs.arbiQueryKeys.userUsageToday(),
|
|
2228
2228
|
queryFn: () => arbi.user.usageToday(),
|
|
2229
2229
|
enabled: (options?.enabled ?? true) && arbi.isLoggedIn,
|
|
2230
2230
|
refetchOnWindowFocus: true,
|
|
@@ -2252,7 +2252,7 @@ function writeLog(queryClient, key) {
|
|
|
2252
2252
|
return log;
|
|
2253
2253
|
}
|
|
2254
2254
|
function withLocalWrites(queryClient, workspaceId, rows, requestedAt) {
|
|
2255
|
-
return writeLog(queryClient,
|
|
2255
|
+
return writeLog(queryClient, chunkSJZRVX7T_cjs.arbiQueryKeys.conversations(workspaceId)).filter((w) => w.at >= requestedAt).reduce((list, w) => w.apply(list), rows);
|
|
2256
2256
|
}
|
|
2257
2257
|
async function readConversationList(queryClient, workspaceId, read) {
|
|
2258
2258
|
const requestedAt = Date.now();
|
|
@@ -2260,7 +2260,7 @@ async function readConversationList(queryClient, workspaceId, read) {
|
|
|
2260
2260
|
}
|
|
2261
2261
|
function seedConversationList(queryClient, workspaceId, rows, requestedAt) {
|
|
2262
2262
|
queryClient.setQueryData(
|
|
2263
|
-
|
|
2263
|
+
chunkSJZRVX7T_cjs.arbiQueryKeys.conversations(workspaceId),
|
|
2264
2264
|
withLocalWrites(queryClient, workspaceId, rows, requestedAt)
|
|
2265
2265
|
);
|
|
2266
2266
|
}
|
|
@@ -2279,7 +2279,7 @@ function patchLists(queryClient, reducer) {
|
|
|
2279
2279
|
}
|
|
2280
2280
|
function patchConversationList(queryClient, workspaceId, reducer) {
|
|
2281
2281
|
if (!workspaceId) return;
|
|
2282
|
-
const key =
|
|
2282
|
+
const key = chunkSJZRVX7T_cjs.arbiQueryKeys.conversations(workspaceId);
|
|
2283
2283
|
const current = queryClient.getQueryData(key) ?? [];
|
|
2284
2284
|
const next = reducer(current);
|
|
2285
2285
|
if (next !== current) writeList(queryClient, key, reducer, next);
|
|
@@ -2420,5 +2420,5 @@ exports.useUserUsageToday = useUserUsageToday;
|
|
|
2420
2420
|
exports.useWorkspaceActivity = useWorkspaceActivity;
|
|
2421
2421
|
exports.useWorkspaces = useWorkspaces;
|
|
2422
2422
|
exports.withLocalWrites = withLocalWrites;
|
|
2423
|
-
//# sourceMappingURL=chunk-
|
|
2424
|
-
//# sourceMappingURL=chunk-
|
|
2423
|
+
//# sourceMappingURL=chunk-BEOHXA2Z.cjs.map
|
|
2424
|
+
//# sourceMappingURL=chunk-BEOHXA2Z.cjs.map
|