@thoughtspot/visual-embed-sdk 1.32.7 → 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 +3 -3
- package/cjs/src/types.js +3 -3
- 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 +3 -3
- package/dist/tsembed-react.es.js +238 -78
- package/dist/tsembed-react.js +238 -78
- package/dist/tsembed.es.js +272 -110
- package/dist/tsembed.js +272 -110
- package/dist/visual-embed-sdk-react-full.d.ts +55 -38
- package/dist/visual-embed-sdk-react.d.ts +55 -38
- package/dist/visual-embed-sdk.d.ts +55 -38
- 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 +3 -3
- package/lib/src/types.js +3 -3
- 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 +55 -38
- 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 +3 -3
- package/src/utils/authService/authService.spec.ts +3 -1
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
|
-
|
|
273
|
-
|
|
274
|
-
|
|
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,8 +2139,8 @@ 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
|
*
|
|
@@ -2152,6 +2152,7 @@ export enum EmbedEvent {
|
|
|
2152
2152
|
*
|
|
2153
2153
|
* @version SDK : 1.29.0 | Thoughtspot : 10.2.0.cl
|
|
2154
2154
|
*
|
|
2155
|
+
* @example
|
|
2155
2156
|
*```js
|
|
2156
2157
|
* .on(EmbedEvent.OnBeforeGetVizDataIntercept,
|
|
2157
2158
|
* (payload, responder) => {
|
|
@@ -2187,7 +2188,6 @@ export enum EmbedEvent {
|
|
|
2187
2188
|
* }})
|
|
2188
2189
|
* })
|
|
2189
2190
|
*```
|
|
2190
|
-
*
|
|
2191
2191
|
*/
|
|
2192
2192
|
OnBeforeGetVizDataIntercept = 'onBeforeGetVizDataIntercept',
|
|
2193
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 () => {
|