@iblai/web-utils 1.1.9 → 1.1.11

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.
@@ -0,0 +1,311 @@
1
+ export declare const analyticsCustomSlice: import("@reduxjs/toolkit/query").Api<import("@reduxjs/toolkit/query").BaseQueryFn<import("../utils").CustomQueryArgs, unknown, import("../utils").ExtendedFetchBaseQueryError, Record<string, unknown>, import("@reduxjs/toolkit/query").FetchBaseQueryMeta>, {
2
+ getDownloadReportFromURL: import("@reduxjs/toolkit/query").QueryDefinition<{
3
+ url: string;
4
+ }, import("@reduxjs/toolkit/query").BaseQueryFn<import("../utils").CustomQueryArgs, unknown, import("../utils").ExtendedFetchBaseQueryError, Record<string, unknown>, import("@reduxjs/toolkit/query").FetchBaseQueryMeta>, "Analytics", Blob, "analyticsCustomApiSlice", unknown>;
5
+ }, "analyticsCustomApiSlice", "Analytics", typeof import("@reduxjs/toolkit/query").coreModuleName | typeof import("@reduxjs/toolkit/dist/query/react").reactHooksModuleName>;
6
+ export declare const useGetDownloadReportFromURLQuery: <R extends Record<string, any> = import("@reduxjs/toolkit/query").TSHelpersId<(Omit<{
7
+ status: import("@reduxjs/toolkit/query").QueryStatus.uninitialized;
8
+ originalArgs?: undefined | undefined;
9
+ data?: undefined | undefined;
10
+ error?: undefined | undefined;
11
+ requestId?: undefined | undefined;
12
+ endpointName?: string | undefined;
13
+ startedTimeStamp?: undefined | undefined;
14
+ fulfilledTimeStamp?: undefined | undefined;
15
+ } & {
16
+ currentData?: Blob | undefined;
17
+ isUninitialized: false;
18
+ isLoading: false;
19
+ isFetching: false;
20
+ isSuccess: false;
21
+ isError: false;
22
+ }, "isUninitialized"> & {
23
+ isUninitialized: true;
24
+ }) | import("@reduxjs/toolkit/query").TSHelpersOverride<import("@reduxjs/toolkit/query").QuerySubState<import("@reduxjs/toolkit/query").QueryDefinition<{
25
+ url: string;
26
+ }, import("@reduxjs/toolkit/query").BaseQueryFn<import("../utils").CustomQueryArgs, unknown, import("../utils").ExtendedFetchBaseQueryError, Record<string, unknown>, import("@reduxjs/toolkit/query").FetchBaseQueryMeta>, "Analytics", Blob, "analyticsCustomApiSlice", unknown>> & {
27
+ currentData?: Blob | undefined;
28
+ isUninitialized: false;
29
+ isLoading: false;
30
+ isFetching: false;
31
+ isSuccess: false;
32
+ isError: false;
33
+ }, {
34
+ isLoading: true;
35
+ isFetching: boolean;
36
+ data: undefined;
37
+ } | ({
38
+ isSuccess: true;
39
+ isFetching: true;
40
+ error: undefined;
41
+ } & Required<Pick<import("@reduxjs/toolkit/query").QuerySubState<import("@reduxjs/toolkit/query").QueryDefinition<{
42
+ url: string;
43
+ }, import("@reduxjs/toolkit/query").BaseQueryFn<import("../utils").CustomQueryArgs, unknown, import("../utils").ExtendedFetchBaseQueryError, Record<string, unknown>, import("@reduxjs/toolkit/query").FetchBaseQueryMeta>, "Analytics", Blob, "analyticsCustomApiSlice", unknown>> & {
44
+ currentData?: Blob | undefined;
45
+ isUninitialized: false;
46
+ isLoading: false;
47
+ isFetching: false;
48
+ isSuccess: false;
49
+ isError: false;
50
+ }, "data" | "fulfilledTimeStamp">>) | ({
51
+ isSuccess: true;
52
+ isFetching: false;
53
+ error: undefined;
54
+ } & Required<Pick<import("@reduxjs/toolkit/query").QuerySubState<import("@reduxjs/toolkit/query").QueryDefinition<{
55
+ url: string;
56
+ }, import("@reduxjs/toolkit/query").BaseQueryFn<import("../utils").CustomQueryArgs, unknown, import("../utils").ExtendedFetchBaseQueryError, Record<string, unknown>, import("@reduxjs/toolkit/query").FetchBaseQueryMeta>, "Analytics", Blob, "analyticsCustomApiSlice", unknown>> & {
57
+ currentData?: Blob | undefined;
58
+ isUninitialized: false;
59
+ isLoading: false;
60
+ isFetching: false;
61
+ isSuccess: false;
62
+ isError: false;
63
+ }, "data" | "fulfilledTimeStamp" | "currentData">>) | ({
64
+ isError: true;
65
+ } & Required<Pick<import("@reduxjs/toolkit/query").QuerySubState<import("@reduxjs/toolkit/query").QueryDefinition<{
66
+ url: string;
67
+ }, import("@reduxjs/toolkit/query").BaseQueryFn<import("../utils").CustomQueryArgs, unknown, import("../utils").ExtendedFetchBaseQueryError, Record<string, unknown>, import("@reduxjs/toolkit/query").FetchBaseQueryMeta>, "Analytics", Blob, "analyticsCustomApiSlice", unknown>> & {
68
+ currentData?: Blob | undefined;
69
+ isUninitialized: false;
70
+ isLoading: false;
71
+ isFetching: false;
72
+ isSuccess: false;
73
+ isError: false;
74
+ }, "error">>)>> & {
75
+ status: import("@reduxjs/toolkit/query").QueryStatus;
76
+ }>(arg: {
77
+ url: string;
78
+ } | typeof import("@reduxjs/toolkit/query").skipToken, options?: (import("@reduxjs/toolkit/query").SubscriptionOptions & {
79
+ skip?: boolean;
80
+ refetchOnMountOrArgChange?: boolean | number;
81
+ } & {
82
+ skip?: boolean;
83
+ selectFromResult?: ((state: import("@reduxjs/toolkit/query").TSHelpersId<(Omit<{
84
+ status: import("@reduxjs/toolkit/query").QueryStatus.uninitialized;
85
+ originalArgs?: undefined | undefined;
86
+ data?: undefined | undefined;
87
+ error?: undefined | undefined;
88
+ requestId?: undefined | undefined;
89
+ endpointName?: string | undefined;
90
+ startedTimeStamp?: undefined | undefined;
91
+ fulfilledTimeStamp?: undefined | undefined;
92
+ } & {
93
+ currentData?: Blob | undefined;
94
+ isUninitialized: false;
95
+ isLoading: false;
96
+ isFetching: false;
97
+ isSuccess: false;
98
+ isError: false;
99
+ }, "isUninitialized"> & {
100
+ isUninitialized: true;
101
+ }) | import("@reduxjs/toolkit/query").TSHelpersOverride<import("@reduxjs/toolkit/query").QuerySubState<import("@reduxjs/toolkit/query").QueryDefinition<{
102
+ url: string;
103
+ }, import("@reduxjs/toolkit/query").BaseQueryFn<import("../utils").CustomQueryArgs, unknown, import("../utils").ExtendedFetchBaseQueryError, Record<string, unknown>, import("@reduxjs/toolkit/query").FetchBaseQueryMeta>, "Analytics", Blob, "analyticsCustomApiSlice", unknown>> & {
104
+ currentData?: Blob | undefined;
105
+ isUninitialized: false;
106
+ isLoading: false;
107
+ isFetching: false;
108
+ isSuccess: false;
109
+ isError: false;
110
+ }, {
111
+ isLoading: true;
112
+ isFetching: boolean;
113
+ data: undefined;
114
+ } | ({
115
+ isSuccess: true;
116
+ isFetching: true;
117
+ error: undefined;
118
+ } & Required<Pick<import("@reduxjs/toolkit/query").QuerySubState<import("@reduxjs/toolkit/query").QueryDefinition<{
119
+ url: string;
120
+ }, import("@reduxjs/toolkit/query").BaseQueryFn<import("../utils").CustomQueryArgs, unknown, import("../utils").ExtendedFetchBaseQueryError, Record<string, unknown>, import("@reduxjs/toolkit/query").FetchBaseQueryMeta>, "Analytics", Blob, "analyticsCustomApiSlice", unknown>> & {
121
+ currentData?: Blob | undefined;
122
+ isUninitialized: false;
123
+ isLoading: false;
124
+ isFetching: false;
125
+ isSuccess: false;
126
+ isError: false;
127
+ }, "data" | "fulfilledTimeStamp">>) | ({
128
+ isSuccess: true;
129
+ isFetching: false;
130
+ error: undefined;
131
+ } & Required<Pick<import("@reduxjs/toolkit/query").QuerySubState<import("@reduxjs/toolkit/query").QueryDefinition<{
132
+ url: string;
133
+ }, import("@reduxjs/toolkit/query").BaseQueryFn<import("../utils").CustomQueryArgs, unknown, import("../utils").ExtendedFetchBaseQueryError, Record<string, unknown>, import("@reduxjs/toolkit/query").FetchBaseQueryMeta>, "Analytics", Blob, "analyticsCustomApiSlice", unknown>> & {
134
+ currentData?: Blob | undefined;
135
+ isUninitialized: false;
136
+ isLoading: false;
137
+ isFetching: false;
138
+ isSuccess: false;
139
+ isError: false;
140
+ }, "data" | "fulfilledTimeStamp" | "currentData">>) | ({
141
+ isError: true;
142
+ } & Required<Pick<import("@reduxjs/toolkit/query").QuerySubState<import("@reduxjs/toolkit/query").QueryDefinition<{
143
+ url: string;
144
+ }, import("@reduxjs/toolkit/query").BaseQueryFn<import("../utils").CustomQueryArgs, unknown, import("../utils").ExtendedFetchBaseQueryError, Record<string, unknown>, import("@reduxjs/toolkit/query").FetchBaseQueryMeta>, "Analytics", Blob, "analyticsCustomApiSlice", unknown>> & {
145
+ currentData?: Blob | undefined;
146
+ isUninitialized: false;
147
+ isLoading: false;
148
+ isFetching: false;
149
+ isSuccess: false;
150
+ isError: false;
151
+ }, "error">>)>> & {
152
+ status: import("@reduxjs/toolkit/query").QueryStatus;
153
+ }) => R) | undefined;
154
+ }) | undefined) => [R][R extends any ? 0 : never] & {
155
+ refetch: () => import("@reduxjs/toolkit/query").QueryActionCreatorResult<import("@reduxjs/toolkit/query").QueryDefinition<{
156
+ url: string;
157
+ }, import("@reduxjs/toolkit/query").BaseQueryFn<import("../utils").CustomQueryArgs, unknown, import("../utils").ExtendedFetchBaseQueryError, Record<string, unknown>, import("@reduxjs/toolkit/query").FetchBaseQueryMeta>, "Analytics", Blob, "analyticsCustomApiSlice", unknown>>;
158
+ }, useLazyGetDownloadReportFromURLQuery: <R extends Record<string, any> = import("@reduxjs/toolkit/query").TSHelpersId<(Omit<{
159
+ status: import("@reduxjs/toolkit/query").QueryStatus.uninitialized;
160
+ originalArgs?: undefined | undefined;
161
+ data?: undefined | undefined;
162
+ error?: undefined | undefined;
163
+ requestId?: undefined | undefined;
164
+ endpointName?: string | undefined;
165
+ startedTimeStamp?: undefined | undefined;
166
+ fulfilledTimeStamp?: undefined | undefined;
167
+ } & {
168
+ currentData?: Blob | undefined;
169
+ isUninitialized: false;
170
+ isLoading: false;
171
+ isFetching: false;
172
+ isSuccess: false;
173
+ isError: false;
174
+ }, "isUninitialized"> & {
175
+ isUninitialized: true;
176
+ }) | import("@reduxjs/toolkit/query").TSHelpersOverride<import("@reduxjs/toolkit/query").QuerySubState<import("@reduxjs/toolkit/query").QueryDefinition<{
177
+ url: string;
178
+ }, import("@reduxjs/toolkit/query").BaseQueryFn<import("../utils").CustomQueryArgs, unknown, import("../utils").ExtendedFetchBaseQueryError, Record<string, unknown>, import("@reduxjs/toolkit/query").FetchBaseQueryMeta>, "Analytics", Blob, "analyticsCustomApiSlice", unknown>> & {
179
+ currentData?: Blob | undefined;
180
+ isUninitialized: false;
181
+ isLoading: false;
182
+ isFetching: false;
183
+ isSuccess: false;
184
+ isError: false;
185
+ }, {
186
+ isLoading: true;
187
+ isFetching: boolean;
188
+ data: undefined;
189
+ } | ({
190
+ isSuccess: true;
191
+ isFetching: true;
192
+ error: undefined;
193
+ } & Required<Pick<import("@reduxjs/toolkit/query").QuerySubState<import("@reduxjs/toolkit/query").QueryDefinition<{
194
+ url: string;
195
+ }, import("@reduxjs/toolkit/query").BaseQueryFn<import("../utils").CustomQueryArgs, unknown, import("../utils").ExtendedFetchBaseQueryError, Record<string, unknown>, import("@reduxjs/toolkit/query").FetchBaseQueryMeta>, "Analytics", Blob, "analyticsCustomApiSlice", unknown>> & {
196
+ currentData?: Blob | undefined;
197
+ isUninitialized: false;
198
+ isLoading: false;
199
+ isFetching: false;
200
+ isSuccess: false;
201
+ isError: false;
202
+ }, "data" | "fulfilledTimeStamp">>) | ({
203
+ isSuccess: true;
204
+ isFetching: false;
205
+ error: undefined;
206
+ } & Required<Pick<import("@reduxjs/toolkit/query").QuerySubState<import("@reduxjs/toolkit/query").QueryDefinition<{
207
+ url: string;
208
+ }, import("@reduxjs/toolkit/query").BaseQueryFn<import("../utils").CustomQueryArgs, unknown, import("../utils").ExtendedFetchBaseQueryError, Record<string, unknown>, import("@reduxjs/toolkit/query").FetchBaseQueryMeta>, "Analytics", Blob, "analyticsCustomApiSlice", unknown>> & {
209
+ currentData?: Blob | undefined;
210
+ isUninitialized: false;
211
+ isLoading: false;
212
+ isFetching: false;
213
+ isSuccess: false;
214
+ isError: false;
215
+ }, "data" | "fulfilledTimeStamp" | "currentData">>) | ({
216
+ isError: true;
217
+ } & Required<Pick<import("@reduxjs/toolkit/query").QuerySubState<import("@reduxjs/toolkit/query").QueryDefinition<{
218
+ url: string;
219
+ }, import("@reduxjs/toolkit/query").BaseQueryFn<import("../utils").CustomQueryArgs, unknown, import("../utils").ExtendedFetchBaseQueryError, Record<string, unknown>, import("@reduxjs/toolkit/query").FetchBaseQueryMeta>, "Analytics", Blob, "analyticsCustomApiSlice", unknown>> & {
220
+ currentData?: Blob | undefined;
221
+ isUninitialized: false;
222
+ isLoading: false;
223
+ isFetching: false;
224
+ isSuccess: false;
225
+ isError: false;
226
+ }, "error">>)>> & {
227
+ status: import("@reduxjs/toolkit/query").QueryStatus;
228
+ }>(options?: (import("@reduxjs/toolkit/query").SubscriptionOptions & Omit<{
229
+ skip?: boolean;
230
+ selectFromResult?: ((state: import("@reduxjs/toolkit/query").TSHelpersId<(Omit<{
231
+ status: import("@reduxjs/toolkit/query").QueryStatus.uninitialized;
232
+ originalArgs?: undefined | undefined;
233
+ data?: undefined | undefined;
234
+ error?: undefined | undefined;
235
+ requestId?: undefined | undefined;
236
+ endpointName?: string | undefined;
237
+ startedTimeStamp?: undefined | undefined;
238
+ fulfilledTimeStamp?: undefined | undefined;
239
+ } & {
240
+ currentData?: Blob | undefined;
241
+ isUninitialized: false;
242
+ isLoading: false;
243
+ isFetching: false;
244
+ isSuccess: false;
245
+ isError: false;
246
+ }, "isUninitialized"> & {
247
+ isUninitialized: true;
248
+ }) | import("@reduxjs/toolkit/query").TSHelpersOverride<import("@reduxjs/toolkit/query").QuerySubState<import("@reduxjs/toolkit/query").QueryDefinition<{
249
+ url: string;
250
+ }, import("@reduxjs/toolkit/query").BaseQueryFn<import("../utils").CustomQueryArgs, unknown, import("../utils").ExtendedFetchBaseQueryError, Record<string, unknown>, import("@reduxjs/toolkit/query").FetchBaseQueryMeta>, "Analytics", Blob, "analyticsCustomApiSlice", unknown>> & {
251
+ currentData?: Blob | undefined;
252
+ isUninitialized: false;
253
+ isLoading: false;
254
+ isFetching: false;
255
+ isSuccess: false;
256
+ isError: false;
257
+ }, {
258
+ isLoading: true;
259
+ isFetching: boolean;
260
+ data: undefined;
261
+ } | ({
262
+ isSuccess: true;
263
+ isFetching: true;
264
+ error: undefined;
265
+ } & Required<Pick<import("@reduxjs/toolkit/query").QuerySubState<import("@reduxjs/toolkit/query").QueryDefinition<{
266
+ url: string;
267
+ }, import("@reduxjs/toolkit/query").BaseQueryFn<import("../utils").CustomQueryArgs, unknown, import("../utils").ExtendedFetchBaseQueryError, Record<string, unknown>, import("@reduxjs/toolkit/query").FetchBaseQueryMeta>, "Analytics", Blob, "analyticsCustomApiSlice", unknown>> & {
268
+ currentData?: Blob | undefined;
269
+ isUninitialized: false;
270
+ isLoading: false;
271
+ isFetching: false;
272
+ isSuccess: false;
273
+ isError: false;
274
+ }, "data" | "fulfilledTimeStamp">>) | ({
275
+ isSuccess: true;
276
+ isFetching: false;
277
+ error: undefined;
278
+ } & Required<Pick<import("@reduxjs/toolkit/query").QuerySubState<import("@reduxjs/toolkit/query").QueryDefinition<{
279
+ url: string;
280
+ }, import("@reduxjs/toolkit/query").BaseQueryFn<import("../utils").CustomQueryArgs, unknown, import("../utils").ExtendedFetchBaseQueryError, Record<string, unknown>, import("@reduxjs/toolkit/query").FetchBaseQueryMeta>, "Analytics", Blob, "analyticsCustomApiSlice", unknown>> & {
281
+ currentData?: Blob | undefined;
282
+ isUninitialized: false;
283
+ isLoading: false;
284
+ isFetching: false;
285
+ isSuccess: false;
286
+ isError: false;
287
+ }, "data" | "fulfilledTimeStamp" | "currentData">>) | ({
288
+ isError: true;
289
+ } & Required<Pick<import("@reduxjs/toolkit/query").QuerySubState<import("@reduxjs/toolkit/query").QueryDefinition<{
290
+ url: string;
291
+ }, import("@reduxjs/toolkit/query").BaseQueryFn<import("../utils").CustomQueryArgs, unknown, import("../utils").ExtendedFetchBaseQueryError, Record<string, unknown>, import("@reduxjs/toolkit/query").FetchBaseQueryMeta>, "Analytics", Blob, "analyticsCustomApiSlice", unknown>> & {
292
+ currentData?: Blob | undefined;
293
+ isUninitialized: false;
294
+ isLoading: false;
295
+ isFetching: false;
296
+ isSuccess: false;
297
+ isError: false;
298
+ }, "error">>)>> & {
299
+ status: import("@reduxjs/toolkit/query").QueryStatus;
300
+ }) => R) | undefined;
301
+ }, "skip">) | undefined) => [(arg: {
302
+ url: string;
303
+ }, preferCacheValue?: boolean) => import("@reduxjs/toolkit/query").QueryActionCreatorResult<import("@reduxjs/toolkit/query").QueryDefinition<{
304
+ url: string;
305
+ }, import("@reduxjs/toolkit/query").BaseQueryFn<import("../utils").CustomQueryArgs, unknown, import("../utils").ExtendedFetchBaseQueryError, Record<string, unknown>, import("@reduxjs/toolkit/query").FetchBaseQueryMeta>, "Analytics", Blob, "analyticsCustomApiSlice", unknown>>, [R][R extends any ? 0 : never] & {
306
+ reset: () => void;
307
+ }, {
308
+ lastArg: {
309
+ url: string;
310
+ };
311
+ }];
@@ -30,6 +30,7 @@ export * from './features/sessions/api-slice';
30
30
  export * from './features/datasets/api-slice';
