rebilly-js-sdk 55.17.0 → 55.18.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +7 -0
- package/dist/rebilly-js-sdk.d.ts +237 -211
- package/dist/rebilly-js-sdk.es.js +13 -8
- package/dist/rebilly-js-sdk.umd.js +2 -2
- package/package.json +1 -1
- package/src/resources/storefront/orders-resource.js +0 -3
- package/src/resources/storefront/storefront-api-instance.js +2 -0
- package/src/resources/storefront/subscriptions-resource.js +12 -0
package/CHANGELOG.md
CHANGED
|
@@ -1,3 +1,10 @@
|
|
|
1
|
+
## [55.18.0](https://github.com/Rebilly/rebilly/compare/rebilly-js-sdk-v55.17.0...rebilly-js-sdk-v55.18.0) (2024-02-06)
|
|
2
|
+
|
|
3
|
+
|
|
4
|
+
### Features
|
|
5
|
+
|
|
6
|
+
* **rebilly-js-sdk:** Add Subscriptions resource ([#3329](https://github.com/Rebilly/rebilly/issues/3329)) ([754309b](https://github.com/Rebilly/rebilly/commit/754309bbcd2a733a6fe1fe6d3267d43def87916a))
|
|
7
|
+
|
|
1
8
|
## [55.17.0](https://github.com/Rebilly/rebilly/compare/rebilly-js-sdk-v55.16.0...rebilly-js-sdk-v55.17.0) (2024-02-05)
|
|
2
9
|
|
|
3
10
|
|
package/dist/rebilly-js-sdk.d.ts
CHANGED
|
@@ -1942,10 +1942,6 @@ declare module rebilly {
|
|
|
1942
1942
|
|
|
1943
1943
|
type StorefrontGetOrderCollectionResponse = operations['StorefrontGetOrderCollection']['responses']['200']['content']['application/json'][0]
|
|
1944
1944
|
type StorefrontGetOrderCollectionResponsePromise = Promise<{ items: {fields: StorefrontGetOrderCollectionResponse}[], getJSON: object, total?: number, offset?: number, limit?: number }>
|
|
1945
|
-
type StorefrontPostOrderRequest = operations['StorefrontPostOrder']['requestBody']['content']['application/json']
|
|
1946
|
-
type StorefrontCreateOrderRequest = { id?: String, data: StorefrontPostOrderRequest, expand?: String }
|
|
1947
|
-
type StorefrontPostOrderResponse = operations['StorefrontPostOrder']['responses']['201']['content']['application/json']
|
|
1948
|
-
type StorefrontPostOrderResponsePromise = Promise<{fields: StorefrontPostOrderResponse}>
|
|
1949
1945
|
|
|
1950
1946
|
type StorefrontGetOrderRequest = { id : String }
|
|
1951
1947
|
|
|
@@ -2073,6 +2069,11 @@ declare module rebilly {
|
|
|
2073
2069
|
type StorefrontPostRegisterResponse = operations['StorefrontPostRegister']['responses']['201']['content']['application/json']
|
|
2074
2070
|
type StorefrontPostRegisterResponsePromise = Promise<{fields: StorefrontPostRegisterResponse}>
|
|
2075
2071
|
|
|
2072
|
+
type StorefrontPostSubscriptionRequest = operations['StorefrontPostSubscription']['requestBody']['content']['application/json']
|
|
2073
|
+
type StorefrontCreateSubscriptionRequest = { id?: String, data: StorefrontPostSubscriptionRequest, expand?: String }
|
|
2074
|
+
type StorefrontPostSubscriptionResponse = operations['StorefrontPostSubscription']['responses']['201']['content']['application/json']
|
|
2075
|
+
type StorefrontPostSubscriptionResponsePromise = Promise<{fields: StorefrontPostSubscriptionResponse}>
|
|
2076
|
+
|
|
2076
2077
|
type StorefrontGetTransactionCollectionRequest = operations['StorefrontGetTransactionCollection']['parameters']["query"] & (operations['StorefrontGetTransactionCollection']['parameters'] extends {path: {}} ? operations['StorefrontGetTransactionCollection']['parameters']["path"] : {})
|
|
2077
2078
|
|
|
2078
2079
|
type StorefrontGetTransactionCollectionResponse = operations['StorefrontGetTransactionCollection']['responses']['200']['content']['application/json'][0]
|
|
@@ -9042,6 +9043,11 @@ export interface coreComponents {
|
|
|
9042
9043
|
maxAttempts: number;
|
|
9043
9044
|
/** Specifies if the customer must upload a photo of their face (selfie) that matches a provided KYC document. */
|
|
9044
9045
|
faceProofRequired?: boolean;
|
|
9046
|
+
/**
|
|
9047
|
+
* Specifies if the customer must use the face liveness feature when uploading a selfie.
|
|
9048
|
+
* For more information, see [Facial recognition and identity verification](https://www.rebilly.com/docs/kyc-and-aml/kyc-and-aml/#facial-recognition-identity-verification).
|
|
9049
|
+
*/
|
|
9050
|
+
faceLivenessRequired?: boolean;
|
|
9045
9051
|
};
|
|
9046
9052
|
/** KYC request information. */
|
|
9047
9053
|
KycRequest: {
|
|
@@ -21461,65 +21467,6 @@ export interface coreComponents {
|
|
|
21461
21467
|
*/
|
|
21462
21468
|
orderType?: "subscription-order" | "one-time-order";
|
|
21463
21469
|
};
|
|
21464
|
-
PostOrder: {
|
|
21465
|
-
/** ID of the billing portal. */
|
|
21466
|
-
richBillingPortalId: string;
|
|
21467
|
-
/** Details of items in the order. */
|
|
21468
|
-
items: {
|
|
21469
|
-
/** ID of the plan. */
|
|
21470
|
-
planId: string;
|
|
21471
|
-
/** Number of units of the product on the given plan. */
|
|
21472
|
-
quantity?: number;
|
|
21473
|
-
/**
|
|
21474
|
-
* Specifies the soft and hard usage limit thresholds for an item with a metered billing plan.
|
|
21475
|
-
* This value is ignored when the plan is not metered.
|
|
21476
|
-
*/
|
|
21477
|
-
usageLimits?: {
|
|
21478
|
-
/** Specify if customer must receive spending limit alerts. */
|
|
21479
|
-
alerts: boolean;
|
|
21480
|
-
/**
|
|
21481
|
-
* Defines thresholds for notification purposes.
|
|
21482
|
-
* For example, to notify the customer that their usage is near the hard limit of their metered billing plan.
|
|
21483
|
-
* This notification informs the customer so that they can upgrade their plan before the hard limit is reached.
|
|
21484
|
-
* When the reported usage reaches 75%, 90%, and 100% of the configured limit a specific event is fired.
|
|
21485
|
-
* To notify the customer, a webhook and notification can be configured for this event.
|
|
21486
|
-
* This field is useful for accounting and customer success purposes.
|
|
21487
|
-
* The usage of metered billing plans can still be reported if the soft limit is reached.
|
|
21488
|
-
*/
|
|
21489
|
-
softLimit?: {
|
|
21490
|
-
/** Usage limit quantity. */
|
|
21491
|
-
quantity?: number;
|
|
21492
|
-
/** Usage limit amount in the currency of the order. */
|
|
21493
|
-
amount?: number;
|
|
21494
|
-
} | null;
|
|
21495
|
-
/**
|
|
21496
|
-
* Defines a limit where the customer can no longer use the service.
|
|
21497
|
-
* Hard limits are used in addition to soft limits.
|
|
21498
|
-
* When a soft limit is reached,
|
|
21499
|
-
* a customer may receive a notification
|
|
21500
|
-
* but the service can still be provided up to the hard limit value so that the customer can upgrade their plan.
|
|
21501
|
-
* When the reported usage reaches the configured limit,
|
|
21502
|
-
* a specific event is triggered.
|
|
21503
|
-
* To notify the customer in the merchant system,
|
|
21504
|
-
* or block a service,
|
|
21505
|
-
* a webhook and notification can be configured for this event.
|
|
21506
|
-
* When the total usage reaches the hard limit quantity,
|
|
21507
|
-
* or amount values,
|
|
21508
|
-
* metered billing plan usages can no longer be reported.
|
|
21509
|
-
*/
|
|
21510
|
-
hardLimit?: {
|
|
21511
|
-
/** Usage limit quantity. */
|
|
21512
|
-
quantity?: number;
|
|
21513
|
-
/** Usage limit amount in the currency of the order. */
|
|
21514
|
-
amount?: number;
|
|
21515
|
-
} | null;
|
|
21516
|
-
} | null;
|
|
21517
|
-
}[];
|
|
21518
|
-
/** Billing address details. */
|
|
21519
|
-
billingAddress?: coreComponents["schemas"]["ContactObject"] | null;
|
|
21520
|
-
/** Delivery address details. */
|
|
21521
|
-
deliveryAddress?: coreComponents["schemas"]["ContactObject"] | null;
|
|
21522
|
-
};
|
|
21523
21470
|
PaymentInstructionsToken: {
|
|
21524
21471
|
/** ID of the payment token. */
|
|
21525
21472
|
token: string;
|
|
@@ -22190,6 +22137,65 @@ export interface coreComponents {
|
|
|
22190
22137
|
coreComponents["schemas"]["ReadyToPayoutPaymentCardMethod"]
|
|
22191
22138
|
> &
|
|
22192
22139
|
Partial<coreComponents["schemas"]["ReadyToPayoutGenericMethod"]>;
|
|
22140
|
+
PostSubscription: {
|
|
22141
|
+
/** ID of the billing portal. */
|
|
22142
|
+
richBillingPortalId: string;
|
|
22143
|
+
/** Details of items in the order. */
|
|
22144
|
+
items: {
|
|
22145
|
+
/** ID of the plan. */
|
|
22146
|
+
planId: string;
|
|
22147
|
+
/** Number of units of the product on the given plan. */
|
|
22148
|
+
quantity?: number;
|
|
22149
|
+
/**
|
|
22150
|
+
* Specifies the soft and hard usage limit thresholds for an item with a metered billing plan.
|
|
22151
|
+
* This value is ignored when the plan is not metered.
|
|
22152
|
+
*/
|
|
22153
|
+
usageLimits?: {
|
|
22154
|
+
/** Specify if customer must receive spending limit alerts. */
|
|
22155
|
+
alerts: boolean;
|
|
22156
|
+
/**
|
|
22157
|
+
* Defines thresholds for notification purposes.
|
|
22158
|
+
* For example, to notify the customer that their usage is near the hard limit of their metered billing plan.
|
|
22159
|
+
* This notification informs the customer so that they can upgrade their plan before the hard limit is reached.
|
|
22160
|
+
* When the reported usage reaches 75%, 90%, and 100% of the configured limit a specific event is fired.
|
|
22161
|
+
* To notify the customer, a webhook and notification can be configured for this event.
|
|
22162
|
+
* This field is useful for accounting and customer success purposes.
|
|
22163
|
+
* The usage of metered billing plans can still be reported if the soft limit is reached.
|
|
22164
|
+
*/
|
|
22165
|
+
softLimit?: {
|
|
22166
|
+
/** Usage limit quantity. */
|
|
22167
|
+
quantity?: number;
|
|
22168
|
+
/** Usage limit amount in the currency of the order. */
|
|
22169
|
+
amount?: number;
|
|
22170
|
+
} | null;
|
|
22171
|
+
/**
|
|
22172
|
+
* Defines a limit where the customer can no longer use the service.
|
|
22173
|
+
* Hard limits are used in addition to soft limits.
|
|
22174
|
+
* When a soft limit is reached,
|
|
22175
|
+
* a customer may receive a notification
|
|
22176
|
+
* but the service can still be provided up to the hard limit value so that the customer can upgrade their plan.
|
|
22177
|
+
* When the reported usage reaches the configured limit,
|
|
22178
|
+
* a specific event is triggered.
|
|
22179
|
+
* To notify the customer in the merchant system,
|
|
22180
|
+
* or block a service,
|
|
22181
|
+
* a webhook and notification can be configured for this event.
|
|
22182
|
+
* When the total usage reaches the hard limit quantity,
|
|
22183
|
+
* or amount values,
|
|
22184
|
+
* metered billing plan usages can no longer be reported.
|
|
22185
|
+
*/
|
|
22186
|
+
hardLimit?: {
|
|
22187
|
+
/** Usage limit quantity. */
|
|
22188
|
+
quantity?: number;
|
|
22189
|
+
/** Usage limit amount in the currency of the order. */
|
|
22190
|
+
amount?: number;
|
|
22191
|
+
} | null;
|
|
22192
|
+
} | null;
|
|
22193
|
+
}[];
|
|
22194
|
+
/** Billing address details. */
|
|
22195
|
+
billingAddress?: coreComponents["schemas"]["ContactObject"] | null;
|
|
22196
|
+
/** Delivery address details. */
|
|
22197
|
+
deliveryAddress?: coreComponents["schemas"]["ContactObject"] | null;
|
|
22198
|
+
};
|
|
22193
22199
|
EddScore: "not-found" | "unlikely" | "unclear" | "probable" | "confirmed";
|
|
22194
22200
|
EddScoreDetails: {
|
|
22195
22201
|
/** URL from which the score is obtained. */
|
|
@@ -36312,8 +36318,6 @@ export interface storefrontPaths {
|
|
|
36312
36318
|
"/orders": {
|
|
36313
36319
|
/** Retrieve a list of orders. */
|
|
36314
36320
|
get: operations["StorefrontGetOrderCollection"];
|
|
36315
|
-
/** Creates a subscription order in a billing portal. */
|
|
36316
|
-
post: operations["StorefrontPostOrder"];
|
|
36317
36321
|
};
|
|
36318
36322
|
"/orders/{id}": {
|
|
36319
36323
|
/** Retrieve an order with a specified ID. */
|
|
@@ -36565,6 +36569,10 @@ export interface storefrontPaths {
|
|
|
36565
36569
|
/** Register account. */
|
|
36566
36570
|
post: operations["StorefrontPostRegister"];
|
|
36567
36571
|
};
|
|
36572
|
+
"/subscriptions": {
|
|
36573
|
+
/** Creates a subscription order in a billing portal. */
|
|
36574
|
+
post: operations["StorefrontPostSubscription"];
|
|
36575
|
+
};
|
|
36568
36576
|
"/transactions": {
|
|
36569
36577
|
/** Retrieve a list of transactions. */
|
|
36570
36578
|
get: operations["StorefrontGetTransactionCollection"];
|
|
@@ -40443,6 +40451,11 @@ export interface storefrontComponents {
|
|
|
40443
40451
|
maxAttempts: number;
|
|
40444
40452
|
/** Specifies if the customer must upload a photo of their face (selfie) that matches a provided KYC document. */
|
|
40445
40453
|
faceProofRequired?: boolean;
|
|
40454
|
+
/**
|
|
40455
|
+
* Specifies if the customer must use the face liveness feature when uploading a selfie.
|
|
40456
|
+
* For more information, see [Facial recognition and identity verification](https://www.rebilly.com/docs/kyc-and-aml/kyc-and-aml/#facial-recognition-identity-verification).
|
|
40457
|
+
*/
|
|
40458
|
+
faceLivenessRequired?: boolean;
|
|
40446
40459
|
};
|
|
40447
40460
|
/** KYC request information. */
|
|
40448
40461
|
KycRequest: {
|
|
@@ -52862,65 +52875,6 @@ export interface storefrontComponents {
|
|
|
52862
52875
|
*/
|
|
52863
52876
|
orderType?: "subscription-order" | "one-time-order";
|
|
52864
52877
|
};
|
|
52865
|
-
PostOrder: {
|
|
52866
|
-
/** ID of the billing portal. */
|
|
52867
|
-
richBillingPortalId: string;
|
|
52868
|
-
/** Details of items in the order. */
|
|
52869
|
-
items: {
|
|
52870
|
-
/** ID of the plan. */
|
|
52871
|
-
planId: string;
|
|
52872
|
-
/** Number of units of the product on the given plan. */
|
|
52873
|
-
quantity?: number;
|
|
52874
|
-
/**
|
|
52875
|
-
* Specifies the soft and hard usage limit thresholds for an item with a metered billing plan.
|
|
52876
|
-
* This value is ignored when the plan is not metered.
|
|
52877
|
-
*/
|
|
52878
|
-
usageLimits?: {
|
|
52879
|
-
/** Specify if customer must receive spending limit alerts. */
|
|
52880
|
-
alerts: boolean;
|
|
52881
|
-
/**
|
|
52882
|
-
* Defines thresholds for notification purposes.
|
|
52883
|
-
* For example, to notify the customer that their usage is near the hard limit of their metered billing plan.
|
|
52884
|
-
* This notification informs the customer so that they can upgrade their plan before the hard limit is reached.
|
|
52885
|
-
* When the reported usage reaches 75%, 90%, and 100% of the configured limit a specific event is fired.
|
|
52886
|
-
* To notify the customer, a webhook and notification can be configured for this event.
|
|
52887
|
-
* This field is useful for accounting and customer success purposes.
|
|
52888
|
-
* The usage of metered billing plans can still be reported if the soft limit is reached.
|
|
52889
|
-
*/
|
|
52890
|
-
softLimit?: {
|
|
52891
|
-
/** Usage limit quantity. */
|
|
52892
|
-
quantity?: number;
|
|
52893
|
-
/** Usage limit amount in the currency of the order. */
|
|
52894
|
-
amount?: number;
|
|
52895
|
-
} | null;
|
|
52896
|
-
/**
|
|
52897
|
-
* Defines a limit where the customer can no longer use the service.
|
|
52898
|
-
* Hard limits are used in addition to soft limits.
|
|
52899
|
-
* When a soft limit is reached,
|
|
52900
|
-
* a customer may receive a notification
|
|
52901
|
-
* but the service can still be provided up to the hard limit value so that the customer can upgrade their plan.
|
|
52902
|
-
* When the reported usage reaches the configured limit,
|
|
52903
|
-
* a specific event is triggered.
|
|
52904
|
-
* To notify the customer in the merchant system,
|
|
52905
|
-
* or block a service,
|
|
52906
|
-
* a webhook and notification can be configured for this event.
|
|
52907
|
-
* When the total usage reaches the hard limit quantity,
|
|
52908
|
-
* or amount values,
|
|
52909
|
-
* metered billing plan usages can no longer be reported.
|
|
52910
|
-
*/
|
|
52911
|
-
hardLimit?: {
|
|
52912
|
-
/** Usage limit quantity. */
|
|
52913
|
-
quantity?: number;
|
|
52914
|
-
/** Usage limit amount in the currency of the order. */
|
|
52915
|
-
amount?: number;
|
|
52916
|
-
} | null;
|
|
52917
|
-
} | null;
|
|
52918
|
-
}[];
|
|
52919
|
-
/** Billing address details. */
|
|
52920
|
-
billingAddress?: storefrontComponents["schemas"]["ContactObject"] | null;
|
|
52921
|
-
/** Delivery address details. */
|
|
52922
|
-
deliveryAddress?: storefrontComponents["schemas"]["ContactObject"] | null;
|
|
52923
|
-
};
|
|
52924
52878
|
PaymentInstructionsToken: {
|
|
52925
52879
|
/** ID of the payment token. */
|
|
52926
52880
|
token: string;
|
|
@@ -53591,6 +53545,65 @@ export interface storefrontComponents {
|
|
|
53591
53545
|
storefrontComponents["schemas"]["ReadyToPayoutPaymentCardMethod"]
|
|
53592
53546
|
> &
|
|
53593
53547
|
Partial<storefrontComponents["schemas"]["ReadyToPayoutGenericMethod"]>;
|
|
53548
|
+
PostSubscription: {
|
|
53549
|
+
/** ID of the billing portal. */
|
|
53550
|
+
richBillingPortalId: string;
|
|
53551
|
+
/** Details of items in the order. */
|
|
53552
|
+
items: {
|
|
53553
|
+
/** ID of the plan. */
|
|
53554
|
+
planId: string;
|
|
53555
|
+
/** Number of units of the product on the given plan. */
|
|
53556
|
+
quantity?: number;
|
|
53557
|
+
/**
|
|
53558
|
+
* Specifies the soft and hard usage limit thresholds for an item with a metered billing plan.
|
|
53559
|
+
* This value is ignored when the plan is not metered.
|
|
53560
|
+
*/
|
|
53561
|
+
usageLimits?: {
|
|
53562
|
+
/** Specify if customer must receive spending limit alerts. */
|
|
53563
|
+
alerts: boolean;
|
|
53564
|
+
/**
|
|
53565
|
+
* Defines thresholds for notification purposes.
|
|
53566
|
+
* For example, to notify the customer that their usage is near the hard limit of their metered billing plan.
|
|
53567
|
+
* This notification informs the customer so that they can upgrade their plan before the hard limit is reached.
|
|
53568
|
+
* When the reported usage reaches 75%, 90%, and 100% of the configured limit a specific event is fired.
|
|
53569
|
+
* To notify the customer, a webhook and notification can be configured for this event.
|
|
53570
|
+
* This field is useful for accounting and customer success purposes.
|
|
53571
|
+
* The usage of metered billing plans can still be reported if the soft limit is reached.
|
|
53572
|
+
*/
|
|
53573
|
+
softLimit?: {
|
|
53574
|
+
/** Usage limit quantity. */
|
|
53575
|
+
quantity?: number;
|
|
53576
|
+
/** Usage limit amount in the currency of the order. */
|
|
53577
|
+
amount?: number;
|
|
53578
|
+
} | null;
|
|
53579
|
+
/**
|
|
53580
|
+
* Defines a limit where the customer can no longer use the service.
|
|
53581
|
+
* Hard limits are used in addition to soft limits.
|
|
53582
|
+
* When a soft limit is reached,
|
|
53583
|
+
* a customer may receive a notification
|
|
53584
|
+
* but the service can still be provided up to the hard limit value so that the customer can upgrade their plan.
|
|
53585
|
+
* When the reported usage reaches the configured limit,
|
|
53586
|
+
* a specific event is triggered.
|
|
53587
|
+
* To notify the customer in the merchant system,
|
|
53588
|
+
* or block a service,
|
|
53589
|
+
* a webhook and notification can be configured for this event.
|
|
53590
|
+
* When the total usage reaches the hard limit quantity,
|
|
53591
|
+
* or amount values,
|
|
53592
|
+
* metered billing plan usages can no longer be reported.
|
|
53593
|
+
*/
|
|
53594
|
+
hardLimit?: {
|
|
53595
|
+
/** Usage limit quantity. */
|
|
53596
|
+
quantity?: number;
|
|
53597
|
+
/** Usage limit amount in the currency of the order. */
|
|
53598
|
+
amount?: number;
|
|
53599
|
+
} | null;
|
|
53600
|
+
} | null;
|
|
53601
|
+
}[];
|
|
53602
|
+
/** Billing address details. */
|
|
53603
|
+
billingAddress?: storefrontComponents["schemas"]["ContactObject"] | null;
|
|
53604
|
+
/** Delivery address details. */
|
|
53605
|
+
deliveryAddress?: storefrontComponents["schemas"]["ContactObject"] | null;
|
|
53606
|
+
};
|
|
53594
53607
|
EddScore: "not-found" | "unlikely" | "unclear" | "probable" | "confirmed";
|
|
53595
53608
|
EddScoreDetails: {
|
|
53596
53609
|
/** URL from which the score is obtained. */
|
|
@@ -56153,28 +56166,6 @@ export interface operations {
|
|
|
56153
56166
|
403: storefrontComponents["responses"]["Forbidden"];
|
|
56154
56167
|
};
|
|
56155
56168
|
};
|
|
56156
|
-
/** Creates a subscription order in a billing portal. */
|
|
56157
|
-
StorefrontPostOrder: {
|
|
56158
|
-
responses: {
|
|
56159
|
-
/** Order created. */
|
|
56160
|
-
201: {
|
|
56161
|
-
headers: {};
|
|
56162
|
-
content: {
|
|
56163
|
-
"application/json": storefrontComponents["schemas"]["StorefrontOrder"];
|
|
56164
|
-
};
|
|
56165
|
-
};
|
|
56166
|
-
401: storefrontComponents["responses"]["Unauthorized"];
|
|
56167
|
-
403: storefrontComponents["responses"]["Forbidden"];
|
|
56168
|
-
404: storefrontComponents["responses"]["NotFound"];
|
|
56169
|
-
422: storefrontComponents["responses"]["ValidationError"];
|
|
56170
|
-
};
|
|
56171
|
-
/** Create an order request. */
|
|
56172
|
-
requestBody: {
|
|
56173
|
-
content: {
|
|
56174
|
-
"application/json": storefrontComponents["schemas"]["PostOrder"];
|
|
56175
|
-
};
|
|
56176
|
-
};
|
|
56177
|
-
};
|
|
56178
56169
|
/** Retrieve an order with a specified ID. */
|
|
56179
56170
|
StorefrontGetOrder: {
|
|
56180
56171
|
parameters: {
|
|
@@ -56934,6 +56925,28 @@ export interface operations {
|
|
|
56934
56925
|
};
|
|
56935
56926
|
requestBody: storefrontComponents["requestBodies"]["PostRegister"];
|
|
56936
56927
|
};
|
|
56928
|
+
/** Creates a subscription order in a billing portal. */
|
|
56929
|
+
StorefrontPostSubscription: {
|
|
56930
|
+
responses: {
|
|
56931
|
+
/** Subscription created. */
|
|
56932
|
+
201: {
|
|
56933
|
+
headers: {};
|
|
56934
|
+
content: {
|
|
56935
|
+
"application/json": storefrontComponents["schemas"]["StorefrontOrder"];
|
|
56936
|
+
};
|
|
56937
|
+
};
|
|
56938
|
+
401: storefrontComponents["responses"]["Unauthorized"];
|
|
56939
|
+
403: storefrontComponents["responses"]["Forbidden"];
|
|
56940
|
+
404: storefrontComponents["responses"]["NotFound"];
|
|
56941
|
+
422: storefrontComponents["responses"]["ValidationError"];
|
|
56942
|
+
};
|
|
56943
|
+
/** Create an order request. */
|
|
56944
|
+
requestBody: {
|
|
56945
|
+
content: {
|
|
56946
|
+
"application/json": storefrontComponents["schemas"]["PostSubscription"];
|
|
56947
|
+
};
|
|
56948
|
+
};
|
|
56949
|
+
};
|
|
56937
56950
|
/** Retrieve a list of transactions. */
|
|
56938
56951
|
StorefrontGetTransactionCollection: {
|
|
56939
56952
|
parameters: {
|
|
@@ -61073,6 +61086,11 @@ export interface reportsComponents {
|
|
|
61073
61086
|
maxAttempts: number;
|
|
61074
61087
|
/** Specifies if the customer must upload a photo of their face (selfie) that matches a provided KYC document. */
|
|
61075
61088
|
faceProofRequired?: boolean;
|
|
61089
|
+
/**
|
|
61090
|
+
* Specifies if the customer must use the face liveness feature when uploading a selfie.
|
|
61091
|
+
* For more information, see [Facial recognition and identity verification](https://www.rebilly.com/docs/kyc-and-aml/kyc-and-aml/#facial-recognition-identity-verification).
|
|
61092
|
+
*/
|
|
61093
|
+
faceLivenessRequired?: boolean;
|
|
61076
61094
|
};
|
|
61077
61095
|
/** KYC request information. */
|
|
61078
61096
|
KycRequest: {
|
|
@@ -73492,65 +73510,6 @@ export interface reportsComponents {
|
|
|
73492
73510
|
*/
|
|
73493
73511
|
orderType?: "subscription-order" | "one-time-order";
|
|
73494
73512
|
};
|
|
73495
|
-
PostOrder: {
|
|
73496
|
-
/** ID of the billing portal. */
|
|
73497
|
-
richBillingPortalId: string;
|
|
73498
|
-
/** Details of items in the order. */
|
|
73499
|
-
items: {
|
|
73500
|
-
/** ID of the plan. */
|
|
73501
|
-
planId: string;
|
|
73502
|
-
/** Number of units of the product on the given plan. */
|
|
73503
|
-
quantity?: number;
|
|
73504
|
-
/**
|
|
73505
|
-
* Specifies the soft and hard usage limit thresholds for an item with a metered billing plan.
|
|
73506
|
-
* This value is ignored when the plan is not metered.
|
|
73507
|
-
*/
|
|
73508
|
-
usageLimits?: {
|
|
73509
|
-
/** Specify if customer must receive spending limit alerts. */
|
|
73510
|
-
alerts: boolean;
|
|
73511
|
-
/**
|
|
73512
|
-
* Defines thresholds for notification purposes.
|
|
73513
|
-
* For example, to notify the customer that their usage is near the hard limit of their metered billing plan.
|
|
73514
|
-
* This notification informs the customer so that they can upgrade their plan before the hard limit is reached.
|
|
73515
|
-
* When the reported usage reaches 75%, 90%, and 100% of the configured limit a specific event is fired.
|
|
73516
|
-
* To notify the customer, a webhook and notification can be configured for this event.
|
|
73517
|
-
* This field is useful for accounting and customer success purposes.
|
|
73518
|
-
* The usage of metered billing plans can still be reported if the soft limit is reached.
|
|
73519
|
-
*/
|
|
73520
|
-
softLimit?: {
|
|
73521
|
-
/** Usage limit quantity. */
|
|
73522
|
-
quantity?: number;
|
|
73523
|
-
/** Usage limit amount in the currency of the order. */
|
|
73524
|
-
amount?: number;
|
|
73525
|
-
} | null;
|
|
73526
|
-
/**
|
|
73527
|
-
* Defines a limit where the customer can no longer use the service.
|
|
73528
|
-
* Hard limits are used in addition to soft limits.
|
|
73529
|
-
* When a soft limit is reached,
|
|
73530
|
-
* a customer may receive a notification
|
|
73531
|
-
* but the service can still be provided up to the hard limit value so that the customer can upgrade their plan.
|
|
73532
|
-
* When the reported usage reaches the configured limit,
|
|
73533
|
-
* a specific event is triggered.
|
|
73534
|
-
* To notify the customer in the merchant system,
|
|
73535
|
-
* or block a service,
|
|
73536
|
-
* a webhook and notification can be configured for this event.
|
|
73537
|
-
* When the total usage reaches the hard limit quantity,
|
|
73538
|
-
* or amount values,
|
|
73539
|
-
* metered billing plan usages can no longer be reported.
|
|
73540
|
-
*/
|
|
73541
|
-
hardLimit?: {
|
|
73542
|
-
/** Usage limit quantity. */
|
|
73543
|
-
quantity?: number;
|
|
73544
|
-
/** Usage limit amount in the currency of the order. */
|
|
73545
|
-
amount?: number;
|
|
73546
|
-
} | null;
|
|
73547
|
-
} | null;
|
|
73548
|
-
}[];
|
|
73549
|
-
/** Billing address details. */
|
|
73550
|
-
billingAddress?: reportsComponents["schemas"]["ContactObject"] | null;
|
|
73551
|
-
/** Delivery address details. */
|
|
73552
|
-
deliveryAddress?: reportsComponents["schemas"]["ContactObject"] | null;
|
|
73553
|
-
};
|
|
73554
73513
|
PaymentInstructionsToken: {
|
|
73555
73514
|
/** ID of the payment token. */
|
|
73556
73515
|
token: string;
|
|
@@ -74221,6 +74180,65 @@ export interface reportsComponents {
|
|
|
74221
74180
|
reportsComponents["schemas"]["ReadyToPayoutPaymentCardMethod"]
|
|
74222
74181
|
> &
|
|
74223
74182
|
Partial<reportsComponents["schemas"]["ReadyToPayoutGenericMethod"]>;
|
|
74183
|
+
PostSubscription: {
|
|
74184
|
+
/** ID of the billing portal. */
|
|
74185
|
+
richBillingPortalId: string;
|
|
74186
|
+
/** Details of items in the order. */
|
|
74187
|
+
items: {
|
|
74188
|
+
/** ID of the plan. */
|
|
74189
|
+
planId: string;
|
|
74190
|
+
/** Number of units of the product on the given plan. */
|
|
74191
|
+
quantity?: number;
|
|
74192
|
+
/**
|
|
74193
|
+
* Specifies the soft and hard usage limit thresholds for an item with a metered billing plan.
|
|
74194
|
+
* This value is ignored when the plan is not metered.
|
|
74195
|
+
*/
|
|
74196
|
+
usageLimits?: {
|
|
74197
|
+
/** Specify if customer must receive spending limit alerts. */
|
|
74198
|
+
alerts: boolean;
|
|
74199
|
+
/**
|
|
74200
|
+
* Defines thresholds for notification purposes.
|
|
74201
|
+
* For example, to notify the customer that their usage is near the hard limit of their metered billing plan.
|
|
74202
|
+
* This notification informs the customer so that they can upgrade their plan before the hard limit is reached.
|
|
74203
|
+
* When the reported usage reaches 75%, 90%, and 100% of the configured limit a specific event is fired.
|
|
74204
|
+
* To notify the customer, a webhook and notification can be configured for this event.
|
|
74205
|
+
* This field is useful for accounting and customer success purposes.
|
|
74206
|
+
* The usage of metered billing plans can still be reported if the soft limit is reached.
|
|
74207
|
+
*/
|
|
74208
|
+
softLimit?: {
|
|
74209
|
+
/** Usage limit quantity. */
|
|
74210
|
+
quantity?: number;
|
|
74211
|
+
/** Usage limit amount in the currency of the order. */
|
|
74212
|
+
amount?: number;
|
|
74213
|
+
} | null;
|
|
74214
|
+
/**
|
|
74215
|
+
* Defines a limit where the customer can no longer use the service.
|
|
74216
|
+
* Hard limits are used in addition to soft limits.
|
|
74217
|
+
* When a soft limit is reached,
|
|
74218
|
+
* a customer may receive a notification
|
|
74219
|
+
* but the service can still be provided up to the hard limit value so that the customer can upgrade their plan.
|
|
74220
|
+
* When the reported usage reaches the configured limit,
|
|
74221
|
+
* a specific event is triggered.
|
|
74222
|
+
* To notify the customer in the merchant system,
|
|
74223
|
+
* or block a service,
|
|
74224
|
+
* a webhook and notification can be configured for this event.
|
|
74225
|
+
* When the total usage reaches the hard limit quantity,
|
|
74226
|
+
* or amount values,
|
|
74227
|
+
* metered billing plan usages can no longer be reported.
|
|
74228
|
+
*/
|
|
74229
|
+
hardLimit?: {
|
|
74230
|
+
/** Usage limit quantity. */
|
|
74231
|
+
quantity?: number;
|
|
74232
|
+
/** Usage limit amount in the currency of the order. */
|
|
74233
|
+
amount?: number;
|
|
74234
|
+
} | null;
|
|
74235
|
+
} | null;
|
|
74236
|
+
}[];
|
|
74237
|
+
/** Billing address details. */
|
|
74238
|
+
billingAddress?: reportsComponents["schemas"]["ContactObject"] | null;
|
|
74239
|
+
/** Delivery address details. */
|
|
74240
|
+
deliveryAddress?: reportsComponents["schemas"]["ContactObject"] | null;
|
|
74241
|
+
};
|
|
74224
74242
|
EddScore: "not-found" | "unlikely" | "unclear" | "probable" | "confirmed";
|
|
74225
74243
|
EddScoreDetails: {
|
|
74226
74244
|
/** URL from which the score is obtained. */
|
|
@@ -81969,9 +81987,6 @@ declare module "resources/storefront/orders-resource" {
|
|
|
81969
81987
|
id: any;
|
|
81970
81988
|
}): rebilly.StorefrontGetOrderUpcomingInvoiceResponsePromise;
|
|
81971
81989
|
getAll({ filter, sort, limit, offset, q, }?: rebilly.StorefrontGetOrderCollectionRequest): rebilly.StorefrontGetOrderCollectionResponsePromise;
|
|
81972
|
-
create({ data }: {
|
|
81973
|
-
data: any;
|
|
81974
|
-
}): any;
|
|
81975
81990
|
get({ id }: {
|
|
81976
81991
|
id: any;
|
|
81977
81992
|
}): rebilly.StorefrontGetOrderResponsePromise;
|
|
@@ -82108,6 +82123,15 @@ declare module "resources/storefront/rich-billing-portals-resource" {
|
|
|
82108
82123
|
}): rebilly.StorefrontGetRichBillingPortalResponsePromise;
|
|
82109
82124
|
};
|
|
82110
82125
|
}
|
|
82126
|
+
declare module "resources/storefront/subscriptions-resource" {
|
|
82127
|
+
export default function SubscriptionsResource({ apiHandler }: {
|
|
82128
|
+
apiHandler: any;
|
|
82129
|
+
}): {
|
|
82130
|
+
create({ data }: {
|
|
82131
|
+
data: any;
|
|
82132
|
+
}): any;
|
|
82133
|
+
};
|
|
82134
|
+
}
|
|
82111
82135
|
declare module "resources/storefront/transactions-resource" {
|
|
82112
82136
|
export default function TransactionsResource({ apiHandler }: {
|
|
82113
82137
|
apiHandler: any;
|
|
@@ -82266,9 +82290,6 @@ declare module "resources/storefront/storefront-api-instance" {
|
|
|
82266
82290
|
offset?: number;
|
|
82267
82291
|
q?: string;
|
|
82268
82292
|
}): rebilly.StorefrontGetOrderCollectionResponsePromise;
|
|
82269
|
-
create({ data }: {
|
|
82270
|
-
data: any;
|
|
82271
|
-
}): any;
|
|
82272
82293
|
get({ id }: {
|
|
82273
82294
|
id: any;
|
|
82274
82295
|
}): rebilly.StorefrontGetOrderResponsePromise;
|
|
@@ -82397,6 +82418,11 @@ declare module "resources/storefront/storefront-api-instance" {
|
|
|
82397
82418
|
id: any;
|
|
82398
82419
|
}): rebilly.StorefrontGetRichBillingPortalResponsePromise;
|
|
82399
82420
|
};
|
|
82421
|
+
subscriptions: {
|
|
82422
|
+
create({ data }: {
|
|
82423
|
+
data: any;
|
|
82424
|
+
}): any;
|
|
82425
|
+
};
|
|
82400
82426
|
transactions: {
|
|
82401
82427
|
getAll({ limit, offset, filter, q, sort, }?: {
|
|
82402
82428
|
limit?: number;
|
|
@@ -395,7 +395,7 @@ function cloneArrayDeep(val, instanceClone) {
|
|
|
395
395
|
return res;
|
|
396
396
|
}
|
|
397
397
|
var cloneDeep_1 = cloneDeep;
|
|
398
|
-
const version = "55.
|
|
398
|
+
const version = "55.17.0";
|
|
399
399
|
let urlAlphabet = "useandom-26T198340PX75pxJACKVERYMINDBUSHWOLF_GQZbfghjklqvwyzrict";
|
|
400
400
|
let nanoid = (size = 21) => {
|
|
401
401
|
let id = "";
|
|
@@ -2651,7 +2651,7 @@ function SubscriptionReactivationsResource({ apiHandler }) {
|
|
|
2651
2651
|
}
|
|
2652
2652
|
};
|
|
2653
2653
|
}
|
|
2654
|
-
function SubscriptionsResource$
|
|
2654
|
+
function SubscriptionsResource$2({ apiHandler }) {
|
|
2655
2655
|
return {
|
|
2656
2656
|
getAll({
|
|
2657
2657
|
filter = null,
|
|
@@ -3106,7 +3106,7 @@ class ApiInstance {
|
|
|
3106
3106
|
this.subscriptionReactivations = SubscriptionReactivationsResource({
|
|
3107
3107
|
apiHandler
|
|
3108
3108
|
});
|
|
3109
|
-
this.subscriptions = SubscriptionsResource$
|
|
3109
|
+
this.subscriptions = SubscriptionsResource$2({ apiHandler });
|
|
3110
3110
|
this.tags = TagsResource({ apiHandler });
|
|
3111
3111
|
this.tagsRules = TagsRulesResource({ apiHandler });
|
|
3112
3112
|
this.tracking = TrackingResource({ apiHandler });
|
|
@@ -3492,7 +3492,7 @@ function ReportsResource({ apiHandler }) {
|
|
|
3492
3492
|
}
|
|
3493
3493
|
};
|
|
3494
3494
|
}
|
|
3495
|
-
function SubscriptionsResource({ apiHandler }) {
|
|
3495
|
+
function SubscriptionsResource$1({ apiHandler }) {
|
|
3496
3496
|
return {
|
|
3497
3497
|
getSubscriptionSummaryMetrics({ subscriptionId }) {
|
|
3498
3498
|
return apiHandler.get(`subscriptions/${subscriptionId}/summary-metrics`);
|
|
@@ -3539,7 +3539,7 @@ const ExperimentalResources = {
|
|
|
3539
3539
|
DataExportsResource,
|
|
3540
3540
|
HistogramsResource,
|
|
3541
3541
|
ReportsResource,
|
|
3542
|
-
SubscriptionsResource,
|
|
3542
|
+
SubscriptionsResource: SubscriptionsResource$1,
|
|
3543
3543
|
TimelinesResource,
|
|
3544
3544
|
LocationResource
|
|
3545
3545
|
};
|
|
@@ -3728,9 +3728,6 @@ function OrdersResource({ apiHandler }) {
|
|
|
3728
3728
|
const params = { filter, sort, limit, offset, q };
|
|
3729
3729
|
return apiHandler.getAll(`orders`, params);
|
|
3730
3730
|
},
|
|
3731
|
-
create({ data }) {
|
|
3732
|
-
return apiHandler.post(`orders`, data);
|
|
3733
|
-
},
|
|
3734
3731
|
get({ id }) {
|
|
3735
3732
|
return apiHandler.get(`orders/${id}`);
|
|
3736
3733
|
},
|
|
@@ -3885,6 +3882,13 @@ function RichBillingPortalsResource({ apiHandler }) {
|
|
|
3885
3882
|
}
|
|
3886
3883
|
};
|
|
3887
3884
|
}
|
|
3885
|
+
function SubscriptionsResource({ apiHandler }) {
|
|
3886
|
+
return {
|
|
3887
|
+
create({ data }) {
|
|
3888
|
+
return apiHandler.post(`subscriptions`, data);
|
|
3889
|
+
}
|
|
3890
|
+
};
|
|
3891
|
+
}
|
|
3888
3892
|
function TransactionsResource({ apiHandler }) {
|
|
3889
3893
|
return {
|
|
3890
3894
|
getAll({
|
|
@@ -3941,6 +3945,7 @@ class StorefrontApiInstance {
|
|
|
3941
3945
|
this.quotes = QuotesResource({ apiHandler });
|
|
3942
3946
|
this.readyToPayout = ReadyToPayoutResource({ apiHandler });
|
|
3943
3947
|
this.richBillingPortals = RichBillingPortalsResource({ apiHandler });
|
|
3948
|
+
this.subscriptions = SubscriptionsResource({ apiHandler });
|
|
3944
3949
|
this.transactions = TransactionsResource({ apiHandler });
|
|
3945
3950
|
this.websites = WebsitesResource({ apiHandler });
|
|
3946
3951
|
this.checkoutForm = this.checkoutForms;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
(function(f,$){typeof exports=="object"&&typeof module!="undefined"?$(exports,require("axios")):typeof define=="function"&&define.amd?define(["exports","axios"],$):(f=typeof globalThis!="undefined"?globalThis:f||self,$(f["rebilly-js-sdk"]={},f.axios))})(this,function(f,$){"use strict";var
|
|
1
|
+
(function(f,$){typeof exports=="object"&&typeof module!="undefined"?$(exports,require("axios")):typeof define=="function"&&define.amd?define(["exports","axios"],$):(f=typeof globalThis!="undefined"?globalThis:f||self,$(f["rebilly-js-sdk"]={},f.axios))})(this,function(f,$){"use strict";var cn=Object.defineProperty;var gn=(f,$,R)=>$ in f?cn(f,$,{enumerable:!0,configurable:!0,writable:!0,value:R}):f[$]=R;var F=(f,$,R)=>(gn(f,typeof $!="symbol"?$+"":$,R),R);function R(t){return t&&typeof t=="object"&&"default"in t?t:{default:t}}var x=R($);function E(t,{exclude:e=[]}={}){Object.freeze(t);const s=typeof t=="function";return Object.getOwnPropertyNames(t).forEach(n=>{(s?n!=="caller"&&n!=="callee"&&n!=="arguments":!0)&&t[n]!==null&&!e.includes(n)&&(typeof t[n]=="object"||typeof t[n]=="function")&&!Object.isFrozen(t[n])&&E(t[n],{exclude:e})}),t}class B{constructor({data:e,status:s,statusText:n,headers:r},u={}){this.response={status:s,statusText:n,headers:r},this.fields={...e},this.config=u,E(this,{exclude:["cancelToken"]})}getJSON(){return JSON.parse(JSON.stringify({fields:this.fields}))}}const K={limit:"pagination-limit",offset:"pagination-offset",total:"pagination-total"};class ee{constructor({data:e,status:s,statusText:n,headers:r},u={}){this.limit=null,this.offset=null,this.total=null,Object.keys(K).forEach(o=>{const l=r[K[o]];this[o]=l?Number(l):null}),this.response={status:s,statusText:n,headers:r},this.items=e.map(o=>new B({data:o,status:s,statusText:n,headers:r})),this.config=u,E(this,{exclude:["cancelToken"]})}getJSON(){return JSON.parse(JSON.stringify({items:this.items}))}}class te{constructor({data:e,status:s,statusText:n,headers:r},u={}){this.response={status:s,statusText:n,headers:r},this.data=e,this.config=u}}class y extends Error{constructor({error:e,name:s=null}){let{config:n=null,response:r=null,request:u=null,message:o=null}=e,l=o||"Request Error";r&&r.data&&r.data.error&&(l=r.data.error),super(l),this.name=s||"RebillyError",this.response=r,this.request=u,this.config=n,this.status=r&&r.status?r.status:null,this.statusText=r&&r.statusText?r.statusText:null,this.details=r&&r.data&&r.data.details?r.data.details:null,this.invalidFields=r&&r.data&&r.data.invalidFields?r.data.invalidFields:null}}class se extends y{constructor(e){super({error:e,name:"RebillyRequestError"})}}class ne extends y{constructor(e){super({error:e,name:"RebillyValidationError"})}}class re extends y{constructor(e){super({error:e,name:"RebillyNotFoundError"})}}class ue extends y{constructor(e){super({error:e,name:"RebillyConflictError"})}}class oe extends y{constructor(e){super({error:e,name:"RebillyForbiddenError"})}}class le extends y{constructor(e){super({error:e,name:"RebillyMethodNotAllowedError"})}}class ce extends y{constructor(e){super({error:e,name:"RebillyTimeoutError"})}}class ie extends y{constructor(e){super({error:e,name:"RebillyCanceledError"})}}const p={RebillyError:y,RebillyRequestError:se,RebillyValidationError:ne,RebillyNotFoundError:re,RebillyConflictError:ue,RebillyForbiddenError:oe,RebillyMethodNotAllowedError:le,RebillyTimeoutError:ce,RebillyCanceledError:ie};var ge=Object.prototype.toString,L=function(e){if(e===void 0)return"undefined";if(e===null)return"null";var s=typeof e;if(s==="boolean")return"boolean";if(s==="string")return"string";if(s==="number")return"number";if(s==="symbol")return"symbol";if(s==="function")return he(e)?"generatorfunction":"function";if(ae(e))return"array";if(Ae(e))return"buffer";if(ye(e))return"arguments";if(fe(e))return"date";if(me(e))return"error";if($e(e))return"regexp";switch(N(e)){case"Symbol":return"symbol";case"Promise":return"promise";case"WeakMap":return"weakmap";case"WeakSet":return"weakset";case"Map":return"map";case"Set":return"set";case"Int8Array":return"int8array";case"Uint8Array":return"uint8array";case"Uint8ClampedArray":return"uint8clampedarray";case"Int16Array":return"int16array";case"Uint16Array":return"uint16array";case"Int32Array":return"int32array";case"Uint32Array":return"uint32array";case"Float32Array":return"float32array";case"Float64Array":return"float64array"}if(pe(e))return"generator";switch(s=ge.call(e),s){case"[object Object]":return"object";case"[object Map Iterator]":return"mapiterator";case"[object Set Iterator]":return"setiterator";case"[object String Iterator]":return"stringiterator";case"[object Array Iterator]":return"arrayiterator"}return s.slice(8,-1).toLowerCase().replace(/\s/g,"")};function N(t){return typeof t.constructor=="function"?t.constructor.name:null}function ae(t){return Array.isArray?Array.isArray(t):t instanceof Array}function me(t){return t instanceof Error||typeof t.message=="string"&&t.constructor&&typeof t.constructor.stackTraceLimit=="number"}function fe(t){return t instanceof Date?!0:typeof t.toDateString=="function"&&typeof t.getDate=="function"&&typeof t.setDate=="function"}function $e(t){return t instanceof RegExp?!0:typeof t.flags=="string"&&typeof t.ignoreCase=="boolean"&&typeof t.multiline=="boolean"&&typeof t.global=="boolean"}function he(t,e){return N(t)==="GeneratorFunction"}function pe(t){return typeof t.throw=="function"&&typeof t.return=="function"&&typeof t.next=="function"}function ye(t){try{if(typeof t.length=="number"&&typeof t.callee=="function")return!0}catch(e){if(e.message.indexOf("callee")!==-1)return!0}return!1}function Ae(t){return t.constructor&&typeof t.constructor.isBuffer=="function"?t.constructor.isBuffer(t):!1}/*!
|
|
2
2
|
* shallow-clone <https://github.com/jonschlinkert/shallow-clone>
|
|
3
3
|
*
|
|
4
4
|
* Copyright (c) 2015-present, Jon Schlinkert.
|
|
@@ -13,4 +13,4 @@
|
|
|
13
13
|
*
|
|
14
14
|
* Copyright (c) 2014-2017, Jon Schlinkert.
|
|
15
15
|
* Released under the MIT License.
|
|
16
|
-
*/var Ie=Ee;function U(t){return Ie(t)===!0&&Object.prototype.toString.call(t)==="[object Object]"}var qe=function(e){var s,r;return!(U(e)===!1||(s=e.constructor,typeof s!="function")||(r=s.prototype,U(r)===!1)||r.hasOwnProperty("isPrototypeOf")===!1)};const xe=Se,Pe=L,Ce=qe;function P(t,e){switch(Pe(t)){case"object":return je(t,e);case"array":return De(t,e);default:return xe(t)}}function je(t,e){if(typeof e=="function")return e(t);if(e||Ce(t)){const s=new t.constructor;for(let r in t)s[r]=P(t[r],e);return s}return t}function De(t,e){const s=new t.constructor(t.length);for(let r=0;r<t.length;r++)s[r]=P(t[r],e);return s}var Me=P;const Oe="55.16.0";let Fe="useandom-26T198340PX75pxJACKVERYMINDBUSHWOLF_GQZbfghjklqvwyzrict",Be=(t=21)=>{let e="",s=t;for(;s--;)e+=Fe[Math.random()*64|0];return e};class Ke{constructor({id:e=null,created:s=null}={}){this.id=e||Be(),this.created=s||new Date().getTime(),this.cancelSource=x.default.CancelToken.source(),this.cancel=this.cancelSource.cancel,this.cancelToken=this.cancelSource.token,E(this,{exclude:["cancelSource","cancelToken","cancel"]})}}class T{constructor(){if(T.instance)return T.instance;this.requests={},T.instance=this}getAll(){return Object.values(this.requests)}getById(e){return this.requests[e]}deleteById(e){!this.requests[e]||delete this.requests[e]}save(){const e=new Ke;return this.requests[e.id]=e,{id:e.id,cancelToken:e.cancelToken}}}var v=new T;class I{}F(I,"cancelById",(e,s)=>{try{v.getById(e).cancel(s),v.deleteById(e)}catch{}}),F(I,"cancelAll",e=>v.getAll().forEach(s=>{s.cancel(e),v.deleteById(s.id)}));var Le={cancelAll:(...t)=>I.cancelAll(...t)};const b={request:"request",response:"response"},V=t=>{if(!Object.values(b).includes(t))throw new Error(`There is no such interceptor type as "${t}"`);return!0};function C({options:t}){const e=s();function s(){return x.default.create(n())}function r(){return e}function n(){return{baseURL:u(),timeout:t.requestTimeout,headers:o()}}function u(){let c=t.isSandbox?t.apiEndpoints.sandbox:t.apiEndpoints.live;return t.apiVersion&&(c=`${c}/${t.apiVersion}`),t.organizationId&&(c=`${c}/organizations/${t.organizationId}`),`${c}`}function o(){const c={"REB-API-CONSUMER":`RebillySDK/JS-SDK ${Oe}`};return t.apiKey&&(c["REB-APIKEY"]=t.apiKey),c}function l(){return Me(e.defaults.headers)}function a(c){t.requestTimeout=Number(c),e.defaults.timeout=t.requestTimeout}function h(c=t.jwt){const i=l();t.apiKey=null,t.jwt=c,delete i.common["REB-APIKEY"],i.common.Authorization=`Bearer ${c}`,e.defaults.headers=i}function k(c=t.publishableKey){const i=l();t.publishableKey=c,i.common.Authorization=`${c}`,e.defaults.headers=i}function M({host:c,port:i,auth:g}){e.defaults.proxy={host:c,port:i,auth:g}}function O({live:c=null,sandbox:i=null}){c&&(t.apiEndpoints.live=c),i&&(t.apiEndpoints.sandbox=i),e.defaults.baseURL=u()}function J(c,{thenDelegate:i,catchDelegate:g=()=>{}}){return V(c)&&e.interceptors[b[c]].use(i,g)}function G(c,i){return V(c)&&e.interceptors[b[c]].eject(i)}function Ys({thenDelegate:c,catchDelegate:i=()=>{}}){return J(b.request,{thenDelegate:c,catchDelegate:i})}function _s(c){G(b.request,c)}function Qs({thenDelegate:c,catchDelegate:i=()=>{}}){return J(b.response,{thenDelegate:c,catchDelegate:i})}function Xs(c){G(b.response,c)}function d({request:c,isCollection:i,config:g}){const m=_(g),{id:A,cancelToken:or}=v.save();m.cancelToken=or;const H=async function(){try{const S=await c(m);return Zs({response:S,isCollection:i,config:m})}catch(S){return Y({error:S,config:m})}finally{v.deleteById(A)}}();return H.cancel=S=>I.cancelById(A,S),H}function Zs({response:c,isCollection:i,config:g}){return i?new ee(c,g):new B(c,g)}function Y({error:c}){if(x.default.isCancel(c))throw new p.RebillyCanceledError(c);if(c.response)switch(Number(c.response.status)){case 401:throw new p.RebillyForbiddenError(c);case 404:throw new p.RebillyNotFoundError(c);case 405:throw new p.RebillyMethodNotAllowedError(c);case 409:throw new p.RebillyConflictError(c);case 422:throw new p.RebillyValidationError(c);default:throw new p.RebillyRequestError(c)}throw c.code==="ECONNABORTED"?new p.RebillyTimeoutError(c):new p.RebillyRequestError(c)}function Hs(c){return c.params!==void 0&&(c.params=Object.keys(c.params).filter(i=>c.params[i]!==null&&c.params[i]!=="").reduce((i,g)=>(i[g]=c.params[g],i),{})),c}function _(c={}){return{...Hs(c)}}function Q(c,i={}){return d({request:g=>e.get(c,g),config:{params:i}})}function er(c,i){return d({request:g=>e.get(c,g),config:{params:i},isCollection:!0})}function X(c,i,g={}){let m={};return g.authenticate===!1&&(m={headers:l()},delete m.headers.common["REB-APIKEY"],delete m.headers.common.Authorization),g.params&&(m.params={...g.params}),d({request:A=>e.post(c,i,A),config:m})}function Z(c,i,g={}){return d({request:m=>e.put(c,i,m),config:{params:g}})}function tr(c,i){return d({request:g=>e.patch(c,i,g),config:{}})}function sr(c){return d({request:i=>e.delete(c,i),config:{}})}function rr(c,i){return d({request:g=>e.delete(c,g),config:{data:{...i}}})}async function nr(c,i,g,m={}){if(i==="")return X(c,g,{params:m});try{if((await Q(c)).response.status===200)throw new p.RebillyConflictError({message:"A resource already exists with this ID. Please use a different ID."})}catch(A){if(A.name==="RebillyNotFoundError")return Z(c,g,m);throw A}}async function ur(c,i){const g=_(i);try{const m=await e.get(c,g);return new te(m,g)}catch(m){return Y({error:m,config:g})}}return{getInstance:r,addRequestInterceptor:Ys,removeRequestInterceptor:_s,addResponseInterceptor:Qs,removeResponseInterceptor:Xs,setTimeout:a,setProxyAgent:M,setSessionToken:h,setPublishableKey:k,setEndpoints:O,get:Q,getAll:er,post:X,put:Z,patch:tr,delete:sr,deleteAll:rr,create:nr,download:ur}}function Ne({apiHandler:t}){return{forgotPassword({data:e}){return t.post("forgot-password",e,{authenticate:!1})}}}function ze({apiHandler:t}){return{getAllowlistCollection({filter:e=null,sort:s=null,limit:r=null,offset:n=null}={}){const u={filter:e,sort:s,limit:r,offset:n};return t.getAll("allowlists",u)},storeAllowlist({data:e}){return t.post("allowlists",e)},getAllowlist({id:e}){return t.get(`allowlists/${e}`)},delete({id:e}){return t.delete(`allowlists/${e}`)}}}function Ue({apiHandler:t}){return{getAll({limit:e=null,offset:s=null,sort:r=null,filter:n=null,q:u=null}={}){const o={limit:e,offset:s,sort:r,filter:n,q:u};return t.getAll("aml-checks",o)},get({id:e}){return t.get(`aml-checks/${e}`)},startReview({id:e}){return t.post(`aml-checks/${e}/start-review`)},stopReview({id:e}){return t.post(`aml-checks/${e}/stop-review`)},review({id:e,data:s}){return t.post(`aml-checks/${e}/review`,s)}}}function Ve({apiHandler:t}){return{getAmlSettings(){return t.get("aml-settings")},putAmlSettings({data:e}){return t.put("aml-settings",e)}}}function We({apiHandler:t}){return{getAll({limit:e=null,offset:s=null,sort:r=null}={}){const n={limit:e,offset:s,sort:r};return t.getAll("api-keys",n)},create({id:e="",data:s}){return t.create(`api-keys/${e}`,e,s)},get({id:e}){return t.get(`api-keys/${e}`)},update({id:e,data:s}){return t.put(`api-keys/${e}`,s)},delete({id:e}){return t.delete(`api-keys/${e}`)}}}function Je({apiHandler:t}){return{get({applicationId:e}){return t.get(`application-instances/${e}`)},upsert({applicationId:e,data:s}){return t.put(`application-instances/${e}`,s)},delete({applicationId:e}){return t.delete(`application-instances/${e}`)},getConfiguration({applicationId:e}){return t.get(`application-instances/${e}/configuration`)},upsertConfiguration({applicationId:e,data:s}){return t.put(`application-instances/${e}/configuration`,s)}}}function Ge({apiHandler:t}){return{getAll({limit:e=null,offset:s=null,filter:r=null,q:n=null,expand:u=null,fields:o=null,sort:l=null}={}){const a={limit:e,offset:s,filter:r,q:n,expand:u,fields:o,sort:l};return t.getAll("applications",a)},create({data:e}){return t.post("applications",e)},get({id:e}){return t.get(`applications/${e}`)},getInstances({id:e,limit:s=null,offset:r=null}){const n={limit:s,offset:r};return t.getAll(`applications/${e}/instances`,n)},getInstance({id:e,organizationId:s}){return t.get(`applications/${e}/instances/${s}`)}}}function Ye({apiHandler:t}){return{getAll({limit:e=null,offset:s=null,filter:r=null,sort:n=null}={}){const u={limit:e,offset:s,filter:r,sort:n};return t.getAll("balance-transactions",u)},get({id:e}){return t.get(`balance-transactions/${e}`)}}}function _e({apiHandler:t}){return{getAll({limit:e=null,offset:s=null,sort:r=null,filter:n=null,q:u=null}={}){const o={limit:e,offset:s,sort:r,filter:n,q:u};return t.getAll("billing-portals",o)},create({id:e="",data:s}){return t.create(`billing-portals/${e}`,e,s)},get({id:e}){return t.get(`billing-portals/${e}`)},update({id:e,data:s}){return t.put(`billing-portals/${e}`,s)},delete({id:e}){return t.delete(`billing-portals/${e}`)}}}function Qe({apiHandler:t}){return{getAll({limit:e=null,offset:s=null,sort:r=null,filter:n=null,q:u=null}={}){const o={limit:e,offset:s,sort:r,filter:n,q:u};return t.getAll("blocklists",o)},create({id:e="",data:s}){return t.create(`blocklists/${e}`,e,s)},get({id:e}){return t.get(`blocklists/${e}`)},delete({id:e}){return t.delete(`blocklists/${e}`)}}}function Xe({apiHandler:t}){return{getAll({limit:e=null,offset:s=null,sort:r=null,filter:n=null}={}){const u={limit:e,offset:s,sort:r,filter:n};return t.getAll("broadcast-messages",u)},create({data:e}){return t.post("broadcast-messages",e)},get({id:e}){return t.get(`broadcast-messages/${e}`)},delete({id:e}){return t.delete(`broadcast-messages/${e}`)},update({id:e,data:s}){return t.patch(`broadcast-messages/${e}`,s)}}}function Ze({apiHandler:t}){return{getAll({limit:e=null,offset:s=null,sort:r=null,filter:n=null,q:u=null}={}){const o={limit:e,offset:s,sort:r,filter:n,q:u};return t.getAll("checkout-forms",o)},create({id:e="",data:s}){return t.create(`checkout-forms/${e}`,e,s)},get({id:e}){return t.get(`checkout-forms/${e}`)},update({id:e,data:s}){return t.put(`checkout-forms/${e}`,s)},delete({id:e}){return t.delete(`checkout-forms/${e}`)}}}function He({apiHandler:t}){return{getAllRedemptions({limit:e=null,offset:s=null,filter:r=null,q:n=null,sort:u=null}={}){const o={limit:e,offset:s,filter:r,q:n,sort:u};return t.getAll("coupons-redemptions",o)},redeem({data:e}){return t.post("coupons-redemptions",e)},getRedemption({id:e}){return t.get(`coupons-redemptions/${e}`)},cancelRedemption({id:e}){return t.post(`coupons-redemptions/${e}/cancel`)},getAll({limit:e=null,offset:s=null,filter:r=null,q:n=null,sort:u=null}={}){const o={limit:e,offset:s,filter:r,q:n,sort:u};return t.getAll("coupons",o)},create({id:e="",data:s}){return t.create(`coupons/${e}`,e,s)},get({id:e}){return t.get(`coupons/${e}`)},update({id:e,data:s}){return t.put(`coupons/${e}`,s)},setExpiration({id:e,data:s}){return t.post(`coupons/${e}/expiration`,s)}}}function et({apiHandler:t}){return{getAll({filter:e=null,sort:s=null,limit:r=null,offset:n=null,q:u=null}={}){const o={filter:e,sort:s,limit:r,offset:n,q:u};return t.getAll("credit-memos",o)},create({id:e="",data:s}){return t.create(`credit-memos/${e}`,e,s)},get({id:e}){return t.get(`credit-memos/${e}`)},update({id:e,data:s}){return t.put(`credit-memos/${e}`,s)},patch({id:e,data:s}){return t.patch(`credit-memos/${e}`,s)},void({id:e}){return t.post(`credit-memos/${e}/void`)},getAllTimelineMessages({id:e,limit:s=null,offset:r=null,filter:n=null,sort:u=null,q:o=null}){const l={limit:s,offset:r,filter:n,sort:u,q:o};return t.getAll(`credit-memos/${e}/timeline`,l)},createTimelineComment({id:e,data:s}){return t.post(`credit-memos/${e}/timeline`,s)},getTimelineMessage({id:e,messageId:s}){return t.get(`credit-memos/${e}/timeline/${s}`)},deleteTimelineMessage({id:e,messageId:s}){return t.delete(`credit-memos/${e}/timeline/${s}`)}}}function tt({apiHandler:t}){return{getAll({limit:e=null,offset:s=null,sort:r=null,filter:n=null,q:u=null}={}){const o={limit:e,offset:s,sort:r,filter:n,q:u};return t.getAll("custom-domains",o)},create({data:e}){return t.post("custom-domains",e)},get({domain:e}){return t.get(`custom-domains/${e}`)},delete({domain:e}){return t.delete(`custom-domains/${e}`)}}}function st({apiHandler:t}){return{getAll({resource:e,limit:s=null,offset:r=null}){const n={limit:s,offset:r};return t.getAll(`custom-fields/${e}`,n)},get({resource:e,name:s}){return t.get(`custom-fields/${e}/${s}`)},create({resource:e,name:s,data:r}){return t.put(`custom-fields/${e}/${s}`,r)},update({resource:e,name:s,data:r}){return t.put(`custom-fields/${e}/${s}`,r)}}}function rt({apiHandler:t}){return{getAuthOptions(){return t.get("authentication-options")},updateAuthOptions({data:e}){return t.put("authentication-options",e)},getAllAuthTokens({limit:e=null,offset:s=null}={}){const r={limit:e,offset:s};return t.getAll("authentication-tokens",r)},login({data:e}){return t.post("authentication-tokens",e)},verify({token:e}){return t.get(`authentication-tokens/${e}`)},logout({token:e}){return t.delete(`authentication-tokens/${e}`)},exchangeToken({token:e,data:s}){return t.post(`authentication-tokens/${e}/exchange`,s)},getAllCredentials({limit:e=null,offset:s=null}={}){const r={limit:e,offset:s};return t.getAll("credentials",r)},createCredential({id:e="",data:s}){return t.create(`credentials/${e}`,e,s)},getCredential({id:e}){return t.get(`credentials/${e}`)},updateCredential({id:e,data:s}){return t.put(`credentials/${e}`,s)},deleteCredential({id:e}){return t.delete(`credentials/${e}`)},getAllResetPasswordTokens({limit:e=null,offset:s=null}={}){const r={limit:e,offset:s};return t.getAll("password-tokens",r)},createResetPasswordToken({data:e}){return t.post("password-tokens",e)},getResetPasswordToken({id:e}){return t.get(`password-tokens/${e}`)},deleteResetPasswordToken({id:e}){return t.delete(`password-tokens/${e}`)}}}function nt({apiHandler:t}){return{getAll({limit:e=null,offset:s=null,filter:r=null,q:n=null,expand:u=null,fields:o=null,sort:l=null}={}){const a={limit:e,offset:s,filter:r,q:n,expand:u,fields:o,sort:l};return t.getAll("customers",a)},create({id:e="",data:s,expand:r=null}){const n={expand:r};return t.create(`customers/${e}`,e,s,n)},get({id:e,expand:s=null,fields:r=null}){const n={expand:s,fields:r};return t.get(`customers/${e}`,n)},update({id:e,data:s,expand:r=null}){const n={expand:r};return t.put(`customers/${e}`,s,n)},merge({id:e,targetCustomerId:s}){return t.delete(`customers/${e}?targetCustomerId=${s}`)},getLeadSource({id:e}){return t.get(`customers/${e}/lead-source`)},createLeadSource({id:e,data:s}){return t.put(`customers/${e}/lead-source`,s)},updateLeadSource({id:e,data:s}){return t.put(`customers/${e}/lead-source`,s)},deleteLeadSource({id:e}){return t.delete(`customers/${e}/lead-source`)},getAllTimelineMessages({id:e,limit:s=null,offset:r=null,filter:n=null,sort:u=null,q:o=null}){const l={limit:s,offset:r,filter:n,sort:u,q:o};return t.getAll(`customers/${e}/timeline`,l)},createTimelineComment({id:e,data:s}){return t.post(`customers/${e}/timeline`,s)},getTimelineMessage({id:e,messageId:s}){return t.get(`customers/${e}/timeline/${s}`)},deleteTimelineMessage({id:e,messageId:s}){return t.delete(`customers/${e}/timeline/${s}`)},getCustomerEddScore({id:e}){return t.get(`customers/${e}/edd-score`)},patchCustomerEddScore({id:e,data:s}){return t.patch(`customers/${e}/edd-score`,s)},getEddTimelineCollection({id:e,limit:s=null,offset:r=null,filter:n=null,sort:u=null,q:o=null}){const l={limit:s,offset:r,filter:n,sort:u,q:o};return t.getAll(`customers/${e}/edd-timeline`,l)},createEddTimelineComment({id:e,data:s}){return t.post(`customers/${e}/edd-timeline`,s)},getEddTimelineMessage({id:e,messageId:s}){return t.get(`customers/${e}/edd-timeline/${s}`)},deleteEddTimelineMessage({id:e,messageId:s}){return t.delete(`customers/${e}/edd-timeline/${s}`)},getAllEddSearchResults({id:e,limit:s=null,offset:r=null}){const n={limit:s,offset:r};return t.getAll(`customers/${e}/edd-search-results`,n)},getEddSearchResult({id:e,searchResultId:s}){return t.get(`customers/${e}/edd-search-results/${s}`)}}}function ut({apiHandler:t}){return{getAll({limit:e=null,offset:s=null,filter:r=null,sort:n=null}={}){const u={limit:e,offset:s,filter:r,sort:n};return t.getAll("deposit-custom-property-sets",u)},create({id:e="",data:s}){return t.create(`deposit-custom-property-sets/${e}`,e,s)},get({id:e}){return t.get(`deposit-custom-property-sets/${e}`)},update({id:e,data:s}){return t.put(`deposit-custom-property-sets/${e}`,s)},delete({id:e}){return t.delete(`deposit-custom-property-sets/${e}`)}}}function ot({apiHandler:t}){return{getAll({limit:e=null,offset:s=null,filter:r=null,sort:n=null}={}){const u={limit:e,offset:s,filter:r,sort:n};return t.getAll("deposit-requests",u)},create({data:e}){return t.post("deposit-requests",e)},get({id:e,expand:s=null}){const r={expand:s};return t.get(`deposit-requests/${e}`,r)}}}function lt({apiHandler:t}){return{getAll({limit:e=null,offset:s=null,filter:r=null,sort:n=null}={}){const u={limit:e,offset:s,filter:r,sort:n};return t.getAll("deposit-strategies",u)},create({id:e="",data:s}){return t.create(`deposit-strategies/${e}`,e,s)},get({id:e}){return t.get(`deposit-strategies/${e}`)},update({id:e,data:s}){return t.put(`deposit-strategies/${e}`,s)},delete({id:e}){return t.delete(`deposit-strategies/${e}`)}}}function ct({apiHandler:t}){return{validate({data:e}){return t.post("digital-wallets/validation",e)},create({data:e}){return t.post("digital-wallets/onboarding/apple-pay",e)}}}function it({apiHandler:t}){return{getAll({filter:e=null,sort:s=null,limit:r=null,offset:n=null,q:u=null,expand:o=null}={}){const l={filter:e,sort:s,limit:r,offset:n,q:u,expand:o};return t.getAll("disputes",l)},create({id:e="",data:s,expand:r=null}){const n={expand:r};return t.create(`disputes/${e}`,e,s,n)},get({id:e}){return t.get(`disputes/${e}`)},update({id:e,data:s,expand:r=null}){const n={expand:r};return t.put(`disputes/${e}`,s,n)}}}function gt({apiHandler:t}){return{verify({token:e}){return t.put(`email-delivery-setting-verifications/${e}`)},getAll({limit:e=null,offset:s=null,filter:r=null,sort:n=null,q:u=null}={}){const o={limit:e,offset:s,filter:r,sort:n,q:u};return t.getAll("email-delivery-settings",o)},create({data:e}){return t.post("email-delivery-settings",e)},get({id:e}){return t.get(`email-delivery-settings/${e}`)},delete({id:e}){return t.delete(`email-delivery-settings/${e}`)},update({id:e,data:s}){return t.patch(`email-delivery-settings/${e}`,s)},resendVerification({id:e}){return t.post(`email-delivery-settings/${e}/resend-email-verification`)}}}function at({apiHandler:t}){return{getAll({limit:e=null,offset:s=null,q:r=null,sort:n=null,filter:u=null}={}){const o={limit:e,offset:s,q:r,sort:n,filter:u};return t.getAll("email-messages",o)},create({data:e}){return t.post("email-messages",e)},get({id:e}){return t.get(`email-messages/${e}`)},delete({id:e}){return t.delete(`email-messages/${e}`)},send({id:e,data:s={status:"outbox"}}){return t.patch(`email-messages/${e}`,s)}}}function mt({apiHandler:t}){return{getAll({limit:e=null,offset:s=null}={}){const r={limit:e,offset:s};return t.getAll("email-notifications",r)}}}function ft({apiHandler:t}){return{getAll(){return t.getAll("events")},get({eventType:e}){return t.get(`events/${e}`)},getRules({eventType:e}){return t.get(`events/${e}/rules`)},createRules({eventType:e,data:s}){return t.put(`events/${e}/rules`,s)},updateRules({eventType:e,data:s}){return t.put(`events/${e}/rules`,s)},getAllTimelineMessages({eventType:e,limit:s=null,offset:r=null,filter:n=null,sort:u=null,q:o=null}){const l={limit:s,offset:r,filter:n,sort:u,q:o};return t.getAll(`events/${e}/timeline`,l)},createTimelineComment({eventType:e,data:s}){return t.post(`events/${e}/timeline`,s)},getTimelineMessage({eventType:e,messageId:s}){return t.get(`events/${e}/timeline/${s}`)},deleteTimelineMessage({eventType:e,messageId:s}){return t.delete(`events/${e}/timeline/${s}`)},getRulesHistory({eventType:e,limit:s=null,offset:r=null,filter:n=null,q:u=null,sort:o=null,fields:l=null}){const a={limit:s,offset:r,filter:n,q:u,sort:o,fields:l};return t.getAll(`events/${e}/rules/history`,a)},getRulesVersionNumber({eventType:e,version:s,fields:r=null}){const n={fields:r};return t.get(`events/${e}/rules/history/${s}`,n)},getRulesVersionDetail({eventType:e,version:s,fields:r=null}){const n={fields:r};return t.get(`events/${e}/rules/versions/${s}`,n)},getAllDraftRulesets({eventType:e,limit:s=null,offset:r=null,filter:n=null,q:u=null,sort:o=null,fields:l=null}){const a={limit:s,offset:r,filter:n,q:u,sort:o,fields:l};return t.getAll(`events/${e}/rules/drafts`,a)},createDraftRuleset({eventType:e,data:s}){return t.post(`events/${e}/rules/drafts`,s)},getDraftRuleset({eventType:e,id:s,fields:r=null}){const n={fields:r};return t.get(`events/${e}/rules/drafts/${s}`,n)},updateDraftRuleset({eventType:e,id:s,data:r}){return t.put(`events/${e}/rules/drafts/${s}`,r)},deleteDraftRuleset({eventType:e,id:s}){return t.delete(`events/${e}/rules/drafts/${s}`)}}}function $t({apiHandler:t}){return{get({resource:e,resourceId:s,service:r}){return t.get(`${e}/${s}/external-identifiers/${r}`)},sync({resource:e,resourceId:s,service:r}){return t.post(`${e}/${s}/external-identifiers/${r}`)},update({resource:e,resourceId:s,service:r,data:n}){return t.put(`${e}/${s}/external-identifiers/${r}`,n)},delete({resource:e,resourceId:s,service:r}){return t.delete(`${e}/${s}/external-identifiers/${r}`)}}}function ht({apiHandler:t}){return{getExternalServiceSettings(){return t.get("external-services-settings")},updateExternalServiceSettings({data:e}){return t.put("external-services-settings",e)}}}function pt({apiHandler:t}){return{getAll({limit:e=null,offset:s=null,filter:r=null,sort:n=null}={}){const u={limit:e,offset:s,filter:r,sort:n};return t.getAll("fees",u)},create({id:e="",data:s}){return t.create(`fees/${e}`,e,s)},get({id:e}){return t.get(`fees/${e}`)},upsert({id:e,data:s}){return t.put(`fees/${e}`,s)},delete({id:e}){return t.delete(`fees/${e}`)},patch({id:e,data:s}){return t.patch(`fees/${e}`,s)}}}function yt({apiHandler:t}){return{getAllAttachments({limit:e=null,offset:s=null,filter:r=null,q:n=null,expand:u=null,fields:o=null,sort:l=null}={}){const a={limit:e,offset:s,filter:r,q:n,expand:u,fields:o,sort:l};return t.getAll("attachments",a)},attach({id:e="",data:s,expand:r=null}){const n={expand:r};return t.create(`attachments/${e}`,e,s,n)},getAttachment({id:e}){return t.get(`attachments/${e}`)},updateAttachment({id:e,data:s,expand:r=null}){const n={expand:r};return t.put(`attachments/${e}`,s,n)},detach({id:e}){return t.delete(`attachments/${e}`)},getAll({limit:e=null,offset:s=null,filter:r=null,q:n=null,fields:u=null,sort:o=null}={}){const l={limit:e,offset:s,filter:r,q:n,fields:u,sort:o};return t.getAll("files",l)},upload({fileObject:e}){return t.post("files",e)},get({id:e}){return t.get(`files/${e}`)},update({id:e,data:s}){return t.put(`files/${e}`,s)},delete({id:e}){return t.delete(`files/${e}`)},download({id:e}){const s={responseType:"arraybuffer"};return t.download(`files/${e}/download`,s)},detachAndDelete({id:e}){const s={filter:`fileId:${e}`};let r=[];const u=(async()=>{const o=this.getAllAttachments(s);r.push(o);const a=(await o).items.map(k=>this.detach({id:k.fields.id}));r=[...r,a],await Promise.all(a);const h=t.delete(`files/${e}`);return r.push(h),h})();return u.cancel=()=>{r.forEach(o=>o.cancel())},u},uploadAndUpdate({fileObject:e,data:s={description:"",tags:[""]}}){const r=[],u=(async()=>{const o=this.upload({fileObject:e});r.push(o),await o;const l={name:o.name,extension:o.extension,description:s.description,tags:s.tags,url:""},a=this.update({id:o.fields.id,data:l});return r.push(a),a})();return u.cancel=()=>{r.forEach(o=>o.cancel())},u}}}function At({apiHandler:t}){return{getAll({limit:e=null,offset:s=null,sort:r=null,filter:n=null,q:u=null,fields:o=null}={}){const l={limit:e,offset:s,sort:r,filter:n,q:u,fields:o};return t.getAll("gateway-accounts",l)},create({id:e="",data:s}){return t.create(`gateway-accounts/${e}`,e,s)},get({id:e}){return t.get(`gateway-accounts/${e}`)},update({id:e,data:s}){return t.patch(`gateway-accounts/${e}`,s)},delete({id:e}){return t.delete(`gateway-accounts/${e}`)},close({id:e}){return t.post(`gateway-accounts/${e}/close`)},disable({id:e}){return t.post(`gateway-accounts/${e}/disable`)},getAllDowntimeSchedules({id:e,limit:s=null,offset:r=null,filter:n=null,sort:u=null}){const o={limit:s,offset:r,filter:n,sort:u};return t.getAll(`gateway-accounts/${e}/downtime-schedules`,o)},createDowntimeSchedule({id:e,data:s}){return t.post(`gateway-accounts/${e}/downtime-schedules`,s)},getDowntimeSchedule({id:e,downtimeId:s}){return t.get(`gateway-accounts/${e}/downtime-schedules/${s}`)},updateDowntimeSchedule({id:e,downtimeId:s,data:r}){return t.put(`gateway-accounts/${e}/downtime-schedules/${s}`,r)},deleteDowntimeSchedule({id:e,downtimeId:s}){return t.delete(`gateway-accounts/${e}/downtime-schedules/${s}`)},enable({id:e}){return t.post(`gateway-accounts/${e}/enable`)},getAllVolumeLimits({id:e}){return t.getAll(`gateway-accounts/${e}/limits`)},getVolumeLimit({id:e,limitId:s}){return t.get(`gateway-accounts/${e}/limits/${s}`)},updateVolumeLimit({id:e,limitId:s,data:r}){return t.put(`gateway-accounts/${e}/limits/${s}`,r)},deleteVolumeLimit({id:e,limitId:s}){return t.delete(`gateway-accounts/${e}/limits/${s}`)},getAllTimelineMessages({id:e,limit:s=null,offset:r=null,filter:n=null,sort:u=null,q:o=null}){const l={limit:s,offset:r,filter:n,sort:u,q:o};return t.getAll(`gateway-accounts/${e}/timeline`,l)},createTimelineComment({id:e,data:s}){return t.post(`gateway-accounts/${e}/timeline`,s)},getTimelineMessage({id:e,messageId:s}){return t.get(`gateway-accounts/${e}/timeline/${s}`)},deleteTimelineMessage({id:e,messageId:s}){return t.delete(`gateway-accounts/${e}/timeline/${s}`)},checkCredentials({id:e}){return t.post(`gateway-accounts/${e}/check-credentials`)},getFinancialSettings({id:e}){return t.get(`gateway-accounts/${e}/financial-settings`)},setFinancialSettings({id:e,data:s}){return t.put(`gateway-accounts/${e}/financial-settings`,s)}}}function Rt({apiHandler:t}){return{getAll({limit:e=null,offset:s=null}={}){const r={limit:e,offset:s};return t.getAll("integrations",r)},get({label:e}){return t.get(`integrations/${e}`)}}}const q={Accept:"application/pdf"};function bt({apiHandler:t}){return{getAll({filter:e=null,sort:s=null,limit:r=null,offset:n=null,q:u=null,expand:o=null}={}){const l={filter:e,sort:s,limit:r,offset:n,q:u,expand:o};return t.getAll("invoices",l)},create({id:e="",data:s}){return t.create(`invoices/${e}`,e,s)},get({id:e,expand:s=null}){const r={expand:s};return t.get(`invoices/${e}`,r)},update({id:e,data:s}){return t.put(`invoices/${e}`,s)},getAllInvoiceItems({id:e,limit:s=null,offset:r=null,expand:n=null}){const u={limit:s,offset:r,expand:n};return t.getAll(`invoices/${e}/items`,u)},createInvoiceItem({id:e,data:s}){return t.post(`invoices/${e}/items`,s)},getInvoiceItem({id:e,itemId:s}){return t.get(`invoices/${e}/items/${s}`)},updateInvoiceItem({id:e,itemId:s,data:r}){return t.put(`invoices/${e}/items/${s}`,r)},deleteInvoiceItem({id:e,itemId:s}){return t.delete(`invoices/${e}/items/${s}`)},issue({id:e,data:s}){return t.post(`invoices/${e}/issue`,s)},abandon({id:e}){return t.post(`invoices/${e}/abandon`)},void({id:e}){return t.post(`invoices/${e}/void`)},recalculate({id:e}){return t.post(`invoices/${e}/recalculate`)},reissue({id:e,data:s}){return t.post(`invoices/${e}/reissue`,s)},getAllTransactionAllocations({id:e,limit:s=null,offset:r=null}){const n={limit:s,offset:r};return t.getAll(`invoices/${e}/transaction-allocations`,n)},applyTransaction({id:e,data:s}){return t.post(`invoices/${e}/transaction`,s)},getAllTimelineMessages({id:e,limit:s=null,offset:r=null,filter:n=null,sort:u=null,q:o=null}){const l={limit:s,offset:r,filter:n,sort:u,q:o};return t.getAll(`invoices/${e}/timeline`,l)},createTimelineComment({id:e,data:s}){return t.post(`invoices/${e}/timeline`,s)},getTimelineMessage({id:e,messageId:s}){return t.get(`invoices/${e}/timeline/${s}`)},deleteTimelineMessage({id:e,messageId:s}){return t.delete(`invoices/${e}/timeline/${s}`)},downloadPDF({id:e}){const s={headers:q,responseType:"arraybuffer"};return t.download(`invoices/${e}`,s)}}}function wt({apiHandler:t}){return{getAllAccounts({limit:e=null,offset:s=null,filter:r=null,sort:n=null}={}){const u={limit:e,offset:s,filter:r,sort:n};return t.getAll("journal-accounts",u)},createAccount({id:e="",data:s}){return t.create(`journal-accounts/${e}`,e,s)},getAccount({id:e}){return t.get(`journal-accounts/${e}`)},updateAccount({id:e,data:s}){return t.put(`journal-accounts/${e}`,s)}}}function kt({apiHandler:t}){return{getAllEntries({limit:e=null,offset:s=null,filter:r=null,sort:n=null}={}){const u={limit:e,offset:s,filter:r,sort:n};return t.getAll("journal-entries",u)},createEntry({id:e="",data:s}){return t.create(`journal-entries/${e}`,e,s)},getEntry({id:e}){return t.get(`journal-entries/${e}`)},updateEntry({id:e,data:s}){return t.put(`journal-entries/${e}`,s)},getAllRecords({id:e,limit:s=null,offset:r=null,filter:n=null,sort:u=null,expand:o=null}){const l={limit:s,offset:r,filter:n,sort:u,expand:o};return t.getAll(`journal-entries/${e}/records`,l)},createRecord({id:e,data:s}){return t.post(`journal-entries/${e}/records`,s)},getRecord({id:e,journalRecordId:s}){return t.get(`journal-entries/${e}/records/${s}`)},updateRecord({id:e,journalRecordId:s,data:r}){return t.put(`journal-entries/${e}/records/${s}`,r)},deleteRecord({id:e,journalRecordId:s}){return t.delete(`journal-entries/${e}/records/${s}`)}}}function dt({apiHandler:t}){return{getAll({limit:e=null,offset:s=null,filter:r=null,sort:n=null,expand:u=null}={}){const o={limit:e,offset:s,filter:r,sort:n,expand:u};return t.getAll("kyc-documents",o)},create({id:e="",data:s}){return t.create(`kyc-documents/${e}`,e,s)},get({id:e}){return t.get(`kyc-documents/${e}`)},update({id:e,data:s}){return t.put(`kyc-documents/${e}`,s)},accept({id:e}){return t.post(`kyc-documents/${e}/acceptance`)},matches({id:e,data:s}){return t.post(`kyc-documents/${e}/matches`,s)},reject({id:e,data:s}){return t.post(`kyc-documents/${e}/rejection`,s)},review({id:e}){return t.post(`kyc-documents/${e}/review`)},startReview({id:e}){return t.post(`kyc-documents/${e}/start-review`)},stopReview({id:e}){return t.post(`kyc-documents/${e}/stop-review`)}}}function vt({apiHandler:t}){return{getAll({limit:e=null,offset:s=null,filter:r=null,sort:n=null}={}){const u={limit:e,offset:s,filter:r,sort:n};return t.getAll("kyc-requests",u)},create({data:e}){return t.post("kyc-requests",e)},get({id:e}){return t.get(`kyc-requests/${e}`)},delete({id:e}){return t.delete(`kyc-requests/${e}`)},update({id:e,data:s}){return t.patch(`kyc-requests/${e}`,s)}}}function Tt({apiHandler:t}){return{getKycSettings(){return t.get("kyc-settings")},updateKycSettings({data:e}){return t.put("kyc-settings",e)}}}function St({apiHandler:t}){return{getAll({limit:e=null,offset:s=null,filter:r=null,sort:n=null,fields:u=null,q:o=null}={}){const l={limit:e,offset:s,filter:r,sort:n,fields:u,q:o};return t.getAll("lists",l)},create({id:e="",data:s}){return t.create(`lists/${e}`,e,s)},getLatestVersion({id:e}){return t.get(`lists/${e}`)},update({id:e,data:s}){return t.put(`lists/${e}`,s)},delete({id:e}){return t.delete(`lists/${e}`)},getByVersion({id:e,version:s}){return t.get(`lists/${e}/${s}`)}}}function Et({apiHandler:t}){return{getAll({limit:e=null,offset:s=null,filter:r=null,sort:n=null}={}){const u={limit:e,offset:s,filter:r,sort:n};return t.getAll("memberships",u)},get({organizationId:e,userId:s}){return t.get(`memberships/${e}/${s}`)},update({organizationId:e,userId:s,data:r}){return t.put(`memberships/${e}/${s}`,r)},delete({organizationId:e,userId:s}){return t.delete(`memberships/${e}/${s}`)}}}function It({apiHandler:t}){return{getAll({limit:e=null,offset:s=null,filter:r=null,q:n=null,sort:u=null}={}){const o={limit:e,offset:s,filter:r,q:n,sort:u};return t.getAll("organization-exports",o)},create({data:e}){return t.post("organization-exports",e)},get({id:e}){return t.get(`organization-exports/${e}`)}}}function qt({apiHandler:t}){return{getAll({limit:e=null,offset:s=null,filter:r=null,sort:n=null,q:u=null}={}){const o={limit:e,offset:s,filter:r,sort:n,q:u};return t.getAll("organizations",o)},create({data:e}){return t.post("organizations",e)},get({id:e}){return t.get(`organizations/${e}`)},update({id:e,data:s}){return t.patch(`organizations/${e}`,s)}}}function xt({apiHandler:t}){return{getAll({limit:e=null,q:s=null}={}){const r={limit:e,q:s};return t.getAll("payment-cards-bank-names",r)}}}function Pt({apiHandler:t}){return{getAll({filter:e=null,sort:s=null,limit:r=null,offset:n=null,q:u=null,expand:o=null}={}){const l={filter:e,sort:s,limit:r,offset:n,q:u,expand:o};return t.getAll("payment-instruments",l)},create({data:e}){return t.post("payment-instruments",e)},get({id:e}){return t.get(`payment-instruments/${e}`)},update({id:e,data:s}){return t.patch(`payment-instruments/${e}`,s)},deactivate({id:e}){return t.post(`payment-instruments/${e}/deactivation`)}}}function Ct({apiHandler:t}){return{getAll({limit:e=null,offset:s=null}={}){const r={limit:e,offset:s};return t.getAll("payment-methods",r)},get({apiName:e}){return t.get(`payment-methods/${e}`)}}}function jt({apiHandler:t}){return{getAll({limit:e=null,offset:s=null}={}){const r={limit:e,offset:s};return t.getAll("tokens",r)},create({data:e}){return t.post("tokens",e)},get({token:e}){return t.get(`tokens/${e}`)}}}function Dt({apiHandler:t}){return{getAll({limit:e=null,offset:s=null,filter:r=null,sort:n=null}={}){const u={limit:e,offset:s,filter:r,sort:n};return t.getAll("payout-requests",u)},create({id:e="",data:s}){return t.create(`payout-requests/${e}`,e,s)},get({id:e}){return t.get(`payout-requests/${e}`)},update({id:e,data:s}){return t.put(`payout-requests/${e}`,s)},getPaymentInstruments({id:e}){return t.get(`payout-requests/${e}/payment-instruments`)}}}function Mt({apiHandler:t}){return{create({data:e}){return t.post("payouts",e)}}}function Ot({apiHandler:t}){return{getAll({filter:e=null,sort:s=null,limit:r=null,offset:n=null,q:u=null}={}){const o={filter:e,sort:s,limit:r,offset:n,q:u};return t.getAll("plans",o)},create({id:e="",data:s}){return t.create(`plans/${e}`,e,s)},get({id:e}){return t.get(`plans/${e}`)},update({id:e,data:s}){return t.put(`plans/${e}`,s)},delete({id:e}){return t.delete(`plans/${e}`)}}}function Ft({apiHandler:t}){return{order({data:e}){return t.post("previews/orders",e)},sendEmailRuleAction({data:e}){return t.post("previews/rule-actions/send-email",e)},webhook({data:e}){return t.post("previews/webhooks",e)}}}function Bt({apiHandler:t}){return{getAll({filter:e=null,sort:s=null,limit:r=null,offset:n=null,q:u=null}={}){const o={filter:e,sort:s,limit:r,offset:n,q:u};return t.getAll("products",o)},create({id:e="",data:s}){return t.create(`products/${e}`,e,s)},get({id:e}){return t.get(`products/${e}`)},update({id:e,data:s}){return t.put(`products/${e}`,s)},delete({id:e}){return t.delete(`products/${e}`)}}}function Kt({apiHandler:t}){return{startPermissionsEmulation({data:e}){return t.post("permissions-emulation",e)},stopPermissionsEmulation(){return t.delete("permissions-emulation")},get(){return t.get("profile")},update({data:e}){return t.put("profile",e)},getMfa(){return t.get("profile/mfa")},updateMfa(){return t.post("profile/mfa")},deleteMfa(){return t.delete("profile/mfa")}}}function Lt({apiHandler:t}){return{readyToPay({data:e}){return t.post("ready-to-pay",e)}}}function Nt({apiHandler:t}){return{getAll({filter:e=null,sort:s=null,limit:r=null,offset:n=null,expand:u=null}={}){const o={filter:e,sort:s,limit:r,offset:n,expand:u};return t.getAll("quotes",o)},create({id:e="",data:s}){return t.create(`quotes/${e}`,e,s)},get({id:e,expand:s=null}){const r={expand:s};return t.get(`quotes/${e}`,r)},update({id:e,data:s}){return t.put(`quotes/${e}`,s)},patch({id:e,data:s}){return t.patch(`quotes/${e}`,s)},accept({id:e}){return t.post(`quotes/${e}/accept`)},cancel({id:e}){return t.post(`quotes/${e}/cancel`)},issue({id:e}){return t.post(`quotes/${e}/issue`)},recall({id:e}){return t.post(`quotes/${e}/recall`)},reject({id:e}){return t.post(`quotes/${e}/reject`)},getAllTimelineMessages({id:e,limit:s=null,offset:r=null,filter:n=null,sort:u=null,q:o=null}){const l={limit:s,offset:r,filter:n,sort:u,q:o};return t.getAll(`quotes/${e}/timeline`,l)},createTimelineComment({id:e,data:s}){return t.post(`quotes/${e}/timeline`,s)},getTimelineMessage({id:e,messageId:s}){return t.get(`quotes/${e}/timeline/${s}`)},deleteTimelineMessage({id:e,messageId:s}){return t.delete(`quotes/${e}/timeline/${s}`)},downloadPDF({id:e}){const s={headers:q,responseType:"arraybuffer"};return t.download(`quotes/${e}`,s)}}}function zt({apiHandler:t}){return{get({resource:e,resourceId:s,service:r}){return t.get(`${e}/${s}/external-identifiers/${r}`)},sync({resource:e,resourceId:s,service:r}){return t.post(`${e}/${s}/external-identifiers/${r}`)},update({resource:e,resourceId:s,service:r,data:n}){return t.put(`${e}/${s}/external-identifiers/${r}`,n)},delete({resource:e,resourceId:s,service:r}){return t.delete(`${e}/${s}/external-identifiers/${r}`)}}}function Ut({apiHandler:t}){return{getAll({filter:e=null,sort:s=null,limit:r=null,offset:n=null,q:u=null}={}){const o={filter:e,sort:s,limit:r,offset:n,q:u};return t.getAll("rich-billing-portals",o)},create({id:e="",data:s}){return t.create(`rich-billing-portals/${e}`,e,s)},get({id:e}){return t.get(`rich-billing-portals/${e}`)},update({id:e,data:s}){return t.put(`rich-billing-portals/${e}`,s)}}}function Vt({apiHandler:t}){return{getAll(){return t.get("risk-score-rules")},updateRiskScoreRules({data:e}){return t.put("risk-score-rules",e)},getAllBlocklistRules(){return t.get("risk-score-rules/blocklists")},updateRiskScoreBlocklistRules({data:e}){return t.put("risk-score-rules/blocklists",e)}}}function Wt({apiHandler:t}){return{getAll({limit:e=null,offset:s=null,filter:r=null,sort:n=null,q:u=null,expand:o=null}={}){const l={limit:e,offset:s,filter:r,sort:n,q:u,expand:o};return t.getAll("roles",l)},create({id:e="",data:s}){return t.create(`roles/${e}`,e,s)},get({id:e,expand:s=null}){const r={expand:s};return t.get(`roles/${e}`,r)},update({id:e,data:s}){return t.put(`roles/${e}`,s)},delete({id:e}){return t.delete(`roles/${e}`)}}}function Jt({apiHandler:t}){return{get({sort:e=null,limit:s=null,offset:r=null,q:n=null}){const u={sort:e,limit:s,offset:r,q:n};return t.get("search",u)}}}function Gt({apiHandler:t}){return{getAll({limit:e=null,offset:s=null,sort:r=null,filter:n=null,q:u=null}={}){const o={limit:e,offset:s,sort:r,filter:n,q:u};return t.getAll("grid-segments",o)},create({id:e="",data:s}){return t.create(`grid-segments/${e}`,e,s)},get({id:e}){return t.get(`grid-segments/${e}`)},update({id:e,data:s}){return t.put(`grid-segments/${e}`,s)},delete({id:e}){return t.delete(`grid-segments/${e}`)}}}function Yt({apiHandler:t}){return{getAll({eventType:e}){return t.getAll(`send-through-attribution/${e}`)}}}function _t({apiHandler:t}){return{getAll({type:e,filter:s=null,limit:r=null,offset:n=null,sort:u=null,q:o=null}){const l={filter:s,limit:r,offset:n,sort:u,q:o};return t.getAll(`service-credentials/${e}`,l)},create({type:e,data:s}){return t.post(`service-credentials/${e}`,s)},get({type:e,id:s}){return t.get(`service-credentials/${e}/${s}`)},update({type:e,id:s,data:r}){return t.patch(`service-credentials/${e}/${s}`,r)},getItems({type:e,id:s,limit:r=null,offset:n=null,filter:u=null,q:o=null,fields:l=null,sort:a=null}){const h={limit:r,offset:n,filter:u,q:o,fields:l,sort:a};return t.getAll(`service-credentials/${e}/${s}/items`,h)}}}function Qt({apiHandler:t}){return{getAll({limit:e=null,offset:s=null,filter:r=null,sort:n=null,q:u=null}={}){const o={limit:e,offset:s,filter:r,sort:n,q:u};return t.getAll("shipping-rates",o)},create({id:e="",data:s}){return t.create(`shipping-rates/${e}`,e,s)},get({id:e}){return t.get(`shipping-rates/${e}`)},update({id:e,data:s}){return t.put(`shipping-rates/${e}`,s)},delete({id:e}){return t.delete(`shipping-rates/${e}`)}}}function Xt({apiHandler:t}){return{get(){return t.get("status")}}}function Zt({apiHandler:t}){return{getAll({limit:e=null,offset:s=null,filter:r=null,sort:n=null}={}){const u={limit:e,offset:s,filter:r,sort:n};return t.getAll("subscription-cancellations",u)},create({id:e="",data:s}){return t.create(`subscription-cancellations/${e}`,e,s)},get({id:e}){return t.get(`subscription-cancellations/${e}`)},delete({id:e}){return t.delete(`subscription-cancellations/${e}`)},patch({id:e,data:s}){return t.patch(`subscription-cancellations/${e}`,s)}}}function Ht({apiHandler:t}){return{getAll({limit:e=null,offset:s=null,filter:r=null,sort:n=null}={}){const u={limit:e,offset:s,filter:r,sort:n};return t.getAll("subscription-pauses",u)},pause({id:e="",data:s}){return t.create(`subscription-pauses/${e}`,e,s)},get({id:e}){return t.get(`subscription-pauses/${e}`)},update({id:e,data:s}){return t.put(`subscription-pauses/${e}`,s)},delete({id:e}){return t.delete(`subscription-pauses/${e}`)}}}function es({apiHandler:t}){return{getAll({limit:e=null,offset:s=null,filter:r=null,sort:n=null}={}){const u={limit:e,offset:s,filter:r,sort:n};return t.getAll("subscription-reactivations",u)},reactivate({data:e}){return t.post("subscription-reactivations",e)},get({id:e}){return t.get(`subscription-reactivations/${e}`)}}}function ts({apiHandler:t}){return{getAll({filter:e=null,sort:s=null,limit:r=null,offset:n=null,q:u=null,expand:o=null}={}){const l={filter:e,sort:s,limit:r,offset:n,q:u,expand:o};return t.getAll("subscriptions",l)},create({id:e="",data:s,expand:r=null}){const n={expand:r};return t.create(`subscriptions/${e}`,e,s,n)},get({id:e,expand:s=null}){const r={expand:s};return t.get(`subscriptions/${e}`,r)},update({id:e,data:s,expand:r=null}){const n={expand:r};return t.put(`subscriptions/${e}`,s,n)},delete({id:e}){return t.delete(`subscriptions/${e}`)},void({id:e}){return t.post(`subscriptions/${e}/void`)},changeItems({id:e,data:s}){return t.post(`subscriptions/${e}/change-items`,s)},updateItem({id:e,itemId:s,data:r}){return t.patch(`subscriptions/${e}/items/${s}`,r)},createInterimInvoice({id:e,data:s}){return t.post(`subscriptions/${e}/interim-invoice`,s)},getAllUpcomingInvoices({id:e,expand:s=null}){const r={expand:s};return t.getAll(`subscriptions/${e}/upcoming-invoices`,r)},getUpcomingInvoice({id:e,expand:s=null}){const r={expand:s};return t.get(`subscriptions/${e}/upcoming-invoice`,r)},issueEarlyUpcomingInvoice({id:e,data:s}){return t.post(`subscriptions/${e}/upcoming-invoice/issue`,s)},issueUpcomingInvoice({id:e,invoiceId:s,data:r}){return t.post(`subscriptions/${e}/upcoming-invoices/${s}/issue`,r)},getAllTimelineMessages({id:e,limit:s=null,offset:r=null,filter:n=null,sort:u=null,q:o=null}){const l={limit:s,offset:r,filter:n,sort:u,q:o};return t.getAll(`subscriptions/${e}/timeline`,l)},createTimelineComment({id:e,data:s}){return t.post(`subscriptions/${e}/timeline`,s)},getTimelineMessage({id:e,messageId:s}){return t.get(`subscriptions/${e}/timeline/${s}`)},deleteTimelineMessage({id:e,messageId:s}){return t.delete(`subscriptions/${e}/timeline/${s}`)}}}function ss({apiHandler:t}){return{getAll({limit:e=null,offset:s=null,filter:r=null,q:n=null,sort:u=null}={}){const o={limit:e,offset:s,filter:r,q:n,sort:u};return t.getAll("tags",o)},create({data:e}){return t.post("tags",e)},get({tag:e}){return t.get(`tags/${e}`)},delete({tag:e}){return t.delete(`tags/${e}`)},update({tag:e,data:s}){return t.patch(`tags/${e}`,s)},tagCustomers({tag:e,data:s}){return t.post(`tags/${e}/customers`,s)},untagCustomers({tag:e,data:s}){return t.delete(`tags/${e}/customers`,s)},tagCustomer({tag:e,customerId:s}){return t.post(`tags/${e}/customers/${s}`)},untagCustomer({tag:e,customerId:s}){return t.delete(`tags/${e}/customers/${s}`)},tagKycDocuments({tag:e,data:s}){return t.post(`tags/${e}/kyc-documents`,s)},untagKycDocuments({tag:e,data:s}){return t.delete(`tags/${e}/kyc-documents`,s)},tagKycDocument({tag:e,kycDocumentId:s}){return t.post(`tags/${e}/kyc-documents/${s}`)},untagKycDocument({tag:e,kycDocumentId:s}){return t.delete(`tags/${e}/kyc-documents/${s}`)},tagAmlChecks({tag:e,data:s}){return t.post(`tags/${e}/aml-checks`,s)},untagAmlChecks({tag:e,data:s}){return t.delete(`tags/${e}/aml-checks`,s)},tagAmlCheck({tag:e,amlCheckId:s}){return t.post(`tags/${e}/aml-checks/${s}`)},untagAmlCheck({tag:e,amlCheckId:s}){return t.delete(`tags/${e}/aml-checks/${s}`)}}}function rs({apiHandler:t}){return{getAllTagsRules({limit:e=null,offset:s=null,sort:r=null,filter:n=null,q:u=null}={}){const o={limit:e,offset:s,sort:r,filter:n,q:u};return t.getAll("tags-rules",o)},createTagsRule({id:e="",data:s}){return t.create(`tags-rules/${e}`,e,s)},getTagsRule({id:e}){return t.get(`tags-rules/${e}`)},updateTagsRule({id:e,data:s}){return t.put(`tags-rules/${e}`,s)},deleteTagsRule({id:e}){return t.delete(`tags-rules/${e}`)}}}function ns({apiHandler:t}){return{getAllApiLogs({limit:e=null,offset:s=null,sort:r=null,filter:n=null,q:u=null,expand:o=null}={}){const l={limit:e,offset:s,sort:r,filter:n,q:u,expand:o};return t.getAll("tracking/api",l)},getApiLog({id:e}){return t.get(`tracking/api/${e}`)},getAllTaxTrackingLogs({limit:e=null,offset:s=null,sort:r=null,filter:n=null,q:u=null}={}){const o={limit:e,offset:s,sort:r,filter:n,q:u};return t.getAll("tracking/taxes",o)},getTaxTrackingLog({id:e}){return t.get(`tracking/taxes/${e}`)},getAllListsChangesHistory({limit:e=null,offset:s=null,sort:r=null,filter:n=null,q:u=null}={}){const o={limit:e,offset:s,sort:r,filter:n,q:u};return t.getAll("tracking/lists",o)},getAllWebhookTrackingLogs({limit:e=null,offset:s=null,sort:r=null,filter:n=null,q:u=null}={}){const o={limit:e,offset:s,sort:r,filter:n,q:u};return t.getAll("tracking/webhooks",o)},getWebhookTrackingLog({id:e}){return t.get(`tracking/webhooks/${e}`)},resendWebhook({id:e}){return t.post(`tracking/webhooks/${e}/resend`)}}}function us({apiHandler:t}){return{getAll({limit:e=null,offset:s=null,filter:r=null,q:n=null,sort:u=null,expand:o=null}={}){const l={limit:e,offset:s,filter:r,q:n,sort:u,expand:o};return t.getAll("transactions",l)},create({data:e,expand:s=null}){const r={expand:s};return t.post("transactions",e,r)},get({id:e,expand:s=null}){const r={expand:s};return t.get(`transactions/${e}`,r)},patch({id:e,data:s}){return t.patch(`transactions/${e}`,s)},query({id:e}){return t.post(`transactions/${e}/query`)},update({id:e,data:s}){return t.post(`transactions/${e}/update`,s)},refund({id:e,data:s}){return t.post(`transactions/${e}/refund`,s)},getAllTimelineMessages({id:e,limit:s=null,offset:r=null,filter:n=null,sort:u=null,q:o=null}){const l={limit:s,offset:r,filter:n,sort:u,q:o};return t.getAll(`transactions/${e}/timeline`,l)},createTimelineComment({id:e,data:s}){return t.post(`transactions/${e}/timeline`,s)},getTimelineMessage({id:e,messageId:s}){return t.get(`transactions/${e}/timeline/${s}`)},deleteTimelineMessage({id:e,messageId:s}){return t.delete(`transactions/${e}/timeline/${s}`)}}}function os({apiHandler:t}){return{getAll({filter:e=null,sort:s=null,limit:r=null,offset:n=null,q:u=null}={}){const o={filter:e,sort:s,limit:r,offset:n,q:u};return t.getAll("usages",o)},create({id:e="",data:s}){return t.create(`usages/${e}`,e,s)},get({id:e}){return t.get(`usages/${e}`)},update({id:e,data:s}){return t.put(`usages/${e}`,s)},delete({id:e}){return t.delete(`usages/${e}`)}}}function ls({apiHandler:t}){return{getAll({limit:e=null,offset:s=null,sort:r=null,filter:n=null,q:u=null}={}){const o={limit:e,offset:s,sort:r,filter:n,q:u};return t.getAll("users",o)},create({id:e="",data:s}){return t.create(`users/${e}`,e,s)},get({id:e}){return t.get(`users/${e}`)},update({id:e,data:s}){return t.put(`users/${e}`,s)},getMfa({id:e}){return t.get(`users/${e}/mfa`)}}}function cs({apiHandler:t}){return{getAll({limit:e=null,offset:s=null,filter:r=null}={}){const n={limit:e,offset:s,filter:r};return t.getAll("webhooks",n)},create({id:e="",data:s}){return t.create(`webhooks/${e}`,e,s)},get({id:e}){return t.get(`webhooks/${e}`)},update({id:e,data:s}){return t.put(`webhooks/${e}`,s)}}}function is({apiHandler:t}){return{getAll({limit:e=null,offset:s=null,q:r=null,filter:n=null,sort:u=null}={}){const o={limit:e,offset:s,q:r,filter:n,sort:u};return t.getAll("websites",o)},create({id:e="",data:s}){return t.create(`websites/${e}`,e,s)},get({id:e}){return t.get(`websites/${e}`)},update({id:e,data:s}){return t.put(`websites/${e}`,s)},delete({id:e}){return t.delete(`websites/${e}`)}}}class gs{constructor({apiHandler:e}){this.account=Ne({apiHandler:e}),this.allowlists=ze({apiHandler:e}),this.amlChecks=Ue({apiHandler:e}),this.amlSettings=Ve({apiHandler:e}),this.apiKeys=We({apiHandler:e}),this.applicationInstances=Je({apiHandler:e}),this.applications=Ge({apiHandler:e}),this.balanceTransactions=Ye({apiHandler:e}),this.billingPortals=_e({apiHandler:e}),this.blocklists=Qe({apiHandler:e}),this.broadcastMessages=Xe({apiHandler:e}),this.checkoutForms=Ze({apiHandler:e}),this.coupons=He({apiHandler:e}),this.creditMemos=et({apiHandler:e}),this.customDomains=tt({apiHandler:e}),this.customFields=st({apiHandler:e}),this.customerAuthentication=rt({apiHandler:e}),this.customers=nt({apiHandler:e}),this.depositCustomPropertySets=ut({apiHandler:e}),this.depositRequests=ot({apiHandler:e}),this.depositStrategies=lt({apiHandler:e}),this.digitalWallets=ct({apiHandler:e}),this.disputes=it({apiHandler:e}),this.emailDeliverySettings=gt({apiHandler:e}),this.emailMessages=at({apiHandler:e}),this.emailNotifications=mt({apiHandler:e}),this.events=ft({apiHandler:e}),this.externalIdentifiers=$t({apiHandler:e}),this.externalServicesSettings=ht({apiHandler:e}),this.fees=pt({apiHandler:e}),this.files=yt({apiHandler:e}),this.gatewayAccounts=At({apiHandler:e}),this.integrations=Rt({apiHandler:e}),this.invoices=bt({apiHandler:e}),this.journalAccounts=wt({apiHandler:e}),this.journalEntries=kt({apiHandler:e}),this.kycDocuments=dt({apiHandler:e}),this.kycRequests=vt({apiHandler:e}),this.kycSettings=Tt({apiHandler:e}),this.lists=St({apiHandler:e}),this.memberships=Et({apiHandler:e}),this.organizationExports=It({apiHandler:e}),this.organizations=qt({apiHandler:e}),this.paymentCardsBankNames=xt({apiHandler:e}),this.paymentInstruments=Pt({apiHandler:e}),this.paymentMethods=Ct({apiHandler:e}),this.paymentTokens=jt({apiHandler:e}),this.payoutRequests=Dt({apiHandler:e}),this.payouts=Mt({apiHandler:e}),this.plans=Ot({apiHandler:e}),this.previews=Ft({apiHandler:e}),this.products=Bt({apiHandler:e}),this.profile=Kt({apiHandler:e}),this.purchase=Lt({apiHandler:e}),this.quotes=Nt({apiHandler:e}),this.resource=zt({apiHandler:e}),this.richBillingPortals=Ut({apiHandler:e}),this.riskScoreRules=Vt({apiHandler:e}),this.roles=Wt({apiHandler:e}),this.search=Jt({apiHandler:e}),this.segments=Gt({apiHandler:e}),this.sendThroughAttribution=Yt({apiHandler:e}),this.serviceCredentials=_t({apiHandler:e}),this.shippingRates=Qt({apiHandler:e}),this.status=Xt({apiHandler:e}),this.subscriptionCancellations=Zt({apiHandler:e}),this.subscriptionPauses=Ht({apiHandler:e}),this.subscriptionReactivations=es({apiHandler:e}),this.subscriptions=ts({apiHandler:e}),this.tags=ss({apiHandler:e}),this.tagsRules=rs({apiHandler:e}),this.tracking=ns({apiHandler:e}),this.transactions=us({apiHandler:e}),this.usages=os({apiHandler:e}),this.users=ls({apiHandler:e}),this.webhooks=cs({apiHandler:e}),this.websites=is({apiHandler:e}),this.addRequestInterceptor=e.addRequestInterceptor,this.removeRequestInterceptor=e.removeRequestInterceptor,this.addResponseInterceptor=e.addResponseInterceptor,this.removeResponseInterceptor=e.removeResponseInterceptor,this.setTimeout=e.setTimeout,this.setProxyAgent=e.setProxyAgent,this.setSessionToken=e.setSessionToken,this.setPublishableKey=e.setPublishableKey,this.setEndpoints=e.setEndpoints,this.getCancellationToken=e.getCancellationToken,this.generateSignature=e.generateSignature}}function as({apiHandler:t}){return{getCustomerLifetimeSummaryMetrics({customerId:e}){return t.get(`customers/${e}/summary-metrics`)}}}function ms({apiHandler:t}){return{getAll({limit:e=null,offset:s=null,sort:r=null,expand:n=null,filter:u=null,q:o=null,criteria:l=null}={}){const a={limit:e,offset:s,sort:r,expand:n,filter:u,q:o,criteria:l};return t.getAll("data-exports",a)},queue({id:e="",data:s,expand:r=null}){const n={expand:r};return t.create(`data-exports/${e}`,e,s,n)},get({id:e,expand:s=null}){const r={expand:s};return t.get(`data-exports/${e}`,r)},update({id:e,data:s,expand:r=null}){const n={expand:r};return t.put(`data-exports/${e}`,s,n)},delete({id:e}){return t.delete(`data-exports/${e}`)}}}function fs({apiHandler:t}){return{getTransactionHistogramReport({periodStart:e,periodEnd:s,aggregationPeriod:r,metric:n,filter:u=null}){const o={periodStart:e,periodEnd:s,aggregationPeriod:r,metric:n,filter:u};return t.get("histograms/transactions",o)}}}function $s({apiHandler:t}){return{getApiLogSummary({periodStart:e,periodEnd:s,limit:r=null,offset:n=null}){const u={periodStart:e,periodEnd:s,limit:r,offset:n};return t.get("reports/api-log-summary",u)},getCumulativeSubscriptions({aggregationField:e,periodStart:s,periodEnd:r,limit:n=null,offset:u=null,filter:o=null}){const l={aggregationField:e,periodStart:s,periodEnd:r,limit:n,offset:u,filter:o};return t.get("reports/cumulative-subscriptions",l)},getDashboardMetrics({periodStart:e,periodEnd:s,metrics:r=null,segments:n=null}){const u={periodStart:e,periodEnd:s,metrics:r,segments:n};return t.get("reports/dashboard",u)},getDccMarkup({aggregationField:e,periodStart:s,periodEnd:r,limit:n=null,offset:u=null,filter:o=null}){const l={aggregationField:e,periodStart:s,periodEnd:r,limit:n,offset:u,filter:o};return t.get("reports/dcc-markup",l)},getDeclinedTransactions({aggregationField:e,periodStart:s,periodEnd:r,limit:n=null,offset:u=null,filter:o=null}){const l={aggregationField:e,periodStart:s,periodEnd:r,limit:n,offset:u,filter:o};return t.get("reports/declined-transactions",l)},getDisputes({aggregationField:e,periodMonth:s,limit:r=null,offset:n=null,filter:u=null}){const o={aggregationField:e,periodMonth:s,limit:r,offset:n,filter:u};return t.get("reports/disputes",o)},getEventsTriggeredSummary({periodStart:e,periodEnd:s,limit:r=null,offset:n=null}){const u={periodStart:e,periodEnd:s,limit:r,offset:n};return t.get("reports/events-triggered",u)},getTriggeredEventRuleReport({eventType:e,periodStart:s,periodEnd:r,limit:n=null,offset:u=null}){const o={periodStart:s,periodEnd:r,limit:n,offset:u};return t.get(`reports/events-triggered/${e}/rules`,o)},getFutureRenewals({periodStart:e,periodEnd:s,limit:r=null,offset:n=null}){const u={periodStart:e,periodEnd:s,limit:r,offset:n};return t.get("reports/future-renewals",u)},getJournal({currency:e,bookedFrom:s=null,bookedTo:r=null,recognizedAt:n,aggregationField:u,limit:o=null,offset:l=null,filter:a=null}){const h={currency:e,bookedFrom:s,bookedTo:r,recognizedAt:n,aggregationField:u,limit:o,offset:l,filter:a};return t.get("reports/journal",h)},getKycAcceptanceSummary({periodStart:e,periodEnd:s}){const r={periodStart:e,periodEnd:s};return t.get("reports/kyc-acceptance-summary",r)},getKycRejectionSummary({periodStart:e,periodEnd:s}){const r={periodStart:e,periodEnd:s};return t.get("reports/kyc-rejection-summary",r)},getKycRequestSummary({periodStart:e,periodEnd:s}){const r={periodStart:e,periodEnd:s};return t.get("reports/kyc-request-summary",r)},getMonthlyRecurringRevenue({currency:e,periodStart:s,periodEnd:r,limit:n=null,offset:u=null}){const o={currency:e,periodStart:s,periodEnd:r,limit:n,offset:u};return t.get("reports/monthly-recurring-revenue",o)},getRenewalSales({periodStart:e,periodEnd:s,limit:r=null,offset:n=null}){const u={periodStart:e,periodEnd:s,limit:r,offset:n};return t.get("reports/renewal-sales",u)},getRetentionPercentage({aggregationField:e,aggregationPeriod:s,includeSwitchedSubscriptions:r=null,periodStart:n,periodEnd:u,limit:o=null,offset:l=null,filter:a=null,criteria:h=null}){const k={aggregationField:e,aggregationPeriod:s,includeSwitchedSubscriptions:r,periodStart:n,periodEnd:u,limit:o,offset:l,filter:a,criteria:h};return t.get("reports/retention-percentage",k)},getRetentionValue({aggregationField:e,aggregationPeriod:s,includeRefunds:r=null,includeDisputes:n=null,periodStart:u,periodEnd:o,limit:l=null,offset:a=null,filter:h=null,sort:k=null,criteria:M=null}){const O={aggregationField:e,aggregationPeriod:s,includeRefunds:r,includeDisputes:n,periodStart:u,periodEnd:o,limit:l,offset:a,filter:h,sort:k,criteria:M};return t.get("reports/retention-value",O)},getRevenueWaterfall({currency:e,issuedFrom:s,issuedTo:r,recognizedTo:n}){const u={currency:e,issuedFrom:s,issuedTo:r,recognizedTo:n};return t.get("reports/revenue-waterfall",u)},getRevenueAudit({filter:e=null,sort:s=null,limit:r=null,offset:n=null}){const u={filter:e,sort:s,limit:r,offset:n};return t.get("reports/revenue-audit",u)},getSubscriptionCancellation({periodStart:e,periodEnd:s,aggregationField:r,limit:n=null,offset:u=null,filter:o=null}){const l={periodStart:e,periodEnd:s,aggregationField:r,limit:n,offset:u,filter:o};return t.get("reports/subscription-cancellation",l)},getSubscriptionRenewal({periodStart:e,periodEnd:s,limit:r=null,offset:n=null}){const u={periodStart:e,periodEnd:s,limit:r,offset:n};return t.get("reports/subscription-renewal",u)},getTax({periodStart:e,periodEnd:s,accountingMethod:r,limit:n=null,offset:u=null}){const o={periodStart:e,periodEnd:s,accountingMethod:r,limit:n,offset:u};return t.get("reports/tax",o)},getTimeSeriesTransaction({type:e,subaggregate:s,periodStart:r,periodEnd:n,limit:u=null,offset:o=null}){const l={type:e,subaggregate:s,periodStart:r,periodEnd:n,limit:u,offset:o};return t.get("reports/time-series-transaction",l)},getTransactionsTimeDispute({aggregationField:e,periodStart:s,periodEnd:r,limit:n=null,offset:u=null,filter:o=null}){const l={aggregationField:e,periodStart:s,periodEnd:r,limit:n,offset:u,filter:o};return t.get("reports/transactions-time-dispute",l)},getTransactions({periodStart:e,periodEnd:s,aggregationField:r,limit:n=null,offset:u=null,filter:o=null}){const l={periodStart:e,periodEnd:s,aggregationField:r,limit:n,offset:u,filter:o};return t.get("reports/transactions",l)}}}function hs({apiHandler:t}){return{getSubscriptionSummaryMetrics({subscriptionId:e}){return t.get(`subscriptions/${e}/summary-metrics`)}}}function ps({apiHandler:t}){return{getActivityFeed({eventTypes:e=null,limit:s=1e3,offset:r=0}){const n={eventTypes:e,limit:s,offset:r};return t.getAll("activity-feed",n)},getTransaction({id:e="",eventTypes:s=null,limit:r=1e3,offset:n=0}){const u={eventTypes:s,limit:r,offset:n};return t.getAll(`transactions/${e}/timeline`,u)},getCustomer({id:e="",eventTypes:s=null,limit:r=1e3,offset:n=0}){const u={eventTypes:s,limit:r,offset:n};return t.getAll(`customers/${e}/timeline`,u)}}}function ys({apiHandler:t}){return{query(){return t.get("location")}}}const w={CustomersResource:as,DataExportsResource:ms,HistogramsResource:fs,ReportsResource:$s,SubscriptionsResource:hs,TimelinesResource:ps,LocationResource:ys};class As{constructor({apiHandler:e}){this.customers=w.CustomersResource({apiHandler:e}),this.dataExports=w.DataExportsResource({apiHandler:e}),this.histograms=w.HistogramsResource({apiHandler:e}),this.reports=w.ReportsResource({apiHandler:e}),this.subscriptions=w.SubscriptionsResource({apiHandler:e}),this.timelines=w.TimelinesResource({apiHandler:e}),this.location=w.LocationResource({apiHandler:e}),this.addRequestInterceptor=e.addRequestInterceptor,this.removeRequestInterceptor=e.removeRequestInterceptor,this.addResponseInterceptor=e.addResponseInterceptor,this.removeResponseInterceptor=e.removeResponseInterceptor,this.setTimeout=e.setTimeout,this.setProxyAgent=e.setProxyAgent,this.setSessionToken=e.setSessionToken,this.setEndpoints=e.setEndpoints,this.getCancellationToken=e.getCancellationToken}}function Rs({apiHandler:t}){return{get({expand:e=null}={}){const s={expand:e};return t.get("account",s)},update({data:e}){return t.patch("account",e)},requestPasswordReset({data:e}){return t.post("account/forgot-password",e)},changePassword({data:e}){return t.patch("account/password",e)},resendEmailVerification({data:e}){return t.post("account/resend-verification",e)},confirmPasswordReset({token:e,data:s}){return t.post(`account/reset-password/${e}`,s)},verifyEmail({token:e}){return t.post(`account/verification/${e}`)},register({data:e}){return t.post("register",e)}}}function bs({apiHandler:t}){return{login({data:e}){return t.post("login",e)},logout(){return t.post("logout")}}}function ws({apiHandler:t}){return{get({slug:e}){return t.get(`billing-portals/${e}`)}}}function ks({apiHandler:t}){return{get({id:e}){return t.get(`checkout-forms/${e}`)}}}function ds({apiHandler:t}){return{getAll({resource:e,limit:s=null,offset:r=null}){const n={limit:s,offset:r};return t.getAll(`custom-fields/${e}`,n)}}}function vs({apiHandler:t}){return{get({id:e,expand:s=null}){const r={expand:s};return t.get(`deposit-requests/${e}`,r)}}}function Ts({apiHandler:t}){return{create({data:e}){return t.post("deposit",e)}}}function Ss({apiHandler:t}){return{get({id:e}){return t.get(`deposit-strategies/${e}`)}}}function Es({apiHandler:t}){return{getAll({filter:e=null,sort:s=null,limit:r=null,offset:n=null,q:u=null,expand:o=null}={}){const l={filter:e,sort:s,limit:r,offset:n,q:u,expand:o};return t.getAll("invoices",l)},get({id:e}){return t.get(`invoices/${e}`)},downloadPDF({id:e}){const s={headers:q,responseType:"arraybuffer"};return t.download(`invoices/${e}`,s)}}}function Is({apiHandler:t}){return{getAll({limit:e=null,offset:s=null}={}){const r={limit:e,offset:s};return t.getAll("kyc-documents",r)},create({data:e}){return t.post("kyc-documents",e)},get({id:e}){return t.get(`kyc-documents/${e}`)},update({id:e,data:s}){return t.patch(`kyc-documents/${e}`,s)}}}function qs({apiHandler:t}){return{create({data:e}){return t.post("kyc-liveness-sessions",e)},get({id:e}){return t.get(`kyc-liveness-sessions/${e}`)},finish({id:e}){return t.post(`kyc-liveness-sessions/${e}/finish`)}}}function xs({apiHandler:t}){return{get({id:e,expand:s=null}){const r={expand:s};return t.get(`kyc-requests/${e}`,r)}}}function Ps({apiHandler:t}){return{getUpcomingInvoice({id:e}){return t.get(`orders/${e}/upcoming-invoice`)},getAll({filter:e=null,sort:s=null,limit:r=null,offset:n=null,q:u=null}={}){const o={filter:e,sort:s,limit:r,offset:n,q:u};return t.getAll("orders",o)},create({data:e}){return t.post("orders",e)},get({id:e}){return t.get(`orders/${e}`)},update({id:e,data:s}){return t.patch(`orders/${e}`,s)},cancel({id:e,data:s}){return t.post(`orders/${e}/cancellation`,s)},pause({id:e,data:s}){return t.post(`orders/${e}/pause`,s)}}}function Cs({apiHandler:t}){return{getAll({filter:e=null,sort:s=null,limit:r=null,offset:n=null,q:u=null}={}){const o={filter:e,sort:s,limit:r,offset:n,q:u};return t.getAll("payment-instruments",o)},create({data:e}){return t.post("payment-instruments",e)},get({id:e,limit:s=null,offset:r=null}){const n={limit:s,offset:r};return t.get(`payment-instruments/${e}`,n)},update({id:e,data:s}){return t.patch(`payment-instruments/${e}`,s)},deactivate({id:e}){return t.post(`payment-instruments/${e}/deactivation`)},getSetupTransaction({id:e}){return t.get(`payment-instruments/${e}/setup`)},setup({id:e,data:s}){return t.post(`payment-instruments/${e}/setup`,s)}}}function js({apiHandler:t}){return{getAll({filter:e=null,sort:s=null,limit:r=null,offset:n=null,q:u=null}={}){const o={filter:e,sort:s,limit:r,offset:n,q:u};return t.getAll("payout-requests",o)},get({id:e}){return t.get(`payout-requests/${e}`)},update({id:e,data:s}){return t.patch(`payout-requests/${e}`,s)}}}function Ds({apiHandler:t}){return{getAll({filter:e=null,sort:s=null,limit:r=null,offset:n=null,q:u=null,expand:o=null}={}){const l={filter:e,sort:s,limit:r,offset:n,q:u,expand:o};return t.getAll("plans",l)},get({id:e,expand:s=null}){const r={expand:s};return t.get(`plans/${e}`,r)}}}function Ms({apiHandler:t}){return{getAll({filter:e=null,sort:s=null,limit:r=null,offset:n=null,q:u=null}={}){const o={filter:e,sort:s,limit:r,offset:n,q:u};return t.getAll("products",o)},get({id:e}){return t.get(`products/${e}`)}}}function Os({apiHandler:t}){return{payment({data:e}){return t.post("payment",e)},purchase({data:e}){return t.post("purchase",e)},preview({data:e}){return t.post("preview-purchase",e)},readyToPay({data:e}){return t.post("ready-to-pay",e)}}}function Fs({apiHandler:t}){return{get({id:e,expand:s=null}){const r={expand:s};return t.get(`quotes/${e}`,r)},accept({id:e}){return t.post(`quotes/${e}/accept`)},reject({id:e}){return t.post(`quotes/${e}/reject`)},downloadPDF({id:e}){const s={headers:q,responseType:"arraybuffer"};return t.download(`quotes/${e}`,s)}}}function Bs({apiHandler:t}){return{readyToPayout({data:e}){return t.post("ready-to-payout",e)}}}function Ks({apiHandler:t}){return{get({id:e}){return t.get(`rich-billing-portals/${e}`)}}}function Ls({apiHandler:t}){return{getAll({limit:e=null,offset:s=null,filter:r=null,q:n=null,sort:u=null}={}){const o={limit:e,offset:s,filter:r,q:n,sort:u};return t.getAll("transactions",o)},get({id:e}){return t.get(`transactions/${e}`)},finishKyc({id:e,token:s}){return t.post(`transactions/${e}/${s}/continue`)},skipKyc({id:e,token:s}){return t.post(`transactions/${e}/${s}/bypass`)},update({id:e,data:s}){return t.patch(`transactions/${e}`,s)}}}function Ns({apiHandler:t}){return{get({id:e}){return t.get(`websites/${e}`)}}}class zs{constructor({apiHandler:e}){this.account=Rs({apiHandler:e}),this.authorization=bs({apiHandler:e}),this.billingPortals=ws({apiHandler:e}),this.checkoutForms=ks({apiHandler:e}),this.customFields=ds({apiHandler:e}),this.depositRequests=vs({apiHandler:e}),this.deposit=Ts({apiHandler:e}),this.depositStrategies=Ss({apiHandler:e}),this.invoices=Es({apiHandler:e}),this.kycDocuments=Is({apiHandler:e}),this.kycLivenessSessions=qs({apiHandler:e}),this.kycRequests=xs({apiHandler:e}),this.orders=Ps({apiHandler:e}),this.paymentInstruments=Cs({apiHandler:e}),this.payoutRequests=js({apiHandler:e}),this.plans=Ds({apiHandler:e}),this.products=Ms({apiHandler:e}),this.purchase=Os({apiHandler:e}),this.quotes=Fs({apiHandler:e}),this.readyToPayout=Bs({apiHandler:e}),this.richBillingPortals=Ks({apiHandler:e}),this.transactions=Ls({apiHandler:e}),this.websites=Ns({apiHandler:e}),this.checkoutForm=this.checkoutForms,this.billingPortal=this.billingPortals,this.addRequestInterceptor=e.addRequestInterceptor,this.removeRequestInterceptor=e.removeRequestInterceptor,this.addResponseInterceptor=e.addResponseInterceptor,this.removeResponseInterceptor=e.removeResponseInterceptor,this.setTimeout=e.setTimeout,this.setProxyAgent=e.setProxyAgent,this.setSessionToken=e.setSessionToken,this.setPublishableKey=e.setPublishableKey,this.setEndpoints=e.setEndpoints,this.getCancellationToken=e.getCancellationToken,this.generateSignature=e.generateSignature}}function Us({apiHandler:t}){return new gs({apiHandler:t})}function Vs({apiHandler:t}){return new As({apiHandler:t})}function Ws({apiHandler:t}){return new zs({apiHandler:t})}const j={live:"https://api.rebilly.com",sandbox:"https://api-sandbox.rebilly.com"},D=6e3;function W({apiKey:t=null,sandbox:e=!1,timeout:s=D,organizationId:r=null,urls:n=j}={}){if(!n.live||!n.sandbox)throw new Error("RebillyAPI urls config must include a key for both `live` and `sandbox`");if(typeof n.live!="string"||typeof n.sandbox!="string")throw new Error("RebillyAPI urls config `live` and `sandbox` must be strings");const o=C({options:{apiEndpoints:n,apiKey:t,apiVersion:"",isSandbox:e,requestTimeout:s,jwt:null,organizationId:r}});return Us({apiHandler:o})}function Js({apiKey:t=null,sandbox:e=!1,timeout:s=D,organizationId:r=null,urls:n=j}={}){if(!n.live||!n.sandbox)throw new Error("RebillyAPI urls config must include a key for both `live` and `sandbox`");if(typeof n.live!="string"||typeof n.sandbox!="string")throw new Error("RebillyAPI urls config `live` and `sandbox` must be strings");const o=C({options:{apiEndpoints:n,apiKey:t,apiVersion:"experimental",isSandbox:e,requestTimeout:s,jwt:null,organizationId:r}});return Vs({apiHandler:o})}function Gs({publishableKey:t=null,jwt:e=null,sandbox:s=!1,timeout:r=D,organizationId:n=null,urls:u=j}={}){if(!u.live||!u.sandbox)throw new Error("RebillyAPI urls config must include a key for both `live` and `sandbox`");if(typeof u.live!="string"||typeof u.sandbox!="string")throw new Error("RebillyAPI urls config `live` and `sandbox` must be strings");const o={apiEndpoints:u,publishableKey:t,jwt:e,apiVersion:"storefront",isSandbox:s,requestTimeout:r,organizationId:n},l=C({options:o});return l.setSessionToken(o.jwt),Ws({apiHandler:l})}f.RebillyAPI=W,f.RebillyErrors=p,f.RebillyExperimentalAPI=Js,f.RebillyStorefrontAPI=Gs,f.cancellation=Le,f.default=W,Object.defineProperties(f,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}})});
|
|
16
|
+
*/var Ie=Ee;function U(t){return Ie(t)===!0&&Object.prototype.toString.call(t)==="[object Object]"}var qe=function(e){var s,n;return!(U(e)===!1||(s=e.constructor,typeof s!="function")||(n=s.prototype,U(n)===!1)||n.hasOwnProperty("isPrototypeOf")===!1)};const xe=Se,Pe=L,Ce=qe;function P(t,e){switch(Pe(t)){case"object":return je(t,e);case"array":return De(t,e);default:return xe(t)}}function je(t,e){if(typeof e=="function")return e(t);if(e||Ce(t)){const s=new t.constructor;for(let n in t)s[n]=P(t[n],e);return s}return t}function De(t,e){const s=new t.constructor(t.length);for(let n=0;n<t.length;n++)s[n]=P(t[n],e);return s}var Me=P;const Oe="55.17.0";let Fe="useandom-26T198340PX75pxJACKVERYMINDBUSHWOLF_GQZbfghjklqvwyzrict",Be=(t=21)=>{let e="",s=t;for(;s--;)e+=Fe[Math.random()*64|0];return e};class Ke{constructor({id:e=null,created:s=null}={}){this.id=e||Be(),this.created=s||new Date().getTime(),this.cancelSource=x.default.CancelToken.source(),this.cancel=this.cancelSource.cancel,this.cancelToken=this.cancelSource.token,E(this,{exclude:["cancelSource","cancelToken","cancel"]})}}class T{constructor(){if(T.instance)return T.instance;this.requests={},T.instance=this}getAll(){return Object.values(this.requests)}getById(e){return this.requests[e]}deleteById(e){!this.requests[e]||delete this.requests[e]}save(){const e=new Ke;return this.requests[e.id]=e,{id:e.id,cancelToken:e.cancelToken}}}var v=new T;class I{}F(I,"cancelById",(e,s)=>{try{v.getById(e).cancel(s),v.deleteById(e)}catch{}}),F(I,"cancelAll",e=>v.getAll().forEach(s=>{s.cancel(e),v.deleteById(s.id)}));var Le={cancelAll:(...t)=>I.cancelAll(...t)};const b={request:"request",response:"response"},V=t=>{if(!Object.values(b).includes(t))throw new Error(`There is no such interceptor type as "${t}"`);return!0};function C({options:t}){const e=s();function s(){return x.default.create(r())}function n(){return e}function r(){return{baseURL:u(),timeout:t.requestTimeout,headers:o()}}function u(){let c=t.isSandbox?t.apiEndpoints.sandbox:t.apiEndpoints.live;return t.apiVersion&&(c=`${c}/${t.apiVersion}`),t.organizationId&&(c=`${c}/organizations/${t.organizationId}`),`${c}`}function o(){const c={"REB-API-CONSUMER":`RebillySDK/JS-SDK ${Oe}`};return t.apiKey&&(c["REB-APIKEY"]=t.apiKey),c}function l(){return Me(e.defaults.headers)}function a(c){t.requestTimeout=Number(c),e.defaults.timeout=t.requestTimeout}function h(c=t.jwt){const i=l();t.apiKey=null,t.jwt=c,delete i.common["REB-APIKEY"],i.common.Authorization=`Bearer ${c}`,e.defaults.headers=i}function k(c=t.publishableKey){const i=l();t.publishableKey=c,i.common.Authorization=`${c}`,e.defaults.headers=i}function M({host:c,port:i,auth:g}){e.defaults.proxy={host:c,port:i,auth:g}}function O({live:c=null,sandbox:i=null}){c&&(t.apiEndpoints.live=c),i&&(t.apiEndpoints.sandbox=i),e.defaults.baseURL=u()}function J(c,{thenDelegate:i,catchDelegate:g=()=>{}}){return V(c)&&e.interceptors[b[c]].use(i,g)}function G(c,i){return V(c)&&e.interceptors[b[c]].eject(i)}function _s({thenDelegate:c,catchDelegate:i=()=>{}}){return J(b.request,{thenDelegate:c,catchDelegate:i})}function Qs(c){G(b.request,c)}function Xs({thenDelegate:c,catchDelegate:i=()=>{}}){return J(b.response,{thenDelegate:c,catchDelegate:i})}function Zs(c){G(b.response,c)}function d({request:c,isCollection:i,config:g}){const m=_(g),{id:A,cancelToken:ln}=v.save();m.cancelToken=ln;const H=async function(){try{const S=await c(m);return Hs({response:S,isCollection:i,config:m})}catch(S){return Y({error:S,config:m})}finally{v.deleteById(A)}}();return H.cancel=S=>I.cancelById(A,S),H}function Hs({response:c,isCollection:i,config:g}){return i?new ee(c,g):new B(c,g)}function Y({error:c}){if(x.default.isCancel(c))throw new p.RebillyCanceledError(c);if(c.response)switch(Number(c.response.status)){case 401:throw new p.RebillyForbiddenError(c);case 404:throw new p.RebillyNotFoundError(c);case 405:throw new p.RebillyMethodNotAllowedError(c);case 409:throw new p.RebillyConflictError(c);case 422:throw new p.RebillyValidationError(c);default:throw new p.RebillyRequestError(c)}throw c.code==="ECONNABORTED"?new p.RebillyTimeoutError(c):new p.RebillyRequestError(c)}function en(c){return c.params!==void 0&&(c.params=Object.keys(c.params).filter(i=>c.params[i]!==null&&c.params[i]!=="").reduce((i,g)=>(i[g]=c.params[g],i),{})),c}function _(c={}){return{...en(c)}}function Q(c,i={}){return d({request:g=>e.get(c,g),config:{params:i}})}function tn(c,i){return d({request:g=>e.get(c,g),config:{params:i},isCollection:!0})}function X(c,i,g={}){let m={};return g.authenticate===!1&&(m={headers:l()},delete m.headers.common["REB-APIKEY"],delete m.headers.common.Authorization),g.params&&(m.params={...g.params}),d({request:A=>e.post(c,i,A),config:m})}function Z(c,i,g={}){return d({request:m=>e.put(c,i,m),config:{params:g}})}function sn(c,i){return d({request:g=>e.patch(c,i,g),config:{}})}function nn(c){return d({request:i=>e.delete(c,i),config:{}})}function rn(c,i){return d({request:g=>e.delete(c,g),config:{data:{...i}}})}async function un(c,i,g,m={}){if(i==="")return X(c,g,{params:m});try{if((await Q(c)).response.status===200)throw new p.RebillyConflictError({message:"A resource already exists with this ID. Please use a different ID."})}catch(A){if(A.name==="RebillyNotFoundError")return Z(c,g,m);throw A}}async function on(c,i){const g=_(i);try{const m=await e.get(c,g);return new te(m,g)}catch(m){return Y({error:m,config:g})}}return{getInstance:n,addRequestInterceptor:_s,removeRequestInterceptor:Qs,addResponseInterceptor:Xs,removeResponseInterceptor:Zs,setTimeout:a,setProxyAgent:M,setSessionToken:h,setPublishableKey:k,setEndpoints:O,get:Q,getAll:tn,post:X,put:Z,patch:sn,delete:nn,deleteAll:rn,create:un,download:on}}function Ne({apiHandler:t}){return{forgotPassword({data:e}){return t.post("forgot-password",e,{authenticate:!1})}}}function ze({apiHandler:t}){return{getAllowlistCollection({filter:e=null,sort:s=null,limit:n=null,offset:r=null}={}){const u={filter:e,sort:s,limit:n,offset:r};return t.getAll("allowlists",u)},storeAllowlist({data:e}){return t.post("allowlists",e)},getAllowlist({id:e}){return t.get(`allowlists/${e}`)},delete({id:e}){return t.delete(`allowlists/${e}`)}}}function Ue({apiHandler:t}){return{getAll({limit:e=null,offset:s=null,sort:n=null,filter:r=null,q:u=null}={}){const o={limit:e,offset:s,sort:n,filter:r,q:u};return t.getAll("aml-checks",o)},get({id:e}){return t.get(`aml-checks/${e}`)},startReview({id:e}){return t.post(`aml-checks/${e}/start-review`)},stopReview({id:e}){return t.post(`aml-checks/${e}/stop-review`)},review({id:e,data:s}){return t.post(`aml-checks/${e}/review`,s)}}}function Ve({apiHandler:t}){return{getAmlSettings(){return t.get("aml-settings")},putAmlSettings({data:e}){return t.put("aml-settings",e)}}}function We({apiHandler:t}){return{getAll({limit:e=null,offset:s=null,sort:n=null}={}){const r={limit:e,offset:s,sort:n};return t.getAll("api-keys",r)},create({id:e="",data:s}){return t.create(`api-keys/${e}`,e,s)},get({id:e}){return t.get(`api-keys/${e}`)},update({id:e,data:s}){return t.put(`api-keys/${e}`,s)},delete({id:e}){return t.delete(`api-keys/${e}`)}}}function Je({apiHandler:t}){return{get({applicationId:e}){return t.get(`application-instances/${e}`)},upsert({applicationId:e,data:s}){return t.put(`application-instances/${e}`,s)},delete({applicationId:e}){return t.delete(`application-instances/${e}`)},getConfiguration({applicationId:e}){return t.get(`application-instances/${e}/configuration`)},upsertConfiguration({applicationId:e,data:s}){return t.put(`application-instances/${e}/configuration`,s)}}}function Ge({apiHandler:t}){return{getAll({limit:e=null,offset:s=null,filter:n=null,q:r=null,expand:u=null,fields:o=null,sort:l=null}={}){const a={limit:e,offset:s,filter:n,q:r,expand:u,fields:o,sort:l};return t.getAll("applications",a)},create({data:e}){return t.post("applications",e)},get({id:e}){return t.get(`applications/${e}`)},getInstances({id:e,limit:s=null,offset:n=null}){const r={limit:s,offset:n};return t.getAll(`applications/${e}/instances`,r)},getInstance({id:e,organizationId:s}){return t.get(`applications/${e}/instances/${s}`)}}}function Ye({apiHandler:t}){return{getAll({limit:e=null,offset:s=null,filter:n=null,sort:r=null}={}){const u={limit:e,offset:s,filter:n,sort:r};return t.getAll("balance-transactions",u)},get({id:e}){return t.get(`balance-transactions/${e}`)}}}function _e({apiHandler:t}){return{getAll({limit:e=null,offset:s=null,sort:n=null,filter:r=null,q:u=null}={}){const o={limit:e,offset:s,sort:n,filter:r,q:u};return t.getAll("billing-portals",o)},create({id:e="",data:s}){return t.create(`billing-portals/${e}`,e,s)},get({id:e}){return t.get(`billing-portals/${e}`)},update({id:e,data:s}){return t.put(`billing-portals/${e}`,s)},delete({id:e}){return t.delete(`billing-portals/${e}`)}}}function Qe({apiHandler:t}){return{getAll({limit:e=null,offset:s=null,sort:n=null,filter:r=null,q:u=null}={}){const o={limit:e,offset:s,sort:n,filter:r,q:u};return t.getAll("blocklists",o)},create({id:e="",data:s}){return t.create(`blocklists/${e}`,e,s)},get({id:e}){return t.get(`blocklists/${e}`)},delete({id:e}){return t.delete(`blocklists/${e}`)}}}function Xe({apiHandler:t}){return{getAll({limit:e=null,offset:s=null,sort:n=null,filter:r=null}={}){const u={limit:e,offset:s,sort:n,filter:r};return t.getAll("broadcast-messages",u)},create({data:e}){return t.post("broadcast-messages",e)},get({id:e}){return t.get(`broadcast-messages/${e}`)},delete({id:e}){return t.delete(`broadcast-messages/${e}`)},update({id:e,data:s}){return t.patch(`broadcast-messages/${e}`,s)}}}function Ze({apiHandler:t}){return{getAll({limit:e=null,offset:s=null,sort:n=null,filter:r=null,q:u=null}={}){const o={limit:e,offset:s,sort:n,filter:r,q:u};return t.getAll("checkout-forms",o)},create({id:e="",data:s}){return t.create(`checkout-forms/${e}`,e,s)},get({id:e}){return t.get(`checkout-forms/${e}`)},update({id:e,data:s}){return t.put(`checkout-forms/${e}`,s)},delete({id:e}){return t.delete(`checkout-forms/${e}`)}}}function He({apiHandler:t}){return{getAllRedemptions({limit:e=null,offset:s=null,filter:n=null,q:r=null,sort:u=null}={}){const o={limit:e,offset:s,filter:n,q:r,sort:u};return t.getAll("coupons-redemptions",o)},redeem({data:e}){return t.post("coupons-redemptions",e)},getRedemption({id:e}){return t.get(`coupons-redemptions/${e}`)},cancelRedemption({id:e}){return t.post(`coupons-redemptions/${e}/cancel`)},getAll({limit:e=null,offset:s=null,filter:n=null,q:r=null,sort:u=null}={}){const o={limit:e,offset:s,filter:n,q:r,sort:u};return t.getAll("coupons",o)},create({id:e="",data:s}){return t.create(`coupons/${e}`,e,s)},get({id:e}){return t.get(`coupons/${e}`)},update({id:e,data:s}){return t.put(`coupons/${e}`,s)},setExpiration({id:e,data:s}){return t.post(`coupons/${e}/expiration`,s)}}}function et({apiHandler:t}){return{getAll({filter:e=null,sort:s=null,limit:n=null,offset:r=null,q:u=null}={}){const o={filter:e,sort:s,limit:n,offset:r,q:u};return t.getAll("credit-memos",o)},create({id:e="",data:s}){return t.create(`credit-memos/${e}`,e,s)},get({id:e}){return t.get(`credit-memos/${e}`)},update({id:e,data:s}){return t.put(`credit-memos/${e}`,s)},patch({id:e,data:s}){return t.patch(`credit-memos/${e}`,s)},void({id:e}){return t.post(`credit-memos/${e}/void`)},getAllTimelineMessages({id:e,limit:s=null,offset:n=null,filter:r=null,sort:u=null,q:o=null}){const l={limit:s,offset:n,filter:r,sort:u,q:o};return t.getAll(`credit-memos/${e}/timeline`,l)},createTimelineComment({id:e,data:s}){return t.post(`credit-memos/${e}/timeline`,s)},getTimelineMessage({id:e,messageId:s}){return t.get(`credit-memos/${e}/timeline/${s}`)},deleteTimelineMessage({id:e,messageId:s}){return t.delete(`credit-memos/${e}/timeline/${s}`)}}}function tt({apiHandler:t}){return{getAll({limit:e=null,offset:s=null,sort:n=null,filter:r=null,q:u=null}={}){const o={limit:e,offset:s,sort:n,filter:r,q:u};return t.getAll("custom-domains",o)},create({data:e}){return t.post("custom-domains",e)},get({domain:e}){return t.get(`custom-domains/${e}`)},delete({domain:e}){return t.delete(`custom-domains/${e}`)}}}function st({apiHandler:t}){return{getAll({resource:e,limit:s=null,offset:n=null}){const r={limit:s,offset:n};return t.getAll(`custom-fields/${e}`,r)},get({resource:e,name:s}){return t.get(`custom-fields/${e}/${s}`)},create({resource:e,name:s,data:n}){return t.put(`custom-fields/${e}/${s}`,n)},update({resource:e,name:s,data:n}){return t.put(`custom-fields/${e}/${s}`,n)}}}function nt({apiHandler:t}){return{getAuthOptions(){return t.get("authentication-options")},updateAuthOptions({data:e}){return t.put("authentication-options",e)},getAllAuthTokens({limit:e=null,offset:s=null}={}){const n={limit:e,offset:s};return t.getAll("authentication-tokens",n)},login({data:e}){return t.post("authentication-tokens",e)},verify({token:e}){return t.get(`authentication-tokens/${e}`)},logout({token:e}){return t.delete(`authentication-tokens/${e}`)},exchangeToken({token:e,data:s}){return t.post(`authentication-tokens/${e}/exchange`,s)},getAllCredentials({limit:e=null,offset:s=null}={}){const n={limit:e,offset:s};return t.getAll("credentials",n)},createCredential({id:e="",data:s}){return t.create(`credentials/${e}`,e,s)},getCredential({id:e}){return t.get(`credentials/${e}`)},updateCredential({id:e,data:s}){return t.put(`credentials/${e}`,s)},deleteCredential({id:e}){return t.delete(`credentials/${e}`)},getAllResetPasswordTokens({limit:e=null,offset:s=null}={}){const n={limit:e,offset:s};return t.getAll("password-tokens",n)},createResetPasswordToken({data:e}){return t.post("password-tokens",e)},getResetPasswordToken({id:e}){return t.get(`password-tokens/${e}`)},deleteResetPasswordToken({id:e}){return t.delete(`password-tokens/${e}`)}}}function rt({apiHandler:t}){return{getAll({limit:e=null,offset:s=null,filter:n=null,q:r=null,expand:u=null,fields:o=null,sort:l=null}={}){const a={limit:e,offset:s,filter:n,q:r,expand:u,fields:o,sort:l};return t.getAll("customers",a)},create({id:e="",data:s,expand:n=null}){const r={expand:n};return t.create(`customers/${e}`,e,s,r)},get({id:e,expand:s=null,fields:n=null}){const r={expand:s,fields:n};return t.get(`customers/${e}`,r)},update({id:e,data:s,expand:n=null}){const r={expand:n};return t.put(`customers/${e}`,s,r)},merge({id:e,targetCustomerId:s}){return t.delete(`customers/${e}?targetCustomerId=${s}`)},getLeadSource({id:e}){return t.get(`customers/${e}/lead-source`)},createLeadSource({id:e,data:s}){return t.put(`customers/${e}/lead-source`,s)},updateLeadSource({id:e,data:s}){return t.put(`customers/${e}/lead-source`,s)},deleteLeadSource({id:e}){return t.delete(`customers/${e}/lead-source`)},getAllTimelineMessages({id:e,limit:s=null,offset:n=null,filter:r=null,sort:u=null,q:o=null}){const l={limit:s,offset:n,filter:r,sort:u,q:o};return t.getAll(`customers/${e}/timeline`,l)},createTimelineComment({id:e,data:s}){return t.post(`customers/${e}/timeline`,s)},getTimelineMessage({id:e,messageId:s}){return t.get(`customers/${e}/timeline/${s}`)},deleteTimelineMessage({id:e,messageId:s}){return t.delete(`customers/${e}/timeline/${s}`)},getCustomerEddScore({id:e}){return t.get(`customers/${e}/edd-score`)},patchCustomerEddScore({id:e,data:s}){return t.patch(`customers/${e}/edd-score`,s)},getEddTimelineCollection({id:e,limit:s=null,offset:n=null,filter:r=null,sort:u=null,q:o=null}){const l={limit:s,offset:n,filter:r,sort:u,q:o};return t.getAll(`customers/${e}/edd-timeline`,l)},createEddTimelineComment({id:e,data:s}){return t.post(`customers/${e}/edd-timeline`,s)},getEddTimelineMessage({id:e,messageId:s}){return t.get(`customers/${e}/edd-timeline/${s}`)},deleteEddTimelineMessage({id:e,messageId:s}){return t.delete(`customers/${e}/edd-timeline/${s}`)},getAllEddSearchResults({id:e,limit:s=null,offset:n=null}){const r={limit:s,offset:n};return t.getAll(`customers/${e}/edd-search-results`,r)},getEddSearchResult({id:e,searchResultId:s}){return t.get(`customers/${e}/edd-search-results/${s}`)}}}function ut({apiHandler:t}){return{getAll({limit:e=null,offset:s=null,filter:n=null,sort:r=null}={}){const u={limit:e,offset:s,filter:n,sort:r};return t.getAll("deposit-custom-property-sets",u)},create({id:e="",data:s}){return t.create(`deposit-custom-property-sets/${e}`,e,s)},get({id:e}){return t.get(`deposit-custom-property-sets/${e}`)},update({id:e,data:s}){return t.put(`deposit-custom-property-sets/${e}`,s)},delete({id:e}){return t.delete(`deposit-custom-property-sets/${e}`)}}}function ot({apiHandler:t}){return{getAll({limit:e=null,offset:s=null,filter:n=null,sort:r=null}={}){const u={limit:e,offset:s,filter:n,sort:r};return t.getAll("deposit-requests",u)},create({data:e}){return t.post("deposit-requests",e)},get({id:e,expand:s=null}){const n={expand:s};return t.get(`deposit-requests/${e}`,n)}}}function lt({apiHandler:t}){return{getAll({limit:e=null,offset:s=null,filter:n=null,sort:r=null}={}){const u={limit:e,offset:s,filter:n,sort:r};return t.getAll("deposit-strategies",u)},create({id:e="",data:s}){return t.create(`deposit-strategies/${e}`,e,s)},get({id:e}){return t.get(`deposit-strategies/${e}`)},update({id:e,data:s}){return t.put(`deposit-strategies/${e}`,s)},delete({id:e}){return t.delete(`deposit-strategies/${e}`)}}}function ct({apiHandler:t}){return{validate({data:e}){return t.post("digital-wallets/validation",e)},create({data:e}){return t.post("digital-wallets/onboarding/apple-pay",e)}}}function it({apiHandler:t}){return{getAll({filter:e=null,sort:s=null,limit:n=null,offset:r=null,q:u=null,expand:o=null}={}){const l={filter:e,sort:s,limit:n,offset:r,q:u,expand:o};return t.getAll("disputes",l)},create({id:e="",data:s,expand:n=null}){const r={expand:n};return t.create(`disputes/${e}`,e,s,r)},get({id:e}){return t.get(`disputes/${e}`)},update({id:e,data:s,expand:n=null}){const r={expand:n};return t.put(`disputes/${e}`,s,r)}}}function gt({apiHandler:t}){return{verify({token:e}){return t.put(`email-delivery-setting-verifications/${e}`)},getAll({limit:e=null,offset:s=null,filter:n=null,sort:r=null,q:u=null}={}){const o={limit:e,offset:s,filter:n,sort:r,q:u};return t.getAll("email-delivery-settings",o)},create({data:e}){return t.post("email-delivery-settings",e)},get({id:e}){return t.get(`email-delivery-settings/${e}`)},delete({id:e}){return t.delete(`email-delivery-settings/${e}`)},update({id:e,data:s}){return t.patch(`email-delivery-settings/${e}`,s)},resendVerification({id:e}){return t.post(`email-delivery-settings/${e}/resend-email-verification`)}}}function at({apiHandler:t}){return{getAll({limit:e=null,offset:s=null,q:n=null,sort:r=null,filter:u=null}={}){const o={limit:e,offset:s,q:n,sort:r,filter:u};return t.getAll("email-messages",o)},create({data:e}){return t.post("email-messages",e)},get({id:e}){return t.get(`email-messages/${e}`)},delete({id:e}){return t.delete(`email-messages/${e}`)},send({id:e,data:s={status:"outbox"}}){return t.patch(`email-messages/${e}`,s)}}}function mt({apiHandler:t}){return{getAll({limit:e=null,offset:s=null}={}){const n={limit:e,offset:s};return t.getAll("email-notifications",n)}}}function ft({apiHandler:t}){return{getAll(){return t.getAll("events")},get({eventType:e}){return t.get(`events/${e}`)},getRules({eventType:e}){return t.get(`events/${e}/rules`)},createRules({eventType:e,data:s}){return t.put(`events/${e}/rules`,s)},updateRules({eventType:e,data:s}){return t.put(`events/${e}/rules`,s)},getAllTimelineMessages({eventType:e,limit:s=null,offset:n=null,filter:r=null,sort:u=null,q:o=null}){const l={limit:s,offset:n,filter:r,sort:u,q:o};return t.getAll(`events/${e}/timeline`,l)},createTimelineComment({eventType:e,data:s}){return t.post(`events/${e}/timeline`,s)},getTimelineMessage({eventType:e,messageId:s}){return t.get(`events/${e}/timeline/${s}`)},deleteTimelineMessage({eventType:e,messageId:s}){return t.delete(`events/${e}/timeline/${s}`)},getRulesHistory({eventType:e,limit:s=null,offset:n=null,filter:r=null,q:u=null,sort:o=null,fields:l=null}){const a={limit:s,offset:n,filter:r,q:u,sort:o,fields:l};return t.getAll(`events/${e}/rules/history`,a)},getRulesVersionNumber({eventType:e,version:s,fields:n=null}){const r={fields:n};return t.get(`events/${e}/rules/history/${s}`,r)},getRulesVersionDetail({eventType:e,version:s,fields:n=null}){const r={fields:n};return t.get(`events/${e}/rules/versions/${s}`,r)},getAllDraftRulesets({eventType:e,limit:s=null,offset:n=null,filter:r=null,q:u=null,sort:o=null,fields:l=null}){const a={limit:s,offset:n,filter:r,q:u,sort:o,fields:l};return t.getAll(`events/${e}/rules/drafts`,a)},createDraftRuleset({eventType:e,data:s}){return t.post(`events/${e}/rules/drafts`,s)},getDraftRuleset({eventType:e,id:s,fields:n=null}){const r={fields:n};return t.get(`events/${e}/rules/drafts/${s}`,r)},updateDraftRuleset({eventType:e,id:s,data:n}){return t.put(`events/${e}/rules/drafts/${s}`,n)},deleteDraftRuleset({eventType:e,id:s}){return t.delete(`events/${e}/rules/drafts/${s}`)}}}function $t({apiHandler:t}){return{get({resource:e,resourceId:s,service:n}){return t.get(`${e}/${s}/external-identifiers/${n}`)},sync({resource:e,resourceId:s,service:n}){return t.post(`${e}/${s}/external-identifiers/${n}`)},update({resource:e,resourceId:s,service:n,data:r}){return t.put(`${e}/${s}/external-identifiers/${n}`,r)},delete({resource:e,resourceId:s,service:n}){return t.delete(`${e}/${s}/external-identifiers/${n}`)}}}function ht({apiHandler:t}){return{getExternalServiceSettings(){return t.get("external-services-settings")},updateExternalServiceSettings({data:e}){return t.put("external-services-settings",e)}}}function pt({apiHandler:t}){return{getAll({limit:e=null,offset:s=null,filter:n=null,sort:r=null}={}){const u={limit:e,offset:s,filter:n,sort:r};return t.getAll("fees",u)},create({id:e="",data:s}){return t.create(`fees/${e}`,e,s)},get({id:e}){return t.get(`fees/${e}`)},upsert({id:e,data:s}){return t.put(`fees/${e}`,s)},delete({id:e}){return t.delete(`fees/${e}`)},patch({id:e,data:s}){return t.patch(`fees/${e}`,s)}}}function yt({apiHandler:t}){return{getAllAttachments({limit:e=null,offset:s=null,filter:n=null,q:r=null,expand:u=null,fields:o=null,sort:l=null}={}){const a={limit:e,offset:s,filter:n,q:r,expand:u,fields:o,sort:l};return t.getAll("attachments",a)},attach({id:e="",data:s,expand:n=null}){const r={expand:n};return t.create(`attachments/${e}`,e,s,r)},getAttachment({id:e}){return t.get(`attachments/${e}`)},updateAttachment({id:e,data:s,expand:n=null}){const r={expand:n};return t.put(`attachments/${e}`,s,r)},detach({id:e}){return t.delete(`attachments/${e}`)},getAll({limit:e=null,offset:s=null,filter:n=null,q:r=null,fields:u=null,sort:o=null}={}){const l={limit:e,offset:s,filter:n,q:r,fields:u,sort:o};return t.getAll("files",l)},upload({fileObject:e}){return t.post("files",e)},get({id:e}){return t.get(`files/${e}`)},update({id:e,data:s}){return t.put(`files/${e}`,s)},delete({id:e}){return t.delete(`files/${e}`)},download({id:e}){const s={responseType:"arraybuffer"};return t.download(`files/${e}/download`,s)},detachAndDelete({id:e}){const s={filter:`fileId:${e}`};let n=[];const u=(async()=>{const o=this.getAllAttachments(s);n.push(o);const a=(await o).items.map(k=>this.detach({id:k.fields.id}));n=[...n,a],await Promise.all(a);const h=t.delete(`files/${e}`);return n.push(h),h})();return u.cancel=()=>{n.forEach(o=>o.cancel())},u},uploadAndUpdate({fileObject:e,data:s={description:"",tags:[""]}}){const n=[],u=(async()=>{const o=this.upload({fileObject:e});n.push(o),await o;const l={name:o.name,extension:o.extension,description:s.description,tags:s.tags,url:""},a=this.update({id:o.fields.id,data:l});return n.push(a),a})();return u.cancel=()=>{n.forEach(o=>o.cancel())},u}}}function At({apiHandler:t}){return{getAll({limit:e=null,offset:s=null,sort:n=null,filter:r=null,q:u=null,fields:o=null}={}){const l={limit:e,offset:s,sort:n,filter:r,q:u,fields:o};return t.getAll("gateway-accounts",l)},create({id:e="",data:s}){return t.create(`gateway-accounts/${e}`,e,s)},get({id:e}){return t.get(`gateway-accounts/${e}`)},update({id:e,data:s}){return t.patch(`gateway-accounts/${e}`,s)},delete({id:e}){return t.delete(`gateway-accounts/${e}`)},close({id:e}){return t.post(`gateway-accounts/${e}/close`)},disable({id:e}){return t.post(`gateway-accounts/${e}/disable`)},getAllDowntimeSchedules({id:e,limit:s=null,offset:n=null,filter:r=null,sort:u=null}){const o={limit:s,offset:n,filter:r,sort:u};return t.getAll(`gateway-accounts/${e}/downtime-schedules`,o)},createDowntimeSchedule({id:e,data:s}){return t.post(`gateway-accounts/${e}/downtime-schedules`,s)},getDowntimeSchedule({id:e,downtimeId:s}){return t.get(`gateway-accounts/${e}/downtime-schedules/${s}`)},updateDowntimeSchedule({id:e,downtimeId:s,data:n}){return t.put(`gateway-accounts/${e}/downtime-schedules/${s}`,n)},deleteDowntimeSchedule({id:e,downtimeId:s}){return t.delete(`gateway-accounts/${e}/downtime-schedules/${s}`)},enable({id:e}){return t.post(`gateway-accounts/${e}/enable`)},getAllVolumeLimits({id:e}){return t.getAll(`gateway-accounts/${e}/limits`)},getVolumeLimit({id:e,limitId:s}){return t.get(`gateway-accounts/${e}/limits/${s}`)},updateVolumeLimit({id:e,limitId:s,data:n}){return t.put(`gateway-accounts/${e}/limits/${s}`,n)},deleteVolumeLimit({id:e,limitId:s}){return t.delete(`gateway-accounts/${e}/limits/${s}`)},getAllTimelineMessages({id:e,limit:s=null,offset:n=null,filter:r=null,sort:u=null,q:o=null}){const l={limit:s,offset:n,filter:r,sort:u,q:o};return t.getAll(`gateway-accounts/${e}/timeline`,l)},createTimelineComment({id:e,data:s}){return t.post(`gateway-accounts/${e}/timeline`,s)},getTimelineMessage({id:e,messageId:s}){return t.get(`gateway-accounts/${e}/timeline/${s}`)},deleteTimelineMessage({id:e,messageId:s}){return t.delete(`gateway-accounts/${e}/timeline/${s}`)},checkCredentials({id:e}){return t.post(`gateway-accounts/${e}/check-credentials`)},getFinancialSettings({id:e}){return t.get(`gateway-accounts/${e}/financial-settings`)},setFinancialSettings({id:e,data:s}){return t.put(`gateway-accounts/${e}/financial-settings`,s)}}}function Rt({apiHandler:t}){return{getAll({limit:e=null,offset:s=null}={}){const n={limit:e,offset:s};return t.getAll("integrations",n)},get({label:e}){return t.get(`integrations/${e}`)}}}const q={Accept:"application/pdf"};function bt({apiHandler:t}){return{getAll({filter:e=null,sort:s=null,limit:n=null,offset:r=null,q:u=null,expand:o=null}={}){const l={filter:e,sort:s,limit:n,offset:r,q:u,expand:o};return t.getAll("invoices",l)},create({id:e="",data:s}){return t.create(`invoices/${e}`,e,s)},get({id:e,expand:s=null}){const n={expand:s};return t.get(`invoices/${e}`,n)},update({id:e,data:s}){return t.put(`invoices/${e}`,s)},getAllInvoiceItems({id:e,limit:s=null,offset:n=null,expand:r=null}){const u={limit:s,offset:n,expand:r};return t.getAll(`invoices/${e}/items`,u)},createInvoiceItem({id:e,data:s}){return t.post(`invoices/${e}/items`,s)},getInvoiceItem({id:e,itemId:s}){return t.get(`invoices/${e}/items/${s}`)},updateInvoiceItem({id:e,itemId:s,data:n}){return t.put(`invoices/${e}/items/${s}`,n)},deleteInvoiceItem({id:e,itemId:s}){return t.delete(`invoices/${e}/items/${s}`)},issue({id:e,data:s}){return t.post(`invoices/${e}/issue`,s)},abandon({id:e}){return t.post(`invoices/${e}/abandon`)},void({id:e}){return t.post(`invoices/${e}/void`)},recalculate({id:e}){return t.post(`invoices/${e}/recalculate`)},reissue({id:e,data:s}){return t.post(`invoices/${e}/reissue`,s)},getAllTransactionAllocations({id:e,limit:s=null,offset:n=null}){const r={limit:s,offset:n};return t.getAll(`invoices/${e}/transaction-allocations`,r)},applyTransaction({id:e,data:s}){return t.post(`invoices/${e}/transaction`,s)},getAllTimelineMessages({id:e,limit:s=null,offset:n=null,filter:r=null,sort:u=null,q:o=null}){const l={limit:s,offset:n,filter:r,sort:u,q:o};return t.getAll(`invoices/${e}/timeline`,l)},createTimelineComment({id:e,data:s}){return t.post(`invoices/${e}/timeline`,s)},getTimelineMessage({id:e,messageId:s}){return t.get(`invoices/${e}/timeline/${s}`)},deleteTimelineMessage({id:e,messageId:s}){return t.delete(`invoices/${e}/timeline/${s}`)},downloadPDF({id:e}){const s={headers:q,responseType:"arraybuffer"};return t.download(`invoices/${e}`,s)}}}function wt({apiHandler:t}){return{getAllAccounts({limit:e=null,offset:s=null,filter:n=null,sort:r=null}={}){const u={limit:e,offset:s,filter:n,sort:r};return t.getAll("journal-accounts",u)},createAccount({id:e="",data:s}){return t.create(`journal-accounts/${e}`,e,s)},getAccount({id:e}){return t.get(`journal-accounts/${e}`)},updateAccount({id:e,data:s}){return t.put(`journal-accounts/${e}`,s)}}}function kt({apiHandler:t}){return{getAllEntries({limit:e=null,offset:s=null,filter:n=null,sort:r=null}={}){const u={limit:e,offset:s,filter:n,sort:r};return t.getAll("journal-entries",u)},createEntry({id:e="",data:s}){return t.create(`journal-entries/${e}`,e,s)},getEntry({id:e}){return t.get(`journal-entries/${e}`)},updateEntry({id:e,data:s}){return t.put(`journal-entries/${e}`,s)},getAllRecords({id:e,limit:s=null,offset:n=null,filter:r=null,sort:u=null,expand:o=null}){const l={limit:s,offset:n,filter:r,sort:u,expand:o};return t.getAll(`journal-entries/${e}/records`,l)},createRecord({id:e,data:s}){return t.post(`journal-entries/${e}/records`,s)},getRecord({id:e,journalRecordId:s}){return t.get(`journal-entries/${e}/records/${s}`)},updateRecord({id:e,journalRecordId:s,data:n}){return t.put(`journal-entries/${e}/records/${s}`,n)},deleteRecord({id:e,journalRecordId:s}){return t.delete(`journal-entries/${e}/records/${s}`)}}}function dt({apiHandler:t}){return{getAll({limit:e=null,offset:s=null,filter:n=null,sort:r=null,expand:u=null}={}){const o={limit:e,offset:s,filter:n,sort:r,expand:u};return t.getAll("kyc-documents",o)},create({id:e="",data:s}){return t.create(`kyc-documents/${e}`,e,s)},get({id:e}){return t.get(`kyc-documents/${e}`)},update({id:e,data:s}){return t.put(`kyc-documents/${e}`,s)},accept({id:e}){return t.post(`kyc-documents/${e}/acceptance`)},matches({id:e,data:s}){return t.post(`kyc-documents/${e}/matches`,s)},reject({id:e,data:s}){return t.post(`kyc-documents/${e}/rejection`,s)},review({id:e}){return t.post(`kyc-documents/${e}/review`)},startReview({id:e}){return t.post(`kyc-documents/${e}/start-review`)},stopReview({id:e}){return t.post(`kyc-documents/${e}/stop-review`)}}}function vt({apiHandler:t}){return{getAll({limit:e=null,offset:s=null,filter:n=null,sort:r=null}={}){const u={limit:e,offset:s,filter:n,sort:r};return t.getAll("kyc-requests",u)},create({data:e}){return t.post("kyc-requests",e)},get({id:e}){return t.get(`kyc-requests/${e}`)},delete({id:e}){return t.delete(`kyc-requests/${e}`)},update({id:e,data:s}){return t.patch(`kyc-requests/${e}`,s)}}}function Tt({apiHandler:t}){return{getKycSettings(){return t.get("kyc-settings")},updateKycSettings({data:e}){return t.put("kyc-settings",e)}}}function St({apiHandler:t}){return{getAll({limit:e=null,offset:s=null,filter:n=null,sort:r=null,fields:u=null,q:o=null}={}){const l={limit:e,offset:s,filter:n,sort:r,fields:u,q:o};return t.getAll("lists",l)},create({id:e="",data:s}){return t.create(`lists/${e}`,e,s)},getLatestVersion({id:e}){return t.get(`lists/${e}`)},update({id:e,data:s}){return t.put(`lists/${e}`,s)},delete({id:e}){return t.delete(`lists/${e}`)},getByVersion({id:e,version:s}){return t.get(`lists/${e}/${s}`)}}}function Et({apiHandler:t}){return{getAll({limit:e=null,offset:s=null,filter:n=null,sort:r=null}={}){const u={limit:e,offset:s,filter:n,sort:r};return t.getAll("memberships",u)},get({organizationId:e,userId:s}){return t.get(`memberships/${e}/${s}`)},update({organizationId:e,userId:s,data:n}){return t.put(`memberships/${e}/${s}`,n)},delete({organizationId:e,userId:s}){return t.delete(`memberships/${e}/${s}`)}}}function It({apiHandler:t}){return{getAll({limit:e=null,offset:s=null,filter:n=null,q:r=null,sort:u=null}={}){const o={limit:e,offset:s,filter:n,q:r,sort:u};return t.getAll("organization-exports",o)},create({data:e}){return t.post("organization-exports",e)},get({id:e}){return t.get(`organization-exports/${e}`)}}}function qt({apiHandler:t}){return{getAll({limit:e=null,offset:s=null,filter:n=null,sort:r=null,q:u=null}={}){const o={limit:e,offset:s,filter:n,sort:r,q:u};return t.getAll("organizations",o)},create({data:e}){return t.post("organizations",e)},get({id:e}){return t.get(`organizations/${e}`)},update({id:e,data:s}){return t.patch(`organizations/${e}`,s)}}}function xt({apiHandler:t}){return{getAll({limit:e=null,q:s=null}={}){const n={limit:e,q:s};return t.getAll("payment-cards-bank-names",n)}}}function Pt({apiHandler:t}){return{getAll({filter:e=null,sort:s=null,limit:n=null,offset:r=null,q:u=null,expand:o=null}={}){const l={filter:e,sort:s,limit:n,offset:r,q:u,expand:o};return t.getAll("payment-instruments",l)},create({data:e}){return t.post("payment-instruments",e)},get({id:e}){return t.get(`payment-instruments/${e}`)},update({id:e,data:s}){return t.patch(`payment-instruments/${e}`,s)},deactivate({id:e}){return t.post(`payment-instruments/${e}/deactivation`)}}}function Ct({apiHandler:t}){return{getAll({limit:e=null,offset:s=null}={}){const n={limit:e,offset:s};return t.getAll("payment-methods",n)},get({apiName:e}){return t.get(`payment-methods/${e}`)}}}function jt({apiHandler:t}){return{getAll({limit:e=null,offset:s=null}={}){const n={limit:e,offset:s};return t.getAll("tokens",n)},create({data:e}){return t.post("tokens",e)},get({token:e}){return t.get(`tokens/${e}`)}}}function Dt({apiHandler:t}){return{getAll({limit:e=null,offset:s=null,filter:n=null,sort:r=null}={}){const u={limit:e,offset:s,filter:n,sort:r};return t.getAll("payout-requests",u)},create({id:e="",data:s}){return t.create(`payout-requests/${e}`,e,s)},get({id:e}){return t.get(`payout-requests/${e}`)},update({id:e,data:s}){return t.put(`payout-requests/${e}`,s)},getPaymentInstruments({id:e}){return t.get(`payout-requests/${e}/payment-instruments`)}}}function Mt({apiHandler:t}){return{create({data:e}){return t.post("payouts",e)}}}function Ot({apiHandler:t}){return{getAll({filter:e=null,sort:s=null,limit:n=null,offset:r=null,q:u=null}={}){const o={filter:e,sort:s,limit:n,offset:r,q:u};return t.getAll("plans",o)},create({id:e="",data:s}){return t.create(`plans/${e}`,e,s)},get({id:e}){return t.get(`plans/${e}`)},update({id:e,data:s}){return t.put(`plans/${e}`,s)},delete({id:e}){return t.delete(`plans/${e}`)}}}function Ft({apiHandler:t}){return{order({data:e}){return t.post("previews/orders",e)},sendEmailRuleAction({data:e}){return t.post("previews/rule-actions/send-email",e)},webhook({data:e}){return t.post("previews/webhooks",e)}}}function Bt({apiHandler:t}){return{getAll({filter:e=null,sort:s=null,limit:n=null,offset:r=null,q:u=null}={}){const o={filter:e,sort:s,limit:n,offset:r,q:u};return t.getAll("products",o)},create({id:e="",data:s}){return t.create(`products/${e}`,e,s)},get({id:e}){return t.get(`products/${e}`)},update({id:e,data:s}){return t.put(`products/${e}`,s)},delete({id:e}){return t.delete(`products/${e}`)}}}function Kt({apiHandler:t}){return{startPermissionsEmulation({data:e}){return t.post("permissions-emulation",e)},stopPermissionsEmulation(){return t.delete("permissions-emulation")},get(){return t.get("profile")},update({data:e}){return t.put("profile",e)},getMfa(){return t.get("profile/mfa")},updateMfa(){return t.post("profile/mfa")},deleteMfa(){return t.delete("profile/mfa")}}}function Lt({apiHandler:t}){return{readyToPay({data:e}){return t.post("ready-to-pay",e)}}}function Nt({apiHandler:t}){return{getAll({filter:e=null,sort:s=null,limit:n=null,offset:r=null,expand:u=null}={}){const o={filter:e,sort:s,limit:n,offset:r,expand:u};return t.getAll("quotes",o)},create({id:e="",data:s}){return t.create(`quotes/${e}`,e,s)},get({id:e,expand:s=null}){const n={expand:s};return t.get(`quotes/${e}`,n)},update({id:e,data:s}){return t.put(`quotes/${e}`,s)},patch({id:e,data:s}){return t.patch(`quotes/${e}`,s)},accept({id:e}){return t.post(`quotes/${e}/accept`)},cancel({id:e}){return t.post(`quotes/${e}/cancel`)},issue({id:e}){return t.post(`quotes/${e}/issue`)},recall({id:e}){return t.post(`quotes/${e}/recall`)},reject({id:e}){return t.post(`quotes/${e}/reject`)},getAllTimelineMessages({id:e,limit:s=null,offset:n=null,filter:r=null,sort:u=null,q:o=null}){const l={limit:s,offset:n,filter:r,sort:u,q:o};return t.getAll(`quotes/${e}/timeline`,l)},createTimelineComment({id:e,data:s}){return t.post(`quotes/${e}/timeline`,s)},getTimelineMessage({id:e,messageId:s}){return t.get(`quotes/${e}/timeline/${s}`)},deleteTimelineMessage({id:e,messageId:s}){return t.delete(`quotes/${e}/timeline/${s}`)},downloadPDF({id:e}){const s={headers:q,responseType:"arraybuffer"};return t.download(`quotes/${e}`,s)}}}function zt({apiHandler:t}){return{get({resource:e,resourceId:s,service:n}){return t.get(`${e}/${s}/external-identifiers/${n}`)},sync({resource:e,resourceId:s,service:n}){return t.post(`${e}/${s}/external-identifiers/${n}`)},update({resource:e,resourceId:s,service:n,data:r}){return t.put(`${e}/${s}/external-identifiers/${n}`,r)},delete({resource:e,resourceId:s,service:n}){return t.delete(`${e}/${s}/external-identifiers/${n}`)}}}function Ut({apiHandler:t}){return{getAll({filter:e=null,sort:s=null,limit:n=null,offset:r=null,q:u=null}={}){const o={filter:e,sort:s,limit:n,offset:r,q:u};return t.getAll("rich-billing-portals",o)},create({id:e="",data:s}){return t.create(`rich-billing-portals/${e}`,e,s)},get({id:e}){return t.get(`rich-billing-portals/${e}`)},update({id:e,data:s}){return t.put(`rich-billing-portals/${e}`,s)}}}function Vt({apiHandler:t}){return{getAll(){return t.get("risk-score-rules")},updateRiskScoreRules({data:e}){return t.put("risk-score-rules",e)},getAllBlocklistRules(){return t.get("risk-score-rules/blocklists")},updateRiskScoreBlocklistRules({data:e}){return t.put("risk-score-rules/blocklists",e)}}}function Wt({apiHandler:t}){return{getAll({limit:e=null,offset:s=null,filter:n=null,sort:r=null,q:u=null,expand:o=null}={}){const l={limit:e,offset:s,filter:n,sort:r,q:u,expand:o};return t.getAll("roles",l)},create({id:e="",data:s}){return t.create(`roles/${e}`,e,s)},get({id:e,expand:s=null}){const n={expand:s};return t.get(`roles/${e}`,n)},update({id:e,data:s}){return t.put(`roles/${e}`,s)},delete({id:e}){return t.delete(`roles/${e}`)}}}function Jt({apiHandler:t}){return{get({sort:e=null,limit:s=null,offset:n=null,q:r=null}){const u={sort:e,limit:s,offset:n,q:r};return t.get("search",u)}}}function Gt({apiHandler:t}){return{getAll({limit:e=null,offset:s=null,sort:n=null,filter:r=null,q:u=null}={}){const o={limit:e,offset:s,sort:n,filter:r,q:u};return t.getAll("grid-segments",o)},create({id:e="",data:s}){return t.create(`grid-segments/${e}`,e,s)},get({id:e}){return t.get(`grid-segments/${e}`)},update({id:e,data:s}){return t.put(`grid-segments/${e}`,s)},delete({id:e}){return t.delete(`grid-segments/${e}`)}}}function Yt({apiHandler:t}){return{getAll({eventType:e}){return t.getAll(`send-through-attribution/${e}`)}}}function _t({apiHandler:t}){return{getAll({type:e,filter:s=null,limit:n=null,offset:r=null,sort:u=null,q:o=null}){const l={filter:s,limit:n,offset:r,sort:u,q:o};return t.getAll(`service-credentials/${e}`,l)},create({type:e,data:s}){return t.post(`service-credentials/${e}`,s)},get({type:e,id:s}){return t.get(`service-credentials/${e}/${s}`)},update({type:e,id:s,data:n}){return t.patch(`service-credentials/${e}/${s}`,n)},getItems({type:e,id:s,limit:n=null,offset:r=null,filter:u=null,q:o=null,fields:l=null,sort:a=null}){const h={limit:n,offset:r,filter:u,q:o,fields:l,sort:a};return t.getAll(`service-credentials/${e}/${s}/items`,h)}}}function Qt({apiHandler:t}){return{getAll({limit:e=null,offset:s=null,filter:n=null,sort:r=null,q:u=null}={}){const o={limit:e,offset:s,filter:n,sort:r,q:u};return t.getAll("shipping-rates",o)},create({id:e="",data:s}){return t.create(`shipping-rates/${e}`,e,s)},get({id:e}){return t.get(`shipping-rates/${e}`)},update({id:e,data:s}){return t.put(`shipping-rates/${e}`,s)},delete({id:e}){return t.delete(`shipping-rates/${e}`)}}}function Xt({apiHandler:t}){return{get(){return t.get("status")}}}function Zt({apiHandler:t}){return{getAll({limit:e=null,offset:s=null,filter:n=null,sort:r=null}={}){const u={limit:e,offset:s,filter:n,sort:r};return t.getAll("subscription-cancellations",u)},create({id:e="",data:s}){return t.create(`subscription-cancellations/${e}`,e,s)},get({id:e}){return t.get(`subscription-cancellations/${e}`)},delete({id:e}){return t.delete(`subscription-cancellations/${e}`)},patch({id:e,data:s}){return t.patch(`subscription-cancellations/${e}`,s)}}}function Ht({apiHandler:t}){return{getAll({limit:e=null,offset:s=null,filter:n=null,sort:r=null}={}){const u={limit:e,offset:s,filter:n,sort:r};return t.getAll("subscription-pauses",u)},pause({id:e="",data:s}){return t.create(`subscription-pauses/${e}`,e,s)},get({id:e}){return t.get(`subscription-pauses/${e}`)},update({id:e,data:s}){return t.put(`subscription-pauses/${e}`,s)},delete({id:e}){return t.delete(`subscription-pauses/${e}`)}}}function es({apiHandler:t}){return{getAll({limit:e=null,offset:s=null,filter:n=null,sort:r=null}={}){const u={limit:e,offset:s,filter:n,sort:r};return t.getAll("subscription-reactivations",u)},reactivate({data:e}){return t.post("subscription-reactivations",e)},get({id:e}){return t.get(`subscription-reactivations/${e}`)}}}function ts({apiHandler:t}){return{getAll({filter:e=null,sort:s=null,limit:n=null,offset:r=null,q:u=null,expand:o=null}={}){const l={filter:e,sort:s,limit:n,offset:r,q:u,expand:o};return t.getAll("subscriptions",l)},create({id:e="",data:s,expand:n=null}){const r={expand:n};return t.create(`subscriptions/${e}`,e,s,r)},get({id:e,expand:s=null}){const n={expand:s};return t.get(`subscriptions/${e}`,n)},update({id:e,data:s,expand:n=null}){const r={expand:n};return t.put(`subscriptions/${e}`,s,r)},delete({id:e}){return t.delete(`subscriptions/${e}`)},void({id:e}){return t.post(`subscriptions/${e}/void`)},changeItems({id:e,data:s}){return t.post(`subscriptions/${e}/change-items`,s)},updateItem({id:e,itemId:s,data:n}){return t.patch(`subscriptions/${e}/items/${s}`,n)},createInterimInvoice({id:e,data:s}){return t.post(`subscriptions/${e}/interim-invoice`,s)},getAllUpcomingInvoices({id:e,expand:s=null}){const n={expand:s};return t.getAll(`subscriptions/${e}/upcoming-invoices`,n)},getUpcomingInvoice({id:e,expand:s=null}){const n={expand:s};return t.get(`subscriptions/${e}/upcoming-invoice`,n)},issueEarlyUpcomingInvoice({id:e,data:s}){return t.post(`subscriptions/${e}/upcoming-invoice/issue`,s)},issueUpcomingInvoice({id:e,invoiceId:s,data:n}){return t.post(`subscriptions/${e}/upcoming-invoices/${s}/issue`,n)},getAllTimelineMessages({id:e,limit:s=null,offset:n=null,filter:r=null,sort:u=null,q:o=null}){const l={limit:s,offset:n,filter:r,sort:u,q:o};return t.getAll(`subscriptions/${e}/timeline`,l)},createTimelineComment({id:e,data:s}){return t.post(`subscriptions/${e}/timeline`,s)},getTimelineMessage({id:e,messageId:s}){return t.get(`subscriptions/${e}/timeline/${s}`)},deleteTimelineMessage({id:e,messageId:s}){return t.delete(`subscriptions/${e}/timeline/${s}`)}}}function ss({apiHandler:t}){return{getAll({limit:e=null,offset:s=null,filter:n=null,q:r=null,sort:u=null}={}){const o={limit:e,offset:s,filter:n,q:r,sort:u};return t.getAll("tags",o)},create({data:e}){return t.post("tags",e)},get({tag:e}){return t.get(`tags/${e}`)},delete({tag:e}){return t.delete(`tags/${e}`)},update({tag:e,data:s}){return t.patch(`tags/${e}`,s)},tagCustomers({tag:e,data:s}){return t.post(`tags/${e}/customers`,s)},untagCustomers({tag:e,data:s}){return t.delete(`tags/${e}/customers`,s)},tagCustomer({tag:e,customerId:s}){return t.post(`tags/${e}/customers/${s}`)},untagCustomer({tag:e,customerId:s}){return t.delete(`tags/${e}/customers/${s}`)},tagKycDocuments({tag:e,data:s}){return t.post(`tags/${e}/kyc-documents`,s)},untagKycDocuments({tag:e,data:s}){return t.delete(`tags/${e}/kyc-documents`,s)},tagKycDocument({tag:e,kycDocumentId:s}){return t.post(`tags/${e}/kyc-documents/${s}`)},untagKycDocument({tag:e,kycDocumentId:s}){return t.delete(`tags/${e}/kyc-documents/${s}`)},tagAmlChecks({tag:e,data:s}){return t.post(`tags/${e}/aml-checks`,s)},untagAmlChecks({tag:e,data:s}){return t.delete(`tags/${e}/aml-checks`,s)},tagAmlCheck({tag:e,amlCheckId:s}){return t.post(`tags/${e}/aml-checks/${s}`)},untagAmlCheck({tag:e,amlCheckId:s}){return t.delete(`tags/${e}/aml-checks/${s}`)}}}function ns({apiHandler:t}){return{getAllTagsRules({limit:e=null,offset:s=null,sort:n=null,filter:r=null,q:u=null}={}){const o={limit:e,offset:s,sort:n,filter:r,q:u};return t.getAll("tags-rules",o)},createTagsRule({id:e="",data:s}){return t.create(`tags-rules/${e}`,e,s)},getTagsRule({id:e}){return t.get(`tags-rules/${e}`)},updateTagsRule({id:e,data:s}){return t.put(`tags-rules/${e}`,s)},deleteTagsRule({id:e}){return t.delete(`tags-rules/${e}`)}}}function rs({apiHandler:t}){return{getAllApiLogs({limit:e=null,offset:s=null,sort:n=null,filter:r=null,q:u=null,expand:o=null}={}){const l={limit:e,offset:s,sort:n,filter:r,q:u,expand:o};return t.getAll("tracking/api",l)},getApiLog({id:e}){return t.get(`tracking/api/${e}`)},getAllTaxTrackingLogs({limit:e=null,offset:s=null,sort:n=null,filter:r=null,q:u=null}={}){const o={limit:e,offset:s,sort:n,filter:r,q:u};return t.getAll("tracking/taxes",o)},getTaxTrackingLog({id:e}){return t.get(`tracking/taxes/${e}`)},getAllListsChangesHistory({limit:e=null,offset:s=null,sort:n=null,filter:r=null,q:u=null}={}){const o={limit:e,offset:s,sort:n,filter:r,q:u};return t.getAll("tracking/lists",o)},getAllWebhookTrackingLogs({limit:e=null,offset:s=null,sort:n=null,filter:r=null,q:u=null}={}){const o={limit:e,offset:s,sort:n,filter:r,q:u};return t.getAll("tracking/webhooks",o)},getWebhookTrackingLog({id:e}){return t.get(`tracking/webhooks/${e}`)},resendWebhook({id:e}){return t.post(`tracking/webhooks/${e}/resend`)}}}function us({apiHandler:t}){return{getAll({limit:e=null,offset:s=null,filter:n=null,q:r=null,sort:u=null,expand:o=null}={}){const l={limit:e,offset:s,filter:n,q:r,sort:u,expand:o};return t.getAll("transactions",l)},create({data:e,expand:s=null}){const n={expand:s};return t.post("transactions",e,n)},get({id:e,expand:s=null}){const n={expand:s};return t.get(`transactions/${e}`,n)},patch({id:e,data:s}){return t.patch(`transactions/${e}`,s)},query({id:e}){return t.post(`transactions/${e}/query`)},update({id:e,data:s}){return t.post(`transactions/${e}/update`,s)},refund({id:e,data:s}){return t.post(`transactions/${e}/refund`,s)},getAllTimelineMessages({id:e,limit:s=null,offset:n=null,filter:r=null,sort:u=null,q:o=null}){const l={limit:s,offset:n,filter:r,sort:u,q:o};return t.getAll(`transactions/${e}/timeline`,l)},createTimelineComment({id:e,data:s}){return t.post(`transactions/${e}/timeline`,s)},getTimelineMessage({id:e,messageId:s}){return t.get(`transactions/${e}/timeline/${s}`)},deleteTimelineMessage({id:e,messageId:s}){return t.delete(`transactions/${e}/timeline/${s}`)}}}function os({apiHandler:t}){return{getAll({filter:e=null,sort:s=null,limit:n=null,offset:r=null,q:u=null}={}){const o={filter:e,sort:s,limit:n,offset:r,q:u};return t.getAll("usages",o)},create({id:e="",data:s}){return t.create(`usages/${e}`,e,s)},get({id:e}){return t.get(`usages/${e}`)},update({id:e,data:s}){return t.put(`usages/${e}`,s)},delete({id:e}){return t.delete(`usages/${e}`)}}}function ls({apiHandler:t}){return{getAll({limit:e=null,offset:s=null,sort:n=null,filter:r=null,q:u=null}={}){const o={limit:e,offset:s,sort:n,filter:r,q:u};return t.getAll("users",o)},create({id:e="",data:s}){return t.create(`users/${e}`,e,s)},get({id:e}){return t.get(`users/${e}`)},update({id:e,data:s}){return t.put(`users/${e}`,s)},getMfa({id:e}){return t.get(`users/${e}/mfa`)}}}function cs({apiHandler:t}){return{getAll({limit:e=null,offset:s=null,filter:n=null}={}){const r={limit:e,offset:s,filter:n};return t.getAll("webhooks",r)},create({id:e="",data:s}){return t.create(`webhooks/${e}`,e,s)},get({id:e}){return t.get(`webhooks/${e}`)},update({id:e,data:s}){return t.put(`webhooks/${e}`,s)}}}function is({apiHandler:t}){return{getAll({limit:e=null,offset:s=null,q:n=null,filter:r=null,sort:u=null}={}){const o={limit:e,offset:s,q:n,filter:r,sort:u};return t.getAll("websites",o)},create({id:e="",data:s}){return t.create(`websites/${e}`,e,s)},get({id:e}){return t.get(`websites/${e}`)},update({id:e,data:s}){return t.put(`websites/${e}`,s)},delete({id:e}){return t.delete(`websites/${e}`)}}}class gs{constructor({apiHandler:e}){this.account=Ne({apiHandler:e}),this.allowlists=ze({apiHandler:e}),this.amlChecks=Ue({apiHandler:e}),this.amlSettings=Ve({apiHandler:e}),this.apiKeys=We({apiHandler:e}),this.applicationInstances=Je({apiHandler:e}),this.applications=Ge({apiHandler:e}),this.balanceTransactions=Ye({apiHandler:e}),this.billingPortals=_e({apiHandler:e}),this.blocklists=Qe({apiHandler:e}),this.broadcastMessages=Xe({apiHandler:e}),this.checkoutForms=Ze({apiHandler:e}),this.coupons=He({apiHandler:e}),this.creditMemos=et({apiHandler:e}),this.customDomains=tt({apiHandler:e}),this.customFields=st({apiHandler:e}),this.customerAuthentication=nt({apiHandler:e}),this.customers=rt({apiHandler:e}),this.depositCustomPropertySets=ut({apiHandler:e}),this.depositRequests=ot({apiHandler:e}),this.depositStrategies=lt({apiHandler:e}),this.digitalWallets=ct({apiHandler:e}),this.disputes=it({apiHandler:e}),this.emailDeliverySettings=gt({apiHandler:e}),this.emailMessages=at({apiHandler:e}),this.emailNotifications=mt({apiHandler:e}),this.events=ft({apiHandler:e}),this.externalIdentifiers=$t({apiHandler:e}),this.externalServicesSettings=ht({apiHandler:e}),this.fees=pt({apiHandler:e}),this.files=yt({apiHandler:e}),this.gatewayAccounts=At({apiHandler:e}),this.integrations=Rt({apiHandler:e}),this.invoices=bt({apiHandler:e}),this.journalAccounts=wt({apiHandler:e}),this.journalEntries=kt({apiHandler:e}),this.kycDocuments=dt({apiHandler:e}),this.kycRequests=vt({apiHandler:e}),this.kycSettings=Tt({apiHandler:e}),this.lists=St({apiHandler:e}),this.memberships=Et({apiHandler:e}),this.organizationExports=It({apiHandler:e}),this.organizations=qt({apiHandler:e}),this.paymentCardsBankNames=xt({apiHandler:e}),this.paymentInstruments=Pt({apiHandler:e}),this.paymentMethods=Ct({apiHandler:e}),this.paymentTokens=jt({apiHandler:e}),this.payoutRequests=Dt({apiHandler:e}),this.payouts=Mt({apiHandler:e}),this.plans=Ot({apiHandler:e}),this.previews=Ft({apiHandler:e}),this.products=Bt({apiHandler:e}),this.profile=Kt({apiHandler:e}),this.purchase=Lt({apiHandler:e}),this.quotes=Nt({apiHandler:e}),this.resource=zt({apiHandler:e}),this.richBillingPortals=Ut({apiHandler:e}),this.riskScoreRules=Vt({apiHandler:e}),this.roles=Wt({apiHandler:e}),this.search=Jt({apiHandler:e}),this.segments=Gt({apiHandler:e}),this.sendThroughAttribution=Yt({apiHandler:e}),this.serviceCredentials=_t({apiHandler:e}),this.shippingRates=Qt({apiHandler:e}),this.status=Xt({apiHandler:e}),this.subscriptionCancellations=Zt({apiHandler:e}),this.subscriptionPauses=Ht({apiHandler:e}),this.subscriptionReactivations=es({apiHandler:e}),this.subscriptions=ts({apiHandler:e}),this.tags=ss({apiHandler:e}),this.tagsRules=ns({apiHandler:e}),this.tracking=rs({apiHandler:e}),this.transactions=us({apiHandler:e}),this.usages=os({apiHandler:e}),this.users=ls({apiHandler:e}),this.webhooks=cs({apiHandler:e}),this.websites=is({apiHandler:e}),this.addRequestInterceptor=e.addRequestInterceptor,this.removeRequestInterceptor=e.removeRequestInterceptor,this.addResponseInterceptor=e.addResponseInterceptor,this.removeResponseInterceptor=e.removeResponseInterceptor,this.setTimeout=e.setTimeout,this.setProxyAgent=e.setProxyAgent,this.setSessionToken=e.setSessionToken,this.setPublishableKey=e.setPublishableKey,this.setEndpoints=e.setEndpoints,this.getCancellationToken=e.getCancellationToken,this.generateSignature=e.generateSignature}}function as({apiHandler:t}){return{getCustomerLifetimeSummaryMetrics({customerId:e}){return t.get(`customers/${e}/summary-metrics`)}}}function ms({apiHandler:t}){return{getAll({limit:e=null,offset:s=null,sort:n=null,expand:r=null,filter:u=null,q:o=null,criteria:l=null}={}){const a={limit:e,offset:s,sort:n,expand:r,filter:u,q:o,criteria:l};return t.getAll("data-exports",a)},queue({id:e="",data:s,expand:n=null}){const r={expand:n};return t.create(`data-exports/${e}`,e,s,r)},get({id:e,expand:s=null}){const n={expand:s};return t.get(`data-exports/${e}`,n)},update({id:e,data:s,expand:n=null}){const r={expand:n};return t.put(`data-exports/${e}`,s,r)},delete({id:e}){return t.delete(`data-exports/${e}`)}}}function fs({apiHandler:t}){return{getTransactionHistogramReport({periodStart:e,periodEnd:s,aggregationPeriod:n,metric:r,filter:u=null}){const o={periodStart:e,periodEnd:s,aggregationPeriod:n,metric:r,filter:u};return t.get("histograms/transactions",o)}}}function $s({apiHandler:t}){return{getApiLogSummary({periodStart:e,periodEnd:s,limit:n=null,offset:r=null}){const u={periodStart:e,periodEnd:s,limit:n,offset:r};return t.get("reports/api-log-summary",u)},getCumulativeSubscriptions({aggregationField:e,periodStart:s,periodEnd:n,limit:r=null,offset:u=null,filter:o=null}){const l={aggregationField:e,periodStart:s,periodEnd:n,limit:r,offset:u,filter:o};return t.get("reports/cumulative-subscriptions",l)},getDashboardMetrics({periodStart:e,periodEnd:s,metrics:n=null,segments:r=null}){const u={periodStart:e,periodEnd:s,metrics:n,segments:r};return t.get("reports/dashboard",u)},getDccMarkup({aggregationField:e,periodStart:s,periodEnd:n,limit:r=null,offset:u=null,filter:o=null}){const l={aggregationField:e,periodStart:s,periodEnd:n,limit:r,offset:u,filter:o};return t.get("reports/dcc-markup",l)},getDeclinedTransactions({aggregationField:e,periodStart:s,periodEnd:n,limit:r=null,offset:u=null,filter:o=null}){const l={aggregationField:e,periodStart:s,periodEnd:n,limit:r,offset:u,filter:o};return t.get("reports/declined-transactions",l)},getDisputes({aggregationField:e,periodMonth:s,limit:n=null,offset:r=null,filter:u=null}){const o={aggregationField:e,periodMonth:s,limit:n,offset:r,filter:u};return t.get("reports/disputes",o)},getEventsTriggeredSummary({periodStart:e,periodEnd:s,limit:n=null,offset:r=null}){const u={periodStart:e,periodEnd:s,limit:n,offset:r};return t.get("reports/events-triggered",u)},getTriggeredEventRuleReport({eventType:e,periodStart:s,periodEnd:n,limit:r=null,offset:u=null}){const o={periodStart:s,periodEnd:n,limit:r,offset:u};return t.get(`reports/events-triggered/${e}/rules`,o)},getFutureRenewals({periodStart:e,periodEnd:s,limit:n=null,offset:r=null}){const u={periodStart:e,periodEnd:s,limit:n,offset:r};return t.get("reports/future-renewals",u)},getJournal({currency:e,bookedFrom:s=null,bookedTo:n=null,recognizedAt:r,aggregationField:u,limit:o=null,offset:l=null,filter:a=null}){const h={currency:e,bookedFrom:s,bookedTo:n,recognizedAt:r,aggregationField:u,limit:o,offset:l,filter:a};return t.get("reports/journal",h)},getKycAcceptanceSummary({periodStart:e,periodEnd:s}){const n={periodStart:e,periodEnd:s};return t.get("reports/kyc-acceptance-summary",n)},getKycRejectionSummary({periodStart:e,periodEnd:s}){const n={periodStart:e,periodEnd:s};return t.get("reports/kyc-rejection-summary",n)},getKycRequestSummary({periodStart:e,periodEnd:s}){const n={periodStart:e,periodEnd:s};return t.get("reports/kyc-request-summary",n)},getMonthlyRecurringRevenue({currency:e,periodStart:s,periodEnd:n,limit:r=null,offset:u=null}){const o={currency:e,periodStart:s,periodEnd:n,limit:r,offset:u};return t.get("reports/monthly-recurring-revenue",o)},getRenewalSales({periodStart:e,periodEnd:s,limit:n=null,offset:r=null}){const u={periodStart:e,periodEnd:s,limit:n,offset:r};return t.get("reports/renewal-sales",u)},getRetentionPercentage({aggregationField:e,aggregationPeriod:s,includeSwitchedSubscriptions:n=null,periodStart:r,periodEnd:u,limit:o=null,offset:l=null,filter:a=null,criteria:h=null}){const k={aggregationField:e,aggregationPeriod:s,includeSwitchedSubscriptions:n,periodStart:r,periodEnd:u,limit:o,offset:l,filter:a,criteria:h};return t.get("reports/retention-percentage",k)},getRetentionValue({aggregationField:e,aggregationPeriod:s,includeRefunds:n=null,includeDisputes:r=null,periodStart:u,periodEnd:o,limit:l=null,offset:a=null,filter:h=null,sort:k=null,criteria:M=null}){const O={aggregationField:e,aggregationPeriod:s,includeRefunds:n,includeDisputes:r,periodStart:u,periodEnd:o,limit:l,offset:a,filter:h,sort:k,criteria:M};return t.get("reports/retention-value",O)},getRevenueWaterfall({currency:e,issuedFrom:s,issuedTo:n,recognizedTo:r}){const u={currency:e,issuedFrom:s,issuedTo:n,recognizedTo:r};return t.get("reports/revenue-waterfall",u)},getRevenueAudit({filter:e=null,sort:s=null,limit:n=null,offset:r=null}){const u={filter:e,sort:s,limit:n,offset:r};return t.get("reports/revenue-audit",u)},getSubscriptionCancellation({periodStart:e,periodEnd:s,aggregationField:n,limit:r=null,offset:u=null,filter:o=null}){const l={periodStart:e,periodEnd:s,aggregationField:n,limit:r,offset:u,filter:o};return t.get("reports/subscription-cancellation",l)},getSubscriptionRenewal({periodStart:e,periodEnd:s,limit:n=null,offset:r=null}){const u={periodStart:e,periodEnd:s,limit:n,offset:r};return t.get("reports/subscription-renewal",u)},getTax({periodStart:e,periodEnd:s,accountingMethod:n,limit:r=null,offset:u=null}){const o={periodStart:e,periodEnd:s,accountingMethod:n,limit:r,offset:u};return t.get("reports/tax",o)},getTimeSeriesTransaction({type:e,subaggregate:s,periodStart:n,periodEnd:r,limit:u=null,offset:o=null}){const l={type:e,subaggregate:s,periodStart:n,periodEnd:r,limit:u,offset:o};return t.get("reports/time-series-transaction",l)},getTransactionsTimeDispute({aggregationField:e,periodStart:s,periodEnd:n,limit:r=null,offset:u=null,filter:o=null}){const l={aggregationField:e,periodStart:s,periodEnd:n,limit:r,offset:u,filter:o};return t.get("reports/transactions-time-dispute",l)},getTransactions({periodStart:e,periodEnd:s,aggregationField:n,limit:r=null,offset:u=null,filter:o=null}){const l={periodStart:e,periodEnd:s,aggregationField:n,limit:r,offset:u,filter:o};return t.get("reports/transactions",l)}}}function hs({apiHandler:t}){return{getSubscriptionSummaryMetrics({subscriptionId:e}){return t.get(`subscriptions/${e}/summary-metrics`)}}}function ps({apiHandler:t}){return{getActivityFeed({eventTypes:e=null,limit:s=1e3,offset:n=0}){const r={eventTypes:e,limit:s,offset:n};return t.getAll("activity-feed",r)},getTransaction({id:e="",eventTypes:s=null,limit:n=1e3,offset:r=0}){const u={eventTypes:s,limit:n,offset:r};return t.getAll(`transactions/${e}/timeline`,u)},getCustomer({id:e="",eventTypes:s=null,limit:n=1e3,offset:r=0}){const u={eventTypes:s,limit:n,offset:r};return t.getAll(`customers/${e}/timeline`,u)}}}function ys({apiHandler:t}){return{query(){return t.get("location")}}}const w={CustomersResource:as,DataExportsResource:ms,HistogramsResource:fs,ReportsResource:$s,SubscriptionsResource:hs,TimelinesResource:ps,LocationResource:ys};class As{constructor({apiHandler:e}){this.customers=w.CustomersResource({apiHandler:e}),this.dataExports=w.DataExportsResource({apiHandler:e}),this.histograms=w.HistogramsResource({apiHandler:e}),this.reports=w.ReportsResource({apiHandler:e}),this.subscriptions=w.SubscriptionsResource({apiHandler:e}),this.timelines=w.TimelinesResource({apiHandler:e}),this.location=w.LocationResource({apiHandler:e}),this.addRequestInterceptor=e.addRequestInterceptor,this.removeRequestInterceptor=e.removeRequestInterceptor,this.addResponseInterceptor=e.addResponseInterceptor,this.removeResponseInterceptor=e.removeResponseInterceptor,this.setTimeout=e.setTimeout,this.setProxyAgent=e.setProxyAgent,this.setSessionToken=e.setSessionToken,this.setEndpoints=e.setEndpoints,this.getCancellationToken=e.getCancellationToken}}function Rs({apiHandler:t}){return{get({expand:e=null}={}){const s={expand:e};return t.get("account",s)},update({data:e}){return t.patch("account",e)},requestPasswordReset({data:e}){return t.post("account/forgot-password",e)},changePassword({data:e}){return t.patch("account/password",e)},resendEmailVerification({data:e}){return t.post("account/resend-verification",e)},confirmPasswordReset({token:e,data:s}){return t.post(`account/reset-password/${e}`,s)},verifyEmail({token:e}){return t.post(`account/verification/${e}`)},register({data:e}){return t.post("register",e)}}}function bs({apiHandler:t}){return{login({data:e}){return t.post("login",e)},logout(){return t.post("logout")}}}function ws({apiHandler:t}){return{get({slug:e}){return t.get(`billing-portals/${e}`)}}}function ks({apiHandler:t}){return{get({id:e}){return t.get(`checkout-forms/${e}`)}}}function ds({apiHandler:t}){return{getAll({resource:e,limit:s=null,offset:n=null}){const r={limit:s,offset:n};return t.getAll(`custom-fields/${e}`,r)}}}function vs({apiHandler:t}){return{get({id:e,expand:s=null}){const n={expand:s};return t.get(`deposit-requests/${e}`,n)}}}function Ts({apiHandler:t}){return{create({data:e}){return t.post("deposit",e)}}}function Ss({apiHandler:t}){return{get({id:e}){return t.get(`deposit-strategies/${e}`)}}}function Es({apiHandler:t}){return{getAll({filter:e=null,sort:s=null,limit:n=null,offset:r=null,q:u=null,expand:o=null}={}){const l={filter:e,sort:s,limit:n,offset:r,q:u,expand:o};return t.getAll("invoices",l)},get({id:e}){return t.get(`invoices/${e}`)},downloadPDF({id:e}){const s={headers:q,responseType:"arraybuffer"};return t.download(`invoices/${e}`,s)}}}function Is({apiHandler:t}){return{getAll({limit:e=null,offset:s=null}={}){const n={limit:e,offset:s};return t.getAll("kyc-documents",n)},create({data:e}){return t.post("kyc-documents",e)},get({id:e}){return t.get(`kyc-documents/${e}`)},update({id:e,data:s}){return t.patch(`kyc-documents/${e}`,s)}}}function qs({apiHandler:t}){return{create({data:e}){return t.post("kyc-liveness-sessions",e)},get({id:e}){return t.get(`kyc-liveness-sessions/${e}`)},finish({id:e}){return t.post(`kyc-liveness-sessions/${e}/finish`)}}}function xs({apiHandler:t}){return{get({id:e,expand:s=null}){const n={expand:s};return t.get(`kyc-requests/${e}`,n)}}}function Ps({apiHandler:t}){return{getUpcomingInvoice({id:e}){return t.get(`orders/${e}/upcoming-invoice`)},getAll({filter:e=null,sort:s=null,limit:n=null,offset:r=null,q:u=null}={}){const o={filter:e,sort:s,limit:n,offset:r,q:u};return t.getAll("orders",o)},get({id:e}){return t.get(`orders/${e}`)},update({id:e,data:s}){return t.patch(`orders/${e}`,s)},cancel({id:e,data:s}){return t.post(`orders/${e}/cancellation`,s)},pause({id:e,data:s}){return t.post(`orders/${e}/pause`,s)}}}function Cs({apiHandler:t}){return{getAll({filter:e=null,sort:s=null,limit:n=null,offset:r=null,q:u=null}={}){const o={filter:e,sort:s,limit:n,offset:r,q:u};return t.getAll("payment-instruments",o)},create({data:e}){return t.post("payment-instruments",e)},get({id:e,limit:s=null,offset:n=null}){const r={limit:s,offset:n};return t.get(`payment-instruments/${e}`,r)},update({id:e,data:s}){return t.patch(`payment-instruments/${e}`,s)},deactivate({id:e}){return t.post(`payment-instruments/${e}/deactivation`)},getSetupTransaction({id:e}){return t.get(`payment-instruments/${e}/setup`)},setup({id:e,data:s}){return t.post(`payment-instruments/${e}/setup`,s)}}}function js({apiHandler:t}){return{getAll({filter:e=null,sort:s=null,limit:n=null,offset:r=null,q:u=null}={}){const o={filter:e,sort:s,limit:n,offset:r,q:u};return t.getAll("payout-requests",o)},get({id:e}){return t.get(`payout-requests/${e}`)},update({id:e,data:s}){return t.patch(`payout-requests/${e}`,s)}}}function Ds({apiHandler:t}){return{getAll({filter:e=null,sort:s=null,limit:n=null,offset:r=null,q:u=null,expand:o=null}={}){const l={filter:e,sort:s,limit:n,offset:r,q:u,expand:o};return t.getAll("plans",l)},get({id:e,expand:s=null}){const n={expand:s};return t.get(`plans/${e}`,n)}}}function Ms({apiHandler:t}){return{getAll({filter:e=null,sort:s=null,limit:n=null,offset:r=null,q:u=null}={}){const o={filter:e,sort:s,limit:n,offset:r,q:u};return t.getAll("products",o)},get({id:e}){return t.get(`products/${e}`)}}}function Os({apiHandler:t}){return{payment({data:e}){return t.post("payment",e)},purchase({data:e}){return t.post("purchase",e)},preview({data:e}){return t.post("preview-purchase",e)},readyToPay({data:e}){return t.post("ready-to-pay",e)}}}function Fs({apiHandler:t}){return{get({id:e,expand:s=null}){const n={expand:s};return t.get(`quotes/${e}`,n)},accept({id:e}){return t.post(`quotes/${e}/accept`)},reject({id:e}){return t.post(`quotes/${e}/reject`)},downloadPDF({id:e}){const s={headers:q,responseType:"arraybuffer"};return t.download(`quotes/${e}`,s)}}}function Bs({apiHandler:t}){return{readyToPayout({data:e}){return t.post("ready-to-payout",e)}}}function Ks({apiHandler:t}){return{get({id:e}){return t.get(`rich-billing-portals/${e}`)}}}function Ls({apiHandler:t}){return{create({data:e}){return t.post("subscriptions",e)}}}function Ns({apiHandler:t}){return{getAll({limit:e=null,offset:s=null,filter:n=null,q:r=null,sort:u=null}={}){const o={limit:e,offset:s,filter:n,q:r,sort:u};return t.getAll("transactions",o)},get({id:e}){return t.get(`transactions/${e}`)},finishKyc({id:e,token:s}){return t.post(`transactions/${e}/${s}/continue`)},skipKyc({id:e,token:s}){return t.post(`transactions/${e}/${s}/bypass`)},update({id:e,data:s}){return t.patch(`transactions/${e}`,s)}}}function zs({apiHandler:t}){return{get({id:e}){return t.get(`websites/${e}`)}}}class Us{constructor({apiHandler:e}){this.account=Rs({apiHandler:e}),this.authorization=bs({apiHandler:e}),this.billingPortals=ws({apiHandler:e}),this.checkoutForms=ks({apiHandler:e}),this.customFields=ds({apiHandler:e}),this.depositRequests=vs({apiHandler:e}),this.deposit=Ts({apiHandler:e}),this.depositStrategies=Ss({apiHandler:e}),this.invoices=Es({apiHandler:e}),this.kycDocuments=Is({apiHandler:e}),this.kycLivenessSessions=qs({apiHandler:e}),this.kycRequests=xs({apiHandler:e}),this.orders=Ps({apiHandler:e}),this.paymentInstruments=Cs({apiHandler:e}),this.payoutRequests=js({apiHandler:e}),this.plans=Ds({apiHandler:e}),this.products=Ms({apiHandler:e}),this.purchase=Os({apiHandler:e}),this.quotes=Fs({apiHandler:e}),this.readyToPayout=Bs({apiHandler:e}),this.richBillingPortals=Ks({apiHandler:e}),this.subscriptions=Ls({apiHandler:e}),this.transactions=Ns({apiHandler:e}),this.websites=zs({apiHandler:e}),this.checkoutForm=this.checkoutForms,this.billingPortal=this.billingPortals,this.addRequestInterceptor=e.addRequestInterceptor,this.removeRequestInterceptor=e.removeRequestInterceptor,this.addResponseInterceptor=e.addResponseInterceptor,this.removeResponseInterceptor=e.removeResponseInterceptor,this.setTimeout=e.setTimeout,this.setProxyAgent=e.setProxyAgent,this.setSessionToken=e.setSessionToken,this.setPublishableKey=e.setPublishableKey,this.setEndpoints=e.setEndpoints,this.getCancellationToken=e.getCancellationToken,this.generateSignature=e.generateSignature}}function Vs({apiHandler:t}){return new gs({apiHandler:t})}function Ws({apiHandler:t}){return new As({apiHandler:t})}function Js({apiHandler:t}){return new Us({apiHandler:t})}const j={live:"https://api.rebilly.com",sandbox:"https://api-sandbox.rebilly.com"},D=6e3;function W({apiKey:t=null,sandbox:e=!1,timeout:s=D,organizationId:n=null,urls:r=j}={}){if(!r.live||!r.sandbox)throw new Error("RebillyAPI urls config must include a key for both `live` and `sandbox`");if(typeof r.live!="string"||typeof r.sandbox!="string")throw new Error("RebillyAPI urls config `live` and `sandbox` must be strings");const o=C({options:{apiEndpoints:r,apiKey:t,apiVersion:"",isSandbox:e,requestTimeout:s,jwt:null,organizationId:n}});return Vs({apiHandler:o})}function Gs({apiKey:t=null,sandbox:e=!1,timeout:s=D,organizationId:n=null,urls:r=j}={}){if(!r.live||!r.sandbox)throw new Error("RebillyAPI urls config must include a key for both `live` and `sandbox`");if(typeof r.live!="string"||typeof r.sandbox!="string")throw new Error("RebillyAPI urls config `live` and `sandbox` must be strings");const o=C({options:{apiEndpoints:r,apiKey:t,apiVersion:"experimental",isSandbox:e,requestTimeout:s,jwt:null,organizationId:n}});return Ws({apiHandler:o})}function Ys({publishableKey:t=null,jwt:e=null,sandbox:s=!1,timeout:n=D,organizationId:r=null,urls:u=j}={}){if(!u.live||!u.sandbox)throw new Error("RebillyAPI urls config must include a key for both `live` and `sandbox`");if(typeof u.live!="string"||typeof u.sandbox!="string")throw new Error("RebillyAPI urls config `live` and `sandbox` must be strings");const o={apiEndpoints:u,publishableKey:t,jwt:e,apiVersion:"storefront",isSandbox:s,requestTimeout:n,organizationId:r},l=C({options:o});return l.setSessionToken(o.jwt),Js({apiHandler:l})}f.RebillyAPI=W,f.RebillyErrors=p,f.RebillyExperimentalAPI=Gs,f.RebillyStorefrontAPI=Ys,f.cancellation=Le,f.default=W,Object.defineProperties(f,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}})});
|
package/package.json
CHANGED
|
@@ -25,9 +25,6 @@ export default function OrdersResource({apiHandler}) {
|
|
|
25
25
|
const params = {filter, sort, limit, offset, q};
|
|
26
26
|
return apiHandler.getAll(`orders`, params);
|
|
27
27
|
},
|
|
28
|
-
create({data}) {
|
|
29
|
-
return apiHandler.post(`orders`, data);
|
|
30
|
-
},
|
|
31
28
|
/**
|
|
32
29
|
* @returns { rebilly.StorefrontGetOrderResponsePromise } response
|
|
33
30
|
*/
|
|
@@ -24,6 +24,7 @@ import PurchaseResource from './purchase-resource';
|
|
|
24
24
|
import QuotesResource from './quotes-resource';
|
|
25
25
|
import ReadyToPayoutResource from './ready-to-payout-resource';
|
|
26
26
|
import RichBillingPortalsResource from './rich-billing-portals-resource';
|
|
27
|
+
import SubscriptionsResource from './subscriptions-resource';
|
|
27
28
|
import TransactionsResource from './transactions-resource';
|
|
28
29
|
import WebsitesResource from './websites-resource';
|
|
29
30
|
|
|
@@ -50,6 +51,7 @@ export class StorefrontApiInstance {
|
|
|
50
51
|
this.quotes = QuotesResource({apiHandler});
|
|
51
52
|
this.readyToPayout = ReadyToPayoutResource({apiHandler});
|
|
52
53
|
this.richBillingPortals = RichBillingPortalsResource({apiHandler});
|
|
54
|
+
this.subscriptions = SubscriptionsResource({apiHandler});
|
|
53
55
|
this.transactions = TransactionsResource({apiHandler});
|
|
54
56
|
this.websites = WebsitesResource({apiHandler});
|
|
55
57
|
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* This file was auto-generated by rebilly-sdk-generator.
|
|
3
|
+
* Do not make direct changes to this file.
|
|
4
|
+
*/
|
|
5
|
+
|
|
6
|
+
export default function SubscriptionsResource({apiHandler}) {
|
|
7
|
+
return {
|
|
8
|
+
create({data}) {
|
|
9
|
+
return apiHandler.post(`subscriptions`, data);
|
|
10
|
+
},
|
|
11
|
+
};
|
|
12
|
+
}
|