@iblai/data-layer 1.17.0 → 1.18.1

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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@iblai/data-layer",
3
- "version": "1.16.0",
3
+ "version": "1.18.0",
4
4
  "description": "ibl.ai data layer",
5
5
  "main": "dist/index.esm.js",
6
6
  "types": "dist/index.d.ts",
@@ -67,6 +67,12 @@ export interface TranscriptsMessagesDetailsResponse {
67
67
  mentor: string;
68
68
  mentor_unique_id: string;
69
69
  model: string;
70
+ /**
71
+ * Provider key of `model` (e.g. `openai`), as the per-turn
72
+ * `metadata.llm_provider` names it. Not sent by the backend yet; when it
73
+ * is, the transcript badge resolves its logo from it directly.
74
+ */
75
+ llm_provider?: string | null;
70
76
  username: string;
71
77
  name: string;
72
78
  /** Preferred over `name`/`username` in the UI; older deployments omit it. */
@@ -83,14 +89,53 @@ export interface TranscriptsMessagesDetailsResponse {
83
89
  session: string;
84
90
  user: number;
85
91
  };
86
- messages: Array<{
87
- human: string;
88
- ai: string;
89
- /** Attachments uploaded with the human turn; a file-only turn has `human: ""`. */
90
- human_files?: TranscriptFile[] | null;
91
- /** Files produced by the assistant turn (same shape as `human_files`). */
92
- ai_files?: TranscriptFile[] | null;
93
- }>;
92
+ messages: TranscriptMessage[];
93
+ }
94
+ /** One human/AI exchange of a transcript, with its attachments and extended context. */
95
+ export interface TranscriptMessage extends TranscriptTurnExtendedContext {
96
+ human: string;
97
+ ai: string;
98
+ /** Attachments uploaded with the human turn; a file-only turn has `human: ""`. */
99
+ human_files?: TranscriptFile[] | null;
100
+ /** Files produced by the assistant turn (same shape as `human_files`). */
101
+ ai_files?: TranscriptFile[] | null;
102
+ }
103
+ /** A document the agent retrieved while producing an AI turn (a RAG source). */
104
+ export interface TranscriptRetrievedDocument {
105
+ source?: string | null;
106
+ title?: string | null;
107
+ snippet?: string | null;
108
+ score?: number | null;
109
+ confidence_level?: string | number | null;
110
+ [key: string]: unknown;
111
+ }
112
+ /** A tool the agent called while producing an AI turn. `input`/`output` are free-form. */
113
+ export interface TranscriptToolCall {
114
+ name?: string | null;
115
+ input?: unknown;
116
+ output?: unknown;
117
+ [key: string]: unknown;
118
+ }
119
+ /** Backend metadata recorded for an AI turn. Known keys are typed; anything else passes through. */
120
+ export interface TranscriptTurnMetadata {
121
+ client?: Record<string, unknown> | null;
122
+ llm_model?: string | null;
123
+ llm_provider?: string | null;
124
+ llm_temperature?: number | null;
125
+ [key: string]: unknown;
126
+ }
127
+ /**
128
+ * Extended per-turn context — retrieved documents, tool calls, metadata and the
129
+ * request context — that the backend attaches to each AI turn on the admin
130
+ * surfaces only (`analytics/messages/details/` and the admin `chat-history/`
131
+ * list). The learner-facing `my-chat-history` endpoints never carry these.
132
+ * Every field may be `null` or empty for turns with no retrieval/tool activity.
133
+ */
134
+ export interface TranscriptTurnExtendedContext {
135
+ documents?: TranscriptRetrievedDocument[] | null;
136
+ tool_calls?: TranscriptToolCall[] | null;
137
+ metadata?: TranscriptTurnMetadata | null;
138
+ request_context?: Record<string, unknown> | null;
94
139
  }
95
140
  /** A file attached to a transcript message; `url` is a presigned, time-limited link. */
