@unblu/floating-js-api 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.
Files changed (54) hide show
  1. package/dist/lib/index.d.ts +98 -0
  2. package/dist/lib/internal/internal-api.d.ts +18 -0
  3. package/dist/lib/internal/module/general-lazy-module.d.ts +17 -0
  4. package/dist/lib/internal/module/general-module.d.ts +31 -0
  5. package/dist/lib/internal/module/meta-module.d.ts +18 -0
  6. package/dist/lib/model/individualui_component.d.ts +29 -0
  7. package/dist/lib/model/individualui_state.d.ts +14 -0
  8. package/dist/lib/shared/api-state.d.ts +8 -0
  9. package/dist/lib/shared/conversation.d.ts +313 -0
  10. package/dist/lib/shared/internal/api-bridge.d.ts +36 -0
  11. package/dist/lib/shared/internal/event.d.ts +6 -0
  12. package/dist/lib/shared/internal/initialized-unblu-api.d.ts +10 -0
  13. package/dist/lib/shared/internal/initialized-unblu-element.d.ts +10 -0
  14. package/dist/lib/shared/internal/java-error-codes.d.ts +5 -0
  15. package/dist/lib/shared/internal/model/destroy-mode.d.ts +4 -0
  16. package/dist/lib/shared/internal/model/destroy-options.d.ts +4 -0
  17. package/dist/lib/shared/internal/module/agent-availability-module.d.ts +14 -0
  18. package/dist/lib/shared/internal/module/base-general-module.d.ts +35 -0
  19. package/dist/lib/shared/internal/module/conversation-module.d.ts +64 -0
  20. package/dist/lib/shared/internal/module/module.d.ts +10 -0
  21. package/dist/lib/shared/internal/unblu-floating-api.d.ts +15 -0
  22. package/dist/lib/shared/internal/unblu-util.d.ts +76 -0
  23. package/dist/lib/shared/internal/util/event-emitter.d.ts +44 -0
  24. package/dist/lib/shared/model/agent-availability-state.d.ts +18 -0
  25. package/dist/lib/shared/model/branchclient/language.d.ts +14 -0
  26. package/dist/lib/shared/model/branchclient/named-area-agent-availability.d.ts +19 -0
  27. package/dist/lib/shared/model/call-connection-state.d.ts +18 -0
  28. package/dist/lib/shared/model/call-state.d.ts +30 -0
  29. package/dist/lib/shared/model/configuration.d.ts +53 -0
  30. package/dist/lib/shared/model/connection-state.d.ts +27 -0
  31. package/dist/lib/shared/model/conversation-info.d.ts +42 -0
  32. package/dist/lib/shared/model/conversation-message-info.d.ts +14 -0
  33. package/dist/lib/shared/model/conversation-participant.d.ts +15 -0
  34. package/dist/lib/shared/model/conversation-participation-type.d.ts +18 -0
  35. package/dist/lib/shared/model/conversation-recipient-type.d.ts +18 -0
  36. package/dist/lib/shared/model/conversation-recipient.d.ts +18 -0
  37. package/dist/lib/shared/model/conversation-state.d.ts +37 -0
  38. package/dist/lib/shared/model/conversation-type.d.ts +47 -0
  39. package/dist/lib/shared/model/customaction/custom-action-invocation.d.ts +27 -0
  40. package/dist/lib/shared/model/customaction/custom-conversation-action-invocation.d.ts +6 -0
  41. package/dist/lib/shared/model/customaction/custom-message-action-invocation.d.ts +16 -0
  42. package/dist/lib/shared/model/customaction/custom-person-action-invocation.d.ts +11 -0
  43. package/dist/lib/shared/model/new-conversation-interceptor-result.d.ts +14 -0
  44. package/dist/lib/shared/model/new-conversation-recipient-type.d.ts +10 -0
  45. package/dist/lib/shared/model/new-conversation-recipient.d.ts +14 -0
  46. package/dist/lib/shared/model/person-info.d.ts +5 -0
  47. package/dist/lib/shared/new-conversation-interceptor.d.ts +24 -0
  48. package/dist/lib/shared/unblu-api-error.d.ts +117 -0
  49. package/dist/lib/unblu-api-ui.d.ts +137 -0
  50. package/dist/lib/unblu-api.d.ts +380 -0
  51. package/dist/lib/unblu-api.js +1 -3
  52. package/dist/lib/unblu-api.js.map +1 -1
  53. package/dist/lib/unblu-static-api.d.ts +237 -0
  54. package/package.json +1 -1
