@telia-ace/ace-chat-flamingo 1.1.123-rc.42 → 1.1.123-rc.43
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/client.d.ts +3 -2
- package/engine.d.ts +1 -21
- package/index.js +736 -664
- package/index.mjs +4243 -4031
- package/package.json +3 -3
- package/provider.d.ts +33 -47
- package/services/auth-service.d.ts +19 -0
- package/services/dialog-service.d.ts +25 -0
- package/services/dialog.service.d.ts +25 -0
- package/services/header-menu-service.d.ts +10 -0
- package/services/video-service.d.ts +17 -0
- package/types.d.ts +7 -0
- package/ui/chat-unavailable-card.d.ts +7 -0
- package/ui/entrance-closed-dialog.d.ts +0 -1
package/package.json
CHANGED
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@telia-ace/ace-chat-flamingo",
|
|
3
|
-
"version": "1.1.123-rc.
|
|
3
|
+
"version": "1.1.123-rc.43",
|
|
4
4
|
"dependencies": {
|
|
5
|
-
"@telia-ace/widget-core-flamingo": "1.1.123-rc.
|
|
6
|
-
"@telia-ace/widget-conversation-flamingo": "1.1.123-rc.
|
|
5
|
+
"@telia-ace/widget-core-flamingo": "1.1.123-rc.43",
|
|
6
|
+
"@telia-ace/widget-conversation-flamingo": "1.1.123-rc.43",
|
|
7
7
|
"rxjs": "^7.8.2",
|
|
8
8
|
"lit": "^3.0.2",
|
|
9
9
|
"@teliads/icons": "^8.4.0",
|
package/provider.d.ts
CHANGED
|
@@ -1,37 +1,42 @@
|
|
|
1
|
-
import { ConversationProvider } from '../../conversation/src/index.ts';
|
|
1
|
+
import { ConversationEntry, ConversationProvider } from '../../conversation/src/index.ts';
|
|
2
|
+
import { Auth, StorageService, TextsService } from '../../core/src/index.ts';
|
|
3
|
+
import { AuthCardState } from './types';
|
|
2
4
|
export declare class ChatProvider extends ConversationProvider {
|
|
3
|
-
private
|
|
4
|
-
private
|
|
5
|
-
private
|
|
6
|
-
private
|
|
7
|
-
|
|
5
|
+
private headerMenuService;
|
|
6
|
+
private videoService;
|
|
7
|
+
private dialogService;
|
|
8
|
+
private authService;
|
|
9
|
+
readonly storageService: StorageService;
|
|
10
|
+
readonly textsService: TextsService;
|
|
11
|
+
readonly auth: Auth;
|
|
12
|
+
readonly isThirdPartyWidget: boolean;
|
|
13
|
+
readonly headerComponent: any;
|
|
14
|
+
private readonly application;
|
|
15
|
+
private readonly survey;
|
|
16
|
+
private readonly live;
|
|
8
17
|
private readonly agent;
|
|
9
18
|
private readonly user;
|
|
10
19
|
private readonly params;
|
|
11
20
|
private readonly invitationUid;
|
|
12
21
|
private readonly customerName;
|
|
13
|
-
private readonly
|
|
14
|
-
private readonly shouldUseAuth;
|
|
15
|
-
private readonly idHubEidType;
|
|
22
|
+
private readonly pendingMessages;
|
|
16
23
|
private readonly disconnected$;
|
|
17
|
-
private engine
|
|
18
|
-
private idHubClient?;
|
|
24
|
+
private engine;
|
|
19
25
|
private agentUsername;
|
|
20
|
-
private videoConfirmDialogEntry;
|
|
21
|
-
private quitConfirmDialogEntry;
|
|
22
|
-
private authenticationCardEntry;
|
|
23
|
-
private conversationOption;
|
|
24
|
-
private _conversationOptions;
|
|
25
26
|
private sessionId;
|
|
26
27
|
private contactId;
|
|
27
28
|
private errand;
|
|
28
29
|
private entrance;
|
|
29
|
-
private
|
|
30
|
-
private
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
30
|
+
private conversationOptions;
|
|
31
|
+
private _conversationOption;
|
|
32
|
+
get conversationOption(): any;
|
|
33
|
+
set conversationOption(val: any);
|
|
34
|
+
get inVideoCall(): boolean;
|
|
35
|
+
updateHeaderOption(): void;
|
|
36
|
+
showTunnistusAuthCard(state: AuthCardState, tunnistusURL?: string, errorMessage?: string, isAuthenticating?: boolean): ConversationEntry;
|
|
37
|
+
getChatStatus(): Promise<"finished" | "noSession" | "active">;
|
|
34
38
|
constructor(name: string, component: any);
|
|
39
|
+
private initializeServices;
|
|
35
40
|
connect(conversationOptions?: Record<string, any>): void;
|
|
36
41
|
disconnected(): void;
|
|
37
42
|
onUserSubmit(action: {
|
|
@@ -40,23 +45,20 @@ export declare class ChatProvider extends ConversationProvider {
|
|
|
40
45
|
save(data: any): void;
|
|
41
46
|
rehydrate(data: Record<string, any>): Promise<void>;
|
|
42
47
|
static getInstance(key: string, component: any): ChatProvider;
|
|
48
|
+
private createEngineConfig;
|
|
43
49
|
private initializeChat;
|
|
44
50
|
setupAuthenticationListeners(): void;
|
|
45
|
-
|
|
46
|
-
private startAuthenticationFlow;
|
|
47
|
-
private getAuthResult;
|
|
48
|
-
private handleWelcomeForm;
|
|
51
|
+
handleWelcomeForm(idhubEIDToken?: string, isEntranceOpen?: boolean): Promise<void>;
|
|
49
52
|
private startChat;
|
|
50
|
-
|
|
53
|
+
restartNewChat(): void;
|
|
51
54
|
private handleChatEngineError;
|
|
52
55
|
private resetChatState;
|
|
53
56
|
private setQueueStatus;
|
|
54
|
-
|
|
57
|
+
endConversation(): Promise<void>;
|
|
55
58
|
private sendConversationEmail;
|
|
56
59
|
private clearPendingMessages;
|
|
57
|
-
|
|
60
|
+
setSessionId(id: string | null): void;
|
|
58
61
|
private isEntranceOpen;
|
|
59
|
-
private resetAuthState;
|
|
60
62
|
private unescapeHtml;
|
|
61
63
|
private readonly onQueueStatusReceived;
|
|
62
64
|
private readonly onEstablished;
|
|
@@ -66,24 +68,8 @@ export declare class ChatProvider extends ConversationProvider {
|
|
|
66
68
|
private readonly onEndVideoButtonClicked;
|
|
67
69
|
private readonly onPenStatusChange;
|
|
68
70
|
private readonly onChatEnded;
|
|
69
|
-
private handleAuthentication;
|
|
70
71
|
private printAgent;
|
|
71
72
|
private printUser;
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
private showTunnistusAuthCard;
|
|
75
|
-
private showWelcomeForm;
|
|
76
|
-
private showEntranceClosedDialog;
|
|
77
|
-
private showQuitConfirmDialog;
|
|
78
|
-
private showConversationEndedForm;
|
|
79
|
-
private showVideoConfirmDialog;
|
|
80
|
-
private showVideoIFrame;
|
|
81
|
-
private showChatOverVideo;
|
|
82
|
-
private endAuthenticatedSession;
|
|
83
|
-
private removeVideo;
|
|
84
|
-
private addHeaderOptions;
|
|
85
|
-
private removeHeaderOptions;
|
|
86
|
-
private setStartNewChatOption;
|
|
87
|
-
private setEndConversationOption;
|
|
88
|
-
private setHeaderOption;
|
|
73
|
+
printSystem(text: string): ConversationEntry;
|
|
74
|
+
showQuitConfirmDialog(): void;
|
|
89
75
|
}
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
import { ConversationEntry } from '../../../conversation/src/index.ts';
|
|
2
|
+
import { AuthState } from '../../../core/src/index.ts';
|
|
3
|
+
import { AuthResponse } from '../../../widget-id-hub/src/index.ts';
|
|
4
|
+
import { ChatProvider } from '../provider';
|
|
5
|
+
export declare class AuthService {
|
|
6
|
+
private provider;
|
|
7
|
+
private _idHubClient?;
|
|
8
|
+
private _authResult?;
|
|
9
|
+
private _authenticationCardEntry;
|
|
10
|
+
constructor(provider: ChatProvider);
|
|
11
|
+
get authResult(): AuthResponse | undefined;
|
|
12
|
+
get authenticationCardEntry(): ConversationEntry | undefined;
|
|
13
|
+
setupIDHubAuth(): void;
|
|
14
|
+
startAuthenticationFlow(isRetry?: boolean): Promise<void>;
|
|
15
|
+
handleAuthentication(): Promise<void>;
|
|
16
|
+
endAuthenticatedSession(): Promise<void>;
|
|
17
|
+
resetAuthState(authState: AuthState.NonAuthenticated | AuthState.ChatEnded): void;
|
|
18
|
+
private getAuthResult;
|
|
19
|
+
}
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
import { ConversationEntry } from '../../../conversation/src/index.ts';
|
|
2
|
+
import { AuthCardState } from '../types';
|
|
3
|
+
import { ChatProvider } from '../provider';
|
|
4
|
+
export declare class DialogService {
|
|
5
|
+
private provider;
|
|
6
|
+
private _videoConfirmDialogEntry;
|
|
7
|
+
private _quitConfirmDialogEntry;
|
|
8
|
+
constructor(provider: ChatProvider);
|
|
9
|
+
get videoConfirmDialogEntry(): ConversationEntry | undefined;
|
|
10
|
+
get quitConfirmDialogEntry(): ConversationEntry | undefined;
|
|
11
|
+
removeVideoConfirmDialog(): void;
|
|
12
|
+
showSurvey(agentUsername: string, entrance: string, errand: string, contactId: string): void;
|
|
13
|
+
showTunnistusAuthCard(state: AuthCardState, tunnistusURL?: string, errorMessage?: string, isAuthenticating?: boolean): ConversationEntry;
|
|
14
|
+
showWelcomeForm(idhubEIDToken: string | undefined, onSubmit: (data: {
|
|
15
|
+
customerName: string;
|
|
16
|
+
customerEmailAddress?: string;
|
|
17
|
+
visitorQuestion?: string;
|
|
18
|
+
customData: Record<string, any>;
|
|
19
|
+
idhubEIDToken?: string;
|
|
20
|
+
}) => void): void;
|
|
21
|
+
showEntranceClosedDialog(): void;
|
|
22
|
+
showQuitConfirmDialog(onQuit: () => void): void;
|
|
23
|
+
showConversationEndedForm(onEmailSubmit: (email: string) => void): void;
|
|
24
|
+
showVideoConfirmDialog(onResult: (result: string, text: string) => void): void;
|
|
25
|
+
}
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
import { ConversationEntry } from '../../../conversation/src/index.ts';
|
|
2
|
+
import { AuthCardState } from '../types';
|
|
3
|
+
import { ChatProvider } from '../provider';
|
|
4
|
+
export declare class DialogService {
|
|
5
|
+
private provider;
|
|
6
|
+
private _videoConfirmDialogEntry;
|
|
7
|
+
private _quitConfirmDialogEntry;
|
|
8
|
+
constructor(provider: ChatProvider);
|
|
9
|
+
get videoConfirmDialogEntry(): ConversationEntry | undefined;
|
|
10
|
+
get quitConfirmDialogEntry(): ConversationEntry | undefined;
|
|
11
|
+
removeVideoConfirmDialog(): void;
|
|
12
|
+
showSurvey(agentUsername: string, entrance: string, errand: string, contactId: string): void;
|
|
13
|
+
showTunnistusAuthCard(state: AuthCardState, tunnistusURL?: string, errorMessage?: string, isAuthenticating?: boolean): ConversationEntry;
|
|
14
|
+
showWelcomeForm(idhubEIDToken: string | undefined, onSubmit: (data: {
|
|
15
|
+
customerName: string;
|
|
16
|
+
customerEmailAddress?: string;
|
|
17
|
+
visitorQuestion?: string;
|
|
18
|
+
customData: Record<string, any>;
|
|
19
|
+
idhubEIDToken?: string;
|
|
20
|
+
}) => void): void;
|
|
21
|
+
showEntranceClosedDialog(): void;
|
|
22
|
+
showQuitConfirmDialog(onQuit: () => void): void;
|
|
23
|
+
showConversationEndedForm(onEmailSubmit: (email: string) => void): void;
|
|
24
|
+
showVideoConfirmDialog(onResult: (result: string, text: string) => void): void;
|
|
25
|
+
}
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import { ChatProvider } from '../provider';
|
|
2
|
+
export declare class HeaderMenuService {
|
|
3
|
+
private provider;
|
|
4
|
+
constructor(provider: ChatProvider);
|
|
5
|
+
private addOption;
|
|
6
|
+
removeOptions(): void;
|
|
7
|
+
setStartNewChatOption(): void;
|
|
8
|
+
setEndConversationOption(): void;
|
|
9
|
+
setHeaderOption(): Promise<void>;
|
|
10
|
+
}
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import { ChatProvider } from '../provider';
|
|
2
|
+
export declare class VideoService {
|
|
3
|
+
private provider;
|
|
4
|
+
private _videoIFrameElement;
|
|
5
|
+
private _guestId;
|
|
6
|
+
private _chatOverlayActive;
|
|
7
|
+
private _inVideoCall;
|
|
8
|
+
constructor(provider: ChatProvider);
|
|
9
|
+
get videoIFrameElement(): HTMLElement | undefined;
|
|
10
|
+
get guestId(): string | null;
|
|
11
|
+
get chatOverlayActive(): boolean;
|
|
12
|
+
get inVideoCall(): boolean;
|
|
13
|
+
clearGuestId(): void;
|
|
14
|
+
showVideoIFrame(userUrl: string): void;
|
|
15
|
+
showChatOverVideo(guestId: string): void;
|
|
16
|
+
removeVideo(): void;
|
|
17
|
+
}
|
package/types.d.ts
CHANGED
|
@@ -117,6 +117,13 @@ export declare const isChatButtonClickedAction: (action: EngineAction) => action
|
|
|
117
117
|
export declare const isEndVideoButtonClickedAction: (action: EngineAction) => action is EndVideoButtonClickedAction;
|
|
118
118
|
export declare const isChatEndedAction: (action: EngineAction) => action is ChatEndedAction;
|
|
119
119
|
export type EngineErrorType = 'chat-request-error' | 'chat-join-error' | 'chat-engine-error' | 'chat-write-error' | 'chat-email-session-error' | 'chat-unknown-error';
|
|
120
|
+
export type EngineConfig = {
|
|
121
|
+
engineUrl: string;
|
|
122
|
+
instance: string;
|
|
123
|
+
entrance: string;
|
|
124
|
+
queueMessageInterval: number;
|
|
125
|
+
videoChatMode: string;
|
|
126
|
+
};
|
|
120
127
|
export type AuthenticationInfo = {
|
|
121
128
|
authenticated: boolean;
|
|
122
129
|
name?: string;
|