groundmail 0.37.0 → 0.38.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +16 -0
- package/dist/authjs.d.ts +1 -1
- package/dist/authjs.js +1 -1
- package/dist/better-auth.d.ts +1 -1
- package/dist/better-auth.js +1 -1
- package/dist/{chunk-HMOQDJOX.js → chunk-5KMGMW5F.js} +19 -0
- package/dist/clerk.d.ts +1 -1
- package/dist/clerk.js +1 -1
- package/dist/{client-BZWkihNZ.d.ts → client-gRhoYpOK.d.ts} +49 -1
- package/dist/index.d.ts +2 -2
- package/dist/index.js +1 -1
- package/dist/payload.d.ts +1 -1
- package/dist/payload.js +1 -1
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -79,6 +79,22 @@ time. Also: `tx.testInbox.list({ to, since })`, `tx.testInbox.get(id)` and `tx.t
|
|
|
79
79
|
(domain and monthly usage). Emails sent with a `gm_test_` key land here too. Details:
|
|
80
80
|
https://docs.groundmail.dev/email-testing
|
|
81
81
|
|
|
82
|
+
## Batches
|
|
83
|
+
|
|
84
|
+
`emails.batch()` sends up to 100 emails in one request and returns a `batch_id` shared by every
|
|
85
|
+
email it accepted. Schedule a batch with `scheduledAt` on each email, then check on it or call it
|
|
86
|
+
off in one call:
|
|
87
|
+
|
|
88
|
+
```ts
|
|
89
|
+
const { batch_id } = await tx.emails.batch(emails) // each with scheduledAt: '2026-11-04T09:00:00Z'
|
|
90
|
+
|
|
91
|
+
await tx.batches.get(batch_id) // { total: 100, counts: { scheduled: 100 }, … }
|
|
92
|
+
await tx.batches.cancel(batch_id) // { cancelled: 100, already_cancelled: 0, not_cancellable: 0 }
|
|
93
|
+
```
|
|
94
|
+
|
|
95
|
+
`cancel` only touches emails that are still scheduled and is safe to repeat. Details:
|
|
96
|
+
https://docs.groundmail.dev/emails#batches
|
|
97
|
+
|
|
82
98
|
## Senders
|
|
83
99
|
|
|
84
100
|
Save a sender once (name, an address on a verified domain, where replies go) and send as it by
|
package/dist/authjs.d.ts
CHANGED
package/dist/authjs.js
CHANGED
package/dist/better-auth.d.ts
CHANGED
package/dist/better-auth.js
CHANGED
|
@@ -1407,6 +1407,24 @@ var AutomationsResource = class {
|
|
|
1407
1407
|
}
|
|
1408
1408
|
};
|
|
1409
1409
|
|
|
1410
|
+
// src/batches.ts
|
|
1411
|
+
var BatchesResource = class {
|
|
1412
|
+
constructor(client) {
|
|
1413
|
+
this.client = client;
|
|
1414
|
+
}
|
|
1415
|
+
/** How many emails the batch has, by current status. */
|
|
1416
|
+
async get(batchId) {
|
|
1417
|
+
return this.client.request(`/batches/${encodeURIComponent(batchId)}`, { method: "GET" });
|
|
1418
|
+
}
|
|
1419
|
+
/**
|
|
1420
|
+
* Cancels every email in the batch that is still scheduled. Emails already
|
|
1421
|
+
* queued or sent are counted in `not_cancellable`. Safe to call again.
|
|
1422
|
+
*/
|
|
1423
|
+
async cancel(batchId) {
|
|
1424
|
+
return this.client.request(`/batches/${encodeURIComponent(batchId)}/cancel`, { method: "POST" });
|
|
1425
|
+
}
|
|
1426
|
+
};
|
|
1427
|
+
|
|
1410
1428
|
// src/dmarc.ts
|
|
1411
1429
|
var DmarcResource = class {
|
|
1412
1430
|
constructor(client) {
|
|
@@ -2158,6 +2176,7 @@ var _Groundmail = class _Groundmail {
|
|
|
2158
2176
|
}
|
|
2159
2177
|
this.domains = new DomainsResource(this);
|
|
2160
2178
|
this.emails = new EmailsResource(this);
|
|
2179
|
+
this.batches = new BatchesResource(this);
|
|
2161
2180
|
this.receivedEmails = new ReceivedEmailsResource(this);
|
|
2162
2181
|
this.events = new EventsResource(this);
|
|
2163
2182
|
this.automations = new AutomationsResource(this);
|
package/dist/clerk.d.ts
CHANGED
package/dist/clerk.js
CHANGED
|
@@ -135,6 +135,11 @@ type BatchSendOptions = {
|
|
|
135
135
|
idempotencyKey?: string;
|
|
136
136
|
};
|
|
137
137
|
type BatchSendEmailResult = {
|
|
138
|
+
/**
|
|
139
|
+
* Shared by every email this call accepted (`batch_…`). Pass it to
|
|
140
|
+
* `batches.get()` or `batches.cancel()`. Optional so older API responses still type-check.
|
|
141
|
+
*/
|
|
142
|
+
batch_id?: string;
|
|
138
143
|
data: Array<{
|
|
139
144
|
index: number;
|
|
140
145
|
id?: string;
|
|
@@ -149,6 +154,26 @@ type BatchSendEmailResult = {
|
|
|
149
154
|
};
|
|
150
155
|
}>;
|
|
151
156
|
};
|
|
157
|
+
/** `batches.get()`: a batch's emails by current status. */
|
|
158
|
+
type Batch = {
|
|
159
|
+
batch_id: string;
|
|
160
|
+
/** When the batch's first email was created (ISO 8601). */
|
|
161
|
+
created_at: string;
|
|
162
|
+
/** Emails in the batch. */
|
|
163
|
+
total: number;
|
|
164
|
+
/** Emails by status, e.g. `{ scheduled: 98, sent: 2 }`. Only statuses with an email appear. */
|
|
165
|
+
counts: Record<string, number>;
|
|
166
|
+
};
|
|
167
|
+
/** `batches.cancel()` result. */
|
|
168
|
+
type CancelBatchResult = {
|
|
169
|
+
batch_id: string;
|
|
170
|
+
/** Scheduled emails this call cancelled. */
|
|
171
|
+
cancelled: number;
|
|
172
|
+
/** Emails already cancelled before this call. */
|
|
173
|
+
already_cancelled: number;
|
|
174
|
+
/** Emails past `scheduled` (queued, sent, delivered, failed, …) that can no longer be cancelled. */
|
|
175
|
+
not_cancellable: number;
|
|
176
|
+
};
|
|
152
177
|
type UpdateEmailParams = {
|
|
153
178
|
scheduledAt?: string | Date;
|
|
154
179
|
scheduled_at?: string | Date;
|
|
@@ -211,6 +236,11 @@ type EmailListItem = {
|
|
|
211
236
|
/** Mail stream it went out on (each sends from its own IPs). */
|
|
212
237
|
stream?: MailStream;
|
|
213
238
|
tags: unknown;
|
|
239
|
+
/**
|
|
240
|
+
* The `emails.batch()` call that sent it (`batch_…`); null for a single send.
|
|
241
|
+
* Optional so older API responses still type-check.
|
|
242
|
+
*/
|
|
243
|
+
batch_id?: string | null;
|
|
214
244
|
scheduled_at: string | null;
|
|
215
245
|
cancelled_at: string | null;
|
|
216
246
|
created_at: string;
|
|
@@ -1760,6 +1790,22 @@ declare class AutomationsResource {
|
|
|
1760
1790
|
retryRun(id: string): Promise<AutomationRunResponse>;
|
|
1761
1791
|
}
|
|
1762
1792
|
|
|
1793
|
+
/**
|
|
1794
|
+
* Batches from `emails.batch()`: every email one call accepted shares the
|
|
1795
|
+
* result's `batch_id`. Read their status counts, or cancel the scheduled ones.
|
|
1796
|
+
*/
|
|
1797
|
+
declare class BatchesResource {
|
|
1798
|
+
private readonly client;
|
|
1799
|
+
constructor(client: Groundmail);
|
|
1800
|
+
/** How many emails the batch has, by current status. */
|
|
1801
|
+
get(batchId: string): Promise<Batch>;
|
|
1802
|
+
/**
|
|
1803
|
+
* Cancels every email in the batch that is still scheduled. Emails already
|
|
1804
|
+
* queued or sent are counted in `not_cancellable`. Safe to call again.
|
|
1805
|
+
*/
|
|
1806
|
+
cancel(batchId: string): Promise<CancelBatchResult>;
|
|
1807
|
+
}
|
|
1808
|
+
|
|
1763
1809
|
/** Status of one sending source in the DMARC reports. `unknown`: an unrecognised server failing DMARC (possible spoofing). */
|
|
1764
1810
|
type DmarcSourceStatus = 'passing' | 'failing' | 'unknown';
|
|
1765
1811
|
type DmarcSource = {
|
|
@@ -2241,6 +2287,8 @@ declare const DEFAULT_API_BASE_URL = "https://api.groundmail.dev";
|
|
|
2241
2287
|
declare class Groundmail {
|
|
2242
2288
|
readonly domains: DomainsResource;
|
|
2243
2289
|
readonly emails: EmailsResource;
|
|
2290
|
+
/** Batches from `emails.batch()`: status counts, and cancel the scheduled emails in one call. */
|
|
2291
|
+
readonly batches: BatchesResource;
|
|
2244
2292
|
readonly receivedEmails: ReceivedEmailsResource;
|
|
2245
2293
|
readonly events: EventsResource;
|
|
2246
2294
|
readonly automations: AutomationsResource;
|
|
@@ -2297,4 +2345,4 @@ declare function normalizeAccessToken(value: GroundmailAccessToken | null | unde
|
|
|
2297
2345
|
expiresAt: number | null;
|
|
2298
2346
|
};
|
|
2299
2347
|
|
|
2300
|
-
export { type
|
|
2348
|
+
export { type DeliverabilityBucket as $, type ApiErrorBody as A, type Batch as B, type BrandLogo as C, type DnsRecord as D, type BrandSettings as E, type CancelBatchResult as F, Groundmail as G, type CategoryOptOut as H, type CategoryOptOutCategory as I, type CategoryUnsubscribedErrorDetails as J, type ConnectTwilioParams as K, type ContactWebhookEventPayload as L, type CreateApiKeyParams as M, type CreateApiKeyResult as N, type CreateAutomationParams as O, type CreateDomainParams as P, type CreateDomainResult as Q, type CreateMigrationParams as R, type SendEmailResult as S, type CreateSenderParams as T, type CreateSuppressionParams as U, type CreateTemplateParams as V, type CreateTenantParams as W, type CreateWebhookParams as X, DEFAULT_API_BASE_URL as Y, type DailyRampLimitErrorDetails as Z, type DeleteTenantResult as _, type ApiErrorCode as a, type ListTestInboxEmailsResult as a$, type DeliverabilityDomainInsight as a0, type DeliverabilityInsightsResult as a1, type DeliverabilityMailServerRelay as a2, type DeliverabilityWindow as a3, type DmarcDailyPoint as a4, type DmarcMonitoring as a5, type DmarcMonitoringDisabled as a6, type DmarcReadiness as a7, type DmarcReadinessVerdict as a8, type DmarcSource as a9, type GroundmailTokenProvider as aA, type HeldBackErrorDetails as aB, type HeldBackReason as aC, type HeldBackRecipient as aD, type InReplyToEmail as aE, type ListApiKeysParams as aF, type ListApiKeysResult as aG, type ListAutomationRunsParams as aH, type ListAutomationRunsResult as aI, type ListAutomationsResult as aJ, type ListCategoryOptOutsParams as aK, type ListCategoryOptOutsResult as aL, type ListDomainsParams as aM, type ListDomainsResult as aN, type ListEmailsParams as aO, type ListEmailsResult as aP, type ListReceivedEmailsParams as aQ, type ListReceivedEmailsResult as aR, type ListSendersResult as aS, type ListSuppressionsParams as aT, type ListSuppressionsResult as aU, type ListTemplatesParams as aV, type ListTemplatesResult as aW, type ListTenantDomainsResult as aX, type ListTenantsParams as aY, type ListTenantsResult as aZ, type ListTestInboxEmailsParams as a_, type DmarcSourceStatus as aa, type DmarcStatus as ab, type DnsProviderName as ac, type Domain as ad, type DomainBimiAnalysis as ae, type DomainBlocklistListing as af, type DomainBlocklistStatus as ag, type DomainBlocklists as ah, type DomainDetailResult as ai, type DomainDmarcAnalysis as aj, type DomainDnsAnalysis as ak, type DomainStatus as al, type DomainTlsMode as am, type DomainTrackingDns as an, type DomainTrackingStatus as ao, type EmailDelivery as ap, type EmailListItem as aq, type EmailWebhookEventPayload as ar, type EmailWebhookEventType as as, type EnableDmarcParams as at, type EnableDmarcResult as au, type EnrollmentSkip as av, type EventRecord as aw, type GroundmailAccessToken as ax, type GroundmailOptions as ay, type GroundmailTokenOptions as az, type ApiKey as b, type ValidationVerdict as b$, type MailServerSigningStatus as b0, type MailStream as b1, type Migration as b2, type MigrationDnsChange as b3, type MigrationDnsPlan as b4, type MigrationDomainItem as b5, type MigrationItemStatus as b6, type MigrationProvider as b7, type MigrationResource as b8, type MigrationSummary as b9, type TenantStats as bA, type TenantStatsResult as bB, type TenantStatus as bC, type TenantStreamPolicy as bD, type TestEmailWebhookParams as bE, type TestEmailWebhookResult as bF, type TestInbox as bG, type TestInboxAddressOptions as bH, type TestInboxEmail as bI, type TestInboxEmailDetail as bJ, type TestInboxHeader as bK, TestInboxResource as bL, type TestInboxUsage as bM, type TriggerEventParams as bN, type TriggerEventResult as bO, type TwilioIntegrationResponse as bP, type TwilioIntegrationStatus as bQ, type UpdateAutomationParams as bR, type UpdateBrandParams as bS, type UpdateDomainParams as bT, type UpdateEmailParams as bU, type UpdateSenderParams as bV, type UpdateTemplateParams as bW, type UpdateTenantParams as bX, type UpdateWebhookParams as bY, type ValidateEmailResult as bZ, type ValidationReason as b_, type MigrationTemplateItem as ba, type MigrationTotals as bb, type MigrationWebhookItem as bc, type ReceivedEmail as bd, type ReceivedEmailAttachment as be, type ReceivedEmailAttachmentMeta as bf, type RemoteApplyDnsCredentials as bg, type RemoveCategoryOptOutOptions as bh, type RunMigrationOptions as bi, type SendEmailParams as bj, type Sender as bk, type SesMigrationParams as bl, type StreamDeliverability as bm, type SuppressedErrorDetails as bn, type Suppression as bo, TEST_INBOX_WAIT_DEFAULT_MS as bp, TEST_INBOX_WAIT_MAX_SECONDS as bq, type Template as br, type TemplateFormat as bs, type TemplateLintWarning as bt, type TemplateStarter as bu, type TemplateStatus as bv, type TemplateVersion as bw, type Tenant as bx, type TenantPauseSource as by, type TenantRamp as bz, type ApiKeyMigrationParams as c, type VerifyDomainResult as c0, type WaitForTestEmailParams as c1, type WebhookEmailTag as c2, type WebhookEndpoint as c3, type WebhookEndpointWithSecret as c4, type WebhookEventType as c5, mergeMigrations as c6, normalizeAccessToken as c7, type ApiKeyScope as d, type ApplyDnsParams as e, type ApplyDnsRecordResult as f, type ApplyDnsResult as g, type Asset as h, type Automation as i, type AutomationBranchQuestion as j, type AutomationBranchStep as k, type AutomationInlineEmail as l, type AutomationResult as m, type AutomationRun as n, type AutomationRunResponse as o, type AutomationRunStatus as p, type AutomationRunStep as q, type AutomationRunStepStatus as r, type AutomationSendEmailStep as s, type AutomationStatus as t, type AutomationStep as u, type AutomationTemplateEmail as v, type AutomationTrigger as w, type BatchSendEmailResult as x, type BounceType as y, type Brand as z };
|
package/dist/index.d.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { A as ApiErrorBody, D as DnsRecord } from './client-
|
|
2
|
-
export { a as ApiErrorCode, b as ApiKey, c as ApiKeyMigrationParams, d as ApiKeyScope, e as ApplyDnsParams, f as ApplyDnsRecordResult, g as ApplyDnsResult, h as Asset, i as Automation, j as AutomationBranchQuestion, k as AutomationBranchStep, l as AutomationInlineEmail, m as AutomationResult, n as AutomationRun, o as AutomationRunResponse, p as AutomationRunStatus, q as AutomationRunStep, r as AutomationRunStepStatus, s as AutomationSendEmailStep, t as AutomationStatus, u as AutomationStep, v as AutomationTemplateEmail, w as AutomationTrigger, B as
|
|
1
|
+
import { A as ApiErrorBody, D as DnsRecord } from './client-gRhoYpOK.js';
|
|
2
|
+
export { a as ApiErrorCode, b as ApiKey, c as ApiKeyMigrationParams, d as ApiKeyScope, e as ApplyDnsParams, f as ApplyDnsRecordResult, g as ApplyDnsResult, h as Asset, i as Automation, j as AutomationBranchQuestion, k as AutomationBranchStep, l as AutomationInlineEmail, m as AutomationResult, n as AutomationRun, o as AutomationRunResponse, p as AutomationRunStatus, q as AutomationRunStep, r as AutomationRunStepStatus, s as AutomationSendEmailStep, t as AutomationStatus, u as AutomationStep, v as AutomationTemplateEmail, w as AutomationTrigger, B as Batch, x as BatchSendEmailResult, y as BounceType, z as Brand, C as BrandLogo, E as BrandSettings, F as CancelBatchResult, H as CategoryOptOut, I as CategoryOptOutCategory, J as CategoryUnsubscribedErrorDetails, K as ConnectTwilioParams, L as ContactWebhookEventPayload, M as CreateApiKeyParams, N as CreateApiKeyResult, O as CreateAutomationParams, P as CreateDomainParams, Q as CreateDomainResult, R as CreateMigrationParams, T as CreateSenderParams, U as CreateSuppressionParams, V as CreateTemplateParams, W as CreateTenantParams, X as CreateWebhookParams, Y as DEFAULT_API_BASE_URL, Z as DailyRampLimitErrorDetails, _ as DeleteTenantResult, $ as DeliverabilityBucket, a0 as DeliverabilityDomainInsight, a1 as DeliverabilityInsightsResult, a2 as DeliverabilityMailServerRelay, a3 as DeliverabilityWindow, a4 as DmarcDailyPoint, a5 as DmarcMonitoring, a6 as DmarcMonitoringDisabled, a7 as DmarcReadiness, a8 as DmarcReadinessVerdict, a9 as DmarcSource, aa as DmarcSourceStatus, ab as DmarcStatus, ac as DnsProviderName, ad as Domain, ae as DomainBimiAnalysis, af as DomainBlocklistListing, ag as DomainBlocklistStatus, ah as DomainBlocklists, ai as DomainDetailResult, aj as DomainDmarcAnalysis, ak as DomainDnsAnalysis, al as DomainStatus, am as DomainTlsMode, an as DomainTrackingDns, ao as DomainTrackingStatus, ap as EmailDelivery, aq as EmailListItem, ar as EmailWebhookEventPayload, as as EmailWebhookEventType, at as EnableDmarcParams, au as EnableDmarcResult, av as EnrollmentSkip, aw as EventRecord, G as Groundmail, ax as GroundmailAccessToken, ay as GroundmailOptions, az as GroundmailTokenOptions, aA as GroundmailTokenProvider, aB as HeldBackErrorDetails, aC as HeldBackReason, aD as HeldBackRecipient, aE as InReplyToEmail, aF as ListApiKeysParams, aG as ListApiKeysResult, aH as ListAutomationRunsParams, aI as ListAutomationRunsResult, aJ as ListAutomationsResult, aK as ListCategoryOptOutsParams, aL as ListCategoryOptOutsResult, aM as ListDomainsParams, aN as ListDomainsResult, aO as ListEmailsParams, aP as ListEmailsResult, aQ as ListReceivedEmailsParams, aR as ListReceivedEmailsResult, aS as ListSendersResult, aT as ListSuppressionsParams, aU as ListSuppressionsResult, aV as ListTemplatesParams, aW as ListTemplatesResult, aX as ListTenantDomainsResult, aY as ListTenantsParams, aZ as ListTenantsResult, a_ as ListTestInboxEmailsParams, a$ as ListTestInboxEmailsResult, b0 as MailServerSigningStatus, b1 as MailStream, b2 as Migration, b3 as MigrationDnsChange, b4 as MigrationDnsPlan, b5 as MigrationDomainItem, b6 as MigrationItemStatus, b7 as MigrationProvider, b8 as MigrationResource, b9 as MigrationSummary, ba as MigrationTemplateItem, bb as MigrationTotals, bc as MigrationWebhookItem, bd as ReceivedEmail, be as ReceivedEmailAttachment, bf as ReceivedEmailAttachmentMeta, bg as RemoteApplyDnsCredentials, bh as RemoveCategoryOptOutOptions, bi as RunMigrationOptions, bj as SendEmailParams, S as SendEmailResult, bk as Sender, bl as SesMigrationParams, bm as StreamDeliverability, bn as SuppressedErrorDetails, bo as Suppression, bp as TEST_INBOX_WAIT_DEFAULT_MS, bq as TEST_INBOX_WAIT_MAX_SECONDS, br as Template, bs as TemplateFormat, bt as TemplateLintWarning, bu as TemplateStarter, bv as TemplateStatus, bw as TemplateVersion, bx as Tenant, by as TenantPauseSource, bz as TenantRamp, bA as TenantStats, bB as TenantStatsResult, bC as TenantStatus, bD as TenantStreamPolicy, bE as TestEmailWebhookParams, bF as TestEmailWebhookResult, bG as TestInbox, bH as TestInboxAddressOptions, bI as TestInboxEmail, bJ as TestInboxEmailDetail, bK as TestInboxHeader, bL as TestInboxResource, bM as TestInboxUsage, bN as TriggerEventParams, bO as TriggerEventResult, bP as TwilioIntegrationResponse, bQ as TwilioIntegrationStatus, bR as UpdateAutomationParams, bS as UpdateBrandParams, bT as UpdateDomainParams, bU as UpdateEmailParams, bV as UpdateSenderParams, bW as UpdateTemplateParams, bX as UpdateTenantParams, bY as UpdateWebhookParams, bZ as ValidateEmailResult, b_ as ValidationReason, b$ as ValidationVerdict, c0 as VerifyDomainResult, c1 as WaitForTestEmailParams, c2 as WebhookEmailTag, c3 as WebhookEndpoint, c4 as WebhookEndpointWithSecret, c5 as WebhookEventType, c6 as mergeMigrations, c7 as normalizeAccessToken } from './client-gRhoYpOK.js';
|
|
3
3
|
|
|
4
4
|
type GroundmailErrorOptions = {
|
|
5
5
|
code?: string;
|
package/dist/index.js
CHANGED
package/dist/payload.d.ts
CHANGED
package/dist/payload.js
CHANGED