orb-billing 1.27.0 → 1.28.0

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 (145) hide show
  1. package/CHANGELOG.md +14 -0
  2. package/core.d.ts +0 -10
  3. package/core.d.ts.map +1 -1
  4. package/core.js +1 -13
  5. package/core.js.map +1 -1
  6. package/core.mjs +0 -11
  7. package/core.mjs.map +1 -1
  8. package/package.json +1 -1
  9. package/resource.d.ts +1 -7
  10. package/resource.d.ts.map +1 -1
  11. package/resource.js +1 -7
  12. package/resource.js.map +1 -1
  13. package/resource.mjs +1 -7
  14. package/resource.mjs.map +1 -1
  15. package/resources/coupons/coupons.d.ts.map +1 -1
  16. package/resources/coupons/coupons.js +5 -5
  17. package/resources/coupons/coupons.js.map +1 -1
  18. package/resources/coupons/coupons.mjs +5 -5
  19. package/resources/coupons/coupons.mjs.map +1 -1
  20. package/resources/coupons/subscriptions.d.ts.map +1 -1
  21. package/resources/coupons/subscriptions.js +4 -1
  22. package/resources/coupons/subscriptions.js.map +1 -1
  23. package/resources/coupons/subscriptions.mjs +4 -1
  24. package/resources/coupons/subscriptions.mjs.map +1 -1
  25. package/resources/credit-notes.js +2 -2
  26. package/resources/credit-notes.js.map +1 -1
  27. package/resources/credit-notes.mjs +2 -2
  28. package/resources/credit-notes.mjs.map +1 -1
  29. package/resources/customers/balance-transactions.js +2 -2
  30. package/resources/customers/balance-transactions.js.map +1 -1
  31. package/resources/customers/balance-transactions.mjs +2 -2
  32. package/resources/customers/balance-transactions.mjs.map +1 -1
  33. package/resources/customers/costs.d.ts.map +1 -1
  34. package/resources/customers/costs.js +5 -2
  35. package/resources/customers/costs.js.map +1 -1
  36. package/resources/customers/costs.mjs +5 -2
  37. package/resources/customers/costs.mjs.map +1 -1
  38. package/resources/customers/credits/credits.d.ts.map +1 -1
  39. package/resources/customers/credits/credits.js +3 -3
  40. package/resources/customers/credits/credits.js.map +1 -1
  41. package/resources/customers/credits/credits.mjs +3 -3
  42. package/resources/customers/credits/credits.mjs.map +1 -1
  43. package/resources/customers/credits/ledger.d.ts +132 -20
  44. package/resources/customers/credits/ledger.d.ts.map +1 -1
  45. package/resources/customers/credits/ledger.js +4 -4
  46. package/resources/customers/credits/ledger.js.map +1 -1
  47. package/resources/customers/credits/ledger.mjs +4 -4
  48. package/resources/customers/credits/ledger.mjs.map +1 -1
  49. package/resources/customers/customers.d.ts +11 -10
  50. package/resources/customers/customers.d.ts.map +1 -1
  51. package/resources/customers/customers.js +12 -12
  52. package/resources/customers/customers.js.map +1 -1
  53. package/resources/customers/customers.mjs +12 -12
  54. package/resources/customers/customers.mjs.map +1 -1
  55. package/resources/customers/usage.js +2 -2
  56. package/resources/customers/usage.js.map +1 -1
  57. package/resources/customers/usage.mjs +2 -2
  58. package/resources/customers/usage.mjs.map +1 -1
  59. package/resources/events/backfills.js +5 -5
  60. package/resources/events/backfills.js.map +1 -1
  61. package/resources/events/backfills.mjs +5 -5
  62. package/resources/events/backfills.mjs.map +1 -1
  63. package/resources/events/events.d.ts.map +1 -1
  64. package/resources/events/events.js +5 -5
  65. package/resources/events/events.js.map +1 -1
  66. package/resources/events/events.mjs +5 -5
  67. package/resources/events/events.mjs.map +1 -1
  68. package/resources/invoice-line-items.js +1 -1
  69. package/resources/invoice-line-items.js.map +1 -1
  70. package/resources/invoice-line-items.mjs +1 -1
  71. package/resources/invoice-line-items.mjs.map +1 -1
  72. package/resources/invoices.d.ts +10 -2
  73. package/resources/invoices.d.ts.map +1 -1
  74. package/resources/invoices.js +7 -7
  75. package/resources/invoices.js.map +1 -1
  76. package/resources/invoices.mjs +7 -7
  77. package/resources/invoices.mjs.map +1 -1
  78. package/resources/items.js +3 -3
  79. package/resources/items.js.map +1 -1
  80. package/resources/items.mjs +3 -3
  81. package/resources/items.mjs.map +1 -1
  82. package/resources/metrics.d.ts +14 -3
  83. package/resources/metrics.d.ts.map +1 -1
  84. package/resources/metrics.js +3 -3
  85. package/resources/metrics.js.map +1 -1
  86. package/resources/metrics.mjs +3 -3
  87. package/resources/metrics.mjs.map +1 -1
  88. package/resources/plans/external-plan-id.d.ts +4 -1
  89. package/resources/plans/external-plan-id.d.ts.map +1 -1
  90. package/resources/plans/external-plan-id.js +2 -2
  91. package/resources/plans/external-plan-id.js.map +1 -1
  92. package/resources/plans/external-plan-id.mjs +2 -2
  93. package/resources/plans/external-plan-id.mjs.map +1 -1
  94. package/resources/plans/plans.d.ts +13 -3
  95. package/resources/plans/plans.d.ts.map +1 -1
  96. package/resources/plans/plans.js +5 -5
  97. package/resources/plans/plans.js.map +1 -1
  98. package/resources/plans/plans.mjs +5 -5
  99. package/resources/plans/plans.mjs.map +1 -1
  100. package/resources/prices/external-price-id.js +1 -1
  101. package/resources/prices/external-price-id.js.map +1 -1
  102. package/resources/prices/external-price-id.mjs +1 -1
  103. package/resources/prices/external-price-id.mjs.map +1 -1
  104. package/resources/prices/prices.d.ts.map +1 -1
  105. package/resources/prices/prices.js +4 -4
  106. package/resources/prices/prices.js.map +1 -1
  107. package/resources/prices/prices.mjs +4 -4
  108. package/resources/prices/prices.mjs.map +1 -1
  109. package/resources/subscriptions.d.ts +7 -4
  110. package/resources/subscriptions.d.ts.map +1 -1
  111. package/resources/subscriptions.js +17 -14
  112. package/resources/subscriptions.js.map +1 -1
  113. package/resources/subscriptions.mjs +17 -14
  114. package/resources/subscriptions.mjs.map +1 -1
  115. package/resources/top-level.js +1 -1
  116. package/resources/top-level.js.map +1 -1
  117. package/resources/top-level.mjs +1 -1
  118. package/resources/top-level.mjs.map +1 -1
  119. package/src/core.ts +0 -21
  120. package/src/resource.ts +3 -16
  121. package/src/resources/coupons/coupons.ts +5 -5
  122. package/src/resources/coupons/subscriptions.ts +4 -1
  123. package/src/resources/credit-notes.ts +2 -2
  124. package/src/resources/customers/balance-transactions.ts +2 -2
  125. package/src/resources/customers/costs.ts +5 -2
  126. package/src/resources/customers/credits/credits.ts +3 -3
  127. package/src/resources/customers/credits/ledger.ts +136 -24
  128. package/src/resources/customers/customers.ts +22 -21
  129. package/src/resources/customers/usage.ts +2 -2
  130. package/src/resources/events/backfills.ts +5 -5
  131. package/src/resources/events/events.ts +5 -5
  132. package/src/resources/invoice-line-items.ts +1 -1
  133. package/src/resources/invoices.ts +17 -9
  134. package/src/resources/items.ts +3 -3
  135. package/src/resources/metrics.ts +17 -6
  136. package/src/resources/plans/external-plan-id.ts +6 -3
  137. package/src/resources/plans/plans.ts +18 -8
  138. package/src/resources/prices/external-price-id.ts +1 -1
  139. package/src/resources/prices/prices.ts +4 -4
  140. package/src/resources/subscriptions.ts +24 -18
  141. package/src/resources/top-level.ts +1 -1
  142. package/src/version.ts +1 -1
  143. package/version.d.ts +1 -1
  144. package/version.js +1 -1
  145. package/version.mjs +1 -1
