groundmail 0.25.1 → 0.26.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 +19 -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-NQWM7F3N.js → chunk-E6G7G2PM.js} +95 -0
- package/dist/clerk.d.ts +1 -1
- package/dist/clerk.js +1 -1
- package/dist/{client-DJB1l4zk.d.ts → client-DAetJZCf.d.ts} +124 -2
- package/dist/index.d.ts +2 -2
- package/dist/index.js +7 -1
- package/dist/payload.d.ts +1 -1
- package/dist/payload.js +1 -1
- package/package.json +2 -2
package/README.md
CHANGED
|
@@ -60,6 +60,25 @@ await tx.emails.send({
|
|
|
60
60
|
Outcomes: `delivered`, `bounce`, `block`, `complaint`, `suppressed`, `delayed`. Details:
|
|
61
61
|
https://docs.groundmail.dev/testing
|
|
62
62
|
|
|
63
|
+
## Email testing
|
|
64
|
+
|
|
65
|
+
Your team has a test domain (`<team>.test.groundmail.dev`). Mail sent to any address there is
|
|
66
|
+
caught in your test inbox and never delivered, whichever provider your app sends with. Give each
|
|
67
|
+
test its own address, then wait for the email and read the extracted code and links:
|
|
68
|
+
|
|
69
|
+
```ts
|
|
70
|
+
const to = await tx.testInbox.address({ prefix: 'signup' }) // signup-k3m9x2pq@acme.test.groundmail.dev
|
|
71
|
+
// …your app sends the signup email to `to`…
|
|
72
|
+
const email = await tx.testInbox.waitFor({ to, timeout: 30_000 })
|
|
73
|
+
email.code // '482913'
|
|
74
|
+
email.links // ['https://app.example.com/verify?token=…']
|
|
75
|
+
```
|
|
76
|
+
|
|
77
|
+
`waitFor` throws a `GroundmailError` with status 408 and code `timeout` when nothing arrives in
|
|
78
|
+
time. Also: `tx.testInbox.list({ to, since })`, `tx.testInbox.get(id)` and `tx.testInbox.info()`
|
|
79
|
+
(domain and monthly usage). Emails sent with a `gm_test_` key land here too. Details:
|
|
80
|
+
https://docs.groundmail.dev/email-testing
|
|
81
|
+
|
|
63
82
|
## Tenants
|
|
64
83
|
|
|
65
84
|
If you send email for your own customers, create one tenant per customer. Each tenant has its
|
package/dist/authjs.d.ts
CHANGED
package/dist/authjs.js
CHANGED
package/dist/better-auth.d.ts
CHANGED
package/dist/better-auth.js
CHANGED
|
@@ -802,6 +802,97 @@ var MigrationsResource = class {
|
|
|
802
802
|
}
|
|
803
803
|
};
|
|
804
804
|
|
|
805
|
+
// src/test-inbox.ts
|
|
806
|
+
var TEST_INBOX_WAIT_MAX_SECONDS = 60;
|
|
807
|
+
var TEST_INBOX_WAIT_DEFAULT_MS = 3e4;
|
|
808
|
+
var ALPHABET = "abcdefghijkmnpqrstuvwxyz23456789";
|
|
809
|
+
function randomSuffix(length = 8) {
|
|
810
|
+
const bytes = new Uint8Array(length);
|
|
811
|
+
const cryptoImpl = globalThis.crypto;
|
|
812
|
+
if (cryptoImpl?.getRandomValues) cryptoImpl.getRandomValues(bytes);
|
|
813
|
+
else for (let i = 0; i < length; i++) bytes[i] = Math.floor(Math.random() * 256);
|
|
814
|
+
let out = "";
|
|
815
|
+
for (const byte of bytes) out += ALPHABET[byte % ALPHABET.length];
|
|
816
|
+
return out;
|
|
817
|
+
}
|
|
818
|
+
function cleanPrefix(prefix) {
|
|
819
|
+
const cleaned = (prefix ?? "").trim().toLowerCase().replace(/[^a-z0-9._+-]+/g, "-").replace(/^[-.]+|[-.]+$/g, "").slice(0, 48);
|
|
820
|
+
return cleaned || "run";
|
|
821
|
+
}
|
|
822
|
+
function isoTime(value) {
|
|
823
|
+
if (value === void 0 || value === null || value === "") return null;
|
|
824
|
+
return value instanceof Date ? value.toISOString() : String(value);
|
|
825
|
+
}
|
|
826
|
+
var TestInboxResource = class {
|
|
827
|
+
constructor(client) {
|
|
828
|
+
this.client = client;
|
|
829
|
+
this.domain = null;
|
|
830
|
+
}
|
|
831
|
+
/** The team's test domain, an example address and this month's usage. */
|
|
832
|
+
async info() {
|
|
833
|
+
const { test_inbox } = await this.client.request("/test-inbox", { method: "GET" });
|
|
834
|
+
this.domain = test_inbox.domain;
|
|
835
|
+
return test_inbox;
|
|
836
|
+
}
|
|
837
|
+
/** A fresh unique address on your test domain: `run-k3m9x2pq@acme.test.groundmail.dev`. */
|
|
838
|
+
async address(options = {}) {
|
|
839
|
+
const domain = this.domain ?? (await this.info()).domain;
|
|
840
|
+
return `${cleanPrefix(options.prefix)}-${randomSuffix()}@${domain}`;
|
|
841
|
+
}
|
|
842
|
+
/** Caught emails, newest first. */
|
|
843
|
+
async list(params = {}) {
|
|
844
|
+
const search = new URLSearchParams();
|
|
845
|
+
if (params.to) search.set("to", params.to);
|
|
846
|
+
const since = isoTime(params.since);
|
|
847
|
+
if (since) search.set("since", since);
|
|
848
|
+
if (params.limit != null) search.set("limit", String(params.limit));
|
|
849
|
+
if (params.cursor) search.set("cursor", params.cursor);
|
|
850
|
+
const query = search.toString();
|
|
851
|
+
return this.client.request(`/test-inbox/emails${query ? `?${query}` : ""}`, { method: "GET" });
|
|
852
|
+
}
|
|
853
|
+
/** One caught email with bodies, headers and source. */
|
|
854
|
+
async get(id) {
|
|
855
|
+
const { email } = await this.client.request(
|
|
856
|
+
`/test-inbox/emails/${encodeURIComponent(id)}`,
|
|
857
|
+
{ method: "GET" }
|
|
858
|
+
);
|
|
859
|
+
return email;
|
|
860
|
+
}
|
|
861
|
+
/**
|
|
862
|
+
* Wait for an email to `to` and return it. An email that already arrived is
|
|
863
|
+
* returned at once. Waits up to `timeout` ms (default 30s), then throws a
|
|
864
|
+
* `GroundmailError` with status 408 and code `timeout`.
|
|
865
|
+
*/
|
|
866
|
+
async waitFor(params) {
|
|
867
|
+
if (!params?.to) throw new Error("testInbox.waitFor: `to` is required");
|
|
868
|
+
const totalMs = params.timeout ?? TEST_INBOX_WAIT_DEFAULT_MS;
|
|
869
|
+
const deadline = Date.now() + totalMs;
|
|
870
|
+
const since = isoTime(params.since);
|
|
871
|
+
for (; ; ) {
|
|
872
|
+
const remainingMs = Math.max(0, deadline - Date.now());
|
|
873
|
+
const seconds = Math.min(TEST_INBOX_WAIT_MAX_SECONDS, Math.ceil(remainingMs / 1e3));
|
|
874
|
+
const search = new URLSearchParams({ to: params.to, timeout: String(seconds) });
|
|
875
|
+
if (since) search.set("since", since);
|
|
876
|
+
try {
|
|
877
|
+
const { email } = await this.client.request(`/test-inbox/wait?${search}`, {
|
|
878
|
+
method: "GET"
|
|
879
|
+
});
|
|
880
|
+
return email;
|
|
881
|
+
} catch (error) {
|
|
882
|
+
const timedOut = error instanceof GroundmailError && error.status === 408;
|
|
883
|
+
if (!timedOut) throw error;
|
|
884
|
+
if (Date.now() >= deadline || seconds === 0) {
|
|
885
|
+
throw new GroundmailError(`No email to ${params.to} arrived within ${Math.round(totalMs / 1e3)} seconds`, 408, error.details, {
|
|
886
|
+
code: "timeout",
|
|
887
|
+
hint: error.hint,
|
|
888
|
+
docsUrl: error.docsUrl
|
|
889
|
+
});
|
|
890
|
+
}
|
|
891
|
+
}
|
|
892
|
+
}
|
|
893
|
+
}
|
|
894
|
+
};
|
|
895
|
+
|
|
805
896
|
// src/webhooks/verify.ts
|
|
806
897
|
import { createHmac, timingSafeEqual } from "crypto";
|
|
807
898
|
function signWebhookPayload(secret, payload, timestamp) {
|
|
@@ -1592,6 +1683,7 @@ var _Groundmail = class _Groundmail {
|
|
|
1592
1683
|
this.tenants = new TenantsResource(this);
|
|
1593
1684
|
this.migrations = new MigrationsResource(this);
|
|
1594
1685
|
this.dmarc = new DmarcResource(this);
|
|
1686
|
+
this.testInbox = new TestInboxResource(this);
|
|
1595
1687
|
}
|
|
1596
1688
|
/**
|
|
1597
1689
|
* Check one address with Groundmail validation before you accept it (for
|
|
@@ -1687,6 +1779,9 @@ export {
|
|
|
1687
1779
|
mergeSpfInclude,
|
|
1688
1780
|
applyDnsRecords,
|
|
1689
1781
|
mergeMigrations,
|
|
1782
|
+
TEST_INBOX_WAIT_MAX_SECONDS,
|
|
1783
|
+
TEST_INBOX_WAIT_DEFAULT_MS,
|
|
1784
|
+
TestInboxResource,
|
|
1690
1785
|
signWebhookPayload,
|
|
1691
1786
|
buildSignatureHeader,
|
|
1692
1787
|
verifyWebhookSignature,
|
package/dist/clerk.d.ts
CHANGED
package/dist/clerk.js
CHANGED
|
@@ -4,7 +4,9 @@ type ApiErrorCode = 'validation_error' | 'unauthorized' | 'forbidden' | 'not_fou
|
|
|
4
4
|
/** 403: the request names a tenant, but tenants are not enabled for this account (Scale and Dedicated plans). */
|
|
5
5
|
| 'tenants_not_enabled'
|
|
6
6
|
/** 403: the send uses `category: 'newsletter'`, but newsletter sending isn't enabled on this account (approved accounts only). */
|
|
7
|
-
| 'newsletter_not_enabled' | 'domain_limit' | 'idempotency_conflict' | 'rate_limited'
|
|
7
|
+
| 'newsletter_not_enabled' | 'domain_limit' | 'idempotency_conflict' | 'rate_limited'
|
|
8
|
+
/** 408: a long-poll ended before anything matched (`testInbox.waitFor`). Safe to call again. */
|
|
9
|
+
| 'timeout' | 'upstream_error' | 'not_configured' | 'internal_error';
|
|
8
10
|
type SendEmailParams = {
|
|
9
11
|
from: string | {
|
|
10
12
|
email: string;
|
|
@@ -1324,6 +1326,89 @@ type TenantStatsResult = {
|
|
|
1324
1326
|
type ListTenantDomainsResult = {
|
|
1325
1327
|
data: Domain[];
|
|
1326
1328
|
};
|
|
1329
|
+
/** Monthly test email usage for the team. */
|
|
1330
|
+
type TestInboxUsage = {
|
|
1331
|
+
/** `YYYY-MM`, UTC. */
|
|
1332
|
+
month: string;
|
|
1333
|
+
received: number;
|
|
1334
|
+
/** Refused this month because the limit was reached. */
|
|
1335
|
+
rejected: number;
|
|
1336
|
+
/** 100 free, 5,000 with the email testing add-on. */
|
|
1337
|
+
included: number;
|
|
1338
|
+
/** True with the add-on: mail past `included` is accepted and billed per 1,000. */
|
|
1339
|
+
overage: boolean;
|
|
1340
|
+
resets_at: string;
|
|
1341
|
+
};
|
|
1342
|
+
/** The team's test domain: mail to any address at it is caught, never delivered. */
|
|
1343
|
+
type TestInbox = {
|
|
1344
|
+
object: 'test_inbox';
|
|
1345
|
+
/** e.g. `acme.test.groundmail.dev` */
|
|
1346
|
+
domain: string;
|
|
1347
|
+
/** An example fresh address. Use a new one per test. */
|
|
1348
|
+
address: string;
|
|
1349
|
+
addon: {
|
|
1350
|
+
active: boolean;
|
|
1351
|
+
status: string | null;
|
|
1352
|
+
};
|
|
1353
|
+
usage: TestInboxUsage;
|
|
1354
|
+
retention_days: number;
|
|
1355
|
+
};
|
|
1356
|
+
/** A caught test email (list item). */
|
|
1357
|
+
type TestInboxEmail = {
|
|
1358
|
+
object: 'test_inbox_email';
|
|
1359
|
+
/** `tie_…` */
|
|
1360
|
+
id: string;
|
|
1361
|
+
/** `inbound`: received at your test domain. `test_key`: sent with a `gm_test_` key. */
|
|
1362
|
+
source: 'inbound' | 'test_key';
|
|
1363
|
+
/** With `test_key`: the sent email's id. */
|
|
1364
|
+
email_id: string | null;
|
|
1365
|
+
from: string;
|
|
1366
|
+
to: string[];
|
|
1367
|
+
cc: string[];
|
|
1368
|
+
subject: string;
|
|
1369
|
+
/** The one-time code (4 to 8 digits) found in the email, or null. */
|
|
1370
|
+
code: string | null;
|
|
1371
|
+
/** http(s) links in the email, in order. */
|
|
1372
|
+
links: string[];
|
|
1373
|
+
received_at: string;
|
|
1374
|
+
expires_at: string;
|
|
1375
|
+
};
|
|
1376
|
+
type TestInboxHeader = {
|
|
1377
|
+
name: string;
|
|
1378
|
+
value: string;
|
|
1379
|
+
};
|
|
1380
|
+
/** A caught test email with bodies, headers and source. */
|
|
1381
|
+
type TestInboxEmailDetail = TestInboxEmail & {
|
|
1382
|
+
text_body: string | null;
|
|
1383
|
+
html_body: string | null;
|
|
1384
|
+
headers: TestInboxHeader[];
|
|
1385
|
+
raw_source: string | null;
|
|
1386
|
+
};
|
|
1387
|
+
type ListTestInboxEmailsParams = {
|
|
1388
|
+
/** Only emails to this exact address. */
|
|
1389
|
+
to?: string;
|
|
1390
|
+
/** Only emails received at or after this time. */
|
|
1391
|
+
since?: Date | string;
|
|
1392
|
+
limit?: number;
|
|
1393
|
+
cursor?: string;
|
|
1394
|
+
};
|
|
1395
|
+
type ListTestInboxEmailsResult = {
|
|
1396
|
+
emails: TestInboxEmail[];
|
|
1397
|
+
has_more: boolean;
|
|
1398
|
+
next_cursor: string | null;
|
|
1399
|
+
};
|
|
1400
|
+
type TestInboxAddressOptions = {
|
|
1401
|
+
/** Start of the local part, e.g. `signup` → `signup-k3m9x2pq@…`. Default `run`. */
|
|
1402
|
+
prefix?: string;
|
|
1403
|
+
};
|
|
1404
|
+
type WaitForTestEmailParams = {
|
|
1405
|
+
/** The exact address your app sent to. */
|
|
1406
|
+
to: string;
|
|
1407
|
+
/** Total time to wait in milliseconds. Default 30,000. */
|
|
1408
|
+
timeout?: number;
|
|
1409
|
+
/** Only emails received at or after this time. */
|
|
1410
|
+
since?: Date | string;
|
|
1411
|
+
};
|
|
1327
1412
|
|
|
1328
1413
|
declare class AutomationsResource {
|
|
1329
1414
|
private readonly client;
|
|
@@ -1712,6 +1797,41 @@ declare class TenantDomainsResource {
|
|
|
1712
1797
|
}>;
|
|
1713
1798
|
}
|
|
1714
1799
|
|
|
1800
|
+
/** Longest single wait the API holds open, in seconds. */
|
|
1801
|
+
declare const TEST_INBOX_WAIT_MAX_SECONDS = 60;
|
|
1802
|
+
declare const TEST_INBOX_WAIT_DEFAULT_MS = 30000;
|
|
1803
|
+
/**
|
|
1804
|
+
* Hosted test inbox: your team's test domain catches mail from any email
|
|
1805
|
+
* provider and never delivers it. Give each test its own address, then wait for
|
|
1806
|
+
* the email and read its `code` and `links`:
|
|
1807
|
+
*
|
|
1808
|
+
* ```ts
|
|
1809
|
+
* const to = await groundmail.testInbox.address({ prefix: 'signup' })
|
|
1810
|
+
* await page.fill('#email', to) // your app sends with any provider
|
|
1811
|
+
* const email = await groundmail.testInbox.waitFor({ to })
|
|
1812
|
+
* await page.fill('#code', email.code!)
|
|
1813
|
+
* ```
|
|
1814
|
+
*/
|
|
1815
|
+
declare class TestInboxResource {
|
|
1816
|
+
private readonly client;
|
|
1817
|
+
private domain;
|
|
1818
|
+
constructor(client: Groundmail);
|
|
1819
|
+
/** The team's test domain, an example address and this month's usage. */
|
|
1820
|
+
info(): Promise<TestInbox>;
|
|
1821
|
+
/** A fresh unique address on your test domain: `run-k3m9x2pq@acme.test.groundmail.dev`. */
|
|
1822
|
+
address(options?: TestInboxAddressOptions): Promise<string>;
|
|
1823
|
+
/** Caught emails, newest first. */
|
|
1824
|
+
list(params?: ListTestInboxEmailsParams): Promise<ListTestInboxEmailsResult>;
|
|
1825
|
+
/** One caught email with bodies, headers and source. */
|
|
1826
|
+
get(id: string): Promise<TestInboxEmailDetail>;
|
|
1827
|
+
/**
|
|
1828
|
+
* Wait for an email to `to` and return it. An email that already arrived is
|
|
1829
|
+
* returned at once. Waits up to `timeout` ms (default 30s), then throws a
|
|
1830
|
+
* `GroundmailError` with status 408 and code `timeout`.
|
|
1831
|
+
*/
|
|
1832
|
+
waitFor(params: WaitForTestEmailParams): Promise<TestInboxEmailDetail>;
|
|
1833
|
+
}
|
|
1834
|
+
|
|
1715
1835
|
declare class WebhooksResource {
|
|
1716
1836
|
private readonly client;
|
|
1717
1837
|
constructor(client: Groundmail);
|
|
@@ -1756,6 +1876,8 @@ declare class Groundmail {
|
|
|
1756
1876
|
readonly migrations: MigrationsResource;
|
|
1757
1877
|
/** DMARC monitoring per domain: report address, sources, pass rates and readiness. */
|
|
1758
1878
|
readonly dmarc: DmarcResource;
|
|
1879
|
+
/** Hosted test inbox: catch test mail from any provider and wait for it in your tests. */
|
|
1880
|
+
readonly testInbox: TestInboxResource;
|
|
1759
1881
|
private readonly apiKey;
|
|
1760
1882
|
private readonly options;
|
|
1761
1883
|
private readonly getToken;
|
|
@@ -1791,4 +1913,4 @@ declare function normalizeAccessToken(value: GroundmailAccessToken | null | unde
|
|
|
1791
1913
|
expiresAt: number | null;
|
|
1792
1914
|
};
|
|
1793
1915
|
|
|
1794
|
-
export { type DmarcStatus as $, type ApiErrorBody as A, type BatchSendEmailResult as B, type CategoryOptOut as C, type DnsRecord as D, type CreateDomainResult as E, type CreateMigrationParams as F, Groundmail as G, type CreateSuppressionParams as H, type CreateTemplateParams as I, type CreateTenantParams as J, type CreateWebhookParams as K, DEFAULT_API_BASE_URL as L, type DailyRampLimitErrorDetails as M, type DeleteTenantResult as N, type DeliverabilityBucket as O, type DeliverabilityDomainInsight as P, type DeliverabilityInsightsResult as Q, type DeliverabilityMailServerRelay as R, type SendEmailResult as S, type DeliverabilityWindow as T, type DmarcDailyPoint as U, type DmarcMonitoring as V, type DmarcMonitoringDisabled as W, type DmarcReadiness as X, type DmarcReadinessVerdict as Y, type DmarcSource as Z, type DmarcSourceStatus as _, type ApiErrorCode as a, type
|
|
1916
|
+
export { type DmarcStatus as $, type ApiErrorBody as A, type BatchSendEmailResult as B, type CategoryOptOut as C, type DnsRecord as D, type CreateDomainResult as E, type CreateMigrationParams as F, Groundmail as G, type CreateSuppressionParams as H, type CreateTemplateParams as I, type CreateTenantParams as J, type CreateWebhookParams as K, DEFAULT_API_BASE_URL as L, type DailyRampLimitErrorDetails as M, type DeleteTenantResult as N, type DeliverabilityBucket as O, type DeliverabilityDomainInsight as P, type DeliverabilityInsightsResult as Q, type DeliverabilityMailServerRelay as R, type SendEmailResult as S, type DeliverabilityWindow as T, type DmarcDailyPoint as U, type DmarcMonitoring as V, type DmarcMonitoringDisabled as W, type DmarcReadiness as X, type DmarcReadinessVerdict as Y, type DmarcSource as Z, type DmarcSourceStatus as _, type ApiErrorCode as a, type RemoveCategoryOptOutOptions as a$, type DnsProviderName as a0, type Domain as a1, type DomainBimiAnalysis as a2, type DomainDetailResult as a3, type DomainDmarcAnalysis as a4, type DomainDnsAnalysis as a5, type DomainStatus as a6, type DomainTlsMode as a7, type DomainTrackingDns as a8, type DomainTrackingStatus as a9, type ListReceivedEmailsResult as aA, type ListSuppressionsParams as aB, type ListSuppressionsResult as aC, type ListTemplatesParams as aD, type ListTemplatesResult as aE, type ListTenantDomainsResult as aF, type ListTenantsParams as aG, type ListTenantsResult as aH, type ListTestInboxEmailsParams as aI, type ListTestInboxEmailsResult as aJ, type MailServerSigningStatus as aK, type MailStream as aL, type Migration as aM, type MigrationDnsChange as aN, type MigrationDnsPlan as aO, type MigrationDomainItem as aP, type MigrationItemStatus as aQ, type MigrationProvider as aR, type MigrationResource as aS, type MigrationSummary as aT, type MigrationTemplateItem as aU, type MigrationTotals as aV, type MigrationWebhookItem as aW, type ReceivedEmail as aX, type ReceivedEmailAttachment as aY, type ReceivedEmailAttachmentMeta as aZ, type RemoteApplyDnsCredentials as a_, type EmailListItem as aa, type EmailWebhookEventPayload as ab, type EmailWebhookEventType as ac, type EnableDmarcParams as ad, type EnableDmarcResult as ae, type EnrollmentSkip as af, type EventRecord as ag, type GroundmailAccessToken as ah, type GroundmailOptions as ai, type GroundmailTokenOptions as aj, type GroundmailTokenProvider as ak, type HeldBackErrorDetails as al, type HeldBackReason as am, type HeldBackRecipient as an, type ListApiKeysParams as ao, type ListApiKeysResult as ap, type ListAutomationRunsParams as aq, type ListAutomationRunsResult as ar, type ListAutomationsResult as as, type ListCategoryOptOutsParams as at, type ListCategoryOptOutsResult as au, type ListDomainsParams as av, type ListDomainsResult as aw, type ListEmailsParams as ax, type ListEmailsResult as ay, type ListReceivedEmailsParams as az, type ApiKey as b, type RunMigrationOptions as b0, type SendEmailParams as b1, type StreamDeliverability as b2, type SuppressedErrorDetails as b3, type Suppression as b4, TEST_INBOX_WAIT_DEFAULT_MS as b5, TEST_INBOX_WAIT_MAX_SECONDS as b6, type Template as b7, type TemplateFormat as b8, type TemplateLintWarning as b9, type UpdateTemplateParams as bA, type UpdateTenantParams as bB, type UpdateWebhookParams as bC, type ValidateEmailResult as bD, type ValidationReason as bE, type ValidationVerdict as bF, type VerifyDomainResult as bG, type WaitForTestEmailParams as bH, type WebhookEmailTag as bI, type WebhookEndpoint as bJ, type WebhookEndpointWithSecret as bK, type WebhookEventType as bL, mergeMigrations as bM, normalizeAccessToken as bN, type TemplateStarter as ba, type TemplateStatus as bb, type TemplateVersion as bc, type Tenant as bd, type TenantPauseSource as be, type TenantRamp as bf, type TenantStats as bg, type TenantStatsResult as bh, type TenantStatus as bi, type TenantStreamPolicy as bj, type TestEmailWebhookParams as bk, type TestEmailWebhookResult as bl, type TestInbox as bm, type TestInboxAddressOptions as bn, type TestInboxEmail as bo, type TestInboxEmailDetail as bp, type TestInboxHeader as bq, TestInboxResource as br, type TestInboxUsage as bs, type TriggerEventParams as bt, type TriggerEventResult as bu, type TwilioIntegrationResponse as bv, type TwilioIntegrationStatus as bw, type UpdateAutomationParams as bx, type UpdateDomainParams as by, type UpdateEmailParams as bz, type ApiKeyScope as c, type ApplyDnsParams as d, type ApplyDnsRecordResult as e, type ApplyDnsResult as f, type Asset as g, type Automation as h, type AutomationResult as i, type AutomationRun as j, type AutomationRunResponse as k, type AutomationRunStatus as l, type AutomationRunStep as m, type AutomationRunStepStatus as n, type AutomationStatus as o, type AutomationStep as p, type AutomationTrigger as q, type BounceType as r, type CategoryOptOutCategory as s, type CategoryUnsubscribedErrorDetails as t, type ConnectTwilioParams as u, type ContactWebhookEventPayload as v, type CreateApiKeyParams as w, type CreateApiKeyResult as x, type CreateAutomationParams as y, type CreateDomainParams 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 ApiKeyScope, d as ApplyDnsParams, e as ApplyDnsRecordResult, f as ApplyDnsResult, g as Asset, h as Automation, i as AutomationResult, j as AutomationRun, k as AutomationRunResponse, l as AutomationRunStatus, m as AutomationRunStep, n as AutomationRunStepStatus, o as AutomationStatus, p as AutomationStep, q as AutomationTrigger, B as BatchSendEmailResult, r as BounceType, C as CategoryOptOut, s as CategoryOptOutCategory, t as CategoryUnsubscribedErrorDetails, u as ConnectTwilioParams, v as ContactWebhookEventPayload, w as CreateApiKeyParams, x as CreateApiKeyResult, y as CreateAutomationParams, z as CreateDomainParams, E as CreateDomainResult, F as CreateMigrationParams, H as CreateSuppressionParams, I as CreateTemplateParams, J as CreateTenantParams, K as CreateWebhookParams, L as DEFAULT_API_BASE_URL, M as DailyRampLimitErrorDetails, N as DeleteTenantResult, O as DeliverabilityBucket, P as DeliverabilityDomainInsight, Q as DeliverabilityInsightsResult, R as DeliverabilityMailServerRelay, T as DeliverabilityWindow, U as DmarcDailyPoint, V as DmarcMonitoring, W as DmarcMonitoringDisabled, X as DmarcReadiness, Y as DmarcReadinessVerdict, Z as DmarcSource, _ as DmarcSourceStatus, $ as DmarcStatus, a0 as DnsProviderName, a1 as Domain, a2 as DomainBimiAnalysis, a3 as DomainDetailResult, a4 as DomainDmarcAnalysis, a5 as DomainDnsAnalysis, a6 as DomainStatus, a7 as DomainTlsMode, a8 as DomainTrackingDns, a9 as DomainTrackingStatus, aa as EmailListItem, ab as EmailWebhookEventPayload, ac as EmailWebhookEventType, ad as EnableDmarcParams, ae as EnableDmarcResult, af as EnrollmentSkip, ag as EventRecord, G as Groundmail, ah as GroundmailAccessToken, ai as GroundmailOptions, aj as GroundmailTokenOptions, ak as GroundmailTokenProvider, al as HeldBackErrorDetails, am as HeldBackReason, an as HeldBackRecipient, ao as ListApiKeysParams, ap as ListApiKeysResult, aq as ListAutomationRunsParams, ar as ListAutomationRunsResult, as as ListAutomationsResult, at as ListCategoryOptOutsParams, au as ListCategoryOptOutsResult, av as ListDomainsParams, aw as ListDomainsResult, ax as ListEmailsParams, ay as ListEmailsResult, az as ListReceivedEmailsParams, aA as ListReceivedEmailsResult, aB as ListSuppressionsParams, aC as ListSuppressionsResult, aD as ListTemplatesParams, aE as ListTemplatesResult, aF as ListTenantDomainsResult, aG as ListTenantsParams, aH as ListTenantsResult, aI as
|
|
1
|
+
import { A as ApiErrorBody, D as DnsRecord } from './client-DAetJZCf.js';
|
|
2
|
+
export { a as ApiErrorCode, b as ApiKey, c as ApiKeyScope, d as ApplyDnsParams, e as ApplyDnsRecordResult, f as ApplyDnsResult, g as Asset, h as Automation, i as AutomationResult, j as AutomationRun, k as AutomationRunResponse, l as AutomationRunStatus, m as AutomationRunStep, n as AutomationRunStepStatus, o as AutomationStatus, p as AutomationStep, q as AutomationTrigger, B as BatchSendEmailResult, r as BounceType, C as CategoryOptOut, s as CategoryOptOutCategory, t as CategoryUnsubscribedErrorDetails, u as ConnectTwilioParams, v as ContactWebhookEventPayload, w as CreateApiKeyParams, x as CreateApiKeyResult, y as CreateAutomationParams, z as CreateDomainParams, E as CreateDomainResult, F as CreateMigrationParams, H as CreateSuppressionParams, I as CreateTemplateParams, J as CreateTenantParams, K as CreateWebhookParams, L as DEFAULT_API_BASE_URL, M as DailyRampLimitErrorDetails, N as DeleteTenantResult, O as DeliverabilityBucket, P as DeliverabilityDomainInsight, Q as DeliverabilityInsightsResult, R as DeliverabilityMailServerRelay, T as DeliverabilityWindow, U as DmarcDailyPoint, V as DmarcMonitoring, W as DmarcMonitoringDisabled, X as DmarcReadiness, Y as DmarcReadinessVerdict, Z as DmarcSource, _ as DmarcSourceStatus, $ as DmarcStatus, a0 as DnsProviderName, a1 as Domain, a2 as DomainBimiAnalysis, a3 as DomainDetailResult, a4 as DomainDmarcAnalysis, a5 as DomainDnsAnalysis, a6 as DomainStatus, a7 as DomainTlsMode, a8 as DomainTrackingDns, a9 as DomainTrackingStatus, aa as EmailListItem, ab as EmailWebhookEventPayload, ac as EmailWebhookEventType, ad as EnableDmarcParams, ae as EnableDmarcResult, af as EnrollmentSkip, ag as EventRecord, G as Groundmail, ah as GroundmailAccessToken, ai as GroundmailOptions, aj as GroundmailTokenOptions, ak as GroundmailTokenProvider, al as HeldBackErrorDetails, am as HeldBackReason, an as HeldBackRecipient, ao as ListApiKeysParams, ap as ListApiKeysResult, aq as ListAutomationRunsParams, ar as ListAutomationRunsResult, as as ListAutomationsResult, at as ListCategoryOptOutsParams, au as ListCategoryOptOutsResult, av as ListDomainsParams, aw as ListDomainsResult, ax as ListEmailsParams, ay as ListEmailsResult, az as ListReceivedEmailsParams, aA as ListReceivedEmailsResult, aB as ListSuppressionsParams, aC as ListSuppressionsResult, aD as ListTemplatesParams, aE as ListTemplatesResult, aF as ListTenantDomainsResult, aG as ListTenantsParams, aH as ListTenantsResult, aI as ListTestInboxEmailsParams, aJ as ListTestInboxEmailsResult, aK as MailServerSigningStatus, aL as MailStream, aM as Migration, aN as MigrationDnsChange, aO as MigrationDnsPlan, aP as MigrationDomainItem, aQ as MigrationItemStatus, aR as MigrationProvider, aS as MigrationResource, aT as MigrationSummary, aU as MigrationTemplateItem, aV as MigrationTotals, aW as MigrationWebhookItem, aX as ReceivedEmail, aY as ReceivedEmailAttachment, aZ as ReceivedEmailAttachmentMeta, a_ as RemoteApplyDnsCredentials, a$ as RemoveCategoryOptOutOptions, b0 as RunMigrationOptions, b1 as SendEmailParams, S as SendEmailResult, b2 as StreamDeliverability, b3 as SuppressedErrorDetails, b4 as Suppression, b5 as TEST_INBOX_WAIT_DEFAULT_MS, b6 as TEST_INBOX_WAIT_MAX_SECONDS, b7 as Template, b8 as TemplateFormat, b9 as TemplateLintWarning, ba as TemplateStarter, bb as TemplateStatus, bc as TemplateVersion, bd as Tenant, be as TenantPauseSource, bf as TenantRamp, bg as TenantStats, bh as TenantStatsResult, bi as TenantStatus, bj as TenantStreamPolicy, bk as TestEmailWebhookParams, bl as TestEmailWebhookResult, bm as TestInbox, bn as TestInboxAddressOptions, bo as TestInboxEmail, bp as TestInboxEmailDetail, bq as TestInboxHeader, br as TestInboxResource, bs as TestInboxUsage, bt as TriggerEventParams, bu as TriggerEventResult, bv as TwilioIntegrationResponse, bw as TwilioIntegrationStatus, bx as UpdateAutomationParams, by as UpdateDomainParams, bz as UpdateEmailParams, bA as UpdateTemplateParams, bB as UpdateTenantParams, bC as UpdateWebhookParams, bD as ValidateEmailResult, bE as ValidationReason, bF as ValidationVerdict, bG as VerifyDomainResult, bH as WaitForTestEmailParams, bI as WebhookEmailTag, bJ as WebhookEndpoint, bK as WebhookEndpointWithSecret, bL as WebhookEventType, bM as mergeMigrations, bN as normalizeAccessToken } from './client-DAetJZCf.js';
|
|
3
3
|
|
|
4
4
|
type GroundmailErrorOptions = {
|
|
5
5
|
code?: string;
|
package/dist/index.js
CHANGED
|
@@ -2,6 +2,9 @@ import {
|
|
|
2
2
|
DEFAULT_API_BASE_URL,
|
|
3
3
|
Groundmail,
|
|
4
4
|
GroundmailError,
|
|
5
|
+
TEST_INBOX_WAIT_DEFAULT_MS,
|
|
6
|
+
TEST_INBOX_WAIT_MAX_SECONDS,
|
|
7
|
+
TestInboxResource,
|
|
5
8
|
applyDnsRecords,
|
|
6
9
|
buildSignatureHeader,
|
|
7
10
|
mergeMigrations,
|
|
@@ -9,7 +12,7 @@ import {
|
|
|
9
12
|
normalizeAccessToken,
|
|
10
13
|
signWebhookPayload,
|
|
11
14
|
verifyWebhookSignature
|
|
12
|
-
} from "./chunk-
|
|
15
|
+
} from "./chunk-E6G7G2PM.js";
|
|
13
16
|
|
|
14
17
|
// src/simulator.ts
|
|
15
18
|
var SIMULATOR_DOMAIN = "simulator.groundmail.dev";
|
|
@@ -37,6 +40,9 @@ export {
|
|
|
37
40
|
SIMULATOR_DOMAIN,
|
|
38
41
|
SIMULATOR_OUTCOMES,
|
|
39
42
|
TEST_API_KEY_PREFIX,
|
|
43
|
+
TEST_INBOX_WAIT_DEFAULT_MS,
|
|
44
|
+
TEST_INBOX_WAIT_MAX_SECONDS,
|
|
45
|
+
TestInboxResource,
|
|
40
46
|
applyDnsRecords,
|
|
41
47
|
buildSignatureHeader,
|
|
42
48
|
isSimulatorAddress,
|
package/dist/payload.d.ts
CHANGED
package/dist/payload.js
CHANGED
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "groundmail",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.26.0",
|
|
4
4
|
"description": "Groundmail transactional email API client",
|
|
5
5
|
"license": "MIT",
|
|
6
6
|
"type": "module",
|
|
@@ -89,7 +89,7 @@
|
|
|
89
89
|
"prepublishOnly": "npm run build && npm run build:nodemailer-bridge"
|
|
90
90
|
},
|
|
91
91
|
"dependencies": {
|
|
92
|
-
"groundmail-nodemailer": "0.15.
|
|
92
|
+
"groundmail-nodemailer": "0.15.13"
|
|
93
93
|
},
|
|
94
94
|
"devDependencies": {
|
|
95
95
|
"@types/nodemailer": "^8.0.1",
|