96
141
  export interface TranscriptFile {
@@ -117,6 +162,12 @@ export interface TranscriptsMessagesResponse {
117
162
  mentor: string;
118
163
  mentor_unique_id: string;
119
164
  model: string;
165
+ /**
166
+ * Provider key of `model` (e.g. `openai`). Not sent by the backend yet;
167
+ * when it is, the list card's model badge shows the provider logo from it
168
+ * instead of inferring the provider from the model name.
169
+ */
170
+ llm_provider?: string | null;
120
171
  cost: number;
121
172
  username: string;
122
173
  name: string;
@@ -133,6 +184,14 @@ export interface TranscriptsMessagesResponse {
133
184
  platform: number;
134
185
  session: string;
135
186
  user: number;
187
+ /**
188
+ * Rollups of the extended per-turn context, so rows can be badged without
189
+ * opening the conversation. The generated API client types them as strings;
190
+ * older backends omit them. Zero / false when there is no extended history.
191
+ */
192
+ documents_count?: number | string | null;
193
+ tool_calls_count?: number | string | null;
194
+ used_documents?: boolean | string | null;
136
195
  }>;
137
196
  pagination: {
138
197
  page: number;
@@ -0,0 +1 @@
1
+ export {};
@@ -1,3 +1,5 @@
1
+ import type { GlobalSearchArgs, GlobalSearchResponse } from './types';
2
+ export { buildGlobalSearchUrl } from './url';
1
3
  export declare const searchApiSlice: import("@reduxjs/toolkit/query").Api<import("@reduxjs/toolkit/query").BaseQueryFn<void, unknown, unknown, {
2
4
  attempt?: number;
3
5
  } & import("@reduxjs/toolkit/query").RetryOptions, {}>, {
@@ -71,6 +73,9 @@ export declare const searchApiSlice: import("@reduxjs/toolkit/query").Api<import
71
73
  }], import("@reduxjs/toolkit/query").BaseQueryFn<void, unknown, unknown, {
72
74
  attempt?: number;
73
75
  } & import("@reduxjs/toolkit/query").RetryOptions, {}>, never, import("@iblai/iblai-api").GlobalCatalogSearchResponse, "searchApiSlice", any>;
76
+ getSearchGlobal: import("@reduxjs/toolkit/query").QueryDefinition<[(GlobalSearchArgs | undefined)?], import("@reduxjs/toolkit/query").BaseQueryFn<void, unknown, unknown, {
77
+ attempt?: number;
78
+ } & import("@reduxjs/toolkit/query").RetryOptions, {}>, never, GlobalSearchResponse, "searchApiSlice", any>;
74
79
  }, "searchApiSlice", never, typeof import("@reduxjs/toolkit/query").coreModuleName | typeof import("@reduxjs/toolkit/dist/query/react").reactHooksModuleName>;
75
80
  export declare const useGetPersonnalizedSearchQuery: <R extends Record<string, any> = import("@reduxjs/toolkit/query").TSHelpersId<(Omit<{
76
81
  status: import("@reduxjs/toolkit/query").QueryStatus.uninitialized;
@@ -2014,4 +2019,303 @@ export declare const useGetPersonnalizedSearchQuery: <R extends Record<string, a
2014
2019
  topics?: Array<string>;
2015
2020
  updateFacet?: string;
2016
2021
  }];
2022
+ }], useGetSearchGlobalQuery: <R extends Record<string, any> = import("@reduxjs/toolkit/query").TSHelpersId<(Omit<{
2023
+ status: import("@reduxjs/toolkit/query").QueryStatus.uninitialized;
2024
+ originalArgs?: undefined | undefined;
2025
+ data?: undefined | undefined;
2026
+ error?: undefined | undefined;
2027
+ requestId?: undefined | undefined;
2028
+ endpointName?: string | undefined;
2029
+ startedTimeStamp?: undefined | undefined;
2030
+ fulfilledTimeStamp?: undefined | undefined;
2031
+ } & {
2032
+ currentData?: GlobalSearchResponse | undefined;
2033
+ isUninitialized: false;
2034
+ isLoading: false;
2035
+ isFetching: false;
2036
+ isSuccess: false;
2037
+ isError: false;
2038
+ }, "isUninitialized"> & {
2039
+ isUninitialized: true;
2040
+ }) | import("@reduxjs/toolkit/query").TSHelpersOverride<import("@reduxjs/toolkit/query").QuerySubState<import("@reduxjs/toolkit/query").QueryDefinition<[(GlobalSearchArgs | undefined)?], import("@reduxjs/toolkit/query").BaseQueryFn<void, unknown, unknown, {
2041
+ attempt?: number;
2042
+ } & import("@reduxjs/toolkit/query").RetryOptions, {}>, never, GlobalSearchResponse, "searchApiSlice", any>> & {
2043
+ currentData?: GlobalSearchResponse | undefined;
2044
+ isUninitialized: false;
2045
+ isLoading: false;
2046
+ isFetching: false;
2047
+ isSuccess: false;
2048
+ isError: false;
2049
+ }, {
2050
+ isLoading: true;
2051
+ isFetching: boolean;
2052
+ data: undefined;
2053
+ } | ({
2054
+ isSuccess: true;
2055
+ isFetching: true;
2056
+ error: undefined;
2057
+ } & Required<Pick<import("@reduxjs/toolkit/query").QuerySubState<import("@reduxjs/toolkit/query").QueryDefinition<[(GlobalSearchArgs | undefined)?], import("@reduxjs/toolkit/query").BaseQueryFn<void, unknown, unknown, {
2058
+ attempt?: number;
2059
+ } & import("@reduxjs/toolkit/query").RetryOptions, {}>, never, GlobalSearchResponse, "searchApiSlice", any>> & {
2060
+ currentData?: GlobalSearchResponse | undefined;
2061
+ isUninitialized: false;
2062
+ isLoading: false;
2063
+ isFetching: false;
2064
+ isSuccess: false;
2065
+ isError: false;
2066
+ }, "data" | "fulfilledTimeStamp">>) | ({
2067
+ isSuccess: true;
2068
+ isFetching: false;
2069
+ error: undefined;
2070
+ } & Required<Pick<import("@reduxjs/toolkit/query").QuerySubState<import("@reduxjs/toolkit/query").QueryDefinition<[(GlobalSearchArgs | undefined)?], import("@reduxjs/toolkit/query").BaseQueryFn<void, unknown, unknown, {
2071
+ attempt?: number;
2072
+ } & import("@reduxjs/toolkit/query").RetryOptions, {}>, never, GlobalSearchResponse, "searchApiSlice", any>> & {
2073
+ currentData?: GlobalSearchResponse | undefined;
2074
+ isUninitialized: false;
2075
+ isLoading: false;
2076
+ isFetching: false;
2077
+ isSuccess: false;
2078
+ isError: false;
2079
+ }, "data" | "fulfilledTimeStamp" | "currentData">>) | ({
2080
+ isError: true;
2081
+ } & Required<Pick<import("@reduxjs/toolkit/query").QuerySubState<import("@reduxjs/toolkit/query").QueryDefinition<[(GlobalSearchArgs | undefined)?], import("@reduxjs/toolkit/query").BaseQueryFn<void, unknown, unknown, {
2082
+ attempt?: number;
2083
+ } & import("@reduxjs/toolkit/query").RetryOptions, {}>, never, GlobalSearchResponse, "searchApiSlice", any>> & {
2084
+ currentData?: GlobalSearchResponse | undefined;
2085
+ isUninitialized: false;
2086
+ isLoading: false;
2087
+ isFetching: false;
2088
+ isSuccess: false;
2089
+ isError: false;
2090
+ }, "error">>)>> & {
2091
+ status: import("@reduxjs/toolkit/query").QueryStatus;
2092
+ }>(arg: [(GlobalSearchArgs | undefined)?] | typeof import("@reduxjs/toolkit/query").skipToken, options?: (import("@reduxjs/toolkit/query").SubscriptionOptions & {
2093
+ skip?: boolean;
2094
+ refetchOnMountOrArgChange?: boolean | number;
2095
+ } & {
2096
+ skip?: boolean;
2097
+ selectFromResult?: ((state: import("@reduxjs/toolkit/query").TSHelpersId<(Omit<{
2098
+ status: import("@reduxjs/toolkit/query").QueryStatus.uninitialized;
2099
+ originalArgs?: undefined | undefined;
2100
+ data?: undefined | undefined;
2101
+ error?: undefined | undefined;
2102
+ requestId?: undefined | undefined;
2103
+ endpointName?: string | undefined;
2104
+ startedTimeStamp?: undefined | undefined;
2105
+ fulfilledTimeStamp?: undefined | undefined;
2106
+ } & {
2107
+ currentData?: GlobalSearchResponse | undefined;
2108
+ isUninitialized: false;
2109
+ isLoading: false;
2110
+ isFetching: false;
2111
+ isSuccess: false;
2112
+ isError: false;
2113
+ }, "isUninitialized"> & {
2114
+ isUninitialized: true;
2115
+ }) | import("@reduxjs/toolkit/query").TSHelpersOverride<import("@reduxjs/toolkit/query").QuerySubState<import("@reduxjs/toolkit/query").QueryDefinition<[(GlobalSearchArgs | undefined)?], import("@reduxjs/toolkit/query").BaseQueryFn<void, unknown, unknown, {
2116
+ attempt?: number;
2117
+ } & import("@reduxjs/toolkit/query").RetryOptions, {}>, never, GlobalSearchResponse, "searchApiSlice", any>> & {
2118
+ currentData?: GlobalSearchResponse | undefined;
2119
+ isUninitialized: false;
2120
+ isLoading: false;
2121
+ isFetching: false;
2122
+ isSuccess: false;
2123
+ isError: false;
2124
+ }, {
2125
+ isLoading: true;
2126
+ isFetching: boolean;
2127
+ data: undefined;
2128
+ } | ({
2129
+ isSuccess: true;
2130
+ isFetching: true;
2131
+ error: undefined;
2132
+ } & Required<Pick<import("@reduxjs/toolkit/query").QuerySubState<import("@reduxjs/toolkit/query").QueryDefinition<[(GlobalSearchArgs | undefined)?], import("@reduxjs/toolkit/query").BaseQueryFn<void, unknown, unknown, {
2133
+ attempt?: number;
2134
+ } & import("@reduxjs/toolkit/query").RetryOptions, {}>, never, GlobalSearchResponse, "searchApiSlice", any>> & {
2135
+ currentData?: GlobalSearchResponse | undefined;
2136
+ isUninitialized: false;
2137
+ isLoading: false;
2138
+ isFetching: false;
2139
+ isSuccess: false;
2140
+ isError: false;
2141
+ }, "data" | "fulfilledTimeStamp">>) | ({
2142
+ isSuccess: true;
2143
+ isFetching: false;
2144
+ error: undefined;
2145
+ } & Required<Pick<import("@reduxjs/toolkit/query").QuerySubState<import("@reduxjs/toolkit/query").QueryDefinition<[(GlobalSearchArgs | undefined)?], import("@reduxjs/toolkit/query").BaseQueryFn<void, unknown, unknown, {
2146
+ attempt?: number;
2147
+ } & import("@reduxjs/toolkit/query").RetryOptions, {}>, never, GlobalSearchResponse, "searchApiSlice", any>> & {
2148
+ currentData?: GlobalSearchResponse | undefined;
2149
+ isUninitialized: false;
2150
+ isLoading: false;
2151
+ isFetching: false;
2152
+ isSuccess: false;
2153
+ isError: false;
2154
+ }, "data" | "fulfilledTimeStamp" | "currentData">>) | ({
2155
+ isError: true;
2156
+ } & Required<Pick<import("@reduxjs/toolkit/query").QuerySubState<import("@reduxjs/toolkit/query").QueryDefinition<[(GlobalSearchArgs | undefined)?], import("@reduxjs/toolkit/query").BaseQueryFn<void, unknown, unknown, {
2157
+ attempt?: number;
2158
+ } & import("@reduxjs/toolkit/query").RetryOptions, {}>, never, GlobalSearchResponse, "searchApiSlice", any>> & {
2159
+ currentData?: GlobalSearchResponse | undefined;
2160
+ isUninitialized: false;
2161
+ isLoading: false;
2162
+ isFetching: false;
2163
+ isSuccess: false;
2164
+ isError: false;
2165
+ }, "error">>)>> & {
2166
+ status: import("@reduxjs/toolkit/query").QueryStatus;
2167
+ }) => R) | undefined;
2168
+ }) | undefined) => [R][R extends any ? 0 : never] & {
2169
+ refetch: () => import("@reduxjs/toolkit/query").QueryActionCreatorResult<import("@reduxjs/toolkit/query").QueryDefinition<[(GlobalSearchArgs | undefined)?], import("@reduxjs/toolkit/query").BaseQueryFn<void, unknown, unknown, {
2170
+ attempt?: number;
2171
+ } & import("@reduxjs/toolkit/query").RetryOptions, {}>, never, GlobalSearchResponse, "searchApiSlice", any>>;
2172
+ }, useLazyGetSearchGlobalQuery: <R extends Record<string, any> = import("@reduxjs/toolkit/query").TSHelpersId<(Omit<{
2173
+ status: import("@reduxjs/toolkit/query").QueryStatus.uninitialized;
2174
+ originalArgs?: undefined | undefined;
2175
+ data?: undefined | undefined;
2176
+ error?: undefined | undefined;
2177
+ requestId?: undefined | undefined;
2178
+ endpointName?: string | undefined;
2179
+ startedTimeStamp?: undefined | undefined;
2180
+ fulfilledTimeStamp?: undefined | undefined;
2181
+ } & {
2182
+ currentData?: GlobalSearchResponse | undefined;
2183
+ isUninitialized: false;
2184
+ isLoading: false;
2185
+ isFetching: false;
2186
+ isSuccess: false;
2187
+ isError: false;
2188
+ }, "isUninitialized"> & {
2189
+ isUninitialized: true;
2190
+ }) | import("@reduxjs/toolkit/query").TSHelpersOverride<import("@reduxjs/toolkit/query").QuerySubState<import("@reduxjs/toolkit/query").QueryDefinition<[(GlobalSearchArgs | undefined)?], import("@reduxjs/toolkit/query").BaseQueryFn<void, unknown, unknown, {
2191
+ attempt?: number;
2192
+ } & import("@reduxjs/toolkit/query").RetryOptions, {}>, never, GlobalSearchResponse, "searchApiSlice", any>> & {
2193
+ currentData?: GlobalSearchResponse | undefined;
2194
+ isUninitialized: false;
2195
+ isLoading: false;
2196
+ isFetching: false;
2197
+ isSuccess: false;
2198
+ isError: false;
2199
+ }, {
2200
+ isLoading: true;
2201
+ isFetching: boolean;
2202
+ data: undefined;
2203
+ } | ({
2204
+ isSuccess: true;
2205
+ isFetching: true;
2206
+ error: undefined;
2207
+ } & Required<Pick<import("@reduxjs/toolkit/query").QuerySubState<import("@reduxjs/toolkit/query").QueryDefinition<[(GlobalSearchArgs | undefined)?], import("@reduxjs/toolkit/query").BaseQueryFn<void, unknown, unknown, {
2208
+ attempt?: number;
2209
+ } & import("@reduxjs/toolkit/query").RetryOptions, {}>, never, GlobalSearchResponse, "searchApiSlice", any>> & {
2210
+ currentData?: GlobalSearchResponse | undefined;
2211
+ isUninitialized: false;
2212
+ isLoading: false;
2213
+ isFetching: false;
2214
+ isSuccess: false;
2215
+ isError: false;
2216
+ }, "data" | "fulfilledTimeStamp">>) | ({
2217
+ isSuccess: true;
2218
+ isFetching: false;
2219
+ error: undefined;
2220
+ } & Required<Pick<import("@reduxjs/toolkit/query").QuerySubState<import("@reduxjs/toolkit/query").QueryDefinition<[(GlobalSearchArgs | undefined)?], import("@reduxjs/toolkit/query").BaseQueryFn<void, unknown, unknown, {
2221
+ attempt?: number;
2222
+ } & import("@reduxjs/toolkit/query").RetryOptions, {}>, never, GlobalSearchResponse, "searchApiSlice", any>> & {
2223
+ currentData?: GlobalSearchResponse | undefined;
2224
+ isUninitialized: false;
2225
+ isLoading: false;
2226
+ isFetching: false;
2227
+ isSuccess: false;
2228
+ isError: false;
2229
+ }, "data" | "fulfilledTimeStamp" | "currentData">>) | ({
2230
+ isError: true;
2231
+ } & Required<Pick<import("@reduxjs/toolkit/query").QuerySubState<import("@reduxjs/toolkit/query").QueryDefinition<[(GlobalSearchArgs | undefined)?], import("@reduxjs/toolkit/query").BaseQueryFn<void, unknown, unknown, {
2232
+ attempt?: number;
2233
+ } & import("@reduxjs/toolkit/query").RetryOptions, {}>, never, GlobalSearchResponse, "searchApiSlice", any>> & {
2234
+ currentData?: GlobalSearchResponse | undefined;
2235
+ isUninitialized: false;
2236
+ isLoading: false;
2237
+ isFetching: false;
2238
+ isSuccess: false;
2239
+ isError: false;
2240
+ }, "error">>)>> & {
2241
+ status: import("@reduxjs/toolkit/query").QueryStatus;
2242
+ }>(options?: (import("@reduxjs/toolkit/query").SubscriptionOptions & Omit<{
2243
+ skip?: boolean;
2244
+ selectFromResult?: ((state: import("@reduxjs/toolkit/query").TSHelpersId<(Omit<{
2245
+ status: import("@reduxjs/toolkit/query").QueryStatus.uninitialized;
2246
+ originalArgs?: undefined | undefined;
2247
+ data?: undefined | undefined;
2248
+ error?: undefined | undefined;
2249
+ requestId?: undefined | undefined;
2250
+ endpointName?: string | undefined;
2251
+ startedTimeStamp?: undefined | undefined;
2252
+ fulfilledTimeStamp?: undefined | undefined;
2253
+ } & {
2254
+ currentData?: GlobalSearchResponse | undefined;
2255
+ isUninitialized: false;
2256
+ isLoading: false;
2257
+ isFetching: false;
2258
+ isSuccess: false;
2259
+ isError: false;
2260
+ }, "isUninitialized"> & {
2261
+ isUninitialized: true;
2262
+ }) | import("@reduxjs/toolkit/query").TSHelpersOverride<import("@reduxjs/toolkit/query").QuerySubState<import("@reduxjs/toolkit/query").QueryDefinition<[(GlobalSearchArgs | undefined)?], import("@reduxjs/toolkit/query").BaseQueryFn<void, unknown, unknown, {
2263
+ attempt?: number;
2264
+ } & import("@reduxjs/toolkit/query").RetryOptions, {}>, never, GlobalSearchResponse, "searchApiSlice", any>> & {
2265
+ currentData?: GlobalSearchResponse | undefined;
2266
+ isUninitialized: false;
2267
+ isLoading: false;
2268
+ isFetching: false;
2269
+ isSuccess: false;
2270
+ isError: false;
2271
+ }, {
2272
+ isLoading: true;
2273
+ isFetching: boolean;
2274
+ data: undefined;
2275
+ } | ({
2276
+ isSuccess: true;
2277
+ isFetching: true;
2278
+ error: undefined;
2279
+ } & Required<Pick<import("@reduxjs/toolkit/query").QuerySubState<import("@reduxjs/toolkit/query").QueryDefinition<[(GlobalSearchArgs | undefined)?], import("@reduxjs/toolkit/query").BaseQueryFn<void, unknown, unknown, {
2280
+ attempt?: number;
2281
+ } & import("@reduxjs/toolkit/query").RetryOptions, {}>, never, GlobalSearchResponse, "searchApiSlice", any>> & {
2282
+ currentData?: GlobalSearchResponse | undefined;
2283
+ isUninitialized: false;
2284
+ isLoading: false;
2285
+ isFetching: false;
2286
+ isSuccess: false;
2287
+ isError: false;
2288
+ }, "data" | "fulfilledTimeStamp">>) | ({
2289
+ isSuccess: true;
2290
+ isFetching: false;
2291
+ error: undefined;
2292
+ } & Required<Pick<import("@reduxjs/toolkit/query").QuerySubState<import("@reduxjs/toolkit/query").QueryDefinition<[(GlobalSearchArgs | undefined)?], import("@reduxjs/toolkit/query").BaseQueryFn<void, unknown, unknown, {
2293
+ attempt?: number;
2294
+ } & import("@reduxjs/toolkit/query").RetryOptions, {}>, never, GlobalSearchResponse, "searchApiSlice", any>> & {
2295
+ currentData?: GlobalSearchResponse | undefined;
2296
+ isUninitialized: false;
2297
+ isLoading: false;
2298
+ isFetching: false;
2299
+ isSuccess: false;
2300
+ isError: false;
2301
+ }, "data" | "fulfilledTimeStamp" | "currentData">>) | ({
2302
+ isError: true;
2303
+ } & Required<Pick<import("@reduxjs/toolkit/query").QuerySubState<import("@reduxjs/toolkit/query").QueryDefinition<[(GlobalSearchArgs | undefined)?], import("@reduxjs/toolkit/query").BaseQueryFn<void, unknown, unknown, {
2304
+ attempt?: number;
2305
+ } & import("@reduxjs/toolkit/query").RetryOptions, {}>, never, GlobalSearchResponse, "searchApiSlice", any>> & {
2306
+ currentData?: GlobalSearchResponse | undefined;
2307
+ isUninitialized: false;
2308
+ isLoading: false;
2309
+ isFetching: false;
2310
+ isSuccess: false;
2311
+ isError: false;
2312
+ }, "error">>)>> & {
2313
+ status: import("@reduxjs/toolkit/query").QueryStatus;
2314
+ }) => R) | undefined;
2315
+ }, "skip">) | undefined) => [(arg: [(GlobalSearchArgs | undefined)?], preferCacheValue?: boolean) => import("@reduxjs/toolkit/query").QueryActionCreatorResult<import("@reduxjs/toolkit/query").QueryDefinition<[(GlobalSearchArgs | undefined)?], import("@reduxjs/toolkit/query").BaseQueryFn<void, unknown, unknown, {
2316
+ attempt?: number;
2317
+ } & import("@reduxjs/toolkit/query").RetryOptions, {}>, never, GlobalSearchResponse, "searchApiSlice", any>>, [R][R extends any ? 0 : never] & {
2318
+ reset: () => void;
2319
+ }, {
2320
+ lastArg: [(GlobalSearchArgs | undefined)?];
2017
2321
  }];
