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,11 @@
// File generated from our OpenAPI spec
import { StripeResource } from '../../../StripeResource.js';
export class MeterEventAdjustmentResource extends 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);
}
}
//# 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,OAAO,EAAC,cAAc,EAAC,MAAM,4BAA4B,CAAC;AAG1D,MAAM,OAAO,4BAA6B,SAAQ,cAAc;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"}

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,11 @@
// File generated from our OpenAPI spec
import { StripeResource } from '../../../StripeResource.js';
export 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, options) {
return this._makeRequest('POST', '/v2/billing/meter_event_session', params, options);
}
}
//# 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,OAAO,EAAC,cAAc,EAAC,MAAM,4BAA4B,CAAC;AAG1D,MAAM,OAAO,yBAA0B,SAAQ,cAAc;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"}

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,14 @@
// File generated from our OpenAPI spec
import { StripeResource } from '../../../StripeResource.js';
export 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, options) {
return this._makeRequest('POST', '/v2/billing/meter_event_stream', params, options, {
apiBase: 'meter_events',
});
}
}
//# 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,OAAO,EAAC,cAAc,EAAC,MAAM,4BAA4B,CAAC;AAG1D,MAAM,OAAO,wBAAyB,SAAQ,cAAc;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"}

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,11 @@
// File generated from our OpenAPI spec
import { StripeResource } from '../../../StripeResource.js';
export 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, options) {
return this._makeRequest('POST', '/v2/billing/meter_events', params, options);
}
}
//# 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,OAAO,EAAC,cAAc,EAAC,MAAM,4BAA4B,CAAC;AAG1D,MAAM,OAAO,kBAAmB,SAAQ,cAAc;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"}

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 };
}

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

@@ -0,0 +1,15 @@
// File generated from our OpenAPI spec
import { MeterEventResource, } from './MeterEvents.js';
import { MeterEventAdjustmentResource, } from './MeterEventAdjustments.js';
import { MeterEventSessionResource, } from './MeterEventSession.js';
import { MeterEventStreamResource, } from './MeterEventStream.js';
export class Billing {
constructor(stripe) {
this.stripe = stripe;
this.meterEvents = new MeterEventResource(stripe);
this.meterEventAdjustments = new MeterEventAdjustmentResource(stripe);
this.meterEventSession = new MeterEventSessionResource(stripe);
this.meterEventStream = new MeterEventStreamResource(stripe);
}
}
//# 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,OAAO,EAGL,kBAAkB,GACnB,MAAM,kBAAkB,CAAC;AAC1B,OAAO,EAGL,4BAA4B,GAC7B,MAAM,4BAA4B,CAAC;AACpC,OAAO,EAGL,yBAAyB,GAC1B,MAAM,wBAAwB,CAAC;AAChC,OAAO,EAEL,wBAAwB,GACzB,MAAM,uBAAuB,CAAC;AAM/B,MAAM,OAAO,OAAO;IAMlB,YAA6B,MAAc;QAAd,WAAM,GAAN,MAAM,CAAQ;QACzC,IAAI,CAAC,WAAW,GAAG,IAAI,kBAAkB,CAAC,MAAM,CAAC,CAAC;QAClD,IAAI,CAAC,qBAAqB,GAAG,IAAI,4BAA4B,CAAC,MAAM,CAAC,CAAC;QACtE,IAAI,CAAC,iBAAiB,GAAG,IAAI,yBAAyB,CAAC,MAAM,CAAC,CAAC;QAC/D,IAAI,CAAC,gBAAgB,GAAG,IAAI,wBAAwB,CAAC,MAAM,CAAC,CAAC;IAC/D,CAAC;CACF"}

View File

@@ -0,0 +1,99 @@
import { StripeResource } from '../../../../StripeResource.js';
import { ProductCatalogImport } from './../../../V2/Commerce/ProductCatalogImports.js';
import { MetadataParam } from '../../../../shared.js';
import { RequestOptions, V2ListPromise, Response } from '../../../../lib.js';
export declare class ImportResource extends StripeResource {
/**
* Returns a list of ProductCatalogImport objects.
*/
list(params?: V2.Commerce.ProductCatalog.ImportListParams, options?: RequestOptions): V2ListPromise<ProductCatalogImport>;
/**
* Creates a ProductCatalogImport.
*/
create(params: V2.Commerce.ProductCatalog.ImportCreateParams, options?: RequestOptions): Promise<Response<ProductCatalogImport>>;
/**
* Retrieves a ProductCatalogImport by ID.
*/
retrieve(id: string, params?: V2.Commerce.ProductCatalog.ImportRetrieveParams, options?: RequestOptions): Promise<Response<ProductCatalogImport>>;
}
export declare namespace V2 {
namespace Commerce {
namespace ProductCatalog {
interface ImportCreateParams {
/**
* The type of catalog data to import.
*/
feed_type: ImportCreateParams.FeedType;
/**
* Additional information about the import in a structured format.
*/
metadata: MetadataParam;
/**
* The strategy for handling existing catalog data during import.
*/
mode: ImportCreateParams.Mode;
}
namespace ImportCreateParams {
type FeedType = 'inventory' | 'pricing' | 'product';
type Mode = 'replace' | 'upsert';
}
}
}
}
export declare namespace V2 {
namespace Commerce {
namespace ProductCatalog {
interface ImportRetrieveParams {
}
}
}
}
export declare namespace V2 {
namespace Commerce {
namespace ProductCatalog {
interface ImportListParams {
/**
* Filter for objects created at the specified timestamp.
* Must be an RFC 3339 date & time value, for example: 2022-09-18T13:22:00Z.
*/
created?: string;
/**
* Filter for objects created after the specified timestamp.
* Must be an RFC 3339 date & time value, for example: 2022-09-18T13:22:00Z.
*/
created_gt?: string;
/**
* Filter for objects created on or after the specified timestamp.
* Must be an RFC 3339 date & time value, for example: 2022-09-18T13:22:00Z.
*/
created_gte?: string;
/**
* Filter for objects created before the specified timestamp.
* Must be an RFC 3339 date & time value, for example: 2022-09-18T13:22:00Z.
*/
created_lt?: string;
/**
* Filter for objects created on or before the specified timestamp.
* Must be an RFC 3339 date & time value, for example: 2022-09-18T13:22:00Z.
*/
created_lte?: string;
/**
* Filter by the type of feed data being imported.
*/
feed_type?: ImportListParams.FeedType;
/**
* The maximum number of results per page.
*/
limit?: number;
/**
* Filter by import status.
*/
status?: ImportListParams.Status;
}
namespace ImportListParams {
type FeedType = 'inventory' | 'pricing' | 'product';
type Status = 'awaiting_upload' | 'failed' | 'processing' | 'succeeded' | 'succeeded_with_errors';
}
}
}
}

View File

@@ -0,0 +1,152 @@
// File generated from our OpenAPI spec
import { StripeResource } from '../../../../StripeResource.js';
export class ImportResource extends StripeResource {
/**
* Returns a list of ProductCatalogImport objects.
*/
list(params, options) {
return this._makeRequest('GET', '/v2/commerce/product_catalog/imports', params, options, {
methodType: 'list',
responseSchema: {
kind: 'object',
fields: {
data: {
kind: 'array',
element: {
kind: 'object',
fields: {
status_details: {
kind: 'object',
fields: {
processing: {
kind: 'object',
fields: {
error_count: { kind: 'int64_string' },
success_count: { kind: 'int64_string' },
},
},
succeeded: {
kind: 'object',
fields: { success_count: { kind: 'int64_string' } },
},
succeeded_with_errors: {
kind: 'object',
fields: {
error_count: { kind: 'int64_string' },
error_file: {
kind: 'object',
fields: { size: { kind: 'int64_string' } },
},
samples: {
kind: 'array',
element: {
kind: 'object',
fields: { row: { kind: 'int64_string' } },
},
},
success_count: { kind: 'int64_string' },
},
},
},
},
},
},
},
},
},
});
}
/**
* Creates a ProductCatalogImport.
*/
create(params, options) {
return this._makeRequest('POST', '/v2/commerce/product_catalog/imports', params, options, {
responseSchema: {
kind: 'object',
fields: {
status_details: {
kind: 'object',
fields: {
processing: {
kind: 'object',
fields: {
error_count: { kind: 'int64_string' },
success_count: { kind: 'int64_string' },
},
},
succeeded: {
kind: 'object',
fields: { success_count: { kind: 'int64_string' } },
},
succeeded_with_errors: {
kind: 'object',
fields: {
error_count: { kind: 'int64_string' },
error_file: {
kind: 'object',
fields: { size: { kind: 'int64_string' } },
},
samples: {
kind: 'array',
element: {
kind: 'object',
fields: { row: { kind: 'int64_string' } },
},
},
success_count: { kind: 'int64_string' },
},
},
},
},
},
},
});
}
/**
* Retrieves a ProductCatalogImport by ID.
*/
retrieve(id, params, options) {
return this._makeRequest('GET', `/v2/commerce/product_catalog/imports/${encodeURIComponent(id)}`, params, options, {
responseSchema: {
kind: 'object',
fields: {
status_details: {
kind: 'object',
fields: {
processing: {
kind: 'object',
fields: {
error_count: { kind: 'int64_string' },
success_count: { kind: 'int64_string' },
},
},
succeeded: {
kind: 'object',
fields: { success_count: { kind: 'int64_string' } },
},
succeeded_with_errors: {
kind: 'object',
fields: {
error_count: { kind: 'int64_string' },
error_file: {
kind: 'object',
fields: { size: { kind: 'int64_string' } },
},
samples: {
kind: 'array',
element: {
kind: 'object',
fields: { row: { kind: 'int64_string' } },
},
},
success_count: { kind: 'int64_string' },
},
},
},
},
},
},
});
}
}
//# sourceMappingURL=Imports.js.map

View File

@@ -0,0 +1 @@
{"version":3,"file":"Imports.js","sourceRoot":"","sources":["../../../../../src/resources/V2/Commerce/ProductCatalog/Imports.ts"],"names":[],"mappings":"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"}

View File

@@ -0,0 +1,8 @@
import { Stripe } from '../../../../stripe.core.js';
import { ImportResource } from './Imports.js';
export declare class ProductCatalog {
private readonly stripe;
imports: ImportResource;
constructor(stripe: Stripe);
}
export declare namespace ProductCatalog { }

View File

@@ -0,0 +1,9 @@
// File generated from our OpenAPI spec
import { ImportResource } from './Imports.js';
export class ProductCatalog {
constructor(stripe) {
this.stripe = stripe;
this.imports = new ImportResource(stripe);
}
}
//# sourceMappingURL=index.js.map

View File

@@ -0,0 +1 @@
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../../src/resources/V2/Commerce/ProductCatalog/index.ts"],"names":[],"mappings":"AAAA,uCAAuC;AAGvC,OAAO,EAAqB,cAAc,EAAC,MAAM,cAAc,CAAC;AAEhE,MAAM,OAAO,cAAc;IAGzB,YAA6B,MAAc;QAAd,WAAM,GAAN,MAAM,CAAQ;QACzC,IAAI,CAAC,OAAO,GAAG,IAAI,cAAc,CAAC,MAAM,CAAC,CAAC;IAC5C,CAAC;CACF"}

View File

@@ -0,0 +1,183 @@
import { Metadata } from '../../../shared.js';
export interface ProductCatalogImport {
/**
* The unique identifier for this ProductCatalogImport.
*/
id: string;
/**
* String representing the object's type. Objects of the same type share the same value of the object field.
*/
object: 'v2.commerce.product_catalog_import';
/**
* The time this ProductCatalogImport was created.
*/
created: string;
/**
* The type of feed data being imported into the product catalog.
*/
feed_type: V2.Commerce.ProductCatalogImport.FeedType;
/**
* Has the value `true` if the object exists in live mode or the value `false` if the object exists in test mode.
*/
livemode: boolean;
/**
* Additional information about the object in a structured format.
*/
metadata: Metadata;
/**
* The current status of this ProductCatalogImport.
*/
status: V2.Commerce.ProductCatalogImport.Status;
/**
* Details about the current import status.
*/
status_details?: V2.Commerce.ProductCatalogImport.StatusDetails;
}
export declare namespace V2 {
namespace Commerce {
namespace ProductCatalogImport {
type FeedType = 'inventory' | 'pricing' | 'product';
type Status = 'awaiting_upload' | 'failed' | 'processing' | 'succeeded' | 'succeeded_with_errors';
interface StatusDetails {
/**
* Details when the import is awaiting file upload.
*/
awaiting_upload?: StatusDetails.AwaitingUpload;
/**
* Details when the import didn't complete.
*/
failed?: StatusDetails.Failed;
/**
* Details when the import is processing.
*/
processing?: StatusDetails.Processing;
/**
* Details when the import has succeeded.
*/
succeeded?: StatusDetails.Succeeded;
/**
* Details when the import completed but some records failed to process.
*/
succeeded_with_errors?: StatusDetails.SucceededWithErrors;
}
namespace StatusDetails {
interface AwaitingUpload {
/**
* The pre-signed URL information for uploading the catalog file.
*/
upload_url: AwaitingUpload.UploadUrl;
}
interface Failed {
/**
* The error code for this product catalog processing failure.
*/
code: Failed.Code;
/**
* A message explaining why the import failed.
*/
failure_message: string;
/**
* The error type for this product catalog processing failure.
*/
type: Failed.Type;
}
interface Processing {
/**
* The number of records that failed to process so far.
*/
error_count: bigint;
/**
* The number of records processed so far.
*/
success_count: bigint;
}
interface Succeeded {
/**
* The total number of records processed.
*/
success_count: bigint;
}
interface SucceededWithErrors {
/**
* The total number of records that failed to process.
*/
error_count: bigint;
/**
* A file containing details about all errors that occurred.
*/
error_file: SucceededWithErrors.ErrorFile;
/**
* A sample of errors that occurred during processing.
*/
samples: Array<SucceededWithErrors.Sample>;
/**
* The total number of records processed.
*/
success_count: bigint;
}
namespace AwaitingUpload {
interface UploadUrl {
/**
* The timestamp when the upload URL expires.
*/
expires_at: string;
/**
* The pre-signed URL for uploading the catalog file.
*/
url: string;
}
}
namespace Failed {
type Code = 'file_not_found' | 'internal_error' | 'invalid_file';
type Type = 'cannot_proceed' | 'transient_failure';
}
namespace SucceededWithErrors {
interface ErrorFile {
/**
* The MIME type of the error file.
*/
content_type: string;
/**
* The pre-signed URL information for downloading the error file.
*/
download_url: ErrorFile.DownloadUrl;
/**
* The size of the error file in bytes.
*/
size: bigint;
}
interface Sample {
/**
* A description of what went wrong with this record.
*/
error_message: string;
/**
* The name of the field that caused the error.
*/
field: string;
/**
* The identifier of the record that failed to process.
*/
id: string;
/**
* The row number in the import file where the error occurred.
*/
row: bigint;
}
namespace ErrorFile {
interface DownloadUrl {
/**
* The timestamp when the download URL expires.
*/
expires_at: string;
/**
* The pre-signed URL for downloading the error file.
*/
url: string;
}
}
}
}
}
}
}

View File

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

View File

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

View File

@@ -0,0 +1,13 @@
import { Stripe } from '../../../stripe.core.js';
import { ProductCatalogImport } from './ProductCatalogImports.js';
import { ProductCatalog } from './ProductCatalog/index.js';
export { ProductCatalogImport } from './ProductCatalogImports.js';
export declare class Commerce {
private readonly stripe;
productCatalog: ProductCatalog;
constructor(stripe: Stripe);
}
export declare namespace Commerce {
export { ProductCatalogImport };
export { ProductCatalog };
}

View File

@@ -0,0 +1,9 @@
// File generated from our OpenAPI spec
import { ProductCatalog } from './ProductCatalog/index.js';
export class Commerce {
constructor(stripe) {
this.stripe = stripe;
this.productCatalog = new ProductCatalog(stripe);
}
}
//# sourceMappingURL=index.js.map

View File

@@ -0,0 +1 @@
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../src/resources/V2/Commerce/index.ts"],"names":[],"mappings":"AAAA,uCAAuC;AAIvC,OAAO,EAAC,cAAc,EAAC,MAAM,2BAA2B,CAAC;AAIzD,MAAM,OAAO,QAAQ;IAGnB,YAA6B,MAAc;QAAd,WAAM,GAAN,MAAM,CAAQ;QACzC,IAAI,CAAC,cAAc,GAAG,IAAI,cAAc,CAAC,MAAM,CAAC,CAAC;IACnD,CAAC;CACF"}

View File

@@ -0,0 +1,235 @@
import { StripeResource } from '../../../StripeResource.js';
import { RequestOptions, Response } from '../../../lib.js';
export declare class AccountLinkResource extends StripeResource {
/**
* Creates an AccountLink object that includes a single-use URL that an account can use to access a Stripe-hosted flow for collecting or updating required information.
* @throws Stripe.RateLimitError
*/
create(params: V2.Core.AccountLinkCreateParams, options?: RequestOptions): Promise<Response<AccountLink>>;
}
export interface AccountLink {
/**
* String representing the object's type. Objects of the same type share the same value of the object field.
*/
object: 'v2.core.account_link';
/**
* The ID of the connected account this Account Link applies to.
*/
account: string;
/**
* The timestamp at which this Account Link was created.
*/
created: string;
/**
* The timestamp at which this Account Link will expire.
*/
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;
/**
* The URL at which the account can access the Stripe-hosted flow.
*/
url: string;
/**
* Hash containing usage options.
*/
use_case: V2.Core.AccountLink.UseCase;
}
export declare namespace V2 {
namespace Core {
namespace AccountLink {
interface UseCase {
/**
* Hash containing configuration options for an Account Link object that onboards a new account.
*/
account_onboarding?: UseCase.AccountOnboarding;
/**
* Hash containing configuration options for an Account Link that updates an existing account.
*/
account_update?: UseCase.AccountUpdate;
/**
* Open Enum. The type of Account Link the user is requesting.
*/
type: UseCase.Type;
}
namespace UseCase {
interface AccountOnboarding {
/**
* Specifies the requirements that Stripe collects from v2/core/accounts in the Onboarding flow.
*/
collection_options?: AccountOnboarding.CollectionOptions;
/**
* Open Enum. A v2/core/account can be configured to enable certain functionality. The configuration param targets the v2/core/account_link to collect information for the specified v2/core/account configuration/s.
*/
configurations: Array<AccountOnboarding.Configuration>;
/**
* The URL the user will be redirected to if the AccountLink is expired, has been used, or is otherwise invalid. The URL you specify should attempt to generate a new AccountLink with the same parameters used to create the original AccountLink, then redirect the user to the new AccountLink's URL so they can continue the flow. If a new AccountLink cannot be generated or the redirect fails you should display a useful error to the user. Please make sure to implement authentication before redirecting the user in case this URL is leaked to a third party.
*/
refresh_url: string;
/**
* The URL that the user will be redirected to upon completing the linked flow.
*/
return_url?: string;
}
interface AccountUpdate {
/**
* Specifies the requirements that Stripe collects from v2/core/accounts in the Onboarding flow.
*/
collection_options?: AccountUpdate.CollectionOptions;
/**
* Open Enum. A v2/account can be configured to enable certain functionality. The configuration param targets the v2/account_link to collect information for the specified v2/account configuration/s.
*/
configurations: Array<AccountUpdate.Configuration>;
/**
* The URL the user will be redirected to if the Account Link is expired, has been used, or is otherwise invalid. The URL you specify should attempt to generate a new Account Link with the same parameters used to create the original Account Link, then redirect the user to the new Account Link URL so they can continue the flow. Make sure to authenticate the user before redirecting to the new Account Link, in case the URL leaks to a third party. If a new Account Link can't be generated, or if the redirect fails, you should display a useful error to the user.
*/
refresh_url: string;
/**
* The URL that the user will be redirected to upon completing the linked flow.
*/
return_url?: string;
}
type Type = 'account_onboarding' | 'account_update';
namespace AccountOnboarding {
interface CollectionOptions {
/**
* Specifies whether the platform collects only currently_due requirements (`currently_due`) or both currently_due and eventually_due requirements (`eventually_due`). If you don't specify collection_options, the default value is currently_due.
*/
fields?: CollectionOptions.Fields;
/**
* Specifies whether the platform collects future_requirements in addition to requirements in Connect Onboarding. The default value is `omit`.
*/
future_requirements?: CollectionOptions.FutureRequirements;
}
type Configuration = 'customer' | 'merchant' | 'recipient';
namespace CollectionOptions {
type Fields = 'currently_due' | 'eventually_due';
type FutureRequirements = 'include' | 'omit';
}
}
namespace AccountUpdate {
interface CollectionOptions {
/**
* Specifies whether the platform collects only currently_due requirements (`currently_due`) or both currently_due and eventually_due requirements (`eventually_due`). The default value is `currently_due`.
*/
fields?: CollectionOptions.Fields;
/**
* Specifies whether the platform collects future_requirements in addition to requirements in Connect Onboarding. The default value is `omit`.
*/
future_requirements?: CollectionOptions.FutureRequirements;
}
type Configuration = 'customer' | 'merchant' | 'recipient';
namespace CollectionOptions {
type Fields = 'currently_due' | 'eventually_due';
type FutureRequirements = 'include' | 'omit';
}
}
}
}
}
}
export declare namespace V2 {
namespace Core {
interface AccountLinkCreateParams {
/**
* The ID of the Account to create link for.
*/
account: string;
/**
* The use case of the AccountLink.
*/
use_case: AccountLinkCreateParams.UseCase;
}
namespace AccountLinkCreateParams {
interface UseCase {
/**
* Hash containing configuration options for an Account Link object that onboards a new account.
*/
account_onboarding?: UseCase.AccountOnboarding;
/**
* Hash containing configuration options for an Account Link that updates an existing account.
*/
account_update?: UseCase.AccountUpdate;
/**
* Open Enum. The type of Account Link the user is requesting.
*/
type: UseCase.Type;
}
namespace UseCase {
interface AccountOnboarding {
/**
* Specifies the requirements that Stripe collects from v2/core/accounts in the Onboarding flow.
*/
collection_options?: AccountOnboarding.CollectionOptions;
/**
* Open Enum. A v2/core/account can be configured to enable certain functionality. The configuration param targets the v2/core/account_link to collect information for the specified v2/core/account configuration/s.
*/
configurations: Array<AccountOnboarding.Configuration>;
/**
* The URL the user will be redirected to if the AccountLink is expired, has been used, or is otherwise invalid. The URL you specify should attempt to generate a new AccountLink with the same parameters used to create the original AccountLink, then redirect the user to the new AccountLink's URL so they can continue the flow. If a new AccountLink cannot be generated or the redirect fails you should display a useful error to the user. Please make sure to implement authentication before redirecting the user in case this URL is leaked to a third party.
*/
refresh_url: string;
/**
* The URL that the user will be redirected to upon completing the linked flow.
*/
return_url?: string;
}
interface AccountUpdate {
/**
* Specifies the requirements that Stripe collects from v2/core/accounts in the Onboarding flow.
*/
collection_options?: AccountUpdate.CollectionOptions;
/**
* Open Enum. A v2/account can be configured to enable certain functionality. The configuration param targets the v2/account_link to collect information for the specified v2/account configuration/s.
*/
configurations: Array<AccountUpdate.Configuration>;
/**
* The URL the user will be redirected to if the Account Link is expired, has been used, or is otherwise invalid. The URL you specify should attempt to generate a new Account Link with the same parameters used to create the original Account Link, then redirect the user to the new Account Link URL so they can continue the flow. Make sure to authenticate the user before redirecting to the new Account Link, in case the URL leaks to a third party. If a new Account Link can't be generated, or if the redirect fails, you should display a useful error to the user.
*/
refresh_url: string;
/**
* The URL that the user will be redirected to upon completing the linked flow.
*/
return_url?: string;
}
type Type = 'account_onboarding' | 'account_update';
namespace AccountOnboarding {
interface CollectionOptions {
/**
* Specifies whether the platform collects only currently_due requirements (`currently_due`) or both currently_due and eventually_due requirements (`eventually_due`). If you don't specify collection_options, the default value is currently_due.
*/
fields?: CollectionOptions.Fields;
/**
* Specifies whether the platform collects future_requirements in addition to requirements in Connect Onboarding. The default value is `omit`.
*/
future_requirements?: CollectionOptions.FutureRequirements;
}
type Configuration = 'customer' | 'merchant' | 'recipient';
namespace CollectionOptions {
type Fields = 'currently_due' | 'eventually_due';
type FutureRequirements = 'include' | 'omit';
}
}
namespace AccountUpdate {
interface CollectionOptions {
/**
* Specifies whether the platform collects only currently_due requirements (`currently_due`) or both currently_due and eventually_due requirements (`eventually_due`). The default value is `currently_due`.
*/
fields?: CollectionOptions.Fields;
/**
* Specifies whether the platform collects future_requirements in addition to requirements in Connect Onboarding. The default value is `omit`.
*/
future_requirements?: CollectionOptions.FutureRequirements;
}
type Configuration = 'customer' | 'merchant' | 'recipient';
namespace CollectionOptions {
type Fields = 'currently_due' | 'eventually_due';
type FutureRequirements = 'include' | 'omit';
}
}
}
}
}
}

