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,81 @@
import { StripeResource } from '../../../StripeResource.js';
import { RequestOptions, Response } from '../../../lib.js';
export declare class MeterEventAdjustmentResource extends StripeResource {
/**
* Creates a meter event adjustment to cancel a previously sent meter event.
*/
create(params: V2.Billing.MeterEventAdjustmentCreateParams, options?: RequestOptions): Promise<Response<MeterEventAdjustment>>;
}
export interface MeterEventAdjustment {
/**
* The unique ID of this meter event adjustment.
*/
id: string;
/**
* String representing the object's type. Objects of the same type share the same value of the object field.
*/
object: 'v2.billing.meter_event_adjustment';
/**
* Specifies which event to cancel.
*/
cancel: V2.Billing.MeterEventAdjustment.Cancel;
/**
* The time the adjustment was created.
*/
created: string;
/**
* The name of the meter event. Corresponds with the `event_name` field on a meter.
*/
event_name: string;
/**
* Has the value `true` if the object exists in live mode or the value `false` if the object exists in test mode.
*/
livemode: boolean;
/**
* Open Enum. The meter event adjustment's status.
*/
status: V2.Billing.MeterEventAdjustment.Status;
/**
* Open Enum. Specifies the type of cancellation. Currently supports canceling a single event.
*/
type: 'cancel';
}
export declare namespace V2 {
namespace Billing {
namespace MeterEventAdjustment {
interface Cancel {
/**
* The identifier that was originally assigned to the meter event. You can only cancel events within 24 hours of Stripe receiving them.
*/
identifier: string;
}
type Status = 'complete' | 'pending';
}
}
}
export declare namespace V2 {
namespace Billing {
interface MeterEventAdjustmentCreateParams {
/**
* Specifies which event to cancel.
*/
cancel: MeterEventAdjustmentCreateParams.Cancel;
/**
* The name of the meter event. Corresponds with the `event_name` field on a meter.
*/
event_name: string;
/**
* Specifies the type of cancellation. Currently supports canceling a single event.
*/
type: 'cancel';
}
namespace MeterEventAdjustmentCreateParams {
interface Cancel {
/**
* The identifier that was originally assigned to the meter event. You can only cancel events within 24 hours of Stripe receiving them.
*/
identifier: string;
}
}
}
}

View File

@@ -0,0 +1,15 @@
"use strict";
// File generated from our OpenAPI spec
Object.defineProperty(exports, "__esModule", { value: true });
exports.MeterEventAdjustmentResource = void 0;
const StripeResource_js_1 = require("../../../StripeResource.js");
class MeterEventAdjustmentResource extends StripeResource_js_1.StripeResource {
/**
* Creates a meter event adjustment to cancel a previously sent meter event.
*/
create(params, options) {
return this._makeRequest('POST', '/v2/billing/meter_event_adjustments', params, options);
}
}
exports.MeterEventAdjustmentResource = MeterEventAdjustmentResource;
//# sourceMappingURL=MeterEventAdjustments.js.map

View File

@@ -0,0 +1 @@
{"version":3,"file":"MeterEventAdjustments.js","sourceRoot":"","sources":["../../../../src/resources/V2/Billing/MeterEventAdjustments.ts"],"names":[],"mappings":";AAAA,uCAAuC;;;AAEvC,kEAA0D;AAG1D,MAAa,4BAA6B,SAAQ,kCAAc;IAC9D;;OAEG;IACH,MAAM,CACJ,MAAmD,EACnD,OAAwB;QAExB,OAAO,IAAI,CAAC,YAAY,CACtB,MAAM,EACN,qCAAqC,EACrC,MAAM,EACN,OAAO,CACD,CAAC;IACX,CAAC;CACF;AAfD,oEAeC"}

View File

