@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
@@ -4,6 +4,7 @@ import { APIResource } from '../../../core/resource';
4
4
  import * as CustomersAPI from './customers';
5
5
  import { APIPromise } from '../../../core/api-promise';
6
6
  import { MyCursorIDPage, type MyCursorIDPageParams, PagePromise } from '../../../core/pagination';
7
+ import { buildHeaders } from '../../../internal/headers';
7
8
  import { RequestOptions } from '../../../internal/request-options';
8
9
  import { path } from '../../../internal/utils/path';
9
10
 
@@ -25,8 +26,17 @@ export class Integrations extends APIResource {
25
26
  params: IntegrationRetrieveParams,
26
27
  options?: RequestOptions,
27
28
  ): APIPromise<CustomersAPI.CustomerIntegrationResponse> {
28
- const { id } = params;
29
- return this._client.get(path`/api/v1/customers/${id}/integrations/${integrationID}`, options);
29
+ const { id, 'X-ACCOUNT-ID': xAccountID, 'X-ENVIRONMENT-ID': xEnvironmentID } = params;
30
+ return this._client.get(path`/api/v1/customers/${id}/integrations/${integrationID}`, {
31
+ ...options,
32
+ headers: buildHeaders([
33
+ {
34
+ ...(xAccountID != null ? { 'X-ACCOUNT-ID': xAccountID } : undefined),
35
+ ...(xEnvironmentID != null ? { 'X-ENVIRONMENT-ID': xEnvironmentID } : undefined),
36
+ },
37
+ options?.headers,
38
+ ]),
39
+ });
30
40
  }
31
41
 
32
42
  /**
@@ -47,10 +57,17 @@ export class Integrations extends APIResource {
47
57
  params: IntegrationUpdateParams,
48
58
  options?: RequestOptions,
49
59
  ): APIPromise<CustomersAPI.CustomerIntegrationResponse> {
50
- const { id, ...body } = params;
60
+ const { id, 'X-ACCOUNT-ID': xAccountID, 'X-ENVIRONMENT-ID': xEnvironmentID, ...body } = params;
51
61
  return this._client.patch(path`/api/v1/customers/${id}/integrations/${integrationID}`, {
52
62
  body,
53
63
  ...options,
64
+ headers: buildHeaders([
65
+ {
66
+ ...(xAccountID != null ? { 'X-ACCOUNT-ID': xAccountID } : undefined),
67
+ ...(xEnvironmentID != null ? { 'X-ENVIRONMENT-ID': xEnvironmentID } : undefined),
68
+ },
69
+ options?.headers,
70
+ ]),
54
71
  });
55
72
  }
56
73
 
@@ -70,13 +87,24 @@ export class Integrations extends APIResource {
70
87
  */
71
88
  list(
72
89
  id: string,
73
- query: IntegrationListParams | null | undefined = {},
90
+ params: IntegrationListParams | null | undefined = {},
74
91
  options?: RequestOptions,
75
92
  ): PagePromise<IntegrationListResponsesMyCursorIDPage, IntegrationListResponse> {
93
+ const { 'X-ACCOUNT-ID': xAccountID, 'X-ENVIRONMENT-ID': xEnvironmentID, ...query } = params ?? {};
76
94
  return this._client.getAPIList(
77
95
  path`/api/v1/customers/${id}/integrations`,
78
96
  MyCursorIDPage<IntegrationListResponse>,
79
- { query, ...options },
97
+ {
98
+ query,
99
+ ...options,
100
+ headers: buildHeaders([
101
+ {
102
+ ...(xAccountID != null ? { 'X-ACCOUNT-ID': xAccountID } : undefined),
103
+ ...(xEnvironmentID != null ? { 'X-ENVIRONMENT-ID': xEnvironmentID } : undefined),
104
+ },
105
+ options?.headers,
106
+ ]),
107
+ },
80
108
  );
81
109
  }
82
110
 
