dodopayments 2.49.0 → 2.50.0

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 (68) hide show
  1. package/CHANGELOG.md +8 -0
  2. package/bin/migration-config.json +33 -0
  3. package/package.json +1 -1
  4. package/resources/balances.d.mts +2 -2
  5. package/resources/balances.d.mts.map +1 -1
  6. package/resources/balances.d.ts +2 -2
  7. package/resources/balances.d.ts.map +1 -1
  8. package/resources/checkout-sessions.d.mts +5 -0
  9. package/resources/checkout-sessions.d.mts.map +1 -1
  10. package/resources/checkout-sessions.d.ts +5 -0
  11. package/resources/checkout-sessions.d.ts.map +1 -1
  12. package/resources/credit-entitlements/balances.d.mts +7 -4
  13. package/resources/credit-entitlements/balances.d.mts.map +1 -1
  14. package/resources/credit-entitlements/balances.d.ts +7 -4
  15. package/resources/credit-entitlements/balances.d.ts.map +1 -1
  16. package/resources/credit-entitlements/balances.js +1 -0
  17. package/resources/credit-entitlements/balances.js.map +1 -1
  18. package/resources/credit-entitlements/balances.mjs +1 -0
  19. package/resources/credit-entitlements/balances.mjs.map +1 -1
  20. package/resources/customers/customers.d.mts +4 -0
  21. package/resources/customers/customers.d.mts.map +1 -1
  22. package/resources/customers/customers.d.ts +4 -0
  23. package/resources/customers/customers.d.ts.map +1 -1
  24. package/resources/customers/customers.js +4 -0
  25. package/resources/customers/customers.js.map +1 -1
  26. package/resources/customers/customers.mjs +4 -0
  27. package/resources/customers/customers.mjs.map +1 -1
  28. package/resources/customers/emails.d.mts +169 -0
  29. package/resources/customers/emails.d.mts.map +1 -0
  30. package/resources/customers/emails.d.ts +169 -0
  31. package/resources/customers/emails.d.ts.map +1 -0
  32. package/resources/customers/emails.js +48 -0
  33. package/resources/customers/emails.js.map +1 -0
  34. package/resources/customers/emails.mjs +44 -0
  35. package/resources/customers/emails.mjs.map +1 -0
  36. package/resources/customers/index.d.mts +1 -0
  37. package/resources/customers/index.d.mts.map +1 -1
  38. package/resources/customers/index.d.ts +1 -0
  39. package/resources/customers/index.d.ts.map +1 -1
  40. package/resources/customers/index.js +3 -1
  41. package/resources/customers/index.js.map +1 -1
  42. package/resources/customers/index.mjs +1 -0
  43. package/resources/customers/index.mjs.map +1 -1
  44. package/resources/products/products.d.mts +54 -13
  45. package/resources/products/products.d.mts.map +1 -1
  46. package/resources/products/products.d.ts +54 -13
  47. package/resources/products/products.d.ts.map +1 -1
  48. package/resources/products/products.js +0 -1
  49. package/resources/products/products.js.map +1 -1
  50. package/resources/products/products.mjs +0 -1
  51. package/resources/products/products.mjs.map +1 -1
  52. package/resources/subscriptions.d.mts +15 -0
  53. package/resources/subscriptions.d.mts.map +1 -1
  54. package/resources/subscriptions.d.ts +15 -0
  55. package/resources/subscriptions.d.ts.map +1 -1
  56. package/src/resources/balances.ts +6 -2
  57. package/src/resources/checkout-sessions.ts +6 -0
  58. package/src/resources/credit-entitlements/balances.ts +8 -4
  59. package/src/resources/customers/customers.ts +26 -0
  60. package/src/resources/customers/emails.ts +238 -0
  61. package/src/resources/customers/index.ts +11 -0
  62. package/src/resources/products/products.ts +62 -16
  63. package/src/resources/subscriptions.ts +18 -0
  64. package/src/version.ts +1 -1
  65. package/version.d.mts +1 -1
  66. package/version.d.ts +1 -1
  67. package/version.js +1 -1
  68. package/version.mjs +1 -1
@@ -1 +1 @@
1
- {"version":3,"file":"customers.js","sourceRoot":"","sources":["../../src/resources/customers/customers.ts"],"names":[],"mappings":";AAAA,sFAAsF;;;;AAEtF,qDAAkD;AAGlD,gFAAuD;AACvD,0DAA+E;AAI/E,yEAAgD;AAChD,kDAAgF;AAEhF,yDAI+B;AAC/B,uDAAsD;AAEtD,uDAAiD;AAEjD,MAAa,SAAU,SAAQ,sBAAW;IAA1C;;QACE,mBAAc,GAAqC,IAAI,iBAAiB,CAAC,cAAc,CAAC,IAAI,CAAC,OAAO,CAAC,CAAC;QACtG,YAAO,GAAuB,IAAI,UAAU,CAAC,OAAO,CAAC,IAAI,CAAC,OAAO,C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AAC,OAAO,CAAC,GAAG,CAAC,IAAA,WAAI,EAAA,cAAc,UAAU,sBAAsB,EAAE,OAAO,CAAC,CAAC;IACvF,CAAC;IAED;;;;;;;;OAQG;IACH,mBAAmB,CACjB,eAAuB,EACvB,MAAyC,EACzC,OAAwB;QAExB,MAAM,EAAE,WAAW,EAAE,GAAG,MAAM,CAAC;QAC/B,OAAO,IAAI,CAAC,OAAO,CAAC,MAAM,CAAC,IAAA,WAAI,EAAA,cAAc,WAAW,oBAAoB,eAAe,EAAE,EAAE;YAC7F,GAAG,OAAO;YACV,OAAO,EAAE,IAAA,sBAAY,EAAC,CAAC,EAAE,MAAM,EAAE,KAAK,EAAE,EAAE,OAAO,EAAE,OAAO,CAAC,CAAC;SAC7D,CAAC,CAAC;IACL,CAAC;IAED;;;;;;;;;OASG;IACH,gBAAgB,CACd,UAAkB,EAClB,OAAwB;QAExB,OAAO,IAAI,CAAC,OAAO,CAAC,GAAG,CAAC,IAAA,WAAI,EAAA,cAAc,UAAU,eAAe,EAAE,OAAO,CAAC,CAAC;IAChF,CAAC;IAED;;;;;;;;;;;;;OAaG;IACH,qBAAqB,CACnB,UAAkB,EAClB,QAAgE,EAAE,EAClE,OAAwB;QAExB,OAAO,IAAI,CAAC,OAAO,CAAC,UAAU,CAC5B,IAAA,WAAI,EAAA,cAAc,UAAU,qBAAqB,EACjD,CAAA,wCAAuD,CAAA,EACvD,EAAE,KAAK,EAAE,GAAG,OAAO,EAAE,CACtB,CAAC;IACJ,CAAC;CACF;AA9JD,8BA8JC;AA2PD,SAAS,CAAC,cAAc,GAAG,gCAAc,CAAC;AAC1C,SAAS,CAAC,OAAO,GAAG,iBAAO,CAAC;AAC5B,SAAS,CAAC,MAAM,GAAG,eAAM,CAAC"}
@@ -2,6 +2,8 @@
2
2
  import { APIResource } from "../../core/resource.mjs";
