orb-billing 4.72.3 → 4.74.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 (138) hide show
  1. package/CHANGELOG.md +30 -0
  2. package/README.md +18 -30
  3. package/index.d.mts +7 -4
  4. package/index.d.ts +7 -4
  5. package/index.d.ts.map +1 -1
  6. package/index.js +3 -0
  7. package/index.js.map +1 -1
  8. package/index.mjs +3 -0
  9. package/index.mjs.map +1 -1
  10. package/package.json +1 -1
  11. package/resources/alerts.d.ts +18 -0
  12. package/resources/alerts.d.ts.map +1 -1
  13. package/resources/alerts.js.map +1 -1
  14. package/resources/alerts.mjs.map +1 -1
  15. package/resources/beta/beta.d.ts +7492 -0
  16. package/resources/beta/beta.d.ts.map +1 -0
  17. package/resources/beta/beta.js +67 -0
  18. package/resources/beta/beta.js.map +1 -0
  19. package/resources/beta/beta.mjs +40 -0
  20. package/resources/beta/beta.mjs.map +1 -0
  21. package/resources/beta/external-plan-id.d.ts +7218 -0
  22. package/resources/beta/external-plan-id.d.ts.map +1 -0
  23. package/resources/beta/external-plan-id.js +40 -0
  24. package/resources/beta/external-plan-id.js.map +1 -0
  25. package/resources/beta/external-plan-id.mjs +36 -0
  26. package/resources/beta/external-plan-id.mjs.map +1 -0
  27. package/resources/beta/index.d.ts +3 -0
  28. package/resources/beta/index.d.ts.map +1 -0
  29. package/resources/beta/index.js +9 -0
  30. package/resources/beta/index.js.map +1 -0
  31. package/resources/beta/index.mjs +4 -0
  32. package/resources/beta/index.mjs.map +1 -0
  33. package/resources/beta.d.ts +2 -0
  34. package/resources/beta.d.ts.map +1 -0
  35. package/resources/beta.js +19 -0
  36. package/resources/beta.js.map +1 -0
  37. package/resources/beta.mjs +3 -0
  38. package/resources/beta.mjs.map +1 -0
  39. package/resources/credit-notes.d.ts +4 -4
  40. package/resources/credit-notes.d.ts.map +1 -1
  41. package/resources/customers/balance-transactions.d.ts +0 -7
  42. package/resources/customers/balance-transactions.d.ts.map +1 -1
  43. package/resources/customers/balance-transactions.js.map +1 -1
  44. package/resources/customers/balance-transactions.mjs.map +1 -1
  45. package/resources/customers/credits/ledger.d.ts +17 -0
  46. package/resources/customers/credits/ledger.d.ts.map +1 -1
  47. package/resources/customers/credits/ledger.js.map +1 -1
  48. package/resources/customers/credits/ledger.mjs.map +1 -1
  49. package/resources/customers/credits/top-ups.d.ts +26 -14
  50. package/resources/customers/credits/top-ups.d.ts.map +1 -1
  51. package/resources/customers/credits/top-ups.js.map +1 -1
  52. package/resources/customers/credits/top-ups.mjs.map +1 -1
  53. package/resources/customers/customers.d.ts +16 -7
  54. package/resources/customers/customers.d.ts.map +1 -1
  55. package/resources/customers/customers.js +1 -4
  56. package/resources/customers/customers.js.map +1 -1
  57. package/resources/customers/customers.mjs +1 -4
  58. package/resources/customers/customers.mjs.map +1 -1
  59. package/resources/dimensional-price-groups/dimensional-price-groups.d.ts +1 -1
  60. package/resources/dimensional-price-groups/dimensional-price-groups.js +1 -1
  61. package/resources/dimensional-price-groups/dimensional-price-groups.mjs +1 -1
  62. package/resources/events/events.d.ts +3 -3
  63. package/resources/events/events.d.ts.map +1 -1
  64. package/resources/index.d.ts +3 -2
  65. package/resources/index.d.ts.map +1 -1
  66. package/resources/index.js +3 -1
  67. package/resources/index.js.map +1 -1
  68. package/resources/index.mjs +1 -0
  69. package/resources/index.mjs.map +1 -1
  70. package/resources/invoice-line-items.d.ts +150 -10
  71. package/resources/invoice-line-items.d.ts.map +1 -1
  72. package/resources/invoices.d.ts +388 -28
  73. package/resources/invoices.d.ts.map +1 -1
  74. package/resources/invoices.js.map +1 -1
  75. package/resources/invoices.mjs.map +1 -1
  76. package/resources/items.d.ts +23 -0
  77. package/resources/items.d.ts.map +1 -1
  78. package/resources/items.js +6 -0
  79. package/resources/items.js.map +1 -1
  80. package/resources/items.mjs +6 -0
  81. package/resources/items.mjs.map +1 -1
  82. package/resources/plans/external-plan-id.d.ts +1 -1
  83. package/resources/plans/external-plan-id.js +1 -1
  84. package/resources/plans/external-plan-id.mjs +1 -1
  85. package/resources/plans/plans.d.ts +1153 -22
  86. package/resources/plans/plans.d.ts.map +1 -1
  87. package/resources/plans/plans.js +1 -1
  88. package/resources/plans/plans.js.map +1 -1
  89. package/resources/plans/plans.mjs +1 -1
  90. package/resources/plans/plans.mjs.map +1 -1
  91. package/resources/prices/index.d.ts +1 -1
  92. package/resources/prices/index.d.ts.map +1 -1
  93. package/resources/prices/index.js.map +1 -1
  94. package/resources/prices/index.mjs.map +1 -1
  95. package/resources/prices/prices.d.ts +6180 -123
  96. package/resources/prices/prices.d.ts.map +1 -1
  97. package/resources/prices/prices.js +40 -1
  98. package/resources/prices/prices.js.map +1 -1
  99. package/resources/prices/prices.mjs +40 -1
  100. package/resources/prices/prices.mjs.map +1 -1
  101. package/resources/shared.d.ts +14 -14
  102. package/resources/shared.d.ts.map +1 -1
  103. package/resources/subscription-changes.d.ts +648 -87
  104. package/resources/subscription-changes.d.ts.map +1 -1
  105. package/resources/subscriptions.d.ts +10981 -3716
  106. package/resources/subscriptions.d.ts.map +1 -1
  107. package/resources/subscriptions.js +6 -0
  108. package/resources/subscriptions.js.map +1 -1
  109. package/resources/subscriptions.mjs +6 -0
  110. package/resources/subscriptions.mjs.map +1 -1
  111. package/src/index.ts +25 -0
  112. package/src/resources/alerts.ts +21 -0
  113. package/src/resources/beta/beta.ts +9106 -0
  114. package/src/resources/beta/external-plan-id.ts +8748 -0
  115. package/src/resources/beta/index.ts +14 -0
  116. package/src/resources/beta.ts +3 -0
  117. package/src/resources/credit-notes.ts +4 -4
  118. package/src/resources/customers/balance-transactions.ts +0 -7
  119. package/src/resources/customers/credits/ledger.ts +21 -0
  120. package/src/resources/customers/credits/top-ups.ts +26 -14
  121. package/src/resources/customers/customers.ts +22 -4
  122. package/src/resources/dimensional-price-groups/dimensional-price-groups.ts +1 -1
  123. package/src/resources/events/events.ts +3 -3
  124. package/src/resources/index.ts +11 -0
  125. package/src/resources/invoice-line-items.ts +178 -10
  126. package/src/resources/invoices.ts +460 -28
  127. package/src/resources/items.ts +29 -0
  128. package/src/resources/plans/external-plan-id.ts +1 -1
  129. package/src/resources/plans/plans.ts +1375 -30
  130. package/src/resources/prices/index.ts +2 -0
  131. package/src/resources/prices/prices.ts +7345 -135
  132. package/src/resources/shared.ts +18 -18
  133. package/src/resources/subscription-changes.ts +771 -102
  134. package/src/resources/subscriptions.ts +13383 -4686
  135. package/src/version.ts +1 -1
  136. package/version.d.ts +1 -1
  137. package/version.js +1 -1
  138. package/version.mjs +1 -1