View File

@@ -0,0 +1,12 @@
// File generated from our OpenAPI spec
import { StripeResource } from '../../../StripeResource.js';
export class AccountLinkResource extends StripeResource {
/**
* Creates an AccountLink object that includes a single-use URL that an account can use to access a Stripe-hosted flow for collecting or updating required information.
* @throws Stripe.RateLimitError
*/
create(params, options) {
return this._makeRequest('POST', '/v2/core/account_links', params, options);
}
}
//# sourceMappingURL=AccountLinks.js.map

View File

@@ -0,0 +1 @@
{"version":3,"file":"AccountLinks.js","sourceRoot":"","sources":["../../../../src/resources/V2/Core/AccountLinks.ts"],"names":[],"mappings":"AAAA,uCAAuC;AAEvC,OAAO,EAAC,cAAc,EAAC,MAAM,4BAA4B,CAAC;AAG1D,MAAM,OAAO,mBAAoB,SAAQ,cAAc;IACrD;;;OAGG;IACH,MAAM,CACJ,MAAuC,EACvC,OAAwB;QAExB,OAAO,IAAI,CAAC,YAAY,CACtB,MAAM,EACN,wBAAwB,EACxB,MAAM,EACN,OAAO,CACD,CAAC;IACX,CAAC;CACF"}

View File

@@ -0,0 +1,26 @@
export interface AccountPersonToken {
/**
* Unique identifier for the token.
*/
id: string;
/**
* String representing the object's type. Objects of the same type share the same value of the object field.
*/
object: 'v2.core.account_person_token';
/**
* Time at which the token was created. Represented as a RFC 3339 date & time UTC value in millisecond precision, for example: 2022-09-18T13:22:18.123Z.
*/
created: string;
/**
* Time at which the token will expire.
*/
expires_at: string;
/**
* Has the value `true` if the token exists in live mode or the value `false` if the object exists in test mode.
*/
livemode: boolean;
/**
* Determines if the token has already been used (tokens can only be used once).
*/
used: boolean;
}

View File

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

View File

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

View File

@@ -0,0 +1,473 @@
import { Metadata, Decimal } from '../../../shared.js';
export interface AccountPerson {
/**
* Unique identifier for the Person.
*/
id: string;
/**
* String representing the object's type. Objects of the same type share the same value of the object field.
*/
object: 'v2.core.account_person';
/**
* The account ID which the individual belongs to.
*/
account: string;
/**
* Additional addresses associated with the person.
*/
additional_addresses?: Array<V2.Core.AccountPerson.AdditionalAddress>;
/**
* Additional names (e.g. aliases) associated with the person.
*/
additional_names?: Array<V2.Core.AccountPerson.AdditionalName>;
/**
* Attestations of accepted terms of service agreements.
*/
additional_terms_of_service?: V2.Core.AccountPerson.AdditionalTermsOfService;
/**
* The person's residential address.
*/
address?: V2.Core.AccountPerson.Address;
/**
* Time at which the object was created. Represented as a RFC 3339 date & time UTC value in millisecond precision, for example: 2022-09-18T13:22:18.123Z.
*/
created: string;
/**
* The person's date of birth.
*/
date_of_birth?: V2.Core.AccountPerson.DateOfBirth;
/**
* Documents that may be submitted to satisfy various informational requests.
*/
documents?: V2.Core.AccountPerson.Documents;
/**
* The person's email address.
*/
email?: string;
/**
* The person's first name.
*/
given_name?: string;
/**
* The identification numbers (e.g., SSN) associated with the person.
*/
id_numbers?: Array<V2.Core.AccountPerson.IdNumber>;
/**
* The person's gender (International regulations require either "male" or "female").
*/
legal_gender?: V2.Core.AccountPerson.LegalGender;
/**
* Has the value `true` if the object exists in live mode or the value `false` if the object exists in test mode.
*/
livemode: boolean;
/**
* Set of key-value pairs that you can attach to an object. This can be useful for storing additional information about the object in a structured format.
*/
metadata?: Metadata;
/**
* The countries where the person is a national. Two-letter country code ([ISO 3166-1 alpha-2](https://en.wikipedia.org/wiki/ISO_3166-1_alpha-2)).
*/
nationalities?: Array<string>;
/**
* The person's phone number.
*/
phone?: string;
/**
* The person's political exposure.
*/
political_exposure?: V2.Core.AccountPerson.PoliticalExposure;
/**
* The relationship that this person has with the Account's business or legal entity.
*/
relationship?: V2.Core.AccountPerson.Relationship;
/**
* The script addresses (e.g., non-Latin characters) associated with the person.
*/
script_addresses?: V2.Core.AccountPerson.ScriptAddresses;
/**
* The script names (e.g. non-Latin characters) associated with the person.
*/
script_names?: V2.Core.AccountPerson.ScriptNames;
/**
* The person's last name.
*/
surname?: string;
/**
* Time at which the object was last updated. Represented as a RFC 3339 date & time UTC value in millisecond precision, for example: 2022-09-18T13:22:18.123Z.
*/
updated: string;
}
export declare namespace V2 {
namespace Core {
namespace AccountPerson {
interface AdditionalAddress {
/**
* City, district, suburb, town, or village.
*/
city?: string;
/**
* Two-letter country code ([ISO 3166-1 alpha-2](https://en.wikipedia.org/wiki/ISO_3166-1_alpha-2)).
*/
country?: string;
/**
* Address line 1 (e.g., street, PO Box, or company name).
*/
line1?: string;
/**
* Address line 2 (e.g., apartment, suite, unit, or building).
*/
line2?: string;
/**
* ZIP or postal code.
*/
postal_code?: string;
/**
* Purpose of additional address.
*/
purpose: 'registered';
/**
* State, county, province, or region.
*/
state?: string;
/**
* Town or district.
*/
town?: string;
}
interface AdditionalName {
/**
* The individual's full name.
*/
full_name?: string;
/**
* The individual's first or given name.
*/
given_name?: string;
/**
* The purpose or type of the additional name.
*/
purpose: AdditionalName.Purpose;
/**
* The individual's last or family name.
*/
surname?: string;
}
interface AdditionalTermsOfService {
/**
* Stripe terms of service agreement.
*/
account?: AdditionalTermsOfService.Account;
}
interface Address {
/**
* City, district, suburb, town, or village.
*/
city?: string;
/**
* Two-letter country code ([ISO 3166-1 alpha-2](https://en.wikipedia.org/wiki/ISO_3166-1_alpha-2)).
*/
country?: string;
/**
* Address line 1 (e.g., street, PO Box, or company name).
*/
line1?: string;
/**
* Address line 2 (e.g., apartment, suite, unit, or building).
*/
line2?: string;
/**
* ZIP or postal code.
*/
postal_code?: string;
/**
* State, county, province, or region.
*/
state?: string;
/**
* Town or district.
*/
town?: string;
}
interface DateOfBirth {
/**
* The day of birth, between 1 and 31.
*/
day: number;
/**
* The month of birth, between 1 and 12.
*/
month: number;
/**
* The four-digit year of birth.
*/
year: number;
}
interface Documents {
/**
* One or more documents that demonstrate proof that this person is authorized to represent the company.
*/
company_authorization?: Documents.CompanyAuthorization;
/**
* One or more documents showing the person's passport page with photo and personal data.
*/
passport?: Documents.Passport;
/**
* An identifying document showing the person's name, either a passport or local ID card.
*/
primary_verification?: Documents.PrimaryVerification;
/**
* A document showing address, either a passport, local ID card, or utility bill from a well-known utility company.
*/
secondary_verification?: Documents.SecondaryVerification;
/**
* One or more documents showing the person's visa required for living in the country where they are residing.
*/
visa?: Documents.Visa;
}
interface IdNumber {
/**
* The ID number type of an individual.
*/
type: IdNumber.Type;
}
type LegalGender = 'female' | 'male';
type PoliticalExposure = 'existing' | 'none';
interface Relationship {
/**
* Whether the individual is an authorizer of the Account's identity.
*/
authorizer?: boolean;
/**
* Whether the individual is a director of the Account's identity. Directors are typically members of the governing board of the company or are responsible for making sure that the company meets its regulatory obligations.
*/
director?: boolean;
/**
* Whether the individual has significant responsibility to control, manage, or direct the organization.
*/
executive?: boolean;
/**
* Whether the individual is the legal guardian of the Account's representative.
*/
legal_guardian?: boolean;
/**
* Whether the individual is an owner of the Account's identity.
*/
owner?: boolean;
/**
* The percentage of the Account's identity that the individual owns.
*/
percent_ownership?: Decimal;
/**
* Whether the individual is authorized as the primary representative of the Account. This is the person nominated by the business to provide information about themselves, and general information about the account. There can only be one representative at any given time. At the time the account is created, this person should be set to the person responsible for opening the account.
*/
representative?: boolean;
/**
* The individual's title (e.g., CEO, Support Engineer).
*/
title?: string;
}
interface ScriptAddresses {
/**
* Kana Address.
*/
kana?: ScriptAddresses.Kana;
/**
* Kanji Address.
*/
kanji?: ScriptAddresses.Kanji;
}
interface ScriptNames {
/**
* Persons name in kana script.
*/
kana?: ScriptNames.Kana;
/**
* Persons name in kanji script.
*/
kanji?: ScriptNames.Kanji;
}
namespace AdditionalName {
type Purpose = 'alias' | 'maiden';
}
namespace AdditionalTermsOfService {
interface Account {
/**
* The time when the Account's representative accepted the terms of service. Represented as a RFC 3339 date & time UTC value in millisecond precision, for example: 2022-09-18T13:22:18.123Z.
*/
date?: string;
/**
* The IP address from which the Account's representative accepted the terms of service.
*/
ip?: string;
/**
* The user agent of the browser from which the Account's representative accepted the terms of service.
*/
user_agent?: string;
}
}
namespace Documents {
interface CompanyAuthorization {
/**
* One or more document IDs returned by a [file upload](https://docs.stripe.com/api/persons/update#create_file) with a purpose value of `account_requirement`.
*/
files: Array<string>;
/**
* The format of the document. Currently supports `files` only.
*/
type: 'files';
}
interface Passport {
/**
* One or more document IDs returned by a [file upload](https://docs.stripe.com/api/persons/update#create_file) with a purpose value of `account_requirement`.
*/
files: Array<string>;
/**
* The format of the document. Currently supports `files` only.
*/
type: 'files';
}
interface PrimaryVerification {
/**
* The [file upload](https://docs.stripe.com/api/persons/update#create_file) tokens for the front and back of the verification document.
*/
front_back: PrimaryVerification.FrontBack;
/**
* The format of the verification document. Currently supports `front_back` only.
*/
type: 'front_back';
}
interface SecondaryVerification {
/**
* The [file upload](https://docs.stripe.com/api/persons/update#create_file) tokens for the front and back of the verification document.
*/
front_back: SecondaryVerification.FrontBack;
/**
* The format of the verification document. Currently supports `front_back` only.
*/
type: 'front_back';
}
interface Visa {
/**
* One or more document IDs returned by a [file upload](https://docs.stripe.com/api/persons/update#create_file) with a purpose value of `account_requirement`.
*/
files: Array<string>;
/**
* The format of the document. Currently supports `files` only.
*/
type: 'files';
}
namespace PrimaryVerification {
interface FrontBack {
/**
* A [file upload](https://docs.stripe.com/api/persons/update#create_file) token representing the back of the verification document. The purpose of the uploaded file should be 'identity_document'. The uploaded file needs to be a color image (smaller than 8,000px by 8,000px), in JPG, PNG, or PDF format, and less than 10 MB in size.
*/
back?: string;
/**
* A [file upload](https://docs.stripe.com/api/persons/update#create_file) token representing the front of the verification document. The purpose of the uploaded file should be 'identity_document'. The uploaded file needs to be a color image (smaller than 8,000px by 8,000px), in JPG, PNG, or PDF format, and less than 10 MB in size.
*/
front: string;
}
}
namespace SecondaryVerification {
interface FrontBack {
/**
* A [file upload](https://docs.stripe.com/api/persons/update#create_file) token representing the back of the verification document. The purpose of the uploaded file should be 'identity_document'. The uploaded file needs to be a color image (smaller than 8,000px by 8,000px), in JPG, PNG, or PDF format, and less than 10 MB in size.
*/
back?: string;
/**
* A [file upload](https://docs.stripe.com/api/persons/update#create_file) token representing the front of the verification document. The purpose of the uploaded file should be 'identity_document'. The uploaded file needs to be a color image (smaller than 8,000px by 8,000px), in JPG, PNG, or PDF format, and less than 10 MB in size.
*/
front: string;
}
}
}
namespace IdNumber {
type Type = 'ae_eid' | 'ao_nif' | 'ar_cuil' | 'ar_dni' | 'at_stn' | 'az_tin' | 'bd_brc' | 'bd_etin' | 'bd_nid' | 'be_nrn' | 'bg_ucn' | 'bn_nric' | 'br_cpf' | 'ca_sin' | 'ch_oasi' | 'cl_rut' | 'cn_pp' | 'co_nuip' | 'cr_ci' | 'cr_cpf' | 'cr_dimex' | 'cr_nite' | 'cy_tic' | 'cz_rc' | 'de_stn' | 'dk_cpr' | 'do_cie' | 'do_rcn' | 'ec_ci' | 'ee_ik' | 'es_nif' | 'fi_hetu' | 'fr_nir' | 'gb_nino' | 'gr_afm' | 'gt_nit' | 'hk_id' | 'hr_oib' | 'hu_ad' | 'id_nik' | 'ie_ppsn' | 'is_kt' | 'it_cf' | 'jp_inc' | 'ke_pin' | 'kz_iin' | 'li_peid' | 'lt_ak' | 'lu_nif' | 'lv_pk' | 'mx_rfc' | 'my_nric' | 'mz_nuit' | 'ng_nin' | 'nl_bsn' | 'no_nin' | 'nz_ird' | 'pe_dni' | 'pk_cnic' | 'pk_snic' | 'pl_pesel' | 'pt_nif' | 'ro_cnp' | 'sa_tin' | 'se_pin' | 'sg_fin' | 'sg_nric' | 'sk_dic' | 'th_lc' | 'th_pin' | 'tr_tin' | 'us_itin' | 'us_itin_last_4' | 'us_ssn' | 'us_ssn_last_4' | 'uy_dni' | 'za_id';
}
namespace ScriptAddresses {
interface Kana {
/**
* City, district, suburb, town, or village.
*/
city?: string;
/**
* Two-letter country code ([ISO 3166-1 alpha-2](https://en.wikipedia.org/wiki/ISO_3166-1_alpha-2)).
*/
country?: string;
/**
* Address line 1 (e.g., street, PO Box, or company name).
*/
line1?: string;
/**
* Address line 2 (e.g., apartment, suite, unit, or building).
*/
line2?: string;
/**
* ZIP or postal code.
*/
postal_code?: string;
/**
* State, county, province, or region.
*/
state?: string;
/**
* Town or district.
*/
town?: string;
}
interface Kanji {
/**
* City, district, suburb, town, or village.
*/
city?: string;
/**
* Two-letter country code ([ISO 3166-1 alpha-2](https://en.wikipedia.org/wiki/ISO_3166-1_alpha-2)).
*/
country?: string;
/**
* Address line 1 (e.g., street, PO Box, or company name).
*/
line1?: string;
/**
* Address line 2 (e.g., apartment, suite, unit, or building).
*/
line2?: string;
/**
* ZIP or postal code.
*/
postal_code?: string;
/**
* State, county, province, or region.
*/
state?: string;
/**
* Town or district.
*/
town?: string;
}
}
namespace ScriptNames {
interface Kana {
/**
* The person's first or given name.
*/
given_name?: string;
/**
* The person's last or family name.
*/
surname?: string;
}
interface Kanji {
/**
* The person's first or given name.
*/
given_name?: string;
/**
* The person's last or family name.
*/
surname?: string;
}
}
}
}
}

View File

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

View File

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

View File

