@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,747 @@
1
+ import { APIResource } from "../../../core/resource.mjs";
2
+ import { APIPromise } from "../../../core/api-promise.mjs";
3
+ import { RequestOptions } from "../../../internal/request-options.mjs";
4
+ export declare class Entitlements extends APIResource {
5
+ /**
6
+ * Creates one or more entitlements (feature or credit) on a draft plan.
7
+ */
8
+ create(planID: string, body: EntitlementCreateParams, options?: RequestOptions): APIPromise<EntitlementCreateResponse>;
9
+ /**
10
+ * Updates an existing entitlement on a draft plan.
11
+ */
12
+ update(id: string, params: EntitlementUpdateParams, options?: RequestOptions): APIPromise<PlanEntitlement>;
13
+ /**
14
+ * Retrieves a list of entitlements for a plan.
15
+ */
16
+ list(planID: string, options?: RequestOptions): APIPromise<EntitlementListResponse>;
17
+ /**
18
+ * Deletes an entitlement from a draft plan.
19
+ */
20
+ delete(id: string, params: EntitlementDeleteParams, options?: RequestOptions): APIPromise<PlanEntitlement>;
21
+ }
22
+ /**
23
+ * Response object
24
+ */
25
+ export interface PlanEntitlement {
26
+ /**
27
+ * Feature or credit entitlement on a plan
28
+ */
29
+ data: PlanEntitlement.Data;
30
+ }
31
+ export declare namespace PlanEntitlement {
32
+ /**
33
+ * Feature or credit entitlement on a plan
34
+ */
35
+ interface Data {
36
+ /**
37
+ * Unique identifier of the entitlement
38
+ */
39
+ id: string;
40
+ /**
41
+ * Credit amount (for credit entitlements)
42
+ */
43
+ amount: number | null;
44
+ /**
45
+ * Entitlement behavior (Increment or Override)
46
+ */
47
+ behavior: 'Increment' | 'Override';
48
+ /**
49
+ * Credit grant cadence (for credit entitlements)
50
+ */
51
+ cadence: 'MONTH' | 'YEAR' | null;
52
+ /**
53
+ * Timestamp of when the record was created
54
+ */
55
+ createdAt: string;
56
+ /**
57
+ * Custom currency ID (for credit entitlements)
58
+ */
59
+ customCurrencyId: string | null;
60
+ /**
61
+ * Optional description of the entitlement
62
+ */
63
+ description: string | null;
64
+ /**
65
+ * Override display name for the entitlement
66
+ */
67
+ displayNameOverride: string | null;
68
+ /**
69
+ * Allowed enum values (for feature entitlements)
70
+ */
71
+ enumValues: Array<string> | null;
72
+ /**
73
+ * Feature ID (for feature entitlements)
74
+ */
75
+ featureId: string | null;
76
+ /**
77
+ * Whether the usage limit is a soft limit (for feature entitlements)
78
+ */
79
+ hasSoftLimit: boolean | null;
80
+ /**
81
+ * Whether usage is unlimited (for feature entitlements)
82
+ */
83
+ hasUnlimitedUsage: boolean | null;
84
+ /**
85
+ * Widget types where this entitlement is hidden
86
+ */
87
+ hiddenFromWidgets: Array<'PAYWALL' | 'CUSTOMER_PORTAL' | 'CHECKOUT'>;
88
+ /**
89
+ * Whether this is a custom entitlement
90
+ */
91
+ isCustom: boolean | null;
92
+ /**
93
+ * Whether the entitlement is granted
94
+ */
95
+ isGranted: boolean;
96
+ /**
97
+ * Display order of the entitlement
98
+ */
99
+ order: number | null;
100
+ /**
101
+ * Usage reset period (for feature entitlements)
102
+ */
103
+ resetPeriod: 'YEAR' | 'MONTH' | 'WEEK' | 'DAY' | 'HOUR' | null;
104
+ /**
105
+ * Reset period configuration (for feature entitlements)
106
+ */
107
+ resetPeriodConfiguration: Data.YearlyResetPeriodConfig | Data.MonthlyResetPeriodConfig | Data.WeeklyResetPeriodConfig | null;
108
+ /**
109
+ * Entitlement type (FEATURE or CREDIT)
110
+ */
111
+ type: 'FEATURE' | 'CREDIT';
112
+ /**
113
+ * Timestamp of when the record was last updated
114
+ */
115
+ updatedAt: string;
116
+ /**
117
+ * Usage limit (for feature entitlements)
118
+ */
119
+ usageLimit: number | null;
120
+ }
121
+ namespace Data {
122
+ /**
123
+ * Yearly reset configuration
124
+ */
125
+ interface YearlyResetPeriodConfig {
126
+ /**
127
+ * Reset anchor (SubscriptionStart)
128
+ */
129
+ accordingTo: 'SubscriptionStart';
130
+ }
131
+ /**
132
+ * Monthly reset configuration
133
+ */
134
+ interface MonthlyResetPeriodConfig {
135
+ /**
136
+ * Reset anchor (SubscriptionStart or StartOfTheMonth)
137
+ */
138
+ accordingTo: 'SubscriptionStart' | 'StartOfTheMonth';
139
+ }
140
+ /**
141
+ * Weekly reset configuration
142
+ */
143
+ interface WeeklyResetPeriodConfig {
144
+ /**
145
+ * Reset anchor (SubscriptionStart or specific day)
146
+ */
147
+ accordingTo: 'SubscriptionStart' | 'EverySunday' | 'EveryMonday' | 'EveryTuesday' | 'EveryWednesday' | 'EveryThursday' | 'EveryFriday' | 'EverySaturday';
148
+ }
149
+ }
150
+ }
151
+ /**
152
+ * Response object
153
+ */
154
+ export interface EntitlementCreateResponse {
155
+ data: Array<EntitlementCreateResponse.Data>;
156
+ }
157
+ export declare namespace EntitlementCreateResponse {
158
+ /**
159
+ * Feature or credit entitlement on a plan
160
+ */
161
+ interface Data {
162
+ /**
163
+ * Unique identifier of the entitlement
164
+ */
165
+ id: string;
166
+ /**
167
+ * Credit amount (for credit entitlements)
168
+ */
169
+ amount: number | null;
170
+ /**
171
+ * Entitlement behavior (Increment or Override)
172
+ */
173
+ behavior: 'Increment' | 'Override';
174
+ /**
175
+ * Credit grant cadence (for credit entitlements)
176
+ */
177
+ cadence: 'MONTH' | 'YEAR' | null;
178
+ /**
179
+ * Timestamp of when the record was created
180
+ */
181
+ createdAt: string;
182
+ /**
183
+ * Custom currency ID (for credit entitlements)
184
+ */
185
+ customCurrencyId: string | null;
186
+ /**
187
+ * Optional description of the entitlement
188
+ */
189
+ description: string | null;
190
+ /**
191
+ * Override display name for the entitlement
192
+ */
193
+ displayNameOverride: string | null;
194
+ /**
195
+ * Allowed enum values (for feature entitlements)
196
+ */
197
+ enumValues: Array<string> | null;
198
+ /**
199
+ * Feature ID (for feature entitlements)
200
+ */
201
+ featureId: string | null;
202
+ /**
203
+ * Whether the usage limit is a soft limit (for feature entitlements)
204
+ */
205
+ hasSoftLimit: boolean | null;
206
+ /**
207
+ * Whether usage is unlimited (for feature entitlements)
208
+ */
209
+ hasUnlimitedUsage: boolean | null;
210
+ /**
211
+ * Widget types where this entitlement is hidden
212
+ */
213
+ hiddenFromWidgets: Array<'PAYWALL' | 'CUSTOMER_PORTAL' | 'CHECKOUT'>;
214
+ /**
215
+ * Whether this is a custom entitlement
216
+ */
217
+ isCustom: boolean | null;
218
+ /**
219
+ * Whether the entitlement is granted
220
+ */
221
+ isGranted: boolean;
222
+ /**
223
+ * Display order of the entitlement
224
+ */
225
+ order: number | null;
226
+ /**
227
+ * Usage reset period (for feature entitlements)
228
+ */
229
+ resetPeriod: 'YEAR' | 'MONTH' | 'WEEK' | 'DAY' | 'HOUR' | null;
230
+ /**
231
+ * Reset period configuration (for feature entitlements)
232
+ */
233
+ resetPeriodConfiguration: Data.YearlyResetPeriodConfig | Data.MonthlyResetPeriodConfig | Data.WeeklyResetPeriodConfig | null;
234
+ /**
235
+ * Entitlement type (FEATURE or CREDIT)
236
+ */
237
+ type: 'FEATURE' | 'CREDIT';
238
+ /**
239
+ * Timestamp of when the record was last updated
240
+ */
241
+ updatedAt: string;
242
+ /**
243
+ * Usage limit (for feature entitlements)
244
+ */
245
+ usageLimit: number | null;
246
+ }
247
+ namespace Data {
248
+ /**
249
+ * Yearly reset configuration
250
+ */
251
+ interface YearlyResetPeriodConfig {
252
+ /**
253
+ * Reset anchor (SubscriptionStart)
254
+ */
255
+ accordingTo: 'SubscriptionStart';
256
+ }
257
+ /**
258
+ * Monthly reset configuration
259
+ */
260
+ interface MonthlyResetPeriodConfig {
261
+ /**
262
+ * Reset anchor (SubscriptionStart or StartOfTheMonth)
263
+ */
264
+ accordingTo: 'SubscriptionStart' | 'StartOfTheMonth';
265
+ }
266
+ /**
267
+ * Weekly reset configuration
268
+ */
269
+ interface WeeklyResetPeriodConfig {
270
+ /**
271
+ * Reset anchor (SubscriptionStart or specific day)
272
+ */
273
+ accordingTo: 'SubscriptionStart' | 'EverySunday' | 'EveryMonday' | 'EveryTuesday' | 'EveryWednesday' | 'EveryThursday' | 'EveryFriday' | 'EverySaturday';
274
+ }
275
+ }
276
+ }
277
+ /**
278
+ * Response list object
279
+ */
280
+ export interface EntitlementListResponse {
281
+ data: Array<EntitlementListResponse.Data>;
282
+ /**
283
+ * Pagination metadata including cursors for navigating through results
284
+ */
285
+ pagination: EntitlementListResponse.Pagination;
286
+ }
287
+ export declare namespace EntitlementListResponse {
288
+ /**
289
+ * Feature or credit entitlement on a plan
290
+ */
291
+ interface Data {
292
+ /**
293
+ * Unique identifier of the entitlement
294
+ */
295
+ id: string;
296
+ /**
297
+ * Credit amount (for credit entitlements)
298
+ */
299
+ amount: number | null;
300
+ /**
301
+ * Entitlement behavior (Increment or Override)
302
+ */
303
+ behavior: 'Increment' | 'Override';
304
+ /**
305
+ * Credit grant cadence (for credit entitlements)
306
+ */
307
+ cadence: 'MONTH' | 'YEAR' | null;
308
+ /**
309
+ * Timestamp of when the record was created
310
+ */
311
+ createdAt: string;
312
+ /**
313
+ * Custom currency ID (for credit entitlements)
314
+ */
315
+ customCurrencyId: string | null;
316
+ /**
317
+ * Optional description of the entitlement
318
+ */
319
+ description: string | null;
320
+ /**
321
+ * Override display name for the entitlement
322
+ */
323
+ displayNameOverride: string | null;
324
+ /**
325
+ * Allowed enum values (for feature entitlements)
326
+ */
327
+ enumValues: Array<string> | null;
328
+ /**
329
+ * Feature ID (for feature entitlements)
330
+ */
331
+ featureId: string | null;
332
+ /**
333
+ * Whether the usage limit is a soft limit (for feature entitlements)
334
+ */
335
+ hasSoftLimit: boolean | null;
336
+ /**
337
+ * Whether usage is unlimited (for feature entitlements)
338
+ */
339
+ hasUnlimitedUsage: boolean | null;
340
+ /**
341
+ * Widget types where this entitlement is hidden
342
+ */
343
+ hiddenFromWidgets: Array<'PAYWALL' | 'CUSTOMER_PORTAL' | 'CHECKOUT'>;
344
+ /**
345
+ * Whether this is a custom entitlement
346
+ */
347
+ isCustom: boolean | null;
348
+ /**
349
+ * Whether the entitlement is granted
350
+ */
351
+ isGranted: boolean;
352
+ /**
353
+ * Display order of the entitlement
354
+ */
355
+ order: number | null;
356
+ /**
357
+ * Usage reset period (for feature entitlements)
358
+ */
359
+ resetPeriod: 'YEAR' | 'MONTH' | 'WEEK' | 'DAY' | 'HOUR' | null;
360
+ /**
361
+ * Reset period configuration (for feature entitlements)
362
+ */
363
+ resetPeriodConfiguration: Data.YearlyResetPeriodConfig | Data.MonthlyResetPeriodConfig | Data.WeeklyResetPeriodConfig | null;
364
+ /**
365
+ * Entitlement type (FEATURE or CREDIT)
366
+ */
367
+ type: 'FEATURE' | 'CREDIT';
368
+ /**
369
+ * Timestamp of when the record was last updated
370
+ */
371
+ updatedAt: string;
372
+ /**
373
+ * Usage limit (for feature entitlements)
374
+ */
375
+ usageLimit: number | null;
376
+ }
377
+ namespace Data {
378
+ /**
379
+ * Yearly reset configuration
380
+ */
381
+ interface YearlyResetPeriodConfig {
382
+ /**
383
+ * Reset anchor (SubscriptionStart)
384
+ */
385
+ accordingTo: 'SubscriptionStart';
386
+ }
387
+ /**
388
+ * Monthly reset configuration
389
+ */
390
+ interface MonthlyResetPeriodConfig {
391
+ /**
392
+ * Reset anchor (SubscriptionStart or StartOfTheMonth)
393
+ */
394
+ accordingTo: 'SubscriptionStart' | 'StartOfTheMonth';
395
+ }
396
+ /**
397
+ * Weekly reset configuration
398
+ */
399
+ interface WeeklyResetPeriodConfig {
400
+ /**
401
+ * Reset anchor (SubscriptionStart or specific day)
402
+ */
403
+ accordingTo: 'SubscriptionStart' | 'EverySunday' | 'EveryMonday' | 'EveryTuesday' | 'EveryWednesday' | 'EveryThursday' | 'EveryFriday' | 'EverySaturday';
404
+ }
405
+ }
406
+ /**
407
+ * Pagination metadata including cursors for navigating through results
408
+ */
409
+ interface Pagination {
410
+ /**
411
+ * Cursor for fetching the next page of results, or null if no additional pages
412
+ * exist
413
+ */
414
+ next: string | null;
415
+ /**
416
+ * Cursor for fetching the previous page of results, or null if at the beginning
417
+ */
418
+ prev: string | null;
419
+ }
420
+ }
421
+ export interface EntitlementCreateParams {
422
+ /**
423
+ * Entitlements to create
424
+ */
425
+ entitlements: Array<EntitlementCreateParams.Entitlement>;
426
+ }
427
+ export declare namespace EntitlementCreateParams {
428
+ /**
429
+ * A single entitlement to create. Provide exactly one of feature or credit.
430
+ */
431
+ interface Entitlement {
432
+ /**
433
+ * Credit entitlement to create
434
+ */
435
+ credit?: Entitlement.Credit;
436
+ /**
437
+ * Feature entitlement to create
438
+ */
439
+ feature?: Entitlement.Feature;
440
+ }
441
+ namespace Entitlement {
442
+ /**
443
+ * Credit entitlement to create
444
+ */
445
+ interface Credit {
446
+ /**
447
+ * Credit grant amount
448
+ */
449
+ amount: number | null;
450
+ /**
451
+ * Credit grant cadence (MONTH or YEAR)
452
+ */
453
+ cadence: 'MONTH' | 'YEAR';
454
+ /**
455
+ * The custom currency ID for the credit entitlement
456
+ */
457
+ customCurrencyId: string;
458
+ /**
459
+ * Entitlement behavior (Increment or Override)
460
+ */
461
+ behavior?: 'Increment' | 'Override';
462
+ /**
463
+ * Description of the entitlement
464
+ */
465
+ description?: string;
466
+ /**
467
+ * Override display name for the entitlement
468
+ */
469
+ displayNameOverride?: string;
470
+ /**
471
+ * Widget types where this entitlement is hidden
472
+ */
473
+ hiddenFromWidgets?: Array<'PAYWALL' | 'CUSTOMER_PORTAL' | 'CHECKOUT'>;
474
+ /**
475
+ * Whether this is a custom entitlement
476
+ */
477
+ isCustom?: boolean;
478
+ /**
479
+ * Whether the entitlement is granted
480
+ */
481
+ isGranted?: boolean;
482
+ /**
483
+ * Display order of the entitlement
484
+ */
485
+ order?: number;
486
+ }
487
+ /**
488
+ * Feature entitlement to create
489
+ */
490
+ interface Feature {
491
+ /**
492
+ * The feature ID to attach the entitlement to
493
+ */
494
+ featureId: string;
495
+ /**
496
+ * Entitlement behavior (Increment or Override)
497
+ */
498
+ behavior?: 'Increment' | 'Override';
499
+ /**
500
+ * Description of the entitlement
501
+ */
502
+ description?: string;
503
+ /**
504
+ * Override display name for the entitlement
505
+ */
506
+ displayNameOverride?: string;
507
+ /**
508
+ * Allowed enum values for the feature entitlement
509
+ */
510
+ enumValues?: Array<string>;
511
+ /**
512
+ * Whether the usage limit is a soft limit
513
+ */
514
+ hasSoftLimit?: boolean;
515
+ /**
516
+ * Whether usage is unlimited
517
+ */
518
+ hasUnlimitedUsage?: boolean;
519
+ /**
520
+ * Widget types where this entitlement is hidden
521
+ */
522
+ hiddenFromWidgets?: Array<'PAYWALL' | 'CUSTOMER_PORTAL' | 'CHECKOUT'>;
523
+ /**
524
+ * Whether this is a custom entitlement
525
+ */
526
+ isCustom?: boolean;
527
+ /**
528
+ * Whether the entitlement is granted
529
+ */
530
+ isGranted?: boolean;
531
+ /**
532
+ * Configuration for monthly reset period
533
+ */
534
+ monthlyResetPeriodConfiguration?: Feature.MonthlyResetPeriodConfiguration | null;
535
+ /**
536
+ * Display order of the entitlement
537
+ */
538
+ order?: number;
539
+ /**
540
+ * Period at which usage resets
541
+ */
542
+ resetPeriod?: 'YEAR' | 'MONTH' | 'WEEK' | 'DAY' | 'HOUR';
543
+ /**
544
+ * Maximum allowed usage for the feature
545
+ */
546
+ usageLimit?: number | null;
547
+ /**
548
+ * Configuration for weekly reset period
549
+ */
550
+ weeklyResetPeriodConfiguration?: Feature.WeeklyResetPeriodConfiguration | null;
551
+ /**
552
+ * Configuration for yearly reset period
553
+ */
554
+ yearlyResetPeriodConfiguration?: Feature.YearlyResetPeriodConfiguration | null;
555
+ }
556
+ namespace Feature {
557
+ /**
558
+ * Configuration for monthly reset period
559
+ */
560
+ interface MonthlyResetPeriodConfiguration {
561
+ /**
562
+ * Reset anchor (SubscriptionStart or StartOfTheMonth)
563
+ */
564
+ accordingTo: 'SubscriptionStart' | 'StartOfTheMonth';
565
+ }
566
+ /**
567
+ * Configuration for weekly reset period
568
+ */
569
+ interface WeeklyResetPeriodConfiguration {
570
+ /**
571
+ * Reset anchor (SubscriptionStart or specific day)
572
+ */
573
+ accordingTo: 'SubscriptionStart' | 'EverySunday' | 'EveryMonday' | 'EveryTuesday' | 'EveryWednesday' | 'EveryThursday' | 'EveryFriday' | 'EverySaturday';
574
+ }
575
+ /**
576
+ * Configuration for yearly reset period
577
+ */
578
+ interface YearlyResetPeriodConfiguration {
579
+ /**
580
+ * Reset anchor (SubscriptionStart)
581
+ */
582
+ accordingTo: 'SubscriptionStart';
583
+ }
584
+ }
585
+ }
586
+ }
587
+ export interface EntitlementUpdateParams {
588
+ /**
589
+ * Path param: The plan ID
590
+ */
591
+ planId: string;
592
+ /**
593
+ * Body param: Credit entitlement fields to update
594
+ */
595
+ credit?: EntitlementUpdateParams.Credit;
596
+ /**
597
+ * Body param: Feature entitlement fields to update
598
+ */
599
+ feature?: EntitlementUpdateParams.Feature;
600
+ }
601
+ export declare namespace EntitlementUpdateParams {
602
+ /**
603
+ * Credit entitlement fields to update
604
+ */
605
+ interface Credit {
606
+ /**
607
+ * Credit grant amount
608
+ */
609
+ amount?: number;
610
+ /**
611
+ * Entitlement behavior (Increment or Override)
612
+ */
613
+ behavior?: 'Increment' | 'Override';
614
+ /**
615
+ * Credit grant cadence (MONTH or YEAR)
616
+ */
617
+ cadence?: 'MONTH' | 'YEAR';
618
+ /**
619
+ * Description of the entitlement
620
+ */
621
+ description?: string;
622
+ /**
623
+ * Override display name for the entitlement
624
+ */
625
+ displayNameOverride?: string;
626
+ /**
627
+ * Widget types where this entitlement is hidden
628
+ */
629
+ hiddenFromWidgets?: Array<'PAYWALL' | 'CUSTOMER_PORTAL' | 'CHECKOUT'>;
630
+ /**
631
+ * Whether this is a custom entitlement
632
+ */
633
+ isCustom?: boolean;
634
+ /**
635
+ * Whether the entitlement is granted
636
+ */
637
+ isGranted?: boolean;
638
+ /**
639
+ * Display order of the entitlement
640
+ */
641
+ order?: number;
642
+ }
643
+ /**
644
+ * Feature entitlement fields to update
645
+ */
646
+ interface Feature {
647
+ /**
648
+ * Entitlement behavior (Increment or Override)
649
+ */
650
+ behavior?: 'Increment' | 'Override';
651
+ /**
652
+ * Description of the entitlement
653
+ */
654
+ description?: string;
655
+ /**
656
+ * Override display name for the entitlement
657
+ */
658
+ displayNameOverride?: string;
659
+ /**
660
+ * Allowed enum values for the feature entitlement
661
+ */
662
+ enumValues?: Array<string>;
663
+ /**
664
+ * Whether the usage limit is a soft limit
665
+ */
666
+ hasSoftLimit?: boolean;
667
+ /**
668
+ * Whether usage is unlimited
669
+ */
670
+ hasUnlimitedUsage?: boolean;
671
+ /**
672
+ * Widget types where this entitlement is hidden
673
+ */
674
+ hiddenFromWidgets?: Array<'PAYWALL' | 'CUSTOMER_PORTAL' | 'CHECKOUT'>;
675
+ /**
676
+ * Whether this is a custom entitlement
677
+ */
678
+ isCustom?: boolean;
679
+ /**
680
+ * Whether the entitlement is granted
681
+ */
682
+ isGranted?: boolean;
683
+ /**
684
+ * Configuration for monthly reset period
685
+ */
686
+ monthlyResetPeriodConfiguration?: Feature.MonthlyResetPeriodConfiguration | null;
687
+ /**
688
+ * Display order of the entitlement
689
+ */
690
+ order?: number;
691
+ /**
692
+ * Period at which usage resets
693
+ */
694
+ resetPeriod?: 'YEAR' | 'MONTH' | 'WEEK' | 'DAY' | 'HOUR';
695
+ /**
696
+ * Maximum allowed usage for the feature
697
+ */
698
+ usageLimit?: number | null;
699
+ /**
700
+ * Configuration for weekly reset period
701
+ */
702
+ weeklyResetPeriodConfiguration?: Feature.WeeklyResetPeriodConfiguration | null;
703
+ /**
704
+ * Configuration for yearly reset period
705
+ */
706
+ yearlyResetPeriodConfiguration?: Feature.YearlyResetPeriodConfiguration | null;
707
+ }
708
+ namespace Feature {
709
+ /**
710
+ * Configuration for monthly reset period
711
+ */
712
+ interface MonthlyResetPeriodConfiguration {
713
+ /**
714
+ * Reset anchor (SubscriptionStart or StartOfTheMonth)
715
+ */
716
+ accordingTo: 'SubscriptionStart' | 'StartOfTheMonth';
717
+ }
718
+ /**
719
+ * Configuration for weekly reset period
720
+ */
721
+ interface WeeklyResetPeriodConfiguration {
722
+ /**
723
+ * Reset anchor (SubscriptionStart or specific day)
724
+ */
725
+ accordingTo: 'SubscriptionStart' | 'EverySunday' | 'EveryMonday' | 'EveryTuesday' | 'EveryWednesday' | 'EveryThursday' | 'EveryFriday' | 'EverySaturday';
726
+ }
727
+ /**
728
+ * Configuration for yearly reset period
729
+ */
730
+ interface YearlyResetPeriodConfiguration {
731
+ /**
732
+ * Reset anchor (SubscriptionStart)
733
+ */
734
+ accordingTo: 'SubscriptionStart';
735
+ }
736
+ }
737
+ }
738
+ export interface EntitlementDeleteParams {
739
+ /**
740
+ * The plan ID
741
+ */
742
+ planId: string;
743
+ }
744
+ export declare namespace Entitlements {
745
+ export { type PlanEntitlement as PlanEntitlement, type EntitlementCreateResponse as EntitlementCreateResponse, type EntitlementListResponse as EntitlementListResponse, type EntitlementCreateParams as EntitlementCreateParams, type EntitlementUpdateParams as EntitlementUpdateParams, type EntitlementDeleteParams as EntitlementDeleteParams, };
746
+ }
747
+ //# sourceMappingURL=entitlements.d.mts.map