@@ -39,3 +39,18 @@ export declare const CUSTOM_AI_SEARCH_QUERY_KEYS: {
39
39
  GET_MENTORS: () => string[];
40
40
  GET_PERSONNALIZED_MENTORS: () => string[];
41
41
  };
42
+ /** Path of the global (non-personalized) catalog search endpoint. */
43
+ export declare const GLOBAL_SEARCH_PATH = "/api/search/global/";
44
+ /**
45
+ * Defaults the generated `SearchService.searchGlobalRetrieve` applies to its
46
+ * own parameters. Kept here so the hand-built URL sends the same query the
47
+ * generated client would, and so swapping to it later is a no-op for callers.
48
+ */
49
+ export declare const GLOBAL_SEARCH_DEFAULTS: {
50
+ allowSkillSearch: boolean;
51
+ alphabetical: boolean;
52
+ limit: number;
53
+ orderAscending: boolean;
54
+ returnFacet: boolean;
55
+ returnItems: boolean;
56
+ };
@@ -159,3 +159,84 @@ export interface GetAiSearchMentorsArgs {
159
159
  starred?: boolean;
160
160
  featured?: boolean;
161
161
  }
162
+ /**
163
+ * Query parameters accepted by `GET /api/search/global/`.
164
+ *
165
+ * Camel-cased to match the generated `SearchService` signature; the URL
166
+ * builder converts each key to its snake_case query param.
167
+ */
168
+ export interface GlobalSearchArgs {
169
+ /** Enable skill-based search. */
170
+ allowSkillSearch?: boolean;
171
+ /** Sort alphabetically by name. */
172
+ alphabetical?: boolean;
173
+ /** Filter by certificate type. */
174
+ certificate?: string[];
175
+ /** Content types to include, e.g. `['courses', 'programs', 'resources']`. */
176
+ content?: string[];
177
+ /** Filter by a specific course ID. */
178
+ courseId?: string;
179
+ /** Filter by course duration range. */
180
+ duration?: string[];
181
+ /** Filter by content language. */
182
+ language?: string[];
183
+ /** Filter by difficulty level. */
184
+ level?: string[];
185
+ /** Number of results per page. */
186
+ limit?: number;
187
+ /** Starting position for pagination. */
188
+ offset?: number;
189
+ /** Sort direction. */
190
+ orderAscending?: boolean;
191
+ /** Field to sort results by. */
192
+ orderBy?: string;
193
+ /** Filter by a specific pathway ID. */
194
+ pathwayId?: string;
195
+ /** Filter by price/audit status. */
196
+ price?: string;
197
+ /** Filter by a specific program ID. */
198
+ programId?: string;
199
+ /** Filter by program type. */
200
+ programType?: string[];
201
+ /** Filter by promotion status. */
202
+ promotion?: string[];
203
+ /** Search term matched against name and description. */
204
+ query?: string;
205
+ /** Filter by resource type. */
206
+ resourceType?: string[];
207
+ /** Include facet data in the response. */
208
+ returnFacet?: boolean;
209
+ /** Include the items nested in programs/pathways. */
210
+ returnItems?: boolean;
211
+ /** Filter by course format. */
212
+ selfPaced?: string[];
213
+ /** Filter by a specific skill ID. */
214
+ skillId?: string;
215
+ /** Filter by skills. */
216
+ skills?: string[];
217
+ /** Filter by subject areas. */
218
+ subject?: string[];
219
+ /** Filter by tags. */
220
+ tags?: string[];
221
+ /** Filter by tenant/organization. */
222
+ tenant?: string;
223
+ /** Filter by topic areas. */
224
+ topics?: string[];
225
+ /** Force a facet update. */
226
+ updateFacet?: string;
227
+ }
228
+ /** Response shape of `GET /api/search/global/`. */
229
+ export interface GlobalSearchResponse {
230
+ /** Content items matching the search criteria. */
231
+ results: Record<string, unknown>[];
232
+ /** Total number of items matching the search criteria. */
233
+ count: number;
234
+ /** URL for the next page of results. */
235
+ next: string | null;
236
+ /** URL for the previous page of results. */
237
+ previous: string | null;
238
+ current_page: number;
239
+ total_pages: number;
240
+ /** Facet information for filtering, omitted when `returnFacet` is false. */
241
+ facets?: Record<string, unknown>;
242
+ }
@@ -0,0 +1,10 @@
1
+ import type { GlobalSearchArgs } from './types';
2
+ /**
3
+ * Build the URL for `GET /api/search/global/`.
4
+ *
5
+ * Hand-assembled rather than delegating to `SearchService.searchGlobalRetrieve`
6
+ * because the workspace pins `@iblai/iblai-api` to a release that predates that
7
+ * method (see `overrides` in pnpm-workspace.yaml). Params and defaults mirror
8
+ * the generated signature so the two stay interchangeable.
9
+ */
10
+ export declare const buildGlobalSearchUrl: (args?: GlobalSearchArgs) => string;
@@ -1,3 +1,4 @@
1
+ import type { TranscriptFile } from '../analytics/types';
1
2
  export type UserChatHistoryTopic = {
2
3
  id?: number;
3
4
  name: string;
@@ -17,6 +18,10 @@ export type UserChatHistoryMessage = {
17
18
  ai: string;
18
19
  human_message_inserted_at?: string;
19
20
  ai_message_inserted_at?: string;
21
+ /** Files the user attached to the turn (presigned `url`); a file-only turn has `human: ""`. */
22
+ human_files?: TranscriptFile[] | null;
23
+ /** Files the assistant produced on the turn. */
24
+ ai_files?: TranscriptFile[] | null;
20
25
  };
21
26
  export type UserChatHistorySession = {
22
27
  id: string;
@@ -62,6 +62,15 @@ export declare const buildEndpointFromAxdService: <Args extends Record<string, u
62
62
  export declare const buildEndpointFromDmUrl: <Args extends Record<string, unknown>, Result>(buildUrl: (args: Args) => string, service?: SERVICES) => {
63
63
  queryFn: BaseQueryFn<Args, Result, FetchBaseQueryError | CustomError>;
64
64
  };
65
+ /**
66
+ * Build an endpoint from a hand-assembled URL, taking its arguments in the
67
+ * spread-array form the `*Legacy` builders use. Lets a URL-backed endpoint sit
68
+ * in the same slice as generated-service ones without callers having to switch
69
+ * between `hook(args)` and `hook([args])`.
70
+ */
71
+ export declare const buildEndpointFromDmUrlLegacy: <Args extends any[], Result>(buildUrl: (...args: Args) => string, service?: SERVICES) => {
72
+ queryFn: BaseQueryFn<Args, Result, FetchBaseQueryError | CustomError>;
73
+ };
65
74
  export interface CustomQueryArgs extends Omit<FetchArgs, 'url'> {
66
75
  url: string;
67
76
  service: SERVICES;