@usehercules/sdk 1.14.2 → 1.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.
Files changed (61) hide show
  1. package/CHANGELOG.md +16 -0
  2. package/client.d.mts +7 -0
  3. package/client.d.mts.map +1 -1
  4. package/client.d.ts +7 -0
  5. package/client.d.ts.map +1 -1
  6. package/client.js +7 -0
  7. package/client.js.map +1 -1
  8. package/client.mjs +7 -0
  9. package/client.mjs.map +1 -1
  10. package/package.json +1 -1
  11. package/resources/email/email.d.mts +166 -0
  12. package/resources/email/email.d.mts.map +1 -0
  13. package/resources/email/email.d.ts +166 -0
  14. package/resources/email/email.d.ts.map +1 -0
  15. package/resources/email/email.js +43 -0
  16. package/resources/email/email.js.map +1 -0
  17. package/resources/email/email.mjs +38 -0
  18. package/resources/email/email.mjs.map +1 -0
  19. package/resources/email/identities.d.mts +107 -0
  20. package/resources/email/identities.d.mts.map +1 -0
  21. package/resources/email/identities.d.ts +107 -0
  22. package/resources/email/identities.d.ts.map +1 -0
  23. package/resources/email/identities.js +51 -0
  24. package/resources/email/identities.js.map +1 -0
  25. package/resources/email/identities.mjs +47 -0
  26. package/resources/email/identities.mjs.map +1 -0
  27. package/resources/email/index.d.mts +3 -0
  28. package/resources/email/index.d.mts.map +1 -0
  29. package/resources/email/index.d.ts +3 -0
  30. package/resources/email/index.d.ts.map +1 -0
  31. package/resources/email/index.js +9 -0
  32. package/resources/email/index.js.map +1 -0
  33. package/resources/email/index.mjs +4 -0
  34. package/resources/email/index.mjs.map +1 -0
  35. package/resources/email.d.mts +2 -0
  36. package/resources/email.d.mts.map +1 -0
  37. package/resources/email.d.ts +2 -0
  38. package/resources/email.d.ts.map +1 -0
  39. package/resources/email.js +6 -0
  40. package/resources/email.js.map +1 -0
  41. package/resources/email.mjs +3 -0
  42. package/resources/email.mjs.map +1 -0
  43. package/resources/index.d.mts +1 -0
  44. package/resources/index.d.mts.map +1 -1
  45. package/resources/index.d.ts +1 -0
  46. package/resources/index.d.ts.map +1 -1
  47. package/resources/index.js +3 -1
  48. package/resources/index.js.map +1 -1
  49. package/resources/index.mjs +1 -0
  50. package/resources/index.mjs.map +1 -1
  51. package/src/client.ts +26 -1
  52. package/src/resources/email/email.ts +229 -0
  53. package/src/resources/email/identities.ts +151 -0
  54. package/src/resources/email/index.ts +18 -0
  55. package/src/resources/email.ts +3 -0
  56. package/src/resources/index.ts +9 -0
  57. package/src/version.ts +1 -1
  58. package/version.d.mts +1 -1
  59. package/version.d.ts +1 -1
  60. package/version.js +1 -1
  61. package/version.mjs +1 -1
@@ -0,0 +1,6 @@
1
+ "use strict";
2
+ // File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
3
+ Object.defineProperty(exports, "__esModule", { value: true });
4
+ const tslib_1 = require("../internal/tslib.js");
5
+ tslib_1.__exportStar(require("./email/index.js"), exports);
6
+ //# sourceMappingURL=email.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"email.js","sourceRoot":"","sources":["../src/resources/email.ts"],"names":[],"mappings":";AAAA,sFAAsF;;;AAEtF,2DAA8B"}
@@ -0,0 +1,3 @@
1
+ // File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
2
+ export * from "./email/index.mjs";
3
+ //# sourceMappingURL=email.mjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"email.mjs","sourceRoot":"","sources":["../src/resources/email.ts"],"names":[],"mappings":"AAAA,sFAAsF"}
@@ -1,6 +1,7 @@
1
1
  export { Commerce, type Currency, type CommerceCancelResponse, type CommerceCheckResponse, type CommerceCheckoutResponse, type CommerceCancelParams, type CommerceCheckParams, type CommerceCheckoutParams, } from "./commerce/commerce.mjs";
