@stigg/typescript 0.1.0-alpha.18 → 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 (119) hide show
  1. package/CHANGELOG.md +12 -0
  2. package/package.json +1 -1
  3. package/resources/v1/addons/entitlements.d.mts +360 -247
  4. package/resources/v1/addons/entitlements.d.mts.map +1 -1
  5. package/resources/v1/addons/entitlements.d.ts +360 -247
  6. package/resources/v1/addons/entitlements.d.ts.map +1 -1
  7. package/resources/v1/coupons.d.mts +12 -0
  8. package/resources/v1/coupons.d.mts.map +1 -1
  9. package/resources/v1/coupons.d.ts +12 -0
  10. package/resources/v1/coupons.d.ts.map +1 -1
  11. package/resources/v1/customers/customers.d.mts +16 -0
  12. package/resources/v1/customers/customers.d.mts.map +1 -1
  13. package/resources/v1/customers/customers.d.ts +16 -0
  14. package/resources/v1/customers/customers.d.ts.map +1 -1
  15. package/resources/v1/customers/customers.js.map +1 -1
  16. package/resources/v1/customers/customers.mjs.map +1 -1
  17. package/resources/v1/events/credits/credits.d.mts +260 -0
  18. package/resources/v1/events/credits/credits.d.mts.map +1 -0
  19. package/resources/v1/events/credits/credits.d.ts +260 -0
  20. package/resources/v1/events/credits/credits.d.ts.map +1 -0
  21. package/resources/v1/events/credits/credits.js +41 -0
  22. package/resources/v1/events/credits/credits.js.map +1 -0
  23. package/resources/v1/events/credits/credits.mjs +36 -0
  24. package/resources/v1/events/credits/credits.mjs.map +1 -0
  25. package/resources/v1/events/credits/grants.d.mts +549 -0
  26. package/resources/v1/events/credits/grants.d.mts.map +1 -0
  27. package/resources/v1/events/credits/grants.d.ts +549 -0
  28. package/resources/v1/events/credits/grants.d.ts.map +1 -0
  29. package/resources/v1/events/credits/grants.js +37 -0
  30. package/resources/v1/events/credits/grants.js.map +1 -0
  31. package/resources/v1/events/credits/grants.mjs +33 -0
  32. package/resources/v1/events/credits/grants.mjs.map +1 -0
  33. package/resources/v1/events/credits/index.d.mts +3 -0
  34. package/resources/v1/events/credits/index.d.mts.map +1 -0
  35. package/resources/v1/events/credits/index.d.ts +3 -0
  36. package/resources/v1/events/credits/index.d.ts.map +1 -0
  37. package/resources/v1/events/credits/index.js +9 -0
  38. package/resources/v1/events/credits/index.js.map +1 -0
  39. package/resources/v1/events/credits/index.mjs +4 -0
  40. package/resources/v1/events/credits/index.mjs.map +1 -0
  41. package/resources/v1/events/credits.d.mts +2 -0
  42. package/resources/v1/events/credits.d.mts.map +1 -0
  43. package/resources/v1/events/credits.d.ts +2 -0
  44. package/resources/v1/events/credits.d.ts.map +1 -0
  45. package/resources/v1/events/credits.js +6 -0
  46. package/resources/v1/events/credits.js.map +1 -0
  47. package/resources/v1/events/credits.mjs +3 -0
  48. package/resources/v1/events/credits.mjs.map +1 -0
  49. package/resources/v1/events/events.d.mts +70 -0
  50. package/resources/v1/events/events.d.mts.map +1 -0
  51. package/resources/v1/events/events.d.ts +70 -0
  52. package/resources/v1/events/events.d.ts.map +1 -0
  53. package/resources/v1/events/events.js +27 -0
  54. package/resources/v1/events/events.js.map +1 -0
  55. package/resources/v1/events/events.mjs +22 -0
  56. package/resources/v1/events/events.mjs.map +1 -0
  57. package/resources/v1/events/index.d.mts +3 -0
  58. package/resources/v1/events/index.d.mts.map +1 -0
  59. package/resources/v1/events/index.d.ts +3 -0
  60. package/resources/v1/events/index.d.ts.map +1 -0
  61. package/resources/v1/events/index.js +9 -0
  62. package/resources/v1/events/index.js.map +1 -0
  63. package/resources/v1/events/index.mjs +4 -0
  64. package/resources/v1/events/index.mjs.map +1 -0
  65. package/resources/v1/events.d.mts +1 -65
  66. package/resources/v1/events.d.mts.map +1 -1
  67. package/resources/v1/events.d.ts +1 -65
  68. package/resources/v1/events.d.ts.map +1 -1
  69. package/resources/v1/events.js +2 -15
  70. package/resources/v1/events.js.map +1 -1
  71. package/resources/v1/events.mjs +1 -13
  72. package/resources/v1/events.mjs.map +1 -1
  73. package/resources/v1/index.d.mts +1 -1
  74. package/resources/v1/index.d.ts +1 -1
  75. package/resources/v1/index.js +6 -6
  76. package/resources/v1/index.js.map +1 -1
  77. package/resources/v1/index.mjs +1 -1
  78. package/resources/v1/plans/entitlements.d.mts +360 -247
  79. package/resources/v1/plans/entitlements.d.mts.map +1 -1
  80. package/resources/v1/plans/entitlements.d.ts +360 -247
  81. package/resources/v1/plans/entitlements.d.ts.map +1 -1
  82. package/resources/v1/subscriptions/subscriptions.d.mts +142 -156
  83. package/resources/v1/subscriptions/subscriptions.d.mts.map +1 -1
  84. package/resources/v1/subscriptions/subscriptions.d.ts +142 -156
  85. package/resources/v1/subscriptions/subscriptions.d.ts.map +1 -1
  86. package/resources/v1/subscriptions/subscriptions.js.map +1 -1
  87. package/resources/v1/subscriptions/subscriptions.mjs.map +1 -1
  88. package/resources/v1/usage.d.mts +1 -1
  89. package/resources/v1/usage.d.mts.map +1 -1
  90. package/resources/v1/usage.d.ts +1 -1
  91. package/resources/v1/usage.d.ts.map +1 -1
  92. package/resources/v1/v1.d.mts +2 -2
  93. package/resources/v1/v1.d.mts.map +1 -1
  94. package/resources/v1/v1.d.ts +2 -2
  95. package/resources/v1/v1.d.ts.map +1 -1
  96. package/resources/v1/v1.js +2 -2
  97. package/resources/v1/v1.js.map +1 -1
  98. package/resources/v1/v1.mjs +2 -2
  99. package/resources/v1/v1.mjs.map +1 -1
  100. package/src/resources/v1/addons/entitlements.ts +431 -287
  101. package/src/resources/v1/coupons.ts +10 -0
  102. package/src/resources/v1/customers/customers.ts +20 -0
  103. package/src/resources/v1/events/credits/credits.ts +356 -0
  104. package/src/resources/v1/events/credits/grants.ts +795 -0
  105. package/src/resources/v1/events/credits/index.ts +20 -0
  106. package/src/resources/v1/events/credits.ts +3 -0
  107. package/src/resources/v1/events/events.ts +103 -0
  108. package/src/resources/v1/events/index.ts +13 -0
  109. package/src/resources/v1/events.ts +1 -75
  110. package/src/resources/v1/index.ts +1 -1
  111. package/src/resources/v1/plans/entitlements.ts +431 -287
  112. package/src/resources/v1/subscriptions/subscriptions.ts +166 -180
  113. package/src/resources/v1/usage.ts +1 -1
  114. package/src/resources/v1/v1.ts +2 -2
  115. package/src/version.ts +1 -1
  116. package/version.d.mts +1 -1
  117. package/version.d.ts +1 -1
  118. package/version.js +1 -1
  119. package/version.mjs +1 -1
