@stigg/typescript 0.1.0-alpha.17 → 0.1.0-alpha.19

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 (135) hide show
  1. package/CHANGELOG.md +33 -0
  2. package/client.d.mts.map +1 -1
  3. package/client.d.ts.map +1 -1
  4. package/client.js +6 -5
  5. package/client.js.map +1 -1
  6. package/client.mjs +6 -5
  7. package/client.mjs.map +1 -1
  8. package/package.json +1 -1
  9. package/resources/v1/addons/entitlements.d.mts +360 -247
  10. package/resources/v1/addons/entitlements.d.mts.map +1 -1
  11. package/resources/v1/addons/entitlements.d.ts +360 -247
  12. package/resources/v1/addons/entitlements.d.ts.map +1 -1
  13. package/resources/v1/coupons.d.mts +12 -0
  14. package/resources/v1/coupons.d.mts.map +1 -1
  15. package/resources/v1/coupons.d.ts +12 -0
  16. package/resources/v1/coupons.d.ts.map +1 -1
  17. package/resources/v1/customers/customers.d.mts +16 -0
  18. package/resources/v1/customers/customers.d.mts.map +1 -1
  19. package/resources/v1/customers/customers.d.ts +16 -0
  20. package/resources/v1/customers/customers.d.ts.map +1 -1
  21. package/resources/v1/customers/customers.js.map +1 -1
  22. package/resources/v1/customers/customers.mjs.map +1 -1
  23. package/resources/v1/events/credits/credits.d.mts +260 -0
  24. package/resources/v1/events/credits/credits.d.mts.map +1 -0
  25. package/resources/v1/events/credits/credits.d.ts +260 -0
  26. package/resources/v1/events/credits/credits.d.ts.map +1 -0
  27. package/resources/v1/events/credits/credits.js +41 -0
  28. package/resources/v1/events/credits/credits.js.map +1 -0
  29. package/resources/v1/events/credits/credits.mjs +36 -0
  30. package/resources/v1/events/credits/credits.mjs.map +1 -0
  31. package/resources/v1/events/credits/grants.d.mts +549 -0
  32. package/resources/v1/events/credits/grants.d.mts.map +1 -0
  33. package/resources/v1/events/credits/grants.d.ts +549 -0
  34. package/resources/v1/events/credits/grants.d.ts.map +1 -0
  35. package/resources/v1/events/credits/grants.js +37 -0
  36. package/resources/v1/events/credits/grants.js.map +1 -0
  37. package/resources/v1/events/credits/grants.mjs +33 -0
  38. package/resources/v1/events/credits/grants.mjs.map +1 -0
  39. package/resources/v1/events/credits/index.d.mts +3 -0
  40. package/resources/v1/events/credits/index.d.mts.map +1 -0
  41. package/resources/v1/events/credits/index.d.ts +3 -0
  42. package/resources/v1/events/credits/index.d.ts.map +1 -0
  43. package/resources/v1/events/credits/index.js +9 -0
  44. package/resources/v1/events/credits/index.js.map +1 -0
  45. package/resources/v1/events/credits/index.mjs +4 -0
  46. package/resources/v1/events/credits/index.mjs.map +1 -0
  47. package/resources/v1/events/credits.d.mts +2 -0
  48. package/resources/v1/events/credits.d.mts.map +1 -0
  49. package/resources/v1/events/credits.d.ts +2 -0
  50. package/resources/v1/events/credits.d.ts.map +1 -0
  51. package/resources/v1/events/credits.js +6 -0
  52. package/resources/v1/events/credits.js.map +1 -0
  53. package/resources/v1/events/credits.mjs +3 -0
  54. package/resources/v1/events/credits.mjs.map +1 -0
  55. package/resources/v1/events/events.d.mts +70 -0
  56. package/resources/v1/events/events.d.mts.map +1 -0
  57. package/resources/v1/events/events.d.ts +70 -0
  58. package/resources/v1/events/events.d.ts.map +1 -0
  59. package/resources/v1/events/events.js +27 -0
  60. package/resources/v1/events/events.js.map +1 -0
  61. package/resources/v1/events/events.mjs +22 -0
  62. package/resources/v1/events/events.mjs.map +1 -0
  63. package/resources/v1/events/index.d.mts +3 -0
  64. package/resources/v1/events/index.d.mts.map +1 -0
  65. package/resources/v1/events/index.d.ts +3 -0
  66. package/resources/v1/events/index.d.ts.map +1 -0
  67. package/resources/v1/events/index.js +9 -0
  68. package/resources/v1/events/index.js.map +1 -0
  69. package/resources/v1/events/index.mjs +4 -0
  70. package/resources/v1/events/index.mjs.map +1 -0
  71. package/resources/v1/events.d.mts +1 -65
  72. package/resources/v1/events.d.mts.map +1 -1
  73. package/resources/v1/events.d.ts +1 -65
  74. package/resources/v1/events.d.ts.map +1 -1
  75. package/resources/v1/events.js +2 -15
  76. package/resources/v1/events.js.map +1 -1
  77. package/resources/v1/events.mjs +1 -13
  78. package/resources/v1/events.mjs.map +1 -1
  79. package/resources/v1/index.d.mts +1 -1
  80. package/resources/v1/index.d.ts +1 -1
  81. package/resources/v1/index.js +6 -6
  82. package/resources/v1/index.js.map +1 -1
  83. package/resources/v1/index.mjs +1 -1
  84. package/resources/v1/plans/entitlements.d.mts +360 -247
  85. package/resources/v1/plans/entitlements.d.mts.map +1 -1
  86. package/resources/v1/plans/entitlements.d.ts +360 -247
  87. package/resources/v1/plans/entitlements.d.ts.map +1 -1
  88. package/resources/v1/products.d.mts +2 -2
  89. package/resources/v1/products.d.mts.map +1 -1
  90. package/resources/v1/products.d.ts +2 -2
  91. package/resources/v1/products.d.ts.map +1 -1
  92. package/resources/v1/products.js +2 -2
  93. package/resources/v1/products.js.map +1 -1
  94. package/resources/v1/products.mjs +2 -2
  95. package/resources/v1/products.mjs.map +1 -1
  96. package/resources/v1/subscriptions/subscriptions.d.mts +184 -32
  97. package/resources/v1/subscriptions/subscriptions.d.mts.map +1 -1
  98. package/resources/v1/subscriptions/subscriptions.d.ts +184 -32
  99. package/resources/v1/subscriptions/subscriptions.d.ts.map +1 -1
  100. package/resources/v1/subscriptions/subscriptions.js.map +1 -1
  101. package/resources/v1/subscriptions/subscriptions.mjs.map +1 -1
  102. package/resources/v1/usage.d.mts +1 -1
  103. package/resources/v1/usage.d.mts.map +1 -1
  104. package/resources/v1/usage.d.ts +1 -1
  105. package/resources/v1/usage.d.ts.map +1 -1
  106. package/resources/v1/v1.d.mts +2 -2
  107. package/resources/v1/v1.d.mts.map +1 -1
  108. package/resources/v1/v1.d.ts +2 -2
  109. package/resources/v1/v1.d.ts.map +1 -1
  110. package/resources/v1/v1.js +2 -2
  111. package/resources/v1/v1.js.map +1 -1
  112. package/resources/v1/v1.mjs +2 -2
  113. package/resources/v1/v1.mjs.map +1 -1
  114. package/src/client.ts +6 -5
  115. package/src/resources/v1/addons/entitlements.ts +431 -287
  116. package/src/resources/v1/coupons.ts +10 -0
  117. package/src/resources/v1/customers/customers.ts +20 -0
  118. package/src/resources/v1/events/credits/credits.ts +356 -0
  119. package/src/resources/v1/events/credits/grants.ts +795 -0
  120. package/src/resources/v1/events/credits/index.ts +20 -0
  121. package/src/resources/v1/events/credits.ts +3 -0
  122. package/src/resources/v1/events/events.ts +103 -0
  123. package/src/resources/v1/events/index.ts +13 -0
  124. package/src/resources/v1/events.ts +1 -75
  125. package/src/resources/v1/index.ts +1 -1
  126. package/src/resources/v1/plans/entitlements.ts +431 -287
  127. package/src/resources/v1/products.ts +3 -3
  128. package/src/resources/v1/subscriptions/subscriptions.ts +234 -57
  129. package/src/resources/v1/usage.ts +1 -1
  130. package/src/resources/v1/v1.ts +2 -2
  131. package/src/version.ts +1 -1
  132. package/version.d.mts +1 -1
  133. package/version.d.ts +1 -1
  134. package/version.js +1 -1
  135. package/version.mjs +1 -1
