rebilly-js-sdk 47.0.0 → 47.3.1
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 +107 -6
- package/dist/rebilly-js-sdk.es.js +23 -13
- package/dist/rebilly-js-sdk.umd.js +5 -5
- package/package.json +1 -1
package/dist/rebilly-js-sdk.d.ts
CHANGED
|
@@ -1533,6 +1533,11 @@ declare module rebilly {
|
|
|
1533
1533
|
type PutUserResponse = operations['PutUser']['responses']['201']['content']['application/json']
|
|
1534
1534
|
type PutUserResponsePromise = Promise<{fields: PutUserResponse}>
|
|
1535
1535
|
|
|
1536
|
+
type GetUserMfaRequest = { id : String }
|
|
1537
|
+
|
|
1538
|
+
type GetUserMfaResponse = operations['GetUserMfa']['responses']['200']['content']['application/json']
|
|
1539
|
+
type GetUserMfaResponsePromise = Promise<{fields: GetUserMfaResponse}>
|
|
1540
|
+
|
|
1536
1541
|
type PostUserPasswordChangeRequest = operations['PostUserPasswordChange']['requestBody']['content']['application/json']
|
|
1537
1542
|
type CreateUserPasswordChangeRequest = { id: String, data: PostUserPasswordChangeRequest, expand?: String }
|
|
1538
1543
|
type PostUserPasswordChangeResponse = operations['PostUserPasswordChange']['responses']['201']['content']['application/json']
|
|
@@ -3697,7 +3702,6 @@ export interface coreComponents {
|
|
|
3697
3702
|
| "POLi"
|
|
3698
3703
|
| "PostFinance-card"
|
|
3699
3704
|
| "PostFinance-e-finance"
|
|
3700
|
-
| "Przelewy24"
|
|
3701
3705
|
| "QIWI"
|
|
3702
3706
|
| "QPay"
|
|
3703
3707
|
| "QQPay"
|
|
@@ -3940,6 +3944,8 @@ export interface coreComponents {
|
|
|
3940
3944
|
revision?: number;
|
|
3941
3945
|
/** Indicates if EDD is enabled for this customer. */
|
|
3942
3946
|
isEddRequired: boolean;
|
|
3947
|
+
/** Whether the customer has fulfilled a KYC request by providing valid identity and address documents. */
|
|
3948
|
+
hasFulfilledKyc?: boolean;
|
|
3943
3949
|
/** The links related to resource. */
|
|
3944
3950
|
_links?: (Partial<coreComponents["schemas"]["SelfLink"]> &
|
|
3945
3951
|
Partial<coreComponents["schemas"]["DefaultPaymentInstrumentLink"]> &
|
|
@@ -4242,6 +4248,7 @@ export interface coreComponents {
|
|
|
4242
4248
|
| "JetPay"
|
|
4243
4249
|
| "Jeton"
|
|
4244
4250
|
| "Khelocard"
|
|
4251
|
+
| "Klarna"
|
|
4245
4252
|
| "Konnektive"
|
|
4246
4253
|
| "loonie"
|
|
4247
4254
|
| "LPG"
|
|
@@ -4505,6 +4512,7 @@ export interface coreComponents {
|
|
|
4505
4512
|
| "Intuit"
|
|
4506
4513
|
| "Jeton"
|
|
4507
4514
|
| "Khelocard"
|
|
4515
|
+
| "Klarna"
|
|
4508
4516
|
| "Konnektive"
|
|
4509
4517
|
| "loonie"
|
|
4510
4518
|
| "LPG"
|
|
@@ -6218,6 +6226,21 @@ export interface coreComponents {
|
|
|
6218
6226
|
apiSecret: string;
|
|
6219
6227
|
};
|
|
6220
6228
|
};
|
|
6229
|
+
/** Klarna config. */
|
|
6230
|
+
Klarna: coreComponents["schemas"]["GatewayAccount"] & {
|
|
6231
|
+
/** Credentials object. */
|
|
6232
|
+
credentials: {
|
|
6233
|
+
/** Klarna API username. */
|
|
6234
|
+
username: string;
|
|
6235
|
+
/** Klarna API password. */
|
|
6236
|
+
password: string;
|
|
6237
|
+
};
|
|
6238
|
+
/** Settings object. */
|
|
6239
|
+
settings: {
|
|
6240
|
+
/** Klarna API region. */
|
|
6241
|
+
region: "EU" | "NA" | "OC";
|
|
6242
|
+
};
|
|
6243
|
+
};
|
|
6221
6244
|
/** Konnektive config. */
|
|
6222
6245
|
Konnektive: coreComponents["schemas"]["GatewayAccount"] & {
|
|
6223
6246
|
/** Credentials object. */
|
|
@@ -6482,6 +6505,9 @@ export interface coreComponents {
|
|
|
6482
6505
|
uid: string;
|
|
6483
6506
|
wsk: string;
|
|
6484
6507
|
};
|
|
6508
|
+
settings?: {
|
|
6509
|
+
useRecurringApi: boolean;
|
|
6510
|
+
};
|
|
6485
6511
|
};
|
|
6486
6512
|
/** Pagsmile Gateway config. */
|
|
6487
6513
|
Pagsmile: coreComponents["schemas"]["GatewayAccount"] & {
|
|
@@ -9396,6 +9422,7 @@ export interface coreComponents {
|
|
|
9396
9422
|
| "Onlineueberweisen"
|
|
9397
9423
|
| "oriental-wallet"
|
|
9398
9424
|
| "OXXO"
|
|
9425
|
+
| "P24"
|
|
9399
9426
|
| "Pagadito"
|
|
9400
9427
|
| "PagoEffectivo"
|
|
9401
9428
|
| "Pagsmile-deposit-express"
|
|
@@ -9418,7 +9445,6 @@ export interface coreComponents {
|
|
|
9418
9445
|
| "POLi"
|
|
9419
9446
|
| "PostFinance-card"
|
|
9420
9447
|
| "PostFinance-e-finance"
|
|
9421
|
-
| "Przelewy24"
|
|
9422
9448
|
| "QIWI"
|
|
9423
9449
|
| "QPay"
|
|
9424
9450
|
| "QQPay"
|
|
@@ -17161,6 +17187,16 @@ export interface usersPaths {
|
|
|
17161
17187
|
};
|
|
17162
17188
|
};
|
|
17163
17189
|
};
|
|
17190
|
+
"/users/{id}/mfa": {
|
|
17191
|
+
/** Retrieve user MFA status. */
|
|
17192
|
+
get: operations["GetUserMfa"];
|
|
17193
|
+
parameters: {
|
|
17194
|
+
path: {
|
|
17195
|
+
/** The resource identifier string. */
|
|
17196
|
+
id: usersComponents["parameters"]["resourceId"];
|
|
17197
|
+
};
|
|
17198
|
+
};
|
|
17199
|
+
};
|
|
17164
17200
|
"/users/{id}/password": {
|
|
17165
17201
|
/** Updates user's password with the specified newPassword. And checks if. currentPassword matches the actual one. */
|
|
17166
17202
|
post: operations["PostUserPasswordChange"];
|
|
@@ -17446,7 +17482,6 @@ export interface usersComponents {
|
|
|
17446
17482
|
| "POLi"
|
|
17447
17483
|
| "PostFinance-card"
|
|
17448
17484
|
| "PostFinance-e-finance"
|
|
17449
|
-
| "Przelewy24"
|
|
17450
17485
|
| "QIWI"
|
|
17451
17486
|
| "QPay"
|
|
17452
17487
|
| "QQPay"
|
|
@@ -17689,6 +17724,8 @@ export interface usersComponents {
|
|
|
17689
17724
|
revision?: number;
|
|
17690
17725
|
/** Indicates if EDD is enabled for this customer. */
|
|
17691
17726
|
isEddRequired: boolean;
|
|
17727
|
+
/** Whether the customer has fulfilled a KYC request by providing valid identity and address documents. */
|
|
17728
|
+
hasFulfilledKyc?: boolean;
|
|
17692
17729
|
/** The links related to resource. */
|
|
17693
17730
|
_links?: (Partial<usersComponents["schemas"]["SelfLink"]> &
|
|
17694
17731
|
Partial<usersComponents["schemas"]["DefaultPaymentInstrumentLink"]> &
|
|
@@ -17888,6 +17925,7 @@ export interface usersComponents {
|
|
|
17888
17925
|
| "JetPay"
|
|
17889
17926
|
| "Jeton"
|
|
17890
17927
|
| "Khelocard"
|
|
17928
|
+
| "Klarna"
|
|
17891
17929
|
| "Konnektive"
|
|
17892
17930
|
| "loonie"
|
|
17893
17931
|
| "LPG"
|
|
@@ -18151,6 +18189,7 @@ export interface usersComponents {
|
|
|
18151
18189
|
| "Intuit"
|
|
18152
18190
|
| "Jeton"
|
|
18153
18191
|
| "Khelocard"
|
|
18192
|
+
| "Klarna"
|
|
18154
18193
|
| "Konnektive"
|
|
18155
18194
|
| "loonie"
|
|
18156
18195
|
| "LPG"
|
|
@@ -19864,6 +19903,21 @@ export interface usersComponents {
|
|
|
19864
19903
|
apiSecret: string;
|
|
19865
19904
|
};
|
|
19866
19905
|
};
|
|
19906
|
+
/** Klarna config. */
|
|
19907
|
+
Klarna: usersComponents["schemas"]["GatewayAccount"] & {
|
|
19908
|
+
/** Credentials object. */
|
|
19909
|
+
credentials: {
|
|
19910
|
+
/** Klarna API username. */
|
|
19911
|
+
username: string;
|
|
19912
|
+
/** Klarna API password. */
|
|
19913
|
+
password: string;
|
|
19914
|
+
};
|
|
19915
|
+
/** Settings object. */
|
|
19916
|
+
settings: {
|
|
19917
|
+
/** Klarna API region. */
|
|
19918
|
+
region: "EU" | "NA" | "OC";
|
|
19919
|
+
};
|
|
19920
|
+
};
|
|
19867
19921
|
/** Konnektive config. */
|
|
19868
19922
|
Konnektive: usersComponents["schemas"]["GatewayAccount"] & {
|
|
19869
19923
|
/** Credentials object. */
|
|
@@ -20128,6 +20182,9 @@ export interface usersComponents {
|
|
|
20128
20182
|
uid: string;
|
|
20129
20183
|
wsk: string;
|
|
20130
20184
|
};
|
|
20185
|
+
settings?: {
|
|
20186
|
+
useRecurringApi: boolean;
|
|
20187
|
+
};
|
|
20131
20188
|
};
|
|
20132
20189
|
/** Pagsmile Gateway config. */
|
|
20133
20190
|
Pagsmile: usersComponents["schemas"]["GatewayAccount"] & {
|
|
@@ -22393,6 +22450,7 @@ export interface usersComponents {
|
|
|
22393
22450
|
| "Onlineueberweisen"
|
|
22394
22451
|
| "oriental-wallet"
|
|
22395
22452
|
| "OXXO"
|
|
22453
|
+
| "P24"
|
|
22396
22454
|
| "Pagadito"
|
|
22397
22455
|
| "PagoEffectivo"
|
|
22398
22456
|
| "Pagsmile-deposit-express"
|
|
@@ -22415,7 +22473,6 @@ export interface usersComponents {
|
|
|
22415
22473
|
| "POLi"
|
|
22416
22474
|
| "PostFinance-card"
|
|
22417
22475
|
| "PostFinance-e-finance"
|
|
22418
|
-
| "Przelewy24"
|
|
22419
22476
|
| "QIWI"
|
|
22420
22477
|
| "QPay"
|
|
22421
22478
|
| "QQPay"
|
|
@@ -29175,6 +29232,26 @@ export interface operations {
|
|
|
29175
29232
|
};
|
|
29176
29233
|
requestBody: usersComponents["requestBodies"]["User"];
|
|
29177
29234
|
};
|
|
29235
|
+
/** Retrieve user MFA status. */
|
|
29236
|
+
GetUserMfa: {
|
|
29237
|
+
parameters: {
|
|
29238
|
+
path: {
|
|
29239
|
+
/** The resource identifier string. */
|
|
29240
|
+
id: usersComponents["parameters"]["resourceId"];
|
|
29241
|
+
};
|
|
29242
|
+
};
|
|
29243
|
+
responses: {
|
|
29244
|
+
/** User MFA status was retrieved successfully. */
|
|
29245
|
+
200: {
|
|
29246
|
+
content: {
|
|
29247
|
+
"application/json": usersComponents["schemas"]["ProfileMfa"];
|
|
29248
|
+
};
|
|
29249
|
+
};
|
|
29250
|
+
401: usersComponents["responses"]["Unauthorized"];
|
|
29251
|
+
403: usersComponents["responses"]["Forbidden"];
|
|
29252
|
+
404: usersComponents["responses"]["NotFound"];
|
|
29253
|
+
};
|
|
29254
|
+
};
|
|
29178
29255
|
/** Updates user's password with the specified newPassword. And checks if. currentPassword matches the actual one. */
|
|
29179
29256
|
PostUserPasswordChange: {
|
|
29180
29257
|
parameters: {
|
|
@@ -29914,7 +29991,6 @@ export interface storefrontComponents {
|
|
|
29914
29991
|
| "POLi"
|
|
29915
29992
|
| "PostFinance-card"
|
|
29916
29993
|
| "PostFinance-e-finance"
|
|
29917
|
-
| "Przelewy24"
|
|
29918
29994
|
| "QIWI"
|
|
29919
29995
|
| "QPay"
|
|
29920
29996
|
| "QQPay"
|
|
@@ -30134,6 +30210,7 @@ export interface storefrontComponents {
|
|
|
30134
30210
|
| "JetPay"
|
|
30135
30211
|
| "Jeton"
|
|
30136
30212
|
| "Khelocard"
|
|
30213
|
+
| "Klarna"
|
|
30137
30214
|
| "Konnektive"
|
|
30138
30215
|
| "loonie"
|
|
30139
30216
|
| "LPG"
|
|
@@ -31367,6 +31444,7 @@ export interface storefrontComponents {
|
|
|
31367
31444
|
| "Onlineueberweisen"
|
|
31368
31445
|
| "oriental-wallet"
|
|
31369
31446
|
| "OXXO"
|
|
31447
|
+
| "P24"
|
|
31370
31448
|
| "Pagadito"
|
|
31371
31449
|
| "PagoEffectivo"
|
|
31372
31450
|
| "Pagsmile-deposit-express"
|
|
@@ -31389,7 +31467,6 @@ export interface storefrontComponents {
|
|
|
31389
31467
|
| "POLi"
|
|
31390
31468
|
| "PostFinance-card"
|
|
31391
31469
|
| "PostFinance-e-finance"
|
|
31392
|
-
| "Przelewy24"
|
|
31393
31470
|
| "QIWI"
|
|
31394
31471
|
| "QPay"
|
|
31395
31472
|
| "QQPay"
|
|
@@ -36930,6 +37007,10 @@ declare module "resources/experimental/reports-resource" {
|
|
|
36930
37007
|
periodStart: any;
|
|
36931
37008
|
periodEnd: any;
|
|
36932
37009
|
}): any;
|
|
37010
|
+
getKycRequestSummary({ periodStart, periodEnd }?: {
|
|
37011
|
+
periodStart: any;
|
|
37012
|
+
periodEnd: any;
|
|
37013
|
+
}): any;
|
|
36933
37014
|
getRulesMatchedSummary({ eventType, periodStart, periodEnd, limit, offset, tz }?: {
|
|
36934
37015
|
eventType: any;
|
|
36935
37016
|
periodStart: any;
|
|
@@ -36971,6 +37052,14 @@ declare module "resources/experimental/reports-resource" {
|
|
|
36971
37052
|
criteria?: any;
|
|
36972
37053
|
tz?: any;
|
|
36973
37054
|
}): any;
|
|
37055
|
+
getRevenueWaterfall({ issuedFrom, issuedTo, recognizedTo, limit, offset, tz }: {
|
|
37056
|
+
issuedFrom: any;
|
|
37057
|
+
issuedTo: any;
|
|
37058
|
+
recognizedTo: any;
|
|
37059
|
+
limit?: any;
|
|
37060
|
+
offset?: any;
|
|
37061
|
+
tz?: any;
|
|
37062
|
+
}): any;
|
|
36974
37063
|
getSubscriptionCancellation({ aggregationField, periodStart, periodEnd, limit, offset, filter, criteria, tz }?: {
|
|
36975
37064
|
aggregationField: any;
|
|
36976
37065
|
periodStart: any;
|
|
@@ -37177,6 +37266,10 @@ declare module "resources/experimental/experimental-resources" {
|
|
|
37177
37266
|
periodStart: any;
|
|
37178
37267
|
periodEnd: any;
|
|
37179
37268
|
}): any;
|
|
37269
|
+
getKycRequestSummary({ periodStart, periodEnd }?: {
|
|
37270
|
+
periodStart: any;
|
|
37271
|
+
periodEnd: any;
|
|
37272
|
+
}): any;
|
|
37180
37273
|
getRulesMatchedSummary({ eventType, periodStart, periodEnd, limit, offset, tz }?: {
|
|
37181
37274
|
eventType: any;
|
|
37182
37275
|
periodStart: any;
|
|
@@ -37218,6 +37311,14 @@ declare module "resources/experimental/experimental-resources" {
|
|
|
37218
37311
|
criteria?: any;
|
|
37219
37312
|
tz?: any;
|
|
37220
37313
|
}): any;
|
|
37314
|
+
getRevenueWaterfall({ issuedFrom, issuedTo, recognizedTo, limit, offset, tz }: {
|
|
37315
|
+
issuedFrom: any;
|
|
37316
|
+
issuedTo: any;
|
|
37317
|
+
recognizedTo: any;
|
|
37318
|
+
limit?: any;
|
|
37319
|
+
offset?: any;
|
|
37320
|
+
tz?: any;
|
|
37321
|
+
}): any;
|
|
37221
37322
|
getSubscriptionCancellation({ aggregationField, periodStart, periodEnd, limit, offset, filter, criteria, tz }?: {
|
|
37222
37323
|
aggregationField: any;
|
|
37223
37324
|
periodStart: any;
|
|
@@ -1583,21 +1583,13 @@ function cloneArrayDeep(arr, instanceClone) {
|
|
|
1583
1583
|
return res;
|
|
1584
1584
|
}
|
|
1585
1585
|
var cloneDeep_1 = cloneDeep;
|
|
1586
|
-
const version = "47.
|
|
1586
|
+
const version = "47.3.1";
|
|
1587
|
+
let urlAlphabet = "useandom-26T198340PX75pxJACKVERYMINDBUSHWOLF_GQZbfghjklqvwyzrict";
|
|
1587
1588
|
let nanoid = (size = 21) => {
|
|
1588
1589
|
let id = "";
|
|
1589
|
-
let
|
|
1590
|
-
while (
|
|
1591
|
-
|
|
1592
|
-
if (byte < 36) {
|
|
1593
|
-
id += byte.toString(36);
|
|
1594
|
-
} else if (byte < 62) {
|
|
1595
|
-
id += (byte - 26).toString(36).toUpperCase();
|
|
1596
|
-
} else if (byte < 63) {
|
|
1597
|
-
id += "_";
|
|
1598
|
-
} else {
|
|
1599
|
-
id += "-";
|
|
1600
|
-
}
|
|
1590
|
+
let i = size;
|
|
1591
|
+
while (i--) {
|
|
1592
|
+
id += urlAlphabet[Math.random() * 64 | 0];
|
|
1601
1593
|
}
|
|
1602
1594
|
return id;
|
|
1603
1595
|
};
|
|
@@ -4119,6 +4111,13 @@ function ReportsResource({ apiHandler }) {
|
|
|
4119
4111
|
};
|
|
4120
4112
|
return apiHandler.get(`reports/kyc-rejection-summary`, params);
|
|
4121
4113
|
},
|
|
4114
|
+
getKycRequestSummary({ periodStart, periodEnd } = {}) {
|
|
4115
|
+
const params = {
|
|
4116
|
+
periodStart,
|
|
4117
|
+
periodEnd
|
|
4118
|
+
};
|
|
4119
|
+
return apiHandler.get(`reports/kyc-request-summary`, params);
|
|
4120
|
+
},
|
|
4122
4121
|
getRulesMatchedSummary({ eventType, periodStart, periodEnd, limit = null, offset = null, tz = null } = {}) {
|
|
4123
4122
|
const params = {
|
|
4124
4123
|
periodStart,
|
|
@@ -4171,6 +4170,17 @@ function ReportsResource({ apiHandler }) {
|
|
|
4171
4170
|
};
|
|
4172
4171
|
return apiHandler.get(`reports/retention-value`, params);
|
|
4173
4172
|
},
|
|
4173
|
+
getRevenueWaterfall({ issuedFrom, issuedTo, recognizedTo, limit = null, offset = null, tz = null }) {
|
|
4174
|
+
const params = {
|
|
4175
|
+
issuedFrom,
|
|
4176
|
+
issuedTo,
|
|
4177
|
+
recognizedTo,
|
|
4178
|
+
limit,
|
|
4179
|
+
offset,
|
|
4180
|
+
tz
|
|
4181
|
+
};
|
|
4182
|
+
return apiHandler.get("reports/revenue-waterfall", params);
|
|
4183
|
+
},
|
|
4174
4184
|
getSubscriptionCancellation({ aggregationField, periodStart, periodEnd, limit = null, offset = null, filter = null, criteria = null, tz = null } = {}) {
|
|
4175
4185
|
const params = {
|
|
4176
4186
|
aggregationField,
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
var
|
|
2
|
-
`),function(l){if(u=l.indexOf(":"),n=ie.trim(l.substr(0,u)).toLowerCase(),s=ie.trim(l.substr(u+1)),n){if(r[n]&&qt.indexOf(n)>=0)return;n==="set-cookie"?r[n]=(r[n]?r[n]:[]).concat([s]):r[n]=r[n]?r[n]+", "+s:s}}),r},Ie=v,Nt=Ie.isStandardBrowserEnv()?function(){var e=/(msie|trident)/i.test(navigator.userAgent),r=document.createElement("a"),n;function s(u){var o=u;return e&&(r.setAttribute("href",o),o=r.href),r.setAttribute("href",o),{href:r.href,protocol:r.protocol?r.protocol.replace(/:$/,""):"",host:r.host,search:r.search?r.search.replace(/^\?/,""):"",hash:r.hash?r.hash.replace(/^#/,""):"",hostname:r.hostname,port:r.port,pathname:r.pathname.charAt(0)==="/"?r.pathname:"/"+r.pathname}}return n=s(window.location.href),function(o){var l=Ie.isString(o)?s(o):o;return l.protocol===n.protocol&&l.host===n.host}}():function(){return function(){return!0}}();function ce(t){this.message=t}ce.prototype.toString=function(){return"Cancel"+(this.message?": "+this.message:"")},ce.prototype.__CANCEL__=!0;var Y=ce,Q=v,Mt=Ct,Bt=Tt,Ut=ke,Lt=jt,Ft=Dt,Vt=Nt,ae=xe,Kt=Te,_t=Y,Pe=function(e){return new Promise(function(n,s){var u=e.data,o=e.headers,l=e.responseType,a;function m(){e.cancelToken&&e.cancelToken.unsubscribe(a),e.signal&&e.signal.removeEventListener("abort",a)}Q.isFormData(u)&&delete o["Content-Type"];var c=new XMLHttpRequest;if(e.auth){var h=e.auth.username||"",w=e.auth.password?unescape(encodeURIComponent(e.auth.password)):"";o.Authorization="Basic "+btoa(h+":"+w)}var y=Lt(e.baseURL,e.url);c.open(e.method.toUpperCase(),Ut(y,e.params,e.paramsSerializer),!0),c.timeout=e.timeout;function K(){if(!!c){var E="getAllResponseHeaders"in c?Ft(c.getAllResponseHeaders()):null,P=!l||l==="text"||l==="json"?c.responseText:c.response,T={data:P,status:c.status,statusText:c.statusText,headers:E,config:e,request:c};Mt(function(_){n(_),m()},function(_){s(_),m()},T),c=null}}if("onloadend"in c?c.onloadend=K:c.onreadystatechange=function(){!c||c.readyState!==4||c.status===0&&!(c.responseURL&&c.responseURL.indexOf("file:")===0)||setTimeout(K)},c.onabort=function(){!c||(s(ae("Request aborted",e,"ECONNABORTED",c)),c=null)},c.onerror=function(){s(ae("Network Error",e,null,c)),c=null},c.ontimeout=function(){var P=e.timeout?"timeout of "+e.timeout+"ms exceeded":"timeout exceeded",T=e.transitional||Kt;e.timeoutErrorMessage&&(P=e.timeoutErrorMessage),s(ae(P,e,T.clarifyTimeoutError?"ETIMEDOUT":"ECONNABORTED",c)),c=null},Q.isStandardBrowserEnv()){var ne=(e.withCredentials||Vt(y))&&e.xsrfCookieName?Bt.read(e.xsrfCookieName):void 0;ne&&(o[e.xsrfHeaderName]=ne)}"setRequestHeader"in c&&Q.forEach(o,function(P,T){typeof u=="undefined"&&T.toLowerCase()==="content-type"?delete o[T]:c.setRequestHeader(T,P)}),Q.isUndefined(e.withCredentials)||(c.withCredentials=!!e.withCredentials),l&&l!=="json"&&(c.responseType=e.responseType),typeof e.onDownloadProgress=="function"&&c.addEventListener("progress",e.onDownloadProgress),typeof e.onUploadProgress=="function"&&c.upload&&c.upload.addEventListener("progress",e.onUploadProgress),(e.cancelToken||e.signal)&&(a=function(E){!c||(s(!E||E&&E.type?new _t("canceled"):E),c.abort(),c=null)},e.cancelToken&&e.cancelToken.subscribe(a),e.signal&&(e.signal.aborted?a():e.signal.addEventListener("abort",a))),u||(u=null),c.send(u)})},b=v,Oe=Et,zt=Ce,Jt=Te,Wt={"Content-Type":"application/x-www-form-urlencoded"};function je(t,e){!b.isUndefined(t)&&b.isUndefined(t["Content-Type"])&&(t["Content-Type"]=e)}function Gt(){var t;return(typeof XMLHttpRequest!="undefined"||typeof process!="undefined"&&Object.prototype.toString.call(process)==="[object process]")&&(t=Pe),t}function Xt(t,e,r){if(b.isString(t))try{return(e||JSON.parse)(t),b.trim(t)}catch(n){if(n.name!=="SyntaxError")throw n}return(r||JSON.stringify)(t)}var Z={transitional:Jt,adapter:Gt(),transformRequest:[function(e,r){return Oe(r,"Accept"),Oe(r,"Content-Type"),b.isFormData(e)||b.isArrayBuffer(e)||b.isBuffer(e)||b.isStream(e)||b.isFile(e)||b.isBlob(e)?e:b.isArrayBufferView(e)?e.buffer:b.isURLSearchParams(e)?(je(r,"application/x-www-form-urlencoded;charset=utf-8"),e.toString()):b.isObject(e)||r&&r["Content-Type"]==="application/json"?(je(r,"application/json"),Xt(e)):e}],transformResponse:[function(e){var r=this.transitional||Z.transitional,n=r&&r.silentJSONParsing,s=r&&r.forcedJSONParsing,u=!n&&this.responseType==="json";if(u||s&&b.isString(e)&&e.length)try{return JSON.parse(e)}catch(o){if(u)throw o.name==="SyntaxError"?zt(o,this,"E_JSON_PARSE"):o}return e}],timeout:0,xsrfCookieName:"XSRF-TOKEN",xsrfHeaderName:"X-XSRF-TOKEN",maxContentLength:-1,maxBodyLength:-1,validateStatus:function(e){return e>=200&&e<300},headers:{common:{Accept:"application/json, text/plain, */*"}}};b.forEach(["delete","get","head"],function(e){Z.headers[e]={}}),b.forEach(["post","put","patch"],function(e){Z.headers[e]=b.merge(Wt)});var fe=Z,Yt=v,Qt=fe,Zt=function(e,r,n){var s=this||Qt;return Yt.forEach(n,function(o){e=o.call(s,e,r)}),e},qe=function(e){return!!(e&&e.__CANCEL__)},De=v,me=Zt,Ht=qe,er=fe,tr=Y;function ge(t){if(t.cancelToken&&t.cancelToken.throwIfRequested(),t.signal&&t.signal.aborted)throw new tr("canceled")}var rr=function(e){ge(e),e.headers=e.headers||{},e.data=me.call(e,e.data,e.headers,e.transformRequest),e.headers=De.merge(e.headers.common||{},e.headers[e.method]||{},e.headers),De.forEach(["delete","get","head","post","put","patch","common"],function(s){delete e.headers[s]});var r=e.adapter||er.adapter;return r(e).then(function(s){return ge(e),s.data=me.call(e,s.data,s.headers,e.transformResponse),s},function(s){return Ht(s)||(ge(e),s&&s.response&&(s.response.data=me.call(e,s.response.data,s.response.headers,e.transformResponse))),Promise.reject(s)})},R=v,Ne=function(e,r){r=r||{};var n={};function s(c,h){return R.isPlainObject(c)&&R.isPlainObject(h)?R.merge(c,h):R.isPlainObject(h)?R.merge({},h):R.isArray(h)?h.slice():h}function u(c){if(R.isUndefined(r[c])){if(!R.isUndefined(e[c]))return s(void 0,e[c])}else return s(e[c],r[c])}function o(c){if(!R.isUndefined(r[c]))return s(void 0,r[c])}function l(c){if(R.isUndefined(r[c])){if(!R.isUndefined(e[c]))return s(void 0,e[c])}else return s(void 0,r[c])}function a(c){if(c in r)return s(e[c],r[c]);if(c in e)return s(void 0,e[c])}var m={url:o,method:o,data:o,baseURL:l,transformRequest:l,transformResponse:l,paramsSerializer:l,timeout:l,timeoutMessage:l,withCredentials:l,adapter:l,responseType:l,xsrfCookieName:l,xsrfHeaderName:l,onUploadProgress:l,onDownloadProgress:l,decompress:l,maxContentLength:l,maxBodyLength:l,transport:l,httpAgent:l,httpsAgent:l,cancelToken:l,socketPath:l,responseEncoding:l,validateStatus:a};return R.forEach(Object.keys(e).concat(Object.keys(r)),function(h){var w=m[h]||u,y=w(h);R.isUndefined(y)&&w!==a||(n[h]=y)}),n},Me={version:"0.26.1"},nr=Me.version,he={};["object","boolean","number","function","string","symbol"].forEach(function(t,e){he[t]=function(n){return typeof n===t||"a"+(e<1?"n ":" ")+t}});var Be={};he.transitional=function(e,r,n){function s(u,o){return"[Axios v"+nr+"] Transitional option '"+u+"'"+o+(n?". "+n:"")}return function(u,o,l){if(e===!1)throw new Error(s(o," has been removed"+(r?" in "+r:"")));return r&&!Be[o]&&(Be[o]=!0,console.warn(s(o," has been deprecated since v"+r+" and will be removed in the near future"))),e?e(u,o,l):!0}};function sr(t,e,r){if(typeof t!="object")throw new TypeError("options must be an object");for(var n=Object.keys(t),s=n.length;s-- >0;){var u=n[s],o=e[u];if(o){var l=t[u],a=l===void 0||o(l,u,t);if(a!==!0)throw new TypeError("option "+u+" must be "+a);continue}if(r!==!0)throw Error("Unknown option "+u)}}var ur={assertOptions:sr,validators:he},Ue=v,or=ke,Le=wt,Fe=rr,H=Ne,Ve=ur,B=Ve.validators;function F(t){this.defaults=t,this.interceptors={request:new Le,response:new Le}}F.prototype.request=function(e,r){typeof e=="string"?(r=r||{},r.url=e):r=e||{},r=H(this.defaults,r),r.method?r.method=r.method.toLowerCase():this.defaults.method?r.method=this.defaults.method.toLowerCase():r.method="get";var n=r.transitional;n!==void 0&&Ve.assertOptions(n,{silentJSONParsing:B.transitional(B.boolean),forcedJSONParsing:B.transitional(B.boolean),clarifyTimeoutError:B.transitional(B.boolean)},!1);var s=[],u=!0;this.interceptors.request.forEach(function(y){typeof y.runWhen=="function"&&y.runWhen(r)===!1||(u=u&&y.synchronous,s.unshift(y.fulfilled,y.rejected))});var o=[];this.interceptors.response.forEach(function(y){o.push(y.fulfilled,y.rejected)});var l;if(!u){var a=[Fe,void 0];for(Array.prototype.unshift.apply(a,s),a=a.concat(o),l=Promise.resolve(r);a.length;)l=l.then(a.shift(),a.shift());return l}for(var m=r;s.length;){var c=s.shift(),h=s.shift();try{m=c(m)}catch(w){h(w);break}}try{l=Fe(m)}catch(w){return Promise.reject(w)}for(;o.length;)l=l.then(o.shift(),o.shift());return l},F.prototype.getUri=function(e){return e=H(this.defaults,e),or(e.url,e.params,e.paramsSerializer).replace(/^\?/,"")},Ue.forEach(["delete","get","head","options"],function(e){F.prototype[e]=function(r,n){return this.request(H(n||{},{method:e,url:r,data:(n||{}).data}))}}),Ue.forEach(["post","put","patch"],function(e){F.prototype[e]=function(r,n,s){return this.request(H(s||{},{method:e,url:r,data:n}))}});var lr=F,ir=Y;function U(t){if(typeof t!="function")throw new TypeError("executor must be a function.");var e;this.promise=new Promise(function(s){e=s});var r=this;this.promise.then(function(n){if(!!r._listeners){var s,u=r._listeners.length;for(s=0;s<u;s++)r._listeners[s](n);r._listeners=null}}),this.promise.then=function(n){var s,u=new Promise(function(o){r.subscribe(o),s=o}).then(n);return u.cancel=function(){r.unsubscribe(s)},u},t(function(s){r.reason||(r.reason=new ir(s),e(r.reason))})}U.prototype.throwIfRequested=function(){if(this.reason)throw this.reason},U.prototype.subscribe=function(e){if(this.reason){e(this.reason);return}this._listeners?this._listeners.push(e):this._listeners=[e]},U.prototype.unsubscribe=function(e){if(!!this._listeners){var r=this._listeners.indexOf(e);r!==-1&&this._listeners.splice(r,1)}},U.source=function(){var e,r=new U(function(s){e=s});return{token:r,cancel:e}};var cr=U,ar=function(e){return function(n){return e.apply(null,n)}},fr=v,mr=function(e){return fr.isObject(e)&&e.isAxiosError===!0},Ke=v,gr=A,ee=lr,hr=Ne,pr=fe;function _e(t){var e=new ee(t),r=gr(ee.prototype.request,e);return Ke.extend(r,ee.prototype,e),Ke.extend(r,e),r.create=function(s){return _e(hr(t,s))},r}var k=_e(pr);k.Axios=ee,k.Cancel=Y,k.CancelToken=cr,k.isCancel=qe,k.VERSION=Me.version,k.all=function(e){return Promise.all(e)},k.spread=ar,k.isAxiosError=mr,p.exports=k,p.exports.default=k;var pe=p.exports;function te(t,{exclude:e=[]}={}){Object.freeze(t);const r=typeof t=="function";return Object.getOwnPropertyNames(t).forEach(n=>{(r?n!=="caller"&&n!=="callee"&&n!=="arguments":!0)&&t[n]!==null&&!e.includes(n)&&(typeof t[n]=="object"||typeof t[n]=="function")&&!Object.isFrozen(t[n])&&te(t[n],{exclude:e})}),t}class ze{constructor({data:e,status:r,statusText:n,headers:s},u={}){this.response={status:r,statusText:n,headers:s},this.fields=J({},e),this.config=u,te(this,{exclude:["cancelToken"]})}getJSON(){return JSON.parse(JSON.stringify({fields:this.fields}))}}const Je={limit:"pagination-limit",offset:"pagination-offset",total:"pagination-total"};class dr{constructor({data:e,status:r,statusText:n,headers:s},u={}){this.limit=null,this.offset=null,this.total=null,Object.keys(Je).forEach(o=>{const l=s[Je[o]];this[o]=l?Number(l):null}),this.response={status:r,statusText:n,headers:s},this.items=e.map(o=>new ze({data:o,status:r,statusText:n,headers:s})),this.config=u,te(this,{exclude:["cancelToken"]})}getJSON(){return JSON.parse(JSON.stringify({items:this.items}))}}class yr{constructor({data:e,status:r,statusText:n,headers:s},u={}){this.response={status:r,statusText:n,headers:s},this.data=e,this.config=u}}class C extends Error{constructor({error:e,name:r=null}){let{config:n=null,response:s=null,request:u=null,message:o=null}=e,l=o||"Request Error";s&&s.data&&s.data.error&&(l=s.data.error);super(l);this.name=r||"RebillyError",this.response=s,this.request=u,this.config=n,this.status=s&&s.status?s.status:null,this.statusText=s&&s.statusText?s.statusText:null,this.details=s&&s.data&&s.data.details?s.data.details:null,this.invalidFields=s&&s.data&&s.data.invalidFields?s.data.invalidFields:null}}class $r extends C{constructor(e){super({error:e,name:"RebillyRequestError"})}}class br extends C{constructor(e){super({error:e,name:"RebillyValidationError"})}}class Ar extends C{constructor(e){super({error:e,name:"RebillyNotFoundError"})}}class vr extends C{constructor(e){super({error:e,name:"RebillyConflictError"})}}class wr extends C{constructor(e){super({error:e,name:"RebillyForbiddenError"})}}class Rr extends C{constructor(e){super({error:e,name:"RebillyMethodNotAllowedError"})}}class Er extends C{constructor(e){super({error:e,name:"RebillyTimeoutError"})}}class Sr extends C{constructor(e){super({error:e,name:"RebillyCanceledError"})}}const S={RebillyError:C,RebillyRequestError:$r,RebillyValidationError:br,RebillyNotFoundError:Ar,RebillyConflictError:vr,RebillyForbiddenError:wr,RebillyMethodNotAllowedError:Rr,RebillyTimeoutError:Er,RebillyCanceledError:Sr};/*!
|
|
1
|
+
var Xs=Object.defineProperty;var ut=Object.getOwnPropertySymbols;var Ys=Object.prototype.hasOwnProperty,Qs=Object.prototype.propertyIsEnumerable;var Ae=(d,p,A)=>p in d?Xs(d,p,{enumerable:!0,configurable:!0,writable:!0,value:A}):d[p]=A,J=(d,p)=>{for(var A in p||(p={}))Ys.call(p,A)&&Ae(d,A,p[A]);if(ut)for(var A of ut(p))Qs.call(p,A)&&Ae(d,A,p[A]);return d};var ve=(d,p,A)=>(Ae(d,typeof p!="symbol"?p+"":p,A),A);(function(d,p){typeof exports=="object"&&typeof module!="undefined"?p(exports):typeof define=="function"&&define.amd?define(["exports"],p):(d=typeof globalThis!="undefined"?globalThis:d||self,p(d["rebilly-js-sdk"]={}))})(this,function(d){"use strict";var p={exports:{}},A=function(e,r){return function(){for(var s=new Array(arguments.length),u=0;u<s.length;u++)s[u]=arguments[u];return e.apply(r,s)}},ot=A,I=Object.prototype.toString;function se(t){return Array.isArray(t)}function ue(t){return typeof t=="undefined"}function lt(t){return t!==null&&!ue(t)&&t.constructor!==null&&!ue(t.constructor)&&typeof t.constructor.isBuffer=="function"&&t.constructor.isBuffer(t)}function we(t){return I.call(t)==="[object ArrayBuffer]"}function it(t){return I.call(t)==="[object FormData]"}function ct(t){var e;return typeof ArrayBuffer!="undefined"&&ArrayBuffer.isView?e=ArrayBuffer.isView(t):e=t&&t.buffer&&we(t.buffer),e}function at(t){return typeof t=="string"}function ft(t){return typeof t=="number"}function Re(t){return t!==null&&typeof t=="object"}function W(t){if(I.call(t)!=="[object Object]")return!1;var e=Object.getPrototypeOf(t);return e===null||e===Object.prototype}function mt(t){return I.call(t)==="[object Date]"}function gt(t){return I.call(t)==="[object File]"}function ht(t){return I.call(t)==="[object Blob]"}function Ee(t){return I.call(t)==="[object Function]"}function pt(t){return Re(t)&&Ee(t.pipe)}function dt(t){return I.call(t)==="[object URLSearchParams]"}function yt(t){return t.trim?t.trim():t.replace(/^\s+|\s+$/g,"")}function $t(){return typeof navigator!="undefined"&&(navigator.product==="ReactNative"||navigator.product==="NativeScript"||navigator.product==="NS")?!1:typeof window!="undefined"&&typeof document!="undefined"}function oe(t,e){if(!(t===null||typeof t=="undefined"))if(typeof t!="object"&&(t=[t]),se(t))for(var r=0,n=t.length;r<n;r++)e.call(null,t[r],r,t);else for(var s in t)Object.prototype.hasOwnProperty.call(t,s)&&e.call(null,t[s],s,t)}function le(){var t={};function e(s,u){W(t[u])&&W(s)?t[u]=le(t[u],s):W(s)?t[u]=le({},s):se(s)?t[u]=s.slice():t[u]=s}for(var r=0,n=arguments.length;r<n;r++)oe(arguments[r],e);return t}function bt(t,e,r){return oe(e,function(s,u){r&&typeof s=="function"?t[u]=ot(s,r):t[u]=s}),t}function At(t){return t.charCodeAt(0)===65279&&(t=t.slice(1)),t}var v={isArray:se,isArrayBuffer:we,isBuffer:lt,isFormData:it,isArrayBufferView:ct,isString:at,isNumber:ft,isObject:Re,isPlainObject:W,isUndefined:ue,isDate:mt,isFile:gt,isBlob:ht,isFunction:Ee,isStream:pt,isURLSearchParams:dt,isStandardBrowserEnv:$t,forEach:oe,merge:le,extend:bt,trim:yt,stripBOM:At},M=v;function Se(t){return encodeURIComponent(t).replace(/%3A/gi,":").replace(/%24/g,"$").replace(/%2C/gi,",").replace(/%20/g,"+").replace(/%5B/gi,"[").replace(/%5D/gi,"]")}var ke=function(e,r,n){if(!r)return e;var s;if(n)s=n(r);else if(M.isURLSearchParams(r))s=r.toString();else{var u=[];M.forEach(r,function(a,m){a===null||typeof a=="undefined"||(M.isArray(a)?m=m+"[]":a=[a],M.forEach(a,function(h){M.isDate(h)?h=h.toISOString():M.isObject(h)&&(h=JSON.stringify(h)),u.push(Se(m)+"="+Se(h))}))}),s=u.join("&")}if(s){var o=e.indexOf("#");o!==-1&&(e=e.slice(0,o)),e+=(e.indexOf("?")===-1?"?":"&")+s}return e},vt=v;function G(){this.handlers=[]}G.prototype.use=function(e,r,n){return this.handlers.push({fulfilled:e,rejected:r,synchronous:n?n.synchronous:!1,runWhen:n?n.runWhen:null}),this.handlers.length-1},G.prototype.eject=function(e){this.handlers[e]&&(this.handlers[e]=null)},G.prototype.forEach=function(e){vt.forEach(this.handlers,function(n){n!==null&&e(n)})};var wt=G,Rt=v,Et=function(e,r){Rt.forEach(e,function(s,u){u!==r&&u.toUpperCase()===r.toUpperCase()&&(e[r]=s,delete e[u])})},Ce=function(e,r,n,s,u){return e.config=r,n&&(e.code=n),e.request=s,e.response=u,e.isAxiosError=!0,e.toJSON=function(){return{message:this.message,name:this.name,description:this.description,number:this.number,fileName:this.fileName,lineNumber:this.lineNumber,columnNumber:this.columnNumber,stack:this.stack,config:this.config,code:this.code,status:this.response&&this.response.status?this.response.status:null}},e},Te={silentJSONParsing:!0,forcedJSONParsing:!0,clarifyTimeoutError:!1},St=Ce,xe=function(e,r,n,s,u){var o=new Error(e);return St(o,r,n,s,u)},kt=xe,Ct=function(e,r,n){var s=n.config.validateStatus;!n.status||!s||s(n.status)?e(n):r(kt("Request failed with status code "+n.status,n.config,null,n.request,n))},X=v,Tt=X.isStandardBrowserEnv()?function(){return{write:function(r,n,s,u,o,l){var a=[];a.push(r+"="+encodeURIComponent(n)),X.isNumber(s)&&a.push("expires="+new Date(s).toGMTString()),X.isString(u)&&a.push("path="+u),X.isString(o)&&a.push("domain="+o),l===!0&&a.push("secure"),document.cookie=a.join("; ")},read:function(r){var n=document.cookie.match(new RegExp("(^|;\\s*)("+r+")=([^;]*)"));return n?decodeURIComponent(n[3]):null},remove:function(r){this.write(r,"",Date.now()-864e5)}}}():function(){return{write:function(){},read:function(){return null},remove:function(){}}}(),xt=function(e){return/^([a-z][a-z\d+\-.]*:)?\/\//i.test(e)},It=function(e,r){return r?e.replace(/\/+$/,"")+"/"+r.replace(/^\/+/,""):e},Pt=xt,Ot=It,jt=function(e,r){return e&&!Pt(r)?Ot(e,r):r},ie=v,qt=["age","authorization","content-length","content-type","etag","expires","from","host","if-modified-since","if-unmodified-since","last-modified","location","max-forwards","proxy-authorization","referer","retry-after","user-agent"],Dt=function(e){var r={},n,s,u;return e&&ie.forEach(e.split(`
|
|
2
|
+
`),function(l){if(u=l.indexOf(":"),n=ie.trim(l.substr(0,u)).toLowerCase(),s=ie.trim(l.substr(u+1)),n){if(r[n]&&qt.indexOf(n)>=0)return;n==="set-cookie"?r[n]=(r[n]?r[n]:[]).concat([s]):r[n]=r[n]?r[n]+", "+s:s}}),r},Ie=v,Nt=Ie.isStandardBrowserEnv()?function(){var e=/(msie|trident)/i.test(navigator.userAgent),r=document.createElement("a"),n;function s(u){var o=u;return e&&(r.setAttribute("href",o),o=r.href),r.setAttribute("href",o),{href:r.href,protocol:r.protocol?r.protocol.replace(/:$/,""):"",host:r.host,search:r.search?r.search.replace(/^\?/,""):"",hash:r.hash?r.hash.replace(/^#/,""):"",hostname:r.hostname,port:r.port,pathname:r.pathname.charAt(0)==="/"?r.pathname:"/"+r.pathname}}return n=s(window.location.href),function(o){var l=Ie.isString(o)?s(o):o;return l.protocol===n.protocol&&l.host===n.host}}():function(){return function(){return!0}}();function ce(t){this.message=t}ce.prototype.toString=function(){return"Cancel"+(this.message?": "+this.message:"")},ce.prototype.__CANCEL__=!0;var Y=ce,Q=v,Mt=Ct,Bt=Tt,Ut=ke,Lt=jt,Ft=Dt,Kt=Nt,ae=xe,Vt=Te,zt=Y,Pe=function(e){return new Promise(function(n,s){var u=e.data,o=e.headers,l=e.responseType,a;function m(){e.cancelToken&&e.cancelToken.unsubscribe(a),e.signal&&e.signal.removeEventListener("abort",a)}Q.isFormData(u)&&delete o["Content-Type"];var c=new XMLHttpRequest;if(e.auth){var h=e.auth.username||"",w=e.auth.password?unescape(encodeURIComponent(e.auth.password)):"";o.Authorization="Basic "+btoa(h+":"+w)}var y=Lt(e.baseURL,e.url);c.open(e.method.toUpperCase(),Ut(y,e.params,e.paramsSerializer),!0),c.timeout=e.timeout;function V(){if(!!c){var E="getAllResponseHeaders"in c?Ft(c.getAllResponseHeaders()):null,P=!l||l==="text"||l==="json"?c.responseText:c.response,T={data:P,status:c.status,statusText:c.statusText,headers:E,config:e,request:c};Mt(function(z){n(z),m()},function(z){s(z),m()},T),c=null}}if("onloadend"in c?c.onloadend=V:c.onreadystatechange=function(){!c||c.readyState!==4||c.status===0&&!(c.responseURL&&c.responseURL.indexOf("file:")===0)||setTimeout(V)},c.onabort=function(){!c||(s(ae("Request aborted",e,"ECONNABORTED",c)),c=null)},c.onerror=function(){s(ae("Network Error",e,null,c)),c=null},c.ontimeout=function(){var P=e.timeout?"timeout of "+e.timeout+"ms exceeded":"timeout exceeded",T=e.transitional||Vt;e.timeoutErrorMessage&&(P=e.timeoutErrorMessage),s(ae(P,e,T.clarifyTimeoutError?"ETIMEDOUT":"ECONNABORTED",c)),c=null},Q.isStandardBrowserEnv()){var ne=(e.withCredentials||Kt(y))&&e.xsrfCookieName?Bt.read(e.xsrfCookieName):void 0;ne&&(o[e.xsrfHeaderName]=ne)}"setRequestHeader"in c&&Q.forEach(o,function(P,T){typeof u=="undefined"&&T.toLowerCase()==="content-type"?delete o[T]:c.setRequestHeader(T,P)}),Q.isUndefined(e.withCredentials)||(c.withCredentials=!!e.withCredentials),l&&l!=="json"&&(c.responseType=e.responseType),typeof e.onDownloadProgress=="function"&&c.addEventListener("progress",e.onDownloadProgress),typeof e.onUploadProgress=="function"&&c.upload&&c.upload.addEventListener("progress",e.onUploadProgress),(e.cancelToken||e.signal)&&(a=function(E){!c||(s(!E||E&&E.type?new zt("canceled"):E),c.abort(),c=null)},e.cancelToken&&e.cancelToken.subscribe(a),e.signal&&(e.signal.aborted?a():e.signal.addEventListener("abort",a))),u||(u=null),c.send(u)})},b=v,Oe=Et,_t=Ce,Jt=Te,Wt={"Content-Type":"application/x-www-form-urlencoded"};function je(t,e){!b.isUndefined(t)&&b.isUndefined(t["Content-Type"])&&(t["Content-Type"]=e)}function Gt(){var t;return(typeof XMLHttpRequest!="undefined"||typeof process!="undefined"&&Object.prototype.toString.call(process)==="[object process]")&&(t=Pe),t}function Xt(t,e,r){if(b.isString(t))try{return(e||JSON.parse)(t),b.trim(t)}catch(n){if(n.name!=="SyntaxError")throw n}return(r||JSON.stringify)(t)}var Z={transitional:Jt,adapter:Gt(),transformRequest:[function(e,r){return Oe(r,"Accept"),Oe(r,"Content-Type"),b.isFormData(e)||b.isArrayBuffer(e)||b.isBuffer(e)||b.isStream(e)||b.isFile(e)||b.isBlob(e)?e:b.isArrayBufferView(e)?e.buffer:b.isURLSearchParams(e)?(je(r,"application/x-www-form-urlencoded;charset=utf-8"),e.toString()):b.isObject(e)||r&&r["Content-Type"]==="application/json"?(je(r,"application/json"),Xt(e)):e}],transformResponse:[function(e){var r=this.transitional||Z.transitional,n=r&&r.silentJSONParsing,s=r&&r.forcedJSONParsing,u=!n&&this.responseType==="json";if(u||s&&b.isString(e)&&e.length)try{return JSON.parse(e)}catch(o){if(u)throw o.name==="SyntaxError"?_t(o,this,"E_JSON_PARSE"):o}return e}],timeout:0,xsrfCookieName:"XSRF-TOKEN",xsrfHeaderName:"X-XSRF-TOKEN",maxContentLength:-1,maxBodyLength:-1,validateStatus:function(e){return e>=200&&e<300},headers:{common:{Accept:"application/json, text/plain, */*"}}};b.forEach(["delete","get","head"],function(e){Z.headers[e]={}}),b.forEach(["post","put","patch"],function(e){Z.headers[e]=b.merge(Wt)});var fe=Z,Yt=v,Qt=fe,Zt=function(e,r,n){var s=this||Qt;return Yt.forEach(n,function(o){e=o.call(s,e,r)}),e},qe=function(e){return!!(e&&e.__CANCEL__)},De=v,me=Zt,Ht=qe,er=fe,tr=Y;function ge(t){if(t.cancelToken&&t.cancelToken.throwIfRequested(),t.signal&&t.signal.aborted)throw new tr("canceled")}var rr=function(e){ge(e),e.headers=e.headers||{},e.data=me.call(e,e.data,e.headers,e.transformRequest),e.headers=De.merge(e.headers.common||{},e.headers[e.method]||{},e.headers),De.forEach(["delete","get","head","post","put","patch","common"],function(s){delete e.headers[s]});var r=e.adapter||er.adapter;return r(e).then(function(s){return ge(e),s.data=me.call(e,s.data,s.headers,e.transformResponse),s},function(s){return Ht(s)||(ge(e),s&&s.response&&(s.response.data=me.call(e,s.response.data,s.response.headers,e.transformResponse))),Promise.reject(s)})},R=v,Ne=function(e,r){r=r||{};var n={};function s(c,h){return R.isPlainObject(c)&&R.isPlainObject(h)?R.merge(c,h):R.isPlainObject(h)?R.merge({},h):R.isArray(h)?h.slice():h}function u(c){if(R.isUndefined(r[c])){if(!R.isUndefined(e[c]))return s(void 0,e[c])}else return s(e[c],r[c])}function o(c){if(!R.isUndefined(r[c]))return s(void 0,r[c])}function l(c){if(R.isUndefined(r[c])){if(!R.isUndefined(e[c]))return s(void 0,e[c])}else return s(void 0,r[c])}function a(c){if(c in r)return s(e[c],r[c]);if(c in e)return s(void 0,e[c])}var m={url:o,method:o,data:o,baseURL:l,transformRequest:l,transformResponse:l,paramsSerializer:l,timeout:l,timeoutMessage:l,withCredentials:l,adapter:l,responseType:l,xsrfCookieName:l,xsrfHeaderName:l,onUploadProgress:l,onDownloadProgress:l,decompress:l,maxContentLength:l,maxBodyLength:l,transport:l,httpAgent:l,httpsAgent:l,cancelToken:l,socketPath:l,responseEncoding:l,validateStatus:a};return R.forEach(Object.keys(e).concat(Object.keys(r)),function(h){var w=m[h]||u,y=w(h);R.isUndefined(y)&&w!==a||(n[h]=y)}),n},Me={version:"0.26.1"},nr=Me.version,he={};["object","boolean","number","function","string","symbol"].forEach(function(t,e){he[t]=function(n){return typeof n===t||"a"+(e<1?"n ":" ")+t}});var Be={};he.transitional=function(e,r,n){function s(u,o){return"[Axios v"+nr+"] Transitional option '"+u+"'"+o+(n?". "+n:"")}return function(u,o,l){if(e===!1)throw new Error(s(o," has been removed"+(r?" in "+r:"")));return r&&!Be[o]&&(Be[o]=!0,console.warn(s(o," has been deprecated since v"+r+" and will be removed in the near future"))),e?e(u,o,l):!0}};function sr(t,e,r){if(typeof t!="object")throw new TypeError("options must be an object");for(var n=Object.keys(t),s=n.length;s-- >0;){var u=n[s],o=e[u];if(o){var l=t[u],a=l===void 0||o(l,u,t);if(a!==!0)throw new TypeError("option "+u+" must be "+a);continue}if(r!==!0)throw Error("Unknown option "+u)}}var ur={assertOptions:sr,validators:he},Ue=v,or=ke,Le=wt,Fe=rr,H=Ne,Ke=ur,B=Ke.validators;function F(t){this.defaults=t,this.interceptors={request:new Le,response:new Le}}F.prototype.request=function(e,r){typeof e=="string"?(r=r||{},r.url=e):r=e||{},r=H(this.defaults,r),r.method?r.method=r.method.toLowerCase():this.defaults.method?r.method=this.defaults.method.toLowerCase():r.method="get";var n=r.transitional;n!==void 0&&Ke.assertOptions(n,{silentJSONParsing:B.transitional(B.boolean),forcedJSONParsing:B.transitional(B.boolean),clarifyTimeoutError:B.transitional(B.boolean)},!1);var s=[],u=!0;this.interceptors.request.forEach(function(y){typeof y.runWhen=="function"&&y.runWhen(r)===!1||(u=u&&y.synchronous,s.unshift(y.fulfilled,y.rejected))});var o=[];this.interceptors.response.forEach(function(y){o.push(y.fulfilled,y.rejected)});var l;if(!u){var a=[Fe,void 0];for(Array.prototype.unshift.apply(a,s),a=a.concat(o),l=Promise.resolve(r);a.length;)l=l.then(a.shift(),a.shift());return l}for(var m=r;s.length;){var c=s.shift(),h=s.shift();try{m=c(m)}catch(w){h(w);break}}try{l=Fe(m)}catch(w){return Promise.reject(w)}for(;o.length;)l=l.then(o.shift(),o.shift());return l},F.prototype.getUri=function(e){return e=H(this.defaults,e),or(e.url,e.params,e.paramsSerializer).replace(/^\?/,"")},Ue.forEach(["delete","get","head","options"],function(e){F.prototype[e]=function(r,n){return this.request(H(n||{},{method:e,url:r,data:(n||{}).data}))}}),Ue.forEach(["post","put","patch"],function(e){F.prototype[e]=function(r,n,s){return this.request(H(s||{},{method:e,url:r,data:n}))}});var lr=F,ir=Y;function U(t){if(typeof t!="function")throw new TypeError("executor must be a function.");var e;this.promise=new Promise(function(s){e=s});var r=this;this.promise.then(function(n){if(!!r._listeners){var s,u=r._listeners.length;for(s=0;s<u;s++)r._listeners[s](n);r._listeners=null}}),this.promise.then=function(n){var s,u=new Promise(function(o){r.subscribe(o),s=o}).then(n);return u.cancel=function(){r.unsubscribe(s)},u},t(function(s){r.reason||(r.reason=new ir(s),e(r.reason))})}U.prototype.throwIfRequested=function(){if(this.reason)throw this.reason},U.prototype.subscribe=function(e){if(this.reason){e(this.reason);return}this._listeners?this._listeners.push(e):this._listeners=[e]},U.prototype.unsubscribe=function(e){if(!!this._listeners){var r=this._listeners.indexOf(e);r!==-1&&this._listeners.splice(r,1)}},U.source=function(){var e,r=new U(function(s){e=s});return{token:r,cancel:e}};var cr=U,ar=function(e){return function(n){return e.apply(null,n)}},fr=v,mr=function(e){return fr.isObject(e)&&e.isAxiosError===!0},Ve=v,gr=A,ee=lr,hr=Ne,pr=fe;function ze(t){var e=new ee(t),r=gr(ee.prototype.request,e);return Ve.extend(r,ee.prototype,e),Ve.extend(r,e),r.create=function(s){return ze(hr(t,s))},r}var k=ze(pr);k.Axios=ee,k.Cancel=Y,k.CancelToken=cr,k.isCancel=qe,k.VERSION=Me.version,k.all=function(e){return Promise.all(e)},k.spread=ar,k.isAxiosError=mr,p.exports=k,p.exports.default=k;var pe=p.exports;function te(t,{exclude:e=[]}={}){Object.freeze(t);const r=typeof t=="function";return Object.getOwnPropertyNames(t).forEach(n=>{(r?n!=="caller"&&n!=="callee"&&n!=="arguments":!0)&&t[n]!==null&&!e.includes(n)&&(typeof t[n]=="object"||typeof t[n]=="function")&&!Object.isFrozen(t[n])&&te(t[n],{exclude:e})}),t}class _e{constructor({data:e,status:r,statusText:n,headers:s},u={}){this.response={status:r,statusText:n,headers:s},this.fields=J({},e),this.config=u,te(this,{exclude:["cancelToken"]})}getJSON(){return JSON.parse(JSON.stringify({fields:this.fields}))}}const Je={limit:"pagination-limit",offset:"pagination-offset",total:"pagination-total"};class dr{constructor({data:e,status:r,statusText:n,headers:s},u={}){this.limit=null,this.offset=null,this.total=null,Object.keys(Je).forEach(o=>{const l=s[Je[o]];this[o]=l?Number(l):null}),this.response={status:r,statusText:n,headers:s},this.items=e.map(o=>new _e({data:o,status:r,statusText:n,headers:s})),this.config=u,te(this,{exclude:["cancelToken"]})}getJSON(){return JSON.parse(JSON.stringify({items:this.items}))}}class yr{constructor({data:e,status:r,statusText:n,headers:s},u={}){this.response={status:r,statusText:n,headers:s},this.data=e,this.config=u}}class C extends Error{constructor({error:e,name:r=null}){let{config:n=null,response:s=null,request:u=null,message:o=null}=e,l=o||"Request Error";s&&s.data&&s.data.error&&(l=s.data.error);super(l);this.name=r||"RebillyError",this.response=s,this.request=u,this.config=n,this.status=s&&s.status?s.status:null,this.statusText=s&&s.statusText?s.statusText:null,this.details=s&&s.data&&s.data.details?s.data.details:null,this.invalidFields=s&&s.data&&s.data.invalidFields?s.data.invalidFields:null}}class $r extends C{constructor(e){super({error:e,name:"RebillyRequestError"})}}class br extends C{constructor(e){super({error:e,name:"RebillyValidationError"})}}class Ar extends C{constructor(e){super({error:e,name:"RebillyNotFoundError"})}}class vr extends C{constructor(e){super({error:e,name:"RebillyConflictError"})}}class wr extends C{constructor(e){super({error:e,name:"RebillyForbiddenError"})}}class Rr extends C{constructor(e){super({error:e,name:"RebillyMethodNotAllowedError"})}}class Er extends C{constructor(e){super({error:e,name:"RebillyTimeoutError"})}}class Sr extends C{constructor(e){super({error:e,name:"RebillyCanceledError"})}}const S={RebillyError:C,RebillyRequestError:$r,RebillyValidationError:br,RebillyNotFoundError:Ar,RebillyConflictError:vr,RebillyForbiddenError:wr,RebillyMethodNotAllowedError:Rr,RebillyTimeoutError:Er,RebillyCanceledError:Sr};/*!
|
|
3
3
|
* isobject <https://github.com/jonschlinkert/isobject>
|
|
4
4
|
*
|
|
5
5
|
* Copyright (c) 2014-2017, Jon Schlinkert.
|
|
@@ -24,14 +24,14 @@ var Gs=Object.defineProperty;var ut=Object.getOwnPropertySymbols;var Xs=Object.p
|
|
|
24
24
|
*
|
|
25
25
|
* Copyright (c) 2015-2017, Jon Schlinkert.
|
|
26
26
|
* Released under the MIT License.
|
|
27
|
-
*/var Mr=Ge,Br=jr,Ur=Dr;function j(t){var e=Ur(t);return j.hasOwnProperty(e)?j[e](t):t}j.array=function(e){return e.slice()},j.date=function(e){return new Date(+e)},j.object=function(e){return Mr(e)?Br({},e):e},j.regexp=function(e){var r="";return r+=e.multiline?"m":"",r+=e.global?"g":"",r+=e.ignorecase?"i":"",new RegExp(e.source,r)};var Lr=j,Fr=Object.prototype.toString,
|
|
27
|
+
*/var Mr=Ge,Br=jr,Ur=Dr;function j(t){var e=Ur(t);return j.hasOwnProperty(e)?j[e](t):t}j.array=function(e){return e.slice()},j.date=function(e){return new Date(+e)},j.object=function(e){return Mr(e)?Br({},e):e},j.regexp=function(e){var r="";return r+=e.multiline?"m":"",r+=e.global?"g":"",r+=e.ignorecase?"i":"",new RegExp(e.source,r)};var Lr=j,Fr=Object.prototype.toString,Kr=function(e){var r=typeof e;return r==="undefined"?"undefined":e===null?"null":e===!0||e===!1||e instanceof Boolean?"boolean":r==="string"||e instanceof String?"string":r==="number"||e instanceof Number?"number":r==="function"||e instanceof Function?typeof e.constructor.name!="undefined"&&e.constructor.name.slice(0,9)==="Generator"?"generatorfunction":"function":typeof Array.isArray!="undefined"&&Array.isArray(e)?"array":e instanceof RegExp?"regexp":e instanceof Date?"date":(r=Fr.call(e),r==="[object RegExp]"?"regexp":r==="[object Date]"?"date":r==="[object Arguments]"?"arguments":r==="[object Error]"?"error":r==="[object Promise]"?"promise":Vr(e)?"buffer":r==="[object Set]"?"set":r==="[object WeakSet]"?"weakset":r==="[object Map]"?"map":r==="[object WeakMap]"?"weakmap":r==="[object Symbol]"?"symbol":r==="[object Map Iterator]"?"mapiterator":r==="[object Set Iterator]"?"setiterator":r==="[object String Iterator]"?"stringiterator":r==="[object Array Iterator]"?"arrayiterator":r==="[object Int8Array]"?"int8array":r==="[object Uint8Array]"?"uint8array":r==="[object Uint8ClampedArray]"?"uint8clampedarray":r==="[object Int16Array]"?"int16array":r==="[object Uint16Array]"?"uint16array":r==="[object Int32Array]"?"int32array":r==="[object Uint32Array]"?"uint32array":r==="[object Float32Array]"?"float32array":r==="[object Float64Array]"?"float64array":"object")};function Vr(t){return t.constructor&&typeof t.constructor.isBuffer=="function"&&t.constructor.isBuffer(t)}/*!
|
|
28
28
|
* for-in <https://github.com/jonschlinkert/for-in>
|
|
29
29
|
*
|
|
30
30
|
* Copyright (c) 2014-2017, Jon Schlinkert.
|
|
31
31
|
* Released under the MIT License.
|
|
32
|
-
*/var
|
|
32
|
+
*/var zr=function(e,r,n){for(var s in e)if(r.call(n,e[s],s,e)===!1)break};/*!
|
|
33
33
|
* for-own <https://github.com/jonschlinkert/for-own>
|
|
34
34
|
*
|
|
35
35
|
* Copyright (c) 2014-2017, Jon Schlinkert.
|
|
36
36
|
* Released under the MIT License.
|
|
37
|
-
*/var zr=_r,Jr=Object.prototype.hasOwnProperty,Wr=function(e,r,n){zr(e,function(s,u){if(Jr.call(e,u))return r.call(n,e[u],u,e)})},Gr=Tr,Xr=Lr,Yr=Vr,Qr=Wr;function de(t,e){switch(Yr(t)){case"object":return Zr(t,e);case"array":return Hr(t,e);default:return Xr(t)}}function Zr(t,e){if(Gr(t)){var r={};return Qr(t,function(n,s){this[s]=de(n,e)},r),r}else return e?e(t):t}function Hr(t,e){for(var r=t.length,n=[],s=-1;++s<r;)n[s]=de(t[s],e);return n}var en=de;const tn="47.0.0";let rn=(t=21)=>{let e="",r=crypto.getRandomValues(new Uint8Array(t));for(;t--;){let n=r[t]&63;n<36?e+=n.toString(36):n<62?e+=(n-26).toString(36).toUpperCase():n<63?e+="_":e+="-"}return e};class nn{constructor({id:e=null,created:r=null}={}){this.id=e||rn(),this.created=r||new Date().getTime(),this.cancelSource=pe.CancelToken.source(),this.cancel=this.cancelSource.cancel,this.cancelToken=this.cancelSource.token,te(this,{exclude:["cancelSource","cancelToken","cancel"]})}}class V{constructor(){if(V.instance)return V.instance;this.requests={},V.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 nn;return this.requests[e.id]=e,{id:e.id,cancelToken:e.cancelToken}}}var L=new V;class re{}ve(re,"cancelById",(e,r)=>{try{L.getById(e).cancel(r),L.deleteById(e)}catch{}}),ve(re,"cancelAll",e=>L.getAll().forEach(r=>{r.cancel(e),L.deleteById(r.id)}));var sn={cancelAll:(...t)=>re.cancelAll(...t)};const q={request:"request",response:"response"},Ye=t=>{if(!Object.values(q).includes(t))throw new Error(`There is no such interceptor type as "${t}"`);return!0};function ye({options:t}){const e=r();function r(){return pe.create(s())}function n(){return e}function s(){return{baseURL:u(),timeout:t.requestTimeout,headers:o()}}function u(){let i=t.isSandbox?t.apiEndpoints.sandbox:t.apiEndpoints.live;return t.apiVersion&&(i=`${i}/${t.apiVersion}`),t.organizationId&&(i=`${i}/organizations/${t.organizationId}`),`${i}`}function o(){const i={"REB-API-CONSUMER":`RebillySDK/JS-SDK ${tn}`};return t.apiKey&&(i["REB-APIKEY"]=t.apiKey),i}function l(){return en(e.defaults.headers)}function a(i){t.requestTimeout=Number(i),e.defaults.timeout=t.requestTimeout}function m(i=t.jwt){const f=l();t.apiKey=null,t.jwt=i,delete f.common["REB-APIKEY"],f.common.Authorization=`Bearer ${i}`,e.defaults.headers=f}function c(i=t.publishableKey){const f=l();t.publishableKey=i,f.common.Authorization=`${i}`,e.defaults.headers=f}function h({host:i,port:f,auth:g}){e.defaults.proxy={host:i,port:f,auth:g}}function w({live:i=null,sandbox:f=null}){i&&(t.apiEndpoints.live=i),f&&(t.apiEndpoints.sandbox=f),e.defaults.baseURL=u()}function y(i,{thenDelegate:f,catchDelegate:g=()=>{}}){return Ye(i)&&e.interceptors[q[i]].use(f,g)}function K(i,f){return Ye(i)&&e.interceptors[q[i]].eject(f)}function ne({thenDelegate:i,catchDelegate:f=()=>{}}){return y(q.request,{thenDelegate:i,catchDelegate:f})}function E(i){K(q.request,i)}function P({thenDelegate:i,catchDelegate:f=()=>{}}){return y(q.response,{thenDelegate:i,catchDelegate:f})}function T(i){K(q.response,i)}function x({request:i,isCollection:f,config:g}){const $=et(g),{id:O,cancelToken:Ws}=L.save();$.cancelToken=Ws;const st=async function(){try{const z=await i($);return _({response:z,isCollection:f,config:$})}catch(z){return He({error:z,config:$})}finally{L.deleteById(O)}}();return st.cancel=z=>re.cancelById(O,z),st}function _({response:i,isCollection:f,config:g}){return f?new dr(i,g):new ze(i,g)}function He({error:i}){if(pe.isCancel(i))throw new S.RebillyCanceledError(i);if(i.response)switch(Number(i.response.status)){case 401:throw new S.RebillyForbiddenError(i);case 404:throw new S.RebillyNotFoundError(i);case 405:throw new S.RebillyMethodNotAllowedError(i);case 409:throw new S.RebillyConflictError(i);case 422:throw new S.RebillyValidationError(i);default:throw new S.RebillyRequestError(i)}throw i.code==="ECONNABORTED"?new S.RebillyTimeoutError(i):new S.RebillyRequestError(i)}function Ls(i){return i.params!==void 0&&(i.params=Object.keys(i.params).filter(f=>i.params[f]!==null&&i.params[f]!=="").reduce((f,g)=>(f[g]=i.params[g],f),{})),i}function et(i={}){const f=Ls(i);return J({},f)}function tt(i,f={}){return x({request:g=>e.get(i,g),config:{params:f}})}function Fs(i,f){return x({request:g=>e.get(i,g),config:{params:f},isCollection:!0})}function rt(i,f,g={}){let $={};return g.authenticate===!1&&($={headers:l()},delete $.headers.common["REB-APIKEY"],delete $.headers.common.Authorization),g.params&&($.params=J({},g.params)),x({request:O=>e.post(i,f,O),config:$})}function nt(i,f,g={}){return x({request:$=>e.put(i,f,$),config:{params:g}})}function Vs(i,f){return x({request:g=>e.patch(i,f,g),config:{}})}function Ks(i){return x({request:f=>e.delete(i,f),config:{}})}function _s(i,f){return x({request:g=>e.delete(i,g),config:{data:J({},f)}})}async function zs(i,f,g,$={}){if(f==="")return rt(i,g,{params:$});try{if((await tt(i)).response.status===200)throw new S.RebillyConflictError({message:"Member already exists. Please use a different ID."})}catch(O){if(O.name==="RebillyNotFoundError")return nt(i,g,$);throw O}}async function Js(i,f){const g=et(f);try{const $=await e.get(i,g);return new yr($,g)}catch($){return He({error:$,config:g})}}return{getInstance:n,addRequestInterceptor:ne,removeRequestInterceptor:E,addResponseInterceptor:P,removeResponseInterceptor:T,setTimeout:a,setProxyAgent:h,setSessionToken:m,setPublishableKey:c,setEndpoints:w,get:tt,getAll:Fs,post:rt,put:nt,patch:Vs,delete:Ks,deleteAll:_s,create:zs,download:Js}}function un({apiHandler:t}){return{activate({token:e}){return t.post(`activation/${e}`,{authenticate:!1})},forgotPassword({data:e}){return t.post("forgot-password",e,{authenticate:!1})},logout(){return t.post("logout")},signIn({data:e}){return t.post("signin",e,{authenticate:!1})},signUp({data:e}){return t.post("signup",e,{authenticate:!1})}}}function on({apiHandler:t}){return{getAll({firstName:e,lastName:r,dob:n=null,country:s=null}){const u={firstName:e,lastName:r,dob:n,country:s};return t.getAll("aml",u)}}}function ln({apiHandler:t}){return{getAll({limit:e=null,offset:r=null,sort:n=null}={}){const s={limit:e,offset:r,sort:n};return t.getAll("api-keys",s)},create({id:e="",data:r}){return t.create(`api-keys/${e}`,e,r)},get({id:e}){return t.get(`api-keys/${e}`)},update({id:e,data:r}){return t.put(`api-keys/${e}`,r)},delete({id:e}){return t.delete(`api-keys/${e}`)}}}function cn({apiHandler:t}){return{get({applicationId:e}){return t.get(`application-instances/${e}`)},upsert({applicationId:e,data:r}){return t.put(`application-instances/${e}`,r)},delete({applicationId:e}){return t.delete(`application-instances/${e}`)}}}function an({apiHandler:t}){return{getAll({limit:e=null,offset:r=null,filter:n=null,q:s=null,expand:u=null,fields:o=null,sort:l=null}={}){const a={limit:e,offset:r,filter:n,q:s,expand:u,fields:o,sort:l};return t.getAll("applications",a)},create({data:e}){return t.post("applications",e)},get({id:e}){return t.get(`applications/${e}`)},getInstances({id:e}){return t.getAll(`applications/${e}/instances`)},getInstance({id:e,organizationId:r}){return t.get(`applications/${e}/instances/${r}`)}}}function fn({apiHandler:t}){return{getAll({limit:e=null,offset:r=null}={}){const n={limit:e,offset:r};return t.getAll("balance-transactions",n)},get({id:e}){return t.get(`balance-transactions/${e}`)}}}function mn({apiHandler:t}){return{getAll({limit:e=null,offset:r=null,sort:n=null,filter:s=null,q:u=null}={}){const o={limit:e,offset:r,sort:n,filter:s,q:u};return t.getAll("billing-portals",o)},create({id:e="",data:r}){return t.create(`billing-portals/${e}`,e,r)},get({id:e}){return t.get(`billing-portals/${e}`)},update({id:e,data:r}){return t.put(`billing-portals/${e}`,r)},delete({id:e}){return t.delete(`billing-portals/${e}`)}}}function gn({apiHandler:t}){return{getAll({limit:e=null,offset:r=null,sort:n=null,filter:s=null,q:u=null}={}){const o={limit:e,offset:r,sort:n,filter:s,q:u};return t.getAll("blocklists",o)},create({id:e="",data:r}){return t.create(`blocklists/${e}`,e,r)},get({id:e}){return t.get(`blocklists/${e}`)},delete({id:e}){return t.delete(`blocklists/${e}`)}}}function hn({apiHandler:t}){return{getAll({limit:e=null,offset:r=null,sort:n=null,filter:s=null}={}){const u={limit:e,offset:r,sort:n,filter:s};return t.getAll("broadcast-messages",u)},create({data:e}){return t.post("broadcast-messages",e)},get({id:e}){return t.get(`broadcast-messages/${e}`)},delete({id:e}){return t.delete(`broadcast-messages/${e}`)},update({id:e,data:r}){return t.patch(`broadcast-messages/${e}`,r)}}}function pn({apiHandler:t}){return{getAll({limit:e=null,offset:r=null,sort:n=null,filter:s=null,q:u=null}={}){const o={limit:e,offset:r,sort:n,filter:s,q:u};return t.getAll("checkout-forms",o)},create({id:e="",data:r}){return t.create(`checkout-forms/${e}`,e,r)},get({id:e}){return t.get(`checkout-forms/${e}`)},update({id:e,data:r}){return t.put(`checkout-forms/${e}`,r)},delete({id:e}){return t.delete(`checkout-forms/${e}`)}}}function dn({apiHandler:t}){return{getAllRedemptions({limit:e=null,offset:r=null,filter:n=null,q:s=null,sort:u=null}={}){const o={limit:e,offset:r,filter:n,q:s,sort:u};return t.getAll("coupons-redemptions",o)},redeem({data:e}){return t.post("coupons-redemptions",e)},getRedemption({id:e}){return t.get(`coupons-redemptions/${e}`)},cancelRedemption({id:e}){return t.post(`coupons-redemptions/${e}/cancel`)},getAll({limit:e=null,offset:r=null,filter:n=null,q:s=null,sort:u=null}={}){const o={limit:e,offset:r,filter:n,q:s,sort:u};return t.getAll("coupons",o)},create({id:e="",data:r}){return t.create(`coupons/${e}`,e,r)},get({id:e}){return t.get(`coupons/${e}`)},update({id:e,data:r}){return t.put(`coupons/${e}`,r)},setExpiration({id:e,data:r}){return t.post(`coupons/${e}/expiration`,r)}}}function yn({apiHandler:t}){return{createAWSSESCredential({data:e}){return t.post("credential-hashes/aws-ses",e)},getAWSSESCredential({hash:e}){return t.get(`credential-hashes/aws-ses/${e}`)},updateAWSSESCredential({hash:e,data:r}){return t.patch(`credential-hashes/aws-ses/${e}`,r)},createEmailCredential({data:e}){return t.post("credential-hashes/emails",e)},getEmailCredential({hash:e}){return t.get(`credential-hashes/emails/${e}`)},patchEmailCredential({hash:e,data:r}){return t.patch(`credential-hashes/emails/${e}`,r)},createMailgunCredential({data:e}){return t.post("credential-hashes/mailgun",e)},getMailgunCredential({hash:e}){return t.get(`credential-hashes/mailgun/${e}`)},patchMailgunCredential({hash:e,data:r}){return t.patch(`credential-hashes/mailgun/${e}`,r)},getAllOAuth2Credentials({filter:e=null,limit:r=null,offset:n=null,sort:s=null,q:u=null}={}){const o={filter:e,limit:r,offset:n,sort:s,q:u};return t.getAll("credential-hashes/oauth2",o)},createOAuth2Credential({data:e}){return t.post("credential-hashes/oauth2",e)},getOAuth2Credential({hash:e}){return t.get(`credential-hashes/oauth2/${e}`)},updateOAuth2Credential({hash:e,data:r}){return t.patch(`credential-hashes/oauth2/${e}`,r)},getOAuth2CredentialItems({hash:e,limit:r=null,offset:n=null,filter:s=null,q:u=null,fields:o=null,sort:l=null}){const a={limit:r,offset:n,filter:s,q:u,fields:o,sort:l};return t.getAll(`credential-hashes/oauth2/${e}/items`,a)},getAllPlaidCredentials({filter:e=null,limit:r=null,offset:n=null,sort:s=null,q:u=null}={}){const o={filter:e,limit:r,offset:n,sort:s,q:u};return t.getAll("credential-hashes/plaid",o)},createPlaidCredential({data:e}){return t.post("credential-hashes/plaid",e)},getPlaidCredential({hash:e}){return t.get(`credential-hashes/plaid/${e}`)},updatePlaidCredential({hash:e,data:r}){return t.patch(`credential-hashes/plaid/${e}`,r)},createPostmarkCredential({data:e}){return t.post("credential-hashes/postmark",e)},getPostmarkCredential({hash:e}){return t.get(`credential-hashes/postmark/${e}`)},patchPostmarkCredential({hash:e,data:r}){return t.patch(`credential-hashes/postmark/${e}`,r)},createSendGridCredential({data:e}){return t.post("credential-hashes/sendgrid",e)},getSendGridCredential({hash:e}){return t.get(`credential-hashes/sendgrid/${e}`)},patchSendGridCredential({hash:e,data:r}){return t.patch(`credential-hashes/sendgrid/${e}`,r)},createWebhookCredential({data:e}){return t.post("credential-hashes/webhooks",e)},getWebhookCredential({hash:e}){return t.get(`credential-hashes/webhooks/${e}`)},patchWebhookCredential({hash:e,data:r}){return t.patch(`credential-hashes/webhooks/${e}`,r)},getAllExperianCredentials({filter:e=null,limit:r=null,offset:n=null,sort:s=null,q:u=null}={}){const o={filter:e,limit:r,offset:n,sort:s,q:u};return t.getAll("credential-hashes/experian",o)},createExperianCredential({data:e}){return t.post("credential-hashes/experian",e)},getExperianCredential({hash:e}){return t.get(`credential-hashes/experian/${e}`)},updateExperianCredential({hash:e,data:r}){return t.patch(`credential-hashes/experian/${e}`,r)},getAllTaxJarCredentials({filter:e=null,limit:r=null,offset:n=null,sort:s=null,q:u=null}={}){const o={filter:e,limit:r,offset:n,sort:s,q:u};return t.getAll("credential-hashes/taxjar",o)},createTaxJarCredential({data:e}){return t.post("credential-hashes/taxjar",e)},getTaxJarCredential({hash:e}){return t.get(`credential-hashes/taxjar/${e}`)},updateTaxJarCredential({hash:e,data:r}){return t.patch(`credential-hashes/taxjar/${e}`,r)}}}function $n({apiHandler:t}){return{getAll({limit:e=null,offset:r=null,sort:n=null,filter:s=null,q:u=null}={}){const o={limit:e,offset:r,sort:n,filter:s,q:u};return t.getAll("custom-domains",o)},create({data:e}){return t.post("custom-domains",e)},get({domain:e}){return t.get(`custom-domains/${e}`)},delete({domain:e}){return t.delete(`custom-domains/${e}`)}}}function bn({apiHandler:t}){return{getAll({resource:e,limit:r=null,offset:n=null}){const s={limit:r,offset:n};return t.getAll(`custom-fields/${e}`,s)},get({resource:e,name:r}){return t.get(`custom-fields/${e}/${r}`)},create({resource:e,name:r,data:n}){return t.put(`custom-fields/${e}/${r}`,n)},update({resource:e,name:r,data:n}){return t.put(`custom-fields/${e}/${r}`,n)}}}function An({apiHandler:t}){return{getAuthOptions(){return t.get("authentication-options")},updateAuthOptions({data:e}){return t.put("authentication-options",e)},getAllAuthTokens({limit:e=null,offset:r=null}={}){const n={limit:e,offset:r};return t.getAll("authentication-tokens",n)},login({data:e}){return t.post("authentication-tokens",e)},verify({token:e}){return t.get(`authentication-tokens/${e}`)},logout({token:e}){return t.delete(`authentication-tokens/${e}`)},exchangeToken({token:e,data:r}){return t.post(`authentication-tokens/${e}/exchange`,r)},getAllCredentials({limit:e=null,offset:r=null}={}){const n={limit:e,offset:r};return t.getAll("credentials",n)},createCredential({id:e="",data:r}){return t.create(`credentials/${e}`,e,r)},getCredential({id:e}){return t.get(`credentials/${e}`)},updateCredential({id:e,data:r}){return t.put(`credentials/${e}`,r)},deleteCredential({id:e}){return t.delete(`credentials/${e}`)},getAllResetPasswordTokens({limit:e=null,offset:r=null}={}){const n={limit:e,offset:r};return t.getAll("password-tokens",n)},createResetPasswordToken({data:e}){return t.post("password-tokens",e)},getResetPasswordToken({id:e}){return t.get(`password-tokens/${e}`)},deleteResetPasswordToken({id:e}){return t.delete(`password-tokens/${e}`)}}}const D={Accept:"text/csv"},Qe={Accept:"application/pdf"};function vn({apiHandler:t}){return{getAll({limit:e=null,offset:r=null,filter:n=null,q:s=null,expand:u=null,fields:o=null,sort:l=null}={}){const a={limit:e,offset:r,filter:n,q:s,expand:u,fields:o,sort:l};return t.getAll("customers",a)},create({id:e="",data:r,expand:n=null}){const s={expand:n};return t.create(`customers/${e}`,e,r,s)},get({id:e,expand:r=null,fields:n=null}){const s={expand:r,fields:n};return t.get(`customers/${e}`,s)},update({id:e,data:r,expand:n=null}){const s={expand:n};return t.put(`customers/${e}`,r,s)},merge({id:e,targetCustomerId:r}){return t.delete(`customers/${e}?targetCustomerId=${r}`)},getAml({id:e}){return t.getAll(`customers/${e}/aml`)},getLeadSource({id:e}){return t.get(`customers/${e}/lead-source`)},createLeadSource({id:e,data:r}){return t.put(`customers/${e}/lead-source`,r)},updateLeadSource({id:e,data:r}){return t.put(`customers/${e}/lead-source`,r)},deleteLeadSource({id:e}){return t.delete(`customers/${e}/lead-source`)},getAllTimelineMessages({id:e,limit:r=null,offset:n=null,filter:s=null,sort:u=null,q:o=null}){const l={limit:r,offset:n,filter:s,sort:u,q:o};return t.getAll(`customers/${e}/timeline`,l)},createTimelineComment({id:e,data:r}){return t.post(`customers/${e}/timeline`,r)},getTimelineMessage({id:e,messageId:r}){return t.get(`customers/${e}/timeline/${r}`)},deleteTimelineMessage({id:e,messageId:r}){return t.delete(`customers/${e}/timeline/${r}`)},getAllUpcomingInvoices({id:e,expand:r=null}){const n={expand:r};return t.getAll(`customers/${e}/upcoming-invoices`,n)},getCustomerEddScore({id:e}){return t.get(`customers/${e}/edd-score`)},patchCustomerEddScore({id:e,data:r}){return t.patch(`customers/${e}/edd-score`,r)},getEddTimelineCollection({id:e,limit:r=null,offset:n=null,filter:s=null,sort:u=null,q:o=null}){const l={limit:r,offset:n,filter:s,sort:u,q:o};return t.getAll(`customers/${e}/edd-timeline`,l)},createEddTimelineComment({id:e,data:r}){return t.post(`customers/${e}/edd-timeline`,r)},GetEddSearchResults({id:e}){return t.get(`customers/${e}/edd-search-results`)},downloadCSV({limit:e=null,offset:r=null,sort:n=null,expand:s=null,filter:u=null,q:o=null}={}){const l={params:{limit:e,offset:r,sort:n,expand:s,filter:u,q:o},headers:D};return t.download("customers",l)}}}function wn({apiHandler:t}){return{create({data:e}){return t.post("digital-wallets/onboarding/apple-pay",e)},validate({data:e}){return t.post("digital-wallets/validation",e)}}}function Rn({apiHandler:t}){return{getAll({filter:e=null,sort:r=null,limit:n=null,offset:s=null,q:u=null,expand:o=null}={}){const l={filter:e,sort:r,limit:n,offset:s,q:u,expand:o};return t.getAll("disputes",l)},create({id:e="",data:r,expand:n=null}){const s={expand:n};return t.create(`disputes/${e}`,e,r,s)},get({id:e}){return t.get(`disputes/${e}`)},update({id:e,data:r,expand:n=null}){const s={expand:n};return t.put(`disputes/${e}`,r,s)},downloadCSV({limit:e=null,offset:r=null,sort:n=null,expand:s=null,filter:u=null,q:o=null}={}){const l={params:{limit:e,offset:r,sort:n,expand:s,filter:u,q:o},headers:D};return t.download("disputes",l)}}}function En({apiHandler:t}){return{verify({token:e}){return t.put(`email-delivery-setting-verifications/${e}`)},getAll({limit:e=null,offset:r=null,filter:n=null,sort:s=null,q:u=null}={}){const o={limit:e,offset:r,filter:n,sort:s,q:u};return t.getAll("email-delivery-settings",o)},create({data:e}){return t.post("email-delivery-settings",e)},get({id:e}){return t.get(`email-delivery-settings/${e}`)},delete({id:e}){return t.delete(`email-delivery-settings/${e}`)},update({id:e,data:r}){return t.patch(`email-delivery-settings/${e}`,r)},resendVerification({id:e}){return t.post(`email-delivery-settings/${e}/resend-email-verification`)}}}function Sn({apiHandler:t}){return{getAll({limit:e=null,offset:r=null,q:n=null,sort:s=null,filter:u=null}={}){const o={limit:e,offset:r,q:n,sort:s,filter:u};return t.getAll("email-messages",o)},create({data:e}){return t.post("email-messages",e)},get({id:e}){return t.get(`email-messages/${e}`)},delete({id:e}){return t.delete(`email-messages/${e}`)},send({id:e,data:r={status:"outbox"}}){return t.patch(`email-messages/${e}`,r)}}}function kn({apiHandler:t}){return{getAll(){return t.getAll("email-notifications")}}}function Cn({apiHandler:t}){return{getAll(){return t.getAll("events")},get({eventType:e}){return t.get(`events/${e}`)},getRules({eventType:e}){return t.get(`events/${e}/rules`)},createRules({eventType:e,data:r}){return t.put(`events/${e}/rules`,r)},updateRules({eventType:e,data:r}){return t.put(`events/${e}/rules`,r)},getAllTimelineMessages({eventType:e,limit:r=null,offset:n=null,filter:s=null,sort:u=null,q:o=null}){const l={limit:r,offset:n,filter:s,sort:u,q:o};return t.getAll(`events/${e}/timeline`,l)},createTimelineComment({eventType:e,data:r}){return t.post(`events/${e}/timeline`,r)},getTimelineMessage({eventType:e,messageId:r}){return t.get(`events/${e}/timeline/${r}`)},deleteTimelineMessage({eventType:e,messageId:r}){return t.delete(`events/${e}/timeline/${r}`)},getRulesHistory({eventType:e,limit:r=null,offset:n=null,filter:s=null,q:u=null,sort:o=null,fields:l=null,expand:a=null}){const m={limit:r,offset:n,filter:s,q:u,sort:o,fields:l,expand:a};return t.getAll(`events/${e}/rules/history`,m)},getRulesVersionNumber({eventType:e,version:r,fields:n=null,expand:s=null}){const u={fields:n,expand:s};return t.get(`events/${e}/rules/history/${r}`,u)},getRulesVersionDetail({eventType:e,version:r,fields:n=null,expand:s=null}){const u={fields:n,expand:s};return t.get(`events/${e}/rules/versions/${r}`,u)},getAllDraftRulesets({eventType:e,limit:r=null,offset:n=null,filter:s=null,q:u=null,sort:o=null,fields:l=null,expand:a=null}){const m={limit:r,offset:n,filter:s,q:u,sort:o,fields:l,expand:a};return t.getAll(`events/${e}/rules/drafts`,m)},createDraftRuleset({eventType:e,data:r}){return t.post(`events/${e}/rules/drafts`,r)},getDraftRuleset({eventType:e,id:r,fields:n=null,expand:s=null}){const u={fields:n,expand:s};return t.get(`events/${e}/rules/drafts/${r}`,u)},updateDraftRuleset({eventType:e,id:r,data:n}){return t.put(`events/${e}/rules/drafts/${r}`,n)},deleteDraftRuleset({eventType:e,id:r}){return t.delete(`events/${e}/rules/drafts/${r}`)}}}function Tn({apiHandler:t}){return{getAll({limit:e=null,offset:r=null}={}){const n={limit:e,offset:r};return t.getAll("fees",n)},create({id:e="",data:r}){return t.create(`fees/${e}`,e,r)},get({id:e}){return t.get(`fees/${e}`)},upsert({id:e,data:r}){return t.put(`fees/${e}`,r)},patch({id:e,data:r}){return t.patch(`fees/${e}`,r)}}}function xn({apiHandler:t}){return{getAllAttachments({limit:e=null,offset:r=null,filter:n=null,q:s=null,expand:u=null,fields:o=null,sort:l=null}={}){const a={limit:e,offset:r,filter:n,q:s,expand:u,fields:o,sort:l};return t.getAll("attachments",a)},attach({id:e="",data:r,expand:n=null}){const s={expand:n};return t.create(`attachments/${e}`,e,r,s)},getAttachment({id:e}){return t.get(`attachments/${e}`)},updateAttachment({id:e,data:r,expand:n=null}){const s={expand:n};return t.put(`attachments/${e}`,r,s)},detach({id:e}){return t.delete(`attachments/${e}`)},getAll({limit:e=null,offset:r=null,filter:n=null,q:s=null,expand:u=null,fields:o=null,sort:l=null}={}){const a={limit:e,offset:r,filter:n,q:s,expand:u,fields:o,sort:l};return t.getAll("files",a)},upload({fileObject:e}){return t.post("files",e)},get({id:e}){return t.get(`files/${e}`)},update({id:e,data:r}){return t.put(`files/${e}`,r)},delete({id:e}){return t.delete(`files/${e}`)},download({id:e}){const r={responseType:"arraybuffer"};return t.download(`files/${e}/download`,r)},detachAndDelete({id:e}){const r={filter:`fileId:${e}`};let n=[];const u=(async()=>{const o=this.getAllAttachments(r);n.push(o);const a=(await o).items.map(c=>this.detach({id:c.fields.id}));n=[...n,a],await Promise.all(a);const m=t.delete(`files/${e}`);return n.push(m),m})();return u.cancel=()=>{n.forEach(o=>o.cancel())},u},uploadAndUpdate({fileObject:e,data:r={description:"",tags:[""]}}){const n=[],u=(async()=>{const o=this.upload({fileObject:e});n.push(o),await o;const l={name:o.name,extension:o.extension,description:r.description,tags:r.tags,url:""},a=this.update({id:o.fields.id,data:l});return n.push(a),a})();return u.cancel=()=>{n.forEach(o=>o.cancel())},u}}}function In({apiHandler:t}){return{getAll({limit:e=null,offset:r=null,sort:n=null,filter:s=null,q:u=null,fields:o=null}={}){const l={limit:e,offset:r,sort:n,filter:s,q:u,fields:o};return t.getAll("gateway-accounts",l)},create({id:e="",data:r}){return t.create(`gateway-accounts/${e}`,e,r)},get({id:e}){return t.get(`gateway-accounts/${e}`)},update({id:e,data:r}){return t.patch(`gateway-accounts/${e}`,r)},delete({id:e}){return t.delete(`gateway-accounts/${e}`)},close({id:e}){return t.post(`gateway-accounts/${e}/close`)},disable({id:e}){return t.post(`gateway-accounts/${e}/disable`)},getAllDowntimeSchedules({id:e,limit:r=null,offset:n=null,filter:s=null,sort:u=null}){const o={limit:r,offset:n,filter:s,sort:u};return t.getAll(`gateway-accounts/${e}/downtime-schedules`,o)},createDowntimeSchedule({id:e,data:r}){return t.post(`gateway-accounts/${e}/downtime-schedules`,r)},getDowntimeSchedule({id:e,downtimeId:r}){return t.get(`gateway-accounts/${e}/downtime-schedules/${r}`)},updateDowntimeSchedule({id:e,downtimeId:r,data:n}){return t.put(`gateway-accounts/${e}/downtime-schedules/${r}`,n)},deleteDowntimeSchedule({id:e,downtimeId:r}){return t.delete(`gateway-accounts/${e}/downtime-schedules/${r}`)},enable({id:e}){return t.post(`gateway-accounts/${e}/enable`)},getAllVolumeLimits({id:e}){return t.getAll(`gateway-accounts/${e}/limits`)},getVolumeLimit({id:e,limitId:r}){return t.get(`gateway-accounts/${e}/limits/${r}`)},updateVolumeLimit({id:e,limitId:r,data:n}){return t.put(`gateway-accounts/${e}/limits/${r}`,n)},deleteVolumeLimit({id:e,limitId:r}){return t.delete(`gateway-accounts/${e}/limits/${r}`)},getAllTimelineMessages({id:e,limit:r=null,offset:n=null,filter:s=null,sort:u=null,q:o=null}){const l={limit:r,offset:n,filter:s,sort:u,q:o};return t.getAll(`gateway-accounts/${e}/timeline`,l)},createTimelineComment({id:e,data:r}){return t.post(`gateway-accounts/${e}/timeline`,r)},getTimelineMessage({id:e,messageId:r}){return t.get(`gateway-accounts/${e}/timeline/${r}`)},deleteTimelineMessage({id:e,messageId:r}){return t.delete(`gateway-accounts/${e}/timeline/${r}`)},checkCredentials({id:e}){return t.post(`gateway-accounts/${e}/check-credentials`)},getFinancialSettings({id:e}){return t.get(`gateway-accounts/${e}/financial-settings`)},setFinancialSettings({id:e,data:r}){return t.put(`gateway-accounts/${e}/financial-settings`,r)}}}function Pn({apiHandler:t}){return{getAll(){return t.getAll("integrations")},get({label:e}){return t.get(`integrations/${e}`)}}}function On({apiHandler:t}){return{getAll({filter:e=null,sort:r=null,limit:n=null,offset:s=null,q:u=null,expand:o=null}={}){const l={filter:e,sort:r,limit:n,offset:s,q:u,expand:o};return t.getAll("invoices",l)},create({id:e="",data:r,expand:n=null}){const s={expand:n};return t.create(`invoices/${e}`,e,r,s)},get({id:e,expand:r=null}){const n={expand:r};return t.get(`invoices/${e}`,n)},update({id:e,data:r,expand:n=null}){const s={expand:n};return t.put(`invoices/${e}`,r,s)},getAllInvoiceItems({id:e,limit:r=null,offset:n=null,expand:s=null}){const u={limit:r,offset:n,expand:s};return t.getAll(`invoices/${e}/items`,u)},createInvoiceItem({id:e,data:r}){return t.post(`invoices/${e}/items`,r)},getInvoiceItem({id:e,itemId:r}){return t.get(`invoices/${e}/items/${r}`)},updateInvoiceItem({id:e,itemId:r,data:n}){return t.put(`invoices/${e}/items/${r}`,n)},deleteInvoiceItem({id:e,itemId:r}){return t.delete(`invoices/${e}/items/${r}`)},issue({id:e,data:r}){return t.post(`invoices/${e}/issue`,r)},abandon({id:e}){return t.post(`invoices/${e}/abandon`)},void({id:e}){return t.post(`invoices/${e}/void`)},recalculate({id:e}){return t.post(`invoices/${e}/recalculate`)},reissue({id:e,data:r}){return t.post(`invoices/${e}/reissue`,r)},getAllTransactionAllocations({id:e,limit:r=null,offset:n=null}){const s={limit:r,offset:n};return t.getAll(`invoices/${e}/transaction-allocations`,s)},applyTransaction({id:e,data:r}){return t.post(`invoices/${e}/transaction`,r)},getAllTimelineMessages({id:e,limit:r=null,offset:n=null,filter:s=null,sort:u=null,q:o=null}){const l={limit:r,offset:n,filter:s,sort:u,q:o};return t.getAll(`invoices/${e}/timeline`,l)},createTimelineComment({id:e,data:r}){return t.post(`invoices/${e}/timeline`,r)},getTimelineMessage({id:e,messageId:r}){return t.get(`invoices/${e}/timeline/${r}`)},deleteTimelineMessage({id:e,messageId:r}){return t.delete(`invoices/${e}/timeline/${r}`)},downloadCSV({limit:e=null,offset:r=null,sort:n=null,expand:s=null,filter:u=null,q:o=null}={}){const l={params:{limit:e,offset:r,sort:n,expand:s,filter:u,q:o},headers:D};return t.download("invoices",l)},downloadPDF({id:e}){const r={headers:Qe,responseType:"arraybuffer"};return t.download(`invoices/${e}`,r)}}}function jn({apiHandler:t}){return{getAll({limit:e=null,offset:r=null,filter:n=null,sort:s=null}={}){const u={limit:e,offset:r,filter:n,sort:s};return t.getAll("kyc-documents",u)},create({id:e="",data:r}){return t.create(`kyc-documents/${e}`,e,r)},get({id:e}){return t.get(`kyc-documents/${e}`)},update({id:e,data:r}){return t.put(`kyc-documents/${e}`,r)},accept({id:e}){return t.post(`kyc-documents/${e}/acceptance`)},matches({id:e,data:r}){return t.post(`kyc-documents/${e}/matches`,r)},reject({id:e,data:r}){return t.post(`kyc-documents/${e}/rejection`,r)},review({id:e}){return t.post(`kyc-documents/${e}/review`)},startReview({id:e}){return t.post(`kyc-documents/${e}/start-review`)},stopReview({id:e}){return t.post(`kyc-documents/${e}/stop-review`)}}}function qn({apiHandler:t}){return{getAll({limit:e=null,offset:r=null,filter:n=null,sort:s=null}={}){const u={limit:e,offset:r,filter:n,sort:s};return t.getAll("kyc-requests",u)},create({data:e}){return t.post("kyc-requests",e)},get({id:e}){return t.get(`kyc-requests/${e}`)},delete({id:e}){return t.delete(`kyc-requests/${e}`)},update({id:e,data:r}){return t.patch(`kyc-requests/${e}`,r)}}}function Dn({apiHandler:t}){return{updateKycSettings({data:e}){return t.put("kyc-settings",e)}}}function Nn({apiHandler:t}){return{getAll({limit:e=null,offset:r=null,filter:n=null,sort:s=null,fields:u=null,q:o=null}={}){const l={limit:e,offset:r,filter:n,sort:s,fields:u,q:o};return t.getAll("lists",l)},create({id:e="",data:r}){return t.create(`lists/${e}`,e,r)},getLatestVersion({id:e}){return t.get(`lists/${e}`)},update({id:e,data:r}){return t.put(`lists/${e}`,r)},delete({id:e}){return t.delete(`lists/${e}`)},getByVersion({id:e,version:r}){return t.get(`lists/${e}/${r}`)}}}function Mn({apiHandler:t}){return{getAll({limit:e=null,offset:r=null,filter:n=null,sort:s=null}={}){const u={limit:e,offset:r,filter:n,sort:s};return t.getAll("memberships",u)},get({organizationId:e,userId:r}){return t.get(`memberships/${e}/${r}`)},update({organizationId:e,userId:r,data:n}){return t.put(`memberships/${e}/${r}`,n)},delete({organizationId:e,userId:r}){return t.delete(`memberships/${e}/${r}`)}}}function Bn({apiHandler:t}){return{getAll({limit:e=null,offset:r=null,filter:n=null,q:s=null}={}){const u={limit:e,offset:r,filter:n,q:s};return t.getAll("organizations",u)},create({data:e}){return t.post("organizations",e)},get({id:e}){return t.get(`organizations/${e}`)},update({id:e,data:r}){return t.patch(`organizations/${e}`,r)}}}function Un({apiHandler:t}){return{getAll({limit:e=null,q:r=null}={}){const n={limit:e,q:r};return t.getAll("payment-cards-bank-names",n)}}}function Ln({apiHandler:t}){return{getAll({filter:e=null,sort:r=null,limit:n=null,offset:s=null,q:u=null,expand:o=null}={}){const l={filter:e,sort:r,limit:n,offset:s,q:u,expand:o};return t.getAll("payment-instruments",l)},create({data:e}){return t.post("payment-instruments",e)},get({id:e}){return t.get(`payment-instruments/${e}`)},update({id:e,data:r}){return t.patch(`payment-instruments/${e}`,r)},deactivate({id:e}){return t.post(`payment-instruments/${e}/deactivation`)}}}function Fn({apiHandler:t}){return{getAll(){return t.getAll("payment-methods")},get({apiName:e}){return t.get(`payment-methods/${e}`)}}}function Vn({apiHandler:t}){return{getAll({limit:e=null,offset:r=null}={}){const n={limit:e,offset:r};return t.getAll("tokens",n)},create({data:e}){return t.post("tokens",e)},get({token:e}){return t.get(`tokens/${e}`)}}}function Kn({apiHandler:t}){return{create({data:e}){return t.post("payouts",e)}}}function _n({apiHandler:t}){return{getAll({filter:e=null,sort:r=null,limit:n=null,offset:s=null,q:u=null}={}){const o={filter:e,sort:r,limit:n,offset:s,q:u};return t.getAll("plans",o)},create({id:e="",data:r}){return t.create(`plans/${e}`,e,r)},get({id:e}){return t.get(`plans/${e}`)},update({id:e,data:r}){return t.put(`plans/${e}`,r)},delete({id:e}){return t.delete(`plans/${e}`)}}}function zn({apiHandler:t}){return{sendEmailRuleAction({data:e}){return t.post("previews/rule-actions/send-email",e)},triggerWebhookRuleAction({data:e}){return t.post("previews/rule-actions/trigger-webhook",e)},webhook({data:e}){return t.post("previews/webhooks",e)},order({data:e}){return t.post("previews/orders",e)}}}function Jn({apiHandler:t}){return{getAll({filter:e=null,sort:r=null,limit:n=null,offset:s=null,q:u=null}={}){const o={filter:e,sort:r,limit:n,offset:s,q:u};return t.getAll("products",o)},create({id:e="",data:r}){return t.create(`products/${e}`,e,r)},get({id:e}){return t.get(`products/${e}`)},update({id:e,data:r}){return t.put(`products/${e}`,r)},delete({id:e}){return t.delete(`products/${e}`)}}}function Wn({apiHandler:t}){return{startPermissionsEmulation({data:e}){return t.post("permissions-emulation",e)},stopPermissionsEmulation(){return t.delete("permissions-emulation")},get(){return t.get("profile")},update({data:e}){return t.put("profile",e)},getMfa(){return t.get("profile/mfa")},updateMfa(){return t.post("profile/mfa")},deleteMfa(){return t.delete("profile/mfa")},updatePassword({data:e}){return t.post("profile/password",e)},resetTotp(){return t.post("profile/totp-reset")}}}function Gn({apiHandler:t}){return{readyToPay({data:e}){return t.post("ready-to-pay",e)}}}function Xn({apiHandler:t}){return{getAll({limit:e=null,offset:r=null,filter:n=null,sort:s=null,q:u=null,expand:o=null}={}){const l={limit:e,offset:r,filter:n,sort:s,q:u,expand:o};return t.getAll("roles",l)},create({id:e="",data:r}){return t.create(`roles/${e}`,e,r)},get({id:e,expand:r=null}){const n={expand:r};return t.get(`roles/${e}`,n)},update({id:e,data:r}){return t.put(`roles/${e}`,r)},delete({id:e}){return t.delete(`roles/${e}`)}}}function Yn({apiHandler:t}){return{get({sort:e=null,limit:r=null,offset:n=null,q:s=null}){const u={sort:e,limit:r,offset:n,q:s};return t.get("search",u)}}}function Qn({apiHandler:t}){return{getAll({limit:e=null,offset:r=null,sort:n=null,filter:s=null,q:u=null}={}){const o={limit:e,offset:r,sort:n,filter:s,q:u};return t.getAll("grid-segments",o)},create({id:e="",data:r}){return t.create(`grid-segments/${e}`,e,r)},get({id:e}){return t.get(`grid-segments/${e}`)},update({id:e,data:r}){return t.put(`grid-segments/${e}`,r)},delete({id:e}){return t.delete(`grid-segments/${e}`)}}}function Zn({apiHandler:t}){return{getAll({eventType:e}){return t.getAll(`send-through-attribution/${e}`)}}}function Hn({apiHandler:t}){return{getAll({limit:e=null,offset:r=null,filter:n=null,sort:s=null,q:u=null}={}){const o={limit:e,offset:r,filter:n,sort:s,q:u};return t.getAll("shipping-rates",o)},create({id:e="",data:r}){return t.create(`shipping-rates/${e}`,e,r)},get({id:e}){return t.get(`shipping-rates/${e}`)},update({id:e,data:r}){return t.put(`shipping-rates/${e}`,r)},delete({id:e}){return t.delete(`shipping-rates/${e}`)}}}function es({apiHandler:t}){return{get(){return t.get("status")}}}function ts({apiHandler:t}){return{getAll({limit:e=null,offset:r=null,filter:n=null,sort:s=null}={}){const u={limit:e,offset:r,filter:n,sort:s};return t.getAll("subscription-cancellations",u)},create({id:e="",data:r}){return t.create(`subscription-cancellations/${e}`,e,r)},get({id:e}){return t.get(`subscription-cancellations/${e}`)},delete({id:e}){return t.delete(`subscription-cancellations/${e}`)},patch({id:e,data:r}){return t.patch(`subscription-cancellations/${e}`,r)}}}function rs({apiHandler:t}){return{getAll({limit:e=null,offset:r=null,filter:n=null,sort:s=null}={}){const u={limit:e,offset:r,filter:n,sort:s};return t.getAll("subscription-pauses",u)},pause({id:e="",data:r}){return t.create(`subscription-pauses/${e}`,e,r)},get({id:e}){return t.get(`subscription-pauses/${e}`)},update({id:e,data:r}){return t.put(`subscription-pauses/${e}`,r)},delete({id:e}){return t.delete(`subscription-pauses/${e}`)}}}function ns({apiHandler:t}){return{getAll({limit:e=null,offset:r=null,filter:n=null,sort:s=null}={}){const u={limit:e,offset:r,filter:n,sort:s};return t.getAll("subscription-reactivations",u)},reactivate({data:e}){return t.post("subscription-reactivations",e)},get({id:e}){return t.get(`subscription-reactivations/${e}`)}}}function ss({apiHandler:t}){return{getAll({filter:e=null,sort:r=null,limit:n=null,offset:s=null,q:u=null,expand:o=null}={}){const l={filter:e,sort:r,limit:n,offset:s,q:u,expand:o};return t.getAll("subscriptions",l)},create({id:e="",data:r,expand:n=null}){const s={expand:n};return t.create(`subscriptions/${e}`,e,r,s)},get({id:e,expand:r=null}){const n={expand:r};return t.get(`subscriptions/${e}`,n)},update({id:e,data:r,expand:n=null}){const s={expand:n};return t.put(`subscriptions/${e}`,r,s)},delete({id:e}){return t.delete(`subscriptions/${e}`)},void({id:e}){return t.post(`subscriptions/${e}/void`)},changeItems({id:e,data:r}){return t.post(`subscriptions/${e}/change-items`,r)},createInterimInvoice({id:e,data:r}){return t.post(`subscriptions/${e}/interim-invoice`,r)},getAllUpcomingInvoices({id:e,expand:r=null}){const n={expand:r};return t.getAll(`subscriptions/${e}/upcoming-invoices`,n)},issueUpcomingInvoice({id:e,invoiceId:r,data:n}){return t.post(`subscriptions/${e}/upcoming-invoices/${r}/issue`,n)},getAllTimelineMessages({id:e,limit:r=null,offset:n=null,filter:s=null,sort:u=null,q:o=null}){const l={limit:r,offset:n,filter:s,sort:u,q:o};return t.getAll(`subscriptions/${e}/timeline`,l)},createTimelineComment({id:e,data:r}){return t.post(`subscriptions/${e}/timeline`,r)},getTimelineMessage({id:e,messageId:r}){return t.get(`subscriptions/${e}/timeline/${r}`)},deleteTimelineMessage({id:e,messageId:r}){return t.delete(`subscriptions/${e}/timeline/${r}`)},downloadCSV({limit:e=null,offset:r=null,sort:n=null,expand:s=null,filter:u=null,q:o=null}={}){const l={params:{limit:e,offset:r,sort:n,expand:s,filter:u,q:o},headers:D};return t.download("subscriptions",l)}}}function us({apiHandler:t}){return{getAll({limit:e=null,offset:r=null,filter:n=null,q:s=null,sort:u=null}={}){const o={limit:e,offset:r,filter:n,q:s,sort:u};return t.getAll("tags",o)},create({data:e}){return t.post("tags",e)},get({tag:e}){return t.get(`tags/${e}`)},delete({tag:e}){return t.delete(`tags/${e}`)},update({tag:e,data:r}){return t.patch(`tags/${e}`,r)},tagCustomers({tag:e,data:r}){return t.post(`tags/${e}/customers`,r)},untagCustomers({tag:e,data:r}){return t.delete(`tags/${e}/customers`,r)},tagCustomer({tag:e,customerId:r}){return t.post(`tags/${e}/customers/${r}`)},untagCustomer({tag:e,customerId:r}){return t.delete(`tags/${e}/customers/${r}`)},tagKycDocuments({tag:e,data:r}){return t.post(`tags/${e}/kyc-documents`,r)},untagKycDocuments({tag:e,data:r}){return t.delete(`tags/${e}/kyc-documents`,r)},tagKycDocument({tag:e,kycDocumentId:r}){return t.post(`tags/${e}/kyc-documents/${r}`)},untagKycDocument({tag:e,kycDocumentId:r}){return t.delete(`tags/${e}/kyc-documents/${r}`)}}}function os({apiHandler:t}){return{getAllApiLogs({limit:e=null,offset:r=null,sort:n=null,filter:s=null,q:u=null}={}){const o={limit:e,offset:r,sort:n,filter:s,q:u};return t.getAll("tracking/api",o)},getApiLog({id:e}){return t.get(`tracking/api/${e}`)},getAllListsChangesHistory({limit:e=null,offset:r=null,sort:n=null,filter:s=null,q:u=null}={}){const o={limit:e,offset:r,sort:n,filter:s,q:u};return t.getAll("tracking/lists",o)},getAllWebhookTrackingLogs({limit:e=null,offset:r=null,sort:n=null,filter:s=null,q:u=null}={}){const o={limit:e,offset:r,sort:n,filter:s,q:u};return t.getAll("tracking/webhooks",o)},getWebhookTrackingLog({id:e}){return t.get(`tracking/webhooks/${e}`)},resendWebhook({id:e}){return t.post(`tracking/webhooks/${e}/resend`)},downloadApiLogsCSV({limit:e=null,offset:r=null,sort:n=null,filter:s=null,q:u=null}={}){const o={params:{limit:e,offset:r,sort:n,filter:s,q:u},headers:D};return t.download("tracking/api",o)}}}function ls({apiHandler:t}){return{getAll({limit:e=null,offset:r=null,filter:n=null,q:s=null,sort:u=null,expand:o=null}={}){const l={limit:e,offset:r,filter:n,q:s,sort:u,expand:o};return t.getAll("transactions",l)},create({data:e,expand:r=null}){const n={expand:r};return t.post("transactions",e,n)},get({id:e,expand:r=null}){const n={expand:r};return t.get(`transactions/${e}`,n)},patch({id:e,data:r}){return t.patch(`transactions/${e}`,r)},query({id:e}){return t.post(`transactions/${e}/query`)},update({id:e,data:r}){return t.post(`transactions/${e}/update`,r)},refund({id:e,data:r}){return t.post(`transactions/${e}/refund`,r)},getAllTimelineMessages({id:e,limit:r=null,offset:n=null,filter:s=null}){const u={limit:r,offset:n,filter:s};return t.getAll(`transactions/${e}/timeline`,u)},createTimelineComment({id:e,data:r}){return t.post(`transactions/${e}/timeline`,r)},getTimelineMessage({id:e,messageId:r}){return t.get(`transactions/${e}/timeline/${r}`)},deleteTimelineMessage({id:e,messageId:r}){return t.delete(`transactions/${e}/timeline/${r}`)},downloadCSV({limit:e=null,offset:r=null,sort:n=null,expand:s=null,filter:u=null,q:o=null}={}){const l={params:{limit:e,offset:r,sort:n,expand:s,filter:u,q:o},headers:D};return t.download("transactions",l)}}}function is({apiHandler:t}){return{getResetPasswordToken({token:e}){return t.get(`reset-password/${e}`)},resetPassword({token:e,data:r}){return t.post(`reset-password/${e}`,r)},getAll({limit:e=null,offset:r=null,sort:n=null,filter:s=null,q:u=null}={}){const o={limit:e,offset:r,sort:n,filter:s,q:u};return t.getAll("users",o)},create({id:e="",data:r}){return t.create(`users/${e}`,e,r)},get({id:e}){return t.get(`users/${e}`)},update({id:e,data:r}){return t.put(`users/${e}`,r)},updatePassword({id:e,data:r}){return t.post(`users/${e}/password`,r)},resetTotp({id:e}){return t.post(`users/${e}/totp-reset`)}}}function cs({apiHandler:t}){return{getAll({limit:e=null,offset:r=null,filter:n=null}={}){const s={limit:e,offset:r,filter:n};return t.getAll("webhooks",s)},create({id:e="",data:r}){return t.create(`webhooks/${e}`,e,r)},get({id:e}){return t.get(`webhooks/${e}`)},update({id:e,data:r}){return t.put(`webhooks/${e}`,r)}}}function as({apiHandler:t}){return{getAll({limit:e=null,offset:r=null,q:n=null,filter:s=null,sort:u=null}={}){const o={limit:e,offset:r,q:n,filter:s,sort:u};return t.getAll("websites",o)},create({id:e="",data:r}){return t.create(`websites/${e}`,e,r)},get({id:e}){return t.get(`websites/${e}`)},update({id:e,data:r}){return t.put(`websites/${e}`,r)},delete({id:e}){return t.delete(`websites/${e}`)},downloadCSV({limit:e=null,offset:r=null,sort:n=null,expand:s=null,filter:u=null,q:o=null}={}){const l={params:{limit:e,offset:r,sort:n,expand:s,filter:u,q:o},headers:D};return t.download("websites",l)}}}class fs{constructor({apiHandler:e}){this.account=un({apiHandler:e}),this.aml=on({apiHandler:e}),this.apiKeys=ln({apiHandler:e}),this.applicationInstances=cn({apiHandler:e}),this.applications=an({apiHandler:e}),this.balanceTransactions=fn({apiHandler:e}),this.billingPortals=mn({apiHandler:e}),this.blocklists=gn({apiHandler:e}),this.broadcastMessages=hn({apiHandler:e}),this.checkoutForms=pn({apiHandler:e}),this.coupons=dn({apiHandler:e}),this.credentialHashes=yn({apiHandler:e}),this.customDomains=$n({apiHandler:e}),this.customFields=bn({apiHandler:e}),this.customerAuthentication=An({apiHandler:e}),this.customers=vn({apiHandler:e}),this.digitalWallets=wn({apiHandler:e}),this.disputes=Rn({apiHandler:e}),this.emailDeliverySettings=En({apiHandler:e}),this.emailMessages=Sn({apiHandler:e}),this.emailNotifications=kn({apiHandler:e}),this.events=Cn({apiHandler:e}),this.fees=Tn({apiHandler:e}),this.files=xn({apiHandler:e}),this.gatewayAccounts=In({apiHandler:e}),this.integrations=Pn({apiHandler:e}),this.invoices=On({apiHandler:e}),this.kycDocuments=jn({apiHandler:e}),this.kycRequests=qn({apiHandler:e}),this.kycSettings=Dn({apiHandler:e}),this.lists=Nn({apiHandler:e}),this.memberships=Mn({apiHandler:e}),this.organizations=Bn({apiHandler:e}),this.paymentCardsBankNames=Un({apiHandler:e}),this.paymentInstruments=Ln({apiHandler:e}),this.paymentMethods=Fn({apiHandler:e}),this.paymentTokens=Vn({apiHandler:e}),this.payouts=Kn({apiHandler:e}),this.plans=_n({apiHandler:e}),this.previews=zn({apiHandler:e}),this.products=Jn({apiHandler:e}),this.profile=Wn({apiHandler:e}),this.purchase=Gn({apiHandler:e}),this.roles=Xn({apiHandler:e}),this.search=Yn({apiHandler:e}),this.segments=Qn({apiHandler:e}),this.sendThroughAttribution=Zn({apiHandler:e}),this.shippingRates=Hn({apiHandler:e}),this.status=es({apiHandler:e}),this.subscriptionCancellations=ts({apiHandler:e}),this.subscriptionPauses=rs({apiHandler:e}),this.subscriptionReactivations=ns({apiHandler:e}),this.subscriptions=ss({apiHandler:e}),this.tags=us({apiHandler:e}),this.tracking=os({apiHandler:e}),this.transactions=ls({apiHandler:e}),this.users=is({apiHandler:e}),this.webhooks=cs({apiHandler:e}),this.websites=as({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 ms({apiHandler:t}){return{getCustomerLifetimeSummaryMetrics({customerId:e=""}={}){const r={customerId:e};return t.get(`customers/${e}/summary-metrics`,r)}}}function gs({apiHandler:t}){return{getAll({limit:e=null,offset:r=null,sort:n=null,expand:s=null,filter:u=null,q:o=null,criteria:l=null}={}){const a={limit:e,offset:r,sort:n,expand:s,filter:u,q:o,criteria:l};return t.getAll("data-exports",a)},get({id:e,expand:r=null}){const n={expand:r};return t.get(`data-exports/${e}`,n)},queue({data:e,expand:r=null}){const n={expand:r};return t.post("data-exports",e,n)},update({id:e,data:r,expand:n=null}){const s={expand:n};return t.put(`data-exports/${e}`,r,s)},delete({id:e}){return t.delete(`data-exports/${e}`)}}}function hs({apiHandler:t}){return{getTransactionHistogramReport({periodStart:e="",periodEnd:r="",aggregationField:n="",aggregationPeriod:s="",metric:u="",filter:o=null,tz:l=null}={}){const a={periodStart:e,periodEnd:r,aggregationField:n,aggregationPeriod:s,metric:u,filter:o,tz:l};return t.get("histograms/transactions",a)}}}function ps({apiHandler:t}){return{getApiLogSummary({aggregationField:e,periodStart:r,periodEnd:n,limit:s=null,offset:u=null,tz:o=null}={}){const l={aggregationField:e,periodStart:r,periodEnd:n,limit:s,offset:u,tz:o};return t.get("reports/api-log-summary",l)},getCumulativeSubscriptions({aggregationField:e,periodStart:r,periodEnd:n,limit:s=null,offset:u=null,filter:o=null,criteria:l=null,tz:a=null}={}){const m={aggregationField:e,periodStart:r,periodEnd:n,limit:s,offset:u,filter:o,criteria:l,tz:a};return t.get("reports/cumulative-subscriptions",m)},getDashboardMetrics({periodStart:e=null,periodEnd:r=null,tz:n=null,metrics:s=null,segments:u={}}={}){const o={periodStart:e,periodEnd:r,tz:n,segments:u,metrics:s};return t.getAll("reports/dashboard",o)},getDccMarkup({aggregationField:e,periodStart:r,periodEnd:n,limit:s=null,offset:u=null,filter:o=null,tz:l=null}={}){const a={aggregationField:e,periodStart:r,periodEnd:n,limit:s,offset:u,filter:o,tz:l};return t.get("reports/dcc-markup",a)},getDisputes({aggregationField:e,periodMonth:r,limit:n=null,offset:s=null,filter:u=null,tz:o=null}={}){const l={aggregationField:e,periodMonth:r,limit:n,offset:s,filter:u,tz:o};return t.get("reports/disputes",l)},getEventsTriggeredSummary({periodStart:e,periodEnd:r,limit:n=null,offset:s=null,tz:u=null}={}){const o={periodStart:e,periodEnd:r,limit:n,offset:s,tz:u};return t.get("reports/events-triggered",o)},getFutureRenewals({periodStart:e,periodEnd:r,limit:n=null,offset:s=null,tz:u=null}={}){const o={periodStart:e,periodEnd:r,limit:n,offset:s,tz:u};return t.get("reports/future-renewals",o)},getKycAcceptanceSummary({periodStart:e,periodEnd:r}={}){const n={periodStart:e,periodEnd:r};return t.get("reports/kyc-acceptance-summary",n)},getKycRejectionSummary({periodStart:e,periodEnd:r}={}){const n={periodStart:e,periodEnd:r};return t.get("reports/kyc-rejection-summary",n)},getRulesMatchedSummary({eventType:e,periodStart:r,periodEnd:n,limit:s=null,offset:u=null,tz:o=null}={}){const l={periodStart:r,periodEnd:n,limit:s,offset:u,tz:o};return t.get(`reports/events-triggered/${e}/rules`,l)},getRenewalSales({periodStart:e,periodEnd:r,limit:n=null,offset:s=null,tz:u=null}={}){const o={periodStart:e,periodEnd:r,limit:n,offset:s,tz:u};return t.get("reports/renewal-sales",o)},getRetentionPercentage({aggregationField:e,aggregationPeriod:r,periodStart:n,periodEnd:s,includeSwitchedSubscriptions:u=null,limit:o=null,offset:l=null,filter:a=null,criteria:m=null,tz:c=null}={}){const h={aggregationField:e,aggregationPeriod:r,periodStart:n,periodEnd:s,includeSwitchedSubscriptions:u,limit:o,offset:l,filter:a,criteria:m,tz:c};return t.get("reports/retention-percentage",h)},getRetentionValue({aggregationField:e,aggregationPeriod:r,periodStart:n,periodEnd:s,includeRefunds:u=null,includeDisputes:o=null,limit:l=null,offset:a=null,sort:m=null,filter:c=null,criteria:h=null,tz:w=null}={}){const y={aggregationField:e,aggregationPeriod:r,periodStart:n,periodEnd:s,includeRefunds:u,includeDisputes:o,limit:l,offset:a,sort:m,filter:c,criteria:h,tz:w};return t.get("reports/retention-value",y)},getSubscriptionCancellation({aggregationField:e,periodStart:r,periodEnd:n,limit:s=null,offset:u=null,filter:o=null,criteria:l=null,tz:a=null}={}){const m={aggregationField:e,periodStart:r,periodEnd:n,limit:s,offset:u,filter:o,criteria:l,tz:a};return t.get("reports/subscription-cancellation",m)},getSubscriptionRenewalList({periodStart:e,periodEnd:r,limit:n=null,offset:s=null,tz:u=null}={}){const o={periodStart:e,periodEnd:r,limit:n,offset:s,tz:u};return t.getAll("reports/subscription-renewal-list",o)},getSubscriptionRenewal({periodStart:e,periodEnd:r,limit:n=null,offset:s=null,tz:u=null}={}){const o={periodStart:e,periodEnd:r,limit:n,offset:s,tz:u};return t.get("reports/subscription-renewal",o)},getTimeSeriesTransaction({periodStart:e,periodEnd:r,type:n,subaggregate:s,limit:u=null,offset:o=null}={}){const l={periodStart:e,periodEnd:r,type:n,subaggregate:s,limit:u,offset:o};return t.get("reports/time-series-transaction",l)},getTransactionsTimeDispute({aggregationField:e,periodStart:r,periodEnd:n,limit:s=null,offset:u=null,filter:o=null,criteria:l=null,tz:a=null}={}){const m={aggregationField:e,periodStart:r,periodEnd:n,limit:s,offset:u,filter:o,criteria:l,tz:a};return t.get("reports/transactions-time-dispute",m)},getTransactions({aggregationField:e,periodStart:r,periodEnd:n,limit:s=null,offset:u=null,filter:o=null,criteria:l=null,tz:a=null}={}){const m={aggregationField:e,periodStart:r,periodEnd:n,limit:s,offset:u,filter:o,criteria:l,tz:a};return t.get("reports/transactions",m)}}}function ds({apiHandler:t}){return{getSubscriptionSummaryMetrics({subscriptionId:e=""}={}){const r={subscriptionId:e};return t.get(`subscriptions/${e}/summary-metrics`,r)}}}function ys({apiHandler:t}){return{getActivityFeed({eventTypes:e=null,limit:r=1e3,offset:n=0}){const s={eventTypes:e,limit:r,offset:n};return t.getAll("activity-feed",s)},getTransaction({id:e="",eventTypes:r=null,limit:n=1e3,offset:s=0}){const u={eventTypes:r,limit:n,offset:s};return t.getAll(`transactions/${e}/timeline`,u)},getCustomer({id:e="",eventTypes:r=null,limit:n=1e3,offset:s=0}){const u={eventTypes:r,limit:n,offset:s};return t.getAll(`customers/${e}/timeline`,u)}}}function $s({apiHandler:t}){return{query(){return t.get("location")}}}const N={CustomersResource:ms,DataExportsResource:gs,HistogramsResource:hs,ReportsResource:ps,SubscriptionsResource:ds,TimelinesResource:ys,LocationResource:$s};class bs{constructor({apiHandler:e}){this.customers=N.CustomersResource({apiHandler:e}),this.dataExports=N.DataExportsResource({apiHandler:e}),this.histograms=N.HistogramsResource({apiHandler:e}),this.reports=N.ReportsResource({apiHandler:e}),this.subscriptions=N.SubscriptionsResource({apiHandler:e}),this.timelines=N.TimelinesResource({apiHandler:e}),this.location=N.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 As({apiHandler:t}){return{get(){return t.get("account")},update({data:e}){return t.patch("account",e)},requestPasswordReset({data:e}){return t.post("account/forgot-password",e)},changePassword({data:e}){return t.patch("account/password",e)},resendEmailVerification({data:e}){return t.post("account/resend-verification",e)},confirmPasswordReset({token:e,data:r}){return t.post(`account/reset-password/${e}`,r)},verifyEmail({token:e}){return t.post(`account/verification/${e}`)},register({data:e}){return t.post("register",e)}}}function vs({apiHandler:t}){return{login({data:e}){return t.post("login",e)},logout(){return t.post("logout")}}}function ws({apiHandler:t}){return{get({slug:e}){return t.get(`billing-portals/${e}`)}}}function Rs({apiHandler:t}){return{get({id:e}){return t.get(`checkout-forms/${e}`)}}}function Es({apiHandler:t}){return{getAll({filter:e=null,sort:r=null,limit:n=null,offset:s=null,q:u=null}={}){const o={filter:e,sort:r,limit:n,offset:s,q:u};return t.getAll("invoices",o)},get({id:e}){return t.get(`invoices/${e}`)},downloadPDF({id:e}){const r={headers:Qe,responseType:"arraybuffer"};return t.download(`invoices/${e}`,r)}}}function Ss({apiHandler:t}){return{getAll({limit:e=null,offset:r=null}={}){const n={limit:e,offset:r};return t.getAll("kyc-documents",n)},create({data:e}){return t.post("kyc-documents",e)},get({id:e}){return t.get(`kyc-documents/${e}`)},update({id:e,data:r}){return t.patch(`kyc-documents/${e}`,r)}}}function ks({apiHandler:t}){return{get({id:e}){return t.get(`kyc-requests/${e}`)}}}function Cs({apiHandler:t}){return{getAll({filter:e=null,sort:r=null,limit:n=null,offset:s=null,q:u=null}={}){const o={filter:e,sort:r,limit:n,offset:s,q:u};return t.getAll("orders",o)},get({id:e}){return t.get(`orders/${e}`)},update({id:e,data:r}){return t.patch(`orders/${e}`,r)},cancel({id:e,data:r}){return t.post(`orders/${e}/cancellation`,r)}}}function Ts({apiHandler:t}){return{getAll({filter:e=null,sort:r=null,limit:n=null,offset:s=null,q:u=null}={}){const o={filter:e,sort:r,limit:n,offset:s,q:u};return t.getAll("payment-instruments",o)},create({data:e}){return t.post("payment-instruments",e)},get({id:e,limit:r=null,offset:n=null}){const s={limit:r,offset:n};return t.get(`payment-instruments/${e}`,s)},update({id:e,data:r}){return t.patch(`payment-instruments/${e}`,r)},deactivate({id:e}){return t.post(`payment-instruments/${e}/deactivation`)},getSetupTransaction({id:e}){return t.get(`payment-instruments/${e}/setup`)},setup({id:e,data:r}){return t.post(`payment-instruments/${e}/setup`,r)}}}function xs({apiHandler:t}){return{getAll({filter:e=null,sort:r=null,limit:n=null,offset:s=null,q:u=null}={}){const o={filter:e,sort:r,limit:n,offset:s,q:u};return t.getAll("plans",o)},get({id:e}){return t.get(`plans/${e}`)}}}function Is({apiHandler:t}){return{getAll({filter:e=null,sort:r=null,limit:n=null,offset:s=null,q:u=null}={}){const o={filter:e,sort:r,limit:n,offset:s,q:u};return t.getAll("products",o)},get({id:e}){return t.get(`products/${e}`)}}}function Ps({apiHandler:t}){return{payment({data:e}){return t.post("payment",e)},purchase({data:e}){return t.post("purchase",e)},preview({data:e}){return t.post("preview-purchase",e)},readyToPay({data:e}){return t.post("ready-to-pay",e)}}}function Os({apiHandler:t}){return{getAll({limit:e=null,offset:r=null,filter:n=null,q:s=null,sort:u=null}={}){const o={limit:e,offset:r,filter:n,q:s,sort:u};return t.getAll("transactions",o)},get({id:e}){return t.get(`transactions/${e}`)},update({id:e,data:r}){return t.patch(`transactions/${e}`,r)}}}function js({apiHandler:t}){return{get({id:e}){return t.get(`websites/${e}`)}}}class qs{constructor({apiHandler:e}){this.account=As({apiHandler:e}),this.authorization=vs({apiHandler:e}),this.billingPortals=ws({apiHandler:e}),this.checkoutForms=Rs({apiHandler:e}),this.invoices=Es({apiHandler:e}),this.kycDocuments=Ss({apiHandler:e}),this.kycRequests=ks({apiHandler:e}),this.orders=Cs({apiHandler:e}),this.paymentInstruments=Ts({apiHandler:e}),this.plans=xs({apiHandler:e}),this.products=Is({apiHandler:e}),this.purchase=Ps({apiHandler:e}),this.transactions=Os({apiHandler:e}),this.websites=js({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 Ds({apiHandler:t}){return new fs({apiHandler:t})}function Ns({apiHandler:t}){return new bs({apiHandler:t})}function Ms({apiHandler:t}){return new qs({apiHandler:t})}const $e={live:"https://api.rebilly.com",sandbox:"https://api-sandbox.rebilly.com"},be=6e3;function Ze({apiKey:t=null,sandbox:e=!1,timeout:r=be,organizationId:n=null,urls:s=$e}={}){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 o=ye({options:{apiEndpoints:s,apiKey:t,apiVersion:"",isSandbox:e,requestTimeout:r,jwt:null,organizationId:n}});return Ds({apiHandler:o})}function Bs({apiKey:t=null,sandbox:e=!1,timeout:r=be,organizationId:n=null,urls:s=$e}={}){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 o=ye({options:{apiEndpoints:s,apiKey:t,apiVersion:"experimental",isSandbox:e,requestTimeout:r,jwt:null,organizationId:n}});return Ns({apiHandler:o})}function Us({publishableKey:t=null,jwt:e=null,sandbox:r=!1,timeout:n=be,organizationId:s=null,urls:u=$e}={}){if(!u.live||!u.sandbox)throw new Error("RebillyAPI urls config must include a key for both `live` and `sandbox`");if(typeof u.live!="string"||typeof u.sandbox!="string")throw new Error("RebillyAPI urls config `live` and `sandbox` must be strings");const o={apiEndpoints:u,publishableKey:t,jwt:e,apiVersion:"storefront",isSandbox:r,requestTimeout:n,organizationId:s},l=ye({options:o});return l.setSessionToken(o.jwt),Ms({apiHandler:l})}d.RebillyAPI=Ze,d.RebillyErrors=S,d.RebillyExperimentalAPI=Bs,d.RebillyStorefrontAPI=Us,d.cancellation=sn,d.default=Ze,Object.defineProperties(d,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}})});
|
|
37
|
+
*/var _r=zr,Jr=Object.prototype.hasOwnProperty,Wr=function(e,r,n){_r(e,function(s,u){if(Jr.call(e,u))return r.call(n,e[u],u,e)})},Gr=Tr,Xr=Lr,Yr=Kr,Qr=Wr;function de(t,e){switch(Yr(t)){case"object":return Zr(t,e);case"array":return Hr(t,e);default:return Xr(t)}}function Zr(t,e){if(Gr(t)){var r={};return Qr(t,function(n,s){this[s]=de(n,e)},r),r}else return e?e(t):t}function Hr(t,e){for(var r=t.length,n=[],s=-1;++s<r;)n[s]=de(t[s],e);return n}var en=de;const tn="47.3.1";let rn="useandom-26T198340PX75pxJACKVERYMINDBUSHWOLF_GQZbfghjklqvwyzrict",nn=(t=21)=>{let e="",r=t;for(;r--;)e+=rn[Math.random()*64|0];return e};class sn{constructor({id:e=null,created:r=null}={}){this.id=e||nn(),this.created=r||new Date().getTime(),this.cancelSource=pe.CancelToken.source(),this.cancel=this.cancelSource.cancel,this.cancelToken=this.cancelSource.token,te(this,{exclude:["cancelSource","cancelToken","cancel"]})}}class K{constructor(){if(K.instance)return K.instance;this.requests={},K.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 sn;return this.requests[e.id]=e,{id:e.id,cancelToken:e.cancelToken}}}var L=new K;class re{}ve(re,"cancelById",(e,r)=>{try{L.getById(e).cancel(r),L.deleteById(e)}catch{}}),ve(re,"cancelAll",e=>L.getAll().forEach(r=>{r.cancel(e),L.deleteById(r.id)}));var un={cancelAll:(...t)=>re.cancelAll(...t)};const q={request:"request",response:"response"},Ye=t=>{if(!Object.values(q).includes(t))throw new Error(`There is no such interceptor type as "${t}"`);return!0};function ye({options:t}){const e=r();function r(){return pe.create(s())}function n(){return e}function s(){return{baseURL:u(),timeout:t.requestTimeout,headers:o()}}function u(){let i=t.isSandbox?t.apiEndpoints.sandbox:t.apiEndpoints.live;return t.apiVersion&&(i=`${i}/${t.apiVersion}`),t.organizationId&&(i=`${i}/organizations/${t.organizationId}`),`${i}`}function o(){const i={"REB-API-CONSUMER":`RebillySDK/JS-SDK ${tn}`};return t.apiKey&&(i["REB-APIKEY"]=t.apiKey),i}function l(){return en(e.defaults.headers)}function a(i){t.requestTimeout=Number(i),e.defaults.timeout=t.requestTimeout}function m(i=t.jwt){const f=l();t.apiKey=null,t.jwt=i,delete f.common["REB-APIKEY"],f.common.Authorization=`Bearer ${i}`,e.defaults.headers=f}function c(i=t.publishableKey){const f=l();t.publishableKey=i,f.common.Authorization=`${i}`,e.defaults.headers=f}function h({host:i,port:f,auth:g}){e.defaults.proxy={host:i,port:f,auth:g}}function w({live:i=null,sandbox:f=null}){i&&(t.apiEndpoints.live=i),f&&(t.apiEndpoints.sandbox=f),e.defaults.baseURL=u()}function y(i,{thenDelegate:f,catchDelegate:g=()=>{}}){return Ye(i)&&e.interceptors[q[i]].use(f,g)}function V(i,f){return Ye(i)&&e.interceptors[q[i]].eject(f)}function ne({thenDelegate:i,catchDelegate:f=()=>{}}){return y(q.request,{thenDelegate:i,catchDelegate:f})}function E(i){V(q.request,i)}function P({thenDelegate:i,catchDelegate:f=()=>{}}){return y(q.response,{thenDelegate:i,catchDelegate:f})}function T(i){V(q.response,i)}function x({request:i,isCollection:f,config:g}){const $=et(g),{id:O,cancelToken:Gs}=L.save();$.cancelToken=Gs;const st=async function(){try{const _=await i($);return z({response:_,isCollection:f,config:$})}catch(_){return He({error:_,config:$})}finally{L.deleteById(O)}}();return st.cancel=_=>re.cancelById(O,_),st}function z({response:i,isCollection:f,config:g}){return f?new dr(i,g):new _e(i,g)}function He({error:i}){if(pe.isCancel(i))throw new S.RebillyCanceledError(i);if(i.response)switch(Number(i.response.status)){case 401:throw new S.RebillyForbiddenError(i);case 404:throw new S.RebillyNotFoundError(i);case 405:throw new S.RebillyMethodNotAllowedError(i);case 409:throw new S.RebillyConflictError(i);case 422:throw new S.RebillyValidationError(i);default:throw new S.RebillyRequestError(i)}throw i.code==="ECONNABORTED"?new S.RebillyTimeoutError(i):new S.RebillyRequestError(i)}function Fs(i){return i.params!==void 0&&(i.params=Object.keys(i.params).filter(f=>i.params[f]!==null&&i.params[f]!=="").reduce((f,g)=>(f[g]=i.params[g],f),{})),i}function et(i={}){const f=Fs(i);return J({},f)}function tt(i,f={}){return x({request:g=>e.get(i,g),config:{params:f}})}function Ks(i,f){return x({request:g=>e.get(i,g),config:{params:f},isCollection:!0})}function rt(i,f,g={}){let $={};return g.authenticate===!1&&($={headers:l()},delete $.headers.common["REB-APIKEY"],delete $.headers.common.Authorization),g.params&&($.params=J({},g.params)),x({request:O=>e.post(i,f,O),config:$})}function nt(i,f,g={}){return x({request:$=>e.put(i,f,$),config:{params:g}})}function Vs(i,f){return x({request:g=>e.patch(i,f,g),config:{}})}function zs(i){return x({request:f=>e.delete(i,f),config:{}})}function _s(i,f){return x({request:g=>e.delete(i,g),config:{data:J({},f)}})}async function Js(i,f,g,$={}){if(f==="")return rt(i,g,{params:$});try{if((await tt(i)).response.status===200)throw new S.RebillyConflictError({message:"Member already exists. Please use a different ID."})}catch(O){if(O.name==="RebillyNotFoundError")return nt(i,g,$);throw O}}async function Ws(i,f){const g=et(f);try{const $=await e.get(i,g);return new yr($,g)}catch($){return He({error:$,config:g})}}return{getInstance:n,addRequestInterceptor:ne,removeRequestInterceptor:E,addResponseInterceptor:P,removeResponseInterceptor:T,setTimeout:a,setProxyAgent:h,setSessionToken:m,setPublishableKey:c,setEndpoints:w,get:tt,getAll:Ks,post:rt,put:nt,patch:Vs,delete:zs,deleteAll:_s,create:Js,download:Ws}}function on({apiHandler:t}){return{activate({token:e}){return t.post(`activation/${e}`,{authenticate:!1})},forgotPassword({data:e}){return t.post("forgot-password",e,{authenticate:!1})},logout(){return t.post("logout")},signIn({data:e}){return t.post("signin",e,{authenticate:!1})},signUp({data:e}){return t.post("signup",e,{authenticate:!1})}}}function ln({apiHandler:t}){return{getAll({firstName:e,lastName:r,dob:n=null,country:s=null}){const u={firstName:e,lastName:r,dob:n,country:s};return t.getAll("aml",u)}}}function cn({apiHandler:t}){return{getAll({limit:e=null,offset:r=null,sort:n=null}={}){const s={limit:e,offset:r,sort:n};return t.getAll("api-keys",s)},create({id:e="",data:r}){return t.create(`api-keys/${e}`,e,r)},get({id:e}){return t.get(`api-keys/${e}`)},update({id:e,data:r}){return t.put(`api-keys/${e}`,r)},delete({id:e}){return t.delete(`api-keys/${e}`)}}}function an({apiHandler:t}){return{get({applicationId:e}){return t.get(`application-instances/${e}`)},upsert({applicationId:e,data:r}){return t.put(`application-instances/${e}`,r)},delete({applicationId:e}){return t.delete(`application-instances/${e}`)}}}function fn({apiHandler:t}){return{getAll({limit:e=null,offset:r=null,filter:n=null,q:s=null,expand:u=null,fields:o=null,sort:l=null}={}){const a={limit:e,offset:r,filter:n,q:s,expand:u,fields:o,sort:l};return t.getAll("applications",a)},create({data:e}){return t.post("applications",e)},get({id:e}){return t.get(`applications/${e}`)},getInstances({id:e}){return t.getAll(`applications/${e}/instances`)},getInstance({id:e,organizationId:r}){return t.get(`applications/${e}/instances/${r}`)}}}function mn({apiHandler:t}){return{getAll({limit:e=null,offset:r=null}={}){const n={limit:e,offset:r};return t.getAll("balance-transactions",n)},get({id:e}){return t.get(`balance-transactions/${e}`)}}}function gn({apiHandler:t}){return{getAll({limit:e=null,offset:r=null,sort:n=null,filter:s=null,q:u=null}={}){const o={limit:e,offset:r,sort:n,filter:s,q:u};return t.getAll("billing-portals",o)},create({id:e="",data:r}){return t.create(`billing-portals/${e}`,e,r)},get({id:e}){return t.get(`billing-portals/${e}`)},update({id:e,data:r}){return t.put(`billing-portals/${e}`,r)},delete({id:e}){return t.delete(`billing-portals/${e}`)}}}function hn({apiHandler:t}){return{getAll({limit:e=null,offset:r=null,sort:n=null,filter:s=null,q:u=null}={}){const o={limit:e,offset:r,sort:n,filter:s,q:u};return t.getAll("blocklists",o)},create({id:e="",data:r}){return t.create(`blocklists/${e}`,e,r)},get({id:e}){return t.get(`blocklists/${e}`)},delete({id:e}){return t.delete(`blocklists/${e}`)}}}function pn({apiHandler:t}){return{getAll({limit:e=null,offset:r=null,sort:n=null,filter:s=null}={}){const u={limit:e,offset:r,sort:n,filter:s};return t.getAll("broadcast-messages",u)},create({data:e}){return t.post("broadcast-messages",e)},get({id:e}){return t.get(`broadcast-messages/${e}`)},delete({id:e}){return t.delete(`broadcast-messages/${e}`)},update({id:e,data:r}){return t.patch(`broadcast-messages/${e}`,r)}}}function dn({apiHandler:t}){return{getAll({limit:e=null,offset:r=null,sort:n=null,filter:s=null,q:u=null}={}){const o={limit:e,offset:r,sort:n,filter:s,q:u};return t.getAll("checkout-forms",o)},create({id:e="",data:r}){return t.create(`checkout-forms/${e}`,e,r)},get({id:e}){return t.get(`checkout-forms/${e}`)},update({id:e,data:r}){return t.put(`checkout-forms/${e}`,r)},delete({id:e}){return t.delete(`checkout-forms/${e}`)}}}function yn({apiHandler:t}){return{getAllRedemptions({limit:e=null,offset:r=null,filter:n=null,q:s=null,sort:u=null}={}){const o={limit:e,offset:r,filter:n,q:s,sort:u};return t.getAll("coupons-redemptions",o)},redeem({data:e}){return t.post("coupons-redemptions",e)},getRedemption({id:e}){return t.get(`coupons-redemptions/${e}`)},cancelRedemption({id:e}){return t.post(`coupons-redemptions/${e}/cancel`)},getAll({limit:e=null,offset:r=null,filter:n=null,q:s=null,sort:u=null}={}){const o={limit:e,offset:r,filter:n,q:s,sort:u};return t.getAll("coupons",o)},create({id:e="",data:r}){return t.create(`coupons/${e}`,e,r)},get({id:e}){return t.get(`coupons/${e}`)},update({id:e,data:r}){return t.put(`coupons/${e}`,r)},setExpiration({id:e,data:r}){return t.post(`coupons/${e}/expiration`,r)}}}function $n({apiHandler:t}){return{createAWSSESCredential({data:e}){return t.post("credential-hashes/aws-ses",e)},getAWSSESCredential({hash:e}){return t.get(`credential-hashes/aws-ses/${e}`)},updateAWSSESCredential({hash:e,data:r}){return t.patch(`credential-hashes/aws-ses/${e}`,r)},createEmailCredential({data:e}){return t.post("credential-hashes/emails",e)},getEmailCredential({hash:e}){return t.get(`credential-hashes/emails/${e}`)},patchEmailCredential({hash:e,data:r}){return t.patch(`credential-hashes/emails/${e}`,r)},createMailgunCredential({data:e}){return t.post("credential-hashes/mailgun",e)},getMailgunCredential({hash:e}){return t.get(`credential-hashes/mailgun/${e}`)},patchMailgunCredential({hash:e,data:r}){return t.patch(`credential-hashes/mailgun/${e}`,r)},getAllOAuth2Credentials({filter:e=null,limit:r=null,offset:n=null,sort:s=null,q:u=null}={}){const o={filter:e,limit:r,offset:n,sort:s,q:u};return t.getAll("credential-hashes/oauth2",o)},createOAuth2Credential({data:e}){return t.post("credential-hashes/oauth2",e)},getOAuth2Credential({hash:e}){return t.get(`credential-hashes/oauth2/${e}`)},updateOAuth2Credential({hash:e,data:r}){return t.patch(`credential-hashes/oauth2/${e}`,r)},getOAuth2CredentialItems({hash:e,limit:r=null,offset:n=null,filter:s=null,q:u=null,fields:o=null,sort:l=null}){const a={limit:r,offset:n,filter:s,q:u,fields:o,sort:l};return t.getAll(`credential-hashes/oauth2/${e}/items`,a)},getAllPlaidCredentials({filter:e=null,limit:r=null,offset:n=null,sort:s=null,q:u=null}={}){const o={filter:e,limit:r,offset:n,sort:s,q:u};return t.getAll("credential-hashes/plaid",o)},createPlaidCredential({data:e}){return t.post("credential-hashes/plaid",e)},getPlaidCredential({hash:e}){return t.get(`credential-hashes/plaid/${e}`)},updatePlaidCredential({hash:e,data:r}){return t.patch(`credential-hashes/plaid/${e}`,r)},createPostmarkCredential({data:e}){return t.post("credential-hashes/postmark",e)},getPostmarkCredential({hash:e}){return t.get(`credential-hashes/postmark/${e}`)},patchPostmarkCredential({hash:e,data:r}){return t.patch(`credential-hashes/postmark/${e}`,r)},createSendGridCredential({data:e}){return t.post("credential-hashes/sendgrid",e)},getSendGridCredential({hash:e}){return t.get(`credential-hashes/sendgrid/${e}`)},patchSendGridCredential({hash:e,data:r}){return t.patch(`credential-hashes/sendgrid/${e}`,r)},createWebhookCredential({data:e}){return t.post("credential-hashes/webhooks",e)},getWebhookCredential({hash:e}){return t.get(`credential-hashes/webhooks/${e}`)},patchWebhookCredential({hash:e,data:r}){return t.patch(`credential-hashes/webhooks/${e}`,r)},getAllExperianCredentials({filter:e=null,limit:r=null,offset:n=null,sort:s=null,q:u=null}={}){const o={filter:e,limit:r,offset:n,sort:s,q:u};return t.getAll("credential-hashes/experian",o)},createExperianCredential({data:e}){return t.post("credential-hashes/experian",e)},getExperianCredential({hash:e}){return t.get(`credential-hashes/experian/${e}`)},updateExperianCredential({hash:e,data:r}){return t.patch(`credential-hashes/experian/${e}`,r)},getAllTaxJarCredentials({filter:e=null,limit:r=null,offset:n=null,sort:s=null,q:u=null}={}){const o={filter:e,limit:r,offset:n,sort:s,q:u};return t.getAll("credential-hashes/taxjar",o)},createTaxJarCredential({data:e}){return t.post("credential-hashes/taxjar",e)},getTaxJarCredential({hash:e}){return t.get(`credential-hashes/taxjar/${e}`)},updateTaxJarCredential({hash:e,data:r}){return t.patch(`credential-hashes/taxjar/${e}`,r)}}}function bn({apiHandler:t}){return{getAll({limit:e=null,offset:r=null,sort:n=null,filter:s=null,q:u=null}={}){const o={limit:e,offset:r,sort:n,filter:s,q:u};return t.getAll("custom-domains",o)},create({data:e}){return t.post("custom-domains",e)},get({domain:e}){return t.get(`custom-domains/${e}`)},delete({domain:e}){return t.delete(`custom-domains/${e}`)}}}function An({apiHandler:t}){return{getAll({resource:e,limit:r=null,offset:n=null}){const s={limit:r,offset:n};return t.getAll(`custom-fields/${e}`,s)},get({resource:e,name:r}){return t.get(`custom-fields/${e}/${r}`)},create({resource:e,name:r,data:n}){return t.put(`custom-fields/${e}/${r}`,n)},update({resource:e,name:r,data:n}){return t.put(`custom-fields/${e}/${r}`,n)}}}function vn({apiHandler:t}){return{getAuthOptions(){return t.get("authentication-options")},updateAuthOptions({data:e}){return t.put("authentication-options",e)},getAllAuthTokens({limit:e=null,offset:r=null}={}){const n={limit:e,offset:r};return t.getAll("authentication-tokens",n)},login({data:e}){return t.post("authentication-tokens",e)},verify({token:e}){return t.get(`authentication-tokens/${e}`)},logout({token:e}){return t.delete(`authentication-tokens/${e}`)},exchangeToken({token:e,data:r}){return t.post(`authentication-tokens/${e}/exchange`,r)},getAllCredentials({limit:e=null,offset:r=null}={}){const n={limit:e,offset:r};return t.getAll("credentials",n)},createCredential({id:e="",data:r}){return t.create(`credentials/${e}`,e,r)},getCredential({id:e}){return t.get(`credentials/${e}`)},updateCredential({id:e,data:r}){return t.put(`credentials/${e}`,r)},deleteCredential({id:e}){return t.delete(`credentials/${e}`)},getAllResetPasswordTokens({limit:e=null,offset:r=null}={}){const n={limit:e,offset:r};return t.getAll("password-tokens",n)},createResetPasswordToken({data:e}){return t.post("password-tokens",e)},getResetPasswordToken({id:e}){return t.get(`password-tokens/${e}`)},deleteResetPasswordToken({id:e}){return t.delete(`password-tokens/${e}`)}}}const D={Accept:"text/csv"},Qe={Accept:"application/pdf"};function wn({apiHandler:t}){return{getAll({limit:e=null,offset:r=null,filter:n=null,q:s=null,expand:u=null,fields:o=null,sort:l=null}={}){const a={limit:e,offset:r,filter:n,q:s,expand:u,fields:o,sort:l};return t.getAll("customers",a)},create({id:e="",data:r,expand:n=null}){const s={expand:n};return t.create(`customers/${e}`,e,r,s)},get({id:e,expand:r=null,fields:n=null}){const s={expand:r,fields:n};return t.get(`customers/${e}`,s)},update({id:e,data:r,expand:n=null}){const s={expand:n};return t.put(`customers/${e}`,r,s)},merge({id:e,targetCustomerId:r}){return t.delete(`customers/${e}?targetCustomerId=${r}`)},getAml({id:e}){return t.getAll(`customers/${e}/aml`)},getLeadSource({id:e}){return t.get(`customers/${e}/lead-source`)},createLeadSource({id:e,data:r}){return t.put(`customers/${e}/lead-source`,r)},updateLeadSource({id:e,data:r}){return t.put(`customers/${e}/lead-source`,r)},deleteLeadSource({id:e}){return t.delete(`customers/${e}/lead-source`)},getAllTimelineMessages({id:e,limit:r=null,offset:n=null,filter:s=null,sort:u=null,q:o=null}){const l={limit:r,offset:n,filter:s,sort:u,q:o};return t.getAll(`customers/${e}/timeline`,l)},createTimelineComment({id:e,data:r}){return t.post(`customers/${e}/timeline`,r)},getTimelineMessage({id:e,messageId:r}){return t.get(`customers/${e}/timeline/${r}`)},deleteTimelineMessage({id:e,messageId:r}){return t.delete(`customers/${e}/timeline/${r}`)},getAllUpcomingInvoices({id:e,expand:r=null}){const n={expand:r};return t.getAll(`customers/${e}/upcoming-invoices`,n)},getCustomerEddScore({id:e}){return t.get(`customers/${e}/edd-score`)},patchCustomerEddScore({id:e,data:r}){return t.patch(`customers/${e}/edd-score`,r)},getEddTimelineCollection({id:e,limit:r=null,offset:n=null,filter:s=null,sort:u=null,q:o=null}){const l={limit:r,offset:n,filter:s,sort:u,q:o};return t.getAll(`customers/${e}/edd-timeline`,l)},createEddTimelineComment({id:e,data:r}){return t.post(`customers/${e}/edd-timeline`,r)},GetEddSearchResults({id:e}){return t.get(`customers/${e}/edd-search-results`)},downloadCSV({limit:e=null,offset:r=null,sort:n=null,expand:s=null,filter:u=null,q:o=null}={}){const l={params:{limit:e,offset:r,sort:n,expand:s,filter:u,q:o},headers:D};return t.download("customers",l)}}}function Rn({apiHandler:t}){return{create({data:e}){return t.post("digital-wallets/onboarding/apple-pay",e)},validate({data:e}){return t.post("digital-wallets/validation",e)}}}function En({apiHandler:t}){return{getAll({filter:e=null,sort:r=null,limit:n=null,offset:s=null,q:u=null,expand:o=null}={}){const l={filter:e,sort:r,limit:n,offset:s,q:u,expand:o};return t.getAll("disputes",l)},create({id:e="",data:r,expand:n=null}){const s={expand:n};return t.create(`disputes/${e}`,e,r,s)},get({id:e}){return t.get(`disputes/${e}`)},update({id:e,data:r,expand:n=null}){const s={expand:n};return t.put(`disputes/${e}`,r,s)},downloadCSV({limit:e=null,offset:r=null,sort:n=null,expand:s=null,filter:u=null,q:o=null}={}){const l={params:{limit:e,offset:r,sort:n,expand:s,filter:u,q:o},headers:D};return t.download("disputes",l)}}}function Sn({apiHandler:t}){return{verify({token:e}){return t.put(`email-delivery-setting-verifications/${e}`)},getAll({limit:e=null,offset:r=null,filter:n=null,sort:s=null,q:u=null}={}){const o={limit:e,offset:r,filter:n,sort:s,q:u};return t.getAll("email-delivery-settings",o)},create({data:e}){return t.post("email-delivery-settings",e)},get({id:e}){return t.get(`email-delivery-settings/${e}`)},delete({id:e}){return t.delete(`email-delivery-settings/${e}`)},update({id:e,data:r}){return t.patch(`email-delivery-settings/${e}`,r)},resendVerification({id:e}){return t.post(`email-delivery-settings/${e}/resend-email-verification`)}}}function kn({apiHandler:t}){return{getAll({limit:e=null,offset:r=null,q:n=null,sort:s=null,filter:u=null}={}){const o={limit:e,offset:r,q:n,sort:s,filter:u};return t.getAll("email-messages",o)},create({data:e}){return t.post("email-messages",e)},get({id:e}){return t.get(`email-messages/${e}`)},delete({id:e}){return t.delete(`email-messages/${e}`)},send({id:e,data:r={status:"outbox"}}){return t.patch(`email-messages/${e}`,r)}}}function Cn({apiHandler:t}){return{getAll(){return t.getAll("email-notifications")}}}function Tn({apiHandler:t}){return{getAll(){return t.getAll("events")},get({eventType:e}){return t.get(`events/${e}`)},getRules({eventType:e}){return t.get(`events/${e}/rules`)},createRules({eventType:e,data:r}){return t.put(`events/${e}/rules`,r)},updateRules({eventType:e,data:r}){return t.put(`events/${e}/rules`,r)},getAllTimelineMessages({eventType:e,limit:r=null,offset:n=null,filter:s=null,sort:u=null,q:o=null}){const l={limit:r,offset:n,filter:s,sort:u,q:o};return t.getAll(`events/${e}/timeline`,l)},createTimelineComment({eventType:e,data:r}){return t.post(`events/${e}/timeline`,r)},getTimelineMessage({eventType:e,messageId:r}){return t.get(`events/${e}/timeline/${r}`)},deleteTimelineMessage({eventType:e,messageId:r}){return t.delete(`events/${e}/timeline/${r}`)},getRulesHistory({eventType:e,limit:r=null,offset:n=null,filter:s=null,q:u=null,sort:o=null,fields:l=null,expand:a=null}){const m={limit:r,offset:n,filter:s,q:u,sort:o,fields:l,expand:a};return t.getAll(`events/${e}/rules/history`,m)},getRulesVersionNumber({eventType:e,version:r,fields:n=null,expand:s=null}){const u={fields:n,expand:s};return t.get(`events/${e}/rules/history/${r}`,u)},getRulesVersionDetail({eventType:e,version:r,fields:n=null,expand:s=null}){const u={fields:n,expand:s};return t.get(`events/${e}/rules/versions/${r}`,u)},getAllDraftRulesets({eventType:e,limit:r=null,offset:n=null,filter:s=null,q:u=null,sort:o=null,fields:l=null,expand:a=null}){const m={limit:r,offset:n,filter:s,q:u,sort:o,fields:l,expand:a};return t.getAll(`events/${e}/rules/drafts`,m)},createDraftRuleset({eventType:e,data:r}){return t.post(`events/${e}/rules/drafts`,r)},getDraftRuleset({eventType:e,id:r,fields:n=null,expand:s=null}){const u={fields:n,expand:s};return t.get(`events/${e}/rules/drafts/${r}`,u)},updateDraftRuleset({eventType:e,id:r,data:n}){return t.put(`events/${e}/rules/drafts/${r}`,n)},deleteDraftRuleset({eventType:e,id:r}){return t.delete(`events/${e}/rules/drafts/${r}`)}}}function xn({apiHandler:t}){return{getAll({limit:e=null,offset:r=null}={}){const n={limit:e,offset:r};return t.getAll("fees",n)},create({id:e="",data:r}){return t.create(`fees/${e}`,e,r)},get({id:e}){return t.get(`fees/${e}`)},upsert({id:e,data:r}){return t.put(`fees/${e}`,r)},patch({id:e,data:r}){return t.patch(`fees/${e}`,r)}}}function In({apiHandler:t}){return{getAllAttachments({limit:e=null,offset:r=null,filter:n=null,q:s=null,expand:u=null,fields:o=null,sort:l=null}={}){const a={limit:e,offset:r,filter:n,q:s,expand:u,fields:o,sort:l};return t.getAll("attachments",a)},attach({id:e="",data:r,expand:n=null}){const s={expand:n};return t.create(`attachments/${e}`,e,r,s)},getAttachment({id:e}){return t.get(`attachments/${e}`)},updateAttachment({id:e,data:r,expand:n=null}){const s={expand:n};return t.put(`attachments/${e}`,r,s)},detach({id:e}){return t.delete(`attachments/${e}`)},getAll({limit:e=null,offset:r=null,filter:n=null,q:s=null,expand:u=null,fields:o=null,sort:l=null}={}){const a={limit:e,offset:r,filter:n,q:s,expand:u,fields:o,sort:l};return t.getAll("files",a)},upload({fileObject:e}){return t.post("files",e)},get({id:e}){return t.get(`files/${e}`)},update({id:e,data:r}){return t.put(`files/${e}`,r)},delete({id:e}){return t.delete(`files/${e}`)},download({id:e}){const r={responseType:"arraybuffer"};return t.download(`files/${e}/download`,r)},detachAndDelete({id:e}){const r={filter:`fileId:${e}`};let n=[];const u=(async()=>{const o=this.getAllAttachments(r);n.push(o);const a=(await o).items.map(c=>this.detach({id:c.fields.id}));n=[...n,a],await Promise.all(a);const m=t.delete(`files/${e}`);return n.push(m),m})();return u.cancel=()=>{n.forEach(o=>o.cancel())},u},uploadAndUpdate({fileObject:e,data:r={description:"",tags:[""]}}){const n=[],u=(async()=>{const o=this.upload({fileObject:e});n.push(o),await o;const l={name:o.name,extension:o.extension,description:r.description,tags:r.tags,url:""},a=this.update({id:o.fields.id,data:l});return n.push(a),a})();return u.cancel=()=>{n.forEach(o=>o.cancel())},u}}}function Pn({apiHandler:t}){return{getAll({limit:e=null,offset:r=null,sort:n=null,filter:s=null,q:u=null,fields:o=null}={}){const l={limit:e,offset:r,sort:n,filter:s,q:u,fields:o};return t.getAll("gateway-accounts",l)},create({id:e="",data:r}){return t.create(`gateway-accounts/${e}`,e,r)},get({id:e}){return t.get(`gateway-accounts/${e}`)},update({id:e,data:r}){return t.patch(`gateway-accounts/${e}`,r)},delete({id:e}){return t.delete(`gateway-accounts/${e}`)},close({id:e}){return t.post(`gateway-accounts/${e}/close`)},disable({id:e}){return t.post(`gateway-accounts/${e}/disable`)},getAllDowntimeSchedules({id:e,limit:r=null,offset:n=null,filter:s=null,sort:u=null}){const o={limit:r,offset:n,filter:s,sort:u};return t.getAll(`gateway-accounts/${e}/downtime-schedules`,o)},createDowntimeSchedule({id:e,data:r}){return t.post(`gateway-accounts/${e}/downtime-schedules`,r)},getDowntimeSchedule({id:e,downtimeId:r}){return t.get(`gateway-accounts/${e}/downtime-schedules/${r}`)},updateDowntimeSchedule({id:e,downtimeId:r,data:n}){return t.put(`gateway-accounts/${e}/downtime-schedules/${r}`,n)},deleteDowntimeSchedule({id:e,downtimeId:r}){return t.delete(`gateway-accounts/${e}/downtime-schedules/${r}`)},enable({id:e}){return t.post(`gateway-accounts/${e}/enable`)},getAllVolumeLimits({id:e}){return t.getAll(`gateway-accounts/${e}/limits`)},getVolumeLimit({id:e,limitId:r}){return t.get(`gateway-accounts/${e}/limits/${r}`)},updateVolumeLimit({id:e,limitId:r,data:n}){return t.put(`gateway-accounts/${e}/limits/${r}`,n)},deleteVolumeLimit({id:e,limitId:r}){return t.delete(`gateway-accounts/${e}/limits/${r}`)},getAllTimelineMessages({id:e,limit:r=null,offset:n=null,filter:s=null,sort:u=null,q:o=null}){const l={limit:r,offset:n,filter:s,sort:u,q:o};return t.getAll(`gateway-accounts/${e}/timeline`,l)},createTimelineComment({id:e,data:r}){return t.post(`gateway-accounts/${e}/timeline`,r)},getTimelineMessage({id:e,messageId:r}){return t.get(`gateway-accounts/${e}/timeline/${r}`)},deleteTimelineMessage({id:e,messageId:r}){return t.delete(`gateway-accounts/${e}/timeline/${r}`)},checkCredentials({id:e}){return t.post(`gateway-accounts/${e}/check-credentials`)},getFinancialSettings({id:e}){return t.get(`gateway-accounts/${e}/financial-settings`)},setFinancialSettings({id:e,data:r}){return t.put(`gateway-accounts/${e}/financial-settings`,r)}}}function On({apiHandler:t}){return{getAll(){return t.getAll("integrations")},get({label:e}){return t.get(`integrations/${e}`)}}}function jn({apiHandler:t}){return{getAll({filter:e=null,sort:r=null,limit:n=null,offset:s=null,q:u=null,expand:o=null}={}){const l={filter:e,sort:r,limit:n,offset:s,q:u,expand:o};return t.getAll("invoices",l)},create({id:e="",data:r,expand:n=null}){const s={expand:n};return t.create(`invoices/${e}`,e,r,s)},get({id:e,expand:r=null}){const n={expand:r};return t.get(`invoices/${e}`,n)},update({id:e,data:r,expand:n=null}){const s={expand:n};return t.put(`invoices/${e}`,r,s)},getAllInvoiceItems({id:e,limit:r=null,offset:n=null,expand:s=null}){const u={limit:r,offset:n,expand:s};return t.getAll(`invoices/${e}/items`,u)},createInvoiceItem({id:e,data:r}){return t.post(`invoices/${e}/items`,r)},getInvoiceItem({id:e,itemId:r}){return t.get(`invoices/${e}/items/${r}`)},updateInvoiceItem({id:e,itemId:r,data:n}){return t.put(`invoices/${e}/items/${r}`,n)},deleteInvoiceItem({id:e,itemId:r}){return t.delete(`invoices/${e}/items/${r}`)},issue({id:e,data:r}){return t.post(`invoices/${e}/issue`,r)},abandon({id:e}){return t.post(`invoices/${e}/abandon`)},void({id:e}){return t.post(`invoices/${e}/void`)},recalculate({id:e}){return t.post(`invoices/${e}/recalculate`)},reissue({id:e,data:r}){return t.post(`invoices/${e}/reissue`,r)},getAllTransactionAllocations({id:e,limit:r=null,offset:n=null}){const s={limit:r,offset:n};return t.getAll(`invoices/${e}/transaction-allocations`,s)},applyTransaction({id:e,data:r}){return t.post(`invoices/${e}/transaction`,r)},getAllTimelineMessages({id:e,limit:r=null,offset:n=null,filter:s=null,sort:u=null,q:o=null}){const l={limit:r,offset:n,filter:s,sort:u,q:o};return t.getAll(`invoices/${e}/timeline`,l)},createTimelineComment({id:e,data:r}){return t.post(`invoices/${e}/timeline`,r)},getTimelineMessage({id:e,messageId:r}){return t.get(`invoices/${e}/timeline/${r}`)},deleteTimelineMessage({id:e,messageId:r}){return t.delete(`invoices/${e}/timeline/${r}`)},downloadCSV({limit:e=null,offset:r=null,sort:n=null,expand:s=null,filter:u=null,q:o=null}={}){const l={params:{limit:e,offset:r,sort:n,expand:s,filter:u,q:o},headers:D};return t.download("invoices",l)},downloadPDF({id:e}){const r={headers:Qe,responseType:"arraybuffer"};return t.download(`invoices/${e}`,r)}}}function qn({apiHandler:t}){return{getAll({limit:e=null,offset:r=null,filter:n=null,sort:s=null}={}){const u={limit:e,offset:r,filter:n,sort:s};return t.getAll("kyc-documents",u)},create({id:e="",data:r}){return t.create(`kyc-documents/${e}`,e,r)},get({id:e}){return t.get(`kyc-documents/${e}`)},update({id:e,data:r}){return t.put(`kyc-documents/${e}`,r)},accept({id:e}){return t.post(`kyc-documents/${e}/acceptance`)},matches({id:e,data:r}){return t.post(`kyc-documents/${e}/matches`,r)},reject({id:e,data:r}){return t.post(`kyc-documents/${e}/rejection`,r)},review({id:e}){return t.post(`kyc-documents/${e}/review`)},startReview({id:e}){return t.post(`kyc-documents/${e}/start-review`)},stopReview({id:e}){return t.post(`kyc-documents/${e}/stop-review`)}}}function Dn({apiHandler:t}){return{getAll({limit:e=null,offset:r=null,filter:n=null,sort:s=null}={}){const u={limit:e,offset:r,filter:n,sort:s};return t.getAll("kyc-requests",u)},create({data:e}){return t.post("kyc-requests",e)},get({id:e}){return t.get(`kyc-requests/${e}`)},delete({id:e}){return t.delete(`kyc-requests/${e}`)},update({id:e,data:r}){return t.patch(`kyc-requests/${e}`,r)}}}function Nn({apiHandler:t}){return{updateKycSettings({data:e}){return t.put("kyc-settings",e)}}}function Mn({apiHandler:t}){return{getAll({limit:e=null,offset:r=null,filter:n=null,sort:s=null,fields:u=null,q:o=null}={}){const l={limit:e,offset:r,filter:n,sort:s,fields:u,q:o};return t.getAll("lists",l)},create({id:e="",data:r}){return t.create(`lists/${e}`,e,r)},getLatestVersion({id:e}){return t.get(`lists/${e}`)},update({id:e,data:r}){return t.put(`lists/${e}`,r)},delete({id:e}){return t.delete(`lists/${e}`)},getByVersion({id:e,version:r}){return t.get(`lists/${e}/${r}`)}}}function Bn({apiHandler:t}){return{getAll({limit:e=null,offset:r=null,filter:n=null,sort:s=null}={}){const u={limit:e,offset:r,filter:n,sort:s};return t.getAll("memberships",u)},get({organizationId:e,userId:r}){return t.get(`memberships/${e}/${r}`)},update({organizationId:e,userId:r,data:n}){return t.put(`memberships/${e}/${r}`,n)},delete({organizationId:e,userId:r}){return t.delete(`memberships/${e}/${r}`)}}}function Un({apiHandler:t}){return{getAll({limit:e=null,offset:r=null,filter:n=null,q:s=null}={}){const u={limit:e,offset:r,filter:n,q:s};return t.getAll("organizations",u)},create({data:e}){return t.post("organizations",e)},get({id:e}){return t.get(`organizations/${e}`)},update({id:e,data:r}){return t.patch(`organizations/${e}`,r)}}}function Ln({apiHandler:t}){return{getAll({limit:e=null,q:r=null}={}){const n={limit:e,q:r};return t.getAll("payment-cards-bank-names",n)}}}function Fn({apiHandler:t}){return{getAll({filter:e=null,sort:r=null,limit:n=null,offset:s=null,q:u=null,expand:o=null}={}){const l={filter:e,sort:r,limit:n,offset:s,q:u,expand:o};return t.getAll("payment-instruments",l)},create({data:e}){return t.post("payment-instruments",e)},get({id:e}){return t.get(`payment-instruments/${e}`)},update({id:e,data:r}){return t.patch(`payment-instruments/${e}`,r)},deactivate({id:e}){return t.post(`payment-instruments/${e}/deactivation`)}}}function Kn({apiHandler:t}){return{getAll(){return t.getAll("payment-methods")},get({apiName:e}){return t.get(`payment-methods/${e}`)}}}function Vn({apiHandler:t}){return{getAll({limit:e=null,offset:r=null}={}){const n={limit:e,offset:r};return t.getAll("tokens",n)},create({data:e}){return t.post("tokens",e)},get({token:e}){return t.get(`tokens/${e}`)}}}function zn({apiHandler:t}){return{create({data:e}){return t.post("payouts",e)}}}function _n({apiHandler:t}){return{getAll({filter:e=null,sort:r=null,limit:n=null,offset:s=null,q:u=null}={}){const o={filter:e,sort:r,limit:n,offset:s,q:u};return t.getAll("plans",o)},create({id:e="",data:r}){return t.create(`plans/${e}`,e,r)},get({id:e}){return t.get(`plans/${e}`)},update({id:e,data:r}){return t.put(`plans/${e}`,r)},delete({id:e}){return t.delete(`plans/${e}`)}}}function Jn({apiHandler:t}){return{sendEmailRuleAction({data:e}){return t.post("previews/rule-actions/send-email",e)},triggerWebhookRuleAction({data:e}){return t.post("previews/rule-actions/trigger-webhook",e)},webhook({data:e}){return t.post("previews/webhooks",e)},order({data:e}){return t.post("previews/orders",e)}}}function Wn({apiHandler:t}){return{getAll({filter:e=null,sort:r=null,limit:n=null,offset:s=null,q:u=null}={}){const o={filter:e,sort:r,limit:n,offset:s,q:u};return t.getAll("products",o)},create({id:e="",data:r}){return t.create(`products/${e}`,e,r)},get({id:e}){return t.get(`products/${e}`)},update({id:e,data:r}){return t.put(`products/${e}`,r)},delete({id:e}){return t.delete(`products/${e}`)}}}function Gn({apiHandler:t}){return{startPermissionsEmulation({data:e}){return t.post("permissions-emulation",e)},stopPermissionsEmulation(){return t.delete("permissions-emulation")},get(){return t.get("profile")},update({data:e}){return t.put("profile",e)},getMfa(){return t.get("profile/mfa")},updateMfa(){return t.post("profile/mfa")},deleteMfa(){return t.delete("profile/mfa")},updatePassword({data:e}){return t.post("profile/password",e)},resetTotp(){return t.post("profile/totp-reset")}}}function Xn({apiHandler:t}){return{readyToPay({data:e}){return t.post("ready-to-pay",e)}}}function Yn({apiHandler:t}){return{getAll({limit:e=null,offset:r=null,filter:n=null,sort:s=null,q:u=null,expand:o=null}={}){const l={limit:e,offset:r,filter:n,sort:s,q:u,expand:o};return t.getAll("roles",l)},create({id:e="",data:r}){return t.create(`roles/${e}`,e,r)},get({id:e,expand:r=null}){const n={expand:r};return t.get(`roles/${e}`,n)},update({id:e,data:r}){return t.put(`roles/${e}`,r)},delete({id:e}){return t.delete(`roles/${e}`)}}}function Qn({apiHandler:t}){return{get({sort:e=null,limit:r=null,offset:n=null,q:s=null}){const u={sort:e,limit:r,offset:n,q:s};return t.get("search",u)}}}function Zn({apiHandler:t}){return{getAll({limit:e=null,offset:r=null,sort:n=null,filter:s=null,q:u=null}={}){const o={limit:e,offset:r,sort:n,filter:s,q:u};return t.getAll("grid-segments",o)},create({id:e="",data:r}){return t.create(`grid-segments/${e}`,e,r)},get({id:e}){return t.get(`grid-segments/${e}`)},update({id:e,data:r}){return t.put(`grid-segments/${e}`,r)},delete({id:e}){return t.delete(`grid-segments/${e}`)}}}function Hn({apiHandler:t}){return{getAll({eventType:e}){return t.getAll(`send-through-attribution/${e}`)}}}function es({apiHandler:t}){return{getAll({limit:e=null,offset:r=null,filter:n=null,sort:s=null,q:u=null}={}){const o={limit:e,offset:r,filter:n,sort:s,q:u};return t.getAll("shipping-rates",o)},create({id:e="",data:r}){return t.create(`shipping-rates/${e}`,e,r)},get({id:e}){return t.get(`shipping-rates/${e}`)},update({id:e,data:r}){return t.put(`shipping-rates/${e}`,r)},delete({id:e}){return t.delete(`shipping-rates/${e}`)}}}function ts({apiHandler:t}){return{get(){return t.get("status")}}}function rs({apiHandler:t}){return{getAll({limit:e=null,offset:r=null,filter:n=null,sort:s=null}={}){const u={limit:e,offset:r,filter:n,sort:s};return t.getAll("subscription-cancellations",u)},create({id:e="",data:r}){return t.create(`subscription-cancellations/${e}`,e,r)},get({id:e}){return t.get(`subscription-cancellations/${e}`)},delete({id:e}){return t.delete(`subscription-cancellations/${e}`)},patch({id:e,data:r}){return t.patch(`subscription-cancellations/${e}`,r)}}}function ns({apiHandler:t}){return{getAll({limit:e=null,offset:r=null,filter:n=null,sort:s=null}={}){const u={limit:e,offset:r,filter:n,sort:s};return t.getAll("subscription-pauses",u)},pause({id:e="",data:r}){return t.create(`subscription-pauses/${e}`,e,r)},get({id:e}){return t.get(`subscription-pauses/${e}`)},update({id:e,data:r}){return t.put(`subscription-pauses/${e}`,r)},delete({id:e}){return t.delete(`subscription-pauses/${e}`)}}}function ss({apiHandler:t}){return{getAll({limit:e=null,offset:r=null,filter:n=null,sort:s=null}={}){const u={limit:e,offset:r,filter:n,sort:s};return t.getAll("subscription-reactivations",u)},reactivate({data:e}){return t.post("subscription-reactivations",e)},get({id:e}){return t.get(`subscription-reactivations/${e}`)}}}function us({apiHandler:t}){return{getAll({filter:e=null,sort:r=null,limit:n=null,offset:s=null,q:u=null,expand:o=null}={}){const l={filter:e,sort:r,limit:n,offset:s,q:u,expand:o};return t.getAll("subscriptions",l)},create({id:e="",data:r,expand:n=null}){const s={expand:n};return t.create(`subscriptions/${e}`,e,r,s)},get({id:e,expand:r=null}){const n={expand:r};return t.get(`subscriptions/${e}`,n)},update({id:e,data:r,expand:n=null}){const s={expand:n};return t.put(`subscriptions/${e}`,r,s)},delete({id:e}){return t.delete(`subscriptions/${e}`)},void({id:e}){return t.post(`subscriptions/${e}/void`)},changeItems({id:e,data:r}){return t.post(`subscriptions/${e}/change-items`,r)},createInterimInvoice({id:e,data:r}){return t.post(`subscriptions/${e}/interim-invoice`,r)},getAllUpcomingInvoices({id:e,expand:r=null}){const n={expand:r};return t.getAll(`subscriptions/${e}/upcoming-invoices`,n)},issueUpcomingInvoice({id:e,invoiceId:r,data:n}){return t.post(`subscriptions/${e}/upcoming-invoices/${r}/issue`,n)},getAllTimelineMessages({id:e,limit:r=null,offset:n=null,filter:s=null,sort:u=null,q:o=null}){const l={limit:r,offset:n,filter:s,sort:u,q:o};return t.getAll(`subscriptions/${e}/timeline`,l)},createTimelineComment({id:e,data:r}){return t.post(`subscriptions/${e}/timeline`,r)},getTimelineMessage({id:e,messageId:r}){return t.get(`subscriptions/${e}/timeline/${r}`)},deleteTimelineMessage({id:e,messageId:r}){return t.delete(`subscriptions/${e}/timeline/${r}`)},downloadCSV({limit:e=null,offset:r=null,sort:n=null,expand:s=null,filter:u=null,q:o=null}={}){const l={params:{limit:e,offset:r,sort:n,expand:s,filter:u,q:o},headers:D};return t.download("subscriptions",l)}}}function os({apiHandler:t}){return{getAll({limit:e=null,offset:r=null,filter:n=null,q:s=null,sort:u=null}={}){const o={limit:e,offset:r,filter:n,q:s,sort:u};return t.getAll("tags",o)},create({data:e}){return t.post("tags",e)},get({tag:e}){return t.get(`tags/${e}`)},delete({tag:e}){return t.delete(`tags/${e}`)},update({tag:e,data:r}){return t.patch(`tags/${e}`,r)},tagCustomers({tag:e,data:r}){return t.post(`tags/${e}/customers`,r)},untagCustomers({tag:e,data:r}){return t.delete(`tags/${e}/customers`,r)},tagCustomer({tag:e,customerId:r}){return t.post(`tags/${e}/customers/${r}`)},untagCustomer({tag:e,customerId:r}){return t.delete(`tags/${e}/customers/${r}`)},tagKycDocuments({tag:e,data:r}){return t.post(`tags/${e}/kyc-documents`,r)},untagKycDocuments({tag:e,data:r}){return t.delete(`tags/${e}/kyc-documents`,r)},tagKycDocument({tag:e,kycDocumentId:r}){return t.post(`tags/${e}/kyc-documents/${r}`)},untagKycDocument({tag:e,kycDocumentId:r}){return t.delete(`tags/${e}/kyc-documents/${r}`)}}}function ls({apiHandler:t}){return{getAllApiLogs({limit:e=null,offset:r=null,sort:n=null,filter:s=null,q:u=null}={}){const o={limit:e,offset:r,sort:n,filter:s,q:u};return t.getAll("tracking/api",o)},getApiLog({id:e}){return t.get(`tracking/api/${e}`)},getAllListsChangesHistory({limit:e=null,offset:r=null,sort:n=null,filter:s=null,q:u=null}={}){const o={limit:e,offset:r,sort:n,filter:s,q:u};return t.getAll("tracking/lists",o)},getAllWebhookTrackingLogs({limit:e=null,offset:r=null,sort:n=null,filter:s=null,q:u=null}={}){const o={limit:e,offset:r,sort:n,filter:s,q:u};return t.getAll("tracking/webhooks",o)},getWebhookTrackingLog({id:e}){return t.get(`tracking/webhooks/${e}`)},resendWebhook({id:e}){return t.post(`tracking/webhooks/${e}/resend`)},downloadApiLogsCSV({limit:e=null,offset:r=null,sort:n=null,filter:s=null,q:u=null}={}){const o={params:{limit:e,offset:r,sort:n,filter:s,q:u},headers:D};return t.download("tracking/api",o)}}}function is({apiHandler:t}){return{getAll({limit:e=null,offset:r=null,filter:n=null,q:s=null,sort:u=null,expand:o=null}={}){const l={limit:e,offset:r,filter:n,q:s,sort:u,expand:o};return t.getAll("transactions",l)},create({data:e,expand:r=null}){const n={expand:r};return t.post("transactions",e,n)},get({id:e,expand:r=null}){const n={expand:r};return t.get(`transactions/${e}`,n)},patch({id:e,data:r}){return t.patch(`transactions/${e}`,r)},query({id:e}){return t.post(`transactions/${e}/query`)},update({id:e,data:r}){return t.post(`transactions/${e}/update`,r)},refund({id:e,data:r}){return t.post(`transactions/${e}/refund`,r)},getAllTimelineMessages({id:e,limit:r=null,offset:n=null,filter:s=null}){const u={limit:r,offset:n,filter:s};return t.getAll(`transactions/${e}/timeline`,u)},createTimelineComment({id:e,data:r}){return t.post(`transactions/${e}/timeline`,r)},getTimelineMessage({id:e,messageId:r}){return t.get(`transactions/${e}/timeline/${r}`)},deleteTimelineMessage({id:e,messageId:r}){return t.delete(`transactions/${e}/timeline/${r}`)},downloadCSV({limit:e=null,offset:r=null,sort:n=null,expand:s=null,filter:u=null,q:o=null}={}){const l={params:{limit:e,offset:r,sort:n,expand:s,filter:u,q:o},headers:D};return t.download("transactions",l)}}}function cs({apiHandler:t}){return{getResetPasswordToken({token:e}){return t.get(`reset-password/${e}`)},resetPassword({token:e,data:r}){return t.post(`reset-password/${e}`,r)},getAll({limit:e=null,offset:r=null,sort:n=null,filter:s=null,q:u=null}={}){const o={limit:e,offset:r,sort:n,filter:s,q:u};return t.getAll("users",o)},create({id:e="",data:r}){return t.create(`users/${e}`,e,r)},get({id:e}){return t.get(`users/${e}`)},update({id:e,data:r}){return t.put(`users/${e}`,r)},updatePassword({id:e,data:r}){return t.post(`users/${e}/password`,r)},resetTotp({id:e}){return t.post(`users/${e}/totp-reset`)}}}function as({apiHandler:t}){return{getAll({limit:e=null,offset:r=null,filter:n=null}={}){const s={limit:e,offset:r,filter:n};return t.getAll("webhooks",s)},create({id:e="",data:r}){return t.create(`webhooks/${e}`,e,r)},get({id:e}){return t.get(`webhooks/${e}`)},update({id:e,data:r}){return t.put(`webhooks/${e}`,r)}}}function fs({apiHandler:t}){return{getAll({limit:e=null,offset:r=null,q:n=null,filter:s=null,sort:u=null}={}){const o={limit:e,offset:r,q:n,filter:s,sort:u};return t.getAll("websites",o)},create({id:e="",data:r}){return t.create(`websites/${e}`,e,r)},get({id:e}){return t.get(`websites/${e}`)},update({id:e,data:r}){return t.put(`websites/${e}`,r)},delete({id:e}){return t.delete(`websites/${e}`)},downloadCSV({limit:e=null,offset:r=null,sort:n=null,expand:s=null,filter:u=null,q:o=null}={}){const l={params:{limit:e,offset:r,sort:n,expand:s,filter:u,q:o},headers:D};return t.download("websites",l)}}}class ms{constructor({apiHandler:e}){this.account=on({apiHandler:e}),this.aml=ln({apiHandler:e}),this.apiKeys=cn({apiHandler:e}),this.applicationInstances=an({apiHandler:e}),this.applications=fn({apiHandler:e}),this.balanceTransactions=mn({apiHandler:e}),this.billingPortals=gn({apiHandler:e}),this.blocklists=hn({apiHandler:e}),this.broadcastMessages=pn({apiHandler:e}),this.checkoutForms=dn({apiHandler:e}),this.coupons=yn({apiHandler:e}),this.credentialHashes=$n({apiHandler:e}),this.customDomains=bn({apiHandler:e}),this.customFields=An({apiHandler:e}),this.customerAuthentication=vn({apiHandler:e}),this.customers=wn({apiHandler:e}),this.digitalWallets=Rn({apiHandler:e}),this.disputes=En({apiHandler:e}),this.emailDeliverySettings=Sn({apiHandler:e}),this.emailMessages=kn({apiHandler:e}),this.emailNotifications=Cn({apiHandler:e}),this.events=Tn({apiHandler:e}),this.fees=xn({apiHandler:e}),this.files=In({apiHandler:e}),this.gatewayAccounts=Pn({apiHandler:e}),this.integrations=On({apiHandler:e}),this.invoices=jn({apiHandler:e}),this.kycDocuments=qn({apiHandler:e}),this.kycRequests=Dn({apiHandler:e}),this.kycSettings=Nn({apiHandler:e}),this.lists=Mn({apiHandler:e}),this.memberships=Bn({apiHandler:e}),this.organizations=Un({apiHandler:e}),this.paymentCardsBankNames=Ln({apiHandler:e}),this.paymentInstruments=Fn({apiHandler:e}),this.paymentMethods=Kn({apiHandler:e}),this.paymentTokens=Vn({apiHandler:e}),this.payouts=zn({apiHandler:e}),this.plans=_n({apiHandler:e}),this.previews=Jn({apiHandler:e}),this.products=Wn({apiHandler:e}),this.profile=Gn({apiHandler:e}),this.purchase=Xn({apiHandler:e}),this.roles=Yn({apiHandler:e}),this.search=Qn({apiHandler:e}),this.segments=Zn({apiHandler:e}),this.sendThroughAttribution=Hn({apiHandler:e}),this.shippingRates=es({apiHandler:e}),this.status=ts({apiHandler:e}),this.subscriptionCancellations=rs({apiHandler:e}),this.subscriptionPauses=ns({apiHandler:e}),this.subscriptionReactivations=ss({apiHandler:e}),this.subscriptions=us({apiHandler:e}),this.tags=os({apiHandler:e}),this.tracking=ls({apiHandler:e}),this.transactions=is({apiHandler:e}),this.users=cs({apiHandler:e}),this.webhooks=as({apiHandler:e}),this.websites=fs({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 gs({apiHandler:t}){return{getCustomerLifetimeSummaryMetrics({customerId:e=""}={}){const r={customerId:e};return t.get(`customers/${e}/summary-metrics`,r)}}}function hs({apiHandler:t}){return{getAll({limit:e=null,offset:r=null,sort:n=null,expand:s=null,filter:u=null,q:o=null,criteria:l=null}={}){const a={limit:e,offset:r,sort:n,expand:s,filter:u,q:o,criteria:l};return t.getAll("data-exports",a)},get({id:e,expand:r=null}){const n={expand:r};return t.get(`data-exports/${e}`,n)},queue({data:e,expand:r=null}){const n={expand:r};return t.post("data-exports",e,n)},update({id:e,data:r,expand:n=null}){const s={expand:n};return t.put(`data-exports/${e}`,r,s)},delete({id:e}){return t.delete(`data-exports/${e}`)}}}function ps({apiHandler:t}){return{getTransactionHistogramReport({periodStart:e="",periodEnd:r="",aggregationField:n="",aggregationPeriod:s="",metric:u="",filter:o=null,tz:l=null}={}){const a={periodStart:e,periodEnd:r,aggregationField:n,aggregationPeriod:s,metric:u,filter:o,tz:l};return t.get("histograms/transactions",a)}}}function ds({apiHandler:t}){return{getApiLogSummary({aggregationField:e,periodStart:r,periodEnd:n,limit:s=null,offset:u=null,tz:o=null}={}){const l={aggregationField:e,periodStart:r,periodEnd:n,limit:s,offset:u,tz:o};return t.get("reports/api-log-summary",l)},getCumulativeSubscriptions({aggregationField:e,periodStart:r,periodEnd:n,limit:s=null,offset:u=null,filter:o=null,criteria:l=null,tz:a=null}={}){const m={aggregationField:e,periodStart:r,periodEnd:n,limit:s,offset:u,filter:o,criteria:l,tz:a};return t.get("reports/cumulative-subscriptions",m)},getDashboardMetrics({periodStart:e=null,periodEnd:r=null,tz:n=null,metrics:s=null,segments:u={}}={}){const o={periodStart:e,periodEnd:r,tz:n,segments:u,metrics:s};return t.getAll("reports/dashboard",o)},getDccMarkup({aggregationField:e,periodStart:r,periodEnd:n,limit:s=null,offset:u=null,filter:o=null,tz:l=null}={}){const a={aggregationField:e,periodStart:r,periodEnd:n,limit:s,offset:u,filter:o,tz:l};return t.get("reports/dcc-markup",a)},getDisputes({aggregationField:e,periodMonth:r,limit:n=null,offset:s=null,filter:u=null,tz:o=null}={}){const l={aggregationField:e,periodMonth:r,limit:n,offset:s,filter:u,tz:o};return t.get("reports/disputes",l)},getEventsTriggeredSummary({periodStart:e,periodEnd:r,limit:n=null,offset:s=null,tz:u=null}={}){const o={periodStart:e,periodEnd:r,limit:n,offset:s,tz:u};return t.get("reports/events-triggered",o)},getFutureRenewals({periodStart:e,periodEnd:r,limit:n=null,offset:s=null,tz:u=null}={}){const o={periodStart:e,periodEnd:r,limit:n,offset:s,tz:u};return t.get("reports/future-renewals",o)},getKycAcceptanceSummary({periodStart:e,periodEnd:r}={}){const n={periodStart:e,periodEnd:r};return t.get("reports/kyc-acceptance-summary",n)},getKycRejectionSummary({periodStart:e,periodEnd:r}={}){const n={periodStart:e,periodEnd:r};return t.get("reports/kyc-rejection-summary",n)},getKycRequestSummary({periodStart:e,periodEnd:r}={}){const n={periodStart:e,periodEnd:r};return t.get("reports/kyc-request-summary",n)},getRulesMatchedSummary({eventType:e,periodStart:r,periodEnd:n,limit:s=null,offset:u=null,tz:o=null}={}){const l={periodStart:r,periodEnd:n,limit:s,offset:u,tz:o};return t.get(`reports/events-triggered/${e}/rules`,l)},getRenewalSales({periodStart:e,periodEnd:r,limit:n=null,offset:s=null,tz:u=null}={}){const o={periodStart:e,periodEnd:r,limit:n,offset:s,tz:u};return t.get("reports/renewal-sales",o)},getRetentionPercentage({aggregationField:e,aggregationPeriod:r,periodStart:n,periodEnd:s,includeSwitchedSubscriptions:u=null,limit:o=null,offset:l=null,filter:a=null,criteria:m=null,tz:c=null}={}){const h={aggregationField:e,aggregationPeriod:r,periodStart:n,periodEnd:s,includeSwitchedSubscriptions:u,limit:o,offset:l,filter:a,criteria:m,tz:c};return t.get("reports/retention-percentage",h)},getRetentionValue({aggregationField:e,aggregationPeriod:r,periodStart:n,periodEnd:s,includeRefunds:u=null,includeDisputes:o=null,limit:l=null,offset:a=null,sort:m=null,filter:c=null,criteria:h=null,tz:w=null}={}){const y={aggregationField:e,aggregationPeriod:r,periodStart:n,periodEnd:s,includeRefunds:u,includeDisputes:o,limit:l,offset:a,sort:m,filter:c,criteria:h,tz:w};return t.get("reports/retention-value",y)},getRevenueWaterfall({issuedFrom:e,issuedTo:r,recognizedTo:n,limit:s=null,offset:u=null,tz:o=null}){const l={issuedFrom:e,issuedTo:r,recognizedTo:n,limit:s,offset:u,tz:o};return t.get("reports/revenue-waterfall",l)},getSubscriptionCancellation({aggregationField:e,periodStart:r,periodEnd:n,limit:s=null,offset:u=null,filter:o=null,criteria:l=null,tz:a=null}={}){const m={aggregationField:e,periodStart:r,periodEnd:n,limit:s,offset:u,filter:o,criteria:l,tz:a};return t.get("reports/subscription-cancellation",m)},getSubscriptionRenewalList({periodStart:e,periodEnd:r,limit:n=null,offset:s=null,tz:u=null}={}){const o={periodStart:e,periodEnd:r,limit:n,offset:s,tz:u};return t.getAll("reports/subscription-renewal-list",o)},getSubscriptionRenewal({periodStart:e,periodEnd:r,limit:n=null,offset:s=null,tz:u=null}={}){const o={periodStart:e,periodEnd:r,limit:n,offset:s,tz:u};return t.get("reports/subscription-renewal",o)},getTimeSeriesTransaction({periodStart:e,periodEnd:r,type:n,subaggregate:s,limit:u=null,offset:o=null}={}){const l={periodStart:e,periodEnd:r,type:n,subaggregate:s,limit:u,offset:o};return t.get("reports/time-series-transaction",l)},getTransactionsTimeDispute({aggregationField:e,periodStart:r,periodEnd:n,limit:s=null,offset:u=null,filter:o=null,criteria:l=null,tz:a=null}={}){const m={aggregationField:e,periodStart:r,periodEnd:n,limit:s,offset:u,filter:o,criteria:l,tz:a};return t.get("reports/transactions-time-dispute",m)},getTransactions({aggregationField:e,periodStart:r,periodEnd:n,limit:s=null,offset:u=null,filter:o=null,criteria:l=null,tz:a=null}={}){const m={aggregationField:e,periodStart:r,periodEnd:n,limit:s,offset:u,filter:o,criteria:l,tz:a};return t.get("reports/transactions",m)}}}function ys({apiHandler:t}){return{getSubscriptionSummaryMetrics({subscriptionId:e=""}={}){const r={subscriptionId:e};return t.get(`subscriptions/${e}/summary-metrics`,r)}}}function $s({apiHandler:t}){return{getActivityFeed({eventTypes:e=null,limit:r=1e3,offset:n=0}){const s={eventTypes:e,limit:r,offset:n};return t.getAll("activity-feed",s)},getTransaction({id:e="",eventTypes:r=null,limit:n=1e3,offset:s=0}){const u={eventTypes:r,limit:n,offset:s};return t.getAll(`transactions/${e}/timeline`,u)},getCustomer({id:e="",eventTypes:r=null,limit:n=1e3,offset:s=0}){const u={eventTypes:r,limit:n,offset:s};return t.getAll(`customers/${e}/timeline`,u)}}}function bs({apiHandler:t}){return{query(){return t.get("location")}}}const N={CustomersResource:gs,DataExportsResource:hs,HistogramsResource:ps,ReportsResource:ds,SubscriptionsResource:ys,TimelinesResource:$s,LocationResource:bs};class As{constructor({apiHandler:e}){this.customers=N.CustomersResource({apiHandler:e}),this.dataExports=N.DataExportsResource({apiHandler:e}),this.histograms=N.HistogramsResource({apiHandler:e}),this.reports=N.ReportsResource({apiHandler:e}),this.subscriptions=N.SubscriptionsResource({apiHandler:e}),this.timelines=N.TimelinesResource({apiHandler:e}),this.location=N.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 vs({apiHandler:t}){return{get(){return t.get("account")},update({data:e}){return t.patch("account",e)},requestPasswordReset({data:e}){return t.post("account/forgot-password",e)},changePassword({data:e}){return t.patch("account/password",e)},resendEmailVerification({data:e}){return t.post("account/resend-verification",e)},confirmPasswordReset({token:e,data:r}){return t.post(`account/reset-password/${e}`,r)},verifyEmail({token:e}){return t.post(`account/verification/${e}`)},register({data:e}){return t.post("register",e)}}}function ws({apiHandler:t}){return{login({data:e}){return t.post("login",e)},logout(){return t.post("logout")}}}function Rs({apiHandler:t}){return{get({slug:e}){return t.get(`billing-portals/${e}`)}}}function Es({apiHandler:t}){return{get({id:e}){return t.get(`checkout-forms/${e}`)}}}function Ss({apiHandler:t}){return{getAll({filter:e=null,sort:r=null,limit:n=null,offset:s=null,q:u=null}={}){const o={filter:e,sort:r,limit:n,offset:s,q:u};return t.getAll("invoices",o)},get({id:e}){return t.get(`invoices/${e}`)},downloadPDF({id:e}){const r={headers:Qe,responseType:"arraybuffer"};return t.download(`invoices/${e}`,r)}}}function ks({apiHandler:t}){return{getAll({limit:e=null,offset:r=null}={}){const n={limit:e,offset:r};return t.getAll("kyc-documents",n)},create({data:e}){return t.post("kyc-documents",e)},get({id:e}){return t.get(`kyc-documents/${e}`)},update({id:e,data:r}){return t.patch(`kyc-documents/${e}`,r)}}}function Cs({apiHandler:t}){return{get({id:e}){return t.get(`kyc-requests/${e}`)}}}function Ts({apiHandler:t}){return{getAll({filter:e=null,sort:r=null,limit:n=null,offset:s=null,q:u=null}={}){const o={filter:e,sort:r,limit:n,offset:s,q:u};return t.getAll("orders",o)},get({id:e}){return t.get(`orders/${e}`)},update({id:e,data:r}){return t.patch(`orders/${e}`,r)},cancel({id:e,data:r}){return t.post(`orders/${e}/cancellation`,r)}}}function xs({apiHandler:t}){return{getAll({filter:e=null,sort:r=null,limit:n=null,offset:s=null,q:u=null}={}){const o={filter:e,sort:r,limit:n,offset:s,q:u};return t.getAll("payment-instruments",o)},create({data:e}){return t.post("payment-instruments",e)},get({id:e,limit:r=null,offset:n=null}){const s={limit:r,offset:n};return t.get(`payment-instruments/${e}`,s)},update({id:e,data:r}){return t.patch(`payment-instruments/${e}`,r)},deactivate({id:e}){return t.post(`payment-instruments/${e}/deactivation`)},getSetupTransaction({id:e}){return t.get(`payment-instruments/${e}/setup`)},setup({id:e,data:r}){return t.post(`payment-instruments/${e}/setup`,r)}}}function Is({apiHandler:t}){return{getAll({filter:e=null,sort:r=null,limit:n=null,offset:s=null,q:u=null}={}){const o={filter:e,sort:r,limit:n,offset:s,q:u};return t.getAll("plans",o)},get({id:e}){return t.get(`plans/${e}`)}}}function Ps({apiHandler:t}){return{getAll({filter:e=null,sort:r=null,limit:n=null,offset:s=null,q:u=null}={}){const o={filter:e,sort:r,limit:n,offset:s,q:u};return t.getAll("products",o)},get({id:e}){return t.get(`products/${e}`)}}}function Os({apiHandler:t}){return{payment({data:e}){return t.post("payment",e)},purchase({data:e}){return t.post("purchase",e)},preview({data:e}){return t.post("preview-purchase",e)},readyToPay({data:e}){return t.post("ready-to-pay",e)}}}function js({apiHandler:t}){return{getAll({limit:e=null,offset:r=null,filter:n=null,q:s=null,sort:u=null}={}){const o={limit:e,offset:r,filter:n,q:s,sort:u};return t.getAll("transactions",o)},get({id:e}){return t.get(`transactions/${e}`)},update({id:e,data:r}){return t.patch(`transactions/${e}`,r)}}}function qs({apiHandler:t}){return{get({id:e}){return t.get(`websites/${e}`)}}}class Ds{constructor({apiHandler:e}){this.account=vs({apiHandler:e}),this.authorization=ws({apiHandler:e}),this.billingPortals=Rs({apiHandler:e}),this.checkoutForms=Es({apiHandler:e}),this.invoices=Ss({apiHandler:e}),this.kycDocuments=ks({apiHandler:e}),this.kycRequests=Cs({apiHandler:e}),this.orders=Ts({apiHandler:e}),this.paymentInstruments=xs({apiHandler:e}),this.plans=Is({apiHandler:e}),this.products=Ps({apiHandler:e}),this.purchase=Os({apiHandler:e}),this.transactions=js({apiHandler:e}),this.websites=qs({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 Ns({apiHandler:t}){return new ms({apiHandler:t})}function Ms({apiHandler:t}){return new As({apiHandler:t})}function Bs({apiHandler:t}){return new Ds({apiHandler:t})}const $e={live:"https://api.rebilly.com",sandbox:"https://api-sandbox.rebilly.com"},be=6e3;function Ze({apiKey:t=null,sandbox:e=!1,timeout:r=be,organizationId:n=null,urls:s=$e}={}){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 o=ye({options:{apiEndpoints:s,apiKey:t,apiVersion:"",isSandbox:e,requestTimeout:r,jwt:null,organizationId:n}});return Ns({apiHandler:o})}function Us({apiKey:t=null,sandbox:e=!1,timeout:r=be,organizationId:n=null,urls:s=$e}={}){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 o=ye({options:{apiEndpoints:s,apiKey:t,apiVersion:"experimental",isSandbox:e,requestTimeout:r,jwt:null,organizationId:n}});return Ms({apiHandler:o})}function Ls({publishableKey:t=null,jwt:e=null,sandbox:r=!1,timeout:n=be,organizationId:s=null,urls:u=$e}={}){if(!u.live||!u.sandbox)throw new Error("RebillyAPI urls config must include a key for both `live` and `sandbox`");if(typeof u.live!="string"||typeof u.sandbox!="string")throw new Error("RebillyAPI urls config `live` and `sandbox` must be strings");const o={apiEndpoints:u,publishableKey:t,jwt:e,apiVersion:"storefront",isSandbox:r,requestTimeout:n,organizationId:s},l=ye({options:o});return l.setSessionToken(o.jwt),Bs({apiHandler:l})}d.RebillyAPI=Ze,d.RebillyErrors=S,d.RebillyExperimentalAPI=Us,d.RebillyStorefrontAPI=Ls,d.cancellation=un,d.default=Ze,Object.defineProperties(d,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}})});
|