@stigg/typescript 0.1.0-beta.20 → 0.1.0-beta.21

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 (274) hide show
  1. package/CHANGELOG.md +8 -0
  2. package/package.json +1 -1
  3. package/resources/v1/addons/addons.d.mts +143 -33
  4. package/resources/v1/addons/addons.d.mts.map +1 -1
  5. package/resources/v1/addons/addons.d.ts +143 -33
  6. package/resources/v1/addons/addons.d.ts.map +1 -1
  7. package/resources/v1/addons/addons.js +110 -17
  8. package/resources/v1/addons/addons.js.map +1 -1
  9. package/resources/v1/addons/addons.mjs +110 -17
  10. package/resources/v1/addons/addons.mjs.map +1 -1
  11. package/resources/v1/addons/entitlements.d.mts +62 -5
  12. package/resources/v1/addons/entitlements.d.mts.map +1 -1
  13. package/resources/v1/addons/entitlements.d.ts +62 -5
  14. package/resources/v1/addons/entitlements.d.ts.map +1 -1
  15. package/resources/v1/addons/entitlements.js +49 -8
  16. package/resources/v1/addons/entitlements.js.map +1 -1
  17. package/resources/v1/addons/entitlements.mjs +49 -8
  18. package/resources/v1/addons/entitlements.mjs.map +1 -1
  19. package/resources/v1/addons/index.d.mts +2 -2
  20. package/resources/v1/addons/index.d.mts.map +1 -1
  21. package/resources/v1/addons/index.d.ts +2 -2
  22. package/resources/v1/addons/index.d.ts.map +1 -1
  23. package/resources/v1/addons/index.js.map +1 -1
  24. package/resources/v1/addons/index.mjs.map +1 -1
  25. package/resources/v1/coupons.d.mts +80 -20
  26. package/resources/v1/coupons.d.mts.map +1 -1
  27. package/resources/v1/coupons.d.ts +80 -20
  28. package/resources/v1/coupons.d.ts.map +1 -1
  29. package/resources/v1/coupons.js +60 -9
  30. package/resources/v1/coupons.js.map +1 -1
  31. package/resources/v1/coupons.mjs +60 -9
  32. package/resources/v1/coupons.mjs.map +1 -1
  33. package/resources/v1/credits/credits.d.mts +59 -26
  34. package/resources/v1/credits/credits.d.mts.map +1 -1
  35. package/resources/v1/credits/credits.d.ts +59 -26
  36. package/resources/v1/credits/credits.d.ts.map +1 -1
  37. package/resources/v1/credits/credits.js +36 -5
  38. package/resources/v1/credits/credits.js.map +1 -1
  39. package/resources/v1/credits/credits.mjs +36 -5
  40. package/resources/v1/credits/credits.mjs.map +1 -1
  41. package/resources/v1/credits/custom-currencies.d.mts +96 -23
  42. package/resources/v1/credits/custom-currencies.d.mts.map +1 -1
  43. package/resources/v1/credits/custom-currencies.d.ts +96 -23
  44. package/resources/v1/credits/custom-currencies.d.ts.map +1 -1
  45. package/resources/v1/credits/custom-currencies.js +76 -12
  46. package/resources/v1/credits/custom-currencies.js.map +1 -1
  47. package/resources/v1/credits/custom-currencies.mjs +76 -12
  48. package/resources/v1/credits/custom-currencies.mjs.map +1 -1
  49. package/resources/v1/credits/grants.d.mts +60 -23
  50. package/resources/v1/credits/grants.d.mts.map +1 -1
  51. package/resources/v1/credits/grants.d.ts +60 -23
  52. package/resources/v1/credits/grants.d.ts.map +1 -1
  53. package/resources/v1/credits/grants.js +35 -5
  54. package/resources/v1/credits/grants.js.map +1 -1
  55. package/resources/v1/credits/grants.mjs +35 -5
  56. package/resources/v1/credits/grants.mjs.map +1 -1
  57. package/resources/v1/credits/index.d.mts +2 -2
  58. package/resources/v1/credits/index.d.mts.map +1 -1
  59. package/resources/v1/credits/index.d.ts +2 -2
  60. package/resources/v1/credits/index.d.ts.map +1 -1
  61. package/resources/v1/credits/index.js.map +1 -1
  62. package/resources/v1/credits/index.mjs.map +1 -1
  63. package/resources/v1/customers/customers.d.mts +165 -48
  64. package/resources/v1/customers/customers.d.mts.map +1 -1
  65. package/resources/v1/customers/customers.d.ts +165 -48
  66. package/resources/v1/customers/customers.d.ts.map +1 -1
  67. package/resources/v1/customers/customers.js +124 -19
  68. package/resources/v1/customers/customers.js.map +1 -1
  69. package/resources/v1/customers/customers.mjs +124 -19
  70. package/resources/v1/customers/customers.mjs.map +1 -1
  71. package/resources/v1/customers/index.d.mts +2 -2
  72. package/resources/v1/customers/index.d.mts.map +1 -1
  73. package/resources/v1/customers/index.d.ts +2 -2
  74. package/resources/v1/customers/index.d.ts.map +1 -1
  75. package/resources/v1/customers/index.js.map +1 -1
  76. package/resources/v1/customers/index.mjs +1 -1
  77. package/resources/v1/customers/index.mjs.map +1 -1
  78. package/resources/v1/customers/integrations.d.mts +64 -9
  79. package/resources/v1/customers/integrations.d.mts.map +1 -1
  80. package/resources/v1/customers/integrations.d.ts +64 -9
  81. package/resources/v1/customers/integrations.d.ts.map +1 -1
  82. package/resources/v1/customers/integrations.js +57 -9
  83. package/resources/v1/customers/integrations.js.map +1 -1
  84. package/resources/v1/customers/integrations.mjs +57 -9
  85. package/resources/v1/customers/integrations.mjs.map +1 -1
  86. package/resources/v1/customers/payment-method.d.mts +31 -7
  87. package/resources/v1/customers/payment-method.d.mts.map +1 -1
  88. package/resources/v1/customers/payment-method.d.ts +31 -7
  89. package/resources/v1/customers/payment-method.d.ts.map +1 -1
  90. package/resources/v1/customers/payment-method.js +26 -4
  91. package/resources/v1/customers/payment-method.js.map +1 -1
  92. package/resources/v1/customers/payment-method.mjs +26 -4
  93. package/resources/v1/customers/payment-method.mjs.map +1 -1
  94. package/resources/v1/customers/promotional-entitlements.d.mts +40 -7
  95. package/resources/v1/customers/promotional-entitlements.d.mts.map +1 -1
  96. package/resources/v1/customers/promotional-entitlements.d.ts +40 -7
  97. package/resources/v1/customers/promotional-entitlements.d.ts.map +1 -1
  98. package/resources/v1/customers/promotional-entitlements.js +38 -6
  99. package/resources/v1/customers/promotional-entitlements.js.map +1 -1
  100. package/resources/v1/customers/promotional-entitlements.mjs +38 -6
  101. package/resources/v1/customers/promotional-entitlements.mjs.map +1 -1
  102. package/resources/v1/events/beta/customers/assignments.d.mts +27 -5
  103. package/resources/v1/events/beta/customers/assignments.d.mts.map +1 -1
  104. package/resources/v1/events/beta/customers/assignments.d.ts +27 -5
  105. package/resources/v1/events/beta/customers/assignments.d.ts.map +1 -1
  106. package/resources/v1/events/beta/customers/assignments.js +27 -4
  107. package/resources/v1/events/beta/customers/assignments.js.map +1 -1
  108. package/resources/v1/events/beta/customers/assignments.mjs +27 -4
  109. package/resources/v1/events/beta/customers/assignments.mjs.map +1 -1
  110. package/resources/v1/events/beta/customers/entities.d.mts +66 -10
  111. package/resources/v1/events/beta/customers/entities.d.mts.map +1 -1
  112. package/resources/v1/events/beta/customers/entities.d.ts +66 -10
  113. package/resources/v1/events/beta/customers/entities.d.ts.map +1 -1
  114. package/resources/v1/events/beta/customers/entities.js +64 -10
  115. package/resources/v1/events/beta/customers/entities.js.map +1 -1
  116. package/resources/v1/events/beta/customers/entities.mjs +64 -10
  117. package/resources/v1/events/beta/customers/entities.mjs.map +1 -1
  118. package/resources/v1/events/beta/customers/entitlements.d.mts +23 -10
  119. package/resources/v1/events/beta/customers/entitlements.d.mts.map +1 -1
  120. package/resources/v1/events/beta/customers/entitlements.d.ts +23 -10
  121. package/resources/v1/events/beta/customers/entitlements.d.ts.map +1 -1
  122. package/resources/v1/events/beta/customers/entitlements.js +14 -2
  123. package/resources/v1/events/beta/customers/entitlements.js.map +1 -1
  124. package/resources/v1/events/beta/customers/entitlements.mjs +14 -2
  125. package/resources/v1/events/beta/customers/entitlements.mjs.map +1 -1
  126. package/resources/v1/events/beta/entity-types.d.mts +25 -3
  127. package/resources/v1/events/beta/entity-types.d.mts.map +1 -1
  128. package/resources/v1/events/beta/entity-types.d.ts +25 -3
  129. package/resources/v1/events/beta/entity-types.d.ts.map +1 -1
  130. package/resources/v1/events/beta/entity-types.js +23 -3
  131. package/resources/v1/events/beta/entity-types.js.map +1 -1
  132. package/resources/v1/events/beta/entity-types.mjs +23 -3
  133. package/resources/v1/events/beta/entity-types.mjs.map +1 -1
  134. package/resources/v1/events/events.d.mts +13 -2
  135. package/resources/v1/events/events.d.mts.map +1 -1
  136. package/resources/v1/events/events.d.ts +13 -2
  137. package/resources/v1/events/events.d.ts.map +1 -1
  138. package/resources/v1/events/events.js +14 -2
  139. package/resources/v1/events/events.js.map +1 -1
  140. package/resources/v1/events/events.mjs +14 -2
  141. package/resources/v1/events/events.mjs.map +1 -1
  142. package/resources/v1/features.d.mts +108 -30
  143. package/resources/v1/features.d.mts.map +1 -1
  144. package/resources/v1/features.d.ts +108 -30
  145. package/resources/v1/features.d.ts.map +1 -1
  146. package/resources/v1/features.js +72 -11
  147. package/resources/v1/features.js.map +1 -1
  148. package/resources/v1/features.mjs +72 -11
  149. package/resources/v1/features.mjs.map +1 -1
  150. package/resources/v1/index.d.mts +7 -7
  151. package/resources/v1/index.d.mts.map +1 -1
  152. package/resources/v1/index.d.ts +7 -7
  153. package/resources/v1/index.d.ts.map +1 -1
  154. package/resources/v1/index.js.map +1 -1
  155. package/resources/v1/index.mjs.map +1 -1
  156. package/resources/v1/plans/entitlements.d.mts +62 -5
  157. package/resources/v1/plans/entitlements.d.mts.map +1 -1
  158. package/resources/v1/plans/entitlements.d.ts +62 -5
  159. package/resources/v1/plans/entitlements.d.ts.map +1 -1
  160. package/resources/v1/plans/entitlements.js +49 -8
  161. package/resources/v1/plans/entitlements.js.map +1 -1
  162. package/resources/v1/plans/entitlements.mjs +49 -8
  163. package/resources/v1/plans/entitlements.mjs.map +1 -1
  164. package/resources/v1/plans/index.d.mts +2 -2
  165. package/resources/v1/plans/index.d.mts.map +1 -1
  166. package/resources/v1/plans/index.d.ts +2 -2
  167. package/resources/v1/plans/index.d.ts.map +1 -1
  168. package/resources/v1/plans/index.js.map +1 -1
  169. package/resources/v1/plans/index.mjs.map +1 -1
  170. package/resources/v1/plans/plans.d.mts +156 -34
  171. package/resources/v1/plans/plans.d.mts.map +1 -1
  172. package/resources/v1/plans/plans.d.ts +156 -34
  173. package/resources/v1/plans/plans.d.ts.map +1 -1
  174. package/resources/v1/plans/plans.js +127 -20
  175. package/resources/v1/plans/plans.js.map +1 -1
  176. package/resources/v1/plans/plans.mjs +127 -20
  177. package/resources/v1/plans/plans.mjs.map +1 -1
  178. package/resources/v1/products.d.mts +97 -23
  179. package/resources/v1/products.d.mts.map +1 -1
  180. package/resources/v1/products.d.ts +97 -23
  181. package/resources/v1/products.d.ts.map +1 -1
  182. package/resources/v1/products.js +73 -11
  183. package/resources/v1/products.js.map +1 -1
  184. package/resources/v1/products.mjs +73 -11
  185. package/resources/v1/products.mjs.map +1 -1
  186. package/resources/v1/subscriptions/future-update.d.mts +29 -3
  187. package/resources/v1/subscriptions/future-update.d.mts.map +1 -1
  188. package/resources/v1/subscriptions/future-update.d.ts +29 -3
  189. package/resources/v1/subscriptions/future-update.d.ts.map +1 -1
  190. package/resources/v1/subscriptions/future-update.js +25 -4
  191. package/resources/v1/subscriptions/future-update.js.map +1 -1
  192. package/resources/v1/subscriptions/future-update.mjs +25 -4
  193. package/resources/v1/subscriptions/future-update.mjs.map +1 -1
  194. package/resources/v1/subscriptions/index.d.mts +4 -4
  195. package/resources/v1/subscriptions/index.d.mts.map +1 -1
  196. package/resources/v1/subscriptions/index.d.ts +4 -4
  197. package/resources/v1/subscriptions/index.d.ts.map +1 -1
  198. package/resources/v1/subscriptions/index.js.map +1 -1
  199. package/resources/v1/subscriptions/index.mjs +1 -1
  200. package/resources/v1/subscriptions/index.mjs.map +1 -1
  201. package/resources/v1/subscriptions/invoice.d.mts +15 -2
  202. package/resources/v1/subscriptions/invoice.d.mts.map +1 -1
  203. package/resources/v1/subscriptions/invoice.d.ts +15 -2
  204. package/resources/v1/subscriptions/invoice.d.ts.map +1 -1
  205. package/resources/v1/subscriptions/invoice.js +13 -2
  206. package/resources/v1/subscriptions/invoice.js.map +1 -1
  207. package/resources/v1/subscriptions/invoice.mjs +13 -2
  208. package/resources/v1/subscriptions/invoice.mjs.map +1 -1
  209. package/resources/v1/subscriptions/subscriptions.d.mts +242 -78
  210. package/resources/v1/subscriptions/subscriptions.d.mts.map +1 -1
  211. package/resources/v1/subscriptions/subscriptions.d.ts +242 -78
  212. package/resources/v1/subscriptions/subscriptions.d.ts.map +1 -1
  213. package/resources/v1/subscriptions/subscriptions.js +126 -19
  214. package/resources/v1/subscriptions/subscriptions.js.map +1 -1
  215. package/resources/v1/subscriptions/subscriptions.mjs +128 -21
  216. package/resources/v1/subscriptions/subscriptions.mjs.map +1 -1
  217. package/resources/v1/subscriptions/usage.d.mts +29 -4
  218. package/resources/v1/subscriptions/usage.d.mts.map +1 -1
  219. package/resources/v1/subscriptions/usage.d.ts +29 -4
  220. package/resources/v1/subscriptions/usage.d.ts.map +1 -1
  221. package/resources/v1/subscriptions/usage.js +26 -4
  222. package/resources/v1/subscriptions/usage.js.map +1 -1
  223. package/resources/v1/subscriptions/usage.mjs +26 -4
  224. package/resources/v1/subscriptions/usage.mjs.map +1 -1
  225. package/resources/v1/usage.d.mts +24 -2
  226. package/resources/v1/usage.d.mts.map +1 -1
  227. package/resources/v1/usage.d.ts +24 -2
  228. package/resources/v1/usage.d.ts.map +1 -1
  229. package/resources/v1/usage.js +26 -4
  230. package/resources/v1/usage.js.map +1 -1
  231. package/resources/v1/usage.mjs +26 -4
  232. package/resources/v1/usage.mjs.map +1 -1
  233. package/resources/v1/v1.d.mts +14 -14
  234. package/resources/v1/v1.d.mts.map +1 -1
  235. package/resources/v1/v1.d.ts +14 -14
  236. package/resources/v1/v1.d.ts.map +1 -1
  237. package/resources/v1/v1.js.map +1 -1
  238. package/resources/v1/v1.mjs.map +1 -1
  239. package/src/resources/v1/addons/addons.ts +286 -39
  240. package/src/resources/v1/addons/entitlements.ts +123 -10
  241. package/src/resources/v1/addons/index.ts +5 -0
  242. package/src/resources/v1/coupons.ts +154 -23
  243. package/src/resources/v1/credits/credits.ts +102 -24
  244. package/src/resources/v1/credits/custom-currencies.ts +188 -30
  245. package/src/resources/v1/credits/grants.ts +102 -24
  246. package/src/resources/v1/credits/index.ts +4 -0
  247. package/src/resources/v1/customers/customers.ts +318 -57
  248. package/src/resources/v1/customers/index.ts +8 -1
  249. package/src/resources/v1/customers/integrations.ts +129 -16
  250. package/src/resources/v1/customers/payment-method.ts +66 -9
  251. package/src/resources/v1/customers/promotional-entitlements.ts +82 -11
  252. package/src/resources/v1/events/beta/customers/assignments.ts +56 -7
  253. package/src/resources/v1/events/beta/customers/entities.ts +136 -16
  254. package/src/resources/v1/events/beta/customers/entitlements.ts +38 -11
  255. package/src/resources/v1/events/beta/entity-types.ts +51 -5
  256. package/src/resources/v1/events/events.ts +28 -3
  257. package/src/resources/v1/features.ts +204 -34
  258. package/src/resources/v1/index.ts +19 -0
  259. package/src/resources/v1/plans/entitlements.ts +123 -10
  260. package/src/resources/v1/plans/index.ts +5 -0
  261. package/src/resources/v1/plans/plans.ts +314 -43
  262. package/src/resources/v1/products.ts +189 -27
  263. package/src/resources/v1/subscriptions/future-update.ts +68 -5
  264. package/src/resources/v1/subscriptions/index.ts +9 -2
  265. package/src/resources/v1/subscriptions/invoice.ts +36 -3
  266. package/src/resources/v1/subscriptions/subscriptions.ts +410 -85
  267. package/src/resources/v1/subscriptions/usage.ts +61 -5
  268. package/src/resources/v1/usage.ts +53 -5
  269. package/src/resources/v1/v1.ts +38 -0
  270. package/src/version.ts +1 -1
  271. package/version.d.mts +1 -1
  272. package/version.d.ts +1 -1
  273. package/version.js +1 -1
  274. package/version.mjs +1 -1
