@stigg/typescript 0.1.0-alpha.1 → 0.1.0-alpha.11

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 (317) hide show
  1. package/CHANGELOG.md +158 -0
  2. package/README.md +40 -0
  3. package/client.d.mts +6 -8
  4. package/client.d.mts.map +1 -1
  5. package/client.d.ts +6 -8
  6. package/client.d.ts.map +1 -1
  7. package/client.js +23 -21
  8. package/client.js.map +1 -1
  9. package/client.mjs +24 -22
  10. package/client.mjs.map +1 -1
  11. package/core/pagination.d.mts +11 -5
  12. package/core/pagination.d.mts.map +1 -1
  13. package/core/pagination.d.ts +11 -5
  14. package/core/pagination.d.ts.map +1 -1
  15. package/core/pagination.js +9 -9
  16. package/core/pagination.js.map +1 -1
  17. package/core/pagination.mjs +9 -9
  18. package/core/pagination.mjs.map +1 -1
  19. package/internal/parse.d.mts.map +1 -1
  20. package/internal/parse.d.ts.map +1 -1
  21. package/internal/parse.js +5 -0
  22. package/internal/parse.js.map +1 -1
  23. package/internal/parse.mjs +5 -0
  24. package/internal/parse.mjs.map +1 -1
  25. package/internal/qs/formats.d.mts +7 -0
  26. package/internal/qs/formats.d.mts.map +1 -0
  27. package/internal/qs/formats.d.ts +7 -0
  28. package/internal/qs/formats.d.ts.map +1 -0
  29. package/internal/qs/formats.js +13 -0
  30. package/internal/qs/formats.js.map +1 -0
  31. package/internal/qs/formats.mjs +9 -0
  32. package/internal/qs/formats.mjs.map +1 -0
  33. package/internal/qs/index.d.mts +10 -0
  34. package/internal/qs/index.d.mts.map +1 -0
  35. package/internal/qs/index.d.ts +10 -0
  36. package/internal/qs/index.d.ts.map +1 -0
  37. package/internal/qs/index.js +14 -0
  38. package/internal/qs/index.js.map +1 -0
  39. package/internal/qs/index.mjs +10 -0
  40. package/internal/qs/index.mjs.map +1 -0
  41. package/internal/qs/stringify.d.mts +3 -0
  42. package/internal/qs/stringify.d.mts.map +1 -0
  43. package/internal/qs/stringify.d.ts +3 -0
  44. package/internal/qs/stringify.d.ts.map +1 -0
  45. package/internal/qs/stringify.js +277 -0
  46. package/internal/qs/stringify.js.map +1 -0
  47. package/internal/qs/stringify.mjs +274 -0
  48. package/internal/qs/stringify.mjs.map +1 -0
  49. package/internal/qs/types.d.mts +57 -0
  50. package/internal/qs/types.d.mts.map +1 -0
  51. package/internal/qs/types.d.ts +57 -0
  52. package/internal/qs/types.d.ts.map +1 -0
  53. package/internal/qs/types.js +3 -0
  54. package/internal/qs/types.js.map +1 -0
  55. package/internal/qs/types.mjs +2 -0
  56. package/internal/qs/types.mjs.map +1 -0
  57. package/internal/qs/utils.d.mts +15 -0
  58. package/internal/qs/utils.d.mts.map +1 -0
  59. package/internal/qs/utils.d.ts +15 -0
  60. package/internal/qs/utils.d.ts.map +1 -0
  61. package/internal/qs/utils.js +230 -0
  62. package/internal/qs/utils.js.map +1 -0
  63. package/internal/qs/utils.mjs +217 -0
  64. package/internal/qs/utils.mjs.map +1 -0
  65. package/package.json +1 -1
  66. package/resources/index.d.mts +1 -1
  67. package/resources/index.d.mts.map +1 -1
  68. package/resources/index.d.ts +1 -1
  69. package/resources/index.d.ts.map +1 -1
  70. package/resources/index.js.map +1 -1
  71. package/resources/index.mjs +1 -1
  72. package/resources/index.mjs.map +1 -1
  73. package/resources/v1/addons/addons.d.mts +1298 -0
  74. package/resources/v1/addons/addons.d.mts.map +1 -0
  75. package/resources/v1/addons/addons.d.ts +1298 -0
  76. package/resources/v1/addons/addons.d.ts.map +1 -0
  77. package/resources/v1/addons/addons.js +78 -0
  78. package/resources/v1/addons/addons.js.map +1 -0
  79. package/resources/v1/addons/addons.mjs +73 -0
  80. package/resources/v1/addons/addons.mjs.map +1 -0
  81. package/resources/v1/addons/entitlements.d.mts +747 -0
  82. package/resources/v1/addons/entitlements.d.mts.map +1 -0
  83. package/resources/v1/addons/entitlements.d.ts +747 -0
  84. package/resources/v1/addons/entitlements.d.ts.map +1 -0
  85. package/resources/v1/addons/entitlements.js +36 -0
  86. package/resources/v1/addons/entitlements.js.map +1 -0
  87. package/resources/v1/addons/entitlements.mjs +32 -0
  88. package/resources/v1/addons/entitlements.mjs.map +1 -0
  89. package/resources/v1/addons/index.d.mts +3 -0
  90. package/resources/v1/addons/index.d.mts.map +1 -0
  91. package/resources/v1/addons/index.d.ts +3 -0
  92. package/resources/v1/addons/index.d.ts.map +1 -0
  93. package/resources/v1/addons/index.js +9 -0
  94. package/resources/v1/addons/index.js.map +1 -0
  95. package/resources/v1/addons/index.mjs +4 -0
  96. package/resources/v1/addons/index.mjs.map +1 -0
  97. package/resources/v1/addons.d.mts +2 -0
  98. package/resources/v1/addons.d.mts.map +1 -0
  99. package/resources/v1/addons.d.ts +2 -0
  100. package/resources/v1/addons.d.ts.map +1 -0
  101. package/resources/v1/addons.js +6 -0
  102. package/resources/v1/addons.js.map +1 -0
  103. package/resources/v1/addons.mjs +3 -0
  104. package/resources/v1/addons.mjs.map +1 -0
  105. package/resources/v1/coupons.d.mts +154 -157
  106. package/resources/v1/coupons.d.mts.map +1 -1
  107. package/resources/v1/coupons.d.ts +154 -157
  108. package/resources/v1/coupons.d.ts.map +1 -1
  109. package/resources/v1/coupons.js +21 -4
  110. package/resources/v1/coupons.js.map +1 -1
  111. package/resources/v1/coupons.mjs +21 -4
  112. package/resources/v1/coupons.mjs.map +1 -1
  113. package/resources/v1/customers/customers.d.mts +247 -118
  114. package/resources/v1/customers/customers.d.mts.map +1 -1
  115. package/resources/v1/customers/customers.d.ts +247 -118
  116. package/resources/v1/customers/customers.d.ts.map +1 -1
  117. package/resources/v1/customers/customers.js +37 -16
  118. package/resources/v1/customers/customers.js.map +1 -1
  119. package/resources/v1/customers/customers.mjs +37 -16
  120. package/resources/v1/customers/customers.mjs.map +1 -1
  121. package/resources/v1/customers/index.d.mts +2 -2
  122. package/resources/v1/customers/index.d.mts.map +1 -1
  123. package/resources/v1/customers/index.d.ts +2 -2
  124. package/resources/v1/customers/index.d.ts.map +1 -1
  125. package/resources/v1/customers/index.js +3 -3
  126. package/resources/v1/customers/index.js.map +1 -1
  127. package/resources/v1/customers/index.mjs +1 -1
  128. package/resources/v1/customers/index.mjs.map +1 -1
  129. package/resources/v1/customers/payment-method.d.mts +7 -2
  130. package/resources/v1/customers/payment-method.d.mts.map +1 -1
  131. package/resources/v1/customers/payment-method.d.ts +7 -2
  132. package/resources/v1/customers/payment-method.d.ts.map +1 -1
  133. package/resources/v1/customers/payment-method.js +4 -2
  134. package/resources/v1/customers/payment-method.js.map +1 -1
  135. package/resources/v1/customers/payment-method.mjs +4 -2
  136. package/resources/v1/customers/payment-method.mjs.map +1 -1
  137. package/resources/v1/customers/promotional-entitlements.d.mts +498 -0
  138. package/resources/v1/customers/promotional-entitlements.d.mts.map +1 -0
  139. package/resources/v1/customers/promotional-entitlements.d.ts +498 -0
  140. package/resources/v1/customers/promotional-entitlements.d.ts.map +1 -0
  141. package/resources/v1/customers/promotional-entitlements.js +32 -0
  142. package/resources/v1/customers/promotional-entitlements.js.map +1 -0
  143. package/resources/v1/customers/promotional-entitlements.mjs +28 -0
  144. package/resources/v1/customers/promotional-entitlements.mjs.map +1 -0
  145. package/resources/v1/events.d.mts +63 -0
  146. package/resources/v1/events.d.mts.map +1 -0
  147. package/resources/v1/events.d.ts +63 -0
  148. package/resources/v1/events.d.ts.map +1 -0
  149. package/resources/v1/events.js +16 -0
  150. package/resources/v1/events.js.map +1 -0
  151. package/resources/v1/events.mjs +12 -0
  152. package/resources/v1/events.mjs.map +1 -0
  153. package/resources/v1/features.d.mts +444 -0
  154. package/resources/v1/features.d.mts.map +1 -0
  155. package/resources/v1/features.d.ts +444 -0
  156. package/resources/v1/features.d.ts.map +1 -0
  157. package/resources/v1/features.js +51 -0
  158. package/resources/v1/features.js.map +1 -0
  159. package/resources/v1/features.mjs +47 -0
  160. package/resources/v1/features.mjs.map +1 -0
  161. package/resources/v1/index.d.mts +10 -4
  162. package/resources/v1/index.d.mts.map +1 -1
  163. package/resources/v1/index.d.ts +10 -4
  164. package/resources/v1/index.d.ts.map +1 -1
  165. package/resources/v1/index.js +17 -5
  166. package/resources/v1/index.js.map +1 -1
  167. package/resources/v1/index.mjs +7 -1
  168. package/resources/v1/index.mjs.map +1 -1
  169. package/resources/v1/plans/entitlements.d.mts +747 -0
  170. package/resources/v1/plans/entitlements.d.mts.map +1 -0
  171. package/resources/v1/plans/entitlements.d.ts +747 -0
  172. package/resources/v1/plans/entitlements.d.ts.map +1 -0
  173. package/resources/v1/plans/entitlements.js +36 -0
  174. package/resources/v1/plans/entitlements.js.map +1 -0
  175. package/resources/v1/plans/entitlements.mjs +32 -0
  176. package/resources/v1/plans/entitlements.mjs.map +1 -0
  177. package/resources/v1/plans/index.d.mts +3 -0
  178. package/resources/v1/plans/index.d.mts.map +1 -0
  179. package/resources/v1/plans/index.d.ts +3 -0
  180. package/resources/v1/plans/index.d.ts.map +1 -0
  181. package/resources/v1/plans/index.js +9 -0
  182. package/resources/v1/plans/index.js.map +1 -0
  183. package/resources/v1/plans/index.mjs +4 -0
  184. package/resources/v1/plans/index.mjs.map +1 -0
  185. package/resources/v1/plans/plans.d.mts +973 -0
  186. package/resources/v1/plans/plans.d.mts.map +1 -0
  187. package/resources/v1/plans/plans.d.ts +973 -0
  188. package/resources/v1/plans/plans.d.ts.map +1 -0
  189. package/resources/v1/plans/plans.js +76 -0
  190. package/resources/v1/plans/plans.js.map +1 -0
  191. package/resources/v1/plans/plans.mjs +71 -0
  192. package/resources/v1/plans/plans.mjs.map +1 -0
  193. package/resources/v1/plans.d.mts +2 -0
  194. package/resources/v1/plans.d.mts.map +1 -0
  195. package/resources/v1/plans.d.ts +2 -0
  196. package/resources/v1/plans.d.ts.map +1 -0
  197. package/resources/v1/plans.js +6 -0
  198. package/resources/v1/plans.js.map +1 -0
  199. package/resources/v1/plans.mjs +3 -0
  200. package/resources/v1/plans.mjs.map +1 -0
  201. package/resources/v1/products.d.mts +332 -0
  202. package/resources/v1/products.d.mts.map +1 -0
  203. package/resources/v1/products.d.ts +332 -0
  204. package/resources/v1/products.d.ts.map +1 -0
  205. package/resources/v1/products.js +52 -0
  206. package/resources/v1/products.js.map +1 -0
  207. package/resources/v1/products.mjs +48 -0
  208. package/resources/v1/products.mjs.map +1 -0
  209. package/resources/v1/subscriptions/future-update.d.mts +12 -19
  210. package/resources/v1/subscriptions/future-update.d.mts.map +1 -1
  211. package/resources/v1/subscriptions/future-update.d.ts +12 -19
  212. package/resources/v1/subscriptions/future-update.d.ts.map +1 -1
  213. package/resources/v1/subscriptions/future-update.js +3 -2
  214. package/resources/v1/subscriptions/future-update.js.map +1 -1
  215. package/resources/v1/subscriptions/future-update.mjs +3 -2
  216. package/resources/v1/subscriptions/future-update.mjs.map +1 -1
  217. package/resources/v1/subscriptions/index.d.mts +4 -2
  218. package/resources/v1/subscriptions/index.d.mts.map +1 -1
  219. package/resources/v1/subscriptions/index.d.ts +4 -2
  220. package/resources/v1/subscriptions/index.d.ts.map +1 -1
  221. package/resources/v1/subscriptions/index.js +5 -1
  222. package/resources/v1/subscriptions/index.js.map +1 -1
  223. package/resources/v1/subscriptions/index.mjs +3 -1
  224. package/resources/v1/subscriptions/index.mjs.map +1 -1
  225. package/resources/v1/subscriptions/invoice.d.mts +34 -0
  226. package/resources/v1/subscriptions/invoice.d.mts.map +1 -0
  227. package/resources/v1/subscriptions/invoice.d.ts +34 -0
  228. package/resources/v1/subscriptions/invoice.d.ts.map +1 -0
  229. package/resources/v1/subscriptions/invoice.js +17 -0
  230. package/resources/v1/subscriptions/invoice.js.map +1 -0
  231. package/resources/v1/subscriptions/invoice.mjs +13 -0
  232. package/resources/v1/subscriptions/invoice.mjs.map +1 -0
  233. package/resources/v1/subscriptions/subscriptions.d.mts +1565 -518
  234. package/resources/v1/subscriptions/subscriptions.d.mts.map +1 -1
  235. package/resources/v1/subscriptions/subscriptions.d.ts +1565 -518
  236. package/resources/v1/subscriptions/subscriptions.d.ts.map +1 -1
  237. package/resources/v1/subscriptions/subscriptions.js +52 -12
  238. package/resources/v1/subscriptions/subscriptions.js.map +1 -1
  239. package/resources/v1/subscriptions/subscriptions.mjs +53 -13
  240. package/resources/v1/subscriptions/subscriptions.mjs.map +1 -1
  241. package/resources/v1/subscriptions/usage.d.mts +98 -0
  242. package/resources/v1/subscriptions/usage.d.mts.map +1 -0
  243. package/resources/v1/subscriptions/usage.d.ts +98 -0
  244. package/resources/v1/subscriptions/usage.d.ts.map +1 -0
  245. package/resources/v1/subscriptions/usage.js +24 -0
  246. package/resources/v1/subscriptions/usage.js.map +1 -0
  247. package/resources/v1/subscriptions/usage.mjs +20 -0
  248. package/resources/v1/subscriptions/usage.mjs.map +1 -0
  249. package/resources/v1/usage.d.mts +230 -0
  250. package/resources/v1/usage.d.mts.map +1 -0
  251. package/resources/v1/usage.d.ts +230 -0
  252. package/resources/v1/usage.d.ts.map +1 -0
  253. package/resources/v1/usage.js +24 -0
  254. package/resources/v1/usage.js.map +1 -0
  255. package/resources/v1/usage.mjs +20 -0
  256. package/resources/v1/usage.mjs.map +1 -0
  257. package/resources/v1/v1.d.mts +30 -149
  258. package/resources/v1/v1.d.mts.map +1 -1
  259. package/resources/v1/v1.d.ts +30 -149
  260. package/resources/v1/v1.d.ts.map +1 -1
  261. package/resources/v1/v1.js +24 -12
  262. package/resources/v1/v1.js.map +1 -1
  263. package/resources/v1/v1.mjs +24 -12
  264. package/resources/v1/v1.mjs.map +1 -1
  265. package/src/client.ts +33 -40
  266. package/src/core/pagination.ts +24 -18
  267. package/src/internal/parse.ts +6 -0
  268. package/src/internal/qs/LICENSE.md +13 -0
  269. package/src/internal/qs/README.md +3 -0
  270. package/src/internal/qs/formats.ts +10 -0
  271. package/src/internal/qs/index.ts +13 -0
  272. package/src/internal/qs/stringify.ts +385 -0
  273. package/src/internal/qs/types.ts +71 -0
  274. package/src/internal/qs/utils.ts +265 -0
  275. package/src/resources/index.ts +1 -7
  276. package/src/resources/v1/addons/addons.ts +3245 -0
  277. package/src/resources/v1/addons/entitlements.ts +976 -0
  278. package/src/resources/v1/addons/index.ts +26 -0
  279. package/src/resources/v1/addons.ts +3 -0
  280. package/src/resources/v1/coupons.ts +311 -436
  281. package/src/resources/v1/customers/customers.ts +334 -153
  282. package/src/resources/v1/customers/index.ts +17 -2
  283. package/src/resources/v1/customers/payment-method.ts +7 -2
  284. package/src/resources/v1/customers/promotional-entitlements.ts +669 -0
  285. package/src/resources/v1/events.ts +74 -0
  286. package/src/resources/v1/features.ts +571 -0
  287. package/src/resources/v1/index.ts +73 -15
  288. package/src/resources/v1/plans/entitlements.ts +968 -0
  289. package/src/resources/v1/plans/index.ts +24 -0
  290. package/src/resources/v1/plans/plans.ts +2032 -0
  291. package/src/resources/v1/plans.ts +3 -0
  292. package/src/resources/v1/products.ts +423 -0
  293. package/src/resources/v1/subscriptions/future-update.ts +12 -27
  294. package/src/resources/v1/subscriptions/index.ts +16 -11
  295. package/src/resources/v1/subscriptions/invoice.ts +42 -0
  296. package/src/resources/v1/subscriptions/subscriptions.ts +3341 -832
  297. package/src/resources/v1/subscriptions/usage.ts +126 -0
  298. package/src/resources/v1/usage.ts +284 -0
  299. package/src/resources/v1/v1.ts +174 -197
  300. package/src/version.ts +1 -1
  301. package/version.d.mts +1 -1
  302. package/version.d.mts.map +1 -1
  303. package/version.d.ts +1 -1
  304. package/version.d.ts.map +1 -1
  305. package/version.js +1 -1
  306. package/version.js.map +1 -1
  307. package/version.mjs +1 -1
  308. package/version.mjs.map +1 -1
  309. package/resources/v1/customers/usage.d.mts +0 -98
  310. package/resources/v1/customers/usage.d.mts.map +0 -1
  311. package/resources/v1/customers/usage.d.ts +0 -98
  312. package/resources/v1/customers/usage.d.ts.map +0 -1
  313. package/resources/v1/customers/usage.js +0 -20
  314. package/resources/v1/customers/usage.js.map +0 -1
  315. package/resources/v1/customers/usage.mjs +0 -16
  316. package/resources/v1/customers/usage.mjs.map +0 -1
  317. package/src/resources/v1/customers/usage.ts +0 -132
