@thoughtspot/visual-embed-sdk 1.36.7 → 1.36.9-PA

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.
Files changed (157) hide show
  1. package/cjs/package.json +23 -21
  2. package/cjs/src/embed/bodyless-conversation.d.ts +16 -0
  3. package/cjs/src/embed/bodyless-conversation.d.ts.map +1 -1
  4. package/cjs/src/embed/bodyless-conversation.js +1 -1
  5. package/cjs/src/embed/bodyless-conversation.js.map +1 -1
  6. package/cjs/src/embed/liveboard.d.ts +15 -0
  7. package/cjs/src/embed/liveboard.d.ts.map +1 -1
  8. package/cjs/src/embed/liveboard.js +4 -1
  9. package/cjs/src/embed/liveboard.js.map +1 -1
  10. package/cjs/src/embed/liveboard.spec.js +25 -1
  11. package/cjs/src/embed/liveboard.spec.js.map +1 -1
  12. package/cjs/src/embed/search-bar.d.ts +1 -1
  13. package/cjs/src/embed/search.d.ts +1 -1
  14. package/cjs/src/embed/ts-embed.d.ts.map +1 -1
  15. package/cjs/src/embed/ts-embed.js +14 -2
  16. package/cjs/src/embed/ts-embed.js.map +1 -1
  17. package/cjs/src/embed/ts-embed.spec.js +111 -0
  18. package/cjs/src/embed/ts-embed.spec.js.map +1 -1
  19. package/cjs/src/index.d.ts +2 -2
  20. package/cjs/src/index.d.ts.map +1 -1
  21. package/cjs/src/index.js +2 -1
  22. package/cjs/src/index.js.map +1 -1
  23. package/cjs/src/pages/embed-test.page.d.ts +8 -0
  24. package/cjs/src/pages/embed-test.page.d.ts.map +1 -0
  25. package/cjs/src/pages/embed-test.page.js +20 -0
  26. package/cjs/src/pages/embed-test.page.js.map +1 -0
  27. package/cjs/src/pages/home.page.d.ts +6 -0
  28. package/cjs/src/pages/home.page.d.ts.map +1 -0
  29. package/cjs/src/pages/home.page.js +12 -0
  30. package/cjs/src/pages/home.page.js.map +1 -0
  31. package/cjs/src/pages/login.page.d.ts +15 -0
  32. package/cjs/src/pages/login.page.d.ts.map +1 -0
  33. package/cjs/src/pages/login.page.js +22 -0
  34. package/cjs/src/pages/login.page.js.map +1 -0
  35. package/cjs/src/react/index.d.ts +1 -1
  36. package/cjs/src/react/index.d.ts.map +1 -1
  37. package/cjs/src/react/index.js +10 -5
  38. package/cjs/src/react/index.js.map +1 -1
  39. package/cjs/src/react/util.d.ts +2 -0
  40. package/cjs/src/react/util.d.ts.map +1 -1
  41. package/cjs/src/react/util.js.map +1 -1
  42. package/cjs/src/tests/auth.test.d.ts +1 -0
  43. package/cjs/src/tests/auth.test.d.ts.map +1 -0
  44. package/cjs/src/tests/auth.test.js +1 -0
  45. package/cjs/src/tests/auth.test.js.map +1 -0
  46. package/cjs/src/tests/e2e/auth.spec.d.ts +2 -0
  47. package/cjs/src/tests/e2e/auth.spec.d.ts.map +1 -0
  48. package/cjs/src/tests/e2e/auth.spec.js +54 -0
  49. package/cjs/src/tests/e2e/auth.spec.js.map +1 -0
  50. package/cjs/src/types.d.ts +93 -11
  51. package/cjs/src/types.d.ts.map +1 -1
  52. package/cjs/src/types.js +56 -9
  53. package/cjs/src/types.js.map +1 -1
  54. package/dist/index-BEyovSez.js +7370 -0
  55. package/dist/{index-BratITNz.js → index-BJx3m5_V.js} +1 -1
  56. package/dist/index-CpzF_6NO.js +7440 -0
  57. package/dist/index-Dg18PU5Z.js +7370 -0
  58. package/dist/index-Do_T8J8z.js +7370 -0
  59. package/dist/index-KdQfn0ah.js +7440 -0
  60. package/dist/src/embed/bodyless-conversation.d.ts +16 -0
  61. package/dist/src/embed/bodyless-conversation.d.ts.map +1 -1
  62. package/dist/src/embed/liveboard.d.ts +15 -0
  63. package/dist/src/embed/liveboard.d.ts.map +1 -1
  64. package/dist/src/embed/search-bar.d.ts +1 -1
  65. package/dist/src/embed/search.d.ts +1 -1
  66. package/dist/src/embed/ts-embed.d.ts.map +1 -1
  67. package/dist/src/index.d.ts +2 -2
  68. package/dist/src/index.d.ts.map +1 -1
  69. package/dist/src/pages/embed-test.page.d.ts +8 -0
  70. package/dist/src/pages/embed-test.page.d.ts.map +1 -0
  71. package/dist/src/pages/home.page.d.ts +6 -0
  72. package/dist/src/pages/home.page.d.ts.map +1 -0
  73. package/dist/src/pages/login.page.d.ts +15 -0
  74. package/dist/src/pages/login.page.d.ts.map +1 -0
  75. package/dist/src/react/index.d.ts +1 -1
  76. package/dist/src/react/index.d.ts.map +1 -1
  77. package/dist/src/react/util.d.ts +2 -0
  78. package/dist/src/react/util.d.ts.map +1 -1
  79. package/dist/src/tests/auth.test.d.ts +1 -0
  80. package/dist/src/tests/auth.test.d.ts.map +1 -0
  81. package/dist/src/tests/e2e/auth.spec.d.ts +2 -0
  82. package/dist/src/tests/e2e/auth.spec.d.ts.map +1 -0
  83. package/dist/src/types.d.ts +93 -11
  84. package/dist/src/types.d.ts.map +1 -1
  85. package/dist/tsembed-react.es.js +85 -19
  86. package/dist/tsembed-react.js +269 -133
  87. package/dist/tsembed.es.js +78 -16
  88. package/dist/tsembed.js +261 -129
  89. package/dist/visual-embed-sdk-react-full.d.ts +127 -14
  90. package/dist/visual-embed-sdk-react.d.ts +127 -14
  91. package/dist/visual-embed-sdk.d.ts +126 -14
  92. package/lib/package.json +23 -21
  93. package/lib/src/embed/bodyless-conversation.d.ts +16 -0
  94. package/lib/src/embed/bodyless-conversation.d.ts.map +1 -1
  95. package/lib/src/embed/bodyless-conversation.js +1 -1
  96. package/lib/src/embed/bodyless-conversation.js.map +1 -1
  97. package/lib/src/embed/liveboard.d.ts +15 -0
  98. package/lib/src/embed/liveboard.d.ts.map +1 -1
  99. package/lib/src/embed/liveboard.js +4 -1
  100. package/lib/src/embed/liveboard.js.map +1 -1
  101. package/lib/src/embed/liveboard.spec.js +25 -1
  102. package/lib/src/embed/liveboard.spec.js.map +1 -1
  103. package/lib/src/embed/search-bar.d.ts +1 -1
  104. package/lib/src/embed/search.d.ts +1 -1
  105. package/lib/src/embed/ts-embed.d.ts.map +1 -1
  106. package/lib/src/embed/ts-embed.js +14 -2
  107. package/lib/src/embed/ts-embed.js.map +1 -1
  108. package/lib/src/embed/ts-embed.spec.js +111 -0
  109. package/lib/src/embed/ts-embed.spec.js.map +1 -1
  110. package/lib/src/index.d.ts +2 -2
  111. package/lib/src/index.d.ts.map +1 -1
  112. package/lib/src/index.js +2 -2
  113. package/lib/src/index.js.map +1 -1
  114. package/lib/src/pages/embed-test.page.d.ts +8 -0
  115. package/lib/src/pages/embed-test.page.d.ts.map +1 -0
  116. package/lib/src/pages/embed-test.page.js +16 -0
  117. package/lib/src/pages/embed-test.page.js.map +1 -0
  118. package/lib/src/pages/home.page.d.ts +6 -0
  119. package/lib/src/pages/home.page.d.ts.map +1 -0
  120. package/lib/src/pages/home.page.js +8 -0
  121. package/lib/src/pages/home.page.js.map +1 -0
  122. package/lib/src/pages/login.page.d.ts +15 -0
  123. package/lib/src/pages/login.page.d.ts.map +1 -0
  124. package/lib/src/pages/login.page.js +18 -0
  125. package/lib/src/pages/login.page.js.map +1 -0
  126. package/lib/src/react/index.d.ts +1 -1
  127. package/lib/src/react/index.d.ts.map +1 -1
  128. package/lib/src/react/index.js +9 -5
  129. package/lib/src/react/index.js.map +1 -1
  130. package/lib/src/react/util.d.ts +2 -0
  131. package/lib/src/react/util.d.ts.map +1 -1
  132. package/lib/src/react/util.js.map +1 -1
  133. package/lib/src/tests/auth.test.d.ts +1 -0
  134. package/lib/src/tests/auth.test.d.ts.map +1 -0
  135. package/lib/src/tests/auth.test.js +1 -0
  136. package/lib/src/tests/auth.test.js.map +1 -0
  137. package/lib/src/tests/e2e/auth.spec.d.ts +2 -0
  138. package/lib/src/tests/e2e/auth.spec.d.ts.map +1 -0
  139. package/lib/src/tests/e2e/auth.spec.js +52 -0
  140. package/lib/src/tests/e2e/auth.spec.js.map +1 -0
  141. package/lib/src/types.d.ts +93 -11
  142. package/lib/src/types.d.ts.map +1 -1
  143. package/lib/src/types.js +55 -8
  144. package/lib/src/types.js.map +1 -1
  145. package/lib/src/visual-embed-sdk.d.ts +128 -15
  146. package/package.json +23 -21
  147. package/src/embed/bodyless-conversation.ts +1 -1
  148. package/src/embed/liveboard.spec.ts +35 -7
  149. package/src/embed/liveboard.ts +21 -1
  150. package/src/embed/search-bar.tsx +1 -1
  151. package/src/embed/search.ts +1 -1
  152. package/src/embed/ts-embed.spec.ts +118 -0
  153. package/src/embed/ts-embed.ts +15 -0
  154. package/src/index.ts +2 -0
  155. package/src/react/index.tsx +12 -8
  156. package/src/react/util.ts +1 -0
  157. package/src/types.ts +94 -10
