@usehercules/sdk 1.14.3 → 1.14.4

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 (143) hide show
  1. package/CHANGELOG.md +95 -0
  2. package/client.d.mts +3 -3
  3. package/client.d.mts.map +1 -1
  4. package/client.d.ts +3 -3
  5. package/client.d.ts.map +1 -1
  6. package/client.js +15 -7
  7. package/client.js.map +1 -1
  8. package/client.mjs +15 -7
  9. package/client.mjs.map +1 -1
  10. package/internal/tslib.js +17 -17
  11. package/internal/utils/query.d.mts +2 -0
  12. package/internal/utils/query.d.mts.map +1 -0
  13. package/internal/utils/query.d.ts +2 -0
  14. package/internal/utils/query.d.ts.map +1 -0
  15. package/internal/utils/query.js +10 -0
  16. package/internal/utils/query.js.map +1 -0
  17. package/internal/utils/query.mjs +6 -0
  18. package/internal/utils/query.mjs.map +1 -0
  19. package/internal/utils.d.mts +1 -0
  20. package/internal/utils.d.ts +1 -0
  21. package/internal/utils.js +1 -0
  22. package/internal/utils.js.map +1 -1
  23. package/internal/utils.mjs +1 -0
  24. package/package.json +7 -1
  25. package/resources/commerce/coupons.d.mts +1 -1
  26. package/resources/commerce/coupons.d.mts.map +1 -1
  27. package/resources/commerce/coupons.d.ts +1 -1
  28. package/resources/commerce/coupons.d.ts.map +1 -1
  29. package/resources/commerce/coupons.js +1 -1
  30. package/resources/commerce/coupons.js.map +1 -1
  31. package/resources/commerce/coupons.mjs +1 -1
  32. package/resources/commerce/coupons.mjs.map +1 -1
  33. package/resources/commerce/customers.d.mts +3 -3
  34. package/resources/commerce/customers.d.mts.map +1 -1
  35. package/resources/commerce/customers.d.ts +3 -3
  36. package/resources/commerce/customers.d.ts.map +1 -1
  37. package/resources/commerce/customers.js +3 -3
  38. package/resources/commerce/customers.js.map +1 -1
  39. package/resources/commerce/customers.mjs +3 -3
  40. package/resources/commerce/customers.mjs.map +1 -1
  41. package/resources/commerce/features.d.mts +1 -1
  42. package/resources/commerce/features.d.mts.map +1 -1
  43. package/resources/commerce/features.d.ts +1 -1
  44. package/resources/commerce/features.d.ts.map +1 -1
  45. package/resources/commerce/features.js +1 -1
  46. package/resources/commerce/features.js.map +1 -1
  47. package/resources/commerce/features.mjs +1 -1
  48. package/resources/commerce/features.mjs.map +1 -1
  49. package/resources/commerce/products/products.d.mts +1 -1
  50. package/resources/commerce/products/products.d.mts.map +1 -1
  51. package/resources/commerce/products/products.d.ts +1 -1
  52. package/resources/commerce/products/products.d.ts.map +1 -1
  53. package/resources/commerce/products/products.js +1 -1
  54. package/resources/commerce/products/products.js.map +1 -1
  55. package/resources/commerce/products/products.mjs +1 -1
  56. package/resources/commerce/products/products.mjs.map +1 -1
  57. package/resources/content/assets.d.mts +1 -1
  58. package/resources/content/assets.d.mts.map +1 -1
  59. package/resources/content/assets.d.ts +1 -1
  60. package/resources/content/assets.d.ts.map +1 -1
  61. package/resources/content/assets.js +1 -1
  62. package/resources/content/assets.js.map +1 -1
  63. package/resources/content/assets.mjs +1 -1
  64. package/resources/content/assets.mjs.map +1 -1
  65. package/resources/content/collections/collections.d.mts +1 -1
  66. package/resources/content/collections/collections.d.mts.map +1 -1
  67. package/resources/content/collections/collections.d.ts +1 -1
  68. package/resources/content/collections/collections.d.ts.map +1 -1
  69. package/resources/content/collections/collections.js +1 -1
  70. package/resources/content/collections/collections.js.map +1 -1
  71. package/resources/content/collections/collections.mjs +1 -1
  72. package/resources/content/collections/collections.mjs.map +1 -1
  73. package/resources/content/entries.d.mts +2 -2
  74. package/resources/content/entries.d.mts.map +1 -1
  75. package/resources/content/entries.d.ts +2 -2
  76. package/resources/content/entries.d.ts.map +1 -1
  77. package/resources/content/entries.js +2 -2
  78. package/resources/content/entries.js.map +1 -1
  79. package/resources/content/entries.mjs +2 -2
  80. package/resources/content/entries.mjs.map +1 -1
  81. package/resources/content/locales.d.mts +1 -1
  82. package/resources/content/locales.d.mts.map +1 -1
  83. package/resources/content/locales.d.ts +1 -1
  84. package/resources/content/locales.d.ts.map +1 -1
  85. package/resources/content/locales.js +1 -1
  86. package/resources/content/locales.js.map +1 -1
  87. package/resources/content/locales.mjs +1 -1
  88. package/resources/content/locales.mjs.map +1 -1
  89. package/resources/content/releases/releases.d.mts +1 -1
  90. package/resources/content/releases/releases.d.mts.map +1 -1
  91. package/resources/content/releases/releases.d.ts +1 -1
  92. package/resources/content/releases/releases.d.ts.map +1 -1
  93. package/resources/content/releases/releases.js +1 -1
  94. package/resources/content/releases/releases.js.map +1 -1
  95. package/resources/content/releases/releases.mjs +1 -1
  96. package/resources/content/releases/releases.mjs.map +1 -1
  97. package/resources/email/email.d.mts +53 -4
  98. package/resources/email/email.d.mts.map +1 -1
  99. package/resources/email/email.d.ts +53 -4
  100. package/resources/email/email.d.ts.map +1 -1
  101. package/resources/email/email.js.map +1 -1
  102. package/resources/email/email.mjs.map +1 -1
  103. package/resources/email/identities.d.mts +50 -12
  104. package/resources/email/identities.d.mts.map +1 -1
  105. package/resources/email/identities.d.ts +50 -12
  106. package/resources/email/identities.d.ts.map +1 -1
  107. package/resources/email/identities.js +2 -2
  108. package/resources/email/identities.js.map +1 -1
  109. package/resources/email/identities.mjs +2 -2
  110. package/resources/email/identities.mjs.map +1 -1
  111. package/resources/email/index.d.mts +2 -2
  112. package/resources/email/index.d.mts.map +1 -1
  113. package/resources/email/index.d.ts +2 -2
  114. package/resources/email/index.d.ts.map +1 -1
  115. package/resources/email/index.js.map +1 -1
  116. package/resources/email/index.mjs.map +1 -1
  117. package/resources/index.d.mts +1 -1
  118. package/resources/index.d.mts.map +1 -1
  119. package/resources/index.d.ts +1 -1
  120. package/resources/index.d.ts.map +1 -1
  121. package/resources/index.js.map +1 -1
  122. package/resources/index.mjs.map +1 -1
  123. package/src/client.ts +20 -9
  124. package/src/internal/utils/query.ts +7 -0
  125. package/src/internal/utils.ts +1 -0
  126. package/src/resources/commerce/coupons.ts +1 -5
  127. package/src/resources/commerce/customers.ts +3 -7
  128. package/src/resources/commerce/features.ts +1 -5
  129. package/src/resources/commerce/products/products.ts +1 -5
  130. package/src/resources/content/assets.ts +1 -5
  131. package/src/resources/content/collections/collections.ts +1 -1
  132. package/src/resources/content/entries.ts +2 -10
  133. package/src/resources/content/locales.ts +1 -5
  134. package/src/resources/content/releases/releases.ts +1 -5
  135. package/src/resources/email/email.ts +64 -1
  136. package/src/resources/email/identities.ts +59 -12
  137. package/src/resources/email/index.ts +2 -0
  138. package/src/resources/index.ts +1 -0
  139. package/src/version.ts +1 -1
  140. package/version.d.mts +1 -1
  141. package/version.d.ts +1 -1
  142. package/version.js +1 -1
  143. package/version.mjs +1 -1