@@ -0,0 +1,968 @@
1
+ // File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
2
+
3
+ import { APIResource } from '../../../core/resource';
4
+ import { APIPromise } from '../../../core/api-promise';
5
+ import { RequestOptions } from '../../../internal/request-options';
6
+ import { path } from '../../../internal/utils/path';
7
+
8
+ export class Entitlements extends APIResource {
9
+ /**
10
+ * Creates one or more entitlements (feature or credit) on a draft plan.
11
+ */
12
+ create(
13
+ planID: string,
14
+ body: EntitlementCreateParams,
15
+ options?: RequestOptions,
16
+ ): APIPromise<EntitlementCreateResponse> {
17
+ return this._client.post(path`/api/v1/plans/${planID}/entitlements`, { body, ...options });
18
+ }
19
+
20
+ /**
21
+ * Updates an existing entitlement on a draft plan.
22
+ */
23
+ update(id: string, params: EntitlementUpdateParams, options?: RequestOptions): APIPromise<PlanEntitlement> {
24
+ const { planId, ...body } = params;
25
+ return this._client.patch(path`/api/v1/plans/${planId}/entitlements/${id}`, { body, ...options });
26
+ }
27
+
28
+ /**
29
+ * Retrieves a list of entitlements for a plan.
30
+ */
31
+ list(planID: string, options?: RequestOptions): APIPromise<EntitlementListResponse> {
32
+ return this._client.get(path`/api/v1/plans/${planID}/entitlements`, options);
33
+ }
34
+
35
+ /**
36
+ * Deletes an entitlement from a draft plan.
37
+ */
38
+ delete(id: string, params: EntitlementDeleteParams, options?: RequestOptions): APIPromise<PlanEntitlement> {
39
+ const { planId } = params;
40
+ return this._client.delete(path`/api/v1/plans/${planId}/entitlements/${id}`, options);
41
+ }
42
+ }
43
+
44
+ /**
45
+ * Response object
46
+ */
47
+ export interface PlanEntitlement {
48
+ /**
49
+ * Feature or credit entitlement on a plan
50
+ */
51
+ data: PlanEntitlement.Data;
52
+ }
53
+
54
+ export namespace PlanEntitlement {
55
+ /**
56
+ * Feature or credit entitlement on a plan
57
+ */
58
+ export interface Data {
59
+ /**
60
+ * Unique identifier of the entitlement
61
+ */
62
+ id: string;
63
+
64
+ /**
65
+ * Credit amount (for credit entitlements)
66
+ */
67
+ amount: number | null;
68
+
69
+ /**
70
+ * Entitlement behavior (Increment or Override)
71
+ */
72
+ behavior: 'Increment' | 'Override';
73
+
74
+ /**
75
+ * Credit grant cadence (for credit entitlements)
76
+ */
77
+ cadence: 'MONTH' | 'YEAR' | null;
78
+
79
+ /**
80
+ * Timestamp of when the record was created
81
+ */
82
+ createdAt: string;
83
+
84
+ /**
85
+ * Custom currency ID (for credit entitlements)
86
+ */
87
+ customCurrencyId: string | null;
88
+
89
+ /**
90
+ * Optional description of the entitlement
91
+ */
92
+ description: string | null;
93
+
94
+ /**
95
+ * Override display name for the entitlement
96
+ */
97
+ displayNameOverride: string | null;
98
+
99
+ /**
100
+ * Allowed enum values (for feature entitlements)
101
+ */
102
+ enumValues: Array<string> | null;
103
+
104
+ /**
105
+ * Feature ID (for feature entitlements)
106
+ */
107
+ featureId: string | null;
108
+
109
+ /**
110
+ * Whether the usage limit is a soft limit (for feature entitlements)
111
+ */
112
+ hasSoftLimit: boolean | null;
113
+
114
+ /**
115
+ * Whether usage is unlimited (for feature entitlements)
116
+ */
117
+ hasUnlimitedUsage: boolean | null;
118
+
119
+ /**
120
+ * Widget types where this entitlement is hidden
121
+ */
122
+ hiddenFromWidgets: Array<'PAYWALL' | 'CUSTOMER_PORTAL' | 'CHECKOUT'>;
123
+
124
+ /**
125
+ * Whether this is a custom entitlement
126
+ */
127
+ isCustom: boolean | null;
128
+
129
+ /**
130
+ * Whether the entitlement is granted
131
+ */
132
+ isGranted: boolean;
133
+
134
+ /**
135
+ * Display order of the entitlement
136
+ */
137
+ order: number | null;
138
+
139
+ /**
140
+ * Usage reset period (for feature entitlements)
141
+ */
142
+ resetPeriod: 'YEAR' | 'MONTH' | 'WEEK' | 'DAY' | 'HOUR' | null;
143
+
144
+ /**
145
+ * Reset period configuration (for feature entitlements)
146
+ */
147
+ resetPeriodConfiguration:
148
+ | Data.YearlyResetPeriodConfig
149
+ | Data.MonthlyResetPeriodConfig
150
+ | Data.WeeklyResetPeriodConfig
151
+ | null;
152
+
153
+ /**
154
+ * Entitlement type (FEATURE or CREDIT)
155
+ */
156
+ type: 'FEATURE' | 'CREDIT';
157
+
158
+ /**
159
+ * Timestamp of when the record was last updated
160
+ */
161
+ updatedAt: string;
162
+
163
+ /**
164
+ * Usage limit (for feature entitlements)
165
+ */
166
+ usageLimit: number | null;
167
+ }
168
+
169
+ export namespace Data {
170
+ /**
171
+ * Yearly reset configuration
172
+ */
173
+ export interface YearlyResetPeriodConfig {
174
+ /**
175
+ * Reset anchor (SubscriptionStart)
176
+ */
177
+ accordingTo: 'SubscriptionStart';
178
+ }
179
+
180
+ /**
181
+ * Monthly reset configuration
182
+ */
183
+ export interface MonthlyResetPeriodConfig {
184
+ /**
185
+ * Reset anchor (SubscriptionStart or StartOfTheMonth)
186
+ */
187
+ accordingTo: 'SubscriptionStart' | 'StartOfTheMonth';
188
+ }
189
+
190
+ /**
191
+ * Weekly reset configuration
192
+ */
193
+ export interface WeeklyResetPeriodConfig {
194
+ /**
195
+ * Reset anchor (SubscriptionStart or specific day)
196
+ */
197
+ accordingTo:
198
+ | 'SubscriptionStart'
199
+ | 'EverySunday'
200
+ | 'EveryMonday'
201
+ | 'EveryTuesday'
202
+ | 'EveryWednesday'
203
+ | 'EveryThursday'
204
+ | 'EveryFriday'
205
+ | 'EverySaturday';
206
+ }
207
+ }
208
+ }
209
+
210
+ /**
211
+ * Response object
212
+ */
213
+ export interface EntitlementCreateResponse {
214
+ data: Array<EntitlementCreateResponse.Data>;
215
+ }
216
+
217
+ export namespace EntitlementCreateResponse {
218
+ /**
219
+ * Feature or credit entitlement on a plan
220
+ */
221
+ export interface Data {
222
+ /**
223
+ * Unique identifier of the entitlement
224
+ */
225
+ id: string;
226
+
227
+ /**
228
+ * Credit amount (for credit entitlements)
229
+ */
230
+ amount: number | null;
231
+
232
+ /**
233
+ * Entitlement behavior (Increment or Override)
234
+ */
235
+ behavior: 'Increment' | 'Override';
236
+
237
+ /**
238
+ * Credit grant cadence (for credit entitlements)
239
+ */
240
+ cadence: 'MONTH' | 'YEAR' | null;
241
+
242
+ /**
243
+ * Timestamp of when the record was created
244
+ */
245
+ createdAt: string;
246
+
247
+ /**
248
+ * Custom currency ID (for credit entitlements)
249
+ */
250
+ customCurrencyId: string | null;
251
+
252
+ /**
253
+ * Optional description of the entitlement
254
+ */
255
+ description: string | null;
256
+
257
+ /**
258
+ * Override display name for the entitlement
259
+ */
260
+ displayNameOverride: string | null;
261
+
262
+ /**
263
+ * Allowed enum values (for feature entitlements)
264
+ */
265
+ enumValues: Array<string> | null;
266
+
267
+ /**
268
+ * Feature ID (for feature entitlements)
269
+ */
270
+ featureId: string | null;
271
+
272
+ /**
273
+ * Whether the usage limit is a soft limit (for feature entitlements)
274
+ */
275
+ hasSoftLimit: boolean | null;
276
+
277
+ /**
278
+ * Whether usage is unlimited (for feature entitlements)
279
+ */
280
+ hasUnlimitedUsage: boolean | null;
281
+
282
+ /**
283
+ * Widget types where this entitlement is hidden
284
+ */
285
+ hiddenFromWidgets: Array<'PAYWALL' | 'CUSTOMER_PORTAL' | 'CHECKOUT'>;
286
+
287
+ /**
288
+ * Whether this is a custom entitlement
289
+ */
290
+ isCustom: boolean | null;
291
+
292
+ /**
293
+ * Whether the entitlement is granted
294
+ */
295
+ isGranted: boolean;
296
+
297
+ /**
298
+ * Display order of the entitlement
299
+ */
300
+ order: number | null;
301
+
302
+ /**
303
+ * Usage reset period (for feature entitlements)
304
+ */
305
+ resetPeriod: 'YEAR' | 'MONTH' | 'WEEK' | 'DAY' | 'HOUR' | null;
306
+
307
+ /**
308
+ * Reset period configuration (for feature entitlements)
309
+ */
310
+ resetPeriodConfiguration:
311
+ | Data.YearlyResetPeriodConfig
312
+ | Data.MonthlyResetPeriodConfig
313
+ | Data.WeeklyResetPeriodConfig
314
+ | null;
315
+
316
+ /**
317
+ * Entitlement type (FEATURE or CREDIT)
318
+ */
319
+ type: 'FEATURE' | 'CREDIT';
320
+
321
+ /**
322
+ * Timestamp of when the record was last updated
323
+ */
324
+ updatedAt: string;
325
+
326
+ /**
327
+ * Usage limit (for feature entitlements)
328
+ */
329
+ usageLimit: number | null;
330
+ }
331
+
332
+ export namespace Data {
333
+ /**
334
+ * Yearly reset configuration
335
+ */
336
+ export interface YearlyResetPeriodConfig {
337
+ /**
338
+ * Reset anchor (SubscriptionStart)
339
+ */
340
+ accordingTo: 'SubscriptionStart';
341
+ }
342
+
343
+ /**
344
+ * Monthly reset configuration
345
+ */
346
+ export interface MonthlyResetPeriodConfig {
347
+ /**
348
+ * Reset anchor (SubscriptionStart or StartOfTheMonth)
349
+ */
350
+ accordingTo: 'SubscriptionStart' | 'StartOfTheMonth';
351
+ }
352
+
353
+ /**
354
+ * Weekly reset configuration
355
+ */
356
+ export interface WeeklyResetPeriodConfig {
357
+ /**
358
+ * Reset anchor (SubscriptionStart or specific day)
359
+ */
360
+ accordingTo:
361
+ | 'SubscriptionStart'
362
+ | 'EverySunday'
363
+ | 'EveryMonday'
364
+ | 'EveryTuesday'
365
+ | 'EveryWednesday'
366
+ | 'EveryThursday'
367
+ | 'EveryFriday'
368
+ | 'EverySaturday';
369
+ }
370
+ }
371
+ }
372
+
373
+ /**
374
+ * Response list object
375
+ */
376
+ export interface EntitlementListResponse {
377
+ data: Array<EntitlementListResponse.Data>;
378
+
379
+ /**
380
+ * Pagination metadata including cursors for navigating through results
381
+ */
382
+ pagination: EntitlementListResponse.Pagination;
383
+ }
384
+
385
+ export namespace EntitlementListResponse {
386
+ /**
387
+ * Feature or credit entitlement on a plan
388
+ */
389
+ export interface Data {
390
+ /**
391
+ * Unique identifier of the entitlement
392
+ */
393
+ id: string;
394
+
395
+ /**
396
+ * Credit amount (for credit entitlements)
397
+ */
398
+ amount: number | null;
399
+
400
+ /**
401
+ * Entitlement behavior (Increment or Override)
402
+ */
403
+ behavior: 'Increment' | 'Override';
404
+
405
+ /**
406
+ * Credit grant cadence (for credit entitlements)
407
+ */
408
+ cadence: 'MONTH' | 'YEAR' | null;
409
+
410
+ /**
411
+ * Timestamp of when the record was created
412
+ */
413
+ createdAt: string;
414
+
415
+ /**
416
+ * Custom currency ID (for credit entitlements)
417
+ */
418
+ customCurrencyId: string | null;
419
+
420
+ /**
421
+ * Optional description of the entitlement
422
+ */
423
+ description: string | null;
424
+
425
+ /**
426
+ * Override display name for the entitlement
427
+ */
428
+ displayNameOverride: string | null;
429
+
430
+ /**
431
+ * Allowed enum values (for feature entitlements)
432
+ */
433
+ enumValues: Array<string> | null;
434
+
435
+ /**
436
+ * Feature ID (for feature entitlements)
437
+ */
438
+ featureId: string | null;
439
+
440
+ /**
441
+ * Whether the usage limit is a soft limit (for feature entitlements)
442
+ */
443
+ hasSoftLimit: boolean | null;
444
+
445
+ /**
446
+ * Whether usage is unlimited (for feature entitlements)
447
+ */
448
+ hasUnlimitedUsage: boolean | null;
449
+
450
+ /**
451
+ * Widget types where this entitlement is hidden
452
+ */
453
+ hiddenFromWidgets: Array<'PAYWALL' | 'CUSTOMER_PORTAL' | 'CHECKOUT'>;
454
+
455
+ /**
456
+ * Whether this is a custom entitlement
457
+ */
458
+ isCustom: boolean | null;
459
+
460
+ /**
461
+ * Whether the entitlement is granted
462
+ */
463
+ isGranted: boolean;
464
+
465
+ /**
466
+ * Display order of the entitlement
467
+ */
468
+ order: number | null;
469
+
470
+ /**
471
+ * Usage reset period (for feature entitlements)
472
+ */
473
+ resetPeriod: 'YEAR' | 'MONTH' | 'WEEK' | 'DAY' | 'HOUR' | null;
474
+
475
+ /**
476
+ * Reset period configuration (for feature entitlements)
477
+ */
478
+ resetPeriodConfiguration:
479
+ | Data.YearlyResetPeriodConfig
480
+ | Data.MonthlyResetPeriodConfig
481
+ | Data.WeeklyResetPeriodConfig
482
+ | null;
483
+
484
+ /**
485
+ * Entitlement type (FEATURE or CREDIT)
486
+ */
487
+ type: 'FEATURE' | 'CREDIT';
488
+
489
+ /**
490
+ * Timestamp of when the record was last updated
491
+ */
492
+ updatedAt: string;
493
+
494
+ /**
495
+ * Usage limit (for feature entitlements)
496
+ */
497
+ usageLimit: number | null;
498
+ }
499
+
500
+ export namespace Data {
501
+ /**
502
+ * Yearly reset configuration
503
+ */
504
+ export interface YearlyResetPeriodConfig {
505
+ /**
506
+ * Reset anchor (SubscriptionStart)
507
+ */
508
+ accordingTo: 'SubscriptionStart';
509
+ }
510
+
511
+ /**
512
+ * Monthly reset configuration
513
+ */
514
+ export interface MonthlyResetPeriodConfig {
515
+ /**
516
+ * Reset anchor (SubscriptionStart or StartOfTheMonth)
517
+ */
518
+ accordingTo: 'SubscriptionStart' | 'StartOfTheMonth';
519
+ }
520
+
521
+ /**
522
+ * Weekly reset configuration
523
+ */
524
+ export interface WeeklyResetPeriodConfig {
525
+ /**
526
+ * Reset anchor (SubscriptionStart or specific day)
527
+ */
528
+ accordingTo:
529
+ | 'SubscriptionStart'
530
+ | 'EverySunday'
531
+ | 'EveryMonday'
532
+ | 'EveryTuesday'
533
+ | 'EveryWednesday'
534
+ | 'EveryThursday'
535
+ | 'EveryFriday'
536
+ | 'EverySaturday';
537
+ }
538
+ }
539
+
540
+ /**
541
+ * Pagination metadata including cursors for navigating through results
542
+ */
543
+ export interface Pagination {
544
+ /**
545
+ * Cursor for fetching the next page of results, or null if no additional pages
546
+ * exist
547
+ */
548
+ next: string | null;
549
+
550
+ /**
551
+ * Cursor for fetching the previous page of results, or null if at the beginning
552
+ */
553
+ prev: string | null;
554
+ }
555
+ }
556
+
557
+ export interface EntitlementCreateParams {
558
+ /**
559
+ * Entitlements to create
560
+ */
561
+ entitlements: Array<EntitlementCreateParams.Entitlement>;
562
+ }
563
+
564
+ export namespace EntitlementCreateParams {
565
+ /**
566
+ * A single entitlement to create. Provide exactly one of feature or credit.
567
+ */
568
+ export interface Entitlement {
569
+ /**
570
+ * Credit entitlement to create
571
+ */
572
+ credit?: Entitlement.Credit;
573
+
574
+ /**
575
+ * Feature entitlement to create
576
+ */
577
+ feature?: Entitlement.Feature;
578
+ }
579
+
580
+ export namespace Entitlement {
581
+ /**
582
+ * Credit entitlement to create
583
+ */
584
+ export interface Credit {
585
+ /**
586
+ * Credit grant amount
587
+ */
588
+ amount: number | null;
589
+
590
+ /**
591
+ * Credit grant cadence (MONTH or YEAR)
592
+ */
593
+ cadence: 'MONTH' | 'YEAR';
594
+
595
+ /**
596
+ * The custom currency ID for the credit entitlement
597
+ */
598
+ customCurrencyId: string;
599
+
600
+ /**
601
+ * Entitlement behavior (Increment or Override)
602
+ */
603
+ behavior?: 'Increment' | 'Override';
604
+
605
+ /**
606
+ * Description of the entitlement
607
+ */
608
+ description?: string;
609
+
610
+ /**
611
+ * Override display name for the entitlement
612
+ */
613
+ displayNameOverride?: string;
614
+
615
+ /**
616
+ * Widget types where this entitlement is hidden
617
+ */
618
+ hiddenFromWidgets?: Array<'PAYWALL' | 'CUSTOMER_PORTAL' | 'CHECKOUT'>;
619
+
620
+ /**
621
+ * Whether this is a custom entitlement
622
+ */
623
+ isCustom?: boolean;
624
+
625
+ /**
626
+ * Whether the entitlement is granted
627
+ */
628
+ isGranted?: boolean;
629
+
630
+ /**
631
+ * Display order of the entitlement
632
+ */
633
+ order?: number;
634
+ }
635
+
636
+ /**
637
+ * Feature entitlement to create
638
+ */
639
+ export interface Feature {
640
+ /**
641
+ * The feature ID to attach the entitlement to
642
+ */
643
+ featureId: string;
644
+
645
+ /**
646
+ * Entitlement behavior (Increment or Override)
647
+ */
648
+ behavior?: 'Increment' | 'Override';
649
+
650
+ /**
651
+ * Description of the entitlement
652
+ */
653
+ description?: string;
654
+
655
+ /**
656
+ * Override display name for the entitlement
657
+ */
658
+ displayNameOverride?: string;
659
+
660
+ /**
661
+ * Allowed enum values for the feature entitlement
662
+ */
663
+ enumValues?: Array<string>;
664
+
665
+ /**
666
+ * Whether the usage limit is a soft limit
667
+ */
668
+ hasSoftLimit?: boolean;
669
+
670
+ /**
671
+ * Whether usage is unlimited
672
+ */
673
+ hasUnlimitedUsage?: boolean;
674
+
675
+ /**
676
+ * Widget types where this entitlement is hidden
677
+ */
678
+ hiddenFromWidgets?: Array<'PAYWALL' | 'CUSTOMER_PORTAL' | 'CHECKOUT'>;
679
+
680
+ /**
681
+ * Whether this is a custom entitlement
682
+ */
683
+ isCustom?: boolean;
684
+
685
+ /**
686
+ * Whether the entitlement is granted
687
+ */
688
+ isGranted?: boolean;
689
+
690
+ /**
691
+ * Configuration for monthly reset period
692
+ */
693
+ monthlyResetPeriodConfiguration?: Feature.MonthlyResetPeriodConfiguration | null;
694
+
695
+ /**
696
+ * Display order of the entitlement
697
+ */
698
+ order?: number;
699
+
700
+ /**
701
+ * Period at which usage resets
702
+ */
703
+ resetPeriod?: 'YEAR' | 'MONTH' | 'WEEK' | 'DAY' | 'HOUR';
704
+
705
+ /**
706
+ * Maximum allowed usage for the feature
707
+ */
708
+ usageLimit?: number | null;
709
+
710
+ /**
711
+ * Configuration for weekly reset period
712
+ */
713
+ weeklyResetPeriodConfiguration?: Feature.WeeklyResetPeriodConfiguration | null;
714
+
715
+ /**
716
+ * Configuration for yearly reset period
717
+ */
718
+ yearlyResetPeriodConfiguration?: Feature.YearlyResetPeriodConfiguration | null;
719
+ }
720
+
721
+ export namespace Feature {
722
+ /**
723
+ * Configuration for monthly reset period
724
+ */
725
+ export interface MonthlyResetPeriodConfiguration {
726
+ /**
727
+ * Reset anchor (SubscriptionStart or StartOfTheMonth)
728
+ */
729
+ accordingTo: 'SubscriptionStart' | 'StartOfTheMonth';
730
+ }
731
+
732
+ /**
733
+ * Configuration for weekly reset period
734
+ */
735
+ export interface WeeklyResetPeriodConfiguration {
736
+ /**
737
+ * Reset anchor (SubscriptionStart or specific day)
738
+ */
739
+ accordingTo:
740
+ | 'SubscriptionStart'
741
+ | 'EverySunday'
742
+ | 'EveryMonday'
743
+ | 'EveryTuesday'
744
+ | 'EveryWednesday'
745
+ | 'EveryThursday'
746
+ | 'EveryFriday'
747
+ | 'EverySaturday';
748
+ }
749
+
750
+ /**
751
+ * Configuration for yearly reset period
752
+ */
753
+ export interface YearlyResetPeriodConfiguration {
754
+ /**
755
+ * Reset anchor (SubscriptionStart)
756
+ */
757
+ accordingTo: 'SubscriptionStart';
758
+ }
759
+ }
760
+ }
761
+ }
762
+
763
+ export interface EntitlementUpdateParams {
764
+ /**
765
+ * Path param: The plan ID
766
+ */
767
+ planId: string;
768
+
769
+ /**
770
+ * Body param: Credit entitlement fields to update
771
+ */
772
+ credit?: EntitlementUpdateParams.Credit;
773
+
774
+ /**
775
+ * Body param: Feature entitlement fields to update
776
+ */
777
+ feature?: EntitlementUpdateParams.Feature;
778
+ }
779
+
780
+ export namespace EntitlementUpdateParams {
781
+ /**
782
+ * Credit entitlement fields to update
783
+ */
784
+ export interface Credit {
785
+ /**
786
+ * Credit grant amount
787
+ */
788
+ amount?: number;
789
+
790
+ /**
791
+ * Entitlement behavior (Increment or Override)
792
+ */
793
+ behavior?: 'Increment' | 'Override';
794
+
795
+ /**
796
+ * Credit grant cadence (MONTH or YEAR)
797
+ */
798
+ cadence?: 'MONTH' | 'YEAR';
799
+
800
+ /**
801
+ * Description of the entitlement
802
+ */
803
+ description?: string;
804
+
805
+ /**
806
+ * Override display name for the entitlement
807
+ */
808
+ displayNameOverride?: string;
809
+
810
+ /**
811
+ * Widget types where this entitlement is hidden
812
+ */
813
+ hiddenFromWidgets?: Array<'PAYWALL' | 'CUSTOMER_PORTAL' | 'CHECKOUT'>;
814
+
815
+ /**
816
+ * Whether this is a custom entitlement
817
+ */
818
+ isCustom?: boolean;
819
+
820
+ /**
821
+ * Whether the entitlement is granted
822
+ */
823
+ isGranted?: boolean;
824
+
825
+ /**
826
+ * Display order of the entitlement
827
+ */
828
+ order?: number;
829
+ }
830
+
831
+ /**
832
+ * Feature entitlement fields to update
833
+ */
834
+ export interface Feature {
835
+ /**
836
+ * Entitlement behavior (Increment or Override)
837
+ */
838
+ behavior?: 'Increment' | 'Override';
839
+
840
+ /**
841
+ * Description of the entitlement
842
+ */
843
+ description?: string;
844
+
845
+ /**
846
+ * Override display name for the entitlement
847
+ */
848
+ displayNameOverride?: string;
849
+
850
+ /**
851
+ * Allowed enum values for the feature entitlement
852
+ */
853
+ enumValues?: Array<string>;
854
+
855
+ /**
856
+ * Whether the usage limit is a soft limit
857
+ */
858
+ hasSoftLimit?: boolean;
859
+
860
+ /**
861
+ * Whether usage is unlimited
862
+ */
863
+ hasUnlimitedUsage?: boolean;
864
+
865
+ /**
866
+ * Widget types where this entitlement is hidden
867
+ */
868
+ hiddenFromWidgets?: Array<'PAYWALL' | 'CUSTOMER_PORTAL' | 'CHECKOUT'>;
869
+
870
+ /**
871
+ * Whether this is a custom entitlement
872
+ */
873
+ isCustom?: boolean;
874
+
875
+ /**
876
+ * Whether the entitlement is granted
877
+ */
878
+ isGranted?: boolean;
879
+
880
+ /**
881
+ * Configuration for monthly reset period
882
+ */
883
+ monthlyResetPeriodConfiguration?: Feature.MonthlyResetPeriodConfiguration | null;
884
+
885
+ /**
886
+ * Display order of the entitlement
887
+ */
888
+ order?: number;
889
+
890
+ /**
891
+ * Period at which usage resets
892
+ */
893
+ resetPeriod?: 'YEAR' | 'MONTH' | 'WEEK' | 'DAY' | 'HOUR';
894
+
895
+ /**
896
+ * Maximum allowed usage for the feature
897
+ */
898
+ usageLimit?: number | null;
899
+
900
+ /**
901
+ * Configuration for weekly reset period
902
+ */
903
+ weeklyResetPeriodConfiguration?: Feature.WeeklyResetPeriodConfiguration | null;
904
+
905
+ /**
906
+ * Configuration for yearly reset period
907
+ */
908
+ yearlyResetPeriodConfiguration?: Feature.YearlyResetPeriodConfiguration | null;
909
+ }
910
+
911
+ export namespace Feature {
912
+ /**
913
+ * Configuration for monthly reset period
914
+ */
915
+ export interface MonthlyResetPeriodConfiguration {
916
+ /**
917
+ * Reset anchor (SubscriptionStart or StartOfTheMonth)
918
+ */
919
+ accordingTo: 'SubscriptionStart' | 'StartOfTheMonth';
920
+ }
921
+
922
+ /**
923
+ * Configuration for weekly reset period
924
+ */
925
+ export interface WeeklyResetPeriodConfiguration {
926
+ /**
927
+ * Reset anchor (SubscriptionStart or specific day)
928
+ */
929
+ accordingTo:
930
+ | 'SubscriptionStart'
931
+ | 'EverySunday'
932
+ | 'EveryMonday'
933
+ | 'EveryTuesday'
934
+ | 'EveryWednesday'
935
+ | 'EveryThursday'
936
+ | 'EveryFriday'
937
+ | 'EverySaturday';
938
+ }
939
+
940
+ /**
941
+ * Configuration for yearly reset period
942
+ */
943
+ export interface YearlyResetPeriodConfiguration {
944
+ /**
945
+ * Reset anchor (SubscriptionStart)
946
+ */
947
+ accordingTo: 'SubscriptionStart';
948
+ }
949
+ }
950
+ }
951
+
952
+ export interface EntitlementDeleteParams {
953
+ /**
954
+ * The plan ID
955
+ */
956
+ planId: string;
957
+ }
958
+
959
+ export declare namespace Entitlements {
960
+ export {
961
+ type PlanEntitlement as PlanEntitlement,
962
+ type EntitlementCreateResponse as EntitlementCreateResponse,
963
+ type EntitlementListResponse as EntitlementListResponse,
964
+ type EntitlementCreateParams as EntitlementCreateParams,
965
+ type EntitlementUpdateParams as EntitlementUpdateParams,
966
+ type EntitlementDeleteParams as EntitlementDeleteParams,
967
+ };
968
+ }