2
2
  export { Content } from "./content/content.mjs";
3
3
  export { Domains, type Domain, type DomainListParams, type DomainsCursorIDPage } from "./domains.mjs";
4
+ export { EmailResource, type Attachment, type Email, type EmailSendResponse, type EmailListParams, type EmailSendParams, type EmailsCursorIDPage, } from "./email/email.mjs";
4
5
  export { Files, type File, type Upload, type FileListParams, type FilesCursorIDPage } from "./files.mjs";
5
6
  export { PushNotifications, type PushNotificationEnableResponse, type PushNotificationIdentifyResponse, type PushNotificationSendResponse, type PushNotificationSubscribeResponse, type PushNotificationUnsubscribeResponse, type PushNotificationIdentifyParams, type PushNotificationSendParams, type PushNotificationSubscribeParams, type PushNotificationUnsubscribeParams, } from "./push-notifications/push-notifications.mjs";
6
7
  //# sourceMappingURL=index.d.mts.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.mts","sourceRoot":"","sources":["../src/resources/index.ts"],"names":[],"mappings":"OAEO,EACL,QAAQ,EACR,KAAK,QAAQ,EACb,KAAK,sBAAsB,EAC3B,KAAK,qBAAqB,EAC1B,KAAK,wBAAwB,EAC7B,KAAK,oBAAoB,EACzB,KAAK,mBAAmB,EACxB,KAAK,sBAAsB,GAC5B;OACM,EAAE,OAAO,EAAE;OACX,EAAE,OAAO,EAAE,KAAK,MAAM,EAAE,KAAK,gBAAgB,EAAE,KAAK,mBAAmB,EAAE;OACzE,EAAE,KAAK,EAAE,KAAK,IAAI,EAAE,KAAK,MAAM,EAAE,KAAK,cAAc,EAAE,KAAK,iBAAiB,EAAE;OAC9E,EACL,iBAAiB,EACjB,KAAK,8BAA8B,EACnC,KAAK,gCAAgC,EACrC,KAAK,4BAA4B,EACjC,KAAK,iCAAiC,EACtC,KAAK,mCAAmC,EACxC,KAAK,8BAA8B,EACnC,KAAK,0BAA0B,EAC/B,KAAK,+BAA+B,EACpC,KAAK,iCAAiC,GACvC"}
1
+ {"version":3,"file":"index.d.mts","sourceRoot":"","sources":["../src/resources/index.ts"],"names":[],"mappings":"OAEO,EACL,QAAQ,EACR,KAAK,QAAQ,EACb,KAAK,sBAAsB,EAC3B,KAAK,qBAAqB,EAC1B,KAAK,wBAAwB,EAC7B,KAAK,oBAAoB,EACzB,KAAK,mBAAmB,EACxB,KAAK,sBAAsB,GAC5B;OACM,EAAE,OAAO,EAAE;OACX,EAAE,OAAO,EAAE,KAAK,MAAM,EAAE,KAAK,gBAAgB,EAAE,KAAK,mBAAmB,EAAE;OACzE,EACL,aAAa,EACb,KAAK,UAAU,EACf,KAAK,KAAK,EACV,KAAK,iBAAiB,EACtB,KAAK,eAAe,EACpB,KAAK,eAAe,EACpB,KAAK,kBAAkB,GACxB;OACM,EAAE,KAAK,EAAE,KAAK,IAAI,EAAE,KAAK,MAAM,EAAE,KAAK,cAAc,EAAE,KAAK,iBAAiB,EAAE;OAC9E,EACL,iBAAiB,EACjB,KAAK,8BAA8B,EACnC,KAAK,gCAAgC,EACrC,KAAK,4BAA4B,EACjC,KAAK,iCAAiC,EACtC,KAAK,mCAAmC,EACxC,KAAK,8BAA8B,EACnC,KAAK,0BAA0B,EAC/B,KAAK,+BAA+B,EACpC,KAAK,iCAAiC,GACvC"}
@@ -1,6 +1,7 @@
1
1
  export { Commerce, type Currency, type CommerceCancelResponse, type CommerceCheckResponse, type CommerceCheckoutResponse, type CommerceCancelParams, type CommerceCheckParams, type CommerceCheckoutParams, } from "./commerce/commerce.js";