@@ -24,39 +24,27 @@ export declare class Entitlements extends APIResource {
24
24
  */
25
25
  export interface AddonPackageEntitlement {
26
26
  /**
27
- * Feature or credit entitlement on an addon
27
+ * Feature entitlement response
28
28
  */
29
- data: AddonPackageEntitlement.Data;
29
+ data: AddonPackageEntitlement.Feature | AddonPackageEntitlement.Credit;
30
30
  }
31
31
  export declare namespace AddonPackageEntitlement {
32
32
  /**
33
- * Feature or credit entitlement on an addon
33
+ * Feature entitlement response
34
34
  */
35
- interface Data {
35
+ interface Feature {
36
36
  /**
37
37
  * Unique identifier of the entitlement
38
38
  */
39
39
  id: string;
40
- /**
41
- * Credit amount (for credit entitlements)
42
- */
43
- amount: number | null;
44
40
  /**
45
41
  * Entitlement behavior (Increment or Override)
46
42
  */
47
43
  behavior: 'Increment' | 'Override';
48
- /**
49
- * Credit grant cadence (for credit entitlements)
50
- */
51
- cadence: 'MONTH' | 'YEAR' | null;
52
44
  /**
53
45
  * Timestamp of when the record was created
54
46
  */
55
47
  createdAt: string;
56
- /**
57
- * Custom currency ID (for credit entitlements)
58
- */
59
- customCurrencyId: string | null;
60
48
  /**
61
49
  * Optional description of the entitlement
62
50
  */
@@ -69,10 +57,6 @@ export declare namespace AddonPackageEntitlement {
69
57
  * Allowed enum values (for feature entitlements)
70
58
  */
71
59
  enumValues: Array<string> | null;
72
- /**
73
- * Feature ID (for feature entitlements)
74
- */
75
- featureId: string | null;
76
60
  /**
77
61
  * Whether the usage limit is a soft limit (for feature entitlements)
78
62
  */
@@ -104,11 +88,11 @@ export declare namespace AddonPackageEntitlement {
104
88
  /**
105
89
  * Reset period configuration (for feature entitlements)
106
90
  */
107
- resetPeriodConfiguration: Data.YearlyResetPeriodConfig | Data.MonthlyResetPeriodConfig | Data.WeeklyResetPeriodConfig | null;
91
+ resetPeriodConfiguration: Feature.YearlyResetPeriodConfig | Feature.MonthlyResetPeriodConfig | Feature.WeeklyResetPeriodConfig | null;
108
92
  /**
109
93
  * Entitlement type (FEATURE or CREDIT)
110
94
  */
111
- type: 'FEATURE' | 'CREDIT';
95
+ type: 'FEATURE';
112
96
  /**
113
97
  * Timestamp of when the record was last updated
114
98
  */
@@ -118,7 +102,7 @@ export declare namespace AddonPackageEntitlement {
118
102
  */
119
103
  usageLimit: number | null;
120
104
  }
121
- namespace Data {
105
+ namespace Feature {
122
106
  /**
123
107
  * Yearly reset configuration
124
108
  */
@@ -147,18 +131,10 @@ export declare namespace AddonPackageEntitlement {
147
131
  accordingTo: 'SubscriptionStart' | 'EverySunday' | 'EveryMonday' | 'EveryTuesday' | 'EveryWednesday' | 'EveryThursday' | 'EveryFriday' | 'EverySaturday';
148
132
  }
149
133
  }
150
- }
151
- /**
152
- * Response object
153
- */
154
- export interface EntitlementCreateResponse {
155
- data: Array<EntitlementCreateResponse.Data>;
156
- }
157
- export declare namespace EntitlementCreateResponse {
158
134
  /**
159
- * Feature or credit entitlement on an addon
135
+ * Credit entitlement response
160
136
  */
161
- interface Data {
137
+ interface Credit {
162
138
  /**
163
139
  * Unique identifier of the entitlement
164
140
  */
@@ -180,9 +156,62 @@ export declare namespace EntitlementCreateResponse {
180
156
  */
181
157
  createdAt: string;
182
158
  /**
183
- * Custom currency ID (for credit entitlements)
159
+ * Optional description of the entitlement
160
+ */
161
+ description: string | null;
162
+ /**
163
+ * Override display name for the entitlement
164
+ */
165
+ displayNameOverride: string | null;
166
+ /**
167
+ * Widget types where this entitlement is hidden
168
+ */
169
+ hiddenFromWidgets: Array<'PAYWALL' | 'CUSTOMER_PORTAL' | 'CHECKOUT'>;
170
+ /**
171
+ * Whether this is a custom entitlement
172
+ */
173
+ isCustom: boolean | null;
174
+ /**
175
+ * Whether the entitlement is granted
176
+ */
177
+ isGranted: boolean;
178
+ /**
179
+ * Display order of the entitlement
180
+ */
181
+ order: number | null;
182
+ /**
183
+ * Entitlement type (FEATURE or CREDIT)
184
+ */
185
+ type: 'CREDIT';
186
+ /**
187
+ * Timestamp of when the record was last updated
188
+ */
189
+ updatedAt: string;
190
+ }
191
+ }
192
+ /**
193
+ * Response object
194
+ */
195
+ export interface EntitlementCreateResponse {
196
+ data: Array<EntitlementCreateResponse.Feature | EntitlementCreateResponse.Credit>;
197
+ }
198
+ export declare namespace EntitlementCreateResponse {
199
+ /**
200
+ * Feature entitlement response
201
+ */
202
+ interface Feature {
203
+ /**
204
+ * Unique identifier of the entitlement
205
+ */
206
+ id: string;
207
+ /**
208
+ * Entitlement behavior (Increment or Override)
184
209
  */
185
- customCurrencyId: string | null;
210
+ behavior: 'Increment' | 'Override';
211
+ /**
212
+ * Timestamp of when the record was created
213
+ */
214
+ createdAt: string;
186
215
  /**
187
216
  * Optional description of the entitlement
188
217
  */
@@ -195,10 +224,6 @@ export declare namespace EntitlementCreateResponse {
195
224
  * Allowed enum values (for feature entitlements)
196
225
  */
197
226
  enumValues: Array<string> | null;
198
- /**
199
- * Feature ID (for feature entitlements)
200
- */
201
- featureId: string | null;
202
227
  /**
203
228
  * Whether the usage limit is a soft limit (for feature entitlements)
204
229
  */
@@ -230,11 +255,11 @@ export declare namespace EntitlementCreateResponse {
230
255
  /**
231
256
  * Reset period configuration (for feature entitlements)
232
257
  */
233
- resetPeriodConfiguration: Data.YearlyResetPeriodConfig | Data.MonthlyResetPeriodConfig | Data.WeeklyResetPeriodConfig | null;
258
+ resetPeriodConfiguration: Feature.YearlyResetPeriodConfig | Feature.MonthlyResetPeriodConfig | Feature.WeeklyResetPeriodConfig | null;
234
259
  /**
235
260
  * Entitlement type (FEATURE or CREDIT)
236
261
  */
237
- type: 'FEATURE' | 'CREDIT';
262
+ type: 'FEATURE';
238
263
  /**
239
264
  * Timestamp of when the record was last updated
240
265
  */
@@ -244,7 +269,7 @@ export declare namespace EntitlementCreateResponse {
244
269
  */
245
270
  usageLimit: number | null;
246
271
  }
247
- namespace Data {
272
+ namespace Feature {
248
273
  /**
249
274
  * Yearly reset configuration
250
275
  */
@@ -273,12 +298,69 @@ export declare namespace EntitlementCreateResponse {
273
298
  accordingTo: 'SubscriptionStart' | 'EverySunday' | 'EveryMonday' | 'EveryTuesday' | 'EveryWednesday' | 'EveryThursday' | 'EveryFriday' | 'EverySaturday';
274
299
  }
275
300
  }
301
+ /**
302
+ * Credit entitlement response
303
+ */
304
+ interface Credit {
305
+ /**
306
+ * Unique identifier of the entitlement
307
+ */
308
+ id: string;
309
+ /**
310
+ * Credit amount (for credit entitlements)
311
+ */
312
+ amount: number | null;
313
+ /**
314
+ * Entitlement behavior (Increment or Override)
315
+ */
316
+ behavior: 'Increment' | 'Override';
317
+ /**
318
+ * Credit grant cadence (for credit entitlements)
319
+ */
320
+ cadence: 'MONTH' | 'YEAR' | null;
321
+ /**
322
+ * Timestamp of when the record was created
323
+ */
324
+ createdAt: string;
325
+ /**
326
+ * Optional description of the entitlement
327
+ */
328
+ description: string | null;
329
+ /**
330
+ * Override display name for the entitlement
331
+ */
332
+ displayNameOverride: string | null;
333
+ /**
334
+ * Widget types where this entitlement is hidden
335
+ */
336
+ hiddenFromWidgets: Array<'PAYWALL' | 'CUSTOMER_PORTAL' | 'CHECKOUT'>;
337
+ /**
338
+ * Whether this is a custom entitlement
339
+ */
340
+ isCustom: boolean | null;
341
+ /**
342
+ * Whether the entitlement is granted
343
+ */
344
+ isGranted: boolean;
345
+ /**
346
+ * Display order of the entitlement
347
+ */
348
+ order: number | null;
349
+ /**
350
+ * Entitlement type (FEATURE or CREDIT)
351
+ */
352
+ type: 'CREDIT';
353
+ /**
354
+ * Timestamp of when the record was last updated
355
+ */
356
+ updatedAt: string;
357
+ }
276
358
  }
277
359
  /**
278
360
  * Response list object
279
361
  */
280
362
  export interface EntitlementListResponse {
281
- data: Array<EntitlementListResponse.Data>;
363
+ data: Array<EntitlementListResponse.Feature | EntitlementListResponse.Credit>;
282
364
  /**
283
365
  * Pagination metadata including cursors for navigating through results
284
366
  */
@@ -286,33 +368,21 @@ export interface EntitlementListResponse {
286
368
  }
287
369
  export declare namespace EntitlementListResponse {
288
370
  /**
289
- * Feature or credit entitlement on an addon
371
+ * Feature entitlement response
290
372
  */
291
- interface Data {
373
+ interface Feature {
292
374
  /**
293
375
  * Unique identifier of the entitlement
294
376
  */
295
377
  id: string;
296
- /**
297
- * Credit amount (for credit entitlements)
298
- */
299
- amount: number | null;
300
378
  /**
301
379
  * Entitlement behavior (Increment or Override)
302
380
  */
303
381
  behavior: 'Increment' | 'Override';
304
- /**
305
- * Credit grant cadence (for credit entitlements)
306
- */
307
- cadence: 'MONTH' | 'YEAR' | null;
308
382
  /**
309
383
  * Timestamp of when the record was created
310
384
  */
311
385
  createdAt: string;
312
- /**
313
- * Custom currency ID (for credit entitlements)
314
- */
315
- customCurrencyId: string | null;
316
386
  /**
317
387
  * Optional description of the entitlement
318
388
  */
@@ -325,10 +395,6 @@ export declare namespace EntitlementListResponse {
325
395
  * Allowed enum values (for feature entitlements)
326
396
  */
327
397
  enumValues: Array<string> | null;
328
- /**
329
- * Feature ID (for feature entitlements)
330
- */
331
- featureId: string | null;
332
398
  /**
333
399
  * Whether the usage limit is a soft limit (for feature entitlements)
334
400
  */
@@ -360,11 +426,11 @@ export declare namespace EntitlementListResponse {
360
426
  /**
361
427
  * Reset period configuration (for feature entitlements)
362
428
  */
363
- resetPeriodConfiguration: Data.YearlyResetPeriodConfig | Data.MonthlyResetPeriodConfig | Data.WeeklyResetPeriodConfig | null;
429
+ resetPeriodConfiguration: Feature.YearlyResetPeriodConfig | Feature.MonthlyResetPeriodConfig | Feature.WeeklyResetPeriodConfig | null;
364
430
  /**
365
431
  * Entitlement type (FEATURE or CREDIT)
366
432
  */
367
- type: 'FEATURE' | 'CREDIT';
433
+ type: 'FEATURE';
368
434
  /**
369
435
  * Timestamp of when the record was last updated
370
436
  */
@@ -374,7 +440,7 @@ export declare namespace EntitlementListResponse {
374
440
  */
375
441
  usageLimit: number | null;
376
442
  }
377
- namespace Data {
443
+ namespace Feature {
378
444
  /**
379
445
  * Yearly reset configuration
380
446
  */
@@ -403,6 +469,63 @@ export declare namespace EntitlementListResponse {
403
469
  accordingTo: 'SubscriptionStart' | 'EverySunday' | 'EveryMonday' | 'EveryTuesday' | 'EveryWednesday' | 'EveryThursday' | 'EveryFriday' | 'EverySaturday';
404
470
  }
405
471
  }
472
+ /**
473
+ * Credit entitlement response
474
+ */
475
+ interface Credit {
476
+ /**
477
+ * Unique identifier of the entitlement
478
+ */
479
+ id: string;
480
+ /**
481
+ * Credit amount (for credit entitlements)
482
+ */
483
+ amount: number | null;
484
+ /**
485
+ * Entitlement behavior (Increment or Override)
486
+ */
487
+ behavior: 'Increment' | 'Override';
488
+ /**
489
+ * Credit grant cadence (for credit entitlements)
490
+ */
491
+ cadence: 'MONTH' | 'YEAR' | null;
492
+ /**
493
+ * Timestamp of when the record was created
494
+ */
495
+ createdAt: string;
496
+ /**
497
+ * Optional description of the entitlement
498
+ */
499
+ description: string | null;
500
+ /**
501
+ * Override display name for the entitlement
502
+ */
503
+ displayNameOverride: string | null;
504
+ /**
505
+ * Widget types where this entitlement is hidden
506
+ */
507
+ hiddenFromWidgets: Array<'PAYWALL' | 'CUSTOMER_PORTAL' | 'CHECKOUT'>;
508
+ /**
509
+ * Whether this is a custom entitlement
510
+ */
511
+ isCustom: boolean | null;
512
+ /**
513
+ * Whether the entitlement is granted
514
+ */
515
+ isGranted: boolean;
516
+ /**
517
+ * Display order of the entitlement
518
+ */
519
+ order: number | null;
520
+ /**
521
+ * Entitlement type (FEATURE or CREDIT)
522
+ */
523
+ type: 'CREDIT';
524
+ /**
525
+ * Timestamp of when the record was last updated
526
+ */
527
+ updatedAt: string;
528
+ }
406
529
  /**
407
530
  * Pagination metadata including cursors for navigating through results
408
531
  */
@@ -422,199 +545,135 @@ export interface EntitlementCreateParams {
422
545
  /**
423
546
  * Entitlements to create
424
547
  */
425
- entitlements: Array<EntitlementCreateParams.Entitlement>;
548
+ entitlements: Array<EntitlementCreateParams.Feature | EntitlementCreateParams.Credit>;
426
549
  }
427
550
  export declare namespace EntitlementCreateParams {
428
551
  /**
429
- * A single entitlement to create. Provide exactly one of feature or credit.
552
+ * Request to create a feature entitlement
430
553
  */
431
- interface Entitlement {
554
+ interface Feature {
555
+ /**
556
+ * The feature ID to attach the entitlement to
557
+ */
558
+ id: string;
559
+ /**
560
+ * CreateFeatureEntitlementRequest
561
+ */
562
+ type: 'FEATURE';
432
563
  /**
433
- * Credit entitlement to create
564
+ * Entitlement behavior (Increment or Override)
565
+ */
566
+ behavior?: 'Increment' | 'Override';
567
+ /**
568
+ * Description of the entitlement
569
+ */
570
+ description?: string;
571
+ /**
572
+ * Override display name for the entitlement
573
+ */
574
+ displayNameOverride?: string;
575
+ /**
576
+ * Allowed enum values for the feature entitlement
577
+ */
578
+ enumValues?: Array<string>;
579
+ /**
580
+ * Whether the usage limit is a soft limit
581
+ */
582
+ hasSoftLimit?: boolean;
583
+ /**
584
+ * Whether usage is unlimited
585
+ */
586
+ hasUnlimitedUsage?: boolean;
587
+ /**
588
+ * Widget types where this entitlement is hidden
589
+ */
590
+ hiddenFromWidgets?: Array<'PAYWALL' | 'CUSTOMER_PORTAL' | 'CHECKOUT'>;
591
+ /**
592
+ * Whether this is a custom entitlement
593
+ */
594
+ isCustom?: boolean;
595
+ /**
596
+ * Whether the entitlement is granted
597
+ */
598
+ isGranted?: boolean;
599
+ /**
600
+ * Configuration for monthly reset period
601
+ */
602
+ monthlyResetPeriodConfiguration?: Feature.MonthlyResetPeriodConfiguration | null;
603
+ /**
604
+ * Display order of the entitlement
605
+ */
606
+ order?: number;
607
+ /**
608
+ * Period at which usage resets
609
+ */
610
+ resetPeriod?: 'YEAR' | 'MONTH' | 'WEEK' | 'DAY' | 'HOUR';
611
+ /**
612
+ * Maximum allowed usage for the feature
613
+ */
614
+ usageLimit?: number | null;
615
+ /**
616
+ * Configuration for weekly reset period
434
617
  */
435
- credit?: Entitlement.Credit;
618
+ weeklyResetPeriodConfiguration?: Feature.WeeklyResetPeriodConfiguration | null;
436
619
  /**
437
- * Feature entitlement to create
620
+ * Configuration for yearly reset period
438
621
  */
439
- feature?: Entitlement.Feature;
622
+ yearlyResetPeriodConfiguration?: Feature.YearlyResetPeriodConfiguration | null;
440
623
  }
441
- namespace Entitlement {
624
+ namespace Feature {
442
625
  /**
443
- * Credit entitlement to create
626
+ * Configuration for monthly reset period
444
627
  */
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;
628
+ interface MonthlyResetPeriodConfiguration {
482
629
  /**
483
- * Display order of the entitlement
630
+ * Reset anchor (SubscriptionStart or StartOfTheMonth)
484
631
  */
485
- order?: number;
632
+ accordingTo: 'SubscriptionStart' | 'StartOfTheMonth';
486
633
  }
487
634
  /**
488
- * Feature entitlement to create
635
+ * Configuration for weekly reset period
489
636
  */
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;
637
+ interface WeeklyResetPeriodConfiguration {
551
638
  /**
552
- * Configuration for yearly reset period
639
+ * Reset anchor (SubscriptionStart or specific day)
553
640
  */
554
- yearlyResetPeriodConfiguration?: Feature.YearlyResetPeriodConfiguration | null;
641
+ accordingTo: 'SubscriptionStart' | 'EverySunday' | 'EveryMonday' | 'EveryTuesday' | 'EveryWednesday' | 'EveryThursday' | 'EveryFriday' | 'EverySaturday';
555
642
  }
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
- }
643
+ /**
644
+ * Configuration for yearly reset period
645
+ */
646
+ interface YearlyResetPeriodConfiguration {
575
647
  /**
576
- * Configuration for yearly reset period
648
+ * Reset anchor (SubscriptionStart)
577
649
  */
578
- interface YearlyResetPeriodConfiguration {
579
- /**
580
- * Reset anchor (SubscriptionStart)
581
- */
582
- accordingTo: 'SubscriptionStart';
583
- }
650
+ accordingTo: 'SubscriptionStart';
584
651
  }
585
652
  }
586
- }
587
- export interface EntitlementUpdateParams {
588
- /**
589
- * Path param: The addon ID
590
- */
591
- addonId: 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
653
  /**
603
- * Credit entitlement fields to update
654
+ * Request to create a credit entitlement
604
655
  */
605
656
  interface Credit {
606
657
  /**
607
- * Credit grant amount
658
+ * The custom currency ID for the credit entitlement
608
659
  */
609
- amount?: number;
660
+ id: string;
610
661
  /**
611
- * Entitlement behavior (Increment or Override)
662
+ * Credit grant amount
612
663
  */
613
- behavior?: 'Increment' | 'Override';
664
+ amount: number | null;
614
665
  /**
615
666
  * Credit grant cadence (MONTH or YEAR)
616
667
  */
617
- cadence?: 'MONTH' | 'YEAR';
668
+ cadence: 'MONTH' | 'YEAR';
669
+ /**
670
+ * CreateCreditEntitlementRequest
671
+ */
672
+ type: 'CREDIT';
673
+ /**
674
+ * Entitlement behavior (Increment or Override)
675
+ */
676
+ behavior?: 'Increment' | 'Override';
618
677
  /**
619
678
  * Description of the entitlement
620
679
  */
@@ -640,72 +699,80 @@ export declare namespace EntitlementUpdateParams {
640
699
  */
641
700
  order?: number;
642
701
  }
643
- /**
644
- * Feature entitlement fields to update
645
- */
646
- interface Feature {
702
+ }
703
+ export type EntitlementUpdateParams = EntitlementUpdateParams.UpdateFeatureEntitlementRequest | EntitlementUpdateParams.UpdateCreditEntitlementRequest;
704
+ export declare namespace EntitlementUpdateParams {
705
+ interface UpdateFeatureEntitlementRequest {
647
706
  /**
648
- * Entitlement behavior (Increment or Override)
707
+ * Path param: The addon ID
708
+ */
709
+ addonId: string;
710
+ /**
711
+ * Body param: UpdateFeatureEntitlementRequest
712
+ */
713
+ type: 'FEATURE';
714
+ /**
715
+ * Body param: Entitlement behavior (Increment or Override)
649
716
  */
650
717
  behavior?: 'Increment' | 'Override';
651
718
  /**
652
- * Description of the entitlement
719
+ * Body param: Description of the entitlement
653
720
  */
654
721
  description?: string;
655
722
  /**
656
- * Override display name for the entitlement
723
+ * Body param: Override display name for the entitlement
657
724
  */
658
725
  displayNameOverride?: string;
659
726
  /**
660
- * Allowed enum values for the feature entitlement
727
+ * Body param: Allowed enum values for the feature entitlement
661
728
  */
662
729
  enumValues?: Array<string>;
663
730
  /**
664
- * Whether the usage limit is a soft limit
731
+ * Body param: Whether the usage limit is a soft limit
665
732
  */
666
733
  hasSoftLimit?: boolean;
667
734
  /**
668
- * Whether usage is unlimited
735
+ * Body param: Whether usage is unlimited
669
736
  */
670
737
  hasUnlimitedUsage?: boolean;
671
738
  /**
672
- * Widget types where this entitlement is hidden
739
+ * Body param: Widget types where this entitlement is hidden
673
740
  */
674
741
  hiddenFromWidgets?: Array<'PAYWALL' | 'CUSTOMER_PORTAL' | 'CHECKOUT'>;
675
742
  /**
676
- * Whether this is a custom entitlement
743
+ * Body param: Whether this is a custom entitlement
677
744
  */
678
745
  isCustom?: boolean;
679
746
  /**
680
- * Whether the entitlement is granted
747
+ * Body param: Whether the entitlement is granted
681
748
  */
682
749
  isGranted?: boolean;
683
750
  /**
684
- * Configuration for monthly reset period
751
+ * Body param: Configuration for monthly reset period
685
752
  */
686
- monthlyResetPeriodConfiguration?: Feature.MonthlyResetPeriodConfiguration | null;
753
+ monthlyResetPeriodConfiguration?: UpdateFeatureEntitlementRequest.MonthlyResetPeriodConfiguration | null;
687
754
  /**
688
- * Display order of the entitlement
755
+ * Body param: Display order of the entitlement
689
756
  */
690
757
  order?: number;
691
758
  /**
692
- * Period at which usage resets
759
+ * Body param: Period at which usage resets
693
760
  */
694
761
  resetPeriod?: 'YEAR' | 'MONTH' | 'WEEK' | 'DAY' | 'HOUR';
695
762
  /**
696
- * Maximum allowed usage for the feature
763
+ * Body param: Maximum allowed usage for the feature
697
764
  */
698
765
  usageLimit?: number | null;
699
766
  /**
700
- * Configuration for weekly reset period
767
+ * Body param: Configuration for weekly reset period
701
768
  */
702
- weeklyResetPeriodConfiguration?: Feature.WeeklyResetPeriodConfiguration | null;
769
+ weeklyResetPeriodConfiguration?: UpdateFeatureEntitlementRequest.WeeklyResetPeriodConfiguration | null;
703
770
  /**
704
- * Configuration for yearly reset period
771
+ * Body param: Configuration for yearly reset period
705
772
  */
706
- yearlyResetPeriodConfiguration?: Feature.YearlyResetPeriodConfiguration | null;
773
+ yearlyResetPeriodConfiguration?: UpdateFeatureEntitlementRequest.YearlyResetPeriodConfiguration | null;
707
774
  }
708
- namespace Feature {
775
+ namespace UpdateFeatureEntitlementRequest {
709
776
  /**
710
777
  * Configuration for monthly reset period
711
778
  */
@@ -734,6 +801,52 @@ export declare namespace EntitlementUpdateParams {
734
801
  accordingTo: 'SubscriptionStart';
735
802
  }
736
803
  }
804
+ interface UpdateCreditEntitlementRequest {
805
+ /**
806
+ * Path param: The addon ID
807
+ */
808
+ addonId: string;
809
+ /**
810
+ * Body param: UpdateCreditEntitlementRequest
811
+ */
812
+ type: 'CREDIT';
813
+ /**
814
+ * Body param: Credit grant amount
815
+ */
816
+ amount?: number;
817
+ /**
818
+ * Body param: Entitlement behavior (Increment or Override)
819
+ */
820
+ behavior?: 'Increment' | 'Override';
821
+ /**
822
+ * Body param: Credit grant cadence (MONTH or YEAR)
823
+ */
824
+ cadence?: 'MONTH' | 'YEAR';
825
+ /**
826
+ * Body param: Description of the entitlement
827
+ */
828
+ description?: string;
829
+ /**
830
+ * Body param: Override display name for the entitlement
831
+ */
832
+ displayNameOverride?: string;
833
+ /**
834
+ * Body param: Widget types where this entitlement is hidden
835
+ */
836
+ hiddenFromWidgets?: Array<'PAYWALL' | 'CUSTOMER_PORTAL' | 'CHECKOUT'>;
837
+ /**
838
+ * Body param: Whether this is a custom entitlement
839
+ */
840
+ isCustom?: boolean;
841
+ /**
842
+ * Body param: Whether the entitlement is granted
843
+ */
844
+ isGranted?: boolean;
845
+ /**
846
+ * Body param: Display order of the entitlement
847
+ */
848
+ order?: number;
849
+ }
737
850
  }
738
851
  export interface EntitlementDeleteParams {
739
852
  /**