@thoughtspot/visual-embed-sdk 1.37.1-spotter-embed → 1.38.0
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 +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 +39 -6
- 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/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-DnIvX1FR.js → index-BIcnpmMY.js} +1 -1
- 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/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 +593 -66
- package/dist/tsembed-react.js +737 -285
- package/dist/tsembed.es.js +132 -64
- package/dist/tsembed.js +276 -284
- 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 +38 -5
- 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/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 +61 -8
- 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/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-Cj4BVGHL.js +0 -7371
- 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.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
/* @thoughtspot/visual-embed-sdk version 1.
|
|
1
|
+
/* @thoughtspot/visual-embed-sdk version 1.38.0 */
|
|
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);
|
|
@@ -2005,9 +2005,12 @@
|
|
|
2005
2005
|
* @example
|
|
2006
2006
|
* ```js
|
|
2007
2007
|
* searchEmbed.trigger(HostEvent.OpenFilter,
|
|
2008
|
-
* { columnId: '<column-GUID>', name: 'column name', type: 'INT64', dataType: 'ATTRIBUTE'})
|
|
2008
|
+
* {column: { columnId: '<column-GUID>', name: 'column name', type: 'INT64', dataType: 'ATTRIBUTE'}})
|
|
2009
|
+
* ```
|
|
2010
|
+
* @example
|
|
2011
|
+
* ```js
|
|
2009
2012
|
* LiveboardEmbed.trigger(HostEvent.OpenFilter,
|
|
2010
|
-
*
|
|
2013
|
+
* { column: {columnId: '<column-GUID>'}})
|
|
2011
2014
|
* ```
|
|
2012
2015
|
* @version SDK: 1.21.0 | ThoughtSpot: 9.2.0.cl
|
|
2013
2016
|
*/
|
|
@@ -2616,6 +2619,25 @@
|
|
|
2616
2619
|
* }]
|
|
2617
2620
|
* });
|
|
2618
2621
|
* ```
|
|
2622
|
+
* If there are multiple columns with the same name, consider
|
|
2623
|
+
* using `WORKSHEET_NAME::COLUMN_NAME` format.
|
|
2624
|
+
*
|
|
2625
|
+
* @example
|
|
2626
|
+
*
|
|
2627
|
+
* ```js
|
|
2628
|
+
* liveboardEmbed.trigger(HostEvent.UpdateFilters, {
|
|
2629
|
+
* filters: [{
|
|
2630
|
+
* column: "(Sample) Retail - Apparel::city",
|
|
2631
|
+
* oper: 'IN',
|
|
2632
|
+
* values: ["atlanta"]
|
|
2633
|
+
* },
|
|
2634
|
+
* {
|
|
2635
|
+
* column: "(Sample) Retail - Apparel::Region",
|
|
2636
|
+
* oper: 'IN',
|
|
2637
|
+
* values: ["West","Midwest"]
|
|
2638
|
+
* }]
|
|
2639
|
+
* });
|
|
2640
|
+
* ```
|
|
2619
2641
|
* @version SDK: 1.23.0 | ThoughtSpot: 9.4.0.cl
|
|
2620
2642
|
*/
|
|
2621
2643
|
HostEvent["UpdateFilters"] = "updateFilters";
|
|
@@ -2825,54 +2847,6 @@
|
|
|
2825
2847
|
* @version SDK: 1.37.0 | ThoughtSpot: 10.8.0.cl
|
|
2826
2848
|
*/
|
|
2827
2849
|
HostEvent["TransformTableVizData"] = "TransformTableVizData";
|
|
2828
|
-
/**
|
|
2829
|
-
* Triggers the table visualization re-render with the updated data.
|
|
2830
|
-
* Includes the following properties:
|
|
2831
|
-
* @param - `columnDataLite` - an array of object containing the
|
|
2832
|
-
* data value modifications retrieved from the `EmbedEvent.TableVizRendered`
|
|
2833
|
-
* payload.For example, { columnDataLite: []}`.
|
|
2834
|
-
*/
|
|
2835
|
-
HostEvent["SpotterSearch"] = "SpotterSearch";
|
|
2836
|
-
/**
|
|
2837
|
-
* Triggers the table visualization re-render with the updated data.
|
|
2838
|
-
* Includes the following properties:
|
|
2839
|
-
* @param - `columnDataLite` - an array of object containing the
|
|
2840
|
-
* data value modifications retrieved from the `EmbedEvent.TableVizRendered`
|
|
2841
|
-
* payload.For example, { columnDataLite: []}`.
|
|
2842
|
-
*/
|
|
2843
|
-
HostEvent["EditLastPrompt"] = "EditLastPrompt";
|
|
2844
|
-
/**
|
|
2845
|
-
* Triggers the table visualization re-render with the updated data.
|
|
2846
|
-
* Includes the following properties:
|
|
2847
|
-
* @param - `columnDataLite` - an array of object containing the
|
|
2848
|
-
* data value modifications retrieved from the `EmbedEvent.TableVizRendered`
|
|
2849
|
-
* payload.For example, { columnDataLite: []}`.
|
|
2850
|
-
*/
|
|
2851
|
-
HostEvent["PreviewSpotterData"] = "PreviewSpotterData";
|
|
2852
|
-
/**
|
|
2853
|
-
* Triggers the table visualization re-render with the updated data.
|
|
2854
|
-
* Includes the following properties:
|
|
2855
|
-
* @param - `columnDataLite` - an array of object containing the
|
|
2856
|
-
* data value modifications retrieved from the `EmbedEvent.TableVizRendered`
|
|
2857
|
-
* payload.For example, { columnDataLite: []}`.
|
|
2858
|
-
*/
|
|
2859
|
-
HostEvent["ResetSpotterConversation"] = "ResetSpotterConversation";
|
|
2860
|
-
/**
|
|
2861
|
-
* Triggers the table visualization re-render with the updated data.
|
|
2862
|
-
* Includes the following properties:
|
|
2863
|
-
* @param - `columnDataLite` - an array of object containing the
|
|
2864
|
-
* data value modifications retrieved from the `EmbedEvent.TableVizRendered`
|
|
2865
|
-
* payload.For example, { columnDataLite: []}`.
|
|
2866
|
-
*/
|
|
2867
|
-
HostEvent["DeleteLastPrompt"] = "DeleteLastPrompt";
|
|
2868
|
-
/**
|
|
2869
|
-
* Triggers the table visualization re-render with the updated data.
|
|
2870
|
-
* Includes the following properties:
|
|
2871
|
-
* @param - `columnDataLite` - an array of object containing the
|
|
2872
|
-
* data value modifications retrieved from the `EmbedEvent.TableVizRendered`
|
|
2873
|
-
* payload.For example, { columnDataLite: []}`.
|
|
2874
|
-
*/
|
|
2875
|
-
HostEvent["AnswerChartSwitcher"] = "answerChartSwitcher";
|
|
2876
2850
|
})(exports.HostEvent || (exports.HostEvent = {}));
|
|
2877
2851
|
/**
|
|
2878
2852
|
* The different visual modes that the data sources panel within
|
|
@@ -15054,6 +15028,13 @@ mutation GetUnsavedAnswerTML($session: BachSessionIdInput!, $exportDependencies:
|
|
|
15054
15028
|
iFrame.style.width = '0';
|
|
15055
15029
|
iFrame.style.height = '0';
|
|
15056
15030
|
iFrame.style.border = '0';
|
|
15031
|
+
// Make it 'fixed' to keep it in a different stacking context.
|
|
15032
|
+
// This should solve the focus behaviours inside the iframe from
|
|
15033
|
+
// interfering with main body.
|
|
15034
|
+
iFrame.style.position = 'fixed';
|
|
15035
|
+
// Push it out of viewport.
|
|
15036
|
+
iFrame.style.top = '100vh';
|
|
15037
|
+
iFrame.style.left = '100vw';
|
|
15057
15038
|
iFrame.classList.add('prefetchIframe');
|
|
15058
15039
|
iFrame.classList.add(`prefetchIframeNum-${index}`);
|
|
15059
15040
|
document.body.appendChild(iFrame);
|
|
@@ -15425,7 +15406,7 @@ mutation GetUnsavedAnswerTML($session: BachSessionIdInput!, $exportDependencies:
|
|
|
15425
15406
|
return e;
|
|
15426
15407
|
}
|
|
15427
15408
|
|
|
15428
|
-
var name="@thoughtspot/visual-embed-sdk";var version$1="1.
|
|
15409
|
+
var name="@thoughtspot/visual-embed-sdk";var version$1="1.38.0";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};
|
|
15429
15410
|
|
|
15430
15411
|
/**
|
|
15431
15412
|
* Reloads the ThoughtSpot iframe.
|
|
@@ -15659,11 +15640,13 @@ mutation GetUnsavedAnswerTML($session: BachSessionIdInput!, $exportDependencies:
|
|
|
15659
15640
|
* @param responder
|
|
15660
15641
|
*/
|
|
15661
15642
|
this.updateAuthToken = async (_, responder) => {
|
|
15662
|
-
const {
|
|
15663
|
-
|
|
15664
|
-
|
|
15643
|
+
const { authType } = this.embedConfig;
|
|
15644
|
+
let { autoLogin } = this.embedConfig;
|
|
15645
|
+
// Default autoLogin: true for cookieless if undefined/null, otherwise false
|
|
15646
|
+
autoLogin = autoLogin !== null && autoLogin !== void 0 ? autoLogin : (authType === exports.AuthType.TrustedAuthTokenCookieless);
|
|
15647
|
+
if (autoLogin && authType === exports.AuthType.TrustedAuthTokenCookieless) {
|
|
15665
15648
|
try {
|
|
15666
|
-
authToken = await getAuthenticationToken(this.embedConfig);
|
|
15649
|
+
const authToken = await getAuthenticationToken(this.embedConfig);
|
|
15667
15650
|
responder({
|
|
15668
15651
|
type: exports.EmbedEvent.AuthExpire,
|
|
15669
15652
|
data: { authToken },
|
|
@@ -16817,6 +16800,31 @@ mutation GetUnsavedAnswerTML($session: BachSessionIdInput!, $exportDependencies:
|
|
|
16817
16800
|
HomePageSearchBarMode["AI_ANSWER"] = "aiAnswer";
|
|
16818
16801
|
HomePageSearchBarMode["NONE"] = "none";
|
|
16819
16802
|
})(exports.HomePageSearchBarMode || (exports.HomePageSearchBarMode = {}));
|
|
16803
|
+
/**
|
|
16804
|
+
* Define the version of the primary navbar
|
|
16805
|
+
* @version SDK: 1.39.0 | Thoughtspot: 10.10.0.cl
|
|
16806
|
+
*/
|
|
16807
|
+
exports.PrimaryNavbarVersion = void 0;
|
|
16808
|
+
(function (PrimaryNavbarVersion) {
|
|
16809
|
+
/**
|
|
16810
|
+
* Sliding (v3) introduces a new left-side navigation hub featuring a tab switcher,
|
|
16811
|
+
* along with updates to the top navigation bar.
|
|
16812
|
+
* It serves as the foundational version of the PrimaryNavBar.
|
|
16813
|
+
*/
|
|
16814
|
+
PrimaryNavbarVersion["Sliding"] = "v3";
|
|
16815
|
+
})(exports.PrimaryNavbarVersion || (exports.PrimaryNavbarVersion = {}));
|
|
16816
|
+
/**
|
|
16817
|
+
* Define the version of the home page
|
|
16818
|
+
* @version SDK: 1.39.0 | Thoughtspot: 10.10.0.cl
|
|
16819
|
+
*/
|
|
16820
|
+
exports.HomePage = void 0;
|
|
16821
|
+
(function (HomePage) {
|
|
16822
|
+
/**
|
|
16823
|
+
* Modular (v2) introduces the updated Modular Home Experience.
|
|
16824
|
+
* It serves as the foundational version of the home page.
|
|
16825
|
+
*/
|
|
16826
|
+
HomePage["Modular"] = "v2";
|
|
16827
|
+
})(exports.HomePage || (exports.HomePage = {}));
|
|
16820
16828
|
/**
|
|
16821
16829
|
* Embeds full ThoughtSpot experience in a host application.
|
|
16822
16830
|
* @group Embed components
|
|
@@ -16871,9 +16879,9 @@ mutation GetUnsavedAnswerTML($session: BachSessionIdInput!, $exportDependencies:
|
|
|
16871
16879
|
* embedded Liveboard or visualization.
|
|
16872
16880
|
*/
|
|
16873
16881
|
getEmbedParams() {
|
|
16874
|
-
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,
|
|
16882
|
+
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,
|
|
16875
16883
|
/* eslint-disable-next-line max-len */
|
|
16876
|
-
dataPanelCustomGroupsAccordionInitialState = DataPanelCustomColumnGroupsAccordionState$1.EXPAND_ALL, collapseSearchBar = true, isLiveboardCompactHeaderEnabled = false, showLiveboardVerifiedBadge = true, showLiveboardReverifyBanner = true, hideIrrelevantChipsInLiveboardTabs = false, homePageSearchBarMode, isUnifiedSearchExperienceEnabled = true, enablePendoHelp = true, } = this.viewConfig;
|
|
16884
|
+
dataPanelCustomGroupsAccordionInitialState = DataPanelCustomColumnGroupsAccordionState$1.EXPAND_ALL, collapseSearchBar = true, isLiveboardCompactHeaderEnabled = false, showLiveboardVerifiedBadge = true, showLiveboardReverifyBanner = true, hideIrrelevantChipsInLiveboardTabs = false, homePageSearchBarMode, isUnifiedSearchExperienceEnabled = true, enablePendoHelp = true, discoveryExperience, } = this.viewConfig;
|
|
16877
16885
|
let params = {};
|
|
16878
16886
|
params[Param.PrimaryNavHidden] = !showPrimaryNavbar;
|
|
16879
16887
|
params[Param.HideProfleAndHelp] = !!disableProfileAndHelp;
|
|
@@ -16890,9 +16898,6 @@ mutation GetUnsavedAnswerTML($session: BachSessionIdInput!, $exportDependencies:
|
|
|
16890
16898
|
params[Param.HideIrrelevantFiltersInTab] = hideIrrelevantChipsInLiveboardTabs;
|
|
16891
16899
|
params[Param.IsUnifiedSearchExperienceEnabled] = isUnifiedSearchExperienceEnabled;
|
|
16892
16900
|
params = this.getBaseQueryParams(params);
|
|
16893
|
-
if (modularHomeExperienceV3) {
|
|
16894
|
-
params[Param.NavigationVersion] = 'v3';
|
|
16895
|
-
}
|
|
16896
16901
|
if (hideObjectSearch) {
|
|
16897
16902
|
params[Param.HideObjectSearch] = !!hideObjectSearch;
|
|
16898
16903
|
}
|
|
@@ -16949,6 +16954,17 @@ mutation GetUnsavedAnswerTML($session: BachSessionIdInput!, $exportDependencies:
|
|
|
16949
16954
|
/* eslint-disable-next-line max-len */
|
|
16950
16955
|
params[Param.DataPanelCustomGroupsAccordionInitialState] = DataPanelCustomColumnGroupsAccordionState$1.EXPAND_ALL;
|
|
16951
16956
|
}
|
|
16957
|
+
if (discoveryExperience) {
|
|
16958
|
+
// primaryNavbarVersion v3 will enabled the new left navigation
|
|
16959
|
+
if (discoveryExperience.primaryNavbarVersion === exports.PrimaryNavbarVersion.Sliding) {
|
|
16960
|
+
params[Param.NavigationVersion] = discoveryExperience.primaryNavbarVersion;
|
|
16961
|
+
}
|
|
16962
|
+
// homePage v2 will enable the modular home page
|
|
16963
|
+
// and it will override the modularHomeExperience value
|
|
16964
|
+
if (discoveryExperience.homePage === exports.HomePage.Modular) {
|
|
16965
|
+
params[Param.ModularHomeExperienceEnabled] = true;
|
|
16966
|
+
}
|
|
16967
|
+
}
|
|
16952
16968
|
const queryParams = getQueryParamString(params, true);
|
|
16953
16969
|
return queryParams;
|
|
16954
16970
|
}
|
|
@@ -18089,6 +18105,9 @@ query SendMessage($params: Input_convassist_SendMessageRequest) {
|
|
|
18089
18105
|
return { error };
|
|
18090
18106
|
}
|
|
18091
18107
|
const container = document.createElement('div');
|
|
18108
|
+
if (this.viewConfig.containerClassName) {
|
|
18109
|
+
container.className = this.viewConfig.containerClassName;
|
|
18110
|
+
}
|
|
18092
18111
|
const embed = new ConversationMessage(container, {
|
|
18093
18112
|
...this.viewConfig,
|
|
18094
18113
|
sessionId: data.sessionId,
|
|
@@ -18099,6 +18118,31 @@ query SendMessage($params: Input_convassist_SendMessageRequest) {
|
|
|
18099
18118
|
await embed.render();
|
|
18100
18119
|
return { container, viz: embed };
|
|
18101
18120
|
}
|
|
18121
|
+
}
|
|
18122
|
+
/**
|
|
18123
|
+
* Create a conversation embed, which can be integrated inside
|
|
18124
|
+
* chatbots or other conversational interfaces.
|
|
18125
|
+
* @deprecated from SDK: 1.38.0 | ThoughtSpot: 10.10.0.cl
|
|
18126
|
+
* Use {@link SpotterAgentEmbed} instead
|
|
18127
|
+
* @example
|
|
18128
|
+
* ```js
|
|
18129
|
+
* import { SpotterAgentEmbed } from '@thoughtspot/visual-embed-sdk';
|
|
18130
|
+
*
|
|
18131
|
+
* const conversation = new SpotterAgentEmbed({
|
|
18132
|
+
* worksheetId: 'worksheetId',
|
|
18133
|
+
* });
|
|
18134
|
+
*
|
|
18135
|
+
* const { container, error } = await conversation.sendMessage('show me sales by region');
|
|
18136
|
+
*
|
|
18137
|
+
* // append the container to the DOM
|
|
18138
|
+
* document.body.appendChild(container); // or to any other element
|
|
18139
|
+
* ```
|
|
18140
|
+
* @group Embed components
|
|
18141
|
+
*/
|
|
18142
|
+
class BodylessConversation extends SpotterAgentEmbed {
|
|
18143
|
+
constructor(viewConfig) {
|
|
18144
|
+
super(viewConfig);
|
|
18145
|
+
}
|
|
18102
18146
|
}
|
|
18103
18147
|
|
|
18104
18148
|
/**
|
|
@@ -18137,7 +18181,7 @@ query SendMessage($params: Input_convassist_SendMessageRequest) {
|
|
|
18137
18181
|
* });
|
|
18138
18182
|
* conversation.render();
|
|
18139
18183
|
* ```
|
|
18140
|
-
* @version SDK: 1.
|
|
18184
|
+
* @version SDK: 1.37.0 | ThoughtSpot: 10.9.0.cl
|
|
18141
18185
|
*/
|
|
18142
18186
|
class SpotterEmbed extends TsEmbed {
|
|
18143
18187
|
constructor(container, viewConfig) {
|
|
@@ -18185,6 +18229,30 @@ query SendMessage($params: Input_convassist_SendMessageRequest) {
|
|
|
18185
18229
|
await this.renderIFrame(src);
|
|
18186
18230
|
return this;
|
|
18187
18231
|
}
|
|
18232
|
+
}
|
|
18233
|
+
/**
|
|
18234
|
+
* Embed ThoughtSpot AI Conversation.
|
|
18235
|
+
* @deprecated from SDK: 1.38.0 | ThoughtSpot: 10.10.0.cl
|
|
18236
|
+
* Use {@link SpotterEmbed} instead
|
|
18237
|
+
* @group Embed components
|
|
18238
|
+
* @example
|
|
18239
|
+
* ```js
|
|
18240
|
+
* const conversation = new SpotterEmbed('#tsEmbed', {
|
|
18241
|
+
* worksheetId: 'worksheetId',
|
|
18242
|
+
* searchOptions: {
|
|
18243
|
+
* searchQuery: 'searchQuery',
|
|
18244
|
+
* },
|
|
18245
|
+
* });
|
|
18246
|
+
* conversation.render();
|
|
18247
|
+
* ```
|
|
18248
|
+
* @version SDK: 1.37.0 | ThoughtSpot: 10.9.0.cl
|
|
18249
|
+
*/
|
|
18250
|
+
class ConversationEmbed extends SpotterEmbed {
|
|
18251
|
+
constructor(container, viewConfig) {
|
|
18252
|
+
viewConfig.embedComponentType = 'conversation';
|
|
18253
|
+
super(container, viewConfig);
|
|
18254
|
+
this.viewConfig = viewConfig;
|
|
18255
|
+
}
|
|
18188
18256
|
}
|
|
18189
18257
|
|
|
18190
18258
|
/**
|
|
@@ -19245,7 +19313,8 @@ query GetEurekaResults($params: Input_eureka_SearchRequest) {
|
|
|
19245
19313
|
return {
|
|
19246
19314
|
onAnchor: (source) => {
|
|
19247
19315
|
aliasObjects.push(source);
|
|
19248
|
-
|
|
19316
|
+
if (!prevAnchors)
|
|
19317
|
+
prevAnchors = anchorNames(doc);
|
|
19249
19318
|
const anchor = findNewAnchor(prefix, prevAnchors);
|
|
19250
19319
|
prevAnchors.add(anchor);
|
|
19251
19320
|
return anchor;
|
|
@@ -19409,36 +19478,23 @@ query GetEurekaResults($params: Input_eureka_SearchRequest) {
|
|
|
19409
19478
|
* Resolve the value of this alias within `doc`, finding the last
|
|
19410
19479
|
* instance of the `source` anchor before this node.
|
|
19411
19480
|
*/
|
|
19412
|
-
resolve(doc
|
|
19413
|
-
let nodes;
|
|
19414
|
-
if (ctx?.aliasResolveCache) {
|
|
19415
|
-
nodes = ctx.aliasResolveCache;
|
|
19416
|
-
}
|
|
19417
|
-
else {
|
|
19418
|
-
nodes = [];
|
|
19419
|
-
visit$1(doc, {
|
|
19420
|
-
Node: (_key, node) => {
|
|
19421
|
-
if (isAlias(node) || hasAnchor(node))
|
|
19422
|
-
nodes.push(node);
|
|
19423
|
-
}
|
|
19424
|
-
});
|
|
19425
|
-
if (ctx)
|
|
19426
|
-
ctx.aliasResolveCache = nodes;
|
|
19427
|
-
}
|
|
19481
|
+
resolve(doc) {
|
|
19428
19482
|
let found = undefined;
|
|
19429
|
-
|
|
19430
|
-
|
|
19431
|
-
|
|
19432
|
-
|
|
19433
|
-
|
|
19434
|
-
|
|
19483
|
+
visit$1(doc, {
|
|
19484
|
+
Node: (_key, node) => {
|
|
19485
|
+
if (node === this)
|
|
19486
|
+
return visit$1.BREAK;
|
|
19487
|
+
if (node.anchor === this.source)
|
|
19488
|
+
found = node;
|
|
19489
|
+
}
|
|
19490
|
+
});
|
|
19435
19491
|
return found;
|
|
19436
19492
|
}
|
|
19437
19493
|
toJSON(_arg, ctx) {
|
|
19438
19494
|
if (!ctx)
|
|
19439
19495
|
return { source: this.source };
|
|
19440
19496
|
const { anchors, doc, maxAliasCount } = ctx;
|
|
19441
|
-
const source = this.resolve(doc
|
|
19497
|
+
const source = this.resolve(doc);
|
|
19442
19498
|
if (!source) {
|
|
19443
19499
|
const msg = `Unresolved alias (the anchor must be set before the alias): ${this.source}`;
|
|
19444
19500
|
throw new ReferenceError(msg);
|
|
@@ -19557,7 +19613,8 @@ query GetEurekaResults($params: Input_eureka_SearchRequest) {
|
|
|
19557
19613
|
if (aliasDuplicateObjects && value && typeof value === 'object') {
|
|
19558
19614
|
ref = sourceObjects.get(value);
|
|
19559
19615
|
if (ref) {
|
|
19560
|
-
|
|
19616
|
+
if (!ref.anchor)
|
|
19617
|
+
ref.anchor = onAnchor(value);
|
|
19561
19618
|
return new Alias(ref.anchor);
|
|
19562
19619
|
}
|
|
19563
19620
|
else {
|
|
@@ -20128,32 +20185,23 @@ query GetEurekaResults($params: Input_eureka_SearchRequest) {
|
|
|
20128
20185
|
start = start.replace(/\n+/g, `$&${indent}`);
|
|
20129
20186
|
}
|
|
20130
20187
|
const indentSize = indent ? '2' : '1'; // root is at -1
|
|
20131
|
-
|
|
20132
|
-
let header = (startWithSpace ? indentSize : '') + chomp;
|
|
20188
|
+
let header = (literal ? '|' : '>') + (startWithSpace ? indentSize : '') + chomp;
|
|
20133
20189
|
if (comment) {
|
|
20134
20190
|
header += ' ' + commentString(comment.replace(/ ?[\r\n]+/g, ' '));
|
|
20135
20191
|
if (onComment)
|
|
20136
20192
|
onComment();
|
|
20137
20193
|
}
|
|
20138
|
-
if (
|
|
20139
|
-
|
|
20140
|
-
|
|
20141
|
-
.replace(/(?:^|\n)([\t ].*)(?:([\n\t ]*)\n(?![\n\t ]))?/g, '$1$2') // more-indented lines aren't folded
|
|
20142
|
-
// ^ more-ind. ^ empty ^ capture next empty lines only at end of indent
|
|
20143
|
-
.replace(/\n+/g, `$&${indent}`);
|
|
20144
|
-
let literalFallback = false;
|
|
20145
|
-
const foldOptions = getFoldOptions(ctx, true);
|
|
20146
|
-
if (blockQuote !== 'folded' && type !== Scalar.BLOCK_FOLDED) {
|
|
20147
|
-
foldOptions.onOverflow = () => {
|
|
20148
|
-
literalFallback = true;
|
|
20149
|
-
};
|
|
20150
|
-
}
|
|
20151
|
-
const body = foldFlowLines(`${start}${foldedValue}${end}`, indent, FOLD_BLOCK, foldOptions);
|
|
20152
|
-
if (!literalFallback)
|
|
20153
|
-
return `>${header}\n${indent}${body}`;
|
|
20194
|
+
if (literal) {
|
|
20195
|
+
value = value.replace(/\n+/g, `$&${indent}`);
|
|
20196
|
+
return `${header}\n${indent}${start}${value}${end}`;
|
|
20154
20197
|
}
|
|
20155
|
-
value = value
|
|
20156
|
-
|
|
20198
|
+
value = value
|
|
20199
|
+
.replace(/\n+/g, '\n$&')
|
|
20200
|
+
.replace(/(?:^|\n)([\t ].*)(?:([\n\t ]*)\n(?![\n\t ]))?/g, '$1$2') // more-indented lines aren't folded
|
|
20201
|
+
// ^ more-ind. ^ empty ^ capture next empty lines only at end of indent
|
|
20202
|
+
.replace(/\n+/g, `$&${indent}`);
|
|
20203
|
+
const body = foldFlowLines(`${start}${value}${end}`, indent, FOLD_BLOCK, getFoldOptions(ctx, true));
|
|
20204
|
+
return `${header}\n${indent}${body}`;
|
|
20157
20205
|
}
|
|
20158
20206
|
function plainString(item, ctx, onComment, onChompKeep) {
|
|
20159
20207
|
const { type, value } = item;
|
|
@@ -20162,9 +20210,10 @@ query GetEurekaResults($params: Input_eureka_SearchRequest) {
|
|
|
20162
20210
|
(inFlow && /[[\]{},]/.test(value))) {
|
|
20163
20211
|
return quotedString(value, ctx);
|
|
20164
20212
|
}
|
|
20165
|
-
if (
|
|
20213
|
+
if (!value ||
|
|
20214
|
+
/^[\n\t ,[\]{}#&*!|>'"%@`]|^[?-]$|^[?-][ \t]|[\n:][ \t]|[ \t]\n|[\n\t ]#|[\n\t :]$/.test(value)) {
|
|
20166
20215
|
// not allowed:
|
|
20167
|
-
// - '-' or '?'
|
|
20216
|
+
// - empty string, '-' or '?'
|
|
20168
20217
|
// - start with an indicator character (except [?:-]) or /[?-] /
|
|
20169
20218
|
// - '\n ', ': ' or ' \n' anywhere
|
|
20170
20219
|
// - '#' not preceded by a non-space char
|
|
@@ -20293,12 +20342,7 @@ query GetEurekaResults($params: Input_eureka_SearchRequest) {
|
|
|
20293
20342
|
let obj;
|
|
20294
20343
|
if (isScalar$1(item)) {
|
|
20295
20344
|
obj = item.value;
|
|
20296
|
-
|
|
20297
|
-
if (match.length > 1) {
|
|
20298
|
-
const testMatch = match.filter(t => t.test);
|
|
20299
|
-
if (testMatch.length > 0)
|
|
20300
|
-
match = testMatch;
|
|
20301
|
-
}
|
|
20345
|
+
const match = tags.filter(t => t.identify?.(obj));
|
|
20302
20346
|
tagObj =
|
|
20303
20347
|
match.find(t => t.format === item.format) ?? match.find(t => !t.format);
|
|
20304
20348
|
}
|
|
@@ -20307,7 +20351,7 @@ query GetEurekaResults($params: Input_eureka_SearchRequest) {
|
|
|
20307
20351
|
tagObj = tags.find(t => t.nodeClass && obj instanceof t.nodeClass);
|
|
20308
20352
|
}
|
|
20309
20353
|
if (!tagObj) {
|
|
20310
|
-
const name = obj?.constructor?.name ??
|
|
20354
|
+
const name = obj?.constructor?.name ?? typeof obj;
|
|
20311
20355
|
throw new Error(`Tag not resolved for ${name} value`);
|
|
20312
20356
|
}
|
|
20313
20357
|
return tagObj;
|
|
@@ -20322,7 +20366,7 @@ query GetEurekaResults($params: Input_eureka_SearchRequest) {
|
|
|
20322
20366
|
anchors.add(anchor);
|
|
20323
20367
|
props.push(`&${anchor}`);
|
|
20324
20368
|
}
|
|
20325
|
-
const tag = node.tag
|
|
20369
|
+
const tag = node.tag ? node.tag : tagObj.default ? null : tagObj.tag;
|
|
20326
20370
|
if (tag)
|
|
20327
20371
|
props.push(doc.directives.tagString(tag));
|
|
20328
20372
|
return props.join(' ');
|
|
@@ -20348,7 +20392,8 @@ query GetEurekaResults($params: Input_eureka_SearchRequest) {
|
|
|
20348
20392
|
const node = isNode(item)
|
|
20349
20393
|
? item
|
|
20350
20394
|
: ctx.doc.createNode(item, { onTagObj: o => (tagObj = o) });
|
|
20351
|
-
|
|
20395
|
+
if (!tagObj)
|
|
20396
|
+
tagObj = getTagObject(ctx.doc.schema.tags, node);
|
|
20352
20397
|
const props = stringifyProps(node, tagObj, ctx);
|
|
20353
20398
|
if (props.length > 0)
|
|
20354
20399
|
ctx.indentAtStart = (ctx.indentAtStart ?? 0) + props.length + 1;
|
|
@@ -20510,10 +20555,54 @@ query GetEurekaResults($params: Input_eureka_SearchRequest) {
|
|
|
20510
20555
|
|
|
20511
20556
|
function warn(logLevel, warning) {
|
|
20512
20557
|
if (logLevel === 'debug' || logLevel === 'warn') {
|
|
20513
|
-
|
|
20558
|
+
if (typeof process !== 'undefined' && process.emitWarning)
|
|
20559
|
+
process.emitWarning(warning);
|
|
20560
|
+
else
|
|
20561
|
+
console.warn(warning);
|
|
20514
20562
|
}
|
|
20515
20563
|
}
|
|
20516
20564
|
|
|
20565
|
+
const MERGE_KEY = '<<';
|
|
20566
|
+
function addPairToJSMap(ctx, map, { key, value }) {
|
|
20567
|
+
if (ctx?.doc.schema.merge && isMergeKey(key)) {
|
|
20568
|
+
value = isAlias(value) ? value.resolve(ctx.doc) : value;
|
|
20569
|
+
if (isSeq(value))
|
|
20570
|
+
for (const it of value.items)
|
|
20571
|
+
mergeToJSMap(ctx, map, it);
|
|
20572
|
+
else if (Array.isArray(value))
|
|
20573
|
+
for (const it of value)
|
|
20574
|
+
mergeToJSMap(ctx, map, it);
|
|
20575
|
+
else
|
|
20576
|
+
mergeToJSMap(ctx, map, value);
|
|
20577
|
+
}
|
|
20578
|
+
else {
|
|
20579
|
+
const jsKey = toJS(key, '', ctx);
|
|
20580
|
+
if (map instanceof Map) {
|
|
20581
|
+
map.set(jsKey, toJS(value, jsKey, ctx));
|
|
20582
|
+
}
|
|
20583
|
+
else if (map instanceof Set) {
|
|
20584
|
+
map.add(jsKey);
|
|
20585
|
+
}
|
|
20586
|
+
else {
|
|
20587
|
+
const stringKey = stringifyKey(key, jsKey, ctx);
|
|
20588
|
+
const jsValue = toJS(value, stringKey, ctx);
|
|
20589
|
+
if (stringKey in map)
|
|
20590
|
+
Object.defineProperty(map, stringKey, {
|
|
20591
|
+
value: jsValue,
|
|
20592
|
+
writable: true,
|
|
20593
|
+
enumerable: true,
|
|
20594
|
+
configurable: true
|
|
20595
|
+
});
|
|
20596
|
+
else
|
|
20597
|
+
map[stringKey] = jsValue;
|
|
20598
|
+
}
|
|
20599
|
+
}
|
|
20600
|
+
return map;
|
|
20601
|
+
}
|
|
20602
|
+
const isMergeKey = (key) => key === MERGE_KEY ||
|
|
20603
|
+
(isScalar$1(key) &&
|
|
20604
|
+
key.value === MERGE_KEY &&
|
|
20605
|
+
(!key.type || key.type === Scalar.PLAIN));
|
|
20517
20606
|
// If the value associated with a merge key is a single mapping node, each of
|
|
20518
20607
|
// its key/value pairs is inserted into the current mapping, unless the key
|
|
20519
20608
|
// already exists in it. If the value associated with the merge key is a
|
|
@@ -20521,35 +20610,7 @@ query GetEurekaResults($params: Input_eureka_SearchRequest) {
|
|
|
20521
20610
|
// of these nodes is merged in turn according to its order in the sequence.
|
|
20522
20611
|
// Keys in mapping nodes earlier in the sequence override keys specified in
|
|
20523
20612
|
// later mapping nodes. -- http://yaml.org/type/merge.html
|
|
20524
|
-
|
|
20525
|
-
const merge = {
|
|
20526
|
-
identify: value => value === MERGE_KEY ||
|
|
20527
|
-
(typeof value === 'symbol' && value.description === MERGE_KEY),
|
|
20528
|
-
default: 'key',
|
|
20529
|
-
tag: 'tag:yaml.org,2002:merge',
|
|
20530
|
-
test: /^<<$/,
|
|
20531
|
-
resolve: () => Object.assign(new Scalar(Symbol(MERGE_KEY)), {
|
|
20532
|
-
addToJSMap: addMergeToJSMap
|
|
20533
|
-
}),
|
|
20534
|
-
stringify: () => MERGE_KEY
|
|
20535
|
-
};
|
|
20536
|
-
const isMergeKey = (ctx, key) => (merge.identify(key) ||
|
|
20537
|
-
(isScalar$1(key) &&
|
|
20538
|
-
(!key.type || key.type === Scalar.PLAIN) &&
|
|
20539
|
-
merge.identify(key.value))) &&
|
|
20540
|
-
ctx?.doc.schema.tags.some(tag => tag.tag === merge.tag && tag.default);
|
|
20541
|
-
function addMergeToJSMap(ctx, map, value) {
|
|
20542
|
-
value = ctx && isAlias(value) ? value.resolve(ctx.doc) : value;
|
|
20543
|
-
if (isSeq(value))
|
|
20544
|
-
for (const it of value.items)
|
|
20545
|
-
mergeValue(ctx, map, it);
|
|
20546
|
-
else if (Array.isArray(value))
|
|
20547
|
-
for (const it of value)
|
|
20548
|
-
mergeValue(ctx, map, it);
|
|
20549
|
-
else
|
|
20550
|
-
mergeValue(ctx, map, value);
|
|
20551
|
-
}
|
|
20552
|
-
function mergeValue(ctx, map, value) {
|
|
20613
|
+
function mergeToJSMap(ctx, map, value) {
|
|
20553
20614
|
const source = ctx && isAlias(value) ? value.resolve(ctx.doc) : value;
|
|
20554
20615
|
if (!isMap(source))
|
|
20555
20616
|
throw new Error('Merge sources must be maps or map aliases');
|
|
@@ -20573,41 +20634,9 @@ query GetEurekaResults($params: Input_eureka_SearchRequest) {
|
|
|
20573
20634
|
}
|
|
20574
20635
|
return map;
|
|
20575
20636
|
}
|
|
20576
|
-
|
|
20577
|
-
function addPairToJSMap(ctx, map, { key, value }) {
|
|
20578
|
-
if (isNode(key) && key.addToJSMap)
|
|
20579
|
-
key.addToJSMap(ctx, map, value);
|
|
20580
|
-
// TODO: Should drop this special case for bare << handling
|
|
20581
|
-
else if (isMergeKey(ctx, key))
|
|
20582
|
-
addMergeToJSMap(ctx, map, value);
|
|
20583
|
-
else {
|
|
20584
|
-
const jsKey = toJS(key, '', ctx);
|
|
20585
|
-
if (map instanceof Map) {
|
|
20586
|
-
map.set(jsKey, toJS(value, jsKey, ctx));
|
|
20587
|
-
}
|
|
20588
|
-
else if (map instanceof Set) {
|
|
20589
|
-
map.add(jsKey);
|
|
20590
|
-
}
|
|
20591
|
-
else {
|
|
20592
|
-
const stringKey = stringifyKey(key, jsKey, ctx);
|
|
20593
|
-
const jsValue = toJS(value, stringKey, ctx);
|
|
20594
|
-
if (stringKey in map)
|
|
20595
|
-
Object.defineProperty(map, stringKey, {
|
|
20596
|
-
value: jsValue,
|
|
20597
|
-
writable: true,
|
|
20598
|
-
enumerable: true,
|
|
20599
|
-
configurable: true
|
|
20600
|
-
});
|
|
20601
|
-
else
|
|
20602
|
-
map[stringKey] = jsValue;
|
|
20603
|
-
}
|
|
20604
|
-
}
|
|
20605
|
-
return map;
|
|
20606
|
-
}
|
|
20607
20637
|
function stringifyKey(key, jsKey, ctx) {
|
|
20608
20638
|
if (jsKey === null)
|
|
20609
20639
|
return '';
|
|
20610
|
-
// eslint-disable-next-line @typescript-eslint/no-base-to-string
|
|
20611
20640
|
if (typeof jsKey !== 'object')
|
|
20612
20641
|
return String(jsKey);
|
|
20613
20642
|
if (isNode(key) && ctx?.doc) {
|
|
@@ -21240,7 +21269,7 @@ query GetEurekaResults($params: Input_eureka_SearchRequest) {
|
|
|
21240
21269
|
identify: value => typeof value === 'boolean',
|
|
21241
21270
|
default: true,
|
|
21242
21271
|
tag: 'tag:yaml.org,2002:bool',
|
|
21243
|
-
test: /^true
|
|
21272
|
+
test: /^true|false$/,
|
|
21244
21273
|
resolve: str => str === 'true',
|
|
21245
21274
|
stringify: stringifyJSON
|
|
21246
21275
|
},
|
|
@@ -21285,7 +21314,10 @@ query GetEurekaResults($params: Input_eureka_SearchRequest) {
|
|
|
21285
21314
|
* document.querySelector('#photo').src = URL.createObjectURL(blob)
|
|
21286
21315
|
*/
|
|
21287
21316
|
resolve(src, onError) {
|
|
21288
|
-
if (typeof
|
|
21317
|
+
if (typeof Buffer === 'function') {
|
|
21318
|
+
return Buffer.from(src, 'base64');
|
|
21319
|
+
}
|
|
21320
|
+
else if (typeof atob === 'function') {
|
|
21289
21321
|
// On IE 11, atob() can't handle newlines
|
|
21290
21322
|
const str = atob(src.replace(/[\n\r]/g, ''));
|
|
21291
21323
|
const buffer = new Uint8Array(str.length);
|
|
@@ -21299,11 +21331,15 @@ query GetEurekaResults($params: Input_eureka_SearchRequest) {
|
|
|
21299
21331
|
}
|
|
21300
21332
|
},
|
|
21301
21333
|
stringify({ comment, type, value }, ctx, onComment, onChompKeep) {
|
|
21302
|
-
if (!value)
|
|
21303
|
-
return '';
|
|
21304
21334
|
const buf = value; // checked earlier by binary.identify()
|
|
21305
21335
|
let str;
|
|
21306
|
-
if (typeof
|
|
21336
|
+
if (typeof Buffer === 'function') {
|
|
21337
|
+
str =
|
|
21338
|
+
buf instanceof Buffer
|
|
21339
|
+
? buf.toString('base64')
|
|
21340
|
+
: Buffer.from(buf.buffer).toString('base64');
|
|
21341
|
+
}
|
|
21342
|
+
else if (typeof btoa === 'function') {
|
|
21307
21343
|
let s = '';
|
|
21308
21344
|
for (let i = 0; i < buf.length; ++i)
|
|
21309
21345
|
s += String.fromCharCode(buf[i]);
|
|
@@ -21312,7 +21348,8 @@ query GetEurekaResults($params: Input_eureka_SearchRequest) {
|
|
|
21312
21348
|
else {
|
|
21313
21349
|
throw new Error('This environment does not support writing binary tags; either Buffer or btoa is required');
|
|
21314
21350
|
}
|
|
21315
|
-
|
|
21351
|
+
if (!type)
|
|
21352
|
+
type = Scalar.BLOCK_LITERAL;
|
|
21316
21353
|
if (type !== Scalar.QUOTE_DOUBLE) {
|
|
21317
21354
|
const lineWidth = Math.max(ctx.options.lineWidth - ctx.indent.length, ctx.options.minContentWidth);
|
|
21318
21355
|
const n = Math.ceil(str.length / lineWidth);
|
|
@@ -21781,7 +21818,7 @@ query GetEurekaResults($params: Input_eureka_SearchRequest) {
|
|
|
21781
21818
|
}
|
|
21782
21819
|
return new Date(date);
|
|
21783
21820
|
},
|
|
21784
|
-
stringify: ({ value }) => value
|
|
21821
|
+
stringify: ({ value }) => value.toISOString().replace(/((T00:00)?:00)?\.000Z$/, '')
|
|
21785
21822
|
};
|
|
21786
21823
|
|
|
21787
21824
|
const schema = [
|
|
@@ -21799,7 +21836,6 @@ query GetEurekaResults($params: Input_eureka_SearchRequest) {
|
|
|
21799
21836
|
floatExp,
|
|
21800
21837
|
float,
|
|
21801
21838
|
binary,
|
|
21802
|
-
merge,
|
|
21803
21839
|
omap,
|
|
21804
21840
|
pairs,
|
|
21805
21841
|
set,
|
|
@@ -21827,7 +21863,6 @@ query GetEurekaResults($params: Input_eureka_SearchRequest) {
|
|
|
21827
21863
|
intOct: intOct$1,
|
|
21828
21864
|
intTime,
|
|
21829
21865
|
map,
|
|
21830
|
-
merge,
|
|
21831
21866
|
null: nullTag,
|
|
21832
21867
|
omap,
|
|
21833
21868
|
pairs,
|
|
@@ -21837,20 +21872,13 @@ query GetEurekaResults($params: Input_eureka_SearchRequest) {
|
|
|
21837
21872
|
};
|
|
21838
21873
|
const coreKnownTags = {
|
|
21839
21874
|
'tag:yaml.org,2002:binary': binary,
|
|
21840
|
-
'tag:yaml.org,2002:merge': merge,
|
|
21841
21875
|
'tag:yaml.org,2002:omap': omap,
|
|
21842
21876
|
'tag:yaml.org,2002:pairs': pairs,
|
|
21843
21877
|
'tag:yaml.org,2002:set': set,
|
|
21844
21878
|
'tag:yaml.org,2002:timestamp': timestamp
|
|
21845
21879
|
};
|
|
21846
|
-
function getTags(customTags, schemaName
|
|
21847
|
-
|
|
21848
|
-
if (schemaTags && !customTags) {
|
|
21849
|
-
return addMergeTag && !schemaTags.includes(merge)
|
|
21850
|
-
? schemaTags.concat(merge)
|
|
21851
|
-
: schemaTags.slice();
|
|
21852
|
-
}
|
|
21853
|
-
let tags = schemaTags;
|
|
21880
|
+
function getTags(customTags, schemaName) {
|
|
21881
|
+
let tags = schemas.get(schemaName);
|
|
21854
21882
|
if (!tags) {
|
|
21855
21883
|
if (Array.isArray(customTags))
|
|
21856
21884
|
tags = [];
|
|
@@ -21869,21 +21897,17 @@ query GetEurekaResults($params: Input_eureka_SearchRequest) {
|
|
|
21869
21897
|
else if (typeof customTags === 'function') {
|
|
21870
21898
|
tags = customTags(tags.slice());
|
|
21871
21899
|
}
|
|
21872
|
-
|
|
21873
|
-
|
|
21874
|
-
|
|
21875
|
-
const tagObj =
|
|
21876
|
-
if (
|
|
21877
|
-
|
|
21878
|
-
|
|
21879
|
-
|
|
21880
|
-
|
|
21881
|
-
|
|
21882
|
-
|
|
21883
|
-
if (!tags.includes(tagObj))
|
|
21884
|
-
tags.push(tagObj);
|
|
21885
|
-
return tags;
|
|
21886
|
-
}, []);
|
|
21900
|
+
return tags.map(tag => {
|
|
21901
|
+
if (typeof tag !== 'string')
|
|
21902
|
+
return tag;
|
|
21903
|
+
const tagObj = tagsByName[tag];
|
|
21904
|
+
if (tagObj)
|
|
21905
|
+
return tagObj;
|
|
21906
|
+
const keys = Object.keys(tagsByName)
|
|
21907
|
+
.map(key => JSON.stringify(key))
|
|
21908
|
+
.join(', ');
|
|
21909
|
+
throw new Error(`Unknown custom tag "${tag}"; use one of ${keys}`);
|
|
21910
|
+
});
|
|
21887
21911
|
}
|
|
21888
21912
|
|
|
21889
21913
|
const sortMapEntriesByKey = (a, b) => a.key < b.key ? -1 : a.key > b.key ? 1 : 0;
|
|
@@ -21894,9 +21918,10 @@ query GetEurekaResults($params: Input_eureka_SearchRequest) {
|
|
|
21894
21918
|
: compat
|
|
21895
21919
|
? getTags(null, compat)
|
|
21896
21920
|
: null;
|
|
21921
|
+
this.merge = !!merge;
|
|
21897
21922
|
this.name = (typeof schema === 'string' && schema) || 'core';
|
|
21898
21923
|
this.knownTags = resolveKnownTags ? coreKnownTags : {};
|
|
21899
|
-
this.tags = getTags(customTags, this.name
|
|
21924
|
+
this.tags = getTags(customTags, this.name);
|
|
21900
21925
|
this.toStringOptions = toStringDefaults ?? null;
|
|
21901
21926
|
Object.defineProperty(this, MAP, { value: map });
|
|
21902
21927
|
Object.defineProperty(this, SCALAR$1, { value: string });
|
|
@@ -22021,7 +22046,6 @@ query GetEurekaResults($params: Input_eureka_SearchRequest) {
|
|
|
22021
22046
|
logLevel: 'warn',
|
|
22022
22047
|
prettyErrors: true,
|
|
22023
22048
|
strict: true,
|
|
22024
|
-
stringKeys: false,
|
|
22025
22049
|
uniqueKeys: true,
|
|
22026
22050
|
version: '1.2'
|
|
22027
22051
|
}, options);
|
|
@@ -22245,7 +22269,7 @@ query GetEurekaResults($params: Input_eureka_SearchRequest) {
|
|
|
22245
22269
|
this.directives.yaml.version = '1.1';
|
|
22246
22270
|
else
|
|
22247
22271
|
this.directives = new Directives({ version: '1.1' });
|
|
22248
|
-
opt = { resolveKnownTags: false, schema: 'yaml-1.1' };
|
|
22272
|
+
opt = { merge: true, resolveKnownTags: false, schema: 'yaml-1.1' };
|
|
22249
22273
|
break;
|
|
22250
22274
|
case '1.2':
|
|
22251
22275
|
case 'next':
|
|
@@ -22253,7 +22277,7 @@ query GetEurekaResults($params: Input_eureka_SearchRequest) {
|
|
|
22253
22277
|
this.directives.yaml.version = version;
|
|
22254
22278
|
else
|
|
22255
22279
|
this.directives = new Directives({ version });
|
|
22256
|
-
opt = { resolveKnownTags: true, schema: 'core' };
|
|
22280
|
+
opt = { merge: false, resolveKnownTags: true, schema: 'core' };
|
|
22257
22281
|
break;
|
|
22258
22282
|
case null:
|
|
22259
22283
|
if (this.directives)
|
|
@@ -22431,7 +22455,7 @@ query GetEurekaResults($params: Input_eureka_SearchRequest) {
|
|
|
22431
22455
|
if (atNewline) {
|
|
22432
22456
|
if (comment)
|
|
22433
22457
|
comment += token.source;
|
|
22434
|
-
else
|
|
22458
|
+
else
|
|
22435
22459
|
spaceBefore = true;
|
|
22436
22460
|
}
|
|
22437
22461
|
else
|
|
@@ -22448,7 +22472,8 @@ query GetEurekaResults($params: Input_eureka_SearchRequest) {
|
|
|
22448
22472
|
if (token.source.endsWith(':'))
|
|
22449
22473
|
onError(token.offset + token.source.length - 1, 'BAD_ALIAS', 'Anchor ending in : is ambiguous', true);
|
|
22450
22474
|
anchor = token;
|
|
22451
|
-
|
|
22475
|
+
if (start === null)
|
|
22476
|
+
start = token.offset;
|
|
22452
22477
|
atNewline = false;
|
|
22453
22478
|
hasSpace = false;
|
|
22454
22479
|
reqSpace = true;
|
|
@@ -22457,7 +22482,8 @@ query GetEurekaResults($params: Input_eureka_SearchRequest) {
|
|
|
22457
22482
|
if (tag)
|
|
22458
22483
|
onError(token, 'MULTIPLE_TAGS', 'A node can have at most one tag');
|
|
22459
22484
|
tag = token;
|
|
22460
|
-
|
|
22485
|
+
if (start === null)
|
|
22486
|
+
start = token.offset;
|
|
22461
22487
|
atNewline = false;
|
|
22462
22488
|
hasSpace = false;
|
|
22463
22489
|
reqSpace = true;
|
|
@@ -22570,7 +22596,11 @@ query GetEurekaResults($params: Input_eureka_SearchRequest) {
|
|
|
22570
22596
|
return false;
|
|
22571
22597
|
const isEqual = typeof uniqueKeys === 'function'
|
|
22572
22598
|
? uniqueKeys
|
|
22573
|
-
: (a, b) => a === b ||
|
|
22599
|
+
: (a, b) => a === b ||
|
|
22600
|
+
(isScalar$1(a) &&
|
|
22601
|
+
isScalar$1(b) &&
|
|
22602
|
+
a.value === b.value &&
|
|
22603
|
+
!(a.value === '<<' && ctx.schema.merge));
|
|
22574
22604
|
return items.some(pair => isEqual(pair.key, search));
|
|
22575
22605
|
}
|
|
22576
22606
|
|
|
@@ -22619,14 +22649,12 @@ query GetEurekaResults($params: Input_eureka_SearchRequest) {
|
|
|
22619
22649
|
onError(offset, 'BAD_INDENT', startColMsg);
|
|
22620
22650
|
}
|
|
22621
22651
|
// key value
|
|
22622
|
-
ctx.atKey = true;
|
|
22623
22652
|
const keyStart = keyProps.end;
|
|
22624
22653
|
const keyNode = key
|
|
22625
22654
|
? composeNode(ctx, key, keyProps, onError)
|
|
22626
22655
|
: composeEmptyNode(ctx, keyStart, start, null, keyProps, onError);
|
|
22627
22656
|
if (ctx.schema.compat)
|
|
22628
22657
|
flowIndentCheck(bm.indent, key, onError);
|
|
22629
|
-
ctx.atKey = false;
|
|
22630
22658
|
if (mapIncludes(ctx, map.items, keyNode))
|
|
22631
22659
|
onError(keyStart, 'DUPLICATE_KEY', 'Map keys must be unique');
|
|
22632
22660
|
// value properties
|
|
@@ -22686,8 +22714,6 @@ query GetEurekaResults($params: Input_eureka_SearchRequest) {
|
|
|
22686
22714
|
const seq = new NodeClass(ctx.schema);
|
|
22687
22715
|
if (ctx.atRoot)
|
|
22688
22716
|
ctx.atRoot = false;
|
|
22689
|
-
if (ctx.atKey)
|
|
22690
|
-
ctx.atKey = false;
|
|
22691
22717
|
let offset = bs.offset;
|
|
22692
22718
|
let commentEnd = null;
|
|
22693
22719
|
for (const { start, value } of bs.items) {
|
|
@@ -22772,8 +22798,6 @@ query GetEurekaResults($params: Input_eureka_SearchRequest) {
|
|
|
22772
22798
|
const atRoot = ctx.atRoot;
|
|
22773
22799
|
if (atRoot)
|
|
22774
22800
|
ctx.atRoot = false;
|
|
22775
|
-
if (ctx.atKey)
|
|
22776
|
-
ctx.atKey = false;
|
|
22777
22801
|
let offset = fc.offset + fc.start.source.length;
|
|
22778
22802
|
for (let i = 0; i < fc.items.length; ++i) {
|
|
22779
22803
|
const collItem = fc.items[i];
|
|
@@ -22853,14 +22877,12 @@ query GetEurekaResults($params: Input_eureka_SearchRequest) {
|
|
|
22853
22877
|
else {
|
|
22854
22878
|
// item is a key+value pair
|
|
22855
22879
|
// key value
|
|
22856
|
-
ctx.atKey = true;
|
|
22857
22880
|
const keyStart = props.end;
|
|
22858
22881
|
const keyNode = key
|
|
22859
22882
|
? composeNode(ctx, key, props, onError)
|
|
22860
22883
|
: composeEmptyNode(ctx, keyStart, start, null, props, onError);
|
|
22861
22884
|
if (isBlock(key))
|
|
22862
22885
|
onError(keyNode.range, 'BLOCK_IN_FLOW', blockMsg);
|
|
22863
|
-
ctx.atKey = false;
|
|
22864
22886
|
// value properties
|
|
22865
22887
|
const valueProps = resolveProps(sep ?? [], {
|
|
22866
22888
|
flow: fcName,
|
|
@@ -23016,8 +23038,8 @@ query GetEurekaResults($params: Input_eureka_SearchRequest) {
|
|
|
23016
23038
|
tag = kt;
|
|
23017
23039
|
}
|
|
23018
23040
|
else {
|
|
23019
|
-
if (kt) {
|
|
23020
|
-
onError(tagToken, 'BAD_COLLECTION_TYPE', `${kt.tag} used for ${expType} collection, but expects ${kt.collection
|
|
23041
|
+
if (kt?.collection) {
|
|
23042
|
+
onError(tagToken, 'BAD_COLLECTION_TYPE', `${kt.tag} used for ${expType} collection, but expects ${kt.collection}`, true);
|
|
23021
23043
|
}
|
|
23022
23044
|
else {
|
|
23023
23045
|
onError(tagToken, 'TAG_RESOLVE_FAILED', `Unresolved tag: ${tagName}`, true);
|
|
@@ -23458,16 +23480,11 @@ query GetEurekaResults($params: Input_eureka_SearchRequest) {
|
|
|
23458
23480
|
const tagName = tagToken
|
|
23459
23481
|
? ctx.directives.tagName(tagToken.source, msg => onError(tagToken, 'TAG_RESOLVE_FAILED', msg))
|
|
23460
23482
|
: null;
|
|
23461
|
-
|
|
23462
|
-
|
|
23463
|
-
|
|
23464
|
-
|
|
23465
|
-
|
|
23466
|
-
tag = findScalarTagByName(ctx.schema, value, tagName, tagToken, onError);
|
|
23467
|
-
else if (token.type === 'scalar')
|
|
23468
|
-
tag = findScalarTagByTest(ctx, value, token, onError);
|
|
23469
|
-
else
|
|
23470
|
-
tag = ctx.schema[SCALAR$1];
|
|
23483
|
+
const tag = tagToken && tagName
|
|
23484
|
+
? findScalarTagByName(ctx.schema, value, tagName, tagToken, onError)
|
|
23485
|
+
: token.type === 'scalar'
|
|
23486
|
+
? findScalarTagByTest(ctx, value, token, onError)
|
|
23487
|
+
: ctx.schema[SCALAR$1];
|
|
23471
23488
|
let scalar;
|
|
23472
23489
|
try {
|
|
23473
23490
|
const res = tag.resolve(value, msg => onError(tagToken ?? token, 'TAG_RESOLVE_FAILED', msg), ctx.options);
|
|
@@ -23515,9 +23532,8 @@ query GetEurekaResults($params: Input_eureka_SearchRequest) {
|
|
|
23515
23532
|
onError(tagToken, 'TAG_RESOLVE_FAILED', `Unresolved tag: ${tagName}`, tagName !== 'tag:yaml.org,2002:str');
|
|
23516
23533
|
return schema[SCALAR$1];
|
|
23517
23534
|
}
|
|
23518
|
-
function findScalarTagByTest({
|
|
23519
|
-
const tag = schema.tags.find(tag =>
|
|
23520
|
-
tag.test?.test(value)) || schema[SCALAR$1];
|
|
23535
|
+
function findScalarTagByTest({ directives, schema }, value, token, onError) {
|
|
23536
|
+
const tag = schema.tags.find(tag => tag.default && tag.test?.test(value)) || schema[SCALAR$1];
|
|
23521
23537
|
if (schema.compat) {
|
|
23522
23538
|
const compat = schema.compat.find(tag => tag.default && tag.test?.test(value)) ??
|
|
23523
23539
|
schema[SCALAR$1];
|
|
@@ -23533,7 +23549,8 @@ query GetEurekaResults($params: Input_eureka_SearchRequest) {
|
|
|
23533
23549
|
|
|
23534
23550
|
function emptyScalarPosition(offset, before, pos) {
|
|
23535
23551
|
if (before) {
|
|
23536
|
-
|
|
23552
|
+
if (pos === null)
|
|
23553
|
+
pos = before.length;
|
|
23537
23554
|
for (let i = pos - 1; i >= 0; --i) {
|
|
23538
23555
|
let st = before[i];
|
|
23539
23556
|
switch (st.type) {
|
|
@@ -23558,7 +23575,6 @@ query GetEurekaResults($params: Input_eureka_SearchRequest) {
|
|
|
23558
23575
|
|
|
23559
23576
|
const CN = { composeNode, composeEmptyNode };
|
|
23560
23577
|
function composeNode(ctx, token, props, onError) {
|
|
23561
|
-
const atKey = ctx.atKey;
|
|
23562
23578
|
const { spaceBefore, comment, anchor, tag } = props;
|
|
23563
23579
|
let node;
|
|
23564
23580
|
let isSrcToken = true;
|
|
@@ -23594,14 +23610,6 @@ query GetEurekaResults($params: Input_eureka_SearchRequest) {
|
|
|
23594
23610
|
}
|
|
23595
23611
|
if (anchor && node.anchor === '')
|
|
23596
23612
|
onError(anchor, 'BAD_ALIAS', 'Anchor cannot be an empty string');
|
|
23597
|
-
if (atKey &&
|
|
23598
|
-
ctx.options.stringKeys &&
|
|
23599
|
-
(!isScalar$1(node) ||
|
|
23600
|
-
typeof node.value !== 'string' ||
|
|
23601
|
-
(node.tag && node.tag !== 'tag:yaml.org,2002:str'))) {
|
|
23602
|
-
const msg = 'With stringKeys, all keys must be strings';
|
|
23603
|
-
onError(tag ?? token, 'NON_STRING_KEY', msg);
|
|
23604
|
-
}
|
|
23605
23613
|
if (spaceBefore)
|
|
23606
23614
|
node.spaceBefore = true;
|
|
23607
23615
|
if (comment) {
|
|
@@ -23654,7 +23662,6 @@ query GetEurekaResults($params: Input_eureka_SearchRequest) {
|
|
|
23654
23662
|
const opts = Object.assign({ _directives: directives }, options);
|
|
23655
23663
|
const doc = new Document(undefined, opts);
|
|
23656
23664
|
const ctx = {
|
|
23657
|
-
atKey: false,
|
|
23658
23665
|
atRoot: true,
|
|
23659
23666
|
directives: doc.directives,
|
|
23660
23667
|
options: doc.options,
|
|
@@ -25789,20 +25796,7 @@ query GetEurekaResults($params: Input_eureka_SearchRequest) {
|
|
|
25789
25796
|
default: {
|
|
25790
25797
|
const bv = this.startBlockValue(map);
|
|
25791
25798
|
if (bv) {
|
|
25792
|
-
if (bv.type
|
|
25793
|
-
if (!it.explicitKey &&
|
|
25794
|
-
it.sep &&
|
|
25795
|
-
!includesToken(it.sep, 'newline')) {
|
|
25796
|
-
yield* this.pop({
|
|
25797
|
-
type: 'error',
|
|
25798
|
-
offset: this.offset,
|
|
25799
|
-
message: 'Unexpected block-seq-ind on same line with key',
|
|
25800
|
-
source: this.source
|
|
25801
|
-
});
|
|
25802
|
-
return;
|
|
25803
|
-
}
|
|
25804
|
-
}
|
|
25805
|
-
else if (atMapIndent) {
|
|
25799
|
+
if (atMapIndent && bv.type !== 'block-seq') {
|
|
25806
25800
|
map.items.push({ start });
|
|
25807
25801
|
}
|
|
25808
25802
|
this.stack.push(bv);
|
|
@@ -26173,8 +26167,6 @@ query GetEurekaResults($params: Input_eureka_SearchRequest) {
|
|
|
26173
26167
|
if (!keepUndefined)
|
|
26174
26168
|
return undefined;
|
|
26175
26169
|
}
|
|
26176
|
-
if (isDocument(value) && !_replacer)
|
|
26177
|
-
return value.toString(options);
|
|
26178
26170
|
return new Document(value, _replacer, options).toString(options);
|
|
26179
26171
|
}
|
|
26180
26172
|
|
|
@@ -26250,8 +26242,8 @@ query GetEurekaResults($params: Input_eureka_SearchRequest) {
|
|
|
26250
26242
|
|
|
26251
26243
|
exports.AnswerService = AnswerService;
|
|
26252
26244
|
exports.AppEmbed = AppEmbed;
|
|
26253
|
-
exports.BodylessConversation =
|
|
26254
|
-
exports.ConversationEmbed =
|
|
26245
|
+
exports.BodylessConversation = BodylessConversation;
|
|
26246
|
+
exports.ConversationEmbed = ConversationEmbed;
|
|
26255
26247
|
exports.LiveboardEmbed = LiveboardEmbed;
|
|
26256
26248
|
exports.MIXPANEL_EVENT = MIXPANEL_EVENT;
|
|
26257
26249
|
exports.PinboardEmbed = PinboardEmbed;
|