@@ -0,0 +1,380 @@
1
+ import { InternalApi } from './internal/internal-api';
2
+ import { Conversation } from './shared/conversation';
3
+ import { PersonInfo } from './shared/model/person-info';
4
+ import { Listener } from './shared/internal/util/event-emitter';
5
+ import { ConversationType } from './shared/model/conversation-type';
6
+ import { AgentAvailabilityState } from './shared/model/agent-availability-state';
7
+ import { AgentAvailabilityEventType } from './shared/internal/module/agent-availability-module';
8
+ import { UnbluUiApi } from './unblu-api-ui';
9
+ import { MetaEventType } from "./internal/module/meta-module";
10
+ import { ConversationInfo } from "./shared/model/conversation-info";
11
+ import { NewConversationInterceptor } from "./shared/new-conversation-interceptor";
12
+ import { GeneralEventType } from "./internal/module/general-module";
13
+ import { InitializedUnbluApi } from "./shared/internal/initialized-unblu-api";
14
+ import { NewConversationRecipient } from "./shared/model/new-conversation-recipient";
15
+ import { DestroyOptions } from "./shared/internal/model/destroy-options";
16
+ /**
17
+ * Listener called whenever the active conversation changes.
18
+ *
19
+ * **Note:** If no conversation is currently active the passed conversation object will be `null`
20
+ * @param conversation API object for the active conversation or `null` if no conversation is active.
21
+ */
22
+ export type ConversationChangeListener = (conversation?: Conversation) => void;
23
+ /**
24
+ * Listener called whenever a conversation changed, added or removed from all conversations.
25
+ * @param conversations All conversations of the current visitor.
26
+ */
27
+ export type ConversationsChangeListener = (conversations: ConversationInfo[]) => void;
28
+ /**
29
+ * Listener called whenever the notification count of a person (i.e. unread messages) changes.
30
+ * @param count The number of unseen notifications.
31
+ */
32
+ export type NotificationCountChangeListener = (count: number) => void;
33
+ /**
34
+ * Listener called whenever the local person changes.
35
+ * @param person Info about the person.
36
+ */
37
+ export type PersonChangeListener = (person: PersonInfo) => void;
38
+ /**
39
+ * Listener called whenever there is activity by the person.
40
+ * @param lastActivity A UTC timestamp when the last activity happened.
41
+ */
42
+ export type PersonActivityListener = (lastActivity: Number) => void;
43
+ /**
44
+ * Listener called whenever the agent availability changes.
45
+ * @param isAvailable A boolean that indicates if an agent is available.
46
+ */
47
+ export type AgentAvailableChangeListener = (isAvailable: boolean) => void;
48
+ /**
49
+ * Listener called whenever the agent availability state changes.
50
+ * @param availability The new availability state.
51
+ */
52
+ export type AgentAvailabilityChangeListener = (availability: AgentAvailabilityState) => void;
53
+ /**
54
+ * Listener called whenever the UnbluApi gets de-initialized.
55
+ */
56
+ export type DeinitializationListener = () => void;
57
+ /**
58
+ * #### This class represents the initialized Unblu Floating JS API.
59
+ *
60
+ * There is only ever one instance of this api which can be retrieved via `unblu.floating.api.initialize()`.
61
+ * See {@link UnbluStaticApi} for more details on configuring and initializing the UnbluApi.
62
+ *
63
+ * The API connects to the integrated version of Unblu. All actions performed via the UnbluApi are executed in
64
+ * the name of and with the rights of current visitor and may have direct effect on the displayed Unblu UI.
65
+ *
66
+ * For example if a conversation is started from the UnbluApi, the Unblu UI will navigate to it.
67
+ * If a conversation is closed via the API, it will also be closed on the Unblu UI of the visitor.
68
+ * For more information on UI side effects please check the documentation for each method call.
69
+ *
70
+ * For programmatic administrator access and configuration of Unblu please use the Unblu WebAPI.
71
+ */
72
+ export declare class UnbluApi implements InitializedUnbluApi {
73
+ private internalApi;
74
+ /**
75
+ * Event emitted every time the active conversation changes.
76
+ *
77
+ * This may happen due to a UI-navigation or an API-call.
78
+ *
79
+ * @event activeConversationChange
80
+ * @see {@link on} for listener registration
81
+ * @see {@link ConversationChangeListener}
82
+ */
83
+ static readonly ACTIVE_CONVERSATION_CHANGE: 'activeConversationChange';
84
+ /**
85
+ * Event emitted every time one of the conversations accessible to the current user changes or one is added or removed.
86
+ *
87
+ * @event conversationsChanged
88
+ * @see {@link on} for listener registration
89
+ * @see {@link ConversationsChangeListener}
90
+ */
91
+ static readonly CONVERSATIONS_CHANGE: 'conversationsChange';
92
+ /**
93
+ * Event emitted every time the notification count (unread messages) changes.
94
+ *
95
+ * @event notificationCountChange
96
+ * @see {@link on} for listener registration
97
+ * @see {@link NotificationCountChangeListener}
98
+ */
99
+ static readonly NOTIFICATION_COUNT_CHANGE: 'notificationCountChange';
100
+ /**
101
+ * Event emitted every time the local person changes. This may be i.e. due to the person setting its name.
102
+ *
103
+ * @event personChange
104
+ * @see {@link on} for listener registration
105
+ * @see {@link PersonChangeListener}
106
+ */
107
+ static readonly PERSON_CHANGE: 'personChange';
108
+ /**
109
+ * Event emitted every time the local person has some activity inside Unblu.
110
+ * This may be i.e. an interaction with the chat, a call, opening a conversation or interacting
111
+ * with a co-browsing layer.
112
+ *
113
+ * The event can be used to reset the logout timer inside an authenticated area, for example.
114
+ *
115
+ * The configuration property com.unblu.conversation.activity.activityCategoriesToTrack specifies which categories of activity trigger the event.
116
+ *
117
+ * @event personActivity
118
+ * @see {@link on} for listener registration
119
+ * @see {@link PersonActivityListener}
120
+ */
121
+ static readonly PERSON_ACTIVITY: 'personActivity';
122
+ /**
123
+ * Event emitted every time the agent availability changes for the current named area and locale.
124
+ *
125
+ * @event availableChange
126
+ * @see {@link on} for listener registration
127
+ * @see {@link AgentAvailableChangeListener}
128
+ */
129
+ static readonly AGENT_AVAILABLE_CHANGE: 'availableChange';
130
+ /**
131
+ * Event emitted every time the agent availability state changes for the current named area and locale.
132
+ *
133
+ * @event availabilityChange
134
+ * @see {@link on} for listener registration
135
+ * @see {@link AgentAvailabilityChangeListener}
136
+ */
137
+ static readonly AGENT_AVAILABILITY_CHANGE: 'availabilityChange';
138
+ /**
139
+ * Event emitted when this instance gets de-initialized and is not usable at the time until it fully got de-initialized.
140
+ *
141
+ * @event deinitializing
142
+ * @see {@link on} for listener registration
143
+ * @see {@link DeinitializationListener}
144
+ */
145
+ static readonly DEINITIALIZING: 'deinitializing';
146
+ /**
147
+ * Event emitted when this instance got de-initialized and has to be initialized again.
148
+ *
149
+ * @event deinitialized
150
+ * @see {@link on} for listener registration
151
+ * @see {@link DeinitializationListener}
152
+ */
153
+ static readonly DEINITIALIZED: 'deinitialized';
154
+ /**
155
+ * Access the UI functionality over the UI property.
156
+ */
157
+ ui: UnbluUiApi;
158
+ private internalListeners;
159
+ private eventEmitter;
160
+ /**
161
+ * @hidden
162
+ */
163
+ constructor(internalApi: InternalApi);
164
+ /**
165
+ * Registers an event listener for the given event.
166
+ * @param event The activeConversationChange event.
167
+ * @param listener The listener to be called.
168
+ * @see {@link ACTIVE_CONVERSATION_CHANGE}
169
+ */
170
+ on(event: typeof UnbluApi.ACTIVE_CONVERSATION_CHANGE, listener: ConversationChangeListener): void;
171
+ /**
172
+ * Registers an event listener for the given event.
173
+ * @param event The notificationCountChange event.
174
+ * @param listener The listener to be called.
175
+ * @see {@link NOTIFICATION_COUNT_CHANGE}
176
+ */
177
+ /**
178
+ * Registers an event listener for the given event.
179
+ * @param event The conversationsChanged event.
180
+ * @param listener The listener to be called.
181
+ * @see {@link CONVERSATIONS_CHANGE}
182
+ */
183
+ on(event: typeof UnbluApi.CONVERSATIONS_CHANGE, listener: ConversationsChangeListener): void;
184
+ /**
185
+ * Registers an event listener for the given event.
186
+ * @param event The notificationCountChanged event.
187
+ * @param listener The listener to be called.
188
+ * @see {@link NOTIFICATION_COUNT_CHANGE}
189
+ */
190
+ on(event: typeof UnbluApi.NOTIFICATION_COUNT_CHANGE, listener: NotificationCountChangeListener): void;
191
+ /**
192
+ * Registers an event listener for the given event.
193
+ * @param event The personChange event.
194
+ * @param listener The listener to be called.
195
+ * @see {@link PERSON_CHANGE}
196
+ */
197
+ on(event: typeof UnbluApi.PERSON_CHANGE, listener: PersonChangeListener): void;
198
+ /**
199
+ * Registers an event listener for the given event.
200
+ * @param event The personActivity event.
201
+ * @param listener The listener to be called.
202
+ * @see {@link PERSON_ACTIVITY}
203
+ */
204
+ on(event: typeof UnbluApi.PERSON_ACTIVITY, listener: PersonActivityListener): void;
205
+ /**
206
+ * Registers an event listener for the given event.
207
+ * @param event The agentAvailableChange event.
208
+ * @param listener The listener to be called.
209
+ * @see {@link AGENT_AVAILABLE_CHANGE}
210
+ */
211
+ on(event: typeof UnbluApi.AGENT_AVAILABLE_CHANGE, listener: AgentAvailableChangeListener): void;
212
+ /**
213
+ * Registers an event listener for the given event.
214
+ * @param event The agentAvailabilityChange event.
215
+ * @param listener The listener to be called.
216
+ * @see {@link AGENT_AVAILABILITY_CHANGE}
217
+ */
218
+ on(event: typeof UnbluApi.AGENT_AVAILABILITY_CHANGE, listener: AgentAvailabilityChangeListener): void;
219
+ /**
220
+ * Registers an event listener for the given event.
221
+ * @param event The deinitializing event.
222
+ * @param listener The listener to be called.
223
+ * @see {@link DEINITIALIZING}
224
+ */
225
+ on(event: typeof UnbluApi.DEINITIALIZING, listener: DeinitializationListener): void;
226
+ /**
227
+ * Registers an event listener for the given event.
228
+ * @param event The deinitialized event.
229
+ * @param listener The listener to be called.
230
+ * @see {@link DEINITIALIZED}
231
+ */
232
+ on(event: typeof UnbluApi.DEINITIALIZED, listener: DeinitializationListener): void;
233
+ /**
234
+ * Removes a previously registered listener
235
+ * @param event The event to unregister from.
236
+ * @param listener The listener to remove.
237
+ */
238
+ off(event: GeneralEventType | AgentAvailabilityEventType | MetaEventType, listener: Listener): boolean;
239
+ private onInternal;
240
+ private offInternal;
241
+ /**
242
+ * Returns information about the visitor.
243
+ * @return A promise that resolves to the current visitors person info.
244
+ */
245
+ getPersonInfo(): Promise<PersonInfo>;
246
+ /**
247
+ * Sets the current visitor's nickname.
248
+ * This could be set before or during a conversation.
249
+ * @return A promise that resolves empty when the operation is done
250
+ */
251
+ setPersonNickname(nickname: string): Promise<void>;
252
+ /**
253
+ * Adds the label with the given labelName to the current visitor.
254
+ * This only adds the label as long as it exists, can be set on visitors and the visitor is allowed to set the label.
255
+ * @returns A promise that resolves empty when the operation is done or is rejected if it failed.
256
+ */
257
+ addPersonLabel(labelName: string): Promise<void>;
258
+ /**
259
+ * Removes the label with the given labelName from the current visitor.
260
+ * This only removes the label as long as the visitor has the label applied to themselves and the visitor is allowed to remove the label.
261
+ * @returns A promise that resolves empty when the operation is done or is rejected if it failed.
262
+ */
263
+ removePersonLabel(labelName: string): Promise<void>;
264
+ /**
265
+ * Logs the current visitor in using the `authenticator/loginWithSecureToken` web API endpoint.
266
+ * Depending on the configuration, existing conversation may will be transferred to the authenticated user.
267
+ * @param accessToken The access token (JWT) to authenticate the visitor with
268
+ * @return A promise that resolves empty if the login succeeds or is rejected if it fails
269
+ */
270
+ login(accessToken: string): Promise<void>;
271
+ /**
272
+ * Checks if the current visitor is authenticated.
273
+ * @return A promise that resolves to a boolean if the visitor is authenticated
274
+ */
275
+ isAuthenticated(): Promise<boolean>;
276
+ /**
277
+ * Logs the visitor out.
278
+ * The user will not have access to conversations from the authenticated visitor he was before anymore. He needs to be authenticated again for that.
279
+ * @return A promise that resolves empty when the logout succeeds or is rejected if it fails
280
+ */
281
+ logout(): Promise<void>;
282
+ /**
283
+ * Returns the number of unread messages.
284
+ * @return A promise that resolves to the current number of unread messages.
285
+ */
286
+ getNotificationCount(): Promise<number>;
287
+ /**
288
+ * Starts a new Conversation and places it into the inbound conversation queue.
289
+ *
290
+ * Starting a new conversation involves an agent availability check.
291
+ * For {@link ConversationType.OFFLINE_CHAT_REQUEST} conversations, the check proceeds as follows:
292
+ * * If an agent is available, the conversation type will be changed to {@link ConversationType.CHAT_REQUEST}.
293
+ * * If no agents are available, it will start an offline conversation provided offline chat requests are enabled in the Unblu server's configuration.
294
+ * * if offline chat requests aren't enabled, the request will be rejected.
295
+ *
296
+ * For all `online` conversation types, the check works as follows:
297
+ * * If an agent is available, the conversation will be started.
298
+ * * If no agents are available, the request will be rejected.
299
+ *
300
+ * You should therefore always check agent availability before starting a new conversation.
301
+ * If no agents are available, only start conversations of the type {@link ConversationType.OFFLINE_CHAT_REQUEST}.
302
+ *
303
+ * **NOTE:** calling this method will NOT automatically open the Unblu UI if it is collapsed. Use [ui.openIndividualUi()]{@link UnbluUiApi.openIndividualUi} if this is needed.
304
+ *
305
+ * @param type The conversation type that shall be started.
306
+ * @param visitorName The name the local visitor should have. This is only taken into account if the visitor is not already authenticated.
307
+ * @param visitorData Custom data for the visitor in any format. **NOTE:** The data which is passed here could be used in [NewConversationCallback]{@link NewConversationInterceptor}
308
+ * @param recipient The team or agent recipient of the conversation. This will overwrite any named area that might be set for this web page. **NOTE:** The data which is passed here could be used in [NewConversationCallback]{@link NewConversationInterceptor}
309
+ * @return A promise that resolves to the conversation object giving API access to the started conversation.
310
+ */
311
+ startConversation(type: ConversationType, visitorName?: string, visitorData?: string, recipient?: NewConversationRecipient): Promise<Conversation>;
312
+ /**
313
+ * Set a custom interceptor which will be triggered when a new conversation is started (initiated from UI or JavaScript).
314
+ * @param callback The interceptor which is called before a new conversation is started. The Callback is of type [NewConversationCallback]{@link NewConversationInterceptor}
315
+ * @return A promise that resolves when the interceptor is successfully applied and active.
316
+ */
317
+ setNewConversationInterceptor(callback: NewConversationInterceptor): Promise<void>;
318
+ /**
319
+ * Joins an existing conversation with a given PIN.
320
+ *
321
+ * **NOTE:** calling this method will NOT automatically open the Unblu UI if it is collapsed. Use [ui.openIndividualUi()]{@link UnbluUiApi.openIndividualUi} if this is needed.
322
+ *
323
+ * @param pin The PIN retrieved from the Unblu Agent Desk.
324
+ * @param visitorName The name the local visitor should have. This is only taken into account if the visitor is not already authenticated.
325
+ * @return A promise that resolves to the conversation object giving API access to the joined conversation.
326
+ */
327
+ joinConversation(pin: string, visitorName?: string): Promise<Conversation>;
328
+ /**
329
+ * Opens the existing conversation with the given conversation ID.
330
+ *
331
+ * **NOTE:** calling this method will NOT automatically open the Unblu UI if it is collapsed. Use [ui.openIndividualUi()]{@link UnbluUiApi.openIndividualUi} if this is needed.
332
+ *
333
+ * @param conversationId The id of the conversation to be opened.
334
+ * @return A promise that resolves to the conversation object giving API access to the opened conversation.
335
+ */
336
+ openConversation(conversationId: string): Promise<Conversation>;
337
+ /**
338
+ * Returns the currently active conversation or `null` if no conversation is active.
339
+ *
340
+ * **NOTE:** calling this method twice while the same conversation is active, will result in two individual conversation API instances being returned.
341
+ * destroying one of them will not cause the other one to also be destroyed. If however the active conversation is closed, all returned Conversation instances will be destroyed.
342
+ *
343
+ * @return A promise that either resolves to the currently active conversation or `null` if no conversation is open.
344
+ * @see {@link ACTIVE_CONVERSATION_CHANGE}
345
+ */
346
+ getActiveConversation(): Promise<Conversation | null>;
347
+ /**
348
+ * Returns all conversations of the current visitor. If no conversation is present, an empty array is returned.
349
+ *
350
+ * @return A promise that resolves to an array of [ConversationInfo]{@link ConversationInfo}.
351
+ */
352
+ getConversations(): Promise<ConversationInfo[]>;
353
+ /**
354
+ * Checks if an agent is available for the current named area and language.
355
+ *
356
+ * @return Promise that resolves to `true` if the availability state is [AVAILABLE]{@link AgentAvailabilityState.AVAILABLE} or [BUSY]{@link AgentAvailabilityState.BUSY}, `false` otherwise.
357
+ * @see {@link getAgentAvailabilityState} for a more detailed check.
358
+ */
359
+ isAgentAvailable(): Promise<boolean>;
360
+ /**
361
+ * Returns the current availability state for the current named area and language.
362
+ * @return Promise that resolves to the current availability state.
363
+ * @see {@link isAgentAvailable} for a simpler check.
364
+ */
365
+ getAgentAvailabilityState(): Promise<AgentAvailabilityState>;
366
+ private requireUpgrade;
367
+ private onUpgraded;
368
+ private assertNotDeinitialized;
369
+ isDeinitialized(): Boolean;
370
+ /**
371
+ * De-initializes the API. It will destroy the UI, all connections and will release all resources (as far as it is technically possible).
372
+ *
373
+ * Afterwards the API can be initialized again via {@link UnbluStaticApi.initialize | window.unblu.floating.api.initialize()}
374
+ */
375
+ deinitialize(): Promise<void>;
376
+ /**
377
+ * @hidden
378
+ */
379
+ deinitialize(destroyOptions: DestroyOptions): Promise<void>;
380
+ }
@@ -354,9 +354,7 @@ export class UnbluApi {
354
354
  isDeinitialized() {
355
355
  return this.internalApi == null;
356
356
  }
357
- /**
358
- * @hidden
359
- */
357
+ //don't hide as otherwise the visible function without parameters is also hidden from the docs
360
358
  async deinitialize(destroyOptions) {
361
359
  if (this.isDeinitialized()) {
362
360
  return;
@@ -1 +1 @@
1
- {"version":3,"file":"unblu-api.js","sourceRoot":"","sources":["../../src/unblu-api.ts"],"names":[],"mappings":"AACA,OAAO,EAAC,YAAY,EAAC,MAAM,uBAAuB,CAAA;AAGlD,OAAO,EAAC,YAAY,EAAW,MAAM,sCAAsC,CAAA;AAK3E,OAAO,EAAC,aAAa,EAAE,cAAc,EAAC,MAAM,0BAA0B,CAAA;AACtE,OAAO,EAAC,UAAU,EAAC,MAAM,gBAAgB,CAAA;AAOzC,OAAO,EAAC,SAAS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AAI,CAAA;QACvB,IAAI,CAAC,EAAE,GAAG,IAAI,CAAA;QACd,IAAI,CAAC,iBAAiB,GAAG,IAAI,CAAA;QAC7B,IAAI,CAAC,YAAY,GAAG,IAAI,CAAA;IAC5B,CAAC;;AAtiBD;;;;;;;;GAQG;AACoB,mCAA0B,GAA+B,0BAA0B,AAAzD,CAAyD;AAE1G;;;;;;GAMG;AACoB,6BAAoB,GAA0B,qBAAqB,AAA/C,CAA+C;AAE1F;;;;;;GAMG;AACoB,kCAAyB,GAA8B,yBAAyB,AAAvD,CAAuD;AAEvG;;;;;;GAMG;AACoB,sBAAa,GAAmB,cAAc,AAAjC,CAAiC;AAErE;;;;;;;;;;;;GAYG;AACoB,wBAAe,GAAqB,gBAAgB,AAArC,CAAqC;AAE3E;;;;;;GAMG;AACoB,+BAAsB,GAAsB,iBAAiB,AAAvC,CAAuC;AAEpF;;;;;;GAMG;AACoB,kCAAyB,GAAyB,oBAAoB,AAA7C,CAA6C;AAE7F;;;;;;GAMG;AACoB,uBAAc,GAAqB,gBAAgB,AAArC,CAAqC;AAE1E;;;;;;GAMG;AACoB,sBAAa,GAAoB,eAAe,AAAnC,CAAmC"}
@@ -0,0 +1,237 @@
1
+ import { UnbluApi } from './unblu-api';
2
+ import { Listener } from './shared/internal/util/event-emitter';
3
+ import { ApiState } from "./shared/api-state";
4
+ import { Configuration } from "./shared/model/configuration";
5
+ import { UnbluFloatingApiFactory } from "./shared/internal/unblu-floating-api";
6
+ export { Configuration };
7
+ export type ReadyListener = (api: UnbluApi) => void;
8
+ export type ErrorListener = (e: Error) => void;
9
+ export type DeinitializingListener = () => void;
10
+ export type DeinitializedListener = () => void;
11
+ export type StateListener = (state: ApiState) => void;
12
+ /**
13
+ * #### The central entry point that allows to configure an initialize the Unblu Floating JS API.
14
+ * The Unblu Floating JS API is an optional add-on to the Unblu Floating UI.
15
+ * The UnbluStaticApi works without actually loading the rest of Unblu.
16
+ * It can do some general checks and load Unblu or connect the API to a loaded version of Unblu.
17
+ *
18
+ * Depending on how Unblu is integrated into the local website the API has to be initialized differently.
19
+ *
20
+ * **a.) API-only integration**
21
+ * If no unblu-snippet is loaded into the page, the Unblu Floating UI can be fully initialized with the API.
22
+ * In this case, both the `configure` and the `initialize` methods have to be called.
23
+ * Example:
24
+ * ```ts
25
+ * const api = await unblu.floating.api
26
+ * // configure the unblu server
27
+ * .configure({
28
+ * apiKey: "<your-api-key>",
29
+ * serverUrl: "<unblu-server-url>"
30
+ * })
31
+ * // initialize the api.
32
+ * .initialize();
33
+ * ```
34
+ * This implementation will load the Unblu snippet and initialize both the Unblu Floating UI and the JS API.
35
+ *
36
+ * **b.) Snippet and JS API integration**
37
+ * If the Unblu snippet is already present in the local website, Unblu doesn't have to be loaded
38
+ * and only the API has to be initialized.
39
+ * Example:
40
+ * ```ts
41
+ * // directly initialize the api without configuring.
42
+ * const api = await unblu.floating.api.initialize();
43
+ *
44
+ * ```
45
+ */
46
+ export declare class UnbluStaticApi implements UnbluFloatingApiFactory {
47
+ /**
48
+ * Event emitted as soon as the API is initialized.
49
+ *
50
+ * It usually makes sense to use this event if there is some general action that has to be triggered when the API is initialized,
51
+ * but there are several places in the integration code that may trigger the initialization.
52
+ *
53
+ * In most cases however, it is better to use
54
+ * ```ts
55
+ * unblu.floating.api.initialize().then(api => { //use api here });
56
+ * ```
57
+ * or
58
+ * ```ts
59
+ * let api = await unblu.floating.api.initialize();
60
+ * // use api here
61
+ * ```
62
+ *
63
+ * Note: that this event will be triggered again after each initialization.
64
+ *
65
+ * @event ready
66
+ * @see {@link on} for listener registration
67
+ */
68
+ static readonly READY: 'ready';
69
+ /**
70
+ * Event emitted if the API initialization fails.
71
+ *
72
+ * It usually makes sense to use this event if there is some general action that has to be triggered when the API initialization fails,
73
+ * but there are several places in the integration code that may trigger the initialization.
74
+ *
75
+ * In most cases however, it is better to use
76
+ * ```ts
77
+ * unblu.floating.api.initialize().catch(error=> { //handle error here });
78
+ * ```
79
+ * or
80
+ * ```ts
81
+ * try{
82
+ * let api = await unblu.floating.api.initialize();
83
+ * }catch(e){
84
+ * // handle error here
85
+ * }
86
+ *
87
+ * ```
88
+ *
89
+ * @event error
90
+ * @see {@link on} for listener registration
91
+ */
92
+ static readonly ERROR: 'error';
93
+ /**
94
+ * Event emitted as soon as the API is going to get de-initialized.
95
+ *
96
+ * It usually makes sense to use this event to clean up resources and/or unregistering of listeners to no try to use the API again until it is initialized again.
97
+ *
98
+ * @event deinitializing
99
+ * @see {@link on} for listener registration
100
+ */
101
+ static readonly DEINITIALIZING: 'deinitializing';
102
+ /**
103
+ * Event emitted as soon as the API is completely de-initialized.
104
+ *
105
+ * It usually makes sense to use this event to clean up resources and/or unregistering of listeners to no try to use the API again until it is initialized again.
106
+ *
107
+ * @event deinitialized
108
+ * @see {@link on} for listener registration
109
+ */
110
+ static readonly DEINITIALIZED: 'deinitialized';
111
+ /**
112
+ * Event emitted whenever the API state changes
113
+ *
114
+ * @event state
115
+ * @see {@link on} for listener registration
116
+ */
117
+ static readonly STATE: 'state';
118
+ private state;
119
+ private error;
120
+ private eventEmitter;
121
+ private configuration;
122
+ private initializedApi;
123
+ /**
124
+ * @hidden
125
+ */
126
+ constructor();
127
+ private static injectUnblu;
128
+ /**
129
+ * Registers an event listener for the given event.
130
+ *
131
+ * **Note** If the API is already initialized, this listener will be called directly.
132
+ * @param event The ready event
133
+ * @param listener The listener to be called.
134
+ * @see {@link READY}
135
+ */
136
+ on(event: typeof UnbluStaticApi.READY, listener: ReadyListener): void;
137
+ /**
138
+ * Registers an event listener for the given event.
139
+ *
140
+ * **Note** If the API has already failed, this listener will be called directly.
141
+ * @param event The error event
142
+ * @param listener The listener to be called.
143
+ * @see {@link ERROR}
144
+ */
145
+ on(event: typeof UnbluStaticApi.ERROR, listener: ErrorListener): void;
146
+ /**
147
+ * Registers an event listener for the given event.
148
+ *
149
+ * **Note** If the API is already deinitializing, this listener will be called directly.
150
+ * @param event The deinitializing event
151
+ * @param listener The listener to be called.
152
+ * @see {@link DEINITIALIZING}
153
+ */
154
+ on(event: typeof UnbluStaticApi.DEINITIALIZING, listener: DeinitializingListener): void;
155
+ /**
156
+ * Registers an event listener for the given event.
157
+ *
158
+ * **Note** If the API is already deinitialized, this listener will be called directly.
159
+ * @param event The deinitialized event
160
+ * @param listener The listener to be called.
161
+ * @see {@link DEINITIALIZED}
162
+ */
163
+ on(event: typeof UnbluStaticApi.DEINITIALIZED, listener: DeinitializedListener): void;
164
+ /**
165
+ * Registers an event listener for the given event.
166
+ *
167
+ * @param event The state event
168
+ * @param listener The listener to be called.
169
+ * @see {@link STATE}
170
+ */
171
+ on(event: typeof UnbluStaticApi.STATE, listener: StateListener): void;
172
+ /**
173
+ * Removes a previously registered listener.
174
+ * @param event The event unregister.
175
+ * @param listener The listener to be removed.
176
+ * @return `true` if the listener was removed, `false` otherwise.
177
+ */
178
+ off(event: string, listener: Listener): boolean;
179
+ /**
180
+ * Checks whether the API has to be configured or not.
181
+ *
182
+ * - If no snippet is present and the API state is still [INITIAL]{@link ApiState.INITIAL} a configuration is necessary.
183
+ * - If a snippet is present or the API is already loaded, configuration is not necessary.
184
+ * - If the API state is in [DEINITIALIZED]{@link ApiState.DEINITIALIZED}
185
+ *
186
+ * @return `true` if a configuration is needed to initialize the API, `false` otherwise.
187
+ * @see {@link configure} to configure the API
188
+ * @see {@link initialize} to initialize the API
189
+ */
190
+ isConfigurationNeeded(): boolean;
191
+ /**
192
+ * Returns the current state of the API
193
+ * @return the current API state.
194
+ * @see {@link isInitialized} for a simpler check
195
+ */
196
+ getApiState(): ApiState;
197
+ /**
198
+ * Checks whether the API is initialized or not.
199
+ * @return `true` if the API is initialized, `false` for any other state.
200
+ * @see {@link getApiState} for the full state
201
+ */
202
+ isInitialized(): boolean;
203
+ /**
204
+ * Configures the way that Unblu should be initialized.
205
+ *
206
+ * The configuration of the Unblu API is needed when, and only when no Unblu snippet is already present in the website.
207
+ *
208
+ * **Note:**
209
+ * - Calling this method when there's already an Unblu snippet will result in an {@link UnbluApiError}.
210
+ * - This method must be called BEFORE {@link initialize}.
211
+ * If it is called afterwards an {@link UnbluApiError} will be thrown.
212
+ *
213
+ * @param config The configuration to be set.
214
+ * @return an instance of `this` allowing chaining like `unblu.floating.api.configure({...}).initialize();`
215
+ * @see {@link isConfigurationNeeded} to check if configuration is needed or not.
216
+ */
217
+ configure(config: Configuration): UnbluStaticApi;
218
+ /**
219
+ * Initializes the API and resolves to the fully initialized API.
220
+ *
221
+ * If the API has already been initialized or is already in the initializing process, the existing API will be returned.
222
+ * There is only ever one instance of the API which will be returned by any call of this method which makes it safe to call this multiple times.
223
+ *
224
+ * *The initialization may fail with a {@link UnbluApiError} for the following reasons*
225
+ * - A configuration is needed but none was provided: [CONFIGURATION_MISSING]{@link UnbluErrorType.CONFIGURATION_MISSING}
226
+ * - Loading Unblu encounters a problem: [ERROR_LOADING_UNBLU]{@link UnbluErrorType.ERROR_LOADING_UNBLU}
227
+ * - The initialization timed out: [INITIALIZATION_TIMEOUT]{@link UnbluErrorType.INITIALIZATION_TIMEOUT}
228
+ * - The Unblu API is incompatible with the Unblu server: [INCOMPATIBLE_UNBLU_VERSION]{@link UnbluErrorType.INCOMPATIBLE_UNBLU_VERSION}
229
+ * - The browser is unsupported: [UNSUPPORTED_BROWSER]{@link UnbluErrorType.UNSUPPORTED_BROWSER}
230
+ * - The provided access token is invalid: [AUTHENTICATION_FAILED]{@link UnbluErrorType.AUTHENTICATION_FAILED}
231
+ */
232
+ initialize(): Promise<UnbluApi>;
233
+ private initializeApi;
234
+ private handleError;
235
+ private onDeinitializing;
236
+ private onDeinitialized;
237
+ }