package/dist/tsembed.js CHANGED
@@ -1,4 +1,4 @@
1
- /* @thoughtspot/visual-embed-sdk version 1.36.7 */
1
+ /* @thoughtspot/visual-embed-sdk version 1.36.9-PA */
2
2
  (function (global, factory) {
3
3
  typeof exports === 'object' && typeof module !== 'undefined' ? factory(exports) :
4
4
  typeof define === 'function' && define.amd ? define(['exports'], factory) :
@@ -31,7 +31,7 @@
31
31
  }
32
32
  return false;
33
33
  };
34
- const merge = (...objects) => objects.reduce((result, current) => {
34
+ const merge$1 = (...objects) => objects.reduce((result, current) => {
35
35
  if (Array.isArray(current)) {
36
36
  throw new TypeError("Arguments provided to ts-deepmerge must be objects, not arrays.");
37
37
  }
@@ -40,19 +40,19 @@
40
40
  return;
41
41
  }
42
42
  if (Array.isArray(result[key]) && Array.isArray(current[key])) {
43
- result[key] = merge.options.mergeArrays
44
- ? merge.options.uniqueArrayItems
43
+ result[key] = merge$1.options.mergeArrays
44
+ ? merge$1.options.uniqueArrayItems
45
45
  ? Array.from(new Set(result[key].concat(current[key])))
46
46
  : [...result[key], ...current[key]]
47
47
  : current[key];
48
48
  }
49
49
  else if (isObject$1(result[key]) && isObject$1(current[key])) {
50
- result[key] = merge(result[key], current[key]);
50
+ result[key] = merge$1(result[key], current[key]);
51
51
  }
52
52
  else {
53
53
  result[key] =
54
54
  current[key] === undefined
55
- ? merge.options.allowUndefinedOverrides
55
+ ? merge$1.options.allowUndefinedOverrides
56
56
  ? current[key]
57
57
  : result[key]
58
58
  : current[key];
@@ -65,11 +65,11 @@
65
65
  mergeArrays: true,
66
66
  uniqueArrayItems: true,
67
67
  };
68
- merge.options = defaultOptions;
69
- merge.withOptions = (options, ...objects) => {
70
- merge.options = Object.assign(Object.assign({}, defaultOptions), options);
71
- const result = merge(...objects);
72
- merge.options = defaultOptions;
68
+ merge$1.options = defaultOptions;
69
+ merge$1.withOptions = (options, ...objects) => {
70
+ merge$1.options = Object.assign(Object.assign({}, defaultOptions), options);
71
+ const result = merge$1(...objects);
72
+ merge$1.options = defaultOptions;
73
73
  return result;
74
74
  };
75
75
 
@@ -270,7 +270,7 @@
270
270
  function getDOMNode(domSelector) {
271
271
  return typeof domSelector === 'string' ? document.querySelector(domSelector) : domSelector;
272
272
  }
273
- const deepMerge = (target, source) => merge(target, source);
273
+ const deepMerge = (target, source) => merge$1(target, source);
274
274
  const getOperationNameFromQuery = (query) => {
275
275
  const regex = /(?:query|mutation)\s+(\w+)/;
276
276
  const matches = query.match(regex);
@@ -683,6 +683,35 @@
683
683
  */
684
684
  HomepageModule["Learning"] = "LEARNING";
685
685
  })(exports.HomepageModule || (exports.HomepageModule = {}));
686
+ /**
687
+ * List page columns that can be hidden.
688
+ * **Note**: This option is applicable only in full app embedding.
689
+ * @version SDK: 1.38.0 | ThoughtSpot: 9.12.5.cl, 10.1.0.sw
690
+ */
691
+ // eslint-disable-next-line no-shadow
692
+ exports.ListPageColumns = void 0;
693
+ (function (ListPageColumns) {
694
+ /**
695
+ * Favourite
696
+ */
697
+ ListPageColumns["Favourite"] = "FAVOURITE";
698
+ /**
699
+ * Tags
700
+ */
701
+ ListPageColumns["Tags"] = "TAGS";
702
+ /**
703
+ * Author
704
+ */
705
+ ListPageColumns["Author"] = "AUTHOR";
706
+ /**
707
+ * Last viewed/Last modified
708
+ */
709
+ ListPageColumns["DateSort"] = "DATE_SORT";
710
+ /**
711
+ * Share
712
+ */
713
+ ListPageColumns["Share"] = "SHARE";
714
+ })(exports.ListPageColumns || (exports.ListPageColumns = {}));
686
715
  /**
687
716
  * Event types emitted by the embedded ThoughtSpot application.
688
717
  *
@@ -1673,16 +1702,19 @@
1673
1702
  /**
1674
1703
  * Emits when a table visualization is rendered in
1675
1704
  * the ThoughtSpot embedded app.
1705
+ *
1676
1706
  * You can also use this event as a hook to trigger host events
1677
1707
  * such as `HostEvent.TransformTableVizData` on the table visualization.
1678
1708
  * The event payload contains the data used in the rendered table.
1679
1709
  * You can extract the relevant data from the payload
1680
1710
  * stored in `payload.data.data.columnDataLite`.
1711
+ *
1681
1712
  * `columnDataLite` is a multidimensional array that contains
1682
1713
  * data values for each column, which was used in the query to
1683
1714
  * generate the table visualization. To find and modify specific cell data,
1684
1715
  * you can either loop through the array or directly access a cell if
1685
1716
  * you know its position and data index.
1717
+ *
1686
1718
  * In the following code sample, the first cell in the first column
1687
1719
  * (`columnDataLite[0].dataValue[0]`) is set to `new fob`.
1688
1720
  * Note that any changes made to the data in the payload will only update the
@@ -1692,6 +1724,7 @@
1692
1724
  * payload in the `columnDataLite` is passed on to
1693
1725
  * `HostEvent.TransformTableVizData` and trigger an update to
1694
1726
  * the table visualization.
1727
+ *
1695
1728
  * If the Row-Level Security (RLS) rules are applied on the
1696
1729
  * Worksheet or Model, exercise caution when changing column
1697
1730
  * or table cell values to maintain data security.
@@ -1706,7 +1739,7 @@
1706
1739
  * searchEmbed.trigger(HostEvent.TransformTableVizData, columnDataLite);
1707
1740
  * })
1708
1741
  * ```
1709
- * @version SDK: 1.35.12 | ThoughtSpot: 10.7.0.cl
1742
+ * @version SDK: 1.38.0 | ThoughtSpot: 10.8.0.cl
1710
1743
  */
1711
1744
  EmbedEvent["TableVizRendered"] = "TableVizRendered";
1712
1745
  /**
@@ -1719,7 +1752,7 @@
1719
1752
  * console.log('payload', payload);
1720
1753
  * })
1721
1754
  *```
1722
- * @version SDK : 1.36.0 | ThoughtSpot : 10.8.0.cl
1755
+ * @version SDK : 1.38.0 | ThoughtSpot : 10.8.0.cl
1723
1756
  */
1724
1757
  EmbedEvent["CreateLiveboard"] = "createLiveboard";
1725
1758
  /**
@@ -2168,7 +2201,7 @@
2168
2201
  * ```js
2169
2202
  * liveboardEmbed.trigger(HostEvent.Remove)
2170
2203
  * ```
2171
- * @version SDK: 1.37.0 | ThoughtSpot: 10.8.0.cl, 10.10.0.sw
2204
+ * @version SDK: 1.38.0 | ThoughtSpot: 10.8.0.cl, 10.10.0.sw
2172
2205
  */
2173
2206
  HostEvent["Remove"] = "delete";
2174
2207
  /**
@@ -2716,7 +2749,7 @@
2716
2749
  * ```js
2717
2750
  * liveboardEmbed.trigger(HostEvent.InfoSuccess, data);
2718
2751
  *```
2719
- * @version SDK: 1.36.0 | Thoughtspot: 10.6.0.cl
2752
+ * @version SDK: 1.36.0 | ThoughtSpot: 10.6.0.cl
2720
2753
  */
2721
2754
  HostEvent["InfoSuccess"] = "InfoSuccess";
2722
2755
  /**
@@ -2763,7 +2796,7 @@
2763
2796
  * searchEmbed.trigger(HostEvent.TransformTableVizData, columnDataLite);
2764
2797
  * })
2765
2798
  * ```
2766
- * @version SDK: 1.35.12 | ThoughtSpot: 10.7.0.cl
2799
+ * @version SDK: 1.38.0 | ThoughtSpot: 10.8.0.cl
2767
2800
  */
2768
2801
  HostEvent["TransformTableVizData"] = "TransformTableVizData";
2769
2802
  })(exports.HostEvent || (exports.HostEvent = {}));
@@ -2818,6 +2851,7 @@
2818
2851
  Param["livedBoardEmbed"] = "isLiveboardEmbed";
2819
2852
  Param["searchEmbed"] = "isSearchEmbed";
2820
2853
  Param["vizEmbed"] = "isVizEmbed";
2854
+ Param["StringIDsUrl"] = "overrideStringIDsUrl";
2821
2855
  Param["Version"] = "sdkVersion";
2822
2856
  Param["ViewPortHeight"] = "viewPortHeight";
2823
2857
  Param["ViewPortWidth"] = "viewPortWidth";
@@ -2873,6 +2907,7 @@
2873
2907
  Param["HideSageAnswerHeader"] = "hideSageAnswerHeader";
2874
2908
  Param["HideSearchBar"] = "hideSearchBar";
2875
2909
  Param["ClientLogLevel"] = "clientLogLevel";
2910
+ Param["ExposeTranslationIDs"] = "exposeTranslationIDs";
2876
2911
  Param["OverrideNativeConsole"] = "overrideConsoleLogs";
2877
2912
  Param["enableAskSage"] = "enableAskSage";
2878
2913
  Param["CollapseSearchBarInitially"] = "collapseSearchBarInitially";
@@ -2899,6 +2934,8 @@
2899
2934
  Param["DataSourceId"] = "dataSourceId";
2900
2935
  Param["preAuthCache"] = "preAuthCache";
2901
2936
  Param["ShowSpotterLimitations"] = "showSpotterLimitations";
2937
+ Param["CoverAndFilterOptionInPDF"] = "coverAndFilterOptionInPDF";
2938
+ Param["PrimaryAction"] = "primaryAction";
2902
2939
  })(Param || (Param = {}));
