@unblu/embedded-app-component 8.19.1 → 8.21.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/lib/index.d.ts +39 -0
- package/dist/lib/internal/internal-embedded-api.d.ts +16 -0
- package/dist/lib/internal/module/embedded-meta-module.d.ts +17 -0
- package/dist/lib/internal/module/general-module.d.ts +16 -0
- package/dist/lib/shared/api-state.d.ts +8 -0
- package/dist/lib/shared/conversation.d.ts +313 -0
- package/dist/lib/shared/internal/api-bridge.d.ts +36 -0
- package/dist/lib/shared/internal/event.d.ts +6 -0
- package/dist/lib/shared/internal/initialized-unblu-api.d.ts +10 -0
- package/dist/lib/shared/internal/initialized-unblu-element.d.ts +10 -0
- package/dist/lib/shared/internal/java-error-codes.d.ts +5 -0
- package/dist/lib/shared/internal/model/destroy-mode.d.ts +4 -0
- package/dist/lib/shared/internal/model/destroy-options.d.ts +4 -0
- package/dist/lib/shared/internal/module/agent-availability-module.d.ts +14 -0
- package/dist/lib/shared/internal/module/base-general-module.d.ts +35 -0
- package/dist/lib/shared/internal/module/conversation-module.d.ts +64 -0
- package/dist/lib/shared/internal/module/module.d.ts +10 -0
- package/dist/lib/shared/internal/unblu-floating-api.d.ts +15 -0
- package/dist/lib/shared/internal/unblu-util.d.ts +76 -0
- package/dist/lib/shared/internal/util/event-emitter.d.ts +44 -0
- package/dist/lib/shared/model/agent-availability-state.d.ts +18 -0
- package/dist/lib/shared/model/branchclient/language.d.ts +14 -0
- package/dist/lib/shared/model/branchclient/named-area-agent-availability.d.ts +19 -0
- package/dist/lib/shared/model/call-connection-state.d.ts +18 -0
- package/dist/lib/shared/model/call-state.d.ts +30 -0
- package/dist/lib/shared/model/configuration.d.ts +53 -0
- package/dist/lib/shared/model/connection-state.d.ts +27 -0
- package/dist/lib/shared/model/conversation-info.d.ts +42 -0
- package/dist/lib/shared/model/conversation-message-info.d.ts +14 -0
- package/dist/lib/shared/model/conversation-participant.d.ts +15 -0
- package/dist/lib/shared/model/conversation-participation-type.d.ts +18 -0
- package/dist/lib/shared/model/conversation-recipient-type.d.ts +18 -0
- package/dist/lib/shared/model/conversation-recipient.d.ts +18 -0
- package/dist/lib/shared/model/conversation-state.d.ts +37 -0
- package/dist/lib/shared/model/conversation-type.d.ts +47 -0
- package/dist/lib/shared/model/customaction/custom-action-invocation.d.ts +27 -0
- package/dist/lib/shared/model/customaction/custom-conversation-action-invocation.d.ts +6 -0
- package/dist/lib/shared/model/customaction/custom-message-action-invocation.d.ts +16 -0
- package/dist/lib/shared/model/customaction/custom-person-action-invocation.d.ts +11 -0
- package/dist/lib/shared/model/new-conversation-interceptor-result.d.ts +14 -0
- package/dist/lib/shared/model/new-conversation-recipient-type.d.ts +10 -0
- package/dist/lib/shared/model/new-conversation-recipient.d.ts +14 -0
- package/dist/lib/shared/model/person-info.d.ts +5 -0
- package/dist/lib/shared/new-conversation-interceptor.d.ts +24 -0
- package/dist/lib/shared/unblu-api-error.d.ts +117 -0
- package/dist/lib/unblu-embedded-api.d.ts +554 -0
- package/dist/lib/unblu-embedded-api.js +1 -3
- package/dist/lib/unblu-embedded-api.js.map +1 -1
- package/dist/lib/unblu-embedded-app-element.d.ts +708 -0
- package/dist/lib/unblu-embedded-app-element.js +1 -3
- package/dist/lib/unblu-embedded-app-element.js.map +1 -1
- package/dist/lib/view-mode.d.ts +5 -0
- package/dist/lib/web-types.json +1 -1
- package/package.json +1 -1
|
@@ -0,0 +1,76 @@
|
|
|
1
|
+
import { InitializedUnbluElement } from "./initialized-unblu-element";
|
|
2
|
+
import { Configuration } from "../model/configuration";
|
|
3
|
+
import { UnbluFloatingApi } from "./unblu-floating-api";
|
|
4
|
+
export declare enum IntegrationType {
|
|
5
|
+
embedded = "embedded",
|
|
6
|
+
floating = "floating",
|
|
7
|
+
branchClient = "branch-client"
|
|
8
|
+
}
|
|
9
|
+
declare enum EntryPoint {
|
|
10
|
+
siteIntegrationGreedyMain = "SiteIntegrationGreedyMain",
|
|
11
|
+
siteIntegrationLazyMain = "SiteIntegrationLazyMain",
|
|
12
|
+
siteEmbeddedMain = "SiteEmbeddedMain",
|
|
13
|
+
branchClientMain = "BranchClientMain"
|
|
14
|
+
}
|
|
15
|
+
/**
|
|
16
|
+
* Internal type definition of the unblu object.
|
|
17
|
+
*/
|
|
18
|
+
export interface UnbluObject {
|
|
19
|
+
floating?: UnbluFloatingApi;
|
|
20
|
+
/**
|
|
21
|
+
* internal unblu field
|
|
22
|
+
* @hidden
|
|
23
|
+
*/
|
|
24
|
+
APIKEY?: string;
|
|
25
|
+
/**
|
|
26
|
+
* internal unblu field
|
|
27
|
+
* @hidden
|
|
28
|
+
*/
|
|
29
|
+
BRANCHCLIENTTOKEN?: string;
|
|
30
|
+
/**
|
|
31
|
+
* internal unblu field
|
|
32
|
+
* @hidden
|
|
33
|
+
*/
|
|
34
|
+
SERVER?: string;
|
|
35
|
+
/**
|
|
36
|
+
* internal unblu field
|
|
37
|
+
* @hidden
|
|
38
|
+
*/
|
|
39
|
+
l?: string;
|
|
40
|
+
/**
|
|
41
|
+
* internal unblu field
|
|
42
|
+
* @hidden
|
|
43
|
+
*/
|
|
44
|
+
entryPoint?: EntryPoint;
|
|
45
|
+
/**
|
|
46
|
+
* internal unblu field
|
|
47
|
+
* @hidden
|
|
48
|
+
*/
|
|
49
|
+
globalPrefix?: string;
|
|
50
|
+
/**
|
|
51
|
+
* internal unblu field
|
|
52
|
+
* @hidden
|
|
53
|
+
*/
|
|
54
|
+
'embedded-internal-element'?: InitializedUnbluElement | null;
|
|
55
|
+
}
|
|
56
|
+
export declare class UnbluUtil {
|
|
57
|
+
static loadScript(uri: string, timeout: number): Promise<void>;
|
|
58
|
+
static getNamedArea(): string | undefined;
|
|
59
|
+
static setNamedArea(namedArea: string): void;
|
|
60
|
+
static removeNamedArea(): void;
|
|
61
|
+
static setLocale(locale: string): void;
|
|
62
|
+
static loginWithSecureToken(serverUrl: string, apiKey: string, entryPath: string, accessToken: string): Promise<void>;
|
|
63
|
+
static isAuthenticated(serverUrl: string, entryPath: string): Promise<boolean>;
|
|
64
|
+
static logout(serverUrl: string, entryPath: string): Promise<void>;
|
|
65
|
+
static isUnbluLoaded(integrationType: IntegrationType): boolean;
|
|
66
|
+
static generateConfigurationFromLoadedUnblu(): Configuration;
|
|
67
|
+
private static entryPointMatches;
|
|
68
|
+
static getUnbluObject(): UnbluObject;
|
|
69
|
+
static createUnbluObject(): UnbluObject;
|
|
70
|
+
static getOrCreateUnbluObject(): UnbluObject;
|
|
71
|
+
static deinitializeFloatingIfNeeded(): Promise<void>;
|
|
72
|
+
static deinitializeEmbeddedIfNeeded(excludedAppElement?: InitializedUnbluElement): Promise<void>;
|
|
73
|
+
static deinitializeBranchClientIfNeeded(excludedAppElement?: InitializedUnbluElement): Promise<void>;
|
|
74
|
+
static sanitizeParameter(param: string): string;
|
|
75
|
+
}
|
|
76
|
+
export {};
|
|
@@ -0,0 +1,44 @@
|
|
|
1
|
+
export type Listener = (data?: any) => void;
|
|
2
|
+
export declare class EventEmitter {
|
|
3
|
+
private listeners;
|
|
4
|
+
/**
|
|
5
|
+
* Resets the emitter by removing all registered listeners.
|
|
6
|
+
*/
|
|
7
|
+
reset(): void;
|
|
8
|
+
/**
|
|
9
|
+
* Adds an event listeners
|
|
10
|
+
* @param event the event to listen to
|
|
11
|
+
* @param listener the listener to be called.
|
|
12
|
+
*/
|
|
13
|
+
on(event: string, listener: Listener): void;
|
|
14
|
+
/**
|
|
15
|
+
* removes a previously registered listener
|
|
16
|
+
* @param event the event
|
|
17
|
+
* @param listener the listener that should be removed.
|
|
18
|
+
* @return `true` if the listener was removed, `false` otherwise.
|
|
19
|
+
*/
|
|
20
|
+
off(event: string, listener: any): boolean;
|
|
21
|
+
/**
|
|
22
|
+
* removes all listeners for the given event.
|
|
23
|
+
* @param event the event for which all listeners will be removed.
|
|
24
|
+
*/
|
|
25
|
+
offAll(event: string): void;
|
|
26
|
+
/**
|
|
27
|
+
* Checks weather at least one listener exists for a given event.
|
|
28
|
+
* @param event the event to check for
|
|
29
|
+
* @return weather or not any listeners for the given event are registered.
|
|
30
|
+
*/
|
|
31
|
+
hasListeners(event: string): boolean;
|
|
32
|
+
/**
|
|
33
|
+
* Returns all events that have at least one listeners registered to them.
|
|
34
|
+
* @return An array containing all events that have at least one listener.
|
|
35
|
+
* If no listeners are registered at all, an empty array will be returned.
|
|
36
|
+
*/
|
|
37
|
+
getEventsWithListeners(): string[];
|
|
38
|
+
/**
|
|
39
|
+
* Emits an event dispatching it to all listeners registered for it.
|
|
40
|
+
* @param event the event name.
|
|
41
|
+
* @param data the event data.
|
|
42
|
+
*/
|
|
43
|
+
emit(event: string, data?: any): void;
|
|
44
|
+
}
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
export declare enum AgentAvailabilityState {
|
|
2
|
+
/**
|
|
3
|
+
* There is at least one agent available for the specified named area and locale.
|
|
4
|
+
*/
|
|
5
|
+
AVAILABLE = "AVAILABLE",
|
|
6
|
+
/**
|
|
7
|
+
* There is at least one agent watching the inbound queue for the specified named area and locale but the max capacity of parallel conversations is reached.
|
|
8
|
+
*
|
|
9
|
+
* It is very likely, that an agent will be available in a short time.
|
|
10
|
+
*/
|
|
11
|
+
BUSY = "BUSY",
|
|
12
|
+
/**
|
|
13
|
+
* There is currently no agent handling any inbound queue items.
|
|
14
|
+
*
|
|
15
|
+
* It is very unlikely, that an agent will be available in a short time.
|
|
16
|
+
*/
|
|
17
|
+
UNAVAILABLE = "UNAVAILABLE"
|
|
18
|
+
}
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
export interface Language {
|
|
2
|
+
/**
|
|
3
|
+
* BCP 47 language tag representation
|
|
4
|
+
*/
|
|
5
|
+
languageTag: string;
|
|
6
|
+
/**
|
|
7
|
+
* Name of the language in the current locale
|
|
8
|
+
*/
|
|
9
|
+
name: string;
|
|
10
|
+
/**
|
|
11
|
+
* Native name of the language localized with the language of this instance
|
|
12
|
+
*/
|
|
13
|
+
nativeName: string;
|
|
14
|
+
}
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
import { AgentAvailabilityState } from "../agent-availability-state";
|
|
2
|
+
export interface NamedAreaAgentAvailability {
|
|
3
|
+
/**
|
|
4
|
+
* Display name of named area
|
|
5
|
+
*/
|
|
6
|
+
displayName: string;
|
|
7
|
+
/**
|
|
8
|
+
* Description of named area
|
|
9
|
+
*/
|
|
10
|
+
description: string;
|
|
11
|
+
/**
|
|
12
|
+
* Site ID of named area
|
|
13
|
+
*/
|
|
14
|
+
namedAreaSiteId: string;
|
|
15
|
+
/**
|
|
16
|
+
* Agent availability state of named area
|
|
17
|
+
*/
|
|
18
|
+
availability: AgentAvailabilityState;
|
|
19
|
+
}
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
export declare enum CallConnectionState {
|
|
2
|
+
/**
|
|
3
|
+
* Call is connecting to call service
|
|
4
|
+
*/
|
|
5
|
+
CONNECTING = "CONNECTING",
|
|
6
|
+
/**
|
|
7
|
+
* Call is connected to call service
|
|
8
|
+
*/
|
|
9
|
+
CONNECTED = "CONNECTED",
|
|
10
|
+
/**
|
|
11
|
+
* Call is reconnecting to call service, possibly due to poor internet connectivity
|
|
12
|
+
*/
|
|
13
|
+
RECONNECTING = "RECONNECTING",
|
|
14
|
+
/**
|
|
15
|
+
* Call is disconnected, either because there is no call in the conversation or it isn't joined
|
|
16
|
+
*/
|
|
17
|
+
DISCONNECTED = "DISCONNECTED"
|
|
18
|
+
}
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
export declare enum CallState {
|
|
2
|
+
/**
|
|
3
|
+
* A some one is trying to call, the phone is ringing
|
|
4
|
+
*/
|
|
5
|
+
INBOUND = "INBOUND",
|
|
6
|
+
/**
|
|
7
|
+
* You are trying to call someone
|
|
8
|
+
*/
|
|
9
|
+
OUTBOUND = "OUTBOUND",
|
|
10
|
+
/**
|
|
11
|
+
* A call is active and the local tab is connected to the call, however there is currently no other participant in the call.
|
|
12
|
+
*/
|
|
13
|
+
ACTIVE_JOINED_ALONE = "ACTIVE_JOINED_ALONE",
|
|
14
|
+
/**
|
|
15
|
+
* A call is active and the local tab is connected to the call and there is at least one other participant to which the connection is established.
|
|
16
|
+
*/
|
|
17
|
+
ACTIVE_JOINED = "ACTIVE_JOINED",
|
|
18
|
+
/**
|
|
19
|
+
* A call is active but the local person has declined it.
|
|
20
|
+
*/
|
|
21
|
+
ACTIVE_NOT_JOINED = "ACTIVE_NOT_JOINED",
|
|
22
|
+
/**
|
|
23
|
+
* A call is active and the local person has joined it on an other device.
|
|
24
|
+
*/
|
|
25
|
+
ACTIVE_JOINED_ELSEWHERE = "ACTIVE_JOINED_ELSEWHERE",
|
|
26
|
+
/**
|
|
27
|
+
* No inbound, outgoing or active call.
|
|
28
|
+
*/
|
|
29
|
+
NONE = "NONE"
|
|
30
|
+
}
|
|
@@ -0,0 +1,53 @@
|
|
|
1
|
+
export interface Configuration {
|
|
2
|
+
/**
|
|
3
|
+
* The API key to use.
|
|
4
|
+
* This is a mandatory configuration.
|
|
5
|
+
*
|
|
6
|
+
* You can retrieve API keys from the Account Configuration interface.
|
|
7
|
+
* This requires the `ADMIN` user role.
|
|
8
|
+
*/
|
|
9
|
+
apiKey: string;
|
|
10
|
+
/**
|
|
11
|
+
* The BranchClient token to use.
|
|
12
|
+
* This is a mandatory configuration for the branch client. When branch clients are defined in the branch client
|
|
13
|
+
* configuration on the collaboration server, the token will be generated and can be retrieved from there.
|
|
14
|
+
*
|
|
15
|
+
*/
|
|
16
|
+
branchClientToken?: string;
|
|
17
|
+
/**
|
|
18
|
+
* The URL of the Unblu server to connect to.
|
|
19
|
+
*
|
|
20
|
+
* @default If not set, the domain of the current page is used.
|
|
21
|
+
*/
|
|
22
|
+
serverUrl?: string;
|
|
23
|
+
/**
|
|
24
|
+
* The public path used with {@link serverUrl} to connect to Unblu.
|
|
25
|
+
*
|
|
26
|
+
* @default If not set, '/unblu' is used.
|
|
27
|
+
*/
|
|
28
|
+
entryPath?: string;
|
|
29
|
+
/**
|
|
30
|
+
* The locale to use for all Unblu translation texts.
|
|
31
|
+
*
|
|
32
|
+
* @default If not set, the browser's locale will be used.
|
|
33
|
+
*/
|
|
34
|
+
locale?: string;
|
|
35
|
+
/**
|
|
36
|
+
* The named area to be used.
|
|
37
|
+
* The named area determines the queue that conversation requests go to, the agent availability, and the configuration.
|
|
38
|
+
*
|
|
39
|
+
* @default If not set, the named area specified in the HTML `meta` element named `unblu:named-area` is used.
|
|
40
|
+
* If no such element is present, the named area associated with the current domain is used.
|
|
41
|
+
*/
|
|
42
|
+
namedArea?: string;
|
|
43
|
+
/**
|
|
44
|
+
* The timeout in milliseconds for the Unblu integration to load.
|
|
45
|
+
*
|
|
46
|
+
* @default 30'000 (30 seconds)
|
|
47
|
+
*/
|
|
48
|
+
initTimeout?: number;
|
|
49
|
+
/**
|
|
50
|
+
* The access token used to log the user in before initializing Unblu.
|
|
51
|
+
*/
|
|
52
|
+
accessToken?: string;
|
|
53
|
+
}
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
export declare enum ConnectionState {
|
|
2
|
+
/**
|
|
3
|
+
* Initial state before connection establishment has started
|
|
4
|
+
*/
|
|
5
|
+
INITIAL = "INITIAL",
|
|
6
|
+
/**
|
|
7
|
+
* State during the first connection to the server
|
|
8
|
+
*/
|
|
9
|
+
CONNECTING = "CONNECTING",
|
|
10
|
+
/**
|
|
11
|
+
* The connection has been successfully established.
|
|
12
|
+
*/
|
|
13
|
+
CONNECTED = "CONNECTED",
|
|
14
|
+
/**
|
|
15
|
+
* The connection has been lost, reconnect is active.
|
|
16
|
+
*/
|
|
17
|
+
RECONNECTING = "RECONNECTING",
|
|
18
|
+
/**
|
|
19
|
+
* The connection has been successfully closed.
|
|
20
|
+
*
|
|
21
|
+
*/
|
|
22
|
+
CLOSED = "CLOSED",
|
|
23
|
+
/**
|
|
24
|
+
* A fatal error has occurred. The connection has been permanently lost. No reconnect will be be possible.
|
|
25
|
+
*/
|
|
26
|
+
ERROR = "ERROR"
|
|
27
|
+
}
|
|
@@ -0,0 +1,42 @@
|
|
|
1
|
+
import { ConversationRecipient } from "./conversation-recipient";
|
|
2
|
+
import { ConversationParticipationType } from "./conversation-participation-type";
|
|
3
|
+
import { ConversationParticipant } from "./conversation-participant";
|
|
4
|
+
import { ConversationState } from "./conversation-state";
|
|
5
|
+
export interface ConversationInfo {
|
|
6
|
+
/**
|
|
7
|
+
* The ID of the conversation.
|
|
8
|
+
*/
|
|
9
|
+
id: string;
|
|
10
|
+
/**
|
|
11
|
+
* Conversation state.
|
|
12
|
+
*/
|
|
13
|
+
state: ConversationState;
|
|
14
|
+
/**
|
|
15
|
+
* Conversation creation timestamp in milliseconds elapsed since January 1, 1970 00:00:00 UTC.
|
|
16
|
+
*/
|
|
17
|
+
creationTimestamp: number;
|
|
18
|
+
/**
|
|
19
|
+
* Notification count of this conversation.
|
|
20
|
+
*/
|
|
21
|
+
notificationCount: number;
|
|
22
|
+
/**
|
|
23
|
+
* Participation type of the current person in this conversation
|
|
24
|
+
*/
|
|
25
|
+
myParticipationType: ConversationParticipationType;
|
|
26
|
+
/**
|
|
27
|
+
* All other participants of this conversation
|
|
28
|
+
*/
|
|
29
|
+
otherParticipants: [ConversationParticipant];
|
|
30
|
+
/**
|
|
31
|
+
* The current recipient of this conversation
|
|
32
|
+
*/
|
|
33
|
+
recipient: ConversationRecipient;
|
|
34
|
+
/**
|
|
35
|
+
* Topic of this conversation; null if not set
|
|
36
|
+
*/
|
|
37
|
+
topic?: string;
|
|
38
|
+
/**
|
|
39
|
+
* The custom visitor data of the conversation. Null if not set.
|
|
40
|
+
*/
|
|
41
|
+
visitorData?: string;
|
|
42
|
+
}
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import { ConversationParticipationType } from "./conversation-participation-type";
|
|
2
|
+
export interface ConversationParticipant {
|
|
3
|
+
/**
|
|
4
|
+
* Person ID of the participant
|
|
5
|
+
*/
|
|
6
|
+
personId: string;
|
|
7
|
+
/**
|
|
8
|
+
* Name of the participant
|
|
9
|
+
*/
|
|
10
|
+
name: string;
|
|
11
|
+
/**
|
|
12
|
+
* Participation type of the participant
|
|
13
|
+
*/
|
|
14
|
+
participationType: ConversationParticipationType;
|
|
15
|
+
}
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
export declare enum ConversationParticipationType {
|
|
2
|
+
/**
|
|
3
|
+
* The main agent of the conversation. There can only be one per conversation at any given point in time.
|
|
4
|
+
*/
|
|
5
|
+
ASSIGNED_AGENT = "ASSIGNED_AGENT",
|
|
6
|
+
/**
|
|
7
|
+
* The main visitor of the conversation. There can only be one per conversation at any given point in time.
|
|
8
|
+
*/
|
|
9
|
+
CONTEXT_PERSON = "CONTEXT_PERSON",
|
|
10
|
+
/**
|
|
11
|
+
* A secondary agent. Multiple instances per conversation possible.
|
|
12
|
+
*/
|
|
13
|
+
SECONDARY_AGENT = "SECONDARY_AGENT",
|
|
14
|
+
/**
|
|
15
|
+
* A secondary visitor. Multiple instances per conversation possible.
|
|
16
|
+
*/
|
|
17
|
+
SECONDARY_VISITOR = "SECONDARY_VISITOR"
|
|
18
|
+
}
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
export declare enum ConversationRecipientType {
|
|
2
|
+
/**
|
|
3
|
+
* The recipient type for a conversation is the account
|
|
4
|
+
*/
|
|
5
|
+
ACCOUNT = "ACCOUNT",
|
|
6
|
+
/**
|
|
7
|
+
* The recipient type for a conversation is a named area
|
|
8
|
+
*/
|
|
9
|
+
NAMED_AREA = "NAMED_AREA",
|
|
10
|
+
/**
|
|
11
|
+
* The recipient type for a conversation is a team
|
|
12
|
+
*/
|
|
13
|
+
TEAM = "TEAM",
|
|
14
|
+
/**
|
|
15
|
+
* The recipient type for a conversation is an agent
|
|
16
|
+
*/
|
|
17
|
+
AGENT = "AGENT"
|
|
18
|
+
}
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
import { ConversationRecipientType } from "./conversation-recipient-type";
|
|
2
|
+
/**
|
|
3
|
+
* The recipient of a conversation
|
|
4
|
+
*/
|
|
5
|
+
export interface ConversationRecipient {
|
|
6
|
+
/**
|
|
7
|
+
* The ID of the recipient. Depending on the type, this either refers to an agent person ID or to a team ID
|
|
8
|
+
*/
|
|
9
|
+
id: string;
|
|
10
|
+
/**
|
|
11
|
+
* The recipient type
|
|
12
|
+
*/
|
|
13
|
+
recipientType: ConversationRecipientType;
|
|
14
|
+
/**
|
|
15
|
+
* The name of the recipient
|
|
16
|
+
*/
|
|
17
|
+
name: string;
|
|
18
|
+
}
|
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
export declare enum ConversationState {
|
|
2
|
+
/**
|
|
3
|
+
* Initial state of a conversation
|
|
4
|
+
*/
|
|
5
|
+
CREATED = "CREATED",
|
|
6
|
+
/**
|
|
7
|
+
* Depending of the engagement type of the conversation, the conversation stays in the onboarding state as long as the person in the center of the conversation
|
|
8
|
+
* is doing his onboarding
|
|
9
|
+
*/
|
|
10
|
+
ONBOARDING = "ONBOARDING",
|
|
11
|
+
/**
|
|
12
|
+
* When a message is send to an unassigned conversation, the conversation first is put into the reboarding state as long as the person in the center of the
|
|
13
|
+
* conversation is doing the reboarding.
|
|
14
|
+
*/
|
|
15
|
+
REBOARDING = "REBOARDING",
|
|
16
|
+
/**
|
|
17
|
+
* Depending of the engagement type of the conversation, the conversation is put in the queued state when it is inside the queue.
|
|
18
|
+
*/
|
|
19
|
+
QUEUED = "QUEUED",
|
|
20
|
+
/**
|
|
21
|
+
* Conversation is active
|
|
22
|
+
*/
|
|
23
|
+
ACTIVE = "ACTIVE",
|
|
24
|
+
/**
|
|
25
|
+
* After there is no assignee of a conversation anymore, the conversation goes to unassigned state until a message from a visitor is written to start reboarding
|
|
26
|
+
* again.
|
|
27
|
+
*/
|
|
28
|
+
UNASSIGNED = "UNASSIGNED",
|
|
29
|
+
/**
|
|
30
|
+
* Conversation is being ended
|
|
31
|
+
*/
|
|
32
|
+
OFFBOARDING = "OFFBOARDING",
|
|
33
|
+
/**
|
|
34
|
+
* Conversation is ended
|
|
35
|
+
*/
|
|
36
|
+
ENDED = "ENDED"
|
|
37
|
+
}
|
|
@@ -0,0 +1,47 @@
|
|
|
1
|
+
export declare enum ConversationType {
|
|
2
|
+
/**
|
|
3
|
+
* (Visitor initiated, visitor centered) A visitor creates an incoming chat conversation.
|
|
4
|
+
*/
|
|
5
|
+
CHAT_REQUEST = "CHAT_REQUEST",
|
|
6
|
+
/**
|
|
7
|
+
* (Visitor initiated, visitor centered) A visitor creates an incoming chat conversation while all agents are offline.
|
|
8
|
+
*/
|
|
9
|
+
OFFLINE_CHAT_REQUEST = "OFFLINE_CHAT_REQUEST",
|
|
10
|
+
/**
|
|
11
|
+
* (Visitor initiated, visitor centered) A visitor creates an incoming video conversation.
|
|
12
|
+
*/
|
|
13
|
+
VIDEO_REQUEST = "VIDEO_REQUEST",
|
|
14
|
+
/**
|
|
15
|
+
* (Visitor initiated, visitor centered) A visitor creates an incoming audio conversation.
|
|
16
|
+
*/
|
|
17
|
+
AUDIO_REQUEST = "AUDIO_REQUEST",
|
|
18
|
+
/**
|
|
19
|
+
* (Visitor initiated, visitor centered) A visitor creates an incoming universal co-browsing conversation.
|
|
20
|
+
*/
|
|
21
|
+
HEADLESS_BROWSER_REQUEST = "HEADLESS_BROWSER_REQUEST",
|
|
22
|
+
/**
|
|
23
|
+
* (Visitor initiated, visitor centered) A visitor creates an incoming embedded co-browsing conversation.
|
|
24
|
+
*/
|
|
25
|
+
DOMCAP_BROWSER_REQUEST = "DOMCAP_BROWSER_REQUEST",
|
|
26
|
+
/**
|
|
27
|
+
* (Visitor initiated, visitor centered) A visitor creates an incoming mobile co-browsing conversation.
|
|
28
|
+
*/
|
|
29
|
+
MOBILE_COBROWSING_REQUEST = "MOBILE_COBROWSING_REQUEST",
|
|
30
|
+
/**
|
|
31
|
+
* (Visitor initiated, visitor centered) A visitor creates an incoming whiteboard conversation.
|
|
32
|
+
*/
|
|
33
|
+
WHITEBOARD_REQUEST = "WHITEBOARD_REQUEST",
|
|
34
|
+
/**
|
|
35
|
+
* (Visitor initiated, visitor centered) A visitor creates an incoming screen sharing conversation.
|
|
36
|
+
*/
|
|
37
|
+
SCREEN_SHARING_REQUEST = "SCREEN_SHARING_REQUEST",
|
|
38
|
+
/**
|
|
39
|
+
* (Api initiated, visitor centered) A visitor creates a conversation via API which is not added to the queue and where he can invite other visitor to do
|
|
40
|
+
* embedded
|
|
41
|
+
*/
|
|
42
|
+
VISITOR_COBROWSING = "VISITOR_COBROWSING",
|
|
43
|
+
/**
|
|
44
|
+
* (Visitor initiated, visitor centered) A visitor creates an incoming branch client conversation.
|
|
45
|
+
*/
|
|
46
|
+
BRANCH_CLIENT_REQUEST = "BRANCH_CLIENT_REQUEST"
|
|
47
|
+
}
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
import { PersonInfo } from "../person-info";
|
|
2
|
+
import { ConversationInfo } from "../conversation-info";
|
|
3
|
+
/**
|
|
4
|
+
* CustomActionInvocation represents an event containing information about the invoked custom action
|
|
5
|
+
*/
|
|
6
|
+
export interface CustomActionInvocation {
|
|
7
|
+
/**
|
|
8
|
+
* The invocation ID
|
|
9
|
+
*/
|
|
10
|
+
invocationId: string;
|
|
11
|
+
/**
|
|
12
|
+
* The unique key of the invoked custom action
|
|
13
|
+
*/
|
|
14
|
+
key: string;
|
|
15
|
+
/**
|
|
16
|
+
* UTC timestamp, in milliseconds, of the custom action invocation
|
|
17
|
+
*/
|
|
18
|
+
invocationTimestamp: number;
|
|
19
|
+
/**
|
|
20
|
+
* The person who invoked the custom action
|
|
21
|
+
*/
|
|
22
|
+
invokingPerson: PersonInfo;
|
|
23
|
+
/**
|
|
24
|
+
* The conversation the custom action was invoked in
|
|
25
|
+
*/
|
|
26
|
+
conversation: ConversationInfo;
|
|
27
|
+
}
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import { CustomActionInvocation } from "./custom-action-invocation";
|
|
2
|
+
import { PersonInfo } from "../person-info";
|
|
3
|
+
import { ConversationMessageInfo } from "../conversation-message-info";
|
|
4
|
+
/**
|
|
5
|
+
* Custom message action invocation
|
|
6
|
+
*/
|
|
7
|
+
export interface CustomMessageActionInvocation extends CustomActionInvocation {
|
|
8
|
+
/**
|
|
9
|
+
* The conversation containing the message that the custom action was invoked on is part of
|
|
10
|
+
*/
|
|
11
|
+
targetMessage: ConversationMessageInfo;
|
|
12
|
+
/**
|
|
13
|
+
* The sender of the message the custom action was invoked on
|
|
14
|
+
*/
|
|
15
|
+
targetMessageSender: PersonInfo;
|
|
16
|
+
}
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import { CustomActionInvocation } from "./custom-action-invocation";
|
|
2
|
+
import { PersonInfo } from "../person-info";
|
|
3
|
+
/**
|
|
4
|
+
* Custom person action invocation
|
|
5
|
+
*/
|
|
6
|
+
export interface CustomPersonActionInvocation extends CustomActionInvocation {
|
|
7
|
+
/**
|
|
8
|
+
* The person the custom action was invoked on
|
|
9
|
+
*/
|
|
10
|
+
targetPerson: PersonInfo;
|
|
11
|
+
}
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import { NewConversationRecipient } from "./new-conversation-recipient";
|
|
2
|
+
/**
|
|
3
|
+
* The result of calling a {@link NewConversationInterceptor}.
|
|
4
|
+
*/
|
|
5
|
+
export interface NewConversationInterceptorResult {
|
|
6
|
+
/**
|
|
7
|
+
* Custom visitor data that will be stored on the conversation and can be accessed through the Web API later on. This data won't be displayed anywhere and is for API usage only.
|
|
8
|
+
*/
|
|
9
|
+
visitorData?: string;
|
|
10
|
+
/**
|
|
11
|
+
* The team or agent recipient of the conversation. This overwrites any named area that may be set on the web page.
|
|
12
|
+
*/
|
|
13
|
+
recipient?: NewConversationRecipient;
|
|
14
|
+
}
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import { NewConversationRecipientType } from "./new-conversation-recipient-type";
|
|
2
|
+
/**
|
|
3
|
+
* The recipient of a conversation
|
|
4
|
+
*/
|
|
5
|
+
export interface NewConversationRecipient {
|
|
6
|
+
/**
|
|
7
|
+
* The ID of the recipient. Depending on the recipient type, this refers either to an agent person ID or a team ID.
|
|
8
|
+
*/
|
|
9
|
+
id: string;
|
|
10
|
+
/**
|
|
11
|
+
* The recipient type
|
|
12
|
+
*/
|
|
13
|
+
recipientType: NewConversationRecipientType;
|
|
14
|
+
}
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
import { ConversationType } from "./model/conversation-type";
|
|
2
|
+
import { NewConversationRecipient } from "./model/new-conversation-recipient";
|
|
3
|
+
import { NewConversationInterceptorResult } from "./model/new-conversation-interceptor-result";
|
|
4
|
+
/**
|
|
5
|
+
* Interceptor function which is called every time a new conversation is started from the UI or JS API.
|
|
6
|
+
*
|
|
7
|
+
* Starting the conversation is deferred until the Promise returned by this interceptor resolves:
|
|
8
|
+
* - If the interceptor rejects the Promise, starting the conversation will be cancelled.
|
|
9
|
+
* - If the interceptor resolves the Promise with a String, the value of the String will be used and set as "visitorData" for the conversation created.
|
|
10
|
+
* - If the interceptor resolves the Promise with a {@link NewConversationInterceptorResult}, the values from it will be used for the "visitorData" and the "recipient" for the conversation created.
|
|
11
|
+
* - If the resolved value is undefined, the value passed into the {@link UnbluApi.startConversation} method will be used.
|
|
12
|
+
* - If the resolved value is set to null, any value passed into {@link UnbluApi.startConversation} will be discarded.
|
|
13
|
+
* - If the resolved value is neither a {@link NewConversationInterceptorResult}, nor a String, nor undefined, the conversation is started without any visitorData.
|
|
14
|
+
* - If the interceptor resolves the Promise with something other than a {@link NewConversationInterceptorResult} or a String, the conversation is started without any visitorData.
|
|
15
|
+
*
|
|
16
|
+
* Any values of {@link NewConversationInterceptorResult} that are undefined are replaced by the corresponding values passed to {@link UnbluApi.startConversation}.
|
|
17
|
+
* Any values of {@link NewConversationInterceptorResult} that are null discard the corresponding values passed to {@link UnbluApi.startConversation}.
|
|
18
|
+
*
|
|
19
|
+
* @param conversationType The type of the conversation being started.
|
|
20
|
+
* @param visitorData Optional visitorData, only present if passed to the {@link UnbluApi.startConversation} method
|
|
21
|
+
* @param recipient Optional recipient, only present if passed to the {@link UnbluApi.startConversation} method
|
|
22
|
+
* @return A Promise deferring the start of the conversation until it resolves.
|
|
23
|
+
*/
|
|
24
|
+
export type NewConversationInterceptor = (conversationType: ConversationType, visitorData?: String, recipient?: NewConversationRecipient) => Promise<String | NewConversationInterceptorResult>;
|