@thoughtspot/visual-embed-sdk 1.42.1-alpha.7 → 1.42.2
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/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 +14 -42
- package/cjs/src/embed/ts-embed.js.map +1 -1
- package/cjs/src/embed/ts-embed.spec.js +0 -2
- 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 +58 -93
- package/cjs/src/types.d.ts.map +1 -1
- package/cjs/src/types.js +21 -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-CjbriUI0.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/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 +58 -93
- 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 +86 -222
- package/dist/tsembed-react.js +230 -442
- package/dist/tsembed.es.js +85 -222
- package/dist/tsembed.js +228 -441
- package/dist/visual-embed-sdk-react-full.d.ts +104 -160
- package/dist/visual-embed-sdk-react.d.ts +95 -155
- package/dist/visual-embed-sdk.d.ts +95 -158
- 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/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 +14 -42
- package/lib/src/embed/ts-embed.js.map +1 -1
- package/lib/src/embed/ts-embed.spec.js +0 -2
- 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 +58 -93
- package/lib/src/types.d.ts.map +1 -1
- package/lib/src/types.js +20 -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/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 +7 -9
- package/src/embed/ts-embed.ts +31 -67
- 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 +56 -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.2 */
|
|
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);
|
|
@@ -3357,6 +3340,7 @@
|
|
|
3357
3340
|
Param["HideResult"] = "hideResult";
|
|
3358
3341
|
Param["UseLastSelectedDataSource"] = "useLastSelectedSources";
|
|
3359
3342
|
Param["Tag"] = "tag";
|
|
3343
|
+
Param["HideTagFilterChips"] = "hideTagFilterChips";
|
|
3360
3344
|
Param["AutoLogin"] = "autoLogin";
|
|
3361
3345
|
Param["searchTokenString"] = "searchTokenString";
|
|
3362
3346
|
Param["executeSearch"] = "executeSearch";
|
|
@@ -3445,6 +3429,7 @@
|
|
|
3445
3429
|
Param["ShowLiveboardReverifyBanner"] = "showLiveboardReverifyBanner";
|
|
3446
3430
|
Param["LiveboardHeaderV2"] = "isLiveboardHeaderV2Enabled";
|
|
3447
3431
|
Param["HideIrrelevantFiltersInTab"] = "hideIrrelevantFiltersAtTabLevel";
|
|
3432
|
+
Param["IsEnhancedFilterInteractivityEnabled"] = "isLiveboardPermissionV2Enabled";
|
|
3448
3433
|
Param["SpotterEnabled"] = "isSpotterExperienceEnabled";
|
|
3449
3434
|
Param["IsUnifiedSearchExperienceEnabled"] = "isUnifiedSearchExperienceEnabled";
|
|
3450
3435
|
Param["OverrideOrgId"] = "orgId";
|
|
@@ -3461,7 +3446,9 @@
|
|
|
3461
3446
|
Param["RootMarginForLazyLoad"] = "rootMarginForLazyLoad";
|
|
3462
3447
|
Param["LiveboardXLSXCSVDownload"] = "isLiveboardXLSXCSVDownloadEnabled";
|
|
3463
3448
|
Param["isPNGInScheduledEmailsEnabled"] = "isPNGInScheduledEmailsEnabled";
|
|
3449
|
+
Param["isCentralizedLiveboardFilterUXEnabled"] = "isCentralizedLiveboardFilterUXEnabled";
|
|
3464
3450
|
Param["isLinkParametersEnabled"] = "isLinkParametersEnabled";
|
|
3451
|
+
Param["EnablePastConversationsSidebar"] = "enablePastConversationsSidebar";
|
|
3465
3452
|
})(Param || (Param = {}));
|
|
3466
3453
|
/**
|
|
3467
3454
|
* ThoughtSpot application pages include actions and menu commands
|
|
@@ -3574,7 +3561,7 @@
|
|
|
3574
3561
|
*/
|
|
3575
3562
|
Action["SchedulesList"] = "schedule-list";
|
|
3576
3563
|
/**
|
|
3577
|
-
* The **Share** action on a Liveboard, Answer, or
|
|
3564
|
+
* The **Share** action on a Liveboard, Answer, or Model.
|
|
3578
3565
|
* Allows users to share an object with other users and groups.
|
|
3579
3566
|
* @example
|
|
3580
3567
|
* ```js
|
|
@@ -4032,7 +4019,7 @@
|
|
|
4032
4019
|
Action["AnswerChartSwitcher"] = "answerChartSwitcher";
|
|
4033
4020
|
/**
|
|
4034
4021
|
* The Favorites icon (*) for Answers,
|
|
4035
|
-
* Liveboard, and data objects like
|
|
4022
|
+
* Liveboard, and data objects like Model,
|
|
4036
4023
|
* Tables and Views.
|
|
4037
4024
|
* Allows adding an object to the user's favorites list.
|
|
4038
4025
|
* @example
|
|
@@ -4766,6 +4753,16 @@
|
|
|
4766
4753
|
* @version SDK: 1.42.0 | ThoughtSpot Cloud: 10.14.0.cl
|
|
4767
4754
|
*/
|
|
4768
4755
|
Action["RemoveAttachment"] = "removeAttachment";
|
|
4756
|
+
/**
|
|
4757
|
+
* The **Style panel** on a Liveboard.
|
|
4758
|
+
* Controls the visibility of the Liveboard style panel.
|
|
4759
|
+
* @example
|
|
4760
|
+
* ```js
|
|
4761
|
+
* hiddenActions: [Action.LiveboardStylePanel]
|
|
4762
|
+
* ```
|
|
4763
|
+
* @version SDK: 1.43.0 | ThoughtSpot Cloud: 10.15.0.cl
|
|
4764
|
+
*/
|
|
4765
|
+
Action["LiveboardStylePanel"] = "liveboardStylePanel";
|
|
4769
4766
|
})(exports.Action || (exports.Action = {}));
|
|
4770
4767
|
exports.PrefetchFeatures = void 0;
|
|
4771
4768
|
(function (PrefetchFeatures) {
|
|
@@ -4887,29 +4884,7 @@
|
|
|
4887
4884
|
* @version SDK: 1.26.7 | ThoughtSpot Cloud: 9.10.0.cl
|
|
4888
4885
|
*/
|
|
4889
4886
|
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 = {}));
|
|
4887
|
+
})(exports.LogLevel || (exports.LogLevel = {}));
|
|
4913
4888
|
|
|
4914
4889
|
const logFunctions = {
|
|
4915
4890
|
[exports.LogLevel.SILENT]: () => undefined,
|
|
@@ -7255,20 +7230,9 @@
|
|
|
7255
7230
|
|
|
7256
7231
|
var isEmpty_1 = isEmpty$1;
|
|
7257
7232
|
|
|
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
7233
|
const ERROR_MESSAGE = {
|
|
7270
7234
|
INVALID_THOUGHTSPOT_HOST: 'Error parsing ThoughtSpot host. Please provide a valid URL.',
|
|
7271
|
-
SPOTTER_EMBED_WORKSHEED_ID_NOT_FOUND: 'Please select a
|
|
7235
|
+
SPOTTER_EMBED_WORKSHEED_ID_NOT_FOUND: 'Please select a Model to get started',
|
|
7272
7236
|
LIVEBOARD_VIZ_ID_VALIDATION: 'Please select a Liveboard to embed.',
|
|
7273
7237
|
TRIGGER_TIMED_OUT: 'Trigger timed-out in getting a response',
|
|
7274
7238
|
SEARCHEMBED_BETA_WRANING_MESSAGE: 'SearchEmbed is in Beta in this release.',
|
|
@@ -9718,6 +9682,14 @@ mutation GetUnsavedAnswerTML($session: BachSessionIdInput!, $exportDependencies:
|
|
|
9718
9682
|
finalValidActions.push(action);
|
|
9719
9683
|
}
|
|
9720
9684
|
});
|
|
9685
|
+
// Step 4: Collect warnings for long custom action names
|
|
9686
|
+
const MAX_ACTION_NAME_LENGTH = 30;
|
|
9687
|
+
const warnings = finalValidActions
|
|
9688
|
+
.filter(action => action.name.length > MAX_ACTION_NAME_LENGTH)
|
|
9689
|
+
.map(action => `Custom action name '${action.name}' exceeds ${MAX_ACTION_NAME_LENGTH} characters. This may cause display or truncation issues in the UI.`);
|
|
9690
|
+
if (warnings.length > 0) {
|
|
9691
|
+
logger$3.warn(warnings);
|
|
9692
|
+
}
|
|
9721
9693
|
const sortedActions = sortBy_1(finalValidActions, (a) => a.name.toLocaleLowerCase());
|
|
9722
9694
|
return {
|
|
9723
9695
|
actions: sortedActions,
|
|
@@ -17516,27 +17488,27 @@ mutation GetUnsavedAnswerTML($session: BachSessionIdInput!, $exportDependencies:
|
|
|
17516
17488
|
* @param thoughtSpotHost
|
|
17517
17489
|
* @param containerEl
|
|
17518
17490
|
*/
|
|
17519
|
-
function processEventData(type,
|
|
17491
|
+
function processEventData(type, e, thoughtSpotHost, containerEl) {
|
|
17520
17492
|
switch (type) {
|
|
17521
17493
|
case exports.EmbedEvent.CustomAction:
|
|
17522
|
-
return processCustomAction(
|
|
17494
|
+
return processCustomAction(e, thoughtSpotHost);
|
|
17523
17495
|
case exports.EmbedEvent.AuthInit:
|
|
17524
|
-
return processAuthInit(
|
|
17496
|
+
return processAuthInit(e);
|
|
17525
17497
|
case exports.EmbedEvent.NoCookieAccess:
|
|
17526
|
-
return processNoCookieAccess(
|
|
17498
|
+
return processNoCookieAccess(e, containerEl);
|
|
17527
17499
|
case exports.EmbedEvent.AuthFailure:
|
|
17528
|
-
return processAuthFailure(
|
|
17500
|
+
return processAuthFailure(e, containerEl);
|
|
17529
17501
|
case exports.EmbedEvent.AuthLogout:
|
|
17530
|
-
return processAuthLogout(
|
|
17502
|
+
return processAuthLogout(e, containerEl);
|
|
17531
17503
|
case exports.EmbedEvent.ExitPresentMode:
|
|
17532
17504
|
return processExitPresentMode();
|
|
17533
17505
|
case exports.EmbedEvent.CLEAR_INFO_CACHE:
|
|
17534
17506
|
return processClearInfoCache();
|
|
17535
17507
|
}
|
|
17536
|
-
return
|
|
17508
|
+
return e;
|
|
17537
17509
|
}
|
|
17538
17510
|
|
|
17539
|
-
var name="@thoughtspot/visual-embed-sdk";var version$1="1.42.
|
|
17511
|
+
var name="@thoughtspot/visual-embed-sdk";var version$1="1.42.2";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
17512
|
|
|
17541
17513
|
/**
|
|
17542
17514
|
* Reloads the ThoughtSpot iframe.
|
|
@@ -17608,6 +17580,16 @@ mutation GetUnsavedAnswerTML($session: BachSessionIdInput!, $exportDependencies:
|
|
|
17608
17580
|
});
|
|
17609
17581
|
}
|
|
17610
17582
|
|
|
17583
|
+
exports.UIPassthroughEvent = void 0;
|
|
17584
|
+
(function (UIPassthroughEvent) {
|
|
17585
|
+
UIPassthroughEvent["PinAnswerToLiveboard"] = "addVizToPinboard";
|
|
17586
|
+
UIPassthroughEvent["SaveAnswer"] = "saveAnswer";
|
|
17587
|
+
UIPassthroughEvent["GetDiscoverabilityStatus"] = "getDiscoverabilityStatus";
|
|
17588
|
+
UIPassthroughEvent["GetAvailableUIPassthroughs"] = "getAvailableUiPassthroughs";
|
|
17589
|
+
UIPassthroughEvent["GetAnswerConfig"] = "getAnswerPageConfig";
|
|
17590
|
+
UIPassthroughEvent["GetLiveboardConfig"] = "getPinboardPageConfig";
|
|
17591
|
+
})(exports.UIPassthroughEvent || (exports.UIPassthroughEvent = {}));
|
|
17592
|
+
|
|
17611
17593
|
class HostEventClient {
|
|
17612
17594
|
constructor(iFrame) {
|
|
17613
17595
|
this.iFrame = iFrame;
|
|
@@ -17699,111 +17681,6 @@ mutation GetUnsavedAnswerTML($session: BachSessionIdInput!, $exportDependencies:
|
|
|
17699
17681
|
}
|
|
17700
17682
|
}
|
|
17701
17683
|
|
|
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
17684
|
/**
|
|
17808
17685
|
* Copyright (c) 2022
|
|
17809
17686
|
*
|
|
@@ -17857,27 +17734,6 @@ mutation GetUnsavedAnswerTML($session: BachSessionIdInput!, $exportDependencies:
|
|
|
17857
17734
|
*/
|
|
17858
17735
|
this.fullscreenChangeHandler = null;
|
|
17859
17736
|
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
17737
|
/**
|
|
17882
17738
|
* Send Custom style as part of payload of APP_INIT
|
|
17883
17739
|
* @param _
|
|
@@ -17962,18 +17818,6 @@ mutation GetUnsavedAnswerTML($session: BachSessionIdInput!, $exportDependencies:
|
|
|
17962
17818
|
this.on(exports.EmbedEvent.AuthInit, authInitHandler, { start: false }, true);
|
|
17963
17819
|
};
|
|
17964
17820
|
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
17821
|
/**
|
|
17978
17822
|
* @hidden
|
|
17979
17823
|
* Internal state to track if the embed container is loaded.
|
|
@@ -18159,8 +18003,16 @@ mutation GetUnsavedAnswerTML($session: BachSessionIdInput!, $exportDependencies:
|
|
|
18159
18003
|
*/
|
|
18160
18004
|
subscribeToMessageEvents() {
|
|
18161
18005
|
this.unsubscribeToMessageEvents();
|
|
18162
|
-
|
|
18163
|
-
|
|
18006
|
+
const messageEventListener = (event) => {
|
|
18007
|
+
const eventType = this.getEventType(event);
|
|
18008
|
+
const eventPort = this.getEventPort(event);
|
|
18009
|
+
const eventData = this.formatEventData(event, eventType);
|
|
18010
|
+
if (event.source === this.iFrame.contentWindow) {
|
|
18011
|
+
this.executeCallbacks(eventType, processEventData(eventType, eventData, this.thoughtSpotHost, this.isPreRendered ? this.preRenderWrapper : this.el), eventPort);
|
|
18012
|
+
}
|
|
18013
|
+
};
|
|
18014
|
+
window.addEventListener('message', messageEventListener);
|
|
18015
|
+
this.subscribedListeners.message = messageEventListener;
|
|
18164
18016
|
}
|
|
18165
18017
|
/**
|
|
18166
18018
|
* Adds event listeners for both network and message events.
|
|
@@ -18221,7 +18073,7 @@ mutation GetUnsavedAnswerTML($session: BachSessionIdInput!, $exportDependencies:
|
|
|
18221
18073
|
message: customActionsResult.errors,
|
|
18222
18074
|
});
|
|
18223
18075
|
}
|
|
18224
|
-
|
|
18076
|
+
return {
|
|
18225
18077
|
customisations: getCustomisations(this.embedConfig, this.viewConfig),
|
|
18226
18078
|
authToken,
|
|
18227
18079
|
runtimeFilterParams: this.viewConfig.excludeRuntimeFiltersfromURL
|
|
@@ -18239,9 +18091,7 @@ mutation GetUnsavedAnswerTML($session: BachSessionIdInput!, $exportDependencies:
|
|
|
18239
18091
|
customVariablesForThirdPartyTools: this.embedConfig.customVariablesForThirdPartyTools || {},
|
|
18240
18092
|
hiddenListColumns: this.viewConfig.hiddenListColumns || [],
|
|
18241
18093
|
customActions: customActionsResult.actions,
|
|
18242
|
-
...getInterceptInitData(this.embedConfig, this.viewConfig),
|
|
18243
18094
|
};
|
|
18244
|
-
return baseInitData;
|
|
18245
18095
|
}
|
|
18246
18096
|
async getAppInitData() {
|
|
18247
18097
|
return this.getDefaultAppInitData();
|
|
@@ -18670,8 +18520,9 @@ mutation GetUnsavedAnswerTML($session: BachSessionIdInput!, $exportDependencies:
|
|
|
18670
18520
|
// When start status is false it trigger only end releated
|
|
18671
18521
|
// payload
|
|
18672
18522
|
|| (!callbackObj.options.start && dataStatus === embedEventStatus.END)) {
|
|
18673
|
-
|
|
18674
|
-
|
|
18523
|
+
callbackObj.callback(data, (payload) => {
|
|
18524
|
+
this.triggerEventOnPort(eventPort, payload);
|
|
18525
|
+
});
|
|
18675
18526
|
}
|
|
18676
18527
|
});
|
|
18677
18528
|
}
|
|
@@ -19381,7 +19232,7 @@ mutation GetUnsavedAnswerTML($session: BachSessionIdInput!, $exportDependencies:
|
|
|
19381
19232
|
* embedded Liveboard or visualization.
|
|
19382
19233
|
*/
|
|
19383
19234
|
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;
|
|
19235
|
+
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
19236
|
let params = {};
|
|
19386
19237
|
params[Param.PrimaryNavHidden] = !showPrimaryNavbar;
|
|
19387
19238
|
params[Param.HideProfleAndHelp] = !!disableProfileAndHelp;
|
|
@@ -19393,6 +19244,7 @@ mutation GetUnsavedAnswerTML($session: BachSessionIdInput!, $exportDependencies:
|
|
|
19393
19244
|
params[Param.LiveboardHeaderSticky] = isLiveboardHeaderSticky;
|
|
19394
19245
|
params[Param.IsFullAppEmbed] = true;
|
|
19395
19246
|
params[Param.LiveboardHeaderV2] = isLiveboardCompactHeaderEnabled;
|
|
19247
|
+
params[Param.IsEnhancedFilterInteractivityEnabled] = isEnhancedFilterInteractivityEnabled;
|
|
19396
19248
|
params[Param.ShowLiveboardVerifiedBadge] = showLiveboardVerifiedBadge;
|
|
19397
19249
|
params[Param.ShowLiveboardReverifyBanner] = showLiveboardReverifyBanner;
|
|
19398
19250
|
params[Param.HideIrrelevantFiltersInTab] = hideIrrelevantChipsInLiveboardTabs;
|
|
@@ -19434,8 +19286,7 @@ mutation GetUnsavedAnswerTML($session: BachSessionIdInput!, $exportDependencies:
|
|
|
19434
19286
|
if (enableAskSage) {
|
|
19435
19287
|
params[Param.enableAskSage] = enableAskSage;
|
|
19436
19288
|
}
|
|
19437
|
-
|
|
19438
|
-
if (isOnBeforeGetVizDataInterceptEnabled && !enableApiIntercept) {
|
|
19289
|
+
if (isOnBeforeGetVizDataInterceptEnabled) {
|
|
19439
19290
|
params[Param.IsOnBeforeGetVizDataInterceptEnabled] = isOnBeforeGetVizDataInterceptEnabled;
|
|
19440
19291
|
}
|
|
19441
19292
|
if (homePageSearchBarMode) {
|
|
@@ -19450,9 +19301,15 @@ mutation GetUnsavedAnswerTML($session: BachSessionIdInput!, $exportDependencies:
|
|
|
19450
19301
|
if (isPNGInScheduledEmailsEnabled !== undefined) {
|
|
19451
19302
|
params[Param.isPNGInScheduledEmailsEnabled] = isPNGInScheduledEmailsEnabled;
|
|
19452
19303
|
}
|
|
19304
|
+
if (hideTagFilterChips !== undefined) {
|
|
19305
|
+
params[Param.HideTagFilterChips] = hideTagFilterChips;
|
|
19306
|
+
}
|
|
19453
19307
|
if (isLinkParametersEnabled !== undefined) {
|
|
19454
19308
|
params[Param.isLinkParametersEnabled] = isLinkParametersEnabled;
|
|
19455
19309
|
}
|
|
19310
|
+
if (isCentralizedLiveboardFilterUXEnabled != undefined) {
|
|
19311
|
+
params[Param.isCentralizedLiveboardFilterUXEnabled] = isCentralizedLiveboardFilterUXEnabled;
|
|
19312
|
+
}
|
|
19456
19313
|
params[Param.DataPanelV2Enabled] = dataPanelV2;
|
|
19457
19314
|
params[Param.HideHomepageLeftNav] = hideHomepageLeftNav;
|
|
19458
19315
|
params[Param.ModularHomeExperienceEnabled] = modularHomeExperience;
|
|
@@ -19807,7 +19664,7 @@ query GetEurekaVizSnapshots(
|
|
|
19807
19664
|
getEmbedParamsObject() {
|
|
19808
19665
|
let params = {};
|
|
19809
19666
|
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;
|
|
19667
|
+
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
19668
|
const preventLiveboardFilterRemoval = this.viewConfig.preventLiveboardFilterRemoval
|
|
19812
19669
|
|| this.viewConfig.preventPinboardFilterRemoval;
|
|
19813
19670
|
if (fullHeight === true) {
|
|
@@ -19875,11 +19732,15 @@ query GetEurekaVizSnapshots(
|
|
|
19875
19732
|
if (isLinkParametersEnabled !== undefined) {
|
|
19876
19733
|
params[Param.isLinkParametersEnabled] = isLinkParametersEnabled;
|
|
19877
19734
|
}
|
|
19735
|
+
if (isCentralizedLiveboardFilterUXEnabled !== undefined) {
|
|
19736
|
+
params[Param.isCentralizedLiveboardFilterUXEnabled] = isCentralizedLiveboardFilterUXEnabled;
|
|
19737
|
+
}
|
|
19878
19738
|
params[Param.LiveboardHeaderSticky] = isLiveboardHeaderSticky;
|
|
19879
19739
|
params[Param.LiveboardHeaderV2] = isLiveboardCompactHeaderEnabled;
|
|
19880
19740
|
params[Param.ShowLiveboardVerifiedBadge] = showLiveboardVerifiedBadge;
|
|
19881
19741
|
params[Param.ShowLiveboardReverifyBanner] = showLiveboardReverifyBanner;
|
|
19882
19742
|
params[Param.HideIrrelevantFiltersInTab] = hideIrrelevantChipsInLiveboardTabs;
|
|
19743
|
+
params[Param.IsEnhancedFilterInteractivityEnabled] = isEnhancedFilterInteractivityEnabled;
|
|
19883
19744
|
params[Param.DataPanelV2Enabled] = dataPanelV2;
|
|
19884
19745
|
params[Param.EnableCustomColumnGroups] = enableCustomColumnGroups;
|
|
19885
19746
|
params[Param.CoverAndFilterOptionInPDF] = coverAndFilterOptionInPDF;
|
|
@@ -20161,8 +20022,7 @@ query GetEurekaVizSnapshots(
|
|
|
20161
20022
|
if (hideSearchBar) {
|
|
20162
20023
|
queryParams[Param.HideSearchBar] = true;
|
|
20163
20024
|
}
|
|
20164
|
-
|
|
20165
|
-
if (isOnBeforeGetVizDataInterceptEnabled && !enableApiIntercept) {
|
|
20025
|
+
if (isOnBeforeGetVizDataInterceptEnabled) {
|
|
20166
20026
|
queryParams[Param.IsOnBeforeGetVizDataInterceptEnabled] = isOnBeforeGetVizDataInterceptEnabled;
|
|
20167
20027
|
}
|
|
20168
20028
|
if (!focusSearchBarOnRender) {
|
|
@@ -20874,7 +20734,7 @@ query SendMessage($params: Input_convassist_SendMessageRequest) {
|
|
|
20874
20734
|
this.viewConfig = viewConfig;
|
|
20875
20735
|
}
|
|
20876
20736
|
getEmbedParamsObject() {
|
|
20877
|
-
const { worksheetId, searchOptions, disableSourceSelection, hideSourceSelection, dataPanelV2, showSpotterLimitations, hideSampleQuestions, runtimeFilters, excludeRuntimeFiltersfromURL, runtimeParameters, excludeRuntimeParametersfromURL, } = this.viewConfig;
|
|
20737
|
+
const { worksheetId, searchOptions, disableSourceSelection, hideSourceSelection, dataPanelV2, showSpotterLimitations, hideSampleQuestions, enablePastConversationsSidebar, runtimeFilters, excludeRuntimeFiltersfromURL, runtimeParameters, excludeRuntimeParametersfromURL, } = this.viewConfig;
|
|
20878
20738
|
if (!worksheetId) {
|
|
20879
20739
|
this.handleError(ERROR_MESSAGE.SPOTTER_EMBED_WORKSHEED_ID_NOT_FOUND);
|
|
20880
20740
|
}
|
|
@@ -20898,9 +20758,12 @@ query SendMessage($params: Input_convassist_SendMessageRequest) {
|
|
|
20898
20758
|
return queryParams;
|
|
20899
20759
|
}
|
|
20900
20760
|
getIframeSrc() {
|
|
20901
|
-
const { worksheetId, searchOptions, runtimeFilters, excludeRuntimeFiltersfromURL, runtimeParameters, excludeRuntimeParametersfromURL, } = this.viewConfig;
|
|
20761
|
+
const { worksheetId, searchOptions, runtimeFilters, excludeRuntimeFiltersfromURL, runtimeParameters, excludeRuntimeParametersfromURL, enablePastConversationsSidebar } = this.viewConfig;
|
|
20902
20762
|
const path = 'insights/conv-assist';
|
|
20903
20763
|
const queryParams = this.getEmbedParamsObject();
|
|
20764
|
+
if (!isUndefined_1(enablePastConversationsSidebar)) {
|
|
20765
|
+
queryParams[Param.EnablePastConversationsSidebar] = !!enablePastConversationsSidebar;
|
|
20766
|
+
}
|
|
20904
20767
|
let query = '';
|
|
20905
20768
|
const queryParamsString = getQueryParamString(queryParams, true);
|
|
20906
20769
|
if (queryParamsString) {
|
|
@@ -22031,7 +21894,8 @@ query GetEurekaResults($params: Input_eureka_SearchRequest) {
|
|
|
22031
21894
|
return {
|
|
22032
21895
|
onAnchor: (source) => {
|
|
22033
21896
|
aliasObjects.push(source);
|
|
22034
|
-
|
|
21897
|
+
if (!prevAnchors)
|
|
21898
|
+
prevAnchors = anchorNames(doc);
|
|
22035
21899
|
const anchor = findNewAnchor(prefix, prevAnchors);
|
|
22036
21900
|
prevAnchors.add(anchor);
|
|
22037
21901
|
return anchor;
|
|
@@ -22195,36 +22059,23 @@ query GetEurekaResults($params: Input_eureka_SearchRequest) {
|
|
|
22195
22059
|
* Resolve the value of this alias within `doc`, finding the last
|
|
22196
22060
|
* instance of the `source` anchor before this node.
|
|
22197
22061
|
*/
|
|
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
|
-
}
|
|
22062
|
+
resolve(doc) {
|
|
22214
22063
|
let found = undefined;
|
|
22215
|
-
|
|
22216
|
-
|
|
22217
|
-
|
|
22218
|
-
|
|
22219
|
-
|
|
22220
|
-
|
|
22064
|
+
visit$1(doc, {
|
|
22065
|
+
Node: (_key, node) => {
|
|
22066
|
+
if (node === this)
|
|
22067
|
+
return visit$1.BREAK;
|
|
22068
|
+
if (node.anchor === this.source)
|
|
22069
|
+
found = node;
|
|
22070
|
+
}
|
|
22071
|
+
});
|
|
22221
22072
|
return found;
|
|
22222
22073
|
}
|
|
22223
22074
|
toJSON(_arg, ctx) {
|
|
22224
22075
|
if (!ctx)
|
|
22225
22076
|
return { source: this.source };
|
|
22226
22077
|
const { anchors, doc, maxAliasCount } = ctx;
|
|
22227
|
-
const source = this.resolve(doc
|
|
22078
|
+
const source = this.resolve(doc);
|
|
22228
22079
|
if (!source) {
|
|
22229
22080
|
const msg = `Unresolved alias (the anchor must be set before the alias): ${this.source}`;
|
|
22230
22081
|
throw new ReferenceError(msg);
|
|
@@ -22343,7 +22194,8 @@ query GetEurekaResults($params: Input_eureka_SearchRequest) {
|
|
|
22343
22194
|
if (aliasDuplicateObjects && value && typeof value === 'object') {
|
|
22344
22195
|
ref = sourceObjects.get(value);
|
|
22345
22196
|
if (ref) {
|
|
22346
|
-
|
|
22197
|
+
if (!ref.anchor)
|
|
22198
|
+
ref.anchor = onAnchor(value);
|
|
22347
22199
|
return new Alias(ref.anchor);
|
|
22348
22200
|
}
|
|
22349
22201
|
else {
|
|
@@ -22854,7 +22706,7 @@ query GetEurekaResults($params: Input_eureka_SearchRequest) {
|
|
|
22854
22706
|
const { blockQuote, commentString, lineWidth } = ctx.options;
|
|
22855
22707
|
// 1. Block can't end in whitespace unless the last line is non-empty.
|
|
22856
22708
|
// 2. Strings consisting of only whitespace are best rendered explicitly.
|
|
22857
|
-
if (!blockQuote || /\n[\t ]+$/.test(value)) {
|
|
22709
|
+
if (!blockQuote || /\n[\t ]+$/.test(value) || /^\s*$/.test(value)) {
|
|
22858
22710
|
return quotedString(value, ctx);
|
|
22859
22711
|
}
|
|
22860
22712
|
const indent = ctx.indent ||
|
|
@@ -22914,32 +22766,23 @@ query GetEurekaResults($params: Input_eureka_SearchRequest) {
|
|
|
22914
22766
|
start = start.replace(/\n+/g, `$&${indent}`);
|
|
22915
22767
|
}
|
|
22916
22768
|
const indentSize = indent ? '2' : '1'; // root is at -1
|
|
22917
|
-
|
|
22918
|
-
let header = (startWithSpace ? indentSize : '') + chomp;
|
|
22769
|
+
let header = (literal ? '|' : '>') + (startWithSpace ? indentSize : '') + chomp;
|
|
22919
22770
|
if (comment) {
|
|
22920
22771
|
header += ' ' + commentString(comment.replace(/ ?[\r\n]+/g, ' '));
|
|
22921
22772
|
if (onComment)
|
|
22922
22773
|
onComment();
|
|
22923
22774
|
}
|
|
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}`;
|
|
22775
|
+
if (literal) {
|
|
22776
|
+
value = value.replace(/\n+/g, `$&${indent}`);
|
|
22777
|
+
return `${header}\n${indent}${start}${value}${end}`;
|
|
22940
22778
|
}
|
|
22941
|
-
value = value
|
|
22942
|
-
|
|
22779
|
+
value = value
|
|
22780
|
+
.replace(/\n+/g, '\n$&')
|
|
22781
|
+
.replace(/(?:^|\n)([\t ].*)(?:([\n\t ]*)\n(?![\n\t ]))?/g, '$1$2') // more-indented lines aren't folded
|
|
22782
|
+
// ^ more-ind. ^ empty ^ capture next empty lines only at end of indent
|
|
22783
|
+
.replace(/\n+/g, `$&${indent}`);
|
|
22784
|
+
const body = foldFlowLines(`${start}${value}${end}`, indent, FOLD_BLOCK, getFoldOptions(ctx, true));
|
|
22785
|
+
return `${header}\n${indent}${body}`;
|
|
22943
22786
|
}
|
|
22944
22787
|
function plainString(item, ctx, onComment, onChompKeep) {
|
|
22945
22788
|
const { type, value } = item;
|
|
@@ -22948,9 +22791,10 @@ query GetEurekaResults($params: Input_eureka_SearchRequest) {
|
|
|
22948
22791
|
(inFlow && /[[\]{},]/.test(value))) {
|
|
22949
22792
|
return quotedString(value, ctx);
|
|
22950
22793
|
}
|
|
22951
|
-
if (
|
|
22794
|
+
if (!value ||
|
|
22795
|
+
/^[\n\t ,[\]{}#&*!|>'"%@`]|^[?-]$|^[?-][ \t]|[\n:][ \t]|[ \t]\n|[\n\t ]#|[\n\t :]$/.test(value)) {
|
|
22952
22796
|
// not allowed:
|
|
22953
|
-
// - '-' or '?'
|
|
22797
|
+
// - empty string, '-' or '?'
|
|
22954
22798
|
// - start with an indicator character (except [?:-]) or /[?-] /
|
|
22955
22799
|
// - '\n ', ': ' or ' \n' anywhere
|
|
22956
22800
|
// - '#' not preceded by a non-space char
|
|
@@ -23079,12 +22923,7 @@ query GetEurekaResults($params: Input_eureka_SearchRequest) {
|
|
|
23079
22923
|
let obj;
|
|
23080
22924
|
if (isScalar$1(item)) {
|
|
23081
22925
|
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
|
-
}
|
|
22926
|
+
const match = tags.filter(t => t.identify?.(obj));
|
|
23088
22927
|
tagObj =
|
|
23089
22928
|
match.find(t => t.format === item.format) ?? match.find(t => !t.format);
|
|
23090
22929
|
}
|
|
@@ -23093,7 +22932,7 @@ query GetEurekaResults($params: Input_eureka_SearchRequest) {
|
|
|
23093
22932
|
tagObj = tags.find(t => t.nodeClass && obj instanceof t.nodeClass);
|
|
23094
22933
|
}
|
|
23095
22934
|
if (!tagObj) {
|
|
23096
|
-
const name = obj?.constructor?.name ??
|
|
22935
|
+
const name = obj?.constructor?.name ?? typeof obj;
|
|
23097
22936
|
throw new Error(`Tag not resolved for ${name} value`);
|
|
23098
22937
|
}
|
|
23099
22938
|
return tagObj;
|
|
@@ -23108,7 +22947,7 @@ query GetEurekaResults($params: Input_eureka_SearchRequest) {
|
|
|
23108
22947
|
anchors.add(anchor);
|
|
23109
22948
|
props.push(`&${anchor}`);
|
|
23110
22949
|
}
|
|
23111
|
-
const tag = node.tag
|
|
22950
|
+
const tag = node.tag ? node.tag : tagObj.default ? null : tagObj.tag;
|
|
23112
22951
|
if (tag)
|
|
23113
22952
|
props.push(doc.directives.tagString(tag));
|
|
23114
22953
|
return props.join(' ');
|
|
@@ -23134,7 +22973,8 @@ query GetEurekaResults($params: Input_eureka_SearchRequest) {
|
|
|
23134
22973
|
const node = isNode(item)
|
|
23135
22974
|
? item
|
|
23136
22975
|
: ctx.doc.createNode(item, { onTagObj: o => (tagObj = o) });
|
|
23137
|
-
|
|
22976
|
+
if (!tagObj)
|
|
22977
|
+
tagObj = getTagObject(ctx.doc.schema.tags, node);
|
|
23138
22978
|
const props = stringifyProps(node, tagObj, ctx);
|
|
23139
22979
|
if (props.length > 0)
|
|
23140
22980
|
ctx.indentAtStart = (ctx.indentAtStart ?? 0) + props.length + 1;
|
|
@@ -23296,10 +23136,54 @@ query GetEurekaResults($params: Input_eureka_SearchRequest) {
|
|
|
23296
23136
|
|
|
23297
23137
|
function warn(logLevel, warning) {
|
|
23298
23138
|
if (logLevel === 'debug' || logLevel === 'warn') {
|
|
23299
|
-
|
|
23139
|
+
if (typeof process !== 'undefined' && process.emitWarning)
|
|
23140
|
+
process.emitWarning(warning);
|
|
23141
|
+
else
|
|
23142
|
+
console.warn(warning);
|
|
23300
23143
|
}
|
|
23301
23144
|
}
|
|
23302
23145
|
|
|
23146
|
+
const MERGE_KEY = '<<';
|
|
23147
|
+
function addPairToJSMap(ctx, map, { key, value }) {
|
|
23148
|
+
if (ctx?.doc.schema.merge && isMergeKey(key)) {
|
|
23149
|
+
value = isAlias(value) ? value.resolve(ctx.doc) : value;
|
|
23150
|
+
if (isSeq(value))
|
|
23151
|
+
for (const it of value.items)
|
|
23152
|
+
mergeToJSMap(ctx, map, it);
|
|
23153
|
+
else if (Array.isArray(value))
|
|
23154
|
+
for (const it of value)
|
|
23155
|
+
mergeToJSMap(ctx, map, it);
|
|
23156
|
+
else
|
|
23157
|
+
mergeToJSMap(ctx, map, value);
|
|
23158
|
+
}
|
|
23159
|
+
else {
|
|
23160
|
+
const jsKey = toJS(key, '', ctx);
|
|
23161
|
+
if (map instanceof Map) {
|
|
23162
|
+
map.set(jsKey, toJS(value, jsKey, ctx));
|
|
23163
|
+
}
|
|
23164
|
+
else if (map instanceof Set) {
|
|
23165
|
+
map.add(jsKey);
|
|
23166
|
+
}
|
|
23167
|
+
else {
|
|
23168
|
+
const stringKey = stringifyKey(key, jsKey, ctx);
|
|
23169
|
+
const jsValue = toJS(value, stringKey, ctx);
|
|
23170
|
+
if (stringKey in map)
|
|
23171
|
+
Object.defineProperty(map, stringKey, {
|
|
23172
|
+
value: jsValue,
|
|
23173
|
+
writable: true,
|
|
23174
|
+
enumerable: true,
|
|
23175
|
+
configurable: true
|
|
23176
|
+
});
|
|
23177
|
+
else
|
|
23178
|
+
map[stringKey] = jsValue;
|
|
23179
|
+
}
|
|
23180
|
+
}
|
|
23181
|
+
return map;
|
|
23182
|
+
}
|
|
23183
|
+
const isMergeKey = (key) => key === MERGE_KEY ||
|
|
23184
|
+
(isScalar$1(key) &&
|
|
23185
|
+
key.value === MERGE_KEY &&
|
|
23186
|
+
(!key.type || key.type === Scalar.PLAIN));
|
|
23303
23187
|
// If the value associated with a merge key is a single mapping node, each of
|
|
23304
23188
|
// its key/value pairs is inserted into the current mapping, unless the key
|
|
23305
23189
|
// already exists in it. If the value associated with the merge key is a
|
|
@@ -23307,35 +23191,7 @@ query GetEurekaResults($params: Input_eureka_SearchRequest) {
|
|
|
23307
23191
|
// of these nodes is merged in turn according to its order in the sequence.
|
|
23308
23192
|
// Keys in mapping nodes earlier in the sequence override keys specified in
|
|
23309
23193
|
// 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) {
|
|
23194
|
+
function mergeToJSMap(ctx, map, value) {
|
|
23339
23195
|
const source = ctx && isAlias(value) ? value.resolve(ctx.doc) : value;
|
|
23340
23196
|
if (!isMap(source))
|
|
23341
23197
|
throw new Error('Merge sources must be maps or map aliases');
|
|
@@ -23359,41 +23215,9 @@ query GetEurekaResults($params: Input_eureka_SearchRequest) {
|
|
|
23359
23215
|
}
|
|
23360
23216
|
return map;
|
|
23361
23217
|
}
|
|
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
23218
|
function stringifyKey(key, jsKey, ctx) {
|
|
23394
23219
|
if (jsKey === null)
|
|
23395
23220
|
return '';
|
|
23396
|
-
// eslint-disable-next-line @typescript-eslint/no-base-to-string
|
|
23397
23221
|
if (typeof jsKey !== 'object')
|
|
23398
23222
|
return String(jsKey);
|
|
23399
23223
|
if (isNode(key) && ctx?.doc) {
|
|
@@ -24026,7 +23850,7 @@ query GetEurekaResults($params: Input_eureka_SearchRequest) {
|
|
|
24026
23850
|
identify: value => typeof value === 'boolean',
|
|
24027
23851
|
default: true,
|
|
24028
23852
|
tag: 'tag:yaml.org,2002:bool',
|
|
24029
|
-
test: /^true
|
|
23853
|
+
test: /^true|false$/,
|
|
24030
23854
|
resolve: str => str === 'true',
|
|
24031
23855
|
stringify: stringifyJSON
|
|
24032
23856
|
},
|
|
@@ -24071,7 +23895,10 @@ query GetEurekaResults($params: Input_eureka_SearchRequest) {
|
|
|
24071
23895
|
* document.querySelector('#photo').src = URL.createObjectURL(blob)
|
|
24072
23896
|
*/
|
|
24073
23897
|
resolve(src, onError) {
|
|
24074
|
-
if (typeof
|
|
23898
|
+
if (typeof Buffer === 'function') {
|
|
23899
|
+
return Buffer.from(src, 'base64');
|
|
23900
|
+
}
|
|
23901
|
+
else if (typeof atob === 'function') {
|
|
24075
23902
|
// On IE 11, atob() can't handle newlines
|
|
24076
23903
|
const str = atob(src.replace(/[\n\r]/g, ''));
|
|
24077
23904
|
const buffer = new Uint8Array(str.length);
|
|
@@ -24085,11 +23912,15 @@ query GetEurekaResults($params: Input_eureka_SearchRequest) {
|
|
|
24085
23912
|
}
|
|
24086
23913
|
},
|
|
24087
23914
|
stringify({ comment, type, value }, ctx, onComment, onChompKeep) {
|
|
24088
|
-
if (!value)
|
|
24089
|
-
return '';
|
|
24090
23915
|
const buf = value; // checked earlier by binary.identify()
|
|
24091
23916
|
let str;
|
|
24092
|
-
if (typeof
|
|
23917
|
+
if (typeof Buffer === 'function') {
|
|
23918
|
+
str =
|
|
23919
|
+
buf instanceof Buffer
|
|
23920
|
+
? buf.toString('base64')
|
|
23921
|
+
: Buffer.from(buf.buffer).toString('base64');
|
|
23922
|
+
}
|
|
23923
|
+
else if (typeof btoa === 'function') {
|
|
24093
23924
|
let s = '';
|
|
24094
23925
|
for (let i = 0; i < buf.length; ++i)
|
|
24095
23926
|
s += String.fromCharCode(buf[i]);
|
|
@@ -24098,7 +23929,8 @@ query GetEurekaResults($params: Input_eureka_SearchRequest) {
|
|
|
24098
23929
|
else {
|
|
24099
23930
|
throw new Error('This environment does not support writing binary tags; either Buffer or btoa is required');
|
|
24100
23931
|
}
|
|
24101
|
-
|
|
23932
|
+
if (!type)
|
|
23933
|
+
type = Scalar.BLOCK_LITERAL;
|
|
24102
23934
|
if (type !== Scalar.QUOTE_DOUBLE) {
|
|
24103
23935
|
const lineWidth = Math.max(ctx.options.lineWidth - ctx.indent.length, ctx.options.minContentWidth);
|
|
24104
23936
|
const n = Math.ceil(str.length / lineWidth);
|
|
@@ -24567,7 +24399,7 @@ query GetEurekaResults($params: Input_eureka_SearchRequest) {
|
|
|
24567
24399
|
}
|
|
24568
24400
|
return new Date(date);
|
|
24569
24401
|
},
|
|
24570
|
-
stringify: ({ value }) => value
|
|
24402
|
+
stringify: ({ value }) => value.toISOString().replace(/((T00:00)?:00)?\.000Z$/, '')
|
|
24571
24403
|
};
|
|
24572
24404
|
|
|
24573
24405
|
const schema = [
|
|
@@ -24585,7 +24417,6 @@ query GetEurekaResults($params: Input_eureka_SearchRequest) {
|
|
|
24585
24417
|
floatExp,
|
|
24586
24418
|
float,
|
|
24587
24419
|
binary,
|
|
24588
|
-
merge,
|
|
24589
24420
|
omap,
|
|
24590
24421
|
pairs,
|
|
24591
24422
|
set,
|
|
@@ -24613,7 +24444,6 @@ query GetEurekaResults($params: Input_eureka_SearchRequest) {
|
|
|
24613
24444
|
intOct: intOct$1,
|
|
24614
24445
|
intTime,
|
|
24615
24446
|
map,
|
|
24616
|
-
merge,
|
|
24617
24447
|
null: nullTag,
|
|
24618
24448
|
omap,
|
|
24619
24449
|
pairs,
|
|
@@ -24623,20 +24453,13 @@ query GetEurekaResults($params: Input_eureka_SearchRequest) {
|
|
|
24623
24453
|
};
|
|
24624
24454
|
const coreKnownTags = {
|
|
24625
24455
|
'tag:yaml.org,2002:binary': binary,
|
|
24626
|
-
'tag:yaml.org,2002:merge': merge,
|
|
24627
24456
|
'tag:yaml.org,2002:omap': omap,
|
|
24628
24457
|
'tag:yaml.org,2002:pairs': pairs,
|
|
24629
24458
|
'tag:yaml.org,2002:set': set,
|
|
24630
24459
|
'tag:yaml.org,2002:timestamp': timestamp
|
|
24631
24460
|
};
|
|
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;
|
|
24461
|
+
function getTags(customTags, schemaName) {
|
|
24462
|
+
let tags = schemas.get(schemaName);
|
|
24640
24463
|
if (!tags) {
|
|
24641
24464
|
if (Array.isArray(customTags))
|
|
24642
24465
|
tags = [];
|
|
@@ -24655,21 +24478,17 @@ query GetEurekaResults($params: Input_eureka_SearchRequest) {
|
|
|
24655
24478
|
else if (typeof customTags === 'function') {
|
|
24656
24479
|
tags = customTags(tags.slice());
|
|
24657
24480
|
}
|
|
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
|
-
}, []);
|
|
24481
|
+
return tags.map(tag => {
|
|
24482
|
+
if (typeof tag !== 'string')
|
|
24483
|
+
return tag;
|
|
24484
|
+
const tagObj = tagsByName[tag];
|
|
24485
|
+
if (tagObj)
|
|
24486
|
+
return tagObj;
|
|
24487
|
+
const keys = Object.keys(tagsByName)
|
|
24488
|
+
.map(key => JSON.stringify(key))
|
|
24489
|
+
.join(', ');
|
|
24490
|
+
throw new Error(`Unknown custom tag "${tag}"; use one of ${keys}`);
|
|
24491
|
+
});
|
|
24673
24492
|
}
|
|
24674
24493
|
|
|
24675
24494
|
const sortMapEntriesByKey = (a, b) => a.key < b.key ? -1 : a.key > b.key ? 1 : 0;
|
|
@@ -24680,9 +24499,10 @@ query GetEurekaResults($params: Input_eureka_SearchRequest) {
|
|
|
24680
24499
|
: compat
|
|
24681
24500
|
? getTags(null, compat)
|
|
24682
24501
|
: null;
|
|
24502
|
+
this.merge = !!merge;
|
|
24683
24503
|
this.name = (typeof schema === 'string' && schema) || 'core';
|
|
24684
24504
|
this.knownTags = resolveKnownTags ? coreKnownTags : {};
|
|
24685
|
-
this.tags = getTags(customTags, this.name
|
|
24505
|
+
this.tags = getTags(customTags, this.name);
|
|
24686
24506
|
this.toStringOptions = toStringDefaults ?? null;
|
|
24687
24507
|
Object.defineProperty(this, MAP, { value: map });
|
|
24688
24508
|
Object.defineProperty(this, SCALAR$1, { value: string });
|
|
@@ -24807,7 +24627,6 @@ query GetEurekaResults($params: Input_eureka_SearchRequest) {
|
|
|
24807
24627
|
logLevel: 'warn',
|
|
24808
24628
|
prettyErrors: true,
|
|
24809
24629
|
strict: true,
|
|
24810
|
-
stringKeys: false,
|
|
24811
24630
|
uniqueKeys: true,
|
|
24812
24631
|
version: '1.2'
|
|
24813
24632
|
}, options);
|
|
@@ -25031,7 +24850,7 @@ query GetEurekaResults($params: Input_eureka_SearchRequest) {
|
|
|
25031
24850
|
this.directives.yaml.version = '1.1';
|
|
25032
24851
|
else
|
|
25033
24852
|
this.directives = new Directives({ version: '1.1' });
|
|
25034
|
-
opt = { resolveKnownTags: false, schema: 'yaml-1.1' };
|
|
24853
|
+
opt = { merge: true, resolveKnownTags: false, schema: 'yaml-1.1' };
|
|
25035
24854
|
break;
|
|
25036
24855
|
case '1.2':
|
|
25037
24856
|
case 'next':
|
|
@@ -25039,7 +24858,7 @@ query GetEurekaResults($params: Input_eureka_SearchRequest) {
|
|
|
25039
24858
|
this.directives.yaml.version = version;
|
|
25040
24859
|
else
|
|
25041
24860
|
this.directives = new Directives({ version });
|
|
25042
|
-
opt = { resolveKnownTags: true, schema: 'core' };
|
|
24861
|
+
opt = { merge: false, resolveKnownTags: true, schema: 'core' };
|
|
25043
24862
|
break;
|
|
25044
24863
|
case null:
|
|
25045
24864
|
if (this.directives)
|
|
@@ -25217,7 +25036,7 @@ query GetEurekaResults($params: Input_eureka_SearchRequest) {
|
|
|
25217
25036
|
if (atNewline) {
|
|
25218
25037
|
if (comment)
|
|
25219
25038
|
comment += token.source;
|
|
25220
|
-
else
|
|
25039
|
+
else
|
|
25221
25040
|
spaceBefore = true;
|
|
25222
25041
|
}
|
|
25223
25042
|
else
|
|
@@ -25234,7 +25053,8 @@ query GetEurekaResults($params: Input_eureka_SearchRequest) {
|
|
|
25234
25053
|
if (token.source.endsWith(':'))
|
|
25235
25054
|
onError(token.offset + token.source.length - 1, 'BAD_ALIAS', 'Anchor ending in : is ambiguous', true);
|
|
25236
25055
|
anchor = token;
|
|
25237
|
-
|
|
25056
|
+
if (start === null)
|
|
25057
|
+
start = token.offset;
|
|
25238
25058
|
atNewline = false;
|
|
25239
25059
|
hasSpace = false;
|
|
25240
25060
|
reqSpace = true;
|
|
@@ -25243,7 +25063,8 @@ query GetEurekaResults($params: Input_eureka_SearchRequest) {
|
|
|
25243
25063
|
if (tag)
|
|
25244
25064
|
onError(token, 'MULTIPLE_TAGS', 'A node can have at most one tag');
|
|
25245
25065
|
tag = token;
|
|
25246
|
-
|
|
25066
|
+
if (start === null)
|
|
25067
|
+
start = token.offset;
|
|
25247
25068
|
atNewline = false;
|
|
25248
25069
|
hasSpace = false;
|
|
25249
25070
|
reqSpace = true;
|
|
@@ -25356,7 +25177,11 @@ query GetEurekaResults($params: Input_eureka_SearchRequest) {
|
|
|
25356
25177
|
return false;
|
|
25357
25178
|
const isEqual = typeof uniqueKeys === 'function'
|
|
25358
25179
|
? uniqueKeys
|
|
25359
|
-
: (a, b) => a === b ||
|
|
25180
|
+
: (a, b) => a === b ||
|
|
25181
|
+
(isScalar$1(a) &&
|
|
25182
|
+
isScalar$1(b) &&
|
|
25183
|
+
a.value === b.value &&
|
|
25184
|
+
!(a.value === '<<' && ctx.schema.merge));
|
|
25360
25185
|
return items.some(pair => isEqual(pair.key, search));
|
|
25361
25186
|
}
|
|
25362
25187
|
|
|
@@ -25405,14 +25230,12 @@ query GetEurekaResults($params: Input_eureka_SearchRequest) {
|
|
|
25405
25230
|
onError(offset, 'BAD_INDENT', startColMsg);
|
|
25406
25231
|
}
|
|
25407
25232
|
// key value
|
|
25408
|
-
ctx.atKey = true;
|
|
25409
25233
|
const keyStart = keyProps.end;
|
|
25410
25234
|
const keyNode = key
|
|
25411
25235
|
? composeNode(ctx, key, keyProps, onError)
|
|
25412
25236
|
: composeEmptyNode(ctx, keyStart, start, null, keyProps, onError);
|
|
25413
25237
|
if (ctx.schema.compat)
|
|
25414
25238
|
flowIndentCheck(bm.indent, key, onError);
|
|
25415
|
-
ctx.atKey = false;
|
|
25416
25239
|
if (mapIncludes(ctx, map.items, keyNode))
|
|
25417
25240
|
onError(keyStart, 'DUPLICATE_KEY', 'Map keys must be unique');
|
|
25418
25241
|
// value properties
|
|
@@ -25472,8 +25295,6 @@ query GetEurekaResults($params: Input_eureka_SearchRequest) {
|
|
|
25472
25295
|
const seq = new NodeClass(ctx.schema);
|
|
25473
25296
|
if (ctx.atRoot)
|
|
25474
25297
|
ctx.atRoot = false;
|
|
25475
|
-
if (ctx.atKey)
|
|
25476
|
-
ctx.atKey = false;
|
|
25477
25298
|
let offset = bs.offset;
|
|
25478
25299
|
let commentEnd = null;
|
|
25479
25300
|
for (const { start, value } of bs.items) {
|
|
@@ -25558,8 +25379,6 @@ query GetEurekaResults($params: Input_eureka_SearchRequest) {
|
|
|
25558
25379
|
const atRoot = ctx.atRoot;
|
|
25559
25380
|
if (atRoot)
|
|
25560
25381
|
ctx.atRoot = false;
|
|
25561
|
-
if (ctx.atKey)
|
|
25562
|
-
ctx.atKey = false;
|
|
25563
25382
|
let offset = fc.offset + fc.start.source.length;
|
|
25564
25383
|
for (let i = 0; i < fc.items.length; ++i) {
|
|
25565
25384
|
const collItem = fc.items[i];
|
|
@@ -25639,14 +25458,12 @@ query GetEurekaResults($params: Input_eureka_SearchRequest) {
|
|
|
25639
25458
|
else {
|
|
25640
25459
|
// item is a key+value pair
|
|
25641
25460
|
// key value
|
|
25642
|
-
ctx.atKey = true;
|
|
25643
25461
|
const keyStart = props.end;
|
|
25644
25462
|
const keyNode = key
|
|
25645
25463
|
? composeNode(ctx, key, props, onError)
|
|
25646
25464
|
: composeEmptyNode(ctx, keyStart, start, null, props, onError);
|
|
25647
25465
|
if (isBlock(key))
|
|
25648
25466
|
onError(keyNode.range, 'BLOCK_IN_FLOW', blockMsg);
|
|
25649
|
-
ctx.atKey = false;
|
|
25650
25467
|
// value properties
|
|
25651
25468
|
const valueProps = resolveProps(sep ?? [], {
|
|
25652
25469
|
flow: fcName,
|
|
@@ -25802,8 +25619,8 @@ query GetEurekaResults($params: Input_eureka_SearchRequest) {
|
|
|
25802
25619
|
tag = kt;
|
|
25803
25620
|
}
|
|
25804
25621
|
else {
|
|
25805
|
-
if (kt) {
|
|
25806
|
-
onError(tagToken, 'BAD_COLLECTION_TYPE', `${kt.tag} used for ${expType} collection, but expects ${kt.collection
|
|
25622
|
+
if (kt?.collection) {
|
|
25623
|
+
onError(tagToken, 'BAD_COLLECTION_TYPE', `${kt.tag} used for ${expType} collection, but expects ${kt.collection}`, true);
|
|
25807
25624
|
}
|
|
25808
25625
|
else {
|
|
25809
25626
|
onError(tagToken, 'TAG_RESOLVE_FAILED', `Unresolved tag: ${tagName}`, true);
|
|
@@ -26244,16 +26061,11 @@ query GetEurekaResults($params: Input_eureka_SearchRequest) {
|
|
|
26244
26061
|
const tagName = tagToken
|
|
26245
26062
|
? ctx.directives.tagName(tagToken.source, msg => onError(tagToken, 'TAG_RESOLVE_FAILED', msg))
|
|
26246
26063
|
: 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];
|
|
26064
|
+
const tag = tagToken && tagName
|
|
26065
|
+
? findScalarTagByName(ctx.schema, value, tagName, tagToken, onError)
|
|
26066
|
+
: token.type === 'scalar'
|
|
26067
|
+
? findScalarTagByTest(ctx, value, token, onError)
|
|
26068
|
+
: ctx.schema[SCALAR$1];
|
|
26257
26069
|
let scalar;
|
|
26258
26070
|
try {
|
|
26259
26071
|
const res = tag.resolve(value, msg => onError(tagToken ?? token, 'TAG_RESOLVE_FAILED', msg), ctx.options);
|
|
@@ -26301,9 +26113,8 @@ query GetEurekaResults($params: Input_eureka_SearchRequest) {
|
|
|
26301
26113
|
onError(tagToken, 'TAG_RESOLVE_FAILED', `Unresolved tag: ${tagName}`, tagName !== 'tag:yaml.org,2002:str');
|
|
26302
26114
|
return schema[SCALAR$1];
|
|
26303
26115
|
}
|
|
26304
|
-
function findScalarTagByTest({
|
|
26305
|
-
const tag = schema.tags.find(tag =>
|
|
26306
|
-
tag.test?.test(value)) || schema[SCALAR$1];
|
|
26116
|
+
function findScalarTagByTest({ directives, schema }, value, token, onError) {
|
|
26117
|
+
const tag = schema.tags.find(tag => tag.default && tag.test?.test(value)) || schema[SCALAR$1];
|
|
26307
26118
|
if (schema.compat) {
|
|
26308
26119
|
const compat = schema.compat.find(tag => tag.default && tag.test?.test(value)) ??
|
|
26309
26120
|
schema[SCALAR$1];
|
|
@@ -26319,7 +26130,8 @@ query GetEurekaResults($params: Input_eureka_SearchRequest) {
|
|
|
26319
26130
|
|
|
26320
26131
|
function emptyScalarPosition(offset, before, pos) {
|
|
26321
26132
|
if (before) {
|
|
26322
|
-
|
|
26133
|
+
if (pos === null)
|
|
26134
|
+
pos = before.length;
|
|
26323
26135
|
for (let i = pos - 1; i >= 0; --i) {
|
|
26324
26136
|
let st = before[i];
|
|
26325
26137
|
switch (st.type) {
|
|
@@ -26344,7 +26156,6 @@ query GetEurekaResults($params: Input_eureka_SearchRequest) {
|
|
|
26344
26156
|
|
|
26345
26157
|
const CN = { composeNode, composeEmptyNode };
|
|
26346
26158
|
function composeNode(ctx, token, props, onError) {
|
|
26347
|
-
const atKey = ctx.atKey;
|
|
26348
26159
|
const { spaceBefore, comment, anchor, tag } = props;
|
|
26349
26160
|
let node;
|
|
26350
26161
|
let isSrcToken = true;
|
|
@@ -26380,14 +26191,6 @@ query GetEurekaResults($params: Input_eureka_SearchRequest) {
|
|
|
26380
26191
|
}
|
|
26381
26192
|
if (anchor && node.anchor === '')
|
|
26382
26193
|
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
26194
|
if (spaceBefore)
|
|
26392
26195
|
node.spaceBefore = true;
|
|
26393
26196
|
if (comment) {
|
|
@@ -26440,7 +26243,6 @@ query GetEurekaResults($params: Input_eureka_SearchRequest) {
|
|
|
26440
26243
|
const opts = Object.assign({ _directives: directives }, options);
|
|
26441
26244
|
const doc = new Document(undefined, opts);
|
|
26442
26245
|
const ctx = {
|
|
26443
|
-
atKey: false,
|
|
26444
26246
|
atRoot: true,
|
|
26445
26247
|
directives: doc.directives,
|
|
26446
26248
|
options: doc.options,
|
|
@@ -28575,20 +28377,7 @@ query GetEurekaResults($params: Input_eureka_SearchRequest) {
|
|
|
28575
28377
|
default: {
|
|
28576
28378
|
const bv = this.startBlockValue(map);
|
|
28577
28379
|
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) {
|
|
28380
|
+
if (atMapIndent && bv.type !== 'block-seq') {
|
|
28592
28381
|
map.items.push({ start });
|
|
28593
28382
|
}
|
|
28594
28383
|
this.stack.push(bv);
|
|
@@ -28959,8 +28748,6 @@ query GetEurekaResults($params: Input_eureka_SearchRequest) {
|
|
|
28959
28748
|
if (!keepUndefined)
|
|
28960
28749
|
return undefined;
|
|
28961
28750
|
}
|
|
28962
|
-
if (isDocument(value) && !_replacer)
|
|
28963
|
-
return value.toString(options);
|
|
28964
28751
|
return new Document(value, _replacer, options).toString(options);
|
|
28965
28752
|
}
|
|
28966
28753
|
|