@thoughtspot/visual-embed-sdk 1.37.1-spotter-embed → 1.38.0-alpha.1
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/README.md +1 -1
- package/cjs/package.json +2 -2
- package/cjs/src/embed/app.d.ts +43 -3
- package/cjs/src/embed/app.d.ts.map +1 -1
- package/cjs/src/embed/app.js +40 -7
- package/cjs/src/embed/app.js.map +1 -1
- package/cjs/src/embed/app.spec.js +23 -6
- 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 +7 -0
- package/cjs/src/embed/base.js.map +1 -1
- package/cjs/src/embed/bodyless-conversation.d.ts +8 -3
- package/cjs/src/embed/bodyless-conversation.d.ts.map +1 -1
- package/cjs/src/embed/bodyless-conversation.js +5 -2
- package/cjs/src/embed/bodyless-conversation.js.map +1 -1
- package/cjs/src/embed/bodyless-conversation.spec.js +286 -1
- package/cjs/src/embed/bodyless-conversation.spec.js.map +1 -1
- package/cjs/src/embed/conversation.d.ts +5 -3
- package/cjs/src/embed/conversation.d.ts.map +1 -1
- package/cjs/src/embed/conversation.js +3 -2
- package/cjs/src/embed/conversation.js.map +1 -1
- package/cjs/src/embed/liveboard.d.ts.map +1 -1
- package/cjs/src/embed/liveboard.js +21 -10
- package/cjs/src/embed/liveboard.js.map +1 -1
- package/cjs/src/embed/ts-embed.d.ts.map +1 -1
- package/cjs/src/embed/ts-embed.js +6 -4
- package/cjs/src/embed/ts-embed.js.map +1 -1
- package/cjs/src/embed/ts-embed.spec.d.ts.map +1 -1
- package/cjs/src/embed/ts-embed.spec.js +105 -0
- package/cjs/src/embed/ts-embed.spec.js.map +1 -1
- package/cjs/src/index.d.ts +4 -4
- package/cjs/src/index.d.ts.map +1 -1
- package/cjs/src/index.js +5 -3
- package/cjs/src/index.js.map +1 -1
- package/cjs/src/react/all-types-export.d.ts +1 -1
- package/cjs/src/react/all-types-export.d.ts.map +1 -1
- package/cjs/src/react/all-types-export.js +2 -1
- package/cjs/src/react/all-types-export.js.map +1 -1
- package/cjs/src/react/index.d.ts +32 -3
- package/cjs/src/react/index.d.ts.map +1 -1
- package/cjs/src/react/index.js +54 -2
- package/cjs/src/react/index.js.map +1 -1
- package/cjs/src/react/index.spec.js +94 -0
- package/cjs/src/react/index.spec.js.map +1 -1
- package/cjs/src/types.d.ts +25 -51
- package/cjs/src/types.d.ts.map +1 -1
- package/cjs/src/types.js +24 -50
- package/cjs/src/types.js.map +1 -1
- package/dist/{index-Cj4BVGHL.js → index-DeFzsyFF.js} +1 -1
- package/dist/{index-DnIvX1FR.js → index-NZYq1Tu3.js} +1 -2
- package/dist/src/embed/app.d.ts +43 -3
- 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 +8 -3
- package/dist/src/embed/bodyless-conversation.d.ts.map +1 -1
- package/dist/src/embed/conversation.d.ts +5 -3
- package/dist/src/embed/conversation.d.ts.map +1 -1
- package/dist/src/embed/liveboard.d.ts.map +1 -1
- package/dist/src/embed/ts-embed.d.ts.map +1 -1
- package/dist/src/embed/ts-embed.spec.d.ts.map +1 -1
- package/dist/src/index.d.ts +4 -4
- package/dist/src/index.d.ts.map +1 -1
- package/dist/src/react/all-types-export.d.ts +1 -1
- package/dist/src/react/all-types-export.d.ts.map +1 -1
- package/dist/src/react/index.d.ts +32 -3
- package/dist/src/react/index.d.ts.map +1 -1
- package/dist/src/types.d.ts +25 -51
- package/dist/src/types.d.ts.map +1 -1
- package/dist/tsembed-react.es.js +614 -77
- package/dist/tsembed-react.js +758 -296
- package/dist/tsembed.es.js +153 -75
- package/dist/tsembed.js +297 -295
- package/dist/visual-embed-sdk-react-full.d.ts +194 -145
- package/dist/visual-embed-sdk-react.d.ts +194 -145
- package/dist/visual-embed-sdk.d.ts +82 -61
- package/lib/package.json +2 -2
- package/lib/src/embed/app.d.ts +43 -3
- package/lib/src/embed/app.d.ts.map +1 -1
- package/lib/src/embed/app.js +39 -6
- package/lib/src/embed/app.js.map +1 -1
- package/lib/src/embed/app.spec.js +24 -7
- 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 +7 -0
- package/lib/src/embed/base.js.map +1 -1
- package/lib/src/embed/bodyless-conversation.d.ts +8 -3
- package/lib/src/embed/bodyless-conversation.d.ts.map +1 -1
- package/lib/src/embed/bodyless-conversation.js +5 -2
- package/lib/src/embed/bodyless-conversation.js.map +1 -1
- package/lib/src/embed/bodyless-conversation.spec.js +287 -2
- package/lib/src/embed/bodyless-conversation.spec.js.map +1 -1
- package/lib/src/embed/conversation.d.ts +5 -3
- package/lib/src/embed/conversation.d.ts.map +1 -1
- package/lib/src/embed/conversation.js +3 -2
- package/lib/src/embed/conversation.js.map +1 -1
- package/lib/src/embed/liveboard.d.ts.map +1 -1
- package/lib/src/embed/liveboard.js +21 -10
- package/lib/src/embed/liveboard.js.map +1 -1
- package/lib/src/embed/ts-embed.d.ts.map +1 -1
- package/lib/src/embed/ts-embed.js +6 -4
- package/lib/src/embed/ts-embed.js.map +1 -1
- package/lib/src/embed/ts-embed.spec.d.ts.map +1 -1
- package/lib/src/embed/ts-embed.spec.js +105 -0
- package/lib/src/embed/ts-embed.spec.js.map +1 -1
- package/lib/src/index.d.ts +4 -4
- package/lib/src/index.d.ts.map +1 -1
- package/lib/src/index.js +4 -4
- package/lib/src/index.js.map +1 -1
- package/lib/src/react/all-types-export.d.ts +1 -1
- package/lib/src/react/all-types-export.d.ts.map +1 -1
- package/lib/src/react/all-types-export.js +1 -1
- package/lib/src/react/all-types-export.js.map +1 -1
- package/lib/src/react/index.d.ts +32 -3
- package/lib/src/react/index.d.ts.map +1 -1
- package/lib/src/react/index.js +53 -1
- package/lib/src/react/index.js.map +1 -1
- package/lib/src/react/index.spec.js +96 -2
- package/lib/src/react/index.spec.js.map +1 -1
- package/lib/src/types.d.ts +25 -51
- package/lib/src/types.d.ts.map +1 -1
- package/lib/src/types.js +24 -50
- package/lib/src/types.js.map +1 -1
- package/lib/src/visual-embed-sdk.d.ts +85 -64
- package/package.json +2 -2
- package/src/embed/app.spec.ts +30 -6
- package/src/embed/app.ts +62 -9
- package/src/embed/base.ts +9 -0
- package/src/embed/bodyless-conversation.spec.ts +308 -1
- package/src/embed/bodyless-conversation.ts +13 -3
- package/src/embed/conversation.ts +5 -3
- package/src/embed/liveboard.ts +25 -10
- package/src/embed/ts-embed.spec.ts +130 -0
- package/src/embed/ts-embed.ts +6 -4
- package/src/index.ts +10 -3
- package/src/react/all-types-export.ts +1 -0
- package/src/react/index.spec.tsx +157 -1
- package/src/react/index.tsx +64 -3
- package/src/types.ts +24 -56
- package/cjs/src/pages/embed-test.page.d.ts +0 -8
- package/cjs/src/pages/embed-test.page.d.ts.map +0 -1
- package/cjs/src/pages/embed-test.page.js +0 -20
- package/cjs/src/pages/embed-test.page.js.map +0 -1
- package/cjs/src/pages/home.page.d.ts +0 -6
- package/cjs/src/pages/home.page.d.ts.map +0 -1
- package/cjs/src/pages/home.page.js +0 -12
- package/cjs/src/pages/home.page.js.map +0 -1
- package/cjs/src/pages/login.page.d.ts +0 -15
- package/cjs/src/pages/login.page.d.ts.map +0 -1
- package/cjs/src/pages/login.page.js +0 -22
- package/cjs/src/pages/login.page.js.map +0 -1
- package/cjs/src/tests/auth.test.d.ts +0 -1
- package/cjs/src/tests/auth.test.d.ts.map +0 -1
- package/cjs/src/tests/auth.test.js +0 -1
- package/cjs/src/tests/auth.test.js.map +0 -1
- package/cjs/src/tests/e2e/auth.spec.d.ts +0 -2
- package/cjs/src/tests/e2e/auth.spec.d.ts.map +0 -1
- package/cjs/src/tests/e2e/auth.spec.js +0 -54
- package/cjs/src/tests/e2e/auth.spec.js.map +0 -1
- package/dist/index-DUaG1OG2.js +0 -7447
- package/dist/index-Fhk1V_Gw.js +0 -7371
- package/dist/index-OuiZF3zE.js +0 -7371
package/dist/tsembed-react.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
/* @thoughtspot/visual-embed-sdk version 1.
|
|
1
|
+
/* @thoughtspot/visual-embed-sdk version 1.38.0-alpha.1 */
|
|
2
2
|
'use client';
|
|
3
3
|
(function (global, factory) {
|
|
4
4
|
typeof exports === 'object' && typeof module !== 'undefined' ? factory(exports, require('react')) :
|
|
@@ -163,7 +163,7 @@
|
|
|
163
163
|
}
|
|
164
164
|
return false;
|
|
165
165
|
};
|
|
166
|
-
const merge
|
|
166
|
+
const merge = (...objects) => objects.reduce((result, current) => {
|
|
167
167
|
if (Array.isArray(current)) {
|
|
168
168
|
throw new TypeError("Arguments provided to ts-deepmerge must be objects, not arrays.");
|
|
169
169
|
}
|
|
@@ -172,19 +172,19 @@
|
|
|
172
172
|
return;
|
|
173
173
|
}
|
|
174
174
|
if (Array.isArray(result[key]) && Array.isArray(current[key])) {
|
|
175
|
-
result[key] = merge
|
|
176
|
-
? merge
|
|
175
|
+
result[key] = merge.options.mergeArrays
|
|
176
|
+
? merge.options.uniqueArrayItems
|
|
177
177
|
? Array.from(new Set(result[key].concat(current[key])))
|
|
178
178
|
: [...result[key], ...current[key]]
|
|
179
179
|
: current[key];
|
|
180
180
|
}
|
|
181
181
|
else if (isObject$1(result[key]) && isObject$1(current[key])) {
|
|
182
|
-
result[key] = merge
|
|
182
|
+
result[key] = merge(result[key], current[key]);
|
|
183
183
|
}
|
|
184
184
|
else {
|
|
185
185
|
result[key] =
|
|
186
186
|
current[key] === undefined
|
|
187
|
-
? merge
|
|
187
|
+
? merge.options.allowUndefinedOverrides
|
|
188
188
|
? current[key]
|
|
189
189
|
: result[key]
|
|
190
190
|
: current[key];
|
|
@@ -197,11 +197,11 @@
|
|
|
197
197
|
mergeArrays: true,
|
|
198
198
|
uniqueArrayItems: true,
|
|
199
199
|
};
|
|
200
|
-
merge
|
|
201
|
-
merge
|
|
202
|
-
merge
|
|
203
|
-
const result = merge
|
|
204
|
-
merge
|
|
200
|
+
merge.options = defaultOptions;
|
|
201
|
+
merge.withOptions = (options, ...objects) => {
|
|
202
|
+
merge.options = Object.assign(Object.assign({}, defaultOptions), options);
|
|
203
|
+
const result = merge(...objects);
|
|
204
|
+
merge.options = defaultOptions;
|
|
205
205
|
return result;
|
|
206
206
|
};
|
|
207
207
|
|
|
@@ -402,7 +402,7 @@
|
|
|
402
402
|
function getDOMNode(domSelector) {
|
|
403
403
|
return typeof domSelector === 'string' ? document.querySelector(domSelector) : domSelector;
|
|
404
404
|
}
|
|
405
|
-
const deepMerge = (target, source) => merge
|
|
405
|
+
const deepMerge = (target, source) => merge(target, source);
|
|
406
406
|
const getOperationNameFromQuery = (query) => {
|
|
407
407
|
const regex = /(?:query|mutation)\s+(\w+)/;
|
|
408
408
|
const matches = query.match(regex);
|
|
@@ -2136,9 +2136,12 @@
|
|
|
2136
2136
|
* @example
|
|
2137
2137
|
* ```js
|
|
2138
2138
|
* searchEmbed.trigger(HostEvent.OpenFilter,
|
|
2139
|
-
* { columnId: '<column-GUID>', name: 'column name', type: 'INT64', dataType: 'ATTRIBUTE'})
|
|
2139
|
+
* {column: { columnId: '<column-GUID>', name: 'column name', type: 'INT64', dataType: 'ATTRIBUTE'}})
|
|
2140
|
+
* ```
|
|
2141
|
+
* @example
|
|
2142
|
+
* ```js
|
|
2140
2143
|
* LiveboardEmbed.trigger(HostEvent.OpenFilter,
|
|
2141
|
-
*
|
|
2144
|
+
* { column: {columnId: '<column-GUID>'}})
|
|
2142
2145
|
* ```
|
|
2143
2146
|
* @version SDK: 1.21.0 | ThoughtSpot: 9.2.0.cl
|
|
2144
2147
|
*/
|
|
@@ -2747,6 +2750,25 @@
|
|
|
2747
2750
|
* }]
|
|
2748
2751
|
* });
|
|
2749
2752
|
* ```
|
|
2753
|
+
* If there are multiple columns with the same name, consider
|
|
2754
|
+
* using `WORKSHEET_NAME::COLUMN_NAME` format.
|
|
2755
|
+
*
|
|
2756
|
+
* @example
|
|
2757
|
+
*
|
|
2758
|
+
* ```js
|
|
2759
|
+
* liveboardEmbed.trigger(HostEvent.UpdateFilters, {
|
|
2760
|
+
* filters: [{
|
|
2761
|
+
* column: "(Sample) Retail - Apparel::city",
|
|
2762
|
+
* oper: 'IN',
|
|
2763
|
+
* values: ["atlanta"]
|
|
2764
|
+
* },
|
|
2765
|
+
* {
|
|
2766
|
+
* column: "(Sample) Retail - Apparel::Region",
|
|
2767
|
+
* oper: 'IN',
|
|
2768
|
+
* values: ["West","Midwest"]
|
|
2769
|
+
* }]
|
|
2770
|
+
* });
|
|
2771
|
+
* ```
|
|
2750
2772
|
* @version SDK: 1.23.0 | ThoughtSpot: 9.4.0.cl
|
|
2751
2773
|
*/
|
|
2752
2774
|
HostEvent["UpdateFilters"] = "updateFilters";
|
|
@@ -2956,54 +2978,6 @@
|
|
|
2956
2978
|
* @version SDK: 1.37.0 | ThoughtSpot: 10.8.0.cl
|
|
2957
2979
|
*/
|
|
2958
2980
|
HostEvent["TransformTableVizData"] = "TransformTableVizData";
|
|
2959
|
-
/**
|
|
2960
|
-
* Triggers the table visualization re-render with the updated data.
|
|
2961
|
-
* Includes the following properties:
|
|
2962
|
-
* @param - `columnDataLite` - an array of object containing the
|
|
2963
|
-
* data value modifications retrieved from the `EmbedEvent.TableVizRendered`
|
|
2964
|
-
* payload.For example, { columnDataLite: []}`.
|
|
2965
|
-
*/
|
|
2966
|
-
HostEvent["SpotterSearch"] = "SpotterSearch";
|
|
2967
|
-
/**
|
|
2968
|
-
* Triggers the table visualization re-render with the updated data.
|
|
2969
|
-
* Includes the following properties:
|
|
2970
|
-
* @param - `columnDataLite` - an array of object containing the
|
|
2971
|
-
* data value modifications retrieved from the `EmbedEvent.TableVizRendered`
|
|
2972
|
-
* payload.For example, { columnDataLite: []}`.
|
|
2973
|
-
*/
|
|
2974
|
-
HostEvent["EditLastPrompt"] = "EditLastPrompt";
|
|
2975
|
-
/**
|
|
2976
|
-
* Triggers the table visualization re-render with the updated data.
|
|
2977
|
-
* Includes the following properties:
|
|
2978
|
-
* @param - `columnDataLite` - an array of object containing the
|
|
2979
|
-
* data value modifications retrieved from the `EmbedEvent.TableVizRendered`
|
|
2980
|
-
* payload.For example, { columnDataLite: []}`.
|
|
2981
|
-
*/
|
|
2982
|
-
HostEvent["PreviewSpotterData"] = "PreviewSpotterData";
|
|
2983
|
-
/**
|
|
2984
|
-
* Triggers the table visualization re-render with the updated data.
|
|
2985
|
-
* Includes the following properties:
|
|
2986
|
-
* @param - `columnDataLite` - an array of object containing the
|
|
2987
|
-
* data value modifications retrieved from the `EmbedEvent.TableVizRendered`
|
|
2988
|
-
* payload.For example, { columnDataLite: []}`.
|
|
2989
|
-
*/
|
|
2990
|
-
HostEvent["ResetSpotterConversation"] = "ResetSpotterConversation";
|
|
2991
|
-
/**
|
|
2992
|
-
* Triggers the table visualization re-render with the updated data.
|
|
2993
|
-
* Includes the following properties:
|
|
2994
|
-
* @param - `columnDataLite` - an array of object containing the
|
|
2995
|
-
* data value modifications retrieved from the `EmbedEvent.TableVizRendered`
|
|
2996
|
-
* payload.For example, { columnDataLite: []}`.
|
|
2997
|
-
*/
|
|
2998
|
-
HostEvent["DeleteLastPrompt"] = "DeleteLastPrompt";
|
|
2999
|
-
/**
|
|
3000
|
-
* Triggers the table visualization re-render with the updated data.
|
|
3001
|
-
* Includes the following properties:
|
|
3002
|
-
* @param - `columnDataLite` - an array of object containing the
|
|
3003
|
-
* data value modifications retrieved from the `EmbedEvent.TableVizRendered`
|
|
3004
|
-
* payload.For example, { columnDataLite: []}`.
|
|
3005
|
-
*/
|
|
3006
|
-
HostEvent["AnswerChartSwitcher"] = "answerChartSwitcher";
|
|
3007
2981
|
})(exports.HostEvent || (exports.HostEvent = {}));
|
|
3008
2982
|
/**
|
|
3009
2983
|
* The different visual modes that the data sources panel within
|
|
@@ -15159,6 +15133,13 @@ mutation GetUnsavedAnswerTML($session: BachSessionIdInput!, $exportDependencies:
|
|
|
15159
15133
|
iFrame.style.width = '0';
|
|
15160
15134
|
iFrame.style.height = '0';
|
|
15161
15135
|
iFrame.style.border = '0';
|
|
15136
|
+
// Make it 'fixed' to keep it in a different stacking context.
|
|
15137
|
+
// This should solve the focus behaviours inside the iframe from
|
|
15138
|
+
// interfering with main body.
|
|
15139
|
+
iFrame.style.position = 'fixed';
|
|
15140
|
+
// Push it out of viewport.
|
|
15141
|
+
iFrame.style.top = '100vh';
|
|
15142
|
+
iFrame.style.left = '100vw';
|
|
15162
15143
|
iFrame.classList.add('prefetchIframe');
|
|
15163
15144
|
iFrame.classList.add(`prefetchIframeNum-${index}`);
|
|
15164
15145
|
document.body.appendChild(iFrame);
|
|
@@ -15390,7 +15371,7 @@ mutation GetUnsavedAnswerTML($session: BachSessionIdInput!, $exportDependencies:
|
|
|
15390
15371
|
return e;
|
|
15391
15372
|
}
|
|
15392
15373
|
|
|
15393
|
-
var name="@thoughtspot/visual-embed-sdk";var version$1="1.
|
|
15374
|
+
var name="@thoughtspot/visual-embed-sdk";var version$1="1.38.0-alpha.1";var description="ThoughtSpot Embed SDK";var module="lib/src/index.js";var main="dist/tsembed.js";var types="lib/src/index.d.ts";var files=["dist/**","lib/**","src/**","cjs/**"];var exports$1={".":{"import":"./lib/src/index.js",require:"./cjs/src/index.js",types:"./lib/src/index.d.ts"},"./react":{"import":"./lib/src/react/all-types-export.js",require:"./cjs/src/react/all-types-export.js",types:"./lib/src/react/all-types-export.d.ts"},"./lib/src/react":{"import":"./lib/src/react/all-types-export.js",require:"./cjs/src/react/all-types-export.js",types:"./lib/src/react/all-types-export.d.ts"}};var typesVersions={"*":{react:["./lib/src/react/all-types-export.d.ts"]}};var scripts={lint:"eslint 'src/**'","lint:fix":"eslint 'src/**/*.*' --fix",tsc:"tsc -p . --incremental false; tsc -p . --incremental false --module commonjs --outDir cjs","build-and-publish":"npm run build:gatsby && npm run publish","bundle-dts-file":"dts-bundle --name @thoughtspot/visual-embed-sdk --out visual-embed-sdk.d.ts --main lib/src/index.d.ts","bundle-dts":"dts-bundle --name ../../dist/visual-embed-sdk --main lib/src/index.d.ts --outputAsModuleFolder=true","bundle-dts-react":"dts-bundle --name ../../../dist/visual-embed-sdk-react --main lib/src/react/index.d.ts --outputAsModuleFolder=true","bundle-dts-react-full":"dts-bundle --name ../../../dist/visual-embed-sdk-react-full --main lib/src/react/all-types-export.d.ts --outputAsModuleFolder=true",build:"rollup -c",watch:"rollup -cw",docgen:"typedoc --tsconfig tsconfig.json --theme typedoc-theme --json static/typedoc/typedoc.json --disableOutputCheck","test-sdk":"jest -c jest.config.sdk.js --runInBand",test:"npm run test-sdk",posttest:"cat ./coverage/sdk/lcov.info | coveralls","is-publish-allowed":"node scripts/is-publish-allowed.js",prepublishOnly:"npm run is-publish-allowed && npm run test && npm run tsc && npm run bundle-dts-file && npm run bundle-dts && npm run bundle-dts-react && npm run bundle-dts-react-full && npm run build","check-size":"npm run build && size-limit","publish-dev":"npm publish --tag dev","publish-prod":"npm publish --tag latest",dev:"vite -c vite.local.config.ts"};var peerDependencies={react:"> 16.8.0","react-dom":"> 16.8.0"};var dependencies={classnames:"^2.3.1",eventemitter3:"^4.0.7",lodash:"^4.17.21","mixpanel-browser":"2.47.0","ts-deepmerge":"^6.0.2",tslib:"^2.5.3","use-deep-compare-effect":"^1.8.1",yaml:"^2.5.1"};var devDependencies={"@mdx-js/mdx":"^1.6.22","@mdx-js/react":"^1.6.22","@react-icons/all-files":"^4.1.0","@rollup/plugin-commonjs":"^18.0.0","@rollup/plugin-json":"^4.1.0","@rollup/plugin-node-resolve":"^11.2.1","@rollup/plugin-replace":"^5.0.2","@size-limit/preset-big-lib":"^8.2.6","@testing-library/dom":"^7.31.0","@testing-library/jest-dom":"^5.14.1","@testing-library/react":"^11.2.7","@testing-library/user-event":"^13.1.8","@types/jest":"^22.2.3","@types/lodash":"^4.17.0","@types/mixpanel-browser":"^2.35.6","@types/react-test-renderer":"^17.0.1","@typescript-eslint/eslint-plugin":"^8.28.0","@typescript-eslint/parser":"^8.28.0",asciidoctor:"^2.2.1","babel-jest":"^26.6.3","babel-preset-gatsby":"^1.10.0","command-line-args":"^5.1.1",coveralls:"^3.1.0",crypto:"^1.0.1","current-git-branch":"^1.1.0","dts-bundle":"^0.7.3",eslint:"^9.23.0","eslint-config-airbnb-base":"^15.0.0","eslint-config-prettier":"^10.1.1","eslint-import-resolver-typescript":"^4.2.5","eslint-plugin-comment-length":"2.2.1","eslint-plugin-import":"^2.31.0","eslint-plugin-jsdoc":"^50.6.9","eslint-plugin-prettier":"^5.2.5","eslint-plugin-react":"^7.37.5","eslint-plugin-react-hooks":"^5.2.0","fs-extra":"^10.0.0","gh-pages":"6.3.0",globals:"^16.0.0","highlight.js":"^10.6.0","html-to-text":"^8.0.0","identity-obj-proxy":"^3.0.0","istanbul-merge":"^1.1.1",jest:"^26.6.3","jest-fetch-mock":"^3.0.3",jsdom:"^17.0.0",prettier:"2.1.2",react:"^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:"31 kB"}],scripts:scripts,peerDependencies:peerDependencies,dependencies:dependencies,devDependencies:devDependencies,author:author,email:email,license:license,directories:directories,repository:repository,publishConfig:publishConfig,keywords:keywords,bugs:bugs,homepage:homepage,globals:globals};
|
|
15394
15375
|
|
|
15395
15376
|
/**
|
|
15396
15377
|
* Reloads the ThoughtSpot iframe.
|
|
@@ -15624,11 +15605,13 @@ mutation GetUnsavedAnswerTML($session: BachSessionIdInput!, $exportDependencies:
|
|
|
15624
15605
|
* @param responder
|
|
15625
15606
|
*/
|
|
15626
15607
|
this.updateAuthToken = async (_, responder) => {
|
|
15627
|
-
const {
|
|
15628
|
-
|
|
15629
|
-
|
|
15608
|
+
const { authType } = this.embedConfig;
|
|
15609
|
+
let { autoLogin } = this.embedConfig;
|
|
15610
|
+
// Default autoLogin: true for cookieless if undefined/null, otherwise false
|
|
15611
|
+
autoLogin = autoLogin !== null && autoLogin !== void 0 ? autoLogin : (authType === AuthType.TrustedAuthTokenCookieless);
|
|
15612
|
+
if (autoLogin && authType === AuthType.TrustedAuthTokenCookieless) {
|
|
15630
15613
|
try {
|
|
15631
|
-
authToken = await getAuthenticationToken(this.embedConfig);
|
|
15614
|
+
const authToken = await getAuthenticationToken(this.embedConfig);
|
|
15632
15615
|
responder({
|
|
15633
15616
|
type: exports.EmbedEvent.AuthExpire,
|
|
15634
15617
|
data: { authToken },
|
|
@@ -17108,6 +17091,31 @@ mutation GetUnsavedAnswerTML($session: BachSessionIdInput!, $exportDependencies:
|
|
|
17108
17091
|
HomePageSearchBarMode["AI_ANSWER"] = "aiAnswer";
|
|
17109
17092
|
HomePageSearchBarMode["NONE"] = "none";
|
|
17110
17093
|
})(HomePageSearchBarMode || (HomePageSearchBarMode = {}));
|
|
17094
|
+
/**
|
|
17095
|
+
* Define the version of the primary navbar
|
|
17096
|
+
* @version SDK: 1.39.0 | Thoughtspot: 10.10.0.cl
|
|
17097
|
+
*/
|
|
17098
|
+
var PrimaryNavbarVersion;
|
|
17099
|
+
(function (PrimaryNavbarVersion) {
|
|
17100
|
+
/**
|
|
17101
|
+
* Sliding (v3) introduces a new left-side navigation hub featuring a tab switcher,
|
|
17102
|
+
* along with updates to the top navigation bar.
|
|
17103
|
+
* It serves as the foundational version of the PrimaryNavBar.
|
|
17104
|
+
*/
|
|
17105
|
+
PrimaryNavbarVersion["Sliding"] = "v3";
|
|
17106
|
+
})(PrimaryNavbarVersion || (PrimaryNavbarVersion = {}));
|
|
17107
|
+
/**
|
|
17108
|
+
* Define the version of the home page
|
|
17109
|
+
* @version SDK: 1.39.0 | Thoughtspot: 10.10.0.cl
|
|
17110
|
+
*/
|
|
17111
|
+
var HomePage;
|
|
17112
|
+
(function (HomePage) {
|
|
17113
|
+
/**
|
|
17114
|
+
* Modular (v2) introduces the updated Modular Home Experience.
|
|
17115
|
+
* It serves as the foundational version of the home page.
|
|
17116
|
+
*/
|
|
17117
|
+
HomePage["Modular"] = "v2";
|
|
17118
|
+
})(HomePage || (HomePage = {}));
|
|
17111
17119
|
/**
|
|
17112
17120
|
* Embeds full ThoughtSpot experience in a host application.
|
|
17113
17121
|
* @group Embed components
|
|
@@ -17132,7 +17140,7 @@ mutation GetUnsavedAnswerTML($session: BachSessionIdInput!, $exportDependencies:
|
|
|
17132
17140
|
responder({ type: exports.EmbedEvent.EmbedIframeCenter, data: obj });
|
|
17133
17141
|
};
|
|
17134
17142
|
this.setIframeHeightForNonEmbedLiveboard = (data) => {
|
|
17135
|
-
const { height: frameHeight
|
|
17143
|
+
const { height: frameHeight } = this.viewConfig.frameParams || {};
|
|
17136
17144
|
const liveboardRelatedRoutes = [
|
|
17137
17145
|
'/pinboard/',
|
|
17138
17146
|
'/insights/pinboard/',
|
|
@@ -17162,9 +17170,9 @@ mutation GetUnsavedAnswerTML($session: BachSessionIdInput!, $exportDependencies:
|
|
|
17162
17170
|
* embedded Liveboard or visualization.
|
|
17163
17171
|
*/
|
|
17164
17172
|
getEmbedParams() {
|
|
17165
|
-
const { tag, hideObjects, liveboardV2, showPrimaryNavbar, disableProfileAndHelp, hideHamburger, hideObjectSearch, hideNotification, hideApplicationSwitcher, hideOrgSwitcher, enableSearchAssist, fullHeight, dataPanelV2 = false, hideLiveboardHeader = false, showLiveboardTitle = true, showLiveboardDescription = true, hideHomepageLeftNav = false, modularHomeExperience = false,
|
|
17173
|
+
const { tag, hideObjects, liveboardV2, showPrimaryNavbar, disableProfileAndHelp, hideHamburger, hideObjectSearch, hideNotification, hideApplicationSwitcher, hideOrgSwitcher, enableSearchAssist, fullHeight, dataPanelV2 = false, hideLiveboardHeader = false, showLiveboardTitle = true, showLiveboardDescription = true, hideHomepageLeftNav = false, modularHomeExperience = false, isLiveboardHeaderSticky = true, enableAskSage, collapseSearchBarInitially = false, enable2ColumnLayout, enableCustomColumnGroups = false, isOnBeforeGetVizDataInterceptEnabled = false,
|
|
17166
17174
|
/* eslint-disable-next-line max-len */
|
|
17167
|
-
dataPanelCustomGroupsAccordionInitialState = DataPanelCustomColumnGroupsAccordionState.EXPAND_ALL, collapseSearchBar = true, isLiveboardCompactHeaderEnabled = false, showLiveboardVerifiedBadge = true, showLiveboardReverifyBanner = true, hideIrrelevantChipsInLiveboardTabs = false, homePageSearchBarMode, isUnifiedSearchExperienceEnabled = true, enablePendoHelp = true, } = this.viewConfig;
|
|
17175
|
+
dataPanelCustomGroupsAccordionInitialState = DataPanelCustomColumnGroupsAccordionState.EXPAND_ALL, collapseSearchBar = true, isLiveboardCompactHeaderEnabled = false, showLiveboardVerifiedBadge = true, showLiveboardReverifyBanner = true, hideIrrelevantChipsInLiveboardTabs = false, homePageSearchBarMode, isUnifiedSearchExperienceEnabled = true, enablePendoHelp = true, discoveryExperience, } = this.viewConfig;
|
|
17168
17176
|
let params = {};
|
|
17169
17177
|
params[Param.PrimaryNavHidden] = !showPrimaryNavbar;
|
|
17170
17178
|
params[Param.HideProfleAndHelp] = !!disableProfileAndHelp;
|
|
@@ -17181,9 +17189,6 @@ mutation GetUnsavedAnswerTML($session: BachSessionIdInput!, $exportDependencies:
|
|
|
17181
17189
|
params[Param.HideIrrelevantFiltersInTab] = hideIrrelevantChipsInLiveboardTabs;
|
|
17182
17190
|
params[Param.IsUnifiedSearchExperienceEnabled] = isUnifiedSearchExperienceEnabled;
|
|
17183
17191
|
params = this.getBaseQueryParams(params);
|
|
17184
|
-
if (modularHomeExperienceV3) {
|
|
17185
|
-
params[Param.NavigationVersion] = 'v3';
|
|
17186
|
-
}
|
|
17187
17192
|
if (hideObjectSearch) {
|
|
17188
17193
|
params[Param.HideObjectSearch] = !!hideObjectSearch;
|
|
17189
17194
|
}
|
|
@@ -17240,6 +17245,17 @@ mutation GetUnsavedAnswerTML($session: BachSessionIdInput!, $exportDependencies:
|
|
|
17240
17245
|
/* eslint-disable-next-line max-len */
|
|
17241
17246
|
params[Param.DataPanelCustomGroupsAccordionInitialState] = DataPanelCustomColumnGroupsAccordionState.EXPAND_ALL;
|
|
17242
17247
|
}
|
|
17248
|
+
if (discoveryExperience) {
|
|
17249
|
+
// primaryNavbarVersion v3 will enabled the new left navigation
|
|
17250
|
+
if (discoveryExperience.primaryNavbarVersion === PrimaryNavbarVersion.Sliding) {
|
|
17251
|
+
params[Param.NavigationVersion] = discoveryExperience.primaryNavbarVersion;
|
|
17252
|
+
}
|
|
17253
|
+
// homePage v2 will enable the modular home page
|
|
17254
|
+
// and it will override the modularHomeExperience value
|
|
17255
|
+
if (discoveryExperience.homePage === HomePage.Modular) {
|
|
17256
|
+
params[Param.ModularHomeExperienceEnabled] = true;
|
|
17257
|
+
}
|
|
17258
|
+
}
|
|
17243
17259
|
const queryParams = getQueryParamString(params, true);
|
|
17244
17260
|
return queryParams;
|
|
17245
17261
|
}
|
|
@@ -17419,12 +17435,6 @@ query GetEurekaVizSnapshots(
|
|
|
17419
17435
|
* @summary Liveboard & visualization embed
|
|
17420
17436
|
* @author Ayon Ghosh <ayon.ghosh@thoughtspot.com>
|
|
17421
17437
|
*/
|
|
17422
|
-
const liveboardHeightWhitelistedRoutes = [
|
|
17423
|
-
'/embed/viz/',
|
|
17424
|
-
'/embed/insights/viz/',
|
|
17425
|
-
'/tsl-editor/PINBOARD_ANSWER_BOOK/',
|
|
17426
|
-
'/import-tsl/PINBOARD_ANSWER_BOOK/',
|
|
17427
|
-
];
|
|
17428
17438
|
/**
|
|
17429
17439
|
* Embed a ThoughtSpot Liveboard or visualization. When rendered it already
|
|
17430
17440
|
* waits for the authentication to complete, so you need not wait for
|
|
@@ -17441,7 +17451,6 @@ query GetEurekaVizSnapshots(
|
|
|
17441
17451
|
* @group Embed components
|
|
17442
17452
|
*/
|
|
17443
17453
|
let LiveboardEmbed$1 = class LiveboardEmbed extends V1Embed {
|
|
17444
|
-
// eslint-disable-next-line no-useless-constructor
|
|
17445
17454
|
constructor(domSelector, viewConfig) {
|
|
17446
17455
|
viewConfig.embedComponentType = 'LiveboardEmbed';
|
|
17447
17456
|
super(domSelector, viewConfig);
|
|
@@ -17459,13 +17468,30 @@ query GetEurekaVizSnapshots(
|
|
|
17459
17468
|
responder({ type: exports.EmbedEvent.EmbedIframeCenter, data: obj });
|
|
17460
17469
|
};
|
|
17461
17470
|
this.setIframeHeightForNonEmbedLiveboard = (data) => {
|
|
17462
|
-
const
|
|
17463
|
-
|
|
17471
|
+
const { height: frameHeight } = this.viewConfig.frameParams || {};
|
|
17472
|
+
const liveboardRelatedRoutes = [
|
|
17473
|
+
'/pinboard/',
|
|
17474
|
+
'/insights/pinboard/',
|
|
17475
|
+
'/schedules/',
|
|
17476
|
+
'/embed/viz/',
|
|
17477
|
+
'/embed/insights/viz/',
|
|
17478
|
+
'/liveboard/',
|
|
17479
|
+
'/insights/liveboard/',
|
|
17480
|
+
'/tsl-editor/PINBOARD_ANSWER_BOOK/',
|
|
17481
|
+
'/import-tsl/PINBOARD_ANSWER_BOOK/',
|
|
17482
|
+
];
|
|
17483
|
+
if (liveboardRelatedRoutes.some((path) => data.data.currentPath.startsWith(path))) {
|
|
17484
|
+
// Ignore the height reset of the frame, if the navigation is
|
|
17485
|
+
// only within the liveboard page.
|
|
17464
17486
|
return;
|
|
17465
17487
|
}
|
|
17466
|
-
this.setIFrameHeight(this.defaultHeight);
|
|
17488
|
+
this.setIFrameHeight(frameHeight || this.defaultHeight);
|
|
17467
17489
|
};
|
|
17468
17490
|
if (this.viewConfig.fullHeight === true) {
|
|
17491
|
+
if (this.viewConfig.vizId) {
|
|
17492
|
+
logger$3.warn('Full height is currently only supported for Liveboard embeds.' +
|
|
17493
|
+
'Using full height with vizId might lead to unexpected behavior.');
|
|
17494
|
+
}
|
|
17469
17495
|
this.on(exports.EmbedEvent.RouteChange, this.setIframeHeightForNonEmbedLiveboard);
|
|
17470
17496
|
this.on(exports.EmbedEvent.EmbedHeight, this.updateIFrameHeight);
|
|
17471
17497
|
this.on(exports.EmbedEvent.EmbedIframeCenter, this.embedIframeCenter);
|
|
@@ -17681,6 +17707,465 @@ query GetEurekaVizSnapshots(
|
|
|
17681
17707
|
}
|
|
17682
17708
|
};
|
|
17683
17709
|
|
|
17710
|
+
const createConversation = `
|
|
17711
|
+
mutation CreateConversation($params: Input_convassist_CreateConversationRequest) {
|
|
17712
|
+
ConvAssist__createConversation(request: $params) {
|
|
17713
|
+
convId
|
|
17714
|
+
initialCtx {
|
|
17715
|
+
type
|
|
17716
|
+
tsAnsCtx {
|
|
17717
|
+
sessionId
|
|
17718
|
+
genNo
|
|
17719
|
+
stateKey {
|
|
17720
|
+
transactionId
|
|
17721
|
+
generationNumber
|
|
17722
|
+
}
|
|
17723
|
+
worksheet {
|
|
17724
|
+
worksheetId
|
|
17725
|
+
worksheetName
|
|
17726
|
+
}
|
|
17727
|
+
}
|
|
17728
|
+
}
|
|
17729
|
+
}
|
|
17730
|
+
}
|
|
17731
|
+
`;
|
|
17732
|
+
const sendMessage = `
|
|
17733
|
+
query SendMessage($params: Input_convassist_SendMessageRequest) {
|
|
17734
|
+
ConvAssist__sendMessage(request: $params) {
|
|
17735
|
+
responses {
|
|
17736
|
+
timestamp
|
|
17737
|
+
msgId
|
|
17738
|
+
data {
|
|
17739
|
+
asstRespData {
|
|
17740
|
+
tool
|
|
17741
|
+
asstRespText
|
|
17742
|
+
nlsAnsData {
|
|
17743
|
+
sageQuerySuggestions {
|
|
17744
|
+
sageQueryTokens {
|
|
17745
|
+
additions {
|
|
17746
|
+
phrase {
|
|
17747
|
+
isCompletePhrase
|
|
17748
|
+
numTokens
|
|
17749
|
+
phraseType
|
|
17750
|
+
startIndex
|
|
17751
|
+
__typename
|
|
17752
|
+
}
|
|
17753
|
+
tokens {
|
|
17754
|
+
token
|
|
17755
|
+
dataType
|
|
17756
|
+
typeEnum
|
|
17757
|
+
guid
|
|
17758
|
+
tokenMetadata {
|
|
17759
|
+
name
|
|
17760
|
+
__typename
|
|
17761
|
+
}
|
|
17762
|
+
__typename
|
|
17763
|
+
}
|
|
17764
|
+
__typename
|
|
17765
|
+
}
|
|
17766
|
+
phrases {
|
|
17767
|
+
isCompletePhrase
|
|
17768
|
+
numTokens
|
|
17769
|
+
phraseType
|
|
17770
|
+
startIndex
|
|
17771
|
+
__typename
|
|
17772
|
+
}
|
|
17773
|
+
removals {
|
|
17774
|
+
phrase {
|
|
17775
|
+
isCompletePhrase
|
|
17776
|
+
numTokens
|
|
17777
|
+
phraseType
|
|
17778
|
+
startIndex
|
|
17779
|
+
__typename
|
|
17780
|
+
}
|
|
17781
|
+
tokens {
|
|
17782
|
+
token
|
|
17783
|
+
dataType
|
|
17784
|
+
typeEnum
|
|
17785
|
+
guid
|
|
17786
|
+
tokenMetadata {
|
|
17787
|
+
name
|
|
17788
|
+
__typename
|
|
17789
|
+
}
|
|
17790
|
+
__typename
|
|
17791
|
+
}
|
|
17792
|
+
__typename
|
|
17793
|
+
}
|
|
17794
|
+
tokens {
|
|
17795
|
+
token
|
|
17796
|
+
dataType
|
|
17797
|
+
typeEnum
|
|
17798
|
+
guid
|
|
17799
|
+
tokenMetadata {
|
|
17800
|
+
name
|
|
17801
|
+
__typename
|
|
17802
|
+
}
|
|
17803
|
+
__typename
|
|
17804
|
+
}
|
|
17805
|
+
__typename
|
|
17806
|
+
}
|
|
17807
|
+
llmReasoning {
|
|
17808
|
+
assumptions
|
|
17809
|
+
clarifications
|
|
17810
|
+
interpretation
|
|
17811
|
+
__typename
|
|
17812
|
+
}
|
|
17813
|
+
tokens
|
|
17814
|
+
tmlTokens
|
|
17815
|
+
worksheetId
|
|
17816
|
+
tokens
|
|
17817
|
+
description
|
|
17818
|
+
title
|
|
17819
|
+
tmlTokens
|
|
17820
|
+
cached
|
|
17821
|
+
sqlQuery
|
|
17822
|
+
sessionId
|
|
17823
|
+
genNo
|
|
17824
|
+
formulaInfo {
|
|
17825
|
+
name
|
|
17826
|
+
expression
|
|
17827
|
+
__typename
|
|
17828
|
+
}
|
|
17829
|
+
tmlPhrases
|
|
17830
|
+
ambiguousPhrases {
|
|
17831
|
+
alternativePhrases {
|
|
17832
|
+
phraseType
|
|
17833
|
+
token {
|
|
17834
|
+
token
|
|
17835
|
+
dataType
|
|
17836
|
+
typeEnum
|
|
17837
|
+
guid
|
|
17838
|
+
tokenMetadata {
|
|
17839
|
+
name
|
|
17840
|
+
__typename
|
|
17841
|
+
}
|
|
17842
|
+
__typename
|
|
17843
|
+
}
|
|
17844
|
+
__typename
|
|
17845
|
+
}
|
|
17846
|
+
ambiguityType
|
|
17847
|
+
token {
|
|
17848
|
+
token
|
|
17849
|
+
dataType
|
|
17850
|
+
typeEnum
|
|
17851
|
+
guid
|
|
17852
|
+
tokenMetadata {
|
|
17853
|
+
name
|
|
17854
|
+
__typename
|
|
17855
|
+
}
|
|
17856
|
+
__typename
|
|
17857
|
+
}
|
|
17858
|
+
__typename
|
|
17859
|
+
}
|
|
17860
|
+
ambiguousTokens {
|
|
17861
|
+
alternativeTokens {
|
|
17862
|
+
token
|
|
17863
|
+
dataType
|
|
17864
|
+
typeEnum
|
|
17865
|
+
guid
|
|
17866
|
+
tokenMetadata {
|
|
17867
|
+
name
|
|
17868
|
+
deprecatedTableGuid
|
|
17869
|
+
deprecatedTableName
|
|
17870
|
+
isFormula
|
|
17871
|
+
rootTables {
|
|
17872
|
+
created
|
|
17873
|
+
description
|
|
17874
|
+
guid
|
|
17875
|
+
indexVersion
|
|
17876
|
+
modified
|
|
17877
|
+
name
|
|
17878
|
+
__typename
|
|
17879
|
+
}
|
|
17880
|
+
schemaTableUserDefinedName
|
|
17881
|
+
table {
|
|
17882
|
+
created
|
|
17883
|
+
description
|
|
17884
|
+
guid
|
|
17885
|
+
indexVersion
|
|
17886
|
+
modified
|
|
17887
|
+
name
|
|
17888
|
+
__typename
|
|
17889
|
+
}
|
|
17890
|
+
__typename
|
|
17891
|
+
}
|
|
17892
|
+
__typename
|
|
17893
|
+
}
|
|
17894
|
+
ambiguityType
|
|
17895
|
+
token {
|
|
17896
|
+
token
|
|
17897
|
+
dataType
|
|
17898
|
+
typeEnum
|
|
17899
|
+
guid
|
|
17900
|
+
tokenMetadata {
|
|
17901
|
+
name
|
|
17902
|
+
__typename
|
|
17903
|
+
}
|
|
17904
|
+
__typename
|
|
17905
|
+
}
|
|
17906
|
+
__typename
|
|
17907
|
+
}
|
|
17908
|
+
stateKey {
|
|
17909
|
+
transactionId
|
|
17910
|
+
generationNumber
|
|
17911
|
+
transactionId
|
|
17912
|
+
__typename
|
|
17913
|
+
}
|
|
17914
|
+
subQueries {
|
|
17915
|
+
tokens
|
|
17916
|
+
cohortConfig {
|
|
17917
|
+
anchorColumnId
|
|
17918
|
+
cohortAnswerGuid
|
|
17919
|
+
cohortGroupingType
|
|
17920
|
+
cohortGuid
|
|
17921
|
+
cohortType
|
|
17922
|
+
combineNonGroupValues
|
|
17923
|
+
description
|
|
17924
|
+
groupExcludedQueryValues
|
|
17925
|
+
hideExcludedQueryValues
|
|
17926
|
+
isEditable
|
|
17927
|
+
name
|
|
17928
|
+
nullOutputValue
|
|
17929
|
+
returnColumnId
|
|
17930
|
+
__typename
|
|
17931
|
+
}
|
|
17932
|
+
formulas {
|
|
17933
|
+
name
|
|
17934
|
+
expression
|
|
17935
|
+
__typename
|
|
17936
|
+
}
|
|
17937
|
+
__typename
|
|
17938
|
+
}
|
|
17939
|
+
visualizationSuggestion {
|
|
17940
|
+
chartType
|
|
17941
|
+
displayMode
|
|
17942
|
+
axisConfigs {
|
|
17943
|
+
category
|
|
17944
|
+
color
|
|
17945
|
+
hidden
|
|
17946
|
+
size
|
|
17947
|
+
sort
|
|
17948
|
+
x
|
|
17949
|
+
y
|
|
17950
|
+
__typename
|
|
17951
|
+
}
|
|
17952
|
+
usersVizIntentApplied
|
|
17953
|
+
customChartConfigs {
|
|
17954
|
+
dimensions {
|
|
17955
|
+
columns
|
|
17956
|
+
key
|
|
17957
|
+
__typename
|
|
17958
|
+
}
|
|
17959
|
+
key
|
|
17960
|
+
__typename
|
|
17961
|
+
}
|
|
17962
|
+
customChartGuid
|
|
17963
|
+
__typename
|
|
17964
|
+
}
|
|
17965
|
+
tableData {
|
|
17966
|
+
columnDataLite {
|
|
17967
|
+
columnId
|
|
17968
|
+
columnDataType
|
|
17969
|
+
dataValue
|
|
17970
|
+
columnName
|
|
17971
|
+
__typename
|
|
17972
|
+
}
|
|
17973
|
+
__typename
|
|
17974
|
+
}
|
|
17975
|
+
warningType
|
|
17976
|
+
cached
|
|
17977
|
+
__typename
|
|
17978
|
+
}
|
|
17979
|
+
debugInfo {
|
|
17980
|
+
fewShotExamples {
|
|
17981
|
+
chartType
|
|
17982
|
+
id
|
|
17983
|
+
mappingId
|
|
17984
|
+
nlQuery
|
|
17985
|
+
nlQueryConcepts
|
|
17986
|
+
sageQuery
|
|
17987
|
+
scope
|
|
17988
|
+
sql
|
|
17989
|
+
tml
|
|
17990
|
+
__typename
|
|
17991
|
+
}
|
|
17992
|
+
__typename
|
|
17993
|
+
}
|
|
17994
|
+
__typename
|
|
17995
|
+
}
|
|
17996
|
+
__typename
|
|
17997
|
+
}
|
|
17998
|
+
errorData {
|
|
17999
|
+
tool
|
|
18000
|
+
errCode
|
|
18001
|
+
errTxt
|
|
18002
|
+
toolErrCode
|
|
18003
|
+
__typename
|
|
18004
|
+
}
|
|
18005
|
+
__typename
|
|
18006
|
+
}
|
|
18007
|
+
type
|
|
18008
|
+
__typename
|
|
18009
|
+
}
|
|
18010
|
+
prevCtx {
|
|
18011
|
+
genNo
|
|
18012
|
+
sessionId
|
|
18013
|
+
__typename
|
|
18014
|
+
}
|
|
18015
|
+
__typename
|
|
18016
|
+
}
|
|
18017
|
+
}
|
|
18018
|
+
`;
|
|
18019
|
+
|
|
18020
|
+
class Conversation {
|
|
18021
|
+
constructor(thoughtSpotHost, worksheetId) {
|
|
18022
|
+
this.thoughtSpotHost = thoughtSpotHost;
|
|
18023
|
+
this.worksheetId = worksheetId;
|
|
18024
|
+
this.inProgress = null;
|
|
18025
|
+
this.inProgress = this.init();
|
|
18026
|
+
}
|
|
18027
|
+
async init() {
|
|
18028
|
+
const { convId } = await this.createConversation();
|
|
18029
|
+
this.conversationId = convId;
|
|
18030
|
+
}
|
|
18031
|
+
createConversation() {
|
|
18032
|
+
return this.executeQuery(createConversation, {
|
|
18033
|
+
params: {
|
|
18034
|
+
initialCtx: {
|
|
18035
|
+
tsWorksheetCtx: {
|
|
18036
|
+
worksheet: {
|
|
18037
|
+
worksheetId: this.worksheetId,
|
|
18038
|
+
},
|
|
18039
|
+
},
|
|
18040
|
+
type: 'TS_WORKSHEET',
|
|
18041
|
+
},
|
|
18042
|
+
userInfo: {
|
|
18043
|
+
tenantUrl: `${this.thoughtSpotHost}/prism`,
|
|
18044
|
+
},
|
|
18045
|
+
},
|
|
18046
|
+
});
|
|
18047
|
+
}
|
|
18048
|
+
async sendMessage(userMessage) {
|
|
18049
|
+
await this.inProgress;
|
|
18050
|
+
try {
|
|
18051
|
+
const { responses } = await this.executeQuery(sendMessage, {
|
|
18052
|
+
params: {
|
|
18053
|
+
convId: this.conversationId,
|
|
18054
|
+
headers: [],
|
|
18055
|
+
msg: {
|
|
18056
|
+
data: {
|
|
18057
|
+
userCmdData: {
|
|
18058
|
+
cmdText: userMessage,
|
|
18059
|
+
nlsData: {
|
|
18060
|
+
worksheetId: this.worksheetId,
|
|
18061
|
+
questionType: 'ANSWER_SPEC_GENERATION',
|
|
18062
|
+
},
|
|
18063
|
+
},
|
|
18064
|
+
},
|
|
18065
|
+
msgId: crypto.randomUUID(),
|
|
18066
|
+
type: 'USER_COMMAND',
|
|
18067
|
+
},
|
|
18068
|
+
},
|
|
18069
|
+
});
|
|
18070
|
+
const data = responses[0].data;
|
|
18071
|
+
return {
|
|
18072
|
+
data: data.asstRespData.nlsAnsData.sageQuerySuggestions[0],
|
|
18073
|
+
error: null,
|
|
18074
|
+
};
|
|
18075
|
+
}
|
|
18076
|
+
catch (error) {
|
|
18077
|
+
return { error };
|
|
18078
|
+
}
|
|
18079
|
+
}
|
|
18080
|
+
async executeQuery(query, variables) {
|
|
18081
|
+
return graphqlQuery({
|
|
18082
|
+
query,
|
|
18083
|
+
variables,
|
|
18084
|
+
thoughtSpotHost: this.thoughtSpotHost,
|
|
18085
|
+
isCompositeQuery: false,
|
|
18086
|
+
});
|
|
18087
|
+
}
|
|
18088
|
+
}
|
|
18089
|
+
|
|
18090
|
+
class ConversationMessage extends TsEmbed {
|
|
18091
|
+
constructor(container, viewConfig) {
|
|
18092
|
+
viewConfig.embedComponentType = 'bodyless-conversation';
|
|
18093
|
+
super(container, viewConfig);
|
|
18094
|
+
this.viewConfig = viewConfig;
|
|
18095
|
+
}
|
|
18096
|
+
getIframeSrc() {
|
|
18097
|
+
var _a;
|
|
18098
|
+
const { sessionId, genNo, acSessionId, acGenNo, } = this.viewConfig;
|
|
18099
|
+
const path = 'conv-assist-answer';
|
|
18100
|
+
const queryParams = this.getBaseQueryParams();
|
|
18101
|
+
queryParams[Param.HideActions] = [...((_a = queryParams[Param.HideActions]) !== null && _a !== void 0 ? _a : [])];
|
|
18102
|
+
queryParams[Param.isSpotterAgentEmbed] = true;
|
|
18103
|
+
let query = '';
|
|
18104
|
+
const queryParamsString = getQueryParamString(queryParams, true);
|
|
18105
|
+
if (queryParamsString) {
|
|
18106
|
+
query = `?${queryParamsString}`;
|
|
18107
|
+
}
|
|
18108
|
+
const tsPostHashParams = this.getThoughtSpotPostUrlParams({
|
|
18109
|
+
sessionId,
|
|
18110
|
+
genNo,
|
|
18111
|
+
acSessionId,
|
|
18112
|
+
acGenNo,
|
|
18113
|
+
});
|
|
18114
|
+
return `${this.getEmbedBasePath(query)}/embed/${path}${tsPostHashParams}`;
|
|
18115
|
+
}
|
|
18116
|
+
async render() {
|
|
18117
|
+
await super.render();
|
|
18118
|
+
const src = this.getIframeSrc();
|
|
18119
|
+
await this.renderIFrame(src);
|
|
18120
|
+
return this;
|
|
18121
|
+
}
|
|
18122
|
+
}
|
|
18123
|
+
/**
|
|
18124
|
+
* Create a conversation embed, which can be integrated inside
|
|
18125
|
+
* chatbots or other conversational interfaces.
|
|
18126
|
+
* @example
|
|
18127
|
+
* ```js
|
|
18128
|
+
* import { SpotterAgentEmbed } from '@thoughtspot/visual-embed-sdk';
|
|
18129
|
+
*
|
|
18130
|
+
* const conversation = new SpotterAgentEmbed({
|
|
18131
|
+
* worksheetId: 'worksheetId',
|
|
18132
|
+
* });
|
|
18133
|
+
*
|
|
18134
|
+
* const { container, error } = await conversation.sendMessage('show me sales by region');
|
|
18135
|
+
*
|
|
18136
|
+
* // append the container to the DOM
|
|
18137
|
+
* document.body.appendChild(container); // or to any other element
|
|
18138
|
+
* ```
|
|
18139
|
+
* @group Embed components
|
|
18140
|
+
* @version SDK: 1.37.0 | ThoughtSpot: 10.9.0.cl
|
|
18141
|
+
*/
|
|
18142
|
+
let SpotterAgentEmbed$1 = class SpotterAgentEmbed {
|
|
18143
|
+
constructor(viewConfig) {
|
|
18144
|
+
this.viewConfig = viewConfig;
|
|
18145
|
+
const embedConfig = getEmbedConfig();
|
|
18146
|
+
this.conversationService = new Conversation(embedConfig.thoughtSpotHost, viewConfig.worksheetId);
|
|
18147
|
+
}
|
|
18148
|
+
async sendMessage(userMessage) {
|
|
18149
|
+
const { data, error } = await this.conversationService.sendMessage(userMessage);
|
|
18150
|
+
if (error) {
|
|
18151
|
+
return { error };
|
|
18152
|
+
}
|
|
18153
|
+
const container = document.createElement('div');
|
|
18154
|
+
if (this.viewConfig.containerClassName) {
|
|
18155
|
+
container.className = this.viewConfig.containerClassName;
|
|
18156
|
+
}
|
|
18157
|
+
const embed = new ConversationMessage(container, {
|
|
18158
|
+
...this.viewConfig,
|
|
18159
|
+
sessionId: data.sessionId,
|
|
18160
|
+
genNo: data.genNo,
|
|
18161
|
+
acSessionId: data.stateKey.transactionId,
|
|
18162
|
+
acGenNo: data.stateKey.generationNumber,
|
|
18163
|
+
});
|
|
18164
|
+
await embed.render();
|
|
18165
|
+
return { container, viz: embed };
|
|
18166
|
+
}
|
|
18167
|
+
};
|
|
18168
|
+
|
|
17684
18169
|
/**
|
|
17685
18170
|
*
|
|
17686
18171
|
* @param props
|
|
@@ -17737,7 +18222,7 @@ query GetEurekaVizSnapshots(
|
|
|
17737
18222
|
* });
|
|
17738
18223
|
* conversation.render();
|
|
17739
18224
|
* ```
|
|
17740
|
-
* @version SDK: 1.
|
|
18225
|
+
* @version SDK: 1.37.0 | ThoughtSpot: 10.9.0.cl
|
|
17741
18226
|
*/
|
|
17742
18227
|
let SpotterEmbed$1 = class SpotterEmbed extends TsEmbed {
|
|
17743
18228
|
constructor(container, viewConfig) {
|
|
@@ -17788,7 +18273,8 @@ query GetEurekaVizSnapshots(
|
|
|
17788
18273
|
};
|
|
17789
18274
|
/**
|
|
17790
18275
|
* Embed ThoughtSpot AI Conversation.
|
|
17791
|
-
* @deprecated
|
|
18276
|
+
* @deprecated from SDK: 1.38.0 | ThoughtSpot: 10.10.0.cl
|
|
18277
|
+
* Use {@link SpotterEmbed} instead
|
|
17792
18278
|
* @group Embed components
|
|
17793
18279
|
* @example
|
|
17794
18280
|
* ```js
|
|
@@ -18037,7 +18523,8 @@ query GetEurekaVizSnapshots(
|
|
|
18037
18523
|
const SpotterEmbed = componentFactory(SpotterEmbed$1);
|
|
18038
18524
|
/**
|
|
18039
18525
|
* React component for LLM based conversation BI.
|
|
18040
|
-
* @deprecated
|
|
18526
|
+
* @deprecated from SDK: 1.38.0 | ThoughtSpot: 10.10.0.cl
|
|
18527
|
+
* Use {@link SpotterEmbed} instead
|
|
18041
18528
|
* @example
|
|
18042
18529
|
* ```tsx
|
|
18043
18530
|
* function Sage() {
|
|
@@ -18052,6 +18539,56 @@ query GetEurekaVizSnapshots(
|
|
|
18052
18539
|
* ```
|
|
18053
18540
|
*/
|
|
18054
18541
|
const ConversationEmbed = componentFactory(ConversationEmbed$1);
|
|
18542
|
+
/**
|
|
18543
|
+
* React component for SpotterAgent embed, which can be integrated inside
|
|
18544
|
+
* chatbots or other conversational interfaces.
|
|
18545
|
+
* @example
|
|
18546
|
+
* ```tsx
|
|
18547
|
+
* function SpotterAgent() {
|
|
18548
|
+
* const ref = useRef();
|
|
18549
|
+
*
|
|
18550
|
+
* const handleSendMessage = async () => {
|
|
18551
|
+
* const { container, error } = await ref.current.sendMessage('show me sales by region');
|
|
18552
|
+
* if (container) {
|
|
18553
|
+
* document.body.appendChild(container);
|
|
18554
|
+
* }
|
|
18555
|
+
* };
|
|
18556
|
+
*
|
|
18557
|
+
* return (
|
|
18558
|
+
* <div>
|
|
18559
|
+
* <SpotterAgentEmbed ref={ref} worksheetId="worksheetId" />
|
|
18560
|
+
* <button onClick={handleSendMessage}>Send Message</button>
|
|
18561
|
+
* </div>
|
|
18562
|
+
* );
|
|
18563
|
+
* }
|
|
18564
|
+
* ```
|
|
18565
|
+
*/
|
|
18566
|
+
const SpotterAgentEmbed = React.forwardRef((props, ref) => {
|
|
18567
|
+
const { className, ...restProps } = props;
|
|
18568
|
+
const serviceRef = React.useRef(null);
|
|
18569
|
+
useDeepCompareEffect(() => {
|
|
18570
|
+
if (serviceRef.current) {
|
|
18571
|
+
serviceRef.current = null;
|
|
18572
|
+
}
|
|
18573
|
+
const configProps = {
|
|
18574
|
+
...restProps,
|
|
18575
|
+
...(className ? { containerClassName: className } : {})
|
|
18576
|
+
};
|
|
18577
|
+
serviceRef.current = new SpotterAgentEmbed$1(configProps);
|
|
18578
|
+
if (ref) {
|
|
18579
|
+
if (typeof ref === 'function') {
|
|
18580
|
+
ref(serviceRef.current);
|
|
18581
|
+
}
|
|
18582
|
+
else {
|
|
18583
|
+
ref.current = serviceRef.current;
|
|
18584
|
+
}
|
|
18585
|
+
}
|
|
18586
|
+
return () => {
|
|
18587
|
+
serviceRef.current = null;
|
|
18588
|
+
};
|
|
18589
|
+
}, [props]);
|
|
18590
|
+
return null;
|
|
18591
|
+
});
|
|
18055
18592
|
/**
|
|
18056
18593
|
* React component for PreRendered Conversation embed.
|
|
18057
18594
|
*
|
|
@@ -18587,7 +19124,8 @@ query GetEurekaVizSnapshots(
|
|
|
18587
19124
|
return {
|
|
18588
19125
|
onAnchor: (source) => {
|
|
18589
19126
|
aliasObjects.push(source);
|
|
18590
|
-
|
|
19127
|
+
if (!prevAnchors)
|
|
19128
|
+
prevAnchors = anchorNames(doc);
|
|
18591
19129
|
const anchor = findNewAnchor(prefix, prevAnchors);
|
|
18592
19130
|
prevAnchors.add(anchor);
|
|
18593
19131
|
return anchor;
|
|
@@ -18751,36 +19289,23 @@ query GetEurekaVizSnapshots(
|
|
|
18751
19289
|
* Resolve the value of this alias within `doc`, finding the last
|
|
18752
19290
|
* instance of the `source` anchor before this node.
|
|
18753
19291
|
*/
|
|
18754
|
-
resolve(doc
|
|
18755
|
-
let nodes;
|
|
18756
|
-
if (ctx?.aliasResolveCache) {
|
|
18757
|
-
nodes = ctx.aliasResolveCache;
|
|
18758
|
-
}
|
|
18759
|
-
else {
|
|
18760
|
-
nodes = [];
|
|
18761
|
-
visit$1(doc, {
|
|
18762
|
-
Node: (_key, node) => {
|
|
18763
|
-
if (isAlias(node) || hasAnchor(node))
|
|
18764
|
-
nodes.push(node);
|
|
18765
|
-
}
|
|
18766
|
-
});
|
|
18767
|
-
if (ctx)
|
|
18768
|
-
ctx.aliasResolveCache = nodes;
|
|
18769
|
-
}
|
|
19292
|
+
resolve(doc) {
|
|
18770
19293
|
let found = undefined;
|
|
18771
|
-
|
|
18772
|
-
|
|
18773
|
-
|
|
18774
|
-
|
|
18775
|
-
|
|
18776
|
-
|
|
19294
|
+
visit$1(doc, {
|
|
19295
|
+
Node: (_key, node) => {
|
|
19296
|
+
if (node === this)
|
|
19297
|
+
return visit$1.BREAK;
|
|
19298
|
+
if (node.anchor === this.source)
|
|
19299
|
+
found = node;
|
|
19300
|
+
}
|
|
19301
|
+
});
|
|
18777
19302
|
return found;
|
|
18778
19303
|
}
|
|
18779
19304
|
toJSON(_arg, ctx) {
|
|
18780
19305
|
if (!ctx)
|
|
18781
19306
|
return { source: this.source };
|
|
18782
19307
|
const { anchors, doc, maxAliasCount } = ctx;
|
|
18783
|
-
const source = this.resolve(doc
|
|
19308
|
+
const source = this.resolve(doc);
|
|
18784
19309
|
if (!source) {
|
|
18785
19310
|
const msg = `Unresolved alias (the anchor must be set before the alias): ${this.source}`;
|
|
18786
19311
|
throw new ReferenceError(msg);
|
|
@@ -18899,7 +19424,8 @@ query GetEurekaVizSnapshots(
|
|
|
18899
19424
|
if (aliasDuplicateObjects && value && typeof value === 'object') {
|
|
18900
19425
|
ref = sourceObjects.get(value);
|
|
18901
19426
|
if (ref) {
|
|
18902
|
-
|
|
19427
|
+
if (!ref.anchor)
|
|
19428
|
+
ref.anchor = onAnchor(value);
|
|
18903
19429
|
return new Alias(ref.anchor);
|
|
18904
19430
|
}
|
|
18905
19431
|
else {
|
|
@@ -19470,32 +19996,23 @@ query GetEurekaVizSnapshots(
|
|
|
19470
19996
|
start = start.replace(/\n+/g, `$&${indent}`);
|
|
19471
19997
|
}
|
|
19472
19998
|
const indentSize = indent ? '2' : '1'; // root is at -1
|
|
19473
|
-
|
|
19474
|
-
let header = (startWithSpace ? indentSize : '') + chomp;
|
|
19999
|
+
let header = (literal ? '|' : '>') + (startWithSpace ? indentSize : '') + chomp;
|
|
19475
20000
|
if (comment) {
|
|
19476
20001
|
header += ' ' + commentString(comment.replace(/ ?[\r\n]+/g, ' '));
|
|
19477
20002
|
if (onComment)
|
|
19478
20003
|
onComment();
|
|
19479
20004
|
}
|
|
19480
|
-
if (
|
|
19481
|
-
|
|
19482
|
-
|
|
19483
|
-
|
|
19484
|
-
|
|
19485
|
-
|
|
19486
|
-
|
|
19487
|
-
|
|
19488
|
-
|
|
19489
|
-
|
|
19490
|
-
|
|
19491
|
-
};
|
|
19492
|
-
}
|
|
19493
|
-
const body = foldFlowLines(`${start}${foldedValue}${end}`, indent, FOLD_BLOCK, foldOptions);
|
|
19494
|
-
if (!literalFallback)
|
|
19495
|
-
return `>${header}\n${indent}${body}`;
|
|
19496
|
-
}
|
|
19497
|
-
value = value.replace(/\n+/g, `$&${indent}`);
|
|
19498
|
-
return `|${header}\n${indent}${start}${value}${end}`;
|
|
20005
|
+
if (literal) {
|
|
20006
|
+
value = value.replace(/\n+/g, `$&${indent}`);
|
|
20007
|
+
return `${header}\n${indent}${start}${value}${end}`;
|
|
20008
|
+
}
|
|
20009
|
+
value = value
|
|
20010
|
+
.replace(/\n+/g, '\n$&')
|
|
20011
|
+
.replace(/(?:^|\n)([\t ].*)(?:([\n\t ]*)\n(?![\n\t ]))?/g, '$1$2') // more-indented lines aren't folded
|
|
20012
|
+
// ^ more-ind. ^ empty ^ capture next empty lines only at end of indent
|
|
20013
|
+
.replace(/\n+/g, `$&${indent}`);
|
|
20014
|
+
const body = foldFlowLines(`${start}${value}${end}`, indent, FOLD_BLOCK, getFoldOptions(ctx, true));
|
|
20015
|
+
return `${header}\n${indent}${body}`;
|
|
19499
20016
|
}
|
|
19500
20017
|
function plainString(item, ctx, onComment, onChompKeep) {
|
|
19501
20018
|
const { type, value } = item;
|
|
@@ -19504,9 +20021,10 @@ query GetEurekaVizSnapshots(
|
|
|
19504
20021
|
(inFlow && /[[\]{},]/.test(value))) {
|
|
19505
20022
|
return quotedString(value, ctx);
|
|
19506
20023
|
}
|
|
19507
|
-
if (
|
|
20024
|
+
if (!value ||
|
|
20025
|
+
/^[\n\t ,[\]{}#&*!|>'"%@`]|^[?-]$|^[?-][ \t]|[\n:][ \t]|[ \t]\n|[\n\t ]#|[\n\t :]$/.test(value)) {
|
|
19508
20026
|
// not allowed:
|
|
19509
|
-
// - '-' or '?'
|
|
20027
|
+
// - empty string, '-' or '?'
|
|
19510
20028
|
// - start with an indicator character (except [?:-]) or /[?-] /
|
|
19511
20029
|
// - '\n ', ': ' or ' \n' anywhere
|
|
19512
20030
|
// - '#' not preceded by a non-space char
|
|
@@ -19635,12 +20153,7 @@ query GetEurekaVizSnapshots(
|
|
|
19635
20153
|
let obj;
|
|
19636
20154
|
if (isScalar$1(item)) {
|
|
19637
20155
|
obj = item.value;
|
|
19638
|
-
|
|
19639
|
-
if (match.length > 1) {
|
|
19640
|
-
const testMatch = match.filter(t => t.test);
|
|
19641
|
-
if (testMatch.length > 0)
|
|
19642
|
-
match = testMatch;
|
|
19643
|
-
}
|
|
20156
|
+
const match = tags.filter(t => t.identify?.(obj));
|
|
19644
20157
|
tagObj =
|
|
19645
20158
|
match.find(t => t.format === item.format) ?? match.find(t => !t.format);
|
|
19646
20159
|
}
|
|
@@ -19649,7 +20162,7 @@ query GetEurekaVizSnapshots(
|
|
|
19649
20162
|
tagObj = tags.find(t => t.nodeClass && obj instanceof t.nodeClass);
|
|
19650
20163
|
}
|
|
19651
20164
|
if (!tagObj) {
|
|
19652
|
-
const name = obj?.constructor?.name ??
|
|
20165
|
+
const name = obj?.constructor?.name ?? typeof obj;
|
|
19653
20166
|
throw new Error(`Tag not resolved for ${name} value`);
|
|
19654
20167
|
}
|
|
19655
20168
|
return tagObj;
|
|
@@ -19664,7 +20177,7 @@ query GetEurekaVizSnapshots(
|
|
|
19664
20177
|
anchors.add(anchor);
|
|
19665
20178
|
props.push(`&${anchor}`);
|
|
19666
20179
|
}
|
|
19667
|
-
const tag = node.tag
|
|
20180
|
+
const tag = node.tag ? node.tag : tagObj.default ? null : tagObj.tag;
|
|
19668
20181
|
if (tag)
|
|
19669
20182
|
props.push(doc.directives.tagString(tag));
|
|
19670
20183
|
return props.join(' ');
|
|
@@ -19690,7 +20203,8 @@ query GetEurekaVizSnapshots(
|
|
|
19690
20203
|
const node = isNode(item)
|
|
19691
20204
|
? item
|
|
19692
20205
|
: ctx.doc.createNode(item, { onTagObj: o => (tagObj = o) });
|
|
19693
|
-
|
|
20206
|
+
if (!tagObj)
|
|
20207
|
+
tagObj = getTagObject(ctx.doc.schema.tags, node);
|
|
19694
20208
|
const props = stringifyProps(node, tagObj, ctx);
|
|
19695
20209
|
if (props.length > 0)
|
|
19696
20210
|
ctx.indentAtStart = (ctx.indentAtStart ?? 0) + props.length + 1;
|
|
@@ -19852,10 +20366,54 @@ query GetEurekaVizSnapshots(
|
|
|
19852
20366
|
|
|
19853
20367
|
function warn(logLevel, warning) {
|
|
19854
20368
|
if (logLevel === 'debug' || logLevel === 'warn') {
|
|
19855
|
-
|
|
20369
|
+
if (typeof process !== 'undefined' && process.emitWarning)
|
|
20370
|
+
process.emitWarning(warning);
|
|
20371
|
+
else
|
|
20372
|
+
console.warn(warning);
|
|
19856
20373
|
}
|
|
19857
20374
|
}
|
|
19858
20375
|
|
|
20376
|
+
const MERGE_KEY = '<<';
|
|
20377
|
+
function addPairToJSMap(ctx, map, { key, value }) {
|
|
20378
|
+
if (ctx?.doc.schema.merge && isMergeKey(key)) {
|
|
20379
|
+
value = isAlias(value) ? value.resolve(ctx.doc) : value;
|
|
20380
|
+
if (isSeq(value))
|
|
20381
|
+
for (const it of value.items)
|
|
20382
|
+
mergeToJSMap(ctx, map, it);
|
|
20383
|
+
else if (Array.isArray(value))
|
|
20384
|
+
for (const it of value)
|
|
20385
|
+
mergeToJSMap(ctx, map, it);
|
|
20386
|
+
else
|
|
20387
|
+
mergeToJSMap(ctx, map, value);
|
|
20388
|
+
}
|
|
20389
|
+
else {
|
|
20390
|
+
const jsKey = toJS(key, '', ctx);
|
|
20391
|
+
if (map instanceof Map) {
|
|
20392
|
+
map.set(jsKey, toJS(value, jsKey, ctx));
|
|
20393
|
+
}
|
|
20394
|
+
else if (map instanceof Set) {
|
|
20395
|
+
map.add(jsKey);
|
|
20396
|
+
}
|
|
20397
|
+
else {
|
|
20398
|
+
const stringKey = stringifyKey(key, jsKey, ctx);
|
|
20399
|
+
const jsValue = toJS(value, stringKey, ctx);
|
|
20400
|
+
if (stringKey in map)
|
|
20401
|
+
Object.defineProperty(map, stringKey, {
|
|
20402
|
+
value: jsValue,
|
|
20403
|
+
writable: true,
|
|
20404
|
+
enumerable: true,
|
|
20405
|
+
configurable: true
|
|
20406
|
+
});
|
|
20407
|
+
else
|
|
20408
|
+
map[stringKey] = jsValue;
|
|
20409
|
+
}
|
|
20410
|
+
}
|
|
20411
|
+
return map;
|
|
20412
|
+
}
|
|
20413
|
+
const isMergeKey = (key) => key === MERGE_KEY ||
|
|
20414
|
+
(isScalar$1(key) &&
|
|
20415
|
+
key.value === MERGE_KEY &&
|
|
20416
|
+
(!key.type || key.type === Scalar.PLAIN));
|
|
19859
20417
|
// If the value associated with a merge key is a single mapping node, each of
|
|
19860
20418
|
// its key/value pairs is inserted into the current mapping, unless the key
|
|
19861
20419
|
// already exists in it. If the value associated with the merge key is a
|
|
@@ -19863,35 +20421,7 @@ query GetEurekaVizSnapshots(
|
|
|
19863
20421
|
// of these nodes is merged in turn according to its order in the sequence.
|
|
19864
20422
|
// Keys in mapping nodes earlier in the sequence override keys specified in
|
|
19865
20423
|
// later mapping nodes. -- http://yaml.org/type/merge.html
|
|
19866
|
-
|
|
19867
|
-
const merge = {
|
|
19868
|
-
identify: value => value === MERGE_KEY ||
|
|
19869
|
-
(typeof value === 'symbol' && value.description === MERGE_KEY),
|
|
19870
|
-
default: 'key',
|
|
19871
|
-
tag: 'tag:yaml.org,2002:merge',
|
|
19872
|
-
test: /^<<$/,
|
|
19873
|
-
resolve: () => Object.assign(new Scalar(Symbol(MERGE_KEY)), {
|
|
19874
|
-
addToJSMap: addMergeToJSMap
|
|
19875
|
-
}),
|
|
19876
|
-
stringify: () => MERGE_KEY
|
|
19877
|
-
};
|
|
19878
|
-
const isMergeKey = (ctx, key) => (merge.identify(key) ||
|
|
19879
|
-
(isScalar$1(key) &&
|
|
19880
|
-
(!key.type || key.type === Scalar.PLAIN) &&
|
|
19881
|
-
merge.identify(key.value))) &&
|
|
19882
|
-
ctx?.doc.schema.tags.some(tag => tag.tag === merge.tag && tag.default);
|
|
19883
|
-
function addMergeToJSMap(ctx, map, value) {
|
|
19884
|
-
value = ctx && isAlias(value) ? value.resolve(ctx.doc) : value;
|
|
19885
|
-
if (isSeq(value))
|
|
19886
|
-
for (const it of value.items)
|
|
19887
|
-
mergeValue(ctx, map, it);
|
|
19888
|
-
else if (Array.isArray(value))
|
|
19889
|
-
for (const it of value)
|
|
19890
|
-
mergeValue(ctx, map, it);
|
|
19891
|
-
else
|
|
19892
|
-
mergeValue(ctx, map, value);
|
|
19893
|
-
}
|
|
19894
|
-
function mergeValue(ctx, map, value) {
|
|
20424
|
+
function mergeToJSMap(ctx, map, value) {
|
|
19895
20425
|
const source = ctx && isAlias(value) ? value.resolve(ctx.doc) : value;
|
|
19896
20426
|
if (!isMap(source))
|
|
19897
20427
|
throw new Error('Merge sources must be maps or map aliases');
|
|
@@ -19915,41 +20445,9 @@ query GetEurekaVizSnapshots(
|
|
|
19915
20445
|
}
|
|
19916
20446
|
return map;
|
|
19917
20447
|
}
|
|
19918
|
-
|
|
19919
|
-
function addPairToJSMap(ctx, map, { key, value }) {
|
|
19920
|
-
if (isNode(key) && key.addToJSMap)
|
|
19921
|
-
key.addToJSMap(ctx, map, value);
|
|
19922
|
-
// TODO: Should drop this special case for bare << handling
|
|
19923
|
-
else if (isMergeKey(ctx, key))
|
|
19924
|
-
addMergeToJSMap(ctx, map, value);
|
|
19925
|
-
else {
|
|
19926
|
-
const jsKey = toJS(key, '', ctx);
|
|
19927
|
-
if (map instanceof Map) {
|
|
19928
|
-
map.set(jsKey, toJS(value, jsKey, ctx));
|
|
19929
|
-
}
|
|
19930
|
-
else if (map instanceof Set) {
|
|
19931
|
-
map.add(jsKey);
|
|
19932
|
-
}
|
|
19933
|
-
else {
|
|
19934
|
-
const stringKey = stringifyKey(key, jsKey, ctx);
|
|
19935
|
-
const jsValue = toJS(value, stringKey, ctx);
|
|
19936
|
-
if (stringKey in map)
|
|
19937
|
-
Object.defineProperty(map, stringKey, {
|
|
19938
|
-
value: jsValue,
|
|
19939
|
-
writable: true,
|
|
19940
|
-
enumerable: true,
|
|
19941
|
-
configurable: true
|
|
19942
|
-
});
|
|
19943
|
-
else
|
|
19944
|
-
map[stringKey] = jsValue;
|
|
19945
|
-
}
|
|
19946
|
-
}
|
|
19947
|
-
return map;
|
|
19948
|
-
}
|
|
19949
20448
|
function stringifyKey(key, jsKey, ctx) {
|
|
19950
20449
|
if (jsKey === null)
|
|
19951
20450
|
return '';
|
|
19952
|
-
// eslint-disable-next-line @typescript-eslint/no-base-to-string
|
|
19953
20451
|
if (typeof jsKey !== 'object')
|
|
19954
20452
|
return String(jsKey);
|
|
19955
20453
|
if (isNode(key) && ctx?.doc) {
|
|
@@ -20582,7 +21080,7 @@ query GetEurekaVizSnapshots(
|
|
|
20582
21080
|
identify: value => typeof value === 'boolean',
|
|
20583
21081
|
default: true,
|
|
20584
21082
|
tag: 'tag:yaml.org,2002:bool',
|
|
20585
|
-
test: /^true
|
|
21083
|
+
test: /^true|false$/,
|
|
20586
21084
|
resolve: str => str === 'true',
|
|
20587
21085
|
stringify: stringifyJSON
|
|
20588
21086
|
},
|
|
@@ -20627,7 +21125,10 @@ query GetEurekaVizSnapshots(
|
|
|
20627
21125
|
* document.querySelector('#photo').src = URL.createObjectURL(blob)
|
|
20628
21126
|
*/
|
|
20629
21127
|
resolve(src, onError) {
|
|
20630
|
-
if (typeof
|
|
21128
|
+
if (typeof Buffer === 'function') {
|
|
21129
|
+
return Buffer.from(src, 'base64');
|
|
21130
|
+
}
|
|
21131
|
+
else if (typeof atob === 'function') {
|
|
20631
21132
|
// On IE 11, atob() can't handle newlines
|
|
20632
21133
|
const str = atob(src.replace(/[\n\r]/g, ''));
|
|
20633
21134
|
const buffer = new Uint8Array(str.length);
|
|
@@ -20641,11 +21142,15 @@ query GetEurekaVizSnapshots(
|
|
|
20641
21142
|
}
|
|
20642
21143
|
},
|
|
20643
21144
|
stringify({ comment, type, value }, ctx, onComment, onChompKeep) {
|
|
20644
|
-
if (!value)
|
|
20645
|
-
return '';
|
|
20646
21145
|
const buf = value; // checked earlier by binary.identify()
|
|
20647
21146
|
let str;
|
|
20648
|
-
if (typeof
|
|
21147
|
+
if (typeof Buffer === 'function') {
|
|
21148
|
+
str =
|
|
21149
|
+
buf instanceof Buffer
|
|
21150
|
+
? buf.toString('base64')
|
|
21151
|
+
: Buffer.from(buf.buffer).toString('base64');
|
|
21152
|
+
}
|
|
21153
|
+
else if (typeof btoa === 'function') {
|
|
20649
21154
|
let s = '';
|
|
20650
21155
|
for (let i = 0; i < buf.length; ++i)
|
|
20651
21156
|
s += String.fromCharCode(buf[i]);
|
|
@@ -20654,7 +21159,8 @@ query GetEurekaVizSnapshots(
|
|
|
20654
21159
|
else {
|
|
20655
21160
|
throw new Error('This environment does not support writing binary tags; either Buffer or btoa is required');
|
|
20656
21161
|
}
|
|
20657
|
-
|
|
21162
|
+
if (!type)
|
|
21163
|
+
type = Scalar.BLOCK_LITERAL;
|
|
20658
21164
|
if (type !== Scalar.QUOTE_DOUBLE) {
|
|
20659
21165
|
const lineWidth = Math.max(ctx.options.lineWidth - ctx.indent.length, ctx.options.minContentWidth);
|
|
20660
21166
|
const n = Math.ceil(str.length / lineWidth);
|
|
@@ -21123,7 +21629,7 @@ query GetEurekaVizSnapshots(
|
|
|
21123
21629
|
}
|
|
21124
21630
|
return new Date(date);
|
|
21125
21631
|
},
|
|
21126
|
-
stringify: ({ value }) => value
|
|
21632
|
+
stringify: ({ value }) => value.toISOString().replace(/((T00:00)?:00)?\.000Z$/, '')
|
|
21127
21633
|
};
|
|
21128
21634
|
|
|
21129
21635
|
const schema = [
|
|
@@ -21141,7 +21647,6 @@ query GetEurekaVizSnapshots(
|
|
|
21141
21647
|
floatExp,
|
|
21142
21648
|
float,
|
|
21143
21649
|
binary,
|
|
21144
|
-
merge,
|
|
21145
21650
|
omap,
|
|
21146
21651
|
pairs,
|
|
21147
21652
|
set,
|
|
@@ -21169,7 +21674,6 @@ query GetEurekaVizSnapshots(
|
|
|
21169
21674
|
intOct: intOct$1,
|
|
21170
21675
|
intTime,
|
|
21171
21676
|
map,
|
|
21172
|
-
merge,
|
|
21173
21677
|
null: nullTag,
|
|
21174
21678
|
omap,
|
|
21175
21679
|
pairs,
|
|
@@ -21179,20 +21683,13 @@ query GetEurekaVizSnapshots(
|
|
|
21179
21683
|
};
|
|
21180
21684
|
const coreKnownTags = {
|
|
21181
21685
|
'tag:yaml.org,2002:binary': binary,
|
|
21182
|
-
'tag:yaml.org,2002:merge': merge,
|
|
21183
21686
|
'tag:yaml.org,2002:omap': omap,
|
|
21184
21687
|
'tag:yaml.org,2002:pairs': pairs,
|
|
21185
21688
|
'tag:yaml.org,2002:set': set,
|
|
21186
21689
|
'tag:yaml.org,2002:timestamp': timestamp
|
|
21187
21690
|
};
|
|
21188
|
-
function getTags(customTags, schemaName
|
|
21189
|
-
|
|
21190
|
-
if (schemaTags && !customTags) {
|
|
21191
|
-
return addMergeTag && !schemaTags.includes(merge)
|
|
21192
|
-
? schemaTags.concat(merge)
|
|
21193
|
-
: schemaTags.slice();
|
|
21194
|
-
}
|
|
21195
|
-
let tags = schemaTags;
|
|
21691
|
+
function getTags(customTags, schemaName) {
|
|
21692
|
+
let tags = schemas.get(schemaName);
|
|
21196
21693
|
if (!tags) {
|
|
21197
21694
|
if (Array.isArray(customTags))
|
|
21198
21695
|
tags = [];
|
|
@@ -21211,21 +21708,17 @@ query GetEurekaVizSnapshots(
|
|
|
21211
21708
|
else if (typeof customTags === 'function') {
|
|
21212
21709
|
tags = customTags(tags.slice());
|
|
21213
21710
|
}
|
|
21214
|
-
|
|
21215
|
-
|
|
21216
|
-
|
|
21217
|
-
const tagObj =
|
|
21218
|
-
if (
|
|
21219
|
-
|
|
21220
|
-
|
|
21221
|
-
|
|
21222
|
-
|
|
21223
|
-
|
|
21224
|
-
|
|
21225
|
-
if (!tags.includes(tagObj))
|
|
21226
|
-
tags.push(tagObj);
|
|
21227
|
-
return tags;
|
|
21228
|
-
}, []);
|
|
21711
|
+
return tags.map(tag => {
|
|
21712
|
+
if (typeof tag !== 'string')
|
|
21713
|
+
return tag;
|
|
21714
|
+
const tagObj = tagsByName[tag];
|
|
21715
|
+
if (tagObj)
|
|
21716
|
+
return tagObj;
|
|
21717
|
+
const keys = Object.keys(tagsByName)
|
|
21718
|
+
.map(key => JSON.stringify(key))
|
|
21719
|
+
.join(', ');
|
|
21720
|
+
throw new Error(`Unknown custom tag "${tag}"; use one of ${keys}`);
|
|
21721
|
+
});
|
|
21229
21722
|
}
|
|
21230
21723
|
|
|
21231
21724
|
const sortMapEntriesByKey = (a, b) => a.key < b.key ? -1 : a.key > b.key ? 1 : 0;
|
|
@@ -21236,9 +21729,10 @@ query GetEurekaVizSnapshots(
|
|
|
21236
21729
|
: compat
|
|
21237
21730
|
? getTags(null, compat)
|
|
21238
21731
|
: null;
|
|
21732
|
+
this.merge = !!merge;
|
|
21239
21733
|
this.name = (typeof schema === 'string' && schema) || 'core';
|
|
21240
21734
|
this.knownTags = resolveKnownTags ? coreKnownTags : {};
|
|
21241
|
-
this.tags = getTags(customTags, this.name
|
|
21735
|
+
this.tags = getTags(customTags, this.name);
|
|
21242
21736
|
this.toStringOptions = toStringDefaults ?? null;
|
|
21243
21737
|
Object.defineProperty(this, MAP, { value: map });
|
|
21244
21738
|
Object.defineProperty(this, SCALAR$1, { value: string });
|
|
@@ -21363,7 +21857,6 @@ query GetEurekaVizSnapshots(
|
|
|
21363
21857
|
logLevel: 'warn',
|
|
21364
21858
|
prettyErrors: true,
|
|
21365
21859
|
strict: true,
|
|
21366
|
-
stringKeys: false,
|
|
21367
21860
|
uniqueKeys: true,
|
|
21368
21861
|
version: '1.2'
|
|
21369
21862
|
}, options);
|
|
@@ -21587,7 +22080,7 @@ query GetEurekaVizSnapshots(
|
|
|
21587
22080
|
this.directives.yaml.version = '1.1';
|
|
21588
22081
|
else
|
|
21589
22082
|
this.directives = new Directives({ version: '1.1' });
|
|
21590
|
-
opt = { resolveKnownTags: false, schema: 'yaml-1.1' };
|
|
22083
|
+
opt = { merge: true, resolveKnownTags: false, schema: 'yaml-1.1' };
|
|
21591
22084
|
break;
|
|
21592
22085
|
case '1.2':
|
|
21593
22086
|
case 'next':
|
|
@@ -21595,7 +22088,7 @@ query GetEurekaVizSnapshots(
|
|
|
21595
22088
|
this.directives.yaml.version = version;
|
|
21596
22089
|
else
|
|
21597
22090
|
this.directives = new Directives({ version });
|
|
21598
|
-
opt = { resolveKnownTags: true, schema: 'core' };
|
|
22091
|
+
opt = { merge: false, resolveKnownTags: true, schema: 'core' };
|
|
21599
22092
|
break;
|
|
21600
22093
|
case null:
|
|
21601
22094
|
if (this.directives)
|
|
@@ -21773,7 +22266,7 @@ query GetEurekaVizSnapshots(
|
|
|
21773
22266
|
if (atNewline) {
|
|
21774
22267
|
if (comment)
|
|
21775
22268
|
comment += token.source;
|
|
21776
|
-
else
|
|
22269
|
+
else
|
|
21777
22270
|
spaceBefore = true;
|
|
21778
22271
|
}
|
|
21779
22272
|
else
|
|
@@ -21790,7 +22283,8 @@ query GetEurekaVizSnapshots(
|
|
|
21790
22283
|
if (token.source.endsWith(':'))
|
|
21791
22284
|
onError(token.offset + token.source.length - 1, 'BAD_ALIAS', 'Anchor ending in : is ambiguous', true);
|
|
21792
22285
|
anchor = token;
|
|
21793
|
-
|
|
22286
|
+
if (start === null)
|
|
22287
|
+
start = token.offset;
|
|
21794
22288
|
atNewline = false;
|
|
21795
22289
|
hasSpace = false;
|
|
21796
22290
|
reqSpace = true;
|
|
@@ -21799,7 +22293,8 @@ query GetEurekaVizSnapshots(
|
|
|
21799
22293
|
if (tag)
|
|
21800
22294
|
onError(token, 'MULTIPLE_TAGS', 'A node can have at most one tag');
|
|
21801
22295
|
tag = token;
|
|
21802
|
-
|
|
22296
|
+
if (start === null)
|
|
22297
|
+
start = token.offset;
|
|
21803
22298
|
atNewline = false;
|
|
21804
22299
|
hasSpace = false;
|
|
21805
22300
|
reqSpace = true;
|
|
@@ -21912,7 +22407,11 @@ query GetEurekaVizSnapshots(
|
|
|
21912
22407
|
return false;
|
|
21913
22408
|
const isEqual = typeof uniqueKeys === 'function'
|
|
21914
22409
|
? uniqueKeys
|
|
21915
|
-
: (a, b) => a === b ||
|
|
22410
|
+
: (a, b) => a === b ||
|
|
22411
|
+
(isScalar$1(a) &&
|
|
22412
|
+
isScalar$1(b) &&
|
|
22413
|
+
a.value === b.value &&
|
|
22414
|
+
!(a.value === '<<' && ctx.schema.merge));
|
|
21916
22415
|
return items.some(pair => isEqual(pair.key, search));
|
|
21917
22416
|
}
|
|
21918
22417
|
|
|
@@ -21961,14 +22460,12 @@ query GetEurekaVizSnapshots(
|
|
|
21961
22460
|
onError(offset, 'BAD_INDENT', startColMsg);
|
|
21962
22461
|
}
|
|
21963
22462
|
// key value
|
|
21964
|
-
ctx.atKey = true;
|
|
21965
22463
|
const keyStart = keyProps.end;
|
|
21966
22464
|
const keyNode = key
|
|
21967
22465
|
? composeNode(ctx, key, keyProps, onError)
|
|
21968
22466
|
: composeEmptyNode(ctx, keyStart, start, null, keyProps, onError);
|
|
21969
22467
|
if (ctx.schema.compat)
|
|
21970
22468
|
flowIndentCheck(bm.indent, key, onError);
|
|
21971
|
-
ctx.atKey = false;
|
|
21972
22469
|
if (mapIncludes(ctx, map.items, keyNode))
|
|
21973
22470
|
onError(keyStart, 'DUPLICATE_KEY', 'Map keys must be unique');
|
|
21974
22471
|
// value properties
|
|
@@ -22028,8 +22525,6 @@ query GetEurekaVizSnapshots(
|
|
|
22028
22525
|
const seq = new NodeClass(ctx.schema);
|
|
22029
22526
|
if (ctx.atRoot)
|
|
22030
22527
|
ctx.atRoot = false;
|
|
22031
|
-
if (ctx.atKey)
|
|
22032
|
-
ctx.atKey = false;
|
|
22033
22528
|
let offset = bs.offset;
|
|
22034
22529
|
let commentEnd = null;
|
|
22035
22530
|
for (const { start, value } of bs.items) {
|
|
@@ -22114,8 +22609,6 @@ query GetEurekaVizSnapshots(
|
|
|
22114
22609
|
const atRoot = ctx.atRoot;
|
|
22115
22610
|
if (atRoot)
|
|
22116
22611
|
ctx.atRoot = false;
|
|
22117
|
-
if (ctx.atKey)
|
|
22118
|
-
ctx.atKey = false;
|
|
22119
22612
|
let offset = fc.offset + fc.start.source.length;
|
|
22120
22613
|
for (let i = 0; i < fc.items.length; ++i) {
|
|
22121
22614
|
const collItem = fc.items[i];
|
|
@@ -22195,14 +22688,12 @@ query GetEurekaVizSnapshots(
|
|
|
22195
22688
|
else {
|
|
22196
22689
|
// item is a key+value pair
|
|
22197
22690
|
// key value
|
|
22198
|
-
ctx.atKey = true;
|
|
22199
22691
|
const keyStart = props.end;
|
|
22200
22692
|
const keyNode = key
|
|
22201
22693
|
? composeNode(ctx, key, props, onError)
|
|
22202
22694
|
: composeEmptyNode(ctx, keyStart, start, null, props, onError);
|
|
22203
22695
|
if (isBlock(key))
|
|
22204
22696
|
onError(keyNode.range, 'BLOCK_IN_FLOW', blockMsg);
|
|
22205
|
-
ctx.atKey = false;
|
|
22206
22697
|
// value properties
|
|
22207
22698
|
const valueProps = resolveProps(sep ?? [], {
|
|
22208
22699
|
flow: fcName,
|
|
@@ -22358,8 +22849,8 @@ query GetEurekaVizSnapshots(
|
|
|
22358
22849
|
tag = kt;
|
|
22359
22850
|
}
|
|
22360
22851
|
else {
|
|
22361
|
-
if (kt) {
|
|
22362
|
-
onError(tagToken, 'BAD_COLLECTION_TYPE', `${kt.tag} used for ${expType} collection, but expects ${kt.collection
|
|
22852
|
+
if (kt?.collection) {
|
|
22853
|
+
onError(tagToken, 'BAD_COLLECTION_TYPE', `${kt.tag} used for ${expType} collection, but expects ${kt.collection}`, true);
|
|
22363
22854
|
}
|
|
22364
22855
|
else {
|
|
22365
22856
|
onError(tagToken, 'TAG_RESOLVE_FAILED', `Unresolved tag: ${tagName}`, true);
|
|
@@ -22800,16 +23291,11 @@ query GetEurekaVizSnapshots(
|
|
|
22800
23291
|
const tagName = tagToken
|
|
22801
23292
|
? ctx.directives.tagName(tagToken.source, msg => onError(tagToken, 'TAG_RESOLVE_FAILED', msg))
|
|
22802
23293
|
: null;
|
|
22803
|
-
|
|
22804
|
-
|
|
22805
|
-
|
|
22806
|
-
|
|
22807
|
-
|
|
22808
|
-
tag = findScalarTagByName(ctx.schema, value, tagName, tagToken, onError);
|
|
22809
|
-
else if (token.type === 'scalar')
|
|
22810
|
-
tag = findScalarTagByTest(ctx, value, token, onError);
|
|
22811
|
-
else
|
|
22812
|
-
tag = ctx.schema[SCALAR$1];
|
|
23294
|
+
const tag = tagToken && tagName
|
|
23295
|
+
? findScalarTagByName(ctx.schema, value, tagName, tagToken, onError)
|
|
23296
|
+
: token.type === 'scalar'
|
|
23297
|
+
? findScalarTagByTest(ctx, value, token, onError)
|
|
23298
|
+
: ctx.schema[SCALAR$1];
|
|
22813
23299
|
let scalar;
|
|
22814
23300
|
try {
|
|
22815
23301
|
const res = tag.resolve(value, msg => onError(tagToken ?? token, 'TAG_RESOLVE_FAILED', msg), ctx.options);
|
|
@@ -22857,9 +23343,8 @@ query GetEurekaVizSnapshots(
|
|
|
22857
23343
|
onError(tagToken, 'TAG_RESOLVE_FAILED', `Unresolved tag: ${tagName}`, tagName !== 'tag:yaml.org,2002:str');
|
|
22858
23344
|
return schema[SCALAR$1];
|
|
22859
23345
|
}
|
|
22860
|
-
function findScalarTagByTest({
|
|
22861
|
-
const tag = schema.tags.find(tag =>
|
|
22862
|
-
tag.test?.test(value)) || schema[SCALAR$1];
|
|
23346
|
+
function findScalarTagByTest({ directives, schema }, value, token, onError) {
|
|
23347
|
+
const tag = schema.tags.find(tag => tag.default && tag.test?.test(value)) || schema[SCALAR$1];
|
|
22863
23348
|
if (schema.compat) {
|
|
22864
23349
|
const compat = schema.compat.find(tag => tag.default && tag.test?.test(value)) ??
|
|
22865
23350
|
schema[SCALAR$1];
|
|
@@ -22875,7 +23360,8 @@ query GetEurekaVizSnapshots(
|
|
|
22875
23360
|
|
|
22876
23361
|
function emptyScalarPosition(offset, before, pos) {
|
|
22877
23362
|
if (before) {
|
|
22878
|
-
|
|
23363
|
+
if (pos === null)
|
|
23364
|
+
pos = before.length;
|
|
22879
23365
|
for (let i = pos - 1; i >= 0; --i) {
|
|
22880
23366
|
let st = before[i];
|
|
22881
23367
|
switch (st.type) {
|
|
@@ -22900,7 +23386,6 @@ query GetEurekaVizSnapshots(
|
|
|
22900
23386
|
|
|
22901
23387
|
const CN = { composeNode, composeEmptyNode };
|
|
22902
23388
|
function composeNode(ctx, token, props, onError) {
|
|
22903
|
-
const atKey = ctx.atKey;
|
|
22904
23389
|
const { spaceBefore, comment, anchor, tag } = props;
|
|
22905
23390
|
let node;
|
|
22906
23391
|
let isSrcToken = true;
|
|
@@ -22936,14 +23421,6 @@ query GetEurekaVizSnapshots(
|
|
|
22936
23421
|
}
|
|
22937
23422
|
if (anchor && node.anchor === '')
|
|
22938
23423
|
onError(anchor, 'BAD_ALIAS', 'Anchor cannot be an empty string');
|
|
22939
|
-
if (atKey &&
|
|
22940
|
-
ctx.options.stringKeys &&
|
|
22941
|
-
(!isScalar$1(node) ||
|
|
22942
|
-
typeof node.value !== 'string' ||
|
|
22943
|
-
(node.tag && node.tag !== 'tag:yaml.org,2002:str'))) {
|
|
22944
|
-
const msg = 'With stringKeys, all keys must be strings';
|
|
22945
|
-
onError(tag ?? token, 'NON_STRING_KEY', msg);
|
|
22946
|
-
}
|
|
22947
23424
|
if (spaceBefore)
|
|
22948
23425
|
node.spaceBefore = true;
|
|
22949
23426
|
if (comment) {
|
|
@@ -22996,7 +23473,6 @@ query GetEurekaVizSnapshots(
|
|
|
22996
23473
|
const opts = Object.assign({ _directives: directives }, options);
|
|
22997
23474
|
const doc = new Document(undefined, opts);
|
|
22998
23475
|
const ctx = {
|
|
22999
|
-
atKey: false,
|
|
23000
23476
|
atRoot: true,
|
|
23001
23477
|
directives: doc.directives,
|
|
23002
23478
|
options: doc.options,
|
|
@@ -25131,20 +25607,7 @@ query GetEurekaVizSnapshots(
|
|
|
25131
25607
|
default: {
|
|
25132
25608
|
const bv = this.startBlockValue(map);
|
|
25133
25609
|
if (bv) {
|
|
25134
|
-
if (bv.type
|
|
25135
|
-
if (!it.explicitKey &&
|
|
25136
|
-
it.sep &&
|
|
25137
|
-
!includesToken(it.sep, 'newline')) {
|
|
25138
|
-
yield* this.pop({
|
|
25139
|
-
type: 'error',
|
|
25140
|
-
offset: this.offset,
|
|
25141
|
-
message: 'Unexpected block-seq-ind on same line with key',
|
|
25142
|
-
source: this.source
|
|
25143
|
-
});
|
|
25144
|
-
return;
|
|
25145
|
-
}
|
|
25146
|
-
}
|
|
25147
|
-
else if (atMapIndent) {
|
|
25610
|
+
if (atMapIndent && bv.type !== 'block-seq') {
|
|
25148
25611
|
map.items.push({ start });
|
|
25149
25612
|
}
|
|
25150
25613
|
this.stack.push(bv);
|
|
@@ -25515,8 +25978,6 @@ query GetEurekaVizSnapshots(
|
|
|
25515
25978
|
if (!keepUndefined)
|
|
25516
25979
|
return undefined;
|
|
25517
25980
|
}
|
|
25518
|
-
if (isDocument(value) && !_replacer)
|
|
25519
|
-
return value.toString(options);
|
|
25520
25981
|
return new Document(value, _replacer, options).toString(options);
|
|
25521
25982
|
}
|
|
25522
25983
|
|
|
@@ -25604,6 +26065,7 @@ query GetEurekaVizSnapshots(
|
|
|
25604
26065
|
exports.SageEmbed = SageEmbed;
|
|
25605
26066
|
exports.SearchBarEmbed = SearchBarEmbed;
|
|
25606
26067
|
exports.SearchEmbed = SearchEmbed;
|
|
26068
|
+
exports.SpotterAgentEmbed = SpotterAgentEmbed;
|
|
25607
26069
|
exports.SpotterEmbed = SpotterEmbed;
|
|
25608
26070
|
exports.getSessionInfo = getSessionInfo;
|
|
25609
26071
|
exports.useEmbedRef = useEmbedRef;
|