Initial project import

This commit is contained in:
drjones
2026-06-13 17:36:44 -07:00
commit ad2a18cc8d
18471 changed files with 4497570 additions and 0 deletions

View File

@@ -0,0 +1,27 @@
import { Alert } from './Alerts.js';
export interface AlertTriggered {
/**
* String representing the object's type. Objects of the same type share the same value.
*/
object: 'billing.alert_triggered';
/**
* A billing alert is a resource that notifies you when a certain usage threshold on a meter is crossed. For example, you might create a billing alert to notify you when a certain user made 100 API requests.
*/
alert: Alert;
/**
* Time at which the object was created. Measured in seconds since the Unix epoch.
*/
created: number;
/**
* ID of customer for which the alert triggered
*/
customer: string;
/**
* If the object exists in live mode, the value is `true`. If the object exists in test mode, the value is `false`.
*/
livemode: boolean;
/**
* The value triggering the alert
*/
value: number;
}

View File

@@ -0,0 +1,3 @@
// File generated from our OpenAPI spec
export {};
//# sourceMappingURL=AlertTriggereds.js.map

View File

@@ -0,0 +1 @@
{"version":3,"file":"AlertTriggereds.js","sourceRoot":"","sources":["../../../src/resources/Billing/AlertTriggereds.ts"],"names":[],"mappings":"AAAA,uCAAuC"}

193
node_modules/stripe/esm/resources/Billing/Alerts.d.ts generated vendored Normal file
View File

@@ -0,0 +1,193 @@
import { StripeResource } from '../../StripeResource.js';
import { Meter } from './Meters.js';
import { Customer } from './../Customers.js';
import { PaginationParams } from '../../shared.js';
import { RequestOptions, ApiListPromise, Response } from '../../lib.js';
export declare class AlertResource extends StripeResource {
/**
* Lists billing active and inactive alerts
*/
list(params?: Billing.AlertListParams, options?: RequestOptions): ApiListPromise<Alert>;
/**
* Creates a billing alert
*/
create(params: Billing.AlertCreateParams, options?: RequestOptions): Promise<Response<Alert>>;
/**
* Retrieves a billing alert given an ID
*/
retrieve(id: string, params?: Billing.AlertRetrieveParams, options?: RequestOptions): Promise<Response<Alert>>;
/**
* Reactivates this alert, allowing it to trigger again.
*/
activate(id: string, params?: Billing.AlertActivateParams, options?: RequestOptions): Promise<Response<Alert>>;
/**
* Archives this alert, removing it from the list view and APIs. This is non-reversible.
*/
archive(id: string, params?: Billing.AlertArchiveParams, options?: RequestOptions): Promise<Response<Alert>>;
/**
* Deactivates this alert, preventing it from triggering.
*/
deactivate(id: string, params?: Billing.AlertDeactivateParams, options?: RequestOptions): Promise<Response<Alert>>;
}
export interface Alert {
/**
* Unique identifier for the object.
*/
id: string;
/**
* String representing the object's type. Objects of the same type share the same value.
*/
object: 'billing.alert';
/**
* Defines the type of the alert.
*/
alert_type: 'usage_threshold';
/**
* If the object exists in live mode, the value is `true`. If the object exists in test mode, the value is `false`.
*/
livemode: boolean;
/**
* Status of the alert. This can be active, inactive or archived.
*/
status: Billing.Alert.Status | null;
/**
* Title of the alert.
*/
title: string;
/**
* Encapsulates configuration of the alert to monitor usage on a specific [Billing Meter](https://docs.stripe.com/api/billing/meter).
*/
usage_threshold: Billing.Alert.UsageThreshold | null;
}
export declare namespace Billing {
namespace Alert {
type Status = 'active' | 'archived' | 'inactive';
interface UsageThreshold {
/**
* The filters allow limiting the scope of this usage alert. You can only specify up to one filter at this time.
*/
filters: Array<UsageThreshold.Filter> | null;
/**
* The value at which this alert will trigger.
*/
gte: number;
/**
* The [Billing Meter](https://docs.stripe.com/api/billing/meter) ID whose usage is monitored.
*/
meter: string | Meter;
/**
* Defines how the alert will behave.
*/
recurrence: 'one_time';
}
namespace UsageThreshold {
interface Filter {
/**
* Limit the scope of the alert to this customer ID
*/
customer: string | Customer | null;
type: 'customer';
}
}
}
}
export declare namespace Billing {
interface AlertCreateParams {
/**
* The type of alert to create.
*/
alert_type: 'usage_threshold';
/**
* The title of the alert.
*/
title: string;
/**
* Specifies which fields in the response should be expanded.
*/
expand?: Array<string>;
/**
* The configuration of the usage threshold.
*/
usage_threshold?: AlertCreateParams.UsageThreshold;
}
namespace AlertCreateParams {
interface UsageThreshold {
/**
* The filters allows limiting the scope of this usage alert. You can only specify up to one filter at this time.
*/
filters?: Array<UsageThreshold.Filter>;
/**
* Defines the threshold value that triggers the alert.
*/
gte: number;
/**
* The [Billing Meter](https://docs.stripe.com/api/billing/meter) ID whose usage is monitored.
*/
meter: string;
/**
* Defines how the alert will behave.
*/
recurrence: 'one_time';
}
namespace UsageThreshold {
interface Filter {
/**
* Limit the scope to this usage alert only to this customer.
*/
customer?: string;
/**
* What type of filter is being applied to this usage alert.
*/
type: 'customer';
}
}
}
}
export declare namespace Billing {
interface AlertRetrieveParams {
/**
* Specifies which fields in the response should be expanded.
*/
expand?: Array<string>;
}
}
export declare namespace Billing {
interface AlertListParams extends PaginationParams {
/**
* Filter results to only include this type of alert.
*/
alert_type?: 'usage_threshold';
/**
* Specifies which fields in the response should be expanded.
*/
expand?: Array<string>;
/**
* Filter results to only include alerts with the given meter.
*/
meter?: string;
}
}
export declare namespace Billing {
interface AlertActivateParams {
/**
* Specifies which fields in the response should be expanded.
*/
expand?: Array<string>;
}
}
export declare namespace Billing {
interface AlertArchiveParams {
/**
* Specifies which fields in the response should be expanded.
*/
expand?: Array<string>;
}
}
export declare namespace Billing {
interface AlertDeactivateParams {
/**
* Specifies which fields in the response should be expanded.
*/
expand?: Array<string>;
}
}

43
node_modules/stripe/esm/resources/Billing/Alerts.js generated vendored Normal file
View File

@@ -0,0 +1,43 @@
// File generated from our OpenAPI spec
import { StripeResource } from '../../StripeResource.js';
export class AlertResource extends StripeResource {
/**
* Lists billing active and inactive alerts
*/
list(params, options) {
return this._makeRequest('GET', '/v1/billing/alerts', params, options, {
methodType: 'list',
});
}
/**
* Creates a billing alert
*/
create(params, options) {
return this._makeRequest('POST', '/v1/billing/alerts', params, options);
}
/**
* Retrieves a billing alert given an ID
*/
retrieve(id, params, options) {
return this._makeRequest('GET', `/v1/billing/alerts/${encodeURIComponent(id)}`, params, options);
}
/**
* Reactivates this alert, allowing it to trigger again.
*/
activate(id, params, options) {
return this._makeRequest('POST', `/v1/billing/alerts/${encodeURIComponent(id)}/activate`, params, options);
}
/**
* Archives this alert, removing it from the list view and APIs. This is non-reversible.
*/
archive(id, params, options) {
return this._makeRequest('POST', `/v1/billing/alerts/${encodeURIComponent(id)}/archive`, params, options);
}
/**
* Deactivates this alert, preventing it from triggering.
*/
deactivate(id, params, options) {
return this._makeRequest('POST', `/v1/billing/alerts/${encodeURIComponent(id)}/deactivate`, params, options);
}
}
//# sourceMappingURL=Alerts.js.map

View File