3
3
  import * as CustomerPortalAPI from "./customer-portal.mjs";
4
4
  import { CustomerPortal } from "./customer-portal.mjs";
5
+ import * as EmailsAPI from "./emails.mjs";
6
+ import { Emails, } from "./emails.mjs";
5
7
  import * as WalletsAPI from "./wallets/wallets.mjs";
6
8
  import { Wallets } from "./wallets/wallets.mjs";
7
9
  import { DefaultPageNumberPagination, } from "../../core/pagination.mjs";
@@ -12,6 +14,7 @@ export class Customers extends APIResource {
12
14
  super(...arguments);
13
15
  this.customerPortal = new CustomerPortalAPI.CustomerPortal(this._client);
14
16
  this.wallets = new WalletsAPI.Wallets(this._client);
17
+ this.emails = new EmailsAPI.Emails(this._client);
15
18
  }
16
19
  /**
17
20
  * @example
@@ -137,4 +140,5 @@ export class Customers extends APIResource {
137
140
  }
138
141
  Customers.CustomerPortal = CustomerPortal;
139
142
  Customers.Wallets = Wallets;
143
+ Customers.Emails = Emails;
140
144
  //# sourceMappingURL=customers.mjs.map
@@ -1 +1 @@
1
- {"version":3,"file":"customers.mjs","sourceRoot":"","sources":["../../src/resources/customers/customers.ts"],"names":[],"mappings":"AAAA,sFAAsF;AAEtF,OAAO,EAAE,WAAW,EAAE,gCAA4B;AAGlD,OAAO,KAAK,iBAAiB,8BAA0B;AACvD,OAAO,EAAE,cAAc,EAA8B,8BAA0B;AAI/E,OAAO,KAAK,UAAU,8BAA0B;AAChD,OAAO,EAAsC,OAAO,EAAE,8BAA0B;AAEhF,OAAO,EACL,2BAA2B,GAG5B,kCAA8B;AAC/B,OAAO,EAAE,YAAY,EAAE,mCAA+B;AAEtD,OAAO,EAAE,IAAI,EAAE,sCAAkC;AAEjD,MAAM,OAAO,SAAU,SAAQ,WAAW;IAA1C;;QACE,mBAAc,GAAqC,IAAI,iBAAiB,CAAC,cAAc,CAAC,IAAI,CAAC,OAAO,CAAC,CAAC;QACtG,YAAO,GAAuB,IAAI,UAAU,CAAC,OAAO,CAAC,IAAI,CAAC,OAAO,CAAC,CAAC;IA2JrE,CAAC;IAzJC;;;;;;;;OAQG;IACH,IAAI,CACF,QAA+C,EAAE,EACjD,OAAwB;QAExB,OAAO,IAAI,CAAC,OAAO,CAAC,UAAU,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,OAAO,IAAI,CAAC,OAAO,CAAC,GAAG,CAAC,IAAI,CAAA,cAAc,UAAU,sBAAsB,EAAE,OAAO,CAAC,CAAC;IACvF,CAAC;IAED;;;;;;;;OAQG;IACH,mBAAmB,CACjB,eAAuB,EACvB,MAAyC,EACzC,OAAwB;QAExB,MAAM,EAAE,WAAW,EAAE,GAAG,MAAM,CAAC;QAC/B,OAAO,IAAI,CAAC,OAAO,CAAC,MAAM,CAAC,IAAI,CAAA,cAAc,WAAW,oBAAoB,eAAe,EAAE,EAAE;YAC7F,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;;;;;;;;;OASG;IACH,gBAAgB,CACd,UAAkB,EAClB,OAAwB;QAExB,OAAO,IAAI,CAAC,OAAO,CAAC,GAAG,CAAC,IAAI,CAAA,cAAc,UAAU,eAAe,EAAE,OAAO,CAAC,CAAC;IAChF,CAAC;IAED;;;;;;;;;;;;;OAaG;IACH,qBAAqB,CACnB,UAAkB,EAClB,QAAgE,EAAE,EAClE,OAAwB;QAExB,OAAO,IAAI,CAAC,OAAO,CAAC,UAAU,CAC5B,IAAI,CAAA,cAAc,UAAU,qBAAqB,EACjD,CAAA,2BAAuD,CAAA,EACvD,EAAE,KAAK,EAAE,GAAG,OAAO,EAAE,CACtB,CAAC;IACJ,CAAC;CACF;AA2PD,SAAS,CAAC,cAAc,GAAG,cAAc,CAAC;AAC1C,SAAS,CAAC,OAAO,GAAG,OAAO,CAAC;AAC5B,SAAS,CAAC,MAAM,GAAG,MAAM,CAAC"}
@@ -0,0 +1,169 @@
1
+ import { APIResource } from "../../core/resource.mjs";
2
+ import { APIPromise } from "../../core/api-promise.mjs";
3
+ import { DefaultPageNumberPagination, type DefaultPageNumberPaginationParams, PagePromise } from "../../core/pagination.mjs";
4
+ import { RequestOptions } from "../../internal/request-options.mjs";
5
+ export declare class Emails extends APIResource {
6
+ /**
7
+ * Returns every transactional email sent to this customer in the last 180 days,
8
+ * newest first, with its delivery outcome. Delivery status comes from the email
9
+ * provider and is as fresh as replication, typically seconds.
10
+ *
11
+ * @example
12
+ * ```ts
13
+ * // Automatically fetches more pages as needed.
14
+ * for await (const emailLogItem of client.customers.emails.list(
15
+ * 'customer_id',
16
+ * )) {
17
+ * // ...
18
+ * }
19
+ * ```
20
+ */
21
+ list(customerID: string, query?: EmailListParams | null | undefined, options?: RequestOptions): PagePromise<EmailLogItemsDefaultPageNumberPagination, EmailLogItem>;
22
+ /**
23
+ * Returns the email exactly as it was sent, plus the reason it failed when it did.
24
+ * Some emails have no body to show: an authentication email carries a live login
25
+ * token, a blocked email never reached the provider, and the provider clears
26
+ * bodies at 180 days.
27
+ *
28
+ * @example
29
+ * ```ts
30
+ * const emailBody =
31
+ * await client.customers.emails.retrieveBody(
32
+ * 'email_log_id',
33
+ * { customer_id: 'customer_id' },
34
+ * );
35
+ * ```
36
+ */
37
+ retrieveBody(emailLogID: string, params: EmailRetrieveBodyParams, options?: RequestOptions): APIPromise<EmailBody>;
38
+ }
39
+ export type EmailLogItemsDefaultPageNumberPagination = DefaultPageNumberPagination<EmailLogItem>;
40
+ export interface EmailBody {
41
+ /**
42
+ * Whether the merchant wrote this content. It is true for the recovery and dunning
43
+ * emails, which the merchant writes.
44
+ *
45
+ * The content is email HTML. Render it in a sandbox, whatever this value is.
46
+ */
47
+ merchant_authored: boolean;
48
+ /**
49
+ * Why the email did not arrive. It is null unless the email failed.
50
+ */
51
+ failure_code?: EmailFailureCode | null;
52
+ /**
53
+ * A sentence that explains `failure_code`. It is null unless the email failed.
54
+ */
55
+ failure_reason?: string | null;
56
+ /**
57
+ * The stored HTML. It is null on a text-only email.
58
+ */
59
+ html?: string | null;
60
+ /**
61
+ * The stored plain text.
62
+ */
63
+ text?: string | null;
64
+ }
65
+ /**
66
+ * Why an email did not reach the recipient.
67
+ *
68
+ * The code is stable. `send_failed` is the catch-all: it covers every failure that
69
+ * the other codes do not name.
70
+ */
71
+ export type EmailFailureCode = 'mailbox_not_found' | 'address_rejected' | 'address_suppressed' | 'mailbox_full' | 'temporary_failure' | 'message_too_large' | 'marked_as_spam' | 'send_failed';
72
+ export interface EmailLogItem {
73
+ /**
74
+ * The group this email belongs to: payments, refunds, subscriptions,
75
+ * dunning_recovery, entitlements or auth.
76
+ */
77
+ category: string;
78
+ /**
79
+ * When this email was sent.
80
+ */
81
+ created_at: string;
82
+ /**
83
+ * Identifies this email. Use it to read the body or to send it again.
84
+ */
85
+ email_log_id: string;
86
+ /**
87
+ * What kind of email this is, for example `payment_successful`.
88
+ */
89
+ email_type: string;
90
+ /**
91
+ * Whether this email has content to show. The content endpoint can still refuse,
92
+ * because the content is removed after 180 days.
93
+ */
94
+ has_preview: boolean;
95
+ /**
96
+ * What you may do with this email.
97
+ */
98
+ policies: EmailPolicies;
99
+ /**
100
+ * Where the email got to: sent, delivered, failed, complained or blocked.
101
+ */
102
+ status: EmailLogStatus;
103
+ /**
104
+ * Why the email did not arrive. It is null unless the email failed.
105
+ */
106
+ failure_code?: EmailFailureCode | null;
107
+ /**
108
+ * A sentence that explains `failure_code`. It is null unless the email failed.
109
+ */
110
+ failure_reason?: string | null;
111
+ /**
112
+ * The address the email was sent from.
113
+ */
114
+ from?: string | null;
115
+ /**
116
+ * What the merchant typed, when test mode redirected the send to the business
117
+ * owner.
118
+ */
119
+ intended_recipient?: string | null;
120
+ /**
121
+ * The address the email reached.
122
+ */
123
+ recipient?: string | null;
124
+ /**
125
+ * The subject line as it was sent. Empty until the provider replicates.
126
+ */
127
+ subject?: string | null;
128
+ }
129
+ /**
130
+ * The delivery status of one email.
131
+ *
132
+ * `sent` also covers an email that is still on its way. A status only becomes
133
+ * `delivered`, `failed` or `complained` when the mail server answers.
134
+ */
135
+ export type EmailLogStatus = 'sent' | 'delivered' | 'failed' | 'complained' | 'blocked';
136
+ /**
137
+ * What the merchant may do with one row. The server decides; the client never
138
+ * derives eligibility itself.
139
+ */
140
+ export interface EmailPolicies {
141
+ /**
142
+ * A permanent failure was recorded, so the same address would be a no-op.
143
+ */
144
+ requires_different_address: boolean;
145
+ /**
146
+ * The row was delivered and may be sent again.
147
+ */
148
+ resend_allowed: boolean;
149
+ /**
150
+ * How many sends are left in this email's chain.
151
+ */
152
+ resends_remaining: number;
153
+ /**
154
+ * The row failed and may be sent again.
155
+ */
156
+ retry_allowed: boolean;
157
+ }
158
+ export interface EmailListParams extends DefaultPageNumberPaginationParams {
159
+ }
160
+ export interface EmailRetrieveBodyParams {
161
+ /**
162
+ * The customer's id
163
+ */
164
+ customer_id: string;
165
+ }
166
+ export declare namespace Emails {
167
+ export { type EmailBody as EmailBody, type EmailFailureCode as EmailFailureCode, type EmailLogItem as EmailLogItem, type EmailLogStatus as EmailLogStatus, type EmailPolicies as EmailPolicies, type EmailLogItemsDefaultPageNumberPagination as EmailLogItemsDefaultPageNumberPagination, type EmailListParams as EmailListParams, type EmailRetrieveBodyParams as EmailRetrieveBodyParams, };
168
+ }
169
+ //# sourceMappingURL=emails.d.mts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"emails.d.mts","sourceRoot":"","sources":["../../src/resources/customers/emails.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,WAAW,EAAE,gCAA4B;AAClD,OAAO,EAAE,UAAU,EAAE,mCAA+B;AACpD,OAAO,EACL,2BAA2B,EAC3B,KAAK,iCAAiC,EACtC,WAAW,EACZ,kCAA8B;AAC/B,OAAO,EAAE,cAAc,EAAE,2CAAuC;AAGhE,qBAAa,MAAO,SAAQ,WAAW;IACrC;;;;;;;;;;;;;;OAcG;IACH,IAAI,CACF,UAAU,EAAE,MAAM,EAClB,KAAK,GAAE,eAAe,GAAG,IAAI,GAAG,SAAc,EAC9C,OAAO,CAAC,EAAE,cAAc,GACvB,WAAW,CAAC,wCAAwC,EAAE,YAAY,CAAC;IAQtE;;;;;;;;;;;;;;OAcG;IACH,YAA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,IAAI,CAAC;IAEnC;;OAEG;IACH,SAAS,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC;IAE1B;;OAEG;IACH,OAAO,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC;CACzB;AAED;;;;;GAKG;AACH,MAAM,MAAM,cAAc,GAAG,MAAM,GAAG,WAAW,GAAG,QAAQ,GAAG,YAAY,GAAG,SAAS,CAAC;AAExF;;;GAGG;AACH,MAAM,WAAW,aAAa;IAC5B;;OAEG;IACH,0BAA0B,EAAE,OAAO,CAAC;IAEpC;;OAEG;IACH,cAAc,EAAE,OAAO,CAAC;IAExB;;OAEG;IACH,iBAAiB,EAAE,MAAM,CAAC;IAE1B;;OAEG;IACH,aAAa,EAAE,OAAO,CAAC;CACxB;AAED,MAAM,WAAW,eAAgB,SAAQ,iCAAiC;CAAG;AAE7E,MAAM,WAAW,uBAAuB;IACtC;;OAEG;IACH,WAAW,EAAE,MAAM,CAAC;CACrB;AAED,MAAM,CAAC,OAAO,WAAW,MAAM,CAAC;IAC9B,OAAO,EACL,KAAK,SAAS,IAAI,SAAS,EAC3B,KAAK,gBAAgB,IAAI,gBAAgB,EACzC,KAAK,YAAY,IAAI,YAAY,EACjC,KAAK,cAAc,IAAI,cAAc,EACrC,KAAK,aAAa,IAAI,aAAa,EACnC,KAAK,wCAAwC,IAAI,wCAAwC,EACzF,KAAK,eAAe,IAAI,eAAe,EACvC,KAAK,uBAAuB,IAAI,uBAAuB,GACxD,CAAC;CACH"}
@@ -0,0 +1,169 @@
1
+ import { APIResource } from "../../core/resource.js";
2
+ import { APIPromise } from "../../core/api-promise.js";
3
+ import { DefaultPageNumberPagination, type DefaultPageNumberPaginationParams, PagePromise } from "../../core/pagination.js";
4
+ import { RequestOptions } from "../../internal/request-options.js";
5
+ export declare class Emails extends APIResource {
6
+ /**
7
+ * Returns every transactional email sent to this customer in the last 180 days,
8
+ * newest first, with its delivery outcome. Delivery status comes from the email
9
+ * provider and is as fresh as replication, typically seconds.
10
+ *
11
+ * @example
12
+ * ```ts
13
+ * // Automatically fetches more pages as needed.
14
+ * for await (const emailLogItem of client.customers.emails.list(
15
+ * 'customer_id',
16
+ * )) {
17
+ * // ...
18
+ * }
19
+ * ```
20
+ */
21
+ list(customerID: string, query?: EmailListParams | null | undefined, options?: RequestOptions): PagePromise<EmailLogItemsDefaultPageNumberPagination, EmailLogItem>;
22
+ /**
23
+ * Returns the email exactly as it was sent, plus the reason it failed when it did.
24
+ * Some emails have no body to show: an authentication email carries a live login
25
+ * token, a blocked email never reached the provider, and the provider clears
26
+ * bodies at 180 days.
27
+ *
28
+ * @example
29
+ * ```ts
30
+ * const emailBody =
31
+ * await client.customers.emails.retrieveBody(
32
+ * 'email_log_id',
33
+ * { customer_id: 'customer_id' },
34
+ * );
35
+ * ```
36
+ */
37
+ retrieveBody(emailLogID: string, params: EmailRetrieveBodyParams, options?: RequestOptions): APIPromise<EmailBody>;
38
+ }
39
+ export type EmailLogItemsDefaultPageNumberPagination = DefaultPageNumberPagination<EmailLogItem>;
40
+ export interface EmailBody {
41
+ /**
42
+ * Whether the merchant wrote this content. It is true for the recovery and dunning
43
+ * emails, which the merchant writes.
44
+ *
45
+ * The content is email HTML. Render it in a sandbox, whatever this value is.
46
+ */
47
+ merchant_authored: boolean;
48
+ /**
49
+ * Why the email did not arrive. It is null unless the email failed.
50
+ */
51
+ failure_code?: EmailFailureCode | null;
52
+ /**
53
+ * A sentence that explains `failure_code`. It is null unless the email failed.
54
+ */
55
+ failure_reason?: string | null;
56
+ /**
57
+ * The stored HTML. It is null on a text-only email.
58
+ */
59
+ html?: string | null;
60
+ /**
61
+ * The stored plain text.
62
+ */
63
+ text?: string | null;
64
+ }
65
+ /**
66
+ * Why an email did not reach the recipient.
67
+ *
68
+ * The code is stable. `send_failed` is the catch-all: it covers every failure that
69
+ * the other codes do not name.
70
+ */
71
+ export type EmailFailureCode = 'mailbox_not_found' | 'address_rejected' | 'address_suppressed' | 'mailbox_full' | 'temporary_failure' | 'message_too_large' | 'marked_as_spam' | 'send_failed';
72
+ export interface EmailLogItem {
73
+ /**
74
+ * The group this email belongs to: payments, refunds, subscriptions,
75
+ * dunning_recovery, entitlements or auth.
76
+ */
77
+ category: string;
78
+ /**
79
+ * When this email was sent.
80
+ */
81
+ created_at: string;
82
+ /**
83
+ * Identifies this email. Use it to read the body or to send it again.
84
+ */
85
+ email_log_id: string;
86
+ /**
87
+ * What kind of email this is, for example `payment_successful`.
88
+ */
89
+ email_type: string;
90
+ /**
91
+ * Whether this email has content to show. The content endpoint can still refuse,
92
+ * because the content is removed after 180 days.
93
+ */
94
+ has_preview: boolean;
95
+ /**
96
+ * What you may do with this email.
97
+ */
98
+ policies: EmailPolicies;
99
+ /**
100
+ * Where the email got to: sent, delivered, failed, complained or blocked.
101
+ */
102
+ status: EmailLogStatus;
103
+ /**
104
+ * Why the email did not arrive. It is null unless the email failed.
105
+ */
106
+ failure_code?: EmailFailureCode | null;
107
+ /**
108
+ * A sentence that explains `failure_code`. It is null unless the email failed.
109
+ */
110
+ failure_reason?: string | null;
111
+ /**
112
+ * The address the email was sent from.
113
+ */
114
+ from?: string | null;
115
+ /**
116
+ * What the merchant typed, when test mode redirected the send to the business
117
+ * owner.
118
+ */
119
+ intended_recipient?: string | null;
120
+ /**
121
+ * The address the email reached.
122
+ */
123
+ recipient?: string | null;
124
+ /**
125
+ * The subject line as it was sent. Empty until the provider replicates.
126
+ */
127
+ subject?: string | null;
128
+ }
129
+ /**
130
+ * The delivery status of one email.
131
+ *
132
+ * `sent` also covers an email that is still on its way. A status only becomes
133
+ * `delivered`, `failed` or `complained` when the mail server answers.
134
+ */
135
+ export type EmailLogStatus = 'sent' | 'delivered' | 'failed' | 'complained' | 'blocked';
136
+ /**
137
+ * What the merchant may do with one row. The server decides; the client never
138
+ * derives eligibility itself.
139
+ */
140
+ export interface EmailPolicies {
141
+ /**
142
+ * A permanent failure was recorded, so the same address would be a no-op.
143
+ */
144
+ requires_different_address: boolean;
145
+ /**
146
+ * The row was delivered and may be sent again.
147
+ */
148
+ resend_allowed: boolean;
149
+ /**
150
+ * How many sends are left in this email's chain.
151
+ */
152
+ resends_remaining: number;
153
+ /**
154
+ * The row failed and may be sent again.
155
+ */
156
+ retry_allowed: boolean;
157
+ }
158
+ export interface EmailListParams extends DefaultPageNumberPaginationParams {
159
+ }
160
+ export interface EmailRetrieveBodyParams {
161
+ /**
162
+ * The customer's id
163
+ */
164
+ customer_id: string;
165
+ }
166
+ export declare namespace Emails {
167
+ export { type EmailBody as EmailBody, type EmailFailureCode as EmailFailureCode, type EmailLogItem as EmailLogItem, type EmailLogStatus as EmailLogStatus, type EmailPolicies as EmailPolicies, type EmailLogItemsDefaultPageNumberPagination as EmailLogItemsDefaultPageNumberPagination, type EmailListParams as EmailListParams, type EmailRetrieveBodyParams as EmailRetrieveBodyParams, };
168
+ }
169
+ //# sourceMappingURL=emails.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"emails.d.ts","sourceRoot":"","sources":["../../src/resources/customers/emails.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,WAAW,EAAE,+BAA4B;AAClD,OAAO,EAAE,UAAU,EAAE,kCAA+B;AACpD,OAAO,EACL,2BAA2B,EAC3B,KAAK,iCAAiC,EACtC,WAAW,EACZ,iCAA8B;AAC/B,OAAO,EAAE,cAAc,EAAE,0CAAuC;AAGhE,qBAAa,MAAO,SAAQ,WAAW;IACrC;;;;;;;;;;;;;;OAcG;IACH,IAAI,CACF,UAAU,EAAE,MAAM,EAClB,KAAK,GAAE,eAAe,GAAG,IAAI,GAAG,SAAc,EAC9C,OAAO,CAAC,EAAE,cAAc,GACvB,WAAW,CAAC,wCAAwC,EAAE,YAAY,CAAC;IAQtE;;;;;;;;;;;;;;OAcG;IACH,YAAY,CACV,UAAU,EAAE,MAAM,EAClB,MAAM,EAAE,uBAAuB,EAC/B,OAAO,CAAC,EAAE,cAAc,GACvB,UAAU,CAAC,SAAS,CAAC;CAIzB;AAED,MAAM,MAAM,wCAA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AAED;;;;;GAKG;AACH,MAAM,MAAM,cAAc,GAAG,MAAM,GAAG,WAAW,GAAG,QAAQ,GAAG,YAAY,GAAG,SAAS,CAAC;AAExF;;;GAGG;AACH,MAAM,WAAW,aAAa;IAC5B;;OAEG;IACH,0BAA0B,EAAE,OAAO,CAAC;IAEpC;;OAEG;IACH,cAAc,EAAE,OAAO,CAAC;IAExB;;OAEG;IACH,iBAAiB,EAAE,MAAM,CAAC;IAE1B;;OAEG;IACH,aAAa,EAAE,OAAO,CAAC;CACxB;AAED,MAAM,WAAW,eAAgB,SAAQ,iCAAiC;CAAG;AAE7E,MAAM,WAAW,uBAAuB;IACtC;;OAEG;IACH,WAAW,EAAE,MAAM,CAAC;CACrB;AAED,MAAM,CAAC,OAAO,WAAW,MAAM,CAAC;IAC9B,OAAO,EACL,KAAK,SAAS,IAAI,SAAS,EAC3B,KAAK,gBAAgB,IAAI,gBAAgB,EACzC,KAAK,YAAY,IAAI,YAAY,EACjC,KAAK,cAAc,IAAI,cAAc,EACrC,KAAK,aAAa,IAAI,aAAa,EACnC,KAAK,wCAAwC,IAAI,wCAAwC,EACzF,KAAK,eAAe,IAAI,eAAe,EACvC,KAAK,uBAAuB,IAAI,uBAAuB,GACxD,CAAC;CACH"}
@@ -0,0 +1,48 @@
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.Emails = void 0;
5
+ const resource_1 = require("../../core/resource.js");
6
+ const pagination_1 = require("../../core/pagination.js");
7
+ const path_1 = require("../../internal/utils/path.js");
8
+ class Emails extends resource_1.APIResource {
9
+ /**
10
+ * Returns every transactional email sent to this customer in the last 180 days,
11
+ * newest first, with its delivery outcome. Delivery status comes from the email
12
+ * provider and is as fresh as replication, typically seconds.
13
+ *
14
+ * @example
15
+ * ```ts
16
+ * // Automatically fetches more pages as needed.
17
+ * for await (const emailLogItem of client.customers.emails.list(
18
+ * 'customer_id',
19
+ * )) {
20
+ * // ...
21
+ * }
22
+ * ```
23
+ */
24
+ list(customerID, query = {}, options) {
25
+ return this._client.getAPIList((0, path_1.path) `/customers/${customerID}/emails`, (pagination_1.DefaultPageNumberPagination), { query, ...options });
26
+ }
27
+ /**
28
+ * Returns the email exactly as it was sent, plus the reason it failed when it did.
29
+ * Some emails have no body to show: an authentication email carries a live login
30
+ * token, a blocked email never reached the provider, and the provider clears
31
+ * bodies at 180 days.
32
+ *
33
+ * @example
34
+ * ```ts
35
+ * const emailBody =
36
+ * await client.customers.emails.retrieveBody(
37
+ * 'email_log_id',
38
+ * { customer_id: 'customer_id' },
39
+ * );
40
+ * ```
41
+ */
42
+ retrieveBody(emailLogID, params, options) {
43
+ const { customer_id } = params;
44
+ return this._client.get((0, path_1.path) `/customers/${customer_id}/emails/${emailLogID}/body`, options);
45
+ }
46
+ }
47
+ exports.Emails = Emails;
48
+ //# sourceMappingURL=emails.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"emails.js","sourceRoot":"","sources":["../../src/resources/customers/emails.ts"],"names":[],"mappings":";AAAA,sFAAsF;;;AAEtF,qDAAkD;AAElD,yDAI+B;AAE/B,uDAAiD;AAEjD,MAAa,MAAO,SAAQ,sBAAW;IACrC;;;;;;;;;;;;;;OAcG;IACH,IAAI,CACF,UAAkB,EAClB,QAA4C,EAAE,EAC9C,OAAwB;QAExB,OAAO,IAAI,CAAC,OAAO,CAAC,UAAU,CAC5B,IAAA,WAAI,EAAA,cAAc,UAAU,SAAS,EACrC,CAAA,wCAAyC,CAAA,EACzC,EAAE,KAAK,EAAE,GAAG,OAAO,EAAE,CACtB,CAAC;IACJ,CAAC;IAED;;;;;;;;;;;;;;OAcG;IACH,YAAY,CACV,UAAkB,EAClB,MAA+B,EAC/B,OAAwB;QAExB,MAAM,EAAE,WAAW,EAAE,GAAG,MAAM,CAAC;QAC/B,OAAO,IAAI,CAAC,OAAO,CAAC,GAAG,CAAC,IAAA,WAAI,EAAA,cAAc,WAAW,WAAW,UAAU,OAAO,EAAE,OAAO,CAAC,CAAC;IAC9F,CAAC;CACF;AAnDD,wBAmDC"}
@@ -0,0 +1,44 @@
1
+ // File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
2
+ import { APIResource } from "../../core/resource.mjs";
3
+ import { DefaultPageNumberPagination, } from "../../core/pagination.mjs";
4
+ import { path } from "../../internal/utils/path.mjs";
5
+ export class Emails extends APIResource {
6
+ /**
7
+ * Returns every transactional email sent to this customer in the last 180 days,
8
+ * newest first, with its delivery outcome. Delivery status comes from the email
9
+ * provider and is as fresh as replication, typically seconds.
10
+ *
11
+ * @example
12
+ * ```ts
13
+ * // Automatically fetches more pages as needed.
14
+ * for await (const emailLogItem of client.customers.emails.list(
15
+ * 'customer_id',
16
+ * )) {
17
+ * // ...
18
+ * }
19
+ * ```
20
+ */
21
+ list(customerID, query = {}, options) {
22
+ return this._client.getAPIList(path `/customers/${customerID}/emails`, (DefaultPageNumberPagination), { query, ...options });
23
+ }
24
+ /**
25
+ * Returns the email exactly as it was sent, plus the reason it failed when it did.
26
+ * Some emails have no body to show: an authentication email carries a live login
27
+ * token, a blocked email never reached the provider, and the provider clears
28
+ * bodies at 180 days.
29
+ *
30
+ * @example
31
+ * ```ts
32
+ * const emailBody =
33
+ * await client.customers.emails.retrieveBody(
34
+ * 'email_log_id',
35
+ * { customer_id: 'customer_id' },
36
+ * );
37
+ * ```
38
+ */
39
+ retrieveBody(emailLogID, params, options) {
40
+ const { customer_id } = params;
41
+ return this._client.get(path `/customers/${customer_id}/emails/${emailLogID}/body`, options);
42
+ }
43
+ }
44
+ //# sourceMappingURL=emails.mjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"emails.mjs","sourceRoot":"","sources":["../../src/resources/customers/emails.ts"],"names":[],"mappings":"AAAA,sFAAsF;AAEtF,OAAO,EAAE,WAAW,EAAE,gCAA4B;AAElD,OAAO,EACL,2BAA2B,GAG5B,kCAA8B;AAE/B,OAAO,EAAE,IAAI,EAAE,sCAAkC;AAEjD,MAAM,OAAO,MAAO,SAAQ,WAAW;IACrC;;;;;;;;;;;;;;OAcG;IACH,IAAI,CACF,UAAkB,EAClB,QAA4C,EAAE,EAC9C,OAAwB;QAExB,OAAO,IAAI,CAAC,OAAO,CAAC,UAAU,CAC5B,IAAI,CAAA,cAAc,UAAU,SAAS,EACrC,CAAA,2BAAyC,CAAA,EACzC,EAAE,KAAK,EAAE,GAAG,OAAO,EAAE,CACtB,CAAC;IACJ,CAAC;IAED;;;;;;;;;;;;;;OAcG;IACH,YAAY,CACV,UAAkB,EAClB,MAA+B,EAC/B,OAAwB;QAExB,MAAM,EAAE,WAAW,EAAE,GAAG,MAAM,CAAC;QAC/B,OAAO,IAAI,CAAC,OAAO,CAAC,GAAG,CAAC,IAAI,CAAA,cAAc,WAAW,WAAW,UAAU,OAAO,EAAE,OAAO,CAAC,CAAC;IAC9F,CAAC;CACF"}
@@ -1,4 +1,5 @@
1
1
  export { CustomerPortal, type CustomerPortalCreateParams } from "./customer-portal.mjs";