@@ -37,7 +37,7 @@ class Prices extends resource_1.APIResource {
37
37
  }
38
38
  /**
39
39
  * This endpoint is used to create a [price](/product-catalog/price-configuration).
40
- * A price created using this endpoint is always an add-on, meaning that its not
40
+ * A price created using this endpoint is always an add-on, meaning that it's not
41
41
  * associated with a specific plan and can instead be individually added to
42
42
  * subscriptions, including subscriptions on different plans.
43
43
  *
@@ -65,6 +65,10 @@ class Prices extends resource_1.APIResource {
65
65
  return this._client.getAPIList('/prices', PricesPage, { query, ...options });
66
66
  }
67
67
  /**
68
+ * [NOTE] It is recommended to use the `/v1/prices/evaluate` which offers further
69
+ * functionality, such as multiple prices, inline price definitions, and querying
70
+ * over preview events.
71
+ *
68
72
  * This endpoint is used to evaluate the output of a price for a given customer and
69
73
  * time range. It enables filtering and grouping the output using
70
74
  * [computed properties](/extensibility/advanced-metrics#computed-properties),
@@ -90,6 +94,41 @@ class Prices extends resource_1.APIResource {
90
94
  evaluate(priceId, body, options) {
91
95
  return this._client.post(`/prices/${priceId}/evaluate`, { body, ...options });
92
96
  }
97
+ /**
98
+ * This endpoint is used to evaluate the output of price(s) for a given customer
99
+ * and time range over either ingested events or preview events. It enables
100
+ * filtering and grouping the output using
101
+ * [computed properties](/extensibility/advanced-metrics#computed-properties),
102
+ * supporting the following workflows:
103
+ *
104
+ * 1. Showing detailed usage and costs to the end customer.
105
+ * 2. Auditing subtotals on invoice line items.
106
+ *
107
+ * Prices may either reference existing prices in your Orb account or be defined
108
+ * inline in the request body. Up to 100 prices can be evaluated in a single
109
+ * request.
110
+ *
111
+ * Price evaluation by default uses ingested events, but you can also provide a
112
+ * list of preview events to use instead. Up to 500 preview events can be provided
113
+ * in a single request. When using ingested events, the start of the time range
114
+ * must be no more than 100 days ago.
115
+ *
116
+ * For these workflows, the expressiveness of computed properties in both the
117
+ * filters and grouping is critical. For example, if you'd like to show your
118
+ * customer their usage grouped by hour and another property, you can do so with
119
+ * the following `grouping_keys`:
120
+ * `["hour_floor_timestamp_millis(timestamp_millis)", "my_property"]`. If you'd
121
+ * like to examine a customer's usage for a specific property value, you can do so
122
+ * with the following `filter`:
123
+ * `my_property = 'foo' AND my_other_property = 'bar'`.
124
+ *
125
+ * The length of the results must be no greater than 1000. Note that this is a POST
126
+ * endpoint rather than a GET endpoint because it employs a JSON body rather than
127
+ * query parameters.
128
+ */
129
+ evaluateMultiple(body, options) {
130
+ return this._client.post('/prices/evaluate', { body, ...options });
131
+ }
93
132
  /**
94
133
  * This endpoint returns a price given an identifier.
95
134
  */