@@ -0,0 +1 @@
{"version":3,"file":"Alerts.js","sourceRoot":"","sources":["../../../src/resources/Billing/Alerts.ts"],"names":[],"mappings":"AAAA,uCAAuC;AAEvC,OAAO,EAAC,cAAc,EAAC,MAAM,yBAAyB,CAAC;AAMvD,MAAM,OAAO,aAAc,SAAQ,cAAc;IAC/C;;OAEG;IACH,IAAI,CACF,MAAgC,EAChC,OAAwB;QAExB,OAAO,IAAI,CAAC,YAAY,CAAC,KAAK,EAAE,oBAAoB,EAAE,MAAM,EAAE,OAAO,EAAE;YACrE,UAAU,EAAE,MAAM;SACnB,CAAQ,CAAC;IACZ,CAAC;IACD;;OAEG;IACH,MAAM,CACJ,MAAiC,EACjC,OAAwB;QAExB,OAAO,IAAI,CAAC,YAAY,CACtB,MAAM,EACN,oBAAoB,EACpB,MAAM,EACN,OAAO,CACD,CAAC;IACX,CAAC;IACD;;OAEG;IACH,QAAQ,CACN,EAAU,EACV,MAAoC,EACpC,OAAwB;QAExB,OAAO,IAAI,CAAC,YAAY,CACtB,KAAK,EACL,sBAAsB,kBAAkB,CAAC,EAAE,CAAC,EAAE,EAC9C,MAAM,EACN,OAAO,CACD,CAAC;IACX,CAAC;IACD;;OAEG;IACH,QAAQ,CACN,EAAU,EACV,MAAoC,EACpC,OAAwB;QAExB,OAAO,IAAI,CAAC,YAAY,CACtB,MAAM,EACN,sBAAsB,kBAAkB,CAAC,EAAE,CAAC,WAAW,EACvD,MAAM,EACN,OAAO,CACD,CAAC;IACX,CAAC;IACD;;OAEG;IACH,OAAO,CACL,EAAU,EACV,MAAmC,EACnC,OAAwB;QAExB,OAAO,IAAI,CAAC,YAAY,CACtB,MAAM,EACN,sBAAsB,kBAAkB,CAAC,EAAE,CAAC,UAAU,EACtD,MAAM,EACN,OAAO,CACD,CAAC;IACX,CAAC;IACD;;OAEG;IACH,UAAU,CACR,EAAU,EACV,MAAsC,EACtC,OAAwB;QAExB,OAAO,IAAI,CAAC,YAAY,CACtB,MAAM,EACN,sBAAsB,kBAAkB,CAAC,EAAE,CAAC,aAAa,EACzD,MAAM,EACN,OAAO,CACD,CAAC;IACX,CAAC;CACF"}

View File

@@ -0,0 +1,142 @@
import { StripeResource } from '../../StripeResource.js';
import { Customer, DeletedCustomer } from './../Customers.js';
import { RequestOptions, Response } from '../../lib.js';
export declare class CreditBalanceSummaryResource extends StripeResource {
/**
* Retrieves the credit balance summary for a customer.
*/
retrieve(params: Billing.CreditBalanceSummaryRetrieveParams, options?: RequestOptions): Promise<Response<CreditBalanceSummary>>;
}
export interface CreditBalanceSummary {
/**
* String representing the object's type. Objects of the same type share the same value.
*/
object: 'billing.credit_balance_summary';
/**
* The billing credit balances. One entry per credit grant currency. If a customer only has credit grants in a single currency, then this will have a single balance entry.
*/
balances: Array<Billing.CreditBalanceSummary.Balance>;
/**
* The customer the balance is for.
*/
customer: string | Customer | DeletedCustomer;
/**
* The account the balance is for.
*/
customer_account: string | null;
/**
* If the object exists in live mode, the value is `true`. If the object exists in test mode, the value is `false`.
*/
livemode: boolean;
}
export declare namespace Billing {
namespace CreditBalanceSummary {
interface Balance {
available_balance: Balance.AvailableBalance;
ledger_balance: Balance.LedgerBalance;
}
namespace Balance {
interface AvailableBalance {
/**
* The monetary amount.
*/
monetary: AvailableBalance.Monetary | null;
/**
* The type of this amount. We currently only support `monetary` billing credits.
*/
type: 'monetary';
}
interface LedgerBalance {
/**
* The monetary amount.
*/
monetary: LedgerBalance.Monetary | null;
/**
* The type of this amount. We currently only support `monetary` billing credits.
*/
type: 'monetary';
}
namespace AvailableBalance {
interface Monetary {
/**
* Three-letter [ISO currency code](https://www.iso.org/iso-4217-currency-codes.html), in lowercase. Must be a [supported currency](https://stripe.com/docs/currencies).
*/
currency: string;
/**
* A positive integer representing the amount.
*/
value: number;
}
}
namespace LedgerBalance {
interface Monetary {
/**
* Three-letter [ISO currency code](https://www.iso.org/iso-4217-currency-codes.html), in lowercase. Must be a [supported currency](https://stripe.com/docs/currencies).
*/
currency: string;
/**
* A positive integer representing the amount.
*/
value: number;
}
}
}
}
}
export declare namespace Billing {
interface CreditBalanceSummaryRetrieveParams {
/**
* The filter criteria for the credit balance summary.
*/
filter: CreditBalanceSummaryRetrieveParams.Filter;
/**
* The customer whose credit balance summary you're retrieving.
*/
customer?: string;
/**
* The account representing the customer whose credit balance summary you're retrieving.
*/
customer_account?: string;
/**
* Specifies which fields in the response should be expanded.
*/
expand?: Array<string>;
}
namespace CreditBalanceSummaryRetrieveParams {
interface Filter {
/**
* The billing credit applicability scope for which to fetch credit balance summary.
*/
applicability_scope?: Filter.ApplicabilityScope;
/**
* The credit grant for which to fetch credit balance summary.
*/
credit_grant?: string;
/**
* Specify the type of this filter.
*/
type: Filter.Type;
}
namespace Filter {
interface ApplicabilityScope {
/**
* The price type that credit grants can apply to. We currently only support the `metered` price type. Cannot be used in combination with `prices`.
*/
price_type?: 'metered';
/**
* A list of prices that the credit grant can apply to. We currently only support the `metered` prices. Cannot be used in combination with `price_type`.
*/
prices?: Array<ApplicabilityScope.Price>;
}
type Type = 'applicability_scope' | 'credit_grant';
namespace ApplicabilityScope {
interface Price {
/**
* The price ID this credit grant should apply to.
*/
id: string;
}
}
}
}
}

View File

@@ -0,0 +1,11 @@
// File generated from our OpenAPI spec
import { StripeResource } from '../../StripeResource.js';
export class CreditBalanceSummaryResource extends StripeResource {
/**
* Retrieves the credit balance summary for a customer.
*/
retrieve(params, options) {
return this._makeRequest('GET', '/v1/billing/credit_balance_summary', params, options);
}
}
//# sourceMappingURL=CreditBalanceSummary.js.map

View File

@@ -0,0 +1 @@
{"version":3,"file":"CreditBalanceSummary.js","sourceRoot":"","sources":["../../../src/resources/Billing/CreditBalanceSummary.ts"],"names":[],"mappings":"AAAA,uCAAuC;AAEvC,OAAO,EAAC,cAAc,EAAC,MAAM,yBAAyB,CAAC;AAIvD,MAAM,OAAO,4BAA6B,SAAQ,cAAc;IAC9D;;OAEG;IACH,QAAQ,CACN,MAAkD,EAClD,OAAwB;QAExB,OAAO,IAAI,CAAC,YAAY,CACtB,KAAK,EACL,oCAAoC,EACpC,MAAM,EACN,OAAO,CACD,CAAC;IACX,CAAC;CACF"}

View File

