@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.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) :
|
|
@@ -32,7 +32,7 @@
|
|
|
32
32
|
}
|
|
33
33
|
return false;
|
|
34
34
|
};
|
|
35
|
-
const merge
|
|
35
|
+
const merge = (...objects) => objects.reduce((result, current) => {
|
|
36
36
|
if (Array.isArray(current)) {
|
|
37
37
|
throw new TypeError("Arguments provided to ts-deepmerge must be objects, not arrays.");
|
|
38
38
|
}
|
|
@@ -41,19 +41,19 @@
|
|
|
41
41
|
return;
|
|
42
42
|
}
|
|
43
43
|
if (Array.isArray(result[key]) && Array.isArray(current[key])) {
|
|
44
|
-
result[key] = merge
|
|
45
|
-
? merge
|
|
44
|
+
result[key] = merge.options.mergeArrays
|
|
45
|
+
? merge.options.uniqueArrayItems
|
|
46
46
|
? Array.from(new Set(result[key].concat(current[key])))
|
|
47
47
|
: [...result[key], ...current[key]]
|
|
48
48
|
: current[key];
|
|
49
49
|
}
|
|
50
50
|
else if (isObject$1(result[key]) && isObject$1(current[key])) {
|
|
51
|
-
result[key] = merge
|
|
51
|
+
result[key] = merge(result[key], current[key]);
|
|
52
52
|
}
|
|
53
53
|
else {
|
|
54
54
|
result[key] =
|
|
55
55
|
current[key] === undefined
|
|
56
|
-
? merge
|
|
56
|
+
? merge.options.allowUndefinedOverrides
|
|
57
57
|
? current[key]
|
|
58
58
|
: result[key]
|
|
59
59
|
: current[key];
|
|
@@ -66,11 +66,11 @@
|
|
|
66
66
|
mergeArrays: true,
|
|
67
67
|
uniqueArrayItems: true,
|
|
68
68
|
};
|
|
69
|
-
merge
|
|
70
|
-
merge
|
|
71
|
-
merge
|
|
72
|
-
const result = merge
|
|
73
|
-
merge
|
|
69
|
+
merge.options = defaultOptions;
|
|
70
|
+
merge.withOptions = (options, ...objects) => {
|
|
71
|
+
merge.options = Object.assign(Object.assign({}, defaultOptions), options);
|
|
72
|
+
const result = merge(...objects);
|
|
73
|
+
merge.options = defaultOptions;
|
|
74
74
|
return result;
|
|
75
75
|
};
|
|
76
76
|
|
|
@@ -271,7 +271,7 @@
|
|
|
271
271
|
function getDOMNode(domSelector) {
|
|
272
272
|
return typeof domSelector === 'string' ? document.querySelector(domSelector) : domSelector;
|
|
273
273
|
}
|
|
274
|
-
const deepMerge = (target, source) => merge
|
|
274
|
+
const deepMerge = (target, source) => merge(target, source);
|
|
275
275
|
const getOperationNameFromQuery = (query) => {
|
|
276
276
|
const regex = /(?:query|mutation)\s+(\w+)/;
|
|
277
277
|
const matches = query.match(regex);
|
|
@@ -1859,7 +1859,7 @@
|
|
|
1859
1859
|
* the table visualization.
|
|
1860
1860
|
*
|
|
1861
1861
|
* If the Row-Level Security (RLS) rules are applied on the
|
|
1862
|
-
*
|
|
1862
|
+
* Model, exercise caution when changing column
|
|
1863
1863
|
* or table cell values to maintain data security.
|
|
1864
1864
|
*
|
|
1865
1865
|
* @example
|
|
@@ -1917,7 +1917,7 @@
|
|
|
1917
1917
|
*/
|
|
1918
1918
|
EmbedEvent["SpotterData"] = "SpotterData";
|
|
1919
1919
|
/**
|
|
1920
|
-
* Emitted when user opens up the
|
|
1920
|
+
* Emitted when user opens up the data source preview modal in Spotter embed.
|
|
1921
1921
|
* @example
|
|
1922
1922
|
* ```js
|
|
1923
1923
|
* spotterEmbed.on(EmbedEvent.PreviewSpotterData, (payload) => {
|
|
@@ -2005,21 +2005,6 @@
|
|
|
2005
2005
|
* @version SDK: 1.41.0 | ThoughtSpot: 10.12.0.cl
|
|
2006
2006
|
*/
|
|
2007
2007
|
EmbedEvent["OrgSwitched"] = "orgSwitched";
|
|
2008
|
-
/**
|
|
2009
|
-
* Emitted when the user intercepts a URL.
|
|
2010
|
-
*
|
|
2011
|
-
* Supported on all embed types.
|
|
2012
|
-
*
|
|
2013
|
-
* @example
|
|
2014
|
-
* ```js
|
|
2015
|
-
* embed.on(EmbedEvent.ApiIntercept, (payload) => {
|
|
2016
|
-
* console.log('payload', payload);
|
|
2017
|
-
* })
|
|
2018
|
-
* ```
|
|
2019
|
-
*
|
|
2020
|
-
* @version SDK: 1.42.0 | ThoughtSpot: 10.14.0.cl
|
|
2021
|
-
*/
|
|
2022
|
-
EmbedEvent["ApiIntercept"] = "ApiIntercept";
|
|
2023
2008
|
})(exports.EmbedEvent || (exports.EmbedEvent = {}));
|
|
2024
2009
|
/**
|
|
2025
2010
|
* Event types that can be triggered by the host application
|
|
@@ -2158,9 +2143,7 @@
|
|
|
2158
2143
|
*/
|
|
2159
2144
|
HostEvent["Reload"] = "reload";
|
|
2160
2145
|
/**
|
|
2161
|
-
* Get iframe URL for the current embed view
|
|
2162
|
-
* Developers can use this URL to embed a ThoughtSpot object
|
|
2163
|
-
* in apps like Salesforce or Sharepoint.
|
|
2146
|
+
* Get iframe URL for the current embed view.
|
|
2164
2147
|
* @example
|
|
2165
2148
|
* ```js
|
|
2166
2149
|
* const url = embed.trigger(HostEvent.GetIframeUrl);
|
|
@@ -3232,7 +3215,7 @@
|
|
|
3232
3215
|
*/
|
|
3233
3216
|
HostEvent["EditLastPrompt"] = "EditLastPrompt";
|
|
3234
3217
|
/**
|
|
3235
|
-
* Opens the
|
|
3218
|
+
* Opens the data source preview modal in Spotter Embed.
|
|
3236
3219
|
* @example
|
|
3237
3220
|
* ```js
|
|
3238
3221
|
* spotterEmbed.trigger(HostEvent.PreviewSpotterData);
|
|
@@ -3314,6 +3297,15 @@
|
|
|
3314
3297
|
* ```
|
|
3315
3298
|
*/
|
|
3316
3299
|
HostEvent["UpdateEmbedParams"] = "updateEmbedParams";
|
|
3300
|
+
/**
|
|
3301
|
+
* Triggered when the embed is needed to be destroyed. This is used to clean up any embed related resources internally.
|
|
3302
|
+
* @example
|
|
3303
|
+
* ```js
|
|
3304
|
+
* liveboardEmbed.trigger(HostEvent.DestroyEmbed);
|
|
3305
|
+
* ```
|
|
3306
|
+
* @version SDK: 1.41.0 | ThoughtSpot: 10.12.0.cl
|
|
3307
|
+
*/
|
|
3308
|
+
HostEvent["DestroyEmbed"] = "EmbedDestroyed";
|
|
3317
3309
|
})(exports.HostEvent || (exports.HostEvent = {}));
|
|
3318
3310
|
/**
|
|
3319
3311
|
* The different visual modes that the data sources panel within
|
|
@@ -3357,6 +3349,7 @@
|
|
|
3357
3349
|
Param["HideResult"] = "hideResult";
|
|
3358
3350
|
Param["UseLastSelectedDataSource"] = "useLastSelectedSources";
|
|
3359
3351
|
Param["Tag"] = "tag";
|
|
3352
|
+
Param["HideTagFilterChips"] = "hideTagFilterChips";
|
|
3360
3353
|
Param["AutoLogin"] = "autoLogin";
|
|
3361
3354
|
Param["searchTokenString"] = "searchTokenString";
|
|
3362
3355
|
Param["executeSearch"] = "executeSearch";
|
|
@@ -3445,6 +3438,7 @@
|
|
|
3445
3438
|
Param["ShowLiveboardReverifyBanner"] = "showLiveboardReverifyBanner";
|
|
3446
3439
|
Param["LiveboardHeaderV2"] = "isLiveboardHeaderV2Enabled";
|
|
3447
3440
|
Param["HideIrrelevantFiltersInTab"] = "hideIrrelevantFiltersAtTabLevel";
|
|
3441
|
+
Param["IsEnhancedFilterInteractivityEnabled"] = "isLiveboardPermissionV2Enabled";
|
|
3448
3442
|
Param["SpotterEnabled"] = "isSpotterExperienceEnabled";
|
|
3449
3443
|
Param["IsUnifiedSearchExperienceEnabled"] = "isUnifiedSearchExperienceEnabled";
|
|
3450
3444
|
Param["OverrideOrgId"] = "orgId";
|
|
@@ -3461,7 +3455,9 @@
|
|
|
3461
3455
|
Param["RootMarginForLazyLoad"] = "rootMarginForLazyLoad";
|
|
3462
3456
|
Param["LiveboardXLSXCSVDownload"] = "isLiveboardXLSXCSVDownloadEnabled";
|
|
3463
3457
|
Param["isPNGInScheduledEmailsEnabled"] = "isPNGInScheduledEmailsEnabled";
|
|
3458
|
+
Param["isCentralizedLiveboardFilterUXEnabled"] = "isCentralizedLiveboardFilterUXEnabled";
|
|
3464
3459
|
Param["isLinkParametersEnabled"] = "isLinkParametersEnabled";
|
|
3460
|
+
Param["EnablePastConversationsSidebar"] = "enablePastConversationsSidebar";
|
|
3465
3461
|
})(Param || (Param = {}));
|
|
3466
3462
|
/**
|
|
3467
3463
|
* ThoughtSpot application pages include actions and menu commands
|
|
@@ -3574,7 +3570,7 @@
|
|
|
3574
3570
|
*/
|
|
3575
3571
|
Action["SchedulesList"] = "schedule-list";
|
|
3576
3572
|
/**
|
|
3577
|
-
* The **Share** action on a Liveboard, Answer, or
|
|
3573
|
+
* The **Share** action on a Liveboard, Answer, or Model.
|
|
3578
3574
|
* Allows users to share an object with other users and groups.
|
|
3579
3575
|
* @example
|
|
3580
3576
|
* ```js
|
|
@@ -4032,7 +4028,7 @@
|
|
|
4032
4028
|
Action["AnswerChartSwitcher"] = "answerChartSwitcher";
|
|
4033
4029
|
/**
|
|
4034
4030
|
* The Favorites icon (*) for Answers,
|
|
4035
|
-
* Liveboard, and data objects like
|
|
4031
|
+
* Liveboard, and data objects like Model,
|
|
4036
4032
|
* Tables and Views.
|
|
4037
4033
|
* Allows adding an object to the user's favorites list.
|
|
4038
4034
|
* @example
|
|
@@ -4766,6 +4762,16 @@
|
|
|
4766
4762
|
* @version SDK: 1.42.0 | ThoughtSpot Cloud: 10.14.0.cl
|
|
4767
4763
|
*/
|
|
4768
4764
|
Action["RemoveAttachment"] = "removeAttachment";
|
|
4765
|
+
/**
|
|
4766
|
+
* The **Style panel** on a Liveboard.
|
|
4767
|
+
* Controls the visibility of the Liveboard style panel.
|
|
4768
|
+
* @example
|
|
4769
|
+
* ```js
|
|
4770
|
+
* hiddenActions: [Action.LiveboardStylePanel]
|
|
4771
|
+
* ```
|
|
4772
|
+
* @version SDK: 1.43.0 | ThoughtSpot Cloud: 10.15.0.cl
|
|
4773
|
+
*/
|
|
4774
|
+
Action["LiveboardStylePanel"] = "liveboardStylePanel";
|
|
4769
4775
|
})(exports.Action || (exports.Action = {}));
|
|
4770
4776
|
exports.PrefetchFeatures = void 0;
|
|
4771
4777
|
(function (PrefetchFeatures) {
|
|
@@ -4887,29 +4893,7 @@
|
|
|
4887
4893
|
* @version SDK: 1.26.7 | ThoughtSpot Cloud: 9.10.0.cl
|
|
4888
4894
|
*/
|
|
4889
4895
|
LogLevel["TRACE"] = "TRACE";
|
|
4890
|
-
})(exports.LogLevel || (exports.LogLevel = {}));
|
|
4891
|
-
/**
|
|
4892
|
-
* Enum for the type of API intercepted
|
|
4893
|
-
*/
|
|
4894
|
-
exports.InterceptedApiType = void 0;
|
|
4895
|
-
(function (InterceptedApiType) {
|
|
4896
|
-
/**
|
|
4897
|
-
* The apis that are use to get the metadata for the embed
|
|
4898
|
-
*/
|
|
4899
|
-
InterceptedApiType["METADATA"] = "METADATA";
|
|
4900
|
-
/**
|
|
4901
|
-
* The apis that are use to get the data for the embed
|
|
4902
|
-
*/
|
|
4903
|
-
InterceptedApiType["ANSWER_DATA"] = "ANSWER_DATA";
|
|
4904
|
-
/**
|
|
4905
|
-
* This will intercept all the apis
|
|
4906
|
-
*/
|
|
4907
|
-
InterceptedApiType["ALL"] = "ALL";
|
|
4908
|
-
/**
|
|
4909
|
-
* The apis that are use to get the data for the liveboard
|
|
4910
|
-
*/
|
|
4911
|
-
InterceptedApiType["LIVEBOARD_DATA"] = "LIVEBOARD_DATA";
|
|
4912
|
-
})(exports.InterceptedApiType || (exports.InterceptedApiType = {}));
|
|
4896
|
+
})(exports.LogLevel || (exports.LogLevel = {}));
|
|
4913
4897
|
|
|
4914
4898
|
const logFunctions = {
|
|
4915
4899
|
[exports.LogLevel.SILENT]: () => undefined,
|
|
@@ -7255,20 +7239,9 @@
|
|
|
7255
7239
|
|
|
7256
7240
|
var isEmpty_1 = isEmpty$1;
|
|
7257
7241
|
|
|
7258
|
-
exports.UIPassthroughEvent = void 0;
|
|
7259
|
-
(function (UIPassthroughEvent) {
|
|
7260
|
-
UIPassthroughEvent["PinAnswerToLiveboard"] = "addVizToPinboard";
|
|
7261
|
-
UIPassthroughEvent["SaveAnswer"] = "saveAnswer";
|
|
7262
|
-
UIPassthroughEvent["GetDiscoverabilityStatus"] = "getDiscoverabilityStatus";
|
|
7263
|
-
UIPassthroughEvent["GetAvailableUIPassthroughs"] = "getAvailableUiPassthroughs";
|
|
7264
|
-
UIPassthroughEvent["GetAnswerConfig"] = "getAnswerPageConfig";
|
|
7265
|
-
UIPassthroughEvent["GetLiveboardConfig"] = "getPinboardPageConfig";
|
|
7266
|
-
UIPassthroughEvent["GetUnsavedAnswerTML"] = "getUnsavedAnswerTML";
|
|
7267
|
-
})(exports.UIPassthroughEvent || (exports.UIPassthroughEvent = {}));
|
|
7268
|
-
|
|
7269
7242
|
const ERROR_MESSAGE = {
|
|
7270
7243
|
INVALID_THOUGHTSPOT_HOST: 'Error parsing ThoughtSpot host. Please provide a valid URL.',
|
|
7271
|
-
SPOTTER_EMBED_WORKSHEED_ID_NOT_FOUND: 'Please select a
|
|
7244
|
+
SPOTTER_EMBED_WORKSHEED_ID_NOT_FOUND: 'Please select a Model to get started',
|
|
7272
7245
|
LIVEBOARD_VIZ_ID_VALIDATION: 'Please select a Liveboard to embed.',
|
|
7273
7246
|
TRIGGER_TIMED_OUT: 'Trigger timed-out in getting a response',
|
|
7274
7247
|
SEARCHEMBED_BETA_WRANING_MESSAGE: 'SearchEmbed is in Beta in this release.',
|
|
@@ -9718,6 +9691,14 @@ mutation GetUnsavedAnswerTML($session: BachSessionIdInput!, $exportDependencies:
|
|
|
9718
9691
|
finalValidActions.push(action);
|
|
9719
9692
|
}
|
|
9720
9693
|
});
|
|
9694
|
+
// Step 4: Collect warnings for long custom action names
|
|
9695
|
+
const MAX_ACTION_NAME_LENGTH = 30;
|
|
9696
|
+
const warnings = finalValidActions
|
|
9697
|
+
.filter(action => action.name.length > MAX_ACTION_NAME_LENGTH)
|
|
9698
|
+
.map(action => `Custom action name '${action.name}' exceeds ${MAX_ACTION_NAME_LENGTH} characters. This may cause display or truncation issues in the UI.`);
|
|
9699
|
+
if (warnings.length > 0) {
|
|
9700
|
+
logger$3.warn(warnings);
|
|
9701
|
+
}
|
|
9721
9702
|
const sortedActions = sortBy_1(finalValidActions, (a) => a.name.toLocaleLowerCase());
|
|
9722
9703
|
return {
|
|
9723
9704
|
actions: sortedActions,
|
|
@@ -17074,6 +17055,8 @@ mutation GetUnsavedAnswerTML($session: BachSessionIdInput!, $exportDependencies:
|
|
|
17074
17055
|
authTriggerText: 'Authorize',
|
|
17075
17056
|
authType: exports.AuthType.None,
|
|
17076
17057
|
logLevel: exports.LogLevel.ERROR,
|
|
17058
|
+
waitForCleanupOnDestroy: false,
|
|
17059
|
+
cleanupTimeout: 5000,
|
|
17077
17060
|
};
|
|
17078
17061
|
let authPromise;
|
|
17079
17062
|
const getAuthPromise = () => authPromise;
|
|
@@ -17516,27 +17499,27 @@ mutation GetUnsavedAnswerTML($session: BachSessionIdInput!, $exportDependencies:
|
|
|
17516
17499
|
* @param thoughtSpotHost
|
|
17517
17500
|
* @param containerEl
|
|
17518
17501
|
*/
|
|
17519
|
-
function processEventData(type,
|
|
17502
|
+
function processEventData(type, e, thoughtSpotHost, containerEl) {
|
|
17520
17503
|
switch (type) {
|
|
17521
17504
|
case exports.EmbedEvent.CustomAction:
|
|
17522
|
-
return processCustomAction(
|
|
17505
|
+
return processCustomAction(e, thoughtSpotHost);
|
|
17523
17506
|
case exports.EmbedEvent.AuthInit:
|
|
17524
|
-
return processAuthInit(
|
|
17507
|
+
return processAuthInit(e);
|
|
17525
17508
|
case exports.EmbedEvent.NoCookieAccess:
|
|
17526
|
-
return processNoCookieAccess(
|
|
17509
|
+
return processNoCookieAccess(e, containerEl);
|
|
17527
17510
|
case exports.EmbedEvent.AuthFailure:
|
|
17528
|
-
return processAuthFailure(
|
|
17511
|
+
return processAuthFailure(e, containerEl);
|
|
17529
17512
|
case exports.EmbedEvent.AuthLogout:
|
|
17530
|
-
return processAuthLogout(
|
|
17513
|
+
return processAuthLogout(e, containerEl);
|
|
17531
17514
|
case exports.EmbedEvent.ExitPresentMode:
|
|
17532
17515
|
return processExitPresentMode();
|
|
17533
17516
|
case exports.EmbedEvent.CLEAR_INFO_CACHE:
|
|
17534
17517
|
return processClearInfoCache();
|
|
17535
17518
|
}
|
|
17536
|
-
return
|
|
17519
|
+
return e;
|
|
17537
17520
|
}
|
|
17538
17521
|
|
|
17539
|
-
var name="@thoughtspot/visual-embed-sdk";var version$1="1.42.
|
|
17522
|
+
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};
|
|
17540
17523
|
|
|
17541
17524
|
/**
|
|
17542
17525
|
* Reloads the ThoughtSpot iframe.
|
|
@@ -17608,6 +17591,16 @@ mutation GetUnsavedAnswerTML($session: BachSessionIdInput!, $exportDependencies:
|
|
|
17608
17591
|
});
|
|
17609
17592
|
}
|
|
17610
17593
|
|
|
17594
|
+
exports.UIPassthroughEvent = void 0;
|
|
17595
|
+
(function (UIPassthroughEvent) {
|
|
17596
|
+
UIPassthroughEvent["PinAnswerToLiveboard"] = "addVizToPinboard";
|
|
17597
|
+
UIPassthroughEvent["SaveAnswer"] = "saveAnswer";
|
|
17598
|
+
UIPassthroughEvent["GetDiscoverabilityStatus"] = "getDiscoverabilityStatus";
|
|
17599
|
+
UIPassthroughEvent["GetAvailableUIPassthroughs"] = "getAvailableUiPassthroughs";
|
|
17600
|
+
UIPassthroughEvent["GetAnswerConfig"] = "getAnswerPageConfig";
|
|
17601
|
+
UIPassthroughEvent["GetLiveboardConfig"] = "getPinboardPageConfig";
|
|
17602
|
+
})(exports.UIPassthroughEvent || (exports.UIPassthroughEvent = {}));
|
|
17603
|
+
|
|
17611
17604
|
class HostEventClient {
|
|
17612
17605
|
constructor(iFrame) {
|
|
17613
17606
|
this.iFrame = iFrame;
|
|
@@ -17699,111 +17692,6 @@ mutation GetUnsavedAnswerTML($session: BachSessionIdInput!, $exportDependencies:
|
|
|
17699
17692
|
}
|
|
17700
17693
|
}
|
|
17701
17694
|
|
|
17702
|
-
const defaultUrls = {
|
|
17703
|
-
[exports.InterceptedApiType.METADATA]: [
|
|
17704
|
-
'/prism/?op=CreateAnswerSession',
|
|
17705
|
-
'/prism/?op=GetV2SourceDetail',
|
|
17706
|
-
],
|
|
17707
|
-
[exports.InterceptedApiType.ANSWER_DATA]: [
|
|
17708
|
-
'/prism/?op=GetChartWithData',
|
|
17709
|
-
'/prism/?op=GetTableWithHeadlineData',
|
|
17710
|
-
],
|
|
17711
|
-
[exports.InterceptedApiType.LIVEBOARD_DATA]: [
|
|
17712
|
-
'/prism/?op=LoadContextBook'
|
|
17713
|
-
],
|
|
17714
|
-
};
|
|
17715
|
-
const formatInterceptUrl = (url) => {
|
|
17716
|
-
const host = getThoughtSpotHost(getEmbedConfig());
|
|
17717
|
-
if (url.startsWith('/'))
|
|
17718
|
-
return `${host}${url}`;
|
|
17719
|
-
return url;
|
|
17720
|
-
};
|
|
17721
|
-
const processInterceptUrls = (interceptUrls) => {
|
|
17722
|
-
let processedUrls = [...interceptUrls];
|
|
17723
|
-
Object.entries(defaultUrls).forEach(([apiType, apiTypeUrls]) => {
|
|
17724
|
-
if (!processedUrls.includes(apiType))
|
|
17725
|
-
return;
|
|
17726
|
-
processedUrls = processedUrls.filter(url => url !== apiType);
|
|
17727
|
-
processedUrls = [...processedUrls, ...apiTypeUrls];
|
|
17728
|
-
});
|
|
17729
|
-
return processedUrls.map(url => formatInterceptUrl(url));
|
|
17730
|
-
};
|
|
17731
|
-
const getInterceptInitData = (embedConfig, viewConfig) => {
|
|
17732
|
-
const enableApiIntercept = (embedConfig.enableApiIntercept || viewConfig.enableApiIntercept) && (viewConfig.enableApiIntercept !== false);
|
|
17733
|
-
if (!enableApiIntercept)
|
|
17734
|
-
return {
|
|
17735
|
-
enableApiIntercept: false,
|
|
17736
|
-
};
|
|
17737
|
-
const combinedUrls = [...(embedConfig.interceptUrls || []), ...(viewConfig.interceptUrls || [])];
|
|
17738
|
-
if (viewConfig.isOnBeforeGetVizDataInterceptEnabled) {
|
|
17739
|
-
combinedUrls.push(exports.InterceptedApiType.ANSWER_DATA);
|
|
17740
|
-
}
|
|
17741
|
-
const shouldInterceptAll = combinedUrls.includes(exports.InterceptedApiType.ALL);
|
|
17742
|
-
const interceptUrls = shouldInterceptAll ? [exports.InterceptedApiType.ALL] : processInterceptUrls(combinedUrls);
|
|
17743
|
-
const interceptTimeout = embedConfig.interceptTimeout || viewConfig.interceptTimeout;
|
|
17744
|
-
return {
|
|
17745
|
-
interceptUrls,
|
|
17746
|
-
interceptTimeout,
|
|
17747
|
-
enableApiIntercept,
|
|
17748
|
-
};
|
|
17749
|
-
};
|
|
17750
|
-
/**
|
|
17751
|
-
*
|
|
17752
|
-
* @param fetchInit
|
|
17753
|
-
*/
|
|
17754
|
-
const parseInterceptData = (eventDataString) => {
|
|
17755
|
-
try {
|
|
17756
|
-
const { input, init } = JSON.parse(eventDataString);
|
|
17757
|
-
init.body = JSON.parse(init.body);
|
|
17758
|
-
const parsedInit = { input, init };
|
|
17759
|
-
return [parsedInit, null];
|
|
17760
|
-
}
|
|
17761
|
-
catch (error) {
|
|
17762
|
-
return [null, error];
|
|
17763
|
-
}
|
|
17764
|
-
};
|
|
17765
|
-
const handleInterceptEvent = async (params) => {
|
|
17766
|
-
var _a, _b, _c, _d, _e;
|
|
17767
|
-
const { eventData, executeEvent, viewConfig, getUnsavedAnswerTml } = params;
|
|
17768
|
-
const [interceptData, bodyParseError] = parseInterceptData(eventData.data);
|
|
17769
|
-
if (bodyParseError) {
|
|
17770
|
-
executeEvent(exports.EmbedEvent.Error, {
|
|
17771
|
-
error: 'Error parsing api intercept body',
|
|
17772
|
-
});
|
|
17773
|
-
logger$3.error('Error parsing request body', bodyParseError);
|
|
17774
|
-
return;
|
|
17775
|
-
}
|
|
17776
|
-
const { input: requestUrl, init } = interceptData;
|
|
17777
|
-
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;
|
|
17778
|
-
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;
|
|
17779
|
-
if (defaultUrls.ANSWER_DATA.includes(requestUrl) && viewConfig.isOnBeforeGetVizDataInterceptEnabled) {
|
|
17780
|
-
const answerTml = await getUnsavedAnswerTml({ sessionId, vizId });
|
|
17781
|
-
executeEvent(exports.EmbedEvent.OnBeforeGetVizDataIntercept, { data: { data: answerTml } });
|
|
17782
|
-
}
|
|
17783
|
-
executeEvent(exports.EmbedEvent.ApiIntercept, interceptData);
|
|
17784
|
-
};
|
|
17785
|
-
const processLegacyInterceptResponse = (payload) => {
|
|
17786
|
-
var _a, _b, _c, _d, _e, _f, _g;
|
|
17787
|
-
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);
|
|
17788
|
-
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);
|
|
17789
|
-
const payloadToSend = {
|
|
17790
|
-
execute: (_g = payload === null || payload === void 0 ? void 0 : payload.data) === null || _g === void 0 ? void 0 : _g.execute,
|
|
17791
|
-
response: {
|
|
17792
|
-
body: {
|
|
17793
|
-
errors: [
|
|
17794
|
-
{
|
|
17795
|
-
title: errorText,
|
|
17796
|
-
description: errorDescription,
|
|
17797
|
-
isUserError: true,
|
|
17798
|
-
},
|
|
17799
|
-
],
|
|
17800
|
-
data: {},
|
|
17801
|
-
},
|
|
17802
|
-
},
|
|
17803
|
-
};
|
|
17804
|
-
return { data: payloadToSend };
|
|
17805
|
-
};
|
|
17806
|
-
|
|
17807
17695
|
/**
|
|
17808
17696
|
* Copyright (c) 2022
|
|
17809
17697
|
*
|
|
@@ -17857,27 +17745,6 @@ mutation GetUnsavedAnswerTML($session: BachSessionIdInput!, $exportDependencies:
|
|
|
17857
17745
|
*/
|
|
17858
17746
|
this.fullscreenChangeHandler = null;
|
|
17859
17747
|
this.subscribedListeners = {};
|
|
17860
|
-
this.messageEventListener = async (event) => {
|
|
17861
|
-
const eventType = this.getEventType(event);
|
|
17862
|
-
const eventPort = this.getEventPort(event);
|
|
17863
|
-
const eventData = this.formatEventData(event, eventType);
|
|
17864
|
-
if (event.source === this.iFrame.contentWindow) {
|
|
17865
|
-
const processedEventData = await processEventData(eventType, eventData, this.thoughtSpotHost, this.isPreRendered ? this.preRenderWrapper : this.el);
|
|
17866
|
-
const executeEvent = (_eventType, data) => {
|
|
17867
|
-
this.executeCallbacks(_eventType, data, eventPort);
|
|
17868
|
-
};
|
|
17869
|
-
if (eventType === exports.EmbedEvent.ApiIntercept && this.viewConfig.enableApiIntercept) {
|
|
17870
|
-
const getUnsavedAnswerTml = async (props) => {
|
|
17871
|
-
var _a;
|
|
17872
|
-
const response = await this.triggerUIPassThrough(exports.UIPassthroughEvent.GetUnsavedAnswerTML, props);
|
|
17873
|
-
return (_a = response[0]) === null || _a === void 0 ? void 0 : _a.value;
|
|
17874
|
-
};
|
|
17875
|
-
handleInterceptEvent({ eventData: processedEventData, executeEvent, embedConfig: this.embedConfig, viewConfig: this.viewConfig, getUnsavedAnswerTml });
|
|
17876
|
-
return;
|
|
17877
|
-
}
|
|
17878
|
-
this.executeCallbacks(eventType, processedEventData, eventPort);
|
|
17879
|
-
}
|
|
17880
|
-
};
|
|
17881
17748
|
/**
|
|
17882
17749
|
* Send Custom style as part of payload of APP_INIT
|
|
17883
17750
|
* @param _
|
|
@@ -17962,18 +17829,6 @@ mutation GetUnsavedAnswerTML($session: BachSessionIdInput!, $exportDependencies:
|
|
|
17962
17829
|
this.on(exports.EmbedEvent.AuthInit, authInitHandler, { start: false }, true);
|
|
17963
17830
|
};
|
|
17964
17831
|
this.showPreRenderByDefault = false;
|
|
17965
|
-
this.createEmbedEventResponder = (eventPort, eventType) => {
|
|
17966
|
-
const { enableApiIntercept } = getInterceptInitData(this.embedConfig, this.viewConfig);
|
|
17967
|
-
if (eventType === exports.EmbedEvent.OnBeforeGetVizDataIntercept && enableApiIntercept) {
|
|
17968
|
-
return (payload) => {
|
|
17969
|
-
const payloadToSend = processLegacyInterceptResponse(payload);
|
|
17970
|
-
this.triggerEventOnPort(eventPort, payloadToSend);
|
|
17971
|
-
};
|
|
17972
|
-
}
|
|
17973
|
-
return (payload) => {
|
|
17974
|
-
this.triggerEventOnPort(eventPort, payload);
|
|
17975
|
-
};
|
|
17976
|
-
};
|
|
17977
17832
|
/**
|
|
17978
17833
|
* @hidden
|
|
17979
17834
|
* Internal state to track if the embed container is loaded.
|
|
@@ -18159,8 +18014,16 @@ mutation GetUnsavedAnswerTML($session: BachSessionIdInput!, $exportDependencies:
|
|
|
18159
18014
|
*/
|
|
18160
18015
|
subscribeToMessageEvents() {
|
|
18161
18016
|
this.unsubscribeToMessageEvents();
|
|
18162
|
-
|
|
18163
|
-
|
|
18017
|
+
const messageEventListener = (event) => {
|
|
18018
|
+
const eventType = this.getEventType(event);
|
|
18019
|
+
const eventPort = this.getEventPort(event);
|
|
18020
|
+
const eventData = this.formatEventData(event, eventType);
|
|
18021
|
+
if (event.source === this.iFrame.contentWindow) {
|
|
18022
|
+
this.executeCallbacks(eventType, processEventData(eventType, eventData, this.thoughtSpotHost, this.isPreRendered ? this.preRenderWrapper : this.el), eventPort);
|
|
18023
|
+
}
|
|
18024
|
+
};
|
|
18025
|
+
window.addEventListener('message', messageEventListener);
|
|
18026
|
+
this.subscribedListeners.message = messageEventListener;
|
|
18164
18027
|
}
|
|
18165
18028
|
/**
|
|
18166
18029
|
* Adds event listeners for both network and message events.
|
|
@@ -18221,7 +18084,7 @@ mutation GetUnsavedAnswerTML($session: BachSessionIdInput!, $exportDependencies:
|
|
|
18221
18084
|
message: customActionsResult.errors,
|
|
18222
18085
|
});
|
|
18223
18086
|
}
|
|
18224
|
-
|
|
18087
|
+
return {
|
|
18225
18088
|
customisations: getCustomisations(this.embedConfig, this.viewConfig),
|
|
18226
18089
|
authToken,
|
|
18227
18090
|
runtimeFilterParams: this.viewConfig.excludeRuntimeFiltersfromURL
|
|
@@ -18239,9 +18102,7 @@ mutation GetUnsavedAnswerTML($session: BachSessionIdInput!, $exportDependencies:
|
|
|
18239
18102
|
customVariablesForThirdPartyTools: this.embedConfig.customVariablesForThirdPartyTools || {},
|
|
18240
18103
|
hiddenListColumns: this.viewConfig.hiddenListColumns || [],
|
|
18241
18104
|
customActions: customActionsResult.actions,
|
|
18242
|
-
...getInterceptInitData(this.embedConfig, this.viewConfig),
|
|
18243
18105
|
};
|
|
18244
|
-
return baseInitData;
|
|
18245
18106
|
}
|
|
18246
18107
|
async getAppInitData() {
|
|
18247
18108
|
return this.getDefaultAppInitData();
|
|
@@ -18670,8 +18531,9 @@ mutation GetUnsavedAnswerTML($session: BachSessionIdInput!, $exportDependencies:
|
|
|
18670
18531
|
// When start status is false it trigger only end releated
|
|
18671
18532
|
// payload
|
|
18672
18533
|
|| (!callbackObj.options.start && dataStatus === embedEventStatus.END)) {
|
|
18673
|
-
|
|
18674
|
-
|
|
18534
|
+
callbackObj.callback(data, (payload) => {
|
|
18535
|
+
this.triggerEventOnPort(eventPort, payload);
|
|
18536
|
+
});
|
|
18675
18537
|
}
|
|
18676
18538
|
});
|
|
18677
18539
|
}
|
|
@@ -18944,11 +18806,26 @@ mutation GetUnsavedAnswerTML($session: BachSessionIdInput!, $exportDependencies:
|
|
|
18944
18806
|
* @version SDK: 1.19.1 | ThoughtSpot: *
|
|
18945
18807
|
*/
|
|
18946
18808
|
destroy() {
|
|
18947
|
-
var _a;
|
|
18809
|
+
var _a, _b;
|
|
18948
18810
|
try {
|
|
18949
18811
|
this.removeFullscreenChangeHandler();
|
|
18950
|
-
(_a = this.insertedDomEl) === null || _a === void 0 ? void 0 : _a.parentNode.removeChild(this.insertedDomEl);
|
|
18951
18812
|
this.unsubscribeToEvents();
|
|
18813
|
+
if (!getEmbedConfig().waitForCleanupOnDestroy) {
|
|
18814
|
+
this.trigger(exports.HostEvent.DestroyEmbed);
|
|
18815
|
+
(_b = (_a = this.insertedDomEl) === null || _a === void 0 ? void 0 : _a.parentNode) === null || _b === void 0 ? void 0 : _b.removeChild(this.insertedDomEl);
|
|
18816
|
+
}
|
|
18817
|
+
else {
|
|
18818
|
+
const cleanupTimeout = getEmbedConfig().cleanupTimeout;
|
|
18819
|
+
Promise.race([
|
|
18820
|
+
this.trigger(exports.HostEvent.DestroyEmbed),
|
|
18821
|
+
new Promise((resolve) => setTimeout(resolve, cleanupTimeout)),
|
|
18822
|
+
]).then(() => {
|
|
18823
|
+
var _a, _b;
|
|
18824
|
+
(_b = (_a = this.insertedDomEl) === null || _a === void 0 ? void 0 : _a.parentNode) === null || _b === void 0 ? void 0 : _b.removeChild(this.insertedDomEl);
|
|
18825
|
+
}).catch((e) => {
|
|
18826
|
+
logger$3.log('Error destroying TS Embed', e);
|
|
18827
|
+
});
|
|
18828
|
+
}
|
|
18952
18829
|
}
|
|
18953
18830
|
catch (e) {
|
|
18954
18831
|
logger$3.log('Error destroying TS Embed', e);
|
|
@@ -19381,7 +19258,7 @@ mutation GetUnsavedAnswerTML($session: BachSessionIdInput!, $exportDependencies:
|
|
|
19381
19258
|
* embedded Liveboard or visualization.
|
|
19382
19259
|
*/
|
|
19383
19260
|
getEmbedParams() {
|
|
19384
|
-
const { tag, hideObjects, liveboardV2, showPrimaryNavbar, disableProfileAndHelp, hideHamburger, hideObjectSearch, hideNotification, hideApplicationSwitcher, hideOrgSwitcher, enableSearchAssist, fullHeight, dataPanelV2 = true, hideLiveboardHeader = false, showLiveboardTitle = true, showLiveboardDescription = true, hideHomepageLeftNav = false, modularHomeExperience = false, isLiveboardHeaderSticky = true, enableAskSage, collapseSearchBarInitially = false, enable2ColumnLayout, enableCustomColumnGroups = false, isOnBeforeGetVizDataInterceptEnabled = false, dataPanelCustomGroupsAccordionInitialState = exports.DataPanelCustomColumnGroupsAccordionState.EXPAND_ALL, collapseSearchBar = true, isLiveboardCompactHeaderEnabled = false, showLiveboardVerifiedBadge = true, showLiveboardReverifyBanner = true, hideIrrelevantChipsInLiveboardTabs = false, homePageSearchBarMode, isUnifiedSearchExperienceEnabled = true, enablePendoHelp = true, discoveryExperience, coverAndFilterOptionInPDF = false, liveboardXLSXCSVDownload = false, isLiveboardStylingAndGroupingEnabled, isPNGInScheduledEmailsEnabled = false, isLinkParametersEnabled, } = this.viewConfig;
|
|
19261
|
+
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 = exports.DataPanelCustomColumnGroupsAccordionState.EXPAND_ALL, collapseSearchBar = true, isLiveboardCompactHeaderEnabled = false, showLiveboardVerifiedBadge = true, showLiveboardReverifyBanner = true, hideIrrelevantChipsInLiveboardTabs = false, isEnhancedFilterInteractivityEnabled = false, homePageSearchBarMode, isUnifiedSearchExperienceEnabled = true, enablePendoHelp = true, discoveryExperience, coverAndFilterOptionInPDF = false, liveboardXLSXCSVDownload = false, isLiveboardStylingAndGroupingEnabled, isPNGInScheduledEmailsEnabled = false, isCentralizedLiveboardFilterUXEnabled = false, isLinkParametersEnabled, } = this.viewConfig;
|
|
19385
19262
|
let params = {};
|
|
19386
19263
|
params[Param.PrimaryNavHidden] = !showPrimaryNavbar;
|
|
19387
19264
|
params[Param.HideProfleAndHelp] = !!disableProfileAndHelp;
|
|
@@ -19393,6 +19270,7 @@ mutation GetUnsavedAnswerTML($session: BachSessionIdInput!, $exportDependencies:
|
|
|
19393
19270
|
params[Param.LiveboardHeaderSticky] = isLiveboardHeaderSticky;
|
|
19394
19271
|
params[Param.IsFullAppEmbed] = true;
|
|
19395
19272
|
params[Param.LiveboardHeaderV2] = isLiveboardCompactHeaderEnabled;
|
|
19273
|
+
params[Param.IsEnhancedFilterInteractivityEnabled] = isEnhancedFilterInteractivityEnabled;
|
|
19396
19274
|
params[Param.ShowLiveboardVerifiedBadge] = showLiveboardVerifiedBadge;
|
|
19397
19275
|
params[Param.ShowLiveboardReverifyBanner] = showLiveboardReverifyBanner;
|
|
19398
19276
|
params[Param.HideIrrelevantFiltersInTab] = hideIrrelevantChipsInLiveboardTabs;
|
|
@@ -19434,8 +19312,7 @@ mutation GetUnsavedAnswerTML($session: BachSessionIdInput!, $exportDependencies:
|
|
|
19434
19312
|
if (enableAskSage) {
|
|
19435
19313
|
params[Param.enableAskSage] = enableAskSage;
|
|
19436
19314
|
}
|
|
19437
|
-
|
|
19438
|
-
if (isOnBeforeGetVizDataInterceptEnabled && !enableApiIntercept) {
|
|
19315
|
+
if (isOnBeforeGetVizDataInterceptEnabled) {
|
|
19439
19316
|
params[Param.IsOnBeforeGetVizDataInterceptEnabled] = isOnBeforeGetVizDataInterceptEnabled;
|
|
19440
19317
|
}
|
|
19441
19318
|
if (homePageSearchBarMode) {
|
|
@@ -19450,9 +19327,15 @@ mutation GetUnsavedAnswerTML($session: BachSessionIdInput!, $exportDependencies:
|
|
|
19450
19327
|
if (isPNGInScheduledEmailsEnabled !== undefined) {
|
|
19451
19328
|
params[Param.isPNGInScheduledEmailsEnabled] = isPNGInScheduledEmailsEnabled;
|
|
19452
19329
|
}
|
|
19330
|
+
if (hideTagFilterChips !== undefined) {
|
|
19331
|
+
params[Param.HideTagFilterChips] = hideTagFilterChips;
|
|
19332
|
+
}
|
|
19453
19333
|
if (isLinkParametersEnabled !== undefined) {
|
|
19454
19334
|
params[Param.isLinkParametersEnabled] = isLinkParametersEnabled;
|
|
19455
19335
|
}
|
|
19336
|
+
if (isCentralizedLiveboardFilterUXEnabled != undefined) {
|
|
19337
|
+
params[Param.isCentralizedLiveboardFilterUXEnabled] = isCentralizedLiveboardFilterUXEnabled;
|
|
19338
|
+
}
|
|
19456
19339
|
params[Param.DataPanelV2Enabled] = dataPanelV2;
|
|
19457
19340
|
params[Param.HideHomepageLeftNav] = hideHomepageLeftNav;
|
|
19458
19341
|
params[Param.ModularHomeExperienceEnabled] = modularHomeExperience;
|
|
@@ -19807,7 +19690,7 @@ query GetEurekaVizSnapshots(
|
|
|
19807
19690
|
getEmbedParamsObject() {
|
|
19808
19691
|
let params = {};
|
|
19809
19692
|
params = this.getBaseQueryParams(params);
|
|
19810
|
-
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;
|
|
19693
|
+
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;
|
|
19811
19694
|
const preventLiveboardFilterRemoval = this.viewConfig.preventLiveboardFilterRemoval
|
|
19812
19695
|
|| this.viewConfig.preventPinboardFilterRemoval;
|
|
19813
19696
|
if (fullHeight === true) {
|
|
@@ -19875,11 +19758,15 @@ query GetEurekaVizSnapshots(
|
|
|
19875
19758
|
if (isLinkParametersEnabled !== undefined) {
|
|
19876
19759
|
params[Param.isLinkParametersEnabled] = isLinkParametersEnabled;
|
|
19877
19760
|
}
|
|
19761
|
+
if (isCentralizedLiveboardFilterUXEnabled !== undefined) {
|
|
19762
|
+
params[Param.isCentralizedLiveboardFilterUXEnabled] = isCentralizedLiveboardFilterUXEnabled;
|
|
19763
|
+
}
|
|
19878
19764
|
params[Param.LiveboardHeaderSticky] = isLiveboardHeaderSticky;
|
|
19879
19765
|
params[Param.LiveboardHeaderV2] = isLiveboardCompactHeaderEnabled;
|
|
19880
19766
|
params[Param.ShowLiveboardVerifiedBadge] = showLiveboardVerifiedBadge;
|
|
19881
19767
|
params[Param.ShowLiveboardReverifyBanner] = showLiveboardReverifyBanner;
|
|
19882
19768
|
params[Param.HideIrrelevantFiltersInTab] = hideIrrelevantChipsInLiveboardTabs;
|
|
19769
|
+
params[Param.IsEnhancedFilterInteractivityEnabled] = isEnhancedFilterInteractivityEnabled;
|
|
19883
19770
|
params[Param.DataPanelV2Enabled] = dataPanelV2;
|
|
19884
19771
|
params[Param.EnableCustomColumnGroups] = enableCustomColumnGroups;
|
|
19885
19772
|
params[Param.CoverAndFilterOptionInPDF] = coverAndFilterOptionInPDF;
|
|
@@ -20161,8 +20048,7 @@ query GetEurekaVizSnapshots(
|
|
|
20161
20048
|
if (hideSearchBar) {
|
|
20162
20049
|
queryParams[Param.HideSearchBar] = true;
|
|
20163
20050
|
}
|
|
20164
|
-
|
|
20165
|
-
if (isOnBeforeGetVizDataInterceptEnabled && !enableApiIntercept) {
|
|
20051
|
+
if (isOnBeforeGetVizDataInterceptEnabled) {
|
|
20166
20052
|
queryParams[Param.IsOnBeforeGetVizDataInterceptEnabled] = isOnBeforeGetVizDataInterceptEnabled;
|
|
20167
20053
|
}
|
|
20168
20054
|
if (!focusSearchBarOnRender) {
|
|
@@ -20874,7 +20760,7 @@ query SendMessage($params: Input_convassist_SendMessageRequest) {
|
|
|
20874
20760
|
this.viewConfig = viewConfig;
|
|
20875
20761
|
}
|
|
20876
20762
|
getEmbedParamsObject() {
|
|
20877
|
-
const { worksheetId, searchOptions, disableSourceSelection, hideSourceSelection, dataPanelV2, showSpotterLimitations, hideSampleQuestions, runtimeFilters, excludeRuntimeFiltersfromURL, runtimeParameters, excludeRuntimeParametersfromURL, } = this.viewConfig;
|
|
20763
|
+
const { worksheetId, searchOptions, disableSourceSelection, hideSourceSelection, dataPanelV2, showSpotterLimitations, hideSampleQuestions, enablePastConversationsSidebar, runtimeFilters, excludeRuntimeFiltersfromURL, runtimeParameters, excludeRuntimeParametersfromURL, } = this.viewConfig;
|
|
20878
20764
|
if (!worksheetId) {
|
|
20879
20765
|
this.handleError(ERROR_MESSAGE.SPOTTER_EMBED_WORKSHEED_ID_NOT_FOUND);
|
|
20880
20766
|
}
|
|
@@ -20898,9 +20784,12 @@ query SendMessage($params: Input_convassist_SendMessageRequest) {
|
|
|
20898
20784
|
return queryParams;
|
|
20899
20785
|
}
|
|
20900
20786
|
getIframeSrc() {
|
|
20901
|
-
const { worksheetId, searchOptions, runtimeFilters, excludeRuntimeFiltersfromURL, runtimeParameters, excludeRuntimeParametersfromURL, } = this.viewConfig;
|
|
20787
|
+
const { worksheetId, searchOptions, runtimeFilters, excludeRuntimeFiltersfromURL, runtimeParameters, excludeRuntimeParametersfromURL, enablePastConversationsSidebar } = this.viewConfig;
|
|
20902
20788
|
const path = 'insights/conv-assist';
|
|
20903
20789
|
const queryParams = this.getEmbedParamsObject();
|
|
20790
|
+
if (!isUndefined_1(enablePastConversationsSidebar)) {
|
|
20791
|
+
queryParams[Param.EnablePastConversationsSidebar] = !!enablePastConversationsSidebar;
|
|
20792
|
+
}
|
|
20904
20793
|
let query = '';
|
|
20905
20794
|
const queryParamsString = getQueryParamString(queryParams, true);
|
|
20906
20795
|
if (queryParamsString) {
|
|
@@ -22031,7 +21920,8 @@ query GetEurekaResults($params: Input_eureka_SearchRequest) {
|
|
|
22031
21920
|
return {
|
|
22032
21921
|
onAnchor: (source) => {
|
|
22033
21922
|
aliasObjects.push(source);
|
|
22034
|
-
|
|
21923
|
+
if (!prevAnchors)
|
|
21924
|
+
prevAnchors = anchorNames(doc);
|
|
22035
21925
|
const anchor = findNewAnchor(prefix, prevAnchors);
|
|
22036
21926
|
prevAnchors.add(anchor);
|
|
22037
21927
|
return anchor;
|
|
@@ -22195,36 +22085,23 @@ query GetEurekaResults($params: Input_eureka_SearchRequest) {
|
|
|
22195
22085
|
* Resolve the value of this alias within `doc`, finding the last
|
|
22196
22086
|
* instance of the `source` anchor before this node.
|
|
22197
22087
|
*/
|
|
22198
|
-
resolve(doc
|
|
22199
|
-
let nodes;
|
|
22200
|
-
if (ctx?.aliasResolveCache) {
|
|
22201
|
-
nodes = ctx.aliasResolveCache;
|
|
22202
|
-
}
|
|
22203
|
-
else {
|
|
22204
|
-
nodes = [];
|
|
22205
|
-
visit$1(doc, {
|
|
22206
|
-
Node: (_key, node) => {
|
|
22207
|
-
if (isAlias(node) || hasAnchor(node))
|
|
22208
|
-
nodes.push(node);
|
|
22209
|
-
}
|
|
22210
|
-
});
|
|
22211
|
-
if (ctx)
|
|
22212
|
-
ctx.aliasResolveCache = nodes;
|
|
22213
|
-
}
|
|
22088
|
+
resolve(doc) {
|
|
22214
22089
|
let found = undefined;
|
|
22215
|
-
|
|
22216
|
-
|
|
22217
|
-
|
|
22218
|
-
|
|
22219
|
-
|
|
22220
|
-
|
|
22090
|
+
visit$1(doc, {
|
|
22091
|
+
Node: (_key, node) => {
|
|
22092
|
+
if (node === this)
|
|
22093
|
+
return visit$1.BREAK;
|
|
22094
|
+
if (node.anchor === this.source)
|
|
22095
|
+
found = node;
|
|
22096
|
+
}
|
|
22097
|
+
});
|
|
22221
22098
|
return found;
|
|
22222
22099
|
}
|
|
22223
22100
|
toJSON(_arg, ctx) {
|
|
22224
22101
|
if (!ctx)
|
|
22225
22102
|
return { source: this.source };
|
|
22226
22103
|
const { anchors, doc, maxAliasCount } = ctx;
|
|
22227
|
-
const source = this.resolve(doc
|
|
22104
|
+
const source = this.resolve(doc);
|
|
22228
22105
|
if (!source) {
|
|
22229
22106
|
const msg = `Unresolved alias (the anchor must be set before the alias): ${this.source}`;
|
|
22230
22107
|
throw new ReferenceError(msg);
|
|
@@ -22343,7 +22220,8 @@ query GetEurekaResults($params: Input_eureka_SearchRequest) {
|
|
|
22343
22220
|
if (aliasDuplicateObjects && value && typeof value === 'object') {
|
|
22344
22221
|
ref = sourceObjects.get(value);
|
|
22345
22222
|
if (ref) {
|
|
22346
|
-
|
|
22223
|
+
if (!ref.anchor)
|
|
22224
|
+
ref.anchor = onAnchor(value);
|
|
22347
22225
|
return new Alias(ref.anchor);
|
|
22348
22226
|
}
|
|
22349
22227
|
else {
|
|
@@ -22854,7 +22732,7 @@ query GetEurekaResults($params: Input_eureka_SearchRequest) {
|
|
|
22854
22732
|
const { blockQuote, commentString, lineWidth } = ctx.options;
|
|
22855
22733
|
// 1. Block can't end in whitespace unless the last line is non-empty.
|
|
22856
22734
|
// 2. Strings consisting of only whitespace are best rendered explicitly.
|
|
22857
|
-
if (!blockQuote || /\n[\t ]+$/.test(value)) {
|
|
22735
|
+
if (!blockQuote || /\n[\t ]+$/.test(value) || /^\s*$/.test(value)) {
|
|
22858
22736
|
return quotedString(value, ctx);
|
|
22859
22737
|
}
|
|
22860
22738
|
const indent = ctx.indent ||
|
|
@@ -22914,32 +22792,23 @@ query GetEurekaResults($params: Input_eureka_SearchRequest) {
|
|
|
22914
22792
|
start = start.replace(/\n+/g, `$&${indent}`);
|
|
22915
22793
|
}
|
|
22916
22794
|
const indentSize = indent ? '2' : '1'; // root is at -1
|
|
22917
|
-
|
|
22918
|
-
let header = (startWithSpace ? indentSize : '') + chomp;
|
|
22795
|
+
let header = (literal ? '|' : '>') + (startWithSpace ? indentSize : '') + chomp;
|
|
22919
22796
|
if (comment) {
|
|
22920
22797
|
header += ' ' + commentString(comment.replace(/ ?[\r\n]+/g, ' '));
|
|
22921
22798
|
if (onComment)
|
|
22922
22799
|
onComment();
|
|
22923
22800
|
}
|
|
22924
|
-
if (
|
|
22925
|
-
|
|
22926
|
-
|
|
22927
|
-
.replace(/(?:^|\n)([\t ].*)(?:([\n\t ]*)\n(?![\n\t ]))?/g, '$1$2') // more-indented lines aren't folded
|
|
22928
|
-
// ^ more-ind. ^ empty ^ capture next empty lines only at end of indent
|
|
22929
|
-
.replace(/\n+/g, `$&${indent}`);
|
|
22930
|
-
let literalFallback = false;
|
|
22931
|
-
const foldOptions = getFoldOptions(ctx, true);
|
|
22932
|
-
if (blockQuote !== 'folded' && type !== Scalar.BLOCK_FOLDED) {
|
|
22933
|
-
foldOptions.onOverflow = () => {
|
|
22934
|
-
literalFallback = true;
|
|
22935
|
-
};
|
|
22936
|
-
}
|
|
22937
|
-
const body = foldFlowLines(`${start}${foldedValue}${end}`, indent, FOLD_BLOCK, foldOptions);
|
|
22938
|
-
if (!literalFallback)
|
|
22939
|
-
return `>${header}\n${indent}${body}`;
|
|
22801
|
+
if (literal) {
|
|
22802
|
+
value = value.replace(/\n+/g, `$&${indent}`);
|
|
22803
|
+
return `${header}\n${indent}${start}${value}${end}`;
|
|
22940
22804
|
}
|
|
22941
|
-
value = value
|
|
22942
|
-
|
|
22805
|
+
value = value
|
|
22806
|
+
.replace(/\n+/g, '\n$&')
|
|
22807
|
+
.replace(/(?:^|\n)([\t ].*)(?:([\n\t ]*)\n(?![\n\t ]))?/g, '$1$2') // more-indented lines aren't folded
|
|
22808
|
+
// ^ more-ind. ^ empty ^ capture next empty lines only at end of indent
|
|
22809
|
+
.replace(/\n+/g, `$&${indent}`);
|
|
22810
|
+
const body = foldFlowLines(`${start}${value}${end}`, indent, FOLD_BLOCK, getFoldOptions(ctx, true));
|
|
22811
|
+
return `${header}\n${indent}${body}`;
|
|
22943
22812
|
}
|
|
22944
22813
|
function plainString(item, ctx, onComment, onChompKeep) {
|
|
22945
22814
|
const { type, value } = item;
|
|
@@ -22948,9 +22817,10 @@ query GetEurekaResults($params: Input_eureka_SearchRequest) {
|
|
|
22948
22817
|
(inFlow && /[[\]{},]/.test(value))) {
|
|
22949
22818
|
return quotedString(value, ctx);
|
|
22950
22819
|
}
|
|
22951
|
-
if (
|
|
22820
|
+
if (!value ||
|
|
22821
|
+
/^[\n\t ,[\]{}#&*!|>'"%@`]|^[?-]$|^[?-][ \t]|[\n:][ \t]|[ \t]\n|[\n\t ]#|[\n\t :]$/.test(value)) {
|
|
22952
22822
|
// not allowed:
|
|
22953
|
-
// - '-' or '?'
|
|
22823
|
+
// - empty string, '-' or '?'
|
|
22954
22824
|
// - start with an indicator character (except [?:-]) or /[?-] /
|
|
22955
22825
|
// - '\n ', ': ' or ' \n' anywhere
|
|
22956
22826
|
// - '#' not preceded by a non-space char
|
|
@@ -23079,12 +22949,7 @@ query GetEurekaResults($params: Input_eureka_SearchRequest) {
|
|
|
23079
22949
|
let obj;
|
|
23080
22950
|
if (isScalar$1(item)) {
|
|
23081
22951
|
obj = item.value;
|
|
23082
|
-
|
|
23083
|
-
if (match.length > 1) {
|
|
23084
|
-
const testMatch = match.filter(t => t.test);
|
|
23085
|
-
if (testMatch.length > 0)
|
|
23086
|
-
match = testMatch;
|
|
23087
|
-
}
|
|
22952
|
+
const match = tags.filter(t => t.identify?.(obj));
|
|
23088
22953
|
tagObj =
|
|
23089
22954
|
match.find(t => t.format === item.format) ?? match.find(t => !t.format);
|
|
23090
22955
|
}
|
|
@@ -23093,7 +22958,7 @@ query GetEurekaResults($params: Input_eureka_SearchRequest) {
|
|
|
23093
22958
|
tagObj = tags.find(t => t.nodeClass && obj instanceof t.nodeClass);
|
|
23094
22959
|
}
|
|
23095
22960
|
if (!tagObj) {
|
|
23096
|
-
const name = obj?.constructor?.name ??
|
|
22961
|
+
const name = obj?.constructor?.name ?? typeof obj;
|
|
23097
22962
|
throw new Error(`Tag not resolved for ${name} value`);
|
|
23098
22963
|
}
|
|
23099
22964
|
return tagObj;
|
|
@@ -23108,7 +22973,7 @@ query GetEurekaResults($params: Input_eureka_SearchRequest) {
|
|
|
23108
22973
|
anchors.add(anchor);
|
|
23109
22974
|
props.push(`&${anchor}`);
|
|
23110
22975
|
}
|
|
23111
|
-
const tag = node.tag
|
|
22976
|
+
const tag = node.tag ? node.tag : tagObj.default ? null : tagObj.tag;
|
|
23112
22977
|
if (tag)
|
|
23113
22978
|
props.push(doc.directives.tagString(tag));
|
|
23114
22979
|
return props.join(' ');
|
|
@@ -23134,7 +22999,8 @@ query GetEurekaResults($params: Input_eureka_SearchRequest) {
|
|
|
23134
22999
|
const node = isNode(item)
|
|
23135
23000
|
? item
|
|
23136
23001
|
: ctx.doc.createNode(item, { onTagObj: o => (tagObj = o) });
|
|
23137
|
-
|
|
23002
|
+
if (!tagObj)
|
|
23003
|
+
tagObj = getTagObject(ctx.doc.schema.tags, node);
|
|
23138
23004
|
const props = stringifyProps(node, tagObj, ctx);
|
|
23139
23005
|
if (props.length > 0)
|
|
23140
23006
|
ctx.indentAtStart = (ctx.indentAtStart ?? 0) + props.length + 1;
|
|
@@ -23296,10 +23162,54 @@ query GetEurekaResults($params: Input_eureka_SearchRequest) {
|
|
|
23296
23162
|
|
|
23297
23163
|
function warn(logLevel, warning) {
|
|
23298
23164
|
if (logLevel === 'debug' || logLevel === 'warn') {
|
|
23299
|
-
|
|
23165
|
+
if (typeof process !== 'undefined' && process.emitWarning)
|
|
23166
|
+
process.emitWarning(warning);
|
|
23167
|
+
else
|
|
23168
|
+
console.warn(warning);
|
|
23300
23169
|
}
|
|
23301
23170
|
}
|
|
23302
23171
|
|
|
23172
|
+
const MERGE_KEY = '<<';
|
|
23173
|
+
function addPairToJSMap(ctx, map, { key, value }) {
|
|
23174
|
+
if (ctx?.doc.schema.merge && isMergeKey(key)) {
|
|
23175
|
+
value = isAlias(value) ? value.resolve(ctx.doc) : value;
|
|
23176
|
+
if (isSeq(value))
|
|
23177
|
+
for (const it of value.items)
|
|
23178
|
+
mergeToJSMap(ctx, map, it);
|
|
23179
|
+
else if (Array.isArray(value))
|
|
23180
|
+
for (const it of value)
|
|
23181
|
+
mergeToJSMap(ctx, map, it);
|
|
23182
|
+
else
|
|
23183
|
+
mergeToJSMap(ctx, map, value);
|
|
23184
|
+
}
|
|
23185
|
+
else {
|
|
23186
|
+
const jsKey = toJS(key, '', ctx);
|
|
23187
|
+
if (map instanceof Map) {
|
|
23188
|
+
map.set(jsKey, toJS(value, jsKey, ctx));
|
|
23189
|
+
}
|
|
23190
|
+
else if (map instanceof Set) {
|
|
23191
|
+
map.add(jsKey);
|
|
23192
|
+
}
|
|
23193
|
+
else {
|
|
23194
|
+
const stringKey = stringifyKey(key, jsKey, ctx);
|
|
23195
|
+
const jsValue = toJS(value, stringKey, ctx);
|
|
23196
|
+
if (stringKey in map)
|
|
23197
|
+
Object.defineProperty(map, stringKey, {
|
|
23198
|
+
value: jsValue,
|
|
23199
|
+
writable: true,
|
|
23200
|
+
enumerable: true,
|
|
23201
|
+
configurable: true
|
|
23202
|
+
});
|
|
23203
|
+
else
|
|
23204
|
+
map[stringKey] = jsValue;
|
|
23205
|
+
}
|
|
23206
|
+
}
|
|
23207
|
+
return map;
|
|
23208
|
+
}
|
|
23209
|
+
const isMergeKey = (key) => key === MERGE_KEY ||
|
|
23210
|
+
(isScalar$1(key) &&
|
|
23211
|
+
key.value === MERGE_KEY &&
|
|
23212
|
+
(!key.type || key.type === Scalar.PLAIN));
|
|
23303
23213
|
// If the value associated with a merge key is a single mapping node, each of
|
|
23304
23214
|
// its key/value pairs is inserted into the current mapping, unless the key
|
|
23305
23215
|
// already exists in it. If the value associated with the merge key is a
|
|
@@ -23307,35 +23217,7 @@ query GetEurekaResults($params: Input_eureka_SearchRequest) {
|
|
|
23307
23217
|
// of these nodes is merged in turn according to its order in the sequence.
|
|
23308
23218
|
// Keys in mapping nodes earlier in the sequence override keys specified in
|
|
23309
23219
|
// later mapping nodes. -- http://yaml.org/type/merge.html
|
|
23310
|
-
|
|
23311
|
-
const merge = {
|
|
23312
|
-
identify: value => value === MERGE_KEY ||
|
|
23313
|
-
(typeof value === 'symbol' && value.description === MERGE_KEY),
|
|
23314
|
-
default: 'key',
|
|
23315
|
-
tag: 'tag:yaml.org,2002:merge',
|
|
23316
|
-
test: /^<<$/,
|
|
23317
|
-
resolve: () => Object.assign(new Scalar(Symbol(MERGE_KEY)), {
|
|
23318
|
-
addToJSMap: addMergeToJSMap
|
|
23319
|
-
}),
|
|
23320
|
-
stringify: () => MERGE_KEY
|
|
23321
|
-
};
|
|
23322
|
-
const isMergeKey = (ctx, key) => (merge.identify(key) ||
|
|
23323
|
-
(isScalar$1(key) &&
|
|
23324
|
-
(!key.type || key.type === Scalar.PLAIN) &&
|
|
23325
|
-
merge.identify(key.value))) &&
|
|
23326
|
-
ctx?.doc.schema.tags.some(tag => tag.tag === merge.tag && tag.default);
|
|
23327
|
-
function addMergeToJSMap(ctx, map, value) {
|
|
23328
|
-
value = ctx && isAlias(value) ? value.resolve(ctx.doc) : value;
|
|
23329
|
-
if (isSeq(value))
|
|
23330
|
-
for (const it of value.items)
|
|
23331
|
-
mergeValue(ctx, map, it);
|
|
23332
|
-
else if (Array.isArray(value))
|
|
23333
|
-
for (const it of value)
|
|
23334
|
-
mergeValue(ctx, map, it);
|
|
23335
|
-
else
|
|
23336
|
-
mergeValue(ctx, map, value);
|
|
23337
|
-
}
|
|
23338
|
-
function mergeValue(ctx, map, value) {
|
|
23220
|
+
function mergeToJSMap(ctx, map, value) {
|
|
23339
23221
|
const source = ctx && isAlias(value) ? value.resolve(ctx.doc) : value;
|
|
23340
23222
|
if (!isMap(source))
|
|
23341
23223
|
throw new Error('Merge sources must be maps or map aliases');
|
|
@@ -23359,41 +23241,9 @@ query GetEurekaResults($params: Input_eureka_SearchRequest) {
|
|
|
23359
23241
|
}
|
|
23360
23242
|
return map;
|
|
23361
23243
|
}
|
|
23362
|
-
|
|
23363
|
-
function addPairToJSMap(ctx, map, { key, value }) {
|
|
23364
|
-
if (isNode(key) && key.addToJSMap)
|
|
23365
|
-
key.addToJSMap(ctx, map, value);
|
|
23366
|
-
// TODO: Should drop this special case for bare << handling
|
|
23367
|
-
else if (isMergeKey(ctx, key))
|
|
23368
|
-
addMergeToJSMap(ctx, map, value);
|
|
23369
|
-
else {
|
|
23370
|
-
const jsKey = toJS(key, '', ctx);
|
|
23371
|
-
if (map instanceof Map) {
|
|
23372
|
-
map.set(jsKey, toJS(value, jsKey, ctx));
|
|
23373
|
-
}
|
|
23374
|
-
else if (map instanceof Set) {
|
|
23375
|
-
map.add(jsKey);
|
|
23376
|
-
}
|
|
23377
|
-
else {
|
|
23378
|
-
const stringKey = stringifyKey(key, jsKey, ctx);
|
|
23379
|
-
const jsValue = toJS(value, stringKey, ctx);
|
|
23380
|
-
if (stringKey in map)
|
|
23381
|
-
Object.defineProperty(map, stringKey, {
|
|
23382
|
-
value: jsValue,
|
|
23383
|
-
writable: true,
|
|
23384
|
-
enumerable: true,
|
|
23385
|
-
configurable: true
|
|
23386
|
-
});
|
|
23387
|
-
else
|
|
23388
|
-
map[stringKey] = jsValue;
|
|
23389
|
-
}
|
|
23390
|
-
}
|
|
23391
|
-
return map;
|
|
23392
|
-
}
|
|
23393
23244
|
function stringifyKey(key, jsKey, ctx) {
|
|
23394
23245
|
if (jsKey === null)
|
|
23395
23246
|
return '';
|
|
23396
|
-
// eslint-disable-next-line @typescript-eslint/no-base-to-string
|
|
23397
23247
|
if (typeof jsKey !== 'object')
|
|
23398
23248
|
return String(jsKey);
|
|
23399
23249
|
if (isNode(key) && ctx?.doc) {
|
|
@@ -24026,7 +23876,7 @@ query GetEurekaResults($params: Input_eureka_SearchRequest) {
|
|
|
24026
23876
|
identify: value => typeof value === 'boolean',
|
|
24027
23877
|
default: true,
|
|
24028
23878
|
tag: 'tag:yaml.org,2002:bool',
|
|
24029
|
-
test: /^true
|
|
23879
|
+
test: /^true|false$/,
|
|
24030
23880
|
resolve: str => str === 'true',
|
|
24031
23881
|
stringify: stringifyJSON
|
|
24032
23882
|
},
|
|
@@ -24071,7 +23921,10 @@ query GetEurekaResults($params: Input_eureka_SearchRequest) {
|
|
|
24071
23921
|
* document.querySelector('#photo').src = URL.createObjectURL(blob)
|
|
24072
23922
|
*/
|
|
24073
23923
|
resolve(src, onError) {
|
|
24074
|
-
if (typeof
|
|
23924
|
+
if (typeof Buffer === 'function') {
|
|
23925
|
+
return Buffer.from(src, 'base64');
|
|
23926
|
+
}
|
|
23927
|
+
else if (typeof atob === 'function') {
|
|
24075
23928
|
// On IE 11, atob() can't handle newlines
|
|
24076
23929
|
const str = atob(src.replace(/[\n\r]/g, ''));
|
|
24077
23930
|
const buffer = new Uint8Array(str.length);
|
|
@@ -24085,11 +23938,15 @@ query GetEurekaResults($params: Input_eureka_SearchRequest) {
|
|
|
24085
23938
|
}
|
|
24086
23939
|
},
|
|
24087
23940
|
stringify({ comment, type, value }, ctx, onComment, onChompKeep) {
|
|
24088
|
-
if (!value)
|
|
24089
|
-
return '';
|
|
24090
23941
|
const buf = value; // checked earlier by binary.identify()
|
|
24091
23942
|
let str;
|
|
24092
|
-
if (typeof
|
|
23943
|
+
if (typeof Buffer === 'function') {
|
|
23944
|
+
str =
|
|
23945
|
+
buf instanceof Buffer
|
|
23946
|
+
? buf.toString('base64')
|
|
23947
|
+
: Buffer.from(buf.buffer).toString('base64');
|
|
23948
|
+
}
|
|
23949
|
+
else if (typeof btoa === 'function') {
|
|
24093
23950
|
let s = '';
|
|
24094
23951
|
for (let i = 0; i < buf.length; ++i)
|
|
24095
23952
|
s += String.fromCharCode(buf[i]);
|
|
@@ -24098,7 +23955,8 @@ query GetEurekaResults($params: Input_eureka_SearchRequest) {
|
|
|
24098
23955
|
else {
|
|
24099
23956
|
throw new Error('This environment does not support writing binary tags; either Buffer or btoa is required');
|
|
24100
23957
|
}
|
|
24101
|
-
|
|
23958
|
+
if (!type)
|
|
23959
|
+
type = Scalar.BLOCK_LITERAL;
|
|
24102
23960
|
if (type !== Scalar.QUOTE_DOUBLE) {
|
|
24103
23961
|
const lineWidth = Math.max(ctx.options.lineWidth - ctx.indent.length, ctx.options.minContentWidth);
|
|
24104
23962
|
const n = Math.ceil(str.length / lineWidth);
|
|
@@ -24567,7 +24425,7 @@ query GetEurekaResults($params: Input_eureka_SearchRequest) {
|
|
|
24567
24425
|
}
|
|
24568
24426
|
return new Date(date);
|
|
24569
24427
|
},
|
|
24570
|
-
stringify: ({ value }) => value
|
|
24428
|
+
stringify: ({ value }) => value.toISOString().replace(/((T00:00)?:00)?\.000Z$/, '')
|
|
24571
24429
|
};
|
|
24572
24430
|
|
|
24573
24431
|
const schema = [
|
|
@@ -24585,7 +24443,6 @@ query GetEurekaResults($params: Input_eureka_SearchRequest) {
|
|
|
24585
24443
|
floatExp,
|
|
24586
24444
|
float,
|
|
24587
24445
|
binary,
|
|
24588
|
-
merge,
|
|
24589
24446
|
omap,
|
|
24590
24447
|
pairs,
|
|
24591
24448
|
set,
|
|
@@ -24613,7 +24470,6 @@ query GetEurekaResults($params: Input_eureka_SearchRequest) {
|
|
|
24613
24470
|
intOct: intOct$1,
|
|
24614
24471
|
intTime,
|
|
24615
24472
|
map,
|
|
24616
|
-
merge,
|
|
24617
24473
|
null: nullTag,
|
|
24618
24474
|
omap,
|
|
24619
24475
|
pairs,
|
|
@@ -24623,20 +24479,13 @@ query GetEurekaResults($params: Input_eureka_SearchRequest) {
|
|
|
24623
24479
|
};
|
|
24624
24480
|
const coreKnownTags = {
|
|
24625
24481
|
'tag:yaml.org,2002:binary': binary,
|
|
24626
|
-
'tag:yaml.org,2002:merge': merge,
|
|
24627
24482
|
'tag:yaml.org,2002:omap': omap,
|
|
24628
24483
|
'tag:yaml.org,2002:pairs': pairs,
|
|
24629
24484
|
'tag:yaml.org,2002:set': set,
|
|
24630
24485
|
'tag:yaml.org,2002:timestamp': timestamp
|
|
24631
24486
|
};
|
|
24632
|
-
function getTags(customTags, schemaName
|
|
24633
|
-
|
|
24634
|
-
if (schemaTags && !customTags) {
|
|
24635
|
-
return addMergeTag && !schemaTags.includes(merge)
|
|
24636
|
-
? schemaTags.concat(merge)
|
|
24637
|
-
: schemaTags.slice();
|
|
24638
|
-
}
|
|
24639
|
-
let tags = schemaTags;
|
|
24487
|
+
function getTags(customTags, schemaName) {
|
|
24488
|
+
let tags = schemas.get(schemaName);
|
|
24640
24489
|
if (!tags) {
|
|
24641
24490
|
if (Array.isArray(customTags))
|
|
24642
24491
|
tags = [];
|
|
@@ -24655,21 +24504,17 @@ query GetEurekaResults($params: Input_eureka_SearchRequest) {
|
|
|
24655
24504
|
else if (typeof customTags === 'function') {
|
|
24656
24505
|
tags = customTags(tags.slice());
|
|
24657
24506
|
}
|
|
24658
|
-
|
|
24659
|
-
|
|
24660
|
-
|
|
24661
|
-
const tagObj =
|
|
24662
|
-
if (
|
|
24663
|
-
|
|
24664
|
-
|
|
24665
|
-
|
|
24666
|
-
|
|
24667
|
-
|
|
24668
|
-
|
|
24669
|
-
if (!tags.includes(tagObj))
|
|
24670
|
-
tags.push(tagObj);
|
|
24671
|
-
return tags;
|
|
24672
|
-
}, []);
|
|
24507
|
+
return tags.map(tag => {
|
|
24508
|
+
if (typeof tag !== 'string')
|
|
24509
|
+
return tag;
|
|
24510
|
+
const tagObj = tagsByName[tag];
|
|
24511
|
+
if (tagObj)
|
|
24512
|
+
return tagObj;
|
|
24513
|
+
const keys = Object.keys(tagsByName)
|
|
24514
|
+
.map(key => JSON.stringify(key))
|
|
24515
|
+
.join(', ');
|
|
24516
|
+
throw new Error(`Unknown custom tag "${tag}"; use one of ${keys}`);
|
|
24517
|
+
});
|
|
24673
24518
|
}
|
|
24674
24519
|
|
|
24675
24520
|
const sortMapEntriesByKey = (a, b) => a.key < b.key ? -1 : a.key > b.key ? 1 : 0;
|
|
@@ -24680,9 +24525,10 @@ query GetEurekaResults($params: Input_eureka_SearchRequest) {
|
|
|
24680
24525
|
: compat
|
|
24681
24526
|
? getTags(null, compat)
|
|
24682
24527
|
: null;
|
|
24528
|
+
this.merge = !!merge;
|
|
24683
24529
|
this.name = (typeof schema === 'string' && schema) || 'core';
|
|
24684
24530
|
this.knownTags = resolveKnownTags ? coreKnownTags : {};
|
|
24685
|
-
this.tags = getTags(customTags, this.name
|
|
24531
|
+
this.tags = getTags(customTags, this.name);
|
|
24686
24532
|
this.toStringOptions = toStringDefaults ?? null;
|
|
24687
24533
|
Object.defineProperty(this, MAP, { value: map });
|
|
24688
24534
|
Object.defineProperty(this, SCALAR$1, { value: string });
|
|
@@ -24807,7 +24653,6 @@ query GetEurekaResults($params: Input_eureka_SearchRequest) {
|
|
|
24807
24653
|
logLevel: 'warn',
|
|
24808
24654
|
prettyErrors: true,
|
|
24809
24655
|
strict: true,
|
|
24810
|
-
stringKeys: false,
|
|
24811
24656
|
uniqueKeys: true,
|
|
24812
24657
|
version: '1.2'
|
|
24813
24658
|
}, options);
|
|
@@ -25031,7 +24876,7 @@ query GetEurekaResults($params: Input_eureka_SearchRequest) {
|
|
|
25031
24876
|
this.directives.yaml.version = '1.1';
|
|
25032
24877
|
else
|
|
25033
24878
|
this.directives = new Directives({ version: '1.1' });
|
|
25034
|
-
opt = { resolveKnownTags: false, schema: 'yaml-1.1' };
|
|
24879
|
+
opt = { merge: true, resolveKnownTags: false, schema: 'yaml-1.1' };
|
|
25035
24880
|
break;
|
|
25036
24881
|
case '1.2':
|
|
25037
24882
|
case 'next':
|
|
@@ -25039,7 +24884,7 @@ query GetEurekaResults($params: Input_eureka_SearchRequest) {
|
|
|
25039
24884
|
this.directives.yaml.version = version;
|
|
25040
24885
|
else
|
|
25041
24886
|
this.directives = new Directives({ version });
|
|
25042
|
-
opt = { resolveKnownTags: true, schema: 'core' };
|
|
24887
|
+
opt = { merge: false, resolveKnownTags: true, schema: 'core' };
|
|
25043
24888
|
break;
|
|
25044
24889
|
case null:
|
|
25045
24890
|
if (this.directives)
|
|
@@ -25217,7 +25062,7 @@ query GetEurekaResults($params: Input_eureka_SearchRequest) {
|
|
|
25217
25062
|
if (atNewline) {
|
|
25218
25063
|
if (comment)
|
|
25219
25064
|
comment += token.source;
|
|
25220
|
-
else
|
|
25065
|
+
else
|
|
25221
25066
|
spaceBefore = true;
|
|
25222
25067
|
}
|
|
25223
25068
|
else
|
|
@@ -25234,7 +25079,8 @@ query GetEurekaResults($params: Input_eureka_SearchRequest) {
|
|
|
25234
25079
|
if (token.source.endsWith(':'))
|
|
25235
25080
|
onError(token.offset + token.source.length - 1, 'BAD_ALIAS', 'Anchor ending in : is ambiguous', true);
|
|
25236
25081
|
anchor = token;
|
|
25237
|
-
|
|
25082
|
+
if (start === null)
|
|
25083
|
+
start = token.offset;
|
|
25238
25084
|
atNewline = false;
|
|
25239
25085
|
hasSpace = false;
|
|
25240
25086
|
reqSpace = true;
|
|
@@ -25243,7 +25089,8 @@ query GetEurekaResults($params: Input_eureka_SearchRequest) {
|
|
|
25243
25089
|
if (tag)
|
|
25244
25090
|
onError(token, 'MULTIPLE_TAGS', 'A node can have at most one tag');
|
|
25245
25091
|
tag = token;
|
|
25246
|
-
|
|
25092
|
+
if (start === null)
|
|
25093
|
+
start = token.offset;
|
|
25247
25094
|
atNewline = false;
|
|
25248
25095
|
hasSpace = false;
|
|
25249
25096
|
reqSpace = true;
|
|
@@ -25356,7 +25203,11 @@ query GetEurekaResults($params: Input_eureka_SearchRequest) {
|
|
|
25356
25203
|
return false;
|
|
25357
25204
|
const isEqual = typeof uniqueKeys === 'function'
|
|
25358
25205
|
? uniqueKeys
|
|
25359
|
-
: (a, b) => a === b ||
|
|
25206
|
+
: (a, b) => a === b ||
|
|
25207
|
+
(isScalar$1(a) &&
|
|
25208
|
+
isScalar$1(b) &&
|
|
25209
|
+
a.value === b.value &&
|
|
25210
|
+
!(a.value === '<<' && ctx.schema.merge));
|
|
25360
25211
|
return items.some(pair => isEqual(pair.key, search));
|
|
25361
25212
|
}
|
|
25362
25213
|
|
|
@@ -25405,14 +25256,12 @@ query GetEurekaResults($params: Input_eureka_SearchRequest) {
|
|
|
25405
25256
|
onError(offset, 'BAD_INDENT', startColMsg);
|
|
25406
25257
|
}
|
|
25407
25258
|
// key value
|
|
25408
|
-
ctx.atKey = true;
|
|
25409
25259
|
const keyStart = keyProps.end;
|
|
25410
25260
|
const keyNode = key
|
|
25411
25261
|
? composeNode(ctx, key, keyProps, onError)
|
|
25412
25262
|
: composeEmptyNode(ctx, keyStart, start, null, keyProps, onError);
|
|
25413
25263
|
if (ctx.schema.compat)
|
|
25414
25264
|
flowIndentCheck(bm.indent, key, onError);
|
|
25415
|
-
ctx.atKey = false;
|
|
25416
25265
|
if (mapIncludes(ctx, map.items, keyNode))
|
|
25417
25266
|
onError(keyStart, 'DUPLICATE_KEY', 'Map keys must be unique');
|
|
25418
25267
|
// value properties
|
|
@@ -25472,8 +25321,6 @@ query GetEurekaResults($params: Input_eureka_SearchRequest) {
|
|
|
25472
25321
|
const seq = new NodeClass(ctx.schema);
|
|
25473
25322
|
if (ctx.atRoot)
|
|
25474
25323
|
ctx.atRoot = false;
|
|
25475
|
-
if (ctx.atKey)
|
|
25476
|
-
ctx.atKey = false;
|
|
25477
25324
|
let offset = bs.offset;
|
|
25478
25325
|
let commentEnd = null;
|
|
25479
25326
|
for (const { start, value } of bs.items) {
|
|
@@ -25558,8 +25405,6 @@ query GetEurekaResults($params: Input_eureka_SearchRequest) {
|
|
|
25558
25405
|
const atRoot = ctx.atRoot;
|
|
25559
25406
|
if (atRoot)
|
|
25560
25407
|
ctx.atRoot = false;
|
|
25561
|
-
if (ctx.atKey)
|
|
25562
|
-
ctx.atKey = false;
|
|
25563
25408
|
let offset = fc.offset + fc.start.source.length;
|
|
25564
25409
|
for (let i = 0; i < fc.items.length; ++i) {
|
|
25565
25410
|
const collItem = fc.items[i];
|
|
@@ -25639,14 +25484,12 @@ query GetEurekaResults($params: Input_eureka_SearchRequest) {
|
|
|
25639
25484
|
else {
|
|
25640
25485
|
// item is a key+value pair
|
|
25641
25486
|
// key value
|
|
25642
|
-
ctx.atKey = true;
|
|
25643
25487
|
const keyStart = props.end;
|
|
25644
25488
|
const keyNode = key
|
|
25645
25489
|
? composeNode(ctx, key, props, onError)
|
|
25646
25490
|
: composeEmptyNode(ctx, keyStart, start, null, props, onError);
|
|
25647
25491
|
if (isBlock(key))
|
|
25648
25492
|
onError(keyNode.range, 'BLOCK_IN_FLOW', blockMsg);
|
|
25649
|
-
ctx.atKey = false;
|
|
25650
25493
|
// value properties
|
|
25651
25494
|
const valueProps = resolveProps(sep ?? [], {
|
|
25652
25495
|
flow: fcName,
|
|
@@ -25802,8 +25645,8 @@ query GetEurekaResults($params: Input_eureka_SearchRequest) {
|
|
|
25802
25645
|
tag = kt;
|
|
25803
25646
|
}
|
|
25804
25647
|
else {
|
|
25805
|
-
if (kt) {
|
|
25806
|
-
onError(tagToken, 'BAD_COLLECTION_TYPE', `${kt.tag} used for ${expType} collection, but expects ${kt.collection
|
|
25648
|
+
if (kt?.collection) {
|
|
25649
|
+
onError(tagToken, 'BAD_COLLECTION_TYPE', `${kt.tag} used for ${expType} collection, but expects ${kt.collection}`, true);
|
|
25807
25650
|
}
|
|
25808
25651
|
else {
|
|
25809
25652
|
onError(tagToken, 'TAG_RESOLVE_FAILED', `Unresolved tag: ${tagName}`, true);
|
|
@@ -26244,16 +26087,11 @@ query GetEurekaResults($params: Input_eureka_SearchRequest) {
|
|
|
26244
26087
|
const tagName = tagToken
|
|
26245
26088
|
? ctx.directives.tagName(tagToken.source, msg => onError(tagToken, 'TAG_RESOLVE_FAILED', msg))
|
|
26246
26089
|
: null;
|
|
26247
|
-
|
|
26248
|
-
|
|
26249
|
-
|
|
26250
|
-
|
|
26251
|
-
|
|
26252
|
-
tag = findScalarTagByName(ctx.schema, value, tagName, tagToken, onError);
|
|
26253
|
-
else if (token.type === 'scalar')
|
|
26254
|
-
tag = findScalarTagByTest(ctx, value, token, onError);
|
|
26255
|
-
else
|
|
26256
|
-
tag = ctx.schema[SCALAR$1];
|
|
26090
|
+
const tag = tagToken && tagName
|
|
26091
|
+
? findScalarTagByName(ctx.schema, value, tagName, tagToken, onError)
|
|
26092
|
+
: token.type === 'scalar'
|
|
26093
|
+
? findScalarTagByTest(ctx, value, token, onError)
|
|
26094
|
+
: ctx.schema[SCALAR$1];
|
|
26257
26095
|
let scalar;
|
|
26258
26096
|
try {
|
|
26259
26097
|
const res = tag.resolve(value, msg => onError(tagToken ?? token, 'TAG_RESOLVE_FAILED', msg), ctx.options);
|
|
@@ -26301,9 +26139,8 @@ query GetEurekaResults($params: Input_eureka_SearchRequest) {
|
|
|
26301
26139
|
onError(tagToken, 'TAG_RESOLVE_FAILED', `Unresolved tag: ${tagName}`, tagName !== 'tag:yaml.org,2002:str');
|
|
26302
26140
|
return schema[SCALAR$1];
|
|
26303
26141
|
}
|
|
26304
|
-
function findScalarTagByTest({
|
|
26305
|
-
const tag = schema.tags.find(tag =>
|
|
26306
|
-
tag.test?.test(value)) || schema[SCALAR$1];
|
|
26142
|
+
function findScalarTagByTest({ directives, schema }, value, token, onError) {
|
|
26143
|
+
const tag = schema.tags.find(tag => tag.default && tag.test?.test(value)) || schema[SCALAR$1];
|
|
26307
26144
|
if (schema.compat) {
|
|
26308
26145
|
const compat = schema.compat.find(tag => tag.default && tag.test?.test(value)) ??
|
|
26309
26146
|
schema[SCALAR$1];
|
|
@@ -26319,7 +26156,8 @@ query GetEurekaResults($params: Input_eureka_SearchRequest) {
|
|
|
26319
26156
|
|
|
26320
26157
|
function emptyScalarPosition(offset, before, pos) {
|
|
26321
26158
|
if (before) {
|
|
26322
|
-
|
|
26159
|
+
if (pos === null)
|
|
26160
|
+
pos = before.length;
|
|
26323
26161
|
for (let i = pos - 1; i >= 0; --i) {
|
|
26324
26162
|
let st = before[i];
|
|
26325
26163
|
switch (st.type) {
|
|
@@ -26344,7 +26182,6 @@ query GetEurekaResults($params: Input_eureka_SearchRequest) {
|
|
|
26344
26182
|
|
|
26345
26183
|
const CN = { composeNode, composeEmptyNode };
|
|
26346
26184
|
function composeNode(ctx, token, props, onError) {
|
|
26347
|
-
const atKey = ctx.atKey;
|
|
26348
26185
|
const { spaceBefore, comment, anchor, tag } = props;
|
|
26349
26186
|
let node;
|
|
26350
26187
|
let isSrcToken = true;
|
|
@@ -26380,14 +26217,6 @@ query GetEurekaResults($params: Input_eureka_SearchRequest) {
|
|
|
26380
26217
|
}
|
|
26381
26218
|
if (anchor && node.anchor === '')
|
|
26382
26219
|
onError(anchor, 'BAD_ALIAS', 'Anchor cannot be an empty string');
|
|
26383
|
-
if (atKey &&
|
|
26384
|
-
ctx.options.stringKeys &&
|
|
26385
|
-
(!isScalar$1(node) ||
|
|
26386
|
-
typeof node.value !== 'string' ||
|
|
26387
|
-
(node.tag && node.tag !== 'tag:yaml.org,2002:str'))) {
|
|
26388
|
-
const msg = 'With stringKeys, all keys must be strings';
|
|
26389
|
-
onError(tag ?? token, 'NON_STRING_KEY', msg);
|
|
26390
|
-
}
|
|
26391
26220
|
if (spaceBefore)
|
|
26392
26221
|
node.spaceBefore = true;
|
|
26393
26222
|
if (comment) {
|
|
@@ -26440,7 +26269,6 @@ query GetEurekaResults($params: Input_eureka_SearchRequest) {
|
|
|
26440
26269
|
const opts = Object.assign({ _directives: directives }, options);
|
|
26441
26270
|
const doc = new Document(undefined, opts);
|
|
26442
26271
|
const ctx = {
|
|
26443
|
-
atKey: false,
|
|
26444
26272
|
atRoot: true,
|
|
26445
26273
|
directives: doc.directives,
|
|
26446
26274
|
options: doc.options,
|
|
@@ -28575,20 +28403,7 @@ query GetEurekaResults($params: Input_eureka_SearchRequest) {
|
|
|
28575
28403
|
default: {
|
|
28576
28404
|
const bv = this.startBlockValue(map);
|
|
28577
28405
|
if (bv) {
|
|
28578
|
-
if (bv.type
|
|
28579
|
-
if (!it.explicitKey &&
|
|
28580
|
-
it.sep &&
|
|
28581
|
-
!includesToken(it.sep, 'newline')) {
|
|
28582
|
-
yield* this.pop({
|
|
28583
|
-
type: 'error',
|
|
28584
|
-
offset: this.offset,
|
|
28585
|
-
message: 'Unexpected block-seq-ind on same line with key',
|
|
28586
|
-
source: this.source
|
|
28587
|
-
});
|
|
28588
|
-
return;
|
|
28589
|
-
}
|
|
28590
|
-
}
|
|
28591
|
-
else if (atMapIndent) {
|
|
28406
|
+
if (atMapIndent && bv.type !== 'block-seq') {
|
|
28592
28407
|
map.items.push({ start });
|
|
28593
28408
|
}
|
|
28594
28409
|
this.stack.push(bv);
|
|
@@ -28959,8 +28774,6 @@ query GetEurekaResults($params: Input_eureka_SearchRequest) {
|
|
|
28959
28774
|
if (!keepUndefined)
|
|
28960
28775
|
return undefined;
|
|
28961
28776
|
}
|
|
28962
|
-
if (isDocument(value) && !_replacer)
|
|
28963
|
-
return value.toString(options);
|
|
28964
28777
|
return new Document(value, _replacer, options).toString(options);
|
|
28965
28778
|
}
|
|
28966
28779
|
|