@telia-ace/widget-conversation-flamingo 1.1.34-rc.0 → 1.1.34

Sign up to get free protection for your applications and to get access to all the features.
@@ -1,11 +1,14 @@
1
1
  import { Subject } from 'rxjs';
2
- import { ConversationMessage, ConversationMessageGroup, ConversationMessageSender, ConversationMessageType } from '../types';
2
+ import { ConversationEntryAction, ConversationMessage, ConversationMessageGroup, ConversationMessageSender, ConversationMessageType } from '../types';
3
3
  export declare class ConversationEntry {
4
4
  type: ConversationMessageType;
5
5
  sender: ConversationMessageSender;
6
6
  messages: ConversationMessageGroup[];
7
7
  timestamp: number;
8
8
  didUpdate: Subject<ConversationEntry>;
9
+ actions$: Subject<ConversationEntryAction>;
10
+ remove$: Subject<void>;
9
11
  constructor(type: ConversationMessageType, sender: ConversationMessageSender, messages: ConversationMessageGroup[]);
10
12
  update(content: ConversationMessage[]): void;
13
+ remove(): void;
11
14
  }
@@ -3,6 +3,7 @@ import { ConversationEntry } from './conversation-entry';
3
3
  import { Agent } from './agent';
4
4
  import { User } from './user';
5
5
  import { ConversationSessionState } from './conversation-session-state';
6
+ import { System } from './system';
6
7
  type UserSubmitEvent = {
7
8
  text: string;
8
9
  };
@@ -11,13 +12,17 @@ export declare class ConversationProvider {
11
12
  session: ConversationSessionState;
12
13
  private print$;
13
14
  private typingState$;
15
+ protected system: System;
14
16
  constructor(name: string, session: ConversationSessionState);
17
+ connect(): void;
15
18
  onUserSubmit(action: UserSubmitEvent): void;
16
19
  print(type: ConversationMessageType, text: string): ConversationEntry;
17
20
  printEntry(entry: ConversationEntry): ConversationEntry;
18
21
  createAgent(name: string): Agent;
19
22
  createUser(name: string): User;
23
+ createSystem(): System;
20
24
  setTypingState(isTyping: boolean): void;
25
+ setToastMessage(message: string | null): void;
21
26
  isTyping(): import("rxjs").Observable<boolean>;
22
27
  actions(): import("rxjs").Observable<ConversationEntry>;
23
28
  complete(): void;
@@ -16,6 +16,7 @@ export declare class ConversationSessionState {
16
16
  entries(): Observable<ConversationEntry[]>;
17
17
  setProvider(provider: ConversationProvider): void;
18
18
  handover(providerKey: string): void;
19
+ addEntryRemoveHandler(entry: ConversationEntry): void;
19
20
  completeProvider(): void;
20
21
  isTyping(): Observable<boolean>;
21
22
  }
@@ -0,0 +1,8 @@
1
+ import { ConversationEntry } from './conversation-entry';
2
+ export declare class System {
3
+ private print$;
4
+ private name;
5
+ constructor();
6
+ print(text: string): ConversationEntry;
7
+ subscribe(): import("rxjs").Observable<ConversationEntry>;
8
+ }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@telia-ace/widget-conversation-flamingo",
3
- "version": "1.1.34-rc.0",
3
+ "version": "1.1.34",
4
4
  "publishConfig": {
5
5
  "registry": "https://registry.npmjs.org"
6
6
  },
@@ -9,7 +9,7 @@
9
9
  "@lit-labs/motion": "^1.0.4",
10
10
  "@teliads/icons": "^8.4.0",
11
11
  "@teliads/components": "^22.1.1",
12
- "@telia-ace/widget-core-flamingo": "1.1.34-rc.0",
12
+ "@telia-ace/widget-core-flamingo": "1.1.34",
13
13
  "uuid": "^9.0.1",
14
14
  "lit-html": "^3.0.2",
15
15
  "rxjs": "^7.8.1"
package/types.d.ts CHANGED
@@ -14,3 +14,7 @@ export declare enum ConversationMessageType {
14
14
  Agent = "agent",
15
15
  System = "system"
16
16
  }
17
+ export type ConversationEntryAction = {
18
+ key: string;
19
+ data: Record<string, any>;
20
+ };