31
31
  export * from './features/tools/api-slice';
32
32
  export * from './features/analytics/api-slice';
33
+ export * from './features/analytics/custom-api-slice';
33
34
  export * from './features/analytics/types';
34
35
  export * from './features/reports/api-slice';
35
36
  export * from './features/catalog/api-slice';
package/dist/index.d.ts CHANGED
@@ -8,7 +8,6 @@ import { OpUnitType } from 'dayjs';
8
8
  import duration from 'dayjs/plugin/duration';
9
9
  import { ChatStatus as ChatStatus$1 } from '@web-utils/features';
10
10
  import { Error402MessageData as Error402MessageData$1, Tenant as Tenant$3 } from '@web-utils/types';
11
- import * as redux from 'redux';
12
11
  import * as _reduxjs_toolkit from '@reduxjs/toolkit';
13
12
  import { Slice } from '@reduxjs/toolkit';
14
13
  import * as react_jsx_runtime from 'react/jsx-runtime';
@@ -809,7 +808,7 @@ declare function handleLogout(options: HandleLogoutOptions): void;
809
808
 
810
809
  declare const isReactNative: () => boolean;
811
810
  declare const isWeb: () => boolean;
812
- declare const isNode: () => string | false;
811
+ declare const isNode: () => any;
813
812
  declare const isExpo: () => any;