@@ -1 +1 @@
1
- {"version":3,"file":"prices.js","sourceRoot":"","sources":["../../src/resources/prices/prices.ts"],"names":[],"mappings":";AAAA,sFAAsF;;;;;;;;;;;;;;;;;;;;;;;;;;AAEtF,gDAA6C;AAC7C,wCAA8C;AAG9C,2EAA0D;AAC1D,8DAAmF;AACnF,oDAAyD;AAEzD,MAAa,MAAO,SAAQ,sBAAW;IAAvC;;QACE,oBAAe,GAAuC,IAAI,kBAAkB,CAAC,eAAe,CAAC,IAAI,CAAC,OAAO,CAAC,CAAC;IAgF7G,CAAC;IA9EC;;;;;;;;;;;OAWG;IACH,MAAM,CAAC,IAAuB,EAAE,OAA6B;QAC3D,OAAO,IAAI,CAAC,OAAO,CAAC,IAAI,CAAC,SAAS,EAAE,EAAE,IAAI,EAAE,GAAG,OAAO,EAAE,CAAC,CAAC;IAC5D,CAAC;IAED;;;;OAIG;IACH,MAAM,CAAC,OAAe,EAAE,IAAu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,OAAe,EAAE,OAA6B;QAClD,OAAO,IAAI,CAAC,OAAO,CAAC,GAAG,CAAC,WAAW,OAAO,EAAE,EAAE,OAAO,CAAC,CAAC;IACzD,CAAC;CACF;AA5HD,wBA4HC;AAED,MAAa,UAAW,SAAQ,iBAAW;CAAG;AAA9C,gCAA8C;AAw1b9C,MAAM,CAAC,UAAU,GAAG,UAAU,CAAC;AAC/B,MAAM,CAAC,eAAe,GAAG,mCAAe,CAAC"}
@@ -11,7 +11,7 @@ export class Prices extends APIResource {
11
11
  }
