@stigg/typescript 0.1.0-beta.54 → 0.1.0-beta.56

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 (97) hide show
  1. package/CHANGELOG.md +15 -0
  2. package/package.json +1 -1
  3. package/resources/v1/addons/addons.d.mts +30 -13
  4. package/resources/v1/addons/addons.d.mts.map +1 -1
  5. package/resources/v1/addons/addons.d.ts +30 -13
  6. package/resources/v1/addons/addons.d.ts.map +1 -1
  7. package/resources/v1/addons/addons.js +5 -1
  8. package/resources/v1/addons/addons.js.map +1 -1
  9. package/resources/v1/addons/addons.mjs +5 -1
  10. package/resources/v1/addons/addons.mjs.map +1 -1
  11. package/resources/v1/contracts.d.mts +35 -4
  12. package/resources/v1/contracts.d.mts.map +1 -1
  13. package/resources/v1/contracts.d.ts +35 -4
  14. package/resources/v1/contracts.d.ts.map +1 -1
  15. package/resources/v1/coupons.d.mts +18 -9
  16. package/resources/v1/coupons.d.mts.map +1 -1
  17. package/resources/v1/coupons.d.ts +18 -9
  18. package/resources/v1/coupons.d.ts.map +1 -1
  19. package/resources/v1/credits/grants.d.mts +51 -14
  20. package/resources/v1/credits/grants.d.mts.map +1 -1
  21. package/resources/v1/credits/grants.d.ts +51 -14
  22. package/resources/v1/credits/grants.d.ts.map +1 -1
  23. package/resources/v1/customers/customers.d.mts +119 -49
  24. package/resources/v1/customers/customers.d.mts.map +1 -1
  25. package/resources/v1/customers/customers.d.ts +119 -49
  26. package/resources/v1/customers/customers.d.ts.map +1 -1
  27. package/resources/v1/customers/customers.js +12 -12
  28. package/resources/v1/customers/customers.js.map +1 -1
  29. package/resources/v1/customers/customers.mjs +12 -12
  30. package/resources/v1/customers/customers.mjs.map +1 -1
  31. package/resources/v1/customers/integrations.d.mts +17 -8
  32. package/resources/v1/customers/integrations.d.mts.map +1 -1
  33. package/resources/v1/customers/integrations.d.ts +17 -8
  34. package/resources/v1/customers/integrations.d.ts.map +1 -1
  35. package/resources/v1/customers/payment-method.d.mts +7 -3
  36. package/resources/v1/customers/payment-method.d.mts.map +1 -1
  37. package/resources/v1/customers/payment-method.d.ts +7 -3
  38. package/resources/v1/customers/payment-method.d.ts.map +1 -1
  39. package/resources/v1/customers/promotional-entitlements.d.mts +23 -5
  40. package/resources/v1/customers/promotional-entitlements.d.mts.map +1 -1
  41. package/resources/v1/customers/promotional-entitlements.d.ts +23 -5
  42. package/resources/v1/customers/promotional-entitlements.d.ts.map +1 -1
  43. package/resources/v1/events/events.d.mts +13 -5
  44. package/resources/v1/events/events.d.mts.map +1 -1
  45. package/resources/v1/events/events.d.ts +13 -5
  46. package/resources/v1/events/events.d.ts.map +1 -1
  47. package/resources/v1/events/events.js +2 -2
  48. package/resources/v1/events/events.js.map +1 -1
  49. package/resources/v1/events/events.mjs +2 -2
  50. package/resources/v1/events/events.mjs.map +1 -1
  51. package/resources/v1/features.d.mts +222 -7
  52. package/resources/v1/features.d.mts.map +1 -1
  53. package/resources/v1/features.d.ts +222 -7
  54. package/resources/v1/features.d.ts.map +1 -1
  55. package/resources/v1/plans/plans.d.mts +62 -22
  56. package/resources/v1/plans/plans.d.mts.map +1 -1
  57. package/resources/v1/plans/plans.d.ts +62 -22
  58. package/resources/v1/plans/plans.d.ts.map +1 -1
  59. package/resources/v1/plans/plans.js +5 -1
  60. package/resources/v1/plans/plans.js.map +1 -1
  61. package/resources/v1/plans/plans.mjs +5 -1
  62. package/resources/v1/plans/plans.mjs.map +1 -1
  63. package/resources/v1/products.d.mts +15 -7
  64. package/resources/v1/products.d.mts.map +1 -1
  65. package/resources/v1/products.d.ts +15 -7
  66. package/resources/v1/products.d.ts.map +1 -1
  67. package/resources/v1/subscriptions/subscriptions.d.mts +66 -22
  68. package/resources/v1/subscriptions/subscriptions.d.mts.map +1 -1
  69. package/resources/v1/subscriptions/subscriptions.d.ts +66 -22
  70. package/resources/v1/subscriptions/subscriptions.d.ts.map +1 -1
  71. package/resources/v1/subscriptions/subscriptions.js +11 -3
  72. package/resources/v1/subscriptions/subscriptions.js.map +1 -1
  73. package/resources/v1/subscriptions/subscriptions.mjs +11 -3
  74. package/resources/v1/subscriptions/subscriptions.mjs.map +1 -1
  75. package/resources/v1/usage.d.mts +32 -9
  76. package/resources/v1/usage.d.mts.map +1 -1
  77. package/resources/v1/usage.d.ts +32 -9
  78. package/resources/v1/usage.d.ts.map +1 -1
  79. package/src/resources/v1/addons/addons.ts +30 -13
  80. package/src/resources/v1/contracts.ts +41 -4
  81. package/src/resources/v1/coupons.ts +18 -9
  82. package/src/resources/v1/credits/grants.ts +51 -14
  83. package/src/resources/v1/customers/customers.ts +120 -49
  84. package/src/resources/v1/customers/integrations.ts +17 -8
  85. package/src/resources/v1/customers/payment-method.ts +7 -3
  86. package/src/resources/v1/customers/promotional-entitlements.ts +23 -5
  87. package/src/resources/v1/events/events.ts +13 -5
  88. package/src/resources/v1/features.ts +288 -7
  89. package/src/resources/v1/plans/plans.ts +62 -22
  90. package/src/resources/v1/products.ts +15 -7
  91. package/src/resources/v1/subscriptions/subscriptions.ts +68 -22
  92. package/src/resources/v1/usage.ts +32 -9
  93. package/src/version.ts +1 -1
  94. package/version.d.mts +1 -1
  95. package/version.d.ts +1 -1
  96. package/version.js +1 -1
  97. package/version.mjs +1 -1