814
813
  declare const isTauri: () => boolean;
815
814
  declare const getPlatform: () => "web" | "react-native" | "node" | "unknown";
@@ -869,7 +868,7 @@ type ChatSliceState = {
869
868
  lastArtifactContentFlushTime: number;
870
869
  };
871
870
  declare const chatActions: _reduxjs_toolkit.CaseReducerActions<_reduxjs_toolkit.SliceCaseReducers<ChatSliceState>, string>;
872
- declare const chatSliceReducerShared: redux.Reducer<ChatSliceState>;
871
+ declare const chatSliceReducerShared: Reducer<State>;
873
872
  declare const selectChats: (state: {
874
873
  chatSliceShared: ChatSliceState;
875
874
  }) => ChatState;
@@ -1038,7 +1037,7 @@ declare const updateFileUrl: _reduxjs_toolkit.ActionCreatorWithoutPayload<`${str
1038
1037
  declare const updateFileMetadata: _reduxjs_toolkit.ActionCreatorWithoutPayload<`${string}/${string}`> | _reduxjs_toolkit.ActionCreatorWithPayload<any, `${string}/${string}`> | _reduxjs_toolkit.ActionCreatorWithPreparedPayload<any[], any, `${string}/${string}`, never, never> | _reduxjs_toolkit.ActionCreatorWithPreparedPayload<any[], any, `${string}/${string}`, never, any> | _reduxjs_toolkit.ActionCreatorWithPreparedPayload<any[], any, `${string}/${string}`, any, never> | _reduxjs_toolkit.ActionCreatorWithPreparedPayload<any[], any, `${string}/${string}`, any, any>;
1039
1038
  declare const updateFileRetryCount: _reduxjs_toolkit.ActionCreatorWithoutPayload<`${string}/${string}`> | _reduxjs_toolkit.ActionCreatorWithPayload<any, `${string}/${string}`> | _reduxjs_toolkit.ActionCreatorWithPreparedPayload<any[], any, `${string}/${string}`, never, never> | _reduxjs_toolkit.ActionCreatorWithPreparedPayload<any[], any, `${string}/${string}`, never, any> | _reduxjs_toolkit.ActionCreatorWithPreparedPayload<any[], any, `${string}/${string}`, any, never> | _reduxjs_toolkit.ActionCreatorWithPreparedPayload<any[], any, `${string}/${string}`, any, any>;
1040
1039
  declare const updateFileUrlFromWebSocket: _reduxjs_toolkit.ActionCreatorWithoutPayload<`${string}/${string}`> | _reduxjs_toolkit.ActionCreatorWithPayload<any, `${string}/${string}`> | _reduxjs_toolkit.ActionCreatorWithPreparedPayload<any[], any, `${string}/${string}`, never, never> | _reduxjs_toolkit.ActionCreatorWithPreparedPayload<any[], any, `${string}/${string}`, never, any> | _reduxjs_toolkit.ActionCreatorWithPreparedPayload<any[], any, `${string}/${string}`, any, never> | _reduxjs_toolkit.ActionCreatorWithPreparedPayload<any[], any, `${string}/${string}`, any, any>;
1041
- declare const filesReducer: redux.Reducer<FilesState>;
1040
+ declare const filesReducer: Reducer<State>;
1042
1041
 
1043
1042
  /**
1044
1043
  * Combines multiple CSV data objects by merging rows based on a common column.
@@ -1200,8 +1199,9 @@ type Props$5 = {
1200
1199
  onOAuthResolved?: (data: OAuthResolvedData) => void;
1201
1200
  isOffline?: boolean;
1202
1201
  onOfflineWithoutLocalLLM?: () => void;
1202
+ isPublicRoute?: boolean;
1203
1203
  };
1204
- declare function useAdvancedChat({ tenantKey, mentorId, username, token, wsUrl, stopGenerationWsUrl, redirectToAuthSpa, errorHandler, sendMessageToParentWebsite, isPreviewMode, mentorShareableToken, on402Error, cachedSessionId, onStartNewChat, onOAuthRequired, onOAuthResolved, isOffline, onOfflineWithoutLocalLLM, }: Props$5): {
1204
+ declare function useAdvancedChat({ tenantKey, mentorId, username, token, wsUrl, stopGenerationWsUrl, redirectToAuthSpa, errorHandler, sendMessageToParentWebsite, isPreviewMode, mentorShareableToken, on402Error, cachedSessionId, onStartNewChat, onOAuthRequired, onOAuthResolved, isOffline, onOfflineWithoutLocalLLM, isPublicRoute, }: Props$5): {
1205
1205
  messages: Message[];
1206
1206
  isStreaming: boolean;
1207
1207
  status: ChatStatus;
@@ -1236,8 +1236,9 @@ type Props$4 = {
1236
1236
  mentorId: string;
1237
1237
  username: string;
1238
1238
  errorHandler?: (message: string, error?: any) => void;
1239
+ isPublicRoute?: boolean;
1239
1240
  };
1240
- declare function useMentorTools({ tenantKey, mentorId, username, errorHandler, }: Props$4): {
1241
+ declare function useMentorTools({ tenantKey, mentorId, username, errorHandler, isPublicRoute, }: Props$4): {
1241
1242
  tools: any;
1242
1243
  activeTools: string[];
1243
1244
  updateSessionTools: (tool: string) => Promise<void>;
@@ -1411,6 +1412,7 @@ type Props$3 = {
1411
1412
  mentorId: string;
1412
1413
  tenantKey: string;
1413
1414
  username: string;
1415
+ isPublicRoute?: boolean;
1414
1416
  };
1415
1417
  type MentorSettingsData = {
1416
1418
  profileImage?: string | null;
@@ -1430,7 +1432,7 @@ type MentorSettingsData = {
1430
1432
  type UseMentorSettingsReturn = {
1431
1433
  data: MentorSettingsData;
1432
1434
  };
1433
- declare function useMentorSettings({ mentorId, tenantKey, username, }: Props$3): UseMentorSettingsReturn;
1435
+ declare function useMentorSettings({ mentorId, tenantKey, username, isPublicRoute, }: Props$3): UseMentorSettingsReturn;
1434
1436
 
1435
1437
  /**
1436
1438
  * Sync authentication state to cookies (web only)
package/dist/index.esm.js CHANGED
@@ -3419,6 +3419,13 @@ function TenantProvider({ children, fallback, onAuthSuccess, onAuthFailure, curr
3419
3419
  // user is not authenticated so we don't need to do anything that concerns an authenticated user
3420
3420
  return;
3421
3421
  }
3422
+ // Logged-in user on a public route (e.g. shareable link) visiting another tenant
3423
+ // — treat as visitor, skip tenant join/token/RBAC calls that will 403
3424
+ if (userIsAccessingPublicRoute) {
3425
+ saveVisitingTenant === null || saveVisitingTenant === void 0 ? void 0 : saveVisitingTenant(newCurrentTenant);
3426
+ setIsLoading(false);
3427
+ return;
3428
+ }
3422
3429
  const { data: tenants } = await fetchUserTenants();
3423
3430
  const enhancedTenants = await enhanceTenants(tenants, data);
3424
3431
  saveUserTenants(enhancedTenants);
@@ -3436,10 +3443,10 @@ function TenantProvider({ children, fallback, onAuthSuccess, onAuthFailure, curr
3436
3443
  }
3437
3444
  if (currentTenant && currentTenant !== tenantKey) {
3438
3445
  setTenantKey(data.platform_key);
3439
- const rbacPermissions = await loadPlatformPermissions(data.platform_key);
3440
- onLoadPlatformPermissions === null || onLoadPlatformPermissions === void 0 ? void 0 : onLoadPlatformPermissions(rbacPermissions);
3441
3446
  const userAlreadyInTenant = enhancedTenants === null || enhancedTenants === void 0 ? void 0 : enhancedTenants.find((t) => t.key === tenantKey);
3442
3447
  if (userAlreadyInTenant) {
3448
+ const rbacPermissions = await loadPlatformPermissions(data.platform_key);
3449
+ onLoadPlatformPermissions === null || onLoadPlatformPermissions === void 0 ? void 0 : onLoadPlatformPermissions(rbacPermissions);
3443
3450
  const formData = new FormData();
3444
3451
  formData.append("platform_key", tenantKey);
3445
3452
  const { data: tokenResponse } = await getAppToken(formData).unwrap();
@@ -3470,6 +3477,8 @@ function TenantProvider({ children, fallback, onAuthSuccess, onAuthFailure, curr
3470
3477
  else {
3471
3478
  // TODO: What happense when if for any reason we fetch tenants and it's an empty list
3472
3479
  }
3480
+ const rbacPermissions = await loadPlatformPermissions(data.platform_key);
3481
+ onLoadPlatformPermissions === null || onLoadPlatformPermissions === void 0 ? void 0 : onLoadPlatformPermissions(rbacPermissions);
3473
3482
  onAutoJoinUserToTenant === null || onAutoJoinUserToTenant === void 0 ? void 0 : onAutoJoinUserToTenant((_c = data.platform_name) !== null && _c !== void 0 ? _c : data === null || data === void 0 ? void 0 : data.platform_key.toUpperCase());
3474
3483
  saveTenant === null || saveTenant === void 0 ? void 0 : saveTenant(tenantKey);
3475
3484
  setUserIsAccessingPublicRoute(false);
@@ -3941,7 +3950,7 @@ function MentorProvider({ children, fallback, onAuthSuccess, onAuthFailure, redi
3941
3950
  mentorDbId = await getMentorDbId(mentor);
3942
3951
  }
3943
3952
  // Load permissions if we have a mentor DB ID and user is logged in
3944
- if (mentorDbId && isLoggedIn) {
3953
+ if (mentorDbId && isLoggedIn && !userIsAccessingPublicRoute) {
3945
3954
  const rbacPermissions = await loadMentorsPermissions(mentorDbId);
3946
3955
  onLoadMentorsPermissions === null || onLoadMentorsPermissions === void 0 ? void 0 : onLoadMentorsPermissions(rbacPermissions);
3947
3956
  }
@@ -3988,7 +3997,9 @@ function MentorProvider({ children, fallback, onAuthSuccess, onAuthFailure, redi
3988
3997
  }
3989
3998
  else {
3990
3999
  console.log("requested mentor exists in tenant, proceeding", requestedMentorId);
3991
- if (requestedMentorDbId && isLoggedIn) {
4000
+ if (requestedMentorDbId &&
4001
+ isLoggedIn &&
4002
+ !userIsAccessingPublicRoute) {
3992
4003
  const rbacPermissions = await loadMentorsPermissions(requestedMentorDbId);
3993
4004
  onLoadMentorsPermissions === null || onLoadMentorsPermissions === void 0 ? void 0 : onLoadMentorsPermissions(rbacPermissions);
3994
4005
  }
@@ -6943,6 +6954,10 @@ const useChat = ({ wsUrl, wsToken, flowConfig, sessionId, stopGenerationWsUrl, e
6943
6954
  const ws = useRef(null);
6944
6955
  const isConnected = useRef(false);
6945
6956
  const messageQueue = useRef([]);
6957
+ // Keep sessionId in a ref so sendMessage always reads the latest value,
6958
+ // avoiding stale closures when Redux updates sessionIds between renders.
6959
+ const sessionIdRef = useRef(sessionId);
6960
+ sessionIdRef.current = sessionId;
6946
6961
  const currentStreamingMessage = useRef({
6947
6962
  id: null,
6948
6963
  content: "",
@@ -7883,9 +7898,19 @@ const useChat = ({ wsUrl, wsToken, flowConfig, sessionId, stopGenerationWsUrl, e
7883
7898
  onStatusChange("error");
7884
7899
  return;
7885
7900
  }
7901
+ // Guard against sending messages without a session ID.
7902
+ // This can happen due to race conditions (e.g., user sends before
7903
+ // createSessionId API returns, or stale closure after tab change).
7904
+ const currentSessionId = sessionIdRef.current;
7905
+ if (!currentSessionId) {
7906
+ console.warn("[sendMessage] No session ID available, cannot send message");
7907
+ onStatusChange("error");
7908
+ errorHandler === null || errorHandler === void 0 ? void 0 : errorHandler("Chat session not ready. Please try again.");
7909
+ return;
7910
+ }
7886
7911
  let messageData = {
7887
7912
  flow: flowConfig,
7888
- session_id: sessionId,
7913
+ session_id: currentSessionId,
7889
7914
  token: wsToken,
7890
7915
  prompt: text || "", // Allow empty prompt when sending files
7891
7916
  };
@@ -7958,7 +7983,6 @@ const useChat = ({ wsUrl, wsToken, flowConfig, sessionId, stopGenerationWsUrl, e
7958
7983
  }
7959
7984
  }, [
7960
7985
  flowConfig,
7961
- sessionId,
7962
7986
  wsToken,
7963
7987
  store,
7964
7988
  triggerHapticFeedback,
@@ -15528,6 +15552,24 @@ createApi({
15528
15552
  }),
15529
15553
  });
15530
15554
 
15555
+ createApi({
15556
+ reducerPath: 'analyticsCustomApiSlice',
15557
+ baseQuery: iblFetchBaseQuery,
15558
+ tagTypes: ['Analytics'],
15559
+ endpoints: (builder) => ({
15560
+ getDownloadReportFromURL: builder.query({
15561
+ query: ({ url }) => ({
15562
+ url: url,
15563
+ service: SERVICES.DM,
15564
+ method: 'GET',
15565
+ responseHandler: (response) => response.blob(),
15566
+ }),
15567
+ // Blobs are non-serializable; disable caching to prevent Redux serialization warnings
15568
+ keepUnusedDataFor: 0,
15569
+ }),
15570
+ }),
15571
+ });
15572
+
15531
15573
  createApi({
15532
15574
  reducerPath: 'reportsApiSlice',
15533
15575
  baseQuery: iblFakeBaseQuery,
@@ -17318,8 +17360,8 @@ createApi({
17318
17360
  }),
17319
17361
  });
17320
17362
 
17321
- function useMentorSettings({ mentorId, tenantKey, username, }) {
17322
- var _a, _b, _c, _d;
17363
+ function useMentorSettings({ mentorId, tenantKey, username, isPublicRoute, }) {
17364
+ var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m, _o, _p;
17323
17365
  const isLoggedIn = username !== ANONYMOUS_USERNAME;
17324
17366
  const { data: mentorSettings } = useGetMentorSettingsQuery({
17325
17367
  mentor: mentorId,
@@ -17327,7 +17369,7 @@ function useMentorSettings({ mentorId, tenantKey, username, }) {
17327
17369
  // @ts-expect-error - userId is passed but not in generated API types
17328
17370
  userId: username !== null && username !== void 0 ? username : "",
17329
17371
  }, {
17330
- skip: !username || !isLoggedIn,
17372
+ skip: !username || !isLoggedIn || !!isPublicRoute,
17331
17373
  });
17332
17374
  const { data: mentorPublicSettings } = useGetMentorPublicSettingsQuery({
17333
17375
  mentor: mentorId,
@@ -17339,44 +17381,26 @@ function useMentorSettings({ mentorId, tenantKey, username, }) {
17339
17381
  });
17340
17382
  return {
17341
17383
  data: {
17342
- profileImage: isLoggedIn
17343
- ? mentorSettings === null || mentorSettings === void 0 ? void 0 : mentorSettings.profile_image
17344
- : mentorPublicSettings === null || mentorPublicSettings === void 0 ? void 0 : mentorPublicSettings.profile_image,
17345
- greetingMethod: isLoggedIn
17346
- ? mentorSettings === null || mentorSettings === void 0 ? void 0 : mentorSettings.greeting_method
17347
- : mentorPublicSettings === null || mentorPublicSettings === void 0 ? void 0 : mentorPublicSettings.greeting_method,
17348
- proactiveResponse: isLoggedIn
17349
- ? mentorSettings === null || mentorSettings === void 0 ? void 0 : mentorSettings.proactive_response
17350
- : mentorPublicSettings === null || mentorPublicSettings === void 0 ? void 0 : mentorPublicSettings.proactive_response,
17351
- llmProvider: isLoggedIn ? mentorSettings === null || mentorSettings === void 0 ? void 0 : mentorSettings.llm_provider : "",
17352
- llmName: isLoggedIn
17353
- ? mentorSettings === null || mentorSettings === void 0 ? void 0 : mentorSettings.llm_name
17354
- : mentorPublicSettings === null || mentorPublicSettings === void 0 ? void 0 : mentorPublicSettings.llm_name,
17355
- mentorUniqueId: isLoggedIn
17356
- ? mentorSettings === null || mentorSettings === void 0 ? void 0 : mentorSettings.mentor_unique_id
17357
- : mentorPublicSettings === null || mentorPublicSettings === void 0 ? void 0 : mentorPublicSettings.mentor_unique_id,
17358
- mentorVisibility: isLoggedIn
17359
- ? mentorSettings === null || mentorSettings === void 0 ? void 0 : mentorSettings.mentor_visibility
17360
- : mentorPublicSettings === null || mentorPublicSettings === void 0 ? void 0 : mentorPublicSettings.mentor_visibility,
17361
- mentorName: (_a = mentorSettings === null || mentorSettings === void 0 ? void 0 : mentorSettings.mentor) !== null && _a !== void 0 ? _a : mentorPublicSettings === null || mentorPublicSettings === void 0 ? void 0 : mentorPublicSettings.mentor,
17362
- enableGuidedPrompts: isLoggedIn
17363
- ? mentorSettings === null || mentorSettings === void 0 ? void 0 : mentorSettings.enable_guided_prompts
17364
- : mentorPublicSettings === null || mentorPublicSettings === void 0 ? void 0 : mentorPublicSettings.enable_guided_prompts,
17365
- mentorSlug: isLoggedIn
17366
- ? mentorSettings === null || mentorSettings === void 0 ? void 0 : mentorSettings.mentor_slug
17367
- : mentorPublicSettings === null || mentorPublicSettings === void 0 ? void 0 : mentorPublicSettings.mentor_slug,
17368
- safetyDisclaimer: isLoggedIn
17369
- ? (_b = mentorSettings === null || mentorSettings === void 0 ? void 0 : mentorSettings.metadata) === null || _b === void 0 ? void 0 : _b.safety_disclaimer
17370
- : (_c = mentorPublicSettings === null || mentorPublicSettings === void 0 ? void 0 : mentorPublicSettings.metadata) === null || _c === void 0 ? void 0 : _c.safety_disclaimer,
17371
- mentorTools: isLoggedIn
17372
- ? mentorSettings === null || mentorSettings === void 0 ? void 0 : mentorSettings.mentor_tools
17373
- : mentorPublicSettings === null || mentorPublicSettings === void 0 ? void 0 : mentorPublicSettings.mentor_tools,
17374
- allowAnonymous: (_d = mentorSettings === null || mentorSettings === void 0 ? void 0 : mentorSettings.allow_anonymous) !== null && _d !== void 0 ? _d : mentorPublicSettings === null || mentorPublicSettings === void 0 ? void 0 : mentorPublicSettings.allow_anonymous,
17384
+ profileImage: (_a = mentorSettings === null || mentorSettings === void 0 ? void 0 : mentorSettings.profile_image) !== null && _a !== void 0 ? _a : mentorPublicSettings === null || mentorPublicSettings === void 0 ? void 0 : mentorPublicSettings.profile_image,
17385
+ greetingMethod: (_b = mentorSettings === null || mentorSettings === void 0 ? void 0 : mentorSettings.greeting_method) !== null && _b !== void 0 ? _b : mentorPublicSettings === null || mentorPublicSettings === void 0 ? void 0 : mentorPublicSettings.greeting_method,
17386
+ proactiveResponse: (_c = mentorSettings === null || mentorSettings === void 0 ? void 0 : mentorSettings.proactive_response) !== null && _c !== void 0 ? _c : mentorPublicSettings === null || mentorPublicSettings === void 0 ? void 0 : mentorPublicSettings.proactive_response,
17387
+ llmProvider: (mentorSettings === null || mentorSettings === void 0 ? void 0 : mentorSettings.llm_provider) ||
17388
+ (mentorPublicSettings === null || mentorPublicSettings === void 0 ? void 0 : mentorPublicSettings.llm_provider) ||
17389
+ "",
17390
+ llmName: (_d = mentorSettings === null || mentorSettings === void 0 ? void 0 : mentorSettings.llm_name) !== null && _d !== void 0 ? _d : mentorPublicSettings === null || mentorPublicSettings === void 0 ? void 0 : mentorPublicSettings.llm_name,
17391
+ mentorUniqueId: (_e = mentorSettings === null || mentorSettings === void 0 ? void 0 : mentorSettings.mentor_unique_id) !== null && _e !== void 0 ? _e : mentorPublicSettings === null || mentorPublicSettings === void 0 ? void 0 : mentorPublicSettings.mentor_unique_id,
17392
+ mentorVisibility: (_f = mentorSettings === null || mentorSettings === void 0 ? void 0 : mentorSettings.mentor_visibility) !== null && _f !== void 0 ? _f : mentorPublicSettings === null || mentorPublicSettings === void 0 ? void 0 : mentorPublicSettings.mentor_visibility,
17393
+ mentorName: (_g = mentorSettings === null || mentorSettings === void 0 ? void 0 : mentorSettings.mentor) !== null && _g !== void 0 ? _g : mentorPublicSettings === null || mentorPublicSettings === void 0 ? void 0 : mentorPublicSettings.mentor,
17394
+ enableGuidedPrompts: (_h = mentorSettings === null || mentorSettings === void 0 ? void 0 : mentorSettings.enable_guided_prompts) !== null && _h !== void 0 ? _h : mentorPublicSettings === null || mentorPublicSettings === void 0 ? void 0 : mentorPublicSettings.enable_guided_prompts,
17395
+ mentorSlug: (_j = mentorSettings === null || mentorSettings === void 0 ? void 0 : mentorSettings.mentor_slug) !== null && _j !== void 0 ? _j : mentorPublicSettings === null || mentorPublicSettings === void 0 ? void 0 : mentorPublicSettings.mentor_slug,
17396
+ safetyDisclaimer: (_l = (_k = mentorSettings === null || mentorSettings === void 0 ? void 0 : mentorSettings.metadata) === null || _k === void 0 ? void 0 : _k.safety_disclaimer) !== null && _l !== void 0 ? _l : (_m = mentorPublicSettings === null || mentorPublicSettings === void 0 ? void 0 : mentorPublicSettings.metadata) === null || _m === void 0 ? void 0 : _m.safety_disclaimer,
17397
+ mentorTools: (_o = mentorSettings === null || mentorSettings === void 0 ? void 0 : mentorSettings.mentor_tools) !== null && _o !== void 0 ? _o : mentorPublicSettings === null || mentorPublicSettings === void 0 ? void 0 : mentorPublicSettings.mentor_tools,
17398
+ allowAnonymous: (_p = mentorSettings === null || mentorSettings === void 0 ? void 0 : mentorSettings.allow_anonymous) !== null && _p !== void 0 ? _p : mentorPublicSettings === null || mentorPublicSettings === void 0 ? void 0 : mentorPublicSettings.allow_anonymous,
17375
17399
  },
17376
17400
  };
17377
17401
  }
17378
17402
 
17379
- function useAdvancedChat({ tenantKey, mentorId, username = ANONYMOUS_USERNAME, token, wsUrl, stopGenerationWsUrl, redirectToAuthSpa, errorHandler, sendMessageToParentWebsite, isPreviewMode, mentorShareableToken, on402Error, cachedSessionId, onStartNewChat, onOAuthRequired, onOAuthResolved, isOffline = false, onOfflineWithoutLocalLLM, }) {
17403
+ function useAdvancedChat({ tenantKey, mentorId, username = ANONYMOUS_USERNAME, token, wsUrl, stopGenerationWsUrl, redirectToAuthSpa, errorHandler, sendMessageToParentWebsite, isPreviewMode, mentorShareableToken, on402Error, cachedSessionId, onStartNewChat, onOAuthRequired, onOAuthResolved, isOffline = false, onOfflineWithoutLocalLLM, isPublicRoute, }) {
17380
17404
  var _a, _b, _c, _d;
17381
17405
  const dispatch = useDispatch();
17382
17406
  const [createSessionId, { isLoading: isLoadingSessionIds }] = useCreateSessionIdMutation();
@@ -17396,6 +17420,7 @@ function useAdvancedChat({ tenantKey, mentorId, username = ANONYMOUS_USERNAME, t
17396
17420
  mentorId,
17397
17421
  tenantKey,
17398
17422
  username,
17423
+ isPublicRoute,
17399
17424
  });
17400
17425
  const onStreamingChange = (streamingState) => {
17401
17426
  dispatch(chatActions.setStreaming(streamingState));
@@ -17708,26 +17733,30 @@ function hasTool(tools, mentorSettings, toolSlug) {
17708
17733
  // Check if the specific tool exists in both available tools and enabled tools
17709
17734
  return tools.some((tool) => tool.slug === toolSlug && enabledToolSlugs.has(tool.slug));
17710
17735
  }
17711
- function useMentorTools({ tenantKey, mentorId, username = ANONYMOUS_USERNAME, errorHandler, }) {
17736
+ function useMentorTools({ tenantKey, mentorId, username = ANONYMOUS_USERNAME, errorHandler, isPublicRoute, }) {
17712
17737
  var _a;
17713
17738
  const dispatch = useDispatch();
17714
17739
  const activeTools = useSelector(selectTools);
17715
17740
  const artifactsEnabled = useSelector(selectArtifactsEnabled);
17716
17741
  const sessionId = useSelector(selectSessionId);
17717
17742
  const [editSession] = useEditSessionMutation();
17718
- const { data: tools } = useGetToolsQuery({
17743
+ const { data: apiTools } = useGetToolsQuery({
17719
17744
  mentor: mentorId,
17720
17745
  org: tenantKey,
17721
17746
  // @ts-expect-error - userId is passed but not in generated API types
17722
17747
  userId: username !== null && username !== void 0 ? username : "",
17723
17748
  }, {
17724
- skip: !username || username === ANONYMOUS_USERNAME,
17749
+ skip: !username || username === ANONYMOUS_USERNAME || !!isPublicRoute,
17725
17750
  });
17726
17751
  const { data: mentorSettings } = useMentorSettings({
17727
17752
  mentorId,
17728
17753
  tenantKey,
17729
17754
  username,
17755
+ isPublicRoute,
17730
17756
  });
17757
+ // Fall back to mentor_tools from public settings when available-tools endpoint
17758
+ // is blocked by RBAC (403). This ensures shareable link users see tool buttons.
17759
+ const tools = apiTools !== null && apiTools !== void 0 ? apiTools : mentorSettings === null || mentorSettings === void 0 ? void 0 : mentorSettings.mentorTools;
17731
17760
  const { data: prompts } = useGetPromptsSearchQuery({
17732
17761
  org: tenantKey,
17733
17762
  username: username !== null && username !== void 0 ? username : "",
@@ -17737,7 +17766,7 @@ function useMentorTools({ tenantKey, mentorId, username = ANONYMOUS_USERNAME, er
17737
17766
  mentor: mentorId,
17738
17767
  orderDirection: "asc",
17739
17768
  }, {
17740
- skip: !tenantKey || !username || !mentorId,
17769
+ skip: !tenantKey || !username || !mentorId || !!isPublicRoute,
17741
17770
  });
17742
17771
  const updateSessionTools = async (tool) => {
17743
17772
  let toolsToAdd = activeTools;