2903
2940
  /**
2904
2941
  * ThoughtSpot application pages include actions and menu commands
@@ -3065,7 +3102,7 @@
3065
3102
  * The **Collapse data panel** icon on the Search page.
3066
3103
  * Collapses the data panel view.
3067
3104
  *
3068
- * @version: SDK: 1.34.0 | ThoughtSpot Cloud: 10.3.0.cl, 10.7.0.sw
3105
+ * @version: SDK: 1.34.0 | ThoughtSpot Cloud: 10.3.0.cl
3069
3106
  *
3070
3107
  * @example
3071
3108
  * ```js
@@ -4110,6 +4147,16 @@
4110
4147
  * @version SDK: 1.38.0 | ThoughtSpot Cloud: 10.8.0.cl
4111
4148
  */
4112
4149
  Action["ColumnRename"] = "columnRename";
4150
+ /**
4151
+ * Action ID for hide checkboxes for include or exclude
4152
+ * cover and filter pages in the Liveboard PDF
4153
+ * @example
4154
+ * ```js
4155
+ * hiddenAction: [Action.CoverAndFilterOptionInPDF]
4156
+ * ```
4157
+ * @version SDK: 1.38.0 | ThoughtSpot Cloud: 10.8.0.cl
4158
+ */
4159
+ Action["CoverAndFilterOptionInPDF"] = "coverAndFilterOptionInPDF";
4113
4160
  })(exports.Action || (exports.Action = {}));
4114
4161
  exports.PrefetchFeatures = void 0;
4115
4162
  (function (PrefetchFeatures) {
@@ -4119,8 +4166,8 @@
4119
4166
  PrefetchFeatures["VizEmbed"] = "VizEmbed";
4120
4167
  })(exports.PrefetchFeatures || (exports.PrefetchFeatures = {}));
4121
4168
  /**
4122
- * Enum for options to change context trigger
4123
- * BOTH_CLICKS option is introduced in 10.7
4169
+ * Enum for options to change context trigger.
4170
+ * The `BOTH_CLICKS` option is available from 10.8.0.cl.
4124
4171
  */
4125
4172
  exports.ContextMenuTriggerOptions = void 0;