2
2
  export { Customers, type Customer, type CustomerPortalSession, type CustomerListCreditEntitlementsResponse, type CustomerListEntitlementsResponse, type CustomerRetrievePaymentMethodsResponse, type CustomerListParams, type CustomerCreateParams, type CustomerUpdateParams, type CustomerDeletePaymentMethodParams, type CustomerListEntitlementGrantsParams, type CustomersDefaultPageNumberPagination, } from "./customers.mjs";
3
+ export { Emails, type EmailBody, type EmailFailureCode, type EmailLogItem, type EmailLogStatus, type EmailPolicies, type EmailListParams, type EmailRetrieveBodyParams, type EmailLogItemsDefaultPageNumberPagination, } from "./emails.mjs";
3
4
  export { Wallets, type CustomerWallet, type WalletListResponse } from "./wallets/index.mjs";
4
5
  //# sourceMappingURL=index.d.mts.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.mts","sourceRoot":"","sources":["../../src/resources/customers/index.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,cAAc,EAAE,KAAK,0BAA0B,EAAE,8BAA0B;AACpF,OAAO,EACL,SAAS,EACT,KAAK,QAAQ,EACb,KAAK,qBAAqB,EAC1B,KAAK,sCAAsC,EAC3C,KAAK,gCAAgC,EACrC,KAAK,sCAAsC,EAC3C,KAAK,kBAAkB,EACvB,KAAK,oBAAoB,EACzB,KAAK,oBAAoB,EACzB,KAAK,iCAAiC,EACtC,KAAK,mCAAmC,EACxC,KAAK,oCAAoC,GAC1C,wBAAoB;AACrB,OAAO,EAAE,OAAO,EAAE,KAAK,cAAc,EAAE,KAAK,kBAAkB,EAAE,4BAAwB"}