12
12
  /**
13
13
  * This endpoint is used to create a [price](/product-catalog/price-configuration).
14
- * A price created using this endpoint is always an add-on, meaning that its not
14
+ * A price created using this endpoint is always an add-on, meaning that it's not
15
15
  * associated with a specific plan and can instead be individually added to
16
16
  * subscriptions, including subscriptions on different plans.
17
17
  *
@@ -39,6 +39,10 @@ export class Prices extends APIResource {
39
39
  return this._client.getAPIList('/prices', PricesPage, { query, ...options });
40
40
  }
41
41
  /**
42
+ * [NOTE] It is recommended to use the `/v1/prices/evaluate` which offers further
43
+ * functionality, such as multiple prices, inline price definitions, and querying
44
+ * over preview events.
45
+ *
42
46
  * This endpoint is used to evaluate the output of a price for a given customer and
43
47
  * time range. It enables filtering and grouping the output using
44
48
  * [computed properties](/extensibility/advanced-metrics#computed-properties),
@@ -64,6 +68,41 @@ export class Prices extends APIResource {
64
68
  evaluate(priceId, body, options) {
65
69
  return this._client.post(`/prices/${priceId}/evaluate`, { body, ...options });
66
70
  }
71
+ /**
72
+ * This endpoint is used to evaluate the output of price(s) for a given customer
73
+ * and time range over either ingested events or preview events. It enables
74
+ * filtering and grouping the output using
75
+ * [computed properties](/extensibility/advanced-metrics#computed-properties),
76
+ * supporting the following workflows:
77
+ *
78
+ * 1. Showing detailed usage and costs to the end customer.
79
+ * 2. Auditing subtotals on invoice line items.
80
+ *
81
+ * Prices may either reference existing prices in your Orb account or be defined
82
+ * inline in the request body. Up to 100 prices can be evaluated in a single
83
+ * request.
84
+ *
85
+ * Price evaluation by default uses ingested events, but you can also provide a
86
+ * list of preview events to use instead. Up to 500 preview events can be provided
87
+ * in a single request. When using ingested events, the start of the time range
88
+ * must be no more than 100 days ago.
89
+ *
90
+ * For these workflows, the expressiveness of computed properties in both the
91
+ * filters and grouping is critical. For example, if you'd like to show your
92
+ * customer their usage grouped by hour and another property, you can do so with
93
+ * the following `grouping_keys`:
94
+ * `["hour_floor_timestamp_millis(timestamp_millis)", "my_property"]`. If you'd
95
+ * like to examine a customer's usage for a specific property value, you can do so
96
+ * with the following `filter`:
97
+ * `my_property = 'foo' AND my_other_property = 'bar'`.
98
+ *
99
+ * The length of the results must be no greater than 1000. Note that this is a POST
100
+ * endpoint rather than a GET endpoint because it employs a JSON body rather than
101
+ * query parameters.
102
+ */
103
+ evaluateMultiple(body, options) {
104
+ return this._client.post('/prices/evaluate', { body, ...options });
105
+ }
67
106
  /**
68
107
  * This endpoint returns a price given an identifier.
69
108
  */
@@ -1 +1 @@
1
- {"version":3,"file":"prices.mjs","sourceRoot":"","sources":["../../src/resources/prices/prices.ts"],"names":[],"mappings":"AAAA,sFAAsF;OAE/E,EAAE,WAAW,EAAE;OACf,EAAE,gBAAgB,EAAE;OAGpB,KAAK,kBAAkB;OACvB,EAAE,eAAe,EAA+B;OAChD,EAAE,IAAI,EAAmB;AAEhC,MAAM,OAAO,MAAO,SAAQ,WAAW;IAAvC;;QACE,oBAAe,GAAuC,IAAI,kBAAkB,CAAC,eAAe,CAAC,IAAI,CAAC,OAAO,CAAC,CAAC;IAgF7G,CAAC;IA9EC;;;;;;;;;;;OAWG;IACH,MAAM,CAAC,IAAuB,EAAE,OAA6B;QAC3D,OAAO,IAAI,CAAC,OAAO,CAAC,IAAI,CAAC,SAAS,EAAE,EAAE,IAAI,EAAE,GAAG,OAAO,EAAE,CAAC,CAAC;IAC5D,CAAC;IAED;;;;OAIG;IACH,MAAM,CAAC,OAAe,EAAE,IAAuB,EAAE,OAA6B;QAC5E,OAAO,IAAI,CAAC,O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AG,CAAC,WAAW,OAAO,EAAE,EAAE,OAAO,CAAC,CAAC;IACzD,CAAC;CACF;AAED,MAAM,OAAO,UAAW,SAAQ,IAAW;CAAG;AAw1b9C,MAAM,CAAC,UAAU,GAAG,UAAU,CAAC;AAC/B,MAAM,CAAC,eAAe,GAAG,eAAe,CAAC"}
@@ -3,12 +3,12 @@ export interface AmountDiscount {
3
3
  * Only available if discount_type is `amount`.
4
4
  */
5
5
  amount_discount: string;
6
+ discount_type: 'amount';
6
7
  /**
7
8
  * List of price_ids that this discount applies to. For plan/plan phase discounts,
8
9
  * this can be a subset of prices.
9
10
  */
10
- applies_to_price_ids: Array<string>;
11
- discount_type: 'amount';
11
+ applies_to_price_ids?: Array<string> | null;
12
12
  reason?: string | null;
13
13
  }