4126
4173
  (function (ContextMenuTriggerOptions) {
@@ -15256,7 +15303,7 @@ mutation GetUnsavedAnswerTML($session: BachSessionIdInput!, $exportDependencies:
15256
15303
  return e;
15257
15304
  }
15258
15305
 
15259
- var name="@thoughtspot/visual-embed-sdk";var version$1="1.36.7";var description="ThoughtSpot Embed SDK";var module="lib/src/index.js";var main="dist/tsembed.js";var types="lib/src/index.d.ts";var files=["dist/**","lib/**","src/**","cjs/**"];var exports$1={".":{"import":"./lib/src/index.js",require:"./cjs/src/index.js",types:"./lib/src/index.d.ts"},"./react":{"import":"./lib/src/react/all-types-export.js",require:"./cjs/src/react/all-types-export.js",types:"./lib/src/react/all-types-export.d.ts"},"./lib/src/react":{"import":"./lib/src/react/all-types-export.js",require:"./cjs/src/react/all-types-export.js",types:"./lib/src/react/all-types-export.d.ts"}};var typesVersions={"*":{react:["./lib/src/react/all-types-export.d.ts"]}};var scripts={lint:"eslint 'src/**'","lint:fix":"eslint 'src/**/*.*' --fix",tsc:"tsc -p . --incremental false; tsc -p . --incremental false --module commonjs --outDir cjs","build-and-publish":"npm run build:gatsby && npm run publish","bundle-dts-file":"dts-bundle --name @thoughtspot/visual-embed-sdk --out visual-embed-sdk.d.ts --main lib/src/index.d.ts","bundle-dts":"dts-bundle --name ../../dist/visual-embed-sdk --main lib/src/index.d.ts --outputAsModuleFolder=true","bundle-dts-react":"dts-bundle --name ../../../dist/visual-embed-sdk-react --main lib/src/react/index.d.ts --outputAsModuleFolder=true","bundle-dts-react-full":"dts-bundle --name ../../../dist/visual-embed-sdk-react-full --main lib/src/react/all-types-export.d.ts --outputAsModuleFolder=true",build:"rollup -c",watch:"rollup -cw",docgen:"typedoc --tsconfig tsconfig.json --theme typedoc-theme --json static/typedoc/typedoc.json --disableOutputCheck","test-sdk":"jest -c jest.config.sdk.js --runInBand",test:"npm run test-sdk",posttest:"cat ./coverage/sdk/lcov.info | coveralls","is-publish-allowed":"node scripts/is-publish-allowed.js",prepublishOnly:"npm run is-publish-allowed && npm run test && npm run tsc && npm run bundle-dts-file && npm run bundle-dts && npm run bundle-dts-react && npm run bundle-dts-react-full && npm run build","check-size":"npm run build && size-limit","publish-dev":"npm publish --tag dev","publish-prod":"npm publish --tag latest",dev:"vite -c vite.local.config.ts"};var peerDependencies={react:"> 16.8.0","react-dom":"> 16.8.0"};var dependencies={algoliasearch:"^4.10.5",classnames:"^2.3.1",eventemitter3:"^4.0.7","gatsby-plugin-vercel":"^1.0.3",lodash:"^4.17.21","mixpanel-browser":"2.47.0","ts-deepmerge":"^6.0.2",tslib:"^2.5.3","use-deep-compare-effect":"^1.8.1",yaml:"^2.5.1"};var devDependencies={"@mdx-js/mdx":"^1.6.22","@mdx-js/react":"^1.6.22","@react-icons/all-files":"^4.1.0","@rollup/plugin-commonjs":"^18.0.0","@rollup/plugin-json":"^4.1.0","@rollup/plugin-node-resolve":"^11.2.1","@rollup/plugin-replace":"^5.0.2","@size-limit/preset-big-lib":"^8.2.6","@testing-library/dom":"^7.31.0","@testing-library/jest-dom":"^5.14.1","@testing-library/react":"^11.2.7","@testing-library/user-event":"^13.1.8","@types/jest":"^22.2.3","@types/lodash":"^4.17.0","@types/mixpanel-browser":"^2.35.6","@types/react-test-renderer":"^17.0.1","@typescript-eslint/eslint-plugin":"^4.6.0","@typescript-eslint/parser":"^4.6.0",asciidoctor:"^2.2.1","babel-jest":"^26.6.3","babel-preset-gatsby":"^1.10.0","command-line-args":"^5.1.1",coveralls:"^3.1.0",crypto:"^1.0.1","current-git-branch":"^1.1.0","dts-bundle":"^0.7.3",eslint:"^7.12.1","eslint-config-airbnb-base":"^14.2.0","eslint-config-prettier":"^6.15.0","eslint-import-resolver-typescript":"^2.3.0","eslint-plugin-import":"^2.22.1","eslint-plugin-prettier":"^3.1.4","eslint-plugin-react-hooks":"^4.2.0","eslint-plugin-comment-length":"1.7.3","eslint-plugin-jsdoc":"^46.9.0","fs-extra":"^10.0.0","gh-pages":"6.3.0","highlight.js":"^10.6.0","html-to-text":"^8.0.0","identity-obj-proxy":"^3.0.0","istanbul-merge":"^1.1.1",jest:"^26.6.3","jest-fetch-mock":"^3.0.3",jsdom:"^17.0.0","node-sass":"^8.0.0",prettier:"2.1.2",react:"^16.14.0","react-dom":"^16.14.0","react-resizable":"^1.11.0","react-resize-detector":"^6.6.0","react-test-renderer":"^17.0.2","react-use-flexsearch":"^0.1.1",rollup:"4.24.0","rollup-plugin-typescript2":"0.27.3","ts-jest":"^26.5.5","ts-loader":"8.0.4",typedoc:"0.21.6","typedoc-plugin-toc-group":"thoughtspot/typedoc-plugin-toc-group",typescript:"^4.9.4","url-search-params-polyfill":"^8.1.0",util:"^0.12.4",vite:"^5.3.4"};var author="ThoughtSpot";var email="support@thoughtspot.com";var license="ThoughtSpot Development Tools End User License Agreement";var directories={lib:"lib"};var repository={type:"git",url:"git+https://github.com/thoughtspot/visual-embed-sdk.git"};var publishConfig={registry:"https://registry.npmjs.org"};var keywords=["thoughtspot","everywhere","embedded","embed","sdk","analytics"];var bugs={url:"https://github.com/thoughtspot/visual-embed-sdk/issues"};var homepage="https://github.com/thoughtspot/visual-embed-sdk#readme";var globals={window:{}};var pkgInfo = {name:name,version:version$1,description:description,module:module,main:main,types:types,files:files,exports:exports$1,typesVersions:typesVersions,"size-limit":[{path:"dist/tsembed.es.js",limit:"31 kB"}],scripts:scripts,peerDependencies:peerDependencies,dependencies:dependencies,devDependencies:devDependencies,author:author,email:email,license:license,directories:directories,repository:repository,publishConfig:publishConfig,keywords:keywords,bugs:bugs,homepage:homepage,globals:globals};
15306
+ var name="@thoughtspot/visual-embed-sdk";var version$1="1.36.9-PA";var description="ThoughtSpot Embed SDK";var module="lib/src/index.js";var main="dist/tsembed.js";var types="lib/src/index.d.ts";var files=["dist/**","lib/**","src/**","cjs/**"];var exports$1={".":{"import":"./lib/src/index.js",require:"./cjs/src/index.js",types:"./lib/src/index.d.ts"},"./react":{"import":"./lib/src/react/all-types-export.js",require:"./cjs/src/react/all-types-export.js",types:"./lib/src/react/all-types-export.d.ts"},"./lib/src/react":{"import":"./lib/src/react/all-types-export.js",require:"./cjs/src/react/all-types-export.js",types:"./lib/src/react/all-types-export.d.ts"}};var typesVersions={"*":{react:["./lib/src/react/all-types-export.d.ts"]}};var scripts={lint:"eslint 'src/**'","lint:fix":"eslint 'src/**/*.*' --fix",tsc:"tsc -p . --incremental false; tsc -p . --incremental false --module commonjs --outDir cjs","build-and-publish":"npm run build:gatsby && npm run publish","bundle-dts-file":"dts-bundle --name @thoughtspot/visual-embed-sdk --out visual-embed-sdk.d.ts --main lib/src/index.d.ts","bundle-dts":"dts-bundle --name ../../dist/visual-embed-sdk --main lib/src/index.d.ts --outputAsModuleFolder=true","bundle-dts-react":"dts-bundle --name ../../../dist/visual-embed-sdk-react --main lib/src/react/index.d.ts --outputAsModuleFolder=true","bundle-dts-react-full":"dts-bundle --name ../../../dist/visual-embed-sdk-react-full --main lib/src/react/all-types-export.d.ts --outputAsModuleFolder=true",build:"rollup -c",watch:"rollup -cw",docgen:"typedoc --tsconfig tsconfig.json --theme typedoc-theme --json static/typedoc/typedoc.json --disableOutputCheck","test-sdk":"jest -c jest.config.sdk.js --runInBand",test:"npm run test-sdk",posttest:"cat ./coverage/sdk/lcov.info | coveralls","is-publish-allowed":"node scripts/is-publish-allowed.js",prepublishOnly:"npm run 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:"^18.3.1","react-dom":"^18.3.1"};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":"^8.2.6","@testing-library/dom":"^7.31.0","@testing-library/jest-dom":"^5.14.1","@testing-library/react":"^11.2.7","@testing-library/user-event":"^13.1.8","@types/jest":"^22.2.3","@types/lodash":"^4.17.0","@types/mixpanel-browser":"^2.35.6","@types/react-test-renderer":"^17.0.1","@typescript-eslint/eslint-plugin":"^8.28.0","@typescript-eslint/parser":"^8.28.0",asciidoctor:"^2.2.1","babel-jest":"^26.6.3","babel-preset-gatsby":"^1.10.0","command-line-args":"^5.1.1",coveralls:"^3.1.0",crypto:"^1.0.1","current-git-branch":"^1.1.0","dts-bundle":"^0.7.3",eslint:"^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":"^1.1.1",jest:"^26.6.3","jest-fetch-mock":"^3.0.3",jsdom:"^17.0.0",prettier:"2.1.2",react:"^18.3.1","react-dom":"^18.3.1","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:"^5.3.4","@types/react":"^18.2.37","@types/react-dom":"^18.2.15"};var author="ThoughtSpot";var email="support@thoughtspot.com";var license="ThoughtSpot Development Tools End User License Agreement";var directories={lib:"lib"};var repository={type:"git",url:"git+https://github.com/thoughtspot/visual-embed-sdk.git"};var publishConfig={registry:"https://registry.npmjs.org"};var keywords=["thoughtspot","everywhere","embedded","embed","sdk","analytics"];var bugs={url:"https://github.com/thoughtspot/visual-embed-sdk/issues"};var homepage="https://github.com/thoughtspot/visual-embed-sdk#readme";var globals={window:{}};var pkgInfo = {name:name,version:version$1,description:description,module:module,main:main,types:types,files:files,exports:exports$1,typesVersions:typesVersions,"size-limit":[{path:"dist/tsembed.es.js",limit:"31 kB"}],scripts:scripts,peerDependencies:peerDependencies,dependencies:dependencies,devDependencies:devDependencies,author:author,email:email,license:license,directories:directories,repository:repository,publishConfig:publishConfig,keywords:keywords,bugs:bugs,homepage:homepage,globals:globals};
15260
15307
 
15261
15308
  /**
15262
15309
  * Reloads the ThoughtSpot iframe.
@@ -15730,6 +15777,7 @@ mutation GetUnsavedAnswerTML($session: BachSessionIdInput!, $exportDependencies:
15730
15777
  ? (_b = this.viewConfig) === null || _b === void 0 ? void 0 : _b.hiddenHomeLeftNavItems
15731
15778
  : [],
15732
15779
  customVariablesForThirdPartyTools: this.embedConfig.customVariablesForThirdPartyTools || {},
15780
+ hiddenListColumns: this.viewConfig.hiddenListColumns || [],
15733
15781
  };
15734
15782
  }
15735
15783
  async getAppInitData() {
@@ -15755,7 +15803,7 @@ mutation GetUnsavedAnswerTML($session: BachSessionIdInput!, $exportDependencies:
15755
15803
  * @returns queryParams
15756
15804
  */
15757
15805
  getBaseQueryParams(queryParams = {}) {
15758
- var _a, _b;
15806
+ var _a, _b, _c, _d;
15759
15807
  let hostAppUrl = ((_a = window === null || window === void 0 ? void 0 : window.location) === null || _a === void 0 ? void 0 : _a.host) || '';
15760
15808
  // The below check is needed because TS Cloud firewall, blocks
15761
15809
  // localhost/127.0.0.1 in any url param.
@@ -15792,7 +15840,7 @@ mutation GetUnsavedAnswerTML($session: BachSessionIdInput!, $exportDependencies:
15792
15840
  if (this.embedConfig.currencyFormat) {
15793
15841
  queryParams[Param.CurrencyFormat] = this.embedConfig.currencyFormat;
15794
15842
  }
15795
- const { disabledActions, disabledActionReason, hiddenActions, visibleActions, hiddenTabs, visibleTabs, showAlerts, additionalFlags: additionalFlagsFromView, locale, customizations, contextMenuTrigger, linkOverride, insertInToSlide, disableRedirectionLinksInNewTab, overrideOrgId, } = this.viewConfig;
15843
+ const { disabledActions, disabledActionReason, hiddenActions, visibleActions, hiddenTabs, visibleTabs, showAlerts, additionalFlags: additionalFlagsFromView, locale, customizations, contextMenuTrigger, linkOverride, insertInToSlide, disableRedirectionLinksInNewTab, overrideOrgId, exposeTranslationIDs, primaryAction, } = this.viewConfig;
15796
15844
  const { additionalFlags: additionalFlagsFromInit } = this.embedConfig;
15797
15845
  const additionalFlags = {
15798
15846
  ...additionalFlagsFromInit,
@@ -15806,12 +15854,18 @@ mutation GetUnsavedAnswerTML($session: BachSessionIdInput!, $exportDependencies:
15806
15854
  this.handleError('You cannot have both hidden Tabs and visible Tabs');
15807
15855
  return queryParams;
15808
15856
  }
15857
+ if (primaryAction) {
15858
+ queryParams[Param.PrimaryAction] = primaryAction;
15859
+ }
15809
15860
  if (disabledActions === null || disabledActions === void 0 ? void 0 : disabledActions.length) {
15810
15861
  queryParams[Param.DisableActions] = disabledActions;
15811
15862
  }
15812
15863
  if (disabledActionReason) {
15813
15864
  queryParams[Param.DisableActionReason] = disabledActionReason;
15814
15865
  }
15866
+ if (exposeTranslationIDs) {
15867
+ queryParams[Param.ExposeTranslationIDs] = exposeTranslationIDs;
15868
+ }
15815
15869
  queryParams[Param.HideActions] = [...this.defaultHiddenActions, ...(hiddenActions !== null && hiddenActions !== void 0 ? hiddenActions : [])];
15816
15870
  if (Array.isArray(visibleActions)) {
15817
15871
  queryParams[Param.VisibleActions] = visibleActions;
@@ -15841,6 +15895,11 @@ mutation GetUnsavedAnswerTML($session: BachSessionIdInput!, $exportDependencies:
15841
15895
  if (spriteUrl) {
15842
15896
  queryParams[Param.IconSpriteUrl] = spriteUrl.replace('https://', '');
15843
15897
  }
15898
+ const stringIDsUrl = ((_c = customizations === null || customizations === void 0 ? void 0 : customizations.content) === null || _c === void 0 ? void 0 : _c.stringIDsUrl)
15899
+ || ((_d = embedCustomizations === null || embedCustomizations === void 0 ? void 0 : embedCustomizations.content) === null || _d === void 0 ? void 0 : _d.stringIDsUrl);
15900
+ if (stringIDsUrl) {
15901
+ queryParams[Param.StringIDsUrl] = stringIDsUrl;
15902
+ }
15844
15903
  if (showAlerts !== undefined) {
15845
15904
  queryParams[Param.ShowAlerts] = showAlerts;
15846
15905
  }
@@ -16994,7 +17053,7 @@ query GetEurekaVizSnapshots(
16994
17053
  getEmbedParams() {
16995
17054
  let params = {};
16996
17055
  params = this.getBaseQueryParams(params);
16997
- 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 = false, enableCustomColumnGroups = false, oAuthPollingInterval, isForceRedirect, dataSourceId, } = this.viewConfig;
17056
+ 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 = false, enableCustomColumnGroups = false, oAuthPollingInterval, isForceRedirect, dataSourceId, coverAndFilterOptionInPDF, } = this.viewConfig;
16998
17057
  const preventLiveboardFilterRemoval = this.viewConfig.preventLiveboardFilterRemoval
16999
17058
  || this.viewConfig.preventPinboardFilterRemoval;
17000
17059
  if (fullHeight === true) {
@@ -17046,6 +17105,9 @@ query GetEurekaVizSnapshots(
17046
17105
  if (dataSourceId !== undefined) {
17047
17106
  params[Param.DataSourceId] = dataSourceId;
17048
17107
  }
17108
+ if (coverAndFilterOptionInPDF !== undefined) {
17109
+ params[Param.CoverAndFilterOptionInPDF] = coverAndFilterOptionInPDF;
17110
+ }
17049
17111
  params[Param.LiveboardHeaderSticky] = isLiveboardHeaderSticky;
17050
17112
  params[Param.LiveboardHeaderV2] = isLiveboardCompactHeaderEnabled;
17051
17113
  params[Param.ShowLiveboardVerifiedBadge] = showLiveboardVerifiedBadge;
@@ -17900,7 +17962,7 @@ query SendMessage($params: Input_convassist_SendMessageRequest) {
17900
17962
  acGenNo: data.stateKey.generationNumber,
17901
17963
  });
17902
17964
  await embed.render();
17903
- return { container };
17965
+ return { container, viz: embed };
17904
17966
  }
17905
17967
  }
17906
17968
 
@@ -19920,23 +19982,32 @@ query GetEurekaResults($params: Input_eureka_SearchRequest) {
19920
19982
  start = start.replace(/\n+/g, `$&${indent}`);
19921
19983
  }
19922
19984
  const indentSize = indent ? '2' : '1'; // root is at -1
19923
- let header = (literal ? '|' : '>') + (startWithSpace ? indentSize : '') + chomp;
19985
+ // Leading | or > is added later
19986
+ let header = (startWithSpace ? indentSize : '') + chomp;
19924
19987
  if (comment) {
19925
19988
  header += ' ' + commentString(comment.replace(/ ?[\r\n]+/g, ' '));
19926
19989
  if (onComment)
19927
19990
  onComment();
19928
19991
  }
19929
- if (literal) {
19930
- value = value.replace(/\n+/g, `$&${indent}`);
19931
- return `${header}\n${indent}${start}${value}${end}`;
19992
+ if (!literal) {
19993
+ const foldedValue = value
19994
+ .replace(/\n+/g, '\n$&')
19995
+ .replace(/(?:^|\n)([\t ].*)(?:([\n\t ]*)\n(?![\n\t ]))?/g, '$1$2') // more-indented lines aren't folded
19996
+ // ^ more-ind. ^ empty ^ capture next empty lines only at end of indent
19997
+ .replace(/\n+/g, `$&${indent}`);
19998
+ let literalFallback = false;
19999
+ const foldOptions = getFoldOptions(ctx, true);
20000
+ if (blockQuote !== 'folded' && type !== Scalar.BLOCK_FOLDED) {
20001
+ foldOptions.onOverflow = () => {
20002
+ literalFallback = true;
20003
+ };
20004
+ }
20005
+ const body = foldFlowLines(`${start}${foldedValue}${end}`, indent, FOLD_BLOCK, foldOptions);
20006
+ if (!literalFallback)
20007
+ return `>${header}\n${indent}${body}`;
19932
20008
  }
19933
- value = value
19934
- .replace(/\n+/g, '\n$&')
19935
- .replace(/(?:^|\n)([\t ].*)(?:([\n\t ]*)\n(?![\n\t ]))?/g, '$1$2') // more-indented lines aren't folded
19936
- // ^ more-ind. ^ empty ^ capture next empty lines only at end of indent
19937
- .replace(/\n+/g, `$&${indent}`);
19938
- const body = foldFlowLines(`${start}${value}${end}`, indent, FOLD_BLOCK, getFoldOptions(ctx, true));
19939
- return `${header}\n${indent}${body}`;
20009
+ value = value.replace(/\n+/g, `$&${indent}`);
20010
+ return `|${header}\n${indent}${start}${value}${end}`;
19940
20011
  }
19941
20012
  function plainString(item, ctx, onComment, onChompKeep) {
19942
20013
  const { type, value } = item;
@@ -20077,7 +20148,12 @@ query GetEurekaResults($params: Input_eureka_SearchRequest) {
20077
20148
  let obj;
20078
20149
  if (isScalar$1(item)) {
20079
20150
  obj = item.value;
20080
- const match = tags.filter(t => t.identify?.(obj));
20151
+ let match = tags.filter(t => t.identify?.(obj));
20152
+ if (match.length > 1) {
20153
+ const testMatch = match.filter(t => t.test);
20154
+ if (testMatch.length > 0)
20155
+ match = testMatch;
20156
+ }
20081
20157
  tagObj =
20082
20158
  match.find(t => t.format === item.format) ?? match.find(t => !t.format);
20083
20159
  }
@@ -20290,54 +20366,10 @@ query GetEurekaResults($params: Input_eureka_SearchRequest) {
20290
20366
 
20291
20367
  function warn(logLevel, warning) {
20292
20368
  if (logLevel === 'debug' || logLevel === 'warn') {
20293
- if (typeof process !== 'undefined' && process.emitWarning)
20294
- process.emitWarning(warning);
20295
- else
20296
- console.warn(warning);
20369
+ console.warn(warning);
20297
20370
  }
20298
20371
  }
20299
20372
 
20300
- const MERGE_KEY = '<<';
20301
- function addPairToJSMap(ctx, map, { key, value }) {
20302
- if (ctx?.doc.schema.merge && isMergeKey(key)) {
20303
- value = isAlias(value) ? value.resolve(ctx.doc) : value;
20304
- if (isSeq(value))
20305
- for (const it of value.items)
20306
- mergeToJSMap(ctx, map, it);
20307
- else if (Array.isArray(value))
20308
- for (const it of value)
20309
- mergeToJSMap(ctx, map, it);
20310
- else
20311
- mergeToJSMap(ctx, map, value);
20312
- }
20313
- else {
20314
- const jsKey = toJS(key, '', ctx);
20315
- if (map instanceof Map) {
20316
- map.set(jsKey, toJS(value, jsKey, ctx));
20317
- }
20318
- else if (map instanceof Set) {
20319
- map.add(jsKey);
20320
- }
20321
- else {
20322
- const stringKey = stringifyKey(key, jsKey, ctx);
20323
- const jsValue = toJS(value, stringKey, ctx);
20324
- if (stringKey in map)
20325
- Object.defineProperty(map, stringKey, {
20326
- value: jsValue,
20327
- writable: true,
20328
- enumerable: true,
20329
- configurable: true
20330
- });
20331
- else
20332
- map[stringKey] = jsValue;
20333
- }
20334
- }
20335
- return map;
20336
- }
20337
- const isMergeKey = (key) => key === MERGE_KEY ||
20338
- (isScalar$1(key) &&
20339
- key.value === MERGE_KEY &&
20340
- (!key.type || key.type === Scalar.PLAIN));
20341
20373
  // If the value associated with a merge key is a single mapping node, each of
20342
20374
  // its key/value pairs is inserted into the current mapping, unless the key
20343
20375
  // already exists in it. If the value associated with the merge key is a
@@ -20345,7 +20377,35 @@ query GetEurekaResults($params: Input_eureka_SearchRequest) {
20345
20377
  // of these nodes is merged in turn according to its order in the sequence.
20346
20378
  // Keys in mapping nodes earlier in the sequence override keys specified in
20347
20379
  // later mapping nodes. -- http://yaml.org/type/merge.html
20348
- function mergeToJSMap(ctx, map, value) {
20380
+ const MERGE_KEY = '<<';
20381
+ const merge = {
20382
+ identify: value => value === MERGE_KEY ||
20383
+ (typeof value === 'symbol' && value.description === MERGE_KEY),
20384
+ default: 'key',
20385
+ tag: 'tag:yaml.org,2002:merge',
20386
+ test: /^<<$/,
20387
+ resolve: () => Object.assign(new Scalar(Symbol(MERGE_KEY)), {
20388
+ addToJSMap: addMergeToJSMap
20389
+ }),
20390
+ stringify: () => MERGE_KEY
20391
+ };
20392
+ const isMergeKey = (ctx, key) => (merge.identify(key) ||
20393
+ (isScalar$1(key) &&
20394
+ (!key.type || key.type === Scalar.PLAIN) &&
20395
+ merge.identify(key.value))) &&
20396
+ ctx?.doc.schema.tags.some(tag => tag.tag === merge.tag && tag.default);
20397
+ function addMergeToJSMap(ctx, map, value) {
20398
+ value = ctx && isAlias(value) ? value.resolve(ctx.doc) : value;
20399
+ if (isSeq(value))
20400
+ for (const it of value.items)
20401
+ mergeValue(ctx, map, it);
20402
+ else if (Array.isArray(value))
20403
+ for (const it of value)
20404
+ mergeValue(ctx, map, it);
20405
+ else
20406
+ mergeValue(ctx, map, value);
20407
+ }
20408
+ function mergeValue(ctx, map, value) {
20349
20409
  const source = ctx && isAlias(value) ? value.resolve(ctx.doc) : value;
20350
20410
  if (!isMap(source))
20351
20411
  throw new Error('Merge sources must be maps or map aliases');
@@ -20369,6 +20429,37 @@ query GetEurekaResults($params: Input_eureka_SearchRequest) {
20369
20429
  }
20370
20430
  return map;
20371
20431
  }
20432
+
20433
+ function addPairToJSMap(ctx, map, { key, value }) {
20434
+ if (isNode(key) && key.addToJSMap)
20435
+ key.addToJSMap(ctx, map, value);
20436
+ // TODO: Should drop this special case for bare << handling
20437
+ else if (isMergeKey(ctx, key))
20438
+ addMergeToJSMap(ctx, map, value);
20439
+ else {
20440
+ const jsKey = toJS(key, '', ctx);
20441
+ if (map instanceof Map) {
20442
+ map.set(jsKey, toJS(value, jsKey, ctx));
20443
+ }
20444
+ else if (map instanceof Set) {
20445
+ map.add(jsKey);
20446
+ }
20447
+ else {
20448
+ const stringKey = stringifyKey(key, jsKey, ctx);
20449
+ const jsValue = toJS(value, stringKey, ctx);
20450
+ if (stringKey in map)
20451
+ Object.defineProperty(map, stringKey, {
20452
+ value: jsValue,
20453
+ writable: true,
20454
+ enumerable: true,
20455
+ configurable: true
20456
+ });
20457
+ else
20458
+ map[stringKey] = jsValue;
20459
+ }
20460
+ }
20461
+ return map;
20462
+ }
20372
20463
  function stringifyKey(key, jsKey, ctx) {
20373
20464
  if (jsKey === null)
20374
20465
  return '';
@@ -21004,7 +21095,7 @@ query GetEurekaResults($params: Input_eureka_SearchRequest) {
21004
21095
  identify: value => typeof value === 'boolean',
21005
21096
  default: true,
21006
21097
  tag: 'tag:yaml.org,2002:bool',
21007
- test: /^true|false$/,
21098
+ test: /^true$|^false$/,
21008
21099
  resolve: str => str === 'true',
21009
21100
  stringify: stringifyJSON
21010
21101
  },
@@ -21049,10 +21140,7 @@ query GetEurekaResults($params: Input_eureka_SearchRequest) {
21049
21140
  * document.querySelector('#photo').src = URL.createObjectURL(blob)
21050
21141
  */
21051
21142
  resolve(src, onError) {
21052
- if (typeof Buffer === 'function') {
21053
- return Buffer.from(src, 'base64');
21054
- }
21055
- else if (typeof atob === 'function') {
21143
+ if (typeof atob === 'function') {
21056
21144
  // On IE 11, atob() can't handle newlines
21057
21145
  const str = atob(src.replace(/[\n\r]/g, ''));
21058
21146
  const buffer = new Uint8Array(str.length);
@@ -21066,15 +21154,11 @@ query GetEurekaResults($params: Input_eureka_SearchRequest) {
21066
21154
  }
21067
21155
  },
21068
21156
  stringify({ comment, type, value }, ctx, onComment, onChompKeep) {
21157
+ if (!value)
21158
+ return '';
21069
21159
  const buf = value; // checked earlier by binary.identify()
21070
21160
  let str;
21071
- if (typeof Buffer === 'function') {
21072
- str =
21073
- buf instanceof Buffer
21074
- ? buf.toString('base64')
21075
- : Buffer.from(buf.buffer).toString('base64');
21076
- }
21077
- else if (typeof btoa === 'function') {
21161
+ if (typeof btoa === 'function') {
21078
21162
  let s = '';
21079
21163
  for (let i = 0; i < buf.length; ++i)
21080
21164
  s += String.fromCharCode(buf[i]);
@@ -21553,7 +21637,7 @@ query GetEurekaResults($params: Input_eureka_SearchRequest) {
21553
21637
  }
21554
21638
  return new Date(date);
21555
21639
  },
21556
- stringify: ({ value }) => value.toISOString().replace(/((T00:00)?:00)?\.000Z$/, '')
21640
+ stringify: ({ value }) => value?.toISOString().replace(/(T00:00:00)?\.000Z$/, '') ?? ''
21557
21641
  };
21558
21642
 
21559
21643
  const schema = [
@@ -21571,6 +21655,7 @@ query GetEurekaResults($params: Input_eureka_SearchRequest) {
21571
21655
  floatExp,
21572
21656
  float,
21573
21657
  binary,
21658
+ merge,
21574
21659
  omap,
21575
21660
  pairs,
21576
21661
  set,
@@ -21598,6 +21683,7 @@ query GetEurekaResults($params: Input_eureka_SearchRequest) {
21598
21683
  intOct: intOct$1,
21599
21684
  intTime,
21600
21685
  map,
21686
+ merge,
21601
21687
  null: nullTag,
21602
21688
  omap,
21603
21689
  pairs,
@@ -21607,13 +21693,20 @@ query GetEurekaResults($params: Input_eureka_SearchRequest) {
21607
21693
  };
21608
21694
  const coreKnownTags = {
21609
21695
  'tag:yaml.org,2002:binary': binary,
21696
+ 'tag:yaml.org,2002:merge': merge,
21610
21697
  'tag:yaml.org,2002:omap': omap,
21611
21698
  'tag:yaml.org,2002:pairs': pairs,
21612
21699
  'tag:yaml.org,2002:set': set,
21613
21700
  'tag:yaml.org,2002:timestamp': timestamp
21614
21701
  };
21615
- function getTags(customTags, schemaName) {
21616
- let tags = schemas.get(schemaName);
21702
+ function getTags(customTags, schemaName, addMergeTag) {
21703
+ const schemaTags = schemas.get(schemaName);
21704
+ if (schemaTags && !customTags) {
21705
+ return addMergeTag && !schemaTags.includes(merge)
21706
+ ? schemaTags.concat(merge)
21707
+ : schemaTags.slice();
21708
+ }
21709
+ let tags = schemaTags;
21617
21710
  if (!tags) {
21618
21711
  if (Array.isArray(customTags))
21619
21712
  tags = [];
@@ -21632,17 +21725,21 @@ query GetEurekaResults($params: Input_eureka_SearchRequest) {
21632
21725
  else if (typeof customTags === 'function') {
21633
21726
  tags = customTags(tags.slice());
21634
21727
  }
21635
- return tags.map(tag => {
21636
- if (typeof tag !== 'string')
21637
- return tag;
21638
- const tagObj = tagsByName[tag];
21639
- if (tagObj)
21640
- return tagObj;
21641
- const keys = Object.keys(tagsByName)
21642
- .map(key => JSON.stringify(key))
21643
- .join(', ');
21644
- throw new Error(`Unknown custom tag "${tag}"; use one of ${keys}`);
21645
- });
21728
+ if (addMergeTag)
21729
+ tags = tags.concat(merge);
21730
+ return tags.reduce((tags, tag) => {
21731
+ const tagObj = typeof tag === 'string' ? tagsByName[tag] : tag;
21732
+ if (!tagObj) {
21733
+ const tagName = JSON.stringify(tag);
21734
+ const keys = Object.keys(tagsByName)
21735
+ .map(key => JSON.stringify(key))
21736
+ .join(', ');
21737
+ throw new Error(`Unknown custom tag ${tagName}; use one of ${keys}`);
21738
+ }
21739
+ if (!tags.includes(tagObj))
21740
+ tags.push(tagObj);
21741
+ return tags;
21742
+ }, []);
21646
21743
  }
21647
21744
 
21648
21745
  const sortMapEntriesByKey = (a, b) => a.key < b.key ? -1 : a.key > b.key ? 1 : 0;
@@ -21653,10 +21750,9 @@ query GetEurekaResults($params: Input_eureka_SearchRequest) {
21653
21750
  : compat
21654
21751
  ? getTags(null, compat)
21655
21752
  : null;
21656
- this.merge = !!merge;
21657
21753
  this.name = (typeof schema === 'string' && schema) || 'core';
21658
21754
  this.knownTags = resolveKnownTags ? coreKnownTags : {};
21659
- this.tags = getTags(customTags, this.name);
21755
+ this.tags = getTags(customTags, this.name, merge);
21660
21756
  this.toStringOptions = toStringDefaults ?? null;
21661
21757
  Object.defineProperty(this, MAP, { value: map });
21662
21758
  Object.defineProperty(this, SCALAR$1, { value: string });
@@ -21781,6 +21877,7 @@ query GetEurekaResults($params: Input_eureka_SearchRequest) {
21781
21877
  logLevel: 'warn',
21782
21878
  prettyErrors: true,
21783
21879
  strict: true,
21880
+ stringKeys: false,
21784
21881
  uniqueKeys: true,
21785
21882
  version: '1.2'
21786
21883
  }, options);
@@ -22004,7 +22101,7 @@ query GetEurekaResults($params: Input_eureka_SearchRequest) {
22004
22101
  this.directives.yaml.version = '1.1';
22005
22102
  else
22006
22103
  this.directives = new Directives({ version: '1.1' });
22007
- opt = { merge: true, resolveKnownTags: false, schema: 'yaml-1.1' };
22104
+ opt = { resolveKnownTags: false, schema: 'yaml-1.1' };
22008
22105
  break;
22009
22106
  case '1.2':
22010
22107
  case 'next':
@@ -22012,7 +22109,7 @@ query GetEurekaResults($params: Input_eureka_SearchRequest) {
22012
22109
  this.directives.yaml.version = version;
22013
22110
  else
22014
22111
  this.directives = new Directives({ version });
22015
- opt = { merge: false, resolveKnownTags: true, schema: 'core' };
22112
+ opt = { resolveKnownTags: true, schema: 'core' };
22016
22113
  break;
22017
22114
  case null:
22018
22115
  if (this.directives)
@@ -22190,7 +22287,7 @@ query GetEurekaResults($params: Input_eureka_SearchRequest) {
22190
22287
  if (atNewline) {
22191
22288
  if (comment)
22192
22289
  comment += token.source;
22193
- else
22290
+ else if (!found || indicator !== 'seq-item-ind')
22194
22291
  spaceBefore = true;
22195
22292
  }
22196
22293
  else
@@ -22331,11 +22428,7 @@ query GetEurekaResults($params: Input_eureka_SearchRequest) {
22331
22428
  return false;
22332
22429
  const isEqual = typeof uniqueKeys === 'function'
22333
22430
  ? uniqueKeys
22334
- : (a, b) => a === b ||
22335
- (isScalar$1(a) &&
22336
- isScalar$1(b) &&
22337
- a.value === b.value &&
22338
- !(a.value === '<<' && ctx.schema.merge));
22431
+ : (a, b) => a === b || (isScalar$1(a) && isScalar$1(b) && a.value === b.value);
22339
22432
  return items.some(pair => isEqual(pair.key, search));
22340
22433
  }
22341
22434
 
@@ -22384,12 +22477,14 @@ query GetEurekaResults($params: Input_eureka_SearchRequest) {
22384
22477
  onError(offset, 'BAD_INDENT', startColMsg);
22385
22478
  }
22386
22479
  // key value
22480
+ ctx.atKey = true;
22387
22481
  const keyStart = keyProps.end;
22388
22482
  const keyNode = key
22389
22483
  ? composeNode(ctx, key, keyProps, onError)
22390
22484
  : composeEmptyNode(ctx, keyStart, start, null, keyProps, onError);
22391
22485
  if (ctx.schema.compat)
22392
22486
  flowIndentCheck(bm.indent, key, onError);
22487
+ ctx.atKey = false;
22393
22488
  if (mapIncludes(ctx, map.items, keyNode))
22394
22489
  onError(keyStart, 'DUPLICATE_KEY', 'Map keys must be unique');
22395
22490
  // value properties
@@ -22449,6 +22544,8 @@ query GetEurekaResults($params: Input_eureka_SearchRequest) {
22449
22544
  const seq = new NodeClass(ctx.schema);
22450
22545
  if (ctx.atRoot)
22451
22546
  ctx.atRoot = false;
22547
+ if (ctx.atKey)
22548
+ ctx.atKey = false;
22452
22549
  let offset = bs.offset;
22453
22550
  let commentEnd = null;
22454
22551
  for (const { start, value } of bs.items) {
@@ -22533,6 +22630,8 @@ query GetEurekaResults($params: Input_eureka_SearchRequest) {
22533
22630
  const atRoot = ctx.atRoot;
22534
22631
  if (atRoot)
22535
22632
  ctx.atRoot = false;
22633
+ if (ctx.atKey)
22634
+ ctx.atKey = false;
22536
22635
  let offset = fc.offset + fc.start.source.length;
22537
22636
  for (let i = 0; i < fc.items.length; ++i) {
22538
22637
  const collItem = fc.items[i];
@@ -22612,12 +22711,14 @@ query GetEurekaResults($params: Input_eureka_SearchRequest) {
22612
22711
  else {
22613
22712
  // item is a key+value pair
22614
22713
  // key value
22714
+ ctx.atKey = true;
22615
22715
  const keyStart = props.end;
22616
22716
  const keyNode = key
22617
22717
  ? composeNode(ctx, key, props, onError)
22618
22718
  : composeEmptyNode(ctx, keyStart, start, null, props, onError);
22619
22719
  if (isBlock(key))
22620
22720
  onError(keyNode.range, 'BLOCK_IN_FLOW', blockMsg);
22721
+ ctx.atKey = false;
22621
22722
  // value properties
22622
22723
  const valueProps = resolveProps(sep ?? [], {
22623
22724
  flow: fcName,
@@ -22773,8 +22874,8 @@ query GetEurekaResults($params: Input_eureka_SearchRequest) {
22773
22874
  tag = kt;
22774
22875
  }
22775
22876
  else {
22776
- if (kt?.collection) {
22777
- onError(tagToken, 'BAD_COLLECTION_TYPE', `${kt.tag} used for ${expType} collection, but expects ${kt.collection}`, true);
22877
+ if (kt) {
22878
+ onError(tagToken, 'BAD_COLLECTION_TYPE', `${kt.tag} used for ${expType} collection, but expects ${kt.collection ?? 'scalar'}`, true);
22778
22879
  }
22779
22880
  else {
22780
22881
  onError(tagToken, 'TAG_RESOLVE_FAILED', `Unresolved tag: ${tagName}`, true);
@@ -23215,11 +23316,16 @@ query GetEurekaResults($params: Input_eureka_SearchRequest) {
23215
23316
  const tagName = tagToken
23216
23317
  ? ctx.directives.tagName(tagToken.source, msg => onError(tagToken, 'TAG_RESOLVE_FAILED', msg))
23217
23318
  : null;
23218
- const tag = tagToken && tagName
23219
- ? findScalarTagByName(ctx.schema, value, tagName, tagToken, onError)
23220
- : token.type === 'scalar'
23221
- ? findScalarTagByTest(ctx, value, token, onError)
23222
- : ctx.schema[SCALAR$1];
23319
+ let tag;
23320
+ if (ctx.options.stringKeys && ctx.atKey) {
23321
+ tag = ctx.schema[SCALAR$1];
23322
+ }
23323
+ else if (tagName)
23324
+ tag = findScalarTagByName(ctx.schema, value, tagName, tagToken, onError);
23325
+ else if (token.type === 'scalar')
23326
+ tag = findScalarTagByTest(ctx, value, token, onError);
23327
+ else
23328
+ tag = ctx.schema[SCALAR$1];
23223
23329
  let scalar;
23224
23330
  try {
23225
23331
  const res = tag.resolve(value, msg => onError(tagToken ?? token, 'TAG_RESOLVE_FAILED', msg), ctx.options);
@@ -23267,8 +23373,9 @@ query GetEurekaResults($params: Input_eureka_SearchRequest) {
23267
23373
  onError(tagToken, 'TAG_RESOLVE_FAILED', `Unresolved tag: ${tagName}`, tagName !== 'tag:yaml.org,2002:str');
23268
23374
  return schema[SCALAR$1];
23269
23375
  }
23270
- function findScalarTagByTest({ directives, schema }, value, token, onError) {
23271
- const tag = schema.tags.find(tag => tag.default && tag.test?.test(value)) || schema[SCALAR$1];
23376
+ function findScalarTagByTest({ atKey, directives, schema }, value, token, onError) {
23377
+ const tag = schema.tags.find(tag => (tag.default === true || (atKey && tag.default === 'key')) &&
23378
+ tag.test?.test(value)) || schema[SCALAR$1];
23272
23379
  if (schema.compat) {
23273
23380
  const compat = schema.compat.find(tag => tag.default && tag.test?.test(value)) ??
23274
23381
  schema[SCALAR$1];
@@ -23310,6 +23417,7 @@ query GetEurekaResults($params: Input_eureka_SearchRequest) {
23310
23417
 
23311
23418
  const CN = { composeNode, composeEmptyNode };
23312
23419
  function composeNode(ctx, token, props, onError) {
23420
+ const atKey = ctx.atKey;
23313
23421
  const { spaceBefore, comment, anchor, tag } = props;
23314
23422
  let node;
23315
23423
  let isSrcToken = true;
@@ -23345,6 +23453,14 @@ query GetEurekaResults($params: Input_eureka_SearchRequest) {
23345
23453
  }
23346
23454
  if (anchor && node.anchor === '')
23347
23455
  onError(anchor, 'BAD_ALIAS', 'Anchor cannot be an empty string');
23456
+ if (atKey &&
23457
+ ctx.options.stringKeys &&
23458
+ (!isScalar$1(node) ||
23459
+ typeof node.value !== 'string' ||
23460
+ (node.tag && node.tag !== 'tag:yaml.org,2002:str'))) {
23461
+ const msg = 'With stringKeys, all keys must be strings';
23462
+ onError(tag ?? token, 'NON_STRING_KEY', msg);
23463
+ }
23348
23464
  if (spaceBefore)
23349
23465
  node.spaceBefore = true;
23350
23466
  if (comment) {
@@ -23397,6 +23513,7 @@ query GetEurekaResults($params: Input_eureka_SearchRequest) {
23397
23513
  const opts = Object.assign({ _directives: directives }, options);
23398
23514
  const doc = new Document(undefined, opts);
23399
23515
  const ctx = {
23516
+ atKey: false,
23400
23517
  atRoot: true,
23401
23518
  directives: doc.directives,
23402
23519
  options: doc.options,
@@ -25531,7 +25648,20 @@ query GetEurekaResults($params: Input_eureka_SearchRequest) {
25531
25648
  default: {
25532
25649
  const bv = this.startBlockValue(map);
25533
25650
  if (bv) {
25534
- if (atMapIndent && bv.type !== 'block-seq') {
25651
+ if (bv.type === 'block-seq') {
25652
+ if (!it.explicitKey &&
25653
+ it.sep &&
25654
+ !includesToken(it.sep, 'newline')) {
25655
+ yield* this.pop({
25656
+ type: 'error',
25657
+ offset: this.offset,
25658
+ message: 'Unexpected block-seq-ind on same line with key',
25659
+ source: this.source
25660
+ });
25661
+ return;
25662
+ }
25663
+ }
25664
+ else if (atMapIndent) {
25535
25665
  map.items.push({ start });
25536
25666
  }
25537
25667
  this.stack.push(bv);
@@ -25902,6 +26032,8 @@ query GetEurekaResults($params: Input_eureka_SearchRequest) {
25902
26032
  if (!keepUndefined)
25903
26033
  return undefined;
25904
26034
  }
26035
+ if (isDocument(value) && !_replacer)
26036
+ return value.toString(options);
25905
26037
  return new Document(value, _replacer, options).toString(options);
25906
26038
  }
25907
26039