@usehercules/sdk 1.14.1 → 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 (163) hide show
  1. package/CHANGELOG.md +47 -0
  2. package/README.md +9 -0
  3. package/client.d.mts +13 -4
  4. package/client.d.mts.map +1 -1
  5. package/client.d.ts +13 -4
  6. package/client.d.ts.map +1 -1
  7. package/client.js +21 -5
  8. package/client.js.map +1 -1
  9. package/client.mjs +21 -5
  10. package/client.mjs.map +1 -1
  11. package/internal/parse.d.mts.map +1 -1
  12. package/internal/parse.d.ts.map +1 -1
  13. package/internal/parse.js +5 -0
  14. package/internal/parse.js.map +1 -1
  15. package/internal/parse.mjs +5 -0
  16. package/internal/parse.mjs.map +1 -1
  17. package/package.json +1 -1
  18. package/resources/content/{models/models.d.mts → collections/collections.d.mts} +88 -87
  19. package/resources/content/collections/collections.d.mts.map +1 -0
  20. package/resources/content/{models/models.d.ts → collections/collections.d.ts} +88 -87
  21. package/resources/content/collections/collections.d.ts.map +1 -0
  22. package/resources/content/collections/collections.js +58 -0
  23. package/resources/content/collections/collections.js.map +1 -0
  24. package/resources/content/collections/collections.mjs +53 -0
  25. package/resources/content/collections/collections.mjs.map +1 -0
  26. package/resources/content/{models → collections}/fields.d.mts +23 -22
  27. package/resources/content/collections/fields.d.mts.map +1 -0
  28. package/resources/content/{models → collections}/fields.d.ts +23 -22
  29. package/resources/content/collections/fields.d.ts.map +1 -0
  30. package/resources/content/collections/fields.js +41 -0
  31. package/resources/content/collections/fields.js.map +1 -0
  32. package/resources/content/collections/fields.mjs +37 -0
  33. package/resources/content/collections/fields.mjs.map +1 -0
  34. package/resources/content/collections/index.d.mts +3 -0
  35. package/resources/content/collections/index.d.mts.map +1 -0
  36. package/resources/content/collections/index.d.ts +3 -0
  37. package/resources/content/collections/index.d.ts.map +1 -0
  38. package/resources/content/{models → collections}/index.js +3 -3
  39. package/resources/content/collections/index.js.map +1 -0
  40. package/resources/content/{models → collections}/index.mjs +1 -1
  41. package/resources/content/collections/index.mjs.map +1 -0
  42. package/resources/content/collections.d.mts +2 -0
  43. package/resources/content/collections.d.mts.map +1 -0
  44. package/resources/content/collections.d.ts +2 -0
  45. package/resources/content/collections.d.ts.map +1 -0
  46. package/resources/content/{models.js → collections.js} +2 -2
  47. package/resources/content/collections.js.map +1 -0
  48. package/resources/content/collections.mjs +3 -0
  49. package/resources/content/collections.mjs.map +1 -0
  50. package/resources/content/content.d.mts +4 -4
  51. package/resources/content/content.d.mts.map +1 -1
  52. package/resources/content/content.d.ts +4 -4
  53. package/resources/content/content.d.ts.map +1 -1
  54. package/resources/content/content.js +4 -4
  55. package/resources/content/content.js.map +1 -1
  56. package/resources/content/content.mjs +4 -4
  57. package/resources/content/content.mjs.map +1 -1
  58. package/resources/content/entries.d.mts +18 -18
  59. package/resources/content/entries.d.mts.map +1 -1
  60. package/resources/content/entries.d.ts +18 -18
  61. package/resources/content/entries.d.ts.map +1 -1
  62. package/resources/content/entries.js +2 -2
  63. package/resources/content/entries.mjs +2 -2
  64. package/resources/content/index.d.mts +1 -1
  65. package/resources/content/index.d.mts.map +1 -1
  66. package/resources/content/index.d.ts +1 -1
  67. package/resources/content/index.d.ts.map +1 -1
  68. package/resources/content/index.js +3 -3
  69. package/resources/content/index.js.map +1 -1
  70. package/resources/content/index.mjs +1 -1
  71. package/resources/content/index.mjs.map +1 -1
  72. package/resources/email/email.d.mts +166 -0
  73. package/resources/email/email.d.mts.map +1 -0
  74. package/resources/email/email.d.ts +166 -0
  75. package/resources/email/email.d.ts.map +1 -0
  76. package/resources/email/email.js +43 -0
  77. package/resources/email/email.js.map +1 -0
  78. package/resources/email/email.mjs +38 -0
  79. package/resources/email/email.mjs.map +1 -0
  80. package/resources/email/identities.d.mts +107 -0
  81. package/resources/email/identities.d.mts.map +1 -0
  82. package/resources/email/identities.d.ts +107 -0
  83. package/resources/email/identities.d.ts.map +1 -0
  84. package/resources/email/identities.js +51 -0
  85. package/resources/email/identities.js.map +1 -0
  86. package/resources/email/identities.mjs +47 -0
  87. package/resources/email/identities.mjs.map +1 -0
  88. package/resources/email/index.d.mts +3 -0
  89. package/resources/email/index.d.mts.map +1 -0
  90. package/resources/email/index.d.ts +3 -0
  91. package/resources/email/index.d.ts.map +1 -0
  92. package/resources/email/index.js +9 -0
  93. package/resources/email/index.js.map +1 -0
  94. package/resources/email/index.mjs +4 -0
  95. package/resources/email/index.mjs.map +1 -0
  96. package/resources/email.d.mts +2 -0
  97. package/resources/email.d.mts.map +1 -0
  98. package/resources/email.d.ts +2 -0
  99. package/resources/email.d.ts.map +1 -0
  100. package/resources/email.js +6 -0
  101. package/resources/email.js.map +1 -0
  102. package/resources/{content/models.mjs → email.mjs} +2 -2
  103. package/resources/email.mjs.map +1 -0
  104. package/resources/files.d.mts +8 -6
  105. package/resources/files.d.mts.map +1 -1
  106. package/resources/files.d.ts +8 -6
  107. package/resources/files.d.ts.map +1 -1
  108. package/resources/files.js +3 -2
  109. package/resources/files.js.map +1 -1
  110. package/resources/files.mjs +3 -2
  111. package/resources/files.mjs.map +1 -1
  112. package/resources/index.d.mts +1 -0
  113. package/resources/index.d.mts.map +1 -1
  114. package/resources/index.d.ts +1 -0
  115. package/resources/index.d.ts.map +1 -1
  116. package/resources/index.js +3 -1
  117. package/resources/index.js.map +1 -1
  118. package/resources/index.mjs +1 -0
  119. package/resources/index.mjs.map +1 -1
  120. package/src/client.ts +46 -8
  121. package/src/internal/parse.ts +6 -0
  122. package/src/resources/content/{models/models.ts → collections/collections.ts} +112 -108
  123. package/src/resources/content/{models → collections}/fields.ts +39 -27
  124. package/src/resources/content/{models → collections}/index.ts +8 -8
  125. package/src/resources/content/collections.ts +3 -0
  126. package/src/resources/content/content.ts +16 -16
  127. package/src/resources/content/entries.ts +20 -20
  128. package/src/resources/content/index.ts +9 -9
  129. package/src/resources/email/email.ts +229 -0
  130. package/src/resources/email/identities.ts +151 -0
  131. package/src/resources/email/index.ts +18 -0
  132. package/src/resources/{content/models.ts → email.ts} +1 -1
  133. package/src/resources/files.ts +8 -6
  134. package/src/resources/index.ts +9 -0
  135. package/src/version.ts +1 -1
  136. package/version.d.mts +1 -1
  137. package/version.d.ts +1 -1
  138. package/version.js +1 -1
  139. package/version.mjs +1 -1
  140. package/resources/content/models/fields.d.mts.map +0 -1
  141. package/resources/content/models/fields.d.ts.map +0 -1
  142. package/resources/content/models/fields.js +0 -37
  143. package/resources/content/models/fields.js.map +0 -1
  144. package/resources/content/models/fields.mjs +0 -33
  145. package/resources/content/models/fields.mjs.map +0 -1
  146. package/resources/content/models/index.d.mts +0 -3
  147. package/resources/content/models/index.d.mts.map +0 -1
  148. package/resources/content/models/index.d.ts +0 -3
  149. package/resources/content/models/index.d.ts.map +0 -1
  150. package/resources/content/models/index.js.map +0 -1
  151. package/resources/content/models/index.mjs.map +0 -1
  152. package/resources/content/models/models.d.mts.map +0 -1
  153. package/resources/content/models/models.d.ts.map +0 -1
  154. package/resources/content/models/models.js +0 -54
  155. package/resources/content/models/models.js.map +0 -1
  156. package/resources/content/models/models.mjs +0 -49
  157. package/resources/content/models/models.mjs.map +0 -1
  158. package/resources/content/models.d.mts +0 -2
  159. package/resources/content/models.d.mts.map +0 -1
  160. package/resources/content/models.d.ts +0 -2
  161. package/resources/content/models.d.ts.map +0 -1
  162. package/resources/content/models.js.map +0 -1
  163. package/resources/content/models.mjs.map +0 -1
