@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
@@ -6,6 +6,7 @@ import {
6
6
  EntitlementCreateParams,
7
7
  EntitlementCreateResponse,
8
8
  EntitlementDeleteParams,
9
+ EntitlementListParams,
9
10
  EntitlementListResponse,
10
11
  EntitlementUpdateParams,
11
12
  Entitlements,
@@ -13,6 +14,7 @@ import {
13
14
  } from './entitlements';
14
15
  import { APIPromise } from '../../../core/api-promise';
15
16
  import { MyCursorIDPage, type MyCursorIDPageParams, PagePromise } from '../../../core/pagination';
17
+ import { buildHeaders } from '../../../internal/headers';
16
18
  import { RequestOptions } from '../../../internal/request-options';
17
19
  import { path } from '../../../internal/utils/path';
18
20
 
@@ -34,8 +36,19 @@ export class Plans extends APIResource {
34
36
  * });
35
37
  * ```
36
38
  */
37
- create(body: PlanCreateParams, options?: RequestOptions): APIPromise<Plan> {
38
- return this._client.post('/api/v1/plans', { body, ...options });
39
+ create(params: PlanCreateParams, options?: RequestOptions): APIPromise<Plan> {
40
+ const { 'X-ACCOUNT-ID': xAccountID, 'X-ENVIRONMENT-ID': xEnvironmentID, ...body } = params;
41
+ return this._client.post('/api/v1/plans', {
42
+ body,
43
+ ...options,
44
+ headers: buildHeaders([
45
+ {
46
+ ...(xAccountID != null ? { 'X-ACCOUNT-ID': xAccountID } : undefined),
47
+ ...(xEnvironmentID != null ? { 'X-ENVIRONMENT-ID': xEnvironmentID } : undefined),
48
+ },
49
+ options?.headers,
50
+ ]),
51
+ });
39
52
  }
40
53
 
41
54
  /**
@@ -47,8 +60,22 @@ export class Plans extends APIResource {
47
60
  * const plan = await client.v1.plans.retrieve('x');
48
61
  * ```
49
62
  */