14
14
  export type BillingCycleRelativeDate = 'start_of_term' | 'end_of_term';
@@ -19,26 +19,26 @@ export interface PaginationMetadata {
19
19
  next_cursor: string | null;
20
20
  }
21
21
  export interface PercentageDiscount {
22
- /**
23
- * List of price_ids that this discount applies to. For plan/plan phase discounts,
24
- * this can be a subset of prices.
25
- */
26
- applies_to_price_ids: Array<string>;
27
22
  discount_type: 'percentage';
28
23
  /**
29
24
  * Only available if discount_type is `percentage`. This is a number between 0
30
25
  * and 1.
31
26
  */
32
27
  percentage_discount: number;
28
+ /**
29
+ * List of price_ids that this discount applies to. For plan/plan phase discounts,
30
+ * this can be a subset of prices.
31
+ */
32
+ applies_to_price_ids?: Array<string> | null;
33
33
  reason?: string | null;
34
34
  }
35
35
  export interface TrialDiscount {
36
+ discount_type: 'trial';
36
37
  /**
37
38
  * List of price_ids that this discount applies to. For plan/plan phase discounts,
38
39
  * this can be a subset of prices.
39
40
  */
40
- applies_to_price_ids: Array<string>;
41
- discount_type: 'trial';
41
+ applies_to_price_ids?: Array<string> | null;
42
42
  reason?: string | null;
43
43
  /**
44
44
  * Only available if discount_type is `trial`
@@ -50,17 +50,17 @@ export interface TrialDiscount {
50
50
  trial_percentage_discount?: number | null;
51
51
  }
52
52
  export interface UsageDiscount {
53
- /**
54
- * List of price_ids that this discount applies to. For plan/plan phase discounts,
55
- * this can be a subset of prices.
56
- */
57
- applies_to_price_ids: Array<string>;
58
53
  discount_type: 'usage';
59
54
  /**
60
55
  * Only available if discount_type is `usage`. Number of usage units that this
61
56
  * discount is for
62
57
  */
63
58
  usage_discount: number;
59
+ /**
60
+ * List of price_ids that this discount applies to. For plan/plan phase discounts,
61
+ * this can be a subset of prices.
62
+ */
63
+ applies_to_price_ids?: Array<string> | null;
64
64
  reason?: string | null;
65
65
  }
66
66
  //# sourceMappingURL=shared.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"shared.d.ts","sourceRoot":"","sources":["../src/resources/shared.ts"],"names":[],"mappings":"AAEA,MAAM,WAAW,cAAc;IAC7B;;OAEG;IACH,eAAe,EAAE,MAAM,CAAC;IAExB;;;OAGG;IACH,oBAAoB,EAAE,KAAK,CAAC,MAAM,CAAC,CAAC;IAEpC,aAAa,EAAE,QAAQ,CAAC;IAExB,MAAM,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC;CACxB;AAED,MAAM,MAAM,wBAAwB,GAAG,eAAe,GAAG,aAAa,CAAC;AAEvE,MAAM,MAAM,QAAQ,GAAG,kBAAkB,GAAG,aAAa,GAAG,aAAa,GAAG,cAAc,CAAC;AAE3F,MAAM,MAAM,oBAAoB,GAAG,kBAAkB,GAAG,cAAc,GAAG,aAAa,CAAC;AAEvF,MAAM,WAAW,kBAAkB;IACjC,QAAQ,EAAE,OAAO,CAAC;IAElB,WAAW,EAAE,MAAM,GAAG,IAAI,CAAC;CAC5B;AAED,MAAM,WAAW,kBAAkB;IACjC;;;OAGG;IACH,oBAAoB,EAAE,KAAK,CAAC,MAAM,CAAC,CAAC;IAEpC,aAAa,EAAE,YAAY,CAAC;IAE5B;;;OAGG;IACH,mBAAmB,EAAE,MAAM,CAAC;IAE5B,MAAM,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC;CACxB;AAED,MAAM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