@thoughtspot/visual-embed-sdk 1.41.0 → 1.42.0
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/README.md +2 -4
- package/cjs/package.json +8 -8
- package/cjs/src/authToken.d.ts +1 -0
- package/cjs/src/authToken.d.ts.map +1 -1
- package/cjs/src/authToken.js +13 -3
- package/cjs/src/authToken.js.map +1 -1
- package/cjs/src/authToken.spec.js +29 -0
- package/cjs/src/authToken.spec.js.map +1 -1
- package/cjs/src/css-variables.d.ts +54 -15
- package/cjs/src/css-variables.d.ts.map +1 -1
- package/cjs/src/embed/app.d.ts +16 -0
- package/cjs/src/embed/app.d.ts.map +1 -1
- package/cjs/src/embed/app.js +4 -1
- package/cjs/src/embed/app.js.map +1 -1
- package/cjs/src/embed/app.spec.js +10 -0
- package/cjs/src/embed/app.spec.js.map +1 -1
- package/cjs/src/embed/bodyless-conversation.d.ts +1 -0
- package/cjs/src/embed/bodyless-conversation.d.ts.map +1 -1
- package/cjs/src/embed/bodyless-conversation.js +7 -3
- package/cjs/src/embed/bodyless-conversation.js.map +1 -1
- package/cjs/src/embed/conversation.d.ts +3 -2
- package/cjs/src/embed/conversation.d.ts.map +1 -1
- package/cjs/src/embed/conversation.js +7 -2
- package/cjs/src/embed/conversation.js.map +1 -1
- package/cjs/src/embed/liveboard.d.ts +33 -0
- package/cjs/src/embed/liveboard.d.ts.map +1 -1
- package/cjs/src/embed/liveboard.js +13 -2
- package/cjs/src/embed/liveboard.js.map +1 -1
- package/cjs/src/embed/liveboard.spec.js +98 -11
- package/cjs/src/embed/liveboard.spec.js.map +1 -1
- package/cjs/src/embed/sage.d.ts +1 -0
- package/cjs/src/embed/sage.d.ts.map +1 -1
- package/cjs/src/embed/sage.js +10 -6
- package/cjs/src/embed/sage.js.map +1 -1
- package/cjs/src/embed/sage.spec.js +20 -10
- package/cjs/src/embed/sage.spec.js.map +1 -1
- package/cjs/src/embed/search-bar.d.ts +1 -0
- package/cjs/src/embed/search-bar.d.ts.map +1 -1
- package/cjs/src/embed/search-bar.js +11 -7
- package/cjs/src/embed/search-bar.js.map +1 -1
- package/cjs/src/embed/search.d.ts +1 -0
- package/cjs/src/embed/search.d.ts.map +1 -1
- package/cjs/src/embed/search.js +7 -8
- package/cjs/src/embed/search.js.map +1 -1
- package/cjs/src/embed/search.spec.js +10 -10
- package/cjs/src/embed/search.spec.js.map +1 -1
- package/cjs/src/embed/ts-embed.d.ts +7 -5
- package/cjs/src/embed/ts-embed.d.ts.map +1 -1
- package/cjs/src/embed/ts-embed.js +26 -9
- package/cjs/src/embed/ts-embed.js.map +1 -1
- package/cjs/src/embed/ts-embed.spec.js.map +1 -1
- package/cjs/src/errors.d.ts +1 -0
- package/cjs/src/errors.d.ts.map +1 -1
- package/cjs/src/errors.js +1 -0
- package/cjs/src/errors.js.map +1 -1
- package/cjs/src/react/all-types-export.spec.js +1 -1
- package/cjs/src/react/all-types-export.spec.js.map +1 -1
- package/cjs/src/react/index.d.ts.map +1 -1
- package/cjs/src/react/index.js +2 -1
- package/cjs/src/react/index.js.map +1 -1
- package/cjs/src/react/index.spec.js +1 -1
- package/cjs/src/react/index.spec.js.map +1 -1
- package/cjs/src/react/util.js.map +1 -1
- package/cjs/src/react/util.spec.d.ts +2 -0
- package/cjs/src/react/util.spec.d.ts.map +1 -0
- package/cjs/src/react/util.spec.js +78 -0
- package/cjs/src/react/util.spec.js.map +1 -0
- package/cjs/src/types.d.ts +64 -9
- package/cjs/src/types.d.ts.map +1 -1
- package/cjs/src/types.js +59 -4
- package/cjs/src/types.js.map +1 -1
- package/cjs/src/utils.d.ts +14 -0
- package/cjs/src/utils.d.ts.map +1 -1
- package/cjs/src/utils.js +22 -1
- package/cjs/src/utils.js.map +1 -1
- package/cjs/src/utils.spec.js +10 -0
- package/cjs/src/utils.spec.js.map +1 -1
- package/dist/{index-B_mxAan8.js → index-BpSohedu.js} +1 -1
- package/dist/src/authToken.d.ts +1 -0
- package/dist/src/authToken.d.ts.map +1 -1
- package/dist/src/css-variables.d.ts +54 -15
- package/dist/src/css-variables.d.ts.map +1 -1
- package/dist/src/embed/app.d.ts +16 -0
- package/dist/src/embed/app.d.ts.map +1 -1
- package/dist/src/embed/bodyless-conversation.d.ts +1 -0
- package/dist/src/embed/bodyless-conversation.d.ts.map +1 -1
- package/dist/src/embed/conversation.d.ts +3 -2
- package/dist/src/embed/conversation.d.ts.map +1 -1
- package/dist/src/embed/liveboard.d.ts +33 -0
- package/dist/src/embed/liveboard.d.ts.map +1 -1
- package/dist/src/embed/sage.d.ts +1 -0
- package/dist/src/embed/sage.d.ts.map +1 -1
- package/dist/src/embed/search-bar.d.ts +1 -0
- package/dist/src/embed/search-bar.d.ts.map +1 -1
- package/dist/src/embed/search.d.ts +1 -0
- package/dist/src/embed/search.d.ts.map +1 -1
- package/dist/src/embed/ts-embed.d.ts +7 -5
- package/dist/src/embed/ts-embed.d.ts.map +1 -1
- package/dist/src/errors.d.ts +1 -0
- package/dist/src/errors.d.ts.map +1 -1
- package/dist/src/react/index.d.ts.map +1 -1
- package/dist/src/react/util.spec.d.ts +2 -0
- package/dist/src/react/util.spec.d.ts.map +1 -0
- package/dist/src/types.d.ts +64 -9
- package/dist/src/types.d.ts.map +1 -1
- package/dist/src/utils.d.ts +14 -0
- package/dist/src/utils.d.ts.map +1 -1
- package/dist/tsembed-react.es.js +180 -47
- package/dist/tsembed-react.js +179 -46
- package/dist/tsembed.es.js +178 -46
- package/dist/tsembed.js +177 -45
- package/dist/visual-embed-sdk-react-full.d.ts +9312 -9842
- package/dist/visual-embed-sdk-react.d.ts +9184 -9848
- package/dist/visual-embed-sdk.d.ts +9351 -9459
- package/lib/package.json +8 -8
- package/lib/src/authToken.d.ts +1 -0
- package/lib/src/authToken.d.ts.map +1 -1
- package/lib/src/authToken.js +11 -2
- package/lib/src/authToken.js.map +1 -1
- package/lib/src/authToken.spec.js +30 -1
- package/lib/src/authToken.spec.js.map +1 -1
- package/lib/src/css-variables.d.ts +54 -15
- package/lib/src/css-variables.d.ts.map +1 -1
- package/lib/src/embed/app.d.ts +16 -0
- package/lib/src/embed/app.d.ts.map +1 -1
- package/lib/src/embed/app.js +4 -1
- package/lib/src/embed/app.js.map +1 -1
- package/lib/src/embed/app.spec.js +10 -0
- package/lib/src/embed/app.spec.js.map +1 -1
- package/lib/src/embed/bodyless-conversation.d.ts +1 -0
- package/lib/src/embed/bodyless-conversation.d.ts.map +1 -1
- package/lib/src/embed/bodyless-conversation.js +7 -3
- package/lib/src/embed/bodyless-conversation.js.map +1 -1
- package/lib/src/embed/conversation.d.ts +3 -2
- package/lib/src/embed/conversation.d.ts.map +1 -1
- package/lib/src/embed/conversation.js +7 -2
- package/lib/src/embed/conversation.js.map +1 -1
- package/lib/src/embed/liveboard.d.ts +33 -0
- package/lib/src/embed/liveboard.d.ts.map +1 -1
- package/lib/src/embed/liveboard.js +13 -2
- package/lib/src/embed/liveboard.js.map +1 -1
- package/lib/src/embed/liveboard.spec.js +98 -11
- package/lib/src/embed/liveboard.spec.js.map +1 -1
- package/lib/src/embed/sage.d.ts +1 -0
- package/lib/src/embed/sage.d.ts.map +1 -1
- package/lib/src/embed/sage.js +10 -6
- package/lib/src/embed/sage.js.map +1 -1
- package/lib/src/embed/sage.spec.js +20 -10
- package/lib/src/embed/sage.spec.js.map +1 -1
- package/lib/src/embed/search-bar.d.ts +1 -0
- package/lib/src/embed/search-bar.d.ts.map +1 -1
- package/lib/src/embed/search-bar.js +11 -7
- package/lib/src/embed/search-bar.js.map +1 -1
- package/lib/src/embed/search.d.ts +1 -0
- package/lib/src/embed/search.d.ts.map +1 -1
- package/lib/src/embed/search.js +7 -8
- package/lib/src/embed/search.js.map +1 -1
- package/lib/src/embed/search.spec.js +11 -11
- package/lib/src/embed/search.spec.js.map +1 -1
- package/lib/src/embed/ts-embed.d.ts +7 -5
- package/lib/src/embed/ts-embed.d.ts.map +1 -1
- package/lib/src/embed/ts-embed.js +26 -9
- package/lib/src/embed/ts-embed.js.map +1 -1
- package/lib/src/embed/ts-embed.spec.js.map +1 -1
- package/lib/src/errors.d.ts +1 -0
- package/lib/src/errors.d.ts.map +1 -1
- package/lib/src/errors.js +1 -0
- package/lib/src/errors.js.map +1 -1
- package/lib/src/react/all-types-export.spec.js +1 -1
- package/lib/src/react/all-types-export.spec.js.map +1 -1
- package/lib/src/react/index.d.ts.map +1 -1
- package/lib/src/react/index.js +2 -1
- package/lib/src/react/index.js.map +1 -1
- package/lib/src/react/index.spec.js +1 -1
- package/lib/src/react/index.spec.js.map +1 -1
- package/lib/src/react/util.js.map +1 -1
- package/lib/src/react/util.spec.d.ts +2 -0
- package/lib/src/react/util.spec.d.ts.map +1 -0
- package/lib/src/react/util.spec.js +76 -0
- package/lib/src/react/util.spec.js.map +1 -0
- package/lib/src/types.d.ts +64 -9
- package/lib/src/types.d.ts.map +1 -1
- package/lib/src/types.js +59 -4
- package/lib/src/types.js.map +1 -1
- package/lib/src/utils.d.ts +14 -0
- package/lib/src/utils.d.ts.map +1 -1
- package/lib/src/utils.js +20 -0
- package/lib/src/utils.js.map +1 -1
- package/lib/src/utils.spec.js +11 -1
- package/lib/src/utils.spec.js.map +1 -1
- package/package.json +8 -8
- package/src/authToken.spec.ts +48 -1
- package/src/authToken.ts +13 -2
- package/src/css-variables.ts +55 -17
- package/src/embed/app.spec.ts +14 -0
- package/src/embed/app.ts +23 -1
- package/src/embed/bodyless-conversation.ts +8 -3
- package/src/embed/conversation.ts +19 -4
- package/src/embed/liveboard.spec.ts +126 -14
- package/src/embed/liveboard.ts +72 -24
- package/src/embed/sage.spec.ts +24 -10
- package/src/embed/sage.ts +14 -9
- package/src/embed/search-bar.tsx +14 -7
- package/src/embed/search.spec.ts +13 -14
- package/src/embed/search.ts +19 -8
- package/src/embed/ts-embed.spec.ts +1 -1
- package/src/embed/ts-embed.ts +35 -13
- package/src/errors.ts +1 -0
- package/src/react/all-types-export.spec.ts +1 -1
- package/src/react/index.spec.tsx +1 -1
- package/src/react/index.tsx +4 -2
- package/src/react/util.spec.tsx +88 -0
- package/src/react/util.ts +3 -3
- package/src/types.ts +125 -69
- package/src/utils.spec.ts +18 -0
- package/src/utils.ts +21 -0
- package/lib/src/visual-embed-sdk.d.ts +0 -9705
package/dist/tsembed.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
/* @thoughtspot/visual-embed-sdk version 1.
|
|
1
|
+
/* @thoughtspot/visual-embed-sdk version 1.42.0 */
|
|
2
2
|
'use client';
|
|
3
3
|
(function (global, factory) {
|
|
4
4
|
typeof exports === 'object' && typeof module !== 'undefined' ? factory(exports) :
|
|
@@ -469,6 +469,26 @@
|
|
|
469
469
|
width: Math.max(0, frameRelativeRight - frameRelativeLeft),
|
|
470
470
|
};
|
|
471
471
|
return data;
|
|
472
|
+
};
|
|
473
|
+
/**
|
|
474
|
+
* Replaces placeholders in a template string with provided values.
|
|
475
|
+
* Placeholders should be in the format {key}.
|
|
476
|
+
* @param template - The template string with placeholders
|
|
477
|
+
* @param values - An object containing key-value pairs to replace placeholders
|
|
478
|
+
* @returns The template string with placeholders replaced
|
|
479
|
+
* @example
|
|
480
|
+
* formatTemplate('Hello {name}, you are {age} years old', { name: 'John', age: 30 })
|
|
481
|
+
* // Returns: 'Hello John, you are 30 years old'
|
|
482
|
+
*
|
|
483
|
+
* formatTemplate('Expected {type}, but received {actual}', { type: 'string', actual: 'number' })
|
|
484
|
+
* // Returns: 'Expected string, but received number'
|
|
485
|
+
*/
|
|
486
|
+
const formatTemplate = (template, values) => {
|
|
487
|
+
// This regex /\{(\w+)\}/g finds all placeholders in the format {word}
|
|
488
|
+
// and captures the word inside the braces for replacement.
|
|
489
|
+
return template.replace(/\{(\w+)\}/g, (match, key) => {
|
|
490
|
+
return values[key] !== undefined ? String(values[key]) : match;
|
|
491
|
+
});
|
|
472
492
|
};
|
|
473
493
|
|
|
474
494
|
/**
|
|
@@ -2750,21 +2770,42 @@
|
|
|
2750
2770
|
*/
|
|
2751
2771
|
HostEvent["Share"] = "share";
|
|
2752
2772
|
/**
|
|
2753
|
-
* Trigger the **Save**
|
|
2773
|
+
* Trigger the **Save** action on a Liveboard, Answer, or Spotter.
|
|
2754
2774
|
* Saves the changes.
|
|
2755
|
-
*
|
|
2775
|
+
*
|
|
2776
|
+
* @param - `vizId` refers to the Spotter Visualization Id used in Spotter embed.
|
|
2777
|
+
* It is required and can be retrieved from the data embed event.
|
|
2778
|
+
*
|
|
2756
2779
|
* @example
|
|
2757
2780
|
* ```js
|
|
2781
|
+
* // Save changes in a Liveboard
|
|
2758
2782
|
* liveboardEmbed.trigger(HostEvent.Save)
|
|
2759
2783
|
* ```
|
|
2784
|
+
*
|
|
2760
2785
|
* ```js
|
|
2786
|
+
* // Save the current Answer in Search embed
|
|
2761
2787
|
* searchEmbed.trigger(HostEvent.Save)
|
|
2762
2788
|
* ```
|
|
2789
|
+
*
|
|
2763
2790
|
* ```js
|
|
2791
|
+
* // Save an Answer in Spotter (requires vizId)
|
|
2764
2792
|
* spotterEmbed.trigger(HostEvent.Save, {
|
|
2765
|
-
*
|
|
2793
|
+
* vizId: "730496d6-6903-4601-937e-2c691821af3c"
|
|
2766
2794
|
* })
|
|
2767
2795
|
* ```
|
|
2796
|
+
*
|
|
2797
|
+
* ```js
|
|
2798
|
+
* // How to get the vizId in Spotter?
|
|
2799
|
+
*
|
|
2800
|
+
* // You can use the Data event dispatched on each answer creation to get the vizId.
|
|
2801
|
+
* let latestSpotterVizId = '';
|
|
2802
|
+
* spotterEmbed.on(EmbedEvent.Data, (payload) => {
|
|
2803
|
+
* latestSpotterVizId = payload.data.id;
|
|
2804
|
+
* });
|
|
2805
|
+
*
|
|
2806
|
+
* spotterEmbed.trigger(HostEvent.Save, { vizId: latestSpotterVizId });
|
|
2807
|
+
* ```
|
|
2808
|
+
*
|
|
2768
2809
|
* @version SDK: 1.19.0 | ThoughtSpot: 9.0.0.cl, 9.0.1.sw
|
|
2769
2810
|
*/
|
|
2770
2811
|
HostEvent["Save"] = "save";
|
|
@@ -2902,7 +2943,7 @@
|
|
|
2902
2943
|
* column: "Date",
|
|
2903
2944
|
* oper: 'EQ',
|
|
2904
2945
|
* values: ["2023-07-31"],
|
|
2905
|
-
*
|
|
2946
|
+
* type: "EXACT_DATE"
|
|
2906
2947
|
* }]
|
|
2907
2948
|
* });
|
|
2908
2949
|
* ```
|
|
@@ -3248,6 +3289,16 @@
|
|
|
3248
3289
|
* @version SDK: 1.41.0 | ThoughtSpot: 10.12.0.cl
|
|
3249
3290
|
*/
|
|
3250
3291
|
HostEvent["AskSpotter"] = "AskSpotter";
|
|
3292
|
+
/**
|
|
3293
|
+
* @hidden
|
|
3294
|
+
* Triggers the update of the embed params.
|
|
3295
|
+
*
|
|
3296
|
+
* @example
|
|
3297
|
+
* ```js
|
|
3298
|
+
* liveboardEmbed.trigger(HostEvent.UpdateEmbedParams, viewConfig);
|
|
3299
|
+
* ```
|
|
3300
|
+
*/
|
|
3301
|
+
HostEvent["UpdateEmbedParams"] = "updateEmbedParams";
|
|
3251
3302
|
})(exports.HostEvent || (exports.HostEvent = {}));
|
|
3252
3303
|
/**
|
|
3253
3304
|
* The different visual modes that the data sources panel within
|
|
@@ -3394,6 +3445,7 @@
|
|
|
3394
3445
|
Param["IsLazyLoadingForEmbedEnabled"] = "isLazyLoadingForEmbedEnabled";
|
|
3395
3446
|
Param["RootMarginForLazyLoad"] = "rootMarginForLazyLoad";
|
|
3396
3447
|
Param["LiveboardXLSXCSVDownload"] = "isLiveboardXLSXCSVDownloadEnabled";
|
|
3448
|
+
Param["isPNGInScheduledEmailsEnabled"] = "isPNGInScheduledEmailsEnabled";
|
|
3397
3449
|
})(Param || (Param = {}));
|
|
3398
3450
|
/**
|
|
3399
3451
|
* ThoughtSpot application pages include actions and menu commands
|
|
@@ -4675,6 +4727,29 @@
|
|
|
4675
4727
|
* @version SDK: 1.41.0 | ThoughtSpot Cloud: 10.13.0.cl
|
|
4676
4728
|
*/
|
|
4677
4729
|
Action["SpotterTokenQuickEdit"] = "SpotterTokenQuickEdit";
|
|
4730
|
+
/**
|
|
4731
|
+
* The **PNG screenshot in email** option in the schedule email dialog.
|
|
4732
|
+
* Includes a PNG screenshot in the notification email body.
|
|
4733
|
+
* @example
|
|
4734
|
+
* ```js
|
|
4735
|
+
* disabledActions: [Action.PngScreenshotInEmail]
|
|
4736
|
+
* ```
|
|
4737
|
+
* ```
|
|
4738
|
+
* @version SDK: 1.42.0 | ThoughtSpot Cloud: 10.14.0.cl
|
|
4739
|
+
*/
|
|
4740
|
+
Action["PngScreenshotInEmail"] = "pngScreenshotInEmail";
|
|
4741
|
+
/**
|
|
4742
|
+
* The **Remove attachment** action in the schedule email dialog.
|
|
4743
|
+
* Removes an attachment from the email configuration.
|
|
4744
|
+
* @example
|
|
4745
|
+
* ```js
|
|
4746
|
+
* disabledActions: [Action.RemoveAttachment]
|
|
4747
|
+
* ```
|
|
4748
|
+
* ```
|
|
4749
|
+
* ```
|
|
4750
|
+
* @version SDK: 1.42.0 | ThoughtSpot Cloud: 10.14.0.cl
|
|
4751
|
+
*/
|
|
4752
|
+
Action["RemoveAttachment"] = "removeAttachment";
|
|
4678
4753
|
})(exports.Action || (exports.Action = {}));
|
|
4679
4754
|
exports.PrefetchFeatures = void 0;
|
|
4680
4755
|
(function (PrefetchFeatures) {
|
|
@@ -7154,6 +7229,7 @@
|
|
|
7154
7229
|
SDK_NOT_INITIALIZED: 'SDK not initialized',
|
|
7155
7230
|
SESSION_INFO_FAILED: 'Failed to get session information',
|
|
7156
7231
|
INVALID_TOKEN_ERROR: 'Received invalid token from getAuthToken callback or authToken endpoint.',
|
|
7232
|
+
INVALID_TOKEN_TYPE_ERROR: 'Expected getAuthToken to return a string, but received a {invalidType}.',
|
|
7157
7233
|
MIXPANEL_TOKEN_NOT_FOUND: 'Mixpanel token not found in session info',
|
|
7158
7234
|
PRERENDER_ID_MISSING: 'PreRender ID is required for preRender',
|
|
7159
7235
|
SYNC_STYLE_CALLED_BEFORE_RENDER: 'PreRender should be called before using syncPreRenderStyle',
|
|
@@ -7334,6 +7410,15 @@
|
|
|
7334
7410
|
return authToken;
|
|
7335
7411
|
}
|
|
7336
7412
|
const validateAuthToken = async (embedConfig, authToken, suppressAlert) => {
|
|
7413
|
+
// even if token verification is disabled, we will still validate
|
|
7414
|
+
// that the token is a string before proceeding.
|
|
7415
|
+
if (typeof authToken !== 'string') {
|
|
7416
|
+
const errorMessage = formatTemplate(ERROR_MESSAGE.INVALID_TOKEN_TYPE_ERROR, {
|
|
7417
|
+
invalidType: typeof authToken,
|
|
7418
|
+
});
|
|
7419
|
+
logger$3.error(errorMessage);
|
|
7420
|
+
throw new Error(errorMessage);
|
|
7421
|
+
}
|
|
7337
7422
|
const cachedAuthToken = getCacheAuthToken();
|
|
7338
7423
|
if (embedConfig.disableTokenVerification) {
|
|
7339
7424
|
logger$3.info('Token verification is disabled. Assuming token is valid.');
|
|
@@ -17401,7 +17486,7 @@ mutation GetUnsavedAnswerTML($session: BachSessionIdInput!, $exportDependencies:
|
|
|
17401
17486
|
return e;
|
|
17402
17487
|
}
|
|
17403
17488
|
|
|
17404
|
-
var name="@thoughtspot/visual-embed-sdk";var version$1="1.
|
|
17489
|
+
var name="@thoughtspot/visual-embed-sdk";var version$1="1.42.0";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 tsconfig.build.json --incremental false; tsc -p tsconfig.build.json --incremental false --module commonjs --outDir cjs","build-and-publish":"npm run build:gatsby && npm run publish","bundle-dts-file":"dts-bundle-generator --config ./dts-config/dts-bundle-file.config.js","bundle-dts":"dts-bundle-generator --config ./dts-config/dts-bundle.config.js","bundle-dts-react":"dts-bundle-generator --config ./dts-config/dts-bundle-react.config.js","bundle-dts-react-full":"dts-bundle-generator --config ./dts-config/dts-bundle-react-full.config.js",build:"rollup -c",watch:"rollup -cw",docgen:"typedoc --tsconfig tsconfig.build.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 | npx coveralls-next","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={classnames:"^2.3.1",eventemitter3:"^4.0.7",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":"^11.2.0","@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":"^8.28.0","@typescript-eslint/parser":"^8.28.0",ajv:"^8.17.1",asciidoctor:"^2.2.1","babel-jest":"^26.6.3","babel-preset-gatsby":"^1.10.0","command-line-args":"^5.1.1","coveralls-next":"^5.0.0",crypto:"^1.0.1","current-git-branch":"^1.1.0","dts-bundle-generator":"^9.5.1",eslint:"^9.23.0","eslint-config-airbnb-base":"^15.0.0","eslint-config-prettier":"^10.1.1","eslint-import-resolver-typescript":"^4.2.5","eslint-plugin-comment-length":"2.2.1","eslint-plugin-import":"^2.31.0","eslint-plugin-jsdoc":"^50.6.9","eslint-plugin-prettier":"^5.2.5","eslint-plugin-react":"^7.37.5","eslint-plugin-react-hooks":"^5.2.0","fs-extra":"^10.0.0","gh-pages":"6.3.0",globals:"^16.0.0","highlight.js":"^10.6.0","html-to-text":"^8.0.0","identity-obj-proxy":"^3.0.0","istanbul-merge":"^2.0.0",jest:"^26.6.3","jest-fetch-mock":"^3.0.3",jsdom:"^17.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","typescript-eslint":"^8.29.1","url-search-params-polyfill":"^8.1.0",util:"^0.12.4",vite:"^6.3.5"};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:"32 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};
|
|
17405
17490
|
|
|
17406
17491
|
/**
|
|
17407
17492
|
* Reloads the ThoughtSpot iframe.
|
|
@@ -17712,10 +17797,10 @@ mutation GetUnsavedAnswerTML($session: BachSessionIdInput!, $exportDependencies:
|
|
|
17712
17797
|
};
|
|
17713
17798
|
this.showPreRenderByDefault = false;
|
|
17714
17799
|
/**
|
|
17715
|
-
|
|
17716
|
-
|
|
17717
|
-
|
|
17718
|
-
|
|
17800
|
+
* @hidden
|
|
17801
|
+
* Internal state to track if the embed container is loaded.
|
|
17802
|
+
* This is used to trigger events after the embed container is loaded.
|
|
17803
|
+
*/
|
|
17719
17804
|
this.isEmbedContainerLoaded = false;
|
|
17720
17805
|
/**
|
|
17721
17806
|
* @hidden
|
|
@@ -17774,10 +17859,10 @@ mutation GetUnsavedAnswerTML($session: BachSessionIdInput!, $exportDependencies:
|
|
|
17774
17859
|
uploadMixpanelEvent(MIXPANEL_EVENT.VISUAL_SDK_EMBED_CREATE, {
|
|
17775
17860
|
...viewConfig,
|
|
17776
17861
|
});
|
|
17862
|
+
const embedConfig = getEmbedConfig();
|
|
17863
|
+
this.embedConfig = embedConfig;
|
|
17777
17864
|
this.hostEventClient = new HostEventClient(this.iFrame);
|
|
17778
17865
|
this.isReadyForRenderPromise = getInitPromise().then(async () => {
|
|
17779
|
-
const embedConfig = getEmbedConfig();
|
|
17780
|
-
this.embedConfig = embedConfig;
|
|
17781
17866
|
if (!embedConfig.authTriggerContainer && !embedConfig.useEventForSAMLPopup) {
|
|
17782
17867
|
this.embedConfig.authTriggerContainer = domSelector;
|
|
17783
17868
|
}
|
|
@@ -17973,6 +18058,11 @@ mutation GetUnsavedAnswerTML($session: BachSessionIdInput!, $exportDependencies:
|
|
|
17973
18058
|
.join('/');
|
|
17974
18059
|
return `${basePath}#`;
|
|
17975
18060
|
}
|
|
18061
|
+
getUpdateEmbedParamsObject() {
|
|
18062
|
+
let queryParams = this.getEmbedParamsObject();
|
|
18063
|
+
queryParams = { ...this.viewConfig, ...queryParams };
|
|
18064
|
+
return queryParams;
|
|
18065
|
+
}
|
|
17976
18066
|
/**
|
|
17977
18067
|
* Common query params set for all the embed modes.
|
|
17978
18068
|
* @param queryParams
|
|
@@ -18122,9 +18212,13 @@ mutation GetUnsavedAnswerTML($session: BachSessionIdInput!, $exportDependencies:
|
|
|
18122
18212
|
return path;
|
|
18123
18213
|
}
|
|
18124
18214
|
getEmbedParams() {
|
|
18125
|
-
const queryParams = this.
|
|
18215
|
+
const queryParams = this.getEmbedParamsObject();
|
|
18126
18216
|
return getQueryParamString(queryParams);
|
|
18127
18217
|
}
|
|
18218
|
+
getEmbedParamsObject() {
|
|
18219
|
+
const params = this.getBaseQueryParams();
|
|
18220
|
+
return params;
|
|
18221
|
+
}
|
|
18128
18222
|
getRootIframeSrc() {
|
|
18129
18223
|
const query = this.getEmbedParams();
|
|
18130
18224
|
return this.getEmbedBasePath(query);
|
|
@@ -18595,13 +18689,17 @@ mutation GetUnsavedAnswerTML($session: BachSessionIdInput!, $exportDependencies:
|
|
|
18595
18689
|
* Creates the preRender shell
|
|
18596
18690
|
* @param showPreRenderByDefault - Show the preRender after render, hidden by default
|
|
18597
18691
|
*/
|
|
18598
|
-
async preRender(showPreRenderByDefault = false) {
|
|
18692
|
+
async preRender(showPreRenderByDefault = false, replaceExistingPreRender = false) {
|
|
18599
18693
|
if (!this.viewConfig.preRenderId) {
|
|
18600
18694
|
logger$3.error(ERROR_MESSAGE.PRERENDER_ID_MISSING);
|
|
18601
18695
|
return this;
|
|
18602
18696
|
}
|
|
18603
18697
|
this.isPreRendered = true;
|
|
18604
18698
|
this.showPreRenderByDefault = showPreRenderByDefault;
|
|
18699
|
+
const isAlreadyRendered = this.connectPreRendered();
|
|
18700
|
+
if (isAlreadyRendered && !replaceExistingPreRender) {
|
|
18701
|
+
return this;
|
|
18702
|
+
}
|
|
18605
18703
|
return this.handleRenderForPrerender();
|
|
18606
18704
|
}
|
|
18607
18705
|
/**
|
|
@@ -18685,7 +18783,12 @@ mutation GetUnsavedAnswerTML($session: BachSessionIdInput!, $exportDependencies:
|
|
|
18685
18783
|
return this.preRender(true);
|
|
18686
18784
|
}
|
|
18687
18785
|
this.validatePreRenderViewConfig(this.viewConfig);
|
|
18786
|
+
logger$3.debug('triggering UpdateEmbedParams', this.viewConfig);
|
|
18787
|
+
this.executeAfterEmbedContainerLoaded(() => {
|
|
18788
|
+
this.trigger(exports.HostEvent.UpdateEmbedParams, this.getUpdateEmbedParamsObject());
|
|
18789
|
+
});
|
|
18688
18790
|
}
|
|
18791
|
+
this.beforePrerenderVisible();
|
|
18689
18792
|
if (this.el) {
|
|
18690
18793
|
this.syncPreRenderStyle();
|
|
18691
18794
|
if (!this.viewConfig.doNotTrackPreRenderSize) {
|
|
@@ -18702,7 +18805,6 @@ mutation GetUnsavedAnswerTML($session: BachSessionIdInput!, $exportDependencies:
|
|
|
18702
18805
|
this.resizeObserver.observe(this.el);
|
|
18703
18806
|
}
|
|
18704
18807
|
}
|
|
18705
|
-
this.beforePrerenderVisible();
|
|
18706
18808
|
removeStyleProperties(this.preRenderWrapper, ['z-index', 'opacity', 'pointer-events']);
|
|
18707
18809
|
this.subscribeToEvents();
|
|
18708
18810
|
// Setup fullscreen change handler for prerendered components
|
|
@@ -19068,7 +19170,7 @@ mutation GetUnsavedAnswerTML($session: BachSessionIdInput!, $exportDependencies:
|
|
|
19068
19170
|
* embedded Liveboard or visualization.
|
|
19069
19171
|
*/
|
|
19070
19172
|
getEmbedParams() {
|
|
19071
|
-
const { tag, hideObjects, liveboardV2, showPrimaryNavbar, disableProfileAndHelp, hideHamburger, hideObjectSearch, hideNotification, hideApplicationSwitcher, hideOrgSwitcher, enableSearchAssist, fullHeight, dataPanelV2 =
|
|
19173
|
+
const { tag, hideObjects, liveboardV2, showPrimaryNavbar, disableProfileAndHelp, hideHamburger, hideObjectSearch, hideNotification, hideApplicationSwitcher, hideOrgSwitcher, enableSearchAssist, fullHeight, dataPanelV2 = true, hideLiveboardHeader = false, showLiveboardTitle = true, showLiveboardDescription = true, hideHomepageLeftNav = false, modularHomeExperience = false, isLiveboardHeaderSticky = true, enableAskSage, collapseSearchBarInitially = false, enable2ColumnLayout, enableCustomColumnGroups = false, isOnBeforeGetVizDataInterceptEnabled = false, dataPanelCustomGroupsAccordionInitialState = exports.DataPanelCustomColumnGroupsAccordionState.EXPAND_ALL, collapseSearchBar = true, isLiveboardCompactHeaderEnabled = false, showLiveboardVerifiedBadge = true, showLiveboardReverifyBanner = true, hideIrrelevantChipsInLiveboardTabs = false, homePageSearchBarMode, isUnifiedSearchExperienceEnabled = true, enablePendoHelp = true, discoveryExperience, coverAndFilterOptionInPDF = false, liveboardXLSXCSVDownload = false, isLiveboardStylingAndGroupingEnabled, isPNGInScheduledEmailsEnabled = false, } = this.viewConfig;
|
|
19072
19174
|
let params = {};
|
|
19073
19175
|
params[Param.PrimaryNavHidden] = !showPrimaryNavbar;
|
|
19074
19176
|
params[Param.HideProfleAndHelp] = !!disableProfileAndHelp;
|
|
@@ -19133,6 +19235,9 @@ mutation GetUnsavedAnswerTML($session: BachSessionIdInput!, $exportDependencies:
|
|
|
19133
19235
|
if (isLiveboardStylingAndGroupingEnabled !== undefined) {
|
|
19134
19236
|
params[Param.IsLiveboardStylingAndGroupingEnabled] = isLiveboardStylingAndGroupingEnabled;
|
|
19135
19237
|
}
|
|
19238
|
+
if (isPNGInScheduledEmailsEnabled !== undefined) {
|
|
19239
|
+
params[Param.isPNGInScheduledEmailsEnabled] = isPNGInScheduledEmailsEnabled;
|
|
19240
|
+
}
|
|
19136
19241
|
params[Param.DataPanelV2Enabled] = dataPanelV2;
|
|
19137
19242
|
params[Param.HideHomepageLeftNav] = hideHomepageLeftNav;
|
|
19138
19243
|
params[Param.ModularHomeExperienceEnabled] = modularHomeExperience;
|
|
@@ -19480,9 +19585,14 @@ query GetEurekaVizSnapshots(
|
|
|
19480
19585
|
* embedded Liveboard or visualization.
|
|
19481
19586
|
*/
|
|
19482
19587
|
getEmbedParams() {
|
|
19588
|
+
const params = this.getEmbedParamsObject();
|
|
19589
|
+
const queryParams = getQueryParamString(params, true);
|
|
19590
|
+
return queryParams;
|
|
19591
|
+
}
|
|
19592
|
+
getEmbedParamsObject() {
|
|
19483
19593
|
let params = {};
|
|
19484
19594
|
params = this.getBaseQueryParams(params);
|
|
19485
|
-
const { enableVizTransformations, fullHeight, defaultHeight, visibleVizs, liveboardV2, vizId, hideTabPanel, activeTabId, hideLiveboardHeader, showLiveboardDescription, showLiveboardTitle, isLiveboardHeaderSticky = true, isLiveboardCompactHeaderEnabled = false, showLiveboardVerifiedBadge = true, showLiveboardReverifyBanner = true, hideIrrelevantChipsInLiveboardTabs = false, enableAskSage, enable2ColumnLayout, dataPanelV2 =
|
|
19595
|
+
const { enableVizTransformations, fullHeight, defaultHeight, visibleVizs, liveboardV2, vizId, hideTabPanel, activeTabId, hideLiveboardHeader, showLiveboardDescription, showLiveboardTitle, isLiveboardHeaderSticky = true, isLiveboardCompactHeaderEnabled = false, showLiveboardVerifiedBadge = true, showLiveboardReverifyBanner = true, hideIrrelevantChipsInLiveboardTabs = false, enableAskSage, enable2ColumnLayout, dataPanelV2 = true, enableCustomColumnGroups = false, oAuthPollingInterval, isForceRedirect, dataSourceId, coverAndFilterOptionInPDF = false, liveboardXLSXCSVDownload = false, isLiveboardStylingAndGroupingEnabled, isPNGInScheduledEmailsEnabled = false, showSpotterLimitations, } = this.viewConfig;
|
|
19486
19596
|
const preventLiveboardFilterRemoval = this.viewConfig.preventLiveboardFilterRemoval
|
|
19487
19597
|
|| this.viewConfig.preventPinboardFilterRemoval;
|
|
19488
19598
|
if (fullHeight === true) {
|
|
@@ -19541,6 +19651,12 @@ query GetEurekaVizSnapshots(
|
|
|
19541
19651
|
if (isLiveboardStylingAndGroupingEnabled !== undefined) {
|
|
19542
19652
|
params[Param.IsLiveboardStylingAndGroupingEnabled] = isLiveboardStylingAndGroupingEnabled;
|
|
19543
19653
|
}
|
|
19654
|
+
if (isPNGInScheduledEmailsEnabled !== undefined) {
|
|
19655
|
+
params[Param.isPNGInScheduledEmailsEnabled] = isPNGInScheduledEmailsEnabled;
|
|
19656
|
+
}
|
|
19657
|
+
if (showSpotterLimitations !== undefined) {
|
|
19658
|
+
params[Param.ShowSpotterLimitations] = showSpotterLimitations;
|
|
19659
|
+
}
|
|
19544
19660
|
params[Param.LiveboardHeaderSticky] = isLiveboardHeaderSticky;
|
|
19545
19661
|
params[Param.LiveboardHeaderV2] = isLiveboardCompactHeaderEnabled;
|
|
19546
19662
|
params[Param.ShowLiveboardVerifiedBadge] = showLiveboardVerifiedBadge;
|
|
@@ -19550,8 +19666,8 @@ query GetEurekaVizSnapshots(
|
|
|
19550
19666
|
params[Param.EnableCustomColumnGroups] = enableCustomColumnGroups;
|
|
19551
19667
|
params[Param.CoverAndFilterOptionInPDF] = coverAndFilterOptionInPDF;
|
|
19552
19668
|
params[Param.LiveboardXLSXCSVDownload] = !!liveboardXLSXCSVDownload;
|
|
19553
|
-
|
|
19554
|
-
return
|
|
19669
|
+
getQueryParamString(params, true);
|
|
19670
|
+
return params;
|
|
19555
19671
|
}
|
|
19556
19672
|
getIframeSuffixSrc(liveboardId, vizId, activeTabId) {
|
|
19557
19673
|
let suffix = `/embed/viz/${liveboardId}`;
|
|
@@ -19793,11 +19909,9 @@ query GetEurekaVizSnapshots(
|
|
|
19793
19909
|
const defaultAppInitData = await super.getAppInitData();
|
|
19794
19910
|
return { ...defaultAppInitData, ...this.getSearchInitData() };
|
|
19795
19911
|
}
|
|
19796
|
-
|
|
19912
|
+
getEmbedParamsObject() {
|
|
19797
19913
|
var _a;
|
|
19798
|
-
const { hideResults, enableSearchAssist, forceTable, searchOptions, runtimeFilters, dataSource, dataSources, excludeRuntimeFiltersfromURL, hideSearchBar, dataPanelV2 =
|
|
19799
|
-
/* eslint-disable-next-line max-len */
|
|
19800
|
-
dataPanelCustomGroupsAccordionInitialState = DataPanelCustomColumnGroupsAccordionState.EXPAND_ALL, focusSearchBarOnRender = true, excludeRuntimeParametersfromURL, excludeSearchTokenStringFromURL, collapseSearchBar = true, } = this.viewConfig;
|
|
19914
|
+
const { hideResults, enableSearchAssist, forceTable, searchOptions, runtimeFilters, dataSource, dataSources, excludeRuntimeFiltersfromURL, hideSearchBar, dataPanelV2 = true, useLastSelectedSources = false, runtimeParameters, collapseSearchBarInitially = false, enableCustomColumnGroups = false, isOnBeforeGetVizDataInterceptEnabled = false, dataPanelCustomGroupsAccordionInitialState = DataPanelCustomColumnGroupsAccordionState.EXPAND_ALL, focusSearchBarOnRender = true, excludeRuntimeParametersfromURL, excludeSearchTokenStringFromURL, collapseSearchBar = true, } = this.viewConfig;
|
|
19801
19915
|
const queryParams = this.getBaseQueryParams();
|
|
19802
19916
|
queryParams[Param.HideActions] = [
|
|
19803
19917
|
...((_a = queryParams[Param.HideActions]) !== null && _a !== void 0 ? _a : []),
|
|
@@ -19830,7 +19944,6 @@ query GetEurekaVizSnapshots(
|
|
|
19830
19944
|
queryParams[Param.HideSearchBar] = true;
|
|
19831
19945
|
}
|
|
19832
19946
|
if (isOnBeforeGetVizDataInterceptEnabled) {
|
|
19833
|
-
/* eslint-disable-next-line max-len */
|
|
19834
19947
|
queryParams[Param.IsOnBeforeGetVizDataInterceptEnabled] = isOnBeforeGetVizDataInterceptEnabled;
|
|
19835
19948
|
}
|
|
19836
19949
|
if (!focusSearchBarOnRender) {
|
|
@@ -19843,20 +19956,22 @@ query GetEurekaVizSnapshots(
|
|
|
19843
19956
|
queryParams[Param.UseLastSelectedDataSource] = false;
|
|
19844
19957
|
}
|
|
19845
19958
|
queryParams[Param.searchEmbed] = true;
|
|
19846
|
-
/* eslint-disable-next-line max-len */
|
|
19847
19959
|
queryParams[Param.CollapseSearchBarInitially] = collapseSearchBarInitially || collapseSearchBar;
|
|
19848
19960
|
queryParams[Param.EnableCustomColumnGroups] = enableCustomColumnGroups;
|
|
19849
19961
|
if (dataPanelCustomGroupsAccordionInitialState
|
|
19850
19962
|
=== DataPanelCustomColumnGroupsAccordionState.COLLAPSE_ALL
|
|
19851
19963
|
|| dataPanelCustomGroupsAccordionInitialState
|
|
19852
19964
|
=== DataPanelCustomColumnGroupsAccordionState.EXPAND_FIRST) {
|
|
19853
|
-
/* eslint-disable-next-line max-len */
|
|
19854
19965
|
queryParams[Param.DataPanelCustomGroupsAccordionInitialState] = dataPanelCustomGroupsAccordionInitialState;
|
|
19855
19966
|
}
|
|
19856
19967
|
else {
|
|
19857
|
-
/* eslint-disable-next-line max-len */
|
|
19858
19968
|
queryParams[Param.DataPanelCustomGroupsAccordionInitialState] = DataPanelCustomColumnGroupsAccordionState.EXPAND_ALL;
|
|
19859
19969
|
}
|
|
19970
|
+
return queryParams;
|
|
19971
|
+
}
|
|
19972
|
+
getEmbedParams() {
|
|
19973
|
+
const { runtimeParameters, runtimeFilters, excludeRuntimeParametersfromURL, excludeRuntimeFiltersfromURL, } = this.viewConfig;
|
|
19974
|
+
const queryParams = this.getEmbedParamsObject();
|
|
19860
19975
|
let query = '';
|
|
19861
19976
|
const queryParamsString = getQueryParamString(queryParams, true);
|
|
19862
19977
|
if (queryParamsString) {
|
|
@@ -19912,15 +20027,9 @@ query GetEurekaVizSnapshots(
|
|
|
19912
20027
|
this.embedComponentType = 'SearchBarEmbed';
|
|
19913
20028
|
this.viewConfig = viewConfig;
|
|
19914
20029
|
}
|
|
19915
|
-
|
|
19916
|
-
* Construct the URL of the embedded ThoughtSpot search to be
|
|
19917
|
-
* loaded in the iframe
|
|
19918
|
-
* @param dataSources A list of data source GUIDs
|
|
19919
|
-
*/
|
|
19920
|
-
getIFrameSrc() {
|
|
20030
|
+
getEmbedParamsObject() {
|
|
19921
20031
|
var _a;
|
|
19922
20032
|
const { searchOptions, dataSource, dataSources, useLastSelectedSources = false, excludeSearchTokenStringFromURL, } = this.viewConfig;
|
|
19923
|
-
const path = 'search-bar-embed';
|
|
19924
20033
|
const queryParams = this.getBaseQueryParams();
|
|
19925
20034
|
queryParams[Param.HideActions] = [...((_a = queryParams[Param.HideActions]) !== null && _a !== void 0 ? _a : [])];
|
|
19926
20035
|
if (dataSources && dataSources.length) {
|
|
@@ -19942,6 +20051,16 @@ query GetEurekaVizSnapshots(
|
|
|
19942
20051
|
queryParams[Param.UseLastSelectedDataSource] = false;
|
|
19943
20052
|
}
|
|
19944
20053
|
queryParams[Param.searchEmbed] = true;
|
|
20054
|
+
return queryParams;
|
|
20055
|
+
}
|
|
20056
|
+
/**
|
|
20057
|
+
* Construct the URL of the embedded ThoughtSpot search to be
|
|
20058
|
+
* loaded in the iframe
|
|
20059
|
+
* @param dataSources A list of data source GUIDs
|
|
20060
|
+
*/
|
|
20061
|
+
getIFrameSrc() {
|
|
20062
|
+
const queryParams = this.getEmbedParamsObject();
|
|
20063
|
+
const path = 'search-bar-embed';
|
|
19945
20064
|
let query = '';
|
|
19946
20065
|
const queryParamsString = getQueryParamString(queryParams, true);
|
|
19947
20066
|
if (queryParamsString) {
|
|
@@ -20364,13 +20483,17 @@ query SendMessage($params: Input_convassist_SendMessageRequest) {
|
|
|
20364
20483
|
super(container, viewConfig);
|
|
20365
20484
|
this.viewConfig = viewConfig;
|
|
20366
20485
|
}
|
|
20367
|
-
|
|
20486
|
+
getEmbedParamsObject() {
|
|
20368
20487
|
var _a;
|
|
20369
|
-
const { sessionId, genNo, acSessionId, acGenNo, convId, messageId, } = this.viewConfig;
|
|
20370
|
-
const path = 'conv-assist-answer';
|
|
20371
20488
|
const queryParams = this.getBaseQueryParams();
|
|
20372
20489
|
queryParams[Param.HideActions] = [...((_a = queryParams[Param.HideActions]) !== null && _a !== void 0 ? _a : [])];
|
|
20373
20490
|
queryParams[Param.isSpotterAgentEmbed] = true;
|
|
20491
|
+
return queryParams;
|
|
20492
|
+
}
|
|
20493
|
+
getIframeSrc() {
|
|
20494
|
+
const { sessionId, genNo, acSessionId, acGenNo, convId, messageId, } = this.viewConfig;
|
|
20495
|
+
const path = 'conv-assist-answer';
|
|
20496
|
+
const queryParams = this.getEmbedParamsObject();
|
|
20374
20497
|
let query = '';
|
|
20375
20498
|
const queryParamsString = getQueryParamString(queryParams, true);
|
|
20376
20499
|
if (queryParamsString) {
|
|
@@ -20531,9 +20654,8 @@ query SendMessage($params: Input_convassist_SendMessageRequest) {
|
|
|
20531
20654
|
super(container, viewConfig);
|
|
20532
20655
|
this.viewConfig = viewConfig;
|
|
20533
20656
|
}
|
|
20534
|
-
|
|
20657
|
+
getEmbedParamsObject() {
|
|
20535
20658
|
const { worksheetId, searchOptions, disableSourceSelection, hideSourceSelection, dataPanelV2, showSpotterLimitations, hideSampleQuestions, runtimeFilters, excludeRuntimeFiltersfromURL, runtimeParameters, excludeRuntimeParametersfromURL, } = this.viewConfig;
|
|
20536
|
-
const path = 'insights/conv-assist';
|
|
20537
20659
|
if (!worksheetId) {
|
|
20538
20660
|
this.handleError(ERROR_MESSAGE.SPOTTER_EMBED_WORKSHEED_ID_NOT_FOUND);
|
|
20539
20661
|
}
|
|
@@ -20554,6 +20676,12 @@ query SendMessage($params: Input_convassist_SendMessageRequest) {
|
|
|
20554
20676
|
if (!isUndefined_1(hideSampleQuestions)) {
|
|
20555
20677
|
queryParams[Param.HideSampleQuestions] = !!hideSampleQuestions;
|
|
20556
20678
|
}
|
|
20679
|
+
return queryParams;
|
|
20680
|
+
}
|
|
20681
|
+
getIframeSrc() {
|
|
20682
|
+
const { worksheetId, searchOptions, runtimeFilters, excludeRuntimeFiltersfromURL, runtimeParameters, excludeRuntimeParametersfromURL, } = this.viewConfig;
|
|
20683
|
+
const path = 'insights/conv-assist';
|
|
20684
|
+
const queryParams = this.getEmbedParamsObject();
|
|
20557
20685
|
let query = '';
|
|
20558
20686
|
const queryParamsString = getQueryParamString(queryParams, true);
|
|
20559
20687
|
if (queryParamsString) {
|
|
@@ -20625,12 +20753,7 @@ query SendMessage($params: Input_convassist_SendMessageRequest) {
|
|
|
20625
20753
|
viewConfig.embedComponentType = 'SageEmbed';
|
|
20626
20754
|
super(domSelector, viewConfig);
|
|
20627
20755
|
}
|
|
20628
|
-
|
|
20629
|
-
* Constructs a map of parameters to be passed on to the
|
|
20630
|
-
* embedded Eureka or Sage search page.
|
|
20631
|
-
* @returns {string} query string
|
|
20632
|
-
*/
|
|
20633
|
-
getEmbedParams() {
|
|
20756
|
+
getEmbedParamsObject() {
|
|
20634
20757
|
const { disableWorksheetChange, hideWorksheetSelector, showObjectSuggestions, dataPanelV2, hideSampleQuestions, isProductTour, hideSageAnswerHeader, hideAutocompleteSuggestions, } = this.viewConfig;
|
|
20635
20758
|
const params = this.getBaseQueryParams();
|
|
20636
20759
|
params[Param.DataPanelV2Enabled] = !!dataPanelV2;
|
|
@@ -20645,6 +20768,15 @@ query SendMessage($params: Input_convassist_SendMessageRequest) {
|
|
|
20645
20768
|
params[Param.HideSampleQuestions] = !!hideSampleQuestions;
|
|
20646
20769
|
params[Param.IsProductTour] = !!isProductTour;
|
|
20647
20770
|
params[Param.HideSageAnswerHeader] = !!hideSageAnswerHeader;
|
|
20771
|
+
return params;
|
|
20772
|
+
}
|
|
20773
|
+
/**
|
|
20774
|
+
* Constructs a map of parameters to be passed on to the
|
|
20775
|
+
* embedded Eureka or Sage search page.
|
|
20776
|
+
* @returns {string} query string
|
|
20777
|
+
*/
|
|
20778
|
+
getEmbedParams() {
|
|
20779
|
+
const params = this.getEmbedParamsObject();
|
|
20648
20780
|
return getQueryParamString(params, true);
|
|
20649
20781
|
}
|
|
20650
20782
|
/**
|