@thoughtspot/visual-embed-sdk 1.24.0-alpha.6 → 1.24.0-alpha.7
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/app.d.ts +1 -0
- package/cjs/src/embed/app.d.ts.map +1 -1
- package/cjs/src/embed/app.js +1 -0
- package/cjs/src/embed/app.js.map +1 -1
- package/cjs/src/embed/liveboard.d.ts +5 -1
- package/cjs/src/embed/liveboard.d.ts.map +1 -1
- package/cjs/src/embed/liveboard.js +5 -2
- package/cjs/src/embed/liveboard.js.map +1 -1
- package/cjs/src/embed/liveboard.spec.js +23 -7
- package/cjs/src/embed/liveboard.spec.js.map +1 -1
- package/cjs/src/embed/search.d.ts +5 -1
- package/cjs/src/embed/search.d.ts.map +1 -1
- package/cjs/src/embed/search.js +4 -1
- package/cjs/src/embed/search.js.map +1 -1
- package/cjs/src/embed/search.spec.js +15 -0
- package/cjs/src/embed/search.spec.js.map +1 -1
- package/cjs/src/embed/ts-embed.d.ts.map +1 -1
- package/cjs/src/embed/ts-embed.js +5 -2
- package/cjs/src/embed/ts-embed.js.map +1 -1
- package/cjs/src/embed/ts-embed.spec.js +38 -1
- package/cjs/src/embed/ts-embed.spec.js.map +1 -1
- package/cjs/src/types.d.ts +78 -7
- package/cjs/src/types.d.ts.map +1 -1
- package/cjs/src/types.js +60 -5
- package/cjs/src/types.js.map +1 -1
- package/cjs/src/utils.d.ts +7 -1
- package/cjs/src/utils.d.ts.map +1 -1
- package/cjs/src/utils.js +20 -1
- package/cjs/src/utils.js.map +1 -1
- package/cjs/src/utils.spec.js +24 -0
- package/cjs/src/utils.spec.js.map +1 -1
- package/dist/src/embed/app.d.ts +1 -0
- package/dist/src/embed/app.d.ts.map +1 -1
- package/dist/src/embed/liveboard.d.ts +5 -1
- package/dist/src/embed/liveboard.d.ts.map +1 -1
- package/dist/src/embed/search.d.ts +5 -1
- package/dist/src/embed/search.d.ts.map +1 -1
- package/dist/src/embed/ts-embed.d.ts.map +1 -1
- package/dist/src/types.d.ts +78 -7
- package/dist/src/types.d.ts.map +1 -1
- package/dist/src/utils.d.ts +7 -1
- package/dist/src/utils.d.ts.map +1 -1
- package/dist/tsembed-react.es.js +94 -11
- package/dist/tsembed-react.js +94 -11
- package/dist/tsembed.es.js +94 -11
- package/dist/tsembed.js +94 -11
- package/dist/visual-embed-sdk-react-full.d.ts +86 -7
- package/dist/visual-embed-sdk-react.d.ts +86 -7
- package/dist/visual-embed-sdk.d.ts +86 -7
- package/lib/package.json +1 -1
- package/lib/src/embed/app.d.ts +1 -0
- package/lib/src/embed/app.d.ts.map +1 -1
- package/lib/src/embed/app.js +1 -0
- package/lib/src/embed/app.js.map +1 -1
- package/lib/src/embed/liveboard.d.ts +5 -1
- package/lib/src/embed/liveboard.d.ts.map +1 -1
- package/lib/src/embed/liveboard.js +6 -3
- package/lib/src/embed/liveboard.js.map +1 -1
- package/lib/src/embed/liveboard.spec.js +23 -7
- package/lib/src/embed/liveboard.spec.js.map +1 -1
- package/lib/src/embed/search.d.ts +5 -1
- package/lib/src/embed/search.d.ts.map +1 -1
- package/lib/src/embed/search.js +5 -2
- package/lib/src/embed/search.js.map +1 -1
- package/lib/src/embed/search.spec.js +15 -0
- package/lib/src/embed/search.spec.js.map +1 -1
- package/lib/src/embed/ts-embed.d.ts.map +1 -1
- package/lib/src/embed/ts-embed.js +5 -2
- package/lib/src/embed/ts-embed.js.map +1 -1
- package/lib/src/embed/ts-embed.spec.js +38 -1
- package/lib/src/embed/ts-embed.spec.js.map +1 -1
- package/lib/src/types.d.ts +78 -7
- package/lib/src/types.d.ts.map +1 -1
- package/lib/src/types.js +60 -5
- package/lib/src/types.js.map +1 -1
- package/lib/src/utils.d.ts +7 -1
- package/lib/src/utils.d.ts.map +1 -1
- package/lib/src/utils.js +18 -0
- package/lib/src/utils.js.map +1 -1
- package/lib/src/utils.spec.js +25 -1
- package/lib/src/utils.spec.js.map +1 -1
- package/lib/src/visual-embed-sdk.d.ts +88 -9
- package/package.json +1 -1
- package/src/embed/app.ts +1 -0
- package/src/embed/liveboard.spec.ts +29 -10
- package/src/embed/liveboard.ts +11 -2
- package/src/embed/search.spec.ts +18 -0
- package/src/embed/search.ts +16 -1
- package/src/embed/ts-embed.spec.ts +40 -1
- package/src/embed/ts-embed.ts +5 -2
- package/src/types.ts +87 -16
- package/src/utils.spec.ts +31 -0
- package/src/utils.ts +23 -0
package/dist/tsembed-react.es.js
CHANGED
|
@@ -186,6 +186,24 @@ const getFilterQuery = (runtimeFilters) => {
|
|
|
186
186
|
}
|
|
187
187
|
return null;
|
|
188
188
|
};
|
|
189
|
+
/**
|
|
190
|
+
* Construct a runtime parameter override query string from the given option.
|
|
191
|
+
*
|
|
192
|
+
* @param runtimeParameters
|
|
193
|
+
*/
|
|
194
|
+
const getRuntimeParameters = (runtimeParameters) => {
|
|
195
|
+
if (runtimeParameters && runtimeParameters.length) {
|
|
196
|
+
const params = runtimeParameters.map((param, valueIndex) => {
|
|
197
|
+
const index = valueIndex + 1;
|
|
198
|
+
const filterExpr = [];
|
|
199
|
+
filterExpr.push(`param${index}=${encodeURIComponent(param.name)}`);
|
|
200
|
+
filterExpr.push(`paramVal${index}=${encodeURIComponent(param.value)}`);
|
|
201
|
+
return filterExpr.join('&');
|
|
202
|
+
});
|
|
203
|
+
return `${params.join('&')}`;
|
|
204
|
+
}
|
|
205
|
+
return null;
|
|
206
|
+
};
|
|
189
207
|
/**
|
|
190
208
|
* Convert a value to a string representation to be sent as a query
|
|
191
209
|
* parameter to the ThoughtSpot app.
|
|
@@ -1045,21 +1063,21 @@ var EmbedEvent;
|
|
|
1045
1063
|
*/
|
|
1046
1064
|
EmbedEvent["InsertIntoSlide"] = "insertInToSlide";
|
|
1047
1065
|
/**
|
|
1066
|
+
* @hidden
|
|
1048
1067
|
* Emitted when a user changes any filter on a Liveboard.
|
|
1049
|
-
*
|
|
1050
1068
|
* @version SDK: 1.23.0 | ThoughtSpot: 9.4.0.cl
|
|
1051
1069
|
*/
|
|
1052
1070
|
EmbedEvent["FilterChanged"] = "filterChanged";
|
|
1053
1071
|
/**
|
|
1054
1072
|
* Emitted when a user click on Go button in Sage Embed
|
|
1055
1073
|
*
|
|
1056
|
-
* @version SDK : 1.
|
|
1074
|
+
* @version SDK : 1.26.0 | Thoughtspot: 9.7.0.cl
|
|
1057
1075
|
*/
|
|
1058
1076
|
EmbedEvent["SageEmbedQuery"] = "sageEmbedQuery";
|
|
1059
1077
|
/**
|
|
1060
1078
|
* Emitten when a user select data source in Sage Embed
|
|
1061
1079
|
*
|
|
1062
|
-
* @version SDK : 1.
|
|
1080
|
+
* @version SDK : 1.26.0 | Thoughtspot: 9.7.0.cl
|
|
1063
1081
|
*/
|
|
1064
1082
|
EmbedEvent["SageWorksheetUpdated"] = "sageWorksheetUpdated";
|
|
1065
1083
|
/**
|
|
@@ -1068,6 +1086,51 @@ var EmbedEvent;
|
|
|
1068
1086
|
* @version SDK : 1.27.0 | Thoughtspot: 9.8.0.cl
|
|
1069
1087
|
*/
|
|
1070
1088
|
EmbedEvent["UpdateConnection"] = "updateConnection";
|
|
1089
|
+
/**
|
|
1090
|
+
* Emitted when name, status (private or public) or filter values of a
|
|
1091
|
+
* PersonalisedView is updated.
|
|
1092
|
+
*
|
|
1093
|
+
* @returns viewName: string
|
|
1094
|
+
* @returns viewId: string
|
|
1095
|
+
* @returns liveboardId: string
|
|
1096
|
+
* @returns isPublic: boolean
|
|
1097
|
+
* @version SDK : 1.26.0 | Thoughtspot: 9.7.0.cl
|
|
1098
|
+
*/
|
|
1099
|
+
EmbedEvent["UpdatePersonalisedView"] = "updatePersonalisedView";
|
|
1100
|
+
/**
|
|
1101
|
+
* Emitted when a PersonalisedView is saved.
|
|
1102
|
+
*
|
|
1103
|
+
* @returns viewName: string
|
|
1104
|
+
* @returns viewId: string
|
|
1105
|
+
* @returns liveboardId: string
|
|
1106
|
+
* @returns isPublic: boolean
|
|
1107
|
+
* @version SDK : 1.26.0 | Thoughtspot: 9.7.0.cl
|
|
1108
|
+
*/
|
|
1109
|
+
EmbedEvent["SavePersonalisedView"] = "savePersonalisedView";
|
|
1110
|
+
/**
|
|
1111
|
+
* Emitted when a Liveboard is reset.
|
|
1112
|
+
*
|
|
1113
|
+
* @returns viewName: string
|
|
1114
|
+
* @returns viewId: string
|
|
1115
|
+
* @returns liveboardId: string
|
|
1116
|
+
* @returns isPublic: boolean
|
|
1117
|
+
* @version SDK : 1.26.0 | Thoughtspot: 9.7.0.cl
|
|
1118
|
+
*/
|
|
1119
|
+
EmbedEvent["ResetLiveboard"] = "resetLiveboard";
|
|
1120
|
+
/**
|
|
1121
|
+
* Emitted when a PersonalisedView is deleted.
|
|
1122
|
+
*
|
|
1123
|
+
* @returns views: string[]
|
|
1124
|
+
* @returns liveboardId: string
|
|
1125
|
+
* @version SDK : 1.26.0 | Thoughtspot: 9.7.0.cl
|
|
1126
|
+
*/
|
|
1127
|
+
EmbedEvent["DeletePersonalisedView"] = "deletePersonalisedView";
|
|
1128
|
+
/**
|
|
1129
|
+
* Emitten when a user creates a new worksheet
|
|
1130
|
+
*
|
|
1131
|
+
* @version SDK : 1.27.0 | Thoughtspot: 9.8.0.cl
|
|
1132
|
+
*/
|
|
1133
|
+
EmbedEvent["CreateWorksheet"] = "createWorksheet";
|
|
1071
1134
|
})(EmbedEvent || (EmbedEvent = {}));
|
|
1072
1135
|
/**
|
|
1073
1136
|
* Event types that can be triggered by the host application
|
|
@@ -1712,16 +1775,16 @@ var HostEvent;
|
|
|
1712
1775
|
*/
|
|
1713
1776
|
HostEvent["ResetSearch"] = "resetSearch";
|
|
1714
1777
|
/**
|
|
1778
|
+
* @hidden
|
|
1715
1779
|
* Gets the currents visible and runtime filters applied on a Liveboard
|
|
1716
|
-
*
|
|
1717
1780
|
* @example
|
|
1718
1781
|
* liveboardEmbed.trigger(HostEvent.GetFilters)
|
|
1719
1782
|
* @version SDK: 1.23.0 | ThoughtSpot: 9.4.0.cl
|
|
1720
1783
|
*/
|
|
1721
1784
|
HostEvent["GetFilters"] = "getFilters";
|
|
1722
1785
|
/**
|
|
1786
|
+
* @hidden
|
|
1723
1787
|
* Updates the visible filters on the Liveboard.
|
|
1724
|
-
*
|
|
1725
1788
|
* @param - filter: filter object containing column name and filter operation and values
|
|
1726
1789
|
* @example
|
|
1727
1790
|
*
|
|
@@ -2709,6 +2772,16 @@ var Action;
|
|
|
2709
2772
|
* ```
|
|
2710
2773
|
*/
|
|
2711
2774
|
Action["ManageMonitor"] = "ManageMonitor";
|
|
2775
|
+
/**
|
|
2776
|
+
* Action ID for Liveboard Personalised Views dropdown
|
|
2777
|
+
*
|
|
2778
|
+
* @example
|
|
2779
|
+
* ```js
|
|
2780
|
+
* disabledActions: [Action.PersonalisedViewsDropdown]
|
|
2781
|
+
* ```
|
|
2782
|
+
* @version SDK : 1.26.0 | Thoughtspot: 9.7.0.cl
|
|
2783
|
+
*/
|
|
2784
|
+
Action["PersonalisedViewsDropdown"] = "personalisedViewsDropdown";
|
|
2712
2785
|
})(Action || (Action = {}));
|
|
2713
2786
|
// eslint-disable-next-line no-shadow
|
|
2714
2787
|
var OperationType;
|
|
@@ -10323,7 +10396,7 @@ function processTrigger(iFrame, messageType, thoughtSpotHost, data) {
|
|
|
10323
10396
|
});
|
|
10324
10397
|
}
|
|
10325
10398
|
|
|
10326
|
-
var name="@thoughtspot/visual-embed-sdk";var version="1.24.0-alpha.
|
|
10399
|
+
var name="@thoughtspot/visual-embed-sdk";var version="1.24.0-alpha.7";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",start:"gatsby develop","build:gatsby":"npm run clean:gatsby && gatsby build --prefix-paths","build:gatsby:noprefix":"npm run clean:gatsby && gatsby build","serve:gatsby":"gatsby serve","clean:gatsby":"gatsby clean","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","docs-cmd":"node scripts/gatsby-commands.js",docgen:"typedoc --tsconfig tsconfig.json --theme typedoc-theme","test-sdk":"jest -c jest.config.sdk.js --runInBand","test-docs":"jest -c jest.config.docs.js",test:"npm run test-sdk && npm run test-docs",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"};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","eslint-plugin-comment-length":"^0.9.2","eslint-plugin-jsdoc":"^40.1.0",eventemitter3:"^4.0.7","gatsby-plugin-vercel":"^1.0.3","html-react-parser":"^1.4.12",lodash:"^4.17.21","mixpanel-browser":"^2.45.0","ts-deepmerge":"^6.0.2",tslib:"^2.5.3","use-deep-compare-effect":"^1.8.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/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","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","fs-extra":"^10.0.0",gatsby:"3.13.1","gatsby-plugin-algolia":"^0.22.2","gatsby-plugin-catch-links":"^3.1.0","gatsby-plugin-env-variables":"^2.1.0","gatsby-plugin-intl":"^0.3.3","gatsby-plugin-manifest":"^3.2.0","gatsby-plugin-output":"^0.1.3","gatsby-plugin-sass":"6.7.0","gatsby-plugin-sitemap":"^4.10.0","gatsby-source-filesystem":"3.1.0","gatsby-transformer-asciidoc":"2.1.0","gatsby-transformer-rehype":"2.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-puppeteer":"^4.4.0",jsdom:"^17.0.0","node-sass":"^8.0.0",prettier:"2.1.2",puppeteer:"^7.0.1",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:"2.30.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"};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","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,description:description,module:module,main:main,types:types,files:files,exports:exports,typesVersions:typesVersions,"size-limit":[{path:"dist/tsembed.js",limit:"40 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};
|
|
10327
10400
|
|
|
10328
10401
|
/**
|
|
10329
10402
|
* Copyright (c) 2022
|
|
@@ -10382,11 +10455,14 @@ class TsEmbed {
|
|
|
10382
10455
|
data: {
|
|
10383
10456
|
customisations: getCustomisations(this.embedConfig, this.viewConfig),
|
|
10384
10457
|
authToken,
|
|
10385
|
-
runtimeFilterParams:
|
|
10458
|
+
runtimeFilterParams: this.viewConfig.excludeRuntimeFiltersfromURL
|
|
10459
|
+
? getRuntimeFilters(this.viewConfig.runtimeFilters)
|
|
10460
|
+
: null,
|
|
10386
10461
|
hiddenHomepageModules: this.viewConfig.hiddenHomepageModules || [],
|
|
10387
10462
|
hostConfig: this.embedConfig.hostConfig,
|
|
10388
10463
|
hiddenHomeLeftNavItems: ((_a = this.viewConfig) === null || _a === void 0 ? void 0 : _a.hiddenHomeLeftNavItems)
|
|
10389
|
-
? (_b = this.viewConfig) === null || _b === void 0 ? void 0 : _b.hiddenHomeLeftNavItems
|
|
10464
|
+
? (_b = this.viewConfig) === null || _b === void 0 ? void 0 : _b.hiddenHomeLeftNavItems
|
|
10465
|
+
: [],
|
|
10390
10466
|
},
|
|
10391
10467
|
});
|
|
10392
10468
|
};
|
|
@@ -11267,7 +11343,7 @@ class SearchEmbed extends TsEmbed {
|
|
|
11267
11343
|
}
|
|
11268
11344
|
getEmbedParams() {
|
|
11269
11345
|
var _a;
|
|
11270
|
-
const { hideResults, enableSearchAssist, forceTable, searchOptions, runtimeFilters, dataSource, dataSources, excludeRuntimeFiltersfromURL, dataPanelV2 = false, useLastSelectedSources = false, } = this.viewConfig;
|
|
11346
|
+
const { hideResults, enableSearchAssist, forceTable, searchOptions, runtimeFilters, dataSource, dataSources, excludeRuntimeFiltersfromURL, dataPanelV2 = false, useLastSelectedSources = false, runtimeParameters, } = this.viewConfig;
|
|
11271
11347
|
const queryParams = this.getBaseQueryParams();
|
|
11272
11348
|
queryParams[Param.HideActions] = [
|
|
11273
11349
|
...((_a = queryParams[Param.HideActions]) !== null && _a !== void 0 ? _a : []),
|
|
@@ -11306,6 +11382,9 @@ class SearchEmbed extends TsEmbed {
|
|
|
11306
11382
|
if (queryParamsString) {
|
|
11307
11383
|
query = `?${queryParamsString}`;
|
|
11308
11384
|
}
|
|
11385
|
+
const parameterQuery = getRuntimeParameters(runtimeParameters || []);
|
|
11386
|
+
if (parameterQuery)
|
|
11387
|
+
query += `&${parameterQuery}`;
|
|
11309
11388
|
const filterQuery = getFilterQuery(runtimeFilters || []);
|
|
11310
11389
|
if (filterQuery && !excludeRuntimeFiltersfromURL) {
|
|
11311
11390
|
query += `&${filterQuery}`;
|
|
@@ -11473,6 +11552,7 @@ class AppEmbed extends V1Embed {
|
|
|
11473
11552
|
* Gets the ThoughtSpot route of the page for a particular page ID.
|
|
11474
11553
|
*
|
|
11475
11554
|
* @param pageId The identifier for a page in the ThoughtSpot app.
|
|
11555
|
+
* @param modularHomeExperience
|
|
11476
11556
|
*/
|
|
11477
11557
|
getPageRoute(pageId, modularHomeExperience = false) {
|
|
11478
11558
|
switch (pageId) {
|
|
@@ -11616,7 +11696,7 @@ class LiveboardEmbed extends V1Embed {
|
|
|
11616
11696
|
let params = {};
|
|
11617
11697
|
params[Param.EmbedApp] = true;
|
|
11618
11698
|
params = this.getBaseQueryParams(params);
|
|
11619
|
-
const { enableVizTransformations, fullHeight, defaultHeight, visibleVizs, liveboardV2, vizId, hideTabPanel, activeTabId, } = this.viewConfig;
|
|
11699
|
+
const { enableVizTransformations, fullHeight, defaultHeight, visibleVizs, liveboardV2, vizId, hideTabPanel, activeTabId, runtimeParameters, } = this.viewConfig;
|
|
11620
11700
|
const preventLiveboardFilterRemoval = this.viewConfig.preventLiveboardFilterRemoval
|
|
11621
11701
|
|| this.viewConfig.preventPinboardFilterRemoval;
|
|
11622
11702
|
if (fullHeight === true) {
|
|
@@ -11644,7 +11724,10 @@ class LiveboardEmbed extends V1Embed {
|
|
|
11644
11724
|
if (hideTabPanel) {
|
|
11645
11725
|
params[Param.HideTabPanel] = hideTabPanel;
|
|
11646
11726
|
}
|
|
11647
|
-
|
|
11727
|
+
let queryParams = getQueryParamString(params, true);
|
|
11728
|
+
const parameterQuery = getRuntimeParameters(runtimeParameters || []);
|
|
11729
|
+
if (parameterQuery)
|
|
11730
|
+
queryParams += `&${parameterQuery}`;
|
|
11648
11731
|
return queryParams;
|
|
11649
11732
|
}
|
|
11650
11733
|
getIframeSuffixSrc(liveboardId, vizId, activeTabId) {
|
package/dist/tsembed-react.js
CHANGED
|
@@ -194,6 +194,24 @@
|
|
|
194
194
|
}
|
|
195
195
|
return null;
|
|
196
196
|
};
|
|
197
|
+
/**
|
|
198
|
+
* Construct a runtime parameter override query string from the given option.
|
|
199
|
+
*
|
|
200
|
+
* @param runtimeParameters
|
|
201
|
+
*/
|
|
202
|
+
const getRuntimeParameters = (runtimeParameters) => {
|
|
203
|
+
if (runtimeParameters && runtimeParameters.length) {
|
|
204
|
+
const params = runtimeParameters.map((param, valueIndex) => {
|
|
205
|
+
const index = valueIndex + 1;
|
|
206
|
+
const filterExpr = [];
|
|
207
|
+
filterExpr.push(`param${index}=${encodeURIComponent(param.name)}`);
|
|
208
|
+
filterExpr.push(`paramVal${index}=${encodeURIComponent(param.value)}`);
|
|
209
|
+
return filterExpr.join('&');
|
|
210
|
+
});
|
|
211
|
+
return `${params.join('&')}`;
|
|
212
|
+
}
|
|
213
|
+
return null;
|
|
214
|
+
};
|
|
197
215
|
/**
|
|
198
216
|
* Convert a value to a string representation to be sent as a query
|
|
199
217
|
* parameter to the ThoughtSpot app.
|
|
@@ -1020,21 +1038,21 @@
|
|
|
1020
1038
|
*/
|
|
1021
1039
|
EmbedEvent["InsertIntoSlide"] = "insertInToSlide";
|
|
1022
1040
|
/**
|
|
1041
|
+
* @hidden
|
|
1023
1042
|
* Emitted when a user changes any filter on a Liveboard.
|
|
1024
|
-
*
|
|
1025
1043
|
* @version SDK: 1.23.0 | ThoughtSpot: 9.4.0.cl
|
|
1026
1044
|
*/
|
|
1027
1045
|
EmbedEvent["FilterChanged"] = "filterChanged";
|
|
1028
1046
|
/**
|
|
1029
1047
|
* Emitted when a user click on Go button in Sage Embed
|
|
1030
1048
|
*
|
|
1031
|
-
* @version SDK : 1.
|
|
1049
|
+
* @version SDK : 1.26.0 | Thoughtspot: 9.7.0.cl
|
|
1032
1050
|
*/
|
|
1033
1051
|
EmbedEvent["SageEmbedQuery"] = "sageEmbedQuery";
|
|
1034
1052
|
/**
|
|
1035
1053
|
* Emitten when a user select data source in Sage Embed
|
|
1036
1054
|
*
|
|
1037
|
-
* @version SDK : 1.
|
|
1055
|
+
* @version SDK : 1.26.0 | Thoughtspot: 9.7.0.cl
|
|
1038
1056
|
*/
|
|
1039
1057
|
EmbedEvent["SageWorksheetUpdated"] = "sageWorksheetUpdated";
|
|
1040
1058
|
/**
|
|
@@ -1043,6 +1061,51 @@
|
|
|
1043
1061
|
* @version SDK : 1.27.0 | Thoughtspot: 9.8.0.cl
|
|
1044
1062
|
*/
|
|
1045
1063
|
EmbedEvent["UpdateConnection"] = "updateConnection";
|
|
1064
|
+
/**
|
|
1065
|
+
* Emitted when name, status (private or public) or filter values of a
|
|
1066
|
+
* PersonalisedView is updated.
|
|
1067
|
+
*
|
|
1068
|
+
* @returns viewName: string
|
|
1069
|
+
* @returns viewId: string
|
|
1070
|
+
* @returns liveboardId: string
|
|
1071
|
+
* @returns isPublic: boolean
|
|
1072
|
+
* @version SDK : 1.26.0 | Thoughtspot: 9.7.0.cl
|
|
1073
|
+
*/
|
|
1074
|
+
EmbedEvent["UpdatePersonalisedView"] = "updatePersonalisedView";
|
|
1075
|
+
/**
|
|
1076
|
+
* Emitted when a PersonalisedView is saved.
|
|
1077
|
+
*
|
|
1078
|
+
* @returns viewName: string
|
|
1079
|
+
* @returns viewId: string
|
|
1080
|
+
* @returns liveboardId: string
|
|
1081
|
+
* @returns isPublic: boolean
|
|
1082
|
+
* @version SDK : 1.26.0 | Thoughtspot: 9.7.0.cl
|
|
1083
|
+
*/
|
|
1084
|
+
EmbedEvent["SavePersonalisedView"] = "savePersonalisedView";
|
|
1085
|
+
/**
|
|
1086
|
+
* Emitted when a Liveboard is reset.
|
|
1087
|
+
*
|
|
1088
|
+
* @returns viewName: string
|
|
1089
|
+
* @returns viewId: string
|
|
1090
|
+
* @returns liveboardId: string
|
|
1091
|
+
* @returns isPublic: boolean
|
|
1092
|
+
* @version SDK : 1.26.0 | Thoughtspot: 9.7.0.cl
|
|
1093
|
+
*/
|
|
1094
|
+
EmbedEvent["ResetLiveboard"] = "resetLiveboard";
|
|
1095
|
+
/**
|
|
1096
|
+
* Emitted when a PersonalisedView is deleted.
|
|
1097
|
+
*
|
|
1098
|
+
* @returns views: string[]
|
|
1099
|
+
* @returns liveboardId: string
|
|
1100
|
+
* @version SDK : 1.26.0 | Thoughtspot: 9.7.0.cl
|
|
1101
|
+
*/
|
|
1102
|
+
EmbedEvent["DeletePersonalisedView"] = "deletePersonalisedView";
|
|
1103
|
+
/**
|
|
1104
|
+
* Emitten when a user creates a new worksheet
|
|
1105
|
+
*
|
|
1106
|
+
* @version SDK : 1.27.0 | Thoughtspot: 9.8.0.cl
|
|
1107
|
+
*/
|
|
1108
|
+
EmbedEvent["CreateWorksheet"] = "createWorksheet";
|
|
1046
1109
|
})(exports.EmbedEvent || (exports.EmbedEvent = {}));
|
|
1047
1110
|
(function (HostEvent) {
|
|
1048
1111
|
/**
|
|
@@ -1663,16 +1726,16 @@
|
|
|
1663
1726
|
*/
|
|
1664
1727
|
HostEvent["ResetSearch"] = "resetSearch";
|
|
1665
1728
|
/**
|
|
1729
|
+
* @hidden
|
|
1666
1730
|
* Gets the currents visible and runtime filters applied on a Liveboard
|
|
1667
|
-
*
|
|
1668
1731
|
* @example
|
|
1669
1732
|
* liveboardEmbed.trigger(HostEvent.GetFilters)
|
|
1670
1733
|
* @version SDK: 1.23.0 | ThoughtSpot: 9.4.0.cl
|
|
1671
1734
|
*/
|
|
1672
1735
|
HostEvent["GetFilters"] = "getFilters";
|
|
1673
1736
|
/**
|
|
1737
|
+
* @hidden
|
|
1674
1738
|
* Updates the visible filters on the Liveboard.
|
|
1675
|
-
*
|
|
1676
1739
|
* @param - filter: filter object containing column name and filter operation and values
|
|
1677
1740
|
* @example
|
|
1678
1741
|
*
|
|
@@ -2631,6 +2694,16 @@
|
|
|
2631
2694
|
* ```
|
|
2632
2695
|
*/
|
|
2633
2696
|
Action["ManageMonitor"] = "ManageMonitor";
|
|
2697
|
+
/**
|
|
2698
|
+
* Action ID for Liveboard Personalised Views dropdown
|
|
2699
|
+
*
|
|
2700
|
+
* @example
|
|
2701
|
+
* ```js
|
|
2702
|
+
* disabledActions: [Action.PersonalisedViewsDropdown]
|
|
2703
|
+
* ```
|
|
2704
|
+
* @version SDK : 1.26.0 | Thoughtspot: 9.7.0.cl
|
|
2705
|
+
*/
|
|
2706
|
+
Action["PersonalisedViewsDropdown"] = "personalisedViewsDropdown";
|
|
2634
2707
|
})(exports.Action || (exports.Action = {}));
|
|
2635
2708
|
// eslint-disable-next-line no-shadow
|
|
2636
2709
|
var OperationType;
|
|
@@ -10245,7 +10318,7 @@
|
|
|
10245
10318
|
});
|
|
10246
10319
|
}
|
|
10247
10320
|
|
|
10248
|
-
var name="@thoughtspot/visual-embed-sdk";var version="1.24.0-alpha.
|
|
10321
|
+
var name="@thoughtspot/visual-embed-sdk";var version="1.24.0-alpha.7";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",start:"gatsby develop","build:gatsby":"npm run clean:gatsby && gatsby build --prefix-paths","build:gatsby:noprefix":"npm run clean:gatsby && gatsby build","serve:gatsby":"gatsby serve","clean:gatsby":"gatsby clean","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","docs-cmd":"node scripts/gatsby-commands.js",docgen:"typedoc --tsconfig tsconfig.json --theme typedoc-theme","test-sdk":"jest -c jest.config.sdk.js --runInBand","test-docs":"jest -c jest.config.docs.js",test:"npm run test-sdk && npm run test-docs",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"};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","eslint-plugin-comment-length":"^0.9.2","eslint-plugin-jsdoc":"^40.1.0",eventemitter3:"^4.0.7","gatsby-plugin-vercel":"^1.0.3","html-react-parser":"^1.4.12",lodash:"^4.17.21","mixpanel-browser":"^2.45.0","ts-deepmerge":"^6.0.2",tslib:"^2.5.3","use-deep-compare-effect":"^1.8.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/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","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","fs-extra":"^10.0.0",gatsby:"3.13.1","gatsby-plugin-algolia":"^0.22.2","gatsby-plugin-catch-links":"^3.1.0","gatsby-plugin-env-variables":"^2.1.0","gatsby-plugin-intl":"^0.3.3","gatsby-plugin-manifest":"^3.2.0","gatsby-plugin-output":"^0.1.3","gatsby-plugin-sass":"6.7.0","gatsby-plugin-sitemap":"^4.10.0","gatsby-source-filesystem":"3.1.0","gatsby-transformer-asciidoc":"2.1.0","gatsby-transformer-rehype":"2.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-puppeteer":"^4.4.0",jsdom:"^17.0.0","node-sass":"^8.0.0",prettier:"2.1.2",puppeteer:"^7.0.1",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:"2.30.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"};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","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,description:description,module:module,main:main,types:types,files:files,exports:exports$1,typesVersions:typesVersions,"size-limit":[{path:"dist/tsembed.js",limit:"40 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};
|
|
10249
10322
|
|
|
10250
10323
|
/**
|
|
10251
10324
|
* Copyright (c) 2022
|
|
@@ -10304,11 +10377,14 @@
|
|
|
10304
10377
|
data: {
|
|
10305
10378
|
customisations: getCustomisations(this.embedConfig, this.viewConfig),
|
|
10306
10379
|
authToken,
|
|
10307
|
-
runtimeFilterParams:
|
|
10380
|
+
runtimeFilterParams: this.viewConfig.excludeRuntimeFiltersfromURL
|
|
10381
|
+
? getRuntimeFilters(this.viewConfig.runtimeFilters)
|
|
10382
|
+
: null,
|
|
10308
10383
|
hiddenHomepageModules: this.viewConfig.hiddenHomepageModules || [],
|
|
10309
10384
|
hostConfig: this.embedConfig.hostConfig,
|
|
10310
10385
|
hiddenHomeLeftNavItems: ((_a = this.viewConfig) === null || _a === void 0 ? void 0 : _a.hiddenHomeLeftNavItems)
|
|
10311
|
-
? (_b = this.viewConfig) === null || _b === void 0 ? void 0 : _b.hiddenHomeLeftNavItems
|
|
10386
|
+
? (_b = this.viewConfig) === null || _b === void 0 ? void 0 : _b.hiddenHomeLeftNavItems
|
|
10387
|
+
: [],
|
|
10312
10388
|
},
|
|
10313
10389
|
});
|
|
10314
10390
|
};
|
|
@@ -11189,7 +11265,7 @@
|
|
|
11189
11265
|
}
|
|
11190
11266
|
getEmbedParams() {
|
|
11191
11267
|
var _a;
|
|
11192
|
-
const { hideResults, enableSearchAssist, forceTable, searchOptions, runtimeFilters, dataSource, dataSources, excludeRuntimeFiltersfromURL, dataPanelV2 = false, useLastSelectedSources = false, } = this.viewConfig;
|
|
11268
|
+
const { hideResults, enableSearchAssist, forceTable, searchOptions, runtimeFilters, dataSource, dataSources, excludeRuntimeFiltersfromURL, dataPanelV2 = false, useLastSelectedSources = false, runtimeParameters, } = this.viewConfig;
|
|
11193
11269
|
const queryParams = this.getBaseQueryParams();
|
|
11194
11270
|
queryParams[Param.HideActions] = [
|
|
11195
11271
|
...((_a = queryParams[Param.HideActions]) !== null && _a !== void 0 ? _a : []),
|
|
@@ -11228,6 +11304,9 @@
|
|
|
11228
11304
|
if (queryParamsString) {
|
|
11229
11305
|
query = `?${queryParamsString}`;
|
|
11230
11306
|
}
|
|
11307
|
+
const parameterQuery = getRuntimeParameters(runtimeParameters || []);
|
|
11308
|
+
if (parameterQuery)
|
|
11309
|
+
query += `&${parameterQuery}`;
|
|
11231
11310
|
const filterQuery = getFilterQuery(runtimeFilters || []);
|
|
11232
11311
|
if (filterQuery && !excludeRuntimeFiltersfromURL) {
|
|
11233
11312
|
query += `&${filterQuery}`;
|
|
@@ -11390,6 +11469,7 @@
|
|
|
11390
11469
|
* Gets the ThoughtSpot route of the page for a particular page ID.
|
|
11391
11470
|
*
|
|
11392
11471
|
* @param pageId The identifier for a page in the ThoughtSpot app.
|
|
11472
|
+
* @param modularHomeExperience
|
|
11393
11473
|
*/
|
|
11394
11474
|
getPageRoute(pageId, modularHomeExperience = false) {
|
|
11395
11475
|
switch (pageId) {
|
|
@@ -11533,7 +11613,7 @@
|
|
|
11533
11613
|
let params = {};
|
|
11534
11614
|
params[Param.EmbedApp] = true;
|
|
11535
11615
|
params = this.getBaseQueryParams(params);
|
|
11536
|
-
const { enableVizTransformations, fullHeight, defaultHeight, visibleVizs, liveboardV2, vizId, hideTabPanel, activeTabId, } = this.viewConfig;
|
|
11616
|
+
const { enableVizTransformations, fullHeight, defaultHeight, visibleVizs, liveboardV2, vizId, hideTabPanel, activeTabId, runtimeParameters, } = this.viewConfig;
|
|
11537
11617
|
const preventLiveboardFilterRemoval = this.viewConfig.preventLiveboardFilterRemoval
|
|
11538
11618
|
|| this.viewConfig.preventPinboardFilterRemoval;
|
|
11539
11619
|
if (fullHeight === true) {
|
|
@@ -11561,7 +11641,10 @@
|
|
|
11561
11641
|
if (hideTabPanel) {
|
|
11562
11642
|
params[Param.HideTabPanel] = hideTabPanel;
|
|
11563
11643
|
}
|
|
11564
|
-
|
|
11644
|
+
let queryParams = getQueryParamString(params, true);
|
|
11645
|
+
const parameterQuery = getRuntimeParameters(runtimeParameters || []);
|
|
11646
|
+
if (parameterQuery)
|
|
11647
|
+
queryParams += `&${parameterQuery}`;
|
|
11565
11648
|
return queryParams;
|
|
11566
11649
|
}
|
|
11567
11650
|
getIframeSuffixSrc(liveboardId, vizId, activeTabId) {
|