@@ -13,7 +13,7 @@ import {
13
13
  Integrations,
14
14
  } from './integrations';
15
15
  import * as PaymentMethodAPI from './payment-method';
16
- import { PaymentMethod, PaymentMethodAttachParams } from './payment-method';
16
+ import { PaymentMethod, PaymentMethodAttachParams, PaymentMethodDetachParams } from './payment-method';
17
17
  import * as PromotionalEntitlementsAPI from './promotional-entitlements';
18
18
  import {
19
19
  PromotionalEntitlementCreateParams,
@@ -27,6 +27,7 @@ import {
27
27
  } from './promotional-entitlements';
28
28
  import { APIPromise } from '../../../core/api-promise';
29
29
  import { MyCursorIDPage, type MyCursorIDPageParams, PagePromise } from '../../../core/pagination';
30
+ import { buildHeaders } from '../../../internal/headers';
30
31
  import { RequestOptions } from '../../../internal/request-options';
31
32
  import { path } from '../../../internal/utils/path';
32
33
 
@@ -47,8 +48,22 @@ export class Customers extends APIResource {
47
48
  * );
48
49
  * ```
49
50
  */
50
- retrieve(id: string, options?: RequestOptions): APIPromise<CustomerResponse> {
51
- return this._client.get(path`/api/v1/customers/${id}`, options);
51
+ retrieve(
52
+ id: string,
53
+ params: CustomerRetrieveParams | null | undefined = {},
54
+ options?: RequestOptions,
55
+ ): APIPromise<CustomerResponse> {
56
+ const { 'X-ACCOUNT-ID': xAccountID, 'X-ENVIRONMENT-ID': xEnvironmentID } = params ?? {};
57
+ return this._client.get(path`/api/v1/customers/${id}`, {
58
+ ...options,
59
+ headers: buildHeaders([
60
+ {
61
+ ...(xAccountID != null ? { 'X-ACCOUNT-ID': xAccountID } : undefined),
62
+ ...(xEnvironmentID != null ? { 'X-ENVIRONMENT-ID': xEnvironmentID } : undefined),
63
+ },
64
+ options?.headers,
65
+ ]),
66
+ });
52
67
  }
53
68
 
54
69
  /**
@@ -62,8 +77,19 @@ export class Customers extends APIResource {
62
77
  * );
63
78
  * ```
64
79
  */
65
- update(id: string, body: CustomerUpdateParams, options?: RequestOptions): APIPromise<CustomerResponse> {
66
- return this._client.patch(path`/api/v1/customers/${id}`, { body, ...options });
80
+ update(id: string, params: CustomerUpdateParams, options?: RequestOptions): APIPromise<CustomerResponse> {
81
+ const { 'X-ACCOUNT-ID': xAccountID, 'X-ENVIRONMENT-ID': xEnvironmentID, ...body } = params;
82
+ return this._client.patch(path`/api/v1/customers/${id}`, {
83
+ body,
84
+ ...options,
85
+ headers: buildHeaders([
86
+ {
87
+ ...(xAccountID != null ? { 'X-ACCOUNT-ID': xAccountID } : undefined),
88
+ ...(xEnvironmentID != null ? { 'X-ENVIRONMENT-ID': xEnvironmentID } : undefined),
89
+ },
90
+ options?.headers,
91
+ ]),
92
+ });
67
93
  }
68
94
 
69
95
  /**
@@ -78,12 +104,20 @@ export class Customers extends APIResource {
78
104
  * ```
79
105
  */
80
106
  list(
81
- query: CustomerListParams | null | undefined = {},
107
+ params: CustomerListParams | null | undefined = {},
82
108
  options?: RequestOptions,
83
109
  ): PagePromise<CustomerListResponsesMyCursorIDPage, CustomerListResponse> {
110
+ const { 'X-ACCOUNT-ID': xAccountID, 'X-ENVIRONMENT-ID': xEnvironmentID, ...query } = params ?? {};
84
111
  return this._client.getAPIList('/api/v1/customers', MyCursorIDPage<CustomerListResponse>, {
85
112
  query,
86
113
  ...options,
114
+ headers: buildHeaders([
115
+ {
116
+ ...(xAccountID != null ? { 'X-ACCOUNT-ID': xAccountID } : undefined),
117
+ ...(xEnvironmentID != null ? { 'X-ENVIRONMENT-ID': xEnvironmentID } : undefined),
118
+ },
119
+ options?.headers,
120
+ ]),
87
121
  });
88
122
  }
89
123
 
@@ -98,8 +132,22 @@ export class Customers extends APIResource {
98
132
  * );
99
133
  * ```
100
134
  */
101
- archive(id: string, options?: RequestOptions): APIPromise<CustomerResponse> {
102
- return this._client.post(path`/api/v1/customers/${id}/archive`, options);
135
+ archive(
136
+ id: string,
137
+ params: CustomerArchiveParams | null | undefined = {},
138
+ options?: RequestOptions,
139
+ ): APIPromise<CustomerResponse> {
140
+ const { 'X-ACCOUNT-ID': xAccountID, 'X-ENVIRONMENT-ID': xEnvironmentID } = params ?? {};
141
+ return this._client.post(path`/api/v1/customers/${id}/archive`, {
142
+ ...options,
143
+ headers: buildHeaders([
144
+ {
145
+ ...(xAccountID != null ? { 'X-ACCOUNT-ID': xAccountID } : undefined),
146
+ ...(xEnvironmentID != null ? { 'X-ENVIRONMENT-ID': xEnvironmentID } : undefined),
147
+ },
148
+ options?.headers,
149
+ ]),
150
+ });
103
151
  }
104
152
 
105
153
  /**
@@ -121,10 +169,21 @@ export class Customers extends APIResource {
121
169
  */
122
170
  checkEntitlement(
123
171
  id: string,
124
- query: CustomerCheckEntitlementParams | null | undefined = {},
172
+ params: CustomerCheckEntitlementParams | null | undefined = {},
125
173
  options?: RequestOptions,
126
174
  ): APIPromise<CustomerCheckEntitlementResponse> {
127
- return this._client.get(path`/api/v1/customers/${id}/entitlements/check`, { query, ...options });
175
+ const { 'X-ACCOUNT-ID': xAccountID, 'X-ENVIRONMENT-ID': xEnvironmentID, ...query } = params ?? {};
176
+ return this._client.get(path`/api/v1/customers/${id}/entitlements/check`, {
177
+ query,
178
+ ...options,
179
+ headers: buildHeaders([
180
+ {
181
+ ...(xAccountID != null ? { 'X-ACCOUNT-ID': xAccountID } : undefined),
182
+ ...(xEnvironmentID != null ? { 'X-ENVIRONMENT-ID': xEnvironmentID } : undefined),
183
+ },
184
+ options?.headers,
185
+ ]),
186
+ });
128
187
  }
129
188
 
130
189
  /**
@@ -144,8 +203,19 @@ export class Customers extends APIResource {
144
203
  * });
145
204
  * ```
146
205
  */
147
- import(body: CustomerImportParams, options?: RequestOptions): APIPromise<CustomerImportResponse> {
148
- return this._client.post('/api/v1/customers/import', { body, ...options });
206
+ import(params: CustomerImportParams, options?: RequestOptions): APIPromise<CustomerImportResponse> {
207
+ const { 'X-ACCOUNT-ID': xAccountID, 'X-ENVIRONMENT-ID': xEnvironmentID, ...body } = params;
208
+ return this._client.post('/api/v1/customers/import', {
209
+ body,
210
+ ...options,
211
+ headers: buildHeaders([
212
+ {
213
+ ...(xAccountID != null ? { 'X-ACCOUNT-ID': xAccountID } : undefined),
214
+ ...(xEnvironmentID != null ? { 'X-ENVIRONMENT-ID': xEnvironmentID } : undefined),
215
+ },
216
+ options?.headers,
217
+ ]),
218
+ });
149
219
  }
150
220
 
151
221
  /**
@@ -163,13 +233,24 @@ export class Customers extends APIResource {
163
233
  */
164
234
  listResources(
165
235
  id: string,
166
- query: CustomerListResourcesParams | null | undefined = {},
236
+ params: CustomerListResourcesParams | null | undefined = {},
167
237
  options?: RequestOptions,
168
238
  ): PagePromise<CustomerListResourcesResponsesMyCursorIDPage, CustomerListResourcesResponse> {
239
+ const { 'X-ACCOUNT-ID': xAccountID, 'X-ENVIRONMENT-ID': xEnvironmentID, ...query } = params ?? {};
169
240
  return this._client.getAPIList(
170
241
  path`/api/v1/customers/${id}/resources`,
171
242
  MyCursorIDPage<CustomerListResourcesResponse>,
172
- { query, ...options },
243
+ {
244
+ query,
245
+ ...options,
246
+ headers: buildHeaders([
247
+ {
248
+ ...(xAccountID != null ? { 'X-ACCOUNT-ID': xAccountID } : undefined),
249
+ ...(xEnvironmentID != null ? { 'X-ENVIRONMENT-ID': xEnvironmentID } : undefined),
250
+ },
251
+ options?.headers,
252
+ ]),
253
+ },
173
254
  );
174
255
  }
175
256
 
@@ -183,8 +264,19 @@ export class Customers extends APIResource {
183
264
  * await client.v1.customers.provision({ id: 'id' });
184
265
  * ```
185
266
  */
186
- provision(body: CustomerProvisionParams, options?: RequestOptions): APIPromise<CustomerResponse> {
187
- return this._client.post('/api/v1/customers', { body, ...options });
267
+ provision(params: CustomerProvisionParams, options?: RequestOptions): APIPromise<CustomerResponse> {
268
+ const { 'X-ACCOUNT-ID': xAccountID, 'X-ENVIRONMENT-ID': xEnvironmentID, ...body } = params;
269
+ return this._client.post('/api/v1/customers', {
270
+ body,
271
+ ...options,
272
+ headers: buildHeaders([
273
+ {
274
+ ...(xAccountID != null ? { 'X-ACCOUNT-ID': xAccountID } : undefined),
275
+ ...(xEnvironmentID != null ? { 'X-ENVIRONMENT-ID': xEnvironmentID } : undefined),
276
+ },
277
+ options?.headers,
278
+ ]),
279
+ });
188
280
  }
189
281
 
190
282
  /**
@@ -204,10 +296,21 @@ export class Customers extends APIResource {
204
296
  */
205
297
  retrieveEntitlements(
206
298
  id: string,
207
- query: CustomerRetrieveEntitlementsParams | null | undefined = {},
299
+ params: CustomerRetrieveEntitlementsParams | null | undefined = {},
208
300
  options?: RequestOptions,
209
301
  ): APIPromise<CustomerRetrieveEntitlementsResponse> {
210
- return this._client.get(path`/api/v1/customers/${id}/entitlements`, { query, ...options });
302
+ const { 'X-ACCOUNT-ID': xAccountID, 'X-ENVIRONMENT-ID': xEnvironmentID, ...query } = params ?? {};
303
+ return this._client.get(path`/api/v1/customers/${id}/entitlements`, {
304
+ query,
305
+ ...options,
306
+ headers: buildHeaders([
307
+ {
308
+ ...(xAccountID != null ? { 'X-ACCOUNT-ID': xAccountID } : undefined),
309
+ ...(xEnvironmentID != null ? { 'X-ENVIRONMENT-ID': xEnvironmentID } : undefined),
310
+ },
311
+ options?.headers,
312
+ ]),
313
+ });
211
314
  }
212
315
 
213
316
  /**
@@ -219,8 +322,22 @@ export class Customers extends APIResource {
219
322
  * await client.v1.customers.unarchive('x');
220
323
  * ```
221
324
  */
222
- unarchive(id: string, options?: RequestOptions): APIPromise<CustomerResponse> {
223
- return this._client.post(path`/api/v1/customers/${id}/unarchive`, options);
325
+ unarchive(
326
+ id: string,
327
+ params: CustomerUnarchiveParams | null | undefined = {},
328
+ options?: RequestOptions,
329
+ ): APIPromise<CustomerResponse> {
330
+ const { 'X-ACCOUNT-ID': xAccountID, 'X-ENVIRONMENT-ID': xEnvironmentID } = params ?? {};
331
+ return this._client.post(path`/api/v1/customers/${id}/unarchive`, {
332
+ ...options,
333
+ headers: buildHeaders([
334
+ {
335
+ ...(xAccountID != null ? { 'X-ACCOUNT-ID': xAccountID } : undefined),
336
+ ...(xEnvironmentID != null ? { 'X-ENVIRONMENT-ID': xEnvironmentID } : undefined),
337
+ },
338
+ options?.headers,
339
+ ]),
340
+ });
224
341
  }
225
342
  }
226
343
 
@@ -1936,9 +2053,24 @@ export namespace CustomerRetrieveEntitlementsResponse {
1936
2053
  }
1937
2054
  }
1938
2055
 
2056
+ export interface CustomerRetrieveParams {
2057
+ /**
2058
+ * Account ID — optional when authenticating with a user JWT (Bearer token); falls
2059
+ * back to the user's first membership. Ignored for API-key auth.
2060
+ */
2061
+ 'X-ACCOUNT-ID'?: string;
2062
+
2063
+ /**
2064
+ * Environment ID — required when authenticating with a user JWT (Bearer token) on
2065
+ * environment-scoped endpoints. Ignored for API-key auth (env is intrinsic to the
2066
+ * key).
2067
+ */
2068
+ 'X-ENVIRONMENT-ID'?: string;
2069
+ }
2070
+
1939
2071
  export interface CustomerUpdateParams {
1940
2072
  /**
1941
- * The billing currency of the customer
2073
+ * Body param: The billing currency of the customer
1942
2074
  */
1943
2075
  billingCurrency?:
1944
2076
  | 'usd'
@@ -2060,49 +2192,62 @@ export interface CustomerUpdateParams {
2060
2192
  | null;
2061
2193
 
2062
2194
  /**
2063
- * The unique identifier for the entity in the billing provider
2195
+ * Body param: The unique identifier for the entity in the billing provider
2064
2196
  */
2065
2197
  billingId?: string | null;
2066
2198
 
2067
2199
  /**
2068
- * Customer level coupon
2200
+ * Body param: Customer level coupon
2069
2201
  */
2070
2202
  couponId?: (string & {}) | '' | null;
2071
2203
 
2072
2204
  /**
2073
- * The email of the customer
2205
+ * Body param: The email of the customer
2074
2206
  */
2075
2207
  email?: string | null;
2076
2208
 
2077
2209
  /**
2078
- * List of integrations
2210
+ * Body param: List of integrations
2079
2211
  */
2080
2212
  integrations?: Array<CustomerUpdateParams.Integration>;
2081
2213
 
2082
2214
  /**
2083
- * Language to use for this customer
2215
+ * Body param: Language to use for this customer
2084
2216
  */
2085
2217
  language?: string | null;
2086
2218
 
2087
2219
  /**
2088
- * Additional metadata
2220
+ * Body param: Additional metadata
2089
2221
  */
2090
2222
  metadata?: { [key: string]: string };
2091
2223
 
2092
2224
  /**
2093
- * The name of the customer
2225
+ * Body param: The name of the customer
2094
2226
  */
2095
2227
  name?: string | null;
2096
2228
 
2097
2229
  /**
2098
- * Vendor-specific billing passthrough fields.
2230
+ * Body param: Vendor-specific billing passthrough fields.
2099
2231
  */
2100
2232
  passthrough?: CustomerUpdateParams.Passthrough;
2101
2233
 
2102
2234
  /**
2103
- * Timezone to use for this customer
2235
+ * Body param: Timezone to use for this customer
2104
2236
  */
2105
2237
  timezone?: string | null;
2238
+
2239
+ /**
2240
+ * Header param: Account ID — optional when authenticating with a user JWT (Bearer
2241
+ * token); falls back to the user's first membership. Ignored for API-key auth.
2242
+ */
2243
+ 'X-ACCOUNT-ID'?: string;
2244
+
2245
+ /**
2246
+ * Header param: Environment ID — required when authenticating with a user JWT
2247
+ * (Bearer token) on environment-scoped endpoints. Ignored for API-key auth (env is
2248
+ * intrinsic to the key).
2249
+ */
2250
+ 'X-ENVIRONMENT-ID'?: string;
2106
2251
  }
2107
2252
 
2108
2253
  export namespace CustomerUpdateParams {
@@ -2463,19 +2608,32 @@ export namespace CustomerUpdateParams {
2463
2608
 
2464
2609
  export interface CustomerListParams extends MyCursorIDPageParams {
2465
2610
  /**
2466
- * Filter by creation date using range operators: gt, gte, lt, lte
2611
+ * Query param: Filter by creation date using range operators: gt, gte, lt, lte
2467
2612
  */
2468
2613
  createdAt?: CustomerListParams.CreatedAt;
2469
2614
 
2470
2615
  /**
2471
- * Filter by exact customer email address
2616
+ * Query param: Filter by exact customer email address
2472
2617
  */
2473
2618
  email?: string;
2474
2619
 
2475
2620
  /**
2476
- * Filter by exact customer name
2621
+ * Query param: Filter by exact customer name
2477
2622
  */
2478
2623
  name?: string;
2624
+
2625
+ /**
2626
+ * Header param: Account ID — optional when authenticating with a user JWT (Bearer
2627
+ * token); falls back to the user's first membership. Ignored for API-key auth.
2628
+ */
2629
+ 'X-ACCOUNT-ID'?: string;
2630
+
2631
+ /**
2632
+ * Header param: Environment ID — required when authenticating with a user JWT
2633
+ * (Bearer token) on environment-scoped endpoints. Ignored for API-key auth (env is
2634
+ * intrinsic to the key).
2635
+ */
2636
+ 'X-ENVIRONMENT-ID'?: string;
2479
2637
  }
2480
2638
 
2481
2639
  export namespace CustomerListParams {
@@ -2505,45 +2663,87 @@ export namespace CustomerListParams {
2505
2663
  }
2506
2664
  }
2507
2665
 
2666
+ export interface CustomerArchiveParams {
2667
+ /**
2668
+ * Account ID — optional when authenticating with a user JWT (Bearer token); falls
2669
+ * back to the user's first membership. Ignored for API-key auth.
2670
+ */
2671
+ 'X-ACCOUNT-ID'?: string;
2672
+
2673
+ /**
2674
+ * Environment ID — required when authenticating with a user JWT (Bearer token) on
2675
+ * environment-scoped endpoints. Ignored for API-key auth (env is intrinsic to the
2676
+ * key).
2677
+ */
2678
+ 'X-ENVIRONMENT-ID'?: string;
2679
+ }
2680
+
2508
2681
  export interface CustomerCheckEntitlementParams {
2509
2682
  /**
2510
- * Currency ID (refId) to check for credit entitlements. Mutually exclusive with
2511
- * `featureId`.
2683
+ * Query param: Currency ID (refId) to check for credit entitlements. Mutually
2684
+ * exclusive with `featureId`.
2512
2685
  */
2513
2686
  currencyId?: string;
2514
2687
 
2515
2688
  /**
2516
- * Feature ID (refId) to check. Mutually exclusive with `currencyId`.
2689
+ * Query param: Feature ID (refId) to check. Mutually exclusive with `currencyId`.
2517
2690
  */
2518
2691
  featureId?: string;
2519
2692
 
2520
2693
  /**
2521
- * Requested usage amount to evaluate against the entitlement limit (numeric
2522
- * features only)
2694
+ * Query param: Requested usage amount to evaluate against the entitlement limit
2695
+ * (numeric features only)
2523
2696
  */
2524
2697
  requestedUsage?: number;
2525
2698
 
2526
2699
  /**
2527
- * Requested values to evaluate against allowed values (enum features only)
2700
+ * Query param: Requested values to evaluate against allowed values (enum features
2701
+ * only)
2528
2702
  */
2529
2703
  requestedValues?: Array<string>;
2530
2704
 
2531
2705
  /**
2532
- * Resource ID to scope the entitlement check to a specific resource
2706
+ * Query param: Resource ID to scope the entitlement check to a specific resource
2533
2707
  */
2534
2708
  resourceId?: string;
2709
+
2710
+ /**
2711
+ * Header param: Account ID — optional when authenticating with a user JWT (Bearer
2712
+ * token); falls back to the user's first membership. Ignored for API-key auth.
2713
+ */
2714
+ 'X-ACCOUNT-ID'?: string;
2715
+
2716
+ /**
2717
+ * Header param: Environment ID — required when authenticating with a user JWT
2718
+ * (Bearer token) on environment-scoped endpoints. Ignored for API-key auth (env is
2719
+ * intrinsic to the key).
2720
+ */
2721
+ 'X-ENVIRONMENT-ID'?: string;
2535
2722
  }
2536
2723
 
2537
2724
  export interface CustomerImportParams {
2538
2725
  /**
2539
- * List of customer objects to import
2726
+ * Body param: List of customer objects to import
2540
2727
  */
2541
2728
  customers: Array<CustomerImportParams.Customer>;
2542
2729
 
2543
2730
  /**
2544
- * Integration details
2731
+ * Body param: Integration details
2545
2732
  */
2546
2733
  integrationId?: string;
2734
+
2735
+ /**
2736
+ * Header param: Account ID — optional when authenticating with a user JWT (Bearer
2737
+ * token); falls back to the user's first membership. Ignored for API-key auth.
2738
+ */
2739
+ 'X-ACCOUNT-ID'?: string;
2740
+
2741
+ /**
2742
+ * Header param: Environment ID — required when authenticating with a user JWT
2743
+ * (Bearer token) on environment-scoped endpoints. Ignored for API-key auth (env is
2744
+ * intrinsic to the key).
2745
+ */
2746
+ 'X-ENVIRONMENT-ID'?: string;
2547
2747
  }
2548
2748
 
2549
2749
  export namespace CustomerImportParams {
@@ -2590,16 +2790,29 @@ export namespace CustomerImportParams {
2590
2790
  }
2591
2791
  }
2592
2792
 
2593
- export interface CustomerListResourcesParams extends MyCursorIDPageParams {}
2793
+ export interface CustomerListResourcesParams extends MyCursorIDPageParams {
2794
+ /**
2795
+ * Header param: Account ID — optional when authenticating with a user JWT (Bearer
2796
+ * token); falls back to the user's first membership. Ignored for API-key auth.
2797
+ */
2798
+ 'X-ACCOUNT-ID'?: string;
2799
+
2800
+ /**
2801
+ * Header param: Environment ID — required when authenticating with a user JWT
2802
+ * (Bearer token) on environment-scoped endpoints. Ignored for API-key auth (env is
2803
+ * intrinsic to the key).
2804
+ */
2805
+ 'X-ENVIRONMENT-ID'?: string;
2806
+ }
2594
2807
 
2595
2808
  export interface CustomerProvisionParams {
2596
2809
  /**
2597
- * Customer slug
2810
+ * Body param: Customer slug
2598
2811
  */
2599
2812
  id: string;
2600
2813
 
2601
2814
  /**
2602
- * The billing currency of the customer
2815
+ * Body param: The billing currency of the customer
2603
2816
  */
2604
2817
  billingCurrency?:
2605
2818
  | 'usd'
@@ -2721,54 +2934,67 @@ export interface CustomerProvisionParams {
2721
2934
  | null;
2722
2935
 
2723
2936
  /**
2724
- * The unique identifier for the entity in the billing provider
2937
+ * Body param: The unique identifier for the entity in the billing provider
2725
2938
  */
2726
2939
  billingId?: string | null;
2727
2940
 
2728
2941
  /**
2729
- * Customer level coupon
2942
+ * Body param: Customer level coupon
2730
2943
  */
2731
2944
  couponId?: (string & {}) | '' | null;
2732
2945
 
2733
2946
  /**
2734
- * The default payment method details
2947
+ * Body param: The default payment method details
2735
2948
  */
2736
2949
  defaultPaymentMethod?: CustomerProvisionParams.DefaultPaymentMethod | null;
2737
2950
 
2738
2951
  /**
2739
- * The email of the customer
2952
+ * Body param: The email of the customer
2740
2953
  */
2741
2954
  email?: string | null;
2742
2955
 
2743
2956
  /**
2744
- * List of integrations
2957
+ * Body param: List of integrations
2745
2958
  */
2746
2959
  integrations?: Array<CustomerProvisionParams.Integration>;
2747
2960
 
2748
2961
  /**
2749
- * Language to use for this customer
2962
+ * Body param: Language to use for this customer
2750
2963
  */
2751
2964
  language?: string | null;
2752
2965
 
2753
2966
  /**
2754
- * Additional metadata
2967
+ * Body param: Additional metadata
2755
2968
  */
2756
2969
  metadata?: { [key: string]: string };
2757
2970
 
2758
2971
  /**
2759
- * The name of the customer
2972
+ * Body param: The name of the customer
2760
2973
  */
2761
2974
  name?: string | null;
2762
2975
 
2763
2976
  /**
2764
- * Vendor-specific billing passthrough fields.
2977
+ * Body param: Vendor-specific billing passthrough fields.
2765
2978
  */
2766
2979
  passthrough?: CustomerProvisionParams.Passthrough;
2767
2980
 
2768
2981
  /**
2769
- * Timezone to use for this customer
2982
+ * Body param: Timezone to use for this customer
2770
2983
  */
2771
2984
  timezone?: string | null;
2985
+
2986
+ /**
2987
+ * Header param: Account ID — optional when authenticating with a user JWT (Bearer
2988
+ * token); falls back to the user's first membership. Ignored for API-key auth.
2989
+ */
2990
+ 'X-ACCOUNT-ID'?: string;
2991
+
2992
+ /**
2993
+ * Header param: Environment ID — required when authenticating with a user JWT
2994
+ * (Bearer token) on environment-scoped endpoints. Ignored for API-key auth (env is
2995
+ * intrinsic to the key).
2996
+ */
2997
+ 'X-ENVIRONMENT-ID'?: string;
2772
2998
  }
2773
2999
 
2774
3000
  export namespace CustomerProvisionParams {
@@ -3159,9 +3385,37 @@ export namespace CustomerProvisionParams {
3159
3385
 
3160
3386
  export interface CustomerRetrieveEntitlementsParams {
3161
3387
  /**
3162
- * Resource ID to scope entitlements to a specific resource
3388
+ * Query param: Resource ID to scope entitlements to a specific resource
3163
3389
  */
3164
3390
  resourceId?: string;
3391
+
3392
+ /**
3393
+ * Header param: Account ID — optional when authenticating with a user JWT (Bearer
3394
+ * token); falls back to the user's first membership. Ignored for API-key auth.
3395
+ */
3396
+ 'X-ACCOUNT-ID'?: string;
3397
+
3398
+ /**
3399
+ * Header param: Environment ID — required when authenticating with a user JWT
3400
+ * (Bearer token) on environment-scoped endpoints. Ignored for API-key auth (env is
3401
+ * intrinsic to the key).
3402
+ */
3403
+ 'X-ENVIRONMENT-ID'?: string;
3404
+ }
3405
+
3406
+ export interface CustomerUnarchiveParams {
3407
+ /**
3408
+ * Account ID — optional when authenticating with a user JWT (Bearer token); falls
3409
+ * back to the user's first membership. Ignored for API-key auth.
3410
+ */
3411
+ 'X-ACCOUNT-ID'?: string;
3412
+
3413
+ /**
3414
+ * Environment ID — required when authenticating with a user JWT (Bearer token) on
3415
+ * environment-scoped endpoints. Ignored for API-key auth (env is intrinsic to the
3416
+ * key).
3417
+ */
3418
+ 'X-ENVIRONMENT-ID'?: string;
3165
3419
  }
3166
3420
 
3167
3421
  Customers.PaymentMethod = PaymentMethod;
@@ -3179,16 +3433,23 @@ export declare namespace Customers {
3179
3433
  type CustomerRetrieveEntitlementsResponse as CustomerRetrieveEntitlementsResponse,
3180
3434
  type CustomerListResponsesMyCursorIDPage as CustomerListResponsesMyCursorIDPage,
3181
3435
  type CustomerListResourcesResponsesMyCursorIDPage as CustomerListResourcesResponsesMyCursorIDPage,
3436
+ type CustomerRetrieveParams as CustomerRetrieveParams,
3182
3437
  type CustomerUpdateParams as CustomerUpdateParams,
3183
3438
  type CustomerListParams as CustomerListParams,
3439
+ type CustomerArchiveParams as CustomerArchiveParams,
3184
3440
  type CustomerCheckEntitlementParams as CustomerCheckEntitlementParams,
3185
3441
  type CustomerImportParams as CustomerImportParams,
3186
3442
  type CustomerListResourcesParams as CustomerListResourcesParams,
3187
3443
  type CustomerProvisionParams as CustomerProvisionParams,
3188
3444
  type CustomerRetrieveEntitlementsParams as CustomerRetrieveEntitlementsParams,
3445
+ type CustomerUnarchiveParams as CustomerUnarchiveParams,
3189
3446
  };
3190
3447
 
3191
- export { PaymentMethod as PaymentMethod, type PaymentMethodAttachParams as PaymentMethodAttachParams };
3448
+ export {
3449
+ PaymentMethod as PaymentMethod,
3450
+ type PaymentMethodAttachParams as PaymentMethodAttachParams,
3451
+ type PaymentMethodDetachParams as PaymentMethodDetachParams,
3452
+ };
3192
3453
 
3193
3454
  export {
3194
3455
  PromotionalEntitlements as PromotionalEntitlements,
@@ -9,13 +9,16 @@ export {
9
9
  type CustomerImportResponse,
10
10
  type CustomerListResourcesResponse,
11
11
  type CustomerRetrieveEntitlementsResponse,
12
+ type CustomerRetrieveParams,
12
13
  type CustomerUpdateParams,
13
14
  type CustomerListParams,
15
+ type CustomerArchiveParams,
14
16
  type CustomerCheckEntitlementParams,
15
17
  type CustomerImportParams,
16
18
  type CustomerListResourcesParams,
17
19
  type CustomerProvisionParams,
18
20
  type CustomerRetrieveEntitlementsParams,
21
+ type CustomerUnarchiveParams,
19
22
  type CustomerListResponsesMyCursorIDPage,
20
23
  type CustomerListResourcesResponsesMyCursorIDPage,
21
24
  } from './customers';
@@ -29,7 +32,11 @@ export {
29
32
  type IntegrationUnlinkParams,
30
33
  type IntegrationListResponsesMyCursorIDPage,
31
34
  } from './integrations';
32
- export { PaymentMethod, type PaymentMethodAttachParams } from './payment-method';
35
+ export {
36
+ PaymentMethod,
37
+ type PaymentMethodAttachParams,
38
+ type PaymentMethodDetachParams,
39
+ } from './payment-method';
33
40
  export {
34
41
  PromotionalEntitlements,
35
42
  type PromotionalEntitlementCreateResponse,