@@ -0,0 +1,183 @@
import { StripeResource } from '../../StripeResource.js';
import { CreditGrant } from './CreditGrants.js';
import { Invoice } from './../Invoices.js';
import * as TestHelpers from './../TestHelpers/index.js';
import { PaginationParams } from '../../shared.js';
import { RequestOptions, ApiListPromise, Response } from '../../lib.js';
export declare class CreditBalanceTransactionResource extends StripeResource {
/**
* Retrieve a list of credit balance transactions.
*/
list(params?: Billing.CreditBalanceTransactionListParams, options?: RequestOptions): ApiListPromise<CreditBalanceTransaction>;
/**
* Retrieves a credit balance transaction.
*/
retrieve(id: string, params?: Billing.CreditBalanceTransactionRetrieveParams, options?: RequestOptions): Promise<Response<CreditBalanceTransaction>>;
}
export interface CreditBalanceTransaction {
/**
* Unique identifier for the object.
*/
id: string;
/**
* String representing the object's type. Objects of the same type share the same value.
*/
object: 'billing.credit_balance_transaction';
/**
* Time at which the object was created. Measured in seconds since the Unix epoch.
*/
created: number;
/**
* Credit details for this credit balance transaction. Only present if type is `credit`.
*/
credit: Billing.CreditBalanceTransaction.Credit | null;
/**
* The credit grant associated with this credit balance transaction.
*/
credit_grant: string | CreditGrant;
/**
* Debit details for this credit balance transaction. Only present if type is `debit`.
*/
debit: Billing.CreditBalanceTransaction.Debit | null;
/**
* The effective time of this credit balance transaction.
*/
effective_at: number;
/**
* If the object exists in live mode, the value is `true`. If the object exists in test mode, the value is `false`.
*/
livemode: boolean;
/**
* ID of the test clock this credit balance transaction belongs to.
*/
test_clock: string | TestHelpers.TestClock | null;
/**
* The type of credit balance transaction (credit or debit).
*/
type: Billing.CreditBalanceTransaction.Type | null;
}
export declare namespace Billing {
namespace CreditBalanceTransaction {
interface Credit {
amount: Credit.Amount;
/**
* Details of the invoice to which the reinstated credits were originally applied. Only present if `type` is `credits_application_invoice_voided`.
*/
credits_application_invoice_voided: Credit.CreditsApplicationInvoiceVoided | null;
/**
* The type of credit transaction.
*/
type: Credit.Type;
}
interface Debit {
amount: Debit.Amount;
/**
* Details of how the billing credits were applied to an invoice. Only present if `type` is `credits_applied`.
*/
credits_applied: Debit.CreditsApplied | null;
/**
* The type of debit transaction.
*/
type: Debit.Type;
}
type Type = 'credit' | 'debit';
namespace Credit {
interface Amount {
/**
* The monetary amount.
*/
monetary: Amount.Monetary | null;
/**
* The type of this amount. We currently only support `monetary` billing credits.
*/
type: 'monetary';
}
interface CreditsApplicationInvoiceVoided {
/**
* The invoice to which the reinstated billing credits were originally applied.
*/
invoice: string | Invoice;
/**
* The invoice line item to which the reinstated billing credits were originally applied.
*/
invoice_line_item: string;
}
type Type = 'credits_application_invoice_voided' | 'credits_granted';
namespace Amount {
interface Monetary {
/**
* Three-letter [ISO currency code](https://www.iso.org/iso-4217-currency-codes.html), in lowercase. Must be a [supported currency](https://stripe.com/docs/currencies).
*/
currency: string;
/**
* A positive integer representing the amount.
*/
value: number;
}
}
}
namespace Debit {
interface Amount {
/**
* The monetary amount.
*/
monetary: Amount.Monetary | null;
/**
* The type of this amount. We currently only support `monetary` billing credits.
*/
type: 'monetary';
}
interface CreditsApplied {
/**
* The invoice to which the billing credits were applied.
*/
invoice: string | Invoice;
/**
* The invoice line item to which the billing credits were applied.
*/
invoice_line_item: string;
}
type Type = 'credits_applied' | 'credits_expired' | 'credits_voided';
namespace Amount {
interface Monetary {
/**
* Three-letter [ISO currency code](https://www.iso.org/iso-4217-currency-codes.html), in lowercase. Must be a [supported currency](https://stripe.com/docs/currencies).
*/
currency: string;
/**
* A positive integer representing the amount.
*/
value: number;
}
}
}
}
}
export declare namespace Billing {
interface CreditBalanceTransactionRetrieveParams {
/**
* Specifies which fields in the response should be expanded.
*/
expand?: Array<string>;
}
}
export declare namespace Billing {
interface CreditBalanceTransactionListParams extends PaginationParams {
/**
* The credit grant for which to fetch credit balance transactions.
*/
credit_grant?: string;
/**
* The customer whose credit balance transactions you're retrieving.
*/
customer?: string;
/**
* The account representing the customer whose credit balance transactions you're retrieving.
*/
customer_account?: string;
/**
* Specifies which fields in the response should be expanded.
*/
expand?: Array<string>;
}
}

View File

@@ -0,0 +1,19 @@
// File generated from our OpenAPI spec
import { StripeResource } from '../../StripeResource.js';
export class CreditBalanceTransactionResource extends StripeResource {
/**
* Retrieve a list of credit balance transactions.
*/
list(params, options) {
return this._makeRequest('GET', '/v1/billing/credit_balance_transactions', params, options, {
methodType: 'list',
});
}
/**
* Retrieves a credit balance transaction.
*/
retrieve(id, params, options) {
return this._makeRequest('GET', `/v1/billing/credit_balance_transactions/${encodeURIComponent(id)}`, params, options);
}
}
//# sourceMappingURL=CreditBalanceTransactions.js.map

View File

@@ -0,0 +1 @@
{"version":3,"file":"CreditBalanceTransactions.js","sourceRoot":"","sources":["../../../src/resources/Billing/CreditBalanceTransactions.ts"],"names":[],"mappings":"AAAA,uCAAuC;AAEvC,OAAO,EAAC,cAAc,EAAC,MAAM,yBAAyB,CAAC;AAOvD,MAAM,OAAO,gCAAiC,SAAQ,cAAc;IAClE;;OAEG;IACH,IAAI,CACF,MAAmD,EACnD,OAAwB;QAExB,OAAO,IAAI,CAAC,YAAY,CACtB,KAAK,EACL,yCAAyC,EACzC,MAAM,EACN,OAAO,EACP;YACE,UAAU,EAAE,MAAM;SACnB,CACK,CAAC;IACX,CAAC;IACD;;OAEG;IACH,QAAQ,CACN,EAAU,EACV,MAAuD,EACvD,OAAwB;QAExB,OAAO,IAAI,CAAC,YAAY,CACtB,KAAK,EACL,2CAA2C,kBAAkB,CAAC,EAAE,CAAC,EAAE,EACnE,MAAM,EACN,OAAO,CACD,CAAC;IACX,CAAC;CACF"}

View File

