groundmail 0.43.0 → 0.44.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/dist/authjs.d.ts CHANGED
@@ -1,4 +1,4 @@
1
- import { G as Groundmail } from './client-BF4NQhim.js';
1
+ import { G as Groundmail } from './client-CD3tBIro.js';
2
2
 
3
3
  /** Subset of Auth.js theme used for the default magic-link email. */
4
4
  type AuthjsTheme = {
package/dist/authjs.js CHANGED
@@ -1,7 +1,7 @@
1
1
  import {
2
2
  DEFAULT_API_BASE_URL,
3
3
  Groundmail
4
- } from "./chunk-Y573OVJI.js";
4
+ } from "./chunk-WMMIGQLO.js";
5
5
 
6
6
  // src/authjs.ts
7
7
  function escapeHtml(value) {
@@ -1,4 +1,4 @@
1
- import { S as SendEmailResult, G as Groundmail } from './client-BF4NQhim.js';
1
+ import { S as SendEmailResult, G as Groundmail } from './client-CD3tBIro.js';
2
2
 
3
3
  type BetterAuthEmailUser = {
4
4
  email: string;
@@ -1,7 +1,7 @@
1
1
  import {
2
2
  DEFAULT_API_BASE_URL,
3
3
  Groundmail
4
- } from "./chunk-Y573OVJI.js";
4
+ } from "./chunk-WMMIGQLO.js";
5
5
 
6
6
  // src/better-auth.ts
7
7
  function linkHtml(label, url) {
@@ -1407,6 +1407,9 @@ function verifyWebhookSignature(secret, payload, header, toleranceSec = 300) {
1407
1407
  }
1408
1408
  }
1409
1409
 
1410
+ // package.json
1411
+ var version = "0.44.0";
1412
+
1410
1413
  // src/automations.ts
1411
1414
  var AutomationsResource = class {
1412
1415
  constructor(client) {
@@ -1649,8 +1652,8 @@ var EmailsResource = class {
1649
1652
  method: "GET"
1650
1653
  });
1651
1654
  }
1652
- async insights(window = "30d") {
1653
- const search = new URLSearchParams({ window });
1655
+ async insights(window2 = "30d") {
1656
+ const search = new URLSearchParams({ window: window2 });
1654
1657
  return this.client.request(`/deliverability?${search.toString()}`, {
1655
1658
  method: "GET"
1656
1659
  });
@@ -2089,9 +2092,9 @@ var TemplatesResource = class {
2089
2092
  method: "GET"
2090
2093
  });
2091
2094
  }
2092
- async restoreVersion(idOrAlias, version) {
2095
+ async restoreVersion(idOrAlias, version2) {
2093
2096
  return this.client.request(
2094
- `/templates/${encodeURIComponent(idOrAlias)}/versions/${version}`,
2097
+ `/templates/${encodeURIComponent(idOrAlias)}/versions/${version2}`,
2095
2098
  {
2096
2099
  method: "POST",
2097
2100
  body: JSON.stringify({ action: "restore" })
@@ -2310,6 +2313,16 @@ var _Groundmail = class _Groundmail {
2310
2313
  get fetchImpl() {
2311
2314
  return this.options.fetch || fetch;
2312
2315
  }
2316
+ /**
2317
+ * `groundmail/<version> node/<version>`, so Groundmail can tell SDK traffic from a plain
2318
+ * HTTP call. Left to a custom `fetch` (our CLI and MCP server send their own), and never
2319
+ * set in a browser, which owns this header.
2320
+ */
2321
+ get userAgentHeader() {
2322
+ if (this.options.fetch || typeof window !== "undefined") return {};
2323
+ const node = typeof process !== "undefined" ? process.versions?.node : void 0;
2324
+ return { "User-Agent": `groundmail/${version}${node ? ` node/${node}` : ""}` };
2325
+ }
2313
2326
  async bearer(forceRefresh = false) {
2314
2327
  if (this.apiKey) return this.apiKey;
2315
2328
  if (!forceRefresh && this.cachedToken && Date.now() < this.cachedToken.refreshAt) {
@@ -2327,7 +2340,12 @@ var _Groundmail = class _Groundmail {
2327
2340
  async authorizedFetch(url, init, extraHeaders) {
2328
2341
  const send = async (forceRefresh) => this.fetchImpl(url, {
2329
2342
  ...init,
2330
- headers: { Authorization: `Bearer ${await this.bearer(forceRefresh)}`, ...extraHeaders, ...init.headers || {} }
2343
+ headers: {
2344
+ ...this.userAgentHeader,
2345
+ Authorization: `Bearer ${await this.bearer(forceRefresh)}`,
2346
+ ...extraHeaders,
2347
+ ...init.headers || {}
2348
+ }
2331
2349
  });
2332
2350
  const response = await send(false);
2333
2351
  if (response.status === 401 && this.getToken) {
package/dist/clerk.d.ts CHANGED
@@ -1,4 +1,4 @@
1
- import { G as Groundmail, S as SendEmailResult } from './client-BF4NQhim.js';
1
+ import { G as Groundmail, S as SendEmailResult } from './client-CD3tBIro.js';
2
2
 
3
3
  /**
4
4
  * Subset of Clerk `email.created` webhook `data` used for delivery.
package/dist/clerk.js CHANGED
@@ -1,7 +1,7 @@
1
1
  import {
2
2
  DEFAULT_API_BASE_URL,
3
3
  Groundmail
4
- } from "./chunk-Y573OVJI.js";
4
+ } from "./chunk-WMMIGQLO.js";
5
5
 
6
6
  // src/clerk.ts
7
7
  function resolveApiKey(options) {
@@ -2570,6 +2570,12 @@ declare class Groundmail {
2570
2570
  validate(email: string): Promise<ValidateEmailResult>;
2571
2571
  get baseUrl(): string;
2572
2572
  get fetchImpl(): typeof fetch;
2573
+ /**
2574
+ * `groundmail/<version> node/<version>`, so Groundmail can tell SDK traffic from a plain
2575
+ * HTTP call. Left to a custom `fetch` (our CLI and MCP server send their own), and never
2576
+ * set in a browser, which owns this header.
2577
+ */
2578
+ private get userAgentHeader();
2573
2579
  /** Two minutes of slack so a token never expires in flight. */
2574
2580
  private static readonly TOKEN_REFRESH_SKEW_MS;
2575
2581
  /** Tokens with no known expiry are reused this long at most. */
package/dist/index.d.ts CHANGED
@@ -1,5 +1,5 @@
1
- import { A as ApiErrorBody, D as DnsRecord } from './client-BF4NQhim.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 BurrowGuardCheck, H as BurrowGuardReason, I as BurrowGuardResource, J as BurrowGuardSite, K as BurrowGuardSiteWithSecret, L as BurrowGuardVerifyParams, M as BurrowGuardVerifyResult, N as CancelBatchResult, O as CategoryOptOut, P as CategoryOptOutCategory, Q as CategoryUnsubscribedErrorDetails, R as ConnectTwilioParams, T as ContactWebhookEventPayload, U as CreateApiKeyParams, V as CreateApiKeyResult, W as CreateAutomationParams, X as CreateBurrowGuardSiteParams, Y as CreateDomainParams, Z as CreateDomainResult, _ as CreateMigrationParams, $ as CreateSenderParams, a0 as CreateSuppressionParams, a1 as CreateTemplateParams, a2 as CreateTenantParams, a3 as CreateWebhookParams, a4 as DEFAULT_API_BASE_URL, a5 as DailyRampLimitErrorDetails, a6 as DeleteTenantResult, a7 as DeliverabilityBucket, a8 as DeliverabilityDomainInsight, a9 as DeliverabilityInsightsResult, aa as DeliverabilityMailServerRelay, ab as DeliverabilityWindow, ac as DmarcDailyPoint, ad as DmarcMonitoring, ae as DmarcMonitoringDisabled, af as DmarcReadiness, ag as DmarcReadinessVerdict, ah as DmarcSource, ai as DmarcSourceStatus, aj as DmarcStatus, ak as DnsProviderName, al as Domain, am as DomainBimiAnalysis, an as DomainBlocklistListing, ao as DomainBlocklistStatus, ap as DomainBlocklists, aq as DomainDetailResult, ar as DomainDmarcAnalysis, as as DomainDnsAnalysis, at as DomainStatus, au as DomainTlsMode, av as DomainTrackingDns, aw as DomainTrackingStatus, ax as EmailDelivery, ay as EmailListItem, az as EmailWebhookEventPayload, aA as EmailWebhookEventType, aB as EnableDmarcParams, aC as EnableDmarcResult, aD as EnrollmentSkip, aE as EventRecord, G as Groundmail, aF as GroundmailAccessToken, aG as GroundmailOptions, aH as GroundmailTokenOptions, aI as GroundmailTokenProvider, aJ as HeldBackErrorDetails, aK as HeldBackReason, aL as HeldBackRecipient, aM as InReplyToEmail, aN as ListApiKeysParams, aO as ListApiKeysResult, aP as ListAutomationRunsParams, aQ as ListAutomationRunsResult, aR as ListAutomationsResult, aS as ListBurrowGuardChecksParams, aT as ListBurrowGuardChecksResult, aU as ListCategoryOptOutsParams, aV as ListCategoryOptOutsResult, aW as ListDomainsParams, aX as ListDomainsResult, aY as ListEmailsParams, aZ as ListEmailsResult, a_ as ListReceivedEmailsParams, a$ as ListReceivedEmailsResult, b0 as ListSendersResult, b1 as ListSuppressionsParams, b2 as ListSuppressionsResult, b3 as ListTemplatesParams, b4 as ListTemplatesResult, b5 as ListTenantDomainsResult, b6 as ListTenantsParams, b7 as ListTenantsResult, b8 as ListTestInboxEmailsParams, b9 as ListTestInboxEmailsResult, ba as ListWebhookDeliveriesParams, bb as ListWebhookDeliveriesResult, bc as MailServerSigningStatus, bd as MailStream, be as Migration, bf as MigrationDnsChange, bg as MigrationDnsPlan, bh as MigrationDomainItem, bi as MigrationItemStatus, bj as MigrationProvider, bk as MigrationResource, bl as MigrationSummary, bm as MigrationTemplateItem, bn as MigrationTotals, bo as MigrationWebhookItem, bp as ReceivedEmail, bq as ReceivedEmailAttachment, br as ReceivedEmailAttachmentMeta, bs as RemoteApplyDnsCredentials, bt as RemoveCategoryOptOutOptions, bu as RunMigrationOptions, bv as SendEmailParams, S as SendEmailResult, bw as Sender, bx as SesMigrationParams, by as StreamDeliverability, bz as SuppressedErrorDetails, bA as Suppression, bB as TEST_INBOX_WAIT_DEFAULT_MS, bC as TEST_INBOX_WAIT_MAX_SECONDS, bD as Template, bE as TemplateFormat, bF as TemplateLintWarning, bG as TemplateStarter, bH as TemplateStatus, bI as TemplateVersion, bJ as Tenant, bK as TenantPauseSource, bL as TenantRamp, bM as TenantStats, bN as TenantStatsResult, bO as TenantStatus, bP as TenantStreamPolicy, bQ as TestEmailWebhookParams, bR as TestEmailWebhookResult, bS as TestInbox, bT as TestInboxAddressOptions, bU as TestInboxEmail, bV as TestInboxEmailDetail, bW as TestInboxHeader, bX as TestInboxResource, bY as TestInboxUsage, bZ as TriggerEventParams, b_ as TriggerEventResult, b$ as TwilioIntegrationResponse, c0 as TwilioIntegrationStatus, c1 as UpdateAutomationParams, c2 as UpdateBrandParams, c3 as UpdateBurrowGuardSiteParams, c4 as UpdateDomainParams, c5 as UpdateEmailParams, c6 as UpdateSenderParams, c7 as UpdateTemplateParams, c8 as UpdateTenantParams, c9 as UpdateWebhookParams, ca as ValidateEmailResult, cb as ValidationReason, cc as ValidationVerdict, cd as VerifyDomainResult, ce as WaitForTestEmailParams, cf as WebhookDelivery, cg as WebhookDeliveryAttempt, ch as WebhookDeliveryDetail, ci as WebhookDeliveryStatus, cj as WebhookEmailTag, ck as WebhookEndpoint, cl as WebhookEndpointHealth, cm as WebhookEndpointWithSecret, cn as WebhookEventType, co as mergeMigrations, cp as normalizeAccessToken } from './client-BF4NQhim.js';
1
+ import { A as ApiErrorBody, D as DnsRecord } from './client-CD3tBIro.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 BurrowGuardCheck, H as BurrowGuardReason, I as BurrowGuardResource, J as BurrowGuardSite, K as BurrowGuardSiteWithSecret, L as BurrowGuardVerifyParams, M as BurrowGuardVerifyResult, N as CancelBatchResult, O as CategoryOptOut, P as CategoryOptOutCategory, Q as CategoryUnsubscribedErrorDetails, R as ConnectTwilioParams, T as ContactWebhookEventPayload, U as CreateApiKeyParams, V as CreateApiKeyResult, W as CreateAutomationParams, X as CreateBurrowGuardSiteParams, Y as CreateDomainParams, Z as CreateDomainResult, _ as CreateMigrationParams, $ as CreateSenderParams, a0 as CreateSuppressionParams, a1 as CreateTemplateParams, a2 as CreateTenantParams, a3 as CreateWebhookParams, a4 as DEFAULT_API_BASE_URL, a5 as DailyRampLimitErrorDetails, a6 as DeleteTenantResult, a7 as DeliverabilityBucket, a8 as DeliverabilityDomainInsight, a9 as DeliverabilityInsightsResult, aa as DeliverabilityMailServerRelay, ab as DeliverabilityWindow, ac as DmarcDailyPoint, ad as DmarcMonitoring, ae as DmarcMonitoringDisabled, af as DmarcReadiness, ag as DmarcReadinessVerdict, ah as DmarcSource, ai as DmarcSourceStatus, aj as DmarcStatus, ak as DnsProviderName, al as Domain, am as DomainBimiAnalysis, an as DomainBlocklistListing, ao as DomainBlocklistStatus, ap as DomainBlocklists, aq as DomainDetailResult, ar as DomainDmarcAnalysis, as as DomainDnsAnalysis, at as DomainStatus, au as DomainTlsMode, av as DomainTrackingDns, aw as DomainTrackingStatus, ax as EmailDelivery, ay as EmailListItem, az as EmailWebhookEventPayload, aA as EmailWebhookEventType, aB as EnableDmarcParams, aC as EnableDmarcResult, aD as EnrollmentSkip, aE as EventRecord, G as Groundmail, aF as GroundmailAccessToken, aG as GroundmailOptions, aH as GroundmailTokenOptions, aI as GroundmailTokenProvider, aJ as HeldBackErrorDetails, aK as HeldBackReason, aL as HeldBackRecipient, aM as InReplyToEmail, aN as ListApiKeysParams, aO as ListApiKeysResult, aP as ListAutomationRunsParams, aQ as ListAutomationRunsResult, aR as ListAutomationsResult, aS as ListBurrowGuardChecksParams, aT as ListBurrowGuardChecksResult, aU as ListCategoryOptOutsParams, aV as ListCategoryOptOutsResult, aW as ListDomainsParams, aX as ListDomainsResult, aY as ListEmailsParams, aZ as ListEmailsResult, a_ as ListReceivedEmailsParams, a$ as ListReceivedEmailsResult, b0 as ListSendersResult, b1 as ListSuppressionsParams, b2 as ListSuppressionsResult, b3 as ListTemplatesParams, b4 as ListTemplatesResult, b5 as ListTenantDomainsResult, b6 as ListTenantsParams, b7 as ListTenantsResult, b8 as ListTestInboxEmailsParams, b9 as ListTestInboxEmailsResult, ba as ListWebhookDeliveriesParams, bb as ListWebhookDeliveriesResult, bc as MailServerSigningStatus, bd as MailStream, be as Migration, bf as MigrationDnsChange, bg as MigrationDnsPlan, bh as MigrationDomainItem, bi as MigrationItemStatus, bj as MigrationProvider, bk as MigrationResource, bl as MigrationSummary, bm as MigrationTemplateItem, bn as MigrationTotals, bo as MigrationWebhookItem, bp as ReceivedEmail, bq as ReceivedEmailAttachment, br as ReceivedEmailAttachmentMeta, bs as RemoteApplyDnsCredentials, bt as RemoveCategoryOptOutOptions, bu as RunMigrationOptions, bv as SendEmailParams, S as SendEmailResult, bw as Sender, bx as SesMigrationParams, by as StreamDeliverability, bz as SuppressedErrorDetails, bA as Suppression, bB as TEST_INBOX_WAIT_DEFAULT_MS, bC as TEST_INBOX_WAIT_MAX_SECONDS, bD as Template, bE as TemplateFormat, bF as TemplateLintWarning, bG as TemplateStarter, bH as TemplateStatus, bI as TemplateVersion, bJ as Tenant, bK as TenantPauseSource, bL as TenantRamp, bM as TenantStats, bN as TenantStatsResult, bO as TenantStatus, bP as TenantStreamPolicy, bQ as TestEmailWebhookParams, bR as TestEmailWebhookResult, bS as TestInbox, bT as TestInboxAddressOptions, bU as TestInboxEmail, bV as TestInboxEmailDetail, bW as TestInboxHeader, bX as TestInboxResource, bY as TestInboxUsage, bZ as TriggerEventParams, b_ as TriggerEventResult, b$ as TwilioIntegrationResponse, c0 as TwilioIntegrationStatus, c1 as UpdateAutomationParams, c2 as UpdateBrandParams, c3 as UpdateBurrowGuardSiteParams, c4 as UpdateDomainParams, c5 as UpdateEmailParams, c6 as UpdateSenderParams, c7 as UpdateTemplateParams, c8 as UpdateTenantParams, c9 as UpdateWebhookParams, ca as ValidateEmailResult, cb as ValidationReason, cc as ValidationVerdict, cd as VerifyDomainResult, ce as WaitForTestEmailParams, cf as WebhookDelivery, cg as WebhookDeliveryAttempt, ch as WebhookDeliveryDetail, ci as WebhookDeliveryStatus, cj as WebhookEmailTag, ck as WebhookEndpoint, cl as WebhookEndpointHealth, cm as WebhookEndpointWithSecret, cn as WebhookEventType, co as mergeMigrations, cp as normalizeAccessToken } from './client-CD3tBIro.js';
3
3
 
4
4
  type GroundmailErrorOptions = {
5
5
  code?: string;
package/dist/index.js CHANGED
@@ -13,7 +13,7 @@ import {
13
13
  normalizeAccessToken,
14
14
  signWebhookPayload,
15
15
  verifyWebhookSignature
16
- } from "./chunk-Y573OVJI.js";
16
+ } from "./chunk-WMMIGQLO.js";
17
17
 
18
18
  // src/simulator.ts
19
19
  var SIMULATOR_DOMAIN = "simulator.groundmail.dev";
package/dist/payload.d.ts CHANGED
@@ -1,4 +1,4 @@
1
- import { G as Groundmail } from './client-BF4NQhim.js';
1
+ import { G as Groundmail } from './client-CD3tBIro.js';
2
2
 
3
3
  /**
4
4
  * Minimal Payload `SendEmailOptions` / address shapes used by this adapter.
package/dist/payload.js CHANGED
@@ -1,7 +1,7 @@
1
1
  import {
2
2
  DEFAULT_API_BASE_URL,
3
3
  Groundmail
4
- } from "./chunk-Y573OVJI.js";
4
+ } from "./chunk-WMMIGQLO.js";
5
5
 
6
6
  // src/payload.ts
7
7
  function resolveApiKey(args) {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "groundmail",
3
- "version": "0.43.0",
3
+ "version": "0.44.0",
4
4
  "description": "Groundmail transactional email API client",
5
5
  "license": "MIT",
6
6
  "type": "module",