@@ -0,0 +1,41 @@
import { StripeResource } from '../../../StripeResource.js';
import { RequestOptions, Response } from '../../../lib.js';
export declare class MeterEventSessionResource extends StripeResource {
/**
* Creates a meter event session to send usage on the high-throughput meter event stream. Authentication tokens are only valid for 15 minutes, so you need to create a new meter event session when your token expires.
*/
create(params?: V2.Billing.MeterEventSessionCreateParams, options?: RequestOptions): Promise<Response<MeterEventSession>>;
}
export interface MeterEventSession {
/**
* The unique ID of this auth session.
*/
id: string;
/**
* String representing the object's type. Objects of the same type share the same value of the object field.
*/
object: 'v2.billing.meter_event_session';
/**
* The authentication token for this session. Use this token when calling the
* high-throughput meter event API.
*/
authentication_token: string;
/**
* The creation time of this session.
*/
created: string;
/**
* The time at which this session expires.
*/
expires_at: string;
/**
* Has the value `true` if the object exists in live mode or the value `false` if the object exists in test mode.
*/
livemode: boolean;
}
export declare namespace V2 {
namespace Billing {
interface MeterEventSessionCreateParams {
}
}
}

View File

@@ -0,0 +1,15 @@
"use strict";
// File generated from our OpenAPI spec
Object.defineProperty(exports, "__esModule", { value: true });
exports.MeterEventSessionResource = void 0;
const StripeResource_js_1 = require("../../../StripeResource.js");
class MeterEventSessionResource extends StripeResource_js_1.StripeResource {
/**
* Creates a meter event session to send usage on the high-throughput meter event stream. Authentication tokens are only valid for 15 minutes, so you need to create a new meter event session when your token expires.
*/
create(params, options) {
return this._makeRequest('POST', '/v2/billing/meter_event_session', params, options);
}
}
exports.MeterEventSessionResource = MeterEventSessionResource;
//# sourceMappingURL=MeterEventSession.js.map

View File

@@ -0,0 +1 @@
{"version":3,"file":"MeterEventSession.js","sourceRoot":"","sources":["../../../../src/resources/V2/Billing/MeterEventSession.ts"],"names":[],"mappings":";AAAA,uCAAuC;;;AAEvC,kEAA0D;AAG1D,MAAa,yBAA0B,SAAQ,kCAAc;IAC3D;;OAEG;IACH,MAAM,CACJ,MAAiD,EACjD,OAAwB;QAExB,OAAO,IAAI,CAAC,YAAY,CACtB,MAAM,EACN,iCAAiC,EACjC,MAAM,EACN,OAAO,CACD,CAAC;IACX,CAAC;CACF;AAfD,8DAeC"}

View File

@@ -0,0 +1,48 @@
import { StripeResource } from '../../../StripeResource.js';
import { RequestOptions } from '../../../lib.js';
export declare class MeterEventStreamResource extends StripeResource {
/**
* Creates meter events. Events are processed asynchronously, including validation. Requires a meter event session for authentication. Supports up to 10,000 requests per second in livemode. For even higher rate-limits, contact sales.
* @throws Stripe.TemporarySessionExpiredError
*/
create(params: V2.Billing.MeterEventStreamCreateParams, options?: RequestOptions): Promise<void>;
}
export declare namespace V2 {
namespace Billing {
interface MeterEventStreamCreateParams {
/**
* List of meter events to include in the request. Supports up to 100 events per request.
*/
events: Array<MeterEventStreamCreateParams.Event>;
}
namespace MeterEventStreamCreateParams {
interface Event {
/**
* The name of the meter event. Corresponds with the `event_name` field on a meter.
*/
event_name: string;
/**
* A unique identifier for the event. If not provided, one will be generated.
* We recommend using a globally unique identifier for this. We'll enforce
* uniqueness within a rolling 24 hour period.
*/
identifier?: 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/recording-usage#payload-key-overrides).
*/
payload: {
[key: string]: string;
};
/**
* The time of the event. Must be within the past 35 calendar days or up to
* 5 minutes in the future. Defaults to current timestamp if not specified.
*/
timestamp?: string;
}
}
}
}

View File

