@upscopeio/sdk 1.0.2 → 1.0.4

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 (2) hide show
  1. package/index.d.ts +147 -0
  2. package/package.json +1 -1
package/index.d.ts ADDED
@@ -0,0 +1,147 @@
1
+ type SubmitRating = {
2
+ userSessionRating?: number;
3
+ userAgentRating?: number;
4
+ userAgentFeedback?: string;
5
+ };
6
+
7
+ type CobrowsingSdkConfiguration = {
8
+ jsConfiguration?: boolean;
9
+ uniqueId?: null | string;
10
+ identities?: null | string | string[];
11
+ tags?: null | string | string[];
12
+ integrationIds?: null | string | string[];
13
+ agentPrompt?: string;
14
+ callName?: string;
15
+
16
+ // Automatic
17
+ version: string;
18
+ apiKey: string;
19
+ beta: boolean;
20
+ region: string | null;
21
+ readonly regionWhitelist: string[] | null;
22
+ dataEndpoint: string;
23
+ pageviewsEndpoint: string;
24
+ phoneEndpoint: string;
25
+ javascriptEndpoint: string;
26
+ storageImplementation: null | Storage;
27
+ proxyRedirectEndpoint: string;
28
+ requireAuthorizationForSession: boolean;
29
+ integrateWithLivechat: boolean;
30
+ liveChatRewrite: boolean;
31
+ grabIdentityFromLivechat: boolean;
32
+ showUpscopeLink: boolean;
33
+ cursorColor: string;
34
+ enlargeCursor: boolean;
35
+ showTerminateButton: boolean;
36
+ useFingerprinting: boolean;
37
+ autoconnect: boolean;
38
+ trackConsole: boolean;
39
+ allowRemoteConsole: boolean;
40
+ allowRemoteClick: boolean;
41
+ allowRemoteScroll: boolean;
42
+ allowRemoteType: boolean;
43
+ allowAgentRedirect: boolean;
44
+ rewriteExternalLinks: boolean;
45
+ collectHistory: boolean;
46
+ consoleAllowed: boolean;
47
+ drawingsTtlMs: number;
48
+ enableLookupCodeOnKey: boolean;
49
+ lookupCodeKey: number;
50
+ lookupCodeKeyRepetitions: number;
51
+ lookupCodeKeyTitle: string;
52
+ lookupCodeKeyMessage: string;
53
+ lookupCodeElement: null | HTMLElement | string;
54
+ injectLookupCodeButton: boolean;
55
+ lookupCodeButtonPages: string[];
56
+ lookupCodeButtonStyle: string;
57
+ disconnectAfterSeconds: number;
58
+ proxyAssets: string[];
59
+ maskedElements: string[];
60
+ domChangesDelay: number;
61
+ ignoreBrowserSupport: boolean;
62
+ enableCanvases: boolean;
63
+ customCallController: null | ((callback: (accepted: boolean) => void) => void);
64
+ callPromptText: string;
65
+ callRingtone: string;
66
+ authorizationPromptTitle: string;
67
+ authorizationPromptMessage: string;
68
+ endOfScreenshareMessage: null | string;
69
+ callWaitMessage: string;
70
+ translationsYes: string;
71
+ translationsNo: string;
72
+ translationsOk: string;
73
+ translationsStopSession: string;
74
+ agentRequestButtonStyle: string;
75
+ agentRequestButtonTitle: string;
76
+ agentRequestButtonSubtitle: string;
77
+ agentRequestButtonRequestingTitle: string;
78
+ agentRequestButtonRequestingSubtitle: string;
79
+ agentRequestResultTitle: string;
80
+ agentRequestNotAvailableText: string;
81
+ agentRequestAcceptedText: string;
82
+ showAgentRequestButton: "always" | "when_available" | "never"; // One of: always / when_available / never
83
+ agentRequestButtonPages: string[];
84
+ callPopupFailedTitle: string;
85
+ callPopupFailedMessage: string;
86
+ callAudioAuthorizationFailedTitle: string;
87
+ callAudioAuthorizationFailedMessage: string;
88
+ unavailableAgentRequestRedirectImmediately: boolean;
89
+ unavailableAgentRequestRedirectTo: null | string;
90
+ fromProxy: boolean;
91
+ sfdcFieldLabel: string;
92
+ sfdcFieldId: string;
93
+ baseProxyUrl: string;
94
+ proxyDomain: string;
95
+ needsProxy: (url: string) => boolean;
96
+ onSessionRequest: (cb: (accepted: boolean) => void, requestingAgent: string | null) => void;
97
+ onSessionStart: () => void;
98
+ onSessionEnd: () => void;
99
+ onWaitingForCall: () => void;
100
+ onSessionContinue: () => void;
101
+ onConnection: null | (() => void);
102
+ maskElementMiddleware: (element: HTMLElement) => boolean;
103
+ noRemoteElements: string[];
104
+ allowRemoteMiddleware: (element: HTMLElement) => boolean;
105
+ styleSheetContentFromRules: (stylesheet: HTMLLinkElement | HTMLStyleElement) => boolean;
106
+ };
107
+
108
+ type Instruction =
109
+ | ["init", Partial<CobrowsingSdkConfiguration>]
110
+ | ["reset"]
111
+ | ["connect"]
112
+ | ["cancelRequestAgent"]
113
+ | ["getShortId", (shortId: string) => void]
114
+ | ["getUserId", (shortId: string) => void] // Legacy version of getShortId
115
+ | ["getLookupCode", (code: string) => void]
116
+ | ["getWatchLink", (link: string) => void]
117
+ | ["logEvent", "success" | "error" | "info" | "warn" | "contact", string]
118
+ | ["newPageview"]
119
+ | ["on", ...string[], (event: any) => void]
120
+ | ["requestAgent"]
121
+ | ["reset", boolean]
122
+ | ["redirect", string]
123
+ | ["saveHistory"]
124
+ | ["stopSession"]
125
+ | ["submitRating", SubmitRating]
126
+ | ["updateConnection", Partial<CobrowsingSdkConfiguration>];
127
+
128
+ type Upscope = {
129
+ (...args: Instruction): void;
130
+ _config?: CobrowsingSdkConfiguration;
131
+ __defaultConfiguration?: CobrowsingSdkConfiguration;
132
+ __defaultRegion?: string;
133
+ _version?: string;
134
+ _integrations?: string[];
135
+ q: Instruction[];
136
+ };
137
+
138
+ declare global {
139
+ interface Window {
140
+ Upscope: Upscope;
141
+ }
142
+
143
+ function setInterval(callback: (...args: any[]) => void, ms: number, ...args: any[]): number;
144
+ function setTimeout(callback: (...args: any[]) => void, ms: number, ...args: any[]): number;
145
+ }
146
+
147
+ export {CobrowsingSdkConfiguration, Instruction, Upscope};
package/package.json CHANGED
@@ -4,5 +4,5 @@
4
4
  "type": "module",
5
5
  "types": "index.d.ts",
6
6
  "dependencies": {},
7
- "version": "1.0.2"
7
+ "version": "1.0.4"
8
8
  }