@@ -54,46 +54,31 @@ export class Entitlements extends APIResource {
54
54
  */
55
55
  export interface AddonPackageEntitlement {
56
56
  /**
57
- * Feature or credit entitlement on an addon
57
+ * Feature entitlement response
58
58
  */
59
- data: AddonPackageEntitlement.Data;
59
+ data: AddonPackageEntitlement.Feature | AddonPackageEntitlement.Credit;
60
60
  }
61
61
 
62
62
  export namespace AddonPackageEntitlement {
63
63
  /**
64
- * Feature or credit entitlement on an addon
64
+ * Feature entitlement response
65
65
  */
66
- export interface Data {
66
+ export interface Feature {
67
67
  /**
68
68
  * Unique identifier of the entitlement
69
69
  */
70
70
  id: string;
71
71
 
72
- /**
73
- * Credit amount (for credit entitlements)
74
- */
75
- amount: number | null;
76
-
77
72
  /**
78
73
  * Entitlement behavior (Increment or Override)
79
74
  */
80
75
  behavior: 'Increment' | 'Override';
81
76
 
82
- /**
83
- * Credit grant cadence (for credit entitlements)
84
- */
85
- cadence: 'MONTH' | 'YEAR' | null;
86
-
87
77
  /**
88
78
  * Timestamp of when the record was created
89
79
  */
90
80
  createdAt: string;
91
81
 
92
- /**
93
- * Custom currency ID (for credit entitlements)
94
- */
95
- customCurrencyId: string | null;
96
-
97
82
  /**
98
83
  * Optional description of the entitlement
99
84
  */
@@ -109,11 +94,6 @@ export namespace AddonPackageEntitlement {
109
94
  */
110
95
  enumValues: Array<string> | null;
111
96
 
112
- /**
113
- * Feature ID (for feature entitlements)
114
- */
115
- featureId: string | null;
116
-
117
97
  /**
118
98
  * Whether the usage limit is a soft limit (for feature entitlements)
119
99
  */
@@ -153,15 +133,15 @@ export namespace AddonPackageEntitlement {
153
133
  * Reset period configuration (for feature entitlements)
154
134
  */
155
135
  resetPeriodConfiguration:
156
- | Data.YearlyResetPeriodConfig
157
- | Data.MonthlyResetPeriodConfig
158
- | Data.WeeklyResetPeriodConfig
136
+ | Feature.YearlyResetPeriodConfig
137
+ | Feature.MonthlyResetPeriodConfig
138
+ | Feature.WeeklyResetPeriodConfig
159
139
  | null;
160
140
 
161
141
  /**
162
142
  * Entitlement type (FEATURE or CREDIT)
163
143
  */
164
- type: 'FEATURE' | 'CREDIT';
144
+ type: 'FEATURE';
165
145
 
166
146
  /**
167
147
  * Timestamp of when the record was last updated
@@ -174,7 +154,7 @@ export namespace AddonPackageEntitlement {
174
154
  usageLimit: number | null;
175
155
  }
176
156
 
177
- export namespace Data {
157
+ export namespace Feature {
178
158
  /**
179
159
  * Yearly reset configuration
180
160
  */
@@ -213,20 +193,11 @@ export namespace AddonPackageEntitlement {
213
193
  | 'EverySaturday';
214
194
  }
215
195
  }
216
- }
217
-
218
- /**
219
- * Response object
220
- */
221
- export interface EntitlementCreateResponse {
222
- data: Array<EntitlementCreateResponse.Data>;
223
- }
224
196
 
225
- export namespace EntitlementCreateResponse {
226
197
  /**
227
- * Feature or credit entitlement on an addon
198
+ * Credit entitlement response
228
199
  */
229
- export interface Data {
200
+ export interface Credit {
230
201
  /**
231
202
  * Unique identifier of the entitlement
232
203
  */
@@ -253,9 +224,73 @@ export namespace EntitlementCreateResponse {
253
224
  createdAt: string;
254
225
 
255
226
  /**
256
- * Custom currency ID (for credit entitlements)
227
+ * Optional description of the entitlement
228
+ */
229
+ description: string | null;
230
+
231
+ /**
232
+ * Override display name for the entitlement
233
+ */
234
+ displayNameOverride: string | null;
235
+
236
+ /**
237
+ * Widget types where this entitlement is hidden
238
+ */
239
+ hiddenFromWidgets: Array<'PAYWALL' | 'CUSTOMER_PORTAL' | 'CHECKOUT'>;
240
+
241
+ /**
242
+ * Whether this is a custom entitlement
243
+ */
244
+ isCustom: boolean | null;
245
+
246
+ /**
247
+ * Whether the entitlement is granted
248
+ */
249
+ isGranted: boolean;
250
+
251
+ /**
252
+ * Display order of the entitlement
253
+ */
254
+ order: number | null;
255
+
256
+ /**
257
+ * Entitlement type (FEATURE or CREDIT)
258
+ */
259
+ type: 'CREDIT';
260
+
261
+ /**
262
+ * Timestamp of when the record was last updated
263
+ */
264
+ updatedAt: string;
265
+ }
266
+ }
267
+
268
+ /**
269
+ * Response object
270
+ */
271
+ export interface EntitlementCreateResponse {
272
+ data: Array<EntitlementCreateResponse.Feature | EntitlementCreateResponse.Credit>;
273
+ }
274
+
275
+ export namespace EntitlementCreateResponse {
276
+ /**
277
+ * Feature entitlement response
278
+ */
279
+ export interface Feature {
280
+ /**
281
+ * Unique identifier of the entitlement
282
+ */
283
+ id: string;
284
+
285
+ /**
286
+ * Entitlement behavior (Increment or Override)
287
+ */
288
+ behavior: 'Increment' | 'Override';
289
+
290
+ /**
291
+ * Timestamp of when the record was created
257
292
  */
258
- customCurrencyId: string | null;
293
+ createdAt: string;
259
294
 
260
295
  /**
261
296
  * Optional description of the entitlement
@@ -272,11 +307,6 @@ export namespace EntitlementCreateResponse {
272
307
  */
273
308
  enumValues: Array<string> | null;
274
309
 
275
- /**
276
- * Feature ID (for feature entitlements)
277
- */
278
- featureId: string | null;
279
-
280
310
  /**
281
311
  * Whether the usage limit is a soft limit (for feature entitlements)
282
312
  */
@@ -316,15 +346,15 @@ export namespace EntitlementCreateResponse {
316
346
  * Reset period configuration (for feature entitlements)
317
347
  */
318
348
  resetPeriodConfiguration:
319
- | Data.YearlyResetPeriodConfig
320
- | Data.MonthlyResetPeriodConfig
321
- | Data.WeeklyResetPeriodConfig
349
+ | Feature.YearlyResetPeriodConfig
350
+ | Feature.MonthlyResetPeriodConfig
351
+ | Feature.WeeklyResetPeriodConfig
322
352
  | null;
323
353
 
324
354
  /**
325
355
  * Entitlement type (FEATURE or CREDIT)
326
356
  */
327
- type: 'FEATURE' | 'CREDIT';
357
+ type: 'FEATURE';
328
358
 
329
359
  /**
330
360
  * Timestamp of when the record was last updated
@@ -337,7 +367,7 @@ export namespace EntitlementCreateResponse {
337
367
  usageLimit: number | null;
338
368
  }
339
369
 
340
- export namespace Data {
370
+ export namespace Feature {
341
371
  /**
342
372
  * Yearly reset configuration
343
373
  */
@@ -376,25 +406,11 @@ export namespace EntitlementCreateResponse {
376
406
  | 'EverySaturday';
377
407
  }
378
408
  }
379
- }
380
409
 
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
410
  /**
395
- * Feature or credit entitlement on an addon
411
+ * Credit entitlement response
396
412
  */
397
- export interface Data {
413
+ export interface Credit {
398
414
  /**
399
415
  * Unique identifier of the entitlement
400
416
  */
@@ -421,9 +437,78 @@ export namespace EntitlementListResponse {
421
437
  createdAt: string;
422
438
 
423
439
  /**
424
- * Custom currency ID (for credit entitlements)
440
+ * Optional description of the entitlement
425
441
  */
426
- customCurrencyId: string | null;
442
+ description: string | null;
443
+
444
+ /**
445
+ * Override display name for the entitlement
446
+ */
447
+ displayNameOverride: string | null;
448
+
449
+ /**
450
+ * Widget types where this entitlement is hidden
451
+ */
452
+ hiddenFromWidgets: Array<'PAYWALL' | 'CUSTOMER_PORTAL' | 'CHECKOUT'>;
453
+
454
+ /**
455
+ * Whether this is a custom entitlement
456
+ */
457
+ isCustom: boolean | null;
458
+
459
+ /**
460
+ * Whether the entitlement is granted
461
+ */
462
+ isGranted: boolean;
463
+
464
+ /**
465
+ * Display order of the entitlement
466
+ */
467
+ order: number | null;
468
+
469
+ /**
470
+ * Entitlement type (FEATURE or CREDIT)
471
+ */
472
+ type: 'CREDIT';
473
+
474
+ /**
475
+ * Timestamp of when the record was last updated
476
+ */
477
+ updatedAt: string;
478
+ }
479
+ }
480
+
481
+ /**
482
+ * Response list object
483
+ */
484
+ export interface EntitlementListResponse {
485
+ data: Array<EntitlementListResponse.Feature | EntitlementListResponse.Credit>;
486
+
487
+ /**
488
+ * Pagination metadata including cursors for navigating through results
489
+ */
490
+ pagination: EntitlementListResponse.Pagination;
491
+ }
492
+
493
+ export namespace EntitlementListResponse {
494
+ /**
495
+ * Feature entitlement response
496
+ */
497
+ export interface Feature {
498
+ /**
499
+ * Unique identifier of the entitlement
500
+ */
501
+ id: string;
502
+
503
+ /**
504
+ * Entitlement behavior (Increment or Override)
505
+ */
506
+ behavior: 'Increment' | 'Override';
507
+
508
+ /**
509
+ * Timestamp of when the record was created
510
+ */
511
+ createdAt: string;
427
512
 
428
513
  /**
429
514
  * Optional description of the entitlement
@@ -440,11 +525,6 @@ export namespace EntitlementListResponse {
440
525
  */
441
526
  enumValues: Array<string> | null;
442
527
 
443
- /**
444
- * Feature ID (for feature entitlements)
445
- */
446
- featureId: string | null;
447
-
448
528
  /**
449
529
  * Whether the usage limit is a soft limit (for feature entitlements)
450
530
  */
@@ -484,15 +564,15 @@ export namespace EntitlementListResponse {
484
564
  * Reset period configuration (for feature entitlements)
485
565
  */
486
566
  resetPeriodConfiguration:
487
- | Data.YearlyResetPeriodConfig
488
- | Data.MonthlyResetPeriodConfig
489
- | Data.WeeklyResetPeriodConfig
567
+ | Feature.YearlyResetPeriodConfig
568
+ | Feature.MonthlyResetPeriodConfig
569
+ | Feature.WeeklyResetPeriodConfig
490
570
  | null;
491
571
 
492
572
  /**
493
573
  * Entitlement type (FEATURE or CREDIT)
494
574
  */
495
- type: 'FEATURE' | 'CREDIT';
575
+ type: 'FEATURE';
496
576
 
497
577
  /**
498
578
  * Timestamp of when the record was last updated
@@ -505,7 +585,7 @@ export namespace EntitlementListResponse {
505
585
  usageLimit: number | null;
506
586
  }
507
587
 
508
- export namespace Data {
588
+ export namespace Feature {
509
589
  /**
510
590
  * Yearly reset configuration
511
591
  */
@@ -545,6 +625,76 @@ export namespace EntitlementListResponse {
545
625
  }
546
626
  }
547
627
 
628
+ /**
629
+ * Credit entitlement response
630
+ */
631
+ export interface Credit {
632
+ /**
633
+ * Unique identifier of the entitlement
634
+ */
635
+ id: string;
636
+
637
+ /**
638
+ * Credit amount (for credit entitlements)
639
+ */
640
+ amount: number | null;
641
+
642
+ /**
643
+ * Entitlement behavior (Increment or Override)
644
+ */
645
+ behavior: 'Increment' | 'Override';
646
+
647
+ /**
648
+ * Credit grant cadence (for credit entitlements)
649
+ */
650
+ cadence: 'MONTH' | 'YEAR' | null;
651
+
652
+ /**
653
+ * Timestamp of when the record was created
654
+ */
655
+ createdAt: string;
656
+
657
+ /**
658
+ * Optional description of the entitlement
659
+ */
660
+ description: string | null;
661
+
662
+ /**
663
+ * Override display name for the entitlement
664
+ */
665
+ displayNameOverride: string | null;
666
+
667
+ /**
668
+ * Widget types where this entitlement is hidden
669
+ */
670
+ hiddenFromWidgets: Array<'PAYWALL' | 'CUSTOMER_PORTAL' | 'CHECKOUT'>;
671
+
672
+ /**
673
+ * Whether this is a custom entitlement
674
+ */
675
+ isCustom: boolean | null;
676
+
677
+ /**
678
+ * Whether the entitlement is granted
679
+ */
680
+ isGranted: boolean;
681
+
682
+ /**
683
+ * Display order of the entitlement
684
+ */
685
+ order: number | null;
686
+
687
+ /**
688
+ * Entitlement type (FEATURE or CREDIT)
689
+ */
690
+ type: 'CREDIT';
691
+
692
+ /**
693
+ * Timestamp of when the record was last updated
694
+ */
695
+ updatedAt: string;
696
+ }
697
+
548
698
  /**
549
699
  * Pagination metadata including cursors for navigating through results
550
700
  */
@@ -566,244 +716,168 @@ export interface EntitlementCreateParams {
566
716
  /**
567
717
  * Entitlements to create
568
718
  */
569
- entitlements: Array<EntitlementCreateParams.Entitlement>;
719
+ entitlements: Array<EntitlementCreateParams.Feature | EntitlementCreateParams.Credit>;
570
720
  }
571
721
 
572
722
  export namespace EntitlementCreateParams {
573
723
  /**
574
- * A single entitlement to create. Provide exactly one of feature or credit.
724
+ * Request to create a feature entitlement
575
725
  */
576
- export interface Entitlement {
726
+ export interface Feature {
577
727
  /**
578
- * Credit entitlement to create
728
+ * The feature ID to attach the entitlement to
579
729
  */
580
- credit?: Entitlement.Credit;
730
+ id: string;
581
731
 
582
732
  /**
583
- * Feature entitlement to create
733
+ * CreateFeatureEntitlementRequest
584
734
  */
585
- feature?: Entitlement.Feature;
586
- }
735
+ type: 'FEATURE';
587
736
 
588
- export namespace Entitlement {
589
737
  /**
590
- * Credit entitlement to create
738
+ * Entitlement behavior (Increment or Override)
591
739
  */
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
- }
740
+ behavior?: 'Increment' | 'Override';
643
741
 
644
742
  /**
645
- * Feature entitlement to create
743
+ * Description of the entitlement
646
744
  */
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';
745
+ description?: string;
657
746
 
658
- /**
659
- * Description of the entitlement
660
- */
661
- description?: string;
747
+ /**
748
+ * Override display name for the entitlement
749
+ */
750
+ displayNameOverride?: string;
662
751
 
663
- /**
664
- * Override display name for the entitlement
665
- */
666
- displayNameOverride?: string;
752
+ /**
753
+ * Allowed enum values for the feature entitlement
754
+ */
755
+ enumValues?: Array<string>;
667
756
 
668
- /**
669
- * Allowed enum values for the feature entitlement
670
- */
671
- enumValues?: Array<string>;
757
+ /**
758
+ * Whether the usage limit is a soft limit
759
+ */
760
+ hasSoftLimit?: boolean;
672
761
 
673
- /**
674
- * Whether the usage limit is a soft limit
675
- */
676
- hasSoftLimit?: boolean;
762
+ /**
763
+ * Whether usage is unlimited
764
+ */
765
+ hasUnlimitedUsage?: boolean;
677
766
 
678
- /**
679
- * Whether usage is unlimited
680
- */
681
- hasUnlimitedUsage?: boolean;
767
+ /**
768
+ * Widget types where this entitlement is hidden
769
+ */
770
+ hiddenFromWidgets?: Array<'PAYWALL' | 'CUSTOMER_PORTAL' | 'CHECKOUT'>;
682
771
 
683
- /**
684
- * Widget types where this entitlement is hidden
685
- */
686
- hiddenFromWidgets?: Array<'PAYWALL' | 'CUSTOMER_PORTAL' | 'CHECKOUT'>;
772
+ /**
773
+ * Whether this is a custom entitlement
774
+ */
775
+ isCustom?: boolean;
687
776
 
688
- /**
689
- * Whether this is a custom entitlement
690
- */
691
- isCustom?: boolean;
777
+ /**
778
+ * Whether the entitlement is granted
779
+ */
780
+ isGranted?: boolean;
692
781
 
693
- /**
694
- * Whether the entitlement is granted
695
- */
696
- isGranted?: boolean;
782
+ /**
783
+ * Configuration for monthly reset period
784
+ */
785
+ monthlyResetPeriodConfiguration?: Feature.MonthlyResetPeriodConfiguration | null;
697
786
 
698
- /**
699
- * Configuration for monthly reset period
700
- */
701
- monthlyResetPeriodConfiguration?: Feature.MonthlyResetPeriodConfiguration | null;
787
+ /**
788
+ * Display order of the entitlement
789
+ */
790
+ order?: number;
702
791
 
703
- /**
704
- * Display order of the entitlement
705
- */
706
- order?: number;
792
+ /**
793
+ * Period at which usage resets
794
+ */
795
+ resetPeriod?: 'YEAR' | 'MONTH' | 'WEEK' | 'DAY' | 'HOUR';
707
796
 
708
- /**
709
- * Period at which usage resets
710
- */
711
- resetPeriod?: 'YEAR' | 'MONTH' | 'WEEK' | 'DAY' | 'HOUR';
797
+ /**
798
+ * Maximum allowed usage for the feature
799
+ */
800
+ usageLimit?: number | null;
712
801
 
713
- /**
714
- * Maximum allowed usage for the feature
715
- */
716
- usageLimit?: number | null;
802
+ /**
803
+ * Configuration for weekly reset period
804
+ */
805
+ weeklyResetPeriodConfiguration?: Feature.WeeklyResetPeriodConfiguration | null;
717
806
 
718
- /**
719
- * Configuration for weekly reset period
720
- */
721
- weeklyResetPeriodConfiguration?: Feature.WeeklyResetPeriodConfiguration | null;
807
+ /**
808
+ * Configuration for yearly reset period
809
+ */
810
+ yearlyResetPeriodConfiguration?: Feature.YearlyResetPeriodConfiguration | null;
811
+ }
722
812
 
813
+ export namespace Feature {
814
+ /**
815
+ * Configuration for monthly reset period
816
+ */
817
+ export interface MonthlyResetPeriodConfiguration {
723
818
  /**
724
- * Configuration for yearly reset period
819
+ * Reset anchor (SubscriptionStart or StartOfTheMonth)
725
820
  */
726
- yearlyResetPeriodConfiguration?: Feature.YearlyResetPeriodConfiguration | null;
821
+ accordingTo: 'SubscriptionStart' | 'StartOfTheMonth';
727
822
  }
728
823
 
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
-
824
+ /**
825
+ * Configuration for weekly reset period
826
+ */
827
+ export interface WeeklyResetPeriodConfiguration {
740
828
  /**
741
- * Configuration for weekly reset period
829
+ * Reset anchor (SubscriptionStart or specific day)
742
830
  */
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
- }
831
+ accordingTo:
832
+ | 'SubscriptionStart'
833
+ | 'EverySunday'
834
+ | 'EveryMonday'
835
+ | 'EveryTuesday'
836
+ | 'EveryWednesday'
837
+ | 'EveryThursday'
838
+ | 'EveryFriday'
839
+ | 'EverySaturday';
840
+ }
757
841
 
842
+ /**
843
+ * Configuration for yearly reset period
844
+ */
845
+ export interface YearlyResetPeriodConfiguration {
758
846
  /**
759
- * Configuration for yearly reset period
847
+ * Reset anchor (SubscriptionStart)
760
848
  */
761
- export interface YearlyResetPeriodConfiguration {
762
- /**
763
- * Reset anchor (SubscriptionStart)
764
- */
765
- accordingTo: 'SubscriptionStart';
766
- }
849
+ accordingTo: 'SubscriptionStart';
767
850
  }
768
851
  }
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
852
 
782
853
  /**
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
854
+ * Request to create a credit entitlement
791
855
  */
792
856
  export interface Credit {
793
857
  /**
794
- * Credit grant amount
858
+ * The custom currency ID for the credit entitlement
795
859
  */
796
- amount?: number;
860
+ id: string;
797
861
 
798
862
  /**
799
- * Entitlement behavior (Increment or Override)
863
+ * Credit grant amount
800
864
  */
801
- behavior?: 'Increment' | 'Override';
865
+ amount: number | null;
802
866
 
803
867
  /**
804
868
  * Credit grant cadence (MONTH or YEAR)
805
869
  */
806
- cadence?: 'MONTH' | 'YEAR';
870
+ cadence: 'MONTH' | 'YEAR';
871
+
872
+ /**
873
+ * CreateCreditEntitlementRequest
874
+ */
875
+ type: 'CREDIT';
876
+
877
+ /**
878
+ * Entitlement behavior (Increment or Override)
879
+ */
880
+ behavior?: 'Increment' | 'Override';
807
881
 
808
882
  /**
809
883
  * Description of the entitlement
@@ -835,88 +909,101 @@ export namespace EntitlementUpdateParams {
835
909
  */
836
910
  order?: number;
837
911
  }
912
+ }
838
913
 
839
- /**
840
- * Feature entitlement fields to update
841
- */
842
- export interface Feature {
914
+ export type EntitlementUpdateParams =
915
+ | EntitlementUpdateParams.UpdateFeatureEntitlementRequest
916
+ | EntitlementUpdateParams.UpdateCreditEntitlementRequest;
917
+
918
+ export declare namespace EntitlementUpdateParams {
919
+ export interface UpdateFeatureEntitlementRequest {
843
920
  /**
844
- * Entitlement behavior (Increment or Override)
921
+ * Path param: The addon ID
922
+ */
923
+ addonId: string;
924
+
925
+ /**
926
+ * Body param: UpdateFeatureEntitlementRequest
927
+ */
928
+ type: 'FEATURE';
929
+
930
+ /**
931
+ * Body param: Entitlement behavior (Increment or Override)
845
932
  */
846
933
  behavior?: 'Increment' | 'Override';
847
934
 
848
935
  /**
849
- * Description of the entitlement
936
+ * Body param: Description of the entitlement
850
937
  */
851
938
  description?: string;
852
939
 
853
940
  /**
854
- * Override display name for the entitlement
941
+ * Body param: Override display name for the entitlement
855
942
  */
856
943
  displayNameOverride?: string;
857
944
 
858
945
  /**
859
- * Allowed enum values for the feature entitlement
946
+ * Body param: Allowed enum values for the feature entitlement
860
947
  */
861
948
  enumValues?: Array<string>;
862
949
 
863
950
  /**
864
- * Whether the usage limit is a soft limit
951
+ * Body param: Whether the usage limit is a soft limit
865
952
  */
866
953
  hasSoftLimit?: boolean;
867
954
 
868
955
  /**
869
- * Whether usage is unlimited
956
+ * Body param: Whether usage is unlimited
870
957
  */
871
958
  hasUnlimitedUsage?: boolean;
872
959
 
873
960
  /**
874
- * Widget types where this entitlement is hidden
961
+ * Body param: Widget types where this entitlement is hidden
875
962
  */
876
963
  hiddenFromWidgets?: Array<'PAYWALL' | 'CUSTOMER_PORTAL' | 'CHECKOUT'>;
877
964
 
878
965
  /**
879
- * Whether this is a custom entitlement
966
+ * Body param: Whether this is a custom entitlement
880
967
  */
881
968
  isCustom?: boolean;
882
969
 
883
970
  /**
884
- * Whether the entitlement is granted
971
+ * Body param: Whether the entitlement is granted
885
972
  */
886
973
  isGranted?: boolean;
887
974
 
888
975
  /**
889
- * Configuration for monthly reset period
976
+ * Body param: Configuration for monthly reset period
890
977
  */
891
- monthlyResetPeriodConfiguration?: Feature.MonthlyResetPeriodConfiguration | null;
978
+ monthlyResetPeriodConfiguration?: UpdateFeatureEntitlementRequest.MonthlyResetPeriodConfiguration | null;
892
979
 
893
980
  /**
894
- * Display order of the entitlement
981
+ * Body param: Display order of the entitlement
895
982
  */
896
983
  order?: number;
897
984
 
898
985
  /**
899
- * Period at which usage resets
986
+ * Body param: Period at which usage resets
900
987
  */
901
988
  resetPeriod?: 'YEAR' | 'MONTH' | 'WEEK' | 'DAY' | 'HOUR';
902
989
 
903
990
  /**
904
- * Maximum allowed usage for the feature
991
+ * Body param: Maximum allowed usage for the feature
905
992
  */
906
993
  usageLimit?: number | null;
907
994
 
908
995
  /**
909
- * Configuration for weekly reset period
996
+ * Body param: Configuration for weekly reset period
910
997
  */
911
- weeklyResetPeriodConfiguration?: Feature.WeeklyResetPeriodConfiguration | null;
998
+ weeklyResetPeriodConfiguration?: UpdateFeatureEntitlementRequest.WeeklyResetPeriodConfiguration | null;
912
999
 
913
1000
  /**
914
- * Configuration for yearly reset period
1001
+ * Body param: Configuration for yearly reset period
915
1002
  */
916
- yearlyResetPeriodConfiguration?: Feature.YearlyResetPeriodConfiguration | null;
1003
+ yearlyResetPeriodConfiguration?: UpdateFeatureEntitlementRequest.YearlyResetPeriodConfiguration | null;
917
1004
  }
918
1005
 
919
- export namespace Feature {
1006
+ export namespace UpdateFeatureEntitlementRequest {
920
1007
  /**
921
1008
  * Configuration for monthly reset period
922
1009
  */
@@ -955,6 +1042,63 @@ export namespace EntitlementUpdateParams {
955
1042
  accordingTo: 'SubscriptionStart';
956
1043
  }
957
1044
  }
1045
+
1046
+ export interface UpdateCreditEntitlementRequest {
1047
+ /**
1048
+ * Path param: The addon ID
1049
+ */
1050
+ addonId: string;
1051
+
1052
+ /**
1053
+ * Body param: UpdateCreditEntitlementRequest
1054
+ */
1055
+ type: 'CREDIT';
1056
+
1057
+ /**
1058
+ * Body param: Credit grant amount
1059
+ */
1060
+ amount?: number;
1061
+
1062
+ /**
1063
+ * Body param: Entitlement behavior (Increment or Override)
1064
+ */
1065
+ behavior?: 'Increment' | 'Override';
1066
+
1067
+ /**
1068
+ * Body param: Credit grant cadence (MONTH or YEAR)
1069
+ */
1070
+ cadence?: 'MONTH' | 'YEAR';
1071
+
1072
+ /**
1073
+ * Body param: Description of the entitlement
1074
+ */
1075
+ description?: string;
1076
+
1077
+ /**
1078
+ * Body param: Override display name for the entitlement
1079
+ */
1080
+ displayNameOverride?: string;
1081
+
1082
+ /**
1083
+ * Body param: Widget types where this entitlement is hidden
1084
+ */
1085
+ hiddenFromWidgets?: Array<'PAYWALL' | 'CUSTOMER_PORTAL' | 'CHECKOUT'>;
1086
+
1087
+ /**
1088
+ * Body param: Whether this is a custom entitlement
1089
+ */
1090
+ isCustom?: boolean;
1091
+
1092
+ /**
1093
+ * Body param: Whether the entitlement is granted
1094
+ */
1095
+ isGranted?: boolean;
1096
+
1097
+ /**
1098
+ * Body param: Display order of the entitlement
1099
+ */
1100
+ order?: number;
1101
+ }
958
1102
  }
959
1103
 
960
1104
  export interface EntitlementDeleteParams {