@@ -0,0 +1,806 @@
import { StripeResource } from '../../../StripeResource.js';
import { V2Amount } from './../V2Amounts.js';
import { JapanAddressParam, MetadataParam, Decimal } from '../../../shared.js';
import { RequestOptions, Response } from '../../../lib.js';
export declare class AccountTokenResource extends StripeResource {
/**
* Create an account token with a publishable key and pass it to the Accounts v2 API to
* create or update an account without its data touching your server.
* Learn more about [account tokens](https://docs.stripe.com/connect/account-tokens).
* In live mode, you can only create account tokens with your application's publishable key.
* In test mode, you can create account tokens with your secret key or publishable key.
* @throws Stripe.RateLimitError
*/
create(params?: V2.Core.AccountTokenCreateParams, options?: RequestOptions): Promise<Response<AccountToken>>;
/**
* Retrieves an Account Token.
* @throws Stripe.RateLimitError
*/
retrieve(id: string, params?: V2.Core.AccountTokenRetrieveParams, options?: RequestOptions): Promise<Response<AccountToken>>;
}
export interface AccountToken {
/**
* Unique identifier for the token.
*/
id: string;
/**
* String representing the object's type. Objects of the same type share the same value of the object field.
*/
object: 'v2.core.account_token';
/**
* Time at which the token was created. Represented as a RFC 3339 date & time UTC value in millisecond precision, for example: 2022-09-18T13:22:18.123Z.
*/
created: string;
/**
* Time at which the token will expire.
*/
expires_at: string;
/**
* Has the value `true` if the token exists in live mode or the value `false` if the object exists in test mode.
*/
livemode: boolean;
/**
* Determines if the token has already been used (tokens can only be used once).
*/
used: boolean;
}
export declare namespace V2 {
namespace Core {
interface AccountTokenCreateParams {
/**
* The primary contact email address for the Account.
*/
contact_email?: string;
/**
* The default contact phone for the Account.
*/
contact_phone?: string;
/**
* A descriptive name for the Account. This name will be surfaced in the Stripe Dashboard and on any invoices sent to the Account.
*/
display_name?: string;
/**
* Information about the company, individual, and business represented by the Account.
*/
identity?: AccountTokenCreateParams.Identity;
}
namespace AccountTokenCreateParams {
interface Identity {
/**
* Attestations from the identity's key people, e.g. owners, executives, directors, representatives.
*/
attestations?: Identity.Attestations;
/**
* Information about the company or business.
*/
business_details?: Identity.BusinessDetails;
/**
* The entity type.
*/
entity_type?: Identity.EntityType;
/**
* Information about the person represented by the account.
*/
individual?: Identity.Individual;
}
namespace Identity {
interface Attestations {
/**
* This hash is used to attest that the directors information provided to Stripe is both current and correct; IP, date, and User Agent are expanded by Stripe.
*/
directorship_declaration?: Attestations.DirectorshipDeclaration;
/**
* This hash is used to attest that the beneficial owner information provided to Stripe is both current and correct; IP, date, and User Agent are expanded by Stripe.
*/
ownership_declaration?: Attestations.OwnershipDeclaration;
/**
* Attestation that all Persons with a specific Relationship value have been provided.
*/
persons_provided?: Attestations.PersonsProvided;
/**
* This hash is used to attest that the representative is authorized to act as the representative of their legal entity; IP, date, and User Agent are expanded by Stripe.
*/
representative_declaration?: Attestations.RepresentativeDeclaration;
/**
* Attestations of accepted terms of service agreements.
*/
terms_of_service?: Attestations.TermsOfService;
}
interface BusinessDetails {
/**
* The business registration address of the business entity.
*/
address?: JapanAddressParam;
/**
* The business gross annual revenue for its preceding fiscal year.
*/
annual_revenue?: BusinessDetails.AnnualRevenue;
/**
* A document verifying the business.
*/
documents?: BusinessDetails.Documents;
/**
* Estimated maximum number of workers currently engaged by the business (including employees, contractors, and vendors).
*/
estimated_worker_count?: number;
/**
* The ID numbers of a business entity.
*/
id_numbers?: Array<BusinessDetails.IdNumber>;
/**
* An estimate of the monthly revenue of the business.
*/
monthly_estimated_revenue?: BusinessDetails.MonthlyEstimatedRevenue;
/**
* The phone number of the Business Entity.
*/
phone?: string;
/**
* The business legal name.
*/
registered_name?: string;
/**
* When the business was incorporated or registered.
*/
registration_date?: BusinessDetails.RegistrationDate;
/**
* The business registration address of the business entity in non latin script.
*/
script_addresses?: BusinessDetails.ScriptAddresses;
/**
* The business legal name in non latin script.
*/
script_names?: BusinessDetails.ScriptNames;
/**
* The category identifying the legal structure of the business.
*/
structure?: BusinessDetails.Structure;
}
type EntityType = 'company' | 'government_entity' | 'individual' | 'non_profit';
interface Individual {
/**
* Additional addresses associated with the individual.
*/
additional_addresses?: Array<Individual.AdditionalAddress>;
/**
* Additional names (e.g. aliases) associated with the individual.
*/
additional_names?: Array<Individual.AdditionalName>;
/**
* The individual's residential address.
*/
address?: JapanAddressParam;
/**
* The individual's date of birth.
*/
date_of_birth?: Individual.DateOfBirth;
/**
* Documents that may be submitted to satisfy various informational requests.
*/
documents?: Individual.Documents;
/**
* The individual's email address. You can only set this field when the Account is configured as a `merchant` or `recipient`. Use `contact_email` as the primary contact email for this Account.
*/
email?: string;
/**
* The individual's first name.
*/
given_name?: string;
/**
* The identification numbers (e.g., SSN) associated with the individual.
*/
id_numbers?: Array<Individual.IdNumber>;
/**
* The individual's gender (International regulations require either "male" or "female").
*/
legal_gender?: Individual.LegalGender;
/**
* Set of key-value pairs that you can attach to an object. This can be useful for storing additional information about the object in a structured format.
*/
metadata?: MetadataParam;
/**
* The countries where the individual is a national. Two-letter country code ([ISO 3166-1 alpha-2](https://en.wikipedia.org/wiki/ISO_3166-1_alpha-2)).
*/
nationalities?: Array<string>;
/**
* The individual's phone number.
*/
phone?: string;
/**
* The individual's political exposure.
*/
political_exposure?: Individual.PoliticalExposure;
/**
* The relationship that this individual has with the account's identity.
*/
relationship?: Individual.Relationship;
/**
* The script addresses (e.g., non-Latin characters) associated with the individual.
*/
script_addresses?: Individual.ScriptAddresses;
/**
* The individuals primary name in non latin script.
*/
script_names?: Individual.ScriptNames;
/**
* The individual's last name.
*/
surname?: string;
}
namespace Attestations {
interface DirectorshipDeclaration {
/**
* A boolean indicating if the directors information has been attested.
*/
attested?: boolean;
}
interface OwnershipDeclaration {
/**
* A boolean indicating if the beneficial owner information has been attested.
*/
attested?: boolean;
}
interface PersonsProvided {
/**
* Whether the company's directors have been provided. Set this Boolean to true after creating all the company's directors with the [Persons API](https://docs.stripe.com/api/v2/core/accounts/createperson).
*/
directors?: boolean;
/**
* Whether the company's executives have been provided. Set this Boolean to true after creating all the company's executives with the [Persons API](https://docs.stripe.com/api/v2/core/accounts/createperson).
*/
executives?: boolean;
/**
* Whether the company's owners have been provided. Set this Boolean to true after creating all the company's owners with the [Persons API](https://docs.stripe.com/api/v2/core/accounts/createperson).
*/
owners?: boolean;
/**
* Reason for why the company is exempt from providing ownership information.
*/
ownership_exemption_reason?: PersonsProvided.OwnershipExemptionReason;
}
interface RepresentativeDeclaration {
/**
* A boolean indicating if the representative is authorized to act as the representative of their legal entity.
*/
attested?: boolean;
}
interface TermsOfService {
/**
* Details on the Account's acceptance of the [Stripe Services Agreement]; IP, date, and User Agent are expanded by Stripe.
*/
account?: TermsOfService.Account;
}
namespace PersonsProvided {
type OwnershipExemptionReason = 'qualified_entity_exceeds_ownership_threshold' | 'qualifies_as_financial_institution';
}
namespace TermsOfService {
interface Account {
/**
* The boolean value indicating if the terms of service have been accepted.
*/
shown_and_accepted?: boolean;
}
}
}
namespace BusinessDetails {
interface AnnualRevenue {
/**
* A non-negative integer representing the amount in the smallest currency unit.
*/
amount?: V2Amount;
/**
* The close-out date of the preceding fiscal year in ISO 8601 format. E.g. 2023-12-31 for the 31st of December, 2023.
*/
fiscal_year_end?: string;
}
interface Documents {
/**
* One or more documents that support the bank account ownership verification requirement. Must be a document associated with the account's primary active bank account that displays the last 4 digits of the account number, either a statement or a check.
*/
bank_account_ownership_verification?: Documents.BankAccountOwnershipVerification;
/**
* One or more documents that demonstrate proof of a company's license to operate.
*/
company_license?: Documents.CompanyLicense;
/**
* One or more documents showing the company's Memorandum of Association.
*/
company_memorandum_of_association?: Documents.CompanyMemorandumOfAssociation;
/**
* Certain countries only: One or more documents showing the ministerial decree legalizing the company's establishment.
*/
company_ministerial_decree?: Documents.CompanyMinisterialDecree;
/**
* One or more documents that demonstrate proof of a company's registration with the appropriate local authorities.
*/
company_registration_verification?: Documents.CompanyRegistrationVerification;
/**
* One or more documents that demonstrate proof of a company's tax ID.
*/
company_tax_id_verification?: Documents.CompanyTaxIdVerification;
/**
* A document verifying the business.
*/
primary_verification?: Documents.PrimaryVerification;
/**
* One or more documents that demonstrate proof of address.
*/
proof_of_address?: Documents.ProofOfAddress;
/**
* One or more documents that demonstrate proof of ultimate beneficial ownership.
*/
proof_of_registration?: Documents.ProofOfRegistration;
/**
* One or more documents that demonstrate proof of ultimate beneficial ownership.
*/
proof_of_ultimate_beneficial_ownership?: Documents.ProofOfUltimateBeneficialOwnership;
}
interface IdNumber {
/**
* The registrar of the ID number (Only valid for DE ID number types).
*/
registrar?: string;
/**
* Open Enum. The ID number type of a business entity.
*/
type: IdNumber.Type;
/**
* The value of the ID number.
*/
value: string;
}
interface MonthlyEstimatedRevenue {
/**
* A non-negative integer representing the amount in the smallest currency unit.
*/
amount?: V2Amount;
}
interface RegistrationDate {
/**
* The day of registration, between 1 and 31.
*/
day: number;
/**
* The month of registration, between 1 and 12.
*/
month: number;
/**
* The four-digit year of registration.
*/
year: number;
}
interface ScriptAddresses {
/**
* Kana Address.
*/
kana?: JapanAddressParam;
/**
* Kanji Address.
*/
kanji?: JapanAddressParam;
}
interface ScriptNames {
/**
* Kana name.
*/
kana?: ScriptNames.Kana;
/**
* Kanji name.
*/
kanji?: ScriptNames.Kanji;
}
type Structure = 'cooperative' | 'free_zone_establishment' | 'free_zone_llc' | 'governmental_unit' | 'government_instrumentality' | 'incorporated_association' | 'incorporated_non_profit' | 'incorporated_partnership' | 'limited_liability_partnership' | 'llc' | 'multi_member_llc' | 'private_company' | 'private_corporation' | 'private_partnership' | 'public_company' | 'public_corporation' | 'public_listed_corporation' | 'public_partnership' | 'registered_charity' | 'single_member_llc' | 'sole_establishment' | 'sole_proprietorship' | 'tax_exempt_government_instrumentality' | 'trust' | 'unincorporated_association' | 'unincorporated_non_profit' | 'unincorporated_partnership';
namespace Documents {
interface BankAccountOwnershipVerification {
/**
* One or more document IDs returned by a [file upload](https://docs.stripe.com/api/persons/update#create_file) with a purpose value of `account_requirement`.
*/
files: Array<string>;
/**
* The format of the document. Currently supports `files` only.
*/
type: 'files';
}
interface CompanyLicense {
/**
* One or more document IDs returned by a [file upload](https://docs.stripe.com/api/persons/update#create_file) with a purpose value of `account_requirement`.
*/
files: Array<string>;
/**
* The format of the document. Currently supports `files` only.
*/
type: 'files';
}
interface CompanyMemorandumOfAssociation {
/**
* One or more document IDs returned by a [file upload](https://docs.stripe.com/api/persons/update#create_file) with a purpose value of `account_requirement`.
*/
files: Array<string>;
/**
* The format of the document. Currently supports `files` only.
*/
type: 'files';
}
interface CompanyMinisterialDecree {
/**
* One or more document IDs returned by a [file upload](https://docs.stripe.com/api/persons/update#create_file) with a purpose value of `account_requirement`.
*/
files: Array<string>;
/**
* The format of the document. Currently supports `files` only.
*/
type: 'files';
}
interface CompanyRegistrationVerification {
/**
* One or more document IDs returned by a [file upload](https://docs.stripe.com/api/persons/update#create_file) with a purpose value of `account_requirement`.
*/
files: Array<string>;
/**
* The format of the document. Currently supports `files` only.
*/
type: 'files';
}
interface CompanyTaxIdVerification {
/**
* One or more document IDs returned by a [file upload](https://docs.stripe.com/api/persons/update#create_file) with a purpose value of `account_requirement`.
*/
files: Array<string>;
/**
* The format of the document. Currently supports `files` only.
*/
type: 'files';
}
interface PrimaryVerification {
/**
* The [file upload](https://docs.stripe.com/api/persons/update#create_file) tokens referring to each side of the document.
*/
front_back: PrimaryVerification.FrontBack;
/**
* The format of the verification document. Currently supports `front_back` only.
*/
type: 'front_back';
}
interface ProofOfAddress {
/**
* One or more document IDs returned by a [file upload](https://docs.stripe.com/api/persons/update#create_file) with a purpose value of `account_requirement`.
*/
files: Array<string>;
/**
* The format of the document. Currently supports `files` only.
*/
type: 'files';
}
interface ProofOfRegistration {
/**
* One or more document IDs returned by a [file upload](https://docs.stripe.com/api/persons/update#create_file) with a purpose value of `account_requirement`.
*/
files: Array<string>;
/**
* Person that is signing the document.
*/
signer?: ProofOfRegistration.Signer;
/**
* The format of the document. Currently supports `files` only.
*/
type: 'files';
}
interface ProofOfUltimateBeneficialOwnership {
/**
* One or more document IDs returned by a [file upload](https://docs.stripe.com/api/persons/update#create_file) with a purpose value of `account_requirement`.
*/
files: Array<string>;
/**
* Person that is signing the document.
*/
signer?: ProofOfUltimateBeneficialOwnership.Signer;
/**
* The format of the document. Currently supports `files` only.
*/
type: 'files';
}
namespace PrimaryVerification {
interface FrontBack {
/**
* A [file upload](https://docs.stripe.com/api/persons/update#create_file) token representing the back of the verification document. The purpose of the uploaded file should be 'identity_document'. The uploaded file needs to be a color image (smaller than 8,000px by 8,000px), in JPG, PNG, or PDF format, and less than 10 MB in size.
*/
back?: string;
/**
* A [file upload](https://docs.stripe.com/api/persons/update#create_file) token representing the front of the verification document. The purpose of the uploaded file should be 'identity_document'. The uploaded file needs to be a color image (smaller than 8,000px by 8,000px), in JPG, PNG, or PDF format, and less than 10 MB in size.
*/
front?: string;
}
}
namespace ProofOfRegistration {
interface Signer {
/**
* Person signing the document.
*/
person: string;
}
}
namespace ProofOfUltimateBeneficialOwnership {
interface Signer {
/**
* Person signing the document.
*/
person: string;
}
}
}
namespace IdNumber {
type Type = 'ae_crn' | 'ae_vat' | 'ao_nif' | 'ar_cuit' | 'at_fn' | 'at_stn' | 'at_vat' | 'au_abn' | 'au_acn' | 'au_in' | 'az_tin' | 'bd_etin' | 'be_cbe' | 'be_vat' | 'bg_uic' | 'bg_vat' | 'br_cnpj' | 'ca_cn' | 'ca_crarr' | 'ca_gst_hst' | 'ca_neq' | 'ca_rid' | 'ch_chid' | 'ch_uid' | 'cr_cpj' | 'cr_nite' | 'cy_he' | 'cy_tic' | 'cy_vat' | 'cz_ico' | 'cz_vat' | 'de_hrn' | 'de_stn' | 'de_vat' | 'dk_cvr' | 'dk_vat' | 'do_rcn' | 'ee_rk' | 'ee_vat' | 'es_cif' | 'es_vat' | 'fi_vat' | 'fi_yt' | 'fr_rna' | 'fr_siren' | 'fr_vat' | 'gb_crn' | 'gb_vat' | 'gi_crn' | 'gr_afm' | 'gr_gemi' | 'gr_vat' | 'gt_nit' | 'hk_br' | 'hk_cr' | 'hr_mbs' | 'hr_oib' | 'hr_vat' | 'hu_cjs' | 'hu_tin' | 'hu_vat' | 'ie_crn' | 'ie_trn' | 'ie_vat' | 'it_rea' | 'it_vat' | 'jp_cn' | 'kz_bin' | 'li_uid' | 'lt_ccrn' | 'lt_vat' | 'lu_nif' | 'lu_rcs' | 'lu_vat' | 'lv_urn' | 'lv_vat' | 'mt_crn' | 'mt_tin' | 'mt_vat' | 'mx_rfc' | 'my_brn' | 'my_coid' | 'my_itn' | 'my_sst' | 'mz_nuit' | 'nl_kvk' | 'nl_rsin' | 'nl_vat' | 'no_orgnr' | 'nz_bn' | 'nz_ird' | 'pe_ruc' | 'pk_ntn' | 'pl_nip' | 'pl_regon' | 'pl_vat' | 'pt_vat' | 'ro_cui' | 'ro_orc' | 'ro_vat' | 'sa_crn' | 'sa_tin' | 'se_orgnr' | 'se_vat' | 'sg_uen' | 'si_msp' | 'si_tin' | 'si_vat' | 'sk_dic' | 'sk_ico' | 'sk_vat' | 'th_crn' | 'th_prn' | 'th_tin' | 'us_ein';
}
namespace ScriptNames {
interface Kana {
/**
* Registered name of the business.
*/
registered_name?: string;
}
interface Kanji {
/**
* Registered name of the business.
*/
registered_name?: string;
}
}
}
namespace Individual {
interface AdditionalAddress {
/**
* City, district, suburb, town, or village.
*/
city?: string;
/**
* Two-letter country code ([ISO 3166-1 alpha-2](https://en.wikipedia.org/wiki/ISO_3166-1_alpha-2)).
*/
country?: string;
/**
* Address line 1 (e.g., street, PO Box, or company name).
*/
line1?: string;
/**
* Address line 2 (e.g., apartment, suite, unit, or building).
*/
line2?: string;
/**
* ZIP or postal code.
*/
postal_code?: string;
/**
* Purpose of additional address.
*/
purpose: 'registered';
/**
* State, county, province, or region.
*/
state?: string;
/**
* Town or district.
*/
town?: string;
}
interface AdditionalName {
/**
* The person's full name.
*/
full_name?: string;
/**
* The person's first or given name.
*/
given_name?: string;
/**
* The purpose or type of the additional name.
*/
purpose: AdditionalName.Purpose;
/**
* The person's last or family name.
*/
surname?: string;
}
interface DateOfBirth {
/**
* The day of the birth.
*/
day: number;
/**
* The month of birth.
*/
month: number;
/**
* The year of birth.
*/
year: number;
}
interface Documents {
/**
* One or more documents that demonstrate proof that this person is authorized to represent the company.
*/
company_authorization?: Documents.CompanyAuthorization;
/**
* One or more documents showing the person's passport page with photo and personal data.
*/
passport?: Documents.Passport;
/**
* An identifying document showing the person's name, either a passport or local ID card.
*/
primary_verification?: Documents.PrimaryVerification;
/**
* A document showing address, either a passport, local ID card, or utility bill from a well-known utility company.
*/
secondary_verification?: Documents.SecondaryVerification;
/**
* One or more documents showing the person's visa required for living in the country where they are residing.
*/
visa?: Documents.Visa;
}
interface IdNumber {
/**
* The ID number type of an individual.
*/
type: IdNumber.Type;
/**
* The value of the ID number.
*/
value: string;
}
type LegalGender = 'female' | 'male';
type PoliticalExposure = 'existing' | 'none';
interface Relationship {
/**
* Whether the person is a director of the account's identity. Directors are typically members of the governing board of the company, or responsible for ensuring the company meets its regulatory obligations.
*/
director?: boolean;
/**
* Whether the person has significant responsibility to control, manage, or direct the organization.
*/
executive?: boolean;
/**
* Whether the person is an owner of the account's identity.
*/
owner?: boolean;
/**
* The percent owned by the person of the account's legal entity.
*/
percent_ownership?: Decimal;
/**
* The person's title (e.g., CEO, Support Engineer).
*/
title?: string;
}
interface ScriptAddresses {
/**
* Kana Address.
*/
kana?: JapanAddressParam;
/**
* Kanji Address.
*/
kanji?: JapanAddressParam;
}
interface ScriptNames {
/**
* Persons name in kana script.
*/
kana?: ScriptNames.Kana;
/**
* Persons name in kanji script.
*/
kanji?: ScriptNames.Kanji;
}
namespace AdditionalName {
type Purpose = 'alias' | 'maiden';
}
namespace Documents {
interface CompanyAuthorization {
/**
* One or more document IDs returned by a [file upload](https://docs.stripe.com/api/persons/update#create_file) with a purpose value of `account_requirement`.
*/
files: Array<string>;
/**
* The format of the document. Currently supports `files` only.
*/
type: 'files';
}
interface Passport {
/**
* One or more document IDs returned by a [file upload](https://docs.stripe.com/api/persons/update#create_file) with a purpose value of `account_requirement`.
*/
files: Array<string>;
/**
* The format of the document. Currently supports `files` only.
*/
type: 'files';
}
interface PrimaryVerification {
/**
* The [file upload](https://docs.stripe.com/api/persons/update#create_file) tokens referring to each side of the document.
*/
front_back: PrimaryVerification.FrontBack;
/**
* The format of the verification document. Currently supports `front_back` only.
*/
type: 'front_back';
}
interface SecondaryVerification {
/**
* The [file upload](https://docs.stripe.com/api/persons/update#create_file) tokens referring to each side of the document.
*/
front_back: SecondaryVerification.FrontBack;
/**
* The format of the verification document. Currently supports `front_back` only.
*/
type: 'front_back';
}
interface Visa {
/**
* One or more document IDs returned by a [file upload](https://docs.stripe.com/api/persons/update#create_file) with a purpose value of `account_requirement`.
*/
files: Array<string>;
/**
* The format of the document. Currently supports `files` only.
*/
type: 'files';
}
namespace PrimaryVerification {
interface FrontBack {
/**
* A [file upload](https://docs.stripe.com/api/persons/update#create_file) token representing the back of the verification document. The purpose of the uploaded file should be 'identity_document'. The uploaded file needs to be a color image (smaller than 8,000px by 8,000px), in JPG, PNG, or PDF format, and less than 10 MB in size.
*/
back?: string;
/**
* A [file upload](https://docs.stripe.com/api/persons/update#create_file) token representing the front of the verification document. The purpose of the uploaded file should be 'identity_document'. The uploaded file needs to be a color image (smaller than 8,000px by 8,000px), in JPG, PNG, or PDF format, and less than 10 MB in size.
*/
front?: string;
}
}
namespace SecondaryVerification {
interface FrontBack {
/**
* A [file upload](https://docs.stripe.com/api/persons/update#create_file) token representing the back of the verification document. The purpose of the uploaded file should be 'identity_document'. The uploaded file needs to be a color image (smaller than 8,000px by 8,000px), in JPG, PNG, or PDF format, and less than 10 MB in size.
*/
back?: string;
/**
* A [file upload](https://docs.stripe.com/api/persons/update#create_file) token representing the front of the verification document. The purpose of the uploaded file should be 'identity_document'. The uploaded file needs to be a color image (smaller than 8,000px by 8,000px), in JPG, PNG, or PDF format, and less than 10 MB in size.
*/
front?: string;
}
}
}
namespace IdNumber {
type Type = 'ae_eid' | 'ao_nif' | 'ar_cuil' | 'ar_dni' | 'at_stn' | 'az_tin' | 'bd_brc' | 'bd_etin' | 'bd_nid' | 'be_nrn' | 'bg_ucn' | 'bn_nric' | 'br_cpf' | 'ca_sin' | 'ch_oasi' | 'cl_rut' | 'cn_pp' | 'co_nuip' | 'cr_ci' | 'cr_cpf' | 'cr_dimex' | 'cr_nite' | 'cy_tic' | 'cz_rc' | 'de_stn' | 'dk_cpr' | 'do_cie' | 'do_rcn' | 'ec_ci' | 'ee_ik' | 'es_nif' | 'fi_hetu' | 'fr_nir' | 'gb_nino' | 'gr_afm' | 'gt_nit' | 'hk_id' | 'hr_oib' | 'hu_ad' | 'id_nik' | 'ie_ppsn' | 'is_kt' | 'it_cf' | 'jp_inc' | 'ke_pin' | 'kz_iin' | 'li_peid' | 'lt_ak' | 'lu_nif' | 'lv_pk' | 'mx_rfc' | 'my_nric' | 'mz_nuit' | 'ng_nin' | 'nl_bsn' | 'no_nin' | 'nz_ird' | 'pe_dni' | 'pk_cnic' | 'pk_snic' | 'pl_pesel' | 'pt_nif' | 'ro_cnp' | 'sa_tin' | 'se_pin' | 'sg_fin' | 'sg_nric' | 'sk_dic' | 'th_lc' | 'th_pin' | 'tr_tin' | 'us_itin' | 'us_itin_last_4' | 'us_ssn' | 'us_ssn_last_4' | 'uy_dni' | 'za_id';
}
namespace ScriptNames {
interface Kana {
/**
* The person's first or given name.
*/
given_name?: string;
/**
* The person's last or family name.
*/
surname?: string;
}
interface Kanji {
/**
* The person's first or given name.
*/
given_name?: string;
/**
* The person's last or family name.
*/
surname?: string;
}
}
}
}
}
}
}
export declare namespace V2 {
namespace Core {
interface AccountTokenRetrieveParams {
}
}
}

View File

@@ -0,0 +1,43 @@
// File generated from our OpenAPI spec
import { StripeResource } from '../../../StripeResource.js';
export class AccountTokenResource extends StripeResource {
/**
* Create an account token with a publishable key and pass it to the Accounts v2 API to
* create or update an account without its data touching your server.
* Learn more about [account tokens](https://docs.stripe.com/connect/account-tokens).
* In live mode, you can only create account tokens with your application's publishable key.
* In test mode, you can create account tokens with your secret key or publishable key.
* @throws Stripe.RateLimitError
*/
create(params, options) {
return this._makeRequest('POST', '/v2/core/account_tokens', params, options, {
requestSchema: {
kind: 'object',
fields: {
identity: {
kind: 'object',
fields: {
individual: {
kind: 'object',
fields: {
relationship: {
kind: 'object',
fields: { percent_ownership: { kind: 'decimal_string' } },
},
},
},
},
},
},
},
});
}
/**
* Retrieves an Account Token.
* @throws Stripe.RateLimitError
*/
retrieve(id, params, options) {
return this._makeRequest('GET', `/v2/core/account_tokens/${encodeURIComponent(id)}`, params, options);
}
}
//# sourceMappingURL=AccountTokens.js.map

View File

