react-semaphor 0.1.318 → 0.1.320
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 +851 -358
- package/dist/chunks/{calendar-preferences-dialog-DgpoCz1l.js → calendar-preferences-dialog-B7Z8OnuZ.js} +1 -1
- package/dist/chunks/{calendar-preferences-dialog-DySStYHa.js → calendar-preferences-dialog-CFXQBJ4A.js} +1 -1
- package/dist/chunks/{dashboard-briefing-launcher-BrUNYrwk.js → dashboard-briefing-launcher-DB16djcj.js} +3095 -2391
- package/dist/chunks/dashboard-briefing-launcher-DjDpGyD7.js +106 -0
- package/dist/chunks/{dashboard-controls-CDCpt8iB.js → dashboard-controls-BisfskDD.js} +1 -1
- package/dist/chunks/{dashboard-controls-BJb7QHvl.js → dashboard-controls-DPStW1kd.js} +3 -3
- package/dist/chunks/{dashboard-json-BYEqzs6b.js → dashboard-json-2nyFJ_-w.js} +1 -1
- package/dist/chunks/{dashboard-json-BjFw0Ktj.js → dashboard-json-C8-kkiyT.js} +1 -1
- package/dist/chunks/{edit-dashboard-visual-IxtXVkBc.js → edit-dashboard-visual-BP77bJFI.js} +1 -1
- package/dist/chunks/{edit-dashboard-visual-VHlDJd5A.js → edit-dashboard-visual-D6oiTlXr.js} +3 -3
- package/dist/chunks/{index-CAWSZGCL.js → index-Clw0hJzi.js} +289 -288
- package/dist/chunks/{index-BhrZn1Zk.js → index-D8eouWYC.js} +75 -75
- package/dist/chunks/{resource-management-panel-X4zxZ4wq.js → resource-management-panel-DTvY5OIq.js} +1 -1
- package/dist/chunks/{resource-management-panel-0OlH_Gze.js → resource-management-panel-HcRJRZHO.js} +2 -2
- package/dist/chunks/{use-create-flow-overlay-state-WYyQFfGQ.js → use-create-flow-overlay-state-75l5mrVp.js} +2 -2
- package/dist/chunks/{use-create-flow-overlay-state-DkZTa6eN.js → use-create-flow-overlay-state-CdCldE6J.js} +1 -1
- package/dist/chunks/{use-visual-utils-C8VR6_Cr.js → use-visual-utils-Bd4Cf9_B.js} +1 -1
- package/dist/chunks/{use-visual-utils-2l8uDXRH.js → use-visual-utils-CMdEUnM5.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 +125 -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,36 +1,72 @@
|
|
|
1
|
-
var
|
|
2
|
-
var
|
|
3
|
-
var
|
|
4
|
-
const
|
|
1
|
+
var G = Object.defineProperty;
|
|
2
|
+
var U = (n, t, e) => t in n ? G(n, t, { enumerable: !0, configurable: !0, writable: !0, value: e }) : n[t] = e;
|
|
3
|
+
var z = (n, t, e) => U(n, typeof t != "symbol" ? t + "" : t, e);
|
|
4
|
+
const S = "BRIEFING", H = ["markdown", "html"], k = ["markdown"], Le = 20, l = {
|
|
5
5
|
name: 500,
|
|
6
6
|
description: 2e3,
|
|
7
7
|
instruction: 5e4,
|
|
8
8
|
customMessage: 5e4,
|
|
9
|
+
contentTitle: 500,
|
|
10
|
+
contentSummary: 2e4,
|
|
11
|
+
contentText: 5e3,
|
|
12
|
+
contentItem: 2e3,
|
|
13
|
+
contentCell: 500,
|
|
9
14
|
attachmentTitle: 500,
|
|
10
15
|
presentationAudience: 1e3,
|
|
11
16
|
presentationTone: 500,
|
|
12
17
|
presentationFormat: 2e3,
|
|
13
18
|
id: 500
|
|
14
|
-
},
|
|
19
|
+
}, g = {
|
|
20
|
+
maxBlocks: 50,
|
|
21
|
+
maxTableRows: 100,
|
|
22
|
+
maxTableColumns: 20,
|
|
23
|
+
maxTableCellCharacters: l.contentCell,
|
|
24
|
+
maxParagraphCharacters: l.contentText,
|
|
25
|
+
maxFindingCharacters: l.contentText,
|
|
26
|
+
maxListItems: 100
|
|
27
|
+
}, D = new Set(H), X = /* @__PURE__ */ new Set([
|
|
15
28
|
"EMAIL",
|
|
16
29
|
"WEBHOOK",
|
|
17
30
|
"SLACK",
|
|
18
31
|
"IN_APP",
|
|
19
32
|
"TELEGRAM"
|
|
20
|
-
]),
|
|
33
|
+
]), T = {
|
|
21
34
|
maxToolCalls: { min: 1, max: 100 },
|
|
22
35
|
maxRows: { min: 1, max: 1e5 },
|
|
23
36
|
timeoutMs: { min: 1e3, max: 30 * 6e4 }
|
|
24
|
-
},
|
|
37
|
+
}, J = /* @__PURE__ */ new Set([
|
|
25
38
|
"letter",
|
|
26
39
|
"legal",
|
|
27
40
|
"a4",
|
|
28
41
|
"a3",
|
|
29
42
|
"tabloid"
|
|
30
|
-
]),
|
|
43
|
+
]), W = /* @__PURE__ */ new Set([
|
|
31
44
|
"portrait",
|
|
32
45
|
"landscape"
|
|
33
|
-
]),
|
|
46
|
+
]), Y = /* @__PURE__ */ new Set([",", ";", " "]), Z = /* @__PURE__ */ new Set([
|
|
47
|
+
"current",
|
|
48
|
+
"all"
|
|
49
|
+
]), Q = /* @__PURE__ */ new Set([
|
|
50
|
+
"concise",
|
|
51
|
+
"balanced",
|
|
52
|
+
"detailed"
|
|
53
|
+
]), ee = /* @__PURE__ */ new Set([
|
|
54
|
+
"info",
|
|
55
|
+
"positive",
|
|
56
|
+
"warning",
|
|
57
|
+
"critical"
|
|
58
|
+
]), te = /* @__PURE__ */ new Set([
|
|
59
|
+
"text",
|
|
60
|
+
"number",
|
|
61
|
+
"currency",
|
|
62
|
+
"percent",
|
|
63
|
+
"date",
|
|
64
|
+
"boolean"
|
|
65
|
+
]), ne = /* @__PURE__ */ new Set([
|
|
66
|
+
"left",
|
|
67
|
+
"center",
|
|
68
|
+
"right"
|
|
69
|
+
]), re = [
|
|
34
70
|
"pageSize",
|
|
35
71
|
"orientation",
|
|
36
72
|
"includeFilters",
|
|
@@ -55,112 +91,137 @@ const A = "BRIEFING", U = ["markdown", "html"], v = ["markdown"], ue = 20, c = {
|
|
|
55
91
|
"cardType",
|
|
56
92
|
"theme"
|
|
57
93
|
];
|
|
58
|
-
class
|
|
94
|
+
class A extends Error {
|
|
59
95
|
constructor(e) {
|
|
60
96
|
super(e.map((r) => `${r.field}: ${r.message}`).join("; "));
|
|
61
|
-
|
|
97
|
+
z(this, "issues");
|
|
62
98
|
this.name = "BriefingContractError", this.issues = e;
|
|
63
99
|
}
|
|
64
100
|
}
|
|
65
|
-
function
|
|
66
|
-
return typeof
|
|
101
|
+
function N(n) {
|
|
102
|
+
return typeof n == "object" && n !== null && !Array.isArray(n);
|
|
67
103
|
}
|
|
68
|
-
function
|
|
69
|
-
|
|
104
|
+
function c(n, t, e) {
|
|
105
|
+
n.push({ field: t, message: e });
|
|
70
106
|
}
|
|
71
|
-
function
|
|
72
|
-
return
|
|
107
|
+
function h(n, t, e) {
|
|
108
|
+
return N(n) ? n : (c(e, t, "Expected an object."), {});
|
|
73
109
|
}
|
|
74
|
-
function
|
|
110
|
+
function f(n, t, e, r) {
|
|
75
111
|
const o = new Set(e);
|
|
76
|
-
Object.keys(
|
|
77
|
-
o.has(i) ||
|
|
112
|
+
Object.keys(n).forEach((i) => {
|
|
113
|
+
o.has(i) || c(
|
|
78
114
|
r,
|
|
79
|
-
|
|
115
|
+
t ? `${t}.${i}` : i,
|
|
80
116
|
`Unexpected field "${i}".`
|
|
81
117
|
);
|
|
82
118
|
});
|
|
83
119
|
}
|
|
84
|
-
function
|
|
85
|
-
if (typeof
|
|
86
|
-
return
|
|
87
|
-
const o =
|
|
88
|
-
return o ? (o.length > e &&
|
|
120
|
+
function u(n, t, e, r) {
|
|
121
|
+
if (typeof n != "string")
|
|
122
|
+
return c(r, t, "Expected a string."), "";
|
|
123
|
+
const o = n.trim();
|
|
124
|
+
return o ? (o.length > e && c(r, t, `Must be ${e} characters or fewer.`), o) : (c(r, t, "Required value cannot be empty."), "");
|
|
89
125
|
}
|
|
90
|
-
function
|
|
91
|
-
if (
|
|
126
|
+
function y(n, t, e, r) {
|
|
127
|
+
if (n == null)
|
|
92
128
|
return;
|
|
93
|
-
if (typeof
|
|
94
|
-
|
|
129
|
+
if (typeof n != "string") {
|
|
130
|
+
c(r, t, "Expected a string.");
|
|
95
131
|
return;
|
|
96
132
|
}
|
|
97
|
-
const o =
|
|
133
|
+
const o = n.trim();
|
|
98
134
|
if (o)
|
|
99
|
-
return o.length > e &&
|
|
135
|
+
return o.length > e && c(r, t, `Must be ${e} characters or fewer.`), o;
|
|
100
136
|
}
|
|
101
|
-
function
|
|
102
|
-
|
|
137
|
+
function oe(n, t, e) {
|
|
138
|
+
if (n != null) {
|
|
139
|
+
if (!Number.isInteger(n) || Number(n) < 0) {
|
|
140
|
+
c(e, t, "Expected a non-negative integer.");
|
|
141
|
+
return;
|
|
142
|
+
}
|
|
143
|
+
return Number(n);
|
|
144
|
+
}
|
|
103
145
|
}
|
|
104
|
-
function
|
|
105
|
-
|
|
146
|
+
function b(n, t, e, r = {}) {
|
|
147
|
+
if (n == null)
|
|
148
|
+
return r.required ? (c(e, t, "Expected at least one evidence id."), []) : void 0;
|
|
149
|
+
if (!Array.isArray(n))
|
|
150
|
+
return c(e, t, "Expected an array."), r.required ? [] : void 0;
|
|
151
|
+
const o = [];
|
|
152
|
+
return n.forEach((i, a) => {
|
|
153
|
+
const d = u(
|
|
154
|
+
i,
|
|
155
|
+
`${t}.${a}`,
|
|
156
|
+
l.id,
|
|
157
|
+
e
|
|
158
|
+
);
|
|
159
|
+
d && !o.includes(d) && o.push(d);
|
|
160
|
+
}), r.required && o.length === 0 && c(e, t, "Expected at least one evidence id."), o.length > 0 || r.required ? o : void 0;
|
|
161
|
+
}
|
|
162
|
+
function $(n, t, e, r) {
|
|
163
|
+
return n == null ? t : typeof n != "boolean" ? (c(r, e, "Expected a boolean."), t) : n;
|
|
106
164
|
}
|
|
107
|
-
function
|
|
108
|
-
return
|
|
165
|
+
function ie(n, t) {
|
|
166
|
+
return n == null ? "ACTIVE" : n === "ACTIVE" || n === "PAUSED" || n === "DISABLED" ? n : (c(t, "status", "Expected ACTIVE, PAUSED, or DISABLED."), "ACTIVE");
|
|
109
167
|
}
|
|
110
|
-
function
|
|
111
|
-
|
|
168
|
+
function ae(n) {
|
|
169
|
+
return n.includes("@") && n.includes(".") && !n.includes(" ");
|
|
170
|
+
}
|
|
171
|
+
function O(n, t) {
|
|
172
|
+
if (n == null)
|
|
112
173
|
return { type: "project" };
|
|
113
|
-
const e =
|
|
114
|
-
return r === "project" ? (
|
|
174
|
+
const e = h(n, "source", t), r = e.type;
|
|
175
|
+
return r === "project" ? (f(e, "source", ["type"], t), { type: "project" }) : r === "dashboard" ? (f(e, "source", ["type", "dashboardId"], t), {
|
|
115
176
|
type: "dashboard",
|
|
116
|
-
dashboardId:
|
|
177
|
+
dashboardId: u(
|
|
117
178
|
e.dashboardId,
|
|
118
179
|
"source.dashboardId",
|
|
119
|
-
|
|
120
|
-
|
|
180
|
+
l.id,
|
|
181
|
+
t
|
|
121
182
|
)
|
|
122
|
-
}) : (
|
|
183
|
+
}) : (c(t, "source.type", "Expected project or dashboard."), { type: "project" });
|
|
123
184
|
}
|
|
124
|
-
function
|
|
125
|
-
const e =
|
|
126
|
-
return r === "generated_analysis" ? (
|
|
185
|
+
function R(n, t) {
|
|
186
|
+
const e = h(n, "body", t), r = e.type;
|
|
187
|
+
return r === "generated_analysis" ? (f(e, "body", ["type", "instruction"], t), {
|
|
127
188
|
type: "generated_analysis",
|
|
128
|
-
instruction:
|
|
189
|
+
instruction: u(
|
|
129
190
|
e.instruction,
|
|
130
191
|
"body.instruction",
|
|
131
|
-
|
|
132
|
-
|
|
192
|
+
l.instruction,
|
|
193
|
+
t
|
|
133
194
|
)
|
|
134
|
-
}) : r === "custom_message" ? (
|
|
195
|
+
}) : r === "custom_message" ? (f(e, "body", ["type", "message"], t), {
|
|
135
196
|
type: "custom_message",
|
|
136
|
-
message:
|
|
197
|
+
message: u(
|
|
137
198
|
e.message,
|
|
138
199
|
"body.message",
|
|
139
|
-
|
|
140
|
-
|
|
200
|
+
l.customMessage,
|
|
201
|
+
t
|
|
141
202
|
)
|
|
142
|
-
}) : r === "none" ? (
|
|
143
|
-
|
|
203
|
+
}) : r === "none" ? (f(e, "body", ["type"], t), { type: "none" }) : (c(
|
|
204
|
+
t,
|
|
144
205
|
"body.type",
|
|
145
206
|
"Expected generated_analysis, custom_message, or none."
|
|
146
207
|
), { type: "none" });
|
|
147
208
|
}
|
|
148
|
-
function
|
|
149
|
-
if (
|
|
150
|
-
return [...
|
|
151
|
-
if (!Array.isArray(
|
|
152
|
-
return
|
|
153
|
-
if (
|
|
154
|
-
return
|
|
155
|
-
|
|
209
|
+
function ce(n, t) {
|
|
210
|
+
if (n == null)
|
|
211
|
+
return [...k];
|
|
212
|
+
if (!Array.isArray(n))
|
|
213
|
+
return c(t, "presentation.artifactFormats", "Expected an array."), [...k];
|
|
214
|
+
if (n.length === 0)
|
|
215
|
+
return c(
|
|
216
|
+
t,
|
|
156
217
|
"presentation.artifactFormats",
|
|
157
218
|
"Choose at least one artifact format."
|
|
158
219
|
), [];
|
|
159
220
|
const e = [];
|
|
160
|
-
return
|
|
161
|
-
if (typeof r != "string" || !
|
|
162
|
-
|
|
163
|
-
|
|
221
|
+
return n.forEach((r, o) => {
|
|
222
|
+
if (typeof r != "string" || !D.has(r)) {
|
|
223
|
+
c(
|
|
224
|
+
t,
|
|
164
225
|
`presentation.artifactFormats.${o}`,
|
|
165
226
|
"Expected markdown or html."
|
|
166
227
|
);
|
|
@@ -169,111 +230,414 @@ function Z(t, n) {
|
|
|
169
230
|
e.includes(r) || e.push(r);
|
|
170
231
|
}), e;
|
|
171
232
|
}
|
|
172
|
-
function
|
|
173
|
-
if (
|
|
233
|
+
function F(n, t) {
|
|
234
|
+
if (n == null)
|
|
174
235
|
return {
|
|
175
|
-
artifactFormats: [...
|
|
236
|
+
artifactFormats: [...k],
|
|
176
237
|
includeEvidence: !0,
|
|
177
238
|
includeSql: !0
|
|
178
239
|
};
|
|
179
|
-
const e =
|
|
180
|
-
|
|
240
|
+
const e = h(n, "presentation", t);
|
|
241
|
+
f(
|
|
181
242
|
e,
|
|
182
243
|
"presentation",
|
|
183
244
|
["artifactFormats", "includeEvidence", "includeSql", "audience", "tone", "format"],
|
|
184
|
-
|
|
245
|
+
t
|
|
185
246
|
);
|
|
186
247
|
const r = {
|
|
187
|
-
artifactFormats:
|
|
188
|
-
includeEvidence:
|
|
248
|
+
artifactFormats: ce(e.artifactFormats, t),
|
|
249
|
+
includeEvidence: $(
|
|
189
250
|
e.includeEvidence,
|
|
190
251
|
!0,
|
|
191
252
|
"presentation.includeEvidence",
|
|
192
|
-
|
|
253
|
+
t
|
|
193
254
|
),
|
|
194
|
-
includeSql:
|
|
255
|
+
includeSql: $(
|
|
195
256
|
e.includeSql,
|
|
196
257
|
!0,
|
|
197
258
|
"presentation.includeSql",
|
|
198
|
-
|
|
259
|
+
t
|
|
199
260
|
)
|
|
200
|
-
}, o =
|
|
261
|
+
}, o = y(
|
|
201
262
|
e.audience,
|
|
202
263
|
"presentation.audience",
|
|
203
|
-
|
|
204
|
-
|
|
205
|
-
), i =
|
|
264
|
+
l.presentationAudience,
|
|
265
|
+
t
|
|
266
|
+
), i = y(
|
|
206
267
|
e.tone,
|
|
207
268
|
"presentation.tone",
|
|
208
|
-
|
|
209
|
-
|
|
210
|
-
), a =
|
|
269
|
+
l.presentationTone,
|
|
270
|
+
t
|
|
271
|
+
), a = y(
|
|
211
272
|
e.format,
|
|
212
273
|
"presentation.format",
|
|
213
|
-
|
|
214
|
-
|
|
274
|
+
l.presentationFormat,
|
|
275
|
+
t
|
|
215
276
|
);
|
|
216
277
|
return o && (r.audience = o), i && (r.tone = i), a && (r.format = a), r;
|
|
217
278
|
}
|
|
218
|
-
function
|
|
219
|
-
return
|
|
279
|
+
function de(n, t, e) {
|
|
280
|
+
return Array.isArray(n) ? (n.length === 0 && c(e, t, "Expected at least one item."), n.length > g.maxListItems && c(
|
|
281
|
+
e,
|
|
282
|
+
t,
|
|
283
|
+
`Must have ${g.maxListItems} items or fewer.`
|
|
284
|
+
), n.slice(0, g.maxListItems).map(
|
|
285
|
+
(r, o) => u(
|
|
286
|
+
r,
|
|
287
|
+
`${t}.${o}`,
|
|
288
|
+
l.contentItem,
|
|
289
|
+
e
|
|
290
|
+
)
|
|
291
|
+
).filter(Boolean)) : (c(e, t, "Expected an array."), []);
|
|
292
|
+
}
|
|
293
|
+
function le(n, t, e) {
|
|
294
|
+
return n === null || typeof n == "string" || typeof n == "number" || typeof n == "boolean" ? typeof n == "string" && n.length > l.contentCell ? (c(
|
|
295
|
+
e,
|
|
296
|
+
t,
|
|
297
|
+
`Must be ${l.contentCell} characters or fewer.`
|
|
298
|
+
), n.slice(0, l.contentCell)) : typeof n == "number" && !Number.isFinite(n) ? (c(e, t, "Expected a finite number."), null) : n : (c(e, t, "Expected a string, number, boolean, or null."), null);
|
|
299
|
+
}
|
|
300
|
+
function se(n, t, e) {
|
|
301
|
+
if (!Array.isArray(n))
|
|
302
|
+
return c(e, t, "Expected an array."), [];
|
|
303
|
+
n.length === 0 && c(e, t, "Expected at least one column."), n.length > g.maxTableColumns && c(
|
|
304
|
+
e,
|
|
305
|
+
t,
|
|
306
|
+
`Must have ${g.maxTableColumns} columns or fewer.`
|
|
307
|
+
);
|
|
308
|
+
const r = /* @__PURE__ */ new Set();
|
|
309
|
+
return n.slice(0, g.maxTableColumns).map((o, i) => {
|
|
310
|
+
const a = `${t}.${i}`, d = h(o, a, e);
|
|
311
|
+
f(d, a, ["key", "label", "kind", "align"], e);
|
|
312
|
+
const m = u(
|
|
313
|
+
d.key,
|
|
314
|
+
`${a}.key`,
|
|
315
|
+
l.id,
|
|
316
|
+
e
|
|
317
|
+
);
|
|
318
|
+
m && (r.has(m) && c(e, `${a}.key`, "Column key must be unique."), r.add(m));
|
|
319
|
+
const s = u(
|
|
320
|
+
d.label,
|
|
321
|
+
`${a}.label`,
|
|
322
|
+
l.contentTitle,
|
|
323
|
+
e
|
|
324
|
+
), p = I(
|
|
325
|
+
d.kind,
|
|
326
|
+
`${a}.kind`,
|
|
327
|
+
te,
|
|
328
|
+
"text, number, currency, percent, date, or boolean",
|
|
329
|
+
e
|
|
330
|
+
), v = I(
|
|
331
|
+
d.align,
|
|
332
|
+
`${a}.align`,
|
|
333
|
+
ne,
|
|
334
|
+
"left, center, or right",
|
|
335
|
+
e
|
|
336
|
+
);
|
|
337
|
+
return {
|
|
338
|
+
key: m,
|
|
339
|
+
label: s,
|
|
340
|
+
...p ? { kind: p } : {},
|
|
341
|
+
...v ? { align: v } : {}
|
|
342
|
+
};
|
|
343
|
+
});
|
|
344
|
+
}
|
|
345
|
+
function fe(n, t, e, r) {
|
|
346
|
+
if (!Array.isArray(n))
|
|
347
|
+
return c(r, t, "Expected an array."), [];
|
|
348
|
+
n.length > g.maxTableRows && c(
|
|
349
|
+
r,
|
|
350
|
+
t,
|
|
351
|
+
`Must have ${g.maxTableRows} rows or fewer.`
|
|
352
|
+
);
|
|
353
|
+
const o = new Set(e.map((i) => i.key).filter(Boolean));
|
|
354
|
+
return n.slice(0, g.maxTableRows).map((i, a) => {
|
|
355
|
+
const d = `${t}.${a}`, m = h(i, d, r);
|
|
356
|
+
return Object.keys(m).forEach((s) => {
|
|
357
|
+
o.has(s) || c(r, `${d}.${s}`, `Unexpected table cell "${s}".`);
|
|
358
|
+
}), Object.fromEntries(
|
|
359
|
+
e.map((s) => [
|
|
360
|
+
s.key,
|
|
361
|
+
le(m[s.key] ?? null, `${d}.${s.key}`, r)
|
|
362
|
+
])
|
|
363
|
+
);
|
|
364
|
+
});
|
|
220
365
|
}
|
|
221
|
-
function
|
|
222
|
-
|
|
223
|
-
|
|
224
|
-
|
|
225
|
-
|
|
366
|
+
function me(n, t, e) {
|
|
367
|
+
const r = `content.blocks.${t}`, o = h(n, r, e), i = o.type;
|
|
368
|
+
if (i === "heading") {
|
|
369
|
+
f(o, r, ["type", "text", "level", "evidenceIds"], e);
|
|
370
|
+
const a = o.level === void 0 || o.level === null ? void 0 : o.level === 2 || o.level === 3 ? o.level : void 0;
|
|
371
|
+
o.level !== void 0 && o.level !== null && a === void 0 && c(e, `${r}.level`, "Expected 2 or 3.");
|
|
372
|
+
const d = b(o.evidenceIds, `${r}.evidenceIds`, e);
|
|
373
|
+
return {
|
|
374
|
+
type: "heading",
|
|
375
|
+
text: u(
|
|
376
|
+
o.text,
|
|
377
|
+
`${r}.text`,
|
|
378
|
+
l.contentTitle,
|
|
379
|
+
e
|
|
380
|
+
),
|
|
381
|
+
...a ? { level: a } : {},
|
|
382
|
+
...d ? { evidenceIds: d } : {}
|
|
383
|
+
};
|
|
226
384
|
}
|
|
385
|
+
if (i === "paragraph") {
|
|
386
|
+
f(o, r, ["type", "text", "evidenceIds"], e);
|
|
387
|
+
const a = b(o.evidenceIds, `${r}.evidenceIds`, e);
|
|
388
|
+
return {
|
|
389
|
+
type: "paragraph",
|
|
390
|
+
text: u(
|
|
391
|
+
o.text,
|
|
392
|
+
`${r}.text`,
|
|
393
|
+
l.contentText,
|
|
394
|
+
e
|
|
395
|
+
),
|
|
396
|
+
...a ? { evidenceIds: a } : {}
|
|
397
|
+
};
|
|
398
|
+
}
|
|
399
|
+
if (i === "finding") {
|
|
400
|
+
f(o, r, ["type", "title", "text", "severity", "evidenceIds"], e);
|
|
401
|
+
const a = y(
|
|
402
|
+
o.title,
|
|
403
|
+
`${r}.title`,
|
|
404
|
+
l.contentTitle,
|
|
405
|
+
e
|
|
406
|
+
), d = I(
|
|
407
|
+
o.severity,
|
|
408
|
+
`${r}.severity`,
|
|
409
|
+
ee,
|
|
410
|
+
"info, positive, warning, or critical",
|
|
411
|
+
e
|
|
412
|
+
);
|
|
413
|
+
return {
|
|
414
|
+
type: "finding",
|
|
415
|
+
...a ? { title: a } : {},
|
|
416
|
+
text: u(
|
|
417
|
+
o.text,
|
|
418
|
+
`${r}.text`,
|
|
419
|
+
l.contentText,
|
|
420
|
+
e
|
|
421
|
+
),
|
|
422
|
+
...d ? { severity: d } : {},
|
|
423
|
+
evidenceIds: b(o.evidenceIds, `${r}.evidenceIds`, e, {
|
|
424
|
+
required: !0
|
|
425
|
+
}) ?? []
|
|
426
|
+
};
|
|
427
|
+
}
|
|
428
|
+
if (i === "bullets" || i === "actions" || i === "limitations") {
|
|
429
|
+
f(o, r, ["type", "title", "items", "evidenceIds"], e);
|
|
430
|
+
const a = y(
|
|
431
|
+
o.title,
|
|
432
|
+
`${r}.title`,
|
|
433
|
+
l.contentTitle,
|
|
434
|
+
e
|
|
435
|
+
), d = b(o.evidenceIds, `${r}.evidenceIds`, e);
|
|
436
|
+
return {
|
|
437
|
+
type: i,
|
|
438
|
+
...a ? { title: a } : {},
|
|
439
|
+
items: de(o.items, `${r}.items`, e),
|
|
440
|
+
...d ? { evidenceIds: d } : {}
|
|
441
|
+
};
|
|
442
|
+
}
|
|
443
|
+
if (i === "metric") {
|
|
444
|
+
f(
|
|
445
|
+
o,
|
|
446
|
+
r,
|
|
447
|
+
["type", "label", "value", "previousValue", "delta", "unit", "evidenceIds"],
|
|
448
|
+
e
|
|
449
|
+
);
|
|
450
|
+
const a = typeof o.value == "string" || typeof o.value == "number" ? o.value : "";
|
|
451
|
+
a === "" && c(e, `${r}.value`, "Expected a string or number.");
|
|
452
|
+
const d = o.previousValue === void 0 || o.previousValue === null || typeof o.previousValue == "string" || typeof o.previousValue == "number" ? o.previousValue : void 0;
|
|
453
|
+
o.previousValue !== void 0 && o.previousValue !== null && d === void 0 && c(e, `${r}.previousValue`, "Expected a string, number, or null.");
|
|
454
|
+
const m = o.delta === void 0 || o.delta === null || typeof o.delta == "string" || typeof o.delta == "number" ? o.delta : void 0;
|
|
455
|
+
o.delta !== void 0 && o.delta !== null && m === void 0 && c(e, `${r}.delta`, "Expected a string, number, or null.");
|
|
456
|
+
const s = y(
|
|
457
|
+
o.unit,
|
|
458
|
+
`${r}.unit`,
|
|
459
|
+
l.contentTitle,
|
|
460
|
+
e
|
|
461
|
+
), p = b(o.evidenceIds, `${r}.evidenceIds`, e);
|
|
462
|
+
return {
|
|
463
|
+
type: "metric",
|
|
464
|
+
label: u(
|
|
465
|
+
o.label,
|
|
466
|
+
`${r}.label`,
|
|
467
|
+
l.contentTitle,
|
|
468
|
+
e
|
|
469
|
+
),
|
|
470
|
+
value: a,
|
|
471
|
+
...d !== void 0 ? { previousValue: d } : {},
|
|
472
|
+
...m !== void 0 ? { delta: m } : {},
|
|
473
|
+
...s ? { unit: s } : {},
|
|
474
|
+
...p ? { evidenceIds: p } : {}
|
|
475
|
+
};
|
|
476
|
+
}
|
|
477
|
+
if (i === "table") {
|
|
478
|
+
f(
|
|
479
|
+
o,
|
|
480
|
+
r,
|
|
481
|
+
["type", "id", "title", "columns", "rows", "caption", "totalRows", "evidenceIds"],
|
|
482
|
+
e
|
|
483
|
+
);
|
|
484
|
+
const a = se(o.columns, `${r}.columns`, e), d = y(
|
|
485
|
+
o.title,
|
|
486
|
+
`${r}.title`,
|
|
487
|
+
l.contentTitle,
|
|
488
|
+
e
|
|
489
|
+
), m = y(
|
|
490
|
+
o.id,
|
|
491
|
+
`${r}.id`,
|
|
492
|
+
l.id,
|
|
493
|
+
e
|
|
494
|
+
), s = y(
|
|
495
|
+
o.caption,
|
|
496
|
+
`${r}.caption`,
|
|
497
|
+
l.contentItem,
|
|
498
|
+
e
|
|
499
|
+
), p = oe(
|
|
500
|
+
o.totalRows,
|
|
501
|
+
`${r}.totalRows`,
|
|
502
|
+
e
|
|
503
|
+
), v = b(o.evidenceIds, `${r}.evidenceIds`, e);
|
|
504
|
+
return {
|
|
505
|
+
type: "table",
|
|
506
|
+
...m ? { id: m } : {},
|
|
507
|
+
...d ? { title: d } : {},
|
|
508
|
+
columns: a,
|
|
509
|
+
rows: fe(o.rows, `${r}.rows`, a, e),
|
|
510
|
+
...s ? { caption: s } : {},
|
|
511
|
+
...p !== void 0 ? { totalRows: p } : {},
|
|
512
|
+
...v ? { evidenceIds: v } : {}
|
|
513
|
+
};
|
|
514
|
+
}
|
|
515
|
+
if (i === "evidence_appendix") {
|
|
516
|
+
f(o, r, ["type", "title", "evidenceIds"], e);
|
|
517
|
+
const a = y(
|
|
518
|
+
o.title,
|
|
519
|
+
`${r}.title`,
|
|
520
|
+
l.contentTitle,
|
|
521
|
+
e
|
|
522
|
+
);
|
|
523
|
+
return {
|
|
524
|
+
type: "evidence_appendix",
|
|
525
|
+
...a ? { title: a } : {},
|
|
526
|
+
evidenceIds: b(o.evidenceIds, `${r}.evidenceIds`, e, {
|
|
527
|
+
required: !0
|
|
528
|
+
}) ?? []
|
|
529
|
+
};
|
|
530
|
+
}
|
|
531
|
+
return c(
|
|
532
|
+
e,
|
|
533
|
+
`${r}.type`,
|
|
534
|
+
"Expected heading, paragraph, finding, bullets, metric, table, actions, limitations, or evidence_appendix."
|
|
535
|
+
), {
|
|
536
|
+
type: "paragraph",
|
|
537
|
+
text: ""
|
|
538
|
+
};
|
|
227
539
|
}
|
|
228
|
-
function
|
|
229
|
-
|
|
230
|
-
|
|
231
|
-
|
|
540
|
+
function pe(n) {
|
|
541
|
+
const t = [], e = h(n, "content", t);
|
|
542
|
+
f(e, "content", ["version", "title", "summary", "blocks"], t), e.version !== 1 && c(t, "content.version", "Expected version 1.");
|
|
543
|
+
const r = y(
|
|
544
|
+
e.title,
|
|
545
|
+
"content.title",
|
|
546
|
+
l.contentTitle,
|
|
547
|
+
t
|
|
548
|
+
), o = y(
|
|
549
|
+
e.summary,
|
|
550
|
+
"content.summary",
|
|
551
|
+
l.contentSummary,
|
|
552
|
+
t
|
|
553
|
+
);
|
|
554
|
+
Array.isArray(e.blocks) || c(t, "content.blocks", "Expected an array.");
|
|
555
|
+
const i = Array.isArray(e.blocks) ? e.blocks : [];
|
|
556
|
+
i.length === 0 && c(t, "content.blocks", "Expected at least one block."), i.length > g.maxBlocks && c(
|
|
557
|
+
t,
|
|
558
|
+
"content.blocks",
|
|
559
|
+
`Must have ${g.maxBlocks} blocks or fewer.`
|
|
560
|
+
);
|
|
561
|
+
const a = i.slice(0, g.maxBlocks).map((d, m) => me(d, m, t));
|
|
562
|
+
return _(t), {
|
|
563
|
+
version: 1,
|
|
564
|
+
...r ? { title: r } : {},
|
|
565
|
+
...o ? { summary: o } : {},
|
|
566
|
+
blocks: a
|
|
567
|
+
};
|
|
568
|
+
}
|
|
569
|
+
function we(n) {
|
|
570
|
+
try {
|
|
571
|
+
return {
|
|
572
|
+
valid: !0,
|
|
573
|
+
value: pe(n),
|
|
574
|
+
issues: []
|
|
575
|
+
};
|
|
576
|
+
} catch (t) {
|
|
577
|
+
if (t instanceof A)
|
|
578
|
+
return { valid: !1, issues: t.issues };
|
|
579
|
+
throw t;
|
|
580
|
+
}
|
|
581
|
+
}
|
|
582
|
+
function E(n, t, e, r) {
|
|
583
|
+
return typeof n == "string" && e.includes(n) ? n : (c(r, t, `Expected ${e.join(" or ")}.`), e[0]);
|
|
584
|
+
}
|
|
585
|
+
function I(n, t, e, r, o) {
|
|
586
|
+
if (n != null) {
|
|
587
|
+
if (typeof n == "string" && e.has(n))
|
|
588
|
+
return n;
|
|
589
|
+
c(o, t, `Expected ${r}.`);
|
|
590
|
+
}
|
|
591
|
+
}
|
|
592
|
+
function ue(n, t, e) {
|
|
593
|
+
if (n != null) {
|
|
594
|
+
if (!Array.isArray(n)) {
|
|
595
|
+
c(e, t, "Expected an array.");
|
|
232
596
|
return;
|
|
233
597
|
}
|
|
234
|
-
return
|
|
598
|
+
return n;
|
|
235
599
|
}
|
|
236
600
|
}
|
|
237
|
-
function
|
|
238
|
-
if (
|
|
239
|
-
if (!
|
|
240
|
-
|
|
601
|
+
function ye(n, t, e) {
|
|
602
|
+
if (n != null) {
|
|
603
|
+
if (!N(n)) {
|
|
604
|
+
c(e, t, "Expected an object.");
|
|
241
605
|
return;
|
|
242
606
|
}
|
|
243
|
-
return
|
|
607
|
+
return n;
|
|
244
608
|
}
|
|
245
609
|
}
|
|
246
|
-
function
|
|
247
|
-
if (
|
|
610
|
+
function he(n, t, e) {
|
|
611
|
+
if (n == null)
|
|
248
612
|
return;
|
|
249
|
-
const r =
|
|
250
|
-
|
|
613
|
+
const r = h(n, t, e);
|
|
614
|
+
f(r, t, re, e);
|
|
251
615
|
const o = {}, i = I(
|
|
252
616
|
r.pageSize,
|
|
253
|
-
`${
|
|
254
|
-
|
|
617
|
+
`${t}.pageSize`,
|
|
618
|
+
J,
|
|
255
619
|
"letter, legal, a4, a3, or tabloid",
|
|
256
620
|
e
|
|
257
621
|
), a = I(
|
|
258
622
|
r.orientation,
|
|
259
|
-
`${
|
|
260
|
-
|
|
623
|
+
`${t}.orientation`,
|
|
624
|
+
W,
|
|
261
625
|
"portrait or landscape",
|
|
262
626
|
e
|
|
263
|
-
),
|
|
627
|
+
), d = I(
|
|
264
628
|
r.delimiter,
|
|
265
|
-
`${
|
|
266
|
-
|
|
629
|
+
`${t}.delimiter`,
|
|
630
|
+
Y,
|
|
267
631
|
"comma, semicolon, or tab",
|
|
268
632
|
e
|
|
269
|
-
),
|
|
633
|
+
), m = I(
|
|
270
634
|
r.sheetSelection,
|
|
271
|
-
`${
|
|
272
|
-
|
|
635
|
+
`${t}.sheetSelection`,
|
|
636
|
+
Z,
|
|
273
637
|
"current or all",
|
|
274
638
|
e
|
|
275
639
|
);
|
|
276
|
-
i && (o.pageSize = i), a && (o.orientation = a),
|
|
640
|
+
i && (o.pageSize = i), a && (o.orientation = a), d && (o.delimiter = d), m && (o.sheetSelection = m);
|
|
277
641
|
for (const s of [
|
|
278
642
|
"includeFilters",
|
|
279
643
|
"includeTimestamp",
|
|
@@ -282,7 +646,7 @@ function te(t, n, e) {
|
|
|
282
646
|
])
|
|
283
647
|
if (!(r[s] === void 0 || r[s] === null)) {
|
|
284
648
|
if (typeof r[s] != "boolean") {
|
|
285
|
-
|
|
649
|
+
c(e, `${t}.${s}`, "Expected a boolean.");
|
|
286
650
|
continue;
|
|
287
651
|
}
|
|
288
652
|
o[s] = r[s];
|
|
@@ -295,13 +659,13 @@ function te(t, n, e) {
|
|
|
295
659
|
"cardType",
|
|
296
660
|
"theme"
|
|
297
661
|
]) {
|
|
298
|
-
const
|
|
662
|
+
const p = y(
|
|
299
663
|
r[s],
|
|
300
|
-
`${
|
|
301
|
-
|
|
664
|
+
`${t}.${s}`,
|
|
665
|
+
l.id,
|
|
302
666
|
e
|
|
303
667
|
);
|
|
304
|
-
|
|
668
|
+
p && (o[s] = p);
|
|
305
669
|
}
|
|
306
670
|
for (const s of [
|
|
307
671
|
"filterValues",
|
|
@@ -311,111 +675,111 @@ function te(t, n, e) {
|
|
|
311
675
|
"cardControlDefinitions",
|
|
312
676
|
"controlBindings"
|
|
313
677
|
]) {
|
|
314
|
-
const
|
|
315
|
-
|
|
678
|
+
const p = ue(r[s], `${t}.${s}`, e);
|
|
679
|
+
p && (o[s] = p);
|
|
316
680
|
}
|
|
317
681
|
for (const s of [
|
|
318
682
|
"controlValues",
|
|
319
683
|
"tablePreferences",
|
|
320
684
|
"dashboardInputExecutionSnapshot"
|
|
321
685
|
]) {
|
|
322
|
-
const
|
|
323
|
-
|
|
686
|
+
const p = ye(r[s], `${t}.${s}`, e);
|
|
687
|
+
p && (o[s] = p);
|
|
324
688
|
}
|
|
325
689
|
return Object.keys(o).length > 0 ? o : void 0;
|
|
326
690
|
}
|
|
327
|
-
function
|
|
328
|
-
const o =
|
|
329
|
-
|
|
691
|
+
function C(n, t, e, r) {
|
|
692
|
+
const o = y(
|
|
693
|
+
t,
|
|
330
694
|
e,
|
|
331
|
-
|
|
695
|
+
l.attachmentTitle,
|
|
332
696
|
r
|
|
333
697
|
);
|
|
334
|
-
return o && (
|
|
698
|
+
return o && (n.title = o), n;
|
|
335
699
|
}
|
|
336
|
-
function
|
|
337
|
-
const o =
|
|
338
|
-
return o && (
|
|
700
|
+
function x(n, t, e, r) {
|
|
701
|
+
const o = he(t, e, r);
|
|
702
|
+
return o && (n.settings = o), n;
|
|
339
703
|
}
|
|
340
|
-
function
|
|
341
|
-
const r = `attachments.${
|
|
704
|
+
function ge(n, t, e) {
|
|
705
|
+
const r = `attachments.${t}`, o = h(n, r, e), i = o.type;
|
|
342
706
|
if (i === "dashboard") {
|
|
343
|
-
|
|
707
|
+
f(
|
|
344
708
|
o,
|
|
345
709
|
r,
|
|
346
710
|
["type", "dashboardId", "format", "title", "settings"],
|
|
347
711
|
e
|
|
348
712
|
);
|
|
349
|
-
const a =
|
|
713
|
+
const a = C(
|
|
350
714
|
{
|
|
351
715
|
type: "dashboard",
|
|
352
|
-
dashboardId:
|
|
716
|
+
dashboardId: u(
|
|
353
717
|
o.dashboardId,
|
|
354
718
|
`${r}.dashboardId`,
|
|
355
|
-
|
|
719
|
+
l.id,
|
|
356
720
|
e
|
|
357
721
|
),
|
|
358
|
-
format:
|
|
722
|
+
format: E(o.format, `${r}.format`, ["pdf"], e)
|
|
359
723
|
},
|
|
360
724
|
o.title,
|
|
361
725
|
`${r}.title`,
|
|
362
726
|
e
|
|
363
727
|
);
|
|
364
|
-
return
|
|
728
|
+
return x(a, o.settings, `${r}.settings`, e);
|
|
365
729
|
}
|
|
366
730
|
if (i === "dashboard_sheet" || i === "document_sheet") {
|
|
367
|
-
|
|
731
|
+
f(
|
|
368
732
|
o,
|
|
369
733
|
r,
|
|
370
734
|
["type", "dashboardId", "sheetId", "format", "title", "settings"],
|
|
371
735
|
e
|
|
372
736
|
);
|
|
373
|
-
const a =
|
|
737
|
+
const a = C(
|
|
374
738
|
{
|
|
375
739
|
type: i,
|
|
376
|
-
dashboardId:
|
|
740
|
+
dashboardId: u(
|
|
377
741
|
o.dashboardId,
|
|
378
742
|
`${r}.dashboardId`,
|
|
379
|
-
|
|
743
|
+
l.id,
|
|
380
744
|
e
|
|
381
745
|
),
|
|
382
|
-
sheetId:
|
|
746
|
+
sheetId: u(
|
|
383
747
|
o.sheetId,
|
|
384
748
|
`${r}.sheetId`,
|
|
385
|
-
|
|
749
|
+
l.id,
|
|
386
750
|
e
|
|
387
751
|
),
|
|
388
|
-
format:
|
|
752
|
+
format: E(o.format, `${r}.format`, ["pdf"], e)
|
|
389
753
|
},
|
|
390
754
|
o.title,
|
|
391
755
|
`${r}.title`,
|
|
392
756
|
e
|
|
393
757
|
);
|
|
394
|
-
return
|
|
758
|
+
return x(a, o.settings, `${r}.settings`, e);
|
|
395
759
|
}
|
|
396
760
|
if (i === "visual") {
|
|
397
|
-
|
|
761
|
+
f(
|
|
398
762
|
o,
|
|
399
763
|
r,
|
|
400
764
|
["type", "dashboardId", "visualId", "format", "title", "settings"],
|
|
401
765
|
e
|
|
402
766
|
);
|
|
403
|
-
const a =
|
|
767
|
+
const a = C(
|
|
404
768
|
{
|
|
405
769
|
type: "visual",
|
|
406
|
-
dashboardId:
|
|
770
|
+
dashboardId: u(
|
|
407
771
|
o.dashboardId,
|
|
408
772
|
`${r}.dashboardId`,
|
|
409
|
-
|
|
773
|
+
l.id,
|
|
410
774
|
e
|
|
411
775
|
),
|
|
412
|
-
visualId:
|
|
776
|
+
visualId: u(
|
|
413
777
|
o.visualId,
|
|
414
778
|
`${r}.visualId`,
|
|
415
|
-
|
|
779
|
+
l.id,
|
|
416
780
|
e
|
|
417
781
|
),
|
|
418
|
-
format:
|
|
782
|
+
format: E(
|
|
419
783
|
o.format,
|
|
420
784
|
`${r}.format`,
|
|
421
785
|
["pdf", "png"],
|
|
@@ -426,31 +790,31 @@ function ne(t, n, e) {
|
|
|
426
790
|
`${r}.title`,
|
|
427
791
|
e
|
|
428
792
|
);
|
|
429
|
-
return
|
|
793
|
+
return x(a, o.settings, `${r}.settings`, e);
|
|
430
794
|
}
|
|
431
795
|
if (i === "card") {
|
|
432
|
-
|
|
796
|
+
f(
|
|
433
797
|
o,
|
|
434
798
|
r,
|
|
435
799
|
["type", "dashboardId", "cardId", "format", "title", "settings"],
|
|
436
800
|
e
|
|
437
801
|
);
|
|
438
|
-
const a =
|
|
802
|
+
const a = C(
|
|
439
803
|
{
|
|
440
804
|
type: "card",
|
|
441
|
-
dashboardId:
|
|
805
|
+
dashboardId: u(
|
|
442
806
|
o.dashboardId,
|
|
443
807
|
`${r}.dashboardId`,
|
|
444
|
-
|
|
808
|
+
l.id,
|
|
445
809
|
e
|
|
446
810
|
),
|
|
447
|
-
cardId:
|
|
811
|
+
cardId: u(
|
|
448
812
|
o.cardId,
|
|
449
813
|
`${r}.cardId`,
|
|
450
|
-
|
|
814
|
+
l.id,
|
|
451
815
|
e
|
|
452
816
|
),
|
|
453
|
-
format:
|
|
817
|
+
format: E(
|
|
454
818
|
o.format,
|
|
455
819
|
`${r}.format`,
|
|
456
820
|
["csv", "pdf", "png"],
|
|
@@ -461,57 +825,57 @@ function ne(t, n, e) {
|
|
|
461
825
|
`${r}.title`,
|
|
462
826
|
e
|
|
463
827
|
);
|
|
464
|
-
return
|
|
828
|
+
return x(a, o.settings, `${r}.settings`, e);
|
|
465
829
|
}
|
|
466
|
-
return
|
|
830
|
+
return c(
|
|
467
831
|
e,
|
|
468
832
|
`${r}.type`,
|
|
469
833
|
"Expected dashboard, dashboard_sheet, document_sheet, visual, or card."
|
|
470
834
|
), { type: "dashboard", dashboardId: "", format: "pdf" };
|
|
471
835
|
}
|
|
472
|
-
function
|
|
473
|
-
switch (
|
|
836
|
+
function ve(n) {
|
|
837
|
+
switch (n.type) {
|
|
474
838
|
case "dashboard":
|
|
475
|
-
return `${
|
|
839
|
+
return `${n.type}:${n.dashboardId}:${n.format}`;
|
|
476
840
|
case "dashboard_sheet":
|
|
477
841
|
case "document_sheet":
|
|
478
|
-
return `${
|
|
842
|
+
return `${n.type}:${n.dashboardId}:${n.sheetId}:${n.format}`;
|
|
479
843
|
case "visual":
|
|
480
|
-
return `${
|
|
844
|
+
return `${n.type}:${n.dashboardId}:${n.visualId}:${n.format}`;
|
|
481
845
|
case "card":
|
|
482
|
-
return `${
|
|
846
|
+
return `${n.type}:${n.dashboardId}:${n.cardId}:${n.format}`;
|
|
483
847
|
}
|
|
484
848
|
}
|
|
485
|
-
function
|
|
486
|
-
if (
|
|
849
|
+
function V(n, t) {
|
|
850
|
+
if (n == null)
|
|
487
851
|
return [];
|
|
488
|
-
if (!Array.isArray(
|
|
489
|
-
return
|
|
490
|
-
|
|
491
|
-
|
|
852
|
+
if (!Array.isArray(n))
|
|
853
|
+
return c(t, "attachments", "Expected an array."), [];
|
|
854
|
+
n.length > 20 && c(
|
|
855
|
+
t,
|
|
492
856
|
"attachments",
|
|
493
857
|
"Choose 20 attachments or fewer."
|
|
494
858
|
);
|
|
495
|
-
const e =
|
|
859
|
+
const e = n.slice(0, 20).map((o, i) => ge(o, i, t)), r = /* @__PURE__ */ new Set();
|
|
496
860
|
return e.forEach((o, i) => {
|
|
497
|
-
const a =
|
|
498
|
-
r.has(a) &&
|
|
861
|
+
const a = ve(o);
|
|
862
|
+
r.has(a) && c(t, `attachments.${i}`, "Duplicate attachment."), r.add(a);
|
|
499
863
|
}), e;
|
|
500
864
|
}
|
|
501
|
-
function
|
|
502
|
-
if (
|
|
865
|
+
function M(n, t) {
|
|
866
|
+
if (n == null)
|
|
503
867
|
return;
|
|
504
|
-
const e =
|
|
505
|
-
|
|
868
|
+
const e = h(n, "limits", t);
|
|
869
|
+
f(e, "limits", Object.keys(T), t);
|
|
506
870
|
const r = {};
|
|
507
|
-
return Object.keys(
|
|
871
|
+
return Object.keys(T).forEach((o) => {
|
|
508
872
|
const i = e[o];
|
|
509
873
|
if (i == null)
|
|
510
874
|
return;
|
|
511
|
-
const a =
|
|
875
|
+
const a = T[o];
|
|
512
876
|
if (typeof i != "number" || !Number.isInteger(i) || i < a.min || i > a.max) {
|
|
513
|
-
|
|
514
|
-
|
|
877
|
+
c(
|
|
878
|
+
t,
|
|
515
879
|
`limits.${o}`,
|
|
516
880
|
`Expected an integer between ${a.min} and ${a.max}.`
|
|
517
881
|
);
|
|
@@ -520,105 +884,105 @@ function V(t, n) {
|
|
|
520
884
|
r[o] = i;
|
|
521
885
|
}), Object.keys(r).length > 0 ? r : void 0;
|
|
522
886
|
}
|
|
523
|
-
function
|
|
524
|
-
if (
|
|
525
|
-
throw new
|
|
887
|
+
function _(n) {
|
|
888
|
+
if (n.length > 0)
|
|
889
|
+
throw new A(n);
|
|
526
890
|
}
|
|
527
|
-
function
|
|
528
|
-
|
|
891
|
+
function P(n, t, e) {
|
|
892
|
+
n.type === "none" && t.length === 0 && c(
|
|
529
893
|
e,
|
|
530
894
|
"body",
|
|
531
895
|
"Add briefing instructions, a custom message, or at least one attachment."
|
|
532
896
|
);
|
|
533
897
|
}
|
|
534
|
-
function
|
|
535
|
-
const
|
|
536
|
-
|
|
898
|
+
function j(n) {
|
|
899
|
+
const t = [], e = h(n, "jobConfig", t);
|
|
900
|
+
f(
|
|
537
901
|
e,
|
|
538
902
|
"jobConfig",
|
|
539
903
|
["kind", "source", "body", "attachments", "presentation", "limits"],
|
|
540
|
-
|
|
541
|
-
), e.kind !==
|
|
542
|
-
const r = O(e.source,
|
|
543
|
-
return
|
|
544
|
-
kind:
|
|
904
|
+
t
|
|
905
|
+
), e.kind !== S && c(t, "kind", "Expected BRIEFING.");
|
|
906
|
+
const r = O(e.source, t), o = R(e.body, t), i = V(e.attachments, t), a = F(e.presentation, t), d = M(e.limits, t);
|
|
907
|
+
return P(o, i, t), _(t), {
|
|
908
|
+
kind: S,
|
|
545
909
|
source: r,
|
|
546
910
|
body: o,
|
|
547
911
|
attachments: i,
|
|
548
912
|
presentation: a,
|
|
549
|
-
...
|
|
913
|
+
...d ? { limits: d } : {}
|
|
550
914
|
};
|
|
551
915
|
}
|
|
552
|
-
function
|
|
553
|
-
return
|
|
554
|
-
...
|
|
555
|
-
kind:
|
|
916
|
+
function Be(n) {
|
|
917
|
+
return j({
|
|
918
|
+
...n,
|
|
919
|
+
kind: S
|
|
556
920
|
});
|
|
557
921
|
}
|
|
558
|
-
function
|
|
559
|
-
const
|
|
560
|
-
if (
|
|
561
|
-
|
|
562
|
-
const
|
|
563
|
-
|
|
564
|
-
`${
|
|
565
|
-
|
|
922
|
+
function L(n, t, e, r = "deliveryConfig.recipients") {
|
|
923
|
+
const o = `${r}.${t}`, i = h(n, o, e), a = i.type;
|
|
924
|
+
if (a === "email") {
|
|
925
|
+
f(i, o, ["type", "address", "name"], e);
|
|
926
|
+
const d = u(
|
|
927
|
+
i.address,
|
|
928
|
+
`${o}.address`,
|
|
929
|
+
l.id,
|
|
566
930
|
e
|
|
567
|
-
),
|
|
568
|
-
|
|
569
|
-
`${
|
|
570
|
-
|
|
931
|
+
), m = y(
|
|
932
|
+
i.name,
|
|
933
|
+
`${o}.name`,
|
|
934
|
+
l.attachmentTitle,
|
|
571
935
|
e
|
|
572
936
|
);
|
|
573
|
-
return
|
|
937
|
+
return d && !ae(d) && c(e, `${o}.address`, "Email address is invalid."), {
|
|
574
938
|
type: "email",
|
|
575
|
-
address:
|
|
576
|
-
...
|
|
939
|
+
address: d,
|
|
940
|
+
...m ? { name: m } : {}
|
|
577
941
|
};
|
|
578
942
|
}
|
|
579
|
-
return
|
|
943
|
+
return a === "user" ? (f(i, o, ["type", "userId"], e), {
|
|
580
944
|
type: "user",
|
|
581
|
-
userId:
|
|
582
|
-
|
|
583
|
-
`${
|
|
584
|
-
|
|
945
|
+
userId: u(
|
|
946
|
+
i.userId,
|
|
947
|
+
`${o}.userId`,
|
|
948
|
+
l.id,
|
|
585
949
|
e
|
|
586
950
|
)
|
|
587
|
-
}) :
|
|
951
|
+
}) : a === "tenant_user" ? (f(i, o, ["type", "tenantUserId"], e), {
|
|
588
952
|
type: "tenant_user",
|
|
589
|
-
tenantUserId:
|
|
590
|
-
|
|
591
|
-
`${
|
|
592
|
-
|
|
953
|
+
tenantUserId: u(
|
|
954
|
+
i.tenantUserId,
|
|
955
|
+
`${o}.tenantUserId`,
|
|
956
|
+
l.id,
|
|
593
957
|
e
|
|
594
958
|
)
|
|
595
|
-
}) :
|
|
959
|
+
}) : a === "group" ? (f(i, o, ["type", "groupId"], e), {
|
|
596
960
|
type: "group",
|
|
597
|
-
groupId:
|
|
598
|
-
|
|
599
|
-
`${
|
|
600
|
-
|
|
961
|
+
groupId: u(
|
|
962
|
+
i.groupId,
|
|
963
|
+
`${o}.groupId`,
|
|
964
|
+
l.id,
|
|
601
965
|
e
|
|
602
966
|
)
|
|
603
|
-
}) : (
|
|
967
|
+
}) : (c(
|
|
604
968
|
e,
|
|
605
|
-
`${
|
|
969
|
+
`${o}.type`,
|
|
606
970
|
"Expected email, user, tenant_user, or group."
|
|
607
971
|
), { type: "email", address: "" });
|
|
608
972
|
}
|
|
609
|
-
function
|
|
610
|
-
return Array.isArray(
|
|
611
|
-
(e, r) =>
|
|
612
|
-
) : (
|
|
973
|
+
function Ie(n, t) {
|
|
974
|
+
return n == null ? [] : Array.isArray(n) ? n.map(
|
|
975
|
+
(e, r) => L(e, r, t)
|
|
976
|
+
) : (c(t, "deliveryConfig.recipients", "Expected an array."), []);
|
|
613
977
|
}
|
|
614
|
-
function
|
|
615
|
-
if (!Array.isArray(
|
|
616
|
-
return
|
|
978
|
+
function be(n, t) {
|
|
979
|
+
if (!Array.isArray(n))
|
|
980
|
+
return c(t, "deliveryConfig.channels", "Expected an array."), [];
|
|
617
981
|
const e = [];
|
|
618
|
-
return
|
|
619
|
-
if (!
|
|
620
|
-
|
|
621
|
-
|
|
982
|
+
return n.forEach((r, o) => {
|
|
983
|
+
if (!q(r)) {
|
|
984
|
+
c(
|
|
985
|
+
t,
|
|
622
986
|
`deliveryConfig.channels.${o}`,
|
|
623
987
|
"Expected EMAIL, WEBHOOK, SLACK, IN_APP, or TELEGRAM."
|
|
624
988
|
);
|
|
@@ -627,136 +991,262 @@ function ae(t, n) {
|
|
|
627
991
|
e.includes(r) || e.push(r);
|
|
628
992
|
}), e;
|
|
629
993
|
}
|
|
630
|
-
function
|
|
631
|
-
if (
|
|
994
|
+
function $e(n, t, e) {
|
|
995
|
+
if (n == null)
|
|
632
996
|
return;
|
|
633
|
-
const r =
|
|
997
|
+
const r = h(n, t, e), o = {};
|
|
634
998
|
return Object.entries(r).forEach(([i, a]) => {
|
|
635
999
|
if (typeof a != "string") {
|
|
636
|
-
|
|
1000
|
+
c(e, `${t}.${i}`, "Expected a string.");
|
|
637
1001
|
return;
|
|
638
1002
|
}
|
|
639
1003
|
o[i] = a.trim();
|
|
640
1004
|
}), Object.keys(o).length > 0 ? o : void 0;
|
|
641
1005
|
}
|
|
642
|
-
function
|
|
643
|
-
if (
|
|
1006
|
+
function Ee(n, t, e) {
|
|
1007
|
+
if (n == null)
|
|
644
1008
|
return;
|
|
645
|
-
const r =
|
|
646
|
-
|
|
1009
|
+
const r = h(n, t, e);
|
|
1010
|
+
f(
|
|
647
1011
|
r,
|
|
648
|
-
|
|
1012
|
+
t,
|
|
649
1013
|
["url", "method", "headers", "secretEncrypted"],
|
|
650
1014
|
e
|
|
651
1015
|
);
|
|
652
|
-
const o = r.method === void 0 || r.method === null ? void 0 :
|
|
1016
|
+
const o = r.method === void 0 || r.method === null ? void 0 : E(r.method, `${t}.method`, ["POST", "PUT"], e), i = $e(r.headers, `${t}.headers`, e), a = y(
|
|
653
1017
|
r.secretEncrypted,
|
|
654
|
-
`${
|
|
1018
|
+
`${t}.secretEncrypted`,
|
|
655
1019
|
2e3,
|
|
656
1020
|
e
|
|
657
1021
|
);
|
|
658
1022
|
return {
|
|
659
|
-
url:
|
|
1023
|
+
url: u(r.url, `${t}.url`, 2e3, e),
|
|
660
1024
|
...o ? { method: o } : {},
|
|
661
1025
|
...i ? { headers: i } : {},
|
|
662
1026
|
...a ? { secretEncrypted: a } : {}
|
|
663
1027
|
};
|
|
664
1028
|
}
|
|
665
|
-
function
|
|
666
|
-
const r =
|
|
667
|
-
|
|
1029
|
+
function Ce(n, t, e) {
|
|
1030
|
+
const r = h(n, t, e), o = r.type;
|
|
1031
|
+
if (o === "channel") {
|
|
1032
|
+
f(
|
|
1033
|
+
r,
|
|
1034
|
+
t,
|
|
1035
|
+
["type", "channelId", "channelName", "isPrivate"],
|
|
1036
|
+
e
|
|
1037
|
+
);
|
|
1038
|
+
const i = y(
|
|
1039
|
+
r.channelName,
|
|
1040
|
+
`${t}.channelName`,
|
|
1041
|
+
l.attachmentTitle,
|
|
1042
|
+
e
|
|
1043
|
+
), a = r.isPrivate === void 0 || r.isPrivate === null ? void 0 : $(
|
|
1044
|
+
r.isPrivate,
|
|
1045
|
+
!1,
|
|
1046
|
+
`${t}.isPrivate`,
|
|
1047
|
+
e
|
|
1048
|
+
);
|
|
1049
|
+
return {
|
|
1050
|
+
type: "channel",
|
|
1051
|
+
channelId: u(
|
|
1052
|
+
r.channelId,
|
|
1053
|
+
`${t}.channelId`,
|
|
1054
|
+
l.id,
|
|
1055
|
+
e
|
|
1056
|
+
),
|
|
1057
|
+
...i ? { channelName: i } : {},
|
|
1058
|
+
...a !== void 0 ? { isPrivate: a } : {}
|
|
1059
|
+
};
|
|
1060
|
+
}
|
|
1061
|
+
return o === "dm" ? (f(r, t, ["type", "recipient"], e), c(
|
|
1062
|
+
e,
|
|
1063
|
+
`${t}.type`,
|
|
1064
|
+
"Slack DM delivery is not supported in V1."
|
|
1065
|
+
), {
|
|
1066
|
+
type: "dm",
|
|
1067
|
+
recipient: L(r.recipient, 0, e, `${t}.recipient`)
|
|
1068
|
+
}) : (c(e, `${t}.type`, "Expected channel."), { type: "channel", channelId: "" });
|
|
1069
|
+
}
|
|
1070
|
+
function xe(n, t, e) {
|
|
1071
|
+
if (n == null)
|
|
1072
|
+
return;
|
|
1073
|
+
if (!Array.isArray(n)) {
|
|
1074
|
+
c(e, t, "Expected an array.");
|
|
1075
|
+
return;
|
|
1076
|
+
}
|
|
1077
|
+
const r = n.map(
|
|
1078
|
+
(o, i) => L(o, i, e, t)
|
|
1079
|
+
);
|
|
1080
|
+
return r.length > 0 ? r : void 0;
|
|
1081
|
+
}
|
|
1082
|
+
function Ae(n, t, e) {
|
|
1083
|
+
if (n == null)
|
|
1084
|
+
return;
|
|
1085
|
+
const r = h(n, t, e);
|
|
1086
|
+
f(
|
|
1087
|
+
r,
|
|
1088
|
+
t,
|
|
1089
|
+
[
|
|
1090
|
+
"destination",
|
|
1091
|
+
"threadMentions",
|
|
1092
|
+
"postThreadDetail",
|
|
1093
|
+
"includeDashboardLink",
|
|
1094
|
+
"includeBriefingLink"
|
|
1095
|
+
],
|
|
1096
|
+
e
|
|
1097
|
+
);
|
|
1098
|
+
const o = xe(
|
|
1099
|
+
r.threadMentions,
|
|
1100
|
+
`${t}.threadMentions`,
|
|
1101
|
+
e
|
|
1102
|
+
), i = $(
|
|
1103
|
+
r.postThreadDetail,
|
|
1104
|
+
!0,
|
|
1105
|
+
`${t}.postThreadDetail`,
|
|
1106
|
+
e
|
|
1107
|
+
), a = $(
|
|
1108
|
+
r.includeDashboardLink,
|
|
1109
|
+
!0,
|
|
1110
|
+
`${t}.includeDashboardLink`,
|
|
1111
|
+
e
|
|
1112
|
+
), d = $(
|
|
1113
|
+
r.includeBriefingLink,
|
|
1114
|
+
!0,
|
|
1115
|
+
`${t}.includeBriefingLink`,
|
|
1116
|
+
e
|
|
1117
|
+
);
|
|
1118
|
+
return {
|
|
1119
|
+
destination: Ce(
|
|
1120
|
+
r.destination,
|
|
1121
|
+
`${t}.destination`,
|
|
1122
|
+
e
|
|
1123
|
+
),
|
|
1124
|
+
...o ? { threadMentions: o } : {},
|
|
1125
|
+
...r.postThreadDetail !== void 0 ? { postThreadDetail: i } : {},
|
|
1126
|
+
...r.includeDashboardLink !== void 0 ? { includeDashboardLink: a } : {},
|
|
1127
|
+
...r.includeBriefingLink !== void 0 ? { includeBriefingLink: d } : {}
|
|
1128
|
+
};
|
|
1129
|
+
}
|
|
1130
|
+
function Te(n, t, e) {
|
|
1131
|
+
const r = h(n, t, e);
|
|
1132
|
+
f(
|
|
668
1133
|
r,
|
|
669
|
-
|
|
1134
|
+
t,
|
|
670
1135
|
[
|
|
671
1136
|
"subjectOverride",
|
|
672
1137
|
"titleOverride",
|
|
673
1138
|
"summaryOverride",
|
|
674
1139
|
"actionBlockVisible",
|
|
1140
|
+
"formatProfile",
|
|
1141
|
+
"slackConfig",
|
|
675
1142
|
"webhookConfig"
|
|
676
1143
|
],
|
|
677
1144
|
e
|
|
678
1145
|
);
|
|
679
|
-
const o =
|
|
1146
|
+
const o = I(
|
|
1147
|
+
r.formatProfile,
|
|
1148
|
+
`${t}.formatProfile`,
|
|
1149
|
+
Q,
|
|
1150
|
+
"concise, balanced, or detailed",
|
|
1151
|
+
e
|
|
1152
|
+
), i = y(
|
|
680
1153
|
r.subjectOverride,
|
|
681
|
-
`${
|
|
1154
|
+
`${t}.subjectOverride`,
|
|
682
1155
|
500,
|
|
683
1156
|
e
|
|
684
|
-
),
|
|
1157
|
+
), a = y(
|
|
685
1158
|
r.titleOverride,
|
|
686
|
-
`${
|
|
1159
|
+
`${t}.titleOverride`,
|
|
687
1160
|
500,
|
|
688
1161
|
e
|
|
689
|
-
),
|
|
1162
|
+
), d = y(
|
|
690
1163
|
r.summaryOverride,
|
|
691
|
-
`${
|
|
1164
|
+
`${t}.summaryOverride`,
|
|
692
1165
|
2e3,
|
|
693
1166
|
e
|
|
694
|
-
),
|
|
1167
|
+
), m = $(
|
|
695
1168
|
r.actionBlockVisible,
|
|
696
1169
|
!0,
|
|
697
|
-
`${
|
|
1170
|
+
`${t}.actionBlockVisible`,
|
|
698
1171
|
e
|
|
699
|
-
),
|
|
1172
|
+
), s = Ee(
|
|
700
1173
|
r.webhookConfig,
|
|
701
|
-
`${
|
|
1174
|
+
`${t}.webhookConfig`,
|
|
1175
|
+
e
|
|
1176
|
+
), p = Ae(
|
|
1177
|
+
r.slackConfig,
|
|
1178
|
+
`${t}.slackConfig`,
|
|
702
1179
|
e
|
|
703
1180
|
);
|
|
704
1181
|
return {
|
|
705
|
-
...o ? {
|
|
706
|
-
...i ? {
|
|
707
|
-
...a ? {
|
|
708
|
-
...
|
|
709
|
-
...
|
|
1182
|
+
...o ? { formatProfile: o } : {},
|
|
1183
|
+
...i ? { subjectOverride: i } : {},
|
|
1184
|
+
...a ? { titleOverride: a } : {},
|
|
1185
|
+
...d ? { summaryOverride: d } : {},
|
|
1186
|
+
...r.actionBlockVisible !== void 0 ? { actionBlockVisible: m } : {},
|
|
1187
|
+
...p ? { slackConfig: p } : {},
|
|
1188
|
+
...s ? { webhookConfig: s } : {}
|
|
710
1189
|
};
|
|
711
1190
|
}
|
|
712
|
-
function
|
|
713
|
-
if (
|
|
1191
|
+
function Se(n, t) {
|
|
1192
|
+
if (n == null)
|
|
714
1193
|
return;
|
|
715
|
-
const e =
|
|
1194
|
+
const e = h(n, "deliveryConfig.channelConfigs", t), r = {};
|
|
716
1195
|
return Object.entries(e).forEach(([o, i]) => {
|
|
717
|
-
if (!
|
|
718
|
-
|
|
719
|
-
|
|
1196
|
+
if (!q(o)) {
|
|
1197
|
+
c(
|
|
1198
|
+
t,
|
|
720
1199
|
`deliveryConfig.channelConfigs.${o}`,
|
|
721
1200
|
"Expected a supported delivery channel."
|
|
722
1201
|
);
|
|
723
1202
|
return;
|
|
724
1203
|
}
|
|
725
|
-
r[o] =
|
|
1204
|
+
r[o] = Te(
|
|
726
1205
|
i,
|
|
727
1206
|
`deliveryConfig.channelConfigs.${o}`,
|
|
728
|
-
|
|
1207
|
+
t
|
|
729
1208
|
);
|
|
730
1209
|
}), Object.keys(r).length > 0 ? r : void 0;
|
|
731
1210
|
}
|
|
732
|
-
function
|
|
733
|
-
|
|
1211
|
+
function ke(n, t) {
|
|
1212
|
+
var m, s, p;
|
|
1213
|
+
if (n == null)
|
|
734
1214
|
return null;
|
|
735
|
-
const e =
|
|
736
|
-
|
|
1215
|
+
const e = h(n, "deliveryConfig", t);
|
|
1216
|
+
f(
|
|
737
1217
|
e,
|
|
738
1218
|
"deliveryConfig",
|
|
739
1219
|
["recipients", "channels", "channelConfigs"],
|
|
740
|
-
|
|
1220
|
+
t
|
|
741
1221
|
);
|
|
742
|
-
const r =
|
|
743
|
-
return
|
|
744
|
-
|
|
1222
|
+
const r = Se(e.channelConfigs, t), o = Ie(e.recipients, t), i = be(e.channels, t), a = ((s = (m = r == null ? void 0 : r.SLACK) == null ? void 0 : m.slackConfig) == null ? void 0 : s.destination.type) === "channel" && !!r.SLACK.slackConfig.destination.channelId.trim();
|
|
1223
|
+
return i.some(
|
|
1224
|
+
(v) => v !== "SLACK"
|
|
1225
|
+
) && o.length === 0 && c(
|
|
1226
|
+
t,
|
|
745
1227
|
"deliveryConfig.recipients",
|
|
746
1228
|
"Add at least one recipient or remove delivery config."
|
|
747
|
-
), i.length === 0 &&
|
|
748
|
-
|
|
1229
|
+
), i.length === 0 && c(
|
|
1230
|
+
t,
|
|
749
1231
|
"deliveryConfig.channels",
|
|
750
1232
|
"Choose at least one delivery channel or remove delivery config."
|
|
1233
|
+
), i.includes("SLACK") && !a && c(
|
|
1234
|
+
t,
|
|
1235
|
+
"deliveryConfig.channelConfigs.SLACK.slackConfig.destination.channelId",
|
|
1236
|
+
"Choose a Slack channel destination."
|
|
1237
|
+
), !i.includes("SLACK") && ((p = r == null ? void 0 : r.SLACK) != null && p.slackConfig) && c(
|
|
1238
|
+
t,
|
|
1239
|
+
"deliveryConfig.channelConfigs.SLACK",
|
|
1240
|
+
"Slack config requires SLACK in deliveryConfig.channels."
|
|
751
1241
|
), {
|
|
752
1242
|
recipients: o,
|
|
753
1243
|
channels: i,
|
|
754
1244
|
...r ? { channelConfigs: r } : {}
|
|
755
1245
|
};
|
|
756
1246
|
}
|
|
757
|
-
function
|
|
758
|
-
const
|
|
759
|
-
|
|
1247
|
+
function w(n) {
|
|
1248
|
+
const t = [], e = h(n, "draft", t);
|
|
1249
|
+
f(
|
|
760
1250
|
e,
|
|
761
1251
|
"draft",
|
|
762
1252
|
[
|
|
@@ -772,77 +1262,80 @@ function T(t) {
|
|
|
772
1262
|
"limits",
|
|
773
1263
|
"deliveryConfig"
|
|
774
1264
|
],
|
|
775
|
-
|
|
1265
|
+
t
|
|
776
1266
|
);
|
|
777
|
-
const r =
|
|
1267
|
+
const r = u(
|
|
778
1268
|
e.name,
|
|
779
1269
|
"name",
|
|
780
|
-
|
|
781
|
-
|
|
782
|
-
), o =
|
|
1270
|
+
l.name,
|
|
1271
|
+
t
|
|
1272
|
+
), o = y(
|
|
783
1273
|
e.description,
|
|
784
1274
|
"description",
|
|
785
|
-
|
|
786
|
-
|
|
787
|
-
) ?? null, i =
|
|
788
|
-
return
|
|
1275
|
+
l.description,
|
|
1276
|
+
t
|
|
1277
|
+
) ?? null, i = y(e.scheduleExpr, "scheduleExpr", 500, t) ?? null, a = y(e.timezone, "timezone", 200, t) ?? "UTC", d = ie(e.status, t), m = O(e.source, t), s = R(e.body, t), p = V(e.attachments, t), v = F(e.presentation, t), B = M(e.limits, t), K = ke(e.deliveryConfig, t);
|
|
1278
|
+
return P(s, p, t), _(t), {
|
|
789
1279
|
name: r,
|
|
790
1280
|
description: o,
|
|
791
|
-
status:
|
|
1281
|
+
status: d,
|
|
792
1282
|
scheduleExpr: i,
|
|
793
1283
|
timezone: a,
|
|
794
|
-
source:
|
|
1284
|
+
source: m,
|
|
795
1285
|
body: s,
|
|
796
|
-
attachments:
|
|
797
|
-
presentation:
|
|
798
|
-
...
|
|
799
|
-
deliveryConfig:
|
|
1286
|
+
attachments: p,
|
|
1287
|
+
presentation: v,
|
|
1288
|
+
...B ? { limits: B } : {},
|
|
1289
|
+
deliveryConfig: K
|
|
800
1290
|
};
|
|
801
1291
|
}
|
|
802
|
-
function
|
|
803
|
-
return
|
|
1292
|
+
function ze(n) {
|
|
1293
|
+
return w(n);
|
|
804
1294
|
}
|
|
805
|
-
function
|
|
806
|
-
return
|
|
1295
|
+
function De(n) {
|
|
1296
|
+
return w(n);
|
|
807
1297
|
}
|
|
808
|
-
function
|
|
1298
|
+
function Ne(n) {
|
|
809
1299
|
try {
|
|
810
|
-
return { valid: !0, value:
|
|
811
|
-
} catch (
|
|
812
|
-
if (
|
|
813
|
-
return { valid: !1, issues:
|
|
814
|
-
throw
|
|
1300
|
+
return { valid: !0, value: w(n), issues: [] };
|
|
1301
|
+
} catch (t) {
|
|
1302
|
+
if (t instanceof A)
|
|
1303
|
+
return { valid: !1, issues: t.issues };
|
|
1304
|
+
throw t;
|
|
815
1305
|
}
|
|
816
1306
|
}
|
|
817
|
-
function
|
|
1307
|
+
function Oe(n) {
|
|
818
1308
|
try {
|
|
819
|
-
return { valid: !0, value:
|
|
820
|
-
} catch (
|
|
821
|
-
if (
|
|
822
|
-
return { valid: !1, issues:
|
|
823
|
-
throw
|
|
1309
|
+
return { valid: !0, value: j(n), issues: [] };
|
|
1310
|
+
} catch (t) {
|
|
1311
|
+
if (t instanceof A)
|
|
1312
|
+
return { valid: !1, issues: t.issues };
|
|
1313
|
+
throw t;
|
|
824
1314
|
}
|
|
825
1315
|
}
|
|
826
|
-
function
|
|
827
|
-
return typeof
|
|
1316
|
+
function Re(n) {
|
|
1317
|
+
return typeof n == "string" && D.has(n);
|
|
828
1318
|
}
|
|
829
|
-
function
|
|
830
|
-
return typeof
|
|
1319
|
+
function q(n) {
|
|
1320
|
+
return typeof n == "string" && X.has(n);
|
|
831
1321
|
}
|
|
832
1322
|
export {
|
|
833
|
-
|
|
834
|
-
|
|
835
|
-
|
|
836
|
-
|
|
837
|
-
|
|
838
|
-
|
|
839
|
-
|
|
840
|
-
|
|
841
|
-
|
|
842
|
-
|
|
843
|
-
|
|
844
|
-
|
|
845
|
-
|
|
846
|
-
|
|
847
|
-
|
|
1323
|
+
H as BRIEFING_ARTIFACT_FORMATS,
|
|
1324
|
+
g as BRIEFING_CONTENT_LIMITS,
|
|
1325
|
+
S as BRIEFING_KIND,
|
|
1326
|
+
l as BRIEFING_TEXT_LIMITS,
|
|
1327
|
+
A as BriefingContractError,
|
|
1328
|
+
k as DEFAULT_BRIEFING_ARTIFACT_FORMATS,
|
|
1329
|
+
Le as MAX_BRIEFING_ATTACHMENTS,
|
|
1330
|
+
Be as buildBriefingJobConfig,
|
|
1331
|
+
ze as buildCreateBriefingRequest,
|
|
1332
|
+
De as buildUpdateBriefingRequest,
|
|
1333
|
+
Re as isBriefingArtifactFormat,
|
|
1334
|
+
q as isBriefingDeliveryChannel,
|
|
1335
|
+
pe as normalizeBriefingContentDocument,
|
|
1336
|
+
w as normalizeBriefingDraft,
|
|
1337
|
+
j as normalizeBriefingJobConfig,
|
|
1338
|
+
we as validateBriefingContentDocument,
|
|
1339
|
+
Ne as validateBriefingDraft,
|
|
1340
|
+
Oe as validateBriefingJobConfig
|
|
848
1341
|
};
|