@seclai/sdk 1.6.0 → 1.7.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +42 -0
- package/README.md +209 -33
- package/dist/index.cjs +365 -135
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +750 -84
- package/dist/index.d.ts +750 -84
- package/dist/index.js +365 -135
- package/dist/index.js.map +1 -1
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -7,10 +7,16 @@ var SeclaiApiVersion = {
|
|
|
7
7
|
V2026_09_28: "2026-09-28",
|
|
8
8
|
V2026_09_30: "2026-09-30",
|
|
9
9
|
V2026_10_03: "2026-10-03",
|
|
10
|
+
V2026_10_05: "2026-10-05",
|
|
11
|
+
V2026_10_13: "2026-10-13",
|
|
12
|
+
V2026_10_16: "2026-10-16",
|
|
13
|
+
V2026_10_18: "2026-10-18",
|
|
14
|
+
V2026_10_19: "2026-10-19",
|
|
15
|
+
V2026_10_21: "2026-10-21",
|
|
10
16
|
/** Baseline applied to an unpinned, header-less caller. */
|
|
11
17
|
Default: "2026-07-01",
|
|
12
18
|
/** Newest version known to this SDK release. May lag the server. */
|
|
13
|
-
Latest: "2026-10-
|
|
19
|
+
Latest: "2026-10-21"
|
|
14
20
|
};
|
|
15
21
|
var KNOWN_API_VERSIONS = Object.entries(SeclaiApiVersion).filter(([k]) => k.startsWith("V")).map(([, v]) => v);
|
|
16
22
|
|
|
@@ -372,11 +378,46 @@ function buildURL(baseUrl, path, query) {
|
|
|
372
378
|
}
|
|
373
379
|
function listItems(res) {
|
|
374
380
|
if (Array.isArray(res)) return res;
|
|
375
|
-
|
|
381
|
+
if (res !== null && typeof res === "object" && "data" in res) {
|
|
382
|
+
const data = res.data;
|
|
383
|
+
if (Array.isArray(data)) return data;
|
|
384
|
+
if (data === null) return [];
|
|
385
|
+
}
|
|
386
|
+
throw notAList();
|
|
387
|
+
}
|
|
388
|
+
function notAList() {
|
|
389
|
+
return new SeclaiError(
|
|
390
|
+
"Expected a list response: an array, or an object carrying the items under `data` or the endpoint's own key."
|
|
391
|
+
);
|
|
392
|
+
}
|
|
393
|
+
function keyedList(res, key, flat = []) {
|
|
394
|
+
if (Array.isArray(res)) return { [key]: res };
|
|
395
|
+
if (res === null || typeof res !== "object") throw notAList();
|
|
396
|
+
const body = { ...res };
|
|
397
|
+
if (Array.isArray(body.data)) body[key] = body.data;
|
|
398
|
+
else if ("data" in body && body.data === null) body[key] = [];
|
|
399
|
+
else if (!Array.isArray(body[key])) throw notAList();
|
|
400
|
+
const pagination = body.pagination;
|
|
401
|
+
for (const field of flat) {
|
|
402
|
+
if (body[field] === void 0 && pagination?.[field] !== void 0) body[field] = pagination[field];
|
|
403
|
+
}
|
|
404
|
+
return body;
|
|
405
|
+
}
|
|
406
|
+
var PAGE_COUNTERS = ["total", "page", "limit"];
|
|
407
|
+
function mergeHeaders(...layers) {
|
|
408
|
+
const byName = /* @__PURE__ */ new Map();
|
|
409
|
+
for (const layer of layers) {
|
|
410
|
+
for (const [name, value] of Object.entries(layer ?? {})) {
|
|
411
|
+
if (value === void 0 || value === null) continue;
|
|
412
|
+
const lower = name.toLowerCase();
|
|
413
|
+
byName.delete(lower);
|
|
414
|
+
byName.set(lower, [name, value]);
|
|
415
|
+
}
|
|
416
|
+
}
|
|
417
|
+
return Object.fromEntries(byName.values());
|
|
376
418
|
}
|
|
377
|
-
function
|
|
378
|
-
|
|
379
|
-
return Array.isArray(body.models) || !Array.isArray(body.data) ? body : { ...body, models: body.data };
|
|
419
|
+
function headerKey(headers, name) {
|
|
420
|
+
return Object.keys(headers ?? {}).filter((key) => key.toLowerCase() === name).pop();
|
|
380
421
|
}
|
|
381
422
|
async function safeText(response) {
|
|
382
423
|
try {
|
|
@@ -493,6 +534,7 @@ function inferMimeType(fileName) {
|
|
|
493
534
|
var Seclai = class {
|
|
494
535
|
baseUrl;
|
|
495
536
|
defaultHeaders;
|
|
537
|
+
allowUnknownApiVersion;
|
|
496
538
|
fetcher;
|
|
497
539
|
_authState = null;
|
|
498
540
|
_authInitPromise = null;
|
|
@@ -523,22 +565,13 @@ var Seclai = class {
|
|
|
523
565
|
);
|
|
524
566
|
}
|
|
525
567
|
this.baseUrl = opts.baseUrl ?? getEnv2("SECLAI_API_URL") ?? SECLAI_API_URL;
|
|
526
|
-
|
|
527
|
-
|
|
528
|
-
|
|
529
|
-
|
|
530
|
-
|
|
531
|
-
|
|
532
|
-
|
|
533
|
-
if (key.toLowerCase() === "seclai-version") versionKey = key;
|
|
534
|
-
}
|
|
535
|
-
const effectiveVersion = versionKey ? merged[versionKey] : void 0;
|
|
536
|
-
if (effectiveVersion && !opts.allowUnknownApiVersion && !KNOWN_API_VERSIONS.includes(effectiveVersion)) {
|
|
537
|
-
const via = versionKey === "Seclai-Version" && merged[versionKey] === opts.apiVersion ? "apiVersion" : `defaultHeaders['${versionKey}']`;
|
|
538
|
-
throw new SeclaiConfigurationError(
|
|
539
|
-
`Unknown API version '${effectiveVersion}' (via ${via}). This release was built against ${KNOWN_API_VERSIONS.join(", ")}. A newer API version can change response shapes, which this client would decode incorrectly rather than reject. Upgrade the package, or set allowUnknownApiVersion to proceed anyway.`
|
|
540
|
-
);
|
|
541
|
-
}
|
|
568
|
+
this.allowUnknownApiVersion = opts.allowUnknownApiVersion ?? false;
|
|
569
|
+
const merged = mergeHeaders(
|
|
570
|
+
opts.apiVersion ? { "Seclai-Version": opts.apiVersion } : void 0,
|
|
571
|
+
opts.defaultHeaders
|
|
572
|
+
);
|
|
573
|
+
const defaultKey = headerKey(opts.defaultHeaders, "seclai-version");
|
|
574
|
+
this.assertKnownApiVersion(merged, defaultKey ? `defaultHeaders['${defaultKey}']` : "apiVersion");
|
|
542
575
|
this.defaultHeaders = merged;
|
|
543
576
|
this.fetcher = fetcher;
|
|
544
577
|
const accessTokenProvider = typeof opts.accessToken === "function" ? opts.accessToken : void 0;
|
|
@@ -577,6 +610,26 @@ var Seclai = class {
|
|
|
577
610
|
}
|
|
578
611
|
return this._authState;
|
|
579
612
|
}
|
|
613
|
+
/** Throw unless the `Seclai-Version` in `headers` is one this release was built against. */
|
|
614
|
+
assertKnownApiVersion(headers, via) {
|
|
615
|
+
const key = headerKey(headers, "seclai-version");
|
|
616
|
+
if (key === void 0 || this.allowUnknownApiVersion) return;
|
|
617
|
+
const version = headers[key] ?? "";
|
|
618
|
+
if (KNOWN_API_VERSIONS.includes(version)) return;
|
|
619
|
+
throw new SeclaiConfigurationError(
|
|
620
|
+
`Unknown API version '${version}' (via ${via}). This release was built against ${KNOWN_API_VERSIONS.join(", ")}. A newer API version can change response shapes, which this client would decode incorrectly rather than reject. Upgrade the package, or set allowUnknownApiVersion to proceed anyway.`
|
|
621
|
+
);
|
|
622
|
+
}
|
|
623
|
+
/**
|
|
624
|
+
* The headers one request sends: `layers` merged in order, later winning,
|
|
625
|
+
* with the resulting `Seclai-Version` checked against the known versions.
|
|
626
|
+
*/
|
|
627
|
+
requestHeaders(layers, perRequest) {
|
|
628
|
+
const headers = mergeHeaders(...layers);
|
|
629
|
+
const requestKey = headerKey(perRequest, "seclai-version");
|
|
630
|
+
this.assertKnownApiVersion(headers, requestKey ? `headers['${requestKey}']` : "defaultHeaders");
|
|
631
|
+
return headers;
|
|
632
|
+
}
|
|
580
633
|
/** Resolve auth headers for the current request. */
|
|
581
634
|
async authHeaders() {
|
|
582
635
|
const state = await this.ensureAuth();
|
|
@@ -600,16 +653,17 @@ var Seclai = class {
|
|
|
600
653
|
async request(method, path, opts) {
|
|
601
654
|
const url = buildURL(this.baseUrl, path, opts?.query);
|
|
602
655
|
const authHeaders = await this.authHeaders();
|
|
603
|
-
const headers = {
|
|
604
|
-
...this.defaultHeaders,
|
|
605
|
-
...opts?.headers ?? {},
|
|
606
|
-
...authHeaders
|
|
607
|
-
};
|
|
608
656
|
let body;
|
|
609
|
-
if (opts?.json !== void 0)
|
|
610
|
-
|
|
611
|
-
|
|
612
|
-
|
|
657
|
+
if (opts?.json !== void 0) body = JSON.stringify(opts.json);
|
|
658
|
+
const headers = this.requestHeaders(
|
|
659
|
+
[
|
|
660
|
+
body === void 0 ? void 0 : { "content-type": "application/json" },
|
|
661
|
+
this.defaultHeaders,
|
|
662
|
+
opts?.headers,
|
|
663
|
+
authHeaders
|
|
664
|
+
],
|
|
665
|
+
opts?.headers
|
|
666
|
+
);
|
|
613
667
|
const init = { method, headers };
|
|
614
668
|
if (body !== void 0) {
|
|
615
669
|
init.body = body;
|
|
@@ -661,16 +715,17 @@ var Seclai = class {
|
|
|
661
715
|
async requestRaw(method, path, opts) {
|
|
662
716
|
const url = buildURL(this.baseUrl, path, opts?.query);
|
|
663
717
|
const authHeaders = await this.authHeaders();
|
|
664
|
-
const headers = {
|
|
665
|
-
...this.defaultHeaders,
|
|
666
|
-
...opts?.headers ?? {},
|
|
667
|
-
...authHeaders
|
|
668
|
-
};
|
|
669
718
|
let body;
|
|
670
|
-
if (opts?.json !== void 0)
|
|
671
|
-
|
|
672
|
-
|
|
673
|
-
|
|
719
|
+
if (opts?.json !== void 0) body = JSON.stringify(opts.json);
|
|
720
|
+
const headers = this.requestHeaders(
|
|
721
|
+
[
|
|
722
|
+
body === void 0 ? void 0 : { "content-type": "application/json" },
|
|
723
|
+
this.defaultHeaders,
|
|
724
|
+
opts?.headers,
|
|
725
|
+
authHeaders
|
|
726
|
+
],
|
|
727
|
+
opts?.headers
|
|
728
|
+
);
|
|
674
729
|
const init = { method, headers };
|
|
675
730
|
if (body !== void 0) init.body = body;
|
|
676
731
|
if (opts?.signal) init.signal = opts.signal;
|
|
@@ -702,12 +757,9 @@ var Seclai = class {
|
|
|
702
757
|
async uploadFile(path, opts) {
|
|
703
758
|
const url = buildURL(this.baseUrl, path);
|
|
704
759
|
const authHeaders = await this.authHeaders();
|
|
705
|
-
const headers =
|
|
706
|
-
|
|
707
|
-
|
|
708
|
-
};
|
|
709
|
-
delete headers["content-type"];
|
|
710
|
-
delete headers["Content-Type"];
|
|
760
|
+
const headers = this.requestHeaders([this.defaultHeaders, authHeaders]);
|
|
761
|
+
const contentType = headerKey(headers, "content-type");
|
|
762
|
+
if (contentType !== void 0) delete headers[contentType];
|
|
711
763
|
const form = new FormData();
|
|
712
764
|
const mimeType = opts.mimeType ?? inferMimeType(opts.fileName);
|
|
713
765
|
const blob = toBlob(opts.file, mimeType);
|
|
@@ -874,7 +926,7 @@ var Seclai = class {
|
|
|
874
926
|
* @returns The calling agents.
|
|
875
927
|
*/
|
|
876
928
|
async getAgentCallers(agentId) {
|
|
877
|
-
return await this.request("GET", `/agents/${agentId}/callers`);
|
|
929
|
+
return listItems(await this.request("GET", `/agents/${agentId}/callers`));
|
|
878
930
|
}
|
|
879
931
|
// ═══════════════════════════════════════════════════════════════════════════
|
|
880
932
|
// Agent Export / Import
|
|
@@ -1012,23 +1064,25 @@ var Seclai = class {
|
|
|
1012
1064
|
* Run an agent in streaming mode (SSE) and wait for the final result.
|
|
1013
1065
|
*
|
|
1014
1066
|
* Consumes the entire SSE stream and returns only the terminal `done` payload.
|
|
1015
|
-
* For real-time event access, use {@link runStreamingAgent} instead.
|
|
1067
|
+
* For real-time event access, use {@link runStreamingAgent} instead. The body
|
|
1068
|
+
* takes no `include_reasoning`, and one passed anyway is not sent: this method
|
|
1069
|
+
* returns no `stream_reasoning` events.
|
|
1016
1070
|
*
|
|
1017
1071
|
* @param agentId - Agent identifier.
|
|
1018
|
-
* @param body - Streaming run request payload
|
|
1072
|
+
* @param body - Streaming run request payload, without `include_reasoning`.
|
|
1019
1073
|
* @param opts - Timeout and abort signal options.
|
|
1020
1074
|
* @returns Final agent run payload from the `done` event.
|
|
1021
1075
|
* @throws {@link SeclaiStreamingError} If the stream ends before a `done` event.
|
|
1022
1076
|
*/
|
|
1023
1077
|
async runStreamingAgentAndWait(agentId, body, opts) {
|
|
1078
|
+
const { include_reasoning: _ignored, ...runBody } = body;
|
|
1024
1079
|
const url = buildURL(this.baseUrl, `/agents/${agentId}/runs/stream`);
|
|
1025
1080
|
const authHdrs = await this.authHeaders();
|
|
1026
|
-
const headers =
|
|
1027
|
-
|
|
1028
|
-
|
|
1029
|
-
accept: "text/event-stream",
|
|
1030
|
-
|
|
1031
|
-
};
|
|
1081
|
+
const headers = this.requestHeaders([
|
|
1082
|
+
this.defaultHeaders,
|
|
1083
|
+
authHdrs,
|
|
1084
|
+
{ accept: "text/event-stream", "content-type": "application/json" }
|
|
1085
|
+
]);
|
|
1032
1086
|
const timeoutMs = opts?.timeoutMs ?? 6e4;
|
|
1033
1087
|
const timeoutController = new AbortController();
|
|
1034
1088
|
let timedOut = false;
|
|
@@ -1039,7 +1093,7 @@ var Seclai = class {
|
|
|
1039
1093
|
const signal = anySignal([opts?.signal, timeoutController.signal]);
|
|
1040
1094
|
let lastSeen;
|
|
1041
1095
|
try {
|
|
1042
|
-
const init = { method: "POST", headers, body: JSON.stringify(
|
|
1096
|
+
const init = { method: "POST", headers, body: JSON.stringify(runBody) };
|
|
1043
1097
|
if (signal) init.signal = signal;
|
|
1044
1098
|
const response = await this.fetcher(url, init);
|
|
1045
1099
|
const contentType = response.headers.get("content-type") ?? "";
|
|
@@ -1133,12 +1187,11 @@ var Seclai = class {
|
|
|
1133
1187
|
async *runStreamingAgent(agentId, body, opts) {
|
|
1134
1188
|
const url = buildURL(this.baseUrl, `/agents/${agentId}/runs/stream`);
|
|
1135
1189
|
const authHdrs = await this.authHeaders();
|
|
1136
|
-
const headers =
|
|
1137
|
-
|
|
1138
|
-
|
|
1139
|
-
accept: "text/event-stream",
|
|
1140
|
-
|
|
1141
|
-
};
|
|
1190
|
+
const headers = this.requestHeaders([
|
|
1191
|
+
this.defaultHeaders,
|
|
1192
|
+
authHdrs,
|
|
1193
|
+
{ accept: "text/event-stream", "content-type": "application/json" }
|
|
1194
|
+
]);
|
|
1142
1195
|
const timeoutMs = opts?.timeoutMs ?? 6e4;
|
|
1143
1196
|
const timeoutController = new AbortController();
|
|
1144
1197
|
let timedOut = false;
|
|
@@ -1269,19 +1322,26 @@ var Seclai = class {
|
|
|
1269
1322
|
* @returns Paginated list of evaluation results.
|
|
1270
1323
|
*/
|
|
1271
1324
|
async listRunEvaluationResults(agentId, runId, opts = {}) {
|
|
1272
|
-
|
|
1273
|
-
|
|
1274
|
-
|
|
1275
|
-
|
|
1325
|
+
return keyedList(
|
|
1326
|
+
await this.request("GET", `/agents/${agentId}/runs/${runId}/evaluation-results`, {
|
|
1327
|
+
query: { page: opts.page, limit: opts.limit }
|
|
1328
|
+
}),
|
|
1329
|
+
"data",
|
|
1330
|
+
PAGE_COUNTERS
|
|
1331
|
+
);
|
|
1276
1332
|
}
|
|
1277
1333
|
// ═══════════════════════════════════════════════════════════════════════════
|
|
1278
1334
|
// Agent Input Uploads
|
|
1279
1335
|
// ═══════════════════════════════════════════════════════════════════════════
|
|
1280
1336
|
/**
|
|
1281
|
-
* Upload a file to use as input for a `dynamic_input` agent run.
|
|
1337
|
+
* Upload a file to use as input for a `dynamic_input` agent run. Any other
|
|
1338
|
+
* agent rejects the upload with HTTP 400. Files are limited to 200 MB.
|
|
1282
1339
|
*
|
|
1283
|
-
*
|
|
1284
|
-
*
|
|
1340
|
+
* From API version `2026-10-16` a file of any type is accepted and is `ready`
|
|
1341
|
+
* at once: pass its `id` as `input_upload_id` to {@link runAgent}.
|
|
1342
|
+
* Earlier versions accept only a fixed list of extensions and write each
|
|
1343
|
+
* file's extracted text into the run's `input`, so poll
|
|
1344
|
+
* {@link getAgentInputUploadStatus} until `status` is `ready` before running.
|
|
1285
1345
|
*
|
|
1286
1346
|
* @param agentId - Agent identifier.
|
|
1287
1347
|
* @param opts - File payload and optional metadata.
|
|
@@ -1323,12 +1383,16 @@ var Seclai = class {
|
|
|
1323
1383
|
* @param runId - Run identifier.
|
|
1324
1384
|
* @param attachmentId - URL-safe-base64-encoded `storage_key` of the attachment
|
|
1325
1385
|
* (as surfaced in run output manifests and webhook/email payloads).
|
|
1326
|
-
* @param opts - Optional `downloadName` filename hint for the download
|
|
1386
|
+
* @param opts - Optional `downloadName` filename hint for the download
|
|
1387
|
+
* disposition, and `signal`, which cancels the request; with a standard `fetch` this
|
|
1388
|
+
* includes reading the body, so `AbortSignal.timeout(ms)` bounds the whole
|
|
1389
|
+
* transfer.
|
|
1327
1390
|
* @returns Raw response with the attachment bytes.
|
|
1328
1391
|
*/
|
|
1329
1392
|
async downloadAgentRunAttachment(runId, attachmentId, opts = {}) {
|
|
1330
1393
|
return await this.requestRaw("GET", `/v2/agent-runs/${runId}/attachments/${attachmentId}`, {
|
|
1331
|
-
query: { download_name: opts.downloadName }
|
|
1394
|
+
query: { download_name: opts.downloadName },
|
|
1395
|
+
signal: opts.signal
|
|
1332
1396
|
});
|
|
1333
1397
|
}
|
|
1334
1398
|
// ═══════════════════════════════════════════════════════════════════════════
|
|
@@ -1400,20 +1464,21 @@ var Seclai = class {
|
|
|
1400
1464
|
/**
|
|
1401
1465
|
* List evaluation criteria for an agent, with pagination metadata.
|
|
1402
1466
|
*
|
|
1403
|
-
*
|
|
1404
|
-
*
|
|
1405
|
-
*
|
|
1406
|
-
* when the endpoint answers with a bare array.
|
|
1467
|
+
* The endpoint answers with a bare array by default and with `{data,
|
|
1468
|
+
* pagination}` once `apiVersion` is 2026-07-27 or later; `pagination` is
|
|
1469
|
+
* absent on the bare array.
|
|
1407
1470
|
*
|
|
1408
1471
|
* @param agentId - Agent identifier.
|
|
1409
1472
|
* @param opts - Pagination options.
|
|
1410
1473
|
* @returns The criteria under `data`, plus the page metadata when present.
|
|
1411
1474
|
*/
|
|
1412
1475
|
async listEvaluationCriteriaPage(agentId, opts = {}) {
|
|
1413
|
-
|
|
1414
|
-
|
|
1415
|
-
|
|
1416
|
-
|
|
1476
|
+
return keyedList(
|
|
1477
|
+
await this.request("GET", `/agents/${agentId}/evaluation-criteria`, {
|
|
1478
|
+
query: { page: opts.page, limit: opts.limit }
|
|
1479
|
+
}),
|
|
1480
|
+
"data"
|
|
1481
|
+
);
|
|
1417
1482
|
}
|
|
1418
1483
|
/**
|
|
1419
1484
|
* Create evaluation criteria for an agent.
|
|
@@ -1468,9 +1533,13 @@ var Seclai = class {
|
|
|
1468
1533
|
* @param opts - Pagination options.
|
|
1469
1534
|
*/
|
|
1470
1535
|
async listEvaluationResults(criteriaId, opts = {}) {
|
|
1471
|
-
return
|
|
1472
|
-
|
|
1473
|
-
|
|
1536
|
+
return keyedList(
|
|
1537
|
+
await this.request("GET", `/agents/evaluation-criteria/${criteriaId}/results`, {
|
|
1538
|
+
query: { page: opts.page, limit: opts.limit }
|
|
1539
|
+
}),
|
|
1540
|
+
"data",
|
|
1541
|
+
PAGE_COUNTERS
|
|
1542
|
+
);
|
|
1474
1543
|
}
|
|
1475
1544
|
/**
|
|
1476
1545
|
* Create a manual evaluation result for a criteria.
|
|
@@ -1489,9 +1558,13 @@ var Seclai = class {
|
|
|
1489
1558
|
* @param opts - Pagination options.
|
|
1490
1559
|
*/
|
|
1491
1560
|
async listCompatibleRuns(criteriaId, opts = {}) {
|
|
1492
|
-
return
|
|
1493
|
-
|
|
1494
|
-
|
|
1561
|
+
return keyedList(
|
|
1562
|
+
await this.request("GET", `/agents/evaluation-criteria/${criteriaId}/compatible-runs`, {
|
|
1563
|
+
query: { page: opts.page, limit: opts.limit }
|
|
1564
|
+
}),
|
|
1565
|
+
"data",
|
|
1566
|
+
PAGE_COUNTERS
|
|
1567
|
+
);
|
|
1495
1568
|
}
|
|
1496
1569
|
/**
|
|
1497
1570
|
* Test a draft evaluation criteria without persisting it.
|
|
@@ -1510,9 +1583,13 @@ var Seclai = class {
|
|
|
1510
1583
|
* @param opts - Pagination options.
|
|
1511
1584
|
*/
|
|
1512
1585
|
async listAgentEvaluationResults(agentId, opts = {}) {
|
|
1513
|
-
return
|
|
1514
|
-
|
|
1515
|
-
|
|
1586
|
+
return keyedList(
|
|
1587
|
+
await this.request("GET", `/agents/${agentId}/evaluation-results`, {
|
|
1588
|
+
query: { page: opts.page, limit: opts.limit }
|
|
1589
|
+
}),
|
|
1590
|
+
"data",
|
|
1591
|
+
PAGE_COUNTERS
|
|
1592
|
+
);
|
|
1516
1593
|
}
|
|
1517
1594
|
/**
|
|
1518
1595
|
* List evaluation run summaries for an agent.
|
|
@@ -1521,9 +1598,13 @@ var Seclai = class {
|
|
|
1521
1598
|
* @param opts - Pagination options.
|
|
1522
1599
|
*/
|
|
1523
1600
|
async listEvaluationRuns(agentId, opts = {}) {
|
|
1524
|
-
return
|
|
1525
|
-
|
|
1526
|
-
|
|
1601
|
+
return keyedList(
|
|
1602
|
+
await this.request("GET", `/agents/${agentId}/evaluation-runs`, {
|
|
1603
|
+
query: { page: opts.page, limit: opts.limit }
|
|
1604
|
+
}),
|
|
1605
|
+
"data",
|
|
1606
|
+
PAGE_COUNTERS
|
|
1607
|
+
);
|
|
1527
1608
|
}
|
|
1528
1609
|
/**
|
|
1529
1610
|
* Get a summary of non-manual evaluations across an agent's runs.
|
|
@@ -1556,6 +1637,24 @@ var Seclai = class {
|
|
|
1556
1637
|
json: body
|
|
1557
1638
|
});
|
|
1558
1639
|
}
|
|
1640
|
+
/**
|
|
1641
|
+
* Replace the input attachments a trigger accepts.
|
|
1642
|
+
*
|
|
1643
|
+
* A run's files are each assigned to one declared attachment before any step
|
|
1644
|
+
* runs, and steps reference one as `{{agent.attachments.<name>}}`. The API
|
|
1645
|
+
* answers 400 when the agent references an attachment the new declaration
|
|
1646
|
+
* leaves out.
|
|
1647
|
+
*
|
|
1648
|
+
* @param agentId - Agent identifier.
|
|
1649
|
+
* @param triggerId - Trigger identifier, as `getAgent()` returns it.
|
|
1650
|
+
* @param body - The full list of accepted attachments; a slot's `min` defaults to 0.
|
|
1651
|
+
* @returns The trigger's accepted attachments.
|
|
1652
|
+
*/
|
|
1653
|
+
async setAcceptedAttachments(agentId, triggerId, body) {
|
|
1654
|
+
return await this.request("PUT", `/agents/${agentId}/triggers/${triggerId}/accepted-attachments`, {
|
|
1655
|
+
json: body
|
|
1656
|
+
});
|
|
1657
|
+
}
|
|
1559
1658
|
// ═══════════════════════════════════════════════════════════════════════════
|
|
1560
1659
|
// Agent Email Governance
|
|
1561
1660
|
// ═══════════════════════════════════════════════════════════════════════════
|
|
@@ -1569,9 +1668,13 @@ var Seclai = class {
|
|
|
1569
1668
|
* @returns The page of opt-outs plus the total count.
|
|
1570
1669
|
*/
|
|
1571
1670
|
async listAgentEmailOptOuts(opts = {}) {
|
|
1572
|
-
return
|
|
1573
|
-
|
|
1574
|
-
|
|
1671
|
+
return keyedList(
|
|
1672
|
+
await this.request("GET", "/agents/agent-email-optouts", {
|
|
1673
|
+
query: { agent_id: opts.agentId, limit: opts.limit, offset: opts.offset }
|
|
1674
|
+
}),
|
|
1675
|
+
"items",
|
|
1676
|
+
["total"]
|
|
1677
|
+
);
|
|
1575
1678
|
}
|
|
1576
1679
|
/**
|
|
1577
1680
|
* Revoke an opt-out, opting the recipient back in to agent emails.
|
|
@@ -1590,9 +1693,13 @@ var Seclai = class {
|
|
|
1590
1693
|
* @param opts.offset - Rows to skip (default 0).
|
|
1591
1694
|
*/
|
|
1592
1695
|
async listBlockedEmailSenders(opts = {}) {
|
|
1593
|
-
return
|
|
1594
|
-
|
|
1595
|
-
|
|
1696
|
+
return keyedList(
|
|
1697
|
+
await this.request("GET", "/agents/blocked-email-senders", {
|
|
1698
|
+
query: { limit: opts.limit, offset: opts.offset }
|
|
1699
|
+
}),
|
|
1700
|
+
"items",
|
|
1701
|
+
["total"]
|
|
1702
|
+
);
|
|
1596
1703
|
}
|
|
1597
1704
|
/**
|
|
1598
1705
|
* Add a sender address or a whole domain to the account blocklist.
|
|
@@ -1627,9 +1734,11 @@ var Seclai = class {
|
|
|
1627
1734
|
* @returns The updated blocked-sender list.
|
|
1628
1735
|
*/
|
|
1629
1736
|
async setAutoBlockMode(body) {
|
|
1630
|
-
return
|
|
1631
|
-
json: body
|
|
1632
|
-
|
|
1737
|
+
return keyedList(
|
|
1738
|
+
await this.request("PUT", "/agents/blocked-email-senders/mode", { json: body }),
|
|
1739
|
+
"items",
|
|
1740
|
+
["total"]
|
|
1741
|
+
);
|
|
1633
1742
|
}
|
|
1634
1743
|
/**
|
|
1635
1744
|
* List recent inbound emails that were quietly discarded before running an
|
|
@@ -1640,9 +1749,11 @@ var Seclai = class {
|
|
|
1640
1749
|
* @param opts.limit - Maximum results (1-200, default 50).
|
|
1641
1750
|
*/
|
|
1642
1751
|
async listInboundEmailRejections(opts = {}) {
|
|
1643
|
-
return
|
|
1644
|
-
|
|
1645
|
-
|
|
1752
|
+
return listItems(
|
|
1753
|
+
await this.request("GET", "/agents/inbound-email-rejections", {
|
|
1754
|
+
query: { agent_id: opts.agentId, limit: opts.limit }
|
|
1755
|
+
})
|
|
1756
|
+
);
|
|
1646
1757
|
}
|
|
1647
1758
|
/**
|
|
1648
1759
|
* Get the account's inbound-email overload status — whether the circuit
|
|
@@ -1684,9 +1795,13 @@ var Seclai = class {
|
|
|
1684
1795
|
* @returns Paginated list of knowledge bases.
|
|
1685
1796
|
*/
|
|
1686
1797
|
async listKnowledgeBases(opts = {}) {
|
|
1687
|
-
return
|
|
1688
|
-
|
|
1689
|
-
|
|
1798
|
+
return keyedList(
|
|
1799
|
+
await this.request("GET", "/knowledge_bases", {
|
|
1800
|
+
query: { page: opts.page, limit: opts.limit, sort: opts.sort, order: opts.order }
|
|
1801
|
+
}),
|
|
1802
|
+
"knowledge_bases",
|
|
1803
|
+
PAGE_COUNTERS
|
|
1804
|
+
);
|
|
1690
1805
|
}
|
|
1691
1806
|
/**
|
|
1692
1807
|
* Create a new knowledge base.
|
|
@@ -1734,9 +1849,13 @@ var Seclai = class {
|
|
|
1734
1849
|
* @returns Paginated list of memory banks.
|
|
1735
1850
|
*/
|
|
1736
1851
|
async listMemoryBanks(opts = {}) {
|
|
1737
|
-
return
|
|
1738
|
-
|
|
1739
|
-
|
|
1852
|
+
return keyedList(
|
|
1853
|
+
await this.request("GET", "/memory_banks", {
|
|
1854
|
+
query: { page: opts.page, limit: opts.limit, sort: opts.sort, order: opts.order }
|
|
1855
|
+
}),
|
|
1856
|
+
"memory_banks",
|
|
1857
|
+
PAGE_COUNTERS
|
|
1858
|
+
);
|
|
1740
1859
|
}
|
|
1741
1860
|
/**
|
|
1742
1861
|
* Create a new memory bank.
|
|
@@ -1783,7 +1902,7 @@ var Seclai = class {
|
|
|
1783
1902
|
* @param memoryBankId - Memory bank identifier.
|
|
1784
1903
|
*/
|
|
1785
1904
|
async getAgentsUsingMemoryBank(memoryBankId) {
|
|
1786
|
-
return await this.request("GET", `/memory_banks/${memoryBankId}/agents`);
|
|
1905
|
+
return listItems(await this.request("GET", `/memory_banks/${memoryBankId}/agents`));
|
|
1787
1906
|
}
|
|
1788
1907
|
/**
|
|
1789
1908
|
* Get stats for a memory bank.
|
|
@@ -1830,7 +1949,7 @@ var Seclai = class {
|
|
|
1830
1949
|
* List available memory bank templates.
|
|
1831
1950
|
*/
|
|
1832
1951
|
async listMemoryBankTemplates() {
|
|
1833
|
-
return await this.request("GET", "/memory_banks/templates");
|
|
1952
|
+
return listItems(await this.request("GET", "/memory_banks/templates"));
|
|
1834
1953
|
}
|
|
1835
1954
|
// ─── Memory Bank AI Assistant ──────────────────────────────────────────────
|
|
1836
1955
|
/**
|
|
@@ -1985,6 +2104,24 @@ var Seclai = class {
|
|
|
1985
2104
|
`/sources/${sourceId}/contents/${contentVersionId}`
|
|
1986
2105
|
);
|
|
1987
2106
|
}
|
|
2107
|
+
/**
|
|
2108
|
+
* List mail an email content source refused, newest first.
|
|
2109
|
+
*
|
|
2110
|
+
* Each entry says who sent the message and why it was refused, never its
|
|
2111
|
+
* subject or body. To accept a refused sender, add its `from_address` or that
|
|
2112
|
+
* address's domain to the source's `email_allowed_senders` — which only helps
|
|
2113
|
+
* when `authenticated` is true. Requires an account owner or administrator;
|
|
2114
|
+
* the API answers 404 for a source that is not an email source.
|
|
2115
|
+
*
|
|
2116
|
+
* @param sourceId - Source connection identifier.
|
|
2117
|
+
* @param opts - Pagination options (`limit` 1-100).
|
|
2118
|
+
* @returns The rejections under `data` with `pagination`.
|
|
2119
|
+
*/
|
|
2120
|
+
async listEmailSourceRejections(sourceId, opts = {}) {
|
|
2121
|
+
return await this.request("GET", `/sources/${sourceId}/email-rejections`, {
|
|
2122
|
+
query: { page: opts.page, limit: opts.limit }
|
|
2123
|
+
});
|
|
2124
|
+
}
|
|
1988
2125
|
// ─── Source Exports ────────────────────────────────────────────────────────
|
|
1989
2126
|
/**
|
|
1990
2127
|
* List exports for a source.
|
|
@@ -2034,10 +2171,15 @@ var Seclai = class {
|
|
|
2034
2171
|
*
|
|
2035
2172
|
* @param sourceId - Source connection identifier.
|
|
2036
2173
|
* @param exportId - Export identifier.
|
|
2174
|
+
* @param opts - Optional `signal`, which cancels the request; with a standard `fetch` this
|
|
2175
|
+
* includes reading the body, so `AbortSignal.timeout(ms)` bounds the whole
|
|
2176
|
+
* transfer.
|
|
2037
2177
|
* @returns Raw response with the export file.
|
|
2038
2178
|
*/
|
|
2039
|
-
async downloadSourceExport(sourceId, exportId) {
|
|
2040
|
-
return await this.requestRaw("GET", `/sources/${sourceId}/exports/${exportId}/download
|
|
2179
|
+
async downloadSourceExport(sourceId, exportId, opts = {}) {
|
|
2180
|
+
return await this.requestRaw("GET", `/sources/${sourceId}/exports/${exportId}/download`, {
|
|
2181
|
+
signal: opts.signal
|
|
2182
|
+
});
|
|
2041
2183
|
}
|
|
2042
2184
|
/**
|
|
2043
2185
|
* Estimate a source export.
|
|
@@ -2131,6 +2273,79 @@ var Seclai = class {
|
|
|
2131
2273
|
query: { page: opts.page ?? 1, limit: opts.limit ?? 20 }
|
|
2132
2274
|
});
|
|
2133
2275
|
}
|
|
2276
|
+
/**
|
|
2277
|
+
* List the files attached to a content item.
|
|
2278
|
+
*
|
|
2279
|
+
* Files arrive from an agent's `write_content_attachment` step, with an email
|
|
2280
|
+
* message, from an RSS feed's `feed_attachments`, from a web page's media, or
|
|
2281
|
+
* as the images inside a document. Each entry says whether it is indexed for
|
|
2282
|
+
* search and, when indexing failed, why.
|
|
2283
|
+
*
|
|
2284
|
+
* @param contentVersionId - Content version identifier.
|
|
2285
|
+
* @param opts - Pagination options.
|
|
2286
|
+
* @returns The attachments under `data` with `pagination`.
|
|
2287
|
+
*/
|
|
2288
|
+
async listContentAttachments(contentVersionId, opts = {}) {
|
|
2289
|
+
return await this.request("GET", `/contents/${contentVersionId}/attachments`, {
|
|
2290
|
+
query: { page: opts.page, limit: opts.limit }
|
|
2291
|
+
});
|
|
2292
|
+
}
|
|
2293
|
+
/**
|
|
2294
|
+
* Get one file attached to a content item: its indexing status and reason,
|
|
2295
|
+
* its metadata, and the text it is indexed by.
|
|
2296
|
+
*
|
|
2297
|
+
* @param contentVersionId - Content version identifier.
|
|
2298
|
+
* @param attachmentId - The `id` of an entry from {@link listContentAttachments}.
|
|
2299
|
+
* @param opts - `start` and `end` character offsets for paging through long text
|
|
2300
|
+
* (server defaults 0 and 5000). Both are sent as given, so `end: 0` asks for
|
|
2301
|
+
* the metadata without any text. A file that was not indexed has no text.
|
|
2302
|
+
* @returns The attachment with the requested range of its text.
|
|
2303
|
+
* @throws {SeclaiAPIStatusError} 402 when the account has no credits left
|
|
2304
|
+
* (`error.code` `insufficient_credits`).
|
|
2305
|
+
*/
|
|
2306
|
+
async getContentAttachment(contentVersionId, attachmentId, opts = {}) {
|
|
2307
|
+
return await this.request("GET", `/contents/${contentVersionId}/attachments/${attachmentId}`, {
|
|
2308
|
+
query: { start: opts.start, end: opts.end }
|
|
2309
|
+
});
|
|
2310
|
+
}
|
|
2311
|
+
/**
|
|
2312
|
+
* List the embeddings (chunk vectors) a content attachment is indexed by.
|
|
2313
|
+
* The list is empty for a file that has no completed index.
|
|
2314
|
+
*
|
|
2315
|
+
* @param contentVersionId - Content version identifier.
|
|
2316
|
+
* @param attachmentId - Attachment identifier.
|
|
2317
|
+
* @param opts - Pagination options (`limit` 1-100).
|
|
2318
|
+
* @returns Paginated list of embeddings.
|
|
2319
|
+
* @throws {SeclaiAPIStatusError} 402 when the account has no credits left
|
|
2320
|
+
* (`error.code` `insufficient_credits`).
|
|
2321
|
+
*/
|
|
2322
|
+
async listContentAttachmentEmbeddings(contentVersionId, attachmentId, opts = {}) {
|
|
2323
|
+
return await this.request("GET", `/contents/${contentVersionId}/attachments/${attachmentId}/embeddings`, {
|
|
2324
|
+
query: { page: opts.page, limit: opts.limit }
|
|
2325
|
+
});
|
|
2326
|
+
}
|
|
2327
|
+
/**
|
|
2328
|
+
* Download a content attachment's bytes.
|
|
2329
|
+
*
|
|
2330
|
+
* Returns the raw `Response` so you can stream or save the binary data. The
|
|
2331
|
+
* API answers 403 when the file is withheld — blocked or redacted by a
|
|
2332
|
+
* governance policy, or still being indexed after arriving from outside; the
|
|
2333
|
+
* attachment's `file_withheld` field says which before you ask.
|
|
2334
|
+
*
|
|
2335
|
+
* @param contentVersionId - Content version identifier.
|
|
2336
|
+
* @param attachmentId - Attachment identifier.
|
|
2337
|
+
* @param opts - Optional `signal`, which cancels the request; with a standard `fetch` this
|
|
2338
|
+
* includes reading the body, so `AbortSignal.timeout(ms)` bounds the whole
|
|
2339
|
+
* transfer.
|
|
2340
|
+
* @returns Raw response with the attachment bytes.
|
|
2341
|
+
* @throws {SeclaiAPIStatusError} 403 when the file is withheld, and 402 when
|
|
2342
|
+
* the account has no credits left (`error.code` `insufficient_credits`).
|
|
2343
|
+
*/
|
|
2344
|
+
async downloadContentAttachment(contentVersionId, attachmentId, opts = {}) {
|
|
2345
|
+
return await this.requestRaw("GET", `/contents/${contentVersionId}/attachments/${attachmentId}/file`, {
|
|
2346
|
+
signal: opts.signal
|
|
2347
|
+
});
|
|
2348
|
+
}
|
|
2134
2349
|
/**
|
|
2135
2350
|
* Upload a file to replace content for an existing content version.
|
|
2136
2351
|
*
|
|
@@ -2260,7 +2475,9 @@ var Seclai = class {
|
|
|
2260
2475
|
* @returns List of conversations.
|
|
2261
2476
|
*/
|
|
2262
2477
|
async listSolutionConversations(solutionId) {
|
|
2263
|
-
return
|
|
2478
|
+
return listItems(
|
|
2479
|
+
await this.request("GET", `/solutions/${solutionId}/conversations`)
|
|
2480
|
+
);
|
|
2264
2481
|
}
|
|
2265
2482
|
/**
|
|
2266
2483
|
* Add a conversation turn to a solution.
|
|
@@ -2349,7 +2566,9 @@ var Seclai = class {
|
|
|
2349
2566
|
* List governance AI conversations.
|
|
2350
2567
|
*/
|
|
2351
2568
|
async listGovernanceAiConversations() {
|
|
2352
|
-
return
|
|
2569
|
+
return listItems(
|
|
2570
|
+
await this.request("GET", "/governance/ai-assistant/conversations")
|
|
2571
|
+
);
|
|
2353
2572
|
}
|
|
2354
2573
|
/**
|
|
2355
2574
|
* Accept a governance AI plan.
|
|
@@ -2433,15 +2652,15 @@ var Seclai = class {
|
|
|
2433
2652
|
* @returns Paginated list of alert configs.
|
|
2434
2653
|
*/
|
|
2435
2654
|
/**
|
|
2436
|
-
*
|
|
2437
|
-
*
|
|
2438
|
-
* returns the canonical `{data, pagination}` envelope instead, so the
|
|
2439
|
-
* top-level key changes.
|
|
2655
|
+
* `configs` and `total` are populated on every API version; `data` and
|
|
2656
|
+
* `pagination` are also present once `apiVersion` is 2026-07-27 or later.
|
|
2440
2657
|
*/
|
|
2441
2658
|
async listAlertConfigs(opts = {}) {
|
|
2442
|
-
return
|
|
2443
|
-
query: { page: opts.page, limit: opts.limit }
|
|
2444
|
-
|
|
2659
|
+
return keyedList(
|
|
2660
|
+
await this.request("GET", "/alerts/configs", { query: { page: opts.page, limit: opts.limit } }),
|
|
2661
|
+
"configs",
|
|
2662
|
+
["total"]
|
|
2663
|
+
);
|
|
2445
2664
|
}
|
|
2446
2665
|
/**
|
|
2447
2666
|
* Create an alert configuration.
|
|
@@ -2484,7 +2703,11 @@ var Seclai = class {
|
|
|
2484
2703
|
* List organization alert preferences.
|
|
2485
2704
|
*/
|
|
2486
2705
|
async listOrganizationAlertPreferences() {
|
|
2487
|
-
return
|
|
2706
|
+
return keyedList(
|
|
2707
|
+
await this.request("GET", "/alerts/organization-preferences/list"),
|
|
2708
|
+
"preferences",
|
|
2709
|
+
["total"]
|
|
2710
|
+
);
|
|
2488
2711
|
}
|
|
2489
2712
|
/**
|
|
2490
2713
|
* Update an organization alert preference.
|
|
@@ -2511,9 +2734,11 @@ var Seclai = class {
|
|
|
2511
2734
|
async listModelAlerts(opts = {}) {
|
|
2512
2735
|
const limit = opts.limit ?? 50;
|
|
2513
2736
|
const offset = opts.page && opts.page > 1 ? (opts.page - 1) * limit : void 0;
|
|
2514
|
-
return
|
|
2515
|
-
query: { offset, limit: opts.limit }
|
|
2516
|
-
|
|
2737
|
+
return keyedList(
|
|
2738
|
+
await this.request("GET", "/models/alerts", { query: { offset, limit: opts.limit } }),
|
|
2739
|
+
"alerts",
|
|
2740
|
+
["total"]
|
|
2741
|
+
);
|
|
2517
2742
|
}
|
|
2518
2743
|
/**
|
|
2519
2744
|
* Mark all model alerts as read.
|
|
@@ -2549,7 +2774,7 @@ var Seclai = class {
|
|
|
2549
2774
|
* @param opts - Optional filters.
|
|
2550
2775
|
*/
|
|
2551
2776
|
async listModels(opts = {}) {
|
|
2552
|
-
return await this.request("GET", "/models", {
|
|
2777
|
+
return listItems(await this.request("GET", "/models", {
|
|
2553
2778
|
query: {
|
|
2554
2779
|
provider: opts.provider,
|
|
2555
2780
|
supports_tool_use: opts.supportsToolUse,
|
|
@@ -2557,7 +2782,7 @@ var Seclai = class {
|
|
|
2557
2782
|
supports_input_media: opts.supportsInputMedia,
|
|
2558
2783
|
supports_output_media: opts.supportsOutputMedia
|
|
2559
2784
|
}
|
|
2560
|
-
});
|
|
2785
|
+
}));
|
|
2561
2786
|
}
|
|
2562
2787
|
/**
|
|
2563
2788
|
* Get full details for a specific model.
|
|
@@ -2579,7 +2804,7 @@ var Seclai = class {
|
|
|
2579
2804
|
* Global routing/pricing (the same for every account); read-only.
|
|
2580
2805
|
*/
|
|
2581
2806
|
async getGenerationTiers() {
|
|
2582
|
-
return await this.request("GET", "/models/generation-tiers");
|
|
2807
|
+
return keyedList(await this.request("GET", "/models/generation-tiers"), "tiers");
|
|
2583
2808
|
}
|
|
2584
2809
|
/**
|
|
2585
2810
|
* List the embedding models a source can index with, and their pricing.
|
|
@@ -2592,10 +2817,11 @@ var Seclai = class {
|
|
|
2592
2817
|
* input modality — a coarse kind (text, image, video, audio) or a full MIME.
|
|
2593
2818
|
*/
|
|
2594
2819
|
async listEmbeddingModels(opts = {}) {
|
|
2595
|
-
return
|
|
2820
|
+
return keyedList(
|
|
2596
2821
|
await this.request("GET", "/models/embedders", {
|
|
2597
2822
|
query: { supports_input_media: opts.supportsInputMedia }
|
|
2598
|
-
})
|
|
2823
|
+
}),
|
|
2824
|
+
"models"
|
|
2599
2825
|
);
|
|
2600
2826
|
}
|
|
2601
2827
|
/**
|
|
@@ -2604,7 +2830,7 @@ var Seclai = class {
|
|
|
2604
2830
|
* `models` is populated on either wire shape, as for {@link Seclai.listEmbeddingModels}.
|
|
2605
2831
|
*/
|
|
2606
2832
|
async listRerankerModels() {
|
|
2607
|
-
return
|
|
2833
|
+
return keyedList(await this.request("GET", "/models/rerankers"), "models");
|
|
2608
2834
|
}
|
|
2609
2835
|
// ═══════════════════════════════════════════════════════════════════════════
|
|
2610
2836
|
// Model Playground Experiments
|
|
@@ -2615,9 +2841,13 @@ var Seclai = class {
|
|
|
2615
2841
|
* @param opts - Optional filters and pagination.
|
|
2616
2842
|
*/
|
|
2617
2843
|
async listExperiments(opts = {}) {
|
|
2618
|
-
return
|
|
2619
|
-
|
|
2620
|
-
|
|
2844
|
+
return keyedList(
|
|
2845
|
+
await this.request("GET", "/models/playground/experiments", {
|
|
2846
|
+
query: { days: opts.days, start_date: opts.startDate, end_date: opts.endDate, limit: opts.limit, offset: opts.offset }
|
|
2847
|
+
}),
|
|
2848
|
+
"experiments",
|
|
2849
|
+
["total"]
|
|
2850
|
+
);
|
|
2621
2851
|
}
|
|
2622
2852
|
/**
|
|
2623
2853
|
* Create a model playground experiment.
|
|
@@ -2794,7 +3024,7 @@ var Seclai = class {
|
|
|
2794
3024
|
* Requires a user-bound credential; an account-only API key is refused with 403.
|
|
2795
3025
|
*/
|
|
2796
3026
|
async listEmailDomains() {
|
|
2797
|
-
return await this.request("GET", "/email-domains");
|
|
3027
|
+
return keyedList(await this.request("GET", "/email-domains"), "domains");
|
|
2798
3028
|
}
|
|
2799
3029
|
/**
|
|
2800
3030
|
* Add and provision a new agent-email domain.
|