@thoughtspot/visual-embed-sdk 1.42.1-alpha.7 → 1.42.3
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 +4 -3
- package/cjs/src/css-variables.d.ts +0 -48
- package/cjs/src/css-variables.d.ts.map +1 -1
- package/cjs/src/embed/app.d.ts +20 -0
- package/cjs/src/embed/app.d.ts.map +1 -1
- package/cjs/src/embed/app.js +9 -4
- package/cjs/src/embed/app.js.map +1 -1
- package/cjs/src/embed/app.spec.js +62 -0
- package/cjs/src/embed/app.spec.js.map +1 -1
- package/cjs/src/embed/base.d.ts.map +1 -1
- package/cjs/src/embed/base.js +2 -0
- package/cjs/src/embed/base.js.map +1 -1
- package/cjs/src/embed/bodyless-conversation.d.ts +1 -1
- package/cjs/src/embed/conversation.d.ts +16 -0
- package/cjs/src/embed/conversation.d.ts.map +1 -1
- package/cjs/src/embed/conversation.js +5 -2
- package/cjs/src/embed/conversation.js.map +1 -1
- package/cjs/src/embed/conversation.spec.js +25 -1
- package/cjs/src/embed/conversation.spec.js.map +1 -1
- package/cjs/src/embed/hostEventClient/contracts.d.ts +1 -11
- package/cjs/src/embed/hostEventClient/contracts.d.ts.map +1 -1
- package/cjs/src/embed/hostEventClient/contracts.js +0 -1
- package/cjs/src/embed/hostEventClient/contracts.js.map +1 -1
- package/cjs/src/embed/liveboard.d.ts.map +1 -1
- package/cjs/src/embed/liveboard.js +5 -1
- package/cjs/src/embed/liveboard.js.map +1 -1
- package/cjs/src/embed/liveboard.spec.js +46 -0
- package/cjs/src/embed/liveboard.spec.js.map +1 -1
- package/cjs/src/embed/sage.d.ts +4 -4
- package/cjs/src/embed/search.d.ts.map +1 -1
- package/cjs/src/embed/search.js +1 -3
- package/cjs/src/embed/search.js.map +1 -1
- package/cjs/src/embed/ts-embed.d.ts +0 -2
- package/cjs/src/embed/ts-embed.d.ts.map +1 -1
- package/cjs/src/embed/ts-embed.js +31 -44
- package/cjs/src/embed/ts-embed.js.map +1 -1
- package/cjs/src/embed/ts-embed.spec.js +134 -43
- package/cjs/src/embed/ts-embed.spec.js.map +1 -1
- package/cjs/src/errors.js +1 -1
- package/cjs/src/errors.js.map +1 -1
- package/cjs/src/index.d.ts +3 -3
- package/cjs/src/index.d.ts.map +1 -1
- package/cjs/src/index.js +1 -2
- package/cjs/src/index.js.map +1 -1
- package/cjs/src/react/all-types-export.d.ts +1 -2
- package/cjs/src/react/all-types-export.d.ts.map +1 -1
- package/cjs/src/react/all-types-export.js +5 -3
- package/cjs/src/react/all-types-export.js.map +1 -1
- package/cjs/src/react/all-types-export.spec.js +0 -8
- package/cjs/src/react/all-types-export.spec.js.map +1 -1
- package/cjs/src/react/index.d.ts +1 -2
- package/cjs/src/react/index.d.ts.map +1 -1
- package/cjs/src/react/index.js +2 -1
- package/cjs/src/react/index.js.map +1 -1
- package/cjs/src/react/util.d.ts +1 -0
- package/cjs/src/react/util.d.ts.map +1 -1
- package/cjs/src/types.d.ts +80 -94
- package/cjs/src/types.d.ts.map +1 -1
- package/cjs/src/types.js +30 -46
- package/cjs/src/types.js.map +1 -1
- package/cjs/src/utils/custom-actions.d.ts.map +1 -1
- package/cjs/src/utils/custom-actions.js +9 -0
- package/cjs/src/utils/custom-actions.js.map +1 -1
- package/cjs/src/utils/custom-actions.spec.js +20 -0
- package/cjs/src/utils/custom-actions.spec.js.map +1 -1
- package/cjs/src/utils/processData.d.ts +1 -1
- package/cjs/src/utils/processData.d.ts.map +1 -1
- package/cjs/src/utils/processData.js +8 -8
- package/cjs/src/utils/processData.js.map +1 -1
- package/cjs/src/utils/processData.spec.js.map +1 -1
- package/dist/{index-DvNA626T.js → index-SVcLgSqi.js} +1 -1
- package/dist/src/css-variables.d.ts +0 -48
- package/dist/src/css-variables.d.ts.map +1 -1
- package/dist/src/embed/app.d.ts +20 -0
- package/dist/src/embed/app.d.ts.map +1 -1
- package/dist/src/embed/base.d.ts.map +1 -1
- package/dist/src/embed/bodyless-conversation.d.ts +1 -1
- package/dist/src/embed/conversation.d.ts +16 -0
- package/dist/src/embed/conversation.d.ts.map +1 -1
- package/dist/src/embed/hostEventClient/contracts.d.ts +1 -11
- package/dist/src/embed/hostEventClient/contracts.d.ts.map +1 -1
- package/dist/src/embed/liveboard.d.ts.map +1 -1
- package/dist/src/embed/sage.d.ts +4 -4
- package/dist/src/embed/search.d.ts.map +1 -1
- package/dist/src/embed/ts-embed.d.ts +0 -2
- package/dist/src/embed/ts-embed.d.ts.map +1 -1
- package/dist/src/index.d.ts +3 -3
- package/dist/src/index.d.ts.map +1 -1
- package/dist/src/react/all-types-export.d.ts +1 -2
- package/dist/src/react/all-types-export.d.ts.map +1 -1
- package/dist/src/react/index.d.ts +1 -2
- package/dist/src/react/index.d.ts.map +1 -1
- package/dist/src/react/util.d.ts +1 -0
- package/dist/src/react/util.d.ts.map +1 -1
- package/dist/src/types.d.ts +80 -94
- package/dist/src/types.d.ts.map +1 -1
- package/dist/src/utils/custom-actions.d.ts.map +1 -1
- package/dist/src/utils/processData.d.ts +1 -1
- package/dist/src/utils/processData.d.ts.map +1 -1
- package/dist/tsembed-react.es.js +114 -224
- package/dist/tsembed-react.js +258 -444
- package/dist/tsembed.es.js +113 -224
- package/dist/tsembed.js +256 -443
- package/dist/visual-embed-sdk-react-full.d.ts +126 -161
- package/dist/visual-embed-sdk-react.d.ts +117 -156
- package/dist/visual-embed-sdk.d.ts +117 -159
- package/lib/package.json +4 -3
- package/lib/src/css-variables.d.ts +0 -48
- package/lib/src/css-variables.d.ts.map +1 -1
- package/lib/src/embed/app.d.ts +20 -0
- package/lib/src/embed/app.d.ts.map +1 -1
- package/lib/src/embed/app.js +9 -4
- package/lib/src/embed/app.js.map +1 -1
- package/lib/src/embed/app.spec.js +62 -0
- package/lib/src/embed/app.spec.js.map +1 -1
- package/lib/src/embed/base.d.ts.map +1 -1
- package/lib/src/embed/base.js +2 -0
- package/lib/src/embed/base.js.map +1 -1
- package/lib/src/embed/bodyless-conversation.d.ts +1 -1
- package/lib/src/embed/conversation.d.ts +16 -0
- package/lib/src/embed/conversation.d.ts.map +1 -1
- package/lib/src/embed/conversation.js +5 -2
- package/lib/src/embed/conversation.js.map +1 -1
- package/lib/src/embed/conversation.spec.js +25 -1
- package/lib/src/embed/conversation.spec.js.map +1 -1
- package/lib/src/embed/hostEventClient/contracts.d.ts +1 -11
- package/lib/src/embed/hostEventClient/contracts.d.ts.map +1 -1
- package/lib/src/embed/hostEventClient/contracts.js +0 -1
- package/lib/src/embed/hostEventClient/contracts.js.map +1 -1
- package/lib/src/embed/liveboard.d.ts.map +1 -1
- package/lib/src/embed/liveboard.js +5 -1
- package/lib/src/embed/liveboard.js.map +1 -1
- package/lib/src/embed/liveboard.spec.js +47 -1
- package/lib/src/embed/liveboard.spec.js.map +1 -1
- package/lib/src/embed/sage.d.ts +4 -4
- package/lib/src/embed/search.d.ts.map +1 -1
- package/lib/src/embed/search.js +1 -3
- package/lib/src/embed/search.js.map +1 -1
- package/lib/src/embed/ts-embed.d.ts +0 -2
- package/lib/src/embed/ts-embed.d.ts.map +1 -1
- package/lib/src/embed/ts-embed.js +31 -44
- package/lib/src/embed/ts-embed.js.map +1 -1
- package/lib/src/embed/ts-embed.spec.js +134 -43
- package/lib/src/embed/ts-embed.spec.js.map +1 -1
- package/lib/src/errors.js +1 -1
- package/lib/src/errors.js.map +1 -1
- package/lib/src/index.d.ts +3 -3
- 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 -2
- package/lib/src/react/all-types-export.d.ts.map +1 -1
- package/lib/src/react/all-types-export.js +2 -2
- package/lib/src/react/all-types-export.js.map +1 -1
- package/lib/src/react/all-types-export.spec.js +0 -8
- package/lib/src/react/all-types-export.spec.js.map +1 -1
- package/lib/src/react/index.d.ts +1 -2
- package/lib/src/react/index.d.ts.map +1 -1
- package/lib/src/react/index.js +4 -3
- package/lib/src/react/index.js.map +1 -1
- package/lib/src/react/util.d.ts +1 -0
- package/lib/src/react/util.d.ts.map +1 -1
- package/lib/src/types.d.ts +80 -94
- package/lib/src/types.d.ts.map +1 -1
- package/lib/src/types.js +29 -45
- package/lib/src/types.js.map +1 -1
- package/lib/src/utils/custom-actions.d.ts.map +1 -1
- package/lib/src/utils/custom-actions.js +9 -0
- package/lib/src/utils/custom-actions.js.map +1 -1
- package/lib/src/utils/custom-actions.spec.js +20 -0
- package/lib/src/utils/custom-actions.spec.js.map +1 -1
- package/lib/src/utils/processData.d.ts +1 -1
- package/lib/src/utils/processData.d.ts.map +1 -1
- package/lib/src/utils/processData.js +8 -8
- package/lib/src/utils/processData.js.map +1 -1
- package/lib/src/utils/processData.spec.js.map +1 -1
- package/package.json +4 -3
- package/src/css-variables.ts +0 -58
- package/src/embed/app.spec.ts +87 -0
- package/src/embed/app.ts +35 -4
- package/src/embed/base.ts +2 -0
- package/src/embed/bodyless-conversation.ts +1 -1
- package/src/embed/conversation.spec.ts +35 -1
- package/src/embed/conversation.ts +22 -0
- package/src/embed/hostEventClient/contracts.ts +0 -10
- package/src/embed/liveboard.spec.ts +60 -0
- package/src/embed/liveboard.ts +9 -0
- package/src/embed/sage.ts +4 -4
- package/src/embed/search.ts +1 -3
- package/src/embed/ts-embed.spec.ts +175 -53
- package/src/embed/ts-embed.ts +45 -68
- package/src/errors.ts +1 -1
- package/src/index.ts +3 -4
- package/src/react/all-types-export.spec.ts +1 -9
- package/src/react/all-types-export.ts +8 -10
- package/src/react/index.tsx +130 -155
- package/src/types.ts +78 -94
- package/src/utils/custom-actions.spec.ts +22 -0
- package/src/utils/custom-actions.ts +11 -0
- package/src/utils/processData.spec.ts +1 -0
- package/src/utils/processData.ts +11 -11
- package/cjs/src/api-intercept.d.ts +0 -31
- package/cjs/src/api-intercept.d.ts.map +0 -1
- package/cjs/src/api-intercept.js +0 -119
- package/cjs/src/api-intercept.js.map +0 -1
- package/cjs/src/api-intercept.spec.d.ts +0 -2
- package/cjs/src/api-intercept.spec.d.ts.map +0 -1
- package/cjs/src/api-intercept.spec.js +0 -122
- package/cjs/src/api-intercept.spec.js.map +0 -1
- package/dist/index-BCC3Z072.js +0 -7371
- package/dist/index-BEzW4MDA.js +0 -7371
- package/dist/index-BaESA9rq.js +0 -7371
- package/dist/index-CFNZIcKr.js +0 -7447
- package/dist/index-CqKTa1Fe.js +0 -7447
- package/dist/index-DFnPKcjZ.js +0 -7447
- package/dist/index-DhFH7b7U.js +0 -7447
- package/dist/src/api-intercept.d.ts +0 -31
- package/dist/src/api-intercept.d.ts.map +0 -1
- package/dist/src/api-intercept.spec.d.ts +0 -2
- package/dist/src/api-intercept.spec.d.ts.map +0 -1
- package/lib/src/api-intercept.d.ts +0 -31
- package/lib/src/api-intercept.d.ts.map +0 -1
- package/lib/src/api-intercept.js +0 -112
- package/lib/src/api-intercept.js.map +0 -1
- package/lib/src/api-intercept.spec.d.ts +0 -2
- package/lib/src/api-intercept.spec.d.ts.map +0 -1
- package/lib/src/api-intercept.spec.js +0 -119
- package/lib/src/api-intercept.spec.js.map +0 -1
- package/src/api-intercept.ts +0 -139
package/dist/tsembed-react.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
/* @thoughtspot/visual-embed-sdk version 1.42.
|
|
1
|
+
/* @thoughtspot/visual-embed-sdk version 1.42.3 */
|
|
2
2
|
'use client';
|
|
3
3
|
(function (global, factory) {
|
|
4
4
|
typeof exports === 'object' && typeof module !== 'undefined' ? factory(exports, require('react')) :
|
|
@@ -163,7 +163,7 @@
|
|
|
163
163
|
}
|
|
164
164
|
return false;
|
|
165
165
|
};
|
|
166
|
-
const merge
|
|
166
|
+
const merge = (...objects) => objects.reduce((result, current) => {
|
|
167
167
|
if (Array.isArray(current)) {
|
|
168
168
|
throw new TypeError("Arguments provided to ts-deepmerge must be objects, not arrays.");
|
|
169
169
|
}
|
|
@@ -172,19 +172,19 @@
|
|
|
172
172
|
return;
|
|
173
173
|
}
|
|
174
174
|
if (Array.isArray(result[key]) && Array.isArray(current[key])) {
|
|
175
|
-
result[key] = merge
|
|
176
|
-
? merge
|
|
175
|
+
result[key] = merge.options.mergeArrays
|
|
176
|
+
? merge.options.uniqueArrayItems
|
|
177
177
|
? Array.from(new Set(result[key].concat(current[key])))
|
|
178
178
|
: [...result[key], ...current[key]]
|
|
179
179
|
: current[key];
|
|
180
180
|
}
|
|
181
181
|
else if (isObject$1(result[key]) && isObject$1(current[key])) {
|
|
182
|
-
result[key] = merge
|
|
182
|
+
result[key] = merge(result[key], current[key]);
|
|
183
183
|
}
|
|
184
184
|
else {
|
|
185
185
|
result[key] =
|
|
186
186
|
current[key] === undefined
|
|
187
|
-
? merge
|
|
187
|
+
? merge.options.allowUndefinedOverrides
|
|
188
188
|
? current[key]
|
|
189
189
|
: result[key]
|
|
190
190
|
: current[key];
|
|
@@ -197,11 +197,11 @@
|
|
|
197
197
|
mergeArrays: true,
|
|
198
198
|
uniqueArrayItems: true,
|
|
199
199
|
};
|
|
200
|
-
merge
|
|
201
|
-
merge
|
|
202
|
-
merge
|
|
203
|
-
const result = merge
|
|
204
|
-
merge
|
|
200
|
+
merge.options = defaultOptions;
|
|
201
|
+
merge.withOptions = (options, ...objects) => {
|
|
202
|
+
merge.options = Object.assign(Object.assign({}, defaultOptions), options);
|
|
203
|
+
const result = merge(...objects);
|
|
204
|
+
merge.options = defaultOptions;
|
|
205
205
|
return result;
|
|
206
206
|
};
|
|
207
207
|
|
|
@@ -1573,7 +1573,7 @@
|
|
|
1573
1573
|
* the table visualization.
|
|
1574
1574
|
*
|
|
1575
1575
|
* If the Row-Level Security (RLS) rules are applied on the
|
|
1576
|
-
*
|
|
1576
|
+
* Model, exercise caution when changing column
|
|
1577
1577
|
* or table cell values to maintain data security.
|
|
1578
1578
|
*
|
|
1579
1579
|
* @example
|
|
@@ -1631,7 +1631,7 @@
|
|
|
1631
1631
|
*/
|
|
1632
1632
|
EmbedEvent["SpotterData"] = "SpotterData";
|
|
1633
1633
|
/**
|
|
1634
|
-
* Emitted when user opens up the
|
|
1634
|
+
* Emitted when user opens up the data source preview modal in Spotter embed.
|
|
1635
1635
|
* @example
|
|
1636
1636
|
* ```js
|
|
1637
1637
|
* spotterEmbed.on(EmbedEvent.PreviewSpotterData, (payload) => {
|
|
@@ -1719,21 +1719,6 @@
|
|
|
1719
1719
|
* @version SDK: 1.41.0 | ThoughtSpot: 10.12.0.cl
|
|
1720
1720
|
*/
|
|
1721
1721
|
EmbedEvent["OrgSwitched"] = "orgSwitched";
|
|
1722
|
-
/**
|
|
1723
|
-
* Emitted when the user intercepts a URL.
|
|
1724
|
-
*
|
|
1725
|
-
* Supported on all embed types.
|
|
1726
|
-
*
|
|
1727
|
-
* @example
|
|
1728
|
-
* ```js
|
|
1729
|
-
* embed.on(EmbedEvent.ApiIntercept, (payload) => {
|
|
1730
|
-
* console.log('payload', payload);
|
|
1731
|
-
* })
|
|
1732
|
-
* ```
|
|
1733
|
-
*
|
|
1734
|
-
* @version SDK: 1.42.0 | ThoughtSpot: 10.14.0.cl
|
|
1735
|
-
*/
|
|
1736
|
-
EmbedEvent["ApiIntercept"] = "ApiIntercept";
|
|
1737
1722
|
})(exports.EmbedEvent || (exports.EmbedEvent = {}));
|
|
1738
1723
|
/**
|
|
1739
1724
|
* Event types that can be triggered by the host application
|
|
@@ -1872,9 +1857,7 @@
|
|
|
1872
1857
|
*/
|
|
1873
1858
|
HostEvent["Reload"] = "reload";
|
|
1874
1859
|
/**
|
|
1875
|
-
* Get iframe URL for the current embed view
|
|
1876
|
-
* Developers can use this URL to embed a ThoughtSpot object
|
|
1877
|
-
* in apps like Salesforce or Sharepoint.
|
|
1860
|
+
* Get iframe URL for the current embed view.
|
|
1878
1861
|
* @example
|
|
1879
1862
|
* ```js
|
|
1880
1863
|
* const url = embed.trigger(HostEvent.GetIframeUrl);
|
|
@@ -2946,7 +2929,7 @@
|
|
|
2946
2929
|
*/
|
|
2947
2930
|
HostEvent["EditLastPrompt"] = "EditLastPrompt";
|
|
2948
2931
|
/**
|
|
2949
|
-
* Opens the
|
|
2932
|
+
* Opens the data source preview modal in Spotter Embed.
|
|
2950
2933
|
* @example
|
|
2951
2934
|
* ```js
|
|
2952
2935
|
* spotterEmbed.trigger(HostEvent.PreviewSpotterData);
|
|
@@ -3028,6 +3011,15 @@
|
|
|
3028
3011
|
* ```
|
|
3029
3012
|
*/
|
|
3030
3013
|
HostEvent["UpdateEmbedParams"] = "updateEmbedParams";
|
|
3014
|
+
/**
|
|
3015
|
+
* Triggered when the embed is needed to be destroyed. This is used to clean up any embed related resources internally.
|
|
3016
|
+
* @example
|
|
3017
|
+
* ```js
|
|
3018
|
+
* liveboardEmbed.trigger(HostEvent.DestroyEmbed);
|
|
3019
|
+
* ```
|
|
3020
|
+
* @version SDK: 1.41.0 | ThoughtSpot: 10.12.0.cl
|
|
3021
|
+
*/
|
|
3022
|
+
HostEvent["DestroyEmbed"] = "EmbedDestroyed";
|
|
3031
3023
|
})(exports.HostEvent || (exports.HostEvent = {}));
|
|
3032
3024
|
/**
|
|
3033
3025
|
* The different visual modes that the data sources panel within
|
|
@@ -3071,6 +3063,7 @@
|
|
|
3071
3063
|
Param["HideResult"] = "hideResult";
|
|
3072
3064
|
Param["UseLastSelectedDataSource"] = "useLastSelectedSources";
|
|
3073
3065
|
Param["Tag"] = "tag";
|
|
3066
|
+
Param["HideTagFilterChips"] = "hideTagFilterChips";
|
|
3074
3067
|
Param["AutoLogin"] = "autoLogin";
|
|
3075
3068
|
Param["searchTokenString"] = "searchTokenString";
|
|
3076
3069
|
Param["executeSearch"] = "executeSearch";
|
|
@@ -3159,6 +3152,7 @@
|
|
|
3159
3152
|
Param["ShowLiveboardReverifyBanner"] = "showLiveboardReverifyBanner";
|
|
3160
3153
|
Param["LiveboardHeaderV2"] = "isLiveboardHeaderV2Enabled";
|
|
3161
3154
|
Param["HideIrrelevantFiltersInTab"] = "hideIrrelevantFiltersAtTabLevel";
|
|
3155
|
+
Param["IsEnhancedFilterInteractivityEnabled"] = "isLiveboardPermissionV2Enabled";
|
|
3162
3156
|
Param["SpotterEnabled"] = "isSpotterExperienceEnabled";
|
|
3163
3157
|
Param["IsUnifiedSearchExperienceEnabled"] = "isUnifiedSearchExperienceEnabled";
|
|
3164
3158
|
Param["OverrideOrgId"] = "orgId";
|
|
@@ -3175,7 +3169,9 @@
|
|
|
3175
3169
|
Param["RootMarginForLazyLoad"] = "rootMarginForLazyLoad";
|
|
3176
3170
|
Param["LiveboardXLSXCSVDownload"] = "isLiveboardXLSXCSVDownloadEnabled";
|
|
3177
3171
|
Param["isPNGInScheduledEmailsEnabled"] = "isPNGInScheduledEmailsEnabled";
|
|
3172
|
+
Param["isCentralizedLiveboardFilterUXEnabled"] = "isCentralizedLiveboardFilterUXEnabled";
|
|
3178
3173
|
Param["isLinkParametersEnabled"] = "isLinkParametersEnabled";
|
|
3174
|
+
Param["EnablePastConversationsSidebar"] = "enablePastConversationsSidebar";
|
|
3179
3175
|
})(Param || (Param = {}));
|
|
3180
3176
|
/**
|
|
3181
3177
|
* ThoughtSpot application pages include actions and menu commands
|
|
@@ -3288,7 +3284,7 @@
|
|
|
3288
3284
|
*/
|
|
3289
3285
|
Action["SchedulesList"] = "schedule-list";
|
|
3290
3286
|
/**
|
|
3291
|
-
* The **Share** action on a Liveboard, Answer, or
|
|
3287
|
+
* The **Share** action on a Liveboard, Answer, or Model.
|
|
3292
3288
|
* Allows users to share an object with other users and groups.
|
|
3293
3289
|
* @example
|
|
3294
3290
|
* ```js
|
|
@@ -3746,7 +3742,7 @@
|
|
|
3746
3742
|
Action["AnswerChartSwitcher"] = "answerChartSwitcher";
|
|
3747
3743
|
/**
|
|
3748
3744
|
* The Favorites icon (*) for Answers,
|
|
3749
|
-
* Liveboard, and data objects like
|
|
3745
|
+
* Liveboard, and data objects like Model,
|
|
3750
3746
|
* Tables and Views.
|
|
3751
3747
|
* Allows adding an object to the user's favorites list.
|
|
3752
3748
|
* @example
|
|
@@ -4480,6 +4476,16 @@
|
|
|
4480
4476
|
* @version SDK: 1.42.0 | ThoughtSpot Cloud: 10.14.0.cl
|
|
4481
4477
|
*/
|
|
4482
4478
|
Action["RemoveAttachment"] = "removeAttachment";
|
|
4479
|
+
/**
|
|
4480
|
+
* The **Style panel** on a Liveboard.
|
|
4481
|
+
* Controls the visibility of the Liveboard style panel.
|
|
4482
|
+
* @example
|
|
4483
|
+
* ```js
|
|
4484
|
+
* hiddenActions: [Action.LiveboardStylePanel]
|
|
4485
|
+
* ```
|
|
4486
|
+
* @version SDK: 1.43.0 | ThoughtSpot Cloud: 10.15.0.cl
|
|
4487
|
+
*/
|
|
4488
|
+
Action["LiveboardStylePanel"] = "liveboardStylePanel";
|
|
4483
4489
|
})(exports.Action || (exports.Action = {}));
|
|
4484
4490
|
var PrefetchFeatures;
|
|
4485
4491
|
(function (PrefetchFeatures) {
|
|
@@ -4601,29 +4607,7 @@
|
|
|
4601
4607
|
* @version SDK: 1.26.7 | ThoughtSpot Cloud: 9.10.0.cl
|
|
4602
4608
|
*/
|
|
4603
4609
|
LogLevel["TRACE"] = "TRACE";
|
|
4604
|
-
})(exports.LogLevel || (exports.LogLevel = {}));
|
|
4605
|
-
/**
|
|
4606
|
-
* Enum for the type of API intercepted
|
|
4607
|
-
*/
|
|
4608
|
-
var InterceptedApiType;
|
|
4609
|
-
(function (InterceptedApiType) {
|
|
4610
|
-
/**
|
|
4611
|
-
* The apis that are use to get the metadata for the embed
|
|
4612
|
-
*/
|
|
4613
|
-
InterceptedApiType["METADATA"] = "METADATA";
|
|
4614
|
-
/**
|
|
4615
|
-
* The apis that are use to get the data for the embed
|
|
4616
|
-
*/
|
|
4617
|
-
InterceptedApiType["ANSWER_DATA"] = "ANSWER_DATA";
|
|
4618
|
-
/**
|
|
4619
|
-
* This will intercept all the apis
|
|
4620
|
-
*/
|
|
4621
|
-
InterceptedApiType["ALL"] = "ALL";
|
|
4622
|
-
/**
|
|
4623
|
-
* The apis that are use to get the data for the liveboard
|
|
4624
|
-
*/
|
|
4625
|
-
InterceptedApiType["LIVEBOARD_DATA"] = "LIVEBOARD_DATA";
|
|
4626
|
-
})(InterceptedApiType || (InterceptedApiType = {}));
|
|
4610
|
+
})(exports.LogLevel || (exports.LogLevel = {}));
|
|
4627
4611
|
|
|
4628
4612
|
const logFunctions = {
|
|
4629
4613
|
[exports.LogLevel.SILENT]: () => undefined,
|
|
@@ -4892,7 +4876,7 @@
|
|
|
4892
4876
|
function getDOMNode(domSelector) {
|
|
4893
4877
|
return typeof domSelector === 'string' ? document.querySelector(domSelector) : domSelector;
|
|
4894
4878
|
}
|
|
4895
|
-
const deepMerge = (target, source) => merge
|
|
4879
|
+
const deepMerge = (target, source) => merge(target, source);
|
|
4896
4880
|
const getOperationNameFromQuery = (query) => {
|
|
4897
4881
|
const regex = /(?:query|mutation)\s+(\w+)/;
|
|
4898
4882
|
const matches = query.match(regex);
|
|
@@ -7386,20 +7370,9 @@
|
|
|
7386
7370
|
|
|
7387
7371
|
var isEmpty_1 = isEmpty$1;
|
|
7388
7372
|
|
|
7389
|
-
var UIPassthroughEvent;
|
|
7390
|
-
(function (UIPassthroughEvent) {
|
|
7391
|
-
UIPassthroughEvent["PinAnswerToLiveboard"] = "addVizToPinboard";
|
|
7392
|
-
UIPassthroughEvent["SaveAnswer"] = "saveAnswer";
|
|
7393
|
-
UIPassthroughEvent["GetDiscoverabilityStatus"] = "getDiscoverabilityStatus";
|
|
7394
|
-
UIPassthroughEvent["GetAvailableUIPassthroughs"] = "getAvailableUiPassthroughs";
|
|
7395
|
-
UIPassthroughEvent["GetAnswerConfig"] = "getAnswerPageConfig";
|
|
7396
|
-
UIPassthroughEvent["GetLiveboardConfig"] = "getPinboardPageConfig";
|
|
7397
|
-
UIPassthroughEvent["GetUnsavedAnswerTML"] = "getUnsavedAnswerTML";
|
|
7398
|
-
})(UIPassthroughEvent || (UIPassthroughEvent = {}));
|
|
7399
|
-
|
|
7400
7373
|
const ERROR_MESSAGE = {
|
|
7401
7374
|
INVALID_THOUGHTSPOT_HOST: 'Error parsing ThoughtSpot host. Please provide a valid URL.',
|
|
7402
|
-
SPOTTER_EMBED_WORKSHEED_ID_NOT_FOUND: 'Please select a
|
|
7375
|
+
SPOTTER_EMBED_WORKSHEED_ID_NOT_FOUND: 'Please select a Model to get started',
|
|
7403
7376
|
LIVEBOARD_VIZ_ID_VALIDATION: 'Please select a Liveboard to embed.',
|
|
7404
7377
|
TRIGGER_TIMED_OUT: 'Trigger timed-out in getting a response',
|
|
7405
7378
|
SEARCHEMBED_BETA_WRANING_MESSAGE: 'SearchEmbed is in Beta in this release.',
|
|
@@ -9849,6 +9822,14 @@ mutation GetUnsavedAnswerTML($session: BachSessionIdInput!, $exportDependencies:
|
|
|
9849
9822
|
finalValidActions.push(action);
|
|
9850
9823
|
}
|
|
9851
9824
|
});
|
|
9825
|
+
// Step 4: Collect warnings for long custom action names
|
|
9826
|
+
const MAX_ACTION_NAME_LENGTH = 30;
|
|
9827
|
+
const warnings = finalValidActions
|
|
9828
|
+
.filter(action => action.name.length > MAX_ACTION_NAME_LENGTH)
|
|
9829
|
+
.map(action => `Custom action name '${action.name}' exceeds ${MAX_ACTION_NAME_LENGTH} characters. This may cause display or truncation issues in the UI.`);
|
|
9830
|
+
if (warnings.length > 0) {
|
|
9831
|
+
logger$3.warn(warnings);
|
|
9832
|
+
}
|
|
9852
9833
|
const sortedActions = sortBy_1(finalValidActions, (a) => a.name.toLocaleLowerCase());
|
|
9853
9834
|
return {
|
|
9854
9835
|
actions: sortedActions,
|
|
@@ -17179,6 +17160,8 @@ mutation GetUnsavedAnswerTML($session: BachSessionIdInput!, $exportDependencies:
|
|
|
17179
17160
|
authTriggerText: 'Authorize',
|
|
17180
17161
|
authType: AuthType.None,
|
|
17181
17162
|
logLevel: exports.LogLevel.ERROR,
|
|
17163
|
+
waitForCleanupOnDestroy: false,
|
|
17164
|
+
cleanupTimeout: 5000,
|
|
17182
17165
|
};
|
|
17183
17166
|
let authPromise;
|
|
17184
17167
|
const getAuthPromise = () => authPromise;
|
|
@@ -17481,27 +17464,27 @@ mutation GetUnsavedAnswerTML($session: BachSessionIdInput!, $exportDependencies:
|
|
|
17481
17464
|
* @param thoughtSpotHost
|
|
17482
17465
|
* @param containerEl
|
|
17483
17466
|
*/
|
|
17484
|
-
function processEventData(type,
|
|
17467
|
+
function processEventData(type, e, thoughtSpotHost, containerEl) {
|
|
17485
17468
|
switch (type) {
|
|
17486
17469
|
case exports.EmbedEvent.CustomAction:
|
|
17487
|
-
return processCustomAction(
|
|
17470
|
+
return processCustomAction(e, thoughtSpotHost);
|
|
17488
17471
|
case exports.EmbedEvent.AuthInit:
|
|
17489
|
-
return processAuthInit(
|
|
17472
|
+
return processAuthInit(e);
|
|
17490
17473
|
case exports.EmbedEvent.NoCookieAccess:
|
|
17491
|
-
return processNoCookieAccess(
|
|
17474
|
+
return processNoCookieAccess(e, containerEl);
|
|
17492
17475
|
case exports.EmbedEvent.AuthFailure:
|
|
17493
|
-
return processAuthFailure(
|
|
17476
|
+
return processAuthFailure(e, containerEl);
|
|
17494
17477
|
case exports.EmbedEvent.AuthLogout:
|
|
17495
|
-
return processAuthLogout(
|
|
17478
|
+
return processAuthLogout(e, containerEl);
|
|
17496
17479
|
case exports.EmbedEvent.ExitPresentMode:
|
|
17497
17480
|
return processExitPresentMode();
|
|
17498
17481
|
case exports.EmbedEvent.CLEAR_INFO_CACHE:
|
|
17499
17482
|
return processClearInfoCache();
|
|
17500
17483
|
}
|
|
17501
|
-
return
|
|
17484
|
+
return e;
|
|
17502
17485
|
}
|
|
17503
17486
|
|
|
17504
|
-
var name="@thoughtspot/visual-embed-sdk";var version$1="1.42.
|
|
17487
|
+
var name="@thoughtspot/visual-embed-sdk";var version$1="1.42.3";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};
|
|
17505
17488
|
|
|
17506
17489
|
/**
|
|
17507
17490
|
* Reloads the ThoughtSpot iframe.
|
|
@@ -17573,6 +17556,16 @@ mutation GetUnsavedAnswerTML($session: BachSessionIdInput!, $exportDependencies:
|
|
|
17573
17556
|
});
|
|
17574
17557
|
}
|
|
17575
17558
|
|
|
17559
|
+
var UIPassthroughEvent;
|
|
17560
|
+
(function (UIPassthroughEvent) {
|
|
17561
|
+
UIPassthroughEvent["PinAnswerToLiveboard"] = "addVizToPinboard";
|
|
17562
|
+
UIPassthroughEvent["SaveAnswer"] = "saveAnswer";
|
|
17563
|
+
UIPassthroughEvent["GetDiscoverabilityStatus"] = "getDiscoverabilityStatus";
|
|
17564
|
+
UIPassthroughEvent["GetAvailableUIPassthroughs"] = "getAvailableUiPassthroughs";
|
|
17565
|
+
UIPassthroughEvent["GetAnswerConfig"] = "getAnswerPageConfig";
|
|
17566
|
+
UIPassthroughEvent["GetLiveboardConfig"] = "getPinboardPageConfig";
|
|
17567
|
+
})(UIPassthroughEvent || (UIPassthroughEvent = {}));
|
|
17568
|
+
|
|
17576
17569
|
class HostEventClient {
|
|
17577
17570
|
constructor(iFrame) {
|
|
17578
17571
|
this.iFrame = iFrame;
|
|
@@ -17664,111 +17657,6 @@ mutation GetUnsavedAnswerTML($session: BachSessionIdInput!, $exportDependencies:
|
|
|
17664
17657
|
}
|
|
17665
17658
|
}
|
|
17666
17659
|
|
|
17667
|
-
const defaultUrls = {
|
|
17668
|
-
[InterceptedApiType.METADATA]: [
|
|
17669
|
-
'/prism/?op=CreateAnswerSession',
|
|
17670
|
-
'/prism/?op=GetV2SourceDetail',
|
|
17671
|
-
],
|
|
17672
|
-
[InterceptedApiType.ANSWER_DATA]: [
|
|
17673
|
-
'/prism/?op=GetChartWithData',
|
|
17674
|
-
'/prism/?op=GetTableWithHeadlineData',
|
|
17675
|
-
],
|
|
17676
|
-
[InterceptedApiType.LIVEBOARD_DATA]: [
|
|
17677
|
-
'/prism/?op=LoadContextBook'
|
|
17678
|
-
],
|
|
17679
|
-
};
|
|
17680
|
-
const formatInterceptUrl = (url) => {
|
|
17681
|
-
const host = getThoughtSpotHost(getEmbedConfig());
|
|
17682
|
-
if (url.startsWith('/'))
|
|
17683
|
-
return `${host}${url}`;
|
|
17684
|
-
return url;
|
|
17685
|
-
};
|
|
17686
|
-
const processInterceptUrls = (interceptUrls) => {
|
|
17687
|
-
let processedUrls = [...interceptUrls];
|
|
17688
|
-
Object.entries(defaultUrls).forEach(([apiType, apiTypeUrls]) => {
|
|
17689
|
-
if (!processedUrls.includes(apiType))
|
|
17690
|
-
return;
|
|
17691
|
-
processedUrls = processedUrls.filter(url => url !== apiType);
|
|
17692
|
-
processedUrls = [...processedUrls, ...apiTypeUrls];
|
|
17693
|
-
});
|
|
17694
|
-
return processedUrls.map(url => formatInterceptUrl(url));
|
|
17695
|
-
};
|
|
17696
|
-
const getInterceptInitData = (embedConfig, viewConfig) => {
|
|
17697
|
-
const enableApiIntercept = (embedConfig.enableApiIntercept || viewConfig.enableApiIntercept) && (viewConfig.enableApiIntercept !== false);
|
|
17698
|
-
if (!enableApiIntercept)
|
|
17699
|
-
return {
|
|
17700
|
-
enableApiIntercept: false,
|
|
17701
|
-
};
|
|
17702
|
-
const combinedUrls = [...(embedConfig.interceptUrls || []), ...(viewConfig.interceptUrls || [])];
|
|
17703
|
-
if (viewConfig.isOnBeforeGetVizDataInterceptEnabled) {
|
|
17704
|
-
combinedUrls.push(InterceptedApiType.ANSWER_DATA);
|
|
17705
|
-
}
|
|
17706
|
-
const shouldInterceptAll = combinedUrls.includes(InterceptedApiType.ALL);
|
|
17707
|
-
const interceptUrls = shouldInterceptAll ? [InterceptedApiType.ALL] : processInterceptUrls(combinedUrls);
|
|
17708
|
-
const interceptTimeout = embedConfig.interceptTimeout || viewConfig.interceptTimeout;
|
|
17709
|
-
return {
|
|
17710
|
-
interceptUrls,
|
|
17711
|
-
interceptTimeout,
|
|
17712
|
-
enableApiIntercept,
|
|
17713
|
-
};
|
|
17714
|
-
};
|
|
17715
|
-
/**
|
|
17716
|
-
*
|
|
17717
|
-
* @param fetchInit
|
|
17718
|
-
*/
|
|
17719
|
-
const parseInterceptData = (eventDataString) => {
|
|
17720
|
-
try {
|
|
17721
|
-
const { input, init } = JSON.parse(eventDataString);
|
|
17722
|
-
init.body = JSON.parse(init.body);
|
|
17723
|
-
const parsedInit = { input, init };
|
|
17724
|
-
return [parsedInit, null];
|
|
17725
|
-
}
|
|
17726
|
-
catch (error) {
|
|
17727
|
-
return [null, error];
|
|
17728
|
-
}
|
|
17729
|
-
};
|
|
17730
|
-
const handleInterceptEvent = async (params) => {
|
|
17731
|
-
var _a, _b, _c, _d, _e;
|
|
17732
|
-
const { eventData, executeEvent, viewConfig, getUnsavedAnswerTml } = params;
|
|
17733
|
-
const [interceptData, bodyParseError] = parseInterceptData(eventData.data);
|
|
17734
|
-
if (bodyParseError) {
|
|
17735
|
-
executeEvent(exports.EmbedEvent.Error, {
|
|
17736
|
-
error: 'Error parsing api intercept body',
|
|
17737
|
-
});
|
|
17738
|
-
logger$3.error('Error parsing request body', bodyParseError);
|
|
17739
|
-
return;
|
|
17740
|
-
}
|
|
17741
|
-
const { input: requestUrl, init } = interceptData;
|
|
17742
|
-
const sessionId = (_c = (_b = (_a = init === null || init === void 0 ? void 0 : init.body) === null || _a === void 0 ? void 0 : _a.variables) === null || _b === void 0 ? void 0 : _b.session) === null || _c === void 0 ? void 0 : _c.sessionId;
|
|
17743
|
-
const vizId = (_e = (_d = init === null || init === void 0 ? void 0 : init.body) === null || _d === void 0 ? void 0 : _d.variables) === null || _e === void 0 ? void 0 : _e.contextBookId;
|
|
17744
|
-
if (defaultUrls.ANSWER_DATA.includes(requestUrl) && viewConfig.isOnBeforeGetVizDataInterceptEnabled) {
|
|
17745
|
-
const answerTml = await getUnsavedAnswerTml({ sessionId, vizId });
|
|
17746
|
-
executeEvent(exports.EmbedEvent.OnBeforeGetVizDataIntercept, { data: { data: answerTml } });
|
|
17747
|
-
}
|
|
17748
|
-
executeEvent(exports.EmbedEvent.ApiIntercept, interceptData);
|
|
17749
|
-
};
|
|
17750
|
-
const processLegacyInterceptResponse = (payload) => {
|
|
17751
|
-
var _a, _b, _c, _d, _e, _f, _g;
|
|
17752
|
-
const errorText = ((_a = payload === null || payload === void 0 ? void 0 : payload.data) === null || _a === void 0 ? void 0 : _a.errorText) || ((_c = (_b = payload === null || payload === void 0 ? void 0 : payload.data) === null || _b === void 0 ? void 0 : _b.error) === null || _c === void 0 ? void 0 : _c.errorText);
|
|
17753
|
-
const errorDescription = ((_d = payload === null || payload === void 0 ? void 0 : payload.data) === null || _d === void 0 ? void 0 : _d.errorDescription) || ((_f = (_e = payload === null || payload === void 0 ? void 0 : payload.data) === null || _e === void 0 ? void 0 : _e.error) === null || _f === void 0 ? void 0 : _f.errorDescription);
|
|
17754
|
-
const payloadToSend = {
|
|
17755
|
-
execute: (_g = payload === null || payload === void 0 ? void 0 : payload.data) === null || _g === void 0 ? void 0 : _g.execute,
|
|
17756
|
-
response: {
|
|
17757
|
-
body: {
|
|
17758
|
-
errors: [
|
|
17759
|
-
{
|
|
17760
|
-
title: errorText,
|
|
17761
|
-
description: errorDescription,
|
|
17762
|
-
isUserError: true,
|
|
17763
|
-
},
|
|
17764
|
-
],
|
|
17765
|
-
data: {},
|
|
17766
|
-
},
|
|
17767
|
-
},
|
|
17768
|
-
};
|
|
17769
|
-
return { data: payloadToSend };
|
|
17770
|
-
};
|
|
17771
|
-
|
|
17772
17660
|
/**
|
|
17773
17661
|
* Copyright (c) 2022
|
|
17774
17662
|
*
|
|
@@ -17822,27 +17710,6 @@ mutation GetUnsavedAnswerTML($session: BachSessionIdInput!, $exportDependencies:
|
|
|
17822
17710
|
*/
|
|
17823
17711
|
this.fullscreenChangeHandler = null;
|
|
17824
17712
|
this.subscribedListeners = {};
|
|
17825
|
-
this.messageEventListener = async (event) => {
|
|
17826
|
-
const eventType = this.getEventType(event);
|
|
17827
|
-
const eventPort = this.getEventPort(event);
|
|
17828
|
-
const eventData = this.formatEventData(event, eventType);
|
|
17829
|
-
if (event.source === this.iFrame.contentWindow) {
|
|
17830
|
-
const processedEventData = await processEventData(eventType, eventData, this.thoughtSpotHost, this.isPreRendered ? this.preRenderWrapper : this.el);
|
|
17831
|
-
const executeEvent = (_eventType, data) => {
|
|
17832
|
-
this.executeCallbacks(_eventType, data, eventPort);
|
|
17833
|
-
};
|
|
17834
|
-
if (eventType === exports.EmbedEvent.ApiIntercept && this.viewConfig.enableApiIntercept) {
|
|
17835
|
-
const getUnsavedAnswerTml = async (props) => {
|
|
17836
|
-
var _a;
|
|
17837
|
-
const response = await this.triggerUIPassThrough(UIPassthroughEvent.GetUnsavedAnswerTML, props);
|
|
17838
|
-
return (_a = response[0]) === null || _a === void 0 ? void 0 : _a.value;
|
|
17839
|
-
};
|
|
17840
|
-
handleInterceptEvent({ eventData: processedEventData, executeEvent, embedConfig: this.embedConfig, viewConfig: this.viewConfig, getUnsavedAnswerTml });
|
|
17841
|
-
return;
|
|
17842
|
-
}
|
|
17843
|
-
this.executeCallbacks(eventType, processedEventData, eventPort);
|
|
17844
|
-
}
|
|
17845
|
-
};
|
|
17846
17713
|
/**
|
|
17847
17714
|
* Send Custom style as part of payload of APP_INIT
|
|
17848
17715
|
* @param _
|
|
@@ -17927,18 +17794,6 @@ mutation GetUnsavedAnswerTML($session: BachSessionIdInput!, $exportDependencies:
|
|
|
17927
17794
|
this.on(exports.EmbedEvent.AuthInit, authInitHandler, { start: false }, true);
|
|
17928
17795
|
};
|
|
17929
17796
|
this.showPreRenderByDefault = false;
|
|
17930
|
-
this.createEmbedEventResponder = (eventPort, eventType) => {
|
|
17931
|
-
const { enableApiIntercept } = getInterceptInitData(this.embedConfig, this.viewConfig);
|
|
17932
|
-
if (eventType === exports.EmbedEvent.OnBeforeGetVizDataIntercept && enableApiIntercept) {
|
|
17933
|
-
return (payload) => {
|
|
17934
|
-
const payloadToSend = processLegacyInterceptResponse(payload);
|
|
17935
|
-
this.triggerEventOnPort(eventPort, payloadToSend);
|
|
17936
|
-
};
|
|
17937
|
-
}
|
|
17938
|
-
return (payload) => {
|
|
17939
|
-
this.triggerEventOnPort(eventPort, payload);
|
|
17940
|
-
};
|
|
17941
|
-
};
|
|
17942
17797
|
/**
|
|
17943
17798
|
* @hidden
|
|
17944
17799
|
* Internal state to track if the embed container is loaded.
|
|
@@ -18124,8 +17979,16 @@ mutation GetUnsavedAnswerTML($session: BachSessionIdInput!, $exportDependencies:
|
|
|
18124
17979
|
*/
|
|
18125
17980
|
subscribeToMessageEvents() {
|
|
18126
17981
|
this.unsubscribeToMessageEvents();
|
|
18127
|
-
|
|
18128
|
-
|
|
17982
|
+
const messageEventListener = (event) => {
|
|
17983
|
+
const eventType = this.getEventType(event);
|
|
17984
|
+
const eventPort = this.getEventPort(event);
|
|
17985
|
+
const eventData = this.formatEventData(event, eventType);
|
|
17986
|
+
if (event.source === this.iFrame.contentWindow) {
|
|
17987
|
+
this.executeCallbacks(eventType, processEventData(eventType, eventData, this.thoughtSpotHost, this.isPreRendered ? this.preRenderWrapper : this.el), eventPort);
|
|
17988
|
+
}
|
|
17989
|
+
};
|
|
17990
|
+
window.addEventListener('message', messageEventListener);
|
|
17991
|
+
this.subscribedListeners.message = messageEventListener;
|
|
18129
17992
|
}
|
|
18130
17993
|
/**
|
|
18131
17994
|
* Adds event listeners for both network and message events.
|
|
@@ -18186,7 +18049,7 @@ mutation GetUnsavedAnswerTML($session: BachSessionIdInput!, $exportDependencies:
|
|
|
18186
18049
|
message: customActionsResult.errors,
|
|
18187
18050
|
});
|
|
18188
18051
|
}
|
|
18189
|
-
|
|
18052
|
+
return {
|
|
18190
18053
|
customisations: getCustomisations(this.embedConfig, this.viewConfig),
|
|
18191
18054
|
authToken,
|
|
18192
18055
|
runtimeFilterParams: this.viewConfig.excludeRuntimeFiltersfromURL
|
|
@@ -18204,9 +18067,7 @@ mutation GetUnsavedAnswerTML($session: BachSessionIdInput!, $exportDependencies:
|
|
|
18204
18067
|
customVariablesForThirdPartyTools: this.embedConfig.customVariablesForThirdPartyTools || {},
|
|
18205
18068
|
hiddenListColumns: this.viewConfig.hiddenListColumns || [],
|
|
18206
18069
|
customActions: customActionsResult.actions,
|
|
18207
|
-
...getInterceptInitData(this.embedConfig, this.viewConfig),
|
|
18208
18070
|
};
|
|
18209
|
-
return baseInitData;
|
|
18210
18071
|
}
|
|
18211
18072
|
async getAppInitData() {
|
|
18212
18073
|
return this.getDefaultAppInitData();
|
|
@@ -18635,8 +18496,9 @@ mutation GetUnsavedAnswerTML($session: BachSessionIdInput!, $exportDependencies:
|
|
|
18635
18496
|
// When start status is false it trigger only end releated
|
|
18636
18497
|
// payload
|
|
18637
18498
|
|| (!callbackObj.options.start && dataStatus === embedEventStatus.END)) {
|
|
18638
|
-
|
|
18639
|
-
|
|
18499
|
+
callbackObj.callback(data, (payload) => {
|
|
18500
|
+
this.triggerEventOnPort(eventPort, payload);
|
|
18501
|
+
});
|
|
18640
18502
|
}
|
|
18641
18503
|
});
|
|
18642
18504
|
}
|
|
@@ -18909,11 +18771,26 @@ mutation GetUnsavedAnswerTML($session: BachSessionIdInput!, $exportDependencies:
|
|
|
18909
18771
|
* @version SDK: 1.19.1 | ThoughtSpot: *
|
|
18910
18772
|
*/
|
|
18911
18773
|
destroy() {
|
|
18912
|
-
var _a;
|
|
18774
|
+
var _a, _b;
|
|
18913
18775
|
try {
|
|
18914
18776
|
this.removeFullscreenChangeHandler();
|
|
18915
|
-
(_a = this.insertedDomEl) === null || _a === void 0 ? void 0 : _a.parentNode.removeChild(this.insertedDomEl);
|
|
18916
18777
|
this.unsubscribeToEvents();
|
|
18778
|
+
if (!getEmbedConfig().waitForCleanupOnDestroy) {
|
|
18779
|
+
this.trigger(exports.HostEvent.DestroyEmbed);
|
|
18780
|
+
(_b = (_a = this.insertedDomEl) === null || _a === void 0 ? void 0 : _a.parentNode) === null || _b === void 0 ? void 0 : _b.removeChild(this.insertedDomEl);
|
|
18781
|
+
}
|
|
18782
|
+
else {
|
|
18783
|
+
const cleanupTimeout = getEmbedConfig().cleanupTimeout;
|
|
18784
|
+
Promise.race([
|
|
18785
|
+
this.trigger(exports.HostEvent.DestroyEmbed),
|
|
18786
|
+
new Promise((resolve) => setTimeout(resolve, cleanupTimeout)),
|
|
18787
|
+
]).then(() => {
|
|
18788
|
+
var _a, _b;
|
|
18789
|
+
(_b = (_a = this.insertedDomEl) === null || _a === void 0 ? void 0 : _a.parentNode) === null || _b === void 0 ? void 0 : _b.removeChild(this.insertedDomEl);
|
|
18790
|
+
}).catch((e) => {
|
|
18791
|
+
logger$3.log('Error destroying TS Embed', e);
|
|
18792
|
+
});
|
|
18793
|
+
}
|
|
18917
18794
|
}
|
|
18918
18795
|
catch (e) {
|
|
18919
18796
|
logger$3.log('Error destroying TS Embed', e);
|
|
@@ -19420,8 +19297,7 @@ mutation GetUnsavedAnswerTML($session: BachSessionIdInput!, $exportDependencies:
|
|
|
19420
19297
|
if (hideSearchBar) {
|
|
19421
19298
|
queryParams[Param.HideSearchBar] = true;
|
|
19422
19299
|
}
|
|
19423
|
-
|
|
19424
|
-
if (isOnBeforeGetVizDataInterceptEnabled && !enableApiIntercept) {
|
|
19300
|
+
if (isOnBeforeGetVizDataInterceptEnabled) {
|
|
19425
19301
|
queryParams[Param.IsOnBeforeGetVizDataInterceptEnabled] = isOnBeforeGetVizDataInterceptEnabled;
|
|
19426
19302
|
}
|
|
19427
19303
|
if (!focusSearchBarOnRender) {
|
|
@@ -19682,7 +19558,7 @@ mutation GetUnsavedAnswerTML($session: BachSessionIdInput!, $exportDependencies:
|
|
|
19682
19558
|
* embedded Liveboard or visualization.
|
|
19683
19559
|
*/
|
|
19684
19560
|
getEmbedParams() {
|
|
19685
|
-
const { tag, hideObjects, liveboardV2, showPrimaryNavbar, disableProfileAndHelp, hideHamburger, hideObjectSearch, hideNotification, hideApplicationSwitcher, hideOrgSwitcher, enableSearchAssist, fullHeight, dataPanelV2 = true, hideLiveboardHeader = false, showLiveboardTitle = true, showLiveboardDescription = true, hideHomepageLeftNav = false, modularHomeExperience = false, isLiveboardHeaderSticky = true, enableAskSage, collapseSearchBarInitially = false, enable2ColumnLayout, enableCustomColumnGroups = false, isOnBeforeGetVizDataInterceptEnabled = false, dataPanelCustomGroupsAccordionInitialState = DataPanelCustomColumnGroupsAccordionState.EXPAND_ALL, collapseSearchBar = true, isLiveboardCompactHeaderEnabled = false, showLiveboardVerifiedBadge = true, showLiveboardReverifyBanner = true, hideIrrelevantChipsInLiveboardTabs = false, homePageSearchBarMode, isUnifiedSearchExperienceEnabled = true, enablePendoHelp = true, discoveryExperience, coverAndFilterOptionInPDF = false, liveboardXLSXCSVDownload = false, isLiveboardStylingAndGroupingEnabled, isPNGInScheduledEmailsEnabled = false, isLinkParametersEnabled, } = this.viewConfig;
|
|
19561
|
+
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, isOnBeforeGetVizDataInterceptEnabled = false, dataPanelCustomGroupsAccordionInitialState = DataPanelCustomColumnGroupsAccordionState.EXPAND_ALL, collapseSearchBar = true, isLiveboardCompactHeaderEnabled = false, showLiveboardVerifiedBadge = true, showLiveboardReverifyBanner = true, hideIrrelevantChipsInLiveboardTabs = false, isEnhancedFilterInteractivityEnabled = false, homePageSearchBarMode, isUnifiedSearchExperienceEnabled = true, enablePendoHelp = true, discoveryExperience, coverAndFilterOptionInPDF = false, liveboardXLSXCSVDownload = false, isLiveboardStylingAndGroupingEnabled, isPNGInScheduledEmailsEnabled = false, isCentralizedLiveboardFilterUXEnabled = false, isLinkParametersEnabled, } = this.viewConfig;
|
|
19686
19562
|
let params = {};
|
|
19687
19563
|
params[Param.PrimaryNavHidden] = !showPrimaryNavbar;
|
|
19688
19564
|
params[Param.HideProfleAndHelp] = !!disableProfileAndHelp;
|
|
@@ -19694,6 +19570,7 @@ mutation GetUnsavedAnswerTML($session: BachSessionIdInput!, $exportDependencies:
|
|
|
19694
19570
|
params[Param.LiveboardHeaderSticky] = isLiveboardHeaderSticky;
|
|
19695
19571
|
params[Param.IsFullAppEmbed] = true;
|
|
19696
19572
|
params[Param.LiveboardHeaderV2] = isLiveboardCompactHeaderEnabled;
|
|
19573
|
+
params[Param.IsEnhancedFilterInteractivityEnabled] = isEnhancedFilterInteractivityEnabled;
|
|
19697
19574
|
params[Param.ShowLiveboardVerifiedBadge] = showLiveboardVerifiedBadge;
|
|
19698
19575
|
params[Param.ShowLiveboardReverifyBanner] = showLiveboardReverifyBanner;
|
|
19699
19576
|
params[Param.HideIrrelevantFiltersInTab] = hideIrrelevantChipsInLiveboardTabs;
|
|
@@ -19735,8 +19612,7 @@ mutation GetUnsavedAnswerTML($session: BachSessionIdInput!, $exportDependencies:
|
|
|
19735
19612
|
if (enableAskSage) {
|
|
19736
19613
|
params[Param.enableAskSage] = enableAskSage;
|
|
19737
19614
|
}
|
|
19738
|
-
|
|
19739
|
-
if (isOnBeforeGetVizDataInterceptEnabled && !enableApiIntercept) {
|
|
19615
|
+
if (isOnBeforeGetVizDataInterceptEnabled) {
|
|
19740
19616
|
params[Param.IsOnBeforeGetVizDataInterceptEnabled] = isOnBeforeGetVizDataInterceptEnabled;
|
|
19741
19617
|
}
|
|
19742
19618
|
if (homePageSearchBarMode) {
|
|
@@ -19751,9 +19627,15 @@ mutation GetUnsavedAnswerTML($session: BachSessionIdInput!, $exportDependencies:
|
|
|
19751
19627
|
if (isPNGInScheduledEmailsEnabled !== undefined) {
|
|
19752
19628
|
params[Param.isPNGInScheduledEmailsEnabled] = isPNGInScheduledEmailsEnabled;
|
|
19753
19629
|
}
|
|
19630
|
+
if (hideTagFilterChips !== undefined) {
|
|
19631
|
+
params[Param.HideTagFilterChips] = hideTagFilterChips;
|
|
19632
|
+
}
|
|
19754
19633
|
if (isLinkParametersEnabled !== undefined) {
|
|
19755
19634
|
params[Param.isLinkParametersEnabled] = isLinkParametersEnabled;
|
|
19756
19635
|
}
|
|
19636
|
+
if (isCentralizedLiveboardFilterUXEnabled != undefined) {
|
|
19637
|
+
params[Param.isCentralizedLiveboardFilterUXEnabled] = isCentralizedLiveboardFilterUXEnabled;
|
|
19638
|
+
}
|
|
19757
19639
|
params[Param.DataPanelV2Enabled] = dataPanelV2;
|
|
19758
19640
|
params[Param.HideHomepageLeftNav] = hideHomepageLeftNav;
|
|
19759
19641
|
params[Param.ModularHomeExperienceEnabled] = modularHomeExperience;
|
|
@@ -20108,7 +19990,7 @@ query GetEurekaVizSnapshots(
|
|
|
20108
19990
|
getEmbedParamsObject() {
|
|
20109
19991
|
let params = {};
|
|
20110
19992
|
params = this.getBaseQueryParams(params);
|
|
20111
|
-
const { enableVizTransformations, fullHeight, defaultHeight, visibleVizs, liveboardV2, vizId, hideTabPanel, activeTabId, hideLiveboardHeader, showLiveboardDescription, showLiveboardTitle, isLiveboardHeaderSticky = true, isLiveboardCompactHeaderEnabled = false, showLiveboardVerifiedBadge = true, showLiveboardReverifyBanner = true, hideIrrelevantChipsInLiveboardTabs = false, enableAskSage, enable2ColumnLayout, dataPanelV2 = true, enableCustomColumnGroups = false, oAuthPollingInterval, isForceRedirect, dataSourceId, coverAndFilterOptionInPDF = false, liveboardXLSXCSVDownload = false, isLiveboardStylingAndGroupingEnabled, isPNGInScheduledEmailsEnabled = false, showSpotterLimitations, isLinkParametersEnabled, } = this.viewConfig;
|
|
19993
|
+
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 = false, isLiveboardStylingAndGroupingEnabled, isPNGInScheduledEmailsEnabled = false, showSpotterLimitations, isCentralizedLiveboardFilterUXEnabled = false, isLinkParametersEnabled, } = this.viewConfig;
|
|
20112
19994
|
const preventLiveboardFilterRemoval = this.viewConfig.preventLiveboardFilterRemoval
|
|
20113
19995
|
|| this.viewConfig.preventPinboardFilterRemoval;
|
|
20114
19996
|
if (fullHeight === true) {
|
|
@@ -20176,11 +20058,15 @@ query GetEurekaVizSnapshots(
|
|
|
20176
20058
|
if (isLinkParametersEnabled !== undefined) {
|
|
20177
20059
|
params[Param.isLinkParametersEnabled] = isLinkParametersEnabled;
|
|
20178
20060
|
}
|
|
20061
|
+
if (isCentralizedLiveboardFilterUXEnabled !== undefined) {
|
|
20062
|
+
params[Param.isCentralizedLiveboardFilterUXEnabled] = isCentralizedLiveboardFilterUXEnabled;
|
|
20063
|
+
}
|
|
20179
20064
|
params[Param.LiveboardHeaderSticky] = isLiveboardHeaderSticky;
|
|
20180
20065
|
params[Param.LiveboardHeaderV2] = isLiveboardCompactHeaderEnabled;
|
|
20181
20066
|
params[Param.ShowLiveboardVerifiedBadge] = showLiveboardVerifiedBadge;
|
|
20182
20067
|
params[Param.ShowLiveboardReverifyBanner] = showLiveboardReverifyBanner;
|
|
20183
20068
|
params[Param.HideIrrelevantFiltersInTab] = hideIrrelevantChipsInLiveboardTabs;
|
|
20069
|
+
params[Param.IsEnhancedFilterInteractivityEnabled] = isEnhancedFilterInteractivityEnabled;
|
|
20184
20070
|
params[Param.DataPanelV2Enabled] = dataPanelV2;
|
|
20185
20071
|
params[Param.EnableCustomColumnGroups] = enableCustomColumnGroups;
|
|
20186
20072
|
params[Param.CoverAndFilterOptionInPDF] = coverAndFilterOptionInPDF;
|
|
@@ -20911,7 +20797,7 @@ query SendMessage($params: Input_convassist_SendMessageRequest) {
|
|
|
20911
20797
|
this.viewConfig = viewConfig;
|
|
20912
20798
|
}
|
|
20913
20799
|
getEmbedParamsObject() {
|
|
20914
|
-
const { worksheetId, searchOptions, disableSourceSelection, hideSourceSelection, dataPanelV2, showSpotterLimitations, hideSampleQuestions, runtimeFilters, excludeRuntimeFiltersfromURL, runtimeParameters, excludeRuntimeParametersfromURL, } = this.viewConfig;
|
|
20800
|
+
const { worksheetId, searchOptions, disableSourceSelection, hideSourceSelection, dataPanelV2, showSpotterLimitations, hideSampleQuestions, enablePastConversationsSidebar, runtimeFilters, excludeRuntimeFiltersfromURL, runtimeParameters, excludeRuntimeParametersfromURL, } = this.viewConfig;
|
|
20915
20801
|
if (!worksheetId) {
|
|
20916
20802
|
this.handleError(ERROR_MESSAGE.SPOTTER_EMBED_WORKSHEED_ID_NOT_FOUND);
|
|
20917
20803
|
}
|
|
@@ -20935,9 +20821,12 @@ query SendMessage($params: Input_convassist_SendMessageRequest) {
|
|
|
20935
20821
|
return queryParams;
|
|
20936
20822
|
}
|
|
20937
20823
|
getIframeSrc() {
|
|
20938
|
-
const { worksheetId, searchOptions, runtimeFilters, excludeRuntimeFiltersfromURL, runtimeParameters, excludeRuntimeParametersfromURL, } = this.viewConfig;
|
|
20824
|
+
const { worksheetId, searchOptions, runtimeFilters, excludeRuntimeFiltersfromURL, runtimeParameters, excludeRuntimeParametersfromURL, enablePastConversationsSidebar } = this.viewConfig;
|
|
20939
20825
|
const path = 'insights/conv-assist';
|
|
20940
20826
|
const queryParams = this.getEmbedParamsObject();
|
|
20827
|
+
if (!isUndefined_1(enablePastConversationsSidebar)) {
|
|
20828
|
+
queryParams[Param.EnablePastConversationsSidebar] = !!enablePastConversationsSidebar;
|
|
20829
|
+
}
|
|
20941
20830
|
let query = '';
|
|
20942
20831
|
const queryParamsString = getQueryParamString(queryParams, true);
|
|
20943
20832
|
if (queryParamsString) {
|
|
@@ -21039,6 +20928,7 @@ query SendMessage($params: Input_convassist_SendMessageRequest) {
|
|
|
21039
20928
|
});
|
|
21040
20929
|
handleRendering(tsEmbed);
|
|
21041
20930
|
if (forwardedRef) {
|
|
20931
|
+
// eslint-disable-next-line no-param-reassign
|
|
21042
20932
|
forwardedRef.current = tsEmbed;
|
|
21043
20933
|
}
|
|
21044
20934
|
return () => {
|
|
@@ -21259,7 +21149,7 @@ query SendMessage($params: Input_convassist_SendMessageRequest) {
|
|
|
21259
21149
|
*/
|
|
21260
21150
|
const SpotterMessage = React.forwardRef((props, ref) => {
|
|
21261
21151
|
const { message, query: _, ...otherProps } = props;
|
|
21262
|
-
return React.createElement(ConversationMessage, { ref: ref, ...message, ...otherProps });
|
|
21152
|
+
return (React.createElement(ConversationMessage, { ref: ref, ...message, ...otherProps }));
|
|
21263
21153
|
});
|
|
21264
21154
|
/**
|
|
21265
21155
|
* React component for PreRendered Conversation embed.
|
|
@@ -21852,7 +21742,8 @@ query SendMessage($params: Input_convassist_SendMessageRequest) {
|
|
|
21852
21742
|
return {
|
|
21853
21743
|
onAnchor: (source) => {
|
|
21854
21744
|
aliasObjects.push(source);
|
|
21855
|
-
|
|
21745
|
+
if (!prevAnchors)
|
|
21746
|
+
prevAnchors = anchorNames(doc);
|
|
21856
21747
|
const anchor = findNewAnchor(prefix, prevAnchors);
|
|
21857
21748
|
prevAnchors.add(anchor);
|
|
21858
21749
|
return anchor;
|
|
@@ -22016,36 +21907,23 @@ query SendMessage($params: Input_convassist_SendMessageRequest) {
|
|
|
22016
21907
|
* Resolve the value of this alias within `doc`, finding the last
|
|
22017
21908
|
* instance of the `source` anchor before this node.
|
|
22018
21909
|
*/
|
|
22019
|
-
resolve(doc
|
|
22020
|
-
let nodes;
|
|
22021
|
-
if (ctx?.aliasResolveCache) {
|
|
22022
|
-
nodes = ctx.aliasResolveCache;
|
|
22023
|
-
}
|
|
22024
|
-
else {
|
|
22025
|
-
nodes = [];
|
|
22026
|
-
visit$1(doc, {
|
|
22027
|
-
Node: (_key, node) => {
|
|
22028
|
-
if (isAlias(node) || hasAnchor(node))
|
|
22029
|
-
nodes.push(node);
|
|
22030
|
-
}
|
|
22031
|
-
});
|
|
22032
|
-
if (ctx)
|
|
22033
|
-
ctx.aliasResolveCache = nodes;
|
|
22034
|
-
}
|
|
21910
|
+
resolve(doc) {
|
|
22035
21911
|
let found = undefined;
|
|
22036
|
-
|
|
22037
|
-
|
|
22038
|
-
|
|
22039
|
-
|
|
22040
|
-
|
|
22041
|
-
|
|
21912
|
+
visit$1(doc, {
|
|
21913
|
+
Node: (_key, node) => {
|
|
21914
|
+
if (node === this)
|
|
21915
|
+
return visit$1.BREAK;
|
|
21916
|
+
if (node.anchor === this.source)
|
|
21917
|
+
found = node;
|
|
21918
|
+
}
|
|
21919
|
+
});
|
|
22042
21920
|
return found;
|
|
22043
21921
|
}
|
|
22044
21922
|
toJSON(_arg, ctx) {
|
|
22045
21923
|
if (!ctx)
|
|
22046
21924
|
return { source: this.source };
|
|
22047
21925
|
const { anchors, doc, maxAliasCount } = ctx;
|
|
22048
|
-
const source = this.resolve(doc
|
|
21926
|
+
const source = this.resolve(doc);
|
|
22049
21927
|
if (!source) {
|
|
22050
21928
|
const msg = `Unresolved alias (the anchor must be set before the alias): ${this.source}`;
|
|
22051
21929
|
throw new ReferenceError(msg);
|
|
@@ -22164,7 +22042,8 @@ query SendMessage($params: Input_convassist_SendMessageRequest) {
|
|
|
22164
22042
|
if (aliasDuplicateObjects && value && typeof value === 'object') {
|
|
22165
22043
|
ref = sourceObjects.get(value);
|
|
22166
22044
|
if (ref) {
|
|
22167
|
-
|
|
22045
|
+
if (!ref.anchor)
|
|
22046
|
+
ref.anchor = onAnchor(value);
|
|
22168
22047
|
return new Alias(ref.anchor);
|
|
22169
22048
|
}
|
|
22170
22049
|
else {
|
|
@@ -22675,7 +22554,7 @@ query SendMessage($params: Input_convassist_SendMessageRequest) {
|
|
|
22675
22554
|
const { blockQuote, commentString, lineWidth } = ctx.options;
|
|
22676
22555
|
// 1. Block can't end in whitespace unless the last line is non-empty.
|
|
22677
22556
|
// 2. Strings consisting of only whitespace are best rendered explicitly.
|
|
22678
|
-
if (!blockQuote || /\n[\t ]+$/.test(value)) {
|
|
22557
|
+
if (!blockQuote || /\n[\t ]+$/.test(value) || /^\s*$/.test(value)) {
|
|
22679
22558
|
return quotedString(value, ctx);
|
|
22680
22559
|
}
|
|
22681
22560
|
const indent = ctx.indent ||
|
|
@@ -22735,32 +22614,23 @@ query SendMessage($params: Input_convassist_SendMessageRequest) {
|
|
|
22735
22614
|
start = start.replace(/\n+/g, `$&${indent}`);
|
|
22736
22615
|
}
|
|
22737
22616
|
const indentSize = indent ? '2' : '1'; // root is at -1
|
|
22738
|
-
|
|
22739
|
-
let header = (startWithSpace ? indentSize : '') + chomp;
|
|
22617
|
+
let header = (literal ? '|' : '>') + (startWithSpace ? indentSize : '') + chomp;
|
|
22740
22618
|
if (comment) {
|
|
22741
22619
|
header += ' ' + commentString(comment.replace(/ ?[\r\n]+/g, ' '));
|
|
22742
22620
|
if (onComment)
|
|
22743
22621
|
onComment();
|
|
22744
22622
|
}
|
|
22745
|
-
if (
|
|
22746
|
-
|
|
22747
|
-
|
|
22748
|
-
.replace(/(?:^|\n)([\t ].*)(?:([\n\t ]*)\n(?![\n\t ]))?/g, '$1$2') // more-indented lines aren't folded
|
|
22749
|
-
// ^ more-ind. ^ empty ^ capture next empty lines only at end of indent
|
|
22750
|
-
.replace(/\n+/g, `$&${indent}`);
|
|
22751
|
-
let literalFallback = false;
|
|
22752
|
-
const foldOptions = getFoldOptions(ctx, true);
|
|
22753
|
-
if (blockQuote !== 'folded' && type !== Scalar.BLOCK_FOLDED) {
|
|
22754
|
-
foldOptions.onOverflow = () => {
|
|
22755
|
-
literalFallback = true;
|
|
22756
|
-
};
|
|
22757
|
-
}
|
|
22758
|
-
const body = foldFlowLines(`${start}${foldedValue}${end}`, indent, FOLD_BLOCK, foldOptions);
|
|
22759
|
-
if (!literalFallback)
|
|
22760
|
-
return `>${header}\n${indent}${body}`;
|
|
22623
|
+
if (literal) {
|
|
22624
|
+
value = value.replace(/\n+/g, `$&${indent}`);
|
|
22625
|
+
return `${header}\n${indent}${start}${value}${end}`;
|
|
22761
22626
|
}
|
|
22762
|
-
value = value
|
|
22763
|
-
|
|
22627
|
+
value = value
|
|
22628
|
+
.replace(/\n+/g, '\n$&')
|
|
22629
|
+
.replace(/(?:^|\n)([\t ].*)(?:([\n\t ]*)\n(?![\n\t ]))?/g, '$1$2') // more-indented lines aren't folded
|
|
22630
|
+
// ^ more-ind. ^ empty ^ capture next empty lines only at end of indent
|
|
22631
|
+
.replace(/\n+/g, `$&${indent}`);
|
|
22632
|
+
const body = foldFlowLines(`${start}${value}${end}`, indent, FOLD_BLOCK, getFoldOptions(ctx, true));
|
|
22633
|
+
return `${header}\n${indent}${body}`;
|
|
22764
22634
|
}
|
|
22765
22635
|
function plainString(item, ctx, onComment, onChompKeep) {
|
|
22766
22636
|
const { type, value } = item;
|
|
@@ -22769,9 +22639,10 @@ query SendMessage($params: Input_convassist_SendMessageRequest) {
|
|
|
22769
22639
|
(inFlow && /[[\]{},]/.test(value))) {
|
|
22770
22640
|
return quotedString(value, ctx);
|
|
22771
22641
|
}
|
|
22772
|
-
if (
|
|
22642
|
+
if (!value ||
|
|
22643
|
+
/^[\n\t ,[\]{}#&*!|>'"%@`]|^[?-]$|^[?-][ \t]|[\n:][ \t]|[ \t]\n|[\n\t ]#|[\n\t :]$/.test(value)) {
|
|
22773
22644
|
// not allowed:
|
|
22774
|
-
// - '-' or '?'
|
|
22645
|
+
// - empty string, '-' or '?'
|
|
22775
22646
|
// - start with an indicator character (except [?:-]) or /[?-] /
|
|
22776
22647
|
// - '\n ', ': ' or ' \n' anywhere
|
|
22777
22648
|
// - '#' not preceded by a non-space char
|
|
@@ -22900,12 +22771,7 @@ query SendMessage($params: Input_convassist_SendMessageRequest) {
|
|
|
22900
22771
|
let obj;
|
|
22901
22772
|
if (isScalar$1(item)) {
|
|
22902
22773
|
obj = item.value;
|
|
22903
|
-
|
|
22904
|
-
if (match.length > 1) {
|
|
22905
|
-
const testMatch = match.filter(t => t.test);
|
|
22906
|
-
if (testMatch.length > 0)
|
|
22907
|
-
match = testMatch;
|
|
22908
|
-
}
|
|
22774
|
+
const match = tags.filter(t => t.identify?.(obj));
|
|
22909
22775
|
tagObj =
|
|
22910
22776
|
match.find(t => t.format === item.format) ?? match.find(t => !t.format);
|
|
22911
22777
|
}
|
|
@@ -22914,7 +22780,7 @@ query SendMessage($params: Input_convassist_SendMessageRequest) {
|
|
|
22914
22780
|
tagObj = tags.find(t => t.nodeClass && obj instanceof t.nodeClass);
|
|
22915
22781
|
}
|
|
22916
22782
|
if (!tagObj) {
|
|
22917
|
-
const name = obj?.constructor?.name ??
|
|
22783
|
+
const name = obj?.constructor?.name ?? typeof obj;
|
|
22918
22784
|
throw new Error(`Tag not resolved for ${name} value`);
|
|
22919
22785
|
}
|
|
22920
22786
|
return tagObj;
|
|
@@ -22929,7 +22795,7 @@ query SendMessage($params: Input_convassist_SendMessageRequest) {
|
|
|
22929
22795
|
anchors.add(anchor);
|
|
22930
22796
|
props.push(`&${anchor}`);
|
|
22931
22797
|
}
|
|
22932
|
-
const tag = node.tag
|
|
22798
|
+
const tag = node.tag ? node.tag : tagObj.default ? null : tagObj.tag;
|
|
22933
22799
|
if (tag)
|
|
22934
22800
|
props.push(doc.directives.tagString(tag));
|
|
22935
22801
|
return props.join(' ');
|
|
@@ -22955,7 +22821,8 @@ query SendMessage($params: Input_convassist_SendMessageRequest) {
|
|
|
22955
22821
|
const node = isNode(item)
|
|
22956
22822
|
? item
|
|
22957
22823
|
: ctx.doc.createNode(item, { onTagObj: o => (tagObj = o) });
|
|
22958
|
-
|
|
22824
|
+
if (!tagObj)
|
|
22825
|
+
tagObj = getTagObject(ctx.doc.schema.tags, node);
|
|
22959
22826
|
const props = stringifyProps(node, tagObj, ctx);
|
|
22960
22827
|
if (props.length > 0)
|
|
22961
22828
|
ctx.indentAtStart = (ctx.indentAtStart ?? 0) + props.length + 1;
|
|
@@ -23117,10 +22984,54 @@ query SendMessage($params: Input_convassist_SendMessageRequest) {
|
|
|
23117
22984
|
|
|
23118
22985
|
function warn(logLevel, warning) {
|
|
23119
22986
|
if (logLevel === 'debug' || logLevel === 'warn') {
|
|
23120
|
-
|
|
22987
|
+
if (typeof process !== 'undefined' && process.emitWarning)
|
|
22988
|
+
process.emitWarning(warning);
|
|
22989
|
+
else
|
|
22990
|
+
console.warn(warning);
|
|
23121
22991
|
}
|
|
23122
22992
|
}
|
|
23123
22993
|
|
|
22994
|
+
const MERGE_KEY = '<<';
|
|
22995
|
+
function addPairToJSMap(ctx, map, { key, value }) {
|
|
22996
|
+
if (ctx?.doc.schema.merge && isMergeKey(key)) {
|
|
22997
|
+
value = isAlias(value) ? value.resolve(ctx.doc) : value;
|
|
22998
|
+
if (isSeq(value))
|
|
22999
|
+
for (const it of value.items)
|
|
23000
|
+
mergeToJSMap(ctx, map, it);
|
|
23001
|
+
else if (Array.isArray(value))
|
|
23002
|
+
for (const it of value)
|
|
23003
|
+
mergeToJSMap(ctx, map, it);
|
|
23004
|
+
else
|
|
23005
|
+
mergeToJSMap(ctx, map, value);
|
|
23006
|
+
}
|
|
23007
|
+
else {
|
|
23008
|
+
const jsKey = toJS(key, '', ctx);
|
|
23009
|
+
if (map instanceof Map) {
|
|
23010
|
+
map.set(jsKey, toJS(value, jsKey, ctx));
|
|
23011
|
+
}
|
|
23012
|
+
else if (map instanceof Set) {
|
|
23013
|
+
map.add(jsKey);
|
|
23014
|
+
}
|
|
23015
|
+
else {
|
|
23016
|
+
const stringKey = stringifyKey(key, jsKey, ctx);
|
|
23017
|
+
const jsValue = toJS(value, stringKey, ctx);
|
|
23018
|
+
if (stringKey in map)
|
|
23019
|
+
Object.defineProperty(map, stringKey, {
|
|
23020
|
+
value: jsValue,
|
|
23021
|
+
writable: true,
|
|
23022
|
+
enumerable: true,
|
|
23023
|
+
configurable: true
|
|
23024
|
+
});
|
|
23025
|
+
else
|
|
23026
|
+
map[stringKey] = jsValue;
|
|
23027
|
+
}
|
|
23028
|
+
}
|
|
23029
|
+
return map;
|
|
23030
|
+
}
|
|
23031
|
+
const isMergeKey = (key) => key === MERGE_KEY ||
|
|
23032
|
+
(isScalar$1(key) &&
|
|
23033
|
+
key.value === MERGE_KEY &&
|
|
23034
|
+
(!key.type || key.type === Scalar.PLAIN));
|
|
23124
23035
|
// If the value associated with a merge key is a single mapping node, each of
|
|
23125
23036
|
// its key/value pairs is inserted into the current mapping, unless the key
|
|
23126
23037
|
// already exists in it. If the value associated with the merge key is a
|
|
@@ -23128,35 +23039,7 @@ query SendMessage($params: Input_convassist_SendMessageRequest) {
|
|
|
23128
23039
|
// of these nodes is merged in turn according to its order in the sequence.
|
|
23129
23040
|
// Keys in mapping nodes earlier in the sequence override keys specified in
|
|
23130
23041
|
// later mapping nodes. -- http://yaml.org/type/merge.html
|
|
23131
|
-
|
|
23132
|
-
const merge = {
|
|
23133
|
-
identify: value => value === MERGE_KEY ||
|
|
23134
|
-
(typeof value === 'symbol' && value.description === MERGE_KEY),
|
|
23135
|
-
default: 'key',
|
|
23136
|
-
tag: 'tag:yaml.org,2002:merge',
|
|
23137
|
-
test: /^<<$/,
|
|
23138
|
-
resolve: () => Object.assign(new Scalar(Symbol(MERGE_KEY)), {
|
|
23139
|
-
addToJSMap: addMergeToJSMap
|
|
23140
|
-
}),
|
|
23141
|
-
stringify: () => MERGE_KEY
|
|
23142
|
-
};
|
|
23143
|
-
const isMergeKey = (ctx, key) => (merge.identify(key) ||
|
|
23144
|
-
(isScalar$1(key) &&
|
|
23145
|
-
(!key.type || key.type === Scalar.PLAIN) &&
|
|
23146
|
-
merge.identify(key.value))) &&
|
|
23147
|
-
ctx?.doc.schema.tags.some(tag => tag.tag === merge.tag && tag.default);
|
|
23148
|
-
function addMergeToJSMap(ctx, map, value) {
|
|
23149
|
-
value = ctx && isAlias(value) ? value.resolve(ctx.doc) : value;
|
|
23150
|
-
if (isSeq(value))
|
|
23151
|
-
for (const it of value.items)
|
|
23152
|
-
mergeValue(ctx, map, it);
|
|
23153
|
-
else if (Array.isArray(value))
|
|
23154
|
-
for (const it of value)
|
|
23155
|
-
mergeValue(ctx, map, it);
|
|
23156
|
-
else
|
|
23157
|
-
mergeValue(ctx, map, value);
|
|
23158
|
-
}
|
|
23159
|
-
function mergeValue(ctx, map, value) {
|
|
23042
|
+
function mergeToJSMap(ctx, map, value) {
|
|
23160
23043
|
const source = ctx && isAlias(value) ? value.resolve(ctx.doc) : value;
|
|
23161
23044
|
if (!isMap(source))
|
|
23162
23045
|
throw new Error('Merge sources must be maps or map aliases');
|
|
@@ -23180,41 +23063,9 @@ query SendMessage($params: Input_convassist_SendMessageRequest) {
|
|
|
23180
23063
|
}
|
|
23181
23064
|
return map;
|
|
23182
23065
|
}
|
|
23183
|
-
|
|
23184
|
-
function addPairToJSMap(ctx, map, { key, value }) {
|
|
23185
|
-
if (isNode(key) && key.addToJSMap)
|
|
23186
|
-
key.addToJSMap(ctx, map, value);
|
|
23187
|
-
// TODO: Should drop this special case for bare << handling
|
|
23188
|
-
else if (isMergeKey(ctx, key))
|
|
23189
|
-
addMergeToJSMap(ctx, map, value);
|
|
23190
|
-
else {
|
|
23191
|
-
const jsKey = toJS(key, '', ctx);
|
|
23192
|
-
if (map instanceof Map) {
|
|
23193
|
-
map.set(jsKey, toJS(value, jsKey, ctx));
|
|
23194
|
-
}
|
|
23195
|
-
else if (map instanceof Set) {
|
|
23196
|
-
map.add(jsKey);
|
|
23197
|
-
}
|
|
23198
|
-
else {
|
|
23199
|
-
const stringKey = stringifyKey(key, jsKey, ctx);
|
|
23200
|
-
const jsValue = toJS(value, stringKey, ctx);
|
|
23201
|
-
if (stringKey in map)
|
|
23202
|
-
Object.defineProperty(map, stringKey, {
|
|
23203
|
-
value: jsValue,
|
|
23204
|
-
writable: true,
|
|
23205
|
-
enumerable: true,
|
|
23206
|
-
configurable: true
|
|
23207
|
-
});
|
|
23208
|
-
else
|
|
23209
|
-
map[stringKey] = jsValue;
|
|
23210
|
-
}
|
|
23211
|
-
}
|
|
23212
|
-
return map;
|
|
23213
|
-
}
|
|
23214
23066
|
function stringifyKey(key, jsKey, ctx) {
|
|
23215
23067
|
if (jsKey === null)
|
|
23216
23068
|
return '';
|
|
23217
|
-
// eslint-disable-next-line @typescript-eslint/no-base-to-string
|
|
23218
23069
|
if (typeof jsKey !== 'object')
|
|
23219
23070
|
return String(jsKey);
|
|
23220
23071
|
if (isNode(key) && ctx?.doc) {
|
|
@@ -23847,7 +23698,7 @@ query SendMessage($params: Input_convassist_SendMessageRequest) {
|
|
|
23847
23698
|
identify: value => typeof value === 'boolean',
|
|
23848
23699
|
default: true,
|
|
23849
23700
|
tag: 'tag:yaml.org,2002:bool',
|
|
23850
|
-
test: /^true
|
|
23701
|
+
test: /^true|false$/,
|
|
23851
23702
|
resolve: str => str === 'true',
|
|
23852
23703
|
stringify: stringifyJSON
|
|
23853
23704
|
},
|
|
@@ -23892,7 +23743,10 @@ query SendMessage($params: Input_convassist_SendMessageRequest) {
|
|
|
23892
23743
|
* document.querySelector('#photo').src = URL.createObjectURL(blob)
|
|
23893
23744
|
*/
|
|
23894
23745
|
resolve(src, onError) {
|
|
23895
|
-
if (typeof
|
|
23746
|
+
if (typeof Buffer === 'function') {
|
|
23747
|
+
return Buffer.from(src, 'base64');
|
|
23748
|
+
}
|
|
23749
|
+
else if (typeof atob === 'function') {
|
|
23896
23750
|
// On IE 11, atob() can't handle newlines
|
|
23897
23751
|
const str = atob(src.replace(/[\n\r]/g, ''));
|
|
23898
23752
|
const buffer = new Uint8Array(str.length);
|
|
@@ -23906,11 +23760,15 @@ query SendMessage($params: Input_convassist_SendMessageRequest) {
|
|
|
23906
23760
|
}
|
|
23907
23761
|
},
|
|
23908
23762
|
stringify({ comment, type, value }, ctx, onComment, onChompKeep) {
|
|
23909
|
-
if (!value)
|
|
23910
|
-
return '';
|
|
23911
23763
|
const buf = value; // checked earlier by binary.identify()
|
|
23912
23764
|
let str;
|
|
23913
|
-
if (typeof
|
|
23765
|
+
if (typeof Buffer === 'function') {
|
|
23766
|
+
str =
|
|
23767
|
+
buf instanceof Buffer
|
|
23768
|
+
? buf.toString('base64')
|
|
23769
|
+
: Buffer.from(buf.buffer).toString('base64');
|
|
23770
|
+
}
|
|
23771
|
+
else if (typeof btoa === 'function') {
|
|
23914
23772
|
let s = '';
|
|
23915
23773
|
for (let i = 0; i < buf.length; ++i)
|
|
23916
23774
|
s += String.fromCharCode(buf[i]);
|
|
@@ -23919,7 +23777,8 @@ query SendMessage($params: Input_convassist_SendMessageRequest) {
|
|
|
23919
23777
|
else {
|
|
23920
23778
|
throw new Error('This environment does not support writing binary tags; either Buffer or btoa is required');
|
|
23921
23779
|
}
|
|
23922
|
-
|
|
23780
|
+
if (!type)
|
|
23781
|
+
type = Scalar.BLOCK_LITERAL;
|
|
23923
23782
|
if (type !== Scalar.QUOTE_DOUBLE) {
|
|
23924
23783
|
const lineWidth = Math.max(ctx.options.lineWidth - ctx.indent.length, ctx.options.minContentWidth);
|
|
23925
23784
|
const n = Math.ceil(str.length / lineWidth);
|
|
@@ -24388,7 +24247,7 @@ query SendMessage($params: Input_convassist_SendMessageRequest) {
|
|
|
24388
24247
|
}
|
|
24389
24248
|
return new Date(date);
|
|
24390
24249
|
},
|
|
24391
|
-
stringify: ({ value }) => value
|
|
24250
|
+
stringify: ({ value }) => value.toISOString().replace(/((T00:00)?:00)?\.000Z$/, '')
|
|
24392
24251
|
};
|
|
24393
24252
|
|
|
24394
24253
|
const schema = [
|
|
@@ -24406,7 +24265,6 @@ query SendMessage($params: Input_convassist_SendMessageRequest) {
|
|
|
24406
24265
|
floatExp,
|
|
24407
24266
|
float,
|
|
24408
24267
|
binary,
|
|
24409
|
-
merge,
|
|
24410
24268
|
omap,
|
|
24411
24269
|
pairs,
|
|
24412
24270
|
set,
|
|
@@ -24434,7 +24292,6 @@ query SendMessage($params: Input_convassist_SendMessageRequest) {
|
|
|
24434
24292
|
intOct: intOct$1,
|
|
24435
24293
|
intTime,
|
|
24436
24294
|
map,
|
|
24437
|
-
merge,
|
|
24438
24295
|
null: nullTag,
|
|
24439
24296
|
omap,
|
|
24440
24297
|
pairs,
|
|
@@ -24444,20 +24301,13 @@ query SendMessage($params: Input_convassist_SendMessageRequest) {
|
|
|
24444
24301
|
};
|
|
24445
24302
|
const coreKnownTags = {
|
|
24446
24303
|
'tag:yaml.org,2002:binary': binary,
|
|
24447
|
-
'tag:yaml.org,2002:merge': merge,
|
|
24448
24304
|
'tag:yaml.org,2002:omap': omap,
|
|
24449
24305
|
'tag:yaml.org,2002:pairs': pairs,
|
|
24450
24306
|
'tag:yaml.org,2002:set': set,
|
|
24451
24307
|
'tag:yaml.org,2002:timestamp': timestamp
|
|
24452
24308
|
};
|
|
24453
|
-
function getTags(customTags, schemaName
|
|
24454
|
-
|
|
24455
|
-
if (schemaTags && !customTags) {
|
|
24456
|
-
return addMergeTag && !schemaTags.includes(merge)
|
|
24457
|
-
? schemaTags.concat(merge)
|
|
24458
|
-
: schemaTags.slice();
|
|
24459
|
-
}
|
|
24460
|
-
let tags = schemaTags;
|
|
24309
|
+
function getTags(customTags, schemaName) {
|
|
24310
|
+
let tags = schemas.get(schemaName);
|
|
24461
24311
|
if (!tags) {
|
|
24462
24312
|
if (Array.isArray(customTags))
|
|
24463
24313
|
tags = [];
|
|
@@ -24476,21 +24326,17 @@ query SendMessage($params: Input_convassist_SendMessageRequest) {
|
|
|
24476
24326
|
else if (typeof customTags === 'function') {
|
|
24477
24327
|
tags = customTags(tags.slice());
|
|
24478
24328
|
}
|
|
24479
|
-
|
|
24480
|
-
|
|
24481
|
-
|
|
24482
|
-
const tagObj =
|
|
24483
|
-
if (
|
|
24484
|
-
|
|
24485
|
-
|
|
24486
|
-
|
|
24487
|
-
|
|
24488
|
-
|
|
24489
|
-
|
|
24490
|
-
if (!tags.includes(tagObj))
|
|
24491
|
-
tags.push(tagObj);
|
|
24492
|
-
return tags;
|
|
24493
|
-
}, []);
|
|
24329
|
+
return tags.map(tag => {
|
|
24330
|
+
if (typeof tag !== 'string')
|
|
24331
|
+
return tag;
|
|
24332
|
+
const tagObj = tagsByName[tag];
|
|
24333
|
+
if (tagObj)
|
|
24334
|
+
return tagObj;
|
|
24335
|
+
const keys = Object.keys(tagsByName)
|
|
24336
|
+
.map(key => JSON.stringify(key))
|
|
24337
|
+
.join(', ');
|
|
24338
|
+
throw new Error(`Unknown custom tag "${tag}"; use one of ${keys}`);
|
|
24339
|
+
});
|
|
24494
24340
|
}
|
|
24495
24341
|
|
|
24496
24342
|
const sortMapEntriesByKey = (a, b) => a.key < b.key ? -1 : a.key > b.key ? 1 : 0;
|
|
@@ -24501,9 +24347,10 @@ query SendMessage($params: Input_convassist_SendMessageRequest) {
|
|
|
24501
24347
|
: compat
|
|
24502
24348
|
? getTags(null, compat)
|
|
24503
24349
|
: null;
|
|
24350
|
+
this.merge = !!merge;
|
|
24504
24351
|
this.name = (typeof schema === 'string' && schema) || 'core';
|
|
24505
24352
|
this.knownTags = resolveKnownTags ? coreKnownTags : {};
|
|
24506
|
-
this.tags = getTags(customTags, this.name
|
|
24353
|
+
this.tags = getTags(customTags, this.name);
|
|
24507
24354
|
this.toStringOptions = toStringDefaults ?? null;
|
|
24508
24355
|
Object.defineProperty(this, MAP, { value: map });
|
|
24509
24356
|
Object.defineProperty(this, SCALAR$1, { value: string });
|
|
@@ -24628,7 +24475,6 @@ query SendMessage($params: Input_convassist_SendMessageRequest) {
|
|
|
24628
24475
|
logLevel: 'warn',
|
|
24629
24476
|
prettyErrors: true,
|
|
24630
24477
|
strict: true,
|
|
24631
|
-
stringKeys: false,
|
|
24632
24478
|
uniqueKeys: true,
|
|
24633
24479
|
version: '1.2'
|
|
24634
24480
|
}, options);
|
|
@@ -24852,7 +24698,7 @@ query SendMessage($params: Input_convassist_SendMessageRequest) {
|
|
|
24852
24698
|
this.directives.yaml.version = '1.1';
|
|
24853
24699
|
else
|
|
24854
24700
|
this.directives = new Directives({ version: '1.1' });
|
|
24855
|
-
opt = { resolveKnownTags: false, schema: 'yaml-1.1' };
|
|
24701
|
+
opt = { merge: true, resolveKnownTags: false, schema: 'yaml-1.1' };
|
|
24856
24702
|
break;
|
|
24857
24703
|
case '1.2':
|
|
24858
24704
|
case 'next':
|
|
@@ -24860,7 +24706,7 @@ query SendMessage($params: Input_convassist_SendMessageRequest) {
|
|
|
24860
24706
|
this.directives.yaml.version = version;
|
|
24861
24707
|
else
|
|
24862
24708
|
this.directives = new Directives({ version });
|
|
24863
|
-
opt = { resolveKnownTags: true, schema: 'core' };
|
|
24709
|
+
opt = { merge: false, resolveKnownTags: true, schema: 'core' };
|
|
24864
24710
|
break;
|
|
24865
24711
|
case null:
|
|
24866
24712
|
if (this.directives)
|
|
@@ -25038,7 +24884,7 @@ query SendMessage($params: Input_convassist_SendMessageRequest) {
|
|
|
25038
24884
|
if (atNewline) {
|
|
25039
24885
|
if (comment)
|
|
25040
24886
|
comment += token.source;
|
|
25041
|
-
else
|
|
24887
|
+
else
|
|
25042
24888
|
spaceBefore = true;
|
|
25043
24889
|
}
|
|
25044
24890
|
else
|
|
@@ -25055,7 +24901,8 @@ query SendMessage($params: Input_convassist_SendMessageRequest) {
|
|
|
25055
24901
|
if (token.source.endsWith(':'))
|
|
25056
24902
|
onError(token.offset + token.source.length - 1, 'BAD_ALIAS', 'Anchor ending in : is ambiguous', true);
|
|
25057
24903
|
anchor = token;
|
|
25058
|
-
|
|
24904
|
+
if (start === null)
|
|
24905
|
+
start = token.offset;
|
|
25059
24906
|
atNewline = false;
|
|
25060
24907
|
hasSpace = false;
|
|
25061
24908
|
reqSpace = true;
|
|
@@ -25064,7 +24911,8 @@ query SendMessage($params: Input_convassist_SendMessageRequest) {
|
|
|
25064
24911
|
if (tag)
|
|
25065
24912
|
onError(token, 'MULTIPLE_TAGS', 'A node can have at most one tag');
|
|
25066
24913
|
tag = token;
|
|
25067
|
-
|
|
24914
|
+
if (start === null)
|
|
24915
|
+
start = token.offset;
|
|
25068
24916
|
atNewline = false;
|
|
25069
24917
|
hasSpace = false;
|
|
25070
24918
|
reqSpace = true;
|
|
@@ -25177,7 +25025,11 @@ query SendMessage($params: Input_convassist_SendMessageRequest) {
|
|
|
25177
25025
|
return false;
|
|
25178
25026
|
const isEqual = typeof uniqueKeys === 'function'
|
|
25179
25027
|
? uniqueKeys
|
|
25180
|
-
: (a, b) => a === b ||
|
|
25028
|
+
: (a, b) => a === b ||
|
|
25029
|
+
(isScalar$1(a) &&
|
|
25030
|
+
isScalar$1(b) &&
|
|
25031
|
+
a.value === b.value &&
|
|
25032
|
+
!(a.value === '<<' && ctx.schema.merge));
|
|
25181
25033
|
return items.some(pair => isEqual(pair.key, search));
|
|
25182
25034
|
}
|
|
25183
25035
|
|
|
@@ -25226,14 +25078,12 @@ query SendMessage($params: Input_convassist_SendMessageRequest) {
|
|
|
25226
25078
|
onError(offset, 'BAD_INDENT', startColMsg);
|
|
25227
25079
|
}
|
|
25228
25080
|
// key value
|
|
25229
|
-
ctx.atKey = true;
|
|
25230
25081
|
const keyStart = keyProps.end;
|
|
25231
25082
|
const keyNode = key
|
|
25232
25083
|
? composeNode(ctx, key, keyProps, onError)
|
|
25233
25084
|
: composeEmptyNode(ctx, keyStart, start, null, keyProps, onError);
|
|
25234
25085
|
if (ctx.schema.compat)
|
|
25235
25086
|
flowIndentCheck(bm.indent, key, onError);
|
|
25236
|
-
ctx.atKey = false;
|
|
25237
25087
|
if (mapIncludes(ctx, map.items, keyNode))
|
|
25238
25088
|
onError(keyStart, 'DUPLICATE_KEY', 'Map keys must be unique');
|
|
25239
25089
|
// value properties
|
|
@@ -25293,8 +25143,6 @@ query SendMessage($params: Input_convassist_SendMessageRequest) {
|
|
|
25293
25143
|
const seq = new NodeClass(ctx.schema);
|
|
25294
25144
|
if (ctx.atRoot)
|
|
25295
25145
|
ctx.atRoot = false;
|
|
25296
|
-
if (ctx.atKey)
|
|
25297
|
-
ctx.atKey = false;
|
|
25298
25146
|
let offset = bs.offset;
|
|
25299
25147
|
let commentEnd = null;
|
|
25300
25148
|
for (const { start, value } of bs.items) {
|
|
@@ -25379,8 +25227,6 @@ query SendMessage($params: Input_convassist_SendMessageRequest) {
|
|
|
25379
25227
|
const atRoot = ctx.atRoot;
|
|
25380
25228
|
if (atRoot)
|
|
25381
25229
|
ctx.atRoot = false;
|
|
25382
|
-
if (ctx.atKey)
|
|
25383
|
-
ctx.atKey = false;
|
|
25384
25230
|
let offset = fc.offset + fc.start.source.length;
|
|
25385
25231
|
for (let i = 0; i < fc.items.length; ++i) {
|
|
25386
25232
|
const collItem = fc.items[i];
|
|
@@ -25460,14 +25306,12 @@ query SendMessage($params: Input_convassist_SendMessageRequest) {
|
|
|
25460
25306
|
else {
|
|
25461
25307
|
// item is a key+value pair
|
|
25462
25308
|
// key value
|
|
25463
|
-
ctx.atKey = true;
|
|
25464
25309
|
const keyStart = props.end;
|
|
25465
25310
|
const keyNode = key
|
|
25466
25311
|
? composeNode(ctx, key, props, onError)
|
|
25467
25312
|
: composeEmptyNode(ctx, keyStart, start, null, props, onError);
|
|
25468
25313
|
if (isBlock(key))
|
|
25469
25314
|
onError(keyNode.range, 'BLOCK_IN_FLOW', blockMsg);
|
|
25470
|
-
ctx.atKey = false;
|
|
25471
25315
|
// value properties
|
|
25472
25316
|
const valueProps = resolveProps(sep ?? [], {
|
|
25473
25317
|
flow: fcName,
|
|
@@ -25623,8 +25467,8 @@ query SendMessage($params: Input_convassist_SendMessageRequest) {
|
|
|
25623
25467
|
tag = kt;
|
|
25624
25468
|
}
|
|
25625
25469
|
else {
|
|
25626
|
-
if (kt) {
|
|
25627
|
-
onError(tagToken, 'BAD_COLLECTION_TYPE', `${kt.tag} used for ${expType} collection, but expects ${kt.collection
|
|
25470
|
+
if (kt?.collection) {
|
|
25471
|
+
onError(tagToken, 'BAD_COLLECTION_TYPE', `${kt.tag} used for ${expType} collection, but expects ${kt.collection}`, true);
|
|
25628
25472
|
}
|
|
25629
25473
|
else {
|
|
25630
25474
|
onError(tagToken, 'TAG_RESOLVE_FAILED', `Unresolved tag: ${tagName}`, true);
|
|
@@ -26065,16 +25909,11 @@ query SendMessage($params: Input_convassist_SendMessageRequest) {
|
|
|
26065
25909
|
const tagName = tagToken
|
|
26066
25910
|
? ctx.directives.tagName(tagToken.source, msg => onError(tagToken, 'TAG_RESOLVE_FAILED', msg))
|
|
26067
25911
|
: null;
|
|
26068
|
-
|
|
26069
|
-
|
|
26070
|
-
|
|
26071
|
-
|
|
26072
|
-
|
|
26073
|
-
tag = findScalarTagByName(ctx.schema, value, tagName, tagToken, onError);
|
|
26074
|
-
else if (token.type === 'scalar')
|
|
26075
|
-
tag = findScalarTagByTest(ctx, value, token, onError);
|
|
26076
|
-
else
|
|
26077
|
-
tag = ctx.schema[SCALAR$1];
|
|
25912
|
+
const tag = tagToken && tagName
|
|
25913
|
+
? findScalarTagByName(ctx.schema, value, tagName, tagToken, onError)
|
|
25914
|
+
: token.type === 'scalar'
|
|
25915
|
+
? findScalarTagByTest(ctx, value, token, onError)
|
|
25916
|
+
: ctx.schema[SCALAR$1];
|
|
26078
25917
|
let scalar;
|
|
26079
25918
|
try {
|
|
26080
25919
|
const res = tag.resolve(value, msg => onError(tagToken ?? token, 'TAG_RESOLVE_FAILED', msg), ctx.options);
|
|
@@ -26122,9 +25961,8 @@ query SendMessage($params: Input_convassist_SendMessageRequest) {
|
|
|
26122
25961
|
onError(tagToken, 'TAG_RESOLVE_FAILED', `Unresolved tag: ${tagName}`, tagName !== 'tag:yaml.org,2002:str');
|
|
26123
25962
|
return schema[SCALAR$1];
|
|
26124
25963
|
}
|
|
26125
|
-
function findScalarTagByTest({
|
|
26126
|
-
const tag = schema.tags.find(tag =>
|
|
26127
|
-
tag.test?.test(value)) || schema[SCALAR$1];
|
|
25964
|
+
function findScalarTagByTest({ directives, schema }, value, token, onError) {
|
|
25965
|
+
const tag = schema.tags.find(tag => tag.default && tag.test?.test(value)) || schema[SCALAR$1];
|
|
26128
25966
|
if (schema.compat) {
|
|
26129
25967
|
const compat = schema.compat.find(tag => tag.default && tag.test?.test(value)) ??
|
|
26130
25968
|
schema[SCALAR$1];
|
|
@@ -26140,7 +25978,8 @@ query SendMessage($params: Input_convassist_SendMessageRequest) {
|
|
|
26140
25978
|
|
|
26141
25979
|
function emptyScalarPosition(offset, before, pos) {
|
|
26142
25980
|
if (before) {
|
|
26143
|
-
|
|
25981
|
+
if (pos === null)
|
|
25982
|
+
pos = before.length;
|
|
26144
25983
|
for (let i = pos - 1; i >= 0; --i) {
|
|
26145
25984
|
let st = before[i];
|
|
26146
25985
|
switch (st.type) {
|
|
@@ -26165,7 +26004,6 @@ query SendMessage($params: Input_convassist_SendMessageRequest) {
|
|
|
26165
26004
|
|
|
26166
26005
|
const CN = { composeNode, composeEmptyNode };
|
|
26167
26006
|
function composeNode(ctx, token, props, onError) {
|
|
26168
|
-
const atKey = ctx.atKey;
|
|
26169
26007
|
const { spaceBefore, comment, anchor, tag } = props;
|
|
26170
26008
|
let node;
|
|
26171
26009
|
let isSrcToken = true;
|
|
@@ -26201,14 +26039,6 @@ query SendMessage($params: Input_convassist_SendMessageRequest) {
|
|
|
26201
26039
|
}
|
|
26202
26040
|
if (anchor && node.anchor === '')
|
|
26203
26041
|
onError(anchor, 'BAD_ALIAS', 'Anchor cannot be an empty string');
|
|
26204
|
-
if (atKey &&
|
|
26205
|
-
ctx.options.stringKeys &&
|
|
26206
|
-
(!isScalar$1(node) ||
|
|
26207
|
-
typeof node.value !== 'string' ||
|
|
26208
|
-
(node.tag && node.tag !== 'tag:yaml.org,2002:str'))) {
|
|
26209
|
-
const msg = 'With stringKeys, all keys must be strings';
|
|
26210
|
-
onError(tag ?? token, 'NON_STRING_KEY', msg);
|
|
26211
|
-
}
|
|
26212
26042
|
if (spaceBefore)
|
|
26213
26043
|
node.spaceBefore = true;
|
|
26214
26044
|
if (comment) {
|
|
@@ -26261,7 +26091,6 @@ query SendMessage($params: Input_convassist_SendMessageRequest) {
|
|
|
26261
26091
|
const opts = Object.assign({ _directives: directives }, options);
|
|
26262
26092
|
const doc = new Document(undefined, opts);
|
|
26263
26093
|
const ctx = {
|
|
26264
|
-
atKey: false,
|
|
26265
26094
|
atRoot: true,
|
|
26266
26095
|
directives: doc.directives,
|
|
26267
26096
|
options: doc.options,
|
|
@@ -28396,20 +28225,7 @@ query SendMessage($params: Input_convassist_SendMessageRequest) {
|
|
|
28396
28225
|
default: {
|
|
28397
28226
|
const bv = this.startBlockValue(map);
|
|
28398
28227
|
if (bv) {
|
|
28399
|
-
if (bv.type
|
|
28400
|
-
if (!it.explicitKey &&
|
|
28401
|
-
it.sep &&
|
|
28402
|
-
!includesToken(it.sep, 'newline')) {
|
|
28403
|
-
yield* this.pop({
|
|
28404
|
-
type: 'error',
|
|
28405
|
-
offset: this.offset,
|
|
28406
|
-
message: 'Unexpected block-seq-ind on same line with key',
|
|
28407
|
-
source: this.source
|
|
28408
|
-
});
|
|
28409
|
-
return;
|
|
28410
|
-
}
|
|
28411
|
-
}
|
|
28412
|
-
else if (atMapIndent) {
|
|
28228
|
+
if (atMapIndent && bv.type !== 'block-seq') {
|
|
28413
28229
|
map.items.push({ start });
|
|
28414
28230
|
}
|
|
28415
28231
|
this.stack.push(bv);
|
|
@@ -28780,8 +28596,6 @@ query SendMessage($params: Input_convassist_SendMessageRequest) {
|
|
|
28780
28596
|
if (!keepUndefined)
|
|
28781
28597
|
return undefined;
|
|
28782
28598
|
}
|
|
28783
|
-
if (isDocument(value) && !_replacer)
|
|
28784
|
-
return value.toString(options);
|
|
28785
28599
|
return new Document(value, _replacer, options).toString(options);
|
|
28786
28600
|
}
|
|
28787
28601
|
|