@@ -411,7 +411,7 @@ export class Subscriptions extends APIResource {
411
411
  if (isRequestOptions(body)) {
412
412
  return this.create({}, body);
413
413
  }
414
- return this.post('/subscriptions', { body, ...options });
414
+ return this._client.post('/subscriptions', { body, ...options });
415
415
  }
416
416
 
417
417
  /**
@@ -435,7 +435,7 @@ export class Subscriptions extends APIResource {
435
435
  if (isRequestOptions(query)) {
436
436
  return this.list({}, query);
437
437
  }
438
- return this.getAPIList('/subscriptions', SubscriptionsPage, { query, ...options });
438
+ return this._client.getAPIList('/subscriptions', SubscriptionsPage, { query, ...options });
439
439
  }
440
440
 
441
441
  /**
@@ -506,7 +506,7 @@ export class Subscriptions extends APIResource {
506
506
  body: SubscriptionCancelParams,
507
507
  options?: Core.RequestOptions,
508
508
  ): Core.APIPromise<Subscription> {
509
- return this.post(`/subscriptions/${subscriptionId}/cancel`, { body, ...options });
509
+ return this._client.post(`/subscriptions/${subscriptionId}/cancel`, { body, ...options });
510
510
  }
511
511
 
512
512
  /**
@@ -514,7 +514,7 @@ export class Subscriptions extends APIResource {
514
514
  * given an identifier.
515
515
  */
