@sisense/sdk-ui 1.30.0 → 1.32.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/dist/ai.cjs +22 -421
- package/dist/ai.js +1825 -1769
- package/dist/analytics-composer.cjs +58 -58
- package/dist/analytics-composer.js +312 -290
- package/dist/derive-chart-family-7Fxxf6Sy.cjs +758 -0
- package/dist/derive-chart-family-CVwj-7u5.js +100883 -0
- package/dist/index.cjs +27 -833
- package/dist/index.js +11550 -9945
- package/dist/packages/sdk-ui/src/ai/api/chat-rest-api.d.ts +1 -3
- package/dist/packages/sdk-ui/src/ai/api/types.d.ts +6 -0
- package/dist/packages/sdk-ui/src/ai/chatbot.d.ts +2 -2
- package/dist/packages/sdk-ui/src/ai/custom-ai-context-provider.d.ts +13 -0
- package/dist/packages/sdk-ui/src/ai/index.d.ts +7 -4
- package/dist/packages/sdk-ui/src/ai/use-get-nlg-insights.d.ts +2 -0
- package/dist/packages/sdk-ui/src/ai/use-get-nlq-result.d.ts +12 -5
- package/dist/packages/sdk-ui/src/ai/use-get-query-recommendations.d.ts +9 -5
- package/dist/packages/sdk-ui/src/analytics-composer/common/constants.d.ts +1 -0
- package/dist/packages/sdk-ui/src/analytics-composer/types.d.ts +13 -6
- package/dist/packages/sdk-ui/src/api/rest-api.d.ts +11 -1
- package/dist/packages/sdk-ui/src/app/client-application.d.ts +15 -0
- package/dist/packages/sdk-ui/src/chart/helpers/get-load-data-function.d.ts +16 -0
- package/dist/packages/sdk-ui/src/chart/helpers/use-chart-data-preparation.d.ts +17 -0
- package/dist/packages/sdk-ui/src/chart/helpers/use-synced-data.d.ts +3 -1
- package/dist/packages/sdk-ui/src/chart/index.d.ts +1 -0
- package/dist/packages/sdk-ui/src/chart/restructured-charts/areamap-chart/areamap-chart-builder.d.ts +2 -0
- package/dist/packages/sdk-ui/src/chart/restructured-charts/areamap-chart/data/areamap-data.d.ts +4 -0
- package/dist/packages/sdk-ui/src/chart/restructured-charts/areamap-chart/data/geo-data-coloring-function.d.ts +2 -0
- package/dist/packages/sdk-ui/src/chart/restructured-charts/areamap-chart/data/index.d.ts +2 -0
- package/dist/packages/sdk-ui/src/chart/restructured-charts/areamap-chart/data-options/data-options.d.ts +2 -0
- package/dist/packages/sdk-ui/src/chart/restructured-charts/areamap-chart/data-options/index.d.ts +1 -0
- package/dist/packages/sdk-ui/src/chart/restructured-charts/areamap-chart/design-options/design-options.d.ts +2 -0
- package/dist/packages/sdk-ui/src/chart/restructured-charts/areamap-chart/design-options/index.d.ts +1 -0
- package/dist/packages/sdk-ui/src/{charts/map-charts/areamap → chart/restructured-charts/areamap-chart/renderer}/areamap-map.d.ts +2 -2
- package/dist/packages/sdk-ui/src/chart/restructured-charts/areamap-chart/renderer/areamap-utils.d.ts +12 -0
- package/dist/packages/sdk-ui/src/{charts/map-charts/areamap → chart/restructured-charts/areamap-chart/renderer}/areamap.d.ts +5 -5
- package/dist/packages/sdk-ui/src/{charts/map-charts/areamap → chart/restructured-charts/areamap-chart/renderer}/feature-styles-dictionary.d.ts +2 -2
- package/dist/packages/sdk-ui/src/chart/restructured-charts/areamap-chart/renderer/index.d.ts +1 -0
- package/dist/packages/sdk-ui/src/{charts/map-charts/areamap → chart/restructured-charts/areamap-chart/renderer}/use-geo-json.d.ts +1 -1
- package/dist/packages/sdk-ui/src/chart/restructured-charts/areamap-chart/types.d.ts +35 -0
- package/dist/packages/sdk-ui/src/chart/restructured-charts/bar-chart/bar-chart-builder.d.ts +2 -0
- package/dist/packages/sdk-ui/src/chart/restructured-charts/chart-builder-factory.d.ts +3 -0
- package/dist/packages/sdk-ui/src/chart/restructured-charts/column-chart/column-chart-builder.d.ts +2 -0
- package/dist/packages/sdk-ui/src/chart/restructured-charts/helpers/cartesians/data-options.d.ts +27 -0
- package/dist/packages/sdk-ui/src/chart/restructured-charts/helpers/cartesians/data.d.ts +4 -0
- package/dist/packages/sdk-ui/src/chart/restructured-charts/helpers/cartesians/stackable/design-options.d.ts +5 -0
- package/dist/packages/sdk-ui/src/chart/restructured-charts/helpers/data-loading.d.ts +12 -0
- package/dist/packages/sdk-ui/src/chart/restructured-charts/types.d.ts +100 -0
- package/dist/packages/sdk-ui/src/chart/restructured-charts/utils.d.ts +3 -0
- package/dist/packages/sdk-ui/src/chart-data/chart-data-service.d.ts +1 -13
- package/dist/packages/sdk-ui/src/chart-data/types.d.ts +3 -29
- package/dist/packages/sdk-ui/src/chart-options-processor/style-to-design-options-translator/prepare-design-options.d.ts +6 -3
- package/dist/packages/sdk-ui/src/chart-options-processor/style-to-design-options-translator/translate-to-highcharts-options.d.ts +9 -8
- package/dist/packages/sdk-ui/src/chart-options-processor/translations/design-options.d.ts +1 -7
- package/dist/packages/sdk-ui/src/chart-options-processor/translations/tooltip-utils.d.ts +2 -3
- package/dist/packages/sdk-ui/src/chart-options-processor/translations/types.d.ts +2 -1
- package/dist/packages/sdk-ui/src/common/components/popper.d.ts +9 -0
- package/dist/packages/sdk-ui/src/common/hooks/fusion-endpoints/use-get-data-source-fields.d.ts +14 -0
- package/dist/packages/sdk-ui/src/common/hooks/use-was-modified.d.ts +5 -0
- package/dist/packages/sdk-ui/src/const.d.ts +1 -0
- package/dist/packages/sdk-ui/src/dashboard/hooks/use-tabber.d.ts +18 -0
- package/dist/packages/sdk-ui/src/dashboard/hooks/use-widgets-layout.d.ts +14 -0
- package/dist/packages/sdk-ui/src/dashboard/types.d.ts +7 -2
- package/dist/packages/sdk-ui/src/dashboard/use-composed-dashboard.d.ts +7 -2
- package/dist/packages/sdk-ui/src/filters/components/criteria-filter-tile/criteria-filter-operations.d.ts +19 -19
- package/dist/packages/sdk-ui/src/filters/components/criteria-filter-tile/criteria-filter-tile.d.ts +1 -1
- package/dist/packages/sdk-ui/src/filters/components/date-filter/date-filter/calendar-date-selector.d.ts +8 -7
- package/dist/packages/sdk-ui/src/filters/components/date-filter/date-filter/date-range-calculator.d.ts +1 -1
- package/dist/packages/sdk-ui/src/filters/components/date-filter/date-range-filter-tile/date-range-filter-tile.d.ts +3 -0
- package/dist/packages/sdk-ui/src/filters/components/date-filter/relative-date-filter-tile/relative-date-filter-tile.d.ts +1 -1
- package/dist/packages/sdk-ui/src/filters/components/filter-editor-popover/common/input.d.ts +11 -3
- package/dist/packages/sdk-ui/src/filters/components/filter-editor-popover/common/scroll-wrapper.d.ts +13 -0
- package/dist/packages/sdk-ui/src/filters/components/filter-editor-popover/common/search-input.d.ts +4 -0
- package/dist/packages/sdk-ui/src/filters/components/filter-editor-popover/common/select/base.d.ts +5 -1
- package/dist/packages/sdk-ui/src/filters/components/filter-editor-popover/common/select/calendar-select/calendar-select.d.ts +27 -0
- package/dist/packages/sdk-ui/src/filters/components/filter-editor-popover/common/select/calendar-select/index.d.ts +2 -0
- package/dist/packages/sdk-ui/src/filters/components/filter-editor-popover/common/select/calendar-select/types.d.ts +14 -0
- package/dist/packages/sdk-ui/src/filters/components/filter-editor-popover/common/select/calendar-select/utils.d.ts +5 -0
- package/dist/packages/sdk-ui/src/filters/components/filter-editor-popover/common/select/members-list-select.d.ts +11 -0
- package/dist/packages/sdk-ui/src/filters/components/filter-editor-popover/common/select/searchable-multi-select.d.ts +5 -0
- package/dist/packages/sdk-ui/src/filters/components/filter-editor-popover/common/select/searchable-single-select.d.ts +21 -1
- package/dist/packages/sdk-ui/src/filters/components/filter-editor-popover/common/select/single-select.d.ts +3 -2
- package/dist/packages/sdk-ui/src/filters/components/filter-editor-popover/common/select/types.d.ts +2 -0
- package/dist/packages/sdk-ui/src/filters/components/filter-editor-popover/common/small-loader.d.ts +1 -0
- package/dist/packages/sdk-ui/src/filters/components/filter-editor-popover/constants.d.ts +2 -0
- package/dist/packages/sdk-ui/src/filters/components/filter-editor-popover/filter-editor-container.d.ts +5 -0
- package/dist/packages/sdk-ui/src/filters/components/filter-editor-popover/filter-editor-datetime.d.ts +8 -0
- package/dist/packages/sdk-ui/src/filters/components/filter-editor-popover/filter-editor-numerical.d.ts +8 -0
- package/dist/packages/sdk-ui/src/filters/components/filter-editor-popover/filter-editor-textual.d.ts +8 -0
- package/dist/packages/sdk-ui/src/filters/components/filter-editor-popover/hooks/use-datetime-formatter.d.ts +2 -0
- package/dist/packages/sdk-ui/src/filters/components/filter-editor-popover/hooks/use-get-attribute-stats.d.ts +28 -0
- package/dist/packages/sdk-ui/src/filters/components/filter-editor-popover/sections/common/granularities.d.ts +8 -0
- package/dist/packages/sdk-ui/src/filters/components/filter-editor-popover/sections/datetime-condition-section/condition-forms/datetime-exclude-condition-form.d.ts +11 -0
- package/dist/packages/sdk-ui/src/filters/components/filter-editor-popover/sections/datetime-condition-section/condition-forms/datetime-is-within-condition-form.d.ts +10 -0
- package/dist/packages/sdk-ui/src/filters/components/filter-editor-popover/sections/datetime-condition-section/datetime-condition-section.d.ts +12 -0
- package/dist/packages/sdk-ui/src/filters/components/filter-editor-popover/sections/datetime-condition-section/index.d.ts +1 -0
- package/dist/packages/sdk-ui/src/filters/components/filter-editor-popover/sections/datetime-members-section.d.ts +12 -0
- package/dist/packages/sdk-ui/src/filters/components/filter-editor-popover/sections/datetime-range-section.d.ts +11 -0
- package/dist/packages/sdk-ui/src/filters/components/filter-editor-popover/sections/datetime-relative-section.d.ts +9 -0
- package/dist/packages/sdk-ui/src/filters/components/filter-editor-popover/sections/members-section.d.ts +0 -1
- package/dist/packages/sdk-ui/src/filters/components/filter-editor-popover/sections/numeric-condition-section/index.d.ts +1 -0
- package/dist/packages/sdk-ui/src/filters/components/filter-editor-popover/sections/numeric-condition-section/numeric-condition-section.d.ts +10 -0
- package/dist/packages/sdk-ui/src/filters/components/filter-editor-popover/sections/numeric-condition-section/types.d.ts +16 -0
- package/dist/packages/sdk-ui/src/filters/components/filter-editor-popover/sections/numeric-condition-section/utils.d.ts +7 -0
- package/dist/packages/sdk-ui/src/filters/components/filter-editor-popover/sections/numeric-range-section.d.ts +11 -0
- package/dist/packages/sdk-ui/src/filters/components/filter-editor-popover/sections/text-condition-section.d.ts +4 -2
- package/dist/packages/sdk-ui/src/filters/components/filter-editor-popover/sections/types.d.ts +4 -0
- package/dist/packages/sdk-ui/src/filters/components/filter-editor-popover/sections/utils.d.ts +4 -0
- package/dist/packages/sdk-ui/src/filters/components/filter-editor-popover/utils.d.ts +13 -1
- package/dist/packages/sdk-ui/src/filters/components/icons/date-icon.d.ts +1 -1
- package/dist/packages/sdk-ui/src/filters/components/icons/equal-icon.d.ts +2 -0
- package/dist/packages/sdk-ui/src/filters/components/icons/greater-than-icon.d.ts +2 -0
- package/dist/packages/sdk-ui/src/filters/components/icons/greater-than-or-equal-icon.d.ts +2 -0
- package/dist/packages/sdk-ui/src/filters/components/icons/index.d.ts +6 -0
- package/dist/packages/sdk-ui/src/filters/components/icons/not-equal-icon.d.ts +2 -0
- package/dist/packages/sdk-ui/src/filters/components/icons/smaller-than-icon.d.ts +2 -0
- package/dist/packages/sdk-ui/src/filters/components/icons/smaller-than-or-equal-icon.d.ts +2 -0
- package/dist/packages/sdk-ui/src/filters/components/member-filter-tile/member-filter-tile.d.ts +1 -1
- package/dist/packages/sdk-ui/src/filters/hooks/use-get-filter-members.d.ts +23 -2
- package/dist/packages/sdk-ui/src/index-typedoc.d.ts +28 -0
- package/dist/packages/sdk-ui/src/index.d.ts +1 -0
- package/dist/packages/sdk-ui/src/models/dashboard/dashboard-model.d.ts +7 -1
- package/dist/packages/sdk-ui/src/models/dashboard/translate-dashboard-utils.d.ts +2 -1
- package/dist/packages/sdk-ui/src/models/dashboard/types.d.ts +9 -1
- package/dist/packages/sdk-ui/src/pivot-table/formatters/header-cell-formatters/header-cell-value-formatter.d.ts +1 -1
- package/dist/packages/sdk-ui/src/plugins-provider/custom-plugins-provider.d.ts +8 -8
- package/dist/packages/sdk-ui/src/plugins-provider/plugins-context.d.ts +6 -6
- package/dist/packages/sdk-ui/src/plugins-provider/plugins-provider.d.ts +3 -3
- package/dist/packages/sdk-ui/src/plugins-provider/types.d.ts +2 -1
- package/dist/packages/sdk-ui/src/props.d.ts +35 -15
- package/dist/packages/sdk-ui/src/query-execution/types.d.ts +10 -1
- package/dist/packages/sdk-ui/src/sisense-chart/sisense-chart.d.ts +1 -16
- package/dist/packages/sdk-ui/src/sisense-chart/types.d.ts +16 -1
- package/dist/packages/sdk-ui/src/translation/resources/en.d.ts +51 -0
- package/dist/packages/sdk-ui/src/translation/resources/index.d.ts +102 -0
- package/dist/packages/sdk-ui/src/types.d.ts +52 -1
- package/dist/packages/sdk-ui/src/utils/generate-attribute-name.d.ts +2 -0
- package/dist/packages/sdk-ui/src/utils/is-numeric-string.d.ts +10 -0
- package/dist/packages/sdk-ui/src/utils/utility-types.d.ts +34 -0
- package/dist/packages/sdk-ui/src/widget-by-id/translate-dashboard-filters.d.ts +1 -0
- package/dist/packages/sdk-ui/src/widget-by-id/translate-widget-style-options.d.ts +16 -5
- package/dist/packages/sdk-ui/src/widgets/tabber-widget.d.ts +35 -0
- package/dist/use-common-filters-BanIIIUW.js +28409 -0
- package/dist/use-common-filters-BeKQ1bKU.cjs +271 -0
- package/dist/{widget-composer-Ch2kYMok.js → widget-composer-4bEKHitq.js} +275 -259
- package/dist/widget-composer-NDI4zssI.cjs +316 -0
- package/package.json +11 -9
- package/dist/derive-chart-family-B2J2kMs6.js +0 -44404
- package/dist/derive-chart-family-Bmg9hQGc.cjs +0 -271
- package/dist/packages/sdk-ui/src/ai/use-get-data-source-fields.d.ts +0 -12
- package/dist/packages/sdk-ui/src/chart-data/areamap-data.d.ts +0 -4
- package/dist/packages/sdk-ui/src/chart-data/data-coloring/geo-data-coloring-function.d.ts +0 -2
- package/dist/packages/sdk-ui/src/chart-options-processor/style-to-design-options-translator/translate-to-areamap-options.d.ts +0 -3
- package/dist/packages/sdk-ui/src/charts/map-charts/areamap/areamap-utils.d.ts +0 -11
- package/dist/useQuery-1ixYW8qO.js +0 -83434
- package/dist/useQuery-Ctzmd-JM.cjs +0 -916
- package/dist/widget-composer-CdxKUwZf.cjs +0 -308
- /package/dist/packages/sdk-ui/src/{charts/map-charts/areamap → chart/restructured-charts/areamap-chart/renderer}/alternative-country-names-dictionary.d.ts +0 -0
|
@@ -1,27 +1,26 @@
|
|
|
1
|
-
var
|
|
1
|
+
var zs = Object.defineProperty, xs = Object.defineProperties;
|
|
2
2
|
var Xs = Object.getOwnPropertyDescriptors;
|
|
3
3
|
var Me = Object.getOwnPropertySymbols;
|
|
4
|
-
var
|
|
4
|
+
var Pt = Object.prototype.hasOwnProperty, Dt = Object.prototype.propertyIsEnumerable;
|
|
5
5
|
var rt = (s, e) => (e = Symbol[s]) ? e : Symbol.for("Symbol." + s);
|
|
6
|
-
var
|
|
6
|
+
var jt = (s, e, t) => e in s ? zs(s, e, { enumerable: !0, configurable: !0, writable: !0, value: t }) : s[e] = t, R = (s, e) => {
|
|
7
7
|
for (var t in e || (e = {}))
|
|
8
|
-
|
|
8
|
+
Pt.call(e, t) && jt(s, t, e[t]);
|
|
9
9
|
if (Me)
|
|
10
10
|
for (var t of Me(e))
|
|
11
|
-
|
|
11
|
+
Dt.call(e, t) && jt(s, t, e[t]);
|
|
12
12
|
return s;
|
|
13
|
-
}, G = (s, e) =>
|
|
14
|
-
var
|
|
13
|
+
}, G = (s, e) => xs(s, Xs(e));
|
|
14
|
+
var Kt = (s, e) => {
|
|
15
15
|
var t = {};
|
|
16
16
|
for (var n in s)
|
|
17
|
-
|
|
17
|
+
Pt.call(s, n) && e.indexOf(n) < 0 && (t[n] = s[n]);
|
|
18
18
|
if (s != null && Me)
|
|
19
19
|
for (var n of Me(s))
|
|
20
|
-
e.indexOf(n) < 0 &&
|
|
20
|
+
e.indexOf(n) < 0 && Dt.call(s, n) && (t[n] = s[n]);
|
|
21
21
|
return t;
|
|
22
22
|
};
|
|
23
|
-
var
|
|
24
|
-
var at = (s, e, t) => new Promise((n, i) => {
|
|
23
|
+
var ot = (s, e, t) => new Promise((n, i) => {
|
|
25
24
|
var r = (a) => {
|
|
26
25
|
try {
|
|
27
26
|
l(t.next(a));
|
|
@@ -60,10 +59,10 @@ var d = (s) => {
|
|
|
60
59
|
throw r;
|
|
61
60
|
}, "return" in e && n("return"), i;
|
|
62
61
|
};
|
|
63
|
-
import { s as en, E as
|
|
64
|
-
import { h as ji, j as Pi, i as Di, w as Ki } from "./widget-composer-
|
|
65
|
-
import {
|
|
66
|
-
const
|
|
62
|
+
import { s as en, E as qt, c as tn, p as sn, v as nn, a as Zt, b as es, d as Te, e as ts, f as ss, g as ns } from "./widget-composer-4bEKHitq.js";
|
|
63
|
+
import { h as ji, j as Pi, i as Di, w as Ki } from "./widget-composer-4bEKHitq.js";
|
|
64
|
+
import { aH as rn, ax as on, bx as Ft, cw as ln, dz as an } from "./derive-chart-family-CVwj-7u5.js";
|
|
65
|
+
const St = Symbol.for("yaml.alias"), pt = Symbol.for("yaml.document"), W = Symbol.for("yaml.map"), is = Symbol.for("yaml.pair"), Y = Symbol.for("yaml.scalar"), me = Symbol.for("yaml.seq"), F = Symbol.for("yaml.node.type"), ne = (s) => !!s && typeof s == "object" && s[F] === St, ye = (s) => !!s && typeof s == "object" && s[F] === pt, ge = (s) => !!s && typeof s == "object" && s[F] === W, E = (s) => !!s && typeof s == "object" && s[F] === is, A = (s) => !!s && typeof s == "object" && s[F] === Y, be = (s) => !!s && typeof s == "object" && s[F] === me;
|
|
67
66
|
function $(s) {
|
|
68
67
|
if (s && typeof s == "object")
|
|
69
68
|
switch (s[F]) {
|
|
@@ -76,7 +75,7 @@ function $(s) {
|
|
|
76
75
|
function M(s) {
|
|
77
76
|
if (s && typeof s == "object")
|
|
78
77
|
switch (s[F]) {
|
|
79
|
-
case
|
|
78
|
+
case St:
|
|
80
79
|
case W:
|
|
81
80
|
case Y:
|
|
82
81
|
case me:
|
|
@@ -124,7 +123,7 @@ function le(s, e, t, n) {
|
|
|
124
123
|
return i;
|
|
125
124
|
}
|
|
126
125
|
function Qe(s, e) {
|
|
127
|
-
return
|
|
126
|
+
return ot(this, null, function* () {
|
|
128
127
|
const t = os(e);
|
|
129
128
|
ye(s) ? (yield ae(null, s.contents, t, Object.freeze([s]))) === J && (s.contents = null) : yield ae(null, s, t, Object.freeze([]));
|
|
130
129
|
});
|
|
@@ -133,7 +132,7 @@ Qe.BREAK = D;
|
|
|
133
132
|
Qe.SKIP = rs;
|
|
134
133
|
Qe.REMOVE = J;
|
|
135
134
|
function ae(s, e, t, n) {
|
|
136
|
-
return
|
|
135
|
+
return ot(this, null, function* () {
|
|
137
136
|
const i = yield ls(s, e, t, n);
|
|
138
137
|
if (M(i) || E(i))
|
|
139
138
|
return as(s, n, i), ae(s, i, t, n);
|
|
@@ -415,7 +414,7 @@ function q(s, e, t) {
|
|
|
415
414
|
}
|
|
416
415
|
return typeof s == "bigint" && !(t != null && t.keep) ? Number(s) : s;
|
|
417
416
|
}
|
|
418
|
-
class
|
|
417
|
+
class kt {
|
|
419
418
|
constructor(e) {
|
|
420
419
|
Object.defineProperty(this, F, { value: e });
|
|
421
420
|
}
|
|
@@ -442,9 +441,9 @@ class Ot {
|
|
|
442
441
|
return typeof r == "function" ? ce(r, { "": l }, "", l) : l;
|
|
443
442
|
}
|
|
444
443
|
}
|
|
445
|
-
class Ye extends
|
|
444
|
+
class Ye extends kt {
|
|
446
445
|
constructor(e) {
|
|
447
|
-
super(
|
|
446
|
+
super(St), this.source = e, Object.defineProperty(this, "tag", {
|
|
448
447
|
set() {
|
|
449
448
|
throw new Error("Alias nodes cannot have tags");
|
|
450
449
|
}
|
|
@@ -514,7 +513,7 @@ function De(s, e, t) {
|
|
|
514
513
|
return 1;
|
|
515
514
|
}
|
|
516
515
|
const hs = (s) => !s || typeof s != "function" && typeof s != "object";
|
|
517
|
-
class N extends
|
|
516
|
+
class N extends kt {
|
|
518
517
|
constructor(e) {
|
|
519
518
|
super(Y), this.value = e;
|
|
520
519
|
}
|
|
@@ -594,7 +593,7 @@ function Re(s, e, t) {
|
|
|
594
593
|
});
|
|
595
594
|
}
|
|
596
595
|
const Oe = (s) => s == null || typeof s == "object" && !!s[Symbol.iterator]().next().done;
|
|
597
|
-
class ds extends
|
|
596
|
+
class ds extends kt {
|
|
598
597
|
constructor(e, t) {
|
|
599
598
|
super(e), Object.defineProperty(this, "schema", {
|
|
600
599
|
value: t,
|
|
@@ -696,7 +695,7 @@ function Q(s, e) {
|
|
|
696
695
|
const Z = (s, e, t) => s.endsWith(`
|
|
697
696
|
`) ? Q(t, e) : t.includes(`
|
|
698
697
|
`) ? `
|
|
699
|
-
` + Q(t, e) : (s.endsWith(" ") ? "" : " ") + t, ps = "flow",
|
|
698
|
+
` + Q(t, e) : (s.endsWith(" ") ? "" : " ") + t, ps = "flow", mt = "block", Ke = "quoted";
|
|
700
699
|
function Ge(s, e, t = "flow", { indentAtStart: n, lineWidth: i = 80, minContentWidth: r = 20, onFold: o, onOverflow: l } = {}) {
|
|
701
700
|
if (!i || i < 0)
|
|
702
701
|
return s;
|
|
@@ -708,7 +707,7 @@ function Ge(s, e, t = "flow", { indentAtStart: n, lineWidth: i = 80, minContentW
|
|
|
708
707
|
let f = i - e.length;
|
|
709
708
|
typeof n == "number" && (n > i - Math.max(2, r) ? c.push(0) : f = i - n);
|
|
710
709
|
let p, m, y = !1, u = -1, g = -1, b = -1;
|
|
711
|
-
t ===
|
|
710
|
+
t === mt && (u = Rt(s, u, e.length), u !== -1 && (f = u + a));
|
|
712
711
|
for (let I; I = s[u += 1]; ) {
|
|
713
712
|
if (t === Ke && I === "\\") {
|
|
714
713
|
switch (g = u, s[u + 1]) {
|
|
@@ -728,7 +727,7 @@ function Ge(s, e, t = "flow", { indentAtStart: n, lineWidth: i = 80, minContentW
|
|
|
728
727
|
}
|
|
729
728
|
if (I === `
|
|
730
729
|
`)
|
|
731
|
-
t ===
|
|
730
|
+
t === mt && (u = Rt(s, u, e.length)), f = u + e.length + a, p = void 0;
|
|
732
731
|
else {
|
|
733
732
|
if (I === " " && m && m !== " " && m !== `
|
|
734
733
|
` && m !== " ") {
|
|
@@ -763,7 +762,7 @@ ${e}${s.slice(k + 1, O)}`);
|
|
|
763
762
|
}
|
|
764
763
|
return S;
|
|
765
764
|
}
|
|
766
|
-
function
|
|
765
|
+
function Rt(s, e, t) {
|
|
767
766
|
let n = e, i = e + 1, r = s[i];
|
|
768
767
|
for (; r === " " || r === " "; )
|
|
769
768
|
if (e < i + t)
|
|
@@ -859,7 +858,7 @@ function Ie(s, e) {
|
|
|
859
858
|
}
|
|
860
859
|
return o = l ? o + t.slice(l) : t, n ? o : Ge(o, r, Ke, We(e, !1));
|
|
861
860
|
}
|
|
862
|
-
function
|
|
861
|
+
function yt(s, e) {
|
|
863
862
|
if (e.options.singleQuote === !1 || e.implicitKey && s.includes(`
|
|
864
863
|
`) || /[ \t]\n|\n[ \t]/.test(s))
|
|
865
864
|
return Ie(s, e);
|
|
@@ -874,18 +873,18 @@ function fe(s, e) {
|
|
|
874
873
|
n = Ie;
|
|
875
874
|
else {
|
|
876
875
|
const i = s.includes('"'), r = s.includes("'");
|
|
877
|
-
i && !r ? n =
|
|
876
|
+
i && !r ? n = yt : r && !i ? n = Ie : n = t ? yt : Ie;
|
|
878
877
|
}
|
|
879
878
|
return n(s, e);
|
|
880
879
|
}
|
|
881
|
-
let
|
|
880
|
+
let gt;
|
|
882
881
|
try {
|
|
883
|
-
|
|
882
|
+
gt = new RegExp(`(^|(?<!
|
|
884
883
|
))
|
|
885
884
|
+(?!
|
|
886
885
|
|$)`, "g");
|
|
887
886
|
} catch (s) {
|
|
888
|
-
|
|
887
|
+
gt = /\n+(?!\n|$)/g;
|
|
889
888
|
}
|
|
890
889
|
function qe({ comment: s, type: e, value: t }, n, i, r) {
|
|
891
890
|
const { blockQuote: o, commentString: l, lineWidth: a } = n.options;
|
|
@@ -907,7 +906,7 @@ function qe({ comment: s, type: e, value: t }, n, i, r) {
|
|
|
907
906
|
const y = m.indexOf(`
|
|
908
907
|
`);
|
|
909
908
|
y === -1 ? f = "-" : t === m || y !== m.length - 1 ? (f = "+", r && r()) : f = "", m && (t = t.slice(0, -m.length), m[m.length - 1] === `
|
|
910
|
-
` && (m = m.slice(0, -1)), m = m.replace(
|
|
909
|
+
` && (m = m.slice(0, -1)), m = m.replace(gt, `$&${c}`));
|
|
911
910
|
let u = !1, g, b = -1;
|
|
912
911
|
for (g = 0; g < t.length; ++g) {
|
|
913
912
|
const T = t[g];
|
|
@@ -927,7 +926,7 @@ function qe({ comment: s, type: e, value: t }, n, i, r) {
|
|
|
927
926
|
${c}${S}${t}${m}`;
|
|
928
927
|
t = t.replace(/\n+/g, `
|
|
929
928
|
$&`).replace(/(?:^|\n)([\t ].*)(?:([\n\t ]*)\n(?![\n\t ]))?/g, "$1$2").replace(/\n+/g, `$&${c}`);
|
|
930
|
-
const O = Ge(`${S}${t}${m}`, c,
|
|
929
|
+
const O = Ge(`${S}${t}${m}`, c, mt, We(n, !0));
|
|
931
930
|
return `${k}
|
|
932
931
|
${c}${O}`;
|
|
933
932
|
}
|
|
@@ -972,7 +971,7 @@ function $e(s, e, t, n) {
|
|
|
972
971
|
case N.QUOTE_DOUBLE:
|
|
973
972
|
return Ie(o.value, e);
|
|
974
973
|
case N.QUOTE_SINGLE:
|
|
975
|
-
return
|
|
974
|
+
return yt(o.value, e);
|
|
976
975
|
case N.PLAIN:
|
|
977
976
|
return gn(o, e, t, n);
|
|
978
977
|
default:
|
|
@@ -1129,8 +1128,8 @@ ${Q(L, t.indent)}`;
|
|
|
1129
1128
|
${t.indent}`;
|
|
1130
1129
|
} else if (!m && $(e)) {
|
|
1131
1130
|
const L = O[0], _ = O.indexOf(`
|
|
1132
|
-
`), B = _ !== -1,
|
|
1133
|
-
if (B || !
|
|
1131
|
+
`), B = _ !== -1, x = (w = (C = t.inFlow) != null ? C : e.flow) != null ? w : e.items.length === 0;
|
|
1132
|
+
if (B || !x) {
|
|
1134
1133
|
let ie = !1;
|
|
1135
1134
|
if (B && (L === "&" || L === "!")) {
|
|
1136
1135
|
let v = O.indexOf(" ");
|
|
@@ -1147,17 +1146,17 @@ ${t.indent}`);
|
|
|
1147
1146
|
function ys(s, e) {
|
|
1148
1147
|
(s === "debug" || s === "warn") && (typeof process != "undefined" && process.emitWarning ? process.emitWarning(e) : console.warn(e));
|
|
1149
1148
|
}
|
|
1150
|
-
const
|
|
1149
|
+
const Ut = "<<";
|
|
1151
1150
|
function gs(s, e, { key: t, value: n }) {
|
|
1152
1151
|
if (s != null && s.doc.schema.merge && kn(t))
|
|
1153
1152
|
if (n = ne(n) ? n.resolve(s.doc) : n, be(n))
|
|
1154
1153
|
for (const i of n.items)
|
|
1155
|
-
|
|
1154
|
+
lt(s, e, i);
|
|
1156
1155
|
else if (Array.isArray(n))
|
|
1157
1156
|
for (const i of n)
|
|
1158
|
-
|
|
1157
|
+
lt(s, e, i);
|
|
1159
1158
|
else
|
|
1160
|
-
|
|
1159
|
+
lt(s, e, n);
|
|
1161
1160
|
else {
|
|
1162
1161
|
const i = q(t, "", s);
|
|
1163
1162
|
if (e instanceof Map)
|
|
@@ -1176,8 +1175,8 @@ function gs(s, e, { key: t, value: n }) {
|
|
|
1176
1175
|
}
|
|
1177
1176
|
return e;
|
|
1178
1177
|
}
|
|
1179
|
-
const kn = (s) => s ===
|
|
1180
|
-
function
|
|
1178
|
+
const kn = (s) => s === Ut || A(s) && s.value === Ut && (!s.type || s.type === N.PLAIN);
|
|
1179
|
+
function lt(s, e, t) {
|
|
1181
1180
|
const n = s && ne(t) ? t.resolve(s.doc) : t;
|
|
1182
1181
|
if (!ge(n))
|
|
1183
1182
|
throw new Error("Merge sources must be maps or map aliases");
|
|
@@ -1211,7 +1210,7 @@ function Nn(s, e, t) {
|
|
|
1211
1210
|
}
|
|
1212
1211
|
return JSON.stringify(e);
|
|
1213
1212
|
}
|
|
1214
|
-
function
|
|
1213
|
+
function Nt(s, e, t) {
|
|
1215
1214
|
const n = Ae(s, void 0, t), i = Ae(e, void 0, t);
|
|
1216
1215
|
return new j(n, i);
|
|
1217
1216
|
}
|
|
@@ -1340,7 +1339,7 @@ class K extends ds {
|
|
|
1340
1339
|
c = r.call(t, a, c);
|
|
1341
1340
|
else if (Array.isArray(r) && !r.includes(a))
|
|
1342
1341
|
return;
|
|
1343
|
-
(c !== void 0 || i) && o.items.push(
|
|
1342
|
+
(c !== void 0 || i) && o.items.push(Nt(a, c, n));
|
|
1344
1343
|
};
|
|
1345
1344
|
if (t instanceof Map)
|
|
1346
1345
|
for (const [a, c] of t)
|
|
@@ -1423,7 +1422,7 @@ const we = {
|
|
|
1423
1422
|
},
|
|
1424
1423
|
createNode: (s, e, t) => K.from(s, e, t)
|
|
1425
1424
|
};
|
|
1426
|
-
class
|
|
1425
|
+
class z extends ds {
|
|
1427
1426
|
static get tagName() {
|
|
1428
1427
|
return "tag:yaml.org,2002:seq";
|
|
1429
1428
|
}
|
|
@@ -1515,13 +1514,13 @@ function ve(s) {
|
|
|
1515
1514
|
const Se = {
|
|
1516
1515
|
collection: "seq",
|
|
1517
1516
|
default: !0,
|
|
1518
|
-
nodeClass:
|
|
1517
|
+
nodeClass: z,
|
|
1519
1518
|
tag: "tag:yaml.org,2002:seq",
|
|
1520
1519
|
resolve(s, e) {
|
|
1521
1520
|
return be(s) || e("Expected a sequence for this tag"), s;
|
|
1522
1521
|
},
|
|
1523
|
-
createNode: (s, e, t) =>
|
|
1524
|
-
},
|
|
1522
|
+
createNode: (s, e, t) => z.from(s, e, t)
|
|
1523
|
+
}, ze = {
|
|
1525
1524
|
identify: (s) => typeof s == "string",
|
|
1526
1525
|
default: !0,
|
|
1527
1526
|
tag: "tag:yaml.org,2002:str",
|
|
@@ -1529,22 +1528,22 @@ const Se = {
|
|
|
1529
1528
|
stringify(s, e, t, n) {
|
|
1530
1529
|
return e = Object.assign({ actualString: !0 }, e), $e(s, e, t, n);
|
|
1531
1530
|
}
|
|
1532
|
-
},
|
|
1531
|
+
}, xe = {
|
|
1533
1532
|
identify: (s) => s == null,
|
|
1534
1533
|
createNode: () => new N(null),
|
|
1535
1534
|
default: !0,
|
|
1536
1535
|
tag: "tag:yaml.org,2002:null",
|
|
1537
1536
|
test: /^(?:~|[Nn]ull|NULL)?$/,
|
|
1538
1537
|
resolve: () => new N(null),
|
|
1539
|
-
stringify: ({ source: s }, e) => typeof s == "string" &&
|
|
1540
|
-
},
|
|
1538
|
+
stringify: ({ source: s }, e) => typeof s == "string" && xe.test.test(s) ? s : e.options.nullStr
|
|
1539
|
+
}, Ot = {
|
|
1541
1540
|
identify: (s) => typeof s == "boolean",
|
|
1542
1541
|
default: !0,
|
|
1543
1542
|
tag: "tag:yaml.org,2002:bool",
|
|
1544
1543
|
test: /^(?:[Tt]rue|TRUE|[Ff]alse|FALSE)$/,
|
|
1545
1544
|
resolve: (s) => new N(s[0] === "t" || s[0] === "T"),
|
|
1546
1545
|
stringify({ source: s, value: e }, t) {
|
|
1547
|
-
if (s &&
|
|
1546
|
+
if (s && Ot.test.test(s)) {
|
|
1548
1547
|
const n = s[0] === "t" || s[0] === "T";
|
|
1549
1548
|
if (e === n)
|
|
1550
1549
|
return s;
|
|
@@ -1596,7 +1595,7 @@ const ws = {
|
|
|
1596
1595
|
return t !== -1 && s[s.length - 1] === "0" && (e.minFractionDigits = s.length - t - 1), e;
|
|
1597
1596
|
},
|
|
1598
1597
|
stringify: V
|
|
1599
|
-
}, Xe = (s) => typeof s == "bigint" || Number.isInteger(s),
|
|
1598
|
+
}, Xe = (s) => typeof s == "bigint" || Number.isInteger(s), Tt = (s, e, t, { intAsBigInt: n }) => n ? BigInt(s) : parseInt(s.substring(e), t);
|
|
1600
1599
|
function Ns(s, e, t) {
|
|
1601
1600
|
const { value: n } = s;
|
|
1602
1601
|
return Xe(n) && n >= 0 ? t + n.toString(e) : V(s);
|
|
@@ -1607,14 +1606,14 @@ const Os = {
|
|
|
1607
1606
|
tag: "tag:yaml.org,2002:int",
|
|
1608
1607
|
format: "OCT",
|
|
1609
1608
|
test: /^0o[0-7]+$/,
|
|
1610
|
-
resolve: (s, e, t) =>
|
|
1609
|
+
resolve: (s, e, t) => Tt(s, 2, 8, t),
|
|
1611
1610
|
stringify: (s) => Ns(s, 8, "0o")
|
|
1612
1611
|
}, Ts = {
|
|
1613
1612
|
identify: Xe,
|
|
1614
1613
|
default: !0,
|
|
1615
1614
|
tag: "tag:yaml.org,2002:int",
|
|
1616
1615
|
test: /^[-+]?[0-9]+$/,
|
|
1617
|
-
resolve: (s, e, t) =>
|
|
1616
|
+
resolve: (s, e, t) => Tt(s, 0, 10, t),
|
|
1618
1617
|
stringify: V
|
|
1619
1618
|
}, Is = {
|
|
1620
1619
|
identify: (s) => Xe(s) && s >= 0,
|
|
@@ -1622,14 +1621,14 @@ const Os = {
|
|
|
1622
1621
|
tag: "tag:yaml.org,2002:int",
|
|
1623
1622
|
format: "HEX",
|
|
1624
1623
|
test: /^0x[0-9a-fA-F]+$/,
|
|
1625
|
-
resolve: (s, e, t) =>
|
|
1624
|
+
resolve: (s, e, t) => Tt(s, 2, 16, t),
|
|
1626
1625
|
stringify: (s) => Ns(s, 16, "0x")
|
|
1627
1626
|
}, In = [
|
|
1628
1627
|
we,
|
|
1629
1628
|
Se,
|
|
1630
|
-
xe,
|
|
1631
1629
|
ze,
|
|
1632
|
-
|
|
1630
|
+
xe,
|
|
1631
|
+
Ot,
|
|
1633
1632
|
Os,
|
|
1634
1633
|
Ts,
|
|
1635
1634
|
Is,
|
|
@@ -1637,7 +1636,7 @@ const Os = {
|
|
|
1637
1636
|
Ss,
|
|
1638
1637
|
ks
|
|
1639
1638
|
];
|
|
1640
|
-
function
|
|
1639
|
+
function Vt(s) {
|
|
1641
1640
|
return typeof s == "bigint" || Number.isInteger(s);
|
|
1642
1641
|
}
|
|
1643
1642
|
const Be = ({ value: s }) => JSON.stringify(s), An = [
|
|
@@ -1666,12 +1665,12 @@ const Be = ({ value: s }) => JSON.stringify(s), An = [
|
|
|
1666
1665
|
stringify: Be
|
|
1667
1666
|
},
|
|
1668
1667
|
{
|
|
1669
|
-
identify:
|
|
1668
|
+
identify: Vt,
|
|
1670
1669
|
default: !0,
|
|
1671
1670
|
tag: "tag:yaml.org,2002:int",
|
|
1672
1671
|
test: /^-?(?:0|[1-9][0-9]*)$/,
|
|
1673
1672
|
resolve: (s, e, { intAsBigInt: t }) => t ? BigInt(s) : parseInt(s, 10),
|
|
1674
|
-
stringify: ({ value: s }) =>
|
|
1673
|
+
stringify: ({ value: s }) => Vt(s) ? s.toString() : JSON.stringify(s)
|
|
1675
1674
|
},
|
|
1676
1675
|
{
|
|
1677
1676
|
identify: (s) => typeof s == "number",
|
|
@@ -1688,7 +1687,7 @@ const Be = ({ value: s }) => JSON.stringify(s), An = [
|
|
|
1688
1687
|
resolve(s, e) {
|
|
1689
1688
|
return e(`Unresolved plain scalar ${JSON.stringify(s)}`), s;
|
|
1690
1689
|
}
|
|
1691
|
-
}, Ln = [we, Se].concat(An, En),
|
|
1690
|
+
}, Ln = [we, Se].concat(An, En), It = {
|
|
1692
1691
|
identify: (s) => s instanceof Uint8Array,
|
|
1693
1692
|
// Buffer inherits from Uint8Array
|
|
1694
1693
|
default: !1,
|
|
@@ -1759,7 +1758,7 @@ ${o.comment}` : i.comment;
|
|
|
1759
1758
|
return s;
|
|
1760
1759
|
}
|
|
1761
1760
|
function Es(s, e, t) {
|
|
1762
|
-
const { replacer: n } = t, i = new
|
|
1761
|
+
const { replacer: n } = t, i = new z(s);
|
|
1763
1762
|
i.tag = "tag:yaml.org,2002:pairs";
|
|
1764
1763
|
let r = 0;
|
|
1765
1764
|
if (e && Symbol.iterator in Object(e))
|
|
@@ -1779,18 +1778,18 @@ function Es(s, e, t) {
|
|
|
1779
1778
|
throw new TypeError(`Expected tuple with one key, not ${c.length} keys`);
|
|
1780
1779
|
} else
|
|
1781
1780
|
l = o;
|
|
1782
|
-
i.items.push(
|
|
1781
|
+
i.items.push(Nt(l, a, t));
|
|
1783
1782
|
}
|
|
1784
1783
|
return i;
|
|
1785
1784
|
}
|
|
1786
|
-
const
|
|
1785
|
+
const At = {
|
|
1787
1786
|
collection: "seq",
|
|
1788
1787
|
default: !1,
|
|
1789
1788
|
tag: "tag:yaml.org,2002:pairs",
|
|
1790
1789
|
resolve: As,
|
|
1791
1790
|
createNode: Es
|
|
1792
1791
|
};
|
|
1793
|
-
class ue extends
|
|
1792
|
+
class ue extends z {
|
|
1794
1793
|
constructor() {
|
|
1795
1794
|
super(), this.add = K.prototype.add.bind(this), this.delete = K.prototype.delete.bind(this), this.get = K.prototype.get.bind(this), this.has = K.prototype.has.bind(this), this.set = K.prototype.set.bind(this), this.tag = ue.tag;
|
|
1796
1795
|
}
|
|
@@ -1817,7 +1816,7 @@ class ue extends x {
|
|
|
1817
1816
|
}
|
|
1818
1817
|
}
|
|
1819
1818
|
ue.tag = "tag:yaml.org,2002:omap";
|
|
1820
|
-
const
|
|
1819
|
+
const Et = {
|
|
1821
1820
|
collection: "seq",
|
|
1822
1821
|
identify: (s) => s instanceof Map,
|
|
1823
1822
|
nodeClass: ue,
|
|
@@ -1901,7 +1900,7 @@ function Ze(s, e, t, { intAsBigInt: n }) {
|
|
|
1901
1900
|
const r = parseInt(s, t);
|
|
1902
1901
|
return i === "-" ? -1 * r : r;
|
|
1903
1902
|
}
|
|
1904
|
-
function
|
|
1903
|
+
function Lt(s, e, t) {
|
|
1905
1904
|
const { value: n } = s;
|
|
1906
1905
|
if (Ce(n)) {
|
|
1907
1906
|
const i = n.toString(e);
|
|
@@ -1916,7 +1915,7 @@ const Mn = {
|
|
|
1916
1915
|
format: "BIN",
|
|
1917
1916
|
test: /^[-+]?0b[0-1_]+$/,
|
|
1918
1917
|
resolve: (s, e, t) => Ze(s, 2, 2, t),
|
|
1919
|
-
stringify: (s) =>
|
|
1918
|
+
stringify: (s) => Lt(s, 2, "0b")
|
|
1920
1919
|
}, vn = {
|
|
1921
1920
|
identify: Ce,
|
|
1922
1921
|
default: !0,
|
|
@@ -1924,7 +1923,7 @@ const Mn = {
|
|
|
1924
1923
|
format: "OCT",
|
|
1925
1924
|
test: /^[-+]?0[0-7_]+$/,
|
|
1926
1925
|
resolve: (s, e, t) => Ze(s, 1, 8, t),
|
|
1927
|
-
stringify: (s) =>
|
|
1926
|
+
stringify: (s) => Lt(s, 8, "0")
|
|
1928
1927
|
}, Bn = {
|
|
1929
1928
|
identify: Ce,
|
|
1930
1929
|
default: !0,
|
|
@@ -1939,7 +1938,7 @@ const Mn = {
|
|
|
1939
1938
|
format: "HEX",
|
|
1940
1939
|
test: /^[-+]?0x[0-9a-fA-F_]+$/,
|
|
1941
1940
|
resolve: (s, e, t) => Ze(s, 2, 16, t),
|
|
1942
|
-
stringify: (s) =>
|
|
1941
|
+
stringify: (s) => Lt(s, 16, "0x")
|
|
1943
1942
|
};
|
|
1944
1943
|
class he extends K {
|
|
1945
1944
|
constructor(e) {
|
|
@@ -1977,12 +1976,12 @@ class he extends K {
|
|
|
1977
1976
|
const { replacer: i } = n, r = new this(e);
|
|
1978
1977
|
if (t && Symbol.iterator in Object(t))
|
|
1979
1978
|
for (let o of t)
|
|
1980
|
-
typeof i == "function" && (o = i.call(t, o, o)), r.items.push(
|
|
1979
|
+
typeof i == "function" && (o = i.call(t, o, o)), r.items.push(Nt(o, null, n));
|
|
1981
1980
|
return r;
|
|
1982
1981
|
}
|
|
1983
1982
|
}
|
|
1984
1983
|
he.tag = "tag:yaml.org,2002:set";
|
|
1985
|
-
const
|
|
1984
|
+
const $t = {
|
|
1986
1985
|
collection: "map",
|
|
1987
1986
|
identify: (s) => s instanceof Set,
|
|
1988
1987
|
nodeClass: he,
|
|
@@ -1999,7 +1998,7 @@ const _t = {
|
|
|
1999
1998
|
return s;
|
|
2000
1999
|
}
|
|
2001
2000
|
};
|
|
2002
|
-
function
|
|
2001
|
+
function Ct(s, e) {
|
|
2003
2002
|
const t = s[0], n = t === "-" || t === "+" ? s.substring(1) : s, i = (o) => e ? BigInt(o) : Number(o), r = n.replace(/_/g, "").split(":").reduce((o, l) => o * i(60) + i(l), i(0));
|
|
2004
2003
|
return t === "-" ? i(-1) * r : r;
|
|
2005
2004
|
}
|
|
@@ -2020,7 +2019,7 @@ const Ms = {
|
|
|
2020
2019
|
tag: "tag:yaml.org,2002:int",
|
|
2021
2020
|
format: "TIME",
|
|
2022
2021
|
test: /^[-+]?[0-9][0-9_]*(?::[0-5]?[0-9])+$/,
|
|
2023
|
-
resolve: (s, e, { intAsBigInt: t }) =>
|
|
2022
|
+
resolve: (s, e, { intAsBigInt: t }) => Ct(s, t),
|
|
2024
2023
|
stringify: _s
|
|
2025
2024
|
}, vs = {
|
|
2026
2025
|
identify: (s) => typeof s == "number",
|
|
@@ -2028,7 +2027,7 @@ const Ms = {
|
|
|
2028
2027
|
tag: "tag:yaml.org,2002:float",
|
|
2029
2028
|
format: "TIME",
|
|
2030
2029
|
test: /^[-+]?[0-9][0-9_]*(?::[0-5]?[0-9])+\.[0-9_]*$/,
|
|
2031
|
-
resolve: (s) =>
|
|
2030
|
+
resolve: (s) => Ct(s, !1),
|
|
2032
2031
|
stringify: _s
|
|
2033
2032
|
}, et = {
|
|
2034
2033
|
identify: (s) => s instanceof Date,
|
|
@@ -2046,17 +2045,17 @@ const Ms = {
|
|
|
2046
2045
|
let c = Date.UTC(t, n - 1, i, r || 0, o || 0, l || 0, a);
|
|
2047
2046
|
const h = e[8];
|
|
2048
2047
|
if (h && h !== "Z") {
|
|
2049
|
-
let f =
|
|
2048
|
+
let f = Ct(h, !1);
|
|
2050
2049
|
Math.abs(f) < 30 && (f *= 60), c -= 6e4 * f;
|
|
2051
2050
|
}
|
|
2052
2051
|
return new Date(c);
|
|
2053
2052
|
},
|
|
2054
2053
|
stringify: ({ value: s }) => s.toISOString().replace(/((T00:00)?:00)?\.000Z$/, "")
|
|
2055
|
-
},
|
|
2054
|
+
}, Jt = [
|
|
2056
2055
|
we,
|
|
2057
2056
|
Se,
|
|
2058
|
-
xe,
|
|
2059
2057
|
ze,
|
|
2058
|
+
xe,
|
|
2060
2059
|
$s,
|
|
2061
2060
|
Cs,
|
|
2062
2061
|
Mn,
|
|
@@ -2066,22 +2065,22 @@ const Ms = {
|
|
|
2066
2065
|
$n,
|
|
2067
2066
|
Cn,
|
|
2068
2067
|
_n,
|
|
2068
|
+
It,
|
|
2069
2069
|
Et,
|
|
2070
|
+
At,
|
|
2070
2071
|
$t,
|
|
2071
|
-
Lt,
|
|
2072
|
-
_t,
|
|
2073
2072
|
Ms,
|
|
2074
2073
|
vs,
|
|
2075
2074
|
et
|
|
2076
|
-
],
|
|
2075
|
+
], Qt = /* @__PURE__ */ new Map([
|
|
2077
2076
|
["core", In],
|
|
2078
|
-
["failsafe", [we, Se,
|
|
2077
|
+
["failsafe", [we, Se, ze]],
|
|
2079
2078
|
["json", Ln],
|
|
2080
|
-
["yaml11",
|
|
2081
|
-
["yaml-1.1",
|
|
2082
|
-
]),
|
|
2083
|
-
binary:
|
|
2084
|
-
bool:
|
|
2079
|
+
["yaml11", Jt],
|
|
2080
|
+
["yaml-1.1", Jt]
|
|
2081
|
+
]), Yt = {
|
|
2082
|
+
binary: It,
|
|
2083
|
+
bool: Ot,
|
|
2085
2084
|
float: ks,
|
|
2086
2085
|
floatExp: Ss,
|
|
2087
2086
|
floatNaN: ws,
|
|
@@ -2091,26 +2090,26 @@ const Ms = {
|
|
|
2091
2090
|
intOct: Os,
|
|
2092
2091
|
intTime: Ms,
|
|
2093
2092
|
map: we,
|
|
2094
|
-
null:
|
|
2095
|
-
omap:
|
|
2096
|
-
pairs:
|
|
2093
|
+
null: xe,
|
|
2094
|
+
omap: Et,
|
|
2095
|
+
pairs: At,
|
|
2097
2096
|
seq: Se,
|
|
2098
|
-
set:
|
|
2097
|
+
set: $t,
|
|
2099
2098
|
timestamp: et
|
|
2100
2099
|
}, Pn = {
|
|
2101
|
-
"tag:yaml.org,2002:binary":
|
|
2102
|
-
"tag:yaml.org,2002:omap":
|
|
2103
|
-
"tag:yaml.org,2002:pairs":
|
|
2104
|
-
"tag:yaml.org,2002:set":
|
|
2100
|
+
"tag:yaml.org,2002:binary": It,
|
|
2101
|
+
"tag:yaml.org,2002:omap": Et,
|
|
2102
|
+
"tag:yaml.org,2002:pairs": At,
|
|
2103
|
+
"tag:yaml.org,2002:set": $t,
|
|
2105
2104
|
"tag:yaml.org,2002:timestamp": et
|
|
2106
2105
|
};
|
|
2107
|
-
function
|
|
2108
|
-
let t =
|
|
2106
|
+
function at(s, e) {
|
|
2107
|
+
let t = Qt.get(e);
|
|
2109
2108
|
if (!t)
|
|
2110
2109
|
if (Array.isArray(s))
|
|
2111
2110
|
t = [];
|
|
2112
2111
|
else {
|
|
2113
|
-
const n = Array.from(
|
|
2112
|
+
const n = Array.from(Qt.keys()).filter((i) => i !== "yaml11").map((i) => JSON.stringify(i)).join(", ");
|
|
2114
2113
|
throw new Error(`Unknown schema "${e}"; use one of ${n} or define customTags array`);
|
|
2115
2114
|
}
|
|
2116
2115
|
if (Array.isArray(s))
|
|
@@ -2121,17 +2120,17 @@ function ft(s, e) {
|
|
|
2121
2120
|
return t.map((n) => {
|
|
2122
2121
|
if (typeof n != "string")
|
|
2123
2122
|
return n;
|
|
2124
|
-
const i =
|
|
2123
|
+
const i = Yt[n];
|
|
2125
2124
|
if (i)
|
|
2126
2125
|
return i;
|
|
2127
|
-
const r = Object.keys(
|
|
2126
|
+
const r = Object.keys(Yt).map((o) => JSON.stringify(o)).join(", ");
|
|
2128
2127
|
throw new Error(`Unknown custom tag "${n}"; use one of ${r}`);
|
|
2129
2128
|
});
|
|
2130
2129
|
}
|
|
2131
2130
|
const Dn = (s, e) => s.key < e.key ? -1 : s.key > e.key ? 1 : 0;
|
|
2132
2131
|
class tt {
|
|
2133
2132
|
constructor({ compat: e, customTags: t, merge: n, resolveKnownTags: i, schema: r, sortMapEntries: o, toStringDefaults: l }) {
|
|
2134
|
-
this.compat = Array.isArray(e) ?
|
|
2133
|
+
this.compat = Array.isArray(e) ? at(e, "compat") : e ? at(null, e) : null, this.merge = !!n, this.name = typeof r == "string" && r || "core", this.knownTags = i ? Pn : {}, this.tags = at(t, this.name), this.toStringOptions = l != null ? l : null, Object.defineProperty(this, W, { value: we }), Object.defineProperty(this, Y, { value: ze }), Object.defineProperty(this, me, { value: Se }), this.sortMapEntries = typeof o == "function" ? o : o === !0 ? Dn : null;
|
|
2135
2134
|
}
|
|
2136
2135
|
clone() {
|
|
2137
2136
|
const e = Object.create(tt.prototype, Object.getOwnPropertyDescriptors(this));
|
|
@@ -2184,7 +2183,7 @@ function Kn(s, e) {
|
|
|
2184
2183
|
}
|
|
2185
2184
|
class ke {
|
|
2186
2185
|
constructor(e, t, n) {
|
|
2187
|
-
this.commentBefore = null, this.comment = null, this.errors = [], this.warnings = [], Object.defineProperty(this, F, { value:
|
|
2186
|
+
this.commentBefore = null, this.comment = null, this.errors = [], this.warnings = [], Object.defineProperty(this, F, { value: pt });
|
|
2188
2187
|
let i = null;
|
|
2189
2188
|
typeof t == "function" || Array.isArray(t) ? i = t : n === void 0 && t && (n = t, t = void 0);
|
|
2190
2189
|
const r = Object.assign({
|
|
@@ -2207,7 +2206,7 @@ class ke {
|
|
|
2207
2206
|
*/
|
|
2208
2207
|
clone() {
|
|
2209
2208
|
const e = Object.create(ke.prototype, {
|
|
2210
|
-
[F]: { value:
|
|
2209
|
+
[F]: { value: pt }
|
|
2211
2210
|
});
|
|
2212
2211
|
return e.commentBefore = this.commentBefore, e.comment = this.comment, e.errors = this.errors.slice(), e.warnings = this.warnings.slice(), e.options = Object.assign({}, this.options), this.directives && (e.directives = this.directives.clone()), e.schema = this.schema.clone(), e.contents = M(this.contents) ? this.contents.clone(e.schema) : this.contents, this.range && (e.range = this.range.slice()), e;
|
|
2213
2212
|
}
|
|
@@ -2397,17 +2396,17 @@ function re(s) {
|
|
|
2397
2396
|
return !0;
|
|
2398
2397
|
throw new Error("Expected a YAML collection as document contents");
|
|
2399
2398
|
}
|
|
2400
|
-
class
|
|
2399
|
+
class _t extends Error {
|
|
2401
2400
|
constructor(e, t, n, i) {
|
|
2402
2401
|
super(), this.name = e, this.code = n, this.message = i, this.pos = t;
|
|
2403
2402
|
}
|
|
2404
2403
|
}
|
|
2405
|
-
class te extends
|
|
2404
|
+
class te extends _t {
|
|
2406
2405
|
constructor(e, t, n) {
|
|
2407
2406
|
super("YAMLParseError", e, t, n);
|
|
2408
2407
|
}
|
|
2409
2408
|
}
|
|
2410
|
-
class Bs extends
|
|
2409
|
+
class Bs extends _t {
|
|
2411
2410
|
constructor(e, t, n) {
|
|
2412
2411
|
super("YAMLWarning", e, t, n);
|
|
2413
2412
|
}
|
|
@@ -2523,7 +2522,7 @@ function Ee(s) {
|
|
|
2523
2522
|
return !0;
|
|
2524
2523
|
}
|
|
2525
2524
|
}
|
|
2526
|
-
function
|
|
2525
|
+
function bt(s, e, t) {
|
|
2527
2526
|
if ((e == null ? void 0 : e.type) === "flow-collection") {
|
|
2528
2527
|
const n = e.end[0];
|
|
2529
2528
|
n.indent === s && (n.source === "]" || n.source === "}") && Ee(e) && t(n, "BAD_INDENT", "Flow end indicator should be more indented than parent", !0);
|
|
@@ -2536,7 +2535,7 @@ function js(s, e, t) {
|
|
|
2536
2535
|
const i = typeof n == "function" ? n : (r, o) => r === o || A(r) && A(o) && r.value === o.value && !(r.value === "<<" && s.schema.merge);
|
|
2537
2536
|
return e.some((r) => i(r.key, t));
|
|
2538
2537
|
}
|
|
2539
|
-
const
|
|
2538
|
+
const Gt = "All mapping items must start at the same column";
|
|
2540
2539
|
function qn({ composeNode: s, composeEmptyNode: e }, t, n, i, r) {
|
|
2541
2540
|
var h, f;
|
|
2542
2541
|
const o = (h = r == null ? void 0 : r.nodeClass) != null ? h : K, l = new o(t.schema);
|
|
@@ -2552,16 +2551,16 @@ function qn({ composeNode: s, composeEmptyNode: e }, t, n, i, r) {
|
|
|
2552
2551
|
startOnNewline: !0
|
|
2553
2552
|
}), S = !b.found;
|
|
2554
2553
|
if (S) {
|
|
2555
|
-
if (y && (y.type === "block-seq" ? i(a, "BLOCK_AS_IMPLICIT_KEY", "A block sequence may not be used as an implicit map key") : "indent" in y && y.indent !== n.indent && i(a, "BAD_INDENT",
|
|
2554
|
+
if (y && (y.type === "block-seq" ? i(a, "BLOCK_AS_IMPLICIT_KEY", "A block sequence may not be used as an implicit map key") : "indent" in y && y.indent !== n.indent && i(a, "BAD_INDENT", Gt)), !b.anchor && !b.tag && !u) {
|
|
2556
2555
|
c = b.end, b.comment && (l.comment ? l.comment += `
|
|
2557
2556
|
` + b.comment : l.comment = b.comment);
|
|
2558
2557
|
continue;
|
|
2559
2558
|
}
|
|
2560
2559
|
(b.newlineAfterProp || Ee(y)) && i(y != null ? y : m[m.length - 1], "MULTILINE_IMPLICIT_KEY", "Implicit keys need to be on a single line");
|
|
2561
2560
|
} else
|
|
2562
|
-
((f = b.found) == null ? void 0 : f.indent) !== n.indent && i(a, "BAD_INDENT",
|
|
2561
|
+
((f = b.found) == null ? void 0 : f.indent) !== n.indent && i(a, "BAD_INDENT", Gt);
|
|
2563
2562
|
const I = b.end, k = y ? s(t, y, b, i) : e(t, I, m, null, b, i);
|
|
2564
|
-
t.schema.compat &&
|
|
2563
|
+
t.schema.compat && bt(n.indent, y, i), js(t, l.items, k) && i(I, "DUPLICATE_KEY", "Map keys must be unique");
|
|
2565
2564
|
const O = pe(u != null ? u : [], {
|
|
2566
2565
|
indicator: "map-value-ind",
|
|
2567
2566
|
next: g,
|
|
@@ -2573,7 +2572,7 @@ function qn({ composeNode: s, composeEmptyNode: e }, t, n, i, r) {
|
|
|
2573
2572
|
if (a = O.end, O.found) {
|
|
2574
2573
|
S && ((g == null ? void 0 : g.type) === "block-map" && !O.hasNewline && i(a, "BLOCK_AS_IMPLICIT_KEY", "Nested mappings are not allowed in compact mappings"), t.options.strict && b.start < O.found.offset - 1024 && i(k.range, "KEY_OVER_1024_CHARS", "The : indicator must be at most 1024 chars after the start of an implicit block mapping key"));
|
|
2575
2574
|
const T = g ? s(t, g, O, i) : e(t, a, u, null, O, i);
|
|
2576
|
-
t.schema.compat &&
|
|
2575
|
+
t.schema.compat && bt(n.indent, g, i), a = T.range[2];
|
|
2577
2576
|
const C = new j(k, T);
|
|
2578
2577
|
t.options.keepSourceTokens && (C.srcToken = p), l.items.push(C);
|
|
2579
2578
|
} else {
|
|
@@ -2587,7 +2586,7 @@ function qn({ composeNode: s, composeEmptyNode: e }, t, n, i, r) {
|
|
|
2587
2586
|
}
|
|
2588
2587
|
function Fn({ composeNode: s, composeEmptyNode: e }, t, n, i, r) {
|
|
2589
2588
|
var h;
|
|
2590
|
-
const o = (h = r == null ? void 0 : r.nodeClass) != null ? h :
|
|
2589
|
+
const o = (h = r == null ? void 0 : r.nodeClass) != null ? h : z, l = new o(t.schema);
|
|
2591
2590
|
t.atRoot && (t.atRoot = !1);
|
|
2592
2591
|
let a = n.offset, c = null;
|
|
2593
2592
|
for (const { start: f, value: p } of n.items) {
|
|
@@ -2607,7 +2606,7 @@ function Fn({ composeNode: s, composeEmptyNode: e }, t, n, i, r) {
|
|
|
2607
2606
|
continue;
|
|
2608
2607
|
}
|
|
2609
2608
|
const y = p ? s(t, p, m, i) : e(t, m.end, f, null, m, i);
|
|
2610
|
-
t.schema.compat &&
|
|
2609
|
+
t.schema.compat && bt(n.indent, p, i), a = y.range[2], l.items.push(y);
|
|
2611
2610
|
}
|
|
2612
2611
|
return l.range = [n.offset, a, c != null ? c : a], l;
|
|
2613
2612
|
}
|
|
@@ -2638,10 +2637,10 @@ function _e(s, e, t, n) {
|
|
|
2638
2637
|
}
|
|
2639
2638
|
return { comment: i, offset: e };
|
|
2640
2639
|
}
|
|
2641
|
-
const
|
|
2640
|
+
const ct = "Block collections are not allowed within flow collections", ft = (s) => s && (s.type === "block-map" || s.type === "block-seq");
|
|
2642
2641
|
function Rn({ composeNode: s, composeEmptyNode: e }, t, n, i, r) {
|
|
2643
2642
|
var g, b;
|
|
2644
|
-
const o = n.start.source === "{", l = o ? "flow map" : "flow sequence", a = (g = r == null ? void 0 : r.nodeClass) != null ? g : o ? K :
|
|
2643
|
+
const o = n.start.source === "{", l = o ? "flow map" : "flow sequence", a = (g = r == null ? void 0 : r.nodeClass) != null ? g : o ? K : z, c = new a(t.schema);
|
|
2645
2644
|
c.flow = !0;
|
|
2646
2645
|
const h = t.atRoot;
|
|
2647
2646
|
h && (t.atRoot = !1);
|
|
@@ -2693,10 +2692,10 @@ function Rn({ composeNode: s, composeEmptyNode: e }, t, n, i, r) {
|
|
|
2693
2692
|
}
|
|
2694
2693
|
if (!o && !T && !w.found) {
|
|
2695
2694
|
const L = C ? s(t, C, w, i) : e(t, w.end, T, null, w, i);
|
|
2696
|
-
c.items.push(L), f = L.range[2],
|
|
2695
|
+
c.items.push(L), f = L.range[2], ft(C) && i(L.range, "BLOCK_IN_FLOW", ct);
|
|
2697
2696
|
} else {
|
|
2698
2697
|
const L = w.end, _ = O ? s(t, O, w, i) : e(t, L, k, null, w, i);
|
|
2699
|
-
|
|
2698
|
+
ft(O) && i(_.range, "BLOCK_IN_FLOW", ct);
|
|
2700
2699
|
const B = pe(T != null ? T : [], {
|
|
2701
2700
|
flow: l,
|
|
2702
2701
|
indicator: "map-value-ind",
|
|
@@ -2721,10 +2720,10 @@ function Rn({ composeNode: s, composeEmptyNode: e }, t, n, i, r) {
|
|
|
2721
2720
|
}
|
|
2722
2721
|
} else
|
|
2723
2722
|
C && ("source" in C && C.source && C.source[0] === ":" ? i(C, "MISSING_CHAR", `Missing space after : in ${l}`) : i(B.start, "MISSING_CHAR", `Missing , or : between ${l} items`));
|
|
2724
|
-
const
|
|
2725
|
-
|
|
2723
|
+
const x = C ? s(t, C, B, i) : B.found ? e(t, B.end, T, null, B, i) : null;
|
|
2724
|
+
x ? ft(C) && i(x.range, "BLOCK_IN_FLOW", ct) : B.comment && (_.comment ? _.comment += `
|
|
2726
2725
|
` + B.comment : _.comment = B.comment);
|
|
2727
|
-
const ie = new j(_,
|
|
2726
|
+
const ie = new j(_, x);
|
|
2728
2727
|
if (t.options.keepSourceTokens && (ie.srcToken = I), o) {
|
|
2729
2728
|
const v = c;
|
|
2730
2729
|
js(t, v.items, _) && i(L, "DUPLICATE_KEY", "Map keys must be unique"), v.items.push(ie);
|
|
@@ -2732,7 +2731,7 @@ function Rn({ composeNode: s, composeEmptyNode: e }, t, n, i, r) {
|
|
|
2732
2731
|
const v = new K(t.schema);
|
|
2733
2732
|
v.flow = !0, v.items.push(ie), c.items.push(v);
|
|
2734
2733
|
}
|
|
2735
|
-
f =
|
|
2734
|
+
f = x ? x.range[2] : B.end;
|
|
2736
2735
|
}
|
|
2737
2736
|
}
|
|
2738
2737
|
const p = o ? "}" : "]", [m, ...y] = n.end;
|
|
@@ -2751,7 +2750,7 @@ function Rn({ composeNode: s, composeEmptyNode: e }, t, n, i, r) {
|
|
|
2751
2750
|
c.range = [n.offset, u, u];
|
|
2752
2751
|
return c;
|
|
2753
2752
|
}
|
|
2754
|
-
function
|
|
2753
|
+
function ut(s, e, t, n, i, r) {
|
|
2755
2754
|
const o = t.type === "block-map" ? qn(s, e, t, n, r) : t.type === "block-seq" ? Fn(s, e, t, n, r) : Rn(s, e, t, n, r), l = o.constructor;
|
|
2756
2755
|
return i === "!" || i === l.tagName ? (o.tag = l.tagName, o) : (i && (o.tag = i), o);
|
|
2757
2756
|
}
|
|
@@ -2763,17 +2762,17 @@ function Un(s, e, t, n, i) {
|
|
|
2763
2762
|
g && (!u || u.offset < g.offset) && i(g, "MISSING_CHAR", "Missing newline after block sequence props");
|
|
2764
2763
|
}
|
|
2765
2764
|
const l = t.type === "block-map" ? "map" : t.type === "block-seq" ? "seq" : t.start.source === "{" ? "map" : "seq";
|
|
2766
|
-
if (!r || !o || o === "!" || o === K.tagName && l === "map" || o ===
|
|
2767
|
-
return
|
|
2765
|
+
if (!r || !o || o === "!" || o === K.tagName && l === "map" || o === z.tagName && l === "seq")
|
|
2766
|
+
return ut(s, e, t, i, o);
|
|
2768
2767
|
let a = e.schema.tags.find((y) => y.tag === o && y.collection === l);
|
|
2769
2768
|
if (!a) {
|
|
2770
2769
|
const y = e.schema.knownTags[o];
|
|
2771
2770
|
if (y && y.collection === l)
|
|
2772
2771
|
e.schema.tags.push(Object.assign({}, y, { default: !1 })), a = y;
|
|
2773
2772
|
else
|
|
2774
|
-
return y != null && y.collection ? i(r, "BAD_COLLECTION_TYPE", `${y.tag} used for ${l} collection, but expects ${y.collection}`, !0) : i(r, "TAG_RESOLVE_FAILED", `Unresolved tag: ${o}`, !0),
|
|
2773
|
+
return y != null && y.collection ? i(r, "BAD_COLLECTION_TYPE", `${y.tag} used for ${l} collection, but expects ${y.collection}`, !0) : i(r, "TAG_RESOLVE_FAILED", `Unresolved tag: ${o}`, !0), ut(s, e, t, i, o);
|
|
2775
2774
|
}
|
|
2776
|
-
const c =
|
|
2775
|
+
const c = ut(s, e, t, i, o, a), h = (m = (p = a.resolve) == null ? void 0 : p.call(a, c, (y) => i(r, "TAG_RESOLVE_FAILED", y), e.options)) != null ? m : c, f = M(h) ? h : new N(h);
|
|
2777
2776
|
return f.range = c.range, f.tag = o, a != null && a.format && (f.format = a.format), f;
|
|
2778
2777
|
}
|
|
2779
2778
|
function Ps(s, e, t) {
|
|
@@ -2999,7 +2998,7 @@ function Gn(s, e) {
|
|
|
2999
2998
|
r = s[++n + 1];
|
|
3000
2999
|
else if (r === "x" || r === "u" || r === "U") {
|
|
3001
3000
|
const l = { x: 2, u: 4, U: 8 }[r];
|
|
3002
|
-
t +=
|
|
3001
|
+
t += zn(s, n + 1, l, e), n += l;
|
|
3003
3002
|
} else {
|
|
3004
3003
|
const l = s.substr(n - 1, 2);
|
|
3005
3004
|
e(n - 1, "BAD_DQ_ESCAPE", `Invalid escape sequence ${l}`), t += l;
|
|
@@ -3061,7 +3060,7 @@ const Hn = {
|
|
|
3061
3060
|
"\\": "\\",
|
|
3062
3061
|
" ": " "
|
|
3063
3062
|
};
|
|
3064
|
-
function
|
|
3063
|
+
function zn(s, e, t, n) {
|
|
3065
3064
|
const i = s.substr(e, t), o = i.length === t && /^[0-9a-fA-F]+$/.test(i) ? parseInt(i, 16) : NaN;
|
|
3066
3065
|
if (isNaN(o)) {
|
|
3067
3066
|
const l = s.substr(e - 2, t + 2);
|
|
@@ -3070,7 +3069,7 @@ function xn(s, e, t, n) {
|
|
|
3070
3069
|
return String.fromCodePoint(o);
|
|
3071
3070
|
}
|
|
3072
3071
|
function qs(s, e, t, n) {
|
|
3073
|
-
const { value: i, type: r, comment: o, range: l } = e.type === "block-scalar" ? Ps(s, e, n) : Ds(e, s.options.strict, n), a = t ? s.directives.tagName(t.source, (f) => n(t, "TAG_RESOLVE_FAILED", f)) : null, c = t && a ?
|
|
3072
|
+
const { value: i, type: r, comment: o, range: l } = e.type === "block-scalar" ? Ps(s, e, n) : Ds(e, s.options.strict, n), a = t ? s.directives.tagName(t.source, (f) => n(t, "TAG_RESOLVE_FAILED", f)) : null, c = t && a ? xn(s.schema, i, a, t, n) : e.type === "scalar" ? Xn(s, i, e, n) : s.schema[Y];
|
|
3074
3073
|
let h;
|
|
3075
3074
|
try {
|
|
3076
3075
|
const f = c.resolve(i, (p) => n(t != null ? t : e, "TAG_RESOLVE_FAILED", p), s.options);
|
|
@@ -3081,7 +3080,7 @@ function qs(s, e, t, n) {
|
|
|
3081
3080
|
}
|
|
3082
3081
|
return h.range = l, h.source = i, r && (h.type = r), a && (h.tag = a), c.format && (h.format = c.format), o && (h.comment = o), h;
|
|
3083
3082
|
}
|
|
3084
|
-
function
|
|
3083
|
+
function xn(s, e, t, n, i) {
|
|
3085
3084
|
var l;
|
|
3086
3085
|
if (t === "!")
|
|
3087
3086
|
return s[Y];
|
|
@@ -3135,7 +3134,7 @@ function Zn(s, e, t) {
|
|
|
3135
3134
|
}
|
|
3136
3135
|
return s;
|
|
3137
3136
|
}
|
|
3138
|
-
const ei = { composeNode: Fs, composeEmptyNode:
|
|
3137
|
+
const ei = { composeNode: Fs, composeEmptyNode: Mt };
|
|
3139
3138
|
function Fs(s, e, t, n) {
|
|
3140
3139
|
const { spaceBefore: i, comment: r, anchor: o, tag: l } = t;
|
|
3141
3140
|
let a, c = !0;
|
|
@@ -3156,12 +3155,12 @@ function Fs(s, e, t, n) {
|
|
|
3156
3155
|
break;
|
|
3157
3156
|
default: {
|
|
3158
3157
|
const h = e.type === "error" ? e.message : `Unsupported token (type: ${e.type})`;
|
|
3159
|
-
n(e, "UNEXPECTED_TOKEN", h), a =
|
|
3158
|
+
n(e, "UNEXPECTED_TOKEN", h), a = Mt(s, e.offset, void 0, null, t, n), c = !1;
|
|
3160
3159
|
}
|
|
3161
3160
|
}
|
|
3162
3161
|
return o && a.anchor === "" && n(o, "BAD_ALIAS", "Anchor cannot be an empty string"), i && (a.spaceBefore = !0), r && (e.type === "scalar" && e.source === "" ? a.comment = r : a.commentBefore = r), s.options.keepSourceTokens && c && (a.srcToken = e), a;
|
|
3163
3162
|
}
|
|
3164
|
-
function
|
|
3163
|
+
function Mt(s, e, t, n, { spaceBefore: i, comment: r, anchor: o, tag: l, end: a }, c) {
|
|
3165
3164
|
const h = {
|
|
3166
3165
|
type: "scalar",
|
|
3167
3166
|
offset: Zn(e, t, n),
|
|
@@ -3190,7 +3189,7 @@ function si(s, e, { offset: t, start: n, value: i, end: r }, o) {
|
|
|
3190
3189
|
parentIndent: 0,
|
|
3191
3190
|
startOnNewline: !0
|
|
3192
3191
|
});
|
|
3193
|
-
h.found && (a.directives.docStart = !0, i && (i.type === "block-map" || i.type === "block-seq") && !h.hasNewline && o(h.end, "MISSING_CHAR", "Block collection cannot start on same line with directives-end marker")), a.contents = i ? Fs(c, i, h, o) :
|
|
3192
|
+
h.found && (a.directives.docStart = !0, i && (i.type === "block-map" || i.type === "block-seq") && !h.hasNewline && o(h.end, "MISSING_CHAR", "Block collection cannot start on same line with directives-end marker")), a.contents = i ? Fs(c, i, h, o) : Mt(c, h.end, n, null, h, o);
|
|
3194
3193
|
const f = a.contents.range[2], p = _e(r, f, !1, o);
|
|
3195
3194
|
return p.comment && (a.comment = p.comment), a.range = [t, f, p.offset], a;
|
|
3196
3195
|
}
|
|
@@ -3202,7 +3201,7 @@ function Ne(s) {
|
|
|
3202
3201
|
const { offset: e, source: t } = s;
|
|
3203
3202
|
return [e, e + (typeof t == "string" ? t.length : 1)];
|
|
3204
3203
|
}
|
|
3205
|
-
function
|
|
3204
|
+
function Wt(s) {
|
|
3206
3205
|
var i;
|
|
3207
3206
|
let e = "", t = !1, n = !1;
|
|
3208
3207
|
for (let r = 0; r < s.length; ++r) {
|
|
@@ -3223,7 +3222,7 @@ function Ht(s) {
|
|
|
3223
3222
|
}
|
|
3224
3223
|
return { comment: e, afterEmptyLine: n };
|
|
3225
3224
|
}
|
|
3226
|
-
class
|
|
3225
|
+
class vt {
|
|
3227
3226
|
constructor(e = {}) {
|
|
3228
3227
|
this.doc = null, this.atDirectives = !1, this.prelude = [], this.errors = [], this.warnings = [], this.onError = (t, n, i, r) => {
|
|
3229
3228
|
const o = Ne(t);
|
|
@@ -3231,7 +3230,7 @@ class jt {
|
|
|
3231
3230
|
}, this.directives = new P({ version: e.version || "1.2" }), this.options = e;
|
|
3232
3231
|
}
|
|
3233
3232
|
decorate(e, t) {
|
|
3234
|
-
const { comment: n, afterEmptyLine: i } =
|
|
3233
|
+
const { comment: n, afterEmptyLine: i } = Wt(this.prelude);
|
|
3235
3234
|
if (n) {
|
|
3236
3235
|
const r = e.contents;
|
|
3237
3236
|
if (t)
|
|
@@ -3260,7 +3259,7 @@ ${o}` : n;
|
|
|
3260
3259
|
*/
|
|
3261
3260
|
streamInfo() {
|
|
3262
3261
|
return {
|
|
3263
|
-
comment:
|
|
3262
|
+
comment: Wt(this.prelude).comment,
|
|
3264
3263
|
directives: this.directives,
|
|
3265
3264
|
errors: this.errors,
|
|
3266
3265
|
warnings: this.warnings
|
|
@@ -3420,13 +3419,13 @@ function ri(s, e, t = {}) {
|
|
|
3420
3419
|
oi(s, a);
|
|
3421
3420
|
break;
|
|
3422
3421
|
case '"':
|
|
3423
|
-
|
|
3422
|
+
ht(s, a, "double-quoted-scalar");
|
|
3424
3423
|
break;
|
|
3425
3424
|
case "'":
|
|
3426
|
-
|
|
3425
|
+
ht(s, a, "single-quoted-scalar");
|
|
3427
3426
|
break;
|
|
3428
3427
|
default:
|
|
3429
|
-
|
|
3428
|
+
ht(s, a, "scalar");
|
|
3430
3429
|
}
|
|
3431
3430
|
}
|
|
3432
3431
|
function oi(s, e) {
|
|
@@ -3462,7 +3461,7 @@ function Rs(s, e) {
|
|
|
3462
3461
|
}
|
|
3463
3462
|
return !1;
|
|
3464
3463
|
}
|
|
3465
|
-
function
|
|
3464
|
+
function ht(s, e, t) {
|
|
3466
3465
|
switch (s.type) {
|
|
3467
3466
|
case "scalar":
|
|
3468
3467
|
case "double-quoted-scalar":
|
|
@@ -3542,11 +3541,11 @@ function Fe({ start: s, key: e, sep: t, value: n }) {
|
|
|
3542
3541
|
i += r.source;
|
|
3543
3542
|
return n && (i += Je(n)), i;
|
|
3544
3543
|
}
|
|
3545
|
-
const
|
|
3544
|
+
const wt = Symbol("break visit"), ai = Symbol("skip children"), Us = Symbol("remove item");
|
|
3546
3545
|
function se(s, e) {
|
|
3547
3546
|
"type" in s && s.type === "document" && (s = { start: s.start, value: s.value }), Vs(Object.freeze([]), s, e);
|
|
3548
3547
|
}
|
|
3549
|
-
se.BREAK =
|
|
3548
|
+
se.BREAK = wt;
|
|
3550
3549
|
se.SKIP = ai;
|
|
3551
3550
|
se.REMOVE = Us;
|
|
3552
3551
|
se.itemAtPath = (s, e) => {
|
|
@@ -3578,8 +3577,8 @@ function Vs(s, e, t) {
|
|
|
3578
3577
|
if (typeof l == "number")
|
|
3579
3578
|
o = l - 1;
|
|
3580
3579
|
else {
|
|
3581
|
-
if (l ===
|
|
3582
|
-
return
|
|
3580
|
+
if (l === wt)
|
|
3581
|
+
return wt;
|
|
3583
3582
|
l === Us && (r.items.splice(o, 1), o -= 1);
|
|
3584
3583
|
}
|
|
3585
3584
|
}
|
|
@@ -3693,8 +3692,8 @@ function U(s) {
|
|
|
3693
3692
|
return !1;
|
|
3694
3693
|
}
|
|
3695
3694
|
}
|
|
3696
|
-
const
|
|
3697
|
-
\r `),
|
|
3695
|
+
const Ht = new Set("0123456789ABCDEFabcdef"), di = new Set("0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz-#;/?:@&=+$_.!~*'()"), je = new Set(",[]{}"), pi = new Set(` ,[]{}
|
|
3696
|
+
\r `), dt = (s) => !s || pi.has(s);
|
|
3698
3697
|
class Qs {
|
|
3699
3698
|
constructor() {
|
|
3700
3699
|
this.atEnd = !1, this.blockScalarIndent = -1, this.blockScalarKeep = !1, this.buffer = "", this.flowKey = !1, this.flowLevel = 0, this.indentNext = 0, this.indentValue = 0, this.lineEndPos = null, this.next = null, this.pos = 0;
|
|
@@ -3855,7 +3854,7 @@ class Qs {
|
|
|
3855
3854
|
case "]":
|
|
3856
3855
|
return yield* d(this.pushCount(1)), "doc";
|
|
3857
3856
|
case "*":
|
|
3858
|
-
return yield* d(this.pushUntil(
|
|
3857
|
+
return yield* d(this.pushUntil(dt)), "doc";
|
|
3859
3858
|
case '"':
|
|
3860
3859
|
case "'":
|
|
3861
3860
|
return yield* d(this.parseQuotedScalar());
|
|
@@ -3891,7 +3890,7 @@ class Qs {
|
|
|
3891
3890
|
case "]":
|
|
3892
3891
|
return yield* d(this.pushCount(1)), this.flowKey = !0, this.flowLevel -= 1, this.flowLevel ? "flow" : "doc";
|
|
3893
3892
|
case "*":
|
|
3894
|
-
return yield* d(this.pushUntil(
|
|
3893
|
+
return yield* d(this.pushUntil(dt)), "flow";
|
|
3895
3894
|
case '"':
|
|
3896
3895
|
case "'":
|
|
3897
3896
|
return this.flowKey = !0, yield* d(this.parseQuotedScalar());
|
|
@@ -4057,7 +4056,7 @@ class Qs {
|
|
|
4057
4056
|
case "!":
|
|
4058
4057
|
return (yield* d(this.pushTag())) + (yield* d(this.pushSpaces(!0))) + (yield* d(this.pushIndicators()));
|
|
4059
4058
|
case "&":
|
|
4060
|
-
return (yield* d(this.pushUntil(
|
|
4059
|
+
return (yield* d(this.pushUntil(dt))) + (yield* d(this.pushSpaces(!0))) + (yield* d(this.pushIndicators()));
|
|
4061
4060
|
case "-":
|
|
4062
4061
|
case "?":
|
|
4063
4062
|
case ":": {
|
|
@@ -4079,7 +4078,7 @@ class Qs {
|
|
|
4079
4078
|
for (; t; )
|
|
4080
4079
|
if (di.has(t))
|
|
4081
4080
|
t = this.buffer[++e];
|
|
4082
|
-
else if (t === "%" &&
|
|
4081
|
+
else if (t === "%" && Ht.has(this.buffer[e + 1]) && Ht.has(this.buffer[e + 2]))
|
|
4083
4082
|
t = this.buffer[e += 3];
|
|
4084
4083
|
else
|
|
4085
4084
|
break;
|
|
@@ -4188,12 +4187,12 @@ function oe(s) {
|
|
|
4188
4187
|
;
|
|
4189
4188
|
return s.splice(e, s.length);
|
|
4190
4189
|
}
|
|
4191
|
-
function
|
|
4190
|
+
function xt(s) {
|
|
4192
4191
|
if (s.start.type === "flow-seq-start")
|
|
4193
4192
|
for (const e of s.items)
|
|
4194
4193
|
e.sep && !e.value && !X(e.start, "explicit-key-ind") && !X(e.sep, "map-value-ind") && (e.key && (e.value = e.key), delete e.key, Gs(e.value) ? e.value.end ? Array.prototype.push.apply(e.value.end, e.sep) : e.value.end = e.sep : Array.prototype.push.apply(e.start, e.sep), delete e.sep);
|
|
4195
4194
|
}
|
|
4196
|
-
class
|
|
4195
|
+
class Bt {
|
|
4197
4196
|
/**
|
|
4198
4197
|
* @param onNewLine - If defined, called separately with the start position of
|
|
4199
4198
|
* each new line (in `parse()`, including the start of input).
|
|
@@ -4312,7 +4311,7 @@ class Pt {
|
|
|
4312
4311
|
yield t;
|
|
4313
4312
|
else {
|
|
4314
4313
|
const n = this.peek(1);
|
|
4315
|
-
switch (t.type === "block-scalar" ? t.indent = "indent" in n ? n.indent : 0 : t.type === "flow-collection" && n.type === "document" && (t.indent = 0), t.type === "flow-collection" &&
|
|
4314
|
+
switch (t.type === "block-scalar" ? t.indent = "indent" in n ? n.indent : 0 : t.type === "flow-collection" && n.type === "document" && (t.indent = 0), t.type === "flow-collection" && xt(t), n.type) {
|
|
4316
4315
|
case "document":
|
|
4317
4316
|
n.value = t;
|
|
4318
4317
|
break;
|
|
@@ -4656,7 +4655,7 @@ class Pt {
|
|
|
4656
4655
|
yield* d(this.pop()), yield* d(this.step());
|
|
4657
4656
|
else if (this.type === "map-value-ind" && n.type !== "flow-collection") {
|
|
4658
4657
|
const i = Pe(n), r = oe(i);
|
|
4659
|
-
|
|
4658
|
+
xt(e);
|
|
4660
4659
|
const o = e.end.splice(1, e.end.length);
|
|
4661
4660
|
o.push(this.sourceToken);
|
|
4662
4661
|
const l = {
|
|
@@ -4770,14 +4769,14 @@ function Ws(s) {
|
|
|
4770
4769
|
return { lineCounter: s.lineCounter || e && new Ys() || null, prettyErrors: e };
|
|
4771
4770
|
}
|
|
4772
4771
|
function mi(s, e = {}) {
|
|
4773
|
-
const { lineCounter: t, prettyErrors: n } = Ws(e), i = new
|
|
4772
|
+
const { lineCounter: t, prettyErrors: n } = Ws(e), i = new Bt(t == null ? void 0 : t.addNewLine), r = new vt(e), o = Array.from(r.compose(i.parse(s)));
|
|
4774
4773
|
if (n && t)
|
|
4775
4774
|
for (const l of o)
|
|
4776
4775
|
l.errors.forEach(Ve(s, t)), l.warnings.forEach(Ve(s, t));
|
|
4777
4776
|
return o.length > 0 ? o : Object.assign([], { empty: !0 }, r.streamInfo());
|
|
4778
4777
|
}
|
|
4779
4778
|
function Hs(s, e = {}) {
|
|
4780
|
-
const { lineCounter: t, prettyErrors: n } = Ws(e), i = new
|
|
4779
|
+
const { lineCounter: t, prettyErrors: n } = Ws(e), i = new Bt(t == null ? void 0 : t.addNewLine), r = new vt(e);
|
|
4781
4780
|
let o = null;
|
|
4782
4781
|
for (const l of r.compose(i.parse(s), !0, s.length))
|
|
4783
4782
|
if (!o)
|
|
@@ -4815,22 +4814,22 @@ function gi(s, e, t) {
|
|
|
4815
4814
|
}
|
|
4816
4815
|
return new ke(s, n, t).toString(t);
|
|
4817
4816
|
}
|
|
4818
|
-
const
|
|
4817
|
+
const Xt = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
|
|
4819
4818
|
__proto__: null,
|
|
4820
4819
|
Alias: Ye,
|
|
4821
4820
|
CST: hi,
|
|
4822
|
-
Composer:
|
|
4821
|
+
Composer: vt,
|
|
4823
4822
|
Document: ke,
|
|
4824
4823
|
Lexer: Qs,
|
|
4825
4824
|
LineCounter: Ys,
|
|
4826
4825
|
Pair: j,
|
|
4827
|
-
Parser:
|
|
4826
|
+
Parser: Bt,
|
|
4828
4827
|
Scalar: N,
|
|
4829
4828
|
Schema: tt,
|
|
4830
|
-
YAMLError:
|
|
4829
|
+
YAMLError: _t,
|
|
4831
4830
|
YAMLMap: K,
|
|
4832
4831
|
YAMLParseError: te,
|
|
4833
|
-
YAMLSeq:
|
|
4832
|
+
YAMLSeq: z,
|
|
4834
4833
|
YAMLWarning: Bs,
|
|
4835
4834
|
isAlias: ne,
|
|
4836
4835
|
isCollection: $,
|
|
@@ -4890,38 +4889,38 @@ model: {{dataSourceTitle}}
|
|
|
4890
4889
|
# - name: Measure2`;
|
|
4891
4890
|
class Ci {
|
|
4892
4891
|
/**
|
|
4893
|
-
|
|
4894
|
-
|
|
4895
|
-
|
|
4896
|
-
|
|
4897
|
-
|
|
4892
|
+
* Constructor for QueryTranslator.
|
|
4893
|
+
*
|
|
4894
|
+
* @param contextTitle - The context title
|
|
4895
|
+
* @param fields - The data source fields
|
|
4896
|
+
*/
|
|
4898
4897
|
constructor(e, t) {
|
|
4899
|
-
|
|
4900
|
-
lt(this, "indexedFields", {});
|
|
4901
|
-
this.contextTitle = e, this.indexedFields = this.indexFields(t);
|
|
4898
|
+
this.indexedFields = {}, this.contextTitle = e, this.indexedFields = this.indexFields(t);
|
|
4902
4899
|
}
|
|
4903
4900
|
indexFields(e) {
|
|
4904
4901
|
return e.reduce((t, n) => {
|
|
4905
4902
|
const i = n.id;
|
|
4906
4903
|
t[i] = n;
|
|
4907
4904
|
const r = en(i);
|
|
4908
|
-
return i !== r && (t[r] = G(R({}, n), {
|
|
4905
|
+
return i !== r && (t[r] = G(R({}, n), {
|
|
4906
|
+
id: r
|
|
4907
|
+
})), t;
|
|
4909
4908
|
}, {});
|
|
4910
4909
|
}
|
|
4911
4910
|
/**
|
|
4912
|
-
|
|
4913
|
-
|
|
4911
|
+
* Concatenates Aggregation Types.
|
|
4912
|
+
*/
|
|
4914
4913
|
concatAggTypes() {
|
|
4915
|
-
return Object.values(an).map((t) =>
|
|
4914
|
+
return Object.values(an).map((t) => rn.aggregationToJAQL(t)).join("|");
|
|
4916
4915
|
}
|
|
4917
4916
|
/**
|
|
4918
|
-
|
|
4919
|
-
|
|
4920
|
-
|
|
4921
|
-
|
|
4922
|
-
|
|
4923
|
-
|
|
4924
|
-
|
|
4917
|
+
* Simplifies Aggregation Formula defined in MetadataItemJaql returned from chat response.
|
|
4918
|
+
*
|
|
4919
|
+
* @param aggFormula - The Aggregation Formula to simplify
|
|
4920
|
+
* @returns The equivalent measure
|
|
4921
|
+
* @privateRemarks
|
|
4922
|
+
* See unit tests for examples of aggregation formulas and their equivalent measures.
|
|
4923
|
+
*/
|
|
4925
4924
|
simplifyAggFormula(e) {
|
|
4926
4925
|
const { formula: t, context: n, filter: i } = e;
|
|
4927
4926
|
if (!n || !t)
|
|
@@ -4942,11 +4941,11 @@ class Ci {
|
|
|
4942
4941
|
return e;
|
|
4943
4942
|
}
|
|
4944
4943
|
/**
|
|
4945
|
-
|
|
4946
|
-
|
|
4947
|
-
|
|
4948
|
-
|
|
4949
|
-
|
|
4944
|
+
* Simplifies MetadataItemJaql.
|
|
4945
|
+
*
|
|
4946
|
+
* @param item - The MetadataItemJaql to simplify
|
|
4947
|
+
* @returns The simplified MetadataItemJaql
|
|
4948
|
+
*/
|
|
4950
4949
|
simplifyMetadataItemJaql(e) {
|
|
4951
4950
|
let t = e;
|
|
4952
4951
|
if ("formula" in e && (t = this.simplifyAggFormula(e)), delete t.table, delete t.column, delete t.datatype, "context" in t) {
|
|
@@ -4958,11 +4957,11 @@ class Ci {
|
|
|
4958
4957
|
return t;
|
|
4959
4958
|
}
|
|
4960
4959
|
/**
|
|
4961
|
-
|
|
4962
|
-
|
|
4963
|
-
|
|
4964
|
-
|
|
4965
|
-
|
|
4960
|
+
* Simplify filter
|
|
4961
|
+
*
|
|
4962
|
+
* @param item - the MetadataItem
|
|
4963
|
+
* @return the MetadataItem with simplified filter
|
|
4964
|
+
*/
|
|
4966
4965
|
simplifyMetadataItemFilter(e) {
|
|
4967
4966
|
var i;
|
|
4968
4967
|
const t = e;
|
|
@@ -4970,30 +4969,39 @@ class Ci {
|
|
|
4970
4969
|
return t;
|
|
4971
4970
|
delete t.format;
|
|
4972
4971
|
const { jaql: n } = t;
|
|
4973
|
-
return (i = n.filter) != null && i.by && (n.filter.by = this.simplifyAggFormula(n.filter.by)), G(R({}, t), {
|
|
4972
|
+
return (i = n.filter) != null && i.by && (n.filter.by = this.simplifyAggFormula(n.filter.by)), G(R({}, t), {
|
|
4973
|
+
jaql: n
|
|
4974
|
+
});
|
|
4974
4975
|
}
|
|
4975
4976
|
/**
|
|
4976
|
-
|
|
4977
|
-
|
|
4978
|
-
|
|
4979
|
-
|
|
4980
|
-
|
|
4977
|
+
* Simplify date and number format
|
|
4978
|
+
*
|
|
4979
|
+
* @param item - the MetadataItem
|
|
4980
|
+
* @return the MetadataItem with simplified format
|
|
4981
|
+
*/
|
|
4981
4982
|
simplifyMetadataItemFormat(e) {
|
|
4982
|
-
const {
|
|
4983
|
-
|
|
4984
|
-
format: {
|
|
4985
|
-
|
|
4986
|
-
|
|
4983
|
+
const { jaql: { level: t }, format: { mask: n } = {} } = e;
|
|
4984
|
+
return t && (n != null && n[t]) ? G(R({}, e), {
|
|
4985
|
+
format: {
|
|
4986
|
+
mask: {
|
|
4987
|
+
[t]: n[t]
|
|
4988
|
+
}
|
|
4989
|
+
}
|
|
4990
|
+
}) : e;
|
|
4987
4991
|
}
|
|
4988
4992
|
/**
|
|
4989
|
-
|
|
4990
|
-
|
|
4991
|
-
|
|
4992
|
-
|
|
4993
|
-
|
|
4993
|
+
* Simplifies MetadataItem.
|
|
4994
|
+
*
|
|
4995
|
+
* @param item - The MetadataItem to simplify
|
|
4996
|
+
* @returns The simplified MetadataItem
|
|
4997
|
+
*/
|
|
4994
4998
|
simplifyMetadataItem(e) {
|
|
4995
4999
|
let t = e;
|
|
4996
|
-
t.panel && [
|
|
5000
|
+
t.panel && [
|
|
5001
|
+
"rows",
|
|
5002
|
+
"columns",
|
|
5003
|
+
"measures"
|
|
5004
|
+
].includes(t.panel) && delete t.panel, t = this.simplifyMetadataItemFilter(t), t = this.simplifyMetadataItemFormat(t);
|
|
4997
5005
|
const { jaql: n, measure: i, by: r } = t;
|
|
4998
5006
|
return G(R({}, t), {
|
|
4999
5007
|
jaql: this.simplifyMetadataItemJaql(n),
|
|
@@ -5002,37 +5010,41 @@ class Ci {
|
|
|
5002
5010
|
});
|
|
5003
5011
|
}
|
|
5004
5012
|
/**
|
|
5005
|
-
|
|
5006
|
-
|
|
5007
|
-
|
|
5008
|
-
|
|
5009
|
-
|
|
5013
|
+
* Simplifies Chart Recommendations.
|
|
5014
|
+
*
|
|
5015
|
+
* @param chartRecommendations - The Chart Recommendations to simplify
|
|
5016
|
+
* @returns The simplified chart data options
|
|
5017
|
+
*/
|
|
5010
5018
|
simplifyChartRecommendations(e) {
|
|
5011
5019
|
if (!("axesMapping" in e))
|
|
5012
5020
|
return {};
|
|
5013
|
-
const { chartType: t, axesMapping: n } = e,
|
|
5014
|
-
return {
|
|
5021
|
+
const { chartType: t, axesMapping: n, styleOptions: i } = e, r = Object.entries(n).reduce((o, [l, a]) => (o[l] = a.map((c) => on(c)), o), {});
|
|
5022
|
+
return {
|
|
5023
|
+
chartType: t,
|
|
5024
|
+
dataOptions: r,
|
|
5025
|
+
styleOptions: i
|
|
5026
|
+
};
|
|
5015
5027
|
}
|
|
5016
5028
|
/**
|
|
5017
|
-
|
|
5018
|
-
|
|
5019
|
-
|
|
5020
|
-
|
|
5021
|
-
|
|
5022
|
-
|
|
5029
|
+
* Returns the query title with the chart type.
|
|
5030
|
+
*
|
|
5031
|
+
* @param queryTitle - The query title
|
|
5032
|
+
* @param chartRecommendations - The chart recommendations
|
|
5033
|
+
* @returns The query title with the chart type
|
|
5034
|
+
*/
|
|
5023
5035
|
getQueryTitleWithChartType(e, t) {
|
|
5024
5036
|
let n = "chartType" in t ? t.chartType : "table";
|
|
5025
5037
|
return n !== "table" && (n += " chart"), `${n} showing ${e.toLowerCase()}`;
|
|
5026
5038
|
}
|
|
5027
5039
|
/**
|
|
5028
|
-
|
|
5029
|
-
|
|
5030
|
-
|
|
5031
|
-
|
|
5032
|
-
|
|
5040
|
+
* Takes a ExpandedQueryModel (e.g., from chat response) and translates it to SimpleQueryModel.
|
|
5041
|
+
*
|
|
5042
|
+
* @param expandedQueryModel - The Expanded Query model to simplify
|
|
5043
|
+
* @returns The simplified query model
|
|
5044
|
+
*/
|
|
5033
5045
|
translateToSimple(e) {
|
|
5034
5046
|
try {
|
|
5035
|
-
const { jaql: t, chartRecommendations: n, queryTitle: i } =
|
|
5047
|
+
const { jaql: t, chartRecommendations: n, queryTitle: i } = Ft(e);
|
|
5036
5048
|
return {
|
|
5037
5049
|
model: t.datasource.title,
|
|
5038
5050
|
metadata: t.metadata.map((r) => this.simplifyMetadataItem(r)),
|
|
@@ -5040,59 +5052,66 @@ class Ci {
|
|
|
5040
5052
|
queryTitle: this.getQueryTitleWithChartType(i, n)
|
|
5041
5053
|
};
|
|
5042
5054
|
} catch (t) {
|
|
5043
|
-
return console.error("Error running toSimpleQuery", t),
|
|
5055
|
+
return console.error("Error running toSimpleQuery", t), qt;
|
|
5044
5056
|
}
|
|
5045
5057
|
}
|
|
5046
5058
|
/**
|
|
5047
|
-
|
|
5048
|
-
|
|
5049
|
-
|
|
5050
|
-
|
|
5051
|
-
|
|
5059
|
+
* Stringifies a simple query model to YAML string.
|
|
5060
|
+
*
|
|
5061
|
+
* @param simpleQueryModel - The Simple Query model to convert
|
|
5062
|
+
* @returns The YAML string representing the simple query model
|
|
5063
|
+
*/
|
|
5052
5064
|
stringifySimple(e) {
|
|
5053
|
-
const r = e, { queryTitle: t } = r, n =
|
|
5065
|
+
const r = e, { queryTitle: t } = r, n = Kt(r, ["queryTitle"]), i = new Xt.Document(n);
|
|
5054
5066
|
return i.commentBefore = ` ${tn(t)}`, i.directives && (i.directives.docStart = !0), String(i);
|
|
5055
5067
|
}
|
|
5056
5068
|
/**
|
|
5057
|
-
|
|
5058
|
-
|
|
5069
|
+
* Returns the query template.
|
|
5070
|
+
*/
|
|
5059
5071
|
getQueryTemplate() {
|
|
5060
|
-
return sn(bi, {
|
|
5072
|
+
return sn(bi, {
|
|
5073
|
+
dataSourceTitle: this.contextTitle
|
|
5074
|
+
});
|
|
5061
5075
|
}
|
|
5062
5076
|
/**
|
|
5063
|
-
|
|
5064
|
-
|
|
5065
|
-
|
|
5066
|
-
|
|
5067
|
-
|
|
5077
|
+
* Parses a YAML string to Simple Query Model.
|
|
5078
|
+
*
|
|
5079
|
+
* @param simpleQueryYaml - The YAML string to parse
|
|
5080
|
+
* @returns The Simple Query Model
|
|
5081
|
+
*/
|
|
5068
5082
|
parseSimple(e) {
|
|
5069
5083
|
try {
|
|
5070
|
-
const t =
|
|
5084
|
+
const t = Xt.parseDocument(e), { commentBefore: n } = t, i = nn(t.toJS());
|
|
5071
5085
|
return i.queryTitle = (n == null ? void 0 : n.trim()) || "", i;
|
|
5072
5086
|
} catch (t) {
|
|
5073
5087
|
console.error("Error parsing the YAML string", t);
|
|
5074
5088
|
}
|
|
5075
|
-
return
|
|
5089
|
+
return qt;
|
|
5076
5090
|
}
|
|
5077
5091
|
/**
|
|
5078
|
-
|
|
5079
|
-
|
|
5080
|
-
|
|
5081
|
-
|
|
5082
|
-
|
|
5092
|
+
* Expands Chart Recommendations.
|
|
5093
|
+
*
|
|
5094
|
+
* @param chartRecommendations - The Chart Recommendations to expand
|
|
5095
|
+
* @returns The expanded chart recommendations
|
|
5096
|
+
*/
|
|
5083
5097
|
expandChartRecommendations(e) {
|
|
5084
5098
|
if (!e || !("dataOptions" in e))
|
|
5085
5099
|
return {};
|
|
5086
|
-
const { chartType: t, dataOptions: n } = e;
|
|
5087
|
-
return {
|
|
5100
|
+
const { chartType: t, dataOptions: n, styleOptions: i } = e;
|
|
5101
|
+
return {
|
|
5102
|
+
chartFamily: ln(t),
|
|
5103
|
+
chartType: t,
|
|
5104
|
+
axesMapping: n,
|
|
5105
|
+
styleOptions: i
|
|
5106
|
+
};
|
|
5088
5107
|
}
|
|
5089
5108
|
/**
|
|
5090
|
-
|
|
5091
|
-
|
|
5092
|
-
|
|
5093
|
-
|
|
5094
|
-
|
|
5095
|
-
|
|
5109
|
+
* Expands MetadataItemJaql by adding table, column, datatype, and title
|
|
5110
|
+
* if they are missing from the item.
|
|
5111
|
+
*
|
|
5112
|
+
* @param item - The MetadataItemJaql to expand
|
|
5113
|
+
* @returns The expanded MetadataItemJaql
|
|
5114
|
+
*/
|
|
5096
5115
|
expandMetadataItemJaql(e) {
|
|
5097
5116
|
const { dim: t = "", agg: n, context: i } = e;
|
|
5098
5117
|
i && (Object.keys(i).forEach((l) => {
|
|
@@ -5102,7 +5121,9 @@ class Ci {
|
|
|
5102
5121
|
if (!r)
|
|
5103
5122
|
return e;
|
|
5104
5123
|
let { filter: o } = e;
|
|
5105
|
-
return o != null && o.by && (o = G(R({}, o), {
|
|
5124
|
+
return o != null && o.by && (o = G(R({}, o), {
|
|
5125
|
+
by: this.expandMetadataItemJaql(o.by)
|
|
5126
|
+
}), e.filter = o), R({
|
|
5106
5127
|
table: r.table,
|
|
5107
5128
|
column: r.column,
|
|
5108
5129
|
datatype: r.dimtype,
|
|
@@ -5110,11 +5131,11 @@ class Ci {
|
|
|
5110
5131
|
}, e);
|
|
5111
5132
|
}
|
|
5112
5133
|
/**
|
|
5113
|
-
|
|
5114
|
-
|
|
5115
|
-
|
|
5116
|
-
|
|
5117
|
-
|
|
5134
|
+
* Expands MetadataItem
|
|
5135
|
+
*
|
|
5136
|
+
* @param item - The MetadataItem to expand
|
|
5137
|
+
* @returns The expanded MetadataItem
|
|
5138
|
+
*/
|
|
5118
5139
|
expandMetadataItem(e) {
|
|
5119
5140
|
const { jaql: t, measure: n } = e;
|
|
5120
5141
|
return n ? G(R({}, e), {
|
|
@@ -5125,53 +5146,54 @@ class Ci {
|
|
|
5125
5146
|
});
|
|
5126
5147
|
}
|
|
5127
5148
|
/**
|
|
5128
|
-
|
|
5129
|
-
|
|
5130
|
-
|
|
5131
|
-
|
|
5132
|
-
|
|
5149
|
+
* Translates a Simple Query Model to Expanded Query Model.
|
|
5150
|
+
*
|
|
5151
|
+
* @param simpleQueryModel - The Simple Query model to convert
|
|
5152
|
+
* @returns The Expanded Query Model
|
|
5153
|
+
*/
|
|
5133
5154
|
translateToExpanded(e) {
|
|
5134
|
-
const { model: t, metadata: n, chart: i, queryTitle: r } =
|
|
5135
|
-
datasource: {
|
|
5155
|
+
const { model: t, metadata: n, chart: i, queryTitle: r } = Ft(e), o = {
|
|
5156
|
+
datasource: {
|
|
5157
|
+
title: t
|
|
5158
|
+
},
|
|
5136
5159
|
metadata: n.map((a) => this.expandMetadataItem(a))
|
|
5137
5160
|
}, l = this.expandChartRecommendations(i);
|
|
5138
|
-
return {
|
|
5161
|
+
return {
|
|
5162
|
+
jaql: o,
|
|
5163
|
+
chartRecommendations: l,
|
|
5164
|
+
queryTitle: r
|
|
5165
|
+
};
|
|
5139
5166
|
}
|
|
5140
5167
|
}
|
|
5141
5168
|
const _i = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
|
|
5142
5169
|
__proto__: null
|
|
5143
5170
|
}, Symbol.toStringTag, { value: "Module" })), wi = "executeQueryTmpl", Si = "executePivotQueryTmpl", ki = (s, e, t) => {
|
|
5144
|
-
const n =
|
|
5171
|
+
const n = Zt(s), i = {
|
|
5145
5172
|
dataSourceString: es(s.dataSource),
|
|
5146
5173
|
dimensionsString: Te(s.dimensions || []),
|
|
5147
5174
|
measuresString: Te(s.measures || []),
|
|
5148
|
-
filtersString:
|
|
5175
|
+
filtersString: ts(s.filters),
|
|
5149
5176
|
highlightsString: Te(s.highlights || []),
|
|
5150
|
-
extraImportsString:
|
|
5177
|
+
extraImportsString: ss(s.filters || [], n)
|
|
5151
5178
|
};
|
|
5152
|
-
return
|
|
5179
|
+
return ns(t, i, e);
|
|
5153
5180
|
}, Ni = (s, e, t) => {
|
|
5154
|
-
const n =
|
|
5181
|
+
const n = Zt(s), i = {
|
|
5155
5182
|
dataSourceString: es(s.dataSource),
|
|
5156
5183
|
rowsString: Te(s.rows || []),
|
|
5157
5184
|
valuesString: Te(s.values || []),
|
|
5158
|
-
|
|
5185
|
+
filtersString: ts(s.filters),
|
|
5186
|
+
extraImportsString: ss(s.filters || [], n)
|
|
5159
5187
|
};
|
|
5160
|
-
return
|
|
5161
|
-
}, Oi = ({
|
|
5162
|
-
queryParams: s,
|
|
5163
|
-
uiFramework: e = "react"
|
|
5164
|
-
}) => ki(s, e, wi), Ti = ({
|
|
5165
|
-
pivotQueryParams: s,
|
|
5166
|
-
uiFramework: e = "react"
|
|
5167
|
-
}) => Ni(s, e, Si), Ii = (s) => Oi(s), Ai = (s) => Ti(s), Mi = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
|
|
5188
|
+
return ns(t, i, e);
|
|
5189
|
+
}, Oi = ({ queryParams: s, uiFramework: e = "react" }) => ki(s, e, wi), Ti = ({ pivotQueryParams: s, uiFramework: e = "react" }) => Ni(s, e, Si), Ii = (s) => Oi(s), Ai = (s) => Ti(s), Mi = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
|
|
5168
5190
|
__proto__: null,
|
|
5169
5191
|
toExecutePivotQueryCode: Ai,
|
|
5170
5192
|
toExecuteQueryCode: Ii
|
|
5171
5193
|
}, Symbol.toStringTag, { value: "Module" }));
|
|
5172
5194
|
export {
|
|
5173
5195
|
ji as EMPTY_EXPANDED_QUERY_MODEL,
|
|
5174
|
-
|
|
5196
|
+
qt as EMPTY_SIMPLE_QUERY_MODEL,
|
|
5175
5197
|
Ci as QueryTranslator,
|
|
5176
5198
|
_i as dashboardComposer,
|
|
5177
5199
|
Mi as executeQueryComposer,
|