@thoughtspot/visual-embed-sdk 1.35.5-hostEvent.1 → 1.35.5-hostEvent.2
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 +1 -1
- package/cjs/src/embed/hostEventClient/contracts.d.ts +6 -12
- package/cjs/src/embed/hostEventClient/contracts.d.ts.map +1 -1
- package/cjs/src/embed/hostEventClient/contracts.js +0 -1
- package/cjs/src/embed/hostEventClient/contracts.js.map +1 -1
- package/cjs/src/embed/hostEventClient/host-event-client.d.ts +3 -6
- package/cjs/src/embed/hostEventClient/host-event-client.d.ts.map +1 -1
- package/cjs/src/embed/hostEventClient/host-event-client.js +22 -22
- package/cjs/src/embed/hostEventClient/host-event-client.js.map +1 -1
- package/cjs/src/embed/ts-embed.d.ts +3 -3
- package/cjs/src/embed/ts-embed.d.ts.map +1 -1
- package/cjs/src/embed/ts-embed.js +11 -11
- package/cjs/src/embed/ts-embed.js.map +1 -1
- package/cjs/src/types.d.ts +1 -1
- package/cjs/src/types.js +1 -1
- package/dist/index-DFwi_pV_.js +7370 -0
- package/dist/src/embed/hostEventClient/contracts.d.ts +6 -12
- package/dist/src/embed/hostEventClient/contracts.d.ts.map +1 -1
- package/dist/src/embed/hostEventClient/host-event-client.d.ts +3 -6
- package/dist/src/embed/hostEventClient/host-event-client.d.ts.map +1 -1
- package/dist/src/embed/ts-embed.d.ts +3 -3
- package/dist/src/embed/ts-embed.d.ts.map +1 -1
- package/dist/src/types.d.ts +1 -1
- package/dist/tsembed-react.es.js +37 -38
- package/dist/tsembed-react.js +36 -37
- package/dist/tsembed.es.js +37 -38
- package/dist/tsembed.js +36 -37
- package/dist/visual-embed-sdk-react-full.d.ts +10 -19
- package/dist/visual-embed-sdk-react.d.ts +10 -19
- package/dist/visual-embed-sdk.d.ts +10 -19
- package/lib/package.json +1 -1
- package/lib/src/embed/hostEventClient/contracts.d.ts +6 -12
- package/lib/src/embed/hostEventClient/contracts.d.ts.map +1 -1
- package/lib/src/embed/hostEventClient/contracts.js +0 -1
- package/lib/src/embed/hostEventClient/contracts.js.map +1 -1
- package/lib/src/embed/hostEventClient/host-event-client.d.ts +3 -6
- package/lib/src/embed/hostEventClient/host-event-client.d.ts.map +1 -1
- package/lib/src/embed/hostEventClient/host-event-client.js +22 -22
- package/lib/src/embed/hostEventClient/host-event-client.js.map +1 -1
- package/lib/src/embed/ts-embed.d.ts +3 -3
- package/lib/src/embed/ts-embed.d.ts.map +1 -1
- package/lib/src/embed/ts-embed.js +11 -11
- package/lib/src/embed/ts-embed.js.map +1 -1
- package/lib/src/types.d.ts +1 -1
- package/lib/src/types.js +1 -1
- package/lib/src/visual-embed-sdk.d.ts +13 -22
- package/package.json +1 -1
- package/src/embed/hostEventClient/contracts.ts +4 -10
- package/src/embed/hostEventClient/host-event-client.ts +31 -34
- package/src/embed/ts-embed.ts +13 -4
- package/src/types.ts +1 -1
|
@@ -6,8 +6,7 @@ export declare enum UiPassthroughEvent {
|
|
|
6
6
|
getDiscoverabilityStatus = "getDiscoverabilityStatus",
|
|
7
7
|
getAvailableUiPassthroughs = "getAvailableUiPassthroughs",
|
|
8
8
|
getAnswerPageConfig = "getAnswerPageConfig",
|
|
9
|
-
getPinboardPageConfig = "getPinboardPageConfig"
|
|
10
|
-
UiPassthroughEventNotFound = "UiPassthroughEventNotFound"
|
|
9
|
+
getPinboardPageConfig = "getPinboardPageConfig"
|
|
11
10
|
}
|
|
12
11
|
export type UiPassthroughContractBase = {
|
|
13
12
|
[UiPassthroughEvent.addVizToPinboard]: {
|
|
@@ -70,13 +69,12 @@ export type UiPassthroughContractBase = {
|
|
|
70
69
|
request: any;
|
|
71
70
|
response: any;
|
|
72
71
|
};
|
|
73
|
-
[UiPassthroughEvent.UiPassthroughEventNotFound]: {
|
|
74
|
-
request: any;
|
|
75
|
-
response: any;
|
|
76
|
-
};
|
|
77
72
|
};
|
|
78
|
-
export type
|
|
79
|
-
|
|
73
|
+
export type FlattenType<T> = T extends infer R ? {
|
|
74
|
+
[K in keyof R]: R[K];
|
|
75
|
+
} : never;
|
|
76
|
+
export type UiPassthroughRequest<T extends keyof UiPassthroughContractBase> = FlattenType<UiPassthroughContractBase[T]['request']>;
|
|
77
|
+
export type UiPassthroughResponse<T extends keyof UiPassthroughContractBase> = FlattenType<UiPassthroughContractBase[T]['response']>;
|
|
80
78
|
export type UiPassthroughArrayResponse<ApiName extends keyof UiPassthroughContractBase> = Promise<Array<{
|
|
81
79
|
redId?: string;
|
|
82
80
|
value?: UiPassthroughResponse<ApiName>;
|
|
@@ -85,11 +83,7 @@ export type UiPassthroughArrayResponse<ApiName extends keyof UiPassthroughContra
|
|
|
85
83
|
export type EmbedApiHostEventMapping = {
|
|
86
84
|
[HostEvent.Pin]: UiPassthroughEvent.addVizToPinboard;
|
|
87
85
|
[HostEvent.SaveAnswer]: UiPassthroughEvent.saveAnswer;
|
|
88
|
-
'hostEventNotMapped': UiPassthroughEvent.UiPassthroughEventNotFound;
|
|
89
86
|
};
|
|
90
|
-
export type FlattenType<T> = T extends infer R ? {
|
|
91
|
-
[K in keyof R]: R[K];
|
|
92
|
-
} : never;
|
|
93
87
|
export type HostEventRequest<HostEventT extends HostEvent> = HostEventT extends keyof EmbedApiHostEventMapping ? FlattenType<UiPassthroughRequest<EmbedApiHostEventMapping[HostEventT]>> : any;
|
|
94
88
|
export type HostEventResponse<HostEventT extends HostEvent> = HostEventT extends keyof EmbedApiHostEventMapping ? {
|
|
95
89
|
value?: UiPassthroughResponse<EmbedApiHostEventMapping[HostEventT]>;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"contracts.d.ts","sourceRoot":"","sources":["contracts.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,MAAM,aAAa,CAAC;AAExC,oBAAY,kBAAkB;IAC5B,gBAAgB,qBAAqB;IACrC,UAAU,eAAe;IACzB,oBAAoB,yBAAyB;IAC7C,wBAAwB,6BAA6B;IACrD,0BAA0B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AAyB,IACpF,OAAO,CAAC,KAAK,CAAC;IACZ,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,KAAK,CAAC,EAAE,qBAAqB,CAAC,OAAO,CAAC,CAAC;IACvC,KAAK,CAAC,EAAE,GAAG,CAAC;CACb,CAAC,CAAC,CAAA;AAEL,MAAM,MAAM,wBAAwB,GAAG;IACrC,CAAC,SAAS,CAAC,GAAG,CAAC,EAAE,kBAAkB,CAAC,gBAAgB,CAAC;IACrD,CAAC,SAAS,CAAC,UAAU,CAAC,EAAE,kBAAkB,CAAC,UAAU,CAAC;CACvD,CAAA;AAED,MAAM,MAAM,gBAAgB,CAAC,UAAU,SAAS,SAAS,IACvD,UAAU,SAAS,MAAM,wBAAwB,GACjD,WAAW,CAAC,oBAAoB,CAAC,wBAAwB,CAAC,UAAU,CAAC,CAAC,CAAC,GAAG,GAAG,CAAC;AAEhF,MAAM,MAAM,iBAAiB,CAAC,UAAU,SAAS,SAAS,IACxD,UAAU,SAAS,MAAM,wBAAwB,GACjD;IACE,KAAK,CAAC,EAAE,qBAAqB,CAAC,wBAAwB,CAAC,UAAU,CAAC,CAAC,CAAA;CACpE,GACC,GAAG,CAAC"}
|
|
@@ -1,14 +1,11 @@
|
|
|
1
1
|
import { HostEvent } from '../../types';
|
|
2
|
-
import { UiPassthroughArrayResponse, UiPassthroughEvent, HostEventRequest, HostEventResponse, UiPassthroughRequest,
|
|
3
|
-
type UiPassthroughHandlerWithIframe = <UiPassthroughEventT extends UiPassthroughEvent>(iFrame: HTMLIFrameElement, apiName: UiPassthroughEventT, parameters: FlattenType<UiPassthroughRequest<UiPassthroughEventT>>) => UiPassthroughArrayResponse<UiPassthroughEventT>;
|
|
4
|
-
export type UiPassthroughHandler = <UiPassthroughEventT extends UiPassthroughEvent>(apiName: UiPassthroughEventT, parameters: FlattenType<UiPassthroughRequest<UiPassthroughEventT>>) => UiPassthroughArrayResponse<UiPassthroughEventT>;
|
|
2
|
+
import { UiPassthroughArrayResponse, UiPassthroughEvent, HostEventRequest, HostEventResponse, UiPassthroughRequest, UiPassthroughResponse } from './contracts';
|
|
5
3
|
export declare class HostEventClient {
|
|
6
4
|
thoughtSpotHost: string;
|
|
7
5
|
constructor(thoughtSpotHost: string);
|
|
8
|
-
executeUiPassthroughApi:
|
|
9
|
-
handleUiPassthroughForHostEvent:
|
|
6
|
+
executeUiPassthroughApi<UiPassthroughEventT extends UiPassthroughEvent>(iFrame: HTMLIFrameElement, apiName: UiPassthroughEventT, parameters: UiPassthroughRequest<UiPassthroughEventT>): UiPassthroughArrayResponse<UiPassthroughEventT>;
|
|
7
|
+
handleUiPassthroughForHostEvent<UiPassthroughEventT extends UiPassthroughEvent>(iFrame: HTMLIFrameElement, apiName: UiPassthroughEventT, parameters: UiPassthroughRequest<UiPassthroughEventT>): Promise<UiPassthroughResponse<UiPassthroughEventT>>;
|
|
10
8
|
hostEventFallback(iFrame: HTMLIFrameElement, hostEvent: HostEvent, data: any): Promise<any>;
|
|
11
9
|
executeHostEvent<T extends HostEvent>(iFrame: HTMLIFrameElement, hostEvent: HostEvent, payload?: HostEventRequest<T>): Promise<HostEventResponse<HostEvent>>;
|
|
12
10
|
}
|
|
13
|
-
export {};
|
|
14
11
|
//# sourceMappingURL=host-event-client.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"host-event-client.d.ts","sourceRoot":"","sources":["host-event-client.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,MAAM,aAAa,CAAC;AAExC,OAAO,EACH,0BAA0B,EAC1B,kBAAkB,EAAE,gBAAgB,EAAE,iBAAiB,EACvD,oBAAoB,EACpB,
|
|
1
|
+
{"version":3,"file":"host-event-client.d.ts","sourceRoot":"","sources":["host-event-client.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,MAAM,aAAa,CAAC;AAExC,OAAO,EACH,0BAA0B,EAC1B,kBAAkB,EAAE,gBAAgB,EAAE,iBAAiB,EACvD,oBAAoB,EACpB,qBAAqB,EACxB,MAAM,aAAa,CAAC;AAErB,qBAAa,eAAe;IAC1B,eAAe,EAAE,MAAM,CAAC;gBAEZ,eAAe,EAAE,MAAM;IAItB,uBAAuB,CAAC,mBAAmB,SAAS,kBAAkB,EAC/E,MAAM,EAAE,iBAAiB,EACzB,OAAO,EAAE,mBAAmB,EAC5B,UAAU,EAAE,oBAAoB,CAAC,mBAAmB,CAAC,GACtD,0BAA0B,CAAC,mBAAmB,CAAC;IASrC,+BAA+B,CAAC,mBAAmB,SAAS,kBAAkB,EACvF,MAAM,EAAE,iBAAiB,EACzB,OAAO,EAAE,mBAAmB,EAC5B,UAAU,EAAE,oBAAoB,CAAC,mBAAmB,CAAC,GACtD,OAAO,CAAC,qBAAqB,CAAC,mBAAmB,CAAC,CAAC;IAmBzC,iBAAiB,CAC1B,MAAM,EAAE,iBAAiB,EAAE,SAAS,EAAE,SAAS,EAAE,IAAI,EAAE,GAAG,GAC3D,OAAO,CAAC,GAAG,CAAC;IAIF,gBAAgB,CAAC,CAAC,SAAS,SAAS,EAC7C,MAAM,EAAE,iBAAiB,EACzB,SAAS,EAAE,SAAS,EACpB,OAAO,CAAC,EAAE,gBAAgB,CAAC,CAAC,CAAC,GAC9B,OAAO,CAAC,iBAAiB,CAAC,SAAS,CAAC,CAAC;CAezC"}
|
|
@@ -5,10 +5,10 @@
|
|
|
5
5
|
* @summary Base classes
|
|
6
6
|
* @author Ayon Ghosh <ayon.ghosh@thoughtspot.com>
|
|
7
7
|
*/
|
|
8
|
-
import { HostEventRequest, HostEventResponse } from './hostEventClient/contracts';
|
|
8
|
+
import { HostEventRequest, HostEventResponse, UiPassthroughArrayResponse, UiPassthroughEvent, UiPassthroughRequest } from './hostEventClient/contracts';
|
|
9
9
|
import { AnswerService } from '../utils/graphql/answerService/answerService';
|
|
10
10
|
import { DOMSelector, HostEvent, EmbedEvent, MessageCallback, EmbedConfig, MessageOptions, ViewConfig } from '../types';
|
|
11
|
-
import { HostEventClient
|
|
11
|
+
import { HostEventClient } from './hostEventClient/host-event-client';
|
|
12
12
|
/**
|
|
13
13
|
* Global prefix for all Thoughtspot postHash Params.
|
|
14
14
|
*/
|
|
@@ -264,7 +264,7 @@ export declare class TsEmbed {
|
|
|
264
264
|
* @returns {Promise<UiPassthroughRequest>} - A promise that resolves with the response
|
|
265
265
|
* from the embedded app.
|
|
266
266
|
*/
|
|
267
|
-
triggerUiPassThrough:
|
|
267
|
+
triggerUiPassThrough<UiPassthroughEventT extends UiPassthroughEvent>(apiName: UiPassthroughEventT, parameters: UiPassthroughRequest<UiPassthroughEventT>): UiPassthroughArrayResponse<UiPassthroughEventT>;
|
|
268
268
|
/**
|
|
269
269
|
* Marks the ThoughtSpot object to have been rendered
|
|
270
270
|
* Needs to be overridden by subclasses to do the actual
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ts-embed.d.ts","sourceRoot":"","sources":["ts-embed.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAKH,OAAO,
|
|
1
|
+
{"version":3,"file":"ts-embed.d.ts","sourceRoot":"","sources":["ts-embed.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAKH,OAAO,EACH,gBAAgB,EAChB,iBAAiB,EACjB,0BAA0B,EAC1B,kBAAkB,EAClB,oBAAoB,EACvB,MAAM,6BAA6B,CAAC;AAGrC,OAAO,EAAE,aAAa,EAAE,MAAM,8CAA8C,CAAC;AAwB7E,OAAO,EAEH,WAAW,EACX,SAAS,EACT,UAAU,EACV,eAAe,EAGf,WAAW,EACX,cAAc,EAGd,UAAU,EAIb,MAAM,UAAU,CAAC;AAWlB,OAAO,EAAE,eAAe,EAAE,MAAM,qCAAqC,CAAC;AAItE;;GAEG;AACH,eAAO,MAAM,wBAAwB,QAAQ,CAAC;AAW9C;;;;GAIG;AACH,qBAAa,OAAO;IAChB;;;;;OAKG;IACH,SAAS,CAAC,aAAa,EAAE,IAAI,CAAC;IAE9B;;OAEG;IACH,SAAS,CAAC,EAAE,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AI;IASf,yBAAyB,IAAI,iBAAiB;IAIrD;;;;;;OAMG;IACU,gBAAgB,IAAI,OAAO,CAAC,GAAG,CAAC;IAM7C,SAAS,CAAC,sBAAsB,IAAI,IAAI;IAIxC,OAAO,CAAC,2BAA2B,CAyBjC;IAEF;;;;;OAKG;IACI,aAAa,IAAI,IAAI;IAwC5B;;;;;;;OAOG;IACI,kBAAkB,IAAI,IAAI;IAejC;;;OAGG;IACI,aAAa,IAAI,IAAI;IAqB5B;;;;;;OAMG;IACI,eAAe;;;;IAOtB;;;;;OAKG;IACU,gBAAgB,CAAC,KAAK,CAAC,EAAE,MAAM,GAAG,OAAO,CAAC,aAAa,CAAC;CAIxE;AAED;;;;;GAKG;AACH,qBAAa,OAAQ,SAAQ,OAAO;IAChC,SAAS,CAAC,UAAU,EAAE,UAAU,CAAC;gBAErB,WAAW,EAAE,WAAW,EAAE,UAAU,EAAE,UAAU;IAK5D;;;OAGG;IACH,SAAS,CAAC,aAAa,CAAC,SAAS,EAAE,MAAM,GAAG,OAAO,CAAC,GAAG,CAAC;IAIxD,SAAS,CAAC,gBAAgB,IAAI,MAAM;IAqBpC;;;;;;;;;;;;;;;;OAgBG;IACI,EAAE,CACL,WAAW,EAAE,UAAU,EACvB,QAAQ,EAAE,eAAe,EACzB,OAAO,GAAE,cAAiC,GAC3C,OAAO,OAAO,CAAC,SAAS;IAK3B;;;OAGG;IAEI,sBAAsB,6EAAyB;CACzD"}
|
package/dist/src/types.d.ts
CHANGED
|
@@ -3152,7 +3152,7 @@ export declare enum HostEvent {
|
|
|
3152
3152
|
UpdatePersonalisedView = "UpdatePersonalisedView",
|
|
3153
3153
|
/**
|
|
3154
3154
|
* Triggers the action to get the current view of the liveboard
|
|
3155
|
-
* @version SDK: 1.
|
|
3155
|
+
* @version SDK: 1.36.0 | Thoughtspot: 10.6.0.cl
|
|
3156
3156
|
*/
|
|
3157
3157
|
SaveAnswer = "saveAnswer",
|
|
3158
3158
|
/**
|
package/dist/tsembed-react.es.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
/* @thoughtspot/visual-embed-sdk version 1.35.5-hostEvent.
|
|
1
|
+
/* @thoughtspot/visual-embed-sdk version 1.35.5-hostEvent.2 */
|
|
2
2
|
import * as React from 'react';
|
|
3
3
|
import React__default from 'react';
|
|
4
4
|
|
|
@@ -2665,7 +2665,7 @@ var HostEvent;
|
|
|
2665
2665
|
HostEvent["UpdatePersonalisedView"] = "UpdatePersonalisedView";
|
|
2666
2666
|
/**
|
|
2667
2667
|
* Triggers the action to get the current view of the liveboard
|
|
2668
|
-
* @version SDK: 1.
|
|
2668
|
+
* @version SDK: 1.36.0 | Thoughtspot: 10.6.0.cl
|
|
2669
2669
|
*/
|
|
2670
2670
|
HostEvent["SaveAnswer"] = "saveAnswer";
|
|
2671
2671
|
/**
|
|
@@ -7160,7 +7160,7 @@ class AnswerService {
|
|
|
7160
7160
|
async getTML() {
|
|
7161
7161
|
const { object } = await this.executeQuery(getAnswerTML, {});
|
|
7162
7162
|
const edoc = object[0].edoc;
|
|
7163
|
-
const YAML = await import('./index-
|
|
7163
|
+
const YAML = await import('./index-DFwi_pV_.js');
|
|
7164
7164
|
const parsedDoc = YAML.parse(edoc);
|
|
7165
7165
|
return {
|
|
7166
7166
|
answer: {
|
|
@@ -14503,7 +14503,7 @@ function processEventData(type, e, thoughtSpotHost, containerEl) {
|
|
|
14503
14503
|
return e;
|
|
14504
14504
|
}
|
|
14505
14505
|
|
|
14506
|
-
var name="@thoughtspot/visual-embed-sdk";var version$1="1.35.5-hostEvent.
|
|
14506
|
+
var name="@thoughtspot/visual-embed-sdk";var version$1="1.35.5-hostEvent.2";var description="ThoughtSpot Embed SDK";var module="lib/src/index.js";var main="dist/tsembed.js";var types="lib/src/index.d.ts";var files=["dist/**","lib/**","src/**","cjs/**"];var exports={".":{"import":"./lib/src/index.js",require:"./cjs/src/index.js",types:"./lib/src/index.d.ts"},"./react":{"import":"./lib/src/react/all-types-export.js",require:"./cjs/src/react/all-types-export.js",types:"./lib/src/react/all-types-export.d.ts"},"./lib/src/react":{"import":"./lib/src/react/all-types-export.js",require:"./cjs/src/react/all-types-export.js",types:"./lib/src/react/all-types-export.d.ts"}};var typesVersions={"*":{react:["./lib/src/react/all-types-export.d.ts"]}};var scripts={lint:"eslint 'src/**'","lint:fix":"eslint 'src/**/*.*' --fix",tsc:"tsc -p . --incremental false; tsc -p . --incremental false --module commonjs --outDir cjs","build-and-publish":"npm run build:gatsby && npm run publish","bundle-dts-file":"dts-bundle --name @thoughtspot/visual-embed-sdk --out visual-embed-sdk.d.ts --main lib/src/index.d.ts","bundle-dts":"dts-bundle --name ../../dist/visual-embed-sdk --main lib/src/index.d.ts --outputAsModuleFolder=true","bundle-dts-react":"dts-bundle --name ../../../dist/visual-embed-sdk-react --main lib/src/react/index.d.ts --outputAsModuleFolder=true","bundle-dts-react-full":"dts-bundle --name ../../../dist/visual-embed-sdk-react-full --main lib/src/react/all-types-export.d.ts --outputAsModuleFolder=true",build:"rollup -c",watch:"rollup -cw",docgen:"typedoc --tsconfig tsconfig.json --theme typedoc-theme --json static/typedoc/typedoc.json --disableOutputCheck","test-sdk":"jest -c jest.config.sdk.js --runInBand",test:"npm run test-sdk",posttest:"cat ./coverage/sdk/lcov.info | coveralls","is-publish-allowed":"node scripts/is-publish-allowed.js",prepublishOnly:"npm run is-publish-allowed && npm run test && npm run tsc && npm run bundle-dts-file && npm run bundle-dts && npm run bundle-dts-react && npm run bundle-dts-react-full && npm run build","check-size":"npm run build && size-limit","publish-dev":"npm publish --tag dev","publish-prod":"npm publish --tag latest",dev:"vite -c vite.local.config.ts"};var peerDependencies={react:"> 16.8.0","react-dom":"> 16.8.0"};var dependencies={algoliasearch:"^4.10.5",classnames:"^2.3.1",dompurify:"^2.3.4",eventemitter3:"^4.0.7","gatsby-plugin-vercel":"^1.0.3","html-react-parser":"^1.4.12",lodash:"^4.17.21","mixpanel-browser":"2.47.0","ts-deepmerge":"^6.0.2",tslib:"^2.5.3","use-deep-compare-effect":"^1.8.1",yaml:"^2.5.1"};var devDependencies={"@mdx-js/mdx":"^1.6.22","@mdx-js/react":"^1.6.22","@react-icons/all-files":"^4.1.0","@rollup/plugin-commonjs":"^18.0.0","@rollup/plugin-json":"^4.1.0","@rollup/plugin-node-resolve":"^11.2.1","@rollup/plugin-replace":"^5.0.2","@size-limit/preset-big-lib":"^8.2.6","@testing-library/dom":"^7.31.0","@testing-library/jest-dom":"^5.14.1","@testing-library/react":"^11.2.7","@testing-library/user-event":"^13.1.8","@types/jest":"^22.2.3","@types/lodash":"^4.17.0","@types/mixpanel-browser":"^2.35.6","@types/react-test-renderer":"^17.0.1","@typescript-eslint/eslint-plugin":"^4.6.0","@typescript-eslint/parser":"^4.6.0",asciidoctor:"^2.2.1","babel-jest":"^26.6.3","babel-preset-gatsby":"^1.10.0","command-line-args":"^5.1.1",coveralls:"^3.1.0",crypto:"^1.0.1","current-git-branch":"^1.1.0","dts-bundle":"^0.7.3",eslint:"^7.12.1","eslint-config-airbnb-base":"^14.2.0","eslint-config-prettier":"^6.15.0","eslint-import-resolver-typescript":"^2.3.0","eslint-plugin-import":"^2.22.1","eslint-plugin-prettier":"^3.1.4","eslint-plugin-react-hooks":"^4.2.0","eslint-plugin-comment-length":"1.7.3","eslint-plugin-jsdoc":"^46.9.0","fs-extra":"^10.0.0","gh-pages":"^3.1.0","highlight.js":"^10.6.0","html-to-text":"^8.0.0","identity-obj-proxy":"^3.0.0","istanbul-merge":"^1.1.1",jest:"^26.6.3","jest-fetch-mock":"^3.0.3",jsdom:"^17.0.0","node-sass":"^8.0.0",prettier:"2.1.2",react:"^16.14.0","react-dom":"^16.14.0","react-resizable":"^1.11.0","react-resize-detector":"^6.6.0","react-test-renderer":"^17.0.2","react-use-flexsearch":"^0.1.1",rollup:"4.24.0","rollup-plugin-typescript2":"0.27.3","ts-jest":"^26.5.5","ts-loader":"8.0.4",typedoc:"0.21.6","typedoc-plugin-toc-group":"thoughtspot/typedoc-plugin-toc-group",typescript:"^4.9.4","url-search-params-polyfill":"^8.1.0",util:"^0.12.4",vite:"^5.3.4"};var author="ThoughtSpot";var email="support@thoughtspot.com";var license="ThoughtSpot Development Tools End User License Agreement";var directories={lib:"lib"};var repository={type:"git",url:"git+https://github.com/thoughtspot/visual-embed-sdk.git"};var publishConfig={registry:"https://registry.npmjs.org"};var keywords=["thoughtspot","everywhere","embedded","embed","sdk","analytics"];var bugs={url:"https://github.com/thoughtspot/visual-embed-sdk/issues"};var homepage="https://github.com/thoughtspot/visual-embed-sdk#readme";var globals={window:{}};var pkgInfo = {name:name,version:version$1,description:description,module:module,main:main,types:types,files:files,exports:exports,typesVersions:typesVersions,"size-limit":[{path:"dist/tsembed.es.js",limit:"31 kB"}],scripts:scripts,peerDependencies:peerDependencies,dependencies:dependencies,devDependencies:devDependencies,author:author,email:email,license:license,directories:directories,repository:repository,publishConfig:publishConfig,keywords:keywords,bugs:bugs,homepage:homepage,globals:globals};
|
|
14507
14507
|
|
|
14508
14508
|
/**
|
|
14509
14509
|
* Reloads the ThoughtSpot iframe.
|
|
@@ -14572,35 +14572,34 @@ var UiPassthroughEvent;
|
|
|
14572
14572
|
UiPassthroughEvent["getAvailableUiPassthroughs"] = "getAvailableUiPassthroughs";
|
|
14573
14573
|
UiPassthroughEvent["getAnswerPageConfig"] = "getAnswerPageConfig";
|
|
14574
14574
|
UiPassthroughEvent["getPinboardPageConfig"] = "getPinboardPageConfig";
|
|
14575
|
-
UiPassthroughEvent["UiPassthroughEventNotFound"] = "UiPassthroughEventNotFound";
|
|
14576
14575
|
})(UiPassthroughEvent || (UiPassthroughEvent = {}));
|
|
14577
14576
|
|
|
14578
14577
|
class HostEventClient {
|
|
14579
14578
|
constructor(thoughtSpotHost) {
|
|
14580
|
-
this.executeUiPassthroughApi = async (iFrame, apiName, parameters) => {
|
|
14581
|
-
const res = await processTrigger(iFrame, HostEvent.UiPassthrough, this.thoughtSpotHost, {
|
|
14582
|
-
type: apiName,
|
|
14583
|
-
parameters,
|
|
14584
|
-
});
|
|
14585
|
-
return res;
|
|
14586
|
-
};
|
|
14587
|
-
this.handleUiPassthroughForHostEvent = async (iFrame, apiName, parameters) => {
|
|
14588
|
-
var _a, _b, _c;
|
|
14589
|
-
const response = (_b = (_a = (await this.executeUiPassthroughApi(iFrame, apiName, parameters))) === null || _a === void 0 ? void 0 : _a.filter) === null || _b === void 0 ? void 0 : _b.call(_a, (r) => r.error || r.value)[0];
|
|
14590
|
-
if (!response) {
|
|
14591
|
-
const error = `No answer found${parameters.vizId ? ` for vizId: ${parameters.vizId}` : ''}.`;
|
|
14592
|
-
// eslint-disable-next-line no-throw-literal
|
|
14593
|
-
throw { error };
|
|
14594
|
-
}
|
|
14595
|
-
const errors = response.error || ((_c = response.value) === null || _c === void 0 ? void 0 : _c.errors);
|
|
14596
|
-
if (errors) {
|
|
14597
|
-
// eslint-disable-next-line no-throw-literal
|
|
14598
|
-
throw { error: response.error };
|
|
14599
|
-
}
|
|
14600
|
-
return { ...response.value };
|
|
14601
|
-
};
|
|
14602
14579
|
this.thoughtSpotHost = thoughtSpotHost;
|
|
14603
14580
|
}
|
|
14581
|
+
async executeUiPassthroughApi(iFrame, apiName, parameters) {
|
|
14582
|
+
const res = await processTrigger(iFrame, HostEvent.UiPassthrough, this.thoughtSpotHost, {
|
|
14583
|
+
type: apiName,
|
|
14584
|
+
parameters,
|
|
14585
|
+
});
|
|
14586
|
+
return res;
|
|
14587
|
+
}
|
|
14588
|
+
async handleUiPassthroughForHostEvent(iFrame, apiName, parameters) {
|
|
14589
|
+
var _a, _b, _c;
|
|
14590
|
+
const response = (_b = (_a = (await this.executeUiPassthroughApi(iFrame, apiName, parameters))) === null || _a === void 0 ? void 0 : _a.filter) === null || _b === void 0 ? void 0 : _b.call(_a, (r) => r.error || r.value)[0];
|
|
14591
|
+
if (!response) {
|
|
14592
|
+
const error = `No answer found${parameters.vizId ? ` for vizId: ${parameters.vizId}` : ''}.`;
|
|
14593
|
+
// eslint-disable-next-line no-throw-literal
|
|
14594
|
+
throw { error };
|
|
14595
|
+
}
|
|
14596
|
+
const errors = response.error || ((_c = response.value) === null || _c === void 0 ? void 0 : _c.errors);
|
|
14597
|
+
if (errors) {
|
|
14598
|
+
// eslint-disable-next-line no-throw-literal
|
|
14599
|
+
throw { error: response.error };
|
|
14600
|
+
}
|
|
14601
|
+
return { ...response.value };
|
|
14602
|
+
}
|
|
14604
14603
|
async hostEventFallback(iFrame, hostEvent, data) {
|
|
14605
14604
|
return processTrigger(iFrame, hostEvent, this.thoughtSpotHost, data);
|
|
14606
14605
|
}
|
|
@@ -14731,17 +14730,6 @@ class TsEmbed {
|
|
|
14731
14730
|
this.on(EmbedEvent.AuthExpire, this.updateAuthToken, { start: false }, true);
|
|
14732
14731
|
};
|
|
14733
14732
|
this.showPreRenderByDefault = false;
|
|
14734
|
-
/**
|
|
14735
|
-
* Triggers an event to the embedded app, skipping the UI flow.
|
|
14736
|
-
* @param {UiPassthroughEvent} apiName - The name of the API to be triggered.
|
|
14737
|
-
* @param {UiPassthroughRequest} parameters - The parameters to be passed to the API.
|
|
14738
|
-
* @returns {Promise<UiPassthroughRequest>} - A promise that resolves with the response
|
|
14739
|
-
* from the embedded app.
|
|
14740
|
-
*/
|
|
14741
|
-
// eslint-disable-next-line arrow-body-style
|
|
14742
|
-
this.triggerUiPassThrough = (apiName, parameters) => {
|
|
14743
|
-
return this.hostEventClient.executeUiPassthroughApi(this.iFrame, apiName, parameters);
|
|
14744
|
-
};
|
|
14745
14733
|
this.validatePreRenderViewConfig = (viewConfig) => {
|
|
14746
14734
|
var _a;
|
|
14747
14735
|
const preRenderAllowedKeys = ['preRenderId', 'vizId', 'liveboardId'];
|
|
@@ -15416,6 +15404,17 @@ class TsEmbed {
|
|
|
15416
15404
|
}
|
|
15417
15405
|
return this.hostEventClient.executeHostEvent(this.iFrame, messageType, data);
|
|
15418
15406
|
}
|
|
15407
|
+
/**
|
|
15408
|
+
* Triggers an event to the embedded app, skipping the UI flow.
|
|
15409
|
+
* @param {UiPassthroughEvent} apiName - The name of the API to be triggered.
|
|
15410
|
+
* @param {UiPassthroughRequest} parameters - The parameters to be passed to the API.
|
|
15411
|
+
* @returns {Promise<UiPassthroughRequest>} - A promise that resolves with the response
|
|
15412
|
+
* from the embedded app.
|
|
15413
|
+
*/
|
|
15414
|
+
// eslint-disable-next-line arrow-body-style
|
|
15415
|
+
triggerUiPassThrough(apiName, parameters) {
|
|
15416
|
+
return this.hostEventClient.executeUiPassthroughApi(this.iFrame, apiName, parameters);
|
|
15417
|
+
}
|
|
15419
15418
|
/**
|
|
15420
15419
|
* Marks the ThoughtSpot object to have been rendered
|
|
15421
15420
|
* Needs to be overridden by subclasses to do the actual
|
package/dist/tsembed-react.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
/* @thoughtspot/visual-embed-sdk version 1.35.5-hostEvent.
|
|
1
|
+
/* @thoughtspot/visual-embed-sdk version 1.35.5-hostEvent.2 */
|
|
2
2
|
(function (global, factory) {
|
|
3
3
|
typeof exports === 'object' && typeof module !== 'undefined' ? factory(exports, require('react')) :
|
|
4
4
|
typeof define === 'function' && define.amd ? define(['exports', 'react'], factory) :
|
|
@@ -2687,7 +2687,7 @@
|
|
|
2687
2687
|
HostEvent["UpdatePersonalisedView"] = "UpdatePersonalisedView";
|
|
2688
2688
|
/**
|
|
2689
2689
|
* Triggers the action to get the current view of the liveboard
|
|
2690
|
-
* @version SDK: 1.
|
|
2690
|
+
* @version SDK: 1.36.0 | Thoughtspot: 10.6.0.cl
|
|
2691
2691
|
*/
|
|
2692
2692
|
HostEvent["SaveAnswer"] = "saveAnswer";
|
|
2693
2693
|
/**
|
|
@@ -14525,7 +14525,7 @@ mutation GetUnsavedAnswerTML($session: BachSessionIdInput!, $exportDependencies:
|
|
|
14525
14525
|
return e;
|
|
14526
14526
|
}
|
|
14527
14527
|
|
|
14528
|
-
var name="@thoughtspot/visual-embed-sdk";var version$1="1.35.5-hostEvent.
|
|
14528
|
+
var name="@thoughtspot/visual-embed-sdk";var version$1="1.35.5-hostEvent.2";var description="ThoughtSpot Embed SDK";var module="lib/src/index.js";var main="dist/tsembed.js";var types="lib/src/index.d.ts";var files=["dist/**","lib/**","src/**","cjs/**"];var exports$1={".":{"import":"./lib/src/index.js",require:"./cjs/src/index.js",types:"./lib/src/index.d.ts"},"./react":{"import":"./lib/src/react/all-types-export.js",require:"./cjs/src/react/all-types-export.js",types:"./lib/src/react/all-types-export.d.ts"},"./lib/src/react":{"import":"./lib/src/react/all-types-export.js",require:"./cjs/src/react/all-types-export.js",types:"./lib/src/react/all-types-export.d.ts"}};var typesVersions={"*":{react:["./lib/src/react/all-types-export.d.ts"]}};var scripts={lint:"eslint 'src/**'","lint:fix":"eslint 'src/**/*.*' --fix",tsc:"tsc -p . --incremental false; tsc -p . --incremental false --module commonjs --outDir cjs","build-and-publish":"npm run build:gatsby && npm run publish","bundle-dts-file":"dts-bundle --name @thoughtspot/visual-embed-sdk --out visual-embed-sdk.d.ts --main lib/src/index.d.ts","bundle-dts":"dts-bundle --name ../../dist/visual-embed-sdk --main lib/src/index.d.ts --outputAsModuleFolder=true","bundle-dts-react":"dts-bundle --name ../../../dist/visual-embed-sdk-react --main lib/src/react/index.d.ts --outputAsModuleFolder=true","bundle-dts-react-full":"dts-bundle --name ../../../dist/visual-embed-sdk-react-full --main lib/src/react/all-types-export.d.ts --outputAsModuleFolder=true",build:"rollup -c",watch:"rollup -cw",docgen:"typedoc --tsconfig tsconfig.json --theme typedoc-theme --json static/typedoc/typedoc.json --disableOutputCheck","test-sdk":"jest -c jest.config.sdk.js --runInBand",test:"npm run test-sdk",posttest:"cat ./coverage/sdk/lcov.info | coveralls","is-publish-allowed":"node scripts/is-publish-allowed.js",prepublishOnly:"npm run is-publish-allowed && npm run test && npm run tsc && npm run bundle-dts-file && npm run bundle-dts && npm run bundle-dts-react && npm run bundle-dts-react-full && npm run build","check-size":"npm run build && size-limit","publish-dev":"npm publish --tag dev","publish-prod":"npm publish --tag latest",dev:"vite -c vite.local.config.ts"};var peerDependencies={react:"> 16.8.0","react-dom":"> 16.8.0"};var dependencies={algoliasearch:"^4.10.5",classnames:"^2.3.1",dompurify:"^2.3.4",eventemitter3:"^4.0.7","gatsby-plugin-vercel":"^1.0.3","html-react-parser":"^1.4.12",lodash:"^4.17.21","mixpanel-browser":"2.47.0","ts-deepmerge":"^6.0.2",tslib:"^2.5.3","use-deep-compare-effect":"^1.8.1",yaml:"^2.5.1"};var devDependencies={"@mdx-js/mdx":"^1.6.22","@mdx-js/react":"^1.6.22","@react-icons/all-files":"^4.1.0","@rollup/plugin-commonjs":"^18.0.0","@rollup/plugin-json":"^4.1.0","@rollup/plugin-node-resolve":"^11.2.1","@rollup/plugin-replace":"^5.0.2","@size-limit/preset-big-lib":"^8.2.6","@testing-library/dom":"^7.31.0","@testing-library/jest-dom":"^5.14.1","@testing-library/react":"^11.2.7","@testing-library/user-event":"^13.1.8","@types/jest":"^22.2.3","@types/lodash":"^4.17.0","@types/mixpanel-browser":"^2.35.6","@types/react-test-renderer":"^17.0.1","@typescript-eslint/eslint-plugin":"^4.6.0","@typescript-eslint/parser":"^4.6.0",asciidoctor:"^2.2.1","babel-jest":"^26.6.3","babel-preset-gatsby":"^1.10.0","command-line-args":"^5.1.1",coveralls:"^3.1.0",crypto:"^1.0.1","current-git-branch":"^1.1.0","dts-bundle":"^0.7.3",eslint:"^7.12.1","eslint-config-airbnb-base":"^14.2.0","eslint-config-prettier":"^6.15.0","eslint-import-resolver-typescript":"^2.3.0","eslint-plugin-import":"^2.22.1","eslint-plugin-prettier":"^3.1.4","eslint-plugin-react-hooks":"^4.2.0","eslint-plugin-comment-length":"1.7.3","eslint-plugin-jsdoc":"^46.9.0","fs-extra":"^10.0.0","gh-pages":"^3.1.0","highlight.js":"^10.6.0","html-to-text":"^8.0.0","identity-obj-proxy":"^3.0.0","istanbul-merge":"^1.1.1",jest:"^26.6.3","jest-fetch-mock":"^3.0.3",jsdom:"^17.0.0","node-sass":"^8.0.0",prettier:"2.1.2",react:"^16.14.0","react-dom":"^16.14.0","react-resizable":"^1.11.0","react-resize-detector":"^6.6.0","react-test-renderer":"^17.0.2","react-use-flexsearch":"^0.1.1",rollup:"4.24.0","rollup-plugin-typescript2":"0.27.3","ts-jest":"^26.5.5","ts-loader":"8.0.4",typedoc:"0.21.6","typedoc-plugin-toc-group":"thoughtspot/typedoc-plugin-toc-group",typescript:"^4.9.4","url-search-params-polyfill":"^8.1.0",util:"^0.12.4",vite:"^5.3.4"};var author="ThoughtSpot";var email="support@thoughtspot.com";var license="ThoughtSpot Development Tools End User License Agreement";var directories={lib:"lib"};var repository={type:"git",url:"git+https://github.com/thoughtspot/visual-embed-sdk.git"};var publishConfig={registry:"https://registry.npmjs.org"};var keywords=["thoughtspot","everywhere","embedded","embed","sdk","analytics"];var bugs={url:"https://github.com/thoughtspot/visual-embed-sdk/issues"};var homepage="https://github.com/thoughtspot/visual-embed-sdk#readme";var globals={window:{}};var pkgInfo = {name:name,version:version$1,description:description,module:module,main:main,types:types,files:files,exports:exports$1,typesVersions:typesVersions,"size-limit":[{path:"dist/tsembed.es.js",limit:"31 kB"}],scripts:scripts,peerDependencies:peerDependencies,dependencies:dependencies,devDependencies:devDependencies,author:author,email:email,license:license,directories:directories,repository:repository,publishConfig:publishConfig,keywords:keywords,bugs:bugs,homepage:homepage,globals:globals};
|
|
14529
14529
|
|
|
14530
14530
|
/**
|
|
14531
14531
|
* Reloads the ThoughtSpot iframe.
|
|
@@ -14594,35 +14594,34 @@ mutation GetUnsavedAnswerTML($session: BachSessionIdInput!, $exportDependencies:
|
|
|
14594
14594
|
UiPassthroughEvent["getAvailableUiPassthroughs"] = "getAvailableUiPassthroughs";
|
|
14595
14595
|
UiPassthroughEvent["getAnswerPageConfig"] = "getAnswerPageConfig";
|
|
14596
14596
|
UiPassthroughEvent["getPinboardPageConfig"] = "getPinboardPageConfig";
|
|
14597
|
-
UiPassthroughEvent["UiPassthroughEventNotFound"] = "UiPassthroughEventNotFound";
|
|
14598
14597
|
})(UiPassthroughEvent || (UiPassthroughEvent = {}));
|
|
14599
14598
|
|
|
14600
14599
|
class HostEventClient {
|
|
14601
14600
|
constructor(thoughtSpotHost) {
|
|
14602
|
-
this.executeUiPassthroughApi = async (iFrame, apiName, parameters) => {
|
|
14603
|
-
const res = await processTrigger(iFrame, exports.HostEvent.UiPassthrough, this.thoughtSpotHost, {
|
|
14604
|
-
type: apiName,
|
|
14605
|
-
parameters,
|
|
14606
|
-
});
|
|
14607
|
-
return res;
|
|
14608
|
-
};
|
|
14609
|
-
this.handleUiPassthroughForHostEvent = async (iFrame, apiName, parameters) => {
|
|
14610
|
-
var _a, _b, _c;
|
|
14611
|
-
const response = (_b = (_a = (await this.executeUiPassthroughApi(iFrame, apiName, parameters))) === null || _a === void 0 ? void 0 : _a.filter) === null || _b === void 0 ? void 0 : _b.call(_a, (r) => r.error || r.value)[0];
|
|
14612
|
-
if (!response) {
|
|
14613
|
-
const error = `No answer found${parameters.vizId ? ` for vizId: ${parameters.vizId}` : ''}.`;
|
|
14614
|
-
// eslint-disable-next-line no-throw-literal
|
|
14615
|
-
throw { error };
|
|
14616
|
-
}
|
|
14617
|
-
const errors = response.error || ((_c = response.value) === null || _c === void 0 ? void 0 : _c.errors);
|
|
14618
|
-
if (errors) {
|
|
14619
|
-
// eslint-disable-next-line no-throw-literal
|
|
14620
|
-
throw { error: response.error };
|
|
14621
|
-
}
|
|
14622
|
-
return { ...response.value };
|
|
14623
|
-
};
|
|
14624
14601
|
this.thoughtSpotHost = thoughtSpotHost;
|
|
14625
14602
|
}
|
|
14603
|
+
async executeUiPassthroughApi(iFrame, apiName, parameters) {
|
|
14604
|
+
const res = await processTrigger(iFrame, exports.HostEvent.UiPassthrough, this.thoughtSpotHost, {
|
|
14605
|
+
type: apiName,
|
|
14606
|
+
parameters,
|
|
14607
|
+
});
|
|
14608
|
+
return res;
|
|
14609
|
+
}
|
|
14610
|
+
async handleUiPassthroughForHostEvent(iFrame, apiName, parameters) {
|
|
14611
|
+
var _a, _b, _c;
|
|
14612
|
+
const response = (_b = (_a = (await this.executeUiPassthroughApi(iFrame, apiName, parameters))) === null || _a === void 0 ? void 0 : _a.filter) === null || _b === void 0 ? void 0 : _b.call(_a, (r) => r.error || r.value)[0];
|
|
14613
|
+
if (!response) {
|
|
14614
|
+
const error = `No answer found${parameters.vizId ? ` for vizId: ${parameters.vizId}` : ''}.`;
|
|
14615
|
+
// eslint-disable-next-line no-throw-literal
|
|
14616
|
+
throw { error };
|
|
14617
|
+
}
|
|
14618
|
+
const errors = response.error || ((_c = response.value) === null || _c === void 0 ? void 0 : _c.errors);
|
|
14619
|
+
if (errors) {
|
|
14620
|
+
// eslint-disable-next-line no-throw-literal
|
|
14621
|
+
throw { error: response.error };
|
|
14622
|
+
}
|
|
14623
|
+
return { ...response.value };
|
|
14624
|
+
}
|
|
14626
14625
|
async hostEventFallback(iFrame, hostEvent, data) {
|
|
14627
14626
|
return processTrigger(iFrame, hostEvent, this.thoughtSpotHost, data);
|
|
14628
14627
|
}
|
|
@@ -14753,17 +14752,6 @@ mutation GetUnsavedAnswerTML($session: BachSessionIdInput!, $exportDependencies:
|
|
|
14753
14752
|
this.on(exports.EmbedEvent.AuthExpire, this.updateAuthToken, { start: false }, true);
|
|
14754
14753
|
};
|
|
14755
14754
|
this.showPreRenderByDefault = false;
|
|
14756
|
-
/**
|
|
14757
|
-
* Triggers an event to the embedded app, skipping the UI flow.
|
|
14758
|
-
* @param {UiPassthroughEvent} apiName - The name of the API to be triggered.
|
|
14759
|
-
* @param {UiPassthroughRequest} parameters - The parameters to be passed to the API.
|
|
14760
|
-
* @returns {Promise<UiPassthroughRequest>} - A promise that resolves with the response
|
|
14761
|
-
* from the embedded app.
|
|
14762
|
-
*/
|
|
14763
|
-
// eslint-disable-next-line arrow-body-style
|
|
14764
|
-
this.triggerUiPassThrough = (apiName, parameters) => {
|
|
14765
|
-
return this.hostEventClient.executeUiPassthroughApi(this.iFrame, apiName, parameters);
|
|
14766
|
-
};
|
|
14767
14755
|
this.validatePreRenderViewConfig = (viewConfig) => {
|
|
14768
14756
|
var _a;
|
|
14769
14757
|
const preRenderAllowedKeys = ['preRenderId', 'vizId', 'liveboardId'];
|
|
@@ -15438,6 +15426,17 @@ mutation GetUnsavedAnswerTML($session: BachSessionIdInput!, $exportDependencies:
|
|
|
15438
15426
|
}
|
|
15439
15427
|
return this.hostEventClient.executeHostEvent(this.iFrame, messageType, data);
|
|
15440
15428
|
}
|
|
15429
|
+
/**
|
|
15430
|
+
* Triggers an event to the embedded app, skipping the UI flow.
|
|
15431
|
+
* @param {UiPassthroughEvent} apiName - The name of the API to be triggered.
|
|
15432
|
+
* @param {UiPassthroughRequest} parameters - The parameters to be passed to the API.
|
|
15433
|
+
* @returns {Promise<UiPassthroughRequest>} - A promise that resolves with the response
|
|
15434
|
+
* from the embedded app.
|
|
15435
|
+
*/
|
|
15436
|
+
// eslint-disable-next-line arrow-body-style
|
|
15437
|
+
triggerUiPassThrough(apiName, parameters) {
|
|
15438
|
+
return this.hostEventClient.executeUiPassthroughApi(this.iFrame, apiName, parameters);
|
|
15439
|
+
}
|
|
15441
15440
|
/**
|
|
15442
15441
|
* Marks the ThoughtSpot object to have been rendered
|
|
15443
15442
|
* Needs to be overridden by subclasses to do the actual
|
package/dist/tsembed.es.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
/* @thoughtspot/visual-embed-sdk version 1.35.5-hostEvent.
|
|
1
|
+
/* @thoughtspot/visual-embed-sdk version 1.35.5-hostEvent.2 */
|
|
2
2
|
function _mergeNamespaces(n, m) {
|
|
3
3
|
m.forEach(function (e) {
|
|
4
4
|
e && typeof e !== 'string' && !Array.isArray(e) && Object.keys(e).forEach(function (k) {
|
|
@@ -2550,7 +2550,7 @@ var HostEvent;
|
|
|
2550
2550
|
HostEvent["UpdatePersonalisedView"] = "UpdatePersonalisedView";
|
|
2551
2551
|
/**
|
|
2552
2552
|
* Triggers the action to get the current view of the liveboard
|
|
2553
|
-
* @version SDK: 1.
|
|
2553
|
+
* @version SDK: 1.36.0 | Thoughtspot: 10.6.0.cl
|
|
2554
2554
|
*/
|
|
2555
2555
|
HostEvent["SaveAnswer"] = "saveAnswer";
|
|
2556
2556
|
/**
|
|
@@ -7059,7 +7059,7 @@ class AnswerService {
|
|
|
7059
7059
|
async getTML() {
|
|
7060
7060
|
const { object } = await this.executeQuery(getAnswerTML, {});
|
|
7061
7061
|
const edoc = object[0].edoc;
|
|
7062
|
-
const YAML = await import('./index-
|
|
7062
|
+
const YAML = await import('./index-DFwi_pV_.js');
|
|
7063
7063
|
const parsedDoc = YAML.parse(edoc);
|
|
7064
7064
|
return {
|
|
7065
7065
|
answer: {
|
|
@@ -14745,7 +14745,7 @@ function processEventData(type, e, thoughtSpotHost, containerEl) {
|
|
|
14745
14745
|
return e;
|
|
14746
14746
|
}
|
|
14747
14747
|
|
|
14748
|
-
var name="@thoughtspot/visual-embed-sdk";var version$1="1.35.5-hostEvent.
|
|
14748
|
+
var name="@thoughtspot/visual-embed-sdk";var version$1="1.35.5-hostEvent.2";var description="ThoughtSpot Embed SDK";var module="lib/src/index.js";var main="dist/tsembed.js";var types="lib/src/index.d.ts";var files=["dist/**","lib/**","src/**","cjs/**"];var exports={".":{"import":"./lib/src/index.js",require:"./cjs/src/index.js",types:"./lib/src/index.d.ts"},"./react":{"import":"./lib/src/react/all-types-export.js",require:"./cjs/src/react/all-types-export.js",types:"./lib/src/react/all-types-export.d.ts"},"./lib/src/react":{"import":"./lib/src/react/all-types-export.js",require:"./cjs/src/react/all-types-export.js",types:"./lib/src/react/all-types-export.d.ts"}};var typesVersions={"*":{react:["./lib/src/react/all-types-export.d.ts"]}};var scripts={lint:"eslint 'src/**'","lint:fix":"eslint 'src/**/*.*' --fix",tsc:"tsc -p . --incremental false; tsc -p . --incremental false --module commonjs --outDir cjs","build-and-publish":"npm run build:gatsby && npm run publish","bundle-dts-file":"dts-bundle --name @thoughtspot/visual-embed-sdk --out visual-embed-sdk.d.ts --main lib/src/index.d.ts","bundle-dts":"dts-bundle --name ../../dist/visual-embed-sdk --main lib/src/index.d.ts --outputAsModuleFolder=true","bundle-dts-react":"dts-bundle --name ../../../dist/visual-embed-sdk-react --main lib/src/react/index.d.ts --outputAsModuleFolder=true","bundle-dts-react-full":"dts-bundle --name ../../../dist/visual-embed-sdk-react-full --main lib/src/react/all-types-export.d.ts --outputAsModuleFolder=true",build:"rollup -c",watch:"rollup -cw",docgen:"typedoc --tsconfig tsconfig.json --theme typedoc-theme --json static/typedoc/typedoc.json --disableOutputCheck","test-sdk":"jest -c jest.config.sdk.js --runInBand",test:"npm run test-sdk",posttest:"cat ./coverage/sdk/lcov.info | coveralls","is-publish-allowed":"node scripts/is-publish-allowed.js",prepublishOnly:"npm run is-publish-allowed && npm run test && npm run tsc && npm run bundle-dts-file && npm run bundle-dts && npm run bundle-dts-react && npm run bundle-dts-react-full && npm run build","check-size":"npm run build && size-limit","publish-dev":"npm publish --tag dev","publish-prod":"npm publish --tag latest",dev:"vite -c vite.local.config.ts"};var peerDependencies={react:"> 16.8.0","react-dom":"> 16.8.0"};var dependencies={algoliasearch:"^4.10.5",classnames:"^2.3.1",dompurify:"^2.3.4",eventemitter3:"^4.0.7","gatsby-plugin-vercel":"^1.0.3","html-react-parser":"^1.4.12",lodash:"^4.17.21","mixpanel-browser":"2.47.0","ts-deepmerge":"^6.0.2",tslib:"^2.5.3","use-deep-compare-effect":"^1.8.1",yaml:"^2.5.1"};var devDependencies={"@mdx-js/mdx":"^1.6.22","@mdx-js/react":"^1.6.22","@react-icons/all-files":"^4.1.0","@rollup/plugin-commonjs":"^18.0.0","@rollup/plugin-json":"^4.1.0","@rollup/plugin-node-resolve":"^11.2.1","@rollup/plugin-replace":"^5.0.2","@size-limit/preset-big-lib":"^8.2.6","@testing-library/dom":"^7.31.0","@testing-library/jest-dom":"^5.14.1","@testing-library/react":"^11.2.7","@testing-library/user-event":"^13.1.8","@types/jest":"^22.2.3","@types/lodash":"^4.17.0","@types/mixpanel-browser":"^2.35.6","@types/react-test-renderer":"^17.0.1","@typescript-eslint/eslint-plugin":"^4.6.0","@typescript-eslint/parser":"^4.6.0",asciidoctor:"^2.2.1","babel-jest":"^26.6.3","babel-preset-gatsby":"^1.10.0","command-line-args":"^5.1.1",coveralls:"^3.1.0",crypto:"^1.0.1","current-git-branch":"^1.1.0","dts-bundle":"^0.7.3",eslint:"^7.12.1","eslint-config-airbnb-base":"^14.2.0","eslint-config-prettier":"^6.15.0","eslint-import-resolver-typescript":"^2.3.0","eslint-plugin-import":"^2.22.1","eslint-plugin-prettier":"^3.1.4","eslint-plugin-react-hooks":"^4.2.0","eslint-plugin-comment-length":"1.7.3","eslint-plugin-jsdoc":"^46.9.0","fs-extra":"^10.0.0","gh-pages":"^3.1.0","highlight.js":"^10.6.0","html-to-text":"^8.0.0","identity-obj-proxy":"^3.0.0","istanbul-merge":"^1.1.1",jest:"^26.6.3","jest-fetch-mock":"^3.0.3",jsdom:"^17.0.0","node-sass":"^8.0.0",prettier:"2.1.2",react:"^16.14.0","react-dom":"^16.14.0","react-resizable":"^1.11.0","react-resize-detector":"^6.6.0","react-test-renderer":"^17.0.2","react-use-flexsearch":"^0.1.1",rollup:"4.24.0","rollup-plugin-typescript2":"0.27.3","ts-jest":"^26.5.5","ts-loader":"8.0.4",typedoc:"0.21.6","typedoc-plugin-toc-group":"thoughtspot/typedoc-plugin-toc-group",typescript:"^4.9.4","url-search-params-polyfill":"^8.1.0",util:"^0.12.4",vite:"^5.3.4"};var author="ThoughtSpot";var email="support@thoughtspot.com";var license="ThoughtSpot Development Tools End User License Agreement";var directories={lib:"lib"};var repository={type:"git",url:"git+https://github.com/thoughtspot/visual-embed-sdk.git"};var publishConfig={registry:"https://registry.npmjs.org"};var keywords=["thoughtspot","everywhere","embedded","embed","sdk","analytics"];var bugs={url:"https://github.com/thoughtspot/visual-embed-sdk/issues"};var homepage="https://github.com/thoughtspot/visual-embed-sdk#readme";var globals={window:{}};var pkgInfo = {name:name,version:version$1,description:description,module:module,main:main,types:types,files:files,exports:exports,typesVersions:typesVersions,"size-limit":[{path:"dist/tsembed.es.js",limit:"31 kB"}],scripts:scripts,peerDependencies:peerDependencies,dependencies:dependencies,devDependencies:devDependencies,author:author,email:email,license:license,directories:directories,repository:repository,publishConfig:publishConfig,keywords:keywords,bugs:bugs,homepage:homepage,globals:globals};
|
|
14749
14749
|
|
|
14750
14750
|
/**
|
|
14751
14751
|
* Reloads the ThoughtSpot iframe.
|
|
@@ -14814,35 +14814,34 @@ var UiPassthroughEvent;
|
|
|
14814
14814
|
UiPassthroughEvent["getAvailableUiPassthroughs"] = "getAvailableUiPassthroughs";
|
|
14815
14815
|
UiPassthroughEvent["getAnswerPageConfig"] = "getAnswerPageConfig";
|
|
14816
14816
|
UiPassthroughEvent["getPinboardPageConfig"] = "getPinboardPageConfig";
|
|
14817
|
-
UiPassthroughEvent["UiPassthroughEventNotFound"] = "UiPassthroughEventNotFound";
|
|
14818
14817
|
})(UiPassthroughEvent || (UiPassthroughEvent = {}));
|
|
14819
14818
|
|
|
14820
14819
|
class HostEventClient {
|
|
14821
14820
|
constructor(thoughtSpotHost) {
|
|
14822
|
-
this.executeUiPassthroughApi = async (iFrame, apiName, parameters) => {
|
|
14823
|
-
const res = await processTrigger(iFrame, HostEvent.UiPassthrough, this.thoughtSpotHost, {
|
|
14824
|
-
type: apiName,
|
|
14825
|
-
parameters,
|
|
14826
|
-
});
|
|
14827
|
-
return res;
|
|
14828
|
-
};
|
|
14829
|
-
this.handleUiPassthroughForHostEvent = async (iFrame, apiName, parameters) => {
|
|
14830
|
-
var _a, _b, _c;
|
|
14831
|
-
const response = (_b = (_a = (await this.executeUiPassthroughApi(iFrame, apiName, parameters))) === null || _a === void 0 ? void 0 : _a.filter) === null || _b === void 0 ? void 0 : _b.call(_a, (r) => r.error || r.value)[0];
|
|
14832
|
-
if (!response) {
|
|
14833
|
-
const error = `No answer found${parameters.vizId ? ` for vizId: ${parameters.vizId}` : ''}.`;
|
|
14834
|
-
// eslint-disable-next-line no-throw-literal
|
|
14835
|
-
throw { error };
|
|
14836
|
-
}
|
|
14837
|
-
const errors = response.error || ((_c = response.value) === null || _c === void 0 ? void 0 : _c.errors);
|
|
14838
|
-
if (errors) {
|
|
14839
|
-
// eslint-disable-next-line no-throw-literal
|
|
14840
|
-
throw { error: response.error };
|
|
14841
|
-
}
|
|
14842
|
-
return { ...response.value };
|
|
14843
|
-
};
|
|
14844
14821
|
this.thoughtSpotHost = thoughtSpotHost;
|
|
14845
14822
|
}
|
|
14823
|
+
async executeUiPassthroughApi(iFrame, apiName, parameters) {
|
|
14824
|
+
const res = await processTrigger(iFrame, HostEvent.UiPassthrough, this.thoughtSpotHost, {
|
|
14825
|
+
type: apiName,
|
|
14826
|
+
parameters,
|
|
14827
|
+
});
|
|
14828
|
+
return res;
|
|
14829
|
+
}
|
|
14830
|
+
async handleUiPassthroughForHostEvent(iFrame, apiName, parameters) {
|
|
14831
|
+
var _a, _b, _c;
|
|
14832
|
+
const response = (_b = (_a = (await this.executeUiPassthroughApi(iFrame, apiName, parameters))) === null || _a === void 0 ? void 0 : _a.filter) === null || _b === void 0 ? void 0 : _b.call(_a, (r) => r.error || r.value)[0];
|
|
14833
|
+
if (!response) {
|
|
14834
|
+
const error = `No answer found${parameters.vizId ? ` for vizId: ${parameters.vizId}` : ''}.`;
|
|
14835
|
+
// eslint-disable-next-line no-throw-literal
|
|
14836
|
+
throw { error };
|
|
14837
|
+
}
|
|
14838
|
+
const errors = response.error || ((_c = response.value) === null || _c === void 0 ? void 0 : _c.errors);
|
|
14839
|
+
if (errors) {
|
|
14840
|
+
// eslint-disable-next-line no-throw-literal
|
|
14841
|
+
throw { error: response.error };
|
|
14842
|
+
}
|
|
14843
|
+
return { ...response.value };
|
|
14844
|
+
}
|
|
14846
14845
|
async hostEventFallback(iFrame, hostEvent, data) {
|
|
14847
14846
|
return processTrigger(iFrame, hostEvent, this.thoughtSpotHost, data);
|
|
14848
14847
|
}
|
|
@@ -14973,17 +14972,6 @@ class TsEmbed {
|
|
|
14973
14972
|
this.on(EmbedEvent.AuthExpire, this.updateAuthToken, { start: false }, true);
|
|
14974
14973
|
};
|
|
14975
14974
|
this.showPreRenderByDefault = false;
|
|
14976
|
-
/**
|
|
14977
|
-
* Triggers an event to the embedded app, skipping the UI flow.
|
|
14978
|
-
* @param {UiPassthroughEvent} apiName - The name of the API to be triggered.
|
|
14979
|
-
* @param {UiPassthroughRequest} parameters - The parameters to be passed to the API.
|
|
14980
|
-
* @returns {Promise<UiPassthroughRequest>} - A promise that resolves with the response
|
|
14981
|
-
* from the embedded app.
|
|
14982
|
-
*/
|
|
14983
|
-
// eslint-disable-next-line arrow-body-style
|
|
14984
|
-
this.triggerUiPassThrough = (apiName, parameters) => {
|
|
14985
|
-
return this.hostEventClient.executeUiPassthroughApi(this.iFrame, apiName, parameters);
|
|
14986
|
-
};
|
|
14987
14975
|
this.validatePreRenderViewConfig = (viewConfig) => {
|
|
14988
14976
|
var _a;
|
|
14989
14977
|
const preRenderAllowedKeys = ['preRenderId', 'vizId', 'liveboardId'];
|
|
@@ -15658,6 +15646,17 @@ class TsEmbed {
|
|
|
15658
15646
|
}
|
|
15659
15647
|
return this.hostEventClient.executeHostEvent(this.iFrame, messageType, data);
|
|
15660
15648
|
}
|
|
15649
|
+
/**
|
|
15650
|
+
* Triggers an event to the embedded app, skipping the UI flow.
|
|
15651
|
+
* @param {UiPassthroughEvent} apiName - The name of the API to be triggered.
|
|
15652
|
+
* @param {UiPassthroughRequest} parameters - The parameters to be passed to the API.
|
|
15653
|
+
* @returns {Promise<UiPassthroughRequest>} - A promise that resolves with the response
|
|
15654
|
+
* from the embedded app.
|
|
15655
|
+
*/
|
|
15656
|
+
// eslint-disable-next-line arrow-body-style
|
|
15657
|
+
triggerUiPassThrough(apiName, parameters) {
|
|
15658
|
+
return this.hostEventClient.executeUiPassthroughApi(this.iFrame, apiName, parameters);
|
|
15659
|
+
}
|
|
15661
15660
|
/**
|
|
15662
15661
|
* Marks the ThoughtSpot object to have been rendered
|
|
15663
15662
|
* Needs to be overridden by subclasses to do the actual
|