orb-billing 5.48.0 → 5.75.1
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.
- package/CHANGELOG.md +241 -0
- package/core.js +2 -2
- package/core.js.map +1 -1
- package/core.mjs +2 -2
- package/core.mjs.map +1 -1
- package/index.d.ts.map +1 -1
- package/index.js +11 -0
- package/index.js.map +1 -1
- package/index.mjs +11 -0
- package/index.mjs.map +1 -1
- package/package.json +1 -1
- package/resources/alerts.d.ts +140 -3
- package/resources/alerts.d.ts.map +1 -1
- package/resources/alerts.js.map +1 -1
- package/resources/alerts.mjs.map +1 -1
- package/resources/beta/beta.d.ts +738 -7570
- package/resources/beta/beta.d.ts.map +1 -1
- package/resources/beta/beta.js.map +1 -1
- package/resources/beta/beta.mjs.map +1 -1
- package/resources/beta/external-plan-id.d.ts +664 -7572
- package/resources/beta/external-plan-id.d.ts.map +1 -1
- package/resources/coupons/coupons.d.ts +29 -0
- package/resources/coupons/coupons.d.ts.map +1 -1
- package/resources/coupons/coupons.js +21 -0
- package/resources/coupons/coupons.js.map +1 -1
- package/resources/coupons/coupons.mjs +21 -0
- package/resources/coupons/coupons.mjs.map +1 -1
- package/resources/coupons/subscriptions.d.ts +10 -0
- package/resources/coupons/subscriptions.d.ts.map +1 -1
- package/resources/coupons/subscriptions.js.map +1 -1
- package/resources/coupons/subscriptions.mjs.map +1 -1
- package/resources/credit-blocks.d.ts +98 -7
- package/resources/credit-blocks.d.ts.map +1 -1
- package/resources/credit-blocks.js +10 -7
- package/resources/credit-blocks.js.map +1 -1
- package/resources/credit-blocks.mjs +10 -7
- package/resources/credit-blocks.mjs.map +1 -1
- package/resources/credit-notes.d.ts +28 -0
- package/resources/credit-notes.d.ts.map +1 -1
- package/resources/credit-notes.js +20 -0
- package/resources/credit-notes.js.map +1 -1
- package/resources/credit-notes.mjs +20 -0
- package/resources/credit-notes.mjs.map +1 -1
- package/resources/customers/credits/credits.d.ts +89 -0
- package/resources/customers/credits/credits.d.ts.map +1 -1
- package/resources/customers/credits/credits.js.map +1 -1
- package/resources/customers/credits/credits.mjs.map +1 -1
- package/resources/customers/credits/ledger.d.ts +34 -20
- package/resources/customers/credits/ledger.d.ts.map +1 -1
- package/resources/customers/credits/ledger.js +28 -14
- package/resources/customers/credits/ledger.js.map +1 -1
- package/resources/customers/credits/ledger.mjs +28 -14
- package/resources/customers/credits/ledger.mjs.map +1 -1
- package/resources/customers/customers.d.ts +89 -6
- package/resources/customers/customers.d.ts.map +1 -1
- package/resources/customers/customers.js.map +1 -1
- package/resources/customers/customers.mjs.map +1 -1
- package/resources/dimensional-price-groups/dimensional-price-groups.d.ts +35 -1
- package/resources/dimensional-price-groups/dimensional-price-groups.d.ts.map +1 -1
- package/resources/dimensional-price-groups/dimensional-price-groups.js +26 -0
- package/resources/dimensional-price-groups/dimensional-price-groups.js.map +1 -1
- package/resources/dimensional-price-groups/dimensional-price-groups.mjs +26 -0
- package/resources/dimensional-price-groups/dimensional-price-groups.mjs.map +1 -1
- package/resources/dimensional-price-groups/external-dimensional-price-group-id.d.ts +16 -0
- package/resources/dimensional-price-groups/external-dimensional-price-group-id.d.ts.map +1 -1
- package/resources/dimensional-price-groups/external-dimensional-price-group-id.js +16 -0
- package/resources/dimensional-price-groups/external-dimensional-price-group-id.js.map +1 -1
- package/resources/dimensional-price-groups/external-dimensional-price-group-id.mjs +16 -0
- package/resources/dimensional-price-groups/external-dimensional-price-group-id.mjs.map +1 -1
- package/resources/events/backfills.d.ts +37 -0
- package/resources/events/backfills.d.ts.map +1 -1
- package/resources/events/backfills.js +29 -0
- package/resources/events/backfills.js.map +1 -1
- package/resources/events/backfills.mjs +29 -0
- package/resources/events/backfills.mjs.map +1 -1
- package/resources/events/events.d.ts +41 -33
- package/resources/events/events.d.ts.map +1 -1
- package/resources/events/events.js +39 -31
- package/resources/events/events.js.map +1 -1
- package/resources/events/events.mjs +39 -31
- package/resources/events/events.mjs.map +1 -1
- package/resources/events/volume.d.ts +7 -0
- package/resources/events/volume.d.ts.map +1 -1
- package/resources/events/volume.js +7 -0
- package/resources/events/volume.js.map +1 -1
- package/resources/events/volume.mjs +7 -0
- package/resources/events/volume.mjs.map +1 -1
- package/resources/invoice-line-items.d.ts +89 -1
- package/resources/invoice-line-items.d.ts.map +1 -1
- package/resources/invoice-line-items.js +12 -0
- package/resources/invoice-line-items.js.map +1 -1
- package/resources/invoice-line-items.mjs +12 -0
- package/resources/invoice-line-items.mjs.map +1 -1
- package/resources/invoices.d.ts +200 -12
- package/resources/invoices.d.ts.map +1 -1
- package/resources/invoices.js +64 -0
- package/resources/invoices.js.map +1 -1
- package/resources/invoices.mjs +64 -0
- package/resources/invoices.mjs.map +1 -1
- package/resources/items.d.ts +30 -0
- package/resources/items.d.ts.map +1 -1
- package/resources/items.js +22 -0
- package/resources/items.js.map +1 -1
- package/resources/items.mjs +22 -0
- package/resources/items.mjs.map +1 -1
- package/resources/licenses/external-licenses.d.ts +13 -1
- package/resources/licenses/external-licenses.d.ts.map +1 -1
- package/resources/licenses/external-licenses.js +12 -0
- package/resources/licenses/external-licenses.js.map +1 -1
- package/resources/licenses/external-licenses.mjs +12 -0
- package/resources/licenses/external-licenses.mjs.map +1 -1
- package/resources/licenses/licenses.d.ts +44 -0
- package/resources/licenses/licenses.d.ts.map +1 -1
- package/resources/licenses/licenses.js +44 -0
- package/resources/licenses/licenses.js.map +1 -1
- package/resources/licenses/licenses.mjs +44 -0
- package/resources/licenses/licenses.mjs.map +1 -1
- package/resources/licenses/usage.d.ts +17 -2
- package/resources/licenses/usage.d.ts.map +1 -1
- package/resources/licenses/usage.js +8 -0
- package/resources/licenses/usage.js.map +1 -1
- package/resources/licenses/usage.mjs +8 -0
- package/resources/licenses/usage.mjs.map +1 -1
- package/resources/metrics.d.ts +37 -5
- package/resources/metrics.d.ts.map +1 -1
- package/resources/metrics.js +27 -2
- package/resources/metrics.js.map +1 -1
- package/resources/metrics.mjs +27 -2
- package/resources/metrics.mjs.map +1 -1
- package/resources/plans/external-plan-id.d.ts +6 -2
- package/resources/plans/external-plan-id.d.ts.map +1 -1
- package/resources/plans/external-plan-id.js +2 -2
- package/resources/plans/external-plan-id.mjs +2 -2
- package/resources/plans/migrations.d.ts +42 -0
- package/resources/plans/migrations.d.ts.map +1 -1
- package/resources/plans/migrations.js.map +1 -1
- package/resources/plans/migrations.mjs.map +1 -1
- package/resources/plans/plans.d.ts +382 -3754
- package/resources/plans/plans.d.ts.map +1 -1
- package/resources/plans/plans.js +2 -2
- package/resources/plans/plans.js.map +1 -1
- package/resources/plans/plans.mjs +2 -2
- package/resources/plans/plans.mjs.map +1 -1
- package/resources/prices/external-price-id.d.ts +14 -0
- package/resources/prices/external-price-id.d.ts.map +1 -1
- package/resources/prices/external-price-id.js +14 -0
- package/resources/prices/external-price-id.js.map +1 -1
- package/resources/prices/external-price-id.mjs +14 -0
- package/resources/prices/external-price-id.mjs.map +1 -1
- package/resources/prices/prices.d.ts +1632 -393
- package/resources/prices/prices.d.ts.map +1 -1
- package/resources/prices/prices.js +46 -0
- package/resources/prices/prices.js.map +1 -1
- package/resources/prices/prices.mjs +46 -0
- package/resources/prices/prices.mjs.map +1 -1
- package/resources/shared.d.ts +922 -52
- package/resources/shared.d.ts.map +1 -1
- package/resources/shared.js.map +1 -1
- package/resources/shared.mjs.map +1 -1
- package/resources/subscription-changes.d.ts +72 -1
- package/resources/subscription-changes.d.ts.map +1 -1
- package/resources/subscription-changes.js.map +1 -1
- package/resources/subscription-changes.mjs.map +1 -1
- package/resources/subscriptions.d.ts +3075 -464
- package/resources/subscriptions.d.ts.map +1 -1
- package/resources/subscriptions.js +111 -0
- package/resources/subscriptions.js.map +1 -1
- package/resources/subscriptions.mjs +111 -0
- package/resources/subscriptions.mjs.map +1 -1
- package/src/core.ts +2 -2
- package/src/index.ts +12 -0
- package/src/resources/alerts.ts +161 -3
- package/src/resources/beta/beta.ts +828 -8988
- package/src/resources/beta/external-plan-id.ts +745 -8997
- package/src/resources/coupons/coupons.ts +29 -0
- package/src/resources/coupons/subscriptions.ts +10 -0
- package/src/resources/credit-blocks.ts +120 -7
- package/src/resources/credit-notes.ts +28 -0
- package/src/resources/customers/credits/credits.ts +111 -0
- package/src/resources/customers/credits/ledger.ts +34 -20
- package/src/resources/customers/customers.ts +99 -6
- package/src/resources/dimensional-price-groups/dimensional-price-groups.ts +35 -1
- package/src/resources/dimensional-price-groups/external-dimensional-price-group-id.ts +16 -0
- package/src/resources/events/backfills.ts +37 -0
- package/src/resources/events/events.ts +41 -33
- package/src/resources/events/volume.ts +7 -0
- package/src/resources/invoice-line-items.ts +104 -0
- package/src/resources/invoices.ts +215 -11
- package/src/resources/items.ts +30 -0
- package/src/resources/licenses/external-licenses.ts +13 -1
- package/src/resources/licenses/licenses.ts +44 -0
- package/src/resources/licenses/usage.ts +17 -2
- package/src/resources/metrics.ts +37 -5
- package/src/resources/plans/external-plan-id.ts +7 -2
- package/src/resources/plans/migrations.ts +42 -0
- package/src/resources/plans/plans.ts +456 -4482
- package/src/resources/prices/external-price-id.ts +14 -0
- package/src/resources/prices/prices.ts +1743 -264
- package/src/resources/shared.ts +1172 -50
- package/src/resources/subscription-changes.ts +88 -1
- package/src/resources/subscriptions.ts +4707 -1585
- package/src/version.ts +1 -1
- package/version.d.ts +1 -1
- package/version.js +1 -1
- package/version.mjs +1 -1
|
@@ -61,6 +61,15 @@ export class Events extends APIResource {
|
|
|
61
61
|
* - By default, no more than 100 events can be amended for a single customer in a
|
|
62
62
|
* 100 day period. For higher volume updates, consider using the
|
|
63
63
|
* [event backfill](create-backfill) endpoint.
|
|
64
|
+
*
|
|
65
|
+
* @example
|
|
66
|
+
* ```ts
|
|
67
|
+
* const event = await client.events.update('event_id', {
|
|
68
|
+
* event_name: 'event_name',
|
|
69
|
+
* properties: { foo: 'bar' },
|
|
70
|
+
* timestamp: '2020-12-09T16:09:53Z',
|
|
71
|
+
* });
|
|
72
|
+
* ```
|
|
64
73
|
*/
|
|
65
74
|
update(eventId, body, options) {
|
|
66
75
|
return this._client.put(`/events/${eventId}`, { body, ...options });
|
|
@@ -106,6 +115,11 @@ export class Events extends APIResource {
|
|
|
106
115
|
* - By default, no more than 100 events can be deprecated for a single customer in
|
|
107
116
|
* a 100 day period. For higher volume updates, consider using the
|
|
108
117
|
* [event backfill](create-backfill) endpoint.
|
|
118
|
+
*
|
|
119
|
+
* @example
|
|
120
|
+
* ```ts
|
|
121
|
+
* const response = await client.events.deprecate('event_id');
|
|
122
|
+
* ```
|
|
109
123
|
*/
|
|
110
124
|
deprecate(eventId, options) {
|
|
111
125
|
return this._client.put(`/events/${eventId}/deprecate`, options);
|
|
@@ -226,8 +240,8 @@ export class Events extends APIResource {
|
|
|
226
240
|
* billed for in the corresponding billing period.
|
|
227
241
|
*
|
|
228
242
|
* In general, Orb does not expect events with future dated timestamps. In cases
|
|
229
|
-
* where the timestamp is
|
|
230
|
-
*
|
|
243
|
+
* where the timestamp is 5 minutes ahead of the current time, the event will not
|
|
244
|
+
* be accepted as a valid event, and will throw validation errors.
|
|
231
245
|
*
|
|
232
246
|
* ## Event validation
|
|
233
247
|
*
|
|
@@ -242,9 +256,9 @@ export class Events extends APIResource {
|
|
|
242
256
|
* - If the `external_customer_id` is specified, the customer in Orb does not need
|
|
243
257
|
* to exist. Events will be attributed to any future customers with the
|
|
244
258
|
* `external_customer_id` on subscription creation.
|
|
245
|
-
* - `timestamp` must conform to ISO 8601 and represent a timestamp at most
|
|
246
|
-
* in the future. This timestamp should be sent in UTC timezone (no
|
|
247
|
-
* offset).
|
|
259
|
+
* - `timestamp` must conform to ISO 8601 and represent a timestamp at most 5
|
|
260
|
+
* minutes in the future. This timestamp should be sent in UTC timezone (no
|
|
261
|
+
* timezone offset).
|
|
248
262
|
*
|
|
249
263
|
* ## Idempotency and retry semantics
|
|
250
264
|
*
|
|
@@ -281,39 +295,26 @@ export class Events extends APIResource {
|
|
|
281
295
|
* request payload size, but please give us a heads up if you’re changing either of
|
|
282
296
|
* these factors by an order of magnitude from initial setup.
|
|
283
297
|
*
|
|
284
|
-
*
|
|
285
|
-
*
|
|
286
|
-
* The ingestion API supports a debug mode, which returns additional verbose output
|
|
287
|
-
* to indicate which event idempotency keys were newly ingested or duplicates from
|
|
288
|
-
* previous requests. To enable this mode, mark `debug=true` as a query parameter.
|
|
289
|
-
*
|
|
290
|
-
* If `debug=true` is not specified, the response will only contain
|
|
291
|
-
* `validation_failed`. Orb will still honor the idempotency guarantees set
|
|
292
|
-
* [here](/events-and-metrics/event-ingestion#event-volume-and-concurrency) in all
|
|
293
|
-
* cases.
|
|
294
|
-
*
|
|
295
|
-
* We strongly recommend that you only use debug mode as part of testing your
|
|
296
|
-
* initial Orb integration. Once you're ready to switch to production, disable
|
|
297
|
-
* debug mode to take advantage of improved performance and maximal throughput.
|
|
298
|
-
*
|
|
299
|
-
* #### Example: ingestion response with `debug=true`
|
|
298
|
+
* #### Example: ingestion response
|
|
300
299
|
*
|
|
301
300
|
* ```json
|
|
302
301
|
* {
|
|
303
|
-
* "debug": {
|
|
304
|
-
* "duplicate": [],
|
|
305
|
-
* "ingested": ["B7E83HDMfJPAunXW", "SJs5DQJ3TnwSqEZE", "8SivfDsNKwCeAXim"]
|
|
306
|
-
* },
|
|
307
302
|
* "validation_failed": []
|
|
308
303
|
* }
|
|
309
304
|
* ```
|
|
310
305
|
*
|
|
311
|
-
*
|
|
312
|
-
*
|
|
313
|
-
*
|
|
314
|
-
*
|
|
315
|
-
*
|
|
316
|
-
*
|
|
306
|
+
* @example
|
|
307
|
+
* ```ts
|
|
308
|
+
* const response = await client.events.ingest({
|
|
309
|
+
* events: [
|
|
310
|
+
* {
|
|
311
|
+
* event_name: 'event_name',
|
|
312
|
+
* idempotency_key: 'idempotency_key',
|
|
313
|
+
* properties: { foo: 'bar' },
|
|
314
|
+
* timestamp: '2020-12-09T16:09:53Z',
|
|
315
|
+
* },
|
|
316
|
+
* ],
|
|
317
|
+
* });
|
|
317
318
|
* ```
|
|
318
319
|
*/
|
|
319
320
|
ingest(params, options) {
|
|
@@ -336,6 +337,13 @@ export class Events extends APIResource {
|
|
|
336
337
|
*
|
|
337
338
|
* By default, Orb will not throw a `404` if no events matched, Orb will return an
|
|
338
339
|
* empty array for `data` instead.
|
|
340
|
+
*
|
|
341
|
+
* @example
|
|
342
|
+
* ```ts
|
|
343
|
+
* const response = await client.events.search({
|
|
344
|
+
* event_ids: ['string'],
|
|
345
|
+
* });
|
|
346
|
+
* ```
|
|
339
347
|
*/
|
|
340
348
|
search(body, options) {
|
|
341
349
|
return this._client.post('/events/search', { body, ...options });
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"events.mjs","sourceRoot":"","sources":["../../src/resources/events/events.ts"],"names":[],"mappings":"AAAA,sFAAsF;OAE/E,EAAE,WAAW,EAAE;OAEf,KAAK,YAAY;OACjB,EAOL,yBAAyB,EAEzB,SAAS,GACV;OACM,KAAK,SAAS;OACd,EAAgB,MAAM,EAAoB;AAEjD;;;;GAIG;AACH,MAAM,OAAO,MAAO,SAAQ,WAAW;IAAvC;;QACE,cAAS,GAA2B,IAAI,YAAY,CAAC,SAAS,CAAC,IAAI,CAAC,OAAO,CAAC,CAAC;QAC7E,WAAM,GAAqB,IAAI,SAAS,CAAC,MAAM,CAAC,IAAI,CAAC,OAAO,CAAC,CAAC;
|
|
1
|
+
{"version":3,"file":"events.mjs","sourceRoot":"","sources":["../../src/resources/events/events.ts"],"names":[],"mappings":"AAAA,sFAAsF;OAE/E,EAAE,WAAW,EAAE;OAEf,KAAK,YAAY;OACjB,EAOL,yBAAyB,EAEzB,SAAS,GACV;OACM,KAAK,SAAS;OACd,EAAgB,MAAM,EAAoB;AAEjD;;;;GAIG;AACH,MAAM,OAAO,MAAO,SAAQ,WAAW;IAAvC;;QACE,cAAS,GAA2B,IAAI,YAAY,CAAC,SAAS,CAAC,IAAI,CAAC,OAAO,CAAC,CAAC;QAC7E,WAAM,GAAqB,IAAI,SAAS,CAAC,MAAM,CAAC,IAAI,CAAC,OAAO,C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AAM,CAAC,SAAS,GAAG,SAAS,CAAC;AAC7B,MAAM,CAAC,yBAAyB,GAAG,yBAAyB,CAAC;AAC7D,MAAM,CAAC,MAAM,GAAG,MAAM,CAAC"}
|
|
@@ -20,6 +20,13 @@ export declare class Volume extends APIResource {
|
|
|
20
20
|
* where the start and end time are hour-aligned and in UTC. When a specific
|
|
21
21
|
* timestamp is passed in for either start or end time, the response includes the
|
|
22
22
|
* hours the timestamp falls in.
|
|
23
|
+
*
|
|
24
|
+
* @example
|
|
25
|
+
* ```ts
|
|
26
|
+
* const eventVolumes = await client.events.volume.list({
|
|
27
|
+
* timeframe_start: '2019-12-27T18:11:19.117Z',
|
|
28
|
+
* });
|
|
29
|
+
* ```
|
|
23
30
|
*/
|
|
24
31
|
list(query: VolumeListParams, options?: Core.RequestOptions): Core.APIPromise<EventVolumes>;
|
|
25
32
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"volume.d.ts","sourceRoot":"","sources":["../../src/resources/events/volume.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,WAAW,EAAE,MAAM,gBAAgB,CAAC;AAC7C,OAAO,KAAK,IAAI,MAAM,YAAY,CAAC;AAEnC;;;;GAIG;AACH,qBAAa,MAAO,SAAQ,WAAW;IACrC
|
|
1
|
+
{"version":3,"file":"volume.d.ts","sourceRoot":"","sources":["../../src/resources/events/volume.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,WAAW,EAAE,MAAM,gBAAgB,CAAC;AAC7C,OAAO,KAAK,IAAI,MAAM,YAAY,CAAC;AAEnC;;;;GAIG;AACH,qBAAa,MAAO,SAAQ,WAAW;IACrC;;;;;;;;;;;;;;;;;;;;;OAqBG;IACH,IAAI,CAAC,KAAK,EAAE,gBAAgB,EAAE,OAAO,CAAC,EAAE,IAAI,CAAC,cAAc,GAAG,IAAI,CAAC,UAAU,CAAC,YAAY,CAAC;CAG5F;AAED,MAAM,WAAW,YAAY;IAC3B,IAAI,EAAE,KAAK,CAAC,YAAY,CAAC,IAAI,CAAC,CAAC;CAChC;AAED,yBAAiB,YAAY,CAAC;IAC5B;;;OAGG;IACH,UAAiB,IAAI;QACnB;;WAEG;QACH,KAAK,EAAE,MAAM,CAAC;QAEd,aAAa,EAAE,MAAM,CAAC;QAEtB,eAAe,EAAE,MAAM,CAAC;KACzB;CACF;AAED,MAAM,WAAW,gBAAgB;IAC/B;;;;;OAKG;IACH,eAAe,EAAE,MAAM,CAAC;IAExB;;;OAGG;IACH,MAAM,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC;IAEvB;;OAEG;IACH,KAAK,CAAC,EAAE,MAAM,CAAC;IAEf;;;;;OAKG;IACH,aAAa,CAAC,EAAE,MAAM,CAAC;CACxB;AAED,MAAM,CAAC,OAAO,WAAW,MAAM,CAAC;IAC9B,OAAO,EAAE,KAAK,YAAY,IAAI,YAAY,EAAE,KAAK,gBAAgB,IAAI,gBAAgB,EAAE,CAAC;CACzF"}
|
|
@@ -23,6 +23,13 @@ class Volume extends resource_1.APIResource {
|
|
|
23
23
|
* where the start and end time are hour-aligned and in UTC. When a specific
|
|
24
24
|
* timestamp is passed in for either start or end time, the response includes the
|
|
25
25
|
* hours the timestamp falls in.
|
|
26
|
+
*
|
|
27
|
+
* @example
|
|
28
|
+
* ```ts
|
|
29
|
+
* const eventVolumes = await client.events.volume.list({
|
|
30
|
+
* timeframe_start: '2019-12-27T18:11:19.117Z',
|
|
31
|
+
* });
|
|
32
|
+
* ```
|
|
26
33
|
*/
|
|
27
34
|
list(query, options) {
|
|
28
35
|
return this._client.get('/events/volume', { query, ...options });
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"volume.js","sourceRoot":"","sources":["../../src/resources/events/volume.ts"],"names":[],"mappings":";AAAA,sFAAsF;;;AAEtF,gDAA6C;AAG7C;;;;GAIG;AACH,MAAa,MAAO,SAAQ,sBAAW;IACrC
|
|
1
|
+
{"version":3,"file":"volume.js","sourceRoot":"","sources":["../../src/resources/events/volume.ts"],"names":[],"mappings":";AAAA,sFAAsF;;;AAEtF,gDAA6C;AAG7C;;;;GAIG;AACH,MAAa,MAAO,SAAQ,sBAAW;IACrC;;;;;;;;;;;;;;;;;;;;;OAqBG;IACH,IAAI,CAAC,KAAuB,EAAE,OAA6B;QACzD,OAAO,IAAI,CAAC,OAAO,CAAC,GAAG,CAAC,gBAAgB,EAAE,EAAE,KAAK,EAAE,GAAG,OAAO,EAAE,CAAC,CAAC;IACnE,CAAC;CACF;AA1BD,wBA0BC"}
|
|
@@ -20,6 +20,13 @@ export class Volume extends APIResource {
|
|
|
20
20
|
* where the start and end time are hour-aligned and in UTC. When a specific
|
|
21
21
|
* timestamp is passed in for either start or end time, the response includes the
|
|
22
22
|
* hours the timestamp falls in.
|
|
23
|
+
*
|
|
24
|
+
* @example
|
|
25
|
+
* ```ts
|
|
26
|
+
* const eventVolumes = await client.events.volume.list({
|
|
27
|
+
* timeframe_start: '2019-12-27T18:11:19.117Z',
|
|
28
|
+
* });
|
|
29
|
+
* ```
|
|
23
30
|
*/
|
|
24
31
|
list(query, options) {
|
|
25
32
|
return this._client.get('/events/volume', { query, ...options });
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"volume.mjs","sourceRoot":"","sources":["../../src/resources/events/volume.ts"],"names":[],"mappings":"AAAA,sFAAsF;OAE/E,EAAE,WAAW,EAAE;AAGtB;;;;GAIG;AACH,MAAM,OAAO,MAAO,SAAQ,WAAW;IACrC
|
|
1
|
+
{"version":3,"file":"volume.mjs","sourceRoot":"","sources":["../../src/resources/events/volume.ts"],"names":[],"mappings":"AAAA,sFAAsF;OAE/E,EAAE,WAAW,EAAE;AAGtB;;;;GAIG;AACH,MAAM,OAAO,MAAO,SAAQ,WAAW;IACrC;;;;;;;;;;;;;;;;;;;;;OAqBG;IACH,IAAI,CAAC,KAAuB,EAAE,OAA6B;QACzD,OAAO,IAAI,CAAC,OAAO,CAAC,GAAG,CAAC,gBAAgB,EAAE,EAAE,KAAK,EAAE,GAAG,OAAO,EAAE,CAAC,CAAC;IACnE,CAAC;CACF"}
|
|
@@ -22,6 +22,18 @@ export declare class InvoiceLineItems extends APIResource {
|
|
|
22
22
|
* - If both `item_id` and `name` are provided: The item is looked up by ID for
|
|
23
23
|
* association, but the provided `name` is used for the line item (not the item's
|
|
24
24
|
* name).
|
|
25
|
+
*
|
|
26
|
+
* @example
|
|
27
|
+
* ```ts
|
|
28
|
+
* const invoiceLineItem =
|
|
29
|
+
* await client.invoiceLineItems.create({
|
|
30
|
+
* amount: '12.00',
|
|
31
|
+
* end_date: '2023-09-22',
|
|
32
|
+
* invoice_id: '4khy3nwzktxv7',
|
|
33
|
+
* quantity: 1,
|
|
34
|
+
* start_date: '2023-09-22',
|
|
35
|
+
* });
|
|
36
|
+
* ```
|
|
25
37
|
*/
|
|
26
38
|
create(body: InvoiceLineItemCreateParams, options?: Core.RequestOptions): Core.APIPromise<InvoiceLineItemCreateResponse>;
|
|
27
39
|
}
|
|
@@ -40,7 +52,7 @@ export interface InvoiceLineItemCreateResponse {
|
|
|
40
52
|
* invoice calculations (ie. usage discounts -> amount discounts -> percentage
|
|
41
53
|
* discounts -> minimums -> maximums).
|
|
42
54
|
*/
|
|
43
|
-
adjustments: Array<Shared.MonetaryUsageDiscountAdjustment | Shared.MonetaryAmountDiscountAdjustment | Shared.MonetaryPercentageDiscountAdjustment | Shared.MonetaryMinimumAdjustment | Shared.MonetaryMaximumAdjustment>;
|
|
55
|
+
adjustments: Array<Shared.MonetaryUsageDiscountAdjustment | Shared.MonetaryAmountDiscountAdjustment | Shared.MonetaryPercentageDiscountAdjustment | InvoiceLineItemCreateResponse.MonetaryTieredPercentageDiscountAdjustment | Shared.MonetaryMinimumAdjustment | Shared.MonetaryMaximumAdjustment>;
|
|
44
56
|
/**
|
|
45
57
|
* The final amount for a line item after all adjustments and pre paid credits have
|
|
46
58
|
* been applied.
|
|
@@ -112,6 +124,82 @@ export interface InvoiceLineItemCreateResponse {
|
|
|
112
124
|
*/
|
|
113
125
|
usage_customer_ids: Array<string> | null;
|
|
114
126
|
}
|
|
127
|
+
export declare namespace InvoiceLineItemCreateResponse {
|
|
128
|
+
interface MonetaryTieredPercentageDiscountAdjustment {
|
|
129
|
+
id: string;
|
|
130
|
+
adjustment_type: 'tiered_percentage_discount';
|
|
131
|
+
/**
|
|
132
|
+
* The value applied by an adjustment.
|
|
133
|
+
*/
|
|
134
|
+
amount: string;
|
|
135
|
+
/**
|
|
136
|
+
* @deprecated The price IDs that this adjustment applies to.
|
|
137
|
+
*/
|
|
138
|
+
applies_to_price_ids: Array<string>;
|
|
139
|
+
/**
|
|
140
|
+
* The filters that determine which prices to apply this adjustment to.
|
|
141
|
+
*/
|
|
142
|
+
filters: Array<MonetaryTieredPercentageDiscountAdjustment.Filter>;
|
|
143
|
+
/**
|
|
144
|
+
* True for adjustments that apply to an entire invoice, false for adjustments that
|
|
145
|
+
* apply to only one price.
|
|
146
|
+
*/
|
|
147
|
+
is_invoice_level: boolean;
|
|
148
|
+
/**
|
|
149
|
+
* The reason for the adjustment.
|
|
150
|
+
*/
|
|
151
|
+
reason: string | null;
|
|
152
|
+
/**
|
|
153
|
+
* The adjustment id this adjustment replaces. This adjustment will take the place
|
|
154
|
+
* of the replaced adjustment in plan version migrations.
|
|
155
|
+
*/
|
|
156
|
+
replaces_adjustment_id: string | null;
|
|
157
|
+
/**
|
|
158
|
+
* The ordered, contiguous bands of cumulative eligible spend, each discounted at
|
|
159
|
+
* its own percentage (progressive fill-a-tier), applied to the prices this
|
|
160
|
+
* adjustment covers in a given billing period.
|
|
161
|
+
*/
|
|
162
|
+
tiers: Array<MonetaryTieredPercentageDiscountAdjustment.Tier>;
|
|
163
|
+
}
|
|
164
|
+
namespace MonetaryTieredPercentageDiscountAdjustment {
|
|
165
|
+
interface Filter {
|
|
166
|
+
/**
|
|
167
|
+
* The property of the price to filter on.
|
|
168
|
+
*/
|
|
169
|
+
field: 'price_id' | 'item_id' | 'price_type' | 'currency' | 'pricing_unit_id';
|
|
170
|
+
/**
|
|
171
|
+
* Should prices that match the filter be included or excluded.
|
|
172
|
+
*/
|
|
173
|
+
operator: 'includes' | 'excludes';
|
|
174
|
+
/**
|
|
175
|
+
* The IDs or values that match this filter.
|
|
176
|
+
*/
|
|
177
|
+
values: Array<string>;
|
|
178
|
+
}
|
|
179
|
+
/**
|
|
180
|
+
* One band of a tiered percentage discount. Bounds are denominated in the
|
|
181
|
+
* discount's currency. `lower_bound` is the exclusive start of the band and
|
|
182
|
+
* `upper_bound` is the inclusive end; `upper_bound` is null only for the
|
|
183
|
+
* open-ended final tier.
|
|
184
|
+
*/
|
|
185
|
+
interface Tier {
|
|
186
|
+
/**
|
|
187
|
+
* Exclusive lower bound of cumulative spend for this tier.
|
|
188
|
+
*/
|
|
189
|
+
lower_bound: number;
|
|
190
|
+
/**
|
|
191
|
+
* The percentage (between 0 and 1) discounted from spend that falls within this
|
|
192
|
+
* tier.
|
|
193
|
+
*/
|
|
194
|
+
percentage: number;
|
|
195
|
+
/**
|
|
196
|
+
* Inclusive upper bound of cumulative spend for this tier; null for the final
|
|
197
|
+
* open-ended tier.
|
|
198
|
+
*/
|
|
199
|
+
upper_bound?: number | null;
|
|
200
|
+
}
|
|
201
|
+
}
|
|
202
|
+
}
|
|
115
203
|
export interface InvoiceLineItemCreateParams {
|
|
116
204
|
/**
|
|
117
205
|
* The total amount in the invoice's currency to add to the line item.
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"invoice-line-items.d.ts","sourceRoot":"","sources":["../src/resources/invoice-line-items.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,WAAW,EAAE,MAAM,aAAa,CAAC;AAC1C,OAAO,KAAK,IAAI,MAAM,SAAS,CAAC;AAChC,OAAO,KAAK,MAAM,MAAM,UAAU,CAAC;AAEnC;;;;;GAKG;AACH,qBAAa,gBAAiB,SAAQ,WAAW;IAC/C
|
|
1
|
+
{"version":3,"file":"invoice-line-items.d.ts","sourceRoot":"","sources":["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;;;eAGG;YACH,WAAW,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC;SAC7B;KACF;CACF;AAED,MAAM,WAAW,2BAA2B;IAC1C;;OAEG;IACH,MAAM,EAAE,MAAM,CAAC;IAEf;;OAEG;IACH,QAAQ,EAAE,MAAM,CAAC;IAEjB;;OAEG;IACH,UAAU,EAAE,MAAM,CAAC;IAEnB;;OAEG;IACH,QAAQ,EAAE,MAAM,CAAC;IAEjB;;OAEG;IACH,UAAU,EAAE,MAAM,CAAC;IAEnB;;;;;OAKG;IACH,OAAO,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC;IAExB;;;;;;;OAOG;IACH,IAAI,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC;CACtB;AAED,MAAM,CAAC,OAAO,WAAW,gBAAgB,CAAC;IACxC,OAAO,EACL,KAAK,6BAA6B,IAAI,6BAA6B,EACnE,KAAK,2BAA2B,IAAI,2BAA2B,GAChE,CAAC;CACH"}
|
|
@@ -24,6 +24,18 @@ class InvoiceLineItems extends resource_1.APIResource {
|
|
|
24
24
|
* - If both `item_id` and `name` are provided: The item is looked up by ID for
|
|
25
25
|
* association, but the provided `name` is used for the line item (not the item's
|
|
26
26
|
* name).
|
|
27
|
+
*
|
|
28
|
+
* @example
|
|
29
|
+
* ```ts
|
|
30
|
+
* const invoiceLineItem =
|
|
31
|
+
* await client.invoiceLineItems.create({
|
|
32
|
+
* amount: '12.00',
|
|
33
|
+
* end_date: '2023-09-22',
|
|
34
|
+
* invoice_id: '4khy3nwzktxv7',
|
|
35
|
+
* quantity: 1,
|
|
36
|
+
* start_date: '2023-09-22',
|
|
37
|
+
* });
|
|
38
|
+
* ```
|
|
27
39
|
*/
|
|
28
40
|
create(body, options) {
|
|
29
41
|
return this._client.post('/invoice_line_items', { body, ...options });
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"invoice-line-items.js","sourceRoot":"","sources":["../src/resources/invoice-line-items.ts"],"names":[],"mappings":";AAAA,sFAAsF;;;AAEtF,6CAA0C;AAI1C;;;;;GAKG;AACH,MAAa,gBAAiB,SAAQ,sBAAW;IAC/C
|
|
1
|
+
{"version":3,"file":"invoice-line-items.js","sourceRoot":"","sources":["../src/resources/invoice-line-items.ts"],"names":[],"mappings":";AAAA,sFAAsF;;;AAEtF,6CAA0C;AAI1C;;;;;GAKG;AACH,MAAa,gBAAiB,SAAQ,sBAAW;IAC/C;;;;;;;;;;;;;;;;;;;;;;;;;;OA0BG;IACH,MAAM,CACJ,IAAiC,EACjC,OAA6B;QAE7B,OAAO,IAAI,CAAC,OAAO,CAAC,IAAI,CAAC,qBAAqB,EAAE,EAAE,IAAI,EAAE,GAAG,OAAO,EAAE,CAAC,CAAC;IACxE,CAAC;CACF;AAlCD,4CAkCC"}
|
|
@@ -21,6 +21,18 @@ export class InvoiceLineItems extends APIResource {
|
|
|
21
21
|
* - If both `item_id` and `name` are provided: The item is looked up by ID for
|
|
22
22
|
* association, but the provided `name` is used for the line item (not the item's
|
|
23
23
|
* name).
|
|
24
|
+
*
|
|
25
|
+
* @example
|
|
26
|
+
* ```ts
|
|
27
|
+
* const invoiceLineItem =
|
|
28
|
+
* await client.invoiceLineItems.create({
|
|
29
|
+
* amount: '12.00',
|
|
30
|
+
* end_date: '2023-09-22',
|
|
31
|
+
* invoice_id: '4khy3nwzktxv7',
|
|
32
|
+
* quantity: 1,
|
|
33
|
+
* start_date: '2023-09-22',
|
|
34
|
+
* });
|
|
35
|
+
* ```
|
|
24
36
|
*/
|
|
25
37
|
create(body, options) {
|
|
26
38
|
return this._client.post('/invoice_line_items', { body, ...options });
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"invoice-line-items.mjs","sourceRoot":"","sources":["../src/resources/invoice-line-items.ts"],"names":[],"mappings":"AAAA,sFAAsF;OAE/E,EAAE,WAAW,EAAE;AAItB;;;;;GAKG;AACH,MAAM,OAAO,gBAAiB,SAAQ,WAAW;IAC/C
|
|
1
|
+
{"version":3,"file":"invoice-line-items.mjs","sourceRoot":"","sources":["../src/resources/invoice-line-items.ts"],"names":[],"mappings":"AAAA,sFAAsF;OAE/E,EAAE,WAAW,EAAE;AAItB;;;;;GAKG;AACH,MAAM,OAAO,gBAAiB,SAAQ,WAAW;IAC/C;;;;;;;;;;;;;;;;;;;;;;;;;;OA0BG;IACH,MAAM,CACJ,IAAiC,EACjC,OAA6B;QAE7B,OAAO,IAAI,CAAC,OAAO,CAAC,IAAI,CAAC,qBAAqB,EAAE,EAAE,IAAI,EAAE,GAAG,OAAO,EAAE,CAAC,CAAC;IACxE,CAAC;CACF"}
|