orb-billing 4.15.1 → 4.16.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 (98) hide show
  1. package/CHANGELOG.md +19 -0
  2. package/LICENSE +0 -0
  3. package/README.md +0 -0
  4. package/_shims/README.md +0 -0
  5. package/_shims/auto/types.d.ts +0 -0
  6. package/_shims/auto/types.js +0 -0
  7. package/_shims/auto/types.mjs +0 -0
  8. package/_shims/index.d.ts +0 -0
  9. package/_shims/index.js +0 -0
  10. package/_shims/index.mjs +0 -0
  11. package/_shims/manual-types.d.ts +0 -0
  12. package/_shims/manual-types.js +0 -0
  13. package/_shims/manual-types.mjs +0 -0
  14. package/_shims/node-types.d.ts +0 -0
  15. package/_shims/node-types.js +0 -0
  16. package/_shims/node-types.mjs +0 -0
  17. package/_shims/web-types.d.ts +0 -0
  18. package/_shims/web-types.js +0 -0
  19. package/_shims/web-types.mjs +0 -0
  20. package/package.json +2 -2
  21. package/resources/subscriptions.d.ts +246 -2
  22. package/resources/subscriptions.d.ts.map +1 -1
  23. package/resources/subscriptions.js.map +1 -1
  24. package/resources/subscriptions.mjs.map +1 -1
  25. package/src/_shims/MultipartBody.ts +0 -0
  26. package/src/_shims/README.md +0 -0
  27. package/src/_shims/auto/runtime-bun.ts +0 -0
  28. package/src/_shims/auto/runtime-node.ts +0 -0
  29. package/src/_shims/auto/runtime.ts +0 -0
  30. package/src/_shims/auto/types-node.ts +0 -0
  31. package/src/_shims/auto/types.d.ts +0 -0
  32. package/src/_shims/auto/types.js +0 -0
  33. package/src/_shims/auto/types.mjs +0 -0
  34. package/src/_shims/bun-runtime.ts +0 -0
  35. package/src/_shims/index.d.ts +0 -0
  36. package/src/_shims/index.js +0 -0
  37. package/src/_shims/index.mjs +0 -0
  38. package/src/_shims/manual-types.d.ts +0 -0
  39. package/src/_shims/manual-types.js +0 -0
  40. package/src/_shims/manual-types.mjs +0 -0
  41. package/src/_shims/node-runtime.ts +0 -0
  42. package/src/_shims/node-types.d.ts +0 -0
  43. package/src/_shims/node-types.js +0 -0
  44. package/src/_shims/node-types.mjs +0 -0
  45. package/src/_shims/registry.ts +0 -0
  46. package/src/_shims/web-runtime.ts +0 -0
  47. package/src/_shims/web-types.d.ts +0 -0
  48. package/src/_shims/web-types.js +0 -0
  49. package/src/_shims/web-types.mjs +0 -0
  50. package/src/core.ts +0 -0
  51. package/src/error.ts +0 -0
  52. package/src/index.ts +0 -0
  53. package/src/lib/.keep +0 -0
  54. package/src/pagination.ts +0 -0
  55. package/src/resource.ts +0 -0
  56. package/src/resources/alerts.ts +0 -0
  57. package/src/resources/coupons/coupons.ts +0 -0
  58. package/src/resources/coupons/index.ts +0 -0
  59. package/src/resources/coupons/subscriptions.ts +0 -0
  60. package/src/resources/credit-notes.ts +0 -0
  61. package/src/resources/customers/balance-transactions.ts +0 -0
  62. package/src/resources/customers/costs.ts +0 -0
  63. package/src/resources/customers/credits/credits.ts +0 -0
  64. package/src/resources/customers/credits/index.ts +0 -0
  65. package/src/resources/customers/credits/ledger.ts +0 -0
  66. package/src/resources/customers/credits/top-ups.ts +0 -0
  67. package/src/resources/customers/customers.ts +0 -0
  68. package/src/resources/customers/index.ts +0 -0
  69. package/src/resources/events/backfills.ts +0 -0
  70. package/src/resources/events/events.ts +0 -0
  71. package/src/resources/events/index.ts +0 -0
  72. package/src/resources/index.ts +0 -0
  73. package/src/resources/invoice-line-items.ts +0 -0
  74. package/src/resources/invoices.ts +0 -0
  75. package/src/resources/items.ts +0 -0
  76. package/src/resources/metrics.ts +0 -0
  77. package/src/resources/plans/external-plan-id.ts +0 -0
  78. package/src/resources/plans/index.ts +0 -0
  79. package/src/resources/plans/plans.ts +0 -0
  80. package/src/resources/prices/external-price-id.ts +0 -0
  81. package/src/resources/prices/index.ts +0 -0
  82. package/src/resources/prices/prices.ts +0 -0
  83. package/src/resources/shared.ts +0 -0
  84. package/src/resources/subscriptions.ts +308 -0
  85. package/src/resources/top-level.ts +0 -0
  86. package/src/shims/node.ts +0 -0
  87. package/src/shims/web.ts +0 -0
  88. package/src/tsconfig.json +0 -0
  89. package/src/uploads.ts +5 -3
  90. package/src/version.ts +1 -1
  91. package/uploads.d.ts.map +1 -1
  92. package/uploads.js +5 -3
  93. package/uploads.js.map +1 -1
  94. package/uploads.mjs +5 -3
  95. package/uploads.mjs.map +1 -1
  96. package/version.d.ts +1 -1
  97. package/version.js +1 -1
  98. package/version.mjs +1 -1
