@iblai/data-layer 1.30.3 → 1.31.0

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.30.2",
3
+ "version": "1.30.3",
4
4
  "description": "ibl.ai data layer",
5
5
  "main": "dist/index.esm.js",
6
6
  "types": "dist/index.d.ts",
@@ -1,3 +1,4 @@
1
+ import type { ThunkDispatch, UnknownAction } from '@reduxjs/toolkit';
1
2
  import { type PinnedMessageGet, type PinnedMessageRequest } from '@iblai/iblai-api';
2
3
  export type RecentMessagesArgs = {
3
4
  org: string;
@@ -26,6 +27,12 @@ export declare const getNextRecentMessagesPageParam: (lastPage: RecentMessagesPa
26
27
  * LimitOffsetPagination (`limit`/`offset`), not page numbers.
27
28
  */
28
29
  export declare const buildRecentMessagesUrl: (args: RecentMessagesArgs, pageParam: number) => string;
30
+ /**
31
+ * The session id of the first recent-messages row, or `null` when there is
32
+ * none. Assumes the endpoint lists newest first (not yet confirmed by the
33
+ * backend) — this is the one place to change if that, or the source, changes.
34
+ */
35
+ export declare const latestSessionIdFrom: (body: unknown) => string | null;
29
36
  export type PinnedMessagesArgs = {
30
37
  org: string;
31
38
  userId: string;
@@ -89,6 +96,21 @@ export declare const chatApiSlice: import("@reduxjs/toolkit/query").Api<import("
89
96
  attempt?: number;
90
97
  } & import("@reduxjs/toolkit/query").RetryOptions, {}>, "pinnedMessages" | "recentMessages" | "messageFeedback", import("@iblai/iblai-api").AudioToTextResponse, "chatApiSlice", any>;
91
98
  }, "chatApiSlice", "pinnedMessages" | "recentMessages" | "messageFeedback", typeof import("@reduxjs/toolkit/query").coreModuleName | typeof import("@reduxjs/toolkit/dist/query/react").reactHooksModuleName>;
99
+ export type LatestMentorSessionArgs = {
100
+ org: string;
101
+ userId: string;
102
+ mentor: string;
103
+ };
104
+ /**
105
+ * The user's latest session with an agent, read from page 0 of the same
106
+ * `getRecentMessages` entry the chat-history sidebar subscribes to (`search: ''`
107
+ * is its idle search box), so an agent open costs one request, not two.
108
+ * `forceRefetch` in seconds is the time since `openedAt`: an entry fulfilled
109
+ * before this open is refetched (another device may have started a chat since),
110
+ * one fulfilled after it is reused, and one in flight is joined — RTK never
111
+ * starts a second request for a pending entry.
112
+ */
113
+ export declare const fetchLatestMentorSessionId: ({ org, userId, mentor }: LatestMentorSessionArgs, openedAt: number) => (dispatch: ThunkDispatch<unknown, unknown, UnknownAction>) => Promise<string | null>;
92
114
  export declare const useLazyGetPinnedMessagesQuery: <R extends Record<string, any> = import("@reduxjs/toolkit/query").TSHelpersId<(Omit<{
93
115
  status: import("@reduxjs/toolkit/query").QueryStatus.uninitialized;
94
116
  originalArgs?: undefined | undefined;