@@ -53,7 +53,13 @@ export class Subscriptions extends APIResource {
53
53
 
54
54
  /**
55
55
  * Updates an active subscription's properties including billing period, add-ons,
56
- * unit quantities, and discounts.
56
+ * unit quantities, and discounts. This is a partial update — only the fields
57
+ * present in the request body change. Object fields such as `metadata` are
58
+ * replaced wholesale rather than merged, and list fields such as `addons` and
59
+ * `priceOverrides` must be sent in full: any existing item that isn't included in
60
+ * the array is removed from the subscription. Changes classified as a downgrade
61
+ * may be scheduled for the end of the current billing period instead of applying
62
+ * immediately, depending on your update scheduling configuration.
57
63
  */
58
64
  update(id: string, params: SubscriptionUpdateParams, options?: RequestOptions): APIPromise<Subscription> {
59
65
  const { 'X-ACCOUNT-ID': xAccountID, 'X-ENVIRONMENT-ID': xEnvironmentID, ...body } = params;
@@ -112,8 +118,10 @@ export class Subscriptions extends APIResource {
112
118
  }
113
119
 
114
120
  /**
115
- * Delegates the payment responsibility of a subscription to a different customer.
116
- * The delegated customer will be billed for this subscription.
121
+ * Delegates a subscription to a different customer, who becomes responsible for
122
+ * managing it. The original customer remains the paying customer for this
123
+ * subscription, unless payment was already delegated to the target customer, in
124
+ * which case the target customer becomes the paying customer as well.
117
125
  */
118
126
  delegate(
119
127
  id: string,
@@ -377,7 +385,8 @@ export namespace Subscription {
377
385
  latestInvoice?: Data.LatestInvoice | null;
378
386
 
379
387
  /**
380
- * Additional metadata for the subscription
388
+ * Additional metadata for the subscription, stored as an arbitrary flat key-value
389
+ * object.
381
390
  */
382
391
  metadata?: { [key: string]: string };
383
392
 
@@ -863,7 +872,10 @@ export namespace Subscription {
863
872
  baseCharge?: boolean;
864
873
 
865
874
  /**
866
- * The billing country code of the price
875
+ * ISO 3166-1 alpha-2 country code this price applies to, or "eu" for the European
876
+ * Union group you map countries into. Omit for the default price shown to all
877
+ * countries; set one or more country-specific price periods on the same currency
878
+ * to localize the amount by billing country.
867
879
  */
868
880
  billingCountryCode?: string;
869
881
 
@@ -1438,7 +1450,8 @@ export interface SubscriptionListResponse {
1438
1450
  latestInvoice?: SubscriptionListResponse.LatestInvoice | null;
1439
1451
 
1440
1452
  /**
1441
- * Additional metadata for the subscription
1453
+ * Additional metadata for the subscription, stored as an arbitrary flat key-value
1454
+ * object.
1442
1455
  */
1443
1456
  metadata?: { [key: string]: string };
1444
1457
 
@@ -1924,7 +1937,10 @@ export namespace SubscriptionListResponse {
1924
1937
  baseCharge?: boolean;
1925
1938
 
1926
1939
  /**
1927
- * The billing country code of the price
1940
+ * ISO 3166-1 alpha-2 country code this price applies to, or "eu" for the European
1941
+ * Union group you map countries into. Omit for the default price shown to all
1942
+ * countries; set one or more country-specific price periods on the same currency
1943
+ * to localize the amount by billing country.
1928
1944
  */
1929
1945
  billingCountryCode?: string;
1930
1946
 
@@ -2426,7 +2442,12 @@ export namespace SubscriptionPreviewResponse {
2426
2442
  hasScheduledUpdates?: boolean;
2427
2443
 
2428
2444
  /**
2429
- * Whether this is a downgrade
2445
+ * Whether this change is classified as a downgrade. Stigg determines this by
2446
+ * ranking the target plan against the customer's current plan — primarily by
2447
+ * calculated price (or by plan parent/child inheritance, when your catalog uses
2448
+ * it) — rather than by a manually assigned plan order. Downgrades can be scheduled
2449
+ * to take effect at the end of the current billing period instead of immediately,
2450
+ * depending on your update scheduling configuration.
2430
2451
  */
2431
2452
  isPlanDowngrade?: boolean;
2432
2453
 
@@ -3090,7 +3111,8 @@ export namespace SubscriptionProvisionResponse {
3090
3111
  latestInvoice?: Subscription.LatestInvoice | null;
3091
3112
 
3092
3113
  /**
3093
- * Additional metadata for the subscription
3114
+ * Additional metadata for the subscription, stored as an arbitrary flat key-value
3115
+ * object.
3094
3116
  */
3095
3117
  metadata?: { [key: string]: string };
3096
3118
 
@@ -3576,7 +3598,10 @@ export namespace SubscriptionProvisionResponse {
3576
3598
  baseCharge?: boolean;
3577
3599
 
3578
3600
  /**
3579
- * The billing country code of the price
3601
+ * ISO 3166-1 alpha-2 country code this price applies to, or "eu" for the European
3602
+ * Union group you map countries into. Omit for the default price shown to all
3603
+ * countries; set one or more country-specific price periods on the same currency
3604
+ * to localize the amount by billing country.
3580
3605
  */
3581
3606
  billingCountryCode?: string;
3582
3607
 
@@ -4095,7 +4120,8 @@ export interface SubscriptionUpdateParams {
4095
4120
  entitlements?: Array<SubscriptionUpdateParams.Feature | SubscriptionUpdateParams.Credit>;
4096
4121
 
4097
4122
  /**
4098
- * Body param: Additional metadata for the subscription
4123
+ * Body param: Additional metadata for the subscription, stored as an arbitrary
4124
+ * flat key-value object.
4099
4125
  */
4100
4126
  metadata?: { [key: string]: string };
4101
4127
 
@@ -4347,7 +4373,8 @@ export namespace SubscriptionUpdateParams {
4347
4373
  isInvoicePaid?: boolean;
4348
4374
 
4349
4375
  /**
4350
- * Additional metadata for the subscription
4376
+ * Additional metadata for the subscription, stored as an arbitrary flat key-value
4377
+ * object.
4351
4378
  */
4352
4379
  metadata?: { [key: string]: string };
4353
4380
 
@@ -4539,6 +4566,11 @@ export namespace SubscriptionUpdateParams {
4539
4566
  * SubscriptionCreditEntitlementRequest
4540
4567
  */
4541
4568
  type: 'CREDIT';
4569
+
4570
+ /**
4571
+ * Whether the credit balance is a soft limit
4572
+ */
4573
+ hasSoftLimit?: boolean;
4542
4574
  }
4543
4575
 
4544
4576
  /**
@@ -4933,10 +4965,10 @@ export interface SubscriptionCancelParams {
4933
4965
 
4934
4966
  export interface SubscriptionDelegateParams {
4935
4967
  /**
4936
- * Body param: The unique identifier of the customer who will assume payment
4937
- * responsibility for this subscription. This customer must already exist in your
4938
- * Stigg account and have a valid payment method if the subscription requires
4939
- * payment.
4968
+ * Body param: The unique identifier of the customer who will manage this
4969
+ * subscription going forward. This customer must already exist in your Stigg
4970
+ * account. The paying customer for the subscription does not change as a result of
4971
+ * this request.
4940
4972
  */
4941
4973
  targetCustomerId: string;
4942
4974
 
@@ -5016,7 +5048,8 @@ export namespace SubscriptionImportParams {
5016
5048
  endDate?: string | null;
5017
5049
 
5018
5050
  /**
5019
- * Additional metadata for the subscription
5051
+ * Additional metadata for the subscription, stored as an arbitrary flat key-value
5052
+ * object.
5020
5053
  */
5021
5054
  metadata?: { [key: string]: string };
5022
5055
 
@@ -5117,7 +5150,8 @@ export interface SubscriptionPreviewParams {
5117
5150
  billableFeatures?: Array<SubscriptionPreviewParams.BillableFeature>;
5118
5151
 
5119
5152
  /**
5120
- * Body param: ISO 3166-1 country code for localization
5153
+ * Body param: Country code selecting a localized price, or "eu" for the European
5154
+ * Union group you map countries into; the default price applies when none matches
5121
5155
  */
5122
5156
  billingCountryCode?: string;
5123
5157
 
@@ -5587,7 +5621,9 @@ export interface SubscriptionProvisionParams {
5587
5621
  awaitPaymentConfirmation?: boolean;
5588
5622
 
5589
5623
  /**
5590
- * Body param: The ISO 3166-1 alpha-2 country code for billing
5624
+ * Body param: The country code used to select a localized price, or "eu" for the
5625
+ * European Union group you map countries into, falling back to the default price
5626
+ * when none matches
5591
5627
  */
5592
5628
  billingCountryCode?: string | null;
5593
5629
 
@@ -5637,7 +5673,8 @@ export interface SubscriptionProvisionParams {
5637
5673
  entitlements?: Array<SubscriptionProvisionParams.Feature | SubscriptionProvisionParams.Credit>;
5638
5674
 
5639
5675
  /**
5640
- * Body param: Additional metadata for the subscription
5676
+ * Body param: Additional metadata for the subscription, stored as an arbitrary
5677
+ * flat key-value object.
5641
5678
  */
5642
5679
  metadata?: { [key: string]: string };
5643
5680
 
@@ -5955,7 +5992,8 @@ export namespace SubscriptionProvisionParams {
5955
5992
  isInvoicePaid?: boolean;
5956
5993
 
5957
5994
  /**
5958
- * Additional metadata for the subscription
5995
+ * Additional metadata for the subscription, stored as an arbitrary flat key-value
5996
+ * object.
5959
5997
  */
5960
5998
  metadata?: { [key: string]: string };
5961
5999
 
@@ -6200,6 +6238,11 @@ export namespace SubscriptionProvisionParams {
6200
6238
  * SubscriptionCreditEntitlementRequest
6201
6239
  */
6202
6240
  type: 'CREDIT';
6241
+
6242
+ /**
6243
+ * Whether the credit balance is a soft limit
6244
+ */
6245
+ hasSoftLimit?: boolean;
6203
6246
  }
6204
6247
 
6205
6248
  /**
@@ -6350,7 +6393,10 @@ export namespace SubscriptionProvisionParams {
6350
6393
  baseCharge?: boolean;
6351
6394
 
6352
6395
  /**
6353
- * The billing country code of the price
6396
+ * ISO 3166-1 alpha-2 country code this price applies to, or "eu" for the European
6397
+ * Union group you map countries into. Omit for the default price shown to all
6398
+ * countries; set one or more country-specific price periods on the same currency
6399
+ * to localize the amount by billing country.
6354
6400
  */
6355
6401
  billingCountryCode?: string;
6356
6402
 
@@ -310,7 +310,10 @@ export namespace UsageReportResponse {
310
310
  nextResetDate?: string | null;
311
311
 
312
312
  /**
313
- * Resource id
313
+ * The customer resource this usage applies to. Optional — only required if the
314
+ * customer has multiple resources (for example, one subscription per workspace or
315
+ * site) and usage needs to be tracked separately per resource; omit it to report
316
+ * usage at the customer level.
314
317
  */
315
318
  resourceId?: string | null;
316
319
 
@@ -385,7 +388,10 @@ export interface UsageEstimateParams {
385
388
  featureId: string;
386
389
 
387
390
  /**
388
- * Body param: The value to report for usage
391
+ * Body param: The value to report for usage. Must be a whole number — the REST API
392
+ * does not accept fractional (float) usage values; scale up (e.g. report cents
393
+ * instead of dollars, or milliseconds instead of seconds) if you need sub-unit
394
+ * precision.
389
395
  */
390
396
  value: number;
391
397
 
@@ -395,12 +401,17 @@ export interface UsageEstimateParams {
395
401
  dimensions?: { [key: string]: string | number | boolean };
396
402
 
397
403
  /**
398
- * Body param: Resource id
404
+ * Body param: The customer resource this usage applies to. Optional — only
405
+ * required if the customer has multiple resources (for example, one subscription
406
+ * per workspace or site) and usage needs to be tracked separately per resource;
407
+ * omit it to report usage at the customer level.
399
408
  */
400
409
  resourceId?: string | null;
401
410
 
402
411
  /**
403
- * Body param: The method by which the usage value should be updated
412
+ * Body param: How the reported value is applied: DELTA (default) adds it to the
413
+ * feature's current usage; SET treats it as the new absolute usage total, and
414
+ * Stigg computes the delta internally.
404
415
  */
405
416
  updateBehavior?: 'DELTA' | 'SET';
406
417
 
@@ -440,7 +451,10 @@ export interface UsageHistoryParams {
440
451
  groupBy?: string;
441
452
 
442
453
  /**
443
- * Query param: Resource id
454
+ * Query param: The customer resource this usage applies to. Optional — only
455
+ * required if the customer has multiple resources (for example, one subscription
456
+ * per workspace or site) and usage needs to be tracked separately per resource;
457
+ * omit it to report usage at the customer level.
444
458
  */
445
459
  resourceId?: string | null;
446
460
 
@@ -494,7 +508,9 @@ export namespace UsageReportParams {
494
508
  featureId: string;
495
509
 
496
510
  /**
497
- * The value to report for usage
511
+ * The value to report for usage. Must be a whole number — the REST API does not
512
+ * accept fractional (float) usage values; scale up (e.g. report cents instead of
513
+ * dollars, or milliseconds instead of seconds) if you need sub-unit precision.
498
514
  */
499
515
  value: number;
500
516
 
@@ -509,17 +525,24 @@ export namespace UsageReportParams {
509
525
  dimensions?: { [key: string]: string | number | boolean };
510
526
 
511
527
  /**
512
- * Idempotency key
528
+ * A key you provide to safely retry the same usage report without double-counting
529
+ * it. Reports with a previously-seen idempotency key are deduplicated for 7 days;
530
+ * after that window a retry is treated as new usage.
513
531
  */
514
532
  idempotencyKey?: string;
515
533
 
516
534
  /**
517
- * Resource id
535
+ * The customer resource this usage applies to. Optional — only required if the
536
+ * customer has multiple resources (for example, one subscription per workspace or
537
+ * site) and usage needs to be tracked separately per resource; omit it to report
538
+ * usage at the customer level.
518
539
  */
519
540
  resourceId?: string | null;
520
541
 
521
542
  /**
522
- * The method by which the usage value should be updated
543
+ * How the reported value is applied: DELTA (default) adds it to the feature's
544
+ * current usage; SET treats it as the new absolute usage total, and Stigg computes
545
+ * the delta internally.
523
546
  */
524
547
  updateBehavior?: 'DELTA' | 'SET';
525
548
  }
package/src/version.ts CHANGED
@@ -1 +1 @@
1
- export const VERSION = '0.1.0-beta.54'; // x-release-please-version
1
+ export const VERSION = '0.1.0-beta.56'; // x-release-please-version
package/version.d.mts CHANGED
@@ -1,2 +1,2 @@
1
- export declare const VERSION = "0.1.0-beta.54";
1
+ export declare const VERSION = "0.1.0-beta.56";
2
2
  //# sourceMappingURL=version.d.mts.map
package/version.d.ts CHANGED
@@ -1,2 +1,2 @@
1
- export declare const VERSION = "0.1.0-beta.54";
1
+ export declare const VERSION = "0.1.0-beta.56";
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-beta.54'; // x-release-please-version
4
+ exports.VERSION = '0.1.0-beta.56'; // 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-beta.54'; // x-release-please-version
1
+ export const VERSION = '0.1.0-beta.56'; // x-release-please-version
2
2
  //# sourceMappingURL=version.mjs.map