groundmail 0.14.1 → 0.14.2
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-B8xoWTgr.d.ts} +17 -6
- 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
|
@@ -719,13 +719,24 @@ type ApplyDnsResult = {
|
|
|
719
719
|
domain: string;
|
|
720
720
|
results: ApplyDnsRecordResult[];
|
|
721
721
|
};
|
|
722
|
+
/** Fields the API puts on an error, nested under `error` or (older routes) beside it. */
|
|
723
|
+
type ApiErrorFields = {
|
|
724
|
+
message?: string;
|
|
725
|
+
details?: unknown;
|
|
726
|
+
/** Stable machine-readable code, e.g. `insufficient_scope`. */
|
|
727
|
+
code?: string;
|
|
728
|
+
/** How to fix it. */
|
|
729
|
+
hint?: string;
|
|
730
|
+
/** https://docs.groundmail.dev/errors#<code> */
|
|
731
|
+
docs_url?: string;
|
|
732
|
+
/** With `insufficient_scope`: the scope(s) the endpoint needs, space-separated. */
|
|
733
|
+
required_scope?: string;
|
|
734
|
+
upgrade_url?: string;
|
|
735
|
+
};
|
|
722
736
|
type ApiErrorBody = {
|
|
723
|
-
error?: string |
|
|
724
|
-
|
|
725
|
-
|
|
726
|
-
code?: string;
|
|
727
|
-
upgrade_url?: string;
|
|
728
|
-
};
|
|
737
|
+
error?: string | ApiErrorFields;
|
|
738
|
+
} & Omit<ApiErrorFields, 'message'> & {
|
|
739
|
+
message?: string;
|
|
729
740
|
};
|
|
730
741
|
|
|
731
742
|
declare class AutomationsResource {
|
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 EmailListItem, W as EmailWebhookEventType, X as EventRecord, G as Groundmail, Y as GroundmailOptions, Z as ListApiKeysParams, _ as ListApiKeysResult, $ as ListAutomationRunsParams, a0 as ListAutomationRunsResult, a1 as ListAutomationsResult, a2 as ListDomainsParams, a3 as ListDomainsResult, a4 as ListEmailsParams, a5 as ListEmailsResult, a6 as ListReceivedEmailsParams, a7 as ListReceivedEmailsResult, a8 as ListSuppressionsParams, a9 as ListSuppressionsResult, aa as ListTemplatesParams, ab as ListTemplatesResult, ac as MailServerSigningStatus, ad as ReceivedEmail, ae as ReceivedEmailAttachment, af as ReceivedEmailAttachmentMeta, ag as RemoteApplyDnsCredentials, ah as SendEmailParams, S as SendEmailResult, ai as SuppressedErrorDetails, aj as Suppression, ak as Template, al as TemplateFormat, am as TemplateLintWarning, an as TemplateStarter, ao as TemplateStatus, ap as TemplateVersion, aq as TestEmailWebhookParams, ar as TestEmailWebhookResult, as as TriggerEventParams, at as TriggerEventResult, au as TwilioIntegrationResponse, av as TwilioIntegrationStatus, aw as UpdateAutomationParams, ax as UpdateDomainParams, ay as UpdateEmailParams, az as UpdateTemplateParams, aA as UpdateWebhookParams, aB as VerifyDomainResult, aC as WebhookEndpoint, aD as WebhookEndpointWithSecret, aE as WebhookEventType } from './client-
|
|
1
|
+
import { A as ApiErrorBody, D as DnsRecord } from './client-B8xoWTgr.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 EmailListItem, W as EmailWebhookEventType, X as EventRecord, G as Groundmail, Y as GroundmailOptions, Z as ListApiKeysParams, _ as ListApiKeysResult, $ as ListAutomationRunsParams, a0 as ListAutomationRunsResult, a1 as ListAutomationsResult, a2 as ListDomainsParams, a3 as ListDomainsResult, a4 as ListEmailsParams, a5 as ListEmailsResult, a6 as ListReceivedEmailsParams, a7 as ListReceivedEmailsResult, a8 as ListSuppressionsParams, a9 as ListSuppressionsResult, aa as ListTemplatesParams, ab as ListTemplatesResult, ac as MailServerSigningStatus, ad as ReceivedEmail, ae as ReceivedEmailAttachment, af as ReceivedEmailAttachmentMeta, ag as RemoteApplyDnsCredentials, ah as SendEmailParams, S as SendEmailResult, ai as SuppressedErrorDetails, aj as Suppression, ak as Template, al as TemplateFormat, am as TemplateLintWarning, an as TemplateStarter, ao as TemplateStatus, ap as TemplateVersion, aq as TestEmailWebhookParams, ar as TestEmailWebhookResult, as as TriggerEventParams, at as TriggerEventResult, au as TwilioIntegrationResponse, av as TwilioIntegrationStatus, aw as UpdateAutomationParams, ax as UpdateDomainParams, ay as UpdateEmailParams, az as UpdateTemplateParams, aA as UpdateWebhookParams, aB as VerifyDomainResult, aC as WebhookEndpoint, aD as WebhookEndpointWithSecret, aE as WebhookEventType } from './client-B8xoWTgr.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.2",
|
|
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.2"
|
|
93
93
|
},
|
|
94
94
|
"devDependencies": {
|
|
95
95
|
"@types/nodemailer": "^8.0.1",
|