@repa/mail 0.1.0-alpha.20 → 0.1.0-alpha.21

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/README.md CHANGED
@@ -5,12 +5,13 @@ Node 22 and Node 24. Root exports reject browsers/workers. `/contracts` is
5
5
  browser-safe. This package uses the repa evaluation licence; no public
6
6
  production SLA or stable production-use terms are promised.
7
7
 
8
- Published on npm: **0.1.0-alpha.19** on the `alpha` channel (first publication
9
- 0.1.0-alpha.18 on 2026-11-08, EMAIL-D226). Pin the exact version; a matching mail service
8
+ Published on npm: **0.1.0-alpha.20** on the `alpha` channel (first publication
9
+ under this name). This source is the **0.1.0-alpha.21** candidate, not yet published;
10
+ new-text reads below arrive with it. Pin the exact version; a matching mail service
10
11
  deployment is qualified separately.
11
12
 
12
13
  ```sh
13
- npm install @repa/mail@0.1.0-alpha.19
14
+ npm install @repa/mail@0.1.0-alpha.20
14
15
  ```
15
16
 
16
17
  This package was named `@repa/email-server` until 0.1.0-alpha.17 (EMAIL-D226).
@@ -145,6 +146,77 @@ for integration subjects. Rotation preserves ownership, but queued first dispatc
145
146
  still checks the original key; keep it valid until its work drains. Revocation
146
147
  cannot recall provider-accepted mail.
147
148
 
149
+ ## Read a reply without the quoted chain
150
+
151
+ Each reply usually carries the earlier messages quoted below it. `readMessage`
152
+ with `content: 'new'` returns only what the sender wrote in this message:
153
+ `text` is the new text, `signature` the separated signature, and there is no
154
+ `html`. The default (`content: 'full'`, or no `content`) is the whole message;
155
+ the stored message never changes. `content: 'new'` cannot be combined with a
156
+ part download.
157
+
158
+ ```ts
159
+ import { createEmailClient } from '@repa/mail';
160
+
161
+ export async function readReplyOnly(apiKey: string, authenticatedSubject: string,
162
+ message: { accountId: string; folderId: string; uidValidity: number; uid: number }) {
163
+ const mail = createEmailClient({ apiKey, subject: authenticatedSubject });
164
+ const reply = await mail.readMessage({ ...message, content: 'new' });
165
+ // An unproven cut: say that earlier quoted text was removed; the full read still has it.
166
+ const note = reply.newText.confidence === 'structural' ? 'Earlier quoted text was removed.' : null;
167
+ return { text: reply.text, signature: reply.signature, note };
168
+ }
169
+ ```
170
+
171
+ `newText` says what happened:
172
+
173
+ - `outcome`: `cut` (quoted earlier text was removed), `whole` (nothing was
174
+ removed; the signature may still come separately) or `unreadable` (no
175
+ readable text; `text` is empty).
176
+ - `confidence`: `proven` (the removed text repeats an earlier message of the
177
+ same conversation in this mailbox), `structural` (the sender's mail program
178
+ marked it as a quote, but no earlier message proved it) or `none` (nothing
179
+ removed).
180
+ - `reason`: why, for example `gmail_quote`, `outlook_separator`,
181
+ `text_attribution` (an "On … wrote:" line) or `proven_repeat` for a cut, and
182
+ `no_quote`, `interleaved` (answers between quoted lines), `forward`,
183
+ `empty_remainder`, `too_large`, `invitation` or `encrypted` when the whole
184
+ text was kept. New reasons may appear; go by `outcome`.
185
+ - `signatureReason`: `rfc3676_delimiter` (the `-- ` line), `html_signature`
186
+ (the mail program's signature block), `sender_learned` (the same closing
187
+ lines end earlier messages from this sender) or empty.
188
+ - `removed[]`: each removed region with `kind` (`quote`, `forward_header`,
189
+ `signature`), `bytes`, `headerId` (the earlier message's Message-ID, null
190
+ when unproven) and `messageId`.
191
+ - `fullTextBytes` is the size of the whole text; `extractorVersion` names the
192
+ extractor that derived it.
193
+
194
+ No word the sender wrote is dropped: when a cut is not safe (answers between
195
+ quoted lines, several quoted regions, a forward), the whole text is kept.
196
+
197
+ ## Follow `removed[].messageId` to the earlier message
198
+
199
+ `messageId` is set only when you may read that earlier message in this
200
+ mailbox; it is the `id` of that message in `readConversation`, whose messages
201
+ also carry the same `newText` in `chat`.
202
+
203
+ ```ts
204
+ import { createEmailClient } from '@repa/mail';
205
+
206
+ export async function quotedEarlierMessages(apiKey: string, authenticatedSubject: string,
207
+ message: { accountId: string; folderId: string; uidValidity: number; uid: number }) {
208
+ const mail = createEmailClient({ apiKey, subject: authenticatedSubject });
209
+ const reply = await mail.readMessage({ ...message, content: 'new' });
210
+ const ids = new Set(reply.newText.removed.flatMap(region => region.messageId ? [region.messageId] : []));
211
+ if (ids.size === 0) return [];
212
+ const thread = await mail.readConversation({ ...message, cursor: '', limit: 50 });
213
+ return thread.messages.filter(earlier => ids.has(earlier.id)).map(earlier => ({ id: earlier.id, from: earlier.from, text: earlier.chat.text }));
214
+ }
215
+ ```
216
+
217
+ A conversation page holds its newest 50 messages; continue with `earlier` as
218
+ the cursor to reach older ones.
219
+
148
220
  ## Limits and errors
149
221
 
150
222
  - 60 requests per minute per integration; workspace sending/storage allowances also apply.
@@ -1,4 +1,4 @@
1
- export { j as EmailAttachment, E as EmailClientOptions, m as EmailDomainSendScope, l as EmailDomainSender, h as EmailError, q as EmailEvent, f as EmailEventPage, p as EmailEventType, k as EmailExactSender, o as EmailFeedbackType, c as EmailMessage, a as EmailRequestOptions, d as EmailSendOptions, b as EmailSender, e as EmailSubmission, n as EmailSubmissionState, g as EmailWebhookEvent } from './errors-B_W1C1Hu.js';
1
+ export { j as EmailAttachment, a as EmailClientOptions, m as EmailDomainSendScope, l as EmailDomainSender, h as EmailError, q as EmailEvent, f as EmailEventPage, p as EmailEventType, k as EmailExactSender, o as EmailFeedbackType, c as EmailMessage, E as EmailRequestOptions, d as EmailSendOptions, b as EmailSender, e as EmailSubmission, n as EmailSubmissionState, g as EmailWebhookEvent } from './errors-VxeL4C8r.js';
2
2
 
3
3
  declare function createEmailClient(): never;
4
4
  declare function createMailTransport(): never;
@@ -213,6 +213,48 @@ var MailError = class extends Error {
213
213
  this.name = "MailError";
214
214
  }
215
215
  };
216
+ var readContent = z.enum(["full", "new"]);
217
+ var newTextOutcome = z.enum(["cut", "whole", "unreadable"]);
218
+ var newTextConfidence = z.enum(["proven", "structural", "none"]);
219
+ var newTextSignatureReason = z.enum(["", "rfc3676_delimiter", "html_signature", "sender_learned"]);
220
+ var newTextRemovedKind = z.enum(["quote", "forward_header", "signature"]);
221
+ var newTextRemoved = z.object({
222
+ kind: newTextRemovedKind,
223
+ messageId: z.uuid().nullable(),
224
+ headerId: z.string().min(1).max(998).nullable(),
225
+ bytes: z.number().int().nonnegative()
226
+ }).strict();
227
+ var newTextReason = z.string().regex(/^[a-z0-9_]*$/).max(32);
228
+ var newTextInfo = z.object({
229
+ outcome: newTextOutcome,
230
+ confidence: newTextConfidence,
231
+ reason: newTextReason,
232
+ extractorVersion: z.number().int().min(1).max(65535),
233
+ fullTextBytes: z.number().int().nonnegative(),
234
+ signatureReason: newTextSignatureReason,
235
+ removed: z.array(newTextRemoved).max(8)
236
+ }).strict();
237
+ var unreadNewText = z.object({
238
+ outcome: z.literal(""),
239
+ confidence: z.literal(""),
240
+ reason: z.literal(""),
241
+ extractorVersion: z.literal(0),
242
+ fullTextBytes: z.literal(0),
243
+ signatureReason: z.literal(""),
244
+ removed: z.array(newTextRemoved).max(0)
245
+ }).strict();
246
+ var newTextMessage = z.object({
247
+ entry,
248
+ headers: message.shape.headers,
249
+ text: message.shape.text,
250
+ signature: z.string().max(1024),
251
+ attachments: message.shape.attachments,
252
+ warnings: message.shape.warnings,
253
+ incomplete: z.boolean(),
254
+ newText: newTextInfo
255
+ }).strict();
256
+
257
+ // src/contracts/conversations.ts
216
258
  var uuid3 = z.string().uuid();
217
259
  var uint2 = z.number().int().min(1).max(4294967295);
218
260
  var count = z.number().int().nonnegative();
@@ -245,7 +287,8 @@ var chatText = z.object({
245
287
  text: z.string().max(16384),
246
288
  quoted: z.boolean(),
247
289
  signature: z.string().max(1024),
248
- truncated: z.boolean()
290
+ truncated: z.boolean(),
291
+ newText: z.union([newTextInfo, unreadNewText])
249
292
  }).strict();