2
2
  export { Content } from "./content/content.js";
3
3
  export { Domains, type Domain, type DomainListParams, type DomainsCursorIDPage } from "./domains.js";
4
+ export { EmailResource, type Attachment, type Email, type EmailSendResponse, type EmailListParams, type EmailSendParams, type EmailsCursorIDPage, } from "./email/email.js";
4
5
  export { Files, type File, type Upload, type FileListParams, type FilesCursorIDPage } from "./files.js";
5
6
  export { PushNotifications, type PushNotificationEnableResponse, type PushNotificationIdentifyResponse, type PushNotificationSendResponse, type PushNotificationSubscribeResponse, type PushNotificationUnsubscribeResponse, type PushNotificationIdentifyParams, type PushNotificationSendParams, type PushNotificationSubscribeParams, type PushNotificationUnsubscribeParams, } from "./push-notifications/push-notifications.js";
6
7
  //# sourceMappingURL=index.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/resources/index.ts"],"names":[],"mappings":"OAEO,EACL,QAAQ,EACR,KAAK,QAAQ,EACb,KAAK,sBAAsB,EAC3B,KAAK,qBAAqB,EAC1B,KAAK,wBAAwB,EAC7B,KAAK,oBAAoB,EACzB,KAAK,mBAAmB,EACxB,KAAK,sBAAsB,GAC5B;OACM,EAAE,OAAO,EAAE;OACX,EAAE,OAAO,EAAE,KAAK,MAAM,EAAE,KAAK,gBAAgB,EAAE,KAAK,mBAAmB,EAAE;OACzE,EAAE,KAAK,EAAE,KAAK,IAAI,EAAE,KAAK,MAAM,EAAE,KAAK,cAAc,EAAE,KAAK,iBAAiB,EAAE;OAC9E,EACL,iBAAiB,EACjB,KAAK,8BAA8B,EACnC,KAAK,gCAAgC,EACrC,KAAK,4BAA4B,EACjC,KAAK,iCAAiC,EACtC,KAAK,mCAAmC,EACxC,KAAK,8BAA8B,EACnC,KAAK,0BAA0B,EAC/B,KAAK,+BAA+B,EACpC,KAAK,iCAAiC,GACvC"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/resources/index.ts"],"names":[],"mappings":"OAEO,EACL,QAAQ,EACR,KAAK,QAAQ,EACb,KAAK,sBAAsB,EAC3B,KAAK,qBAAqB,EAC1B,KAAK,wBAAwB,EAC7B,KAAK,oBAAoB,EACzB,KAAK,mBAAmB,EACxB,KAAK,sBAAsB,GAC5B;OACM,EAAE,OAAO,EAAE;OACX,EAAE,OAAO,EAAE,KAAK,MAAM,EAAE,KAAK,gBAAgB,EAAE,KAAK,mBAAmB,EAAE;OACzE,EACL,aAAa,EACb,KAAK,UAAU,EACf,KAAK,KAAK,EACV,KAAK,iBAAiB,EACtB,KAAK,eAAe,EACpB,KAAK,eAAe,EACpB,KAAK,kBAAkB,GACxB;OACM,EAAE,KAAK,EAAE,KAAK,IAAI,EAAE,KAAK,MAAM,EAAE,KAAK,cAAc,EAAE,KAAK,iBAAiB,EAAE;OAC9E,EACL,iBAAiB,EACjB,KAAK,8BAA8B,EACnC,KAAK,gCAAgC,EACrC,KAAK,4BAA4B,EACjC,KAAK,iCAAiC,EACtC,KAAK,mCAAmC,EACxC,KAAK,8BAA8B,EACnC,KAAK,0BAA0B,EAC/B,KAAK,+BAA+B,EACpC,KAAK,iCAAiC,GACvC"}
@@ -1,13 +1,15 @@
1
1
  "use strict";
2
2
  // File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
3
3
  Object.defineProperty(exports, "__esModule", { value: true });
