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