Add subscription support + license extension on renewal

This commit is contained in:
Krystie committed 2026-08-19 12:45:06 -07:00
1 parent 14d0eaa2b3
commit ff722aa4d8
2075 files changed
+357707 -63

No files matched your search

+174
View File
@@ -0,0 +1,174 @@
import { StripeResource } from '../../StripeResource.js';
import { File } from './../Files.js';
import { PaginationParams, RangeQueryParam } from '../../shared.js';
import { RequestOptions, ApiListPromise, Response } from '../../lib.js';
export declare class ReportRunResource extends StripeResource {
/**
* Returns a list of Report Runs, with the most recent appearing first.
*/
list(params?: Reporting.ReportRunListParams, options?: RequestOptions): ApiListPromise<ReportRun>;
/**
* Creates a new object and begin running the report. (Certain report types require a [live-mode API key](https://stripe.com/docs/keys#test-live-modes).)
*/
create(params: Reporting.ReportRunCreateParams, options?: RequestOptions): Promise<Response<ReportRun>>;
/**
* Retrieves the details of an existing Report Run.
*/
retrieve(id: string, params?: Reporting.ReportRunRetrieveParams, options?: RequestOptions): Promise<Response<ReportRun>>;
}
export interface ReportRun {
/**
* Unique identifier for the object.
*/
id: string;
/**
* String representing the object's type. Objects of the same type share the same value.
*/
object: 'reporting.report_run';
/**
* Time at which the object was created. Measured in seconds since the Unix epoch.
*/
created: number;
/**
* If something should go wrong during the run, a message about the failure (populated when
* `status=failed`).
*/
error: string | null;
/**
* `true` if the report is run on live mode data and `false` if it is run on test mode data.
*/
livemode: boolean;
parameters: ReportRun.Parameters;
/**
* The ID of the [report type](https://docs.stripe.com/reports/report-types) to run, such as `"balance.summary.1"`.
*/
report_type: string;
/**
* The file object representing the result of the report run (populated when
* `status=succeeded`).
*/
result: File | null;
/**
* Status of this report run. This will be `pending` when the run is initially created.
* When the run finishes, this will be set to `succeeded` and the `result` field will be populated.
* Rarely, we may encounter an error, at which point this will be set to `failed` and the `error` field will be populated.
*/
status: string;
/**
* Timestamp at which this run successfully finished (populated when
* `status=succeeded`). Measured in seconds since the Unix epoch.
*/
succeeded_at: number | null;
}
export declare namespace ReportRun {
interface Parameters {
/**
* The set of output columns requested for inclusion in the report run.
*/
columns?: Array<string>;
/**
* Connected account ID by which to filter the report run.
*/
connected_account?: string;
/**
* Currency of objects to be included in the report run.
*/
currency?: string;
/**
* Ending timestamp of data to be included in the report run. Can be any UTC timestamp between 1 second after the user specified `interval_start` and 1 second before this report's last `data_available_end` value.
*/
interval_end?: number;
/**
* Starting timestamp of data to be included in the report run. Can be any UTC timestamp between 1 second after this report's `data_available_start` and 1 second before the user specified `interval_end` value.
*/
interval_start?: number;
/**
* Payout ID by which to filter the report run.
*/
payout?: string;
/**
* Category of balance transactions to be included in the report run.
*/
reporting_category?: string;
/**
* Defaults to `Etc/UTC`. The output timezone for all timestamps in the report. A list of possible time zone values is maintained at the [IANA Time Zone Database](http://www.iana.org/time-zones). Has no effect on `interval_start` or `interval_end`.
*/
timezone?: string;
}
}
export declare namespace Reporting {
interface ReportRunCreateParams {
/**
* The ID of the [report type](https://docs.stripe.com/reporting/statements/api#report-types) to run, such as `"balance.summary.1"`.
*/
report_type: string;
/**
* Specifies which fields in the response should be expanded.
*/
expand?: Array<string>;
/**
* Parameters specifying how the report should be run. Different Report Types have different required and optional parameters, listed in the [API Access to Reports](https://docs.stripe.com/reporting/statements/api) documentation.
*/
parameters?: ReportRunCreateParams.Parameters;
}
namespace ReportRunCreateParams {
interface Parameters {
/**
* The set of report columns to include in the report output. If omitted, the Report Type is run with its default column set.
*/
columns?: Array<string>;
/**
* Connected account ID to filter for in the report run.
*/
connected_account?: string;
/**
* Currency of objects to be included in the report run.
*/
currency?: string;
/**
* Ending timestamp of data to be included in the report run (exclusive).
*/
interval_end?: number;
/**
* Starting timestamp of data to be included in the report run.
*/
interval_start?: number;
/**
* Payout ID by which to filter the report run.
*/
payout?: string;
/**
* Category of balance transactions to be included in the report run.
*/
reporting_category?: Parameters.ReportingCategory;
/**
* Defaults to `Etc/UTC`. The output timezone for all timestamps in the report. A list of possible time zone values is maintained at the [IANA Time Zone Database](http://www.iana.org/time-zones). Has no effect on `interval_start` or `interval_end`.
*/
timezone?: Parameters.Timezone;
}
namespace Parameters {
type ReportingCategory = 'advance' | 'advance_funding' | 'anticipation_repayment' | 'charge' | 'charge_failure' | 'climate_order_purchase' | 'climate_order_refund' | 'connect_collection_transfer' | 'connect_reserved_funds' | 'contribution' | 'dispute' | 'dispute_reversal' | 'fee' | 'financing_paydown' | 'financing_paydown_reversal' | 'financing_payout' | 'financing_payout_reversal' | 'issuing_authorization_hold' | 'issuing_authorization_release' | 'issuing_dispute' | 'issuing_transaction' | 'network_cost' | 'other_adjustment' | 'partial_capture_reversal' | 'payout' | 'payout_reversal' | 'platform_earning' | 'platform_earning_refund' | 'refund' | 'refund_failure' | 'risk_reserved_funds' | 'tax' | 'topup' | 'topup_reversal' | 'transfer' | 'transfer_reversal' | 'unreconciled_customer_funds';
type Timezone = 'Africa/Abidjan' | 'Africa/Accra' | 'Africa/Addis_Ababa' | 'Africa/Algiers' | 'Africa/Asmara' | 'Africa/Asmera' | 'Africa/Bamako' | 'Africa/Bangui' | 'Africa/Banjul' | 'Africa/Bissau' | 'Africa/Blantyre' | 'Africa/Brazzaville' | 'Africa/Bujumbura' | 'Africa/Cairo' | 'Africa/Casablanca' | 'Africa/Ceuta' | 'Africa/Conakry' | 'Africa/Dakar' | 'Africa/Dar_es_Salaam' | 'Africa/Djibouti' | 'Africa/Douala' | 'Africa/El_Aaiun' | 'Africa/Freetown' | 'Africa/Gaborone' | 'Africa/Harare' | 'Africa/Johannesburg' | 'Africa/Juba' | 'Africa/Kampala' | 'Africa/Khartoum' | 'Africa/Kigali' | 'Africa/Kinshasa' | 'Africa/Lagos' | 'Africa/Libreville' | 'Africa/Lome' | 'Africa/Luanda' | 'Africa/Lubumbashi' | 'Africa/Lusaka' | 'Africa/Malabo' | 'Africa/Maputo' | 'Africa/Maseru' | 'Africa/Mbabane' | 'Africa/Mogadishu' | 'Africa/Monrovia' | 'Africa/Nairobi' | 'Africa/Ndjamena' | 'Africa/Niamey' | 'Africa/Nouakchott' | 'Africa/Ouagadougou' | 'Africa/Porto-Novo' | 'Africa/Sao_Tome' | 'Africa/Timbuktu' | 'Africa/Tripoli' | 'Africa/Tunis' | 'Africa/Windhoek' | 'America/Adak' | 'America/Anchorage' | 'America/Anguilla' | 'America/Antigua' | 'America/Araguaina' | 'America/Argentina/Buenos_Aires' | 'America/Argentina/Catamarca' | 'America/Argentina/ComodRivadavia' | 'America/Argentina/Cordoba' | 'America/Argentina/Jujuy' | 'America/Argentina/La_Rioja' | 'America/Argentina/Mendoza' | 'America/Argentina/Rio_Gallegos' | 'America/Argentina/Salta' | 'America/Argentina/San_Juan' | 'America/Argentina/San_Luis' | 'America/Argentina/Tucuman' | 'America/Argentina/Ushuaia' | 'America/Aruba' | 'America/Asuncion' | 'America/Atikokan' | 'America/Atka' | 'America/Bahia' | 'America/Bahia_Banderas' | 'America/Barbados' | 'America/Belem' | 'America/Belize' | 'America/Blanc-Sablon' | 'America/Boa_Vista' | 'America/Bogota' | 'America/Boise' | 'America/Buenos_Aires' | 'America/Cambridge_Bay' | 'America/Campo_Grande' | 'America/Cancun' | 'America/Caracas' | 'America/Catamarca' | 'America/Cayenne' | 'America/Cayman' | 'America/Chicago' | 'America/Chihuahua' | 'America/Ciudad_Juarez' | 'America/Coral_Harbour' | 'America/Cordoba' | 'America/Costa_Rica' | 'America/Coyhaique' | 'America/Creston' | 'America/Cuiaba' | 'America/Curacao' | 'America/Danmarkshavn' | 'America/Dawson' | 'America/Dawson_Creek' | 'America/Denver' | 'America/Detroit' | 'America/Dominica' | 'America/Edmonton' | 'America/Eirunepe' | 'America/El_Salvador' | 'America/Ensenada' | 'America/Fort_Nelson' | 'America/Fort_Wayne' | 'America/Fortaleza' | 'America/Glace_Bay' | 'America/Godthab' | 'America/Goose_Bay' | 'America/Grand_Turk' | 'America/Grenada' | 'America/Guadeloupe' | 'America/Guatemala' | 'America/Guayaquil' | 'America/Guyana' | 'America/Halifax' | 'America/Havana' | 'America/Hermosillo' | 'America/Indiana/Indianapolis' | 'America/Indiana/Knox' | 'America/Indiana/Marengo' | 'America/Indiana/Petersburg' | 'America/Indiana/Tell_City' | 'America/Indiana/Vevay' | 'America/Indiana/Vincennes' | 'America/Indiana/Winamac' | 'America/Indianapolis' | 'America/Inuvik' | 'America/Iqaluit' | 'America/Jamaica' | 'America/Jujuy' | 'America/Juneau' | 'America/Kentucky/Louisville' | 'America/Kentucky/Monticello' | 'America/Knox_IN' | 'America/Kralendijk' | 'America/La_Paz' | 'America/Lima' | 'America/Los_Angeles' | 'America/Louisville' | 'America/Lower_Princes' | 'America/Maceio' | 'America/Managua' | 'America/Manaus' | 'America/Marigot' | 'America/Martinique' | 'America/Matamoros' | 'America/Mazatlan' | 'America/Mendoza' | 'America/Menominee' | 'America/Merida' | 'America/Metlakatla' | 'America/Mexico_City' | 'America/Miquelon' | 'America/Moncton' | 'America/Monterrey' | 'America/Montevideo' | 'America/Montreal' | 'America/Montserrat' | 'America/Nassau' | 'America/New_York' | 'America/Nipigon' | 'America/Nome' | 'America/Noronha' | 'America/North_Dakota/Beulah' | 'America/North_Dakota/Center' | 'America/North_Dakota/New_Salem' | 'America/Nuuk' | 'America/Ojinaga' | 'America/Panama' | 'America/Pangnirtung' | 'America/Paramaribo' | 'America/Phoenix' | 'America/Port-au-Prince' | 'America/Port_of_Spain' | 'America/Porto_Acre' | 'America/Porto_Velho' | 'America/Puerto_Rico' | 'America/Punta_Arenas' | 'America/Rainy_River' | 'America/Rankin_Inlet' | 'America/Recife' | 'America/Regina' | 'America/Resolute' | 'America/Rio_Branco' | 'America/Rosario' | 'America/Santa_Isabel' | 'America/Santarem' | 'America/Santiago' | 'America/Santo_Domingo' | 'America/Sao_Paulo' | 'America/Scoresbysund' | 'America/Shiprock' | 'America/Sitka' | 'America/St_Barthelemy' | 'America/St_Johns' | 'America/St_Kitts' | 'America/St_Lucia' | 'America/St_Thomas' | 'America/St_Vincent' | 'America/Swift_Current' | 'America/Tegucigalpa' | 'America/Thule' | 'America/Thunder_Bay' | 'America/Tijuana' | 'America/Toronto' | 'America/Tortola' | 'America/Vancouver' | 'America/Virgin' | 'America/Whitehorse' | 'America/Winnipeg' | 'America/Yakutat' | 'America/Yellowknife' | 'Antarctica/Casey' | 'Antarctica/Davis' | 'AntarcticaLine truncated
}
}
}
export declare namespace Reporting {
interface ReportRunRetrieveParams {
/**
* Specifies which fields in the response should be expanded.
*/
expand?: Array<string>;
}
}
export declare namespace Reporting {
interface ReportRunListParams extends PaginationParams {
/**
* Only return Report Runs that were created during the given date interval.
*/
created?: RangeQueryParam | number;
/**
* Specifies which fields in the response should be expanded.
*/
expand?: Array<string>;
}
}
+29
View File
@@ -0,0 +1,29 @@
"use strict";
// File generated from our OpenAPI spec
Object.defineProperty(exports, "__esModule", { value: true });
exports.ReportRunResource = void 0;
const StripeResource_js_1 = require("../../StripeResource.js");
class ReportRunResource extends StripeResource_js_1.StripeResource {
/**
* Returns a list of Report Runs, with the most recent appearing first.
*/
list(params, options) {
return this._makeRequest('GET', '/v1/reporting/report_runs', params, options, {
methodType: 'list',
});
}
/**
* Creates a new object and begin running the report. (Certain report types require a [live-mode API key](https://stripe.com/docs/keys#test-live-modes).)
*/
create(params, options) {
return this._makeRequest('POST', '/v1/reporting/report_runs', params, options);
}
/**
* Retrieves the details of an existing Report Run.
*/
retrieve(id, params, options) {
return this._makeRequest('GET', `/v1/reporting/report_runs/${encodeURIComponent(id)}`, params, options);
}
}
exports.ReportRunResource = ReportRunResource;
//# sourceMappingURL=ReportRuns.js.map
+1
View File
@@ -0,0 +1 @@
{"version":3,"file":"ReportRuns.js","sourceRoot":"","sources":["../../../src/resources/Reporting/ReportRuns.ts"],"names":[],"mappings":";AAAA,uCAAuC;;;AAEvC,+DAAuD;AAKvD,MAAa,iBAAkB,SAAQ,kCAAc;IACnD;;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;CACF;AA/CD,8CA+CC"}
+66
View File
@@ -0,0 +1,66 @@
import { StripeResource } from '../../StripeResource.js';
import { RequestOptions, ApiListPromise, Response } from '../../lib.js';
export declare class ReportTypeResource extends StripeResource {
/**
* Returns a full list of Report Types.
*/
list(params?: Reporting.ReportTypeListParams, options?: RequestOptions): ApiListPromise<ReportType>;
/**
* Retrieves the details of a Report Type. (Certain report types require a [live-mode API key](https://stripe.com/docs/keys#test-live-modes).)
*/
retrieve(id: string, params?: Reporting.ReportTypeRetrieveParams, options?: RequestOptions): Promise<Response<ReportType>>;
}
export interface ReportType {
/**
* The [ID of the Report Type](https://docs.stripe.com/reporting/statements/api#available-report-types), such as `balance.summary.1`.
*/
id: string;
/**
* String representing the object's type. Objects of the same type share the same value.
*/
object: 'reporting.report_type';
/**
* Most recent time for which this Report Type is available. Measured in seconds since the Unix epoch.
*/
data_available_end: number;
/**
* Earliest time for which this Report Type is available. Measured in seconds since the Unix epoch.
*/
data_available_start: number;
/**
* List of column names that are included by default when this Report Type gets run. (If the Report Type doesn't support the `columns` parameter, this will be null.)
*/
default_columns: Array<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;
/**
* Human-readable name of the Report Type
*/
name: string;
/**
* When this Report Type was latest updated. Measured in seconds since the Unix epoch.
*/
updated: number;
/**
* Version of the Report Type. Different versions report with the same ID will have the same purpose, but may take different run parameters or have different result schemas.
*/
version: number;
}
export declare namespace Reporting {
interface ReportTypeRetrieveParams {
/**
* Specifies which fields in the response should be expanded.
*/
expand?: Array<string>;
}
}
export declare namespace Reporting {
interface ReportTypeListParams {
/**
* Specifies which fields in the response should be expanded.
*/
expand?: Array<string>;
}
}
+23
View File
@@ -0,0 +1,23 @@
"use strict";
// File generated from our OpenAPI spec
Object.defineProperty(exports, "__esModule", { value: true });
exports.ReportTypeResource = void 0;
const StripeResource_js_1 = require("../../StripeResource.js");
class ReportTypeResource extends StripeResource_js_1.StripeResource {
/**
* Returns a full list of Report Types.
*/
list(params, options) {
return this._makeRequest('GET', '/v1/reporting/report_types', params, options, {
methodType: 'list',
});
}
/**
* Retrieves the details of a Report Type. (Certain report types require a [live-mode API key](https://stripe.com/docs/keys#test-live-modes).)
*/
retrieve(id, params, options) {
return this._makeRequest('GET', `/v1/reporting/report_types/${encodeURIComponent(id)}`, params, options);
}
}
exports.ReportTypeResource = ReportTypeResource;
//# sourceMappingURL=ReportTypes.js.map
+1
View File
@@ -0,0 +1 @@
{"version":3,"file":"ReportTypes.js","sourceRoot":"","sources":["../../../src/resources/Reporting/ReportTypes.ts"],"names":[],"mappings":";AAAA,uCAAuC;;;AAEvC,+DAAuD;AAGvD,MAAa,kBAAmB,SAAQ,kCAAc;IACpD;;OAEG;IACH,IAAI,CACF,MAAuC,EACvC,OAAwB;QAExB,OAAO,IAAI,CAAC,YAAY,CACtB,KAAK,EACL,4BAA4B,EAC5B,MAAM,EACN,OAAO,EACP;YACE,UAAU,EAAE,MAAM;SACnB,CACK,CAAC;IACX,CAAC;IACD;;OAEG;IACH,QAAQ,CACN,EAAU,EACV,MAA2C,EAC3C,OAAwB;QAExB,OAAO,IAAI,CAAC,YAAY,CACtB,KAAK,EACL,8BAA8B,kBAAkB,CAAC,EAAE,CAAC,EAAE,EACtD,MAAM,EACN,OAAO,CACD,CAAC;IACX,CAAC;CACF;AAjCD,gDAiCC"}
+20
View File
@@ -0,0 +1,20 @@
import { Stripe } from '../../stripe.core.js';
import { Reporting as ReportingNamespace0, ReportRun, ReportRunResource } from './ReportRuns.js';
import { Reporting as ReportingNamespace1, ReportType, ReportTypeResource } from './ReportTypes.js';
export { ReportRun } from './ReportRuns.js';
export { ReportType } from './ReportTypes.js';
export declare class Reporting {
private readonly stripe;
reportRuns: ReportRunResource;
reportTypes: ReportTypeResource;
constructor(stripe: Stripe);
}
export declare namespace Reporting {
export import ReportRunListParams = ReportingNamespace0.ReportRunListParams;
export import ReportRunCreateParams = ReportingNamespace0.ReportRunCreateParams;
export import ReportRunRetrieveParams = ReportingNamespace0.ReportRunRetrieveParams;
export { ReportRun, ReportRunResource };
export import ReportTypeListParams = ReportingNamespace1.ReportTypeListParams;
export import ReportTypeRetrieveParams = ReportingNamespace1.ReportTypeRetrieveParams;
export { ReportType, ReportTypeResource };
}
+15
View File
@@ -0,0 +1,15 @@
"use strict";
// File generated from our OpenAPI spec
Object.defineProperty(exports, "__esModule", { value: true });
exports.Reporting = void 0;
const ReportRuns_js_1 = require("./ReportRuns.js");
const ReportTypes_js_1 = require("./ReportTypes.js");
class Reporting {
constructor(stripe) {
this.stripe = stripe;
this.reportRuns = new ReportRuns_js_1.ReportRunResource(stripe);
this.reportTypes = new ReportTypes_js_1.ReportTypeResource(stripe);
}
}
exports.Reporting = Reporting;
//# sourceMappingURL=index.js.map
+1
View File
@@ -0,0 +1 @@
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/resources/Reporting/index.ts"],"names":[],"mappings":";AAAA,uCAAuC;;;AAGvC,mDAIyB;AACzB,qDAI0B;AAK1B,MAAa,SAAS;IAIpB,YAA6B,MAAc;QAAd,WAAM,GAAN,MAAM,CAAQ;QACzC,IAAI,CAAC,UAAU,GAAG,IAAI,iCAAiB,CAAC,MAAM,CAAC,CAAC;QAChD,IAAI,CAAC,WAAW,GAAG,IAAI,mCAAkB,CAAC,MAAM,CAAC,CAAC;IACpD,CAAC;CACF;AARD,8BAQC"}