groundmail 0.14.1 → 0.14.3
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 +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-IZYE7HGT.js → chunk-2ZKYDDVV.js} +36 -6
- package/dist/clerk.d.ts +1 -1
- package/dist/clerk.js +1 -1
- package/dist/{client-DdrSVDkA.d.ts → client-xZ_HIfb9.d.ts} +27 -7
- package/dist/index.d.ts +29 -7
- package/dist/index.js +1 -1
- package/dist/payload.d.ts +1 -1
- package/dist/payload.js +1 -1
- package/package.json +2 -2
package/dist/authjs.d.ts
CHANGED
package/dist/authjs.js
CHANGED
package/dist/better-auth.d.ts
CHANGED
package/dist/better-auth.js
CHANGED
|
@@ -7,14 +7,44 @@ var GroundmailError = class _GroundmailError extends Error {
|
|
|
7
7
|
this.details = details;
|
|
8
8
|
this.code = options?.code;
|
|
9
9
|
this.upgradeUrl = options?.upgradeUrl;
|
|
10
|
+
this.hint = options?.hint;
|
|
11
|
+
this.docsUrl = options?.docsUrl;
|
|
12
|
+
this.requiredScope = options?.requiredScope;
|
|
13
|
+
}
|
|
14
|
+
/** Same fields as the API's error body, snake_case, for logging. */
|
|
15
|
+
toJSON() {
|
|
16
|
+
return {
|
|
17
|
+
name: this.name,
|
|
18
|
+
message: this.message,
|
|
19
|
+
status: this.status,
|
|
20
|
+
...this.code ? { code: this.code } : {},
|
|
21
|
+
...this.hint ? { hint: this.hint } : {},
|
|
22
|
+
...this.docsUrl ? { docs_url: this.docsUrl } : {},
|
|
23
|
+
...this.requiredScope ? { required_scope: this.requiredScope } : {},
|
|
24
|
+
...this.upgradeUrl ? { upgrade_url: this.upgradeUrl } : {},
|
|
25
|
+
...this.details !== void 0 ? { details: this.details } : {}
|
|
26
|
+
};
|
|
10
27
|
}
|
|
28
|
+
/**
|
|
29
|
+
* Reads both error shapes the API returns: `{ error: { message, code, hint,
|
|
30
|
+
* docs_url, … } }`, and the older `{ error: "<message>", code, hint, docs_url }`.
|
|
31
|
+
*/
|
|
11
32
|
static fromResponse(status, body) {
|
|
12
|
-
const err = body
|
|
13
|
-
const
|
|
14
|
-
const
|
|
15
|
-
const
|
|
16
|
-
|
|
17
|
-
|
|
33
|
+
const err = body?.error;
|
|
34
|
+
const nested = typeof err === "object" && err ? err : void 0;
|
|
35
|
+
const top = body ?? {};
|
|
36
|
+
const pick = (key) => {
|
|
37
|
+
const value = nested?.[key] ?? top[key];
|
|
38
|
+
return typeof value === "string" && value ? value : void 0;
|
|
39
|
+
};
|
|
40
|
+
const message = typeof err === "string" && err || nested?.message || pick("message") || `Request failed with status ${status}`;
|
|
41
|
+
return new _GroundmailError(message, status, nested ? nested.details : top.details, {
|
|
42
|
+
code: pick("code"),
|
|
43
|
+
upgradeUrl: pick("upgrade_url"),
|
|
44
|
+
hint: pick("hint"),
|
|
45
|
+
docsUrl: pick("docs_url"),
|
|
46
|
+
requiredScope: pick("required_scope")
|
|
47
|
+
});
|
|
18
48
|
}
|
|
19
49
|
};
|
|
20
50
|
|
package/dist/clerk.d.ts
CHANGED
package/dist/clerk.js
CHANGED
|
@@ -582,6 +582,7 @@ type DomainDnsAnalysis = {
|
|
|
582
582
|
dmarc: DomainDmarcAnalysis;
|
|
583
583
|
bimi: DomainBimiAnalysis;
|
|
584
584
|
};
|
|
585
|
+
type DomainTrackingStatus = 'disabled' | 'pending' | 'active' | 'error';
|
|
585
586
|
type DomainTrackingDns = {
|
|
586
587
|
required: boolean;
|
|
587
588
|
host: string | null;
|
|
@@ -596,6 +597,14 @@ type Domain = {
|
|
|
596
597
|
verified_at: string | null;
|
|
597
598
|
open_tracking: boolean;
|
|
598
599
|
click_tracking: boolean;
|
|
600
|
+
/**
|
|
601
|
+
* Whether open/click tracking is actually being applied to outgoing mail:
|
|
602
|
+
* `pending` until the tracking CNAME is accepted and a certificate is issued for the
|
|
603
|
+
* tracking hostname (a few minutes after the CNAME is added), `active` once both are done.
|
|
604
|
+
*/
|
|
605
|
+
tracking_status?: DomainTrackingStatus | string;
|
|
606
|
+
/** Why tracking is not active yet, when `tracking_status` is `pending` or `error`. */
|
|
607
|
+
tracking_error?: string | null;
|
|
599
608
|
tls_mode: DomainTlsMode | string;
|
|
600
609
|
inbound_enabled: boolean;
|
|
601
610
|
inbound_status: 'disabled' | 'pending' | 'active' | 'error' | string;
|
|
@@ -719,13 +728,24 @@ type ApplyDnsResult = {
|
|
|
719
728
|
domain: string;
|
|
720
729
|
results: ApplyDnsRecordResult[];
|
|
721
730
|
};
|
|
731
|
+
/** Fields the API puts on an error, nested under `error` or (older routes) beside it. */
|
|
732
|
+
type ApiErrorFields = {
|
|
733
|
+
message?: string;
|
|
734
|
+
details?: unknown;
|
|
735
|
+
/** Stable machine-readable code, e.g. `insufficient_scope`. */
|
|
736
|
+
code?: string;
|
|
737
|
+
/** How to fix it. */
|
|
738
|
+
hint?: string;
|
|
739
|
+
/** https://docs.groundmail.dev/errors#<code> */
|
|
740
|
+
docs_url?: string;
|
|
741
|
+
/** With `insufficient_scope`: the scope(s) the endpoint needs, space-separated. */
|
|
742
|
+
required_scope?: string;
|
|
743
|
+
upgrade_url?: string;
|
|
744
|
+
};
|
|
722
745
|
type ApiErrorBody = {
|
|
723
|
-
error?: string |
|
|
724
|
-
|
|
725
|
-
|
|
726
|
-
code?: string;
|
|
727
|
-
upgrade_url?: string;
|
|
728
|
-
};
|
|
746
|
+
error?: string | ApiErrorFields;
|
|
747
|
+
} & Omit<ApiErrorFields, 'message'> & {
|
|
748
|
+
message?: string;
|
|
729
749
|
};
|
|
730
750
|
|
|
731
751
|
declare class AutomationsResource {
|
|
@@ -947,4 +967,4 @@ declare class Groundmail {
|
|
|
947
967
|
request<T>(path: string, init: RequestInit): Promise<T>;
|
|
948
968
|
}
|
|
949
969
|
|
|
950
|
-
export { type
|
|
970
|
+
export { type ListApiKeysResult as $, type ApiErrorBody as A, type BatchSendEmailResult as B, type CategoryUnsubscribedErrorDetails as C, type DnsRecord as D, DEFAULT_API_BASE_URL as E, type DeliverabilityBucket as F, Groundmail as G, type DeliverabilityDomainInsight as H, type DeliverabilityInsightsResult as I, type DeliverabilityMailServerRelay as J, type DeliverabilityWindow as K, type DnsProviderName as L, type Domain as M, type DomainBimiAnalysis as N, type DomainDetailResult as O, type DomainDmarcAnalysis as P, type DomainDnsAnalysis as Q, type DomainStatus as R, type SendEmailResult as S, type DomainTlsMode as T, type DomainTrackingDns as U, type DomainTrackingStatus as V, type EmailListItem as W, type EmailWebhookEventType as X, type EventRecord as Y, type GroundmailOptions as Z, type ListApiKeysParams as _, type ApiErrorCode as a, type ListAutomationRunsParams as a0, type ListAutomationRunsResult as a1, type ListAutomationsResult as a2, type ListDomainsParams as a3, type ListDomainsResult as a4, type ListEmailsParams as a5, type ListEmailsResult as a6, type ListReceivedEmailsParams as a7, type ListReceivedEmailsResult as a8, type ListSuppressionsParams as a9, type UpdateTemplateParams as aA, type UpdateWebhookParams as aB, type VerifyDomainResult as aC, type WebhookEndpoint as aD, type WebhookEndpointWithSecret as aE, type WebhookEventType as aF, type ListSuppressionsResult as aa, type ListTemplatesParams as ab, type ListTemplatesResult as ac, type MailServerSigningStatus as ad, type ReceivedEmail as ae, type ReceivedEmailAttachment as af, type ReceivedEmailAttachmentMeta as ag, type RemoteApplyDnsCredentials as ah, type SendEmailParams as ai, type SuppressedErrorDetails as aj, type Suppression as ak, type Template as al, type TemplateFormat as am, type TemplateLintWarning as an, type TemplateStarter as ao, type TemplateStatus as ap, type TemplateVersion as aq, type TestEmailWebhookParams as ar, type TestEmailWebhookResult as as, type TriggerEventParams as at, type TriggerEventResult as au, type TwilioIntegrationResponse as av, type TwilioIntegrationStatus as aw, type UpdateAutomationParams as ax, type UpdateDomainParams as ay, type UpdateEmailParams as az, type ApiKey as b, 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 AutomationRun as i, type AutomationRunResponse as j, type AutomationRunStatus as k, type AutomationRunStep as l, type AutomationRunStepStatus as m, type AutomationStatus as n, type AutomationStep as o, type AutomationTrigger as p, type ConnectTwilioParams as q, type ContactWebhookEventPayload as r, type CreateApiKeyParams as s, type CreateApiKeyResult as t, type CreateAutomationParams as u, type CreateDomainParams as v, type CreateDomainResult as w, type CreateSuppressionParams as x, type CreateTemplateParams as y, type CreateWebhookParams as z };
|
package/dist/index.d.ts
CHANGED
|
@@ -1,15 +1,37 @@
|
|
|
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 AutomationRun, j as AutomationRunResponse, k as AutomationRunStatus, l as AutomationRunStep, m as AutomationRunStepStatus, n as AutomationStatus, o as AutomationStep, p as AutomationTrigger, B as BatchSendEmailResult, C as CategoryUnsubscribedErrorDetails, q as ConnectTwilioParams, r as ContactWebhookEventPayload, s as CreateApiKeyParams, t as CreateApiKeyResult, u as CreateAutomationParams, v as CreateDomainParams, w as CreateDomainResult, x as CreateSuppressionParams, y as CreateTemplateParams, z as CreateWebhookParams, E as DEFAULT_API_BASE_URL, F as DeliverabilityBucket, H as DeliverabilityDomainInsight, I as DeliverabilityInsightsResult, J as DeliverabilityMailServerRelay, K as DeliverabilityWindow, L as DnsProviderName, M as Domain, N as DomainBimiAnalysis, O as DomainDetailResult, P as DomainDmarcAnalysis, Q as DomainDnsAnalysis, R as DomainStatus, T as DomainTlsMode, U as DomainTrackingDns, V as
|
|
1
|
+
import { A as ApiErrorBody, D as DnsRecord } from './client-xZ_HIfb9.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 AutomationRun, j as AutomationRunResponse, k as AutomationRunStatus, l as AutomationRunStep, m as AutomationRunStepStatus, n as AutomationStatus, o as AutomationStep, p as AutomationTrigger, B as BatchSendEmailResult, C as CategoryUnsubscribedErrorDetails, q as ConnectTwilioParams, r as ContactWebhookEventPayload, s as CreateApiKeyParams, t as CreateApiKeyResult, u as CreateAutomationParams, v as CreateDomainParams, w as CreateDomainResult, x as CreateSuppressionParams, y as CreateTemplateParams, z as CreateWebhookParams, E as DEFAULT_API_BASE_URL, F as DeliverabilityBucket, H as DeliverabilityDomainInsight, I as DeliverabilityInsightsResult, J as DeliverabilityMailServerRelay, K as DeliverabilityWindow, L as DnsProviderName, M as Domain, N as DomainBimiAnalysis, O as DomainDetailResult, P as DomainDmarcAnalysis, Q as DomainDnsAnalysis, R as DomainStatus, T as DomainTlsMode, U as DomainTrackingDns, V as DomainTrackingStatus, W as EmailListItem, X as EmailWebhookEventType, Y as EventRecord, G as Groundmail, Z as GroundmailOptions, _ as ListApiKeysParams, $ as ListApiKeysResult, a0 as ListAutomationRunsParams, a1 as ListAutomationRunsResult, a2 as ListAutomationsResult, a3 as ListDomainsParams, a4 as ListDomainsResult, a5 as ListEmailsParams, a6 as ListEmailsResult, a7 as ListReceivedEmailsParams, a8 as ListReceivedEmailsResult, a9 as ListSuppressionsParams, aa as ListSuppressionsResult, ab as ListTemplatesParams, ac as ListTemplatesResult, ad as MailServerSigningStatus, ae as ReceivedEmail, af as ReceivedEmailAttachment, ag as ReceivedEmailAttachmentMeta, ah as RemoteApplyDnsCredentials, ai as SendEmailParams, S as SendEmailResult, aj as SuppressedErrorDetails, ak as Suppression, al as Template, am as TemplateFormat, an as TemplateLintWarning, ao as TemplateStarter, ap as TemplateStatus, aq as TemplateVersion, ar as TestEmailWebhookParams, as as TestEmailWebhookResult, at as TriggerEventParams, au as TriggerEventResult, av as TwilioIntegrationResponse, aw as TwilioIntegrationStatus, ax as UpdateAutomationParams, ay as UpdateDomainParams, az as UpdateEmailParams, aA as UpdateTemplateParams, aB as UpdateWebhookParams, aC as VerifyDomainResult, aD as WebhookEndpoint, aE as WebhookEndpointWithSecret, aF as WebhookEventType } from './client-xZ_HIfb9.js';
|
|
3
3
|
|
|
4
|
+
type GroundmailErrorOptions = {
|
|
5
|
+
code?: string;
|
|
6
|
+
upgradeUrl?: string;
|
|
7
|
+
hint?: string;
|
|
8
|
+
docsUrl?: string;
|
|
9
|
+
requiredScope?: string;
|
|
10
|
+
};
|
|
11
|
+
/**
|
|
12
|
+
* An API error. Besides `message` and `status`, the API says how to recover:
|
|
13
|
+
* `code` (stable, e.g. `insufficient_scope`), `hint` (what to do next),
|
|
14
|
+
* `docsUrl` (the errors page entry for the code), `requiredScope` (with
|
|
15
|
+
* `insufficient_scope`) and `upgradeUrl` (with plan limits).
|
|
16
|
+
*/
|
|
4
17
|
declare class GroundmailError extends Error {
|
|
5
18
|
readonly status: number;
|
|
6
19
|
readonly details?: unknown;
|
|
7
20
|
readonly code?: string;
|
|
8
21
|
readonly upgradeUrl?: string;
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
22
|
+
/** How to fix it, from the API. */
|
|
23
|
+
readonly hint?: string;
|
|
24
|
+
/** Docs for this error code, e.g. https://docs.groundmail.dev/errors#insufficient_scope */
|
|
25
|
+
readonly docsUrl?: string;
|
|
26
|
+
/** With `insufficient_scope`: the scope(s) the endpoint needs, space-separated. */
|
|
27
|
+
readonly requiredScope?: string;
|
|
28
|
+
constructor(message: string, status: number, details?: unknown, options?: GroundmailErrorOptions);
|
|
29
|
+
/** Same fields as the API's error body, snake_case, for logging. */
|
|
30
|
+
toJSON(): Record<string, unknown>;
|
|
31
|
+
/**
|
|
32
|
+
* Reads both error shapes the API returns: `{ error: { message, code, hint,
|
|
33
|
+
* docs_url, … } }`, and the older `{ error: "<message>", code, hint, docs_url }`.
|
|
34
|
+
*/
|
|
13
35
|
static fromResponse(status: number, body: ApiErrorBody): GroundmailError;
|
|
14
36
|
}
|
|
15
37
|
|
|
@@ -53,4 +75,4 @@ declare function applyDnsRecords(input: {
|
|
|
53
75
|
fetchImpl?: typeof fetch;
|
|
54
76
|
}): Promise<ApplyDnsResult>;
|
|
55
77
|
|
|
56
|
-
export { DnsRecord, GroundmailError, applyDnsRecords, buildSignatureHeader, mergeSpfInclude, signWebhookPayload, verifyWebhookSignature };
|
|
78
|
+
export { DnsRecord, GroundmailError, type GroundmailErrorOptions, applyDnsRecords, buildSignatureHeader, mergeSpfInclude, signWebhookPayload, verifyWebhookSignature };
|
package/dist/index.js
CHANGED
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.14.
|
|
3
|
+
"version": "0.14.3",
|
|
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.14.
|
|
92
|
+
"groundmail-nodemailer": "0.14.3"
|
|
93
93
|
},
|
|
94
94
|
"devDependencies": {
|
|
95
95
|
"@types/nodemailer": "^8.0.1",
|