@upscopeio/sdk 1.0.5 → 2.2.136

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/index.d.ts CHANGED
@@ -1,10 +1,10 @@
1
- type SubmitRating = {
1
+ export type SubmitRating = {
2
2
  userSessionRating?: number;
3
3
  userAgentRating?: number;
4
4
  userAgentFeedback?: string;
5
5
  };
6
6
 
7
- type CobrowsingSdkConfiguration = {
7
+ export type CobrowsingSdkConfiguration = {
8
8
  jsConfiguration?: boolean;
9
9
  uniqueId?: null | string;
10
10
  identities?: null | string | string[];
@@ -33,6 +33,7 @@ type CobrowsingSdkConfiguration = {
33
33
  cursorColor: string;
34
34
  enlargeCursor: boolean;
35
35
  showTerminateButton: boolean;
36
+ screenWakeLock: boolean;
36
37
  useFingerprinting: boolean;
37
38
  autoconnect: boolean;
38
39
  trackConsole: boolean;
@@ -83,6 +84,10 @@ type CobrowsingSdkConfiguration = {
83
84
  agentRequestButtonPages: string[];
84
85
  callPopupFailedTitle: string;
85
86
  callPopupFailedMessage: string;
87
+ callPopupNoInputTitle: string;
88
+ callPopupNoInputMessage: string;
89
+ callPopupNoOutputTitle: string;
90
+ callPopupNoOutputMessage: string;
86
91
  callAudioAuthorizationFailedTitle: string;
87
92
  callAudioAuthorizationFailedMessage: string;
88
93
  unavailableAgentRequestRedirectImmediately: boolean;
@@ -105,7 +110,7 @@ type CobrowsingSdkConfiguration = {
105
110
  styleSheetContentFromRules: (stylesheet: HTMLLinkElement | HTMLStyleElement) => boolean;
106
111
  };
107
112
 
108
- type Instruction =
113
+ export type Instruction =
109
114
  | ["init", Partial<CobrowsingSdkConfiguration>]
110
115
  | ["reset"]
111
116
  | ["connect"]
@@ -125,8 +130,7 @@ type Instruction =
125
130
  | ["submitRating", SubmitRating]
126
131
  | ["updateConnection", Partial<CobrowsingSdkConfiguration>];
127
132
 
128
- type Upscope = {
129
- (...args: Instruction): void;
133
+ export type Upscope = {
130
134
  _config?: CobrowsingSdkConfiguration;
131
135
  __defaultConfiguration?: CobrowsingSdkConfiguration;
132
136
  __defaultRegion?: string;
@@ -139,9 +143,5 @@ declare global {
139
143
  interface Window {
140
144
  Upscope: Upscope;
141
145
  }
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
  }
146
-
147
- export {CobrowsingSdkConfiguration, Instruction, Upscope};
147
+ export = Upscope;
package/index.js ADDED
@@ -0,0 +1,3 @@
1
+ function _arrayLikeToArray(arr,len){if(len==null||len>arr.length)len=arr.length;for(var i=0,arr2=new Array(len);i<len;i++)arr2[i]=arr[i];return arr2}function _arrayWithoutHoles(arr){if(Array.isArray(arr))return _arrayLikeToArray(arr)}function _iterableToArray(iter){if(typeof Symbol!=="undefined"&&iter[Symbol.iterator]!=null||iter["@@iterator"]!=null)return Array.from(iter)}function _nonIterableSpread(){throw new TypeError("Invalid attempt to spread non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}function _toConsumableArray(arr){return _arrayWithoutHoles(arr)||_iterableToArray(arr)||_unsupportedIterableToArray(arr)||_nonIterableSpread()}function _unsupportedIterableToArray(o,minLen){if(!o)return;if(typeof o==="string")return _arrayLikeToArray(o,minLen);var n=Object.prototype.toString.call(o).slice(8,-1);if(n==="Object"&&o.constructor)n=o.constructor.name;if(n==="Map"||n==="Set")return Array.from(n);if(n==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return _arrayLikeToArray(o,minLen)}function loadSDK(apiKey){var _x_parentNode;var i=function i1(){for(var _len=arguments.length,args=new Array(_len),_key=0;_key<_len;_key++){args[_key]=arguments[_key]}i.q.push(args)};i.q=[];window.Upscope=i;var s=document.createElement("script");s.type="text/javascript";s.async=true;s.src="https://code.upscope.io/".concat(apiKey,".js");var x=document.getElementsByTagName("script")[0];(_x_parentNode=x.parentNode)===null||_x_parentNode===void 0?void 0:_x_parentNode.insertBefore(s,x)}var _Upscope=function _Upscope1(){var _window;var args=arguments;if(window.Upscope===_Upscope){if(args[0]==="init"){var config=args[1];if(!(config===null||config===void 0?void 0:config.apiKey)){throw new Error("API key not specified")}loadSDK(config.apiKey)}else{throw new Error("Upscope is not loaded")}}return(_window=window).Upscope.apply(_window,_toConsumableArray(args))};window.Upscope=_Upscope;export default _Upscope;
2
+
3
+ //# sourceMappingURL=index.js.map
package/index.js.map ADDED
@@ -0,0 +1 @@
1
+ {"version":3,"sources":[],"names":[],"mappings":"","file":"index.js"}
package/package.json CHANGED
@@ -1,8 +1,7 @@
1
1
  {
2
2
  "name": "@upscopeio/sdk",
3
- "main": "sdk.js",
3
+ "main": "index.js",
4
4
  "type": "module",
5
- "types": "index.d.ts",
6
5
  "dependencies": {},
7
- "version": "1.0.5"
6
+ "version": "2.2.136"
8
7
  }
package/sdk.js DELETED
@@ -1,33 +0,0 @@
1
- function loadSDK(apiKey) {
2
- const i = function (...args) {
3
- i.q.push(args);
4
- };
5
- i.q = [];
6
- // The real Upscope implementation is loaded below
7
- window.Upscope = i;
8
- const s = document.createElement("script");
9
- s.type = "text/javascript";
10
- s.async = true;
11
- s.src = `https://code.upscope.io/${apiKey}.js`;
12
- const x = document.getElementsByTagName("script")[0];
13
- x.parentNode?.insertBefore(s, x);
14
- }
15
- const _Upscope = function () {
16
- const args = arguments;
17
- if (window.Upscope === _Upscope) {
18
- // The real Upscope implementation is not loaded yet, so load it
19
- if (args[0] === "init") {
20
- const config = args[1];
21
- if (!config?.apiKey) {
22
- throw new Error("API key not specified");
23
- }
24
- loadSDK(config.apiKey);
25
- }
26
- else {
27
- throw new Error("Upscope is not loaded");
28
- }
29
- }
30
- return window.Upscope(...args);
31
- };
32
- window.Upscope = _Upscope;
33
- export default _Upscope;