@@ -0,0 +1,300 @@
import { StripeResource } from '../../StripeResource.js';
import { Customer, DeletedCustomer } from './../Customers.js';
import * as TestHelpers from './../TestHelpers/index.js';
import { MetadataParam, Emptyable, PaginationParams, Metadata } from '../../shared.js';
import { RequestOptions, ApiListPromise, Response } from '../../lib.js';
export declare class CreditGrantResource extends StripeResource {
/**
* Retrieve a list of credit grants.
*/
list(params?: Billing.CreditGrantListParams, options?: RequestOptions): ApiListPromise<CreditGrant>;
/**
* Creates a credit grant.
*/
create(params: Billing.CreditGrantCreateParams, options?: RequestOptions): Promise<Response<CreditGrant>>;
/**
* Retrieves a credit grant.
*/
retrieve(id: string, params?: Billing.CreditGrantRetrieveParams, options?: RequestOptions): Promise<Response<CreditGrant>>;
/**
* Updates a credit grant.
*/
update(id: string, params?: Billing.CreditGrantUpdateParams, options?: RequestOptions): Promise<Response<CreditGrant>>;
/**
* Expires a credit grant.
*/
expire(id: string, params?: Billing.CreditGrantExpireParams, options?: RequestOptions): Promise<Response<CreditGrant>>;
/**
* Voids a credit grant.
*/
voidGrant(id: string, params?: Billing.CreditGrantVoidGrantParams, options?: RequestOptions): Promise<Response<CreditGrant>>;
}
export interface CreditGrant {
/**
* Unique identifier for the object.
*/
id: string;
/**
* String representing the object's type. Objects of the same type share the same value.
*/
object: 'billing.credit_grant';
amount: Billing.CreditGrant.Amount;
applicability_config: Billing.CreditGrant.ApplicabilityConfig;
/**
* The category of this credit grant. This is for tracking purposes and isn't displayed to the customer.
*/
category: Billing.CreditGrant.Category;
/**
* Time at which the object was created. Measured in seconds since the Unix epoch.
*/
created: number;
/**
* ID of the customer receiving the billing credits.
*/
customer: string | Customer | DeletedCustomer;
/**
* ID of the account representing the customer receiving the billing credits
*/
customer_account: string | null;
/**
* The time when the billing credits become effective-when they're eligible for use.
*/
effective_at: number | null;
/**
* The time when the billing credits expire. If not present, the billing credits don't expire.
*/
expires_at: number | null;
/**
* If the object exists in live mode, the value is `true`. If the object exists in test mode, the value is `false`.
*/
livemode: boolean;
/**
* Set of [key-value pairs](https://docs.stripe.com/api/metadata) that you can attach to an object. This can be useful for storing additional information about the object in a structured format.
*/
metadata: Metadata;
/**
* A descriptive name shown in dashboard.
*/
name: string | null;
/**
* The priority for applying this credit grant. The highest priority is 0 and the lowest is 100.
*/
priority?: number | null;
/**
* ID of the test clock this credit grant belongs to.
*/
test_clock: string | TestHelpers.TestClock | null;
/**
* Time at which the object was last updated. Measured in seconds since the Unix epoch.
*/
updated: number;
/**
* The time when this credit grant was voided. If not present, the credit grant hasn't been voided.
*/
voided_at: number | null;
}
export declare namespace Billing {
namespace CreditGrant {
interface Amount {
/**
* The monetary amount.
*/
monetary: Amount.Monetary | null;
/**
* The type of this amount. We currently only support `monetary` billing credits.
*/
type: 'monetary';
}
interface ApplicabilityConfig {
scope: ApplicabilityConfig.Scope;
}
type Category = 'paid' | 'promotional';
namespace Amount {
interface Monetary {
/**
* Three-letter [ISO currency code](https://www.iso.org/iso-4217-currency-codes.html), in lowercase. Must be a [supported currency](https://stripe.com/docs/currencies).
*/
currency: string;
/**
* A positive integer representing the amount.
*/
value: number;
}
}
namespace ApplicabilityConfig {
interface Scope {
/**
* The price type that credit grants can apply to. We currently only support the `metered` price type. This refers to prices that have a [Billing Meter](https://docs.stripe.com/api/billing/meter) attached to them. Cannot be used in combination with `prices`.
*/
price_type?: 'metered';
/**
* The prices that credit grants can apply to. We currently only support `metered` prices. This refers to prices that have a [Billing Meter](https://docs.stripe.com/api/billing/meter) attached to them. Cannot be used in combination with `price_type`.
*/
prices?: Array<Scope.Price>;
}
namespace Scope {
interface Price {
/**
* Unique identifier for the object.
*/
id: string | null;
}
}
}
}
}
export declare namespace Billing {
interface CreditGrantCreateParams {
/**
* Amount of this credit grant.
*/
amount: CreditGrantCreateParams.Amount;
/**
* Configuration specifying what this credit grant applies to. We currently only support `metered` prices that have a [Billing Meter](https://docs.stripe.com/api/billing/meter) attached to them.
*/
applicability_config: CreditGrantCreateParams.ApplicabilityConfig;
/**
* The category of this credit grant. It defaults to `paid` if not specified.
*/
category?: CreditGrantCreateParams.Category;
/**
* ID of the customer receiving the billing credits.
*/
customer?: string;
/**
* ID of the account representing the customer receiving the billing credits.
*/
customer_account?: string;
/**
* The time when the billing credits become effective-when they're eligible for use. It defaults to the current timestamp if not specified.
*/
effective_at?: number;
/**
* Specifies which fields in the response should be expanded.
*/
expand?: Array<string>;
/**
* The time when the billing credits expire. If not specified, the billing credits don't expire.
*/
expires_at?: number;
/**
* Set of key-value pairs that you can attach to an object. You can use this to store additional information about the object (for example, cost basis) in a structured format.
*/
metadata?: MetadataParam;
/**
* A descriptive name shown in the Dashboard.
*/
name?: string;
/**
* The desired priority for applying this credit grant. If not specified, it will be set to the default value of 50. The highest priority is 0 and the lowest is 100.
*/
priority?: number;
}
namespace CreditGrantCreateParams {
interface Amount {
/**
* The monetary amount.
*/
monetary?: Amount.Monetary;
/**
* The type of this amount. We currently only support `monetary` billing credits.
*/
type: 'monetary';
}
interface ApplicabilityConfig {
/**
* Specify the scope of this applicability config.
*/
scope: ApplicabilityConfig.Scope;
}
type Category = 'paid' | 'promotional';
namespace Amount {
interface Monetary {
/**
* Three-letter [ISO code for the currency](https://stripe.com/docs/currencies) of the `value` parameter.
*/
currency: string;
/**
* A positive integer representing the amount of the credit grant.
*/
value: number;
}
}
namespace ApplicabilityConfig {
interface Scope {
/**
* The price type that credit grants can apply to. We currently only support the `metered` price type. Cannot be used in combination with `prices`.
*/
price_type?: 'metered';
/**
* A list of prices that the credit grant can apply to. We currently only support the `metered` prices. Cannot be used in combination with `price_type`.
*/
prices?: Array<Scope.Price>;
}
namespace Scope {
interface Price {
/**
* The price ID this credit grant should apply to.
*/
id: string;
}
}
}
}
}
export declare namespace Billing {
interface CreditGrantRetrieveParams {
/**
* Specifies which fields in the response should be expanded.
*/
expand?: Array<string>;
}
}
export declare namespace Billing {
interface CreditGrantUpdateParams {
/**
* Specifies which fields in the response should be expanded.
*/
expand?: Array<string>;
/**
* The time when the billing credits created by this credit grant expire. If set to empty, the billing credits never expire.
*/
expires_at?: Emptyable<number>;
/**
* Set of key-value pairs you can attach to an object. You can use this to store additional information about the object (for example, cost basis) in a structured format.
*/
metadata?: MetadataParam;
}
}
export declare namespace Billing {
interface CreditGrantListParams extends PaginationParams {
/**
* Only return credit grants for this customer.
*/
customer?: string;
/**
* Only return credit grants for this account representing the customer.
*/
customer_account?: string;
/**
* Specifies which fields in the response should be expanded.
*/
expand?: Array<string>;
}
}
export declare namespace Billing {
interface CreditGrantExpireParams {
/**
* Specifies which fields in the response should be expanded.
*/
expand?: Array<string>;
}
}
export declare namespace Billing {
interface CreditGrantVoidGrantParams {
/**
* Specifies which fields in the response should be expanded.
*/
expand?: Array<string>;
}
}

View File

