Skip to content

Commit b377673

Browse files
committed
feat: remove unused imports and update createConnectAction method in ChatSurfaceAdapter
1 parent fb5e87e commit b377673

1 file changed

Lines changed: 11 additions & 9 deletions

File tree

adminforth/types/adapters/ChatSurfaceAdapter.ts

Lines changed: 11 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,3 @@
1-
import type { AdminUser } from "../Common.js";
2-
import type { IAdminForth } from "../Back.js";
3-
41
export type ChatSurfaceRequestContext = {
52
body: unknown;
63
headers: Record<string, unknown>;
@@ -19,6 +16,12 @@ export type ChatSurfaceIncomingMessage = {
1916
metadata?: Record<string, unknown>;
2017
};
2118

19+
export type ChatSurfaceConnectAction = {
20+
type: "url";
21+
label: string;
22+
url: string;
23+
};
24+
2225
export type ChatSurfaceEvent =
2326
| {
2427
type: "text_delta";
@@ -74,11 +77,10 @@ export interface ChatSurfaceAdapter {
7477
): ChatSurfaceEventSink | Promise<ChatSurfaceEventSink>;
7578

7679
/**
77-
* Maps an external surface user to an authorized AdminForth admin user.
78-
* Return null to reject the incoming chat message.
80+
* Creates a platform-specific action that lets a logged-in AdminForth user link
81+
* their account to this external chat surface.
7982
*/
80-
resolveAdminUser(input: {
81-
adminforth: IAdminForth;
82-
incoming: ChatSurfaceIncomingMessage;
83-
}): AdminUser | null | Promise<AdminUser | null>;
83+
createConnectAction?(input: {
84+
token: string;
85+
}): ChatSurfaceConnectAction | Promise<ChatSurfaceConnectAction>;
8486
}

0 commit comments

Comments
 (0)