@thoughtspot/visual-embed-sdk 1.44.0 → 1.44.1-test
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/api-intercept.d.ts.map +1 -1
- package/cjs/src/api-intercept.js +8 -3
- package/cjs/src/api-intercept.js.map +1 -1
- package/cjs/src/api-intercept.spec.js +19 -3
- package/cjs/src/api-intercept.spec.js.map +1 -1
- package/cjs/src/embed/app.d.ts +17 -0
- package/cjs/src/embed/app.d.ts.map +1 -1
- package/cjs/src/embed/app.js +6 -4
- package/cjs/src/embed/app.js.map +1 -1
- package/cjs/src/embed/app.spec.js +84 -1
- package/cjs/src/embed/app.spec.js.map +1 -1
- package/cjs/src/embed/base.d.ts +7 -0
- package/cjs/src/embed/base.d.ts.map +1 -1
- package/cjs/src/embed/base.js +16 -1
- package/cjs/src/embed/base.js.map +1 -1
- package/cjs/src/embed/base.spec.js +21 -0
- package/cjs/src/embed/base.spec.js.map +1 -1
- package/cjs/src/embed/conversation.d.ts.map +1 -1
- package/cjs/src/embed/conversation.js +6 -1
- package/cjs/src/embed/conversation.js.map +1 -1
- package/cjs/src/embed/conversation.spec.js +6 -1
- package/cjs/src/embed/conversation.spec.js.map +1 -1
- package/cjs/src/embed/liveboard.d.ts +18 -0
- package/cjs/src/embed/liveboard.d.ts.map +1 -1
- package/cjs/src/embed/liveboard.js +10 -5
- package/cjs/src/embed/liveboard.js.map +1 -1
- package/cjs/src/embed/liveboard.spec.js +86 -0
- package/cjs/src/embed/liveboard.spec.js.map +1 -1
- package/cjs/src/embed/ts-embed.d.ts +3 -2
- package/cjs/src/embed/ts-embed.d.ts.map +1 -1
- package/cjs/src/embed/ts-embed.js +51 -17
- package/cjs/src/embed/ts-embed.js.map +1 -1
- package/cjs/src/embed/ts-embed.spec.d.ts.map +1 -1
- package/cjs/src/embed/ts-embed.spec.js +93 -5
- package/cjs/src/embed/ts-embed.spec.js.map +1 -1
- package/cjs/src/errors.d.ts +7 -0
- package/cjs/src/errors.d.ts.map +1 -1
- package/cjs/src/errors.js +7 -0
- package/cjs/src/errors.js.map +1 -1
- package/cjs/src/index.d.ts +2 -2
- package/cjs/src/index.d.ts.map +1 -1
- package/cjs/src/index.js +2 -1
- package/cjs/src/index.js.map +1 -1
- package/cjs/src/react/all-types-export.d.ts +1 -1
- package/cjs/src/react/all-types-export.d.ts.map +1 -1
- package/cjs/src/react/all-types-export.js +2 -1
- package/cjs/src/react/all-types-export.js.map +1 -1
- package/cjs/src/types.d.ts +248 -6
- package/cjs/src/types.d.ts.map +1 -1
- package/cjs/src/types.js +134 -2
- package/cjs/src/types.js.map +1 -1
- package/dist/{index-B2QPwxuL.js → index-BXCUJ09L.js} +1 -1
- package/dist/src/api-intercept.d.ts.map +1 -1
- package/dist/src/embed/app.d.ts +17 -0
- package/dist/src/embed/app.d.ts.map +1 -1
- package/dist/src/embed/base.d.ts +7 -0
- package/dist/src/embed/base.d.ts.map +1 -1
- package/dist/src/embed/conversation.d.ts.map +1 -1
- package/dist/src/embed/liveboard.d.ts +18 -0
- package/dist/src/embed/liveboard.d.ts.map +1 -1
- package/dist/src/embed/ts-embed.d.ts +3 -2
- package/dist/src/embed/ts-embed.d.ts.map +1 -1
- package/dist/src/embed/ts-embed.spec.d.ts.map +1 -1
- package/dist/src/errors.d.ts +7 -0
- package/dist/src/errors.d.ts.map +1 -1
- package/dist/src/index.d.ts +2 -2
- package/dist/src/index.d.ts.map +1 -1
- package/dist/src/react/all-types-export.d.ts +1 -1
- package/dist/src/react/all-types-export.d.ts.map +1 -1
- package/dist/src/types.d.ts +248 -6
- package/dist/src/types.d.ts.map +1 -1
- package/dist/tsembed-react.es.js +293 -104
- package/dist/tsembed-react.js +292 -103
- package/dist/tsembed.es.js +307 -105
- package/dist/tsembed.js +306 -103
- package/dist/visual-embed-sdk-react-full.d.ts +245 -7
- package/dist/visual-embed-sdk-react.d.ts +238 -7
- package/dist/visual-embed-sdk.d.ts +245 -7
- package/lib/package.json +1 -1
- package/lib/src/api-intercept.d.ts.map +1 -1
- package/lib/src/api-intercept.js +9 -4
- package/lib/src/api-intercept.js.map +1 -1
- package/lib/src/api-intercept.spec.js +20 -4
- package/lib/src/api-intercept.spec.js.map +1 -1
- package/lib/src/embed/app.d.ts +17 -0
- package/lib/src/embed/app.d.ts.map +1 -1
- package/lib/src/embed/app.js +6 -4
- package/lib/src/embed/app.js.map +1 -1
- package/lib/src/embed/app.spec.js +84 -1
- package/lib/src/embed/app.spec.js.map +1 -1
- package/lib/src/embed/base.d.ts +7 -0
- package/lib/src/embed/base.d.ts.map +1 -1
- package/lib/src/embed/base.js +14 -0
- package/lib/src/embed/base.js.map +1 -1
- package/lib/src/embed/base.spec.js +21 -0
- package/lib/src/embed/base.spec.js.map +1 -1
- 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/conversation.spec.js +7 -2
- package/lib/src/embed/conversation.spec.js.map +1 -1
- package/lib/src/embed/liveboard.d.ts +18 -0
- package/lib/src/embed/liveboard.d.ts.map +1 -1
- package/lib/src/embed/liveboard.js +11 -6
- package/lib/src/embed/liveboard.js.map +1 -1
- package/lib/src/embed/liveboard.spec.js +86 -0
- package/lib/src/embed/liveboard.spec.js.map +1 -1
- package/lib/src/embed/ts-embed.d.ts +3 -2
- package/lib/src/embed/ts-embed.d.ts.map +1 -1
- package/lib/src/embed/ts-embed.js +52 -18
- package/lib/src/embed/ts-embed.js.map +1 -1
- package/lib/src/embed/ts-embed.spec.d.ts.map +1 -1
- package/lib/src/embed/ts-embed.spec.js +94 -6
- package/lib/src/embed/ts-embed.spec.js.map +1 -1
- package/lib/src/errors.d.ts +7 -0
- package/lib/src/errors.d.ts.map +1 -1
- package/lib/src/errors.js +7 -0
- package/lib/src/errors.js.map +1 -1
- package/lib/src/index.d.ts +2 -2
- package/lib/src/index.d.ts.map +1 -1
- package/lib/src/index.js +2 -2
- package/lib/src/index.js.map +1 -1
- package/lib/src/react/all-types-export.d.ts +1 -1
- package/lib/src/react/all-types-export.d.ts.map +1 -1
- package/lib/src/react/all-types-export.js +1 -1
- package/lib/src/react/all-types-export.js.map +1 -1
- package/lib/src/types.d.ts +248 -6
- package/lib/src/types.d.ts.map +1 -1
- package/lib/src/types.js +133 -1
- package/lib/src/types.js.map +1 -1
- package/package.json +1 -1
- package/src/api-intercept.spec.ts +23 -10
- package/src/api-intercept.ts +9 -4
- package/src/embed/app.spec.ts +116 -2
- package/src/embed/app.ts +26 -2
- package/src/embed/base.spec.ts +28 -0
- package/src/embed/base.ts +15 -0
- package/src/embed/conversation.spec.ts +7 -2
- package/src/embed/conversation.ts +7 -2
- package/src/embed/liveboard.spec.ts +107 -0
- package/src/embed/liveboard.ts +32 -4
- package/src/embed/ts-embed.spec.ts +107 -15
- package/src/embed/ts-embed.ts +56 -19
- package/src/errors.ts +7 -0
- package/src/index.ts +2 -0
- package/src/react/all-types-export.ts +1 -0
- package/src/types.ts +259 -6
package/dist/tsembed.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
/* @thoughtspot/visual-embed-sdk version 1.44.
|
|
1
|
+
/* @thoughtspot/visual-embed-sdk version 1.44.1-test */
|
|
2
2
|
'use client';
|
|
3
3
|
(function (global, factory) {
|
|
4
4
|
typeof exports === 'object' && typeof module !== 'undefined' ? factory(exports) :
|
|
@@ -602,6 +602,7 @@
|
|
|
602
602
|
* SearchEmbed.on(EmbedEvent.Error, (error) => {
|
|
603
603
|
* console.log(error);
|
|
604
604
|
* // { type: "Error", data: { errorType: "API", error: { message: '...', error: '...' } } }
|
|
605
|
+
* // { errorType: "API", message: '...', code: '...' } new format
|
|
605
606
|
* });
|
|
606
607
|
* ```
|
|
607
608
|
* @example
|
|
@@ -613,6 +614,7 @@
|
|
|
613
614
|
* // message: "Fullscreen API is not enabled",
|
|
614
615
|
* // stack: "..."
|
|
615
616
|
* // } }}
|
|
617
|
+
* // { errorType: "FULLSCREEN", message: "Fullscreen API is not enabled", code: '...' } new format
|
|
616
618
|
* })
|
|
617
619
|
* ```
|
|
618
620
|
*/
|
|
@@ -768,7 +770,8 @@
|
|
|
768
770
|
*/
|
|
769
771
|
EmbedEvent["ALL"] = "*";
|
|
770
772
|
/**
|
|
771
|
-
* Emitted when an Answer is saved in the app
|
|
773
|
+
* Emitted when an Answer is saved in the app.
|
|
774
|
+
* Use start:true to subscribe to when save is initiated, or end:true to subscribe to when save is completed. Default is end:true.
|
|
772
775
|
* @Version SDK: 1.11.0 | ThoughtSpot: 8.3.0.cl, 8.4.1.sw
|
|
773
776
|
* @example
|
|
774
777
|
*```js
|
|
@@ -803,6 +806,7 @@
|
|
|
803
806
|
EmbedEvent["Download"] = "download";
|
|
804
807
|
/**
|
|
805
808
|
* Emitted when the download action is triggered on an Answer.
|
|
809
|
+
* Use start:true to subscribe to when download is initiated, or end:true to subscribe to when download is completed. Default is end:true.
|
|
806
810
|
* @version SDK: 1.21.0 | ThoughtSpot: 9.2.0.cl, 9.4.0.sw
|
|
807
811
|
* @example
|
|
808
812
|
*```js
|
|
@@ -817,6 +821,7 @@
|
|
|
817
821
|
EmbedEvent["DownloadAsPng"] = "downloadAsPng";
|
|
818
822
|
/**
|
|
819
823
|
* Emitted when the Download as PDF action is triggered on an Answer
|
|
824
|
+
* Use start:true to subscribe to when download as PDF is initiated, or end:true to subscribe to when download as PDF is completed. Default is end:true.
|
|
820
825
|
* @version SDK: 1.11.0 | ThoughtSpot: 8.3.0.cl, 8.4.1.sw
|
|
821
826
|
* @example
|
|
822
827
|
*```js
|
|
@@ -831,6 +836,7 @@
|
|
|
831
836
|
EmbedEvent["DownloadAsPdf"] = "downloadAsPdf";
|
|
832
837
|
/**
|
|
833
838
|
* Emitted when the Download as CSV action is triggered on an Answer.
|
|
839
|
+
* Use start:true to subscribe to when download as CSV is initiated, or end:true to subscribe to when download as CSV is completed. Default is end:true.
|
|
834
840
|
* @version SDK: 1.11.0 | ThoughtSpot: 8.3.0.cl, 8.4.1.sw
|
|
835
841
|
* @example
|
|
836
842
|
*```js
|
|
@@ -845,6 +851,7 @@
|
|
|
845
851
|
EmbedEvent["DownloadAsCsv"] = "downloadAsCsv";
|
|
846
852
|
/**
|
|
847
853
|
* Emitted when the Download as XLSX action is triggered on an Answer.
|
|
854
|
+
* Use start:true to subscribe to when download as XLSX is initiated, or end:true to subscribe to when download as XLSX is completed. Default is end:true.
|
|
848
855
|
* @version SDK: 1.11.0 | ThoughtSpot: 8.3.0.cl, 8.4.1.sw
|
|
849
856
|
* @example
|
|
850
857
|
*```js
|
|
@@ -859,6 +866,7 @@
|
|
|
859
866
|
EmbedEvent["DownloadAsXlsx"] = "downloadAsXlsx";
|
|
860
867
|
/**
|
|
861
868
|
* Emitted when an Answer is deleted in the app
|
|
869
|
+
* Use start:true to subscribe to when delete is initiated, or end:true to subscribe to when delete is completed. Default is end:true.
|
|
862
870
|
* @version SDK: 1.11.0 | ThoughtSpot: 8.3.0.cl, 8.4.1.sw
|
|
863
871
|
* @example
|
|
864
872
|
*```js
|
|
@@ -885,6 +893,7 @@
|
|
|
885
893
|
/**
|
|
886
894
|
* Emitted when a user initiates the Pin action to
|
|
887
895
|
* add an Answer to a Liveboard.
|
|
896
|
+
* Use start:true to subscribe to when pin is initiated, or end:true to subscribe to when pin is completed. Default is end:true.
|
|
888
897
|
* @version SDK: 1.11.0 | ThoughtSpot: 8.3.0.cl, 8.4.1.sw
|
|
889
898
|
* @example
|
|
890
899
|
*```js
|
|
@@ -998,6 +1007,7 @@
|
|
|
998
1007
|
/**
|
|
999
1008
|
* Emitted when the **Export TML** action is triggered on an
|
|
1000
1009
|
* an embedded object in the app
|
|
1010
|
+
* Use start:true to subscribe to when export is initiated, or end:true to subscribe to when export is completed. Default is end:true.
|
|
1001
1011
|
* @version SDK: 1.11.0 | ThoughtSpot: 8.3.0.cl, 8.4.1.sw
|
|
1002
1012
|
* @example
|
|
1003
1013
|
*```js
|
|
@@ -1023,6 +1033,7 @@
|
|
|
1023
1033
|
EmbedEvent["SaveAsView"] = "saveAsView";
|
|
1024
1034
|
/**
|
|
1025
1035
|
* Emitted when the user creates a copy of an Answer.
|
|
1036
|
+
* Use start:true to subscribe to when copy and edit is initiated, or end:true to subscribe to when copy and edit is completed. Default is end:true.
|
|
1026
1037
|
* @version SDK: 1.11.0 | ThoughtSpot: 8.3.0.cl, 8.4.1.sw
|
|
1027
1038
|
* @example
|
|
1028
1039
|
*```js
|
|
@@ -3094,6 +3105,8 @@
|
|
|
3094
3105
|
Param["HideLiveboardHeader"] = "hideLiveboardHeader";
|
|
3095
3106
|
Param["ShowLiveboardDescription"] = "showLiveboardDescription";
|
|
3096
3107
|
Param["ShowLiveboardTitle"] = "showLiveboardTitle";
|
|
3108
|
+
Param["ShowMaskedFilterChip"] = "showMaskedFilterChip";
|
|
3109
|
+
Param["IsLiveboardMasterpiecesEnabled"] = "isLiveboardMasterpiecesEnabled";
|
|
3097
3110
|
Param["HiddenTabs"] = "hideTabs";
|
|
3098
3111
|
Param["VisibleTabs"] = "visibleTabs";
|
|
3099
3112
|
Param["HideTabPanel"] = "hideTabPanel";
|
|
@@ -4465,6 +4478,46 @@
|
|
|
4465
4478
|
* @version SDK: 1.43.0 | ThoughtSpot Cloud: 10.15.0.cl
|
|
4466
4479
|
*/
|
|
4467
4480
|
Action["LiveboardStylePanel"] = "liveboardStylePanel";
|
|
4481
|
+
/**
|
|
4482
|
+
* The **Move to Group** menu action on a Liveboard.
|
|
4483
|
+
* Allows moving a visualization to a different group.
|
|
4484
|
+
* @example
|
|
4485
|
+
* ```js
|
|
4486
|
+
* disabledActions: [Action.MoveToGroup]
|
|
4487
|
+
* ```
|
|
4488
|
+
* @version SDK: 1.44.0 | ThoughtSpot Cloud: 26.2.0.cl
|
|
4489
|
+
*/
|
|
4490
|
+
Action["MoveToGroup"] = "moveToGroup";
|
|
4491
|
+
/**
|
|
4492
|
+
* The **Move out of Group** menu action on a Liveboard.
|
|
4493
|
+
* Allows moving a visualization out of a group.
|
|
4494
|
+
* @example
|
|
4495
|
+
* ```js
|
|
4496
|
+
* disabledActions: [Action.MoveOutOfGroup]
|
|
4497
|
+
* ```
|
|
4498
|
+
* @version SDK: 1.44.0 | ThoughtSpot Cloud: 26.2.0.cl
|
|
4499
|
+
*/
|
|
4500
|
+
Action["MoveOutOfGroup"] = "moveOutOfGroup";
|
|
4501
|
+
/**
|
|
4502
|
+
* The **Create Group** menu action on a Liveboard.
|
|
4503
|
+
* Allows creating a new group.
|
|
4504
|
+
* @example
|
|
4505
|
+
* ```js
|
|
4506
|
+
* disabledActions: [Action.CreateGroup]
|
|
4507
|
+
* ```
|
|
4508
|
+
* @version SDK: 1.44.0 | ThoughtSpot Cloud: 26.2.0.cl
|
|
4509
|
+
*/
|
|
4510
|
+
Action["CreateGroup"] = "createGroup";
|
|
4511
|
+
/**
|
|
4512
|
+
* The **Ungroup Liveboard Group** menu action on a Liveboard.
|
|
4513
|
+
* Allows ungrouping a liveboard group.
|
|
4514
|
+
* @example
|
|
4515
|
+
* ```js
|
|
4516
|
+
* disabledActions: [Action.UngroupLiveboardGroup]
|
|
4517
|
+
* ```
|
|
4518
|
+
* @version SDK: 1.44.0 | ThoughtSpot Cloud: 26.2.0.cl
|
|
4519
|
+
*/
|
|
4520
|
+
Action["UngroupLiveboardGroup"] = "ungroupLiveboardGroup";
|
|
4468
4521
|
})(exports.Action || (exports.Action = {}));
|
|
4469
4522
|
exports.PrefetchFeatures = void 0;
|
|
4470
4523
|
(function (PrefetchFeatures) {
|
|
@@ -4587,6 +4640,85 @@
|
|
|
4587
4640
|
*/
|
|
4588
4641
|
LogLevel["TRACE"] = "TRACE";
|
|
4589
4642
|
})(exports.LogLevel || (exports.LogLevel = {}));
|
|
4643
|
+
/**
|
|
4644
|
+
* Error types emitted by embedded components.
|
|
4645
|
+
*
|
|
4646
|
+
* These enum values categorize different types of errors that can occur during
|
|
4647
|
+
* the lifecycle of an embedded ThoughtSpot component. Use these values to implement
|
|
4648
|
+
* specific error handling logic based on the error category.
|
|
4649
|
+
*
|
|
4650
|
+
* @see {@link EmbedErrorDetailsEvent} - The error event object structure
|
|
4651
|
+
* @see {@link EmbedEvent.Error} - The event that emits these errors
|
|
4652
|
+
* @version SDK: 1.44.2 | ThoughtSpot: 26.2.0.cl
|
|
4653
|
+
* @group Error Handling
|
|
4654
|
+
*/
|
|
4655
|
+
var ErrorDetailsTypes;
|
|
4656
|
+
(function (ErrorDetailsTypes) {
|
|
4657
|
+
/** API call failure */
|
|
4658
|
+
ErrorDetailsTypes["API"] = "API";
|
|
4659
|
+
/** General validation error */
|
|
4660
|
+
ErrorDetailsTypes["VALIDATION_ERROR"] = "VALIDATION_ERROR";
|
|
4661
|
+
/** Network connectivity or request error */
|
|
4662
|
+
ErrorDetailsTypes["NETWORK"] = "NETWORK";
|
|
4663
|
+
})(ErrorDetailsTypes || (ErrorDetailsTypes = {}));
|
|
4664
|
+
/**
|
|
4665
|
+
* Specific error codes for embedded component errors.
|
|
4666
|
+
*
|
|
4667
|
+
* These codes provide granular identification of errors that occur in embedded components.
|
|
4668
|
+
* They are returned in the {@link EmbedErrorDetailsEvent.code} property and allow for
|
|
4669
|
+
* precise error handling and debugging.
|
|
4670
|
+
*
|
|
4671
|
+
* The codes are organized into categories:
|
|
4672
|
+
* - **Worksheet ID not found or does not exist**: Errors related to applying or updating filters
|
|
4673
|
+
* - **Liveboard ID missing**: Errors related to missing liveboard ID
|
|
4674
|
+
* - **Conflicting actions configuration**: Errors related to conflicting actions configuration
|
|
4675
|
+
* - **Conflicting tabs configuration**: Errors related to conflicting tabs configuration
|
|
4676
|
+
* - **Initialization error**: Errors related to initialization error
|
|
4677
|
+
* - **Network error**: Errors related to network error
|
|
4678
|
+
* - **Custom action validation**: Errors related to custom action validation
|
|
4679
|
+
* - **Login failed**: Errors related to login failed
|
|
4680
|
+
* - **Render not called**: Errors related to render not called
|
|
4681
|
+
* - **Host event type undefined or invalid**: Errors related to host event type undefined or invalid
|
|
4682
|
+
*
|
|
4683
|
+
* @version SDK: 1.44.2 | ThoughtSpot: 26.2.0.cl
|
|
4684
|
+
* @group Error Handling
|
|
4685
|
+
* @see {@link EmbedErrorDetailsEvent} - The error event object that includes these codes
|
|
4686
|
+
* @see {@link ErrorDetailsTypes} - General error type categories
|
|
4687
|
+
*
|
|
4688
|
+
* @example
|
|
4689
|
+
* Handle specific error codes
|
|
4690
|
+
*
|
|
4691
|
+
* embed.on(EmbedEvent.Error, (error) => {
|
|
4692
|
+
* if (error.code === EmbedErrorCodes.WORKSHEET_ID_NOT_FOUND) {
|
|
4693
|
+
* console.error('Worksheet ID not found:', error.message);
|
|
4694
|
+
* }
|
|
4695
|
+
* });
|
|
4696
|
+
* */
|
|
4697
|
+
var EmbedErrorCodes;
|
|
4698
|
+
(function (EmbedErrorCodes) {
|
|
4699
|
+
/** Worksheet ID not found or does not exist */
|
|
4700
|
+
EmbedErrorCodes["WORKSHEET_ID_NOT_FOUND"] = "WORKSHEET_ID_NOT_FOUND";
|
|
4701
|
+
/** Required Liveboard ID is missing from configuration */
|
|
4702
|
+
EmbedErrorCodes["LIVEBOARD_ID_MISSING"] = "LIVEBOARD_ID_MISSING";
|
|
4703
|
+
/** Conflicting action configuration detected (e.g., both hiddenActions and visibleActions specified) */
|
|
4704
|
+
EmbedErrorCodes["CONFLICTING_ACTIONS_CONFIG"] = "CONFLICTING_ACTIONS_CONFIG";
|
|
4705
|
+
/** Conflicting tab configuration detected (e.g., both hiddenTabs and visibleTabs specified) */
|
|
4706
|
+
EmbedErrorCodes["CONFLICTING_TABS_CONFIG"] = "CONFLICTING_TABS_CONFIG";
|
|
4707
|
+
/** Error during component initialization */
|
|
4708
|
+
EmbedErrorCodes["INIT_ERROR"] = "INIT_ERROR";
|
|
4709
|
+
/** Network connectivity or request error */
|
|
4710
|
+
EmbedErrorCodes["NETWORK_ERROR"] = "NETWORK_ERROR";
|
|
4711
|
+
/** Custom action validation failed */
|
|
4712
|
+
EmbedErrorCodes["CUSTOM_ACTION_VALIDATION"] = "CUSTOM_ACTION_VALIDATION";
|
|
4713
|
+
/** Authentication/login failed */
|
|
4714
|
+
EmbedErrorCodes["LOGIN_FAILED"] = "LOGIN_FAILED";
|
|
4715
|
+
/** Render method was not called before attempting to use the component */
|
|
4716
|
+
EmbedErrorCodes["RENDER_NOT_CALLED"] = "RENDER_NOT_CALLED";
|
|
4717
|
+
/** Host event type is undefined or invalid */
|
|
4718
|
+
EmbedErrorCodes["HOST_EVENT_TYPE_UNDEFINED"] = "HOST_EVENT_TYPE_UNDEFINED";
|
|
4719
|
+
/** Error parsing api intercept body */
|
|
4720
|
+
EmbedErrorCodes["PARSING_API_INTERCEPT_BODY_ERROR"] = "PARSING_API_INTERCEPT_BODY_ERROR";
|
|
4721
|
+
})(EmbedErrorCodes || (EmbedErrorCodes = {}));
|
|
4590
4722
|
/**
|
|
4591
4723
|
* Enum for the type of API intercepted
|
|
4592
4724
|
*/
|
|
@@ -7453,6 +7585,13 @@
|
|
|
7453
7585
|
RENDER_CALLED_BEFORE_INIT: 'Looks like render was called before calling init, the render won\'t start until init is called.\nFor more info check\n1. https://developers.thoughtspot.com/docs/Function_init#_init\n2.https://developers.thoughtspot.com/docs/getting-started#initSdk',
|
|
7454
7586
|
SPOTTER_AGENT_NOT_INITIALIZED: 'SpotterAgent not initialized',
|
|
7455
7587
|
OFFLINE_WARNING: 'Network not Detected. Embed is offline. Please reconnect and refresh',
|
|
7588
|
+
INIT_SDK_REQUIRED: 'You need to init the ThoughtSpot SDK module first',
|
|
7589
|
+
CONFLICTING_ACTIONS_CONFIG: 'You cannot have both hidden actions and visible actions',
|
|
7590
|
+
CONFLICTING_TABS_CONFIG: 'You cannot have both hidden Tabs and visible Tabs',
|
|
7591
|
+
RENDER_BEFORE_EVENTS_REQUIRED: 'Please call render before triggering events',
|
|
7592
|
+
HOST_EVENT_TYPE_UNDEFINED: 'Host event type is undefined',
|
|
7593
|
+
LOGIN_FAILED: 'Login failed',
|
|
7594
|
+
ERROR_PARSING_API_INTERCEPT_BODY: 'Error parsing api intercept body',
|
|
7456
7595
|
};
|
|
7457
7596
|
const CUSTOM_ACTIONS_ERROR_MESSAGE = {
|
|
7458
7597
|
INVALID_ACTION_OBJECT: 'Custom Action Validation Error: Invalid action object provided',
|
|
@@ -17233,6 +17372,76 @@ mutation GetUnsavedAnswerTML($session: BachSessionIdInput!, $exportDependencies:
|
|
|
17233
17372
|
};
|
|
17234
17373
|
}
|
|
17235
17374
|
|
|
17375
|
+
/**
|
|
17376
|
+
* Reloads the ThoughtSpot iframe.
|
|
17377
|
+
* @param iFrame
|
|
17378
|
+
*/
|
|
17379
|
+
const reload = (iFrame) => {
|
|
17380
|
+
const src = iFrame.src;
|
|
17381
|
+
iFrame.src = '';
|
|
17382
|
+
setTimeout(() => {
|
|
17383
|
+
iFrame.src = src;
|
|
17384
|
+
}, 100);
|
|
17385
|
+
};
|
|
17386
|
+
/**
|
|
17387
|
+
* Post iframe message.
|
|
17388
|
+
* @param iFrame
|
|
17389
|
+
* @param message
|
|
17390
|
+
* @param message.type
|
|
17391
|
+
* @param message.data
|
|
17392
|
+
* @param thoughtSpotHost
|
|
17393
|
+
* @param channel
|
|
17394
|
+
*/
|
|
17395
|
+
function postIframeMessage(iFrame, message, thoughtSpotHost, channel) {
|
|
17396
|
+
var _a;
|
|
17397
|
+
return (_a = iFrame.contentWindow) === null || _a === void 0 ? void 0 : _a.postMessage(message, thoughtSpotHost, [channel === null || channel === void 0 ? void 0 : channel.port2]);
|
|
17398
|
+
}
|
|
17399
|
+
const TRIGGER_TIMEOUT = 30000;
|
|
17400
|
+
/**
|
|
17401
|
+
*
|
|
17402
|
+
* @param iFrame
|
|
17403
|
+
* @param messageType
|
|
17404
|
+
* @param thoughtSpotHost
|
|
17405
|
+
* @param data
|
|
17406
|
+
*/
|
|
17407
|
+
function processTrigger(iFrame, messageType, thoughtSpotHost, data) {
|
|
17408
|
+
return new Promise((res, rej) => {
|
|
17409
|
+
var _a;
|
|
17410
|
+
if (messageType === exports.HostEvent.Reload) {
|
|
17411
|
+
reload(iFrame);
|
|
17412
|
+
return res(null);
|
|
17413
|
+
}
|
|
17414
|
+
if (messageType === exports.HostEvent.Present) {
|
|
17415
|
+
const embedConfig = getEmbedConfig();
|
|
17416
|
+
const disableFullscreenPresentation = (_a = embedConfig === null || embedConfig === void 0 ? void 0 : embedConfig.disableFullscreenPresentation) !== null && _a !== void 0 ? _a : true;
|
|
17417
|
+
if (!disableFullscreenPresentation) {
|
|
17418
|
+
handlePresentEvent(iFrame);
|
|
17419
|
+
}
|
|
17420
|
+
else {
|
|
17421
|
+
logger$3.warn('Fullscreen presentation mode is disabled. Set disableFullscreenPresentation: false to enable this feature.');
|
|
17422
|
+
}
|
|
17423
|
+
}
|
|
17424
|
+
const channel = new MessageChannel();
|
|
17425
|
+
channel.port1.onmessage = ({ data: responseData }) => {
|
|
17426
|
+
var _a;
|
|
17427
|
+
channel.port1.close();
|
|
17428
|
+
const error = responseData.error || ((_a = responseData === null || responseData === void 0 ? void 0 : responseData.data) === null || _a === void 0 ? void 0 : _a.error);
|
|
17429
|
+
if (error) {
|
|
17430
|
+
rej(error);
|
|
17431
|
+
}
|
|
17432
|
+
else {
|
|
17433
|
+
res(responseData);
|
|
17434
|
+
}
|
|
17435
|
+
};
|
|
17436
|
+
// Close the messageChannel and resolve the promise if timeout.
|
|
17437
|
+
setTimeout(() => {
|
|
17438
|
+
channel.port1.close();
|
|
17439
|
+
res(new Error(ERROR_MESSAGE.TRIGGER_TIMED_OUT));
|
|
17440
|
+
}, TRIGGER_TIMEOUT);
|
|
17441
|
+
return postIframeMessage(iFrame, { type: messageType, data }, thoughtSpotHost, channel);
|
|
17442
|
+
});
|
|
17443
|
+
}
|
|
17444
|
+
|
|
17236
17445
|
/* eslint-disable camelcase */
|
|
17237
17446
|
/* eslint-disable import/no-mutable-exports */
|
|
17238
17447
|
/**
|
|
@@ -17578,6 +17787,19 @@ mutation GetUnsavedAnswerTML($session: BachSessionIdInput!, $exportDependencies:
|
|
|
17578
17787
|
.catch((error) => {
|
|
17579
17788
|
throw error;
|
|
17580
17789
|
});
|
|
17790
|
+
};
|
|
17791
|
+
/**
|
|
17792
|
+
* Reloads the ThoughtSpot iframe.
|
|
17793
|
+
* @param iFrame
|
|
17794
|
+
* @group Global methods
|
|
17795
|
+
* @version SDK: 1.43.1
|
|
17796
|
+
*/
|
|
17797
|
+
const reloadIframe = (iFrame) => {
|
|
17798
|
+
if (!iFrame) {
|
|
17799
|
+
logger$3.warn('reloadIframe called with no iFrame element.');
|
|
17800
|
+
return;
|
|
17801
|
+
}
|
|
17802
|
+
reload(iFrame);
|
|
17581
17803
|
};
|
|
17582
17804
|
|
|
17583
17805
|
/**
|
|
@@ -17711,77 +17933,7 @@ mutation GetUnsavedAnswerTML($session: BachSessionIdInput!, $exportDependencies:
|
|
|
17711
17933
|
return eventData;
|
|
17712
17934
|
}
|
|
17713
17935
|
|
|
17714
|
-
var name="@thoughtspot/visual-embed-sdk";var version$1="1.44.
|
|
17715
|
-
|
|
17716
|
-
/**
|
|
17717
|
-
* Reloads the ThoughtSpot iframe.
|
|
17718
|
-
* @param iFrame
|
|
17719
|
-
*/
|
|
17720
|
-
const reload = (iFrame) => {
|
|
17721
|
-
const src = iFrame.src;
|
|
17722
|
-
iFrame.src = '';
|
|
17723
|
-
setTimeout(() => {
|
|
17724
|
-
iFrame.src = src;
|
|
17725
|
-
}, 100);
|
|
17726
|
-
};
|
|
17727
|
-
/**
|
|
17728
|
-
* Post iframe message.
|
|
17729
|
-
* @param iFrame
|
|
17730
|
-
* @param message
|
|
17731
|
-
* @param message.type
|
|
17732
|
-
* @param message.data
|
|
17733
|
-
* @param thoughtSpotHost
|
|
17734
|
-
* @param channel
|
|
17735
|
-
*/
|
|
17736
|
-
function postIframeMessage(iFrame, message, thoughtSpotHost, channel) {
|
|
17737
|
-
var _a;
|
|
17738
|
-
return (_a = iFrame.contentWindow) === null || _a === void 0 ? void 0 : _a.postMessage(message, thoughtSpotHost, [channel === null || channel === void 0 ? void 0 : channel.port2]);
|
|
17739
|
-
}
|
|
17740
|
-
const TRIGGER_TIMEOUT = 30000;
|
|
17741
|
-
/**
|
|
17742
|
-
*
|
|
17743
|
-
* @param iFrame
|
|
17744
|
-
* @param messageType
|
|
17745
|
-
* @param thoughtSpotHost
|
|
17746
|
-
* @param data
|
|
17747
|
-
*/
|
|
17748
|
-
function processTrigger(iFrame, messageType, thoughtSpotHost, data) {
|
|
17749
|
-
return new Promise((res, rej) => {
|
|
17750
|
-
var _a;
|
|
17751
|
-
if (messageType === exports.HostEvent.Reload) {
|
|
17752
|
-
reload(iFrame);
|
|
17753
|
-
return res(null);
|
|
17754
|
-
}
|
|
17755
|
-
if (messageType === exports.HostEvent.Present) {
|
|
17756
|
-
const embedConfig = getEmbedConfig();
|
|
17757
|
-
const disableFullscreenPresentation = (_a = embedConfig === null || embedConfig === void 0 ? void 0 : embedConfig.disableFullscreenPresentation) !== null && _a !== void 0 ? _a : true;
|
|
17758
|
-
if (!disableFullscreenPresentation) {
|
|
17759
|
-
handlePresentEvent(iFrame);
|
|
17760
|
-
}
|
|
17761
|
-
else {
|
|
17762
|
-
logger$3.warn('Fullscreen presentation mode is disabled. Set disableFullscreenPresentation: false to enable this feature.');
|
|
17763
|
-
}
|
|
17764
|
-
}
|
|
17765
|
-
const channel = new MessageChannel();
|
|
17766
|
-
channel.port1.onmessage = ({ data: responseData }) => {
|
|
17767
|
-
var _a;
|
|
17768
|
-
channel.port1.close();
|
|
17769
|
-
const error = responseData.error || ((_a = responseData === null || responseData === void 0 ? void 0 : responseData.data) === null || _a === void 0 ? void 0 : _a.error);
|
|
17770
|
-
if (error) {
|
|
17771
|
-
rej(error);
|
|
17772
|
-
}
|
|
17773
|
-
else {
|
|
17774
|
-
res(responseData);
|
|
17775
|
-
}
|
|
17776
|
-
};
|
|
17777
|
-
// Close the messageChannel and resolve the promise if timeout.
|
|
17778
|
-
setTimeout(() => {
|
|
17779
|
-
channel.port1.close();
|
|
17780
|
-
res(new Error(ERROR_MESSAGE.TRIGGER_TIMED_OUT));
|
|
17781
|
-
}, TRIGGER_TIMEOUT);
|
|
17782
|
-
return postIframeMessage(iFrame, { type: messageType, data }, thoughtSpotHost, channel);
|
|
17783
|
-
});
|
|
17784
|
-
}
|
|
17936
|
+
var name="@thoughtspot/visual-embed-sdk";var version$1="1.44.1-test";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};
|
|
17785
17937
|
|
|
17786
17938
|
class HostEventClient {
|
|
17787
17939
|
constructor(iFrame) {
|
|
@@ -17979,9 +18131,13 @@ mutation GetUnsavedAnswerTML($session: BachSessionIdInput!, $exportDependencies:
|
|
|
17979
18131
|
const { eventData, executeEvent, viewConfig, getUnsavedAnswerTml } = params;
|
|
17980
18132
|
const [interceptData, bodyParseError] = parseInterceptData(eventData.data);
|
|
17981
18133
|
if (bodyParseError) {
|
|
17982
|
-
|
|
17983
|
-
|
|
17984
|
-
|
|
18134
|
+
const errorDetails = {
|
|
18135
|
+
errorType: ErrorDetailsTypes.API,
|
|
18136
|
+
message: ERROR_MESSAGE.ERROR_PARSING_API_INTERCEPT_BODY,
|
|
18137
|
+
code: EmbedErrorCodes.PARSING_API_INTERCEPT_BODY_ERROR,
|
|
18138
|
+
error: ERROR_MESSAGE.ERROR_PARSING_API_INTERCEPT_BODY,
|
|
18139
|
+
};
|
|
18140
|
+
executeEvent(exports.EmbedEvent.Error, errorDetails);
|
|
17985
18141
|
logger$3.error('Error parsing request body', bodyParseError);
|
|
17986
18142
|
return;
|
|
17987
18143
|
}
|
|
@@ -18293,19 +18449,23 @@ mutation GetUnsavedAnswerTML($session: BachSessionIdInput!, $exportDependencies:
|
|
|
18293
18449
|
* Throws error encountered during initialization.
|
|
18294
18450
|
*/
|
|
18295
18451
|
throwInitError() {
|
|
18296
|
-
this.handleError(
|
|
18452
|
+
this.handleError({
|
|
18453
|
+
errorType: ErrorDetailsTypes.VALIDATION_ERROR,
|
|
18454
|
+
message: ERROR_MESSAGE.INIT_SDK_REQUIRED,
|
|
18455
|
+
code: EmbedErrorCodes.INIT_ERROR,
|
|
18456
|
+
error: ERROR_MESSAGE.INIT_SDK_REQUIRED,
|
|
18457
|
+
});
|
|
18297
18458
|
}
|
|
18298
18459
|
/**
|
|
18299
18460
|
* Handles errors within the SDK
|
|
18300
18461
|
* @param error The error message or object
|
|
18462
|
+
* @param errorDetails The error details
|
|
18301
18463
|
*/
|
|
18302
|
-
handleError(
|
|
18464
|
+
handleError(errorDetails) {
|
|
18303
18465
|
this.isError = true;
|
|
18304
|
-
this.executeCallbacks(exports.EmbedEvent.Error,
|
|
18305
|
-
error,
|
|
18306
|
-
});
|
|
18466
|
+
this.executeCallbacks(exports.EmbedEvent.Error, errorDetails);
|
|
18307
18467
|
// Log error
|
|
18308
|
-
logger$3.error(
|
|
18468
|
+
logger$3.error(errorDetails);
|
|
18309
18469
|
}
|
|
18310
18470
|
/**
|
|
18311
18471
|
* Extracts the type field from the event payload
|
|
@@ -18384,11 +18544,14 @@ mutation GetUnsavedAnswerTML($session: BachSessionIdInput!, $exportDependencies:
|
|
|
18384
18544
|
};
|
|
18385
18545
|
window.addEventListener('online', onlineEventListener);
|
|
18386
18546
|
const offlineEventListener = (e) => {
|
|
18387
|
-
const
|
|
18388
|
-
|
|
18389
|
-
|
|
18390
|
-
|
|
18391
|
-
|
|
18547
|
+
const errorDetails = {
|
|
18548
|
+
errorType: ErrorDetailsTypes.NETWORK,
|
|
18549
|
+
message: ERROR_MESSAGE.OFFLINE_WARNING,
|
|
18550
|
+
code: EmbedErrorCodes.NETWORK_ERROR,
|
|
18551
|
+
offlineWarning: ERROR_MESSAGE.OFFLINE_WARNING,
|
|
18552
|
+
};
|
|
18553
|
+
this.executeCallbacks(exports.EmbedEvent.Error, errorDetails);
|
|
18554
|
+
logger$3.warn(errorDetails);
|
|
18392
18555
|
};
|
|
18393
18556
|
window.addEventListener('offline', offlineEventListener);
|
|
18394
18557
|
this.subscribedListeners.online = onlineEventListener;
|
|
@@ -18468,8 +18631,10 @@ mutation GetUnsavedAnswerTML($session: BachSessionIdInput!, $exportDependencies:
|
|
|
18468
18631
|
]);
|
|
18469
18632
|
if (customActionsResult.errors.length > 0) {
|
|
18470
18633
|
this.handleError({
|
|
18471
|
-
|
|
18634
|
+
errorType: ErrorDetailsTypes.VALIDATION_ERROR,
|
|
18472
18635
|
message: customActionsResult.errors,
|
|
18636
|
+
code: EmbedErrorCodes.CUSTOM_ACTION_VALIDATION,
|
|
18637
|
+
error: { type: EmbedErrorCodes.CUSTOM_ACTION_VALIDATION, message: customActionsResult.errors }
|
|
18473
18638
|
});
|
|
18474
18639
|
}
|
|
18475
18640
|
const baseInitData = {
|
|
@@ -18566,11 +18731,21 @@ mutation GetUnsavedAnswerTML($session: BachSessionIdInput!, $exportDependencies:
|
|
|
18566
18731
|
...additionalFlagsFromView,
|
|
18567
18732
|
};
|
|
18568
18733
|
if (Array.isArray(visibleActions) && Array.isArray(hiddenActions)) {
|
|
18569
|
-
this.handleError(
|
|
18734
|
+
this.handleError({
|
|
18735
|
+
errorType: ErrorDetailsTypes.VALIDATION_ERROR,
|
|
18736
|
+
message: ERROR_MESSAGE.CONFLICTING_ACTIONS_CONFIG,
|
|
18737
|
+
code: EmbedErrorCodes.CONFLICTING_ACTIONS_CONFIG,
|
|
18738
|
+
error: ERROR_MESSAGE.CONFLICTING_ACTIONS_CONFIG,
|
|
18739
|
+
});
|
|
18570
18740
|
return queryParams;
|
|
18571
18741
|
}
|
|
18572
18742
|
if (Array.isArray(visibleTabs) && Array.isArray(hiddenTabs)) {
|
|
18573
|
-
this.handleError(
|
|
18743
|
+
this.handleError({
|
|
18744
|
+
errorType: ErrorDetailsTypes.VALIDATION_ERROR,
|
|
18745
|
+
message: ERROR_MESSAGE.CONFLICTING_TABS_CONFIG,
|
|
18746
|
+
code: EmbedErrorCodes.CONFLICTING_TABS_CONFIG,
|
|
18747
|
+
error: ERROR_MESSAGE.CONFLICTING_TABS_CONFIG,
|
|
18748
|
+
});
|
|
18574
18749
|
return queryParams;
|
|
18575
18750
|
}
|
|
18576
18751
|
if (primaryAction) {
|
|
@@ -18795,7 +18970,12 @@ mutation GetUnsavedAnswerTML($session: BachSessionIdInput!, $exportDependencies:
|
|
|
18795
18970
|
error: JSON.stringify(error),
|
|
18796
18971
|
});
|
|
18797
18972
|
this.handleInsertionIntoDOM(this.embedConfig.loginFailedMessage);
|
|
18798
|
-
this.handleError(
|
|
18973
|
+
this.handleError({
|
|
18974
|
+
errorType: ErrorDetailsTypes.API,
|
|
18975
|
+
message: error.message || ERROR_MESSAGE.LOGIN_FAILED,
|
|
18976
|
+
code: EmbedErrorCodes.LOGIN_FAILED,
|
|
18977
|
+
error: error,
|
|
18978
|
+
});
|
|
18799
18979
|
});
|
|
18800
18980
|
});
|
|
18801
18981
|
}
|
|
@@ -19100,11 +19280,21 @@ mutation GetUnsavedAnswerTML($session: BachSessionIdInput!, $exportDependencies:
|
|
|
19100
19280
|
async trigger(messageType, data = {}) {
|
|
19101
19281
|
uploadMixpanelEvent(`${MIXPANEL_EVENT.VISUAL_SDK_TRIGGER}-${messageType}`);
|
|
19102
19282
|
if (!this.isRendered) {
|
|
19103
|
-
this.handleError(
|
|
19283
|
+
this.handleError({
|
|
19284
|
+
errorType: ErrorDetailsTypes.VALIDATION_ERROR,
|
|
19285
|
+
message: ERROR_MESSAGE.RENDER_BEFORE_EVENTS_REQUIRED,
|
|
19286
|
+
code: EmbedErrorCodes.RENDER_NOT_CALLED,
|
|
19287
|
+
error: ERROR_MESSAGE.RENDER_BEFORE_EVENTS_REQUIRED,
|
|
19288
|
+
});
|
|
19104
19289
|
return null;
|
|
19105
19290
|
}
|
|
19106
19291
|
if (!messageType) {
|
|
19107
|
-
this.handleError(
|
|
19292
|
+
this.handleError({
|
|
19293
|
+
errorType: ErrorDetailsTypes.VALIDATION_ERROR,
|
|
19294
|
+
message: ERROR_MESSAGE.HOST_EVENT_TYPE_UNDEFINED,
|
|
19295
|
+
code: EmbedErrorCodes.HOST_EVENT_TYPE_UNDEFINED,
|
|
19296
|
+
error: ERROR_MESSAGE.HOST_EVENT_TYPE_UNDEFINED,
|
|
19297
|
+
});
|
|
19108
19298
|
return null;
|
|
19109
19299
|
}
|
|
19110
19300
|
// Check if iframe exists before triggering -
|
|
@@ -19585,7 +19775,7 @@ mutation GetUnsavedAnswerTML($session: BachSessionIdInput!, $exportDependencies:
|
|
|
19585
19775
|
constructor(domSelector, viewConfig) {
|
|
19586
19776
|
viewConfig.embedComponentType = 'AppEmbed';
|
|
19587
19777
|
super(domSelector, viewConfig);
|
|
19588
|
-
this.defaultHeight =
|
|
19778
|
+
this.defaultHeight = 500;
|
|
19589
19779
|
this.sendFullHeightLazyLoadData = () => {
|
|
19590
19780
|
const data = calculateVisibleElementData(this.iFrame);
|
|
19591
19781
|
this.trigger(exports.HostEvent.VisibleEmbedCoordinates, data);
|
|
@@ -19607,8 +19797,7 @@ mutation GetUnsavedAnswerTML($session: BachSessionIdInput!, $exportDependencies:
|
|
|
19607
19797
|
* @param data The event payload
|
|
19608
19798
|
*/
|
|
19609
19799
|
this.updateIFrameHeight = (data) => {
|
|
19610
|
-
|
|
19611
|
-
this.setIFrameHeight(Math.max(data.data, (_a = this.iFrame) === null || _a === void 0 ? void 0 : _a.scrollHeight));
|
|
19800
|
+
this.setIFrameHeight(Math.max(data.data, this.defaultHeight));
|
|
19612
19801
|
this.sendFullHeightLazyLoadData();
|
|
19613
19802
|
};
|
|
19614
19803
|
this.embedIframeCenter = (data, responder) => {
|
|
@@ -19647,7 +19836,7 @@ mutation GetUnsavedAnswerTML($session: BachSessionIdInput!, $exportDependencies:
|
|
|
19647
19836
|
* embedded Liveboard or visualization.
|
|
19648
19837
|
*/
|
|
19649
19838
|
getEmbedParams() {
|
|
19650
|
-
const { tag, hideTagFilterChips, 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, dataPanelCustomGroupsAccordionInitialState = exports.DataPanelCustomColumnGroupsAccordionState.EXPAND_ALL, collapseSearchBar = true, isLiveboardCompactHeaderEnabled = false, showLiveboardVerifiedBadge = true, showLiveboardReverifyBanner = true, hideIrrelevantChipsInLiveboardTabs = false, isEnhancedFilterInteractivityEnabled = false, homePageSearchBarMode, isUnifiedSearchExperienceEnabled = true, enablePendoHelp = true, discoveryExperience, coverAndFilterOptionInPDF = false, liveboardXLSXCSVDownload, isLiveboardStylingAndGroupingEnabled, isPNGInScheduledEmailsEnabled = false, isCentralizedLiveboardFilterUXEnabled = false, isLinkParametersEnabled, updatedSpotterChatPrompt, } = this.viewConfig;
|
|
19839
|
+
const { tag, hideTagFilterChips, hideObjects, liveboardV2, showPrimaryNavbar, disableProfileAndHelp, hideHamburger, hideObjectSearch, hideNotification, hideApplicationSwitcher, hideOrgSwitcher, enableSearchAssist, fullHeight, dataPanelV2 = true, hideLiveboardHeader = false, showLiveboardTitle = true, showLiveboardDescription = true, showMaskedFilterChip = false, isLiveboardMasterpiecesEnabled = false, hideHomepageLeftNav = false, modularHomeExperience = false, isLiveboardHeaderSticky = true, enableAskSage, collapseSearchBarInitially = false, enable2ColumnLayout, enableCustomColumnGroups = false, dataPanelCustomGroupsAccordionInitialState = exports.DataPanelCustomColumnGroupsAccordionState.EXPAND_ALL, collapseSearchBar = true, isLiveboardCompactHeaderEnabled = false, showLiveboardVerifiedBadge = true, showLiveboardReverifyBanner = true, hideIrrelevantChipsInLiveboardTabs = false, isEnhancedFilterInteractivityEnabled = false, homePageSearchBarMode, isUnifiedSearchExperienceEnabled = true, enablePendoHelp = true, discoveryExperience, coverAndFilterOptionInPDF = false, liveboardXLSXCSVDownload, isLiveboardStylingAndGroupingEnabled, isPNGInScheduledEmailsEnabled = false, isCentralizedLiveboardFilterUXEnabled = false, isLinkParametersEnabled, updatedSpotterChatPrompt, minimumHeight, } = this.viewConfig;
|
|
19651
19840
|
let params = {};
|
|
19652
19841
|
params[Param.PrimaryNavHidden] = !showPrimaryNavbar;
|
|
19653
19842
|
params[Param.HideProfleAndHelp] = !!disableProfileAndHelp;
|
|
@@ -19656,6 +19845,8 @@ mutation GetUnsavedAnswerTML($session: BachSessionIdInput!, $exportDependencies:
|
|
|
19656
19845
|
params[Param.HideLiveboardHeader] = hideLiveboardHeader;
|
|
19657
19846
|
params[Param.ShowLiveboardTitle] = showLiveboardTitle;
|
|
19658
19847
|
params[Param.ShowLiveboardDescription] = !!showLiveboardDescription;
|
|
19848
|
+
params[Param.ShowMaskedFilterChip] = showMaskedFilterChip;
|
|
19849
|
+
params[Param.IsLiveboardMasterpiecesEnabled] = isLiveboardMasterpiecesEnabled;
|
|
19659
19850
|
params[Param.LiveboardHeaderSticky] = isLiveboardHeaderSticky;
|
|
19660
19851
|
params[Param.IsFullAppEmbed] = true;
|
|
19661
19852
|
params[Param.LiveboardHeaderV2] = isLiveboardCompactHeaderEnabled;
|
|
@@ -19727,6 +19918,7 @@ mutation GetUnsavedAnswerTML($session: BachSessionIdInput!, $exportDependencies:
|
|
|
19727
19918
|
if (isCentralizedLiveboardFilterUXEnabled != undefined) {
|
|
19728
19919
|
params[Param.isCentralizedLiveboardFilterUXEnabled] = isCentralizedLiveboardFilterUXEnabled;
|
|
19729
19920
|
}
|
|
19921
|
+
this.defaultHeight = minimumHeight || this.defaultHeight;
|
|
19730
19922
|
params[Param.DataPanelV2Enabled] = dataPanelV2;
|
|
19731
19923
|
params[Param.HideHomepageLeftNav] = hideHomepageLeftNav;
|
|
19732
19924
|
params[Param.ModularHomeExperienceEnabled] = modularHomeExperience;
|
|
@@ -20081,7 +20273,7 @@ query GetEurekaVizSnapshots(
|
|
|
20081
20273
|
getEmbedParamsObject() {
|
|
20082
20274
|
let params = {};
|
|
20083
20275
|
params = this.getBaseQueryParams(params);
|
|
20084
|
-
const { enableVizTransformations, fullHeight, defaultHeight, visibleVizs, liveboardV2, vizId, hideTabPanel, activeTabId, hideLiveboardHeader, showLiveboardDescription, showLiveboardTitle, isLiveboardHeaderSticky = true, isLiveboardCompactHeaderEnabled = false, showLiveboardVerifiedBadge = true, showLiveboardReverifyBanner = true, hideIrrelevantChipsInLiveboardTabs = false, isEnhancedFilterInteractivityEnabled = false, enableAskSage, enable2ColumnLayout, dataPanelV2 = true, enableCustomColumnGroups = false, oAuthPollingInterval, isForceRedirect, dataSourceId, coverAndFilterOptionInPDF = false, liveboardXLSXCSVDownload, isLiveboardStylingAndGroupingEnabled, isPNGInScheduledEmailsEnabled = false, showSpotterLimitations, isCentralizedLiveboardFilterUXEnabled = false, isLinkParametersEnabled, updatedSpotterChatPrompt, } = this.viewConfig;
|
|
20276
|
+
const { enableVizTransformations, fullHeight, defaultHeight, minimumHeight, visibleVizs, liveboardV2, vizId, hideTabPanel, activeTabId, hideLiveboardHeader, showLiveboardDescription, showLiveboardTitle, isLiveboardHeaderSticky = true, isLiveboardCompactHeaderEnabled = false, showLiveboardVerifiedBadge = true, showLiveboardReverifyBanner = true, hideIrrelevantChipsInLiveboardTabs = false, showMaskedFilterChip = false, isLiveboardMasterpiecesEnabled = false, isEnhancedFilterInteractivityEnabled = false, enableAskSage, enable2ColumnLayout, dataPanelV2 = true, enableCustomColumnGroups = false, oAuthPollingInterval, isForceRedirect, dataSourceId, coverAndFilterOptionInPDF = false, liveboardXLSXCSVDownload, isLiveboardStylingAndGroupingEnabled, isPNGInScheduledEmailsEnabled = false, showSpotterLimitations, isCentralizedLiveboardFilterUXEnabled = false, isLinkParametersEnabled, updatedSpotterChatPrompt, } = this.viewConfig;
|
|
20085
20277
|
const preventLiveboardFilterRemoval = this.viewConfig.preventLiveboardFilterRemoval
|
|
20086
20278
|
|| this.viewConfig.preventPinboardFilterRemoval;
|
|
20087
20279
|
if (fullHeight === true) {
|
|
@@ -20091,9 +20283,7 @@ query GetEurekaVizSnapshots(
|
|
|
20091
20283
|
params[Param.RootMarginForLazyLoad] = this.viewConfig.lazyLoadingMargin;
|
|
20092
20284
|
}
|
|
20093
20285
|
}
|
|
20094
|
-
|
|
20095
|
-
this.defaultHeight = defaultHeight;
|
|
20096
|
-
}
|
|
20286
|
+
this.defaultHeight = minimumHeight || defaultHeight || this.defaultHeight;
|
|
20097
20287
|
if (enableVizTransformations !== undefined) {
|
|
20098
20288
|
params[Param.EnableVizTransformations] = enableVizTransformations.toString();
|
|
20099
20289
|
}
|
|
@@ -20160,6 +20350,8 @@ query GetEurekaVizSnapshots(
|
|
|
20160
20350
|
params[Param.ShowLiveboardVerifiedBadge] = showLiveboardVerifiedBadge;
|
|
20161
20351
|
params[Param.ShowLiveboardReverifyBanner] = showLiveboardReverifyBanner;
|
|
20162
20352
|
params[Param.HideIrrelevantFiltersInTab] = hideIrrelevantChipsInLiveboardTabs;
|
|
20353
|
+
params[Param.ShowMaskedFilterChip] = showMaskedFilterChip;
|
|
20354
|
+
params[Param.IsLiveboardMasterpiecesEnabled] = isLiveboardMasterpiecesEnabled;
|
|
20163
20355
|
params[Param.IsEnhancedFilterInteractivityEnabled] = isEnhancedFilterInteractivityEnabled;
|
|
20164
20356
|
params[Param.DataPanelV2Enabled] = dataPanelV2;
|
|
20165
20357
|
params[Param.EnableCustomColumnGroups] = enableCustomColumnGroups;
|
|
@@ -20191,7 +20383,12 @@ query GetEurekaVizSnapshots(
|
|
|
20191
20383
|
const { vizId, activeTabId } = this.viewConfig;
|
|
20192
20384
|
const liveboardId = (_a = this.viewConfig.liveboardId) !== null && _a !== void 0 ? _a : this.viewConfig.pinboardId;
|
|
20193
20385
|
if (!liveboardId) {
|
|
20194
|
-
this.handleError(
|
|
20386
|
+
this.handleError({
|
|
20387
|
+
errorType: ErrorDetailsTypes.VALIDATION_ERROR,
|
|
20388
|
+
message: ERROR_MESSAGE.LIVEBOARD_VIZ_ID_VALIDATION,
|
|
20389
|
+
code: EmbedErrorCodes.LIVEBOARD_ID_MISSING,
|
|
20390
|
+
error: ERROR_MESSAGE.LIVEBOARD_VIZ_ID_VALIDATION,
|
|
20391
|
+
});
|
|
20195
20392
|
}
|
|
20196
20393
|
return `${this.getRootIframeSrc()}${this.getIframeSuffixSrc(liveboardId, vizId, activeTabId)}`;
|
|
20197
20394
|
}
|
|
@@ -21155,7 +21352,12 @@ query SendMessage($params: Input_convassist_SendMessageRequest) {
|
|
|
21155
21352
|
getEmbedParamsObject() {
|
|
21156
21353
|
const { worksheetId, searchOptions, disableSourceSelection, hideSourceSelection, dataPanelV2, showSpotterLimitations, hideSampleQuestions, enablePastConversationsSidebar, runtimeFilters, excludeRuntimeFiltersfromURL, runtimeParameters, excludeRuntimeParametersfromURL, updatedSpotterChatPrompt, } = this.viewConfig;
|
|
21157
21354
|
if (!worksheetId) {
|
|
21158
|
-
this.handleError(
|
|
21355
|
+
this.handleError({
|
|
21356
|
+
errorType: ErrorDetailsTypes.VALIDATION_ERROR,
|
|
21357
|
+
message: ERROR_MESSAGE.SPOTTER_EMBED_WORKSHEED_ID_NOT_FOUND,
|
|
21358
|
+
code: EmbedErrorCodes.WORKSHEET_ID_NOT_FOUND,
|
|
21359
|
+
error: ERROR_MESSAGE.SPOTTER_EMBED_WORKSHEED_ID_NOT_FOUND,
|
|
21360
|
+
});
|
|
21159
21361
|
}
|
|
21160
21362
|
const queryParams = this.getBaseQueryParams();
|
|
21161
21363
|
queryParams[Param.SpotterEnabled] = true;
|
|
@@ -29264,6 +29466,7 @@ query GetEurekaResults($params: Input_eureka_SearchRequest) {
|
|
|
29264
29466
|
exports.init = init;
|
|
29265
29467
|
exports.logout = logout;
|
|
29266
29468
|
exports.prefetch = prefetch;
|
|
29469
|
+
exports.reloadIframe = reloadIframe;
|
|
29267
29470
|
exports.resetCachedAuthToken = resetCachedAuthToken;
|
|
29268
29471
|
exports.tokenizedFetch = tokenizedFetch;
|
|
29269
29472
|
exports.uploadMixpanelEvent = uploadMixpanelEvent;
|