react-semaphor 0.1.428 → 0.1.430
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/analytics-protocol/index.cjs +1 -1
- package/dist/analytics-protocol/index.js +72 -71
- package/dist/brand-studio/index.cjs +1 -1
- package/dist/brand-studio/index.js +5 -4
- package/dist/briefings/index.cjs +1 -1
- package/dist/briefings/index.js +1031 -622
- package/dist/chunks/analyze-result-contract-BswhsmWT.js +1 -0
- package/dist/chunks/{analyze-result-contract-DnfF8kBb.js → analyze-result-contract-CfOBEwaC.js} +681 -759
- package/dist/chunks/{code-editor-CojfM3qp.js → code-editor-C65eEYyU.js} +2980 -2960
- package/dist/chunks/code-editor-DOh3aYEh.js +138 -0
- package/dist/chunks/{comparison-document-migration-b6c3xiWh.js → comparison-document-migration-DbU_BTxR.js} +1 -1
- package/dist/chunks/{comparison-document-migration-BJH1idOd.js → comparison-document-migration-Dj6xZMCb.js} +2 -2
- package/dist/chunks/csv-utils-Co0WxHke.js +4 -0
- package/dist/chunks/csv-utils-suxSkJGj.js +376 -0
- package/dist/chunks/{dashboard-509sbC4_.js → dashboard-0Tpj3XFq.js} +49934 -47167
- package/dist/chunks/dashboard-CVDy3fbO.js +1402 -0
- package/dist/chunks/{dashboard-briefing-launcher-B-ZTWJwo.js → dashboard-briefing-launcher-DLQqwXMF.js} +1 -1
- package/dist/chunks/{dashboard-briefing-launcher-DIdYHNTq.js → dashboard-briefing-launcher-pkNPk_4j.js} +100 -99
- package/dist/chunks/{dashboard-controls-CbRzWo1N.js → dashboard-controls-CIN4biYx.js} +114 -113
- package/dist/chunks/{dashboard-controls-CWprw-Pb.js → dashboard-controls-DbW9Jt_P.js} +2 -2
- package/dist/chunks/dashboard-json-BDKT0Z-m.js +1 -0
- package/dist/chunks/{dashboard-json-jO4GQfZk.js → dashboard-json-DBfR770k.js} +18 -17
- package/dist/chunks/edit-dashboard-visual-BjAp_UpK.js +182 -0
- package/dist/chunks/{edit-dashboard-visual-KgQTjqWp.js → edit-dashboard-visual-qkvRHS8Q.js} +8721 -8481
- package/dist/chunks/{metric-comparison-CWweq9RG.js → metric-comparison-CPoDx56y.js} +1 -1
- package/dist/chunks/{metric-comparison-BKgkMy9r.js → metric-comparison-DVy3fll_.js} +1 -1
- package/dist/chunks/numeric-presentation-CGTcqocU.js +517 -0
- package/dist/chunks/numeric-presentation-Dlb-Dk4c.js +1 -0
- package/dist/chunks/report-preferences-dialog-Bx8uzG8K.js +690 -0
- package/dist/chunks/report-preferences-dialog-LCHeqh7t.js +1 -0
- package/dist/chunks/source-identity-5OPV4gvg.js +92 -0
- package/dist/chunks/source-identity-Cbo2LOHQ.js +1 -0
- package/dist/chunks/{update-policy-CY2k-pJP.js → update-policy-De2NswtM.js} +1 -1
- package/dist/chunks/{update-policy-BgONreNd.js → update-policy-DnF_74zC.js} +1 -1
- package/dist/chunks/{use-create-flow-overlay-state-BiMYdjZP.js → use-create-flow-overlay-state-C-CxrQ48.js} +1 -1
- package/dist/chunks/{use-create-flow-overlay-state-CGsLzp9A.js → use-create-flow-overlay-state-C-j8E5IZ.js} +97 -96
- package/dist/chunks/validators-B2vUAqTf.js +1 -0
- package/dist/chunks/{validators-Cz-XuORM.js → validators-Bce_J7Vd.js} +19 -13
- package/dist/dashboard/index.cjs +1 -1
- package/dist/dashboard/index.js +1 -1
- package/dist/dashboard-authoring/index.cjs +3 -3
- package/dist/dashboard-authoring/index.js +20 -19
- package/dist/data-app-builder/index.cjs +1 -1
- package/dist/data-app-builder/index.js +50 -50
- package/dist/data-app-codegen/index.cjs +1 -1
- package/dist/data-app-codegen/index.js +2 -2
- package/dist/data-app-codegen-node/index.cjs +1 -1
- package/dist/data-app-codegen-node/index.js +3 -3
- package/dist/data-app-sdk/index.cjs +2 -2
- package/dist/data-app-sdk/index.js +27 -26
- package/dist/data-app-sdk-adapters/index.cjs +1 -1
- package/dist/data-app-sdk-adapters/index.js +25 -24
- package/dist/data-app-sdk-validation/index.cjs +1 -1
- package/dist/data-app-sdk-validation/index.js +57 -55
- package/dist/format-utils/index.cjs +2 -5
- package/dist/format-utils/index.js +136 -161
- package/dist/index.cjs +1 -1
- package/dist/index.js +158 -155
- package/dist/report-runtime-context/index.cjs +1 -0
- package/dist/report-runtime-context/index.js +394 -0
- package/dist/style.css +1 -1
- package/dist/surfboard/index.cjs +1 -1
- package/dist/surfboard/index.js +7 -6
- package/dist/types/analytics-protocol.d.ts +0 -4
- package/dist/types/briefings.d.ts +216 -19
- package/dist/types/dashboard-assistant.d.ts +0 -2
- package/dist/types/dashboard-authoring.d.ts +34 -9
- package/dist/types/dashboard.d.ts +93 -9
- package/dist/types/data-app-builder.d.ts +0 -1
- package/dist/types/data-app-codegen-node.d.ts +6 -28
- package/dist/types/data-app-codegen.d.ts +6 -28
- package/dist/types/data-app-sdk-adapters.d.ts +6 -28
- package/dist/types/data-app-sdk-validation.d.ts +6 -29
- package/dist/types/data-app-sdk.d.ts +6 -31
- package/dist/types/format-utils.d.ts +128 -4
- package/dist/types/index.cjs +1 -1
- package/dist/types/index.js +10 -13
- package/dist/types/main.d.ts +249 -89
- package/dist/types/report-runtime-context.d.ts +99 -0
- package/dist/types/shared.d.ts +34 -9
- package/dist/types/surfboard.d.ts +119 -16
- package/dist/types/types.d.ts +156 -73
- package/dist/types/value-format-preferences.d.ts +126 -0
- package/dist/value-format-preferences/index.cjs +1 -0
- package/dist/value-format-preferences/index.js +635 -0
- package/package.json +11 -1
- package/dist/chunks/analyze-result-contract-ege_u6Nl.js +0 -1
- package/dist/chunks/calendar-preferences-dialog-BF9bNAF_.js +0 -457
- package/dist/chunks/calendar-preferences-dialog-_L9eBQfj.js +0 -1
- package/dist/chunks/code-editor-BoowcKU0.js +0 -138
- package/dist/chunks/dashboard-CMDXBLnG.js +0 -1402
- package/dist/chunks/dashboard-json-BEZrxx_k.js +0 -1
- package/dist/chunks/date-formatter-BTTYdAik.js +0 -1
- package/dist/chunks/date-formatter-D-89jTjG.js +0 -514
- package/dist/chunks/edit-dashboard-visual-D3uhqgm3.js +0 -182
- package/dist/chunks/validators-B4VMLX3_.js +0 -1
package/dist/briefings/index.js
CHANGED
|
@@ -1,8 +1,235 @@
|
|
|
1
|
-
var
|
|
2
|
-
var
|
|
3
|
-
var
|
|
4
|
-
import {
|
|
5
|
-
|
|
1
|
+
var le = Object.defineProperty;
|
|
2
|
+
var de = (t, n, e) => n in t ? le(t, n, { enumerable: !0, configurable: !0, writable: !0, value: e }) : t[n] = e;
|
|
3
|
+
var H = (t, n, e) => de(t, typeof n != "symbol" ? n + "" : n, e);
|
|
4
|
+
import { d as me, j as W } from "../chunks/numeric-presentation-CGTcqocU.js";
|
|
5
|
+
import { parseReportRuntimeContext as se } from "../report-runtime-context/index.js";
|
|
6
|
+
import { i as fe } from "../chunks/card-config-utils-BYZ5MJOh.js";
|
|
7
|
+
function pe(t) {
|
|
8
|
+
return !!t && typeof t == "object" && !Array.isArray(t);
|
|
9
|
+
}
|
|
10
|
+
function E(t, n, e) {
|
|
11
|
+
return pe(t) ? t : (e.push({ field: n, message: "Expected an object." }), {});
|
|
12
|
+
}
|
|
13
|
+
function C(t, n, e, r) {
|
|
14
|
+
const o = new Set(e);
|
|
15
|
+
Object.keys(t).forEach((a) => {
|
|
16
|
+
o.has(a) || r.push({
|
|
17
|
+
field: `${n}.${a}`,
|
|
18
|
+
message: "Unexpected property."
|
|
19
|
+
});
|
|
20
|
+
});
|
|
21
|
+
}
|
|
22
|
+
function T(t, n, e, r, o = {}) {
|
|
23
|
+
if (t == null)
|
|
24
|
+
return;
|
|
25
|
+
if (typeof t != "string") {
|
|
26
|
+
r.push({ field: n, message: "Expected a string." });
|
|
27
|
+
return;
|
|
28
|
+
}
|
|
29
|
+
const a = o.trim === !1 ? t : t.trim();
|
|
30
|
+
if (!o.allowEmpty && a.length === 0) {
|
|
31
|
+
r.push({ field: n, message: "Expected a non-empty string." });
|
|
32
|
+
return;
|
|
33
|
+
}
|
|
34
|
+
if (a.length > e) {
|
|
35
|
+
r.push({
|
|
36
|
+
field: n,
|
|
37
|
+
message: `Expected ${e} characters or fewer.`
|
|
38
|
+
});
|
|
39
|
+
return;
|
|
40
|
+
}
|
|
41
|
+
return a;
|
|
42
|
+
}
|
|
43
|
+
function L(t, n, e) {
|
|
44
|
+
const r = T(t, n, 2e3, e);
|
|
45
|
+
if (r)
|
|
46
|
+
try {
|
|
47
|
+
return new URL(r), r;
|
|
48
|
+
} catch {
|
|
49
|
+
e.push({ field: n, message: "Expected an absolute URL." });
|
|
50
|
+
return;
|
|
51
|
+
}
|
|
52
|
+
}
|
|
53
|
+
function G(t, n, e) {
|
|
54
|
+
const r = E(t, n, e);
|
|
55
|
+
C(r, n, ["tokens", "components"], e);
|
|
56
|
+
const o = {};
|
|
57
|
+
if (r.tokens !== void 0) {
|
|
58
|
+
const a = E(r.tokens, `${n}.tokens`, e);
|
|
59
|
+
C(
|
|
60
|
+
a,
|
|
61
|
+
`${n}.tokens`,
|
|
62
|
+
["color", "typography"],
|
|
63
|
+
e
|
|
64
|
+
);
|
|
65
|
+
const i = {};
|
|
66
|
+
if (a.color !== void 0) {
|
|
67
|
+
const c = E(
|
|
68
|
+
a.color,
|
|
69
|
+
`${n}.tokens.color`,
|
|
70
|
+
e
|
|
71
|
+
), d = [
|
|
72
|
+
"background",
|
|
73
|
+
"foreground",
|
|
74
|
+
"muted",
|
|
75
|
+
"mutedForeground",
|
|
76
|
+
"border",
|
|
77
|
+
"primary",
|
|
78
|
+
"primaryForeground",
|
|
79
|
+
"positive",
|
|
80
|
+
"negative",
|
|
81
|
+
"warning",
|
|
82
|
+
"info"
|
|
83
|
+
];
|
|
84
|
+
C(c, `${n}.tokens.color`, d, e);
|
|
85
|
+
const m = {};
|
|
86
|
+
d.forEach((p) => {
|
|
87
|
+
const v = T(
|
|
88
|
+
c[p],
|
|
89
|
+
`${n}.tokens.color.${p}`,
|
|
90
|
+
120,
|
|
91
|
+
e
|
|
92
|
+
);
|
|
93
|
+
v !== void 0 && (m[p] = v);
|
|
94
|
+
}), i.color = m;
|
|
95
|
+
}
|
|
96
|
+
if (a.typography !== void 0) {
|
|
97
|
+
const c = E(
|
|
98
|
+
a.typography,
|
|
99
|
+
`${n}.tokens.typography`,
|
|
100
|
+
e
|
|
101
|
+
);
|
|
102
|
+
C(
|
|
103
|
+
c,
|
|
104
|
+
`${n}.tokens.typography`,
|
|
105
|
+
["fontFamily", "monoFontFamily"],
|
|
106
|
+
e
|
|
107
|
+
);
|
|
108
|
+
const d = T(
|
|
109
|
+
c.fontFamily,
|
|
110
|
+
`${n}.tokens.typography.fontFamily`,
|
|
111
|
+
500,
|
|
112
|
+
e,
|
|
113
|
+
{ allowEmpty: !0 }
|
|
114
|
+
), m = T(
|
|
115
|
+
c.monoFontFamily,
|
|
116
|
+
`${n}.tokens.typography.monoFontFamily`,
|
|
117
|
+
500,
|
|
118
|
+
e,
|
|
119
|
+
{ allowEmpty: !0 }
|
|
120
|
+
);
|
|
121
|
+
i.typography = {
|
|
122
|
+
...d !== void 0 ? { fontFamily: d } : {},
|
|
123
|
+
...m !== void 0 ? { monoFontFamily: m } : {}
|
|
124
|
+
};
|
|
125
|
+
}
|
|
126
|
+
o.tokens = i;
|
|
127
|
+
}
|
|
128
|
+
if (r.components !== void 0) {
|
|
129
|
+
const a = E(
|
|
130
|
+
r.components,
|
|
131
|
+
`${n}.components`,
|
|
132
|
+
e
|
|
133
|
+
);
|
|
134
|
+
if (C(a, `${n}.components`, ["chart"], e), a.chart !== void 0) {
|
|
135
|
+
const i = E(
|
|
136
|
+
a.chart,
|
|
137
|
+
`${n}.components.chart`,
|
|
138
|
+
e
|
|
139
|
+
);
|
|
140
|
+
C(i, `${n}.components.chart`, ["palette"], e);
|
|
141
|
+
let c;
|
|
142
|
+
i.palette !== void 0 && (Array.isArray(i.palette) ? i.palette.length > 20 ? e.push({
|
|
143
|
+
field: `${n}.components.chart.palette`,
|
|
144
|
+
message: "Expected 20 colors or fewer."
|
|
145
|
+
}) : c = i.palette.map(
|
|
146
|
+
(d, m) => T(
|
|
147
|
+
d,
|
|
148
|
+
`${n}.components.chart.palette.${m}`,
|
|
149
|
+
120,
|
|
150
|
+
e
|
|
151
|
+
)
|
|
152
|
+
).filter((d) => d !== void 0) : e.push({
|
|
153
|
+
field: `${n}.components.chart.palette`,
|
|
154
|
+
message: "Expected an array."
|
|
155
|
+
})), o.components = {
|
|
156
|
+
chart: c ? { palette: c } : {}
|
|
157
|
+
};
|
|
158
|
+
}
|
|
159
|
+
}
|
|
160
|
+
return o;
|
|
161
|
+
}
|
|
162
|
+
function ue(t, n) {
|
|
163
|
+
const e = "presentation.appearance", r = E(t, e, n);
|
|
164
|
+
C(r, e, ["version", "schemes"], n);
|
|
165
|
+
const o = {};
|
|
166
|
+
if (r.version !== void 0 && (typeof r.version != "number" || !Number.isFinite(r.version) ? n.push({ field: `${e}.version`, message: "Expected a number." }) : o.version = r.version), r.schemes !== void 0) {
|
|
167
|
+
const a = E(r.schemes, `${e}.schemes`, n);
|
|
168
|
+
C(a, `${e}.schemes`, ["light", "dark"], n), o.schemes = {
|
|
169
|
+
...a.light !== void 0 ? {
|
|
170
|
+
light: G(
|
|
171
|
+
a.light,
|
|
172
|
+
`${e}.schemes.light`,
|
|
173
|
+
n
|
|
174
|
+
)
|
|
175
|
+
} : {},
|
|
176
|
+
...a.dark !== void 0 ? {
|
|
177
|
+
dark: G(
|
|
178
|
+
a.dark,
|
|
179
|
+
`${e}.schemes.dark`,
|
|
180
|
+
n
|
|
181
|
+
)
|
|
182
|
+
} : {}
|
|
183
|
+
};
|
|
184
|
+
}
|
|
185
|
+
return o;
|
|
186
|
+
}
|
|
187
|
+
function he(t, n) {
|
|
188
|
+
const e = "presentation.brandOverrides", r = E(t, e, n);
|
|
189
|
+
C(r, e, ["brandName", "logoUrl", "link"], n);
|
|
190
|
+
const o = T(
|
|
191
|
+
r.brandName,
|
|
192
|
+
`${e}.brandName`,
|
|
193
|
+
200,
|
|
194
|
+
n
|
|
195
|
+
), a = L(r.logoUrl, `${e}.logoUrl`, n), i = T(r.link, `${e}.link`, 120, n);
|
|
196
|
+
return {
|
|
197
|
+
...o !== void 0 ? { brandName: o } : {},
|
|
198
|
+
...a !== void 0 ? { logoUrl: a } : {},
|
|
199
|
+
...i !== void 0 ? { link: i } : {}
|
|
200
|
+
};
|
|
201
|
+
}
|
|
202
|
+
function ye(t, n) {
|
|
203
|
+
const e = "presentation.fragments", r = E(t, e, n), o = [
|
|
204
|
+
"preHeaderText",
|
|
205
|
+
"headerBannerHtml",
|
|
206
|
+
"signatureHtml",
|
|
207
|
+
"footerHtml",
|
|
208
|
+
"disclaimerHtml",
|
|
209
|
+
"unsubscribeUrl"
|
|
210
|
+
];
|
|
211
|
+
C(r, e, o, n);
|
|
212
|
+
const a = {};
|
|
213
|
+
return o.forEach((i) => {
|
|
214
|
+
const c = i === "unsubscribeUrl" ? L(r[i], `${e}.${i}`, n) : T(
|
|
215
|
+
r[i],
|
|
216
|
+
`${e}.${i}`,
|
|
217
|
+
i === "preHeaderText" ? 200 : 5e3,
|
|
218
|
+
n,
|
|
219
|
+
{ trim: i === "preHeaderText" }
|
|
220
|
+
);
|
|
221
|
+
c !== void 0 && (a[i] = c);
|
|
222
|
+
}), a;
|
|
223
|
+
}
|
|
224
|
+
function ge(t) {
|
|
225
|
+
const n = [], e = {};
|
|
226
|
+
if (t.appearance !== void 0 && (e.appearance = ue(t.appearance, n)), t.brandOverrides !== void 0 && (e.brandOverrides = he(t.brandOverrides, n)), t.fragments !== void 0 && (e.fragments = ye(t.fragments, n)), t.viewUrl !== void 0) {
|
|
227
|
+
const r = L(t.viewUrl, "presentation.viewUrl", n);
|
|
228
|
+
r !== void 0 && (e.viewUrl = r);
|
|
229
|
+
}
|
|
230
|
+
return { value: e, issues: n };
|
|
231
|
+
}
|
|
232
|
+
const Z = [
|
|
6
233
|
"SUN",
|
|
7
234
|
"MON",
|
|
8
235
|
"TUE",
|
|
@@ -10,15 +237,15 @@ const P = [
|
|
|
10
237
|
"THU",
|
|
11
238
|
"FRI",
|
|
12
239
|
"SAT"
|
|
13
|
-
],
|
|
14
|
-
|
|
15
|
-
),
|
|
240
|
+
], ve = new Map(
|
|
241
|
+
Z.map((t, n) => [t, n])
|
|
242
|
+
), bt = {
|
|
16
243
|
cadence: "weekly",
|
|
17
244
|
hour: 9,
|
|
18
245
|
minute: 0,
|
|
19
246
|
weekdays: [1]
|
|
20
247
|
};
|
|
21
|
-
function
|
|
248
|
+
function $t(t) {
|
|
22
249
|
if (typeof t != "string" || t.length === 0 || t !== t.trim() || /^(?:(?:UTC|GMT)[+-]|[+-]\d{2}:\d{2}$)/.test(t))
|
|
23
250
|
return !1;
|
|
24
251
|
try {
|
|
@@ -27,27 +254,27 @@ function Qe(t) {
|
|
|
27
254
|
return !1;
|
|
28
255
|
}
|
|
29
256
|
}
|
|
30
|
-
function
|
|
257
|
+
function be(t) {
|
|
31
258
|
return Number.isInteger(t.minute) && t.minute >= 0 && t.minute <= 59 && Number.isInteger(t.hour) && t.hour >= 0 && t.hour <= 23;
|
|
32
259
|
}
|
|
33
|
-
function
|
|
260
|
+
function Y(t) {
|
|
34
261
|
if (t.length === 0) return null;
|
|
35
262
|
const n = [...t].sort((e, r) => e - r);
|
|
36
263
|
return n.some(
|
|
37
264
|
(e, r) => !Number.isInteger(e) || e < 0 || e > 6 || r > 0 && e === n[r - 1]
|
|
38
265
|
) ? null : n;
|
|
39
266
|
}
|
|
40
|
-
function
|
|
41
|
-
if (!
|
|
267
|
+
function It(t) {
|
|
268
|
+
if (!be(t))
|
|
42
269
|
throw new Error("Choose a valid schedule time.");
|
|
43
270
|
const n = `${t.minute} ${t.hour}`;
|
|
44
271
|
switch (t.cadence) {
|
|
45
272
|
case "daily":
|
|
46
273
|
return `${n} * * *`;
|
|
47
274
|
case "weekly": {
|
|
48
|
-
const e =
|
|
275
|
+
const e = Y(t.weekdays);
|
|
49
276
|
if (!e) throw new Error("Choose at least one weekday.");
|
|
50
|
-
return `${n} * * ${e.map((r) =>
|
|
277
|
+
return `${n} * * ${e.map((r) => Z[r]).join(",")}`;
|
|
51
278
|
}
|
|
52
279
|
case "twice_monthly":
|
|
53
280
|
return `${n} 1,15 * *`;
|
|
@@ -55,7 +282,7 @@ function et(t) {
|
|
|
55
282
|
return `${n} 1 * *`;
|
|
56
283
|
}
|
|
57
284
|
}
|
|
58
|
-
function
|
|
285
|
+
function $e(t) {
|
|
59
286
|
if (typeof t != "string" || t.length === 0)
|
|
60
287
|
return { ok: !1, issue: "Choose a supported schedule." };
|
|
61
288
|
if (t !== t.trim() || t.includes(" "))
|
|
@@ -63,43 +290,43 @@ function oe(t) {
|
|
|
63
290
|
const n = t.split(" ");
|
|
64
291
|
if (n.length !== 5)
|
|
65
292
|
return { ok: !1, issue: "Choose a supported schedule." };
|
|
66
|
-
const [e, r, o,
|
|
293
|
+
const [e, r, o, a, i] = n;
|
|
67
294
|
if (!/^(0|[1-9]\d?)$/.test(e) || !/^(0|[1-9]\d?)$/.test(r))
|
|
68
295
|
return { ok: !1, issue: "Choose a supported schedule." };
|
|
69
|
-
const
|
|
70
|
-
if (
|
|
296
|
+
const c = Number(e), d = Number(r);
|
|
297
|
+
if (c > 59 || d > 23 || a !== "*")
|
|
71
298
|
return { ok: !1, issue: "Choose a supported schedule." };
|
|
72
|
-
if (o === "*" &&
|
|
299
|
+
if (o === "*" && i === "*")
|
|
73
300
|
return {
|
|
74
301
|
ok: !0,
|
|
75
|
-
value: { cadence: "daily", hour:
|
|
302
|
+
value: { cadence: "daily", hour: d, minute: c, weekdays: [] }
|
|
76
303
|
};
|
|
77
|
-
if (o === "*" &&
|
|
78
|
-
const
|
|
79
|
-
if (
|
|
304
|
+
if (o === "*" && i !== "*") {
|
|
305
|
+
const p = i.split(",").map((y) => ve.get(y));
|
|
306
|
+
if (p.some((y) => y === void 0))
|
|
80
307
|
return { ok: !1, issue: "Choose a supported schedule." };
|
|
81
|
-
const
|
|
82
|
-
return !
|
|
308
|
+
const v = p, b = Y(v);
|
|
309
|
+
return !b || b.some((y, S) => y !== v[S]) ? { ok: !1, issue: "Choose a supported schedule." } : {
|
|
83
310
|
ok: !0,
|
|
84
|
-
value: { cadence: "weekly", hour:
|
|
311
|
+
value: { cadence: "weekly", hour: d, minute: c, weekdays: b }
|
|
85
312
|
};
|
|
86
313
|
}
|
|
87
|
-
return o === "1,15" &&
|
|
314
|
+
return o === "1,15" && i === "*" ? {
|
|
88
315
|
ok: !0,
|
|
89
|
-
value: { cadence: "twice_monthly", hour:
|
|
90
|
-
} : o === "1" &&
|
|
316
|
+
value: { cadence: "twice_monthly", hour: d, minute: c, weekdays: [] }
|
|
317
|
+
} : o === "1" && i === "*" ? {
|
|
91
318
|
ok: !0,
|
|
92
|
-
value: { cadence: "monthly", hour:
|
|
319
|
+
value: { cadence: "monthly", hour: d, minute: c, weekdays: [] }
|
|
93
320
|
} : { ok: !1, issue: "Choose a supported schedule." };
|
|
94
321
|
}
|
|
95
|
-
function
|
|
322
|
+
function Ie(t, n, e) {
|
|
96
323
|
return new Intl.DateTimeFormat(e, {
|
|
97
324
|
hour: "numeric",
|
|
98
325
|
minute: "2-digit",
|
|
99
326
|
timeZone: "UTC"
|
|
100
327
|
}).format(new Date(Date.UTC(2020, 0, 1, t, n)));
|
|
101
328
|
}
|
|
102
|
-
function
|
|
329
|
+
function Ee(t, n) {
|
|
103
330
|
var e;
|
|
104
331
|
if (t === "UTC") return "UTC";
|
|
105
332
|
try {
|
|
@@ -111,39 +338,39 @@ function ae(t, n) {
|
|
|
111
338
|
return null;
|
|
112
339
|
}
|
|
113
340
|
}
|
|
114
|
-
function
|
|
115
|
-
const r =
|
|
341
|
+
function Et(t, n, e = "en-US") {
|
|
342
|
+
const r = $e(t);
|
|
116
343
|
if (!r.ok) return null;
|
|
117
344
|
try {
|
|
118
|
-
const o =
|
|
119
|
-
if (!
|
|
345
|
+
const o = Ie(r.value.hour, r.value.minute, e), a = Ee(n, e);
|
|
346
|
+
if (!a) return null;
|
|
120
347
|
switch (r.value.cadence) {
|
|
121
348
|
case "daily":
|
|
122
|
-
return `Daily at ${o} ${
|
|
349
|
+
return `Daily at ${o} ${a}`;
|
|
123
350
|
case "weekly": {
|
|
124
|
-
const
|
|
351
|
+
const i = new Intl.DateTimeFormat(e, {
|
|
125
352
|
weekday: "long",
|
|
126
353
|
timeZone: "UTC"
|
|
127
354
|
});
|
|
128
355
|
return `${r.value.weekdays.map(
|
|
129
|
-
(
|
|
130
|
-
).join(" and ")} at ${o} ${
|
|
356
|
+
(d) => i.format(new Date(Date.UTC(2023, 0, 1 + d)))
|
|
357
|
+
).join(" and ")} at ${o} ${a}`;
|
|
131
358
|
}
|
|
132
359
|
case "twice_monthly":
|
|
133
|
-
return `On the 1st and 15th at ${o} ${
|
|
360
|
+
return `On the 1st and 15th at ${o} ${a}`;
|
|
134
361
|
case "monthly":
|
|
135
|
-
return `Monthly on the 1st at ${o} ${
|
|
362
|
+
return `Monthly on the 1st at ${o} ${a}`;
|
|
136
363
|
}
|
|
137
364
|
} catch {
|
|
138
365
|
return null;
|
|
139
366
|
}
|
|
140
367
|
}
|
|
141
|
-
const
|
|
368
|
+
const Ce = /* @__PURE__ */ new Set([
|
|
142
369
|
"table",
|
|
143
370
|
"aggregateTable",
|
|
144
371
|
"pivotTable",
|
|
145
372
|
"detailTable"
|
|
146
|
-
]),
|
|
373
|
+
]), ke = /* @__PURE__ */ new Set([
|
|
147
374
|
"bar",
|
|
148
375
|
"horizontalBar",
|
|
149
376
|
"line",
|
|
@@ -174,51 +401,51 @@ const ce = /* @__PURE__ */ new Set([
|
|
|
174
401
|
"treemap",
|
|
175
402
|
"custom"
|
|
176
403
|
]);
|
|
177
|
-
function
|
|
178
|
-
var r, o,
|
|
179
|
-
const n =
|
|
180
|
-
return t.type === "text" || !n ||
|
|
181
|
-
formats:
|
|
404
|
+
function Ct(t) {
|
|
405
|
+
var r, o, a;
|
|
406
|
+
const n = ke.has(t.type) && (t.type !== "custom" || !!((r = t.customCardPreferences) != null && r.url));
|
|
407
|
+
return t.type === "text" || !n || fe(t) ? { formats: [], defaultFormat: null } : {
|
|
408
|
+
formats: Te({
|
|
182
409
|
cardType: t.type,
|
|
183
410
|
allowDownload: (o = t.preferences) == null ? void 0 : o.allowDownload
|
|
184
411
|
}),
|
|
185
|
-
defaultFormat:
|
|
412
|
+
defaultFormat: xe({
|
|
186
413
|
cardType: t.type,
|
|
187
|
-
allowDownload: (
|
|
414
|
+
allowDownload: (a = t.preferences) == null ? void 0 : a.allowDownload
|
|
188
415
|
})
|
|
189
416
|
};
|
|
190
417
|
}
|
|
191
|
-
function
|
|
418
|
+
function Te(t) {
|
|
192
419
|
return t.allowDownload === !1 ? ["pdf"] : ["pdf", "csv"];
|
|
193
420
|
}
|
|
194
|
-
function
|
|
195
|
-
return
|
|
421
|
+
function xe(t) {
|
|
422
|
+
return Ce.has(t.cardType) && t.allowDownload !== !1 ? "csv" : "pdf";
|
|
196
423
|
}
|
|
197
|
-
function
|
|
424
|
+
function kt(t) {
|
|
198
425
|
return t != null && t.role ? t.type === "tenant" ? t.role === "POWER_USER" : ["AUTHOR", "ADMIN", "SUPER_ADMIN"].includes(t.role) : !1;
|
|
199
426
|
}
|
|
200
|
-
function
|
|
427
|
+
function Tt(t) {
|
|
201
428
|
return t.canCreate ? [
|
|
202
429
|
...t.scheduledReportAvailable ? ["scheduled_report"] : [],
|
|
203
430
|
...t.analyticalBriefingsEnabled ? ["analytical_briefing"] : []
|
|
204
431
|
] : [];
|
|
205
432
|
}
|
|
206
|
-
function
|
|
433
|
+
function Ae(t) {
|
|
207
434
|
const n = (t == null ? void 0 : t.channels) ?? [];
|
|
208
435
|
return n.length === 1 && n[0] === "EMAIL";
|
|
209
436
|
}
|
|
210
|
-
function
|
|
211
|
-
return t.body.type === "generated_analysis" ? "Analytical briefing" : t.body.type === "custom_message" && t.attachments.length > 0 &&
|
|
437
|
+
function Se(t) {
|
|
438
|
+
return t.body.type === "generated_analysis" ? "Analytical briefing" : t.body.type === "custom_message" && t.attachments.length > 0 && Ae(t.deliveryConfig) ? t.scheduleExpr ? "Scheduled report" : "On-demand report" : "Plain briefing";
|
|
212
439
|
}
|
|
213
|
-
function
|
|
214
|
-
const n =
|
|
440
|
+
function xt(t) {
|
|
441
|
+
const n = Se(t), e = n === "Scheduled report" || n === "On-demand report" ? "report" : "briefing";
|
|
215
442
|
return {
|
|
216
443
|
typeLabel: n,
|
|
217
444
|
noun: e,
|
|
218
445
|
pluralNoun: e === "report" ? "reports" : "briefings"
|
|
219
446
|
};
|
|
220
447
|
}
|
|
221
|
-
const
|
|
448
|
+
const O = "BRIEFING", we = ["markdown", "html"], R = ["markdown"], _ = 20, s = {
|
|
222
449
|
name: 500,
|
|
223
450
|
description: 2e3,
|
|
224
451
|
instruction: 5e4,
|
|
@@ -234,61 +461,83 @@ const L = "BRIEFING", me = ["markdown", "html"], N = ["markdown"], w = 20, d = {
|
|
|
234
461
|
presentationTone: 500,
|
|
235
462
|
presentationFormat: 2e3,
|
|
236
463
|
id: 500
|
|
237
|
-
},
|
|
464
|
+
}, $ = {
|
|
238
465
|
maxBlocks: 50,
|
|
239
466
|
maxTableRows: 100,
|
|
240
467
|
maxTableColumns: 20,
|
|
241
|
-
maxTableCellCharacters:
|
|
242
|
-
maxParagraphCharacters:
|
|
243
|
-
maxFindingCharacters:
|
|
468
|
+
maxTableCellCharacters: s.contentCell,
|
|
469
|
+
maxParagraphCharacters: s.contentText,
|
|
470
|
+
maxFindingCharacters: s.contentText,
|
|
244
471
|
maxListItems: 100,
|
|
245
472
|
// A kpi_grid is rendered as a 2-up tile arrangement in emails. Cap at 8 so
|
|
246
473
|
// the visual stays at most 4 rows (4 columns wide on desktop would force
|
|
247
474
|
// tiny tiles in narrow client panels; 2-up was the chosen layout).
|
|
248
475
|
maxKpiTiles: 8
|
|
249
|
-
}
|
|
476
|
+
};
|
|
477
|
+
function De(t) {
|
|
478
|
+
if (t === null || typeof t != "object" || Array.isArray(t))
|
|
479
|
+
return !1;
|
|
480
|
+
const n = t;
|
|
481
|
+
if (typeof n.value != "number" || !Number.isFinite(n.value))
|
|
482
|
+
return !1;
|
|
483
|
+
const e = n.target;
|
|
484
|
+
if (e === null || typeof e != "object" || Array.isArray(e))
|
|
485
|
+
return !1;
|
|
486
|
+
const r = e;
|
|
487
|
+
return (r.kind === "metric" && typeof r.metricId == "string" && !!r.metricId.trim() || r.kind === "column" && typeof r.columnKey == "string" && !!r.columnKey.trim() || r.kind === "matrix_measure" && typeof r.measureId == "string" && !!r.measureId.trim()) && W(n.format).ok;
|
|
488
|
+
}
|
|
489
|
+
function _e(t) {
|
|
490
|
+
return t == null ? "" : De(t) ? me(t.value, t.format) : String(t);
|
|
491
|
+
}
|
|
492
|
+
function At(t) {
|
|
493
|
+
return [t.delta, t.percentChange].filter(
|
|
494
|
+
(n) => n != null
|
|
495
|
+
).map(_e).filter(Boolean).join(" / ");
|
|
496
|
+
}
|
|
497
|
+
const J = new Set(we), Be = /* @__PURE__ */ new Set([
|
|
250
498
|
"EMAIL",
|
|
251
499
|
"WEBHOOK",
|
|
252
500
|
"SLACK",
|
|
253
501
|
"IN_APP",
|
|
254
502
|
"TELEGRAM"
|
|
255
|
-
]),
|
|
503
|
+
]), B = {
|
|
256
504
|
maxToolCalls: { min: 1, max: 100 },
|
|
505
|
+
maxPlanningIterations: { min: 1, max: 10 },
|
|
257
506
|
maxRows: { min: 1, max: 1e5 },
|
|
258
507
|
timeoutMs: { min: 1e3, max: 30 * 6e4 }
|
|
259
|
-
},
|
|
508
|
+
}, Fe = /* @__PURE__ */ new Set([
|
|
260
509
|
"letter",
|
|
261
510
|
"legal",
|
|
262
511
|
"a4",
|
|
263
512
|
"a3",
|
|
264
513
|
"tabloid"
|
|
265
|
-
]),
|
|
514
|
+
]), Ne = /* @__PURE__ */ new Set([
|
|
266
515
|
"portrait",
|
|
267
516
|
"landscape"
|
|
268
|
-
]),
|
|
517
|
+
]), Oe = /* @__PURE__ */ new Set([",", ";", " "]), Re = /* @__PURE__ */ new Set([
|
|
269
518
|
"current",
|
|
270
519
|
"all"
|
|
271
|
-
]),
|
|
520
|
+
]), Le = /* @__PURE__ */ new Set([
|
|
272
521
|
"concise",
|
|
273
522
|
"balanced",
|
|
274
523
|
"detailed"
|
|
275
|
-
]),
|
|
524
|
+
]), ze = /* @__PURE__ */ new Set([
|
|
276
525
|
"info",
|
|
277
526
|
"positive",
|
|
278
527
|
"warning",
|
|
279
528
|
"critical"
|
|
280
|
-
]),
|
|
529
|
+
]), Ve = /* @__PURE__ */ new Set([
|
|
281
530
|
"text",
|
|
282
531
|
"number",
|
|
283
532
|
"currency",
|
|
284
533
|
"percent",
|
|
285
534
|
"date",
|
|
286
535
|
"boolean"
|
|
287
|
-
]),
|
|
536
|
+
]), Ue = /* @__PURE__ */ new Set([
|
|
288
537
|
"left",
|
|
289
538
|
"center",
|
|
290
539
|
"right"
|
|
291
|
-
]),
|
|
540
|
+
]), Pe = [
|
|
292
541
|
"pageSize",
|
|
293
542
|
"orientation",
|
|
294
543
|
"includeFilters",
|
|
@@ -314,142 +563,142 @@ const L = "BRIEFING", me = ["markdown", "html"], N = ["markdown"], w = 20, d = {
|
|
|
314
563
|
"allowDownload",
|
|
315
564
|
"theme"
|
|
316
565
|
];
|
|
317
|
-
class
|
|
566
|
+
class D extends Error {
|
|
318
567
|
constructor(e) {
|
|
319
568
|
super(e.map((r) => `${r.field}: ${r.message}`).join("; "));
|
|
320
|
-
|
|
569
|
+
H(this, "issues");
|
|
321
570
|
this.name = "BriefingContractError", this.issues = e;
|
|
322
571
|
}
|
|
323
572
|
}
|
|
324
|
-
function
|
|
573
|
+
function X(t) {
|
|
325
574
|
return typeof t == "object" && t !== null && !Array.isArray(t);
|
|
326
575
|
}
|
|
327
|
-
function
|
|
576
|
+
function l(t, n, e) {
|
|
328
577
|
t.push({ field: n, message: e });
|
|
329
578
|
}
|
|
330
579
|
function g(t, n, e) {
|
|
331
|
-
return
|
|
580
|
+
return X(t) ? t : (l(e, n, "Expected an object."), {});
|
|
332
581
|
}
|
|
333
|
-
function
|
|
582
|
+
function f(t, n, e, r) {
|
|
334
583
|
const o = new Set(e);
|
|
335
|
-
Object.keys(t).forEach((
|
|
336
|
-
o.has(
|
|
584
|
+
Object.keys(t).forEach((a) => {
|
|
585
|
+
o.has(a) || l(
|
|
337
586
|
r,
|
|
338
|
-
n ? `${n}.${
|
|
339
|
-
`Unexpected field "${
|
|
587
|
+
n ? `${n}.${a}` : a,
|
|
588
|
+
`Unexpected field "${a}".`
|
|
340
589
|
);
|
|
341
590
|
});
|
|
342
591
|
}
|
|
343
|
-
function
|
|
592
|
+
function u(t, n, e, r) {
|
|
344
593
|
if (typeof t != "string")
|
|
345
|
-
return
|
|
594
|
+
return l(r, n, "Expected a string."), "";
|
|
346
595
|
const o = t.trim();
|
|
347
|
-
return o ? (o.length > e &&
|
|
596
|
+
return o ? (o.length > e && l(r, n, `Must be ${e} characters or fewer.`), o) : (l(r, n, "Required value cannot be empty."), "");
|
|
348
597
|
}
|
|
349
598
|
function h(t, n, e, r) {
|
|
350
599
|
if (t == null)
|
|
351
600
|
return;
|
|
352
601
|
if (typeof t != "string") {
|
|
353
|
-
|
|
602
|
+
l(r, n, "Expected a string.");
|
|
354
603
|
return;
|
|
355
604
|
}
|
|
356
605
|
const o = t.trim();
|
|
357
606
|
if (o)
|
|
358
|
-
return o.length > e &&
|
|
607
|
+
return o.length > e && l(r, n, `Must be ${e} characters or fewer.`), o;
|
|
359
608
|
}
|
|
360
|
-
function
|
|
609
|
+
function je(t, n, e, r) {
|
|
361
610
|
if (typeof t != "string")
|
|
362
|
-
return
|
|
611
|
+
return l(r, n, "Expected a string."), "";
|
|
363
612
|
const o = t.trim();
|
|
364
|
-
return o.length > e &&
|
|
613
|
+
return o.length > e && l(r, n, `Must be ${e} characters or fewer.`), o;
|
|
365
614
|
}
|
|
366
|
-
function
|
|
615
|
+
function Me(t, n, e) {
|
|
367
616
|
if (t != null) {
|
|
368
617
|
if (!Number.isInteger(t) || Number(t) < 0) {
|
|
369
|
-
|
|
618
|
+
l(e, n, "Expected a non-negative integer.");
|
|
370
619
|
return;
|
|
371
620
|
}
|
|
372
621
|
return Number(t);
|
|
373
622
|
}
|
|
374
623
|
}
|
|
375
|
-
function
|
|
624
|
+
function I(t, n, e, r = {}) {
|
|
376
625
|
if (t == null)
|
|
377
|
-
return r.required ? (
|
|
626
|
+
return r.required ? (l(e, n, "Expected at least one evidence id."), []) : void 0;
|
|
378
627
|
if (!Array.isArray(t))
|
|
379
|
-
return
|
|
628
|
+
return l(e, n, "Expected an array."), r.required ? [] : void 0;
|
|
380
629
|
const o = [];
|
|
381
|
-
return t.forEach((
|
|
382
|
-
const
|
|
383
|
-
|
|
384
|
-
`${n}.${
|
|
385
|
-
|
|
630
|
+
return t.forEach((a, i) => {
|
|
631
|
+
const c = u(
|
|
632
|
+
a,
|
|
633
|
+
`${n}.${i}`,
|
|
634
|
+
s.id,
|
|
386
635
|
e
|
|
387
636
|
);
|
|
388
|
-
|
|
389
|
-
}), r.required && o.length === 0 &&
|
|
637
|
+
c && !o.includes(c) && o.push(c);
|
|
638
|
+
}), r.required && o.length === 0 && l(e, n, "Expected at least one evidence id."), o.length > 0 || r.required ? o : void 0;
|
|
390
639
|
}
|
|
391
|
-
function
|
|
392
|
-
return t == null ? n : typeof t != "boolean" ? (
|
|
640
|
+
function A(t, n, e, r) {
|
|
641
|
+
return t == null ? n : typeof t != "boolean" ? (l(r, e, "Expected a boolean."), n) : t;
|
|
393
642
|
}
|
|
394
|
-
function
|
|
395
|
-
return t == null ? "ACTIVE" : t === "ACTIVE" || t === "PAUSED" || t === "DISABLED" ? t : (
|
|
643
|
+
function Ke(t, n) {
|
|
644
|
+
return t == null ? "ACTIVE" : t === "ACTIVE" || t === "PAUSED" || t === "DISABLED" ? t : (l(n, "status", "Expected ACTIVE, PAUSED, or DISABLED."), "ACTIVE");
|
|
396
645
|
}
|
|
397
|
-
function
|
|
646
|
+
function qe(t) {
|
|
398
647
|
return t.includes("@") && t.includes(".") && !t.includes(" ");
|
|
399
648
|
}
|
|
400
|
-
function
|
|
649
|
+
function Q(t, n) {
|
|
401
650
|
if (t == null)
|
|
402
651
|
return { type: "project" };
|
|
403
652
|
const e = g(t, "source", n), r = e.type;
|
|
404
|
-
return r === "project" ? (
|
|
653
|
+
return r === "project" ? (f(e, "source", ["type"], n), { type: "project" }) : r === "dashboard" ? (f(e, "source", ["type", "dashboardId"], n), {
|
|
405
654
|
type: "dashboard",
|
|
406
|
-
dashboardId:
|
|
655
|
+
dashboardId: u(
|
|
407
656
|
e.dashboardId,
|
|
408
657
|
"source.dashboardId",
|
|
409
|
-
|
|
658
|
+
s.id,
|
|
410
659
|
n
|
|
411
660
|
)
|
|
412
|
-
}) : (
|
|
661
|
+
}) : (l(n, "source.type", "Expected project or dashboard."), { type: "project" });
|
|
413
662
|
}
|
|
414
|
-
function
|
|
663
|
+
function ee(t, n) {
|
|
415
664
|
const e = g(t, "body", n), r = e.type;
|
|
416
|
-
return r === "generated_analysis" ? (
|
|
665
|
+
return r === "generated_analysis" ? (f(e, "body", ["type", "instruction"], n), {
|
|
417
666
|
type: "generated_analysis",
|
|
418
|
-
instruction:
|
|
667
|
+
instruction: u(
|
|
419
668
|
e.instruction,
|
|
420
669
|
"body.instruction",
|
|
421
|
-
|
|
670
|
+
s.instruction,
|
|
422
671
|
n
|
|
423
672
|
)
|
|
424
|
-
}) : r === "custom_message" ? (
|
|
673
|
+
}) : r === "custom_message" ? (f(e, "body", ["type", "message"], n), {
|
|
425
674
|
type: "custom_message",
|
|
426
|
-
message:
|
|
675
|
+
message: je(
|
|
427
676
|
e.message,
|
|
428
677
|
"body.message",
|
|
429
|
-
|
|
678
|
+
s.customMessage,
|
|
430
679
|
n
|
|
431
680
|
)
|
|
432
|
-
}) : r === "none" ? (
|
|
681
|
+
}) : r === "none" ? (f(e, "body", ["type"], n), { type: "none" }) : (l(
|
|
433
682
|
n,
|
|
434
683
|
"body.type",
|
|
435
684
|
"Expected generated_analysis, custom_message, or none."
|
|
436
685
|
), { type: "none" });
|
|
437
686
|
}
|
|
438
|
-
function
|
|
687
|
+
function He(t, n) {
|
|
439
688
|
if (t == null)
|
|
440
|
-
return [...
|
|
689
|
+
return [...R];
|
|
441
690
|
if (!Array.isArray(t))
|
|
442
|
-
return
|
|
691
|
+
return l(n, "presentation.artifactFormats", "Expected an array."), [...R];
|
|
443
692
|
if (t.length === 0)
|
|
444
|
-
return
|
|
693
|
+
return l(
|
|
445
694
|
n,
|
|
446
695
|
"presentation.artifactFormats",
|
|
447
696
|
"Choose at least one artifact format."
|
|
448
697
|
), [];
|
|
449
698
|
const e = [];
|
|
450
699
|
return t.forEach((r, o) => {
|
|
451
|
-
if (typeof r != "string" || !
|
|
452
|
-
|
|
700
|
+
if (typeof r != "string" || !J.has(r)) {
|
|
701
|
+
l(
|
|
453
702
|
n,
|
|
454
703
|
`presentation.artifactFormats.${o}`,
|
|
455
704
|
"Expected markdown or html."
|
|
@@ -459,29 +708,40 @@ function Se(t, n) {
|
|
|
459
708
|
e.includes(r) || e.push(r);
|
|
460
709
|
}), e;
|
|
461
710
|
}
|
|
462
|
-
function
|
|
711
|
+
function te(t, n) {
|
|
463
712
|
if (t == null)
|
|
464
713
|
return {
|
|
465
|
-
artifactFormats: [...
|
|
714
|
+
artifactFormats: [...R],
|
|
466
715
|
includeEvidence: !0,
|
|
467
716
|
includeSql: !0
|
|
468
717
|
};
|
|
469
718
|
const e = g(t, "presentation", n);
|
|
470
|
-
|
|
719
|
+
f(
|
|
471
720
|
e,
|
|
472
721
|
"presentation",
|
|
473
|
-
[
|
|
722
|
+
[
|
|
723
|
+
"artifactFormats",
|
|
724
|
+
"includeEvidence",
|
|
725
|
+
"includeSql",
|
|
726
|
+
"audience",
|
|
727
|
+
"tone",
|
|
728
|
+
"format",
|
|
729
|
+
"appearance",
|
|
730
|
+
"brandOverrides",
|
|
731
|
+
"fragments",
|
|
732
|
+
"viewUrl"
|
|
733
|
+
],
|
|
474
734
|
n
|
|
475
735
|
);
|
|
476
736
|
const r = {
|
|
477
|
-
artifactFormats:
|
|
478
|
-
includeEvidence:
|
|
737
|
+
artifactFormats: He(e.artifactFormats, n),
|
|
738
|
+
includeEvidence: A(
|
|
479
739
|
e.includeEvidence,
|
|
480
740
|
!0,
|
|
481
741
|
"presentation.includeEvidence",
|
|
482
742
|
n
|
|
483
743
|
),
|
|
484
|
-
includeSql:
|
|
744
|
+
includeSql: A(
|
|
485
745
|
e.includeSql,
|
|
486
746
|
!0,
|
|
487
747
|
"presentation.includeSql",
|
|
@@ -490,383 +750,512 @@ function H(t, n) {
|
|
|
490
750
|
}, o = h(
|
|
491
751
|
e.audience,
|
|
492
752
|
"presentation.audience",
|
|
493
|
-
|
|
753
|
+
s.presentationAudience,
|
|
494
754
|
n
|
|
495
|
-
),
|
|
755
|
+
), a = h(
|
|
496
756
|
e.tone,
|
|
497
757
|
"presentation.tone",
|
|
498
|
-
|
|
758
|
+
s.presentationTone,
|
|
499
759
|
n
|
|
500
|
-
),
|
|
760
|
+
), i = h(
|
|
501
761
|
e.format,
|
|
502
762
|
"presentation.format",
|
|
503
|
-
|
|
763
|
+
s.presentationFormat,
|
|
504
764
|
n
|
|
505
765
|
);
|
|
506
|
-
|
|
766
|
+
o && (r.audience = o), a && (r.tone = a), i && (r.format = i);
|
|
767
|
+
const c = ge(e);
|
|
768
|
+
return c.issues.forEach((d) => l(n, d.field, d.message)), Object.assign(r, c.value), r;
|
|
507
769
|
}
|
|
508
|
-
function
|
|
509
|
-
return Array.isArray(t) ? (t.length === 0 &&
|
|
770
|
+
function Ge(t, n, e) {
|
|
771
|
+
return Array.isArray(t) ? (t.length === 0 && l(e, n, "Expected at least one item."), t.length > $.maxListItems && l(
|
|
510
772
|
e,
|
|
511
773
|
n,
|
|
512
|
-
`Must have ${
|
|
513
|
-
), t.slice(0,
|
|
514
|
-
(r, o) =>
|
|
774
|
+
`Must have ${$.maxListItems} items or fewer.`
|
|
775
|
+
), t.slice(0, $.maxListItems).map(
|
|
776
|
+
(r, o) => u(
|
|
515
777
|
r,
|
|
516
778
|
`${n}.${o}`,
|
|
517
|
-
|
|
779
|
+
s.contentItem,
|
|
518
780
|
e
|
|
519
781
|
)
|
|
520
|
-
).filter(Boolean)) : (
|
|
782
|
+
).filter(Boolean)) : (l(e, n, "Expected an array."), []);
|
|
783
|
+
}
|
|
784
|
+
function We(t, n, e) {
|
|
785
|
+
const r = g(t, n, e);
|
|
786
|
+
if (r.kind === "metric")
|
|
787
|
+
return f(r, n, ["kind", "metricId"], e), {
|
|
788
|
+
kind: "metric",
|
|
789
|
+
metricId: u(
|
|
790
|
+
r.metricId,
|
|
791
|
+
`${n}.metricId`,
|
|
792
|
+
s.id,
|
|
793
|
+
e
|
|
794
|
+
)
|
|
795
|
+
};
|
|
796
|
+
if (r.kind === "column")
|
|
797
|
+
return f(r, n, ["kind", "columnKey"], e), {
|
|
798
|
+
kind: "column",
|
|
799
|
+
columnKey: u(
|
|
800
|
+
r.columnKey,
|
|
801
|
+
`${n}.columnKey`,
|
|
802
|
+
s.id,
|
|
803
|
+
e
|
|
804
|
+
)
|
|
805
|
+
};
|
|
806
|
+
if (r.kind === "matrix_measure")
|
|
807
|
+
return f(r, n, ["kind", "measureId"], e), {
|
|
808
|
+
kind: "matrix_measure",
|
|
809
|
+
measureId: u(
|
|
810
|
+
r.measureId,
|
|
811
|
+
`${n}.measureId`,
|
|
812
|
+
s.id,
|
|
813
|
+
e
|
|
814
|
+
)
|
|
815
|
+
};
|
|
816
|
+
l(
|
|
817
|
+
e,
|
|
818
|
+
`${n}.kind`,
|
|
819
|
+
"Expected metric, column, or matrix_measure."
|
|
820
|
+
);
|
|
821
|
+
}
|
|
822
|
+
function ne(t, n, e) {
|
|
823
|
+
if (t === null || typeof t != "object" || Array.isArray(t))
|
|
824
|
+
return;
|
|
825
|
+
const r = g(t, n, e);
|
|
826
|
+
if (!Object.prototype.hasOwnProperty.call(r, "target") && !Object.prototype.hasOwnProperty.call(r, "format"))
|
|
827
|
+
return;
|
|
828
|
+
f(r, n, ["value", "target", "format"], e), (typeof r.value != "number" || !Number.isFinite(r.value)) && l(e, `${n}.value`, "Expected a finite number.");
|
|
829
|
+
const o = We(
|
|
830
|
+
r.target,
|
|
831
|
+
`${n}.target`,
|
|
832
|
+
e
|
|
833
|
+
), a = W(r.format);
|
|
834
|
+
if (a.ok || a.issues.forEach(
|
|
835
|
+
(i) => l(
|
|
836
|
+
e,
|
|
837
|
+
i.path === "$" ? `${n}.format` : `${n}.format.${i.path}`,
|
|
838
|
+
i.message
|
|
839
|
+
)
|
|
840
|
+
), !(typeof r.value != "number" || !Number.isFinite(r.value) || !o || !a.ok))
|
|
841
|
+
return { value: r.value, target: o, format: a.value };
|
|
842
|
+
}
|
|
843
|
+
function k(t, n, e) {
|
|
844
|
+
if (typeof t == "string")
|
|
845
|
+
return t;
|
|
846
|
+
if (typeof t == "number") {
|
|
847
|
+
if (!Number.isFinite(t)) {
|
|
848
|
+
l(e, n, "Expected a finite number.");
|
|
849
|
+
return;
|
|
850
|
+
}
|
|
851
|
+
return t;
|
|
852
|
+
}
|
|
853
|
+
const r = ne(t, n, e);
|
|
854
|
+
if (r) return r;
|
|
855
|
+
l(
|
|
856
|
+
e,
|
|
857
|
+
n,
|
|
858
|
+
"Expected a string, number, or structured numeric value."
|
|
859
|
+
);
|
|
521
860
|
}
|
|
522
|
-
function
|
|
523
|
-
|
|
861
|
+
function Ze(t, n, e) {
|
|
862
|
+
if (t === null || typeof t == "string" || typeof t == "number" || typeof t == "boolean")
|
|
863
|
+
return typeof t == "string" && t.length > s.contentCell ? (l(
|
|
864
|
+
e,
|
|
865
|
+
n,
|
|
866
|
+
`Must be ${s.contentCell} characters or fewer.`
|
|
867
|
+
), t.slice(0, s.contentCell)) : typeof t == "number" && !Number.isFinite(t) ? (l(e, n, "Expected a finite number."), null) : t;
|
|
868
|
+
const r = ne(t, n, e);
|
|
869
|
+
return r || (l(
|
|
524
870
|
e,
|
|
525
871
|
n,
|
|
526
|
-
|
|
527
|
-
),
|
|
872
|
+
"Expected a string, number, boolean, structured numeric value, or null."
|
|
873
|
+
), null);
|
|
528
874
|
}
|
|
529
|
-
function
|
|
875
|
+
function Ye(t, n, e) {
|
|
530
876
|
if (!Array.isArray(t))
|
|
531
|
-
return
|
|
532
|
-
t.length === 0 &&
|
|
877
|
+
return l(e, n, "Expected an array."), [];
|
|
878
|
+
t.length === 0 && l(e, n, "Expected at least one column."), t.length > $.maxTableColumns && l(
|
|
533
879
|
e,
|
|
534
880
|
n,
|
|
535
|
-
`Must have ${
|
|
881
|
+
`Must have ${$.maxTableColumns} columns or fewer.`
|
|
536
882
|
);
|
|
537
883
|
const r = /* @__PURE__ */ new Set();
|
|
538
|
-
return t.slice(0,
|
|
539
|
-
const
|
|
540
|
-
|
|
541
|
-
const
|
|
542
|
-
|
|
543
|
-
`${
|
|
544
|
-
|
|
884
|
+
return t.slice(0, $.maxTableColumns).map((o, a) => {
|
|
885
|
+
const i = `${n}.${a}`, c = g(o, i, e);
|
|
886
|
+
f(c, i, ["key", "label", "kind", "align"], e);
|
|
887
|
+
const d = u(
|
|
888
|
+
c.key,
|
|
889
|
+
`${i}.key`,
|
|
890
|
+
s.id,
|
|
545
891
|
e
|
|
546
892
|
);
|
|
547
|
-
|
|
548
|
-
const
|
|
549
|
-
|
|
550
|
-
`${
|
|
551
|
-
|
|
893
|
+
d && (r.has(d) && l(e, `${i}.key`, "Column key must be unique."), r.add(d));
|
|
894
|
+
const m = u(
|
|
895
|
+
c.label,
|
|
896
|
+
`${i}.label`,
|
|
897
|
+
s.contentTitle,
|
|
552
898
|
e
|
|
553
|
-
),
|
|
554
|
-
|
|
555
|
-
`${
|
|
556
|
-
|
|
899
|
+
), p = x(
|
|
900
|
+
c.kind,
|
|
901
|
+
`${i}.kind`,
|
|
902
|
+
Ve,
|
|
557
903
|
"text, number, currency, percent, date, or boolean",
|
|
558
904
|
e
|
|
559
|
-
),
|
|
560
|
-
|
|
561
|
-
`${
|
|
562
|
-
|
|
905
|
+
), v = x(
|
|
906
|
+
c.align,
|
|
907
|
+
`${i}.align`,
|
|
908
|
+
Ue,
|
|
563
909
|
"left, center, or right",
|
|
564
910
|
e
|
|
565
911
|
);
|
|
566
912
|
return {
|
|
567
|
-
key:
|
|
568
|
-
label:
|
|
569
|
-
...
|
|
570
|
-
...
|
|
913
|
+
key: d,
|
|
914
|
+
label: m,
|
|
915
|
+
...p ? { kind: p } : {},
|
|
916
|
+
...v ? { align: v } : {}
|
|
571
917
|
};
|
|
572
918
|
});
|
|
573
919
|
}
|
|
574
|
-
function
|
|
920
|
+
function Je(t, n, e, r) {
|
|
575
921
|
if (!Array.isArray(t))
|
|
576
|
-
return
|
|
577
|
-
t.length >
|
|
922
|
+
return l(r, n, "Expected an array."), [];
|
|
923
|
+
t.length > $.maxTableRows && l(
|
|
578
924
|
r,
|
|
579
925
|
n,
|
|
580
|
-
`Must have ${
|
|
926
|
+
`Must have ${$.maxTableRows} rows or fewer.`
|
|
581
927
|
);
|
|
582
|
-
const o = new Set(e.map((
|
|
583
|
-
return t.slice(0,
|
|
584
|
-
const
|
|
585
|
-
return Object.keys(
|
|
586
|
-
o.has(
|
|
928
|
+
const o = new Set(e.map((a) => a.key).filter(Boolean));
|
|
929
|
+
return t.slice(0, $.maxTableRows).map((a, i) => {
|
|
930
|
+
const c = `${n}.${i}`, d = g(a, c, r);
|
|
931
|
+
return Object.keys(d).forEach((m) => {
|
|
932
|
+
o.has(m) || l(r, `${c}.${m}`, `Unexpected table cell "${m}".`);
|
|
587
933
|
}), Object.fromEntries(
|
|
588
|
-
e.map((
|
|
589
|
-
|
|
590
|
-
|
|
934
|
+
e.map((m) => [
|
|
935
|
+
m.key,
|
|
936
|
+
Ze(d[m.key] ?? null, `${c}.${m.key}`, r)
|
|
591
937
|
])
|
|
592
938
|
);
|
|
593
939
|
});
|
|
594
940
|
}
|
|
595
|
-
function
|
|
596
|
-
const r = `content.blocks.${n}`, o = g(t, r, e),
|
|
597
|
-
if (
|
|
598
|
-
|
|
599
|
-
const
|
|
600
|
-
o.level !== void 0 && o.level !== null &&
|
|
601
|
-
const
|
|
941
|
+
function Xe(t, n, e) {
|
|
942
|
+
const r = `content.blocks.${n}`, o = g(t, r, e), a = o.type;
|
|
943
|
+
if (a === "heading") {
|
|
944
|
+
f(o, r, ["type", "text", "level", "evidenceIds"], e);
|
|
945
|
+
const i = o.level === void 0 || o.level === null ? void 0 : o.level === 2 || o.level === 3 ? o.level : void 0;
|
|
946
|
+
o.level !== void 0 && o.level !== null && i === void 0 && l(e, `${r}.level`, "Expected 2 or 3.");
|
|
947
|
+
const c = I(o.evidenceIds, `${r}.evidenceIds`, e);
|
|
602
948
|
return {
|
|
603
949
|
type: "heading",
|
|
604
|
-
text:
|
|
950
|
+
text: u(
|
|
605
951
|
o.text,
|
|
606
952
|
`${r}.text`,
|
|
607
|
-
|
|
953
|
+
s.contentTitle,
|
|
608
954
|
e
|
|
609
955
|
),
|
|
610
|
-
...
|
|
611
|
-
...
|
|
956
|
+
...i ? { level: i } : {},
|
|
957
|
+
...c ? { evidenceIds: c } : {}
|
|
612
958
|
};
|
|
613
959
|
}
|
|
614
|
-
if (
|
|
615
|
-
|
|
616
|
-
const
|
|
960
|
+
if (a === "paragraph") {
|
|
961
|
+
f(o, r, ["type", "text", "evidenceIds"], e);
|
|
962
|
+
const i = I(o.evidenceIds, `${r}.evidenceIds`, e);
|
|
617
963
|
return {
|
|
618
964
|
type: "paragraph",
|
|
619
|
-
text:
|
|
965
|
+
text: u(
|
|
620
966
|
o.text,
|
|
621
967
|
`${r}.text`,
|
|
622
|
-
|
|
968
|
+
s.contentText,
|
|
623
969
|
e
|
|
624
970
|
),
|
|
625
|
-
...
|
|
971
|
+
...i ? { evidenceIds: i } : {}
|
|
626
972
|
};
|
|
627
973
|
}
|
|
628
|
-
if (
|
|
629
|
-
|
|
630
|
-
const
|
|
974
|
+
if (a === "finding") {
|
|
975
|
+
f(o, r, ["type", "title", "text", "severity", "evidenceIds"], e);
|
|
976
|
+
const i = h(
|
|
631
977
|
o.title,
|
|
632
978
|
`${r}.title`,
|
|
633
|
-
|
|
979
|
+
s.contentTitle,
|
|
634
980
|
e
|
|
635
|
-
),
|
|
981
|
+
), c = x(
|
|
636
982
|
o.severity,
|
|
637
983
|
`${r}.severity`,
|
|
638
|
-
|
|
984
|
+
ze,
|
|
639
985
|
"info, positive, warning, or critical",
|
|
640
986
|
e
|
|
641
987
|
);
|
|
642
988
|
return {
|
|
643
989
|
type: "finding",
|
|
644
|
-
...
|
|
645
|
-
text:
|
|
990
|
+
...i ? { title: i } : {},
|
|
991
|
+
text: u(
|
|
646
992
|
o.text,
|
|
647
993
|
`${r}.text`,
|
|
648
|
-
|
|
994
|
+
s.contentText,
|
|
649
995
|
e
|
|
650
996
|
),
|
|
651
|
-
...
|
|
652
|
-
evidenceIds:
|
|
997
|
+
...c ? { severity: c } : {},
|
|
998
|
+
evidenceIds: I(o.evidenceIds, `${r}.evidenceIds`, e, {
|
|
653
999
|
required: !0
|
|
654
1000
|
}) ?? []
|
|
655
1001
|
};
|
|
656
1002
|
}
|
|
657
|
-
if (
|
|
658
|
-
|
|
659
|
-
const
|
|
1003
|
+
if (a === "bullets" || a === "actions" || a === "limitations") {
|
|
1004
|
+
f(o, r, ["type", "title", "items", "evidenceIds"], e);
|
|
1005
|
+
const i = h(
|
|
660
1006
|
o.title,
|
|
661
1007
|
`${r}.title`,
|
|
662
|
-
|
|
1008
|
+
s.contentTitle,
|
|
663
1009
|
e
|
|
664
|
-
),
|
|
1010
|
+
), c = I(o.evidenceIds, `${r}.evidenceIds`, e);
|
|
665
1011
|
return {
|
|
666
|
-
type:
|
|
667
|
-
...
|
|
668
|
-
items:
|
|
669
|
-
...
|
|
1012
|
+
type: a,
|
|
1013
|
+
...i ? { title: i } : {},
|
|
1014
|
+
items: Ge(o.items, `${r}.items`, e),
|
|
1015
|
+
...c ? { evidenceIds: c } : {}
|
|
670
1016
|
};
|
|
671
1017
|
}
|
|
672
|
-
if (
|
|
673
|
-
|
|
1018
|
+
if (a === "metric") {
|
|
1019
|
+
f(
|
|
674
1020
|
o,
|
|
675
1021
|
r,
|
|
676
|
-
[
|
|
1022
|
+
[
|
|
1023
|
+
"type",
|
|
1024
|
+
"label",
|
|
1025
|
+
"value",
|
|
1026
|
+
"previousValue",
|
|
1027
|
+
"delta",
|
|
1028
|
+
"percentChange",
|
|
1029
|
+
"unit",
|
|
1030
|
+
"evidenceIds"
|
|
1031
|
+
],
|
|
677
1032
|
e
|
|
678
1033
|
);
|
|
679
|
-
const
|
|
680
|
-
|
|
681
|
-
|
|
682
|
-
|
|
683
|
-
|
|
684
|
-
|
|
685
|
-
const
|
|
1034
|
+
const i = k(o.value, `${r}.value`, e) ?? "";
|
|
1035
|
+
i === "" && l(
|
|
1036
|
+
e,
|
|
1037
|
+
`${r}.value`,
|
|
1038
|
+
"Expected a non-empty string, number, or structured numeric value."
|
|
1039
|
+
);
|
|
1040
|
+
const c = o.previousValue === void 0 || o.previousValue === null ? o.previousValue : k(
|
|
1041
|
+
o.previousValue,
|
|
1042
|
+
`${r}.previousValue`,
|
|
1043
|
+
e
|
|
1044
|
+
), d = o.delta === void 0 || o.delta === null ? o.delta : k(
|
|
1045
|
+
o.delta,
|
|
1046
|
+
`${r}.delta`,
|
|
1047
|
+
e
|
|
1048
|
+
), m = o.percentChange === void 0 || o.percentChange === null ? o.percentChange : k(
|
|
1049
|
+
o.percentChange,
|
|
1050
|
+
`${r}.percentChange`,
|
|
1051
|
+
e
|
|
1052
|
+
), p = h(
|
|
686
1053
|
o.unit,
|
|
687
1054
|
`${r}.unit`,
|
|
688
|
-
|
|
1055
|
+
s.contentTitle,
|
|
689
1056
|
e
|
|
690
|
-
),
|
|
1057
|
+
), v = I(o.evidenceIds, `${r}.evidenceIds`, e);
|
|
691
1058
|
return {
|
|
692
1059
|
type: "metric",
|
|
693
|
-
label:
|
|
1060
|
+
label: u(
|
|
694
1061
|
o.label,
|
|
695
1062
|
`${r}.label`,
|
|
696
|
-
|
|
1063
|
+
s.contentTitle,
|
|
697
1064
|
e
|
|
698
1065
|
),
|
|
699
|
-
value:
|
|
700
|
-
...
|
|
701
|
-
...
|
|
702
|
-
...
|
|
703
|
-
...
|
|
1066
|
+
value: i,
|
|
1067
|
+
...c !== void 0 ? { previousValue: c } : {},
|
|
1068
|
+
...d !== void 0 ? { delta: d } : {},
|
|
1069
|
+
...m !== void 0 ? { percentChange: m } : {},
|
|
1070
|
+
...p ? { unit: p } : {},
|
|
1071
|
+
...v ? { evidenceIds: v } : {}
|
|
704
1072
|
};
|
|
705
1073
|
}
|
|
706
|
-
if (
|
|
707
|
-
|
|
708
|
-
const
|
|
1074
|
+
if (a === "kpi_grid") {
|
|
1075
|
+
f(o, r, ["type", "title", "tiles", "evidenceIds"], e);
|
|
1076
|
+
const i = h(
|
|
709
1077
|
o.title,
|
|
710
1078
|
`${r}.title`,
|
|
711
|
-
|
|
1079
|
+
s.contentTitle,
|
|
712
1080
|
e
|
|
713
|
-
),
|
|
714
|
-
Array.isArray(o.tiles) ||
|
|
1081
|
+
), c = Array.isArray(o.tiles) ? o.tiles : [];
|
|
1082
|
+
Array.isArray(o.tiles) || l(e, `${r}.tiles`, "Expected an array."), c.length === 0 && l(e, `${r}.tiles`, "Expected at least one tile."), c.length > $.maxKpiTiles && l(
|
|
715
1083
|
e,
|
|
716
1084
|
`${r}.tiles`,
|
|
717
|
-
`Must have ${
|
|
1085
|
+
`Must have ${$.maxKpiTiles} tiles or fewer.`
|
|
718
1086
|
);
|
|
719
|
-
const
|
|
720
|
-
const
|
|
721
|
-
|
|
722
|
-
|
|
723
|
-
|
|
724
|
-
[
|
|
1087
|
+
const d = c.slice(0, $.maxKpiTiles).map((p, v) => {
|
|
1088
|
+
const b = `${r}.tiles.${v}`, y = g(p, b, e);
|
|
1089
|
+
f(
|
|
1090
|
+
y,
|
|
1091
|
+
b,
|
|
1092
|
+
[
|
|
1093
|
+
"label",
|
|
1094
|
+
"value",
|
|
1095
|
+
"previousValue",
|
|
1096
|
+
"delta",
|
|
1097
|
+
"percentChange",
|
|
1098
|
+
"unit",
|
|
1099
|
+
"evidenceIds"
|
|
1100
|
+
],
|
|
725
1101
|
e
|
|
726
1102
|
);
|
|
727
|
-
const
|
|
728
|
-
|
|
729
|
-
|
|
730
|
-
|
|
1103
|
+
const S = k(
|
|
1104
|
+
y.value,
|
|
1105
|
+
`${b}.value`,
|
|
1106
|
+
e
|
|
1107
|
+
) ?? "";
|
|
1108
|
+
S === "" && l(
|
|
731
1109
|
e,
|
|
732
|
-
`${
|
|
733
|
-
"Expected a string, number, or
|
|
1110
|
+
`${b}.value`,
|
|
1111
|
+
"Expected a non-empty string, number, or structured numeric value."
|
|
734
1112
|
);
|
|
735
|
-
const
|
|
736
|
-
|
|
737
|
-
|
|
738
|
-
|
|
739
|
-
|
|
740
|
-
|
|
1113
|
+
const P = y.previousValue === void 0 || y.previousValue === null ? y.previousValue : k(
|
|
1114
|
+
y.previousValue,
|
|
1115
|
+
`${b}.previousValue`,
|
|
1116
|
+
e
|
|
1117
|
+
), j = y.delta === void 0 || y.delta === null ? y.delta : k(
|
|
1118
|
+
y.delta,
|
|
1119
|
+
`${b}.delta`,
|
|
1120
|
+
e
|
|
1121
|
+
), M = y.percentChange === void 0 || y.percentChange === null ? y.percentChange : k(
|
|
1122
|
+
y.percentChange,
|
|
1123
|
+
`${b}.percentChange`,
|
|
741
1124
|
e
|
|
742
|
-
),
|
|
743
|
-
|
|
744
|
-
`${
|
|
1125
|
+
), K = h(
|
|
1126
|
+
y.unit,
|
|
1127
|
+
`${b}.unit`,
|
|
1128
|
+
s.contentTitle,
|
|
1129
|
+
e
|
|
1130
|
+
), q = I(
|
|
1131
|
+
y.evidenceIds,
|
|
1132
|
+
`${b}.evidenceIds`,
|
|
745
1133
|
e
|
|
746
1134
|
);
|
|
747
1135
|
return {
|
|
748
|
-
label:
|
|
749
|
-
|
|
750
|
-
`${
|
|
751
|
-
|
|
1136
|
+
label: u(
|
|
1137
|
+
y.label,
|
|
1138
|
+
`${b}.label`,
|
|
1139
|
+
s.contentTitle,
|
|
752
1140
|
e
|
|
753
1141
|
),
|
|
754
|
-
value:
|
|
755
|
-
...
|
|
756
|
-
...
|
|
757
|
-
...
|
|
758
|
-
...
|
|
1142
|
+
value: S,
|
|
1143
|
+
...P !== void 0 ? { previousValue: P } : {},
|
|
1144
|
+
...j !== void 0 ? { delta: j } : {},
|
|
1145
|
+
...M !== void 0 ? { percentChange: M } : {},
|
|
1146
|
+
...K ? { unit: K } : {},
|
|
1147
|
+
...q ? { evidenceIds: q } : {}
|
|
759
1148
|
};
|
|
760
|
-
}),
|
|
1149
|
+
}), m = I(
|
|
761
1150
|
o.evidenceIds,
|
|
762
1151
|
`${r}.evidenceIds`,
|
|
763
1152
|
e
|
|
764
1153
|
);
|
|
765
1154
|
return {
|
|
766
1155
|
type: "kpi_grid",
|
|
767
|
-
...
|
|
768
|
-
tiles:
|
|
769
|
-
...
|
|
1156
|
+
...i ? { title: i } : {},
|
|
1157
|
+
tiles: d,
|
|
1158
|
+
...m ? { evidenceIds: m } : {}
|
|
770
1159
|
};
|
|
771
1160
|
}
|
|
772
|
-
if (
|
|
773
|
-
|
|
774
|
-
const
|
|
775
|
-
(typeof o.value != "number" || !Number.isFinite(o.value)) &&
|
|
776
|
-
const
|
|
1161
|
+
if (a === "progress") {
|
|
1162
|
+
f(o, r, ["type", "label", "value", "detail", "evidenceIds"], e);
|
|
1163
|
+
const i = typeof o.value == "number" && Number.isFinite(o.value) ? o.value : 0;
|
|
1164
|
+
(typeof o.value != "number" || !Number.isFinite(o.value)) && l(e, `${r}.value`, "Expected a finite number.");
|
|
1165
|
+
const c = h(
|
|
777
1166
|
o.detail,
|
|
778
1167
|
`${r}.detail`,
|
|
779
|
-
|
|
1168
|
+
s.contentText,
|
|
780
1169
|
e
|
|
781
|
-
),
|
|
1170
|
+
), d = I(o.evidenceIds, `${r}.evidenceIds`, e);
|
|
782
1171
|
return {
|
|
783
1172
|
type: "progress",
|
|
784
|
-
label:
|
|
1173
|
+
label: u(
|
|
785
1174
|
o.label,
|
|
786
1175
|
`${r}.label`,
|
|
787
|
-
|
|
1176
|
+
s.contentTitle,
|
|
788
1177
|
e
|
|
789
1178
|
),
|
|
790
|
-
value:
|
|
791
|
-
...
|
|
792
|
-
...
|
|
1179
|
+
value: i,
|
|
1180
|
+
...c ? { detail: c } : {},
|
|
1181
|
+
...d ? { evidenceIds: d } : {}
|
|
793
1182
|
};
|
|
794
1183
|
}
|
|
795
|
-
if (
|
|
796
|
-
|
|
1184
|
+
if (a === "table") {
|
|
1185
|
+
f(
|
|
797
1186
|
o,
|
|
798
1187
|
r,
|
|
799
1188
|
["type", "id", "title", "columns", "rows", "caption", "totalRows", "evidenceIds"],
|
|
800
1189
|
e
|
|
801
1190
|
);
|
|
802
|
-
const
|
|
1191
|
+
const i = Ye(o.columns, `${r}.columns`, e), c = h(
|
|
803
1192
|
o.title,
|
|
804
1193
|
`${r}.title`,
|
|
805
|
-
|
|
1194
|
+
s.contentTitle,
|
|
806
1195
|
e
|
|
807
|
-
),
|
|
1196
|
+
), d = h(
|
|
808
1197
|
o.id,
|
|
809
1198
|
`${r}.id`,
|
|
810
|
-
|
|
1199
|
+
s.id,
|
|
811
1200
|
e
|
|
812
|
-
),
|
|
1201
|
+
), m = h(
|
|
813
1202
|
o.caption,
|
|
814
1203
|
`${r}.caption`,
|
|
815
|
-
|
|
1204
|
+
s.contentItem,
|
|
816
1205
|
e
|
|
817
|
-
),
|
|
1206
|
+
), p = Me(
|
|
818
1207
|
o.totalRows,
|
|
819
1208
|
`${r}.totalRows`,
|
|
820
1209
|
e
|
|
821
|
-
),
|
|
1210
|
+
), v = I(o.evidenceIds, `${r}.evidenceIds`, e);
|
|
822
1211
|
return {
|
|
823
1212
|
type: "table",
|
|
824
|
-
...
|
|
825
|
-
...
|
|
826
|
-
columns:
|
|
827
|
-
rows:
|
|
828
|
-
...
|
|
829
|
-
...
|
|
830
|
-
...
|
|
1213
|
+
...d ? { id: d } : {},
|
|
1214
|
+
...c ? { title: c } : {},
|
|
1215
|
+
columns: i,
|
|
1216
|
+
rows: Je(o.rows, `${r}.rows`, i, e),
|
|
1217
|
+
...m ? { caption: m } : {},
|
|
1218
|
+
...p !== void 0 ? { totalRows: p } : {},
|
|
1219
|
+
...v ? { evidenceIds: v } : {}
|
|
831
1220
|
};
|
|
832
1221
|
}
|
|
833
|
-
if (
|
|
834
|
-
|
|
835
|
-
const
|
|
1222
|
+
if (a === "evidence_appendix") {
|
|
1223
|
+
f(o, r, ["type", "title", "evidenceIds"], e);
|
|
1224
|
+
const i = h(
|
|
836
1225
|
o.title,
|
|
837
1226
|
`${r}.title`,
|
|
838
|
-
|
|
1227
|
+
s.contentTitle,
|
|
839
1228
|
e
|
|
840
1229
|
);
|
|
841
1230
|
return {
|
|
842
1231
|
type: "evidence_appendix",
|
|
843
|
-
...
|
|
844
|
-
evidenceIds:
|
|
1232
|
+
...i ? { title: i } : {},
|
|
1233
|
+
evidenceIds: I(o.evidenceIds, `${r}.evidenceIds`, e, {
|
|
845
1234
|
required: !0
|
|
846
1235
|
}) ?? []
|
|
847
1236
|
};
|
|
848
1237
|
}
|
|
849
|
-
if (
|
|
850
|
-
|
|
851
|
-
const
|
|
1238
|
+
if (a === "sql") {
|
|
1239
|
+
f(o, r, ["type", "title", "sql", "evidenceIds"], e);
|
|
1240
|
+
const i = h(
|
|
852
1241
|
o.title,
|
|
853
1242
|
`${r}.title`,
|
|
854
|
-
|
|
1243
|
+
s.contentTitle,
|
|
855
1244
|
e
|
|
856
|
-
),
|
|
1245
|
+
), c = u(
|
|
857
1246
|
o.sql,
|
|
858
1247
|
`${r}.sql`,
|
|
859
|
-
|
|
1248
|
+
s.contentSql,
|
|
860
1249
|
e
|
|
861
|
-
),
|
|
1250
|
+
), d = I(o.evidenceIds, `${r}.evidenceIds`, e);
|
|
862
1251
|
return {
|
|
863
1252
|
type: "sql",
|
|
864
|
-
...
|
|
865
|
-
sql:
|
|
866
|
-
...
|
|
1253
|
+
...i ? { title: i } : {},
|
|
1254
|
+
sql: c,
|
|
1255
|
+
...d ? { evidenceIds: d } : {}
|
|
867
1256
|
};
|
|
868
1257
|
}
|
|
869
|
-
return
|
|
1258
|
+
return l(
|
|
870
1259
|
e,
|
|
871
1260
|
`${r}.type`,
|
|
872
1261
|
"Expected heading, paragraph, finding, bullets, metric, kpi_grid, progress, table, actions, limitations, sql, or evidence_appendix."
|
|
@@ -875,122 +1264,122 @@ function Le(t, n, e) {
|
|
|
875
1264
|
text: ""
|
|
876
1265
|
};
|
|
877
1266
|
}
|
|
878
|
-
function
|
|
1267
|
+
function Qe(t) {
|
|
879
1268
|
const n = [], e = g(t, "content", n);
|
|
880
|
-
|
|
1269
|
+
f(e, "content", ["version", "title", "summary", "blocks"], n), e.version !== 1 && l(n, "content.version", "Expected version 1.");
|
|
881
1270
|
const r = h(
|
|
882
1271
|
e.title,
|
|
883
1272
|
"content.title",
|
|
884
|
-
|
|
1273
|
+
s.contentTitle,
|
|
885
1274
|
n
|
|
886
1275
|
), o = h(
|
|
887
1276
|
e.summary,
|
|
888
1277
|
"content.summary",
|
|
889
|
-
|
|
1278
|
+
s.contentSummary,
|
|
890
1279
|
n
|
|
891
1280
|
);
|
|
892
|
-
Array.isArray(e.blocks) ||
|
|
893
|
-
const
|
|
894
|
-
|
|
1281
|
+
Array.isArray(e.blocks) || l(n, "content.blocks", "Expected an array.");
|
|
1282
|
+
const a = Array.isArray(e.blocks) ? e.blocks : [];
|
|
1283
|
+
a.length === 0 && l(n, "content.blocks", "Expected at least one block."), a.length > $.maxBlocks && l(
|
|
895
1284
|
n,
|
|
896
1285
|
"content.blocks",
|
|
897
|
-
`Must have ${
|
|
1286
|
+
`Must have ${$.maxBlocks} blocks or fewer.`
|
|
898
1287
|
);
|
|
899
|
-
const
|
|
900
|
-
return
|
|
1288
|
+
const i = a.slice(0, $.maxBlocks).map((c, d) => Xe(c, d, n));
|
|
1289
|
+
return z(n), {
|
|
901
1290
|
version: 1,
|
|
902
1291
|
...r ? { title: r } : {},
|
|
903
1292
|
...o ? { summary: o } : {},
|
|
904
|
-
blocks:
|
|
1293
|
+
blocks: i
|
|
905
1294
|
};
|
|
906
1295
|
}
|
|
907
|
-
function
|
|
1296
|
+
function St(t) {
|
|
908
1297
|
try {
|
|
909
1298
|
return {
|
|
910
1299
|
valid: !0,
|
|
911
|
-
value:
|
|
1300
|
+
value: Qe(t),
|
|
912
1301
|
issues: []
|
|
913
1302
|
};
|
|
914
1303
|
} catch (n) {
|
|
915
|
-
if (n instanceof
|
|
1304
|
+
if (n instanceof D)
|
|
916
1305
|
return { valid: !1, issues: n.issues };
|
|
917
1306
|
throw n;
|
|
918
1307
|
}
|
|
919
1308
|
}
|
|
920
|
-
function
|
|
921
|
-
return typeof t == "string" && e.includes(t) ? t : (
|
|
1309
|
+
function w(t, n, e, r) {
|
|
1310
|
+
return typeof t == "string" && e.includes(t) ? t : (l(r, n, `Expected ${e.join(" or ")}.`), e[0]);
|
|
922
1311
|
}
|
|
923
|
-
function
|
|
1312
|
+
function x(t, n, e, r, o) {
|
|
924
1313
|
if (t != null) {
|
|
925
1314
|
if (typeof t == "string" && e.has(t))
|
|
926
1315
|
return t;
|
|
927
|
-
|
|
1316
|
+
l(o, n, `Expected ${r}.`);
|
|
928
1317
|
}
|
|
929
1318
|
}
|
|
930
|
-
function
|
|
1319
|
+
function et(t, n, e) {
|
|
931
1320
|
if (t != null) {
|
|
932
1321
|
if (!Array.isArray(t)) {
|
|
933
|
-
|
|
1322
|
+
l(e, n, "Expected an array.");
|
|
934
1323
|
return;
|
|
935
1324
|
}
|
|
936
1325
|
return t;
|
|
937
1326
|
}
|
|
938
1327
|
}
|
|
939
|
-
function
|
|
1328
|
+
function tt(t, n, e) {
|
|
940
1329
|
if (t != null) {
|
|
941
|
-
if (!
|
|
942
|
-
|
|
1330
|
+
if (!X(t)) {
|
|
1331
|
+
l(e, n, "Expected an object.");
|
|
943
1332
|
return;
|
|
944
1333
|
}
|
|
945
1334
|
return t;
|
|
946
1335
|
}
|
|
947
1336
|
}
|
|
948
|
-
function
|
|
1337
|
+
function nt(t, n, e) {
|
|
949
1338
|
if (t == null)
|
|
950
1339
|
return;
|
|
951
1340
|
const r = g(t, n, e);
|
|
952
|
-
|
|
953
|
-
const o = {},
|
|
1341
|
+
f(r, n, Pe, e);
|
|
1342
|
+
const o = {}, a = x(
|
|
954
1343
|
r.pageSize,
|
|
955
1344
|
`${n}.pageSize`,
|
|
956
|
-
|
|
1345
|
+
Fe,
|
|
957
1346
|
"letter, legal, a4, a3, or tabloid",
|
|
958
1347
|
e
|
|
959
|
-
),
|
|
1348
|
+
), i = x(
|
|
960
1349
|
r.orientation,
|
|
961
1350
|
`${n}.orientation`,
|
|
962
|
-
|
|
1351
|
+
Ne,
|
|
963
1352
|
"portrait or landscape",
|
|
964
1353
|
e
|
|
965
|
-
),
|
|
1354
|
+
), c = x(
|
|
966
1355
|
r.delimiter,
|
|
967
1356
|
`${n}.delimiter`,
|
|
968
|
-
|
|
1357
|
+
Oe,
|
|
969
1358
|
"comma, semicolon, or tab",
|
|
970
1359
|
e
|
|
971
|
-
),
|
|
1360
|
+
), d = x(
|
|
972
1361
|
r.sheetSelection,
|
|
973
1362
|
`${n}.sheetSelection`,
|
|
974
|
-
|
|
1363
|
+
Re,
|
|
975
1364
|
"current or all",
|
|
976
1365
|
e
|
|
977
1366
|
);
|
|
978
|
-
|
|
979
|
-
for (const
|
|
1367
|
+
a && (o.pageSize = a), i && (o.orientation = i), c && (o.delimiter = c), d && (o.sheetSelection = d);
|
|
1368
|
+
for (const m of [
|
|
980
1369
|
"includeFilters",
|
|
981
1370
|
"includeTimestamp",
|
|
982
1371
|
"includeHeaders",
|
|
983
1372
|
"useFormattedValues",
|
|
984
1373
|
"allowDownload"
|
|
985
1374
|
])
|
|
986
|
-
if (!(r[
|
|
987
|
-
if (typeof r[
|
|
988
|
-
|
|
1375
|
+
if (!(r[m] === void 0 || r[m] === null)) {
|
|
1376
|
+
if (typeof r[m] != "boolean") {
|
|
1377
|
+
l(e, `${n}.${m}`, "Expected a boolean.");
|
|
989
1378
|
continue;
|
|
990
1379
|
}
|
|
991
|
-
o[
|
|
1380
|
+
o[m] = r[m];
|
|
992
1381
|
}
|
|
993
|
-
for (const
|
|
1382
|
+
for (const m of [
|
|
994
1383
|
"currentSheetId",
|
|
995
1384
|
"currentSheetName",
|
|
996
1385
|
"filterLine",
|
|
@@ -998,15 +1387,15 @@ function Re(t, n, e) {
|
|
|
998
1387
|
"cardType",
|
|
999
1388
|
"theme"
|
|
1000
1389
|
]) {
|
|
1001
|
-
const
|
|
1002
|
-
r[
|
|
1003
|
-
`${n}.${
|
|
1004
|
-
|
|
1390
|
+
const p = h(
|
|
1391
|
+
r[m],
|
|
1392
|
+
`${n}.${m}`,
|
|
1393
|
+
s.id,
|
|
1005
1394
|
e
|
|
1006
1395
|
);
|
|
1007
|
-
|
|
1396
|
+
p && (o[m] = p);
|
|
1008
1397
|
}
|
|
1009
|
-
for (const
|
|
1398
|
+
for (const m of [
|
|
1010
1399
|
"filterValues",
|
|
1011
1400
|
"inlineFilterValues",
|
|
1012
1401
|
"sheetFilterValues",
|
|
@@ -1014,111 +1403,111 @@ function Re(t, n, e) {
|
|
|
1014
1403
|
"cardControlDefinitions",
|
|
1015
1404
|
"controlBindings"
|
|
1016
1405
|
]) {
|
|
1017
|
-
const
|
|
1018
|
-
|
|
1406
|
+
const p = et(r[m], `${n}.${m}`, e);
|
|
1407
|
+
p && (o[m] = p);
|
|
1019
1408
|
}
|
|
1020
|
-
for (const
|
|
1409
|
+
for (const m of [
|
|
1021
1410
|
"controlValues",
|
|
1022
1411
|
"tablePreferences",
|
|
1023
1412
|
"dashboardInputExecutionSnapshot"
|
|
1024
1413
|
]) {
|
|
1025
|
-
const
|
|
1026
|
-
|
|
1414
|
+
const p = tt(r[m], `${n}.${m}`, e);
|
|
1415
|
+
p && (o[m] = p);
|
|
1027
1416
|
}
|
|
1028
1417
|
return Object.keys(o).length > 0 ? o : void 0;
|
|
1029
1418
|
}
|
|
1030
|
-
function
|
|
1419
|
+
function F(t, n, e, r) {
|
|
1031
1420
|
const o = h(
|
|
1032
1421
|
n,
|
|
1033
1422
|
e,
|
|
1034
|
-
|
|
1423
|
+
s.attachmentTitle,
|
|
1035
1424
|
r
|
|
1036
1425
|
);
|
|
1037
1426
|
return o && (t.title = o), t;
|
|
1038
1427
|
}
|
|
1039
|
-
function
|
|
1040
|
-
const o =
|
|
1428
|
+
function N(t, n, e, r) {
|
|
1429
|
+
const o = nt(n, e, r);
|
|
1041
1430
|
return o && (t.settings = o), t;
|
|
1042
1431
|
}
|
|
1043
|
-
function
|
|
1044
|
-
const r = `attachments.${n}`, o = g(t, r, e),
|
|
1045
|
-
if (
|
|
1046
|
-
|
|
1432
|
+
function rt(t, n, e) {
|
|
1433
|
+
const r = `attachments.${n}`, o = g(t, r, e), a = o.type;
|
|
1434
|
+
if (a === "dashboard") {
|
|
1435
|
+
f(
|
|
1047
1436
|
o,
|
|
1048
1437
|
r,
|
|
1049
1438
|
["type", "dashboardId", "format", "title", "settings"],
|
|
1050
1439
|
e
|
|
1051
1440
|
);
|
|
1052
|
-
const
|
|
1441
|
+
const i = F(
|
|
1053
1442
|
{
|
|
1054
1443
|
type: "dashboard",
|
|
1055
|
-
dashboardId:
|
|
1444
|
+
dashboardId: u(
|
|
1056
1445
|
o.dashboardId,
|
|
1057
1446
|
`${r}.dashboardId`,
|
|
1058
|
-
|
|
1447
|
+
s.id,
|
|
1059
1448
|
e
|
|
1060
1449
|
),
|
|
1061
|
-
format:
|
|
1450
|
+
format: w(o.format, `${r}.format`, ["pdf"], e)
|
|
1062
1451
|
},
|
|
1063
1452
|
o.title,
|
|
1064
1453
|
`${r}.title`,
|
|
1065
1454
|
e
|
|
1066
1455
|
);
|
|
1067
|
-
return
|
|
1456
|
+
return N(i, o.settings, `${r}.settings`, e);
|
|
1068
1457
|
}
|
|
1069
|
-
if (
|
|
1070
|
-
|
|
1458
|
+
if (a === "dashboard_sheet" || a === "document_sheet") {
|
|
1459
|
+
f(
|
|
1071
1460
|
o,
|
|
1072
1461
|
r,
|
|
1073
1462
|
["type", "dashboardId", "sheetId", "format", "title", "settings"],
|
|
1074
1463
|
e
|
|
1075
1464
|
);
|
|
1076
|
-
const
|
|
1465
|
+
const i = F(
|
|
1077
1466
|
{
|
|
1078
|
-
type:
|
|
1079
|
-
dashboardId:
|
|
1467
|
+
type: a,
|
|
1468
|
+
dashboardId: u(
|
|
1080
1469
|
o.dashboardId,
|
|
1081
1470
|
`${r}.dashboardId`,
|
|
1082
|
-
|
|
1471
|
+
s.id,
|
|
1083
1472
|
e
|
|
1084
1473
|
),
|
|
1085
|
-
sheetId:
|
|
1474
|
+
sheetId: u(
|
|
1086
1475
|
o.sheetId,
|
|
1087
1476
|
`${r}.sheetId`,
|
|
1088
|
-
|
|
1477
|
+
s.id,
|
|
1089
1478
|
e
|
|
1090
1479
|
),
|
|
1091
|
-
format:
|
|
1480
|
+
format: w(o.format, `${r}.format`, ["pdf"], e)
|
|
1092
1481
|
},
|
|
1093
1482
|
o.title,
|
|
1094
1483
|
`${r}.title`,
|
|
1095
1484
|
e
|
|
1096
1485
|
);
|
|
1097
|
-
return
|
|
1486
|
+
return N(i, o.settings, `${r}.settings`, e);
|
|
1098
1487
|
}
|
|
1099
|
-
if (
|
|
1100
|
-
|
|
1488
|
+
if (a === "card") {
|
|
1489
|
+
f(
|
|
1101
1490
|
o,
|
|
1102
1491
|
r,
|
|
1103
1492
|
["type", "dashboardId", "cardId", "format", "title", "settings"],
|
|
1104
1493
|
e
|
|
1105
1494
|
);
|
|
1106
|
-
const
|
|
1495
|
+
const i = F(
|
|
1107
1496
|
{
|
|
1108
1497
|
type: "card",
|
|
1109
|
-
dashboardId:
|
|
1498
|
+
dashboardId: u(
|
|
1110
1499
|
o.dashboardId,
|
|
1111
1500
|
`${r}.dashboardId`,
|
|
1112
|
-
|
|
1501
|
+
s.id,
|
|
1113
1502
|
e
|
|
1114
1503
|
),
|
|
1115
|
-
cardId:
|
|
1504
|
+
cardId: u(
|
|
1116
1505
|
o.cardId,
|
|
1117
1506
|
`${r}.cardId`,
|
|
1118
|
-
|
|
1507
|
+
s.id,
|
|
1119
1508
|
e
|
|
1120
1509
|
),
|
|
1121
|
-
format:
|
|
1510
|
+
format: w(
|
|
1122
1511
|
o.format,
|
|
1123
1512
|
`${r}.format`,
|
|
1124
1513
|
["csv", "pdf"],
|
|
@@ -1129,15 +1518,15 @@ function Ve(t, n, e) {
|
|
|
1129
1518
|
`${r}.title`,
|
|
1130
1519
|
e
|
|
1131
1520
|
);
|
|
1132
|
-
return
|
|
1521
|
+
return N(i, o.settings, `${r}.settings`, e);
|
|
1133
1522
|
}
|
|
1134
|
-
return
|
|
1523
|
+
return l(
|
|
1135
1524
|
e,
|
|
1136
1525
|
`${r}.type`,
|
|
1137
1526
|
"Expected dashboard, dashboard_sheet, document_sheet, or card."
|
|
1138
1527
|
), { type: "dashboard", dashboardId: "", format: "pdf" };
|
|
1139
1528
|
}
|
|
1140
|
-
function
|
|
1529
|
+
function ot(t) {
|
|
1141
1530
|
switch (t.type) {
|
|
1142
1531
|
case "dashboard":
|
|
1143
1532
|
return `${t.type}:${t.dashboardId}:${t.format}`;
|
|
@@ -1148,142 +1537,159 @@ function ze(t) {
|
|
|
1148
1537
|
return `${t.type}:${t.dashboardId}:${t.cardId}:${t.format}`;
|
|
1149
1538
|
}
|
|
1150
1539
|
}
|
|
1151
|
-
function
|
|
1540
|
+
function re(t, n) {
|
|
1152
1541
|
if (t == null)
|
|
1153
1542
|
return [];
|
|
1154
1543
|
if (!Array.isArray(t))
|
|
1155
|
-
return
|
|
1156
|
-
t.length >
|
|
1544
|
+
return l(n, "attachments", "Expected an array."), [];
|
|
1545
|
+
t.length > _ && l(
|
|
1157
1546
|
n,
|
|
1158
1547
|
"attachments",
|
|
1159
|
-
`Choose ${
|
|
1548
|
+
`Choose ${_} attachments or fewer.`
|
|
1160
1549
|
);
|
|
1161
|
-
const e = t.slice(0,
|
|
1162
|
-
return e.forEach((o,
|
|
1163
|
-
const
|
|
1164
|
-
r.has(
|
|
1550
|
+
const e = t.slice(0, _).map((o, a) => rt(o, a, n)), r = /* @__PURE__ */ new Set();
|
|
1551
|
+
return e.forEach((o, a) => {
|
|
1552
|
+
const i = ot(o);
|
|
1553
|
+
r.has(i) && l(n, `attachments.${a}`, "Duplicate attachment."), r.add(i);
|
|
1165
1554
|
}), e;
|
|
1166
1555
|
}
|
|
1167
|
-
function
|
|
1556
|
+
function oe(t, n) {
|
|
1168
1557
|
if (t == null)
|
|
1169
1558
|
return;
|
|
1170
1559
|
const e = g(t, "limits", n);
|
|
1171
|
-
|
|
1560
|
+
f(e, "limits", Object.keys(B), n);
|
|
1172
1561
|
const r = {};
|
|
1173
|
-
return Object.keys(
|
|
1174
|
-
const
|
|
1175
|
-
if (
|
|
1562
|
+
return Object.keys(B).forEach((o) => {
|
|
1563
|
+
const a = e[o];
|
|
1564
|
+
if (a == null)
|
|
1176
1565
|
return;
|
|
1177
|
-
const
|
|
1178
|
-
if (typeof
|
|
1179
|
-
|
|
1566
|
+
const i = B[o];
|
|
1567
|
+
if (typeof a != "number" || !Number.isInteger(a) || a < i.min || a > i.max) {
|
|
1568
|
+
l(
|
|
1180
1569
|
n,
|
|
1181
1570
|
`limits.${o}`,
|
|
1182
|
-
`Expected an integer between ${
|
|
1571
|
+
`Expected an integer between ${i.min} and ${i.max}.`
|
|
1183
1572
|
);
|
|
1184
1573
|
return;
|
|
1185
1574
|
}
|
|
1186
|
-
r[o] =
|
|
1575
|
+
r[o] = a;
|
|
1187
1576
|
}), Object.keys(r).length > 0 ? r : void 0;
|
|
1188
1577
|
}
|
|
1189
|
-
function
|
|
1578
|
+
function z(t) {
|
|
1190
1579
|
if (t.length > 0)
|
|
1191
|
-
throw new
|
|
1580
|
+
throw new D(t);
|
|
1192
1581
|
}
|
|
1193
|
-
function
|
|
1194
|
-
!(t.type === "generated_analysis" || t.type === "custom_message" && !!t.message.trim()) && n.length === 0 &&
|
|
1582
|
+
function ae(t, n, e) {
|
|
1583
|
+
!(t.type === "generated_analysis" || t.type === "custom_message" && !!t.message.trim()) && n.length === 0 && l(
|
|
1195
1584
|
e,
|
|
1196
1585
|
"body",
|
|
1197
1586
|
"Add briefing instructions, a custom message, or at least one attachment."
|
|
1198
1587
|
);
|
|
1199
1588
|
}
|
|
1200
|
-
function
|
|
1589
|
+
function ie(t) {
|
|
1201
1590
|
const n = [], e = g(t, "jobConfig", n);
|
|
1202
|
-
|
|
1591
|
+
f(
|
|
1203
1592
|
e,
|
|
1204
1593
|
"jobConfig",
|
|
1205
|
-
[
|
|
1594
|
+
[
|
|
1595
|
+
"kind",
|
|
1596
|
+
"reportContext",
|
|
1597
|
+
"source",
|
|
1598
|
+
"body",
|
|
1599
|
+
"attachments",
|
|
1600
|
+
"presentation",
|
|
1601
|
+
"limits"
|
|
1602
|
+
],
|
|
1206
1603
|
n
|
|
1207
|
-
), e.kind !==
|
|
1208
|
-
const r =
|
|
1209
|
-
|
|
1210
|
-
|
|
1211
|
-
|
|
1212
|
-
|
|
1604
|
+
), e.kind !== O && l(n, "kind", "Expected BRIEFING.");
|
|
1605
|
+
const r = se(e.reportContext);
|
|
1606
|
+
r.ok || r.issues.forEach(
|
|
1607
|
+
(m) => l(
|
|
1608
|
+
n,
|
|
1609
|
+
m.path === "$" ? "jobConfig.reportContext" : `jobConfig.reportContext.${m.path}`,
|
|
1610
|
+
m.message
|
|
1611
|
+
)
|
|
1612
|
+
);
|
|
1613
|
+
const o = Q(e.source, n), a = ee(e.body, n), i = re(e.attachments, n), c = te(e.presentation, n), d = oe(e.limits, n);
|
|
1614
|
+
return ae(a, i, n), z(n), {
|
|
1615
|
+
kind: O,
|
|
1616
|
+
reportContext: r.ok ? r.value : e.reportContext,
|
|
1617
|
+
source: o,
|
|
1618
|
+
body: a,
|
|
1213
1619
|
attachments: i,
|
|
1214
|
-
presentation:
|
|
1215
|
-
...
|
|
1620
|
+
presentation: c,
|
|
1621
|
+
...d ? { limits: d } : {}
|
|
1216
1622
|
};
|
|
1217
1623
|
}
|
|
1218
|
-
function
|
|
1219
|
-
return
|
|
1624
|
+
function wt(t) {
|
|
1625
|
+
return ie({
|
|
1220
1626
|
...t,
|
|
1221
|
-
kind:
|
|
1627
|
+
kind: O
|
|
1222
1628
|
});
|
|
1223
1629
|
}
|
|
1224
|
-
function
|
|
1225
|
-
const o = `${r}.${n}`,
|
|
1226
|
-
if (
|
|
1227
|
-
|
|
1228
|
-
const
|
|
1229
|
-
|
|
1630
|
+
function V(t, n, e, r = "deliveryConfig.recipients") {
|
|
1631
|
+
const o = `${r}.${n}`, a = g(t, o, e), i = a.type;
|
|
1632
|
+
if (i === "email") {
|
|
1633
|
+
f(a, o, ["type", "address", "name"], e);
|
|
1634
|
+
const c = u(
|
|
1635
|
+
a.address,
|
|
1230
1636
|
`${o}.address`,
|
|
1231
|
-
|
|
1637
|
+
s.id,
|
|
1232
1638
|
e
|
|
1233
|
-
),
|
|
1234
|
-
|
|
1639
|
+
), d = h(
|
|
1640
|
+
a.name,
|
|
1235
1641
|
`${o}.name`,
|
|
1236
|
-
|
|
1642
|
+
s.attachmentTitle,
|
|
1237
1643
|
e
|
|
1238
1644
|
);
|
|
1239
|
-
return
|
|
1645
|
+
return c && !qe(c) && l(e, `${o}.address`, "Email address is invalid."), {
|
|
1240
1646
|
type: "email",
|
|
1241
|
-
address:
|
|
1242
|
-
...
|
|
1647
|
+
address: c,
|
|
1648
|
+
...d ? { name: d } : {}
|
|
1243
1649
|
};
|
|
1244
1650
|
}
|
|
1245
|
-
return
|
|
1651
|
+
return i === "user" ? (f(a, o, ["type", "userId"], e), {
|
|
1246
1652
|
type: "user",
|
|
1247
|
-
userId:
|
|
1248
|
-
|
|
1653
|
+
userId: u(
|
|
1654
|
+
a.userId,
|
|
1249
1655
|
`${o}.userId`,
|
|
1250
|
-
|
|
1656
|
+
s.id,
|
|
1251
1657
|
e
|
|
1252
1658
|
)
|
|
1253
|
-
}) :
|
|
1659
|
+
}) : i === "tenant_user" ? (f(a, o, ["type", "tenantUserId"], e), {
|
|
1254
1660
|
type: "tenant_user",
|
|
1255
|
-
tenantUserId:
|
|
1256
|
-
|
|
1661
|
+
tenantUserId: u(
|
|
1662
|
+
a.tenantUserId,
|
|
1257
1663
|
`${o}.tenantUserId`,
|
|
1258
|
-
|
|
1664
|
+
s.id,
|
|
1259
1665
|
e
|
|
1260
1666
|
)
|
|
1261
|
-
}) :
|
|
1667
|
+
}) : i === "group" ? (f(a, o, ["type", "groupId"], e), {
|
|
1262
1668
|
type: "group",
|
|
1263
|
-
groupId:
|
|
1264
|
-
|
|
1669
|
+
groupId: u(
|
|
1670
|
+
a.groupId,
|
|
1265
1671
|
`${o}.groupId`,
|
|
1266
|
-
|
|
1672
|
+
s.id,
|
|
1267
1673
|
e
|
|
1268
1674
|
)
|
|
1269
|
-
}) : (
|
|
1675
|
+
}) : (l(
|
|
1270
1676
|
e,
|
|
1271
1677
|
`${o}.type`,
|
|
1272
1678
|
"Expected email, user, tenant_user, or group."
|
|
1273
1679
|
), { type: "email", address: "" });
|
|
1274
1680
|
}
|
|
1275
|
-
function
|
|
1681
|
+
function at(t, n) {
|
|
1276
1682
|
return t == null ? [] : Array.isArray(t) ? t.map(
|
|
1277
|
-
(e, r) =>
|
|
1278
|
-
) : (
|
|
1683
|
+
(e, r) => V(e, r, n)
|
|
1684
|
+
) : (l(n, "deliveryConfig.recipients", "Expected an array."), []);
|
|
1279
1685
|
}
|
|
1280
|
-
function
|
|
1686
|
+
function it(t, n) {
|
|
1281
1687
|
if (!Array.isArray(t))
|
|
1282
|
-
return
|
|
1688
|
+
return l(n, "deliveryConfig.channels", "Expected an array."), [];
|
|
1283
1689
|
const e = [];
|
|
1284
1690
|
return t.forEach((r, o) => {
|
|
1285
|
-
if (!
|
|
1286
|
-
|
|
1691
|
+
if (!ce(r)) {
|
|
1692
|
+
l(
|
|
1287
1693
|
n,
|
|
1288
1694
|
`deliveryConfig.channels.${o}`,
|
|
1289
1695
|
"Expected EMAIL, WEBHOOK, SLACK, IN_APP, or TELEGRAM."
|
|
@@ -1293,56 +1699,56 @@ function Pe(t, n) {
|
|
|
1293
1699
|
e.includes(r) || e.push(r);
|
|
1294
1700
|
}), e;
|
|
1295
1701
|
}
|
|
1296
|
-
function
|
|
1702
|
+
function ct(t, n, e) {
|
|
1297
1703
|
if (t == null)
|
|
1298
1704
|
return;
|
|
1299
1705
|
const r = g(t, n, e), o = {};
|
|
1300
|
-
return Object.entries(r).forEach(([
|
|
1301
|
-
if (typeof
|
|
1302
|
-
|
|
1706
|
+
return Object.entries(r).forEach(([a, i]) => {
|
|
1707
|
+
if (typeof i != "string") {
|
|
1708
|
+
l(e, `${n}.${a}`, "Expected a string.");
|
|
1303
1709
|
return;
|
|
1304
1710
|
}
|
|
1305
|
-
o[
|
|
1711
|
+
o[a] = i.trim();
|
|
1306
1712
|
}), Object.keys(o).length > 0 ? o : void 0;
|
|
1307
1713
|
}
|
|
1308
|
-
function
|
|
1714
|
+
function lt(t, n, e) {
|
|
1309
1715
|
if (t == null)
|
|
1310
1716
|
return;
|
|
1311
1717
|
const r = g(t, n, e);
|
|
1312
|
-
|
|
1718
|
+
f(
|
|
1313
1719
|
r,
|
|
1314
1720
|
n,
|
|
1315
1721
|
["url", "method", "headers", "secretEncrypted"],
|
|
1316
1722
|
e
|
|
1317
1723
|
);
|
|
1318
|
-
const o = r.method === void 0 || r.method === null ? void 0 :
|
|
1724
|
+
const o = r.method === void 0 || r.method === null ? void 0 : w(r.method, `${n}.method`, ["POST", "PUT"], e), a = ct(r.headers, `${n}.headers`, e), i = h(
|
|
1319
1725
|
r.secretEncrypted,
|
|
1320
1726
|
`${n}.secretEncrypted`,
|
|
1321
1727
|
2e3,
|
|
1322
1728
|
e
|
|
1323
1729
|
);
|
|
1324
1730
|
return {
|
|
1325
|
-
url:
|
|
1731
|
+
url: u(r.url, `${n}.url`, 2e3, e),
|
|
1326
1732
|
...o ? { method: o } : {},
|
|
1327
|
-
...
|
|
1328
|
-
...
|
|
1733
|
+
...a ? { headers: a } : {},
|
|
1734
|
+
...i ? { secretEncrypted: i } : {}
|
|
1329
1735
|
};
|
|
1330
1736
|
}
|
|
1331
|
-
function
|
|
1737
|
+
function dt(t, n, e) {
|
|
1332
1738
|
const r = g(t, n, e), o = r.type;
|
|
1333
1739
|
if (o === "channel") {
|
|
1334
|
-
|
|
1740
|
+
f(
|
|
1335
1741
|
r,
|
|
1336
1742
|
n,
|
|
1337
1743
|
["type", "channelId", "channelName", "isPrivate"],
|
|
1338
1744
|
e
|
|
1339
1745
|
);
|
|
1340
|
-
const
|
|
1746
|
+
const a = h(
|
|
1341
1747
|
r.channelName,
|
|
1342
1748
|
`${n}.channelName`,
|
|
1343
|
-
|
|
1749
|
+
s.attachmentTitle,
|
|
1344
1750
|
e
|
|
1345
|
-
),
|
|
1751
|
+
), i = r.isPrivate === void 0 || r.isPrivate === null ? void 0 : A(
|
|
1346
1752
|
r.isPrivate,
|
|
1347
1753
|
!1,
|
|
1348
1754
|
`${n}.isPrivate`,
|
|
@@ -1350,42 +1756,42 @@ function qe(t, n, e) {
|
|
|
1350
1756
|
);
|
|
1351
1757
|
return {
|
|
1352
1758
|
type: "channel",
|
|
1353
|
-
channelId:
|
|
1759
|
+
channelId: u(
|
|
1354
1760
|
r.channelId,
|
|
1355
1761
|
`${n}.channelId`,
|
|
1356
|
-
|
|
1762
|
+
s.id,
|
|
1357
1763
|
e
|
|
1358
1764
|
),
|
|
1359
|
-
...
|
|
1360
|
-
...
|
|
1765
|
+
...a ? { channelName: a } : {},
|
|
1766
|
+
...i !== void 0 ? { isPrivate: i } : {}
|
|
1361
1767
|
};
|
|
1362
1768
|
}
|
|
1363
|
-
return o === "dm" ? (
|
|
1769
|
+
return o === "dm" ? (f(r, n, ["type", "recipient"], e), l(
|
|
1364
1770
|
e,
|
|
1365
1771
|
`${n}.type`,
|
|
1366
1772
|
"Slack DM delivery is not supported in V1."
|
|
1367
1773
|
), {
|
|
1368
1774
|
type: "dm",
|
|
1369
|
-
recipient:
|
|
1370
|
-
}) : (
|
|
1775
|
+
recipient: V(r.recipient, 0, e, `${n}.recipient`)
|
|
1776
|
+
}) : (l(e, `${n}.type`, "Expected channel."), { type: "channel", channelId: "" });
|
|
1371
1777
|
}
|
|
1372
|
-
function
|
|
1778
|
+
function mt(t, n, e) {
|
|
1373
1779
|
if (t == null)
|
|
1374
1780
|
return;
|
|
1375
1781
|
if (!Array.isArray(t)) {
|
|
1376
|
-
|
|
1782
|
+
l(e, n, "Expected an array.");
|
|
1377
1783
|
return;
|
|
1378
1784
|
}
|
|
1379
1785
|
const r = t.map(
|
|
1380
|
-
(o,
|
|
1786
|
+
(o, a) => V(o, a, e, n)
|
|
1381
1787
|
);
|
|
1382
1788
|
return r.length > 0 ? r : void 0;
|
|
1383
1789
|
}
|
|
1384
|
-
function
|
|
1790
|
+
function st(t, n, e) {
|
|
1385
1791
|
if (t == null)
|
|
1386
1792
|
return;
|
|
1387
1793
|
const r = g(t, n, e);
|
|
1388
|
-
|
|
1794
|
+
f(
|
|
1389
1795
|
r,
|
|
1390
1796
|
n,
|
|
1391
1797
|
[
|
|
@@ -1397,41 +1803,41 @@ function Ge(t, n, e) {
|
|
|
1397
1803
|
],
|
|
1398
1804
|
e
|
|
1399
1805
|
);
|
|
1400
|
-
const o =
|
|
1806
|
+
const o = mt(
|
|
1401
1807
|
r.threadMentions,
|
|
1402
1808
|
`${n}.threadMentions`,
|
|
1403
1809
|
e
|
|
1404
|
-
),
|
|
1810
|
+
), a = A(
|
|
1405
1811
|
r.postThreadDetail,
|
|
1406
1812
|
!0,
|
|
1407
1813
|
`${n}.postThreadDetail`,
|
|
1408
1814
|
e
|
|
1409
|
-
),
|
|
1815
|
+
), i = A(
|
|
1410
1816
|
r.includeDashboardLink,
|
|
1411
1817
|
!0,
|
|
1412
1818
|
`${n}.includeDashboardLink`,
|
|
1413
1819
|
e
|
|
1414
|
-
),
|
|
1820
|
+
), c = A(
|
|
1415
1821
|
r.includeBriefingLink,
|
|
1416
1822
|
!0,
|
|
1417
1823
|
`${n}.includeBriefingLink`,
|
|
1418
1824
|
e
|
|
1419
1825
|
);
|
|
1420
1826
|
return {
|
|
1421
|
-
destination:
|
|
1827
|
+
destination: dt(
|
|
1422
1828
|
r.destination,
|
|
1423
1829
|
`${n}.destination`,
|
|
1424
1830
|
e
|
|
1425
1831
|
),
|
|
1426
1832
|
...o ? { threadMentions: o } : {},
|
|
1427
|
-
...r.postThreadDetail !== void 0 ? { postThreadDetail:
|
|
1428
|
-
...r.includeDashboardLink !== void 0 ? { includeDashboardLink:
|
|
1429
|
-
...r.includeBriefingLink !== void 0 ? { includeBriefingLink:
|
|
1833
|
+
...r.postThreadDetail !== void 0 ? { postThreadDetail: a } : {},
|
|
1834
|
+
...r.includeDashboardLink !== void 0 ? { includeDashboardLink: i } : {},
|
|
1835
|
+
...r.includeBriefingLink !== void 0 ? { includeBriefingLink: c } : {}
|
|
1430
1836
|
};
|
|
1431
1837
|
}
|
|
1432
|
-
function
|
|
1838
|
+
function ft(t, n, e) {
|
|
1433
1839
|
const r = g(t, n, e);
|
|
1434
|
-
|
|
1840
|
+
f(
|
|
1435
1841
|
r,
|
|
1436
1842
|
n,
|
|
1437
1843
|
[
|
|
@@ -1445,110 +1851,110 @@ function He(t, n, e) {
|
|
|
1445
1851
|
],
|
|
1446
1852
|
e
|
|
1447
1853
|
);
|
|
1448
|
-
const o =
|
|
1854
|
+
const o = x(
|
|
1449
1855
|
r.formatProfile,
|
|
1450
1856
|
`${n}.formatProfile`,
|
|
1451
|
-
|
|
1857
|
+
Le,
|
|
1452
1858
|
"concise, balanced, or detailed",
|
|
1453
1859
|
e
|
|
1454
|
-
),
|
|
1860
|
+
), a = h(
|
|
1455
1861
|
r.subjectOverride,
|
|
1456
1862
|
`${n}.subjectOverride`,
|
|
1457
1863
|
500,
|
|
1458
1864
|
e
|
|
1459
|
-
),
|
|
1865
|
+
), i = h(
|
|
1460
1866
|
r.titleOverride,
|
|
1461
1867
|
`${n}.titleOverride`,
|
|
1462
1868
|
500,
|
|
1463
1869
|
e
|
|
1464
|
-
),
|
|
1870
|
+
), c = h(
|
|
1465
1871
|
r.summaryOverride,
|
|
1466
1872
|
`${n}.summaryOverride`,
|
|
1467
1873
|
2e3,
|
|
1468
1874
|
e
|
|
1469
|
-
),
|
|
1875
|
+
), d = A(
|
|
1470
1876
|
r.actionBlockVisible,
|
|
1471
1877
|
!0,
|
|
1472
1878
|
`${n}.actionBlockVisible`,
|
|
1473
1879
|
e
|
|
1474
|
-
),
|
|
1880
|
+
), m = lt(
|
|
1475
1881
|
r.webhookConfig,
|
|
1476
1882
|
`${n}.webhookConfig`,
|
|
1477
1883
|
e
|
|
1478
|
-
),
|
|
1884
|
+
), p = st(
|
|
1479
1885
|
r.slackConfig,
|
|
1480
1886
|
`${n}.slackConfig`,
|
|
1481
1887
|
e
|
|
1482
1888
|
);
|
|
1483
1889
|
return {
|
|
1484
1890
|
...o ? { formatProfile: o } : {},
|
|
1485
|
-
...
|
|
1486
|
-
...
|
|
1487
|
-
...
|
|
1488
|
-
...r.actionBlockVisible !== void 0 ? { actionBlockVisible:
|
|
1489
|
-
...
|
|
1490
|
-
...
|
|
1891
|
+
...a ? { subjectOverride: a } : {},
|
|
1892
|
+
...i ? { titleOverride: i } : {},
|
|
1893
|
+
...c ? { summaryOverride: c } : {},
|
|
1894
|
+
...r.actionBlockVisible !== void 0 ? { actionBlockVisible: d } : {},
|
|
1895
|
+
...p ? { slackConfig: p } : {},
|
|
1896
|
+
...m ? { webhookConfig: m } : {}
|
|
1491
1897
|
};
|
|
1492
1898
|
}
|
|
1493
|
-
function
|
|
1899
|
+
function pt(t, n) {
|
|
1494
1900
|
if (t == null)
|
|
1495
1901
|
return;
|
|
1496
1902
|
const e = g(t, "deliveryConfig.channelConfigs", n), r = {};
|
|
1497
|
-
return Object.entries(e).forEach(([o,
|
|
1498
|
-
if (!
|
|
1499
|
-
|
|
1903
|
+
return Object.entries(e).forEach(([o, a]) => {
|
|
1904
|
+
if (!ce(o)) {
|
|
1905
|
+
l(
|
|
1500
1906
|
n,
|
|
1501
1907
|
`deliveryConfig.channelConfigs.${o}`,
|
|
1502
1908
|
"Expected a supported delivery channel."
|
|
1503
1909
|
);
|
|
1504
1910
|
return;
|
|
1505
1911
|
}
|
|
1506
|
-
r[o] =
|
|
1507
|
-
|
|
1912
|
+
r[o] = ft(
|
|
1913
|
+
a,
|
|
1508
1914
|
`deliveryConfig.channelConfigs.${o}`,
|
|
1509
1915
|
n
|
|
1510
1916
|
);
|
|
1511
1917
|
}), Object.keys(r).length > 0 ? r : void 0;
|
|
1512
1918
|
}
|
|
1513
|
-
function
|
|
1514
|
-
var
|
|
1919
|
+
function ut(t, n) {
|
|
1920
|
+
var d, m, p;
|
|
1515
1921
|
if (t == null)
|
|
1516
1922
|
return null;
|
|
1517
1923
|
const e = g(t, "deliveryConfig", n);
|
|
1518
|
-
|
|
1924
|
+
f(
|
|
1519
1925
|
e,
|
|
1520
1926
|
"deliveryConfig",
|
|
1521
1927
|
["recipients", "channels", "channelConfigs"],
|
|
1522
1928
|
n
|
|
1523
1929
|
);
|
|
1524
|
-
const r =
|
|
1525
|
-
return
|
|
1526
|
-
(
|
|
1527
|
-
) && o.length === 0 &&
|
|
1930
|
+
const r = pt(e.channelConfigs, n), o = at(e.recipients, n), a = it(e.channels, n), i = ((m = (d = r == null ? void 0 : r.SLACK) == null ? void 0 : d.slackConfig) == null ? void 0 : m.destination.type) === "channel" && !!r.SLACK.slackConfig.destination.channelId.trim();
|
|
1931
|
+
return a.some(
|
|
1932
|
+
(v) => v !== "SLACK"
|
|
1933
|
+
) && o.length === 0 && l(
|
|
1528
1934
|
n,
|
|
1529
1935
|
"deliveryConfig.recipients",
|
|
1530
1936
|
"Add at least one recipient or remove delivery config."
|
|
1531
|
-
),
|
|
1937
|
+
), a.length === 0 && l(
|
|
1532
1938
|
n,
|
|
1533
1939
|
"deliveryConfig.channels",
|
|
1534
1940
|
"Choose at least one delivery channel or remove delivery config."
|
|
1535
|
-
),
|
|
1941
|
+
), a.includes("SLACK") && !i && l(
|
|
1536
1942
|
n,
|
|
1537
1943
|
"deliveryConfig.channelConfigs.SLACK.slackConfig.destination.channelId",
|
|
1538
1944
|
"Choose a Slack channel destination."
|
|
1539
|
-
), !
|
|
1945
|
+
), !a.includes("SLACK") && ((p = r == null ? void 0 : r.SLACK) != null && p.slackConfig) && l(
|
|
1540
1946
|
n,
|
|
1541
1947
|
"deliveryConfig.channelConfigs.SLACK",
|
|
1542
1948
|
"Slack config requires SLACK in deliveryConfig.channels."
|
|
1543
1949
|
), {
|
|
1544
1950
|
recipients: o,
|
|
1545
|
-
channels:
|
|
1951
|
+
channels: a,
|
|
1546
1952
|
...r ? { channelConfigs: r } : {}
|
|
1547
1953
|
};
|
|
1548
1954
|
}
|
|
1549
|
-
function
|
|
1955
|
+
function U(t) {
|
|
1550
1956
|
const n = [], e = g(t, "draft", n);
|
|
1551
|
-
|
|
1957
|
+
f(
|
|
1552
1958
|
e,
|
|
1553
1959
|
"draft",
|
|
1554
1960
|
[
|
|
@@ -1566,91 +1972,94 @@ function R(t) {
|
|
|
1566
1972
|
],
|
|
1567
1973
|
n
|
|
1568
1974
|
);
|
|
1569
|
-
const r =
|
|
1975
|
+
const r = u(
|
|
1570
1976
|
e.name,
|
|
1571
1977
|
"name",
|
|
1572
|
-
|
|
1978
|
+
s.name,
|
|
1573
1979
|
n
|
|
1574
1980
|
), o = h(
|
|
1575
1981
|
e.description,
|
|
1576
1982
|
"description",
|
|
1577
|
-
|
|
1983
|
+
s.description,
|
|
1578
1984
|
n
|
|
1579
|
-
) ?? null,
|
|
1580
|
-
return
|
|
1985
|
+
) ?? null, a = h(e.scheduleExpr, "scheduleExpr", 500, n) ?? null, i = h(e.timezone, "timezone", 200, n) ?? "UTC", c = Ke(e.status, n), d = Q(e.source, n), m = ee(e.body, n), p = re(e.attachments, n), v = te(e.presentation, n), b = oe(e.limits, n), y = ut(e.deliveryConfig, n);
|
|
1986
|
+
return ae(m, p, n), z(n), {
|
|
1581
1987
|
name: r,
|
|
1582
1988
|
description: o,
|
|
1583
|
-
status:
|
|
1584
|
-
scheduleExpr:
|
|
1585
|
-
timezone:
|
|
1586
|
-
source:
|
|
1587
|
-
body:
|
|
1588
|
-
attachments:
|
|
1589
|
-
presentation:
|
|
1590
|
-
...
|
|
1591
|
-
deliveryConfig:
|
|
1989
|
+
status: c,
|
|
1990
|
+
scheduleExpr: a,
|
|
1991
|
+
timezone: i,
|
|
1992
|
+
source: d,
|
|
1993
|
+
body: m,
|
|
1994
|
+
attachments: p,
|
|
1995
|
+
presentation: v,
|
|
1996
|
+
...b ? { limits: b } : {},
|
|
1997
|
+
deliveryConfig: y
|
|
1592
1998
|
};
|
|
1593
1999
|
}
|
|
1594
|
-
function
|
|
1595
|
-
return
|
|
2000
|
+
function Dt(t) {
|
|
2001
|
+
return U(t);
|
|
1596
2002
|
}
|
|
1597
|
-
function
|
|
1598
|
-
return
|
|
2003
|
+
function _t(t) {
|
|
2004
|
+
return U(t);
|
|
1599
2005
|
}
|
|
1600
|
-
function
|
|
2006
|
+
function Bt(t) {
|
|
1601
2007
|
try {
|
|
1602
|
-
return { valid: !0, value:
|
|
2008
|
+
return { valid: !0, value: U(t), issues: [] };
|
|
1603
2009
|
} catch (n) {
|
|
1604
|
-
if (n instanceof
|
|
2010
|
+
if (n instanceof D)
|
|
1605
2011
|
return { valid: !1, issues: n.issues };
|
|
1606
2012
|
throw n;
|
|
1607
2013
|
}
|
|
1608
2014
|
}
|
|
1609
|
-
function
|
|
2015
|
+
function Ft(t) {
|
|
1610
2016
|
try {
|
|
1611
|
-
return { valid: !0, value:
|
|
2017
|
+
return { valid: !0, value: ie(t), issues: [] };
|
|
1612
2018
|
} catch (n) {
|
|
1613
|
-
if (n instanceof
|
|
2019
|
+
if (n instanceof D)
|
|
1614
2020
|
return { valid: !1, issues: n.issues };
|
|
1615
2021
|
throw n;
|
|
1616
2022
|
}
|
|
1617
2023
|
}
|
|
1618
|
-
function
|
|
1619
|
-
return typeof t == "string" &&
|
|
2024
|
+
function Nt(t) {
|
|
2025
|
+
return typeof t == "string" && J.has(t);
|
|
1620
2026
|
}
|
|
1621
|
-
function
|
|
1622
|
-
return typeof t == "string" &&
|
|
2027
|
+
function ce(t) {
|
|
2028
|
+
return typeof t == "string" && Be.has(t);
|
|
1623
2029
|
}
|
|
1624
2030
|
export {
|
|
1625
|
-
|
|
1626
|
-
|
|
1627
|
-
|
|
1628
|
-
|
|
1629
|
-
|
|
1630
|
-
|
|
1631
|
-
|
|
1632
|
-
|
|
1633
|
-
|
|
1634
|
-
|
|
1635
|
-
|
|
1636
|
-
|
|
1637
|
-
|
|
1638
|
-
|
|
1639
|
-
|
|
1640
|
-
|
|
1641
|
-
|
|
1642
|
-
|
|
1643
|
-
|
|
1644
|
-
|
|
1645
|
-
|
|
1646
|
-
|
|
1647
|
-
|
|
1648
|
-
|
|
1649
|
-
|
|
1650
|
-
|
|
1651
|
-
|
|
1652
|
-
|
|
1653
|
-
|
|
1654
|
-
|
|
1655
|
-
|
|
2031
|
+
we as BRIEFING_ARTIFACT_FORMATS,
|
|
2032
|
+
$ as BRIEFING_CONTENT_LIMITS,
|
|
2033
|
+
O as BRIEFING_KIND,
|
|
2034
|
+
s as BRIEFING_TEXT_LIMITS,
|
|
2035
|
+
D as BriefingContractError,
|
|
2036
|
+
R as DEFAULT_BRIEFING_ARTIFACT_FORMATS,
|
|
2037
|
+
bt as DEFAULT_BRIEFING_SCHEDULE,
|
|
2038
|
+
_ as MAX_BRIEFING_ATTACHMENTS,
|
|
2039
|
+
wt as buildBriefingJobConfig,
|
|
2040
|
+
It as buildBriefingScheduleExpr,
|
|
2041
|
+
Dt as buildCreateBriefingRequest,
|
|
2042
|
+
_t as buildUpdateBriefingRequest,
|
|
2043
|
+
kt as canCreateBriefingForUser,
|
|
2044
|
+
Et as describeBriefingSchedule,
|
|
2045
|
+
At as formatBriefingComparisonValues,
|
|
2046
|
+
_e as formatBriefingDisplayValue,
|
|
2047
|
+
Ct as getBriefingCardAttachmentCapability,
|
|
2048
|
+
Te as getBriefingCardAttachmentFormats,
|
|
2049
|
+
Tt as getBriefingCreationIntents,
|
|
2050
|
+
Se as getBriefingDisplayTypeLabel,
|
|
2051
|
+
xt as getBriefingPresentation,
|
|
2052
|
+
xe as getDefaultBriefingCardAttachmentFormat,
|
|
2053
|
+
Nt as isBriefingArtifactFormat,
|
|
2054
|
+
ce as isBriefingDeliveryChannel,
|
|
2055
|
+
De as isBriefingNumericValue,
|
|
2056
|
+
Ae as isEmailOnlyBriefingDelivery,
|
|
2057
|
+
$t as isValidBriefingTimezone,
|
|
2058
|
+
Qe as normalizeBriefingContentDocument,
|
|
2059
|
+
U as normalizeBriefingDraft,
|
|
2060
|
+
ie as normalizeBriefingJobConfig,
|
|
2061
|
+
$e as parseBriefingScheduleExpr,
|
|
2062
|
+
St as validateBriefingContentDocument,
|
|
2063
|
+
Bt as validateBriefingDraft,
|
|
2064
|
+
Ft as validateBriefingJobConfig
|
|
1656
2065
|
};
|