@ada-support/embed2 1.14.3 → 1.14.5

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.
@@ -1,3 +1,8 @@
1
1
  import type { Client } from "common/models/client";
2
+ import type { AdaCluster } from "common/types";
2
3
  import type { MessagePayload } from "common/types/events";
3
- export declare function storeChatterEventDataInBrowser(client: Client, payload: MessagePayload): void;
4
+ export declare function storeChatterEventDataInBrowser(client: Client, payload: MessagePayload, { cluster, domain, privateMode, }?: {
5
+ cluster?: AdaCluster;
6
+ domain?: string;
7
+ privateMode?: boolean;
8
+ }): void;
@@ -0,0 +1,34 @@
1
+ import type { AdaCluster } from "common/types";
2
+ export interface MessagingAuthState {
3
+ messagingToken: string;
4
+ messagingTokenExpiresAt: number;
5
+ sessionRefreshToken: string;
6
+ refreshGeneration: number;
7
+ }
8
+ type MessagingAuthStatePersistence = "normal" | "session" | "private" | string | null | undefined;
9
+ declare const MESSAGING_AUTH_STATE_STORAGE_KEY: "messagingAuthState";
10
+ export declare function buildMessagingAuthStateStorageKey({ handle, cluster, domain, }: {
11
+ handle: string | null | undefined;
12
+ cluster?: AdaCluster;
13
+ domain?: string;
14
+ }): typeof MESSAGING_AUTH_STATE_STORAGE_KEY | null;
15
+ export declare function parseMessagingAuthState(value: unknown): MessagingAuthState | null;
16
+ export declare function readMessagingAuthStateFromStorage({ handle, cluster, domain, }: {
17
+ handle: string | null | undefined;
18
+ cluster?: AdaCluster;
19
+ domain?: string;
20
+ }): MessagingAuthState | undefined;
21
+ export declare function writeMessagingAuthStateToStorage({ handle, cluster, domain, persistence, state, }: {
22
+ handle: string | null | undefined;
23
+ cluster?: AdaCluster;
24
+ domain?: string;
25
+ persistence: MessagingAuthStatePersistence;
26
+ state: MessagingAuthState | null | undefined;
27
+ }): boolean;
28
+ export declare function clearAllMessagingAuthStatesFromStorage(): void;
29
+ export declare function clearMessagingAuthStateFromStorage({ handle, cluster, domain, }: {
30
+ handle: string | null | undefined;
31
+ cluster?: AdaCluster;
32
+ domain?: string;
33
+ }): void;
34
+ export {};
@@ -1,11 +1,13 @@
1
1
  import type { Modality, StartOptions } from "@ada-support/embed-types";
2
2
  import type { ConnectionState } from "common/constants/events";
3
+ import type { MessagingAuthState } from "common/helpers/messaging-auth-state";
3
4
  import type { Client } from "common/models/client";
4
5
  import type { AdaCluster } from "common/types";
5
6
  export interface StoreState extends StartOptionsNoFunction {
6
7
  chatterCreated: string | undefined;
7
8
  chatterToken: string | undefined;
8
9
  sessionToken: string | undefined;
10
+ messagingAuthState?: MessagingAuthState;
9
11
  client?: Client;
10
12
  enabledLanguages: string[];
11
13
  isDrawerOpen: boolean;