rebilly-js-sdk 47.2.0 → 47.5.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/rebilly-js-sdk.d.ts +138 -14
- package/dist/rebilly-js-sdk.es.js +20 -14
- package/dist/rebilly-js-sdk.umd.js +4 -4
- package/package.json +1 -1
package/dist/rebilly-js-sdk.d.ts
CHANGED
|
@@ -1980,8 +1980,7 @@ export interface corePaths {
|
|
|
1980
1980
|
* ID (which we recommend to prevent duplication), you
|
|
1981
1981
|
* may use our `PUT` request described below.
|
|
1982
1982
|
*
|
|
1983
|
-
*
|
|
1984
|
-
* to understand more.
|
|
1983
|
+
* For more information, see [preventing duplicates](https://www.rebilly.com/docs/billing/concept/core-concepts/#preventing-duplicates).
|
|
1985
1984
|
*/
|
|
1986
1985
|
post: operations["PostCustomer"];
|
|
1987
1986
|
};
|
|
@@ -1990,8 +1989,7 @@ export interface corePaths {
|
|
|
1990
1989
|
get: operations["GetCustomer"];
|
|
1991
1990
|
/**
|
|
1992
1991
|
* Create or update (upsert) a customer with predefined identifier string.
|
|
1993
|
-
*
|
|
1994
|
-
* to understand more.
|
|
1992
|
+
* For more information, see [preventing duplicates](https://www.rebilly.com/docs/billing/concept/core-concepts/#preventing-duplicates).
|
|
1995
1993
|
*/
|
|
1996
1994
|
put: operations["PutCustomer"];
|
|
1997
1995
|
/** Merge one duplicate customer to another target customer and delete the. former. */
|
|
@@ -3944,6 +3942,8 @@ export interface coreComponents {
|
|
|
3944
3942
|
revision?: number;
|
|
3945
3943
|
/** Indicates if EDD is enabled for this customer. */
|
|
3946
3944
|
isEddRequired: boolean;
|
|
3945
|
+
/** Whether the customer has fulfilled a KYC request by providing valid identity and address documents. */
|
|
3946
|
+
hasFulfilledKyc?: boolean;
|
|
3947
3947
|
/** The links related to resource. */
|
|
3948
3948
|
_links?: (Partial<coreComponents["schemas"]["SelfLink"]> &
|
|
3949
3949
|
Partial<coreComponents["schemas"]["DefaultPaymentInstrumentLink"]> &
|
|
@@ -4246,6 +4246,7 @@ export interface coreComponents {
|
|
|
4246
4246
|
| "JetPay"
|
|
4247
4247
|
| "Jeton"
|
|
4248
4248
|
| "Khelocard"
|
|
4249
|
+
| "Klarna"
|
|
4249
4250
|
| "Konnektive"
|
|
4250
4251
|
| "loonie"
|
|
4251
4252
|
| "LPG"
|
|
@@ -4291,6 +4292,7 @@ export interface coreComponents {
|
|
|
4291
4292
|
| "PayULatam"
|
|
4292
4293
|
| "Payvision"
|
|
4293
4294
|
| "Piastrix"
|
|
4295
|
+
| "Pin4Pay"
|
|
4294
4296
|
| "Plugnpay"
|
|
4295
4297
|
| "PostFinance"
|
|
4296
4298
|
| "PPRO"
|
|
@@ -4509,6 +4511,7 @@ export interface coreComponents {
|
|
|
4509
4511
|
| "Intuit"
|
|
4510
4512
|
| "Jeton"
|
|
4511
4513
|
| "Khelocard"
|
|
4514
|
+
| "Klarna"
|
|
4512
4515
|
| "Konnektive"
|
|
4513
4516
|
| "loonie"
|
|
4514
4517
|
| "LPG"
|
|
@@ -4552,6 +4555,7 @@ export interface coreComponents {
|
|
|
4552
4555
|
| "PayULatam"
|
|
4553
4556
|
| "Payvision"
|
|
4554
4557
|
| "Piastrix"
|
|
4558
|
+
| "Pin4Pay"
|
|
4555
4559
|
| "Peoples Trust Company"
|
|
4556
4560
|
| "PostFinance"
|
|
4557
4561
|
| "PPRO"
|
|
@@ -4723,6 +4727,13 @@ export interface coreComponents {
|
|
|
4723
4727
|
* The 2 placeholders are available to use in this URI: `{id}` and `{result}`.
|
|
4724
4728
|
*/
|
|
4725
4729
|
TransactionNotificationUrl: string;
|
|
4730
|
+
TransactionLimitAmount: {
|
|
4731
|
+
/** The limit amount. */
|
|
4732
|
+
amount?: number;
|
|
4733
|
+
currency?: coreComponents["schemas"]["CurrencyCode"];
|
|
4734
|
+
/** The date and time in which the limit amount resets. This value may be used for some user interfaces. */
|
|
4735
|
+
resetTime?: string;
|
|
4736
|
+
} | null;
|
|
4726
4737
|
GatewayAccountLink: coreComponents["schemas"]["Link"] & {
|
|
4727
4738
|
/** The link type. */
|
|
4728
4739
|
rel: "gatewayAccount";
|
|
@@ -4890,6 +4901,7 @@ export interface coreComponents {
|
|
|
4890
4901
|
settlementTime?: string | null;
|
|
4891
4902
|
/** The time of the most recent discrepancy on the transaction. */
|
|
4892
4903
|
discrepancyTime?: string | null;
|
|
4904
|
+
limits?: coreComponents["schemas"]["TransactionLimitAmount"];
|
|
4893
4905
|
/** The links related to resource. */
|
|
4894
4906
|
_links?: (Partial<coreComponents["schemas"]["SelfLink"]> &
|
|
4895
4907
|
Partial<coreComponents["schemas"]["WebsiteLink"]> &
|
|
@@ -5351,6 +5363,10 @@ export interface coreComponents {
|
|
|
5351
5363
|
settings?: {
|
|
5352
5364
|
/** Enable MOTO option (Mail-Order-Telephone-Order). */
|
|
5353
5365
|
enableMoto: boolean;
|
|
5366
|
+
/** Sales tax amount as a decimal to send with level 2/3 data. */
|
|
5367
|
+
salesTaxAmount?: number;
|
|
5368
|
+
/** The Rebilly custom field to use for sending transaction metadata. */
|
|
5369
|
+
metadataCustomField?: string;
|
|
5354
5370
|
};
|
|
5355
5371
|
};
|
|
5356
5372
|
/** BraintreePayments Gateway config. */
|
|
@@ -6222,6 +6238,21 @@ export interface coreComponents {
|
|
|
6222
6238
|
apiSecret: string;
|
|
6223
6239
|
};
|
|
6224
6240
|
};
|
|
6241
|
+
/** Klarna config. */
|
|
6242
|
+
Klarna: coreComponents["schemas"]["GatewayAccount"] & {
|
|
6243
|
+
/** Credentials object. */
|
|
6244
|
+
credentials: {
|
|
6245
|
+
/** Klarna API username. */
|
|
6246
|
+
username: string;
|
|
6247
|
+
/** Klarna API password. */
|
|
6248
|
+
password: string;
|
|
6249
|
+
};
|
|
6250
|
+
/** Settings object. */
|
|
6251
|
+
settings: {
|
|
6252
|
+
/** Klarna API region. */
|
|
6253
|
+
region: "EU" | "NA" | "OC";
|
|
6254
|
+
};
|
|
6255
|
+
};
|
|
6225
6256
|
/** Konnektive config. */
|
|
6226
6257
|
Konnektive: coreComponents["schemas"]["GatewayAccount"] & {
|
|
6227
6258
|
/** Credentials object. */
|
|
@@ -6677,6 +6708,7 @@ export interface coreComponents {
|
|
|
6677
6708
|
PaymentsOS: coreComponents["schemas"]["GatewayAccount"] & {
|
|
6678
6709
|
credentials: {
|
|
6679
6710
|
appId: string;
|
|
6711
|
+
publicKey: string;
|
|
6680
6712
|
privateKey: string;
|
|
6681
6713
|
};
|
|
6682
6714
|
};
|
|
@@ -6806,6 +6838,20 @@ export interface coreComponents {
|
|
|
6806
6838
|
};
|
|
6807
6839
|
threeDSecureServer?: coreComponents["schemas"]["Piastrix3dsServers"];
|
|
6808
6840
|
};
|
|
6841
|
+
/** Pin4Pay config. */
|
|
6842
|
+
Pin4Pay: coreComponents["schemas"]["GatewayAccount"] & {
|
|
6843
|
+
/** Credentials object. */
|
|
6844
|
+
credentials: {
|
|
6845
|
+
/** Pin4Pay API username. */
|
|
6846
|
+
username: string;
|
|
6847
|
+
/** Pin4Pay API requestOrigin. */
|
|
6848
|
+
requestOrigin: string;
|
|
6849
|
+
/** Pin4Pay API codigoCliente. */
|
|
6850
|
+
codigoCliente: string;
|
|
6851
|
+
/** Pin4Pay API password. */
|
|
6852
|
+
keyValue: string;
|
|
6853
|
+
};
|
|
6854
|
+
};
|
|
6809
6855
|
/** Plugnpay Gateway config. */
|
|
6810
6856
|
Plugnpay: coreComponents["schemas"]["GatewayAccount"] & {
|
|
6811
6857
|
credentials: {
|
|
@@ -9049,6 +9095,11 @@ export interface coreComponents {
|
|
|
9049
9095
|
matchLevel?: number;
|
|
9050
9096
|
/** The settings used to score the document. */
|
|
9051
9097
|
settings?: { [key: string]: any } | null;
|
|
9098
|
+
/**
|
|
9099
|
+
* The number of times the KYC document data has been modified.
|
|
9100
|
+
* The revision is useful when analyzing webhook data to determine if the change takes precedence over the current representation.
|
|
9101
|
+
*/
|
|
9102
|
+
revision?: number;
|
|
9052
9103
|
};
|
|
9053
9104
|
KycRequest: coreComponents["schemas"]["CommonKycRequest"] & {
|
|
9054
9105
|
/** The customer ID. */
|
|
@@ -9060,6 +9111,8 @@ export interface coreComponents {
|
|
|
9060
9111
|
* The value of `1` is less strict and `2` is strict.
|
|
9061
9112
|
*/
|
|
9062
9113
|
matchLevel: number;
|
|
9114
|
+
/** The number of times the KYC request data has been modified. The revision is useful when analyzing webhook data to determine if the change takes precedence over the current representation. */
|
|
9115
|
+
revision?: number;
|
|
9063
9116
|
/** The links related to the resource. */
|
|
9064
9117
|
_links?: (Partial<coreComponents["schemas"]["SelfLink"]> &
|
|
9065
9118
|
Partial<coreComponents["schemas"]["KycDocumentsLink"]> &
|
|
@@ -10450,9 +10503,9 @@ export interface coreComponents {
|
|
|
10450
10503
|
/** The time the transaction was processed. Can be specified only if transaction was processed outside Rebilly. */
|
|
10451
10504
|
processedTime?: string;
|
|
10452
10505
|
};
|
|
10453
|
-
TransactionRequest:
|
|
10454
|
-
|
|
10455
|
-
|
|
10506
|
+
TransactionRequest: { [key: string]: any } & {
|
|
10507
|
+
/** If the value is `true`, this operation upserts (creates or updates) a customer. If the value is `false`, the `customerId` already exists, and the related customer is not updated. */
|
|
10508
|
+
upsertCustomer: boolean;
|
|
10456
10509
|
/**
|
|
10457
10510
|
* The type of transaction requested.
|
|
10458
10511
|
* You should always include the type within your API request.
|
|
@@ -10461,7 +10514,8 @@ export interface coreComponents {
|
|
|
10461
10514
|
* The `setup` type will set up the payment instrument by following the `setupInstruction` in the selected gateway account. If the instruction is to `do-nothing`, a transaction with result `approved` of type `setup` will be returned.
|
|
10462
10515
|
*/
|
|
10463
10516
|
type?: "3ds-authentication" | "sale" | "authorize" | "setup";
|
|
10464
|
-
|
|
10517
|
+
limits?: coreComponents["schemas"]["TransactionLimitAmount"];
|
|
10518
|
+
} & coreComponents["schemas"]["CommonTransactionRequest"];
|
|
10465
10519
|
PayoutRequest: coreComponents["schemas"]["CommonTransactionRequest"];
|
|
10466
10520
|
TransactionQuery: {
|
|
10467
10521
|
/** Transaction result. */
|
|
@@ -12216,8 +12270,7 @@ export interface operations {
|
|
|
12216
12270
|
* ID (which we recommend to prevent duplication), you
|
|
12217
12271
|
* may use our `PUT` request described below.
|
|
12218
12272
|
*
|
|
12219
|
-
*
|
|
12220
|
-
* to understand more.
|
|
12273
|
+
* For more information, see [preventing duplicates](https://www.rebilly.com/docs/billing/concept/core-concepts/#preventing-duplicates).
|
|
12221
12274
|
*/
|
|
12222
12275
|
PostCustomer: {
|
|
12223
12276
|
responses: {
|
|
@@ -12261,8 +12314,7 @@ export interface operations {
|
|
|
12261
12314
|
};
|
|
12262
12315
|
/**
|
|
12263
12316
|
* Create or update (upsert) a customer with predefined identifier string.
|
|
12264
|
-
*
|
|
12265
|
-
* to understand more.
|
|
12317
|
+
* For more information, see [preventing duplicates](https://www.rebilly.com/docs/billing/concept/core-concepts/#preventing-duplicates).
|
|
12266
12318
|
*/
|
|
12267
12319
|
PutCustomer: {
|
|
12268
12320
|
parameters: {
|
|
@@ -17705,6 +17757,8 @@ export interface usersComponents {
|
|
|
17705
17757
|
revision?: number;
|
|
17706
17758
|
/** Indicates if EDD is enabled for this customer. */
|
|
17707
17759
|
isEddRequired: boolean;
|
|
17760
|
+
/** Whether the customer has fulfilled a KYC request by providing valid identity and address documents. */
|
|
17761
|
+
hasFulfilledKyc?: boolean;
|
|
17708
17762
|
/** The links related to resource. */
|
|
17709
17763
|
_links?: (Partial<usersComponents["schemas"]["SelfLink"]> &
|
|
17710
17764
|
Partial<usersComponents["schemas"]["DefaultPaymentInstrumentLink"]> &
|
|
@@ -17904,6 +17958,7 @@ export interface usersComponents {
|
|
|
17904
17958
|
| "JetPay"
|
|
17905
17959
|
| "Jeton"
|
|
17906
17960
|
| "Khelocard"
|
|
17961
|
+
| "Klarna"
|
|
17907
17962
|
| "Konnektive"
|
|
17908
17963
|
| "loonie"
|
|
17909
17964
|
| "LPG"
|
|
@@ -17949,6 +18004,7 @@ export interface usersComponents {
|
|
|
17949
18004
|
| "PayULatam"
|
|
17950
18005
|
| "Payvision"
|
|
17951
18006
|
| "Piastrix"
|
|
18007
|
+
| "Pin4Pay"
|
|
17952
18008
|
| "Plugnpay"
|
|
17953
18009
|
| "PostFinance"
|
|
17954
18010
|
| "PPRO"
|
|
@@ -18167,6 +18223,7 @@ export interface usersComponents {
|
|
|
18167
18223
|
| "Intuit"
|
|
18168
18224
|
| "Jeton"
|
|
18169
18225
|
| "Khelocard"
|
|
18226
|
+
| "Klarna"
|
|
18170
18227
|
| "Konnektive"
|
|
18171
18228
|
| "loonie"
|
|
18172
18229
|
| "LPG"
|
|
@@ -18210,6 +18267,7 @@ export interface usersComponents {
|
|
|
18210
18267
|
| "PayULatam"
|
|
18211
18268
|
| "Payvision"
|
|
18212
18269
|
| "Piastrix"
|
|
18270
|
+
| "Pin4Pay"
|
|
18213
18271
|
| "Peoples Trust Company"
|
|
18214
18272
|
| "PostFinance"
|
|
18215
18273
|
| "PPRO"
|
|
@@ -18381,6 +18439,13 @@ export interface usersComponents {
|
|
|
18381
18439
|
* The 2 placeholders are available to use in this URI: `{id}` and `{result}`.
|
|
18382
18440
|
*/
|
|
18383
18441
|
TransactionNotificationUrl: string;
|
|
18442
|
+
TransactionLimitAmount: {
|
|
18443
|
+
/** The limit amount. */
|
|
18444
|
+
amount?: number;
|
|
18445
|
+
currency?: usersComponents["schemas"]["CurrencyCode"];
|
|
18446
|
+
/** The date and time in which the limit amount resets. This value may be used for some user interfaces. */
|
|
18447
|
+
resetTime?: string;
|
|
18448
|
+
} | null;
|
|
18384
18449
|
GatewayAccountLink: usersComponents["schemas"]["Link"] & {
|
|
18385
18450
|
/** The link type. */
|
|
18386
18451
|
rel: "gatewayAccount";
|
|
@@ -18548,6 +18613,7 @@ export interface usersComponents {
|
|
|
18548
18613
|
settlementTime?: string | null;
|
|
18549
18614
|
/** The time of the most recent discrepancy on the transaction. */
|
|
18550
18615
|
discrepancyTime?: string | null;
|
|
18616
|
+
limits?: usersComponents["schemas"]["TransactionLimitAmount"];
|
|
18551
18617
|
/** The links related to resource. */
|
|
18552
18618
|
_links?: (Partial<usersComponents["schemas"]["SelfLink"]> &
|
|
18553
18619
|
Partial<usersComponents["schemas"]["WebsiteLink"]> &
|
|
@@ -19009,6 +19075,10 @@ export interface usersComponents {
|
|
|
19009
19075
|
settings?: {
|
|
19010
19076
|
/** Enable MOTO option (Mail-Order-Telephone-Order). */
|
|
19011
19077
|
enableMoto: boolean;
|
|
19078
|
+
/** Sales tax amount as a decimal to send with level 2/3 data. */
|
|
19079
|
+
salesTaxAmount?: number;
|
|
19080
|
+
/** The Rebilly custom field to use for sending transaction metadata. */
|
|
19081
|
+
metadataCustomField?: string;
|
|
19012
19082
|
};
|
|
19013
19083
|
};
|
|
19014
19084
|
/** BraintreePayments Gateway config. */
|
|
@@ -19880,6 +19950,21 @@ export interface usersComponents {
|
|
|
19880
19950
|
apiSecret: string;
|
|
19881
19951
|
};
|
|
19882
19952
|
};
|
|
19953
|
+
/** Klarna config. */
|
|
19954
|
+
Klarna: usersComponents["schemas"]["GatewayAccount"] & {
|
|
19955
|
+
/** Credentials object. */
|
|
19956
|
+
credentials: {
|
|
19957
|
+
/** Klarna API username. */
|
|
19958
|
+
username: string;
|
|
19959
|
+
/** Klarna API password. */
|
|
19960
|
+
password: string;
|
|
19961
|
+
};
|
|
19962
|
+
/** Settings object. */
|
|
19963
|
+
settings: {
|
|
19964
|
+
/** Klarna API region. */
|
|
19965
|
+
region: "EU" | "NA" | "OC";
|
|
19966
|
+
};
|
|
19967
|
+
};
|
|
19883
19968
|
/** Konnektive config. */
|
|
19884
19969
|
Konnektive: usersComponents["schemas"]["GatewayAccount"] & {
|
|
19885
19970
|
/** Credentials object. */
|
|
@@ -20335,6 +20420,7 @@ export interface usersComponents {
|
|
|
20335
20420
|
PaymentsOS: usersComponents["schemas"]["GatewayAccount"] & {
|
|
20336
20421
|
credentials: {
|
|
20337
20422
|
appId: string;
|
|
20423
|
+
publicKey: string;
|
|
20338
20424
|
privateKey: string;
|
|
20339
20425
|
};
|
|
20340
20426
|
};
|
|
@@ -20464,6 +20550,20 @@ export interface usersComponents {
|
|
|
20464
20550
|
};
|
|
20465
20551
|
threeDSecureServer?: usersComponents["schemas"]["Piastrix3dsServers"];
|
|
20466
20552
|
};
|
|
20553
|
+
/** Pin4Pay config. */
|
|
20554
|
+
Pin4Pay: usersComponents["schemas"]["GatewayAccount"] & {
|
|
20555
|
+
/** Credentials object. */
|
|
20556
|
+
credentials: {
|
|
20557
|
+
/** Pin4Pay API username. */
|
|
20558
|
+
username: string;
|
|
20559
|
+
/** Pin4Pay API requestOrigin. */
|
|
20560
|
+
requestOrigin: string;
|
|
20561
|
+
/** Pin4Pay API codigoCliente. */
|
|
20562
|
+
codigoCliente: string;
|
|
20563
|
+
/** Pin4Pay API password. */
|
|
20564
|
+
keyValue: string;
|
|
20565
|
+
};
|
|
20566
|
+
};
|
|
20467
20567
|
/** Plugnpay Gateway config. */
|
|
20468
20568
|
Plugnpay: usersComponents["schemas"]["GatewayAccount"] & {
|
|
20469
20569
|
credentials: {
|
|
@@ -30172,6 +30272,7 @@ export interface storefrontComponents {
|
|
|
30172
30272
|
| "JetPay"
|
|
30173
30273
|
| "Jeton"
|
|
30174
30274
|
| "Khelocard"
|
|
30275
|
+
| "Klarna"
|
|
30175
30276
|
| "Konnektive"
|
|
30176
30277
|
| "loonie"
|
|
30177
30278
|
| "LPG"
|
|
@@ -30217,6 +30318,7 @@ export interface storefrontComponents {
|
|
|
30217
30318
|
| "PayULatam"
|
|
30218
30319
|
| "Payvision"
|
|
30219
30320
|
| "Piastrix"
|
|
30321
|
+
| "Pin4Pay"
|
|
30220
30322
|
| "Plugnpay"
|
|
30221
30323
|
| "PostFinance"
|
|
30222
30324
|
| "PPRO"
|
|
@@ -35132,6 +35234,9 @@ declare module "resources/users-resource" {
|
|
|
35132
35234
|
id: any;
|
|
35133
35235
|
data: any;
|
|
35134
35236
|
}): rebilly.PutUserResponsePromise;
|
|
35237
|
+
getMfa({ id }: {
|
|
35238
|
+
id: any;
|
|
35239
|
+
}): rebilly.GetUserMfaResponsePromise;
|
|
35135
35240
|
updatePassword({ id, data }: {
|
|
35136
35241
|
id: any;
|
|
35137
35242
|
data: any;
|
|
@@ -36781,6 +36886,9 @@ declare module "resources/api-instance" {
|
|
|
36781
36886
|
id: any;
|
|
36782
36887
|
data: any;
|
|
36783
36888
|
}): rebilly.PutUserResponsePromise;
|
|
36889
|
+
getMfa({ id }: {
|
|
36890
|
+
id: any;
|
|
36891
|
+
}): rebilly.GetUserMfaResponsePromise;
|
|
36784
36892
|
updatePassword({ id, data }: {
|
|
36785
36893
|
id: any;
|
|
36786
36894
|
data: any;
|
|
@@ -36972,6 +37080,13 @@ declare module "resources/experimental/reports-resource" {
|
|
|
36972
37080
|
periodStart: any;
|
|
36973
37081
|
periodEnd: any;
|
|
36974
37082
|
}): any;
|
|
37083
|
+
getMonthlyRecurringRevenue({ periodStart, periodEnd, limit, offset, tz }?: {
|
|
37084
|
+
periodStart: any;
|
|
37085
|
+
periodEnd: any;
|
|
37086
|
+
limit?: any;
|
|
37087
|
+
offset?: any;
|
|
37088
|
+
tz?: any;
|
|
37089
|
+
}): any;
|
|
36975
37090
|
getRulesMatchedSummary({ eventType, periodStart, periodEnd, limit, offset, tz }?: {
|
|
36976
37091
|
eventType: any;
|
|
36977
37092
|
periodStart: any;
|
|
@@ -37013,7 +37128,8 @@ declare module "resources/experimental/reports-resource" {
|
|
|
37013
37128
|
criteria?: any;
|
|
37014
37129
|
tz?: any;
|
|
37015
37130
|
}): any;
|
|
37016
|
-
getRevenueWaterfall({ issuedFrom, issuedTo, recognizedTo, limit, offset, tz }: {
|
|
37131
|
+
getRevenueWaterfall({ currency, issuedFrom, issuedTo, recognizedTo, limit, offset, tz }: {
|
|
37132
|
+
currency: any;
|
|
37017
37133
|
issuedFrom: any;
|
|
37018
37134
|
issuedTo: any;
|
|
37019
37135
|
recognizedTo: any;
|
|
@@ -37231,6 +37347,13 @@ declare module "resources/experimental/experimental-resources" {
|
|
|
37231
37347
|
periodStart: any;
|
|
37232
37348
|
periodEnd: any;
|
|
37233
37349
|
}): any;
|
|
37350
|
+
getMonthlyRecurringRevenue({ periodStart, periodEnd, limit, offset, tz }?: {
|
|
37351
|
+
periodStart: any;
|
|
37352
|
+
periodEnd: any;
|
|
37353
|
+
limit?: any;
|
|
37354
|
+
offset?: any;
|
|
37355
|
+
tz?: any;
|
|
37356
|
+
}): any;
|
|
37234
37357
|
getRulesMatchedSummary({ eventType, periodStart, periodEnd, limit, offset, tz }?: {
|
|
37235
37358
|
eventType: any;
|
|
37236
37359
|
periodStart: any;
|
|
@@ -37272,7 +37395,8 @@ declare module "resources/experimental/experimental-resources" {
|
|
|
37272
37395
|
criteria?: any;
|
|
37273
37396
|
tz?: any;
|
|
37274
37397
|
}): any;
|
|
37275
|
-
getRevenueWaterfall({ issuedFrom, issuedTo, recognizedTo, limit, offset, tz }: {
|
|
37398
|
+
getRevenueWaterfall({ currency, issuedFrom, issuedTo, recognizedTo, limit, offset, tz }: {
|
|
37399
|
+
currency: any;
|
|
37276
37400
|
issuedFrom: any;
|
|
37277
37401
|
issuedTo: any;
|
|
37278
37402
|
recognizedTo: 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.5.0";
|
|
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
|
};
|
|
@@ -3819,6 +3811,9 @@ function UsersResource({ apiHandler }) {
|
|
|
3819
3811
|
update({ id, data: data2 }) {
|
|
3820
3812
|
return apiHandler.put(`users/${id}`, data2);
|
|
3821
3813
|
},
|
|
3814
|
+
getMfa({ id }) {
|
|
3815
|
+
return apiHandler.get(`users/${id}/mfa`);
|
|
3816
|
+
},
|
|
3822
3817
|
updatePassword({ id, data: data2 }) {
|
|
3823
3818
|
return apiHandler.post(`users/${id}/password`, data2);
|
|
3824
3819
|
},
|
|
@@ -4126,6 +4121,16 @@ function ReportsResource({ apiHandler }) {
|
|
|
4126
4121
|
};
|
|
4127
4122
|
return apiHandler.get(`reports/kyc-request-summary`, params);
|
|
4128
4123
|
},
|
|
4124
|
+
getMonthlyRecurringRevenue({ periodStart, periodEnd, limit = null, offset = null, tz = null } = {}) {
|
|
4125
|
+
const params = {
|
|
4126
|
+
periodStart,
|
|
4127
|
+
periodEnd,
|
|
4128
|
+
limit,
|
|
4129
|
+
offset,
|
|
4130
|
+
tz
|
|
4131
|
+
};
|
|
4132
|
+
return apiHandler.get(`reports/monthly-recurring-revenue`, params);
|
|
4133
|
+
},
|
|
4129
4134
|
getRulesMatchedSummary({ eventType, periodStart, periodEnd, limit = null, offset = null, tz = null } = {}) {
|
|
4130
4135
|
const params = {
|
|
4131
4136
|
periodStart,
|
|
@@ -4178,8 +4183,9 @@ function ReportsResource({ apiHandler }) {
|
|
|
4178
4183
|
};
|
|
4179
4184
|
return apiHandler.get(`reports/retention-value`, params);
|
|
4180
4185
|
},
|
|
4181
|
-
getRevenueWaterfall({ issuedFrom, issuedTo, recognizedTo, limit = null, offset = null, tz = null }) {
|
|
4186
|
+
getRevenueWaterfall({ currency, issuedFrom, issuedTo, recognizedTo, limit = null, offset = null, tz = null }) {
|
|
4182
4187
|
const params = {
|
|
4188
|
+
currency,
|
|
4183
4189
|
issuedFrom,
|
|
4184
4190
|
issuedTo,
|
|
4185
4191
|
recognizedTo,
|
|
@@ -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,Kt=Nt,ae=xe,Vt=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 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(_){n(_),m()},function(_){s(_),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 _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,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 _e(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 _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(c,m){c===null||typeof c=="undefined"||(M.isArray(c)?m=m+"[]":c=[c],M.forEach(c,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 c=[];c.push(r+"="+encodeURIComponent(n)),X.isNumber(s)&&c.push("expires="+new Date(s).toGMTString()),X.isString(u)&&c.push("path="+u),X.isString(o)&&c.push("domain="+o),l===!0&&c.push("secure"),document.cookie=c.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,c;function m(){e.cancelToken&&e.cancelToken.unsubscribe(c),e.signal&&e.signal.removeEventListener("abort",c)}Q.isFormData(u)&&delete o["Content-Type"];var a=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);a.open(e.method.toUpperCase(),Ut(y,e.params,e.paramsSerializer),!0),a.timeout=e.timeout;function V(){if(!!a){var E="getAllResponseHeaders"in a?Ft(a.getAllResponseHeaders()):null,P=!l||l==="text"||l==="json"?a.responseText:a.response,T={data:P,status:a.status,statusText:a.statusText,headers:E,config:e,request:a};Mt(function(z){n(z),m()},function(z){s(z),m()},T),a=null}}if("onloadend"in a?a.onloadend=V:a.onreadystatechange=function(){!a||a.readyState!==4||a.status===0&&!(a.responseURL&&a.responseURL.indexOf("file:")===0)||setTimeout(V)},a.onabort=function(){!a||(s(ae("Request aborted",e,"ECONNABORTED",a)),a=null)},a.onerror=function(){s(ae("Network Error",e,null,a)),a=null},a.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",a)),a=null},Q.isStandardBrowserEnv()){var ne=(e.withCredentials||Kt(y))&&e.xsrfCookieName?Bt.read(e.xsrfCookieName):void 0;ne&&(o[e.xsrfHeaderName]=ne)}"setRequestHeader"in a&&Q.forEach(o,function(P,T){typeof u=="undefined"&&T.toLowerCase()==="content-type"?delete o[T]:a.setRequestHeader(T,P)}),Q.isUndefined(e.withCredentials)||(a.withCredentials=!!e.withCredentials),l&&l!=="json"&&(a.responseType=e.responseType),typeof e.onDownloadProgress=="function"&&a.addEventListener("progress",e.onDownloadProgress),typeof e.onUploadProgress=="function"&&a.upload&&a.upload.addEventListener("progress",e.onUploadProgress),(e.cancelToken||e.signal)&&(c=function(E){!a||(s(!E||E&&E.type?new zt("canceled"):E),a.abort(),a=null)},e.cancelToken&&e.cancelToken.subscribe(c),e.signal&&(e.signal.aborted?c():e.signal.addEventListener("abort",c))),u||(u=null),a.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(a,h){return R.isPlainObject(a)&&R.isPlainObject(h)?R.merge(a,h):R.isPlainObject(h)?R.merge({},h):R.isArray(h)?h.slice():h}function u(a){if(R.isUndefined(r[a])){if(!R.isUndefined(e[a]))return s(void 0,e[a])}else return s(e[a],r[a])}function o(a){if(!R.isUndefined(r[a]))return s(void 0,r[a])}function l(a){if(R.isUndefined(r[a])){if(!R.isUndefined(e[a]))return s(void 0,e[a])}else return s(void 0,r[a])}function c(a){if(a in r)return s(e[a],r[a]);if(a in e)return s(void 0,e[a])}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:c};return R.forEach(Object.keys(e).concat(Object.keys(r)),function(h){var w=m[h]||u,y=w(h);R.isUndefined(y)&&w!==c||(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],c=l===void 0||o(l,u,t);if(c!==!0)throw new TypeError("option "+u+" must be "+c);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 c=[Fe,void 0];for(Array.prototype.unshift.apply(c,s),c=c.concat(o),l=Promise.resolve(r);c.length;)l=l.then(c.shift(),c.shift());return l}for(var m=r;s.length;){var a=s.shift(),h=s.shift();try{m=a(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.
|
|
@@ -29,9 +29,9 @@ var Gs=Object.defineProperty;var ut=Object.getOwnPropertySymbols;var Xs=Object.p
|
|
|
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=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.2.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 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 nn;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 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 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: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 Ks(i,f){return x({request:g=>e.patch(i,f,g),config:{}})}function Vs(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:Ks,delete:Vs,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 Kn({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 Vn({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=Kn({apiHandler:e}),this.payouts=Vn({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)},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 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.5.0";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 c(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 a(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:c,setProxyAgent:h,setSessionToken:m,setPublishableKey:a,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 c={limit:e,offset:r,filter:n,q:s,expand:u,fields:o,sort:l};return t.getAll("applications",c)},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 c={limit:r,offset:n,filter:s,q:u,fields:o,sort:l};return t.getAll(`credential-hashes/oauth2/${e}/items`,c)},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 c={limit:e,offset:r,filter:n,q:s,expand:u,fields:o,sort:l};return t.getAll("customers",c)},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:c=null}){const m={limit:r,offset:n,filter:s,q:u,sort:o,fields:l,expand:c};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:c=null}){const m={limit:r,offset:n,filter:s,q:u,sort:o,fields:l,expand:c};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 c={limit:e,offset:r,filter:n,q:s,expand:u,fields:o,sort:l};return t.getAll("attachments",c)},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 c={limit:e,offset:r,filter:n,q:s,expand:u,fields:o,sort:l};return t.getAll("files",c)},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 c=(await o).items.map(a=>this.detach({id:a.fields.id}));n=[...n,c],await Promise.all(c);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:""},c=this.update({id:o.fields.id,data:l});return n.push(c),c})();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)},getMfa({id:e}){return t.get(`users/${e}/mfa`)},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 c={limit:e,offset:r,sort:n,expand:s,filter:u,q:o,criteria:l};return t.getAll("data-exports",c)},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 c={periodStart:e,periodEnd:r,aggregationField:n,aggregationPeriod:s,metric:u,filter:o,tz:l};return t.get("histograms/transactions",c)}}}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:c=null}={}){const m={aggregationField:e,periodStart:r,periodEnd:n,limit:s,offset:u,filter:o,criteria:l,tz:c};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 c={aggregationField:e,periodStart:r,periodEnd:n,limit:s,offset:u,filter:o,tz:l};return t.get("reports/dcc-markup",c)},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)},getMonthlyRecurringRevenue({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/monthly-recurring-revenue",o)},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:c=null,criteria:m=null,tz:a=null}={}){const h={aggregationField:e,aggregationPeriod:r,periodStart:n,periodEnd:s,includeSwitchedSubscriptions:u,limit:o,offset:l,filter:c,criteria:m,tz:a};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:c=null,sort:m=null,filter:a=null,criteria:h=null,tz:w=null}={}){const y={aggregationField:e,aggregationPeriod:r,periodStart:n,periodEnd:s,includeRefunds:u,includeDisputes:o,limit:l,offset:c,sort:m,filter:a,criteria:h,tz:w};return t.get("reports/retention-value",y)},getRevenueWaterfall({currency:e,issuedFrom:r,issuedTo:n,recognizedTo:s,limit:u=null,offset:o=null,tz:l=null}){const c={currency:e,issuedFrom:r,issuedTo:n,recognizedTo:s,limit:u,offset:o,tz:l};return t.get("reports/revenue-waterfall",c)},getSubscriptionCancellation({aggregationField:e,periodStart:r,periodEnd:n,limit:s=null,offset:u=null,filter:o=null,criteria:l=null,tz:c=null}={}){const m={aggregationField:e,periodStart:r,periodEnd:n,limit:s,offset:u,filter:o,criteria:l,tz:c};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:c=null}={}){const m={aggregationField:e,periodStart:r,periodEnd:n,limit:s,offset:u,filter:o,criteria:l,tz:c};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:c=null}={}){const m={aggregationField:e,periodStart:r,periodEnd:n,limit:s,offset:u,filter:o,criteria:l,tz:c};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"}})});
|