@@ -0,0 +1,43 @@
// File generated from our OpenAPI spec
import { StripeResource } from '../../StripeResource.js';
export class CreditGrantResource extends StripeResource {
/**
* Retrieve a list of credit grants.
*/
list(params, options) {
return this._makeRequest('GET', '/v1/billing/credit_grants', params, options, {
methodType: 'list',
});
}
/**
* Creates a credit grant.
*/
create(params, options) {
return this._makeRequest('POST', '/v1/billing/credit_grants', params, options);
}
/**
* Retrieves a credit grant.
*/
retrieve(id, params, options) {
return this._makeRequest('GET', `/v1/billing/credit_grants/${encodeURIComponent(id)}`, params, options);
}
/**
* Updates a credit grant.
*/
update(id, params, options) {
return this._makeRequest('POST', `/v1/billing/credit_grants/${encodeURIComponent(id)}`, params, options);
}
/**
* Expires a credit grant.
*/
expire(id, params, options) {
return this._makeRequest('POST', `/v1/billing/credit_grants/${encodeURIComponent(id)}/expire`, params, options);
}
/**
* Voids a credit grant.
*/
voidGrant(id, params, options) {
return this._makeRequest('POST', `/v1/billing/credit_grants/${encodeURIComponent(id)}/void`, params, options);
}
}
//# sourceMappingURL=CreditGrants.js.map

View File

@@ -0,0 +1 @@
{"version":3,"file":"CreditGrants.js","sourceRoot":"","sources":["../../../src/resources/Billing/CreditGrants.ts"],"names":[],"mappings":"AAAA,uCAAuC;AAEvC,OAAO,EAAC,cAAc,EAAC,MAAM,yBAAyB,CAAC;AAWvD,MAAM,OAAO,mBAAoB,SAAQ,cAAc;IACrD;;OAEG;IACH,IAAI,CACF,MAAsC,EACtC,OAAwB;QAExB,OAAO,IAAI,CAAC,YAAY,CACtB,KAAK,EACL,2BAA2B,EAC3B,MAAM,EACN,OAAO,EACP;YACE,UAAU,EAAE,MAAM;SACnB,CACK,CAAC;IACX,CAAC;IACD;;OAEG;IACH,MAAM,CACJ,MAAuC,EACvC,OAAwB;QAExB,OAAO,IAAI,CAAC,YAAY,CACtB,MAAM,EACN,2BAA2B,EAC3B,MAAM,EACN,OAAO,CACD,CAAC;IACX,CAAC;IACD;;OAEG;IACH,QAAQ,CACN,EAAU,EACV,MAA0C,EAC1C,OAAwB;QAExB,OAAO,IAAI,CAAC,YAAY,CACtB,KAAK,EACL,6BAA6B,kBAAkB,CAAC,EAAE,CAAC,EAAE,EACrD,MAAM,EACN,OAAO,CACD,CAAC;IACX,CAAC;IACD;;OAEG;IACH,MAAM,CACJ,EAAU,EACV,MAAwC,EACxC,OAAwB;QAExB,OAAO,IAAI,CAAC,YAAY,CACtB,MAAM,EACN,6BAA6B,kBAAkB,CAAC,EAAE,CAAC,EAAE,EACrD,MAAM,EACN,OAAO,CACD,CAAC;IACX,CAAC;IACD;;OAEG;IACH,MAAM,CACJ,EAAU,EACV,MAAwC,EACxC,OAAwB;QAExB,OAAO,IAAI,CAAC,YAAY,CACtB,MAAM,EACN,6BAA6B,kBAAkB,CAAC,EAAE,CAAC,SAAS,EAC5D,MAAM,EACN,OAAO,CACD,CAAC;IACX,CAAC;IACD;;OAEG;IACH,SAAS,CACP,EAAU,EACV,MAA2C,EAC3C,OAAwB;QAExB,OAAO,IAAI,CAAC,YAAY,CACtB,MAAM,EACN,6BAA6B,kBAAkB,CAAC,EAAE,CAAC,OAAO,EAC1D,MAAM,EACN,OAAO,CACD,CAAC;IACX,CAAC;CACF"}

View File

@@ -0,0 +1,73 @@
import { StripeResource } from '../../StripeResource.js';
import { RequestOptions, Response } from '../../lib.js';
export declare class MeterEventAdjustmentResource extends StripeResource {
/**
* Creates a billing meter event adjustment.
*/
create(params: Billing.MeterEventAdjustmentCreateParams, options?: RequestOptions): Promise<Response<MeterEventAdjustment>>;
}
export interface MeterEventAdjustment {
/**
* String representing the object's type. Objects of the same type share the same value.
*/
object: 'billing.meter_event_adjustment';
/**
* Specifies which event to cancel.
*/
cancel: Billing.MeterEventAdjustment.Cancel | null;
/**
* The name of the meter event. Corresponds with the `event_name` field on a meter.
*/
event_name: string;
/**
* If the object exists in live mode, the value is `true`. If the object exists in test mode, the value is `false`.
*/
livemode: boolean;
/**
* The meter event adjustment's status.
*/
status: Billing.MeterEventAdjustment.Status;
/**
* Specifies whether to cancel a single event or a range of events for a time period. Time period cancellation is not supported yet.
*/
type: 'cancel';
}
export declare namespace Billing {
namespace MeterEventAdjustment {
interface Cancel {
/**
* Unique identifier for the event.
*/
identifier: string | null;
}
type Status = 'complete' | 'pending';
}
}
export declare namespace Billing {
interface MeterEventAdjustmentCreateParams {
/**
* The name of the meter event. Corresponds with the `event_name` field on a meter.
*/
event_name: string;
/**
* Specifies whether to cancel a single event or a range of events for a time period. Time period cancellation is not supported yet.
*/
type: 'cancel';
/**
* Specifies which event to cancel.
*/
cancel?: MeterEventAdjustmentCreateParams.Cancel;
/**
* Specifies which fields in the response should be expanded.
*/
expand?: Array<string>;
}
namespace MeterEventAdjustmentCreateParams {
interface Cancel {
/**
* Unique identifier for the event. You can only cancel events within 24 hours of Stripe receiving them.
*/
identifier?: string;
}
}
}

View File

@@ -0,0 +1,11 @@
// File generated from our OpenAPI spec
import { StripeResource } from '../../StripeResource.js';
export class MeterEventAdjustmentResource extends StripeResource {
/**
* Creates a billing meter event adjustment.
*/
create(params, options) {
return this._makeRequest('POST', '/v1/billing/meter_event_adjustments', params, options);
}
}
//# sourceMappingURL=MeterEventAdjustments.js.map

View File

@@ -0,0 +1 @@
{"version":3,"file":"MeterEventAdjustments.js","sourceRoot":"","sources":["../../../src/resources/Billing/MeterEventAdjustments.ts"],"names":[],"mappings":"AAAA,uCAAuC;AAEvC,OAAO,EAAC,cAAc,EAAC,MAAM,yBAAyB,CAAC;AAGvD,MAAM,OAAO,4BAA6B,SAAQ,cAAc;IAC9D;;OAEG;IACH,MAAM,CACJ,MAAgD,EAChD,OAAwB;QAExB,OAAO,IAAI,CAAC,YAAY,CACtB,MAAM,EACN,qCAAqC,EACrC,MAAM,EACN,OAAO,CACD,CAAC;IACX,CAAC;CACF"}

View File

@@ -0,0 +1,30 @@
export interface MeterEventSummary {
/**
* Unique identifier for the object.
*/
id: string;
/**
* String representing the object's type. Objects of the same type share the same value.
*/
object: 'billing.meter_event_summary';
/**
* Aggregated value of all the events within `start_time` (inclusive) and `end_time` (inclusive). The aggregation strategy is defined on meter via `default_aggregation`.
*/
aggregated_value: number;
/**
* End timestamp for this event summary (exclusive). Must be aligned with minute boundaries.
*/
end_time: number;
/**
* If the object exists in live mode, the value is `true`. If the object exists in test mode, the value is `false`.
*/
livemode: boolean;
/**
* The meter associated with this event summary.
*/
meter: string;
/**
* Start timestamp for this event summary (inclusive). Must be aligned with minute boundaries.
*/
start_time: number;
}

View File

@@ -0,0 +1,3 @@
// File generated from our OpenAPI spec
export {};
//# sourceMappingURL=MeterEventSummaries.js.map

View File

@@ -0,0 +1 @@
{"version":3,"file":"MeterEventSummaries.js","sourceRoot":"","sources":["../../../src/resources/Billing/MeterEventSummaries.ts"],"names":[],"mappings":"AAAA,uCAAuC"}