516
516
  fetch(subscriptionId: string, options?: Core.RequestOptions): Core.APIPromise<Subscription> {
517
- return this.get(`/subscriptions/${subscriptionId}`, options);
517
+ return this._client.get(`/subscriptions/${subscriptionId}`, options);
518
518
  }
519
519
 
520
520
  /**
@@ -546,7 +546,7 @@ export class Subscriptions extends APIResource {
546
546
  if (isRequestOptions(query)) {
547
547
  return this.fetchCosts(subscriptionId, {}, query);
548
548
  }
549
- return this.get(`/subscriptions/${subscriptionId}/costs`, { query, ...options });
549
+ return this._client.get(`/subscriptions/${subscriptionId}/costs`, { query, ...options });
550
550
  }
551
551
 
552
552
  /**
@@ -572,7 +572,7 @@ export class Subscriptions extends APIResource {
572
572
  if (isRequestOptions(query)) {
573
573
  return this.fetchSchedule(subscriptionId, {}, query);
574
574
  }
575
- return this.getAPIList(
575
+ return this._client.getAPIList(
576
576
  `/subscriptions/${subscriptionId}/schedule`,
577
577
  SubscriptionFetchScheduleResponsesPage,
578
578
  { query, ...options },
@@ -789,7 +789,7 @@ export class Subscriptions extends APIResource {
789
789
  if (isRequestOptions(query)) {
790
790
  return this.fetchUsage(subscriptionId, {}, query);
791
791
  }
792
- return this.get(`/subscriptions/${subscriptionId}/usage`, { query, ...options });
792
+ return this._client.get(`/subscriptions/${subscriptionId}/usage`, { query, ...options });
793
793
  }
794
794
 
795
795
  /**
@@ -865,7 +865,7 @@ export class Subscriptions extends APIResource {
865
865
  if (isRequestOptions(body)) {
866
866
  return this.priceIntervals(subscriptionId, {}, body);
867
867
  }
868
- return this.post(`/subscriptions/${subscriptionId}/price_intervals`, { body, ...options });
868
+ return this._client.post(`/subscriptions/${subscriptionId}/price_intervals`, { body, ...options });
869
869
  }
870
870
 
871
871
  /**
@@ -914,7 +914,7 @@ export class Subscriptions extends APIResource {
914
914
  body: SubscriptionSchedulePlanChangeParams,
915
915
  options?: Core.RequestOptions,
916
916
  ): Core.APIPromise<Subscription> {
917
- return this.post(`/subscriptions/${subscriptionId}/schedule_plan_change`, { body, ...options });
917
+ return this._client.post(`/subscriptions/${subscriptionId}/schedule_plan_change`, { body, ...options });
918
918
  }
919
919
 
920
920
  /**
@@ -935,7 +935,7 @@ export class Subscriptions extends APIResource {
935
935
  if (isRequestOptions(body)) {
936
936
  return this.triggerPhase(subscriptionId, {}, body);
937
937
  }
938
- return this.post(`/subscriptions/${subscriptionId}/trigger_phase`, { body, ...options });
938
+ return this._client.post(`/subscriptions/${subscriptionId}/trigger_phase`, { body, ...options });
939
939
  }
940
940
 
941
941
  /**
@@ -950,7 +950,7 @@ export class Subscriptions extends APIResource {
950
950
  subscriptionId: string,
951
951
  options?: Core.RequestOptions,
952
952
  ): Core.APIPromise<Subscription> {
953
- return this.post(`/subscriptions/${subscriptionId}/unschedule_cancellation`, options);
953
+ return this._client.post(`/subscriptions/${subscriptionId}/unschedule_cancellation`, options);
954
954
  }
955
955
 
956
956
  /**
@@ -964,7 +964,7 @@ export class Subscriptions extends APIResource {
964
964
  body: SubscriptionUnscheduleFixedFeeQuantityUpdatesParams,
965
965
  options?: Core.RequestOptions,
966
966
  ): Core.APIPromise<Subscription> {
967
- return this.post(`/subscriptions/${subscriptionId}/unschedule_fixed_fee_quantity_updates`, {
967
+ return this._client.post(`/subscriptions/${subscriptionId}/unschedule_fixed_fee_quantity_updates`, {
968
968
  body,
969
969
  ...options,
970
970
  });
@@ -978,7 +978,7 @@ export class Subscriptions extends APIResource {
978
978
  subscriptionId: string,
979
979
  options?: Core.RequestOptions,
980
980
  ): Core.APIPromise<Subscription> {
981
- return this.post(`/subscriptions/${subscriptionId}/unschedule_pending_plan_changes`, options);
981
+ return this._client.post(`/subscriptions/${subscriptionId}/unschedule_pending_plan_changes`, options);
982
982
  }
983
983
 
984
984
  /**
@@ -1002,7 +1002,10 @@ export class Subscriptions extends APIResource {
1002
1002
  body: SubscriptionUpdateFixedFeeQuantityParams,
1003
1003
  options?: Core.RequestOptions,
1004
1004
  ): Core.APIPromise<Subscription> {
1005
- return this.post(`/subscriptions/${subscriptionId}/update_fixed_fee_quantity`, { body, ...options });
1005
+ return this._client.post(`/subscriptions/${subscriptionId}/update_fixed_fee_quantity`, {
1006
+ body,
1007
+ ...options,
1008
+ });
1006
1009
  }
1007
1010
  }
1008
1011
 
@@ -1124,10 +1127,10 @@ export interface Subscription {
1124
1127
  maximum_intervals: Array<Subscription.MaximumInterval>;
1125
1128
 
1126
1129
  /**
1127
- * User specified key-value pairs. If no metadata was specified at subscription
1128
- * creation time, this defaults to an empty dictionary.
1130
+ * User specified key-value pairs. If not provided, this defaults to an empty
1131
+ * dictionary.
1129
1132
  */