@@ -0,0 +1,18 @@
"use strict";
// File generated from our OpenAPI spec
Object.defineProperty(exports, "__esModule", { value: true });
exports.MeterEventStreamResource = void 0;
const StripeResource_js_1 = require("../../../StripeResource.js");
class MeterEventStreamResource extends StripeResource_js_1.StripeResource {
/**
* Creates meter events. Events are processed asynchronously, including validation. Requires a meter event session for authentication. Supports up to 10,000 requests per second in livemode. For even higher rate-limits, contact sales.
* @throws Stripe.TemporarySessionExpiredError
*/
create(params, options) {
return this._makeRequest('POST', '/v2/billing/meter_event_stream', params, options, {
apiBase: 'meter_events',
});
}
}
exports.MeterEventStreamResource = MeterEventStreamResource;
//# sourceMappingURL=MeterEventStream.js.map

View File

@@ -0,0 +1 @@
{"version":3,"file":"MeterEventStream.js","sourceRoot":"","sources":["../../../../src/resources/V2/Billing/MeterEventStream.ts"],"names":[],"mappings":";AAAA,uCAAuC;;;AAEvC,kEAA0D;AAG1D,MAAa,wBAAyB,SAAQ,kCAAc;IAC1D;;;OAGG;IACH,MAAM,CACJ,MAA+C,EAC/C,OAAwB;QAExB,OAAO,IAAI,CAAC,YAAY,CACtB,MAAM,EACN,gCAAgC,EAChC,MAAM,EACN,OAAO,EACP;YACE,OAAO,EAAE,cAAc;SACxB,CACK,CAAC;IACX,CAAC;CACF;AAnBD,4DAmBC"}

View File

@@ -0,0 +1,75 @@
import { StripeResource } from '../../../StripeResource.js';
import { RequestOptions, Response } from '../../../lib.js';
export declare class MeterEventResource extends StripeResource {
/**
* Creates a meter event. Events are validated synchronously, but are processed asynchronously. Supports up to 1,000 events per second in livemode. For higher rate-limits, please use meter event streams instead.
*/
create(params: V2.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 of the object field.
*/
object: 'v2.billing.meter_event';
/**
* The creation time of this meter event.
*/
created: string;
/**
* The name of the meter event. Corresponds with the `event_name` field on a meter.
*/
event_name: string;
/**
* A unique identifier for the event. If not provided, one will be generated. We recommend using a globally unique identifier for this. We'll enforce uniqueness within a rolling 24 hour period.
*/
identifier: string;
/**
* Has the value `true` if the object exists in live mode or the value `false` if the object exists in test mode.
*/
livemode: boolean;
/**
* 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/recording-usage#payload-key-overrides)..
*/
payload: {
[key: string]: string;
};
/**
* The time of the event. Must be within the past 35 calendar days or up to
* 5 minutes in the future. Defaults to current timestamp if not specified.
*/
timestamp: string;
}
export declare namespace V2 {
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/recording-usage#payload-key-overrides).
*/
payload: {
[key: string]: string;
};
/**
* A unique identifier for the event. If not provided, one will be generated.
* We recommend using a globally unique identifier for this. We'll enforce
* uniqueness within a rolling 24 hour period.
*/
identifier?: string;
/**
* The time of the event. Must be within the past 35 calendar days or up to
* 5 minutes in the future. Defaults to current timestamp if not specified.
*/
timestamp?: string;
}
}
}

View File

@@ -0,0 +1,15 @@
"use strict";
// File generated from our OpenAPI spec
Object.defineProperty(exports, "__esModule", { value: true });
exports.MeterEventResource = void 0;
const StripeResource_js_1 = require("../../../StripeResource.js");
class MeterEventResource extends StripeResource_js_1.StripeResource {
/**
* Creates a meter event. Events are validated synchronously, but are processed asynchronously. Supports up to 1,000 events per second in livemode. For higher rate-limits, please use meter event streams instead.
*/
create(params, options) {
return this._makeRequest('POST', '/v2/billing/meter_events', params, options);
}
}
exports.MeterEventResource = MeterEventResource;
//# sourceMappingURL=MeterEvents.js.map

View File

