react-semaphor 0.1.318 → 0.1.319
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/briefings/index.cjs +1 -1
- package/dist/briefings/index.js +497 -364
- package/dist/chunks/{calendar-preferences-dialog-DySStYHa.js → calendar-preferences-dialog-DLKB05SY.js} +1 -1
- package/dist/chunks/{calendar-preferences-dialog-DgpoCz1l.js → calendar-preferences-dialog-DPaVsZlk.js} +1 -1
- package/dist/chunks/{dashboard-briefing-launcher-BrUNYrwk.js → dashboard-briefing-launcher-DR_i0anv.js} +3164 -2537
- package/dist/chunks/dashboard-briefing-launcher-F3qKyuGr.js +106 -0
- package/dist/chunks/{dashboard-controls-BJb7QHvl.js → dashboard-controls-8J06Ot-K.js} +3 -3
- package/dist/chunks/{dashboard-controls-CDCpt8iB.js → dashboard-controls-BNAIucBl.js} +1 -1
- package/dist/chunks/{dashboard-json-BYEqzs6b.js → dashboard-json-B_Li7wO5.js} +1 -1
- package/dist/chunks/{dashboard-json-BjFw0Ktj.js → dashboard-json-DIsACFCO.js} +1 -1
- package/dist/chunks/{edit-dashboard-visual-IxtXVkBc.js → edit-dashboard-visual-2CBS2I52.js} +1 -1
- package/dist/chunks/{edit-dashboard-visual-VHlDJd5A.js → edit-dashboard-visual-BGnC2DH7.js} +3 -3
- package/dist/chunks/{index-CAWSZGCL.js → index-DYycYzpZ.js} +289 -288
- package/dist/chunks/{index-BhrZn1Zk.js → index-cxoegFH9.js} +75 -75
- package/dist/chunks/{resource-management-panel-X4zxZ4wq.js → resource-management-panel-BwNGxqrB.js} +1 -1
- package/dist/chunks/{resource-management-panel-0OlH_Gze.js → resource-management-panel-YtbKp2kW.js} +2 -2
- package/dist/chunks/{use-create-flow-overlay-state-DkZTa6eN.js → use-create-flow-overlay-state-DQZneUXL.js} +1 -1
- package/dist/chunks/{use-create-flow-overlay-state-WYyQFfGQ.js → use-create-flow-overlay-state-Qnd7FF6L.js} +2 -2
- package/dist/chunks/{use-visual-utils-2l8uDXRH.js → use-visual-utils-BdMhr0YR.js} +1 -1
- package/dist/chunks/{use-visual-utils-C8VR6_Cr.js → use-visual-utils-t73RlvjS.js} +1 -1
- package/dist/dashboard/index.cjs +1 -1
- package/dist/dashboard/index.js +1 -1
- package/dist/index.cjs +1 -1
- package/dist/index.js +5 -5
- package/dist/style.css +1 -1
- package/dist/surfboard/index.cjs +1 -1
- package/dist/surfboard/index.js +2 -2
- package/dist/types/briefings.d.ts +29 -1
- package/dist/types/main.d.ts +29 -1
- package/dist/types/types.d.ts +29 -1
- package/package.json +1 -1
- package/dist/chunks/dashboard-briefing-launcher-Fh6vC1S2.js +0 -101
package/dist/briefings/index.js
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
var
|
|
2
|
-
var G = (
|
|
3
|
-
var
|
|
4
|
-
const A = "BRIEFING",
|
|
1
|
+
var K = Object.defineProperty;
|
|
2
|
+
var G = (n, t, e) => t in n ? K(n, t, { enumerable: !0, configurable: !0, writable: !0, value: e }) : n[t] = e;
|
|
3
|
+
var D = (n, t, e) => G(n, typeof t != "symbol" ? t + "" : t, e);
|
|
4
|
+
const A = "BRIEFING", q = ["markdown", "html"], S = ["markdown"], Ie = 20, l = {
|
|
5
5
|
name: 500,
|
|
6
6
|
description: 2e3,
|
|
7
7
|
instruction: 5e4,
|
|
@@ -11,26 +11,33 @@ const A = "BRIEFING", U = ["markdown", "html"], v = ["markdown"], ue = 20, c = {
|
|
|
11
11
|
presentationTone: 500,
|
|
12
12
|
presentationFormat: 2e3,
|
|
13
13
|
id: 500
|
|
14
|
-
}, z = new Set(
|
|
14
|
+
}, z = new Set(q), H = /* @__PURE__ */ new Set([
|
|
15
15
|
"EMAIL",
|
|
16
16
|
"WEBHOOK",
|
|
17
17
|
"SLACK",
|
|
18
18
|
"IN_APP",
|
|
19
19
|
"TELEGRAM"
|
|
20
|
-
]),
|
|
20
|
+
]), C = {
|
|
21
21
|
maxToolCalls: { min: 1, max: 100 },
|
|
22
22
|
maxRows: { min: 1, max: 1e5 },
|
|
23
23
|
timeoutMs: { min: 1e3, max: 30 * 6e4 }
|
|
24
|
-
},
|
|
24
|
+
}, U = /* @__PURE__ */ new Set([
|
|
25
25
|
"letter",
|
|
26
26
|
"legal",
|
|
27
27
|
"a4",
|
|
28
28
|
"a3",
|
|
29
29
|
"tabloid"
|
|
30
|
-
]),
|
|
30
|
+
]), X = /* @__PURE__ */ new Set([
|
|
31
31
|
"portrait",
|
|
32
32
|
"landscape"
|
|
33
|
-
]),
|
|
33
|
+
]), J = /* @__PURE__ */ new Set([",", ";", " "]), W = /* @__PURE__ */ new Set([
|
|
34
|
+
"current",
|
|
35
|
+
"all"
|
|
36
|
+
]), Y = /* @__PURE__ */ new Set([
|
|
37
|
+
"concise",
|
|
38
|
+
"balanced",
|
|
39
|
+
"detailed"
|
|
40
|
+
]), Z = [
|
|
34
41
|
"pageSize",
|
|
35
42
|
"orientation",
|
|
36
43
|
"includeFilters",
|
|
@@ -55,112 +62,112 @@ const A = "BRIEFING", U = ["markdown", "html"], v = ["markdown"], ue = 20, c = {
|
|
|
55
62
|
"cardType",
|
|
56
63
|
"theme"
|
|
57
64
|
];
|
|
58
|
-
class
|
|
65
|
+
class T extends Error {
|
|
59
66
|
constructor(e) {
|
|
60
67
|
super(e.map((r) => `${r.field}: ${r.message}`).join("; "));
|
|
61
|
-
|
|
68
|
+
D(this, "issues");
|
|
62
69
|
this.name = "BriefingContractError", this.issues = e;
|
|
63
70
|
}
|
|
64
71
|
}
|
|
65
|
-
function
|
|
66
|
-
return typeof
|
|
72
|
+
function x(n) {
|
|
73
|
+
return typeof n == "object" && n !== null && !Array.isArray(n);
|
|
67
74
|
}
|
|
68
|
-
function
|
|
69
|
-
|
|
75
|
+
function c(n, t, e) {
|
|
76
|
+
n.push({ field: t, message: e });
|
|
70
77
|
}
|
|
71
|
-
function
|
|
72
|
-
return
|
|
78
|
+
function h(n, t, e) {
|
|
79
|
+
return x(n) ? n : (c(e, t, "Expected an object."), {});
|
|
73
80
|
}
|
|
74
|
-
function
|
|
81
|
+
function s(n, t, e, r) {
|
|
75
82
|
const o = new Set(e);
|
|
76
|
-
Object.keys(
|
|
77
|
-
o.has(i) ||
|
|
83
|
+
Object.keys(n).forEach((i) => {
|
|
84
|
+
o.has(i) || c(
|
|
78
85
|
r,
|
|
79
|
-
|
|
86
|
+
t ? `${t}.${i}` : i,
|
|
80
87
|
`Unexpected field "${i}".`
|
|
81
88
|
);
|
|
82
89
|
});
|
|
83
90
|
}
|
|
84
|
-
function
|
|
85
|
-
if (typeof
|
|
86
|
-
return
|
|
87
|
-
const o =
|
|
88
|
-
return o ? (o.length > e &&
|
|
91
|
+
function u(n, t, e, r) {
|
|
92
|
+
if (typeof n != "string")
|
|
93
|
+
return c(r, t, "Expected a string."), "";
|
|
94
|
+
const o = n.trim();
|
|
95
|
+
return o ? (o.length > e && c(r, t, `Must be ${e} characters or fewer.`), o) : (c(r, t, "Required value cannot be empty."), "");
|
|
89
96
|
}
|
|
90
|
-
function
|
|
91
|
-
if (
|
|
97
|
+
function p(n, t, e, r) {
|
|
98
|
+
if (n == null)
|
|
92
99
|
return;
|
|
93
|
-
if (typeof
|
|
94
|
-
|
|
100
|
+
if (typeof n != "string") {
|
|
101
|
+
c(r, t, "Expected a string.");
|
|
95
102
|
return;
|
|
96
103
|
}
|
|
97
|
-
const o =
|
|
104
|
+
const o = n.trim();
|
|
98
105
|
if (o)
|
|
99
|
-
return o.length > e &&
|
|
106
|
+
return o.length > e && c(r, t, `Must be ${e} characters or fewer.`), o;
|
|
100
107
|
}
|
|
101
|
-
function
|
|
102
|
-
return
|
|
108
|
+
function g(n, t, e, r) {
|
|
109
|
+
return n == null ? t : typeof n != "boolean" ? (c(r, e, "Expected a boolean."), t) : n;
|
|
103
110
|
}
|
|
104
|
-
function
|
|
105
|
-
return
|
|
111
|
+
function Q(n, t) {
|
|
112
|
+
return n == null ? "ACTIVE" : n === "ACTIVE" || n === "PAUSED" || n === "DISABLED" ? n : (c(t, "status", "Expected ACTIVE, PAUSED, or DISABLED."), "ACTIVE");
|
|
106
113
|
}
|
|
107
|
-
function
|
|
108
|
-
return
|
|
114
|
+
function ee(n) {
|
|
115
|
+
return n.includes("@") && n.includes(".") && !n.includes(" ");
|
|
109
116
|
}
|
|
110
|
-
function
|
|
111
|
-
if (
|
|
117
|
+
function B(n, t) {
|
|
118
|
+
if (n == null)
|
|
112
119
|
return { type: "project" };
|
|
113
|
-
const e =
|
|
114
|
-
return r === "project" ? (
|
|
120
|
+
const e = h(n, "source", t), r = e.type;
|
|
121
|
+
return r === "project" ? (s(e, "source", ["type"], t), { type: "project" }) : r === "dashboard" ? (s(e, "source", ["type", "dashboardId"], t), {
|
|
115
122
|
type: "dashboard",
|
|
116
|
-
dashboardId:
|
|
123
|
+
dashboardId: u(
|
|
117
124
|
e.dashboardId,
|
|
118
125
|
"source.dashboardId",
|
|
119
|
-
|
|
120
|
-
|
|
126
|
+
l.id,
|
|
127
|
+
t
|
|
121
128
|
)
|
|
122
|
-
}) : (
|
|
129
|
+
}) : (c(t, "source.type", "Expected project or dashboard."), { type: "project" });
|
|
123
130
|
}
|
|
124
|
-
function
|
|
125
|
-
const e =
|
|
126
|
-
return r === "generated_analysis" ? (
|
|
131
|
+
function F(n, t) {
|
|
132
|
+
const e = h(n, "body", t), r = e.type;
|
|
133
|
+
return r === "generated_analysis" ? (s(e, "body", ["type", "instruction"], t), {
|
|
127
134
|
type: "generated_analysis",
|
|
128
|
-
instruction:
|
|
135
|
+
instruction: u(
|
|
129
136
|
e.instruction,
|
|
130
137
|
"body.instruction",
|
|
131
|
-
|
|
132
|
-
|
|
138
|
+
l.instruction,
|
|
139
|
+
t
|
|
133
140
|
)
|
|
134
|
-
}) : r === "custom_message" ? (
|
|
141
|
+
}) : r === "custom_message" ? (s(e, "body", ["type", "message"], t), {
|
|
135
142
|
type: "custom_message",
|
|
136
|
-
message:
|
|
143
|
+
message: u(
|
|
137
144
|
e.message,
|
|
138
145
|
"body.message",
|
|
139
|
-
|
|
140
|
-
|
|
146
|
+
l.customMessage,
|
|
147
|
+
t
|
|
141
148
|
)
|
|
142
|
-
}) : r === "none" ? (
|
|
143
|
-
|
|
149
|
+
}) : r === "none" ? (s(e, "body", ["type"], t), { type: "none" }) : (c(
|
|
150
|
+
t,
|
|
144
151
|
"body.type",
|
|
145
152
|
"Expected generated_analysis, custom_message, or none."
|
|
146
153
|
), { type: "none" });
|
|
147
154
|
}
|
|
148
|
-
function
|
|
149
|
-
if (
|
|
150
|
-
return [...
|
|
151
|
-
if (!Array.isArray(
|
|
152
|
-
return
|
|
153
|
-
if (
|
|
154
|
-
return
|
|
155
|
-
|
|
155
|
+
function te(n, t) {
|
|
156
|
+
if (n == null)
|
|
157
|
+
return [...S];
|
|
158
|
+
if (!Array.isArray(n))
|
|
159
|
+
return c(t, "presentation.artifactFormats", "Expected an array."), [...S];
|
|
160
|
+
if (n.length === 0)
|
|
161
|
+
return c(
|
|
162
|
+
t,
|
|
156
163
|
"presentation.artifactFormats",
|
|
157
164
|
"Choose at least one artifact format."
|
|
158
165
|
), [];
|
|
159
166
|
const e = [];
|
|
160
|
-
return
|
|
167
|
+
return n.forEach((r, o) => {
|
|
161
168
|
if (typeof r != "string" || !z.has(r)) {
|
|
162
|
-
|
|
163
|
-
|
|
169
|
+
c(
|
|
170
|
+
t,
|
|
164
171
|
`presentation.artifactFormats.${o}`,
|
|
165
172
|
"Expected markdown or html."
|
|
166
173
|
);
|
|
@@ -169,125 +176,125 @@ function Z(t, n) {
|
|
|
169
176
|
e.includes(r) || e.push(r);
|
|
170
177
|
}), e;
|
|
171
178
|
}
|
|
172
|
-
function
|
|
173
|
-
if (
|
|
179
|
+
function O(n, t) {
|
|
180
|
+
if (n == null)
|
|
174
181
|
return {
|
|
175
|
-
artifactFormats: [...
|
|
182
|
+
artifactFormats: [...S],
|
|
176
183
|
includeEvidence: !0,
|
|
177
184
|
includeSql: !0
|
|
178
185
|
};
|
|
179
|
-
const e =
|
|
180
|
-
|
|
186
|
+
const e = h(n, "presentation", t);
|
|
187
|
+
s(
|
|
181
188
|
e,
|
|
182
189
|
"presentation",
|
|
183
190
|
["artifactFormats", "includeEvidence", "includeSql", "audience", "tone", "format"],
|
|
184
|
-
|
|
191
|
+
t
|
|
185
192
|
);
|
|
186
193
|
const r = {
|
|
187
|
-
artifactFormats:
|
|
188
|
-
includeEvidence:
|
|
194
|
+
artifactFormats: te(e.artifactFormats, t),
|
|
195
|
+
includeEvidence: g(
|
|
189
196
|
e.includeEvidence,
|
|
190
197
|
!0,
|
|
191
198
|
"presentation.includeEvidence",
|
|
192
|
-
|
|
199
|
+
t
|
|
193
200
|
),
|
|
194
|
-
includeSql:
|
|
201
|
+
includeSql: g(
|
|
195
202
|
e.includeSql,
|
|
196
203
|
!0,
|
|
197
204
|
"presentation.includeSql",
|
|
198
|
-
|
|
205
|
+
t
|
|
199
206
|
)
|
|
200
|
-
}, o =
|
|
207
|
+
}, o = p(
|
|
201
208
|
e.audience,
|
|
202
209
|
"presentation.audience",
|
|
203
|
-
|
|
204
|
-
|
|
205
|
-
), i =
|
|
210
|
+
l.presentationAudience,
|
|
211
|
+
t
|
|
212
|
+
), i = p(
|
|
206
213
|
e.tone,
|
|
207
214
|
"presentation.tone",
|
|
208
|
-
|
|
209
|
-
|
|
210
|
-
), a =
|
|
215
|
+
l.presentationTone,
|
|
216
|
+
t
|
|
217
|
+
), a = p(
|
|
211
218
|
e.format,
|
|
212
219
|
"presentation.format",
|
|
213
|
-
|
|
214
|
-
|
|
220
|
+
l.presentationFormat,
|
|
221
|
+
t
|
|
215
222
|
);
|
|
216
223
|
return o && (r.audience = o), i && (r.tone = i), a && (r.format = a), r;
|
|
217
224
|
}
|
|
218
|
-
function
|
|
219
|
-
return typeof
|
|
225
|
+
function I(n, t, e, r) {
|
|
226
|
+
return typeof n == "string" && e.includes(n) ? n : (c(r, t, `Expected ${e.join(" or ")}.`), e[0]);
|
|
220
227
|
}
|
|
221
|
-
function
|
|
222
|
-
if (
|
|
223
|
-
if (typeof
|
|
224
|
-
return
|
|
225
|
-
|
|
228
|
+
function b(n, t, e, r, o) {
|
|
229
|
+
if (n != null) {
|
|
230
|
+
if (typeof n == "string" && e.has(n))
|
|
231
|
+
return n;
|
|
232
|
+
c(o, t, `Expected ${r}.`);
|
|
226
233
|
}
|
|
227
234
|
}
|
|
228
|
-
function
|
|
229
|
-
if (
|
|
230
|
-
if (!Array.isArray(
|
|
231
|
-
|
|
235
|
+
function ne(n, t, e) {
|
|
236
|
+
if (n != null) {
|
|
237
|
+
if (!Array.isArray(n)) {
|
|
238
|
+
c(e, t, "Expected an array.");
|
|
232
239
|
return;
|
|
233
240
|
}
|
|
234
|
-
return
|
|
241
|
+
return n;
|
|
235
242
|
}
|
|
236
243
|
}
|
|
237
|
-
function
|
|
238
|
-
if (
|
|
239
|
-
if (!
|
|
240
|
-
|
|
244
|
+
function re(n, t, e) {
|
|
245
|
+
if (n != null) {
|
|
246
|
+
if (!x(n)) {
|
|
247
|
+
c(e, t, "Expected an object.");
|
|
241
248
|
return;
|
|
242
249
|
}
|
|
243
|
-
return
|
|
250
|
+
return n;
|
|
244
251
|
}
|
|
245
252
|
}
|
|
246
|
-
function
|
|
247
|
-
if (
|
|
253
|
+
function oe(n, t, e) {
|
|
254
|
+
if (n == null)
|
|
248
255
|
return;
|
|
249
|
-
const r =
|
|
250
|
-
|
|
251
|
-
const o = {}, i =
|
|
256
|
+
const r = h(n, t, e);
|
|
257
|
+
s(r, t, Z, e);
|
|
258
|
+
const o = {}, i = b(
|
|
252
259
|
r.pageSize,
|
|
253
|
-
`${
|
|
254
|
-
|
|
260
|
+
`${t}.pageSize`,
|
|
261
|
+
U,
|
|
255
262
|
"letter, legal, a4, a3, or tabloid",
|
|
256
263
|
e
|
|
257
|
-
), a =
|
|
264
|
+
), a = b(
|
|
258
265
|
r.orientation,
|
|
259
|
-
`${
|
|
260
|
-
|
|
266
|
+
`${t}.orientation`,
|
|
267
|
+
X,
|
|
261
268
|
"portrait or landscape",
|
|
262
269
|
e
|
|
263
|
-
),
|
|
270
|
+
), f = b(
|
|
264
271
|
r.delimiter,
|
|
265
|
-
`${
|
|
266
|
-
|
|
272
|
+
`${t}.delimiter`,
|
|
273
|
+
J,
|
|
267
274
|
"comma, semicolon, or tab",
|
|
268
275
|
e
|
|
269
|
-
), y =
|
|
276
|
+
), y = b(
|
|
270
277
|
r.sheetSelection,
|
|
271
|
-
`${
|
|
272
|
-
|
|
278
|
+
`${t}.sheetSelection`,
|
|
279
|
+
W,
|
|
273
280
|
"current or all",
|
|
274
281
|
e
|
|
275
282
|
);
|
|
276
|
-
i && (o.pageSize = i), a && (o.orientation = a),
|
|
277
|
-
for (const
|
|
283
|
+
i && (o.pageSize = i), a && (o.orientation = a), f && (o.delimiter = f), y && (o.sheetSelection = y);
|
|
284
|
+
for (const d of [
|
|
278
285
|
"includeFilters",
|
|
279
286
|
"includeTimestamp",
|
|
280
287
|
"includeHeaders",
|
|
281
288
|
"useFormattedValues"
|
|
282
289
|
])
|
|
283
|
-
if (!(r[
|
|
284
|
-
if (typeof r[
|
|
285
|
-
|
|
290
|
+
if (!(r[d] === void 0 || r[d] === null)) {
|
|
291
|
+
if (typeof r[d] != "boolean") {
|
|
292
|
+
c(e, `${t}.${d}`, "Expected a boolean.");
|
|
286
293
|
continue;
|
|
287
294
|
}
|
|
288
|
-
o[
|
|
295
|
+
o[d] = r[d];
|
|
289
296
|
}
|
|
290
|
-
for (const
|
|
297
|
+
for (const d of [
|
|
291
298
|
"currentSheetId",
|
|
292
299
|
"currentSheetName",
|
|
293
300
|
"filterLine",
|
|
@@ -295,15 +302,15 @@ function te(t, n, e) {
|
|
|
295
302
|
"cardType",
|
|
296
303
|
"theme"
|
|
297
304
|
]) {
|
|
298
|
-
const
|
|
299
|
-
r[
|
|
300
|
-
`${
|
|
301
|
-
|
|
305
|
+
const m = p(
|
|
306
|
+
r[d],
|
|
307
|
+
`${t}.${d}`,
|
|
308
|
+
l.id,
|
|
302
309
|
e
|
|
303
310
|
);
|
|
304
|
-
|
|
311
|
+
m && (o[d] = m);
|
|
305
312
|
}
|
|
306
|
-
for (const
|
|
313
|
+
for (const d of [
|
|
307
314
|
"filterValues",
|
|
308
315
|
"inlineFilterValues",
|
|
309
316
|
"sheetFilterValues",
|
|
@@ -311,111 +318,111 @@ function te(t, n, e) {
|
|
|
311
318
|
"cardControlDefinitions",
|
|
312
319
|
"controlBindings"
|
|
313
320
|
]) {
|
|
314
|
-
const
|
|
315
|
-
|
|
321
|
+
const m = ne(r[d], `${t}.${d}`, e);
|
|
322
|
+
m && (o[d] = m);
|
|
316
323
|
}
|
|
317
|
-
for (const
|
|
324
|
+
for (const d of [
|
|
318
325
|
"controlValues",
|
|
319
326
|
"tablePreferences",
|
|
320
327
|
"dashboardInputExecutionSnapshot"
|
|
321
328
|
]) {
|
|
322
|
-
const
|
|
323
|
-
|
|
329
|
+
const m = re(r[d], `${t}.${d}`, e);
|
|
330
|
+
m && (o[d] = m);
|
|
324
331
|
}
|
|
325
332
|
return Object.keys(o).length > 0 ? o : void 0;
|
|
326
333
|
}
|
|
327
|
-
function
|
|
328
|
-
const o =
|
|
329
|
-
|
|
334
|
+
function E(n, t, e, r) {
|
|
335
|
+
const o = p(
|
|
336
|
+
t,
|
|
330
337
|
e,
|
|
331
|
-
|
|
338
|
+
l.attachmentTitle,
|
|
332
339
|
r
|
|
333
340
|
);
|
|
334
|
-
return o && (
|
|
341
|
+
return o && (n.title = o), n;
|
|
335
342
|
}
|
|
336
|
-
function
|
|
337
|
-
const o =
|
|
338
|
-
return o && (
|
|
343
|
+
function $(n, t, e, r) {
|
|
344
|
+
const o = oe(t, e, r);
|
|
345
|
+
return o && (n.settings = o), n;
|
|
339
346
|
}
|
|
340
|
-
function
|
|
341
|
-
const r = `attachments.${
|
|
347
|
+
function ie(n, t, e) {
|
|
348
|
+
const r = `attachments.${t}`, o = h(n, r, e), i = o.type;
|
|
342
349
|
if (i === "dashboard") {
|
|
343
|
-
|
|
350
|
+
s(
|
|
344
351
|
o,
|
|
345
352
|
r,
|
|
346
353
|
["type", "dashboardId", "format", "title", "settings"],
|
|
347
354
|
e
|
|
348
355
|
);
|
|
349
|
-
const a =
|
|
356
|
+
const a = E(
|
|
350
357
|
{
|
|
351
358
|
type: "dashboard",
|
|
352
|
-
dashboardId:
|
|
359
|
+
dashboardId: u(
|
|
353
360
|
o.dashboardId,
|
|
354
361
|
`${r}.dashboardId`,
|
|
355
|
-
|
|
362
|
+
l.id,
|
|
356
363
|
e
|
|
357
364
|
),
|
|
358
|
-
format:
|
|
365
|
+
format: I(o.format, `${r}.format`, ["pdf"], e)
|
|
359
366
|
},
|
|
360
367
|
o.title,
|
|
361
368
|
`${r}.title`,
|
|
362
369
|
e
|
|
363
370
|
);
|
|
364
|
-
return
|
|
371
|
+
return $(a, o.settings, `${r}.settings`, e);
|
|
365
372
|
}
|
|
366
373
|
if (i === "dashboard_sheet" || i === "document_sheet") {
|
|
367
|
-
|
|
374
|
+
s(
|
|
368
375
|
o,
|
|
369
376
|
r,
|
|
370
377
|
["type", "dashboardId", "sheetId", "format", "title", "settings"],
|
|
371
378
|
e
|
|
372
379
|
);
|
|
373
|
-
const a =
|
|
380
|
+
const a = E(
|
|
374
381
|
{
|
|
375
382
|
type: i,
|
|
376
|
-
dashboardId:
|
|
383
|
+
dashboardId: u(
|
|
377
384
|
o.dashboardId,
|
|
378
385
|
`${r}.dashboardId`,
|
|
379
|
-
|
|
386
|
+
l.id,
|
|
380
387
|
e
|
|
381
388
|
),
|
|
382
|
-
sheetId:
|
|
389
|
+
sheetId: u(
|
|
383
390
|
o.sheetId,
|
|
384
391
|
`${r}.sheetId`,
|
|
385
|
-
|
|
392
|
+
l.id,
|
|
386
393
|
e
|
|
387
394
|
),
|
|
388
|
-
format:
|
|
395
|
+
format: I(o.format, `${r}.format`, ["pdf"], e)
|
|
389
396
|
},
|
|
390
397
|
o.title,
|
|
391
398
|
`${r}.title`,
|
|
392
399
|
e
|
|
393
400
|
);
|
|
394
|
-
return
|
|
401
|
+
return $(a, o.settings, `${r}.settings`, e);
|
|
395
402
|
}
|
|
396
403
|
if (i === "visual") {
|
|
397
|
-
|
|
404
|
+
s(
|
|
398
405
|
o,
|
|
399
406
|
r,
|
|
400
407
|
["type", "dashboardId", "visualId", "format", "title", "settings"],
|
|
401
408
|
e
|
|
402
409
|
);
|
|
403
|
-
const a =
|
|
410
|
+
const a = E(
|
|
404
411
|
{
|
|
405
412
|
type: "visual",
|
|
406
|
-
dashboardId:
|
|
413
|
+
dashboardId: u(
|
|
407
414
|
o.dashboardId,
|
|
408
415
|
`${r}.dashboardId`,
|
|
409
|
-
|
|
416
|
+
l.id,
|
|
410
417
|
e
|
|
411
418
|
),
|
|
412
|
-
visualId:
|
|
419
|
+
visualId: u(
|
|
413
420
|
o.visualId,
|
|
414
421
|
`${r}.visualId`,
|
|
415
|
-
|
|
422
|
+
l.id,
|
|
416
423
|
e
|
|
417
424
|
),
|
|
418
|
-
format:
|
|
425
|
+
format: I(
|
|
419
426
|
o.format,
|
|
420
427
|
`${r}.format`,
|
|
421
428
|
["pdf", "png"],
|
|
@@ -426,31 +433,31 @@ function ne(t, n, e) {
|
|
|
426
433
|
`${r}.title`,
|
|
427
434
|
e
|
|
428
435
|
);
|
|
429
|
-
return
|
|
436
|
+
return $(a, o.settings, `${r}.settings`, e);
|
|
430
437
|
}
|
|
431
438
|
if (i === "card") {
|
|
432
|
-
|
|
439
|
+
s(
|
|
433
440
|
o,
|
|
434
441
|
r,
|
|
435
442
|
["type", "dashboardId", "cardId", "format", "title", "settings"],
|
|
436
443
|
e
|
|
437
444
|
);
|
|
438
|
-
const a =
|
|
445
|
+
const a = E(
|
|
439
446
|
{
|
|
440
447
|
type: "card",
|
|
441
|
-
dashboardId:
|
|
448
|
+
dashboardId: u(
|
|
442
449
|
o.dashboardId,
|
|
443
450
|
`${r}.dashboardId`,
|
|
444
|
-
|
|
451
|
+
l.id,
|
|
445
452
|
e
|
|
446
453
|
),
|
|
447
|
-
cardId:
|
|
454
|
+
cardId: u(
|
|
448
455
|
o.cardId,
|
|
449
456
|
`${r}.cardId`,
|
|
450
|
-
|
|
457
|
+
l.id,
|
|
451
458
|
e
|
|
452
459
|
),
|
|
453
|
-
format:
|
|
460
|
+
format: I(
|
|
454
461
|
o.format,
|
|
455
462
|
`${r}.format`,
|
|
456
463
|
["csv", "pdf", "png"],
|
|
@@ -461,57 +468,57 @@ function ne(t, n, e) {
|
|
|
461
468
|
`${r}.title`,
|
|
462
469
|
e
|
|
463
470
|
);
|
|
464
|
-
return
|
|
471
|
+
return $(a, o.settings, `${r}.settings`, e);
|
|
465
472
|
}
|
|
466
|
-
return
|
|
473
|
+
return c(
|
|
467
474
|
e,
|
|
468
475
|
`${r}.type`,
|
|
469
476
|
"Expected dashboard, dashboard_sheet, document_sheet, visual, or card."
|
|
470
477
|
), { type: "dashboard", dashboardId: "", format: "pdf" };
|
|
471
478
|
}
|
|
472
|
-
function
|
|
473
|
-
switch (
|
|
479
|
+
function ae(n) {
|
|
480
|
+
switch (n.type) {
|
|
474
481
|
case "dashboard":
|
|
475
|
-
return `${
|
|
482
|
+
return `${n.type}:${n.dashboardId}:${n.format}`;
|
|
476
483
|
case "dashboard_sheet":
|
|
477
484
|
case "document_sheet":
|
|
478
|
-
return `${
|
|
485
|
+
return `${n.type}:${n.dashboardId}:${n.sheetId}:${n.format}`;
|
|
479
486
|
case "visual":
|
|
480
|
-
return `${
|
|
487
|
+
return `${n.type}:${n.dashboardId}:${n.visualId}:${n.format}`;
|
|
481
488
|
case "card":
|
|
482
|
-
return `${
|
|
489
|
+
return `${n.type}:${n.dashboardId}:${n.cardId}:${n.format}`;
|
|
483
490
|
}
|
|
484
491
|
}
|
|
485
|
-
function
|
|
486
|
-
if (
|
|
492
|
+
function R(n, t) {
|
|
493
|
+
if (n == null)
|
|
487
494
|
return [];
|
|
488
|
-
if (!Array.isArray(
|
|
489
|
-
return
|
|
490
|
-
|
|
491
|
-
|
|
495
|
+
if (!Array.isArray(n))
|
|
496
|
+
return c(t, "attachments", "Expected an array."), [];
|
|
497
|
+
n.length > 20 && c(
|
|
498
|
+
t,
|
|
492
499
|
"attachments",
|
|
493
500
|
"Choose 20 attachments or fewer."
|
|
494
501
|
);
|
|
495
|
-
const e =
|
|
502
|
+
const e = n.slice(0, 20).map((o, i) => ie(o, i, t)), r = /* @__PURE__ */ new Set();
|
|
496
503
|
return e.forEach((o, i) => {
|
|
497
|
-
const a =
|
|
498
|
-
r.has(a) &&
|
|
504
|
+
const a = ae(o);
|
|
505
|
+
r.has(a) && c(t, `attachments.${i}`, "Duplicate attachment."), r.add(a);
|
|
499
506
|
}), e;
|
|
500
507
|
}
|
|
501
|
-
function
|
|
502
|
-
if (
|
|
508
|
+
function M(n, t) {
|
|
509
|
+
if (n == null)
|
|
503
510
|
return;
|
|
504
|
-
const e =
|
|
505
|
-
|
|
511
|
+
const e = h(n, "limits", t);
|
|
512
|
+
s(e, "limits", Object.keys(C), t);
|
|
506
513
|
const r = {};
|
|
507
|
-
return Object.keys(
|
|
514
|
+
return Object.keys(C).forEach((o) => {
|
|
508
515
|
const i = e[o];
|
|
509
516
|
if (i == null)
|
|
510
517
|
return;
|
|
511
|
-
const a =
|
|
518
|
+
const a = C[o];
|
|
512
519
|
if (typeof i != "number" || !Number.isInteger(i) || i < a.min || i > a.max) {
|
|
513
|
-
|
|
514
|
-
|
|
520
|
+
c(
|
|
521
|
+
t,
|
|
515
522
|
`limits.${o}`,
|
|
516
523
|
`Expected an integer between ${a.min} and ${a.max}.`
|
|
517
524
|
);
|
|
@@ -520,105 +527,105 @@ function V(t, n) {
|
|
|
520
527
|
r[o] = i;
|
|
521
528
|
}), Object.keys(r).length > 0 ? r : void 0;
|
|
522
529
|
}
|
|
523
|
-
function N(
|
|
524
|
-
if (
|
|
525
|
-
throw new
|
|
530
|
+
function N(n) {
|
|
531
|
+
if (n.length > 0)
|
|
532
|
+
throw new T(n);
|
|
526
533
|
}
|
|
527
|
-
function
|
|
528
|
-
|
|
534
|
+
function V(n, t, e) {
|
|
535
|
+
n.type === "none" && t.length === 0 && c(
|
|
529
536
|
e,
|
|
530
537
|
"body",
|
|
531
538
|
"Add briefing instructions, a custom message, or at least one attachment."
|
|
532
539
|
);
|
|
533
540
|
}
|
|
534
|
-
function
|
|
535
|
-
const
|
|
536
|
-
|
|
541
|
+
function P(n) {
|
|
542
|
+
const t = [], e = h(n, "jobConfig", t);
|
|
543
|
+
s(
|
|
537
544
|
e,
|
|
538
545
|
"jobConfig",
|
|
539
546
|
["kind", "source", "body", "attachments", "presentation", "limits"],
|
|
540
|
-
|
|
541
|
-
), e.kind !== A &&
|
|
542
|
-
const r =
|
|
543
|
-
return
|
|
547
|
+
t
|
|
548
|
+
), e.kind !== A && c(t, "kind", "Expected BRIEFING.");
|
|
549
|
+
const r = B(e.source, t), o = F(e.body, t), i = R(e.attachments, t), a = O(e.presentation, t), f = M(e.limits, t);
|
|
550
|
+
return V(o, i, t), N(t), {
|
|
544
551
|
kind: A,
|
|
545
552
|
source: r,
|
|
546
553
|
body: o,
|
|
547
554
|
attachments: i,
|
|
548
555
|
presentation: a,
|
|
549
|
-
...
|
|
556
|
+
...f ? { limits: f } : {}
|
|
550
557
|
};
|
|
551
558
|
}
|
|
552
|
-
function
|
|
553
|
-
return
|
|
554
|
-
...
|
|
559
|
+
function be(n) {
|
|
560
|
+
return P({
|
|
561
|
+
...n,
|
|
555
562
|
kind: A
|
|
556
563
|
});
|
|
557
564
|
}
|
|
558
|
-
function
|
|
559
|
-
const
|
|
560
|
-
if (
|
|
561
|
-
|
|
562
|
-
const
|
|
563
|
-
|
|
564
|
-
`${
|
|
565
|
-
|
|
565
|
+
function _(n, t, e, r = "deliveryConfig.recipients") {
|
|
566
|
+
const o = `${r}.${t}`, i = h(n, o, e), a = i.type;
|
|
567
|
+
if (a === "email") {
|
|
568
|
+
s(i, o, ["type", "address", "name"], e);
|
|
569
|
+
const f = u(
|
|
570
|
+
i.address,
|
|
571
|
+
`${o}.address`,
|
|
572
|
+
l.id,
|
|
566
573
|
e
|
|
567
|
-
),
|
|
568
|
-
|
|
569
|
-
`${
|
|
570
|
-
|
|
574
|
+
), y = p(
|
|
575
|
+
i.name,
|
|
576
|
+
`${o}.name`,
|
|
577
|
+
l.attachmentTitle,
|
|
571
578
|
e
|
|
572
579
|
);
|
|
573
|
-
return
|
|
580
|
+
return f && !ee(f) && c(e, `${o}.address`, "Email address is invalid."), {
|
|
574
581
|
type: "email",
|
|
575
|
-
address:
|
|
576
|
-
...
|
|
582
|
+
address: f,
|
|
583
|
+
...y ? { name: y } : {}
|
|
577
584
|
};
|
|
578
585
|
}
|
|
579
|
-
return
|
|
586
|
+
return a === "user" ? (s(i, o, ["type", "userId"], e), {
|
|
580
587
|
type: "user",
|
|
581
|
-
userId:
|
|
582
|
-
|
|
583
|
-
`${
|
|
584
|
-
|
|
588
|
+
userId: u(
|
|
589
|
+
i.userId,
|
|
590
|
+
`${o}.userId`,
|
|
591
|
+
l.id,
|
|
585
592
|
e
|
|
586
593
|
)
|
|
587
|
-
}) :
|
|
594
|
+
}) : a === "tenant_user" ? (s(i, o, ["type", "tenantUserId"], e), {
|
|
588
595
|
type: "tenant_user",
|
|
589
|
-
tenantUserId:
|
|
590
|
-
|
|
591
|
-
`${
|
|
592
|
-
|
|
596
|
+
tenantUserId: u(
|
|
597
|
+
i.tenantUserId,
|
|
598
|
+
`${o}.tenantUserId`,
|
|
599
|
+
l.id,
|
|
593
600
|
e
|
|
594
601
|
)
|
|
595
|
-
}) :
|
|
602
|
+
}) : a === "group" ? (s(i, o, ["type", "groupId"], e), {
|
|
596
603
|
type: "group",
|
|
597
|
-
groupId:
|
|
598
|
-
|
|
599
|
-
`${
|
|
600
|
-
|
|
604
|
+
groupId: u(
|
|
605
|
+
i.groupId,
|
|
606
|
+
`${o}.groupId`,
|
|
607
|
+
l.id,
|
|
601
608
|
e
|
|
602
609
|
)
|
|
603
|
-
}) : (
|
|
610
|
+
}) : (c(
|
|
604
611
|
e,
|
|
605
|
-
`${
|
|
612
|
+
`${o}.type`,
|
|
606
613
|
"Expected email, user, tenant_user, or group."
|
|
607
614
|
), { type: "email", address: "" });
|
|
608
615
|
}
|
|
609
|
-
function
|
|
610
|
-
return Array.isArray(
|
|
611
|
-
(e, r) =>
|
|
612
|
-
) : (
|
|
616
|
+
function ce(n, t) {
|
|
617
|
+
return n == null ? [] : Array.isArray(n) ? n.map(
|
|
618
|
+
(e, r) => _(e, r, t)
|
|
619
|
+
) : (c(t, "deliveryConfig.recipients", "Expected an array."), []);
|
|
613
620
|
}
|
|
614
|
-
function
|
|
615
|
-
if (!Array.isArray(
|
|
616
|
-
return
|
|
621
|
+
function de(n, t) {
|
|
622
|
+
if (!Array.isArray(n))
|
|
623
|
+
return c(t, "deliveryConfig.channels", "Expected an array."), [];
|
|
617
624
|
const e = [];
|
|
618
|
-
return
|
|
619
|
-
if (!
|
|
620
|
-
|
|
621
|
-
|
|
625
|
+
return n.forEach((r, o) => {
|
|
626
|
+
if (!w(r)) {
|
|
627
|
+
c(
|
|
628
|
+
t,
|
|
622
629
|
`deliveryConfig.channels.${o}`,
|
|
623
630
|
"Expected EMAIL, WEBHOOK, SLACK, IN_APP, or TELEGRAM."
|
|
624
631
|
);
|
|
@@ -627,136 +634,262 @@ function ae(t, n) {
|
|
|
627
634
|
e.includes(r) || e.push(r);
|
|
628
635
|
}), e;
|
|
629
636
|
}
|
|
630
|
-
function
|
|
631
|
-
if (
|
|
637
|
+
function le(n, t, e) {
|
|
638
|
+
if (n == null)
|
|
632
639
|
return;
|
|
633
|
-
const r =
|
|
640
|
+
const r = h(n, t, e), o = {};
|
|
634
641
|
return Object.entries(r).forEach(([i, a]) => {
|
|
635
642
|
if (typeof a != "string") {
|
|
636
|
-
|
|
643
|
+
c(e, `${t}.${i}`, "Expected a string.");
|
|
637
644
|
return;
|
|
638
645
|
}
|
|
639
646
|
o[i] = a.trim();
|
|
640
647
|
}), Object.keys(o).length > 0 ? o : void 0;
|
|
641
648
|
}
|
|
642
|
-
function
|
|
643
|
-
if (
|
|
649
|
+
function se(n, t, e) {
|
|
650
|
+
if (n == null)
|
|
644
651
|
return;
|
|
645
|
-
const r =
|
|
646
|
-
|
|
652
|
+
const r = h(n, t, e);
|
|
653
|
+
s(
|
|
647
654
|
r,
|
|
648
|
-
|
|
655
|
+
t,
|
|
649
656
|
["url", "method", "headers", "secretEncrypted"],
|
|
650
657
|
e
|
|
651
658
|
);
|
|
652
|
-
const o = r.method === void 0 || r.method === null ? void 0 :
|
|
659
|
+
const o = r.method === void 0 || r.method === null ? void 0 : I(r.method, `${t}.method`, ["POST", "PUT"], e), i = le(r.headers, `${t}.headers`, e), a = p(
|
|
653
660
|
r.secretEncrypted,
|
|
654
|
-
`${
|
|
661
|
+
`${t}.secretEncrypted`,
|
|
655
662
|
2e3,
|
|
656
663
|
e
|
|
657
664
|
);
|
|
658
665
|
return {
|
|
659
|
-
url:
|
|
666
|
+
url: u(r.url, `${t}.url`, 2e3, e),
|
|
660
667
|
...o ? { method: o } : {},
|
|
661
668
|
...i ? { headers: i } : {},
|
|
662
669
|
...a ? { secretEncrypted: a } : {}
|
|
663
670
|
};
|
|
664
671
|
}
|
|
665
|
-
function
|
|
666
|
-
const r =
|
|
667
|
-
|
|
672
|
+
function fe(n, t, e) {
|
|
673
|
+
const r = h(n, t, e), o = r.type;
|
|
674
|
+
if (o === "channel") {
|
|
675
|
+
s(
|
|
676
|
+
r,
|
|
677
|
+
t,
|
|
678
|
+
["type", "channelId", "channelName", "isPrivate"],
|
|
679
|
+
e
|
|
680
|
+
);
|
|
681
|
+
const i = p(
|
|
682
|
+
r.channelName,
|
|
683
|
+
`${t}.channelName`,
|
|
684
|
+
l.attachmentTitle,
|
|
685
|
+
e
|
|
686
|
+
), a = r.isPrivate === void 0 || r.isPrivate === null ? void 0 : g(
|
|
687
|
+
r.isPrivate,
|
|
688
|
+
!1,
|
|
689
|
+
`${t}.isPrivate`,
|
|
690
|
+
e
|
|
691
|
+
);
|
|
692
|
+
return {
|
|
693
|
+
type: "channel",
|
|
694
|
+
channelId: u(
|
|
695
|
+
r.channelId,
|
|
696
|
+
`${t}.channelId`,
|
|
697
|
+
l.id,
|
|
698
|
+
e
|
|
699
|
+
),
|
|
700
|
+
...i ? { channelName: i } : {},
|
|
701
|
+
...a !== void 0 ? { isPrivate: a } : {}
|
|
702
|
+
};
|
|
703
|
+
}
|
|
704
|
+
return o === "dm" ? (s(r, t, ["type", "recipient"], e), c(
|
|
705
|
+
e,
|
|
706
|
+
`${t}.type`,
|
|
707
|
+
"Slack DM delivery is not supported in V1."
|
|
708
|
+
), {
|
|
709
|
+
type: "dm",
|
|
710
|
+
recipient: _(r.recipient, 0, e, `${t}.recipient`)
|
|
711
|
+
}) : (c(e, `${t}.type`, "Expected channel."), { type: "channel", channelId: "" });
|
|
712
|
+
}
|
|
713
|
+
function me(n, t, e) {
|
|
714
|
+
if (n == null)
|
|
715
|
+
return;
|
|
716
|
+
if (!Array.isArray(n)) {
|
|
717
|
+
c(e, t, "Expected an array.");
|
|
718
|
+
return;
|
|
719
|
+
}
|
|
720
|
+
const r = n.map(
|
|
721
|
+
(o, i) => _(o, i, e, t)
|
|
722
|
+
);
|
|
723
|
+
return r.length > 0 ? r : void 0;
|
|
724
|
+
}
|
|
725
|
+
function ue(n, t, e) {
|
|
726
|
+
if (n == null)
|
|
727
|
+
return;
|
|
728
|
+
const r = h(n, t, e);
|
|
729
|
+
s(
|
|
668
730
|
r,
|
|
669
|
-
|
|
731
|
+
t,
|
|
732
|
+
[
|
|
733
|
+
"destination",
|
|
734
|
+
"threadMentions",
|
|
735
|
+
"postThreadDetail",
|
|
736
|
+
"includeDashboardLink",
|
|
737
|
+
"includeBriefingLink"
|
|
738
|
+
],
|
|
739
|
+
e
|
|
740
|
+
);
|
|
741
|
+
const o = me(
|
|
742
|
+
r.threadMentions,
|
|
743
|
+
`${t}.threadMentions`,
|
|
744
|
+
e
|
|
745
|
+
), i = g(
|
|
746
|
+
r.postThreadDetail,
|
|
747
|
+
!0,
|
|
748
|
+
`${t}.postThreadDetail`,
|
|
749
|
+
e
|
|
750
|
+
), a = g(
|
|
751
|
+
r.includeDashboardLink,
|
|
752
|
+
!0,
|
|
753
|
+
`${t}.includeDashboardLink`,
|
|
754
|
+
e
|
|
755
|
+
), f = g(
|
|
756
|
+
r.includeBriefingLink,
|
|
757
|
+
!0,
|
|
758
|
+
`${t}.includeBriefingLink`,
|
|
759
|
+
e
|
|
760
|
+
);
|
|
761
|
+
return {
|
|
762
|
+
destination: fe(
|
|
763
|
+
r.destination,
|
|
764
|
+
`${t}.destination`,
|
|
765
|
+
e
|
|
766
|
+
),
|
|
767
|
+
...o ? { threadMentions: o } : {},
|
|
768
|
+
...r.postThreadDetail !== void 0 ? { postThreadDetail: i } : {},
|
|
769
|
+
...r.includeDashboardLink !== void 0 ? { includeDashboardLink: a } : {},
|
|
770
|
+
...r.includeBriefingLink !== void 0 ? { includeBriefingLink: f } : {}
|
|
771
|
+
};
|
|
772
|
+
}
|
|
773
|
+
function he(n, t, e) {
|
|
774
|
+
const r = h(n, t, e);
|
|
775
|
+
s(
|
|
776
|
+
r,
|
|
777
|
+
t,
|
|
670
778
|
[
|
|
671
779
|
"subjectOverride",
|
|
672
780
|
"titleOverride",
|
|
673
781
|
"summaryOverride",
|
|
674
782
|
"actionBlockVisible",
|
|
783
|
+
"formatProfile",
|
|
784
|
+
"slackConfig",
|
|
675
785
|
"webhookConfig"
|
|
676
786
|
],
|
|
677
787
|
e
|
|
678
788
|
);
|
|
679
|
-
const o =
|
|
789
|
+
const o = b(
|
|
790
|
+
r.formatProfile,
|
|
791
|
+
`${t}.formatProfile`,
|
|
792
|
+
Y,
|
|
793
|
+
"concise, balanced, or detailed",
|
|
794
|
+
e
|
|
795
|
+
), i = p(
|
|
680
796
|
r.subjectOverride,
|
|
681
|
-
`${
|
|
797
|
+
`${t}.subjectOverride`,
|
|
682
798
|
500,
|
|
683
799
|
e
|
|
684
|
-
),
|
|
800
|
+
), a = p(
|
|
685
801
|
r.titleOverride,
|
|
686
|
-
`${
|
|
802
|
+
`${t}.titleOverride`,
|
|
687
803
|
500,
|
|
688
804
|
e
|
|
689
|
-
),
|
|
805
|
+
), f = p(
|
|
690
806
|
r.summaryOverride,
|
|
691
|
-
`${
|
|
807
|
+
`${t}.summaryOverride`,
|
|
692
808
|
2e3,
|
|
693
809
|
e
|
|
694
|
-
),
|
|
810
|
+
), y = g(
|
|
695
811
|
r.actionBlockVisible,
|
|
696
812
|
!0,
|
|
697
|
-
`${
|
|
813
|
+
`${t}.actionBlockVisible`,
|
|
698
814
|
e
|
|
699
|
-
),
|
|
815
|
+
), d = se(
|
|
700
816
|
r.webhookConfig,
|
|
701
|
-
`${
|
|
817
|
+
`${t}.webhookConfig`,
|
|
818
|
+
e
|
|
819
|
+
), m = ue(
|
|
820
|
+
r.slackConfig,
|
|
821
|
+
`${t}.slackConfig`,
|
|
702
822
|
e
|
|
703
823
|
);
|
|
704
824
|
return {
|
|
705
|
-
...o ? {
|
|
706
|
-
...i ? {
|
|
707
|
-
...a ? {
|
|
708
|
-
...
|
|
709
|
-
...
|
|
825
|
+
...o ? { formatProfile: o } : {},
|
|
826
|
+
...i ? { subjectOverride: i } : {},
|
|
827
|
+
...a ? { titleOverride: a } : {},
|
|
828
|
+
...f ? { summaryOverride: f } : {},
|
|
829
|
+
...r.actionBlockVisible !== void 0 ? { actionBlockVisible: y } : {},
|
|
830
|
+
...m ? { slackConfig: m } : {},
|
|
831
|
+
...d ? { webhookConfig: d } : {}
|
|
710
832
|
};
|
|
711
833
|
}
|
|
712
|
-
function
|
|
713
|
-
if (
|
|
834
|
+
function pe(n, t) {
|
|
835
|
+
if (n == null)
|
|
714
836
|
return;
|
|
715
|
-
const e =
|
|
837
|
+
const e = h(n, "deliveryConfig.channelConfigs", t), r = {};
|
|
716
838
|
return Object.entries(e).forEach(([o, i]) => {
|
|
717
|
-
if (!
|
|
718
|
-
|
|
719
|
-
|
|
839
|
+
if (!w(o)) {
|
|
840
|
+
c(
|
|
841
|
+
t,
|
|
720
842
|
`deliveryConfig.channelConfigs.${o}`,
|
|
721
843
|
"Expected a supported delivery channel."
|
|
722
844
|
);
|
|
723
845
|
return;
|
|
724
846
|
}
|
|
725
|
-
r[o] =
|
|
847
|
+
r[o] = he(
|
|
726
848
|
i,
|
|
727
849
|
`deliveryConfig.channelConfigs.${o}`,
|
|
728
|
-
|
|
850
|
+
t
|
|
729
851
|
);
|
|
730
852
|
}), Object.keys(r).length > 0 ? r : void 0;
|
|
731
853
|
}
|
|
732
|
-
function
|
|
733
|
-
|
|
854
|
+
function ye(n, t) {
|
|
855
|
+
var y, d, m;
|
|
856
|
+
if (n == null)
|
|
734
857
|
return null;
|
|
735
|
-
const e =
|
|
736
|
-
|
|
858
|
+
const e = h(n, "deliveryConfig", t);
|
|
859
|
+
s(
|
|
737
860
|
e,
|
|
738
861
|
"deliveryConfig",
|
|
739
862
|
["recipients", "channels", "channelConfigs"],
|
|
740
|
-
|
|
863
|
+
t
|
|
741
864
|
);
|
|
742
|
-
const r =
|
|
743
|
-
return
|
|
744
|
-
|
|
865
|
+
const r = pe(e.channelConfigs, t), o = ce(e.recipients, t), i = de(e.channels, t), a = ((d = (y = r == null ? void 0 : r.SLACK) == null ? void 0 : y.slackConfig) == null ? void 0 : d.destination.type) === "channel" && !!r.SLACK.slackConfig.destination.channelId.trim();
|
|
866
|
+
return i.some(
|
|
867
|
+
(v) => v !== "SLACK"
|
|
868
|
+
) && o.length === 0 && c(
|
|
869
|
+
t,
|
|
745
870
|
"deliveryConfig.recipients",
|
|
746
871
|
"Add at least one recipient or remove delivery config."
|
|
747
|
-
), i.length === 0 &&
|
|
748
|
-
|
|
872
|
+
), i.length === 0 && c(
|
|
873
|
+
t,
|
|
749
874
|
"deliveryConfig.channels",
|
|
750
875
|
"Choose at least one delivery channel or remove delivery config."
|
|
876
|
+
), i.includes("SLACK") && !a && c(
|
|
877
|
+
t,
|
|
878
|
+
"deliveryConfig.channelConfigs.SLACK.slackConfig.destination.channelId",
|
|
879
|
+
"Choose a Slack channel destination."
|
|
880
|
+
), !i.includes("SLACK") && ((m = r == null ? void 0 : r.SLACK) != null && m.slackConfig) && c(
|
|
881
|
+
t,
|
|
882
|
+
"deliveryConfig.channelConfigs.SLACK",
|
|
883
|
+
"Slack config requires SLACK in deliveryConfig.channels."
|
|
751
884
|
), {
|
|
752
885
|
recipients: o,
|
|
753
886
|
channels: i,
|
|
754
887
|
...r ? { channelConfigs: r } : {}
|
|
755
888
|
};
|
|
756
889
|
}
|
|
757
|
-
function
|
|
758
|
-
const
|
|
759
|
-
|
|
890
|
+
function k(n) {
|
|
891
|
+
const t = [], e = h(n, "draft", t);
|
|
892
|
+
s(
|
|
760
893
|
e,
|
|
761
894
|
"draft",
|
|
762
895
|
[
|
|
@@ -772,77 +905,77 @@ function T(t) {
|
|
|
772
905
|
"limits",
|
|
773
906
|
"deliveryConfig"
|
|
774
907
|
],
|
|
775
|
-
|
|
908
|
+
t
|
|
776
909
|
);
|
|
777
|
-
const r =
|
|
910
|
+
const r = u(
|
|
778
911
|
e.name,
|
|
779
912
|
"name",
|
|
780
|
-
|
|
781
|
-
|
|
782
|
-
), o =
|
|
913
|
+
l.name,
|
|
914
|
+
t
|
|
915
|
+
), o = p(
|
|
783
916
|
e.description,
|
|
784
917
|
"description",
|
|
785
|
-
|
|
786
|
-
|
|
787
|
-
) ?? null, i =
|
|
788
|
-
return
|
|
918
|
+
l.description,
|
|
919
|
+
t
|
|
920
|
+
) ?? null, i = p(e.scheduleExpr, "scheduleExpr", 500, t) ?? null, a = p(e.timezone, "timezone", 200, t) ?? "UTC", f = Q(e.status, t), y = B(e.source, t), d = F(e.body, t), m = R(e.attachments, t), v = O(e.presentation, t), L = M(e.limits, t), j = ye(e.deliveryConfig, t);
|
|
921
|
+
return V(d, m, t), N(t), {
|
|
789
922
|
name: r,
|
|
790
923
|
description: o,
|
|
791
|
-
status:
|
|
924
|
+
status: f,
|
|
792
925
|
scheduleExpr: i,
|
|
793
926
|
timezone: a,
|
|
794
927
|
source: y,
|
|
795
|
-
body:
|
|
796
|
-
attachments:
|
|
797
|
-
presentation:
|
|
798
|
-
...
|
|
799
|
-
deliveryConfig:
|
|
928
|
+
body: d,
|
|
929
|
+
attachments: m,
|
|
930
|
+
presentation: v,
|
|
931
|
+
...L ? { limits: L } : {},
|
|
932
|
+
deliveryConfig: j
|
|
800
933
|
};
|
|
801
934
|
}
|
|
802
|
-
function
|
|
803
|
-
return
|
|
935
|
+
function Ee(n) {
|
|
936
|
+
return k(n);
|
|
804
937
|
}
|
|
805
|
-
function
|
|
806
|
-
return
|
|
938
|
+
function $e(n) {
|
|
939
|
+
return k(n);
|
|
807
940
|
}
|
|
808
|
-
function
|
|
941
|
+
function ve(n) {
|
|
809
942
|
try {
|
|
810
|
-
return { valid: !0, value:
|
|
811
|
-
} catch (
|
|
812
|
-
if (
|
|
813
|
-
return { valid: !1, issues:
|
|
814
|
-
throw
|
|
943
|
+
return { valid: !0, value: k(n), issues: [] };
|
|
944
|
+
} catch (t) {
|
|
945
|
+
if (t instanceof T)
|
|
946
|
+
return { valid: !1, issues: t.issues };
|
|
947
|
+
throw t;
|
|
815
948
|
}
|
|
816
949
|
}
|
|
817
|
-
function
|
|
950
|
+
function Ce(n) {
|
|
818
951
|
try {
|
|
819
|
-
return { valid: !0, value:
|
|
820
|
-
} catch (
|
|
821
|
-
if (
|
|
822
|
-
return { valid: !1, issues:
|
|
823
|
-
throw
|
|
952
|
+
return { valid: !0, value: P(n), issues: [] };
|
|
953
|
+
} catch (t) {
|
|
954
|
+
if (t instanceof T)
|
|
955
|
+
return { valid: !1, issues: t.issues };
|
|
956
|
+
throw t;
|
|
824
957
|
}
|
|
825
958
|
}
|
|
826
|
-
function
|
|
827
|
-
return typeof
|
|
959
|
+
function Ae(n) {
|
|
960
|
+
return typeof n == "string" && z.has(n);
|
|
828
961
|
}
|
|
829
|
-
function
|
|
830
|
-
return typeof
|
|
962
|
+
function w(n) {
|
|
963
|
+
return typeof n == "string" && H.has(n);
|
|
831
964
|
}
|
|
832
965
|
export {
|
|
833
|
-
|
|
966
|
+
q as BRIEFING_ARTIFACT_FORMATS,
|
|
834
967
|
A as BRIEFING_KIND,
|
|
835
|
-
|
|
836
|
-
|
|
837
|
-
|
|
838
|
-
|
|
839
|
-
|
|
840
|
-
|
|
841
|
-
|
|
842
|
-
|
|
843
|
-
|
|
844
|
-
|
|
845
|
-
|
|
846
|
-
|
|
847
|
-
|
|
968
|
+
l as BRIEFING_TEXT_LIMITS,
|
|
969
|
+
T as BriefingContractError,
|
|
970
|
+
S as DEFAULT_BRIEFING_ARTIFACT_FORMATS,
|
|
971
|
+
Ie as MAX_BRIEFING_ATTACHMENTS,
|
|
972
|
+
be as buildBriefingJobConfig,
|
|
973
|
+
Ee as buildCreateBriefingRequest,
|
|
974
|
+
$e as buildUpdateBriefingRequest,
|
|
975
|
+
Ae as isBriefingArtifactFormat,
|
|
976
|
+
w as isBriefingDeliveryChannel,
|
|
977
|
+
k as normalizeBriefingDraft,
|
|
978
|
+
P as normalizeBriefingJobConfig,
|
|
979
|
+
ve as validateBriefingDraft,
|
|
980
|
+
Ce as validateBriefingJobConfig
|
|
848
981
|
};
|