@@ -21,11 +21,7 @@ export class Assets extends APIResource {
21
21
  * Updates asset metadata including URL, folder, title, description, and custom
22
22
  * metadata.
23
23
  */
24
- update(
25
- assetID: string,
26
- body: AssetUpdateParams | null | undefined = {},
27
- options?: RequestOptions,
28
- ): APIPromise<Asset> {
24
+ update(assetID: string, body: AssetUpdateParams, options?: RequestOptions): APIPromise<Asset> {
29
25
  return this._client.patch(path`/v1/content/assets/${assetID}`, { body, ...options });
30
26
  }
31
27
 
@@ -26,7 +26,7 @@ export class Collections extends APIResource {
26
26
  */
27
27
  update(
28
28
  collectionID: string,
29
- body: CollectionUpdateParams | null | undefined = {},
29
+ body: CollectionUpdateParams,
30
30
  options?: RequestOptions,
31
31
  ): APIPromise<Collection> {
32
32
  return this._client.patch(path`/v1/content/collections/${collectionID}`, { body, ...options });
@@ -20,11 +20,7 @@ export class Entries extends APIResource {
20
20
  * fields are modified. Use the version parameter for optimistic locking to prevent
21
21
  * concurrent update conflicts.
22
22
  */
23
- update(
24
- entryID: string,
25
- body: EntryUpdateParams | null | undefined = {},
26
- options?: RequestOptions,
27
- ): APIPromise<Entry> {
23
+ update(entryID: string, body: EntryUpdateParams, options?: RequestOptions): APIPromise<Entry> {
28
24
  return this._client.patch(path`/v1/content/entries/${entryID}`, { body, ...options });
29
25
  }
30
26
 
@@ -61,11 +57,7 @@ export class Entries extends APIResource {
61
57
  * publishing for a future time. Publishing validates that all required fields have
62
58
  * values.
63
59
  */
64
- publish(
65
- entryID: string,
66
- body: EntryPublishParams | null | undefined = {},
67
- options?: RequestOptions,
68
- ): APIPromise<Entry> {
60
+ publish(entryID: string, body: EntryPublishParams, options?: RequestOptions): APIPromise<Entry> {
69
61
  return this._client.post(path`/v1/content/entries/${entryID}/publish`, { body, ...options });
70
62
  }
71
63
 
@@ -20,11 +20,7 @@ export class Locales extends APIResource {
20
20
  * Updates a locale's configuration including name, fallback, default status, and
21
21
  * active status.
22
22
  */
23
- update(
24
- localeCode: string,
25
- body: LocaleUpdateParams | null | undefined = {},
26
- options?: RequestOptions,
27
- ): APIPromise<Locale> {
23
+ update(localeCode: string, body: LocaleUpdateParams, options?: RequestOptions): APIPromise<Locale> {
28
24
  return this._client.patch(path`/v1/content/locales/${localeCode}`, { body, ...options });
29
25
  }
30
26
 
@@ -23,11 +23,7 @@ export class Releases extends APIResource {
23
23
  /**
24
24
  * Updates a release name and description. Only draft releases can be updated.
25
25
  */
26
- update(
27
- releaseID: string,
28
- body: ReleaseUpdateParams | null | undefined = {},
29
- options?: RequestOptions,
30
- ): APIPromise<Release> {
26
+ update(releaseID: string, body: ReleaseUpdateParams, options?: RequestOptions): APIPromise<Release> {
31
27
  return this._client.patch(path`/v1/content/releases/${releaseID}`, { body, ...options });
32
28
  }
33
29
 
@@ -8,6 +8,7 @@ import {
8
8
  Identity,
9
9
  IdentityCreateParams,
10
10
  IdentityListParams,
11
+ IdentityVerifyParams,
11
12
  } from './identities';
12
13
  import { APIPromise } from '../../core/api-promise';
13
14
  import { CursorIDPage, type CursorIDPageParams, PagePromise } from '../../core/pagination';
@@ -35,7 +36,7 @@ export class EmailResource extends APIResource {
35
36
  /**
36
37
  * Retrieves a single email by its unique identifier.
37
38
  */
38
- get(emailID: string, options?: RequestOptions): APIPromise<Email> {
39
+ get(emailID: string, options?: RequestOptions): APIPromise<EmailGetResponse> {
39
40
  return this._client.get(path`/v1/email/${emailID}`, options);
40
41
  }
41
42
 
@@ -120,6 +121,66 @@ export interface Email {
120
121
  reply_to?: Array<string> | null;
121
122
  }
122
123
 
124
+ /**
125
+ * A sent email object with full body content
126
+ */
127
+ export interface EmailGetResponse {
128
+ /**
129
+ * Unique identifier for the email
130
+ */
131
+ id: string;
132
+
133
+ /**
134
+ * Timestamp when the email was sent
135
+ */
136
+ created_at: string;
137
+
138
+ /**
139
+ * Sender email address
140
+ */
141
+ from: string;
142
+
143
+ /**
144
+ * Email subject line
145
+ */
146
+ subject: string;
147
+
148
+ /**
149
+ * Recipient email addresses
150
+ */
151
+ to: Array<string>;
152
+
153
+ /**
154
+ * Blind carbon copy recipients
155
+ */
156
+ bcc?: Array<string> | null;
157
+
158
+ /**
159
+ * Carbon copy recipients
160
+ */
161
+ cc?: Array<string> | null;
162
+
163
+ /**
164
+ * The HTML version of the message body
165
+ */
166
+ html?: string | null;
167
+
168
+ /**
169
+ * The most recent event for this email
170
+ */
171
+ last_event?: 'sent' | 'delivered' | 'opened' | 'clicked' | 'bounced' | 'complained' | null;
172
+
173
+ /**
174
+ * Reply-to addresses
175
+ */
176
+ reply_to?: Array<string> | null;
177
+
178
+ /**
179
+ * The plain text version of the message body
180
+ */
181
+ text?: string | null;
182
+ }
183
+
123
184
  /**
124
185
  * Response after sending an email
125
186
  */
@@ -213,6 +274,7 @@ export declare namespace EmailResource {
213
274
  export {
214
275
  type Attachment as Attachment,
215
276
  type Email as Email,
277
+ type EmailGetResponse as EmailGetResponse,
216
278
  type EmailSendResponse as EmailSendResponse,
217
279
  type EmailsCursorIDPage as EmailsCursorIDPage,
218
280
  type EmailListParams as EmailListParams,
@@ -225,5 +287,6 @@ export declare namespace EmailResource {
225
287
  type IdentitiesCursorIDPage as IdentitiesCursorIDPage,
226
288
  type IdentityCreateParams as IdentityCreateParams,
227
289
  type IdentityListParams as IdentityListParams,
290
+ type IdentityVerifyParams as IdentityVerifyParams,
228
291
  };
229
292
  }
@@ -51,8 +51,8 @@ export class Identities extends APIResource {
51
51
  * Triggers a manual recheck of the identity's verification status against AWS SES.
52
52
  * Returns the identity with its updated status.
53
53
  */
54
- verify(identityID: string, options?: RequestOptions): APIPromise<Identity> {
55
- return this._client.post(path`/v1/email/identities/${identityID}/verify`, options);
54
+ verify(identityID: string, body: IdentityVerifyParams, options?: RequestOptions): APIPromise<Identity> {
55
+ return this._client.post(path`/v1/email/identities/${identityID}/verify`, { body, ...options });
56
56
  }
57
57
  }
58
58
 
@@ -72,6 +72,11 @@ export interface Identity {
72
72
  */
73
73
  created_at: string;
74
74
 
75
+ /**
76
+ * Whether a custom MAIL FROM domain is enabled for SPF alignment
77
+ */
78
+ mail_from_enabled: boolean;
79
+
75
80
  /**
76
81
  * The verification status of the identity
77
82
  */
@@ -88,6 +93,12 @@ export interface Identity {
88
93
  */
89
94
  value: string;
90
95
 
96
+ /**
97
+ * The subdomain prefix used for the custom MAIL FROM domain (e.g. 'mail' for
98
+ * mail.yourdomain.com)
99
+ */
100
+ mail_from_subdomain?: string | null;
101
+
91
102
  /**
92
103
  * DNS records required for verification (only present for domain identities)
93
104
  */
@@ -126,26 +137,62 @@ export namespace Identity {
126
137
  }
127
138
  }
128
139
 
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';
140
+ export type IdentityCreateParams = IdentityCreateParams.Variant0 | IdentityCreateParams.Variant1;
135
141
 
136
- /**
137
- * The email address or domain name to verify
138
- */
139
- value: string;
142
+ export declare namespace IdentityCreateParams {
143
+ export interface Variant0 {
144
+ /**
145
+ * Create an email address identity
146
+ */
147
+ type: 'email';
148
+
149
+ /**
150
+ * The email address to verify
151
+ */
152
+ value: string;
153
+ }
154
+
155
+ export interface Variant1 {
156
+ /**
157
+ * Create a domain identity
158
+ */
159
+ type: 'domain';
160
+
161
+ /**
162
+ * The domain name to verify
163
+ */
164
+ value: string;
165
+
166
+ /**
167
+ * Enable a custom MAIL FROM domain for SPF alignment. When enabled, additional DNS
168
+ * records are required.
169
+ */
170
+ mail_from_enabled?: boolean;
171
+
172
+ /**
173
+ * The subdomain prefix for the custom MAIL FROM domain (e.g. 'mail' for
174
+ * mail.yourdomain.com). Defaults to 'mail'.
175
+ */
176
+ mail_from_subdomain?: string;
177
+ }
140
178
  }
141
179
 
142
180
  export interface IdentityListParams extends CursorIDPageParams {}
143
181
 
182
+ export interface IdentityVerifyParams {
183
+ /**
184
+ * If true and the identity is an unverified email address, resend the verification
185
+ * email.
186
+ */
187
+ resend?: boolean;
188
+ }
189
+
144
190
  export declare namespace Identities {
145
191
  export {
146
192
  type Identity as Identity,
147
193
  type IdentitiesCursorIDPage as IdentitiesCursorIDPage,
148
194
  type IdentityCreateParams as IdentityCreateParams,
149
195
  type IdentityListParams as IdentityListParams,
196
+ type IdentityVerifyParams as IdentityVerifyParams,
150
197
  };
151
198
  }
@@ -4,6 +4,7 @@ export {
4
4
  EmailResource,
5
5
  type Attachment,
6
6
  type Email,
7
+ type EmailGetResponse,
7
8
  type EmailSendResponse,
8
9
  type EmailListParams,
9
10
  type EmailSendParams,
@@ -14,5 +15,6 @@ export {
14
15
  type Identity,
15
16
  type IdentityCreateParams,
16
17
  type IdentityListParams,
18
+ type IdentityVerifyParams,
17
19
  type IdentitiesCursorIDPage,
18
20
  } from './identities';
@@ -16,6 +16,7 @@ export {
16
16
  EmailResource,
17
17
  type Attachment,
18
18
  type Email,
19
+ type EmailGetResponse,
19
20
  type EmailSendResponse,
20
21
  type EmailListParams,
21
22
  type EmailSendParams,
package/src/version.ts CHANGED
@@ -1 +1 @@
1
- export const VERSION = '1.14.3'; // x-release-please-version
1
+ export const VERSION = '1.14.4'; // x-release-please-version
package/version.d.mts CHANGED
@@ -1,2 +1,2 @@
1
- export declare const VERSION = "1.14.3";
1
+ export declare const VERSION = "1.14.4";
2
2
  //# sourceMappingURL=version.d.mts.map
package/version.d.ts CHANGED
@@ -1,2 +1,2 @@
1
- export declare const VERSION = "1.14.3";
1
+ export declare const VERSION = "1.14.4";
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.3'; // x-release-please-version
4
+ exports.VERSION = '1.14.4'; // x-release-please-version
5
5
  //# sourceMappingURL=version.js.map
package/version.mjs CHANGED
@@ -1,2 +1,2 @@
1
- export const VERSION = '1.14.3'; // x-release-please-version
1
+ export const VERSION = '1.14.4'; // x-release-please-version
2
2
  //# sourceMappingURL=version.mjs.map