@repa/mail 0.0.0-stage → 0.1.0-alpha.20
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/LICENSE +36 -0
- package/README.md +172 -2
- package/dist/browser-denied.d.ts +7 -0
- package/dist/browser-denied.js +14 -0
- package/dist/chunk-CXNVFCRT.js +879 -0
- package/dist/chunk-XW4CRZRY.js +47 -0
- package/dist/contracts.d.ts +1278 -0
- package/dist/contracts.js +1 -0
- package/dist/errors-B_W1C1Hu.d.ts +115 -0
- package/dist/index.d.ts +947 -0
- package/dist/index.js +275 -0
- package/dist/operations-14iYfteB.d.ts +3699 -0
- package/package.json +57 -3
|
@@ -0,0 +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';
|
|
@@ -0,0 +1,115 @@
|
|
|
1
|
+
interface EmailAttachment {
|
|
2
|
+
readonly filename: string;
|
|
3
|
+
readonly contentType: string;
|
|
4
|
+
/** Canonical padded base64. Buffer.from(bytes).toString('base64') on Node. */
|
|
5
|
+
readonly content: string;
|
|
6
|
+
}
|
|
7
|
+
interface EmailMessage {
|
|
8
|
+
/** Granted email address, optionally `Display name <address>`. Repa resolves
|
|
9
|
+
* its exact sender/Sent grant; this field cannot expand key permissions. */
|
|
10
|
+
readonly from: string;
|
|
11
|
+
readonly to?: readonly string[];
|
|
12
|
+
readonly cc?: readonly string[];
|
|
13
|
+
readonly bcc?: readonly string[];
|
|
14
|
+
readonly subject: string;
|
|
15
|
+
readonly text?: string;
|
|
16
|
+
readonly html?: string;
|
|
17
|
+
readonly attachments?: readonly EmailAttachment[];
|
|
18
|
+
}
|
|
19
|
+
/** An exact address this key may send as, with the mailbox that keeps its Sent copy. */
|
|
20
|
+
interface EmailExactSender {
|
|
21
|
+
readonly grant: 'sender';
|
|
22
|
+
readonly id: string;
|
|
23
|
+
readonly address: string;
|
|
24
|
+
readonly sentAccountId: string;
|
|
25
|
+
readonly ready: boolean;
|
|
26
|
+
}
|
|
27
|
+
/** A domain this key may send from: any address the scope covers, including addresses that do not exist yet.
|
|
28
|
+
* 'except_personal' leaves out personal mailboxes' addresses; 'without_mailbox' allows only addresses without a mailbox. */
|
|
29
|
+
interface EmailDomainSender {
|
|
30
|
+
readonly grant: 'domain';
|
|
31
|
+
readonly domainId: string;
|
|
32
|
+
readonly domain: string;
|
|
33
|
+
readonly scope: EmailDomainSendScope;
|
|
34
|
+
readonly ready: boolean;
|
|
35
|
+
}
|
|
36
|
+
type EmailDomainSendScope = 'all' | 'except_personal' | 'without_mailbox';
|
|
37
|
+
type EmailSender = EmailExactSender | EmailDomainSender;
|
|
38
|
+
type EmailSubmissionState = 'preparing' | 'pending' | 'accepted' | 'queued' | 'dispatching' | 'acceptance_unknown' | 'provider_accepted' | 'failed' | 'cancelled';
|
|
39
|
+
type EmailFeedbackType = 'Send' | 'Delivery' | 'Bounce' | 'Complaint' | 'Reject' | 'Rendering Failure' | 'DeliveryDelay';
|
|
40
|
+
type EmailEventType = EmailSubmissionState | EmailFeedbackType;
|
|
41
|
+
interface EmailSubmission {
|
|
42
|
+
readonly operationId: string;
|
|
43
|
+
readonly state: EmailSubmissionState;
|
|
44
|
+
readonly createdAt: string;
|
|
45
|
+
/** Durable Repa acceptance time; provider acceptance is reported by state. */
|
|
46
|
+
readonly acceptedAt: string | null;
|
|
47
|
+
readonly recipients: readonly {
|
|
48
|
+
readonly ordinal: number;
|
|
49
|
+
readonly type: EmailFeedbackType;
|
|
50
|
+
readonly at: string;
|
|
51
|
+
readonly possibleComplainant: boolean;
|
|
52
|
+
}[];
|
|
53
|
+
}
|
|
54
|
+
interface EmailEvent {
|
|
55
|
+
readonly version: 1;
|
|
56
|
+
readonly id: string;
|
|
57
|
+
readonly operationId: string;
|
|
58
|
+
readonly type: EmailEventType;
|
|
59
|
+
readonly occurredAt: string;
|
|
60
|
+
}
|
|
61
|
+
interface EmailEventPage {
|
|
62
|
+
readonly events: readonly EmailEvent[];
|
|
63
|
+
readonly next: number;
|
|
64
|
+
}
|
|
65
|
+
interface EmailRequestOptions {
|
|
66
|
+
readonly signal?: AbortSignal;
|
|
67
|
+
readonly timeoutMs?: number;
|
|
68
|
+
readonly subject?: string;
|
|
69
|
+
}
|
|
70
|
+
interface EmailSendOptions extends EmailRequestOptions {
|
|
71
|
+
readonly idempotencyKey: string;
|
|
72
|
+
}
|
|
73
|
+
interface EmailClientOptions {
|
|
74
|
+
readonly apiKey: string;
|
|
75
|
+
/** Opaque host identity partition; it does not grant mailbox authority. */
|
|
76
|
+
readonly subject: string;
|
|
77
|
+
readonly baseUrl?: string;
|
|
78
|
+
readonly fetch?: typeof fetch;
|
|
79
|
+
readonly timeoutMs?: number;
|
|
80
|
+
}
|
|
81
|
+
interface EmailWebhookEvent {
|
|
82
|
+
readonly schemaVersion: 'devcited-webhook-event.v1';
|
|
83
|
+
readonly id: string;
|
|
84
|
+
readonly type: 'mail.submission.status';
|
|
85
|
+
readonly occurredAt: string;
|
|
86
|
+
readonly data: EmailEvent & {
|
|
87
|
+
readonly workspaceId: number;
|
|
88
|
+
readonly integrationId: string;
|
|
89
|
+
};
|
|
90
|
+
}
|
|
91
|
+
|
|
92
|
+
type EmailErrorCode = 'INVALID_REQUEST' | 'UNAUTHORIZED' | 'DENIED' | 'NOT_FOUND' | 'CONFLICT' | 'SEND_ALLOWANCE' | 'FOLDER_PROTECTED' | 'FOLDER_NOT_SELECTABLE' | 'FOLDER_NOT_EMPTY' | 'STORAGE_LIMIT' | 'SENDING_UNAVAILABLE' | 'RECIPIENT_SUPPRESSED' | 'LIMIT' | 'UNAVAILABLE' | 'MESSAGE_TOO_LARGE' | 'PAYLOAD_TOO_LARGE' | 'RATE_LIMITED' | 'SERVER_ONLY' | 'TIMEOUT' | 'ABORTED' | 'CONNECTION' | 'PROTOCOL' | 'INVALID_SIGNATURE';
|
|
93
|
+
declare class EmailError extends Error {
|
|
94
|
+
readonly code: EmailErrorCode;
|
|
95
|
+
readonly attachmentBytes: number | null;
|
|
96
|
+
readonly attachmentCapacityBytes: number | null;
|
|
97
|
+
readonly limitBytes: number | null;
|
|
98
|
+
readonly status: number | null;
|
|
99
|
+
readonly requestId: string | null;
|
|
100
|
+
readonly retryAfterSeconds: number | null;
|
|
101
|
+
readonly idempotencyKey: string | null;
|
|
102
|
+
readonly operationId: string | null;
|
|
103
|
+
constructor(code: EmailErrorCode, metadata?: {
|
|
104
|
+
attachmentBytes?: number;
|
|
105
|
+
attachmentCapacityBytes?: number;
|
|
106
|
+
limitBytes?: number;
|
|
107
|
+
status?: number;
|
|
108
|
+
requestId?: string;
|
|
109
|
+
retryAfterSeconds?: number;
|
|
110
|
+
idempotencyKey?: string;
|
|
111
|
+
operationId?: string;
|
|
112
|
+
});
|
|
113
|
+
}
|
|
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 };
|