@@ -0,0 +1 @@
{"version":3,"file":"AccountTokens.js","sourceRoot":"","sources":["../../../../src/resources/V2/Core/AccountTokens.ts"],"names":[],"mappings":"AAAA,uCAAuC;AAEvC,OAAO,EAAC,cAAc,EAAC,MAAM,4BAA4B,CAAC;AAK1D,MAAM,OAAO,oBAAqB,SAAQ,cAAc;IACtD;;;;;;;OAOG;IACH,MAAM,CACJ,MAAyC,EACzC,OAAwB;QAExB,OAAO,IAAI,CAAC,YAAY,CACtB,MAAM,EACN,yBAAyB,EACzB,MAAM,EACN,OAAO,EACP;YACE,aAAa,EAAE;gBACb,IAAI,EAAE,QAAQ;gBACd,MAAM,EAAE;oBACN,QAAQ,EAAE;wBACR,IAAI,EAAE,QAAQ;wBACd,MAAM,EAAE;4BACN,UAAU,EAAE;gCACV,IAAI,EAAE,QAAQ;gCACd,MAAM,EAAE;oCACN,YAAY,EAAE;wCACZ,IAAI,EAAE,QAAQ;wCACd,MAAM,EAAE,EAAC,iBAAiB,EAAE,EAAC,IAAI,EAAE,gBAAgB,EAAC,EAAC;qCACtD;iCACF;6BACF;yBACF;qBACF;iBACF;aACF;SACF,CACK,CAAC;IACX,CAAC;IACD;;;OAGG;IACH,QAAQ,CACN,EAAU,EACV,MAA2C,EAC3C,OAAwB;QAExB,OAAO,IAAI,CAAC,YAAY,CACtB,KAAK,EACL,2BAA2B,kBAAkB,CAAC,EAAE,CAAC,EAAE,EACnD,MAAM,EACN,OAAO,CACD,CAAC;IACX,CAAC;CACF"}

7023
node_modules/stripe/esm/resources/V2/Core/Accounts.d.ts generated vendored Normal file

File diff suppressed because it is too large Load Diff

195
node_modules/stripe/esm/resources/V2/Core/Accounts.js generated vendored Normal file
View File

@@ -0,0 +1,195 @@
// File generated from our OpenAPI spec
import { StripeResource } from '../../../StripeResource.js';
import { PersonResource } from './Accounts/Persons.js';
import { PersonTokenResource } from './Accounts/PersonTokens.js';
export class AccountResource extends StripeResource {
constructor(stripe) {
super(stripe);
this.stripe = stripe;
this.persons = new PersonResource(stripe);
this.personTokens = new PersonTokenResource(stripe);
}
/**
* Returns a list of Accounts.
* @throws Stripe.RateLimitError
*/
list(params, options) {
return this._makeRequest('GET', '/v2/core/accounts', params, options, {
methodType: 'list',
responseSchema: {
kind: 'object',
fields: {
data: {
kind: 'array',
element: {
kind: 'object',
fields: {
identity: {
kind: 'object',
fields: {
individual: {
kind: 'object',
fields: {
relationship: {
kind: 'object',
fields: { percent_ownership: { kind: 'decimal_string' } },
},
},
},
},
},
},
},
},
},
},
});
}
/**
* Create an Account that represents a company, individual, or other entity that your business interacts with. Accounts contain identifying information about the entity, and configurations that store the features an account has access to. An account can be configured as any or all of the following configurations: Customer, Merchant and/or Recipient.
* @throws Stripe.RateLimitError
*/
create(params, options) {
return this._makeRequest('POST', '/v2/core/accounts', params, options, {
requestSchema: {
kind: 'object',
fields: {
identity: {
kind: 'object',
fields: {
individual: {
kind: 'object',
fields: {
relationship: {
kind: 'object',
fields: { percent_ownership: { kind: 'decimal_string' } },
},
},
},
},
},
},
},
responseSchema: {
kind: 'object',
fields: {
identity: {
kind: 'object',
fields: {
individual: {
kind: 'object',
fields: {
relationship: {
kind: 'object',
fields: { percent_ownership: { kind: 'decimal_string' } },
},
},
},
},
},
},
},
});
}
/**
* Retrieves the details of an Account.
* @throws Stripe.RateLimitError
*/
retrieve(id, params, options) {
return this._makeRequest('GET', `/v2/core/accounts/${encodeURIComponent(id)}`, params, options, {
responseSchema: {
kind: 'object',
fields: {
identity: {
kind: 'object',
fields: {
individual: {
kind: 'object',
fields: {
relationship: {
kind: 'object',
fields: { percent_ownership: { kind: 'decimal_string' } },
},
},
},
},
},
},
},
});
}
/**
* Updates the details of an Account.
* @throws Stripe.RateLimitError
*/
update(id, params, options) {
return this._makeRequest('POST', `/v2/core/accounts/${encodeURIComponent(id)}`, params, options, {
requestSchema: {
kind: 'object',
fields: {
identity: {
kind: 'object',
fields: {
individual: {
kind: 'object',
fields: {
relationship: {
kind: 'object',
fields: { percent_ownership: { kind: 'decimal_string' } },
},
},
},
},
},
},
},
responseSchema: {
kind: 'object',
fields: {
identity: {
kind: 'object',
fields: {
individual: {
kind: 'object',
fields: {
relationship: {
kind: 'object',
fields: { percent_ownership: { kind: 'decimal_string' } },
},
},
},
},
},
},
},
});
}
/**
* Removes access to the Account and its associated resources. Closed Accounts can no longer be operated on, but limited information can still be retrieved through the API in order to be able to track their history.
* @throws Stripe.RateLimitError
*/
close(id, params, options) {
return this._makeRequest('POST', `/v2/core/accounts/${encodeURIComponent(id)}/close`, params, options, {
responseSchema: {
kind: 'object',
fields: {
identity: {
kind: 'object',
fields: {
individual: {
kind: 'object',
fields: {
relationship: {
kind: 'object',
fields: { percent_ownership: { kind: 'decimal_string' } },
},
},
},
},
},
},
},
});
}
}
//# sourceMappingURL=Accounts.js.map

View File

@@ -0,0 +1 @@
{"version":3,"file":"Accounts.js","sourceRoot":"","sources":["../../../../src/resources/V2/Core/Accounts.ts"],"names":[],"mappings":"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"}

View File

@@ -0,0 +1,379 @@
import { StripeResource } from '../../../../StripeResource.js';
import { AccountPersonToken } from './../../../V2/Core/AccountPersonTokens.js';
import { JapanAddressParam, MetadataParam, Decimal } from '../../../../shared.js';
import { RequestOptions, Response } from '../../../../lib.js';
export declare class PersonTokenResource extends StripeResource {
/**
* Creates a single-use token that represents the details for a person. Use this when you create or update persons associated with an Account v2. Learn more about [account tokens](https://docs.stripe.com/connect/account-tokens).
* You can only create person tokens with your application's publishable key and in live mode. You can use your application's secret key to create person tokens only in test mode.
* @throws Stripe.RateLimitError
*/
create(accountId: string, params?: V2.Core.Accounts.PersonTokenCreateParams, options?: RequestOptions): Promise<Response<AccountPersonToken>>;
/**
* Retrieves a Person Token associated with an Account.
* @throws Stripe.RateLimitError
*/
retrieve(accountId: string, id: string, params?: V2.Core.Accounts.PersonTokenRetrieveParams, options?: RequestOptions): Promise<Response<AccountPersonToken>>;
}
export declare namespace V2 {
namespace Core {
namespace Accounts {
interface PersonTokenCreateParams {
/**
* Additional addresses associated with the person.
*/
additional_addresses?: Array<PersonTokenCreateParams.AdditionalAddress>;
/**
* Additional names (e.g. aliases) associated with the person.
*/
additional_names?: Array<PersonTokenCreateParams.AdditionalName>;
/**
* Attestations of accepted terms of service agreements.
*/
additional_terms_of_service?: PersonTokenCreateParams.AdditionalTermsOfService;
/**
* The person's residential address.
*/
address?: JapanAddressParam;
/**
* The person's date of birth.
*/
date_of_birth?: PersonTokenCreateParams.DateOfBirth;
/**
* Documents that may be submitted to satisfy various informational requests.
*/
documents?: PersonTokenCreateParams.Documents;
/**
* Email.
*/
email?: string;
/**
* The person's first name.
*/
given_name?: string;
/**
* The identification numbers (e.g., SSN) associated with the person.
*/
id_numbers?: Array<PersonTokenCreateParams.IdNumber>;
/**
* The person's gender (International regulations require either "male" or "female").
*/
legal_gender?: PersonTokenCreateParams.LegalGender;
/**
* Set of key-value pairs that you can attach to an object. This can be useful for storing additional information about the object in a structured format.
*/
metadata?: MetadataParam;
/**
* The nationalities (countries) this person is associated with.
*/
nationalities?: Array<string>;
/**
* The phone number for this person.
*/
phone?: string;
/**
* The person's political exposure.
*/
political_exposure?: PersonTokenCreateParams.PoliticalExposure;
/**
* The relationship that this person has with the Account's business or legal entity.
*/
relationship?: PersonTokenCreateParams.Relationship;
/**
* The script addresses (e.g., non-Latin characters) associated with the person.
*/
script_addresses?: PersonTokenCreateParams.ScriptAddresses;
/**
* The script names (e.g. non-Latin characters) associated with the person.
*/
script_names?: PersonTokenCreateParams.ScriptNames;
/**
* The person's last name.
*/
surname?: string;
}
namespace PersonTokenCreateParams {
interface AdditionalAddress {
/**
* City, district, suburb, town, or village.
*/
city?: string;
/**
* Two-letter country code ([ISO 3166-1 alpha-2](https://en.wikipedia.org/wiki/ISO_3166-1_alpha-2)).
*/
country?: string;
/**
* Address line 1 (e.g., street, PO Box, or company name).
*/
line1?: string;
/**
* Address line 2 (e.g., apartment, suite, unit, or building).
*/
line2?: string;
/**
* ZIP or postal code.
*/
postal_code?: string;
/**
* Purpose of additional address.
*/
purpose: 'registered';
/**
* State, county, province, or region.
*/
state?: string;
/**
* Town or district.
*/
town?: string;
}
interface AdditionalName {
/**
* The person's full name.
*/
full_name?: string;
/**
* The person's first or given name.
*/
given_name?: string;
/**
* The purpose or type of the additional name.
*/
purpose: AdditionalName.Purpose;
/**
* The person's last or family name.
*/
surname?: string;
}
interface AdditionalTermsOfService {
/**
* Details on the Person's acceptance of the [Stripe Services Agreement]; IP, date, and User Agent are expanded by Stripe.
*/
account?: AdditionalTermsOfService.Account;
}
interface DateOfBirth {
/**
* The day of the birth.
*/
day: number;
/**
* The month of birth.
*/
month: number;
/**
* The year of birth.
*/
year: number;
}
interface Documents {
/**
* One or more documents that demonstrate proof that this person is authorized to represent the company.
*/
company_authorization?: Documents.CompanyAuthorization;
/**
* One or more documents showing the person's passport page with photo and personal data.
*/
passport?: Documents.Passport;
/**
* An identifying document showing the person's name, either a passport or local ID card.
*/
primary_verification?: Documents.PrimaryVerification;
/**
* A document showing address, either a passport, local ID card, or utility bill from a well-known utility company.
*/
secondary_verification?: Documents.SecondaryVerification;
/**
* One or more documents showing the person's visa required for living in the country where they are residing.
*/
visa?: Documents.Visa;
}
interface IdNumber {
/**
* The ID number type of an individual.
*/
type: IdNumber.Type;
/**
* The value of the ID number.
*/
value: string;
}
type LegalGender = 'female' | 'male';
type PoliticalExposure = 'existing' | 'none';
interface Relationship {
/**
* Whether the individual is an authorizer of the Account's identity.
*/
authorizer?: boolean;
/**
* Indicates whether the person is a director of the associated legal entity.
*/
director?: boolean;
/**
* Indicates whether the person is an executive of the associated legal entity.
*/
executive?: boolean;
/**
* Indicates whether the person is a legal guardian of the associated legal entity.
*/
legal_guardian?: boolean;
/**
* Indicates whether the person is an owner of the associated legal entity.
*/
owner?: boolean;
/**
* The percentage of ownership the person has in the associated legal entity.
*/
percent_ownership?: Decimal;
/**
* Indicates whether the person is a representative of the associated legal entity.
*/
representative?: boolean;
/**
* The title or position the person holds in the associated legal entity.
*/
title?: string;
}
interface ScriptAddresses {
/**
* Kana Address.
*/
kana?: JapanAddressParam;
/**
* Kanji Address.
*/
kanji?: JapanAddressParam;
}
interface ScriptNames {
/**
* Persons name in kana script.
*/
kana?: ScriptNames.Kana;
/**
* Persons name in kanji script.
*/
kanji?: ScriptNames.Kanji;
}
namespace AdditionalName {
type Purpose = 'alias' | 'maiden';
}
namespace AdditionalTermsOfService {
interface Account {
/**
* The boolean value indicating if the terms of service have been accepted.
*/
shown_and_accepted?: boolean;
}
}
namespace Documents {
interface CompanyAuthorization {
/**
* One or more document IDs returned by a [file upload](https://docs.stripe.com/api/persons/update#create_file) with a purpose value of `account_requirement`.
*/
files: Array<string>;
/**
* The format of the document. Currently supports `files` only.
*/
type: 'files';
}
interface Passport {
/**
* One or more document IDs returned by a [file upload](https://docs.stripe.com/api/persons/update#create_file) with a purpose value of `account_requirement`.
*/
files: Array<string>;
/**
* The format of the document. Currently supports `files` only.
*/
type: 'files';
}
interface PrimaryVerification {
/**
* The [file upload](https://docs.stripe.com/api/persons/update#create_file) tokens referring to each side of the document.
*/
front_back: PrimaryVerification.FrontBack;
/**
* The format of the verification document. Currently supports `front_back` only.
*/
type: 'front_back';
}
interface SecondaryVerification {
/**
* The [file upload](https://docs.stripe.com/api/persons/update#create_file) tokens referring to each side of the document.
*/
front_back: SecondaryVerification.FrontBack;
/**
* The format of the verification document. Currently supports `front_back` only.
*/
type: 'front_back';
}
interface Visa {
/**
* One or more document IDs returned by a [file upload](https://docs.stripe.com/api/persons/update#create_file) with a purpose value of `account_requirement`.
*/
files: Array<string>;
/**
* The format of the document. Currently supports `files` only.
*/
type: 'files';
}
namespace PrimaryVerification {
interface FrontBack {
/**
* A [file upload](https://docs.stripe.com/api/persons/update#create_file) token representing the back of the verification document. The purpose of the uploaded file should be 'identity_document'. The uploaded file needs to be a color image (smaller than 8,000px by 8,000px), in JPG, PNG, or PDF format, and less than 10 MB in size.
*/
back?: string;
/**
* A [file upload](https://docs.stripe.com/api/persons/update#create_file) token representing the front of the verification document. The purpose of the uploaded file should be 'identity_document'. The uploaded file needs to be a color image (smaller than 8,000px by 8,000px), in JPG, PNG, or PDF format, and less than 10 MB in size.
*/
front?: string;
}
}
namespace SecondaryVerification {
interface FrontBack {
/**
* A [file upload](https://docs.stripe.com/api/persons/update#create_file) token representing the back of the verification document. The purpose of the uploaded file should be 'identity_document'. The uploaded file needs to be a color image (smaller than 8,000px by 8,000px), in JPG, PNG, or PDF format, and less than 10 MB in size.
*/
back?: string;
/**
* A [file upload](https://docs.stripe.com/api/persons/update#create_file) token representing the front of the verification document. The purpose of the uploaded file should be 'identity_document'. The uploaded file needs to be a color image (smaller than 8,000px by 8,000px), in JPG, PNG, or PDF format, and less than 10 MB in size.
*/
front?: string;
}
}
}
namespace IdNumber {
type Type = 'ae_eid' | 'ao_nif' | 'ar_cuil' | 'ar_dni' | 'at_stn' | 'az_tin' | 'bd_brc' | 'bd_etin' | 'bd_nid' | 'be_nrn' | 'bg_ucn' | 'bn_nric' | 'br_cpf' | 'ca_sin' | 'ch_oasi' | 'cl_rut' | 'cn_pp' | 'co_nuip' | 'cr_ci' | 'cr_cpf' | 'cr_dimex' | 'cr_nite' | 'cy_tic' | 'cz_rc' | 'de_stn' | 'dk_cpr' | 'do_cie' | 'do_rcn' | 'ec_ci' | 'ee_ik' | 'es_nif' | 'fi_hetu' | 'fr_nir' | 'gb_nino' | 'gr_afm' | 'gt_nit' | 'hk_id' | 'hr_oib' | 'hu_ad' | 'id_nik' | 'ie_ppsn' | 'is_kt' | 'it_cf' | 'jp_inc' | 'ke_pin' | 'kz_iin' | 'li_peid' | 'lt_ak' | 'lu_nif' | 'lv_pk' | 'mx_rfc' | 'my_nric' | 'mz_nuit' | 'ng_nin' | 'nl_bsn' | 'no_nin' | 'nz_ird' | 'pe_dni' | 'pk_cnic' | 'pk_snic' | 'pl_pesel' | 'pt_nif' | 'ro_cnp' | 'sa_tin' | 'se_pin' | 'sg_fin' | 'sg_nric' | 'sk_dic' | 'th_lc' | 'th_pin' | 'tr_tin' | 'us_itin' | 'us_itin_last_4' | 'us_ssn' | 'us_ssn_last_4' | 'uy_dni' | 'za_id';
}
namespace ScriptNames {
interface Kana {
/**
* The person's first or given name.
*/
given_name?: string;
/**
* The person's last or family name.
*/
surname?: string;
}
interface Kanji {
/**
* The person's first or given name.
*/
given_name?: string;
/**
* The person's last or family name.
*/
surname?: string;
}
}
}
}
}
}
export declare namespace V2 {
namespace Core {
namespace Accounts {
interface PersonTokenRetrieveParams {
}
}
}
}

View File

@@ -0,0 +1,30 @@
// File generated from our OpenAPI spec
import { StripeResource } from '../../../../StripeResource.js';
export class PersonTokenResource extends StripeResource {
/**
* Creates a single-use token that represents the details for a person. Use this when you create or update persons associated with an Account v2. Learn more about [account tokens](https://docs.stripe.com/connect/account-tokens).
* You can only create person tokens with your application's publishable key and in live mode. You can use your application's secret key to create person tokens only in test mode.
* @throws Stripe.RateLimitError
*/
create(accountId, params, options) {
return this._makeRequest('POST', `/v2/core/accounts/${encodeURIComponent(accountId)}/person_tokens`, params, options, {
requestSchema: {
kind: 'object',
fields: {
relationship: {
kind: 'object',
fields: { percent_ownership: { kind: 'decimal_string' } },
},
},
},
});
}
/**
* Retrieves a Person Token associated with an Account.
* @throws Stripe.RateLimitError
*/
retrieve(accountId, id, params, options) {
return this._makeRequest('GET', `/v2/core/accounts/${encodeURIComponent(accountId)}/person_tokens/${encodeURIComponent(id)}`, params, options);
}
}
//# sourceMappingURL=PersonTokens.js.map

View File

@@ -0,0 +1 @@
{"version":3,"file":"PersonTokens.js","sourceRoot":"","sources":["../../../../../src/resources/V2/Core/Accounts/PersonTokens.ts"],"names":[],"mappings":"AAAA,uCAAuC;AAEvC,OAAO,EAAC,cAAc,EAAC,MAAM,+BAA+B,CAAC;AAK7D,MAAM,OAAO,mBAAoB,SAAQ,cAAc;IACrD;;;;OAIG;IACH,MAAM,CACJ,SAAiB,EACjB,MAAiD,EACjD,OAAwB;QAExB,OAAO,IAAI,CAAC,YAAY,CACtB,MAAM,EACN,qBAAqB,kBAAkB,CAAC,SAAS,CAAC,gBAAgB,EAClE,MAAM,EACN,OAAO,EACP;YACE,aAAa,EAAE;gBACb,IAAI,EAAE,QAAQ;gBACd,MAAM,EAAE;oBACN,YAAY,EAAE;wBACZ,IAAI,EAAE,QAAQ;wBACd,MAAM,EAAE,EAAC,iBAAiB,EAAE,EAAC,IAAI,EAAE,gBAAgB,EAAC,EAAC;qBACtD;iBACF;aACF;SACF,CACK,CAAC;IACX,CAAC;IACD;;;OAGG;IACH,QAAQ,CACN,SAAiB,EACjB,EAAU,EACV,MAAmD,EACnD,OAAwB;QAExB,OAAO,IAAI,CAAC,YAAY,CACtB,KAAK,EACL,qBAAqB,kBAAkB,CACrC,SAAS,CACV,kBAAkB,kBAAkB,CAAC,EAAE,CAAC,EAAE,EAC3C,MAAM,EACN,OAAO,CACD,CAAC;IACX,CAAC;CACF"}

View File

