@usehercules/sdk 1.14.3 → 1.14.5
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/CHANGELOG.md +132 -0
- package/client.d.mts +3 -3
- package/client.d.mts.map +1 -1
- package/client.d.ts +3 -3
- package/client.d.ts.map +1 -1
- package/client.js +15 -7
- package/client.js.map +1 -1
- package/client.mjs +15 -7
- package/client.mjs.map +1 -1
- package/internal/tslib.js +17 -17
- package/internal/utils/env.js +2 -2
- package/internal/utils/env.js.map +1 -1
- package/internal/utils/env.mjs +2 -2
- package/internal/utils/env.mjs.map +1 -1
- package/internal/utils/query.d.mts +2 -0
- package/internal/utils/query.d.mts.map +1 -0
- package/internal/utils/query.d.ts +2 -0
- package/internal/utils/query.d.ts.map +1 -0
- package/internal/utils/query.js +10 -0
- package/internal/utils/query.js.map +1 -0
- package/internal/utils/query.mjs +6 -0
- package/internal/utils/query.mjs.map +1 -0
- package/internal/utils.d.mts +1 -0
- package/internal/utils.d.ts +1 -0
- package/internal/utils.js +1 -0
- package/internal/utils.js.map +1 -1
- package/internal/utils.mjs +1 -0
- package/package.json +7 -1
- package/resources/commerce/coupons.d.mts +1 -1
- package/resources/commerce/coupons.d.mts.map +1 -1
- package/resources/commerce/coupons.d.ts +1 -1
- package/resources/commerce/coupons.d.ts.map +1 -1
- package/resources/commerce/coupons.js +1 -1
- package/resources/commerce/coupons.js.map +1 -1
- package/resources/commerce/coupons.mjs +1 -1
- package/resources/commerce/coupons.mjs.map +1 -1
- package/resources/commerce/customers.d.mts +3 -3
- package/resources/commerce/customers.d.mts.map +1 -1
- package/resources/commerce/customers.d.ts +3 -3
- package/resources/commerce/customers.d.ts.map +1 -1
- package/resources/commerce/customers.js +3 -3
- package/resources/commerce/customers.js.map +1 -1
- package/resources/commerce/customers.mjs +3 -3
- package/resources/commerce/customers.mjs.map +1 -1
- package/resources/commerce/features.d.mts +1 -1
- package/resources/commerce/features.d.mts.map +1 -1
- package/resources/commerce/features.d.ts +1 -1
- package/resources/commerce/features.d.ts.map +1 -1
- package/resources/commerce/features.js +1 -1
- package/resources/commerce/features.js.map +1 -1
- package/resources/commerce/features.mjs +1 -1
- package/resources/commerce/features.mjs.map +1 -1
- package/resources/commerce/products/products.d.mts +1 -1
- package/resources/commerce/products/products.d.mts.map +1 -1
- package/resources/commerce/products/products.d.ts +1 -1
- package/resources/commerce/products/products.d.ts.map +1 -1
- package/resources/commerce/products/products.js +1 -1
- package/resources/commerce/products/products.js.map +1 -1
- package/resources/commerce/products/products.mjs +1 -1
- package/resources/commerce/products/products.mjs.map +1 -1
- package/resources/content/assets.d.mts +1 -1
- package/resources/content/assets.d.mts.map +1 -1
- package/resources/content/assets.d.ts +1 -1
- package/resources/content/assets.d.ts.map +1 -1
- package/resources/content/assets.js +1 -1
- package/resources/content/assets.js.map +1 -1
- package/resources/content/assets.mjs +1 -1
- package/resources/content/assets.mjs.map +1 -1
- package/resources/content/collections/collections.d.mts +1 -1
- package/resources/content/collections/collections.d.mts.map +1 -1
- package/resources/content/collections/collections.d.ts +1 -1
- package/resources/content/collections/collections.d.ts.map +1 -1
- package/resources/content/collections/collections.js +1 -1
- package/resources/content/collections/collections.js.map +1 -1
- package/resources/content/collections/collections.mjs +1 -1
- package/resources/content/collections/collections.mjs.map +1 -1
- package/resources/content/entries.d.mts +6 -22
- package/resources/content/entries.d.mts.map +1 -1
- package/resources/content/entries.d.ts +6 -22
- package/resources/content/entries.d.ts.map +1 -1
- package/resources/content/entries.js +2 -2
- package/resources/content/entries.js.map +1 -1
- package/resources/content/entries.mjs +2 -2
- package/resources/content/entries.mjs.map +1 -1
- package/resources/content/locales.d.mts +1 -1
- package/resources/content/locales.d.mts.map +1 -1
- package/resources/content/locales.d.ts +1 -1
- package/resources/content/locales.d.ts.map +1 -1
- package/resources/content/locales.js +1 -1
- package/resources/content/locales.js.map +1 -1
- package/resources/content/locales.mjs +1 -1
- package/resources/content/locales.mjs.map +1 -1
- package/resources/content/releases/releases.d.mts +1 -1
- package/resources/content/releases/releases.d.mts.map +1 -1
- package/resources/content/releases/releases.d.ts +1 -1
- package/resources/content/releases/releases.d.ts.map +1 -1
- package/resources/content/releases/releases.js +1 -1
- package/resources/content/releases/releases.js.map +1 -1
- package/resources/content/releases/releases.mjs +1 -1
- package/resources/content/releases/releases.mjs.map +1 -1
- package/resources/email/email.d.mts +53 -4
- package/resources/email/email.d.mts.map +1 -1
- package/resources/email/email.d.ts +53 -4
- package/resources/email/email.d.ts.map +1 -1
- package/resources/email/email.js.map +1 -1
- package/resources/email/email.mjs.map +1 -1
- package/resources/email/identities.d.mts +50 -12
- package/resources/email/identities.d.mts.map +1 -1
- package/resources/email/identities.d.ts +50 -12
- package/resources/email/identities.d.ts.map +1 -1
- package/resources/email/identities.js +2 -2
- package/resources/email/identities.js.map +1 -1
- package/resources/email/identities.mjs +2 -2
- package/resources/email/identities.mjs.map +1 -1
- package/resources/email/index.d.mts +2 -2
- package/resources/email/index.d.mts.map +1 -1
- package/resources/email/index.d.ts +2 -2
- package/resources/email/index.d.ts.map +1 -1
- package/resources/email/index.js.map +1 -1
- package/resources/email/index.mjs.map +1 -1
- package/resources/index.d.mts +1 -1
- package/resources/index.d.mts.map +1 -1
- package/resources/index.d.ts +1 -1
- package/resources/index.d.ts.map +1 -1
- package/resources/index.js.map +1 -1
- package/resources/index.mjs.map +1 -1
- package/src/client.ts +20 -9
- package/src/internal/utils/env.ts +2 -2
- package/src/internal/utils/query.ts +7 -0
- package/src/internal/utils.ts +1 -0
- package/src/resources/commerce/coupons.ts +1 -5
- package/src/resources/commerce/customers.ts +3 -7
- package/src/resources/commerce/features.ts +1 -5
- package/src/resources/commerce/products/products.ts +1 -5
- package/src/resources/content/assets.ts +1 -5
- package/src/resources/content/collections/collections.ts +1 -1
- package/src/resources/content/entries.ts +6 -34
- package/src/resources/content/locales.ts +1 -5
- package/src/resources/content/releases/releases.ts +1 -5
- package/src/resources/email/email.ts +64 -1
- package/src/resources/email/identities.ts +59 -12
- package/src/resources/email/index.ts +2 -0
- package/src/resources/index.ts +1 -0
- package/src/version.ts +1 -1
- package/version.d.mts +1 -1
- package/version.d.ts +1 -1
- package/version.js +1 -1
- package/version.mjs +1 -1
package/resources/index.d.mts
CHANGED
|
@@ -1,7 +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
|
+
export { EmailResource, type Attachment, type Email, type EmailGetResponse, type EmailSendResponse, type EmailListParams, type EmailSendParams, type EmailsCursorIDPage, } from "./email/email.mjs";
|
|
5
5
|
export { Files, type File, type Upload, type FileListParams, type FilesCursorIDPage } from "./files.mjs";
|
|
6
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";
|
|
7
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,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
|
+
{"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,gBAAgB,EACrB,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"}
|
package/resources/index.d.ts
CHANGED
|
@@ -1,7 +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
|
+
export { EmailResource, type Attachment, type Email, type EmailGetResponse, type EmailSendResponse, type EmailListParams, type EmailSendParams, type EmailsCursorIDPage, } from "./email/email.js";
|
|
5
5
|
export { Files, type File, type Upload, type FileListParams, type FilesCursorIDPage } from "./files.js";
|
|
6
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";
|
|
7
7
|
//# sourceMappingURL=index.d.ts.map
|
package/resources/index.d.ts.map
CHANGED
|
@@ -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,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
|
+
{"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,gBAAgB,EACrB,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"}
|
package/resources/index.js.map
CHANGED
|
@@ -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,
|
|
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,0CASuB;AARrB,sGAAA,aAAa,OAAA;AASf,oCAAqG;AAA5F,8FAAA,KAAK,OAAA;AACd,iFAWiD;AAV/C,uHAAA,iBAAiB,OAAA"}
|
package/resources/index.mjs.map
CHANGED
|
@@ -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,EACL,aAAa,
|
|
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,GAQd;OACM,EAAE,KAAK,EAAuE;OAC9E,EACL,iBAAiB,GAUlB"}
|
package/src/client.ts
CHANGED
|
@@ -11,7 +11,7 @@ import type { APIResponseProps } from './internal/parse';
|
|
|
11
11
|
import { getPlatformHeaders } from './internal/detect-platform';
|
|
12
12
|
import * as Shims from './internal/shims';
|
|
13
13
|
import * as Opts from './internal/request-options';
|
|
14
|
-
import
|
|
14
|
+
import { stringifyQuery } from './internal/utils/query';
|
|
15
15
|
import { VERSION } from './version';
|
|
16
16
|
import * as Errors from './core/error';
|
|
17
17
|
import * as Pagination from './core/pagination';
|
|
@@ -35,6 +35,7 @@ import { Content } from './resources/content/content';
|
|
|
35
35
|
import {
|
|
36
36
|
Attachment,
|
|
37
37
|
Email,
|
|
38
|
+
EmailGetResponse,
|
|
38
39
|
EmailListParams,
|
|
39
40
|
EmailResource,
|
|
40
41
|
EmailSendParams,
|
|
@@ -263,8 +264,8 @@ export class Hercules {
|
|
|
263
264
|
return buildHeaders([{ Authorization: `Bearer ${this.apiKey}` }]);
|
|
264
265
|
}
|
|
265
266
|
|
|
266
|
-
protected stringifyQuery(query: Record<string, unknown>): string {
|
|
267
|
-
return
|
|
267
|
+
protected stringifyQuery(query: object | Record<string, unknown>): string {
|
|
268
|
+
return stringifyQuery(query);
|
|
268
269
|
}
|
|
269
270
|
|
|
270
271
|
private getUserAgent(): string {
|
|
@@ -296,12 +297,13 @@ export class Hercules {
|
|
|
296
297
|
: new URL(baseURL + (baseURL.endsWith('/') && path.startsWith('/') ? path.slice(1) : path));
|
|
297
298
|
|
|
298
299
|
const defaultQuery = this.defaultQuery();
|
|
299
|
-
|
|
300
|
-
|
|
300
|
+
const pathQuery = Object.fromEntries(url.searchParams);
|
|
301
|
+
if (!isEmptyObj(defaultQuery) || !isEmptyObj(pathQuery)) {
|
|
302
|
+
query = { ...pathQuery, ...defaultQuery, ...query };
|
|
301
303
|
}
|
|
302
304
|
|
|
303
305
|
if (typeof query === 'object' && query && !Array.isArray(query)) {
|
|
304
|
-
url.search = this.stringifyQuery(query
|
|
306
|
+
url.search = this.stringifyQuery(query);
|
|
305
307
|
}
|
|
306
308
|
|
|
307
309
|
return url.toString();
|
|
@@ -630,9 +632,9 @@ export class Hercules {
|
|
|
630
632
|
}
|
|
631
633
|
}
|
|
632
634
|
|
|
633
|
-
// If the API asks us to wait a certain amount of time
|
|
634
|
-
//
|
|
635
|
-
if (
|
|
635
|
+
// If the API asks us to wait a certain amount of time, just do what it
|
|
636
|
+
// says, but otherwise calculate a default
|
|
637
|
+
if (timeoutMillis === undefined) {
|
|
636
638
|
const maxRetries = options.maxRetries ?? this.maxRetries;
|
|
637
639
|
timeoutMillis = this.calculateDefaultRetryTimeoutMillis(retriesRemaining, maxRetries);
|
|
638
640
|
}
|
|
@@ -759,6 +761,14 @@ export class Hercules {
|
|
|
759
761
|
(Symbol.iterator in body && 'next' in body && typeof body.next === 'function'))
|
|
760
762
|
) {
|
|
761
763
|
return { bodyHeaders: undefined, body: Shims.ReadableStreamFrom(body as AsyncIterable<Uint8Array>) };
|
|
764
|
+
} else if (
|
|
765
|
+
typeof body === 'object' &&
|
|
766
|
+
headers.values.get('content-type') === 'application/x-www-form-urlencoded'
|
|
767
|
+
) {
|
|
768
|
+
return {
|
|
769
|
+
bodyHeaders: { 'content-type': 'application/x-www-form-urlencoded' },
|
|
770
|
+
body: this.stringifyQuery(body),
|
|
771
|
+
};
|
|
762
772
|
} else {
|
|
763
773
|
return this.#encoder({ body, headers });
|
|
764
774
|
}
|
|
@@ -848,6 +858,7 @@ export declare namespace Hercules {
|
|
|
848
858
|
EmailResource as EmailResource,
|
|
849
859
|
type Attachment as Attachment,
|
|
850
860
|
type Email as Email,
|
|
861
|
+
type EmailGetResponse as EmailGetResponse,
|
|
851
862
|
type EmailSendResponse as EmailSendResponse,
|
|
852
863
|
type EmailsCursorIDPage as EmailsCursorIDPage,
|
|
853
864
|
type EmailListParams as EmailListParams,
|
|
@@ -9,10 +9,10 @@
|
|
|
9
9
|
*/
|
|
10
10
|
export const readEnv = (env: string): string | undefined => {
|
|
11
11
|
if (typeof (globalThis as any).process !== 'undefined') {
|
|
12
|
-
return (globalThis as any).process.env?.[env]?.trim()
|
|
12
|
+
return (globalThis as any).process.env?.[env]?.trim() || undefined;
|
|
13
13
|
}
|
|
14
14
|
if (typeof (globalThis as any).Deno !== 'undefined') {
|
|
15
|
-
return (globalThis as any).Deno.env?.get?.(env)?.trim();
|
|
15
|
+
return (globalThis as any).Deno.env?.get?.(env)?.trim() || undefined;
|
|
16
16
|
}
|
|
17
17
|
return undefined;
|
|
18
18
|
};
|
package/src/internal/utils.ts
CHANGED
|
@@ -35,11 +35,7 @@ export class Coupons extends APIResource {
|
|
|
35
35
|
* );
|
|
36
36
|
* ```
|
|
37
37
|
*/
|
|
38
|
-
update(
|
|
39
|
-
couponID: string,
|
|
40
|
-
body: CouponUpdateParams | null | undefined = {},
|
|
41
|
-
options?: RequestOptions,
|
|
42
|
-
): APIPromise<Coupon> {
|
|
38
|
+
update(couponID: string, body: CouponUpdateParams, options?: RequestOptions): APIPromise<Coupon> {
|
|
43
39
|
return this._client.patch(path`/v1/commerce/coupons/${couponID}`, { body, ...options });
|
|
44
40
|
}
|
|
45
41
|
|
|
@@ -18,7 +18,7 @@ export class Customers extends APIResource {
|
|
|
18
18
|
* const customer = await client.commerce.customers.create();
|
|
19
19
|
* ```
|
|
20
20
|
*/
|
|
21
|
-
create(body: CustomerCreateParams
|
|
21
|
+
create(body: CustomerCreateParams, options?: RequestOptions): APIPromise<Customer> {
|
|
22
22
|
return this._client.post('/v1/commerce/customers', { body, ...options });
|
|
23
23
|
}
|
|
24
24
|
|
|
@@ -33,11 +33,7 @@ export class Customers extends APIResource {
|
|
|
33
33
|
* );
|
|
34
34
|
* ```
|
|
35
35
|
*/
|
|
36
|
-
update(
|
|
37
|
-
customerID: string,
|
|
38
|
-
body: CustomerUpdateParams | null | undefined = {},
|
|
39
|
-
options?: RequestOptions,
|
|
40
|
-
): APIPromise<Customer> {
|
|
36
|
+
update(customerID: string, body: CustomerUpdateParams, options?: RequestOptions): APIPromise<Customer> {
|
|
41
37
|
return this._client.patch(path`/v1/commerce/customers/${customerID}`, { body, ...options });
|
|
42
38
|
}
|
|
43
39
|
|
|
@@ -75,7 +71,7 @@ export class Customers extends APIResource {
|
|
|
75
71
|
*/
|
|
76
72
|
billingPortal(
|
|
77
73
|
customerID: string,
|
|
78
|
-
body: CustomerBillingPortalParams
|
|
74
|
+
body: CustomerBillingPortalParams,
|
|
79
75
|
options?: RequestOptions,
|
|
80
76
|
): APIPromise<CustomerBillingPortalResponse> {
|
|
81
77
|
return this._client.post(path`/v1/commerce/customers/${customerID}/billing_portal`, { body, ...options });
|
|
@@ -33,11 +33,7 @@ export class Features extends APIResource {
|
|
|
33
33
|
* );
|
|
34
34
|
* ```
|
|
35
35
|
*/
|
|
36
|
-
update(
|
|
37
|
-
featureID: string,
|
|
38
|
-
body: FeatureUpdateParams | null | undefined = {},
|
|
39
|
-
options?: RequestOptions,
|
|
40
|
-
): APIPromise<Feature> {
|
|
36
|
+
update(featureID: string, body: FeatureUpdateParams, options?: RequestOptions): APIPromise<Feature> {
|
|
41
37
|
return this._client.patch(path`/v1/commerce/features/${featureID}`, { body, ...options });
|
|
42
38
|
}
|
|
43
39
|
|
|
@@ -61,11 +61,7 @@ export class Products extends APIResource {
|
|
|
61
61
|
* );
|
|
62
62
|
* ```
|
|
63
63
|
*/
|
|
64
|
-
update(
|
|
65
|
-
productID: string,
|
|
66
|
-
body: ProductUpdateParams | null | undefined = {},
|
|
67
|
-
options?: RequestOptions,
|
|
68
|
-
): APIPromise<Product> {
|
|
64
|
+
update(productID: string, body: ProductUpdateParams, options?: RequestOptions): APIPromise<Product> {
|
|
69
65
|
return this._client.patch(path`/v1/commerce/products/${productID}`, { body, ...options });
|
|
70
66
|
}
|
|
71
67
|
|
|
@@ -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
|
|
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
|
|
|
@@ -101,16 +93,11 @@ export interface Entry {
|
|
|
101
93
|
created: string;
|
|
102
94
|
|
|
103
95
|
/**
|
|
104
|
-
* Field values.
|
|
105
|
-
* non-localized
|
|
96
|
+
* Field values. Localization is field-level: localized fields use { fieldApiId: {
|
|
97
|
+
* locale: value } }, non-localized use { fieldApiId: value }.
|
|
106
98
|
*/
|
|
107
99
|
fields: { [key: string]: unknown };
|
|
108
100
|
|
|
109
|
-
/**
|
|
110
|
-
* Primary locale for this entry
|
|
111
|
-
*/
|
|
112
|
-
locale: string;
|
|
113
|
-
|
|
114
101
|
/**
|
|
115
102
|
* Publishing status: draft, published, or archived
|
|
116
103
|
*/
|
|
@@ -165,16 +152,11 @@ export interface EntryCreateParams {
|
|
|
165
152
|
id?: string;
|
|
166
153
|
|
|
167
154
|
/**
|
|
168
|
-
* Field values.
|
|
169
|
-
* non-localized
|
|
155
|
+
* Field values. Localization is field-level: localized fields use { fieldApiId: {
|
|
156
|
+
* locale: value } }, non-localized use { fieldApiId: value }.
|
|
170
157
|
*/
|
|
171
158
|
fields?: { [key: string]: unknown };
|
|
172
159
|
|
|
173
|
-
/**
|
|
174
|
-
* Primary locale for this entry
|
|
175
|
-
*/
|
|
176
|
-
locale?: string;
|
|
177
|
-
|
|
178
160
|
/**
|
|
179
161
|
* Initial status (default: draft)
|
|
180
162
|
*/
|
|
@@ -188,11 +170,6 @@ export interface EntryUpdateParams {
|
|
|
188
170
|
*/
|
|
189
171
|
fields?: { [key: string]: unknown };
|
|
190
172
|
|
|
191
|
-
/**
|
|
192
|
-
* Primary locale
|
|
193
|
-
*/
|
|
194
|
-
locale?: string;
|
|
195
|
-
|
|
196
173
|
/**
|
|
197
174
|
* Expected version for optimistic locking. Update fails if version mismatch.
|
|
198
175
|
*/
|
|
@@ -215,11 +192,6 @@ export interface EntryListParams extends CursorIDPageParams {
|
|
|
215
192
|
*/
|
|
216
193
|
include_depth?: number;
|
|
217
194
|
|
|
218
|
-
/**
|
|
219
|
-
* Filter by primary locale
|
|
220
|
-
*/
|
|
221
|
-
locale?: string;
|
|
222
|
-
|
|
223
195
|
/**
|
|
224
196
|
* JSON-encoded sort order. Example: {"field":"publishedAt","direction":"desc"}
|
|
225
197
|
*/
|
|
@@ -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<
|
|
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
|
|
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
|
-
|
|
138
|
-
|
|
139
|
-
|
|
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';
|
package/src/resources/index.ts
CHANGED
package/src/version.ts
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
export const VERSION = '1.14.
|
|
1
|
+
export const VERSION = '1.14.5'; // x-release-please-version
|
package/version.d.mts
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
export declare const VERSION = "1.14.
|
|
1
|
+
export declare const VERSION = "1.14.5";
|
|
2
2
|
//# sourceMappingURL=version.d.mts.map
|
package/version.d.ts
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
export declare const VERSION = "1.14.
|
|
1
|
+
export declare const VERSION = "1.14.5";
|
|
2
2
|
//# sourceMappingURL=version.d.ts.map
|
package/version.js
CHANGED
package/version.mjs
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
export const VERSION = '1.14.
|
|
1
|
+
export const VERSION = '1.14.5'; // x-release-please-version
|
|
2
2
|
//# sourceMappingURL=version.mjs.map
|