@@ -0,0 +1 @@
{"version":3,"file":"MeterEvents.js","sourceRoot":"","sources":["../../../../src/resources/V2/Billing/MeterEvents.ts"],"names":[],"mappings":";AAAA,uCAAuC;;;AAEvC,kEAA0D;AAG1D,MAAa,kBAAmB,SAAQ,kCAAc;IACpD;;OAEG;IACH,MAAM,CACJ,MAAyC,EACzC,OAAwB;QAExB,OAAO,IAAI,CAAC,YAAY,CACtB,MAAM,EACN,0BAA0B,EAC1B,MAAM,EACN,OAAO,CACD,CAAC;IACX,CAAC;CACF;AAfD,gDAeC"}

View File

@@ -0,0 +1,24 @@
import { Stripe } from '../../../stripe.core.js';
import { V2 as V2Namespace0, MeterEvent, MeterEventResource } from './MeterEvents.js';
import { V2 as V2Namespace1, MeterEventAdjustment, MeterEventAdjustmentResource } from './MeterEventAdjustments.js';
import { V2 as V2Namespace2, MeterEventSession, MeterEventSessionResource } from './MeterEventSession.js';
import { MeterEventStreamResource } from './MeterEventStream.js';
export { MeterEvent } from './MeterEvents.js';
export { MeterEventAdjustment } from './MeterEventAdjustments.js';
export { MeterEventSession } from './MeterEventSession.js';
export declare class Billing {
private readonly stripe;
meterEvents: MeterEventResource;
meterEventAdjustments: MeterEventAdjustmentResource;
meterEventSession: MeterEventSessionResource;
meterEventStream: MeterEventStreamResource;
constructor(stripe: Stripe);
}
export declare namespace Billing {
export import MeterEventCreateParams = V2Namespace0.Billing.MeterEventCreateParams;
export { MeterEvent };
export import MeterEventAdjustmentCreateParams = V2Namespace1.Billing.MeterEventAdjustmentCreateParams;
export { MeterEventAdjustment };
export import MeterEventSessionCreateParams = V2Namespace2.Billing.MeterEventSessionCreateParams;
export { MeterEventSession };
}

19
node_modules/stripe/cjs/resources/V2/Billing/index.js generated vendored Normal file
View File

@@ -0,0 +1,19 @@
"use strict";
// File generated from our OpenAPI spec
Object.defineProperty(exports, "__esModule", { value: true });
exports.Billing = void 0;
const MeterEvents_js_1 = require("./MeterEvents.js");
const MeterEventAdjustments_js_1 = require("./MeterEventAdjustments.js");
const MeterEventSession_js_1 = require("./MeterEventSession.js");
const MeterEventStream_js_1 = require("./MeterEventStream.js");
class Billing {
constructor(stripe) {
this.stripe = stripe;
this.meterEvents = new MeterEvents_js_1.MeterEventResource(stripe);
this.meterEventAdjustments = new MeterEventAdjustments_js_1.MeterEventAdjustmentResource(stripe);
this.meterEventSession = new MeterEventSession_js_1.MeterEventSessionResource(stripe);
this.meterEventStream = new MeterEventStream_js_1.MeterEventStreamResource(stripe);
}
}
exports.Billing = Billing;
//# sourceMappingURL=index.js.map

View File

@@ -0,0 +1 @@
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../src/resources/V2/Billing/index.ts"],"names":[],"mappings":";AAAA,uCAAuC;;;AAGvC,qDAI0B;AAC1B,yEAIoC;AACpC,iEAIgC;AAChC,+DAG+B;AAM/B,MAAa,OAAO;IAMlB,YAA6B,MAAc;QAAd,WAAM,GAAN,MAAM,CAAQ;QACzC,IAAI,CAAC,WAAW,GAAG,IAAI,mCAAkB,CAAC,MAAM,CAAC,CAAC;QAClD,IAAI,CAAC,qBAAqB,GAAG,IAAI,uDAA4B,CAAC,MAAM,CAAC,CAAC;QACtE,IAAI,CAAC,iBAAiB,GAAG,IAAI,gDAAyB,CAAC,MAAM,CAAC,CAAC;QAC/D,IAAI,CAAC,gBAAgB,GAAG,IAAI,8CAAwB,CAAC,MAAM,CAAC,CAAC;IAC/D,CAAC;CACF;AAZD,0BAYC"}