@@ -0,0 +1,884 @@
import { StripeResource } from '../../../../StripeResource.js';
import { AccountPerson } from './../../../V2/Core/AccountPersons.js';
import { MetadataParam, Decimal, JapanAddressParam } from '../../../../shared.js';
import { RequestOptions, V2ListPromise, Response } from '../../../../lib.js';
import { DeletedObject } from './../../../V2/DeletedObject.js';
export declare class PersonResource extends StripeResource {
/**
* Returns a paginated list of Persons associated with an Account.
* @throws Stripe.RateLimitError
*/
list(accountId: string, params?: V2.Core.Accounts.PersonListParams, options?: RequestOptions): V2ListPromise<AccountPerson>;
/**
* Create a Person. Adds an individual to an Account's identity. You can set relationship attributes and identity information at creation.
* @throws Stripe.RateLimitError
*/
create(accountId: string, params?: V2.Core.Accounts.PersonCreateParams, options?: RequestOptions): Promise<Response<AccountPerson>>;
/**
* Delete a Person associated with an Account.
* @throws Stripe.RateLimitError
*/
del(accountId: string, id: string, params?: V2.Core.Accounts.PersonDeleteParams, options?: RequestOptions): Promise<Response<DeletedObject>>;
/**
* Retrieves a Person associated with an Account.
* @throws Stripe.RateLimitError
*/
retrieve(accountId: string, id: string, params?: V2.Core.Accounts.PersonRetrieveParams, options?: RequestOptions): Promise<Response<AccountPerson>>;
/**
* Updates a Person associated with an Account.
* @throws Stripe.RateLimitError
*/
update(accountId: string, id: string, params?: V2.Core.Accounts.PersonUpdateParams, options?: RequestOptions): Promise<Response<AccountPerson>>;
}
export declare namespace V2 {
namespace Core {
namespace Accounts {
interface PersonCreateParams {
/**
* Additional addresses associated with the person.
*/
additional_addresses?: Array<PersonCreateParams.AdditionalAddress>;
/**
* Additional names (e.g. aliases) associated with the person.
*/
additional_names?: Array<PersonCreateParams.AdditionalName>;
/**
* Attestations of accepted terms of service agreements.
*/
additional_terms_of_service?: PersonCreateParams.AdditionalTermsOfService;
/**
* The person's residential address.
*/
address?: PersonCreateParams.Address;
/**
* The person's date of birth.
*/
date_of_birth?: PersonCreateParams.DateOfBirth;
/**
* Documents that may be submitted to satisfy various informational requests.
*/
documents?: PersonCreateParams.Documents;
/**
* Email.
*/
email?: string;
/**
* The person's first name.
*/
given_name?: string;
/**
* The identification numbers (e.g., SSN) associated with the person.
*/
id_numbers?: Array<PersonCreateParams.IdNumber>;
/**
* The person's gender (International regulations require either "male" or "female").
*/
legal_gender?: PersonCreateParams.LegalGender;
/**
* Set of key-value pairs that you can attach to an object. This can be useful for storing additional information about the object in a structured format.
*/
metadata?: MetadataParam;
/**
* The nationalities (countries) this person is associated with.
*/
nationalities?: Array<string>;
/**
* The person token generated by the person token api.
*/
person_token?: string;
/**
* The phone number for this person.
*/
phone?: string;
/**
* The person's political exposure.
*/
political_exposure?: PersonCreateParams.PoliticalExposure;
/**
* The relationship that this person has with the Account's business or legal entity.
*/
relationship?: PersonCreateParams.Relationship;
/**
* The script addresses (e.g., non-Latin characters) associated with the person.
*/
script_addresses?: PersonCreateParams.ScriptAddresses;
/**
* The script names (e.g. non-Latin characters) associated with the person.
*/
script_names?: PersonCreateParams.ScriptNames;
/**
* The person's last name.
*/
surname?: string;
}
namespace PersonCreateParams {
interface AdditionalAddress {
/**
* City, district, suburb, town, or village.
*/
city?: string;
/**
* Two-letter country code ([ISO 3166-1 alpha-2](https://en.wikipedia.org/wiki/ISO_3166-1_alpha-2)).
*/
country: string;
/**
* Address line 1 (e.g., street, PO Box, or company name).
*/
line1?: string;
/**
* Address line 2 (e.g., apartment, suite, unit, or building).
*/
line2?: string;
/**
* ZIP or postal code.
*/
postal_code?: string;
/**
* Purpose of additional address.
*/
purpose: 'registered';
/**
* State, county, province, or region.
*/
state?: string;
/**
* Town or district.
*/
town?: string;
}
interface AdditionalName {
/**
* The person's full name.
*/
full_name?: string;
/**
* The person's first or given name.
*/
given_name?: string;
/**
* The purpose or type of the additional name.
*/
purpose: AdditionalName.Purpose;
/**
* The person's last or family name.
*/
surname?: string;
}
interface AdditionalTermsOfService {
/**
* Stripe terms of service agreement.
*/
account?: AdditionalTermsOfService.Account;
}
interface Address {
/**
* City, district, suburb, town, or village.
*/
city?: string;
/**
* Two-letter country code ([ISO 3166-1 alpha-2](https://en.wikipedia.org/wiki/ISO_3166-1_alpha-2)).
*/
country: string;
/**
* Address line 1 (e.g., street, PO Box, or company name).
*/
line1?: string;
/**
* Address line 2 (e.g., apartment, suite, unit, or building).
*/
line2?: string;
/**
* ZIP or postal code.
*/
postal_code?: string;
/**
* State, county, province, or region.
*/
state?: string;
/**
* Town or district.
*/
town?: string;
}
interface DateOfBirth {
/**
* The day of birth.
*/
day: number;
/**
* The month of birth.
*/
month: number;
/**
* The year of birth.
*/
year: number;
}
interface Documents {
/**
* One or more documents that demonstrate proof that this person is authorized to represent the company.
*/
company_authorization?: Documents.CompanyAuthorization;
/**
* One or more documents showing the person's passport page with photo and personal data.
*/
passport?: Documents.Passport;
/**
* An identifying document showing the person's name, either a passport or local ID card.
*/
primary_verification?: Documents.PrimaryVerification;
/**
* A document showing address, either a passport, local ID card, or utility bill from a well-known utility company.
*/
secondary_verification?: Documents.SecondaryVerification;
/**
* One or more documents showing the person's visa required for living in the country where they are residing.
*/
visa?: Documents.Visa;
}
interface IdNumber {
/**
* The ID number type of an individual.
*/
type: IdNumber.Type;
/**
* The value of the ID number.
*/
value: string;
}
type LegalGender = 'female' | 'male';
type PoliticalExposure = 'existing' | 'none';
interface Relationship {
/**
* Whether the individual is an authorizer of the Account's identity.
*/
authorizer?: boolean;
/**
* Indicates whether the person is a director of the associated legal entity.
*/
director?: boolean;
/**
* Indicates whether the person is an executive of the associated legal entity.
*/
executive?: boolean;
/**
* Indicates whether the person is a legal guardian of the associated legal entity.
*/
legal_guardian?: boolean;
/**
* Indicates whether the person is an owner of the associated legal entity.
*/
owner?: boolean;
/**
* The percentage of ownership the person has in the associated legal entity.
*/
percent_ownership?: Decimal;
/**
* Indicates whether the person is a representative of the associated legal entity.
*/
representative?: boolean;
/**
* The title or position the person holds in the associated legal entity.
*/
title?: string;
}
interface ScriptAddresses {
/**
* Kana Address.
*/
kana?: ScriptAddresses.Kana;
/**
* Kanji Address.
*/
kanji?: ScriptAddresses.Kanji;
}
interface ScriptNames {
/**
* Persons name in kana script.
*/
kana?: ScriptNames.Kana;
/**
* Persons name in kanji script.
*/
kanji?: ScriptNames.Kanji;
}
namespace AdditionalName {
type Purpose = 'alias' | 'maiden';
}
namespace AdditionalTermsOfService {
interface Account {
/**
* The time when the Account's representative accepted the terms of service. Represented as a RFC 3339 date & time UTC value in millisecond precision, for example: 2022-09-18T13:22:18.123Z.
*/
date: string;
/**
* The IP address from which the Account's representative accepted the terms of service.
*/
ip: string;
/**
* The user agent of the browser from which the Account's representative accepted the terms of service.
*/
user_agent?: string;
}
}
namespace Documents {
interface CompanyAuthorization {
/**
* One or more document IDs returned by a [file upload](https://docs.stripe.com/api/persons/update#create_file) with a purpose value of `account_requirement`.
*/
files: Array<string>;
/**
* The format of the document. Currently supports `files` only.
*/
type: 'files';
}
interface Passport {
/**
* One or more document IDs returned by a [file upload](https://docs.stripe.com/api/persons/update#create_file) with a purpose value of `account_requirement`.
*/
files: Array<string>;
/**
* The format of the document. Currently supports `files` only.
*/
type: 'files';
}
interface PrimaryVerification {
/**
* The [file upload](https://docs.stripe.com/api/persons/update#create_file) tokens referring to each side of the document.
*/
front_back: PrimaryVerification.FrontBack;
/**
* The format of the verification document. Currently supports `front_back` only.
*/
type: 'front_back';
}
interface SecondaryVerification {
/**
* The [file upload](https://docs.stripe.com/api/persons/update#create_file) tokens referring to each side of the document.
*/
front_back: SecondaryVerification.FrontBack;
/**
* The format of the verification document. Currently supports `front_back` only.
*/
type: 'front_back';
}
interface Visa {
/**
* One or more document IDs returned by a [file upload](https://docs.stripe.com/api/persons/update#create_file) with a purpose value of `account_requirement`.
*/
files: Array<string>;
/**
* The format of the document. Currently supports `files` only.
*/
type: 'files';
}
namespace PrimaryVerification {
interface FrontBack {
/**
* A [file upload](https://docs.stripe.com/api/persons/update#create_file) token representing the back of the verification document. The purpose of the uploaded file should be 'identity_document'. The uploaded file needs to be a color image (smaller than 8,000px by 8,000px), in JPG, PNG, or PDF format, and less than 10 MB in size.
*/
back?: string;
/**
* A [file upload](https://docs.stripe.com/api/persons/update#create_file) token representing the front of the verification document. The purpose of the uploaded file should be 'identity_document'. The uploaded file needs to be a color image (smaller than 8,000px by 8,000px), in JPG, PNG, or PDF format, and less than 10 MB in size.
*/
front: string;
}
}
namespace SecondaryVerification {
interface FrontBack {
/**
* A [file upload](https://docs.stripe.com/api/persons/update#create_file) token representing the back of the verification document. The purpose of the uploaded file should be 'identity_document'. The uploaded file needs to be a color image (smaller than 8,000px by 8,000px), in JPG, PNG, or PDF format, and less than 10 MB in size.
*/
back?: string;
/**
* A [file upload](https://docs.stripe.com/api/persons/update#create_file) token representing the front of the verification document. The purpose of the uploaded file should be 'identity_document'. The uploaded file needs to be a color image (smaller than 8,000px by 8,000px), in JPG, PNG, or PDF format, and less than 10 MB in size.
*/
front: string;
}
}
}
namespace IdNumber {
type Type = 'ae_eid' | 'ao_nif' | 'ar_cuil' | 'ar_dni' | 'at_stn' | 'az_tin' | 'bd_brc' | 'bd_etin' | 'bd_nid' | 'be_nrn' | 'bg_ucn' | 'bn_nric' | 'br_cpf' | 'ca_sin' | 'ch_oasi' | 'cl_rut' | 'cn_pp' | 'co_nuip' | 'cr_ci' | 'cr_cpf' | 'cr_dimex' | 'cr_nite' | 'cy_tic' | 'cz_rc' | 'de_stn' | 'dk_cpr' | 'do_cie' | 'do_rcn' | 'ec_ci' | 'ee_ik' | 'es_nif' | 'fi_hetu' | 'fr_nir' | 'gb_nino' | 'gr_afm' | 'gt_nit' | 'hk_id' | 'hr_oib' | 'hu_ad' | 'id_nik' | 'ie_ppsn' | 'is_kt' | 'it_cf' | 'jp_inc' | 'ke_pin' | 'kz_iin' | 'li_peid' | 'lt_ak' | 'lu_nif' | 'lv_pk' | 'mx_rfc' | 'my_nric' | 'mz_nuit' | 'ng_nin' | 'nl_bsn' | 'no_nin' | 'nz_ird' | 'pe_dni' | 'pk_cnic' | 'pk_snic' | 'pl_pesel' | 'pt_nif' | 'ro_cnp' | 'sa_tin' | 'se_pin' | 'sg_fin' | 'sg_nric' | 'sk_dic' | 'th_lc' | 'th_pin' | 'tr_tin' | 'us_itin' | 'us_itin_last_4' | 'us_ssn' | 'us_ssn_last_4' | 'uy_dni' | 'za_id';
}
namespace ScriptAddresses {
interface Kana {
/**
* City, district, suburb, town, or village.
*/
city?: string;
/**
* Two-letter country code ([ISO 3166-1 alpha-2](https://en.wikipedia.org/wiki/ISO_3166-1_alpha-2)).
*/
country: string;
/**
* Address line 1 (e.g., street, PO Box, or company name).
*/
line1?: string;
/**
* Address line 2 (e.g., apartment, suite, unit, or building).
*/
line2?: string;
/**
* ZIP or postal code.
*/
postal_code?: string;
/**
* State, county, province, or region.
*/
state?: string;
/**
* Town or district.
*/
town?: string;
}
interface Kanji {
/**
* City, district, suburb, town, or village.
*/
city?: string;
/**
* Two-letter country code ([ISO 3166-1 alpha-2](https://en.wikipedia.org/wiki/ISO_3166-1_alpha-2)).
*/
country: string;
/**
* Address line 1 (e.g., street, PO Box, or company name).
*/
line1?: string;
/**
* Address line 2 (e.g., apartment, suite, unit, or building).
*/
line2?: string;
/**
* ZIP or postal code.
*/
postal_code?: string;
/**
* State, county, province, or region.
*/
state?: string;
/**
* Town or district.
*/
town?: string;
}
}
namespace ScriptNames {
interface Kana {
/**
* The person's first or given name.
*/
given_name?: string;
/**
* The person's last or family name.
*/
surname?: string;
}
interface Kanji {
/**
* The person's first or given name.
*/
given_name?: string;
/**
* The person's last or family name.
*/
surname?: string;
}
}
}
}
}
}
export declare namespace V2 {
namespace Core {
namespace Accounts {
interface PersonRetrieveParams {
}
}
}
}
export declare namespace V2 {
namespace Core {
namespace Accounts {
interface PersonUpdateParams {
/**
* Additional addresses associated with the person.
*/
additional_addresses?: Array<PersonUpdateParams.AdditionalAddress>;
/**
* Additional names (e.g. aliases) associated with the person.
*/
additional_names?: Array<PersonUpdateParams.AdditionalName>;
/**
* Attestations of accepted terms of service agreements.
*/
additional_terms_of_service?: PersonUpdateParams.AdditionalTermsOfService;
/**
* The primary address associated with the person.
*/
address?: JapanAddressParam;
/**
* The person's date of birth.
*/
date_of_birth?: PersonUpdateParams.DateOfBirth;
/**
* Documents that may be submitted to satisfy various informational requests.
*/
documents?: PersonUpdateParams.Documents;
/**
* Email.
*/
email?: string;
/**
* The person's first name.
*/
given_name?: string;
/**
* The identification numbers (e.g., SSN) associated with the person.
*/
id_numbers?: Array<PersonUpdateParams.IdNumber>;
/**
* The person's gender (International regulations require either "male" or "female").
*/
legal_gender?: PersonUpdateParams.LegalGender;
/**
* Set of key-value pairs that you can attach to an object. This can be useful for storing additional information about the object in a structured format.
*/
metadata?: MetadataParam;
/**
* The nationalities (countries) this person is associated with.
*/
nationalities?: Array<string>;
/**
* The person token generated by the person token api.
*/
person_token?: string;
/**
* The phone number for this person.
*/
phone?: string;
/**
* The person's political exposure.
*/
political_exposure?: PersonUpdateParams.PoliticalExposure;
/**
* The relationship that this person has with the Account's business or legal entity.
*/
relationship?: PersonUpdateParams.Relationship;
/**
* The script addresses (e.g., non-Latin characters) associated with the person.
*/
script_addresses?: PersonUpdateParams.ScriptAddresses;
/**
* The script names (e.g. non-Latin characters) associated with the person.
*/
script_names?: PersonUpdateParams.ScriptNames;
/**
* The person's last name.
*/
surname?: string;
}
namespace PersonUpdateParams {
interface AdditionalAddress {
/**
* City, district, suburb, town, or village.
*/
city?: string;
/**
* Two-letter country code ([ISO 3166-1 alpha-2](https://en.wikipedia.org/wiki/ISO_3166-1_alpha-2)).
*/
country?: string;
/**
* Address line 1 (e.g., street, PO Box, or company name).
*/
line1?: string;
/**
* Address line 2 (e.g., apartment, suite, unit, or building).
*/
line2?: string;
/**
* ZIP or postal code.
*/
postal_code?: string;
/**
* Purpose of additional address.
*/
purpose: 'registered';
/**
* State, county, province, or region.
*/
state?: string;
/**
* Town or district.
*/
town?: string;
}
interface AdditionalName {
/**
* The person's full name.
*/
full_name?: string;
/**
* The person's first or given name.
*/
given_name?: string;
/**
* The purpose or type of the additional name.
*/
purpose: AdditionalName.Purpose;
/**
* The person's last or family name.
*/
surname?: string;
}
interface AdditionalTermsOfService {
/**
* Stripe terms of service agreement.
*/
account?: AdditionalTermsOfService.Account;
}
interface DateOfBirth {
/**
* The day of the birth.
*/
day: number;
/**
* The month of birth.
*/
month: number;
/**
* The year of birth.
*/
year: number;
}
interface Documents {
/**
* One or more documents that demonstrate proof that this person is authorized to represent the company.
*/
company_authorization?: Documents.CompanyAuthorization;
/**
* One or more documents showing the person's passport page with photo and personal data.
*/
passport?: Documents.Passport;
/**
* An identifying document showing the person's name, either a passport or local ID card.
*/
primary_verification?: Documents.PrimaryVerification;
/**
* A document showing address, either a passport, local ID card, or utility bill from a well-known utility company.
*/
secondary_verification?: Documents.SecondaryVerification;
/**
* One or more documents showing the person's visa required for living in the country where they are residing.
*/
visa?: Documents.Visa;
}
interface IdNumber {
/**
* The ID number type of an individual.
*/
type: IdNumber.Type;
/**
* The value of the ID number.
*/
value: string;
}
type LegalGender = 'female' | 'male';
type PoliticalExposure = 'existing' | 'none';
interface Relationship {
/**
* Whether the individual is an authorizer of the Account's identity.
*/
authorizer?: boolean;
/**
* Indicates whether the person is a director of the associated legal entity.
*/
director?: boolean;
/**
* Indicates whether the person is an executive of the associated legal entity.
*/
executive?: boolean;
/**
* Indicates whether the person is a legal guardian of the associated legal entity.
*/
legal_guardian?: boolean;
/**
* Indicates whether the person is an owner of the associated legal entity.
*/
owner?: boolean;
/**
* The percentage of ownership the person has in the associated legal entity.
*/
percent_ownership?: Decimal;
/**
* Indicates whether the person is a representative of the associated legal entity.
*/
representative?: boolean;
/**
* The title or position the person holds in the associated legal entity.
*/
title?: string;
}
interface ScriptAddresses {
/**
* Kana Address.
*/
kana?: JapanAddressParam;
/**
* Kanji Address.
*/
kanji?: JapanAddressParam;
}
interface ScriptNames {
/**
* Persons name in kana script.
*/
kana?: ScriptNames.Kana;
/**
* Persons name in kanji script.
*/
kanji?: ScriptNames.Kanji;
}
namespace AdditionalName {
type Purpose = 'alias' | 'maiden';
}
namespace AdditionalTermsOfService {
interface Account {
/**
* The time when the Account's representative accepted the terms of service. Represented as a RFC 3339 date & time UTC value in millisecond precision, for example: 2022-09-18T13:22:18.123Z.
*/
date?: string;
/**
* The IP address from which the Account's representative accepted the terms of service.
*/
ip?: string;
/**
* The user agent of the browser from which the Account's representative accepted the terms of service.
*/
user_agent?: string;
}
}
namespace Documents {
interface CompanyAuthorization {
/**
* One or more document IDs returned by a [file upload](https://docs.stripe.com/api/persons/update#create_file) with a purpose value of `account_requirement`.
*/
files: Array<string>;
/**
* The format of the document. Currently supports `files` only.
*/
type: 'files';
}
interface Passport {
/**
* One or more document IDs returned by a [file upload](https://docs.stripe.com/api/persons/update#create_file) with a purpose value of `account_requirement`.
*/
files: Array<string>;
/**
* The format of the document. Currently supports `files` only.
*/
type: 'files';
}
interface PrimaryVerification {
/**
* The [file upload](https://docs.stripe.com/api/persons/update#create_file) tokens referring to each side of the document.
*/
front_back: PrimaryVerification.FrontBack;
/**
* The format of the verification document. Currently supports `front_back` only.
*/
type: 'front_back';
}
interface SecondaryVerification {
/**
* The [file upload](https://docs.stripe.com/api/persons/update#create_file) tokens referring to each side of the document.
*/
front_back: SecondaryVerification.FrontBack;
/**
* The format of the verification document. Currently supports `front_back` only.
*/
type: 'front_back';
}
interface Visa {
/**
* One or more document IDs returned by a [file upload](https://docs.stripe.com/api/persons/update#create_file) with a purpose value of `account_requirement`.
*/
files: Array<string>;
/**
* The format of the document. Currently supports `files` only.
*/
type: 'files';
}
namespace PrimaryVerification {
interface FrontBack {
/**
* A [file upload](https://docs.stripe.com/api/persons/update#create_file) token representing the back of the verification document. The purpose of the uploaded file should be 'identity_document'. The uploaded file needs to be a color image (smaller than 8,000px by 8,000px), in JPG, PNG, or PDF format, and less than 10 MB in size.
*/
back?: string;
/**
* A [file upload](https://docs.stripe.com/api/persons/update#create_file) token representing the front of the verification document. The purpose of the uploaded file should be 'identity_document'. The uploaded file needs to be a color image (smaller than 8,000px by 8,000px), in JPG, PNG, or PDF format, and less than 10 MB in size.
*/
front?: string;
}
}
namespace SecondaryVerification {
interface FrontBack {
/**
* A [file upload](https://docs.stripe.com/api/persons/update#create_file) token representing the back of the verification document. The purpose of the uploaded file should be 'identity_document'. The uploaded file needs to be a color image (smaller than 8,000px by 8,000px), in JPG, PNG, or PDF format, and less than 10 MB in size.
*/
back?: string;
/**
* A [file upload](https://docs.stripe.com/api/persons/update#create_file) token representing the front of the verification document. The purpose of the uploaded file should be 'identity_document'. The uploaded file needs to be a color image (smaller than 8,000px by 8,000px), in JPG, PNG, or PDF format, and less than 10 MB in size.
*/
front?: string;
}
}
}
namespace IdNumber {
type Type = 'ae_eid' | 'ao_nif' | 'ar_cuil' | 'ar_dni' | 'at_stn' | 'az_tin' | 'bd_brc' | 'bd_etin' | 'bd_nid' | 'be_nrn' | 'bg_ucn' | 'bn_nric' | 'br_cpf' | 'ca_sin' | 'ch_oasi' | 'cl_rut' | 'cn_pp' | 'co_nuip' | 'cr_ci' | 'cr_cpf' | 'cr_dimex' | 'cr_nite' | 'cy_tic' | 'cz_rc' | 'de_stn' | 'dk_cpr' | 'do_cie' | 'do_rcn' | 'ec_ci' | 'ee_ik' | 'es_nif' | 'fi_hetu' | 'fr_nir' | 'gb_nino' | 'gr_afm' | 'gt_nit' | 'hk_id' | 'hr_oib' | 'hu_ad' | 'id_nik' | 'ie_ppsn' | 'is_kt' | 'it_cf' | 'jp_inc' | 'ke_pin' | 'kz_iin' | 'li_peid' | 'lt_ak' | 'lu_nif' | 'lv_pk' | 'mx_rfc' | 'my_nric' | 'mz_nuit' | 'ng_nin' | 'nl_bsn' | 'no_nin' | 'nz_ird' | 'pe_dni' | 'pk_cnic' | 'pk_snic' | 'pl_pesel' | 'pt_nif' | 'ro_cnp' | 'sa_tin' | 'se_pin' | 'sg_fin' | 'sg_nric' | 'sk_dic' | 'th_lc' | 'th_pin' | 'tr_tin' | 'us_itin' | 'us_itin_last_4' | 'us_ssn' | 'us_ssn_last_4' | 'uy_dni' | 'za_id';
}
namespace ScriptNames {
interface Kana {
/**
* The person's first or given name.
*/
given_name?: string;
/**
* The person's last or family name.
*/
surname?: string;
}
interface Kanji {
/**
* The person's first or given name.
*/
given_name?: string;
/**
* The person's last or family name.
*/
surname?: string;
}
}
}
}
}
}
export declare namespace V2 {
namespace Core {
namespace Accounts {
interface PersonListParams {
/**
* The upper limit on the number of accounts returned by the List Account request.
*/
limit?: number;
}
}
}
}
export declare namespace V2 {
namespace Core {
namespace Accounts {
interface PersonDeleteParams {
}
}
}
}

