@thoughtspot/visual-embed-sdk 1.32.6 → 1.32.8
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/cjs/package.json +3 -3
- package/cjs/src/css-variables.d.ts +18 -3
- package/cjs/src/css-variables.d.ts.map +1 -1
- package/cjs/src/embed/base.d.ts +34 -32
- package/cjs/src/embed/base.d.ts.map +1 -1
- package/cjs/src/embed/base.js +34 -32
- package/cjs/src/embed/base.js.map +1 -1
- package/cjs/src/tokenizedFetch.d.ts.map +1 -1
- package/cjs/src/tokenizedFetch.js +5 -1
- package/cjs/src/tokenizedFetch.js.map +1 -1
- package/cjs/src/types.d.ts +7 -4
- package/cjs/src/types.d.ts.map +1 -1
- package/cjs/src/types.js +7 -4
- package/cjs/src/types.js.map +1 -1
- package/cjs/src/utils/authService/authService.spec.js +3 -1
- package/cjs/src/utils/authService/authService.spec.js.map +1 -1
- package/dist/src/css-variables.d.ts +18 -3
- package/dist/src/css-variables.d.ts.map +1 -1
- package/dist/src/embed/base.d.ts +34 -32
- package/dist/src/embed/base.d.ts.map +1 -1
- package/dist/src/tokenizedFetch.d.ts.map +1 -1
- package/dist/src/types.d.ts +7 -4
- package/dist/src/types.d.ts.map +1 -1
- package/dist/tsembed-react.es.js +242 -79
- package/dist/tsembed-react.js +242 -79
- package/dist/tsembed.es.js +276 -111
- package/dist/tsembed.js +276 -111
- package/dist/visual-embed-sdk-react-full.d.ts +59 -39
- package/dist/visual-embed-sdk-react.d.ts +59 -39
- package/dist/visual-embed-sdk.d.ts +59 -39
- package/lib/package.json +3 -3
- package/lib/src/css-variables.d.ts +18 -3
- package/lib/src/css-variables.d.ts.map +1 -1
- package/lib/src/embed/base.d.ts +34 -32
- package/lib/src/embed/base.d.ts.map +1 -1
- package/lib/src/embed/base.js +34 -32
- package/lib/src/embed/base.js.map +1 -1
- package/lib/src/tokenizedFetch.d.ts.map +1 -1
- package/lib/src/tokenizedFetch.js +5 -1
- package/lib/src/tokenizedFetch.js.map +1 -1
- package/lib/src/types.d.ts +7 -4
- package/lib/src/types.d.ts.map +1 -1
- package/lib/src/types.js +7 -4
- package/lib/src/types.js.map +1 -1
- package/lib/src/utils/authService/authService.spec.js +3 -1
- package/lib/src/utils/authService/authService.spec.js.map +1 -1
- package/lib/src/visual-embed-sdk.d.ts +59 -39
- package/package.json +3 -3
- package/src/css-variables.ts +21 -3
- package/src/embed/base.ts +34 -32
- package/src/tokenizedFetch.ts +5 -1
- package/src/types.ts +7 -4
- package/src/utils/authService/authService.spec.ts +3 -1
|
@@ -587,21 +587,22 @@ declare module '@thoughtspot/visual-embed-sdk/embed/base' {
|
|
|
587
587
|
/**
|
|
588
588
|
* Imports TML representation of the metadata objects into ThoughtSpot.
|
|
589
589
|
* @param data
|
|
590
|
+
* @returns imports TML data into ThoughtSpot
|
|
590
591
|
* @example
|
|
591
592
|
* ```js
|
|
592
|
-
*
|
|
593
|
-
* //Array of metadata Tmls
|
|
594
|
-
|
|
595
|
-
|
|
596
|
-
|
|
597
|
-
|
|
598
|
-
|
|
599
|
-
|
|
600
|
-
}).then(result => {
|
|
601
|
-
|
|
602
|
-
}).catch(error => {
|
|
603
|
-
|
|
604
|
-
});
|
|
593
|
+
* executeTML({
|
|
594
|
+
* //Array of metadata Tmls in string format
|
|
595
|
+
* metadata_tmls: [
|
|
596
|
+
* "'\''{\"guid\":\"9bd202f5-d431-44bf-9a07-b4f7be372125\",
|
|
597
|
+
* \"liveboard\":{\"name\":\"Parameters Liveboard\"}}'\''"
|
|
598
|
+
* ],
|
|
599
|
+
* import_policy: 'PARTIAL', // Specifies the import policy for the TML import.
|
|
600
|
+
* create_new: false, // If selected, creates TML objects with new GUIDs.
|
|
601
|
+
* }).then(result => {
|
|
602
|
+
* console.log(result);
|
|
603
|
+
* }).catch(error => {
|
|
604
|
+
* console.error(error);
|
|
605
|
+
* });
|
|
605
606
|
*```
|
|
606
607
|
* @version SDK: 1.23.0 | ThoughtSpot: 9.4.0.cl
|
|
607
608
|
* @group Global methods
|
|
@@ -611,27 +612,28 @@ declare module '@thoughtspot/visual-embed-sdk/embed/base' {
|
|
|
611
612
|
* Exports TML representation of the metadata objects from ThoughtSpot in JSON or YAML
|
|
612
613
|
* format.
|
|
613
614
|
* @param data
|
|
615
|
+
* @returns exports TML data
|
|
614
616
|
* @example
|
|
615
617
|
* ```js
|
|
616
|
-
exportTML({
|
|
617
|
-
|
|
618
|
-
|
|
619
|
-
|
|
620
|
-
|
|
621
|
-
|
|
622
|
-
|
|
623
|
-
|
|
624
|
-
|
|
625
|
-
|
|
626
|
-
|
|
627
|
-
|
|
628
|
-
|
|
629
|
-
|
|
630
|
-
}).then(result => {
|
|
631
|
-
|
|
632
|
-
}).catch(error => {
|
|
633
|
-
|
|
634
|
-
});
|
|
618
|
+
* exportTML({
|
|
619
|
+
* metadata: [
|
|
620
|
+
* {
|
|
621
|
+
* type: "LIVEBOARD", //Metadata Type
|
|
622
|
+
* identifier: "9bd202f5-d431-44bf-9a07-b4f7be372125" //Metadata Id
|
|
623
|
+
* }
|
|
624
|
+
* ],
|
|
625
|
+
* export_associated: false,//indicates whether to export associated metadata objects
|
|
626
|
+
* export_fqn: false, //Adds FQNs of the referenced objects.For example, if you are
|
|
627
|
+
* //exporting a Liveboard and its associated objects, the API
|
|
628
|
+
* //returns the Liveboard TML data with the FQNs of the referenced
|
|
629
|
+
* //worksheet. If the exported TML data includes FQNs, you don't need
|
|
630
|
+
* //to manually add FQNs of the referenced objects during TML import.
|
|
631
|
+
* edoc_format: "JSON" //It takes JSON or YAML value
|
|
632
|
+
* }).then(result => {
|
|
633
|
+
* console.log(result);
|
|
634
|
+
* }).catch(error => {
|
|
635
|
+
* console.error(error);
|
|
636
|
+
* });
|
|
635
637
|
* ```
|
|
636
638
|
* @version SDK: 1.23.0 | ThoughtSpot: 9.4.0.cl
|
|
637
639
|
* @group Global methods
|
|
@@ -3716,15 +3718,20 @@ declare module '@thoughtspot/visual-embed-sdk/types' {
|
|
|
3716
3718
|
* Prerequisite: Set isOnBeforeGetVizDataInterceptEnabled : true
|
|
3717
3719
|
* for this embed event to get emitted.
|
|
3718
3720
|
*
|
|
3719
|
-
*
|
|
3720
|
-
*
|
|
3721
|
+
* @param: payload
|
|
3722
|
+
* @param: responder
|
|
3721
3723
|
* Contains elements that lets developers define whether ThoughtSpot
|
|
3722
3724
|
* will run the search or not, and if not, which error message to provide.
|
|
3725
|
+
*
|
|
3723
3726
|
* execute: When execute returns true, the search will be run.
|
|
3724
3727
|
* When execute returns false, the search will not be executed.
|
|
3728
|
+
*
|
|
3725
3729
|
* error: Developers can customize the user facing message when execute is
|
|
3726
3730
|
* set to false using the error parameter in responder
|
|
3727
3731
|
*
|
|
3732
|
+
* @version SDK : 1.29.0 | Thoughtspot : 10.2.0.cl
|
|
3733
|
+
*
|
|
3734
|
+
* @example
|
|
3728
3735
|
*```js
|
|
3729
3736
|
* .on(EmbedEvent.OnBeforeGetVizDataIntercept,
|
|
3730
3737
|
* (payload, responder) => {
|
|
@@ -3760,8 +3767,6 @@ declare module '@thoughtspot/visual-embed-sdk/types' {
|
|
|
3760
3767
|
* }})
|
|
3761
3768
|
* })
|
|
3762
3769
|
*```
|
|
3763
|
-
*
|
|
3764
|
-
* @version SDK : 1.29.0 | Thoughtspot : 10.2.0.cl
|
|
3765
3770
|
*/
|
|
3766
3771
|
OnBeforeGetVizDataIntercept = "onBeforeGetVizDataIntercept",
|
|
3767
3772
|
/**
|
|
@@ -5953,9 +5958,12 @@ declare module '@thoughtspot/visual-embed-sdk/css-variables' {
|
|
|
5953
5958
|
*/
|
|
5954
5959
|
'--ts-var-root-text-transform'?: string;
|
|
5955
5960
|
/**
|
|
5956
|
-
*
|
|
5957
|
-
*
|
|
5958
|
-
*
|
|
5961
|
+
* Font color of the text on toggle buttons such as
|
|
5962
|
+
* **All**, **Answers**, and **Liveboards** on the Home page (Classic experience),
|
|
5963
|
+
* the text color of the chart and table tiles on Home page (New modular Homepage experience),
|
|
5964
|
+
* and title text on the AI-generated charts and tables.
|
|
5965
|
+
* The default color code is #2770EF.
|
|
5966
|
+
*
|
|
5959
5967
|
*/
|
|
5960
5968
|
'--ts-var-application-color'?: string;
|
|
5961
5969
|
/**
|
|
@@ -6066,6 +6074,10 @@ declare module '@thoughtspot/visual-embed-sdk/css-variables' {
|
|
|
6066
6074
|
* Background color of the primary buttons on hover.
|
|
6067
6075
|
*/
|
|
6068
6076
|
'--ts-var-button--primary--hover-background'?: string;
|
|
6077
|
+
/**
|
|
6078
|
+
* Backgroud color of the primary buttons when active.
|
|
6079
|
+
*/
|
|
6080
|
+
'--ts-var-button--primary--active-background'?: string;
|
|
6069
6081
|
/**
|
|
6070
6082
|
* Font color of the text on the secondary buttons.
|
|
6071
6083
|
*/
|
|
@@ -6082,6 +6094,10 @@ declare module '@thoughtspot/visual-embed-sdk/css-variables' {
|
|
|
6082
6094
|
* Background color of the secondary button on hover.
|
|
6083
6095
|
*/
|
|
6084
6096
|
'--ts-var-button--secondary--hover-background'?: string;
|
|
6097
|
+
/**
|
|
6098
|
+
* Backgroud color of the secondary buttons when active.
|
|
6099
|
+
*/
|
|
6100
|
+
'--ts-var-button--secondary--active-background'?: string;
|
|
6085
6101
|
/**
|
|
6086
6102
|
* Font color of the tertiary button. For example, the *Undo*, *Redo*, and *Reset*
|
|
6087
6103
|
* buttons on the *Search* page.
|
|
@@ -6095,6 +6111,10 @@ declare module '@thoughtspot/visual-embed-sdk/css-variables' {
|
|
|
6095
6111
|
* Background color of the tertiary button when a user hovers over these buttons.
|
|
6096
6112
|
*/
|
|
6097
6113
|
'--ts-var-button--tertiary--hover-background'?: string;
|
|
6114
|
+
/**
|
|
6115
|
+
* Backgroud color of the tertiary buttons when active.
|
|
6116
|
+
*/
|
|
6117
|
+
'--ts-var-button--tertiary--active-background'?: string;
|
|
6098
6118
|
/**
|
|
6099
6119
|
* Font color of the title text of a visualization or Answer.
|
|
6100
6120
|
*/
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@thoughtspot/visual-embed-sdk",
|
|
3
|
-
"version": "1.32.
|
|
3
|
+
"version": "1.32.8",
|
|
4
4
|
"description": "ThoughtSpot Embed SDK",
|
|
5
5
|
"module": "lib/src/index.js",
|
|
6
6
|
"main": "dist/tsembed.js",
|
|
@@ -38,7 +38,7 @@
|
|
|
38
38
|
"size-limit": [
|
|
39
39
|
{
|
|
40
40
|
"path": "dist/tsembed.js",
|
|
41
|
-
"limit": "
|
|
41
|
+
"limit": "49 kB"
|
|
42
42
|
}
|
|
43
43
|
],
|
|
44
44
|
"scripts": {
|
|
@@ -77,7 +77,7 @@
|
|
|
77
77
|
"gatsby-plugin-vercel": "^1.0.3",
|
|
78
78
|
"html-react-parser": "^1.4.12",
|
|
79
79
|
"lodash": "^4.17.21",
|
|
80
|
-
"mixpanel-browser": "
|
|
80
|
+
"mixpanel-browser": "2.47.0",
|
|
81
81
|
"ts-deepmerge": "^6.0.2",
|
|
82
82
|
"tslib": "^2.5.3",
|
|
83
83
|
"use-deep-compare-effect": "^1.8.1"
|
package/src/css-variables.ts
CHANGED
|
@@ -24,9 +24,12 @@ export interface CustomCssVariables {
|
|
|
24
24
|
'--ts-var-root-text-transform'?: string;
|
|
25
25
|
|
|
26
26
|
/**
|
|
27
|
-
*
|
|
28
|
-
*
|
|
29
|
-
*
|
|
27
|
+
* Font color of the text on toggle buttons such as
|
|
28
|
+
* **All**, **Answers**, and **Liveboards** on the Home page (Classic experience),
|
|
29
|
+
* the text color of the chart and table tiles on Home page (New modular Homepage experience),
|
|
30
|
+
* and title text on the AI-generated charts and tables.
|
|
31
|
+
* The default color code is #2770EF.
|
|
32
|
+
*
|
|
30
33
|
*/
|
|
31
34
|
'--ts-var-application-color'?: string;
|
|
32
35
|
|
|
@@ -163,6 +166,11 @@ export interface CustomCssVariables {
|
|
|
163
166
|
*/
|
|
164
167
|
'--ts-var-button--primary--hover-background'?: string;
|
|
165
168
|
|
|
169
|
+
/**
|
|
170
|
+
* Backgroud color of the primary buttons when active.
|
|
171
|
+
*/
|
|
172
|
+
'--ts-var-button--primary--active-background'?: string;
|
|
173
|
+
|
|
166
174
|
/**
|
|
167
175
|
* Font color of the text on the secondary buttons.
|
|
168
176
|
*/
|
|
@@ -183,6 +191,11 @@ export interface CustomCssVariables {
|
|
|
183
191
|
*/
|
|
184
192
|
'--ts-var-button--secondary--hover-background'?: string;
|
|
185
193
|
|
|
194
|
+
/**
|
|
195
|
+
* Backgroud color of the secondary buttons when active.
|
|
196
|
+
*/
|
|
197
|
+
'--ts-var-button--secondary--active-background'?: string;
|
|
198
|
+
|
|
186
199
|
/**
|
|
187
200
|
* Font color of the tertiary button. For example, the *Undo*, *Redo*, and *Reset*
|
|
188
201
|
* buttons on the *Search* page.
|
|
@@ -199,6 +212,11 @@ export interface CustomCssVariables {
|
|
|
199
212
|
*/
|
|
200
213
|
'--ts-var-button--tertiary--hover-background'?: string;
|
|
201
214
|
|
|
215
|
+
/**
|
|
216
|
+
* Backgroud color of the tertiary buttons when active.
|
|
217
|
+
*/
|
|
218
|
+
'--ts-var-button--tertiary--active-background'?: string;
|
|
219
|
+
|
|
202
220
|
/**
|
|
203
221
|
* Font color of the title text of a visualization or Answer.
|
|
204
222
|
*/
|
package/src/embed/base.ts
CHANGED
|
@@ -259,21 +259,22 @@ export const renderInQueue = (fn: (next?: (val?: any) => void) => Promise<any>):
|
|
|
259
259
|
/**
|
|
260
260
|
* Imports TML representation of the metadata objects into ThoughtSpot.
|
|
261
261
|
* @param data
|
|
262
|
+
* @returns imports TML data into ThoughtSpot
|
|
262
263
|
* @example
|
|
263
264
|
* ```js
|
|
264
|
-
*
|
|
265
|
-
* //Array of metadata Tmls
|
|
266
|
-
|
|
267
|
-
|
|
268
|
-
|
|
269
|
-
|
|
270
|
-
|
|
271
|
-
|
|
272
|
-
}).then(result => {
|
|
273
|
-
|
|
274
|
-
}).catch(error => {
|
|
275
|
-
|
|
276
|
-
});
|
|
265
|
+
* executeTML({
|
|
266
|
+
* //Array of metadata Tmls in string format
|
|
267
|
+
* metadata_tmls: [
|
|
268
|
+
* "'\''{\"guid\":\"9bd202f5-d431-44bf-9a07-b4f7be372125\",
|
|
269
|
+
* \"liveboard\":{\"name\":\"Parameters Liveboard\"}}'\''"
|
|
270
|
+
* ],
|
|
271
|
+
* import_policy: 'PARTIAL', // Specifies the import policy for the TML import.
|
|
272
|
+
* create_new: false, // If selected, creates TML objects with new GUIDs.
|
|
273
|
+
* }).then(result => {
|
|
274
|
+
* console.log(result);
|
|
275
|
+
* }).catch(error => {
|
|
276
|
+
* console.error(error);
|
|
277
|
+
* });
|
|
277
278
|
*```
|
|
278
279
|
* @version SDK: 1.23.0 | ThoughtSpot: 9.4.0.cl
|
|
279
280
|
* @group Global methods
|
|
@@ -319,27 +320,28 @@ export const executeTML = async (data: executeTMLInput): Promise<any> => {
|
|
|
319
320
|
* Exports TML representation of the metadata objects from ThoughtSpot in JSON or YAML
|
|
320
321
|
* format.
|
|
321
322
|
* @param data
|
|
323
|
+
* @returns exports TML data
|
|
322
324
|
* @example
|
|
323
325
|
* ```js
|
|
324
|
-
|
|
325
|
-
|
|
326
|
-
|
|
327
|
-
|
|
328
|
-
|
|
329
|
-
|
|
330
|
-
|
|
331
|
-
|
|
332
|
-
|
|
333
|
-
|
|
334
|
-
|
|
335
|
-
|
|
336
|
-
|
|
337
|
-
|
|
338
|
-
|
|
339
|
-
|
|
340
|
-
|
|
341
|
-
|
|
342
|
-
|
|
326
|
+
* exportTML({
|
|
327
|
+
* metadata: [
|
|
328
|
+
* {
|
|
329
|
+
* type: "LIVEBOARD", //Metadata Type
|
|
330
|
+
* identifier: "9bd202f5-d431-44bf-9a07-b4f7be372125" //Metadata Id
|
|
331
|
+
* }
|
|
332
|
+
* ],
|
|
333
|
+
* export_associated: false,//indicates whether to export associated metadata objects
|
|
334
|
+
* export_fqn: false, //Adds FQNs of the referenced objects.For example, if you are
|
|
335
|
+
* //exporting a Liveboard and its associated objects, the API
|
|
336
|
+
* //returns the Liveboard TML data with the FQNs of the referenced
|
|
337
|
+
* //worksheet. If the exported TML data includes FQNs, you don't need
|
|
338
|
+
* //to manually add FQNs of the referenced objects during TML import.
|
|
339
|
+
* edoc_format: "JSON" //It takes JSON or YAML value
|
|
340
|
+
* }).then(result => {
|
|
341
|
+
* console.log(result);
|
|
342
|
+
* }).catch(error => {
|
|
343
|
+
* console.error(error);
|
|
344
|
+
* });
|
|
343
345
|
* ```
|
|
344
346
|
* @version SDK: 1.23.0 | ThoughtSpot: 9.4.0.cl
|
|
345
347
|
* @group Global methods
|
package/src/tokenizedFetch.ts
CHANGED
|
@@ -22,7 +22,11 @@ import { AuthType } from './types';
|
|
|
22
22
|
export const tokenizedFetch: typeof fetch = async (input, init): Promise<Response> => {
|
|
23
23
|
const embedConfig = getEmbedConfig();
|
|
24
24
|
if (embedConfig.authType !== AuthType.TrustedAuthTokenCookieless) {
|
|
25
|
-
return fetch(input,
|
|
25
|
+
return fetch(input, {
|
|
26
|
+
// ensure cookies are included for the non cookie-less api calls.
|
|
27
|
+
credentials: 'include',
|
|
28
|
+
...init,
|
|
29
|
+
});
|
|
26
30
|
}
|
|
27
31
|
|
|
28
32
|
const req = new Request(input, init);
|
package/src/types.ts
CHANGED
|
@@ -2139,15 +2139,20 @@ export enum EmbedEvent {
|
|
|
2139
2139
|
* Prerequisite: Set isOnBeforeGetVizDataInterceptEnabled : true
|
|
2140
2140
|
* for this embed event to get emitted.
|
|
2141
2141
|
*
|
|
2142
|
-
*
|
|
2143
|
-
*
|
|
2142
|
+
* @param: payload
|
|
2143
|
+
* @param: responder
|
|
2144
2144
|
* Contains elements that lets developers define whether ThoughtSpot
|
|
2145
2145
|
* will run the search or not, and if not, which error message to provide.
|
|
2146
|
+
*
|
|
2146
2147
|
* execute: When execute returns true, the search will be run.
|
|
2147
2148
|
* When execute returns false, the search will not be executed.
|
|
2149
|
+
*
|
|
2148
2150
|
* error: Developers can customize the user facing message when execute is
|
|
2149
2151
|
* set to false using the error parameter in responder
|
|
2150
2152
|
*
|
|
2153
|
+
* @version SDK : 1.29.0 | Thoughtspot : 10.2.0.cl
|
|
2154
|
+
*
|
|
2155
|
+
* @example
|
|
2151
2156
|
*```js
|
|
2152
2157
|
* .on(EmbedEvent.OnBeforeGetVizDataIntercept,
|
|
2153
2158
|
* (payload, responder) => {
|
|
@@ -2183,8 +2188,6 @@ export enum EmbedEvent {
|
|
|
2183
2188
|
* }})
|
|
2184
2189
|
* })
|
|
2185
2190
|
*```
|
|
2186
|
-
*
|
|
2187
|
-
* @version SDK : 1.29.0 | Thoughtspot : 10.2.0.cl
|
|
2188
2191
|
*/
|
|
2189
2192
|
OnBeforeGetVizDataIntercept = 'onBeforeGetVizDataIntercept',
|
|
2190
2193
|
/**
|
|
@@ -29,7 +29,9 @@ describe('Unit test for authService', () => {
|
|
|
29
29
|
const response = await fetchSessionInfoService(thoughtSpotHost);
|
|
30
30
|
expect(response.success).toBe(true);
|
|
31
31
|
expect(fetch).toHaveBeenCalledTimes(1);
|
|
32
|
-
expect(fetch).toBeCalledWith(`${thoughtSpotHost}${EndPoints.SESSION_INFO}`, {
|
|
32
|
+
expect(fetch).toBeCalledWith(`${thoughtSpotHost}${EndPoints.SESSION_INFO}`, {
|
|
33
|
+
credentials: 'include',
|
|
34
|
+
});
|
|
33
35
|
});
|
|
34
36
|
|
|
35
37
|
test('fetchAuthTokenService', async () => {
|