orb-billing 5.44.0 → 5.46.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.
- package/CHANGELOG.md +52 -0
- package/core.d.ts +1 -1
- package/core.d.ts.map +1 -1
- package/core.js +8 -17
- package/core.js.map +1 -1
- package/core.mjs +8 -17
- package/core.mjs.map +1 -1
- package/index.d.mts +91 -5
- package/index.d.ts +91 -5
- package/index.d.ts.map +1 -1
- package/index.js +90 -2
- package/index.js.map +1 -1
- package/index.mjs +91 -3
- package/index.mjs.map +1 -1
- package/internal/utils/query.d.ts +2 -0
- package/internal/utils/query.d.ts.map +1 -0
- package/internal/utils/query.js +33 -0
- package/internal/utils/query.js.map +1 -0
- package/internal/utils/query.mjs +6 -0
- package/internal/utils/query.mjs.map +1 -0
- package/package.json +1 -1
- package/resources/alerts.d.ts +21 -0
- package/resources/alerts.d.ts.map +1 -1
- package/resources/alerts.js +6 -0
- package/resources/alerts.js.map +1 -1
- package/resources/alerts.mjs +6 -0
- package/resources/alerts.mjs.map +1 -1
- package/resources/beta/beta.d.ts +8293 -140
- package/resources/beta/beta.d.ts.map +1 -1
- package/resources/beta/beta.js +5 -0
- package/resources/beta/beta.js.map +1 -1
- package/resources/beta/beta.mjs +5 -0
- package/resources/beta/beta.mjs.map +1 -1
- package/resources/beta/external-plan-id.d.ts +8293 -140
- package/resources/beta/external-plan-id.d.ts.map +1 -1
- package/resources/beta/external-plan-id.js +5 -0
- package/resources/beta/external-plan-id.js.map +1 -1
- package/resources/beta/external-plan-id.mjs +5 -0
- package/resources/beta/external-plan-id.mjs.map +1 -1
- package/resources/coupons/coupons.d.ts +3 -0
- package/resources/coupons/coupons.d.ts.map +1 -1
- package/resources/coupons/coupons.js +3 -0
- package/resources/coupons/coupons.js.map +1 -1
- package/resources/coupons/coupons.mjs +3 -0
- package/resources/coupons/coupons.mjs.map +1 -1
- package/resources/coupons/subscriptions.d.ts +3 -0
- package/resources/coupons/subscriptions.d.ts.map +1 -1
- package/resources/coupons/subscriptions.js +3 -0
- package/resources/coupons/subscriptions.js.map +1 -1
- package/resources/coupons/subscriptions.mjs +3 -0
- package/resources/coupons/subscriptions.mjs.map +1 -1
- package/resources/credit-blocks.d.ts +85 -1
- package/resources/credit-blocks.d.ts.map +1 -1
- package/resources/credit-blocks.js +22 -0
- package/resources/credit-blocks.js.map +1 -1
- package/resources/credit-blocks.mjs +22 -0
- package/resources/credit-blocks.mjs.map +1 -1
- package/resources/credit-notes.d.ts +4 -0
- package/resources/credit-notes.d.ts.map +1 -1
- package/resources/credit-notes.js +4 -0
- package/resources/credit-notes.js.map +1 -1
- package/resources/credit-notes.mjs +4 -0
- package/resources/credit-notes.mjs.map +1 -1
- package/resources/customers/balance-transactions.d.ts +16 -0
- package/resources/customers/balance-transactions.d.ts.map +1 -1
- package/resources/customers/balance-transactions.js +16 -0
- package/resources/customers/balance-transactions.js.map +1 -1
- package/resources/customers/balance-transactions.mjs +16 -0
- package/resources/customers/balance-transactions.mjs.map +1 -1
- package/resources/customers/costs.d.ts +16 -0
- package/resources/customers/costs.d.ts.map +1 -1
- package/resources/customers/costs.js +16 -0
- package/resources/customers/costs.js.map +1 -1
- package/resources/customers/costs.mjs +16 -0
- package/resources/customers/costs.mjs.map +1 -1
- package/resources/customers/credits/credits.d.ts +39 -0
- package/resources/customers/credits/credits.d.ts.map +1 -1
- package/resources/customers/credits/credits.js +3 -0
- package/resources/customers/credits/credits.js.map +1 -1
- package/resources/customers/credits/credits.mjs +3 -0
- package/resources/customers/credits/credits.mjs.map +1 -1
- package/resources/customers/credits/ledger.d.ts +31 -4
- package/resources/customers/credits/ledger.d.ts.map +1 -1
- package/resources/customers/credits/ledger.js +19 -2
- package/resources/customers/credits/ledger.js.map +1 -1
- package/resources/customers/credits/ledger.mjs +19 -2
- package/resources/customers/credits/ledger.mjs.map +1 -1
- package/resources/customers/credits/top-ups.d.ts +3 -0
- package/resources/customers/credits/top-ups.d.ts.map +1 -1
- package/resources/customers/credits/top-ups.js +3 -0
- package/resources/customers/credits/top-ups.js.map +1 -1
- package/resources/customers/credits/top-ups.mjs +3 -0
- package/resources/customers/credits/top-ups.mjs.map +1 -1
- package/resources/customers/customers.d.ts +57 -12
- package/resources/customers/customers.d.ts.map +1 -1
- package/resources/customers/customers.js +20 -3
- package/resources/customers/customers.js.map +1 -1
- package/resources/customers/customers.mjs +20 -3
- package/resources/customers/customers.mjs.map +1 -1
- package/resources/dimensional-price-groups/external-dimensional-price-group-id.d.ts +1 -1
- package/resources/dimensional-price-groups/external-dimensional-price-group-id.d.ts.map +1 -1
- package/resources/events/backfills.d.ts +5 -0
- package/resources/events/backfills.d.ts.map +1 -1
- package/resources/events/backfills.js +5 -0
- package/resources/events/backfills.js.map +1 -1
- package/resources/events/backfills.mjs +5 -0
- package/resources/events/backfills.mjs.map +1 -1
- package/resources/events/events.d.ts +5 -0
- package/resources/events/events.d.ts.map +1 -1
- package/resources/events/events.js +5 -0
- package/resources/events/events.js.map +1 -1
- package/resources/events/events.mjs +5 -0
- package/resources/events/events.mjs.map +1 -1
- package/resources/events/volume.d.ts +5 -0
- package/resources/events/volume.d.ts.map +1 -1
- package/resources/events/volume.js +5 -0
- package/resources/events/volume.js.map +1 -1
- package/resources/events/volume.mjs +5 -0
- package/resources/events/volume.mjs.map +1 -1
- package/resources/index.d.ts +4 -2
- package/resources/index.d.ts.map +1 -1
- package/resources/index.js +7 -1
- package/resources/index.js.map +1 -1
- package/resources/index.mjs +3 -1
- package/resources/index.mjs.map +1 -1
- package/resources/invoice-line-items.d.ts +6 -0
- package/resources/invoice-line-items.d.ts.map +1 -1
- package/resources/invoice-line-items.js +6 -0
- package/resources/invoice-line-items.js.map +1 -1
- package/resources/invoice-line-items.mjs +6 -0
- package/resources/invoice-line-items.mjs.map +1 -1
- package/resources/invoices.d.ts +443 -10
- package/resources/invoices.d.ts.map +1 -1
- package/resources/invoices.js +24 -9
- package/resources/invoices.js.map +1 -1
- package/resources/invoices.mjs +24 -9
- package/resources/invoices.mjs.map +1 -1
- package/resources/items.d.ts +6 -2
- package/resources/items.d.ts.map +1 -1
- package/resources/items.js +4 -0
- package/resources/items.js.map +1 -1
- package/resources/items.mjs +4 -0
- package/resources/items.mjs.map +1 -1
- package/resources/license-types.d.ts +113 -0
- package/resources/license-types.d.ts.map +1 -0
- package/resources/license-types.js +44 -0
- package/resources/license-types.js.map +1 -0
- package/resources/license-types.mjs +39 -0
- package/resources/license-types.mjs.map +1 -0
- package/resources/licenses/external-licenses.d.ts +114 -0
- package/resources/licenses/external-licenses.d.ts.map +1 -0
- package/resources/licenses/external-licenses.js +18 -0
- package/resources/licenses/external-licenses.js.map +1 -0
- package/resources/licenses/external-licenses.mjs +14 -0
- package/resources/licenses/external-licenses.mjs.map +1 -0
- package/resources/licenses/index.d.ts +4 -0
- package/resources/licenses/index.d.ts.map +1 -0
- package/resources/licenses/index.js +12 -0
- package/resources/licenses/index.js.map +1 -0
- package/resources/licenses/index.mjs +5 -0
- package/resources/licenses/index.mjs.map +1 -0
- package/resources/licenses/licenses.d.ts +133 -0
- package/resources/licenses/licenses.d.ts.map +1 -0
- package/resources/licenses/licenses.js +86 -0
- package/resources/licenses/licenses.js.map +1 -0
- package/resources/licenses/licenses.mjs +58 -0
- package/resources/licenses/licenses.mjs.map +1 -0
- package/resources/licenses/usage.d.ts +211 -0
- package/resources/licenses/usage.d.ts.map +1 -0
- package/resources/licenses/usage.js +25 -0
- package/resources/licenses/usage.js.map +1 -0
- package/resources/licenses/usage.mjs +21 -0
- package/resources/licenses/usage.mjs.map +1 -0
- package/resources/licenses.d.ts +2 -0
- package/resources/licenses.d.ts.map +1 -0
- package/resources/licenses.js +19 -0
- package/resources/licenses.js.map +1 -0
- package/resources/licenses.mjs +3 -0
- package/resources/licenses.mjs.map +1 -0
- package/resources/metrics.d.ts +7 -0
- package/resources/metrics.d.ts.map +1 -1
- package/resources/metrics.js +4 -0
- package/resources/metrics.js.map +1 -1
- package/resources/metrics.mjs +4 -0
- package/resources/metrics.mjs.map +1 -1
- package/resources/plans/external-plan-id.d.ts +5 -0
- package/resources/plans/external-plan-id.d.ts.map +1 -1
- package/resources/plans/external-plan-id.js +5 -0
- package/resources/plans/external-plan-id.js.map +1 -1
- package/resources/plans/external-plan-id.mjs +5 -0
- package/resources/plans/external-plan-id.mjs.map +1 -1
- package/resources/plans/migrations.d.ts +5 -0
- package/resources/plans/migrations.d.ts.map +1 -1
- package/resources/plans/migrations.js +5 -0
- package/resources/plans/migrations.js.map +1 -1
- package/resources/plans/migrations.mjs +5 -0
- package/resources/plans/migrations.mjs.map +1 -1
- package/resources/plans/plans.d.ts +4200 -121
- package/resources/plans/plans.d.ts.map +1 -1
- package/resources/plans/plans.js +5 -0
- package/resources/plans/plans.js.map +1 -1
- package/resources/plans/plans.mjs +5 -0
- package/resources/plans/plans.mjs.map +1 -1
- package/resources/prices/external-price-id.d.ts +9 -0
- package/resources/prices/external-price-id.d.ts.map +1 -1
- package/resources/prices/external-price-id.js +9 -0
- package/resources/prices/external-price-id.js.map +1 -1
- package/resources/prices/external-price-id.mjs +9 -0
- package/resources/prices/external-price-id.mjs.map +1 -1
- package/resources/prices/prices.d.ts +198 -0
- package/resources/prices/prices.d.ts.map +1 -1
- package/resources/prices/prices.js +9 -0
- package/resources/prices/prices.js.map +1 -1
- package/resources/prices/prices.mjs +9 -0
- package/resources/prices/prices.mjs.map +1 -1
- package/resources/shared.d.ts +1040 -6
- package/resources/shared.d.ts.map +1 -1
- package/resources/shared.js.map +1 -1
- package/resources/shared.mjs.map +1 -1
- package/resources/subscriptions.d.ts +262 -0
- package/resources/subscriptions.d.ts.map +1 -1
- package/resources/subscriptions.js.map +1 -1
- package/resources/subscriptions.mjs.map +1 -1
- package/src/core.ts +10 -21
- package/src/index.ts +151 -5
- package/src/internal/utils/query.ts +7 -0
- package/src/resources/alerts.ts +24 -0
- package/src/resources/beta/beta.ts +9945 -194
- package/src/resources/beta/external-plan-id.ts +9945 -194
- package/src/resources/coupons/coupons.ts +3 -0
- package/src/resources/coupons/subscriptions.ts +3 -0
- package/src/resources/credit-blocks.ts +110 -1
- package/src/resources/credit-notes.ts +4 -0
- package/src/resources/customers/balance-transactions.ts +16 -0
- package/src/resources/customers/costs.ts +16 -0
- package/src/resources/customers/credits/credits.ts +45 -0
- package/src/resources/customers/credits/ledger.ts +33 -4
- package/src/resources/customers/credits/top-ups.ts +3 -0
- package/src/resources/customers/customers.ts +89 -12
- package/src/resources/dimensional-price-groups/external-dimensional-price-group-id.ts +1 -1
- package/src/resources/events/backfills.ts +5 -0
- package/src/resources/events/events.ts +5 -0
- package/src/resources/events/volume.ts +5 -0
- package/src/resources/index.ts +30 -1
- package/src/resources/invoice-line-items.ts +6 -0
- package/src/resources/invoices.ts +541 -10
- package/src/resources/items.ts +8 -2
- package/src/resources/license-types.ts +163 -0
- package/src/resources/licenses/external-licenses.ts +147 -0
- package/src/resources/licenses/index.ts +27 -0
- package/src/resources/licenses/licenses.ts +248 -0
- package/src/resources/licenses/usage.ts +280 -0
- package/src/resources/licenses.ts +3 -0
- package/src/resources/metrics.ts +6 -0
- package/src/resources/plans/external-plan-id.ts +5 -0
- package/src/resources/plans/migrations.ts +5 -0
- package/src/resources/plans/plans.ts +5004 -126
- package/src/resources/prices/external-price-id.ts +9 -0
- package/src/resources/prices/prices.ts +237 -0
- package/src/resources/shared.ts +1213 -0
- package/src/resources/subscriptions.ts +311 -0
- package/src/version.ts +1 -1
- package/version.d.ts +1 -1
- package/version.js +1 -1
- package/version.mjs +1 -1
package/resources/invoices.js
CHANGED
|
@@ -7,6 +7,12 @@ const core_1 = require("../core.js");
|
|
|
7
7
|
const shared_1 = require("./shared.js");
|
|
8
8
|
Object.defineProperty(exports, "InvoicesPage", { enumerable: true, get: function () { return shared_1.InvoicesPage; } });
|
|
9
9
|
const pagination_1 = require("../pagination.js");
|
|
10
|
+
/**
|
|
11
|
+
* An [`Invoice`](/core-concepts#invoice) is a fundamental billing entity, representing the request for payment for
|
|
12
|
+
* a single subscription. This includes a set of line items, which correspond to prices in the subscription's plan and
|
|
13
|
+
* can represent fixed recurring fees or usage-based fees. They are generated at the end of a billing period, or as
|
|
14
|
+
* the result of an action, such as a cancellation.
|
|
15
|
+
*/
|
|
10
16
|
class Invoices extends resource_1.APIResource {
|
|
11
17
|
/**
|
|
12
18
|
* This endpoint is used to create a one-off invoice for a customer.
|
|
@@ -15,13 +21,14 @@ class Invoices extends resource_1.APIResource {
|
|
|
15
21
|
return this._client.post('/invoices', { body, ...options });
|
|
16
22
|
}
|
|
17
23
|
/**
|
|
18
|
-
* This endpoint allows you to update the `metadata`, `net_terms`, `due_date`,
|
|
19
|
-
* `invoice_date` properties on an invoice. If you pass null
|
|
20
|
-
* value, it will clear any existing metadata for that invoice.
|
|
24
|
+
* This endpoint allows you to update the `metadata`, `net_terms`, `due_date`,
|
|
25
|
+
* `invoice_date`, and `auto_collection` properties on an invoice. If you pass null
|
|
26
|
+
* for the metadata value, it will clear any existing metadata for that invoice.
|
|
21
27
|
*
|
|
22
28
|
* `metadata` can be modified regardless of invoice state. `net_terms`, `due_date`,
|
|
23
|
-
* and `
|
|
24
|
-
* `invoice_date` can only be modified for non-subscription
|
|
29
|
+
* `invoice_date`, and `auto_collection` can only be modified if the invoice is in
|
|
30
|
+
* a `draft` state. `invoice_date` can only be modified for non-subscription
|
|
31
|
+
* invoices.
|
|
25
32
|
*/
|
|
26
33
|
update(invoiceId, body, options) {
|
|
27
34
|
return this._client.put(`/invoices/${invoiceId}`, { body, ...options });
|
|
@@ -66,6 +73,12 @@ class Invoices extends resource_1.APIResource {
|
|
|
66
73
|
}
|
|
67
74
|
return this._client.post(`/invoices/${invoiceId}/issue`, { body, ...options });
|
|
68
75
|
}
|
|
76
|
+
issueSummary(invoiceId, body = {}, options) {
|
|
77
|
+
if ((0, core_1.isRequestOptions)(body)) {
|
|
78
|
+
return this.issueSummary(invoiceId, {}, body);
|
|
79
|
+
}
|
|
80
|
+
return this._client.post(`/invoices/summary/${invoiceId}/issue`, { body, ...options });
|
|
81
|
+
}
|
|
69
82
|
listSummary(query = {}, options) {
|
|
70
83
|
if ((0, core_1.isRequestOptions)(query)) {
|
|
71
84
|
return this.listSummary({}, query);
|
|
@@ -83,11 +96,13 @@ class Invoices extends resource_1.APIResource {
|
|
|
83
96
|
return this._client.post(`/invoices/${invoiceId}/mark_paid`, { body, ...options });
|
|
84
97
|
}
|
|
85
98
|
/**
|
|
86
|
-
* This endpoint collects payment for an invoice
|
|
87
|
-
* payment method.
|
|
99
|
+
* This endpoint collects payment for an invoice. By default, it uses the
|
|
100
|
+
* customer's default payment method. Optionally, a shared payment token (SPT) can
|
|
101
|
+
* be provided to pay using agent-granted credentials instead. This action can only
|
|
102
|
+
* be taken on invoices with status "issued".
|
|
88
103
|
*/
|
|
89
|
-
pay(invoiceId, options) {
|
|
90
|
-
return this._client.post(`/invoices/${invoiceId}/pay`, options);
|
|
104
|
+
pay(invoiceId, body, options) {
|
|
105
|
+
return this._client.post(`/invoices/${invoiceId}/pay`, { body, ...options });
|
|
91
106
|
}
|
|
92
107
|
/**
|
|
93
108
|
* This endpoint allows an invoice's status to be set to the `void` status. This
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"invoices.js","sourceRoot":"","sources":["../src/resources/invoices.ts"],"names":[],"mappings":";AAAA,sFAAsF;;;AAEtF,6CAA0C;AAC1C,qCAA2C;AAG3C,wCAAwC;
|
|
1
|
+
{"version":3,"file":"invoices.js","sourceRoot":"","sources":["../src/resources/invoices.ts"],"names":[],"mappings":";AAAA,sFAAsF;;;AAEtF,6CAA0C;AAC1C,qCAA2C;AAG3C,wCAAwC;AA++D/B,6FA/+DA,qBAAY,OA++DA;AA9+DrB,iDAAsD;AAEtD;;;;;GAKG;AACH,MAAa,QAAS,SAAQ,sBAAW;IACvC;;OAEG;IACH,MAAM,CAAC,IAAyB,EAAE,OAA6B;QAC7D,OAAO,IAAI,CAAC,OAAO,CAAC,IAAI,CAAC,WAAW,EAAE,EAAE,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EAAE,EAAE,IAAI,EAAE,GAAG,OAAO,EAAE,CAAC,CAAC;IAC/E,CAAC;IAED;;;;;;;;;;;;OAYG;IACH,IAAI,CAAC,SAAiB,EAAE,OAA6B;QACnD,OAAO,IAAI,CAAC,OAAO,CAAC,IAAI,CAAC,aAAa,SAAS,OAAO,EAAE,OAAO,CAAC,CAAC;IACnE,CAAC;CACF;AAtOD,4BAsOC;AAED,MAAa,+BAAgC,SAAQ,iBAAgC;CAAG;AAAxF,0EAAwF;AA0uDxF,QAAQ,CAAC,+BAA+B,GAAG,+BAA+B,CAAC"}
|
package/resources/invoices.mjs
CHANGED
|
@@ -3,6 +3,12 @@ import { APIResource } from "../resource.mjs";
|
|
|
3
3
|
import { isRequestOptions } from "../core.mjs";
|
|
4
4
|
import { InvoicesPage } from "./shared.mjs";
|
|
5
5
|
import { Page } from "../pagination.mjs";
|
|
6
|
+
/**
|
|
7
|
+
* An [`Invoice`](/core-concepts#invoice) is a fundamental billing entity, representing the request for payment for
|
|
8
|
+
* a single subscription. This includes a set of line items, which correspond to prices in the subscription's plan and
|
|
9
|
+
* can represent fixed recurring fees or usage-based fees. They are generated at the end of a billing period, or as
|
|
10
|
+
* the result of an action, such as a cancellation.
|
|
11
|
+
*/
|
|
6
12
|
export class Invoices extends APIResource {
|
|
7
13
|
/**
|
|
8
14
|
* This endpoint is used to create a one-off invoice for a customer.
|
|
@@ -11,13 +17,14 @@ export class Invoices extends APIResource {
|
|
|
11
17
|
return this._client.post('/invoices', { body, ...options });
|
|
12
18
|
}
|
|
13
19
|
/**
|
|
14
|
-
* This endpoint allows you to update the `metadata`, `net_terms`, `due_date`,
|
|
15
|
-
* `invoice_date` properties on an invoice. If you pass null
|
|
16
|
-
* value, it will clear any existing metadata for that invoice.
|
|
20
|
+
* This endpoint allows you to update the `metadata`, `net_terms`, `due_date`,
|
|
21
|
+
* `invoice_date`, and `auto_collection` properties on an invoice. If you pass null
|
|
22
|
+
* for the metadata value, it will clear any existing metadata for that invoice.
|
|
17
23
|
*
|
|
18
24
|
* `metadata` can be modified regardless of invoice state. `net_terms`, `due_date`,
|
|
19
|
-
* and `
|
|
20
|
-
* `invoice_date` can only be modified for non-subscription
|
|
25
|
+
* `invoice_date`, and `auto_collection` can only be modified if the invoice is in
|
|
26
|
+
* a `draft` state. `invoice_date` can only be modified for non-subscription
|
|
27
|
+
* invoices.
|
|
21
28
|
*/
|
|
22
29
|
update(invoiceId, body, options) {
|
|
23
30
|
return this._client.put(`/invoices/${invoiceId}`, { body, ...options });
|
|
@@ -62,6 +69,12 @@ export class Invoices extends APIResource {
|
|
|
62
69
|
}
|
|
63
70
|
return this._client.post(`/invoices/${invoiceId}/issue`, { body, ...options });
|
|
64
71
|
}
|
|
72
|
+
issueSummary(invoiceId, body = {}, options) {
|
|
73
|
+
if (isRequestOptions(body)) {
|
|
74
|
+
return this.issueSummary(invoiceId, {}, body);
|
|
75
|
+
}
|
|
76
|
+
return this._client.post(`/invoices/summary/${invoiceId}/issue`, { body, ...options });
|
|
77
|
+
}
|
|
65
78
|
listSummary(query = {}, options) {
|
|
66
79
|
if (isRequestOptions(query)) {
|
|
67
80
|
return this.listSummary({}, query);
|
|
@@ -79,11 +92,13 @@ export class Invoices extends APIResource {
|
|
|
79
92
|
return this._client.post(`/invoices/${invoiceId}/mark_paid`, { body, ...options });
|
|
80
93
|
}
|
|
81
94
|
/**
|
|
82
|
-
* This endpoint collects payment for an invoice
|
|
83
|
-
* payment method.
|
|
95
|
+
* This endpoint collects payment for an invoice. By default, it uses the
|
|
96
|
+
* customer's default payment method. Optionally, a shared payment token (SPT) can
|
|
97
|
+
* be provided to pay using agent-granted credentials instead. This action can only
|
|
98
|
+
* be taken on invoices with status "issued".
|
|
84
99
|
*/
|
|
85
|
-
pay(invoiceId, options) {
|
|
86
|
-
return this._client.post(`/invoices/${invoiceId}/pay`, options);
|
|
100
|
+
pay(invoiceId, body, options) {
|
|
101
|
+
return this._client.post(`/invoices/${invoiceId}/pay`, { body, ...options });
|
|
87
102
|
}
|
|
88
103
|
/**
|
|
89
104
|
* This endpoint allows an invoice's status to be set to the `void` status. This
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"invoices.mjs","sourceRoot":"","sources":["../src/resources/invoices.ts"],"names":[],"mappings":"AAAA,sFAAsF;OAE/E,EAAE,WAAW,EAAE;OACf,EAAE,gBAAgB,EAAE;OAGpB,EAAE,YAAY,EAAE;OAChB,EAAE,IAAI,EAAmB;AAEhC,MAAM,OAAO,QAAS,SAAQ,WAAW;IACvC;;OAEG;IACH,MAAM,CAAC,IAAyB,EAAE,OAA6B;QAC7D,OAAO,IAAI,CAAC,OAAO,CAAC,IAAI,CAAC,WAAW,EAAE,EAAE,IAAI,EAAE,GAAG,OAAO,EAAE,CAAC,CAAC;IAC9D,CAAC;IAED
|
|
1
|
+
{"version":3,"file":"invoices.mjs","sourceRoot":"","sources":["../src/resources/invoices.ts"],"names":[],"mappings":"AAAA,sFAAsF;OAE/E,EAAE,WAAW,EAAE;OACf,EAAE,gBAAgB,EAAE;OAGpB,EAAE,YAAY,EAAE;OAChB,EAAE,IAAI,EAAmB;AAEhC;;;;;GAKG;AACH,MAAM,OAAO,QAAS,SAAQ,WAAW;IACvC;;OAEG;IACH,MAAM,CAAC,IAAyB,EAAE,OAA6B;QAC7D,OAAO,IAAI,CAAC,OAAO,CAAC,IAAI,CAAC,WAAW,EAAE,EAAE,IAAI,EAAE,GAAG,OAAO,EAAE,CAAC,CAAC;IAC9D,CAAC;IAED;;;;;;;;;OASG;IACH,MAAM,CACJ,SAAiB,EACjB,IAAyB,EACzB,OAA6B;QAE7B,OAAO,IAAI,CAAC,OAAO,CAAC,GAAG,CAAC,aAAa,SAAS,EAAE,EAAE,EAAE,IAAI,EAAE,GAAG,OAAO,EAAE,CAAC,CAAC;IAC1E,CAAC;IAsBD,IAAI,CACF,QAAiD,EAAE,EACnD,OAA6B;QAE7B,IAAI,gBAAgB,CAAC,KAAK,CAAC,EAAE;YAC3B,OAAO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ts
CHANGED
|
@@ -1,6 +1,10 @@
|
|
|
1
1
|
import { APIResource } from "../resource.js";
|
|
2
2
|
import * as Core from "../core.js";
|
|
3
3
|
import { Page, type PageParams } from "../pagination.js";
|
|
4
|
+
/**
|
|
5
|
+
* The Item resource represents a sellable product or good. Items are associated with all line items, billable metrics,
|
|
6
|
+
* and prices and are used for defining external sync behavior for invoices and tax calculation purposes.
|
|
7
|
+
*/
|
|
4
8
|
export declare class Items extends APIResource {
|
|
5
9
|
/**
|
|
6
10
|
* This endpoint is used to create an [Item](/core-concepts#item).
|
|
@@ -73,7 +77,7 @@ export declare namespace Item {
|
|
|
73
77
|
/**
|
|
74
78
|
* The name of the external system this item is connected to.
|
|
75
79
|
*/
|
|
76
|
-
external_connection_name: 'stripe' | 'quickbooks' | 'bill.com' | 'netsuite' | 'taxjar' | 'avalara' | 'anrok' | 'numeral';
|
|
80
|
+
external_connection_name: 'stripe' | 'quickbooks' | 'bill.com' | 'netsuite' | 'taxjar' | 'avalara' | 'anrok' | 'numeral' | 'stripe_tax';
|
|
77
81
|
/**
|
|
78
82
|
* The identifier of this item in the external system.
|
|
79
83
|
*/
|
|
@@ -115,7 +119,7 @@ export declare namespace ItemUpdateParams {
|
|
|
115
119
|
/**
|
|
116
120
|
* The name of the external system this item is connected to.
|
|
117
121
|
*/
|
|
118
|
-
external_connection_name: 'stripe' | 'quickbooks' | 'bill.com' | 'netsuite' | 'taxjar' | 'avalara' | 'anrok' | 'numeral';
|
|
122
|
+
external_connection_name: 'stripe' | 'quickbooks' | 'bill.com' | 'netsuite' | 'taxjar' | 'avalara' | 'anrok' | 'numeral' | 'stripe_tax';
|
|
119
123
|
/**
|
|
120
124
|
* The identifier of this item in the external system.
|
|
121
125
|
*/
|
package/resources/items.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"items.d.ts","sourceRoot":"","sources":["../src/resources/items.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,WAAW,EAAE,MA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/B,oBAAoB,CAAC,EAAE,KAAK,CAAC,gBAAgB,CAAC,kBAAkB,CAAC,GAAG,IAAI,CAAC;IAEzE;;;;OAIG;IACH,QAAQ,CAAC,EAAE;QAAE,CAAC,GAAG,EAAE,MAAM,GAAG,MAAM,GAAG,IAAI,CAAA;KAAE,GAAG,IAAI,CAAC;IAEnD,IAAI,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC;CACtB;AAED,yBAAiB,gBAAgB,CAAC;IAChC;;;OAGG;IACH,UAAiB,kBAAkB;QACjC;;WAEG;QACH,wBAAwB,EACpB,QAAQ,GACR,YAAY,GACZ,UAAU,GACV,UAAU,GACV,QAAQ,GACR,SAAS,GACT,OAAO,GACP,SAAS,GACT,YAAY,CAAC;QAEjB;;WAEG;QACH,kBAAkB,EAAE,MAAM,CAAC;KAC5B;CACF;AAED,MAAM,WAAW,cAAe,SAAQ,UAAU;CAAG;AAIrD,MAAM,CAAC,OAAO,WAAW,KAAK,CAAC;IAC7B,OAAO,EACL,KAAK,IAAI,IAAI,IAAI,EACjB,SAAS,IAAI,SAAS,EACtB,KAAK,gBAAgB,IAAI,gBAAgB,EACzC,KAAK,gBAAgB,IAAI,gBAAgB,EACzC,KAAK,cAAc,IAAI,cAAc,GACtC,CAAC;CACH"}
|
package/resources/items.js
CHANGED
|
@@ -5,6 +5,10 @@ exports.ItemsPage = exports.Items = void 0;
|
|
|
5
5
|
const resource_1 = require("../resource.js");
|
|
6
6
|
const core_1 = require("../core.js");
|
|
7
7
|
const pagination_1 = require("../pagination.js");
|
|
8
|
+
/**
|
|
9
|
+
* The Item resource represents a sellable product or good. Items are associated with all line items, billable metrics,
|
|
10
|
+
* and prices and are used for defining external sync behavior for invoices and tax calculation purposes.
|
|
11
|
+
*/
|
|
8
12
|
class Items extends resource_1.APIResource {
|
|
9
13
|
/**
|
|
10
14
|
* This endpoint is used to create an [Item](/core-concepts#item).
|
package/resources/items.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version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SAAS,CAAC"}
|
package/resources/items.mjs
CHANGED
|
@@ -2,6 +2,10 @@
|
|
|
2
2
|
import { APIResource } from "../resource.mjs";
|
|
3
3
|
import { isRequestOptions } from "../core.mjs";
|
|
4
4
|
import { Page } from "../pagination.mjs";
|
|
5
|
+
/**
|
|
6
|
+
* The Item resource represents a sellable product or good. Items are associated with all line items, billable metrics,
|
|
7
|
+
* and prices and are used for defining external sync behavior for invoices and tax calculation purposes.
|
|
8
|
+
*/
|
|
5
9
|
export class Items extends APIResource {
|
|
6
10
|
/**
|
|
7
11
|
* This endpoint is used to create an [Item](/core-concepts#item).
|
package/resources/items.mjs.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"items.mjs","sourceRoot":"","sources":["../src/resources/items.ts"],"names":[],"mappings":"AAAA,sFAAsF;OAE/E,EAAE,WAAW,EAAE;OACf,EAAE,gBAAgB,EAAE;OAEpB,EAAE,IAAI,EAAmB;AAEhC,MAAM,OAAO,KAAM,SAAQ,WAAW;IACpC;;OAEG;IACH,MAAM,CAAC,IAAsB,EAAE,OAA6B;QAC1D,OAAO,IAAI,CAAC,OAAO,CAAC,IAAI,CAAC,QAAQ,EAAE,EAAE,IAAI,EAAE,GAAG,OAAO,EAAE,CAAC,CAAC;IAC3D,CAAC;IAED;;OAEG;IACH,MAAM,CAAC,MAAc,EAAE,IAAsB,EAAE,OAA6B;QAC1E,OAAO,IAAI,CAAC,OAAO,CAAC,GAAG,CAAC,UAAU,MAAM,EAAE,EAAE,EAAE,IAAI,EAAE,GAAG,OAAO,EAAE,CAAC,CAAC;IACpE,CAAC;IAQD,IAAI,CACF,QAA8C,EAAE,EAChD,OAA6B;QAE7B,IAAI,gBAAgB,CAAC,KAAK,CAAC,EAAE;YAC3B,OAAO,IAAI,CAAC,IAAI,CAAC,EAAE,EAAE,KAAK,CAAC,CAAC;SAC7B;QACD,OAAO,IAAI,CAAC,OAAO,CAAC,UAAU,CAAC,QAAQ,EAAE,SAAS,EAA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AE,EAAE,KAAK,EAAE,GAAG,OAAO,EAAE,CAAC,CAAC;IAC7E,CAAC;IAED;;OAEG;IACH,OAAO,CAAC,MAAc,EAAE,OAA6B;QACnD,OAAO,IAAI,CAAC,OAAO,CAAC,IAAI,CAAC,UAAU,MAAM,UAAU,EAAE,OAAO,CAAC,CAAC;IAChE,CAAC;IAED;;OAEG;IACH,KAAK,CAAC,MAAc,EAAE,OAA6B;QACjD,OAAO,IAAI,CAAC,OAAO,CAAC,GAAG,CAAC,UAAU,MAAM,EAAE,EAAE,OAAO,CAAC,CAAC;IACvD,CAAC;CACF;AAED,MAAM,OAAO,SAAU,SAAQ,IAAU;CAAG;AA8H5C,KAAK,CAAC,SAAS,GAAG,SAAS,CAAC"}
|
|
@@ -0,0 +1,113 @@
|
|
|
1
|
+
import { APIResource } from "../resource.js";
|
|
2
|
+
import * as Core from "../core.js";
|
|
3
|
+
import { Page, type PageParams } from "../pagination.js";
|
|
4
|
+
/**
|
|
5
|
+
* The LicenseType resource represents a type of license that can be assigned to users.
|
|
6
|
+
* License types are used during billing by grouping metrics on the configured grouping key.
|
|
7
|
+
*/
|
|
8
|
+
export declare class LicenseTypes extends APIResource {
|
|
9
|
+
/**
|
|
10
|
+
* This endpoint is used to create a new license type.
|
|
11
|
+
*
|
|
12
|
+
* License types are used to group licenses and define billing behavior. Each
|
|
13
|
+
* license type has a name and a grouping key that determines how metrics are
|
|
14
|
+
* aggregated for billing purposes.
|
|
15
|
+
*/
|
|
16
|
+
create(body: LicenseTypeCreateParams, options?: Core.RequestOptions): Core.APIPromise<LicenseTypeCreateResponse>;
|
|
17
|
+
/**
|
|
18
|
+
* This endpoint returns a license type identified by its license_type_id.
|
|
19
|
+
*
|
|
20
|
+
* Use this endpoint to retrieve details about a specific license type, including
|
|
21
|
+
* its name and grouping key.
|
|
22
|
+
*/
|
|
23
|
+
retrieve(licenseTypeId: string, options?: Core.RequestOptions): Core.APIPromise<LicenseTypeRetrieveResponse>;
|
|
24
|
+
/**
|
|
25
|
+
* This endpoint returns a list of all license types configured for the account,
|
|
26
|
+
* ordered in ascending order by creation time.
|
|
27
|
+
*
|
|
28
|
+
* License types are used to group licenses and define billing behavior. Each
|
|
29
|
+
* license type has a name and a grouping key that determines how metrics are
|
|
30
|
+
* aggregated for billing purposes.
|
|
31
|
+
*/
|
|
32
|
+
list(query?: LicenseTypeListParams, options?: Core.RequestOptions): Core.PagePromise<LicenseTypeListResponsesPage, LicenseTypeListResponse>;
|
|
33
|
+
list(options?: Core.RequestOptions): Core.PagePromise<LicenseTypeListResponsesPage, LicenseTypeListResponse>;
|
|
34
|
+
}
|
|
35
|
+
export declare class LicenseTypeListResponsesPage extends Page<LicenseTypeListResponse> {
|
|
36
|
+
}
|
|
37
|
+
/**
|
|
38
|
+
* The LicenseType resource represents a type of license that can be assigned to
|
|
39
|
+
* users. License types are used during billing by grouping metrics on the
|
|
40
|
+
* configured grouping key.
|
|
41
|
+
*/
|
|
42
|
+
export interface LicenseTypeCreateResponse {
|
|
43
|
+
/**
|
|
44
|
+
* The Orb-assigned unique identifier for the license type.
|
|
45
|
+
*/
|
|
46
|
+
id: string;
|
|
47
|
+
/**
|
|
48
|
+
* The key used for grouping licenses of this type. This is typically a user
|
|
49
|
+
* identifier field.
|
|
50
|
+
*/
|
|
51
|
+
grouping_key: string;
|
|
52
|
+
/**
|
|
53
|
+
* The name of the license type.
|
|
54
|
+
*/
|
|
55
|
+
name: string;
|
|
56
|
+
}
|
|
57
|
+
/**
|
|
58
|
+
* The LicenseType resource represents a type of license that can be assigned to
|
|
59
|
+
* users. License types are used during billing by grouping metrics on the
|
|
60
|
+
* configured grouping key.
|
|
61
|
+
*/
|
|
62
|
+
export interface LicenseTypeRetrieveResponse {
|
|
63
|
+
/**
|
|
64
|
+
* The Orb-assigned unique identifier for the license type.
|
|
65
|
+
*/
|
|
66
|
+
id: string;
|
|
67
|
+
/**
|
|
68
|
+
* The key used for grouping licenses of this type. This is typically a user
|
|
69
|
+
* identifier field.
|
|
70
|
+
*/
|
|
71
|
+
grouping_key: string;
|
|
72
|
+
/**
|
|
73
|
+
* The name of the license type.
|
|
74
|
+
*/
|
|
75
|
+
name: string;
|
|
76
|
+
}
|
|
77
|
+
/**
|
|
78
|
+
* The LicenseType resource represents a type of license that can be assigned to
|
|
79
|
+
* users. License types are used during billing by grouping metrics on the
|
|
80
|
+
* configured grouping key.
|
|
81
|
+
*/
|
|
82
|
+
export interface LicenseTypeListResponse {
|
|
83
|
+
/**
|
|
84
|
+
* The Orb-assigned unique identifier for the license type.
|
|
85
|
+
*/
|
|
86
|
+
id: string;
|
|
87
|
+
/**
|
|
88
|
+
* The key used for grouping licenses of this type. This is typically a user
|
|
89
|
+
* identifier field.
|
|
90
|
+
*/
|
|
91
|
+
grouping_key: string;
|
|
92
|
+
/**
|
|
93
|
+
* The name of the license type.
|
|
94
|
+
*/
|
|
95
|
+
name: string;
|
|
96
|
+
}
|
|
97
|
+
export interface LicenseTypeCreateParams {
|
|
98
|
+
/**
|
|
99
|
+
* The key used for grouping licenses of this type. This is typically a user
|
|
100
|
+
* identifier field.
|
|
101
|
+
*/
|
|
102
|
+
grouping_key: string;
|
|
103
|
+
/**
|
|
104
|
+
* The name of the license type.
|
|
105
|
+
*/
|
|
106
|
+
name: string;
|
|
107
|
+
}
|
|
108
|
+
export interface LicenseTypeListParams extends PageParams {
|
|
109
|
+
}
|
|
110
|
+
export declare namespace LicenseTypes {
|
|
111
|
+
export { type LicenseTypeCreateResponse as LicenseTypeCreateResponse, type LicenseTypeRetrieveResponse as LicenseTypeRetrieveResponse, type LicenseTypeListResponse as LicenseTypeListResponse, LicenseTypeListResponsesPage as LicenseTypeListResponsesPage, type LicenseTypeCreateParams as LicenseTypeCreateParams, type LicenseTypeListParams as LicenseTypeListParams, };
|
|
112
|
+
}
|
|
113
|
+
//# sourceMappingURL=license-types.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"license-types.d.ts","sourceRoot":"","sources":["../src/res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AM,WAAW,uBAAuB;IACtC;;OAEG;IACH,EAAE,EAAE,MAAM,CAAC;IAEX;;;OAGG;IACH,YAAY,EAAE,MAAM,CAAC;IAErB;;OAEG;IACH,IAAI,EAAE,MAAM,CAAC;CACd;AAED,MAAM,WAAW,uBAAuB;IACtC;;;OAGG;IACH,YAAY,EAAE,MAAM,CAAC;IAErB;;OAEG;IACH,IAAI,EAAE,MAAM,CAAC;CACd;AAED,MAAM,WAAW,qBAAsB,SAAQ,UAAU;CAAG;AAI5D,MAAM,CAAC,OAAO,WAAW,YAAY,CAAC;IACpC,OAAO,EACL,KAAK,yBAAyB,IAAI,yBAAyB,EAC3D,KAAK,2BAA2B,IAAI,2BAA2B,EAC/D,KAAK,uBAAuB,IAAI,uBAAuB,EACvD,4BAA4B,IAAI,4BAA4B,EAC5D,KAAK,uBAAuB,IAAI,uBAAuB,EACvD,KAAK,qBAAqB,IAAI,qBAAqB,GACpD,CAAC;CACH"}
|
|
@@ -0,0 +1,44 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
// File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
|
|
3
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
4
|
+
exports.LicenseTypeListResponsesPage = exports.LicenseTypes = void 0;
|
|
5
|
+
const resource_1 = require("../resource.js");
|
|
6
|
+
const core_1 = require("../core.js");
|
|
7
|
+
const pagination_1 = require("../pagination.js");
|
|
8
|
+
/**
|
|
9
|
+
* The LicenseType resource represents a type of license that can be assigned to users.
|
|
10
|
+
* License types are used during billing by grouping metrics on the configured grouping key.
|
|
11
|
+
*/
|
|
12
|
+
class LicenseTypes extends resource_1.APIResource {
|
|
13
|
+
/**
|
|
14
|
+
* This endpoint is used to create a new license type.
|
|
15
|
+
*
|
|
16
|
+
* License types are used to group licenses and define billing behavior. Each
|
|
17
|
+
* license type has a name and a grouping key that determines how metrics are
|
|
18
|
+
* aggregated for billing purposes.
|
|
19
|
+
*/
|
|
20
|
+
create(body, options) {
|
|
21
|
+
return this._client.post('/license_types', { body, ...options });
|
|
22
|
+
}
|
|
23
|
+
/**
|
|
24
|
+
* This endpoint returns a license type identified by its license_type_id.
|
|
25
|
+
*
|
|
26
|
+
* Use this endpoint to retrieve details about a specific license type, including
|
|
27
|
+
* its name and grouping key.
|
|
28
|
+
*/
|
|
29
|
+
retrieve(licenseTypeId, options) {
|
|
30
|
+
return this._client.get(`/license_types/${licenseTypeId}`, options);
|
|
31
|
+
}
|
|
32
|
+
list(query = {}, options) {
|
|
33
|
+
if ((0, core_1.isRequestOptions)(query)) {
|
|
34
|
+
return this.list({}, query);
|
|
35
|
+
}
|
|
36
|
+
return this._client.getAPIList('/license_types', LicenseTypeListResponsesPage, { query, ...options });
|
|
37
|
+
}
|
|
38
|
+
}
|
|
39
|
+
exports.LicenseTypes = LicenseTypes;
|
|
40
|
+
class LicenseTypeListResponsesPage extends pagination_1.Page {
|
|
41
|
+
}
|
|
42
|
+
exports.LicenseTypeListResponsesPage = LicenseTypeListResponsesPage;
|
|
43
|
+
LicenseTypes.LicenseTypeListResponsesPage = LicenseTypeListResponsesPage;
|
|
44
|
+
//# sourceMappingURL=license-types.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"license-types.js","sourceRoot":"","sources":["../src/resources/license-types.ts"],"names":[],"mappings":";AAAA,sFAAsF;;;AAEtF,6CAA0C;AAC1C,qCAA2C;AAE3C,iDAAsD;AAEtD;;;GAGG;AACH,MAAa,YAAa,SAAQ,sBAAW;IAC3C;;;;;;OAMG;IACH,MAAM,CACJ,IAA6B,EAC7B,OAA6B;QAE7B,OAAO,IAAI,CAAC,OAAO,CAAC,IAAI,CAAC,gBAAgB,EAAE,EAAE,IAAI,EAAE,GAAG,OAAO,EAAE,CAAC,CAAC;IACnE,CAAC;IAED;;;;;OAKG;IACH,QAAQ,CACN,aAAqB,EACrB,OAA6B;QAE7B,OAAO,IAAI,CAAC,OAAO,CAAC,GAAG,CAAC,kBAAkB,aAAa,EAAE,EAAE,OAAO,CAAC,CAAC;IACtE,CAAC;IAiBD,IAAI,CACF,QAAqD,EAAE,EACvD,OAA6B;QAE7B,IAAI,IAAA,uBAAgB,EAAC,KAAK,CAAC,EAAE;YAC3B,OAAO,IAAI,CAAC,IAAI,CAAC,EAAE,EAAE,KAAK,CAAC,CAAC;SAC7B;QACD,OAAO,IAAI,CAAC,OAAO,CAAC,UAAU,CAAC,gBAAgB,EAAE,4BAA4B,EAAE,EAAE,KAAK,EAAE,GAAG,OAAO,EAAE,CAAC,CAAC;IACxG,CAAC;CACF;AApDD,oCAoDC;AAED,MAAa,4BAA6B,SAAQ,iBAA6B;CAAG;AAAlF,oEAAkF;AAsFlF,YAAY,CAAC,4BAA4B,GAAG,4BAA4B,CAAC"}
|
|
@@ -0,0 +1,39 @@
|
|
|
1
|
+
// File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
|
|
2
|
+
import { APIResource } from "../resource.mjs";
|
|
3
|
+
import { isRequestOptions } from "../core.mjs";
|
|
4
|
+
import { Page } from "../pagination.mjs";
|
|
5
|
+
/**
|
|
6
|
+
* The LicenseType resource represents a type of license that can be assigned to users.
|
|
7
|
+
* License types are used during billing by grouping metrics on the configured grouping key.
|
|
8
|
+
*/
|
|
9
|
+
export class LicenseTypes extends APIResource {
|
|
10
|
+
/**
|
|
11
|
+
* This endpoint is used to create a new license type.
|
|
12
|
+
*
|
|
13
|
+
* License types are used to group licenses and define billing behavior. Each
|
|
14
|
+
* license type has a name and a grouping key that determines how metrics are
|
|
15
|
+
* aggregated for billing purposes.
|
|
16
|
+
*/
|
|
17
|
+
create(body, options) {
|
|
18
|
+
return this._client.post('/license_types', { body, ...options });
|
|
19
|
+
}
|
|
20
|
+
/**
|
|
21
|
+
* This endpoint returns a license type identified by its license_type_id.
|
|
22
|
+
*
|
|
23
|
+
* Use this endpoint to retrieve details about a specific license type, including
|
|
24
|
+
* its name and grouping key.
|
|
25
|
+
*/
|
|
26
|
+
retrieve(licenseTypeId, options) {
|
|
27
|
+
return this._client.get(`/license_types/${licenseTypeId}`, options);
|
|
28
|
+
}
|
|
29
|
+
list(query = {}, options) {
|
|
30
|
+
if (isRequestOptions(query)) {
|
|
31
|
+
return this.list({}, query);
|
|
32
|
+
}
|
|
33
|
+
return this._client.getAPIList('/license_types', LicenseTypeListResponsesPage, { query, ...options });
|
|
34
|
+
}
|
|
35
|
+
}
|
|
36
|
+
export class LicenseTypeListResponsesPage extends Page {
|
|
37
|
+
}
|
|
38
|
+
LicenseTypes.LicenseTypeListResponsesPage = LicenseTypeListResponsesPage;
|
|
39
|
+
//# sourceMappingURL=license-types.mjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"license-types.mjs","sourceRoot":"","sources":["../src/resources/license-types.ts"],"names":[],"mappings":"AAAA,sFAAsF;OAE/E,EAAE,WAAW,EAAE;OACf,EAAE,gBAAgB,EAAE;OAEpB,EAAE,IAAI,EAAmB;AAEhC;;;GAGG;AACH,MAAM,OAAO,YAAa,SAAQ,WAAW;IAC3C;;;;;;OAMG;IACH,MAAM,CACJ,IAA6B,EAC7B,OAA6B;QAE7B,OAAO,IAAI,CAAC,OAAO,CAAC,IAAI,CAAC,gBAAgB,EAAE,EAAE,IAAI,EAAE,GAAG,OAAO,EAAE,CAAC,CAAC;IACnE,CAAC;IAED;;;;;OAKG;IACH,QAAQ,CACN,aAAqB,EACrB,OAA6B;QAE7B,OAAO,IAAI,CAAC,OAAO,CAAC,GAAG,CAAC,kBAAkB,aAAa,EAAE,EAAE,OAAO,CAAC,CAAC;IACtE,CAAC;IAiBD,IAAI,CACF,QAAqD,EAAE,EACvD,OAA6B;QAE7B,IAAI,gBAAgB,CAAC,KAAK,CAAC,EAAE;YAC3B,OAAO,IAAI,CAAC,IAAI,CAAC,EAAE,EAAE,KAAK,CAAC,CAAC;SAC7B;QACD,OAAO,IAAI,CAAC,OAAO,CAAC,UAAU,CAAC,gBAAgB,EAAE,4BAA4B,EAAE,EAAE,KAAK,EAAE,GAAG,OAAO,EAAE,CAAC,CAAC;IACxG,CAAC;CACF;AAED,MAAM,OAAO,4BAA6B,SAAQ,IAA6B;CAAG;AAsFlF,YAAY,CAAC,4BAA4B,GAAG,4BAA4B,CAAC"}
|
|
@@ -0,0 +1,114 @@
|
|
|
1
|
+
import { APIResource } from "../../resource.js";
|
|
2
|
+
import * as Core from "../../core.js";
|
|
3
|
+
import * as Shared from "../shared.js";
|
|
4
|
+
export declare class ExternalLicenses extends APIResource {
|
|
5
|
+
/**
|
|
6
|
+
* Returns usage and remaining credits for a license identified by its external
|
|
7
|
+
* license ID.
|
|
8
|
+
*
|
|
9
|
+
* Date range defaults to the current billing period if not specified.
|
|
10
|
+
*/
|
|
11
|
+
getUsage(externalLicenseId: string, query: ExternalLicenseGetUsageParams, options?: Core.RequestOptions): Core.APIPromise<ExternalLicenseGetUsageResponse>;
|
|
12
|
+
}
|
|
13
|
+
export interface ExternalLicenseGetUsageResponse {
|
|
14
|
+
data: Array<ExternalLicenseGetUsageResponse.Data>;
|
|
15
|
+
pagination_metadata: Shared.PaginationMetadata;
|
|
16
|
+
}
|
|
17
|
+
export declare namespace ExternalLicenseGetUsageResponse {
|
|
18
|
+
/**
|
|
19
|
+
* The LicenseUsage resource represents usage and remaining credits for a license
|
|
20
|
+
* over a date range.
|
|
21
|
+
*
|
|
22
|
+
* When grouped by 'day' only, license_id and external_license_id will be null as
|
|
23
|
+
* the data is aggregated across all licenses.
|
|
24
|
+
*/
|
|
25
|
+
interface Data {
|
|
26
|
+
/**
|
|
27
|
+
* The total credits allocated to this license for the period.
|
|
28
|
+
*/
|
|
29
|
+
allocated_credits: number;
|
|
30
|
+
/**
|
|
31
|
+
* The credits consumed by this license for the period.
|
|
32
|
+
*/
|
|
33
|
+
consumed_credits: number;
|
|
34
|
+
/**
|
|
35
|
+
* The end date of the usage period.
|
|
36
|
+
*/
|
|
37
|
+
end_date: string;
|
|
38
|
+
/**
|
|
39
|
+
* The unique identifier for the license type.
|
|
40
|
+
*/
|
|
41
|
+
license_type_id: string;
|
|
42
|
+
/**
|
|
43
|
+
* The pricing unit for the credits (e.g., 'credits').
|
|
44
|
+
*/
|
|
45
|
+
pricing_unit: string;
|
|
46
|
+
/**
|
|
47
|
+
* The remaining credits available for this license (allocated - consumed).
|
|
48
|
+
*/
|
|
49
|
+
remaining_credits: number;
|
|
50
|
+
/**
|
|
51
|
+
* The start date of the usage period.
|
|
52
|
+
*/
|
|
53
|
+
start_date: string;
|
|
54
|
+
/**
|
|
55
|
+
* The unique identifier for the subscription.
|
|
56
|
+
*/
|
|
57
|
+
subscription_id: string;
|
|
58
|
+
/**
|
|
59
|
+
* Credits consumed while the license was active (eligible for individual
|
|
60
|
+
* allocation deduction).
|
|
61
|
+
*/
|
|
62
|
+
allocation_eligible_credits?: number | null;
|
|
63
|
+
/**
|
|
64
|
+
* The external identifier for the license. Null when grouped by day only.
|
|
65
|
+
*/
|
|
66
|
+
external_license_id?: string | null;
|
|
67
|
+
/**
|
|
68
|
+
* The unique identifier for the license. Null when grouped by day only.
|
|
69
|
+
*/
|
|
70
|
+
license_id?: string | null;
|
|
71
|
+
/**
|
|
72
|
+
* Credits consumed while the license was inactive (draws from shared pool, not
|
|
73
|
+
* individual allocation).
|
|
74
|
+
*/
|
|
75
|
+
shared_pool_credits?: number | null;
|
|
76
|
+
}
|
|
77
|
+
}
|
|
78
|
+
export interface ExternalLicenseGetUsageParams {
|
|
79
|
+
/**
|
|
80
|
+
* The license type ID to filter licenses by.
|
|
81
|
+
*/
|
|
82
|
+
license_type_id: string;
|
|
83
|
+
/**
|
|
84
|
+
* The subscription ID to get license usage for.
|
|
85
|
+
*/
|
|
86
|
+
subscription_id: string;
|
|
87
|
+
/**
|
|
88
|
+
* Pagination cursor from a previous request.
|
|
89
|
+
*/
|
|
90
|
+
cursor?: string | null;
|
|
91
|
+
/**
|
|
92
|
+
* End date for the usage period (YYYY-MM-DD). Defaults to end of current billing
|
|
93
|
+
* period.
|
|
94
|
+
*/
|
|
95
|
+
end_date?: string | null;
|
|
96
|
+
/**
|
|
97
|
+
* How to group the results. Valid values: 'license', 'day'. Can be combined (e.g.,
|
|
98
|
+
* 'license,day').
|
|
99
|
+
*/
|
|
100
|
+
group_by?: Array<string> | null;
|
|
101
|
+
/**
|
|
102
|
+
* Maximum number of rows in the response data (default 20, max 100).
|
|
103
|
+
*/
|
|
104
|
+
limit?: number;
|
|
105
|
+
/**
|
|
106
|
+
* Start date for the usage period (YYYY-MM-DD). Defaults to start of current
|
|
107
|
+
* billing period.
|
|
108
|
+
*/
|
|
109
|
+
start_date?: string | null;
|
|
110
|
+
}
|
|
111
|
+
export declare namespace ExternalLicenses {
|
|
112
|
+
export { type ExternalLicenseGetUsageResponse as ExternalLicenseGetUsageResponse, type ExternalLicenseGetUsageParams as ExternalLicenseGetUsageParams, };
|
|
113
|
+
}
|
|
114
|
+
//# sourceMappingURL=external-licenses.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"external-licenses.d.ts","sourceRoot":"","sources":["../../src/resources/licenses/external-licenses.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,WAAW,EAAE,MAAM,gBAAgB,CAAC;AAC7C,OAAO,KAAK,IAAI,MAAM,YAAY,CAAC;AACnC,OAAO,KAAK,MAAM,MAAM,WAAW,CAAC;AAEpC,qBAAa,gBAAiB,SAAQ,WAAW;IAC/C;;;;;OAKG;IACH,QAAQ,CACN,iBAAiB,EAAE,MAAM,EACzB,KAAK,EAAE,6BAA6B,EACpC,OAAO,CAAC,EAAE,IAAI,CAAC,cAAc,GAC5B,IAAI,CAAC,UAAU,CAAC,+BAA+B,CAAC;CAGpD;AAED,MAAM,WAAW,+BAA+B;IAC9C,IAAI,EAAE,KAAK,CAAC,+BAA+B,CAAC,IAAI,CAAC,CAAC;IAElD,mBAAmB,EAAE,MAAM,CAAC,kBAAkB,CAAC;CAChD;AAED,yBAAiB,+BAA+B,CAAC;IAC/C;;;;;;OAMG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 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
// File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
|
|
3
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
4
|
+
exports.ExternalLicenses = void 0;
|
|
5
|
+
const resource_1 = require("../../resource.js");
|
|
6
|
+
class ExternalLicenses extends resource_1.APIResource {
|
|
7
|
+
/**
|
|
8
|
+
* Returns usage and remaining credits for a license identified by its external
|
|
9
|
+
* license ID.
|
|
10
|
+
*
|
|
11
|
+
* Date range defaults to the current billing period if not specified.
|
|
12
|
+
*/
|
|
13
|
+
getUsage(externalLicenseId, query, options) {
|
|
14
|
+
return this._client.get(`/licenses/external_licenses/${externalLicenseId}/usage`, { query, ...options });
|
|
15
|
+
}
|
|
16
|
+
}
|
|
17
|
+
exports.ExternalLicenses = ExternalLicenses;
|
|
18
|
+
//# sourceMappingURL=external-licenses.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"external-licenses.js","sourceRoot":"","sources":["../../src/resources/licenses/external-licenses.ts"],"names":[],"mappings":";AAAA,sFAAsF;;;AAEtF,gDAA6C;AAI7C,MAAa,gBAAiB,SAAQ,sBAAW;IAC/C;;;;;OAKG;IACH,QAAQ,CACN,iBAAyB,EACzB,KAAoC,EACpC,OAA6B;QAE7B,OAAO,IAAI,CAAC,OAAO,CAAC,GAAG,CAAC,+BAA+B,iBAAiB,QAAQ,EAAE,EAAE,KAAK,EAAE,GAAG,OAAO,EAAE,CAAC,CAAC;IAC3G,CAAC;CACF;AAdD,4CAcC"}
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
// File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
|
|
2
|
+
import { APIResource } from "../../resource.mjs";
|
|
3
|
+
export class ExternalLicenses extends APIResource {
|
|
4
|
+
/**
|
|
5
|
+
* Returns usage and remaining credits for a license identified by its external
|
|
6
|
+
* license ID.
|
|
7
|
+
*
|
|
8
|
+
* Date range defaults to the current billing period if not specified.
|
|
9
|
+
*/
|
|
10
|
+
getUsage(externalLicenseId, query, options) {
|
|
11
|
+
return this._client.get(`/licenses/external_licenses/${externalLicenseId}/usage`, { query, ...options });
|
|
12
|
+
}
|
|
13
|
+
}
|
|
14
|
+
//# sourceMappingURL=external-licenses.mjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"external-licenses.mjs","sourceRoot":"","sources":["../../src/resources/licenses/external-licenses.ts"],"names":[],"mappings":"AAAA,sFAAsF;OAE/E,EAAE,WAAW,EAAE;AAItB,MAAM,OAAO,gBAAiB,SAAQ,WAAW;IAC/C;;;;;OAKG;IACH,QAAQ,CACN,iBAAyB,EACzB,KAAoC,EACpC,OAA6B;QAE7B,OAAO,IAAI,CAAC,OAAO,CAAC,GAAG,CAAC,+BAA+B,iBAAiB,QAAQ,EAAE,EAAE,KAAK,EAAE,GAAG,OAAO,EAAE,CAAC,CAAC;IAC3G,CAAC;CACF"}
|
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
export { ExternalLicenses, type ExternalLicenseGetUsageResponse, type ExternalLicenseGetUsageParams, } from "./external-licenses.js";
|
|
2
|
+
export { LicenseListResponsesPage, Licenses, type LicenseCreateResponse, type LicenseRetrieveResponse, type LicenseListResponse, type LicenseDeactivateResponse, type LicenseRetrieveByExternalIDResponse, type LicenseCreateParams, type LicenseListParams, type LicenseDeactivateParams, type LicenseRetrieveByExternalIDParams, } from "./licenses.js";
|
|
3
|
+
export { Usage, type UsageGetAllUsageResponse, type UsageGetUsageResponse, type UsageGetAllUsageParams, type UsageGetUsageParams, } from "./usage.js";
|
|
4
|
+
//# sourceMappingURL=index.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/resources/licenses/index.ts"],"names":[],"mappings":"AAEA,OAAO,EACL,gBAAgB,EAChB,KAAK,+BAA+B,EACpC,KAAK,6BAA6B,GACnC,MAAM,qBAAqB,CAAC;AAC7B,OAAO,EACL,wBAAwB,EACxB,QAAQ,EACR,KAAK,qBAAqB,EAC1B,KAAK,uBAAuB,EAC5B,KAAK,mBAAmB,EACxB,KAAK,yBAAyB,EAC9B,KAAK,mCAAmC,EACxC,KAAK,mBAAmB,EACxB,KAAK,iBAAiB,EACtB,KAAK,uBAAuB,EAC5B,KAAK,iCAAiC,GACvC,MAAM,YAAY,CAAC;AACpB,OAAO,EACL,KAAK,EACL,KAAK,wBAAwB,EAC7B,KAAK,qBAAqB,EAC1B,KAAK,sBAAsB,EAC3B,KAAK,mBAAmB,GACzB,MAAM,SAAS,CAAC"}
|