@@ -96,10 +124,21 @@ export class Integrations extends APIResource {
96
124
  */
97
125
  link(
98
126
  id: string,
99
- body: IntegrationLinkParams,
127
+ params: IntegrationLinkParams,
100
128
  options?: RequestOptions,
101
129
  ): APIPromise<CustomersAPI.CustomerIntegrationResponse> {
102
- return this._client.post(path`/api/v1/customers/${id}/integrations`, { body, ...options });
130
+ const { 'X-ACCOUNT-ID': xAccountID, 'X-ENVIRONMENT-ID': xEnvironmentID, ...body } = params;
131
+ return this._client.post(path`/api/v1/customers/${id}/integrations`, {
132
+ body,
133
+ ...options,
134
+ headers: buildHeaders([
135
+ {
136
+ ...(xAccountID != null ? { 'X-ACCOUNT-ID': xAccountID } : undefined),
137
+ ...(xEnvironmentID != null ? { 'X-ENVIRONMENT-ID': xEnvironmentID } : undefined),
138
+ },
139
+ options?.headers,
140
+ ]),
141
+ });
103
142
  }
104
143
 
105
144
  /**
@@ -119,8 +158,17 @@ export class Integrations extends APIResource {
119
158
  params: IntegrationUnlinkParams,
120
159
  options?: RequestOptions,
121
160
  ): APIPromise<CustomersAPI.CustomerIntegrationResponse> {
122
- const { id } = params;
123
- return this._client.delete(path`/api/v1/customers/${id}/integrations/${integrationID}`, options);
161
+ const { id, 'X-ACCOUNT-ID': xAccountID, 'X-ENVIRONMENT-ID': xEnvironmentID } = params;
162
+ return this._client.delete(path`/api/v1/customers/${id}/integrations/${integrationID}`, {
163
+ ...options,
164
+ headers: buildHeaders([
165
+ {
166
+ ...(xAccountID != null ? { 'X-ACCOUNT-ID': xAccountID } : undefined),
167
+ ...(xEnvironmentID != null ? { 'X-ENVIRONMENT-ID': xEnvironmentID } : undefined),
168
+ },
169
+ options?.headers,
170
+ ]),
171
+ });
124
172
  }
125
173
  }
126
174
 
@@ -218,9 +266,22 @@ export namespace IntegrationListResponse {
218
266
 
219
267
  export interface IntegrationRetrieveParams {
220
268
  /**
221
- * Customer slug
269
+ * Path param: Customer slug
222
270
  */
223
271
  id: string;
272
+
273
+ /**
274
+ * Header param: Account ID — optional when authenticating with a user JWT (Bearer
275
+ * token); falls back to the user's first membership. Ignored for API-key auth.
276
+ */
277
+ 'X-ACCOUNT-ID'?: string;
278
+
279
+ /**
280
+ * Header param: Environment ID — required when authenticating with a user JWT
281
+ * (Bearer token) on environment-scoped endpoints. Ignored for API-key auth (env is
282
+ * intrinsic to the key).
283
+ */
284
+ 'X-ENVIRONMENT-ID'?: string;
224
285
  }
225
286
 