@@ -0,0 +1,166 @@
1
+ import { APIResource } from "../../core/resource.js";
2
+ import * as IdentitiesAPI from "./identities.js";
3
+ import { Identities, IdentitiesCursorIDPage, Identity, IdentityCreateParams, IdentityListParams } from "./identities.js";
4
+ import { APIPromise } from "../../core/api-promise.js";
5
+ import { CursorIDPage, type CursorIDPageParams, PagePromise } from "../../core/pagination.js";
6
+ import { RequestOptions } from "../../internal/request-options.js";
7
+ /**
8
+ * Send transactional emails, send batch emails, and retrieve sent email
9
+ * history with delivery status tracking.
10
+ */
11
+ export declare class EmailResource extends APIResource {
12
+ identities: IdentitiesAPI.Identities;
13
+ /**
14
+ * Retrieves a paginated list of sent emails. Returns email metadata including
15
+ * delivery status.
16
+ */
17
+ list(query?: EmailListParams | null | undefined, options?: RequestOptions): PagePromise<EmailsCursorIDPage, Email>;
18
+ /**
19
+ * Retrieves a single email by its unique identifier.
20
+ */
21
+ get(emailID: string, options?: RequestOptions): APIPromise<Email>;
22
+ /**
23
+ * Sends a single email. The sender address must be a verified identity for this
24
+ * website.
25
+ */
26
+ send(body: EmailSendParams, options?: RequestOptions): APIPromise<EmailSendResponse>;
27
+ }
28
+ export type EmailsCursorIDPage = CursorIDPage<Email>;
29
+ /**
30
+ * A file attachment
31
+ */
32
+ export interface Attachment {
33
+ /**
34
+ * The Base64-encoded content of the attachment. Max 40MB total per email.
35
+ */
36
+ content: string;
37
+ /**
38
+ * The name of the attached file
39
+ */
40
+ filename: string;
41
+ /**
42
+ * The MIME type of the attachment
43
+ */
44
+ content_type?: string;
45
+ }
46
+ /**
47
+ * A sent email object
48
+ */
49
+ export interface Email {
50
+ /**
51
+ * Unique identifier for the email
52
+ */
53
+ id: string;
54
+ /**
55
+ * Timestamp when the email was sent
56
+ */
57
+ created_at: string;
58
+ /**
59
+ * Sender email address
60
+ */
61
+ from: string;
62
+ /**
63
+ * Email subject line
64
+ */
65
+ subject: string;
66
+ /**
67
+ * Recipient email addresses
68
+ */
69
+ to: Array<string>;
70
+ /**
71
+ * Blind carbon copy recipients
72
+ */
73
+ bcc?: Array<string> | null;
74
+ /**
75
+ * Carbon copy recipients
76
+ */
77
+ cc?: Array<string> | null;
78
+ /**
79
+ * The most recent event for this email
80
+ */
81
+ last_event?: 'sent' | 'delivered' | 'opened' | 'clicked' | 'bounced' | 'complained' | null;
82
+ /**
83
+ * Reply-to addresses
84
+ */
85
+ reply_to?: Array<string> | null;
86
+ }
87
+ /**
88
+ * Response after sending an email
89
+ */
90
+ export interface EmailSendResponse {
91
+ /**
92
+ * The unique identifier of the sent email
93
+ */
94
+ id: string;
95
+ }
96
+ export interface EmailListParams extends CursorIDPageParams {
97
+ }
98
+ export interface EmailSendParams {
99
+ /**
100
+ * Sender email address. To include a friendly name, use the format 'Your Name
101
+ * <sender@domain.com>'.
102
+ */
103
+ from: string;
104
+ /**
105
+ * Email subject line
106
+ */
107
+ subject: string;
108
+ /**
109
+ * Recipient email address(es). Maximum 50.
110
+ */
111
+ to: string | Array<string>;
112
+ /**
113
+ * List of file attachments. Total size must not exceed 40MB after Base64 encoding.
114
+ */
115
+ attachments?: Array<Attachment>;
116
+ /**
117
+ * Blind carbon copy recipient(s)
118
+ */
119
+ bcc?: string | Array<string>;
120
+ /**
121
+ * Carbon copy recipient(s)
122
+ */
123
+ cc?: string | Array<string>;
124
+ /**
125
+ * Custom email headers as key-value pairs
126
+ */
127
+ headers?: {
128
+ [key: string]: string;
129
+ };
130
+ /**
131
+ * The HTML version of the message body
132
+ */
133
+ html?: string;
134
+ /**
135
+ * Reply-to email address(es)
136
+ */
137
+ reply_to?: string | Array<string>;
138
+ /**
139
+ * Custom metadata tags for the email (max 50)
140
+ */
141
+ tags?: Array<EmailSendParams.Tag>;
142
+ /**
143
+ * The plain text version of the message body
144
+ */
145
+ text?: string;
146
+ }
147
+ export declare namespace EmailSendParams {
148
+ /**
149
+ * A custom metadata tag for the email
150
+ */
151
+ interface Tag {
152
+ /**
153
+ * The name of the tag
154
+ */
155
+ name: string;
156
+ /**
157
+ * The value of the tag
158
+ */
159
+ value: string;
160
+ }
161
+ }
162
+ export declare namespace EmailResource {
163
+ export { type Attachment as Attachment, type Email as Email, type EmailSendResponse as EmailSendResponse, type EmailsCursorIDPage as EmailsCursorIDPage, type EmailListParams as EmailListParams, type EmailSendParams as EmailSendParams, };
164
+ export { Identities as Identities, type Identity as Identity, type IdentitiesCursorIDPage as IdentitiesCursorIDPage, type IdentityCreateParams as IdentityCreateParams, type IdentityListParams as IdentityListParams, };
165
+ }
166
+ //# sourceMappingURL=email.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"email.d.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;;OAEG;IACH,IAAI,CAAC,EAAE,MAAM,CAAC;CACf;AAED,yBAAiB,eAAe,CAAC;IAC/B;;OAEG;IACH,UAAiB,GAAG;QAClB;;WAEG;QACH,IAAI,EAAE,MAAM,CAAC;QAEb;;WAEG;QACH,KAAK,EAAE,MAAM,CAAC;KACf;CACF;AAID,MAAM,CAAC,OAAO,WAAW,aAAa,CAAC;IACrC,OAAO,EACL,KAAK,UAAU,IAAI,UAAU,EAC7B,KAAK,KAAK,IAAI,KAAK,EACnB,KAAK,iBAAiB,IAAI,iBAAiB,EAC3C,KAAK,kBAAkB,IAAI,kBAAkB,EAC7C,KAAK,eAAe,IAAI,eAAe,EACvC,KAAK,eAAe,IAAI,eAAe,GACxC,CAAC;IAEF,OAAO,EACL,UAAU,IAAI,UAAU,EACxB,KAAK,QAAQ,IAAI,QAAQ,EACzB,KAAK,sBAAsB,IAAI,sBAAsB,EACrD,KAAK,oBAAoB,IAAI,oBAAoB,EACjD,KAAK,kBAAkB,IAAI,kBAAkB,GAC9C,CAAC;CACH"}
@@ -0,0 +1,43 @@
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
+ exports.EmailResource = void 0;
5
+ const tslib_1 = require("../../internal/tslib.js");
6
+ const resource_1 = require("../../core/resource.js");
7
+ const IdentitiesAPI = tslib_1.__importStar(require("./identities.js"));
8
+ const identities_1 = require("./identities.js");
9
+ const pagination_1 = require("../../core/pagination.js");
10
+ const path_1 = require("../../internal/utils/path.js");
11
+ /**
12
+ * Send transactional emails, send batch emails, and retrieve sent email
13
+ * history with delivery status tracking.
14
+ */
15
+ class EmailResource extends resource_1.APIResource {
16
+ constructor() {
17
+ super(...arguments);
18
+ this.identities = new IdentitiesAPI.Identities(this._client);
19
+ }
20
+ /**
21
+ * Retrieves a paginated list of sent emails. Returns email metadata including
22
+ * delivery status.
23
+ */
24
+ list(query = {}, options) {
25
+ return this._client.getAPIList('/v1/email', (pagination_1.CursorIDPage), { query, ...options });
26
+ }
27
+ /**
28
+ * Retrieves a single email by its unique identifier.
29
+ */
30
+ get(emailID, options) {
31
+ return this._client.get((0, path_1.path) `/v1/email/${emailID}`, options);
32
+ }
33
+ /**
34
+ * Sends a single email. The sender address must be a verified identity for this
35
+ * website.
36
+ */
37
+ send(body, options) {
38
+ return this._client.post('/v1/email', { body, ...options });
39
+ }
40
+ }
41
+ exports.EmailResource = EmailResource;
42
+ EmailResource.Identities = identities_1.Identities;
43
+ //# sourceMappingURL=email.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"email.js","sourceRoot":"","sources":["../../src/resources/email/email.ts"],"names":[],"mappings":";AAAA,sFAAsF;;;;AAEtF,qDAAkD;AAClD,uEAA8C;AAC9C,gDAMsB;AAEtB,yDAA2F;AAE3F,uDAAiD;AAEjD;;;GAGG;AACH,MAAa,aAAc,SAAQ,sBAAW;IAA9C;;QACE,eAAU,GAA6B,IAAI,aAAa,CAAC,UAAU,CAAC,IAAI,CAAC,OAAO,CAAC,CAAC;IA2BpF,CAAC;IAzBC;;;OAGG;IACH,IAAI,CACF,QAA4C,EAAE,EAC9C,OAAwB;QAExB,OAAO,IAAI,CAAC,OAAO,CAAC,UAAU,CAAC,WAAW,EAAE,CAAA,yBAAmB,CAAA,EAAE,EAAE,KAAK,EAAE,GAAG,OAAO,EAAE,CAAC,CAAC;IAC1F,CAAC;IAED;;OAEG;IACH,GAAG,CAAC,OAAe,EAAE,OAAwB;QAC3C,OAAO,IAAI,CAAC,OAAO,CAAC,GAAG,CAAC,IAAA,WAAI,EAAA,aAAa,OAAO,EAAE,EAAE,OAAO,CAAC,CAAC;IAC/D,CAAC;IAED;;;OAGG;IACH,IAAI,CAAC,IAAqB,EAAE,OAAwB;QAClD,OAAO,IAAI,CAAC,OAAO,CAAC,IAAI,CAAC,WAAW,EAAE,EAAE,IAAI,EAAE,GAAG,OAAO,EAAE,CAAC,CAAC;IAC9D,CAAC;CACF;AA5BD,sCA4BC;AAiKD,aAAa,CAAC,UAAU,GAAG,uBAAU,CAAC"}
@@ -0,0 +1,38 @@
1
+ // File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
2
+ import { APIResource } from "../../core/resource.mjs";
3
+ import * as IdentitiesAPI from "./identities.mjs";
4
+ import { Identities, } from "./identities.mjs";
5
+ import { CursorIDPage } from "../../core/pagination.mjs";
6
+ import { path } from "../../internal/utils/path.mjs";
7
+ /**
8
+ * Send transactional emails, send batch emails, and retrieve sent email
9
+ * history with delivery status tracking.
10
+ */
11
+ export class EmailResource extends APIResource {
12
+ constructor() {
13
+ super(...arguments);
14
+ this.identities = new IdentitiesAPI.Identities(this._client);
15
+ }
16
+ /**
17
+ * Retrieves a paginated list of sent emails. Returns email metadata including
18
+ * delivery status.
19
+ */
20
+ list(query = {}, options) {
21
+ return this._client.getAPIList('/v1/email', (CursorIDPage), { query, ...options });
22
+ }
23
+ /**
24
+ * Retrieves a single email by its unique identifier.
25
+ */
26
+ get(emailID, options) {
27
+ return this._client.get(path `/v1/email/${emailID}`, options);
28
+ }
29
+ /**
30
+ * Sends a single email. The sender address must be a verified identity for this
31
+ * website.
32
+ */
33
+ send(body, options) {
34
+ return this._client.post('/v1/email', { body, ...options });
35
+ }
36
+ }
37
+ EmailResource.Identities = Identities;
38
+ //# sourceMappingURL=email.mjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"email.mjs","sourceRoot":"","sources":["../../src/resources/email/email.ts"],"names":[],"mappings":"AAAA,sFAAsF;OAE/E,EAAE,WAAW,EAAE;OACf,KAAK,aAAa;OAClB,EACL,UAAU,GAKX;OAEM,EAAE,YAAY,EAAwC;OAEtD,EAAE,IAAI,EAAE;AAEf;;;GAGG;AACH,MAAM,OAAO,aAAc,SAAQ,WAAW;IAA9C;;QACE,eAAU,GAA6B,IAAI,aAAa,CAAC,UAAU,CAAC,IAAI,CAAC,OAAO,CAAC,CAAC;IA2BpF,CAAC;IAzBC;;;OAGG;IACH,IAAI,CACF,QAA4C,EAAE,EAC9C,OAAwB;QAExB,OAAO,IAAI,CAAC,OAAO,CAAC,UAAU,CAAC,WAAW,EAAE,CAAA,YAAmB,CAAA,EAAE,EAAE,KAAK,EAAE,GAAG,OAAO,EAAE,CAAC,CAAC;IAC1F,CAAC;IAED;;OAEG;IACH,GAAG,CAAC,OAAe,EAAE,OAAwB;QAC3C,OAAO,IAAI,CAAC,OAAO,CAAC,GAAG,CAAC,IAAI,CAAA,aAAa,OAAO,EAAE,EAAE,OAAO,CAAC,CAAC;IAC/D,CAAC;IAED;;;OAGG;IACH,IAAI,CAAC,IAAqB,EAAE,OAAwB;QAClD,OAAO,IAAI,CAAC,OAAO,CAAC,IAAI,CAAC,WAAW,EAAE,EAAE,IAAI,EAAE,GAAG,OAAO,EAAE,CAAC,CAAC;IAC9D,CAAC;CACF;AAiKD,aAAa,CAAC,UAAU,GAAG,UAAU,CAAC"}
@@ -0,0 +1,107 @@
1
+ import { APIResource } from "../../core/resource.mjs";
2
+ import { APIPromise } from "../../core/api-promise.mjs";
3
+ import { CursorIDPage, type CursorIDPageParams, PagePromise } from "../../core/pagination.mjs";
4
+ import { RequestOptions } from "../../internal/request-options.mjs";
5
+ export declare class Identities extends APIResource {
6
+ /**
7
+ * Creates a new sender identity for email verification. For email identities, a
8
+ * verification email is sent. For domain identities, DNS records are returned that
9
+ * must be configured to verify ownership.
10
+ */
11
+ create(body: IdentityCreateParams, options?: RequestOptions): APIPromise<Identity>;
12
+ /**
13
+ * Retrieves a paginated list of sender identities (email addresses and domains)
14
+ * configured for this website.
15
+ */
16
+ list(query?: IdentityListParams | null | undefined, options?: RequestOptions): PagePromise<IdentitiesCursorIDPage, Identity>;
17
+ /**
18
+ * Permanently deletes a sender identity. Emails can no longer be sent from this
19
+ * address or domain after deletion.
20
+ */
21
+ delete(identityID: string, options?: RequestOptions): APIPromise<void>;
22
+ /**
23
+ * Retrieves a sender identity by ID. Returns the identity with its current
24
+ * verification status and any required DNS records.
25
+ */
26
+ get(identityID: string, options?: RequestOptions): APIPromise<Identity>;
27
+ /**
28
+ * Triggers a manual recheck of the identity's verification status against AWS SES.
29
+ * Returns the identity with its updated status.
30
+ */
31
+ verify(identityID: string, options?: RequestOptions): APIPromise<Identity>;
32
+ }
33
+ export type IdentitiesCursorIDPage = CursorIDPage<Identity>;
34
+ /**
35
+ * A verified sender identity (email address or domain) for sending emails
36
+ */
37
+ export interface Identity {
38
+ /**
39
+ * Unique identifier for the identity
40
+ */
41
+ id: string;
42
+ /**
43
+ * Timestamp when the identity was created
44
+ */
45
+ created_at: string;
46
+ /**
47
+ * The verification status of the identity
48
+ */
49
+ status: 'pending' | 'verified' | 'failed';
50
+ /**
51
+ * The type of identity: 'email' for a single email address, 'domain' for an entire
52
+ * domain
53
+ */
54
+ type: 'email' | 'domain';
55
+ /**
56
+ * The email address or domain name
57
+ */
58
+ value: string;
59
+ /**
60
+ * DNS records required for verification (only present for domain identities)
61
+ */
62
+ verification_records?: Array<Identity.VerificationRecord> | null;
63
+ }
64
+ export declare namespace Identity {
65
+ /**
66
+ * A DNS record required for domain verification
67
+ */
68
+ interface VerificationRecord {
69
+ /**
70
+ * The DNS record name/host
71
+ */
72
+ name: string;
73
+ /**
74
+ * Verification status of this individual record
75
+ */
76
+ status: 'pending' | 'verified' | 'failed';
77
+ /**
78
+ * The DNS record type
79
+ */
80
+ type: 'TXT' | 'CNAME' | 'MX';
81
+ /**
82
+ * The DNS record value
83
+ */
84
+ value: string;
85
+ /**
86
+ * The DNS record priority (for MX records)
87
+ */
88
+ priority?: number;
89
+ }
90
+ }
91
+ export interface IdentityCreateParams {
92
+ /**
93
+ * The type of identity to create. Use 'email' for a single address or 'domain' for
94
+ * an entire domain.
95
+ */
96
+ type: 'email' | 'domain';
97
+ /**
98
+ * The email address or domain name to verify
99
+ */
100
+ value: string;
101
+ }
102
+ export interface IdentityListParams extends CursorIDPageParams {
103
+ }
104
+ export declare namespace Identities {
105
+ export { type Identity as Identity, type IdentitiesCursorIDPage as IdentitiesCursorIDPage, type IdentityCreateParams as IdentityCreateParams, type IdentityListParams as IdentityListParams, };
106
+ }
107
+ //# sourceMappingURL=identities.d.mts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"identities.d.mts","sourceRoot":"","sources":["../../src/resources/email/identities.ts"],"names":[],"mappings":"OAEO,EAAE,WAAW,EAAE;OACf,EAAE,UAAU,EAAE;OACd,EAAE,YAAY,EAAE,KAAK,kBAAkB,EAAE,WAAW,EAAE;OAEtD,EAAE,cAAc,EAAE;AAGzB,qBAAa,UAAW,SAAQ,WAAW;IACzC;;;;OAIG;IACH,MAAM,CAAC,IAAI,EAAE,oBAAoB,EAAE,OAAO,CAAC,EAAE,cAAc,GAAG,UAAU,CAAC,QAAQ,CAAC;IAIlF;;;OAGG;IACH,IAAI,CACF,KAAK,GAAE,kBAAkB,GAAG,IAAI,GAAG,SAAc,EACjD,OAAO,CAAC,EAAE,cAAc,GACvB,WAAW,CAAC,sBAAsB,EAAE,QAAQ,CAAC;IAIhD;;;OAGG;IACH,MAAM,CAAC,UAAU,EAAE,MAAM,EAAE,OAAO,CAAC,EAAE,cAAc,GAAG,UAAU,CAAC,IAAI,CAAC;IAOtE;;;OAGG;IACH,GAAG,CAAC,UAAU,EAAE,MAAM,EAAE,OAAO,CAAC,EAAE,cAAc,GAAG,UAAU,CAAC,QAAQ,CAAC;IAIvE;;;OAGG;IACH,MAAM,CAAC,UAAU,EAAE,MAAM,EAAE,OAAO,CAAC,EAAE,cAAc,GAAG,UAAU,CAAC,QAAQ,CAAC;CAG3E;AAED,MAAM,MAAM,sBAAsB,GAAG,YAAY,CAAC,QAAQ,CAAC,CAAC;AAE5D;;GAEG;AACH,MAAM,WAAW,QAAQ;IACvB;;OAEG;IACH,EAAE,EAAE,MAAM,CAAC;IAEX;;OAEG;IACH,UAAU,EAAE,MAAM,CAAC;IAEnB;;OAEG;IACH,MAAM,EAAE,SAAS,GAAG,UAAU,GAAG,QAAQ,CAAC;IAE1C;;;OAGG;IACH,IAAI,EAAE,OAAO,GAAG,QAAQ,CAAC;IAEzB;;OAEG;IACH,KAAK,EAAE,MAAM,CAAC;IAEd;;OAEG;IACH,oBAAoB,CAAC,EAAE,KAAK,CAAC,QAAQ,CAAC,kBAAkB,CAAC,GAAG,IAAI,CAAC;CAClE;AAED,yBAAiB,QAAQ,CAAC;IACxB;;OAEG;IACH,UAAiB,kBAAkB;QACjC;;WAEG;QACH,IAAI,EAAE,MAAM,CAAC;QAEb;;WAEG;QACH,MAAM,EAAE,SAAS,GAAG,UAAU,GAAG,QAAQ,CAAC;QAE1C;;WAEG;QACH,IAAI,EAAE,KAAK,GAAG,OAAO,GAAG,IAAI,CAAC;QAE7B;;WAEG;QACH,KAAK,EAAE,MAAM,CAAC;QAEd;;WAEG;QACH,QAAQ,CAAC,EAAE,MAAM,CAAC;KACnB;CACF;AAED,MAAM,WAAW,oBAAoB;IACnC;;;OAGG;IACH,IAAI,EAAE,OAAO,GAAG,QAAQ,CAAC;IAEzB;;OAEG;IACH,KAAK,EAAE,MAAM,CAAC;CACf;AAED,MAAM,WAAW,kBAAmB,SAAQ,kBAAkB;CAAG;AAEjE,MAAM,CAAC,OAAO,WAAW,UAAU,CAAC;IAClC,OAAO,EACL,KAAK,QAAQ,IAAI,QAAQ,EACzB,KAAK,sBAAsB,IAAI,sBAAsB,EACrD,KAAK,oBAAoB,IAAI,oBAAoB,EACjD,KAAK,kBAAkB,IAAI,kBAAkB,GAC9C,CAAC;CACH"}
@@ -0,0 +1,107 @@
1
+ import { APIResource } from "../../core/resource.js";
2
+ import { APIPromise } from "../../core/api-promise.js";
3
+ import { CursorIDPage, type CursorIDPageParams, PagePromise } from "../../core/pagination.js";
4
+ import { RequestOptions } from "../../internal/request-options.js";
5
+ export declare class Identities extends APIResource {
6
+ /**
7
+ * Creates a new sender identity for email verification. For email identities, a
8
+ * verification email is sent. For domain identities, DNS records are returned that
9
+ * must be configured to verify ownership.
10
+ */
11
+ create(body: IdentityCreateParams, options?: RequestOptions): APIPromise<Identity>;
12
+ /**
13
+ * Retrieves a paginated list of sender identities (email addresses and domains)
14
+ * configured for this website.
15
+ */
16
+ list(query?: IdentityListParams | null | undefined, options?: RequestOptions): PagePromise<IdentitiesCursorIDPage, Identity>;
17
+ /**
18
+ * Permanently deletes a sender identity. Emails can no longer be sent from this
19
+ * address or domain after deletion.
20
+ */
21
+ delete(identityID: string, options?: RequestOptions): APIPromise<void>;
22
+ /**
23
+ * Retrieves a sender identity by ID. Returns the identity with its current
24
+ * verification status and any required DNS records.
25
+ */
26
+ get(identityID: string, options?: RequestOptions): APIPromise<Identity>;
27
+ /**
28
+ * Triggers a manual recheck of the identity's verification status against AWS SES.
29
+ * Returns the identity with its updated status.
30
+ */
31
+ verify(identityID: string, options?: RequestOptions): APIPromise<Identity>;
32
+ }
33
+ export type IdentitiesCursorIDPage = CursorIDPage<Identity>;
34
+ /**
35
+ * A verified sender identity (email address or domain) for sending emails
36
+ */
37
+ export interface Identity {
38
+ /**
39
+ * Unique identifier for the identity
40
+ */
41
+ id: string;
42
+ /**
43
+ * Timestamp when the identity was created
44
+ */
45
+ created_at: string;
46
+ /**
47
+ * The verification status of the identity
48
+ */
49
+ status: 'pending' | 'verified' | 'failed';
50
+ /**
51
+ * The type of identity: 'email' for a single email address, 'domain' for an entire
52
+ * domain
53
+ */
54
+ type: 'email' | 'domain';
55
+ /**
56
+ * The email address or domain name
57
+ */
58
+ value: string;
59
+ /**
60
+ * DNS records required for verification (only present for domain identities)
61
+ */
62
+ verification_records?: Array<Identity.VerificationRecord> | null;
63
+ }
64
+ export declare namespace Identity {
65
+ /**
66
+ * A DNS record required for domain verification
67
+ */
68
+ interface VerificationRecord {
69
+ /**
70
+ * The DNS record name/host
71
+ */
72
+ name: string;
73
+ /**
74
+ * Verification status of this individual record
75
+ */
76
+ status: 'pending' | 'verified' | 'failed';
77
+ /**
78
+ * The DNS record type
79
+ */
80
+ type: 'TXT' | 'CNAME' | 'MX';
81
+ /**
82
+ * The DNS record value
83
+ */
84
+ value: string;
85
+ /**
86
+ * The DNS record priority (for MX records)
87
+ */
88
+ priority?: number;
89
+ }
90
+ }
91
+ export interface IdentityCreateParams {
92
+ /**
93
+ * The type of identity to create. Use 'email' for a single address or 'domain' for
94
+ * an entire domain.
95
+ */
96
+ type: 'email' | 'domain';
97
+ /**
98
+ * The email address or domain name to verify
99
+ */
100
+ value: string;
101
+ }
102
+ export interface IdentityListParams extends CursorIDPageParams {
103
+ }
104
+ export declare namespace Identities {
105
+ export { type Identity as Identity, type IdentitiesCursorIDPage as IdentitiesCursorIDPage, type IdentityCreateParams as IdentityCreateParams, type IdentityListParams as IdentityListParams, };
106
+ }
107
+ //# sourceMappingURL=identities.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"identities.d.ts","sourceRoot":"","sources":["../../src/resources/email/identities.ts"],"names":[],"mappings":"OAEO,EAAE,WAAW,EAAE;OACf,EAAE,UAAU,EAAE;OACd,EAAE,YAAY,EAAE,KAAK,kBAAkB,EAAE,WAAW,EAAE;OAEtD,EAAE,cAAc,EAAE;AAGzB,qBAAa,UAAW,SAAQ,WAAW;IACzC;;;;OAIG;IACH,MAAM,CAAC,IAAI,EAAE,oBAAoB,EAAE,OAAO,CAAC,EAAE,cAAc,GAAG,UAAU,CAAC,QAAQ,CAAC;IAIlF;;;OAGG;IACH,IAAI,CACF,KAAK,GAAE,kBAAkB,GAAG,IAAI,GAAG,SAAc,EACjD,OAAO,CAAC,EAAE,cAAc,GACvB,WAAW,CAAC,sBAAsB,EAAE,QAAQ,CAAC;IAIhD;;;OAGG;IACH,MAAM,CAAC,UAAU,EAAE,MAAM,EAAE,OAAO,CAAC,EAAE,cAAc,GAAG,UAAU,CAAC,IAAI,CAAC;IAOtE;;;OAGG;IACH,GAAG,CAAC,UAAU,EAAE,MAAM,EAAE,OAAO,CAAC,EAAE,cAAc,GAAG,UAAU,CAAC,QAAQ,CAAC;IAIvE;;;OAGG;IACH,MAAM,CAAC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BAAkB,IAAI,kBAAkB,GAC9C,CAAC;CACH"}
@@ -0,0 +1,51 @@
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
+ exports.Identities = void 0;
5
+ const resource_1 = require("../../core/resource.js");
6
+ const pagination_1 = require("../../core/pagination.js");
7
+ const headers_1 = require("../../internal/headers.js");
8
+ const path_1 = require("../../internal/utils/path.js");
9
+ class Identities extends resource_1.APIResource {
10
+ /**
11
+ * Creates a new sender identity for email verification. For email identities, a
12
+ * verification email is sent. For domain identities, DNS records are returned that
13
+ * must be configured to verify ownership.
14
+ */
15
+ create(body, options) {
16
+ return this._client.post('/v1/email/identities', { body, ...options });
17
+ }
18
+ /**
19
+ * Retrieves a paginated list of sender identities (email addresses and domains)
20
+ * configured for this website.
21
+ */
22
+ list(query = {}, options) {
23
+ return this._client.getAPIList('/v1/email/identities', (pagination_1.CursorIDPage), { query, ...options });
24
+ }
25
+ /**
26
+ * Permanently deletes a sender identity. Emails can no longer be sent from this
27
+ * address or domain after deletion.
28
+ */
29
+ delete(identityID, options) {
30
+ return this._client.delete((0, path_1.path) `/v1/email/identities/${identityID}`, {
31
+ ...options,
32
+ headers: (0, headers_1.buildHeaders)([{ Accept: '*/*' }, options?.headers]),
33
+ });
34
+ }
35
+ /**
36
+ * Retrieves a sender identity by ID. Returns the identity with its current
37
+ * verification status and any required DNS records.
38
+ */
39
+ get(identityID, options) {
40
+ return this._client.get((0, path_1.path) `/v1/email/identities/${identityID}`, options);
41
+ }
42
+ /**
43
+ * Triggers a manual recheck of the identity's verification status against AWS SES.
44
+ * Returns the identity with its updated status.
45
+ */
46
+ verify(identityID, options) {
47
+ return this._client.post((0, path_1.path) `/v1/email/identities/${identityID}/verify`, options);
48
+ }
49
+ }
50
+ exports.Identities = Identities;
51
+ //# sourceMappingURL=identities.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"identities.js","sourceRoot":"","sources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enAPI spec by Stainless. See CONTRIBUTING.md for details.
2
+ import { APIResource } from "../../core/resource.mjs";
3
+ import { CursorIDPage } from "../../core/pagination.mjs";
4
+ import { buildHeaders } from "../../internal/headers.mjs";
5
+ import { path } from "../../internal/utils/path.mjs";
6
+ export class Identities extends APIResource {
7
+ /**
8
+ * Creates a new sender identity for email verification. For email identities, a
9
+ * verification email is sent. For domain identities, DNS records are returned that
10
+ * must be configured to verify ownership.
11
+ */
12
+ create(body, options) {
13
+ return this._client.post('/v1/email/identities', { body, ...options });
14
+ }
15
+ /**
16
+ * Retrieves a paginated list of sender identities (email addresses and domains)
17
+ * configured for this website.
18
+ */
19
+ list(query = {}, options) {
20
+ return this._client.getAPIList('/v1/email/identities', (CursorIDPage), { query, ...options });
21
+ }
22
+ /**
23
+ * Permanently deletes a sender identity. Emails can no longer be sent from this
24
+ * address or domain after deletion.
25
+ */
26
+ delete(identityID, options) {
27
+ return this._client.delete(path `/v1/email/identities/${identityID}`, {
28
+ ...options,
29
+ headers: buildHeaders([{ Accept: '*/*' }, options?.headers]),
30
+ });
31
+ }
32
+ /**
33
+ * Retrieves a sender identity by ID. Returns the identity with its current
34
+ * verification status and any required DNS records.
35
+ */
36
+ get(identityID, options) {
37
+ return this._client.get(path `/v1/email/identities/${identityID}`, options);
38
+ }
39
+ /**
40
+ * Triggers a manual recheck of the identity's verification status against AWS SES.
41
+ * Returns the identity with its updated status.
42
+ */
43
+ verify(identityID, options) {
44
+ return this._client.post(path `/v1/email/identities/${identityID}/verify`, options);
45
+ }
46
+ }
47
+ //# sourceMappingURL=identities.mjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"identities.mjs","sourceRoot":"","sources":["../../src/resources/email/identities.ts"],"names":[],"mappings":"AAAA,sFAAsF;OAE/E,EAAE,WAAW,EAAE;OAEf,EAAE,YAAY,EAAwC;OACtD,EAAE,YAAY,EAAE;OAEhB,EAAE,IAAI,EAAE;AAEf,MAAM,OAAO,UAAW,SAAQ,WAAW;IACzC;;;;OAIG;IACH,MAAM,CAAC,IAA0B,EAAE,OAAwB;QACzD,OAAO,IAAI,CAAC,OAAO,CAAC,IAAI,CAAC,sBAAsB,EAAE,EAAE,IAAI,EAAE,GAAG,OAAO,EAAE,CAAC,CAAC;IACzE,CAAC;IAED;;;OAGG;IACH,IAAI,CACF,QAA+C,EAAE,EACjD,OAAwB;QAExB,OAAO,IAAI,CAAC,OAAO,CAAC,UAAU,CAAC,sBAAsB,EAAE,CAAA,YAAsB,CAAA,EAAE,EAAE,KAAK,EAAE,GAAG,OAAO,EAAE,CAAC,CAAC;IACxG,CAAC;IAED;;;OAGG;IACH,MAAM,CAAC,UAAkB,EAAE,OAAwB;QACjD,OAAO,IAAI,CAAC,OAAO,CAAC,MAAM,CAAC,IAAI,CAAA,wBAAwB,UAAU,EAAE,EAAE;YACnE,GAAG,OAAO;YACV,OAAO,EAAE,YAAY,CAAC,CAAC,EAAE,MAAM,EAAE,KAAK,EAAE,EAAE,OAAO,EAAE,OAAO,CAAC,CAAC;SAC7D,CAAC,CAAC;IACL,CAAC;IAED;;;OAGG;IACH,GAAG,CAAC,UAAkB,EAAE,OAAwB;QAC9C,OAAO,IAAI,CAAC,OAAO,CAAC,GAAG,CAAC,IAAI,CAAA,wBAAwB,UAAU,EAAE,EAAE,OAAO,CAAC,CAAC;IAC7E,CAAC;IAED;;;OAGG;IACH,MAAM,CAAC,UAAkB,EAAE,OAAwB;QACjD,OAAO,IAAI,CAAC,OAAO,CAAC,IAAI,CAAC,IAAI,CAAA,wBAAwB,UAAU,SAAS,EAAE,OAAO,CAAC,CAAC;IACrF,CAAC;CACF"}
@@ -0,0 +1,3 @@
1
+ export { EmailResource, type Attachment, type Email, type EmailSendResponse, type EmailListParams, type EmailSendParams, type EmailsCursorIDPage, } from "./email.mjs";
2
+ export { Identities, type Identity, type IdentityCreateParams, type IdentityListParams, type IdentitiesCursorIDPage, } from "./identities.mjs";
3
+ //# sourceMappingURL=index.d.mts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.mts","sourceRoot":"","sources":["../../src/resources/email/index.ts"],"names":[],"mappings":"OAEO,EACL,aAAa,EACb,KAAK,UAAU,EACf,KAAK,KAAK,EACV,KAAK,iBAAiB,EACtB,KAAK,eAAe,EACpB,KAAK,eAAe,EACpB,KAAK,kBAAkB,GACxB;OACM,EACL,UAAU,EACV,KAAK,QAAQ,EACb,KAAK,oBAAoB,EACzB,KAAK,kBAAkB,EACvB,KAAK,sBAAsB,GAC5B"}
@@ -0,0 +1,3 @@
1
+ export { EmailResource, type Attachment, type Email, type EmailSendResponse, type EmailListParams, type EmailSendParams, type EmailsCursorIDPage, } from "./email.js";
2
+ export { Identities, type Identity, type IdentityCreateParams, type IdentityListParams, type IdentitiesCursorIDPage, } from "./identities.js";
3
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/resources/email/index.ts"],"names":[],"mappings":"OAEO,EACL,aAAa,EACb,KAAK,UAAU,EACf,KAAK,KAAK,EACV,KAAK,iBAAiB,EACtB,KAAK,eAAe,EACpB,KAAK,eAAe,EACpB,KAAK,kBAAkB,GACxB;OACM,EACL,UAAU,EACV,KAAK,QAAQ,EACb,KAAK,oBAAoB,EACzB,KAAK,kBAAkB,EACvB,KAAK,sBAAsB,GAC5B"}
@@ -0,0 +1,9 @@
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
+ exports.Identities = exports.EmailResource = void 0;
5
+ var email_1 = require("./email.js");
6
+ Object.defineProperty(exports, "EmailResource", { enumerable: true, get: function () { return email_1.EmailResource; } });
7
+ var identities_1 = require("./identities.js");
8
+ Object.defineProperty(exports, "Identities", { enumerable: true, get: function () { return identities_1.Identities; } });
9
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/resources/email/index.ts"],"names":[],"mappings":";AAAA,sFAAsF;;;AAEtF,oCAQiB;AAPf,sGAAA,aAAa,OAAA;AAQf,8CAMsB;AALpB,wGAAA,UAAU,OAAA"}
@@ -0,0 +1,4 @@
1
+ // File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
2
+ export { EmailResource, } from "./email.mjs";
3
+ export { Identities, } from "./identities.mjs";
4
+ //# sourceMappingURL=index.mjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.mjs","sourceRoot":"","sources":["../../src/resources/email/index.ts"],"names":[],"mappings":"AAAA,sFAAsF;OAE/E,EACL,aAAa,GAOd;OACM,EACL,UAAU,GAKX"}
@@ -0,0 +1,2 @@
1
+ export * from "./email/index.mjs";
2
+ //# sourceMappingURL=email.d.mts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"email.d.mts","sourceRoot":"","sources":["../src/resources/email.ts"],"names":[],"mappings":""}
@@ -0,0 +1,2 @@
1
+ export * from "./email/index.js";
2
+ //# sourceMappingURL=email.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"email.d.ts","sourceRoot":"","sources":["../src/resources/email.ts"],"names":[],"mappings":""}