package/CHANGELOG.md CHANGED
@@ -1,5 +1,24 @@
1
1
  # Changelog
2
2
 
3
+ ## 4.16.0 (2024-09-06)
4
+
5
+ Full Changelog: [v4.15.1...v4.16.0](https://github.com/orbcorp/orb-node/compare/v4.15.1...v4.16.0)
6
+
7
+ ### Features
8
+
9
+ * **api:** OpenAPI spec update via Stainless API ([#308](https://github.com/orbcorp/orb-node/issues/308)) ([6ff542e](https://github.com/orbcorp/orb-node/commit/6ff542e1e1f36fad4d9c92c891872113bcb50e63))
10
+
11
+
12
+ ### Bug Fixes
13
+
14
+ * **uploads:** avoid making redundant memory copies ([#309](https://github.com/orbcorp/orb-node/issues/309)) ([f626def](https://github.com/orbcorp/orb-node/commit/f626deff3d2af5dc08d0d9d44f9e91924750c0c6))
15
+
16
+
17
+ ### Chores
18
+
19
+ * **internal:** dependency updates ([#305](https://github.com/orbcorp/orb-node/issues/305)) ([b647ed0](https://github.com/orbcorp/orb-node/commit/b647ed07527e9b40d86c6262cd042f906b33abe4))
20
+ * **internal:** minor bump qs version ([#307](https://github.com/orbcorp/orb-node/issues/307)) ([e69ddaf](https://github.com/orbcorp/orb-node/commit/e69ddafc73d93581b55f05c0d86d521ecf030125))
21
+
3
22
  ## 4.15.1 (2024-09-05)
4
23
 
5
24
  Full Changelog: [v4.15.0...v4.15.1](https://github.com/orbcorp/orb-node/compare/v4.15.0...v4.15.1)
package/LICENSE CHANGED
File without changes
package/README.md CHANGED
File without changes
package/_shims/README.md CHANGED
File without changes
File without changes
File without changes
File without changes
package/_shims/index.d.ts CHANGED
File without changes
package/_shims/index.js CHANGED
File without changes
package/_shims/index.mjs CHANGED
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "orb-billing",
3
- "version": "4.15.1",
3
+ "version": "4.16.0",
4
4
  "description": "The official TypeScript library for the Orb API",
5
5
  "author": "Orb <team@withorb.com>",
6
6
  "types": "./index.d.ts",
@@ -24,7 +24,7 @@
24
24
  "dependencies": {
25
25
  "@types/node": "^18.11.18",
26
26
  "@types/node-fetch": "^2.6.4",
27
- "@types/qs": "^6.9.7",
27
+ "@types/qs": "^6.9.15",
28
28
  "abort-controller": "^3.0.0",
29
29
  "agentkeepalive": "^4.2.1",
30
30
  "form-data-encoder": "1.7.2",
@@ -1959,7 +1959,7 @@ export interface SubscriptionCreateParams {
1959
1959
  /**
1960
1960
  * Optionally provide a list of overrides for prices on the plan
1961
1961
  */
1962
- price_overrides?: Array<SubscriptionCreateParams.OverrideUnitPrice | SubscriptionCreateParams.OverridePackagePrice | SubscriptionCreateParams.OverrideMatrixPrice | SubscriptionCreateParams.OverrideTieredPrice | SubscriptionCreateParams.OverrideTieredBpsPrice | SubscriptionCreateParams.OverrideBpsPrice | SubscriptionCreateParams.OverrideBulkBpsPrice | SubscriptionCreateParams.OverrideBulkPrice | SubscriptionCreateParams.OverrideThresholdTotalAmountPrice | SubscriptionCreateParams.OverrideTieredPackagePrice | SubscriptionCreateParams.OverrideTieredWithMinimumPrice | SubscriptionCreateParams.OverridePackageWithAllocationPrice | SubscriptionCreateParams.OverrideUnitWithPercentPrice | SubscriptionCreateParams.OverrideGroupedAllocationPrice | SubscriptionCreateParams.OverrideGroupedWithProratedMinimumPrice | SubscriptionCreateParams.OverrideBulkWithProrationPrice> | null;
1962
+ price_overrides?: Array<SubscriptionCreateParams.OverrideUnitPrice | SubscriptionCreateParams.OverridePackagePrice | SubscriptionCreateParams.OverrideMatrixPrice | SubscriptionCreateParams.OverrideTieredPrice | SubscriptionCreateParams.OverrideTieredBpsPrice | SubscriptionCreateParams.OverrideBpsPrice | SubscriptionCreateParams.OverrideBulkBpsPrice | SubscriptionCreateParams.OverrideBulkPrice | SubscriptionCreateParams.OverrideThresholdTotalAmountPrice | SubscriptionCreateParams.OverrideTieredPackagePrice | SubscriptionCreateParams.OverrideTieredWithMinimumPrice | SubscriptionCreateParams.OverridePackageWithAllocationPrice | SubscriptionCreateParams.OverrideUnitWithPercentPrice | SubscriptionCreateParams.OverrideGroupedAllocationPrice | SubscriptionCreateParams.OverrideGroupedWithProratedMinimumPrice | SubscriptionCreateParams.OverrideBulkWithProrationPrice | SubscriptionCreateParams.OverrideUnitWithProrationPrice | SubscriptionCreateParams.OverrideTieredWithProrationPrice> | null;
1963
1963
  start_date?: string | null;
1964
1964
  }
1965
1965
  export declare namespace SubscriptionCreateParams {
@@ -3104,6 +3104,128 @@ export declare namespace SubscriptionCreateParams {
3104
3104
  usage_discount?: number | null;
3105
3105
  }
3106
3106
  }
3107
+ interface OverrideUnitWithProrationPrice {
3108
+ id: string;
3109
+ model_type: 'unit_with_proration';
3110
+ unit_with_proration_config: Record<string, unknown>;
3111
+ /**
3112
+ * The per unit conversion rate of the price currency to the invoicing currency.
3113
+ */
3114
+ conversion_rate?: number | null;
3115
+ /**
3116
+ * The currency of the price. If not provided, the currency of the plan will be
3117
+ * used.
3118
+ */
3119
+ currency?: string | null;
3120
+ /**
3121
+ * The subscription's override discount for the plan.
3122
+ */
3123
+ discount?: OverrideUnitWithProrationPrice.Discount | null;
3124
+ /**
3125
+ * The starting quantity of the price, if the price is a fixed price.
3126
+ */
3127
+ fixed_price_quantity?: number | null;
3128
+ /**
3129
+ * The subscription's override maximum amount for the plan.
3130
+ */
3131
+ maximum_amount?: string | null;
3132
+ /**
3133
+ * The subscription's override minimum amount for the plan.
3134
+ */
3135
+ minimum_amount?: string | null;
3136
+ }
3137
+ namespace OverrideUnitWithProrationPrice {
3138
+ /**
3139
+ * The subscription's override discount for the plan.
3140
+ */
3141
+ interface Discount {
3142
+ discount_type: 'percentage' | 'trial' | 'usage' | 'amount';
3143
+ /**
3144
+ * Only available if discount_type is `amount`.
3145
+ */
3146
+ amount_discount?: string | null;
3147
+ /**
3148
+ * List of price_ids that this discount applies to. For plan/plan phase discounts,
3149
+ * this can be a subset of prices.
3150
+ */
3151
+ applies_to_price_ids?: Array<string> | null;
3152
+ /**
3153
+ * Only available if discount_type is `percentage`. This is a number between 0
3154
+ * and 1.
3155
+ */
3156
+ percentage_discount?: number | null;
3157
+ /**
3158
+ * Only available if discount_type is `trial`
3159
+ */
3160
+ trial_amount_discount?: string | null;
3161
+ /**
3162
+ * Only available if discount_type is `usage`. Number of usage units that this
3163
+ * discount is for
3164
+ */
3165
+ usage_discount?: number | null;
3166
+ }
3167
+ }
3168
+ interface OverrideTieredWithProrationPrice {
3169
+ id: string;
3170
+ model_type: 'tiered_with_proration';
3171
+ tiered_with_proration_config: Record<string, unknown>;
3172
+ /**
3173
+ * The per unit conversion rate of the price currency to the invoicing currency.
3174
+ */
3175
+ conversion_rate?: number | null;
3176
+ /**
3177
+ * The currency of the price. If not provided, the currency of the plan will be
3178
+ * used.
3179
+ */
3180
+ currency?: string | null;
3181
+ /**
3182
+ * The subscription's override discount for the plan.
3183
+ */
3184
+ discount?: OverrideTieredWithProrationPrice.Discount | null;
3185
+ /**
3186
+ * The starting quantity of the price, if the price is a fixed price.
3187
+ */
3188
+ fixed_price_quantity?: number | null;
3189
+ /**
3190
+ * The subscription's override maximum amount for the plan.
3191
+ */
3192
+ maximum_amount?: string | null;
3193
+ /**
3194
+ * The subscription's override minimum amount for the plan.
3195
+ */
3196
+ minimum_amount?: string | null;
3197
+ }
3198
+ namespace OverrideTieredWithProrationPrice {
3199
+ /**
3200
+ * The subscription's override discount for the plan.
3201
+ */
3202
+ interface Discount {
3203
+ discount_type: 'percentage' | 'trial' | 'usage' | 'amount';
3204
+ /**
3205
+ * Only available if discount_type is `amount`.
3206
+ */
3207
+ amount_discount?: string | null;
3208
+ /**
3209
+ * List of price_ids that this discount applies to. For plan/plan phase discounts,
3210
+ * this can be a subset of prices.
3211
+ */
3212
+ applies_to_price_ids?: Array<string> | null;
3213
+ /**
3214
+ * Only available if discount_type is `percentage`. This is a number between 0
3215
+ * and 1.
3216
+ */
3217
+ percentage_discount?: number | null;
3218
+ /**
3219
+ * Only available if discount_type is `trial`
3220
+ */
3221
+ trial_amount_discount?: string | null;
3222
+ /**
3223
+ * Only available if discount_type is `usage`. Number of usage units that this
3224
+ * discount is for
3225
+ */
3226
+ usage_discount?: number | null;
3227
+ }
3228
+ }
3107
3229
  }
3108
3230
  export interface SubscriptionUpdateParams {
3109
3231
  /**
@@ -5649,7 +5771,7 @@ export interface SubscriptionSchedulePlanChangeParams {
5649
5771
  /**
5650
5772
  * Optionally provide a list of overrides for prices on the plan
5651
5773
  */
5652
- price_overrides?: Array<SubscriptionSchedulePlanChangeParams.OverrideUnitPrice | SubscriptionSchedulePlanChangeParams.OverridePackagePrice | SubscriptionSchedulePlanChangeParams.OverrideMatrixPrice | SubscriptionSchedulePlanChangeParams.OverrideTieredPrice | SubscriptionSchedulePlanChangeParams.OverrideTieredBpsPrice | SubscriptionSchedulePlanChangeParams.OverrideBpsPrice | SubscriptionSchedulePlanChangeParams.OverrideBulkBpsPrice | SubscriptionSchedulePlanChangeParams.OverrideBulkPrice | SubscriptionSchedulePlanChangeParams.OverrideThresholdTotalAmountPrice | SubscriptionSchedulePlanChangeParams.OverrideTieredPackagePrice | SubscriptionSchedulePlanChangeParams.OverrideTieredWithMinimumPrice | SubscriptionSchedulePlanChangeParams.OverridePackageWithAllocationPrice | SubscriptionSchedulePlanChangeParams.OverrideUnitWithPercentPrice | SubscriptionSchedulePlanChangeParams.OverrideGroupedAllocationPrice | SubscriptionSchedulePlanChangeParams.OverrideGroupedWithProratedMinimumPrice | SubscriptionSchedulePlanChangeParams.OverrideBulkWithProrationPrice> | null;
5774
+ price_overrides?: Array<SubscriptionSchedulePlanChangeParams.OverrideUnitPrice | SubscriptionSchedulePlanChangeParams.OverridePackagePrice | SubscriptionSchedulePlanChangeParams.OverrideMatrixPrice | SubscriptionSchedulePlanChangeParams.OverrideTieredPrice | SubscriptionSchedulePlanChangeParams.OverrideTieredBpsPrice | SubscriptionSchedulePlanChangeParams.OverrideBpsPrice | SubscriptionSchedulePlanChangeParams.OverrideBulkBpsPrice | SubscriptionSchedulePlanChangeParams.OverrideBulkPrice | SubscriptionSchedulePlanChangeParams.OverrideThresholdTotalAmountPrice | SubscriptionSchedulePlanChangeParams.OverrideTieredPackagePrice | SubscriptionSchedulePlanChangeParams.OverrideTieredWithMinimumPrice | SubscriptionSchedulePlanChangeParams.OverridePackageWithAllocationPrice | SubscriptionSchedulePlanChangeParams.OverrideUnitWithPercentPrice | SubscriptionSchedulePlanChangeParams.OverrideGroupedAllocationPrice | SubscriptionSchedulePlanChangeParams.OverrideGroupedWithProratedMinimumPrice | SubscriptionSchedulePlanChangeParams.OverrideBulkWithProrationPrice | SubscriptionSchedulePlanChangeParams.OverrideUnitWithProrationPrice | SubscriptionSchedulePlanChangeParams.OverrideTieredWithProrationPrice> | null;
5653
5775
  }
5654
5776
  export declare namespace SubscriptionSchedulePlanChangeParams {
5655
5777
  interface OverrideUnitPrice {
@@ -6773,6 +6895,128 @@ export declare namespace SubscriptionSchedulePlanChangeParams {
6773
6895
  usage_discount?: number | null;
6774
6896
  }
6775
6897
  }
6898
+ interface OverrideUnitWithProrationPrice {
6899
+ id: string;
6900
+ model_type: 'unit_with_proration';
6901
+ unit_with_proration_config: Record<string, unknown>;
6902
+ /**
6903
+ * The per unit conversion rate of the price currency to the invoicing currency.
6904
+ */
6905
+ conversion_rate?: number | null;
6906
+ /**
6907
+ * The currency of the price. If not provided, the currency of the plan will be
6908
+ * used.
6909
+ */
6910
+ currency?: string | null;
6911
+ /**
6912
+ * The subscription's override discount for the plan.
6913
+ */
6914
+ discount?: OverrideUnitWithProrationPrice.Discount | null;
6915
+ /**
6916
+ * The starting quantity of the price, if the price is a fixed price.
6917
+ */
6918
+ fixed_price_quantity?: number | null;
6919
+ /**
6920
+ * The subscription's override maximum amount for the plan.
6921
+ */
6922
+ maximum_amount?: string | null;
6923
+ /**
6924
+ * The subscription's override minimum amount for the plan.
6925
+ */
6926
+ minimum_amount?: string | null;
6927
+ }
6928
+ namespace OverrideUnitWithProrationPrice {
6929
+ /**
6930
+ * The subscription's override discount for the plan.
6931
+ */
6932
+ interface Discount {
6933
+ discount_type: 'percentage' | 'trial' | 'usage' | 'amount';
6934
+ /**
6935
+ * Only available if discount_type is `amount`.
6936
+ */
6937
+ amount_discount?: string | null;
6938
+ /**
6939
+ * List of price_ids that this discount applies to. For plan/plan phase discounts,
6940
+ * this can be a subset of prices.
6941
+ */
6942
+ applies_to_price_ids?: Array<string> | null;
6943
+ /**
6944
+ * Only available if discount_type is `percentage`. This is a number between 0
6945
+ * and 1.
6946
+ */
6947
+ percentage_discount?: number | null;
6948
+ /**
6949
+ * Only available if discount_type is `trial`
6950
+ */
6951
+ trial_amount_discount?: string | null;
6952
+ /**
6953
+ * Only available if discount_type is `usage`. Number of usage units that this
6954
+ * discount is for
6955
+ */
6956
+ usage_discount?: number | null;
6957
+ }
6958
+ }
6959
+ interface OverrideTieredWithProrationPrice {
6960
+ id: string;
6961
+ model_type: 'tiered_with_proration';
6962
+ tiered_with_proration_config: Record<string, unknown>;
6963
+ /**
6964
+ * The per unit conversion rate of the price currency to the invoicing currency.
6965
+ */
6966
+ conversion_rate?: number | null;
6967
+ /**
6968
+ * The currency of the price. If not provided, the currency of the plan will be
6969
+ * used.
6970
+ */
6971
+ currency?: string | null;
6972
+ /**
6973
+ * The subscription's override discount for the plan.
6974
+ */
6975
+ discount?: OverrideTieredWithProrationPrice.Discount | null;
6976
+ /**
6977
+ * The starting quantity of the price, if the price is a fixed price.
6978
+ */
6979
+ fixed_price_quantity?: number | null;
6980
+ /**
6981
+ * The subscription's override maximum amount for the plan.
6982
+ */
6983
+ maximum_amount?: string | null;
6984
+ /**
6985
+ * The subscription's override minimum amount for the plan.
6986
+ */
6987
+ minimum_amount?: string | null;
6988
+ }
6989
+ namespace OverrideTieredWithProrationPrice {
6990
+ /**
6991
+ * The subscription's override discount for the plan.
6992
+ */
6993
+ interface Discount {
6994
+ discount_type: 'percentage' | 'trial' | 'usage' | 'amount';
6995
+ /**
6996
+ * Only available if discount_type is `amount`.
6997
+ */
6998
+ amount_discount?: string | null;
6999
+ /**
7000
+ * List of price_ids that this discount applies to. For plan/plan phase discounts,
7001
+ * this can be a subset of prices.
7002
+ */
7003
+ applies_to_price_ids?: Array<string> | null;
7004
+ /**
7005
+ * Only available if discount_type is `percentage`. This is a number between 0
7006
+ * and 1.
7007
+ */
7008
+ percentage_discount?: number | null;
7009
+ /**
7010
+ * Only available if discount_type is `trial`
7011
+ */
7012
+ trial_amount_discount?: string | null;
7013
+ /**
7014
+ * Only available if discount_type is `usage`. Number of usage units that this
7015
+ * discount is for
7016
+ */
7017
+ usage_discount?: number | null;
7018
+ }
7019
+ }
6776
7020
  }
6777
7021
  export interface SubscriptionTriggerPhaseParams {
6778
7022
  /**