@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
@@ -29,11 +29,11 @@ export class Products extends APIResource {
29
29
  * Duplicates an existing product, including its plans, addons, and configuration.
30
30
  */
31
31
  duplicateProduct(
32
- pathID: string,
32
+ id: string,
33
33
  body: ProductDuplicateProductParams,
34
34
  options?: RequestOptions,
35
35
  ): APIPromise<Product> {
36
- return this._client.post(path`/api/v1/products/${pathID}/duplicate`, { body, ...options });
36
+ return this._client.post(path`/api/v1/products/${id}/duplicate`, { body, ...options });
37
37
  }
38
38
 
39
39
  /**
@@ -286,7 +286,7 @@ export interface ProductDuplicateProductParams {
286
286
  /**
287
287
  * The unique identifier for the entity
288
288
  */
289
- body_id: string;
289
+ id: string;
290
290
 
291
291
  /**
292
292
  * Description of the product
@@ -3900,6 +3900,8 @@ export interface SubscriptionUpdateParams {
3900
3900
 
3901
3901
  charges?: Array<SubscriptionUpdateParams.Charge>;
3902
3902
 
3903
+ entitlements?: Array<SubscriptionUpdateParams.Feature | SubscriptionUpdateParams.Credit>;
3904
+
3903
3905
  /**
3904
3906
  * Additional metadata for the subscription
3905
3907
  */
@@ -3916,8 +3918,6 @@ export interface SubscriptionUpdateParams {
3916
3918
 
3917
3919
  scheduleStrategy?: 'END_OF_BILLING_PERIOD' | 'END_OF_BILLING_MONTH' | 'IMMEDIATE';
3918
3920
 
3919
- subscriptionEntitlements?: Array<SubscriptionUpdateParams.SubscriptionEntitlement>;
3920
-
3921
3921
  /**
3922
3922
  * Subscription trial end date
3923
3923
  */
@@ -4204,6 +4204,121 @@ export namespace SubscriptionUpdateParams {
4204
4204
  type: 'FEATURE' | 'CREDIT';
4205
4205
  }
4206
4206
 
4207
+ /**
4208
+ * Feature entitlement configuration for a subscription
4209
+ */
4210
+ export interface Feature {
4211
+ /**
4212
+ * The feature ID to attach the entitlement to
4213
+ */
4214
+ id: string;
4215
+
4216
+ /**
4217
+ * SubscriptionFeatureEntitlementRequest
4218
+ */
4219
+ type: 'FEATURE';
4220
+
4221
+ /**
4222
+ * Whether the usage limit is a soft limit
4223
+ */
4224
+ hasSoftLimit?: boolean;
4225
+
4226
+ /**
4227
+ * Whether usage is unlimited
4228
+ */
4229
+ hasUnlimitedUsage?: boolean;
4230
+
4231
+ /**
4232
+ * Configuration for monthly reset period
4233
+ */
4234
+ monthlyResetPeriodConfiguration?: Feature.MonthlyResetPeriodConfiguration | null;
4235
+
4236
+ /**
4237
+ * Period at which usage resets
4238
+ */
4239
+ resetPeriod?: 'YEAR' | 'MONTH' | 'WEEK' | 'DAY' | 'HOUR';
4240
+
4241
+ /**
4242
+ * Maximum allowed usage for the feature
4243
+ */
4244
+ usageLimit?: number;
4245
+
4246
+ /**
4247
+ * Configuration for weekly reset period
4248
+ */
4249
+ weeklyResetPeriodConfiguration?: Feature.WeeklyResetPeriodConfiguration | null;
4250
+
4251
+ /**
4252
+ * Configuration for yearly reset period
4253
+ */
4254
+ yearlyResetPeriodConfiguration?: Feature.YearlyResetPeriodConfiguration | null;
4255
+ }
4256
+
4257
+ export namespace Feature {
4258
+ /**
4259
+ * Configuration for monthly reset period
4260
+ */
4261
+ export interface MonthlyResetPeriodConfiguration {
4262
+ /**
4263
+ * Reset anchor (SubscriptionStart or StartOfTheMonth)
4264
+ */
4265
+ accordingTo: 'SubscriptionStart' | 'StartOfTheMonth';
4266
+ }
4267
+
4268
+ /**
4269
+ * Configuration for weekly reset period
4270
+ */
4271
+ export interface WeeklyResetPeriodConfiguration {
4272
+ /**
4273
+ * Reset anchor (SubscriptionStart or specific day)
4274
+ */
4275
+ accordingTo:
4276
+ | 'SubscriptionStart'
4277
+ | 'EverySunday'
4278
+ | 'EveryMonday'
4279
+ | 'EveryTuesday'
4280
+ | 'EveryWednesday'
4281
+ | 'EveryThursday'
4282
+ | 'EveryFriday'
4283
+ | 'EverySaturday';
4284
+ }
4285
+
4286
+ /**
4287
+ * Configuration for yearly reset period
4288
+ */
4289
+ export interface YearlyResetPeriodConfiguration {
4290
+ /**
4291
+ * Reset anchor (SubscriptionStart)
4292
+ */
4293
+ accordingTo: 'SubscriptionStart';
4294
+ }
4295
+ }
4296
+
4297
+ /**
4298
+ * Credit entitlement configuration for a subscription
4299
+ */
4300
+ export interface Credit {
4301
+ /**
4302
+ * The custom currency ID for the credit entitlement
4303
+ */
4304
+ id: string;
4305
+
4306
+ /**
4307
+ * Credit grant amount
4308
+ */
4309
+ amount: number;
4310
+
4311
+ /**
4312
+ * Credit grant cadence (MONTH or YEAR)
4313
+ */
4314
+ cadence: 'MONTH' | 'YEAR';
4315
+
4316
+ /**
4317
+ * SubscriptionCreditEntitlementRequest
4318
+ */
4319
+ type: 'CREDIT';
4320
+ }
4321
+
4207
4322
  /**
4208
4323
  * Minimum spend amount
4209
4324
  */
@@ -4482,48 +4597,6 @@ export namespace SubscriptionUpdateParams {
4482
4597
  */
4483
4598
  featureId?: string;
4484
4599
  }
4485
-
4486
- export interface SubscriptionEntitlement {
4487
- id?: string;
4488
-
4489
- featureId?: string;
4490
-
4491
- hasSoftLimit?: boolean;
4492
-
4493
- hasUnlimitedUsage?: boolean;
4494
-
4495
- monthlyResetPeriodConfiguration?: SubscriptionEntitlement.MonthlyResetPeriodConfiguration;
4496
-
4497
- resetPeriod?: 'YEAR' | 'MONTH' | 'WEEK' | 'DAY' | 'HOUR';
4498
-
4499
- usageLimit?: number;
4500
-
4501
- weeklyResetPeriodConfiguration?: SubscriptionEntitlement.WeeklyResetPeriodConfiguration;
4502
-
4503
- yearlyResetPeriodConfiguration?: SubscriptionEntitlement.YearlyResetPeriodConfiguration;
4504
- }
4505
-
4506
- export namespace SubscriptionEntitlement {
4507
- export interface MonthlyResetPeriodConfiguration {
4508
- accordingTo: 'SubscriptionStart' | 'StartOfTheMonth';
4509
- }
4510
-
4511
- export interface WeeklyResetPeriodConfiguration {
4512
- accordingTo:
4513
- | 'SubscriptionStart'
4514
- | 'EverySunday'
4515
- | 'EveryMonday'
4516
- | 'EveryTuesday'
4517
- | 'EveryWednesday'
4518
- | 'EveryThursday'
4519
- | 'EveryFriday'
4520
- | 'EverySaturday';
4521
- }
4522
-
4523
- export interface YearlyResetPeriodConfiguration {
4524
- accordingTo: 'SubscriptionStart';
4525
- }
4526
- }
4527
4600
  }
4528
4601
 
4529
4602
  export interface SubscriptionListParams extends MyCursorIDPageParams {
@@ -5235,6 +5308,8 @@ export interface SubscriptionProvisionParams {
5235
5308
  */
5236
5309
  checkoutOptions?: SubscriptionProvisionParams.CheckoutOptions;
5237
5310
 
5311
+ entitlements?: Array<SubscriptionProvisionParams.Feature | SubscriptionProvisionParams.Credit>;
5312
+
5238
5313
  /**
5239
5314
  * Additional metadata for the subscription
5240
5315
  */
@@ -5277,8 +5352,6 @@ export interface SubscriptionProvisionParams {
5277
5352
  */
5278
5353
  startDate?: string;
5279
5354
 
5280
- subscriptionEntitlements?: Array<SubscriptionProvisionParams.SubscriptionEntitlement>;
5281
-
5282
5355
  /**
5283
5356
  * Trial period override settings
5284
5357
  */
@@ -5665,6 +5738,121 @@ export namespace SubscriptionProvisionParams {
5665
5738
  referenceId?: string | null;
5666
5739
  }
5667
5740
 
5741
+ /**
5742
+ * Feature entitlement configuration for a subscription
5743
+ */
5744
+ export interface Feature {
5745
+ /**
5746
+ * The feature ID to attach the entitlement to
5747
+ */
5748
+ id: string;
5749
+
5750
+ /**
5751
+ * SubscriptionFeatureEntitlementRequest
5752
+ */
5753
+ type: 'FEATURE';
5754
+
5755
+ /**
5756
+ * Whether the usage limit is a soft limit
5757
+ */
5758
+ hasSoftLimit?: boolean;
5759
+
5760
+ /**
5761
+ * Whether usage is unlimited
5762
+ */
5763
+ hasUnlimitedUsage?: boolean;
5764
+
5765
+ /**
5766
+ * Configuration for monthly reset period
5767
+ */
5768
+ monthlyResetPeriodConfiguration?: Feature.MonthlyResetPeriodConfiguration | null;
5769
+
5770
+ /**
5771
+ * Period at which usage resets
5772
+ */
5773
+ resetPeriod?: 'YEAR' | 'MONTH' | 'WEEK' | 'DAY' | 'HOUR';
5774
+
5775
+ /**
5776
+ * Maximum allowed usage for the feature
5777
+ */
5778
+ usageLimit?: number;
5779
+
5780
+ /**
5781
+ * Configuration for weekly reset period
5782
+ */
5783
+ weeklyResetPeriodConfiguration?: Feature.WeeklyResetPeriodConfiguration | null;
5784
+
5785
+ /**
5786
+ * Configuration for yearly reset period
5787
+ */
5788
+ yearlyResetPeriodConfiguration?: Feature.YearlyResetPeriodConfiguration | null;
5789
+ }
5790
+
5791
+ export namespace Feature {
5792
+ /**
5793
+ * Configuration for monthly reset period
5794
+ */
5795
+ export interface MonthlyResetPeriodConfiguration {
5796
+ /**
5797
+ * Reset anchor (SubscriptionStart or StartOfTheMonth)
5798
+ */
5799
+ accordingTo: 'SubscriptionStart' | 'StartOfTheMonth';
5800
+ }
5801
+
5802
+ /**
5803
+ * Configuration for weekly reset period
5804
+ */
5805
+ export interface WeeklyResetPeriodConfiguration {
5806
+ /**
5807
+ * Reset anchor (SubscriptionStart or specific day)
5808
+ */
5809
+ accordingTo:
5810
+ | 'SubscriptionStart'
5811
+ | 'EverySunday'
5812
+ | 'EveryMonday'
5813
+ | 'EveryTuesday'
5814
+ | 'EveryWednesday'
5815
+ | 'EveryThursday'
5816
+ | 'EveryFriday'
5817
+ | 'EverySaturday';
5818
+ }
5819
+
5820
+ /**
5821
+ * Configuration for yearly reset period
5822
+ */
5823
+ export interface YearlyResetPeriodConfiguration {
5824
+ /**
5825
+ * Reset anchor (SubscriptionStart)
5826
+ */
5827
+ accordingTo: 'SubscriptionStart';
5828
+ }
5829
+ }
5830
+
5831
+ /**
5832
+ * Credit entitlement configuration for a subscription
5833
+ */
5834
+ export interface Credit {
5835
+ /**
5836
+ * The custom currency ID for the credit entitlement
5837
+ */
5838
+ id: string;
5839
+
5840
+ /**
5841
+ * Credit grant amount
5842
+ */
5843
+ amount: number;
5844
+
5845
+ /**
5846
+ * Credit grant cadence (MONTH or YEAR)
5847
+ */
5848
+ cadence: 'MONTH' | 'YEAR';
5849
+
5850
+ /**
5851
+ * SubscriptionCreditEntitlementRequest
5852
+ */
5853
+ type: 'CREDIT';
5854
+ }
5855
+
5668
5856
  /**
5669
5857
  * Minimum spend amount
5670
5858
  */
@@ -6258,17 +6446,6 @@ export namespace SubscriptionProvisionParams {
6258
6446
  }
6259
6447
  }
6260
6448
 
6261
- export interface SubscriptionEntitlement {
6262
- /**
6263
- * Feature ID
6264
- */
6265
- featureId: string;
6266
-
6267
- usageLimit: number;
6268
-
6269
- isGranted?: boolean;
6270
- }
6271
-
6272
6449
  /**
6273
6450
  * Trial period override settings
6274
6451
  */
@@ -226,7 +226,7 @@ export interface UsageHistoryParams {
226
226
  * Query param: When true, includes usage data from the most recent cancelled or
227
227
  * expired subscription
228
228
  */
229
- includeHistoricalUsage?: boolean;
229
+ includeInactiveSubscriptions?: boolean;
230
230
 
231
231
  /**
232
232
  * Query param: Resource id
@@ -11,8 +11,6 @@ import {
11
11
  CouponUpdateCouponParams,
12
12
  Coupons,
13
13
  } from './coupons';
14
- import * as EventsAPI from './events';
15
- import { EventReportParams, EventReportResponse, Events } from './events';
16
14
  import * as FeaturesAPI from './features';
17
15
  import {
18
16
  Feature,
@@ -73,6 +71,8 @@ import {
73
71
  CustomerUpdateParams,
74
72
  Customers,
75
73
  } from './customers/customers';
74
+ import * as EventsAPI from './events/events';
75
+ import { EventReportParams, EventReportResponse, Events } from './events/events';
76
76
  import * as PlansAPI from './plans/plans';
77
77
  import {
78
78
  Plan,
package/src/version.ts CHANGED
@@ -1 +1 @@
1
- export const VERSION = '0.1.0-alpha.17'; // x-release-please-version
1
+ export const VERSION = '0.1.0-alpha.19'; // x-release-please-version
package/version.d.mts CHANGED
@@ -1,2 +1,2 @@
1
- export declare const VERSION = "0.1.0-alpha.17";
1
+ export declare const VERSION = "0.1.0-alpha.19";
2
2
  //# sourceMappingURL=version.d.mts.map
package/version.d.ts CHANGED
@@ -1,2 +1,2 @@
1
- export declare const VERSION = "0.1.0-alpha.17";
1
+ export declare const VERSION = "0.1.0-alpha.19";
2
2
  //# sourceMappingURL=version.d.ts.map
package/version.js CHANGED
@@ -1,5 +1,5 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.VERSION = void 0;
4
- exports.VERSION = '0.1.0-alpha.17'; // x-release-please-version
4
+ exports.VERSION = '0.1.0-alpha.19'; // x-release-please-version
5
5
  //# sourceMappingURL=version.js.map
package/version.mjs CHANGED
@@ -1,2 +1,2 @@
1
- export const VERSION = '0.1.0-alpha.17'; // x-release-please-version
1
+ export const VERSION = '0.1.0-alpha.19'; // x-release-please-version
2
2
  //# sourceMappingURL=version.mjs.map