View File

@@ -0,0 +1,66 @@
import { StripeResource } from '../../StripeResource.js';
import { RequestOptions, Response } from '../../lib.js';
export declare class MeterEventResource extends StripeResource {
/**
* Creates a billing meter event.
*/
create(params: Billing.MeterEventCreateParams, options?: RequestOptions): Promise<Response<MeterEvent>>;
}
export interface MeterEvent {
/**
* String representing the object's type. Objects of the same type share the same value.
*/
object: 'billing.meter_event';
/**
* Time at which the object was created. Measured in seconds since the Unix epoch.
*/
created: number;
/**
* The name of the meter event. Corresponds with the `event_name` field on a meter.
*/
event_name: string;
/**
* A unique identifier for the event.
*/
identifier: string;
/**
* If the object exists in live mode, the value is `true`. If the object exists in test mode, the value is `false`.
*/
livemode: boolean;
/**
* The payload of the event. This contains the fields corresponding to a meter's `customer_mapping.event_payload_key` (default is `stripe_customer_id`) and `value_settings.event_payload_key` (default is `value`). Read more about the [payload](https://docs.stripe.com/billing/subscriptions/usage-based/meters/configure#meter-configuration-attributes).
*/
payload: {
[key: string]: string;
};
/**
* The timestamp passed in when creating the event. Measured in seconds since the Unix epoch.
*/
timestamp: number;
}
export declare namespace Billing {
interface MeterEventCreateParams {
/**
* The name of the meter event. Corresponds with the `event_name` field on a meter.
*/
event_name: string;
/**
* The payload of the event. This must contain the fields corresponding to a meter's `customer_mapping.event_payload_key` (default is `stripe_customer_id`) and `value_settings.event_payload_key` (default is `value`). Read more about the [payload](https://docs.stripe.com/billing/subscriptions/usage-based/meters/configure#meter-configuration-attributes).
*/
payload: {
[key: string]: string;
};
/**
* Specifies which fields in the response should be expanded.
*/
expand?: Array<string>;
/**
* A unique identifier for the event. If not provided, one is generated. We recommend using UUID-like identifiers. Stripe enforces uniqueness within a rolling period of at least 24 hours. The enforcement of uniqueness primarily addresses issues arising from accidental retries or other problems occurring within extremely brief time intervals. This approach helps prevent duplicate entries and ensures data integrity in high-frequency operations.
*/
identifier?: string;
/**
* The time of the event. Measured in seconds since the Unix epoch. Must be within the past 35 calendar days or up to 5 minutes in the future. Defaults to current timestamp if not specified.
*/
timestamp?: number;
}
}

View File

@@ -0,0 +1,11 @@
// File generated from our OpenAPI spec
import { StripeResource } from '../../StripeResource.js';
export class MeterEventResource extends StripeResource {
/**
* Creates a billing meter event.
*/
create(params, options) {
return this._makeRequest('POST', '/v1/billing/meter_events', params, options);
}
}
//# sourceMappingURL=MeterEvents.js.map

View File

@@ -0,0 +1 @@
{"version":3,"file":"MeterEvents.js","sourceRoot":"","sources":["../../../src/resources/Billing/MeterEvents.ts"],"names":[],"mappings":"AAAA,uCAAuC;AAEvC,OAAO,EAAC,cAAc,EAAC,MAAM,yBAAyB,CAAC;AAGvD,MAAM,OAAO,kBAAmB,SAAQ,cAAc;IACpD;;OAEG;IACH,MAAM,CACJ,MAAsC,EACtC,OAAwB;QAExB,OAAO,IAAI,CAAC,YAAY,CACtB,MAAM,EACN,0BAA0B,EAC1B,MAAM,EACN,OAAO,CACD,CAAC;IACX,CAAC;CACF"}

251
node_modules/stripe/esm/resources/Billing/Meters.d.ts generated vendored Normal file
View File

@@ -0,0 +1,251 @@
import { StripeResource } from '../../StripeResource.js';
import { MeterEventSummary } from './MeterEventSummaries.js';
import { PaginationParams } from '../../shared.js';
import { RequestOptions, ApiListPromise, Response } from '../../lib.js';
export declare class MeterResource extends StripeResource {
/**
* Retrieve a list of billing meters.
*/
list(params?: Billing.MeterListParams, options?: RequestOptions): ApiListPromise<Meter>;
/**
* Creates a billing meter.
*/
create(params: Billing.MeterCreateParams, options?: RequestOptions): Promise<Response<Meter>>;
/**
* Retrieves a billing meter given an ID.
*/
retrieve(id: string, params?: Billing.MeterRetrieveParams, options?: RequestOptions): Promise<Response<Meter>>;
/**
* Updates a billing meter.
*/
update(id: string, params?: Billing.MeterUpdateParams, options?: RequestOptions): Promise<Response<Meter>>;
/**
* When a meter is deactivated, no more meter events will be accepted for this meter. You can't attach a deactivated meter to a price.
*/
deactivate(id: string, params?: Billing.MeterDeactivateParams, options?: RequestOptions): Promise<Response<Meter>>;
/**
* When a meter is reactivated, events for this meter can be accepted and you can attach the meter to a price.
*/
reactivate(id: string, params?: Billing.MeterReactivateParams, options?: RequestOptions): Promise<Response<Meter>>;
/**
* Retrieve a list of billing meter event summaries.
*/
listEventSummaries(id: string, params: Billing.MeterListEventSummariesParams, options?: RequestOptions): ApiListPromise<MeterEventSummary>;
}
export interface Meter {
/**
* Unique identifier for the object.
*/
id: string;
/**
* String representing the object's type. Objects of the same type share the same value.
*/
object: 'billing.meter';
/**
* Time at which the object was created. Measured in seconds since the Unix epoch.
*/
created: number;
customer_mapping: Billing.Meter.CustomerMapping;
default_aggregation: Billing.Meter.DefaultAggregation;
/**
* The meter's name.
*/
display_name: string;
/**
* The name of the meter event to record usage for. Corresponds with the `event_name` field on meter events.
*/
event_name: string;
/**
* The time window which meter events have been pre-aggregated for, if any.
*/
event_time_window: Billing.Meter.EventTimeWindow | null;
/**
* If the object exists in live mode, the value is `true`. If the object exists in test mode, the value is `false`.
*/
livemode: boolean;
/**
* The meter's status.
*/
status: Billing.Meter.Status;
status_transitions: Billing.Meter.StatusTransitions;
/**
* Time at which the object was last updated. Measured in seconds since the Unix epoch.
*/
updated: number;
value_settings: Billing.Meter.ValueSettings;
}
export declare namespace Billing {
namespace Meter {
interface CustomerMapping {
/**
* The key in the meter event payload to use for mapping the event to a customer.
*/
event_payload_key: string;
/**
* The method for mapping a meter event to a customer.
*/
type: 'by_id';
}
interface DefaultAggregation {
/**
* Specifies how events are aggregated.
*/
formula: DefaultAggregation.Formula;
}
type EventTimeWindow = 'day' | 'hour';
type Status = 'active' | 'inactive';
interface StatusTransitions {
/**
* The time the meter was deactivated, if any. Measured in seconds since Unix epoch.
*/
deactivated_at: number | null;
}
interface ValueSettings {
/**
* The key in the meter event payload to use as the value for this meter.
*/
event_payload_key: string;
}
namespace DefaultAggregation {
type Formula = 'count' | 'last' | 'sum';
}
}
}
export declare namespace Billing {
interface MeterCreateParams {
/**
* The default settings to aggregate a meter's events with.
*/
default_aggregation: MeterCreateParams.DefaultAggregation;
/**
* The meter's name. Not visible to the customer.
*/
display_name: string;
/**
* The name of the meter event to record usage for. Corresponds with the `event_name` field on meter events.
*/
event_name: string;
/**
* Fields that specify how to map a meter event to a customer.
*/
customer_mapping?: MeterCreateParams.CustomerMapping;
/**
* The time window which meter events have been pre-aggregated for, if any.
*/
event_time_window?: MeterCreateParams.EventTimeWindow;
/**
* Specifies which fields in the response should be expanded.
*/
expand?: Array<string>;
/**
* Fields that specify how to calculate a meter event's value.
*/
value_settings?: MeterCreateParams.ValueSettings;
}
namespace MeterCreateParams {
interface DefaultAggregation {
/**
* Specifies how events are aggregated.
*/
formula: DefaultAggregation.Formula;
}
interface CustomerMapping {
/**
* The key in the meter event payload to use for mapping the event to a customer.
*/
event_payload_key: string;
/**
* The method for mapping a meter event to a customer. Must be `by_id`.
*/
type: 'by_id';
}
type EventTimeWindow = 'day' | 'hour';
interface ValueSettings {
/**
* The key in the usage event payload to use as the value for this meter. For example, if the event payload contains usage on a `bytes_used` field, then set the event_payload_key to "bytes_used".
*/
event_payload_key: string;
}
namespace DefaultAggregation {
type Formula = 'count' | 'last' | 'sum';
}
}
}
export declare namespace Billing {
interface MeterRetrieveParams {
/**
* Specifies which fields in the response should be expanded.
*/
expand?: Array<string>;
}
}
export declare namespace Billing {
interface MeterUpdateParams {
/**
* The meter's name. Not visible to the customer.
*/
display_name?: string;
/**
* Specifies which fields in the response should be expanded.
*/
expand?: Array<string>;
}
}
export declare namespace Billing {
interface MeterListParams extends PaginationParams {
/**
* Specifies which fields in the response should be expanded.
*/
expand?: Array<string>;
/**
* Filter results to only include meters with the given status.
*/
status?: MeterListParams.Status;
}
namespace MeterListParams {
type Status = 'active' | 'inactive';
}
}
export declare namespace Billing {
interface MeterDeactivateParams {
/**
* Specifies which fields in the response should be expanded.
*/
expand?: Array<string>;
}
}
export declare namespace Billing {
interface MeterListEventSummariesParams extends PaginationParams {
/**
* The customer for which to fetch event summaries.
*/
customer: string;
/**
* The timestamp from when to stop aggregating meter events (exclusive). Must be aligned with minute boundaries.
*/
end_time: number;
/**
* The timestamp from when to start aggregating meter events (inclusive). Must be aligned with minute boundaries.
*/
start_time: number;
/**
* Specifies which fields in the response should be expanded.
*/
expand?: Array<string>;
/**
* Specifies what granularity to use when generating event summaries. If not specified, a single event summary would be returned for the specified time range. For hourly granularity, start and end times must align with hour boundaries (e.g., 00:00, 01:00, ..., 23:00). For daily granularity, start and end times must align with UTC day boundaries (00:00 UTC).
*/
value_grouping_window?: MeterListEventSummariesParams.ValueGroupingWindow;
}
namespace MeterListEventSummariesParams {
type ValueGroupingWindow = 'day' | 'hour';
}
}
export declare namespace Billing {
interface MeterReactivateParams {
/**
* Specifies which fields in the response should be expanded.
*/
expand?: Array<string>;
}
}

