@flowmails/flowmails-sdk 2.0.0 → 2.1.1
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 +16 -0
- package/README.md +45 -1
- package/dist/index.cjs +172 -2
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +341 -12
- package/dist/index.d.ts +341 -12
- package/dist/index.js +172 -3
- package/dist/index.js.map +1 -1
- package/openapi.json +1245 -249
- package/package.json +1 -1
package/dist/index.d.cts
CHANGED
|
@@ -136,10 +136,36 @@ interface CreateWaitResult extends WaitStatus {
|
|
|
136
136
|
/** A hint for the poll loop: check again in a few seconds. */
|
|
137
137
|
pollAfterMs: number;
|
|
138
138
|
}
|
|
139
|
+
/**
|
|
140
|
+
* One verification code the platform extracted **on read**.
|
|
141
|
+
*
|
|
142
|
+
* `source` says where it came from: a code in the subject line is the
|
|
143
|
+
* strongest signal there is.
|
|
144
|
+
*/
|
|
145
|
+
interface ExtractedVerificationCode {
|
|
146
|
+
code: string;
|
|
147
|
+
source: "subject" | "body";
|
|
148
|
+
}
|
|
149
|
+
/** One authentication-shaped link the platform extracted. */
|
|
150
|
+
interface ExtractedMagicLink {
|
|
151
|
+
url: string;
|
|
152
|
+
label?: string;
|
|
153
|
+
}
|
|
154
|
+
/**
|
|
155
|
+
* The structured facts a message carries.
|
|
156
|
+
*
|
|
157
|
+
* Deterministic — the platform runs the same rules on every read, with no
|
|
158
|
+
* model and no clock — so the same message answers the same thing twice.
|
|
159
|
+
* Both lists are usually empty.
|
|
160
|
+
*/
|
|
161
|
+
interface ExtractedContent {
|
|
162
|
+
verificationCodes: ExtractedVerificationCode[];
|
|
163
|
+
magicLinks: ExtractedMagicLink[];
|
|
164
|
+
}
|
|
139
165
|
/** The full content of one message. Fetched, never pushed. */
|
|
140
166
|
interface MessageDetail {
|
|
141
|
-
/** The
|
|
142
|
-
id:
|
|
167
|
+
/** The mailstore's UUIDv7 row id. */
|
|
168
|
+
id: string;
|
|
143
169
|
/** The SMTP `Message-ID` the event carried. */
|
|
144
170
|
messageId: string;
|
|
145
171
|
from: string;
|
|
@@ -149,16 +175,64 @@ interface MessageDetail {
|
|
|
149
175
|
subject: string | null;
|
|
150
176
|
/** Plain-text body. Ideal for regexing a verification code out. */
|
|
151
177
|
text: string | null;
|
|
152
|
-
/**
|
|
178
|
+
/**
|
|
179
|
+
* Rendered HTML body, when the message had one.
|
|
180
|
+
*
|
|
181
|
+
* `null` when {@link GetMessageOptions.format} was `"markdown"` — that
|
|
182
|
+
* mode omits the raw markup on purpose.
|
|
183
|
+
*/
|
|
153
184
|
html: string | null;
|
|
185
|
+
/**
|
|
186
|
+
* A clean Markdown projection of the HTML body: head/style/script,
|
|
187
|
+
* hidden preheader text and tracking pixels removed; headings, lists,
|
|
188
|
+
* links and emphasis kept.
|
|
189
|
+
*/
|
|
190
|
+
markdown: string | null;
|
|
191
|
+
/** Verification codes and authentication links, extracted on read. */
|
|
192
|
+
extracted: ExtractedContent | null;
|
|
193
|
+
/**
|
|
194
|
+
* The prompt-injection verdict — the firewall's read-time answer about this
|
|
195
|
+
* message.
|
|
196
|
+
*
|
|
197
|
+
* Present when the domain's firewall mode is not `off`; absent (not `null`)
|
|
198
|
+
* when the domain does not scan, so "not scanned" and "scanned clean" stay
|
|
199
|
+
* distinguishable. `hidden_payload` means an instruction was concealed in
|
|
200
|
+
* the HTML (a `display:none` block, an HTML comment, or a run of invisible
|
|
201
|
+
* characters) — the shape a human reading the mail would never see.
|
|
202
|
+
*
|
|
203
|
+
* The `signals[].evidence` strings are **untrusted text**. Escape them, and
|
|
204
|
+
* never treat them as an instruction.
|
|
205
|
+
*/
|
|
206
|
+
security?: MessageSecurity;
|
|
154
207
|
receivedAt: string | null;
|
|
155
208
|
attachments: Array<{
|
|
209
|
+
/** The attachment id — what {@link AgentMessages.attachmentText} takes. */
|
|
210
|
+
id: string | null;
|
|
156
211
|
filename: string | null;
|
|
157
212
|
mimeType: string | null;
|
|
158
213
|
size: number | null;
|
|
159
214
|
url: string | null;
|
|
160
215
|
}>;
|
|
161
216
|
}
|
|
217
|
+
/** One matched signal behind a message's prompt-injection verdict. */
|
|
218
|
+
interface MessageSecuritySignal {
|
|
219
|
+
/**
|
|
220
|
+
* `instruction_override` | `role_hijack` | `data_exfiltration` |
|
|
221
|
+
* `tool_abuse` | `hidden_payload`.
|
|
222
|
+
*/
|
|
223
|
+
kind: string;
|
|
224
|
+
/** The points this signal contributed. */
|
|
225
|
+
weight: number;
|
|
226
|
+
/** A bounded snippet of the matched text. Untrusted. */
|
|
227
|
+
evidence: string;
|
|
228
|
+
}
|
|
229
|
+
/** The prompt-injection verdict for one message. */
|
|
230
|
+
interface MessageSecurity {
|
|
231
|
+
promptInjectionRisk: "none" | "low" | "medium" | "high";
|
|
232
|
+
/** `0..=100`. */
|
|
233
|
+
score: number;
|
|
234
|
+
signals: MessageSecuritySignal[];
|
|
235
|
+
}
|
|
162
236
|
/** One address (mailbox) the platform accepts mail for. */
|
|
163
237
|
interface AgentAddress {
|
|
164
238
|
address: string;
|
|
@@ -229,6 +303,94 @@ interface ThreadDetail {
|
|
|
229
303
|
/** The chain, oldest first. */
|
|
230
304
|
messages: ThreadMessage[];
|
|
231
305
|
}
|
|
306
|
+
/** The four states a draft can be in. */
|
|
307
|
+
declare const DRAFT_STATUS_NAMES: readonly ["pending_review", "approved", "rejected", "sent"];
|
|
308
|
+
type DraftStatusName = (typeof DRAFT_STATUS_NAMES)[number];
|
|
309
|
+
/**
|
|
310
|
+
* A message an agent wrote that a **person** has not approved yet.
|
|
311
|
+
*
|
|
312
|
+
* ## Why this is not a gated send
|
|
313
|
+
*
|
|
314
|
+
* Sending is the agent's decision (`docs/agent-platform.md` §3), and
|
|
315
|
+
* `fm.send()` still sends immediately. The draft is a **different
|
|
316
|
+
* capability**: `drafts:write` (without `messages:send`) lets a
|
|
317
|
+
* credential prepare a message and deliver nothing. Nothing leaves
|
|
318
|
+
* until a human approves it from the dashboard, and the approval
|
|
319
|
+
* dispatches through the platform's own audited send path.
|
|
320
|
+
*
|
|
321
|
+
* ```ts
|
|
322
|
+
* const draft = await fm.drafts.create({
|
|
323
|
+
* from: "support@acme.test",
|
|
324
|
+
* to: "customer@example.com",
|
|
325
|
+
* subject: "Re: your invoice",
|
|
326
|
+
* replyToMessageId: event.messageId,
|
|
327
|
+
* useAiContext: true,
|
|
328
|
+
* });
|
|
329
|
+
* // …nothing has been sent. Poll the outcome:
|
|
330
|
+
* const later = await fm.drafts.get(draft.id);
|
|
331
|
+
* // later.status: "pending_review" | "sent" | "rejected"
|
|
332
|
+
* ```
|
|
333
|
+
*/
|
|
334
|
+
interface EmailDraft {
|
|
335
|
+
id: string;
|
|
336
|
+
domainId: string;
|
|
337
|
+
from: string;
|
|
338
|
+
fromName: string | null;
|
|
339
|
+
to: string[];
|
|
340
|
+
replyTo: string | null;
|
|
341
|
+
replyToMessageId: string | null;
|
|
342
|
+
subject: string;
|
|
343
|
+
text: string | null;
|
|
344
|
+
html: string | null;
|
|
345
|
+
status: DraftStatusName;
|
|
346
|
+
source: "agent" | "human";
|
|
347
|
+
useAiContext: boolean;
|
|
348
|
+
aiRoleName: string | null;
|
|
349
|
+
/** Which credential wrote it; `null` when a human wrote it. */
|
|
350
|
+
createdByCredentialType: string | null;
|
|
351
|
+
/** The reviewer's note, on an approved or rejected draft. */
|
|
352
|
+
reviewNote: string | null;
|
|
353
|
+
/** The relay's SMTP `Message-ID`, once sent. */
|
|
354
|
+
sentMessageId: string | null;
|
|
355
|
+
sentEmailId: string | null;
|
|
356
|
+
createdAt: number;
|
|
357
|
+
updatedAt: number;
|
|
358
|
+
reviewedAt: number | null;
|
|
359
|
+
}
|
|
360
|
+
/**
|
|
361
|
+
* Options for {@link AgentDrafts.create}.
|
|
362
|
+
*
|
|
363
|
+
* `text` or `html` is required for a hand-written draft. With
|
|
364
|
+
* `useAiContext: true` both are optional and `replyToMessageId` is
|
|
365
|
+
* required — the body is generated from the message being answered and
|
|
366
|
+
* the domain's knowledge base.
|
|
367
|
+
*/
|
|
368
|
+
interface CreateDraftOptions {
|
|
369
|
+
from: string;
|
|
370
|
+
fromName?: string;
|
|
371
|
+
to: string | string[];
|
|
372
|
+
subject: string;
|
|
373
|
+
text?: string;
|
|
374
|
+
html?: string;
|
|
375
|
+
replyTo?: string;
|
|
376
|
+
replyToMessageId?: string;
|
|
377
|
+
/**
|
|
378
|
+
* Draft the reply from the domain's AI context instead of a
|
|
379
|
+
* hand-written body. A plan without AI context answers `402`.
|
|
380
|
+
*/
|
|
381
|
+
useAiContext?: boolean;
|
|
382
|
+
}
|
|
383
|
+
/** Options for {@link AgentDrafts.list}. */
|
|
384
|
+
interface ListDraftsOptions {
|
|
385
|
+
status?: DraftStatusName;
|
|
386
|
+
domainId?: string;
|
|
387
|
+
limit?: number;
|
|
388
|
+
}
|
|
389
|
+
/** The answer of {@link AgentDrafts.list}. */
|
|
390
|
+
interface ListDraftsResult {
|
|
391
|
+
drafts: EmailDraft[];
|
|
392
|
+
total: number;
|
|
393
|
+
}
|
|
232
394
|
/**
|
|
233
395
|
* The agent's own record of what it did with one message.
|
|
234
396
|
*
|
|
@@ -258,6 +420,47 @@ interface MessageState {
|
|
|
258
420
|
claimedAt: string | number | null;
|
|
259
421
|
/** ISO-8601 timestamp of the last write. */
|
|
260
422
|
updatedAt: string | number;
|
|
423
|
+
/** ISO-8601 timestamp of when the row was created. */
|
|
424
|
+
createdAt?: string | number;
|
|
425
|
+
}
|
|
426
|
+
/**
|
|
427
|
+
* The state names the platform accepts, in the platform's order.
|
|
428
|
+
*
|
|
429
|
+
* The vocabulary is this one list: the {@link MessageStateName} union
|
|
430
|
+
* below is derived from it, and the SDK's own validation reads it, so a
|
|
431
|
+
* name cannot exist in one place and be refused in the other.
|
|
432
|
+
*/
|
|
433
|
+
declare const MESSAGE_STATE_NAMES: readonly ["pending", "processing", "done", "failed"];
|
|
434
|
+
/**
|
|
435
|
+
* The vocabulary of {@link MessageState.state}, as a named union so a
|
|
436
|
+
* caller can pass one without re-typing the literal at every call
|
|
437
|
+
* site.
|
|
438
|
+
*/
|
|
439
|
+
type MessageStateName = (typeof MESSAGE_STATE_NAMES)[number];
|
|
440
|
+
/**
|
|
441
|
+
* Options for {@link AgentMessages.listStates}.
|
|
442
|
+
*/
|
|
443
|
+
interface ListMessageStatesOptions {
|
|
444
|
+
/**
|
|
445
|
+
* Only the states in this one — `pending`, `processing`, `done` or
|
|
446
|
+
* `failed`.
|
|
447
|
+
*
|
|
448
|
+
* The resume-after-restart read is most useful with
|
|
449
|
+
* `processing`: those are the messages this agent took and never
|
|
450
|
+
* finished.
|
|
451
|
+
*/
|
|
452
|
+
state?: MessageStateName;
|
|
453
|
+
/** Narrow to one message. */
|
|
454
|
+
messageId?: string;
|
|
455
|
+
/** The page size. */
|
|
456
|
+
limit?: number;
|
|
457
|
+
}
|
|
458
|
+
/**
|
|
459
|
+
* The agent's own per-message state, read back.
|
|
460
|
+
*/
|
|
461
|
+
interface ListMessageStatesResult {
|
|
462
|
+
/** One row per message the calling credential has a state for. */
|
|
463
|
+
states: MessageState[];
|
|
261
464
|
}
|
|
262
465
|
/** Options for {@link AgentMessages.claim}. */
|
|
263
466
|
interface ClaimMessageOptions {
|
|
@@ -288,8 +491,8 @@ interface CompleteMessageOptions {
|
|
|
288
491
|
* when the agent decides a message matters.
|
|
289
492
|
*/
|
|
290
493
|
interface SearchMessageHit {
|
|
291
|
-
/** The
|
|
292
|
-
id:
|
|
494
|
+
/** The mailstore's UUIDv7 row id. Accepted by {@link AgentMessages.get}. */
|
|
495
|
+
id: string | null;
|
|
293
496
|
/** The SMTP `Message-ID`, when the sender supplied one. */
|
|
294
497
|
messageId: string;
|
|
295
498
|
from: string | null;
|
|
@@ -338,15 +541,21 @@ interface SendOptions {
|
|
|
338
541
|
* to (the SDK backend enforces this with a 422 on mismatch).
|
|
339
542
|
*/
|
|
340
543
|
from: string;
|
|
341
|
-
/**
|
|
342
|
-
*
|
|
544
|
+
/**
|
|
545
|
+
* Display name for the sender, e.g. `"Billing"`.
|
|
546
|
+
*
|
|
547
|
+
* Optional: when it is absent the mail worker stores the address's
|
|
548
|
+
* local part **verbatim** (`billing@…` → `billing`), so the column is
|
|
549
|
+
* never blank. It does not capitalise it — a display name is the
|
|
550
|
+
* caller's choice.
|
|
551
|
+
*/
|
|
343
552
|
fromName?: string;
|
|
344
553
|
/** One recipient or an array. */
|
|
345
554
|
to: string | string[];
|
|
346
555
|
/** Optional reply-to override. */
|
|
347
556
|
replyTo?: string;
|
|
348
557
|
/**
|
|
349
|
-
* Reply in thread: the SMTP `Message-ID` (or
|
|
558
|
+
* Reply in thread: the SMTP `Message-ID` (or mailstore row UUID) of the
|
|
350
559
|
* message being answered.
|
|
351
560
|
*
|
|
352
561
|
* When set, the SDK backend resolves the parent row and derives
|
|
@@ -763,6 +972,21 @@ declare class Flowmails {
|
|
|
763
972
|
* `Message-ID`, which is exactly what `email.threadId` holds.
|
|
764
973
|
*/
|
|
765
974
|
readonly threads: AgentThreads;
|
|
975
|
+
/**
|
|
976
|
+
* The draft queue — a message written for a **person** to review.
|
|
977
|
+
*
|
|
978
|
+
* Nothing here sends. `create` writes a `pending_review` row and
|
|
979
|
+
* `list` / `get` report what a reviewer did with it. A human
|
|
980
|
+
* approves it in the dashboard, and the approval is the send — so
|
|
981
|
+
* the platform's audited send path, quota and domain rules apply
|
|
982
|
+
* unchanged.
|
|
983
|
+
*
|
|
984
|
+
* ```ts
|
|
985
|
+
* const draft = await fm.drafts.create({ from, to, subject, text });
|
|
986
|
+
* const queue = await fm.drafts.list({ status: "pending_review" });
|
|
987
|
+
* ```
|
|
988
|
+
*/
|
|
989
|
+
readonly drafts: AgentDrafts;
|
|
766
990
|
/**
|
|
767
991
|
* The durable wait — the one thing an agent cannot build for
|
|
768
992
|
* itself.
|
|
@@ -790,6 +1014,17 @@ declare class Flowmails {
|
|
|
790
1014
|
*/
|
|
791
1015
|
private request;
|
|
792
1016
|
}
|
|
1017
|
+
/**
|
|
1018
|
+
* The draft namespace — see {@link Flowmails.drafts}.
|
|
1019
|
+
*
|
|
1020
|
+
* Three operations and no sending: a draft is a message a **person**
|
|
1021
|
+
* approves, which is why this namespace has no `send`.
|
|
1022
|
+
*/
|
|
1023
|
+
interface AgentDrafts {
|
|
1024
|
+
create(opts: CreateDraftOptions): Promise<EmailDraft>;
|
|
1025
|
+
list(opts?: ListDraftsOptions): Promise<ListDraftsResult>;
|
|
1026
|
+
get(draftId: string): Promise<EmailDraft>;
|
|
1027
|
+
}
|
|
793
1028
|
/**
|
|
794
1029
|
* The event log namespace — see {@link Flowmails.events}.
|
|
795
1030
|
*/
|
|
@@ -808,11 +1043,66 @@ interface AgentEvents {
|
|
|
808
1043
|
/**
|
|
809
1044
|
* The message-read namespace — see {@link Flowmails.messages}.
|
|
810
1045
|
*/
|
|
1046
|
+
/**
|
|
1047
|
+
* Options for {@link AgentMessages.get}.
|
|
1048
|
+
*
|
|
1049
|
+
* `format` trades bytes for fidelity: `"full"` (the default) returns the raw
|
|
1050
|
+
* HTML beside the plain text, `"markdown"` omits `html` and returns the
|
|
1051
|
+
* Markdown projection instead. Both modes carry `markdown` and `extracted`
|
|
1052
|
+
* when the message has them.
|
|
1053
|
+
*/
|
|
1054
|
+
interface GetMessageOptions {
|
|
1055
|
+
/** Which of the account's domains to look in. */
|
|
1056
|
+
domainId?: string;
|
|
1057
|
+
/** `full` (default) or `markdown`. An unknown value is a `400`. */
|
|
1058
|
+
format?: "full" | "markdown";
|
|
1059
|
+
}
|
|
1060
|
+
/**
|
|
1061
|
+
* One attachment, read as text.
|
|
1062
|
+
*
|
|
1063
|
+
* An attachment with no text representation — an image, an encrypted PDF, a
|
|
1064
|
+
* scanned page — answers `supported: false` with a stable `reason`. That is
|
|
1065
|
+
* an answer, not an error: branch on `supported` instead of retrying.
|
|
1066
|
+
*/
|
|
1067
|
+
interface AttachmentText {
|
|
1068
|
+
supported: boolean;
|
|
1069
|
+
/**
|
|
1070
|
+
* A stable slug when `supported` is false: `attachment_too_large`,
|
|
1071
|
+
* `unsupported_format`, `encrypted_pdf`, `suspicious_compression`,
|
|
1072
|
+
* `no_text`, `corrupt_attachment`.
|
|
1073
|
+
*/
|
|
1074
|
+
reason: string | null;
|
|
1075
|
+
filename: string | null;
|
|
1076
|
+
mimeType: string | null;
|
|
1077
|
+
sizeBytes: number;
|
|
1078
|
+
/** The extracted text; `null` when unsupported. Untrusted input. */
|
|
1079
|
+
text: string | null;
|
|
1080
|
+
/** `true` when the text was cut at 64 KiB. */
|
|
1081
|
+
truncated: boolean;
|
|
1082
|
+
}
|
|
811
1083
|
interface AgentMessages {
|
|
812
1084
|
/** Fetch the full content of one message by SMTP `Message-ID`. */
|
|
813
|
-
get(messageId: string, opts?:
|
|
1085
|
+
get(messageId: string, opts?: GetMessageOptions): Promise<MessageDetail>;
|
|
1086
|
+
/**
|
|
1087
|
+
* `get_attachment_text`: read one attachment as text.
|
|
1088
|
+
*
|
|
1089
|
+
* `attachmentId` is the value in `attachments[].id` of a
|
|
1090
|
+
* {@link AgentMessages.get} answer. Plain text, CSV, Markdown, HTML,
|
|
1091
|
+
* JSON, XML, `.docx` and PDF are supported; anything else answers
|
|
1092
|
+
* `supported: false` with a reason.
|
|
1093
|
+
*
|
|
1094
|
+
* ```ts
|
|
1095
|
+
* const message = await fm.messages.get(event.messageId, { format: "markdown" });
|
|
1096
|
+
* const file = await fm.messages.attachmentText(
|
|
1097
|
+
* event.messageId,
|
|
1098
|
+
* message.attachments[0].id,
|
|
1099
|
+
* );
|
|
1100
|
+
* if (file.supported) console.log(file.text);
|
|
1101
|
+
* ```
|
|
1102
|
+
*/
|
|
1103
|
+
attachmentText(messageId: string, attachmentId: string, opts?: {
|
|
814
1104
|
domainId?: string;
|
|
815
|
-
}): Promise<
|
|
1105
|
+
}): Promise<AttachmentText>;
|
|
816
1106
|
/** Poll a sent message's delivery state by row id or `Message-ID`. */
|
|
817
1107
|
status(id: string): Promise<SendStatus>;
|
|
818
1108
|
/**
|
|
@@ -851,6 +1141,33 @@ interface AgentMessages {
|
|
|
851
1141
|
* query parameter.
|
|
852
1142
|
*/
|
|
853
1143
|
search(domainId: string, opts: SearchMessagesOptions): Promise<SearchMessagesResult>;
|
|
1144
|
+
/**
|
|
1145
|
+
* `list_message_states`: read the agent's **own** record back.
|
|
1146
|
+
*
|
|
1147
|
+
* The event log says a mail arrived; the claim and the completion
|
|
1148
|
+
* say what this agent did with it. This is the third half — the
|
|
1149
|
+
* read — and it is what makes the other two useful: an agent that
|
|
1150
|
+
* restarted reads it back to tell "I never saw this" from "I saw
|
|
1151
|
+
* it and never finished".
|
|
1152
|
+
*
|
|
1153
|
+
* Two facts the caller must know:
|
|
1154
|
+
*
|
|
1155
|
+
* - **The rows belong to the calling credential.** The platform
|
|
1156
|
+
* stores the state under a fingerprint of the bearer, so another
|
|
1157
|
+
* credential of the same tenant does not read them by accident.
|
|
1158
|
+
* - **`domainId` is required.** The state is scoped to the domain
|
|
1159
|
+
* whose mailbox received the message.
|
|
1160
|
+
*
|
|
1161
|
+
* ```ts
|
|
1162
|
+
* const { states } = await fm.messages.listStates(domainId, {
|
|
1163
|
+
* state: "processing",
|
|
1164
|
+
* });
|
|
1165
|
+
* ```
|
|
1166
|
+
*
|
|
1167
|
+
* @throws {ValidationError} when `domainId` is missing, or `state`
|
|
1168
|
+
* is not one of the four names.
|
|
1169
|
+
*/
|
|
1170
|
+
listStates(domainId: string, opts?: ListMessageStatesOptions): Promise<ListMessageStatesResult>;
|
|
854
1171
|
}
|
|
855
1172
|
/**
|
|
856
1173
|
* The conversation namespace — see {@link Flowmails.threads}.
|
|
@@ -978,7 +1295,19 @@ declare class AuthenticationError extends FlowmailsError {
|
|
|
978
1295
|
*/
|
|
979
1296
|
declare class ValidationError extends FlowmailsError {
|
|
980
1297
|
readonly detail?: string;
|
|
981
|
-
|
|
1298
|
+
/**
|
|
1299
|
+
* The rest of the platform's error body, when it carried more than
|
|
1300
|
+
* `error` / `detail`.
|
|
1301
|
+
*
|
|
1302
|
+
* The claim conflict is the case that matters: a `409` from
|
|
1303
|
+
* `POST /api/agent/messages/:messageId/claim` names the credential
|
|
1304
|
+
* holding the live claim (`claimedBy`, `claimedAt`). Dropping those
|
|
1305
|
+
* left a caller with "Validation failed: message already claimed" and
|
|
1306
|
+
* no way to tell which worker holds the message — the one fact the
|
|
1307
|
+
* mutex exists to communicate.
|
|
1308
|
+
*/
|
|
1309
|
+
readonly extra?: Record<string, unknown>;
|
|
1310
|
+
constructor(code: string, detail: string | undefined, status?: number, extra?: Record<string, unknown>);
|
|
982
1311
|
}
|
|
983
1312
|
/**
|
|
984
1313
|
* 408 / 429 — request was rate-limited or timed out. Retryable.
|
|
@@ -1016,4 +1345,4 @@ declare class UpstreamError extends FlowmailsError {
|
|
|
1016
1345
|
constructor(code: string, upstreamMessage: string | undefined, status?: number);
|
|
1017
1346
|
}
|
|
1018
1347
|
|
|
1019
|
-
export { type AccountInfo, type AccountSendingState, type AgentAddress, type AgentAddresses, type AgentDomain, type AgentEvent, type AgentEvents, type AgentMessages, type AgentThreads, type AgentWaits, AuthenticationError, type ClaimMessageOptions, type CompleteMessageOptions, type CreateAddressResult, type CreateWaitOptions, type CreateWaitResult, Flowmails, FlowmailsError, type FlowmailsOptions, type ListEventsOptions, type ListEventsResult, type MessageDetail, type MessageState, RateLimitError, type SearchMessageHit, type SearchMessagesOptions, type SearchMessagesResult, type SendAttachment, type SendOptions, type SendRecipientResult, type SendResult, type SendStatus, type ThreadDetail, type ThreadMessage, UpstreamError, ValidationError, WAIT_RESOLVED_EVENT, type WaitStatus, type WorkerVersionInfo };
|
|
1348
|
+
export { type AccountInfo, type AccountSendingState, type AgentAddress, type AgentAddresses, type AgentDomain, type AgentDrafts, type AgentEvent, type AgentEvents, type AgentMessages, type AgentThreads, type AgentWaits, AuthenticationError, type ClaimMessageOptions, type CompleteMessageOptions, type CreateAddressResult, type CreateDraftOptions, type CreateWaitOptions, type CreateWaitResult, DRAFT_STATUS_NAMES, type DraftStatusName, type EmailDraft, Flowmails, FlowmailsError, type FlowmailsOptions, type ListDraftsOptions, type ListDraftsResult, type ListEventsOptions, type ListEventsResult, type ListMessageStatesOptions, type ListMessageStatesResult, type MessageDetail, type MessageSecurity, type MessageSecuritySignal, type MessageState, type MessageStateName, RateLimitError, type SearchMessageHit, type SearchMessagesOptions, type SearchMessagesResult, type SendAttachment, type SendOptions, type SendRecipientResult, type SendResult, type SendStatus, type ThreadDetail, type ThreadMessage, UpstreamError, ValidationError, WAIT_RESOLVED_EVENT, type WaitStatus, type WorkerVersionInfo };
|