rebilly-js-sdk 48.4.0 → 48.5.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/dist/rebilly-js-sdk.d.ts
CHANGED
|
@@ -3988,12 +3988,12 @@ export interface coreComponents {
|
|
|
3988
3988
|
comments?: string | null;
|
|
3989
3989
|
_links?: coreComponents["schemas"]["SelfLink"];
|
|
3990
3990
|
};
|
|
3991
|
-
/** Unique resource ID. Defaults to UUID v4. */
|
|
3992
|
-
ResourceId: string;
|
|
3993
3991
|
/** Date and time which is set automatically when the resource is created. */
|
|
3994
3992
|
CreatedTime: string;
|
|
3995
3993
|
/** Date and time which updates automatically when the resource is updated. */
|
|
3996
3994
|
UpdatedTime: string;
|
|
3995
|
+
/** Unique resource ID. Defaults to UUID v4. */
|
|
3996
|
+
ResourceId: string;
|
|
3997
3997
|
/**
|
|
3998
3998
|
* Use tags to organize and categorize customers or KYC documents based on keywords.
|
|
3999
3999
|
* For more information, see [Tags](https://www.rebilly.com/docs/dev-docs/api/tag/Tags/).
|
|
@@ -4018,7 +4018,8 @@ export interface coreComponents {
|
|
|
4018
4018
|
};
|
|
4019
4019
|
/** AML check result. */
|
|
4020
4020
|
AmlCheck: {
|
|
4021
|
-
|
|
4021
|
+
/** Unique resource ID. */
|
|
4022
|
+
id?: string;
|
|
4022
4023
|
createdTime?: coreComponents["schemas"]["CreatedTime"];
|
|
4023
4024
|
updatedTime?: coreComponents["schemas"]["UpdatedTime"];
|
|
4024
4025
|
/** Website ID associated with the customer. */
|
|
@@ -4276,7 +4277,7 @@ export interface coreComponents {
|
|
|
4276
4277
|
};
|
|
4277
4278
|
Blocklist: {
|
|
4278
4279
|
/** ID of the blocklist. */
|
|
4279
|
-
id?:
|
|
4280
|
+
id?: string;
|
|
4280
4281
|
/** Type of blocklist. */
|
|
4281
4282
|
type:
|
|
4282
4283
|
| "payment-card"
|
|
@@ -5896,6 +5897,7 @@ export interface coreComponents {
|
|
|
5896
5897
|
| "PayPal"
|
|
5897
5898
|
| "Payper"
|
|
5898
5899
|
| "Payr"
|
|
5900
|
+
| "PayRetailers"
|
|
5899
5901
|
| "Paysafe"
|
|
5900
5902
|
| "Paysafecard"
|
|
5901
5903
|
| "Paysafecash"
|
|
@@ -6207,6 +6209,7 @@ export interface coreComponents {
|
|
|
6207
6209
|
| "PayPal"
|
|
6208
6210
|
| "Payper"
|
|
6209
6211
|
| "Payr"
|
|
6212
|
+
| "PayRetailers"
|
|
6210
6213
|
| "PayTabs"
|
|
6211
6214
|
| "PayULatam"
|
|
6212
6215
|
| "Payvision"
|
|
@@ -6392,7 +6395,7 @@ export interface coreComponents {
|
|
|
6392
6395
|
} | null;
|
|
6393
6396
|
Transaction: coreComponents["schemas"]["CommonTransaction"] & {
|
|
6394
6397
|
/** ID of the gateway account that processed the transaction. */
|
|
6395
|
-
gatewayAccountId?:
|
|
6398
|
+
gatewayAccountId?: string;
|
|
6396
6399
|
/** ID of the gateway transaction. */
|
|
6397
6400
|
gatewayTransactionId?: coreComponents["schemas"]["ResourceId"];
|
|
6398
6401
|
/** Related gateway information. */
|
|
@@ -6983,7 +6986,7 @@ export interface coreComponents {
|
|
|
6983
6986
|
};
|
|
6984
6987
|
JournalAccount: {
|
|
6985
6988
|
/** ID of the journal account. */
|
|
6986
|
-
id?:
|
|
6989
|
+
id?: string;
|
|
6987
6990
|
/** Name of the journal account. */
|
|
6988
6991
|
name: string;
|
|
6989
6992
|
description?: string | null;
|
|
@@ -6993,7 +6996,7 @@ export interface coreComponents {
|
|
|
6993
6996
|
};
|
|
6994
6997
|
JournalEntry: {
|
|
6995
6998
|
/** ID of the journal entry. */
|
|
6996
|
-
id?:
|
|
6999
|
+
id?: string;
|
|
6997
7000
|
period: {
|
|
6998
7001
|
startDate?: string;
|
|
6999
7002
|
endDate?: string;
|
|
@@ -7005,7 +7008,8 @@ export interface coreComponents {
|
|
|
7005
7008
|
updatedTime?: coreComponents["schemas"]["UpdatedTime"];
|
|
7006
7009
|
};
|
|
7007
7010
|
JournalRecord: {
|
|
7008
|
-
|
|
7011
|
+
/** Unique resource ID. */
|
|
7012
|
+
id?: string;
|
|
7009
7013
|
/** ID of the journal entry. */
|
|
7010
7014
|
journalEntryId: string;
|
|
7011
7015
|
/** ID of the customer. */
|
|
@@ -19440,12 +19444,12 @@ export interface usersComponents {
|
|
|
19440
19444
|
/** Type of link. */
|
|
19441
19445
|
rel?: "self";
|
|
19442
19446
|
}[];
|
|
19443
|
-
/** Unique resource ID. Defaults to UUID v4. */
|
|
19444
|
-
ResourceId: string;
|
|
19445
19447
|
/** Date and time which is set automatically when the resource is created. */
|
|
19446
19448
|
CreatedTime: string;
|
|
19447
19449
|
/** Date and time which updates automatically when the resource is updated. */
|
|
19448
19450
|
UpdatedTime: string;
|
|
19451
|
+
/** Unique resource ID. Defaults to UUID v4. */
|
|
19452
|
+
ResourceId: string;
|
|
19449
19453
|
/** RFC-7807 [problem details](https://tools.ietf.org/html/rfc7807) JSON object. */
|
|
19450
19454
|
BaseProblem: {
|
|
19451
19455
|
/**
|
|
@@ -20388,6 +20392,7 @@ export interface usersComponents {
|
|
|
20388
20392
|
| "PayPal"
|
|
20389
20393
|
| "Payper"
|
|
20390
20394
|
| "Payr"
|
|
20395
|
+
| "PayRetailers"
|
|
20391
20396
|
| "Paysafe"
|
|
20392
20397
|
| "Paysafecard"
|
|
20393
20398
|
| "Paysafecash"
|
|
@@ -20699,6 +20704,7 @@ export interface usersComponents {
|
|
|
20699
20704
|
| "PayPal"
|
|
20700
20705
|
| "Payper"
|
|
20701
20706
|
| "Payr"
|
|
20707
|
+
| "PayRetailers"
|
|
20702
20708
|
| "PayTabs"
|
|
20703
20709
|
| "PayULatam"
|
|
20704
20710
|
| "Payvision"
|
|
@@ -20884,7 +20890,7 @@ export interface usersComponents {
|
|
|
20884
20890
|
} | null;
|
|
20885
20891
|
Transaction: usersComponents["schemas"]["CommonTransaction"] & {
|
|
20886
20892
|
/** ID of the gateway account that processed the transaction. */
|
|
20887
|
-
gatewayAccountId?:
|
|
20893
|
+
gatewayAccountId?: string;
|
|
20888
20894
|
/** ID of the gateway transaction. */
|
|
20889
20895
|
gatewayTransactionId?: usersComponents["schemas"]["ResourceId"];
|
|
20890
20896
|
/** Related gateway information. */
|
|
@@ -21633,7 +21639,7 @@ export interface usersComponents {
|
|
|
21633
21639
|
};
|
|
21634
21640
|
BroadcastMessage: {
|
|
21635
21641
|
/** ID of the broadcast message. */
|
|
21636
|
-
id?:
|
|
21642
|
+
id?: string;
|
|
21637
21643
|
/**
|
|
21638
21644
|
* Use this filter to select customers during broadcast message processing.
|
|
21639
21645
|
*
|
|
@@ -21751,7 +21757,7 @@ export interface usersComponents {
|
|
|
21751
21757
|
CheckoutFormPlans: usersComponents["schemas"]["CheckoutFormPlan"][];
|
|
21752
21758
|
CommonCheckoutForm: {
|
|
21753
21759
|
/** ID of the checkout form. */
|
|
21754
|
-
id?:
|
|
21760
|
+
id?: string;
|
|
21755
21761
|
websiteId: usersComponents["schemas"]["WebsiteId"];
|
|
21756
21762
|
/** Custom domain for the checkout form. */
|
|
21757
21763
|
customDomain?: string | null;
|
|
@@ -22547,7 +22553,8 @@ export interface usersComponents {
|
|
|
22547
22553
|
};
|
|
22548
22554
|
"gateway-account-weights": usersComponents["schemas"]["GatewayAccountPickInstruction"] & {
|
|
22549
22555
|
weightedList: {
|
|
22550
|
-
|
|
22556
|
+
/** Unique resource ID. */
|
|
22557
|
+
gatewayAccountId: string;
|
|
22551
22558
|
weight: number;
|
|
22552
22559
|
}[];
|
|
22553
22560
|
};
|
|
@@ -22937,7 +22944,7 @@ export interface usersComponents {
|
|
|
22937
22944
|
/** Gateway account details. */
|
|
22938
22945
|
GatewayAccount: {
|
|
22939
22946
|
/** ID of the payment gateway account. */
|
|
22940
|
-
id?:
|
|
22947
|
+
id?: string;
|
|
22941
22948
|
gatewayName: usersComponents["schemas"]["GatewayName"];
|
|
22942
22949
|
acquirerName: usersComponents["schemas"]["AcquirerName"];
|
|
22943
22950
|
method: usersComponents["schemas"]["PaymentMethod"];
|
|
@@ -24945,6 +24952,16 @@ export interface usersComponents {
|
|
|
24945
24952
|
apiSecurityToken?: string;
|
|
24946
24953
|
};
|
|
24947
24954
|
};
|
|
24955
|
+
/** PayRetailers gateway configuration. */
|
|
24956
|
+
PayRetailers: usersComponents["schemas"]["GatewayAccount"] & {
|
|
24957
|
+
/** PayRetailers credentials object. */
|
|
24958
|
+
credentials: {
|
|
24959
|
+
/** ID of the PayRetailers shop. */
|
|
24960
|
+
shopId: string;
|
|
24961
|
+
/** Secret key value of the PayRetailers API. */
|
|
24962
|
+
secretKey: string;
|
|
24963
|
+
};
|
|
24964
|
+
};
|
|
24948
24965
|
/** Paysafe 3DS servers. */
|
|
24949
24966
|
Paysafe3dsServers: {
|
|
24950
24967
|
name: "Paysafe3dsServer";
|
|
@@ -26031,7 +26048,7 @@ export interface usersComponents {
|
|
|
26031
26048
|
usersComponents["schemas"]["ValidationErrorExtensions"];
|
|
26032
26049
|
GatewayAccountDowntimeSchedule: {
|
|
26033
26050
|
/** ID of the gateway account downtime schedule. */
|
|
26034
|
-
id?:
|
|
26051
|
+
id?: string;
|
|
26035
26052
|
/** Status of the gateway account downtime schedule. */
|
|
26036
26053
|
status?: "pending" | "ongoing" | "finished";
|
|
26037
26054
|
/** Reason for the gateway account downtime schedule. */
|
|
@@ -26239,7 +26256,7 @@ export interface usersComponents {
|
|
|
26239
26256
|
};
|
|
26240
26257
|
ValueList: {
|
|
26241
26258
|
/** ID of the list. */
|
|
26242
|
-
id?:
|
|
26259
|
+
id?: string;
|
|
26243
26260
|
/** Version of the list. */
|
|
26244
26261
|
version?: number;
|
|
26245
26262
|
/** Description of the list. */
|
|
@@ -26961,6 +26978,10 @@ export interface usersComponents {
|
|
|
26961
26978
|
createdTime?: usersComponents["schemas"]["CreatedTime"];
|
|
26962
26979
|
updatedTime?: usersComponents["schemas"]["UpdatedTime"];
|
|
26963
26980
|
_links?: usersComponents["schemas"]["SelfLink"];
|
|
26981
|
+
/** Embedded objects that are requested by the `expand` query parameter. */
|
|
26982
|
+
_embedded?: {
|
|
26983
|
+
organization?: { [key: string]: any };
|
|
26984
|
+
};
|
|
26964
26985
|
};
|
|
26965
26986
|
/**
|
|
26966
26987
|
* Webhook tracking lists up to the 1,000 most-recently delivered webhooks.
|
|
@@ -32043,10 +32064,14 @@ export interface operations {
|
|
|
32043
32064
|
filter?: usersComponents["parameters"]["collectionFilter"];
|
|
32044
32065
|
/** Use this field to perform a partial search of text fields. */
|
|
32045
32066
|
q?: usersComponents["parameters"]["collectionQuery"];
|
|
32046
|
-
|
|
32047
|
-
|
|
32048
|
-
|
|
32049
|
-
|
|
32067
|
+
/**
|
|
32068
|
+
* Expands a request to include embedded objects within the `_embedded`
|
|
32069
|
+
* property of the response. This field accepts a comma-separated list of objects.
|
|
32070
|
+
*
|
|
32071
|
+
* For more information, see
|
|
32072
|
+
* [Expand to include embedded objects](https://all-rebilly.redoc.ly/#section/Expand-to-include-embedded-objects).
|
|
32073
|
+
*/
|
|
32074
|
+
expand?: usersComponents["parameters"]["collectionExpand"];
|
|
32050
32075
|
};
|
|
32051
32076
|
};
|
|
32052
32077
|
responses: {
|
|
@@ -33016,12 +33041,12 @@ export interface storefrontComponents {
|
|
|
33016
33041
|
/** Type of link. */
|
|
33017
33042
|
rel?: "self";
|
|
33018
33043
|
}[];
|
|
33019
|
-
/** Unique resource ID. Defaults to UUID v4. */
|
|
33020
|
-
ResourceId: string;
|
|
33021
33044
|
/** Date and time which is set automatically when the resource is created. */
|
|
33022
33045
|
CreatedTime: string;
|
|
33023
33046
|
/** Date and time which updates automatically when the resource is updated. */
|
|
33024
33047
|
UpdatedTime: string;
|
|
33048
|
+
/** Unique resource ID. Defaults to UUID v4. */
|
|
33049
|
+
ResourceId: string;
|
|
33025
33050
|
/** RFC-7807 [problem details](https://tools.ietf.org/html/rfc7807) JSON object. */
|
|
33026
33051
|
BaseProblem: {
|
|
33027
33052
|
/**
|
|
@@ -33740,6 +33765,7 @@ export interface storefrontComponents {
|
|
|
33740
33765
|
| "PayPal"
|
|
33741
33766
|
| "Payper"
|
|
33742
33767
|
| "Payr"
|
|
33768
|
+
| "PayRetailers"
|
|
33743
33769
|
| "Paysafe"
|
|
33744
33770
|
| "Paysafecard"
|
|
33745
33771
|
| "Paysafecash"
|
|
@@ -35333,7 +35359,7 @@ export interface storefrontComponents {
|
|
|
35333
35359
|
CheckoutFormPlans: storefrontComponents["schemas"]["CheckoutFormPlan"][];
|
|
35334
35360
|
CommonCheckoutForm: {
|
|
35335
35361
|
/** ID of the checkout form. */
|
|
35336
|
-
id?:
|
|
35362
|
+
id?: string;
|
|
35337
35363
|
websiteId: storefrontComponents["schemas"]["WebsiteId"];
|
|
35338
35364
|
/** Custom domain for the checkout form. */
|
|
35339
35365
|
customDomain?: string | null;
|
|
@@ -37986,12 +38012,12 @@ export interface reportsPaths {
|
|
|
37986
38012
|
|
|
37987
38013
|
export interface reportsComponents {
|
|
37988
38014
|
schemas: {
|
|
37989
|
-
/** Unique resource ID. Defaults to UUID v4. */
|
|
37990
|
-
ResourceId: string;
|
|
37991
38015
|
/** Date and time which is set automatically when the resource is created. */
|
|
37992
38016
|
CreatedTime: string;
|
|
37993
38017
|
/** Date and time which updates automatically when the resource is updated. */
|
|
37994
38018
|
UpdatedTime: string;
|
|
38019
|
+
/** Unique resource ID. Defaults to UUID v4. */
|
|
38020
|
+
ResourceId: string;
|
|
37995
38021
|
/** RFC-7807 [problem details](https://tools.ietf.org/html/rfc7807) JSON object. */
|
|
37996
38022
|
BaseProblem: {
|
|
37997
38023
|
/**
|
|
@@ -42026,7 +42052,7 @@ declare module "resources/tracking-resource" {
|
|
|
42026
42052
|
export default function TrackingResource({ apiHandler }: {
|
|
42027
42053
|
apiHandler: any;
|
|
42028
42054
|
}): {
|
|
42029
|
-
getAllApiLogs({ limit, offset, sort, filter, q, }?: rebilly.GetTrackingApiCollectionRequest): rebilly.GetTrackingApiCollectionResponsePromise;
|
|
42055
|
+
getAllApiLogs({ limit, offset, sort, filter, q, expand, }?: rebilly.GetTrackingApiCollectionRequest): rebilly.GetTrackingApiCollectionResponsePromise;
|
|
42030
42056
|
getApiLog({ id }: {
|
|
42031
42057
|
id: any;
|
|
42032
42058
|
}): rebilly.GetTrackingApiResponsePromise;
|
|
@@ -43909,12 +43935,13 @@ declare module "resources/api-instance" {
|
|
|
43909
43935
|
}): any;
|
|
43910
43936
|
};
|
|
43911
43937
|
tracking: {
|
|
43912
|
-
getAllApiLogs({ limit, offset, sort, filter, q, }?: {
|
|
43938
|
+
getAllApiLogs({ limit, offset, sort, filter, q, expand, }?: {
|
|
43913
43939
|
limit?: number;
|
|
43914
43940
|
offset?: number;
|
|
43915
43941
|
sort?: string[];
|
|
43916
43942
|
filter?: string;
|
|
43917
43943
|
q?: string;
|
|
43944
|
+
expand?: string;
|
|
43918
43945
|
}): rebilly.GetTrackingApiCollectionResponsePromise;
|
|
43919
43946
|
getApiLog({ id }: {
|
|
43920
43947
|
id: any;
|
|
@@ -538,7 +538,7 @@ function cloneArrayDeep(arr, instanceClone) {
|
|
|
538
538
|
return res;
|
|
539
539
|
}
|
|
540
540
|
var cloneDeep_1 = cloneDeep;
|
|
541
|
-
const version = "48.
|
|
541
|
+
const version = "48.5.0";
|
|
542
542
|
let urlAlphabet = "useandom-26T198340PX75pxJACKVERYMINDBUSHWOLF_GQZbfghjklqvwyzrict";
|
|
543
543
|
let nanoid = (size = 21) => {
|
|
544
544
|
let id = "";
|
|
@@ -2958,9 +2958,10 @@ function TrackingResource({ apiHandler }) {
|
|
|
2958
2958
|
offset = null,
|
|
2959
2959
|
sort = null,
|
|
2960
2960
|
filter = null,
|
|
2961
|
-
q = null
|
|
2961
|
+
q = null,
|
|
2962
|
+
expand = null
|
|
2962
2963
|
} = {}) {
|
|
2963
|
-
const params = { limit, offset, sort, filter, q };
|
|
2964
|
+
const params = { limit, offset, sort, filter, q, expand };
|
|
2964
2965
|
return apiHandler.getAll(`tracking/api`, params);
|
|
2965
2966
|
},
|
|
2966
2967
|
getApiLog({ id }) {
|
|
@@ -33,4 +33,4 @@ var nn=Object.defineProperty;var ne=Object.getOwnPropertySymbols;var sn=Object.p
|
|
|
33
33
|
*
|
|
34
34
|
* Copyright (c) 2014-2017, Jon Schlinkert.
|
|
35
35
|
* Released under the MIT License.
|
|
36
|
-
*/var qe=Pe,Me=Object.prototype.hasOwnProperty,Oe=function(e,t,n){qe(e,function(s,u){if(Me.call(e,u))return t.call(n,e[u],u,e)})},De=pe,Fe=Ie,Ke=xe,Be=Oe;function q(r,e){switch(Ke(r)){case"object":return Ne(r,e);case"array":return Ve(r,e);default:return Fe(r)}}function Ne(r,e){if(De(r)){var t={};return Be(r,function(n,s){this[s]=q(n,e)},t),t}else return e?e(r):r}function Ve(r,e){for(var t=r.length,n=[],s=-1;++s<t;)n[s]=q(r[s],e);return n}var ze=q;const Le="48.4.0";let Ue="useandom-26T198340PX75pxJACKVERYMINDBUSHWOLF_GQZbfghjklqvwyzrict",We=(r=21)=>{let e="",t=r;for(;t--;)e+=Ue[Math.random()*64|0];return e};class Je{constructor({id:e=null,created:t=null}={}){this.id=e||We(),this.created=t||new Date().getTime(),this.cancelSource=P.default.CancelToken.source(),this.cancel=this.cancelSource.cancel,this.cancelToken=this.cancelSource.token,x(this,{exclude:["cancelSource","cancelToken","cancel"]})}}class S{constructor(){if(S.instance)return S.instance;this.requests={},S.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 Je;return this.requests[e.id]=e,{id:e.id,cancelToken:e.cancelToken}}}var E=new S;class j{}N(j,"cancelById",(e,t)=>{try{E.getById(e).cancel(t),E.deleteById(e)}catch{}}),N(j,"cancelAll",e=>E.getAll().forEach(t=>{t.cancel(e),E.deleteById(t.id)}));var Ge={cancelAll:(...r)=>j.cancelAll(...r)};const d={request:"request",response:"response"},J=r=>{if(!Object.values(d).includes(r))throw new Error(`There is no such interceptor type as "${r}"`);return!0};function M({options:r}){const e=t();function t(){return P.default.create(s())}function n(){return e}function s(){return{baseURL:u(),timeout:r.requestTimeout,headers:l()}}function u(){let c=r.isSandbox?r.apiEndpoints.sandbox:r.apiEndpoints.live;return r.apiVersion&&(c=`${c}/${r.apiVersion}`),r.organizationId&&(c=`${c}/organizations/${r.organizationId}`),`${c}`}function l(){const c={"REB-API-CONSUMER":`RebillySDK/JS-SDK ${Le}`};return r.apiKey&&(c["REB-APIKEY"]=r.apiKey),c}function o(){return ze(e.defaults.headers)}function g(c){r.requestTimeout=Number(c),e.defaults.timeout=r.requestTimeout}function p(c=r.jwt){const i=o();r.apiKey=null,r.jwt=c,delete i.common["REB-APIKEY"],i.common.Authorization=`Bearer ${c}`,e.defaults.headers=i}function k(c=r.publishableKey){const i=o();r.publishableKey=c,i.common.Authorization=`${c}`,e.defaults.headers=i}function F({host:c,port:i,auth:a}){e.defaults.proxy={host:c,port:i,auth:a}}function K({live:c=null,sandbox:i=null}){c&&(r.apiEndpoints.live=c),i&&(r.apiEndpoints.sandbox=i),e.defaults.baseURL=u()}function _(c,{thenDelegate:i,catchDelegate:a=()=>{}}){return J(c)&&e.interceptors[d[c]].use(i,a)}function Q(c,i){return J(c)&&e.interceptors[d[c]].eject(i)}function Ur({thenDelegate:c,catchDelegate:i=()=>{}}){return _(d.request,{thenDelegate:c,catchDelegate:i})}function Wr(c){Q(d.request,c)}function Jr({thenDelegate:c,catchDelegate:i=()=>{}}){return _(d.response,{thenDelegate:c,catchDelegate:i})}function Gr(c){Q(d.response,c)}function T({request:c,isCollection:i,config:a}){const f=Z(a),{id:b,cancelToken:rn}=E.save();f.cancelToken=rn;const re=async function(){try{const I=await c(f);return Yr({response:I,isCollection:i,config:f})}catch(I){return X({error:I,config:f})}finally{E.deleteById(b)}}();return re.cancel=I=>j.cancelById(b,I),re}function Yr({response:c,isCollection:i,config:a}){return i?new se(c,a):new V(c,a)}function X({error:c}){if(P.default.isCancel(c))throw new y.RebillyCanceledError(c);if(c.response)switch(Number(c.response.status)){case 401:throw new y.RebillyForbiddenError(c);case 404:throw new y.RebillyNotFoundError(c);case 405:throw new y.RebillyMethodNotAllowedError(c);case 409:throw new y.RebillyConflictError(c);case 422:throw new y.RebillyValidationError(c);default:throw new y.RebillyRequestError(c)}throw c.code==="ECONNABORTED"?new y.RebillyTimeoutError(c):new y.RebillyRequestError(c)}function _r(c){return c.params!==void 0&&(c.params=Object.keys(c.params).filter(i=>c.params[i]!==null&&c.params[i]!=="").reduce((i,a)=>(i[a]=c.params[a],i),{})),c}function Z(c={}){const i=_r(c);return C({},i)}function H(c,i={}){return T({request:a=>e.get(c,a),config:{params:i}})}function Qr(c,i){return T({request:a=>e.get(c,a),config:{params:i},isCollection:!0})}function ee(c,i,a={}){let f={};return a.authenticate===!1&&(f={headers:o()},delete f.headers.common["REB-APIKEY"],delete f.headers.common.Authorization),a.params&&(f.params=C({},a.params)),T({request:b=>e.post(c,i,b),config:f})}function te(c,i,a={}){return T({request:f=>e.put(c,i,f),config:{params:a}})}function Xr(c,i){return T({request:a=>e.patch(c,i,a),config:{}})}function Zr(c){return T({request:i=>e.delete(c,i),config:{}})}function Hr(c,i){return T({request:a=>e.delete(c,a),config:{data:C({},i)}})}async function en(c,i,a,f={}){if(i==="")return ee(c,a,{params:f});try{if((await H(c)).response.status===200)throw new y.RebillyConflictError({message:"Member already exists. Please use a different ID."})}catch(b){if(b.name==="RebillyNotFoundError")return te(c,a,f);throw b}}async function tn(c,i){const a=Z(i);try{const f=await e.get(c,a);return new ue(f,a)}catch(f){return X({error:f,config:a})}}return{getInstance:n,addRequestInterceptor:Ur,removeRequestInterceptor:Wr,addResponseInterceptor:Jr,removeResponseInterceptor:Gr,setTimeout:g,setProxyAgent:F,setSessionToken:p,setPublishableKey:k,setEndpoints:K,get:H,getAll:Qr,post:ee,put:te,patch:Xr,delete:Zr,deleteAll:Hr,create:en,download:tn}}function Ye({apiHandler:r}){return{activate({token:e}){return r.post(`activation/${e}`,{authenticate:!1})},forgotPassword({data:e}){return r.post("forgot-password",e,{authenticate:!1})},logout(){return r.post("logout")},signIn({data:e}){return r.post("signin",e,{authenticate:!1})},signUp({data:e}){return r.post("signup",e,{authenticate:!1})}}}function _e({apiHandler:r}){return{getAll({limit:e=null,offset:t=null,sort:n=null,filter:s=null,q:u=null}={}){const l={limit:e,offset:t,sort:n,filter:s,q:u};return r.getAll("aml-checks",l)},get({id:e}){return r.get(`aml-checks/${e}`)},review({id:e,data:t}){return r.post(`aml-checks/${e}/review`,t)}}}function Qe({apiHandler:r}){return{getAll({firstName:e,lastName:t,dob:n=null,country:s=null}){const u={firstName:e,lastName:t,dob:n,country:s};return r.get("aml",u)}}}function Xe({apiHandler:r}){return{getAll({limit:e=null,offset:t=null,sort:n=null}={}){const s={limit:e,offset:t,sort:n};return r.getAll("api-keys",s)},create({id:e="",data:t}){return r.create(`api-keys/${e}`,e,t)},get({id:e}){return r.get(`api-keys/${e}`)},update({id:e,data:t}){return r.put(`api-keys/${e}`,t)},delete({id:e}){return r.delete(`api-keys/${e}`)}}}function Ze({apiHandler:r}){return{get({applicationId:e}){return r.get(`application-instances/${e}`)},upsert({applicationId:e,data:t}){return r.put(`application-instances/${e}`,t)},delete({applicationId:e}){return r.delete(`application-instances/${e}`)}}}function He({apiHandler:r}){return{getAll({limit:e=null,offset:t=null,filter:n=null,q:s=null,expand:u=null,fields:l=null,sort:o=null}={}){const g={limit:e,offset:t,filter:n,q:s,expand:u,fields:l,sort:o};return r.getAll("applications",g)},create({data:e}){return r.post("applications",e)},get({id:e}){return r.get(`applications/${e}`)},getInstances({id:e,limit:t=null,offset:n=null}){const s={limit:t,offset:n};return r.getAll(`applications/${e}/instances`,s)},getInstance({id:e,organizationId:t}){return r.get(`applications/${e}/instances/${t}`)}}}function et({apiHandler:r}){return{getAll({limit:e=null,offset:t=null}={}){const n={limit:e,offset:t};return r.getAll("balance-transactions",n)},get({id:e}){return r.get(`balance-transactions/${e}`)}}}function tt({apiHandler:r}){return{getAll({limit:e=null,offset:t=null,sort:n=null,filter:s=null,q:u=null}={}){const l={limit:e,offset:t,sort:n,filter:s,q:u};return r.getAll("billing-portals",l)},create({id:e="",data:t}){return r.create(`billing-portals/${e}`,e,t)},get({id:e}){return r.get(`billing-portals/${e}`)},update({id:e,data:t}){return r.put(`billing-portals/${e}`,t)},delete({id:e}){return r.delete(`billing-portals/${e}`)}}}function rt({apiHandler:r}){return{getAll({limit:e=null,offset:t=null,sort:n=null,filter:s=null,q:u=null}={}){const l={limit:e,offset:t,sort:n,filter:s,q:u};return r.getAll("blocklists",l)},create({id:e="",data:t}){return r.create(`blocklists/${e}`,e,t)},get({id:e}){return r.get(`blocklists/${e}`)},delete({id:e}){return r.delete(`blocklists/${e}`)}}}function nt({apiHandler:r}){return{getAll({limit:e=null,offset:t=null,sort:n=null,filter:s=null}={}){const u={limit:e,offset:t,sort:n,filter:s};return r.getAll("broadcast-messages",u)},create({data:e}){return r.post("broadcast-messages",e)},get({id:e}){return r.get(`broadcast-messages/${e}`)},delete({id:e}){return r.delete(`broadcast-messages/${e}`)},update({id:e,data:t}){return r.patch(`broadcast-messages/${e}`,t)}}}function st({apiHandler:r}){return{getAll({limit:e=null,offset:t=null,filter:n=null,sort:s=null}={}){const u={limit:e,offset:t,filter:n,sort:s};return r.getAll("cashier-custom-property-sets",u)},create({id:e="",data:t}){return r.create(`cashier-custom-property-sets/${e}`,e,t)},get({id:e}){return r.get(`cashier-custom-property-sets/${e}`)},update({id:e,data:t}){return r.put(`cashier-custom-property-sets/${e}`,t)},delete({id:e}){return r.delete(`cashier-custom-property-sets/${e}`)}}}function ut({apiHandler:r}){return{getAll({limit:e=null,offset:t=null,filter:n=null,sort:s=null}={}){const u={limit:e,offset:t,filter:n,sort:s};return r.getAll("cashier-requests",u)},create({data:e}){return r.post("cashier-requests",e)},get({id:e,expand:t=null}){const n={expand:t};return r.get(`cashier-requests/${e}`,n)}}}function lt({apiHandler:r}){return{getAll({limit:e=null,offset:t=null,filter:n=null,sort:s=null}={}){const u={limit:e,offset:t,filter:n,sort:s};return r.getAll("cashier-strategies",u)},create({id:e="",data:t}){return r.create(`cashier-strategies/${e}`,e,t)},get({id:e}){return r.get(`cashier-strategies/${e}`)},update({id:e,data:t}){return r.put(`cashier-strategies/${e}`,t)},delete({id:e}){return r.delete(`cashier-strategies/${e}`)}}}function ot({apiHandler:r}){return{getAll({limit:e=null,offset:t=null,sort:n=null,filter:s=null,q:u=null}={}){const l={limit:e,offset:t,sort:n,filter:s,q:u};return r.getAll("checkout-forms",l)},create({id:e="",data:t}){return r.create(`checkout-forms/${e}`,e,t)},get({id:e}){return r.get(`checkout-forms/${e}`)},update({id:e,data:t}){return r.put(`checkout-forms/${e}`,t)},delete({id:e}){return r.delete(`checkout-forms/${e}`)}}}function ct({apiHandler:r}){return{getAllRedemptions({limit:e=null,offset:t=null,filter:n=null,q:s=null,sort:u=null}={}){const l={limit:e,offset:t,filter:n,q:s,sort:u};return r.getAll("coupons-redemptions",l)},redeem({data:e}){return r.post("coupons-redemptions",e)},getRedemption({id:e}){return r.get(`coupons-redemptions/${e}`)},cancelRedemption({id:e}){return r.post(`coupons-redemptions/${e}/cancel`)},getAll({limit:e=null,offset:t=null,filter:n=null,q:s=null,sort:u=null}={}){const l={limit:e,offset:t,filter:n,q:s,sort:u};return r.getAll("coupons",l)},create({id:e="",data:t}){return r.create(`coupons/${e}`,e,t)},get({id:e}){return r.get(`coupons/${e}`)},update({id:e,data:t}){return r.put(`coupons/${e}`,t)},setExpiration({id:e,data:t}){return r.post(`coupons/${e}/expiration`,t)}}}function it({apiHandler:r}){return{createAWSSESCredential({data:e}){return r.post("credential-hashes/aws-ses",e)},getAWSSESCredential({hash:e}){return r.get(`credential-hashes/aws-ses/${e}`)},updateAWSSESCredential({hash:e,data:t}){return r.patch(`credential-hashes/aws-ses/${e}`,t)},createEmailCredential({data:e}){return r.post("credential-hashes/emails",e)},getEmailCredential({hash:e}){return r.get(`credential-hashes/emails/${e}`)},patchEmailCredential({hash:e,data:t}){return r.patch(`credential-hashes/emails/${e}`,t)},createMailgunCredential({data:e}){return r.post("credential-hashes/mailgun",e)},getMailgunCredential({hash:e}){return r.get(`credential-hashes/mailgun/${e}`)},patchMailgunCredential({hash:e,data:t}){return r.patch(`credential-hashes/mailgun/${e}`,t)},getAllOAuth2Credentials({filter:e=null,limit:t=null,offset:n=null,sort:s=null,q:u=null}={}){const l={filter:e,limit:t,offset:n,sort:s,q:u};return r.getAll("credential-hashes/oauth2",l)},createOAuth2Credential({data:e}){return r.post("credential-hashes/oauth2",e)},getOAuth2Credential({hash:e}){return r.get(`credential-hashes/oauth2/${e}`)},updateOAuth2Credential({hash:e,data:t}){return r.patch(`credential-hashes/oauth2/${e}`,t)},getOAuth2CredentialItems({hash:e,limit:t=null,offset:n=null,filter:s=null,q:u=null,fields:l=null,sort:o=null}){const g={limit:t,offset:n,filter:s,q:u,fields:l,sort:o};return r.getAll(`credential-hashes/oauth2/${e}/items`,g)},getAllPlaidCredentials({filter:e=null,limit:t=null,offset:n=null,sort:s=null,q:u=null}={}){const l={filter:e,limit:t,offset:n,sort:s,q:u};return r.getAll("credential-hashes/plaid",l)},createPlaidCredential({data:e}){return r.post("credential-hashes/plaid",e)},getPlaidCredential({hash:e}){return r.get(`credential-hashes/plaid/${e}`)},updatePlaidCredential({hash:e,data:t}){return r.patch(`credential-hashes/plaid/${e}`,t)},createPostmarkCredential({data:e}){return r.post("credential-hashes/postmark",e)},getPostmarkCredential({hash:e}){return r.get(`credential-hashes/postmark/${e}`)},patchPostmarkCredential({hash:e,data:t}){return r.patch(`credential-hashes/postmark/${e}`,t)},createSendGridCredential({data:e}){return r.post("credential-hashes/sendgrid",e)},getSendGridCredential({hash:e}){return r.get(`credential-hashes/sendgrid/${e}`)},patchSendGridCredential({hash:e,data:t}){return r.patch(`credential-hashes/sendgrid/${e}`,t)},createWebhookCredential({data:e}){return r.post("credential-hashes/webhooks",e)},getWebhookCredential({hash:e}){return r.get(`credential-hashes/webhooks/${e}`)},patchWebhookCredential({hash:e,data:t}){return r.patch(`credential-hashes/webhooks/${e}`,t)},getAllExperianCredentials({filter:e=null,limit:t=null,offset:n=null,sort:s=null,q:u=null}={}){const l={filter:e,limit:t,offset:n,sort:s,q:u};return r.getAll("credential-hashes/experian",l)},createExperianCredential({data:e}){return r.post("credential-hashes/experian",e)},getExperianCredential({hash:e}){return r.get(`credential-hashes/experian/${e}`)},updateExperianCredential({hash:e,data:t}){return r.patch(`credential-hashes/experian/${e}`,t)},getAllTaxJarCredentials({filter:e=null,limit:t=null,offset:n=null,sort:s=null,q:u=null}={}){const l={filter:e,limit:t,offset:n,sort:s,q:u};return r.getAll("credential-hashes/taxjar",l)},createTaxJarCredential({data:e}){return r.post("credential-hashes/taxjar",e)},getTaxJarCredential({hash:e}){return r.get(`credential-hashes/taxjar/${e}`)},updateTaxJarCredential({hash:e,data:t}){return r.patch(`credential-hashes/taxjar/${e}`,t)},getAllAvalaraCredentials({filter:e=null,limit:t=null,offset:n=null,sort:s=null,q:u=null}={}){const l={filter:e,limit:t,offset:n,sort:s,q:u};return r.getAll("credential-hashes/avalara",l)},createAvalaraCredential({data:e}){return r.post("credential-hashes/avalara",e)},getAvalaraCredential({hash:e}){return r.get(`credential-hashes/avalara/${e}`)},updateAvalaraCredential({hash:e,data:t}){return r.patch(`credential-hashes/avalara/${e}`,t)}}}function at({apiHandler:r}){return{getAll({filter:e=null,sort:t=null,limit:n=null,offset:s=null,q:u=null}={}){const l={filter:e,sort:t,limit:n,offset:s,q:u};return r.getAll("credit-memos",l)},create({id:e="",data:t}){return r.create(`credit-memos/${e}`,e,t)},get({id:e}){return r.get(`credit-memos/${e}`)},update({id:e,data:t}){return r.put(`credit-memos/${e}`,t)},patch({id:e,data:t}){return r.patch(`credit-memos/${e}`,t)},void({id:e}){return r.post(`credit-memos/${e}/void`)},getAllTimelineMessages({id:e,limit:t=null,offset:n=null,filter:s=null,sort:u=null,q:l=null}){const o={limit:t,offset:n,filter:s,sort:u,q:l};return r.getAll(`credit-memos/${e}/timeline`,o)},createTimelineComment({id:e,data:t}){return r.post(`credit-memos/${e}/timeline`,t)},getTimelineMessage({id:e,messageId:t}){return r.get(`credit-memos/${e}/timeline/${t}`)},deleteTimelineMessage({id:e,messageId:t}){return r.delete(`credit-memos/${e}/timeline/${t}`)}}}function gt({apiHandler:r}){return{getAll({limit:e=null,offset:t=null,sort:n=null,filter:s=null,q:u=null}={}){const l={limit:e,offset:t,sort:n,filter:s,q:u};return r.getAll("custom-domains",l)},create({data:e}){return r.post("custom-domains",e)},get({domain:e}){return r.get(`custom-domains/${e}`)},delete({domain:e}){return r.delete(`custom-domains/${e}`)}}}function mt({apiHandler:r}){return{getAll({resource:e,limit:t=null,offset:n=null}){const s={limit:t,offset:n};return r.getAll(`custom-fields/${e}`,s)},get({resource:e,name:t}){return r.get(`custom-fields/${e}/${t}`)},create({resource:e,name:t,data:n}){return r.put(`custom-fields/${e}/${t}`,n)},update({resource:e,name:t,data:n}){return r.put(`custom-fields/${e}/${t}`,n)}}}function ht({apiHandler:r}){return{getAuthOptions(){return r.get("authentication-options")},updateAuthOptions({data:e}){return r.put("authentication-options",e)},getAllAuthTokens({limit:e=null,offset:t=null}={}){const n={limit:e,offset:t};return r.getAll("authentication-tokens",n)},login({data:e}){return r.post("authentication-tokens",e)},verify({token:e}){return r.get(`authentication-tokens/${e}`)},logout({token:e}){return r.delete(`authentication-tokens/${e}`)},exchangeToken({token:e,data:t}){return r.post(`authentication-tokens/${e}/exchange`,t)},getAllCredentials({limit:e=null,offset:t=null}={}){const n={limit:e,offset:t};return r.getAll("credentials",n)},createCredential({id:e="",data:t}){return r.create(`credentials/${e}`,e,t)},getCredential({id:e}){return r.get(`credentials/${e}`)},updateCredential({id:e,data:t}){return r.put(`credentials/${e}`,t)},deleteCredential({id:e}){return r.delete(`credentials/${e}`)},getAllResetPasswordTokens({limit:e=null,offset:t=null}={}){const n={limit:e,offset:t};return r.getAll("password-tokens",n)},createResetPasswordToken({data:e}){return r.post("password-tokens",e)},getResetPasswordToken({id:e}){return r.get(`password-tokens/${e}`)},deleteResetPasswordToken({id:e}){return r.delete(`password-tokens/${e}`)}}}const w={Accept:"text/csv"},G={Accept:"application/pdf"};function ft({apiHandler:r}){return{getAll({limit:e=null,offset:t=null,filter:n=null,q:s=null,expand:u=null,fields:l=null,sort:o=null}={}){const g={limit:e,offset:t,filter:n,q:s,expand:u,fields:l,sort:o};return r.getAll("customers",g)},create({id:e="",data:t,expand:n=null}){const s={expand:n};return r.create(`customers/${e}`,e,t,s)},get({id:e,expand:t=null,fields:n=null}){const s={expand:t,fields:n};return r.get(`customers/${e}`,s)},update({id:e,data:t,expand:n=null}){const s={expand:n};return r.put(`customers/${e}`,t,s)},merge({id:e,targetCustomerId:t}){return r.delete(`customers/${e}?targetCustomerId=${t}`)},getAml({id:e}){return r.get(`customers/${e}/aml`)},getLeadSource({id:e}){return r.get(`customers/${e}/lead-source`)},createLeadSource({id:e,data:t}){return r.put(`customers/${e}/lead-source`,t)},updateLeadSource({id:e,data:t}){return r.put(`customers/${e}/lead-source`,t)},deleteLeadSource({id:e}){return r.delete(`customers/${e}/lead-source`)},getAllTimelineMessages({id:e,limit:t=null,offset:n=null,filter:s=null,sort:u=null,q:l=null}){const o={limit:t,offset:n,filter:s,sort:u,q:l};return r.getAll(`customers/${e}/timeline`,o)},createTimelineComment({id:e,data:t}){return r.post(`customers/${e}/timeline`,t)},getTimelineMessage({id:e,messageId:t}){return r.get(`customers/${e}/timeline/${t}`)},deleteTimelineMessage({id:e,messageId:t}){return r.delete(`customers/${e}/timeline/${t}`)},getCustomerEddScore({id:e}){return r.get(`customers/${e}/edd-score`)},patchCustomerEddScore({id:e,data:t}){return r.patch(`customers/${e}/edd-score`,t)},getEddTimelineCollection({id:e,limit:t=null,offset:n=null,filter:s=null,sort:u=null,q:l=null}){const o={limit:t,offset:n,filter:s,sort:u,q:l};return r.getAll(`customers/${e}/edd-timeline`,o)},createEddTimelineComment({id:e,data:t}){return r.post(`customers/${e}/edd-timeline`,t)},getEddTimelineMessage({id:e,messageId:t}){return r.get(`customers/${e}/edd-timeline/${t}`)},deleteEddTimelineMessage({id:e,messageId:t}){return r.delete(`customers/${e}/edd-timeline/${t}`)},getAllEddSearchResults({id:e,limit:t=null,offset:n=null}){const s={limit:t,offset:n};return r.getAll(`customers/${e}/edd-search-results`,s)},getEddSearchResult({id:e,searchResultId:t}){return r.get(`customers/${e}/edd-search-results/${t}`)},downloadCSV({limit:e=null,offset:t=null,sort:n=null,expand:s=null,filter:u=null,q:l=null}={}){const o={params:{limit:e,offset:t,sort:n,expand:s,filter:u,q:l},headers:w};return r.download("customers",o)}}}function $t({apiHandler:r}){return{create({data:e}){return r.post("digital-wallets/onboarding/apple-pay",e)},validate({data:e}){return r.post("digital-wallets/validation",e)}}}function pt({apiHandler:r}){return{getAll({filter:e=null,sort:t=null,limit:n=null,offset:s=null,q:u=null,expand:l=null}={}){const o={filter:e,sort:t,limit:n,offset:s,q:u,expand:l};return r.getAll("disputes",o)},create({id:e="",data:t,expand:n=null}){const s={expand:n};return r.create(`disputes/${e}`,e,t,s)},get({id:e}){return r.get(`disputes/${e}`)},update({id:e,data:t,expand:n=null}){const s={expand:n};return r.put(`disputes/${e}`,t,s)},downloadCSV({limit:e=null,offset:t=null,sort:n=null,expand:s=null,filter:u=null,q:l=null}={}){const o={params:{limit:e,offset:t,sort:n,expand:s,filter:u,q:l},headers:w};return r.download("disputes",o)}}}function yt({apiHandler:r}){return{verify({token:e}){return r.put(`email-delivery-setting-verifications/${e}`)},getAll({limit:e=null,offset:t=null,filter:n=null,sort:s=null,q:u=null}={}){const l={limit:e,offset:t,filter:n,sort:s,q:u};return r.getAll("email-delivery-settings",l)},create({data:e}){return r.post("email-delivery-settings",e)},get({id:e}){return r.get(`email-delivery-settings/${e}`)},delete({id:e}){return r.delete(`email-delivery-settings/${e}`)},update({id:e,data:t}){return r.patch(`email-delivery-settings/${e}`,t)},resendVerification({id:e}){return r.post(`email-delivery-settings/${e}/resend-email-verification`)}}}function At({apiHandler:r}){return{getAll({limit:e=null,offset:t=null,q:n=null,sort:s=null,filter:u=null}={}){const l={limit:e,offset:t,q:n,sort:s,filter:u};return r.getAll("email-messages",l)},create({data:e}){return r.post("email-messages",e)},get({id:e}){return r.get(`email-messages/${e}`)},delete({id:e}){return r.delete(`email-messages/${e}`)},send({id:e,data:t={status:"outbox"}}){return r.patch(`email-messages/${e}`,t)}}}function bt({apiHandler:r}){return{getAll({limit:e=null,offset:t=null}={}){const n={limit:e,offset:t};return r.getAll("email-notifications",n)}}}function Rt({apiHandler:r}){return{getAll(){return r.getAll("events")},get({eventType:e}){return r.get(`events/${e}`)},getRules({eventType:e}){return r.get(`events/${e}/rules`)},createRules({eventType:e,data:t}){return r.put(`events/${e}/rules`,t)},updateRules({eventType:e,data:t}){return r.put(`events/${e}/rules`,t)},getAllTimelineMessages({eventType:e,limit:t=null,offset:n=null,filter:s=null,sort:u=null,q:l=null}){const o={limit:t,offset:n,filter:s,sort:u,q:l};return r.getAll(`events/${e}/timeline`,o)},createTimelineComment({eventType:e,data:t}){return r.post(`events/${e}/timeline`,t)},getTimelineMessage({eventType:e,messageId:t}){return r.get(`events/${e}/timeline/${t}`)},deleteTimelineMessage({eventType:e,messageId:t}){return r.delete(`events/${e}/timeline/${t}`)},getRulesHistory({eventType:e,limit:t=null,offset:n=null,filter:s=null,q:u=null,sort:l=null,fields:o=null}){const g={limit:t,offset:n,filter:s,q:u,sort:l,fields:o};return r.getAll(`events/${e}/rules/history`,g)},getRulesVersionNumber({eventType:e,version:t,fields:n=null}){const s={fields:n};return r.get(`events/${e}/rules/history/${t}`,s)},getRulesVersionDetail({eventType:e,version:t,fields:n=null}){const s={fields:n};return r.get(`events/${e}/rules/versions/${t}`,s)},getAllDraftRulesets({eventType:e,limit:t=null,offset:n=null,filter:s=null,q:u=null,sort:l=null,fields:o=null}){const g={limit:t,offset:n,filter:s,q:u,sort:l,fields:o};return r.getAll(`events/${e}/rules/drafts`,g)},createDraftRuleset({eventType:e,data:t}){return r.post(`events/${e}/rules/drafts`,t)},getDraftRuleset({eventType:e,id:t,fields:n=null}){const s={fields:n};return r.get(`events/${e}/rules/drafts/${t}`,s)},updateDraftRuleset({eventType:e,id:t,data:n}){return r.put(`events/${e}/rules/drafts/${t}`,n)},deleteDraftRuleset({eventType:e,id:t}){return r.delete(`events/${e}/rules/drafts/${t}`)}}}function dt({apiHandler:r}){return{getAll({limit:e=null,offset:t=null}={}){const n={limit:e,offset:t};return r.getAll("fees",n)},create({id:e="",data:t}){return r.create(`fees/${e}`,e,t)},get({id:e}){return r.get(`fees/${e}`)},upsert({id:e,data:t}){return r.put(`fees/${e}`,t)},patch({id:e,data:t}){return r.patch(`fees/${e}`,t)}}}function wt({apiHandler:r}){return{getAllAttachments({limit:e=null,offset:t=null,filter:n=null,q:s=null,expand:u=null,fields:l=null,sort:o=null}={}){const g={limit:e,offset:t,filter:n,q:s,expand:u,fields:l,sort:o};return r.getAll("attachments",g)},attach({id:e="",data:t,expand:n=null}){const s={expand:n};return r.create(`attachments/${e}`,e,t,s)},getAttachment({id:e}){return r.get(`attachments/${e}`)},updateAttachment({id:e,data:t,expand:n=null}){const s={expand:n};return r.put(`attachments/${e}`,t,s)},detach({id:e}){return r.delete(`attachments/${e}`)},getAll({limit:e=null,offset:t=null,filter:n=null,q:s=null,fields:u=null,sort:l=null}={}){const o={limit:e,offset:t,filter:n,q:s,fields:u,sort:l};return r.getAll("files",o)},upload({fileObject:e}){return r.post("files",e)},get({id:e}){return r.get(`files/${e}`)},update({id:e,data:t}){return r.put(`files/${e}`,t)},delete({id:e}){return r.delete(`files/${e}`)},download({id:e}){const t={responseType:"arraybuffer"};return r.download(`files/${e}/download`,t)},detachAndDelete({id:e}){const t={filter:`fileId:${e}`};let n=[];const u=(async()=>{const l=this.getAllAttachments(t);n.push(l);const g=(await l).items.map(k=>this.detach({id:k.fields.id}));n=[...n,g],await Promise.all(g);const p=r.delete(`files/${e}`);return n.push(p),p})();return u.cancel=()=>{n.forEach(l=>l.cancel())},u},uploadAndUpdate({fileObject:e,data:t={description:"",tags:[""]}}){const n=[],u=(async()=>{const l=this.upload({fileObject:e});n.push(l),await l;const o={name:l.name,extension:l.extension,description:t.description,tags:t.tags,url:""},g=this.update({id:l.fields.id,data:o});return n.push(g),g})();return u.cancel=()=>{n.forEach(l=>l.cancel())},u}}}function vt({apiHandler:r}){return{getAll({limit:e=null,offset:t=null,sort:n=null,filter:s=null,q:u=null,fields:l=null}={}){const o={limit:e,offset:t,sort:n,filter:s,q:u,fields:l};return r.getAll("gateway-accounts",o)},create({id:e="",data:t}){return r.create(`gateway-accounts/${e}`,e,t)},get({id:e}){return r.get(`gateway-accounts/${e}`)},update({id:e,data:t}){return r.patch(`gateway-accounts/${e}`,t)},delete({id:e}){return r.delete(`gateway-accounts/${e}`)},close({id:e}){return r.post(`gateway-accounts/${e}/close`)},disable({id:e}){return r.post(`gateway-accounts/${e}/disable`)},getAllDowntimeSchedules({id:e,limit:t=null,offset:n=null,filter:s=null,sort:u=null}){const l={limit:t,offset:n,filter:s,sort:u};return r.getAll(`gateway-accounts/${e}/downtime-schedules`,l)},createDowntimeSchedule({id:e,data:t}){return r.post(`gateway-accounts/${e}/downtime-schedules`,t)},getDowntimeSchedule({id:e,downtimeId:t}){return r.get(`gateway-accounts/${e}/downtime-schedules/${t}`)},updateDowntimeSchedule({id:e,downtimeId:t,data:n}){return r.put(`gateway-accounts/${e}/downtime-schedules/${t}`,n)},deleteDowntimeSchedule({id:e,downtimeId:t}){return r.delete(`gateway-accounts/${e}/downtime-schedules/${t}`)},enable({id:e}){return r.post(`gateway-accounts/${e}/enable`)},getAllVolumeLimits({id:e}){return r.getAll(`gateway-accounts/${e}/limits`)},getVolumeLimit({id:e,limitId:t}){return r.get(`gateway-accounts/${e}/limits/${t}`)},updateVolumeLimit({id:e,limitId:t,data:n}){return r.put(`gateway-accounts/${e}/limits/${t}`,n)},deleteVolumeLimit({id:e,limitId:t}){return r.delete(`gateway-accounts/${e}/limits/${t}`)},getAllTimelineMessages({id:e,limit:t=null,offset:n=null,filter:s=null,sort:u=null,q:l=null}){const o={limit:t,offset:n,filter:s,sort:u,q:l};return r.getAll(`gateway-accounts/${e}/timeline`,o)},createTimelineComment({id:e,data:t}){return r.post(`gateway-accounts/${e}/timeline`,t)},getTimelineMessage({id:e,messageId:t}){return r.get(`gateway-accounts/${e}/timeline/${t}`)},deleteTimelineMessage({id:e,messageId:t}){return r.delete(`gateway-accounts/${e}/timeline/${t}`)},checkCredentials({id:e}){return r.post(`gateway-accounts/${e}/check-credentials`)},getFinancialSettings({id:e}){return r.get(`gateway-accounts/${e}/financial-settings`)},setFinancialSettings({id:e,data:t}){return r.put(`gateway-accounts/${e}/financial-settings`,t)}}}function kt({apiHandler:r}){return{getAll({limit:e=null,offset:t=null}={}){const n={limit:e,offset:t};return r.getAll("integrations",n)},get({label:e}){return r.get(`integrations/${e}`)}}}function Tt({apiHandler:r}){return{getAll({filter:e=null,sort:t=null,limit:n=null,offset:s=null,q:u=null,expand:l=null}={}){const o={filter:e,sort:t,limit:n,offset:s,q:u,expand:l};return r.getAll("invoices",o)},create({id:e="",data:t,expand:n=null}){const s={expand:n};return r.create(`invoices/${e}`,e,t,s)},get({id:e,expand:t=null}){const n={expand:t};return r.get(`invoices/${e}`,n)},update({id:e,data:t,expand:n=null}){const s={expand:n};return r.put(`invoices/${e}`,t,s)},getAllInvoiceItems({id:e,limit:t=null,offset:n=null,expand:s=null}){const u={limit:t,offset:n,expand:s};return r.getAll(`invoices/${e}/items`,u)},createInvoiceItem({id:e,data:t}){return r.post(`invoices/${e}/items`,t)},getInvoiceItem({id:e,itemId:t}){return r.get(`invoices/${e}/items/${t}`)},updateInvoiceItem({id:e,itemId:t,data:n}){return r.put(`invoices/${e}/items/${t}`,n)},deleteInvoiceItem({id:e,itemId:t}){return r.delete(`invoices/${e}/items/${t}`)},issue({id:e,data:t}){return r.post(`invoices/${e}/issue`,t)},abandon({id:e}){return r.post(`invoices/${e}/abandon`)},void({id:e}){return r.post(`invoices/${e}/void`)},recalculate({id:e}){return r.post(`invoices/${e}/recalculate`)},reissue({id:e,data:t}){return r.post(`invoices/${e}/reissue`,t)},getAllTransactionAllocations({id:e,limit:t=null,offset:n=null}){const s={limit:t,offset:n};return r.getAll(`invoices/${e}/transaction-allocations`,s)},applyTransaction({id:e,data:t}){return r.post(`invoices/${e}/transaction`,t)},getAllTimelineMessages({id:e,limit:t=null,offset:n=null,filter:s=null,sort:u=null,q:l=null}){const o={limit:t,offset:n,filter:s,sort:u,q:l};return r.getAll(`invoices/${e}/timeline`,o)},createTimelineComment({id:e,data:t}){return r.post(`invoices/${e}/timeline`,t)},getTimelineMessage({id:e,messageId:t}){return r.get(`invoices/${e}/timeline/${t}`)},deleteTimelineMessage({id:e,messageId:t}){return r.delete(`invoices/${e}/timeline/${t}`)},downloadCSV({limit:e=null,offset:t=null,sort:n=null,expand:s=null,filter:u=null,q:l=null}={}){const o={params:{limit:e,offset:t,sort:n,expand:s,filter:u,q:l},headers:w};return r.download("invoices",o)},downloadPDF({id:e}){const t={headers:G,responseType:"arraybuffer"};return r.download(`invoices/${e}`,t)}}}function Et({apiHandler:r}){return{getAllAccounts({limit:e=null,offset:t=null,filter:n=null,sort:s=null}={}){const u={limit:e,offset:t,filter:n,sort:s};return r.getAll("journal-accounts",u)},createAccount({id:e="",data:t}){return r.create(`journal-accounts/${e}`,e,t)},getAccount({id:e}){return r.get(`journal-accounts/${e}`)},updateAccount({id:e,data:t}){return r.put(`journal-accounts/${e}`,t)}}}function St({apiHandler:r}){return{getAllEntries({limit:e=null,offset:t=null,filter:n=null,sort:s=null}={}){const u={limit:e,offset:t,filter:n,sort:s};return r.getAll("journal-entries",u)},createEntry({id:e="",data:t}){return r.create(`journal-entries/${e}`,e,t)},getEntry({id:e}){return r.get(`journal-entries/${e}`)},updateEntry({id:e,data:t}){return r.put(`journal-entries/${e}`,t)},getAllRecords({id:e,limit:t=null,offset:n=null,filter:s=null,sort:u=null,expand:l=null}){const o={limit:t,offset:n,filter:s,sort:u,expand:l};return r.getAll(`journal-entries/${e}/records`,o)},createRecord({id:e,data:t}){return r.post(`journal-entries/${e}/records`,t)},getRecord({id:e,journalRecordId:t}){return r.get(`journal-entries/${e}/records/${t}`)},updateRecord({id:e,journalRecordId:t,data:n}){return r.put(`journal-entries/${e}/records/${t}`,n)},deleteRecord({id:e,journalRecordId:t}){return r.delete(`journal-entries/${e}/records/${t}`)}}}function It({apiHandler:r}){return{getAll({limit:e=null,offset:t=null,filter:n=null,sort:s=null,expand:u=null}={}){const l={limit:e,offset:t,filter:n,sort:s,expand:u};return r.getAll("kyc-documents",l)},create({id:e="",data:t}){return r.create(`kyc-documents/${e}`,e,t)},get({id:e}){return r.get(`kyc-documents/${e}`)},update({id:e,data:t}){return r.put(`kyc-documents/${e}`,t)},accept({id:e}){return r.post(`kyc-documents/${e}/acceptance`)},matches({id:e,data:t}){return r.post(`kyc-documents/${e}/matches`,t)},reject({id:e,data:t}){return r.post(`kyc-documents/${e}/rejection`,t)},review({id:e}){return r.post(`kyc-documents/${e}/review`)},startReview({id:e}){return r.post(`kyc-documents/${e}/start-review`)},stopReview({id:e}){return r.post(`kyc-documents/${e}/stop-review`)}}}function Ct({apiHandler:r}){return{getAll({limit:e=null,offset:t=null,filter:n=null,sort:s=null}={}){const u={limit:e,offset:t,filter:n,sort:s};return r.getAll("kyc-requests",u)},create({data:e}){return r.post("kyc-requests",e)},get({id:e}){return r.get(`kyc-requests/${e}`)},delete({id:e}){return r.delete(`kyc-requests/${e}`)},update({id:e,data:t}){return r.patch(`kyc-requests/${e}`,t)}}}function xt({apiHandler:r}){return{getKycSettings(){return r.get("kyc-settings")},updateKycSettings({data:e}){return r.put("kyc-settings",e)}}}function jt({apiHandler:r}){return{getAll({limit:e=null,offset:t=null,filter:n=null,sort:s=null,fields:u=null,q:l=null}={}){const o={limit:e,offset:t,filter:n,sort:s,fields:u,q:l};return r.getAll("lists",o)},create({id:e="",data:t}){return r.create(`lists/${e}`,e,t)},getLatestVersion({id:e}){return r.get(`lists/${e}`)},update({id:e,data:t}){return r.put(`lists/${e}`,t)},delete({id:e}){return r.delete(`lists/${e}`)},getByVersion({id:e,version:t}){return r.get(`lists/${e}/${t}`)}}}function Pt({apiHandler:r}){return{getAll({limit:e=null,offset:t=null,filter:n=null,sort:s=null}={}){const u={limit:e,offset:t,filter:n,sort:s};return r.getAll("memberships",u)},get({organizationId:e,userId:t}){return r.get(`memberships/${e}/${t}`)},update({organizationId:e,userId:t,data:n}){return r.put(`memberships/${e}/${t}`,n)},delete({organizationId:e,userId:t}){return r.delete(`memberships/${e}/${t}`)}}}function qt({apiHandler:r}){return{getAll({limit:e=null,offset:t=null,filter:n=null,q:s=null,sort:u=null}={}){const l={limit:e,offset:t,filter:n,q:s,sort:u};return r.getAll("organization-exports",l)},create({data:e}){return r.post("organization-exports",e)},get({id:e}){return r.get(`organization-exports/${e}`)}}}function Mt({apiHandler:r}){return{getAll({limit:e=null,offset:t=null,filter:n=null,q:s=null}={}){const u={limit:e,offset:t,filter:n,q:s};return r.getAll("organizations",u)},create({data:e}){return r.post("organizations",e)},get({id:e}){return r.get(`organizations/${e}`)},update({id:e,data:t}){return r.patch(`organizations/${e}`,t)}}}function Ot({apiHandler:r}){return{getAll({limit:e=null,q:t=null}={}){const n={limit:e,q:t};return r.getAll("payment-cards-bank-names",n)}}}function Dt({apiHandler:r}){return{getAll({filter:e=null,sort:t=null,limit:n=null,offset:s=null,q:u=null,expand:l=null}={}){const o={filter:e,sort:t,limit:n,offset:s,q:u,expand:l};return r.getAll("payment-instruments",o)},create({data:e}){return r.post("payment-instruments",e)},get({id:e}){return r.get(`payment-instruments/${e}`)},update({id:e,data:t}){return r.patch(`payment-instruments/${e}`,t)},deactivate({id:e}){return r.post(`payment-instruments/${e}/deactivation`)}}}function Ft({apiHandler:r}){return{getAll({limit:e=null,offset:t=null}={}){const n={limit:e,offset:t};return r.getAll("payment-methods",n)},get({apiName:e}){return r.get(`payment-methods/${e}`)}}}function Kt({apiHandler:r}){return{getAll({limit:e=null,offset:t=null}={}){const n={limit:e,offset:t};return r.getAll("tokens",n)},create({data:e}){return r.post("tokens",e)},get({token:e}){return r.get(`tokens/${e}`)}}}function Bt({apiHandler:r}){return{getAll({limit:e=null,offset:t=null,filter:n=null,sort:s=null}={}){const u={limit:e,offset:t,filter:n,sort:s};return r.getAll("payout-requests",u)},create({id:e="",data:t}){return r.create(`payout-requests/${e}`,e,t)},get({id:e}){return r.get(`payout-requests/${e}`)},update({id:e,data:t}){return r.put(`payout-requests/${e}`,t)},getPaymentInstruments({id:e}){return r.get(`payout-requests/${e}/payment-instruments`)}}}function Nt({apiHandler:r}){return{create({data:e}){return r.post("payouts",e)}}}function Vt({apiHandler:r}){return{getAll({filter:e=null,sort:t=null,limit:n=null,offset:s=null,q:u=null}={}){const l={filter:e,sort:t,limit:n,offset:s,q:u};return r.getAll("plans",l)},create({id:e="",data:t}){return r.create(`plans/${e}`,e,t)},get({id:e}){return r.get(`plans/${e}`)},update({id:e,data:t}){return r.put(`plans/${e}`,t)},delete({id:e}){return r.delete(`plans/${e}`)}}}function zt({apiHandler:r}){return{sendEmailRuleAction({data:e}){return r.post("previews/rule-actions/send-email",e)},triggerWebhookRuleAction({data:e}){return r.post("previews/rule-actions/trigger-webhook",e)},webhook({data:e}){return r.post("previews/webhooks",e)},order({data:e}){return r.post("previews/orders",e)}}}function Lt({apiHandler:r}){return{getAll({filter:e=null,sort:t=null,limit:n=null,offset:s=null,q:u=null}={}){const l={filter:e,sort:t,limit:n,offset:s,q:u};return r.getAll("products",l)},create({id:e="",data:t}){return r.create(`products/${e}`,e,t)},get({id:e}){return r.get(`products/${e}`)},update({id:e,data:t}){return r.put(`products/${e}`,t)},delete({id:e}){return r.delete(`products/${e}`)}}}function Ut({apiHandler:r}){return{startPermissionsEmulation({data:e}){return r.post("permissions-emulation",e)},stopPermissionsEmulation(){return r.delete("permissions-emulation")},get(){return r.get("profile")},update({data:e}){return r.put("profile",e)},getMfa(){return r.get("profile/mfa")},updateMfa(){return r.post("profile/mfa")},deleteMfa(){return r.delete("profile/mfa")}}}function Wt({apiHandler:r}){return{readyToPay({data:e}){return r.post("ready-to-pay",e)}}}function Jt({apiHandler:r}){return{getAll(){return r.get("risk-score-rules")},updateRiskScoreRules({data:e}){return r.put("risk-score-rules",e)},getAllBlocklistRules(){return r.get("risk-score-rules/blocklists")},updateRiskScoreBlocklistRules({data:e}){return r.put("risk-score-rules/blocklists",e)}}}function Gt({apiHandler:r}){return{getAll({limit:e=null,offset:t=null,filter:n=null,sort:s=null,q:u=null,expand:l=null}={}){const o={limit:e,offset:t,filter:n,sort:s,q:u,expand:l};return r.getAll("roles",o)},create({id:e="",data:t}){return r.create(`roles/${e}`,e,t)},get({id:e,expand:t=null}){const n={expand:t};return r.get(`roles/${e}`,n)},update({id:e,data:t}){return r.put(`roles/${e}`,t)},delete({id:e}){return r.delete(`roles/${e}`)}}}function Yt({apiHandler:r}){return{get({sort:e=null,limit:t=null,offset:n=null,q:s=null}){const u={sort:e,limit:t,offset:n,q:s};return r.get("search",u)}}}function _t({apiHandler:r}){return{getAll({limit:e=null,offset:t=null,sort:n=null,filter:s=null,q:u=null}={}){const l={limit:e,offset:t,sort:n,filter:s,q:u};return r.getAll("grid-segments",l)},create({id:e="",data:t}){return r.create(`grid-segments/${e}`,e,t)},get({id:e}){return r.get(`grid-segments/${e}`)},update({id:e,data:t}){return r.put(`grid-segments/${e}`,t)},delete({id:e}){return r.delete(`grid-segments/${e}`)}}}function Qt({apiHandler:r}){return{getAll({eventType:e}){return r.getAll(`send-through-attribution/${e}`)}}}function Xt({apiHandler:r}){return{getAll({type:e,filter:t=null,limit:n=null,offset:s=null,sort:u=null,q:l=null}){const o={filter:t,limit:n,offset:s,sort:u,q:l};return r.getAll(`service-credentials/${e}`,o)},create({type:e,data:t}){return r.post(`service-credentials/${e}`,t)},get({type:e,id:t}){return r.get(`service-credentials/${e}/${t}`)},update({type:e,id:t,data:n}){return r.patch(`service-credentials/${e}/${t}`,n)},getItems({type:e,id:t,limit:n=null,offset:s=null,filter:u=null,q:l=null,fields:o=null,sort:g=null}){const p={limit:n,offset:s,filter:u,q:l,fields:o,sort:g};return r.getAll(`service-credentials/${e}/${t}/items`,p)}}}function Zt({apiHandler:r}){return{getAll({limit:e=null,offset:t=null,filter:n=null,sort:s=null,q:u=null}={}){const l={limit:e,offset:t,filter:n,sort:s,q:u};return r.getAll("shipping-rates",l)},create({id:e="",data:t}){return r.create(`shipping-rates/${e}`,e,t)},get({id:e}){return r.get(`shipping-rates/${e}`)},update({id:e,data:t}){return r.put(`shipping-rates/${e}`,t)},delete({id:e}){return r.delete(`shipping-rates/${e}`)}}}function Ht({apiHandler:r}){return{get(){return r.get("status")}}}function er({apiHandler:r}){return{getAll({limit:e=null,offset:t=null,filter:n=null,sort:s=null}={}){const u={limit:e,offset:t,filter:n,sort:s};return r.getAll("subscription-cancellations",u)},create({id:e="",data:t}){return r.create(`subscription-cancellations/${e}`,e,t)},get({id:e}){return r.get(`subscription-cancellations/${e}`)},delete({id:e}){return r.delete(`subscription-cancellations/${e}`)},patch({id:e,data:t}){return r.patch(`subscription-cancellations/${e}`,t)}}}function tr({apiHandler:r}){return{getAll({limit:e=null,offset:t=null,filter:n=null,sort:s=null}={}){const u={limit:e,offset:t,filter:n,sort:s};return r.getAll("subscription-pauses",u)},pause({id:e="",data:t}){return r.create(`subscription-pauses/${e}`,e,t)},get({id:e}){return r.get(`subscription-pauses/${e}`)},update({id:e,data:t}){return r.put(`subscription-pauses/${e}`,t)},delete({id:e}){return r.delete(`subscription-pauses/${e}`)}}}function rr({apiHandler:r}){return{getAll({limit:e=null,offset:t=null,filter:n=null,sort:s=null}={}){const u={limit:e,offset:t,filter:n,sort:s};return r.getAll("subscription-reactivations",u)},reactivate({data:e}){return r.post("subscription-reactivations",e)},get({id:e}){return r.get(`subscription-reactivations/${e}`)}}}function nr({apiHandler:r}){return{getAll({filter:e=null,sort:t=null,limit:n=null,offset:s=null,q:u=null,expand:l=null}={}){const o={filter:e,sort:t,limit:n,offset:s,q:u,expand:l};return r.getAll("subscriptions",o)},create({id:e="",data:t,expand:n=null}){const s={expand:n};return r.create(`subscriptions/${e}`,e,t,s)},get({id:e,expand:t=null}){const n={expand:t};return r.get(`subscriptions/${e}`,n)},update({id:e,data:t,expand:n=null}){const s={expand:n};return r.put(`subscriptions/${e}`,t,s)},delete({id:e}){return r.delete(`subscriptions/${e}`)},void({id:e}){return r.post(`subscriptions/${e}/void`)},changeItems({id:e,data:t}){return r.post(`subscriptions/${e}/change-items`,t)},createInterimInvoice({id:e,data:t}){return r.post(`subscriptions/${e}/interim-invoice`,t)},getAllUpcomingInvoices({id:e,expand:t=null}){const n={expand:t};return r.getAll(`subscriptions/${e}/upcoming-invoices`,n)},getUpcomingInvoice({id:e,expand:t=null}){const n={expand:t};return r.get(`subscriptions/${e}/upcoming-invoice`,n)},issueUpcomingInvoice({id:e,invoiceId:t,data:n}){return r.post(`subscriptions/${e}/upcoming-invoices/${t}/issue`,n)},getAllTimelineMessages({id:e,limit:t=null,offset:n=null,filter:s=null,sort:u=null,q:l=null}){const o={limit:t,offset:n,filter:s,sort:u,q:l};return r.getAll(`subscriptions/${e}/timeline`,o)},createTimelineComment({id:e,data:t}){return r.post(`subscriptions/${e}/timeline`,t)},getTimelineMessage({id:e,messageId:t}){return r.get(`subscriptions/${e}/timeline/${t}`)},deleteTimelineMessage({id:e,messageId:t}){return r.delete(`subscriptions/${e}/timeline/${t}`)},downloadCSV({limit:e=null,offset:t=null,sort:n=null,expand:s=null,filter:u=null,q:l=null}={}){const o={params:{limit:e,offset:t,sort:n,expand:s,filter:u,q:l},headers:w};return r.download("subscriptions",o)}}}function sr({apiHandler:r}){return{getAll({limit:e=null,offset:t=null,filter:n=null,q:s=null,sort:u=null}={}){const l={limit:e,offset:t,filter:n,q:s,sort:u};return r.getAll("tags",l)},create({data:e}){return r.post("tags",e)},get({tag:e}){return r.get(`tags/${e}`)},delete({tag:e}){return r.delete(`tags/${e}`)},update({tag:e,data:t}){return r.patch(`tags/${e}`,t)},tagCustomers({tag:e,data:t}){return r.post(`tags/${e}/customers`,t)},untagCustomers({tag:e,data:t}){return r.delete(`tags/${e}/customers`,t)},tagCustomer({tag:e,customerId:t}){return r.post(`tags/${e}/customers/${t}`)},untagCustomer({tag:e,customerId:t}){return r.delete(`tags/${e}/customers/${t}`)},tagKycDocuments({tag:e,data:t}){return r.post(`tags/${e}/kyc-documents`,t)},untagKycDocuments({tag:e,data:t}){return r.delete(`tags/${e}/kyc-documents`,t)},tagKycDocument({tag:e,kycDocumentId:t}){return r.post(`tags/${e}/kyc-documents/${t}`)},untagKycDocument({tag:e,kycDocumentId:t}){return r.delete(`tags/${e}/kyc-documents/${t}`)}}}function ur({apiHandler:r}){return{getAllTagsRules({limit:e=null,offset:t=null,sort:n=null,filter:s=null,q:u=null}={}){const l={limit:e,offset:t,sort:n,filter:s,q:u};return r.getAll("tags-rules",l)},createTagsRule({id:e="",data:t}){return r.create(`tags-rules/${e}`,e,t)},getTagsRule({id:e}){return r.get(`tags-rules/${e}`)},updateTagsRule({id:e,data:t}){return r.put(`tags-rules/${e}`,t)},deleteTagsRule({id:e}){return r.delete(`tags-rules/${e}`)}}}function lr({apiHandler:r}){return{getAllApiLogs({limit:e=null,offset:t=null,sort:n=null,filter:s=null,q:u=null}={}){const l={limit:e,offset:t,sort:n,filter:s,q:u};return r.getAll("tracking/api",l)},getApiLog({id:e}){return r.get(`tracking/api/${e}`)},getAllListsChangesHistory({limit:e=null,offset:t=null,sort:n=null,filter:s=null,q:u=null}={}){const l={limit:e,offset:t,sort:n,filter:s,q:u};return r.getAll("tracking/lists",l)},getAllWebhookTrackingLogs({limit:e=null,offset:t=null,sort:n=null,filter:s=null,q:u=null}={}){const l={limit:e,offset:t,sort:n,filter:s,q:u};return r.getAll("tracking/webhooks",l)},getWebhookTrackingLog({id:e}){return r.get(`tracking/webhooks/${e}`)},resendWebhook({id:e}){return r.post(`tracking/webhooks/${e}/resend`)},downloadApiLogsCSV({limit:e=null,offset:t=null,sort:n=null,filter:s=null,q:u=null}={}){const l={params:{limit:e,offset:t,sort:n,filter:s,q:u},headers:w};return r.download("tracking/api",l)}}}function or({apiHandler:r}){return{getAll({limit:e=null,offset:t=null,filter:n=null,q:s=null,sort:u=null,expand:l=null}={}){const o={limit:e,offset:t,filter:n,q:s,sort:u,expand:l};return r.getAll("transactions",o)},create({data:e,expand:t=null}){const n={expand:t};return r.post("transactions",e,n)},get({id:e,expand:t=null}){const n={expand:t};return r.get(`transactions/${e}`,n)},patch({id:e,data:t}){return r.patch(`transactions/${e}`,t)},query({id:e}){return r.post(`transactions/${e}/query`)},update({id:e,data:t}){return r.post(`transactions/${e}/update`,t)},refund({id:e,data:t}){return r.post(`transactions/${e}/refund`,t)},getAllTimelineMessages({id:e,limit:t=null,offset:n=null,filter:s=null}){const u={limit:t,offset:n,filter:s};return r.getAll(`transactions/${e}/timeline`,u)},createTimelineComment({id:e,data:t}){return r.post(`transactions/${e}/timeline`,t)},getTimelineMessage({id:e,messageId:t}){return r.get(`transactions/${e}/timeline/${t}`)},deleteTimelineMessage({id:e,messageId:t}){return r.delete(`transactions/${e}/timeline/${t}`)},downloadCSV({limit:e=null,offset:t=null,sort:n=null,expand:s=null,filter:u=null,q:l=null}={}){const o={params:{limit:e,offset:t,sort:n,expand:s,filter:u,q:l},headers:w};return r.download("transactions",o)}}}function cr({apiHandler:r}){return{getAll({filter:e=null,sort:t=null,limit:n=null,offset:s=null,q:u=null}={}){const l={filter:e,sort:t,limit:n,offset:s,q:u};return r.getAll("usages",l)},create({id:e="",data:t}){return r.create(`usages/${e}`,e,t)},get({id:e}){return r.get(`usages/${e}`)},update({id:e,data:t}){return r.put(`usages/${e}`,t)},delete({id:e}){return r.delete(`usages/${e}`)}}}function ir({apiHandler:r}){return{getAll({limit:e=null,offset:t=null,sort:n=null,filter:s=null,q:u=null}={}){const l={limit:e,offset:t,sort:n,filter:s,q:u};return r.getAll("users",l)},create({id:e="",data:t}){return r.create(`users/${e}`,e,t)},get({id:e}){return r.get(`users/${e}`)},update({id:e,data:t}){return r.put(`users/${e}`,t)},getMfa({id:e}){return r.get(`users/${e}/mfa`)}}}function ar({apiHandler:r}){return{getAll({limit:e=null,offset:t=null,filter:n=null}={}){const s={limit:e,offset:t,filter:n};return r.getAll("webhooks",s)},create({id:e="",data:t}){return r.create(`webhooks/${e}`,e,t)},get({id:e}){return r.get(`webhooks/${e}`)},update({id:e,data:t}){return r.put(`webhooks/${e}`,t)}}}function gr({apiHandler:r}){return{getAll({limit:e=null,offset:t=null,q:n=null,filter:s=null,sort:u=null}={}){const l={limit:e,offset:t,q:n,filter:s,sort:u};return r.getAll("websites",l)},create({id:e="",data:t}){return r.create(`websites/${e}`,e,t)},get({id:e}){return r.get(`websites/${e}`)},update({id:e,data:t}){return r.put(`websites/${e}`,t)},delete({id:e}){return r.delete(`websites/${e}`)},downloadCSV({limit:e=null,offset:t=null,sort:n=null,expand:s=null,filter:u=null,q:l=null}={}){const o={params:{limit:e,offset:t,sort:n,expand:s,filter:u,q:l},headers:w};return r.download("websites",o)}}}class mr{constructor({apiHandler:e}){this.account=Ye({apiHandler:e}),this.amlChecks=_e({apiHandler:e}),this.aml=Qe({apiHandler:e}),this.apiKeys=Xe({apiHandler:e}),this.applicationInstances=Ze({apiHandler:e}),this.applications=He({apiHandler:e}),this.balanceTransactions=et({apiHandler:e}),this.billingPortals=tt({apiHandler:e}),this.blocklists=rt({apiHandler:e}),this.broadcastMessages=nt({apiHandler:e}),this.cashierCustomPropertySets=st({apiHandler:e}),this.cashierRequests=ut({apiHandler:e}),this.cashierStrategies=lt({apiHandler:e}),this.checkoutForms=ot({apiHandler:e}),this.coupons=ct({apiHandler:e}),this.credentialHashes=it({apiHandler:e}),this.creditMemos=at({apiHandler:e}),this.customDomains=gt({apiHandler:e}),this.customFields=mt({apiHandler:e}),this.customerAuthentication=ht({apiHandler:e}),this.customers=ft({apiHandler:e}),this.digitalWallets=$t({apiHandler:e}),this.disputes=pt({apiHandler:e}),this.emailDeliverySettings=yt({apiHandler:e}),this.emailMessages=At({apiHandler:e}),this.emailNotifications=bt({apiHandler:e}),this.events=Rt({apiHandler:e}),this.fees=dt({apiHandler:e}),this.files=wt({apiHandler:e}),this.gatewayAccounts=vt({apiHandler:e}),this.integrations=kt({apiHandler:e}),this.invoices=Tt({apiHandler:e}),this.journalAccounts=Et({apiHandler:e}),this.journalEntries=St({apiHandler:e}),this.kycDocuments=It({apiHandler:e}),this.kycRequests=Ct({apiHandler:e}),this.kycSettings=xt({apiHandler:e}),this.lists=jt({apiHandler:e}),this.memberships=Pt({apiHandler:e}),this.organizationExports=qt({apiHandler:e}),this.organizations=Mt({apiHandler:e}),this.paymentCardsBankNames=Ot({apiHandler:e}),this.paymentInstruments=Dt({apiHandler:e}),this.paymentMethods=Ft({apiHandler:e}),this.paymentTokens=Kt({apiHandler:e}),this.payoutRequests=Bt({apiHandler:e}),this.payouts=Nt({apiHandler:e}),this.plans=Vt({apiHandler:e}),this.previews=zt({apiHandler:e}),this.products=Lt({apiHandler:e}),this.profile=Ut({apiHandler:e}),this.purchase=Wt({apiHandler:e}),this.riskScoreRules=Jt({apiHandler:e}),this.roles=Gt({apiHandler:e}),this.search=Yt({apiHandler:e}),this.segments=_t({apiHandler:e}),this.sendThroughAttribution=Qt({apiHandler:e}),this.serviceCredentials=Xt({apiHandler:e}),this.shippingRates=Zt({apiHandler:e}),this.status=Ht({apiHandler:e}),this.subscriptionCancellations=er({apiHandler:e}),this.subscriptionPauses=tr({apiHandler:e}),this.subscriptionReactivations=rr({apiHandler:e}),this.subscriptions=nr({apiHandler:e}),this.tags=sr({apiHandler:e}),this.tagsRules=ur({apiHandler:e}),this.tracking=lr({apiHandler:e}),this.transactions=or({apiHandler:e}),this.usages=cr({apiHandler:e}),this.users=ir({apiHandler:e}),this.webhooks=ar({apiHandler:e}),this.websites=gr({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 hr({apiHandler:r}){return{getCustomerLifetimeSummaryMetrics({customerId:e}){return r.get(`customers/${e}/summary-metrics`)}}}function fr({apiHandler:r}){return{getAll({limit:e=null,offset:t=null,sort:n=null,expand:s=null,filter:u=null,q:l=null,criteria:o=null}={}){const g={limit:e,offset:t,sort:n,expand:s,filter:u,q:l,criteria:o};return r.getAll("data-exports",g)},queue({id:e="",data:t,expand:n=null}){const s={expand:n};return r.create(`data-exports/${e}`,e,t,s)},get({id:e,expand:t=null}){const n={expand:t};return r.get(`data-exports/${e}`,n)},update({id:e,data:t,expand:n=null}){const s={expand:n};return r.put(`data-exports/${e}`,t,s)},delete({id:e}){return r.delete(`data-exports/${e}`)}}}function $r({apiHandler:r}){return{getTransactionHistogramReport({periodStart:e,periodEnd:t,aggregationPeriod:n,metric:s,filter:u=null}){const l={periodStart:e,periodEnd:t,aggregationPeriod:n,metric:s,filter:u};return r.get("histograms/transactions",l)}}}function pr({apiHandler:r}){return{getApiLogSummary({periodStart:e,periodEnd:t,limit:n=null,offset:s=null}){const u={periodStart:e,periodEnd:t,limit:n,offset:s};return r.get("reports/api-log-summary",u)},getCumulativeSubscriptions({aggregationField:e,periodStart:t,periodEnd:n,limit:s=null,offset:u=null,filter:l=null}){const o={aggregationField:e,periodStart:t,periodEnd:n,limit:s,offset:u,filter:l};return r.get("reports/cumulative-subscriptions",o)},getDashboardMetrics({periodStart:e,periodEnd:t,metrics:n=null,segments:s=null}){const u={periodStart:e,periodEnd:t,metrics:n,segments:s};return r.get("reports/dashboard",u)},getDccMarkup({aggregationField:e,periodStart:t,periodEnd:n,limit:s=null,offset:u=null,filter:l=null}){const o={aggregationField:e,periodStart:t,periodEnd:n,limit:s,offset:u,filter:l};return r.get("reports/dcc-markup",o)},getDisputes({aggregationField:e,periodMonth:t,limit:n=null,offset:s=null,filter:u=null}){const l={aggregationField:e,periodMonth:t,limit:n,offset:s,filter:u};return r.get("reports/disputes",l)},getEventsTriggeredSummary({periodStart:e,periodEnd:t,limit:n=null,offset:s=null}){const u={periodStart:e,periodEnd:t,limit:n,offset:s};return r.get("reports/events-triggered",u)},getTriggeredEventRuleReport({eventType:e,periodStart:t,periodEnd:n,limit:s=null,offset:u=null}){const l={periodStart:t,periodEnd:n,limit:s,offset:u};return r.get(`reports/events-triggered/${e}/rules`,l)},getFutureRenewals({periodStart:e,periodEnd:t,limit:n=null,offset:s=null}){const u={periodStart:e,periodEnd:t,limit:n,offset:s};return r.get("reports/future-renewals",u)},getJournal({currency:e,bookedFrom:t=null,bookedTo:n=null,recognizedAt:s,aggregationField:u,limit:l=null,offset:o=null,filter:g=null}){const p={currency:e,bookedFrom:t,bookedTo:n,recognizedAt:s,aggregationField:u,limit:l,offset:o,filter:g};return r.get("reports/journal",p)},getKycAcceptanceSummary({periodStart:e,periodEnd:t}){const n={periodStart:e,periodEnd:t};return r.get("reports/kyc-acceptance-summary",n)},getKycRejectionSummary({periodStart:e,periodEnd:t}){const n={periodStart:e,periodEnd:t};return r.get("reports/kyc-rejection-summary",n)},getKycRequestSummary({periodStart:e,periodEnd:t}){const n={periodStart:e,periodEnd:t};return r.get("reports/kyc-request-summary",n)},getMonthlyRecurringRevenue({currency:e,periodStart:t,periodEnd:n,limit:s=null,offset:u=null}){const l={currency:e,periodStart:t,periodEnd:n,limit:s,offset:u};return r.get("reports/monthly-recurring-revenue",l)},getRenewalSales({periodStart:e,periodEnd:t,limit:n=null,offset:s=null}){const u={periodStart:e,periodEnd:t,limit:n,offset:s};return r.get("reports/renewal-sales",u)},getRetentionPercentage({aggregationField:e,aggregationPeriod:t,includeSwitchedSubscriptions:n=null,periodStart:s,periodEnd:u,limit:l=null,offset:o=null,filter:g=null,criteria:p=null}){const k={aggregationField:e,aggregationPeriod:t,includeSwitchedSubscriptions:n,periodStart:s,periodEnd:u,limit:l,offset:o,filter:g,criteria:p};return r.get("reports/retention-percentage",k)},getRetentionValue({aggregationField:e,aggregationPeriod:t,includeRefunds:n=null,includeDisputes:s=null,periodStart:u,periodEnd:l,limit:o=null,offset:g=null,filter:p=null,sort:k=null,criteria:F=null}){const K={aggregationField:e,aggregationPeriod:t,includeRefunds:n,includeDisputes:s,periodStart:u,periodEnd:l,limit:o,offset:g,filter:p,sort:k,criteria:F};return r.get("reports/retention-value",K)},getRevenueWaterfall({currency:e,issuedFrom:t,issuedTo:n,recognizedTo:s}){const u={currency:e,issuedFrom:t,issuedTo:n,recognizedTo:s};return r.get("reports/revenue-waterfall",u)},getRevenueAudit({filter:e=null,sort:t=null,limit:n=null,offset:s=null}){const u={filter:e,sort:t,limit:n,offset:s};return r.get("reports/revenue-audit",u)},getSubscriptionCancellation({periodStart:e,periodEnd:t,aggregationField:n,limit:s=null,offset:u=null,filter:l=null}){const o={periodStart:e,periodEnd:t,aggregationField:n,limit:s,offset:u,filter:l};return r.get("reports/subscription-cancellation",o)},getSubscriptionRenewal({periodStart:e,periodEnd:t,limit:n=null,offset:s=null}){const u={periodStart:e,periodEnd:t,limit:n,offset:s};return r.get("reports/subscription-renewal",u)},getTimeSeriesTransaction({type:e,subaggregate:t,periodStart:n,periodEnd:s,limit:u=null,offset:l=null}){const o={type:e,subaggregate:t,periodStart:n,periodEnd:s,limit:u,offset:l};return r.get("reports/time-series-transaction",o)},getTransactionsTimeDispute({aggregationField:e,periodStart:t,periodEnd:n,limit:s=null,offset:u=null,filter:l=null}){const o={aggregationField:e,periodStart:t,periodEnd:n,limit:s,offset:u,filter:l};return r.get("reports/transactions-time-dispute",o)},getTransactions({periodStart:e,periodEnd:t,aggregationField:n,limit:s=null,offset:u=null,filter:l=null}){const o={periodStart:e,periodEnd:t,aggregationField:n,limit:s,offset:u,filter:l};return r.get("reports/transactions",o)}}}function yr({apiHandler:r}){return{getSubscriptionSummaryMetrics({subscriptionId:e}){return r.get(`subscriptions/${e}/summary-metrics`)}}}function Ar({apiHandler:r}){return{getActivityFeed({eventTypes:e=null,limit:t=1e3,offset:n=0}){const s={eventTypes:e,limit:t,offset:n};return r.getAll("activity-feed",s)},getTransaction({id:e="",eventTypes:t=null,limit:n=1e3,offset:s=0}){const u={eventTypes:t,limit:n,offset:s};return r.getAll(`transactions/${e}/timeline`,u)},getCustomer({id:e="",eventTypes:t=null,limit:n=1e3,offset:s=0}){const u={eventTypes:t,limit:n,offset:s};return r.getAll(`customers/${e}/timeline`,u)}}}function br({apiHandler:r}){return{query(){return r.get("location")}}}const v={CustomersResource:hr,DataExportsResource:fr,HistogramsResource:$r,ReportsResource:pr,SubscriptionsResource:yr,TimelinesResource:Ar,LocationResource:br};class Rr{constructor({apiHandler:e}){this.customers=v.CustomersResource({apiHandler:e}),this.dataExports=v.DataExportsResource({apiHandler:e}),this.histograms=v.HistogramsResource({apiHandler:e}),this.reports=v.ReportsResource({apiHandler:e}),this.subscriptions=v.SubscriptionsResource({apiHandler:e}),this.timelines=v.TimelinesResource({apiHandler:e}),this.location=v.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 dr({apiHandler:r}){return{get({expand:e=null}={}){const t={expand:e};return r.get("account",t)},update({data:e}){return r.patch("account",e)},requestPasswordReset({data:e}){return r.post("account/forgot-password",e)},changePassword({data:e}){return r.patch("account/password",e)},resendEmailVerification({data:e}){return r.post("account/resend-verification",e)},confirmPasswordReset({token:e,data:t}){return r.post(`account/reset-password/${e}`,t)},verifyEmail({token:e}){return r.post(`account/verification/${e}`)},register({data:e}){return r.post("register",e)}}}function wr({apiHandler:r}){return{login({data:e}){return r.post("login",e)},logout(){return r.post("logout")}}}function vr({apiHandler:r}){return{get({slug:e}){return r.get(`billing-portals/${e}`)}}}function kr({apiHandler:r}){return{create({data:e}){return r.post("cashier-deposit",e)}}}function Tr({apiHandler:r}){return{get({id:e,expand:t=null}){const n={expand:t};return r.get(`cashier-requests/${e}`,n)}}}function Er({apiHandler:r}){return{get({id:e}){return r.get(`checkout-forms/${e}`)}}}function Sr({apiHandler:r}){return{getAll({filter:e=null,sort:t=null,limit:n=null,offset:s=null,q:u=null}={}){const l={filter:e,sort:t,limit:n,offset:s,q:u};return r.getAll("invoices",l)},get({id:e}){return r.get(`invoices/${e}`)},downloadPDF({id:e}){const t={headers:G,responseType:"arraybuffer"};return r.download(`invoices/${e}`,t)}}}function Ir({apiHandler:r}){return{getAll({limit:e=null,offset:t=null}={}){const n={limit:e,offset:t};return r.getAll("kyc-documents",n)},create({data:e}){return r.post("kyc-documents",e)},get({id:e}){return r.get(`kyc-documents/${e}`)},update({id:e,data:t}){return r.patch(`kyc-documents/${e}`,t)}}}function Cr({apiHandler:r}){return{get({id:e,expand:t=null}){const n={expand:t};return r.get(`kyc-requests/${e}`,n)}}}function xr({apiHandler:r}){return{getAll({filter:e=null,sort:t=null,limit:n=null,offset:s=null,q:u=null}={}){const l={filter:e,sort:t,limit:n,offset:s,q:u};return r.getAll("orders",l)},get({id:e}){return r.get(`orders/${e}`)},update({id:e,data:t}){return r.patch(`orders/${e}`,t)},cancel({id:e,data:t}){return r.post(`orders/${e}/cancellation`,t)},pause({id:e,data:t}){return r.post(`orders/${e}/pause`,t)}}}function jr({apiHandler:r}){return{getAll({filter:e=null,sort:t=null,limit:n=null,offset:s=null,q:u=null}={}){const l={filter:e,sort:t,limit:n,offset:s,q:u};return r.getAll("payment-instruments",l)},create({data:e}){return r.post("payment-instruments",e)},get({id:e,limit:t=null,offset:n=null}){const s={limit:t,offset:n};return r.get(`payment-instruments/${e}`,s)},update({id:e,data:t}){return r.patch(`payment-instruments/${e}`,t)},deactivate({id:e}){return r.post(`payment-instruments/${e}/deactivation`)},getSetupTransaction({id:e}){return r.get(`payment-instruments/${e}/setup`)},setup({id:e,data:t}){return r.post(`payment-instruments/${e}/setup`,t)}}}function Pr({apiHandler:r}){return{getAll({filter:e=null,sort:t=null,limit:n=null,offset:s=null,q:u=null}={}){const l={filter:e,sort:t,limit:n,offset:s,q:u};return r.getAll("payout-requests",l)},get({id:e}){return r.get(`payout-requests/${e}`)},update({id:e,data:t}){return r.patch(`payout-requests/${e}`,t)}}}function qr({apiHandler:r}){return{getAll({filter:e=null,sort:t=null,limit:n=null,offset:s=null,q:u=null,expand:l=null}={}){const o={filter:e,sort:t,limit:n,offset:s,q:u,expand:l};return r.getAll("plans",o)},get({id:e,expand:t=null}){const n={expand:t};return r.get(`plans/${e}`,n)}}}function Mr({apiHandler:r}){return{getAll({filter:e=null,sort:t=null,limit:n=null,offset:s=null,q:u=null}={}){const l={filter:e,sort:t,limit:n,offset:s,q:u};return r.getAll("products",l)},get({id:e}){return r.get(`products/${e}`)}}}function Or({apiHandler:r}){return{payment({data:e}){return r.post("payment",e)},purchase({data:e}){return r.post("purchase",e)},preview({data:e}){return r.post("preview-purchase",e)},readyToPay({data:e}){return r.post("ready-to-pay",e)}}}function Dr({apiHandler:r}){return{getAll({limit:e=null,offset:t=null,filter:n=null,q:s=null,sort:u=null}={}){const l={limit:e,offset:t,filter:n,q:s,sort:u};return r.getAll("transactions",l)},get({id:e}){return r.get(`transactions/${e}`)},finishKyc({id:e,token:t}){return r.post(`transactions/${e}/${t}/continue`)},skipKyc({id:e,token:t}){return r.post(`transactions/${e}/${t}/bypass`)},update({id:e,data:t}){return r.patch(`transactions/${e}`,t)}}}function Fr({apiHandler:r}){return{get({id:e}){return r.get(`websites/${e}`)}}}class Kr{constructor({apiHandler:e}){this.account=dr({apiHandler:e}),this.authorization=wr({apiHandler:e}),this.billingPortals=vr({apiHandler:e}),this.cashierDeposit=kr({apiHandler:e}),this.cashierRequests=Tr({apiHandler:e}),this.checkoutForms=Er({apiHandler:e}),this.invoices=Sr({apiHandler:e}),this.kycDocuments=Ir({apiHandler:e}),this.kycRequests=Cr({apiHandler:e}),this.orders=xr({apiHandler:e}),this.paymentInstruments=jr({apiHandler:e}),this.payoutRequests=Pr({apiHandler:e}),this.plans=qr({apiHandler:e}),this.products=Mr({apiHandler:e}),this.purchase=Or({apiHandler:e}),this.transactions=Dr({apiHandler:e}),this.websites=Fr({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 Br({apiHandler:r}){return new mr({apiHandler:r})}function Nr({apiHandler:r}){return new Rr({apiHandler:r})}function Vr({apiHandler:r}){return new Kr({apiHandler:r})}const O={live:"https://api.rebilly.com",sandbox:"https://api-sandbox.rebilly.com"},D=6e3;function Y({apiKey:r=null,sandbox:e=!1,timeout:t=D,organizationId:n=null,urls:s=O}={}){if(!s.live||!s.sandbox)throw new Error("RebillyAPI urls config must include a key for both `live` and `sandbox`");if(typeof s.live!="string"||typeof s.sandbox!="string")throw new Error("RebillyAPI urls config `live` and `sandbox` must be strings");const l=M({options:{apiEndpoints:s,apiKey:r,apiVersion:"",isSandbox:e,requestTimeout:t,jwt:null,organizationId:n}});return Br({apiHandler:l})}function zr({apiKey:r=null,sandbox:e=!1,timeout:t=D,organizationId:n=null,urls:s=O}={}){if(!s.live||!s.sandbox)throw new Error("RebillyAPI urls config must include a key for both `live` and `sandbox`");if(typeof s.live!="string"||typeof s.sandbox!="string")throw new Error("RebillyAPI urls config `live` and `sandbox` must be strings");const l=M({options:{apiEndpoints:s,apiKey:r,apiVersion:"experimental",isSandbox:e,requestTimeout:t,jwt:null,organizationId:n}});return Nr({apiHandler:l})}function Lr({publishableKey:r=null,jwt:e=null,sandbox:t=!1,timeout:n=D,organizationId:s=null,urls:u=O}={}){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 l={apiEndpoints:u,publishableKey:r,jwt:e,apiVersion:"storefront",isSandbox:t,requestTimeout:n,organizationId:s},o=M({options:l});return o.setSessionToken(l.jwt),Vr({apiHandler:o})}m.RebillyAPI=Y,m.RebillyErrors=y,m.RebillyExperimentalAPI=zr,m.RebillyStorefrontAPI=Lr,m.cancellation=Ge,m.default=Y,Object.defineProperties(m,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}})});
|
|
36
|
+
*/var qe=Pe,Me=Object.prototype.hasOwnProperty,Oe=function(e,t,n){qe(e,function(s,u){if(Me.call(e,u))return t.call(n,e[u],u,e)})},De=pe,Fe=Ie,Ke=xe,Be=Oe;function q(r,e){switch(Ke(r)){case"object":return Ne(r,e);case"array":return Ve(r,e);default:return Fe(r)}}function Ne(r,e){if(De(r)){var t={};return Be(r,function(n,s){this[s]=q(n,e)},t),t}else return e?e(r):r}function Ve(r,e){for(var t=r.length,n=[],s=-1;++s<t;)n[s]=q(r[s],e);return n}var ze=q;const Le="48.5.0";let Ue="useandom-26T198340PX75pxJACKVERYMINDBUSHWOLF_GQZbfghjklqvwyzrict",We=(r=21)=>{let e="",t=r;for(;t--;)e+=Ue[Math.random()*64|0];return e};class Je{constructor({id:e=null,created:t=null}={}){this.id=e||We(),this.created=t||new Date().getTime(),this.cancelSource=P.default.CancelToken.source(),this.cancel=this.cancelSource.cancel,this.cancelToken=this.cancelSource.token,x(this,{exclude:["cancelSource","cancelToken","cancel"]})}}class S{constructor(){if(S.instance)return S.instance;this.requests={},S.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 Je;return this.requests[e.id]=e,{id:e.id,cancelToken:e.cancelToken}}}var E=new S;class j{}N(j,"cancelById",(e,t)=>{try{E.getById(e).cancel(t),E.deleteById(e)}catch{}}),N(j,"cancelAll",e=>E.getAll().forEach(t=>{t.cancel(e),E.deleteById(t.id)}));var Ge={cancelAll:(...r)=>j.cancelAll(...r)};const d={request:"request",response:"response"},J=r=>{if(!Object.values(d).includes(r))throw new Error(`There is no such interceptor type as "${r}"`);return!0};function M({options:r}){const e=t();function t(){return P.default.create(s())}function n(){return e}function s(){return{baseURL:u(),timeout:r.requestTimeout,headers:l()}}function u(){let c=r.isSandbox?r.apiEndpoints.sandbox:r.apiEndpoints.live;return r.apiVersion&&(c=`${c}/${r.apiVersion}`),r.organizationId&&(c=`${c}/organizations/${r.organizationId}`),`${c}`}function l(){const c={"REB-API-CONSUMER":`RebillySDK/JS-SDK ${Le}`};return r.apiKey&&(c["REB-APIKEY"]=r.apiKey),c}function o(){return ze(e.defaults.headers)}function g(c){r.requestTimeout=Number(c),e.defaults.timeout=r.requestTimeout}function p(c=r.jwt){const i=o();r.apiKey=null,r.jwt=c,delete i.common["REB-APIKEY"],i.common.Authorization=`Bearer ${c}`,e.defaults.headers=i}function k(c=r.publishableKey){const i=o();r.publishableKey=c,i.common.Authorization=`${c}`,e.defaults.headers=i}function F({host:c,port:i,auth:a}){e.defaults.proxy={host:c,port:i,auth:a}}function K({live:c=null,sandbox:i=null}){c&&(r.apiEndpoints.live=c),i&&(r.apiEndpoints.sandbox=i),e.defaults.baseURL=u()}function _(c,{thenDelegate:i,catchDelegate:a=()=>{}}){return J(c)&&e.interceptors[d[c]].use(i,a)}function Q(c,i){return J(c)&&e.interceptors[d[c]].eject(i)}function Ur({thenDelegate:c,catchDelegate:i=()=>{}}){return _(d.request,{thenDelegate:c,catchDelegate:i})}function Wr(c){Q(d.request,c)}function Jr({thenDelegate:c,catchDelegate:i=()=>{}}){return _(d.response,{thenDelegate:c,catchDelegate:i})}function Gr(c){Q(d.response,c)}function T({request:c,isCollection:i,config:a}){const f=Z(a),{id:b,cancelToken:rn}=E.save();f.cancelToken=rn;const re=async function(){try{const I=await c(f);return Yr({response:I,isCollection:i,config:f})}catch(I){return X({error:I,config:f})}finally{E.deleteById(b)}}();return re.cancel=I=>j.cancelById(b,I),re}function Yr({response:c,isCollection:i,config:a}){return i?new se(c,a):new V(c,a)}function X({error:c}){if(P.default.isCancel(c))throw new y.RebillyCanceledError(c);if(c.response)switch(Number(c.response.status)){case 401:throw new y.RebillyForbiddenError(c);case 404:throw new y.RebillyNotFoundError(c);case 405:throw new y.RebillyMethodNotAllowedError(c);case 409:throw new y.RebillyConflictError(c);case 422:throw new y.RebillyValidationError(c);default:throw new y.RebillyRequestError(c)}throw c.code==="ECONNABORTED"?new y.RebillyTimeoutError(c):new y.RebillyRequestError(c)}function _r(c){return c.params!==void 0&&(c.params=Object.keys(c.params).filter(i=>c.params[i]!==null&&c.params[i]!=="").reduce((i,a)=>(i[a]=c.params[a],i),{})),c}function Z(c={}){const i=_r(c);return C({},i)}function H(c,i={}){return T({request:a=>e.get(c,a),config:{params:i}})}function Qr(c,i){return T({request:a=>e.get(c,a),config:{params:i},isCollection:!0})}function ee(c,i,a={}){let f={};return a.authenticate===!1&&(f={headers:o()},delete f.headers.common["REB-APIKEY"],delete f.headers.common.Authorization),a.params&&(f.params=C({},a.params)),T({request:b=>e.post(c,i,b),config:f})}function te(c,i,a={}){return T({request:f=>e.put(c,i,f),config:{params:a}})}function Xr(c,i){return T({request:a=>e.patch(c,i,a),config:{}})}function Zr(c){return T({request:i=>e.delete(c,i),config:{}})}function Hr(c,i){return T({request:a=>e.delete(c,a),config:{data:C({},i)}})}async function en(c,i,a,f={}){if(i==="")return ee(c,a,{params:f});try{if((await H(c)).response.status===200)throw new y.RebillyConflictError({message:"Member already exists. Please use a different ID."})}catch(b){if(b.name==="RebillyNotFoundError")return te(c,a,f);throw b}}async function tn(c,i){const a=Z(i);try{const f=await e.get(c,a);return new ue(f,a)}catch(f){return X({error:f,config:a})}}return{getInstance:n,addRequestInterceptor:Ur,removeRequestInterceptor:Wr,addResponseInterceptor:Jr,removeResponseInterceptor:Gr,setTimeout:g,setProxyAgent:F,setSessionToken:p,setPublishableKey:k,setEndpoints:K,get:H,getAll:Qr,post:ee,put:te,patch:Xr,delete:Zr,deleteAll:Hr,create:en,download:tn}}function Ye({apiHandler:r}){return{activate({token:e}){return r.post(`activation/${e}`,{authenticate:!1})},forgotPassword({data:e}){return r.post("forgot-password",e,{authenticate:!1})},logout(){return r.post("logout")},signIn({data:e}){return r.post("signin",e,{authenticate:!1})},signUp({data:e}){return r.post("signup",e,{authenticate:!1})}}}function _e({apiHandler:r}){return{getAll({limit:e=null,offset:t=null,sort:n=null,filter:s=null,q:u=null}={}){const l={limit:e,offset:t,sort:n,filter:s,q:u};return r.getAll("aml-checks",l)},get({id:e}){return r.get(`aml-checks/${e}`)},review({id:e,data:t}){return r.post(`aml-checks/${e}/review`,t)}}}function Qe({apiHandler:r}){return{getAll({firstName:e,lastName:t,dob:n=null,country:s=null}){const u={firstName:e,lastName:t,dob:n,country:s};return r.get("aml",u)}}}function Xe({apiHandler:r}){return{getAll({limit:e=null,offset:t=null,sort:n=null}={}){const s={limit:e,offset:t,sort:n};return r.getAll("api-keys",s)},create({id:e="",data:t}){return r.create(`api-keys/${e}`,e,t)},get({id:e}){return r.get(`api-keys/${e}`)},update({id:e,data:t}){return r.put(`api-keys/${e}`,t)},delete({id:e}){return r.delete(`api-keys/${e}`)}}}function Ze({apiHandler:r}){return{get({applicationId:e}){return r.get(`application-instances/${e}`)},upsert({applicationId:e,data:t}){return r.put(`application-instances/${e}`,t)},delete({applicationId:e}){return r.delete(`application-instances/${e}`)}}}function He({apiHandler:r}){return{getAll({limit:e=null,offset:t=null,filter:n=null,q:s=null,expand:u=null,fields:l=null,sort:o=null}={}){const g={limit:e,offset:t,filter:n,q:s,expand:u,fields:l,sort:o};return r.getAll("applications",g)},create({data:e}){return r.post("applications",e)},get({id:e}){return r.get(`applications/${e}`)},getInstances({id:e,limit:t=null,offset:n=null}){const s={limit:t,offset:n};return r.getAll(`applications/${e}/instances`,s)},getInstance({id:e,organizationId:t}){return r.get(`applications/${e}/instances/${t}`)}}}function et({apiHandler:r}){return{getAll({limit:e=null,offset:t=null}={}){const n={limit:e,offset:t};return r.getAll("balance-transactions",n)},get({id:e}){return r.get(`balance-transactions/${e}`)}}}function tt({apiHandler:r}){return{getAll({limit:e=null,offset:t=null,sort:n=null,filter:s=null,q:u=null}={}){const l={limit:e,offset:t,sort:n,filter:s,q:u};return r.getAll("billing-portals",l)},create({id:e="",data:t}){return r.create(`billing-portals/${e}`,e,t)},get({id:e}){return r.get(`billing-portals/${e}`)},update({id:e,data:t}){return r.put(`billing-portals/${e}`,t)},delete({id:e}){return r.delete(`billing-portals/${e}`)}}}function rt({apiHandler:r}){return{getAll({limit:e=null,offset:t=null,sort:n=null,filter:s=null,q:u=null}={}){const l={limit:e,offset:t,sort:n,filter:s,q:u};return r.getAll("blocklists",l)},create({id:e="",data:t}){return r.create(`blocklists/${e}`,e,t)},get({id:e}){return r.get(`blocklists/${e}`)},delete({id:e}){return r.delete(`blocklists/${e}`)}}}function nt({apiHandler:r}){return{getAll({limit:e=null,offset:t=null,sort:n=null,filter:s=null}={}){const u={limit:e,offset:t,sort:n,filter:s};return r.getAll("broadcast-messages",u)},create({data:e}){return r.post("broadcast-messages",e)},get({id:e}){return r.get(`broadcast-messages/${e}`)},delete({id:e}){return r.delete(`broadcast-messages/${e}`)},update({id:e,data:t}){return r.patch(`broadcast-messages/${e}`,t)}}}function st({apiHandler:r}){return{getAll({limit:e=null,offset:t=null,filter:n=null,sort:s=null}={}){const u={limit:e,offset:t,filter:n,sort:s};return r.getAll("cashier-custom-property-sets",u)},create({id:e="",data:t}){return r.create(`cashier-custom-property-sets/${e}`,e,t)},get({id:e}){return r.get(`cashier-custom-property-sets/${e}`)},update({id:e,data:t}){return r.put(`cashier-custom-property-sets/${e}`,t)},delete({id:e}){return r.delete(`cashier-custom-property-sets/${e}`)}}}function ut({apiHandler:r}){return{getAll({limit:e=null,offset:t=null,filter:n=null,sort:s=null}={}){const u={limit:e,offset:t,filter:n,sort:s};return r.getAll("cashier-requests",u)},create({data:e}){return r.post("cashier-requests",e)},get({id:e,expand:t=null}){const n={expand:t};return r.get(`cashier-requests/${e}`,n)}}}function lt({apiHandler:r}){return{getAll({limit:e=null,offset:t=null,filter:n=null,sort:s=null}={}){const u={limit:e,offset:t,filter:n,sort:s};return r.getAll("cashier-strategies",u)},create({id:e="",data:t}){return r.create(`cashier-strategies/${e}`,e,t)},get({id:e}){return r.get(`cashier-strategies/${e}`)},update({id:e,data:t}){return r.put(`cashier-strategies/${e}`,t)},delete({id:e}){return r.delete(`cashier-strategies/${e}`)}}}function ot({apiHandler:r}){return{getAll({limit:e=null,offset:t=null,sort:n=null,filter:s=null,q:u=null}={}){const l={limit:e,offset:t,sort:n,filter:s,q:u};return r.getAll("checkout-forms",l)},create({id:e="",data:t}){return r.create(`checkout-forms/${e}`,e,t)},get({id:e}){return r.get(`checkout-forms/${e}`)},update({id:e,data:t}){return r.put(`checkout-forms/${e}`,t)},delete({id:e}){return r.delete(`checkout-forms/${e}`)}}}function ct({apiHandler:r}){return{getAllRedemptions({limit:e=null,offset:t=null,filter:n=null,q:s=null,sort:u=null}={}){const l={limit:e,offset:t,filter:n,q:s,sort:u};return r.getAll("coupons-redemptions",l)},redeem({data:e}){return r.post("coupons-redemptions",e)},getRedemption({id:e}){return r.get(`coupons-redemptions/${e}`)},cancelRedemption({id:e}){return r.post(`coupons-redemptions/${e}/cancel`)},getAll({limit:e=null,offset:t=null,filter:n=null,q:s=null,sort:u=null}={}){const l={limit:e,offset:t,filter:n,q:s,sort:u};return r.getAll("coupons",l)},create({id:e="",data:t}){return r.create(`coupons/${e}`,e,t)},get({id:e}){return r.get(`coupons/${e}`)},update({id:e,data:t}){return r.put(`coupons/${e}`,t)},setExpiration({id:e,data:t}){return r.post(`coupons/${e}/expiration`,t)}}}function it({apiHandler:r}){return{createAWSSESCredential({data:e}){return r.post("credential-hashes/aws-ses",e)},getAWSSESCredential({hash:e}){return r.get(`credential-hashes/aws-ses/${e}`)},updateAWSSESCredential({hash:e,data:t}){return r.patch(`credential-hashes/aws-ses/${e}`,t)},createEmailCredential({data:e}){return r.post("credential-hashes/emails",e)},getEmailCredential({hash:e}){return r.get(`credential-hashes/emails/${e}`)},patchEmailCredential({hash:e,data:t}){return r.patch(`credential-hashes/emails/${e}`,t)},createMailgunCredential({data:e}){return r.post("credential-hashes/mailgun",e)},getMailgunCredential({hash:e}){return r.get(`credential-hashes/mailgun/${e}`)},patchMailgunCredential({hash:e,data:t}){return r.patch(`credential-hashes/mailgun/${e}`,t)},getAllOAuth2Credentials({filter:e=null,limit:t=null,offset:n=null,sort:s=null,q:u=null}={}){const l={filter:e,limit:t,offset:n,sort:s,q:u};return r.getAll("credential-hashes/oauth2",l)},createOAuth2Credential({data:e}){return r.post("credential-hashes/oauth2",e)},getOAuth2Credential({hash:e}){return r.get(`credential-hashes/oauth2/${e}`)},updateOAuth2Credential({hash:e,data:t}){return r.patch(`credential-hashes/oauth2/${e}`,t)},getOAuth2CredentialItems({hash:e,limit:t=null,offset:n=null,filter:s=null,q:u=null,fields:l=null,sort:o=null}){const g={limit:t,offset:n,filter:s,q:u,fields:l,sort:o};return r.getAll(`credential-hashes/oauth2/${e}/items`,g)},getAllPlaidCredentials({filter:e=null,limit:t=null,offset:n=null,sort:s=null,q:u=null}={}){const l={filter:e,limit:t,offset:n,sort:s,q:u};return r.getAll("credential-hashes/plaid",l)},createPlaidCredential({data:e}){return r.post("credential-hashes/plaid",e)},getPlaidCredential({hash:e}){return r.get(`credential-hashes/plaid/${e}`)},updatePlaidCredential({hash:e,data:t}){return r.patch(`credential-hashes/plaid/${e}`,t)},createPostmarkCredential({data:e}){return r.post("credential-hashes/postmark",e)},getPostmarkCredential({hash:e}){return r.get(`credential-hashes/postmark/${e}`)},patchPostmarkCredential({hash:e,data:t}){return r.patch(`credential-hashes/postmark/${e}`,t)},createSendGridCredential({data:e}){return r.post("credential-hashes/sendgrid",e)},getSendGridCredential({hash:e}){return r.get(`credential-hashes/sendgrid/${e}`)},patchSendGridCredential({hash:e,data:t}){return r.patch(`credential-hashes/sendgrid/${e}`,t)},createWebhookCredential({data:e}){return r.post("credential-hashes/webhooks",e)},getWebhookCredential({hash:e}){return r.get(`credential-hashes/webhooks/${e}`)},patchWebhookCredential({hash:e,data:t}){return r.patch(`credential-hashes/webhooks/${e}`,t)},getAllExperianCredentials({filter:e=null,limit:t=null,offset:n=null,sort:s=null,q:u=null}={}){const l={filter:e,limit:t,offset:n,sort:s,q:u};return r.getAll("credential-hashes/experian",l)},createExperianCredential({data:e}){return r.post("credential-hashes/experian",e)},getExperianCredential({hash:e}){return r.get(`credential-hashes/experian/${e}`)},updateExperianCredential({hash:e,data:t}){return r.patch(`credential-hashes/experian/${e}`,t)},getAllTaxJarCredentials({filter:e=null,limit:t=null,offset:n=null,sort:s=null,q:u=null}={}){const l={filter:e,limit:t,offset:n,sort:s,q:u};return r.getAll("credential-hashes/taxjar",l)},createTaxJarCredential({data:e}){return r.post("credential-hashes/taxjar",e)},getTaxJarCredential({hash:e}){return r.get(`credential-hashes/taxjar/${e}`)},updateTaxJarCredential({hash:e,data:t}){return r.patch(`credential-hashes/taxjar/${e}`,t)},getAllAvalaraCredentials({filter:e=null,limit:t=null,offset:n=null,sort:s=null,q:u=null}={}){const l={filter:e,limit:t,offset:n,sort:s,q:u};return r.getAll("credential-hashes/avalara",l)},createAvalaraCredential({data:e}){return r.post("credential-hashes/avalara",e)},getAvalaraCredential({hash:e}){return r.get(`credential-hashes/avalara/${e}`)},updateAvalaraCredential({hash:e,data:t}){return r.patch(`credential-hashes/avalara/${e}`,t)}}}function at({apiHandler:r}){return{getAll({filter:e=null,sort:t=null,limit:n=null,offset:s=null,q:u=null}={}){const l={filter:e,sort:t,limit:n,offset:s,q:u};return r.getAll("credit-memos",l)},create({id:e="",data:t}){return r.create(`credit-memos/${e}`,e,t)},get({id:e}){return r.get(`credit-memos/${e}`)},update({id:e,data:t}){return r.put(`credit-memos/${e}`,t)},patch({id:e,data:t}){return r.patch(`credit-memos/${e}`,t)},void({id:e}){return r.post(`credit-memos/${e}/void`)},getAllTimelineMessages({id:e,limit:t=null,offset:n=null,filter:s=null,sort:u=null,q:l=null}){const o={limit:t,offset:n,filter:s,sort:u,q:l};return r.getAll(`credit-memos/${e}/timeline`,o)},createTimelineComment({id:e,data:t}){return r.post(`credit-memos/${e}/timeline`,t)},getTimelineMessage({id:e,messageId:t}){return r.get(`credit-memos/${e}/timeline/${t}`)},deleteTimelineMessage({id:e,messageId:t}){return r.delete(`credit-memos/${e}/timeline/${t}`)}}}function gt({apiHandler:r}){return{getAll({limit:e=null,offset:t=null,sort:n=null,filter:s=null,q:u=null}={}){const l={limit:e,offset:t,sort:n,filter:s,q:u};return r.getAll("custom-domains",l)},create({data:e}){return r.post("custom-domains",e)},get({domain:e}){return r.get(`custom-domains/${e}`)},delete({domain:e}){return r.delete(`custom-domains/${e}`)}}}function mt({apiHandler:r}){return{getAll({resource:e,limit:t=null,offset:n=null}){const s={limit:t,offset:n};return r.getAll(`custom-fields/${e}`,s)},get({resource:e,name:t}){return r.get(`custom-fields/${e}/${t}`)},create({resource:e,name:t,data:n}){return r.put(`custom-fields/${e}/${t}`,n)},update({resource:e,name:t,data:n}){return r.put(`custom-fields/${e}/${t}`,n)}}}function ht({apiHandler:r}){return{getAuthOptions(){return r.get("authentication-options")},updateAuthOptions({data:e}){return r.put("authentication-options",e)},getAllAuthTokens({limit:e=null,offset:t=null}={}){const n={limit:e,offset:t};return r.getAll("authentication-tokens",n)},login({data:e}){return r.post("authentication-tokens",e)},verify({token:e}){return r.get(`authentication-tokens/${e}`)},logout({token:e}){return r.delete(`authentication-tokens/${e}`)},exchangeToken({token:e,data:t}){return r.post(`authentication-tokens/${e}/exchange`,t)},getAllCredentials({limit:e=null,offset:t=null}={}){const n={limit:e,offset:t};return r.getAll("credentials",n)},createCredential({id:e="",data:t}){return r.create(`credentials/${e}`,e,t)},getCredential({id:e}){return r.get(`credentials/${e}`)},updateCredential({id:e,data:t}){return r.put(`credentials/${e}`,t)},deleteCredential({id:e}){return r.delete(`credentials/${e}`)},getAllResetPasswordTokens({limit:e=null,offset:t=null}={}){const n={limit:e,offset:t};return r.getAll("password-tokens",n)},createResetPasswordToken({data:e}){return r.post("password-tokens",e)},getResetPasswordToken({id:e}){return r.get(`password-tokens/${e}`)},deleteResetPasswordToken({id:e}){return r.delete(`password-tokens/${e}`)}}}const w={Accept:"text/csv"},G={Accept:"application/pdf"};function ft({apiHandler:r}){return{getAll({limit:e=null,offset:t=null,filter:n=null,q:s=null,expand:u=null,fields:l=null,sort:o=null}={}){const g={limit:e,offset:t,filter:n,q:s,expand:u,fields:l,sort:o};return r.getAll("customers",g)},create({id:e="",data:t,expand:n=null}){const s={expand:n};return r.create(`customers/${e}`,e,t,s)},get({id:e,expand:t=null,fields:n=null}){const s={expand:t,fields:n};return r.get(`customers/${e}`,s)},update({id:e,data:t,expand:n=null}){const s={expand:n};return r.put(`customers/${e}`,t,s)},merge({id:e,targetCustomerId:t}){return r.delete(`customers/${e}?targetCustomerId=${t}`)},getAml({id:e}){return r.get(`customers/${e}/aml`)},getLeadSource({id:e}){return r.get(`customers/${e}/lead-source`)},createLeadSource({id:e,data:t}){return r.put(`customers/${e}/lead-source`,t)},updateLeadSource({id:e,data:t}){return r.put(`customers/${e}/lead-source`,t)},deleteLeadSource({id:e}){return r.delete(`customers/${e}/lead-source`)},getAllTimelineMessages({id:e,limit:t=null,offset:n=null,filter:s=null,sort:u=null,q:l=null}){const o={limit:t,offset:n,filter:s,sort:u,q:l};return r.getAll(`customers/${e}/timeline`,o)},createTimelineComment({id:e,data:t}){return r.post(`customers/${e}/timeline`,t)},getTimelineMessage({id:e,messageId:t}){return r.get(`customers/${e}/timeline/${t}`)},deleteTimelineMessage({id:e,messageId:t}){return r.delete(`customers/${e}/timeline/${t}`)},getCustomerEddScore({id:e}){return r.get(`customers/${e}/edd-score`)},patchCustomerEddScore({id:e,data:t}){return r.patch(`customers/${e}/edd-score`,t)},getEddTimelineCollection({id:e,limit:t=null,offset:n=null,filter:s=null,sort:u=null,q:l=null}){const o={limit:t,offset:n,filter:s,sort:u,q:l};return r.getAll(`customers/${e}/edd-timeline`,o)},createEddTimelineComment({id:e,data:t}){return r.post(`customers/${e}/edd-timeline`,t)},getEddTimelineMessage({id:e,messageId:t}){return r.get(`customers/${e}/edd-timeline/${t}`)},deleteEddTimelineMessage({id:e,messageId:t}){return r.delete(`customers/${e}/edd-timeline/${t}`)},getAllEddSearchResults({id:e,limit:t=null,offset:n=null}){const s={limit:t,offset:n};return r.getAll(`customers/${e}/edd-search-results`,s)},getEddSearchResult({id:e,searchResultId:t}){return r.get(`customers/${e}/edd-search-results/${t}`)},downloadCSV({limit:e=null,offset:t=null,sort:n=null,expand:s=null,filter:u=null,q:l=null}={}){const o={params:{limit:e,offset:t,sort:n,expand:s,filter:u,q:l},headers:w};return r.download("customers",o)}}}function $t({apiHandler:r}){return{create({data:e}){return r.post("digital-wallets/onboarding/apple-pay",e)},validate({data:e}){return r.post("digital-wallets/validation",e)}}}function pt({apiHandler:r}){return{getAll({filter:e=null,sort:t=null,limit:n=null,offset:s=null,q:u=null,expand:l=null}={}){const o={filter:e,sort:t,limit:n,offset:s,q:u,expand:l};return r.getAll("disputes",o)},create({id:e="",data:t,expand:n=null}){const s={expand:n};return r.create(`disputes/${e}`,e,t,s)},get({id:e}){return r.get(`disputes/${e}`)},update({id:e,data:t,expand:n=null}){const s={expand:n};return r.put(`disputes/${e}`,t,s)},downloadCSV({limit:e=null,offset:t=null,sort:n=null,expand:s=null,filter:u=null,q:l=null}={}){const o={params:{limit:e,offset:t,sort:n,expand:s,filter:u,q:l},headers:w};return r.download("disputes",o)}}}function yt({apiHandler:r}){return{verify({token:e}){return r.put(`email-delivery-setting-verifications/${e}`)},getAll({limit:e=null,offset:t=null,filter:n=null,sort:s=null,q:u=null}={}){const l={limit:e,offset:t,filter:n,sort:s,q:u};return r.getAll("email-delivery-settings",l)},create({data:e}){return r.post("email-delivery-settings",e)},get({id:e}){return r.get(`email-delivery-settings/${e}`)},delete({id:e}){return r.delete(`email-delivery-settings/${e}`)},update({id:e,data:t}){return r.patch(`email-delivery-settings/${e}`,t)},resendVerification({id:e}){return r.post(`email-delivery-settings/${e}/resend-email-verification`)}}}function At({apiHandler:r}){return{getAll({limit:e=null,offset:t=null,q:n=null,sort:s=null,filter:u=null}={}){const l={limit:e,offset:t,q:n,sort:s,filter:u};return r.getAll("email-messages",l)},create({data:e}){return r.post("email-messages",e)},get({id:e}){return r.get(`email-messages/${e}`)},delete({id:e}){return r.delete(`email-messages/${e}`)},send({id:e,data:t={status:"outbox"}}){return r.patch(`email-messages/${e}`,t)}}}function bt({apiHandler:r}){return{getAll({limit:e=null,offset:t=null}={}){const n={limit:e,offset:t};return r.getAll("email-notifications",n)}}}function Rt({apiHandler:r}){return{getAll(){return r.getAll("events")},get({eventType:e}){return r.get(`events/${e}`)},getRules({eventType:e}){return r.get(`events/${e}/rules`)},createRules({eventType:e,data:t}){return r.put(`events/${e}/rules`,t)},updateRules({eventType:e,data:t}){return r.put(`events/${e}/rules`,t)},getAllTimelineMessages({eventType:e,limit:t=null,offset:n=null,filter:s=null,sort:u=null,q:l=null}){const o={limit:t,offset:n,filter:s,sort:u,q:l};return r.getAll(`events/${e}/timeline`,o)},createTimelineComment({eventType:e,data:t}){return r.post(`events/${e}/timeline`,t)},getTimelineMessage({eventType:e,messageId:t}){return r.get(`events/${e}/timeline/${t}`)},deleteTimelineMessage({eventType:e,messageId:t}){return r.delete(`events/${e}/timeline/${t}`)},getRulesHistory({eventType:e,limit:t=null,offset:n=null,filter:s=null,q:u=null,sort:l=null,fields:o=null}){const g={limit:t,offset:n,filter:s,q:u,sort:l,fields:o};return r.getAll(`events/${e}/rules/history`,g)},getRulesVersionNumber({eventType:e,version:t,fields:n=null}){const s={fields:n};return r.get(`events/${e}/rules/history/${t}`,s)},getRulesVersionDetail({eventType:e,version:t,fields:n=null}){const s={fields:n};return r.get(`events/${e}/rules/versions/${t}`,s)},getAllDraftRulesets({eventType:e,limit:t=null,offset:n=null,filter:s=null,q:u=null,sort:l=null,fields:o=null}){const g={limit:t,offset:n,filter:s,q:u,sort:l,fields:o};return r.getAll(`events/${e}/rules/drafts`,g)},createDraftRuleset({eventType:e,data:t}){return r.post(`events/${e}/rules/drafts`,t)},getDraftRuleset({eventType:e,id:t,fields:n=null}){const s={fields:n};return r.get(`events/${e}/rules/drafts/${t}`,s)},updateDraftRuleset({eventType:e,id:t,data:n}){return r.put(`events/${e}/rules/drafts/${t}`,n)},deleteDraftRuleset({eventType:e,id:t}){return r.delete(`events/${e}/rules/drafts/${t}`)}}}function dt({apiHandler:r}){return{getAll({limit:e=null,offset:t=null}={}){const n={limit:e,offset:t};return r.getAll("fees",n)},create({id:e="",data:t}){return r.create(`fees/${e}`,e,t)},get({id:e}){return r.get(`fees/${e}`)},upsert({id:e,data:t}){return r.put(`fees/${e}`,t)},patch({id:e,data:t}){return r.patch(`fees/${e}`,t)}}}function wt({apiHandler:r}){return{getAllAttachments({limit:e=null,offset:t=null,filter:n=null,q:s=null,expand:u=null,fields:l=null,sort:o=null}={}){const g={limit:e,offset:t,filter:n,q:s,expand:u,fields:l,sort:o};return r.getAll("attachments",g)},attach({id:e="",data:t,expand:n=null}){const s={expand:n};return r.create(`attachments/${e}`,e,t,s)},getAttachment({id:e}){return r.get(`attachments/${e}`)},updateAttachment({id:e,data:t,expand:n=null}){const s={expand:n};return r.put(`attachments/${e}`,t,s)},detach({id:e}){return r.delete(`attachments/${e}`)},getAll({limit:e=null,offset:t=null,filter:n=null,q:s=null,fields:u=null,sort:l=null}={}){const o={limit:e,offset:t,filter:n,q:s,fields:u,sort:l};return r.getAll("files",o)},upload({fileObject:e}){return r.post("files",e)},get({id:e}){return r.get(`files/${e}`)},update({id:e,data:t}){return r.put(`files/${e}`,t)},delete({id:e}){return r.delete(`files/${e}`)},download({id:e}){const t={responseType:"arraybuffer"};return r.download(`files/${e}/download`,t)},detachAndDelete({id:e}){const t={filter:`fileId:${e}`};let n=[];const u=(async()=>{const l=this.getAllAttachments(t);n.push(l);const g=(await l).items.map(k=>this.detach({id:k.fields.id}));n=[...n,g],await Promise.all(g);const p=r.delete(`files/${e}`);return n.push(p),p})();return u.cancel=()=>{n.forEach(l=>l.cancel())},u},uploadAndUpdate({fileObject:e,data:t={description:"",tags:[""]}}){const n=[],u=(async()=>{const l=this.upload({fileObject:e});n.push(l),await l;const o={name:l.name,extension:l.extension,description:t.description,tags:t.tags,url:""},g=this.update({id:l.fields.id,data:o});return n.push(g),g})();return u.cancel=()=>{n.forEach(l=>l.cancel())},u}}}function vt({apiHandler:r}){return{getAll({limit:e=null,offset:t=null,sort:n=null,filter:s=null,q:u=null,fields:l=null}={}){const o={limit:e,offset:t,sort:n,filter:s,q:u,fields:l};return r.getAll("gateway-accounts",o)},create({id:e="",data:t}){return r.create(`gateway-accounts/${e}`,e,t)},get({id:e}){return r.get(`gateway-accounts/${e}`)},update({id:e,data:t}){return r.patch(`gateway-accounts/${e}`,t)},delete({id:e}){return r.delete(`gateway-accounts/${e}`)},close({id:e}){return r.post(`gateway-accounts/${e}/close`)},disable({id:e}){return r.post(`gateway-accounts/${e}/disable`)},getAllDowntimeSchedules({id:e,limit:t=null,offset:n=null,filter:s=null,sort:u=null}){const l={limit:t,offset:n,filter:s,sort:u};return r.getAll(`gateway-accounts/${e}/downtime-schedules`,l)},createDowntimeSchedule({id:e,data:t}){return r.post(`gateway-accounts/${e}/downtime-schedules`,t)},getDowntimeSchedule({id:e,downtimeId:t}){return r.get(`gateway-accounts/${e}/downtime-schedules/${t}`)},updateDowntimeSchedule({id:e,downtimeId:t,data:n}){return r.put(`gateway-accounts/${e}/downtime-schedules/${t}`,n)},deleteDowntimeSchedule({id:e,downtimeId:t}){return r.delete(`gateway-accounts/${e}/downtime-schedules/${t}`)},enable({id:e}){return r.post(`gateway-accounts/${e}/enable`)},getAllVolumeLimits({id:e}){return r.getAll(`gateway-accounts/${e}/limits`)},getVolumeLimit({id:e,limitId:t}){return r.get(`gateway-accounts/${e}/limits/${t}`)},updateVolumeLimit({id:e,limitId:t,data:n}){return r.put(`gateway-accounts/${e}/limits/${t}`,n)},deleteVolumeLimit({id:e,limitId:t}){return r.delete(`gateway-accounts/${e}/limits/${t}`)},getAllTimelineMessages({id:e,limit:t=null,offset:n=null,filter:s=null,sort:u=null,q:l=null}){const o={limit:t,offset:n,filter:s,sort:u,q:l};return r.getAll(`gateway-accounts/${e}/timeline`,o)},createTimelineComment({id:e,data:t}){return r.post(`gateway-accounts/${e}/timeline`,t)},getTimelineMessage({id:e,messageId:t}){return r.get(`gateway-accounts/${e}/timeline/${t}`)},deleteTimelineMessage({id:e,messageId:t}){return r.delete(`gateway-accounts/${e}/timeline/${t}`)},checkCredentials({id:e}){return r.post(`gateway-accounts/${e}/check-credentials`)},getFinancialSettings({id:e}){return r.get(`gateway-accounts/${e}/financial-settings`)},setFinancialSettings({id:e,data:t}){return r.put(`gateway-accounts/${e}/financial-settings`,t)}}}function kt({apiHandler:r}){return{getAll({limit:e=null,offset:t=null}={}){const n={limit:e,offset:t};return r.getAll("integrations",n)},get({label:e}){return r.get(`integrations/${e}`)}}}function Tt({apiHandler:r}){return{getAll({filter:e=null,sort:t=null,limit:n=null,offset:s=null,q:u=null,expand:l=null}={}){const o={filter:e,sort:t,limit:n,offset:s,q:u,expand:l};return r.getAll("invoices",o)},create({id:e="",data:t,expand:n=null}){const s={expand:n};return r.create(`invoices/${e}`,e,t,s)},get({id:e,expand:t=null}){const n={expand:t};return r.get(`invoices/${e}`,n)},update({id:e,data:t,expand:n=null}){const s={expand:n};return r.put(`invoices/${e}`,t,s)},getAllInvoiceItems({id:e,limit:t=null,offset:n=null,expand:s=null}){const u={limit:t,offset:n,expand:s};return r.getAll(`invoices/${e}/items`,u)},createInvoiceItem({id:e,data:t}){return r.post(`invoices/${e}/items`,t)},getInvoiceItem({id:e,itemId:t}){return r.get(`invoices/${e}/items/${t}`)},updateInvoiceItem({id:e,itemId:t,data:n}){return r.put(`invoices/${e}/items/${t}`,n)},deleteInvoiceItem({id:e,itemId:t}){return r.delete(`invoices/${e}/items/${t}`)},issue({id:e,data:t}){return r.post(`invoices/${e}/issue`,t)},abandon({id:e}){return r.post(`invoices/${e}/abandon`)},void({id:e}){return r.post(`invoices/${e}/void`)},recalculate({id:e}){return r.post(`invoices/${e}/recalculate`)},reissue({id:e,data:t}){return r.post(`invoices/${e}/reissue`,t)},getAllTransactionAllocations({id:e,limit:t=null,offset:n=null}){const s={limit:t,offset:n};return r.getAll(`invoices/${e}/transaction-allocations`,s)},applyTransaction({id:e,data:t}){return r.post(`invoices/${e}/transaction`,t)},getAllTimelineMessages({id:e,limit:t=null,offset:n=null,filter:s=null,sort:u=null,q:l=null}){const o={limit:t,offset:n,filter:s,sort:u,q:l};return r.getAll(`invoices/${e}/timeline`,o)},createTimelineComment({id:e,data:t}){return r.post(`invoices/${e}/timeline`,t)},getTimelineMessage({id:e,messageId:t}){return r.get(`invoices/${e}/timeline/${t}`)},deleteTimelineMessage({id:e,messageId:t}){return r.delete(`invoices/${e}/timeline/${t}`)},downloadCSV({limit:e=null,offset:t=null,sort:n=null,expand:s=null,filter:u=null,q:l=null}={}){const o={params:{limit:e,offset:t,sort:n,expand:s,filter:u,q:l},headers:w};return r.download("invoices",o)},downloadPDF({id:e}){const t={headers:G,responseType:"arraybuffer"};return r.download(`invoices/${e}`,t)}}}function Et({apiHandler:r}){return{getAllAccounts({limit:e=null,offset:t=null,filter:n=null,sort:s=null}={}){const u={limit:e,offset:t,filter:n,sort:s};return r.getAll("journal-accounts",u)},createAccount({id:e="",data:t}){return r.create(`journal-accounts/${e}`,e,t)},getAccount({id:e}){return r.get(`journal-accounts/${e}`)},updateAccount({id:e,data:t}){return r.put(`journal-accounts/${e}`,t)}}}function St({apiHandler:r}){return{getAllEntries({limit:e=null,offset:t=null,filter:n=null,sort:s=null}={}){const u={limit:e,offset:t,filter:n,sort:s};return r.getAll("journal-entries",u)},createEntry({id:e="",data:t}){return r.create(`journal-entries/${e}`,e,t)},getEntry({id:e}){return r.get(`journal-entries/${e}`)},updateEntry({id:e,data:t}){return r.put(`journal-entries/${e}`,t)},getAllRecords({id:e,limit:t=null,offset:n=null,filter:s=null,sort:u=null,expand:l=null}){const o={limit:t,offset:n,filter:s,sort:u,expand:l};return r.getAll(`journal-entries/${e}/records`,o)},createRecord({id:e,data:t}){return r.post(`journal-entries/${e}/records`,t)},getRecord({id:e,journalRecordId:t}){return r.get(`journal-entries/${e}/records/${t}`)},updateRecord({id:e,journalRecordId:t,data:n}){return r.put(`journal-entries/${e}/records/${t}`,n)},deleteRecord({id:e,journalRecordId:t}){return r.delete(`journal-entries/${e}/records/${t}`)}}}function It({apiHandler:r}){return{getAll({limit:e=null,offset:t=null,filter:n=null,sort:s=null,expand:u=null}={}){const l={limit:e,offset:t,filter:n,sort:s,expand:u};return r.getAll("kyc-documents",l)},create({id:e="",data:t}){return r.create(`kyc-documents/${e}`,e,t)},get({id:e}){return r.get(`kyc-documents/${e}`)},update({id:e,data:t}){return r.put(`kyc-documents/${e}`,t)},accept({id:e}){return r.post(`kyc-documents/${e}/acceptance`)},matches({id:e,data:t}){return r.post(`kyc-documents/${e}/matches`,t)},reject({id:e,data:t}){return r.post(`kyc-documents/${e}/rejection`,t)},review({id:e}){return r.post(`kyc-documents/${e}/review`)},startReview({id:e}){return r.post(`kyc-documents/${e}/start-review`)},stopReview({id:e}){return r.post(`kyc-documents/${e}/stop-review`)}}}function Ct({apiHandler:r}){return{getAll({limit:e=null,offset:t=null,filter:n=null,sort:s=null}={}){const u={limit:e,offset:t,filter:n,sort:s};return r.getAll("kyc-requests",u)},create({data:e}){return r.post("kyc-requests",e)},get({id:e}){return r.get(`kyc-requests/${e}`)},delete({id:e}){return r.delete(`kyc-requests/${e}`)},update({id:e,data:t}){return r.patch(`kyc-requests/${e}`,t)}}}function xt({apiHandler:r}){return{getKycSettings(){return r.get("kyc-settings")},updateKycSettings({data:e}){return r.put("kyc-settings",e)}}}function jt({apiHandler:r}){return{getAll({limit:e=null,offset:t=null,filter:n=null,sort:s=null,fields:u=null,q:l=null}={}){const o={limit:e,offset:t,filter:n,sort:s,fields:u,q:l};return r.getAll("lists",o)},create({id:e="",data:t}){return r.create(`lists/${e}`,e,t)},getLatestVersion({id:e}){return r.get(`lists/${e}`)},update({id:e,data:t}){return r.put(`lists/${e}`,t)},delete({id:e}){return r.delete(`lists/${e}`)},getByVersion({id:e,version:t}){return r.get(`lists/${e}/${t}`)}}}function Pt({apiHandler:r}){return{getAll({limit:e=null,offset:t=null,filter:n=null,sort:s=null}={}){const u={limit:e,offset:t,filter:n,sort:s};return r.getAll("memberships",u)},get({organizationId:e,userId:t}){return r.get(`memberships/${e}/${t}`)},update({organizationId:e,userId:t,data:n}){return r.put(`memberships/${e}/${t}`,n)},delete({organizationId:e,userId:t}){return r.delete(`memberships/${e}/${t}`)}}}function qt({apiHandler:r}){return{getAll({limit:e=null,offset:t=null,filter:n=null,q:s=null,sort:u=null}={}){const l={limit:e,offset:t,filter:n,q:s,sort:u};return r.getAll("organization-exports",l)},create({data:e}){return r.post("organization-exports",e)},get({id:e}){return r.get(`organization-exports/${e}`)}}}function Mt({apiHandler:r}){return{getAll({limit:e=null,offset:t=null,filter:n=null,q:s=null}={}){const u={limit:e,offset:t,filter:n,q:s};return r.getAll("organizations",u)},create({data:e}){return r.post("organizations",e)},get({id:e}){return r.get(`organizations/${e}`)},update({id:e,data:t}){return r.patch(`organizations/${e}`,t)}}}function Ot({apiHandler:r}){return{getAll({limit:e=null,q:t=null}={}){const n={limit:e,q:t};return r.getAll("payment-cards-bank-names",n)}}}function Dt({apiHandler:r}){return{getAll({filter:e=null,sort:t=null,limit:n=null,offset:s=null,q:u=null,expand:l=null}={}){const o={filter:e,sort:t,limit:n,offset:s,q:u,expand:l};return r.getAll("payment-instruments",o)},create({data:e}){return r.post("payment-instruments",e)},get({id:e}){return r.get(`payment-instruments/${e}`)},update({id:e,data:t}){return r.patch(`payment-instruments/${e}`,t)},deactivate({id:e}){return r.post(`payment-instruments/${e}/deactivation`)}}}function Ft({apiHandler:r}){return{getAll({limit:e=null,offset:t=null}={}){const n={limit:e,offset:t};return r.getAll("payment-methods",n)},get({apiName:e}){return r.get(`payment-methods/${e}`)}}}function Kt({apiHandler:r}){return{getAll({limit:e=null,offset:t=null}={}){const n={limit:e,offset:t};return r.getAll("tokens",n)},create({data:e}){return r.post("tokens",e)},get({token:e}){return r.get(`tokens/${e}`)}}}function Bt({apiHandler:r}){return{getAll({limit:e=null,offset:t=null,filter:n=null,sort:s=null}={}){const u={limit:e,offset:t,filter:n,sort:s};return r.getAll("payout-requests",u)},create({id:e="",data:t}){return r.create(`payout-requests/${e}`,e,t)},get({id:e}){return r.get(`payout-requests/${e}`)},update({id:e,data:t}){return r.put(`payout-requests/${e}`,t)},getPaymentInstruments({id:e}){return r.get(`payout-requests/${e}/payment-instruments`)}}}function Nt({apiHandler:r}){return{create({data:e}){return r.post("payouts",e)}}}function Vt({apiHandler:r}){return{getAll({filter:e=null,sort:t=null,limit:n=null,offset:s=null,q:u=null}={}){const l={filter:e,sort:t,limit:n,offset:s,q:u};return r.getAll("plans",l)},create({id:e="",data:t}){return r.create(`plans/${e}`,e,t)},get({id:e}){return r.get(`plans/${e}`)},update({id:e,data:t}){return r.put(`plans/${e}`,t)},delete({id:e}){return r.delete(`plans/${e}`)}}}function zt({apiHandler:r}){return{sendEmailRuleAction({data:e}){return r.post("previews/rule-actions/send-email",e)},triggerWebhookRuleAction({data:e}){return r.post("previews/rule-actions/trigger-webhook",e)},webhook({data:e}){return r.post("previews/webhooks",e)},order({data:e}){return r.post("previews/orders",e)}}}function Lt({apiHandler:r}){return{getAll({filter:e=null,sort:t=null,limit:n=null,offset:s=null,q:u=null}={}){const l={filter:e,sort:t,limit:n,offset:s,q:u};return r.getAll("products",l)},create({id:e="",data:t}){return r.create(`products/${e}`,e,t)},get({id:e}){return r.get(`products/${e}`)},update({id:e,data:t}){return r.put(`products/${e}`,t)},delete({id:e}){return r.delete(`products/${e}`)}}}function Ut({apiHandler:r}){return{startPermissionsEmulation({data:e}){return r.post("permissions-emulation",e)},stopPermissionsEmulation(){return r.delete("permissions-emulation")},get(){return r.get("profile")},update({data:e}){return r.put("profile",e)},getMfa(){return r.get("profile/mfa")},updateMfa(){return r.post("profile/mfa")},deleteMfa(){return r.delete("profile/mfa")}}}function Wt({apiHandler:r}){return{readyToPay({data:e}){return r.post("ready-to-pay",e)}}}function Jt({apiHandler:r}){return{getAll(){return r.get("risk-score-rules")},updateRiskScoreRules({data:e}){return r.put("risk-score-rules",e)},getAllBlocklistRules(){return r.get("risk-score-rules/blocklists")},updateRiskScoreBlocklistRules({data:e}){return r.put("risk-score-rules/blocklists",e)}}}function Gt({apiHandler:r}){return{getAll({limit:e=null,offset:t=null,filter:n=null,sort:s=null,q:u=null,expand:l=null}={}){const o={limit:e,offset:t,filter:n,sort:s,q:u,expand:l};return r.getAll("roles",o)},create({id:e="",data:t}){return r.create(`roles/${e}`,e,t)},get({id:e,expand:t=null}){const n={expand:t};return r.get(`roles/${e}`,n)},update({id:e,data:t}){return r.put(`roles/${e}`,t)},delete({id:e}){return r.delete(`roles/${e}`)}}}function Yt({apiHandler:r}){return{get({sort:e=null,limit:t=null,offset:n=null,q:s=null}){const u={sort:e,limit:t,offset:n,q:s};return r.get("search",u)}}}function _t({apiHandler:r}){return{getAll({limit:e=null,offset:t=null,sort:n=null,filter:s=null,q:u=null}={}){const l={limit:e,offset:t,sort:n,filter:s,q:u};return r.getAll("grid-segments",l)},create({id:e="",data:t}){return r.create(`grid-segments/${e}`,e,t)},get({id:e}){return r.get(`grid-segments/${e}`)},update({id:e,data:t}){return r.put(`grid-segments/${e}`,t)},delete({id:e}){return r.delete(`grid-segments/${e}`)}}}function Qt({apiHandler:r}){return{getAll({eventType:e}){return r.getAll(`send-through-attribution/${e}`)}}}function Xt({apiHandler:r}){return{getAll({type:e,filter:t=null,limit:n=null,offset:s=null,sort:u=null,q:l=null}){const o={filter:t,limit:n,offset:s,sort:u,q:l};return r.getAll(`service-credentials/${e}`,o)},create({type:e,data:t}){return r.post(`service-credentials/${e}`,t)},get({type:e,id:t}){return r.get(`service-credentials/${e}/${t}`)},update({type:e,id:t,data:n}){return r.patch(`service-credentials/${e}/${t}`,n)},getItems({type:e,id:t,limit:n=null,offset:s=null,filter:u=null,q:l=null,fields:o=null,sort:g=null}){const p={limit:n,offset:s,filter:u,q:l,fields:o,sort:g};return r.getAll(`service-credentials/${e}/${t}/items`,p)}}}function Zt({apiHandler:r}){return{getAll({limit:e=null,offset:t=null,filter:n=null,sort:s=null,q:u=null}={}){const l={limit:e,offset:t,filter:n,sort:s,q:u};return r.getAll("shipping-rates",l)},create({id:e="",data:t}){return r.create(`shipping-rates/${e}`,e,t)},get({id:e}){return r.get(`shipping-rates/${e}`)},update({id:e,data:t}){return r.put(`shipping-rates/${e}`,t)},delete({id:e}){return r.delete(`shipping-rates/${e}`)}}}function Ht({apiHandler:r}){return{get(){return r.get("status")}}}function er({apiHandler:r}){return{getAll({limit:e=null,offset:t=null,filter:n=null,sort:s=null}={}){const u={limit:e,offset:t,filter:n,sort:s};return r.getAll("subscription-cancellations",u)},create({id:e="",data:t}){return r.create(`subscription-cancellations/${e}`,e,t)},get({id:e}){return r.get(`subscription-cancellations/${e}`)},delete({id:e}){return r.delete(`subscription-cancellations/${e}`)},patch({id:e,data:t}){return r.patch(`subscription-cancellations/${e}`,t)}}}function tr({apiHandler:r}){return{getAll({limit:e=null,offset:t=null,filter:n=null,sort:s=null}={}){const u={limit:e,offset:t,filter:n,sort:s};return r.getAll("subscription-pauses",u)},pause({id:e="",data:t}){return r.create(`subscription-pauses/${e}`,e,t)},get({id:e}){return r.get(`subscription-pauses/${e}`)},update({id:e,data:t}){return r.put(`subscription-pauses/${e}`,t)},delete({id:e}){return r.delete(`subscription-pauses/${e}`)}}}function rr({apiHandler:r}){return{getAll({limit:e=null,offset:t=null,filter:n=null,sort:s=null}={}){const u={limit:e,offset:t,filter:n,sort:s};return r.getAll("subscription-reactivations",u)},reactivate({data:e}){return r.post("subscription-reactivations",e)},get({id:e}){return r.get(`subscription-reactivations/${e}`)}}}function nr({apiHandler:r}){return{getAll({filter:e=null,sort:t=null,limit:n=null,offset:s=null,q:u=null,expand:l=null}={}){const o={filter:e,sort:t,limit:n,offset:s,q:u,expand:l};return r.getAll("subscriptions",o)},create({id:e="",data:t,expand:n=null}){const s={expand:n};return r.create(`subscriptions/${e}`,e,t,s)},get({id:e,expand:t=null}){const n={expand:t};return r.get(`subscriptions/${e}`,n)},update({id:e,data:t,expand:n=null}){const s={expand:n};return r.put(`subscriptions/${e}`,t,s)},delete({id:e}){return r.delete(`subscriptions/${e}`)},void({id:e}){return r.post(`subscriptions/${e}/void`)},changeItems({id:e,data:t}){return r.post(`subscriptions/${e}/change-items`,t)},createInterimInvoice({id:e,data:t}){return r.post(`subscriptions/${e}/interim-invoice`,t)},getAllUpcomingInvoices({id:e,expand:t=null}){const n={expand:t};return r.getAll(`subscriptions/${e}/upcoming-invoices`,n)},getUpcomingInvoice({id:e,expand:t=null}){const n={expand:t};return r.get(`subscriptions/${e}/upcoming-invoice`,n)},issueUpcomingInvoice({id:e,invoiceId:t,data:n}){return r.post(`subscriptions/${e}/upcoming-invoices/${t}/issue`,n)},getAllTimelineMessages({id:e,limit:t=null,offset:n=null,filter:s=null,sort:u=null,q:l=null}){const o={limit:t,offset:n,filter:s,sort:u,q:l};return r.getAll(`subscriptions/${e}/timeline`,o)},createTimelineComment({id:e,data:t}){return r.post(`subscriptions/${e}/timeline`,t)},getTimelineMessage({id:e,messageId:t}){return r.get(`subscriptions/${e}/timeline/${t}`)},deleteTimelineMessage({id:e,messageId:t}){return r.delete(`subscriptions/${e}/timeline/${t}`)},downloadCSV({limit:e=null,offset:t=null,sort:n=null,expand:s=null,filter:u=null,q:l=null}={}){const o={params:{limit:e,offset:t,sort:n,expand:s,filter:u,q:l},headers:w};return r.download("subscriptions",o)}}}function sr({apiHandler:r}){return{getAll({limit:e=null,offset:t=null,filter:n=null,q:s=null,sort:u=null}={}){const l={limit:e,offset:t,filter:n,q:s,sort:u};return r.getAll("tags",l)},create({data:e}){return r.post("tags",e)},get({tag:e}){return r.get(`tags/${e}`)},delete({tag:e}){return r.delete(`tags/${e}`)},update({tag:e,data:t}){return r.patch(`tags/${e}`,t)},tagCustomers({tag:e,data:t}){return r.post(`tags/${e}/customers`,t)},untagCustomers({tag:e,data:t}){return r.delete(`tags/${e}/customers`,t)},tagCustomer({tag:e,customerId:t}){return r.post(`tags/${e}/customers/${t}`)},untagCustomer({tag:e,customerId:t}){return r.delete(`tags/${e}/customers/${t}`)},tagKycDocuments({tag:e,data:t}){return r.post(`tags/${e}/kyc-documents`,t)},untagKycDocuments({tag:e,data:t}){return r.delete(`tags/${e}/kyc-documents`,t)},tagKycDocument({tag:e,kycDocumentId:t}){return r.post(`tags/${e}/kyc-documents/${t}`)},untagKycDocument({tag:e,kycDocumentId:t}){return r.delete(`tags/${e}/kyc-documents/${t}`)}}}function ur({apiHandler:r}){return{getAllTagsRules({limit:e=null,offset:t=null,sort:n=null,filter:s=null,q:u=null}={}){const l={limit:e,offset:t,sort:n,filter:s,q:u};return r.getAll("tags-rules",l)},createTagsRule({id:e="",data:t}){return r.create(`tags-rules/${e}`,e,t)},getTagsRule({id:e}){return r.get(`tags-rules/${e}`)},updateTagsRule({id:e,data:t}){return r.put(`tags-rules/${e}`,t)},deleteTagsRule({id:e}){return r.delete(`tags-rules/${e}`)}}}function lr({apiHandler:r}){return{getAllApiLogs({limit:e=null,offset:t=null,sort:n=null,filter:s=null,q:u=null,expand:l=null}={}){const o={limit:e,offset:t,sort:n,filter:s,q:u,expand:l};return r.getAll("tracking/api",o)},getApiLog({id:e}){return r.get(`tracking/api/${e}`)},getAllListsChangesHistory({limit:e=null,offset:t=null,sort:n=null,filter:s=null,q:u=null}={}){const l={limit:e,offset:t,sort:n,filter:s,q:u};return r.getAll("tracking/lists",l)},getAllWebhookTrackingLogs({limit:e=null,offset:t=null,sort:n=null,filter:s=null,q:u=null}={}){const l={limit:e,offset:t,sort:n,filter:s,q:u};return r.getAll("tracking/webhooks",l)},getWebhookTrackingLog({id:e}){return r.get(`tracking/webhooks/${e}`)},resendWebhook({id:e}){return r.post(`tracking/webhooks/${e}/resend`)},downloadApiLogsCSV({limit:e=null,offset:t=null,sort:n=null,filter:s=null,q:u=null}={}){const l={params:{limit:e,offset:t,sort:n,filter:s,q:u},headers:w};return r.download("tracking/api",l)}}}function or({apiHandler:r}){return{getAll({limit:e=null,offset:t=null,filter:n=null,q:s=null,sort:u=null,expand:l=null}={}){const o={limit:e,offset:t,filter:n,q:s,sort:u,expand:l};return r.getAll("transactions",o)},create({data:e,expand:t=null}){const n={expand:t};return r.post("transactions",e,n)},get({id:e,expand:t=null}){const n={expand:t};return r.get(`transactions/${e}`,n)},patch({id:e,data:t}){return r.patch(`transactions/${e}`,t)},query({id:e}){return r.post(`transactions/${e}/query`)},update({id:e,data:t}){return r.post(`transactions/${e}/update`,t)},refund({id:e,data:t}){return r.post(`transactions/${e}/refund`,t)},getAllTimelineMessages({id:e,limit:t=null,offset:n=null,filter:s=null}){const u={limit:t,offset:n,filter:s};return r.getAll(`transactions/${e}/timeline`,u)},createTimelineComment({id:e,data:t}){return r.post(`transactions/${e}/timeline`,t)},getTimelineMessage({id:e,messageId:t}){return r.get(`transactions/${e}/timeline/${t}`)},deleteTimelineMessage({id:e,messageId:t}){return r.delete(`transactions/${e}/timeline/${t}`)},downloadCSV({limit:e=null,offset:t=null,sort:n=null,expand:s=null,filter:u=null,q:l=null}={}){const o={params:{limit:e,offset:t,sort:n,expand:s,filter:u,q:l},headers:w};return r.download("transactions",o)}}}function cr({apiHandler:r}){return{getAll({filter:e=null,sort:t=null,limit:n=null,offset:s=null,q:u=null}={}){const l={filter:e,sort:t,limit:n,offset:s,q:u};return r.getAll("usages",l)},create({id:e="",data:t}){return r.create(`usages/${e}`,e,t)},get({id:e}){return r.get(`usages/${e}`)},update({id:e,data:t}){return r.put(`usages/${e}`,t)},delete({id:e}){return r.delete(`usages/${e}`)}}}function ir({apiHandler:r}){return{getAll({limit:e=null,offset:t=null,sort:n=null,filter:s=null,q:u=null}={}){const l={limit:e,offset:t,sort:n,filter:s,q:u};return r.getAll("users",l)},create({id:e="",data:t}){return r.create(`users/${e}`,e,t)},get({id:e}){return r.get(`users/${e}`)},update({id:e,data:t}){return r.put(`users/${e}`,t)},getMfa({id:e}){return r.get(`users/${e}/mfa`)}}}function ar({apiHandler:r}){return{getAll({limit:e=null,offset:t=null,filter:n=null}={}){const s={limit:e,offset:t,filter:n};return r.getAll("webhooks",s)},create({id:e="",data:t}){return r.create(`webhooks/${e}`,e,t)},get({id:e}){return r.get(`webhooks/${e}`)},update({id:e,data:t}){return r.put(`webhooks/${e}`,t)}}}function gr({apiHandler:r}){return{getAll({limit:e=null,offset:t=null,q:n=null,filter:s=null,sort:u=null}={}){const l={limit:e,offset:t,q:n,filter:s,sort:u};return r.getAll("websites",l)},create({id:e="",data:t}){return r.create(`websites/${e}`,e,t)},get({id:e}){return r.get(`websites/${e}`)},update({id:e,data:t}){return r.put(`websites/${e}`,t)},delete({id:e}){return r.delete(`websites/${e}`)},downloadCSV({limit:e=null,offset:t=null,sort:n=null,expand:s=null,filter:u=null,q:l=null}={}){const o={params:{limit:e,offset:t,sort:n,expand:s,filter:u,q:l},headers:w};return r.download("websites",o)}}}class mr{constructor({apiHandler:e}){this.account=Ye({apiHandler:e}),this.amlChecks=_e({apiHandler:e}),this.aml=Qe({apiHandler:e}),this.apiKeys=Xe({apiHandler:e}),this.applicationInstances=Ze({apiHandler:e}),this.applications=He({apiHandler:e}),this.balanceTransactions=et({apiHandler:e}),this.billingPortals=tt({apiHandler:e}),this.blocklists=rt({apiHandler:e}),this.broadcastMessages=nt({apiHandler:e}),this.cashierCustomPropertySets=st({apiHandler:e}),this.cashierRequests=ut({apiHandler:e}),this.cashierStrategies=lt({apiHandler:e}),this.checkoutForms=ot({apiHandler:e}),this.coupons=ct({apiHandler:e}),this.credentialHashes=it({apiHandler:e}),this.creditMemos=at({apiHandler:e}),this.customDomains=gt({apiHandler:e}),this.customFields=mt({apiHandler:e}),this.customerAuthentication=ht({apiHandler:e}),this.customers=ft({apiHandler:e}),this.digitalWallets=$t({apiHandler:e}),this.disputes=pt({apiHandler:e}),this.emailDeliverySettings=yt({apiHandler:e}),this.emailMessages=At({apiHandler:e}),this.emailNotifications=bt({apiHandler:e}),this.events=Rt({apiHandler:e}),this.fees=dt({apiHandler:e}),this.files=wt({apiHandler:e}),this.gatewayAccounts=vt({apiHandler:e}),this.integrations=kt({apiHandler:e}),this.invoices=Tt({apiHandler:e}),this.journalAccounts=Et({apiHandler:e}),this.journalEntries=St({apiHandler:e}),this.kycDocuments=It({apiHandler:e}),this.kycRequests=Ct({apiHandler:e}),this.kycSettings=xt({apiHandler:e}),this.lists=jt({apiHandler:e}),this.memberships=Pt({apiHandler:e}),this.organizationExports=qt({apiHandler:e}),this.organizations=Mt({apiHandler:e}),this.paymentCardsBankNames=Ot({apiHandler:e}),this.paymentInstruments=Dt({apiHandler:e}),this.paymentMethods=Ft({apiHandler:e}),this.paymentTokens=Kt({apiHandler:e}),this.payoutRequests=Bt({apiHandler:e}),this.payouts=Nt({apiHandler:e}),this.plans=Vt({apiHandler:e}),this.previews=zt({apiHandler:e}),this.products=Lt({apiHandler:e}),this.profile=Ut({apiHandler:e}),this.purchase=Wt({apiHandler:e}),this.riskScoreRules=Jt({apiHandler:e}),this.roles=Gt({apiHandler:e}),this.search=Yt({apiHandler:e}),this.segments=_t({apiHandler:e}),this.sendThroughAttribution=Qt({apiHandler:e}),this.serviceCredentials=Xt({apiHandler:e}),this.shippingRates=Zt({apiHandler:e}),this.status=Ht({apiHandler:e}),this.subscriptionCancellations=er({apiHandler:e}),this.subscriptionPauses=tr({apiHandler:e}),this.subscriptionReactivations=rr({apiHandler:e}),this.subscriptions=nr({apiHandler:e}),this.tags=sr({apiHandler:e}),this.tagsRules=ur({apiHandler:e}),this.tracking=lr({apiHandler:e}),this.transactions=or({apiHandler:e}),this.usages=cr({apiHandler:e}),this.users=ir({apiHandler:e}),this.webhooks=ar({apiHandler:e}),this.websites=gr({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 hr({apiHandler:r}){return{getCustomerLifetimeSummaryMetrics({customerId:e}){return r.get(`customers/${e}/summary-metrics`)}}}function fr({apiHandler:r}){return{getAll({limit:e=null,offset:t=null,sort:n=null,expand:s=null,filter:u=null,q:l=null,criteria:o=null}={}){const g={limit:e,offset:t,sort:n,expand:s,filter:u,q:l,criteria:o};return r.getAll("data-exports",g)},queue({id:e="",data:t,expand:n=null}){const s={expand:n};return r.create(`data-exports/${e}`,e,t,s)},get({id:e,expand:t=null}){const n={expand:t};return r.get(`data-exports/${e}`,n)},update({id:e,data:t,expand:n=null}){const s={expand:n};return r.put(`data-exports/${e}`,t,s)},delete({id:e}){return r.delete(`data-exports/${e}`)}}}function $r({apiHandler:r}){return{getTransactionHistogramReport({periodStart:e,periodEnd:t,aggregationPeriod:n,metric:s,filter:u=null}){const l={periodStart:e,periodEnd:t,aggregationPeriod:n,metric:s,filter:u};return r.get("histograms/transactions",l)}}}function pr({apiHandler:r}){return{getApiLogSummary({periodStart:e,periodEnd:t,limit:n=null,offset:s=null}){const u={periodStart:e,periodEnd:t,limit:n,offset:s};return r.get("reports/api-log-summary",u)},getCumulativeSubscriptions({aggregationField:e,periodStart:t,periodEnd:n,limit:s=null,offset:u=null,filter:l=null}){const o={aggregationField:e,periodStart:t,periodEnd:n,limit:s,offset:u,filter:l};return r.get("reports/cumulative-subscriptions",o)},getDashboardMetrics({periodStart:e,periodEnd:t,metrics:n=null,segments:s=null}){const u={periodStart:e,periodEnd:t,metrics:n,segments:s};return r.get("reports/dashboard",u)},getDccMarkup({aggregationField:e,periodStart:t,periodEnd:n,limit:s=null,offset:u=null,filter:l=null}){const o={aggregationField:e,periodStart:t,periodEnd:n,limit:s,offset:u,filter:l};return r.get("reports/dcc-markup",o)},getDisputes({aggregationField:e,periodMonth:t,limit:n=null,offset:s=null,filter:u=null}){const l={aggregationField:e,periodMonth:t,limit:n,offset:s,filter:u};return r.get("reports/disputes",l)},getEventsTriggeredSummary({periodStart:e,periodEnd:t,limit:n=null,offset:s=null}){const u={periodStart:e,periodEnd:t,limit:n,offset:s};return r.get("reports/events-triggered",u)},getTriggeredEventRuleReport({eventType:e,periodStart:t,periodEnd:n,limit:s=null,offset:u=null}){const l={periodStart:t,periodEnd:n,limit:s,offset:u};return r.get(`reports/events-triggered/${e}/rules`,l)},getFutureRenewals({periodStart:e,periodEnd:t,limit:n=null,offset:s=null}){const u={periodStart:e,periodEnd:t,limit:n,offset:s};return r.get("reports/future-renewals",u)},getJournal({currency:e,bookedFrom:t=null,bookedTo:n=null,recognizedAt:s,aggregationField:u,limit:l=null,offset:o=null,filter:g=null}){const p={currency:e,bookedFrom:t,bookedTo:n,recognizedAt:s,aggregationField:u,limit:l,offset:o,filter:g};return r.get("reports/journal",p)},getKycAcceptanceSummary({periodStart:e,periodEnd:t}){const n={periodStart:e,periodEnd:t};return r.get("reports/kyc-acceptance-summary",n)},getKycRejectionSummary({periodStart:e,periodEnd:t}){const n={periodStart:e,periodEnd:t};return r.get("reports/kyc-rejection-summary",n)},getKycRequestSummary({periodStart:e,periodEnd:t}){const n={periodStart:e,periodEnd:t};return r.get("reports/kyc-request-summary",n)},getMonthlyRecurringRevenue({currency:e,periodStart:t,periodEnd:n,limit:s=null,offset:u=null}){const l={currency:e,periodStart:t,periodEnd:n,limit:s,offset:u};return r.get("reports/monthly-recurring-revenue",l)},getRenewalSales({periodStart:e,periodEnd:t,limit:n=null,offset:s=null}){const u={periodStart:e,periodEnd:t,limit:n,offset:s};return r.get("reports/renewal-sales",u)},getRetentionPercentage({aggregationField:e,aggregationPeriod:t,includeSwitchedSubscriptions:n=null,periodStart:s,periodEnd:u,limit:l=null,offset:o=null,filter:g=null,criteria:p=null}){const k={aggregationField:e,aggregationPeriod:t,includeSwitchedSubscriptions:n,periodStart:s,periodEnd:u,limit:l,offset:o,filter:g,criteria:p};return r.get("reports/retention-percentage",k)},getRetentionValue({aggregationField:e,aggregationPeriod:t,includeRefunds:n=null,includeDisputes:s=null,periodStart:u,periodEnd:l,limit:o=null,offset:g=null,filter:p=null,sort:k=null,criteria:F=null}){const K={aggregationField:e,aggregationPeriod:t,includeRefunds:n,includeDisputes:s,periodStart:u,periodEnd:l,limit:o,offset:g,filter:p,sort:k,criteria:F};return r.get("reports/retention-value",K)},getRevenueWaterfall({currency:e,issuedFrom:t,issuedTo:n,recognizedTo:s}){const u={currency:e,issuedFrom:t,issuedTo:n,recognizedTo:s};return r.get("reports/revenue-waterfall",u)},getRevenueAudit({filter:e=null,sort:t=null,limit:n=null,offset:s=null}){const u={filter:e,sort:t,limit:n,offset:s};return r.get("reports/revenue-audit",u)},getSubscriptionCancellation({periodStart:e,periodEnd:t,aggregationField:n,limit:s=null,offset:u=null,filter:l=null}){const o={periodStart:e,periodEnd:t,aggregationField:n,limit:s,offset:u,filter:l};return r.get("reports/subscription-cancellation",o)},getSubscriptionRenewal({periodStart:e,periodEnd:t,limit:n=null,offset:s=null}){const u={periodStart:e,periodEnd:t,limit:n,offset:s};return r.get("reports/subscription-renewal",u)},getTimeSeriesTransaction({type:e,subaggregate:t,periodStart:n,periodEnd:s,limit:u=null,offset:l=null}){const o={type:e,subaggregate:t,periodStart:n,periodEnd:s,limit:u,offset:l};return r.get("reports/time-series-transaction",o)},getTransactionsTimeDispute({aggregationField:e,periodStart:t,periodEnd:n,limit:s=null,offset:u=null,filter:l=null}){const o={aggregationField:e,periodStart:t,periodEnd:n,limit:s,offset:u,filter:l};return r.get("reports/transactions-time-dispute",o)},getTransactions({periodStart:e,periodEnd:t,aggregationField:n,limit:s=null,offset:u=null,filter:l=null}){const o={periodStart:e,periodEnd:t,aggregationField:n,limit:s,offset:u,filter:l};return r.get("reports/transactions",o)}}}function yr({apiHandler:r}){return{getSubscriptionSummaryMetrics({subscriptionId:e}){return r.get(`subscriptions/${e}/summary-metrics`)}}}function Ar({apiHandler:r}){return{getActivityFeed({eventTypes:e=null,limit:t=1e3,offset:n=0}){const s={eventTypes:e,limit:t,offset:n};return r.getAll("activity-feed",s)},getTransaction({id:e="",eventTypes:t=null,limit:n=1e3,offset:s=0}){const u={eventTypes:t,limit:n,offset:s};return r.getAll(`transactions/${e}/timeline`,u)},getCustomer({id:e="",eventTypes:t=null,limit:n=1e3,offset:s=0}){const u={eventTypes:t,limit:n,offset:s};return r.getAll(`customers/${e}/timeline`,u)}}}function br({apiHandler:r}){return{query(){return r.get("location")}}}const v={CustomersResource:hr,DataExportsResource:fr,HistogramsResource:$r,ReportsResource:pr,SubscriptionsResource:yr,TimelinesResource:Ar,LocationResource:br};class Rr{constructor({apiHandler:e}){this.customers=v.CustomersResource({apiHandler:e}),this.dataExports=v.DataExportsResource({apiHandler:e}),this.histograms=v.HistogramsResource({apiHandler:e}),this.reports=v.ReportsResource({apiHandler:e}),this.subscriptions=v.SubscriptionsResource({apiHandler:e}),this.timelines=v.TimelinesResource({apiHandler:e}),this.location=v.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 dr({apiHandler:r}){return{get({expand:e=null}={}){const t={expand:e};return r.get("account",t)},update({data:e}){return r.patch("account",e)},requestPasswordReset({data:e}){return r.post("account/forgot-password",e)},changePassword({data:e}){return r.patch("account/password",e)},resendEmailVerification({data:e}){return r.post("account/resend-verification",e)},confirmPasswordReset({token:e,data:t}){return r.post(`account/reset-password/${e}`,t)},verifyEmail({token:e}){return r.post(`account/verification/${e}`)},register({data:e}){return r.post("register",e)}}}function wr({apiHandler:r}){return{login({data:e}){return r.post("login",e)},logout(){return r.post("logout")}}}function vr({apiHandler:r}){return{get({slug:e}){return r.get(`billing-portals/${e}`)}}}function kr({apiHandler:r}){return{create({data:e}){return r.post("cashier-deposit",e)}}}function Tr({apiHandler:r}){return{get({id:e,expand:t=null}){const n={expand:t};return r.get(`cashier-requests/${e}`,n)}}}function Er({apiHandler:r}){return{get({id:e}){return r.get(`checkout-forms/${e}`)}}}function Sr({apiHandler:r}){return{getAll({filter:e=null,sort:t=null,limit:n=null,offset:s=null,q:u=null}={}){const l={filter:e,sort:t,limit:n,offset:s,q:u};return r.getAll("invoices",l)},get({id:e}){return r.get(`invoices/${e}`)},downloadPDF({id:e}){const t={headers:G,responseType:"arraybuffer"};return r.download(`invoices/${e}`,t)}}}function Ir({apiHandler:r}){return{getAll({limit:e=null,offset:t=null}={}){const n={limit:e,offset:t};return r.getAll("kyc-documents",n)},create({data:e}){return r.post("kyc-documents",e)},get({id:e}){return r.get(`kyc-documents/${e}`)},update({id:e,data:t}){return r.patch(`kyc-documents/${e}`,t)}}}function Cr({apiHandler:r}){return{get({id:e,expand:t=null}){const n={expand:t};return r.get(`kyc-requests/${e}`,n)}}}function xr({apiHandler:r}){return{getAll({filter:e=null,sort:t=null,limit:n=null,offset:s=null,q:u=null}={}){const l={filter:e,sort:t,limit:n,offset:s,q:u};return r.getAll("orders",l)},get({id:e}){return r.get(`orders/${e}`)},update({id:e,data:t}){return r.patch(`orders/${e}`,t)},cancel({id:e,data:t}){return r.post(`orders/${e}/cancellation`,t)},pause({id:e,data:t}){return r.post(`orders/${e}/pause`,t)}}}function jr({apiHandler:r}){return{getAll({filter:e=null,sort:t=null,limit:n=null,offset:s=null,q:u=null}={}){const l={filter:e,sort:t,limit:n,offset:s,q:u};return r.getAll("payment-instruments",l)},create({data:e}){return r.post("payment-instruments",e)},get({id:e,limit:t=null,offset:n=null}){const s={limit:t,offset:n};return r.get(`payment-instruments/${e}`,s)},update({id:e,data:t}){return r.patch(`payment-instruments/${e}`,t)},deactivate({id:e}){return r.post(`payment-instruments/${e}/deactivation`)},getSetupTransaction({id:e}){return r.get(`payment-instruments/${e}/setup`)},setup({id:e,data:t}){return r.post(`payment-instruments/${e}/setup`,t)}}}function Pr({apiHandler:r}){return{getAll({filter:e=null,sort:t=null,limit:n=null,offset:s=null,q:u=null}={}){const l={filter:e,sort:t,limit:n,offset:s,q:u};return r.getAll("payout-requests",l)},get({id:e}){return r.get(`payout-requests/${e}`)},update({id:e,data:t}){return r.patch(`payout-requests/${e}`,t)}}}function qr({apiHandler:r}){return{getAll({filter:e=null,sort:t=null,limit:n=null,offset:s=null,q:u=null,expand:l=null}={}){const o={filter:e,sort:t,limit:n,offset:s,q:u,expand:l};return r.getAll("plans",o)},get({id:e,expand:t=null}){const n={expand:t};return r.get(`plans/${e}`,n)}}}function Mr({apiHandler:r}){return{getAll({filter:e=null,sort:t=null,limit:n=null,offset:s=null,q:u=null}={}){const l={filter:e,sort:t,limit:n,offset:s,q:u};return r.getAll("products",l)},get({id:e}){return r.get(`products/${e}`)}}}function Or({apiHandler:r}){return{payment({data:e}){return r.post("payment",e)},purchase({data:e}){return r.post("purchase",e)},preview({data:e}){return r.post("preview-purchase",e)},readyToPay({data:e}){return r.post("ready-to-pay",e)}}}function Dr({apiHandler:r}){return{getAll({limit:e=null,offset:t=null,filter:n=null,q:s=null,sort:u=null}={}){const l={limit:e,offset:t,filter:n,q:s,sort:u};return r.getAll("transactions",l)},get({id:e}){return r.get(`transactions/${e}`)},finishKyc({id:e,token:t}){return r.post(`transactions/${e}/${t}/continue`)},skipKyc({id:e,token:t}){return r.post(`transactions/${e}/${t}/bypass`)},update({id:e,data:t}){return r.patch(`transactions/${e}`,t)}}}function Fr({apiHandler:r}){return{get({id:e}){return r.get(`websites/${e}`)}}}class Kr{constructor({apiHandler:e}){this.account=dr({apiHandler:e}),this.authorization=wr({apiHandler:e}),this.billingPortals=vr({apiHandler:e}),this.cashierDeposit=kr({apiHandler:e}),this.cashierRequests=Tr({apiHandler:e}),this.checkoutForms=Er({apiHandler:e}),this.invoices=Sr({apiHandler:e}),this.kycDocuments=Ir({apiHandler:e}),this.kycRequests=Cr({apiHandler:e}),this.orders=xr({apiHandler:e}),this.paymentInstruments=jr({apiHandler:e}),this.payoutRequests=Pr({apiHandler:e}),this.plans=qr({apiHandler:e}),this.products=Mr({apiHandler:e}),this.purchase=Or({apiHandler:e}),this.transactions=Dr({apiHandler:e}),this.websites=Fr({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 Br({apiHandler:r}){return new mr({apiHandler:r})}function Nr({apiHandler:r}){return new Rr({apiHandler:r})}function Vr({apiHandler:r}){return new Kr({apiHandler:r})}const O={live:"https://api.rebilly.com",sandbox:"https://api-sandbox.rebilly.com"},D=6e3;function Y({apiKey:r=null,sandbox:e=!1,timeout:t=D,organizationId:n=null,urls:s=O}={}){if(!s.live||!s.sandbox)throw new Error("RebillyAPI urls config must include a key for both `live` and `sandbox`");if(typeof s.live!="string"||typeof s.sandbox!="string")throw new Error("RebillyAPI urls config `live` and `sandbox` must be strings");const l=M({options:{apiEndpoints:s,apiKey:r,apiVersion:"",isSandbox:e,requestTimeout:t,jwt:null,organizationId:n}});return Br({apiHandler:l})}function zr({apiKey:r=null,sandbox:e=!1,timeout:t=D,organizationId:n=null,urls:s=O}={}){if(!s.live||!s.sandbox)throw new Error("RebillyAPI urls config must include a key for both `live` and `sandbox`");if(typeof s.live!="string"||typeof s.sandbox!="string")throw new Error("RebillyAPI urls config `live` and `sandbox` must be strings");const l=M({options:{apiEndpoints:s,apiKey:r,apiVersion:"experimental",isSandbox:e,requestTimeout:t,jwt:null,organizationId:n}});return Nr({apiHandler:l})}function Lr({publishableKey:r=null,jwt:e=null,sandbox:t=!1,timeout:n=D,organizationId:s=null,urls:u=O}={}){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 l={apiEndpoints:u,publishableKey:r,jwt:e,apiVersion:"storefront",isSandbox:t,requestTimeout:n,organizationId:s},o=M({options:l});return o.setSessionToken(l.jwt),Vr({apiHandler:o})}m.RebillyAPI=Y,m.RebillyErrors=y,m.RebillyExperimentalAPI=zr,m.RebillyStorefrontAPI=Lr,m.cancellation=Ge,m.default=Y,Object.defineProperties(m,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}})});
|