1130
- metadata: unknown;
1133
+ metadata: Record<string, string>;
1131
1134
 
1132
1135
  /**
1133
1136
  * The minimum intervals for this subscription.
@@ -2087,7 +2090,10 @@ export interface SubscriptionCreateParams {
2087
2090
 
2088
2091
  invoicing_threshold?: string | null;
2089
2092
 
2090
- metadata?: unknown | null;
2093
+ /**
2094
+ * User-specified key/value pairs for the resource.
2095
+ */
2096
+ metadata?: Record<string, string | null> | null;
2091
2097
 
2092
2098
  net_terms?: number | null;
2093
2099
 
@@ -14,7 +14,7 @@ export class TopLevel extends APIResource {
14
14
  * This API does not have any side-effects or return any Orb resources.
15
15
  */
16
16
  ping(options?: Core.RequestOptions): Core.APIPromise<TopLevelPingResponse> {
17
- return this.get('/ping', options);
17
+ return this._client.get('/ping', options);
18
18
  }
19
19
  }
20
20
 
package/src/version.ts CHANGED
@@ -1 +1 @@
1
- export const VERSION = '1.27.0'; // x-release-please-version
1
+ export const VERSION = '1.28.0'; // x-release-please-version
package/version.d.ts CHANGED
@@ -1,2 +1,2 @@
1
- export declare const VERSION = "1.27.0";
1
+ export declare const VERSION = "1.28.0";
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 = '1.27.0'; // x-release-please-version
4
+ exports.VERSION = '1.28.0'; // x-release-please-version
5
5
  //# sourceMappingURL=version.js.map
package/version.mjs CHANGED
@@ -1,2 +1,2 @@
1
- export const VERSION = '1.27.0'; // x-release-please-version
1
+ export const VERSION = '1.28.0'; // x-release-please-version
2
2
  //# sourceMappingURL=version.mjs.map