@sisense/sdk-ai-core 0.2.11 → 0.3.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/engines/data-source-fields/data-source-fields-engine.d.ts +10 -0
- package/dist/engines/data-source-fields/data-source-fields-engine.d.ts.map +1 -0
- package/dist/engines/data-source-fields/index.d.ts +3 -0
- package/dist/engines/data-source-fields/index.d.ts.map +1 -0
- package/dist/engines/data-source-fields/types.d.ts +36 -0
- package/dist/engines/data-source-fields/types.d.ts.map +1 -0
- package/dist/engines/data-sources/data-sources-engine.d.ts +10 -0
- package/dist/engines/data-sources/data-sources-engine.d.ts.map +1 -0
- package/dist/engines/data-sources/index.d.ts +3 -0
- package/dist/engines/data-sources/index.d.ts.map +1 -0
- package/dist/engines/data-sources/types.d.ts +29 -0
- package/dist/engines/data-sources/types.d.ts.map +1 -0
- package/dist/engines/index.d.ts +2 -0
- package/dist/engines/index.d.ts.map +1 -1
- package/dist/index.js +583 -552
- package/dist/index.js.map +1 -1
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
import { z as o, ZodFirstPartyTypeKind as g } from "zod";
|
|
2
|
-
import { translateQueryJSON as
|
|
3
|
-
import { HttpClient as
|
|
4
|
-
import
|
|
5
|
-
import { isChartWidgetProps as Ee, getDashboardModel as
|
|
6
|
-
import { convertDataSource as Me, normalizeName as ve, DateLevels as
|
|
7
|
-
const
|
|
2
|
+
import { translateQueryJSON as ht, translateQueryToJaql as gt, widgetComposer as ft, getChartStyleOptions as ke } from "@sisense/sdk-ui/analytics-composer";
|
|
3
|
+
import { HttpClient as bt, getAuthenticator as yt } from "@sisense/sdk-rest-client";
|
|
4
|
+
import vt from "openai";
|
|
5
|
+
import { isChartWidgetProps as Ee, getDashboardModel as wt, dashboardModelTranslator as St, widgetModelTranslator as ye, translateFiltersAndRelationsToDto as Ot } from "@sisense/sdk-ui";
|
|
6
|
+
import { convertDataSource as Me, normalizeName as ve, DateLevels as Ct, convertJaqlDataSourceForDto as ie, isDataSourceInfo as se } from "@sisense/sdk-data";
|
|
7
|
+
const Dt = Symbol("Let zodToJsonSchema decide on which parser to use"), _t = {
|
|
8
8
|
name: void 0,
|
|
9
9
|
$refStrategy: "root",
|
|
10
10
|
basePath: ["#"],
|
|
@@ -27,11 +27,11 @@ const Ct = Symbol("Let zodToJsonSchema decide on which parser to use"), Dt = {
|
|
|
27
27
|
base64Strategy: "contentEncoding:base64",
|
|
28
28
|
nameStrategy: "ref",
|
|
29
29
|
openAiAnyTypeName: "OpenAiAnyType"
|
|
30
|
-
},
|
|
31
|
-
...
|
|
30
|
+
}, Pt = (e) => ({
|
|
31
|
+
..._t,
|
|
32
32
|
...e
|
|
33
|
-
}),
|
|
34
|
-
const t =
|
|
33
|
+
}), At = (e) => {
|
|
34
|
+
const t = Pt(e), n = t.name !== void 0 ? [...t.basePath, t.definitionPath, t.name] : t.basePath;
|
|
35
35
|
return {
|
|
36
36
|
...t,
|
|
37
37
|
flags: { hasReferencedOpenAiAnyType: !1 },
|
|
@@ -79,7 +79,7 @@ function _(e) {
|
|
|
79
79
|
$ref: e.$refStrategy === "relative" ? Ze(t, e.currentPath) : t.join("/")
|
|
80
80
|
};
|
|
81
81
|
}
|
|
82
|
-
function
|
|
82
|
+
function xt(e, t) {
|
|
83
83
|
var a, r, i;
|
|
84
84
|
const n = {
|
|
85
85
|
type: "array"
|
|
@@ -89,7 +89,7 @@ function At(e, t) {
|
|
|
89
89
|
currentPath: [...t.currentPath, "items"]
|
|
90
90
|
})), e.minLength && v(n, "minItems", e.minLength.value, e.minLength.message, t), e.maxLength && v(n, "maxItems", e.maxLength.value, e.maxLength.message, t), e.exactLength && (v(n, "minItems", e.exactLength.value, e.exactLength.message, t), v(n, "maxItems", e.exactLength.value, e.exactLength.message, t)), n;
|
|
91
91
|
}
|
|
92
|
-
function
|
|
92
|
+
function Tt(e, t) {
|
|
93
93
|
const n = {
|
|
94
94
|
type: "integer",
|
|
95
95
|
format: "int64"
|
|
@@ -118,7 +118,7 @@ function $t() {
|
|
|
118
118
|
function Ie(e, t) {
|
|
119
119
|
return y(e.type._def, t);
|
|
120
120
|
}
|
|
121
|
-
const
|
|
121
|
+
const jt = (e, t) => y(e.innerType._def, t);
|
|
122
122
|
function Le(e, t, n) {
|
|
123
123
|
const a = n ?? t.dateStrategy;
|
|
124
124
|
if (Array.isArray(a))
|
|
@@ -138,10 +138,10 @@ function Le(e, t, n) {
|
|
|
138
138
|
format: "date"
|
|
139
139
|
};
|
|
140
140
|
case "integer":
|
|
141
|
-
return
|
|
141
|
+
return kt(e, t);
|
|
142
142
|
}
|
|
143
143
|
}
|
|
144
|
-
const
|
|
144
|
+
const kt = (e, t) => {
|
|
145
145
|
const n = {
|
|
146
146
|
type: "integer",
|
|
147
147
|
format: "unix-time"
|
|
@@ -173,23 +173,23 @@ const jt = (e, t) => {
|
|
|
173
173
|
}
|
|
174
174
|
return n;
|
|
175
175
|
};
|
|
176
|
-
function
|
|
176
|
+
function Et(e, t) {
|
|
177
177
|
return {
|
|
178
178
|
...y(e.innerType._def, t),
|
|
179
179
|
default: e.defaultValue()
|
|
180
180
|
};
|
|
181
181
|
}
|
|
182
|
-
function
|
|
182
|
+
function Mt(e, t) {
|
|
183
183
|
return t.effectStrategy === "input" ? y(e.schema._def, t) : _(t);
|
|
184
184
|
}
|
|
185
|
-
function
|
|
185
|
+
function Nt(e) {
|
|
186
186
|
return {
|
|
187
187
|
type: "string",
|
|
188
188
|
enum: Array.from(e.values)
|
|
189
189
|
};
|
|
190
190
|
}
|
|
191
|
-
const
|
|
192
|
-
function
|
|
191
|
+
const Zt = (e) => "type" in e && e.type === "string" ? !1 : "allOf" in e;
|
|
192
|
+
function It(e, t) {
|
|
193
193
|
const n = [
|
|
194
194
|
y(e.left._def, {
|
|
195
195
|
...t,
|
|
@@ -203,7 +203,7 @@ function Zt(e, t) {
|
|
|
203
203
|
let a = t.target === "jsonSchema2019-09" ? { unevaluatedProperties: !1 } : void 0;
|
|
204
204
|
const r = [];
|
|
205
205
|
return n.forEach((i) => {
|
|
206
|
-
if (
|
|
206
|
+
if (Zt(i))
|
|
207
207
|
r.push(...i.allOf), i.unevaluatedProperties === void 0 && (a = void 0);
|
|
208
208
|
else {
|
|
209
209
|
let s = i;
|
|
@@ -219,7 +219,7 @@ function Zt(e, t) {
|
|
|
219
219
|
...a
|
|
220
220
|
} : void 0;
|
|
221
221
|
}
|
|
222
|
-
function
|
|
222
|
+
function Lt(e, t) {
|
|
223
223
|
const n = typeof e.value;
|
|
224
224
|
return n !== "bigint" && n !== "number" && n !== "boolean" && n !== "string" ? {
|
|
225
225
|
type: Array.isArray(e.value) ? "array" : "object"
|
|
@@ -384,13 +384,13 @@ function Re(e, t) {
|
|
|
384
384
|
return n;
|
|
385
385
|
}
|
|
386
386
|
function ae(e, t) {
|
|
387
|
-
return t.patternStrategy === "escape" ?
|
|
387
|
+
return t.patternStrategy === "escape" ? zt(e) : e;
|
|
388
388
|
}
|
|
389
|
-
const
|
|
390
|
-
function
|
|
389
|
+
const Rt = new Set("ABCDEFGHIJKLMNOPQRSTUVXYZabcdefghijklmnopqrstuvxyz0123456789");
|
|
390
|
+
function zt(e) {
|
|
391
391
|
let t = "";
|
|
392
392
|
for (let n = 0; n < e.length; n++)
|
|
393
|
-
|
|
393
|
+
Rt.has(e[n]) || (t += "\\"), t += e[n];
|
|
394
394
|
return t;
|
|
395
395
|
}
|
|
396
396
|
function x(e, t, n, a) {
|
|
@@ -518,7 +518,7 @@ function ze(e, t) {
|
|
|
518
518
|
}
|
|
519
519
|
return n;
|
|
520
520
|
}
|
|
521
|
-
function
|
|
521
|
+
function Bt(e, t) {
|
|
522
522
|
if (t.mapStrategy === "record")
|
|
523
523
|
return ze(e, t);
|
|
524
524
|
const n = y(e.keyType._def, {
|
|
@@ -539,14 +539,14 @@ function zt(e, t) {
|
|
|
539
539
|
}
|
|
540
540
|
};
|
|
541
541
|
}
|
|
542
|
-
function
|
|
542
|
+
function Ut(e) {
|
|
543
543
|
const t = e.values, a = Object.keys(e.values).filter((i) => typeof t[t[i]] != "number").map((i) => t[i]), r = Array.from(new Set(a.map((i) => typeof i)));
|
|
544
544
|
return {
|
|
545
545
|
type: r.length === 1 ? r[0] === "string" ? "string" : "number" : ["string", "number"],
|
|
546
546
|
enum: a
|
|
547
547
|
};
|
|
548
548
|
}
|
|
549
|
-
function
|
|
549
|
+
function Ft(e) {
|
|
550
550
|
return e.target === "openAi" ? void 0 : {
|
|
551
551
|
not: _({
|
|
552
552
|
...e,
|
|
@@ -554,7 +554,7 @@ function Ut(e) {
|
|
|
554
554
|
})
|
|
555
555
|
};
|
|
556
556
|
}
|
|
557
|
-
function
|
|
557
|
+
function qt(e) {
|
|
558
558
|
return e.target === "openApi3" ? {
|
|
559
559
|
enum: ["null"],
|
|
560
560
|
nullable: !0
|
|
@@ -569,7 +569,7 @@ const X = {
|
|
|
569
569
|
ZodBoolean: "boolean",
|
|
570
570
|
ZodNull: "null"
|
|
571
571
|
};
|
|
572
|
-
function
|
|
572
|
+
function Wt(e, t) {
|
|
573
573
|
if (t.target === "openApi3")
|
|
574
574
|
return Se(e, t);
|
|
575
575
|
const n = e.options instanceof Map ? Array.from(e.options.values()) : e.options;
|
|
@@ -625,7 +625,7 @@ const Se = (e, t) => {
|
|
|
625
625
|
})).filter((a) => !!a && (!t.strictUnions || typeof a == "object" && Object.keys(a).length > 0));
|
|
626
626
|
return n.length ? { anyOf: n } : void 0;
|
|
627
627
|
};
|
|
628
|
-
function
|
|
628
|
+
function Ht(e, t) {
|
|
629
629
|
if (["ZodString", "ZodNumber", "ZodBigInt", "ZodBoolean", "ZodNull"].includes(e.innerType._def.typeName) && (!e.innerType._def.checks || !e.innerType._def.checks.length))
|
|
630
630
|
return t.target === "openApi3" ? {
|
|
631
631
|
type: X[e.innerType._def.typeName],
|
|
@@ -649,7 +649,7 @@ function Wt(e, t) {
|
|
|
649
649
|
});
|
|
650
650
|
return n && { anyOf: [n, { type: "null" }] };
|
|
651
651
|
}
|
|
652
|
-
function
|
|
652
|
+
function Vt(e, t) {
|
|
653
653
|
const n = {
|
|
654
654
|
type: "number"
|
|
655
655
|
};
|
|
@@ -672,7 +672,7 @@ function Ht(e, t) {
|
|
|
672
672
|
}
|
|
673
673
|
return n;
|
|
674
674
|
}
|
|
675
|
-
function
|
|
675
|
+
function Jt(e, t) {
|
|
676
676
|
const n = t.target === "openAi", a = {
|
|
677
677
|
type: "object",
|
|
678
678
|
properties: {}
|
|
@@ -681,7 +681,7 @@ function Vt(e, t) {
|
|
|
681
681
|
let c = i[l];
|
|
682
682
|
if (c === void 0 || c._def === void 0)
|
|
683
683
|
continue;
|
|
684
|
-
let u =
|
|
684
|
+
let u = Gt(c);
|
|
685
685
|
u && n && (c._def.typeName === "ZodOptional" && (c = c._def.innerType), c.isNullable() || (c = c.nullable()), u = !1);
|
|
686
686
|
const d = y(c._def, {
|
|
687
687
|
...t,
|
|
@@ -691,10 +691,10 @@ function Vt(e, t) {
|
|
|
691
691
|
d !== void 0 && (a.properties[l] = d, u || r.push(l));
|
|
692
692
|
}
|
|
693
693
|
r.length && (a.required = r);
|
|
694
|
-
const s =
|
|
694
|
+
const s = Yt(e, t);
|
|
695
695
|
return s !== void 0 && (a.additionalProperties = s), a;
|
|
696
696
|
}
|
|
697
|
-
function
|
|
697
|
+
function Yt(e, t) {
|
|
698
698
|
if (e.catchall._def.typeName !== "ZodNever")
|
|
699
699
|
return y(e.catchall._def, {
|
|
700
700
|
...t,
|
|
@@ -709,14 +709,14 @@ function Jt(e, t) {
|
|
|
709
709
|
return t.removeAdditionalStrategy === "strict" ? t.allowedAdditionalProperties : t.rejectedAdditionalProperties;
|
|
710
710
|
}
|
|
711
711
|
}
|
|
712
|
-
function
|
|
712
|
+
function Gt(e) {
|
|
713
713
|
try {
|
|
714
714
|
return e.isOptional();
|
|
715
715
|
} catch {
|
|
716
716
|
return !0;
|
|
717
717
|
}
|
|
718
718
|
}
|
|
719
|
-
const
|
|
719
|
+
const Qt = (e, t) => {
|
|
720
720
|
var a;
|
|
721
721
|
if (t.currentPath.toString() === ((a = t.propertyPath) == null ? void 0 : a.toString()))
|
|
722
722
|
return y(e.innerType._def, t);
|
|
@@ -732,7 +732,7 @@ const Gt = (e, t) => {
|
|
|
732
732
|
n
|
|
733
733
|
]
|
|
734
734
|
} : _(t);
|
|
735
|
-
},
|
|
735
|
+
}, Xt = (e, t) => {
|
|
736
736
|
if (t.pipeStrategy === "input")
|
|
737
737
|
return y(e.in._def, t);
|
|
738
738
|
if (t.pipeStrategy === "output")
|
|
@@ -748,10 +748,10 @@ const Gt = (e, t) => {
|
|
|
748
748
|
allOf: [n, a].filter((r) => r !== void 0)
|
|
749
749
|
};
|
|
750
750
|
};
|
|
751
|
-
function
|
|
751
|
+
function Kt(e, t) {
|
|
752
752
|
return y(e.type._def, t);
|
|
753
753
|
}
|
|
754
|
-
function
|
|
754
|
+
function en(e, t) {
|
|
755
755
|
const a = {
|
|
756
756
|
type: "array",
|
|
757
757
|
uniqueItems: !0,
|
|
@@ -762,7 +762,7 @@ function Kt(e, t) {
|
|
|
762
762
|
};
|
|
763
763
|
return e.minSize && v(a, "minItems", e.minSize.value, e.minSize.message, t), e.maxSize && v(a, "maxItems", e.maxSize.value, e.maxSize.message, t), a;
|
|
764
764
|
}
|
|
765
|
-
function
|
|
765
|
+
function tn(e, t) {
|
|
766
766
|
return e.rest ? {
|
|
767
767
|
type: "array",
|
|
768
768
|
minItems: e.items.length,
|
|
@@ -784,80 +784,80 @@ function en(e, t) {
|
|
|
784
784
|
})).reduce((n, a) => a === void 0 ? n : [...n, a], [])
|
|
785
785
|
};
|
|
786
786
|
}
|
|
787
|
-
function
|
|
787
|
+
function nn(e) {
|
|
788
788
|
return {
|
|
789
789
|
not: _(e)
|
|
790
790
|
};
|
|
791
791
|
}
|
|
792
|
-
function
|
|
792
|
+
function an(e) {
|
|
793
793
|
return _(e);
|
|
794
794
|
}
|
|
795
|
-
const
|
|
795
|
+
const rn = (e, t) => y(e.innerType._def, t), on = (e, t, n) => {
|
|
796
796
|
switch (t) {
|
|
797
797
|
case h.ZodString:
|
|
798
798
|
return Re(e, n);
|
|
799
799
|
case h.ZodNumber:
|
|
800
|
-
return Ht(e, n);
|
|
801
|
-
case h.ZodObject:
|
|
802
800
|
return Vt(e, n);
|
|
801
|
+
case h.ZodObject:
|
|
802
|
+
return Jt(e, n);
|
|
803
803
|
case h.ZodBigInt:
|
|
804
|
-
return
|
|
804
|
+
return Tt(e, n);
|
|
805
805
|
case h.ZodBoolean:
|
|
806
806
|
return $t();
|
|
807
807
|
case h.ZodDate:
|
|
808
808
|
return Le(e, n);
|
|
809
809
|
case h.ZodUndefined:
|
|
810
|
-
return
|
|
810
|
+
return nn(n);
|
|
811
811
|
case h.ZodNull:
|
|
812
|
-
return
|
|
812
|
+
return qt(n);
|
|
813
813
|
case h.ZodArray:
|
|
814
|
-
return
|
|
814
|
+
return xt(e, n);
|
|
815
815
|
case h.ZodUnion:
|
|
816
816
|
case h.ZodDiscriminatedUnion:
|
|
817
|
-
return
|
|
817
|
+
return Wt(e, n);
|
|
818
818
|
case h.ZodIntersection:
|
|
819
|
-
return
|
|
819
|
+
return It(e, n);
|
|
820
820
|
case h.ZodTuple:
|
|
821
|
-
return
|
|
821
|
+
return tn(e, n);
|
|
822
822
|
case h.ZodRecord:
|
|
823
823
|
return ze(e, n);
|
|
824
824
|
case h.ZodLiteral:
|
|
825
|
-
return
|
|
825
|
+
return Lt(e, n);
|
|
826
826
|
case h.ZodEnum:
|
|
827
|
-
return
|
|
827
|
+
return Nt(e);
|
|
828
828
|
case h.ZodNativeEnum:
|
|
829
|
-
return
|
|
829
|
+
return Ut(e);
|
|
830
830
|
case h.ZodNullable:
|
|
831
|
-
return
|
|
831
|
+
return Ht(e, n);
|
|
832
832
|
case h.ZodOptional:
|
|
833
|
-
return
|
|
833
|
+
return Qt(e, n);
|
|
834
834
|
case h.ZodMap:
|
|
835
|
-
return
|
|
835
|
+
return Bt(e, n);
|
|
836
836
|
case h.ZodSet:
|
|
837
|
-
return
|
|
837
|
+
return en(e, n);
|
|
838
838
|
case h.ZodLazy:
|
|
839
839
|
return () => e.getter()._def;
|
|
840
840
|
case h.ZodPromise:
|
|
841
|
-
return
|
|
841
|
+
return Kt(e, n);
|
|
842
842
|
case h.ZodNaN:
|
|
843
843
|
case h.ZodNever:
|
|
844
|
-
return
|
|
844
|
+
return Ft(n);
|
|
845
845
|
case h.ZodEffects:
|
|
846
|
-
return
|
|
846
|
+
return Mt(e, n);
|
|
847
847
|
case h.ZodAny:
|
|
848
848
|
return _(n);
|
|
849
849
|
case h.ZodUnknown:
|
|
850
|
-
return
|
|
850
|
+
return an(n);
|
|
851
851
|
case h.ZodDefault:
|
|
852
|
-
return
|
|
852
|
+
return Et(e, n);
|
|
853
853
|
case h.ZodBranded:
|
|
854
854
|
return Ie(e, n);
|
|
855
855
|
case h.ZodReadonly:
|
|
856
|
-
return
|
|
856
|
+
return rn(e, n);
|
|
857
857
|
case h.ZodCatch:
|
|
858
|
-
return
|
|
858
|
+
return jt(e, n);
|
|
859
859
|
case h.ZodPipeline:
|
|
860
|
-
return
|
|
860
|
+
return Xt(e, n);
|
|
861
861
|
case h.ZodFunction:
|
|
862
862
|
case h.ZodVoid:
|
|
863
863
|
case h.ZodSymbol:
|
|
@@ -872,24 +872,24 @@ function y(e, t, n = !1) {
|
|
|
872
872
|
const a = t.seen.get(e);
|
|
873
873
|
if (t.override) {
|
|
874
874
|
const c = (l = t.override) == null ? void 0 : l.call(t, e, t, a, n);
|
|
875
|
-
if (c !==
|
|
875
|
+
if (c !== Dt)
|
|
876
876
|
return c;
|
|
877
877
|
}
|
|
878
878
|
if (a && !n) {
|
|
879
|
-
const c =
|
|
879
|
+
const c = sn(a, t);
|
|
880
880
|
if (c !== void 0)
|
|
881
881
|
return c;
|
|
882
882
|
}
|
|
883
883
|
const r = { def: e, path: t.currentPath, jsonSchema: void 0 };
|
|
884
884
|
t.seen.set(e, r);
|
|
885
|
-
const i =
|
|
886
|
-
if (s &&
|
|
885
|
+
const i = on(e, e.typeName, t), s = typeof i == "function" ? y(i(), t) : i;
|
|
886
|
+
if (s && ln(e, t, s), t.postProcess) {
|
|
887
887
|
const c = t.postProcess(s, e, t);
|
|
888
888
|
return r.jsonSchema = s, c;
|
|
889
889
|
}
|
|
890
890
|
return r.jsonSchema = s, s;
|
|
891
891
|
}
|
|
892
|
-
const
|
|
892
|
+
const sn = (e, t) => {
|
|
893
893
|
switch (t.$refStrategy) {
|
|
894
894
|
case "root":
|
|
895
895
|
return { $ref: e.path.join("/") };
|
|
@@ -899,8 +899,8 @@ const on = (e, t) => {
|
|
|
899
899
|
case "seen":
|
|
900
900
|
return e.path.length < t.currentPath.length && e.path.every((n, a) => t.currentPath[a] === n) ? (console.warn(`Recursive reference detected at ${t.currentPath.join("/")}! Defaulting to any`), _(t)) : t.$refStrategy === "seen" ? _(t) : void 0;
|
|
901
901
|
}
|
|
902
|
-
},
|
|
903
|
-
const n =
|
|
902
|
+
}, ln = (e, t, n) => (e.description && (n.description = e.description, t.markdownDescription && (n.markdownDescription = e.description)), n), cn = (e, t) => {
|
|
903
|
+
const n = At(t);
|
|
904
904
|
let a;
|
|
905
905
|
const r = t == null ? void 0 : t.name, i = y(
|
|
906
906
|
e._def,
|
|
@@ -1000,13 +1000,13 @@ const on = (e, t) => {
|
|
|
1000
1000
|
return o.ZodObject.create(r, e._def);
|
|
1001
1001
|
}
|
|
1002
1002
|
return e;
|
|
1003
|
-
}, re = (e, t) => M(e, t, "include"),
|
|
1003
|
+
}, re = (e, t) => M(e, t, "include"), un = (e, t) => M(e, t, "exclude"), P = (e, t = 0, n, a) => e instanceof o.ZodOptional ? P(e.unwrap(), t) : e instanceof o.ZodNullable ? P(e.unwrap(), t) + " | null" : e instanceof o.ZodArray ? `Array<${P(e.element, t)}>${e.description ? ` - ${e.description}` : ""}` : e instanceof o.ZodObject ? `{
|
|
1004
1004
|
${Object.entries(e.shape).map(
|
|
1005
1005
|
([i, s]) => `${Oe(t + 1)}${i}${s.isOptional() ? "?" : ""}: ${P(s, t + 1, i, s.isOptional())}${s.description ? ` - ${s.description}` : ""}`
|
|
1006
1006
|
).join(`,
|
|
1007
1007
|
`)}
|
|
1008
1008
|
${Oe(t)}}` + (e.description ? ` - ${e.description}` : "") : e instanceof o.ZodEnum ? e.options.map((i) => `"${i}"`).join(" | ") + (e.description ? ` - ${e.description}` : "") : e instanceof o.ZodUnion ? e.options.map((r) => P(r, t)).join(" | ") : e instanceof o.ZodLiteral ? JSON.stringify(e.value) : e instanceof o.ZodString ? "string" : e instanceof o.ZodNumber ? "number" : e instanceof o.ZodBoolean ? "boolean" : "any";
|
|
1009
|
-
function
|
|
1009
|
+
function dn({
|
|
1010
1010
|
function: e,
|
|
1011
1011
|
schema: t,
|
|
1012
1012
|
description: n = "",
|
|
@@ -1020,7 +1020,7 @@ function un({
|
|
|
1020
1020
|
name: a ?? e.name,
|
|
1021
1021
|
description: n,
|
|
1022
1022
|
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
1023
|
-
parameters:
|
|
1023
|
+
parameters: cn(t),
|
|
1024
1024
|
strict: r,
|
|
1025
1025
|
parse(i) {
|
|
1026
1026
|
const s = JSON.parse(i);
|
|
@@ -1029,7 +1029,7 @@ function un({
|
|
|
1029
1029
|
}
|
|
1030
1030
|
};
|
|
1031
1031
|
}
|
|
1032
|
-
const Be = o.enum(["bar", "column", "area", "line", "polar"]), Ue = o.enum(["pie", "funnel", "treemap", "sunburst"]),
|
|
1032
|
+
const Be = o.enum(["bar", "column", "area", "line", "polar"]), Ue = o.enum(["pie", "funnel", "treemap", "sunburst"]), pn = o.enum([
|
|
1033
1033
|
"scatter",
|
|
1034
1034
|
"table",
|
|
1035
1035
|
"indicator",
|
|
@@ -1040,17 +1040,17 @@ const Be = o.enum(["bar", "column", "area", "line", "polar"]), Ue = o.enum(["pie
|
|
|
1040
1040
|
]), ee = o.enum([
|
|
1041
1041
|
...Be.options,
|
|
1042
1042
|
...Ue.options,
|
|
1043
|
-
...
|
|
1044
|
-
]),
|
|
1043
|
+
...pn.options
|
|
1044
|
+
]), mn = o.object({
|
|
1045
1045
|
type: Be,
|
|
1046
1046
|
category: o.array(o.number()),
|
|
1047
1047
|
value: o.array(o.number()),
|
|
1048
1048
|
breakBy: o.array(o.number())
|
|
1049
|
-
}).strict(),
|
|
1049
|
+
}).strict(), hn = o.object({
|
|
1050
1050
|
type: Ue,
|
|
1051
1051
|
category: o.array(o.number()),
|
|
1052
1052
|
value: o.array(o.number())
|
|
1053
|
-
}).strict(),
|
|
1053
|
+
}).strict(), gn = o.object({
|
|
1054
1054
|
type: o.literal("scatter"),
|
|
1055
1055
|
x: o.array(o.number()),
|
|
1056
1056
|
y: o.array(o.number()),
|
|
@@ -1058,41 +1058,40 @@ const Be = o.enum(["bar", "column", "area", "line", "polar"]), Ue = o.enum(["pie
|
|
|
1058
1058
|
breakByColor: o.array(o.number()),
|
|
1059
1059
|
size: o.array(o.number())
|
|
1060
1060
|
// showLegend: z.boolean(),
|
|
1061
|
-
}).strict(),
|
|
1061
|
+
}).strict(), fn = o.object({
|
|
1062
1062
|
type: o.literal("table"),
|
|
1063
1063
|
columns: o.array(o.number()),
|
|
1064
1064
|
pagination: o.boolean(),
|
|
1065
1065
|
rowsPerPage: o.number()
|
|
1066
|
-
}).strict(),
|
|
1066
|
+
}).strict(), bn = o.object({
|
|
1067
1067
|
type: o.literal("range"),
|
|
1068
1068
|
category: o.array(o.number()),
|
|
1069
1069
|
value: o.array(o.number()),
|
|
1070
1070
|
breakBy: o.array(o.number())
|
|
1071
|
-
}).strict(),
|
|
1071
|
+
}).strict(), yn = o.object({
|
|
1072
1072
|
type: o.literal("indicator"),
|
|
1073
1073
|
value: o.array(o.number()),
|
|
1074
1074
|
secondary: o.array(o.number()),
|
|
1075
1075
|
min: o.array(o.number()),
|
|
1076
1076
|
max: o.array(o.number())
|
|
1077
|
-
}).strict(),
|
|
1077
|
+
}).strict(), vn = o.object({
|
|
1078
1078
|
type: o.literal("boxplot"),
|
|
1079
1079
|
category: o.array(o.number()),
|
|
1080
1080
|
value: o.array(o.number()),
|
|
1081
1081
|
boxType: o.enum(["iqr", "extremums", "standardDeviation"]),
|
|
1082
1082
|
outliersEnabled: o.boolean()
|
|
1083
|
-
}).strict(),
|
|
1083
|
+
}).strict(), wn = o.object({
|
|
1084
1084
|
type: o.literal("areamap"),
|
|
1085
1085
|
geo: o.array(o.number()),
|
|
1086
1086
|
color: o.array(o.number())
|
|
1087
|
-
}).strict(),
|
|
1087
|
+
}).strict(), Sn = o.object({
|
|
1088
1088
|
type: o.literal("scattermap"),
|
|
1089
1089
|
geo: o.array(o.number()),
|
|
1090
1090
|
size: o.array(o.number()),
|
|
1091
1091
|
colorBy: o.array(o.number()),
|
|
1092
1092
|
details: o.array(o.number()),
|
|
1093
1093
|
locationLevel: o.enum(["auto", "country", "state", "city"])
|
|
1094
|
-
}).strict(),
|
|
1095
|
-
pn,
|
|
1094
|
+
}).strict(), On = o.discriminatedUnion("type", [
|
|
1096
1095
|
mn,
|
|
1097
1096
|
hn,
|
|
1098
1097
|
gn,
|
|
@@ -1100,15 +1099,16 @@ const Be = o.enum(["bar", "column", "area", "line", "polar"]), Ue = o.enum(["pie
|
|
|
1100
1099
|
bn,
|
|
1101
1100
|
yn,
|
|
1102
1101
|
vn,
|
|
1103
|
-
wn
|
|
1104
|
-
|
|
1102
|
+
wn,
|
|
1103
|
+
Sn
|
|
1104
|
+
]), Cn = ee.nullable().describe(
|
|
1105
1105
|
"If the user prompt does not specify a known chart type, pass null; otherwise, pass the specified chart type"
|
|
1106
|
-
),
|
|
1106
|
+
), Dn = o.string().describe(
|
|
1107
1107
|
'The ID of the chart to update. If not provided, use value "chart_id_placeholder"'
|
|
1108
|
-
).default("chart_id_placeholder"),
|
|
1108
|
+
).default("chart_id_placeholder"), _n = o.object({
|
|
1109
1109
|
chartType: ee,
|
|
1110
|
-
axesMapping:
|
|
1111
|
-
}),
|
|
1110
|
+
axesMapping: On
|
|
1111
|
+
}), Ao = o.object({
|
|
1112
1112
|
dataSourceTitle: o.string().describe("Data source title"),
|
|
1113
1113
|
userPrompt: o.string().describe(
|
|
1114
1114
|
`Combined natural language user prompt describing multiple actions on a chart. Do not split the user prompt into multiple requests.
|
|
@@ -1121,17 +1121,17 @@ When responding to changes involving an existing chart:
|
|
|
1121
1121
|
userPrompt: o.string().describe(
|
|
1122
1122
|
"Natural language user prompt describing a single action on a chart"
|
|
1123
1123
|
)
|
|
1124
|
-
}),
|
|
1125
|
-
chartType:
|
|
1124
|
+
}), Pn = Fe.extend({
|
|
1125
|
+
chartType: Cn,
|
|
1126
1126
|
chartTitle: o.string().describe("The new chart title")
|
|
1127
1127
|
}), L = Fe.extend({
|
|
1128
|
-
chartId:
|
|
1129
|
-
}), Pn = L.extend({
|
|
1130
|
-
chartTitle: o.string().describe("The new chart title")
|
|
1128
|
+
chartId: Dn
|
|
1131
1129
|
}), An = L.extend({
|
|
1130
|
+
chartTitle: o.string().describe("The new chart title")
|
|
1131
|
+
}), xn = L.extend({
|
|
1132
1132
|
chartType: ee
|
|
1133
|
-
}),
|
|
1134
|
-
let
|
|
1133
|
+
}), Tn = L, $n = L, jn = L, kn = L, En = L;
|
|
1134
|
+
let Mn = (e) => crypto.getRandomValues(new Uint8Array(e)), Nn = (e, t, n) => {
|
|
1135
1135
|
let a = (2 << Math.log2(e.length - 1)) - 1, r = -~(1.6 * a * t / e.length);
|
|
1136
1136
|
return (i = t) => {
|
|
1137
1137
|
let s = "";
|
|
@@ -1141,13 +1141,13 @@ let En = (e) => crypto.getRandomValues(new Uint8Array(e)), Mn = (e, t, n) => {
|
|
|
1141
1141
|
if (s += e[l[c] & a] || "", s.length >= i) return s;
|
|
1142
1142
|
}
|
|
1143
1143
|
};
|
|
1144
|
-
}, qe = (e, t = 21) =>
|
|
1144
|
+
}, qe = (e, t = 21) => Nn(e, t | 0, Mn);
|
|
1145
1145
|
const me = qe("0123456789abcdef", 24);
|
|
1146
1146
|
function le() {
|
|
1147
1147
|
const t = qe("0123456789abcdef", 32)();
|
|
1148
1148
|
return t.substring(0, 8) + "-" + t.substring(8, 12) + "-4" + t.substring(13, 16) + "-" + (parseInt(t[16], 16) & 3 | 8).toString(16) + t.substring(17, 20) + "-" + t.substring(20);
|
|
1149
1149
|
}
|
|
1150
|
-
function
|
|
1150
|
+
function Zn(e, t) {
|
|
1151
1151
|
const n = { ...e };
|
|
1152
1152
|
return Object.defineProperties(n, {
|
|
1153
1153
|
$brand: {
|
|
@@ -1160,7 +1160,7 @@ function Nn(e, t) {
|
|
|
1160
1160
|
}
|
|
1161
1161
|
}), n;
|
|
1162
1162
|
}
|
|
1163
|
-
const
|
|
1163
|
+
const In = Symbol("Let zodToJsonSchema decide on which parser to use"), Ce = {
|
|
1164
1164
|
name: void 0,
|
|
1165
1165
|
$refStrategy: "root",
|
|
1166
1166
|
effectStrategy: "input",
|
|
@@ -1179,7 +1179,7 @@ const Zn = Symbol("Let zodToJsonSchema decide on which parser to use"), Ce = {
|
|
|
1179
1179
|
emailStrategy: "format:email",
|
|
1180
1180
|
base64Strategy: "contentEncoding:base64",
|
|
1181
1181
|
nameStrategy: "ref"
|
|
1182
|
-
},
|
|
1182
|
+
}, Ln = (e) => typeof e == "string" ? {
|
|
1183
1183
|
...Ce,
|
|
1184
1184
|
basePath: ["#"],
|
|
1185
1185
|
definitions: {},
|
|
@@ -1190,15 +1190,15 @@ const Zn = Symbol("Let zodToJsonSchema decide on which parser to use"), Ce = {
|
|
|
1190
1190
|
definitions: {},
|
|
1191
1191
|
...e
|
|
1192
1192
|
}, ce = (e) => "_def" in e ? e._def : e;
|
|
1193
|
-
function
|
|
1193
|
+
function Rn(e) {
|
|
1194
1194
|
if (!e)
|
|
1195
1195
|
return !0;
|
|
1196
1196
|
for (const t in e)
|
|
1197
1197
|
return !1;
|
|
1198
1198
|
return !0;
|
|
1199
1199
|
}
|
|
1200
|
-
const
|
|
1201
|
-
const t =
|
|
1200
|
+
const zn = (e) => {
|
|
1201
|
+
const t = Ln(e), n = t.name !== void 0 ? [...t.basePath, t.definitionPath, t.name] : t.basePath;
|
|
1202
1202
|
return {
|
|
1203
1203
|
...t,
|
|
1204
1204
|
currentPath: n,
|
|
@@ -1224,10 +1224,10 @@ function We(e, t, n, a) {
|
|
|
1224
1224
|
function w(e, t, n, a, r) {
|
|
1225
1225
|
e[t] = n, We(e, t, a, r);
|
|
1226
1226
|
}
|
|
1227
|
-
function
|
|
1227
|
+
function Bn() {
|
|
1228
1228
|
return {};
|
|
1229
1229
|
}
|
|
1230
|
-
function
|
|
1230
|
+
function Un(e, t) {
|
|
1231
1231
|
var a, r;
|
|
1232
1232
|
const n = {
|
|
1233
1233
|
type: "array"
|
|
@@ -1237,7 +1237,7 @@ function Bn(e, t) {
|
|
|
1237
1237
|
currentPath: [...t.currentPath, "items"]
|
|
1238
1238
|
})), e.minLength && w(n, "minItems", e.minLength.value, e.minLength.message, t), e.maxLength && w(n, "maxItems", e.maxLength.value, e.maxLength.message, t), e.exactLength && (w(n, "minItems", e.exactLength.value, e.exactLength.message, t), w(n, "maxItems", e.exactLength.value, e.exactLength.message, t)), n;
|
|
1239
1239
|
}
|
|
1240
|
-
function
|
|
1240
|
+
function Fn(e, t) {
|
|
1241
1241
|
const n = {
|
|
1242
1242
|
type: "integer",
|
|
1243
1243
|
format: "int64"
|
|
@@ -1258,15 +1258,15 @@ function Un(e, t) {
|
|
|
1258
1258
|
}
|
|
1259
1259
|
return n;
|
|
1260
1260
|
}
|
|
1261
|
-
function
|
|
1261
|
+
function qn() {
|
|
1262
1262
|
return {
|
|
1263
1263
|
type: "boolean"
|
|
1264
1264
|
};
|
|
1265
1265
|
}
|
|
1266
|
-
function
|
|
1266
|
+
function Wn(e, t) {
|
|
1267
1267
|
return b(e.type._def, t);
|
|
1268
1268
|
}
|
|
1269
|
-
const
|
|
1269
|
+
const Hn = (e, t) => b(e.innerType._def, t);
|
|
1270
1270
|
function He(e, t, n) {
|
|
1271
1271
|
const a = n ?? t.dateStrategy;
|
|
1272
1272
|
if (Array.isArray(a))
|
|
@@ -1286,10 +1286,10 @@ function He(e, t, n) {
|
|
|
1286
1286
|
format: "date"
|
|
1287
1287
|
};
|
|
1288
1288
|
case "integer":
|
|
1289
|
-
return
|
|
1289
|
+
return Vn(e, t);
|
|
1290
1290
|
}
|
|
1291
1291
|
}
|
|
1292
|
-
const
|
|
1292
|
+
const Vn = (e, t) => {
|
|
1293
1293
|
const n = {
|
|
1294
1294
|
type: "integer",
|
|
1295
1295
|
format: "unix-time"
|
|
@@ -1321,23 +1321,23 @@ const Hn = (e, t) => {
|
|
|
1321
1321
|
}
|
|
1322
1322
|
return n;
|
|
1323
1323
|
};
|
|
1324
|
-
function
|
|
1324
|
+
function Jn(e, t) {
|
|
1325
1325
|
return {
|
|
1326
1326
|
...b(e.innerType._def, t),
|
|
1327
1327
|
default: e.defaultValue()
|
|
1328
1328
|
};
|
|
1329
1329
|
}
|
|
1330
|
-
function
|
|
1330
|
+
function Yn(e, t, n) {
|
|
1331
1331
|
return t.effectStrategy === "input" ? b(e.schema._def, t, n) : {};
|
|
1332
1332
|
}
|
|
1333
|
-
function
|
|
1333
|
+
function Gn(e) {
|
|
1334
1334
|
return {
|
|
1335
1335
|
type: "string",
|
|
1336
1336
|
enum: [...e.values]
|
|
1337
1337
|
};
|
|
1338
1338
|
}
|
|
1339
|
-
const
|
|
1340
|
-
function
|
|
1339
|
+
const Qn = (e) => "type" in e && e.type === "string" ? !1 : "allOf" in e;
|
|
1340
|
+
function Xn(e, t) {
|
|
1341
1341
|
const n = [
|
|
1342
1342
|
b(e.left._def, {
|
|
1343
1343
|
...t,
|
|
@@ -1351,7 +1351,7 @@ function Qn(e, t) {
|
|
|
1351
1351
|
let a = t.target === "jsonSchema2019-09" ? { unevaluatedProperties: !1 } : void 0;
|
|
1352
1352
|
const r = [];
|
|
1353
1353
|
return n.forEach((i) => {
|
|
1354
|
-
if (
|
|
1354
|
+
if (Qn(i))
|
|
1355
1355
|
r.push(...i.allOf), i.unevaluatedProperties === void 0 && (a = void 0);
|
|
1356
1356
|
else {
|
|
1357
1357
|
let s = i;
|
|
@@ -1367,7 +1367,7 @@ function Qn(e, t) {
|
|
|
1367
1367
|
...a
|
|
1368
1368
|
} : void 0;
|
|
1369
1369
|
}
|
|
1370
|
-
function
|
|
1370
|
+
function Kn(e, t) {
|
|
1371
1371
|
const n = typeof e.value;
|
|
1372
1372
|
return n !== "bigint" && n !== "number" && n !== "boolean" && n !== "string" ? {
|
|
1373
1373
|
type: Array.isArray(e.value) ? "array" : "object"
|
|
@@ -1411,7 +1411,7 @@ function Ve(e, t) {
|
|
|
1411
1411
|
type: "string"
|
|
1412
1412
|
};
|
|
1413
1413
|
function a(r) {
|
|
1414
|
-
return t.patternStrategy === "escape" ?
|
|
1414
|
+
return t.patternStrategy === "escape" ? ea(r) : r;
|
|
1415
1415
|
}
|
|
1416
1416
|
if (e.checks)
|
|
1417
1417
|
for (const r of e.checks)
|
|
@@ -1425,71 +1425,71 @@ function Ve(e, t) {
|
|
|
1425
1425
|
case "email":
|
|
1426
1426
|
switch (t.emailStrategy) {
|
|
1427
1427
|
case "format:email":
|
|
1428
|
-
|
|
1428
|
+
T(n, "email", r.message, t);
|
|
1429
1429
|
break;
|
|
1430
1430
|
case "format:idn-email":
|
|
1431
|
-
|
|
1431
|
+
T(n, "idn-email", r.message, t);
|
|
1432
1432
|
break;
|
|
1433
1433
|
case "pattern:zod":
|
|
1434
|
-
|
|
1434
|
+
$(n, Z.email, r.message, t);
|
|
1435
1435
|
break;
|
|
1436
1436
|
}
|
|
1437
1437
|
break;
|
|
1438
1438
|
case "url":
|
|
1439
|
-
|
|
1439
|
+
T(n, "uri", r.message, t);
|
|
1440
1440
|
break;
|
|
1441
1441
|
case "uuid":
|
|
1442
|
-
|
|
1442
|
+
T(n, "uuid", r.message, t);
|
|
1443
1443
|
break;
|
|
1444
1444
|
case "regex":
|
|
1445
|
-
|
|
1445
|
+
$(n, r.regex, r.message, t);
|
|
1446
1446
|
break;
|
|
1447
1447
|
case "cuid":
|
|
1448
|
-
|
|
1448
|
+
$(n, Z.cuid, r.message, t);
|
|
1449
1449
|
break;
|
|
1450
1450
|
case "cuid2":
|
|
1451
|
-
|
|
1451
|
+
$(n, Z.cuid2, r.message, t);
|
|
1452
1452
|
break;
|
|
1453
1453
|
case "startsWith":
|
|
1454
|
-
|
|
1454
|
+
$(n, RegExp(`^${a(r.value)}`), r.message, t);
|
|
1455
1455
|
break;
|
|
1456
1456
|
case "endsWith":
|
|
1457
|
-
|
|
1457
|
+
$(n, RegExp(`${a(r.value)}$`), r.message, t);
|
|
1458
1458
|
break;
|
|
1459
1459
|
case "datetime":
|
|
1460
|
-
|
|
1460
|
+
T(n, "date-time", r.message, t);
|
|
1461
1461
|
break;
|
|
1462
1462
|
case "date":
|
|
1463
|
-
|
|
1463
|
+
T(n, "date", r.message, t);
|
|
1464
1464
|
break;
|
|
1465
1465
|
case "time":
|
|
1466
|
-
|
|
1466
|
+
T(n, "time", r.message, t);
|
|
1467
1467
|
break;
|
|
1468
1468
|
case "duration":
|
|
1469
|
-
|
|
1469
|
+
T(n, "duration", r.message, t);
|
|
1470
1470
|
break;
|
|
1471
1471
|
case "length":
|
|
1472
1472
|
w(n, "minLength", typeof n.minLength == "number" ? Math.max(n.minLength, r.value) : r.value, r.message, t), w(n, "maxLength", typeof n.maxLength == "number" ? Math.min(n.maxLength, r.value) : r.value, r.message, t);
|
|
1473
1473
|
break;
|
|
1474
1474
|
case "includes": {
|
|
1475
|
-
|
|
1475
|
+
$(n, RegExp(a(r.value)), r.message, t);
|
|
1476
1476
|
break;
|
|
1477
1477
|
}
|
|
1478
1478
|
case "ip": {
|
|
1479
|
-
r.version !== "v6" &&
|
|
1479
|
+
r.version !== "v6" && T(n, "ipv4", r.message, t), r.version !== "v4" && T(n, "ipv6", r.message, t);
|
|
1480
1480
|
break;
|
|
1481
1481
|
}
|
|
1482
1482
|
case "emoji":
|
|
1483
|
-
|
|
1483
|
+
$(n, Z.emoji, r.message, t);
|
|
1484
1484
|
break;
|
|
1485
1485
|
case "ulid": {
|
|
1486
|
-
|
|
1486
|
+
$(n, Z.ulid, r.message, t);
|
|
1487
1487
|
break;
|
|
1488
1488
|
}
|
|
1489
1489
|
case "base64": {
|
|
1490
1490
|
switch (t.base64Strategy) {
|
|
1491
1491
|
case "format:binary": {
|
|
1492
|
-
|
|
1492
|
+
T(n, "binary", r.message, t);
|
|
1493
1493
|
break;
|
|
1494
1494
|
}
|
|
1495
1495
|
case "contentEncoding:base64": {
|
|
@@ -1497,18 +1497,18 @@ function Ve(e, t) {
|
|
|
1497
1497
|
break;
|
|
1498
1498
|
}
|
|
1499
1499
|
case "pattern:zod": {
|
|
1500
|
-
|
|
1500
|
+
$(n, Z.base64, r.message, t);
|
|
1501
1501
|
break;
|
|
1502
1502
|
}
|
|
1503
1503
|
}
|
|
1504
1504
|
break;
|
|
1505
1505
|
}
|
|
1506
1506
|
case "nanoid":
|
|
1507
|
-
|
|
1507
|
+
$(n, Z.nanoid, r.message, t);
|
|
1508
1508
|
}
|
|
1509
1509
|
return n;
|
|
1510
1510
|
}
|
|
1511
|
-
const
|
|
1511
|
+
const ea = (e) => Array.from(e).map((t) => /[a-zA-Z0-9]/.test(t) ? t : `\\${t}`).join(""), T = (e, t, n, a) => {
|
|
1512
1512
|
var r;
|
|
1513
1513
|
e.format || (r = e.anyOf) != null && r.some((i) => i.format) ? (e.anyOf || (e.anyOf = []), e.format && (e.anyOf.push({
|
|
1514
1514
|
format: e.format,
|
|
@@ -1519,7 +1519,7 @@ const Kn = (e) => Array.from(e).map((t) => /[a-zA-Z0-9]/.test(t) ? t : `\\${t}`)
|
|
|
1519
1519
|
format: t,
|
|
1520
1520
|
...n && a.errorMessages && { errorMessage: { format: n } }
|
|
1521
1521
|
})) : w(e, "format", t, n, a);
|
|
1522
|
-
},
|
|
1522
|
+
}, $ = (e, t, n, a) => {
|
|
1523
1523
|
var r;
|
|
1524
1524
|
e.pattern || (r = e.allOf) != null && r.some((i) => i.pattern) ? (e.allOf || (e.allOf = []), e.pattern && (e.allOf.push({
|
|
1525
1525
|
pattern: e.pattern,
|
|
@@ -1623,7 +1623,7 @@ function Je(e, t) {
|
|
|
1623
1623
|
};
|
|
1624
1624
|
return n;
|
|
1625
1625
|
}
|
|
1626
|
-
function
|
|
1626
|
+
function ta(e, t) {
|
|
1627
1627
|
if (t.mapStrategy === "record")
|
|
1628
1628
|
return Je(e, t);
|
|
1629
1629
|
const n = b(e.keyType._def, {
|
|
@@ -1644,19 +1644,19 @@ function ea(e, t) {
|
|
|
1644
1644
|
}
|
|
1645
1645
|
};
|
|
1646
1646
|
}
|
|
1647
|
-
function
|
|
1647
|
+
function na(e) {
|
|
1648
1648
|
const t = e.values, a = Object.keys(e.values).filter((i) => typeof t[t[i]] != "number").map((i) => t[i]), r = Array.from(new Set(a.map((i) => typeof i)));
|
|
1649
1649
|
return {
|
|
1650
1650
|
type: r.length === 1 ? r[0] === "string" ? "string" : "number" : ["string", "number"],
|
|
1651
1651
|
enum: a
|
|
1652
1652
|
};
|
|
1653
1653
|
}
|
|
1654
|
-
function
|
|
1654
|
+
function aa() {
|
|
1655
1655
|
return {
|
|
1656
1656
|
not: {}
|
|
1657
1657
|
};
|
|
1658
1658
|
}
|
|
1659
|
-
function
|
|
1659
|
+
function ra(e) {
|
|
1660
1660
|
return e.target === "openApi3" ? {
|
|
1661
1661
|
enum: ["null"],
|
|
1662
1662
|
nullable: !0
|
|
@@ -1671,7 +1671,7 @@ const K = {
|
|
|
1671
1671
|
ZodBoolean: "boolean",
|
|
1672
1672
|
ZodNull: "null"
|
|
1673
1673
|
};
|
|
1674
|
-
function
|
|
1674
|
+
function oa(e, t) {
|
|
1675
1675
|
if (t.target === "openApi3")
|
|
1676
1676
|
return _e(e, t);
|
|
1677
1677
|
const n = e.options instanceof Map ? Array.from(e.options.values()) : e.options;
|
|
@@ -1724,7 +1724,7 @@ const _e = (e, t) => {
|
|
|
1724
1724
|
})).filter((a) => !!a && (!t.strictUnions || typeof a == "object" && Object.keys(a).length > 0));
|
|
1725
1725
|
return n.length ? { anyOf: n } : void 0;
|
|
1726
1726
|
};
|
|
1727
|
-
function
|
|
1727
|
+
function ia(e, t) {
|
|
1728
1728
|
if (["ZodString", "ZodNumber", "ZodBigInt", "ZodBoolean", "ZodNull"].includes(e.innerType._def.typeName) && (!e.innerType._def.checks || !e.innerType._def.checks.length))
|
|
1729
1729
|
return t.target === "openApi3" || t.nullableStrategy === "property" ? {
|
|
1730
1730
|
type: K[e.innerType._def.typeName],
|
|
@@ -1745,7 +1745,7 @@ function oa(e, t) {
|
|
|
1745
1745
|
});
|
|
1746
1746
|
return n && { anyOf: [n, { type: "null" }] };
|
|
1747
1747
|
}
|
|
1748
|
-
function
|
|
1748
|
+
function sa(e, t) {
|
|
1749
1749
|
const n = {
|
|
1750
1750
|
type: "number"
|
|
1751
1751
|
};
|
|
@@ -1768,7 +1768,7 @@ function ia(e, t) {
|
|
|
1768
1768
|
}
|
|
1769
1769
|
return n;
|
|
1770
1770
|
}
|
|
1771
|
-
function
|
|
1771
|
+
function la(e, t) {
|
|
1772
1772
|
return t.removeAdditionalStrategy === "strict" ? e.catchall._def.typeName === "ZodNever" ? e.unknownKeys !== "strict" : b(e.catchall._def, {
|
|
1773
1773
|
...t,
|
|
1774
1774
|
currentPath: [...t.currentPath, "additionalProperties"]
|
|
@@ -1777,7 +1777,7 @@ function sa(e, t) {
|
|
|
1777
1777
|
currentPath: [...t.currentPath, "additionalProperties"]
|
|
1778
1778
|
}) ?? !0;
|
|
1779
1779
|
}
|
|
1780
|
-
function
|
|
1780
|
+
function ca(e, t) {
|
|
1781
1781
|
const n = {
|
|
1782
1782
|
type: "object",
|
|
1783
1783
|
...Object.entries(e.shape()).reduce((a, [r, i]) => {
|
|
@@ -1797,11 +1797,11 @@ This will become an error in a future version of the SDK.`), {
|
|
|
1797
1797
|
required: i.isOptional() && !t.openaiStrictMode ? a.required : [...a.required, r]
|
|
1798
1798
|
});
|
|
1799
1799
|
}, { properties: {}, required: [] }),
|
|
1800
|
-
additionalProperties:
|
|
1800
|
+
additionalProperties: la(e, t)
|
|
1801
1801
|
};
|
|
1802
1802
|
return n.required.length || delete n.required, n;
|
|
1803
1803
|
}
|
|
1804
|
-
const
|
|
1804
|
+
const ua = (e, t) => {
|
|
1805
1805
|
var a;
|
|
1806
1806
|
if (t.currentPath.toString() === ((a = t.propertyPath) == null ? void 0 : a.toString()))
|
|
1807
1807
|
return b(e.innerType._def, t);
|
|
@@ -1817,7 +1817,7 @@ const ca = (e, t) => {
|
|
|
1817
1817
|
n
|
|
1818
1818
|
]
|
|
1819
1819
|
} : {};
|
|
1820
|
-
},
|
|
1820
|
+
}, da = (e, t) => {
|
|
1821
1821
|
if (t.pipeStrategy === "input")
|
|
1822
1822
|
return b(e.in._def, t);
|
|
1823
1823
|
if (t.pipeStrategy === "output")
|
|
@@ -1833,10 +1833,10 @@ const ca = (e, t) => {
|
|
|
1833
1833
|
allOf: [n, a].filter((r) => r !== void 0)
|
|
1834
1834
|
};
|
|
1835
1835
|
};
|
|
1836
|
-
function
|
|
1836
|
+
function pa(e, t) {
|
|
1837
1837
|
return b(e.type._def, t);
|
|
1838
1838
|
}
|
|
1839
|
-
function
|
|
1839
|
+
function ma(e, t) {
|
|
1840
1840
|
const a = {
|
|
1841
1841
|
type: "array",
|
|
1842
1842
|
uniqueItems: !0,
|
|
@@ -1847,7 +1847,7 @@ function pa(e, t) {
|
|
|
1847
1847
|
};
|
|
1848
1848
|
return e.minSize && w(a, "minItems", e.minSize.value, e.minSize.message, t), e.maxSize && w(a, "maxItems", e.maxSize.value, e.maxSize.message, t), a;
|
|
1849
1849
|
}
|
|
1850
|
-
function
|
|
1850
|
+
function ha(e, t) {
|
|
1851
1851
|
return e.rest ? {
|
|
1852
1852
|
type: "array",
|
|
1853
1853
|
minItems: e.items.length,
|
|
@@ -1869,34 +1869,34 @@ function ma(e, t) {
|
|
|
1869
1869
|
})).reduce((n, a) => a === void 0 ? n : [...n, a], [])
|
|
1870
1870
|
};
|
|
1871
1871
|
}
|
|
1872
|
-
function
|
|
1872
|
+
function ga() {
|
|
1873
1873
|
return {
|
|
1874
1874
|
not: {}
|
|
1875
1875
|
};
|
|
1876
1876
|
}
|
|
1877
|
-
function
|
|
1877
|
+
function fa() {
|
|
1878
1878
|
return {};
|
|
1879
1879
|
}
|
|
1880
|
-
const
|
|
1880
|
+
const ba = (e, t) => b(e.innerType._def, t);
|
|
1881
1881
|
function b(e, t, n = !1) {
|
|
1882
1882
|
var s;
|
|
1883
1883
|
const a = t.seen.get(e);
|
|
1884
1884
|
if (t.override) {
|
|
1885
1885
|
const l = (s = t.override) == null ? void 0 : s.call(t, e, t, a, n);
|
|
1886
|
-
if (l !==
|
|
1886
|
+
if (l !== In)
|
|
1887
1887
|
return l;
|
|
1888
1888
|
}
|
|
1889
1889
|
if (a && !n) {
|
|
1890
|
-
const l =
|
|
1890
|
+
const l = ya(a, t);
|
|
1891
1891
|
if (l !== void 0)
|
|
1892
1892
|
return "$ref" in l && t.seenRefs.add(l.$ref), l;
|
|
1893
1893
|
}
|
|
1894
1894
|
const r = { def: e, path: t.currentPath, jsonSchema: void 0 };
|
|
1895
1895
|
t.seen.set(e, r);
|
|
1896
|
-
const i =
|
|
1897
|
-
return i &&
|
|
1896
|
+
const i = wa(e, e.typeName, t, n);
|
|
1897
|
+
return i && Sa(e, t, i), r.jsonSchema = i, i;
|
|
1898
1898
|
}
|
|
1899
|
-
const
|
|
1899
|
+
const ya = (e, t) => {
|
|
1900
1900
|
switch (t.$refStrategy) {
|
|
1901
1901
|
case "root":
|
|
1902
1902
|
return { $ref: e.path.join("/") };
|
|
@@ -1904,82 +1904,82 @@ const ba = (e, t) => {
|
|
|
1904
1904
|
const n = e.path.slice(t.basePath.length + 1).join("_");
|
|
1905
1905
|
return n !== t.name && t.nameStrategy === "duplicate-ref" && (t.definitions[n] = e.def), { $ref: [...t.basePath, t.definitionPath, n].join("/") };
|
|
1906
1906
|
case "relative":
|
|
1907
|
-
return { $ref:
|
|
1907
|
+
return { $ref: va(t.currentPath, e.path) };
|
|
1908
1908
|
case "none":
|
|
1909
1909
|
case "seen":
|
|
1910
1910
|
return e.path.length < t.currentPath.length && e.path.every((a, r) => t.currentPath[r] === a) ? (console.warn(`Recursive reference detected at ${t.currentPath.join("/")}! Defaulting to any`), {}) : t.$refStrategy === "seen" ? {} : void 0;
|
|
1911
1911
|
}
|
|
1912
|
-
},
|
|
1912
|
+
}, va = (e, t) => {
|
|
1913
1913
|
let n = 0;
|
|
1914
1914
|
for (; n < e.length && n < t.length && e[n] === t[n]; n++)
|
|
1915
1915
|
;
|
|
1916
1916
|
return [(e.length - n).toString(), ...t.slice(n)].join("/");
|
|
1917
|
-
},
|
|
1917
|
+
}, wa = (e, t, n, a) => {
|
|
1918
1918
|
switch (t) {
|
|
1919
1919
|
case g.ZodString:
|
|
1920
1920
|
return Ve(e, n);
|
|
1921
1921
|
case g.ZodNumber:
|
|
1922
|
-
return
|
|
1922
|
+
return sa(e, n);
|
|
1923
1923
|
case g.ZodObject:
|
|
1924
|
-
return
|
|
1924
|
+
return ca(e, n);
|
|
1925
1925
|
case g.ZodBigInt:
|
|
1926
|
-
return
|
|
1926
|
+
return Fn(e, n);
|
|
1927
1927
|
case g.ZodBoolean:
|
|
1928
|
-
return
|
|
1928
|
+
return qn();
|
|
1929
1929
|
case g.ZodDate:
|
|
1930
1930
|
return He(e, n);
|
|
1931
1931
|
case g.ZodUndefined:
|
|
1932
|
-
return
|
|
1932
|
+
return ga();
|
|
1933
1933
|
case g.ZodNull:
|
|
1934
|
-
return
|
|
1934
|
+
return ra(n);
|
|
1935
1935
|
case g.ZodArray:
|
|
1936
|
-
return
|
|
1936
|
+
return Un(e, n);
|
|
1937
1937
|
case g.ZodUnion:
|
|
1938
1938
|
case g.ZodDiscriminatedUnion:
|
|
1939
|
-
return
|
|
1939
|
+
return oa(e, n);
|
|
1940
1940
|
case g.ZodIntersection:
|
|
1941
|
-
return
|
|
1941
|
+
return Xn(e, n);
|
|
1942
1942
|
case g.ZodTuple:
|
|
1943
|
-
return
|
|
1943
|
+
return ha(e, n);
|
|
1944
1944
|
case g.ZodRecord:
|
|
1945
1945
|
return Je(e, n);
|
|
1946
1946
|
case g.ZodLiteral:
|
|
1947
|
-
return
|
|
1947
|
+
return Kn(e, n);
|
|
1948
1948
|
case g.ZodEnum:
|
|
1949
|
-
return
|
|
1949
|
+
return Gn(e);
|
|
1950
1950
|
case g.ZodNativeEnum:
|
|
1951
|
-
return
|
|
1951
|
+
return na(e);
|
|
1952
1952
|
case g.ZodNullable:
|
|
1953
|
-
return
|
|
1953
|
+
return ia(e, n);
|
|
1954
1954
|
case g.ZodOptional:
|
|
1955
|
-
return
|
|
1955
|
+
return ua(e, n);
|
|
1956
1956
|
case g.ZodMap:
|
|
1957
|
-
return
|
|
1957
|
+
return ta(e, n);
|
|
1958
1958
|
case g.ZodSet:
|
|
1959
|
-
return
|
|
1959
|
+
return ma(e, n);
|
|
1960
1960
|
case g.ZodLazy:
|
|
1961
1961
|
return b(e.getter()._def, n);
|
|
1962
1962
|
case g.ZodPromise:
|
|
1963
|
-
return
|
|
1963
|
+
return pa(e, n);
|
|
1964
1964
|
case g.ZodNaN:
|
|
1965
1965
|
case g.ZodNever:
|
|
1966
|
-
return
|
|
1966
|
+
return aa();
|
|
1967
1967
|
case g.ZodEffects:
|
|
1968
|
-
return
|
|
1968
|
+
return Yn(e, n, a);
|
|
1969
1969
|
case g.ZodAny:
|
|
1970
|
-
return
|
|
1970
|
+
return Bn();
|
|
1971
1971
|
case g.ZodUnknown:
|
|
1972
|
-
return
|
|
1972
|
+
return fa();
|
|
1973
1973
|
case g.ZodDefault:
|
|
1974
|
-
return
|
|
1974
|
+
return Jn(e, n);
|
|
1975
1975
|
case g.ZodBranded:
|
|
1976
|
-
return
|
|
1976
|
+
return Wn(e, n);
|
|
1977
1977
|
case g.ZodReadonly:
|
|
1978
|
-
return
|
|
1978
|
+
return ba(e, n);
|
|
1979
1979
|
case g.ZodCatch:
|
|
1980
|
-
return
|
|
1980
|
+
return Hn(e, n);
|
|
1981
1981
|
case g.ZodPipeline:
|
|
1982
|
-
return
|
|
1982
|
+
return da(e, n);
|
|
1983
1983
|
case g.ZodFunction:
|
|
1984
1984
|
case g.ZodVoid:
|
|
1985
1985
|
case g.ZodSymbol:
|
|
@@ -1988,14 +1988,14 @@ const ba = (e, t) => {
|
|
|
1988
1988
|
return /* @__PURE__ */ ((r) => {
|
|
1989
1989
|
})();
|
|
1990
1990
|
}
|
|
1991
|
-
},
|
|
1992
|
-
const n =
|
|
1991
|
+
}, Sa = (e, t, n) => (e.description && (n.description = e.description, t.markdownDescription && (n.markdownDescription = e.description)), n), Oa = (e, t) => {
|
|
1992
|
+
const n = zn(t), a = typeof t == "string" ? t : (t == null ? void 0 : t.nameStrategy) === "title" || t == null ? void 0 : t.name, r = b(e._def, a === void 0 ? n : {
|
|
1993
1993
|
...n,
|
|
1994
1994
|
currentPath: [...n.basePath, n.definitionPath, a]
|
|
1995
1995
|
}, !1) ?? {}, i = typeof t == "object" && t.name !== void 0 && t.nameStrategy === "title" ? t.name : void 0;
|
|
1996
1996
|
i !== void 0 && (r.title = i);
|
|
1997
1997
|
const s = (() => {
|
|
1998
|
-
if (
|
|
1998
|
+
if (Rn(n.definitions))
|
|
1999
1999
|
return;
|
|
2000
2000
|
const c = {}, u = /* @__PURE__ */ new Set();
|
|
2001
2001
|
for (let d = 0; d < 500; d++) {
|
|
@@ -2028,8 +2028,8 @@ const ba = (e, t) => {
|
|
|
2028
2028
|
};
|
|
2029
2029
|
return n.target === "jsonSchema7" ? l.$schema = "http://json-schema.org/draft-07/schema#" : n.target === "jsonSchema2019-09" && (l.$schema = "https://json-schema.org/draft/2019-09/schema#"), l;
|
|
2030
2030
|
};
|
|
2031
|
-
function
|
|
2032
|
-
return
|
|
2031
|
+
function Ca(e, t) {
|
|
2032
|
+
return Oa(e, {
|
|
2033
2033
|
openaiStrictMode: !0,
|
|
2034
2034
|
name: t.name,
|
|
2035
2035
|
nameStrategy: "duplicate-ref",
|
|
@@ -2037,21 +2037,21 @@ function Oa(e, t) {
|
|
|
2037
2037
|
nullableStrategy: "property"
|
|
2038
2038
|
});
|
|
2039
2039
|
}
|
|
2040
|
-
function
|
|
2041
|
-
return
|
|
2040
|
+
function Da(e, t, n) {
|
|
2041
|
+
return Zn({
|
|
2042
2042
|
type: "json_schema",
|
|
2043
2043
|
json_schema: {
|
|
2044
2044
|
...n,
|
|
2045
2045
|
name: t,
|
|
2046
2046
|
strict: !0,
|
|
2047
|
-
schema:
|
|
2047
|
+
schema: Ca(e, { name: t })
|
|
2048
2048
|
}
|
|
2049
2049
|
}, (a) => e.parse(JSON.parse(a)));
|
|
2050
2050
|
}
|
|
2051
2051
|
function he(e) {
|
|
2052
2052
|
return e.endsWith("/") ? e : `${e}/`;
|
|
2053
2053
|
}
|
|
2054
|
-
const
|
|
2054
|
+
const xo = (e) => {
|
|
2055
2055
|
if (e instanceof Error)
|
|
2056
2056
|
try {
|
|
2057
2057
|
return JSON.parse(e.message);
|
|
@@ -2060,7 +2060,7 @@ const _o = (e) => {
|
|
|
2060
2060
|
}
|
|
2061
2061
|
return e;
|
|
2062
2062
|
};
|
|
2063
|
-
function
|
|
2063
|
+
function _a() {
|
|
2064
2064
|
try {
|
|
2065
2065
|
const e = window.location.host, {
|
|
2066
2066
|
tenant: { tenantDomainNames: t, name: n }
|
|
@@ -2071,22 +2071,22 @@ function Da() {
|
|
|
2071
2071
|
}
|
|
2072
2072
|
}
|
|
2073
2073
|
function Ye(e, t) {
|
|
2074
|
-
let n =
|
|
2074
|
+
let n = _a();
|
|
2075
2075
|
n.startsWith("/") && (n = n.slice(1));
|
|
2076
|
-
const a = new
|
|
2076
|
+
const a = new bt(
|
|
2077
2077
|
`${he(e)}${n}`,
|
|
2078
2078
|
t,
|
|
2079
|
-
"sdk-ai-core-0.
|
|
2079
|
+
"sdk-ai-core-0.3.0"
|
|
2080
2080
|
);
|
|
2081
2081
|
return a.login(), a;
|
|
2082
2082
|
}
|
|
2083
|
-
function
|
|
2084
|
-
const t =
|
|
2083
|
+
function Pa(e) {
|
|
2084
|
+
const t = yt(e);
|
|
2085
2085
|
if (!t)
|
|
2086
2086
|
throw new Error("Invalid authentication method");
|
|
2087
2087
|
return Ye(e.url, t);
|
|
2088
2088
|
}
|
|
2089
|
-
function
|
|
2089
|
+
function Aa(e) {
|
|
2090
2090
|
return async (t, n) => {
|
|
2091
2091
|
if (!t.toString().includes("chat/completions"))
|
|
2092
2092
|
throw new Error("Use httpClient for non-completion requests");
|
|
@@ -2098,9 +2098,9 @@ function Pa(e) {
|
|
|
2098
2098
|
return fetch(t, i);
|
|
2099
2099
|
};
|
|
2100
2100
|
}
|
|
2101
|
-
const
|
|
2102
|
-
function
|
|
2103
|
-
return new
|
|
2101
|
+
const xa = "api/v2/ai";
|
|
2102
|
+
function Ta(e, t) {
|
|
2103
|
+
return new vt({
|
|
2104
2104
|
// @ts-expect-error - OpenAI client requires apiKey but we're using custom auth
|
|
2105
2105
|
apiKey: null,
|
|
2106
2106
|
dangerouslyAllowBrowser: !0,
|
|
@@ -2109,8 +2109,8 @@ function xa(e, t) {
|
|
|
2109
2109
|
});
|
|
2110
2110
|
}
|
|
2111
2111
|
function Ge(e) {
|
|
2112
|
-
const t = he(e.url) +
|
|
2113
|
-
return
|
|
2112
|
+
const t = he(e.url) + xa;
|
|
2113
|
+
return Ta(t, Aa(e));
|
|
2114
2114
|
}
|
|
2115
2115
|
let ue = null;
|
|
2116
2116
|
function Qe(e) {
|
|
@@ -2123,7 +2123,7 @@ function f() {
|
|
|
2123
2123
|
);
|
|
2124
2124
|
return ue;
|
|
2125
2125
|
}
|
|
2126
|
-
function
|
|
2126
|
+
function To() {
|
|
2127
2127
|
const e = f(), t = e.url, n = e.auth, a = Ye(t, n);
|
|
2128
2128
|
Qe(a);
|
|
2129
2129
|
}
|
|
@@ -2138,12 +2138,12 @@ function Ke() {
|
|
|
2138
2138
|
);
|
|
2139
2139
|
return de;
|
|
2140
2140
|
}
|
|
2141
|
-
function
|
|
2141
|
+
function $o() {
|
|
2142
2142
|
const e = Ge(f());
|
|
2143
2143
|
Xe(e);
|
|
2144
2144
|
}
|
|
2145
|
-
function
|
|
2146
|
-
const t =
|
|
2145
|
+
function jo(e) {
|
|
2146
|
+
const t = Pa(e);
|
|
2147
2147
|
Qe(t);
|
|
2148
2148
|
const n = Ge(t);
|
|
2149
2149
|
Xe(n);
|
|
@@ -2157,7 +2157,7 @@ async function ge(e) {
|
|
|
2157
2157
|
temperature: i = 0,
|
|
2158
2158
|
sessionId: s,
|
|
2159
2159
|
openAIClient: l = Ke()
|
|
2160
|
-
} = e, c = a.type === "json_schema" ?
|
|
2160
|
+
} = e, c = a.type === "json_schema" ? Da(a.schema, a.name) : { type: "json_object" }, d = (await l.beta.chat.completions.parse({
|
|
2161
2161
|
model: r,
|
|
2162
2162
|
messages: [
|
|
2163
2163
|
{ role: "system", content: t },
|
|
@@ -2262,7 +2262,7 @@ async function $a(e) {
|
|
|
2262
2262
|
});
|
|
2263
2263
|
});
|
|
2264
2264
|
}
|
|
2265
|
-
const
|
|
2265
|
+
const ja = `
|
|
2266
2266
|
You are an expert in chart visualization and data query structuring. Your task is to assist users in generating the optimal chart type and axes mapping based on their input, adhering to the provided schema (schema object with chartType and axesMapping). Your goal is to interpret the user's prompt, analyze the provided column data, select an appropriate chart type (unless specified by the user), and map column indices to the axes mapping arrays in a way that produces a valid, effective visualization.
|
|
2267
2267
|
|
|
2268
2268
|
DO NOT use any tools.
|
|
@@ -2301,19 +2301,19 @@ Return a JSON object matching the schema structure, with:
|
|
|
2301
2301
|
- axesMapping: The populated axes mapping object per the relevant schema.
|
|
2302
2302
|
Provide a brief explanation of your chart type choice and axes mapping decisions, referencing the prompt and column data.
|
|
2303
2303
|
`;
|
|
2304
|
-
function
|
|
2304
|
+
function ka(e, t) {
|
|
2305
2305
|
return e ? e.map((n) => ({
|
|
2306
2306
|
column: t[n]
|
|
2307
2307
|
})).filter(({ column: n }) => !!n) : [];
|
|
2308
2308
|
}
|
|
2309
|
-
function
|
|
2309
|
+
function Ea(e, t) {
|
|
2310
2310
|
if (!e) return e;
|
|
2311
2311
|
const n = e.axesMapping, a = {
|
|
2312
2312
|
chartType: e.chartType,
|
|
2313
2313
|
axesMapping: {}
|
|
2314
2314
|
};
|
|
2315
2315
|
for (const [r, i] of Object.entries(n))
|
|
2316
|
-
r !== "type" && (Array.isArray(i) ? a.axesMapping[r] =
|
|
2316
|
+
r !== "type" && (Array.isArray(i) ? a.axesMapping[r] = ka(i, t) : a.axesMapping[r] = i);
|
|
2317
2317
|
return a;
|
|
2318
2318
|
}
|
|
2319
2319
|
const et = async (e, t = [], n) => {
|
|
@@ -2337,14 +2337,14 @@ ${JSON.stringify(a)}`;
|
|
|
2337
2337
|
|
|
2338
2338
|
`);
|
|
2339
2339
|
const s = await ge({
|
|
2340
|
-
systemPrompt:
|
|
2340
|
+
systemPrompt: ja,
|
|
2341
2341
|
userPrompt: i,
|
|
2342
2342
|
responseFormat: {
|
|
2343
2343
|
type: "json_schema",
|
|
2344
|
-
schema:
|
|
2344
|
+
schema: _n,
|
|
2345
2345
|
name: "chartRecommendations"
|
|
2346
2346
|
}
|
|
2347
|
-
}), l =
|
|
2347
|
+
}), l = Ea(
|
|
2348
2348
|
s,
|
|
2349
2349
|
t
|
|
2350
2350
|
);
|
|
@@ -2358,36 +2358,36 @@ ${JSON.stringify(a)}`;
|
|
|
2358
2358
|
}
|
|
2359
2359
|
return l;
|
|
2360
2360
|
};
|
|
2361
|
-
async function
|
|
2361
|
+
async function ko(e, t) {
|
|
2362
2362
|
return await f().post(
|
|
2363
2363
|
`api/v2/ai/nlq/query/${e}`,
|
|
2364
2364
|
t
|
|
2365
2365
|
) ?? null;
|
|
2366
2366
|
}
|
|
2367
|
-
async function
|
|
2367
|
+
async function Ma(e, t) {
|
|
2368
2368
|
return await f().post(
|
|
2369
2369
|
`api/v2/ai/nlq/query-light/${e}`,
|
|
2370
2370
|
t
|
|
2371
2371
|
) ?? null;
|
|
2372
2372
|
}
|
|
2373
|
-
async function
|
|
2373
|
+
async function Na(e, t) {
|
|
2374
2374
|
return await f().post(
|
|
2375
2375
|
`api/v2/ai/nlq/smartQuery/${e}`,
|
|
2376
2376
|
t
|
|
2377
2377
|
) ?? null;
|
|
2378
2378
|
}
|
|
2379
|
-
async function
|
|
2379
|
+
async function Eo(e, t) {
|
|
2380
2380
|
return await f().get(
|
|
2381
2381
|
`api/v2/ai/recommendations/query/${e}/${t.numOfRecommendations}`
|
|
2382
2382
|
) ?? null;
|
|
2383
2383
|
}
|
|
2384
|
-
async function
|
|
2384
|
+
async function Mo(e, t) {
|
|
2385
2385
|
return await f().get(
|
|
2386
2386
|
`api/v2/ai/recommendations/query-light/${e}/${t.numOfRecommendations}${t.userPrompt ? `?userPrompt=${t.userPrompt}` : ""}`
|
|
2387
2387
|
) ?? null;
|
|
2388
2388
|
}
|
|
2389
|
-
const
|
|
2390
|
-
const n = await
|
|
2389
|
+
const Za = async (e, t) => {
|
|
2390
|
+
const n = await Ma(e, {
|
|
2391
2391
|
text: t,
|
|
2392
2392
|
timezone: "UTC"
|
|
2393
2393
|
});
|
|
@@ -2395,7 +2395,7 @@ const Na = async (e, t) => {
|
|
|
2395
2395
|
throw new Error(
|
|
2396
2396
|
"Error: Failed to get NLQ result. Ask the user to specify the data source again."
|
|
2397
2397
|
);
|
|
2398
|
-
const a =
|
|
2398
|
+
const a = ft.toWidgetProps(
|
|
2399
2399
|
{ ...n, chartRecommendations: {} },
|
|
2400
2400
|
{
|
|
2401
2401
|
useCustomizedStyleOptions: !0
|
|
@@ -2406,8 +2406,8 @@ const Na = async (e, t) => {
|
|
|
2406
2406
|
if (a.nlqResponse = n, !Ee(a))
|
|
2407
2407
|
throw new Error("Error: Non-chart widget props not supported yet");
|
|
2408
2408
|
return a.title = a.title || n.nlqPrompt || t, a;
|
|
2409
|
-
},
|
|
2410
|
-
const n = await
|
|
2409
|
+
}, Ia = async (e, t) => {
|
|
2410
|
+
const n = await Na(e, {
|
|
2411
2411
|
text: t,
|
|
2412
2412
|
forceGeneration: !0
|
|
2413
2413
|
});
|
|
@@ -2416,7 +2416,7 @@ const Na = async (e, t) => {
|
|
|
2416
2416
|
const a = n.dataSchema;
|
|
2417
2417
|
if (!a)
|
|
2418
2418
|
throw new Error("Error: Data schema not found");
|
|
2419
|
-
const r =
|
|
2419
|
+
const r = ht({
|
|
2420
2420
|
data: n.chartState,
|
|
2421
2421
|
context: a
|
|
2422
2422
|
});
|
|
@@ -2424,7 +2424,7 @@ const Na = async (e, t) => {
|
|
|
2424
2424
|
throw new Error(
|
|
2425
2425
|
"Error: Failed to translate query JSON: " + JSON.stringify(r.errors)
|
|
2426
2426
|
);
|
|
2427
|
-
const i = r.data, s =
|
|
2427
|
+
const i = r.data, s = gt(
|
|
2428
2428
|
i,
|
|
2429
2429
|
Me(a.dataSource)
|
|
2430
2430
|
), l = [
|
|
@@ -2449,8 +2449,8 @@ const Na = async (e, t) => {
|
|
|
2449
2449
|
jaql: s
|
|
2450
2450
|
}
|
|
2451
2451
|
};
|
|
2452
|
-
},
|
|
2453
|
-
const i = await
|
|
2452
|
+
}, La = async (e, t, n) => n ? (console.debug("Generating chart table from NLQ V3"), Ia(e, t)) : (console.debug("Generating chart table from NLQ V2"), Za(e, t)), Ra = async ({ dataSourceTitle: e, userPrompt: t, chartType: n, chartTitle: a }, r) => {
|
|
2453
|
+
const i = await La(
|
|
2454
2454
|
e,
|
|
2455
2455
|
t,
|
|
2456
2456
|
r.isNlqV3Enabled ?? !1
|
|
@@ -2476,7 +2476,7 @@ const Na = async (e, t) => {
|
|
|
2476
2476
|
artifactId: me(),
|
|
2477
2477
|
dataColumns: s
|
|
2478
2478
|
};
|
|
2479
|
-
},
|
|
2479
|
+
}, za = async ({ userPrompt: e, chartType: t, chartTitle: n }, a) => {
|
|
2480
2480
|
var l;
|
|
2481
2481
|
console.debug("toolCall", "createChart", e, t, n);
|
|
2482
2482
|
const r = a.dataSourceTitle;
|
|
@@ -2484,7 +2484,7 @@ const Na = async (e, t) => {
|
|
|
2484
2484
|
throw new Error(
|
|
2485
2485
|
"Error: Please ask the user to specify a data source title"
|
|
2486
2486
|
);
|
|
2487
|
-
const i = a.toolCallId, s = await
|
|
2487
|
+
const i = a.toolCallId, s = await Ra(
|
|
2488
2488
|
{
|
|
2489
2489
|
dataSourceTitle: r,
|
|
2490
2490
|
userPrompt: e,
|
|
@@ -2496,26 +2496,26 @@ const Na = async (e, t) => {
|
|
|
2496
2496
|
return (l = a.saveChart) == null || l.call(a, i, s), {
|
|
2497
2497
|
message: `New chart (chartId: ${i}) created successfully`
|
|
2498
2498
|
};
|
|
2499
|
-
},
|
|
2499
|
+
}, Ba = ({
|
|
2500
2500
|
chartTitle: e,
|
|
2501
2501
|
chartWidgetProps: t
|
|
2502
2502
|
}) => ({
|
|
2503
2503
|
...t,
|
|
2504
2504
|
title: e
|
|
2505
|
-
}),
|
|
2505
|
+
}), Ua = async ({ chartId: e, chartTitle: t }, n) => {
|
|
2506
2506
|
var i, s;
|
|
2507
2507
|
console.debug("toolCall", "updateChartTitle", e, t);
|
|
2508
2508
|
const a = (i = n.retrieveChart) == null ? void 0 : i.call(n, e);
|
|
2509
2509
|
if (!a)
|
|
2510
2510
|
throw new Error("Chart not found");
|
|
2511
|
-
const r =
|
|
2511
|
+
const r = Ba({
|
|
2512
2512
|
chartTitle: t,
|
|
2513
2513
|
chartWidgetProps: a
|
|
2514
2514
|
});
|
|
2515
2515
|
return (s = n.saveChart) == null || s.call(n, e, r), {
|
|
2516
2516
|
message: "Chart title updated successfully"
|
|
2517
2517
|
};
|
|
2518
|
-
},
|
|
2518
|
+
}, Fa = async ({
|
|
2519
2519
|
userPrompt: e,
|
|
2520
2520
|
chartType: t,
|
|
2521
2521
|
chartWidgetProps: n
|
|
@@ -2543,7 +2543,7 @@ const Na = async (e, t) => {
|
|
|
2543
2543
|
..."markerSize" in r && "markerSize" in c ? { markerSize: r.markerSize } : {}
|
|
2544
2544
|
} : c;
|
|
2545
2545
|
return n.styleOptions = u, n;
|
|
2546
|
-
},
|
|
2546
|
+
}, qa = async ({ chartId: e, userPrompt: t, chartType: n }, a) => {
|
|
2547
2547
|
var s, l;
|
|
2548
2548
|
console.debug(
|
|
2549
2549
|
"toolCall",
|
|
@@ -2555,7 +2555,7 @@ const Na = async (e, t) => {
|
|
|
2555
2555
|
const r = (s = a.retrieveChart) == null ? void 0 : s.call(a, e);
|
|
2556
2556
|
if (!r)
|
|
2557
2557
|
throw new Error("Chart not found");
|
|
2558
|
-
const i = await
|
|
2558
|
+
const i = await Fa({
|
|
2559
2559
|
userPrompt: t,
|
|
2560
2560
|
chartType: n,
|
|
2561
2561
|
chartWidgetProps: r
|
|
@@ -2563,9 +2563,9 @@ const Na = async (e, t) => {
|
|
|
2563
2563
|
return (l = a.saveChart) == null || l.call(a, e, i), {
|
|
2564
2564
|
message: "Chart type updated successfully"
|
|
2565
2565
|
};
|
|
2566
|
-
},
|
|
2566
|
+
}, Wa = o.object({
|
|
2567
2567
|
width: o.enum(["thin", "bold", "thick"])
|
|
2568
|
-
}),
|
|
2568
|
+
}), Ha = o.enum(["line/basic", "line/spline"]), j = o.object({
|
|
2569
2569
|
enabled: o.boolean().optional().describe(
|
|
2570
2570
|
"Boolean flag that defines if legend should be shown on the chart"
|
|
2571
2571
|
),
|
|
@@ -2629,9 +2629,9 @@ const Na = async (e, t) => {
|
|
|
2629
2629
|
seriesCapacity: o.number().optional().describe("Maximum number of series to chart")
|
|
2630
2630
|
}).describe(
|
|
2631
2631
|
"Configuration that limits the series or categories that are charted."
|
|
2632
|
-
).strict(),
|
|
2633
|
-
lineWidth:
|
|
2634
|
-
subtype:
|
|
2632
|
+
).strict(), Va = o.object({
|
|
2633
|
+
lineWidth: Wa.optional(),
|
|
2634
|
+
subtype: Ha.optional(),
|
|
2635
2635
|
markers: V.optional(),
|
|
2636
2636
|
navigator: te.optional(),
|
|
2637
2637
|
dataLimits: R.optional(),
|
|
@@ -2649,7 +2649,7 @@ const Na = async (e, t) => {
|
|
|
2649
2649
|
yAxis: F.optional(),
|
|
2650
2650
|
y2Axis: q.optional(),
|
|
2651
2651
|
seriesLabels: k.optional()
|
|
2652
|
-
}).strict(),
|
|
2652
|
+
}).strict(), Ja = o.object({
|
|
2653
2653
|
enabled: o.boolean().optional().describe(
|
|
2654
2654
|
"Boolean flag that defines if convolution ability should be enabled on chart"
|
|
2655
2655
|
),
|
|
@@ -2662,12 +2662,12 @@ const Na = async (e, t) => {
|
|
|
2662
2662
|
selectedConvolutionType: o.enum(["byPercentage", "bySlicesCount"]).optional().describe("Selected type of convolution behavior")
|
|
2663
2663
|
}).describe(
|
|
2664
2664
|
'Configuration that defines the ability of the Pie chart to collapse (convolve) and hide part of the data under the single category "Others".'
|
|
2665
|
-
).strict(),
|
|
2665
|
+
).strict(), Ya = o.object({
|
|
2666
2666
|
subtype: o.enum(["pie/basic", "pie/donut", "pie/ring"]).optional(),
|
|
2667
2667
|
seriesLabels: k.optional(),
|
|
2668
2668
|
legend: j.optional(),
|
|
2669
|
-
convolution:
|
|
2670
|
-
}).strict(),
|
|
2669
|
+
convolution: Ja.optional()
|
|
2670
|
+
}).strict(), Ga = o.object({
|
|
2671
2671
|
markers: V.optional(),
|
|
2672
2672
|
dataLimits: R.optional(),
|
|
2673
2673
|
markerSize: o.object({
|
|
@@ -2680,7 +2680,7 @@ const Na = async (e, t) => {
|
|
|
2680
2680
|
yAxis: F.optional(),
|
|
2681
2681
|
y2Axis: q.optional(),
|
|
2682
2682
|
seriesLabels: k.optional()
|
|
2683
|
-
}).strict(),
|
|
2683
|
+
}).strict(), Qa = o.object({
|
|
2684
2684
|
subtype: o.enum([
|
|
2685
2685
|
"area/basic",
|
|
2686
2686
|
"area/spline",
|
|
@@ -2696,7 +2696,7 @@ const Na = async (e, t) => {
|
|
|
2696
2696
|
yAxis: F.optional(),
|
|
2697
2697
|
y2Axis: q.optional(),
|
|
2698
2698
|
seriesLabels: k.optional()
|
|
2699
|
-
}).strict(),
|
|
2699
|
+
}).strict(), Xa = o.object({
|
|
2700
2700
|
dataLimits: R.optional(),
|
|
2701
2701
|
funnelDirection: o.enum(["inverted", "regular"]).optional().describe("Direction of FunnelChart narrowing"),
|
|
2702
2702
|
funnelSize: o.enum(["narrow", "regular", "wide"]).optional().describe(
|
|
@@ -2708,7 +2708,7 @@ const Na = async (e, t) => {
|
|
|
2708
2708
|
neckWidth: o.number().optional(),
|
|
2709
2709
|
seriesLabels: k.optional(),
|
|
2710
2710
|
legend: j.optional()
|
|
2711
|
-
}).strict(),
|
|
2711
|
+
}).strict(), Ka = o.object({
|
|
2712
2712
|
dataLimits: R.optional(),
|
|
2713
2713
|
layout: o.enum([
|
|
2714
2714
|
"squarified",
|
|
@@ -2723,14 +2723,14 @@ const Na = async (e, t) => {
|
|
|
2723
2723
|
tooltip: o.object({
|
|
2724
2724
|
mode: o.enum(["contribution", "value"]).optional().describe("Define mode of data showing")
|
|
2725
2725
|
})
|
|
2726
|
-
}).strict(),
|
|
2726
|
+
}).strict(), er = o.object({
|
|
2727
2727
|
dataLimits: R.optional(),
|
|
2728
2728
|
levels: o.number().optional(),
|
|
2729
2729
|
borderWidth: o.number().optional(),
|
|
2730
2730
|
borderColor: o.string().optional(),
|
|
2731
2731
|
seriesLabels: k.optional(),
|
|
2732
2732
|
legend: j.optional()
|
|
2733
|
-
}).strict(),
|
|
2733
|
+
}).strict(), tr = o.object({
|
|
2734
2734
|
dataLimits: R.optional(),
|
|
2735
2735
|
subtype: o.enum(["boxplot/full", "boxplot/hollow"]).optional(),
|
|
2736
2736
|
boxType: o.enum(["iqr", "extremums", "standardDeviation"]).optional(),
|
|
@@ -2742,7 +2742,7 @@ const Na = async (e, t) => {
|
|
|
2742
2742
|
y2Axis: q.optional(),
|
|
2743
2743
|
markers: V.optional(),
|
|
2744
2744
|
seriesLabels: k.optional()
|
|
2745
|
-
}).strict(),
|
|
2745
|
+
}).strict(), nr = o.object({
|
|
2746
2746
|
subtype: o.enum(["indicator/numeric", "indicator/gauge"]).optional(),
|
|
2747
2747
|
value: o.number().optional(),
|
|
2748
2748
|
min: o.number().optional(),
|
|
@@ -2754,7 +2754,7 @@ const Na = async (e, t) => {
|
|
|
2754
2754
|
"Boolean flag to force render indicator in ticker mode regardless of display size"
|
|
2755
2755
|
),
|
|
2756
2756
|
skin: o.enum(["1", "2"]).optional().describe("Skin gauge indicator")
|
|
2757
|
-
}).strict(),
|
|
2757
|
+
}).strict(), ar = o.object({
|
|
2758
2758
|
dataLimits: R.optional(),
|
|
2759
2759
|
height: o.number().optional(),
|
|
2760
2760
|
width: o.number().optional(),
|
|
@@ -2793,33 +2793,33 @@ const Na = async (e, t) => {
|
|
|
2793
2793
|
paddingHorizontal: o.number().optional().describe("Horizontal padding around whole table"),
|
|
2794
2794
|
paddingVertical: o.number().optional().describe("Vertical padding around whole table")
|
|
2795
2795
|
}), nt = {
|
|
2796
|
-
line:
|
|
2796
|
+
line: Va,
|
|
2797
2797
|
bar: Pe,
|
|
2798
|
-
area:
|
|
2798
|
+
area: Qa,
|
|
2799
2799
|
column: Pe,
|
|
2800
2800
|
// Assuming column is similar to bar; adjust as needed
|
|
2801
|
-
pie:
|
|
2802
|
-
scatter:
|
|
2803
|
-
funnel:
|
|
2804
|
-
treemap:
|
|
2805
|
-
sunburst:
|
|
2806
|
-
boxplot:
|
|
2807
|
-
indicator:
|
|
2808
|
-
polar:
|
|
2801
|
+
pie: Ya,
|
|
2802
|
+
scatter: Ga,
|
|
2803
|
+
funnel: Xa,
|
|
2804
|
+
treemap: Ka,
|
|
2805
|
+
sunburst: er,
|
|
2806
|
+
boxplot: tr,
|
|
2807
|
+
indicator: nr,
|
|
2808
|
+
polar: ar,
|
|
2809
2809
|
table: tt,
|
|
2810
2810
|
arearange: o.object({}),
|
|
2811
2811
|
scattermap: o.object({}),
|
|
2812
2812
|
areamap: o.object({}),
|
|
2813
2813
|
"calendar-heatmap": o.object({}),
|
|
2814
2814
|
streamgraph: o.object({})
|
|
2815
|
-
},
|
|
2815
|
+
}, rr = o.object({
|
|
2816
2816
|
chartType: ee
|
|
2817
2817
|
});
|
|
2818
|
-
function
|
|
2818
|
+
function or(e) {
|
|
2819
2819
|
const t = nt[e];
|
|
2820
2820
|
if (!t)
|
|
2821
2821
|
throw new Error(`Unsupported chart type: ${e}`);
|
|
2822
|
-
return
|
|
2822
|
+
return rr.extend({
|
|
2823
2823
|
styleOptions: t
|
|
2824
2824
|
});
|
|
2825
2825
|
}
|
|
@@ -2910,7 +2910,7 @@ const xe = o.object({
|
|
|
2910
2910
|
trillion: o.boolean().optional().describe(
|
|
2911
2911
|
"Boolean flag whether to show an abbreviation for a number greater than or equal one trillion - e.g. 1T"
|
|
2912
2912
|
)
|
|
2913
|
-
}),
|
|
2913
|
+
}), ir = o.object({
|
|
2914
2914
|
ignoreAnomalies: o.boolean().optional().describe(
|
|
2915
2915
|
"Boolean flag that enables the function to automatically identify and ignore anomalous values in the series. This can be particularly useful when you want to maintain the integrity of your analysis by avoiding potential outliers. default is false"
|
|
2916
2916
|
),
|
|
@@ -2922,7 +2922,7 @@ const xe = o.object({
|
|
|
2922
2922
|
]).optional().describe(
|
|
2923
2923
|
"Trend analysis model type to be used for the operation. default is linear"
|
|
2924
2924
|
)
|
|
2925
|
-
}).describe("Trend analysis options for the measure"),
|
|
2925
|
+
}).describe("Trend analysis options for the measure"), sr = o.object({
|
|
2926
2926
|
confidenceInterval: o.number().optional().describe(
|
|
2927
2927
|
"Confidence interval showing the probabilistic upper and lower limits of the forecasted series according to the uncertainty level. The valid range is (0.8 <= X < 1). default is 0.8"
|
|
2928
2928
|
),
|
|
@@ -2981,8 +2981,8 @@ const xe = o.object({
|
|
|
2981
2981
|
treatNullDataAsZeros: o.boolean().describe(
|
|
2982
2982
|
"Boolean flag whether null values are treated as zeros in the chart"
|
|
2983
2983
|
),
|
|
2984
|
-
trend:
|
|
2985
|
-
forecast:
|
|
2984
|
+
trend: ir.optional().describe("Trend analysis options for the measure."),
|
|
2985
|
+
forecast: sr.optional().describe("Forecast analysis options for the measure.")
|
|
2986
2986
|
}).describe("Configuration for measures.StyledMeasure"),
|
|
2987
2987
|
dimensions: o.object({
|
|
2988
2988
|
column: Ae,
|
|
@@ -3045,21 +3045,21 @@ const xe = o.object({
|
|
|
3045
3045
|
category: o.array(S.dimensions),
|
|
3046
3046
|
outliersEnabled: o.boolean().optional(),
|
|
3047
3047
|
value: o.array(S.measures)
|
|
3048
|
-
}),
|
|
3048
|
+
}), lr = o.object({
|
|
3049
3049
|
colorBy: S.measures,
|
|
3050
3050
|
// todo: or statement dimensions or measures
|
|
3051
3051
|
details: S.dimensions,
|
|
3052
3052
|
geo: o.array(S.dimensions),
|
|
3053
3053
|
size: S.measures
|
|
3054
|
-
}),
|
|
3054
|
+
}), cr = o.object({
|
|
3055
3055
|
color: o.array(S.measures),
|
|
3056
3056
|
geo: o.array(S.dimensions)
|
|
3057
3057
|
}), it = o.object({
|
|
3058
3058
|
date: o.array(S.dimensions),
|
|
3059
3059
|
value: o.array(S.measures)
|
|
3060
|
-
}),
|
|
3060
|
+
}), ur = o.object({
|
|
3061
3061
|
columns: o.array(S.dimensions)
|
|
3062
|
-
}),
|
|
3062
|
+
}), dr = (e) => {
|
|
3063
3063
|
switch (e) {
|
|
3064
3064
|
case "line":
|
|
3065
3065
|
case "bar":
|
|
@@ -3077,13 +3077,13 @@ const xe = o.object({
|
|
|
3077
3077
|
case "indicator":
|
|
3078
3078
|
return rt;
|
|
3079
3079
|
case "table":
|
|
3080
|
-
return
|
|
3080
|
+
return ur;
|
|
3081
3081
|
case "boxplot":
|
|
3082
3082
|
return ot;
|
|
3083
3083
|
case "scattermap":
|
|
3084
|
-
return sr;
|
|
3085
|
-
case "areamap":
|
|
3086
3084
|
return lr;
|
|
3085
|
+
case "areamap":
|
|
3086
|
+
return cr;
|
|
3087
3087
|
case "calendar-heatmap":
|
|
3088
3088
|
return it;
|
|
3089
3089
|
default:
|
|
@@ -3109,11 +3109,11 @@ const xe = o.object({
|
|
|
3109
3109
|
areamap: o.object({}),
|
|
3110
3110
|
"calendar-heatmap": it,
|
|
3111
3111
|
streamgraph: o.object({})
|
|
3112
|
-
},
|
|
3112
|
+
}, pr = async ({
|
|
3113
3113
|
userPrompt: e,
|
|
3114
3114
|
chartWidgetProps: t
|
|
3115
3115
|
}) => {
|
|
3116
|
-
const { dataOptions: n, chartType: a } = t, r =
|
|
3116
|
+
const { dataOptions: n, chartType: a } = t, r = dr(a);
|
|
3117
3117
|
o.object({
|
|
3118
3118
|
dataOptions: r
|
|
3119
3119
|
});
|
|
@@ -3164,13 +3164,13 @@ const xe = o.object({
|
|
|
3164
3164
|
responseFormat: { type: "json_object" }
|
|
3165
3165
|
});
|
|
3166
3166
|
console.debug("LLM RESPONSE DATA OPTIONS", l);
|
|
3167
|
-
const { dataOptions: c = null } = l, u = c ?
|
|
3167
|
+
const { dataOptions: c = null } = l, u = c ? mr(t.dataOptions, c) : t.dataOptions;
|
|
3168
3168
|
return {
|
|
3169
3169
|
...t,
|
|
3170
3170
|
dataOptions: u
|
|
3171
3171
|
};
|
|
3172
3172
|
};
|
|
3173
|
-
function
|
|
3173
|
+
function mr(e, t) {
|
|
3174
3174
|
const n = { ...e };
|
|
3175
3175
|
for (const a of Object.keys(t)) {
|
|
3176
3176
|
const r = a, i = t[r], s = e[r] || [];
|
|
@@ -3202,7 +3202,7 @@ const Y = async ({ chartId: e, userPrompt: t }, n) => {
|
|
|
3202
3202
|
const a = (i = n.retrieveChart) == null ? void 0 : i.call(n, e);
|
|
3203
3203
|
if (!a)
|
|
3204
3204
|
throw new Error("Chart not found");
|
|
3205
|
-
const r = await
|
|
3205
|
+
const r = await pr({
|
|
3206
3206
|
userPrompt: t,
|
|
3207
3207
|
chartWidgetProps: a
|
|
3208
3208
|
});
|
|
@@ -3213,44 +3213,44 @@ const Y = async ({ chartId: e, userPrompt: t }, n) => {
|
|
|
3213
3213
|
function st(e) {
|
|
3214
3214
|
return e && e.__esModule && Object.prototype.hasOwnProperty.call(e, "default") ? e.default : e;
|
|
3215
3215
|
}
|
|
3216
|
-
var
|
|
3217
|
-
return
|
|
3216
|
+
var hr = function(t) {
|
|
3217
|
+
return gr(t) && !fr(t);
|
|
3218
3218
|
};
|
|
3219
|
-
function
|
|
3219
|
+
function gr(e) {
|
|
3220
3220
|
return !!e && typeof e == "object";
|
|
3221
3221
|
}
|
|
3222
|
-
function
|
|
3222
|
+
function fr(e) {
|
|
3223
3223
|
var t = Object.prototype.toString.call(e);
|
|
3224
|
-
return t === "[object RegExp]" || t === "[object Date]" ||
|
|
3225
|
-
}
|
|
3226
|
-
var fr = typeof Symbol == "function" && Symbol.for, br = fr ? Symbol.for("react.element") : 60103;
|
|
3227
|
-
function yr(e) {
|
|
3228
|
-
return e.$$typeof === br;
|
|
3224
|
+
return t === "[object RegExp]" || t === "[object Date]" || vr(e);
|
|
3229
3225
|
}
|
|
3226
|
+
var br = typeof Symbol == "function" && Symbol.for, yr = br ? Symbol.for("react.element") : 60103;
|
|
3230
3227
|
function vr(e) {
|
|
3228
|
+
return e.$$typeof === yr;
|
|
3229
|
+
}
|
|
3230
|
+
function wr(e) {
|
|
3231
3231
|
return Array.isArray(e) ? [] : {};
|
|
3232
3232
|
}
|
|
3233
3233
|
function H(e, t) {
|
|
3234
|
-
return t.clone !== !1 && t.isMergeableObject(e) ? B(
|
|
3234
|
+
return t.clone !== !1 && t.isMergeableObject(e) ? B(wr(e), e, t) : e;
|
|
3235
3235
|
}
|
|
3236
|
-
function
|
|
3236
|
+
function Sr(e, t, n) {
|
|
3237
3237
|
return e.concat(t).map(function(a) {
|
|
3238
3238
|
return H(a, n);
|
|
3239
3239
|
});
|
|
3240
3240
|
}
|
|
3241
|
-
function
|
|
3241
|
+
function Or(e, t) {
|
|
3242
3242
|
if (!t.customMerge)
|
|
3243
3243
|
return B;
|
|
3244
3244
|
var n = t.customMerge(e);
|
|
3245
3245
|
return typeof n == "function" ? n : B;
|
|
3246
3246
|
}
|
|
3247
|
-
function
|
|
3247
|
+
function Cr(e) {
|
|
3248
3248
|
return Object.getOwnPropertySymbols ? Object.getOwnPropertySymbols(e).filter(function(t) {
|
|
3249
3249
|
return Object.propertyIsEnumerable.call(e, t);
|
|
3250
3250
|
}) : [];
|
|
3251
3251
|
}
|
|
3252
|
-
function
|
|
3253
|
-
return Object.keys(e).concat(
|
|
3252
|
+
function Te(e) {
|
|
3253
|
+
return Object.keys(e).concat(Cr(e));
|
|
3254
3254
|
}
|
|
3255
3255
|
function lt(e, t) {
|
|
3256
3256
|
try {
|
|
@@ -3259,21 +3259,21 @@ function lt(e, t) {
|
|
|
3259
3259
|
return !1;
|
|
3260
3260
|
}
|
|
3261
3261
|
}
|
|
3262
|
-
function
|
|
3262
|
+
function Dr(e, t) {
|
|
3263
3263
|
return lt(e, t) && !(Object.hasOwnProperty.call(e, t) && Object.propertyIsEnumerable.call(e, t));
|
|
3264
3264
|
}
|
|
3265
|
-
function
|
|
3265
|
+
function _r(e, t, n) {
|
|
3266
3266
|
var a = {};
|
|
3267
|
-
return n.isMergeableObject(e) &&
|
|
3267
|
+
return n.isMergeableObject(e) && Te(e).forEach(function(r) {
|
|
3268
3268
|
a[r] = H(e[r], n);
|
|
3269
|
-
}),
|
|
3270
|
-
|
|
3269
|
+
}), Te(t).forEach(function(r) {
|
|
3270
|
+
Dr(e, r) || (lt(e, r) && n.isMergeableObject(t[r]) ? a[r] = Or(r, n)(e[r], t[r], n) : a[r] = H(t[r], n));
|
|
3271
3271
|
}), a;
|
|
3272
3272
|
}
|
|
3273
3273
|
function B(e, t, n) {
|
|
3274
|
-
n = n || {}, n.arrayMerge = n.arrayMerge ||
|
|
3274
|
+
n = n || {}, n.arrayMerge = n.arrayMerge || Sr, n.isMergeableObject = n.isMergeableObject || hr, n.cloneUnlessOtherwiseSpecified = H;
|
|
3275
3275
|
var a = Array.isArray(t), r = Array.isArray(e), i = a === r;
|
|
3276
|
-
return i ? a ? n.arrayMerge(e, t, n) :
|
|
3276
|
+
return i ? a ? n.arrayMerge(e, t, n) : _r(e, t, n) : H(t, n);
|
|
3277
3277
|
}
|
|
3278
3278
|
B.all = function(t, n) {
|
|
3279
3279
|
if (!Array.isArray(t))
|
|
@@ -3282,12 +3282,12 @@ B.all = function(t, n) {
|
|
|
3282
3282
|
return B(a, r, n);
|
|
3283
3283
|
}, {});
|
|
3284
3284
|
};
|
|
3285
|
-
var
|
|
3286
|
-
const
|
|
3285
|
+
var Pr = B, Ar = Pr;
|
|
3286
|
+
const xr = /* @__PURE__ */ st(Ar), Tr = async ({
|
|
3287
3287
|
userPrompt: e,
|
|
3288
3288
|
chartWidgetProps: t
|
|
3289
3289
|
}) => {
|
|
3290
|
-
const { styleOptions: n, chartType: a } = t, r =
|
|
3290
|
+
const { styleOptions: n, chartType: a } = t, r = or(a), s = `
|
|
3291
3291
|
You are a chart style options assistant. You edit only the fields the user mentions.
|
|
3292
3292
|
|
|
3293
3293
|
DO NOT use any tools.
|
|
@@ -3317,7 +3317,7 @@ const Ar = /* @__PURE__ */ st(Pr), xr = async ({
|
|
|
3317
3317
|
systemPrompt: s,
|
|
3318
3318
|
userPrompt: e,
|
|
3319
3319
|
responseFormat: { type: "json_object" }
|
|
3320
|
-
}), { styleOptions: c = n } = l, u =
|
|
3320
|
+
}), { styleOptions: c = n } = l, u = xr(
|
|
3321
3321
|
n || {},
|
|
3322
3322
|
c || {}
|
|
3323
3323
|
);
|
|
@@ -3331,21 +3331,21 @@ const Ar = /* @__PURE__ */ st(Pr), xr = async ({
|
|
|
3331
3331
|
const a = (i = n.retrieveChart) == null ? void 0 : i.call(n, e);
|
|
3332
3332
|
if (!a)
|
|
3333
3333
|
throw new Error("Chart not found");
|
|
3334
|
-
const r = await
|
|
3334
|
+
const r = await Tr({
|
|
3335
3335
|
userPrompt: t,
|
|
3336
3336
|
chartWidgetProps: a
|
|
3337
3337
|
});
|
|
3338
3338
|
return (s = n.saveChart) == null || s.call(n, e, r), {
|
|
3339
3339
|
message: "Chart style options updated successfully"
|
|
3340
3340
|
};
|
|
3341
|
-
},
|
|
3341
|
+
}, jr = "buildChart", No = "buildDashboard", Zo = "buildDataModel", Io = "recommendQueries", Lo = "getDashboards", kr = "getDataSources", Er = "getDataSourceFields", Mr = 10, Nr = (e, t) => ({
|
|
3342
3342
|
title: e.title,
|
|
3343
3343
|
dataSourceTitle: t,
|
|
3344
3344
|
chartType: e.chartType,
|
|
3345
3345
|
filters: "Filters to be updated",
|
|
3346
3346
|
dataOptions: "Data options to be updated",
|
|
3347
3347
|
styleOptions: "Style options to be updated"
|
|
3348
|
-
}), E = (e, t, n, a, r) =>
|
|
3348
|
+
}), E = (e, t, n, a, r) => dn({
|
|
3349
3349
|
schema: e,
|
|
3350
3350
|
name: t,
|
|
3351
3351
|
description: n,
|
|
@@ -3353,30 +3353,30 @@ const Ar = /* @__PURE__ */ st(Pr), xr = async ({
|
|
|
3353
3353
|
{ ...i },
|
|
3354
3354
|
{ ...r, ...s }
|
|
3355
3355
|
)
|
|
3356
|
-
}),
|
|
3356
|
+
}), Zr = (e) => [
|
|
3357
3357
|
E(
|
|
3358
|
-
|
|
3358
|
+
Pn,
|
|
3359
3359
|
"createChart",
|
|
3360
3360
|
"Create a new chart from user prompt. Use this tool for initial creation OR when adding/removing/swapping data fields (e.g. changing Revenue to Profit). This tool also handles data limits (Top 10, Bottom 5).",
|
|
3361
|
-
|
|
3361
|
+
za,
|
|
3362
3362
|
e
|
|
3363
3363
|
),
|
|
3364
3364
|
E(
|
|
3365
|
-
|
|
3365
|
+
An,
|
|
3366
3366
|
"updateChartTitle",
|
|
3367
3367
|
"Update the title of an existing chart",
|
|
3368
|
-
|
|
3368
|
+
Ua,
|
|
3369
3369
|
e
|
|
3370
3370
|
),
|
|
3371
3371
|
E(
|
|
3372
|
-
|
|
3372
|
+
xn,
|
|
3373
3373
|
"updateChartType",
|
|
3374
3374
|
"Switch the chart type of an existing chart",
|
|
3375
|
-
|
|
3375
|
+
qa,
|
|
3376
3376
|
e
|
|
3377
3377
|
),
|
|
3378
3378
|
E(
|
|
3379
|
-
|
|
3379
|
+
Tn,
|
|
3380
3380
|
"updateChartTypeOfMeasures",
|
|
3381
3381
|
`Update the chart type of specific measures within a mixed/combo chart (e.g., make one measure a Bar and another a Line).
|
|
3382
3382
|
|
|
@@ -3412,7 +3412,7 @@ const Ar = /* @__PURE__ */ st(Pr), xr = async ({
|
|
|
3412
3412
|
e
|
|
3413
3413
|
),
|
|
3414
3414
|
E(
|
|
3415
|
-
|
|
3415
|
+
jn,
|
|
3416
3416
|
"updateTrendAndForecast",
|
|
3417
3417
|
`Update the trend and forecast analysis of existing measures in an existing chart
|
|
3418
3418
|
|
|
@@ -3433,7 +3433,7 @@ const Ar = /* @__PURE__ */ st(Pr), xr = async ({
|
|
|
3433
3433
|
e
|
|
3434
3434
|
),
|
|
3435
3435
|
E(
|
|
3436
|
-
|
|
3436
|
+
kn,
|
|
3437
3437
|
"updateOtherChartDataOptions",
|
|
3438
3438
|
`Update other data options of an existing chart including visual encodings of axes (x-axis, y-axis, and right y-axis), dimensions, and measures
|
|
3439
3439
|
|
|
@@ -3445,7 +3445,7 @@ const Ar = /* @__PURE__ */ st(Pr), xr = async ({
|
|
|
3445
3445
|
|
|
3446
3446
|
${Object.entries(J).map(
|
|
3447
3447
|
([t, n]) => `- ${t}: ${P(
|
|
3448
|
-
|
|
3448
|
+
un(n, [
|
|
3449
3449
|
"sortType",
|
|
3450
3450
|
// Has dedicated sorting tool
|
|
3451
3451
|
"trend",
|
|
@@ -3463,7 +3463,7 @@ const Ar = /* @__PURE__ */ st(Pr), xr = async ({
|
|
|
3463
3463
|
e
|
|
3464
3464
|
),
|
|
3465
3465
|
E(
|
|
3466
|
-
|
|
3466
|
+
En,
|
|
3467
3467
|
"updateChartStyleOptions",
|
|
3468
3468
|
`Update cosmetic styling options: legend position, axis titles (text), axis label formatting.
|
|
3469
3469
|
|
|
@@ -3477,7 +3477,7 @@ const Ar = /* @__PURE__ */ st(Pr), xr = async ({
|
|
|
3477
3477
|
e
|
|
3478
3478
|
)
|
|
3479
3479
|
];
|
|
3480
|
-
function
|
|
3480
|
+
function Ir(e) {
|
|
3481
3481
|
return `You are an intelligent and proactive chart assistant.
|
|
3482
3482
|
Your role is to create and update a chart based on natural language requests by using the available tools.
|
|
3483
3483
|
|
|
@@ -3506,9 +3506,9 @@ If the prompt can be handled by a single tool, use that tool without splitting t
|
|
|
3506
3506
|
|
|
3507
3507
|
`;
|
|
3508
3508
|
}
|
|
3509
|
-
async function
|
|
3509
|
+
async function Ro(e, t) {
|
|
3510
3510
|
const { dataSourceTitle: n, userPrompt: a } = e;
|
|
3511
|
-
if (console.debug(
|
|
3511
|
+
if (console.debug(jr, n, a), !n)
|
|
3512
3512
|
throw new Error(
|
|
3513
3513
|
"Error: Please ask the user to specify a data source title"
|
|
3514
3514
|
);
|
|
@@ -3526,9 +3526,9 @@ async function Lo(e, t) {
|
|
|
3526
3526
|
var N;
|
|
3527
3527
|
(N = t.saveChart) == null || N.call(t, r, C), i = C;
|
|
3528
3528
|
}
|
|
3529
|
-
}, u =
|
|
3530
|
-
(t.chartSummaries ?? []).slice(-
|
|
3531
|
-
), d =
|
|
3529
|
+
}, u = Ir(
|
|
3530
|
+
(t.chartSummaries ?? []).slice(-Mr)
|
|
3531
|
+
), d = Zr(c), { combinedMessage: m, isError: p } = await $a({
|
|
3532
3532
|
systemPrompt: u,
|
|
3533
3533
|
userPrompt: a,
|
|
3534
3534
|
tools: d
|
|
@@ -3539,18 +3539,18 @@ async function Lo(e, t) {
|
|
|
3539
3539
|
message: s,
|
|
3540
3540
|
createdAt: (/* @__PURE__ */ new Date()).toISOString(),
|
|
3541
3541
|
chartId: r,
|
|
3542
|
-
chart: i ?
|
|
3542
|
+
chart: i ? Nr(i, n) : void 0
|
|
3543
3543
|
};
|
|
3544
3544
|
}
|
|
3545
|
-
const
|
|
3546
|
-
async function
|
|
3547
|
-
const t = f(), n = `${
|
|
3545
|
+
const Lr = "api/v2/datamodels";
|
|
3546
|
+
async function Rr(e) {
|
|
3547
|
+
const t = f(), n = `${Lr}/schema?title=${encodeURIComponent(
|
|
3548
3548
|
e
|
|
3549
3549
|
)}`;
|
|
3550
3550
|
return await t.get(n) ?? null;
|
|
3551
3551
|
}
|
|
3552
3552
|
const be = "api/datasources";
|
|
3553
|
-
function
|
|
3553
|
+
function zr(e, t) {
|
|
3554
3554
|
const n = t.reduce(
|
|
3555
3555
|
(a, r) => (r.schema.tables.forEach((i) => {
|
|
3556
3556
|
a[i.name] = {}, i.columns.forEach((s) => {
|
|
@@ -3567,7 +3567,7 @@ function Ir(e, t) {
|
|
|
3567
3567
|
};
|
|
3568
3568
|
});
|
|
3569
3569
|
}
|
|
3570
|
-
async function
|
|
3570
|
+
async function Br() {
|
|
3571
3571
|
const e = f(), t = `${be}/?sharedWith=r,w`;
|
|
3572
3572
|
return await e.get(t) || [];
|
|
3573
3573
|
}
|
|
@@ -3576,7 +3576,7 @@ async function ct(e) {
|
|
|
3576
3576
|
`${be}/${encodeURIComponent(e)}`
|
|
3577
3577
|
) ?? null;
|
|
3578
3578
|
}
|
|
3579
|
-
async function
|
|
3579
|
+
async function Ur(e) {
|
|
3580
3580
|
return f().post(
|
|
3581
3581
|
`${be}/${encodeURIComponent(
|
|
3582
3582
|
e
|
|
@@ -3587,13 +3587,13 @@ async function Lr(e) {
|
|
|
3587
3587
|
}
|
|
3588
3588
|
).then((n) => n ?? null);
|
|
3589
3589
|
}
|
|
3590
|
-
async function
|
|
3590
|
+
async function ut(e) {
|
|
3591
3591
|
var n;
|
|
3592
|
-
const t = await
|
|
3592
|
+
const t = await Ur(e);
|
|
3593
3593
|
if (!t) return [];
|
|
3594
3594
|
try {
|
|
3595
|
-
const a = await
|
|
3596
|
-
return a != null && a.datasets ?
|
|
3595
|
+
const a = await Rr(e);
|
|
3596
|
+
return a != null && a.datasets ? zr(
|
|
3597
3597
|
t,
|
|
3598
3598
|
a.datasets
|
|
3599
3599
|
) : t;
|
|
@@ -3608,7 +3608,7 @@ async function Rr(e) {
|
|
|
3608
3608
|
throw a;
|
|
3609
3609
|
}
|
|
3610
3610
|
}
|
|
3611
|
-
function
|
|
3611
|
+
function Fr(e) {
|
|
3612
3612
|
const t = [];
|
|
3613
3613
|
return e.forEach((n) => {
|
|
3614
3614
|
const a = ve(n.column), r = {
|
|
@@ -3618,7 +3618,7 @@ function zr(e) {
|
|
|
3618
3618
|
expression: n.id,
|
|
3619
3619
|
description: n.description || `${n.table}.${n.column}`
|
|
3620
3620
|
};
|
|
3621
|
-
t.push(r), n.dimtype === "datetime" &&
|
|
3621
|
+
t.push(r), n.dimtype === "datetime" && Ct.all.forEach((i) => {
|
|
3622
3622
|
t.push({
|
|
3623
3623
|
...r,
|
|
3624
3624
|
column: `${a}.${i}`,
|
|
@@ -3630,16 +3630,43 @@ function zr(e) {
|
|
|
3630
3630
|
});
|
|
3631
3631
|
}), t;
|
|
3632
3632
|
}
|
|
3633
|
-
async function zo(e, t =
|
|
3633
|
+
async function zo(e, t = ut) {
|
|
3634
3634
|
const n = await t(e);
|
|
3635
|
-
return
|
|
3635
|
+
return Fr(n);
|
|
3636
|
+
}
|
|
3637
|
+
async function Bo(e, t) {
|
|
3638
|
+
console.debug(kr, t.toolCallId);
|
|
3639
|
+
const n = await Br();
|
|
3640
|
+
return {
|
|
3641
|
+
dataSourceTitles: n.map((a) => a.title),
|
|
3642
|
+
dataSources: n
|
|
3643
|
+
};
|
|
3644
|
+
}
|
|
3645
|
+
const Uo = o.object({});
|
|
3646
|
+
async function Fo(e, t) {
|
|
3647
|
+
const { dataSourceTitle: n } = e;
|
|
3648
|
+
if (console.debug(
|
|
3649
|
+
Er,
|
|
3650
|
+
n,
|
|
3651
|
+
t.toolCallId
|
|
3652
|
+
), !n)
|
|
3653
|
+
throw new Error(
|
|
3654
|
+
"Error: Please ask the user to specify a data source title"
|
|
3655
|
+
);
|
|
3656
|
+
const a = await ut(n);
|
|
3657
|
+
return {
|
|
3658
|
+
dataSourceTitle: n,
|
|
3659
|
+
fields: a || []
|
|
3660
|
+
};
|
|
3636
3661
|
}
|
|
3637
|
-
const
|
|
3638
|
-
|
|
3662
|
+
const qo = o.object({
|
|
3663
|
+
dataSourceTitle: o.string().describe("Data source title")
|
|
3664
|
+
}), z = "api/v1/dashboards";
|
|
3665
|
+
function Wo(e) {
|
|
3639
3666
|
const t = f();
|
|
3640
3667
|
return `${he(t.url)}app/main/dashboards/${e}`;
|
|
3641
3668
|
}
|
|
3642
|
-
async function
|
|
3669
|
+
async function qr(e = {}) {
|
|
3643
3670
|
const t = f(), { fields: n, expand: a, searchByTitle: r } = e, i = new URLSearchParams({
|
|
3644
3671
|
...r && { name: r },
|
|
3645
3672
|
...(n == null ? void 0 : n.length) && { fields: n == null ? void 0 : n.join(",") },
|
|
@@ -3649,7 +3676,7 @@ async function Br(e = {}) {
|
|
|
3649
3676
|
);
|
|
3650
3677
|
return s || [];
|
|
3651
3678
|
}
|
|
3652
|
-
async function
|
|
3679
|
+
async function Wr(e) {
|
|
3653
3680
|
const t = f();
|
|
3654
3681
|
try {
|
|
3655
3682
|
return await t.get(
|
|
@@ -3661,9 +3688,9 @@ async function Ur(e) {
|
|
|
3661
3688
|
);
|
|
3662
3689
|
}
|
|
3663
3690
|
}
|
|
3664
|
-
async function
|
|
3691
|
+
async function Hr(e) {
|
|
3665
3692
|
const t = f();
|
|
3666
|
-
return await
|
|
3693
|
+
return await wt(t, e, {
|
|
3667
3694
|
includeWidgets: !0,
|
|
3668
3695
|
includeFilters: !0
|
|
3669
3696
|
});
|
|
@@ -3674,13 +3701,13 @@ async function pe(e, t) {
|
|
|
3674
3701
|
t
|
|
3675
3702
|
) ?? null;
|
|
3676
3703
|
}
|
|
3677
|
-
async function
|
|
3704
|
+
async function Vr(e, t) {
|
|
3678
3705
|
return await f().post(
|
|
3679
3706
|
`${z}/${e}/widgets`,
|
|
3680
3707
|
t
|
|
3681
3708
|
) ?? null;
|
|
3682
3709
|
}
|
|
3683
|
-
async function
|
|
3710
|
+
async function $e(e, t) {
|
|
3684
3711
|
return await f().post(
|
|
3685
3712
|
`${z}`,
|
|
3686
3713
|
{
|
|
@@ -3690,17 +3717,17 @@ async function Te(e, t) {
|
|
|
3690
3717
|
}
|
|
3691
3718
|
) ?? null;
|
|
3692
3719
|
}
|
|
3693
|
-
function
|
|
3720
|
+
function Ho(e) {
|
|
3694
3721
|
return f().delete(
|
|
3695
3722
|
`${z}/${e}`
|
|
3696
3723
|
);
|
|
3697
3724
|
}
|
|
3698
|
-
function
|
|
3725
|
+
function Jr(e, t) {
|
|
3699
3726
|
return f().delete(
|
|
3700
3727
|
`${z}/${e}/widgets/${t}`
|
|
3701
3728
|
);
|
|
3702
3729
|
}
|
|
3703
|
-
function
|
|
3730
|
+
function Yr(e) {
|
|
3704
3731
|
return {
|
|
3705
3732
|
columns: e.columns.map((t) => ({
|
|
3706
3733
|
width: t.widthPercentage,
|
|
@@ -3723,8 +3750,8 @@ function Hr(e) {
|
|
|
3723
3750
|
}))
|
|
3724
3751
|
};
|
|
3725
3752
|
}
|
|
3726
|
-
async function
|
|
3727
|
-
return (await
|
|
3753
|
+
async function Vo() {
|
|
3754
|
+
return (await qr({
|
|
3728
3755
|
fields: ["title", "oid", "datasource", "settings"]
|
|
3729
3756
|
})).filter(
|
|
3730
3757
|
(n) => {
|
|
@@ -3737,42 +3764,42 @@ async function Fo() {
|
|
|
3737
3764
|
dataSourceTitle: n.datasource.title
|
|
3738
3765
|
}));
|
|
3739
3766
|
}
|
|
3740
|
-
async function
|
|
3767
|
+
async function Gr(e) {
|
|
3741
3768
|
var n;
|
|
3742
|
-
const t = await
|
|
3769
|
+
const t = await Hr(e);
|
|
3743
3770
|
if (!(t && ((n = t.settings) == null ? void 0 : n.managedByTool) !== "studio-assistant"))
|
|
3744
|
-
return t ?
|
|
3771
|
+
return t ? St.toDashboardProps(t) : void 0;
|
|
3745
3772
|
}
|
|
3746
|
-
async function
|
|
3747
|
-
const t = await
|
|
3773
|
+
async function Jo(e) {
|
|
3774
|
+
const t = await Gr(e);
|
|
3748
3775
|
if (!t)
|
|
3749
3776
|
throw new Error(
|
|
3750
3777
|
"Dashboard not available for editing. Please specify a different dashboard."
|
|
3751
3778
|
);
|
|
3752
3779
|
return t;
|
|
3753
3780
|
}
|
|
3754
|
-
async function
|
|
3781
|
+
async function Qr(e, t) {
|
|
3755
3782
|
if (t.length === 0)
|
|
3756
3783
|
return [];
|
|
3757
3784
|
const a = t.map((s) => {
|
|
3758
3785
|
const l = ye.fromWidgetProps(s), c = Ee(s) && s.dataSource ? ie(s.dataSource) : void 0;
|
|
3759
3786
|
return ye.toWidgetDto(l, c);
|
|
3760
3787
|
}).map(
|
|
3761
|
-
(s, l) =>
|
|
3788
|
+
(s, l) => Vr(e, s).then((c) => ({
|
|
3762
3789
|
index: l,
|
|
3763
3790
|
result: c
|
|
3764
3791
|
}))
|
|
3765
3792
|
);
|
|
3766
3793
|
return (await Promise.all(a)).sort((s, l) => s.index - l.index).map((s) => s.result).filter((s) => s !== void 0);
|
|
3767
3794
|
}
|
|
3768
|
-
async function
|
|
3769
|
-
const n =
|
|
3795
|
+
async function Xr(e, t) {
|
|
3796
|
+
const n = Ot(t);
|
|
3770
3797
|
await pe(e, n);
|
|
3771
3798
|
}
|
|
3772
|
-
function
|
|
3799
|
+
function Yo(e) {
|
|
3773
3800
|
return !!e.id;
|
|
3774
3801
|
}
|
|
3775
|
-
async function
|
|
3802
|
+
async function Go(e) {
|
|
3776
3803
|
var d, m;
|
|
3777
3804
|
const t = e.defaultDataSource;
|
|
3778
3805
|
if (!t)
|
|
@@ -3789,12 +3816,12 @@ async function Ho(e) {
|
|
|
3789
3816
|
await pe(e.id, {
|
|
3790
3817
|
title: i
|
|
3791
3818
|
});
|
|
3792
|
-
const p = await
|
|
3819
|
+
const p = await Wr(
|
|
3793
3820
|
r
|
|
3794
3821
|
);
|
|
3795
3822
|
p && await Promise.all(
|
|
3796
3823
|
p.map(
|
|
3797
|
-
(O) =>
|
|
3824
|
+
(O) => Jr(
|
|
3798
3825
|
r,
|
|
3799
3826
|
O.oid
|
|
3800
3827
|
)
|
|
@@ -3802,7 +3829,7 @@ async function Ho(e) {
|
|
|
3802
3829
|
);
|
|
3803
3830
|
} catch (p) {
|
|
3804
3831
|
if ((p == null ? void 0 : p.status) === "404" || (p == null ? void 0 : p.status) === 404) {
|
|
3805
|
-
const O = await
|
|
3832
|
+
const O = await $e(
|
|
3806
3833
|
i,
|
|
3807
3834
|
a
|
|
3808
3835
|
);
|
|
@@ -3813,7 +3840,7 @@ async function Ho(e) {
|
|
|
3813
3840
|
throw p;
|
|
3814
3841
|
}
|
|
3815
3842
|
} else {
|
|
3816
|
-
const p = await
|
|
3843
|
+
const p = await $e(
|
|
3817
3844
|
i,
|
|
3818
3845
|
a
|
|
3819
3846
|
);
|
|
@@ -3825,7 +3852,7 @@ async function Ho(e) {
|
|
|
3825
3852
|
...e,
|
|
3826
3853
|
id: r,
|
|
3827
3854
|
title: i
|
|
3828
|
-
}, l = await
|
|
3855
|
+
}, l = await Qr(
|
|
3829
3856
|
r,
|
|
3830
3857
|
e.widgets
|
|
3831
3858
|
), c = e.widgets.map((p, O) => {
|
|
@@ -3847,7 +3874,7 @@ async function Ho(e) {
|
|
|
3847
3874
|
return {
|
|
3848
3875
|
...C,
|
|
3849
3876
|
widgetId: ((N = c.find(
|
|
3850
|
-
(
|
|
3877
|
+
(mt) => mt.oldId === C.widgetId
|
|
3851
3878
|
)) == null ? void 0 : N.id) || C.widgetId
|
|
3852
3879
|
};
|
|
3853
3880
|
})
|
|
@@ -3856,8 +3883,8 @@ async function Ho(e) {
|
|
|
3856
3883
|
)
|
|
3857
3884
|
} : (m = e.layoutOptions) == null ? void 0 : m.widgetsPanel;
|
|
3858
3885
|
return u && await pe(r, {
|
|
3859
|
-
layout:
|
|
3860
|
-
}), await
|
|
3886
|
+
layout: Yr(u)
|
|
3887
|
+
}), await Xr(
|
|
3861
3888
|
r,
|
|
3862
3889
|
e.filters ?? []
|
|
3863
3890
|
), {
|
|
@@ -3866,7 +3893,7 @@ async function Ho(e) {
|
|
|
3866
3893
|
layoutOptions: { widgetsPanel: u }
|
|
3867
3894
|
};
|
|
3868
3895
|
}
|
|
3869
|
-
var
|
|
3896
|
+
var Kr = function e(t, n) {
|
|
3870
3897
|
if (t === n) return !0;
|
|
3871
3898
|
if (t && n && typeof t == "object" && typeof n == "object") {
|
|
3872
3899
|
if (t.constructor !== n.constructor) return !1;
|
|
@@ -3891,13 +3918,13 @@ var Gr = function e(t, n) {
|
|
|
3891
3918
|
}
|
|
3892
3919
|
return t !== t && n !== n;
|
|
3893
3920
|
};
|
|
3894
|
-
const
|
|
3895
|
-
function
|
|
3921
|
+
const eo = /* @__PURE__ */ st(Kr);
|
|
3922
|
+
function to(e) {
|
|
3896
3923
|
return e.columns.flatMap(
|
|
3897
3924
|
(t) => t.rows.flatMap((n) => n.cells.map((a) => a.widgetId))
|
|
3898
3925
|
);
|
|
3899
3926
|
}
|
|
3900
|
-
function
|
|
3927
|
+
function no(e, t) {
|
|
3901
3928
|
const n = e.columns.map((a) => ({
|
|
3902
3929
|
...a,
|
|
3903
3930
|
rows: a.rows.map((r) => ({
|
|
@@ -3910,7 +3937,7 @@ function Kr(e, t) {
|
|
|
3910
3937
|
})).filter((a) => a.rows.length > 0);
|
|
3911
3938
|
return n.length > 0 ? { columns: n } : { columns: [] };
|
|
3912
3939
|
}
|
|
3913
|
-
function
|
|
3940
|
+
function ao(e) {
|
|
3914
3941
|
return e.columns.length === 1 ? {
|
|
3915
3942
|
...e,
|
|
3916
3943
|
columns: [
|
|
@@ -3921,31 +3948,31 @@ function eo(e) {
|
|
|
3921
3948
|
]
|
|
3922
3949
|
} : e;
|
|
3923
3950
|
}
|
|
3924
|
-
function
|
|
3951
|
+
function ro(e, t) {
|
|
3925
3952
|
if (!t)
|
|
3926
3953
|
return [];
|
|
3927
|
-
const n =
|
|
3954
|
+
const n = to(t);
|
|
3928
3955
|
return e.filter((a) => !n.includes(a.id)).map((a) => a.id);
|
|
3929
3956
|
}
|
|
3930
|
-
function
|
|
3957
|
+
function oo(e) {
|
|
3931
3958
|
var a, r;
|
|
3932
3959
|
let t = { ...e };
|
|
3933
|
-
const n =
|
|
3960
|
+
const n = ro(
|
|
3934
3961
|
t.widgets,
|
|
3935
3962
|
(a = t.layoutOptions) == null ? void 0 : a.widgetsPanel
|
|
3936
3963
|
);
|
|
3937
|
-
if (n.length > 0 && (t =
|
|
3964
|
+
if (n.length > 0 && (t = dt(
|
|
3938
3965
|
t,
|
|
3939
3966
|
n
|
|
3940
3967
|
)), (r = t.layoutOptions) != null && r.widgetsPanel) {
|
|
3941
3968
|
const i = new Set(
|
|
3942
3969
|
t.widgets.map((l) => l.id)
|
|
3943
3970
|
);
|
|
3944
|
-
let s =
|
|
3971
|
+
let s = no(
|
|
3945
3972
|
t.layoutOptions.widgetsPanel,
|
|
3946
3973
|
i
|
|
3947
3974
|
);
|
|
3948
|
-
s =
|
|
3975
|
+
s = ao(s), t = {
|
|
3949
3976
|
...t,
|
|
3950
3977
|
layoutOptions: {
|
|
3951
3978
|
...t.layoutOptions,
|
|
@@ -3955,7 +3982,7 @@ function no(e) {
|
|
|
3955
3982
|
}
|
|
3956
3983
|
return { changed: !0, updatedDashboardProps: t };
|
|
3957
3984
|
}
|
|
3958
|
-
function
|
|
3985
|
+
function io(e, t) {
|
|
3959
3986
|
return {
|
|
3960
3987
|
changed: !0,
|
|
3961
3988
|
updatedDashboardProps: {
|
|
@@ -3964,7 +3991,7 @@ function ao(e, t) {
|
|
|
3964
3991
|
}
|
|
3965
3992
|
};
|
|
3966
3993
|
}
|
|
3967
|
-
function
|
|
3994
|
+
function so(e, t) {
|
|
3968
3995
|
var n;
|
|
3969
3996
|
return {
|
|
3970
3997
|
changed: !0,
|
|
@@ -3980,9 +4007,9 @@ function ro(e, t) {
|
|
|
3980
4007
|
}
|
|
3981
4008
|
};
|
|
3982
4009
|
}
|
|
3983
|
-
function
|
|
4010
|
+
function lo(e, t) {
|
|
3984
4011
|
var n;
|
|
3985
|
-
return
|
|
4012
|
+
return eo(t, (n = e.layoutOptions) == null ? void 0 : n.widgetsPanel) ? { changed: !1, updatedDashboardProps: e } : {
|
|
3986
4013
|
changed: !0,
|
|
3987
4014
|
updatedDashboardProps: {
|
|
3988
4015
|
...e,
|
|
@@ -3993,16 +4020,16 @@ function oo(e, t) {
|
|
|
3993
4020
|
}
|
|
3994
4021
|
};
|
|
3995
4022
|
}
|
|
3996
|
-
function
|
|
4023
|
+
function co(e, t) {
|
|
3997
4024
|
return {
|
|
3998
4025
|
changed: !0,
|
|
3999
|
-
updatedDashboardProps:
|
|
4026
|
+
updatedDashboardProps: dt(
|
|
4000
4027
|
e,
|
|
4001
4028
|
t
|
|
4002
4029
|
)
|
|
4003
4030
|
};
|
|
4004
4031
|
}
|
|
4005
|
-
function
|
|
4032
|
+
function uo(e, t) {
|
|
4006
4033
|
var n, a, r;
|
|
4007
4034
|
return {
|
|
4008
4035
|
changed: !0,
|
|
@@ -4022,7 +4049,7 @@ function so(e, t) {
|
|
|
4022
4049
|
}
|
|
4023
4050
|
};
|
|
4024
4051
|
}
|
|
4025
|
-
function
|
|
4052
|
+
function Qo(e) {
|
|
4026
4053
|
const t = /* @__PURE__ */ new Map(), { widgets: n, defaultDataSource: a } = e;
|
|
4027
4054
|
return a && se(a) && t.set(
|
|
4028
4055
|
a.title,
|
|
@@ -4084,7 +4111,7 @@ function je(e) {
|
|
|
4084
4111
|
]
|
|
4085
4112
|
};
|
|
4086
4113
|
}
|
|
4087
|
-
function
|
|
4114
|
+
function po(e, t) {
|
|
4088
4115
|
const a = {
|
|
4089
4116
|
cells: [{
|
|
4090
4117
|
widthPercentage: 100,
|
|
@@ -4113,7 +4140,7 @@ function lo(e, t) {
|
|
|
4113
4140
|
)
|
|
4114
4141
|
};
|
|
4115
4142
|
}
|
|
4116
|
-
function
|
|
4143
|
+
function mo() {
|
|
4117
4144
|
return {
|
|
4118
4145
|
toolbar: { visible: !0 },
|
|
4119
4146
|
widgetsPanel: {
|
|
@@ -4143,16 +4170,16 @@ function co() {
|
|
|
4143
4170
|
}
|
|
4144
4171
|
};
|
|
4145
4172
|
}
|
|
4146
|
-
function
|
|
4173
|
+
function ho() {
|
|
4147
4174
|
return {
|
|
4148
4175
|
title: "Dashboard Title",
|
|
4149
4176
|
widgets: [],
|
|
4150
4177
|
layoutOptions: {},
|
|
4151
|
-
config:
|
|
4178
|
+
config: mo(),
|
|
4152
4179
|
filters: []
|
|
4153
4180
|
};
|
|
4154
4181
|
}
|
|
4155
|
-
async function
|
|
4182
|
+
async function go(e, t) {
|
|
4156
4183
|
const n = await ct(e);
|
|
4157
4184
|
if (!n)
|
|
4158
4185
|
throw new Error(
|
|
@@ -4160,24 +4187,24 @@ async function po(e, t) {
|
|
|
4160
4187
|
);
|
|
4161
4188
|
const a = Me(n);
|
|
4162
4189
|
return {
|
|
4163
|
-
...
|
|
4190
|
+
...ho(),
|
|
4164
4191
|
title: t,
|
|
4165
4192
|
defaultDataSource: a
|
|
4166
4193
|
};
|
|
4167
4194
|
}
|
|
4168
|
-
function
|
|
4195
|
+
function Xo(e) {
|
|
4169
4196
|
return {
|
|
4170
4197
|
...e,
|
|
4171
4198
|
id: me()
|
|
4172
4199
|
};
|
|
4173
4200
|
}
|
|
4174
|
-
function
|
|
4201
|
+
function fo(e, t) {
|
|
4175
4202
|
return {
|
|
4176
4203
|
...e,
|
|
4177
4204
|
widgets: [...e.widgets, ...t]
|
|
4178
4205
|
};
|
|
4179
4206
|
}
|
|
4180
|
-
function
|
|
4207
|
+
function bo(e, t = []) {
|
|
4181
4208
|
var i;
|
|
4182
4209
|
const n = (i = e.layoutOptions) == null ? void 0 : i.widgetsPanel;
|
|
4183
4210
|
let a = n || {
|
|
@@ -4188,38 +4215,38 @@ function ho(e, t = []) {
|
|
|
4188
4215
|
) : (a || (a = je(
|
|
4189
4216
|
e.widgets.map((s) => s.id)
|
|
4190
4217
|
)), t.forEach((s) => {
|
|
4191
|
-
a =
|
|
4218
|
+
a = po(a, s);
|
|
4192
4219
|
})), {
|
|
4193
4220
|
...e,
|
|
4194
4221
|
layoutOptions: { widgetsPanel: a }
|
|
4195
4222
|
};
|
|
4196
4223
|
}
|
|
4197
|
-
function
|
|
4224
|
+
function Ko(e, t) {
|
|
4198
4225
|
return {
|
|
4199
4226
|
...e,
|
|
4200
4227
|
title: t
|
|
4201
4228
|
};
|
|
4202
4229
|
}
|
|
4203
|
-
async function
|
|
4204
|
-
const a = await
|
|
4230
|
+
async function ei(e, t, n = []) {
|
|
4231
|
+
const a = await go(
|
|
4205
4232
|
e,
|
|
4206
4233
|
t
|
|
4207
4234
|
);
|
|
4208
|
-
return
|
|
4235
|
+
return yo(a, n);
|
|
4209
4236
|
}
|
|
4210
|
-
function
|
|
4237
|
+
function yo(e, t) {
|
|
4211
4238
|
if (t.length === 0)
|
|
4212
4239
|
return e;
|
|
4213
|
-
const n =
|
|
4240
|
+
const n = fo(
|
|
4214
4241
|
e,
|
|
4215
4242
|
t
|
|
4216
4243
|
);
|
|
4217
|
-
return
|
|
4244
|
+
return bo(
|
|
4218
4245
|
n,
|
|
4219
4246
|
t.map((r) => r.id)
|
|
4220
4247
|
);
|
|
4221
4248
|
}
|
|
4222
|
-
function
|
|
4249
|
+
function dt(e, t) {
|
|
4223
4250
|
return {
|
|
4224
4251
|
...e,
|
|
4225
4252
|
widgets: e.widgets.filter(
|
|
@@ -4227,21 +4254,21 @@ function ut(e, t) {
|
|
|
4227
4254
|
)
|
|
4228
4255
|
};
|
|
4229
4256
|
}
|
|
4230
|
-
function
|
|
4257
|
+
function vo(e, t) {
|
|
4231
4258
|
switch (t.type) {
|
|
4232
4259
|
case "filters/updated":
|
|
4233
|
-
return
|
|
4260
|
+
return io(e, t.payload);
|
|
4234
4261
|
case "filtersPanel/collapse/changed":
|
|
4235
|
-
return
|
|
4262
|
+
return so(e, t.payload);
|
|
4236
4263
|
case "widgetsPanel/layout/updated":
|
|
4237
|
-
return
|
|
4264
|
+
return lo(
|
|
4238
4265
|
e,
|
|
4239
4266
|
t.payload
|
|
4240
4267
|
);
|
|
4241
4268
|
case "widgets/deleted":
|
|
4242
|
-
return
|
|
4269
|
+
return co(e, t.payload);
|
|
4243
4270
|
case "widgetsPanel/editMode/isEditing/changed":
|
|
4244
|
-
return
|
|
4271
|
+
return uo(
|
|
4245
4272
|
e,
|
|
4246
4273
|
t.payload
|
|
4247
4274
|
);
|
|
@@ -4249,14 +4276,14 @@ function fo(e, t) {
|
|
|
4249
4276
|
return { changed: !1, updatedDashboardProps: e };
|
|
4250
4277
|
}
|
|
4251
4278
|
}
|
|
4252
|
-
function
|
|
4253
|
-
const { changed: n, updatedDashboardProps: a } =
|
|
4279
|
+
function ti(e, t) {
|
|
4280
|
+
const { changed: n, updatedDashboardProps: a } = vo(
|
|
4254
4281
|
e,
|
|
4255
4282
|
t
|
|
4256
4283
|
);
|
|
4257
|
-
return n ?
|
|
4284
|
+
return n ? oo(a) : { changed: n, updatedDashboardProps: a };
|
|
4258
4285
|
}
|
|
4259
|
-
async function
|
|
4286
|
+
async function ni({ title: e }) {
|
|
4260
4287
|
var r;
|
|
4261
4288
|
const t = f(), n = {
|
|
4262
4289
|
operationName: "createNewElasticube",
|
|
@@ -4342,7 +4369,7 @@ fragment experiments on Experiments {
|
|
|
4342
4369
|
throw new Error(a.errors[0].error.message);
|
|
4343
4370
|
return (r = a == null ? void 0 : a.data) == null ? void 0 : r.newCube;
|
|
4344
4371
|
}
|
|
4345
|
-
async function
|
|
4372
|
+
async function ai({
|
|
4346
4373
|
filePath: e,
|
|
4347
4374
|
fileName: t
|
|
4348
4375
|
}) {
|
|
@@ -4369,14 +4396,14 @@ async function Ko({
|
|
|
4369
4396
|
n
|
|
4370
4397
|
) ?? null;
|
|
4371
4398
|
}
|
|
4372
|
-
async function
|
|
4399
|
+
async function ri({
|
|
4373
4400
|
elasticubeOid: e
|
|
4374
4401
|
}) {
|
|
4375
4402
|
return await f().get(
|
|
4376
4403
|
`/api/v2/perspectives/getPerspectiveElasticubesAndLatestRevisionsByOid?parentOid=${e}`
|
|
4377
4404
|
) ?? null;
|
|
4378
4405
|
}
|
|
4379
|
-
async function
|
|
4406
|
+
async function oi({
|
|
4380
4407
|
elasticubeOid: e,
|
|
4381
4408
|
filePath: t,
|
|
4382
4409
|
fileName: n,
|
|
@@ -4472,7 +4499,7 @@ async function ti({
|
|
|
4472
4499
|
m
|
|
4473
4500
|
), columns: d, tableOid: s };
|
|
4474
4501
|
}
|
|
4475
|
-
async function
|
|
4502
|
+
async function ii({
|
|
4476
4503
|
elasticubeOid: e
|
|
4477
4504
|
}) {
|
|
4478
4505
|
const t = {
|
|
@@ -4495,12 +4522,12 @@ async function ni({
|
|
|
4495
4522
|
t
|
|
4496
4523
|
) ?? null;
|
|
4497
4524
|
}
|
|
4498
|
-
async function
|
|
4525
|
+
async function si() {
|
|
4499
4526
|
return await f().get(
|
|
4500
4527
|
"/api/v2/builds"
|
|
4501
4528
|
) ?? null;
|
|
4502
4529
|
}
|
|
4503
|
-
async function
|
|
4530
|
+
async function li({
|
|
4504
4531
|
elasticubeOid: e,
|
|
4505
4532
|
source: t,
|
|
4506
4533
|
target: n
|
|
@@ -4535,7 +4562,7 @@ async function ri({
|
|
|
4535
4562
|
a
|
|
4536
4563
|
) ?? null;
|
|
4537
4564
|
}
|
|
4538
|
-
async function
|
|
4565
|
+
async function ci() {
|
|
4539
4566
|
var a;
|
|
4540
4567
|
const e = f(), t = {
|
|
4541
4568
|
operationName: "elasticubesMetadata",
|
|
@@ -4660,7 +4687,7 @@ fragment experiments on Experiments {
|
|
|
4660
4687
|
throw new Error("Failed to get elasticubes list");
|
|
4661
4688
|
return n.data.elasticubesMetadata;
|
|
4662
4689
|
}
|
|
4663
|
-
async function
|
|
4690
|
+
async function ui({
|
|
4664
4691
|
cubeOid: e
|
|
4665
4692
|
}) {
|
|
4666
4693
|
const t = f(), n = {
|
|
@@ -4836,7 +4863,7 @@ fragment experiments on Experiments {
|
|
|
4836
4863
|
n
|
|
4837
4864
|
) ?? null;
|
|
4838
4865
|
}
|
|
4839
|
-
async function
|
|
4866
|
+
async function di({
|
|
4840
4867
|
oid: e,
|
|
4841
4868
|
replacementDataSource: t
|
|
4842
4869
|
}) {
|
|
@@ -4858,7 +4885,7 @@ async function si({
|
|
|
4858
4885
|
throw new Error("Failed to delete elasticube");
|
|
4859
4886
|
return r.data.removeElasticubeByOid;
|
|
4860
4887
|
}
|
|
4861
|
-
async function
|
|
4888
|
+
async function wo(e, t) {
|
|
4862
4889
|
const n = f(), a = new File([t], e, { type: "text/csv" }), r = {
|
|
4863
4890
|
filename: e,
|
|
4864
4891
|
size: a.size
|
|
@@ -4870,8 +4897,8 @@ async function bo(e, t) {
|
|
|
4870
4897
|
throw new Error("Failed to get file validation token");
|
|
4871
4898
|
return { file: a, fileToken: i.token };
|
|
4872
4899
|
}
|
|
4873
|
-
async function
|
|
4874
|
-
const n = f(), { fileToken: a, file: r } = await
|
|
4900
|
+
async function pi(e, t) {
|
|
4901
|
+
const n = f(), { fileToken: a, file: r } = await wo(e, t), i = new FormData();
|
|
4875
4902
|
i.append("file", r);
|
|
4876
4903
|
const s = {
|
|
4877
4904
|
Accept: "application/json",
|
|
@@ -4891,19 +4918,19 @@ async function li(e, t) {
|
|
|
4891
4918
|
) : new Error("Failed to upload file");
|
|
4892
4919
|
return await l.json();
|
|
4893
4920
|
}
|
|
4894
|
-
async function
|
|
4921
|
+
async function mi() {
|
|
4895
4922
|
return await f().get("api/globals");
|
|
4896
4923
|
}
|
|
4897
|
-
const
|
|
4898
|
-
async function
|
|
4924
|
+
const pt = "api/v2/settings/ai/llm";
|
|
4925
|
+
async function hi() {
|
|
4899
4926
|
const t = await f().get(
|
|
4900
|
-
|
|
4927
|
+
pt
|
|
4901
4928
|
);
|
|
4902
4929
|
if (!t)
|
|
4903
4930
|
throw new Error("Failed to load LLM settings");
|
|
4904
4931
|
return t;
|
|
4905
4932
|
}
|
|
4906
|
-
async function
|
|
4933
|
+
async function gi(e) {
|
|
4907
4934
|
const t = f(), n = {
|
|
4908
4935
|
provider: e.provider,
|
|
4909
4936
|
model: e.model,
|
|
@@ -4915,121 +4942,125 @@ async function di(e) {
|
|
|
4915
4942
|
aiAssistant: e.aiAssistant
|
|
4916
4943
|
};
|
|
4917
4944
|
try {
|
|
4918
|
-
return await t.post(
|
|
4945
|
+
return await t.post(pt, n), e;
|
|
4919
4946
|
} catch (a) {
|
|
4920
4947
|
throw console.error("Error updating LLM settings:", a), a;
|
|
4921
4948
|
}
|
|
4922
4949
|
}
|
|
4923
4950
|
export {
|
|
4924
4951
|
be as DATA_SOURCES_API_URL_PATH,
|
|
4925
|
-
|
|
4926
|
-
|
|
4927
|
-
|
|
4928
|
-
|
|
4929
|
-
|
|
4930
|
-
|
|
4931
|
-
|
|
4932
|
-
|
|
4933
|
-
|
|
4934
|
-
|
|
4935
|
-
|
|
4936
|
-
|
|
4937
|
-
|
|
4938
|
-
|
|
4939
|
-
|
|
4940
|
-
|
|
4941
|
-
|
|
4942
|
-
|
|
4943
|
-
|
|
4944
|
-
|
|
4945
|
-
|
|
4952
|
+
Mr as TOOL_CONTEXT_MAX_ASSETS,
|
|
4953
|
+
jr as TOOL_NAME_CHART_BUILDER,
|
|
4954
|
+
No as TOOL_NAME_DASHBOARD_BUILDER,
|
|
4955
|
+
Zo as TOOL_NAME_DATA_MODEL_BUILDER,
|
|
4956
|
+
Lo as TOOL_NAME_GET_DASHBOARDS,
|
|
4957
|
+
kr as TOOL_NAME_GET_DATA_SOURCES,
|
|
4958
|
+
Er as TOOL_NAME_GET_DATA_SOURCE_FIELDS,
|
|
4959
|
+
Io as TOOL_NAME_RECOMMEND_QUERIES,
|
|
4960
|
+
oi as addDataSet,
|
|
4961
|
+
li as addRelation,
|
|
4962
|
+
Vr as addWidgetToFusionDashboard,
|
|
4963
|
+
fo as addWidgetsToDashboard,
|
|
4964
|
+
yo as addWidgetsToExistingDashboard,
|
|
4965
|
+
Qr as addWidgetsToFusionDashboard,
|
|
4966
|
+
ao as adjustSingleColumnWidth,
|
|
4967
|
+
On as axesMapping,
|
|
4968
|
+
Ro as buildChartEngine,
|
|
4969
|
+
Ao as buildChartSchema,
|
|
4970
|
+
ii as buildElasticube,
|
|
4971
|
+
si as buildStatus,
|
|
4972
|
+
ti as changeDashboard,
|
|
4946
4973
|
J as chartDataOptionsSchemas,
|
|
4947
|
-
|
|
4948
|
-
|
|
4974
|
+
Dn as chartIdSchema,
|
|
4975
|
+
_n as chartRecommendationsSchema,
|
|
4949
4976
|
ee as chartType,
|
|
4950
|
-
|
|
4951
|
-
|
|
4952
|
-
|
|
4953
|
-
|
|
4954
|
-
|
|
4955
|
-
|
|
4956
|
-
|
|
4977
|
+
oo as cleanupDashboardAfterChange,
|
|
4978
|
+
no as cleanupOrphanedCells,
|
|
4979
|
+
Pn as createChartSchema,
|
|
4980
|
+
Aa as createCustomFetch,
|
|
4981
|
+
ni as createElasticube,
|
|
4982
|
+
go as createEmptyDashboard,
|
|
4983
|
+
$e as createEmptyFusionDashboard,
|
|
4957
4984
|
Ye as createHttpClientFromAuthenticator,
|
|
4958
|
-
|
|
4959
|
-
|
|
4985
|
+
Pa as createHttpClientFromConfig,
|
|
4986
|
+
ei as createNewDashboard,
|
|
4960
4987
|
Ge as createOpenAIClient,
|
|
4961
|
-
|
|
4988
|
+
Ta as createOpenAIClientHelper,
|
|
4962
4989
|
ge as createStructuredCompletion,
|
|
4963
4990
|
$a as createToolsCompletion,
|
|
4964
4991
|
S as dataOptionsEditingSchemas,
|
|
4965
|
-
|
|
4966
|
-
|
|
4967
|
-
|
|
4968
|
-
|
|
4969
|
-
|
|
4992
|
+
di as deleteElasticube,
|
|
4993
|
+
Ho as deleteFusionDashboard,
|
|
4994
|
+
dt as deleteWidgetsFromDashboard,
|
|
4995
|
+
un as excludeSchemaProperties,
|
|
4996
|
+
to as extractWidgetIdsFromLayout,
|
|
4970
4997
|
re as filterSchemaProperties,
|
|
4971
|
-
|
|
4972
|
-
|
|
4973
|
-
|
|
4974
|
-
|
|
4975
|
-
|
|
4976
|
-
|
|
4977
|
-
|
|
4998
|
+
ro as findOutOfPlaceWidgets,
|
|
4999
|
+
Ra as generateChart,
|
|
5000
|
+
Vo as getAvailableFusionDashboards,
|
|
5001
|
+
Nr as getBaseChartSummary,
|
|
5002
|
+
mo as getBaseDashboardConfig,
|
|
5003
|
+
ai as getCSVSchemaDetails,
|
|
5004
|
+
Qo as getDashboardDataSourcesMap,
|
|
4978
5005
|
ct as getDataSourceByTitle,
|
|
4979
|
-
|
|
4980
|
-
|
|
4981
|
-
|
|
4982
|
-
|
|
4983
|
-
|
|
4984
|
-
|
|
4985
|
-
|
|
4986
|
-
|
|
4987
|
-
|
|
4988
|
-
|
|
4989
|
-
|
|
5006
|
+
Ur as getDataSourceFields,
|
|
5007
|
+
Fo as getDataSourceFieldsEngine,
|
|
5008
|
+
qo as getDataSourceFieldsSchema,
|
|
5009
|
+
ut as getDataSourceFieldsWithDescriptions,
|
|
5010
|
+
Rr as getDataSourceSchema,
|
|
5011
|
+
Br as getDataSources,
|
|
5012
|
+
Bo as getDataSourcesEngine,
|
|
5013
|
+
Uo as getDataSourcesSchema,
|
|
5014
|
+
ui as getElasticube,
|
|
5015
|
+
ci as getElasticubes,
|
|
5016
|
+
Hr as getFusionDashboardModel,
|
|
5017
|
+
Gr as getFusionDashboardProps,
|
|
5018
|
+
Wo as getFusionDashboardUrl,
|
|
5019
|
+
Wr as getFusionDashboardWidgets,
|
|
5020
|
+
qr as getFusionDashboards,
|
|
4990
5021
|
f as getHttpClient,
|
|
4991
|
-
|
|
4992
|
-
|
|
4993
|
-
|
|
4994
|
-
|
|
5022
|
+
hi as getLlmSettings,
|
|
5023
|
+
ko as getNlqResult,
|
|
5024
|
+
Ma as getNlqResultLight,
|
|
5025
|
+
Na as getNlqV3Result,
|
|
4995
5026
|
zo as getNormalizedDataSourceFields,
|
|
4996
5027
|
Ke as getOpenAIClient,
|
|
4997
|
-
|
|
4998
|
-
|
|
4999
|
-
|
|
5000
|
-
|
|
5028
|
+
ri as getPerspectiveOid,
|
|
5029
|
+
Eo as getQueryRecommendations,
|
|
5030
|
+
Mo as getQueryRecommendationsLight,
|
|
5031
|
+
jo as initializeClients,
|
|
5001
5032
|
Qe as initializeHttpClient,
|
|
5002
5033
|
Xe as initializeOpenAIClient,
|
|
5003
|
-
|
|
5034
|
+
Yo as isDashboardSaved,
|
|
5004
5035
|
je as layoutDashboardWidgets,
|
|
5005
|
-
|
|
5006
|
-
|
|
5036
|
+
Jo as loadExistingDashboardFromFusion,
|
|
5037
|
+
mi as loadGlobals,
|
|
5007
5038
|
me as nanoidHex,
|
|
5008
5039
|
le as nanoidUUIDv4,
|
|
5009
|
-
|
|
5040
|
+
Fr as normalizeFields,
|
|
5010
5041
|
he as normalizeUrl,
|
|
5011
|
-
|
|
5012
|
-
|
|
5042
|
+
Cn as nullableChartType,
|
|
5043
|
+
xo as parseError,
|
|
5013
5044
|
pe as patchFusionDashboard,
|
|
5014
|
-
|
|
5015
|
-
|
|
5016
|
-
|
|
5017
|
-
|
|
5045
|
+
Go as persistDashboardToFusion,
|
|
5046
|
+
To as resetHttpClient,
|
|
5047
|
+
$o as resetOpenAIClient,
|
|
5048
|
+
Xo as resetWidgetForDashboard,
|
|
5018
5049
|
L as updateChartSchema,
|
|
5019
5050
|
$n as updateChartSortingSchema,
|
|
5020
|
-
|
|
5021
|
-
|
|
5022
|
-
|
|
5023
|
-
|
|
5024
|
-
|
|
5025
|
-
|
|
5026
|
-
|
|
5027
|
-
|
|
5028
|
-
|
|
5029
|
-
|
|
5030
|
-
|
|
5031
|
-
|
|
5032
|
-
|
|
5051
|
+
En as updateChartStyleOptionsSchema,
|
|
5052
|
+
An as updateChartTitleSchema,
|
|
5053
|
+
Tn as updateChartTypeOfMeasuresSchema,
|
|
5054
|
+
xn as updateChartTypeSchema,
|
|
5055
|
+
Ko as updateDashboardTitle,
|
|
5056
|
+
bo as updateDashboardWidgetsLayout,
|
|
5057
|
+
Xr as updateFusionDashboardFilters,
|
|
5058
|
+
gi as updateLlmSettings,
|
|
5059
|
+
kn as updateOtherChartDataOptionsSchema,
|
|
5060
|
+
jn as updateTrendAndForecastSchema,
|
|
5061
|
+
pi as uploadCSVMultipart,
|
|
5062
|
+
po as withWidgetAdded,
|
|
5063
|
+
dn as zodFunction,
|
|
5033
5064
|
P as zodToReadableType
|
|
5034
5065
|
};
|
|
5035
5066
|
//# sourceMappingURL=index.js.map
|