250
293
  var conversationMessage = z.object({
251
294
  id: uuid3,
@@ -449,7 +492,14 @@ var headlessOperations = {
449
492
  mailboxes: operation("mailboxes/discover", "mailboxes", z.object({ after: uuid5.optional(), limit: z.number().int().min(1).max(100) }).strict(), mailboxPage),
450
493
  open: operation("mailboxes/open", "open", account2, inbox, { responseBytes: 14 * MiB }),
451
494
  list: operation("messages/list", "list", location.extend({ before: z.number().int().min(0).max(4294967295), limit: z.number().int().min(1).max(20) }).strict(), entries, { responseBytes: 14 * MiB }),
452
- read: operation("messages/read", "read", messageLocation, message, { responseBytes: 14 * MiB }),
495
+ /** `content: 'new'` answers what the sender wrote without the quoted chain (EMAIL-D240); default `full`. */
496
+ read: operation(
497
+ "messages/read",
498
+ "read",
499
+ messageLocation.extend({ content: readContent.optional() }).strict(),
500
+ z.union([message, newTextMessage]),
501
+ { responseBytes: 14 * MiB }
502
+ ),
453
503
  conversations: operation("conversations/list", "conversations", location.extend({
454
504
  cursor: conversationCursor,
455
505
  limit: z.number().int().min(1).max(20)
@@ -876,4 +926,4 @@ var inboxCountsInput = account3.extend({ folderIds: z.array(z.uuid()).min(1).max
876
926
  var inboxFolderCount = z.object({ folderId: z.uuid(), unseen: z.number().int().nonnegative(), total: z.number().int().nonnegative(), uidNext: z.number().int().min(1).max(4294967295), uidValidity: z.number().int().min(1).max(4294967295) }).strict();
877
927
  var inboxCounts = inboxPosition.extend({ folders: z.array(inboxFolderCount).max(200) }).strict();
878
928
 
879
- export { EXPORT_MANIFEST_NAME, IMPORT_UPLOAD_PART_BYTES, MAXIMUM_DELIVERY_BATCH, MAXIMUM_EXPORT_FOLDERS, MAXIMUM_HEADER_SAMPLE, MAXIMUM_IMPORTS_KEPT, MAXIMUM_IMPORT_FAILURES_SHOWN, MAXIMUM_IMPORT_FOLDERS, MAXIMUM_IMPORT_MESSAGE_BYTES, MAXIMUM_IMPORT_UPLOAD_BYTES, MAXIMUM_IMPORT_UPLOAD_DAY_BYTES, MAXIMUM_RULE_CONDITIONS, MAXIMUM_RULE_ITEMS, MAXIMUM_RULE_PROBLEMS, MAXIMUM_RULE_SCRIPT_BYTES, MAXIMUM_SEND_BASE64_BYTES, MAXIMUM_SEND_BODY_BYTES, MAXIMUM_SEND_BYTES, MAXIMUM_SIGNATURES, MAXIMUM_SIGNATURE_BYTES, MAXIMUM_SIGNATURE_LINES, MailError, RULES_REQUEST_BYTES, RULES_RESPONSE_BYTES, accountStorage, accountStorageMaximumBytes, attachment, changed, chatText, cleanupInput, cleanupResult, composeFormat, conversation, conversationCursor, conversationLocation, conversationMessage, conversationPage, conversationRow, deliveryEvent, deliveryEventName, deliveryMeaning, deliveryReason, deliveryState, deliveryStates, deliverySummary, download, draftContent, draftInputs, draftList, draftLocation, draftSchemas, entries, entry, exportFlag, exportManifest, exportManifestFolder, exportManifestMessage, exportStart, finishedImportStates, folder, headerSample, headerSampleInput, headerSampleMessage, headlessOperations, heldReason, importAnswer, importBegin, importConfirm, importDetail, importErrorCode, importFailureReason, importFile, importFileFormat, importFolderChoice, importKind, importList, importListAnswer, importMessageFailure, importPlanFolder, importProgress, importRef, importSecurity, importSource, importSourceInput, importSpecialUse, importState, importStates, importSummary, importUploadBegin, importUploadPart, importWaitReason, inbox, inboxCounts, inboxCountsInput, inboxFolderCount, inboxPosition, inboxWaitInput, mailbox, mailboxPage, mailboxRules, message, participant, receipt, recipientDelivery, renamedFolder, rule, ruleActions, ruleCondition, ruleForward, ruleItem, ruleItemInput, ruleVacation, rulesChecked, rulesInputs, rulesNotice, rulesProblem, rulesSaved, safeComposeLink, savedDraft, sender, sentDeliveries, sentDeliveriesLocation, sentDelivery, sentDeliveryLocation, sentDeliveryStatus, serviceAccountStorage, signature, signaturePage, signaturePlacement, signatureSave, signatureSaved, validComposeFormat };
929
+ export { EXPORT_MANIFEST_NAME, IMPORT_UPLOAD_PART_BYTES, MAXIMUM_DELIVERY_BATCH, MAXIMUM_EXPORT_FOLDERS, MAXIMUM_HEADER_SAMPLE, MAXIMUM_IMPORTS_KEPT, MAXIMUM_IMPORT_FAILURES_SHOWN, MAXIMUM_IMPORT_FOLDERS, MAXIMUM_IMPORT_MESSAGE_BYTES, MAXIMUM_IMPORT_UPLOAD_BYTES, MAXIMUM_IMPORT_UPLOAD_DAY_BYTES, MAXIMUM_RULE_CONDITIONS, MAXIMUM_RULE_ITEMS, MAXIMUM_RULE_PROBLEMS, MAXIMUM_RULE_SCRIPT_BYTES, MAXIMUM_SEND_BASE64_BYTES, MAXIMUM_SEND_BODY_BYTES, MAXIMUM_SEND_BYTES, MAXIMUM_SIGNATURES, MAXIMUM_SIGNATURE_BYTES, MAXIMUM_SIGNATURE_LINES, MailError, RULES_REQUEST_BYTES, RULES_RESPONSE_BYTES, accountStorage, accountStorageMaximumBytes, attachment, changed, chatText, cleanupInput, cleanupResult, composeFormat, conversation, conversationCursor, conversationLocation, conversationMessage, conversationPage, conversationRow, deliveryEvent, deliveryEventName, deliveryMeaning, deliveryReason, deliveryState, deliveryStates, deliverySummary, download, draftContent, draftInputs, draftList, draftLocation, draftSchemas, entries, entry, exportFlag, exportManifest, exportManifestFolder, exportManifestMessage, exportStart, finishedImportStates, folder, headerSample, headerSampleInput, headerSampleMessage, headlessOperations, heldReason, importAnswer, importBegin, importConfirm, importDetail, importErrorCode, importFailureReason, importFile, importFileFormat, importFolderChoice, importKind, importList, importListAnswer, importMessageFailure, importPlanFolder, importProgress, importRef, importSecurity, importSource, importSourceInput, importSpecialUse, importState, importStates, importSummary, importUploadBegin, importUploadPart, importWaitReason, inbox, inboxCounts, inboxCountsInput, inboxFolderCount, inboxPosition, inboxWaitInput, mailbox, mailboxPage, mailboxRules, message, newTextConfidence, newTextInfo, newTextMessage, newTextOutcome, newTextReason, newTextRemoved, newTextRemovedKind, newTextSignatureReason, participant, readContent, receipt, recipientDelivery, renamedFolder, rule, ruleActions, ruleCondition, ruleForward, ruleItem, ruleItemInput, ruleVacation, rulesChecked, rulesInputs, rulesNotice, rulesProblem, rulesSaved, safeComposeLink, savedDraft, sender, sentDeliveries, sentDeliveriesLocation, sentDelivery, sentDeliveryLocation, sentDeliveryStatus, serviceAccountStorage, signature, signaturePage, signaturePlacement, signatureSave, signatureSaved, unreadNewText, validComposeFormat };
@@ -1,5 +1,5 @@
1
- import { C as ComposeNode } from './operations-14iYfteB.js';
2
- export { W as AccountStorage, T as Change, ag as Conversation, ae as ConversationLocation, af as ConversationMessage, ad as ConversationPage, ac as ConversationRow, Q as ConversationTarget, D as DraftAction, a as DraftInput, b as DraftResult, J as Entry, E as Folder, F as FolderInput, H as HeadlessInput, aB as HeadlessOperation, c as HeadlessResult, I as Inbox, O as Location, aj as MAXIMUM_RULE_CONDITIONS, ai as MAXIMUM_RULE_ITEMS, ak as MAXIMUM_RULE_PROBLEMS, ah as MAXIMUM_RULE_SCRIPT_BYTES, U as MailError, M as MailTransport, B as Mailbox, j as MailboxRules, K as Message, P as MessageLocation, ab as Participant, ay as RULES_REQUEST_BYTES, az as RULES_RESPONSE_BYTES, L as Receipt, R as Rule, d as RuleActions, e as RuleCondition, f as RuleForward, g as RuleItem, h as RuleItemInput, i as RuleVacation, k as RulesChecked, l as RulesNotice, m as RulesProblem, n as RulesSaved, a2 as SavedDraft, G as Sender, S as Submission, V as accountStorage, X as accountStorageMaximumBytes, w as attachment, y as changed, a8 as chatText, aE as composeFormat, aa as conversation, a3 as conversationCursor, a7 as conversationLocation, a9 as conversationMessage, a6 as conversationPage, a5 as conversationRow, z as download, Z as draftContent, a1 as draftInputs, $ as draftList, a0 as draftLocation, N as draftSchemas, v as entries, u as entry, q as folder, aA as headlessOperations, t as inbox, o as mailbox, p as mailboxPage, at as mailboxRules, x as message, a4 as participant, A as receipt, r as renamedFolder, an as rule, am as ruleActions, al as ruleCondition, ap as ruleForward, aq as ruleItem, ar as ruleItemInput, ao as ruleVacation, av as rulesChecked, ax as rulesInputs, as as rulesNotice, au as rulesProblem, aw as rulesSaved, aC as safeComposeLink, _ as savedDraft, s as sender, Y as serviceAccountStorage, aD as validComposeFormat } from './operations-14iYfteB.js';
1
+ import { C as ComposeNode } from './operations-g1slmaT3.js';
2
+ export { a1 as AccountStorage, _ as Change, an as Conversation, al as ConversationLocation, am as ConversationMessage, ak as ConversationPage, aj as ConversationRow, Z as ConversationTarget, D as DraftAction, a as DraftInput, b as DraftResult, U as Entry, P as Folder, F as FolderInput, H as HeadlessInput, aS as HeadlessOperation, d as HeadlessResult, T as Inbox, X as Location, aA as MAXIMUM_RULE_CONDITIONS, az as MAXIMUM_RULE_ITEMS, aB as MAXIMUM_RULE_PROBLEMS, ay as MAXIMUM_RULE_SCRIPT_BYTES, $ as MailError, c as MailTransport, O as Mailbox, k as MailboxRules, M as Message, Y as MessageLocation, s as NewTextConfidence, p as NewTextInfo, N as NewTextMessage, r as NewTextOutcome, q as NewTextRemoved, t as NewTextSignatureReason, ai as Participant, aP as RULES_REQUEST_BYTES, aQ as RULES_RESPONSE_BYTES, u as ReadContent, V as Receipt, R as Rule, e as RuleActions, f as RuleCondition, g as RuleForward, h as RuleItem, i as RuleItemInput, j as RuleVacation, l as RulesChecked, m as RulesNotice, n as RulesProblem, o as RulesSaved, a9 as SavedDraft, Q as Sender, S as Submission, a0 as accountStorage, a2 as accountStorageMaximumBytes, G as attachment, J as changed, af as chatText, aV as composeFormat, ah as conversation, aa as conversationCursor, ae as conversationLocation, ag as conversationMessage, ad as conversationPage, ac as conversationRow, K as download, a4 as draftContent, a8 as draftInputs, a6 as draftList, a7 as draftLocation, W as draftSchemas, E as entries, B as entry, x as folder, aR as headlessOperations, A as inbox, v as mailbox, w as mailboxPage, aK as mailboxRules, I as message, aq as newTextConfidence, av as newTextInfo, ax as newTextMessage, ap as newTextOutcome, au as newTextReason, at as newTextRemoved, as as newTextRemovedKind, ar as newTextSignatureReason, ab as participant, ao as readContent, L as receipt, y as renamedFolder, aE as rule, aD as ruleActions, aC as ruleCondition, aG as ruleForward, aH as ruleItem, aI as ruleItemInput, aF as ruleVacation, aM as rulesChecked, aO as rulesInputs, aJ as rulesNotice, aL as rulesProblem, aN as rulesSaved, aT as safeComposeLink, a5 as savedDraft, z as sender, a3 as serviceAccountStorage, aw as unreadNewText, aU as validComposeFormat } from './operations-g1slmaT3.js';
3
3
  import { z } from 'zod';
4
4
 
5
5
  declare const MAXIMUM_DELIVERY_BATCH = 50;
@@ -621,9 +621,9 @@ declare const importFailureReason: z.ZodEnum<{
621
621
  folder_missing: "folder_missing";
622
622
  }>;
623
623
  declare const importMessageFailure: z.ZodEnum<{
624
+ unreadable: "unreadable";
624
625
  too_large: "too_large";
625
626
  empty: "empty";
626
- unreadable: "unreadable";
627
627
  fetch_refused: "fetch_refused";
628
628
  malware: "malware";
629
629
  }>;
@@ -910,9 +910,9 @@ declare const importDetail: z.ZodObject<{
910
910
  }>;
911
911
  item: z.ZodString;
912
912
  reason: z.ZodEnum<{
913
+ unreadable: "unreadable";
913
914
  too_large: "too_large";
914
915
  empty: "empty";
915
- unreadable: "unreadable";
916
916
  fetch_refused: "fetch_refused";
917
917
  malware: "malware";
918
918
  }>;
@@ -1021,9 +1021,9 @@ declare const importAnswer: z.ZodObject<{
1021
1021
  }>;
1022
1022
  item: z.ZodString;
1023
1023
  reason: z.ZodEnum<{
1024
+ unreadable: "unreadable";
1024
1025
  too_large: "too_large";
1025
1026
  empty: "empty";
1026
- unreadable: "unreadable";
1027
1027
  fetch_refused: "fetch_refused";
1028
1028
  malware: "malware";
1029
1029
  }>;
package/dist/contracts.js CHANGED
@@ -1 +1 @@
1
- export { EXPORT_MANIFEST_NAME, IMPORT_UPLOAD_PART_BYTES, MAXIMUM_DELIVERY_BATCH, MAXIMUM_EXPORT_FOLDERS, MAXIMUM_HEADER_SAMPLE, MAXIMUM_IMPORTS_KEPT, MAXIMUM_IMPORT_FAILURES_SHOWN, MAXIMUM_IMPORT_FOLDERS, MAXIMUM_IMPORT_MESSAGE_BYTES, MAXIMUM_IMPORT_UPLOAD_BYTES, MAXIMUM_IMPORT_UPLOAD_DAY_BYTES, MAXIMUM_RULE_CONDITIONS, MAXIMUM_RULE_ITEMS, MAXIMUM_RULE_PROBLEMS, MAXIMUM_RULE_SCRIPT_BYTES, MAXIMUM_SEND_BASE64_BYTES, MAXIMUM_SEND_BODY_BYTES, MAXIMUM_SEND_BYTES, MAXIMUM_SIGNATURES, MAXIMUM_SIGNATURE_BYTES, MAXIMUM_SIGNATURE_LINES, MailError, RULES_REQUEST_BYTES, RULES_RESPONSE_BYTES, accountStorage, accountStorageMaximumBytes, attachment, changed, chatText, cleanupInput, cleanupResult, composeFormat, conversation, conversationCursor, conversationLocation, conversationMessage, conversationPage, conversationRow, deliveryEvent, deliveryEventName, deliveryMeaning, deliveryReason, deliveryState, deliveryStates, deliverySummary, download, draftContent, draftInputs, draftList, draftLocation, draftSchemas, entries, entry, exportFlag, exportManifest, exportManifestFolder, exportManifestMessage, exportStart, finishedImportStates, folder, headerSample, headerSampleInput, headerSampleMessage, headlessOperations, heldReason, importAnswer, importBegin, importConfirm, importDetail, importErrorCode, importFailureReason, importFile, importFileFormat, importFolderChoice, importKind, importList, importListAnswer, importMessageFailure, importPlanFolder, importProgress, importRef, importSecurity, importSource, importSourceInput, importSpecialUse, importState, importStates, importSummary, importUploadBegin, importUploadPart, importWaitReason, inbox, inboxCounts, inboxCountsInput, inboxFolderCount, inboxPosition, inboxWaitInput, mailbox, mailboxPage, mailboxRules, message, participant, receipt, recipientDelivery, renamedFolder, rule, ruleActions, ruleCondition, ruleForward, ruleItem, ruleItemInput, ruleVacation, rulesChecked, rulesInputs, rulesNotice, rulesProblem, rulesSaved, safeComposeLink, savedDraft, sender, sentDeliveries, sentDeliveriesLocation, sentDelivery, sentDeliveryLocation, sentDeliveryStatus, serviceAccountStorage, signature, signaturePage, signaturePlacement, signatureSave, signatureSaved, validComposeFormat } from './chunk-CXNVFCRT.js';
1
+ export { EXPORT_MANIFEST_NAME, IMPORT_UPLOAD_PART_BYTES, MAXIMUM_DELIVERY_BATCH, MAXIMUM_EXPORT_FOLDERS, MAXIMUM_HEADER_SAMPLE, MAXIMUM_IMPORTS_KEPT, MAXIMUM_IMPORT_FAILURES_SHOWN, MAXIMUM_IMPORT_FOLDERS, MAXIMUM_IMPORT_MESSAGE_BYTES, MAXIMUM_IMPORT_UPLOAD_BYTES, MAXIMUM_IMPORT_UPLOAD_DAY_BYTES, MAXIMUM_RULE_CONDITIONS, MAXIMUM_RULE_ITEMS, MAXIMUM_RULE_PROBLEMS, MAXIMUM_RULE_SCRIPT_BYTES, MAXIMUM_SEND_BASE64_BYTES, MAXIMUM_SEND_BODY_BYTES, MAXIMUM_SEND_BYTES, MAXIMUM_SIGNATURES, MAXIMUM_SIGNATURE_BYTES, MAXIMUM_SIGNATURE_LINES, MailError, RULES_REQUEST_BYTES, RULES_RESPONSE_BYTES, accountStorage, accountStorageMaximumBytes, attachment, changed, chatText, cleanupInput, cleanupResult, composeFormat, conversation, conversationCursor, conversationLocation, conversationMessage, conversationPage, conversationRow, deliveryEvent, deliveryEventName, deliveryMeaning, deliveryReason, deliveryState, deliveryStates, deliverySummary, download, draftContent, draftInputs, draftList, draftLocation, draftSchemas, entries, entry, exportFlag, exportManifest, exportManifestFolder, exportManifestMessage, exportStart, finishedImportStates, folder, headerSample, headerSampleInput, headerSampleMessage, headlessOperations, heldReason, importAnswer, importBegin, importConfirm, importDetail, importErrorCode, importFailureReason, importFile, importFileFormat, importFolderChoice, importKind, importList, importListAnswer, importMessageFailure, importPlanFolder, importProgress, importRef, importSecurity, importSource, importSourceInput, importSpecialUse, importState, importStates, importSummary, importUploadBegin, importUploadPart, importWaitReason, inbox, inboxCounts, inboxCountsInput, inboxFolderCount, inboxPosition, inboxWaitInput, mailbox, mailboxPage, mailboxRules, message, newTextConfidence, newTextInfo, newTextMessage, newTextOutcome, newTextReason, newTextRemoved, newTextRemovedKind, newTextSignatureReason, participant, readContent, receipt, recipientDelivery, renamedFolder, rule, ruleActions, ruleCondition, ruleForward, ruleItem, ruleItemInput, ruleVacation, rulesChecked, rulesInputs, rulesNotice, rulesProblem, rulesSaved, safeComposeLink, savedDraft, sender, sentDeliveries, sentDeliveriesLocation, sentDelivery, sentDeliveryLocation, sentDeliveryStatus, serviceAccountStorage, signature, signaturePage, signaturePlacement, signatureSave, signatureSaved, unreadNewText, validComposeFormat } from './chunk-RQOWWVHG.js';
@@ -112,4 +112,4 @@ declare class EmailError extends Error {
112
112
  });
113
113
  }
114
114
 
115
- export { type EmailClientOptions as E, type EmailRequestOptions as a, type EmailSender as b, type EmailMessage as c, type EmailSendOptions as d, type EmailSubmission as e, type EmailEventPage as f, type EmailWebhookEvent as g, EmailError as h, type EmailErrorCode as i, type EmailAttachment as j, type EmailExactSender as k, type EmailDomainSender as l, type EmailDomainSendScope as m, type EmailSubmissionState as n, type EmailFeedbackType as o, type EmailEventType as p, type EmailEvent as q };
115
+ export { type EmailRequestOptions as E, type EmailClientOptions as a, type EmailSender as b, type EmailMessage as c, type EmailSendOptions as d, type EmailSubmission as e, type EmailEventPage as f, type EmailWebhookEvent as g, EmailError as h, type EmailErrorCode as i, type EmailAttachment as j, type EmailExactSender as k, type EmailDomainSender as l, type EmailDomainSendScope as m, type EmailSubmissionState as n, type EmailFeedbackType as o, type EmailEventType as p, type EmailEvent as q };
package/dist/index.d.ts CHANGED
@@ -1,21 +1,24 @@
1
- import { H as HeadlessInput, S as Submission, D as DraftAction, a as DraftInput, b as DraftResult, M as MailTransport } from './operations-14iYfteB.js';
2
- export { c as HeadlessResult, j as MailboxRules, R as Rule, d as RuleActions, e as RuleCondition, f as RuleForward, g as RuleItem, h as RuleItemInput, i as RuleVacation, k as RulesChecked, l as RulesNotice, m as RulesProblem, n as RulesSaved } from './operations-14iYfteB.js';
3
- import { E as EmailClientOptions, a as EmailRequestOptions, b as EmailSender, c as EmailMessage, d as EmailSendOptions, e as EmailSubmission, f as EmailEventPage, g as EmailWebhookEvent } from './errors-B_W1C1Hu.js';
4
- export { j as EmailAttachment, m as EmailDomainSendScope, l as EmailDomainSender, h as EmailError, i as EmailErrorCode, q as EmailEvent, p as EmailEventType, k as EmailExactSender, o as EmailFeedbackType, n as EmailSubmissionState } from './errors-B_W1C1Hu.js';
1
+ import { H as HeadlessInput, N as NewTextMessage, M as Message, S as Submission, D as DraftAction, a as DraftInput, b as DraftResult, c as MailTransport } from './operations-g1slmaT3.js';
2
+ export { d as HeadlessResult, k as MailboxRules, s as NewTextConfidence, p as NewTextInfo, r as NewTextOutcome, q as NewTextRemoved, t as NewTextSignatureReason, u as ReadContent, R as Rule, e as RuleActions, f as RuleCondition, g as RuleForward, h as RuleItem, i as RuleItemInput, j as RuleVacation, l as RulesChecked, m as RulesNotice, n as RulesProblem, o as RulesSaved } from './operations-g1slmaT3.js';
3
+ import { E as EmailRequestOptions, a as EmailClientOptions, b as EmailSender, c as EmailMessage, d as EmailSendOptions, e as EmailSubmission, f as EmailEventPage, g as EmailWebhookEvent } from './errors-VxeL4C8r.js';
4
+ export { j as EmailAttachment, m as EmailDomainSendScope, l as EmailDomainSender, h as EmailError, i as EmailErrorCode, q as EmailEvent, p as EmailEventType, k as EmailExactSender, o as EmailFeedbackType, n as EmailSubmissionState } from './errors-VxeL4C8r.js';
5
5
  import 'zod';
6
6
 
7
- declare const REPA_EMAIL_API_BASE_URL = "https://api.repa.run";
8
- /** No automatic retries: after any uncertain result, look up the original key
9
- * or replay the same frozen request. Never allocate a replacement identity. */
10
- declare function createEmailClient(options: EmailClientOptions): Readonly<{
11
- listSenders: (request?: EmailRequestOptions) => Promise<readonly EmailSender[]>;
12
- send: (message: EmailMessage, request: EmailSendOptions) => Promise<EmailSubmission>;
13
- getSubmission: (operationId: string, request?: EmailRequestOptions) => Promise<EmailSubmission>;
14
- findSubmissionByKey: (idempotencyKey: string, request?: EmailRequestOptions) => Promise<EmailSubmission>;
15
- listEvents: (page?: {
16
- after?: number;
17
- limit?: number;
18
- }, request?: EmailRequestOptions) => Promise<EmailEventPage>;
7
+ type HeadlessCaller = <T>(path: string, decode: (value: unknown) => T, options: EmailRequestOptions, body: {
8
+ body: string;
9
+ key?: string;
10
+ }, operationId?: string, lookupKey?: string, maximum?: number) => Promise<T>;
11
+ /** `content: 'new'` returns what the sender wrote without the quoted chain, with `newText` saying what was
12
+ * removed (EMAIL-D240); without it (or `'full'`) the whole message. */
13
+ type ReadMessage = {
14
+ (input: HeadlessInput<'read'> & {
15
+ content: 'new';
16
+ }, options?: EmailRequestOptions): Promise<NewTextMessage>;
17
+ (input: HeadlessInput<'read'> & {
18
+ content?: 'full';
19
+ }, options?: EmailRequestOptions): Promise<Message>;
20
+ };
21
+ declare function headlessMethods(call: HeadlessCaller): {
19
22
  listMailboxes: (input: HeadlessInput<"mailboxes">, options?: EmailRequestOptions) => Promise<{
20
23
  mailboxes: {
21
24
  id: string;
@@ -57,40 +60,7 @@ declare function createEmailClient(options: EmailClientOptions): Readonly<{
57
60
  hasMore: boolean;
58
61
  count: number;
59
62
  }>;
60
- readMessage: (input: HeadlessInput<"read">, options?: EmailRequestOptions) => Promise<{
61
- entry: {
62
- uid: number;
63
- id: string;
64
- flags: number;
65
- date: string;
66
- octets: number;
67
- preview: string;
68
- hasAttachment: boolean;
69
- subject: string;
70
- from: string;
71
- to: string;
72
- };
73
- headers: {
74
- subject: string;
75
- from: string;
76
- to: string;
77
- cc: string;
78
- replyTo: string;
79
- messageId: string;
80
- unsubscribe?: string | undefined;
81
- };
82
- text: string;
83
- html: string;
84
- attachments: {
85
- part: string;
86
- name: string;
87
- type: string;
88
- octets: number;
89
- contentId?: string | undefined;
90
- }[];
91
- warnings: ("incomplete_scan" | "hosted_domain_unaligned" | "link_text_mismatch" | "lookalike_brand" | "lookalike_tenant" | "homograph_domain" | "credential_form" | "dangerous_attachment" | "encrypted_archive")[];
92
- incomplete: boolean;
93
- }>;
63
+ readMessage: ReadMessage;
94
64
  listConversations: (input: HeadlessInput<"conversations">, options?: EmailRequestOptions) => Promise<{
95
65
  conversations: {
96
66
  id: string;
@@ -145,6 +115,33 @@ declare function createEmailClient(options: EmailClientOptions): Readonly<{
145
115
  quoted: boolean;
146
116
  signature: string;
147
117
  truncated: boolean;
118
+ newText: {
119
+ outcome: "cut" | "whole" | "unreadable";
120
+ confidence: "proven" | "structural" | "none";
121
+ reason: string;
122
+ extractorVersion: number;
123
+ fullTextBytes: number;
124
+ signatureReason: "" | "rfc3676_delimiter" | "html_signature" | "sender_learned";
125
+ removed: {
126
+ kind: "quote" | "forward_header" | "signature";
127
+ messageId: string | null;
128
+ headerId: string | null;
129
+ bytes: number;
130
+ }[];
131
+ } | {
132
+ outcome: "";
133
+ confidence: "";
134
+ reason: "";
135
+ extractorVersion: 0;
136
+ fullTextBytes: 0;
137
+ signatureReason: "";
138
+ removed: {
139
+ kind: "quote" | "forward_header" | "signature";
140
+ messageId: string | null;
141
+ headerId: string | null;
142
+ bytes: number;
143
+ }[];
144
+ };
148
145
  };
149
146
  hasHTML: boolean;
150
147
  attachments: {
@@ -196,6 +193,8 @@ declare function createEmailClient(options: EmailClientOptions): Readonly<{
196
193
  warningPercent: 0 | 80 | 95;
197
194
  workspaceWarningPercent: 0 | 80 | 95;
198
195
  }>;
196
+ /** Mailbox rules need the "Read and organize" level or higher. Writes are compare-and-swap on
197
+ * `expectedRevision` (0: no rules yet) and send no Idempotency-Key; a refusal resolves `{status: 'rejected'}`. */
199
198
  getRules: (input: HeadlessInput<"rulesGet">, options?: EmailRequestOptions) => Promise<{
200
199
  accountId: string;
201
200
  kind: "personal" | "shared";
@@ -467,25 +466,23 @@ declare function createEmailClient(options: EmailClientOptions): Readonly<{
467
466
  state: "queued";
468
467
  }>;
469
468
  draft: <K extends DraftAction>(action: K, input: DraftInput<K>, options?: EmailRequestOptions) => Promise<DraftResult<K>>;
470
- }>;
471
- type EmailClient = ReturnType<typeof createEmailClient>;
472
-
473
- /** Verify the exact received bytes before JSON parsing. Resolve the versioned
474
- * secret from trusted endpoint configuration, never from request parameters. */
475
- declare function verifyEmailWebhook(input: {
476
- readonly body: Uint8Array;
477
- readonly headers: Headers | Readonly<Record<string, string>>;
478
- readonly endpointId: string;
479
- readonly secrets: Readonly<Record<number, string>>;
480
- readonly now?: Date;
481
- readonly toleranceSeconds?: number;
482
- }): EmailWebhookEvent;
469
+ };
470
+ /** Install only on the host backend. Bind the client subject to the host's
471
+ * authenticated session and enforce that user's mailbox policy before calls. */
472
+ declare function createMailTransport(client: ReturnType<typeof headlessMethods>): MailTransport;
483
473
 
484
- type HeadlessCaller = <T>(path: string, decode: (value: unknown) => T, options: EmailRequestOptions, body: {
485
- body: string;
486
- key?: string;
487
- }, operationId?: string, lookupKey?: string, maximum?: number) => Promise<T>;
488
- declare function headlessMethods(call: HeadlessCaller): {
474
+ declare const REPA_EMAIL_API_BASE_URL = "https://api.repa.run";
475
+ /** No automatic retries: after any uncertain result, look up the original key
476
+ * or replay the same frozen request. Never allocate a replacement identity. */
477
+ declare function createEmailClient(options: EmailClientOptions): Readonly<{
478
+ listSenders: (request?: EmailRequestOptions) => Promise<readonly EmailSender[]>;
479
+ send: (message: EmailMessage, request: EmailSendOptions) => Promise<EmailSubmission>;
480
+ getSubmission: (operationId: string, request?: EmailRequestOptions) => Promise<EmailSubmission>;
481
+ findSubmissionByKey: (idempotencyKey: string, request?: EmailRequestOptions) => Promise<EmailSubmission>;
482
+ listEvents: (page?: {
483
+ after?: number;
484
+ limit?: number;
485
+ }, request?: EmailRequestOptions) => Promise<EmailEventPage>;
489
486
  listMailboxes: (input: HeadlessInput<"mailboxes">, options?: EmailRequestOptions) => Promise<{
490
487
  mailboxes: {
491
488
  id: string;
@@ -527,40 +524,7 @@ declare function headlessMethods(call: HeadlessCaller): {
527
524
  hasMore: boolean;
528
525
  count: number;
529
526
  }>;
530
- readMessage: (input: HeadlessInput<"read">, options?: EmailRequestOptions) => Promise<{
531
- entry: {
532
- uid: number;
533
- id: string;
534
- flags: number;
535
- date: string;
536
- octets: number;
537
- preview: string;
538
- hasAttachment: boolean;
539
- subject: string;
540
- from: string;
541
- to: string;
542
- };
543
- headers: {
544
- subject: string;
545
- from: string;
546
- to: string;
547
- cc: string;
548
- replyTo: string;
549
- messageId: string;
550
- unsubscribe?: string | undefined;
551
- };
552
- text: string;
553
- html: string;
554
- attachments: {
555
- part: string;
556
- name: string;
557
- type: string;
558
- octets: number;
559
- contentId?: string | undefined;
560
- }[];
561
- warnings: ("incomplete_scan" | "hosted_domain_unaligned" | "link_text_mismatch" | "lookalike_brand" | "lookalike_tenant" | "homograph_domain" | "credential_form" | "dangerous_attachment" | "encrypted_archive")[];
562
- incomplete: boolean;
563
- }>;
527
+ readMessage: ReadMessage;
564
528
  listConversations: (input: HeadlessInput<"conversations">, options?: EmailRequestOptions) => Promise<{
565
529
  conversations: {
566
530
  id: string;
@@ -615,6 +579,33 @@ declare function headlessMethods(call: HeadlessCaller): {
615
579
  quoted: boolean;
616
580
  signature: string;
617
581
  truncated: boolean;
582
+ newText: {
583
+ outcome: "cut" | "whole" | "unreadable";
584
+ confidence: "proven" | "structural" | "none";
585
+ reason: string;
586
+ extractorVersion: number;
587
+ fullTextBytes: number;
588
+ signatureReason: "" | "rfc3676_delimiter" | "html_signature" | "sender_learned";
589
+ removed: {
590
+ kind: "quote" | "forward_header" | "signature";
591
+ messageId: string | null;
592
+ headerId: string | null;
593
+ bytes: number;
594
+ }[];
595
+ } | {
596
+ outcome: "";
597
+ confidence: "";
598
+ reason: "";
599
+ extractorVersion: 0;
600
+ fullTextBytes: 0;
601
+ signatureReason: "";
602
+ removed: {
603
+ kind: "quote" | "forward_header" | "signature";
604
+ messageId: string | null;
605
+ headerId: string | null;
606
+ bytes: number;
607
+ }[];
608
+ };
618
609
  };
619
610
  hasHTML: boolean;
620
611
  attachments: {
@@ -666,8 +657,6 @@ declare function headlessMethods(call: HeadlessCaller): {
666
657
  warningPercent: 0 | 80 | 95;
667
658
  workspaceWarningPercent: 0 | 80 | 95;
668
659
  }>;
669
- /** Mailbox rules need the "Read and organize" level or higher. Writes are compare-and-swap on
670
- * `expectedRevision` (0: no rules yet) and send no Idempotency-Key; a refusal resolves `{status: 'rejected'}`. */
671
660
  getRules: (input: HeadlessInput<"rulesGet">, options?: EmailRequestOptions) => Promise<{
672
661
  accountId: string;
673
662
  kind: "personal" | "shared";
@@ -939,9 +928,18 @@ declare function headlessMethods(call: HeadlessCaller): {
939
928
  state: "queued";
940
929
  }>;
941
930
  draft: <K extends DraftAction>(action: K, input: DraftInput<K>, options?: EmailRequestOptions) => Promise<DraftResult<K>>;
942
- };
943
- /** Install only on the host backend. Bind the client subject to the host's
944
- * authenticated session and enforce that user's mailbox policy before calls. */
945
- declare function createMailTransport(client: ReturnType<typeof headlessMethods>): MailTransport;
931
+ }>;
932
+ type EmailClient = ReturnType<typeof createEmailClient>;
933
+
934
+ /** Verify the exact received bytes before JSON parsing. Resolve the versioned
935
+ * secret from trusted endpoint configuration, never from request parameters. */
936
+ declare function verifyEmailWebhook(input: {
937
+ readonly body: Uint8Array;
938
+ readonly headers: Headers | Readonly<Record<string, string>>;
939
+ readonly endpointId: string;
940
+ readonly secrets: Readonly<Record<number, string>>;
941
+ readonly now?: Date;
942
+ readonly toleranceSeconds?: number;
943
+ }): EmailWebhookEvent;
946
944
 
947
- export { DraftAction, DraftInput, DraftResult, type EmailClient, EmailClientOptions, EmailEventPage, EmailMessage, EmailRequestOptions, EmailSendOptions, EmailSender, EmailSubmission, EmailWebhookEvent, HeadlessInput, MailTransport, REPA_EMAIL_API_BASE_URL, createEmailClient, createMailTransport, verifyEmailWebhook };
945
+ export { DraftAction, DraftInput, DraftResult, type EmailClient, EmailClientOptions, EmailEventPage, EmailMessage, EmailRequestOptions, EmailSendOptions, EmailSender, EmailSubmission, EmailWebhookEvent, HeadlessInput, MailTransport, Message, NewTextMessage, REPA_EMAIL_API_BASE_URL, type ReadMessage, createEmailClient, createMailTransport, verifyEmailWebhook };
package/dist/index.js CHANGED
@@ -1,4 +1,4 @@
1
- import { MAXIMUM_SEND_BODY_BYTES, MAXIMUM_SEND_BYTES, headlessOperations } from './chunk-CXNVFCRT.js';
1
+ import { MAXIMUM_SEND_BODY_BYTES, MAXIMUM_SEND_BYTES, headlessOperations } from './chunk-RQOWWVHG.js';
2
2
  import { EmailError, publicErrorCodes } from './chunk-XW4CRZRY.js';
3
3
  export { EmailError } from './chunk-XW4CRZRY.js';
4
4
  import { createHmac, timingSafeEqual } from 'crypto';
@@ -18,12 +18,17 @@ function headlessMethods(call) {
18
18
  return result.data;
19
19
  }, options, { body, ...key ? { key } : {} }, void 0, void 0, operation.responseBytes);
20
20
  }
21
+ const readMessage = (async (input, options) => {
22
+ const message = await invoke("read", input, options);
23
+ if ("newText" in message !== (input.content === "new")) throw new EmailError("PROTOCOL");
24
+ return message;
25
+ });
21
26
  const draftNames = { schedule: "draftSchedule", unschedule: "draftUnschedule", list: "draftList", get: "draftGet", save: "draftSave", discard: "draftDiscard", prepare: "draftPrepare", send: "draftSend" };
22
27
  return {
23
28
  listMailboxes: (input, options) => invoke("mailboxes", input, options),
24
29
  openMailbox: (accountId, options) => invoke("open", { accountId }, options),
25
30
  listMessages: (input, options) => invoke("list", input, options),
26
- readMessage: (input, options) => invoke("read", input, options),
31
+ readMessage,
27
32
  listConversations: (input, options) => invoke("conversations", input, options),
28
33
  readConversation: (input, options) => invoke("conversation", input, options),
29
34
  downloadMessage: (input, options) => invoke("download", input, options),
@@ -101,13 +101,65 @@ declare const conversationLocation: z.ZodObject<{
101
101
  uid: z.ZodNumber;
102
102
  flags: z.ZodNumber;
103
103
  }, z.core.$strict>;
104
- /** Chat text is the message's new text when a quote or signature boundary was
105
- * proven, otherwise its whole text; `quoted` says history was hidden. */
104
+ /** Chat text is the message's new text (EMAIL-D240): what the sender wrote,
105
+ * without quoted earlier messages and without the signature. `quoted` says
106
+ * quoted history was cut, `truncated` that the text was cut at 16 KiB, and
107
+ * `newText` says what was removed and how sure the cut is, exactly as
108
+ * `readMessage({..., content: "new"})` returns it (all empty when the message
109
+ * content was not read on this page). */
106
110
  declare const chatText: z.ZodObject<{
107
111
  text: z.ZodString;
108
112
  quoted: z.ZodBoolean;
109
113
  signature: z.ZodString;
110
114
  truncated: z.ZodBoolean;
115
+ newText: z.ZodUnion<readonly [z.ZodObject<{
116
+ outcome: z.ZodEnum<{
117
+ cut: "cut";
118
+ whole: "whole";
119
+ unreadable: "unreadable";
120
+ }>;
121
+ confidence: z.ZodEnum<{
122
+ proven: "proven";
123
+ structural: "structural";
124
+ none: "none";
125
+ }>;
126
+ reason: z.ZodString;
127
+ extractorVersion: z.ZodNumber;
128
+ fullTextBytes: z.ZodNumber;
129
+ signatureReason: z.ZodEnum<{
130
+ "": "";
131
+ rfc3676_delimiter: "rfc3676_delimiter";
132
+ html_signature: "html_signature";
133
+ sender_learned: "sender_learned";
134
+ }>;
135
+ removed: z.ZodArray<z.ZodObject<{
136
+ kind: z.ZodEnum<{
137
+ quote: "quote";
138
+ forward_header: "forward_header";
139
+ signature: "signature";
140
+ }>;
141
+ messageId: z.ZodNullable<z.ZodUUID>;
142
+ headerId: z.ZodNullable<z.ZodString>;
143
+ bytes: z.ZodNumber;
144
+ }, z.core.$strict>>;
145
+ }, z.core.$strict>, z.ZodObject<{
146
+ outcome: z.ZodLiteral<"">;
147
+ confidence: z.ZodLiteral<"">;
148
+ reason: z.ZodLiteral<"">;
149
+ extractorVersion: z.ZodLiteral<0>;
150
+ fullTextBytes: z.ZodLiteral<0>;
151
+ signatureReason: z.ZodLiteral<"">;
152
+ removed: z.ZodArray<z.ZodObject<{
153
+ kind: z.ZodEnum<{
154
+ quote: "quote";
155
+ forward_header: "forward_header";
156
+ signature: "signature";
157
+ }>;
158
+ messageId: z.ZodNullable<z.ZodUUID>;
159
+ headerId: z.ZodNullable<z.ZodString>;
160
+ bytes: z.ZodNumber;
161
+ }, z.core.$strict>>;
162
+ }, z.core.$strict>]>;
111
163
  }, z.core.$strict>;
112
164
  declare const conversationMessage: z.ZodObject<{
113
165
  id: z.ZodString;
@@ -133,6 +185,54 @@ declare const conversationMessage: z.ZodObject<{
133
185
  quoted: z.ZodBoolean;
134
186
  signature: z.ZodString;
135
187
  truncated: z.ZodBoolean;
188
+ newText: z.ZodUnion<readonly [z.ZodObject<{
189
+ outcome: z.ZodEnum<{
190
+ cut: "cut";
191
+ whole: "whole";
192
+ unreadable: "unreadable";
193
+ }>;
194
+ confidence: z.ZodEnum<{
195
+ proven: "proven";
196
+ structural: "structural";
197
+ none: "none";
198
+ }>;
199
+ reason: z.ZodString;
200
+ extractorVersion: z.ZodNumber;
201
+ fullTextBytes: z.ZodNumber;
202
+ signatureReason: z.ZodEnum<{
203
+ "": "";
204
+ rfc3676_delimiter: "rfc3676_delimiter";
205
+ html_signature: "html_signature";
206
+ sender_learned: "sender_learned";
207
+ }>;
208
+ removed: z.ZodArray<z.ZodObject<{
209
+ kind: z.ZodEnum<{
210
+ quote: "quote";
211
+ forward_header: "forward_header";
212
+ signature: "signature";
213
+ }>;
214
+ messageId: z.ZodNullable<z.ZodUUID>;
215
+ headerId: z.ZodNullable<z.ZodString>;
216
+ bytes: z.ZodNumber;
217
+ }, z.core.$strict>>;
218
+ }, z.core.$strict>, z.ZodObject<{
219
+ outcome: z.ZodLiteral<"">;
220
+ confidence: z.ZodLiteral<"">;
221
+ reason: z.ZodLiteral<"">;
222
+ extractorVersion: z.ZodLiteral<0>;
223
+ fullTextBytes: z.ZodLiteral<0>;
224
+ signatureReason: z.ZodLiteral<"">;
225
+ removed: z.ZodArray<z.ZodObject<{
226
+ kind: z.ZodEnum<{
227
+ quote: "quote";
228
+ forward_header: "forward_header";
229
+ signature: "signature";
230
+ }>;
231
+ messageId: z.ZodNullable<z.ZodUUID>;
232
+ headerId: z.ZodNullable<z.ZodString>;
233
+ bytes: z.ZodNumber;
234
+ }, z.core.$strict>>;
235
+ }, z.core.$strict>]>;
136
236
  }, z.core.$strict>;
137
237
  hasHTML: z.ZodBoolean;
138
238
  attachments: z.ZodArray<z.ZodObject<{
@@ -182,6 +282,54 @@ declare const conversation: z.ZodObject<{
182
282
  quoted: z.ZodBoolean;
183
283
  signature: z.ZodString;
184
284
  truncated: z.ZodBoolean;
285
+ newText: z.ZodUnion<readonly [z.ZodObject<{
286
+ outcome: z.ZodEnum<{
287
+ cut: "cut";
288
+ whole: "whole";
289
+ unreadable: "unreadable";
290
+ }>;
291
+ confidence: z.ZodEnum<{
292
+ proven: "proven";
293
+ structural: "structural";
294
+ none: "none";
295
+ }>;
296
+ reason: z.ZodString;
297
+ extractorVersion: z.ZodNumber;
298
+ fullTextBytes: z.ZodNumber;
299
+ signatureReason: z.ZodEnum<{
300
+ "": "";
301
+ rfc3676_delimiter: "rfc3676_delimiter";
302
+ html_signature: "html_signature";
303
+ sender_learned: "sender_learned";
304
+ }>;
305
+ removed: z.ZodArray<z.ZodObject<{
306
+ kind: z.ZodEnum<{
307
+ quote: "quote";
308
+ forward_header: "forward_header";
309
+ signature: "signature";
310
+ }>;
311
+ messageId: z.ZodNullable<z.ZodUUID>;
312
+ headerId: z.ZodNullable<z.ZodString>;
313
+ bytes: z.ZodNumber;
314
+ }, z.core.$strict>>;
315
+ }, z.core.$strict>, z.ZodObject<{
316
+ outcome: z.ZodLiteral<"">;
317
+ confidence: z.ZodLiteral<"">;
318
+ reason: z.ZodLiteral<"">;
319
+ extractorVersion: z.ZodLiteral<0>;
320
+ fullTextBytes: z.ZodLiteral<0>;
321
+ signatureReason: z.ZodLiteral<"">;
322
+ removed: z.ZodArray<z.ZodObject<{
323
+ kind: z.ZodEnum<{
324
+ quote: "quote";
325
+ forward_header: "forward_header";
326
+ signature: "signature";
327
+ }>;
328
+ messageId: z.ZodNullable<z.ZodUUID>;
329
+ headerId: z.ZodNullable<z.ZodString>;
330
+ bytes: z.ZodNumber;
331
+ }, z.core.$strict>>;
332
+ }, z.core.$strict>]>;
185
333
  }, z.core.$strict>;
186
334
  hasHTML: z.ZodBoolean;
187
335
  attachments: z.ZodArray<z.ZodObject<{
@@ -649,6 +797,228 @@ declare class MailError extends Error {
649
797
  constructor(code: string);
650
798
  }
651
799
 
800
+ /**
801
+ * What a message read returns (EMAIL-D240). `full` (the default) is the whole
802
+ * message as it was sent. `new` is only what the sender wrote in this message:
803
+ * the quoted earlier messages are left out and the signature comes separately.
804
+ * The stored message never changes; a `full` read always returns it whole.
805
+ */
806
+ declare const readContent: z.ZodEnum<{
807
+ full: "full";
808
+ new: "new";
809
+ }>;
810
+ /**
811
+ * `cut`: quoted earlier text was removed. `whole`: nothing was removed, the text
812
+ * is the whole message (a signature may still come separately). `unreadable`:
813
+ * no readable text could be derived, the text is empty.
814
+ */
815
+ declare const newTextOutcome: z.ZodEnum<{
816
+ cut: "cut";
817
+ whole: "whole";
818
+ unreadable: "unreadable";
819
+ }>;
820
+ /**
821
+ * `proven`: the removed text repeats an earlier message of the same
822
+ * conversation in this mailbox. `structural`: the sender's mail program marked
823
+ * it as a quote, but no earlier message was found to compare it with. `none`:
824
+ * nothing was removed.
825
+ */
826
+ declare const newTextConfidence: z.ZodEnum<{
827
+ proven: "proven";
828
+ structural: "structural";
829
+ none: "none";
830
+ }>;
831
+ /**
832
+ * How the signature was found. `rfc3676_delimiter`: the standard `-- ` line;
833
+ * `html_signature`: the mail program's signature block; `sender_learned`: the
834
+ * same closing lines end at least two earlier messages from this sender. Empty
835
+ * when no signature was separated.
836
+ */
837
+ declare const newTextSignatureReason: z.ZodEnum<{
838
+ "": "";
839
+ rfc3676_delimiter: "rfc3676_delimiter";
840
+ html_signature: "html_signature";
841
+ sender_learned: "sender_learned";
842
+ }>;
843
+ /** `quote`: quoted earlier text; `forward_header`: the From/Sent/To/Subject
844
+ * block that introduces such a quote; `signature`: the separated signature. */
845
+ declare const newTextRemovedKind: z.ZodEnum<{
846
+ quote: "quote";
847
+ forward_header: "forward_header";
848
+ signature: "signature";
849
+ }>;
850
+ /**
851
+ * One removed region. `messageId` is the earlier message the quote repeats,
852
+ * given only when you may read it in this mailbox (else null); it is the `id`
853
+ * of that message in `readConversation`. `headerId` is its Message-ID header,
854
+ * null when the quote is not proven. `bytes` is the size of the removed text.
855
+ */
856
+ declare const newTextRemoved: z.ZodObject<{
857
+ kind: z.ZodEnum<{
858
+ quote: "quote";
859
+ forward_header: "forward_header";
860
+ signature: "signature";
861
+ }>;
862
+ messageId: z.ZodNullable<z.ZodUUID>;
863
+ headerId: z.ZodNullable<z.ZodString>;
864
+ bytes: z.ZodNumber;
865
+ }, z.core.$strict>;
866
+ /**
867
+ * Why the text was cut or kept. Cuts: `gmail_quote`, `blockquote_cite`,
868
+ * `outlook_separator`, `apple_cite`, `moz_cite_prefix`, `yahoo_quoted`,
869
+ * `proton_quote`, `text_attribution` (an "On … wrote:" line), `text_quote_block`
870
+ * (`>` lines), `proven_repeat`. Kept whole: `no_quote`, `interleaved` (answers
871
+ * between quoted lines), `forward`, `empty_remainder` (nothing would be left),
872
+ * `too_large`, `budget`, `no_text`, `invitation`, `report`, `encrypted`. A newer
873
+ * extractor may add reasons; treat an unknown one like the outcome it comes with.
874
+ */
875
+ declare const newTextReason: z.ZodString;
876
+ /**
877
+ * What a new-text read removed and how sure it is. `fullTextBytes` is the size
878
+ * of the whole readable text, `extractorVersion` the version of the extractor
879
+ * that derived it. No word the sender wrote is ever dropped: when a cut is not
880
+ * safe the whole text is kept.
881
+ */
882
+ declare const newTextInfo: z.ZodObject<{
883
+ outcome: z.ZodEnum<{
884
+ cut: "cut";
885
+ whole: "whole";
886
+ unreadable: "unreadable";
887
+ }>;
888
+ confidence: z.ZodEnum<{
889
+ proven: "proven";
890
+ structural: "structural";
891
+ none: "none";
892
+ }>;
893
+ reason: z.ZodString;
894
+ extractorVersion: z.ZodNumber;
895
+ fullTextBytes: z.ZodNumber;
896
+ signatureReason: z.ZodEnum<{
897
+ "": "";
898
+ rfc3676_delimiter: "rfc3676_delimiter";
899
+ html_signature: "html_signature";
900
+ sender_learned: "sender_learned";
901
+ }>;
902
+ removed: z.ZodArray<z.ZodObject<{
903
+ kind: z.ZodEnum<{
904
+ quote: "quote";
905
+ forward_header: "forward_header";
906
+ signature: "signature";
907
+ }>;
908
+ messageId: z.ZodNullable<z.ZodUUID>;
909
+ headerId: z.ZodNullable<z.ZodString>;
910
+ bytes: z.ZodNumber;
911
+ }, z.core.$strict>>;
912
+ }, z.core.$strict>;
913
+ /** The form a conversation message carries when its content was not read on
914
+ * this page (it is then `incomplete`): every field empty or zero. */
915
+ declare const unreadNewText: z.ZodObject<{
916
+ outcome: z.ZodLiteral<"">;
917
+ confidence: z.ZodLiteral<"">;
918
+ reason: z.ZodLiteral<"">;
919
+ extractorVersion: z.ZodLiteral<0>;
920
+ fullTextBytes: z.ZodLiteral<0>;
921
+ signatureReason: z.ZodLiteral<"">;
922
+ removed: z.ZodArray<z.ZodObject<{
923
+ kind: z.ZodEnum<{
924
+ quote: "quote";
925
+ forward_header: "forward_header";
926
+ signature: "signature";
927
+ }>;
928
+ messageId: z.ZodNullable<z.ZodUUID>;
929
+ headerId: z.ZodNullable<z.ZodString>;
930
+ bytes: z.ZodNumber;
931
+ }, z.core.$strict>>;
932
+ }, z.core.$strict>;
933
+ /**
934
+ * `readMessage({..., content: "new"})`: `text` is what the sender wrote (the
935
+ * whole text when nothing could be cut safely), `signature` the separated
936
+ * signature (at most 1 KiB), attachments and warnings as in a full read, and
937
+ * no `html`.
938
+ */
939
+ declare const newTextMessage: z.ZodObject<{
940
+ entry: z.ZodObject<{
941
+ uid: z.ZodNumber;
942
+ id: z.ZodString;
943
+ flags: z.ZodNumber;
944
+ date: z.ZodString;
945
+ octets: z.ZodNumber;
946
+ preview: z.ZodString;
947
+ hasAttachment: z.ZodBoolean;
948
+ subject: z.ZodString;
949
+ from: z.ZodString;
950
+ to: z.ZodString;
951
+ }, z.core.$strict>;
952
+ headers: z.ZodObject<{
953
+ subject: z.ZodString;
954
+ from: z.ZodString;
955
+ to: z.ZodString;
956
+ cc: z.ZodString;
957
+ replyTo: z.ZodString;
958
+ messageId: z.ZodString;
959
+ unsubscribe: z.ZodOptional<z.ZodString>;
960
+ }, z.core.$strict>;
961
+ text: z.ZodString;
962
+ signature: z.ZodString;
963
+ attachments: z.ZodArray<z.ZodObject<{
964
+ contentId: z.ZodOptional<z.ZodString>;
965
+ part: z.ZodString;
966
+ name: z.ZodString;
967
+ type: z.ZodString;
968
+ octets: z.ZodNumber;
969
+ }, z.core.$strict>>;
970
+ warnings: z.ZodArray<z.ZodEnum<{
971
+ incomplete_scan: "incomplete_scan";
972
+ hosted_domain_unaligned: "hosted_domain_unaligned";
973
+ link_text_mismatch: "link_text_mismatch";
974
+ lookalike_brand: "lookalike_brand";
975
+ lookalike_tenant: "lookalike_tenant";
976
+ homograph_domain: "homograph_domain";
977
+ credential_form: "credential_form";
978
+ dangerous_attachment: "dangerous_attachment";
979
+ encrypted_archive: "encrypted_archive";
980
+ }>>;
981
+ incomplete: z.ZodBoolean;
982
+ newText: z.ZodObject<{
983
+ outcome: z.ZodEnum<{
984
+ cut: "cut";
985
+ whole: "whole";
986
+ unreadable: "unreadable";
987
+ }>;
988
+ confidence: z.ZodEnum<{
989
+ proven: "proven";
990
+ structural: "structural";
991
+ none: "none";
992
+ }>;
993
+ reason: z.ZodString;
994
+ extractorVersion: z.ZodNumber;
995
+ fullTextBytes: z.ZodNumber;
996
+ signatureReason: z.ZodEnum<{
997
+ "": "";
998
+ rfc3676_delimiter: "rfc3676_delimiter";
999
+ html_signature: "html_signature";
1000
+ sender_learned: "sender_learned";
1001
+ }>;
1002
+ removed: z.ZodArray<z.ZodObject<{
1003
+ kind: z.ZodEnum<{
1004
+ quote: "quote";
1005
+ forward_header: "forward_header";
1006
+ signature: "signature";
1007
+ }>;
1008
+ messageId: z.ZodNullable<z.ZodUUID>;
1009
+ headerId: z.ZodNullable<z.ZodString>;
1010
+ bytes: z.ZodNumber;
1011
+ }, z.core.$strict>>;
1012
+ }, z.core.$strict>;
1013
+ }, z.core.$strict>;
1014
+ type ReadContent = z.infer<typeof readContent>;
1015
+ type NewTextOutcome = z.infer<typeof newTextOutcome>;
1016
+ type NewTextConfidence = z.infer<typeof newTextConfidence>;
1017
+ type NewTextSignatureReason = z.infer<typeof newTextSignatureReason>;
1018
+ type NewTextRemoved = z.infer<typeof newTextRemoved>;
1019
+ type NewTextInfo = z.infer<typeof newTextInfo>;
1020
+ type NewTextMessage = z.infer<typeof newTextMessage>;
1021
+
652
1022
  /**
653
1023
  * Mailbox rules (Sieve filtering) for integrations holding the "Read and organize" mailbox level or higher
654
1024
  * (EMAIL-D100). The mailbox's active script is read as ordered items; writes are compare-and-swap on the revision
@@ -1408,6 +1778,7 @@ declare const headlessOperations: {
1408
1778
  key: "id" | "operationId" | undefined;
1409
1779
  revision: boolean;
1410
1780
  };
1781
+ /** `content: 'new'` answers what the sender wrote without the quoted chain (EMAIL-D240); default `full`. */
1411
1782
  readonly read: {
1412
1783
  path: string;
1413
1784
  internal: string;
@@ -1416,8 +1787,12 @@ declare const headlessOperations: {
1416
1787
  folderId: z.ZodUUID;
1417
1788
  uidValidity: z.ZodNumber;
1418
1789
  uid: z.ZodNumber;
1790
+ content: z.ZodOptional<z.ZodEnum<{
1791
+ full: "full";
1792
+ new: "new";
1793
+ }>>;
1419
1794
  }, z.core.$strict>;
1420
- output: z.ZodObject<{
1795
+ output: z.ZodUnion<readonly [z.ZodObject<{
1421
1796
  entry: z.ZodObject<{
1422
1797
  uid: z.ZodNumber;
1423
1798
  id: z.ZodString;
@@ -1460,9 +1835,83 @@ declare const headlessOperations: {
1460
1835
  encrypted_archive: "encrypted_archive";
1461
1836
  }>>;
1462
1837
  incomplete: z.ZodBoolean;
1463
- }, z.core.$strict>;
1838
+ }, z.core.$strict>, z.ZodObject<{
1839
+ entry: z.ZodObject<{
1840
+ uid: z.ZodNumber;
1841
+ id: z.ZodString;
1842
+ flags: z.ZodNumber;
1843
+ date: z.ZodString;
1844
+ octets: z.ZodNumber;
1845
+ preview: z.ZodString;
1846
+ hasAttachment: z.ZodBoolean;
1847
+ subject: z.ZodString;
1848
+ from: z.ZodString;
1849
+ to: z.ZodString;
1850
+ }, z.core.$strict>;
1851
+ headers: z.ZodObject<{
1852
+ subject: z.ZodString;
1853
+ from: z.ZodString;
1854
+ to: z.ZodString;
1855
+ cc: z.ZodString;
1856
+ replyTo: z.ZodString;
1857
+ messageId: z.ZodString;
1858
+ unsubscribe: z.ZodOptional<z.ZodString>;
1859
+ }, z.core.$strict>;
1860
+ text: z.ZodString;
1861
+ signature: z.ZodString;
1862
+ attachments: z.ZodArray<z.ZodObject<{
1863
+ contentId: z.ZodOptional<z.ZodString>;
1864
+ part: z.ZodString;
1865
+ name: z.ZodString;
1866
+ type: z.ZodString;
1867
+ octets: z.ZodNumber;
1868
+ }, z.core.$strict>>;
1869
+ warnings: z.ZodArray<z.ZodEnum<{
1870
+ incomplete_scan: "incomplete_scan";
1871
+ hosted_domain_unaligned: "hosted_domain_unaligned";
1872
+ link_text_mismatch: "link_text_mismatch";
1873
+ lookalike_brand: "lookalike_brand";
1874
+ lookalike_tenant: "lookalike_tenant";
1875
+ homograph_domain: "homograph_domain";
1876
+ credential_form: "credential_form";
1877
+ dangerous_attachment: "dangerous_attachment";
1878
+ encrypted_archive: "encrypted_archive";
1879
+ }>>;
1880
+ incomplete: z.ZodBoolean;
1881
+ newText: z.ZodObject<{
1882
+ outcome: z.ZodEnum<{
1883
+ cut: "cut";
1884
+ whole: "whole";
1885
+ unreadable: "unreadable";
1886
+ }>;
1887
+ confidence: z.ZodEnum<{
1888
+ proven: "proven";
1889
+ structural: "structural";
1890
+ none: "none";
1891
+ }>;
1892
+ reason: z.ZodString;
1893
+ extractorVersion: z.ZodNumber;
1894
+ fullTextBytes: z.ZodNumber;
1895
+ signatureReason: z.ZodEnum<{
1896
+ "": "";
1897
+ rfc3676_delimiter: "rfc3676_delimiter";
1898
+ html_signature: "html_signature";
1899
+ sender_learned: "sender_learned";
1900
+ }>;
1901
+ removed: z.ZodArray<z.ZodObject<{
1902
+ kind: z.ZodEnum<{
1903
+ quote: "quote";
1904
+ forward_header: "forward_header";
1905
+ signature: "signature";
1906
+ }>;
1907
+ messageId: z.ZodNullable<z.ZodUUID>;
1908
+ headerId: z.ZodNullable<z.ZodString>;
1909
+ bytes: z.ZodNumber;
1910
+ }, z.core.$strict>>;
1911
+ }, z.core.$strict>;
1912
+ }, z.core.$strict>]>;
1464
1913
  envelope: z.ZodObject<{
1465
- data: z.ZodObject<{
1914
+ data: z.ZodUnion<readonly [z.ZodObject<{
1466
1915
  entry: z.ZodObject<{
1467
1916
  uid: z.ZodNumber;
1468
1917
  id: z.ZodString;
@@ -1505,7 +1954,81 @@ declare const headlessOperations: {
1505
1954
  encrypted_archive: "encrypted_archive";
1506
1955
  }>>;
1507
1956
  incomplete: z.ZodBoolean;
1508
- }, z.core.$strict>;
1957
+ }, z.core.$strict>, z.ZodObject<{
1958
+ entry: z.ZodObject<{
1959
+ uid: z.ZodNumber;
1960
+ id: z.ZodString;
1961
+ flags: z.ZodNumber;
1962
+ date: z.ZodString;
1963
+ octets: z.ZodNumber;
1964
+ preview: z.ZodString;
1965
+ hasAttachment: z.ZodBoolean;
1966
+ subject: z.ZodString;
1967
+ from: z.ZodString;
1968
+ to: z.ZodString;
1969
+ }, z.core.$strict>;
1970
+ headers: z.ZodObject<{
1971
+ subject: z.ZodString;
1972
+ from: z.ZodString;
1973
+ to: z.ZodString;
1974
+ cc: z.ZodString;
1975
+ replyTo: z.ZodString;
1976
+ messageId: z.ZodString;
1977
+ unsubscribe: z.ZodOptional<z.ZodString>;
1978
+ }, z.core.$strict>;
1979
+ text: z.ZodString;
1980
+ signature: z.ZodString;
1981
+ attachments: z.ZodArray<z.ZodObject<{
1982
+ contentId: z.ZodOptional<z.ZodString>;
1983
+ part: z.ZodString;
1984
+ name: z.ZodString;
1985
+ type: z.ZodString;
1986
+ octets: z.ZodNumber;
1987
+ }, z.core.$strict>>;
1988
+ warnings: z.ZodArray<z.ZodEnum<{
1989
+ incomplete_scan: "incomplete_scan";
1990
+ hosted_domain_unaligned: "hosted_domain_unaligned";
1991
+ link_text_mismatch: "link_text_mismatch";
1992
+ lookalike_brand: "lookalike_brand";
1993
+ lookalike_tenant: "lookalike_tenant";
1994
+ homograph_domain: "homograph_domain";
1995
+ credential_form: "credential_form";
1996
+ dangerous_attachment: "dangerous_attachment";
1997
+ encrypted_archive: "encrypted_archive";
1998
+ }>>;
1999
+ incomplete: z.ZodBoolean;
2000
+ newText: z.ZodObject<{
2001
+ outcome: z.ZodEnum<{
2002
+ cut: "cut";
2003
+ whole: "whole";
2004
+ unreadable: "unreadable";
2005
+ }>;
2006
+ confidence: z.ZodEnum<{
2007
+ proven: "proven";
2008
+ structural: "structural";
2009
+ none: "none";
2010
+ }>;
2011
+ reason: z.ZodString;
2012
+ extractorVersion: z.ZodNumber;
2013
+ fullTextBytes: z.ZodNumber;
2014
+ signatureReason: z.ZodEnum<{
2015
+ "": "";
2016
+ rfc3676_delimiter: "rfc3676_delimiter";
2017
+ html_signature: "html_signature";
2018
+ sender_learned: "sender_learned";
2019
+ }>;
2020
+ removed: z.ZodArray<z.ZodObject<{
2021
+ kind: z.ZodEnum<{
2022
+ quote: "quote";
2023
+ forward_header: "forward_header";
2024
+ signature: "signature";
2025
+ }>;
2026
+ messageId: z.ZodNullable<z.ZodUUID>;
2027
+ headerId: z.ZodNullable<z.ZodString>;
2028
+ bytes: z.ZodNumber;
2029
+ }, z.core.$strict>>;
2030
+ }, z.core.$strict>;
2031
+ }, z.core.$strict>]>;
1509
2032
  }, z.core.$strict>;
1510
2033
  requestBytes: number;
1511
2034
  responseBytes: number;
@@ -1631,6 +2154,54 @@ declare const headlessOperations: {
1631
2154
  quoted: z.ZodBoolean;
1632
2155
  signature: z.ZodString;
1633
2156
  truncated: z.ZodBoolean;
2157
+ newText: z.ZodUnion<readonly [z.ZodObject<{
2158
+ outcome: z.ZodEnum<{
2159
+ cut: "cut";
2160
+ whole: "whole";
2161
+ unreadable: "unreadable";
2162
+ }>;
2163
+ confidence: z.ZodEnum<{
2164
+ proven: "proven";
2165
+ structural: "structural";
2166
+ none: "none";
2167
+ }>;
2168
+ reason: z.ZodString;
2169
+ extractorVersion: z.ZodNumber;
2170
+ fullTextBytes: z.ZodNumber;
2171
+ signatureReason: z.ZodEnum<{
2172
+ "": "";
2173
+ rfc3676_delimiter: "rfc3676_delimiter";
2174
+ html_signature: "html_signature";
2175
+ sender_learned: "sender_learned";
2176
+ }>;
2177
+ removed: z.ZodArray<z.ZodObject<{
2178
+ kind: z.ZodEnum<{
2179
+ quote: "quote";
2180
+ forward_header: "forward_header";
2181
+ signature: "signature";
2182
+ }>;
2183
+ messageId: z.ZodNullable<z.ZodUUID>;
2184
+ headerId: z.ZodNullable<z.ZodString>;
2185
+ bytes: z.ZodNumber;
2186
+ }, z.core.$strict>>;
2187
+ }, z.core.$strict>, z.ZodObject<{
2188
+ outcome: z.ZodLiteral<"">;
2189
+ confidence: z.ZodLiteral<"">;
2190
+ reason: z.ZodLiteral<"">;
2191
+ extractorVersion: z.ZodLiteral<0>;
2192
+ fullTextBytes: z.ZodLiteral<0>;
2193
+ signatureReason: z.ZodLiteral<"">;
2194
+ removed: z.ZodArray<z.ZodObject<{
2195
+ kind: z.ZodEnum<{
2196
+ quote: "quote";
2197
+ forward_header: "forward_header";
2198
+ signature: "signature";
2199
+ }>;
2200
+ messageId: z.ZodNullable<z.ZodUUID>;
2201
+ headerId: z.ZodNullable<z.ZodString>;
2202
+ bytes: z.ZodNumber;
2203
+ }, z.core.$strict>>;
2204
+ }, z.core.$strict>]>;
1634
2205
  }, z.core.$strict>;
1635
2206
  hasHTML: z.ZodBoolean;
1636
2207
  attachments: z.ZodArray<z.ZodObject<{
@@ -1683,6 +2254,54 @@ declare const headlessOperations: {
1683
2254
  quoted: z.ZodBoolean;
1684
2255
  signature: z.ZodString;
1685
2256
  truncated: z.ZodBoolean;
2257
+ newText: z.ZodUnion<readonly [z.ZodObject<{
2258
+ outcome: z.ZodEnum<{
2259
+ cut: "cut";
2260
+ whole: "whole";
2261
+ unreadable: "unreadable";
2262
+ }>;
2263
+ confidence: z.ZodEnum<{
2264
+ proven: "proven";
2265
+ structural: "structural";
2266
+ none: "none";
2267
+ }>;
2268
+ reason: z.ZodString;
2269
+ extractorVersion: z.ZodNumber;
2270
+ fullTextBytes: z.ZodNumber;
2271
+ signatureReason: z.ZodEnum<{
2272
+ "": "";
2273
+ rfc3676_delimiter: "rfc3676_delimiter";
2274
+ html_signature: "html_signature";
2275
+ sender_learned: "sender_learned";
2276
+ }>;
2277
+ removed: z.ZodArray<z.ZodObject<{
2278
+ kind: z.ZodEnum<{
2279
+ quote: "quote";
2280
+ forward_header: "forward_header";
2281
+ signature: "signature";
2282
+ }>;
2283
+ messageId: z.ZodNullable<z.ZodUUID>;
2284
+ headerId: z.ZodNullable<z.ZodString>;
2285
+ bytes: z.ZodNumber;
2286
+ }, z.core.$strict>>;
2287
+ }, z.core.$strict>, z.ZodObject<{
2288
+ outcome: z.ZodLiteral<"">;
2289
+ confidence: z.ZodLiteral<"">;
2290
+ reason: z.ZodLiteral<"">;
2291
+ extractorVersion: z.ZodLiteral<0>;
2292
+ fullTextBytes: z.ZodLiteral<0>;
2293
+ signatureReason: z.ZodLiteral<"">;
2294
+ removed: z.ZodArray<z.ZodObject<{
2295
+ kind: z.ZodEnum<{
2296
+ quote: "quote";
2297
+ forward_header: "forward_header";
2298
+ signature: "signature";
2299
+ }>;
2300
+ messageId: z.ZodNullable<z.ZodUUID>;
2301
+ headerId: z.ZodNullable<z.ZodString>;
2302
+ bytes: z.ZodNumber;
2303
+ }, z.core.$strict>>;
2304
+ }, z.core.$strict>]>;
1686
2305
  }, z.core.$strict>;
1687
2306
  hasHTML: z.ZodBoolean;
1688
2307
  attachments: z.ZodArray<z.ZodObject<{
@@ -3696,4 +4315,4 @@ type HeadlessOperation = keyof typeof headlessOperations;
3696
4315
  type HeadlessInput<K extends HeadlessOperation> = z.infer<(typeof headlessOperations)[K]['input']>;
3697
4316
  type HeadlessResult<K extends HeadlessOperation> = z.infer<(typeof headlessOperations)[K]['output']>;
3698
4317
 
3699
- export { draftList as $, receipt as A, type Mailbox as B, type ComposeNode as C, type DraftAction as D, type Folder as E, type FolderInput as F, type Sender as G, type HeadlessInput as H, type Inbox as I, type Entry as J, type Message as K, type Receipt as L, type MailTransport as M, draftSchemas as N, type Location as O, type MessageLocation as P, type ConversationTarget as Q, type Rule as R, type Submission as S, type Change as T, MailError as U, accountStorage as V, type AccountStorage as W, accountStorageMaximumBytes as X, serviceAccountStorage as Y, draftContent as Z, savedDraft as _, type DraftInput as a, draftLocation as a0, draftInputs as a1, type SavedDraft as a2, conversationCursor as a3, participant as a4, conversationRow as a5, conversationPage as a6, conversationLocation as a7, chatText as a8, conversationMessage as a9, headlessOperations as aA, type HeadlessOperation as aB, safeComposeLink as aC, validComposeFormat as aD, composeFormat as aE, conversation as aa, type Participant as ab, type ConversationRow as ac, type ConversationPage as ad, type ConversationLocation as ae, type ConversationMessage as af, type Conversation as ag, MAXIMUM_RULE_SCRIPT_BYTES as ah, MAXIMUM_RULE_ITEMS as ai, MAXIMUM_RULE_CONDITIONS as aj, MAXIMUM_RULE_PROBLEMS as ak, ruleCondition as al, ruleActions as am, rule as an, ruleVacation as ao, ruleForward as ap, ruleItem as aq, ruleItemInput as ar, rulesNotice as as, mailboxRules as at, rulesProblem as au, rulesChecked as av, rulesSaved as aw, rulesInputs as ax, RULES_REQUEST_BYTES as ay, RULES_RESPONSE_BYTES as az, type DraftResult as b, type HeadlessResult as c, type RuleActions as d, type RuleCondition as e, type RuleForward as f, type RuleItem as g, type RuleItemInput as h, type RuleVacation as i, type MailboxRules as j, type RulesChecked as k, type RulesNotice as l, type RulesProblem as m, type RulesSaved as n, mailbox as o, mailboxPage as p, folder as q, renamedFolder as r, sender as s, inbox as t, entry as u, entries as v, attachment as w, message as x, changed as y, download as z };
4318
+ export { MailError as $, inbox as A, entry as B, type ComposeNode as C, type DraftAction as D, entries as E, type FolderInput as F, attachment as G, type HeadlessInput as H, message as I, changed as J, download as K, receipt as L, type Message as M, type NewTextMessage as N, type Mailbox as O, type Folder as P, type Sender as Q, type Rule as R, type Submission as S, type Inbox as T, type Entry as U, type Receipt as V, draftSchemas as W, type Location as X, type MessageLocation as Y, type ConversationTarget as Z, type Change as _, type DraftInput as a, accountStorage as a0, type AccountStorage as a1, accountStorageMaximumBytes as a2, serviceAccountStorage as a3, draftContent as a4, savedDraft as a5, draftList as a6, draftLocation as a7, draftInputs as a8, type SavedDraft as a9, MAXIMUM_RULE_CONDITIONS as aA, MAXIMUM_RULE_PROBLEMS as aB, ruleCondition as aC, ruleActions as aD, rule as aE, ruleVacation as aF, ruleForward as aG, ruleItem as aH, ruleItemInput as aI, rulesNotice as aJ, mailboxRules as aK, rulesProblem as aL, rulesChecked as aM, rulesSaved as aN, rulesInputs as aO, RULES_REQUEST_BYTES as aP, RULES_RESPONSE_BYTES as aQ, headlessOperations as aR, type HeadlessOperation as aS, safeComposeLink as aT, validComposeFormat as aU, composeFormat as aV, conversationCursor as aa, participant as ab, conversationRow as ac, conversationPage as ad, conversationLocation as ae, chatText as af, conversationMessage as ag, conversation as ah, type Participant as ai, type ConversationRow as aj, type ConversationPage as ak, type ConversationLocation as al, type ConversationMessage as am, type Conversation as an, readContent as ao, newTextOutcome as ap, newTextConfidence as aq, newTextSignatureReason as ar, newTextRemovedKind as as, newTextRemoved as at, newTextReason as au, newTextInfo as av, unreadNewText as aw, newTextMessage as ax, MAXIMUM_RULE_SCRIPT_BYTES as ay, MAXIMUM_RULE_ITEMS as az, type DraftResult as b, type MailTransport as c, type HeadlessResult as d, type RuleActions as e, type RuleCondition as f, type RuleForward as g, type RuleItem as h, type RuleItemInput as i, type RuleVacation as j, type MailboxRules as k, type RulesChecked as l, type RulesNotice as m, type RulesProblem as n, type RulesSaved as o, type NewTextInfo as p, type NewTextRemoved as q, type NewTextOutcome as r, type NewTextConfidence as s, type NewTextSignatureReason as t, type ReadContent as u, mailbox as v, mailboxPage as w, folder as x, renamedFolder as y, sender as z };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@repa/mail",
3
- "version": "0.1.0-alpha.20",
3
+ "version": "0.1.0-alpha.21",
4
4
  "description": "Server-side client library for the repa mail HTTP API: send, submission status, event history and signed webhook verification.",
5
5
  "license": "SEE LICENSE IN LICENSE",
6
6
  "repository": {
@@ -14,7 +14,7 @@
14
14
  },
15
15
  "repaRelease": {
16
16
  "train": "public-sdk",
17
- "coordinatedVersion": "0.1.0-alpha.20",
17
+ "coordinatedVersion": "0.1.0-alpha.21",
18
18
  "channel": "alpha",
19
19
  "licenseStatus": "evaluation-only"
20
20
  },