View File

@@ -0,0 +1,107 @@
// File generated from our OpenAPI spec
import { StripeResource } from '../../../../StripeResource.js';
export class PersonResource extends StripeResource {
/**
* Returns a paginated list of Persons associated with an Account.
* @throws Stripe.RateLimitError
*/
list(accountId, params, options) {
return this._makeRequest('GET', `/v2/core/accounts/${encodeURIComponent(accountId)}/persons`, params, options, {
methodType: 'list',
responseSchema: {
kind: 'object',
fields: {
data: {
kind: 'array',
element: {
kind: 'object',
fields: {
relationship: {
kind: 'object',
fields: { percent_ownership: { kind: 'decimal_string' } },
},
},
},
},
},
},
});
}
/**
* Create a Person. Adds an individual to an Account's identity. You can set relationship attributes and identity information at creation.
* @throws Stripe.RateLimitError
*/
create(accountId, params, options) {
return this._makeRequest('POST', `/v2/core/accounts/${encodeURIComponent(accountId)}/persons`, params, options, {
requestSchema: {
kind: 'object',
fields: {
relationship: {
kind: 'object',
fields: { percent_ownership: { kind: 'decimal_string' } },
},
},
},
responseSchema: {
kind: 'object',
fields: {
relationship: {
kind: 'object',
fields: { percent_ownership: { kind: 'decimal_string' } },
},
},
},
});
}
/**
* Delete a Person associated with an Account.
* @throws Stripe.RateLimitError
*/
del(accountId, id, params, options) {
return this._makeRequest('DELETE', `/v2/core/accounts/${encodeURIComponent(accountId)}/persons/${encodeURIComponent(id)}`, params, options);
}
/**
* Retrieves a Person associated with an Account.
* @throws Stripe.RateLimitError
*/
retrieve(accountId, id, params, options) {
return this._makeRequest('GET', `/v2/core/accounts/${encodeURIComponent(accountId)}/persons/${encodeURIComponent(id)}`, params, options, {
responseSchema: {
kind: 'object',
fields: {
relationship: {
kind: 'object',
fields: { percent_ownership: { kind: 'decimal_string' } },
},
},
},
});
}
/**
* Updates a Person associated with an Account.
* @throws Stripe.RateLimitError
*/
update(accountId, id, params, options) {
return this._makeRequest('POST', `/v2/core/accounts/${encodeURIComponent(accountId)}/persons/${encodeURIComponent(id)}`, params, options, {
requestSchema: {
kind: 'object',
fields: {
relationship: {
kind: 'object',
fields: { percent_ownership: { kind: 'decimal_string' } },
},
},
},
responseSchema: {
kind: 'object',
fields: {
relationship: {
kind: 'object',
fields: { percent_ownership: { kind: 'decimal_string' } },
},
},
},
});
}
}
//# sourceMappingURL=Persons.js.map

View File

@@ -0,0 +1 @@
{"version":3,"file":"Persons.js","sourceRoot":"","sources":["../../../../../src/resources/V2/Core/Accounts/Persons.ts"],"names":[],"mappings":"AAAA,uCAAuC;AAEvC,OAAO,EAAC,cAAc,EAAC,MAAM,+BAA+B,CAAC;AAW7D,MAAM,OAAO,cAAe,SAAQ,cAAc;IAChD;;;OAGG;IACH,IAAI,CACF,SAAiB,EACjB,MAA0C,EAC1C,OAAwB;QAExB,OAAO,IAAI,CAAC,YAAY,CACtB,KAAK,EACL,qBAAqB,kBAAkB,CAAC,SAAS,CAAC,UAAU,EAC5D,MAAM,EACN,OAAO,EACP;YACE,UAAU,EAAE,MAAM;YAClB,cAAc,EAAE;gBACd,IAAI,EAAE,QAAQ;gBACd,MAAM,EAAE;oBACN,IAAI,EAAE;wBACJ,IAAI,EAAE,OAAO;wBACb,OAAO,EAAE;4BACP,IAAI,EAAE,QAAQ;4BACd,MAAM,EAAE;gCACN,YAAY,EAAE;oCACZ,IAAI,EAAE,QAAQ;oCACd,MAAM,EAAE,EAAC,iBAAiB,EAAE,EAAC,IAAI,EAAE,gBAAgB,EAAC,EAAC;iCACtD;6BACF;yBACF;qBACF;iBACF;aACF;SACF,CACK,CAAC;IACX,CAAC;IACD;;;OAGG;IACH,MAAM,CACJ,SAAiB,EACjB,MAA4C,EAC5C,OAAwB;QAExB,OAAO,IAAI,CAAC,YAAY,CACtB,MAAM,EACN,qBAAqB,kBAAkB,CAAC,SAAS,CAAC,UAAU,EAC5D,MAAM,EACN,OAAO,EACP;YACE,aAAa,EAAE;gBACb,IAAI,EAAE,QAAQ;gBACd,MAAM,EAAE;oBACN,YAAY,EAAE;wBACZ,IAAI,EAAE,QAAQ;wBACd,MAAM,EAAE,EAAC,iBAAiB,EAAE,EAAC,IAAI,EAAE,gBAAgB,EAAC,EAAC;qBACtD;iBACF;aACF;YACD,cAAc,EAAE;gBACd,IAAI,EAAE,QAAQ;gBACd,MAAM,EAAE;oBACN,YAAY,EAAE;wBACZ,IAAI,EAAE,QAAQ;wBACd,MAAM,EAAE,EAAC,iBAAiB,EAAE,EAAC,IAAI,EAAE,gBAAgB,EAAC,EAAC;qBACtD;iBACF;aACF;SACF,CACK,CAAC;IACX,CAAC;IACD;;;OAGG;IACH,GAAG,CACD,SAAiB,EACjB,EAAU,EACV,MAA4C,EAC5C,OAAwB;QAExB,OAAO,IAAI,CAAC,YAAY,CACtB,QAAQ,EACR,qBAAqB,kBAAkB,CACrC,SAAS,CACV,YAAY,kBAAkB,CAAC,EAAE,CAAC,EAAE,EACrC,MAAM,EACN,OAAO,CACD,CAAC;IACX,CAAC;IACD;;;OAGG;IACH,QAAQ,CACN,SAAiB,EACjB,EAAU,EACV,MAA8C,EAC9C,OAAwB;QAExB,OAAO,IAAI,CAAC,YAAY,CACtB,KAAK,EACL,qBAAqB,kBAAkB,CACrC,SAAS,CACV,YAAY,kBAAkB,CAAC,EAAE,CAAC,EAAE,EACrC,MAAM,EACN,OAAO,EACP;YACE,cAAc,EAAE;gBACd,IAAI,EAAE,QAAQ;gBACd,MAAM,EAAE;oBACN,YAAY,EAAE;wBACZ,IAAI,EAAE,QAAQ;wBACd,MAAM,EAAE,EAAC,iBAAiB,EAAE,EAAC,IAAI,EAAE,gBAAgB,EAAC,EAAC;qBACtD;iBACF;aACF;SACF,CACK,CAAC;IACX,CAAC;IACD;;;OAGG;IACH,MAAM,CACJ,SAAiB,EACjB,EAAU,EACV,MAA4C,EAC5C,OAAwB;QAExB,OAAO,IAAI,CAAC,YAAY,CACtB,MAAM,EACN,qBAAqB,kBAAkB,CACrC,SAAS,CACV,YAAY,kBAAkB,CAAC,EAAE,CAAC,EAAE,EACrC,MAAM,EACN,OAAO,EACP;YACE,aAAa,EAAE;gBACb,IAAI,EAAE,QAAQ;gBACd,MAAM,EAAE;oBACN,YAAY,EAAE;wBACZ,IAAI,EAAE,QAAQ;wBACd,MAAM,EAAE,EAAC,iBAAiB,EAAE,EAAC,IAAI,EAAE,gBAAgB,EAAC,EAAC;qBACtD;iBACF;aACF;YACD,cAAc,EAAE;gBACd,IAAI,EAAE,QAAQ;gBACd,MAAM,EAAE;oBACN,YAAY,EAAE;wBACZ,IAAI,EAAE,QAAQ;wBACd,MAAM,EAAE,EAAC,iBAAiB,EAAE,EAAC,IAAI,EAAE,gBAAgB,EAAC,EAAC;qBACtD;iBACF;aACF;SACF,CACK,CAAC;IACX,CAAC;CACF"}

View File

@@ -0,0 +1,374 @@
import { StripeResource } from '../../../StripeResource.js';
import { Event } from './Events.js';
import { MetadataParam, Metadata } from '../../../shared.js';
import { RequestOptions, V2ListPromise, Response } from '../../../lib.js';
import { DeletedObject } from './../../V2/DeletedObject.js';
export declare class EventDestinationResource extends StripeResource {
/**
* Lists all event destinations.
*/
list(params?: V2.Core.EventDestinationListParams, options?: RequestOptions): V2ListPromise<EventDestination>;
/**
* Create a new event destination.
*/
create(params: V2.Core.EventDestinationCreateParams, options?: RequestOptions): Promise<Response<EventDestination>>;
/**
* Delete an event destination.
*/
del(id: string, params?: V2.Core.EventDestinationDeleteParams, options?: RequestOptions): Promise<Response<DeletedObject>>;
/**
* Retrieves the details of an event destination.
*/
retrieve(id: string, params?: V2.Core.EventDestinationRetrieveParams, options?: RequestOptions): Promise<Response<EventDestination>>;
/**
* Update the details of an event destination.
*/
update(id: string, params?: V2.Core.EventDestinationUpdateParams, options?: RequestOptions): Promise<Response<EventDestination>>;
/**
* Disable an event destination.
*/
disable(id: string, params?: V2.Core.EventDestinationDisableParams, options?: RequestOptions): Promise<Response<EventDestination>>;
/**
* Enable an event destination.
*/
enable(id: string, params?: V2.Core.EventDestinationEnableParams, options?: RequestOptions): Promise<Response<EventDestination>>;
/**
* Send a `ping` event to an event destination.
*/
ping(id: string, params?: V2.Core.EventDestinationPingParams, options?: RequestOptions): Promise<Response<Event>>;
}
export interface EventDestination {
/**
* Unique identifier for the object.
*/
id: string;
/**
* String representing the object's type. Objects of the same type share the same value of the object field.
*/
object: 'v2.core.event_destination';
/**
* Amazon EventBridge configuration.
*/
amazon_eventbridge?: V2.Core.EventDestination.AmazonEventbridge;
/**
* Azure Event Grid configuration.
*/
azure_event_grid?: V2.Core.EventDestination.AzureEventGrid;
/**
* Time at which the object was created.
*/
created: string;
/**
* An optional description of what the event destination is used for.
*/
description: string;
/**
* The list of events to enable for this endpoint.
*/
enabled_events: Array<string>;
/**
* Payload type of events being subscribed to.
*/
event_payload: V2.Core.EventDestination.EventPayload;
/**
* Specifies which accounts' events route to this destination.
* `@self`: Receive events from the account that owns the event destination.
* `@accounts`: Receive events emitted from other accounts you manage which includes your v1 and v2 accounts.
* `@organization_members`: Receive events from accounts directly linked to the organization.
* `@organization_members/@accounts`: Receive events from all accounts connected to any platform accounts in the organization.
*/
events_from?: Array<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;
/**
* Metadata.
*/
metadata?: Metadata;
/**
* Event destination name.
*/
name: string;
/**
* If using the snapshot event payload, the API version events are rendered as.
*/
snapshot_api_version?: string;
/**
* Status. It can be set to either enabled or disabled.
*/
status: V2.Core.EventDestination.Status;
/**
* Additional information about event destination status.
*/
status_details?: V2.Core.EventDestination.StatusDetails;
/**
* Event destination type.
*/
type: V2.Core.EventDestination.Type;
/**
* Time at which the object was last updated.
*/
updated: string;
/**
* Webhook endpoint configuration.
*/
webhook_endpoint?: V2.Core.EventDestination.WebhookEndpoint;
}
export declare namespace V2 {
namespace Core {
namespace EventDestination {
interface AmazonEventbridge {
/**
* The AWS account ID.
*/
aws_account_id: string;
/**
* The ARN of the AWS event source.
*/
aws_event_source_arn: string;
/**
* The state of the AWS event source.
*/
aws_event_source_status: AmazonEventbridge.AwsEventSourceStatus;
}
interface AzureEventGrid {
/**
* The name of the Azure partner topic.
*/
azure_partner_topic_name: string;
/**
* The status of the Azure partner topic.
*/
azure_partner_topic_status: AzureEventGrid.AzurePartnerTopicStatus;
/**
* The Azure region.
*/
azure_region: string;
/**
* The name of the Azure resource group.
*/
azure_resource_group_name: string;
/**
* The Azure subscription ID.
*/
azure_subscription_id: string;
}
type EventPayload = 'snapshot' | 'thin';
type Status = 'disabled' | 'enabled';
interface StatusDetails {
/**
* Details about why the event destination has been disabled.
*/
disabled?: StatusDetails.Disabled;
}
type Type = 'amazon_eventbridge' | 'azure_event_grid' | 'webhook_endpoint';
interface WebhookEndpoint {
/**
* The signing secret of the webhook endpoint, only includable on creation.
*/
signing_secret?: string;
/**
* The URL of the webhook endpoint, includable.
*/
url?: string;
}
namespace AmazonEventbridge {
type AwsEventSourceStatus = 'active' | 'deleted' | 'pending' | 'unknown';
}
namespace AzureEventGrid {
type AzurePartnerTopicStatus = 'activated' | 'deleted' | 'never_activated' | 'unknown';
}
namespace StatusDetails {
interface Disabled {
/**
* Reason event destination has been disabled.
*/
reason: Disabled.Reason;
}
namespace Disabled {
type Reason = 'no_aws_event_source_exists' | 'no_azure_partner_topic_exists' | 'user';
}
}
}
}
}
export declare namespace V2 {
namespace Core {
interface EventDestinationCreateParams {
/**
* The list of events to enable for this endpoint.
*/
enabled_events: Array<string>;
/**
* Payload type of events being subscribed to.
*/
event_payload: EventDestinationCreateParams.EventPayload;
/**
* Event destination name.
*/
name: string;
/**
* Event destination type.
*/
type: EventDestinationCreateParams.Type;
/**
* Amazon EventBridge configuration.
*/
amazon_eventbridge?: EventDestinationCreateParams.AmazonEventbridge;
/**
* Azure Event Grid configuration.
*/
azure_event_grid?: EventDestinationCreateParams.AzureEventGrid;
/**
* An optional description of what the event destination is used for.
*/
description?: string;
/**
* Specifies which accounts' events route to this destination.
* `@self`: Receive events from the account that owns the event destination.
* `@accounts`: Receive events emitted from other accounts you manage which includes your v1 and v2 accounts.
* `@organization_members`: Receive events from accounts directly linked to the organization.
* `@organization_members/@accounts`: Receive events from all accounts connected to any platform accounts in the organization.
*/
events_from?: Array<string>;
/**
* Additional fields to include in the response.
*/
include?: Array<EventDestinationCreateParams.Include>;
/**
* Metadata.
*/
metadata?: MetadataParam;
/**
* If using the snapshot event payload, the API version events are rendered as.
*/
snapshot_api_version?: string;
/**
* Webhook endpoint configuration.
*/
webhook_endpoint?: EventDestinationCreateParams.WebhookEndpoint;
}
namespace EventDestinationCreateParams {
type EventPayload = 'snapshot' | 'thin';
type Type = 'amazon_eventbridge' | 'azure_event_grid' | 'webhook_endpoint';
interface AmazonEventbridge {
/**
* The AWS account ID.
*/
aws_account_id: string;
/**
* The region of the AWS event source.
*/
aws_region: string;
}
interface AzureEventGrid {
/**
* The Azure region.
*/
azure_region: string;
/**
* The name of the Azure resource group.
*/
azure_resource_group_name: string;
/**
* The Azure subscription ID.
*/
azure_subscription_id: string;
}
type Include = 'webhook_endpoint.signing_secret' | 'webhook_endpoint.url';
interface WebhookEndpoint {
/**
* The URL of the webhook endpoint.
*/
url: string;
}
}
}
}
export declare namespace V2 {
namespace Core {
interface EventDestinationRetrieveParams {
/**
* Additional fields to include in the response.
*/
include?: Array<'webhook_endpoint.url'>;
}
}
}
export declare namespace V2 {
namespace Core {
interface EventDestinationUpdateParams {
/**
* An optional description of what the event destination is used for.
*/
description?: string;
/**
* The list of events to enable for this endpoint.
*/
enabled_events?: Array<string>;
/**
* Additional fields to include in the response. Currently supports `webhook_endpoint.url`.
*/
include?: Array<'webhook_endpoint.url'>;
/**
* Metadata.
*/
metadata?: MetadataParam;
/**
* Event destination name.
*/
name?: string;
/**
* Webhook endpoint configuration.
*/
webhook_endpoint?: EventDestinationUpdateParams.WebhookEndpoint;
}
namespace EventDestinationUpdateParams {
interface WebhookEndpoint {
/**
* The URL of the webhook endpoint.
*/
url: string;
}
}
}
}
export declare namespace V2 {
namespace Core {
interface EventDestinationListParams {
/**
* Additional fields to include in the response. Currently supports `webhook_endpoint.url`.
*/
include?: Array<'webhook_endpoint.url'>;
/**
* The page size.
*/
limit?: number;
}
}
}
export declare namespace V2 {
namespace Core {
interface EventDestinationDeleteParams {
}
}
}
export declare namespace V2 {
namespace Core {
interface EventDestinationDisableParams {
}
}
}
export declare namespace V2 {
namespace Core {
interface EventDestinationEnableParams {
}
}
}
export declare namespace V2 {
namespace Core {
interface EventDestinationPingParams {
}
}
}

View File

@@ -0,0 +1,55 @@
// File generated from our OpenAPI spec
import { StripeResource } from '../../../StripeResource.js';
export class EventDestinationResource extends StripeResource {
/**
* Lists all event destinations.
*/
list(params, options) {
return this._makeRequest('GET', '/v2/core/event_destinations', params, options, {
methodType: 'list',
});
}
/**
* Create a new event destination.
*/
create(params, options) {
return this._makeRequest('POST', '/v2/core/event_destinations', params, options);
}
/**
* Delete an event destination.
*/
del(id, params, options) {
return this._makeRequest('DELETE', `/v2/core/event_destinations/${encodeURIComponent(id)}`, params, options);
}
/**
* Retrieves the details of an event destination.
*/
retrieve(id, params, options) {
return this._makeRequest('GET', `/v2/core/event_destinations/${encodeURIComponent(id)}`, params, options);
}
/**
* Update the details of an event destination.
*/
update(id, params, options) {
return this._makeRequest('POST', `/v2/core/event_destinations/${encodeURIComponent(id)}`, params, options);
}
/**
* Disable an event destination.
*/
disable(id, params, options) {
return this._makeRequest('POST', `/v2/core/event_destinations/${encodeURIComponent(id)}/disable`, params, options);
}
/**
* Enable an event destination.
*/
enable(id, params, options) {
return this._makeRequest('POST', `/v2/core/event_destinations/${encodeURIComponent(id)}/enable`, params, options);
}
/**
* Send a `ping` event to an event destination.
*/
ping(id, params, options) {
return this._makeRequest('POST', `/v2/core/event_destinations/${encodeURIComponent(id)}/ping`, params, options);
}
}
//# sourceMappingURL=EventDestinations.js.map

View File

@@ -0,0 +1 @@
{"version":3,"file":"EventDestinations.js","sourceRoot":"","sources":["../../../../src/resources/V2/Core/EventDestinations.ts"],"names":[],"mappings":"AAAA,uCAAuC;AAEvC,OAAO,EAAC,cAAc,EAAC,MAAM,4BAA4B,CAAC;AAM1D,MAAM,OAAO,wBAAyB,SAAQ,cAAc;IAC1D;;OAEG;IACH,IAAI,CACF,MAA2C,EAC3C,OAAwB;QAExB,OAAO,IAAI,CAAC,YAAY,CACtB,KAAK,EACL,6BAA6B,EAC7B,MAAM,EACN,OAAO,EACP;YACE,UAAU,EAAE,MAAM;SACnB,CACK,CAAC;IACX,CAAC;IACD;;OAEG;IACH,MAAM,CACJ,MAA4C,EAC5C,OAAwB;QAExB,OAAO,IAAI,CAAC,YAAY,CACtB,MAAM,EACN,6BAA6B,EAC7B,MAAM,EACN,OAAO,CACD,CAAC;IACX,CAAC;IACD;;OAEG;IACH,GAAG,CACD,EAAU,EACV,MAA6C,EAC7C,OAAwB;QAExB,OAAO,IAAI,CAAC,YAAY,CACtB,QAAQ,EACR,+BAA+B,kBAAkB,CAAC,EAAE,CAAC,EAAE,EACvD,MAAM,EACN,OAAO,CACD,CAAC;IACX,CAAC;IACD;;OAEG;IACH,QAAQ,CACN,EAAU,EACV,MAA+C,EAC/C,OAAwB;QAExB,OAAO,IAAI,CAAC,YAAY,CACtB,KAAK,EACL,+BAA+B,kBAAkB,CAAC,EAAE,CAAC,EAAE,EACvD,MAAM,EACN,OAAO,CACD,CAAC;IACX,CAAC;IACD;;OAEG;IACH,MAAM,CACJ,EAAU,EACV,MAA6C,EAC7C,OAAwB;QAExB,OAAO,IAAI,CAAC,YAAY,CACtB,MAAM,EACN,+BAA+B,kBAAkB,CAAC,EAAE,CAAC,EAAE,EACvD,MAAM,EACN,OAAO,CACD,CAAC;IACX,CAAC;IACD;;OAEG;IACH,OAAO,CACL,EAAU,EACV,MAA8C,EAC9C,OAAwB;QAExB,OAAO,IAAI,CAAC,YAAY,CACtB,MAAM,EACN,+BAA+B,kBAAkB,CAAC,EAAE,CAAC,UAAU,EAC/D,MAAM,EACN,OAAO,CACD,CAAC;IACX,CAAC;IACD;;OAEG;IACH,MAAM,CACJ,EAAU,EACV,MAA6C,EAC7C,OAAwB;QAExB,OAAO,IAAI,CAAC,YAAY,CACtB,MAAM,EACN,+BAA+B,kBAAkB,CAAC,EAAE,CAAC,SAAS,EAC9D,MAAM,EACN,OAAO,CACD,CAAC;IACX,CAAC;IACD;;OAEG;IACH,IAAI,CACF,EAAU,EACV,MAA2C,EAC3C,OAAwB;QAExB,OAAO,IAAI,CAAC,YAAY,CACtB,MAAM,EACN,+BAA+B,kBAAkB,CAAC,EAAE,CAAC,OAAO,EAC5D,MAAM,EACN,OAAO,CACD,CAAC;IACX,CAAC;CACF"}