226
287
  export interface IntegrationUpdateParams {
@@ -233,12 +294,25 @@ export interface IntegrationUpdateParams {
233
294
  * Body param: Synced entity id
234
295
  */
235
296
  syncedEntityId: string | null;
297
+
298
+ /**
299
+ * Header param: Account ID — optional when authenticating with a user JWT (Bearer
300
+ * token); falls back to the user's first membership. Ignored for API-key auth.
301
+ */
302
+ 'X-ACCOUNT-ID'?: string;
303
+
304
+ /**
305
+ * Header param: Environment ID — required when authenticating with a user JWT
306
+ * (Bearer token) on environment-scoped endpoints. Ignored for API-key auth (env is
307
+ * intrinsic to the key).
308
+ */
309
+ 'X-ENVIRONMENT-ID'?: string;
236
310
  }
237
311
 
238
312
  export interface IntegrationListParams extends MyCursorIDPageParams {
239
313
  /**
240
- * Filter by vendor identifier. Supports comma-separated values for multiple
241
- * vendors (e.g., STRIPE,HUBSPOT)
314
+ * Query param: Filter by vendor identifier. Supports comma-separated values for
315
+ * multiple vendors (e.g., STRIPE,HUBSPOT)
242
316
  */
243
317
  vendorIdentifier?: Array<
244
318
  | 'AUTH0'
@@ -254,21 +328,34 @@ export interface IntegrationListParams extends MyCursorIDPageParams {
254
328
  | 'RECEIVED'
255
329
  | 'PREQUEL'
256
330
  >;
331
+
332
+ /**
333
+ * Header param: Account ID — optional when authenticating with a user JWT (Bearer
334
+ * token); falls back to the user's first membership. Ignored for API-key auth.
335
+ */
336
+ 'X-ACCOUNT-ID'?: string;
337
+
338
+ /**
339
+ * Header param: Environment ID — required when authenticating with a user JWT
340
+ * (Bearer token) on environment-scoped endpoints. Ignored for API-key auth (env is
341
+ * intrinsic to the key).
342
+ */
343
+ 'X-ENVIRONMENT-ID'?: string;
257
344
  }
258
345
 
259
346
  export interface IntegrationLinkParams {
260
347
  /**
261
- * Integration details
348
+ * Body param: Integration details
262
349
  */
263
350
  id: string;
264
351
 
265
352
  /**
266
- * Synced entity id
353
+ * Body param: Synced entity id
267
354
  */
268
355
  syncedEntityId: string;
269
356
 
270
357
  /**
271
- * The vendor identifier of integration
358
+ * Body param: The vendor identifier of integration
272
359
  */
273
360
  vendorIdentifier:
274
361
  | 'AUTH0'
@@ -283,13 +370,39 @@ export interface IntegrationLinkParams {
283
370
  | 'APP_STORE'
284
371
  | 'RECEIVED'
285
372
  | 'PREQUEL';
373
+
374
+ /**
375
+ * Header param: Account ID — optional when authenticating with a user JWT (Bearer
376
+ * token); falls back to the user's first membership. Ignored for API-key auth.
377
+ */
378
+ 'X-ACCOUNT-ID'?: string;
379
+
380
+ /**
381
+ * Header param: Environment ID — required when authenticating with a user JWT
382
+ * (Bearer token) on environment-scoped endpoints. Ignored for API-key auth (env is
383
+ * intrinsic to the key).
384
+ */
385
+ 'X-ENVIRONMENT-ID'?: string;
286
386
  }
287
387
 
288
388
  export interface IntegrationUnlinkParams {
289
389
  /**
290
- * Customer slug
390
+ * Path param: Customer slug
291
391
  */
292
392
  id: string;
393
+
394
+ /**
395
+ * Header param: Account ID — optional when authenticating with a user JWT (Bearer
396
+ * token); falls back to the user's first membership. Ignored for API-key auth.
397
+ */
398
+ 'X-ACCOUNT-ID'?: string;
399
+
400
+ /**
401
+ * Header param: Environment ID — required when authenticating with a user JWT
402
+ * (Bearer token) on environment-scoped endpoints. Ignored for API-key auth (env is
403
+ * intrinsic to the key).
404
+ */
405
+ 'X-ENVIRONMENT-ID'?: string;
293
406
  }
294
407
 
295
408
  export declare namespace Integrations {
@@ -3,6 +3,7 @@
3
3
  import { APIResource } from '../../../core/resource';
4
4
  import * as CustomersAPI from './customers';
5
5
  import { APIPromise } from '../../../core/api-promise';
6
+ import { buildHeaders } from '../../../internal/headers';
6
7
  import { RequestOptions } from '../../../internal/request-options';
7
8
  import { path } from '../../../internal/utils/path';
8
9
 
@@ -26,10 +27,21 @@ export class PaymentMethod extends APIResource {
26
27
  */
27
28
  attach(
28
29
  id: string,
29
- body: PaymentMethodAttachParams,
30
+ params: PaymentMethodAttachParams,
30
31
  options?: RequestOptions,
31
32
  ): APIPromise<CustomersAPI.CustomerResponse> {
32
- return this._client.post(path`/api/v1/customers/${id}/payment-method`, { body, ...options });
33
+ const { 'X-ACCOUNT-ID': xAccountID, 'X-ENVIRONMENT-ID': xEnvironmentID, ...body } = params;
34
+ return this._client.post(path`/api/v1/customers/${id}/payment-method`, {
35
+ body,
36
+ ...options,
37
+ headers: buildHeaders([
38
+ {
39
+ ...(xAccountID != null ? { 'X-ACCOUNT-ID': xAccountID } : undefined),
40
+ ...(xEnvironmentID != null ? { 'X-ENVIRONMENT-ID': xEnvironmentID } : undefined),
41
+ },
42
+ options?.headers,
43
+ ]),
44
+ });
33
45
  }
34
46
 
35
47
  /**
@@ -42,24 +54,38 @@ export class PaymentMethod extends APIResource {
42
54
  * await client.v1.customers.paymentMethod.detach('x');
43
55
  * ```
44
56
  */
45
- detach(id: string, options?: RequestOptions): APIPromise<CustomersAPI.CustomerResponse> {
46
- return this._client.delete(path`/api/v1/customers/${id}/payment-method`, options);
57
+ detach(
58
+ id: string,
59
+ params: PaymentMethodDetachParams | null | undefined = {},
60
+ options?: RequestOptions,
61
+ ): APIPromise<CustomersAPI.CustomerResponse> {
62
+ const { 'X-ACCOUNT-ID': xAccountID, 'X-ENVIRONMENT-ID': xEnvironmentID } = params ?? {};
63
+ return this._client.delete(path`/api/v1/customers/${id}/payment-method`, {
64
+ ...options,
65
+ headers: buildHeaders([
66
+ {
67
+ ...(xAccountID != null ? { 'X-ACCOUNT-ID': xAccountID } : undefined),
68
+ ...(xEnvironmentID != null ? { 'X-ENVIRONMENT-ID': xEnvironmentID } : undefined),
69
+ },
70
+ options?.headers,
71
+ ]),
72
+ });
47
73
  }
48
74
  }
49
75
 
50
76
  export interface PaymentMethodAttachParams {
51
77
  /**
52
- * Integration details
78
+ * Body param: Integration details
53
79
  */
54
80
  integrationId: string;
55
81
 
56
82
  /**
57
- * Billing provider payment method id
83
+ * Body param: Billing provider payment method id
58
84
  */
59
85
  paymentMethodId: string;
60
86
 
61
87
  /**
62
- * The vendor identifier of integration
88
+ * Body param: The vendor identifier of integration
63
89
  */
64
90
  vendorIdentifier:
65
91
  | 'AUTH0'
@@ -76,7 +102,7 @@ export interface PaymentMethodAttachParams {
76
102
  | 'PREQUEL';
77
103
 
78
104
  /**
79
- * Customers selected currency
105
+ * Body param: Customers selected currency
80
106
  */
81
107
  billingCurrency?:
82
108
  | 'usd'
@@ -196,8 +222,39 @@ export interface PaymentMethodAttachParams {
196
222
  | 'xof'
197
223
  | 'xpf'
198
224
  | null;
225
+
226
+ /**
227
+ * Header param: Account ID — optional when authenticating with a user JWT (Bearer
228
+ * token); falls back to the user's first membership. Ignored for API-key auth.
229
+ */
230
+ 'X-ACCOUNT-ID'?: string;
231
+
232
+ /**
233
+ * Header param: Environment ID — required when authenticating with a user JWT
234
+ * (Bearer token) on environment-scoped endpoints. Ignored for API-key auth (env is
235
+ * intrinsic to the key).
236
+ */
237
+ 'X-ENVIRONMENT-ID'?: string;
238
+ }
239
+
240
+ export interface PaymentMethodDetachParams {
241
+ /**
242
+ * Account ID — optional when authenticating with a user JWT (Bearer token); falls
243
+ * back to the user's first membership. Ignored for API-key auth.
244
+ */
245
+ 'X-ACCOUNT-ID'?: string;
246
+
247
+ /**
248
+ * Environment ID — required when authenticating with a user JWT (Bearer token) on
249
+ * environment-scoped endpoints. Ignored for API-key auth (env is intrinsic to the
250
+ * key).
251
+ */
252
+ 'X-ENVIRONMENT-ID'?: string;
199
253
  }
200
254
 
201
255
  export declare namespace PaymentMethod {
202
- export { type PaymentMethodAttachParams as PaymentMethodAttachParams };
256
+ export {
257
+ type PaymentMethodAttachParams as PaymentMethodAttachParams,
258
+ type PaymentMethodDetachParams as PaymentMethodDetachParams,
259
+ };
203
260
  }
@@ -3,6 +3,7 @@
3
3
  import { APIResource } from '../../../core/resource';
4
4
  import { APIPromise } from '../../../core/api-promise';
5
5
  import { MyCursorIDPage, type MyCursorIDPageParams, PagePromise } from '../../../core/pagination';
6
+ import { buildHeaders } from '../../../internal/headers';
6
7
  import { RequestOptions } from '../../../internal/request-options';
7
8
  import { path } from '../../../internal/utils/path';
8
9
 
@@ -48,10 +49,21 @@ export class PromotionalEntitlements extends APIResource {
48
49
  */
49
50
  create(
50
51
  id: string,
51
- body: PromotionalEntitlementCreateParams,
52
+ params: PromotionalEntitlementCreateParams,
52
53
  options?: RequestOptions,
53
54
  ): APIPromise<PromotionalEntitlementCreateResponse> {
54
- return this._client.post(path`/api/v1/customers/${id}/promotional-entitlements`, { body, ...options });
55
+ const { 'X-ACCOUNT-ID': xAccountID, 'X-ENVIRONMENT-ID': xEnvironmentID, ...body } = params;
56
+ return this._client.post(path`/api/v1/customers/${id}/promotional-entitlements`, {
57
+ body,
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
+ });
55
67
  }
56
68
 
57
69
  /**
@@ -69,13 +81,24 @@ export class PromotionalEntitlements extends APIResource {
69
81
  */
70
82
  list(
71
83
  id: string,
72
- query: PromotionalEntitlementListParams | null | undefined = {},
84
+ params: PromotionalEntitlementListParams | null | undefined = {},
73
85
  options?: RequestOptions,
74
86
  ): PagePromise<PromotionalEntitlementListResponsesMyCursorIDPage, PromotionalEntitlementListResponse> {
87
+ const { 'X-ACCOUNT-ID': xAccountID, 'X-ENVIRONMENT-ID': xEnvironmentID, ...query } = params ?? {};
75
88
  return this._client.getAPIList(
76
89
  path`/api/v1/customers/${id}/promotional-entitlements`,
77
90
  MyCursorIDPage<PromotionalEntitlementListResponse>,
78
- { query, ...options },
91
+ {
92
+ query,
93
+ ...options,
94
+ headers: buildHeaders([
95
+ {
96
+ ...(xAccountID != null ? { 'X-ACCOUNT-ID': xAccountID } : undefined),
97
+ ...(xEnvironmentID != null ? { 'X-ENVIRONMENT-ID': xEnvironmentID } : undefined),
98
+ },
99
+ options?.headers,
100
+ ]),
101
+ },
79
102
  );
80
103
  }
81
104
 
@@ -97,8 +120,17 @@ export class PromotionalEntitlements extends APIResource {
97
120
  params: PromotionalEntitlementRevokeParams,
98
121
  options?: RequestOptions,
99
122
  ): APIPromise<PromotionalEntitlementRevokeResponse> {
100
- const { id } = params;
101
- return this._client.delete(path`/api/v1/customers/${id}/promotional-entitlements/${featureID}`, options);
123
+ const { id, 'X-ACCOUNT-ID': xAccountID, 'X-ENVIRONMENT-ID': xEnvironmentID } = params;
124
+ return this._client.delete(path`/api/v1/customers/${id}/promotional-entitlements/${featureID}`, {
125
+ ...options,
126
+ headers: buildHeaders([
127
+ {
128
+ ...(xAccountID != null ? { 'X-ACCOUNT-ID': xAccountID } : undefined),
129
+ ...(xEnvironmentID != null ? { 'X-ENVIRONMENT-ID': xEnvironmentID } : undefined),
130
+ },
131
+ options?.headers,
132
+ ]),
133
+ });
102
134
  }
103
135
  }
104
136
 
@@ -545,9 +577,22 @@ export namespace PromotionalEntitlementRevokeResponse {
545
577
 
546
578
  export interface PromotionalEntitlementCreateParams {
547
579
  /**
548
- * Promotional entitlements to grant
580
+ * Body param: Promotional entitlements to grant
549
581
  */
550
582
  promotionalEntitlements: Array<PromotionalEntitlementCreateParams.PromotionalEntitlement>;
583
+
584
+ /**
585
+ * Header param: Account ID — optional when authenticating with a user JWT (Bearer
586
+ * token); falls back to the user's first membership. Ignored for API-key auth.
587
+ */
588
+ 'X-ACCOUNT-ID'?: string;
589
+
590
+ /**
591
+ * Header param: Environment ID — required when authenticating with a user JWT
592
+ * (Bearer token) on environment-scoped endpoints. Ignored for API-key auth (env is
593
+ * intrinsic to the key).
594
+ */
595
+ 'X-ENVIRONMENT-ID'?: string;
551
596
  }
552
597
 
553
598
  export namespace PromotionalEntitlementCreateParams {
@@ -665,15 +710,28 @@ export namespace PromotionalEntitlementCreateParams {
665
710
 
666
711
  export interface PromotionalEntitlementListParams extends MyCursorIDPageParams {
667
712
  /**
668
- * Filter by creation date using range operators: gt, gte, lt, lte
713
+ * Query param: Filter by creation date using range operators: gt, gte, lt, lte
669
714
  */
670
715
  createdAt?: PromotionalEntitlementListParams.CreatedAt;
671
716
 
672
717
  /**
673
- * Filter by promotional entitlement status. Supports comma-separated values for
674
- * multiple statuses
718
+ * Query param: Filter by promotional entitlement status. Supports comma-separated
719
+ * values for multiple statuses
675
720
  */
676
721
  status?: Array<'Active' | 'Expired' | 'Paused'>;
722
+
723
+ /**
724
+ * Header param: Account ID — optional when authenticating with a user JWT (Bearer
725
+ * token); falls back to the user's first membership. Ignored for API-key auth.
726
+ */
727
+ 'X-ACCOUNT-ID'?: string;
728
+
729
+ /**
730
+ * Header param: Environment ID — required when authenticating with a user JWT
731
+ * (Bearer token) on environment-scoped endpoints. Ignored for API-key auth (env is
732
+ * intrinsic to the key).
733
+ */
734
+ 'X-ENVIRONMENT-ID'?: string;
677
735
  }
678
736
 
679
737
  export namespace PromotionalEntitlementListParams {
@@ -705,9 +763,22 @@ export namespace PromotionalEntitlementListParams {
705
763
 
706
764
  export interface PromotionalEntitlementRevokeParams {
707
765
  /**
708
- * The unique identifier of the customer
766
+ * Path param: The unique identifier of the customer
709
767
  */
710
768
  id: string;
769
+
770
+ /**
771
+ * Header param: Account ID — optional when authenticating with a user JWT (Bearer
772
+ * token); falls back to the user's first membership. Ignored for API-key auth.
773
+ */
774
+ 'X-ACCOUNT-ID'?: string;
775
+
776
+ /**
777
+ * Header param: Environment ID — required when authenticating with a user JWT
778
+ * (Bearer token) on environment-scoped endpoints. Ignored for API-key auth (env is
779
+ * intrinsic to the key).
780
+ */
781
+ 'X-ENVIRONMENT-ID'?: string;
711
782
  }
712
783
 
713
784
  export declare namespace PromotionalEntitlements {
@@ -3,6 +3,7 @@
3
3
  import { APIResource } from '../../../../../core/resource';
4
4
  import { APIPromise } from '../../../../../core/api-promise';
5
5
  import { MyCursorIDPage, type MyCursorIDPageParams, PagePromise } from '../../../../../core/pagination';
6
+ import { buildHeaders } from '../../../../../internal/headers';
6
7
  import { RequestOptions } from '../../../../../internal/request-options';
7
8
  import { path } from '../../../../../internal/utils/path';
8
9
 
@@ -24,13 +25,24 @@ export class Assignments extends APIResource {
24
25
  */
25
26
  list(
26
27
  id: string,
27
- query: AssignmentListParams | null | undefined = {},
28
+ params: AssignmentListParams | null | undefined = {},
28
29
  options?: RequestOptions,
29
30
  ): PagePromise<AssignmentListResponsesMyCursorIDPage, AssignmentListResponse> {
31
+ const { 'X-ACCOUNT-ID': xAccountID, 'X-ENVIRONMENT-ID': xEnvironmentID, ...query } = params ?? {};
30
32
  return this._client.getAPIList(
31
33
  path`/api/v1-beta/customers/${id}/assignments`,
32
34
  MyCursorIDPage<AssignmentListResponse>,
33
- { query, ...options },
35
+ {
36
+ query,
37
+ ...options,
38
+ headers: buildHeaders([
39
+ {
40
+ ...(xAccountID != null ? { 'X-ACCOUNT-ID': xAccountID } : undefined),
41
+ ...(xEnvironmentID != null ? { 'X-ENVIRONMENT-ID': xEnvironmentID } : undefined),
42
+ },
43
+ options?.headers,
44
+ ]),
45
+ },
34
46
  );
35
47
  }
36
48
 
@@ -66,10 +78,21 @@ export class Assignments extends APIResource {
66
78
  */
67
79
  upsert(
68
80
  id: string,
69
- body: AssignmentUpsertParams,
81
+ params: AssignmentUpsertParams,
70
82
  options?: RequestOptions,
71
83
  ): APIPromise<AssignmentUpsertResponse> {
72
- return this._client.put(path`/api/v1-beta/customers/${id}/assignments`, { body, ...options });
84
+ const { 'X-ACCOUNT-ID': xAccountID, 'X-ENVIRONMENT-ID': xEnvironmentID, ...body } = params;
85
+ return this._client.put(path`/api/v1-beta/customers/${id}/assignments`, {
86
+ body,
87
+ ...options,
88
+ headers: buildHeaders([
89
+ {
90
+ ...(xAccountID != null ? { 'X-ACCOUNT-ID': xAccountID } : undefined),
91
+ ...(xEnvironmentID != null ? { 'X-ENVIRONMENT-ID': xEnvironmentID } : undefined),
92
+ },
93
+ options?.headers,
94
+ ]),
95
+ });
73
96
  }
74
97
  }
75
98
 
@@ -170,21 +193,47 @@ export namespace AssignmentUpsertResponse {
170
193
 
171
194
  export interface AssignmentListParams extends MyCursorIDPageParams {
172
195
  /**
173
- * Filter assignments to a specific capability refId
196
+ * Query param: Filter assignments to a specific capability refId
174
197
  */
175
198
  capabilityId?: string;
176
199
 
177
200
  /**
178
- * Filter assignments to a specific entity refId
201
+ * Query param: Filter assignments to a specific entity refId
179
202
  */
180
203
  entityId?: string;
204
+
205
+ /**
206
+ * Header param: Account ID — optional when authenticating with a user JWT (Bearer
207
+ * token); falls back to the user's first membership. Ignored for API-key auth.
208
+ */
209
+ 'X-ACCOUNT-ID'?: string;
210
+
211
+ /**
212
+ * Header param: Environment ID — required when authenticating with a user JWT
213
+ * (Bearer token) on environment-scoped endpoints. Ignored for API-key auth (env is
214
+ * intrinsic to the key).
215
+ */
216
+ 'X-ENVIRONMENT-ID'?: string;
181
217
  }
182
218
 
183
219
  export interface AssignmentUpsertParams {
184
220
  /**
185
- * Assignments to upsert (1–100 per request)
221
+ * Body param: Assignments to upsert (1–100 per request)
186
222
  */
187
223
  assignments: Array<AssignmentUpsertParams.Assignment>;
224
+
225
+ /**
226
+ * Header param: Account ID — optional when authenticating with a user JWT (Bearer
227
+ * token); falls back to the user's first membership. Ignored for API-key auth.
228
+ */
229
+ 'X-ACCOUNT-ID'?: string;
230
+
231
+ /**
232
+ * Header param: Environment ID — required when authenticating with a user JWT
233
+ * (Bearer token) on environment-scoped endpoints. Ignored for API-key auth (env is
234
+ * intrinsic to the key).
235
+ */
236
+ 'X-ENVIRONMENT-ID'?: string;
188
237
  }
189
238
 
190
239
  export namespace AssignmentUpsertParams {