50
- retrieve(id: string, options?: RequestOptions): APIPromise<Plan> {
51
- return this._client.get(path`/api/v1/plans/${id}`, options);
63
+ retrieve(
64
+ id: string,
65
+ params: PlanRetrieveParams | null | undefined = {},
66
+ options?: RequestOptions,
67
+ ): APIPromise<Plan> {
68
+ const { 'X-ACCOUNT-ID': xAccountID, 'X-ENVIRONMENT-ID': xEnvironmentID } = params ?? {};
69
+ return this._client.get(path`/api/v1/plans/${id}`, {
70
+ ...options,
71
+ headers: buildHeaders([
72
+ {
73
+ ...(xAccountID != null ? { 'X-ACCOUNT-ID': xAccountID } : undefined),
74
+ ...(xEnvironmentID != null ? { 'X-ENVIRONMENT-ID': xEnvironmentID } : undefined),
75
+ },
76
+ options?.headers,
77
+ ]),
78
+ });
52
79
  }
53
80
 
54
81
  /**
@@ -60,8 +87,19 @@ export class Plans extends APIResource {
60
87
  * const plan = await client.v1.plans.update('x');
61
88
  * ```
62
89
  */
63
- update(id: string, body: PlanUpdateParams, options?: RequestOptions): APIPromise<Plan> {
64
- return this._client.patch(path`/api/v1/plans/${id}`, { body, ...options });
90
+ update(id: string, params: PlanUpdateParams, options?: RequestOptions): APIPromise<Plan> {
91
+ const { 'X-ACCOUNT-ID': xAccountID, 'X-ENVIRONMENT-ID': xEnvironmentID, ...body } = params;
92
+ return this._client.patch(path`/api/v1/plans/${id}`, {
93
+ body,
94
+ ...options,
95
+ headers: buildHeaders([
96
+ {
97
+ ...(xAccountID != null ? { 'X-ACCOUNT-ID': xAccountID } : undefined),
98
+ ...(xEnvironmentID != null ? { 'X-ENVIRONMENT-ID': xEnvironmentID } : undefined),
99
+ },
100
+ options?.headers,
101
+ ]),
102
+ });
65
103
  }
66
104
 
67
105
  /**
@@ -76,10 +114,21 @@ export class Plans extends APIResource {
76
114
  * ```
77
115
  */
78
116
  list(
79
- query: PlanListParams | null | undefined = {},
117
+ params: PlanListParams | null | undefined = {},
80
118
  options?: RequestOptions,
81
119
  ): PagePromise<PlanListResponsesMyCursorIDPage, PlanListResponse> {
82
- return this._client.getAPIList('/api/v1/plans', MyCursorIDPage<PlanListResponse>, { query, ...options });
120
+ const { 'X-ACCOUNT-ID': xAccountID, 'X-ENVIRONMENT-ID': xEnvironmentID, ...query } = params ?? {};
121
+ return this._client.getAPIList('/api/v1/plans', MyCursorIDPage<PlanListResponse>, {
122
+ query,
123
+ ...options,
124
+ headers: buildHeaders([
125
+ {
126
+ ...(xAccountID != null ? { 'X-ACCOUNT-ID': xAccountID } : undefined),
127
+ ...(xEnvironmentID != null ? { 'X-ENVIRONMENT-ID': xEnvironmentID } : undefined),
128
+ },
129
+ options?.headers,
130
+ ]),
131
+ });
83
132
  }
84
133
 
85
134
  /**
@@ -90,8 +139,22 @@ export class Plans extends APIResource {
90
139
  * const plan = await client.v1.plans.archive('x');
91
140
  * ```
92
141
  */
93
- archive(id: string, options?: RequestOptions): APIPromise<Plan> {
94
- return this._client.post(path`/api/v1/plans/${id}/archive`, options);
142
+ archive(
143
+ id: string,
144
+ params: PlanArchiveParams | null | undefined = {},
145
+ options?: RequestOptions,
146
+ ): APIPromise<Plan> {
147
+ const { 'X-ACCOUNT-ID': xAccountID, 'X-ENVIRONMENT-ID': xEnvironmentID } = params ?? {};
148
+ return this._client.post(path`/api/v1/plans/${id}/archive`, {
149
+ ...options,
150
+ headers: buildHeaders([
151
+ {
152
+ ...(xAccountID != null ? { 'X-ACCOUNT-ID': xAccountID } : undefined),
153
+ ...(xEnvironmentID != null ? { 'X-ENVIRONMENT-ID': xEnvironmentID } : undefined),
154
+ },
155
+ options?.headers,
156
+ ]),
157
+ });
95
158
  }
96
159
 
97
160
  /**
@@ -102,8 +165,22 @@ export class Plans extends APIResource {
102
165
  * const plan = await client.v1.plans.createDraft('x');
103
166
  * ```
104
167
  */
105
- createDraft(id: string, options?: RequestOptions): APIPromise<Plan> {
106
- return this._client.post(path`/api/v1/plans/${id}/draft`, options);
168
+ createDraft(
169
+ id: string,
170
+ params: PlanCreateDraftParams | null | undefined = {},
171
+ options?: RequestOptions,
172
+ ): APIPromise<Plan> {
173
+ const { 'X-ACCOUNT-ID': xAccountID, 'X-ENVIRONMENT-ID': xEnvironmentID } = params ?? {};
174
+ return this._client.post(path`/api/v1/plans/${id}/draft`, {
175
+ ...options,
176
+ headers: buildHeaders([
177
+ {
178
+ ...(xAccountID != null ? { 'X-ACCOUNT-ID': xAccountID } : undefined),
179
+ ...(xEnvironmentID != null ? { 'X-ENVIRONMENT-ID': xEnvironmentID } : undefined),
180
+ },
181
+ options?.headers,
182
+ ]),
183
+ });
107
184
  }
108
185
 
109
186
  /**
@@ -121,13 +198,24 @@ export class Plans extends APIResource {
121
198
  */
122
199
  listCharges(
123
200
  id: string,
124
- query: PlanListChargesParams | null | undefined = {},
201
+ params: PlanListChargesParams | null | undefined = {},
125
202
  options?: RequestOptions,
126
203
  ): PagePromise<PlanListChargesResponsesMyCursorIDPage, PlanListChargesResponse> {
204
+ const { 'X-ACCOUNT-ID': xAccountID, 'X-ENVIRONMENT-ID': xEnvironmentID, ...query } = params ?? {};
127
205
  return this._client.getAPIList(
128
206
  path`/api/v1/plans/${id}/charges`,
129
207
  MyCursorIDPage<PlanListChargesResponse>,
130
- { query, ...options },
208
+ {
209
+ query,
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
+ },
131
219
  );
132
220
  }
133
221
 
@@ -146,13 +234,24 @@ export class Plans extends APIResource {
146
234
  */
147
235
  listOverageCharges(
148
236
  id: string,
149
- query: PlanListOverageChargesParams | null | undefined = {},
237
+ params: PlanListOverageChargesParams | null | undefined = {},
150
238
  options?: RequestOptions,
151
239
  ): PagePromise<PlanListOverageChargesResponsesMyCursorIDPage, PlanListOverageChargesResponse> {
240
+ const { 'X-ACCOUNT-ID': xAccountID, 'X-ENVIRONMENT-ID': xEnvironmentID, ...query } = params ?? {};
152
241
  return this._client.getAPIList(
153
242
  path`/api/v1/plans/${id}/overage-charges`,
154
243
  MyCursorIDPage<PlanListOverageChargesResponse>,
155
- { query, ...options },
244
+ {
245
+ query,
246
+ ...options,
247
+ headers: buildHeaders([
248
+ {
249
+ ...(xAccountID != null ? { 'X-ACCOUNT-ID': xAccountID } : undefined),
250
+ ...(xEnvironmentID != null ? { 'X-ENVIRONMENT-ID': xEnvironmentID } : undefined),
251
+ },
252
+ options?.headers,
253
+ ]),
254
+ },
156
255
  );
157
256
  }
158
257
 
@@ -166,8 +265,19 @@ export class Plans extends APIResource {
166
265
  * });
167
266
  * ```
168
267
  */
169
- publish(id: string, body: PlanPublishParams, options?: RequestOptions): APIPromise<PlanPublishResponse> {
170
- return this._client.post(path`/api/v1/plans/${id}/publish`, { body, ...options });
268
+ publish(id: string, params: PlanPublishParams, options?: RequestOptions): APIPromise<PlanPublishResponse> {
269
+ const { 'X-ACCOUNT-ID': xAccountID, 'X-ENVIRONMENT-ID': xEnvironmentID, ...body } = params;
270
+ return this._client.post(path`/api/v1/plans/${id}/publish`, {
271
+ body,
272
+ ...options,
273
+ headers: buildHeaders([
274
+ {
275
+ ...(xAccountID != null ? { 'X-ACCOUNT-ID': xAccountID } : undefined),
276
+ ...(xEnvironmentID != null ? { 'X-ENVIRONMENT-ID': xEnvironmentID } : undefined),
277
+ },
278
+ options?.headers,
279
+ ]),
280
+ });
171
281
  }
172
282
 
173
283
  /**
@@ -178,8 +288,22 @@ export class Plans extends APIResource {
178
288
  * const response = await client.v1.plans.removeDraft('x');
179
289
  * ```
180
290
  */
181
- removeDraft(id: string, options?: RequestOptions): APIPromise<PlanRemoveDraftResponse> {
182
- return this._client.delete(path`/api/v1/plans/${id}/draft`, options);
291
+ removeDraft(
292
+ id: string,
293
+ params: PlanRemoveDraftParams | null | undefined = {},
294
+ options?: RequestOptions,
295
+ ): APIPromise<PlanRemoveDraftResponse> {
296
+ const { 'X-ACCOUNT-ID': xAccountID, 'X-ENVIRONMENT-ID': xEnvironmentID } = params ?? {};
297
+ return this._client.delete(path`/api/v1/plans/${id}/draft`, {
298
+ ...options,
299
+ headers: buildHeaders([
300
+ {
301
+ ...(xAccountID != null ? { 'X-ACCOUNT-ID': xAccountID } : undefined),
302
+ ...(xEnvironmentID != null ? { 'X-ENVIRONMENT-ID': xEnvironmentID } : undefined),
303
+ },
304
+ options?.headers,
305
+ ]),
306
+ });
183
307
  }
184
308
  }
185
309
 
@@ -1599,54 +1723,67 @@ export namespace PlanRemoveDraftResponse {
1599
1723
 
1600
1724
  export interface PlanCreateParams {
1601
1725
  /**
1602
- * The unique identifier for the entity
1726
+ * Body param: The unique identifier for the entity
1603
1727
  */
1604
1728
  id: string;
1605
1729
 
1606
1730
  /**
1607
- * The display name of the package
1731
+ * Body param: The display name of the package
1608
1732
  */
1609
1733
  displayName: string;
1610
1734
 
1611
1735
  /**
1612
- * The product ID to associate the plan with
1736
+ * Body param: The product ID to associate the plan with
1613
1737
  */
1614
1738
  productId: string;
1615
1739
 
1616
1740
  /**
1617
- * The unique identifier for the entity in the billing provider
1741
+ * Body param: The unique identifier for the entity in the billing provider
1618
1742
  */
1619
1743
  billingId?: string | null;
1620
1744
 
1621
1745
  /**
1622
- * Default trial configuration for the plan
1746
+ * Body param: Default trial configuration for the plan
1623
1747
  */
1624
1748
  defaultTrialConfig?: PlanCreateParams.DefaultTrialConfig | null;
1625
1749
 
1626
1750
  /**
1627
- * The description of the package
1751
+ * Body param: The description of the package
1628
1752
  */
1629
1753
  description?: string | null;
1630
1754
 
1631
1755
  /**
1632
- * Metadata associated with the entity
1756
+ * Body param: Metadata associated with the entity
1633
1757
  */
1634
1758
  metadata?: { [key: string]: string };
1635
1759
 
1636
1760
  /**
1637
- * The ID of the parent plan, if applicable
1761
+ * Body param: The ID of the parent plan, if applicable
1638
1762
  */
1639
1763
  parentPlanId?: string | null;
1640
1764
 
1641
1765
  /**
1642
- * The pricing type of the package
1766
+ * Body param: The pricing type of the package
1643
1767
  */
1644
1768
  pricingType?: 'FREE' | 'PAID' | 'CUSTOM' | null;
1645
1769
 
1646
1770
  /**
1647
- * The status of the package
1771
+ * Body param: The status of the package
1648
1772
  */
1649
1773
  status?: 'DRAFT' | 'PUBLISHED' | 'ARCHIVED';
1774
+
1775
+ /**
1776
+ * Header param: Account ID — optional when authenticating with a user JWT (Bearer
1777
+ * token); falls back to the user's first membership. Ignored for API-key auth.
1778
+ */
1779
+ 'X-ACCOUNT-ID'?: string;
1780
+
1781
+ /**
1782
+ * Header param: Environment ID — required when authenticating with a user JWT
1783
+ * (Bearer token) on environment-scoped endpoints. Ignored for API-key auth (env is
1784
+ * intrinsic to the key).
1785
+ */
1786
+ 'X-ENVIRONMENT-ID'?: string;
1650
1787
  }
1651
1788
 
1652
1789
  export namespace PlanCreateParams {
@@ -1693,43 +1830,74 @@ export namespace PlanCreateParams {
1693
1830
  }
1694
1831
  }
1695
1832
 
1833
+ export interface PlanRetrieveParams {
1834
+ /**
1835
+ * Account ID — optional when authenticating with a user JWT (Bearer token); falls
1836
+ * back to the user's first membership. Ignored for API-key auth.
1837
+ */
1838
+ 'X-ACCOUNT-ID'?: string;
1839
+
1840
+ /**
1841
+ * Environment ID — required when authenticating with a user JWT (Bearer token) on
1842
+ * environment-scoped endpoints. Ignored for API-key auth (env is intrinsic to the
1843
+ * key).
1844
+ */
1845
+ 'X-ENVIRONMENT-ID'?: string;
1846
+ }
1847
+
1696
1848
  export interface PlanUpdateParams {
1697
1849
  /**
1698
- * The unique identifier for the entity in the billing provider
1850
+ * Body param: The unique identifier for the entity in the billing provider
1699
1851
  */
1700
1852
  billingId?: string | null;
1701
1853
 
1702
1854
  /**
1703
- * Pricing configuration to set on the plan draft
1855
+ * Body param: Pricing configuration to set on the plan draft
1704
1856
  */
1705
1857
  charges?: PlanUpdateParams.Charges;
1706
1858
 
1859
+ /**
1860
+ * Body param
1861
+ */
1707
1862
  compatibleAddonIds?: Array<string> | null;
1708
1863
 
1709
1864
  /**
1710
- * Default trial configuration for the plan
1865
+ * Body param: Default trial configuration for the plan
1711
1866
  */
1712
1867
  defaultTrialConfig?: PlanUpdateParams.DefaultTrialConfig | null;
1713
1868
 
1714
1869
  /**
1715
- * The description of the package
1870
+ * Body param: The description of the package
1716
1871
  */
1717
1872
  description?: string | null;
1718
1873
 
1719
1874
  /**
1720
- * The display name of the package
1875
+ * Body param: The display name of the package
1721
1876
  */
1722
1877
  displayName?: string;
1723
1878
 
1724
1879
  /**
1725
- * Metadata associated with the entity
1880
+ * Body param: Metadata associated with the entity
1726
1881
  */
1727
1882
  metadata?: { [key: string]: string };
1728
1883
 
1729
1884
  /**
1730
- * The ID of the parent plan, if applicable
1885
+ * Body param: The ID of the parent plan, if applicable
1731
1886
  */
1732
1887
  parentPlanId?: string | null;
1888
+
1889
+ /**
1890
+ * Header param: Account ID — optional when authenticating with a user JWT (Bearer
1891
+ * token); falls back to the user's first membership. Ignored for API-key auth.
1892
+ */
1893
+ 'X-ACCOUNT-ID'?: string;
1894
+
1895
+ /**
1896
+ * Header param: Environment ID — required when authenticating with a user JWT
1897
+ * (Bearer token) on environment-scoped endpoints. Ignored for API-key auth (env is
1898
+ * intrinsic to the key).
1899
+ */
1900
+ 'X-ENVIRONMENT-ID'?: string;
1733
1901
  }
1734
1902
 
1735
1903
  export namespace PlanUpdateParams {
@@ -3144,19 +3312,33 @@ export namespace PlanUpdateParams {
3144
3312
 
3145
3313
  export interface PlanListParams extends MyCursorIDPageParams {
3146
3314
  /**
3147
- * Filter by creation date using range operators: gt, gte, lt, lte
3315
+ * Query param: Filter by creation date using range operators: gt, gte, lt, lte
3148
3316
  */
3149
3317
  createdAt?: PlanListParams.CreatedAt;
3150
3318
 
3151
3319
  /**
3152
- * Filter by product ID
3320
+ * Query param: Filter by product ID
3153
3321
  */
3154
3322
  productId?: string;
3155
3323
 
3156
3324
  /**
3157
- * Filter by status. Supports comma-separated values for multiple statuses
3325
+ * Query param: Filter by status. Supports comma-separated values for multiple
3326
+ * statuses
3158
3327
  */
3159
3328
  status?: Array<'DRAFT' | 'PUBLISHED' | 'ARCHIVED'>;
3329
+
3330
+ /**
3331
+ * Header param: Account ID — optional when authenticating with a user JWT (Bearer
3332
+ * token); falls back to the user's first membership. Ignored for API-key auth.
3333
+ */
3334
+ 'X-ACCOUNT-ID'?: string;
3335
+
3336
+ /**
3337
+ * Header param: Environment ID — required when authenticating with a user JWT
3338
+ * (Bearer token) on environment-scoped endpoints. Ignored for API-key auth (env is
3339
+ * intrinsic to the key).
3340
+ */
3341
+ 'X-ENVIRONMENT-ID'?: string;
3160
3342
  }
3161
3343
 
3162
3344
  export namespace PlanListParams {
@@ -3186,15 +3368,99 @@ export namespace PlanListParams {
3186
3368
  }
3187
3369
  }
3188
3370
 
3189
- export interface PlanListChargesParams extends MyCursorIDPageParams {}
3371
+ export interface PlanArchiveParams {
3372
+ /**
3373
+ * Account ID — optional when authenticating with a user JWT (Bearer token); falls
3374
+ * back to the user's first membership. Ignored for API-key auth.
3375
+ */
3376
+ 'X-ACCOUNT-ID'?: string;
3190
3377
 
3191
- export interface PlanListOverageChargesParams extends MyCursorIDPageParams {}
3378
+ /**
3379
+ * Environment ID — required when authenticating with a user JWT (Bearer token) on
3380
+ * environment-scoped endpoints. Ignored for API-key auth (env is intrinsic to the
3381
+ * key).
3382
+ */
3383
+ 'X-ENVIRONMENT-ID'?: string;
3384
+ }
3385
+
3386
+ export interface PlanCreateDraftParams {
3387
+ /**
3388
+ * Account ID — optional when authenticating with a user JWT (Bearer token); falls
3389
+ * back to the user's first membership. Ignored for API-key auth.
3390
+ */
3391
+ 'X-ACCOUNT-ID'?: string;
3392
+
3393
+ /**
3394
+ * Environment ID — required when authenticating with a user JWT (Bearer token) on
3395
+ * environment-scoped endpoints. Ignored for API-key auth (env is intrinsic to the
3396
+ * key).
3397
+ */
3398
+ 'X-ENVIRONMENT-ID'?: string;
3399
+ }
3400
+
3401
+ export interface PlanListChargesParams extends MyCursorIDPageParams {
3402
+ /**
3403
+ * Header param: Account ID — optional when authenticating with a user JWT (Bearer
3404
+ * token); falls back to the user's first membership. Ignored for API-key auth.
3405
+ */
3406
+ 'X-ACCOUNT-ID'?: string;
3407
+
3408
+ /**
3409
+ * Header param: Environment ID — required when authenticating with a user JWT
3410
+ * (Bearer token) on environment-scoped endpoints. Ignored for API-key auth (env is
3411
+ * intrinsic to the key).
3412
+ */
3413
+ 'X-ENVIRONMENT-ID'?: string;
3414
+ }
3415
+
3416
+ export interface PlanListOverageChargesParams extends MyCursorIDPageParams {
3417
+ /**
3418
+ * Header param: Account ID — optional when authenticating with a user JWT (Bearer
3419
+ * token); falls back to the user's first membership. Ignored for API-key auth.
3420
+ */
3421
+ 'X-ACCOUNT-ID'?: string;
3422
+
3423
+ /**
3424
+ * Header param: Environment ID — required when authenticating with a user JWT
3425
+ * (Bearer token) on environment-scoped endpoints. Ignored for API-key auth (env is
3426
+ * intrinsic to the key).
3427
+ */
3428
+ 'X-ENVIRONMENT-ID'?: string;
3429
+ }
3192
3430
 
3193
3431
  export interface PlanPublishParams {
3194
3432
  /**
3195
- * The migration type of the package
3433
+ * Body param: The migration type of the package
3196
3434
  */
3197
3435
  migrationType: 'NEW_CUSTOMERS' | 'ALL_CUSTOMERS';
3436
+
3437
+ /**
3438
+ * Header param: Account ID — optional when authenticating with a user JWT (Bearer
3439
+ * token); falls back to the user's first membership. Ignored for API-key auth.
3440
+ */
3441
+ 'X-ACCOUNT-ID'?: string;
3442
+
3443
+ /**
3444
+ * Header param: Environment ID — required when authenticating with a user JWT
3445
+ * (Bearer token) on environment-scoped endpoints. Ignored for API-key auth (env is
3446
+ * intrinsic to the key).
3447
+ */
3448
+ 'X-ENVIRONMENT-ID'?: string;
3449
+ }
3450
+
3451
+ export interface PlanRemoveDraftParams {
3452
+ /**
3453
+ * Account ID — optional when authenticating with a user JWT (Bearer token); falls
3454
+ * back to the user's first membership. Ignored for API-key auth.
3455
+ */
3456
+ 'X-ACCOUNT-ID'?: string;
3457
+
3458
+ /**
3459
+ * Environment ID — required when authenticating with a user JWT (Bearer token) on
3460
+ * environment-scoped endpoints. Ignored for API-key auth (env is intrinsic to the
3461
+ * key).
3462
+ */
3463
+ 'X-ENVIRONMENT-ID'?: string;
3198
3464
  }
3199
3465
 
3200
3466
  Plans.Entitlements = Entitlements;
@@ -3211,11 +3477,15 @@ export declare namespace Plans {
3211
3477
  type PlanListChargesResponsesMyCursorIDPage as PlanListChargesResponsesMyCursorIDPage,
3212
3478
  type PlanListOverageChargesResponsesMyCursorIDPage as PlanListOverageChargesResponsesMyCursorIDPage,
3213
3479
  type PlanCreateParams as PlanCreateParams,
3480
+ type PlanRetrieveParams as PlanRetrieveParams,
3214
3481
  type PlanUpdateParams as PlanUpdateParams,
3215
3482
  type PlanListParams as PlanListParams,
3483
+ type PlanArchiveParams as PlanArchiveParams,
3484
+ type PlanCreateDraftParams as PlanCreateDraftParams,
3216
3485
  type PlanListChargesParams as PlanListChargesParams,
3217
3486
  type PlanListOverageChargesParams as PlanListOverageChargesParams,
3218
3487
  type PlanPublishParams as PlanPublishParams,
3488
+ type PlanRemoveDraftParams as PlanRemoveDraftParams,
3219
3489
  };
3220
3490
 
3221
3491
  export {
@@ -3225,6 +3495,7 @@ export declare namespace Plans {
3225
3495
  type EntitlementListResponse as EntitlementListResponse,
3226
3496
  type EntitlementCreateParams as EntitlementCreateParams,
3227
3497
  type EntitlementUpdateParams as EntitlementUpdateParams,
3498
+ type EntitlementListParams as EntitlementListParams,
3228
3499
  type EntitlementDeleteParams as EntitlementDeleteParams,
3229
3500
  };
3230
3501
  }