51
node_modules/stripe/esm/resources/Billing/Meters.js generated vendored Normal file
View File

@@ -0,0 +1,51 @@
// File generated from our OpenAPI spec
import { StripeResource } from '../../StripeResource.js';
export class MeterResource extends StripeResource {
/**
* Retrieve a list of billing meters.
*/
list(params, options) {
return this._makeRequest('GET', '/v1/billing/meters', params, options, {
methodType: 'list',
});
}
/**
* Creates a billing meter.
*/
create(params, options) {
return this._makeRequest('POST', '/v1/billing/meters', params, options);
}
/**
* Retrieves a billing meter given an ID.
*/
retrieve(id, params, options) {
return this._makeRequest('GET', `/v1/billing/meters/${encodeURIComponent(id)}`, params, options);
}
/**
* Updates a billing meter.
*/
update(id, params, options) {
return this._makeRequest('POST', `/v1/billing/meters/${encodeURIComponent(id)}`, params, options);
}
/**
* When a meter is deactivated, no more meter events will be accepted for this meter. You can't attach a deactivated meter to a price.
*/
deactivate(id, params, options) {
return this._makeRequest('POST', `/v1/billing/meters/${encodeURIComponent(id)}/deactivate`, params, options);
}
/**
* When a meter is reactivated, events for this meter can be accepted and you can attach the meter to a price.
*/
reactivate(id, params, options) {
return this._makeRequest('POST', `/v1/billing/meters/${encodeURIComponent(id)}/reactivate`, params, options);
}
/**
* Retrieve a list of billing meter event summaries.
*/
listEventSummaries(id, params, options) {
return this._makeRequest('GET', `/v1/billing/meters/${encodeURIComponent(id)}/event_summaries`, params, options, {
methodType: 'list',
});
}
}
//# sourceMappingURL=Meters.js.map

View File

@@ -0,0 +1 @@
{"version":3,"file":"Meters.js","sourceRoot":"","sources":["../../../src/resources/Billing/Meters.ts"],"names":[],"mappings":"AAAA,uCAAuC;AAEvC,OAAO,EAAC,cAAc,EAAC,MAAM,yBAAyB,CAAC;AAKvD,MAAM,OAAO,aAAc,SAAQ,cAAc;IAC/C;;OAEG;IACH,IAAI,CACF,MAAgC,EAChC,OAAwB;QAExB,OAAO,IAAI,CAAC,YAAY,CAAC,KAAK,EAAE,oBAAoB,EAAE,MAAM,EAAE,OAAO,EAAE;YACrE,UAAU,EAAE,MAAM;SACnB,CAAQ,CAAC;IACZ,CAAC;IACD;;OAEG;IACH,MAAM,CACJ,MAAiC,EACjC,OAAwB;QAExB,OAAO,IAAI,CAAC,YAAY,CACtB,MAAM,EACN,oBAAoB,EACpB,MAAM,EACN,OAAO,CACD,CAAC;IACX,CAAC;IACD;;OAEG;IACH,QAAQ,CACN,EAAU,EACV,MAAoC,EACpC,OAAwB;QAExB,OAAO,IAAI,CAAC,YAAY,CACtB,KAAK,EACL,sBAAsB,kBAAkB,CAAC,EAAE,CAAC,EAAE,EAC9C,MAAM,EACN,OAAO,CACD,CAAC;IACX,CAAC;IACD;;OAEG;IACH,MAAM,CACJ,EAAU,EACV,MAAkC,EAClC,OAAwB;QAExB,OAAO,IAAI,CAAC,YAAY,CACtB,MAAM,EACN,sBAAsB,kBAAkB,CAAC,EAAE,CAAC,EAAE,EAC9C,MAAM,EACN,OAAO,CACD,CAAC;IACX,CAAC;IACD;;OAEG;IACH,UAAU,CACR,EAAU,EACV,MAAsC,EACtC,OAAwB;QAExB,OAAO,IAAI,CAAC,YAAY,CACtB,MAAM,EACN,sBAAsB,kBAAkB,CAAC,EAAE,CAAC,aAAa,EACzD,MAAM,EACN,OAAO,CACD,CAAC;IACX,CAAC;IACD;;OAEG;IACH,UAAU,CACR,EAAU,EACV,MAAsC,EACtC,OAAwB;QAExB,OAAO,IAAI,CAAC,YAAY,CACtB,MAAM,EACN,sBAAsB,kBAAkB,CAAC,EAAE,CAAC,aAAa,EACzD,MAAM,EACN,OAAO,CACD,CAAC;IACX,CAAC;IACD;;OAEG;IACH,kBAAkB,CAChB,EAAU,EACV,MAA6C,EAC7C,OAAwB;QAExB,OAAO,IAAI,CAAC,YAAY,CACtB,KAAK,EACL,sBAAsB,kBAAkB,CAAC,EAAE,CAAC,kBAAkB,EAC9D,MAAM,EACN,OAAO,EACP;YACE,UAAU,EAAE,MAAM;SACnB,CACK,CAAC;IACX,CAAC;CACF"}