708
node_modules/stripe/esm/resources/V2/Core/Events.d.ts generated vendored Normal file
View File

@@ -0,0 +1,708 @@
import { StripeResource } from '../../../StripeResource.js';
import { RangeQueryParam } from '../../../shared.js';
import { RequestOptions, V2ListPromise, Response } from '../../../lib.js';
export declare class EventResource extends StripeResource {
/**
* List events, going back up to 30 days.
*/
list(params?: V2.Core.EventListParams, options?: RequestOptions): V2ListPromise<Event>;
/**
* Retrieves the details of an event if it was created in the last 30 days. Supply the unique
* identifier of the event, which might have been delivered to your event destination.
*/
retrieve(id: string, params?: V2.Core.EventRetrieveParams, options?: RequestOptions): Promise<Response<Event>>;
/**
* @private
*
* For internal use in stripe-node.
*
* @param pulledEvent The retrieved event object
* @returns The retrieved event object with a fetchRelatedObject method,
* if pulledEvent.related_object is valid (non-null and has a url)
*/
addFetchRelatedObjectIfNeeded(pulledEvent: any): any;
}
export interface EventBase {
/**
* Unique identifier for the event.
*/
id: string;
/**
* String representing the object's type. Objects of the same type share the same value of the object field.
*/
object: 'v2.core.event';
/**
* Before and after changes for the primary related object.
*/
changes?: V2.Core.Event.Changes;
/**
* Authentication context needed to fetch the event or related object.
*/
context?: string;
/**
* Time at which the object was created.
*/
created: 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;
/**
* Reason for the event.
*/
reason?: V2.Core.Event.Reason;
/**
* The type of the event.
*/
type: string;
}
export declare namespace V2 {
namespace Core {
namespace Event {
type Changes = {
[key: string]: unknown;
};
interface Reason {
/**
* Information on the API request that instigated the event.
*/
request?: Reason.Request;
/**
* Event reason type.
*/
type: 'request';
}
namespace Reason {
interface Request {
/**
* ID of the API request that caused the event.
*/
id: string;
/**
* The idempotency key transmitted during the request.
*/
idempotency_key: string;
}
}
}
}
}
export declare namespace V2 {
namespace Core {
interface EventRetrieveParams {
}
}
}
export declare namespace V2 {
namespace Core {
interface EventListParams {
/**
* Set of filters to query events within a range of `created` timestamps.
*/
created?: RangeQueryParam;
/**
* The page size.
*/
limit?: number;
/**
* Primary object ID used to retrieve related events.
*/
object_id?: string;
/**
* An array of up to 20 strings containing specific event names.
*/
types?: Array<string>;
}
}
}
import { Core } from './index.js';
import { Billing as V1Billing } from './../../Billing/index.js';
import { Commerce } from './../Commerce/index.js';
export type Event = V1BillingMeterErrorReportTriggeredEvent | V1BillingMeterNoMeterFoundEvent | V2CommerceProductCatalogImportsFailedEvent | V2CommerceProductCatalogImportsProcessingEvent | V2CommerceProductCatalogImportsSucceededEvent | V2CommerceProductCatalogImportsSucceededWithErrorsEvent | V2CoreAccountClosedEvent | V2CoreAccountCreatedEvent | V2CoreAccountUpdatedEvent | V2CoreAccountIncludingConfigurationCustomerCapabilityStatusUpdatedEvent | V2CoreAccountIncludingConfigurationCustomerUpdatedEvent | V2CoreAccountIncludingConfigurationMerchantCapabilityStatusUpdatedEvent | V2CoreAccountIncludingConfigurationMerchantUpdatedEvent | V2CoreAccountIncludingConfigurationRecipientCapabilityStatusUpdatedEvent | V2CoreAccountIncludingConfigurationRecipientUpdatedEvent | V2CoreAccountIncludingDefaultsUpdatedEvent | V2CoreAccountIncludingFutureRequirementsUpdatedEvent | V2CoreAccountIncludingIdentityUpdatedEvent | V2CoreAccountIncludingRequirementsUpdatedEvent | V2CoreAccountLinkReturnedEvent | V2CoreAccountPersonCreatedEvent | V2CoreAccountPersonDeletedEvent | V2CoreAccountPersonUpdatedEvent | V2CoreEventDestinationPingEvent;
export type EventNotification = V1BillingMeterErrorReportTriggeredEventNotification | V1BillingMeterNoMeterFoundEventNotification | V2CommerceProductCatalogImportsFailedEventNotification | V2CommerceProductCatalogImportsProcessingEventNotification | V2CommerceProductCatalogImportsSucceededEventNotification | V2CommerceProductCatalogImportsSucceededWithErrorsEventNotification | V2CoreAccountClosedEventNotification | V2CoreAccountCreatedEventNotification | V2CoreAccountUpdatedEventNotification | V2CoreAccountIncludingConfigurationCustomerCapabilityStatusUpdatedEventNotification | V2CoreAccountIncludingConfigurationCustomerUpdatedEventNotification | V2CoreAccountIncludingConfigurationMerchantCapabilityStatusUpdatedEventNotification | V2CoreAccountIncludingConfigurationMerchantUpdatedEventNotification | V2CoreAccountIncludingConfigurationRecipientCapabilityStatusUpdatedEventNotification | V2CoreAccountIncludingConfigurationRecipientUpdatedEventNotification | V2CoreAccountIncludingDefaultsUpdatedEventNotification | V2CoreAccountIncludingFutureRequirementsUpdatedEventNotification | V2CoreAccountIncludingIdentityUpdatedEventNotification | V2CoreAccountIncludingRequirementsUpdatedEventNotification | V2CoreAccountLinkReturnedEventNotification | V2CoreAccountPersonCreatedEventNotification | V2CoreAccountPersonDeletedEventNotification | V2CoreAccountPersonUpdatedEventNotification | V2CoreEventDestinationPingEventNotification;
import { StripeContext } from '../../../StripeContext.js';
export declare namespace V2 {
namespace Core {
namespace Events {
interface RelatedObject {
/**
* Unique identifier for the object relevant to the event.
*/ id: string;
/**
* Type of the object relevant to the event.
*/ type: string;
/**
* URL to retrieve the resource.
*/ url: string;
}
}
}
}
/**
* Represents the shape of an EventNotification that the SDK didn't know about when it was generated.
*/ export interface UnknownEventNotification extends EventNotificationBase {
/**
* Object containing the reference to API resource relevant to the event.
*/ related_object: V2.Core.Events.RelatedObject | null;
/**
* Fetches the full object corresponding to the `related_object` field. Returns `null` if there is no `related_object`.
*/ fetchRelatedObject: () => Promise<unknown>;
/**
* Fetches the full Event object corresponding to this notification.
*/ fetchEvent: () => Promise<EventBase>;
}
export interface EventNotificationBase extends Omit<EventBase, 'context'> {
context?: StripeContext;
}
/**
* Occurs when a Meter has invalid async usage events.
*/
export interface V1BillingMeterErrorReportTriggeredEvent extends EventBase {
type: 'v1.billing.meter.error_report_triggered';
data: V1BillingMeterErrorReportTriggeredEvent.Data;
related_object: V2.Core.Events.RelatedObject;
fetchRelatedObject(): Promise<V1Billing.Meter>;
}
export interface V1BillingMeterErrorReportTriggeredEventNotification extends EventNotificationBase {
type: 'v1.billing.meter.error_report_triggered';
related_object: V2.Core.Events.RelatedObject;
fetchRelatedObject(): Promise<V1Billing.Meter>;
fetchEvent(): Promise<V1BillingMeterErrorReportTriggeredEvent>;
}
export declare namespace V1BillingMeterErrorReportTriggeredEvent {
interface Data {
/**
* Extra field included in the event's `data` when fetched from /v2/events.
*/
developer_message_summary: string;
/**
* This contains information about why meter error happens.
*/
reason: Data.Reason;
/**
* The end of the window that is encapsulated by this summary.
*/
validation_end: string;
/**
* The start of the window that is encapsulated by this summary.
*/
validation_start: string;
}
namespace Data {
interface Reason {
/**
* The total error count within this window.
*/
error_count: number;
/**
* The error details.
*/
error_types: Array<Reason.ErrorType>;
}
namespace Reason {
interface ErrorType {
/**
* Open Enum.
*/
code: ErrorType.Code;
/**
* The number of errors of this type.
*/
error_count: number;
/**
* A list of sample errors of this type.
*/
sample_errors: Array<ErrorType.SampleError>;
}
namespace ErrorType {
type Code = 'archived_meter' | 'meter_event_customer_not_found' | 'meter_event_dimension_count_too_high' | 'meter_event_invalid_value' | 'meter_event_no_customer_defined' | 'meter_event_value_too_many_digits' | 'missing_dimension_payload_keys' | 'no_meter' | 'timestamp_in_future' | 'timestamp_too_far_in_past';
interface SampleError {
/**
* The error message.
*/
error_message: string;
/**
* The request causes the error.
*/
request: SampleError.Request;
}
namespace SampleError {
interface Request {
/**
* The request idempotency key.
*/
identifier: string;
}
}
}
}
}
}
/**
* Occurs when a Meter's id is missing or invalid in async usage events.
*/
export interface V1BillingMeterNoMeterFoundEvent extends EventBase {
type: 'v1.billing.meter.no_meter_found';
data: V1BillingMeterNoMeterFoundEvent.Data;
}
export interface V1BillingMeterNoMeterFoundEventNotification extends EventNotificationBase {
type: 'v1.billing.meter.no_meter_found';
fetchEvent(): Promise<V1BillingMeterNoMeterFoundEvent>;
}
export declare namespace V1BillingMeterNoMeterFoundEvent {
interface Data {
/**
* Extra field included in the event's `data` when fetched from /v2/events.
*/
developer_message_summary: string;
/**
* This contains information about why meter error happens.
*/
reason: Data.Reason;
/**
* The end of the window that is encapsulated by this summary.
*/
validation_end: string;
/**
* The start of the window that is encapsulated by this summary.
*/
validation_start: string;
}
namespace Data {
interface Reason {
/**
* The total error count within this window.
*/
error_count: number;
/**
* The error details.
*/
error_types: Array<Reason.ErrorType>;
}
namespace Reason {
interface ErrorType {
/**
* Open Enum.
*/
code: ErrorType.Code;
/**
* The number of errors of this type.
*/
error_count: number;
/**
* A list of sample errors of this type.
*/
sample_errors: Array<ErrorType.SampleError>;
}
namespace ErrorType {
type Code = 'archived_meter' | 'meter_event_customer_not_found' | 'meter_event_dimension_count_too_high' | 'meter_event_invalid_value' | 'meter_event_no_customer_defined' | 'meter_event_value_too_many_digits' | 'missing_dimension_payload_keys' | 'no_meter' | 'timestamp_in_future' | 'timestamp_too_far_in_past';
interface SampleError {
/**
* The error message.
*/
error_message: string;
/**
* The request causes the error.
*/
request: SampleError.Request;
}
namespace SampleError {
interface Request {
/**
* The request idempotency key.
*/
identifier: string;
}
}
}
}
}
}
/**
* Occurs when a product catalog import cannot be processed or if processing fails unexpectedly.
*/
export interface V2CommerceProductCatalogImportsFailedEvent extends EventBase {
type: 'v2.commerce.product_catalog.imports.failed';
related_object: V2.Core.Events.RelatedObject;
fetchRelatedObject(): Promise<Commerce.ProductCatalogImport>;
}
export interface V2CommerceProductCatalogImportsFailedEventNotification extends EventNotificationBase {
type: 'v2.commerce.product_catalog.imports.failed';
related_object: V2.Core.Events.RelatedObject;
fetchRelatedObject(): Promise<Commerce.ProductCatalogImport>;
fetchEvent(): Promise<V2CommerceProductCatalogImportsFailedEvent>;
}
/**
* Occurs when a product catalog import file has been uploaded and has started processing.
*/
export interface V2CommerceProductCatalogImportsProcessingEvent extends EventBase {
type: 'v2.commerce.product_catalog.imports.processing';
related_object: V2.Core.Events.RelatedObject;
fetchRelatedObject(): Promise<Commerce.ProductCatalogImport>;
}
export interface V2CommerceProductCatalogImportsProcessingEventNotification extends EventNotificationBase {
type: 'v2.commerce.product_catalog.imports.processing';
related_object: V2.Core.Events.RelatedObject;
fetchRelatedObject(): Promise<Commerce.ProductCatalogImport>;
fetchEvent(): Promise<V2CommerceProductCatalogImportsProcessingEvent>;
}
/**
* Occurs when a product catalog file has been uploaded successfully and passed validation.
*/
export interface V2CommerceProductCatalogImportsSucceededEvent extends EventBase {
type: 'v2.commerce.product_catalog.imports.succeeded';
related_object: V2.Core.Events.RelatedObject;
fetchRelatedObject(): Promise<Commerce.ProductCatalogImport>;
}
export interface V2CommerceProductCatalogImportsSucceededEventNotification extends EventNotificationBase {
type: 'v2.commerce.product_catalog.imports.succeeded';
related_object: V2.Core.Events.RelatedObject;
fetchRelatedObject(): Promise<Commerce.ProductCatalogImport>;
fetchEvent(): Promise<V2CommerceProductCatalogImportsSucceededEvent>;
}
/**
* Occurs when a product catalog file has been successfully processed but some rows failed validation.
*/
export interface V2CommerceProductCatalogImportsSucceededWithErrorsEvent extends EventBase {
type: 'v2.commerce.product_catalog.imports.succeeded_with_errors';
related_object: V2.Core.Events.RelatedObject;
fetchRelatedObject(): Promise<Commerce.ProductCatalogImport>;
}
export interface V2CommerceProductCatalogImportsSucceededWithErrorsEventNotification extends EventNotificationBase {
type: 'v2.commerce.product_catalog.imports.succeeded_with_errors';
related_object: V2.Core.Events.RelatedObject;
fetchRelatedObject(): Promise<Commerce.ProductCatalogImport>;
fetchEvent(): Promise<V2CommerceProductCatalogImportsSucceededWithErrorsEvent>;
}
/**
* This event occurs when an account is closed.
*/
export interface V2CoreAccountClosedEvent extends EventBase {
type: 'v2.core.account.closed';
related_object: V2.Core.Events.RelatedObject;
fetchRelatedObject(): Promise<Core.Account>;
}
export interface V2CoreAccountClosedEventNotification extends EventNotificationBase {
type: 'v2.core.account.closed';
related_object: V2.Core.Events.RelatedObject;
fetchRelatedObject(): Promise<Core.Account>;
fetchEvent(): Promise<V2CoreAccountClosedEvent>;
}
/**
* Occurs when an Account is created.
*/
export interface V2CoreAccountCreatedEvent extends EventBase {
type: 'v2.core.account.created';
related_object: V2.Core.Events.RelatedObject;
fetchRelatedObject(): Promise<Core.Account>;
}
export interface V2CoreAccountCreatedEventNotification extends EventNotificationBase {
type: 'v2.core.account.created';
related_object: V2.Core.Events.RelatedObject;
fetchRelatedObject(): Promise<Core.Account>;
fetchEvent(): Promise<V2CoreAccountCreatedEvent>;
}
/**
* Occurs when an Account is updated.
*/
export interface V2CoreAccountUpdatedEvent extends EventBase {
type: 'v2.core.account.updated';
related_object: V2.Core.Events.RelatedObject;
fetchRelatedObject(): Promise<Core.Account>;
}
export interface V2CoreAccountUpdatedEventNotification extends EventNotificationBase {
type: 'v2.core.account.updated';
related_object: V2.Core.Events.RelatedObject;
fetchRelatedObject(): Promise<Core.Account>;
fetchEvent(): Promise<V2CoreAccountUpdatedEvent>;
}
/**
* Occurs when the status of an Account's customer configuration capability is updated.
*/
export interface V2CoreAccountIncludingConfigurationCustomerCapabilityStatusUpdatedEvent extends EventBase {
type: 'v2.core.account[configuration.customer].capability_status_updated';
data: V2CoreAccountIncludingConfigurationCustomerCapabilityStatusUpdatedEvent.Data;
related_object: V2.Core.Events.RelatedObject;
fetchRelatedObject(): Promise<Core.Account>;
}
export interface V2CoreAccountIncludingConfigurationCustomerCapabilityStatusUpdatedEventNotification extends EventNotificationBase {
type: 'v2.core.account[configuration.customer].capability_status_updated';
related_object: V2.Core.Events.RelatedObject;
fetchRelatedObject(): Promise<Core.Account>;
fetchEvent(): Promise<V2CoreAccountIncludingConfigurationCustomerCapabilityStatusUpdatedEvent>;
}
export declare namespace V2CoreAccountIncludingConfigurationCustomerCapabilityStatusUpdatedEvent {
interface Data {
/**
* Open Enum. The capability which had its status updated.
*/
updated_capability: 'automatic_indirect_tax';
}
}
/**
* Occurs when an Account's customer configuration is updated.
*/
export interface V2CoreAccountIncludingConfigurationCustomerUpdatedEvent extends EventBase {
type: 'v2.core.account[configuration.customer].updated';
related_object: V2.Core.Events.RelatedObject;
fetchRelatedObject(): Promise<Core.Account>;
}
export interface V2CoreAccountIncludingConfigurationCustomerUpdatedEventNotification extends EventNotificationBase {
type: 'v2.core.account[configuration.customer].updated';
related_object: V2.Core.Events.RelatedObject;
fetchRelatedObject(): Promise<Core.Account>;
fetchEvent(): Promise<V2CoreAccountIncludingConfigurationCustomerUpdatedEvent>;
}
/**
* Occurs when the status of an Account's merchant configuration capability is updated.
*/
export interface V2CoreAccountIncludingConfigurationMerchantCapabilityStatusUpdatedEvent extends EventBase {
type: 'v2.core.account[configuration.merchant].capability_status_updated';
data: V2CoreAccountIncludingConfigurationMerchantCapabilityStatusUpdatedEvent.Data;
related_object: V2.Core.Events.RelatedObject;
fetchRelatedObject(): Promise<Core.Account>;
}
export interface V2CoreAccountIncludingConfigurationMerchantCapabilityStatusUpdatedEventNotification extends EventNotificationBase {
type: 'v2.core.account[configuration.merchant].capability_status_updated';
related_object: V2.Core.Events.RelatedObject;
fetchRelatedObject(): Promise<Core.Account>;
fetchEvent(): Promise<V2CoreAccountIncludingConfigurationMerchantCapabilityStatusUpdatedEvent>;
}
export declare namespace V2CoreAccountIncludingConfigurationMerchantCapabilityStatusUpdatedEvent {
interface Data {
/**
* Open Enum. The capability which had its status updated.
*/
updated_capability: Data.UpdatedCapability;
}
namespace Data {
type UpdatedCapability = 'ach_debit_payments' | 'acss_debit_payments' | 'affirm_payments' | 'afterpay_clearpay_payments' | 'alma_payments' | 'amazon_pay_payments' | 'au_becs_debit_payments' | 'bacs_debit_payments' | 'bancontact_payments' | 'blik_payments' | 'boleto_payments' | 'card_payments' | 'cartes_bancaires_payments' | 'cashapp_payments' | 'eps_payments' | 'fpx_payments' | 'gb_bank_transfer_payments' | 'grabpay_payments' | 'ideal_payments' | 'jcb_payments' | 'jp_bank_transfer_payments' | 'kakao_pay_payments' | 'klarna_payments' | 'konbini_payments' | 'kr_card_payments' | 'link_payments' | 'mobilepay_payments' | 'multibanco_payments' | 'mx_bank_transfer_payments' | 'naver_pay_payments' | 'oxxo_payments' | 'p24_payments' | 'payco_payments' | 'paynow_payments' | 'stripe_balance.payouts' | 'pay_by_bank_payments' | 'promptpay_payments' | 'revolut_pay_payments' | 'samsung_pay_payments' | 'sepa_bank_transfer_payments' | 'sepa_debit_payments' | 'swish_payments' | 'twint_payments' | 'us_bank_transfer_payments' | 'zip_payments';
}
}
/**
* Occurs when an Account's merchant configuration is updated.
*/
export interface V2CoreAccountIncludingConfigurationMerchantUpdatedEvent extends EventBase {
type: 'v2.core.account[configuration.merchant].updated';
related_object: V2.Core.Events.RelatedObject;
fetchRelatedObject(): Promise<Core.Account>;
}
export interface V2CoreAccountIncludingConfigurationMerchantUpdatedEventNotification extends EventNotificationBase {
type: 'v2.core.account[configuration.merchant].updated';
related_object: V2.Core.Events.RelatedObject;
fetchRelatedObject(): Promise<Core.Account>;
fetchEvent(): Promise<V2CoreAccountIncludingConfigurationMerchantUpdatedEvent>;
}
/**
* Occurs when the status of an Account's recipient configuration capability is updated.
*/
export interface V2CoreAccountIncludingConfigurationRecipientCapabilityStatusUpdatedEvent extends EventBase {
type: 'v2.core.account[configuration.recipient].capability_status_updated';
data: V2CoreAccountIncludingConfigurationRecipientCapabilityStatusUpdatedEvent.Data;
related_object: V2.Core.Events.RelatedObject;
fetchRelatedObject(): Promise<Core.Account>;
}
export interface V2CoreAccountIncludingConfigurationRecipientCapabilityStatusUpdatedEventNotification extends EventNotificationBase {
type: 'v2.core.account[configuration.recipient].capability_status_updated';
related_object: V2.Core.Events.RelatedObject;
fetchRelatedObject(): Promise<Core.Account>;
fetchEvent(): Promise<V2CoreAccountIncludingConfigurationRecipientCapabilityStatusUpdatedEvent>;
}
export declare namespace V2CoreAccountIncludingConfigurationRecipientCapabilityStatusUpdatedEvent {
interface Data {
/**
* Open Enum. The capability which had its status updated.
*/
updated_capability: Data.UpdatedCapability;
}
namespace Data {
type UpdatedCapability = 'bank_accounts.local' | 'bank_accounts.wire' | 'cards' | 'stripe_balance.payouts' | 'stripe_balance.stripe_transfers' | 'stripe.transfers';
}
}
/**
* Occurs when a Recipient's configuration is updated.
*/
export interface V2CoreAccountIncludingConfigurationRecipientUpdatedEvent extends EventBase {
type: 'v2.core.account[configuration.recipient].updated';
related_object: V2.Core.Events.RelatedObject;
fetchRelatedObject(): Promise<Core.Account>;
}
export interface V2CoreAccountIncludingConfigurationRecipientUpdatedEventNotification extends EventNotificationBase {
type: 'v2.core.account[configuration.recipient].updated';
related_object: V2.Core.Events.RelatedObject;
fetchRelatedObject(): Promise<Core.Account>;
fetchEvent(): Promise<V2CoreAccountIncludingConfigurationRecipientUpdatedEvent>;
}
/**
* This event occurs when account defaults are created or updated.
*/
export interface V2CoreAccountIncludingDefaultsUpdatedEvent extends EventBase {
type: 'v2.core.account[defaults].updated';
related_object: V2.Core.Events.RelatedObject;
fetchRelatedObject(): Promise<Core.Account>;
}
export interface V2CoreAccountIncludingDefaultsUpdatedEventNotification extends EventNotificationBase {
type: 'v2.core.account[defaults].updated';
related_object: V2.Core.Events.RelatedObject;
fetchRelatedObject(): Promise<Core.Account>;
fetchEvent(): Promise<V2CoreAccountIncludingDefaultsUpdatedEvent>;
}
/**
* Occurs when an Account's future requirements are updated.
*/
export interface V2CoreAccountIncludingFutureRequirementsUpdatedEvent extends EventBase {
type: 'v2.core.account[future_requirements].updated';
related_object: V2.Core.Events.RelatedObject;
fetchRelatedObject(): Promise<Core.Account>;
}
export interface V2CoreAccountIncludingFutureRequirementsUpdatedEventNotification extends EventNotificationBase {
type: 'v2.core.account[future_requirements].updated';
related_object: V2.Core.Events.RelatedObject;
fetchRelatedObject(): Promise<Core.Account>;
fetchEvent(): Promise<V2CoreAccountIncludingFutureRequirementsUpdatedEvent>;
}
/**
* Occurs when an Identity is updated.
*/
export interface V2CoreAccountIncludingIdentityUpdatedEvent extends EventBase {
type: 'v2.core.account[identity].updated';
related_object: V2.Core.Events.RelatedObject;
fetchRelatedObject(): Promise<Core.Account>;
}
export interface V2CoreAccountIncludingIdentityUpdatedEventNotification extends EventNotificationBase {
type: 'v2.core.account[identity].updated';
related_object: V2.Core.Events.RelatedObject;
fetchRelatedObject(): Promise<Core.Account>;
fetchEvent(): Promise<V2CoreAccountIncludingIdentityUpdatedEvent>;
}
/**
* Occurs when an Account's requirements are updated.
*/
export interface V2CoreAccountIncludingRequirementsUpdatedEvent extends EventBase {
type: 'v2.core.account[requirements].updated';
related_object: V2.Core.Events.RelatedObject;
fetchRelatedObject(): Promise<Core.Account>;
}
export interface V2CoreAccountIncludingRequirementsUpdatedEventNotification extends EventNotificationBase {
type: 'v2.core.account[requirements].updated';
related_object: V2.Core.Events.RelatedObject;
fetchRelatedObject(): Promise<Core.Account>;
fetchEvent(): Promise<V2CoreAccountIncludingRequirementsUpdatedEvent>;
}
/**
* Occurs when the generated AccountLink is completed.
*/
export interface V2CoreAccountLinkReturnedEvent extends EventBase {
type: 'v2.core.account_link.returned';
data: V2CoreAccountLinkReturnedEvent.Data;
}
export interface V2CoreAccountLinkReturnedEventNotification extends EventNotificationBase {
type: 'v2.core.account_link.returned';
fetchEvent(): Promise<V2CoreAccountLinkReturnedEvent>;
}
export declare namespace V2CoreAccountLinkReturnedEvent {
interface Data {
/**
* The ID of the v2 account.
*/
account_id: string;
/**
* Configurations on the Account that was onboarded via the account link.
*/
configurations: Array<Data.Configuration>;
/**
* Open Enum. The use case type of the account link that has been completed.
*/
use_case: Data.UseCase;
}
namespace Data {
type Configuration = 'customer' | 'merchant' | 'recipient';
type UseCase = 'account_onboarding' | 'account_update';
}
}
/**
* Occurs when a Person is created.
*/
export interface V2CoreAccountPersonCreatedEvent extends EventBase {
type: 'v2.core.account_person.created';
data: V2CoreAccountPersonCreatedEvent.Data;
related_object: V2.Core.Events.RelatedObject;
fetchRelatedObject(): Promise<Core.AccountPerson>;
}
export interface V2CoreAccountPersonCreatedEventNotification extends EventNotificationBase {
type: 'v2.core.account_person.created';
related_object: V2.Core.Events.RelatedObject;
fetchRelatedObject(): Promise<Core.AccountPerson>;
fetchEvent(): Promise<V2CoreAccountPersonCreatedEvent>;
}
export declare namespace V2CoreAccountPersonCreatedEvent {
interface Data {
/**
* The ID of the v2 account.
*/
account_id: string;
}
}
/**
* Occurs when a Person is deleted.
*/
export interface V2CoreAccountPersonDeletedEvent extends EventBase {
type: 'v2.core.account_person.deleted';
data: V2CoreAccountPersonDeletedEvent.Data;
related_object: V2.Core.Events.RelatedObject;
fetchRelatedObject(): Promise<Core.AccountPerson>;
}
export interface V2CoreAccountPersonDeletedEventNotification extends EventNotificationBase {
type: 'v2.core.account_person.deleted';
related_object: V2.Core.Events.RelatedObject;
fetchRelatedObject(): Promise<Core.AccountPerson>;
fetchEvent(): Promise<V2CoreAccountPersonDeletedEvent>;
}
export declare namespace V2CoreAccountPersonDeletedEvent {
interface Data {
/**
* The ID of the v2 account.
*/
account_id: string;
}
}
/**
* Occurs when a Person is updated.
*/
export interface V2CoreAccountPersonUpdatedEvent extends EventBase {
type: 'v2.core.account_person.updated';
data: V2CoreAccountPersonUpdatedEvent.Data;
related_object: V2.Core.Events.RelatedObject;
fetchRelatedObject(): Promise<Core.AccountPerson>;
}
export interface V2CoreAccountPersonUpdatedEventNotification extends EventNotificationBase {
type: 'v2.core.account_person.updated';
related_object: V2.Core.Events.RelatedObject;
fetchRelatedObject(): Promise<Core.AccountPerson>;
fetchEvent(): Promise<V2CoreAccountPersonUpdatedEvent>;
}
export declare namespace V2CoreAccountPersonUpdatedEvent {
interface Data {
/**
* The ID of the v2 account.
*/
account_id: string;
}
}
/**
* A ping event used to test the connection to an EventDestination.
*/
export interface V2CoreEventDestinationPingEvent extends EventBase {
type: 'v2.core.event_destination.ping';
related_object: V2.Core.Events.RelatedObject;
fetchRelatedObject(): Promise<Core.EventDestination>;
}
export interface V2CoreEventDestinationPingEventNotification extends EventNotificationBase {
type: 'v2.core.event_destination.ping';
related_object: V2.Core.Events.RelatedObject;
fetchRelatedObject(): Promise<Core.EventDestination>;
fetchEvent(): Promise<V2CoreEventDestinationPingEvent>;
}
export declare namespace Events {
export { UnknownEventNotification, V1BillingMeterErrorReportTriggeredEvent, V1BillingMeterNoMeterFoundEvent, V2CommerceProductCatalogImportsFailedEvent, V2CommerceProductCatalogImportsProcessingEvent, V2CommerceProductCatalogImportsSucceededEvent, V2CommerceProductCatalogImportsSucceededWithErrorsEvent, V2CoreAccountClosedEvent, V2CoreAccountCreatedEvent, V2CoreAccountUpdatedEvent, V2CoreAccountIncludingConfigurationCustomerCapabilityStatusUpdatedEvent, V2CoreAccountIncludingConfigurationCustomerUpdatedEvent, V2CoreAccountIncludingConfigurationMerchantCapabilityStatusUpdatedEvent, V2CoreAccountIncludingConfigurationMerchantUpdatedEvent, V2CoreAccountIncludingConfigurationRecipientCapabilityStatusUpdatedEvent, V2CoreAccountIncludingConfigurationRecipientUpdatedEvent, V2CoreAccountIncludingDefaultsUpdatedEvent, V2CoreAccountIncludingFutureRequirementsUpdatedEvent, V2CoreAccountIncludingIdentityUpdatedEvent, V2CoreAccountIncludingRequirementsUpdatedEvent, V2CoreAccountLinkReturnedEvent, V2CoreAccountPersonCreatedEvent, V2CoreAccountPersonDeletedEvent, V2CoreAccountPersonUpdatedEvent, V2CoreEventDestinationPingEvent, V1BillingMeterErrorReportTriggeredEventNotification, V1BillingMeterNoMeterFoundEventNotification, V2CommerceProductCatalogImportsFailedEventNotification, V2CommerceProductCatalogImportsProcessingEventNotification, V2CommerceProductCatalogImportsSucceededEventNotification, V2CommerceProductCatalogImportsSucceededWithErrorsEventNotification, V2CoreAccountClosedEventNotification, V2CoreAccountCreatedEventNotification, V2CoreAccountUpdatedEventNotification, V2CoreAccountIncludingConfigurationCustomerCapabilityStatusUpdatedEventNotification, V2CoreAccountIncludingConfigurationCustomerUpdatedEventNotification, V2CoreAccountIncludingConfigurationMerchantCapabilityStatusUpdatedEventNotification, V2CoreAccountIncludingConfigurationMerchantUpdatedEventNotification, V2CoreAccountIncludingConfigurationRecipientCapabilityStatusUpdatedEventNotification, V2CoreAccountIncludingConfigurationRecipientUpdatedEventNotification, V2CoreAccountIncludingDefaultsUpdatedEventNotification, V2CoreAccountIncludingFutureRequirementsUpdatedEventNotification, V2CoreAccountIncludingIdentityUpdatedEventNotification, V2CoreAccountIncludingRequirementsUpdatedEventNotification, V2CoreAccountLinkReturnedEventNotification, V2CoreAccountPersonCreatedEventNotification, V2CoreAccountPersonDeletedEventNotification, V2CoreAccountPersonUpdatedEventNotification, V2CoreEventDestinationPingEventNotification, };
}