1
+ {"version":3,"file":"index.d.mts","sourceRoot":"","sources":["../../src/resources/customers/index.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,cAAc,EAAE,KAAK,0BAA0B,EAAE,8BAA0B;AACpF,OAAO,EACL,SAAS,EACT,KAAK,QAAQ,EACb,KAAK,qBAAqB,EAC1B,KAAK,sCAAsC,EAC3C,KAAK,gCAAgC,EACrC,KAAK,sCAAsC,EAC3C,KAAK,kBAAkB,EACvB,KAAK,oBAAoB,EACzB,KAAK,oBAAoB,EACzB,KAAK,iCAAiC,EACtC,KAAK,mCAAmC,EACxC,KAAK,oCAAoC,GAC1C,wBAAoB;AACrB,OAAO,EACL,MAAM,EACN,KAAK,SAAS,EACd,KAAK,gBAAgB,EACrB,KAAK,YAAY,EACjB,KAAK,cAAc,EACnB,KAAK,aAAa,EAClB,KAAK,eAAe,EACpB,KAAK,uBAAuB,EAC5B,KAAK,wCAAwC,GAC9C,qBAAiB;AAClB,OAAO,EAAE,OAAO,EAAE,KAAK,cAAc,EAAE,KAAK,kBAAkB,EAAE,4BAAwB"}
@@ -1,4 +1,5 @@
1
1
  export { CustomerPortal, type CustomerPortalCreateParams } from "./customer-portal.js";
2
2
  export { Customers, type Customer, type CustomerPortalSession, type CustomerListCreditEntitlementsResponse, type CustomerListEntitlementsResponse, type CustomerRetrievePaymentMethodsResponse, type CustomerListParams, type CustomerCreateParams, type CustomerUpdateParams, type CustomerDeletePaymentMethodParams, type CustomerListEntitlementGrantsParams, type CustomersDefaultPageNumberPagination, } from "./customers.js";
3
+ export { Emails, type EmailBody, type EmailFailureCode, type EmailLogItem, type EmailLogStatus, type EmailPolicies, type EmailListParams, type EmailRetrieveBodyParams, type EmailLogItemsDefaultPageNumberPagination, } from "./emails.js";
3
4
  export { Wallets, type CustomerWallet, type WalletListResponse } from "./wallets/index.js";
4
5
  //# sourceMappingURL=index.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/resources/customers/index.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,cAAc,EAAE,KAAK,0BAA0B,EAAE,6BAA0B;AACpF,OAAO,EACL,SAAS,EACT,KAAK,QAAQ,EACb,KAAK,qBAAqB,EAC1B,KAAK,sCAAsC,EAC3C,KAAK,gCAAgC,EACrC,KAAK,sCAAsC,EAC3C,KAAK,kBAAkB,EACvB,KAAK,oBAAoB,EACzB,KAAK,oBAAoB,EACzB,KAAK,iCAAiC,EACtC,KAAK,mCAAmC,EACxC,KAAK,oCAAoC,GAC1C,uBAAoB;AACrB,OAAO,EAAE,OAAO,EAAE,KAAK,cAAc,EAAE,KAAK,kBAAkB,EAAE,2BAAwB"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/resources/customers/index.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,cAAc,EAAE,KAAK,0BAA0B,EAAE,6BAA0B;AACpF,OAAO,EACL,SAAS,EACT,KAAK,QAAQ,EACb,KAAK,qBAAqB,EAC1B,KAAK,sCAAsC,EAC3C,KAAK,gCAAgC,EACrC,KAAK,sCAAsC,EAC3C,KAAK,kBAAkB,EACvB,KAAK,oBAAoB,EACzB,KAAK,oBAAoB,EACzB,KAAK,iCAAiC,EACtC,KAAK,mCAAmC,EACxC,KAAK,oCAAoC,GAC1C,uBAAoB;AACrB,OAAO,EACL,MAAM,EACN,KAAK,SAAS,EACd,KAAK,gBAAgB,EACrB,KAAK,YAAY,EACjB,KAAK,cAAc,EACnB,KAAK,aAAa,EAClB,KAAK,eAAe,EACpB,KAAK,uBAAuB,EAC5B,KAAK,wCAAwC,GAC9C,oBAAiB;AAClB,OAAO,EAAE,OAAO,EAAE,KAAK,cAAc,EAAE,KAAK,kBAAkB,EAAE,2BAAwB"}
@@ -1,11 +1,13 @@
1
1
  "use strict";
2
2
  // File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
3
3
  Object.defineProperty(exports, "__esModule", { value: true });
4
- exports.Wallets = exports.Customers = exports.CustomerPortal = void 0;
4
+ exports.Wallets = exports.Emails = exports.Customers = exports.CustomerPortal = void 0;
5
5
  var customer_portal_1 = require("./customer-portal.js");
6
6
  Object.defineProperty(exports, "CustomerPortal", { enumerable: true, get: function () { return customer_portal_1.CustomerPortal; } });
7
7
  var customers_1 = require("./customers.js");
8
8
  Object.defineProperty(exports, "Customers", { enumerable: true, get: function () { return customers_1.Customers; } });
9
+ var emails_1 = require("./emails.js");
10
+ Object.defineProperty(exports, "Emails", { enumerable: true, get: function () { return emails_1.Emails; } });
9
11
  var index_1 = require("./wallets/index.js");
10
12
  Object.defineProperty(exports, "Wallets", { enumerable: true, get: function () { return index_1.Wallets; } });
11
13
  //# sourceMappingURL=index.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/resources/customers/index.ts"],"names":[],"mappings":";AAAA,sFAAsF;;;AAEtF,wDAAoF;AAA3E,iHAAA,cAAc,OAAA;AACvB,4CAaqB;AAZnB,sGAAA,SAAS,OAAA;AAaX,4CAAwF;AAA/E,gGAAA,OAAO,OAAA"}
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/resources/customers/index.ts"],"names":[],"mappings":";AAAA,sFAAsF;;;AAEtF,wDAAoF;AAA3E,iHAAA,cAAc,OAAA;AACvB,4CAaqB;AAZnB,sGAAA,SAAS,OAAA;AAaX,sCAUkB;AAThB,gGAAA,MAAM,OAAA;AAUR,4CAAwF;AAA/E,gGAAA,OAAO,OAAA"}
@@ -1,5 +1,6 @@
1
1
  // File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
2
2
  export { CustomerPortal } from "./customer-portal.mjs";
3
3
  export { Customers, } from "./customers.mjs";
4
+ export { Emails, } from "./emails.mjs";
4
5
  export { Wallets } from "./wallets/index.mjs";
5
6
  //# sourceMappingURL=index.mjs.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.mjs","sourceRoot":"","sources":["../../src/resources/customers/index.ts"],"names":[],"mappings":"AAAA,sFAAsF;AAEtF,OAAO,EAAE,cAAc,EAAmC,8BAA0B;AACpF,OAAO,EACL,SAAS,GAYV,wBAAoB;AACrB,OAAO,EAAE,OAAO,EAAgD,4BAAwB"}
1
+ {"version":3,"file":"index.mjs","sourceRoot":"","sources":["../../src/resources/customers/index.ts"],"names":[],"mappings":"AAAA,sFAAsF;AAEtF,OAAO,EAAE,cAAc,EAAmC,8BAA0B;AACpF,OAAO,EACL,SAAS,GAYV,wBAAoB;AACrB,OAAO,EACL,MAAM,GASP,qBAAiB;AAClB,OAAO,EAAE,OAAO,EAAgD,4BAAwB"}