1 |
|
2 |
|
3 |
|
4 |
|
5 | import * as BB from 'botbuilder';
|
6 | import { CLMemory } from '../CLMemory';
|
7 | import { AppBase } from '@conversationlearner/models';
|
8 | import { QueuedInput } from './InputQueue';
|
9 | import { SessionStartFlags } from '../CLRunner';
|
10 | export interface ConversationSession {
|
11 | sessionId: string | null;
|
12 | conversationId: string | null;
|
13 | }
|
14 | export interface SessionInfo {
|
15 | userName: string;
|
16 | userId: string;
|
17 | logDialogId: string;
|
18 | }
|
19 | export interface ActiveApps {
|
20 | [appId: string]: string;
|
21 | }
|
22 | export declare enum UIMode {
|
23 | TEACH = "TEACH",
|
24 | EDIT = "EDIT",
|
25 | NONE = "NONE"
|
26 | }
|
27 | export declare enum BotStateType {
|
28 | APP = "APP",
|
29 | CONVERSATION_ID = "CONVERSATION_ID",
|
30 | CONVERSATION_REFERENCE = "CONVERSATION_REFERENCE",
|
31 | EDITING_PACKAGE = "EDITING_PACKAGE",
|
32 | UI_MODE = "UI_MODE",
|
33 | LAST_ACTIVE = "LAST_ACTIVE",
|
34 | LOG_DIALOG_ID = "LOG_DIALOG_ID",
|
35 | MESSAGE_MUTEX = "MESSAGE_MUTEX",
|
36 | NEED_SESSIONEND_CALL = "ON_ENDSESSION_CALLED",
|
37 | SESSION_ID = "SESSION_ID"
|
38 | }
|
39 | export declare class BotState {
|
40 | private static _instance;
|
41 | memory: CLMemory | undefined;
|
42 | private constructor();
|
43 | static Get(clMemory: CLMemory): BotState;
|
44 | private GetStateAsync;
|
45 | private SetStateAsync;
|
46 | _SetAppAsync(app: AppBase | null): Promise<void>;
|
47 | GetApp(): Promise<AppBase | null>;
|
48 | SetApp(app: AppBase | null): Promise<void>;
|
49 | GetConversationId(): Promise<string | BB.ConversationReference | null>;
|
50 | SetConversationId(conversationId: string | BB.ConversationReference | null): Promise<void>;
|
51 | GetEditingPackages(): Promise<ActiveApps>;
|
52 | SetEditingPackage(appId: string, packageId: string): Promise<{
|
53 | [appId: string]: string;
|
54 | }>;
|
55 | GetEditingPackageForApp(appId: string): Promise<string>;
|
56 | ClearEditingPackageAsync(): Promise<void>;
|
57 | GetNeedSessionEndCall(): Promise<boolean>;
|
58 | SetNeedSessionEndCall(needed: boolean): Promise<void>;
|
59 | GetLastActive(): Promise<number>;
|
60 | SetLastActive(lastActive: number): Promise<void>;
|
61 | GetSessionIdAndSetConversationId(conversationId: string): Promise<string | null>;
|
62 | GetSessionIdAsync(): Promise<string | null>;
|
63 | SetSessionId(sessionId: string | null): Promise<void>;
|
64 | InitSessionAsync(sessionId: string | null, logDialogId: string | null, conversationId: string | BB.ConversationReference | null, sessionStartFlags: SessionStartFlags): Promise<void>;
|
65 | EndSessionAsync(): Promise<void>;
|
66 | getUIMode(): Promise<UIMode>;
|
67 | SetUIMode(uiMode: UIMode): Promise<void>;
|
68 | SetConversationReference(conversationReference: Partial<BB.ConversationReference> | null): Promise<void>;
|
69 | GetConversationReverence(): Promise<Partial<BB.ConversationReference> | null>;
|
70 | CreateConversationReference(userName: string, userId: string, conversationId: string): Promise<void>;
|
71 | GetLogDialogId(): Promise<string | null>;
|
72 | SetLogDialogId(logDialogId: string | null): Promise<void>;
|
73 | GetMessageProcessing(): Promise<QueuedInput | null>;
|
74 | MessageProcessingPopAsync(): Promise<QueuedInput | null>;
|
75 | SetMessageProcessing(queuedInput: QueuedInput | null): Promise<void>;
|
76 | SessionInfoAsync(): Promise<SessionInfo>;
|
77 | }
|