65
node_modules/stripe/esm/resources/Billing/index.d.ts generated vendored Normal file
View File

@@ -0,0 +1,65 @@
import { Stripe } from '../../stripe.core.js';
import { Billing as BillingNamespace0, Alert, AlertResource } from './Alerts.js';
import { Billing as BillingNamespace1, CreditBalanceSummary, CreditBalanceSummaryResource } from './CreditBalanceSummary.js';
import { Billing as BillingNamespace2, CreditBalanceTransaction, CreditBalanceTransactionResource } from './CreditBalanceTransactions.js';
import { Billing as BillingNamespace3, CreditGrant, CreditGrantResource } from './CreditGrants.js';
import { Billing as BillingNamespace4, Meter, MeterResource } from './Meters.js';
import { Billing as BillingNamespace5, MeterEvent, MeterEventResource } from './MeterEvents.js';
import { Billing as BillingNamespace6, MeterEventAdjustment, MeterEventAdjustmentResource } from './MeterEventAdjustments.js';
import { AlertTriggered } from './AlertTriggereds.js';
import { MeterEventSummary } from './MeterEventSummaries.js';
export { Alert } from './Alerts.js';
export { CreditBalanceSummary } from './CreditBalanceSummary.js';
export { CreditBalanceTransaction } from './CreditBalanceTransactions.js';
export { CreditGrant } from './CreditGrants.js';
export { Meter } from './Meters.js';
export { MeterEvent } from './MeterEvents.js';
export { MeterEventAdjustment } from './MeterEventAdjustments.js';
export { AlertTriggered } from './AlertTriggereds.js';
export { MeterEventSummary } from './MeterEventSummaries.js';
export declare class Billing {
private readonly stripe;
alerts: AlertResource;
creditBalanceSummaries: CreditBalanceSummaryResource;
creditBalanceTransactions: CreditBalanceTransactionResource;
creditGrants: CreditGrantResource;
meters: MeterResource;
meterEvents: MeterEventResource;
meterEventAdjustments: MeterEventAdjustmentResource;
constructor(stripe: Stripe);
}
export declare namespace Billing {
export import AlertListParams = BillingNamespace0.AlertListParams;
export import AlertCreateParams = BillingNamespace0.AlertCreateParams;
export import AlertRetrieveParams = BillingNamespace0.AlertRetrieveParams;
export import AlertActivateParams = BillingNamespace0.AlertActivateParams;
export import AlertArchiveParams = BillingNamespace0.AlertArchiveParams;
export import AlertDeactivateParams = BillingNamespace0.AlertDeactivateParams;
export { Alert };
export import CreditBalanceSummaryRetrieveParams = BillingNamespace1.CreditBalanceSummaryRetrieveParams;
export { CreditBalanceSummary };
export import CreditBalanceTransactionListParams = BillingNamespace2.CreditBalanceTransactionListParams;
export import CreditBalanceTransactionRetrieveParams = BillingNamespace2.CreditBalanceTransactionRetrieveParams;
export { CreditBalanceTransaction };
export import CreditGrantListParams = BillingNamespace3.CreditGrantListParams;
export import CreditGrantCreateParams = BillingNamespace3.CreditGrantCreateParams;
export import CreditGrantRetrieveParams = BillingNamespace3.CreditGrantRetrieveParams;
export import CreditGrantUpdateParams = BillingNamespace3.CreditGrantUpdateParams;
export import CreditGrantExpireParams = BillingNamespace3.CreditGrantExpireParams;
export import CreditGrantVoidGrantParams = BillingNamespace3.CreditGrantVoidGrantParams;
export { CreditGrant };
export import MeterListParams = BillingNamespace4.MeterListParams;
export import MeterCreateParams = BillingNamespace4.MeterCreateParams;
export import MeterRetrieveParams = BillingNamespace4.MeterRetrieveParams;
export import MeterUpdateParams = BillingNamespace4.MeterUpdateParams;
export import MeterDeactivateParams = BillingNamespace4.MeterDeactivateParams;
export import MeterReactivateParams = BillingNamespace4.MeterReactivateParams;
export import MeterListEventSummariesParams = BillingNamespace4.MeterListEventSummariesParams;
export { Meter };
export import MeterEventCreateParams = BillingNamespace5.MeterEventCreateParams;
export { MeterEvent };
export import MeterEventAdjustmentCreateParams = BillingNamespace6.MeterEventAdjustmentCreateParams;
export { MeterEventAdjustment };
export { AlertTriggered };
export { MeterEventSummary };
}

21
node_modules/stripe/esm/resources/Billing/index.js generated vendored Normal file
View File

@@ -0,0 +1,21 @@
// File generated from our OpenAPI spec
import { AlertResource } from './Alerts.js';
import { CreditBalanceSummaryResource, } from './CreditBalanceSummary.js';
import { CreditBalanceTransactionResource, } from './CreditBalanceTransactions.js';
import { CreditGrantResource, } from './CreditGrants.js';
import { MeterResource } from './Meters.js';
import { MeterEventResource, } from './MeterEvents.js';
import { MeterEventAdjustmentResource, } from './MeterEventAdjustments.js';
export class Billing {
constructor(stripe) {
this.stripe = stripe;
this.alerts = new AlertResource(stripe);
this.creditBalanceSummaries = new CreditBalanceSummaryResource(stripe);
this.creditBalanceTransactions = new CreditBalanceTransactionResource(stripe);
this.creditGrants = new CreditGrantResource(stripe);
this.meters = new MeterResource(stripe);
this.meterEvents = new MeterEventResource(stripe);
this.meterEventAdjustments = new MeterEventAdjustmentResource(stripe);
}
}
//# sourceMappingURL=index.js.map

View File

@@ -0,0 +1 @@
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/resources/Billing/index.ts"],"names":[],"mappings":"AAAA,uCAAuC;AAGvC,OAAO,EAAsC,aAAa,EAAC,MAAM,aAAa,CAAC;AAC/E,OAAO,EAGL,4BAA4B,GAC7B,MAAM,2BAA2B,CAAC;AACnC,OAAO,EAGL,gCAAgC,GACjC,MAAM,gCAAgC,CAAC;AACxC,OAAO,EAGL,mBAAmB,GACpB,MAAM,mBAAmB,CAAC;AAC3B,OAAO,EAAsC,aAAa,EAAC,MAAM,aAAa,CAAC;AAC/E,OAAO,EAGL,kBAAkB,GACnB,MAAM,kBAAkB,CAAC;AAC1B,OAAO,EAGL,4BAA4B,GAC7B,MAAM,4BAA4B,CAAC;AAcpC,MAAM,OAAO,OAAO;IASlB,YAA6B,MAAc;QAAd,WAAM,GAAN,MAAM,CAAQ;QACzC,IAAI,CAAC,MAAM,GAAG,IAAI,aAAa,CAAC,MAAM,CAAC,CAAC;QACxC,IAAI,CAAC,sBAAsB,GAAG,IAAI,4BAA4B,CAAC,MAAM,CAAC,CAAC;QACvE,IAAI,CAAC,yBAAyB,GAAG,IAAI,gCAAgC,CACnE,MAAM,CACP,CAAC;QACF,IAAI,CAAC,YAAY,GAAG,IAAI,mBAAmB,CAAC,MAAM,CAAC,CAAC;QACpD,IAAI,CAAC,MAAM,GAAG,IAAI,aAAa,CAAC,MAAM,CAAC,CAAC;QACxC,IAAI,CAAC,WAAW,GAAG,IAAI,kBAAkB,CAAC,MAAM,CAAC,CAAC;QAClD,IAAI,CAAC,qBAAqB,GAAG,IAAI,4BAA4B,CAAC,MAAM,CAAC,CAAC;IACxE,CAAC;CACF"}