orb-billing 6.0.1 → 6.1.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 +22 -0
- package/README.md +1 -4
- package/bin/cli +52 -0
- package/bin/migration-config.json +238 -0
- package/client.d.mts +5 -10
- package/client.d.mts.map +1 -1
- package/client.d.ts +5 -10
- package/client.d.ts.map +1 -1
- package/client.js +140 -149
- package/client.js.map +1 -1
- package/client.mjs +138 -146
- package/client.mjs.map +1 -1
- package/core/api-promise.d.mts +2 -2
- package/core/api-promise.d.mts.map +1 -1
- package/core/api-promise.d.ts +2 -2
- package/core/api-promise.d.ts.map +1 -1
- package/core/api-promise.js.map +1 -1
- package/core/api-promise.mjs.map +1 -1
- package/core/pagination.d.mts +4 -4
- package/core/pagination.d.mts.map +1 -1
- package/core/pagination.d.ts +4 -4
- package/core/pagination.d.ts.map +1 -1
- package/core/pagination.js.map +1 -1
- package/core/pagination.mjs.map +1 -1
- package/core/resource.d.mts +3 -3
- package/core/resource.d.mts.map +1 -1
- package/core/resource.d.ts +3 -3
- package/core/resource.d.ts.map +1 -1
- package/core/resource.js.map +1 -1
- package/core/resource.mjs.map +1 -1
- package/index.d.mts +1 -1
- package/index.d.mts.map +1 -1
- package/index.d.ts +1 -1
- package/index.d.ts.map +1 -1
- package/index.js +1 -2
- package/index.js.map +1 -1
- package/index.mjs +1 -1
- package/index.mjs.map +1 -1
- package/internal/parse.d.mts +2 -2
- package/internal/parse.d.mts.map +1 -1
- package/internal/parse.d.ts +2 -2
- package/internal/parse.d.ts.map +1 -1
- package/internal/parse.js.map +1 -1
- package/internal/parse.mjs.map +1 -1
- package/internal/uploads.d.mts +4 -4
- package/internal/uploads.d.mts.map +1 -1
- package/internal/uploads.d.ts +4 -4
- package/internal/uploads.d.ts.map +1 -1
- package/internal/uploads.js.map +1 -1
- package/internal/uploads.mjs.map +1 -1
- package/internal/utils/log.d.mts +3 -3
- package/internal/utils/log.d.mts.map +1 -1
- package/internal/utils/log.d.ts +3 -3
- package/internal/utils/log.d.ts.map +1 -1
- package/internal/utils/log.js.map +1 -1
- package/internal/utils/log.mjs.map +1 -1
- package/package.json +4 -1
- package/resources/alerts.d.mts +18 -7
- package/resources/alerts.d.mts.map +1 -1
- package/resources/alerts.d.ts +18 -7
- package/resources/alerts.d.ts.map +1 -1
- package/resources/alerts.js +31 -14
- package/resources/alerts.js.map +1 -1
- package/resources/alerts.mjs +31 -14
- package/resources/alerts.mjs.map +1 -1
- package/resources/beta/beta.d.mts +2 -2
- package/resources/beta/beta.d.ts +2 -2
- package/resources/beta/beta.js +6 -6
- package/resources/beta/beta.js.map +1 -1
- package/resources/beta/beta.mjs +6 -6
- package/resources/beta/beta.mjs.map +1 -1
- package/resources/beta/external-plan-id.d.mts +2 -2
- package/resources/beta/external-plan-id.d.ts +2 -2
- package/resources/beta/external-plan-id.js +6 -6
- package/resources/beta/external-plan-id.js.map +1 -1
- package/resources/beta/external-plan-id.mjs +6 -6
- package/resources/beta/external-plan-id.mjs.map +1 -1
- package/resources/coupons/coupons.d.mts +2 -2
- package/resources/coupons/coupons.d.ts +2 -2
- package/resources/coupons/coupons.js +4 -4
- package/resources/coupons/coupons.mjs +4 -4
- package/resources/coupons/subscriptions.d.mts +1 -1
- package/resources/coupons/subscriptions.d.ts +1 -1
- package/resources/coupons/subscriptions.js +2 -2
- package/resources/coupons/subscriptions.mjs +2 -2
- package/resources/credit-blocks.d.mts +3 -3
- package/resources/credit-blocks.d.ts +3 -3
- package/resources/credit-blocks.js +6 -6
- package/resources/credit-blocks.mjs +6 -6
- package/resources/credit-notes.d.mts +1 -1
- package/resources/credit-notes.d.ts +1 -1
- package/resources/credit-notes.js +2 -2
- package/resources/credit-notes.mjs +2 -2
- package/resources/customers/balance-transactions.d.mts +2 -2
- package/resources/customers/balance-transactions.d.ts +2 -2
- package/resources/customers/balance-transactions.js +4 -4
- package/resources/customers/balance-transactions.mjs +4 -4
- package/resources/customers/costs.d.mts +2 -2
- package/resources/customers/costs.d.ts +2 -2
- package/resources/customers/costs.js +4 -4
- package/resources/customers/costs.mjs +4 -4
- package/resources/customers/credits/credits.d.mts +2 -2
- package/resources/customers/credits/credits.d.ts +2 -2
- package/resources/customers/credits/credits.js +4 -4
- package/resources/customers/credits/credits.mjs +4 -4
- package/resources/customers/credits/ledger.d.mts +4 -4
- package/resources/customers/credits/ledger.d.ts +4 -4
- package/resources/customers/credits/ledger.js +8 -8
- package/resources/customers/credits/ledger.mjs +8 -8
- package/resources/customers/credits/top-ups.d.mts +6 -6
- package/resources/customers/credits/top-ups.d.ts +6 -6
- package/resources/customers/credits/top-ups.js +14 -14
- package/resources/customers/credits/top-ups.js.map +1 -1
- package/resources/customers/credits/top-ups.mjs +14 -14
- package/resources/customers/credits/top-ups.mjs.map +1 -1
- package/resources/customers/customers.d.mts +65 -7
- package/resources/customers/customers.d.mts.map +1 -1
- package/resources/customers/customers.d.ts +65 -7
- package/resources/customers/customers.d.ts.map +1 -1
- package/resources/customers/customers.js +35 -12
- package/resources/customers/customers.js.map +1 -1
- package/resources/customers/customers.mjs +35 -12
- package/resources/customers/customers.mjs.map +1 -1
- package/resources/customers/index.d.mts +1 -1
- package/resources/customers/index.d.mts.map +1 -1
- package/resources/customers/index.d.ts +1 -1
- package/resources/customers/index.d.ts.map +1 -1
- package/resources/customers/index.js.map +1 -1
- package/resources/customers/index.mjs.map +1 -1
- package/resources/dimensional-price-groups/dimensional-price-groups.d.mts +2 -2
- package/resources/dimensional-price-groups/dimensional-price-groups.d.ts +2 -2
- package/resources/dimensional-price-groups/dimensional-price-groups.js +4 -4
- package/resources/dimensional-price-groups/dimensional-price-groups.mjs +4 -4
- package/resources/dimensional-price-groups/external-dimensional-price-group-id.d.mts +2 -2
- package/resources/dimensional-price-groups/external-dimensional-price-group-id.d.ts +2 -2
- package/resources/dimensional-price-groups/external-dimensional-price-group-id.js +4 -4
- package/resources/dimensional-price-groups/external-dimensional-price-group-id.mjs +4 -4
- package/resources/events/backfills.d.mts +3 -3
- package/resources/events/backfills.d.ts +3 -3
- package/resources/events/backfills.js +6 -6
- package/resources/events/backfills.mjs +6 -6
- package/resources/events/events.d.mts +2 -18
- package/resources/events/events.d.mts.map +1 -1
- package/resources/events/events.d.ts +2 -18
- package/resources/events/events.d.ts.map +1 -1
- package/resources/events/events.js +6 -6
- package/resources/events/events.js.map +1 -1
- package/resources/events/events.mjs +6 -6
- package/resources/events/events.mjs.map +1 -1
- package/resources/index.d.mts +1 -1
- package/resources/index.d.mts.map +1 -1
- package/resources/index.d.ts +1 -1
- package/resources/index.d.ts.map +1 -1
- package/resources/index.js.map +1 -1
- package/resources/index.mjs.map +1 -1
- package/resources/invoices.d.mts +74 -8
- package/resources/invoices.d.mts.map +1 -1
- package/resources/invoices.d.ts +74 -8
- package/resources/invoices.d.ts.map +1 -1
- package/resources/invoices.js +87 -17
- package/resources/invoices.js.map +1 -1
- package/resources/invoices.mjs +87 -17
- package/resources/invoices.mjs.map +1 -1
- package/resources/items.d.mts +3 -3
- package/resources/items.d.ts +3 -3
- package/resources/items.js +6 -6
- package/resources/items.mjs +6 -6
- package/resources/license-types.d.mts +1 -1
- package/resources/license-types.d.ts +1 -1
- package/resources/license-types.js +2 -2
- package/resources/license-types.mjs +2 -2
- package/resources/licenses/external-licenses.d.mts +1 -1
- package/resources/licenses/external-licenses.d.ts +1 -1
- package/resources/licenses/external-licenses.js +2 -2
- package/resources/licenses/external-licenses.mjs +2 -2
- package/resources/licenses/licenses.d.mts +3 -3
- package/resources/licenses/licenses.d.ts +3 -3
- package/resources/licenses/licenses.js +6 -6
- package/resources/licenses/licenses.mjs +6 -6
- package/resources/licenses/usage.d.mts +1 -1
- package/resources/licenses/usage.d.ts +1 -1
- package/resources/licenses/usage.js +2 -2
- package/resources/licenses/usage.mjs +2 -2
- package/resources/metrics.d.mts +2 -2
- package/resources/metrics.d.ts +2 -2
- package/resources/metrics.js +4 -4
- package/resources/metrics.mjs +4 -4
- package/resources/plans/external-plan-id.d.mts +2 -2
- package/resources/plans/external-plan-id.d.ts +2 -2
- package/resources/plans/external-plan-id.js +4 -4
- package/resources/plans/external-plan-id.mjs +4 -4
- package/resources/plans/migrations.d.mts +3 -3
- package/resources/plans/migrations.d.ts +3 -3
- package/resources/plans/migrations.js +8 -8
- package/resources/plans/migrations.js.map +1 -1
- package/resources/plans/migrations.mjs +8 -8
- package/resources/plans/migrations.mjs.map +1 -1
- package/resources/plans/plans.d.mts +2 -2
- package/resources/plans/plans.d.ts +2 -2
- package/resources/plans/plans.js +4 -4
- package/resources/plans/plans.mjs +4 -4
- package/resources/prices/external-price-id.d.mts +2 -2
- package/resources/prices/external-price-id.d.ts +2 -2
- package/resources/prices/external-price-id.js +4 -4
- package/resources/prices/external-price-id.mjs +4 -4
- package/resources/prices/prices.d.mts +3 -3
- package/resources/prices/prices.d.ts +3 -3
- package/resources/prices/prices.js +6 -6
- package/resources/prices/prices.mjs +6 -6
- package/resources/subscription-changes.d.mts +3 -3
- package/resources/subscription-changes.d.ts +3 -3
- package/resources/subscription-changes.js +6 -6
- package/resources/subscription-changes.mjs +6 -6
- package/resources/subscriptions.d.mts +15 -15
- package/resources/subscriptions.d.ts +15 -15
- package/resources/subscriptions.js +30 -30
- package/resources/subscriptions.mjs +30 -30
- package/src/client.ts +11 -8
- package/src/core/api-promise.ts +4 -7
- package/src/core/pagination.ts +5 -5
- package/src/core/resource.ts +3 -3
- package/src/index.ts +1 -1
- package/src/internal/parse.ts +2 -2
- package/src/internal/uploads.ts +5 -5
- package/src/internal/utils/log.ts +3 -3
- package/src/resources/alerts.ts +32 -14
- package/src/resources/beta/beta.ts +6 -6
- package/src/resources/beta/external-plan-id.ts +6 -6
- package/src/resources/coupons/coupons.ts +4 -4
- package/src/resources/coupons/subscriptions.ts +2 -2
- package/src/resources/credit-blocks.ts +6 -6
- package/src/resources/credit-notes.ts +2 -2
- package/src/resources/customers/balance-transactions.ts +4 -4
- package/src/resources/customers/costs.ts +4 -4
- package/src/resources/customers/credits/credits.ts +4 -4
- package/src/resources/customers/credits/ledger.ts +8 -8
- package/src/resources/customers/credits/top-ups.ts +14 -14
- package/src/resources/customers/customers.ts +105 -12
- package/src/resources/customers/index.ts +4 -0
- package/src/resources/dimensional-price-groups/dimensional-price-groups.ts +4 -4
- package/src/resources/dimensional-price-groups/external-dimensional-price-group-id.ts +4 -4
- package/src/resources/events/backfills.ts +6 -6
- package/src/resources/events/events.ts +6 -26
- package/src/resources/index.ts +4 -0
- package/src/resources/invoices.ts +89 -17
- package/src/resources/items.ts +6 -6
- package/src/resources/license-types.ts +2 -2
- package/src/resources/licenses/external-licenses.ts +2 -2
- package/src/resources/licenses/licenses.ts +6 -6
- package/src/resources/licenses/usage.ts +2 -2
- package/src/resources/metrics.ts +4 -4
- package/src/resources/plans/external-plan-id.ts +4 -4
- package/src/resources/plans/migrations.ts +8 -8
- package/src/resources/plans/plans.ts +4 -4
- package/src/resources/prices/external-price-id.ts +4 -4
- package/src/resources/prices/prices.ts +6 -6
- package/src/resources/subscription-changes.ts +6 -6
- package/src/resources/subscriptions.ts +30 -30
- package/src/version.ts +1 -1
- package/version.d.mts +1 -1
- package/version.d.ts +1 -1
- package/version.js +1 -1
- package/version.mjs +1 -1
package/resources/alerts.d.ts
CHANGED
|
@@ -14,11 +14,11 @@ export declare class Alerts extends APIResource {
|
|
|
14
14
|
/**
|
|
15
15
|
* This endpoint retrieves an alert by its ID.
|
|
16
16
|
*/
|
|
17
|
-
retrieve(
|
|
17
|
+
retrieve(alertID: string, options?: RequestOptions): APIPromise<Alert>;
|
|
18
18
|
/**
|
|
19
19
|
* This endpoint updates the thresholds of an alert.
|
|
20
20
|
*/
|
|
21
|
-
update(
|
|
21
|
+
update(alertConfigurationID: string, body: AlertUpdateParams, options?: RequestOptions): APIPromise<Alert>;
|
|
22
22
|
/**
|
|
23
23
|
* This endpoint returns a list of alerts within Orb.
|
|
24
24
|
*
|
|
@@ -33,6 +33,17 @@ export declare class Alerts extends APIResource {
|
|
|
33
33
|
* [standardized pagination format](/api-reference/pagination).
|
|
34
34
|
*/
|
|
35
35
|
list(query?: AlertListParams | null | undefined, options?: RequestOptions): PagePromise<AlertsPage, Alert>;
|
|
36
|
+
/**
|
|
37
|
+
* This endpoint trashes a subscription- or customer-scoped alert. The alert is
|
|
38
|
+
* soft-deleted: it stops firing immediately and no longer appears in fetch or list
|
|
39
|
+
* responses, while the underlying record is retained internally for audit.
|
|
40
|
+
*
|
|
41
|
+
* Plan-level alerts cannot be trashed via the API — disable them instead
|
|
42
|
+
* (`POST /v1/alerts/{alert_configuration_id}/disable`). Their removal would need
|
|
43
|
+
* to be unwound from every subscription the alert was propagated to, which isn't
|
|
44
|
+
* supported yet.
|
|
45
|
+
*/
|
|
46
|
+
delete(alertConfigurationID: string, options?: RequestOptions): APIPromise<void>;
|
|
36
47
|
/**
|
|
37
48
|
* This endpoint creates a new alert to monitor a customer's credit balance. There
|
|
38
49
|
* are three types of alerts that can be scoped to customers:
|
|
@@ -43,7 +54,7 @@ export declare class Alerts extends APIResource {
|
|
|
43
54
|
* while `credit_balance_depleted` and `credit_balance_recovered` alerts do not
|
|
44
55
|
* require thresholds.
|
|
45
56
|
*/
|
|
46
|
-
createForCustomer(
|
|
57
|
+
createForCustomer(customerID: string, body: AlertCreateForCustomerParams, options?: RequestOptions): APIPromise<Alert>;
|
|
47
58
|
/**
|
|
48
59
|
* This endpoint creates a new alert to monitor a customer's credit balance. There
|
|
49
60
|
* are three types of alerts that can be scoped to customers:
|
|
@@ -54,7 +65,7 @@ export declare class Alerts extends APIResource {
|
|
|
54
65
|
* while `credit_balance_depleted` and `credit_balance_recovered` alerts do not
|
|
55
66
|
* require thresholds.
|
|
56
67
|
*/
|
|
57
|
-
createForExternalCustomer(
|
|
68
|
+
createForExternalCustomer(externalCustomerID: string, body: AlertCreateForExternalCustomerParams, options?: RequestOptions): APIPromise<Alert>;
|
|
58
69
|
/**
|
|
59
70
|
* This endpoint is used to create alerts at the subscription level.
|
|
60
71
|
*
|
|
@@ -68,19 +79,19 @@ export declare class Alerts extends APIResource {
|
|
|
68
79
|
* per metric that is a part of the subscription. Alerts are triggered based on
|
|
69
80
|
* usage or cost conditions met during the current billing cycle.
|
|
70
81
|
*/
|
|
71
|
-
createForSubscription(
|
|
82
|
+
createForSubscription(subscriptionID: string, body: AlertCreateForSubscriptionParams, options?: RequestOptions): APIPromise<Alert>;
|
|
72
83
|
/**
|
|
73
84
|
* This endpoint allows you to disable an alert. To disable a plan-level alert for
|
|
74
85
|
* a specific subscription, you must include the `subscription_id`. The
|
|
75
86
|
* `subscription_id` is not required for customer or subscription level alerts.
|
|
76
87
|
*/
|
|
77
|
-
disable(
|
|
88
|
+
disable(alertConfigurationID: string, params?: AlertDisableParams | null | undefined, options?: RequestOptions): APIPromise<Alert>;
|
|
78
89
|
/**
|
|
79
90
|
* This endpoint allows you to enable an alert. To enable a plan-level alert for a
|
|
80
91
|
* specific subscription, you must include the `subscription_id`. The
|
|
81
92
|
* `subscription_id` is not required for customer or subscription level alerts.
|
|
82
93
|
*/
|
|
83
|
-
enable(
|
|
94
|
+
enable(alertConfigurationID: string, params?: AlertEnableParams | null | undefined, options?: RequestOptions): APIPromise<Alert>;
|
|
84
95
|
}
|
|
85
96
|
export type AlertsPage = Page<Alert>;
|
|
86
97
|
/**
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"alerts.d.ts","sourceRoot":"","sources":["../src/resources/alerts.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,WAAW,EAAE,4BAAyB;AAC/C,OAAO,KAAK,SAAS,oBAAiB;AACtC,OAAO,KAAK,MAAM,oBAAiB;AACnC,OAAO,EAAE,UAAU,EAAE,+BAA4B;AACjD,OAAO,EAAE,IAAI,EAAE,KAAK,UAAU,EAAE,WAAW,EAAE,8BAA2B;
|
|
1
|
+
{"version":3,"file":"alerts.d.ts","sourceRoot":"","sources":["../src/resources/alerts.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,WAAW,EAA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MAAM,EAAE,KAAK,CAAC,MAAM,CAAC,CAAC;KACvB;IAED;;;;;OAKG;IACH,UAAiB,iBAAiB;QAChC;;;;WAIG;QACH,YAAY,EAAE,KAAK,CAAC,MAAM,CAAC,CAAC;QAE5B;;;WAGG;QACH,UAAU,EAAE,KAAK,CAAC,SAAS,CAAC,SAAS,CAAC,CAAC;KACxC;CACF;AAED,MAAM,WAAW,kBAAkB;IACjC;;OAEG;IACH,eAAe,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC;CACjC;AAED,MAAM,WAAW,iBAAiB;IAChC;;OAEG;IACH,eAAe,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC;CACjC;AAED,MAAM,CAAC,OAAO,WAAW,MAAM,CAAC;IAC9B,OAAO,EACL,KAAK,KAAK,IAAI,KAAK,EACnB,KAAK,SAAS,IAAI,SAAS,EAC3B,KAAK,UAAU,IAAI,UAAU,EAC7B,KAAK,iBAAiB,IAAI,iBAAiB,EAC3C,KAAK,eAAe,IAAI,eAAe,EACvC,KAAK,4BAA4B,IAAI,4BAA4B,EACjE,KAAK,oCAAoC,IAAI,oCAAoC,EACjF,KAAK,gCAAgC,IAAI,gCAAgC,EACzE,KAAK,kBAAkB,IAAI,kBAAkB,EAC7C,KAAK,iBAAiB,IAAI,iBAAiB,GAC5C,CAAC;CACH"}
|
package/resources/alerts.js
CHANGED
|
@@ -4,6 +4,7 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
|
4
4
|
exports.Alerts = void 0;
|
|
5
5
|
const resource_1 = require("../core/resource.js");
|
|
6
6
|
const pagination_1 = require("../core/pagination.js");
|
|
7
|
+
const headers_1 = require("../internal/headers.js");
|
|
7
8
|
const path_1 = require("../internal/utils/path.js");
|
|
8
9
|
/**
|
|
9
10
|
* [Alerts within Orb](/product-catalog/configuring-alerts) monitor spending,
|
|
@@ -15,14 +16,14 @@ class Alerts extends resource_1.APIResource {
|
|
|
15
16
|
/**
|
|
16
17
|
* This endpoint retrieves an alert by its ID.
|
|
17
18
|
*/
|
|
18
|
-
retrieve(
|
|
19
|
-
return this._client.get((0, path_1.path) `/alerts/${
|
|
19
|
+
retrieve(alertID, options) {
|
|
20
|
+
return this._client.get((0, path_1.path) `/alerts/${alertID}`, options);
|
|
20
21
|
}
|
|
21
22
|
/**
|
|
22
23
|
* This endpoint updates the thresholds of an alert.
|
|
23
24
|
*/
|
|
24
|
-
update(
|
|
25
|
-
return this._client.put((0, path_1.path) `/alerts/${
|
|
25
|
+
update(alertConfigurationID, body, options) {
|
|
26
|
+
return this._client.put((0, path_1.path) `/alerts/${alertConfigurationID}`, { body, ...options });
|
|
26
27
|
}
|
|
27
28
|
/**
|
|
28
29
|
* This endpoint returns a list of alerts within Orb.
|
|
@@ -40,6 +41,22 @@ class Alerts extends resource_1.APIResource {
|
|
|
40
41
|
list(query = {}, options) {
|
|
41
42
|
return this._client.getAPIList('/alerts', (pagination_1.Page), { query, ...options });
|
|
42
43
|
}
|
|
44
|
+
/**
|
|
45
|
+
* This endpoint trashes a subscription- or customer-scoped alert. The alert is
|
|
46
|
+
* soft-deleted: it stops firing immediately and no longer appears in fetch or list
|
|
47
|
+
* responses, while the underlying record is retained internally for audit.
|
|
48
|
+
*
|
|
49
|
+
* Plan-level alerts cannot be trashed via the API — disable them instead
|
|
50
|
+
* (`POST /v1/alerts/{alert_configuration_id}/disable`). Their removal would need
|
|
51
|
+
* to be unwound from every subscription the alert was propagated to, which isn't
|
|
52
|
+
* supported yet.
|
|
53
|
+
*/
|
|
54
|
+
delete(alertConfigurationID, options) {
|
|
55
|
+
return this._client.delete((0, path_1.path) `/alerts/${alertConfigurationID}`, {
|
|
56
|
+
...options,
|
|
57
|
+
headers: (0, headers_1.buildHeaders)([{ Accept: '*/*' }, options?.headers]),
|
|
58
|
+
});
|
|
59
|
+
}
|
|
43
60
|
/**
|
|
44
61
|
* This endpoint creates a new alert to monitor a customer's credit balance. There
|
|
45
62
|
* are three types of alerts that can be scoped to customers:
|
|
@@ -50,8 +67,8 @@ class Alerts extends resource_1.APIResource {
|
|
|
50
67
|
* while `credit_balance_depleted` and `credit_balance_recovered` alerts do not
|
|
51
68
|
* require thresholds.
|
|
52
69
|
*/
|
|
53
|
-
createForCustomer(
|
|
54
|
-
return this._client.post((0, path_1.path) `/alerts/customer_id/${
|
|
70
|
+
createForCustomer(customerID, body, options) {
|
|
71
|
+
return this._client.post((0, path_1.path) `/alerts/customer_id/${customerID}`, { body, ...options });
|
|
55
72
|
}
|
|
56
73
|
/**
|
|
57
74
|
* This endpoint creates a new alert to monitor a customer's credit balance. There
|
|
@@ -63,8 +80,8 @@ class Alerts extends resource_1.APIResource {
|
|
|
63
80
|
* while `credit_balance_depleted` and `credit_balance_recovered` alerts do not
|
|
64
81
|
* require thresholds.
|
|
65
82
|
*/
|
|
66
|
-
createForExternalCustomer(
|
|
67
|
-
return this._client.post((0, path_1.path) `/alerts/external_customer_id/${
|
|
83
|
+
createForExternalCustomer(externalCustomerID, body, options) {
|
|
84
|
+
return this._client.post((0, path_1.path) `/alerts/external_customer_id/${externalCustomerID}`, { body, ...options });
|
|
68
85
|
}
|
|
69
86
|
/**
|
|
70
87
|
* This endpoint is used to create alerts at the subscription level.
|
|
@@ -79,17 +96,17 @@ class Alerts extends resource_1.APIResource {
|
|
|
79
96
|
* per metric that is a part of the subscription. Alerts are triggered based on
|
|
80
97
|
* usage or cost conditions met during the current billing cycle.
|
|
81
98
|
*/
|
|
82
|
-
createForSubscription(
|
|
83
|
-
return this._client.post((0, path_1.path) `/alerts/subscription_id/${
|
|
99
|
+
createForSubscription(subscriptionID, body, options) {
|
|
100
|
+
return this._client.post((0, path_1.path) `/alerts/subscription_id/${subscriptionID}`, { body, ...options });
|
|
84
101
|
}
|
|
85
102
|
/**
|
|
86
103
|
* This endpoint allows you to disable an alert. To disable a plan-level alert for
|
|
87
104
|
* a specific subscription, you must include the `subscription_id`. The
|
|
88
105
|
* `subscription_id` is not required for customer or subscription level alerts.
|
|
89
106
|
*/
|
|
90
|
-
disable(
|
|
107
|
+
disable(alertConfigurationID, params = {}, options) {
|
|
91
108
|
const { subscription_id } = params ?? {};
|
|
92
|
-
return this._client.post((0, path_1.path) `/alerts/${
|
|
109
|
+
return this._client.post((0, path_1.path) `/alerts/${alertConfigurationID}/disable`, {
|
|
93
110
|
query: { subscription_id },
|
|
94
111
|
...options,
|
|
95
112
|
});
|
|
@@ -99,9 +116,9 @@ class Alerts extends resource_1.APIResource {
|
|
|
99
116
|
* specific subscription, you must include the `subscription_id`. The
|
|
100
117
|
* `subscription_id` is not required for customer or subscription level alerts.
|
|
101
118
|
*/
|
|
102
|
-
enable(
|
|
119
|
+
enable(alertConfigurationID, params = {}, options) {
|
|
103
120
|
const { subscription_id } = params ?? {};
|
|
104
|
-
return this._client.post((0, path_1.path) `/alerts/${
|
|
121
|
+
return this._client.post((0, path_1.path) `/alerts/${alertConfigurationID}/enable`, {
|
|
105
122
|
query: { subscription_id },
|
|
106
123
|
...options,
|
|
107
124
|
});
|
package/resources/alerts.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"alerts.js","sourceRoot":"","sources":["../src/resources/alerts.ts"],"names":[],"mappings":";AAAA,sFAAsF;;;AAEtF,kDAA+C;AAI/C,sDAAwE;
|
|
1
|
+
{"version":3,"file":"alerts.js","sourceRoot":"","sources":["../src/resources/alerts.ts"],"names":[],"mappings":";AAAA,sFAAsF;;;AAEtF,kDAA+C;AAI/C,sDAAwE;AACxE,oDAAmD;AAEnD,oDAA8C;AAE9C;;;;;GAKG;AACH,MAAa,MAAO,SAAQ,sBAAW;IACrC;;OAEG;IACH,QAAQ,CAAC,OAAe,EAAE,OAAwB;QAChD,OAAO,IAAI,CAAC,OAAO,CAAC,GAAG,CAAC,IAAA,WAAI,EAAA,WAAW,OAAO,EAAE,EAAE,OAAO,CAAC,CAAC;IAC7D,CAAC;IAED;;OAEG;IACH,MAAM,CAAC,oBAA4B,EAAE,IAAuB,EAAE,OAAwB;QACpF,OAAO,IA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AI,CAAC,IAAA,WAAI,EAAA,2BAA2B,cAAc,EAAE,EAAE,EAAE,IAAI,EAAE,GAAG,OAAO,EAAE,CAAC,CAAC;IAClG,CAAC;IAED;;;;OAIG;IACH,OAAO,CACL,oBAA4B,EAC5B,SAAgD,EAAE,EAClD,OAAwB;QAExB,MAAM,EAAE,eAAe,EAAE,GAAG,MAAM,IAAI,EAAE,CAAC;QACzC,OAAO,IAAI,CAAC,OAAO,CAAC,IAAI,CAAC,IAAA,WAAI,EAAA,WAAW,oBAAoB,UAAU,EAAE;YACtE,KAAK,EAAE,EAAE,eAAe,EAAE;YAC1B,GAAG,OAAO;SACX,CAAC,CAAC;IACL,CAAC;IAED;;;;OAIG;IACH,MAAM,CACJ,oBAA4B,EAC5B,SAA+C,EAAE,EACjD,OAAwB;QAExB,MAAM,EAAE,eAAe,EAAE,GAAG,MAAM,IAAI,EAAE,CAAC;QACzC,OAAO,IAAI,CAAC,OAAO,CAAC,IAAI,CAAC,IAAA,WAAI,EAAA,WAAW,oBAAoB,SAAS,EAAE;YACrE,KAAK,EAAE,EAAE,eAAe,EAAE;YAC1B,GAAG,OAAO;SACX,CAAC,CAAC;IACL,CAAC;CACF;AA9ID,wBA8IC"}
|
package/resources/alerts.mjs
CHANGED
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
// File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
|
|
2
2
|
import { APIResource } from "../core/resource.mjs";
|
|
3
3
|
import { Page } from "../core/pagination.mjs";
|
|
4
|
+
import { buildHeaders } from "../internal/headers.mjs";
|
|
4
5
|
import { path } from "../internal/utils/path.mjs";
|
|
5
6
|
/**
|
|
6
7
|
* [Alerts within Orb](/product-catalog/configuring-alerts) monitor spending,
|
|
@@ -12,14 +13,14 @@ export class Alerts extends APIResource {
|
|
|
12
13
|
/**
|
|
13
14
|
* This endpoint retrieves an alert by its ID.
|
|
14
15
|
*/
|
|
15
|
-
retrieve(
|
|
16
|
-
return this._client.get(path `/alerts/${
|
|
16
|
+
retrieve(alertID, options) {
|
|
17
|
+
return this._client.get(path `/alerts/${alertID}`, options);
|
|
17
18
|
}
|
|
18
19
|
/**
|
|
19
20
|
* This endpoint updates the thresholds of an alert.
|
|
20
21
|
*/
|
|
21
|
-
update(
|
|
22
|
-
return this._client.put(path `/alerts/${
|
|
22
|
+
update(alertConfigurationID, body, options) {
|
|
23
|
+
return this._client.put(path `/alerts/${alertConfigurationID}`, { body, ...options });
|
|
23
24
|
}
|
|
24
25
|
/**
|
|
25
26
|
* This endpoint returns a list of alerts within Orb.
|
|
@@ -37,6 +38,22 @@ export class Alerts extends APIResource {
|
|
|
37
38
|
list(query = {}, options) {
|
|
38
39
|
return this._client.getAPIList('/alerts', (Page), { query, ...options });
|
|
39
40
|
}
|
|
41
|
+
/**
|
|
42
|
+
* This endpoint trashes a subscription- or customer-scoped alert. The alert is
|
|
43
|
+
* soft-deleted: it stops firing immediately and no longer appears in fetch or list
|
|
44
|
+
* responses, while the underlying record is retained internally for audit.
|
|
45
|
+
*
|
|
46
|
+
* Plan-level alerts cannot be trashed via the API — disable them instead
|
|
47
|
+
* (`POST /v1/alerts/{alert_configuration_id}/disable`). Their removal would need
|
|
48
|
+
* to be unwound from every subscription the alert was propagated to, which isn't
|
|
49
|
+
* supported yet.
|
|
50
|
+
*/
|
|
51
|
+
delete(alertConfigurationID, options) {
|
|
52
|
+
return this._client.delete(path `/alerts/${alertConfigurationID}`, {
|
|
53
|
+
...options,
|
|
54
|
+
headers: buildHeaders([{ Accept: '*/*' }, options?.headers]),
|
|
55
|
+
});
|
|
56
|
+
}
|
|
40
57
|
/**
|
|
41
58
|
* This endpoint creates a new alert to monitor a customer's credit balance. There
|
|
42
59
|
* are three types of alerts that can be scoped to customers:
|
|
@@ -47,8 +64,8 @@ export class Alerts extends APIResource {
|
|
|
47
64
|
* while `credit_balance_depleted` and `credit_balance_recovered` alerts do not
|
|
48
65
|
* require thresholds.
|
|
49
66
|
*/
|
|
50
|
-
createForCustomer(
|
|
51
|
-
return this._client.post(path `/alerts/customer_id/${
|
|
67
|
+
createForCustomer(customerID, body, options) {
|
|
68
|
+
return this._client.post(path `/alerts/customer_id/${customerID}`, { body, ...options });
|
|
52
69
|
}
|
|
53
70
|
/**
|
|
54
71
|
* This endpoint creates a new alert to monitor a customer's credit balance. There
|
|
@@ -60,8 +77,8 @@ export class Alerts extends APIResource {
|
|
|
60
77
|
* while `credit_balance_depleted` and `credit_balance_recovered` alerts do not
|
|
61
78
|
* require thresholds.
|
|
62
79
|
*/
|
|
63
|
-
createForExternalCustomer(
|
|
64
|
-
return this._client.post(path `/alerts/external_customer_id/${
|
|
80
|
+
createForExternalCustomer(externalCustomerID, body, options) {
|
|
81
|
+
return this._client.post(path `/alerts/external_customer_id/${externalCustomerID}`, { body, ...options });
|
|
65
82
|
}
|
|
66
83
|
/**
|
|
67
84
|
* This endpoint is used to create alerts at the subscription level.
|
|
@@ -76,17 +93,17 @@ export class Alerts extends APIResource {
|
|
|
76
93
|
* per metric that is a part of the subscription. Alerts are triggered based on
|
|
77
94
|
* usage or cost conditions met during the current billing cycle.
|
|
78
95
|
*/
|
|
79
|
-
createForSubscription(
|
|
80
|
-
return this._client.post(path `/alerts/subscription_id/${
|
|
96
|
+
createForSubscription(subscriptionID, body, options) {
|
|
97
|
+
return this._client.post(path `/alerts/subscription_id/${subscriptionID}`, { body, ...options });
|
|
81
98
|
}
|
|
82
99
|
/**
|
|
83
100
|
* This endpoint allows you to disable an alert. To disable a plan-level alert for
|
|
84
101
|
* a specific subscription, you must include the `subscription_id`. The
|
|
85
102
|
* `subscription_id` is not required for customer or subscription level alerts.
|
|
86
103
|
*/
|
|
87
|
-
disable(
|
|
104
|
+
disable(alertConfigurationID, params = {}, options) {
|
|
88
105
|
const { subscription_id } = params ?? {};
|
|
89
|
-
return this._client.post(path `/alerts/${
|
|
106
|
+
return this._client.post(path `/alerts/${alertConfigurationID}/disable`, {
|
|
90
107
|
query: { subscription_id },
|
|
91
108
|
...options,
|
|
92
109
|
});
|
|
@@ -96,9 +113,9 @@ export class Alerts extends APIResource {
|
|
|
96
113
|
* specific subscription, you must include the `subscription_id`. The
|
|
97
114
|
* `subscription_id` is not required for customer or subscription level alerts.
|
|
98
115
|
*/
|
|
99
|
-
enable(
|
|
116
|
+
enable(alertConfigurationID, params = {}, options) {
|
|
100
117
|
const { subscription_id } = params ?? {};
|
|
101
|
-
return this._client.post(path `/alerts/${
|
|
118
|
+
return this._client.post(path `/alerts/${alertConfigurationID}/enable`, {
|
|
102
119
|
query: { subscription_id },
|
|
103
120
|
...options,
|
|
104
121
|
});
|
package/resources/alerts.mjs.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"alerts.mjs","sourceRoot":"","sources":["../src/resources/alerts.ts"],"names":[],"mappings":"AAAA,sFAAsF;AAEtF,OAAO,EAAE,WAAW,EAAE,6BAAyB;AAI/C,OAAO,EAAE,IAAI,EAAgC,+BAA2B;
|
|
1
|
+
{"version":3,"file":"alerts.mjs","sourceRoot":"","sources":["../src/resources/alerts.ts"],"names":[],"mappings":"AAAA,sFAAsF;AAEtF,OAAO,EAAE,WAAW,EAAE,6BAAyB;AAI/C,OAAO,EAAE,IAAI,EAAgC,+BAA2B;AACxE,OAAO,EAAE,YAAY,EAAE,gCAA4B;AAEnD,OAAO,EAAE,IAAI,EAAE,mCAA+B;AAE9C;;;;;GAKG;AACH,MAAM,OAAO,MAAO,SAAQ,WAAW;IACrC;;OAEG;IACH,QAAQ,CAAC,OAAe,EAAE,OAAwB;QAChD,OAAO,IAAI,CAAC,OAAO,CAAC,GAAG,CAAC,IAAI,CAAA,WAAW,OAAO,EAAE,EAAE,OAAO,CAAC,CAAC;IAC7D,CAAC;IAED;;OAEG;IACH,MAAM,CAAC,oBAA4B,EAAE,IAAuB,EAAE,OAAwB;QACpF,OAAO,IAAI,CAAC,OAAO,CAAC,GAAG,CAAC,IAAI,CAAA,WAAW,oBAAoB,EAAE,EAAE,EAAE,IAAI,EA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IG;IACH,OAAO,CACL,oBAA4B,EAC5B,SAAgD,EAAE,EAClD,OAAwB;QAExB,MAAM,EAAE,eAAe,EAAE,GAAG,MAAM,IAAI,EAAE,CAAC;QACzC,OAAO,IAAI,CAAC,OAAO,CAAC,IAAI,CAAC,IAAI,CAAA,WAAW,oBAAoB,UAAU,EAAE;YACtE,KAAK,EAAE,EAAE,eAAe,EAAE;YAC1B,GAAG,OAAO;SACX,CAAC,CAAC;IACL,CAAC;IAED;;;;OAIG;IACH,MAAM,CACJ,oBAA4B,EAC5B,SAA+C,EAAE,EACjD,OAAwB;QAExB,MAAM,EAAE,eAAe,EAAE,GAAG,MAAM,IAAI,EAAE,CAAC;QACzC,OAAO,IAAI,CAAC,OAAO,CAAC,IAAI,CAAC,IAAI,CAAA,WAAW,oBAAoB,SAAS,EAAE;YACrE,KAAK,EAAE,EAAE,eAAe,EAAE;YAC1B,GAAG,OAAO;SACX,CAAC,CAAC;IACL,CAAC;CACF"}
|
|
@@ -15,7 +15,7 @@ export declare class Beta extends APIResource {
|
|
|
15
15
|
/**
|
|
16
16
|
* This endpoint allows the creation of a new plan version for an existing plan.
|
|
17
17
|
*/
|
|
18
|
-
createPlanVersion(
|
|
18
|
+
createPlanVersion(planID: string, body: BetaCreatePlanVersionParams, options?: RequestOptions): APIPromise<PlanVersion>;
|
|
19
19
|
/**
|
|
20
20
|
* This endpoint is used to fetch a plan version. It returns the phases, prices,
|
|
21
21
|
* and adjustments present on this version of the plan.
|
|
@@ -24,7 +24,7 @@ export declare class Beta extends APIResource {
|
|
|
24
24
|
/**
|
|
25
25
|
* This endpoint allows setting the default version of a plan.
|
|
26
26
|
*/
|
|
27
|
-
setDefaultPlanVersion(
|
|
27
|
+
setDefaultPlanVersion(planID: string, body: BetaSetDefaultPlanVersionParams, options?: RequestOptions): APIPromise<PlansAPI.Plan>;
|
|
28
28
|
}
|
|
29
29
|
/**
|
|
30
30
|
* The PlanVersion resource represents the prices and adjustments present on a
|
package/resources/beta/beta.d.ts
CHANGED
|
@@ -15,7 +15,7 @@ export declare class Beta extends APIResource {
|
|
|
15
15
|
/**
|
|
16
16
|
* This endpoint allows the creation of a new plan version for an existing plan.
|
|
17
17
|
*/
|
|
18
|
-
createPlanVersion(
|
|
18
|
+
createPlanVersion(planID: string, body: BetaCreatePlanVersionParams, options?: RequestOptions): APIPromise<PlanVersion>;
|
|
19
19
|
/**
|
|
20
20
|
* This endpoint is used to fetch a plan version. It returns the phases, prices,
|
|
21
21
|
* and adjustments present on this version of the plan.
|
|
@@ -24,7 +24,7 @@ export declare class Beta extends APIResource {
|
|
|
24
24
|
/**
|
|
25
25
|
* This endpoint allows setting the default version of a plan.
|
|
26
26
|
*/
|
|
27
|
-
setDefaultPlanVersion(
|
|
27
|
+
setDefaultPlanVersion(planID: string, body: BetaSetDefaultPlanVersionParams, options?: RequestOptions): APIPromise<PlansAPI.Plan>;
|
|
28
28
|
}
|
|
29
29
|
/**
|
|
30
30
|
* The PlanVersion resource represents the prices and adjustments present on a
|
package/resources/beta/beta.js
CHANGED
|
@@ -20,22 +20,22 @@ class Beta extends resource_1.APIResource {
|
|
|
20
20
|
/**
|
|
21
21
|
* This endpoint allows the creation of a new plan version for an existing plan.
|
|
22
22
|
*/
|
|
23
|
-
createPlanVersion(
|
|
24
|
-
return this._client.post((0, path_1.path) `/plans/${
|
|
23
|
+
createPlanVersion(planID, body, options) {
|
|
24
|
+
return this._client.post((0, path_1.path) `/plans/${planID}/versions`, { body, ...options });
|
|
25
25
|
}
|
|
26
26
|
/**
|
|
27
27
|
* This endpoint is used to fetch a plan version. It returns the phases, prices,
|
|
28
28
|
* and adjustments present on this version of the plan.
|
|
29
29
|
*/
|
|
30
30
|
fetchPlanVersion(version, params, options) {
|
|
31
|
-
const { plan_id
|
|
32
|
-
return this._client.get((0, path_1.path) `/plans/${
|
|
31
|
+
const { plan_id } = params;
|
|
32
|
+
return this._client.get((0, path_1.path) `/plans/${plan_id}/versions/${version}`, options);
|
|
33
33
|
}
|
|
34
34
|
/**
|
|
35
35
|
* This endpoint allows setting the default version of a plan.
|
|
36
36
|
*/
|
|
37
|
-
setDefaultPlanVersion(
|
|
38
|
-
return this._client.post((0, path_1.path) `/plans/${
|
|
37
|
+
setDefaultPlanVersion(planID, body, options) {
|
|
38
|
+
return this._client.post((0, path_1.path) `/plans/${planID}/set_default_version`, { body, ...options });
|
|
39
39
|
}
|
|
40
40
|
}
|
|
41
41
|
exports.Beta = Beta;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"beta.js","sourceRoot":"","sources":["../../src/resources/beta/beta.ts"],"names":[],"mappings":";AAAA,sFAAsF;;;;AAEtF,qDAAkD;AAElD,iFAAwD;AACxD,4DAK4B;AAI5B,uDAAiD;AAEjD;;;;GAIG;AACH,MAAa,IAAK,SAAQ,sBAAW;IAArC;;QACE,mBAAc,GAAqC,IAAI,iBAAiB,CAAC,cAAc,CAAC,IAAI,CAAC,OAAO,CAAC,CAAC;IAoCxG,CAAC;IAlCC;;OAEG;IACH,iBAAiB,CACf,MAAc,EACd,IAAiC,EACjC,OAAwB;QAExB,OAAO,IAAI,CAAC,OAAO,CAAC,IAAI,CAAC,IAAA,WAAI,EAAA,UAAU,MAAM,WAAW,EAAE,EAAE,IAAI,EAAE,GAAG,OAAO,EAAE,CAAC,CAAC;IAClF,CAAC;IAED;;;OAGG;IACH,gBAAgB,CACd,OAAe,EACf,MAAkC,EAClC,OAAwB;QAExB,MAAM,EAAE,OAAO,EAAE,
|
|
1
|
+
{"version":3,"file":"beta.js","sourceRoot":"","sources":["../../src/resources/beta/beta.ts"],"names":[],"mappings":";AAAA,sFAAsF;;;;AAEtF,qDAAkD;AAElD,iFAAwD;AACxD,4DAK4B;AAI5B,uDAAiD;AAEjD;;;;GAIG;AACH,MAAa,IAAK,SAAQ,sBAAW;IAArC;;QACE,mBAAc,GAAqC,IAAI,iBAAiB,CAAC,cAAc,CAAC,IAAI,CAAC,OAAO,CAAC,CAAC;IAoCxG,CAAC;IAlCC;;OAEG;IACH,iBAAiB,CACf,MAAc,EACd,IAAiC,EACjC,OAAwB;QAExB,OAAO,IAAI,CAAC,OAAO,CAAC,IAAI,CAAC,IAAA,WAAI,EAAA,UAAU,MAAM,WAAW,EAAE,EAAE,IAAI,EAAE,GAAG,OAAO,EAAE,CAAC,CAAC;IAClF,CAAC;IAED;;;OAGG;IACH,gBAAgB,CACd,OAAe,EACf,MAAkC,EAClC,OAAwB;QAExB,MAAM,EAAE,OAAO,EAAE,GAAG,MAAM,CAAC;QAC3B,OAAO,IAAI,CAAC,OAAO,CAAC,GAAG,CAAC,IAAA,WAAI,EAAA,UAAU,OAAO,aAAa,OAAO,EAAE,EAAE,OAAO,CAAC,CAAC;IAChF,CAAC;IAED;;OAEG;IACH,qBAAqB,CACnB,MAAc,EACd,IAAqC,EACrC,OAAwB;QAExB,OAAO,IAAI,CAAC,OAAO,CAAC,IAAI,CAAC,IAAA,WAAI,EAAA,UAAU,MAAM,sBAAsB,EAAE,EAAE,IAAI,EAAE,GAAG,OAAO,EAAE,CAAC,CAAC;IAC7F,CAAC;CACF;AArCD,oBAqCC;AAw1GD,IAAI,CAAC,cAAc,GAAG,iCAAc,CAAC"}
|
package/resources/beta/beta.mjs
CHANGED
|
@@ -16,22 +16,22 @@ export class Beta extends APIResource {
|
|
|
16
16
|
/**
|
|
17
17
|
* This endpoint allows the creation of a new plan version for an existing plan.
|
|
18
18
|
*/
|
|
19
|
-
createPlanVersion(
|
|
20
|
-
return this._client.post(path `/plans/${
|
|
19
|
+
createPlanVersion(planID, body, options) {
|
|
20
|
+
return this._client.post(path `/plans/${planID}/versions`, { body, ...options });
|
|
21
21
|
}
|
|
22
22
|
/**
|
|
23
23
|
* This endpoint is used to fetch a plan version. It returns the phases, prices,
|
|
24
24
|
* and adjustments present on this version of the plan.
|
|
25
25
|
*/
|
|
26
26
|
fetchPlanVersion(version, params, options) {
|
|
27
|
-
const { plan_id
|
|
28
|
-
return this._client.get(path `/plans/${
|
|
27
|
+
const { plan_id } = params;
|
|
28
|
+
return this._client.get(path `/plans/${plan_id}/versions/${version}`, options);
|
|
29
29
|
}
|
|
30
30
|
/**
|
|
31
31
|
* This endpoint allows setting the default version of a plan.
|
|
32
32
|
*/
|
|
33
|
-
setDefaultPlanVersion(
|
|
34
|
-
return this._client.post(path `/plans/${
|
|
33
|
+
setDefaultPlanVersion(planID, body, options) {
|
|
34
|
+
return this._client.post(path `/plans/${planID}/set_default_version`, { body, ...options });
|
|
35
35
|
}
|
|
36
36
|
}
|
|
37
37
|
Beta.ExternalPlanID = ExternalPlanID;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"beta.mjs","sourceRoot":"","sources":["../../src/resources/beta/beta.ts"],"names":[],"mappings":"AAAA,sFAAsF;AAEtF,OAAO,EAAE,WAAW,EAAE,gCAA4B;AAElD,OAAO,KAAK,iBAAiB,+BAA2B;AACxD,OAAO,EACL,cAAc,GAIf,+BAA2B;AAI5B,OAAO,EAAE,IAAI,EAAE,sCAAkC;AAEjD;;;;GAIG;AACH,MAAM,OAAO,IAAK,SAAQ,WAAW;IAArC;;QACE,mBAAc,GAAqC,IAAI,iBAAiB,CAAC,cAAc,CAAC,IAAI,CAAC,OAAO,CAAC,CAAC;IAoCxG,CAAC;IAlCC;;OAEG;IACH,iBAAiB,CACf,MAAc,EACd,IAAiC,EACjC,OAAwB;QAExB,OAAO,IAAI,CAAC,OAAO,CAAC,IAAI,CAAC,IAAI,CAAA,UAAU,MAAM,WAAW,EAAE,EAAE,IAAI,EAAE,GAAG,OAAO,EAAE,CAAC,CAAC;IAClF,CAAC;IAED;;;OAGG;IACH,gBAAgB,CACd,OAAe,EACf,MAAkC,EAClC,OAAwB;QAExB,MAAM,EAAE,OAAO,EAAE,
|
|
1
|
+
{"version":3,"file":"beta.mjs","sourceRoot":"","sources":["../../src/resources/beta/beta.ts"],"names":[],"mappings":"AAAA,sFAAsF;AAEtF,OAAO,EAAE,WAAW,EAAE,gCAA4B;AAElD,OAAO,KAAK,iBAAiB,+BAA2B;AACxD,OAAO,EACL,cAAc,GAIf,+BAA2B;AAI5B,OAAO,EAAE,IAAI,EAAE,sCAAkC;AAEjD;;;;GAIG;AACH,MAAM,OAAO,IAAK,SAAQ,WAAW;IAArC;;QACE,mBAAc,GAAqC,IAAI,iBAAiB,CAAC,cAAc,CAAC,IAAI,CAAC,OAAO,CAAC,CAAC;IAoCxG,CAAC;IAlCC;;OAEG;IACH,iBAAiB,CACf,MAAc,EACd,IAAiC,EACjC,OAAwB;QAExB,OAAO,IAAI,CAAC,OAAO,CAAC,IAAI,CAAC,IAAI,CAAA,UAAU,MAAM,WAAW,EAAE,EAAE,IAAI,EAAE,GAAG,OAAO,EAAE,CAAC,CAAC;IAClF,CAAC;IAED;;;OAGG;IACH,gBAAgB,CACd,OAAe,EACf,MAAkC,EAClC,OAAwB;QAExB,MAAM,EAAE,OAAO,EAAE,GAAG,MAAM,CAAC;QAC3B,OAAO,IAAI,CAAC,OAAO,CAAC,GAAG,CAAC,IAAI,CAAA,UAAU,OAAO,aAAa,OAAO,EAAE,EAAE,OAAO,CAAC,CAAC;IAChF,CAAC;IAED;;OAEG;IACH,qBAAqB,CACnB,MAAc,EACd,IAAqC,EACrC,OAAwB;QAExB,OAAO,IAAI,CAAC,OAAO,CAAC,IAAI,CAAC,IAAI,CAAA,UAAU,MAAM,sBAAsB,EAAE,EAAE,IAAI,EAAE,GAAG,OAAO,EAAE,CAAC,CAAC;IAC7F,CAAC;CACF;AAw1GD,IAAI,CAAC,cAAc,GAAG,cAAc,CAAC"}
|
|
@@ -13,7 +13,7 @@ export declare class ExternalPlanID extends APIResource {
|
|
|
13
13
|
/**
|
|
14
14
|
* This endpoint allows the creation of a new plan version for an existing plan.
|
|
15
15
|
*/
|
|
16
|
-
createPlanVersion(
|
|
16
|
+
createPlanVersion(externalPlanID: string, body: ExternalPlanIDCreatePlanVersionParams, options?: RequestOptions): APIPromise<BetaAPI.PlanVersion>;
|
|
17
17
|
/**
|
|
18
18
|
* This endpoint is used to fetch a plan version. It returns the phases, prices,
|
|
19
19
|
* and adjustments present on this version of the plan.
|
|
@@ -22,7 +22,7 @@ export declare class ExternalPlanID extends APIResource {
|
|
|
22
22
|
/**
|
|
23
23
|
* This endpoint allows setting the default version of a plan.
|
|
24
24
|
*/
|
|
25
|
-
setDefaultPlanVersion(
|
|
25
|
+
setDefaultPlanVersion(externalPlanID: string, body: ExternalPlanIDSetDefaultPlanVersionParams, options?: RequestOptions): APIPromise<PlansAPI.Plan>;
|
|
26
26
|
}
|
|
27
27
|
export interface ExternalPlanIDCreatePlanVersionParams {
|
|
28
28
|
/**
|
|
@@ -13,7 +13,7 @@ export declare class ExternalPlanID extends APIResource {
|
|
|
13
13
|
/**
|
|
14
14
|
* This endpoint allows the creation of a new plan version for an existing plan.
|
|
15
15
|
*/
|
|
16
|
-
createPlanVersion(
|
|
16
|
+
createPlanVersion(externalPlanID: string, body: ExternalPlanIDCreatePlanVersionParams, options?: RequestOptions): APIPromise<BetaAPI.PlanVersion>;
|
|
17
17
|
/**
|
|
18
18
|
* This endpoint is used to fetch a plan version. It returns the phases, prices,
|
|
19
19
|
* and adjustments present on this version of the plan.
|
|
@@ -22,7 +22,7 @@ export declare class ExternalPlanID extends APIResource {
|
|
|
22
22
|
/**
|
|
23
23
|
* This endpoint allows setting the default version of a plan.
|
|
24
24
|
*/
|
|
25
|
-
setDefaultPlanVersion(
|
|
25
|
+
setDefaultPlanVersion(externalPlanID: string, body: ExternalPlanIDSetDefaultPlanVersionParams, options?: RequestOptions): APIPromise<PlansAPI.Plan>;
|
|
26
26
|
}
|
|
27
27
|
export interface ExternalPlanIDCreatePlanVersionParams {
|
|
28
28
|
/**
|
|
@@ -13,22 +13,22 @@ class ExternalPlanID extends resource_1.APIResource {
|
|
|
13
13
|
/**
|
|
14
14
|
* This endpoint allows the creation of a new plan version for an existing plan.
|
|
15
15
|
*/
|
|
16
|
-
createPlanVersion(
|
|
17
|
-
return this._client.post((0, path_1.path) `/plans/external_plan_id/${
|
|
16
|
+
createPlanVersion(externalPlanID, body, options) {
|
|
17
|
+
return this._client.post((0, path_1.path) `/plans/external_plan_id/${externalPlanID}/versions`, { body, ...options });
|
|
18
18
|
}
|
|
19
19
|
/**
|
|
20
20
|
* This endpoint is used to fetch a plan version. It returns the phases, prices,
|
|
21
21
|
* and adjustments present on this version of the plan.
|
|
22
22
|
*/
|
|
23
23
|
fetchPlanVersion(version, params, options) {
|
|
24
|
-
const { external_plan_id
|
|
25
|
-
return this._client.get((0, path_1.path) `/plans/external_plan_id/${
|
|
24
|
+
const { external_plan_id } = params;
|
|
25
|
+
return this._client.get((0, path_1.path) `/plans/external_plan_id/${external_plan_id}/versions/${version}`, options);
|
|
26
26
|
}
|
|
27
27
|
/**
|
|
28
28
|
* This endpoint allows setting the default version of a plan.
|
|
29
29
|
*/
|
|
30
|
-
setDefaultPlanVersion(
|
|
31
|
-
return this._client.post((0, path_1.path) `/plans/external_plan_id/${
|
|
30
|
+
setDefaultPlanVersion(externalPlanID, body, options) {
|
|
31
|
+
return this._client.post((0, path_1.path) `/plans/external_plan_id/${externalPlanID}/set_default_version`, {
|
|
32
32
|
body,
|
|
33
33
|
...options,
|
|
34
34
|
});
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"external-plan-id.js","sourceRoot":"","sources":["../../src/resources/beta/external-plan-id.ts"],"names":[],"mappings":";AAAA,sFAAsF;;;AAEtF,qDAAkD;AAMlD,uDAAiD;AAEjD;;;;GAIG;AACH,MAAa,cAAe,SAAQ,sBAAW;IAC7C;;OAEG;IACH,iBAAiB,CACf,cAAsB,EACtB,IAA2C,EAC3C,OAAwB;QAExB,OAAO,IAAI,CAAC,OAAO,CAAC,IAAI,CAAC,IAAA,WAAI,EAAA,2BAA2B,cAAc,WAAW,EAAE,EAAE,IAAI,EAAE,GAAG,OAAO,EAAE,CAAC,CAAC;IAC3G,CAAC;IAED;;;OAGG;IACH,gBAAgB,CACd,OAAe,EACf,MAA4C,EAC5C,OAAwB;QAExB,MAAM,EAAE,gBAAgB,EAAE,
|
|
1
|
+
{"version":3,"file":"external-plan-id.js","sourceRoot":"","sources":["../../src/resources/beta/external-plan-id.ts"],"names":[],"mappings":";AAAA,sFAAsF;;;AAEtF,qDAAkD;AAMlD,uDAAiD;AAEjD;;;;GAIG;AACH,MAAa,cAAe,SAAQ,sBAAW;IAC7C;;OAEG;IACH,iBAAiB,CACf,cAAsB,EACtB,IAA2C,EAC3C,OAAwB;QAExB,OAAO,IAAI,CAAC,OAAO,CAAC,IAAI,CAAC,IAAA,WAAI,EAAA,2BAA2B,cAAc,WAAW,EAAE,EAAE,IAAI,EAAE,GAAG,OAAO,EAAE,CAAC,CAAC;IAC3G,CAAC;IAED;;;OAGG;IACH,gBAAgB,CACd,OAAe,EACf,MAA4C,EAC5C,OAAwB;QAExB,MAAM,EAAE,gBAAgB,EAAE,GAAG,MAAM,CAAC;QACpC,OAAO,IAAI,CAAC,OAAO,CAAC,GAAG,CAAC,IAAA,WAAI,EAAA,2BAA2B,gBAAgB,aAAa,OAAO,EAAE,EAAE,OAAO,CAAC,CAAC;IAC1G,CAAC;IAED;;OAEG;IACH,qBAAqB,CACnB,cAAsB,EACtB,IAA+C,EAC/C,OAAwB;QAExB,OAAO,IAAI,CAAC,OAAO,CAAC,IAAI,CAAC,IAAA,WAAI,EAAA,2BAA2B,cAAc,sBAAsB,EAAE;YAC5F,IAAI;YACJ,GAAG,OAAO;SACX,CAAC,CAAC;IACL,CAAC;CACF;AAtCD,wCAsCC"}
|
|
@@ -10,22 +10,22 @@ export class ExternalPlanID extends APIResource {
|
|
|
10
10
|
/**
|
|
11
11
|
* This endpoint allows the creation of a new plan version for an existing plan.
|
|
12
12
|
*/
|
|
13
|
-
createPlanVersion(
|
|
14
|
-
return this._client.post(path `/plans/external_plan_id/${
|
|
13
|
+
createPlanVersion(externalPlanID, body, options) {
|
|
14
|
+
return this._client.post(path `/plans/external_plan_id/${externalPlanID}/versions`, { body, ...options });
|
|
15
15
|
}
|
|
16
16
|
/**
|
|
17
17
|
* This endpoint is used to fetch a plan version. It returns the phases, prices,
|
|
18
18
|
* and adjustments present on this version of the plan.
|
|
19
19
|
*/
|
|
20
20
|
fetchPlanVersion(version, params, options) {
|
|
21
|
-
const { external_plan_id
|
|
22
|
-
return this._client.get(path `/plans/external_plan_id/${
|
|
21
|
+
const { external_plan_id } = params;
|
|
22
|
+
return this._client.get(path `/plans/external_plan_id/${external_plan_id}/versions/${version}`, options);
|
|
23
23
|
}
|
|
24
24
|
/**
|
|
25
25
|
* This endpoint allows setting the default version of a plan.
|
|
26
26
|
*/
|
|
27
|
-
setDefaultPlanVersion(
|
|
28
|
-
return this._client.post(path `/plans/external_plan_id/${
|
|
27
|
+
setDefaultPlanVersion(externalPlanID, body, options) {
|
|
28
|
+
return this._client.post(path `/plans/external_plan_id/${externalPlanID}/set_default_version`, {
|
|
29
29
|
body,
|
|
30
30
|
...options,
|
|
31
31
|
});
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"external-plan-id.mjs","sourceRoot":"","sources":["../../src/resources/beta/external-plan-id.ts"],"names":[],"mappings":"AAAA,sFAAsF;AAEtF,OAAO,EAAE,WAAW,EAAE,gCAA4B;AAMlD,OAAO,EAAE,IAAI,EAAE,sCAAkC;AAEjD;;;;GAIG;AACH,MAAM,OAAO,cAAe,SAAQ,WAAW;IAC7C;;OAEG;IACH,iBAAiB,CACf,cAAsB,EACtB,IAA2C,EAC3C,OAAwB;QAExB,OAAO,IAAI,CAAC,OAAO,CAAC,IAAI,CAAC,IAAI,CAAA,2BAA2B,cAAc,WAAW,EAAE,EAAE,IAAI,EAAE,GAAG,OAAO,EAAE,CAAC,CAAC;IAC3G,CAAC;IAED;;;OAGG;IACH,gBAAgB,CACd,OAAe,EACf,MAA4C,EAC5C,OAAwB;QAExB,MAAM,EAAE,gBAAgB,EAAE,
|
|
1
|
+
{"version":3,"file":"external-plan-id.mjs","sourceRoot":"","sources":["../../src/resources/beta/external-plan-id.ts"],"names":[],"mappings":"AAAA,sFAAsF;AAEtF,OAAO,EAAE,WAAW,EAAE,gCAA4B;AAMlD,OAAO,EAAE,IAAI,EAAE,sCAAkC;AAEjD;;;;GAIG;AACH,MAAM,OAAO,cAAe,SAAQ,WAAW;IAC7C;;OAEG;IACH,iBAAiB,CACf,cAAsB,EACtB,IAA2C,EAC3C,OAAwB;QAExB,OAAO,IAAI,CAAC,OAAO,CAAC,IAAI,CAAC,IAAI,CAAA,2BAA2B,cAAc,WAAW,EAAE,EAAE,IAAI,EAAE,GAAG,OAAO,EAAE,CAAC,CAAC;IAC3G,CAAC;IAED;;;OAGG;IACH,gBAAgB,CACd,OAAe,EACf,MAA4C,EAC5C,OAAwB;QAExB,MAAM,EAAE,gBAAgB,EAAE,GAAG,MAAM,CAAC;QACpC,OAAO,IAAI,CAAC,OAAO,CAAC,GAAG,CAAC,IAAI,CAAA,2BAA2B,gBAAgB,aAAa,OAAO,EAAE,EAAE,OAAO,CAAC,CAAC;IAC1G,CAAC;IAED;;OAEG;IACH,qBAAqB,CACnB,cAAsB,EACtB,IAA+C,EAC/C,OAAwB;QAExB,OAAO,IAAI,CAAC,OAAO,CAAC,IAAI,CAAC,IAAI,CAAA,2BAA2B,cAAc,sBAAsB,EAAE;YAC5F,IAAI;YACJ,GAAG,OAAO;SACX,CAAC,CAAC;IACL,CAAC;CACF"}
|
|
@@ -52,7 +52,7 @@ export declare class Coupons extends APIResource {
|
|
|
52
52
|
* const coupon = await client.coupons.archive('coupon_id');
|
|
53
53
|
* ```
|
|
54
54
|
*/
|
|
55
|
-
archive(
|
|
55
|
+
archive(couponID: string, options?: RequestOptions): APIPromise<Coupon>;
|
|
56
56
|
/**
|
|
57
57
|
* This endpoint retrieves a coupon by its ID. To fetch coupons by their redemption
|
|
58
58
|
* code, use the [List coupons](list-coupons) endpoint with the redemption_code
|
|
@@ -63,7 +63,7 @@ export declare class Coupons extends APIResource {
|
|
|
63
63
|
* const coupon = await client.coupons.fetch('coupon_id');
|
|
64
64
|
* ```
|
|
65
65
|
*/
|
|
66
|
-
fetch(
|
|
66
|
+
fetch(couponID: string, options?: RequestOptions): APIPromise<Coupon>;
|
|
67
67
|
}
|
|
68
68
|
export type CouponsPage = Page<Coupon>;
|
|
69
69
|
/**
|
|
@@ -52,7 +52,7 @@ export declare class Coupons extends APIResource {
|
|
|
52
52
|
* const coupon = await client.coupons.archive('coupon_id');
|
|
53
53
|
* ```
|
|
54
54
|
*/
|
|
55
|
-
archive(
|
|
55
|
+
archive(couponID: string, options?: RequestOptions): APIPromise<Coupon>;
|
|
56
56
|
/**
|
|
57
57
|
* This endpoint retrieves a coupon by its ID. To fetch coupons by their redemption
|
|
58
58
|
* code, use the [List coupons](list-coupons) endpoint with the redemption_code
|
|
@@ -63,7 +63,7 @@ export declare class Coupons extends APIResource {
|
|
|
63
63
|
* const coupon = await client.coupons.fetch('coupon_id');
|
|
64
64
|
* ```
|
|
65
65
|
*/
|
|
66
|
-
fetch(
|
|
66
|
+
fetch(couponID: string, options?: RequestOptions): APIPromise<Coupon>;
|
|
67
67
|
}
|
|
68
68
|
export type CouponsPage = Page<Coupon>;
|
|
69
69
|
/**
|
|
@@ -62,8 +62,8 @@ class Coupons extends resource_1.APIResource {
|
|
|
62
62
|
* const coupon = await client.coupons.archive('coupon_id');
|
|
63
63
|
* ```
|
|
64
64
|
*/
|
|
65
|
-
archive(
|
|
66
|
-
return this._client.post((0, path_1.path) `/coupons/${
|
|
65
|
+
archive(couponID, options) {
|
|
66
|
+
return this._client.post((0, path_1.path) `/coupons/${couponID}/archive`, options);
|
|
67
67
|
}
|
|
68
68
|
/**
|
|
69
69
|
* This endpoint retrieves a coupon by its ID. To fetch coupons by their redemption
|
|
@@ -75,8 +75,8 @@ class Coupons extends resource_1.APIResource {
|
|
|
75
75
|
* const coupon = await client.coupons.fetch('coupon_id');
|
|
76
76
|
* ```
|
|
77
77
|
*/
|
|
78
|
-
fetch(
|
|
79
|
-
return this._client.get((0, path_1.path) `/coupons/${
|
|
78
|
+
fetch(couponID, options) {
|
|
79
|
+
return this._client.get((0, path_1.path) `/coupons/${couponID}`, options);
|
|
80
80
|
}
|
|
81
81
|
}
|
|
82
82
|
exports.Coupons = Coupons;
|