4
- exports.PushNotifications = exports.Files = exports.Domains = exports.Content = exports.Commerce = void 0;
4
+ exports.PushNotifications = exports.Files = exports.EmailResource = exports.Domains = exports.Content = exports.Commerce = void 0;
5
5
  var commerce_1 = require("./commerce/commerce.js");
6
6
  Object.defineProperty(exports, "Commerce", { enumerable: true, get: function () { return commerce_1.Commerce; } });
7
7
  var content_1 = require("./content/content.js");
8
8
  Object.defineProperty(exports, "Content", { enumerable: true, get: function () { return content_1.Content; } });
9
9
  var domains_1 = require("./domains.js");
10
10
  Object.defineProperty(exports, "Domains", { enumerable: true, get: function () { return domains_1.Domains; } });
11
+ var email_1 = require("./email/email.js");
12
+ Object.defineProperty(exports, "EmailResource", { enumerable: true, get: function () { return email_1.EmailResource; } });
11
13
  var files_1 = require("./files.js");
12
14
  Object.defineProperty(exports, "Files", { enumerable: true, get: function () { return files_1.Files; } });
13
15
  var push_notifications_1 = require("./push-notifications/push-notifications.js");
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../src/resources/index.ts"],"names":[],"mappings":";AAAA,sFAAsF;;;AAEtF,mDAS6B;AAR3B,oGAAA,QAAQ,OAAA;AASV,gDAA4C;AAAnC,kGAAA,OAAO,OAAA;AAChB,wCAAkG;AAAzF,kGAAA,OAAO,OAAA;AAChB,oCAAqG;AAA5F,8FAAA,KAAK,OAAA;AACd,iFAWiD;AAV/C,uHAAA,iBAAiB,OAAA"}
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../src/resources/index.ts"],"names":[],"mappings":";AAAA,sFAAsF;;;AAEtF,mDAS6B;AAR3B,oGAAA,QAAQ,OAAA;AASV,gDAA4C;AAAnC,kGAAA,OAAO,OAAA;AAChB,wCAAkG;AAAzF,kGAAA,OAAO,OAAA;AAChB,0CAQuB;AAPrB,sGAAA,aAAa,OAAA;AAQf,oCAAqG;AAA5F,8FAAA,KAAK,OAAA;AACd,iFAWiD;AAV/C,uHAAA,iBAAiB,OAAA"}
@@ -2,6 +2,7 @@
2
2
  export { Commerce, } from "./commerce/commerce.mjs";
3
3
  export { Content } from "./content/content.mjs";
4
4
  export { Domains } from "./domains.mjs";
5
+ export { EmailResource, } from "./email/email.mjs";
5
6
  export { Files } from "./files.mjs";
6
7
  export { PushNotifications, } from "./push-notifications/push-notifications.mjs";
7
8
  //# sourceMappingURL=index.mjs.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.mjs","sourceRoot":"","sources":["../src/resources/index.ts"],"names":[],"mappings":"AAAA,sFAAsF;OAE/E,EACL,QAAQ,GAQT;OACM,EAAE,OAAO,EAAE;OACX,EAAE,OAAO,EAAgE;OACzE,EAAE,KAAK,EAAuE;OAC9E,EACL,iBAAiB,GAUlB"}
1
+ {"version":3,"file":"index.mjs","sourceRoot":"","sources":["../src/resources/index.ts"],"names":[],"mappings":"AAAA,sFAAsF;OAE/E,EACL,QAAQ,GAQT;OACM,EAAE,OAAO,EAAE;OACX,EAAE,OAAO,EAAgE;OACzE,EACL,aAAa,GAOd;OACM,EAAE,KAAK,EAAuE;OAC9E,EACL,iBAAiB,GAUlB"}
package/src/client.ts CHANGED
@@ -32,6 +32,15 @@ import {
32
32
  Currency,
33
33
  } from './resources/commerce/commerce';
34
34
  import { Content } from './resources/content/content';