55
node_modules/stripe/esm/resources/V2/Core/Events.js generated vendored Normal file
View File

@@ -0,0 +1,55 @@
// File generated from our OpenAPI spec
import { StripeResource } from '../../../StripeResource.js';
export class EventResource extends StripeResource {
/**
* List events, going back up to 30 days.
*/
list(params, options) {
const transformResponseData = (response) => {
return {
...response,
data: response.data.map(this.addFetchRelatedObjectIfNeeded.bind(this)),
};
};
return this._makeRequest('GET', '/v2/core/events', params, options, {
methodType: 'list',
transformResponseData: transformResponseData,
});
}
/**
* Retrieves the details of an event if it was created in the last 30 days. Supply the unique
* identifier of the event, which might have been delivered to your event destination.
*/
retrieve(id, params, options) {
const transformResponseData = (response) => {
return this.addFetchRelatedObjectIfNeeded(response);
};
return this._makeRequest('GET', `/v2/core/events/${encodeURIComponent(id)}`, params, options, {
transformResponseData: transformResponseData,
});
}
/**
* @private
*
* For internal use in stripe-node.
*
* @param pulledEvent The retrieved event object
* @returns The retrieved event object with a fetchRelatedObject method,
* if pulledEvent.related_object is valid (non-null and has a url)
*/
addFetchRelatedObjectIfNeeded(pulledEvent) {
if (!pulledEvent.related_object || !pulledEvent.related_object.url) {
return pulledEvent;
}
return {
...pulledEvent,
fetchRelatedObject: () => this._makeRequest('GET', pulledEvent.related_object.url, undefined, {
stripeContext: pulledEvent.context,
headers: {
'Stripe-Request-Trigger': `event=${pulledEvent.id}`,
},
}),
};
}
}
//# sourceMappingURL=Events.js.map

View File

@@ -0,0 +1 @@
{"version":3,"file":"Events.js","sourceRoot":"","sources":["../../../../src/resources/V2/Core/Events.ts"],"names":[],"mappings":"AAAA,uCAAuC;AAEvC,OAAO,EAAC,cAAc,EAAC,MAAM,4BAA4B,CAAC;AAI1D,MAAM,OAAO,aAAc,SAAQ,cAAc;IAC/C;;OAEG;IACH,IAAI,CACF,MAAgC,EAChC,OAAwB;QAExB,MAAM,qBAAqB,GAAG,CAAC,QAAa,EAAO,EAAE;YACnD,OAAO;gBACL,GAAG,QAAQ;gBACX,IAAI,EAAE,QAAQ,CAAC,IAAI,CAAC,GAAG,CAAC,IAAI,CAAC,6BAA6B,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC;aACvE,CAAC;QACJ,CAAC,CAAC;QACF,OAAO,IAAI,CAAC,YAAY,CAAC,KAAK,EAAE,iBAAiB,EAAE,MAAM,EAAE,OAAO,EAAE;YAClE,UAAU,EAAE,MAAM;YAClB,qBAAqB,EAAE,qBAAqB;SAC7C,CAAQ,CAAC;IACZ,CAAC;IACD;;;OAGG;IACH,QAAQ,CACN,EAAU,EACV,MAAoC,EACpC,OAAwB;QAExB,MAAM,qBAAqB,GAAG,CAAC,QAAa,EAAO,EAAE;YACnD,OAAO,IAAI,CAAC,6BAA6B,CAAC,QAAQ,CAAC,CAAC;QACtD,CAAC,CAAC;QACF,OAAO,IAAI,CAAC,YAAY,CACtB,KAAK,EACL,mBAAmB,kBAAkB,CAAC,EAAE,CAAC,EAAE,EAC3C,MAAM,EACN,OAAO,EACP;YACE,qBAAqB,EAAE,qBAAqB;SAC7C,CACK,CAAC;IACX,CAAC;IACD;;;;;;;;OAQG;IACH,6BAA6B,CAAC,WAAgB;QAC5C,IAAI,CAAC,WAAW,CAAC,cAAc,IAAI,CAAC,WAAW,CAAC,cAAc,CAAC,GAAG,EAAE;YAClE,OAAO,WAAW,CAAC;SACpB;QACD,OAAO;YACL,GAAG,WAAW;YACd,kBAAkB,EAAE,GAAwB,EAAE,CAC5C,IAAI,CAAC,YAAY,CAAC,KAAK,EAAE,WAAW,CAAC,cAAc,CAAC,GAAG,EAAE,SAAS,EAAE;gBAClE,aAAa,EAAE,WAAW,CAAC,OAAO;gBAClC,OAAO,EAAE;oBACP,wBAAwB,EAAE,SAAS,WAAW,CAAC,EAAE,EAAE;iBACpD;aACF,CAAC;SACL,CAAC;IACJ,CAAC;CACF"}

51
node_modules/stripe/esm/resources/V2/Core/index.d.ts generated vendored Normal file
View File

@@ -0,0 +1,51 @@
import { Stripe } from '../../../stripe.core.js';
import { V2 as V2Namespace0, Account, AccountResource } from './Accounts.js';
import { V2 as V2Namespace1, AccountLink, AccountLinkResource } from './AccountLinks.js';
import { V2 as V2Namespace2, AccountToken, AccountTokenResource } from './AccountTokens.js';
import { EventBase, EventNotification, Event, Events, V2 as V2EventsNamespace, EventResource } from './Events.js';
import { V2 as V2Namespace4, EventDestination, EventDestinationResource } from './EventDestinations.js';
import { AccountPersonToken } from './AccountPersonTokens.js';
import { AccountPerson } from './AccountPersons.js';
export { Account } from './Accounts.js';
export { AccountLink } from './AccountLinks.js';
export { AccountToken } from './AccountTokens.js';
export { Event } from './Events.js';
export { EventDestination } from './EventDestinations.js';
export { AccountPersonToken } from './AccountPersonTokens.js';
export { AccountPerson } from './AccountPersons.js';
export declare class Core {
private readonly stripe;
accounts: AccountResource;
accountLinks: AccountLinkResource;
accountTokens: AccountTokenResource;
events: EventResource;
eventDestinations: EventDestinationResource;
constructor(stripe: Stripe);
}
export declare namespace Core {
export import AccountListParams = V2Namespace0.Core.AccountListParams;
export import AccountCreateParams = V2Namespace0.Core.AccountCreateParams;
export import AccountRetrieveParams = V2Namespace0.Core.AccountRetrieveParams;
export import AccountUpdateParams = V2Namespace0.Core.AccountUpdateParams;
export import AccountCloseParams = V2Namespace0.Core.AccountCloseParams;
export { Account };
export import AccountLinkCreateParams = V2Namespace1.Core.AccountLinkCreateParams;
export { AccountLink };
export import AccountTokenCreateParams = V2Namespace2.Core.AccountTokenCreateParams;
export import AccountTokenRetrieveParams = V2Namespace2.Core.AccountTokenRetrieveParams;
export { AccountToken };
export import EventListParams = V2EventsNamespace.Core.EventListParams;
export import EventRetrieveParams = V2EventsNamespace.Core.EventRetrieveParams;
export { EventBase, Event, EventNotification, Events };
export import EventDestinationListParams = V2Namespace4.Core.EventDestinationListParams;
export import EventDestinationCreateParams = V2Namespace4.Core.EventDestinationCreateParams;
export import EventDestinationDeleteParams = V2Namespace4.Core.EventDestinationDeleteParams;
export import EventDestinationRetrieveParams = V2Namespace4.Core.EventDestinationRetrieveParams;
export import EventDestinationUpdateParams = V2Namespace4.Core.EventDestinationUpdateParams;
export import EventDestinationDisableParams = V2Namespace4.Core.EventDestinationDisableParams;
export import EventDestinationEnableParams = V2Namespace4.Core.EventDestinationEnableParams;
export import EventDestinationPingParams = V2Namespace4.Core.EventDestinationPingParams;
export { EventDestination };
export { AccountPersonToken };
export { AccountPerson };
}

17
node_modules/stripe/esm/resources/V2/Core/index.js generated vendored Normal file
View File

@@ -0,0 +1,17 @@
// File generated from our OpenAPI spec
import { AccountResource } from './Accounts.js';
import { AccountLinkResource, } from './AccountLinks.js';
import { AccountTokenResource, } from './AccountTokens.js';
import { EventResource, } from './Events.js';
import { EventDestinationResource, } from './EventDestinations.js';
export class Core {
constructor(stripe) {
this.stripe = stripe;
this.accounts = new AccountResource(stripe);
this.accountLinks = new AccountLinkResource(stripe);
this.accountTokens = new AccountTokenResource(stripe);
this.events = new EventResource(stripe);
this.eventDestinations = new EventDestinationResource(stripe);
}
}
//# sourceMappingURL=index.js.map

View File

@@ -0,0 +1 @@
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../src/resources/V2/Core/index.ts"],"names":[],"mappings":"AAAA,uCAAuC;AAGvC,OAAO,EAA8B,eAAe,EAAC,MAAM,eAAe,CAAC;AAC3E,OAAO,EAGL,mBAAmB,GACpB,MAAM,mBAAmB,CAAC;AAC3B,OAAO,EAGL,oBAAoB,GACrB,MAAM,oBAAoB,CAAC;AAC5B,OAAO,EAML,aAAa,GACd,MAAM,aAAa,CAAC;AACrB,OAAO,EAGL,wBAAwB,GACzB,MAAM,wBAAwB,CAAC;AAYhC,MAAM,OAAO,IAAI;IAOf,YAA6B,MAAc;QAAd,WAAM,GAAN,MAAM,CAAQ;QACzC,IAAI,CAAC,QAAQ,GAAG,IAAI,eAAe,CAAC,MAAM,CAAC,CAAC;QAC5C,IAAI,CAAC,YAAY,GAAG,IAAI,mBAAmB,CAAC,MAAM,CAAC,CAAC;QACpD,IAAI,CAAC,aAAa,GAAG,IAAI,oBAAoB,CAAC,MAAM,CAAC,CAAC;QACtD,IAAI,CAAC,MAAM,GAAG,IAAI,aAAa,CAAC,MAAM,CAAC,CAAC;QACxC,IAAI,CAAC,iBAAiB,GAAG,IAAI,wBAAwB,CAAC,MAAM,CAAC,CAAC;IAChE,CAAC;CACF"}

View File

@@ -0,0 +1,10 @@
export interface DeletedObject {
/**
* The ID of the object that's being deleted.
*/
id: string;
/**
* String representing the type of the object that has been deleted. Objects of the same type share the same value of the object field.
*/
object?: string;
}

View File

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

View File

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

4
node_modules/stripe/esm/resources/V2/V2Amounts.d.ts generated vendored Normal file
View File

@@ -0,0 +1,4 @@
export interface V2Amount {
value: number;
currency: string;
}

2
node_modules/stripe/esm/resources/V2/V2Amounts.js generated vendored Normal file
View File

@@ -0,0 +1,2 @@
export {};
//# sourceMappingURL=V2Amounts.js.map

View File

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

19
node_modules/stripe/esm/resources/V2/index.d.ts generated vendored Normal file
View File

@@ -0,0 +1,19 @@
import { Stripe } from '../../stripe.core.js';
import { DeletedObject } from './DeletedObject.js';
import { Billing } from './Billing/index.js';
import { Commerce } from './Commerce/index.js';
import { Core } from './Core/index.js';
export { DeletedObject } from './DeletedObject.js';
export declare class V2 {
private readonly stripe;
billing: Billing;
commerce: Commerce;
core: Core;
constructor(stripe: Stripe);
}
export declare namespace V2 {
export { DeletedObject };
export { Billing };
export { Commerce };
export { Core };
}

13
node_modules/stripe/esm/resources/V2/index.js generated vendored Normal file
View File

@@ -0,0 +1,13 @@
// File generated from our OpenAPI spec
import { Billing } from './Billing/index.js';
import { Commerce } from './Commerce/index.js';
import { Core } from './Core/index.js';
export class V2 {
constructor(stripe) {
this.stripe = stripe;
this.billing = new Billing(stripe);
this.commerce = new Commerce(stripe);
this.core = new Core(stripe);
}
}
//# sourceMappingURL=index.js.map

1
node_modules/stripe/esm/resources/V2/index.js.map generated vendored Normal file
View File

@@ -0,0 +1 @@
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/resources/V2/index.ts"],"names":[],"mappings":"AAAA,uCAAuC;AAIvC,OAAO,EAAC,OAAO,EAAC,MAAM,oBAAoB,CAAC;AAC3C,OAAO,EAAC,QAAQ,EAAC,MAAM,qBAAqB,CAAC;AAC7C,OAAO,EAAC,IAAI,EAAC,MAAM,iBAAiB,CAAC;AAIrC,MAAM,OAAO,EAAE;IAKb,YAA6B,MAAc;QAAd,WAAM,GAAN,MAAM,CAAQ;QACzC,IAAI,CAAC,OAAO,GAAG,IAAI,OAAO,CAAC,MAAM,CAAC,CAAC;QACnC,IAAI,CAAC,QAAQ,GAAG,IAAI,QAAQ,CAAC,MAAM,CAAC,CAAC;QACrC,IAAI,CAAC,IAAI,GAAG,IAAI,IAAI,CAAC,MAAM,CAAC,CAAC;IAC/B,CAAC;CACF"}