35
+ import {
36
+ Attachment,
37
+ Email,
38
+ EmailListParams,
39
+ EmailResource,
40
+ EmailSendParams,
41
+ EmailSendResponse,
42
+ EmailsCursorIDPage,
43
+ } from './resources/email/email';
35
44
  import {
36
45
  PushNotificationEnableResponse,
37
46
  PushNotificationIdentifyParams,
@@ -476,7 +485,7 @@ export class Hercules {
476
485
  loggerFor(this).info(`${responseInfo} - ${retryMessage}`);
477
486
 
478
487
  const errText = await response.text().catch((err: any) => castToError(err).message);
479
- const errJSON = safeJSON(errText);
488
+ const errJSON = safeJSON(errText) as any;
480
489
  const errMessage = errJSON ? undefined : errText;
481
490
 
482
491
  loggerFor(this).debug(
@@ -787,6 +796,11 @@ export class Hercules {
787
796
  * and SSL status.
788
797
  */
789
798
  domains: API.Domains = new API.Domains(this);
799
+ /**
800
+ * Send transactional emails, send batch emails, and retrieve sent email
801
+ * history with delivery status tracking.
802
+ */
803
+ email: API.EmailResource = new API.EmailResource(this);
790
804
  /**
791
805
  * Upload, retrieve, and list files and media associated with a website.
792
806
  * Upload is a two-step process: first call create to get an upload URL,
@@ -800,6 +814,7 @@ export class Hercules {
800
814
  Hercules.Commerce = Commerce;
801
815
  Hercules.Content = Content;
802
816
  Hercules.Domains = Domains;
817
+ Hercules.EmailResource = EmailResource;
803
818
  Hercules.Files = Files;
804
819
  Hercules.PushNotifications = PushNotifications;
805
820
 
@@ -829,6 +844,16 @@ export declare namespace Hercules {
829
844
  type DomainListParams as DomainListParams,
830
845
  };
831
846
 
847
+ export {
848
+ EmailResource as EmailResource,
849
+ type Attachment as Attachment,
850
+ type Email as Email,
851
+ type EmailSendResponse as EmailSendResponse,
852
+ type EmailsCursorIDPage as EmailsCursorIDPage,
853
+ type EmailListParams as EmailListParams,
854
+ type EmailSendParams as EmailSendParams,
855
+ };
856
+
832
857
  export {
833
858
  Files as Files,
834
859
  type File as File,
@@ -0,0 +1,229 @@
1
+ // File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
2
+
3
+ import { APIResource } from '../../core/resource';
4
+ import * as IdentitiesAPI from './identities';
5
+ import {
6
+ Identities,
7
+ IdentitiesCursorIDPage,
8
+ Identity,
9
+ IdentityCreateParams,
10
+ IdentityListParams,
11
+ } from './identities';
12
+ import { APIPromise } from '../../core/api-promise';
13
+ import { CursorIDPage, type CursorIDPageParams, PagePromise } from '../../core/pagination';
14
+ import { RequestOptions } from '../../internal/request-options';
15
+ import { path } from '../../internal/utils/path';
16
+
17
+ /**
18
+ * Send transactional emails, send batch emails, and retrieve sent email
19
+ * history with delivery status tracking.
20
+ */
21
+ export class EmailResource extends APIResource {
22
+ identities: IdentitiesAPI.Identities = new IdentitiesAPI.Identities(this._client);
23
+
24
+ /**
25
+ * Retrieves a paginated list of sent emails. Returns email metadata including
26
+ * delivery status.
27
+ */
28
+ list(
29
+ query: EmailListParams | null | undefined = {},
30
+ options?: RequestOptions,
31
+ ): PagePromise<EmailsCursorIDPage, Email> {
32
+ return this._client.getAPIList('/v1/email', CursorIDPage<Email>, { query, ...options });
33
+ }
34
+
35
+ /**
36
+ * Retrieves a single email by its unique identifier.
37
+ */
38
+ get(emailID: string, options?: RequestOptions): APIPromise<Email> {
39
+ return this._client.get(path`/v1/email/${emailID}`, options);
40
+ }
41
+
42
+ /**
43
+ * Sends a single email. The sender address must be a verified identity for this
44
+ * website.
45
+ */
46
+ send(body: EmailSendParams, options?: RequestOptions): APIPromise<EmailSendResponse> {
47
+ return this._client.post('/v1/email', { body, ...options });
48
+ }
49
+ }
50
+
51
+ export type EmailsCursorIDPage = CursorIDPage<Email>;
52
+
53
+ /**
54
+ * A file attachment
55
+ */
56
+ export interface Attachment {
57
+ /**
58
+ * The Base64-encoded content of the attachment. Max 40MB total per email.
59
+ */
60
+ content: string;
61
+
62
+ /**
63
+ * The name of the attached file
64
+ */
65
+ filename: string;
66
+
67
+ /**
68
+ * The MIME type of the attachment
69
+ */
70
+ content_type?: string;
71
+ }
72
+
73
+ /**
74
+ * A sent email object
75
+ */
76
+ export interface Email {
77
+ /**
78
+ * Unique identifier for the email
79
+ */
80
+ id: string;
81
+
82
+ /**
83
+ * Timestamp when the email was sent
84
+ */
85
+ created_at: string;
86
+
87
+ /**
88
+ * Sender email address
89
+ */
90
+ from: string;
91
+
92
+ /**
93
+ * Email subject line
94
+ */
95
+ subject: string;
96
+
97
+ /**
98
+ * Recipient email addresses
99
+ */
100
+ to: Array<string>;
101
+
102
+ /**
103
+ * Blind carbon copy recipients
104
+ */
105
+ bcc?: Array<string> | null;
106
+
107
+ /**
108
+ * Carbon copy recipients
109
+ */
110
+ cc?: Array<string> | null;
111
+
112
+ /**
113
+ * The most recent event for this email
114
+ */
115
+ last_event?: 'sent' | 'delivered' | 'opened' | 'clicked' | 'bounced' | 'complained' | null;
116
+
117
+ /**
118
+ * Reply-to addresses
119
+ */
120
+ reply_to?: Array<string> | null;
121
+ }
122
+
123
+ /**
124
+ * Response after sending an email
125
+ */
126
+ export interface EmailSendResponse {
127
+ /**
128
+ * The unique identifier of the sent email
129
+ */
130
+ id: string;
131
+ }
132
+
133
+ export interface EmailListParams extends CursorIDPageParams {}
134
+
135
+ export interface EmailSendParams {
136
+ /**
137
+ * Sender email address. To include a friendly name, use the format 'Your Name
138
+ * <sender@domain.com>'.
139
+ */
140
+ from: string;
141
+
142
+ /**
143
+ * Email subject line
144
+ */
145
+ subject: string;
146
+
147
+ /**
148
+ * Recipient email address(es). Maximum 50.
149
+ */
150
+ to: string | Array<string>;
151
+
152
+ /**
153
+ * List of file attachments. Total size must not exceed 40MB after Base64 encoding.
154
+ */
155
+ attachments?: Array<Attachment>;
156
+
157
+ /**
158
+ * Blind carbon copy recipient(s)
159
+ */
160
+ bcc?: string | Array<string>;
161
+
162
+ /**
163
+ * Carbon copy recipient(s)
164
+ */
165
+ cc?: string | Array<string>;
166
+
167
+ /**
168
+ * Custom email headers as key-value pairs
169
+ */
170
+ headers?: { [key: string]: string };
171
+
172
+ /**
173
+ * The HTML version of the message body
174
+ */
175
+ html?: string;
176
+
177
+ /**
178
+ * Reply-to email address(es)
179
+ */
180
+ reply_to?: string | Array<string>;
181
+
182
+ /**
183
+ * Custom metadata tags for the email (max 50)
184
+ */
185
+ tags?: Array<EmailSendParams.Tag>;
186
+
187
+ /**
188
+ * The plain text version of the message body
189
+ */
190
+ text?: string;
191
+ }
192
+
193
+ export namespace EmailSendParams {
194
+ /**
195
+ * A custom metadata tag for the email
196
+ */
197
+ export interface Tag {
198
+ /**
199
+ * The name of the tag
200
+ */
201
+ name: string;
202
+
203
+ /**
204
+ * The value of the tag
205
+ */
206
+ value: string;
207
+ }
208
+ }
209
+
210
+ EmailResource.Identities = Identities;
211
+
212
+ export declare namespace EmailResource {
213
+ export {
214
+ type Attachment as Attachment,
215
+ type Email as Email,
216
+ type EmailSendResponse as EmailSendResponse,
217
+ type EmailsCursorIDPage as EmailsCursorIDPage,
218
+ type EmailListParams as EmailListParams,
219
+ type EmailSendParams as EmailSendParams,
220
+ };
221
+
222
+ export {
223
+ Identities as Identities,
224
+ type Identity as Identity,
225
+ type IdentitiesCursorIDPage as IdentitiesCursorIDPage,
226
+ type IdentityCreateParams as IdentityCreateParams,
227
+ type IdentityListParams as IdentityListParams,
228
+ };
229
+ }
@@ -0,0 +1,151 @@
1
+ // File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
2
+
3
+ import { APIResource } from '../../core/resource';
4
+ import { APIPromise } from '../../core/api-promise';
5
+ import { CursorIDPage, type CursorIDPageParams, PagePromise } from '../../core/pagination';
6
+ import { buildHeaders } from '../../internal/headers';
7
+ import { RequestOptions } from '../../internal/request-options';
8
+ import { path } from '../../internal/utils/path';
9
+
10
+ export class Identities extends APIResource {
11
+ /**
12
+ * Creates a new sender identity for email verification. For email identities, a
13
+ * verification email is sent. For domain identities, DNS records are returned that
14
+ * must be configured to verify ownership.
15
+ */
16
+ create(body: IdentityCreateParams, options?: RequestOptions): APIPromise<Identity> {
17
+ return this._client.post('/v1/email/identities', { body, ...options });
18
+ }
19
+
20
+ /**
21
+ * Retrieves a paginated list of sender identities (email addresses and domains)
22
+ * configured for this website.
23
+ */
24
+ list(
25
+ query: IdentityListParams | null | undefined = {},
26
+ options?: RequestOptions,
27
+ ): PagePromise<IdentitiesCursorIDPage, Identity> {
28
+ return this._client.getAPIList('/v1/email/identities', CursorIDPage<Identity>, { query, ...options });
29
+ }
30
+
31
+ /**
32
+ * Permanently deletes a sender identity. Emails can no longer be sent from this
33
+ * address or domain after deletion.
34
+ */
35
+ delete(identityID: string, options?: RequestOptions): APIPromise<void> {
36
+ return this._client.delete(path`/v1/email/identities/${identityID}`, {
37
+ ...options,
38
+ headers: buildHeaders([{ Accept: '*/*' }, options?.headers]),
39
+ });
40
+ }
41
+
42
+ /**
43
+ * Retrieves a sender identity by ID. Returns the identity with its current
44
+ * verification status and any required DNS records.
45
+ */
46
+ get(identityID: string, options?: RequestOptions): APIPromise<Identity> {
47
+ return this._client.get(path`/v1/email/identities/${identityID}`, options);
48
+ }
49
+
50
+ /**
51
+ * Triggers a manual recheck of the identity's verification status against AWS SES.
52
+ * Returns the identity with its updated status.
53
+ */
54
+ verify(identityID: string, options?: RequestOptions): APIPromise<Identity> {
55
+ return this._client.post(path`/v1/email/identities/${identityID}/verify`, options);
56
+ }
57
+ }
58
+
59
+ export type IdentitiesCursorIDPage = CursorIDPage<Identity>;
60
+
61
+ /**
62
+ * A verified sender identity (email address or domain) for sending emails
63
+ */
64
+ export interface Identity {
65
+ /**
66
+ * Unique identifier for the identity
67
+ */
68
+ id: string;
69
+
70
+ /**
71
+ * Timestamp when the identity was created
72
+ */
73
+ created_at: string;
74
+
75
+ /**
76
+ * The verification status of the identity
77
+ */
78
+ status: 'pending' | 'verified' | 'failed';
79
+
80
+ /**
81
+ * The type of identity: 'email' for a single email address, 'domain' for an entire
82
+ * domain
83
+ */
84
+ type: 'email' | 'domain';
85
+
86
+ /**
87
+ * The email address or domain name
88
+ */
89
+ value: string;
90
+
91
+ /**
92
+ * DNS records required for verification (only present for domain identities)
93
+ */
94
+ verification_records?: Array<Identity.VerificationRecord> | null;
95
+ }
96
+
97
+ export namespace Identity {
98
+ /**
99
+ * A DNS record required for domain verification
100
+ */
101
+ export interface VerificationRecord {
102
+ /**
103
+ * The DNS record name/host
104
+ */
105
+ name: string;
106
+
107
+ /**
108
+ * Verification status of this individual record
109
+ */
110
+ status: 'pending' | 'verified' | 'failed';
111
+
112
+ /**
113
+ * The DNS record type
114
+ */
115
+ type: 'TXT' | 'CNAME' | 'MX';
116
+
117
+ /**
118
+ * The DNS record value
119
+ */
120
+ value: string;
121
+
122
+ /**
123
+ * The DNS record priority (for MX records)
124
+ */
125
+ priority?: number;
126
+ }
127
+ }
128
+
129
+ export interface IdentityCreateParams {
130
+ /**
131
+ * The type of identity to create. Use 'email' for a single address or 'domain' for
132
+ * an entire domain.
133
+ */
134
+ type: 'email' | 'domain';
135
+
136
+ /**
137
+ * The email address or domain name to verify
138
+ */
139
+ value: string;
140
+ }
141
+
142
+ export interface IdentityListParams extends CursorIDPageParams {}
143
+
144
+ export declare namespace Identities {
145
+ export {
146
+ type Identity as Identity,
147
+ type IdentitiesCursorIDPage as IdentitiesCursorIDPage,
148
+ type IdentityCreateParams as IdentityCreateParams,
149
+ type IdentityListParams as IdentityListParams,
150
+ };
151
+ }
@@ -0,0 +1,18 @@
1
+ // File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
2
+
3
+ export {
4
+ EmailResource,
5
+ type Attachment,
6
+ type Email,
7
+ type EmailSendResponse,
8
+ type EmailListParams,
9
+ type EmailSendParams,
10
+ type EmailsCursorIDPage,
11
+ } from './email';
12
+ export {
13
+ Identities,
14
+ type Identity,
15
+ type IdentityCreateParams,
16
+ type IdentityListParams,
17
+ type IdentitiesCursorIDPage,
18
+ } from './identities';
@@ -0,0 +1,3 @@
1
+ // File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
2
+
3
+ export * from './email/index';
@@ -12,6 +12,15 @@ export {
12
12
  } from './commerce/commerce';
13
13
  export { Content } from './content/content';
14
14
  export { Domains, type Domain, type DomainListParams, type DomainsCursorIDPage } from './domains';
15
+ export {
16
+ EmailResource,
17
+ type Attachment,
18
+ type Email,
19
+ type EmailSendResponse,
20
+ type EmailListParams,
21
+ type EmailSendParams,
22
+ type EmailsCursorIDPage,
23
+ } from './email/email';
15
24
  export { Files, type File, type Upload, type FileListParams, type FilesCursorIDPage } from './files';
16
25
  export {
17
26
  PushNotifications,
package/src/version.ts CHANGED
@@ -1 +1 @@
1
- export const VERSION = '1.14.2'; // x-release-please-version
1
+ export const VERSION = '1.14.3'; // x-release-please-version
package/version.d.mts CHANGED
@@ -1,2 +1,2 @@
1
- export declare const VERSION = "1.14.2";
1
+ export declare const VERSION = "1.14.3";
2
2
  //# sourceMappingURL=version.d.mts.map
package/version.d.ts CHANGED
@@ -1,2 +1,2 @@
1
- export declare const VERSION = "1.14.2";
1
+ export declare const VERSION = "1.14.3";
2
2
  //# sourceMappingURL=version.d.ts.map
package/version.js CHANGED
@@ -1,5 +1,5 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.VERSION = void 0;
4
- exports.VERSION = '1.14.2'; // x-release-please-version
4
+ exports.VERSION = '1.14.3'; // x-release-please-version
5
5
  //# sourceMappingURL=version.js.map
package/version.mjs CHANGED
@@ -1,2 +1,2 @@
1
- export const VERSION = '1.14.2'; // x-release-please-version
1
+ export const VERSION = '1.14.3'; // x-release-please-version
2
2
  //# sourceMappingURL=version.mjs.map